From 5d1aa071ca6f385a8ec9bb2b5135d259f0f225eb Mon Sep 17 00:00:00 2001
From: Junjie <DELL@qq.com>
Date: 星期四, 04 十二月 2025 10:59:45 +0800
Subject: [PATCH] #

---
 src/main/java/com/zy/core/MainProcess.java |   33 +++++++++++++++------------------
 1 files changed, 15 insertions(+), 18 deletions(-)

diff --git a/src/main/java/com/zy/core/MainProcess.java b/src/main/java/com/zy/core/MainProcess.java
index 3dbda62..cd49feb 100644
--- a/src/main/java/com/zy/core/MainProcess.java
+++ b/src/main/java/com/zy/core/MainProcess.java
@@ -1,21 +1,23 @@
 package com.zy.core;
 
+import com.core.common.SpringUtils;
+import com.zy.core.plugin.MainProcessPluginApi;
 import com.zy.core.properties.SystemProperties;
-import lombok.Data;
 import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Value;
 import org.springframework.stereotype.Component;
-
 import javax.annotation.PreDestroy;
 
 /**
  * WCS涓绘祦绋�
- * Created by vincent on 2020/8/6
  */
-@Data
 @Slf4j
 @Component
 public class MainProcess {
 
+    @Value("${mainProcessPlugin}")
+    private String mainProcessPlugin;
+    private MainProcessPluginApi mainProcessPluginApi;
     // 鎵�灞炵嚎绋�
     private Thread thread;
 
@@ -26,25 +28,20 @@
         thread = new Thread(() -> {
             while (!Thread.currentThread().isInterrupted()) {
                 try {
+                    if (mainProcessPluginApi == null) {
+                        String className = mainProcessPlugin.contains(".") ? mainProcessPlugin : "com.zy.core.plugin." + mainProcessPlugin;
+                        Class<? extends MainProcessPluginApi> clazz = Class.forName(className).asSubclass(MainProcessPluginApi.class);
+                        mainProcessPluginApi = SpringUtils.getBean(clazz);
+                    }
+
                     // 绯荤粺杩愯鐘舵�佸垽鏂�
-                    if (SystemProperties.WCS_RUNNING_STATUS.get()) {
+                    if (!SystemProperties.WCS_RUNNING_STATUS.get()) {
                         continue;
                     }
 
-
-
-
-
-
-
-
-
-
-
-
+                    mainProcessPluginApi.run();
                     // 闂撮殧
-                    Thread.sleep(1500);
-                    log.info("WCS 宸ヤ綔涓� .....................");
+                    Thread.sleep(200);
                 } catch (Exception e) {
                     e.printStackTrace();
                 }

--
Gitblit v1.9.1