diff --git a/zc-business/src/main/java/com/zc/business/service/impl/DcWarningServiceImpl.java b/zc-business/src/main/java/com/zc/business/service/impl/DcWarningServiceImpl.java index 3c981218..2718dedb 100644 --- a/zc-business/src/main/java/com/zc/business/service/impl/DcWarningServiceImpl.java +++ b/zc-business/src/main/java/com/zc/business/service/impl/DcWarningServiceImpl.java @@ -11,6 +11,7 @@ import com.zc.business.domain.*; import com.zc.business.enums.ValueConverter; import com.zc.business.enums.WarningSubclassEnum; import com.zc.business.mapper.DcEventMapper; +import com.zc.business.mapper.DcProcessConfigMapper; import com.zc.business.mapper.DcWarningMapper; import com.zc.business.service.IDcEventService; import com.zc.business.service.IDcWarningService; @@ -53,6 +54,8 @@ public class DcWarningServiceImpl implements IDcWarningService private IDcEventService dcEventService; @Autowired private DcEventProcessServiceImpl dcEventProcessService; + @Autowired + private DcProcessConfigMapper dcProcessConfigMapper; @Resource private RedisCache redisCache; private final String HAPPEN = "发生"; @@ -544,6 +547,23 @@ public class DcWarningServiceImpl implements IDcWarningService if (insertDcEvent==0){ return AjaxResult.error("操作失败"); } + + //事件处置流程记录 + DcEventProcess dcEventProcess = new DcEventProcess(); + dcEventProcess.setEventId(dcEvent.getId()); + dcEventProcess.setSource(1); + List processConfigList = dcProcessConfigMapper.selectDcProcessConfigByEventType(dcEvent.getEventType().intValue()); + if (processConfigList != null && processConfigList.size() > 0){ + DcProcessConfig dcProcessConfig = processConfigList.get(0); + dcEventProcess.setProcessType(1); + dcEventProcess.setProcessId(Long.valueOf(dcProcessConfig.getNodeNode())); + dcEventProcess.setProcessName(dcProcessConfig.getProcessNode()); + } + String sourceName = ValueConverter.eventSourceName(dcEvent.getEventSource().toString()); + String typeName = ValueConverter.eventTypeName(dcEvent.getEventType().toString()); + dcEventProcess.setContext("由" + sourceName + "上报了一起" + typeName + "事件"); + dcEventProcessService.insertDcEventProcess(dcEventProcess); + return AjaxResult.success("操作成功"); }