转PBOM -直发重复问题

This commit is contained in:
大米 2024-09-14 08:57:22 +08:00
parent dfaf9c402b
commit b947077459
6 changed files with 10 additions and 10 deletions

View File

@ -123,7 +123,7 @@ public class EBomToPBom extends EBomToPbomBase {
continue;
}
//处理子级BOM
mergeChild= handlerArtPackage(parentEnt,mergeChild,facCode,parentList);
mergeChild= handlerArtPackage(parentEnt,mergeChild,facCode,parentList,vo.getVirtualPartType());
//子级
if (CollUtil.isNotEmpty(mergeChild)) {
//合并子级

View File

@ -123,7 +123,7 @@ public class EBomToPBomFor31 extends EBomToPbomBase {
continue;
}
//处理bom子级
mergeChild= handlerArtPackage(parentEnt,mergeChild,facCode,parentList);
mergeChild= handlerArtPackage(parentEnt,mergeChild,facCode,parentList,vo.getVirtualPartType());
//子级
if (CollUtil.isNotEmpty(mergeChild)) {
for (BomNewEbomParentVO eb : mergeChild) {

View File

@ -232,7 +232,7 @@ public abstract class EBomToPbomBase {
/**
* 处理PBOM新增物料
*/
protected List<BomNewEbomParentVO> handlerArtPackage(BomNewPbomParentEntity parent , List<BomNewEbomParentVO> newBomChildren ,String facCode ,List<BomNewEbomParentVO> parentList){
protected List<BomNewEbomParentVO> handlerArtPackage(BomNewPbomParentEntity parent , List<BomNewEbomParentVO> newBomChildren ,String facCode ,List<BomNewEbomParentVO> parentList,Integer parentVirtualPartType){
BomNewPbomParentEntity oldParent = SpringUtil.getBean(BomNewPbomParentService.class).lambdaQuery().eq(BomNewPbomParentEntity::getMaterialNo, parent.getMaterialNo())
.eq(BomNewPbomParentEntity::getFacCode, facCode).last(" order by current_version desc limit 1").one();
List<String> delResult=new ArrayList<>();
@ -246,11 +246,11 @@ public abstract class EBomToPbomBase {
for (BomNewPbomParentVO oldPBomAddItem : oldPBomAddChildren) {
//加入当前BOM明细中
if(!newBomChildrenMap.containsKey(oldPBomAddItem.getMaterialNo()) && !VirtualPackageTypeEnum.DIRECT_DELIVERY_PACKAGE.equalsValue(oldPBomAddItem.getVirtualPartType()) && !VirtualPackageTypeEnum.PRE_ASSEMBLY_PACKAGE.equalsValue(oldPBomAddItem.getVirtualPartType())) {
if(!newBomChildrenMap.containsKey(oldPBomAddItem.getMaterialNo()) && !VirtualPackageTypeEnum.DIRECT_DELIVERY_PACKAGE.equalsValue(parentVirtualPartType) && !VirtualPackageTypeEnum.PRE_ASSEMBLY_PACKAGE.equalsValue(parentVirtualPartType)) {
buildPBomAddChild(parent, facCode, oldPBomAddItem);
}
//直发包发货前-允许物料重复
if(VirtualPackageTypeEnum.DIRECT_DELIVERY_PACKAGE.equalsValue(oldPBomAddItem.getVirtualPartType()) || VirtualPackageTypeEnum.PRE_ASSEMBLY_PACKAGE.equalsValue(oldPBomAddItem.getVirtualPartType())) {
if(VirtualPackageTypeEnum.DIRECT_DELIVERY_PACKAGE.equalsValue(parentVirtualPartType) || VirtualPackageTypeEnum.PRE_ASSEMBLY_PACKAGE.equalsValue(parentVirtualPartType)) {
buildPBomAddChild(parent, facCode, oldPBomAddItem);
}

View File

@ -125,7 +125,7 @@ public class EBomToPBomForFormal31New extends FormalEBomToPbomBase {
continue;
}
//处理子级
mergeChild=handlerArtPackage(parentEnt,mergeChild,facCode,parentList);
mergeChild=handlerArtPackage(parentEnt,mergeChild,facCode,parentList,vo.getVirtualPartType());
//检查是否用户跟用户节点
if(parentEnt.getMaterialNo().equals(parent.getMaterialNo())) {
List<String> childMaterialNos = SpringUtil.getBean(BomNewPbomParentMapper.class).getPBomExistMaterialInChildForWorkList(parent.getMaterialNo());

View File

@ -125,7 +125,7 @@ public class EBomToPBomForFormalNew extends FormalEBomToPbomBase {
continue;
}
//处理子级
mergeChild=handlerArtPackage(parentEnt,mergeChild,facCode,parentList);
mergeChild=handlerArtPackage(parentEnt,mergeChild,facCode,parentList,vo.getVirtualPartType());
//检查是否用户跟用户节点
if(parentEnt.getMaterialNo().equals(parent.getMaterialNo())) {
List<String> childMaterialNos = SpringUtil.getBean(BomNewPbomParentMapper.class).getPBomExistMaterialInChildForWorkList(parent.getMaterialNo());

View File

@ -236,7 +236,7 @@ public abstract class FormalEBomToPbomBase {
/**
* 处理PBOM新增物料
*/
protected List<BomNewEbomParentVO> handlerArtPackage(BomNewPbomParentEntity parent , List<BomNewEbomParentVO> newBomChildren ,String facCode ,List<BomNewEbomParentVO> parentList){
protected List<BomNewEbomParentVO> handlerArtPackage(BomNewPbomParentEntity parent , List<BomNewEbomParentVO> newBomChildren ,String facCode ,List<BomNewEbomParentVO> parentList,Integer patentVirtualPartType){
BomNewPbomParentEntity oldParent = SpringUtil.getBean(BomNewPbomParentService.class).lambdaQuery().eq(BomNewPbomParentEntity::getMaterialNo, parent.getMaterialNo())
.eq(BomNewPbomParentEntity::getFacCode, facCode).last(" order by current_version desc limit 1").one();
List<String> delResult=new ArrayList<>();
@ -250,11 +250,11 @@ public abstract class FormalEBomToPbomBase {
for (BomNewPbomParentVO oldPBomAddItem : oldPBomAddChildren) {
//加入当前BOM明细中
if(!newBomChildrenMap.containsKey(oldPBomAddItem.getMaterialNo()) && !VirtualPackageTypeEnum.DIRECT_DELIVERY_PACKAGE.equalsValue(oldPBomAddItem.getVirtualPartType()) && !VirtualPackageTypeEnum.PRE_ASSEMBLY_PACKAGE.equalsValue(oldPBomAddItem.getVirtualPartType())) {
if(!newBomChildrenMap.containsKey(oldPBomAddItem.getMaterialNo()) && !VirtualPackageTypeEnum.DIRECT_DELIVERY_PACKAGE.equalsValue(patentVirtualPartType) && !VirtualPackageTypeEnum.PRE_ASSEMBLY_PACKAGE.equalsValue(patentVirtualPartType)) {
buildPBomAddChild(parent, facCode, oldPBomAddItem);
}
//直发包发货前-允许物料重复
if(VirtualPackageTypeEnum.DIRECT_DELIVERY_PACKAGE.equalsValue(oldPBomAddItem.getVirtualPartType()) || VirtualPackageTypeEnum.PRE_ASSEMBLY_PACKAGE.equalsValue(oldPBomAddItem.getVirtualPartType())) {
if(VirtualPackageTypeEnum.DIRECT_DELIVERY_PACKAGE.equalsValue(patentVirtualPartType) || VirtualPackageTypeEnum.PRE_ASSEMBLY_PACKAGE.equalsValue(patentVirtualPartType)) {
buildPBomAddChild(parent, facCode, oldPBomAddItem);
}