From 71ffca01f72540bcabc792c22c3daa74ce2eddc8 Mon Sep 17 00:00:00 2001
From: dongyukun <1208714201@qq.com>
Date: 星期四, 13 二月 2025 17:51:17 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/master'

---
 shasteel-biz/src/main/java/com/iailab/module/shasteel/job/task/RunScheduleAirDispatchTask.java |   25 +++++++++++++++----------
 1 files changed, 15 insertions(+), 10 deletions(-)

diff --git a/shasteel-biz/src/main/java/com/iailab/module/shasteel/job/task/RunScheduleAirDispatchTask.java b/shasteel-biz/src/main/java/com/iailab/module/shasteel/job/task/RunScheduleAirDispatchTask.java
index 6d424e8..ca7f863 100644
--- a/shasteel-biz/src/main/java/com/iailab/module/shasteel/job/task/RunScheduleAirDispatchTask.java
+++ b/shasteel-biz/src/main/java/com/iailab/module/shasteel/job/task/RunScheduleAirDispatchTask.java
@@ -67,14 +67,15 @@
             dto.setScheduleTime(scheduleTime);
             dto.setScheduleCode(scheme.getCode());
             MdkScheduleRespDTO mdkScheduleRespDTO = mdkApi.doSchedule(dto);
-            if (CommonConstant.MDK_STATUS_100.equals(mdkScheduleRespDTO.getStatusCode())) {
+            if (!CommonConstant.MDK_STATUS_100.equals(mdkScheduleRespDTO.getStatusCode())) {
                 logger.info("调度结果异常,STATUS=" + mdkScheduleRespDTO.getStatusCode());
                 return;
             }
 
             // 保存预警信息
-            String pressureLWarning = mdkScheduleRespDTO.getResult().get("pressureLWarning").toString();
-            if (StringUtils.isNotBlank(pressureLWarning)) {
+            if (mdkScheduleRespDTO.getResult().get("pressureLWarning") != null &&
+                    StringUtils.isNotEmpty(mdkScheduleRespDTO.getResult().get("pressureLWarning").toString())) {
+                String pressureLWarning = mdkScheduleRespDTO.getResult().get("pressureLWarning").toString();
                 AlarmMessageRespDTO alarm = new AlarmMessageRespDTO();
                 alarm.setTitle("压力低于下限预警");
                 alarm.setContent(pressureLWarning);
@@ -84,10 +85,12 @@
                 mcsApi.createAlarmMessage(alarm);
             }
 
-            String pressureHWarning = mdkScheduleRespDTO.getResult().get("pressureHWarning").toString();
-            if (StringUtils.isNotBlank(pressureHWarning)) {
+
+            if (mdkScheduleRespDTO.getResult().get("pressureHWarning") != null &&
+                    StringUtils.isNotEmpty(mdkScheduleRespDTO.getResult().get("pressureHWarning").toString())) {
+                String pressureHWarning = mdkScheduleRespDTO.getResult().get("pressureHWarning").toString();
                 AlarmMessageRespDTO alarm = new AlarmMessageRespDTO();
-                alarm.setTitle("压力高于上限预警");
+                alarm.setTitle("空压机预警");
                 alarm.setContent(pressureHWarning);
                 alarm.setAlarmObj(scheme.getScheduleObj());
                 alarm.setAlarmType("高于上限");
@@ -96,8 +99,9 @@
             }
 
             // 保存调度建议
-            String dispatchStart = mdkScheduleRespDTO.getResult().get("dispatchStart").toString();
-            if (StringUtils.isNotBlank(pressureHWarning)) {
+            if (mdkScheduleRespDTO.getResult().get("dispatchStart") != null &&
+                    StringUtils.isNotEmpty(mdkScheduleRespDTO.getResult().get("dispatchStart").toString())) {
+                String dispatchStart = mdkScheduleRespDTO.getResult().get("dispatchStart").toString();
                 ScheduleSuggestRespDTO suggest = new ScheduleSuggestRespDTO();
                 suggest.setTitle("空压机启动调度建议");
                 suggest.setContent(dispatchStart);
@@ -107,8 +111,9 @@
                 mcsApi.createScheduleSuggest(suggest);
             }
 
-            String dispatchClose = mdkScheduleRespDTO.getResult().get("dispatchClose").toString();
-            if (StringUtils.isNotBlank(dispatchClose)) {
+            if (mdkScheduleRespDTO.getResult().get("dispatchClose") != null &&
+                    StringUtils.isNotEmpty(mdkScheduleRespDTO.getResult().get("dispatchClose").toString())) {
+                String dispatchClose = mdkScheduleRespDTO.getResult().get("dispatchClose").toString();
                 ScheduleSuggestRespDTO suggest = new ScheduleSuggestRespDTO();
                 suggest.setTitle("空压机关停调度建议");
                 suggest.setContent(dispatchClose);

--
Gitblit v1.9.3