| | |
| | | package com.zy.asrs.task; |
| | | |
| | | import cn.hutool.core.date.StopWatch; |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.baomidou.mybatisplus.plugins.Page; |
| | | import com.core.common.Cools; |
| | | import com.zy.asrs.entity.AgvLocDetl; |
| | | import com.zy.asrs.entity.DocType; |
| | | import com.zy.asrs.entity.Order; |
| | | import com.zy.asrs.entity.OrderDetl; |
| | | import com.zy.asrs.entity.*; |
| | | import com.zy.asrs.mapper.OrderDetlMapper; |
| | | import com.zy.asrs.service.*; |
| | | import com.zy.asrs.task.core.ReturnT; |
| | | import com.zy.asrs.task.handler.OrderSyncHandler; |
| | | import com.zy.common.entity.Parameter; |
| | | import com.zy.common.utils.Synchro; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.scheduling.annotation.Scheduled; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | |
| | | /** |
| | |
| | | private OrderSyncHandler orderSyncHandler; |
| | | @Autowired |
| | | private OrderService orderService; |
| | | |
| | | |
| | | @Autowired |
| | | private OrderLogService orderLogService; |
| | | |
| | | @Autowired |
| | | private OrderDetlLogService orderDetlLogService; |
| | | |
| | | |
| | | @Autowired |
| | | private ApiLogService apiLogService; |
| | | |
| | |
| | | |
| | | private Integer page = 1; |
| | | |
| | | private Integer size = 100; |
| | | private Integer size = 200; |
| | | |
| | | @Scheduled(cron = "0 0 1 * * ? ") |
| | | public void clearApiLog() { |
| | |
| | | @Scheduled(fixedDelay = 600000) |
| | | //@Async("orderThreadPool") |
| | | public void completeAndReport() { |
| | | StopWatch stopWatch = new StopWatch(); |
| | | stopWatch.start(); |
| | | String erpReport = Parameter.get().getErpReport(); |
| | | if (!Cools.isEmpty(erpReport) && erpReport.equals("true")) { |
| | | List<Order> orders = orderService.selectComplete(); |
| | |
| | | } |
| | | } |
| | | } |
| | | stopWatch.stop(); |
| | | log.info("定时任务完成,耗时:{}ms", stopWatch.getTotalTimeMillis()); |
| | | } |
| | | |
| | | //@Scheduled(cron = "* 0/5 * * * ? ") |
| | |
| | | 定时查询状态为2.作业中的单据,检查是否完成 |
| | | */ |
| | | //@Scheduled(cron = "0 */1 * * * ? ") |
| | | @Scheduled(fixedDelay = 60000) |
| | | @Scheduled(fixedDelay = 120000) |
| | | public void completeOrder() { |
| | | try { |
| | | Page<Order> settle = orderService.selectPage(new Page<Order>(page, size), new EntityWrapper<Order>().eq("settle", 2)); |
| | |
| | | } finally { |
| | | page++; |
| | | } |
| | | log.info("分页查询完毕,{}", page); |
| | | } |
| | | |
| | | |
| | | |
| | | } |