From 88837ac6816e66d083a8d099a5dc75ced770e644 Mon Sep 17 00:00:00 2001 From: "jhforever.wang@estsh.com" Date: Thu, 17 Apr 2025 17:17:26 +0800 Subject: [PATCH] =?UTF-8?q?46420=20=E8=AF=95=E5=88=B6=E5=8D=95=E5=9C=A8?= =?UTF-8?q?=E5=B7=A5=E6=AD=A5=E4=B8=AD=E9=BB=98=E8=AE=A4=E4=B8=8D=E6=B1=87?= =?UTF-8?q?=E6=8A=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../MesProductionRecordGenerateStepService.java | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/step/MesProductionRecordGenerateStepService.java b/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/step/MesProductionRecordGenerateStepService.java index 5d19268..531dd9c 100644 --- a/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/step/MesProductionRecordGenerateStepService.java +++ b/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/step/MesProductionRecordGenerateStepService.java @@ -99,6 +99,10 @@ public class MesProductionRecordGenerateStepService extends BaseStepService { MesWorkCenter workCenter = productionProcessContext.getWorkCenter(); MesWorkCell workCell = productionProcessContext.getWorkCell(); + //获取上下文产出零件信息【当前非排序才需要查询, 用于验证P单则不汇报】 + List productionPartContextList = workCenter.getCenterType().compareTo(MesExtEnumUtil.WORK_CENTER_TYPE.NOSORT.getValue()) == 0 ? productionDispatchContextStepService.getProductionPartContext(reqBean) : null; + Map ppcMap = CollectionUtils.isEmpty(productionPartContextList) ? null : productionPartContextList.stream().filter(o -> (null != o && !StringUtils.isEmpty(o.getForeignKey()))).collect(Collectors.toMap(MesProductionPartContext::getForeignKey, o -> o)); + //获取上下文(头道)模具号 String mouldNo = getMouldNo(reqBean, workCenter, prodRuleContextList); @@ -107,7 +111,8 @@ public class MesProductionRecordGenerateStepService extends BaseStepService { //生成加工记录 productionPsOutContextList.stream().filter(o -> null != o).forEach(o -> - saveProductionRecordData(reqBean, workCenter, scanMonitorContext, mouldNo, prodRuleContextList, productionProcessContext, o, prMap, cellEquipContext, CollectionUtils.isEmpty(psiMap) ? null : psiMap.get(o.getForeignKey())) + saveProductionRecordData(reqBean, workCenter, scanMonitorContext, mouldNo, prodRuleContextList, productionProcessContext, o, prMap, cellEquipContext, + CollectionUtils.isEmpty(psiMap) ? null : psiMap.get(o.getForeignKey()), CollectionUtils.isEmpty(ppcMap) ? null : ppcMap.get(o.getForeignKey())) ); //保存上下文产品加工规则信息集合 @@ -126,7 +131,7 @@ public class MesProductionRecordGenerateStepService extends BaseStepService { private void saveProductionRecordData(StationRequestBean reqBean, MesWorkCenter workCenter, MesScanMonitorContext scanMonitorContext, String mouldNo, List prodRuleContextList, MesProductionProcessContext productionProcessContext, MesProductionPsOutContext productionPsOutContext, - Map prMap, MesCellEquipContext cellEquipContext, MesProductionPsInContext productionPsInContext) { + Map prMap, MesCellEquipContext cellEquipContext, MesProductionPsInContext productionPsInContext, MesProductionPartContext productionPartContext) { MesProdRuleContext prodRuleContext = CollectionUtils.isEmpty(prMap) ? null : prMap.get(productionPsOutContext.getForeignKey()); @@ -161,9 +166,19 @@ public class MesProductionRecordGenerateStepService extends BaseStepService { } } + //非排序验证: 判断工单是否是试制工单 + if (productionRecord.getReportStatus().compareTo(MesExtEnumUtil.REPORT_STATUS.REPORT_STATUS_10.getValue()) == 0 && + workCenter.getCenterType().compareTo(MesExtEnumUtil.WORK_CENTER_TYPE.NOSORT.getValue()) == 0 && + null != productionPartContext && !StringUtils.isEmpty(productionPartContext.getOrderFlag()) && + productionPartContext.getOrderFlag().equals(MesExtEnumUtil.ORDER_TYPE_IDENTIFICATION.P.getValue())) { + productionRecord.setReportStatus(MesExtEnumUtil.REPORT_STATUS.REPORT_STATUS_30.getValue()); + } + //非排序与排序 相同验证: 判断是否已经存在汇报状态的加工记录 if (productionRecord.getReportStatus().compareTo(MesExtEnumUtil.REPORT_STATUS.REPORT_STATUS_10.getValue()) == 0 && isSamePart(productionPsInContext, productionPsOutContext) && - checkPsIsReported(reqBean.getOrganizeCode(), productionPsOutContext.getProductSn(), productionPsOutContext.getPartNo())) productionRecord.setReportStatus(MesExtEnumUtil.REPORT_STATUS.REPORT_STATUS_30.getValue()); + checkPsIsReported(reqBean.getOrganizeCode(), productionPsOutContext.getProductSn(), productionPsOutContext.getPartNo())) { + productionRecord.setReportStatus(MesExtEnumUtil.REPORT_STATUS.REPORT_STATUS_30.getValue()); + } productionRecord.setModuleStatisticsStatus(CommonEnumUtil.TRUE_OR_FALSE.FALSE.getValue());