Browse Source

事件处置记录

develop
lau572 7 months ago
parent
commit
b951534f0b
  1. 20
      zc-business/src/main/java/com/zc/business/service/impl/DcWarningServiceImpl.java

20
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.ValueConverter;
import com.zc.business.enums.WarningSubclassEnum; import com.zc.business.enums.WarningSubclassEnum;
import com.zc.business.mapper.DcEventMapper; import com.zc.business.mapper.DcEventMapper;
import com.zc.business.mapper.DcProcessConfigMapper;
import com.zc.business.mapper.DcWarningMapper; import com.zc.business.mapper.DcWarningMapper;
import com.zc.business.service.IDcEventService; import com.zc.business.service.IDcEventService;
import com.zc.business.service.IDcWarningService; import com.zc.business.service.IDcWarningService;
@ -53,6 +54,8 @@ public class DcWarningServiceImpl implements IDcWarningService
private IDcEventService dcEventService; private IDcEventService dcEventService;
@Autowired @Autowired
private DcEventProcessServiceImpl dcEventProcessService; private DcEventProcessServiceImpl dcEventProcessService;
@Autowired
private DcProcessConfigMapper dcProcessConfigMapper;
@Resource @Resource
private RedisCache redisCache; private RedisCache redisCache;
private final String HAPPEN = "发生"; private final String HAPPEN = "发生";
@ -544,6 +547,23 @@ public class DcWarningServiceImpl implements IDcWarningService
if (insertDcEvent==0){ if (insertDcEvent==0){
return AjaxResult.error("操作失败"); return AjaxResult.error("操作失败");
} }
//事件处置流程记录
DcEventProcess dcEventProcess = new DcEventProcess();
dcEventProcess.setEventId(dcEvent.getId());
dcEventProcess.setSource(1);
List<DcProcessConfig> 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("操作成功"); return AjaxResult.success("操作成功");
} }

Loading…
Cancel
Save