From 57fa03f81f2aa8009f56ccbd71403efa9ef5ba24 Mon Sep 17 00:00:00 2001 From: jason Date: Fri, 23 May 2025 17:20:02 +0800 Subject: [PATCH] =?UTF-8?q?46824=20=E5=AE=A2=E9=80=80=E7=94=B5=E5=AD=90?= =?UTF-8?q?=E5=8C=96=E6=A3=80=E9=AA=8C=EF=BC=8CNC=E5=A4=84=E7=90=86?= =?UTF-8?q?=E6=8B=86=E8=A7=A3=E9=9C=80=E6=8C=89=E7=85=A7pisces=E5=8A=9F?= =?UTF-8?q?=E8=83=BD=E6=8C=89=E5=B7=A5=E5=BA=8F=E9=80=80=E5=9B=9E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../busi/MesInputDefectRecordService.java | 25 +++++++++++++--------- 1 file changed, 15 insertions(+), 10 deletions(-) diff --git a/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/busi/MesInputDefectRecordService.java b/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/busi/MesInputDefectRecordService.java index 3858bcf..d034854 100644 --- a/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/busi/MesInputDefectRecordService.java +++ b/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/busi/MesInputDefectRecordService.java @@ -783,8 +783,8 @@ public class MesInputDefectRecordService implements IMesInputDefectRecordService DdlPackBean packBean = DdlPackBean.getDdlPackBean(org); DdlPreparedPack.getStringEqualPack(produceSn.getProductSn(), "sn", packBean); if (!StringUtils.isEmpty(inputModel.getWorkCellCode())) { - DdlPreparedPack.getNumEqualPack(inputModel.getWorkCenterCode(), "workCenterCode", packBean); - DdlPreparedPack.getNumEqualPack(inputModel.getWorkCellCode(), "workCellCode", packBean); + DdlPreparedPack.getStringEqualPack(inputModel.getWorkCenterCode(), "workCenterCode", packBean); + DdlPreparedPack.getStringEqualPack(inputModel.getWorkCellCode(), "workCellCode", packBean); } DdlPreparedPack.getNumEqualPack(refundFlag, "refundFlag", packBean); DdlPreparedPack.getOrderByPack(new Object[]{CommonEnumUtil.ASC_OR_DESC.DESC.getValue()}, new String[]{"createDatetime"}, packBean); @@ -1416,19 +1416,22 @@ public class MesInputDefectRecordService implements IMesInputDefectRecordService detail.setSystemSyncDatetime(MesPcnExtConstWords.EMPTY); } - - private Integer getWorkCellType(String organizeCode, String workCenterCode, String workCellCode) { DdlPackBean packBean = DdlPackBean.getDdlPackBean(organizeCode); DdlPreparedPack.getStringEqualPack(workCenterCode, "workCenterCode", packBean); - DdlPreparedPack.getNumNOEqualPack(workCellCode, "workCellCode", packBean); + DdlPreparedPack.getStringEqualPack(workCellCode, "workCellCode", packBean); MesWorkCell workCell = workCellRDao.getByProperty(packBean); MesExtEnumUtil.MES_PART_INSPECTION_TYPE type = null; if (workCell != null) { + if (workCell.getType() == null) { + MesPcnException.throwFlowException(String.format("工位【%s】未维护工位类型,请检查数据", workCellCode)); + } if (workCell.getType() == MesExtEnumUtil.MES_WORK_CELL_TYPE.PRODUCT_CELL.getValue()) { type = MesExtEnumUtil.MES_PART_INSPECTION_TYPE.ONLINE_CHECK; } else if (workCell.getType() == MesExtEnumUtil.MES_WORK_CELL_TYPE.GP12_CELL.getValue()) { type = MesExtEnumUtil.MES_PART_INSPECTION_TYPE.GP12_CHECK; + } else { + MesPcnException.throwFlowException(String.format("工位【%s】维护了不支持的工位类型,请检查数据", workCellCode)); } } return type != null ? type.getValue() : null; @@ -1453,23 +1456,25 @@ public class MesInputDefectRecordService implements IMesInputDefectRecordService Map> typeMapInspection = inspectionList.stream().collect(Collectors.groupingBy(MesPartInspection::getInspectionType)); if (mesPart.getSlcGateQty() != null) { - List inspections = typeMapInspection.get(MesExtEnumUtil.MES_PART_INSPECTION_TYPE.ONLINE_CHECK.getValue()); + List inspections = typeMapInspection.get(MesExtEnumUtil.MES_PART_INSPECTION_TYPE.GP12_CHECK.getValue()); final int checkCount = inspections == null ? 0 : inspections.size(); if (mesPart.getSlcGateQty() == 1) { if (checkCount == 0) { - MesPcnException.throwFlowException("物料【%s】的SLC GATE 数量为1,至少需要一次GP12!检验", partNo); + MesPcnException.throwFlowException(String.format("物料【%s】的SLC GATE 数量为1,至少需要一次GP12检验!", partNo)); } } else if (mesPart.getSlcGateQty() == 2) { Set opUser = inspections != null ? inspections.stream().map(MesPartInspection::getCreateUser).collect(Collectors.toSet()) : new HashSet<>(); if (opUser.size() != 2) { - MesPcnException.throwFlowException("物料【%s】的SLC GATE 数量为2,需要2次不同创建人的GP12检验!", partNo); + MesPcnException.throwFlowException(String.format("物料【%s】的SLC GATE 数量为2,需要2次不同创建人的GP12检验!", partNo)); } } - } else if (mesPart.getOlGateQty() != null) { + } + + if (mesPart.getOlGateQty() != null) { List inspections = typeMapInspection.get(MesExtEnumUtil.MES_PART_INSPECTION_TYPE.ONLINE_CHECK.getValue()); final int checkCount = inspections == null ? 0 : inspections.size(); if (mesPart.getSlcGateQty() == 1 && checkCount == 0) { - MesPcnException.throwFlowException("物料【%s】的SLC GATE 数量为1,至少需要一次在线检验!", partNo); + MesPcnException.throwFlowException(String.format("物料【%s】的SLC GATE 数量为1,至少需要一次在线检验!", partNo)); } } }