| | |
| | | package com.zy.asrs.task; |
| | | |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.zy.asrs.entity.OrderDetlPakin; |
| | | import com.zy.asrs.entity.OrderDetlPakout; |
| | | import com.zy.asrs.entity.OrderPakin; |
| | | import com.zy.asrs.entity.OrderPakout; |
| | | import com.zy.asrs.service.ApiLogService; |
| | | import com.zy.asrs.service.OrderPakinService; |
| | | import com.zy.asrs.service.OrderPakoutService; |
| | | import com.zy.asrs.service.*; |
| | | import com.zy.asrs.service.impl.OrderDetlPakinServiceImpl; |
| | | import com.zy.asrs.task.core.ReturnT; |
| | | import com.zy.asrs.task.handler.OrderPakinSyncHandler; |
| | | import com.zy.asrs.task.handler.OrderPakoutSyncHandler; |
| | |
| | | import org.springframework.scheduling.annotation.Scheduled; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.Iterator; |
| | | import java.util.List; |
| | | |
| | | /** |
| | |
| | | @Autowired |
| | | private LoadingConfigTimer loadingConfigTimer; |
| | | |
| | | @Resource |
| | | private OrderDetlPakoutService orderDetlPakoutService; |
| | | |
| | | @Resource |
| | | private OrderDetlPakinService orderDetlPakinService; |
| | | |
| | | |
| | | @Scheduled(cron = "0 0 1 * * ? ") |
| | | public void clearApiLog() { |
| | |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 定时上报已入库的订单数量 |
| | | */ |
| | | // @Scheduled(cron = "0 0/5 * * * ?") |
| | | @Scheduled(cron = "0 0/1 * * * ?") |
| | | @Async("orderThreadPool") |
| | | public void reportInStockOrders() { |
| | | if (loadingConfigTimer.getErpReport()) { |
| | | List<OrderDetlPakin> orderDetlPakinList = orderDetlPakinService.selectList(new EntityWrapper<OrderDetlPakin>().where("qty > units")); |
| | | if (!orderDetlPakinList.isEmpty()) { |
| | | orderPakinSyncHandler.reportInStockOrders(orderDetlPakinList); |
| | | } |
| | | } |
| | | } |
| | | |
| | | @Scheduled(cron = "0/15 * * * * ? ") |
| | | /** |
| | | * 定时上报已出库的订单数量,定时任务5分钟上报一次,出入库错开上报 |
| | | */ |
| | | // @Scheduled(cron = "0 3/5 * * * ?") |
| | | @Scheduled(cron = "0/10 * * * * ?") |
| | | @Async("orderThreadPool") |
| | | public void reportOutStockOrders() { |
| | | if (loadingConfigTimer.getErpReport()) { |
| | | List<OrderDetlPakout> orderDetlPakoutList = orderDetlPakoutService.selectList(new EntityWrapper<OrderDetlPakout>().where("qty > units")); |
| | | if (!orderDetlPakoutList.isEmpty()) { |
| | | orderPakoutSyncHandler.reportOutStockOrders(orderDetlPakoutList); |
| | | } |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 订单已完成,上报已完成,订单状态变已上报 |
| | | */ |
| | | @Scheduled(cron = "0 * * * * ?") |
| | | @Async("orderThreadPool") |
| | | public void completeOrderReport() { |
| | | // 入库订单已完成转已上报 |
| | | orderPakinSyncHandler.completeOrderReport(); |
| | | // 出库订单已完成转已上报 |
| | | orderPakoutSyncHandler.completeOrderReport(); |
| | | } |
| | | |
| | | // @Scheduled(cron = "0/15 * * * * ? ") |
| | | @Async("orderThreadPool") |
| | | public void completeOrderPakin() { |
| | | if (loadingConfigTimer.getErpReport()) { |
| | |
| | | } |
| | | |
| | | |
| | | @Scheduled(cron = "0/15 * * * * ? ") |
| | | // @Scheduled(cron = "0/15 * * * * ? ") |
| | | @Async("orderThreadPool") |
| | | public void completeOrderPakout() { |
| | | if (loadingConfigTimer.getErpReport()) { |