From e1bc7f21a0b48bc1b8ce1ff916682ff7cf426bed Mon Sep 17 00:00:00 2001 From: Jason Date: Thu, 16 Jan 2025 15:25:40 +0800 Subject: [PATCH] =?UTF-8?q?44744=20=E4=BF=AE=E5=A4=8D=E5=90=8C=E4=B8=80?= =?UTF-8?q?=E6=9D=A1=E7=A0=81=E5=AE=8C=E6=88=90=E8=BF=94=E5=B7=A5=E5=90=8E?= =?UTF-8?q?=E5=AE=8C=E6=88=90=E8=B4=A8=E6=A3=80=E6=88=90=E5=8A=9F=EF=BC=8C?= =?UTF-8?q?=E5=90=8E=E7=BB=AD=E6=97=A0=E6=B3=95=E5=86=8D=E6=AC=A1=E6=93=8D?= =?UTF-8?q?=E4=BD=9C=E7=94=B5=E5=AD=90=E5=8C=96=E6=A3=80=E9=AA=8C=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../busi/MesInputDefectRecordService.java | 26 ++++++++++++++++++++-- 1 file changed, 24 insertions(+), 2 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 a3ccafe..67aa103 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 @@ -427,7 +427,18 @@ public class MesInputDefectRecordService implements IMesInputDefectRecordService DdlPreparedPack.getOrderByPack(new Object[]{CommonEnumUtil.ASC_OR_DESC.DESC.getValue()}, new String[]{"createDatetime"}, reworkPackBean); int count = reworkTaskRepository.findByHqlWhereCount(reworkPackBean); if (count > 0) { - throw new ImppBusiException(String.format("【%s】该条码需要完成质检,再重新录入电子化检验", model.getSn())); + // 如果是批次还需要移库 + DdlPackBean ddlPackBean = DdlPackBean.getDdlPackBean(org); + DdlPreparedPack.getStringEqualPack(model.getPartNo(), "partNo", ddlPackBean); + MesProductVersion version = productVersionRepository.getByProperty(ddlPackBean); + String srcNo = configService.getCfgValue(org, "LGORT"); + if (version != null) { + srcNo = version.getReceiveInventoryPoint(); + } + String destLocateNo = getDestLocateNo(model, org); + if(!Objects.equals(srcNo, destLocateNo)) { + throw new ImppBusiException(String.format("【%s】该条码需要完成质检,再重新录入电子化检验", model.getSn())); + } } checkProduceSn(produceSn, model.getSn()); @@ -542,7 +553,18 @@ public class MesInputDefectRecordService implements IMesInputDefectRecordService DdlPreparedPack.getOrderByPack(new Object[]{CommonEnumUtil.ASC_OR_DESC.DESC.getValue()}, new String[]{"createDatetime"}, reworkPackBean); int count = reworkTaskRepository.findByHqlWhereCount(reworkPackBean); if (count > 0) { - throw new ImppBusiException(String.format("【%s】该条码需要完成质检,再重新录入电子化检验", model.getSn())); + // 如果是批次还需要移库 + DdlPackBean ddlPackBean = DdlPackBean.getDdlPackBean(org); + DdlPreparedPack.getStringEqualPack(model.getPartNo(), "partNo", ddlPackBean); + MesProductVersion version = productVersionRepository.getByProperty(ddlPackBean); + String srcNo = configService.getCfgValue(org, "LGORT"); + if (version != null) { + srcNo = version.getReceiveInventoryPoint(); + } + String destLocateNo = getDestLocateNo(model, org); + if(!Objects.equals(srcNo, destLocateNo)) { + throw new ImppBusiException(String.format("【%s】该条码需要完成质检,再重新录入电子化检验", model.getSn())); + } } checkProduceSn(produceSn, model.getSn());