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())