From 13a1aae19b89c15e9b61b4746c0d9559ef32bc5b Mon Sep 17 00:00:00 2001 From: zds <2388969634@qq.com> Date: Tue, 27 Aug 2024 17:31:39 +0800 Subject: [PATCH] =?UTF-8?q?fix:acs=E9=87=8D=E5=A4=8D=E6=89=AB=E7=A0=81?= =?UTF-8?q?=E6=97=B6=EF=BC=8Clms=E7=94=9F=E6=88=90=E4=BB=BB=E5=8A=A1?= =?UTF-8?q?=E6=97=B6=E5=88=A4=E6=96=AD=E6=98=AF=E5=90=A6=E5=AD=98=E5=9C=A8?= =?UTF-8?q?=E6=9C=AA=E5=AE=8C=E6=88=90=E7=9A=84=E4=BB=BB=E5=8A=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../wms/sch/task/service/ISchBaseTaskService.java | 8 ++++++++ .../task/service/impl/SchBaseTaskServiceImpl.java | 13 +++++++++++++ .../org/nl/wms/sch/task_manage/AbstractTask.java | 8 ++++++++ .../src/main/resources/logback-spring.xml | 2 +- 4 files changed, 30 insertions(+), 1 deletion(-) diff --git a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task/service/ISchBaseTaskService.java b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task/service/ISchBaseTaskService.java index 4668765..dfdf309 100644 --- a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task/service/ISchBaseTaskService.java +++ b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task/service/ISchBaseTaskService.java @@ -67,6 +67,14 @@ public interface ISchBaseTaskService extends IService { */ List findUnFinishTasksByPoint_code2(String task_code, String point_code2); + /** + * 根据任务号和子托盘查询未完成的任务 + * @param task_code + * @param sub_tray + * @return + */ + List findUnFinishTasksBySub_tray(String task_code, String sub_tray); + /** * 根据任务类型和任务状态查询任务 * @param config_code diff --git a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task/service/impl/SchBaseTaskServiceImpl.java b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task/service/impl/SchBaseTaskServiceImpl.java index d8de2ac..43b3cb3 100644 --- a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task/service/impl/SchBaseTaskServiceImpl.java +++ b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task/service/impl/SchBaseTaskServiceImpl.java @@ -140,6 +140,19 @@ public class SchBaseTaskServiceImpl extends ServiceImpl findUnFinishTasksBySub_tray(String task_code, String sub_tray) { + Assert.notNull(task_code, "任务编码不能为空!"); + Assert.notNull(sub_tray, "子托盘不能为空!"); + LambdaQueryWrapper lam = new LambdaQueryWrapper<>(); + lam.lt(SchBaseTask::getTask_status, TaskStatus.FINISHED.getCode()) + .ne(ObjectUtil.isNotEmpty(task_code),SchBaseTask::getTask_code, task_code)// 不是当前任务 + .eq(SchBaseTask::getVehicle_code2, sub_tray) + .eq(SchBaseTask::getIs_delete, false); + List schBaseTasks = schBaseTaskMapper.selectList(lam); + return schBaseTasks; + } + @Override public List findTasksByTaskStatus(String config_code, TaskStatus status) { Assert.notNull(config_code, "任务配置编码不能为空!"); diff --git a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/AbstractTask.java b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/AbstractTask.java index aee1b05..29db93a 100644 --- a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/AbstractTask.java +++ b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/AbstractTask.java @@ -169,6 +169,7 @@ public abstract class AbstractTask { String apply_point_code = param.getString("device_code"); // 请求点 String next_point = param.getString("next_point"); // 目的点 String config_code = param.getString("config_code"); + String sub_tray = param.getString("sub_tray"); // 1、校验数据 SchBaseTaskconfig taskConfig = taskConfigService.getOne(new LambdaQueryWrapper() .eq(SchBaseTaskconfig::getConfig_code, config_code)); @@ -182,6 +183,13 @@ public abstract class AbstractTask { Assert.isFalse(apply_point_lists.size()>0, "该任务申请点位["+apply_point_code+"]已存在未完成的任务,无法申请任务!"); } + //子托盘非空 + if(ObjectUtil.isNotEmpty(sub_tray)) { + //判断该子托盘是否存在未完成任务 + List apply_sub_tray_lists = taskService.findUnFinishTasksBySub_tray("",sub_tray); + Assert.isFalse(apply_sub_tray_lists.size()>0, + "该任务申请子托盘["+sub_tray+"]已存在未完成的任务,无法申请任务!"); + } // 最大可创建任务数 Integer tcmn = taskConfig.getTask_create_max_num(); // 获取申请的任务 diff --git a/lms/nladmin-system/nlsso-server/src/main/resources/logback-spring.xml b/lms/nladmin-system/nlsso-server/src/main/resources/logback-spring.xml index f00f364..9a2c91e 100644 --- a/lms/nladmin-system/nlsso-server/src/main/resources/logback-spring.xml +++ b/lms/nladmin-system/nlsso-server/src/main/resources/logback-spring.xml @@ -57,7 +57,7 @@ https://juejin.cn/post/6844903775631572999 - +