1
0

OrderTask.java 9.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245
  1. package com.kmall.schedule.quartz;
  2. import com.kmall.schedule.service.*;
  3. import org.apache.commons.logging.Log;
  4. import org.apache.commons.logging.LogFactory;
  5. import org.springframework.beans.factory.annotation.Autowired;
  6. import org.springframework.scheduling.annotation.Scheduled;
  7. import org.springframework.stereotype.Component;
  8. @Component("orderTask")
  9. public class OrderTask {
  10. private static Log logger = LogFactory.getLog(OrderTask.class);
  11. @Autowired
  12. QzOrderService qzOrderService;
  13. @Autowired
  14. QzStorePromService qzStorePromService;
  15. @Autowired
  16. QzStoreTicketDiscountService qzStoreTicketDiscountService;
  17. @Autowired
  18. QzStoreTopicStatisService qzStoreTopicStatisService;
  19. @Autowired
  20. QzStoreCampMinusService qzStoreCampMinusService;
  21. /**
  22. * 方法描述:拼团进度通知
  23. * 每日凌晨2:00
  24. */
  25. /*@Scheduled(cron = "0 0 2 * * ?")
  26. public void groupProgressRemind() {
  27. logger.info(">>>>>>>>>>>>>>>>>>>>groupProgressRemind is start ");
  28. qzOrderService.groupProgressRemind();
  29. logger.info(">>>>>>>>>>>>>>>>>>>>groupProgressRemind is end ");
  30. }*/
  31. /**
  32. * 未评价订单(发送微信模版消息提醒用户)
  33. * 每日凌晨2:00
  34. *//*
  35. @Scheduled(cron = "0 0 2 * * ?")
  36. public void orderUnEvaluateRemind() {
  37. logger.info(">>>>>>>>>>>>>>>>>>>>groupProgressRemind is start ");
  38. qzOrderService.orderUnEvaluateRemind();
  39. logger.info(">>>>>>>>>>>>>>>>>>>>groupProgressRemind is end ");
  40. }*/
  41. /**
  42. * 方法描述:更新过期未支付订单
  43. * 二分钟更新未付款订单
  44. */
  45. // @Scheduled(fixedRate = 1000 * 60 * 2)
  46. public void unpayPastUpdate() {
  47. logger.info(">>>>>>>>>>>>>>>>>>>>unpayPastUpdate is start ");
  48. qzOrderService.unpayPastUpdate();
  49. logger.info(">>>>>>>>>>>>>>>>>>>>unpayPastUpdate is end ");
  50. }
  51. /**
  52. * 方法描述:查询已申请退款订单以及退款中订单,查询微信退款更新订单状态
  53. * 二分钟更新订单
  54. */
  55. // @Scheduled(fixedRate = 1000 * 60 * 1)
  56. public void refundUpdate() {
  57. logger.info(">>>>>>>>>>>>>>>>>>>>refundUpdate is start ");
  58. qzOrderService.refundUpdate();
  59. logger.info(">>>>>>>>>>>>>>>>>>>>refundUpdate is end ");
  60. }
  61. /**
  62. * 方法描述:查询支付中的订单以及小程序更新支付信息异常订单,查询微信订单信息更新订单状态
  63. * 二分钟更新订单
  64. */
  65. // @Scheduled(fixedRate = 1000 * 60 * 1)
  66. public void orderQueryUpdate() {
  67. logger.info(">>>>>>>>>>>>>>>>>>>>orderQueryUpdate is start ");
  68. qzOrderService.orderQueryUpdate();
  69. logger.info(">>>>>>>>>>>>>>>>>>>>orderQueryUpdate is end ");
  70. }
  71. /**
  72. * 方法描述:查询支付中的订单以及小程序更新支付信息异常订单,查询平安订单信息更新订单状态
  73. * 二分钟更新订单
  74. */
  75. // @Scheduled(fixedRate = 1000 * 60 * 1)
  76. public void pinganOrderQueryUpdate() {
  77. logger.info(">>>>>>>>>>>>>>>>>>>>pinganOrderQueryUpdate is start ");
  78. qzOrderService.pinganOrderQueryUpdate();
  79. logger.info(">>>>>>>>>>>>>>>>>>>>pinganOrderQueryUpdate is end ");
  80. }
  81. /**
  82. * 方法描述:商品发货后7天自动确认收货
  83. */
  84. // @Scheduled(fixedRate = 1000 * 60 * 1)
  85. public void shipmentOrderAutoTakeGoods() {
  86. logger.info(">>>>>>>>>>>>>>>>>>>>shipmentOrderAutoTakeGoods is start ");
  87. qzOrderService.shipmentOrderAutoTakeGoods();
  88. logger.info(">>>>>>>>>>>>>>>>>>>>shipmentOrderAutoTakeGoods is end ");
  89. }
  90. /**
  91. * 方法描述:确认收货后30天自动确认好评
  92. */
  93. // @Scheduled(fixedRate = 1000 * 60 * 1)
  94. public void receiptOrderAutoComment() {
  95. logger.info(">>>>>>>>>>>>>>>>>>>>receiptOrderAutoComment is start ");
  96. qzOrderService.receiptOrderAutoComment();
  97. logger.info(">>>>>>>>>>>>>>>>>>>>receiptOrderAutoComment is end ");
  98. }
  99. /**
  100. * 方法描述:返回海关所需获取的支付相关实时数据
  101. * 五分钟更新未付款订单
  102. */
  103. // @Scheduled(fixedRate = 1000 * 60 * 5)
  104. public void realTimeDataUp() {
  105. logger.info(">>>>>>>>>>>>>>>>>>>>realTimeDataUp is start ");
  106. qzOrderService.realTimeDataUp();
  107. logger.info(">>>>>>>>>>>>>>>>>>>>realTimeDataUp is end ");
  108. }
  109. /**
  110. * 方法描述:用户确认收货后,记录商品分销购买记录
  111. * 1分钟更新
  112. */
  113. // @Scheduled(fixedRate = 1000 * 60 * 1)
  114. public void receiptOrderSaveDistSellStatis() {
  115. logger.info(">>>>>>>>>>>>>>>>>>>>receiptOrderSaveDistSellStatis is start ");
  116. qzOrderService.receiptOrderSaveDistSellStatis();
  117. logger.info(">>>>>>>>>>>>>>>>>>>>receiptOrderSaveDistSellStatis is end ");
  118. }
  119. /**
  120. * 方法描述:查询渠道推广有效开始时间是否过期,过期则修改结束状态为已结束
  121. * 1分钟更新
  122. */
  123. // @Scheduled(fixedRate = 1000 * 60 * 1)
  124. public void updateQueryStoreProm() {
  125. logger.info(">>>>>>>>>>>>>>>>>>>>updateQueryStoreProm is start ");
  126. qzStorePromService.updateQueryStoreProm();
  127. logger.info(">>>>>>>>>>>>>>>>>>>>updateQueryStoreProm is end ");
  128. }
  129. /**
  130. * 方法描述:支付成功且是渠道推广订单统计支付数据
  131. * 1分钟更新
  132. */
  133. // @Scheduled(fixedRate = 1000 * 60 * 1)
  134. public void updatePromStatByPaySuccess() {
  135. logger.info(">>>>>>>>>>>>>>>>>>>>updatePromStatByPaySuccess is start ");
  136. qzStorePromService.updatePromStatByPaySuccess();
  137. logger.info(">>>>>>>>>>>>>>>>>>>>updatePromStatByPaySuccess is end ");
  138. }
  139. /**
  140. * 方法描述:退款成功且是渠道推广订单统计支付数据
  141. * 1分钟更新
  142. */
  143. // @Scheduled(fixedRate = 1000 * 60 * 1)
  144. public void updatePromStatByRefundSuccess() {
  145. logger.info(">>>>>>>>>>>>>>>>>>>>updatePromStatByRefundSuccess is start ");
  146. qzStorePromService.updatePromStatByRefundSuccess();
  147. logger.info(">>>>>>>>>>>>>>>>>>>>updatePromStatByRefundSuccess is end ");
  148. }
  149. /**
  150. * 方法描述:查询优惠券有效时间是否过期,修改过期优惠券数据结束状态为无效,修改过期用户优惠券状态为无效
  151. * 1分钟更新
  152. */
  153. // @Scheduled(fixedRate = 1000 * 60 * 1)
  154. public void updateQueryTicketDiscount() {
  155. logger.info(">>>>>>>>>>>>>>>>>>>>updateQueryTicketDiscount is start ");
  156. qzStoreTicketDiscountService.updateQueryTicketDiscount();
  157. logger.info(">>>>>>>>>>>>>>>>>>>>updateQueryTicketDiscount is end ");
  158. }
  159. /**
  160. * 方法描述:支付成功且是门店优惠券活动订单统计支付数据
  161. * 1分钟更新
  162. */
  163. // @Scheduled(fixedRate = 1000 * 60 * 1)
  164. public void updateTopicStatByPaySuccess() {
  165. logger.info(">>>>>>>>>>>>>>>>>>>>updateTopicStatByPaySuccess is start ");
  166. qzStoreTopicStatisService.updateTopicStatByPaySuccess();
  167. logger.info(">>>>>>>>>>>>>>>>>>>>updateTopicStatByPaySuccess is end ");
  168. }
  169. /**
  170. * 方法描述:退款成功且是门店优惠券活动订单统计支付数据
  171. * 1分钟更新
  172. */
  173. // @Scheduled(fixedRate = 1000 * 60 * 1)
  174. public void updateTopicStatByRefundSuccess() {
  175. logger.info(">>>>>>>>>>>>>>>>>>>>updateTopicStatByRefundSuccess is start ");
  176. qzStoreTopicStatisService.updateTopicStatByRefundSuccess();
  177. logger.info(">>>>>>>>>>>>>>>>>>>>updateTopicStatByRefundSuccess is end ");
  178. }
  179. /**
  180. * 方法描述:修改过期满减满折数据结束状态为无效,修改未开始且开始时间已小于或等于当前时间的满减满折结束状态为进行中
  181. * 1分钟更新
  182. */
  183. // @Scheduled(fixedRate = 1000 * 60 * 1)
  184. public void updateQueryStoreCampMinus() {
  185. logger.info(">>>>>>>>>>>>>>>>>>>>updateQueryStoreCampMinus is start ");
  186. qzStoreCampMinusService.updateQueryStoreCampMinus();
  187. logger.info(">>>>>>>>>>>>>>>>>>>>updateQueryStoreCampMinus is end ");
  188. }
  189. /**
  190. * 方法描述:支付成功且是门店促销满减活动订单统计支付数据
  191. * 1分钟更新
  192. */
  193. // @Scheduled(fixedRate = 1000 * 60 * 1)
  194. public void updateCampTopicStatByPaySuccess() {
  195. logger.info(">>>>>>>>>>>>>>>>>>>>updateCampTopicStatByPaySuccess is start ");
  196. qzStoreTopicStatisService.updateCampTopicStatByPaySuccess();
  197. logger.info(">>>>>>>>>>>>>>>>>>>>updateCampTopicStatByPaySuccess is end ");
  198. }
  199. /**
  200. * 方法描述:退款成功且是门店促销满减活动订单统计支付数据
  201. * 1分钟更新
  202. */
  203. // @Scheduled(fixedRate = 1000 * 60 * 1)
  204. public void updateCampTopicStatByRefundSuccess() {
  205. logger.info(">>>>>>>>>>>>>>>>>>>>updateCampTopicStatByRefundSuccess is start ");
  206. qzStoreTopicStatisService.updateCampTopicStatByRefundSuccess();
  207. logger.info(">>>>>>>>>>>>>>>>>>>>updateCampTopicStatByRefundSuccess is end ");
  208. }
  209. /*@Scheduled(fixedRate = 1000 * 60 * 1)
  210. public void updateSellVolume() {
  211. logger.info(">>>>>>>>>>>>>>>>>>>>updateSellVolume is start ");
  212. qzOrderService.updateSellVolume();
  213. logger.info(">>>>>>>>>>>>>>>>>>>>updateSellVolume is end ");
  214. }*/
  215. /**
  216. * 查询商品库存数量变化后未共享的商品数据,批量修改该商品的门店商品库存信息
  217. * 10秒执行一次
  218. */
  219. // @Scheduled(cron = "0/10 * * * * ?")
  220. public void updateProductStoreByGoodsShareStock() {
  221. logger.info(">>>>>>>>>>>>>>>>>>>>updateProductStoreByGoodsShareStock is start ");
  222. qzOrderService.updateProductStoreByGoodsShareStock();
  223. logger.info(">>>>>>>>>>>>>>>>>>>>updateProductStoreByGoodsShareStock is end ");
  224. }
  225. }