diff --git a/mes-core/src/main/java/com/foreverwin/iep/prd/service/ZLotMaterialCompleteTransactionService.java b/mes-core/src/main/java/com/foreverwin/iep/prd/service/ZLotMaterialCompleteTransactionService.java index 21f80b50..413ddec7 100644 --- a/mes-core/src/main/java/com/foreverwin/iep/prd/service/ZLotMaterialCompleteTransactionService.java +++ b/mes-core/src/main/java/com/foreverwin/iep/prd/service/ZLotMaterialCompleteTransactionService.java @@ -13,5 +13,5 @@ import org.springframework.transaction.annotation.Transactional; public interface ZLotMaterialCompleteTransactionService extends IService { @Transactional - void saveMaterialCompleteData(String site, String lotNo, String shopOrder); + void saveMaterialCompleteData(String site, String lotNo, String shopOrder, String fabNo); } diff --git a/mes-core/src/main/java/com/foreverwin/iep/prd/service/impl/ZLotMaterialCompleteTransactionServiceImpl.java b/mes-core/src/main/java/com/foreverwin/iep/prd/service/impl/ZLotMaterialCompleteTransactionServiceImpl.java index 980bffbf..9baa93bf 100644 --- a/mes-core/src/main/java/com/foreverwin/iep/prd/service/impl/ZLotMaterialCompleteTransactionServiceImpl.java +++ b/mes-core/src/main/java/com/foreverwin/iep/prd/service/impl/ZLotMaterialCompleteTransactionServiceImpl.java @@ -38,7 +38,7 @@ public class ZLotMaterialCompleteTransactionServiceImpl extends ServiceImpl queryWrapper = new QueryWrapper<>(); queryWrapper.lambda().eq(WmsInventoryLog::getMaterialLot, lotNo).eq(WmsInventoryLog::getSite, site).orderByDesc(WmsInventoryLog::getDateCreate); @@ -61,6 +61,7 @@ public class ZLotMaterialCompleteTransactionServiceImpl extends ServiceImpl fabNoList = baseMapper.findFabNo(resrceBo); + if (CollectionUtils.isNotEmpty(fabNoList)) { + fabNo = fabNoList.get(0); + } else { + throw BusinessException.build("根据设备【"+ resrce +"】未查询到车间!"); + } + } else { + fabNo = null; + } // 产出物料数量 List operationOutListDTOList = operationOutDTO.getOperationOutListDTOList(); // 使用 Stream API 按工单分组 @@ -495,19 +508,19 @@ public class OperationOutServiceImpl extends ServiceImpl lotBasisList = new ArrayList<>(); diff --git a/mes-db/src/main/java/com/foreverwin/iep/wip/mapper/OperationOutMapper.java b/mes-db/src/main/java/com/foreverwin/iep/wip/mapper/OperationOutMapper.java index 56baa5a2..dff6b97b 100644 --- a/mes-db/src/main/java/com/foreverwin/iep/wip/mapper/OperationOutMapper.java +++ b/mes-db/src/main/java/com/foreverwin/iep/wip/mapper/OperationOutMapper.java @@ -38,4 +38,6 @@ public interface OperationOutMapper extends MomBaseMapper { OperationOutListDTO readOperationOutByBarCode(@Param("dto") OperationOutDTO operationOutDTO); List readBomComponent(@Param("site") String site, @Param("shopOrder") String shopOrder, @Param("operationBo") String operationBo); + + List findFabNo(@Param("resrceBo") String resrceBo); } diff --git a/mes-db/src/main/resources/mapper/wip/OperationOutMapper.xml b/mes-db/src/main/resources/mapper/wip/OperationOutMapper.xml index b7a93980..98ed47c2 100644 --- a/mes-db/src/main/resources/mapper/wip/OperationOutMapper.xml +++ b/mes-db/src/main/resources/mapper/wip/OperationOutMapper.xml @@ -259,4 +259,18 @@ and bc.BOM_COMPONENT_TYPE not in ('B','C') and bc.OPERATION_BO = #{operationBo} + + +