TsbWithdrawTask.java 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138
  1. package com.style24.batch.biz.task;
  2. import org.springframework.beans.factory.annotation.Autowired;
  3. import org.springframework.scheduling.annotation.Async;
  4. import org.springframework.scheduling.annotation.Scheduled;
  5. import org.springframework.stereotype.Component;
  6. import com.style24.batch.biz.job.delivery.TsbCjWithdrawInvoiceJob;
  7. import com.style24.batch.biz.job.delivery.TsbCjWithdrawInvoiceStatJob;
  8. import com.style24.batch.biz.job.delivery.TsbWithdrawExcRcvJob;
  9. import com.style24.batch.biz.job.delivery.TsbWithdrawExcRsltJob;
  10. import com.style24.batch.biz.job.delivery.TsbWithdrawRequestJob;
  11. import com.style24.batch.biz.job.delivery.TsbWithdrawRsltJob;
  12. import lombok.extern.slf4j.Slf4j;
  13. /**
  14. * 회수 Task
  15. * @author moon
  16. * @since 2020. 12. 08
  17. */
  18. @Component
  19. @Slf4j
  20. public class TsbWithdrawTask {
  21. @Autowired
  22. private TsbWithdrawExcRcvJob withdrawExcRcvJob;
  23. @Autowired
  24. private TsbWithdrawExcRsltJob withdrawExcRsltJob;
  25. @Autowired
  26. private TsbWithdrawRsltJob withdrawRsltJob;
  27. @Autowired
  28. private TsbWithdrawRequestJob tsbWithdrawRequestJob;
  29. @Autowired
  30. private TsbCjWithdrawInvoiceJob tsbCjWithdrawInvoiceJob;
  31. @Autowired
  32. private TsbCjWithdrawInvoiceStatJob tsbCjWithdrawInvoiceStatJob;
  33. /**
  34. * 초 분 시 일 월 주(년)
  35. * 0 0 12 * * ?" : 아무 요일, 매월, 매일 12:00:00
  36. * 0 15 10 ? * *" : 모든 요일, 매월, 아무 날이나 10:15:00
  37. * 0 15 10 * * ?" : 아무 요일, 매월, 매일 10:15:00
  38. * 0 15 10 * * ? *" : 모든 연도, 아무 요일, 매월, 매일 10:15
  39. * 0 15 10 * * ? : 2005" 2005년 아무 요일이나 매월, 매일 10:15
  40. * 0 * 14 * * ?" : 아무 요일, 매월, 매일, 14시 매분 0초
  41. * 0 0/5 14 * * ?" : 아무 요일, 매월, 매일, 14시 매 5분마다 0초
  42. * 0 0/5 14,18 * * ?" : 아무 요일, 매월, 매일, 14시, 18시 매 5분마다 0초
  43. * 0 0-5 14 * * ?" : 아무 요일, 매월, 매일, 14:00 부터 매 14:05까지 매 분 0초
  44. * 0 10,44 14 ? 3 WED" : 3월의 매 주 수요일, 아무 날짜나 14:10:00, 14:44:00
  45. * 0 15 10 ? * MON-FRI" : 월~금, 매월, 아무 날이나 10:15:00
  46. * 0 15 10 15 * ?" : 아무 요일, 매월 15일 10:15:00
  47. * 0 15 10 L * ?" : 아무 요일, 매월 마지막 날 10:15:00
  48. * 0 15 10 ? * 6L" : 매월 마지막 금요일 아무 날이나 10:15:00
  49. * 0 15 10 ? * 6L 2002-2005" : 2002년부터 2005년까지 매월 마지막 금요일 아무 날이나 10:15:00
  50. * 0 15 10 ? * 6#3" : 매월 3번째 금요일 아무 날이나 10:15:00
  51. *
  52. * @throws Exception
  53. */
  54. /**
  55. * WMS 회수요청
  56. *
  57. * @throws Exception
  58. */
  59. @Scheduled(cron = "${cron.withdraw.wms.request}")
  60. @Scheduled(fixedDelay = 3500000)
  61. @Async
  62. public void withdrawWmsRequestJob() throws Exception {
  63. tsbWithdrawRequestJob.runById("cron.withdraw.wms.request");
  64. }
  65. /**
  66. * WMS 회수입고예외 수신
  67. *
  68. * @throws Exception
  69. */
  70. @Scheduled(cron = "${cron.withdraw.wms.ingoing.exception.receive}")
  71. //@Scheduled(fixedDelay = 3500000)
  72. @Async
  73. public void withdrawWmsIngoingExceptionReceiveJob() throws Exception {
  74. withdrawExcRcvJob.runById("cron.withdraw.wms.ingoing.exception.receive");
  75. }
  76. /**
  77. * WMS 회수입고예외결과 송신
  78. *
  79. * @throws Exception
  80. */
  81. @Scheduled(cron = "${cron.withdraw.wms.ingoing.exception.result.receive}")
  82. //@Scheduled(fixedDelay = 3500000)
  83. @Async
  84. public void withdrawWmsIngoingExceptionResultReceiveJob() throws Exception {
  85. withdrawExcRsltJob.runById("cron.withdraw.wms.ingoing.exception.result.receive");
  86. }
  87. /**
  88. * WMS 회수입고결과 수신
  89. *
  90. * @throws Exception
  91. */
  92. @Scheduled(cron = "${cron.withdraw.wms.ingoing.result.receive}")
  93. //@Scheduled(fixedDelay = 3500000)
  94. @Async
  95. public void withdrawWmsIngoingResultReceiveJob() throws Exception {
  96. withdrawRsltJob.runById("cron.withdraw.wms.ingoing.result.receive");
  97. }
  98. /**
  99. * CJ 회수송장번호 수신
  100. *
  101. * @throws Exception
  102. */
  103. @Scheduled(cron = "${cron.withdraw.cj.invoice.receive}")
  104. //@Scheduled(fixedDelay = 3500000)
  105. @Async
  106. public void withdrawCjInvoiceReceiveJob() throws Exception {
  107. tsbCjWithdrawInvoiceJob.runById("cron.withdraw.cj.invoice.receive");
  108. }
  109. /**
  110. * CJ 회수상태 수신
  111. *
  112. * @throws Exception
  113. */
  114. @Scheduled(cron = "${cron.withdraw.cj.status.receive}")
  115. //@Scheduled(fixedDelay = 3500000)
  116. @Async
  117. public void withdrawCjStatusJob() throws Exception {
  118. tsbCjWithdrawInvoiceStatJob.runById("cron.withdraw.cj.status.receive");
  119. }
  120. }