Commit 722bf94a authored by chenhao's avatar chenhao

Merge branch 'developer' of http://172.16.10.76/moa/amos-boot-biz into developer

parents df699c7d 6efedc40
package com.yeejoin.amos.boot.biz.common.service; package com.yeejoin.amos.boot.biz.common.service;
import java.util.List;
import java.util.Map; import java.util.Map;
import com.yeejoin.amos.boot.biz.common.bo.ReginParams; import com.yeejoin.amos.boot.biz.common.bo.ReginParams;
...@@ -60,5 +61,11 @@ public interface IWorkflowExcuteService{ ...@@ -60,5 +61,11 @@ public interface IWorkflowExcuteService{
*/ */
public Object getCurrentUserAllTaskList(String key, ReginParams userInfo) throws Exception; public Object getCurrentUserAllTaskList(String key, ReginParams userInfo) throws Exception;
/**
* 根据流程id获取下一节点操作人员userId集合
* @param procressId
* @return
* @throws Exception
*/
public List<String> getUserIdsByWorkflow(String procressId, String checkLeaderId) throws Exception;
} }
...@@ -16,11 +16,8 @@ import org.typroject.tyboot.core.foundation.utils.ValidationUtil; ...@@ -16,11 +16,8 @@ import org.typroject.tyboot.core.foundation.utils.ValidationUtil;
import java.text.ParseException; import java.text.ParseException;
import java.text.SimpleDateFormat; import java.text.SimpleDateFormat;
import java.util.Date; import java.util.*;
import java.util.HashMap; import java.util.stream.Collectors;
import java.util.Map;
import java.util.Random;
import java.util.Set;
@Service @Service
public class WorkflowExcuteServiceImpl implements IWorkflowExcuteService { public class WorkflowExcuteServiceImpl implements IWorkflowExcuteService {
...@@ -267,4 +264,27 @@ public class WorkflowExcuteServiceImpl implements IWorkflowExcuteService { ...@@ -267,4 +264,27 @@ public class WorkflowExcuteServiceImpl implements IWorkflowExcuteService {
return allTaskResultList; return allTaskResultList;
} }
/**
* 根据工作流获取下一审核人角色下的所有用户ID
* @return
*/
@Override
public List<String> getUserIdsByWorkflow(String procressId, String checkLeaderId) throws Exception {
List<String> userIds = new ArrayList<>();
JSONObject teskObject = workflowFeignService.getTaskList(procressId);
JSONArray taskDetailArray = teskObject.getJSONArray(WorkFlowEnum.DATA.getCode());
for (Object obj : taskDetailArray) {
JSONObject detail = JSONObject.parseObject(JSONObject.toJSONString(obj));
JSONArray informerList = detail.getJSONArray(WorkFlowEnum.INFORMERLIST.getCode());
if (informerList.size() > 0) {
userIds = informerList.stream().map(item -> {
JSONObject jsonItem = (JSONObject) item;
return jsonItem.getString("userId");
}).collect(Collectors.toList());
} else {
userIds.add(checkLeaderId);
}
}
return userIds;
}
} }
...@@ -604,7 +604,7 @@ public class DateUtils { ...@@ -604,7 +604,7 @@ public class DateUtils {
System.out.println(dateTimeToDateStringIfTimeEndZero(dateTimeToDate(new Date())));*/ System.out.println(dateTimeToDateStringIfTimeEndZero(dateTimeToDate(new Date())));*/
//System.out.println(dateBetween(dateParse("2017-01-30", null), dateParse("2017-02-01", null))); //System.out.println(dateBetween(dateParse("2017-01-30", null), dateParse("2017-02-01", null)));
//System.out.println(dateBetweenIncludeToday(dateParse("2017-01-30", null), dateParse("2017-02-01", null))); //System.out.println(dateBetweenIncludeToday(dateParse("2017-01-30", null), dateParse("2017-02-01", null)));
System.out.println(getDate(dateParse("2017-01-17", null))); //System.out.println(getDate(dateParse("2017-01-17", null)));
/* /*
System.out.println(getDaysOfMonth(dateParse("2017-02-01", null))); System.out.println(getDaysOfMonth(dateParse("2017-02-01", null)));
System.out.println(getDaysOfYear(dateParse("2017-01-30", null)));*/ System.out.println(getDaysOfYear(dateParse("2017-01-30", null)));*/
...@@ -612,6 +612,7 @@ public class DateUtils { ...@@ -612,6 +612,7 @@ public class DateUtils {
// .MONTH_PATTERN)); // .MONTH_PATTERN));
/*System.out.println(dateFormat(maxDateOfMonth(dateParse("2016-02", "yyyy-MM")), null)); /*System.out.println(dateFormat(maxDateOfMonth(dateParse("2016-02", "yyyy-MM")), null));
System.out.println(dateFormat(minDateOfMonth(dateParse("2016-03-31", null)), null));*/ System.out.println(dateFormat(minDateOfMonth(dateParse("2016-03-31", null)), null));*/
System.out.println(secondsToTimeStr(3600));
} }
/** /**
...@@ -720,4 +721,23 @@ public class DateUtils { ...@@ -720,4 +721,23 @@ public class DateUtils {
String dateString = formatter.format(currentTime); String dateString = formatter.format(currentTime);
return dateString; return dateString;
} }
/**
* 将秒数转换为时分秒格式
* @param times
* @return
*/
public static String secondsToTimeStr(int times) {
if(times <= 0){
return "00:00:00";
}
int h = times/3600;
int m = (times-h*3600)/60;
int s = times - h*3600-m*60;
String time = "%02d:%02d:%02d";
time = String.format(time,h,m,s);
return time;
}
} }
package com.yeejoin.amos.boot.module.common.api.dto;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.Date;
/**
* @author fengwang
* @date 2021-11-01.
*/
@Data
@ApiModel(value = "性能指标详情返回vo实体", description = "性能指标详情返回vo实体")
public class EquipmentIndexDto {
@ApiModelProperty(value = "id")
private Long id;
@ApiModelProperty(value = "值")
private String value;
@ApiModelProperty(value = "equipment_id")
private String equipmentId;
@ApiModelProperty(value = "性能指标名称")
private String perfQuotaName;
@ApiModelProperty(value = "性能指标id")
private String perfQuotaDefinitionId;
@ApiModelProperty(value = "数量单位名称")
private String unitName;
@ApiModelProperty(value = "否物联指标")
private Integer isIot;
@ApiModelProperty(value = "物联指标")
private String typeName;
@ApiModelProperty(value = "物联指标ID")
private String typeCode;
@ApiModelProperty(value = "分类名称")
private String groupName;
@ApiModelProperty(value = "指标原始id,从iot平台接口获取")
private String indexId;
@ApiModelProperty(value = "性能指标")
private String perfQuotaStr;
@ApiModelProperty(value = "是否是核心参数")
private Boolean isImportentParameter;
@ApiModelProperty(value = "排序")
private Integer sortNum;
@ApiModelProperty(value = "類型")
private Integer type;
@ApiModelProperty(value = "物联nameKey")
private String nameKey;
@ApiModelProperty(value = "创建日期")
private Date createDate;
@ApiModelProperty(value = "更新日期")
private Date updateDate;
}
package com.yeejoin.amos.boot.module.common.api.dto;
import com.alibaba.excel.annotation.ExcelIgnore;
import com.alibaba.excel.annotation.ExcelProperty;
import com.yeejoin.amos.boot.biz.common.dto.BaseDto;
import com.yeejoin.amos.boot.module.common.api.entity.SourceFile;
import com.yeejoin.amos.boot.module.common.api.excel.CommonExplicitConstraint;
import com.yeejoin.amos.boot.module.common.api.excel.ExplicitConstraint;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.util.Date;
import java.util.List;
@Data
@EqualsAndHashCode(callSuper = true)
@ApiModel(value = "LinkageUnitVo", description = "联动单位")
public class LinkageUnitVo extends BaseDto {
@ExcelIgnore
private static final long serialVersionUID = 1L;
@ExcelProperty(value = "单位名称", index = 0)
@ApiModelProperty(value = "单位名称")
private String unitName;
@ExcelIgnore
@ApiModelProperty(value = "单位code")
private String unitCode;
@ExcelIgnore
@ApiModelProperty(value = "父级单位id")
private String parentId;
@ExcelProperty(value = "服务类别", index = 1)
@ExplicitConstraint(type = "LDDWLB", indexNum = 1, sourceClass = CommonExplicitConstraint.class) //动态下拉内容
@ApiModelProperty(value = "服务类别")
private String linkageUnitType;
@ExcelIgnore
@ApiModelProperty(value = "联动单位类别code")
private String linkageUnitTypeCode;
@ExcelIgnore
@ApiModelProperty(value = "行政区划")
private String administrativeDivisions;
@ExcelIgnore
@ApiModelProperty(value = "行政区划代码")
private String administrativeDivisionsCode;
@ExcelProperty(value = "地址", index = 2)
@ApiModelProperty(value = "地址")
private String address;
@ExcelProperty(value = "经度", index = 3)
@ApiModelProperty(value = "经度")
private String longitude;
@ExcelProperty(value = "纬度", index = 4)
@ApiModelProperty(value = "纬度")
private String latitude;
@ExcelProperty(value = "协议开始日期", index = 5)
@ApiModelProperty(value = "协议开始日期")
private Date agreementStartDate;
@ExcelProperty(value = "协议结束日期", index = 6)
@ApiModelProperty(value = "协议结束日期")
private Date agreementEndDate;
@ExcelProperty(value = "应急联动单位类别", index = 7)
@ExplicitConstraint(type = "YJLDDW", indexNum = 7, sourceClass = CommonExplicitConstraint.class) //动态下拉内容
@ApiModelProperty(value = "应急联动单位类别")
private String emergencyLinkageUnit;
@ExcelIgnore
@ApiModelProperty(value = "应急联动单位类别code")
private String emergencyLinkageUnitCode;
@ExcelProperty(value = "联系人", index = 8)
@ApiModelProperty(value = "联系人 ")
private String contactUser;
@ExcelProperty(value = "联系人电话", index = 9)
@ApiModelProperty(value = "联系人电话")
private String contactPhone;
@ExcelIgnore
@ApiModelProperty(value = "实例id")
private Long instanceId;
@ExcelIgnore
@ApiModelProperty(value = "组织机构代码")
private String orgCode;
@ExcelIgnore
@ApiModelProperty(value = "操作人名称")
private String recUserName;
@ExcelIgnore
@ApiModelProperty(value = "是否在协议期 ")
private String inAgreement;
@ExcelProperty(value = "消防救援能力", index = 10)
@ApiModelProperty(value = "消防救援能力")
private String fireRescueCapability;
@ExcelProperty(value = "职责_简要情况", index = 11)
@ApiModelProperty(value = "职责_简要情况")
private String responsibilitiesSituation;
@ExcelProperty(value = "应急服务内容", index = 12)
@ApiModelProperty(value = "应急服务内容")
private String emergencyServiceContent;
@ExcelProperty(value = "单位_简要情况", index = 13)
@ApiModelProperty(value = "单位_简要情况")
private String unitSituation;
@ExcelIgnore
@ApiModelProperty(value = "联动单位图片")
private List<SourceFile> image;
@ExcelIgnore
@ApiModelProperty(value = "车辆数量")
private String vehicleNumber;
@ExcelIgnore
@ApiModelProperty(value = "特岗人数")
private String personNumber;
}
package com.yeejoin.amos.boot.module.common.api.dto;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.apache.poi.ss.formula.functions.T;
/**
* @author litw
* @date 2021-11-02.
*/
@Data
public class PerfQuotaIotDTO {
@ApiModelProperty(value = "分页 ")
Page<EquipmentIndexDto> page;
/**
* 分组id
*/
private String groupName;
/**
* 装备id
*/
private Long equipmentId;
}
...@@ -105,11 +105,11 @@ public class WaterResourceDto extends BaseDto { ...@@ -105,11 +105,11 @@ public class WaterResourceDto extends BaseDto {
@ApiModelProperty(value = "实景图") @ApiModelProperty(value = "实景图")
private String realityImg; private String realityImg;
@ExcelProperty(value = "联系人姓名", index = 41) @ExcelProperty(value = "联系人姓名", index = 38)
@ApiModelProperty(value = "联系人姓名") @ApiModelProperty(value = "联系人姓名")
private String contactUser; private String contactUser;
@ExcelProperty(value = "联系人电话", index = 42) @ExcelProperty(value = "联系人电话", index =39)
@ApiModelProperty(value = "联系人电话") @ApiModelProperty(value = "联系人电话")
private String contactPhone; private String contactPhone;
...@@ -289,15 +289,16 @@ public class WaterResourceDto extends BaseDto { ...@@ -289,15 +289,16 @@ public class WaterResourceDto extends BaseDto {
@ApiModelProperty(value = "停车数量(个)") @ApiModelProperty(value = "停车数量(个)")
private Integer parkingNum; private Integer parkingNum;
@ExcelProperty(value = "储水量容积", index = 38) // 物联参数改为动态加载,原先字段作废,字段做隐藏
@ExcelIgnore
@ApiModelProperty(value = "储水量容积物联编码") @ApiModelProperty(value = "储水量容积物联编码")
private String iotWaterStorage; private String iotWaterStorage;
@ExcelProperty(value = "流量", index = 39) @ExcelIgnore
@ApiModelProperty(value = "流量物联编码") @ApiModelProperty(value = "流量物联编码")
private String iotFlowRate; private String iotFlowRate;
@ExcelProperty(value = "状态", index = 40) @ExcelIgnore
@ApiModelProperty(value = "状态物联编码") @ApiModelProperty(value = "状态物联编码")
private String iotStatus; private String iotStatus;
...@@ -308,7 +309,7 @@ public class WaterResourceDto extends BaseDto { ...@@ -308,7 +309,7 @@ public class WaterResourceDto extends BaseDto {
@ExcelIgnore @ExcelIgnore
@ApiModelProperty(value = "物联参数") @ApiModelProperty(value = "物联参数")
private WaterResourceIotDto waterResourceIotDto; private Map<String,Object> waterResourceIotDto;
@ExcelIgnore @ExcelIgnore
@ApiModelProperty("设施定义id") @ApiModelProperty("设施定义id")
...@@ -339,13 +340,14 @@ public class WaterResourceDto extends BaseDto { ...@@ -339,13 +340,14 @@ public class WaterResourceDto extends BaseDto {
@ApiModelProperty(value = "经度") @ApiModelProperty(value = "经度")
@ExcelProperty(value = "经度", index = 43) @ExcelProperty(value = "经度", index = 40)
private Double longitude; private Double longitude;
@ApiModelProperty(value = "纬度") @ApiModelProperty(value = "纬度")
@ExcelProperty(value = "纬度", index = 44) @ExcelProperty(value = "纬度", index = 41)
private Double latitude; private Double latitude;
@ExcelIgnore
@ApiModelProperty(value = "附件") @ApiModelProperty(value = "附件")
@TableField(exist = false) @TableField(exist = false)
private Map<String, List<AttachmentDto>> attachments; private Map<String, List<AttachmentDto>> attachments;
......
package com.yeejoin.amos.boot.module.common.api.dto;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
* @author ltw
* @date 2021-11-02.
*/
@Data
public class WaterResourceDyDto {
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "表单key")
private String key;
@ApiModelProperty(value = "表单名称")
private String label;
@ApiModelProperty(value = "表单类型")
private String type;
@ApiModelProperty(value = "是否一行显示")
private Boolean block;
@ApiModelProperty(value = "是否隱藏")
private Boolean hide;
@ApiModelProperty(value = "表单值")
private String data;
public WaterResourceDyDto() {
}
}
package com.yeejoin.amos.boot.module.common.api.dto;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import com.yeejoin.amos.boot.biz.common.dto.BaseDto;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.util.Date;
/**
* 消防水源物联参数
*
* @author litw
* @date 2021-11-02
*/
@Data
@EqualsAndHashCode(callSuper = true)
@ApiModel(value="WaterResourceIndexDto", description="消防水源物联参数")
public class WaterResourceIndexDto extends BaseDto {
private static final long serialVersionUID = 1L;
private Long id;
@ApiModelProperty(value = "指标拥有者ID:关联装备定义ID")
private Long equipmentId;
@ApiModelProperty(value = "消防水源id")
private Long waterId;
@ApiModelProperty(value = "名称")
private String name;
private String nameKey;
@ApiModelProperty(value = "指标值")
private String perfValue;
}
package com.yeejoin.amos.boot.module.common.api.entity;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.yeejoin.amos.boot.biz.common.entity.BaseEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import java.util.Date;
/**
* 消防水源物联参数
*
* @author litw
* @date 2021-11-02
*/
@Data
@EqualsAndHashCode(callSuper = true)
@Accessors(chain = true)
@TableName("cb_water_resource_index")
public class WaterResourceIndex extends BaseEntity {
private static final long serialVersionUID = 1L;
/**
* 指标拥有者ID:关联装备定义ID
*/
@TableField("equipment_id")
private Long equipmentId;
/**
* 消防水源id
*/
@TableField("water_id")
private Long waterId;
/**
* 名称
*/
@TableField("name")
private String name;
/**
*
*/
@TableField("name_key")
private String nameKey;
/**
* 指标值
*/
@TableField("perf_value")
private String perfValue;
}
package com.yeejoin.amos.boot.module.common.api.feign; package com.yeejoin.amos.boot.module.common.api.feign;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.boot.module.common.api.dto.EquipmentIndexDto;
import com.yeejoin.amos.boot.module.common.api.dto.PerfQuotaIotDTO;
import com.yeejoin.amos.boot.module.common.api.dto.VideoDto; import com.yeejoin.amos.boot.module.common.api.dto.VideoDto;
import com.yeejoin.amos.component.feign.config.InnerInvokException; import com.yeejoin.amos.component.feign.config.InnerInvokException;
import org.springframework.cloud.openfeign.FeignClient; import org.springframework.cloud.openfeign.FeignClient;
...@@ -85,7 +88,8 @@ public interface EquipFeignClient { ...@@ -85,7 +88,8 @@ public interface EquipFeignClient {
@RequestParam String code , @RequestParam String code ,
@RequestParam String pageNum, @RequestParam String pageNum,
@RequestParam String pageSize, @RequestParam String pageSize,
@RequestParam Long id); @RequestParam Long id,
@RequestParam Boolean isNo );
...@@ -303,4 +307,12 @@ public interface EquipFeignClient { ...@@ -303,4 +307,12 @@ public interface EquipFeignClient {
*/ */
@RequestMapping(value = "/confirmAlarm/getMonitorEvent", method = RequestMethod.GET) @RequestMapping(value = "/confirmAlarm/getMonitorEvent", method = RequestMethod.GET)
ResponseModel<Map<String, Object>> getMonitorEvent(); ResponseModel<Map<String, Object>> getMonitorEvent();
/**
* 装备定义性能参数列表分页查询
*
* @return
*/
@RequestMapping(value = "/perf-quota/listAll", method = RequestMethod.POST)
ResponseModel<List<EquipmentIndexDto>> getEquipmentIndexDto(@RequestBody PerfQuotaIotDTO perfQuotaIotDTO);
} }
package com.yeejoin.amos.boot.module.common.api.mapper;
import com.yeejoin.amos.boot.module.common.api.entity.WaterResourceIndex;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
/**
* 消防水源物联参数 Mapper 接口
*
* @author litw
* @date 2021-11-02
*/
public interface WaterResourceIndexMapper extends BaseMapper<WaterResourceIndex> {
}
...@@ -117,7 +117,7 @@ public interface IOrgUsrService { ...@@ -117,7 +117,7 @@ public interface IOrgUsrService {
OrgUsrDto saveOrgPerson(OrgPersonDto OrgPersonDto) throws Exception; OrgUsrDto saveOrgPerson(OrgPersonDto OrgPersonDto) throws Exception;
void updateByIdOrgUsr(OrgUsrDto OrgUsrDto, Long id) throws Exception; OrgUsrDto updateByIdOrgUsr(OrgUsrDto OrgUsrDto, Long id) throws Exception;
void updateByIdOrgPerson(OrgPersonDto OrgPersonDto, Long id) throws Exception; void updateByIdOrgPerson(OrgPersonDto OrgPersonDto, Long id) throws Exception;
......
package com.yeejoin.amos.boot.module.common.api.service;
/**
* 消防水源物联参数接口类
*
* @author litw
* @date 2021-11-02
*/
public interface IWaterResourceIndexService {
}
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.yeejoin.amos.boot.module.common.api.mapper.WaterResourceIndexMapper">
</mapper>
package com.yeejoin.amos.boot.module.jcs.api.service;
/**
* 消防水源物联参数接口类
*
* @author litw
* @date 2021-11-02
*/
public interface IWaterResourceIndexService {
}
...@@ -66,4 +66,13 @@ public enum ExecuteTypeEnum { ...@@ -66,4 +66,13 @@ public enum ExecuteTypeEnum {
} }
return null; return null;
} }
public static String getNameByCode(Integer code) {
for (ExecuteTypeEnum e : ExecuteTypeEnum.values()) {
if (code.equals(e.getCode())) {
return e.getName();
}
}
return null;
}
} }
...@@ -56,6 +56,61 @@ public class PointClassify extends BasicEntity{ ...@@ -56,6 +56,61 @@ public class PointClassify extends BasicEntity{
@Column(name="inspection_spec_name") @Column(name="inspection_spec_name")
private String inspectionSpecName; private String inspectionSpecName;
/**
* 编号
*/
@Column(name="code")
private String code;
/**
* 分类名称
*/
@Column(name="category_name")
private String categoryName;
/**
* 分类id
*/
@Column(name="category_code")
private String categoryCode;
/**
* 位置
*/
@Column(name="address")
private String address;
/**
* 数据源code(1 消防装备 2 重点部位 3 自定义)
*/
@Column(name="data_source_code")
private String dataSourceCode;
/**
* 数据源名称(冗余)
*/
@Column(name="data_source_name")
private String dataSourceName;
/**
* 是否删除( 0未删除,1已删除 )
*/
@Column(name="is_delete")
private byte isDelete;
/**
* 建筑id
*/
@Column(name="building_id")
private String buildingId;
/**
* 建筑名称
*/
@Column(name="building_name")
private String buildingName;
public String getEquipmentId() { public String getEquipmentId() {
return equipmentId; return equipmentId;
} }
...@@ -115,4 +170,76 @@ public class PointClassify extends BasicEntity{ ...@@ -115,4 +170,76 @@ public class PointClassify extends BasicEntity{
public void setOriginalId(String originalId) { public void setOriginalId(String originalId) {
this.originalId = originalId; this.originalId = originalId;
} }
public String getCode() {
return code;
}
public void setCode(String code) {
this.code = code;
}
public String getCategoryName() {
return categoryName;
}
public void setCategoryName(String categoryName) {
this.categoryName = categoryName;
}
public String getAddress() {
return address;
}
public void setAddress(String address) {
this.address = address;
}
public String getDataSourceCode() {
return dataSourceCode;
}
public void setDataSourceCode(String dataSourceCode) {
this.dataSourceCode = dataSourceCode;
}
public String getDataSourceName() {
return dataSourceName;
}
public void setDataSourceName(String dataSourceName) {
this.dataSourceName = dataSourceName;
}
public byte getIsDelete() {
return isDelete;
}
public void setIsDelete(byte isDelete) {
this.isDelete = isDelete;
}
public String getBuildingId() {
return buildingId;
}
public void setBuildingId(String buildingId) {
this.buildingId = buildingId;
}
public String getBuildingName() {
return buildingName;
}
public void setBuildingName(String buildingName) {
this.buildingName = buildingName;
}
public String getCategoryCode() {
return categoryCode;
}
public void setCategoryCode(String categoryCode) {
this.categoryCode = categoryCode;
}
} }
\ No newline at end of file
...@@ -24,6 +24,9 @@ public class AlertPaperInfoDto { ...@@ -24,6 +24,9 @@ public class AlertPaperInfoDto {
@ApiModelProperty(value = "警情类别code") @ApiModelProperty(value = "警情类别code")
private String alarmTypeCode; private String alarmTypeCode;
@ApiModelProperty(value = "警情类别")
private String alarmType;
@ApiModelProperty(value = "所属区域") @ApiModelProperty(value = "所属区域")
private String area; private String area;
......
package com.yeejoin.amos.boot.module.tzs.api.dto; package com.yeejoin.amos.boot.module.tzs.api.dto;
import com.baomidou.mybatisplus.annotation.TableField;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import com.yeejoin.amos.boot.biz.common.dto.BaseDto; import com.yeejoin.amos.boot.biz.common.dto.BaseDto;
...@@ -42,4 +43,7 @@ public class RepairConsultDto extends BaseDto { ...@@ -42,4 +43,7 @@ public class RepairConsultDto extends BaseDto {
@ApiModelProperty(value = "警情阶段code") @ApiModelProperty(value = "警情阶段code")
private String alertStageCode; private String alertStageCode;
@ApiModelProperty(value = "阶段附件")
private String attachment;
} }
...@@ -54,4 +54,13 @@ public class VoiceRecordFileDto extends BaseDto { ...@@ -54,4 +54,13 @@ public class VoiceRecordFileDto extends BaseDto {
@ApiModelProperty(value = "通话记录id") @ApiModelProperty(value = "通话记录id")
private String connectId; private String connectId;
@ApiModelProperty(value = "关联工单编号")
private String workNum;
@ApiModelProperty(value = "通话开始时间str")
private String telStartTimeStr;
@ApiModelProperty(value = "通话结束时间str")
private String telEndTimeStr;
} }
package com.yeejoin.amos.boot.module.tzs.api.entity; package com.yeejoin.amos.boot.module.tzs.api.entity;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
import lombok.experimental.Accessors; import lombok.experimental.Accessors;
import org.springframework.data.annotation.Id; import org.springframework.data.annotation.Id;
...@@ -96,4 +97,11 @@ public class ESAlertCalled { ...@@ -96,4 +97,11 @@ public class ESAlertCalled {
@Field(type = FieldType.Text) @Field(type = FieldType.Text)
private String emergencyCall; private String emergencyCall;
/**
* 所属区域编码
*/
@Field(type = FieldType.Text)
private String regionCode;
} }
...@@ -64,4 +64,10 @@ public class RepairConsult extends BaseEntity { ...@@ -64,4 +64,10 @@ public class RepairConsult extends BaseEntity {
@TableField("alert_stage_code") @TableField("alert_stage_code")
private String alertStageCode; private String alertStageCode;
/**
* 阶段附件
*/
@TableField("attachment")
private String attachment;
} }
...@@ -76,4 +76,11 @@ public class VoiceRecordFile extends BaseEntity { ...@@ -76,4 +76,11 @@ public class VoiceRecordFile extends BaseEntity {
@TableField("alert_stage_code") @TableField("alert_stage_code")
private String alertStageCode; private String alertStageCode;
/**
* 通话时长
*/
@TableField("tel_time")
private String telTime;
} }
...@@ -5,6 +5,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage; ...@@ -5,6 +5,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.boot.module.tzs.api.dto.AlertCalledQueryDto; import com.yeejoin.amos.boot.module.tzs.api.dto.AlertCalledQueryDto;
import com.yeejoin.amos.boot.module.tzs.api.dto.AlertCalledRecordDto; import com.yeejoin.amos.boot.module.tzs.api.dto.AlertCalledRecordDto;
import com.yeejoin.amos.boot.module.tzs.api.dto.AlertPaperInfoDto;
import com.yeejoin.amos.boot.module.tzs.api.dto.WechatMyBusinessListDto; import com.yeejoin.amos.boot.module.tzs.api.dto.WechatMyBusinessListDto;
import com.yeejoin.amos.boot.module.tzs.api.dto.WechatMyBussinessDto; import com.yeejoin.amos.boot.module.tzs.api.dto.WechatMyBussinessDto;
import com.yeejoin.amos.boot.module.tzs.api.dto.WechatMyTaskListDto; import com.yeejoin.amos.boot.module.tzs.api.dto.WechatMyTaskListDto;
...@@ -101,4 +102,5 @@ public interface AlertCalledMapper extends BaseMapper<AlertCalled> { ...@@ -101,4 +102,5 @@ public interface AlertCalledMapper extends BaseMapper<AlertCalled> {
String alertSource, String alertSource,
String alarmType); String alarmType);
List<AlertPaperInfoDto> getAlertPaperInfoList(@Param("regionCodes") List<String> regionCodes,@Param("isHistory") Boolean isHistory);
} }
package com.yeejoin.amos.boot.module.tzs.api.mapper; package com.yeejoin.amos.boot.module.tzs.api.mapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.boot.module.tzs.api.dto.VoiceRecordFileDto;
import com.yeejoin.amos.boot.module.tzs.api.entity.VoiceRecordFile; import com.yeejoin.amos.boot.module.tzs.api.entity.VoiceRecordFile;
import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/** /**
* 通话记录附件 Mapper 接口 * 通话记录附件 Mapper 接口
...@@ -11,4 +16,12 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper; ...@@ -11,4 +16,12 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
*/ */
public interface VoiceRecordFileMapper extends BaseMapper<VoiceRecordFile> { public interface VoiceRecordFileMapper extends BaseMapper<VoiceRecordFile> {
Page<List<VoiceRecordFileDto>> queryRecordListByQueryDto(Page<VoiceRecordFileDto> page,
@Param("telStartTimeStr") String telStartTimeStr,
@Param("telEndTimeStr") String telEndTimeStr,
@Param("fileType") String fileType,
@Param("tel") String tel,
@Param("workNum") String workNum,
@Param("sortParam") String sortParam,
@Param("sortRule") String sortRule);
} }
package com.yeejoin.amos.boot.module.tzs.api.service; package com.yeejoin.amos.boot.module.tzs.api.service;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.boot.module.tzs.api.dto.VoiceRecordFileDto; import com.yeejoin.amos.boot.module.tzs.api.dto.VoiceRecordFileDto;
/** /**
...@@ -13,4 +14,5 @@ public interface IVoiceRecordFileService { ...@@ -13,4 +14,5 @@ public interface IVoiceRecordFileService {
void publishRecord(VoiceRecordFileDto model); void publishRecord(VoiceRecordFileDto model);
Page<VoiceRecordFileDto> queryRecordListByQueryDto(Page<VoiceRecordFileDto> page, String telEndTimeStr, String telEndTimeStr1, String fileType, String tel, String workNum, String sortParam, String sortRule);
} }
package com.yeejoin.amos.boot.module.tzs.api.service;
import java.util.List;
/**
* 特种设备权限服务类
*/
public interface TzsAuthService {
List<String> getUserRegionCode();
}
...@@ -519,7 +519,42 @@ ...@@ -519,7 +519,42 @@
</select> </select>
<select id="getAlertPaperInfoList" resultType="com.yeejoin.amos.boot.module.tzs.api.dto.AlertPaperInfoDto">
SELECT
a.sequence_nbr AS alertId,
a.region_code AS regionCode,
e.rescue_code AS rescueCode,
a.alarm_type_code AS alarmTypeCode,
a.alarm_type AS alarmType,
CONCAT(e.province ,e.city ,e.district) AS area,
a.address AS address,
a.call_time AS callTime,
e.longitude AS longitude,
e.latitude AS latitude,
a.alert_stage AS alertStatus,
e.sequence_nbr AS elevatorId,
e.register_code AS elevatorCode
FROM tz_alert_called a
LEFT JOIN tcb_elevator e ON e.sequence_nbr = a.equipment_id
WHERE a.is_delete = 0
<choose>
<when test="isHistory == true">
AND a.alert_status = 1
AND
DATE_SUB(CURDATE(), INTERVAL 7 DAY) <![CDATA[ <= ]]> date(a.call_time)
</when>
<otherwise>
<if test="regionCodes != null">
AND a.alert_status = 0
AND
<foreach collection="regionCodes" index="index" item="item" open="(" separator=" OR " close=")">
a.region_code LIKE CONCAT('%', #{item}, '%')
</foreach>
</if>
</otherwise>
</choose>
</select>
</mapper> </mapper>
......
...@@ -2,4 +2,46 @@ ...@@ -2,4 +2,46 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.yeejoin.amos.boot.module.tzs.api.mapper.VoiceRecordFileMapper"> <mapper namespace="com.yeejoin.amos.boot.module.tzs.api.mapper.VoiceRecordFileMapper">
<select id="queryRecordListByQueryDto" resultType="java.util.Map">
SELECT
r.sequence_nbr AS sequenceNbr,
r.file_path AS filePath,
r.file_type AS fileType,
r.tel AS tel,
r.tel_start_time AS telStartTime,
r.tel_end_time AS telEndTime,
r.alert_id AS alertId,
r.alert_stage AS alertStage,
r.alert_stage_code AS alertStageCode,
r.tel_time AS telTime,
a.work_order_number AS workNum
FROM
tz_voice_record_file r
LEFT JOIN tz_alert_called a ON a.sequence_nbr =
r.alert_id
WHERE r.is_delete = 0
<if test="workNum != null and workNum != ''">
AND a.work_order_number like
CONCAT(CONCAT('%',#{workNum}),'%')
</if>
<if test="telStartTimeStr != null ">
and #{telStartTimeStr} <![CDATA[ <= ]]>
r.tel_start_time
</if>
<if test="telEndTimeStr != null ">
and r.tel_end_time <![CDATA[ <= ]]>
#{telEndTimeStr}
</if>
<if test="tel != null and tel != ''">
AND r.tel like
CONCAT(CONCAT('%',#{tel}),'%')
</if>
<if test="fileType != null and fileType != ''">
AND r.file_type = #{fileType}
</if>
<if test="sortParam != null and sortParam != '' and sortRule != null and sortRule != '' ">
ORDER BY ${sortParam} ${sortRule}
</if>
</select>
</mapper> </mapper>
...@@ -1334,10 +1334,10 @@ public class CommandController extends BaseController { ...@@ -1334,10 +1334,10 @@ public class CommandController extends BaseController {
Long id =null; Long id =null;
//获取用户已绑定车辆id、 //获取用户已绑定车辆id、
UserCar userCar=userCarService.selectByAmosUserId(Long.valueOf(agencyUserModel.getUserId())); UserCar userCar=userCarService.selectByAmosUserId(Long.valueOf(agencyUserModel.getUserId()));
if(isNo!=null&&isNo){
id =userCar!=null?userCar.getCarId():null; id =userCar!=null?userCar.getCarId():null;
}
ResponseModel<Object> data= equipFeignClient.equipmentCarList(teamId,name,code , pageNum,pageSize,id); ResponseModel<Object> data= equipFeignClient.equipmentCarList(teamId,name,code , pageNum,pageSize,id,isNo);
Map map =new HashMap(); Map map =new HashMap();
map.put("select",userCar!=null?userCar.getCarId():null); map.put("select",userCar!=null?userCar.getCarId():null);
map.put("data",data!=null?data.getResult():null); map.put("data",data!=null?data.getResult():null);
......
...@@ -144,7 +144,7 @@ public class OrgUsrController extends BaseController { ...@@ -144,7 +144,7 @@ public class OrgUsrController extends BaseController {
OrgUsrVo.setBizOrgType(CommonConstant.BIZ_ORG_TYPE_COMPANY); OrgUsrVo.setBizOrgType(CommonConstant.BIZ_ORG_TYPE_COMPANY);
iOrgUsrService.updateByIdOrgUsr(OrgUsrVo, id); iOrgUsrService.updateByIdOrgUsr(OrgUsrVo, id);
return ResponseHelper.buildResponse(null); return ResponseHelper.buildResponse( iOrgUsrService.updateByIdOrgUsr(OrgUsrVo, id));
} }
......
...@@ -3,7 +3,9 @@ package com.yeejoin.amos.boot.module.common.biz.controller; ...@@ -3,7 +3,9 @@ package com.yeejoin.amos.boot.module.common.biz.controller;
import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.mysql.cj.x.protobuf.MysqlxDatatypes; import com.mysql.cj.x.protobuf.MysqlxDatatypes;
import com.yeejoin.amos.boot.biz.common.constants.BizConstant; import com.yeejoin.amos.boot.biz.common.constants.BizConstant;
...@@ -20,6 +22,9 @@ import io.swagger.annotations.ApiOperation; ...@@ -20,6 +22,9 @@ import io.swagger.annotations.ApiOperation;
import org.apache.commons.beanutils.BeanMap; import org.apache.commons.beanutils.BeanMap;
import org.apache.commons.collections.MapUtils; import org.apache.commons.collections.MapUtils;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.apache.poi.ss.formula.functions.T;
import org.checkerframework.checker.units.qual.K;
import org.openxmlformats.schemas.drawingml.x2006.chart.STRadarStyle;
import org.springframework.beans.BeanUtils; import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.util.ObjectUtils; import org.springframework.util.ObjectUtils;
...@@ -65,6 +70,10 @@ public class WaterResourceController extends BaseController { ...@@ -65,6 +70,10 @@ public class WaterResourceController extends BaseController {
WaterResourceIotServiceImpl waterResourceIotService; WaterResourceIotServiceImpl waterResourceIotService;
@Autowired @Autowired
SourceFileServiceImpl sourceFileService; SourceFileServiceImpl sourceFileService;
@Autowired
EquipFeignClient equipFeignClient;
@Autowired
WaterResourceIndexServiceImpl waterResourceIndexServiceImpl;
/** /**
* 新增 * 新增
...@@ -93,7 +102,7 @@ public class WaterResourceController extends BaseController { ...@@ -93,7 +102,7 @@ public class WaterResourceController extends BaseController {
model.setResourceTypeName(resourceTypeEnum.get().getName()); model.setResourceTypeName(resourceTypeEnum.get().getName());
model.setRealityImg(null); model.setRealityImg(null);
model.setOrientationImg(JSONArray.toJSONString(model. getOrientationImgList())); model.setOrientationImg(null);
/*2021-09-08 前端表示前端传递的address参数已经切割过,后端无需再切割获取 陈召 屏蔽代码 97-102行*/ /*2021-09-08 前端表示前端传递的address参数已经切割过,后端无需再切割获取 陈召 屏蔽代码 97-102行*/
/* if(model.getAddress()!=null){ /* if(model.getAddress()!=null){
JSONObject address = WaterResourceServiceImpl.getLongLatFromAddress(model.getAddress()); JSONObject address = WaterResourceServiceImpl.getLongLatFromAddress(model.getAddress());
...@@ -146,11 +155,17 @@ public class WaterResourceController extends BaseController { ...@@ -146,11 +155,17 @@ public class WaterResourceController extends BaseController {
break; break;
} }
// 新增物联信息 // 新增物联信息
if (model.getIsIot()) { if (null != model.getWaterResourceIotDto() && model.getWaterResourceIotDto().size()>0) {
WaterResourceIotDto waterResourceIotDto = model.getWaterResourceIotDto(); Map<String,Object> map = model.getWaterResourceIotDto();
waterResourceIotDto.setResourceType(model.getResourceType()); List<WaterResourceIndex> list = new ArrayList<>();
waterResourceIotDto.setResourceId(model.getSequenceNbr()); for (Map.Entry<String, Object> entry : map.entrySet()) {
waterResourceIotService.createWithModel(waterResourceIotDto); WaterResourceIndex waterResourceIndex1 = new WaterResourceIndex();
waterResourceIndex1.setNameKey(entry.getKey());
waterResourceIndex1.setWaterId(model.getSequenceNbr());
waterResourceIndex1.setPerfValue(entry.getValue().toString());
list.add(waterResourceIndex1);
}
waterResourceIndexServiceImpl.saveBatch(list);
} }
} else { } else {
waterResourceServiceImpl.createWithModel(model); waterResourceServiceImpl.createWithModel(model);
...@@ -161,6 +176,47 @@ public class WaterResourceController extends BaseController { ...@@ -161,6 +176,47 @@ public class WaterResourceController extends BaseController {
return ResponseHelper.buildResponse(model); return ResponseHelper.buildResponse(model);
} }
/**
* 获取关联装备定义物联参数字段
*
* @param equipmentId 设备定义id
* @return 返回结果
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping(value = "/getIotField")
@ApiOperation(httpMethod = "GET", value = "获取关联装备定义物联参数字段", notes = "获取关联装备定义物联参数字段")
public ResponseModel<Object> getIotField(Long equipmentId) {
PerfQuotaIotDTO perfQuotaIotDTO = new PerfQuotaIotDTO();
Page<EquipmentIndexDto> page = new Page<>();
page.setCurrent(1);
page.setSize(100);
perfQuotaIotDTO.setEquipmentId(equipmentId);
perfQuotaIotDTO.setGroupName("");
perfQuotaIotDTO.setPage(page);
ResponseModel<List<EquipmentIndexDto>> equipmentIndexDto = equipFeignClient.getEquipmentIndexDto(perfQuotaIotDTO);
if(equipmentIndexDto.getResult().size() == 0) {
return ResponseHelper.buildResponse(null);
}
List<EquipmentIndexDto> result = equipmentIndexDto.getResult();
List<EquipmentIndexDto> list = result.stream().filter(e-> 1== e.getIsIot()).collect(Collectors.toList());
List<WaterResourceDyDto> listWater = new LinkedList<>();
list.stream().forEach(e-> {
WaterResourceDyDto dyDto = new WaterResourceDyDto();
dyDto.setKey(e.getPerfQuotaDefinitionId());
dyDto.setBlock(false);
dyDto.setLabel(e.getPerfQuotaName());
dyDto.setType("input");
dyDto.setHide(false);
listWater.add(dyDto);
});
return ResponseHelper.buildResponse(listWater);
}
/** /**
* 根据sequenceNbr更新 * 根据sequenceNbr更新
* *
...@@ -235,12 +291,26 @@ public class WaterResourceController extends BaseController { ...@@ -235,12 +291,26 @@ public class WaterResourceController extends BaseController {
} }
} }
// 更新物联信息 // 更新物联信息
if (model.getIsIot() != null){ if (null != model.getWaterResourceIotDto() && model.getWaterResourceIotDto().size() > 0){
if (model.getIsIot()) { Map<String,Object> map = model.getWaterResourceIotDto();
WaterResourceIotDto waterResourceIotDto = model.getWaterResourceIotDto(); List<WaterResourceIndex> list = new ArrayList<>();
waterResourceIotDto.setResourceId(sequenceNbr); for (Map.Entry<String, Object> entry : map.entrySet()) {
waterResourceIotService.updateWithModel(waterResourceIotDto); LambdaQueryWrapper<WaterResourceIndex> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.eq(WaterResourceIndex::getNameKey,entry.getKey());
queryWrapper.eq(WaterResourceIndex::getWaterId,model.getSequenceNbr());
WaterResourceIndex waterResourceIndex = waterResourceIndexServiceImpl.getOne(queryWrapper);
if(waterResourceIndex != null) {
waterResourceIndex.setPerfValue(entry.getValue().toString());
list.add(waterResourceIndex);
} else {
WaterResourceIndex waterResourceIndex1 = new WaterResourceIndex();
waterResourceIndex1.setNameKey(entry.getKey());
waterResourceIndex1.setWaterId(model.getSequenceNbr());
waterResourceIndex1.setPerfValue(entry.getValue().toString());
list.add(waterResourceIndex1);
}
} }
waterResourceIndexServiceImpl.saveOrUpdateBatch(list);
} }
return ResponseHelper.buildResponse(waterResourceDto); return ResponseHelper.buildResponse(waterResourceDto);
} }
...@@ -342,14 +412,15 @@ public class WaterResourceController extends BaseController { ...@@ -342,14 +412,15 @@ public class WaterResourceController extends BaseController {
waterResourceDto.setSequenceNbr(sequenceNbr); waterResourceDto.setSequenceNbr(sequenceNbr);
waterResourceDto.setIsDelete(isDelete); waterResourceDto.setIsDelete(isDelete);
// 查询物联参数 // 查询物联参数
if (waterResourceDto.getIsIot()) { LambdaQueryWrapper<WaterResourceIndex> queryWrapper = new LambdaQueryWrapper<>();
WaterResourceIot waterResourceIot = waterResourceIotService.getOne(new QueryWrapper<WaterResourceIot>().eq( queryWrapper.eq(WaterResourceIndex::getWaterId,waterResourceDto.getSequenceNbr());
"resource_id", sequenceNbr)); List<WaterResourceIndex> list = waterResourceIndexServiceImpl.list(queryWrapper);
WaterResourceIotDto waterResourceIotDto = new WaterResourceIotDto(); if(list.size()>0) {
if (!ValidationUtil.isEmpty(waterResourceIot)) { Map<String,Object> map = new HashMap<>();
BeanUtils.copyProperties(waterResourceIot, waterResourceIotDto); list.stream().forEach(e->{
} map.put(e.getNameKey(),e.getPerfValue());
waterResourceDto.setWaterResourceIotDto(waterResourceIotDto); });
waterResourceDto.setWaterResourceIotDto(map);
} }
return ResponseHelper.buildResponse(waterResourceDto); return ResponseHelper.buildResponse(waterResourceDto);
} }
......
package com.yeejoin.amos.boot.module.common.biz.controller;
import org.springframework.web.bind.annotation.RequestMapping;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.Api;
import org.springframework.web.bind.annotation.RestController;
import com.yeejoin.amos.boot.biz.common.controller.BaseController;
import java.util.List;
import com.yeejoin.amos.boot.module.common.biz.service.impl.WaterResourceIndexServiceImpl;
import org.typroject.tyboot.core.restful.utils.ResponseHelper;
import org.typroject.tyboot.core.restful.utils.ResponseModel;
import org.springframework.beans.factory.annotation.Autowired;
import javax.servlet.http.HttpServletRequest;
import org.springframework.web.bind.annotation.*;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.boot.module.common.api.dto.WaterResourceIndexDto;
import org.typroject.tyboot.core.restful.doc.TycloudOperation;
import org.typroject.tyboot.core.foundation.enumeration.UserType;
/**
* 消防水源物联参数
*
* @author litw
* @date 2021-11-02
*/
@RestController
@Api(tags = "消防水源物联参数Api")
@RequestMapping(value = "/water-resource-index")
public class WaterResourceIndexController extends BaseController {
@Autowired
WaterResourceIndexServiceImpl waterResourceIndexServiceImpl;
/**
* 新增消防水源物联参数
*
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@PostMapping(value = "/save")
@ApiOperation(httpMethod = "POST", value = "新增消防水源物联参数", notes = "新增消防水源物联参数")
public ResponseModel<WaterResourceIndexDto> save(@RequestBody WaterResourceIndexDto model) {
model = waterResourceIndexServiceImpl.createWithModel(model);
return ResponseHelper.buildResponse(model);
}
/**
* 根据sequenceNbr更新
*
* @param sequenceNbr 主键
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@PutMapping(value = "/{sequenceNbr}")
@ApiOperation(httpMethod = "PUT", value = "根据sequenceNbr更新消防水源物联参数", notes = "根据sequenceNbr更新消防水源物联参数")
public ResponseModel<WaterResourceIndexDto> updateBySequenceNbrWaterResourceIndex(@RequestBody WaterResourceIndexDto model,@PathVariable(value = "sequenceNbr") Long sequenceNbr) {
model.setSequenceNbr(sequenceNbr);
return ResponseHelper.buildResponse(waterResourceIndexServiceImpl.updateWithModel(model));
}
/**
* 根据sequenceNbr删除
*
* @param sequenceNbr 主键
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@DeleteMapping(value = "/{sequenceNbr}")
@ApiOperation(httpMethod = "DELETE", value = "根据sequenceNbr删除消防水源物联参数", notes = "根据sequenceNbr删除消防水源物联参数")
public ResponseModel<Boolean> deleteBySequenceNbr(HttpServletRequest request, @PathVariable(value = "sequenceNbr") Long sequenceNbr){
return ResponseHelper.buildResponse(waterResourceIndexServiceImpl.removeById(sequenceNbr));
}
/**
* 根据sequenceNbr查询
*
* @param sequenceNbr 主键
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping(value = "/{sequenceNbr}")
@ApiOperation(httpMethod = "GET",value = "根据sequenceNbr查询单个消防水源物联参数", notes = "根据sequenceNbr查询单个消防水源物联参数")
public ResponseModel<WaterResourceIndexDto> selectOne(@PathVariable Long sequenceNbr) {
return ResponseHelper.buildResponse(waterResourceIndexServiceImpl.queryBySeq(sequenceNbr));
}
/**
* 列表分页查询
*
* @param current 当前页
* @param current 每页大小
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping(value = "/page")
@ApiOperation(httpMethod = "GET",value = "消防水源物联参数分页查询", notes = "消防水源物联参数分页查询")
public ResponseModel<Page<WaterResourceIndexDto>> queryForPage(@RequestParam(value = "current") int current,@RequestParam
(value = "size") int size) {
Page<WaterResourceIndexDto> page = new Page<WaterResourceIndexDto>();
page.setCurrent(current);
page.setSize(size);
return ResponseHelper.buildResponse(waterResourceIndexServiceImpl.queryForWaterResourceIndexPage(page));
}
/**
* 列表全部数据查询
*
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(httpMethod = "GET",value = "消防水源物联参数列表全部数据查询", notes = "消防水源物联参数列表全部数据查询")
@GetMapping(value = "/list")
public ResponseModel<List<WaterResourceIndexDto>> selectForList() {
return ResponseHelper.buildResponse(waterResourceIndexServiceImpl.queryForWaterResourceIndexList());
}
}
...@@ -737,7 +737,7 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp ...@@ -737,7 +737,7 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp
} }
@Override @Override
public void updateByIdOrgUsr(OrgUsrDto OrgUsrVo, Long id) throws Exception { public OrgUsrDto updateByIdOrgUsr(OrgUsrDto OrgUsrVo, Long id) throws Exception {
// 修改单位信息 // 修改单位信息
OrgUsr orgUsr = new OrgUsr(); OrgUsr orgUsr = new OrgUsr();
OrgUsr oriOrgUsr = getById(id); OrgUsr oriOrgUsr = getById(id);
...@@ -773,6 +773,8 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp ...@@ -773,6 +773,8 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp
* 同步保存ES * 同步保存ES
*/ */
eSOrgUsrService.saveAlertCalledToES(orgUsr); eSOrgUsrService.saveAlertCalledToES(orgUsr);
OrgUsrVo.setBizOrgCode(orgUsr.getBizOrgCode());
return OrgUsrVo;
} }
@Override @Override
......
package com.yeejoin.amos.boot.module.common.biz.service.impl;
import com.yeejoin.amos.boot.module.common.api.entity.WaterResourceIndex;
import com.yeejoin.amos.boot.module.common.api.mapper.WaterResourceIndexMapper;
import com.yeejoin.amos.boot.module.common.api.service.IWaterResourceIndexService;
import com.yeejoin.amos.boot.module.common.api.dto.WaterResourceIndexDto;
import org.typroject.tyboot.core.rdbms.service.BaseService;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import java.util.List;
/**
* 消防水源物联参数服务实现类
*
* @author litw
* @date 2021-11-02
*/
@Service
public class WaterResourceIndexServiceImpl extends BaseService<WaterResourceIndexDto,WaterResourceIndex,WaterResourceIndexMapper> implements IWaterResourceIndexService {
/**
* 分页查询
*/
public Page<WaterResourceIndexDto> queryForWaterResourceIndexPage(Page<WaterResourceIndexDto> page) {
return this.queryForPage(page, null, false);
}
/**
* 列表查询 示例
*/
public List<WaterResourceIndexDto> queryForWaterResourceIndexList() {
return this.queryForList("" , false);
}
}
\ No newline at end of file
...@@ -3,6 +3,7 @@ package com.yeejoin.amos.boot.module.common.biz.service.impl; ...@@ -3,6 +3,7 @@ package com.yeejoin.amos.boot.module.common.biz.service.impl;
import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.boot.biz.common.constants.BizConstant; import com.yeejoin.amos.boot.biz.common.constants.BizConstant;
...@@ -19,6 +20,7 @@ import com.yeejoin.amos.boot.module.common.api.dto.WaterResourceZhDto; ...@@ -19,6 +20,7 @@ import com.yeejoin.amos.boot.module.common.api.dto.WaterResourceZhDto;
import com.yeejoin.amos.boot.module.common.api.entity.WaterResource; import com.yeejoin.amos.boot.module.common.api.entity.WaterResource;
import com.yeejoin.amos.boot.module.common.api.entity.WaterResourceCrane; import com.yeejoin.amos.boot.module.common.api.entity.WaterResourceCrane;
import com.yeejoin.amos.boot.module.common.api.entity.WaterResourceHydrant; import com.yeejoin.amos.boot.module.common.api.entity.WaterResourceHydrant;
import com.yeejoin.amos.boot.module.common.api.entity.WaterResourceIndex;
import com.yeejoin.amos.boot.module.common.api.entity.WaterResourceIot; import com.yeejoin.amos.boot.module.common.api.entity.WaterResourceIot;
import com.yeejoin.amos.boot.module.common.api.entity.WaterResourceNatural; import com.yeejoin.amos.boot.module.common.api.entity.WaterResourceNatural;
import com.yeejoin.amos.boot.module.common.api.entity.WaterResourcePool; import com.yeejoin.amos.boot.module.common.api.entity.WaterResourcePool;
...@@ -35,7 +37,9 @@ import org.typroject.tyboot.core.rdbms.service.BaseService; ...@@ -35,7 +37,9 @@ import org.typroject.tyboot.core.rdbms.service.BaseService;
import javax.annotation.Resource; import javax.annotation.Resource;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map;
import java.util.Optional; import java.util.Optional;
/** /**
...@@ -59,6 +63,8 @@ public class WaterResourceServiceImpl extends BaseService<WaterResourceDto, Wate ...@@ -59,6 +63,8 @@ public class WaterResourceServiceImpl extends BaseService<WaterResourceDto, Wate
WaterResourceIotServiceImpl waterResourceIotService; WaterResourceIotServiceImpl waterResourceIotService;
@Resource @Resource
WaterResourceMapper waterResourceMapper; WaterResourceMapper waterResourceMapper;
@Autowired
WaterResourceIndexServiceImpl waterResourceIndexServiceImpl;
/** /**
* 分页查询 * 分页查询
...@@ -154,14 +160,14 @@ public class WaterResourceServiceImpl extends BaseService<WaterResourceDto, Wate ...@@ -154,14 +160,14 @@ public class WaterResourceServiceImpl extends BaseService<WaterResourceDto, Wate
break; break;
} }
// 新增物联信息 // 新增物联信息
if (model.getIsIot()) { // if (model.getIsIot()) {
WaterResourceIotDto waterResourceIotDto = new WaterResourceIotDto(); // WaterResourceIotDto waterResourceIotDto = new WaterResourceIotDto();
BeanUtils.copyProperties(model, waterResourceIotDto); // BeanUtils.copyProperties(model, waterResourceIotDto);
waterResourceIotDto.setSequenceNbr(null); // waterResourceIotDto.setSequenceNbr(null);
waterResourceIotDto.setResourceType(model.getResourceType()); // waterResourceIotDto.setResourceType(model.getResourceType());
waterResourceIotDto.setResourceId(model.getSequenceNbr()); // waterResourceIotDto.setResourceId(model.getSequenceNbr());
waterResourceIotService.createWithModel(waterResourceIotDto); // waterResourceIotService.createWithModel(waterResourceIotDto);
} // }
} else { } else {
createWithModel(model); createWithModel(model);
} }
...@@ -234,12 +240,15 @@ public class WaterResourceServiceImpl extends BaseService<WaterResourceDto, Wate ...@@ -234,12 +240,15 @@ public class WaterResourceServiceImpl extends BaseService<WaterResourceDto, Wate
waterResourceDto.setSequenceNbr(sequenceNbr); waterResourceDto.setSequenceNbr(sequenceNbr);
waterResourceDto.setIsDelete(isDelete); waterResourceDto.setIsDelete(isDelete);
// 查询物联参数 // 查询物联参数
if (waterResourceDto.getIsIot()) { LambdaQueryWrapper<WaterResourceIndex> queryWrapper = new LambdaQueryWrapper<>();
WaterResourceIot waterResourceIot = waterResourceIotService.getOne(new QueryWrapper<WaterResourceIot>().eq( queryWrapper.eq(WaterResourceIndex::getWaterId,waterResourceDto.getSequenceNbr());
"resource_id", sequenceNbr)); List<WaterResourceIndex> list = waterResourceIndexServiceImpl.list(queryWrapper);
WaterResourceIotDto waterResourceIotDto = new WaterResourceIotDto(); if(list.size()>0) {
BeanUtils.copyProperties(waterResourceIot, waterResourceIotDto); Map<String,Object> map = new HashMap<>();
waterResourceDto.setWaterResourceIotDto(waterResourceIotDto); list.stream().forEach(e->{
map.put(e.getNameKey(),e.getPerfValue());
});
waterResourceDto.setWaterResourceIotDto(map);
} }
return waterResourceDto; return waterResourceDto;
} }
......
...@@ -343,6 +343,8 @@ public class AlertCalledController extends BaseController { ...@@ -343,6 +343,8 @@ public class AlertCalledController extends BaseController {
throw new RuntimeException("系统异常"); throw new RuntimeException("系统异常");
} }
}); });
queryWrapper.or().eq("sequence_nbr",alertCalled.getFatherAlert());
return queryWrapper; return queryWrapper;
} }
......
...@@ -328,12 +328,13 @@ public class AlertCalledServiceImpl extends BaseService<AlertCalledDto, AlertCal ...@@ -328,12 +328,13 @@ public class AlertCalledServiceImpl extends BaseService<AlertCalledDto, AlertCal
ruleAlertCalledService.fireAlertCalledRule(alertCalledObjsDto); ruleAlertCalledService.fireAlertCalledRule(alertCalledObjsDto);
// 通知实战指挥页面发送mqtt 默认发送 String 类型 0, 新警情 1 警情状态变化 // 通知实战指挥页面发送mqtt 默认发送 String 类型 0, 新警情 1 警情状态变化
emqKeeper.getMqttClient().publish(topic, "0".getBytes(), RuleConfig.DEFAULT_QOS, true); emqKeeper.getMqttClient().publish(topic, "0".getBytes(), RuleConfig.DEFAULT_QOS, true);
}
/** /**
* 同步保存ES * 同步保存ES
*/ */
eSAlertCalledService.saveAlertCalledToES(alertCalled); eSAlertCalledService.saveAlertCalledToES(alertCalled);
}
return alertCalledObjsDto; return alertCalledObjsDto;
} catch (Exception e) { } catch (Exception e) {
......
...@@ -81,6 +81,7 @@ public class ESAlertCalledService { ...@@ -81,6 +81,7 @@ public class ESAlertCalledService {
Date date=new Date(currentTime); Date date=new Date(currentTime);
wrapper.ge("call_time", date); wrapper.ge("call_time", date);
wrapper.isNull("father_alert");
List<AlertCalled> alertCalleds = alertCalledService.list(wrapper); List<AlertCalled> alertCalleds = alertCalledService.list(wrapper);
if (!ValidationUtil.isEmpty(alertCalleds)) if (!ValidationUtil.isEmpty(alertCalleds))
......
...@@ -15,32 +15,7 @@ import com.yeejoin.amos.boot.biz.common.utils.DateUtils; ...@@ -15,32 +15,7 @@ import com.yeejoin.amos.boot.biz.common.utils.DateUtils;
import com.yeejoin.amos.boot.biz.common.utils.QRCodeUtil; import com.yeejoin.amos.boot.biz.common.utils.QRCodeUtil;
import com.yeejoin.amos.boot.biz.common.utils.RedisKey; import com.yeejoin.amos.boot.biz.common.utils.RedisKey;
import com.yeejoin.amos.boot.biz.common.utils.RedisUtils; import com.yeejoin.amos.boot.biz.common.utils.RedisUtils;
import com.yeejoin.amos.boot.module.common.api.dto.CompanyPerson; import com.yeejoin.amos.boot.module.common.api.dto.*;
import com.yeejoin.amos.boot.module.common.api.dto.DutyCarDto;
import com.yeejoin.amos.boot.module.common.api.dto.DutyFireFightingDto;
import com.yeejoin.amos.boot.module.common.api.dto.DutyFirstAidDto;
import com.yeejoin.amos.boot.module.common.api.dto.DutyPersonDto;
import com.yeejoin.amos.boot.module.common.api.dto.DutyPersonShiftDto;
import com.yeejoin.amos.boot.module.common.api.dto.DutyShiftDto;
import com.yeejoin.amos.boot.module.common.api.dto.DynamicFormInitDto;
import com.yeejoin.amos.boot.module.common.api.dto.DynamicFormInstanceDto;
import com.yeejoin.amos.boot.module.common.api.dto.ExcelDto;
import com.yeejoin.amos.boot.module.common.api.dto.FireChemicalDto;
import com.yeejoin.amos.boot.module.common.api.dto.FireExpertsDto;
import com.yeejoin.amos.boot.module.common.api.dto.FireStationDto;
import com.yeejoin.amos.boot.module.common.api.dto.FireTeamDto;
import com.yeejoin.amos.boot.module.common.api.dto.FirefightersDto;
import com.yeejoin.amos.boot.module.common.api.dto.FirefightersExcelDto;
import com.yeejoin.amos.boot.module.common.api.dto.FirefightersInfoDto;
import com.yeejoin.amos.boot.module.common.api.dto.KeySiteExcleDto;
import com.yeejoin.amos.boot.module.common.api.dto.LinkageUnitDto;
import com.yeejoin.amos.boot.module.common.api.dto.MaintenancePersonExcleDto;
import com.yeejoin.amos.boot.module.common.api.dto.OrgUsrDto;
import com.yeejoin.amos.boot.module.common.api.dto.OrgUsrExcelDto;
import com.yeejoin.amos.boot.module.common.api.dto.OrgUsrFormDto;
import com.yeejoin.amos.boot.module.common.api.dto.RescueEquipmentDto;
import com.yeejoin.amos.boot.module.common.api.dto.SpecialPositionStaffDto;
import com.yeejoin.amos.boot.module.common.api.dto.WaterResourceDto;
import com.yeejoin.amos.boot.module.common.api.entity.DynamicFormColumn; import com.yeejoin.amos.boot.module.common.api.entity.DynamicFormColumn;
import com.yeejoin.amos.boot.module.common.api.entity.DynamicFormInstance; import com.yeejoin.amos.boot.module.common.api.entity.DynamicFormInstance;
import com.yeejoin.amos.boot.module.common.api.entity.FireChemical; import com.yeejoin.amos.boot.module.common.api.entity.FireChemical;
...@@ -341,15 +316,27 @@ public class ExcelServiceImpl { ...@@ -341,15 +316,27 @@ public class ExcelServiceImpl {
LinkageUnitDto.class); LinkageUnitDto.class);
List<LinkageUnitDto> detaiList = resultDtoList.stream().map(item -> { List<LinkageUnitDto> detaiList = resultDtoList.stream().map(item -> {
Date now = new Date(); Date now = new Date();
if (item.getLongitude() != null){
}
boolean isInAgreement = DateUtils.belongCalendar(now, item.getAgreementStartDate(), boolean isInAgreement = DateUtils.belongCalendar(now, item.getAgreementStartDate(),
item.getAgreementEndDate()); item.getAgreementEndDate());
item.setInAgreement(isInAgreement ? "是" : "否"); item.setInAgreement(isInAgreement ? "是" : "否");
return item; return item;
}).filter(item -> org.apache.commons.lang3.StringUtils.isEmpty(inAgreement) || inAgreement.equals(item.getInAgreement())) }).filter(item -> org.apache.commons.lang3.StringUtils.isEmpty(inAgreement) || inAgreement.equals(item.getInAgreement()))
.collect(Collectors.toList()); .collect(Collectors.toList());
/*经纬度导出精度会丢失 转换成string导出 2021-11-02 陈召 开始*/
ExcelUtil.createTemplate(response, excelDto.getFileName(), excelDto.getSheetName(), detaiList, List<LinkageUnitVo> result = new ArrayList<>();
LinkageUnitDto.class, null, false); detaiList.forEach(d->{
LinkageUnitVo linkageUnitVo = new LinkageUnitVo();
BeanUtils.copyProperties(d,linkageUnitVo);
linkageUnitVo.setLatitude(d.getLatitude() != null? String.valueOf(d.getLatitude()):" ");
linkageUnitVo.setLongitude(d.getLongitude() != null?String.valueOf(d.getLongitude()):" ");
result.add(linkageUnitVo);
});
/*经纬度导出精度会丢失 转换成string导出 2021-11-02 陈召 结束*/
ExcelUtil.createTemplate(response, excelDto.getFileName(), excelDto.getSheetName(), result,
LinkageUnitVo.class, null, false);
break; break;
default: default:
break; break;
......
...@@ -18,4 +18,9 @@ public class DangerExecuteSubmitDto extends ExecuteSubmitDto { ...@@ -18,4 +18,9 @@ public class DangerExecuteSubmitDto extends ExecuteSubmitDto {
private Long dangerId; private Long dangerId;
private LatentDangerExecuteTypeEnum executeTypeEnum; private LatentDangerExecuteTypeEnum executeTypeEnum;
/**
* 检查组长userId
*/
private String checkLeaderId;
} }
...@@ -287,6 +287,7 @@ public class LatentDangerServiceImpl extends BaseService<LatentDangerBo, LatentD ...@@ -287,6 +287,7 @@ public class LatentDangerServiceImpl extends BaseService<LatentDangerBo, LatentD
latentDanger.setCurrentFlowRecordId(inputRecord.getId()); latentDanger.setCurrentFlowRecordId(inputRecord.getId());
latentDanger.setInstanceId(instance.getString("id")); latentDanger.setInstanceId(instance.getString("id"));
latentDangerMapper.updateById(latentDanger); latentDangerMapper.updateById(latentDanger);
asyncTask.sendDangerMsg(RequestContext.cloneRequestContext(), latentDanger, onSiteConfirmRole);
} }
// TODO 使用远程调用替换 // TODO 使用远程调用替换
...@@ -1213,6 +1214,7 @@ public class LatentDangerServiceImpl extends BaseService<LatentDangerBo, LatentD ...@@ -1213,6 +1214,7 @@ public class LatentDangerServiceImpl extends BaseService<LatentDangerBo, LatentD
// 4、在执行完节点后需要将检查组长id设置为下个节点执行人 // 4、在执行完节点后需要将检查组长id设置为下个节点执行人
Object resultObj = workflowExecuteService.setTaskAssign(latentDanger.getInstanceId(), checkLeaderId); Object resultObj = workflowExecuteService.setTaskAssign(latentDanger.getInstanceId(), checkLeaderId);
executeSubmitDto.setCheckLeaderId(userModel.getUserId());
if (!(Boolean) resultObj) { if (!(Boolean) resultObj) {
executeSubmitDto.setIsOk(false); executeSubmitDto.setIsOk(false);
...@@ -2057,7 +2059,6 @@ public class LatentDangerServiceImpl extends BaseService<LatentDangerBo, LatentD ...@@ -2057,7 +2059,6 @@ public class LatentDangerServiceImpl extends BaseService<LatentDangerBo, LatentD
latentDanger.setPhotoUrls(Joiner.on(",").join(latentDangerDto.getPhotoUrl())); latentDanger.setPhotoUrls(Joiner.on(",").join(latentDangerDto.getPhotoUrl()));
} }
this.updateById(latentDanger); this.updateById(latentDanger);
DangerExecuteSubmitDto executeSubmitDto = new DangerExecuteSubmitDto(); DangerExecuteSubmitDto executeSubmitDto = new DangerExecuteSubmitDto();
LatentDangerExecuteParam executeParam = new LatentDangerExecuteParam(); LatentDangerExecuteParam executeParam = new LatentDangerExecuteParam();
if (ValidationUtil.isEmpty(executeType) || if (ValidationUtil.isEmpty(executeType) ||
...@@ -2078,6 +2079,8 @@ public class LatentDangerServiceImpl extends BaseService<LatentDangerBo, LatentD ...@@ -2078,6 +2079,8 @@ public class LatentDangerServiceImpl extends BaseService<LatentDangerBo, LatentD
if (!executeSubmitDto.getIsOk()) { if (!executeSubmitDto.getIsOk()) {
throw new Exception(executeSubmitDto.getMsg()); throw new Exception(executeSubmitDto.getMsg());
} }
List<String> userIds = workflowExecuteService.getUserIdsByWorkflow(latentDanger.getInstanceId(), executeSubmitDto.getCheckLeaderId());
asyncTask.sendDangerSubmitMsg(RequestContext.cloneRequestContext(), latentDanger, userIds, ExecuteTypeEnum.getNameByCode(executeType));
return executeSubmitDto; return executeSubmitDto;
} }
......
...@@ -4,12 +4,18 @@ import com.alibaba.fastjson.JSONArray; ...@@ -4,12 +4,18 @@ import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.google.common.collect.Lists; import com.google.common.collect.Lists;
import com.google.common.collect.Maps; import com.google.common.collect.Maps;
import com.yeejoin.amos.feign.privilege.Privilege;
import com.yeejoin.amos.feign.privilege.model.AgencyUserModel;
import com.yeejoin.amos.feign.privilege.model.RoleModel;
import com.yeejoin.amos.feign.systemctl.Systemctl; import com.yeejoin.amos.feign.systemctl.Systemctl;
import com.yeejoin.amos.feign.systemctl.model.MessageModel; import com.yeejoin.amos.feign.systemctl.model.MessageModel;
import com.yeejoin.amos.latentdanger.business.param.JPushTypeEnum; import com.yeejoin.amos.latentdanger.business.param.JPushTypeEnum;
import com.yeejoin.amos.latentdanger.business.param.PushMsgParam; import com.yeejoin.amos.latentdanger.business.param.PushMsgParam;
import com.yeejoin.amos.latentdanger.business.util.DateUtil;
import com.yeejoin.amos.latentdanger.business.util.Toke; import com.yeejoin.amos.latentdanger.business.util.Toke;
import com.yeejoin.amos.latentdanger.common.enums.LatentDangerState;
import com.yeejoin.amos.latentdanger.common.enums.MsgSubscribeEnum; import com.yeejoin.amos.latentdanger.common.enums.MsgSubscribeEnum;
import com.yeejoin.amos.latentdanger.dao.entity.LatentDanger;
import com.yeejoin.amos.latentdanger.dao.entity.Msg; import com.yeejoin.amos.latentdanger.dao.entity.Msg;
import com.yeejoin.amos.latentdanger.feign.RemoteSecurityService; import com.yeejoin.amos.latentdanger.feign.RemoteSecurityService;
import org.slf4j.Logger; import org.slf4j.Logger;
...@@ -17,12 +23,12 @@ import org.slf4j.LoggerFactory; ...@@ -17,12 +23,12 @@ import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Async; import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
import org.typroject.tyboot.core.foundation.context.RequestContext;
import org.typroject.tyboot.core.foundation.context.RequestContextModel;
import org.typroject.tyboot.core.foundation.utils.ValidationUtil;
import java.util.Date; import java.util.*;
import java.util.HashSet; import java.util.stream.Collectors;
import java.util.List;
import java.util.Map;
import java.util.Set;
/** /**
* 异步执行任务 * 异步执行任务
...@@ -33,6 +39,7 @@ import java.util.Set; ...@@ -33,6 +39,7 @@ import java.util.Set;
public class AsyncTask { public class AsyncTask {
private static final String TAB = "\r\n"; private static final String TAB = "\r\n";
private final Logger log = LoggerFactory.getLogger(AsyncTask.class); private final Logger log = LoggerFactory.getLogger(AsyncTask.class);
private final String msgType = "danger";
// @Autowired // @Autowired
// private IMsgDao iMsgDao; // private IMsgDao iMsgDao;
// @Autowired // @Autowired
...@@ -146,4 +153,76 @@ public class AsyncTask { ...@@ -146,4 +153,76 @@ public class AsyncTask {
// messageService.pushMsg(toke.getToke(), toke.getProduct(), toke.getAppKey(), pushMsgParam); // messageService.pushMsg(toke.getToke(), toke.getProduct(), toke.getAppKey(), pushMsgParam);
} }
} }
/**
* 提交隐患发送消息至检查组员被检查单位确认隐患
*/
@Async
public void sendDangerMsg(RequestContextModel requestContextModel, LatentDanger latentDanger, String roleName){
RequestContext.setToken(requestContextModel.getToken());
RequestContext.setProduct(requestContextModel.getProduct());
RequestContext.setAppKey(requestContextModel.getAppKey());
MessageModel model = new MessageModel();
String body = String.format("隐患名称:%s;隐患级别:%s;治理方式:%s;当前状态:%s;推送时间:%s",
latentDanger.getDangerName(), latentDanger.getDangerLevelName(), latentDanger.getReformTypeName(), latentDanger.getDangerStateName(), DateUtil.date2LongStr(new Date()));
model.setBody(body);
getMessageModel(model, latentDanger);
try {
List<RoleModel> result = Privilege.roleClient.queryRoleList(roleName, null).getResult();
if (result.size() > 0) {
List<AgencyUserModel> userModels = Privilege.agencyUserClient.queryByRoleId(String.valueOf(result.get(0).getSequenceNbr()), null).getResult();
List<String> userIds = userModels.stream().map(AgencyUserModel::getUserId).collect(Collectors.toList());
model.setRecivers(userIds);
}
Systemctl.messageClient.create(model);
} catch (Exception e) {
e.printStackTrace();
}
}
/**
* 确认隐患发送消息
*/
@Async
public void sendDangerSubmitMsg(RequestContextModel requestContextModel, LatentDanger latentDanger, List<String> userIds, String executeName){
RequestContext.setToken(requestContextModel.getToken());
RequestContext.setProduct(requestContextModel.getProduct());
RequestContext.setAppKey(requestContextModel.getAppKey());
MessageModel model = new MessageModel();
String body = String.format("隐患名称:%s;隐患级别:%s;治理方式:%s;当前状态:%s;审核结果:%s;推送时间:%s",
latentDanger.getDangerName(), latentDanger.getDangerLevelName(), latentDanger.getReformTypeName(), latentDanger.getDangerStateName(), executeName, DateUtil.date2LongStr(new Date()));
model.setBody(body);
model.setIsSendWeb(true);
model.setRecivers(userIds);
getMessageModel(model, latentDanger);
try {
Systemctl.messageClient.create(model);
} catch (Exception e) {
e.printStackTrace();
}
}
private MessageModel getMessageModel(MessageModel model, LatentDanger latentDanger) {
String type = null;
latentDanger.getDangerState();
LatentDangerState.SupervisionDangerStateEnum stateEnum =
LatentDangerState.SupervisionDangerStateEnum.getEnumByCode(latentDanger.getDangerState());
if (!ValidationUtil.isEmpty(stateEnum)) {
if (stateEnum.getProcessState().equals("1")) {
type = "1";
} else if (stateEnum.getProcessState().equals("4")) {
type = "2";
}
}
if (!ValidationUtil.isEmpty(type)){
Map<String, String> map = new HashMap<>();
map.put("type", type);
model.setExtras(map);
}
model.setTitle(latentDanger.getDangerName());
model.setIsSendApp(true);
model.setMsgType(msgType);
model.setRelationId(String.valueOf(latentDanger.getId()));
return model;
}
} }
...@@ -30,7 +30,7 @@ public interface InputItemMapper extends BaseMapper { ...@@ -30,7 +30,7 @@ public interface InputItemMapper extends BaseMapper {
public List<InputItemVo> getInputItemListByitemNos(@Param("itemNos") String[] itemNos); public List<InputItemVo> getInputItemListByitemNos(@Param("itemNos") String[] itemNos);
public List<PointInputItemVo> queryCustomInputItemByPointId(@Param("pointId") Long pointId, @Param("equipmentId") String equipmentName ); public List<PointInputItemVo> queryCustomInputItemByPointId(@Param("classifyId") String classifyId );
public PointInputItemVo getInputItemByEquipmentName(@Param("equipmentName") String equipmentName ); public PointInputItemVo getInputItemByEquipmentName(@Param("equipmentName") String equipmentName );
} }
...@@ -14,7 +14,7 @@ public interface IPointClassifyDao extends BaseDao<PointClassify, Long> { ...@@ -14,7 +14,7 @@ public interface IPointClassifyDao extends BaseDao<PointClassify, Long> {
@Modifying @Modifying
@Transactional @Transactional
@Query(value = "select * from p_point_classify where point_id = ?1", nativeQuery = true) @Query(value = "select * from p_point_classify where point_id = ?1 and is_delete = 0", nativeQuery = true)
List<PointClassify> getPointClassifyByPointId(long id); List<PointClassify> getPointClassifyByPointId(long id);
@Modifying @Modifying
...@@ -27,5 +27,23 @@ public interface IPointClassifyDao extends BaseDao<PointClassify, Long> { ...@@ -27,5 +27,23 @@ public interface IPointClassifyDao extends BaseDao<PointClassify, Long> {
@Query(value = "delete from p_point_classify where point_id in (?1)", nativeQuery = true) @Query(value = "delete from p_point_classify where point_id in (?1)", nativeQuery = true)
void deleteByPointId(List<Long> pointIds); void deleteByPointId(List<Long> pointIds);
/**
* 根据原始id逻辑删除
* @param id 原始id
*/
@Modifying
@Transactional
@Query(value = "UPDATE p_point_classify SET is_delete = 1 WHERE original_id = (?1)", nativeQuery = true)
void deleteByOriginalId(String id);
/**
* 根据原始id查询
* @param id 原始id
* @return List<PointClassify> 返回
*/
@Query(value = "select * from p_point_classify WHERE original_id = (?1) and is_delete =0", nativeQuery = true)
List<PointClassify> selectByOriginalId(String id);
PointClassify findByOriginalId(String originalId); PointClassify findByOriginalId(String originalId);
} }
package com.yeejoin.amos.patrol.business.dto;
import lombok.Data;
/**
* @author DELL
*/
@Data
public class PointClassifySynDto {
/**
* 原始数据id
*/
private String originalId;
/**
* 原始数据name
*/
private String name;
/**
* 编号
*/
private String code;
/**
* 分类
*/
private String categoryName;
/**
* 分类code
*/
private String categoryCode;
/**
* 位置
*/
private String address;
/**
* 建筑id
*/
private String buildingId;
/**
* 建筑名称
*/
private String buildingName;
}
...@@ -1134,32 +1134,32 @@ public class CheckServiceImpl implements ICheckService { ...@@ -1134,32 +1134,32 @@ public class CheckServiceImpl implements ICheckService {
e.put("photoData", photoList); e.put("photoData", photoList);
}); });
equip.put("equipIputLsit",inputContent); equip.put("equipIputLsit",inputContent);
LinkedHashMap<String,Object> jsonObject = equipment.getEquipDetail(Long.parseLong(equip.get("equipmentId").toString())); // LinkedHashMap<String,Object> jsonObject = equipment.getEquipDetail(Long.parseLong(equip.get("equipmentId").toString()));
LinkedHashMap<String,Object> result = (LinkedHashMap<String, Object>) jsonObject.get("result"); // LinkedHashMap<String,Object> result = (LinkedHashMap<String, Object>) jsonObject.get("result");
if(result!=null){ // if(result!=null){
if(result.get("sourceName")!=null){ // if(result.get("sourceName")!=null){
equip.put("arec",result.get("sourceName").toString()); // equip.put("arec",result.get("sourceName").toString());
}else{ // }else{
equip.put("arec",""); // equip.put("arec","");
} // }
if(result.get("categoryName")!=null){ // if(result.get("categoryName")!=null){
equip.put("equipType",result.get("categoryName").toString()); // equip.put("equipType",result.get("categoryName").toString());
}else{ // }else{
equip.put("equipType",""); // equip.put("equipType","");
} // }
if(result.get("fullName")!=null){ // if(result.get("fullName")!=null){
if(result.get("area")!=null){ // if(result.get("area")!=null){
equip.put("area",result.get("fullName").toString()+result.get("area")); // equip.put("area",result.get("fullName").toString()+result.get("area"));
}else { // }else {
equip.put("area",result.get("fullName").toString()); // equip.put("area",result.get("fullName").toString());
} // }
//
}else{ // }else{
equip.put("area",""); // equip.put("area","");
} // }
//
equip.put("place", result.get("warehouseStructureName")); // equip.put("place", result.get("warehouseStructureName"));
} // }
}); });
return equipList; return equipList;
} }
......
...@@ -781,9 +781,10 @@ public class PlanTaskServiceImpl implements IPlanTaskService { ...@@ -781,9 +781,10 @@ public class PlanTaskServiceImpl implements IPlanTaskService {
userNames.clear(); userNames.clear();
String[] userIds1 = e.get("userId").toString().split(","); String[] userIds1 = e.get("userId").toString().split(",");
for (String userId : userIds1) { for (String userId : userIds1) {
if (!ObjectUtils.isEmpty(userModelMap.get(userId))) {
userNames.add(userModelMap.get(userId)); userNames.add(userModelMap.get(userId));
} }
userNames.remove(null); }
if (userNames.size() > 0) { if (userNames.size() > 0) {
e.put("executiveName", Joiner.on(",").join(userNames)); e.put("executiveName", Joiner.on(",").join(userNames));
} else { } else {
......
package com.yeejoin.amos.patrol.business.service.impl; package com.yeejoin.amos.patrol.business.service.impl;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.google.common.base.Joiner; import com.google.common.base.Joiner;
...@@ -11,6 +12,7 @@ import com.yeejoin.amos.patrol.business.dao.mapper.InputItemMapper; ...@@ -11,6 +12,7 @@ import com.yeejoin.amos.patrol.business.dao.mapper.InputItemMapper;
import com.yeejoin.amos.patrol.business.dao.mapper.PointMapper; import com.yeejoin.amos.patrol.business.dao.mapper.PointMapper;
import com.yeejoin.amos.patrol.business.dao.mapper.RouteMapper; import com.yeejoin.amos.patrol.business.dao.mapper.RouteMapper;
import com.yeejoin.amos.patrol.business.dao.repository.*; import com.yeejoin.amos.patrol.business.dao.repository.*;
import com.yeejoin.amos.patrol.business.dto.PointClassifySynDto;
import com.yeejoin.amos.patrol.business.entity.mybatis.CheckPtListBo; import com.yeejoin.amos.patrol.business.entity.mybatis.CheckPtListBo;
import com.yeejoin.amos.patrol.business.entity.mybatis.PushTargetBo; import com.yeejoin.amos.patrol.business.entity.mybatis.PushTargetBo;
import com.yeejoin.amos.patrol.business.feign.EquipFeign; import com.yeejoin.amos.patrol.business.feign.EquipFeign;
...@@ -29,10 +31,13 @@ import com.yeejoin.amos.patrol.exception.YeeException; ...@@ -29,10 +31,13 @@ import com.yeejoin.amos.patrol.exception.YeeException;
import com.yeejoin.amos.patrol.feign.RemoteSecurityService; import com.yeejoin.amos.patrol.feign.RemoteSecurityService;
import com.yeejoin.amos.safety.common.cache.PointStatusCache; import com.yeejoin.amos.safety.common.cache.PointStatusCache;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang.StringUtils; import org.apache.commons.lang.StringUtils;
import org.apache.poi.ss.formula.functions.T; import org.apache.poi.ss.formula.functions.T;
import org.assertj.core.util.Sets; import org.assertj.core.util.Sets;
import org.springframework.beans.BeanUtils; import org.springframework.beans.BeanUtils;
import org.springframework.beans.BeanWrapper;
import org.springframework.beans.BeanWrapperImpl;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.*; import org.springframework.data.domain.*;
import org.springframework.data.jpa.domain.Specification; import org.springframework.data.jpa.domain.Specification;
...@@ -46,12 +51,14 @@ import javax.persistence.criteria.CriteriaBuilder; ...@@ -46,12 +51,14 @@ import javax.persistence.criteria.CriteriaBuilder;
import javax.persistence.criteria.CriteriaQuery; import javax.persistence.criteria.CriteriaQuery;
import javax.persistence.criteria.Predicate; import javax.persistence.criteria.Predicate;
import javax.persistence.criteria.Root; import javax.persistence.criteria.Root;
import java.beans.PropertyDescriptor;
import java.math.BigInteger; import java.math.BigInteger;
import java.util.*; import java.util.*;
import java.util.stream.Collector; import java.util.stream.Collector;
import java.util.stream.Collectors; import java.util.stream.Collectors;
@Service("pointService") @Service("pointService")
@Slf4j
public class PointServiceImpl implements IPointService { public class PointServiceImpl implements IPointService {
@Autowired @Autowired
...@@ -320,6 +327,15 @@ public class PointServiceImpl implements IPointService { ...@@ -320,6 +327,15 @@ public class PointServiceImpl implements IPointService {
newPointClassify.setCreatorId(point.getCreatorId()); newPointClassify.setCreatorId(point.getCreatorId());
newPointClassify.setPointId(pointId); newPointClassify.setPointId(pointId);
newPointClassify.setOrderNo(pointClassify.getOrderNo()); newPointClassify.setOrderNo(pointClassify.getOrderNo());
newPointClassify.setDataSourceCode(pointClassify.getDataSourceCode());
newPointClassify.setDataSourceName(pointClassify.getDataSourceName());
newPointClassify.setAddress(pointClassify.getAddress());
newPointClassify.setBuildingId(pointClassify.getBuildingId());
newPointClassify.setOriginalId(pointClassify.getOriginalId());
newPointClassify.setCategoryCode(pointClassify.getCategoryCode());
newPointClassify.setCategoryName(pointClassify.getCategoryName());
newPointClassify.setCode(pointClassify.getCode());
newPointClassify.setBuildingName(pointClassify.getBuildingName());
if(!optionalPointClassify.isPresent()) { if(!optionalPointClassify.isPresent()) {
pointResult = iPointClassifyDao.saveAndFlush(newPointClassify); pointResult = iPointClassifyDao.saveAndFlush(newPointClassify);
}else{ }else{
...@@ -1502,8 +1518,8 @@ public class PointServiceImpl implements IPointService { ...@@ -1502,8 +1518,8 @@ public class PointServiceImpl implements IPointService {
public List<Map<String, Object>> queryEquipPointInputItem(Long pointId) { public List<Map<String, Object>> queryEquipPointInputItem(Long pointId) {
List<Map<String, Object>> content = pointMapper.queryEquipPointInputItem(pointId); List<Map<String, Object>> content = pointMapper.queryEquipPointInputItem(pointId);
content.forEach(e->{ content.forEach(e->{
if(e.get("equipmentId")!=null && !StringUtils.isBlank(e.get("equipmentId").toString())){ if(e.get("id")!=null && !StringUtils.isBlank(e.get("id").toString())){
List<PointInputItemVo> inputItems = inputItemMapper.queryCustomInputItemByPointId(pointId,e.get("equipmentId").toString()); List<PointInputItemVo> inputItems = inputItemMapper.queryCustomInputItemByPointId(e.get("id").toString());
e.put("equipIputDetailData",inputItems); e.put("equipIputDetailData",inputItems);
} }
}); });
...@@ -1628,4 +1644,52 @@ public class PointServiceImpl implements IPointService { ...@@ -1628,4 +1644,52 @@ public class PointServiceImpl implements IPointService {
public LinkedHashMap<String, Object> getRegionTress() { public LinkedHashMap<String, Object> getRegionTress() {
return equipFeign.getRegionTress(); return equipFeign.getRegionTress();
} }
@Override
public void syncPointClassify(Map<String, Object> map) {
if (ObjectUtils.isEmpty(map)) {
log.info("消息内容为空!!!");
return;
}
String method = map.get("method").toString();
PointClassifySynDto pointClassifySynDto = JSON.parseObject(map.get("data").toString(), PointClassifySynDto.class);
switch (method) {
case "DELETE":
iPointClassifyDao.deleteByOriginalId(pointClassifySynDto.getOriginalId());
break;
case "UPDATE":
List<PointClassify> pointClassifyList = iPointClassifyDao.selectByOriginalId(pointClassifySynDto.getOriginalId());
if (ObjectUtils.isEmpty(pointClassifyList)) {
log.info("数据不存在!");
}
pointClassifyList.forEach(pointClassify -> {
BeanUtils.copyProperties(pointClassifySynDto, pointClassify,getNullPropertyNames(pointClassifySynDto));
iPointClassifyDao.saveAndFlush(pointClassify);
});
break;
default:
log.info("方法参数错误!!!");
break;
}
}
/**
* 获取控制字段列表
* @param source 对象
* @return 为空数组
*/
private static String[] getNullPropertyNames(Object source) {
final BeanWrapper src = new BeanWrapperImpl(source);
PropertyDescriptor[] pds = src.getPropertyDescriptors();
Set<String> emptyNames = new HashSet<String>();
for(PropertyDescriptor pd : pds) {
Object srcValue = src.getPropertyValue(pd.getName());
if (srcValue == null) {
emptyNames.add(pd.getName());
}
}
String[] result = new String[emptyNames.size()];
return emptyNames.toArray(result);
}
} }
...@@ -343,4 +343,7 @@ public interface IPointService { ...@@ -343,4 +343,7 @@ public interface IPointService {
List queryItemList4RoutePoint(Long pointId, Long equipId); List queryItemList4RoutePoint(Long pointId, Long equipId);
LinkedHashMap<String,Object> getRegionTress (); LinkedHashMap<String,Object> getRegionTress ();
void syncPointClassify(Map<String,Object> map);
} }
...@@ -65,6 +65,35 @@ public class PointInputItemNewVo{ ...@@ -65,6 +65,35 @@ public class PointInputItemNewVo{
* 序号 * 序号
*/ */
private Integer orderNo; private Integer orderNo;
/**
* 数据源名称(冗余)
*/
private String dataSourceName;
/**
* 数据源code(1 消防装备 2 重点部位 3 自定义)
*/
private String dataSourceCode;
/**
* 编号
*/
private String code;
/**
* 建筑id
*/
private String buildingId;
/**
* 建筑name
*/
private String buildingName;
/**
* 原始id
*/
private String originalId;
private List<PointInputItemVo> equipIputDetailData = new ArrayList<PointInputItemVo>(); private List<PointInputItemVo> equipIputDetailData = new ArrayList<PointInputItemVo>();
...@@ -178,4 +207,52 @@ public class PointInputItemNewVo{ ...@@ -178,4 +207,52 @@ public class PointInputItemNewVo{
public void setMaintenanceName(String maintenanceName) { public void setMaintenanceName(String maintenanceName) {
this.maintenanceName = maintenanceName; this.maintenanceName = maintenanceName;
} }
public String getDataSourceName() {
return dataSourceName;
}
public void setDataSourceName(String dataSourceName) {
this.dataSourceName = dataSourceName;
}
public String getDataSourceCode() {
return dataSourceCode;
}
public void setDataSourceCode(String dataSourceCode) {
this.dataSourceCode = dataSourceCode;
}
public String getCode() {
return code;
}
public void setCode(String code) {
this.code = code;
}
public String getBuildingId() {
return buildingId;
}
public void setBuildingId(String buildingId) {
this.buildingId = buildingId;
}
public String getOriginalId() {
return originalId;
}
public void setOriginalId(String originalId) {
this.originalId = originalId;
}
public String getBuildingName() {
return buildingName;
}
public void setBuildingName(String buildingName) {
this.buildingName = buildingName;
}
} }
package com.yeejoin.amos.patrol.mqtt;
import com.alibaba.fastjson.JSON;
import com.yeejoin.amos.patrol.business.service.intfc.IPointService;
import lombok.extern.slf4j.Slf4j;
import org.eclipse.paho.client.mqttv3.MqttMessage;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;
import org.typroject.tyboot.component.emq.EmqxListener;
import java.util.Map;
/**
* @author DELL
*/
@Component
@Slf4j
public class PatrolMqttListener extends EmqxListener {
@Value("${patrol.point.classify.topic}")
private String pointClassifyTopic;
@Autowired
private IPointService iPointService;
@Override
public void processMessage(String topic, MqttMessage message) {
if(log.isInfoEnabled()){
log.info("收到消息主题:{},消息内容:{}",topic, message.toString());
}
try {
Map<String, Object> msg = JSON.parseObject(message.toString());
if (pointClassifyTopic.equals(topic)) {
iPointService.syncPointClassify(msg);
}
log.info("巡检对象同步完成");
} catch (Exception e) {
log.info("巡检对象同步失败:{}", e.getMessage());
}
}
}
package com.yeejoin.amos.supervision.business.service.impl; package com.yeejoin.amos.supervision.business.service.impl;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.google.common.base.Joiner; import com.google.common.base.Joiner;
...@@ -29,6 +30,7 @@ import com.yeejoin.amos.supervision.business.vo.CheckAnalysisVo; ...@@ -29,6 +30,7 @@ import com.yeejoin.amos.supervision.business.vo.CheckAnalysisVo;
import com.yeejoin.amos.supervision.business.vo.CheckInfoVo; import com.yeejoin.amos.supervision.business.vo.CheckInfoVo;
import com.yeejoin.amos.supervision.business.vo.CheckVo; import com.yeejoin.amos.supervision.business.vo.CheckVo;
import com.yeejoin.amos.supervision.common.enums.*; import com.yeejoin.amos.supervision.common.enums.*;
import com.yeejoin.amos.supervision.core.async.AsyncTask;
import com.yeejoin.amos.supervision.core.common.dto.DangerDto; import com.yeejoin.amos.supervision.core.common.dto.DangerDto;
import com.yeejoin.amos.supervision.core.common.request.CommonPageable; import com.yeejoin.amos.supervision.core.common.request.CommonPageable;
import com.yeejoin.amos.supervision.core.common.response.*; import com.yeejoin.amos.supervision.core.common.response.*;
...@@ -47,7 +49,9 @@ import org.springframework.data.domain.Page; ...@@ -47,7 +49,9 @@ import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageImpl; import org.springframework.data.domain.PageImpl;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.util.ObjectUtils; import org.springframework.util.ObjectUtils;
import org.typroject.tyboot.core.foundation.context.RequestContext;
import org.typroject.tyboot.core.foundation.utils.Bean; import org.typroject.tyboot.core.foundation.utils.Bean;
import org.typroject.tyboot.core.foundation.utils.ValidationUtil;
import javax.annotation.Resource; import javax.annotation.Resource;
import javax.transaction.Transactional; import javax.transaction.Transactional;
...@@ -97,6 +101,12 @@ public class CheckServiceImpl implements ICheckService { ...@@ -97,6 +101,12 @@ public class CheckServiceImpl implements ICheckService {
IPlanTaskService planTaskService; IPlanTaskService planTaskService;
@Autowired @Autowired
private IPlanService planService;
@Autowired
private AsyncTask asyncTask;
@Autowired
DangerFeignClient DangerFeignClient; DangerFeignClient DangerFeignClient;
@Autowired @Autowired
...@@ -1414,7 +1424,6 @@ public class CheckServiceImpl implements ICheckService { ...@@ -1414,7 +1424,6 @@ public class CheckServiceImpl implements ICheckService {
if (!depName.contains(personIdentity.getCompanyName())) { if (!depName.contains(personIdentity.getCompanyName())) {
check.setDepName(depName + "," + personIdentity.getCompanyName()); check.setDepName(depName + "," + personIdentity.getCompanyName());
} }
} }
List<CheckInputParam> list = recordParam.getCheckItems(); List<CheckInputParam> list = recordParam.getCheckItems();
...@@ -1560,6 +1569,12 @@ public class CheckServiceImpl implements ICheckService { ...@@ -1560,6 +1569,12 @@ public class CheckServiceImpl implements ICheckService {
planTaskDetailMapper.finishTaskDetail(Long.parseLong(detail.get("planTaskDetailId").toString()), recordParam.getPointId(), planTaskDetailMapper.finishTaskDetail(Long.parseLong(detail.get("planTaskDetailId").toString()), recordParam.getPointId(),
recordParam.getPlanTaskId(), mtUserSeq, userName, size, planTaskStatus); recordParam.getPlanTaskId(), mtUserSeq, userName, size, planTaskStatus);
Plan plan = planService.queryPlanById(planTask.getPlanId());
// 计划完成,发送消息
if (PlanStatusEnum.COMPLETED.getValue() == plan.getStatus()){
asyncTask.sendPlanMsgToLeadPeople(RequestContext.cloneRequestContext(), plan);
}
// p_plan_task_detail更新隐患个数 // p_plan_task_detail更新隐患个数
planTaskDetailMapper.updateDanger(Long.parseLong(detail.get("planTaskDetailId").toString())); planTaskDetailMapper.updateDanger(Long.parseLong(detail.get("planTaskDetailId").toString()));
......
...@@ -318,7 +318,7 @@ public class AsyncTask { ...@@ -318,7 +318,7 @@ public class AsyncTask {
public void sendAddPlanMsg(RequestContextModel requestContextModel, Plan plan, List<String> userIds, boolean isSendWeb, boolean isSendApp){ public void sendAddPlanMsg(RequestContextModel requestContextModel, Plan plan, List<String> userIds, boolean isSendWeb, boolean isSendApp){
MessageModel model = new MessageModel(); MessageModel model = new MessageModel();
model.setTitle(plan.getName()); model.setTitle(plan.getName());
String body = String.format("计划名称:%s;检查类型:%s;创建时间:%s", String body = String.format("计划名称:%s;检查类型:%s;推送时间:%s",
plan.getName(), plan.getCheckTypeName(), DateUtil.date2LongStr(new Date())); plan.getName(), plan.getCheckTypeName(), DateUtil.date2LongStr(new Date()));
model.setBody(body); model.setBody(body);
try { try {
...@@ -327,7 +327,7 @@ public class AsyncTask { ...@@ -327,7 +327,7 @@ public class AsyncTask {
model.setMsgType(msgType); model.setMsgType(msgType);
model.setRelationId(String.valueOf(plan.getId())); model.setRelationId(String.valueOf(plan.getId()));
model.setRecivers(userIds); model.setRecivers(userIds);
// remoteSecurityService.addMessage(requestContextModel, model); remoteSecurityService.addMessage(requestContextModel, model);
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
} }
...@@ -341,7 +341,7 @@ public class AsyncTask { ...@@ -341,7 +341,7 @@ public class AsyncTask {
public void sendPlanMsgToLeadPeople(RequestContextModel requestContextModel, Plan plan){ public void sendPlanMsgToLeadPeople(RequestContextModel requestContextModel, Plan plan){
MessageModel model = new MessageModel(); MessageModel model = new MessageModel();
model.setTitle(plan.getName()); model.setTitle(plan.getName());
String body = String.format("计划名称:%s;检查类型:%s;创建时间:%s", String body = String.format("计划名称:%s;检查类型:%s;推送时间:%s",
plan.getName(), plan.getCheckTypeName(), DateUtil.date2LongStr(new Date())); plan.getName(), plan.getCheckTypeName(), DateUtil.date2LongStr(new Date()));
model.setBody(body); model.setBody(body);
String leadPeopleIds = plan.getLeadPeopleIds(); String leadPeopleIds = plan.getLeadPeopleIds();
...@@ -355,7 +355,7 @@ public class AsyncTask { ...@@ -355,7 +355,7 @@ public class AsyncTask {
model.setMsgType(msgType); model.setMsgType(msgType);
model.setRelationId(String.valueOf(plan.getId())); model.setRelationId(String.valueOf(plan.getId()));
model.setRecivers(recivers); model.setRecivers(recivers);
// remoteSecurityService.addMessage(requestContextModel, model); remoteSecurityService.addMessage(requestContextModel, model);
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
} }
...@@ -369,7 +369,7 @@ public class AsyncTask { ...@@ -369,7 +369,7 @@ public class AsyncTask {
public void sendPlanMsg(RequestContextModel requestContextModel, Plan plan){ public void sendPlanMsg(RequestContextModel requestContextModel, Plan plan){
MessageModel model = new MessageModel(); MessageModel model = new MessageModel();
model.setTitle(plan.getName()); model.setTitle(plan.getName());
String body = String.format("计划名称:%s;检查类型:%s;创建时间:%s", String body = String.format("计划名称:%s;检查类型:%s;推送时间:%s",
plan.getName(), plan.getCheckTypeName(), DateUtil.date2LongStr(new Date())); plan.getName(), plan.getCheckTypeName(), DateUtil.date2LongStr(new Date()));
model.setBody(body); model.setBody(body);
String leadPeopleIds = plan.getLeadPeopleIds(); String leadPeopleIds = plan.getLeadPeopleIds();
......
...@@ -35,6 +35,7 @@ import com.yeejoin.amos.boot.module.tzs.api.entity.WechatRelation; ...@@ -35,6 +35,7 @@ import com.yeejoin.amos.boot.module.tzs.api.entity.WechatRelation;
import com.yeejoin.amos.boot.module.tzs.api.enums.AlertStageEnums; import com.yeejoin.amos.boot.module.tzs.api.enums.AlertStageEnums;
import com.yeejoin.amos.boot.module.tzs.api.service.IMaintenanceUnitService; import com.yeejoin.amos.boot.module.tzs.api.service.IMaintenanceUnitService;
import com.yeejoin.amos.boot.module.tzs.api.service.IUseUnitService; import com.yeejoin.amos.boot.module.tzs.api.service.IUseUnitService;
import com.yeejoin.amos.boot.module.tzs.api.service.TzsAuthService;
import com.yeejoin.amos.boot.module.tzs.biz.service.impl.AlertCalledServiceImpl; import com.yeejoin.amos.boot.module.tzs.biz.service.impl.AlertCalledServiceImpl;
import com.yeejoin.amos.boot.module.tzs.biz.service.impl.AlertFormValueServiceImpl; import com.yeejoin.amos.boot.module.tzs.biz.service.impl.AlertFormValueServiceImpl;
import com.yeejoin.amos.boot.module.tzs.biz.service.impl.DispatchPaperServiceImpl; import com.yeejoin.amos.boot.module.tzs.biz.service.impl.DispatchPaperServiceImpl;
...@@ -44,6 +45,7 @@ import com.yeejoin.amos.boot.module.tzs.biz.service.impl.TemplateExportServiceIm ...@@ -44,6 +45,7 @@ import com.yeejoin.amos.boot.module.tzs.biz.service.impl.TemplateExportServiceIm
import com.yeejoin.amos.boot.module.tzs.biz.service.impl.WechatRelationServiceImpl; import com.yeejoin.amos.boot.module.tzs.biz.service.impl.WechatRelationServiceImpl;
import com.yeejoin.amos.boot.module.tzs.biz.utils.AlertBeanDtoVoUtils; import com.yeejoin.amos.boot.module.tzs.biz.utils.AlertBeanDtoVoUtils;
import com.yeejoin.amos.boot.module.tzs.biz.utils.BeanDtoVoUtils; import com.yeejoin.amos.boot.module.tzs.biz.utils.BeanDtoVoUtils;
import com.yeejoin.amos.feign.privilege.Privilege;
import com.yeejoin.amos.feign.privilege.model.AgencyUserModel; import com.yeejoin.amos.feign.privilege.model.AgencyUserModel;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
...@@ -71,6 +73,8 @@ import org.typroject.tyboot.core.restful.utils.ResponseModel; ...@@ -71,6 +73,8 @@ import org.typroject.tyboot.core.restful.utils.ResponseModel;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import java.io.UnsupportedEncodingException; import java.io.UnsupportedEncodingException;
import java.text.ParseException; import java.text.ParseException;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Date; import java.util.Date;
import java.util.LinkedHashMap; import java.util.LinkedHashMap;
import java.util.List; import java.util.List;
...@@ -125,6 +129,10 @@ public class AlertCalledController extends BaseController { ...@@ -125,6 +129,10 @@ public class AlertCalledController extends BaseController {
@Value("${mqtt.topic.alertInfo.push}") @Value("${mqtt.topic.alertInfo.push}")
private String alertInfopushTopic; private String alertInfopushTopic;
@Autowired
TzsAuthService tzsAuthService;
/** /**
* 新增警情接警填报记录 * 新增警情接警填报记录
* *
...@@ -172,8 +180,7 @@ public class AlertCalledController extends BaseController { ...@@ -172,8 +180,7 @@ public class AlertCalledController extends BaseController {
@TycloudOperation(ApiLevel = UserType.AGENCY) @TycloudOperation(ApiLevel = UserType.AGENCY)
@PostMapping(value = "/saveMobile") @PostMapping(value = "/saveMobile")
@ApiOperation(httpMethod = "POST", value = "新增警情接警填报记录", notes = "新增警情接警填报记录") @ApiOperation(httpMethod = "POST", value = "新增警情接警填报记录", notes = "新增警情接警填报记录")
public ResponseModel<AlertCalledDto> saveMobile(@RequestBody AlertCalledDto alertCalledDto public ResponseModel<AlertCalledDto> saveMobile(@RequestBody AlertCalledDto alertCalledDto) {
) {
if (ValidationUtil.isEmpty(alertCalledDto)) { if (ValidationUtil.isEmpty(alertCalledDto)) {
throw new BadRequest("参数校验失败."); throw new BadRequest("参数校验失败.");
} }
...@@ -207,6 +214,7 @@ public class AlertCalledController extends BaseController { ...@@ -207,6 +214,7 @@ public class AlertCalledController extends BaseController {
alertCalledDto.setEquipmentClassification("电梯"); alertCalledDto.setEquipmentClassification("电梯");
alertCalledDto.setEquipmentClassificationCode("3000"); alertCalledDto.setEquipmentClassificationCode("3000");
alertCalledDto.setCity(elevator.getCity()); alertCalledDto.setCity(elevator.getCity());
alertCalledDto.setRegionCode(elevator.getRegionCode());
alertCalledDto.setDistrict(elevator.getDistrict()); alertCalledDto.setDistrict(elevator.getDistrict());
AlertCalledDto alertCalledDtoReturn = iAlertCalledService.createAlertCalled(alertCalledDto); AlertCalledDto alertCalledDtoReturn = iAlertCalledService.createAlertCalled(alertCalledDto);
return ResponseHelper.buildResponse(alertCalledDtoReturn); return ResponseHelper.buildResponse(alertCalledDtoReturn);
...@@ -661,5 +669,35 @@ public class AlertCalledController extends BaseController { ...@@ -661,5 +669,35 @@ public class AlertCalledController extends BaseController {
} }
/**
* 根据regionCode 获取区域内实时警情
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@PostMapping(value = "/getActualAlert")
@ApiOperation(httpMethod = "POST", value = "根据regionCode 获取区域内实时警情", notes = "根据regionCode 获取区域内实时警情")
public ResponseModel<List<AlertPaperInfoDto>> getActualAlert(@RequestParam(name = "regionCodes", required = false) List<String> regionCodes) {
// 警情id 警情地址 警情状态 警情类型 警情发生时间
if(regionCodes == null) {
regionCodes = tzsAuthService.getUserRegionCode();
}
return ResponseHelper.buildResponse(iAlertCalledService.getAlertPaperInfoList(regionCodes,false));
}
/**
* 根据regionCode 获取区域内历史警情 七日内
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@PostMapping(value = "/getHistoryAlert")
@ApiOperation(httpMethod = "POST", value = "根据regionCode 获取区域内七日内历史警情", notes = "根据regionCode 获取区域内七日内历史警情")
public ResponseModel<List<AlertPaperInfoDto>> getHistoryAlert(@RequestParam(name = "regionCodes", required = false) List<String> regionCodes) {
// 警情id 警情地址 警情状态 警情类型 警情发生时间
if(regionCodes == null) {
regionCodes = tzsAuthService.getUserRegionCode();
}
return ResponseHelper.buildResponse(iAlertCalledService.getAlertPaperInfoList(regionCodes,true));
}
} }
package com.yeejoin.amos.boot.module.tzs.biz.controller;
import com.yeejoin.amos.boot.biz.common.controller.BaseController;
import com.yeejoin.amos.boot.module.tzs.api.service.TzsAuthService;
import com.yeejoin.amos.feign.privilege.Privilege;
import com.yeejoin.amos.feign.privilege.model.AgencyUserModel;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.typroject.tyboot.core.foundation.enumeration.UserType;
import org.typroject.tyboot.core.restful.doc.TycloudOperation;
import org.typroject.tyboot.core.restful.utils.ResponseHelper;
import org.typroject.tyboot.core.restful.utils.ResponseModel;
import java.util.ArrayList;
import java.util.List;
/**
* 特种设备权限controller
*/
@RestController
@Api(tags = "特种设备权限Api")
@RequestMapping(value = "/tzs-auth-api")
public class TzsAuthController extends BaseController {
@Autowired
TzsAuthService tzsAuthService;
/**
* 判断用户是否是管理员
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping(value = "/isUserAdmin")
@ApiOperation(httpMethod = "GET", value = "判断用户是否是管理员", notes = "判断用户是否是管理员")
public ResponseModel<Boolean> isUserAdmin() {
Boolean flag = false;
AgencyUserModel me = Privilege.agencyUserClient.getme().getResult();
if(me.getUserName().equals("tzs_wjl")) {
flag = true;
}
return ResponseHelper.buildResponse(flag);
}
/**
* 获取用户regionCode
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping(value = "/getUserRegincode")
@ApiOperation(httpMethod = "GET", value = "获取用户regionCode", notes = "获取用户regionCode")
public ResponseModel<List<String>> getHistoryAlert() {
List<String> regionList = new ArrayList<>();
AgencyUserModel me = Privilege.agencyUserClient.getme().getResult();
regionList.add("610100");
regionList.add("610300");
return ResponseHelper.buildResponse(regionList);
}
}
package com.yeejoin.amos.boot.module.tzs.biz.controller; package com.yeejoin.amos.boot.module.tzs.biz.controller;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.boot.biz.common.controller.BaseController; import com.yeejoin.amos.boot.biz.common.controller.BaseController;
import com.yeejoin.amos.boot.biz.common.utils.DateUtils; import com.yeejoin.amos.boot.biz.common.utils.DateUtils;
import com.yeejoin.amos.boot.biz.common.utils.RedisKey;
import com.yeejoin.amos.boot.module.tzs.api.dto.AlertCalledDto;
import com.yeejoin.amos.boot.module.tzs.api.dto.AlertCalledFormDto; import com.yeejoin.amos.boot.module.tzs.api.dto.AlertCalledFormDto;
import com.yeejoin.amos.boot.module.tzs.api.dto.AlertCalledQueryDto;
import com.yeejoin.amos.boot.module.tzs.api.dto.VoiceRecordFileDto; import com.yeejoin.amos.boot.module.tzs.api.dto.VoiceRecordFileDto;
import com.yeejoin.amos.boot.module.tzs.api.entity.AlertCalled;
import com.yeejoin.amos.boot.module.tzs.api.entity.VoiceRecordFile; import com.yeejoin.amos.boot.module.tzs.api.entity.VoiceRecordFile;
import com.yeejoin.amos.boot.module.tzs.api.service.ICtiService;
import com.yeejoin.amos.boot.module.tzs.biz.service.impl.AlertCalledServiceImpl; import com.yeejoin.amos.boot.module.tzs.biz.service.impl.AlertCalledServiceImpl;
import com.yeejoin.amos.boot.module.tzs.biz.service.impl.VoiceRecordFileServiceImpl; import com.yeejoin.amos.boot.module.tzs.biz.service.impl.VoiceRecordFileServiceImpl;
import com.yeejoin.amos.boot.module.tzs.biz.utils.AlertBeanDtoVoUtils;
import com.yeejoin.amos.boot.module.tzs.biz.utils.BeanDtoVoUtils;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.BeanUtils; import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Async;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
import org.typroject.tyboot.core.foundation.enumeration.UserType; import org.typroject.tyboot.core.foundation.enumeration.UserType;
import org.typroject.tyboot.core.foundation.utils.ValidationUtil; import org.typroject.tyboot.core.foundation.utils.ValidationUtil;
...@@ -29,13 +36,9 @@ import org.typroject.tyboot.core.restful.exception.instance.BadRequest; ...@@ -29,13 +36,9 @@ import org.typroject.tyboot.core.restful.exception.instance.BadRequest;
import org.typroject.tyboot.core.restful.utils.ResponseHelper; import org.typroject.tyboot.core.restful.utils.ResponseHelper;
import org.typroject.tyboot.core.restful.utils.ResponseModel; import org.typroject.tyboot.core.restful.utils.ResponseModel;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Calendar; import java.util.Calendar;
import java.util.Date;
import java.util.List; import java.util.List;
import java.util.Map;
import java.util.UUID; import java.util.UUID;
/** /**
...@@ -104,9 +107,6 @@ public class VoiceRecordFileController extends BaseController { ...@@ -104,9 +107,6 @@ public class VoiceRecordFileController extends BaseController {
VoiceRecordFileDto target = new VoiceRecordFileDto(); VoiceRecordFileDto target = new VoiceRecordFileDto();
// 把原对象数据拷贝到新对象 // 把原对象数据拷贝到新对象
BeanUtils.copyProperties(voiceRecord, target); BeanUtils.copyProperties(voiceRecord, target);
if(voiceRecord.getTelStartTime() != null && voiceRecord.getTelEndTime() != null) {
target.setTelTime(DateUtils.getTimestr( voiceRecord.getTelEndTime(),voiceRecord.getTelStartTime()));
}
dtoList.add(target); dtoList.add(target);
}); });
return ResponseHelper.buildResponse(dtoList); return ResponseHelper.buildResponse(dtoList);
...@@ -132,4 +132,38 @@ public class VoiceRecordFileController extends BaseController { ...@@ -132,4 +132,38 @@ public class VoiceRecordFileController extends BaseController {
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(value = "查询通话记录", notes = "查询通话记录")
@GetMapping("/selectRecord")
public ResponseModel<Page<VoiceRecordFileDto>> queryVoiceCodeByPager(VoiceRecordFileDto model,
@RequestParam(value = "pageNum") int pageNum, @RequestParam(value = "pageSize") int pageSize, String sort ) {
Page<VoiceRecordFileDto> page = new Page<VoiceRecordFileDto>();
page.setCurrent(pageNum);
page.setSize(pageSize);
String sortParam = "";
String sortRule = "";
if(sort!=null) { // 排序失效
String[] date= sort.split(",");
if(date[1].equals("ascend")) {
sortParam = RedisKey.humpToLine(date[0]);
sortRule = "asc";
}else {
sortParam =RedisKey.humpToLine(date[0]);
sortRule = "desc";
}
}else {
sortParam = "call_time";
sortRule = "desc";
}
Page<VoiceRecordFileDto> pageBean = voiceRecordFileServiceImpl.queryRecordListByQueryDto(page,
model.getTelStartTimeStr(),model.getTelEndTimeStr(),model.getFileType(),model.getTel(),
model.getWorkNum(),sortParam,sortRule);
Page<VoiceRecordFileDto> result = new Page<VoiceRecordFileDto>(pageNum,pageSize);
long totle = pageBean.getTotal();
result.setRecords(pageBean.getRecords());
result.setTotal(totle);
return ResponseHelper.buildResponse(result);
}
} }
...@@ -486,6 +486,7 @@ public class AlertCalledServiceImpl extends BaseService<AlertCalledDto,AlertCall ...@@ -486,6 +486,7 @@ public class AlertCalledServiceImpl extends BaseService<AlertCalledDto,AlertCall
alertCalled.setEquipmentId(elevator.getSequenceNbr()); alertCalled.setEquipmentId(elevator.getSequenceNbr());
alertCalled.setCity(elevator.getCity()); alertCalled.setCity(elevator.getCity());
alertCalled.setDistrict(elevator.getDistrict()); alertCalled.setDistrict(elevator.getDistrict());
alertCalled.setRegionCode(elevator.getRegionCode());
this.save(alertCalled); this.save(alertCalled);
// 动态表单 // 动态表单
...@@ -670,4 +671,15 @@ public class AlertCalledServiceImpl extends BaseService<AlertCalledDto,AlertCall ...@@ -670,4 +671,15 @@ public class AlertCalledServiceImpl extends BaseService<AlertCalledDto,AlertCall
// } // }
// } // }
} }
public List<AlertPaperInfoDto> getAlertPaperInfoList(List<String> regionCodes, Boolean isHistory) {
List<AlertPaperInfoDto> temp = baseMapper.getAlertPaperInfoList(regionCodes, isHistory);
temp.stream().forEach(t -> {
DispatchPaper paper = dispatchPaperService.getOne(new LambdaQueryWrapper<DispatchPaper>().eq(DispatchPaper::getIsDelete,false).eq(DispatchPaper::getAlertId,t.getAlertId()));
if(paper != null) {
t.setFinishTime(paper.getFeedbackFinishTime());
}
});
return temp;
}
} }
\ No newline at end of file
...@@ -7,6 +7,8 @@ import com.yeejoin.amos.boot.biz.common.utils.RedisUtils; ...@@ -7,6 +7,8 @@ import com.yeejoin.amos.boot.biz.common.utils.RedisUtils;
import com.yeejoin.amos.boot.module.tzs.api.service.ICtiService; import com.yeejoin.amos.boot.module.tzs.api.service.ICtiService;
import com.yeejoin.amos.boot.module.tzs.biz.utils.HttpUtils; import com.yeejoin.amos.boot.module.tzs.biz.utils.HttpUtils;
import com.yeejoin.amos.component.feign.model.FeignClientResult; import com.yeejoin.amos.component.feign.model.FeignClientResult;
import com.yeejoin.amos.feign.privilege.Privilege;
import com.yeejoin.amos.feign.privilege.model.AgencyUserModel;
import com.yeejoin.amos.feign.systemctl.Systemctl; import com.yeejoin.amos.feign.systemctl.Systemctl;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value; import org.springframework.beans.factory.annotation.Value;
...@@ -85,6 +87,7 @@ public class CtiServiceImpl implements ICtiService { ...@@ -85,6 +87,7 @@ public class CtiServiceImpl implements ICtiService {
String token = this.getAccessToken(); String token = this.getAccessToken();
// gid code extphone 目前写死 后面根据用户获取 // gid code extphone 目前写死 后面根据用户获取
String gid = "61,默认,0"; String gid = "61,默认,0";
AgencyUserModel me = Privilege.agencyUserClient.getme().getResult();
String code = "1001"; String code = "1001";
String extphone = "10001001"; String extphone = "10001001";
String loginUrl = ctiUrl + "/cti/login" + "?accessToken=" + token; String loginUrl = ctiUrl + "/cti/login" + "?accessToken=" + token;
...@@ -133,7 +136,7 @@ public class CtiServiceImpl implements ICtiService { ...@@ -133,7 +136,7 @@ public class CtiServiceImpl implements ICtiService {
JSONArray loginData = response.getJSONArray("data"); JSONArray loginData = response.getJSONArray("data");
return loginData; return loginData;
} catch (Exception e) { } catch (Exception e) {
throw new BadRequest("获取loginData 出错:" + e.getMessage()); throw new BadRequest("获取话单出错: " + e.getMessage());
} }
} else { //登陆失败 } else { //登陆失败
throw new BadRequest("获取话单出错:" + response.getString("msg")); throw new BadRequest("获取话单出错:" + response.getString("msg"));
......
...@@ -5,6 +5,8 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; ...@@ -5,6 +5,8 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.yeejoin.amos.boot.biz.common.utils.DateUtils; import com.yeejoin.amos.boot.biz.common.utils.DateUtils;
import com.yeejoin.amos.boot.biz.common.utils.RedisUtils; import com.yeejoin.amos.boot.biz.common.utils.RedisUtils;
import com.yeejoin.amos.boot.module.common.api.dto.AttachmentDto;
import com.yeejoin.amos.boot.module.common.api.service.ISourceFileService;
import com.yeejoin.amos.boot.module.tzs.api.dto.AlertCalledDto; import com.yeejoin.amos.boot.module.tzs.api.dto.AlertCalledDto;
import com.yeejoin.amos.boot.module.tzs.api.dto.AlertCalledFormDto; import com.yeejoin.amos.boot.module.tzs.api.dto.AlertCalledFormDto;
import com.yeejoin.amos.boot.module.tzs.api.dto.DispatchPaperFormDto; import com.yeejoin.amos.boot.module.tzs.api.dto.DispatchPaperFormDto;
...@@ -79,6 +81,10 @@ public class RepairConsultServiceImpl extends BaseService<RepairConsultDto,Repai ...@@ -79,6 +81,10 @@ public class RepairConsultServiceImpl extends BaseService<RepairConsultDto,Repai
@Value("${mqtt.topic.alertMatrix.push}") @Value("${mqtt.topic.alertMatrix.push}")
private String alertMatrixpushTopic; private String alertMatrixpushTopic;
@Autowired
ISourceFileService sourceFileService;
/** /**
* 记录处置日志同时修改案件的状态 * 记录处置日志同时修改案件的状态
* @param alertId * @param alertId
...@@ -109,6 +115,7 @@ public class RepairConsultServiceImpl extends BaseService<RepairConsultDto,Repai ...@@ -109,6 +115,7 @@ public class RepairConsultServiceImpl extends BaseService<RepairConsultDto,Repai
String content = template.getContent(); String content = template.getContent();
String createTime = DateUtils.getDateNowString(); String createTime = DateUtils.getDateNowString();
DispatchPaperEnums CZHJ = null; DispatchPaperEnums CZHJ = null;
StringBuffer attach = new StringBuffer();
// 公众号生成接警记录 // 公众号生成接警记录
if(AlertStageEnums.JJ.getCode().equals(type)) { if(AlertStageEnums.JJ.getCode().equals(type)) {
// 接警的处置环节为已接警 // 接警的处置环节为已接警
...@@ -142,6 +149,15 @@ public class RepairConsultServiceImpl extends BaseService<RepairConsultDto,Repai ...@@ -142,6 +149,15 @@ public class RepairConsultServiceImpl extends BaseService<RepairConsultDto,Repai
throw new BadRequest("警情类型缺失"); throw new BadRequest("警情类型缺失");
content = content.replace("$createTime",createTime).replace("$call",emergency_call); content = content.replace("$createTime",createTime).replace("$call",emergency_call);
content = content.replace("$area",area).replace("$alertType",alertType); content = content.replace("$area",area).replace("$alertType",alertType);
// 小程序接警 记录添加图片附件 bykongfm 2021-11-02 task-4217
Map<String, List<AttachmentDto>> imgMap = sourceFileService.getAttachments(alertId);
List<AttachmentDto> mapList = imgMap.get("imgs");
if(mapList != null && mapList.size() > 0) {
mapList.stream().forEach(m -> {
attach.append(",");
attach.append(m.getUrl());
});
}
} else if(TzsCommonParam.PQ.equals(type)) { } else if(TzsCommonParam.PQ.equals(type)) {
// 派遣的处置环节为已派遣 // 派遣的处置环节为已派遣
CZHJ = DispatchPaperEnums.dispatched; CZHJ = DispatchPaperEnums.dispatched;
...@@ -216,6 +232,15 @@ public class RepairConsultServiceImpl extends BaseService<RepairConsultDto,Repai ...@@ -216,6 +232,15 @@ public class RepairConsultServiceImpl extends BaseService<RepairConsultDto,Repai
// 反馈方式从动态表单中取得 // 反馈方式从动态表单中取得
String FKFS = tempMap.get("FKFS") == null ? "" : tempMap.get("FKFS"); String FKFS = tempMap.get("FKFS") == null ? "" : tempMap.get("FKFS");
content = content.replace("$FKFS",FKFS).replace("$fixResult",tempMap.get("fixResult")); content = content.replace("$FKFS",FKFS).replace("$fixResult",tempMap.get("fixResult"));
// 小程序维修反馈 记录添加图片附件 bykongfm 2021-11-02 task-4217
Map<String, List<AttachmentDto>> imgMap = sourceFileService.getAttachments(dispatchTask.getPaperId());
List<AttachmentDto> mapList = imgMap.get("imgs");
if(mapList != null && mapList.size() > 0) {
mapList.stream().forEach(m -> {
attach.append(",");
attach.append(m.getUrl());
});
}
} else if(TzsCommonParam.WXFK_TS.equals(type)) { //从派遣单获取数据 } else if(TzsCommonParam.WXFK_TS.equals(type)) { //从派遣单获取数据
//投诉的维修反馈修改成维保已处置 //投诉的维修反馈修改成维保已处置
CZHJ = DispatchPaperEnums.disposed; CZHJ = DispatchPaperEnums.disposed;
...@@ -235,6 +260,15 @@ public class RepairConsultServiceImpl extends BaseService<RepairConsultDto,Repai ...@@ -235,6 +260,15 @@ public class RepairConsultServiceImpl extends BaseService<RepairConsultDto,Repai
}); });
content = content.replace("$FKFS",tempMap.get(TzsCommonParam.FKFS)).replace("$fixResult",tempMap.get("fixResult")); content = content.replace("$FKFS",tempMap.get(TzsCommonParam.FKFS)).replace("$fixResult",tempMap.get("fixResult"));
type = TzsCommonParam.WXFK; type = TzsCommonParam.WXFK;
// 小程序维修反馈 记录添加图片附件 bykongfm 2021-11-02 task-4217
Map<String, List<AttachmentDto>> imgMap = sourceFileService.getAttachments(dispatchTask.getPaperId());
List<AttachmentDto> mapList = imgMap.get("imgs");
if(mapList != null && mapList.size() > 0) {
mapList.stream().forEach(m -> {
attach.append(",");
attach.append(m.getUrl());
});
}
} else if(TzsCommonParam.BXFK.equals(type)) { } else if(TzsCommonParam.BXFK.equals(type)) {
//报修反馈 //报修反馈
CZHJ = DispatchPaperEnums.reportorBack; CZHJ = DispatchPaperEnums.reportorBack;
...@@ -249,6 +283,15 @@ public class RepairConsultServiceImpl extends BaseService<RepairConsultDto,Repai ...@@ -249,6 +283,15 @@ public class RepairConsultServiceImpl extends BaseService<RepairConsultDto,Repai
} }
}); });
content = content.replace("$FKFS",dispatchPaperFormDto.getDispatchPaper().getFeedbackType()).replace("$feedbackResult",tempMap.get("feedbackResult")); content = content.replace("$FKFS",dispatchPaperFormDto.getDispatchPaper().getFeedbackType()).replace("$feedbackResult",tempMap.get("feedbackResult"));
// 小程序报修人反馈 记录添加图片附件 bykongfm 2021-11-02 task-4217
Map<String, List<AttachmentDto>> imgMap = sourceFileService.getAttachments(alertId);
List<AttachmentDto> mapList = imgMap.get("feedbacks");
if(mapList != null && mapList.size() > 0) {
mapList.stream().forEach(m -> {
attach.append(",");
attach.append(m.getUrl());
});
}
} else if(TzsCommonParam.TSRFK.equals(type)) { } else if(TzsCommonParam.TSRFK.equals(type)) {
//投诉人已反馈 //投诉人已反馈
CZHJ = DispatchPaperEnums.complainantBack; CZHJ = DispatchPaperEnums.complainantBack;
...@@ -263,12 +306,25 @@ public class RepairConsultServiceImpl extends BaseService<RepairConsultDto,Repai ...@@ -263,12 +306,25 @@ public class RepairConsultServiceImpl extends BaseService<RepairConsultDto,Repai
} }
}); });
content = content.replace("$FKFS",dispatchPaperFormDto.getDispatchPaper().getFeedbackType()).replace("$feedbackResult",tempMap.get("feedbackResult")); content = content.replace("$FKFS",dispatchPaperFormDto.getDispatchPaper().getFeedbackType()).replace("$feedbackResult",tempMap.get("feedbackResult"));
// 小程序投诉人反馈记录添加图片附件 bykongfm 2021-11-02 task-4217
Map<String, List<AttachmentDto>> imgMap = sourceFileService.getAttachments(alertId);
List<AttachmentDto> mapList = imgMap.get("feedbacks");
if(mapList != null && mapList.size() > 0) {
mapList.stream().forEach(m -> {
attach.append(",");
attach.append(m.getUrl());
});
}
} }
AlertStageEnums RZHJ = AlertStageEnums.getEnumByCode(type); AlertStageEnums RZHJ = AlertStageEnums.getEnumByCode(type);
repairConsult.setType(RZHJ.getCode()); repairConsult.setType(RZHJ.getCode());
repairConsult.setAlertStageCode(RZHJ.getId()); repairConsult.setAlertStageCode(RZHJ.getId());
repairConsult.setAlertStatus(RZHJ.getValue()); repairConsult.setAlertStatus(RZHJ.getValue());
repairConsult.setDescription(content); repairConsult.setDescription(content);
if(attach.length() > 0) {
String attachment = attach.toString().substring(1);
repairConsult.setAttachment(attachment);
}
flag = this.save(repairConsult); flag = this.save(repairConsult);
if(flag) { if(flag) {
// 记录处置记录后修改 案件状态 // 记录处置记录后修改 案件状态
...@@ -296,7 +352,4 @@ public class RepairConsultServiceImpl extends BaseService<RepairConsultDto,Repai ...@@ -296,7 +352,4 @@ public class RepairConsultServiceImpl extends BaseService<RepairConsultDto,Repai
return flag; return flag;
} }
} }
\ No newline at end of file
package com.yeejoin.amos.boot.module.tzs.biz.service.impl;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.google.common.collect.Maps;
import com.yeejoin.amos.boot.biz.common.utils.DateUtils;
import com.yeejoin.amos.boot.biz.common.utils.RedisKey;
import com.yeejoin.amos.boot.biz.common.utils.RedisUtils;
import com.yeejoin.amos.boot.module.common.api.dto.AttachmentDto;
import com.yeejoin.amos.boot.module.common.api.service.ISourceFileService;
import com.yeejoin.amos.boot.module.tzs.api.dto.AlertCalledDto;
import com.yeejoin.amos.boot.module.tzs.api.dto.AlertCalledFormDto;
import com.yeejoin.amos.boot.module.tzs.api.dto.AlertCalledObjsDto;
import com.yeejoin.amos.boot.module.tzs.api.dto.AlertCalledQueryDto;
import com.yeejoin.amos.boot.module.tzs.api.dto.AlertCalledRecordDto;
import com.yeejoin.amos.boot.module.tzs.api.dto.AlertHandlerDto;
import com.yeejoin.amos.boot.module.tzs.api.dto.AlertHandlerInfoDto;
import com.yeejoin.amos.boot.module.tzs.api.dto.AlertPaperInfoDto;
import com.yeejoin.amos.boot.module.tzs.api.dto.DutySeatDto;
import com.yeejoin.amos.boot.module.tzs.api.dto.FormValue;
import com.yeejoin.amos.boot.module.tzs.api.dto.WechatMyBusinessListDto;
import com.yeejoin.amos.boot.module.tzs.api.dto.WechatMyBussinessDto;
import com.yeejoin.amos.boot.module.tzs.api.entity.AlertCalled;
import com.yeejoin.amos.boot.module.tzs.api.entity.AlertFormValue;
import com.yeejoin.amos.boot.module.tzs.api.entity.DispatchPaper;
import com.yeejoin.amos.boot.module.tzs.api.entity.DispatchTask;
import com.yeejoin.amos.boot.module.tzs.api.entity.Elevator;
import com.yeejoin.amos.boot.module.tzs.api.entity.VoiceRecordFile;
import com.yeejoin.amos.boot.module.tzs.api.enums.AlertStageEnums;
import com.yeejoin.amos.boot.module.tzs.api.enums.DispatchPaperEnums;
import com.yeejoin.amos.boot.module.tzs.api.enums.TzsCommonParam;
import com.yeejoin.amos.boot.module.tzs.api.mapper.AlertCalledMapper;
import com.yeejoin.amos.boot.module.tzs.api.service.IAlertCalledService;
import com.yeejoin.amos.boot.module.tzs.api.service.TzsAuthService;
import com.yeejoin.amos.boot.module.tzs.biz.utils.BeanDtoVoUtils;
import com.yeejoin.amos.component.feign.model.FeignClientResult;
import com.yeejoin.amos.feign.privilege.Privilege;
import com.yeejoin.amos.feign.privilege.model.AgencyUserModel;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.typroject.tyboot.core.foundation.utils.ValidationUtil;
import org.typroject.tyboot.core.rdbms.service.BaseService;
import org.typroject.tyboot.core.restful.exception.instance.BadRequest;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.Date;
import java.util.HashMap;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
/**
* 特种设备权限服务实现类
*/
@Service
public class TzsAuthServiceImpl implements TzsAuthService {
@Override
public List<String> getUserRegionCode() {
List<String> regionList = new ArrayList<>();
AgencyUserModel me = Privilege.agencyUserClient.getme().getResult();
regionList.add("610100");
return regionList;
}
}
\ No newline at end of file
...@@ -6,6 +6,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page; ...@@ -6,6 +6,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.boot.biz.common.feign.AmosFeignService; import com.yeejoin.amos.boot.biz.common.feign.AmosFeignService;
import com.yeejoin.amos.boot.biz.common.utils.DateUtils; import com.yeejoin.amos.boot.biz.common.utils.DateUtils;
import com.yeejoin.amos.boot.module.tzs.api.dto.AlertCalledFormDto; import com.yeejoin.amos.boot.module.tzs.api.dto.AlertCalledFormDto;
import com.yeejoin.amos.boot.module.tzs.api.dto.AlertCalledQueryDto;
import com.yeejoin.amos.boot.module.tzs.api.dto.VoiceRecordFileDto; import com.yeejoin.amos.boot.module.tzs.api.dto.VoiceRecordFileDto;
import com.yeejoin.amos.boot.module.tzs.api.entity.VoiceRecordFile; import com.yeejoin.amos.boot.module.tzs.api.entity.VoiceRecordFile;
import com.yeejoin.amos.boot.module.tzs.api.mapper.VoiceRecordFileMapper; import com.yeejoin.amos.boot.module.tzs.api.mapper.VoiceRecordFileMapper;
...@@ -92,6 +93,8 @@ public class VoiceRecordFileServiceImpl extends BaseService<VoiceRecordFileDto,V ...@@ -92,6 +93,8 @@ public class VoiceRecordFileServiceImpl extends BaseService<VoiceRecordFileDto,V
} catch (Exception e) { } catch (Exception e) {
logger.error("日期转换错误"); logger.error("日期转换错误");
} }
int times = recordInfo.getIntValue("times");
model.setTelTime(DateUtils.secondsToTimeStr(times));
model.setTelStartTime(telStartTime); model.setTelStartTime(telStartTime);
model.setTelEndTime(telEndTime); model.setTelEndTime(telEndTime);
if(1 == recordInfo.getInteger("callType")) { if(1 == recordInfo.getInteger("callType")) {
...@@ -128,4 +131,18 @@ public class VoiceRecordFileServiceImpl extends BaseService<VoiceRecordFileDto,V ...@@ -128,4 +131,18 @@ public class VoiceRecordFileServiceImpl extends BaseService<VoiceRecordFileDto,V
} }
@Override
public Page<VoiceRecordFileDto> queryRecordListByQueryDto(Page<VoiceRecordFileDto> page, String telStartTimeStr, String telEndTimeStr, String fileType, String tel, String workNum, String sortParam, String sortRule) {
Page<List<VoiceRecordFileDto>>list = baseMapper.queryRecordListByQueryDto(page,
telStartTimeStr,telEndTimeStr,fileType,tel,
workNum,sortParam,sortRule);
Page<VoiceRecordFileDto> page1 = new Page<>();
List<VoiceRecordFileDto> resultDtoList = JSONArray.parseArray(JSONArray.toJSONString(list.getRecords()),VoiceRecordFileDto.class);
page1.setCurrent(page.getCurrent());
page1.setSize(page.getSize());
page1.setTotal(list.getTotal());
page1.setRecords(resultDtoList);
return page1;
}
} }
\ No newline at end of file
...@@ -2070,6 +2070,29 @@ ...@@ -2070,6 +2070,29 @@
</sql> </sql>
</changeSet> </changeSet>
<changeSet author="litw" id="2021-11-03-01">
<preConditions onFail="MARK_RAN">
<not>
<tableExists tableName="cb_water_resource_index"/>
</not>
</preConditions>
<comment>create table cb_water_resource_index</comment>
<sql>
CREATE TABLE `cb_water_resource_index` (
`sequence_nbr` bigint(20) NOT NULL,
`equipment_id` bigint(20) NULL COMMENT '指标拥有者ID:关联装备定义ID',
`water_id` bigint(20) NOT NULL COMMENT '消防水源id',
`name` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NULL COMMENT '名称',
`name_key` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NOT null,
`perf_value` varchar(200) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '指标值',
`rec_user_id` bigint(20) NOT NULL COMMENT '更新人id',
`rec_user_name` varchar(30) NOT NULL COMMENT '更新人名称',
`rec_date` datetime NOT NULL ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
`is_delete` bit(1) NOT NULL DEFAULT b'0' COMMENT '是否删除(0:未删除,1:已删除)',
PRIMARY KEY (`sequence_nbr`) USING BTREE
) COMMENT = '消防水源物联参数' ;
</sql>
</changeSet>
</databaseChangeLog> </databaseChangeLog>
package com.yeejoin.amos; package com.yeejoin.amos;
import com.yeejoin.amos.patrol.mqtt.PatrolMqttListener;
import org.eclipse.paho.client.mqttv3.MqttException;
import org.mybatis.spring.annotation.MapperScan; import org.mybatis.spring.annotation.MapperScan;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.SpringApplication; import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.context.properties.EnableConfigurationProperties; import org.springframework.boot.context.properties.EnableConfigurationProperties;
...@@ -20,6 +24,7 @@ import org.springframework.data.jpa.repository.config.EnableJpaAuditing; ...@@ -20,6 +24,7 @@ import org.springframework.data.jpa.repository.config.EnableJpaAuditing;
import org.springframework.scheduling.annotation.EnableAsync; import org.springframework.scheduling.annotation.EnableAsync;
import org.springframework.transaction.annotation.EnableTransactionManagement; import org.springframework.transaction.annotation.EnableTransactionManagement;
import org.springframework.web.client.RestTemplate; import org.springframework.web.client.RestTemplate;
import org.typroject.tyboot.component.emq.EmqKeeper;
import org.typroject.tyboot.core.restful.config.JsonSerializerManage; import org.typroject.tyboot.core.restful.config.JsonSerializerManage;
import org.typroject.tyboot.core.restful.exception.GlobalExceptionHandler; import org.typroject.tyboot.core.restful.exception.GlobalExceptionHandler;
...@@ -59,6 +64,15 @@ public class PatrolApplication { ...@@ -59,6 +64,15 @@ public class PatrolApplication {
return new RestTemplate(); return new RestTemplate();
} }
@Autowired
private PatrolMqttListener patrolMqttListener;
@Autowired
private EmqKeeper emqKeeper;
@Value("${patrol.topic}")
private String patrolTopic;
/** /**
* 启动amosop-server * 启动amosop-server
* *
...@@ -81,4 +95,18 @@ public class PatrolApplication { ...@@ -81,4 +95,18 @@ public class PatrolApplication {
"----------------------------------------------------------"); "----------------------------------------------------------");
} }
/**
* 初始化MQTT
* @throws MqttException
*/
@Bean
void initMqtt() {
try {
emqKeeper.getMqttClient().subscribe(patrolTopic, 1, patrolMqttListener);
} catch (MqttException e) {
e.printStackTrace();
logger.error("EMQ初始化连接失败!");
}
}
} }
\ No newline at end of file
spring.application.name = AMOS-PATROL-tb spring.application.name = AMOS-PATROL
server.servlet.context-path=/patrol server.servlet.context-path=/patrol
server.port = 8082 server.port = 8082
...@@ -44,6 +44,8 @@ Push.fegin.name=APPMESSAGEPUSHSERVICE ...@@ -44,6 +44,8 @@ Push.fegin.name=APPMESSAGEPUSHSERVICE
amos.flowWork.topic =/STATE_GRID/hazardManagement amos.flowWork.topic =/STATE_GRID/hazardManagement
amosRefresh.danger.topic =patrolDangerInsertOrUpdate amosRefresh.danger.topic =patrolDangerInsertOrUpdate
amosRefresh.patrol.topic =patrolCheckInsert amosRefresh.patrol.topic =patrolCheckInsert
patrol.point.classify.topic=patrol/point/classify
patrol.topic=patrol/#
#停止通过WEB公开所有端点 #停止通过WEB公开所有端点
management.endpoints.web.exposure.exclude=* management.endpoints.web.exposure.exclude=*
## redis失效时间 ## redis失效时间
......
...@@ -313,4 +313,121 @@ ...@@ -313,4 +313,121 @@
</sql> </sql>
</changeSet> </changeSet>
<changeSet author="xixinzhao" id="20211102-19">
<preConditions onFail="MARK_RAN">
<not>
<columnExists tableName="p_point_classify" columnName="code"/>
</not>
</preConditions>
<comment>p_point_classify add column code</comment>
<sql>
ALTER TABLE `p_point_classify`
ADD COLUMN `code` varchar(255) DEFAULT NULL COMMENT '编号';
</sql>
</changeSet>
<changeSet author="xixinzhao" id="20211102-20">
<preConditions onFail="MARK_RAN">
<not>
<columnExists tableName="p_point_classify" columnName="category_name"/>
</not>
</preConditions>
<comment>p_point_classify add column category_name</comment>
<sql>
ALTER TABLE `p_point_classify`
ADD COLUMN `category_name` varchar(255) DEFAULT NULL COMMENT '分类名称';
</sql>
</changeSet>
<changeSet author="xixinzhao" id="20211102-22">
<preConditions onFail="MARK_RAN">
<not>
<columnExists tableName="p_point_classify" columnName="address"/>
</not>
</preConditions>
<comment>p_point_classify add column address</comment>
<sql>
ALTER TABLE `p_point_classify`
ADD COLUMN `address` varchar(255) DEFAULT NULL COMMENT '位置';
</sql>
</changeSet>
<changeSet author="xixinzhao" id="20211102-23">
<preConditions onFail="MARK_RAN">
<not>
<columnExists tableName="p_point_classify" columnName="data_source_code"/>
</not>
</preConditions>
<comment>p_point_classify add column data_source_code</comment>
<sql>
ALTER TABLE `p_point_classify`
ADD COLUMN `data_source_code` int(10) DEFAULT NULL COMMENT '数据源code(1 消防装备 2 重点部位 3 自定义)';
</sql>
</changeSet>
<changeSet author="xixinzhao" id="20211102-24">
<preConditions onFail="MARK_RAN">
<not>
<columnExists tableName="p_point_classify" columnName="data_source_name"/>
</not>
</preConditions>
<comment>p_point_classify add column data_source_name</comment>
<sql>
ALTER TABLE `p_point_classify`
ADD COLUMN `data_source_name` varchar(255) DEFAULT NULL COMMENT '数据源名称(冗余)';
</sql>
</changeSet>
<changeSet author="xixinzhao" id="20211102-26">
<preConditions onFail="MARK_RAN">
<not>
<columnExists tableName="p_point_classify" columnName="building_id"/>
</not>
</preConditions>
<comment>p_point_classify add column building_id</comment>
<sql>
ALTER TABLE `p_point_classify`
ADD COLUMN `building_id` varchar(255) DEFAULT NULL COMMENT '建筑id';
</sql>
</changeSet>
<changeSet author="xixinzhao" id="20211102-27">
<preConditions onFail="MARK_RAN">
<not>
<columnExists tableName="p_point_classify" columnName="building_name"/>
</not>
</preConditions>
<comment>p_point_classify add column building_name</comment>
<sql>
ALTER TABLE `p_point_classify`
ADD COLUMN `building_name` varchar(255) DEFAULT NULL COMMENT '建筑名称';
</sql>
</changeSet>
<changeSet author="xixinzhao" id="20211102-28">
<preConditions onFail="MARK_RAN">
<not>
<columnExists tableName="p_point_classify" columnName="category_code"/>
</not>
</preConditions>
<comment>p_point_classify add column category_code</comment>
<sql>
ALTER TABLE `p_point_classify`
ADD COLUMN `category_code` varchar(255) DEFAULT NULL COMMENT '分类id';
</sql>
</changeSet>
<changeSet author="xixinzhao" id="20211102-29">
<preConditions onFail="MARK_RAN">
<not>
<columnExists tableName="p_point_classify" columnName="is_delete"/>
</not>
</preConditions>
<comment>p_point_classify add column is_delete</comment>
<sql>
ALTER TABLE `p_point_classify`
ADD COLUMN `is_delete` bit(1) NOT NULL DEFAULT b'0' COMMENT '是否删除( 0未删除,1已删除 )';
</sql>
</changeSet>
</databaseChangeLog> </databaseChangeLog>
\ No newline at end of file
...@@ -846,6 +846,15 @@ ...@@ -846,6 +846,15 @@
classify.id as classifyId, classify.id as classifyId,
classify.name as equipmentName, classify.name as equipmentName,
classify.equipment_id as equipmentId, classify.equipment_id as equipmentId,
classify.original_id as originalId,
classify.code,
classify.category_name as categoryName,
classify.address as area,
classify.data_source_code as dataSourceCode,
classify.data_source_name as equipType,
classify.building_id as buildingId,
classify.building_name as place,
classify.category_code as categoryCode,
(SELECT create_date FROM p_check WHERE id = #{checkID}) as createDate (SELECT create_date FROM p_check WHERE id = #{checkID}) as createDate
FROM FROM
p_point_classify classify p_point_classify classify
......
...@@ -188,8 +188,9 @@ ...@@ -188,8 +188,9 @@
LEFT JOIN p_input_item pii ON pii.id = ppi.input_item_id LEFT JOIN p_input_item pii ON pii.id = ppi.input_item_id
lEFT JOIN p_route_point_item prpi ON prpi.point_input_item_id = pii.id lEFT JOIN p_route_point_item prpi ON prpi.point_input_item_id = pii.id
WHERE pii.is_delete = '0' WHERE pii.is_delete = '0'
<if test="pointId!=null and pointId !='' "> AND ppc.point_id = #{pointId}</if> <if test="classifyId!=null and classifyId !='' "> AND ppc.id = #{classifyId}</if>
<if test="equipmentId!=null and equipmentId !='' "> AND ppc.equipment_id = #{equipmentId}</if> <!-- <if test="pointId!=null and pointId !='' "> AND ppc.point_id = #{pointId}</if>-->
<!-- <if test="equipmentId!=null and equipmentId !='' "> AND ppc.equipment_id = #{equipmentId}</if>-->
</select> </select>
<select id="getInputItemListByitemNos" resultType="com.yeejoin.amos.patrol.business.vo.InputItemVo"> <select id="getInputItemListByitemNos" resultType="com.yeejoin.amos.patrol.business.vo.InputItemVo">
SELECT SELECT
......
...@@ -942,32 +942,57 @@ ...@@ -942,32 +942,57 @@
AND p.org_code = #{orgCode} AND p.org_code = #{orgCode}
AND c.is_delete = 0 AND c.is_delete = 0
</select> </select>
<!-- <select id="queryEquipPointInputItem" resultType="java.util.Map">-->
<!-- SELECT-->
<!-- distinct cast(spec.id as char) AS equipmentId,-->
<!-- we.name AS name,-->
<!-- structure.source_id AS sourceId,-->
<!-- structure.source_code AS sourceCode,-->
<!-- spec.system_id AS systemId,-->
<!-- spec.code AS code,-->
<!-- cast(ppc.id as char) AS id,-->
<!-- category.NAME AS categoryName,-->
<!-- category.CODE AS categoryCode,-->
<!-- equipment_detail.area AS address,-->
<!-- structure.NAME AS acre,-->
<!-- we.inspection_spec as inspectionName,-->
<!-- ppc.order_no as orderNo-->
<!-- FROM-->
<!-- p_point_classify ppc-->
<!-- LEFT JOIN wl_equipment_specific spec ON spec.id=ppc.equipment_id-->
<!-- LEFT JOIN wl_equipment_detail equipment_detail ON equipment_detail.id = spec.equipment_detail_id-->
<!-- LEFT JOIN wl_stock_detail detail ON detail.equipment_specific_id = spec.id-->
<!-- LEFT JOIN wl_warehouse_structure structure ON detail.warehouse_structure_id = structure.id-->
<!-- LEFT JOIN f_fire_fighting_system AS manage ON manage.id = spec.system_id-->
<!-- LEFT JOIN wl_equipment we ON we.id = equipment_detail.equipment_id-->
<!-- LEFT JOIN wl_equipment_category category ON category.id = we.category_id-->
<!-- WHERE-->
<!-- <if test = "pointId!=''" > ppc.point_id = #{pointId} </if>-->
<!-- </select>-->
<select id="queryEquipPointInputItem" resultType="java.util.Map"> <select id="queryEquipPointInputItem" resultType="java.util.Map">
SELECT SELECT
distinct cast(spec.id as char) AS equipmentId, ppc.id,
we.name AS name, ppc.point_id pointId,
structure.source_id AS sourceId, ppc.name,
structure.source_code AS sourceCode, ppc.code,
spec.system_id AS systemId, ppc.creator_id creatorId,
spec.code AS code, ppc.create_date createDate,
cast(ppc.id as char) AS id, ppc.order_no orderNo,
category.NAME AS categoryName, ppc.original_id originalId,
category.CODE AS categoryCode, ppc.equipment_id equipmentId,
equipment_detail.area AS address, ppc.inspection_spec_name inspectionSpecName,
structure.NAME AS acre, ppc.category_name categoryName,
we.inspection_spec as inspectionName, ppc.address,
ppc.order_no as orderNo ppc.data_source_code dataSourceCode,
ppc.data_source_name dataSourceName,
ppc.building_id buildingId,
ppc.building_name buildingName,
ppc.category_code categoryCode
FROM FROM
p_point_classify ppc p_point_classify ppc
LEFT JOIN wl_equipment_specific spec ON spec.id=ppc.equipment_id
LEFT JOIN wl_equipment_detail equipment_detail ON equipment_detail.id = spec.equipment_detail_id
LEFT JOIN wl_stock_detail detail ON detail.equipment_specific_id = spec.id
LEFT JOIN wl_warehouse_structure structure ON detail.warehouse_structure_id = structure.id
LEFT JOIN f_fire_fighting_system AS manage ON manage.id = spec.system_id
LEFT JOIN wl_equipment we ON we.id = equipment_detail.equipment_id
LEFT JOIN wl_equipment_category category ON category.id = we.category_id
WHERE WHERE
<if test = "pointId!=''" > ppc.point_id = #{pointId} </if> ppc.is_delete = 0
<if test = "pointId!=''" > AND ppc.point_id = #{pointId} </if>
</select> </select>
<select id="queryPointCount4Route" parameterType="long" resultType="int"> <select id="queryPointCount4Route" parameterType="long" resultType="int">
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment