From a159411fb1790f1378a25cef0766f418299cd1d8 Mon Sep 17 00:00:00 2001 From: "jhforever.wang@estsh.com" Date: Mon, 19 May 2025 21:11:49 +0800 Subject: [PATCH] =?UTF-8?q?=E5=90=88=E5=B9=B6=2046981=20=E7=94=B5=E5=AD=90?= =?UTF-8?q?=E5=8C=96=E6=A3=80=E9=AA=8C=20NC=E5=88=A4=E5=AE=9A=20=E8=99=9A?= =?UTF-8?q?=E7=BB=93=E6=9E=84=E4=B8=8D=E5=8F=AF=E5=BD=95=E5=85=A5=20?= =?UTF-8?q?=E8=A7=A3=E5=86=B3=E5=86=B2=E7=AA=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../serviceimpl/busi/MesInputDefectRecordService.java | 15 +++++++++++++++ 1 file changed, 15 insertions(+) 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 e65b1ca..4c5e254 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 @@ -160,6 +160,8 @@ public class MesInputDefectRecordService implements IMesInputDefectRecordService //检查物料 part = checkPartByPartNo(model.getPartNo(), model.getOrganizeCode()); + //20250517-46981 电子化检验 NC判定 虚结构不可录入 + checkPartIsImaginaryStructure(model.getOrganizeCode(), model.getPartNo()); //获取NC-零件检测-单据 if(!Objects.isNull(model.getId())){ @@ -1073,6 +1075,8 @@ public class MesInputDefectRecordService implements IMesInputDefectRecordService throw new ImppBusiException(String.format("【%s】此条码对应【%s】物料号未维护零件类型,请检查数据", produceSn.getProductSn(), produceSn.getPartNo())); } + //20250517-46981 电子化检验 NC判定 虚结构不可录入 + checkPartIsImaginaryStructure(org, part.getPartNo()); return part; } @@ -1404,4 +1408,15 @@ public class MesInputDefectRecordService implements IMesInputDefectRecordService detail.setSystemSyncStatus(CommonEnumUtil.FALSE); detail.setSystemSyncDatetime(MesPcnExtConstWords.EMPTY); } + + private void checkPartIsImaginaryStructure(String organizeCode, String partNo) { + DdlPackBean productVersionPackBean = DdlPackBean.getDdlPackBean(organizeCode); + DdlPreparedPack.getStringEqualPack("虚零件", "description", productVersionPackBean); + DdlPreparedPack.getStringEqualPack(partNo, "partNo", productVersionPackBean); + int count = productVersionRepository.findByHqlWhereCount(productVersionPackBean); + if (count > 0) { + throw new ImppBusiException(String.format("物料号【%s】为虚零件,请检查数据", partNo)); + } + } + }