From 9d24e3f484b92fa18cad86b4f2eb7382ca6e792b Mon Sep 17 00:00:00 2001 From: Junjie <fallin.jie@qq.com> Date: 星期四, 18 五月 2023 16:09:25 +0800 Subject: [PATCH] 数据源配置,通过ui配置application.yml --- src/main/java/com/zy/core/thread/SiemensDevpThread.java | 11 +++++++++++ 1 files changed, 11 insertions(+), 0 deletions(-) diff --git a/src/main/java/com/zy/core/thread/SiemensDevpThread.java b/src/main/java/com/zy/core/thread/SiemensDevpThread.java index 101527c..30c753a 100644 --- a/src/main/java/com/zy/core/thread/SiemensDevpThread.java +++ b/src/main/java/com/zy/core/thread/SiemensDevpThread.java @@ -9,7 +9,9 @@ import com.core.common.DateUtils; import com.core.common.SpringUtils; import com.zy.asrs.entity.BasDevp; +import com.zy.asrs.entity.CommandInfo; import com.zy.asrs.service.BasDevpService; +import com.zy.asrs.service.CommandInfoService; import com.zy.core.DevpThread; import com.zy.core.cache.MessageQueue; import com.zy.core.cache.OutputQueue; @@ -241,6 +243,15 @@ array[1] = staProtocol.getStaNo(); // OperateResult write = siemensS7Net.Write("DB100." + index*4, array); + CommandInfoService commandInfoService = SpringUtils.getBean(CommandInfoService.class); + CommandInfo commandInfo = new CommandInfo(); + commandInfo.setWrkNo(staProtocol.getWorkNo().intValue()); + commandInfo.setCommandStatus(1); + commandInfo.setStartTime(new Date()); + commandInfo.setDevice("devp"); + commandInfo.setCommand(JSON.toJSONString(staProtocol)); + commandInfoService.insert(commandInfo); + OperateResult writeResult; //浠诲姟涓嬪彂娆℃暟 int writeCount = 0; -- Gitblit v1.9.1