From 470974d972b011605e12dce0274ea98fe96e7222 Mon Sep 17 00:00:00 2001 From: psh Date: Wed, 25 Oct 2023 18:05:54 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=8B=E5=8F=91=E4=BB=BB=E5=8A=A1=E7=9B=AE?= =?UTF-8?q?=E6=A0=87=E5=9C=B0=E7=82=B9=E5=85=88=E8=AE=BE=E7=BD=AE=E4=B8=BA?= =?UTF-8?q?=E7=AD=89=E5=BE=85=E7=82=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../nl/wms/ext/service/impl/AcsToWmsServiceImpl.java | 1 + .../nl/wms/sch/task_manage/task/tasks/BPSLTask.java | 4 ++-- .../nl/wms/sch/task_manage/task/tasks/XSCKTask.java | 10 ++++++++-- .../sch/task_manage/task/tasks/ghs/GHSQHTask.java | 12 +++++++++++- lms/nladmin-ui/src/views/wms/sch/group/index.vue | 1 + 5 files changed, 23 insertions(+), 5 deletions(-) diff --git a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/service/impl/AcsToWmsServiceImpl.java b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/service/impl/AcsToWmsServiceImpl.java index ef6fd39..26ae64b 100644 --- a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/service/impl/AcsToWmsServiceImpl.java +++ b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/service/impl/AcsToWmsServiceImpl.java @@ -199,6 +199,7 @@ public class AcsToWmsServiceImpl implements AcsToWmsService { AbstractTask task = taskFactory.getTask(schBaseTask.getConfig_code()); // 执行创建任务 task.feedbackState(param,schBaseTask,result); + taskService.update(schBaseTask); Map map=new HashMap<>(); map.put("start_point",schBaseTask.getPoint_code1()); map.put("next_point",schBaseTask.getPoint_code2()); diff --git a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/BPSLTask.java b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/BPSLTask.java index 996938d..27a20db 100644 --- a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/BPSLTask.java +++ b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/BPSLTask.java @@ -86,7 +86,8 @@ public class BPSLTask extends AbstractTask { continue; } // 设置起点并修改创建成功状态 - task.setPoint_code1(point.getPoint_code()); + // 取料先去等待点 + task.setPoint_code1(point.getStart_wait_point()); task.setTask_status(TaskStatus.CREATED.getCode()); task.setRemark(""); taskService.update(task); @@ -223,6 +224,5 @@ public class BPSLTask extends AbstractTask { SchBasePoint point = this.findNextPoint(jsonObject); // 设置起点并修改创建成功状态 schBaseTask.setPoint_code1(point.getPoint_code()); - taskService.update(schBaseTask); } } diff --git a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/XSCKTask.java b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/XSCKTask.java index db71194..d92d171 100644 --- a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/XSCKTask.java +++ b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/XSCKTask.java @@ -89,7 +89,8 @@ public class XSCKTask extends AbstractTask { continue; } // 设置起点并修改创建成功状态 - task.setPoint_code1(point.getPoint_code()); + // 取料先去等待点 + task.setPoint_code1(point.getStart_wait_point()); task.setTask_status(TaskStatus.CREATED.getCode()); task.setRemark(""); taskService.update(task); @@ -230,6 +231,11 @@ public class XSCKTask extends AbstractTask { @Override protected void feedbackTaskState(JSONObject param,SchBaseTask schBaseTask, BaseResponse result) { - //todo 重算最优点 + // 重算最优点 + SchBasePoint nextPoint=pointService.getOne(new LambdaQueryWrapper() + .eq(SchBasePoint::getPoint_code, schBaseTask.getPoint_code2())); + SchBasePoint point = this.findNextPoint(nextPoint,JSONObject.parseObject(schBaseTask.getExt_group_data())); + // 设置起点并修改创建成功状态 + schBaseTask.setPoint_code1(point.getPoint_code()); } } \ No newline at end of file diff --git a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/ghs/GHSQHTask.java b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/ghs/GHSQHTask.java index 199e42c..2a549eb 100644 --- a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/ghs/GHSQHTask.java +++ b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/ghs/GHSQHTask.java @@ -6,6 +6,7 @@ import cn.hutool.core.util.IdUtil; import cn.hutool.core.util.ObjectUtil; import com.alibaba.fastjson.JSONObject; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import lombok.SneakyThrows; import lombok.extern.slf4j.Slf4j; import org.nl.common.exception.BadRequestException; import org.nl.config.MapOf; @@ -98,7 +99,8 @@ public class GHSQHTask extends AbstractTask { log.info("未找到当前符合允许放货的缓存点,暂不生成任务Vehicle_type:{}",schBasePoint.getVehicle_type()); return; } - this.createTask(schBasePoint,nextPoint.getPoint_code()); + // 放料先去等待点 + this.createTask(schBasePoint,nextPoint.getNext_wait_point()); } @@ -294,8 +296,16 @@ public class GHSQHTask extends AbstractTask { this.updateStatus(task_code, TaskStatus.CANCELED); } + @SneakyThrows @Override protected void feedbackTaskState(JSONObject param,SchBaseTask schBaseTask, BaseResponse result) { //todo 重算最优点 + SchBasePoint startPoint=pointService.getOne(new LambdaQueryWrapper() + .eq(SchBasePoint::getPoint_code, schBaseTask.getPoint_code1())); + SchBasePoint nextPoint=this.findNextPoint(startPoint); + if(ObjectUtil.isEmpty(nextPoint)){ + throw new Exception("当前起点"+schBaseTask.getPoint_code1()+"未找到合适的放货点位"); + } + schBaseTask.setPoint_code2(nextPoint.getPoint_code()); } } diff --git a/lms/nladmin-ui/src/views/wms/sch/group/index.vue b/lms/nladmin-ui/src/views/wms/sch/group/index.vue index 2b186a1..9d23a3b 100644 --- a/lms/nladmin-ui/src/views/wms/sch/group/index.vue +++ b/lms/nladmin-ui/src/views/wms/sch/group/index.vue @@ -253,6 +253,7 @@ +