From 875a183c5d5a12a4ba5c8d37559295ac1ce6cce3 Mon Sep 17 00:00:00 2001 From: skyouc Date: 星期三, 09 七月 2025 21:13:11 +0800 Subject: [PATCH] 播种流程优化 --- zy-asrs-wms/src/main/java/com/zy/asrs/wms/asrs/timer/TaskLogTimer.java | 33 ++++++++++++++++----------------- 1 files changed, 16 insertions(+), 17 deletions(-) diff --git a/zy-asrs-wms/src/main/java/com/zy/asrs/wms/asrs/timer/TaskLogTimer.java b/zy-asrs-wms/src/main/java/com/zy/asrs/wms/asrs/timer/TaskLogTimer.java index 323c180..fc9ad3c 100644 --- a/zy-asrs-wms/src/main/java/com/zy/asrs/wms/asrs/timer/TaskLogTimer.java +++ b/zy-asrs-wms/src/main/java/com/zy/asrs/wms/asrs/timer/TaskLogTimer.java @@ -48,6 +48,13 @@ @Autowired private WaveService waveService; + + /** + * @author Ryan + * @date 2025/6/20 + * @description: 鍏ュ簱浠诲姟宸插畬鎴� + * @version 1.0 + */ @Scheduled(cron = "0/15 * * * * ? ") @Transactional(rollbackFor = Exception.class) public void inExecute() { @@ -116,6 +123,7 @@ for (TaskDetl taskDetl : taskDetls) { TaskDetlLog taskDetlLog = new TaskDetlLog(); taskDetlLog.sync(taskDetl); + taskDetlLog.setOrderId(taskDetl.getOrderId()); taskDetlLog.setId(null); taskDetlLog.setTaskId(taskLog.getId()); if (!taskDetlLogService.save(taskDetlLog)) { @@ -158,7 +166,14 @@ } } - @Scheduled(cron = "0/10 * * * * ? ") + + /** + * @author Ryan + * @date 2025/6/20 + * @description: 鍑哄簱浠诲姟瀹屾垚 + * @version 1.0 + */ + @Scheduled(cron = "0/35 * * * * ? ") @Transactional(rollbackFor = Exception.class) public void outExecute() { InterceptorIgnoreHelper.handle(IgnoreStrategy.builder().tenantLine(true).build()); @@ -171,43 +186,27 @@ 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(); - //淇濆瓨浠诲姟鏄庣粏鍘嗗彶妗� List<TaskDetl> taskDetls = taskDetlService.getTaskDetlByTaskId(task.getId()); if (taskDetls.isEmpty()) { throw new CoolException("浠诲姟鏄庣粏涓嶅瓨鍦�"); } - boolean flag = false; for (TaskDetl taskDetl : taskDetls) { if (taskDetl.getWaveId() == null) { continue; } - Wave wave = waveService.getById(taskDetl.getWaveId()); if (wave != null) { flag = true;//娉㈡鏈畬鎴� break; } } - if (flag) { continue; } - - //淇濆瓨浠诲姟鍘嗗彶妗� TaskLog taskLog = new TaskLog(); taskLog.sync(task); -- Gitblit v1.9.1