From 41e4860f065a13b00441deff45455b62d3787e2c Mon Sep 17 00:00:00 2001
From: lsh <lsh@163.com>
Date: 星期三, 22 十月 2025 13:39:13 +0800
Subject: [PATCH] *
---
src/main/java/com/zy/asrs/controller/ConsoleController.java | 5 +-
src/main/webapp/views/index.html | 4 +
src/main/java/com/zy/core/MainProcess.java | 16 +++++++-
src/main/java/com/zy/core/ServerBootstrap.java | 64 ++++++++++++++++----------------
4 files changed, 52 insertions(+), 37 deletions(-)
diff --git a/src/main/java/com/zy/asrs/controller/ConsoleController.java b/src/main/java/com/zy/asrs/controller/ConsoleController.java
index 7526faa..c3f9caa 100644
--- a/src/main/java/com/zy/asrs/controller/ConsoleController.java
+++ b/src/main/java/com/zy/asrs/controller/ConsoleController.java
@@ -76,14 +76,15 @@
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()));
+ return R.ok();
}
}
} catch (Exception e){
log.error("璁稿彲璇侀獙璇佸け璐ワ紒锛佸紓甯革細{}",e.getMessage());
+ return R.error();
}
SystemProperties.WCS_RUNNING_STATUS.set(Boolean.FALSE);
- return R.ok().add(Cools.add("status", SystemProperties.WCS_RUNNING_STATUS.get()));
+ return R.ok();
}
/****************************************************************/
diff --git a/src/main/java/com/zy/core/MainProcess.java b/src/main/java/com/zy/core/MainProcess.java
index fe79a52..52f4ba6 100644
--- a/src/main/java/com/zy/core/MainProcess.java
+++ b/src/main/java/com/zy/core/MainProcess.java
@@ -74,13 +74,25 @@
}
private void licenseThreadRun(){
+ int i = 0;
while (true) {
try{
Thread.sleep(60*60*1000L);
+
+ // 绯荤粺杩愯鐘舵�佸垽鏂�
+ if (!SystemProperties.WCS_RUNNING_STATUS.get()) {
+ continue;
+ }
+
log.info("++++++++ 寮�濮嬮獙璇佽鍙瘉 ++++++++");
if (!mainService.licenseVerify()){
- SystemProperties.WCS_RUNNING_STATUS.set(Boolean.FALSE);
- log.info("++++++++ 楠岃瘉璁稿彲璇佸け璐� ++++++++");
+ if (i>6){
+ SystemProperties.WCS_RUNNING_STATUS.set(Boolean.FALSE);
+ log.info("++++++++ 楠岃瘉璁稿彲璇佸け璐� ++++++++");
+ i = 0;
+ } else {
+ i++;
+ }
} else {
// SystemProperties.WCS_RUNNING_STATUS.set(Boolean.TRUE);
log.info("++++++++ 楠岃瘉璁稿彲璇佹垚鍔� ++++++++");
diff --git a/src/main/java/com/zy/core/ServerBootstrap.java b/src/main/java/com/zy/core/ServerBootstrap.java
index 28352cb..eb45f98 100644
--- a/src/main/java/com/zy/core/ServerBootstrap.java
+++ b/src/main/java/com/zy/core/ServerBootstrap.java
@@ -132,36 +132,36 @@
public void destroy() {
}
- @Component
- class licenseVerifyThread {
-
- @Scheduled(cron = "0 0 4 * * ?")
- public void licenseVerify() {
- int licenseVerifySignCount = 0;
- boolean licenseVerifySign = false;
- boolean systemSign = SystemProperties.WCS_RUNNING_STATUS.get();
- if (!new LicenseVerify().verify()){
- for (licenseVerifySignCount = 0;!licenseVerifySign && licenseVerifySignCount<10; licenseVerifySignCount++){
- try{
- Thread.sleep(1000);
- }catch (Exception e){
-
- }
- if (!new LicenseVerify().verify()){
- log.info("++++++++ 楠岃瘉璁稿彲璇佸け璐� ++++++++");
- } else {
- log.info("++++++++ 楠岃瘉璁稿彲璇佹垚鍔� ++++++++");
- licenseVerifySign = true;
- }
- }
- if (licenseVerifySignCount>10 && !licenseVerifySign){
- SystemProperties.WCS_RUNNING_STATUS.set(Boolean.FALSE);
- } else {
- if (systemSign){
- SystemProperties.WCS_RUNNING_STATUS.set(Boolean.TRUE);
- }
- }
- }
- }
- }
+// @Component
+// class licenseVerifyThread {
+//
+// @Scheduled(cron = "0 0 4 * * ?")
+// public void licenseVerify() {
+// int licenseVerifySignCount = 0;
+// boolean licenseVerifySign = false;
+// boolean systemSign = SystemProperties.WCS_RUNNING_STATUS.get();
+// if (!new LicenseVerify().verify()){
+// for (licenseVerifySignCount = 0;!licenseVerifySign && licenseVerifySignCount<10; licenseVerifySignCount++){
+// try{
+// Thread.sleep(1000);
+// }catch (Exception e){
+//
+// }
+// if (!new LicenseVerify().verify()){
+// log.info("++++++++ 楠岃瘉璁稿彲璇佸け璐� ++++++++");
+// } else {
+// log.info("++++++++ 楠岃瘉璁稿彲璇佹垚鍔� ++++++++");
+// licenseVerifySign = true;
+// }
+// }
+// if (licenseVerifySignCount>10 && !licenseVerifySign){
+// SystemProperties.WCS_RUNNING_STATUS.set(Boolean.FALSE);
+// } else {
+// if (systemSign){
+// SystemProperties.WCS_RUNNING_STATUS.set(Boolean.TRUE);
+// }
+// }
+// }
+// }
+// }
}
diff --git a/src/main/webapp/views/index.html b/src/main/webapp/views/index.html
index 3d77949..f98cbf7 100644
--- a/src/main/webapp/views/index.html
+++ b/src/main/webapp/views/index.html
@@ -636,7 +636,9 @@
method: 'POST',
success: function (res) {
if (res.code === 200) {
- that.valueSystem = res.data.status;
+ that.$message.success(`鐘舵�佹洿鏂版垚鍔焋);
+ } else {
+ that.$message.error('鐘舵�佹洿鏂板け璐�');
}
}
});
--
Gitblit v1.9.1