From bb8b5f4b987233a259babfea6a65879329b791e5 Mon Sep 17 00:00:00 2001 From: zds <2388969634@qq.com> Date: Wed, 25 Sep 2024 16:11:46 +0800 Subject: [PATCH] =?UTF-8?q?opt:=E6=99=B6=E6=A3=92=E5=BA=93=E5=BA=93?= =?UTF-8?q?=E5=AD=98=E9=A1=B5=E9=9D=A2=E6=96=B0=E5=A2=9E=20=E5=B7=A5?= =?UTF-8?q?=E5=8D=95=E3=80=81=E5=87=BA=E5=BA=93=E7=8A=B6=E6=80=81=E5=AD=97?= =?UTF-8?q?=E6=AE=B5=EF=BC=9Bmes=E4=B8=8B=E5=8F=91=E5=85=A5=E5=BA=93?= =?UTF-8?q?=E3=80=81=E5=B7=A5=E5=8D=95=E5=88=A4=E6=96=AD=E6=98=AF=E5=90=A6?= =?UTF-8?q?=E5=AD=98=E5=9C=A8=EF=BC=8C=E5=B7=B2=E5=AD=98=E5=9C=A8=E6=9B=B4?= =?UTF-8?q?=E6=96=B0=EF=BC=8C=E4=B8=8D=E5=AD=98=E5=9C=A8=E6=96=B0=E5=A2=9E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ext/service/impl/AcsToWmsServiceImpl.java | 2 +- .../nl/wms/mes/controller/MesController.java | 54 +++++++++-- .../service/dao/mapper/ReportMapper.xml | 94 ++++++++++++------- .../nl/wms/sch/report/service/dto/YlDto.java | 4 + .../service/impl/ReportServiceImpl.java | 6 ++ .../src/views/wms/ycl/detail/index.vue | 34 ++++++- 6 files changed, 154 insertions(+), 40 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 3a91556..9e80de5 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 @@ -236,7 +236,7 @@ public class AcsToWmsServiceImpl implements AcsToWmsService { String taskId = param.getString("taskId"); BaseResponse result = BaseResponse.build(requestNo); try { - SchBaseTask schBaseTask=taskService.getById(taskId); + SchBaseTask schBaseTask = taskService.getById(taskId); if(ObjectUtil.isEmpty(schBaseTask)){ throw new BadRequestException("任务不存在!taskId:"+taskId); } diff --git a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/mes/controller/MesController.java b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/mes/controller/MesController.java index 2b878bf..8982946 100644 --- a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/mes/controller/MesController.java +++ b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/mes/controller/MesController.java @@ -7,6 +7,8 @@ import cn.hutool.core.util.ObjectUtil; 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 com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import lombok.extern.slf4j.Slf4j; @@ -15,6 +17,7 @@ import org.nl.wms.mes.domain.*; import org.nl.wms.pdm.service.IPdmBdWorkorderService; import org.nl.wms.pdm.service.dao.PdmBdWorkorder; import org.nl.wms.pdm.service.dao.PdmBdWorkorderDetail; +import org.nl.wms.sch.material.service.IMaterialService; import org.nl.wms.sch.material.service.dao.Material; import org.nl.wms.sch.material.service.dao.mapper.MaterialMapper; import org.nl.wms.sch.task_manage.enums.GroupBindMaterialStatusEnum; @@ -46,6 +49,9 @@ public class MesController { @Autowired private MaterialMapper materialMapper; + @Autowired + private IMaterialService materialService; + @Autowired private IPdmBdWorkorderService pdmBdWorkorderService; @@ -74,13 +80,32 @@ public class MesController { head.setSRC_SYSTEM("AGV"); qpmes060Response.setHEAD(head); try { - Material material = new Material(); for(QPMES060RequestBody QPMES060RequestBody:notice.toJavaObject(QPMES060Request.class).getBODY()) { + Material material = new Material(); + //实体类 material.copyFrom(QPMES060RequestBody); - material.setGroup_bind_material_status(GroupBindMaterialStatusEnum.BOUND.getValue()); - material.setReturn_status("0"); - material.setCreate_time(DateUtil.now()); - materialMapper.insert(material); + String lotSN = material.getLotSN(); + if(ObjectUtil.isNotEmpty(lotSN)){ + Material entity = materialService.getOne(new LambdaQueryWrapper() + .eq(Material::getLotSN, lotSN)); + if (ObjectUtil.isEmpty(entity)){ + //新增 + material.setGroup_bind_material_status(GroupBindMaterialStatusEnum.BOUND.getValue()); + material.setReturn_status("0"); + material.setCreate_time(DateUtil.now()); + materialMapper.insert(material); + }else{ + LambdaUpdateWrapper updateWrapper = new LambdaUpdateWrapper<>(); + updateWrapper.eq(Material::getLotSN,lotSN); + //更新 + material.setGroup_bind_material_status(entity.getGroup_bind_material_status()); + material.setReturn_status(entity.getReturn_status()); + material.setCreate_time(DateUtil.now()); + materialService.update(material,updateWrapper); + } + }else{ + log.error("原材料入库晶棒号为空,{}", material.toString()); + } } qpmes060ResponseBody.setMESSAGE("原材料入库成功"); qpmes060ResponseBody.setSTATUS("S"); @@ -214,7 +239,24 @@ public class MesController { try { Workorder workorder = new Workorder(); workorder.copyFrom(temp); - workorderService.create(workorder); + String lotSN = workorder.getLotSN(); + if(ObjectUtil.isNotEmpty(lotSN)){ + Workorder entity = workorderService.getOne(new LambdaQueryWrapper() + .eq(Workorder::getLotSN, lotSN)); + if (ObjectUtil.isEmpty(entity)){ + //新增 + workorderService.create(workorder); + }else{ + LambdaUpdateWrapper updateWrapper = new LambdaUpdateWrapper<>(); + updateWrapper.eq(Workorder::getLotSN,lotSN); + //更新 + workorder.setMode(entity.getMode()); + workorder.setStatus(entity.getStatus()); + workorderService.update(workorder,updateWrapper); + } + }else{ + log.error("工单晶棒号为空,{}", workorder.toString()); + } } catch (Exception e) { log.error("工单已存在导致新增失败,{}{}", e, e.getMessage()); } diff --git a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/report/service/dao/mapper/ReportMapper.xml b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/report/service/dao/mapper/ReportMapper.xml index 379591e..3eaa9b4 100644 --- a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/report/service/dao/mapper/ReportMapper.xml +++ b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/report/service/dao/mapper/ReportMapper.xml @@ -40,40 +40,70 @@