From 82556d70a1761a764ef12a2c7bb5cd14b4b5a014 Mon Sep 17 00:00:00 2001 From: "xiangwei.zhang" <752558143@qq.com> Date: Thu, 15 May 2025 18:57:38 +0800 Subject: [PATCH 1/7] =?UTF-8?q?46824=20[PCN]=201.=20=E5=A2=9E=E5=8A=A0?= =?UTF-8?q?=E6=A0=A1=E9=AA=8C=E7=94=B5=E5=AD=90=E5=8C=96=E6=A3=80=E9=AA=8C?= =?UTF-8?q?=E6=AC=A1=E6=95=B0=E5=8A=9F=E8=83=BD=E9=9C=80=E6=B1=82;=202.=20?= =?UTF-8?q?=E5=AE=A2=E9=80=80=E7=94=B5=E5=AD=90=E5=8C=96=E6=A3=80=E9=AA=8C?= =?UTF-8?q?=EF=BC=8CNC=E5=A4=84=E7=90=86=E6=8B=86=E8=A7=A3=E9=9C=80?= =?UTF-8?q?=E6=8C=89=E7=85=A7pisces=E5=8A=9F=E8=83=BD=E6=8C=89=E5=B7=A5?= =?UTF-8?q?=E5=BA=8F=E9=80=80=E5=9B=9E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/busi/MesReworkTaskController.java | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/controller/busi/MesReworkTaskController.java b/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/controller/busi/MesReworkTaskController.java index ac46965..5a39d46 100644 --- a/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/controller/busi/MesReworkTaskController.java +++ b/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/controller/busi/MesReworkTaskController.java @@ -1,6 +1,7 @@ package cn.estsh.i3plus.ext.mes.pcn.apiservice.controller.busi; import cn.estsh.i3plus.ext.mes.pcn.api.base.IMesReworkTaskService; +import cn.estsh.i3plus.ext.mes.pcn.api.busi.IMesProductionRecordService; import cn.estsh.i3plus.ext.mes.pcn.pojo.constant.MesCommonConstant; import cn.estsh.i3plus.ext.mes.pcn.pojo.model.MesReworkTaskModel; import cn.estsh.i3plus.ext.mes.pcn.pojo.model.MesReworkTaskRequestModel; @@ -33,6 +34,9 @@ public class MesReworkTaskController { @Autowired private IMesReworkTaskService mesReworkTaskService; + @Autowired + private IMesProductionRecordService mesProductionRecordService; + @GetMapping("/query-pager") @ApiOperation(value = "查询所有返工单") public ResultBean queryReworkTaskByPager(MesReworkTask reworkTask, Pager pager) { @@ -192,4 +196,19 @@ public class MesReworkTaskController { return ImppExceptionBuilder.newInstance().buildExceptionResult(e); } } + + @GetMapping("/queryProductionRecord") + @ApiOperation(value = "查询加工记录") + public ResultBean queryProductionRecord(MesReworkTaskRequestModel requestModel) { + // 数据校验 + ValidatorBean.checkNotNull(requestModel.getSn(), "条码不能为空"); + ValidatorBean.checkNotNull(requestModel.getOrganizeCode(), "工厂代码不能为空"); + try { + return ResultBean.success("查询成功").setResultObject(mesProductionRecordService.findProductionRecordList(requestModel.getOrganizeCode(),requestModel.getSn())); + } catch (ImppBusiException imppException) { + return ResultBean.fail(imppException); + } catch (Exception e) { + return ImppExceptionBuilder.newInstance().buildExceptionResult(e); + } + } } From 958edd3435e8f15c012e328ade951163835858e6 Mon Sep 17 00:00:00 2001 From: jason Date: Fri, 23 May 2025 13:57:30 +0800 Subject: [PATCH 2/7] =?UTF-8?q?46824=20=E5=AE=A2=E9=80=80=E7=94=B5?= =?UTF-8?q?=E5=AD=90=E5=8C=96=E6=A3=80=E9=AA=8C=EF=BC=8CNC=E5=A4=84?= =?UTF-8?q?=E7=90=86=E6=8B=86=E8=A7=A3=E9=9C=80=E6=8C=89=E7=85=A7pisces?= =?UTF-8?q?=E5=8A=9F=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 --- .../pcn/api/busi/IMesInputDefectRecordService.java | 3 + .../serviceimpl/base/MesReworkTaskServiceImpl.java | 12 ++++ .../busi/MesBoxingErrorProofingService.java | 11 ++-- .../busi/MesInputDefectRecordService.java | 73 +++++++++++++++++++++- .../MesShippingScanSnStrategyServiceImpl.java | 6 ++ .../mesShippingScanOrderStrategyServiceImpl.java | 6 ++ .../pojo/model/MesPartInspectionInputModel.java | 3 + 7 files changed, 108 insertions(+), 6 deletions(-) diff --git a/modules/i3plus-ext-mes-pcn-api/src/main/java/cn/estsh/i3plus/ext/mes/pcn/api/busi/IMesInputDefectRecordService.java b/modules/i3plus-ext-mes-pcn-api/src/main/java/cn/estsh/i3plus/ext/mes/pcn/api/busi/IMesInputDefectRecordService.java index 6a1b4d1..09c54f6 100644 --- a/modules/i3plus-ext-mes-pcn-api/src/main/java/cn/estsh/i3plus/ext/mes/pcn/api/busi/IMesInputDefectRecordService.java +++ b/modules/i3plus-ext-mes-pcn-api/src/main/java/cn/estsh/i3plus/ext/mes/pcn/api/busi/IMesInputDefectRecordService.java @@ -36,4 +36,7 @@ public interface IMesInputDefectRecordService { @ApiOperation(value = "可疑品录入") void saveSusPartInspection(MesPartInspectionInputModel model, String org); + + @ApiOperation(value = "电子化检验检测次数卡控") + void checkProductSnInspection(String organizeCode, String partNo, String sn); } diff --git a/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/base/MesReworkTaskServiceImpl.java b/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/base/MesReworkTaskServiceImpl.java index 2c09905..6cc9fdb 100644 --- a/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/base/MesReworkTaskServiceImpl.java +++ b/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/base/MesReworkTaskServiceImpl.java @@ -853,7 +853,10 @@ public class MesReworkTaskServiceImpl implements IMesReworkTaskService { } public void doRecursionCheck(List assemblyModelList,String organizeCode,String userName,String destLocate,String responsibleParty){ + Set recordIds = new HashSet<>(); + Set notScrapRecordIds = new HashSet<>(); for (MesProductionAssemblyModel assemblyModel : assemblyModelList) { + recordIds.add(assemblyModel.getProductionRecordId()); //勾选 if (assemblyModel.getFlag() == CommonEnumUtil.TRUE_OR_FALSE.TRUE.getValue()) { //报废 @@ -873,6 +876,7 @@ public class MesReworkTaskServiceImpl implements IMesReworkTaskService { doRecursionCheck(assemblyModel.getChildren(),organizeCode,userName,destLocate,responsibleParty); } } else if (assemblyModel.getFlag() == CommonEnumUtil.TRUE_OR_FALSE.FALSE.getValue()) { + notScrapRecordIds.add(assemblyModel.getProductionRecordId()); //装配解绑 saveProductionAssembly(organizeCode, userName, assemblyModel.getAssemblySn()); //自制件更新条码状态 条码状态可用 @@ -884,6 +888,14 @@ public class MesReworkTaskServiceImpl implements IMesReworkTaskService { } } } + + // 加工记录下的所有装配件都做了报废之后需要将加工记录软删掉。 + for (Long recordId : recordIds) { + if (notScrapRecordIds.contains(recordId)) { + continue; + } + productionRecordRepository.deleteWeaklyById(recordId, userName); + } } private void updateProductSn(MesReworkTaskRequestModel requestModel, MesProductionAssembly assembly, MesProductionAssemblyContext context) { diff --git a/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/busi/MesBoxingErrorProofingService.java b/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/busi/MesBoxingErrorProofingService.java index 2ca04dc..b4ba746 100644 --- a/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/busi/MesBoxingErrorProofingService.java +++ b/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/busi/MesBoxingErrorProofingService.java @@ -1,9 +1,6 @@ package cn.estsh.i3plus.ext.mes.pcn.apiservice.serviceimpl.busi; -import cn.estsh.i3plus.ext.mes.pcn.api.busi.IMesBoxingErrorProofingService; -import cn.estsh.i3plus.ext.mes.pcn.api.busi.IMesConfigService; -import cn.estsh.i3plus.ext.mes.pcn.api.busi.IMesProduceSnExtService; -import cn.estsh.i3plus.ext.mes.pcn.api.busi.IMesProductionRecordService; +import cn.estsh.i3plus.ext.mes.pcn.api.busi.*; import cn.estsh.i3plus.ext.mes.pcn.apiservice.util.MesPcnException; import cn.estsh.i3plus.ext.mes.pcn.pojo.constant.MesCommonConstant; import cn.estsh.i3plus.ext.mes.pcn.pojo.util.MesPcnExtConstWords; @@ -78,6 +75,9 @@ public class MesBoxingErrorProofingService implements IMesBoxingErrorProofingSer @Autowired private IMesProductionRecordService mesProductionRecordService; + @Autowired + private IMesInputDefectRecordService defectRecordService; + @Override public ListPager queryMesPackageDetailByPager(MesPackage mesPackage, Pager pager) { @@ -165,6 +165,9 @@ public class MesBoxingErrorProofingService implements IMesBoxingErrorProofingSer } //校验条码规则 MesPart mesPart = getMesPartNew(mesPackageDetail, mesPackage, packingDefine); + if (Objects.equals(packingDefine.getIsCheckInspectionRecord(), CommonEnumUtil.TRUE_OR_FALSE.TRUE.getValue())) { + defectRecordService.checkProductSnInspection(mesPackageDetail.getOrganizeCode(), mesPart.getPartNo(), mesPackageDetail.getSerialNumber()); + } //包装规格明细 MesPackageDetail saveMesPackageDetail = getPackageDetail(mesPackageDetail, mesPart); if (mesPackageDetail.getIsMemoryBoolean()) { 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..3858bcf 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 @@ -129,6 +129,9 @@ public class MesInputDefectRecordService implements IMesInputDefectRecordService @Autowired private MesPartProdGroupRepository mesPartProdGroupRao; + @Autowired + private MesWorkCellRepository workCellRDao; + @Override public MesPartInspectionViewModel queryPartInspection(MesPartInspectionInputModel model) { @@ -306,7 +309,7 @@ public class MesInputDefectRecordService implements IMesInputDefectRecordService } } - + final Integer workCellType = getWorkCellType(model.getOrganizeCode(), model.getWorkCenterCode(), model.getWorkCellCode()); //零件检测详情为空,则代表本次校验为合格。 if (CollectionUtils.isEmpty(model.getPartInspectionDetailList())) { MesPartInspection partInspection = null; @@ -321,6 +324,7 @@ public class MesInputDefectRecordService implements IMesInputDefectRecordService if (model.getOptType() != null && model.getOptType() == 2) { partInspection.setRefundFlag(CommonEnumUtil.TRUE_OR_FALSE.TRUE.getValue()); } + partInspection.setInspectionType(workCellType); partInspection = partInspectionRepository.save(partInspection); if (model.getSourceType() == MesExtEnumUtil.PART_INSPECTION_SOURCE_TYPE.SINGLE.getValue()) { @@ -371,6 +375,7 @@ public class MesInputDefectRecordService implements IMesInputDefectRecordService if (model.getOptType() != null && model.getOptType() == 2) { model.getPartInspection().setRefundFlag(CommonEnumUtil.TRUE_OR_FALSE.TRUE.getValue()); } + model.getPartInspection().setInspectionType(workCellType); partInspectionRepository.save(model.getPartInspection()); //查询当前单据明细 @@ -484,7 +489,7 @@ public class MesInputDefectRecordService implements IMesInputDefectRecordService if (model.getOptType() != null && model.getOptType() == 2) { partInspection.setRefundFlag(CommonEnumUtil.TRUE_OR_FALSE.TRUE.getValue()); } - + partInspection.setInspectionType(workCellType); model.setPartInspection(partInspectionRepository.save(partInspection)); List defectTypeNoExitList = new ArrayList<>(); @@ -622,6 +627,7 @@ public class MesInputDefectRecordService implements IMesInputDefectRecordService if (model.getOptType() != null && model.getOptType() == 2) { model.getPartInspection().setRefundFlag(CommonEnumUtil.TRUE_OR_FALSE.TRUE.getValue()); } + model.getPartInspection().setInspectionType(workCellType); partInspectionRepository.save(model.getPartInspection()); //查询当前单据明细 List resultDetailList = queryResultDetailList(model, model.getOrganizeCode()); @@ -776,6 +782,10 @@ 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.getNumEqualPack(refundFlag, "refundFlag", packBean); DdlPreparedPack.getOrderByPack(new Object[]{CommonEnumUtil.ASC_OR_DESC.DESC.getValue()}, new String[]{"createDatetime"}, packBean); MesPartInspection partInspection = partInspectionRepository.getByProperty(packBean); @@ -972,6 +982,7 @@ public class MesInputDefectRecordService implements IMesInputDefectRecordService partInspection.setLotNo(model.getLotNo()); partInspection.setQty(model.getQty()); partInspection.setWorkCenterCode(model.getWorkCenterCode()); + partInspection.setWorkCellCode(model.getWorkCellCode()); partInspection.setShiftCode(model.getShiftCode()); partInspection.setSourceType(model.getSourceType()); //42984 初检创建时修改人和修改时间不能赋值 @@ -1404,4 +1415,62 @@ public class MesInputDefectRecordService implements IMesInputDefectRecordService detail.setSystemSyncStatus(CommonEnumUtil.FALSE); 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); + MesWorkCell workCell = workCellRDao.getByProperty(packBean); + MesExtEnumUtil.MES_PART_INSPECTION_TYPE type = null; + if (workCell != null) { + 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; + } + } + return type != null ? type.getValue() : null; + } + + @Override + public void checkProductSnInspection(String organizeCode, String partNo, String sn) { + if (StringUtils.isEmpty(partNo)) { + return; + } + DdlPackBean packBean = DdlPackBean.getDdlPackBean(organizeCode); + DdlPreparedPack.getStringEqualPack(partNo, "partNo", packBean); + MesPart mesPart = partRepository.getByProperty(packBean); + if (mesPart == null) { + return; + } + + DdlPackBean inspectionPackBean = DdlPackBean.getDdlPackBean(organizeCode); + DdlPreparedPack.getStringEqualPack(sn, "sn", inspectionPackBean); + DdlPreparedPack.getIsNotNull("inspectionType", inspectionPackBean); + List inspectionList = partInspectionRepository.findByHqlWhere(inspectionPackBean); + 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()); + final int checkCount = inspections == null ? 0 : inspections.size(); + if (mesPart.getSlcGateQty() == 1) { + if (checkCount == 0) { + MesPcnException.throwFlowException("物料【%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); + } + } + } else 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); + } + } + } } diff --git a/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/busi/shippingscan/strategy/MesShippingScanSnStrategyServiceImpl.java b/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/busi/shippingscan/strategy/MesShippingScanSnStrategyServiceImpl.java index 30ac10d..cd7d918 100644 --- a/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/busi/shippingscan/strategy/MesShippingScanSnStrategyServiceImpl.java +++ b/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/busi/shippingscan/strategy/MesShippingScanSnStrategyServiceImpl.java @@ -72,6 +72,9 @@ public class MesShippingScanSnStrategyServiceImpl implements IMesShippingScanStr @Autowired private IMesShippingSnUniqueService mesShippingSnUniqueService; + @Autowired + private IMesInputDefectRecordService defectRecordService; + @Override public MesSortShippingCheckModel doScan(MesSortShippingCheckModel model, MesShippingOrderManagement orderManagement, MesPartShippingGroup shippingGroup) { //校验条码 @@ -81,6 +84,9 @@ public class MesShippingScanSnStrategyServiceImpl implements IMesShippingScanStr if (detail.getPartNo().equals(produceSn.getPartNo()) && StringUtils.isEmpty(detail.getBarcode()) && !Objects.equals(detail.getIsScanFlg(), MesCommonConstant.TRUE_INTEGER)) { //校验发运明细 checkShippingDetails(model, orderManagement, shippingGroup, produceSn, detail); + if (shippingGroup != null && Objects.equals(shippingGroup.getIsCheckInspectionRecords(), CommonEnumUtil.TRUE_OR_FALSE.TRUE.getValue())) { + defectRecordService.checkProductSnInspection(model.getOrganizeCode(), produceSn.getPartNo(), model.getSn()); + } scanFlg = true; //明细更新 updateOrderManagementDetails(produceSn, orderManagement, detail, model.getUserInfo()); diff --git a/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/busi/shippingscan/strategy/mesShippingScanOrderStrategyServiceImpl.java b/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/busi/shippingscan/strategy/mesShippingScanOrderStrategyServiceImpl.java index d1d12de..db9052c 100644 --- a/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/busi/shippingscan/strategy/mesShippingScanOrderStrategyServiceImpl.java +++ b/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/busi/shippingscan/strategy/mesShippingScanOrderStrategyServiceImpl.java @@ -70,6 +70,9 @@ public class mesShippingScanOrderStrategyServiceImpl implements IMesShippingScan @Autowired private IMesWorkOrderService mesWorkOrderService; + @Autowired + private IMesInputDefectRecordService defectRecordService; + @Override public MesSortShippingCheckModel doScan(MesSortShippingCheckModel model, MesShippingOrderManagement orderManagement, MesPartShippingGroup shippingGroup) { //校验条码 @@ -90,6 +93,9 @@ public class mesShippingScanOrderStrategyServiceImpl implements IMesShippingScan if (detail.getPartNo().equals(produceSn.getPartNo()) && StringUtils.isEmpty(detail.getBarcode()) && !Objects.equals(detail.getIsScanFlg(), MesCommonConstant.TRUE_INTEGER)) { //校验发运明细 checkShippingDetails(model, orderManagement, shippingGroup, produceSn, detail); + if (shippingGroup != null && Objects.equals(shippingGroup.getIsCheckInspectionRecords(), CommonEnumUtil.TRUE_OR_FALSE.TRUE.getValue())) { + defectRecordService.checkProductSnInspection(model.getOrganizeCode(), produceSn.getPartNo(), model.getSn()); + } scanFlg = true; //明细更新 updateOrderManagementDetails(produceSn, orderManagement, detail, workOrder, model.getUserInfo()); diff --git a/modules/i3plus-ext-mes-pcn-pojo/src/main/java/cn/estsh/i3plus/ext/mes/pcn/pojo/model/MesPartInspectionInputModel.java b/modules/i3plus-ext-mes-pcn-pojo/src/main/java/cn/estsh/i3plus/ext/mes/pcn/pojo/model/MesPartInspectionInputModel.java index 943da9c..6e8ac24 100644 --- a/modules/i3plus-ext-mes-pcn-pojo/src/main/java/cn/estsh/i3plus/ext/mes/pcn/pojo/model/MesPartInspectionInputModel.java +++ b/modules/i3plus-ext-mes-pcn-pojo/src/main/java/cn/estsh/i3plus/ext/mes/pcn/pojo/model/MesPartInspectionInputModel.java @@ -36,6 +36,9 @@ public class MesPartInspectionInputModel { @ApiParam("产线代码") private String workCenterCode; + @ApiParam("工位代码") + private String workCellCode; + @ApiParam("班次代码") private String shiftCode; From 57fa03f81f2aa8009f56ccbd71403efa9ef5ba24 Mon Sep 17 00:00:00 2001 From: jason Date: Fri, 23 May 2025 17:20:02 +0800 Subject: [PATCH 3/7] =?UTF-8?q?46824=20=E5=AE=A2=E9=80=80=E7=94=B5?= =?UTF-8?q?=E5=AD=90=E5=8C=96=E6=A3=80=E9=AA=8C=EF=BC=8CNC=E5=A4=84?= =?UTF-8?q?=E7=90=86=E6=8B=86=E8=A7=A3=E9=9C=80=E6=8C=89=E7=85=A7pisces?= =?UTF-8?q?=E5=8A=9F=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)); } } } From 6390c6b7b53ff2b91c0af9637cee6e319d35e59b Mon Sep 17 00:00:00 2001 From: jason Date: Tue, 27 May 2025 10:05:54 +0800 Subject: [PATCH 4/7] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=B7=A5=E4=BD=8D?= =?UTF-8?q?=E7=B1=BB=E5=9E=8B=E7=9A=84=E6=9E=9A=E4=B8=BE=EF=BC=8C=E9=81=BF?= =?UTF-8?q?=E5=85=8D=E5=90=8D=E7=A7=B0=E9=87=8D=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../apiservice/serviceimpl/busi/MesInputDefectRecordService.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 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 d034854..703be78 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 @@ -309,7 +309,7 @@ public class MesInputDefectRecordService implements IMesInputDefectRecordService } } - final Integer workCellType = getWorkCellType(model.getOrganizeCode(), model.getWorkCenterCode(), model.getWorkCellCode()); + final Integer workCellType = getPartInspectionType(model.getOrganizeCode(), model.getWorkCenterCode(), model.getWorkCellCode()); //零件检测详情为空,则代表本次校验为合格。 if (CollectionUtils.isEmpty(model.getPartInspectionDetailList())) { MesPartInspection partInspection = null; @@ -1416,7 +1416,7 @@ public class MesInputDefectRecordService implements IMesInputDefectRecordService detail.setSystemSyncDatetime(MesPcnExtConstWords.EMPTY); } - private Integer getWorkCellType(String organizeCode, String workCenterCode, String workCellCode) { + private Integer getPartInspectionType(String organizeCode, String workCenterCode, String workCellCode) { DdlPackBean packBean = DdlPackBean.getDdlPackBean(organizeCode); DdlPreparedPack.getStringEqualPack(workCenterCode, "workCenterCode", packBean); DdlPreparedPack.getStringEqualPack(workCellCode, "workCellCode", packBean); @@ -1426,9 +1426,9 @@ public class MesInputDefectRecordService implements IMesInputDefectRecordService if (workCell.getType() == null) { MesPcnException.throwFlowException(String.format("工位【%s】未维护工位类型,请检查数据", workCellCode)); } - if (workCell.getType() == MesExtEnumUtil.MES_WORK_CELL_TYPE.PRODUCT_CELL.getValue()) { + if (workCell.getType() == MesExtEnumUtil.MES_WORK_CELL_CHECK_TYPE.PRODUCT_CELL.getValue()) { type = MesExtEnumUtil.MES_PART_INSPECTION_TYPE.ONLINE_CHECK; - } else if (workCell.getType() == MesExtEnumUtil.MES_WORK_CELL_TYPE.GP12_CELL.getValue()) { + } else if (workCell.getType() == MesExtEnumUtil.MES_WORK_CELL_CHECK_TYPE.GP12_CELL.getValue()) { type = MesExtEnumUtil.MES_PART_INSPECTION_TYPE.GP12_CHECK; } else { MesPcnException.throwFlowException(String.format("工位【%s】维护了不支持的工位类型,请检查数据", workCellCode)); From 5c1c222e2a7c179225a6eb2588e0ff8acac0eaed Mon Sep 17 00:00:00 2001 From: jason Date: Tue, 27 May 2025 11:42:29 +0800 Subject: [PATCH 5/7] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=B7=A5=E4=BD=8D?= =?UTF-8?q?=E7=B1=BB=E5=9E=8B=E7=9A=84=E6=9E=9A=E4=B8=BE=EF=BC=8C=E9=81=BF?= =?UTF-8?q?=E5=85=8D=E5=90=8D=E7=A7=B0=E9=87=8D=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../pcn/apiservice/serviceimpl/busi/MesInputDefectRecordService.java | 3 +++ 1 file changed, 3 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 703be78..1be5af7 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 @@ -1417,6 +1417,9 @@ public class MesInputDefectRecordService implements IMesInputDefectRecordService } private Integer getPartInspectionType(String organizeCode, String workCenterCode, String workCellCode) { + if (StringUtils.isEmpty(workCenterCode) || StringUtils.isEmpty(workCellCode)) { + return null; + } DdlPackBean packBean = DdlPackBean.getDdlPackBean(organizeCode); DdlPreparedPack.getStringEqualPack(workCenterCode, "workCenterCode", packBean); DdlPreparedPack.getStringEqualPack(workCellCode, "workCellCode", packBean); From 640d87bc3b365de40c005fe3a9340791e2ca4f7c Mon Sep 17 00:00:00 2001 From: jason Date: Tue, 3 Jun 2025 13:41:46 +0800 Subject: [PATCH 6/7] =?UTF-8?q?47318=20=E7=94=B5=E5=AD=90=E5=8C=96?= =?UTF-8?q?=E6=A3=80=E9=AA=8C=E5=85=B6=E4=BB=96=E5=B7=A5=E4=BD=8D=E4=B8=8D?= =?UTF-8?q?=E8=89=AF=E9=9C=80=E6=8A=A5=E9=94=99=E6=8F=90=E7=A4=BA=EF=BC=8C?= =?UTF-8?q?=E8=B4=A8=E6=A3=80=E5=8D=95=E8=B5=8B=E5=80=BC=E9=80=89=E6=8B=A9?= =?UTF-8?q?=E7=9A=84=E4=BA=A7=E7=BA=BF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../busi/MesInputDefectRecordService.java | 48 +++++++++++++++++++++- 1 file changed, 47 insertions(+), 1 deletion(-) 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 1be5af7..8f79f65 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 @@ -16,6 +16,7 @@ import cn.estsh.i3plus.mes.pcn.api.iservice.busi.ISyncFuncService; import cn.estsh.i3plus.platform.common.convert.ConvertBean; import cn.estsh.i3plus.platform.common.exception.ImppExceptionEnum; import cn.estsh.i3plus.platform.common.tool.TimeTool; +import cn.estsh.i3plus.platform.common.util.MesConstWords; import cn.estsh.i3plus.pojo.base.bean.DdlPackBean; import cn.estsh.i3plus.pojo.base.enumutil.CommonEnumUtil; import cn.estsh.i3plus.pojo.base.tool.DdlPreparedPack; @@ -132,6 +133,9 @@ public class MesInputDefectRecordService implements IMesInputDefectRecordService @Autowired private MesWorkCellRepository workCellRDao; + @Autowired + private MesWorkCenterRepository mesWorkCenterRDao; + @Override public MesPartInspectionViewModel queryPartInspection(MesPartInspectionInputModel model) { @@ -145,6 +149,7 @@ public class MesInputDefectRecordService implements IMesInputDefectRecordService ValidatorBean.checkNotNull(model.getFrontBack(), "正反面不能为空"); //检查条码 MesProduceSn produceSn = checkProduceSn(model.getSn(), model.getOrganizeCode()); + checkOtherWorkCell(produceSn, model, model.getOrganizeCode()); //获取NC-零件检测-单据 partInspection = getPartInspection(produceSn, model, model.getOrganizeCode()); @@ -252,7 +257,6 @@ public class MesInputDefectRecordService implements IMesInputDefectRecordService if (!StringUtil.isEmpty(produceSn)){ model.setCustSn(produceSn.getCustSn()); model.setSn(produceSn.getProductSn()); - model.setWorkCenterCode(produceSn.getWorkCenterCode()); //排序产线 更新工单的 qcStatus MesWorkCenter centerDb = prodOrgExtService.getWorkCenterDb(model.getOrganizeCode(), produceSn.getWorkCenterCode()); if (!StringUtil.isEmpty(centerDb)){ @@ -797,6 +801,48 @@ public class MesInputDefectRecordService implements IMesInputDefectRecordService } /** + * 检查条码是否在其他工位判为不良 + * @param produceSn 条码 + * @param inputModel 前端传入参数 + * @param org 工厂代码 + */ + private void checkOtherWorkCell(MesProduceSn produceSn,MesPartInspectionInputModel inputModel, String org) { + if (StringUtils.isEmpty(inputModel.getWorkCellCode())) { + return; + } + int refundFlag = CommonEnumUtil.TRUE_OR_FALSE.FALSE.getValue(); + if (inputModel.getOptType() == 2) { + refundFlag = CommonEnumUtil.TRUE_OR_FALSE.TRUE.getValue(); + } + + //根据条码找最近一条单据 + DdlPackBean packBean = DdlPackBean.getDdlPackBean(org); + DdlPreparedPack.getStringEqualPack(produceSn.getProductSn(), "sn", packBean); + DdlPreparedPack.getStringNoEqualPack(inputModel.getWorkCellCode(), "workCellCode", packBean); + DdlPreparedPack.getStringNotBlanklPack("workCellCode", packBean); + DdlPreparedPack.getNumEqualPack(refundFlag, "refundFlag", packBean); + DdlPreparedPack.getNumEqualPack(MesExtEnumUtil.PART_INSPECTION_STATUS.FAIL.getValue(), "inspectionStatus", packBean); + DdlPreparedPack.getOrderByPack(new Object[]{CommonEnumUtil.ASC_OR_DESC.DESC.getValue()}, new String[]{"createDatetime"}, packBean); + MesPartInspection partInspection = partInspectionRepository.getByProperty(packBean); + if (partInspection != null) { + MesWorkCenter mesWorkCenter = null; + if (!StringUtils.isEmpty(partInspection.getWorkCenterCode())) { + mesWorkCenter = mesWorkCenterRDao.getByProperty( + new String[]{MesConstWords.ORGANIZE_CODE, MesConstWords.IS_DELETED, MesConstWords.IS_VALID, "workCenterCode"}, + new Object[]{org, CommonEnumUtil.TRUE_OR_FALSE.FALSE.getValue(), CommonEnumUtil.IS_VAILD.VAILD.getValue(), partInspection.getWorkCenterCode()}); + } + final String workCenterName = mesWorkCenter != null ? mesWorkCenter.getWorkCenterName() : partInspection.getWorkCenterCode(); + MesWorkCell mesWorkCell = workCellRDao.getByProperty(new String[]{MesConstWords.ORGANIZE_CODE, MesConstWords.IS_DELETED, MesConstWords.IS_VALID, "workCellCode"}, + new Object[]{org, CommonEnumUtil.TRUE_OR_FALSE.FALSE.getValue(), CommonEnumUtil.IS_VAILD.VAILD.getValue(), partInspection.getWorkCellCode()}); + final String workCellName = mesWorkCell != null ? mesWorkCell.getWorkCellName() : partInspection.getWorkCellCode(); + throw ImppExceptionBuilder.newInstance().setErrorCode(ImppExceptionEnum.BUSINESS_EXCEPTION_DATA_ERROR.getCode()) + .setErrorDetail(String.format("【%s】条码在产线【%s】工位【%s】判为不良,请检查数据", partInspection.getSn(), workCenterName, workCellName)) + .setSystemID(CommonEnumUtil.SOFT_TYPE.MES.getCode()) + .build(); + } + } + + /** * 获取NC-零件检测-单据 * * @param inputModel From b1f6ded5e62a4e0ef016fe1935d5d7b8d6f9cdac Mon Sep 17 00:00:00 2001 From: jason Date: Wed, 4 Jun 2025 16:30:18 +0800 Subject: [PATCH 7/7] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E7=94=B5=E5=AD=90?= =?UTF-8?q?=E5=8C=96=E6=A3=80=E9=AA=8C=E6=BC=94=E7=A4=BA=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../serviceimpl/busi/MesInputDefectRecordService.java | 14 ++------------ 1 file changed, 2 insertions(+), 12 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 8f79f65..c2f6c79 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 @@ -810,17 +810,12 @@ public class MesInputDefectRecordService implements IMesInputDefectRecordService if (StringUtils.isEmpty(inputModel.getWorkCellCode())) { return; } - int refundFlag = CommonEnumUtil.TRUE_OR_FALSE.FALSE.getValue(); - if (inputModel.getOptType() == 2) { - refundFlag = CommonEnumUtil.TRUE_OR_FALSE.TRUE.getValue(); - } - //根据条码找最近一条单据 DdlPackBean packBean = DdlPackBean.getDdlPackBean(org); DdlPreparedPack.getStringEqualPack(produceSn.getProductSn(), "sn", packBean); DdlPreparedPack.getStringNoEqualPack(inputModel.getWorkCellCode(), "workCellCode", packBean); DdlPreparedPack.getStringNotBlanklPack("workCellCode", packBean); - DdlPreparedPack.getNumEqualPack(refundFlag, "refundFlag", packBean); + DdlPreparedPack.getNumEqualPack(MesExtEnumUtil.PART_INSPECTION_NC_STATUS.CREATE.getValue(), "ncStatus", packBean); DdlPreparedPack.getNumEqualPack(MesExtEnumUtil.PART_INSPECTION_STATUS.FAIL.getValue(), "inspectionStatus", packBean); DdlPreparedPack.getOrderByPack(new Object[]{CommonEnumUtil.ASC_OR_DESC.DESC.getValue()}, new String[]{"createDatetime"}, packBean); MesPartInspection partInspection = partInspectionRepository.getByProperty(packBean); @@ -1471,16 +1466,11 @@ public class MesInputDefectRecordService implements IMesInputDefectRecordService 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 != null && workCell.getType() != null) { if (workCell.getType() == MesExtEnumUtil.MES_WORK_CELL_CHECK_TYPE.PRODUCT_CELL.getValue()) { type = MesExtEnumUtil.MES_PART_INSPECTION_TYPE.ONLINE_CHECK; } else if (workCell.getType() == MesExtEnumUtil.MES_WORK_CELL_CHECK_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;