From 2bbf08be2b03a6260720fe0c1612afbd9e1cd45c Mon Sep 17 00:00:00 2001
From: zhanzhiqin <895896009@qq.com>
Date: 星期四, 22 九月 2022 17:11:33 +0800
Subject: [PATCH] fix

---
 ximon-admin/src/main/java/com/sandu/ximon/admin/service/LightTaskService.java |   20 +++++++++++---------
 1 files changed, 11 insertions(+), 9 deletions(-)

diff --git a/ximon-admin/src/main/java/com/sandu/ximon/admin/service/LightTaskService.java b/ximon-admin/src/main/java/com/sandu/ximon/admin/service/LightTaskService.java
index 2d2a307..8aaa080 100644
--- a/ximon-admin/src/main/java/com/sandu/ximon/admin/service/LightTaskService.java
+++ b/ximon-admin/src/main/java/com/sandu/ximon/admin/service/LightTaskService.java
@@ -6,6 +6,7 @@
 import cn.hutool.core.util.ArrayUtil;
 import cn.hutool.core.util.HexUtil;
 import cn.hutool.core.util.StrUtil;
+import com.alibaba.druid.support.json.JSONUtils;
 import com.baomidou.mybatisplus.core.toolkit.Wrappers;
 import com.github.pagehelper.Page;
 import com.github.pagehelper.PageHelper;
@@ -143,23 +144,24 @@
         newPoleMap.forEach(
                 commend -> {
                     //寮�鍏崇伅鏃堕棿
-                    String s = newLightTask.getOpenOrder() + newLightTask.getCloseOrder();
-                    if (newLightTask.getControlOrder() != null) {
-                        //鎺х伅鏃堕棿
-                        s = s + newLightTask.getControlOrder();
-                    }
-                    // 鏇存柊绯荤粺瀹氭椂
-                    commend.setSysScheduled(s);
+//                    String s = newLightTask.getOpenOrder() + newLightTask.getCloseOrder();
+//                    if (newLightTask.getControlOrder() != null) {
+//                        //鎺х伅鏃堕棿
+//                        s = s + newLightTask.getControlOrder();
+//                    }
+//                    // 鏇存柊绯荤粺瀹氭椂
+//                    commend.setSysScheduled(s);
                     if (commend.getIssueStatus() == 0) {
                         //涓嬪彂鎴愬姛  鏇存柊绯荤粺瀹氭椂鍜岀‖浠跺畾鏃�
-                        commend.setDeviceScheduled(s);
+                        commend.setDeviceScheduled(JSONUtils.toJSONString(newLightTask));
                     } else {
                         //涓嬪彂澶辫触  鏇存柊绯荤粺瀹氭椂  淇濈暀纭欢瀹氭椂 纭欢瀹氭椂
 //                        commend.setSysScheduled(s);
                         oldLightTaskStatusAndPoles.forEach(task -> {
                             if (task.getLightAddress().equals(commend.getLightAddress()) && task.getDeviceCode().equals(commend.getDeviceCode())) {
                                 //鍚屼竴涓伅澶�
-                                commend.setDeviceScheduled(task.getDeviceScheduled());
+                                LightTask oldTask = getById(task.getTaskId());
+                                commend.setDeviceScheduled(JSONUtils.toJSONString(oldTask));
                             }
                         });
 

--
Gitblit v1.9.3