From 1bc0b18a88ed90fa19e0c050d7befecb2a16bb8a Mon Sep 17 00:00:00 2001
From: L <L@132>
Date: 星期五, 10 十月 2025 12:38:27 +0800
Subject: [PATCH] *

---
 src/main/java/com/zy/core/MainProcess.java |   44 +++++++++++++++++++++++++++++++++-----------
 1 files changed, 33 insertions(+), 11 deletions(-)

diff --git a/src/main/java/com/zy/core/MainProcess.java b/src/main/java/com/zy/core/MainProcess.java
index 4034c7e..5770eec 100644
--- a/src/main/java/com/zy/core/MainProcess.java
+++ b/src/main/java/com/zy/core/MainProcess.java
@@ -5,11 +5,9 @@
 import lombok.Data;
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.beans.factory.annotation.Value;
 import org.springframework.stereotype.Component;
 
 import javax.annotation.PreDestroy;
-import java.util.ArrayList;
 
 /**
  * WCS涓绘祦绋�
@@ -24,11 +22,8 @@
     private MainServiceImpl mainService;
     // 鎵�灞炵嚎绋�
     private Thread thread;
+    private Thread threadVerify;
     // 棰戠巼
-    private int i = 0;
-    private int j = 0;
-    private int k = 0;
-    private int l = 0;
     private int[] autoZ = new int[]{0,0,0,0,0,0,0};
 
     /**
@@ -53,20 +48,18 @@
                     Thread.sleep(200);
 
                     // 绯荤粺杩愯鐘舵�佸垽鏂�
-                    if (SystemProperties.WCS_RUNNING_STATUS.get()) {
+                    if (!SystemProperties.WCS_RUNNING_STATUS.get()) {
                         continue;
                     }
 
-                    //鏇存柊浣嶇疆淇℃伅
-                    mainService.updateStePositionNearby();
                     //鏇存柊浣嶇疆淇℃伅
                     mainService.updateStePosition();
                     // 浠诲姟涓嬪彂
                     mainService.DevpTaskNoRun();
                     // 浠诲姟瀹屾垚
                     mainService.rgvCompleteWrkMastSta(autoZ);
-                    //鏇存柊浣嶇疆淇℃伅
-                    mainService.updateStePosition();
+                    // 浠诲姟鍙栨秷
+                    mainService.rgvCancelWrkMastSta();
 
                 } catch (Exception e) {
                     e.printStackTrace();
@@ -74,11 +67,40 @@
             }
         });
         thread.start();
+        threadVerify = new Thread(() -> {
+            while (!Thread.currentThread().isInterrupted()) {
+                try {
+                    // 闂撮殧
+                    Thread.sleep(60000);
+
+                    // 绯荤粺杩愯鐘舵�佸垽鏂�
+                    if (!SystemProperties.WCS_RUNNING_STATUS.get()) {
+                        continue;
+                    }
+
+                    try{
+                        log.info("++++++++ 寮�濮嬮獙璇佽鍙瘉 ++++++++");
+                        if (!mainService.licenseVerify()){
+                            SystemProperties.WCS_RUNNING_STATUS.set(Boolean.FALSE);
+                            log.info("++++++++ 楠岃瘉璁稿彲璇佸け璐� ++++++++");
+                        } else {
+                            SystemProperties.WCS_RUNNING_STATUS.set(Boolean.TRUE);
+                            log.info("++++++++ 楠岃瘉璁稿彲璇佹垚鍔� ++++++++");
+                        }
+                    } catch (Exception e) {}
+
+                } catch (Exception e) {
+                    e.printStackTrace();
+                }
+            }
+        });
+        threadVerify.start();
     }
 
     @PreDestroy
     public void shutDown(){
         if (thread != null) thread.interrupt();
+        if (threadVerify != null) threadVerify.interrupt();
     }
 
 }

--
Gitblit v1.9.1