From ee81afd33e786beb38c9074113ccafa997c8c1d0 Mon Sep 17 00:00:00 2001 From: zjj <3272660260@qq.com> Date: 星期二, 21 十一月 2023 08:56:20 +0800 Subject: [PATCH] #指令日志更新 --- src/main/java/com/zy/core/thread/LedThread.java | 15 ++++++++------- 1 files changed, 8 insertions(+), 7 deletions(-) diff --git a/src/main/java/com/zy/core/thread/LedThread.java b/src/main/java/com/zy/core/thread/LedThread.java index acd6f89..569df3c 100644 --- a/src/main/java/com/zy/core/thread/LedThread.java +++ b/src/main/java/com/zy/core/thread/LedThread.java @@ -5,6 +5,7 @@ import com.core.common.SpringUtils; import com.zy.asrs.entity.CommandInfo; import com.zy.asrs.service.CommandInfoService; +import com.zy.asrs.service.DeviceErrorService; import com.zy.common.entity.Parameter; import com.zy.common.model.MatDto; import com.zy.core.Slave; @@ -116,14 +117,11 @@ } page.newLine("\n"); + //鏇存柊鎸囦护鐘舵�� CommandInfoService commandInfoService = SpringUtils.getBean(CommandInfoService.class); - CommandInfo commandInfo = new CommandInfo(); - commandInfo.setWrkNo(command.getWorkNo()); - commandInfo.setCommandStatus(1); - commandInfo.setStartTime(new Date()); - commandInfo.setDevice("led"); - commandInfo.setCommand(JSON.toJSONString(command)); - commandInfoService.insert(commandInfo); + CommandInfo commandInfo = command.getCommandInfo(); + commandInfo.setCommandStatus(2); + commandInfoService.updateById(commandInfo); } // 璁剧疆瀛椾綋 @@ -203,10 +201,13 @@ 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杩炴帴澶辫触"); } return connRes; } -- Gitblit v1.9.1