parent
c003903a61
commit
77c84b12c6
|
|
@ -525,13 +525,13 @@ public class BomNewPbomParentService extends ServiceImpl<BomNewPbomParentMapper,
|
|||
return hasTechnologypackage;
|
||||
}
|
||||
//删除辅助物料
|
||||
List<BomNewPbomParentVO> noDelList = childListVO.stream()
|
||||
.filter(u -> !u.getMaterialCategoryCode().startsWith("1003")
|
||||
&& !u.getMaterialCategoryCode().startsWith("1020")
|
||||
&& !u.getMaterialCategoryCode().startsWith("1021")
|
||||
&& !u.getMaterialCategoryCode().equals(MaterialMainConstant.CATEGORYCODE_TECHNOLOGYPACKAGE))
|
||||
.collect(Collectors.toList());
|
||||
VUtils.isTure(CollUtil.isNotEmpty(noDelList)).throwMessage("非机加工件的子级只能删除辅助物料");
|
||||
// List<BomNewPbomParentVO> noDelList = childListVO.stream()
|
||||
// .filter(u -> !u.getMaterialCategoryCode().startsWith("1003")
|
||||
// && !u.getMaterialCategoryCode().startsWith("1020")
|
||||
// && !u.getMaterialCategoryCode().startsWith("1021")
|
||||
// && !u.getMaterialCategoryCode().equals(MaterialMainConstant.CATEGORYCODE_TECHNOLOGYPACKAGE))
|
||||
// .collect(Collectors.toList());
|
||||
// VUtils.isTure(CollUtil.isNotEmpty(noDelList)).throwMessage("非机加工件的子级只能删除辅助物料");
|
||||
|
||||
pbomChildService.getBaseMapper().delByRowId(paramDTO.getRowIdList());
|
||||
resetBomExist(parent.getRowId());
|
||||
|
|
|
|||
|
|
@ -26,6 +26,7 @@ import lombok.Getter;
|
|||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.*;
|
||||
import java.util.function.Function;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
public abstract class FormalEBomToPbomBase {
|
||||
|
|
@ -245,14 +246,14 @@ public abstract class FormalEBomToPbomBase {
|
|||
|
||||
//pBom 手工新增物料
|
||||
List<BomNewPbomParentVO> oldPBomAddChildren = oldChildren.stream().filter(u -> StrUtil.isBlank(u.getOriginalMaterialNo())).collect(Collectors.toList());
|
||||
Map<String, BomNewEbomParentVO> newBomChildrenMap = newBomChildren.stream().collect(Collectors.toMap(BomNewEbomParentVO::getMaterialNo, u -> u));
|
||||
Map<String, BomNewEbomParentVO> newBomChildrenMap = newBomChildren.stream().collect(Collectors.toMap(BomNewEbomParentVO::getMaterialNo, Function.identity(),(u,u1) -> u));
|
||||
|
||||
for (BomNewPbomParentVO oldPBomAddItem : oldPBomAddChildren) {
|
||||
//加入当前BOM明细中
|
||||
buildPBomAddChild(parent, facCode, oldPBomAddItem);
|
||||
|
||||
//如为工艺包,且在当前BOM中不存在
|
||||
if (BomConstant.ART_PACKAGE_MATERIAL_CATEGORY_CODE.equals(oldPBomAddItem.getMaterialCategoryCode()) && !newBomChildrenMap.containsKey(oldPBomAddItem.getMaterialNo())) {
|
||||
if (!VirtualPackageTypeEnum.PRE_ASSEMBLY_PACKAGE.equalsValue(oldPBomAddItem.getVirtualPartType()) && !VirtualPackageTypeEnum.DIRECT_DELIVERY_PACKAGE.equalsValue(oldPBomAddItem.getVirtualPartType()) && BomConstant.ART_PACKAGE_MATERIAL_CATEGORY_CODE.equals(oldPBomAddItem.getMaterialCategoryCode()) && !newBomChildrenMap.containsKey(oldPBomAddItem.getMaterialNo())) {
|
||||
//创建工艺包版本
|
||||
BomNewPbomParentEntity artParent = buildPBomParent(Convert.convert(BomNewEbomParentVO.class, oldPBomAddItem), facCode, parentList);
|
||||
//old 工艺包子级
|
||||
|
|
|
|||
Loading…
Reference in New Issue