From 7b16839f2924fb815bf23ff2556a79fd070e2cac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9B=B9=E9=B9=8F=E9=A3=9E?= Date: Tue, 23 Jul 2024 15:33:38 +0800 Subject: [PATCH] =?UTF-8?q?fix(ebom):=20=E8=B0=83=E6=95=B4=E5=88=A0?= =?UTF-8?q?=E9=99=A4=E8=99=9A=E6=8B=9F=E5=8C=85=E6=A0=A1=E9=AA=8C=E9=80=BB?= =?UTF-8?q?=E8=BE=91=E7=9A=84=E4=BD=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/nflg/product/bomnew/api/user/EbomApi.java | 10 ++++++++-- .../bomnew/service/BomNewEbomParentService.java | 9 ++++----- 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/nflg_project_dev/nflg-bom-new/src/main/java/com/nflg/product/bomnew/api/user/EbomApi.java b/nflg_project_dev/nflg-bom-new/src/main/java/com/nflg/product/bomnew/api/user/EbomApi.java index c5057669..268321c9 100644 --- a/nflg_project_dev/nflg-bom-new/src/main/java/com/nflg/product/bomnew/api/user/EbomApi.java +++ b/nflg_project_dev/nflg-bom-new/src/main/java/com/nflg/product/bomnew/api/user/EbomApi.java @@ -10,6 +10,8 @@ import com.mzt.logapi.starter.annotation.LogRecord; import com.nflg.product.base.core.api.BaseApi; import com.nflg.product.base.core.conmon.util.SessionUtil; import com.nflg.product.bomnew.constant.EBomConstant; +import com.nflg.product.bomnew.constant.EBomSourceEnum; +import com.nflg.product.bomnew.constant.VirtualPackageTypeEnum; import com.nflg.product.bomnew.pojo.dto.*; import com.nflg.product.bomnew.pojo.query.BomExceptionQuery; import com.nflg.product.bomnew.pojo.query.BomNewEbomMaterialQuery; @@ -370,14 +372,18 @@ public class EbomApi extends BaseApi { void checkDeleteRule(BomNewEBomParentEditDTO dto){ + VUtils.isTure(dto.getParent().getMaterialNo().startsWith("31") + && dto.getDelDatas().stream().anyMatch(it -> Objects.equals(it.getSource(), EBomSourceEnum.FROM_MDM.getValue()) + && !Objects.equals(it.getVirtualPartType(), VirtualPackageTypeEnum.UN_VIRTUAL_PACKAGE.getValue()))) + .throwMessage("要删除发货包请在生成发货包页面取消选中"); if(CollUtil.isNotEmpty(dto.getDelDatas()) && CollUtil.isNotEmpty(dto.getDatas())){ List delList=dto.getDelDatas().stream().map(BomNewEbomParentVO::getRowId).collect(Collectors.toList()); - List dataList=dto.getDatas().stream().filter(u-> ObjectUtil.isNotNull(u.getRowId())&& u.getRowId().longValue()>0).map(BomNewEbomParentVO::getRowId).collect(Collectors.toList()); + List dataList = dto.getDatas().stream().filter(u -> ObjectUtil.isNotNull(u.getRowId()) && u.getRowId() > 0).map(BomNewEbomParentVO::getRowId).collect(Collectors.toList()); //交 删除编辑出现相同(互斥) - List sameList= CollectionUtil.intersection(delList,dataList).stream().collect(Collectors.toList()); + List sameList = new ArrayList<>(CollectionUtil.intersection(delList, dataList)); if(CollUtil.isNotEmpty(sameList)){ VUtils.isTure(true).throwMessage(StrUtil.format("删除数据与编辑数据出现相同行 {}",StrUtil.join(",",sameList))); } diff --git a/nflg_project_dev/nflg-bom-new/src/main/java/com/nflg/product/bomnew/service/BomNewEbomParentService.java b/nflg_project_dev/nflg-bom-new/src/main/java/com/nflg/product/bomnew/service/BomNewEbomParentService.java index fb04f11f..d694cff0 100644 --- a/nflg_project_dev/nflg-bom-new/src/main/java/com/nflg/product/bomnew/service/BomNewEbomParentService.java +++ b/nflg_project_dev/nflg-bom-new/src/main/java/com/nflg/product/bomnew/service/BomNewEbomParentService.java @@ -35,7 +35,6 @@ import lombok.extern.slf4j.Slf4j; import nflg.product.common.constant.STATE; import nflg.product.common.vo.ResultVO; import org.apache.commons.lang3.StringUtils; -import org.apache.ibatis.annotations.Param; import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; @@ -2221,10 +2220,10 @@ public class BomNewEbomParentService extends ServiceImpl Objects.equals(c.getSource(), EBomSourceEnum.FROM_MDM.getValue())) - && delChildList.stream().anyMatch(d -> !Objects.equals(d.getVirtualPartType(), VirtualPackageTypeEnum.UN_VIRTUAL_PACKAGE.getValue()))) - .throwMessage("请重新生成发货包"); + // VUtils.isTure(parent.getMaterialNo().startsWith("31") + // && delChildList.stream().anyMatch(c -> Objects.equals(c.getSource(), EBomSourceEnum.FROM_MDM.getValue())) + // && delChildList.stream().anyMatch(d -> !Objects.equals(d.getVirtualPartType(), VirtualPackageTypeEnum.UN_VIRTUAL_PACKAGE.getValue()))) + // .throwMessage("请重新生成发货包"); //检查有bom数据关系是否可以删? // List check2List = delList.stream().filter(u -> Objects.equals(EBomSourceEnum.FROM_BOM.getValue(), u.getSource())