From 22028e17471fbd105838fcd8ff2b2484d4bd3c34 Mon Sep 17 00:00:00 2001 From: zds <2388969634@qq.com> Date: Tue, 10 Sep 2024 10:23:40 +0800 Subject: [PATCH] =?UTF-8?q?opt:=E4=BC=98=E5=8C=96=E6=89=8B=E6=8C=81?= =?UTF-8?q?=E5=8E=9F=E6=9D=90=E6=96=99=E5=85=A5=E5=BA=93=E5=8A=9F=E8=83=BD?= =?UTF-8?q?=E3=80=81=E4=BC=98=E5=8C=96=E7=82=B9=E5=AF=B9=E7=82=B9=E6=90=AC?= =?UTF-8?q?=E8=BF=90=E4=BB=BB=E5=8A=A1=E7=BB=84=E7=9B=98=E8=AE=B0=E5=BD=95?= =?UTF-8?q?=E5=A4=84=E7=90=86=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../nl/wms/pda/controller/PdaController.java | 2 +- ...chBaseVehiclematerialgroupServiceImpl.java | 1 + .../sch/task_manage/task/tasks/POINTTask.java | 44 ++++++++++++++++--- 3 files changed, 40 insertions(+), 7 deletions(-) diff --git a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/pda/controller/PdaController.java b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/pda/controller/PdaController.java index 9f1484a..79d639c 100644 --- a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/pda/controller/PdaController.java +++ b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/pda/controller/PdaController.java @@ -60,7 +60,7 @@ public class PdaController { region.setVehicle_qty(0); } } - if("KJ".equals(whereJson.get("region_code"))){ + if("KJ".equals(whereJson.get("region_code")) || "SSX".equals(whereJson.get("region_code"))){ region.setVehicle_qty(null); } return new ResponseEntity<>(pointService.getPointListByPda(region), HttpStatus.OK); diff --git a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/group/service/impl/SchBaseVehiclematerialgroupServiceImpl.java b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/group/service/impl/SchBaseVehiclematerialgroupServiceImpl.java index 402955f..8b24d8e 100644 --- a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/group/service/impl/SchBaseVehiclematerialgroupServiceImpl.java +++ b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/group/service/impl/SchBaseVehiclematerialgroupServiceImpl.java @@ -73,6 +73,7 @@ public class SchBaseVehiclematerialgroupServiceImpl extends ServiceImpl updateWrapper = new UpdateWrapper<>(); updateWrapper.eq("vehicle_code",entity.getVehicle_code()); 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 27ff4d2..cad949b 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,11 +1,16 @@ 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.lang.Assert; +import cn.hutool.core.util.IdUtil; import cn.hutool.core.util.ObjectUtil; +import cn.hutool.http.HttpRequest; +import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSONObject; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; import lombok.extern.slf4j.Slf4j; import org.apache.commons.lang.StringUtils; import org.nl.common.exception.BadRequestException; @@ -13,8 +18,13 @@ import org.nl.system.service.param.ISysParamService; import org.nl.system.service.param.dao.Param; import org.nl.wms.ext.service.WmsToAcsService; import org.nl.wms.ext.service.dto.to.BaseResponse; +import org.nl.wms.mes.domain.Head; +import org.nl.wms.mes.domain.QPMES062Request; +import org.nl.wms.mes.domain.QPMES062RequestBody; +import org.nl.wms.sch.data.service.dto.MaterialDataDto; import org.nl.wms.sch.group.service.ISchBaseVehiclematerialgroupService; import org.nl.wms.sch.group.service.dao.SchBaseVehiclematerialgroup; +import org.nl.wms.sch.material.service.dao.Material; import org.nl.wms.sch.point.service.ISchBasePointService; import org.nl.wms.sch.point.service.dao.SchBasePoint; import org.nl.wms.sch.task.service.ISchBaseTaskService; @@ -32,7 +42,12 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.context.annotation.Lazy; import org.springframework.stereotype.Component; +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.Iterator; import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; /** * @Author: psh @@ -179,6 +194,10 @@ public class POINTTask extends AbstractTask { if (taskObj.getTask_status().equals(TaskStatus.CANCELED.getCode())) { throw new BadRequestException("该任务已取消!"); } + // 获取参数 + JSONObject extGroupData = ObjectUtil.isNotEmpty(taskObj.getExt_group_data()) + ? JSONObject.parseObject(taskObj.getExt_group_data()) + : null; String startPoint = taskObj.getPoint_code1(); // 获取起点 String endPoint = taskObj.getPoint_code2(); // 获取终点 if(endPoint.startsWith("DKT")){ @@ -192,8 +211,8 @@ public class POINTTask extends AbstractTask { taskObj.setRemark("执行中"); } if (status.equals(TaskStatus.FINISHED)) { // 完成 - String vehicleCode=taskObj.getVehicle_code(); - String vehicleCode2= taskObj.getVehicle_code2(); + String vehicleCode = taskObj.getVehicle_code(); + String vehicleCode2 = taskObj.getVehicle_code2(); SchBaseVehiclematerialgroup one =null; //母托盘更新组盘信息 if(StringUtils.isNotEmpty(vehicleCode)) { @@ -205,7 +224,11 @@ public class POINTTask extends AbstractTask { one.setPoint_code(endPointObj.getPoint_code()); // 当前位置 one.setPoint_name(endPointObj.getPoint_name()); one.setMove_way(one.getMove_way() == null ? "" : (one.getMove_way() + " -> ") + endPointObj.getPoint_code()); - one.setGroup_bind_material_status(GroupBindMaterialStatusEnum.UNBOUND.getValue()); + one.setGroup_bind_material_status(GroupBindMaterialStatusEnum.BOUND.getValue()); + //拆包位需解绑组盘记录 + if(endPointObj.getRegion_code().contains("CB")){ + one.setGroup_bind_material_status(GroupBindMaterialStatusEnum.UNBOUND.getValue()); + } one.setUpdate_id(GeneralDefinition.ACS_ID); one.setUpdate_name(GeneralDefinition.ACS_NAME); one.setUpdate_time(DateUtil.now()); @@ -222,13 +245,18 @@ public class POINTTask extends AbstractTask { one.setPoint_code(endPointObj.getPoint_code()); // 当前位置 one.setPoint_name(endPointObj.getPoint_name()); one.setMove_way(one.getMove_way() == null ? "" : (one.getMove_way() + " -> ") + endPointObj.getPoint_code()); - one.setGroup_bind_material_status(GroupBindMaterialStatusEnum.UNBOUND.getValue()); + one.setGroup_bind_material_status(GroupBindMaterialStatusEnum.BOUND.getValue()); + //拆包位需解绑组盘记录 + if(endPointObj.getRegion_code().contains("CB")){ + one.setGroup_bind_material_status(GroupBindMaterialStatusEnum.UNBOUND.getValue()); + } one.setUpdate_id(GeneralDefinition.ACS_ID); one.setUpdate_name(GeneralDefinition.ACS_NAME); one.setUpdate_time(DateUtil.now()); vehiclematerialgroupService.updateByJson(one); } - if(endPointObj.getPoint_code().contains("XHW")){ + //工单出库任务更新工单记录 + if(endPointObj.getRegion_code().contains("HW")){ //pdm_bd_workorder_two任务完成时,status改为3 workorderService.update(vehicleCode2,"3"); } @@ -237,6 +265,9 @@ public class POINTTask extends AbstractTask { endPointObj.setIng_task_code(""); endPointObj.setVehicle_code(taskObj.getVehicle_code()); endPointObj.setVehicle_code2(taskObj.getVehicle_code2()); + if(extGroupData.containsKey("weight")){ + endPointObj.setMaterial_weight(extGroupData.getBigDecimal("weight")); + } if(endPointObj.getPoint_code().startsWith("DKT")){ //叠盘机数量由acs同步,无需维护 // endPointObj.setVehicle_qty(endPointObj.getVehicle_qty()+1); @@ -256,7 +287,8 @@ public class POINTTask extends AbstractTask { taskObj.setGroup_id(ObjectUtil.isNotEmpty(one)?one.getGroup_id():null); taskObj.setRemark("任务完成"); } - if (status.equals(TaskStatus.CANCELED)) { // 取消 + // 取消 + if (status.equals(TaskStatus.CANCELED)) { // 终点解锁 if (ObjectUtil.isNotEmpty(endPointObj)) { endPointObj.setIng_task_code("");