Browse Source

事件处置流程记录插入

develop
lau572 8 months ago
parent
commit
7bc8fd01ba
  1. 2
      zc-business/src/main/java/com/zc/business/controller/MsmController.java
  2. 22
      zc-business/src/main/java/com/zc/business/domain/DcEventProcess.java
  3. 2
      zc-business/src/main/java/com/zc/business/service/impl/DcEmergencyPlansServiceImpl.java
  4. 2
      zc-business/src/main/java/com/zc/business/service/impl/DcEventImportantFileServiceImpl.java
  5. 23
      zc-business/src/main/java/com/zc/business/service/impl/DcEventProcessServiceImpl.java
  6. 12
      zc-business/src/main/java/com/zc/business/service/impl/DcEventServiceImpl.java
  7. 9
      zc-business/src/main/resources/mapper/business/DcEventProcessMapper.xml

2
zc-business/src/main/java/com/zc/business/controller/MsmController.java

@ -102,8 +102,6 @@ public class MsmController extends BaseController {
DcEventProcess dcEventProcess = new DcEventProcess(); DcEventProcess dcEventProcess = new DcEventProcess();
dcEventProcess.setEventId(eventId); dcEventProcess.setEventId(eventId);
dcEventProcess.setOperationTime(new Date());
dcEventProcess.setOperator(SecurityUtils.getUserId().toString());
dcEventProcess.setSource(1); dcEventProcess.setSource(1);
dcEventProcess.setProcessType(2); dcEventProcess.setProcessType(2);
String context = "出行信息发布:" + content; String context = "出行信息发布:" + content;

22
zc-business/src/main/java/com/zc/business/domain/DcEventProcess.java

@ -40,6 +40,11 @@ public class DcEventProcess
@Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()") @Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
private String operator; private String operator;
/** $column.columnComment */
@ApiModelProperty(value="操作人名称")
@Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
private String operatorName;
/** 1-pc端 /** 1-pc端
2-手机端 */ 2-手机端 */
@ApiModelProperty(value="来源") @ApiModelProperty(value="来源")
@ -74,18 +79,18 @@ public class DcEventProcess
@ApiModelProperty("内容类型") @ApiModelProperty("内容类型")
@Excel(name = "${type}", readConverterExp = "$column.readConverterExp()") @Excel(name = "${type}", readConverterExp = "$column.readConverterExp()")
private String type; private String type;
/*
@ApiModelProperty("上传文件") @ApiModelProperty("上传文件")
private MultipartFile file; private MultipartFile file;*/
public MultipartFile getFile() { /* public MultipartFile getFile() {
return file; return file;
} }
public void setFile(MultipartFile file) { public void setFile(MultipartFile file) {
this.file = file; this.file = file;
} }*/
public void setId(Long id) public void setId(Long id)
{ {
@ -123,6 +128,15 @@ public class DcEventProcess
{ {
return operator; return operator;
} }
public String getOperatorName() {
return operatorName;
}
public void setOperatorName(String operatorName) {
this.operatorName = operatorName;
}
public void setSource(Integer source) public void setSource(Integer source)
{ {
this.source = source; this.source = source;

2
zc-business/src/main/java/com/zc/business/service/impl/DcEmergencyPlansServiceImpl.java

@ -757,8 +757,6 @@ public class DcEmergencyPlansServiceImpl implements DcEmergencyPlansService {
} }
DcEventProcess dcEventProcess = new DcEventProcess(); DcEventProcess dcEventProcess = new DcEventProcess();
dcEventProcess.setEventId(id); dcEventProcess.setEventId(id);
dcEventProcess.setOperationTime(new Date());
dcEventProcess.setOperator(SecurityUtils.getUserId().toString());
dcEventProcess.setSource(1); dcEventProcess.setSource(1);
dcEventProcess.setProcessType(3); dcEventProcess.setProcessType(3);
dcEventProcess.setProcessId(Long.valueOf(resultObject.get("eventPlanAssocId").toString())); dcEventProcess.setProcessId(Long.valueOf(resultObject.get("eventPlanAssocId").toString()));

2
zc-business/src/main/java/com/zc/business/service/impl/DcEventImportantFileServiceImpl.java

@ -64,8 +64,6 @@ public class DcEventImportantFileServiceImpl implements IDcEventImportantFileSer
if (i > 0){ if (i > 0){
DcEventProcess dcEventProcess = new DcEventProcess(); DcEventProcess dcEventProcess = new DcEventProcess();
dcEventProcess.setEventId(dcEventImportantFile.getEventId()); dcEventProcess.setEventId(dcEventImportantFile.getEventId());
dcEventProcess.setOperationTime(new Date());
dcEventProcess.setOperator(SecurityUtils.getUserId().toString());
dcEventProcess.setSource(1); dcEventProcess.setSource(1);
dcEventProcess.setProcessType(4); dcEventProcess.setProcessType(4);
dcEventProcess.setProcessId(dcEventImportantFile.getId()); dcEventProcess.setProcessId(dcEventImportantFile.getId());

23
zc-business/src/main/java/com/zc/business/service/impl/DcEventProcessServiceImpl.java

@ -1,10 +1,12 @@
package com.zc.business.service.impl; package com.zc.business.service.impl;
import java.io.IOException; import java.io.IOException;
import java.util.Date;
import java.util.List; import java.util.List;
import com.ruoyi.common.config.RuoYiConfig; import com.ruoyi.common.config.RuoYiConfig;
import com.ruoyi.common.exception.file.InvalidExtensionException; import com.ruoyi.common.exception.file.InvalidExtensionException;
import com.ruoyi.common.utils.SecurityUtils;
import com.ruoyi.common.utils.file.FileUploadUtils; import com.ruoyi.common.utils.file.FileUploadUtils;
import com.ruoyi.common.utils.file.MimeTypeUtils; import com.ruoyi.common.utils.file.MimeTypeUtils;
import com.zc.business.domain.DcEvent; import com.zc.business.domain.DcEvent;
@ -62,7 +64,7 @@ public class DcEventProcessServiceImpl implements IDcEventProcessService
public int insertDcEventProcess(DcEventProcess dcEventProcess) public int insertDcEventProcess(DcEventProcess dcEventProcess)
{ {
//如果有文件传入 //如果有文件传入
if(!dcEventProcess.getFile().isEmpty()){ /*if(!dcEventProcess.getFile().isEmpty()){
try { try {
String address = FileUploadUtils.upload(RuoYiConfig.getUploadPath(), dcEventProcess.getFile(), MimeTypeUtils.DEFAULT_ALLOWED_EXTENSION); String address = FileUploadUtils.upload(RuoYiConfig.getUploadPath(), dcEventProcess.getFile(), MimeTypeUtils.DEFAULT_ALLOWED_EXTENSION);
dcEventProcess.setContext(address); dcEventProcess.setContext(address);
@ -71,7 +73,7 @@ public class DcEventProcessServiceImpl implements IDcEventProcessService
} catch (IOException | InvalidExtensionException e){ } catch (IOException | InvalidExtensionException e){
e.printStackTrace(); e.printStackTrace();
} }
} }*/
//判断是否最后一个节点 //判断是否最后一个节点
if (dcEventProcess.getProcessType() != null && dcEventProcess.getProcessType() == 1){ if (dcEventProcess.getProcessType() != null && dcEventProcess.getProcessType() == 1){
int finalNode = dcEventProcessMapper.selectFinalNode(dcEventProcess.getEventId()); int finalNode = dcEventProcessMapper.selectFinalNode(dcEventProcess.getEventId());
@ -79,6 +81,9 @@ public class DcEventProcessServiceImpl implements IDcEventProcessService
dcEventService.updateDcEventState(dcEventProcess.getEventId(),2); dcEventService.updateDcEventState(dcEventProcess.getEventId(),2);
} }
} }
dcEventProcess.setOperationTime(new Date());
dcEventProcess.setOperator(SecurityUtils.getUserId().toString());
dcEventProcess.setOperatorName(SecurityUtils.getLoginUser().getUser().getNickName());
return dcEventProcessMapper.insertDcEventProcess(dcEventProcess); return dcEventProcessMapper.insertDcEventProcess(dcEventProcess);
} }
@ -92,17 +97,9 @@ public class DcEventProcessServiceImpl implements IDcEventProcessService
public boolean batchInsertDcEventProcess(List<DcEventProcess> dcEventProcessList) public boolean batchInsertDcEventProcess(List<DcEventProcess> dcEventProcessList)
{ {
dcEventProcessList.forEach(dcEventProcess -> { dcEventProcessList.forEach(dcEventProcess -> {
//如果有文件传入 dcEventProcess.setOperationTime(new Date());
if(!dcEventProcess.getFile().isEmpty()){ dcEventProcess.setOperator(SecurityUtils.getUserId().toString());
try { dcEventProcess.setOperatorName(SecurityUtils.getLoginUser().getUser().getNickName());
String address = FileUploadUtils.upload(RuoYiConfig.getUploadPath(), dcEventProcess.getFile(), MimeTypeUtils.DEFAULT_ALLOWED_EXTENSION);
dcEventProcess.setContext(address);
String type = address.split("\\.")[1];
dcEventProcess.setType(type);
} catch (IOException | InvalidExtensionException e){
e.printStackTrace();
}
}
}); });
return dcEventProcessMapper.batchInsertDcEventProcess(dcEventProcessList); return dcEventProcessMapper.batchInsertDcEventProcess(dcEventProcessList);

12
zc-business/src/main/java/com/zc/business/service/impl/DcEventServiceImpl.java

@ -535,8 +535,6 @@ if (dcEvent.getDcEventTrafficControl().getFacilityIds().length<1 &&dcEventId ==
//事件处置流程记录 //事件处置流程记录
DcEventProcess dcEventProcess = new DcEventProcess(); DcEventProcess dcEventProcess = new DcEventProcess();
dcEventProcess.setEventId(dcEvent.getId()); dcEventProcess.setEventId(dcEvent.getId());
dcEventProcess.setOperationTime(new Date());
dcEventProcess.setOperator(SecurityUtils.getUserId().toString());
dcEventProcess.setSource(1); dcEventProcess.setSource(1);
List<DcProcessConfig> processConfigList = dcProcessConfigMapper.selectDcProcessConfigByEventType(dcEvent.getEventType().intValue()); List<DcProcessConfig> processConfigList = dcProcessConfigMapper.selectDcProcessConfigByEventType(dcEvent.getEventType().intValue());
if (processConfigList != null && processConfigList.size() > 0){ if (processConfigList != null && processConfigList.size() > 0){
@ -647,8 +645,6 @@ if (dcEvent.getDcEventTrafficControl().getFacilityIds().length<1 &&dcEventId ==
//事件处置流程记录 //事件处置流程记录
DcEventProcess dcEventProcess = new DcEventProcess(); DcEventProcess dcEventProcess = new DcEventProcess();
dcEventProcess.setEventId(dcEvent.getId()); dcEventProcess.setEventId(dcEvent.getId());
dcEventProcess.setOperationTime(new Date());
dcEventProcess.setOperator(SecurityUtils.getUserId().toString());
dcEventProcess.setSource(1); dcEventProcess.setSource(1);
List<DcProcessConfig> processConfigList = dcProcessConfigMapper.selectDcProcessConfigByEventType(dcEvent.getEventType().intValue()); List<DcProcessConfig> processConfigList = dcProcessConfigMapper.selectDcProcessConfigByEventType(dcEvent.getEventType().intValue());
if (processConfigList != null && processConfigList.size() > 0){ if (processConfigList != null && processConfigList.size() > 0){
@ -690,8 +686,6 @@ if (dcEvent.getDcEventTrafficControl().getFacilityIds().length<1 &&dcEventId ==
//事件处置流程记录 //事件处置流程记录
DcEventProcess dcEventProcess = new DcEventProcess(); DcEventProcess dcEventProcess = new DcEventProcess();
dcEventProcess.setEventId(dcEvent.getId()); dcEventProcess.setEventId(dcEvent.getId());
dcEventProcess.setOperationTime(new Date());
dcEventProcess.setOperator(SecurityUtils.getUserId().toString());
dcEventProcess.setSource(1); dcEventProcess.setSource(1);
dcEventProcess.setContext(context); dcEventProcess.setContext(context);
dcEventProcessService.insertDcEventProcess(dcEventProcess); dcEventProcessService.insertDcEventProcess(dcEventProcess);
@ -979,8 +973,6 @@ if (dcEvent.getDcEventTrafficControl().getFacilityIds().length<1 &&dcEventId ==
//事件处置流程记录 //事件处置流程记录
DcEventProcess dcEventProcess = new DcEventProcess(); DcEventProcess dcEventProcess = new DcEventProcess();
dcEventProcess.setEventId(dcEvent.getId()); dcEventProcess.setEventId(dcEvent.getId());
dcEventProcess.setOperationTime(new Date());
dcEventProcess.setOperator(SecurityUtils.getUserId().toString());
dcEventProcess.setSource(1); dcEventProcess.setSource(1);
List<DcProcessConfig> processConfigList = dcProcessConfigMapper.selectDcProcessConfigByEventType(dcEvent.getEventType().intValue()); List<DcProcessConfig> processConfigList = dcProcessConfigMapper.selectDcProcessConfigByEventType(dcEvent.getEventType().intValue());
if (processConfigList != null && processConfigList.size() > 0){ if (processConfigList != null && processConfigList.size() > 0){
@ -1404,8 +1396,6 @@ if (dcEvent.getDcEventTrafficControl().getFacilityIds().length<1 &&dcEventId ==
//事件处置流程记录 //事件处置流程记录
DcEventProcess dcEventProcess = new DcEventProcess(); DcEventProcess dcEventProcess = new DcEventProcess();
dcEventProcess.setEventId(eventId); dcEventProcess.setEventId(eventId);
dcEventProcess.setOperationTime(new Date());
dcEventProcess.setOperator(SecurityUtils.getUserId().toString());
dcEventProcess.setSource(1); dcEventProcess.setSource(1);
dcEventProcess.setContext("事件解除,处置完毕,处置时长:" + datePoor); dcEventProcess.setContext("事件解除,处置完毕,处置时长:" + datePoor);
@ -1429,8 +1419,6 @@ if (dcEvent.getDcEventTrafficControl().getFacilityIds().length<1 &&dcEventId ==
//事件处置流程记录 //事件处置流程记录
DcEventProcess dcEventProcess = new DcEventProcess(); DcEventProcess dcEventProcess = new DcEventProcess();
dcEventProcess.setEventId(eventId); dcEventProcess.setEventId(eventId);
dcEventProcess.setOperationTime(new Date());
dcEventProcess.setOperator(SecurityUtils.getUserId().toString());
dcEventProcess.setSource(1); dcEventProcess.setSource(1);
dcEventProcess.setProcessType(1); dcEventProcess.setProcessType(1);
dcEventProcess.setProcessId(6L); dcEventProcess.setProcessId(6L);

9
zc-business/src/main/resources/mapper/business/DcEventProcessMapper.xml

@ -9,6 +9,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="eventId" column="event_id" /> <result property="eventId" column="event_id" />
<result property="operationTime" column="operation_time" /> <result property="operationTime" column="operation_time" />
<result property="operator" column="operator" /> <result property="operator" column="operator" />
<result property="operatorName" column="operator_name" />
<result property="source" column="source" /> <result property="source" column="source" />
<result property="processType" column="process_type" /> <result property="processType" column="process_type" />
<result property="context" column="context" /> <result property="context" column="context" />
@ -18,7 +19,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</resultMap> </resultMap>
<sql id="selectDcEventProcessVo"> <sql id="selectDcEventProcessVo">
select id, event_id, operation_time, operator, source, process_type, context, process_id, process_name, `type` from dc_event_process select id, event_id, operation_time, operator,operator_name, source, process_type, context, process_id, process_name, `type` from dc_event_process
</sql> </sql>
<select id="selectDcEventProcessList" parameterType="DcEventProcess" resultMap="DcEventProcessResult"> <select id="selectDcEventProcessList" parameterType="DcEventProcess" resultMap="DcEventProcessResult">
@ -27,6 +28,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="eventId != null and eventId != ''"> and event_id = #{eventId}</if> <if test="eventId != null and eventId != ''"> and event_id = #{eventId}</if>
<if test="operationTime != null "> and operation_time = #{operationTime}</if> <if test="operationTime != null "> and operation_time = #{operationTime}</if>
<if test="operator != null and operator != ''"> and operator = #{operator}</if> <if test="operator != null and operator != ''"> and operator = #{operator}</if>
<if test="operatorName != null and operatorName != ''"> and operator_name = #{operatorName}</if>
<if test="source != null "> and source = #{source}</if> <if test="source != null "> and source = #{source}</if>
<if test="processType != null "> and process_type = #{processType}</if> <if test="processType != null "> and process_type = #{processType}</if>
<if test="context != null and context != ''"> and context = #{context}</if> <if test="context != null and context != ''"> and context = #{context}</if>
@ -48,6 +50,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="eventId != null and eventId != ''">event_id,</if> <if test="eventId != null and eventId != ''">event_id,</if>
<if test="operationTime != null">operation_time,</if> <if test="operationTime != null">operation_time,</if>
<if test="operator != null and operator != ''">operator,</if> <if test="operator != null and operator != ''">operator,</if>
<if test="operatorName != null and operatorName != ''">operator_name,</if>
<if test="source != null">source,</if> <if test="source != null">source,</if>
<if test="processType != null">process_type,</if> <if test="processType != null">process_type,</if>
<if test="context != null">context,</if> <if test="context != null">context,</if>
@ -60,6 +63,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="eventId != null and eventId != ''">#{eventId},</if> <if test="eventId != null and eventId != ''">#{eventId},</if>
<if test="operationTime != null">#{operationTime},</if> <if test="operationTime != null">#{operationTime},</if>
<if test="operator != null and operator != ''">#{operator},</if> <if test="operator != null and operator != ''">#{operator},</if>
<if test="operatorName != null and operatorName != ''">#{operatorName},</if>
<if test="source != null">#{source},</if> <if test="source != null">#{source},</if>
<if test="processType != null">#{processType},</if> <if test="processType != null">#{processType},</if>
<if test="context != null">#{context},</if> <if test="context != null">#{context},</if>
@ -77,6 +81,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="item.eventId != null and item.eventId != ''">event_id,</if> <if test="item.eventId != null and item.eventId != ''">event_id,</if>
<if test="item.operationTime != null">operation_time,</if> <if test="item.operationTime != null">operation_time,</if>
<if test="item.operator != null and item.operator != ''">operator,</if> <if test="item.operator != null and item.operator != ''">operator,</if>
<if test="item.operatorName != null and item.operatorName != ''">operator_name,</if>
<if test="item.source != null">source,</if> <if test="item.source != null">source,</if>
<if test="item.processType != null">process_type,</if> <if test="item.processType != null">process_type,</if>
<if test="item.context != null">context,</if> <if test="item.context != null">context,</if>
@ -89,6 +94,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="item.eventId != null and item.eventId != ''">#{item.eventId},</if> <if test="item.eventId != null and item.eventId != ''">#{item.eventId},</if>
<if test="item.operationTime != null">#{item.operationTime},</if> <if test="item.operationTime != null">#{item.operationTime},</if>
<if test="item.operator != null and item.operator != ''">#{item.operator},</if> <if test="item.operator != null and item.operator != ''">#{item.operator},</if>
<if test="item.operatorName != null and item.operatorName != ''">#{item.operatorName},</if>
<if test="item.source != null">#{item.source},</if> <if test="item.source != null">#{item.source},</if>
<if test="item.processType != null">#{item.processType},</if> <if test="item.processType != null">#{item.processType},</if>
<if test="item.context != null">#{item.context},</if> <if test="item.context != null">#{item.context},</if>
@ -105,6 +111,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="eventId != null and eventId != ''">event_id = #{eventId},</if> <if test="eventId != null and eventId != ''">event_id = #{eventId},</if>
<if test="operationTime != null">operation_time = #{operationTime},</if> <if test="operationTime != null">operation_time = #{operationTime},</if>
<if test="operator != null and operator != ''">operator = #{operator},</if> <if test="operator != null and operator != ''">operator = #{operator},</if>
<if test="operatorName != null and operatorName != ''">operator_name = #{operatorName},</if>
<if test="source != null">source = #{source},</if> <if test="source != null">source = #{source},</if>
<if test="processType != null">process_type = #{processType},</if> <if test="processType != null">process_type = #{processType},</if>
<if test="context != null">context = #{context},</if> <if test="context != null">context = #{context},</if>

Loading…
Cancel
Save