WareWmsTask.java 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. package com.warewms.job.task;
  2. import com.warewms.service.HeXunDataService;
  3. import com.warewms.service.MachAlarmRecordsService;
  4. import lombok.extern.slf4j.Slf4j;
  5. import org.springframework.beans.factory.annotation.Autowired;
  6. import org.springframework.stereotype.Component;
  7. /**
  8. * WMS定时任务
  9. *
  10. * testTask为spring bean的名称
  11. *
  12. * @author Mark sunlightcs@gmail.com
  13. * @since 1.2.0 2016-11-28
  14. */
  15. @Slf4j
  16. @Component("wareWmsTask")
  17. public class WareWmsTask {
  18. @Autowired
  19. private HeXunDataService heXunDataService;
  20. @Autowired
  21. private MachAlarmRecordsService machAlarmRecordsService;
  22. /**
  23. * 定时回传报警信息
  24. */
  25. public void exec(){
  26. machAlarmRecordsService.saveUnrecordedAlarm4MachineOne();
  27. machAlarmRecordsService.saveUnrecordedAlarm4MachineTwo();
  28. heXunDataService.uploadAlarmData();
  29. }
  30. /**
  31. * 定时回传检测点信息
  32. */
  33. public void uploadPointData() {
  34. log.info("------------------回传检测点信息------------------");
  35. heXunDataService.uploadPointOneData();
  36. heXunDataService.uploadPointTwoData();
  37. }
  38. /**
  39. * 定时回传机器人信息
  40. */
  41. public void uploadRobotData() {
  42. log.info("------------------回传机器人信息------------------");
  43. heXunDataService.uploadRobotOneData();
  44. heXunDataService.uploadRobotTwoData();
  45. }
  46. }