| | |
| | | import org.springframework.transaction.interceptor.TransactionAspectSupport;
|
| | |
|
| | | import java.util.*;
|
| | | import java.util.stream.Collectors;
|
| | |
|
| | | @Component
|
| | | public class TaskWaveTimer {
|
| | |
| | |
|
| | | /**
|
| | | * modifty:
|
| | | * original : fetch datasource of task type on WAVE_SEED
|
| | | * now: Fetch datasource of task type on WCS_EXECUTE_OUT_ARRIVED, After completing the task and for setting the task type equal to WAVE_SEED
|
| | | * original : fetch datasource of task type on WCS_EXECUTE_OUT_TASK_DONE
|
| | | * now: Fetch datasource of task type on WCS_EXECUTE_OUT_ARRIVED, After completing the task and for setting the task type equal to GENERATE_WAVE_SEED
|
| | | */
|
| | | @Scheduled(cron = "0/15 * * * * ? ")
|
| | | @Scheduled(cron = "0/3 * * * * ? ")
|
| | | @Transactional(rollbackFor = Exception.class)
|
| | | public void taskWave() {
|
| | | InterceptorIgnoreHelper.handle(IgnoreStrategy.builder().tenantLine(true).build());
|
| | |
| | | if (!autoCreateWaveSeed.equals("true")) {
|
| | | return;
|
| | | }
|
| | | //查询状态为容器到达状态所有任务单据
|
| | | //查询状态为RCS任务完成所有任务单据
|
| | | // List<Task> taskList = taskService.list(new LambdaQueryWrapper<Task>().eq(Task::getTaskSts, TaskStsType.WAVE_SEED.id));
|
| | | List<Task> taskList = taskService.list(new LambdaQueryWrapper<Task>().eq(Task::getTaskSts, TaskStsType.WCS_EXECUTE_OUT_TASK_DONE.id));
|
| | | HashSet<String> sycMatnrs = new HashSet<>();
|
| | | List<Task> taskList = taskService.list(new LambdaQueryWrapper<Task>().eq(Task::getTaskSts, TaskStsType.WCS_EXECUTE_OUT.id)); HashSet<String> sycMatnrs = new HashSet<>();
|
| | | if (taskList.isEmpty()) {
|
| | | // throw new CoolException("没有可播种任务!!");
|
| | | } else {
|
| | |
| | |
|
| | | List<TaskDetl> taskDetls = taskDetlService.list(new LambdaQueryWrapper<TaskDetl>().eq(TaskDetl::getTaskId, task.getId()).eq(TaskDetl::getHostId, hostId));
|
| | | if (taskDetls.isEmpty()) {
|
| | | continue;
|
| | | }
|
| | | // 过滤已经生成波次播种数据的任务 该任务的任务明细号不能在播种数据表里面
|
| | | long count = waveSeedService.count(new LambdaQueryWrapper<WaveSeed>().in(WaveSeed::getTaskDetlId, taskDetls.stream().map(TaskDetl::getId).collect(Collectors.toList())).eq(WaveSeed::getHostId, hostId));
|
| | | if (count > 0) {
|
| | | continue;
|
| | | }
|
| | |
|
| | |
| | | anfme -= workQty;
|
| | |
|
| | | orderUtils.updateWorkQty(orderDetl.getId(), workQty, true);
|
| | |
|
| | | //
|
| | | //fixme 生成波次播种数据时,不自动添加站点绑定,站点绑定调整至出库绑定播种库位时更新
|
| | | // CacheSite cacheSite = cacheSiteService.getOne(new LambdaQueryWrapper<CacheSite>().eq(CacheSite::getOrderId, orderDetl.getOrderId()).eq(CacheSite::getHostId, hostId));
|
| | | // if (cacheSite == null) {
|
| | |
| | | }
|
| | | }
|
| | |
|
| | | task.setTaskSts(TaskStsType.GENERATE_WAVE_SEED.id);
|
| | | task.setUpdateTime(new Date());
|
| | | if (!taskService.updateById(task)) {
|
| | | throw new CoolException("任务更新失败");
|
| | | }
|
| | | // task.setTaskSts(TaskStsType.GENERATE_WAVE_SEED.id);
|
| | | // task.setUpdateTime(new Date());
|
| | | // if (!taskService.updateById(task)) {
|
| | | // throw new CoolException("任务更新失败");
|
| | | // }
|
| | | }
|
| | | }
|
| | | } catch (Exception e) {
|