From 8280c9eee52dd9fa3501305dfd4d1cab1564a73b Mon Sep 17 00:00:00 2001
From: Junjie <DELL@qq.com>
Date: 星期六, 20 十二月 2025 15:01:20 +0800
Subject: [PATCH] #

---
 src/main/java/com/zy/core/network/fake/ZyStationFakeConnect.java |   16 ++++++++++++----
 1 files changed, 12 insertions(+), 4 deletions(-)

diff --git a/src/main/java/com/zy/core/network/fake/ZyStationFakeConnect.java b/src/main/java/com/zy/core/network/fake/ZyStationFakeConnect.java
index faf66f7..dbb8346 100644
--- a/src/main/java/com/zy/core/network/fake/ZyStationFakeConnect.java
+++ b/src/main/java/com/zy/core/network/fake/ZyStationFakeConnect.java
@@ -18,6 +18,7 @@
 import java.util.HashMap;
 import java.util.List;
 
+import java.util.Random;
 import java.util.concurrent.CopyOnWriteArrayList;
 import java.util.concurrent.ExecutorService;
 import java.util.concurrent.Executors;
@@ -305,8 +306,9 @@
 
             Integer nextStationId = null;
             Integer nextStationDeviceNo = null;
+            NavigateNode nextNode = null;
             try {
-                NavigateNode nextNode = navigateNodes.get(i + 1);
+                nextNode = navigateNodes.get(i + 1);
                 JSONObject nextValueObject = JSON.parseObject(nextNode.getNodeValue());
                 nextStationId = nextValueObject.getInteger("stationId");
                 nextStationDeviceNo = nextValueObject.getInteger("deviceNo");
@@ -351,6 +353,10 @@
                     continue;
                 }
                 lastStationId = currentStationId;
+
+                if (nextNode.getIsInflectionPoint()) {
+                    sleep(4000);
+                }
             }
 
             i++;
@@ -553,8 +559,10 @@
                 return false;
             }
 
+            Random random = new Random();
+
             String barcodeTime = String.valueOf(System.currentTimeMillis());
-            String barcode = barcodeTime.substring(5);
+            String barcode = String.valueOf(random.nextInt(10)) + String.valueOf(random.nextInt(10)) + barcodeTime.substring(7);
 
             boolean result = updateStationData(lockTaskNo, currentStationId, currentStationDeviceNo, null, null, null, barcode, null);
             if (!result) {
@@ -614,7 +622,7 @@
         return executeResult;
     }
 
-    public synchronized boolean lockExecute(Integer taskNo, Supplier<Boolean> function) {
+    public boolean lockExecute(Integer taskNo, Supplier<Boolean> function) {
         if (!setLockStation(taskNo)) {
             return false;
         }
@@ -624,7 +632,7 @@
         return result;
     }
 
-    private synchronized boolean checkTaskNoInArea(Integer taskNo) {
+    private boolean checkTaskNoInArea(Integer taskNo) {
         Object fakeTaskNoAreaObj = redisUtil.get(RedisKeyType.FAKE_TASK_NO_AREA.key);
         if (fakeTaskNoAreaObj == null) {
             return false;

--
Gitblit v1.9.1