| | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.plugins.IgnoreStrategy; |
| | | import com.baomidou.mybatisplus.core.plugins.InterceptorIgnoreHelper; |
| | | import com.zy.asrs.framework.common.DateUtils; |
| | | import com.zy.asrs.framework.exception.CoolException; |
| | | import com.zy.asrs.wms.asrs.entity.*; |
| | | import com.zy.asrs.wms.asrs.entity.enums.OrderSettleType; |
| | | import com.zy.asrs.wms.asrs.service.*; |
| | | import com.zy.asrs.wms.system.entity.Dict; |
| | | import com.zy.asrs.wms.system.service.DictService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.scheduling.annotation.Scheduled; |
| | | import org.springframework.stereotype.Component; |
| | |
| | | private OrderService orderService; |
| | | @Autowired |
| | | private OrderDetlService orderDetlService; |
| | | @Autowired |
| | | private DictService dictService; |
| | | |
| | | @Scheduled(cron = "0/3 * * * * ? ") |
| | | @Transactional |
| | |
| | | public void outExecute() { |
| | | InterceptorIgnoreHelper.handle(IgnoreStrategy.builder().tenantLine(true).build()); |
| | | try { |
| | | //获取入库完成任务 |
| | | //获取出库完成任务 |
| | | List<Task> list = taskService.list(new LambdaQueryWrapper<Task>() |
| | | .eq(Task::getTaskSts, 200) |
| | | .in(Task::getTaskType, 101, 53, 57)); |
| | |
| | | return; |
| | | } |
| | | |
| | | Dict dict = dictService.getOne(new LambdaQueryWrapper<Dict>().eq(Dict::getFlag, "taskLogDiffDays").eq(Dict::getStatus, 1)); |
| | | if(dict == null) { |
| | | return; |
| | | } |
| | | for (Task task : list) { |
| | | int diff = DateUtils.diff(task.getCreateTime(), new Date()); |
| | | int taskLogDiffDays = Integer.parseInt(dict.getValue()); |
| | | if (diff < taskLogDiffDays) { |
| | | continue; |
| | | } |
| | | |
| | | Long hostId = task.getHostId(); |
| | | |
| | | //保存任务历史档 |