沙钢智慧能源系统后端代码
潘志宝
2025-01-20 2ee54ad8c0b9b081479b178fdcf3105cc2865b76
shasteel-biz/src/main/java/com/iailab/module/shasteel/mq/consumer/ModelPredictFinishConsumer.java
@@ -57,7 +57,6 @@
            }
            Date predictTime = DateUtils.parse(messageJson.get("predictTime").toString(), DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND);
            // 查询相关预警配置
            List<AlarmConfigRespDTO> configList = mcsApi.listAlarmConfig(new HashMap<String, Object>());
            if (CollectionUtils.isEmpty(configList)) {
@@ -102,6 +101,7 @@
                alarmMessage.setConfigId(configItem.getId());
                alarmMessage.setTitle(configItem.getTitle());
                alarmMessage.setAlarmObj(configItem.getAlarmObj());
                alarmMessage.setAlarmTime(predictTime);
                log.info("对比累计值是否超限");
                StringBuilder content = new StringBuilder();
                if (configItem.getCulUpper() != null && culValue.compareTo(configItem.getCulUpper()) > 0) {
@@ -151,6 +151,9 @@
            }
            if (!CollectionUtils.isEmpty(alarmList)) {
                log.info("发送预警消息");
                Map<String, Object> msg = new HashMap<>(2);
                msg.put("predictTime", predictTime);
                msg.put("alarmList", alarmList);
                rabbitTemplate.convertAndSend(RoutingConstant.EXCHANGE, RoutingConstant.Iailab_Model_Alarm, alarmList);
            }
        } catch (Exception e) {