shasteel-biz/src/main/java/com/iailab/module/shasteel/job/task/RunScheduleAirRatioTask.java
@@ -1,6 +1,7 @@ package com.iailab.module.shasteel.job.task; import com.iailab.module.model.api.mcs.McsApi; import com.iailab.module.model.api.mcs.dto.AlarmMessageRespDTO; import com.iailab.module.model.api.mcs.dto.StScheduleSchemeDTO; import com.iailab.module.model.api.mdk.MdkApi; import com.iailab.module.model.api.mdk.dto.MdkScheduleReqDTO; @@ -61,6 +62,11 @@ MdkScheduleRespDTO mdkScheduleRespDTO = mdkApi.doSchedule(dto); // 结果写入测点 mdkApi.scheduleModelOut(mdkScheduleRespDTO); if (mdkScheduleRespDTO.getResult().get("exceptMessage") != null && StringUtils.isNotEmpty(mdkScheduleRespDTO.getResult().get("exceptMessage").toString())) { this.saveAlarmMessage("压缩空气用户用量预警", mdkScheduleRespDTO.getResult().get("exceptMessage"), scheme.getScheduleObj(), scheduleTime); } } logger.info(params + "调度方案执行完成"); } catch (Exception ex) { @@ -69,4 +75,23 @@ } logger.info("RunScheduleAirRatioTask运行完成"); } private void saveAlarmMessage(String title, Object content, String scheduleObj, Date scheduleTime) { if (content == null) { logger.info(title + "预警信息为空,不产生预警"); return; } String contentStr = content.toString(); if (StringUtils.isBlank(contentStr)) { logger.info(title + "预警信息为空,不产生预警"); return; } AlarmMessageRespDTO alarm = new AlarmMessageRespDTO(); alarm.setTitle(title); alarm.setContent(contentStr); alarm.setAlarmObj(scheduleObj); alarm.setAlarmType(""); alarm.setAlarmTime(scheduleTime); mcsApi.createAlarmMessage(alarm); } } shasteel-biz/src/main/java/com/iailab/module/shasteel/job/task/RunScheduleOnaOptTask.java
@@ -1,6 +1,5 @@ package com.iailab.module.shasteel.job.task; import com.alibaba.fastjson.JSONArray; import com.iailab.module.model.api.mcs.McsApi; import com.iailab.module.model.api.mcs.dto.AlarmMessageRespDTO; import com.iailab.module.model.api.mcs.dto.ScheduleSuggestRespDTO; @@ -41,6 +40,10 @@ * 氮气预警模型 * 预警信号 advice * * consumpOxygenTest * 耗氧异常检测 * 预警信号 advice * * @author PanZhibao * @Description * @createTime 2025年01月07日 @@ -73,6 +76,8 @@ private static final String CODE05 = "05"; private static final String CODE01 = "01"; private static final String CODE_CONS = "consumpOxygenTest"; @Override public void run(String params) { @@ -157,6 +162,16 @@ if(adviceValues.compareTo(BigDecimal.ZERO) != 0){ saveAlarmMessage("氮气预警", advice, scheduleObj, scheduleTime,adviceValues,scheduleScheme.getAdjustRate()); } }else if (entry.getKey().equals(CODE_CONS)) { StScheduleSchemeDTO scheduleScheme = schemeMap.get(CODE_CONS); String scheduleObj = scheduleScheme.getScheduleObj(); BigDecimal adviceValues = new BigDecimal(entry.getValue().getResult().get("advicevalues").toString()); logger.info("耗氧异常检测 adviceValues=" + adviceValues); String advice = entry.getValue().getResult().get("advice").toString(); if(adviceValues.compareTo(BigDecimal.ZERO) != 0){ saveAlarmMessage("耗氧异常检测", advice, scheduleObj, scheduleTime, adviceValues, scheduleScheme.getAdjustRate()); } } } logger.info(params + "调度方案执行完成");