From e108f8a8d4e8a0b97371c39df63268c1fd850bd9 Mon Sep 17 00:00:00 2001
From: zhangc <zc@123>
Date: 星期二, 11 三月 2025 13:57:39 +0800
Subject: [PATCH] 配置信息
---
src/main/java/com/zy/core/CPMainProcess.java | 89 ++++++++++++++++++++++++++++++++++++++++++++
src/main/java/com/zy/core/MainProcess.java | 22 ++---------
src/main/java/com/zy/core/ServerBootstrap.java | 3 +
3 files changed, 96 insertions(+), 18 deletions(-)
diff --git a/src/main/java/com/zy/core/CPMainProcess.java b/src/main/java/com/zy/core/CPMainProcess.java
new file mode 100644
index 0000000..14b4e62
--- /dev/null
+++ b/src/main/java/com/zy/core/CPMainProcess.java
@@ -0,0 +1,89 @@
+package com.zy.core;
+
+import com.zy.asrs.service.impl.MainServiceImpl;
+import com.zy.core.properties.SystemProperties;
+import lombok.Data;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+
+import javax.annotation.PreDestroy;
+
+/**
+ * WCS涓绘祦绋�
+ * Created by vincent on 2020/8/6
+ */
+@Data
+@Slf4j
+@Component
+public class CPMainProcess {
+
+ @Autowired
+ private MainServiceImpl mainService;
+ // 鎵�灞炵嚎绋�
+ private Thread thread;
+ // 棰戠巼
+ private int i = 0;
+
+ /**
+ * =====>> 寮�濮嬪伐浣�
+ */
+ public void start(){
+ thread = new Thread(() -> {
+ while (!Thread.currentThread().isInterrupted()) {
+ try {
+
+ // 闂撮殧
+ Thread.sleep(1000);
+
+ // 绯荤粺杩愯鐘舵�佸垽鏂�
+ if (!SystemProperties.WCS_RUNNING_STATUS.get()) {
+ continue;
+ }
+
+ // 婕旂ず
+// mainService.crnDemoOfLocMove1();
+ // 鍏ュ簱 ===>> 鍏ュ簱绔欏埌鍫嗗灈鏈虹珯锛屾牴鎹潯鐮佹壂鎻忕敓鎴愬叆搴撳伐浣滄。
+ mainService.generateStoreWrkFile1(); // 缁勬墭
+ // 鍑哄簱 ===>> 鍫嗗灈鏈哄嚭搴撶珯鍒板嚭搴撶珯
+ mainService.crnStnToOutStn();
+ // 鍏ュ嚭搴� ===>> 鍫嗗灈鏈哄叆鍑哄簱浣滀笟涓嬪彂
+ mainService.crnIoExecute();
+ // 鍏ュ簱 ===>> 鎵ц瀵瑰伐浣滄。鐨勫畬鎴愭搷浣�
+ mainService.storeFinished();
+
+ // 鍫嗗灈鏈哄紓甯镐俊鎭褰�
+ mainService.recCrnErr();
+ // 鍏ュ簱 ===>> 绌烘爤鏉垮垵濮嬪寲鍏ュ簱,鍙夎溅鍏ュ簱绔欐斁璐�
+// mainService.storeEmptyPlt();
+
+// mainService.outOfDevp();
+
+ // 鍏朵粬 ===>> // 鍏ュ嚭搴撴ā寮忓垏鎹㈠嚱鏁�
+ i++;
+ if (i > 1) {
+// mainService.ioConvert();
+ i = 0;
+ }
+
+ //鑷姩娲惧彂浠诲姟
+ // mainService.autoDistribute();
+ //鑷姩瀹屾垚浠诲姟
+// mainService.autoCompleteTask();
+ //agv鍙栨斁璐у畬鎴�
+// mainService.autoCompleteAGV();
+
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ }
+ });
+ thread.start();
+ }
+
+ @PreDestroy
+ public void shutDown(){
+ if (thread != null) thread.interrupt();
+ }
+
+}
diff --git a/src/main/java/com/zy/core/MainProcess.java b/src/main/java/com/zy/core/MainProcess.java
index 91070ff..80eaae5 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涓绘祦绋�
@@ -30,11 +28,10 @@
/**
* =====>> 寮�濮嬪伐浣�
*/
- public void start(){
+ public void start() {
thread = new Thread(() -> {
while (!Thread.currentThread().isInterrupted()) {
try {
-
// 闂撮殧
Thread.sleep(1000);
@@ -43,8 +40,7 @@
continue;
}
- // 婕旂ず
-// mainService.crnDemoOfLocMove1();
+
// 鍏ュ簱 ===>> 鍏ュ簱绔欏埌鍫嗗灈鏈虹珯锛屾牴鎹潯鐮佹壂鎻忕敓鎴愬叆搴撳伐浣滄。
mainService.generateStoreWrkFile1(); // 缁勬墭
// 鍑哄簱 ===>> 鍫嗗灈鏈哄嚭搴撶珯鍒板嚭搴撶珯
@@ -56,24 +52,14 @@
// 鍫嗗灈鏈哄紓甯镐俊鎭褰�
mainService.recCrnErr();
- // 鍏ュ簱 ===>> 绌烘爤鏉垮垵濮嬪寲鍏ュ簱,鍙夎溅鍏ュ簱绔欐斁璐�
-// mainService.storeEmptyPlt();
-
-// mainService.outOfDevp();
// 鍏朵粬 ===>> // 鍏ュ嚭搴撴ā寮忓垏鎹㈠嚱鏁�
i++;
if (i > 1) {
-// mainService.ioConvert();
+ //mainService.ioConvert();
i = 0;
}
- //鑷姩娲惧彂浠诲姟
- // mainService.autoDistribute();
- //鑷姩瀹屾垚浠诲姟
-// mainService.autoCompleteTask();
- //agv鍙栨斁璐у畬鎴�
-// mainService.autoCompleteAGV();
} catch (Exception e) {
e.printStackTrace();
@@ -84,7 +70,7 @@
}
@PreDestroy
- public void shutDown(){
+ public void shutDown() {
if (thread != null) thread.interrupt();
}
diff --git a/src/main/java/com/zy/core/ServerBootstrap.java b/src/main/java/com/zy/core/ServerBootstrap.java
index a97d9a0..864647e 100644
--- a/src/main/java/com/zy/core/ServerBootstrap.java
+++ b/src/main/java/com/zy/core/ServerBootstrap.java
@@ -27,6 +27,8 @@
private SlaveProperties slaveProperties;
@Autowired
private MainProcess mainProcess;
+ @Autowired
+ private CPMainProcess cpMainProcess;
/**
* PostConstruct浼氬湪鍔犺浇servlet鐨勬椂鍊欒繍琛屼竴娆�
@@ -43,6 +45,7 @@
initThread();
// 寮�濮嬩富娴佺▼杩涚▼
mainProcess.start();
+ cpMainProcess.start();
log.info("鏍稿績鎺у埗灞傚凡鍚姩...............................................");
}
--
Gitblit v1.9.1