|
@@ -0,0 +1,34 @@
|
|
|
+package com.ruoyi.init;
|
|
|
+
|
|
|
+import com.ruoyi.ams.agv.ndc.AciService;
|
|
|
+import com.ruoyi.ams.agv.ndc.config.TestTagConfig;
|
|
|
+import com.ruoyi.ams.agv.ndc.thread.AutoTaskThread;
|
|
|
+import com.ruoyi.ams.business.IBusinessService;
|
|
|
+import org.springframework.beans.factory.annotation.Autowired;
|
|
|
+import org.springframework.beans.factory.annotation.Value;
|
|
|
+import org.springframework.boot.CommandLineRunner;
|
|
|
+import org.springframework.stereotype.Component;
|
|
|
+
|
|
|
+@Component
|
|
|
+public class StartService implements CommandLineRunner {
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ private IBusinessService businessService;
|
|
|
+ @Autowired
|
|
|
+ private TestTagConfig testTagConfig;
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public void run(String... args) throws Exception {
|
|
|
+ //自动下发任务
|
|
|
+ if (testTagConfig.getAutoSend()) {
|
|
|
+ Thread thread = new Thread(new AutoTaskThread(businessService));
|
|
|
+ thread.start();
|
|
|
+ }
|
|
|
+
|
|
|
+ //ndc下发
|
|
|
+ if (testTagConfig.getAciService()) {
|
|
|
+ AciService aciService = new AciService();
|
|
|
+ aciService.start();
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|