diff --git a/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/model/MesSpsDetailInfo.java b/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/model/MesSpsDetailInfo.java new file mode 100644 index 0000000..2458e90 --- /dev/null +++ b/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/model/MesSpsDetailInfo.java @@ -0,0 +1,55 @@ +package cn.estsh.i3plus.ext.mes.pcn.apiservice.model; + + +public class MesSpsDetailInfo { + private String PartNo; + + private String PartName; + + private Double Qty; + + private String Section; + + private String Address; + + + public String getPartNo() { + return PartNo; + } + + public void setPartNo(String partNo) { + PartNo = partNo; + } + + public String getPartName() { + return PartName; + } + + public void setPartName(String partName) { + PartName = partName; + } + + public Double getQty() { + return Qty; + } + + public void setQty(Double qty) { + Qty = qty; + } + + public String getSection() { + return Section; + } + + public void setSection(String section) { + Section = section; + } + + public String getAddress() { + return Address; + } + + public void setAddress(String address) { + Address = address; + } +} diff --git a/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/model/MesSpsInfo.java b/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/model/MesSpsInfo.java new file mode 100644 index 0000000..4b27cd0 --- /dev/null +++ b/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/model/MesSpsInfo.java @@ -0,0 +1,55 @@ +package cn.estsh.i3plus.ext.mes.pcn.apiservice.model; + +import java.util.List; + +public class MesSpsInfo { + private Long id; + + private String OrderCode; + + private String CustOrderCode; + + private Long Seq; + + private List PartList; + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getOrderCode() { + return OrderCode; + } + + public void setOrderCode(String orderCode) { + OrderCode = orderCode; + } + + public String getCustOrderCode() { + return CustOrderCode; + } + + public void setCustOrderCode(String custOrderCode) { + CustOrderCode = custOrderCode; + } + + public Long getSeq() { + return Seq; + } + + public void setSeq(Long seq) { + Seq = seq; + } + + public List getPartList() { + return PartList; + } + + public void setPartList(List partList) { + PartList = partList; + } +} 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 7a98bc6..eab8998 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; @@ -346,7 +348,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 @@ -388,7 +421,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