From 5cd48094dd3e942ad247483fa5adc8d6a9662658 Mon Sep 17 00:00:00 2001 From: zds <2388969634@qq.com> Date: Wed, 28 Aug 2024 10:33:48 +0800 Subject: [PATCH] =?UTF-8?q?fix:=E4=BF=AE=E6=94=B9=E4=B8=8B=E5=8F=91acs?= =?UTF-8?q?=E4=BB=BB=E5=8A=A1=E6=97=B6=EF=BC=8C=E6=9C=AA=E5=88=A4=E6=96=AD?= =?UTF-8?q?=E8=AF=B7=E6=B1=82=E6=98=AF=E5=90=A6=E6=88=90=E5=8A=9F=E7=9A=84?= =?UTF-8?q?Bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../sch/task_manage/task/tasks/KJRKTask.java | 31 +++++++++---- .../sch/task_manage/task/tasks/POINTTask.java | 46 ++++++++++++------- .../task_manage/task/tasks/SSXBKJTask.java | 33 ++++++++----- .../sch/task_manage/task/tasks/YCLCKTask.java | 41 +++++++++++------ .../sch/task_manage/task/tasks/YCLRKTask.java | 39 ++++++++++------ .../src/views/wms/sch/task/index.vue | 6 +-- 6 files changed, 128 insertions(+), 68 deletions(-) diff --git a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/KJRKTask.java b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/KJRKTask.java index 5556758..d45445f 100644 --- a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/KJRKTask.java +++ b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/KJRKTask.java @@ -1,5 +1,6 @@ package org.nl.wms.sch.task_manage.task.tasks; +import cn.hutool.core.bean.BeanUtil; import cn.hutool.core.date.DateUtil; import cn.hutool.core.util.ObjectUtil; import com.alibaba.druid.util.StringUtils; @@ -84,18 +85,28 @@ public class KJRKTask extends AbstractTask { continue; } } + //复制对象 + SchBaseTask acs_task = BeanUtil.copyProperties(task,SchBaseTask.class); // 设置终点并修改创建成功状态 - task.setPoint_code2(point.getPoint_code()); - task.setTask_status(TaskStatus.CREATED.getCode()); - task.setRemark("下发"); - taskService.update(task); - - //发起任务时先把点位占用,防止发起重复任务 - point.setIng_task_code(task.getTask_code()); - pointService.update(point); - + acs_task.setPoint_code2(point.getPoint_code()); //下发 - this.renotifyAcs(task); + JSONObject result = this.renotifyAcs(acs_task); + String status = result.getString("status"); + //下发成功 + if("200".equals(status)){ + task.setTask_status(TaskStatus.CREATED.getCode()); + task.setRemark("下发"); + task.setPoint_code2(point.getPoint_code()); + taskService.update(task); + + //发起任务时先把点位占用,防止发起重复任务 + point.setIng_task_code(task.getTask_code()); + pointService.update(point); + now_num++; + }else{ + task.setRemark("下发acs失败:"+result.toString()); + taskService.update(task); + } } } diff --git a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/POINTTask.java b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/POINTTask.java index 0d7f4d7..865ae43 100644 --- a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/POINTTask.java +++ b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/POINTTask.java @@ -1,5 +1,6 @@ package org.nl.wms.sch.task_manage.task.tasks; +import cn.hutool.core.bean.BeanUtil; import cn.hutool.core.date.DateUtil; import cn.hutool.core.lang.Assert; import cn.hutool.core.util.ObjectUtil; @@ -102,25 +103,36 @@ public class POINTTask extends AbstractTask { continue; } } - task.setTask_status(TaskStatus.CREATED.getCode()); - task.setVehicle_code(schBasePoint.getVehicle_code()); - task.setVehicle_code2(schBasePoint.getVehicle_code2()); - task.setRemark("下发"); - taskService.update(task); + //复制对象 + SchBaseTask acs_task = BeanUtil.copyProperties(task,SchBaseTask.class); + acs_task.setVehicle_code(schBasePoint.getVehicle_code()); + acs_task.setVehicle_code2(schBasePoint.getVehicle_code2()); + //下发 + JSONObject result = this.renotifyAcs(acs_task); + String status = result.getString("status"); + //下发成功 + if("200".equals(status)){ + task.setTask_status(TaskStatus.CREATED.getCode()); + task.setRemark("下发"); + task.setVehicle_code(schBasePoint.getVehicle_code()); + task.setVehicle_code2(schBasePoint.getVehicle_code2()); + taskService.update(task); - //发起任务时先把点位占用,防止发起重复任务 - schBasePoint.setIng_task_code(task.getTask_code()); - pointService.update(schBasePoint); - nextSchBasePoint.setIng_task_code(task.getTask_code()); - pointService.update(nextSchBasePoint); - //去回温库的任务,更细工单表 - if(nextSchBasePoint.getPoint_code().contains("XHW")){ - //pdm_bd_workorder_two任务完成时,status改为2出库中 - workorderService.update(schBasePoint.getVehicle_code2(),"2"); + //发起任务时先把点位占用,防止发起重复任务 + schBasePoint.setIng_task_code(task.getTask_code()); + pointService.update(schBasePoint); + nextSchBasePoint.setIng_task_code(task.getTask_code()); + pointService.update(nextSchBasePoint); + //去回温库的任务,更细工单表 + if(nextSchBasePoint.getPoint_code().contains("XHW")){ + //pdm_bd_workorder_two任务完成时,status改为2出库中 + workorderService.update(schBasePoint.getVehicle_code2(),"2"); + } + now_num++; + }else{ + task.setRemark("下发acs失败:"+result.toString()); + taskService.update(task); } - //下发 - this.renotifyAcs(task); - now_num++; } } diff --git a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/SSXBKJTask.java b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/SSXBKJTask.java index fac17c9..15b058b 100644 --- a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/SSXBKJTask.java +++ b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/SSXBKJTask.java @@ -1,5 +1,6 @@ package org.nl.wms.sch.task_manage.task.tasks; +import cn.hutool.core.bean.BeanUtil; import cn.hutool.core.date.DateUtil; import cn.hutool.core.util.ObjectUtil; import com.alibaba.druid.util.StringUtils; @@ -84,18 +85,28 @@ public class SSXBKJTask extends AbstractTask { continue; } } - // 设置起点并修改创建成功状态 - task.setPoint_code1(point.getPoint_code()); - task.setTask_status(TaskStatus.CREATED.getCode()); - task.setRemark("下发"); - taskService.update(task); - - //发起任务时先把点位占用,防止发起重复任务 - point.setIng_task_code(task.getTask_code()); - pointService.update(point); + //复制对象 + SchBaseTask acs_task = BeanUtil.copyProperties(task,SchBaseTask.class); + acs_task.setPoint_code1(point.getPoint_code()); //下发 - this.renotifyAcs(task); - now_num++; + JSONObject result = this.renotifyAcs(acs_task); + String status = result.getString("status"); + //下发成功 + if("200".equals(status)){ + // 设置起点并修改创建成功状态 + task.setTask_status(TaskStatus.CREATED.getCode()); + task.setRemark("下发"); + task.setPoint_code1(point.getPoint_code()); + taskService.update(task); + + //发起任务时先把点位占用,防止发起重复任务 + point.setIng_task_code(task.getTask_code()); + pointService.update(point); + now_num++; + }else{ + task.setRemark("下发acs失败:"+result.toString()); + taskService.update(task); + } } } } diff --git a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/YCLCKTask.java b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/YCLCKTask.java index cfaf4bf..842eaf3 100644 --- a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/YCLCKTask.java +++ b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/YCLCKTask.java @@ -1,5 +1,6 @@ package org.nl.wms.sch.task_manage.task.tasks; +import cn.hutool.core.bean.BeanUtil; import cn.hutool.core.date.DateTime; import cn.hutool.core.date.DateUtil; import cn.hutool.core.util.IdUtil; @@ -123,24 +124,36 @@ public class YCLCKTask extends AbstractTask { continue; } } + //复制对象 + SchBaseTask acs_task = BeanUtil.copyProperties(task,SchBaseTask.class); // 设置终点并修改创建成功状态 - task.setPoint_code2(point.getPoint_code()); - task.setTask_status(TaskStatus.CREATED.getCode()); - task.setRemark("任务下发"); + acs_task.setPoint_code2(point.getPoint_code()); SchBasePoint schBasePoint = pointService.getOne(new LambdaQueryWrapper() .eq(SchBasePoint::getPoint_code, task.getPoint_code1())); - task.setVehicle_code(schBasePoint.getVehicle_code()); - task.setVehicle_code2(schBasePoint.getVehicle_code2()); - taskService.update(task); - - //发起任务时先把点位占用,防止发起重复任务 - point.setIng_task_code(task.getTask_code()); - pointService.update(point); - //pdm_bd_workorder_two任务下发时,status改为2 - workorderService.update(schBasePoint.getVehicle_code2(),"2"); + acs_task.setVehicle_code(schBasePoint.getVehicle_code()); + acs_task.setVehicle_code2(schBasePoint.getVehicle_code2()); //下发 - this.renotifyAcs(task); - now_num++; + JSONObject result = this.renotifyAcs(acs_task); + String status = result.getString("status"); + //下发成功 + if("200".equals(status)){ + // 设置终点并修改创建成功状态 + task.setTask_status(TaskStatus.CREATED.getCode()); + task.setRemark("任务下发"); + task.setPoint_code2(point.getPoint_code()); + task.setVehicle_code(schBasePoint.getVehicle_code()); + task.setVehicle_code2(schBasePoint.getVehicle_code2()); + taskService.update(task); + //发起任务时先把点位占用,防止发起重复任务 + point.setIng_task_code(task.getTask_code()); + pointService.update(point); + //pdm_bd_workorder_two任务下发时,status改为2 + workorderService.update(schBasePoint.getVehicle_code2(),"2"); + now_num++; + }else{ + task.setRemark("下发acs失败:"+result.toString()); + taskService.update(task); + } } } } diff --git a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/YCLRKTask.java b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/YCLRKTask.java index 56c30db..f943493 100644 --- a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/YCLRKTask.java +++ b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/YCLRKTask.java @@ -1,5 +1,6 @@ package org.nl.wms.sch.task_manage.task.tasks; +import cn.hutool.core.bean.BeanUtil; import cn.hutool.core.date.DateTime; import cn.hutool.core.date.DateUtil; import cn.hutool.core.util.IdUtil; @@ -115,20 +116,32 @@ public class YCLRKTask extends AbstractTask { continue; } } - // 设置终点并修改创建成功状态 - task.setPoint_code2(point.getPoint_code()); - task.setTask_status(TaskStatus.CREATED.getCode()); - task.setVehicle_code(jsonObject.getString("mother_tray")); - task.setVehicle_code2(jsonObject.getString("sub_tray")); - task.setRemark("下发"); - taskService.update(task); - - //发起任务时先把点位占用,防止发起重复任务 - point.setIng_task_code(task.getTask_code()); - pointService.update(point); + //复制对象 + SchBaseTask acs_task = BeanUtil.copyProperties(task,SchBaseTask.class); + acs_task.setPoint_code2(point.getPoint_code()); + acs_task.setVehicle_code(jsonObject.getString("mother_tray")); + acs_task.setVehicle_code2(jsonObject.getString("sub_tray")); //下发 - this.renotifyAcs(task); - now_num++; + JSONObject result = this.renotifyAcs(acs_task); + String status = result.getString("status"); + //下发成功 + if("200".equals(status)){ + // 设置终点并修改创建成功状态 + task.setTask_status(TaskStatus.CREATED.getCode()); + task.setRemark("下发"); + task.setPoint_code2(point.getPoint_code()); + task.setVehicle_code(jsonObject.getString("mother_tray")); + task.setVehicle_code2(jsonObject.getString("sub_tray")); + taskService.update(task); + + //发起任务时先把点位占用,防止发起重复任务 + point.setIng_task_code(task.getTask_code()); + pointService.update(point); + now_num++; + }else{ + task.setRemark("下发acs失败:"+result.toString()); + taskService.update(task); + } } } } diff --git a/lms/nladmin-ui/src/views/wms/sch/task/index.vue b/lms/nladmin-ui/src/views/wms/sch/task/index.vue index 3d6a8f5..913bf33 100644 --- a/lms/nladmin-ui/src/views/wms/sch/task/index.vue +++ b/lms/nladmin-ui/src/views/wms/sch/task/index.vue @@ -76,12 +76,12 @@ - + - + @@ -91,10 +91,10 @@ {{ getStatusName(scope.row.task_status) }} - +