From 41129ab42a97377418c967dd55c0c2d6e369ad61 Mon Sep 17 00:00:00 2001
From: lsh <lsh@163.com>
Date: 星期一, 03 十一月 2025 13:01:40 +0800
Subject: [PATCH] *

---
 src/main/java/com/zy/core/MainProcess.java |  164 ++++++++++++++++++++++++++++++++++++++++++++----------
 1 files changed, 133 insertions(+), 31 deletions(-)

diff --git a/src/main/java/com/zy/core/MainProcess.java b/src/main/java/com/zy/core/MainProcess.java
index f3a40ba..ec52590 100644
--- a/src/main/java/com/zy/core/MainProcess.java
+++ b/src/main/java/com/zy/core/MainProcess.java
@@ -22,48 +22,150 @@
     private MainServiceImpl mainService;
     // 鎵�灞炵嚎绋�
     private Thread thread;
+    private Thread thread2;
+    private Thread thread3;
+    private Thread thread4;
 
     /**
      * =====>>  寮�濮嬪伐浣�
      */
     public void start(){
-        thread = new Thread(() -> {
-            while (!Thread.currentThread().isInterrupted()) {
-                try {
-
-                    // 闂撮殧
-                    Thread.sleep(1000);
-
-                    // 绯荤粺杩愯鐘舵�佸垽鏂�
-                    if (!SystemProperties.WCS_RUNNING_STATUS.get()) {
-                        continue;
-                    }
-
-                    // 鍏ュ簱  ===>> 鍏ュ簱绔欏埌鍫嗗灈鏈虹珯锛屾牴鎹潯鐮佹壂鎻忕敓鎴愬叆搴撳伐浣滄。
-                    mainService.generateStoreWrkFile(); // 缁勬墭
-                    // 鍑哄簱  ===>>  鍫嗗灈鏈哄嚭搴撶珯鍒板嚭搴撶珯
-                    mainService.crnStnToOutStn();
-                    // 鍏ュ嚭搴�  ===>>  鍫嗗灈鏈哄叆鍑哄簱浣滀笟涓嬪彂
-                    mainService.crnIoExecute();
-                    // 鍏ュ簱  ===>> 鎵ц瀵瑰伐浣滄。鐨勫畬鎴愭搷浣�
-                    mainService.storeFinished();
-
-                    // 鍫嗗灈鏈哄紓甯镐俊鎭褰�
-                    mainService.recCrnErr();
-
-
-
-                } catch (Exception e) {
-                    e.printStackTrace();
-                }
-            }
-        });
+        thread = new Thread(this::crnAndDevRun);
         thread.start();
+
+        thread2 = new Thread(this::crnAndDevOtherRun);
+        thread2.start();
+
+        thread3 = new Thread(this::demoRun);
+        thread3.start();
+
+        thread4 = new Thread(this::demoOpenRun);
+        thread4.start();
+    }
+
+    private void crnAndDevRun() {
+        while (!Thread.currentThread().isInterrupted()) {
+            try {
+                // 闂撮殧
+                Thread.sleep(1000);
+                // 绯荤粺杩愯鐘舵�佸垽鏂�
+                if (!SystemProperties.WCS_RUNNING_STATUS.get()) {
+                    continue;
+                }
+                // 绯荤粺婕旂ず妯″紡杩愯鐘舵�佸垽鏂�
+                if (SystemProperties.WCS_RUNNING_STATUS_DEMO.get()) {
+                    continue;
+                }
+                // 鍏ュ簱  ===>> 鍏ュ簱绔欏埌鍫嗗灈鏈虹珯锛屾牴鎹潯鐮佹壂鎻忕敓鎴愬叆搴撳伐浣滄。
+                mainService.generateStoreWrkFile(); // 缁勬墭
+//                    mainService.generateStoreWrkFileIsEmptyMk(); // 缁勬墭  绌烘墭
+                mainService.generateStoreWrkFileWalk(); // wms鍏ュ簱浠诲姟涓嬪彂
+                // 鍏ュ嚭搴�  ===>>  鍫嗗灈鏈哄叆鍑哄簱浣滀笟涓嬪彂
+                mainService.crnIoExecute();
+                // 鍏ュ簱  ===>> 鎵ц瀵瑰伐浣滄。鐨勫畬鎴愭搷浣�
+                mainService.storeFinished();
+                // 浠诲姟涓嬪彂
+                mainService.taskStart();
+                // 鍑哄簱  ===>>  鍫嗗灈鏈�10鍒嗛挓鏃犱换鍔″垯鍥炲埌婧愮偣
+                mainService.crnStnToOutStnSou();
+            } catch (Exception e) {
+                e.printStackTrace();
+            }
+        }
+    }
+    private void crnAndDevOtherRun() {
+        while (!Thread.currentThread().isInterrupted()) {
+            try {
+                // 闂撮殧
+                Thread.sleep(400);
+                // 绯荤粺杩愯鐘舵�佸垽鏂�
+                if (!SystemProperties.WCS_RUNNING_STATUS.get()) {
+                    continue;
+                }
+                // 绯荤粺婕旂ず妯″紡杩愯鐘舵�佸垽鏂�
+                if (SystemProperties.WCS_RUNNING_STATUS_DEMO.get()) {
+                    continue;
+                }
+                // 鍑哄簱  ===>>  鍫嗗灈鏈哄嚭搴撶珯鍒板嚭搴撶珯
+                mainService.crnStnToOutStn();
+                // 鍫嗗灈鏈哄紓甯镐俊鎭褰�
+                mainService.recCrnErr();
+                // 杈撻�佺嚎寮傚父淇℃伅璁板綍
+//                    mainService.recDevErr();
+                // 鍑哄簱  ===>> 宸ヤ綔妗d俊鎭啓鍏ed鏄剧ず鍣�
+//                    mainService.ledExecute(9);
+                // 鍏朵粬  ===>> LED鏄剧ず鍣ㄥ浣嶏紝鏄剧ず榛樿淇℃伅
+//                    mainService.ledReset(10);
+            } catch (Exception e) {
+                e.printStackTrace();
+            }
+        }
+    }
+
+    private void demoRun() {
+        while (!Thread.currentThread().isInterrupted()) {
+            try {
+                // 闂撮殧
+                Thread.sleep(1000);
+                // 绯荤粺杩愯鐘舵�佸垽鏂�
+                if (!SystemProperties.WCS_RUNNING_STATUS.get()) {
+                    continue;
+                }
+                // 绯荤粺婕旂ず妯″紡杩愯鐘舵�佸垽鏂�
+                if (!SystemProperties.WCS_RUNNING_STATUS_DEMO.get()) {
+                    continue;
+                }
+                // 鍑哄簱  ===>>  鍫嗗灈鏈哄嚭搴撶珯鍒板嚭搴撶珯
+                mainService.crnStnToOutStn();
+                // 鍏ュ嚭搴�  ===>>  鍫嗗灈鏈哄叆鍑哄簱浣滀笟涓嬪彂
+                mainService.crnIoExecute();
+                // 鍏朵粬  ===>> LED鏄剧ず鍣ㄦ樉绀烘椂闂�
+            } catch (Exception e) {
+                e.printStackTrace();
+            }
+        }
+    }
+
+    private void demoOpenRun() {
+        while (!Thread.currentThread().isInterrupted()) {
+            try {
+                // 闂撮殧
+                Thread.sleep(1000);
+                // 绯荤粺婕旂ず妯″紡杩愯鐘舵�佸彉鍖�
+                if (SystemProperties.WCS_RUNNING_STATUS_DEMO.get()) {
+                    if (SystemProperties.WCS_RUNNING_STATUS_DEMO_VALUE == 2){
+
+                    } else if (SystemProperties.WCS_RUNNING_STATUS_DEMO_VALUE == 3){
+
+                    } else if (SystemProperties.WCS_RUNNING_STATUS_DEMO_VALUE == 0){
+
+                    } else if (SystemProperties.WCS_RUNNING_STATUS_DEMO_VALUE == 1){
+
+                    }
+                } else {
+                    if (SystemProperties.WCS_RUNNING_STATUS_DEMO_VALUE == 0){
+
+                    } else if (SystemProperties.WCS_RUNNING_STATUS_DEMO_VALUE == 1){
+
+                    } else if (SystemProperties.WCS_RUNNING_STATUS_DEMO_VALUE == 2){
+
+                    } else if (SystemProperties.WCS_RUNNING_STATUS_DEMO_VALUE == 3){
+
+                    }
+                }
+                // 鍏朵粬  ===>> LED鏄剧ず鍣ㄦ樉绀烘椂闂�
+            } catch (Exception e) {
+                e.printStackTrace();
+            }
+        }
     }
 
     @PreDestroy
     public void shutDown(){
         if (thread != null) thread.interrupt();
+        if (thread2 != null) thread2.interrupt();
+        if (thread3 != null) thread3.interrupt();
+        if (thread4 != null) thread4.interrupt();
     }
 
 }

--
Gitblit v1.9.1