From 87b052cbd5bb44bf90ac4e9c4aeaf1cdcf5acf63 Mon Sep 17 00:00:00 2001
From: cpT <1@123>
Date: 星期日, 22 六月 2025 15:30:44 +0800
Subject: [PATCH] #改造
---
src/main/java/com/zy/asrs/controller/ConsoleController.java | 44 ++++++++++++++++++++++++++------------------
1 files changed, 26 insertions(+), 18 deletions(-)
diff --git a/src/main/java/com/zy/asrs/controller/ConsoleController.java b/src/main/java/com/zy/asrs/controller/ConsoleController.java
index 3aef99c..7526faa 100644
--- a/src/main/java/com/zy/asrs/controller/ConsoleController.java
+++ b/src/main/java/com/zy/asrs/controller/ConsoleController.java
@@ -12,7 +12,6 @@
import com.zy.asrs.domain.vo.*;
import com.zy.asrs.entity.BasDevp;
import com.zy.asrs.entity.WrkMast;
-import com.zy.asrs.mapper.LocMastMapper;
import com.zy.asrs.service.BasDevpService;
import com.zy.asrs.service.WrkMastService;
import com.zy.common.CodeRes;
@@ -27,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.*;
@@ -48,31 +48,41 @@
private WrkMastService wrkMastService;
@Autowired
private BasDevpService basDevpService;
- @Autowired
- private LocMastMapper locMastMapper;
@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())){
- return R.error();
- }
- if (param.getOperatorType() == 0) {
- if (Cools.isEmpty(param.getPassword())){
- return R.error("璇疯緭鍏ュ彛浠�");
+// 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().add(Cools.add("status", SystemProperties.WCS_RUNNING_STATUS.get()));
+ }
}
- if (!param.getPassword().equals(SystemProperties.WCS_PASSWORD)){
- return R.error("鍙d护閿欒");
- }
+ } catch (Exception e){
+ log.error("璁稿彲璇侀獙璇佸け璐ワ紒锛佸紓甯革細{}",e.getMessage());
}
- Thread.sleep(200L);
- SystemProperties.WCS_RUNNING_STATUS.set(param.getOperatorType()==1?Boolean.TRUE:Boolean.FALSE);
+ SystemProperties.WCS_RUNNING_STATUS.set(Boolean.FALSE);
return R.ok().add(Cools.add("status", SystemProperties.WCS_RUNNING_STATUS.get()));
}
@@ -183,8 +193,6 @@
vo.setIoType(wrkMast.getIoType$()); // 鍏ュ嚭搴撶被鍨�
vo.setSourceStaNo(wrkMast.getSourceStaNo$());
vo.setStaNo(wrkMast.getStaNo$());
- vo.setSourceLocNo(wrkMast.getSourceLocNo$());
- vo.setLocNo(wrkMast.getLocNo$());
}
}
--
Gitblit v1.9.1