From 3a2e6f883f14825964819b8125062088bf9a9e91 Mon Sep 17 00:00:00 2001 From: jing's Date: Tue, 9 Jul 2024 09:59:13 +0800 Subject: [PATCH] =?UTF-8?q?=20=20=20*=20+=E7=94=B5=E6=8E=A7=E5=8F=91?= =?UTF-8?q?=E8=B4=A7=20=20=20=20=20=20=20=20=20=20*=20=20-=E7=94=B5?= =?UTF-8?q?=E6=8E=A7=E5=88=B6=E4=BD=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../domain/OptionalEBom/PublisMaterial.java | 28 ++++++++++--------- 1 file changed, 15 insertions(+), 13 deletions(-) diff --git a/nflg_project_dev/nflg-bom-new/src/main/java/com/nflg/product/bomnew/service/domain/OptionalEBom/PublisMaterial.java b/nflg_project_dev/nflg-bom-new/src/main/java/com/nflg/product/bomnew/service/domain/OptionalEBom/PublisMaterial.java index b47336f2..6ce4acb9 100644 --- a/nflg_project_dev/nflg-bom-new/src/main/java/com/nflg/product/bomnew/service/domain/OptionalEBom/PublisMaterial.java +++ b/nflg_project_dev/nflg-bom-new/src/main/java/com/nflg/product/bomnew/service/domain/OptionalEBom/PublisMaterial.java @@ -28,10 +28,7 @@ import lombok.Getter; import lombok.extern.slf4j.Slf4j; import nflg.product.common.constant.STATE; -import java.util.ArrayList; -import java.util.Collections; -import java.util.List; -import java.util.Map; +import java.util.*; import java.util.stream.Collectors; @Slf4j @@ -314,7 +311,7 @@ public class PublisMaterial { public List buildMaterialList(List optionList) throws NflgBusinessException { - if (deviceRowId == null || StrUtil.isEmpty(publishAddDTO.getGoodsDesc()) || StrUtil.isEmpty(publishAddDTO.getElectricDesc())) { + if (Objects.isNull(deviceRowId) || deviceRowId==0 || StrUtil.isEmpty(publishAddDTO.getGoodsDesc()) || StrUtil.isEmpty(publishAddDTO.getElectricDesc())) { throw new NflgBusinessException(STATE.BusinessError, "整机或电控数据不完整"); } @@ -328,10 +325,15 @@ public class PublisMaterial { OptionalMbomMaterialEntity genVirtualPackLevelMake1 = genVirtualPackLevelMake1(genVirtualPackLevelSend1.getRowId(), oaList); - //电控制作 - OptionalMbomMaterialEntity genVirtualPackElectricLevelMake2 = genVirtualPackElectricLevelMake2(genVirtualPackLevelMake1.getRowId(), oaList); + /** + * +电控发货 + * -电控制作 + * + */ //电控发货 - OptionalMbomMaterialEntity genVirtualPackElectricLevelSend2 = genVirtualPackElectricLevelSend2(genVirtualPackElectricLevelMake2.getRowId(), oaList); + OptionalMbomMaterialEntity genVirtualPackElectricLevelSend2 = genVirtualPackElectricLevelSend2(genVirtualPackLevelMake1.getRowId(), oaList); + //电控制作 + OptionalMbomMaterialEntity genVirtualPackElectricLevelMake2 = genVirtualPackElectricLevelMake2(genVirtualPackElectricLevelSend2.getRowId(), oaList); //机械 OptionalMbomMaterialEntity genVirtualPackMachineLevel2 = genVirtualPackMachineLevel2(genVirtualPackLevelMake1.getRowId(), optionList, oaList); @@ -340,7 +342,7 @@ public class PublisMaterial { //申请物料 try { mMap = SpringUtil.getBean(MaterialService.class).batchAddMaterial(oaList); - if (mMap == null) { + if (mMap == null || mMap.size()==0) { throw new Exception("申请物料编码出现异常"); } } catch (Exception e) { @@ -357,16 +359,16 @@ public class PublisMaterial { if (StrUtil.isEmpty(genVirtualPackLevelMake1.getMaterialNo())){ throw new NflgBusinessException(STATE.Error, "机型制作物料编码申请失败"); } + genVirtualPackElectricLevelSend2.setMaterialNo( mMap.get(String.valueOf(genVirtualPackElectricLevelSend2.getRowId())).getMaterialNo()) ; + if (StrUtil.isEmpty(genVirtualPackElectricLevelSend2.getMaterialNo())){ + throw new NflgBusinessException(STATE.Error, "电控发货物料编码申请失败"); + } genVirtualPackElectricLevelMake2.setMaterialNo( mMap.get(String.valueOf(genVirtualPackElectricLevelMake2.getRowId())).getMaterialNo()) ; if (StrUtil.isEmpty(genVirtualPackElectricLevelMake2.getMaterialNo())){ throw new NflgBusinessException(STATE.Error, "电控制作物料编码申请失败"); } - genVirtualPackElectricLevelSend2.setMaterialNo( mMap.get(String.valueOf(genVirtualPackElectricLevelSend2.getRowId())).getMaterialNo()) ; - if (StrUtil.isEmpty(genVirtualPackElectricLevelSend2.getMaterialNo())){ - throw new NflgBusinessException(STATE.Error, "电控发货物料编码申请失败"); - } if(StrUtil.isEmpty(genVirtualPackMachineLevel2.getMaterialNo())){