StartService.java 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. package com.ruoyi.init;
  2. import com.ruoyi.ams.agv.ndc.AciService;
  3. import com.ruoyi.ams.agv.ndc.config.InitTaskConfig;
  4. import com.ruoyi.ams.agv.ndc.thread.*;
  5. import com.ruoyi.ams.business.IBusinessService;
  6. import com.ruoyi.base.service.IBaseLocationInfoService;
  7. import lombok.extern.slf4j.Slf4j;
  8. import org.springframework.beans.factory.annotation.Autowired;
  9. import org.springframework.boot.CommandLineRunner;
  10. import org.springframework.stereotype.Component;
  11. @Slf4j
  12. @Component
  13. public class StartService implements CommandLineRunner {
  14. @Autowired
  15. private IBusinessService businessService;
  16. @Autowired
  17. private InitTaskConfig initTaskConfig;
  18. @Autowired
  19. private AciService aciService;
  20. @Autowired
  21. private IBaseLocationInfoService baseLocationInfoService;
  22. @Autowired
  23. private AutoButtonBoxTask autoButtonBoxTask;
  24. @Autowired
  25. private AutoButtonBoxTask01 autoButtonBoxTask01;
  26. @Autowired
  27. private AutoButtonBoxTask02 autoButtonBoxTask02;
  28. @Autowired
  29. private AutoButtonBoxTask03 autoButtonBoxTask03;
  30. @Autowired
  31. private AutoPhotoelectricTask autoPhotoelectricTask;
  32. @Override
  33. public void run(String... args) throws Exception {
  34. //自动下发任务
  35. if (initTaskConfig.getAutoSend()) {
  36. Thread thread = new Thread(new AutoTaskThread(businessService));
  37. thread.start();
  38. }
  39. //ndc下发
  40. if (initTaskConfig.getAciService()) {
  41. Thread thread = new Thread(new AciServiceThread(aciService));
  42. thread.start();
  43. }
  44. }
  45. /**
  46. * 自动按钮盒监控任务 - 裹膜区 -> 仓储区
  47. */
  48. public void autoButtonBoxTask() {
  49. autoButtonBoxTask.run();
  50. }
  51. /**
  52. * 自动按钮盒监控任务 - 氯化镍废料口
  53. */
  54. public void autoButtonBoxTask01() {
  55. autoButtonBoxTask01.run();
  56. }
  57. /**
  58. * 自动按钮盒监控任务 - 硫酸镍废料口退空
  59. */
  60. public void autoButtonBoxTask02() {
  61. autoButtonBoxTask02.run();
  62. }
  63. /**
  64. * 自动按钮盒监控任务 - 硫酸镍废料口
  65. */
  66. public void autoButtonBoxTask03() {
  67. autoButtonBoxTask03.run();
  68. }
  69. /**
  70. * 光电监控任务 - 空托1
  71. */
  72. public void autoPhotoelectricTask01() {
  73. autoPhotoelectricTask.run();
  74. }
  75. /**
  76. * 光电监控任务 - 空托2
  77. */
  78. public void autoPhotoelectricTask02() {
  79. autoPhotoelectricTask.run01();
  80. }
  81. /**
  82. * 光电监控任务 - 空托3
  83. */
  84. public void autoPhotoelectricTask03() {
  85. autoPhotoelectricTask.run02();
  86. }
  87. }