| | |
| | | import com.fasterxml.jackson.databind.cfg.CoercionAction; |
| | | import com.fasterxml.jackson.databind.cfg.CoercionInputShape; |
| | | import com.vincent.rsf.framework.common.Cools; |
| | | import com.vincent.rsf.framework.common.DateUtils; |
| | | import com.vincent.rsf.framework.common.R; |
| | | import com.vincent.rsf.framework.exception.CoolException; |
| | | import com.vincent.rsf.server.api.config.RemotesInfoProperties; |
| | |
| | | @Scheduled(cron = "0/55 * * * * ? ") |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public void pubTaskToWcs() { |
| | | log.info("定时任务开始执行:任务下发到RCS"); |
| | | Long loginUserId = SystemAuthUtils.getLoginUserId(); |
| | | List<Integer> list = Arrays.asList(TaskType.TASK_TYPE_IN.type, TaskType.TASK_TYPE_OUT.type, TaskType.TASK_TYPE_LOC_MOVE.type, TaskType.TASK_TYPE_EMPITY_IN.type |
| | | , TaskType.TASK_TYPE_CHECK_IN.type, TaskType.TASK_TYPE_MERGE_IN.type, TaskType.TASK_TYPE_EMPITY_OUT.type, TaskType.TASK_TYPE_PICK_IN.type, |
| | |
| | | .in(Task::getTaskType, list) |
| | | .in(Task::getTaskStatus, integers) |
| | | .orderByDesc(Task::getSort)); |
| | | log.info("查询到待下发任务数量:{}", tasks.size()); |
| | | if (tasks.isEmpty()) { |
| | | log.debug("没有待下发的任务,定时任务结束"); |
| | | return; |
| | | } |
| | | Config config = configService.getOne(new LambdaQueryWrapper<Config>().eq(Config::getFlag, GlobalConfigCode.AUTO_RUN_CHECK_ORDERS)); |
| | | if (!Objects.isNull(config) && !Objects.isNull(config.getVal())) { |
| | | if (Boolean.parseBoolean(config.getVal())) { |
| | | return; |
| | | log.info("配置项AUTO_RUN_CHECK_ORDERS为true,跳过任务下发"); |
| | | return; |
| | | } |
| | | } |
| | | // for (Task task : tasks) { |
| | |
| | | // } |
| | | // } |
| | | /**下发普通站点任务,报错回滚,不再往下执行*/ |
| | | log.info("开始下发{}个任务到RCS", tasks.size()); |
| | | taskService.pubTaskToWcs(tasks); |
| | | log.info("定时任务执行完成:任务下发到RCS"); |
| | | } |
| | | |
| | | /** |
| | |
| | | } else { |
| | | queryWrapper.in(Task::getTaskStatus, TaskStsType.UPDATED_IN.id, TaskStsType.UPDATED_OUT.id); |
| | | } |
| | | queryWrapper.last("ORDER BY RAND() LIMIT 1"); |
| | | |
| | | List<Task> tasks = taskService.list(queryWrapper); |
| | | if (tasks.isEmpty()) { |
| | | return; |