From 92c572e50893a93a810bbe6adb6d3cdbfc225073 Mon Sep 17 00:00:00 2001
From: lsh <lsh@163.com>
Date: 星期二, 20 五月 2025 14:17:33 +0800
Subject: [PATCH] *
---
src/main/java/com/zy/core/thread/LedThread.java | 24 +++++++++++++++---------
1 files changed, 15 insertions(+), 9 deletions(-)
diff --git a/src/main/java/com/zy/core/thread/LedThread.java b/src/main/java/com/zy/core/thread/LedThread.java
index 569df3c..eb46bc6 100644
--- a/src/main/java/com/zy/core/thread/LedThread.java
+++ b/src/main/java/com/zy/core/thread/LedThread.java
@@ -11,6 +11,7 @@
import com.zy.core.Slave;
import com.zy.core.ThreadHandler;
import com.zy.core.cache.MessageQueue;
+import com.zy.core.enums.CommandStatusType;
import com.zy.core.enums.SlaveType;
import com.zy.core.model.Task;
import com.zy.core.model.command.LedCommand;
@@ -111,7 +112,7 @@
if(idx >= 0){
strQty.substring(0,idx);
}
- page.newLine(matDto.getMaknx() + "[鏁伴噺" + strQty +"]");
+ page.newLine(matDto.getMaktx() + "[鏁伴噺" + strQty +"]");
// page.newLine(matDto.getMaknx() + "銆愭暟閲�" + matDto.getCount() +"銆�");
}
}
@@ -120,7 +121,7 @@
//鏇存柊鎸囦护鐘舵��
CommandInfoService commandInfoService = SpringUtils.getBean(CommandInfoService.class);
CommandInfo commandInfo = command.getCommandInfo();
- commandInfo.setCommandStatus(2);
+ commandInfo.setCommandStatus(CommandStatusType.COMPLETE.id);
commandInfoService.updateById(commandInfo);
}
@@ -201,14 +202,19 @@
screen.turnOn();
} catch (Exception ignore) {
}
- DeviceErrorService deviceErrorService = SpringUtils.getBean(DeviceErrorService.class);
- if (connRes) {
- log.info("led杩炴帴鎴愬姛 ===>> [id:{}] [ip:{}] [port:{}]", slave.getId(), slave.getIp(), slave.getPort());
- deviceErrorService.deleteDeviceError("led", slave.getId());
- } else {
- log.error("led杩炴帴澶辫触锛侊紒锛� ===>> [id:{}] [ip:{}] [port:{}]", slave.getId(), slave.getIp(), slave.getPort());
- deviceErrorService.addDeviceError("led", slave.getId(), "led杩炴帴澶辫触");
+ try{
+ DeviceErrorService deviceErrorService = SpringUtils.getBean(DeviceErrorService.class);
+ if (connRes) {
+ log.info("led杩炴帴鎴愬姛 ===>> [id:{}] [ip:{}] [port:{}]", slave.getId(), slave.getIp(), slave.getPort());
+ deviceErrorService.deleteDeviceError("led", slave.getId());
+ } else {
+ log.error("led杩炴帴澶辫触锛侊紒锛� ===>> [id:{}] [ip:{}] [port:{}]", slave.getId(), slave.getIp(), slave.getPort());
+ deviceErrorService.addDeviceError("led", slave.getId(), "led杩炴帴澶辫触");
+ }
+ } catch (Exception e){
+ log.error("e:"+e.getMessage());
}
+
return connRes;
}
--
Gitblit v1.9.1