From 4599f24b2550a6785f905ef4391473aa8f0a4c70 Mon Sep 17 00:00:00 2001 From: "castle.zang" Date: Thu, 24 Oct 2024 19:24:45 +0800 Subject: [PATCH] =?UTF-8?q?=E9=87=8D=E6=9E=84sps=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../busi/MesPullingOrderInfoService.java | 67 +++++++++++++++++++++- 1 file changed, 65 insertions(+), 2 deletions(-) diff --git a/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/busi/MesPullingOrderInfoService.java b/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/busi/MesPullingOrderInfoService.java index e12b2aa..1bd4511 100644 --- a/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/busi/MesPullingOrderInfoService.java +++ b/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/busi/MesPullingOrderInfoService.java @@ -4,6 +4,8 @@ import cn.estsh.i3plus.ext.mes.pcn.api.busi.IMesConfigService; import cn.estsh.i3plus.ext.mes.pcn.api.busi.IMesNumberRuleMatchDispatchService; import cn.estsh.i3plus.ext.mes.pcn.api.busi.IMesProduceSnExtService; import cn.estsh.i3plus.ext.mes.pcn.api.busi.IMesPullingOrderInfoService; +import cn.estsh.i3plus.ext.mes.pcn.apiservice.model.MesSpsDetailInfo; +import cn.estsh.i3plus.ext.mes.pcn.apiservice.model.MesSpsInfo; import cn.estsh.i3plus.ext.mes.pcn.apiservice.util.MesPcnException; import cn.estsh.i3plus.ext.mes.pcn.pojo.util.MesPcnExtConstWords; import cn.estsh.i3plus.platform.common.convert.ConvertBean; @@ -336,7 +338,38 @@ public class MesPullingOrderInfoService implements IMesPullingOrderInfoService { log.error("没有配置表mes_config,cfg_code为WU_HAN_SPS_CODE,key为WU_HAN_WORK_CENTER_CODE_100 或者 WU_HAN_ORGANIZE_CODE没有配置"); return null; } - return JSON.toJSONString(getPullingOrder(organizeCode, assemblyLine)); + MesPullingOrderInfo pullingOrder = getPullingOrder(organizeCode, assemblyLine); + Map result = new HashMap<>(); + if (pullingOrder != null){ + MesSpsInfo mesSpsInfo = new MesSpsInfo(); + mesSpsInfo.setId(pullingOrder.getId()); + mesSpsInfo.setSeq(pullingOrder.getProductSeq()); + mesSpsInfo.setOrderCode(pullingOrder.getWorkOrderNo()); + mesSpsInfo.setCustOrderCode(pullingOrder.getCustOrderNo()); + + List partList = pullingOrder.getPartList(); + List detailInfoList = new ArrayList<>(); + if (partList !=null && !partList.isEmpty()){ + for (MesPullingOrderPartInfo part : partList) { + MesSpsDetailInfo detailInfo = new MesSpsDetailInfo(); + detailInfo.setPartNo(part.getPartNo()); + detailInfo.setQty(part.getPullQty()); + detailInfo.setPartName(part.getPartName()); + if (part.getLocation().indexOf(",") > 0){ + String[] locations = part.getLocation().split(","); + detailInfo.setSection(locations[0]); + detailInfo.setAddress(locations[1]); + }else { + detailInfo.setAddress(part.getLocation()); + } + detailInfoList.add(detailInfo); + } + } + mesSpsInfo.setPartList(detailInfoList); + result.put("info", mesSpsInfo); + } + + return JSON.toJSONString(result); } @Override @@ -378,7 +411,37 @@ public class MesPullingOrderInfoService implements IMesPullingOrderInfoService { log.error("没有配置表mes_config,cfg_code为WU_HAN_SPS_CODE,key为WU_HAN_WORK_CENTER_CODE_100 或者 WU_HAN_ORGANIZE_CODE没有配置"); return null; } - return JSON.toJSONString(getPullingOrder(organizeCode, assemblyLine)); + MesPullingOrderInfo pullingOrder = getPullingOrder(organizeCode, assemblyLine); + Map result = new HashMap<>(); + if (pullingOrder != null){ + MesSpsInfo mesSpsInfo = new MesSpsInfo(); + mesSpsInfo.setId(pullingOrder.getId()); + mesSpsInfo.setSeq(pullingOrder.getProductSeq()); + mesSpsInfo.setOrderCode(pullingOrder.getWorkOrderNo()); + mesSpsInfo.setCustOrderCode(pullingOrder.getCustOrderNo()); + + List partList = pullingOrder.getPartList(); + List detailInfoList = new ArrayList<>(); + if (partList !=null && !partList.isEmpty()){ + for (MesPullingOrderPartInfo part : partList) { + MesSpsDetailInfo detailInfo = new MesSpsDetailInfo(); + detailInfo.setPartNo(part.getPartNo()); + detailInfo.setQty(part.getPullQty()); + detailInfo.setPartName(part.getPartName()); + if (part.getLocation().indexOf(",") > 0){ + String[] locations = part.getLocation().split(","); + detailInfo.setSection(locations[0]); + detailInfo.setAddress(locations[1]); + }else { + detailInfo.setAddress(part.getLocation()); + } + detailInfoList.add(detailInfo); + } + } + mesSpsInfo.setPartList(detailInfoList); + result.put("info", mesSpsInfo); + } + return JSON.toJSONString(result); } // @Override