From 9bd96eb8f9e11fa3ca024b82c718b104a1545f25 Mon Sep 17 00:00:00 2001
From: L <L@132>
Date: 星期三, 22 四月 2026 16:56:20 +0800
Subject: [PATCH] *

---
 src/main/java/com/zy/asrs/controller/ConsoleController.java |   46 ++++++++++++++++++++++++++++++----------------
 1 files changed, 30 insertions(+), 16 deletions(-)

diff --git a/src/main/java/com/zy/asrs/controller/ConsoleController.java b/src/main/java/com/zy/asrs/controller/ConsoleController.java
index 193a110..859fd29 100644
--- a/src/main/java/com/zy/asrs/controller/ConsoleController.java
+++ b/src/main/java/com/zy/asrs/controller/ConsoleController.java
@@ -26,6 +26,7 @@
 import com.zy.core.properties.SlaveProperties;
 import com.zy.core.properties.SystemProperties;
 import com.zy.core.thread.*;
+import com.zy.system.entity.license.LicenseVerify;
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.*;
@@ -49,28 +50,41 @@
     private BasDevpService basDevpService;
 
     @PostMapping("/system/running/status")
-    @ManagerAuth(memo = "绯荤粺杩愯鐘舵��")
+//    @ManagerAuth(memo = "绯荤粺杩愯鐘舵��")
     public R systemRunningStatus(){
         return R.ok().add(Cools.add("status", SystemProperties.WCS_RUNNING_STATUS.get()));
     }
 
     @PostMapping("/system/switch")
-    @ManagerAuth(memo = "绯荤粺杩愯寮�鍏虫搷浣�")
+//    @ManagerAuth(memo = "绯荤粺杩愯寮�鍏虫搷浣�")
     public R systemSwitch(SystemSwitchParam param) throws InterruptedException {
-        if (Cools.isEmpty(param.getOperatorType())){
+//        if (Cools.isEmpty(param.getOperatorType())){
+//            return R.error();
+//        }
+//        if (param.getOperatorType() == 0) {
+//            if (Cools.isEmpty(param.getPassword())){
+//                return R.error("璇疯緭鍏ュ彛浠�");
+//            }
+//            if (!param.getPassword().equals(SystemProperties.WCS_PASSWORD)){
+//                return R.error("鍙d护閿欒");
+//            }
+//        }
+//        Thread.sleep(200L);
+        //楠岃瘉璁稿彲璇佹槸鍚︽湁鏁�
+        try{
+            boolean systemSign = SystemProperties.WCS_RUNNING_STATUS.get();
+            if (!systemSign){
+                if (new LicenseVerify().verify()){
+                    SystemProperties.WCS_RUNNING_STATUS.set(Boolean.TRUE);
+                    return R.ok();
+                }
+            }
+        } catch (Exception e){
+            log.error("璁稿彲璇侀獙璇佸け璐ワ紒锛佸紓甯革細{}",e.getMessage());
             return R.error();
         }
-        if (param.getOperatorType() == 0) {
-            if (Cools.isEmpty(param.getPassword())){
-                return R.error("璇疯緭鍏ュ彛浠�");
-            }
-            if (!param.getPassword().equals(SystemProperties.WCS_PASSWORD)){
-                return R.error("鍙d护閿欒");
-            }
-        }
-        Thread.sleep(200L);
-        SystemProperties.WCS_RUNNING_STATUS.set(param.getOperatorType()==1?Boolean.TRUE:Boolean.FALSE);
-        return R.ok().add(Cools.add("status", SystemProperties.WCS_RUNNING_STATUS.get()));
+        SystemProperties.WCS_RUNNING_STATUS.set(Boolean.FALSE);
+        return R.ok();
     }
 
     /****************************************************************/
@@ -166,7 +180,7 @@
             if (null != devpThread) {
                 StaProtocol staProtocol = devpThread.getStation().get(siteId);
                 if (staProtocol != null) {
-                    BasDevp basDevp = basDevpService.selectById(siteId);
+                    BasDevp basDevp = basDevpService.getById(siteId);
                     if (basDevp == null) {
                         return R.error("鏁版嵁搴撶淮鎶ゅ紓甯�");
                     }
@@ -174,7 +188,7 @@
                     vo.setWorkNo(staProtocol.getWorkNo());   // 宸ヤ綔鍙�
 
                     if (staProtocol.getWorkNo() > 0) {
-                        WrkMast wrkMast = wrkMastService.selectById(staProtocol.getWorkNo());
+                        WrkMast wrkMast = wrkMastService.getById(staProtocol.getWorkNo());
                         if (wrkMast != null) {
                             vo.setWrkSts(wrkMast.getWrkSts$());   // 宸ヤ綔鐘舵��
                             vo.setIoType(wrkMast.getIoType$());   //  鍏ュ嚭搴撶被鍨�

--
Gitblit v1.9.1