12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394 |
- package com.ruoyi.init;
- import com.ruoyi.ams.agv.ndc.AciService;
- import com.ruoyi.ams.agv.ndc.config.InitTaskConfig;
- import com.ruoyi.ams.agv.ndc.thread.*;
- import com.ruoyi.ams.business.IBusinessService;
- import com.ruoyi.base.service.IBaseLocationInfoService;
- import lombok.extern.slf4j.Slf4j;
- import org.springframework.beans.factory.annotation.Autowired;
- import org.springframework.boot.CommandLineRunner;
- import org.springframework.stereotype.Component;
- @Slf4j
- @Component
- public class StartService implements CommandLineRunner {
- @Autowired
- private IBusinessService businessService;
- @Autowired
- private InitTaskConfig initTaskConfig;
- @Autowired
- private AciService aciService;
- @Autowired
- private IBaseLocationInfoService baseLocationInfoService;
- @Autowired
- private AutoButtonBoxTask autoButtonBoxTask;
- @Autowired
- private AutoButtonBoxTask01 autoButtonBoxTask01;
- @Autowired
- private AutoButtonBoxTask02 autoButtonBoxTask02;
- @Autowired
- private AutoButtonBoxTask03 autoButtonBoxTask03;
- @Autowired
- private AutoPhotoelectricTask autoPhotoelectricTask;
- @Override
- public void run(String... args) throws Exception {
- //自动下发任务
- if (initTaskConfig.getAutoSend()) {
- Thread thread = new Thread(new AutoTaskThread(businessService));
- thread.start();
- }
- //ndc下发
- if (initTaskConfig.getAciService()) {
- Thread thread = new Thread(new AciServiceThread(aciService));
- thread.start();
- }
- }
- /**
- * 自动按钮盒监控任务 - 裹膜区 -> 仓储区
- */
- public void autoButtonBoxTask() {
- autoButtonBoxTask.run();
- }
- /**
- * 自动按钮盒监控任务 - 氯化镍废料口
- */
- public void autoButtonBoxTask01() {
- autoButtonBoxTask01.run();
- }
- /**
- * 自动按钮盒监控任务 - 硫酸镍废料口退空
- */
- public void autoButtonBoxTask02() {
- autoButtonBoxTask02.run();
- }
- /**
- * 自动按钮盒监控任务 - 硫酸镍废料口
- */
- public void autoButtonBoxTask03() {
- autoButtonBoxTask03.run();
- }
- /**
- * 光电监控任务 - 空托1
- */
- public void autoPhotoelectricTask01() {
- autoPhotoelectricTask.run();
- }
- /**
- * 光电监控任务 - 空托2
- */
- public void autoPhotoelectricTask02() {
- autoPhotoelectricTask.run01();
- }
- /**
- * 光电监控任务 - 空托3
- */
- public void autoPhotoelectricTask03() {
- autoPhotoelectricTask.run02();
- }
- }
|