From d4f1965d2dd5c1add73778f42e18d6153890858c Mon Sep 17 00:00:00 2001
From: Junjie <fallin.jie@qq.com>
Date: 星期一, 19 六月 2023 15:54:32 +0800
Subject: [PATCH] log

---
 src/main/java/com/zy/core/thread/LiftThread.java |   37 +++++++++++++++++++------------------
 1 files changed, 19 insertions(+), 18 deletions(-)

diff --git a/src/main/java/com/zy/core/thread/LiftThread.java b/src/main/java/com/zy/core/thread/LiftThread.java
index c1c4a82..194035a 100644
--- a/src/main/java/com/zy/core/thread/LiftThread.java
+++ b/src/main/java/com/zy/core/thread/LiftThread.java
@@ -283,6 +283,12 @@
             array = tmp;
         }
 
+        try {
+            Thread.sleep(1000);//鍛戒护涓嬪彂鍓嶄紤鐪�1s
+        } catch (InterruptedException e) {
+            throw new RuntimeException(e);
+        }
+
         OperateResult result = modbusTcpNet.Write("41088", array);;
         if (result != null && result.IsSuccess) {
             News.info("鎻愬崌鏈哄懡浠や笅鍙慬id:{}] >>>>> {}", slave.getId(), JSON.toJSON(command));
@@ -400,10 +406,19 @@
             News.info("鎻愬崌鏈哄懡浠や笅鍙戞垚鍔燂紝鎻愬崌鏈哄彿={}锛屼换鍔℃暟鎹�={}", command.getLiftNo(), JSON.toJSON(command));
             liftProtocol.setWrkTime(new Date());//鏇存柊宸ヤ綔鏃堕棿
 
-            try {
-                Thread.sleep(1000);//鍛戒护涓嬪彂瀹屾垚鍚庝紤鐪�1s
-            } catch (InterruptedException e) {
-                throw new RuntimeException(e);
+            //淇濆瓨鏁版嵁鍒版暟鎹簱鍋氭祦姘�
+            BasLiftOptService liftOptService = SpringUtils.getBean(BasLiftOptService.class);
+            if (liftOptService != null) {
+                BasLiftOpt opt = new BasLiftOpt(
+                        redisCommand.getWrkNo().intValue(),
+                        redisCommand.getLiftNo().intValue(),
+                        new Date(),
+                        null,
+                        null,
+                        null,
+                        JSON.toJSONString(command)
+                );
+                liftOptService.insert(opt);
             }
 
             //鍒ゆ柇鏁版嵁鏄惁鎵ц瀹屾垚
@@ -416,20 +431,6 @@
                 redisUtil.set("lift_wrk_no_" + redisCommand.getWrkNo(), JSON.toJSONString(redisCommand));
             }else {
                 //宸叉墽琛屽畬鎴�
-                //淇濆瓨鏁版嵁鍒版暟鎹簱鍋氭祦姘�
-                BasLiftOptService liftOptService = SpringUtils.getBean(BasLiftOptService.class);
-                if (liftOptService != null) {
-                    BasLiftOpt opt = new BasLiftOpt(
-                            redisCommand.getWrkNo().intValue(),
-                            redisCommand.getLiftNo().intValue(),
-                            new Date(),
-                            null,
-                            null,
-                            null,
-                            JSON.toJSONString(assignCommand)
-                    );
-                    liftOptService.insert(opt);
-                }
                 //鍒犻櫎redis
                 redisUtil.del("lift_wrk_no_" + redisCommand.getWrkNo());
 

--
Gitblit v1.9.1