From 7bc8fd01babb73e200bc41dd05f1dce298434e92 Mon Sep 17 00:00:00 2001 From: lau572 <1010031226@qq.com> Date: Tue, 16 Apr 2024 14:15:54 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BA=8B=E4=BB=B6=E5=A4=84=E7=BD=AE=E6=B5=81?= =?UTF-8?q?=E7=A8=8B=E8=AE=B0=E5=BD=95=E6=8F=92=E5=85=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../zc/business/controller/MsmController.java | 2 -- .../zc/business/domain/DcEventProcess.java | 24 +++++++++++++++---- .../impl/DcEmergencyPlansServiceImpl.java | 2 -- .../impl/DcEventImportantFileServiceImpl.java | 2 -- .../impl/DcEventProcessServiceImpl.java | 23 ++++++++---------- .../service/impl/DcEventServiceImpl.java | 12 ---------- .../mapper/business/DcEventProcessMapper.xml | 9 ++++++- 7 files changed, 37 insertions(+), 37 deletions(-) diff --git a/zc-business/src/main/java/com/zc/business/controller/MsmController.java b/zc-business/src/main/java/com/zc/business/controller/MsmController.java index e68de05e..efc8929e 100644 --- a/zc-business/src/main/java/com/zc/business/controller/MsmController.java +++ b/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.setEventId(eventId); - dcEventProcess.setOperationTime(new Date()); - dcEventProcess.setOperator(SecurityUtils.getUserId().toString()); dcEventProcess.setSource(1); dcEventProcess.setProcessType(2); String context = "出行信息发布:" + content; diff --git a/zc-business/src/main/java/com/zc/business/domain/DcEventProcess.java b/zc-business/src/main/java/com/zc/business/domain/DcEventProcess.java index be0ab666..649c2ea1 100644 --- a/zc-business/src/main/java/com/zc/business/domain/DcEventProcess.java +++ b/zc-business/src/main/java/com/zc/business/domain/DcEventProcess.java @@ -40,6 +40,11 @@ public class DcEventProcess @Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()") private String operator; + /** $column.columnComment */ + @ApiModelProperty(value="操作人名称") + @Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()") + private String operatorName; + /** 1-pc端 2-手机端 */ @ApiModelProperty(value="来源") @@ -74,18 +79,18 @@ public class DcEventProcess @ApiModelProperty("内容类型") @Excel(name = "${type}", readConverterExp = "$column.readConverterExp()") private String type; - +/* @ApiModelProperty("上传文件") - private MultipartFile file; + private MultipartFile file;*/ - public MultipartFile getFile() { + /* public MultipartFile getFile() { return file; } public void setFile(MultipartFile file) { this.file = file; - } + }*/ public void setId(Long id) { @@ -123,7 +128,16 @@ public class DcEventProcess { return operator; } - public void setSource(Integer source) + + public String getOperatorName() { + return operatorName; + } + + public void setOperatorName(String operatorName) { + this.operatorName = operatorName; + } + + public void setSource(Integer source) { this.source = source; } diff --git a/zc-business/src/main/java/com/zc/business/service/impl/DcEmergencyPlansServiceImpl.java b/zc-business/src/main/java/com/zc/business/service/impl/DcEmergencyPlansServiceImpl.java index 2fd3fb7a..6a61c259 100644 --- a/zc-business/src/main/java/com/zc/business/service/impl/DcEmergencyPlansServiceImpl.java +++ b/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.setEventId(id); - dcEventProcess.setOperationTime(new Date()); - dcEventProcess.setOperator(SecurityUtils.getUserId().toString()); dcEventProcess.setSource(1); dcEventProcess.setProcessType(3); dcEventProcess.setProcessId(Long.valueOf(resultObject.get("eventPlanAssocId").toString())); diff --git a/zc-business/src/main/java/com/zc/business/service/impl/DcEventImportantFileServiceImpl.java b/zc-business/src/main/java/com/zc/business/service/impl/DcEventImportantFileServiceImpl.java index 07fae61e..8ef3657b 100644 --- a/zc-business/src/main/java/com/zc/business/service/impl/DcEventImportantFileServiceImpl.java +++ b/zc-business/src/main/java/com/zc/business/service/impl/DcEventImportantFileServiceImpl.java @@ -64,8 +64,6 @@ public class DcEventImportantFileServiceImpl implements IDcEventImportantFileSer if (i > 0){ DcEventProcess dcEventProcess = new DcEventProcess(); dcEventProcess.setEventId(dcEventImportantFile.getEventId()); - dcEventProcess.setOperationTime(new Date()); - dcEventProcess.setOperator(SecurityUtils.getUserId().toString()); dcEventProcess.setSource(1); dcEventProcess.setProcessType(4); dcEventProcess.setProcessId(dcEventImportantFile.getId()); diff --git a/zc-business/src/main/java/com/zc/business/service/impl/DcEventProcessServiceImpl.java b/zc-business/src/main/java/com/zc/business/service/impl/DcEventProcessServiceImpl.java index 4c91278c..cbd1bc7b 100644 --- a/zc-business/src/main/java/com/zc/business/service/impl/DcEventProcessServiceImpl.java +++ b/zc-business/src/main/java/com/zc/business/service/impl/DcEventProcessServiceImpl.java @@ -1,10 +1,12 @@ package com.zc.business.service.impl; import java.io.IOException; +import java.util.Date; import java.util.List; import com.ruoyi.common.config.RuoYiConfig; 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.MimeTypeUtils; import com.zc.business.domain.DcEvent; @@ -62,7 +64,7 @@ public class DcEventProcessServiceImpl implements IDcEventProcessService public int insertDcEventProcess(DcEventProcess dcEventProcess) { //如果有文件传入 - if(!dcEventProcess.getFile().isEmpty()){ + /*if(!dcEventProcess.getFile().isEmpty()){ try { String address = FileUploadUtils.upload(RuoYiConfig.getUploadPath(), dcEventProcess.getFile(), MimeTypeUtils.DEFAULT_ALLOWED_EXTENSION); dcEventProcess.setContext(address); @@ -71,7 +73,7 @@ public class DcEventProcessServiceImpl implements IDcEventProcessService } catch (IOException | InvalidExtensionException e){ e.printStackTrace(); } - } + }*/ //判断是否最后一个节点 if (dcEventProcess.getProcessType() != null && dcEventProcess.getProcessType() == 1){ int finalNode = dcEventProcessMapper.selectFinalNode(dcEventProcess.getEventId()); @@ -79,6 +81,9 @@ public class DcEventProcessServiceImpl implements IDcEventProcessService dcEventService.updateDcEventState(dcEventProcess.getEventId(),2); } } + dcEventProcess.setOperationTime(new Date()); + dcEventProcess.setOperator(SecurityUtils.getUserId().toString()); + dcEventProcess.setOperatorName(SecurityUtils.getLoginUser().getUser().getNickName()); return dcEventProcessMapper.insertDcEventProcess(dcEventProcess); } @@ -92,17 +97,9 @@ public class DcEventProcessServiceImpl implements IDcEventProcessService public boolean batchInsertDcEventProcess(List dcEventProcessList) { dcEventProcessList.forEach(dcEventProcess -> { - //如果有文件传入 - if(!dcEventProcess.getFile().isEmpty()){ - try { - 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(); - } - } + dcEventProcess.setOperationTime(new Date()); + dcEventProcess.setOperator(SecurityUtils.getUserId().toString()); + dcEventProcess.setOperatorName(SecurityUtils.getLoginUser().getUser().getNickName()); }); return dcEventProcessMapper.batchInsertDcEventProcess(dcEventProcessList); diff --git a/zc-business/src/main/java/com/zc/business/service/impl/DcEventServiceImpl.java b/zc-business/src/main/java/com/zc/business/service/impl/DcEventServiceImpl.java index d1411627..0ee94f4b 100644 --- a/zc-business/src/main/java/com/zc/business/service/impl/DcEventServiceImpl.java +++ b/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.setEventId(dcEvent.getId()); - dcEventProcess.setOperationTime(new Date()); - dcEventProcess.setOperator(SecurityUtils.getUserId().toString()); dcEventProcess.setSource(1); List processConfigList = dcProcessConfigMapper.selectDcProcessConfigByEventType(dcEvent.getEventType().intValue()); if (processConfigList != null && processConfigList.size() > 0){ @@ -647,8 +645,6 @@ if (dcEvent.getDcEventTrafficControl().getFacilityIds().length<1 &&dcEventId == //事件处置流程记录 DcEventProcess dcEventProcess = new DcEventProcess(); dcEventProcess.setEventId(dcEvent.getId()); - dcEventProcess.setOperationTime(new Date()); - dcEventProcess.setOperator(SecurityUtils.getUserId().toString()); dcEventProcess.setSource(1); List processConfigList = dcProcessConfigMapper.selectDcProcessConfigByEventType(dcEvent.getEventType().intValue()); if (processConfigList != null && processConfigList.size() > 0){ @@ -690,8 +686,6 @@ if (dcEvent.getDcEventTrafficControl().getFacilityIds().length<1 &&dcEventId == //事件处置流程记录 DcEventProcess dcEventProcess = new DcEventProcess(); dcEventProcess.setEventId(dcEvent.getId()); - dcEventProcess.setOperationTime(new Date()); - dcEventProcess.setOperator(SecurityUtils.getUserId().toString()); dcEventProcess.setSource(1); dcEventProcess.setContext(context); dcEventProcessService.insertDcEventProcess(dcEventProcess); @@ -979,8 +973,6 @@ if (dcEvent.getDcEventTrafficControl().getFacilityIds().length<1 &&dcEventId == //事件处置流程记录 DcEventProcess dcEventProcess = new DcEventProcess(); dcEventProcess.setEventId(dcEvent.getId()); - dcEventProcess.setOperationTime(new Date()); - dcEventProcess.setOperator(SecurityUtils.getUserId().toString()); dcEventProcess.setSource(1); List processConfigList = dcProcessConfigMapper.selectDcProcessConfigByEventType(dcEvent.getEventType().intValue()); if (processConfigList != null && processConfigList.size() > 0){ @@ -1404,8 +1396,6 @@ if (dcEvent.getDcEventTrafficControl().getFacilityIds().length<1 &&dcEventId == //事件处置流程记录 DcEventProcess dcEventProcess = new DcEventProcess(); dcEventProcess.setEventId(eventId); - dcEventProcess.setOperationTime(new Date()); - dcEventProcess.setOperator(SecurityUtils.getUserId().toString()); dcEventProcess.setSource(1); dcEventProcess.setContext("事件解除,处置完毕,处置时长:" + datePoor); @@ -1429,8 +1419,6 @@ if (dcEvent.getDcEventTrafficControl().getFacilityIds().length<1 &&dcEventId == //事件处置流程记录 DcEventProcess dcEventProcess = new DcEventProcess(); dcEventProcess.setEventId(eventId); - dcEventProcess.setOperationTime(new Date()); - dcEventProcess.setOperator(SecurityUtils.getUserId().toString()); dcEventProcess.setSource(1); dcEventProcess.setProcessType(1); dcEventProcess.setProcessId(6L); diff --git a/zc-business/src/main/resources/mapper/business/DcEventProcessMapper.xml b/zc-business/src/main/resources/mapper/business/DcEventProcessMapper.xml index 28e045e5..cab4e024 100644 --- a/zc-business/src/main/resources/mapper/business/DcEventProcessMapper.xml +++ b/zc-business/src/main/resources/mapper/business/DcEventProcessMapper.xml @@ -9,6 +9,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" + @@ -18,7 +19,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" - 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