Commit d36a3afc authored by tianbo's avatar tianbo

Merge branch 'developer' into developer-latentDanger

parents 9f17a7a1 369eece7
......@@ -63,7 +63,7 @@ public class ControllerAop {
ServletRequestAttributes attributes = (ServletRequestAttributes) RequestContextHolder.getRequestAttributes();
HttpServletRequest request = attributes.getRequest();
// 不需要添加请求头的接口
String[] url = new String[]{"/api/user/selectInfo", "/api/user/save/curCompany", "/jcs/command/lookHtmlText", "/jcs/common/duty-person/findByDutyAreaId", "/tzs/wechatBack", "/tzs/alert-called/saveMobile","/tzs/elevator/getElevatorInfo"};
String[] url = new String[]{"/api/user/selectInfo", "/api/user/save/curCompany", "/jcs/command/lookHtmlText", "/jcs/common/duty-person/findByDutyAreaId", "/tzs/wechatBack", "/tzs/elevator/getElevatorInfo"};
// 获取请求路径
for(String uri : url) {
if(request.getRequestURI().indexOf(uri) != -1) {
......
......@@ -17,6 +17,7 @@ public enum WorkFlowEnum {
GROUPID("groupId","角色组的key"),
GROUPNAME("groupName","角色组的key"),
NAME("name","任务节点的key"),
PROCESSINSTANCEID("processInstanceId",""),
ASSIGN("assign","角色执行人key");
private String code;//对应菜单组件名称
......
......@@ -51,5 +51,14 @@ public interface IWorkflowExcuteService{
*/
boolean excuteTask(String procressId, String condition) throws Exception;
/**
* 获取当前登录用户所能执行的任务信息列表
* @param key 流程定义的key ,例如 :fire_supervision 防火监督
* @param userInfo
* @return List<map<String,String>> eg: [{ "processInstanceId": "110d3af9-1f5a-11ec-a26e-b07b25133c48"}]
* @throws Exception
*/
public Object getCurrentUserAllTaskList(String key, ReginParams userInfo) throws Exception;
}
......@@ -64,23 +64,26 @@ public class WorkflowExcuteServiceImpl implements IWorkflowExcuteService {
JSONArray taskDetailArray = teskObject.getJSONArray(WorkFlowEnum.DATA.getCode());
for (Object obj : taskDetailArray) {
JSONObject detail = JSONObject.parseObject(JSONObject.toJSONString(obj));
if (WorkFlowEnum.制定计划内容.getCode().equals(detail.getString(WorkFlowEnum.NAME.getCode())) || WorkFlowEnum.现场确认.getCode().equals(detail.getString(WorkFlowEnum.NAME.getCode()))) {
if (WorkFlowEnum.制定计划内容.getCode().equals(detail.getString(WorkFlowEnum.NAME.getCode()))
|| WorkFlowEnum.现场确认.getCode().equals(detail.getString(WorkFlowEnum.NAME.getCode()))) {
String groupName = getFristFlowDetail(processInstanceId);
if (StringUtils.isBlank(groupName)) {
if (StringUtils.isNotBlank(groupName) && currentLoginUserRole.equals(groupName)) {
map.put(WorkFlowEnum.TASKID.getCode(), detail.getString(WorkFlowEnum.ID.getCode()));
map.put(WorkFlowEnum.CHECKFLAG.getCode(), true);
map.put(WorkFlowEnum.NAME.getCode(), detail.getString(WorkFlowEnum.NAME.getCode()));
return map;
}
map.put(WorkFlowEnum.TASKID.getCode(), detail.getString(WorkFlowEnum.ID.getCode()));
map.put(WorkFlowEnum.CHECKFLAG.getCode(), true);
map.put(WorkFlowEnum.NAME.getCode(), detail.getString(WorkFlowEnum.NAME.getCode()));
return map;
}
JSONObject taskGroupNameObject = workflowFeignService.getTaskGroupName(detail.getString(WorkFlowEnum.ID.getCode()));
JSONObject taskGroupNameObject = workflowFeignService
.getTaskGroupName(detail.getString(WorkFlowEnum.ID.getCode()));
// 获取流程中原本设置的当前节点的执行权限
JSONArray taskGroupNameDetail = taskGroupNameObject.getJSONArray(WorkFlowEnum.DATA.getCode());
// 如果拿不到当前任务的执行角色,再去获取当前任务有没有默认的执行人,如果都没有则返回校验失败
if (ObjectUtils.isEmpty(taskGroupNameDetail.getJSONObject(0))) {
JSONObject taskAssignObject = workflowFeignService.getTaskAssign(detail.getString(WorkFlowEnum.ID.getCode()));
String assignUser = taskAssignObject.getJSONObject(WorkFlowEnum.DATA.getCode()).getString(WorkFlowEnum.ASSIGN.getCode());
if (ObjectUtils.isEmpty(taskGroupNameDetail)) {
JSONObject taskAssignObject = workflowFeignService
.getTaskAssign(detail.getString(WorkFlowEnum.ID.getCode()));
String assignUser = taskAssignObject.getJSONObject(WorkFlowEnum.DATA.getCode())
.getString(WorkFlowEnum.ASSIGN.getCode());
if (StringUtils.isNotBlank(assignUser)) {
// 如果当前登录人与当前任务的设定人不一定,则直接返回权限校验失败
if (!assignUser.contains(currentLoginUserId)) {
......@@ -94,7 +97,12 @@ public class WorkflowExcuteServiceImpl implements IWorkflowExcuteService {
}
continue;
}
String defaultExecutionRoleProcess = taskGroupNameDetail.getJSONObject(0).getString(WorkFlowEnum.GROUPID.getCode());
String defaultExecutionRoleProcess = taskGroupNameDetail.getJSONObject(0)
.getString(WorkFlowEnum.GROUPID.getCode());
if(StringUtils.isBlank(defaultExecutionRoleProcess)) {
continue;
}
// 判断当前登录人的角色是不是与流程中设置的当前任务节点权限一致,一致则执行,不一致则退出
if (!defaultExecutionRoleProcess.equals(currentLoginUserRole)) {
continue;
......@@ -132,7 +140,8 @@ public class WorkflowExcuteServiceImpl implements IWorkflowExcuteService {
JSONArray taskDetailArray = teskObject.getJSONArray(WorkFlowEnum.DATA.getCode());
for (Object obj : taskDetailArray) {
JSONObject detail = JSONObject.parseObject(JSONObject.toJSONString(obj));
JSONObject taskGroupNameObject = workflowFeignService.getTaskGroupName(detail.getString(WorkFlowEnum.ID.getCode()));
JSONObject taskGroupNameObject = workflowFeignService
.getTaskGroupName(detail.getString(WorkFlowEnum.ID.getCode()));
try {
if (taskGroupNameObject.getJSONArray(WorkFlowEnum.DATA.getCode()) == null
&& taskGroupNameObject.getJSONArray(WorkFlowEnum.DATA.getCode()).size() < 1) {
......@@ -152,7 +161,8 @@ public class WorkflowExcuteServiceImpl implements IWorkflowExcuteService {
HashMap<String, Object> conditionMap = new HashMap<String, Object>();
conditionMap.put(WorkFlowEnum.CONDITION.getCode(), condition);
try {
workflowFeignService.pickupAndCompleteTask(map.get(WorkFlowEnum.TASKID.getCode()).toString(), conditionMap);
workflowFeignService.pickupAndCompleteTask(map.get(WorkFlowEnum.TASKID.getCode()).toString(),
conditionMap);
} catch (Exception e) {
throw new RuntimeException("完成任务失败");
}
......@@ -188,8 +198,10 @@ public class WorkflowExcuteServiceImpl implements IWorkflowExcuteService {
if (ObjectUtils.isEmpty(historyTaskJsonObject.getJSONArray(WorkFlowEnum.DATA.getCode()))) {
return null;
}
JSONObject historyTaskObject = historyTaskJsonObject.getJSONArray(WorkFlowEnum.DATA.getCode()).getJSONObject(0);
JSONObject detail = workflowFeignService.getHistoricIdentityLinksForTask(historyTaskObject.getString(WorkFlowEnum.ID.getCode()));
JSONObject historyTaskObject = historyTaskJsonObject.getJSONArray(WorkFlowEnum.DATA.getCode())
.getJSONObject(0);
JSONObject detail = workflowFeignService
.getHistoricIdentityLinksForTask(historyTaskObject.getString(WorkFlowEnum.ID.getCode()));
JSONArray resultArray = detail.getJSONArray(WorkFlowEnum.DATA.getCode());
if (ObjectUtils.isNotEmpty(resultArray)) {
for (int i = 0; i < resultArray.size(); i++) {
......@@ -204,4 +216,35 @@ public class WorkflowExcuteServiceImpl implements IWorkflowExcuteService {
}
return null;
}
/**
* 获取当前登录用户所能执行的任务信息列表
* @param key
* @param userInfo
* @return List<map<String,String>> eg: [{ "processInstanceId": "110d3af9-1f5a-11ec-a26e-b07b25133c48"}]
* @throws Exception
*/
public Object getCurrentUserAllTaskList(String key, ReginParams userInfo) throws Exception {
String currentLoginUserRole = userInfo.getRole().getRoleName();
JSONObject CurrentUserAllTaskResult = null;
try {
//获取该登录用户已经分配到他名下和他对应的角色权限所能执行的任务组
CurrentUserAllTaskResult = workflowFeignService.getCurrentUserAllTaskList(key);
} catch (Exception e) {
throw new RuntimeException("获取当前角色所能执行的任务失败");
}
JSONArray allTaskResultList = CurrentUserAllTaskResult.getJSONArray(WorkFlowEnum.DATA.getCode());
//获取制定计划节点任务的所有可执行任务
JSONObject SpecifyTask = workflowFeignService.getTaskListForTaskName(WorkFlowEnum.制定计划内容.getCode(), key);
JSONArray SpecifyTaskArray = SpecifyTask.getJSONArray(WorkFlowEnum.DATA.getCode());
//判断该执行任务的历史执行节点的角色是否与当前登录用户的角色一致,如果一致就添加到根据用户角色ID和userID所属的任务列表中
SpecifyTaskArray.stream().forEach(i -> {
JSONObject json = JSONObject.parseObject(JSONObject.toJSONString(i));
String groupName = getFristFlowDetail(json.getString(WorkFlowEnum.PROCESSINSTANCEID.getCode()));
if (StringUtils.isNotBlank(groupName) && currentLoginUserRole.equals(groupName)) {
allTaskResultList.add(i);
}
});
return allTaskResultList;
}
}
......@@ -204,4 +204,14 @@ public interface WorkflowFeignService {
*/
@RequestMapping(value = "/activitiHistory/processes/historytasks/getHistoricTaskForProcessInstanceId/{processInstanceId}",method = RequestMethod.GET)
JSONObject getHistoricTaskForProcessInstanceId(@PathVariable("processInstanceId") String processInstanceId) throws ParseException;
/**'
* 查询指定任务名称的任务列表
* @param taskName
* @return
* @throws Exception
*/
@RequestMapping(value = "/activitiHistory/getTaskListForTaskName/{taskName}/{definitionKey}",method = RequestMethod.GET)
JSONObject getTaskListForTaskName(@PathVariable String taskName,@PathVariable String definitionKey) throws Exception ;
}
......@@ -40,6 +40,7 @@ LEFT JOIN (
COUNT(1) count
FROM
cb_linkage_unit
WHERE is_delete = 0
GROUP BY
emergency_linkage_unit_code
) elink ON elink.emergency_linkage_unit_code = cbb.`code`
......
......@@ -68,14 +68,25 @@ public class FireExpertsDto extends BaseDto {
private String politicalOutlook;
// @ExplicitConstraint(indexNum = 9, sourceClass = RoleNameExplicitConstraint.class, method = "getAdministrativeDivisions") //固定下拉内容
@ExcelProperty(value = "现居住地", index = 9)
@ExplicitConstraint(indexNum = 9,sourceClass = CommonExplicitConstraint.class,method ="getCitys")
@ApiModelProperty(value = "现居住地")
@ExcelProperty(value = "现居住地", index = 9)
private String residence;
@ExcelProperty(value = "居住地详情", index = 10)
@ExcelProperty(value = "籍贯/户口所在地详细地址", index = 17)
@ApiModelProperty(value = "籍贯/户口所在地详细地址")
private String nativePlaceVal;
@ExplicitConstraint(indexNum =10,sourceClass = CommonExplicitConstraint.class,method ="getCitys")
@ExcelProperty(value = "现居住地", index = 10)
@ApiModelProperty(value = "居住地详情")
private String residenceDetails;
@ExcelProperty(value = "现居住地详细地址", index = 18)
@ApiModelProperty(value = "现居住地详细地址")
private String residenceDetailVal;
@ExcelProperty(value = "办公电话", index = 11)
@ApiModelProperty(value = "办公电话")
private String officePhone;
......
......@@ -106,4 +106,10 @@ public class FireExperts extends BaseEntity {
@ApiModelProperty(value = "出生日期")
private Date birthdayTime;
@ApiModelProperty(value = "现居住地详细地址")
private String residenceDetailVal;
@ApiModelProperty(value = "户籍所在地详细地址")
private String nativePlaceVal;
}
package com.yeejoin.amos.boot.module.jcs.api.feign;
import org.springframework.http.HttpStatus;
import org.typroject.tyboot.core.restful.utils.ResponseModel;
public class CommonResponseUtil2 {
public static ResponseModel success() {
ResponseModel res = new ResponseModel();
res.setDevMessage(Constant.RESULT_SUCCESS);
res.setStatus(HttpStatus.OK.value());
return res;
}
public static ResponseModel success(Object obj) {
ResponseModel res = new ResponseModel();
res.setResult(obj);
res.setDevMessage(Constant.RESULT_SUCCESS);
res.setStatus(HttpStatus.OK.value());
return res;
}
public static ResponseModel success(Object obj, String message) {
ResponseModel res = new ResponseModel();
res.setResult(obj);
res.setDevMessage(message);
res.setStatus(HttpStatus.OK.value());
return res;
}
public static ResponseModel failure() {
ResponseModel res = new ResponseModel();
res.setDevMessage(Constant.RESULT_FAILURE);
res.setStatus(HttpStatus.INTERNAL_SERVER_ERROR.value());
return res;
}
public static ResponseModel failure(String message) {
ResponseModel res = new ResponseModel();
res.setDevMessage(Constant.RESULT_FAILURE);
res.setMessage(message);
res.setStatus(HttpStatus.INTERNAL_SERVER_ERROR.value());
return res;
}
public static ResponseModel failure(Object obj, String message) {
ResponseModel res = new ResponseModel();
res.setResult(obj);
res.setDevMessage(Constant.RESULT_FAILURE);
res.setStatus(HttpStatus.INTERNAL_SERVER_ERROR.value());
return res;
}
}
package com.yeejoin.amos.boot.module.jcs.api.feign;
import java.nio.charset.Charset;
import java.nio.charset.StandardCharsets;
import java.time.format.DateTimeFormatter;
/**
* @Description: 常量类
* @Author: duanwei
* @Date: 2019/7/29
*/
public interface Constant {
String SMALL_PRO_PRCODE = "SMALL_PRO_PRCODE_";
String RESULT_SUCCESS = "SUCCESS";
String RESULT_FAILURE = "FAILURE";
/**
* 任务-作业交底
*/
Integer JOB_TYPE = 0;
/**
* 任务-三交三查
*/
Integer HAND_QUERY = 1;
/**
* 违规管理
*/
Integer BAD_MANAGEMENT = 2;
Charset DEFAULT_CHARSET = StandardCharsets.UTF_8;
String FILE_SEPARATOR = System.getProperty("file.separator");
DateTimeFormatter DATE_TIME_FORMATTER = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
String PAGE_NUM = "0";
String SIZE_NUM = "20";
String PAGE = "page";
String SIZE = "size";
String ZERO = "0";
String ONE = "1";
String TWO = "2";
String THREE = "3";
String FOUR = "4";
String FIVE = "5";
String NULL = "";
String JSON_NULL = "[]";
/**
* 请求成功
*/
String SUCCESS = "200";
/**
* 请求错误
*/
String ERROR = "300";
/**
* 无权限
*/
String PERMISSION = "401";
/**
* 请求成功,其他错误
*/
String DATA_NULL = "402";
/**
* 请求失败
*/
String FAILED = "999";
/**
* 最大值
*/
Integer MAX = 32767;
/**
* 数据请求返回码
*/
public static final int RESCODE_SUCCESS = 1000; //成功
public static final int RESCODE_SUCCESS_MSG = 1001; //成功(有返回信息)
public static final int RESCODE_EXCEPTION = 1002; //请求抛出异常
public static final int RESCODE_NOLOGIN = 1003; //未登陆状态
public static final int RESCODE_NOEXIST = 1004; //查询结果为空
public static final int RESCODE_NOAUTH = 1005; //无操作权限
public static final int RESCODE_LOGINEXPIRE = 1006; //登录过期
/**
* token
*/
public static final int JWT_ERRCODE_EXPIRE = 1007;//Token过期
public static final int JWT_ERRCODE_FAIL = 1008;//验证不通过
/**
* jwt
*/
public static final String JWT_ID = "jwt-black";//jwt签发者
public static final String JWT_SECRET = "Isi5Ob9OfvJt+4IHoMJlHkS1ttg=";//密匙
public static final int JWT_TTL = 60 * 60 * 1000; // 60*60*1000; //millisecond
public static final int JWT_REFRESH_INTERVAL = 18 * 1000; //55*60*1000; //millisecond
public static final int JWT_REFRESH_TTL = 60 * 1000; // 12*60*60*1000; //millisecond
}
......@@ -128,10 +128,16 @@
<if test="alertSourceCode!= null ">
and alert_source_code = #{alertSourceCode}
</if>
<if test="data != null and lift == 'ascend'">
<if test="data == 'address' and data != null and lift == 'ascend'">
order by CONVERT(address USING 'gbk') ASC limit #{current},#{size}
</if>
<if test="data == 'address' and data != null and lift == 'descend'">
order by CONVERT(address USING 'gbk') DESC limit #{current},#{size}
</if>
<if test="data != null and data != 'address' and lift == 'ascend'">
order by #{data} ASC limit #{current},#{size}
</if>
<if test="data != null and lift == 'descend'">
<if test="data != null and data != 'address' and lift == 'descend'">
order by #{data} DESC limit #{current},#{size}
</if>
<if test="data == null ">
......
......@@ -70,7 +70,7 @@ public enum DangerCheckTypeLevelEnum {
this.condition = condition;
}
public String getCondition() {
public String getCondition() {
return condition;
}
}
......@@ -6,6 +6,7 @@ import lombok.Data;
import java.io.Serializable;
import java.util.Date;
import java.util.List;
import java.util.Map;
/**
* @author xixinzhao
......@@ -149,4 +150,10 @@ public class DangerDto implements Serializable {
* 隐患类型描述
*/
private String dangerTypeName;
/**
* 业务信息
*/
private Map bizInfo;
}
package com.yeejoin.amos.boot.module.tzs.api.dto;
import com.yeejoin.amos.boot.biz.common.dto.BaseDto;
import com.yeejoin.amos.boot.module.common.api.dto.AttachmentDto;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.util.Date;
import java.util.List;
/**
* 警情接警填报记录
......@@ -147,10 +149,13 @@ public class AlertCalledDto extends BaseDto {
@ApiModelProperty(value = "投诉描述/故障报修描述")
private String describe;
@ApiModelProperty(value = "图片")
private String images;
//
// @ApiModelProperty(value = "图片")
// private String images;
@ApiModelProperty(value = "设备id")
private Long equipmentId;
@ApiModelProperty(value = "现场照片")
private List<AttachmentDto> images;
}
package com.yeejoin.amos.boot.module.tzs.api.dto;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.Date;
import java.util.List;
import java.util.Map;
/**
* @author litw
* @date 2021-09-27.
*/
@Data
public class AlertHandlerDto {
@ApiModelProperty(value = "处置时间")
Map<String, Date> handlerTime;
@ApiModelProperty(value = "处置信息")
List<AlertHandlerInfoDto> alertHandlerInfoDto;
}
package com.yeejoin.amos.boot.module.tzs.api.dto;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
* @author litw
* @date 2021-09-27.
*/
@Data
public class AlertHandlerInfoDto {
@ApiModelProperty(value = "处置流程")
String process;
@ApiModelProperty(value = "接警")
String answerThePolice;
@ApiModelProperty(value = "上报")
String report;
@ApiModelProperty(value = "派遣/通知")
String notice;
@ApiModelProperty(value = "到达")
String arrive;
@ApiModelProperty(value = "完成")
String complete;
@ApiModelProperty(value = "回访")
String returnVisit;
}
......@@ -112,4 +112,10 @@ public class DispatchPaperDto extends BaseDto {
@ApiModelProperty(value = "处置人")
private String dealUser;
@ApiModelProperty(value = "到达反馈方式")
private String arriveFeedbackType;
@ApiModelProperty(value = "到达反馈方式code")
private String arriveFeedbackCode;
}
package com.yeejoin.amos.boot.module.tzs.api.dto;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
* @author litw
* @date 2021-09-26.
*/
@Data
@ApiModel(value="EsElevatorDto", description="ES电梯信息")
public class EsElevatorDto {
/**
*
*/
private static final long serialVersionUID = 1L;
/**
* 注册编码
*/
@ApiModelProperty(value = "注册编码")
private String registerCode;
/**
* 所属省
*/
@ApiModelProperty(value = "所属省")
private String province;
/**
* 所属地市
*/
@ApiModelProperty(value = "所属地市")
private String city;
/**
* 所属区县
*/
@ApiModelProperty(value = "所属区县")
private String district;
/**
* 所属区域代码
*/
@ApiModelProperty(value = "所属区域代码")
private String regionCode;
/**
* 电梯识别码
*/
@ApiModelProperty(value = "电梯识别码")
private Integer rescueCode;
/**
* 电梯经度
*/
@ApiModelProperty(value = "电梯经度")
private String longitude;
/**
* 电梯纬度
*/
@ApiModelProperty(value = "电梯纬度")
private String latitude;
/**
* 地址
*/
@ApiModelProperty(value = "地址")
private String address;
/**
* 警情类型code
*/
@ApiModelProperty(value = "警情类型")
private String alarmTypeCode;
/**
* 警情id
*/
@ApiModelProperty(value = "警情id")
private String alertId;
}
package com.yeejoin.amos.boot.module.tzs.api.dto;
import com.yeejoin.amos.boot.module.common.api.dto.AttachmentDto;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
......@@ -99,13 +100,13 @@ public class WechatMyTaskDto {
private String remark;
@ApiModelProperty(value = "现场照片")
private List<String> fixImgs;
private List<AttachmentDto> fixImgs;
@ApiModelProperty(value = "故障描述")
private String errorContent;
@ApiModelProperty(value = "故障照片")
private List<String> errorImgs;
private List<AttachmentDto> errorImgs;
@ApiModelProperty(value = "反馈时间")
private Date responseTime;
......@@ -120,7 +121,7 @@ public class WechatMyTaskDto {
private String feedbackRemark;
@ApiModelProperty(value = "反馈现场照片")
private List<String> feedBackImgs;
private List<AttachmentDto> feedBackImgs;
@ApiModelProperty(value = "处置时间")
private Date dealTime;
......
......@@ -3,12 +3,14 @@ package com.yeejoin.amos.boot.module.tzs.api.entity;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.yeejoin.amos.boot.biz.common.entity.BaseEntity;
import com.yeejoin.amos.boot.module.common.api.dto.AttachmentDto;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import java.util.Date;
import java.util.List;
/**
* 警情接警填报记录
......@@ -225,8 +227,9 @@ public class AlertCalled extends BaseEntity {
@ApiModelProperty(value = "设备id")
private Long equipmentId;
@TableField("images")
@ApiModelProperty(value = "图片")
private String images;
@TableField(exist=false)
@ApiModelProperty(value = "现场照片")
private List<AttachmentDto> images;
}
......@@ -204,5 +204,18 @@ public class DispatchPaper extends BaseEntity {
@TableField("deal_user")
private String dealUser;
/**
* 到达反馈方式
*/
@TableField("arrive_feedback_type")
private String arriveFeedbackType;
/**
* 到达反馈方式code
*/
@TableField("arrive_feedback_code")
private String arriveFeedbackCode;
}
package com.yeejoin.amos.boot.module.tzs.api.entity;
import lombok.Data;
import lombok.experimental.Accessors;
import org.springframework.data.annotation.Id;
import org.springframework.data.elasticsearch.annotations.Document;
import org.springframework.data.elasticsearch.annotations.Field;
import org.springframework.data.elasticsearch.annotations.FieldType;
/**
* @author litw
* @date 2021-09-26.
*/
@Data
@Accessors(chain = true)
@Document(indexName = "elev", type = "tzsElevator", shards = 1, replicas = 0)
public class EsElevator {
/** 主键 */
@Id
private Long sequenceNbr;
/**
* 注册编码
*/
@Field(type = FieldType.Text)
private String registerCode;
/**
* 所属省
*/
@Field(type = FieldType.Text)
private String province;
/**
* 所属地市
*/
@Field(type = FieldType.Text)
private String city;
/**
* 所属区县
*/
@Field(type = FieldType.Text)
private String district;
/**
* 所属区域代码
*/
@Field(type = FieldType.Text)
private String regionCode;
/**
* 电梯识别码
*/
@Field(type = FieldType.Text)
private Integer rescueCode;
/**
* 电梯经度
*/
@Field(type = FieldType.Text)
private String longitude;
/**
* 电梯纬度
*/
@Field(type = FieldType.Text)
private String latitude;
/**
* 地址
*/
@Field(type = FieldType.Text, searchAnalyzer = "ik_max_word", analyzer = "ik_max_word")
private String address;
}
......@@ -6,6 +6,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
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.AlertCalledQueryDto;
import com.yeejoin.amos.boot.module.tzs.api.dto.AlertHandlerDto;
import com.yeejoin.amos.boot.module.tzs.api.enums.DispatchPaperEnums;
import org.typroject.tyboot.core.rdbms.annotation.Condition;
import org.typroject.tyboot.core.rdbms.annotation.Operator;
......@@ -58,4 +59,8 @@ public interface IAlertCalledService {
* @return
*/
Boolean updateAlertStage(AlertCalledDto alertCalledVo, DispatchPaperEnums stage);
AlertHandlerDto getHandlerInfo(String alertId);
}
......@@ -3,11 +3,13 @@ package com.yeejoin.amos.boot.module.tzs.api.service;
import com.yeejoin.amos.boot.module.tzs.api.dto.DispatchTaskDto;
import com.yeejoin.amos.boot.module.tzs.api.dto.WechatDispatchFeedbackDto;
import com.yeejoin.amos.boot.module.tzs.api.dto.WechatMessageDto;
import com.yeejoin.amos.boot.module.tzs.api.dto.WechatMyTaskDto;
import com.yeejoin.amos.boot.module.tzs.api.dto.WechatMyTaskListDto;
import com.yeejoin.amos.feign.privilege.model.AgencyUserModel;
import org.apache.ibatis.annotations.Param;
import java.util.Date;
import java.util.List;
/**
......@@ -34,4 +36,10 @@ public interface IDispatchTaskService {
List<WechatMyTaskListDto> getTaskListByPhonePager(String phone,String typeCode,Long current);
WechatMyTaskDto saveWechatFeedBack(WechatDispatchFeedbackDto wechatDispatchFeedbackDto);
/**
* 返回封装的WechatMessageDto
* @return
*/
WechatMessageDto getWechatMessageDtoByDispatchTaskDto(DispatchTaskDto dispatchTaskDto);
}
......@@ -34,4 +34,5 @@ public interface IWechatService {
* @return
*/
JSONObject sendWechatModelMessage(String openId, WechatMessageDto wechatMessageDto);
}
......@@ -4,6 +4,7 @@ import java.util.List;
import com.yeejoin.amos.boot.module.common.api.entity.FailureMaintain;
import com.yeejoin.amos.boot.module.common.biz.service.impl.SourceFileServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
......@@ -62,7 +63,7 @@ public class FailureMaintainController extends BaseController {
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(httpMethod = "GET",value = "维修列表记录查询", notes = "维修列表记录查询")
@GetMapping(value = "/list/{faultId}")
public ResponseModel<List<FailureMaintain>> findByFaultIDFotList(@PathVariable long faultId) {
public ResponseModel<List<FailureMaintainDto>> findByFaultIDFotList(@PathVariable long faultId) {
return ResponseHelper.buildResponse(failureMaintainServiceImpl.findByfaultId(faultId));
}
......
......@@ -444,7 +444,7 @@ public class OrgUsrController extends BaseController {
@TycloudOperation(ApiLevel = UserType.AGENCY)
@RequestMapping(value = "/getParentBuilding/{id}", method = RequestMethod.GET)
@ApiOperation(httpMethod = "GET", value = "获取最上级建筑信息", notes = "获取最上级建筑信息")
@ApiOperation(httpMethod = "GET", value = "获取最上级station", notes = "获取最上级建筑信息")
public ResponseModel<JSONObject> getBuliding(@PathVariable Long id) {
JSONObject equipjSONObject = this.getBulid(id);
return ResponseHelper.buildResponse(equipjSONObject);
......
package com.yeejoin.amos.boot.module.common.biz.service.impl;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
......@@ -7,9 +8,11 @@ import java.util.List;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.yeejoin.amos.boot.module.common.api.entity.OrgUsr;
import com.yeejoin.amos.boot.module.common.api.entity.SourceFile;
import org.apache.commons.lang3.ObjectUtils;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
......@@ -175,10 +178,22 @@ public class FailureMaintainServiceImpl extends BaseService<FailureMaintainDto,
/**
* 根据FaultId查询
*/
public List<FailureMaintain> findByfaultId(Long faultId) {
public List<FailureMaintainDto> findByfaultId(Long faultId) {
LambdaQueryWrapper<FailureMaintain> lambdaQueryWrapper = new LambdaQueryWrapper<>();
lambdaQueryWrapper.eq(FailureMaintain::getFaultId, faultId).orderByDesc(FailureMaintain::getMaintainTime);
return baseMapper.selectList(lambdaQueryWrapper);
List<FailureMaintain> failureMaintains = baseMapper.selectList(lambdaQueryWrapper);
List<FailureMaintainDto> failureMaintainDtos = new ArrayList<>();
for (FailureMaintain failureMaintain : failureMaintains) {
FailureMaintainDto failureMaintainDto = new FailureMaintainDto();
BeanUtils.copyProperties(failureMaintain,failureMaintainDto);
List<SourceFile> attachment = sourceFileServiceImpl.findBySourceId(failureMaintain.getSequenceNbr());
if (attachment .size()>0){
failureMaintainDto.setAttachment(attachment);
}
failureMaintainDtos.add(failureMaintainDto);
}
return failureMaintainDtos;
}
/**
......
......@@ -132,7 +132,7 @@ public class FirefightersController extends BaseController {
List<FirefightersJacket> firefightersJacket = iFirefightersJacketService.list(queryWrapper);
if (firefightersJacket != null && firefightersJacket.size() > 0) {
// BUG 2222 by litw start 2021年9月10日
throw new BadRequest("该消防还有在装装备!");
return ResponseHelper.buildResponse("-2");
}
try {
iFirefightersService.update(new UpdateWrapper<Firefighters>().eq("sequence_nbr", id).set("is_delete", 1));
......
......@@ -6,8 +6,10 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.boot.biz.common.controller.BaseController;
import com.yeejoin.amos.boot.biz.common.utils.NameUtils;
import com.yeejoin.amos.boot.module.common.api.entity.FirestationJacket;
import com.yeejoin.amos.boot.module.common.biz.service.impl.FireStationServiceImpl;
import com.yeejoin.amos.boot.module.jcs.api.dto.EquipSpecificDto;
import com.yeejoin.amos.boot.module.jcs.api.dto.EquipmentOnCarDto;
import com.yeejoin.amos.boot.module.jcs.api.feign.CommonResponseUtil2;
import com.yeejoin.amos.boot.module.jcs.biz.service.impl.FirestationJacketServiceImpl;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
......@@ -40,7 +42,8 @@ public class FirestationJacketController extends BaseController {
@Autowired
FirestationJacketServiceImpl iFirestationJacketService;
@Autowired
FireStationServiceImpl fireStationServiceImpl;
/**
* 新增消防人员配装记录
*
......@@ -100,11 +103,33 @@ public class FirestationJacketController extends BaseController {
@ApiOperation(httpMethod = "GET", value = "根据id查询", notes = "根据id查询")
public ResponseModel<FirestationJacket> selectById(HttpServletRequest request, @PathVariable Long id) {
QueryWrapper<FirestationJacket> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("firestation_id", id);
queryWrapper.eq("firefighters_id", id);
FirestationJacket firestationJacket = iFirestationJacketService.getOne(queryWrapper);
return ResponseHelper.buildResponse(firestationJacket);
}
@TycloudOperation(ApiLevel = UserType.AGENCY)
@DeleteMapping(value = "/Firestation/{sequenceNbr}")
@ApiOperation(httpMethod = "DELETE", value = "根据sequenceNbr删除微型消防站", notes = "根据sequenceNbr删除微型消防站")
public ResponseModel deleteBySequenceNbr(HttpServletRequest request,
@PathVariable(value = "sequenceNbr") Long sequenceNbr) {
QueryWrapper<FirestationJacket> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("firefighters_id", sequenceNbr);
FirestationJacket firestationJacket = iFirestationJacketService.getOne(queryWrapper);
if(firestationJacket!=null){
return CommonResponseUtil2.failure("微型消防站有配装装备,不能删除!");
}
return ResponseHelper.buildResponse(fireStationServiceImpl.updateisDelete(sequenceNbr));
}
/**
* 列表分页查询
*
......
......@@ -10,6 +10,7 @@ import java.util.stream.Collectors;
import javax.annotation.Resource;
import com.yeejoin.amos.boot.biz.common.entity.BaseEntity;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
......@@ -125,7 +126,7 @@ public class FireTeamServiceImpl extends BaseService<FireTeamDto, FireTeam, Fire
}
t.setCarNum(carNum);
t.setFighterNum(fighterNum);
/*//递归查找全部战备人数 BUG2217 bykongfm
/*//递归查找全部战备人数 BUG2217 bykongfmfirefighters/1435850387868385282
t.setFighterNum(getFightNumByTeamId(t.getSequenceNbr()));*/
});
fireTeamListPage.setRecords(fireTeamList);
......@@ -262,8 +263,14 @@ public class FireTeamServiceImpl extends BaseService<FireTeamDto, FireTeam, Fire
*/
public void deleteById(Long parent) throws Exception {
// 查询是否有下属队伍
List<FireTeamDto> fireTeamList = queryForList(null, false, parent);
if (!ValidationUtil.isEmpty(fireTeamList) && fireTeamList.size() > 0) {
// List<FireTeamDto> fireTeamList = queryForList(null, false, parent);
/*3026 【web】日常管理>机场单位,删除有级联数据的部门时,应无法直接删除 chenzhao 2021-09-28 start*/
LambdaQueryWrapper<FireTeam> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(FireTeam::getParent,parent);
wrapper.eq(BaseEntity::getIsDelete,0);
List<FireTeam> fireTeams = baseMapper.selectList(wrapper);
/*3026 【web】日常管理>机场单位,删除有级联数据的部门时,应无法直接删除 chenzhao 2021-09-28 end*/
if (!ValidationUtil.isEmpty(fireTeams) && fireTeams.size() > 0) {
// 有下属队伍不能删除
throw new BaseException("该队伍下有下级队伍,不能删除", null, "该队伍下有下级队伍,不能删除");
}
......
......@@ -65,7 +65,7 @@ public class HiddenDangerController extends AbstractBaseController {
@PutMapping(value = "/{latentDangerId}")
public ResponseModel updateDanger(
@RequestBody DangerDto dangerDto,
@PathVariable Long latentDangerId) {
@PathVariable Long latentDangerId) throws Exception {
dangerDto = iHiddenDangerService.updateDanger(latentDangerId, dangerDto);
return ResponseHelper.buildResponse(dangerDto);
}
......
......@@ -37,6 +37,11 @@ public class HiddenDangerDto {
*/
private Long pointId;
/**
* 点名称
*/
private String pointName;
/**
* 隐患类型(1-防火监督检查;2-自行检查)
......@@ -69,10 +74,6 @@ public class HiddenDangerDto {
*/
private String checkUserName;
/**
* 责任单位
*/
private String pointName;
/**
* 状态
......
......@@ -3,7 +3,6 @@ package com.yeejoin.amos.supervision.business.service.impl;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.fasterxml.jackson.databind.util.BeanUtil;
import com.google.common.base.Joiner;
import com.google.common.collect.Lists;
import com.google.common.collect.Maps;
......@@ -18,28 +17,26 @@ import com.yeejoin.amos.supervision.business.dao.mapper.*;
import com.yeejoin.amos.supervision.business.dao.repository.*;
import com.yeejoin.amos.supervision.business.dto.CheckInputItemDto;
import com.yeejoin.amos.supervision.business.dto.CheckRecordDto;
import com.yeejoin.amos.supervision.business.feign.DangerFeignClient;
import com.yeejoin.amos.supervision.core.common.dto.DangerDto;
import com.yeejoin.amos.supervision.business.dto.HiddenDangerDto;
import com.yeejoin.amos.supervision.business.entity.mybatis.*;
import com.yeejoin.amos.supervision.business.feign.DangerFeignClient;
import com.yeejoin.amos.supervision.business.feign.EquipFeign;
import com.yeejoin.amos.supervision.business.param.*;
import com.yeejoin.amos.supervision.business.service.intfc.ICheckService;
import com.yeejoin.amos.supervision.business.service.intfc.IEquipmentHandlerService;
import com.yeejoin.amos.supervision.business.service.intfc.IPlanTaskService;
import com.yeejoin.amos.supervision.business.service.intfc.IPointService;
import com.yeejoin.amos.supervision.business.service.intfc.*;
import com.yeejoin.amos.supervision.business.util.CheckDetailInputPageParam;
import com.yeejoin.amos.supervision.business.util.ToolUtils;
import com.yeejoin.amos.supervision.business.vo.CheckAnalysisVo;
import com.yeejoin.amos.supervision.business.vo.CheckInfoVo;
import com.yeejoin.amos.supervision.business.vo.CheckVo;
import com.yeejoin.amos.supervision.common.enums.*;
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.response.*;
import com.yeejoin.amos.supervision.core.util.DateUtil;
import com.yeejoin.amos.supervision.core.util.StringUtil;
import com.yeejoin.amos.supervision.dao.entity.*;
import com.yeejoin.amos.supervision.feign.RemoteSecurityService;
import org.apache.commons.beanutils.BeanUtils;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.apache.cxf.common.util.CollectionUtils;
import org.assertj.core.util.Sets;
......@@ -58,15 +55,13 @@ import java.util.*;
import java.util.stream.Collectors;
@Service("checkService")
@Slf4j
public class CheckServiceImpl implements ICheckService {
@Autowired
private CheckMapper checkMapper;
@Autowired
private ICheckService checkService;
@Autowired
private IPointService iPointService;
@Autowired
......@@ -74,8 +69,7 @@ public class CheckServiceImpl implements ICheckService {
@Resource
ICheckShotDao checkShotDao;
@Resource
IPlanTaskDao planTaskDao;
@Autowired
PlanTaskMapper planTaskMapper;
......@@ -97,9 +91,6 @@ public class CheckServiceImpl implements ICheckService {
IEquipmentHandlerService equipmentHandlerService;
@Autowired
private IPointClassifyDao iPointClassifyDao;
@Autowired
IPointDao iPointDao;
@Autowired
......@@ -116,17 +107,15 @@ public class CheckServiceImpl implements ICheckService {
private final int HTTP_OK_STATUS = 200;
// @Value("${file.ip}")
// private String fileIp;
//
// @Value("${file.port}")
// private String filePort;
@Value("${file.url}")
private String fileUrl;
@Value("${server.servlet.context-path}")
private String contextPath;
@Autowired
IHiddenDangerService iHiddenDangerService;
@Override
public Page<CheckInfoVo> getCheckInfo(String toke, String product, String appKey, CheckInfoPageParam param) {
long total = checkMapper.countCheckInfoData(param);
......@@ -1357,7 +1346,7 @@ public class CheckServiceImpl implements ICheckService {
@Override
@Transactional
public List<CheckInputItemDto> saveCheckRecord(CheckRecordParam recordParam, ReginParams reginParams) throws Exception {
public List<CheckInputItemDto> saveCheckRecord(CheckRecordParam recordParam, ReginParams reginParams) throws Exception {
ReginParams.PersonIdentity personIdentity = reginParams.getPersonIdentity();
if (ObjectUtils.isEmpty(reginParams.getUserModel()) && ObjectUtils.isEmpty(reginParams.getCompany()) && ObjectUtils.isEmpty(personIdentity)) {
throw new RuntimeException("获取用户信息失败");
......@@ -1584,16 +1573,27 @@ public class CheckServiceImpl implements ICheckService {
/**
* 保存隐患数据
*/
private void saveDanger (List<DangerDto> allDanger, PlanTask planTask, Check check, CheckRecordParam recordParam ) {
private void saveDanger(List<DangerDto> allDanger, PlanTask planTask, Check check, CheckRecordParam recordParam) {
if (!ObjectUtils.isEmpty(allDanger)) {
// 根据bizId删除关系表
List<Long> collect = allDanger.stream().map(DangerDto::getId).collect(Collectors.toList());
hiddenDangerDao.deleteByDangerIdIn(collect);
allDanger.forEach(dangerDto -> {
HiddenDangerDto hiddenDangerDto = new HiddenDangerDto();
hiddenDangerDto.setPlanId(planTask.getPlanId());
hiddenDangerDto.setPointId(recordParam.getPointId());
hiddenDangerDto.setCheckInputId(dangerDto.getBizId());
hiddenDangerDto.setDangerType(DangerHandleTypeEnum.SUPERVISION.getCode());
try {
dangerDto.setBizInfo(iHiddenDangerService.buildBizInfo(hiddenDangerDto));
} catch (Exception e) {
log.error(e.getMessage(), e);
throw new RuntimeException("组织基本数据失败");
}
});
// 1.feign调用保存隐患
FeignClientResult<List<DangerDto>> listFeignClientResult = DangerFeignClient.saveOrUpdateBatch(allDanger);
if (ObjectUtils.isEmpty(listFeignClientResult.getResult()) || listFeignClientResult.getStatus() != HTTP_OK_STATUS) {
throw new RuntimeException(listFeignClientResult.getDevMessage());
}
......
package com.yeejoin.amos.supervision.business.service.impl;
import com.alibaba.fastjson.JSON;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Sequence;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
......@@ -10,15 +11,19 @@ import com.yeejoin.amos.boot.biz.common.excel.DataSources;
import com.yeejoin.amos.boot.biz.common.excel.ExcelUtil;
import com.yeejoin.amos.component.feign.model.FeignClientResult;
import com.yeejoin.amos.supervision.business.dao.mapper.HiddenDangerMapper;
import com.yeejoin.amos.supervision.business.dao.repository.IHiddenDangerDao;
import com.yeejoin.amos.supervision.business.dao.repository.*;
import com.yeejoin.amos.supervision.business.dto.HiddenDangerDto;
import com.yeejoin.amos.supervision.business.dto.HiddenDangerExportDataDto;
import com.yeejoin.amos.supervision.business.dto.HiddenDangerImportDto;
import com.yeejoin.amos.supervision.business.dto.HiddenDangerTemplateDto;
import com.yeejoin.amos.supervision.business.feign.DangerFeignClient;
import com.yeejoin.amos.supervision.business.service.intfc.IHiddenDangerService;
import com.yeejoin.amos.supervision.common.enums.CheckTypeSuEnum;
import com.yeejoin.amos.supervision.common.enums.DangerCheckTypeLevelEnum;
import com.yeejoin.amos.supervision.common.enums.DangerHandleTypeEnum;
import com.yeejoin.amos.supervision.core.common.dto.DangerDto;
import com.yeejoin.amos.supervision.dao.entity.HiddenDanger;
import com.yeejoin.amos.supervision.dao.entity.*;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
......@@ -35,6 +40,7 @@ import java.util.stream.Collectors;
* @author DELL
*/
@Service
@Slf4j
public class HiddenDangerServiceImpl implements IHiddenDangerService {
@Autowired
......@@ -55,6 +61,18 @@ public class HiddenDangerServiceImpl implements IHiddenDangerService {
@Autowired
DataSources dataSources;
@Autowired
IPlanDao iPlanDao;
@Autowired
ICheckInputDao iCheckInputDao;
@Autowired
ICheckShotDao iCheckShotDao;
@Autowired
IPointDao iPointDao;
@Override
public List<HiddenDangerExportDataDto> listAll(String planId, Long pointId, String level, String status) {
//1.查询指定计划和公司的关联隐患数据
......@@ -94,12 +112,19 @@ public class HiddenDangerServiceImpl implements IHiddenDangerService {
}
@Override
public DangerDto updateDanger(Long latentDangerId, DangerDto dangerDto) {
public DangerDto updateDanger(Long latentDangerId, DangerDto dangerDto) throws Exception {
HiddenDanger hiddenDanger = iHiddenDangerDao.findByLatentDangerId(latentDangerId);
if (hiddenDanger == null) {
throw new DataNotFound("该隐患数据不存在");
}
//组织业务数据,字段为bizInfo
HiddenDangerDto hiddenDangerDto = new HiddenDangerDto();
Bean.copyExistPropertis(hiddenDanger, hiddenDangerDto);
Map<String, Object> bizInfo = this.buildBizInfo(hiddenDangerDto);
dangerDto.setBizInfo(JSON.parseObject(JSON.toJSONString(bizInfo)));
//feign 调用保存
FeignClientResult<List<DangerDto>> feignClientResult = feignClient.saveOrUpdateBatch(Collections.singletonList(dangerDto));
//更新隐患
List<DangerDto> saveDangers = feignClientResult.getResult();
if (!saveDangers.isEmpty()) {
hiddenDanger.setUpdateDate(new Date());
......@@ -146,18 +171,32 @@ public class HiddenDangerServiceImpl implements IHiddenDangerService {
//1.调用创建隐患
ReginParams.PersonIdentity personIdentity = reginParams.getPersonIdentity();
List<DangerDto> dtoList = list.stream().map(s -> {
Long seq = sequence.nextId();
String[] dangerArray = s.getDangerLevelName().split("@");
String[] reformTypeArray = s.getReformTypeName().split("@");
String[] pointArray = s.getPointName().split("@");
DangerDto dangerDto = new DangerDto();
Bean.copyExistPropertis(s, dangerDto);
dangerDto.setBizType(contextPath.substring(1));
dangerDto.setBizId(sequence.nextId());
dangerDto.setBizId(seq);
dangerDto.setDangerLevel(dangerArray.length > 1 ? dangerArray[1] : "");
dangerDto.setDangerLevelName(dangerArray.length > 1 ? dangerArray[0] : "");
dangerDto.setReformType(reformTypeArray.length > 1 ? reformTypeArray[1] : "");
dangerDto.setReformTypeName(reformTypeArray.length > 1 ? reformTypeArray[0] : "");
//自行检查
dangerDto.setCheckMode("1");
//导入的为自行检查
dangerDto.setCheckMode(DangerHandleTypeEnum.SELF.getCode());
//组织业务基本数据 对应bizInfo
HiddenDangerDto hiddenDangerDto = new HiddenDangerDto();
hiddenDangerDto.setPlanId(planId);
hiddenDangerDto.setPointId(pointArray.length > 1 ? Long.parseLong(pointArray[1]) : null);
hiddenDangerDto.setCheckInputId(seq);
hiddenDangerDto.setDangerType(DangerHandleTypeEnum.SELF.getCode());
try {
dangerDto.setBizInfo(this.buildBizInfo(hiddenDangerDto));
} catch (Exception e) {
log.error(e.getMessage(),e);
throw new RuntimeException("组织数据失败");
}
return dangerDto;
}).collect(Collectors.toList());
FeignClientResult<List<DangerDto>> feignClientResult = feignClient.saveOrUpdateBatch(dtoList);
......@@ -169,8 +208,8 @@ public class HiddenDangerServiceImpl implements IHiddenDangerService {
hiddenDanger.setPlanId(planId);
hiddenDanger.setLatentDangerId(d.getId());
hiddenDanger.setCheckInputId(d.getBizId());
hiddenDanger.setDangerType("1");
hiddenDanger.setDangerTypeName("自行检查");
hiddenDanger.setDangerType(DangerHandleTypeEnum.SELF.getCode());
hiddenDanger.setDangerTypeName((DangerHandleTypeEnum.SELF.getName()));
hiddenDanger.setCreateDate(new Date());
return hiddenDanger;
}).collect(Collectors.toList());
......@@ -206,4 +245,41 @@ public class HiddenDangerServiceImpl implements IHiddenDangerService {
}
return false;
}
@Override
public Map<String, Object> buildBizInfo(HiddenDangerDto hiddenDangerDto) throws Exception {
Map<String, Object> result = new HashMap<>(32);
Optional<Plan> op = iPlanDao.findById(hiddenDangerDto.getPlanId());
Plan plan = op.orElseThrow((() -> new RuntimeException("计划不存在")));
Point point = iPointDao.findById(hiddenDangerDto.getPointId()).orElseThrow(() -> new RuntimeException("单位不存在"));
//检查级别
DangerCheckTypeLevelEnum dangerCheckTypeLevelEnum = DangerCheckTypeLevelEnum.getEumByCode(plan.getCheckLevel());
//检查类型
CheckTypeSuEnum checkTypeSuEnum = CheckTypeSuEnum.getEumByCode(plan.getCheckTypeId());
String branch = PlanServiceImpl.workFlowExcuteBranch(dangerCheckTypeLevelEnum.getCondition(), checkTypeSuEnum.getCondition());
result.put("planType", branch);
result.put("checkMode", hiddenDangerDto.getDangerType());
result.put("planId", plan.getId());
result.put("planName", plan.getName());
result.put("pointId", point.getId());
result.put("pointName", point.getName());
result.put("bizId", hiddenDangerDto.getCheckInputId());
result.put("bizName", hiddenDangerDto.getInputItemName());
result.put("accompanyingUserId", plan.getLeadPeopleIds());
result.put("accompanyingUserName", plan.getLeadPeopleNames());
this.buildCheckInfo(result, hiddenDangerDto.getCheckInputId());
return result;
}
private void buildCheckInfo(Map<String, Object> result, Long checkInputId) {
CheckInput checkInput = iCheckInputDao.findById(checkInputId).orElse(null);
if (checkInput == null) {
return;
}
List<CheckShot> shotList = iCheckShotDao.findAllByCheckIdAndCheckInputId(checkInput.getCheckId(), checkInput.getId());
result.put("checkUserId", checkInput.getUserId());
result.put("checkUserName", checkInput.getUserName());
result.put("planExecuteTime", checkInput.getCreateDate());
result.put("checkPhotoUrl", shotList.stream().map(CheckShot::getPhotoData).collect(Collectors.joining(",")));
}
}
......@@ -201,7 +201,7 @@ public class PlanServiceImpl implements IPlanService {
/**
* 判断走哪一种工作流WorkFlowBranchEnum
*/
public String workFlowExcuteBranch (String dangerCheckTypeLevel, String checkType) {
public static String workFlowExcuteBranch (String dangerCheckTypeLevel, String checkType) {
String branch = "";
List<Map<String, String>> enumList = WorkFlowBranchEnum.getEnumList();
if (!ObjectUtils.isEmpty(enumList)){
......
......@@ -1221,13 +1221,17 @@ public class PointServiceImpl implements IPointService {
if (map.containsKey("picJson") && !ObjectUtils.isEmpty(map.get("picJson"))) {
map.put("remark", fileUrl + map.get("remark"));
}
List<DangerDto> dangerDtoList = new ArrayList<>();
if (map.containsKey("inputId") && !ObjectUtils.isEmpty(map.get("inputId"))) {
String inputId = map.get("inputId").toString();
if (!"0".equals(inputId) && !ObjectUtils.isEmpty(collect)) {
List<DangerDto> dangerDtoList = collect.get(Long.parseLong(inputId));
map.put("dangerList", dangerDtoList);
dangerDtoList = collect.get(Long.parseLong(inputId));
if (ObjectUtils.isEmpty(dangerDtoList)) {
dangerDtoList = new ArrayList<>();
}
}
}
map.put("dangerList", dangerDtoList);
}
}
return list;
......
......@@ -3,12 +3,14 @@ package com.yeejoin.amos.supervision.business.service.intfc;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.boot.biz.common.bo.ReginParams;
import com.yeejoin.amos.supervision.business.dto.HiddenDangerDto;
import com.yeejoin.amos.supervision.business.dto.HiddenDangerExportDataDto;
import com.yeejoin.amos.supervision.business.dto.HiddenDangerImportDto;
import com.yeejoin.amos.supervision.core.common.dto.DangerDto;
import javax.servlet.http.HttpServletResponse;
import java.util.List;
import java.util.Map;
/**
* @author DELL
......@@ -41,7 +43,7 @@ public interface IHiddenDangerService {
* @param dangerDto 隐患对象
* @return DangerDto
*/
DangerDto updateDanger(Long dangerId, DangerDto dangerDto);
DangerDto updateDanger(Long dangerId, DangerDto dangerDto) throws Exception;
/**
* 分页查询
......@@ -90,4 +92,11 @@ public interface IHiddenDangerService {
* @return Boolean
*/
Boolean deleteBatch(List<Long> ids);
/**
* 组织业务数据
* @param hiddenDangerDto 隐患信息
* @return Map<String,Object>
*/
Map<String,Object> buildBizInfo(HiddenDangerDto hiddenDangerDto) throws Exception;
}
......@@ -55,7 +55,7 @@ public class PersonIdentifyAspect {
Map person = (Map) map.get("PERSON");
if (!ObjectUtils.isEmpty(person)) {
personIdentity.setPersonSeq((String) person.get("sequenceNbr"));
personIdentity.setPersonName((String) person.get("recUserName"));
personIdentity.setPersonName((String) person.get("bizOrgName"));
}
if (!ObjectUtils.isEmpty(other)) {
personIdentity.setCompanyId((String) other.get("sequenceNbr"));
......
......@@ -22,6 +22,7 @@ import com.yeejoin.amos.boot.module.tzs.api.dto.ESAlertCalledRequestDto;
import com.yeejoin.amos.boot.module.tzs.api.entity.AlertCalled;
import com.yeejoin.amos.boot.module.tzs.api.entity.Elevator;
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.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.DispatchPaperServiceImpl;
......@@ -114,18 +115,22 @@ public class AlertCalledController extends BaseController {
*
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY, needAuth = false)
@TycloudOperation(ApiLevel = UserType.AGENCY)
@PostMapping(value = "/saveMobile")
@ApiOperation(httpMethod = "POST", value = "新增警情接警填报记录", notes = "新增警情接警填报记录")
public ResponseModel<AlertCalledDto> saveMobile(@RequestBody AlertCalledDto alertCalledDto,
@RequestParam String phone) {
public ResponseModel<AlertCalledDto> saveMobile(@RequestBody AlertCalledDto alertCalledDto
) {
if (ValidationUtil.isEmpty(alertCalledDto)) {
throw new BadRequest("参数校验失败.");
}
if (ValidationUtil.isEmpty(alertCalledDto.getEmergencyCall())) {
throw new BadRequest("参数校验失败.");
}
// 校验手机号 是否存在
LambdaQueryWrapper<WechatRelation> queryWrapper = new LambdaQueryWrapper();
queryWrapper.eq(WechatRelation::getPhone, phone);
queryWrapper.eq(WechatRelation::getPhone, alertCalledDto.getEmergencyCall());
WechatRelation wechatRelation = wechatRelationService.getOne(queryWrapper);
if (null == wechatRelation) {
throw new BadRequest("手机号未注册");
......@@ -144,6 +149,7 @@ public class AlertCalledController extends BaseController {
alertCalledDto.setDeviceId(String.valueOf(elevator.getRescueCode()));
alertCalledDto.setUseStatus(elevator.getUseStatus());
alertCalledDto.setUseSiteCategory(elevator.getUseSiteCategory());
alertCalledDto.setAlarmType(AlertStageEnums.getEnumById(alertCalledDto.getAlarmTypeCode()).getValue());
AlertCalledDto alertCalledDtoReturn = iAlertCalledService.createAlertCalled(alertCalledDto);
return ResponseHelper.buildResponse(alertCalledDtoReturn);
......@@ -478,4 +484,15 @@ public class AlertCalledController extends BaseController {
return ResponseHelper.buildResponse(iAlertCalledService.getImportantEventOrTodayEmergencyCount(type));
}
/**
* 警情处置流程信息
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping(value = "/getHandlerInfo")
@ApiOperation(httpMethod = "GET", value = "警情处置流程信息", notes = "警情处置流程信息")
public ResponseModel<Object> getHandlerInfo(@RequestParam String alertId) {
return ResponseHelper.buildResponse(iAlertCalledService.getHandlerInfo(alertId));
}
}
......@@ -12,10 +12,12 @@ import com.yeejoin.amos.boot.module.tzs.api.dto.ElevatorInfoDto;
import com.yeejoin.amos.boot.module.tzs.api.dto.ElevatorMaintenanceInfoDto;
import com.yeejoin.amos.boot.module.tzs.api.dto.ElevatorNewDto;
import com.yeejoin.amos.boot.module.tzs.api.dto.ElevatorTestInfoDto;
import com.yeejoin.amos.boot.module.tzs.api.dto.EsElevatorDto;
import com.yeejoin.amos.boot.module.tzs.api.entity.Elevator;
import com.yeejoin.amos.boot.module.tzs.api.entity.MaintainInfo;
import com.yeejoin.amos.boot.module.tzs.api.entity.TestInfo;
import com.yeejoin.amos.boot.module.tzs.api.service.IElevatorService;
import com.yeejoin.amos.boot.module.tzs.biz.service.impl.ESElevatorServiceImpl;
import com.yeejoin.amos.boot.module.tzs.biz.service.impl.ElevatorServiceImpl;
import com.yeejoin.amos.boot.module.tzs.biz.service.impl.MaintainInfoServiceImpl;
import com.yeejoin.amos.boot.module.tzs.biz.service.impl.TestInfoServiceImpl;
......@@ -72,6 +74,9 @@ public class ElevatorController extends BaseController {
@Autowired
private TestInfoServiceImpl testInfoService;
@Autowired
ESElevatorServiceImpl esElevatorService;
/**
* 新增电梯
*
......@@ -339,5 +344,45 @@ public class ElevatorController extends BaseController {
return ResponseHelper.buildResponse(elevatorInfoDto);
}
/**
*
* @return
*/
@TycloudOperation(needAuth = false, ApiLevel = UserType.AGENCY)
@RequestMapping(value = "/init", method = RequestMethod.GET)
@ApiOperation(httpMethod = "GET", value = "电梯信息放入es", notes = "电梯信息放入es")
public void init() {
IPage<Elevator> elevatorPage = new Page<>();
Integer count = elevatorService.count();
for(int i = 0; i <= count % 500 ; i ++ ) {
elevatorPage.setCurrent(i);
elevatorPage.setSize(500);
elevatorPage = elevatorService.page(elevatorPage);
for (Elevator el:elevatorPage.getRecords()
) {
esElevatorService.saveEsElevatorToES(el);
}
}
}
/**
* ES分页查询电梯信息
*
* @param current 当前页
* @param size 每页大小
* @param elevatorDto 查询参数
* @return 查询结果
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@RequestMapping(value = "/query_elevator_list_es", method = RequestMethod.POST)
@ApiOperation(httpMethod = "POST", value = "ES分页查询电梯信息", notes = "ES分页查询电梯信息")
public ResponseModel<IPage<EsElevatorDto>> queryElevatorListEs(@RequestParam(value = "current") int current, @RequestParam(value = "size") int size,
@RequestBody EsElevatorDto elevatorDto){
Page<EsElevatorDto> page = esElevatorService.queryByKeys(elevatorDto,current,size);
return ResponseHelper.buildResponse(page);
}
}
package com.yeejoin.amos.boot.module.tzs.biz.dao;
import com.yeejoin.amos.boot.module.tzs.api.entity.EsElevator;
import org.springframework.data.repository.PagingAndSortingRepository;
import org.springframework.stereotype.Repository;
/**
* @author fengwang
* @date 2021-09-26.
*/
@Repository
public interface ESElavtorRepository extends PagingAndSortingRepository<EsElevator, Long> {
}
......@@ -7,17 +7,22 @@ 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.itextpdf.text.pdf.PdfStructTreeController.returnType;
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.AlertHandlerDto;
import com.yeejoin.amos.boot.module.tzs.api.dto.AlertHandlerInfoDto;
import com.yeejoin.amos.boot.module.tzs.api.dto.FormValue;
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.enums.AlertStageEnums;
import com.yeejoin.amos.boot.module.tzs.api.enums.DispatchPaperEnums;
......@@ -35,12 +40,15 @@ import org.springframework.transaction.annotation.Transactional;
import org.typroject.tyboot.core.rdbms.annotation.Condition;
import org.typroject.tyboot.core.rdbms.annotation.Operator;
import org.typroject.tyboot.core.rdbms.service.BaseService;
import org.typroject.tyboot.core.restful.exception.instance.BadRequest;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
/**
* 警情接警填报记录服务实现类
......@@ -78,6 +86,15 @@ public class AlertCalledServiceImpl extends BaseService<AlertCalledDto,AlertCall
@Autowired
RepairConsultServiceImpl repairConsultServiceImpl;
@Autowired
DispatchPaperServiceImpl dispatchPaperService;
@Autowired
DispatchTaskServiceImpl dispatchTaskService;
@Autowired
ISourceFileService ISourceFileService;
private final Logger logger = LogManager.getLogger(AlertCalledServiceImpl.class);
......@@ -218,6 +235,84 @@ public class AlertCalledServiceImpl extends BaseService<AlertCalledDto,AlertCall
return this.update(updateWrapper);
}
/**
* 警情处置流程信息
*/
@Override
public AlertHandlerDto getHandlerInfo(String alertId) {
AlertHandlerDto alertHandlerDto = new AlertHandlerDto();
Map<String,Date> map = new HashMap<>();
List<AlertHandlerInfoDto> list = new ArrayList<>();
AlertHandlerInfoDto alertHandlerInfoDtoHead = new AlertHandlerInfoDto();
alertHandlerInfoDtoHead.setProcess("处置流程");
alertHandlerInfoDtoHead.setAnswerThePolice("接警");
alertHandlerInfoDtoHead.setReport("上报");
alertHandlerInfoDtoHead.setNotice("派遣/通知");
alertHandlerInfoDtoHead.setArrive("到达");
alertHandlerInfoDtoHead.setComplete("完成");
alertHandlerInfoDtoHead.setReturnVisit("回访");
list.add(alertHandlerInfoDtoHead);
AlertCalled called = this.getById(Long.valueOf(alertId));
if(null == called) {
throw new BadRequest("警情不存在");
}
map.put("接警",called.getCallTime());
map.put("上报",called.getRecDate());
LambdaQueryWrapper<DispatchPaper> queryWrapper = new LambdaQueryWrapper();
queryWrapper.eq(DispatchPaper::getAlertId,Long.valueOf(alertId));
DispatchPaper dispatchPaper = dispatchPaperService.getOne(queryWrapper);
LambdaQueryWrapper<DispatchTask> queryWrapper1 = new LambdaQueryWrapper();
queryWrapper1.eq(DispatchTask::getPaperId,Long.valueOf(dispatchPaper.getSequenceNbr()));
List<DispatchTask> dispatchTask = dispatchTaskService.list(queryWrapper1);
String [] str = new String[]{"使用单位","一级响应","二级响应","三级响应","市级监督"};
if(null != dispatchPaper) {
for(String s:str) {
AlertHandlerInfoDto alertHandlerInfoDto = new AlertHandlerInfoDto();
if(null != dispatchTask &&dispatchTask.size() > 0 ) {
List<DispatchTask> taskList = dispatchTask.stream().filter(e->e.getOrgType().equals(s)).collect(Collectors.toList());
if(taskList.size() > 0) {
map.put("派遣/通知",called.getRecDate());
map.put("到达",dispatchTask.get(0).getArriveTime());
map.put("完成",dispatchTask.get(0).getSaveTime());
dataInit(alertHandlerInfoDto,s,"", "","已派遣",
dispatchTask.get(0).getArriveTime() == null ? "" : "已到达" ,dispatchTask.get(0).getSaveTime() == null ? "" : "已完成",
dispatchPaper.getFeedbackTime() != null || dispatchPaper.getFeedbackFinishTime() != null ? "已回访" : "");
} else {
dataInit(alertHandlerInfoDto,s,"","","","","","");
}
}
list.add(alertHandlerInfoDto);
}
map.put("回访",dispatchPaper.getFeedbackTime());
} else {
for(String s:str) {
AlertHandlerInfoDto alertHandlerInfoDto = new AlertHandlerInfoDto();
dataInit(alertHandlerInfoDto,s,"","","","","","");
list.add(alertHandlerInfoDto);
}
}
alertHandlerDto.setAlertHandlerInfoDto(list);
alertHandlerDto.setHandlerTime(map);
return alertHandlerDto;
}
private void dataInit(AlertHandlerInfoDto alertHandlerInfoDto, String process,String answerThePolice, String report, String notice, String arrive, String complete,String returnVisit) {
alertHandlerInfoDto.setProcess(process);
alertHandlerInfoDto.setAnswerThePolice(answerThePolice);
alertHandlerInfoDto.setReport(report);
alertHandlerInfoDto.setNotice(notice);
alertHandlerInfoDto.setArrive(arrive);
alertHandlerInfoDto.setComplete(complete);
alertHandlerInfoDto.setReturnVisit(returnVisit);
}
/**
*
......@@ -330,6 +425,11 @@ public class AlertCalledServiceImpl extends BaseService<AlertCalledDto,AlertCall
alertCalled.setTypeCode(AlertStageEnums.JQCB.getId());
this.save(alertCalled);
// 保存照片
Map<String, List<AttachmentDto>> attachmentMap = new HashMap<>();
attachmentMap.put("imgs",alertCalledDto.getImages());
ISourceFileService.saveAttachments(alertCalled.getSequenceNbr(),attachmentMap);
// 动态表单
AlertFormValue alertFormValue = new AlertFormValue();
// 填充警情主键
......
......@@ -14,6 +14,7 @@ import com.yeejoin.amos.boot.module.tzs.api.dto.DispatchPaperFormDto;
import com.yeejoin.amos.boot.module.tzs.api.dto.DispatchTaskDto;
import com.yeejoin.amos.boot.module.tzs.api.dto.RescueProcessDto;
import com.yeejoin.amos.boot.module.tzs.api.dto.WechatDispatchFeedbackDto;
import com.yeejoin.amos.boot.module.tzs.api.dto.WechatMessageDto;
import com.yeejoin.amos.boot.module.tzs.api.dto.WechatMyTaskDto;
import com.yeejoin.amos.boot.module.tzs.api.dto.WechatMyTaskListDto;
import com.yeejoin.amos.boot.module.tzs.api.entity.AlertCalled;
......@@ -26,6 +27,7 @@ import com.yeejoin.amos.boot.module.tzs.api.entity.RescueProcess;
import com.yeejoin.amos.boot.module.tzs.api.entity.RescueStation;
import com.yeejoin.amos.boot.module.tzs.api.entity.Template;
import com.yeejoin.amos.boot.module.tzs.api.entity.UseUnit;
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.DispatchPaperEnums;
import com.yeejoin.amos.boot.module.tzs.api.enums.TzsCommonParam;
......@@ -38,6 +40,7 @@ import com.yeejoin.amos.boot.module.tzs.biz.utils.BeanDtoVoUtils;
import com.yeejoin.amos.feign.privilege.model.AgencyUserModel;
import org.apache.commons.lang3.StringUtils;
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.rdbms.service.BaseService;
......@@ -96,6 +99,30 @@ public class DispatchTaskServiceImpl extends BaseService<DispatchTaskDto,Dispatc
@Autowired
ISourceFileService ISourceFileService;
@Autowired
WechatRelationServiceImpl wechatRelationServiceImpl;
@Autowired
WechatServiceImpl wechatService;
@Value("${tzs.wechat.tempId.kr}")
private String KRJY_TEMPID;
@Value("${tzs.wechat.tempId.wx}")
private String WX_TEMPID;
@Value("${tzs.wechat.tempId.ts}")
private String TS_TEMPID;
@Value("${tzs.wechat.url.kr}")
private String KRJY_URL;
@Value("${tzs.wechat.url.wx}")
private String WX_URL;
@Value("${tzs.wechat.url.ts}")
private String TS_URL;
/**
* 分页查询
*/
......@@ -207,6 +234,8 @@ public class DispatchTaskServiceImpl extends BaseService<DispatchTaskDto,Dispatc
dispatchPaperServiceImpl.update(new LambdaUpdateWrapper<DispatchPaper>().
set(DispatchPaper::getArriveTime,now).
set(DispatchPaper::getSaveOrgName,task.getResponseOrgName()).
set(DispatchPaper::getArriveFeedbackCode,"856").
set(DispatchPaper::getArriveFeedbackType,"主动反馈").
eq(DispatchPaper::getSequenceNbr,task.getPaperId()));
// 如果存在救援过程表更新救援过程表中信息
if(task.getIsSaveTask() != null && task.getIsSaveTask()) {
......@@ -405,7 +434,7 @@ public class DispatchTaskServiceImpl extends BaseService<DispatchTaskDto,Dispatc
paperList.stream().forEach(t -> {
String value = t.getFieldValue();
if("action_result".equals(t.getFieldCode())) {
// 处置结果
// 处置结果get
temp.setActionResult(value);
}
});
......@@ -414,6 +443,32 @@ public class DispatchTaskServiceImpl extends BaseService<DispatchTaskDto,Dispatc
return temp;
}
@Override
public WechatMessageDto getWechatMessageDtoByDispatchTaskDto(DispatchTaskDto dispatchTaskDto) {
WechatMessageDto temp = new WechatMessageDto();
// 根据警情分类 封装MessageDto
AlertCalled alertCalled = alertCalledServiceImpl.getById(dispatchTaskDto.getAlertId());
Map<String,String> data = new HashMap<>();
data.put("address",alertCalled.getAddress());
data.put("dispatchTime", DateUtils.date2LongStr(dispatchTaskDto.getDispatchTime()));
if(AlertStageEnums.KRJY.getId().equals(dispatchTaskDto.getAlertCode())) {
temp.setTemplateId(KRJY_TEMPID);
temp.setUrl(KRJY_URL);
temp.setData(data);
} else if(AlertStageEnums.GZWX.getId().equals(dispatchTaskDto.getAlertCode())) {
temp.setTemplateId(WX_TEMPID);
temp.setUrl(WX_URL);
temp.setData(data);
} else if(AlertStageEnums.TSZX.getId().equals(dispatchTaskDto.getAlertCode())) {
temp.setTemplateId(TS_TEMPID);
temp.setUrl(TS_URL);
temp.setData(data);
}
return temp;
}
@Transactional
@Override
public Boolean createDispatchTask(DispatchTaskDto dispatchTaskDto, AgencyUserModel sendUser) {
......@@ -529,7 +584,12 @@ public class DispatchTaskServiceImpl extends BaseService<DispatchTaskDto,Dispatc
rescueProcessServiceImpl.updateByAlertId(rescueProcessDto);
}
}
// 发送任务单
WechatRelation temp = wechatRelationServiceImpl.getOne(new LambdaQueryWrapper<WechatRelation>().eq(WechatRelation::getPhone,dispatchTaskDto.getResponseUserTel()));
if(temp != null && temp.getOpenId() != null) {
WechatMessageDto dto = this.getWechatMessageDtoByDispatchTaskDto(dispatchTaskDto);
wechatService.sendWechatModelMessage(temp.getOpenId() , dto);
}
}
return flag;
}
......
package com.yeejoin.amos.boot.module.tzs.biz.service.impl;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.boot.biz.common.utils.DateUtils;
import com.yeejoin.amos.boot.module.tzs.api.dto.EsElevatorDto;
import com.yeejoin.amos.boot.module.tzs.api.entity.AlertCalled;
import com.yeejoin.amos.boot.module.tzs.api.entity.Elevator;
import com.yeejoin.amos.boot.module.tzs.api.entity.EsElevator;
import com.yeejoin.amos.boot.module.tzs.biz.dao.ESElavtorRepository;
import org.elasticsearch.index.query.BoolQueryBuilder;
import org.elasticsearch.index.query.QueryBuilders;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.data.domain.PageRequest;
import org.springframework.data.elasticsearch.core.ElasticsearchRestTemplate;
import org.springframework.data.elasticsearch.core.SearchHit;
import org.springframework.data.elasticsearch.core.SearchHits;
import org.springframework.data.elasticsearch.core.query.NativeSearchQueryBuilder;
import org.springframework.stereotype.Service;
import org.typroject.tyboot.core.foundation.utils.ValidationUtil;
import java.util.ArrayList;
import java.util.Date;
import java.util.LinkedList;
import java.util.List;
/**
*
* <pre>
* 电梯信息ES检索服务
* </pre>
*
* @authorlitw
* @version 2021年9月26日
*/
@Service
public class ESElevatorServiceImpl {
@Autowired
private ElasticsearchRestTemplate elasticsearchTemplate;
@Autowired
private ESElavtorRepository esElavtorRepository;
@Autowired
AlertCalledServiceImpl iAlertCalledService;
@Value("${alertcall.es.synchrony.time}")
private Long time;
/**
*
* <pre>
* 电梯信息
* </pre>
*
* @param elevator 电梯信息
*/
public EsElevator saveEsElevatorToES(Elevator elevator)
{
EsElevator esElevator = new EsElevator();
esElevator.setSequenceNbr(elevator.getSequenceNbr());
esElevator.setProvince(elevator.getProvince());
esElevator.setAddress(elevator.getAddress());
esElevator.setCity(elevator.getCity());
esElevator.setDistrict(elevator.getDistrict());
esElevator.setLatitude(elevator.getLatitude());
esElevator.setRegisterCode(elevator.getRegisterCode());
esElevator.setRegionCode(elevator.getRegionCode());
esElavtorRepository.save(esElevator);
return esElevator;
}
/**
* 根据关键字查询文档,关键字不为空时按相关性从大到小排序
*
* @param elevatorDto 关键字
* @param current 当前页码
* @param size 页面大小
* @return
*/
@SuppressWarnings({ "rawtypes" })
public Page<EsElevatorDto> queryByKeys(EsElevatorDto elevatorDto, int current, int size) {
Page<EsElevatorDto> result = new Page<>(current, size);
String alarmTypeCode = elevatorDto.getAlarmTypeCode();
String address = elevatorDto.getAddress();
String regionCode = elevatorDto.getRegionCode();
/**
* 通用匹配规则,条件构建
*/
BoolQueryBuilder boolMust = QueryBuilders.boolQuery();
if(!ValidationUtil.isEmpty(alarmTypeCode)) {
BoolQueryBuilder qb0 = QueryBuilders.boolQuery();
LambdaQueryWrapper<AlertCalled> queryWrapper = new LambdaQueryWrapper();
queryWrapper.eq(AlertCalled::getAlarmTypeCode,alarmTypeCode);
queryWrapper.ge(AlertCalled::getCallTime, DateUtils.stampToDate(System.currentTimeMillis(),DateUtils.DATE_PATTERN));
queryWrapper.le(AlertCalled::getCallTime, DateUtils.stampToDate(DateUtils.dateAddDays(new Date(),1).getTime(),DateUtils.DATE_PATTERN));
List<AlertCalled> alertCalleds = iAlertCalledService.list(queryWrapper);
List<Long> stringList = new ArrayList<>();
for (AlertCalled al: alertCalleds
) {
stringList.add(al.getEquipmentId());
}
qb0.must(QueryBuilders.termsQuery("sequenceNbr", stringList.toArray()));
boolMust.must(qb0);
}
if(!ValidationUtil.isEmpty(address)) {
BoolQueryBuilder boolMustAddress = QueryBuilders.boolQuery();
BoolQueryBuilder qb1 = QueryBuilders.boolQuery()
.should(QueryBuilders.matchPhraseQuery("address", address));
boolMustAddress.should(qb1);
boolMust.must(boolMustAddress);
}
if(!ValidationUtil.isEmpty(regionCode)) {
BoolQueryBuilder qb2= QueryBuilders.boolQuery().
filter(QueryBuilders. termQuery("regionCode", regionCode));
boolMust.must(qb2);
}
// 创建查询构造器
NativeSearchQueryBuilder queryBuilder = new NativeSearchQueryBuilder()
// 分页
.withPageable(PageRequest.of(current, size))
// 排序
// .withSort(SortBuilders.fieldSort("callTimeLong").order(SortOrder.DESC))
//过滤条件
.withQuery(boolMust);
List<EsElevatorDto> list = new LinkedList<>();
long totle = 0;
try
{
SearchHits<EsElevator> searchHits =elasticsearchTemplate.search(queryBuilder.build(), EsElevator.class);
for (SearchHit searchHit : searchHits.getSearchHits())
{
JSONObject jsonObject = (JSONObject) JSONObject.toJSON(searchHit.getContent());
EsElevatorDto esElevatorDto =JSONObject.toJavaObject(jsonObject, EsElevatorDto.class);
list.add(esElevatorDto);
}
totle =searchHits.getTotalHits();
}
catch (Exception e)
{
// TODO: handle exception
}
result.setRecords(list);
result.setTotal(totle);
return result;
}
}
......@@ -148,10 +148,11 @@ public class RepairConsultServiceImpl extends BaseService<RepairConsultDto,Repai
DispatchTask dispatchTask = dispatchTaskServiceImpl.getById(taskId);
String person = dispatchTask.getResponseUserName();
content = content.replace("$createTime",createTime).replace("$person",person);
RescueProcessDto rescueProcessDto = rescueProcessServiceImpl.getProcessByAlertId(alertId);
String FKFS = rescueProcessDto.getArriveFeedbackType();
DispatchPaperFormDto dispatchPaperFormDto = dispatchPaperServiceImpl.selectDispatchPaperDtoByAlertId(alertId);
DispatchPaper dispatchPaper = dispatchPaperFormDto.getDispatchPaper();
String FKFS = dispatchPaper.getArriveFeedbackType();
content = content.replace("$FKFS",FKFS);
if(true == dispatchTask.getIsSaveTask()) {
if(dispatchTask.getIsSaveTask() != null && dispatchTask.getIsSaveTask()) {
// 到达的处置环节为维保已到达或者 已到达
CZHJ = DispatchPaperEnums.rescueArrived;
} else {
......
......@@ -203,10 +203,18 @@ public class RescueProcessServiceImpl extends BaseService<RescueProcessDto,Rescu
rescueProcess = BeanDtoVoUtils.convert(rescueProcessDto, RescueProcess.class);
Boolean flag =this.updateById(rescueProcess);
if(arriveByUser) { // 手动到达
DispatchPaperFormDto dispatchPaperDto = dispatchPaperServiceImpl.selectDispatchPaperDtoByAlertId(rescueProcessDto.getAlertId());
if (dispatchPaperDto == null || dispatchPaperDto.getDispatchPaper() == null) {
throw new BadRequest("派遣单信息未找到");
}
DispatchPaper dispatchPaper = dispatchPaperDto.getDispatchPaper();
dispatchPaper.setArriveFeedbackCode(rescueProcessDto.getArriveFeedbackCode());
dispatchPaper.setArriveFeedbackType(rescueProcessDto.getArriveFeedbackType());
// 更新派遣单
dispatchPaperServiceImpl.updateById(dispatchPaper);
// 如果存在三级响应id 则默认三级响应 否则为使用单位
Long taskId = dispatchPaperDto.getDispatchPaper().getRepairOrgTaskId();
if(taskId == null) {
......@@ -215,6 +223,7 @@ public class RescueProcessServiceImpl extends BaseService<RescueProcessDto,Rescu
if(taskId == null) {
throw new BadRequest("派遣任务单信息未找到");
}
repairConsultServiceImpl.saveRepairConsultByAlertIdType( rescueProcessDto.getAlertId(),"DD",taskId,sendUser); //保存接警日志
}
if(saveByUser) { // 手动救援
......
......@@ -146,4 +146,5 @@ public class WechatServiceImpl implements IWechatService {
return response;
}
}
\ No newline at end of file
......@@ -1546,4 +1546,32 @@
update cb_data_dictionary set type_desc = null where sequence_nbr = 1188 ;
</sql>
</changeSet>
<changeSet id="2021-09-272" author="chenzhao">
<preConditions onFail="MARK_RAN">
<tableExists tableName="cb_data_dictionary"/>
</preConditions>
<comment>删除无用数据</comment>
<sql>
update cb_data_dictionary set parent = null where sequence_nbr = 1237 ;
update cb_data_dictionary set parent = null where sequence_nbr = 1238 ;
update cb_data_dictionary set parent = null where sequence_nbr = 1239 ;
update cb_data_dictionary set parent = null where sequence_nbr = 1240 ;
update cb_data_dictionary set parent = null where sequence_nbr = 1241 ;
</sql>
</changeSet>
<changeSet author="chenzhao" id="2021-09-27-cz-1">
<preConditions onFail="MARK_RAN">
<tableExists tableName="cb_fire_experts"/>
</preConditions>
<comment>BUG 2928 表中新增两个字段用来保存详细地址值 </comment>
<sql>
ALTER TABLE `cb_fire_experts` add native_place_val varchar(255) COMMENT '户籍所在地详细地址';
ALTER TABLE `cb_fire_experts` add residence_detail_val varchar(255) COMMENT '现居住地详细地址';
</sql>
</changeSet>
</databaseChangeLog>
......@@ -1150,7 +1150,11 @@
pii.data_json dataJson,
pii.remark remark,
pii.picture_json picJson,
pci.user_id userId,
pci.user_name userName,
pii.id itemId,
group_concat(pcs.photo_data) photoData,
COALESCE (pci.input_value, '') selectValue,
CASE pii.`input_type`
WHEN 0 THEN
'手动录入'
......@@ -1162,10 +1166,11 @@
LEFT JOIN p_route_point_item ppi ON ppi.route_point_id = prp.id
LEFT JOIN p_input_item pii ON ppi.input_item_id = pii.id
LEFT JOIN p_check_input pci ON pci.route_point_item_id = ppi.id
LEFT JOIN p_check_shot pcs ON pci.id = pcs.check_input_id
WHERE
prp.route_id = #{routeId} AND pii.is_delete = 0
-- AND pci.route_point_item_id is NULL
ORDER BY pii.order_no
AND pci.input_value is NULL OR pci.input_value <![CDATA[<>]]> 'pass'
GROUP BY ppi.id
</select>
<select id="getPlanExecuteTeams" resultType="map">
......
......@@ -46,3 +46,15 @@ tzs.wechat.url=https://api.weixin.qq.com
tzs.wechat.appid=wx8918c1aaad956617
##wechatSECRET
tzs.wechat.secret=337c3d8f3e749140d4f9aedc8311033b
##wechatToken
tzs.wechat.token=yeejoin_2021
##wechatTicketUrl
tzs.wechat.ticketurl=https://api.weixin.qq.com/cgi-bin/ticket/getticket?access_token=
tzs.wechat.tempId.kr=SLjmNJoCNLC3FBcYzWzR-u3el0kqXf8WMTmzw8dAQm4
tzs.wechat.url.kr=www.baidu.com
tzs.wechat.tempId.wx=SLjmNJoCNLC3FBcYzWzR-u3el0kqXf8WMTmzw8dAQm4
tzs.wechat.url.wx=www.baidu.com
tzs.wechat.tempId.ts=SLjmNJoCNLC3FBcYzWzR-u3el0kqXf8WMTmzw8dAQm4
tzs.wechat.url.ts=www.baidu.com
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