From 694ed06b59bc1d02dcf0dc5de229cd230898ee8d Mon Sep 17 00:00:00 2001 From: "castle.zang" Date: Wed, 20 Nov 2024 23:14:32 +0800 Subject: [PATCH 1/5] =?UTF-8?q?=E5=AE=A2=E6=88=B7=E9=9B=B6=E4=BB=B6?= =?UTF-8?q?=E5=8F=B7=E9=9C=80=E8=A6=81=E4=BB=8E=E9=9B=B6=E4=BB=B6=E7=94=9F?= =?UTF-8?q?=E4=BA=A7=E7=BB=84=E4=B8=AD=E8=8E=B7=E5=8F=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mes/apiservice/serviceimpl/busi/MesCreateWorkOrderImpl.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/modules/i3plus-ext-mes-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/apiservice/serviceimpl/busi/MesCreateWorkOrderImpl.java b/modules/i3plus-ext-mes-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/apiservice/serviceimpl/busi/MesCreateWorkOrderImpl.java index f0136f8..9b4ce05 100644 --- a/modules/i3plus-ext-mes-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/apiservice/serviceimpl/busi/MesCreateWorkOrderImpl.java +++ b/modules/i3plus-ext-mes-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/apiservice/serviceimpl/busi/MesCreateWorkOrderImpl.java @@ -270,7 +270,12 @@ public class MesCreateWorkOrderImpl implements IMesCreateWorkOrder { Calendar custCalendar = Calendar.getInstance(); custCalendar.setTime(new Date()); GenSerialNoModel custGenSerialNoModel = new GenSerialNoModel("WH_CUST_SN_RULE"); - String partNo = mesWorkOrder.getCustPartNo(); +// String partNo = mesWorkOrder.getCustPartNo(); + /** + * 2024/11/20 + * 客户零件号需要从零件生产组中获取 + */ + String partNo = mesPartProdGroupDetail.getCustPartNo(); String prefix = partNo.substring(0, partNo.length() - 4); String partNo4 = partNo.substring(partNo.length() - 4).toUpperCase(); custGenSerialNoModel.setPartNo(prefix + partNo4); From bcabf203137529f13a824511eff95e9355c564c3 Mon Sep 17 00:00:00 2001 From: "castle.zang" Date: Thu, 21 Nov 2024 17:13:48 +0800 Subject: [PATCH 2/5] =?UTF-8?q?=E5=A6=82=E6=9E=9C=E8=A3=85=E9=85=8D?= =?UTF-8?q?=E4=BB=B6=E6=9C=89=E5=B1=95=E7=A4=BA=E9=A1=BA=E5=BA=8F=EF=BC=8C?= =?UTF-8?q?=E5=9C=A8ptr=E6=9B=BF=E6=8D=A2=E6=98=AF=E9=9C=80=E8=A6=81?= =?UTF-8?q?=E6=9B=BF=E6=8D=A2=E7=9B=AE=E8=A7=86=E9=A1=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mes/apiservice/serviceimpl/busi/MesCreateWorkOrderImpl.java | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/modules/i3plus-ext-mes-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/apiservice/serviceimpl/busi/MesCreateWorkOrderImpl.java b/modules/i3plus-ext-mes-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/apiservice/serviceimpl/busi/MesCreateWorkOrderImpl.java index 9b4ce05..70b0652 100644 --- a/modules/i3plus-ext-mes-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/apiservice/serviceimpl/busi/MesCreateWorkOrderImpl.java +++ b/modules/i3plus-ext-mes-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/apiservice/serviceimpl/busi/MesCreateWorkOrderImpl.java @@ -17,6 +17,7 @@ import cn.estsh.i3plus.pojo.mes.repository.*; import cn.estsh.i3plus.pojo.mes.util.MesExtEnumUtil; import lombok.extern.slf4j.Slf4j; import org.apache.commons.lang.StringUtils; +import org.apache.logging.log4j.util.Strings; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Propagation; @@ -438,7 +439,14 @@ public class MesCreateWorkOrderImpl implements IMesCreateWorkOrder { orderAssemblyList = orderAssembly; } } + /** + * 原pisces逻辑 + * add by aix 2017.4.11 增加根据PTR维护页面维护的目视单显示项来替换WORKORDERASSEMBLY中的partdesc + */ if (!Objects.isNull(orderAssemblyList)){ + if (orderAssemblyList.getDisplaySeq()!=null && orderAssemblyList.getDisplaySeq()!=0){ + orderAssemblyList.setDisplayValue(mesPartPtr.getVisualItem()); + } orderAssemblyList.setAssemblyPartNo(mesPartSap.getPartNo()); orderAssemblyList.setAssemblyPartName(mesPartSap.getPartName()); orderAssemblyList.setMatchRule(mesPartPtr.getReplacePartSnRule()); @@ -482,6 +490,7 @@ public class MesCreateWorkOrderImpl implements IMesCreateWorkOrder { workOrderPartRao.saveAll(workOrderPartList); mesWorkOrder.setProductSeq(productSeq); mesWorkOrder.setPartProdGroupName(partProdGroup.getPartProdGroupName()); + mesWorkOrder.setPtrInfo(ptrInfos.toString()); ConvertBean.saveOrUpdate(mesWorkOrder, "MES-JOB"); mesWorkOrderRao.insert(mesWorkOrder); /** From 5432c0400c5140c4aaa0321d7d173ed778a32536 Mon Sep 17 00:00:00 2001 From: "castle.zang" Date: Thu, 21 Nov 2024 17:16:35 +0800 Subject: [PATCH 3/5] =?UTF-8?q?=E5=A6=82=E6=9E=9C=E8=A3=85=E9=85=8D?= =?UTF-8?q?=E4=BB=B6=E6=9C=89=E5=B1=95=E7=A4=BA=E9=A1=BA=E5=BA=8F=EF=BC=8C?= =?UTF-8?q?=E5=9C=A8ptr=E6=9B=BF=E6=8D=A2=E6=98=AF=E9=9C=80=E8=A6=81?= =?UTF-8?q?=E6=9B=BF=E6=8D=A2=E7=9B=AE=E8=A7=86=E9=A1=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../strategy/AssemblyVisualListPrintStrategy.java | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/modules/i3plus-ext-mes-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/apiservice/serviceimpl/print/strategy/AssemblyVisualListPrintStrategy.java b/modules/i3plus-ext-mes-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/apiservice/serviceimpl/print/strategy/AssemblyVisualListPrintStrategy.java index 8d85ef2..5169df9 100644 --- a/modules/i3plus-ext-mes-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/apiservice/serviceimpl/print/strategy/AssemblyVisualListPrintStrategy.java +++ b/modules/i3plus-ext-mes-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/apiservice/serviceimpl/print/strategy/AssemblyVisualListPrintStrategy.java @@ -79,13 +79,28 @@ public class AssemblyVisualListPrintStrategy implements IPrintTemplateStrategySe // 总个数 Integer totalCount = partProdGroup.getTotalCount(); + Map> collect = workOrderAssemblyList.stream().collect(Collectors.groupingBy(MesWorkOrderAssembly::getDisplaySeq)); // 为空时显示内容 String isNullViewContent = StringUtils.isEmpty(partProdGroup.getIsNullViewContent()) ? "" : partProdGroup.getIsNullViewContent(); - for (Integer index = 0; index < totalCount; index++) { - String displayValue = workOrderAssemblyList.size() -1 < index ? isNullViewContent : workOrderAssemblyList.get(index).getDisplayValue(); + for (int index = 0; index < collect.size(); index++) { + List orderAssemblyList = collect.get(index+1); + List disPlayValues = orderAssemblyList.stream().map(MesWorkOrderAssembly::getDisplayValue).distinct().collect(Collectors.toList()); + String displayValue =isNullViewContent; + if(!disPlayValues.isEmpty()){ + displayValue = String.join("\r\n", disPlayValues); + } + // String displayValue = workOrderAssemblyList.size() -1 < index ? isNullViewContent : workOrderAssemblyList.get(index).getDisplayValue(); - resultMap.put(MesExtConstWords.ASSEMBLY_PARAM + (index+1), StringUtils.isEmpty(displayValue) ? StringUtils.isEmpty(isNullViewContent) ? "" : null : displayValue); +// resultMap.put(MesPcnExtConstWords.ASSEMBLY_PARAM + (index+1), StringUtils.isEmpty(displayValue) ? StringUtils.isEmpty(isNullViewContent) ? "" : isNullViewContent : displayValue); + resultMap.put(MesExtConstWords.ASSEMBLY_PARAM + (index+1), displayValue); } + // 为空时显示内容 +// String isNullViewContent = StringUtils.isEmpty(partProdGroup.getIsNullViewContent()) ? "" : partProdGroup.getIsNullViewContent(); +// for (Integer index = 0; index < totalCount; index++) { +// String displayValue = workOrderAssemblyList.size() -1 < index ? isNullViewContent : workOrderAssemblyList.get(index).getDisplayValue(); +// +// resultMap.put(MesExtConstWords.ASSEMBLY_PARAM + (index+1), StringUtils.isEmpty(displayValue) ? StringUtils.isEmpty(isNullViewContent) ? "" : null : displayValue); +// } printDataMapList.add(resultMap); From 2854686ddec90b372896caabb1a673092f57b7dd Mon Sep 17 00:00:00 2001 From: "castle.zang" Date: Fri, 22 Nov 2024 08:22:47 +0800 Subject: [PATCH 4/5] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E7=9C=8B=E6=9D=BF?= =?UTF-8?q?=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../busi/MesEarlyWarningServiceImpl.java | 31 +++++++++++++--------- 1 file changed, 19 insertions(+), 12 deletions(-) diff --git a/modules/i3plus-ext-mes-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/apiservice/serviceimpl/busi/MesEarlyWarningServiceImpl.java b/modules/i3plus-ext-mes-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/apiservice/serviceimpl/busi/MesEarlyWarningServiceImpl.java index 556b1ef..12d07bf 100644 --- a/modules/i3plus-ext-mes-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/apiservice/serviceimpl/busi/MesEarlyWarningServiceImpl.java +++ b/modules/i3plus-ext-mes-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/apiservice/serviceimpl/busi/MesEarlyWarningServiceImpl.java @@ -262,15 +262,18 @@ public class MesEarlyWarningServiceImpl implements IMesEarlyWarningService { //先查对列表,找到对应产线工位的工单 List queueOrderList = queueOrderRao.findByHqlTopWhere(queueOrderPackBean,1); //过滤掉关闭和拆解的工单 - List orderStatusList1 = new ArrayList<>(); - orderStatusList1.add(MesExtEnumUtil.ORDER_STATUS.RELEASE.getValue()); - orderStatusList1.add(MesExtEnumUtil.ORDER_STATUS.PROCESS.getValue()); - List workOrderNoQueueList = queueOrderList.stream().map(MesQueueOrder::getWorkOrderNo).distinct().collect(Collectors.toList()); - DdlPackBean orderPackBean = DdlPackBean.getDdlPackBean(organizeCode); - DdlPreparedPack.getInPackList(workOrderNoQueueList,"workOrderNo",orderPackBean); - DdlPreparedPack.getInPackList(orderStatusList1,"workOrderStatus",orderPackBean); - DdlPreparedPack.getOrderBy("productSeq",CommonEnumUtil.ASC_OR_DESC.ASC.getValue(), orderPackBean); - List workOrderList = workOrderRao.findByHqlTopWhere(orderPackBean, 1); + List workOrderList = new ArrayList<>(); + if (!queueOrderList.isEmpty()){ + List orderStatusList1 = new ArrayList<>(); + orderStatusList1.add(MesExtEnumUtil.ORDER_STATUS.RELEASE.getValue()); + orderStatusList1.add(MesExtEnumUtil.ORDER_STATUS.PROCESS.getValue()); + List workOrderNoQueueList = queueOrderList.stream().map(MesQueueOrder::getWorkOrderNo).distinct().collect(Collectors.toList()); + DdlPackBean orderPackBean = DdlPackBean.getDdlPackBean(organizeCode); + DdlPreparedPack.getInPackList(workOrderNoQueueList,"workOrderNo",orderPackBean); + DdlPreparedPack.getInPackList(orderStatusList1,"workOrderStatus",orderPackBean); + DdlPreparedPack.getOrderBy("productSeq",CommonEnumUtil.ASC_OR_DESC.ASC.getValue(), orderPackBean); + workOrderList = workOrderRao.findByHqlTopWhere(orderPackBean, 1); + } return !workOrderList.isEmpty() ? workOrderList.get(0) : null; } @@ -291,7 +294,7 @@ public class MesEarlyWarningServiceImpl implements IMesEarlyWarningService { DdlPreparedPack.getStringNotBlanklPack("custOrderNo",workOrderPackBean); DdlPreparedPack.getOrderBy("productSeq",CommonEnumUtil.ASC_OR_DESC.DESC.getValue(), workOrderPackBean); List mesWorkOrders = workOrderRao.findByHqlTopWhere(workOrderPackBean, 1); - return mesWorkOrders.get(0); + return !mesWorkOrders.isEmpty() ? mesWorkOrders.get(0): null; } private Integer getWorkCounts(String realEndTime,String organizeCode,String workCenterCode){ @@ -404,6 +407,9 @@ public class MesEarlyWarningServiceImpl implements IMesEarlyWarningService { mesKanBanShowModel.setSupplyRedBuffer(supplyRedBuffer); //供货缓冲实际 Long realSupplyBuffer = Long.parseLong(infoDD.getCsnNo().substring(3,10)) - Long.parseLong(infoKH.getCsnNo().substring(3,10)) - kanBan.getOnlineAdjustNum(); + if (realSupplyBuffer < 0){ + realSupplyBuffer = 0L; + } mesKanBanShowModel.setRealSupplyBuffer(realSupplyBuffer); if (realSupplyBuffer < supplyRedBuffer){ mesKanBanShowModel.setRealSupplyBufferColor("red"); @@ -412,6 +418,7 @@ public class MesEarlyWarningServiceImpl implements IMesEarlyWarningService { mesKanBanShowModel.setRealSupplyBufferColor("yellow"); mesKanBanShowModel.setSupplyRedBuffer(supplyYellowBuffer); } + //线头积单 Long summaryWorkOrderRedCount = kanBan.getSummaryWorkOrderRedCount(); mesKanBanShowModel.setSummaryWorkOrderRedCount(summaryWorkOrderRedCount); @@ -440,9 +447,9 @@ public class MesEarlyWarningServiceImpl implements IMesEarlyWarningService { //成品实际缓冲 Long realProductionBuffer; if (workOrderLast.getCustOrderNo().length() >= 10){ - realProductionBuffer = Long.parseLong(workOrderLast.getCustOrderNo().substring(workOrderLast.getCustOrderNo().length() - 7)) - Long.parseLong(infoKH.getCsnNo().substring(3, 10)) - kanBan.getOnlineAdjustNum() ; + realProductionBuffer = Long.parseLong(workOrderLast.getCustOrderNo().substring(workOrderLast.getCustOrderNo().length() - 7)) - Long.parseLong(infoKH.getCsnNo().substring(3, 10)) - kanBan.getOnlineToShippingAdjustNum() ; }else { - realProductionBuffer = Long.parseLong(workOrderLast.getCustOrderNo().substring(workOrderLast.getCustOrderNo().length() - 5)) - Long.parseLong(infoKH.getCsnNo().substring(infoKH.getCsnNo().length()-5)) - kanBan.getOnlineAdjustNum() ; + realProductionBuffer = Long.parseLong(workOrderLast.getCustOrderNo().substring(workOrderLast.getCustOrderNo().length() - 5)) - Long.parseLong(infoKH.getCsnNo().substring(infoKH.getCsnNo().length()-5)) - kanBan.getOnlineToShippingAdjustNum() ; } if(realProductionBuffer <0){ From 0250db7d47f95bd27df438a1b40262bb6b252bab Mon Sep 17 00:00:00 2001 From: "castle.zang" Date: Fri, 22 Nov 2024 15:23:15 +0800 Subject: [PATCH 5/5] =?UTF-8?q?=E9=9B=B6=E4=BB=B6=E5=8F=91=E8=BF=90?= =?UTF-8?q?=E7=BB=84--=E5=AE=A2=E6=88=B7=E5=B7=A5=E5=8E=82=E4=B8=8E?= =?UTF-8?q?=E4=BF=A1=E6=81=AF=E7=82=B9=E8=81=94=E5=8A=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../api/base/IMesCustomerMessagePointService.java | 9 +++++++++ .../base/MesCustomerMessagePointController.java | 22 ++++++++++++++++++++++ .../base/MesCustomerMessagePointService.java | 9 ++++++++- 3 files changed, 39 insertions(+), 1 deletion(-) diff --git a/modules/i3plus-ext-mes-api/src/main/java/cn/estsh/i3plus/ext/mes/api/base/IMesCustomerMessagePointService.java b/modules/i3plus-ext-mes-api/src/main/java/cn/estsh/i3plus/ext/mes/api/base/IMesCustomerMessagePointService.java index a9c6520..a4a22e8 100644 --- a/modules/i3plus-ext-mes-api/src/main/java/cn/estsh/i3plus/ext/mes/api/base/IMesCustomerMessagePointService.java +++ b/modules/i3plus-ext-mes-api/src/main/java/cn/estsh/i3plus/ext/mes/api/base/IMesCustomerMessagePointService.java @@ -2,6 +2,8 @@ package cn.estsh.i3plus.ext.mes.api.base; import cn.estsh.i3plus.pojo.mes.bean.MesCustomerMessagePoint; +import java.util.List; + /** * @Description: * @CreateDate 2024/04/16 @@ -10,4 +12,11 @@ import cn.estsh.i3plus.pojo.mes.bean.MesCustomerMessagePoint; public interface IMesCustomerMessagePointService extends IBaseMesService { MesCustomerMessagePoint getPointByCode(String pointCode,String organizeCode); + + /** + * 根据客户工厂代码查找对应的 + * @param custOrganizeCode + * @return + */ + List getByCustOrganizeCode(String custOrganizeCode); } diff --git a/modules/i3plus-ext-mes-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/apiservice/controller/base/MesCustomerMessagePointController.java b/modules/i3plus-ext-mes-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/apiservice/controller/base/MesCustomerMessagePointController.java index 949ee55..e20ef18 100644 --- a/modules/i3plus-ext-mes-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/apiservice/controller/base/MesCustomerMessagePointController.java +++ b/modules/i3plus-ext-mes-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/apiservice/controller/base/MesCustomerMessagePointController.java @@ -1,15 +1,37 @@ package cn.estsh.i3plus.ext.mes.apiservice.controller.base; +import cn.estsh.i3plus.ext.mes.apiservice.serviceimpl.base.MesCustomerMessagePointService; import cn.estsh.i3plus.ext.mes.pojo.constant.MesCommonConstant; import cn.estsh.i3plus.pojo.mes.bean.MesCustomerMessagePoint; import cn.estsh.i3plus.pojo.mes.bean.MesWorkCenter; +import cn.estsh.impp.framework.boot.util.ResultBean; +import io.swagger.annotations.ApiOperation; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; +import java.util.List; + /** * 客户信息点 */ @RestController @RequestMapping(MesCommonConstant.MES_YANFEN + "/mesCustomerMessagePoint") public class MesCustomerMessagePointController extends BaseMesController{ + + @Autowired + private MesCustomerMessagePointService mesCustomerMessagePointService; + //根据客户工厂查找对应的信息点信息 + @GetMapping("/list/{custOrganizeCode}") + @ApiOperation(value = "查询当前客户工厂的信息点", notes = "查询当前客户工厂的信息点") + public ResultBean list(@PathVariable("custOrganizeCode") String custOrganizeCode){ + try { + List messagePoints = mesCustomerMessagePointService.getByCustOrganizeCode(custOrganizeCode); + return ResultBean.success("查询成功").setResultList(messagePoints); + } catch (Exception e) { + return ResultBean.fail("查询失败").setErrorMsg(e.getMessage()); + } + } } diff --git a/modules/i3plus-ext-mes-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/apiservice/serviceimpl/base/MesCustomerMessagePointService.java b/modules/i3plus-ext-mes-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/apiservice/serviceimpl/base/MesCustomerMessagePointService.java index 59d81f7..9025a2a 100644 --- a/modules/i3plus-ext-mes-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/apiservice/serviceimpl/base/MesCustomerMessagePointService.java +++ b/modules/i3plus-ext-mes-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/apiservice/serviceimpl/base/MesCustomerMessagePointService.java @@ -6,12 +6,12 @@ import cn.estsh.i3plus.pojo.base.bean.DdlPackBean; import cn.estsh.i3plus.pojo.base.enumutil.CommonEnumUtil; import cn.estsh.i3plus.pojo.base.tool.DdlPreparedPack; import cn.estsh.i3plus.pojo.mes.bean.MesCustomerMessagePoint; +import cn.estsh.impp.framework.boot.auth.AuthUtil; import cn.estsh.impp.framework.boot.exception.ImppExceptionBuilder; import cn.estsh.impp.framework.boot.util.ValidatorBean; import lombok.extern.slf4j.Slf4j; import org.springframework.stereotype.Service; -import java.util.ArrayList; import java.util.List; @Service @@ -65,4 +65,11 @@ public class MesCustomerMessagePointService extends BaseMesService messagePoints = baseRDao.findByHqlWhere(ddlPackBean); return messagePoints.isEmpty() ? null: messagePoints.get(0); } + + @Override + public List getByCustOrganizeCode(String custOrganizeCode) { + DdlPackBean ddlPackBean = DdlPackBean.getDdlPackBean(AuthUtil.getOrganizeCode()); + DdlPreparedPack.getStringEqualPack(custOrganizeCode, "custOrganizeCode", ddlPackBean); + return baseRDao.findByHqlWhere(ddlPackBean); + } }