Merge branch 'feature/DM/nflg-bom-transition' of http://192.168.0.40:3000/root/nflg_project into feature/DM/nflg-bom-transition

This commit is contained in:
曹鹏飞 2024-09-03 10:56:40 +08:00
commit 82af5dc6f5
14 changed files with 111 additions and 61 deletions

View File

@ -59,6 +59,8 @@ public class MaterialMainExcelApi extends BaseApi {
EecExcelUtil.setResponseExcelHeader(response, categoryCode);
if (categoryCode.startsWith("30")) {
throw new NflgBusinessException(STATE.ParamErr, "整机物料不可批量导入");
} else if (categoryCode.startsWith("60")) {
throw new NflgBusinessException(STATE.ParamErr, "服务物料不可批量导入");
}
if (categoryCode.startsWith("20") || categoryCode.startsWith("22")) {
new Workbook("物料导入", "").addSheet(new ListSheet<>(categoryCode, ImmutableList.of(new MaterialSelfExcelDTO()))).writeTo(response.getOutputStream());

View File

@ -474,6 +474,7 @@ public class MaterialUpdateBillService extends ServiceImpl<MaterialUpdateBillMap
notFreezeSet.add(data.getMaterialNo());
}
}
this.validateFreezeStateChangeOther(ents, deptEnt.getDptCode());
this.saveBatch(ents);
//同步OA
materialUpdateToOAService.sysncToOaOnleState(ents);
@ -642,6 +643,7 @@ public class MaterialUpdateBillService extends ServiceImpl<MaterialUpdateBillMap
return ResultVO.error(checkMaterialDesc.getMsg());
}
}
this.validateFreezeStateChangeOther(ents, deptEnt.getDptCode());
this.saveBatch(ents);
//同步OA
materialUpdateToOAService.sysnToOa(ents);
@ -649,6 +651,23 @@ public class MaterialUpdateBillService extends ServiceImpl<MaterialUpdateBillMap
return ResultVO.success(Boolean.TRUE);
}
// 申请部门是 营销中心11,21变更由冻结改成其他状态不允许改成激活
private void validateFreezeStateChangeOther(List<MaterialUpdateBillEntity> updateList, String applyDeptCode) {
if (CollectionUtil.isEmpty(updateList)) {
return;
}
if (!applyDeptCode.contains("营销中心")) {
return;
}
List<MaterialUpdateBillEntity> filterList = updateList.stream().filter(update -> (update.getOldCategoryCode().startsWith("10") || update.getOldCategoryCode().startsWith("20"))
&& update.getOldMaterialState().equals(MaterialStateEnum.FROZEN.getValue())
&& (ObjectUtil.isNotEmpty(update.getNewMaterialState()) && update.getNewMaterialState().equals(MaterialStateEnum.ACTIVATE.getValue()))).collect(Collectors.toList());
if (CollectionUtil.isNotEmpty(filterList)) {
List<String> materialNos = filterList.stream().map(MaterialUpdateBillEntity::getMaterialNo).collect(Collectors.toList());
throw new NflgBusinessException(STATE.ParamErr, StrUtil.join(",", materialNos).concat("物料解冻时,禁止改成激活"));
}
}
/**
* 获取物料分类tree
*

View File

@ -300,6 +300,10 @@ public class BomNewPbomParentVO extends BaseMaterialVO implements Serializable {
@ApiModelProperty(value = "来源状态1-EBOM导入、2-PBOM创建、3-E->P修改")
private String sourceStatusName;
//PBOM发起变更时漏掉该值 by luohj 240828
@ApiModelProperty("来源行-父项物料编码")
private String sourceParentMaterialNo;
@ApiModelProperty("原始物料编码")
private String originalMaterialNo;

View File

@ -383,7 +383,7 @@ public class BomNewEbomParentService extends ServiceImpl<BomNewEbomParentMapper,
if (CollUtil.isNotEmpty(materialNos)) {
List<BomNewEbomParentEntity> list = this.lambdaQuery().in(BomNewEbomParentEntity::getMaterialNo, materialNos)
// .eq(!EBomStatusEnum.PUBLISHED.equalsValue(parent.getStatus()), BomNewEbomParentEntity::getLastVersionIs, 1)
.eq(EBomStatusEnum.PUBLISHED.equalsValue(parent.getStatus()), BomNewEbomParentEntity::getStatus, EBomStatusEnum.PUBLISHED.getValue()).list();
.eq(type.equals(1), BomNewEbomParentEntity::getStatus, EBomStatusEnum.PUBLISHED.getValue()).list();
// if (EBomStatusEnum.CHECKED.equalsValue(parent.getStatus())) {
// list = list.stream().filter(u -> EBomStatusEnum.CHECKED.equalsValue(u.getStatus())).collect(Collectors.toList());
// }

View File

@ -340,7 +340,8 @@ public class BomNewPbomExportToSAPImpl implements IBomNewPbomExportToSAP {
, BomNewPbomChildEntity::getMaterialUnit, BomNewPbomChildEntity::getMaterialDesc
, BomNewPbomChildEntity::getVirtualPartType, BomNewPbomChildEntity::getProjectType
, BomNewPbomChildEntity::getFacCode, BomNewPbomChildEntity::getMaterialCategoryCode
, BomNewPbomChildEntity::getRowId)
, BomNewPbomChildEntity::getRowId
,BomNewPbomChildEntity::getSourceParentMaterialNo)
.eq(BomNewPbomChildEntity::getParentRowId, parent.getRowId())
.orderByAsc(BomNewPbomChildEntity::getOrderNumber)
.list();

View File

@ -326,11 +326,8 @@ public class BomNewPbomParentService extends ServiceImpl<BomNewPbomParentMapper,
List<String> materialNos = parentChild.stream().map(BaseMaterialVO::getMaterialNo).collect(Collectors.toList());
if (CollUtil.isNotEmpty(materialNos)) {
List<BomNewPbomParentEntity> list = this.lambdaQuery().in(BomNewPbomParentEntity::getMaterialNo, materialNos)
// .eq(PBomStatusEnum.PUBLISH.equalsValue(parent.getStatus()), BomNewPbomParentEntity::getLastVersionIs, 1)
// .lt(!PBomStatusEnum.PUBLISH.equalsValue(parent.getStatus()),BomNewPbomParentEntity::getStatus,PBomStatusEnum.PUBLISH.getValue())
// .eq(PBomStatusEnum.PUBLISH.equalsValue(parent.getStatus()),BomNewPbomParentEntity::getStatus, PBomStatusEnum.PUBLISH.getValue())
.eq(PBomStatusEnum.PUBLISH.getValue() > parent.getStatus(), BomNewPbomParentEntity::getLastVersionIs, 1)
.ge(PBomStatusEnum.PUBLISH.getValue() <= parent.getStatus(), BomNewPbomParentEntity::getStatus, PBomStatusEnum.PUBLISH.getValue())
.eq(type.equals(0), BomNewPbomParentEntity::getLastVersionIs, 1)
.ge(type.equals(1), BomNewPbomParentEntity::getStatus, PBomStatusEnum.PUBLISH.getValue())
.eq(BomNewPbomParentEntity::getFacCode,parent.getFacCode())
.list();
@ -1138,7 +1135,7 @@ public class BomNewPbomParentService extends ServiceImpl<BomNewPbomParentMapper,
List<Long> bomRowIds = allBom.stream().filter(u -> PBomStatusEnum.WAIT_PUBLISH.equalsValue(u.getStatus()) && u.getBomRowId() > 0).map(u -> u.getBomRowId()).collect(Collectors.toList());
List<String> parentMaterialNos = allBom.stream().filter(u -> PBomStatusEnum.WAIT_PUBLISH.equalsValue(u.getStatus()) && u.getBomRowId() > 0).map(u->u.getMaterialNo()).collect(Collectors.toList());
parentMaterialNos.add(parent.getMaterialNo());
//Integer state = (parent.getMaterialNo().startsWith("31") && parent.getFacCode().equals(EBomConstant.MAIN_FACTORY_CODE_1010)) ? PBomStatusEnum.WAIT_FACTORY.getValue() : PBomStatusEnum.PUBLISH.getValue();
Integer state = parent.getMaterialNo().startsWith("31") ? PBomStatusEnum.FACTORY_CONFIRM.getValue() : PBomStatusEnum.PUBLISH.getValue();
@ -1153,25 +1150,25 @@ public class BomNewPbomParentService extends ServiceImpl<BomNewPbomParentMapper,
}
else {
bomRowIds.add(bomRowId);
parentMaterialNos.add(parent.getMaterialNo());
}
this.getBaseMapper().bomRelease(state, SessionUtil.getUserName(), bomRowIds);
//同步sap
// saySyncDEMO();
// importSap(parent,allBom);
//记录-BOM版本RowId
List<BomNewPbomChildEntity> pBomChildren = new ArrayList<>();
allBom.forEach(k -> {
BomNewPbomChildEntity entChild = new BomNewPbomChildEntity();
entChild.setRowId(k.getRowId());
entChild.setBomVersionRowId(k.getBomRowId());
pBomChildren.add(entChild);
});
if (CollUtil.isNotEmpty(pBomChildren)) {
pbomChildService.updateBatchById(pBomChildren);
}
if(CollUtil.isNotEmpty(bomRowIds)) {
this.getBaseMapper().bomRelease(state, SessionUtil.getUserName(), bomRowIds);
//记录-BOM版本RowId
List<BomNewPbomChildEntity> pBomChildren = new ArrayList<>();
allBom.forEach(k -> {
BomNewPbomChildEntity entChild = new BomNewPbomChildEntity();
entChild.setRowId(k.getRowId());
entChild.setBomVersionRowId(k.getBomRowId());
pBomChildren.add(entChild);
});
if (CollUtil.isNotEmpty(pBomChildren)) {
pbomChildService.updateBatchById(pBomChildren);
}
//历史版本转移到formal正式工作表
pBomToFormal(bomRowIds, parentMaterialNos,parent.getFacCode());
//历史版本转移到formal正式工作表
pBomToFormal(bomRowIds, parentMaterialNos, parent.getFacCode());
}
// SpringUtil.getBean(BomNewPbomParentFormalService.class).copyPbomFormal(bomRowId);
} catch (Exception ex) {
@ -1363,6 +1360,10 @@ public class BomNewPbomParentService extends ServiceImpl<BomNewPbomParentMapper,
t1.setIDNRK("");
t1.setPOTX1(c.getMaterialDesc());
}
//项目类别为F项则给POTX1 赋值来源EBOM的父级物料编码 by luohj 20240826
if(ProjectTypeInputTypeEnum.ProjectTypeEnum.TYPE_F.getValue().equalsIgnoreCase(c.getProjectType())){
t1.setPOTX1(c.getSourceParentMaterialNo());
}
t1.setDATUM(dateYMD);
t1s.add(t1);

View File

@ -77,6 +77,8 @@ public class ChangeImpactUpgrade extends EBomToPbomBase {
childEnt.setParentRowId(vParent.getRowId());
childEnt.setFacCode(facCode);
childEnt.setIdentityNo(StrUtil.join("-", vParent.getMaterialNo(), eb.getMaterialNo()));
//原ebom父级编码 by luohj 240828
childEnt.setSourceParentMaterialNo(eb.getSourceParentMaterialNo());
childEnt.setOriginalMaterialNo(eb.getMaterialNo());
childEnt.setOriginalProjectType(eb.getProjectType());
childEnt.setOriginalNum(eb.getNum());

View File

@ -60,7 +60,7 @@ public class EBomToPBom extends EBomToPbomBase {
//buildPBomParent(parent, facCode);
for (BomNewEbomParentVO vo : parentList) {
String hasConvertKey = StrUtil.join("-", facCode, vo.getBomRowId());
if (hasConvert.contains(hasConvertKey) || (PBomStatusEnum.PUBLISH.equalsValue(vo.getStatus()) && !VirtualPackageTypeEnum.DIRECT_DELIVERY_PACKAGE.equalsValue(vo.getVirtualPartType()) && !VirtualPackageTypeEnum.PRE_ASSEMBLY_PACKAGE.equalsValue(vo.getVirtualPartType()))) {
if (hasConvert.contains(hasConvertKey)) {
continue;
}
hasConvert.add(hasConvertKey);
@ -77,9 +77,9 @@ public class EBomToPBom extends EBomToPbomBase {
List<BomNewEbomParentVO> child = result.stream().filter(u -> u.getParentRowId().equals(vo.getBomRowId()) && !childDelMaterialNos.contains(u.getMaterialNo())).distinct().collect(Collectors.toList());
List<BomNewEbomParentVO> mergeChild = mergeChild(child);
//判断pbom 是否一致
if( compareContentIsSame(vo, mergeChild, facCode)){
continue;
}
// if( compareContentIsSame(vo, mergeChild, facCode) && !vo.getMaterialNo().equals(parent.getMaterialNo())){
// continue;
// }
BomNewPbomParentEntity parentEnt = buildPBomParent(vo, facCode,parentList);
if(Objects.isNull(parentEnt)){
continue;
@ -96,6 +96,8 @@ public class EBomToPBom extends EBomToPbomBase {
childEnt.setSourceRowId(eb.getRowId());
childEnt.setIdentityNo(StrUtil.join("-", parentEnt.getMaterialNo(), eb.getMaterialNo()));
childEnt.setOriginalMaterialNo(eb.getMaterialNo());
//原ebom父级编码 by luohj 240828
childEnt.setSourceParentMaterialNo(eb.getSourceParentMaterialNo());
childEnt.setOriginalProjectType(eb.getProjectType());
childEnt.setOriginalNum(eb.getNum());
childEnt.setCreatedTime(LocalDateTime.now());

View File

@ -65,8 +65,9 @@ public class EBomToPBomFor31 extends EBomToPbomBase {
for (BomNewEbomParentVO data : deliveryPackage1010) {
List<BomNewEbomParentVO> subVos = new ArrayList<>();
if (data.getMaterialName().contains("仙桃") ) { //只获取下降虚拟包(排除仙桃油漆包)
if(!data.getMaterialName().contains(VirtualPackageTypeEnum.PAINT_PACKAGE.getDescription())) {
subVos.add(data);
if(!VirtualPackageTypeEnum.PAINT_PACKAGE.getValue().equals(data.getVirtualPartType())) {
subVos.addAll(result.stream().filter(u -> u.getParentRowId().equals(data.getBomRowId())).collect(Collectors.toList()));
}
} else {
@ -102,7 +103,7 @@ public class EBomToPBomFor31 extends EBomToPbomBase {
.collect(Collectors.toList()), BomNewEbomParentVO::getBomRowId);
for (BomNewEbomParentVO vo : parentList) {
String hasConvertKey = StrUtil.join("-", facCode, vo.getBomRowId());
if (hasConvert.contains(hasConvertKey) || (PBomStatusEnum.PUBLISH.equalsValue(vo.getStatus()) && !VirtualPackageTypeEnum.DIRECT_DELIVERY_PACKAGE.equalsValue(vo.getVirtualPartType()) && !VirtualPackageTypeEnum.PRE_ASSEMBLY_PACKAGE.equalsValue(vo.getVirtualPartType()) )) {
if (hasConvert.contains(hasConvertKey) ) {
continue;
}
hasConvert.add(hasConvertKey);
@ -117,9 +118,9 @@ public class EBomToPBomFor31 extends EBomToPbomBase {
//子级
List<BomNewEbomParentVO> child = facBomDataMp.get(facCode).stream().filter(u -> u.getParentRowId().equals(vo.getBomRowId()) && !childDelMaterialNos.contains(u.getMaterialNo())).distinct().collect(Collectors.toList());
List<BomNewEbomParentVO> mergeChild = mergeChild(child);
if(compareContentIsSame(vo, mergeChild, facCode)){
continue;
}
// if(compareContentIsSame(vo, mergeChild, facCode) && !vo.getMaterialNo().equals(parent.getMaterialNo())){
// continue;
// }
BomNewPbomParentEntity parentEnt = buildPBomParent(vo, facCode, parentList);
if (Objects.isNull(parentEnt)) {
continue;
@ -136,6 +137,8 @@ public class EBomToPBomFor31 extends EBomToPbomBase {
childEnt.setIdentityNo(StrUtil.join("-", parentEnt.getMaterialNo(), eb.getMaterialNo()));
childEnt.setSource(PbomSourceEnum.FROM_EBOM.getValue());
childEnt.setSourceStatus(PbomSourceStatusEnum.EBOM.getValue());
//原ebom父级编码 by luohj 240828
childEnt.setSourceParentMaterialNo(eb.getSourceParentMaterialNo());
childEnt.setOriginalMaterialNo(eb.getMaterialNo());
childEnt.setOriginalNum(eb.getNum());
childEnt.setOriginalProjectType(eb.getProjectType());

View File

@ -106,6 +106,8 @@ public class EBomToPBomForFormal extends EBomToPbomBase {
childEnt.setFacCode(facCode);
childEnt.setSourceRowId(eb.getRowId());
childEnt.setIdentityNo(StrUtil.join("-", parentEnt.getMaterialNo(), eb.getMaterialNo()));
//原ebom父级编码 by luohj 240828
childEnt.setSourceParentMaterialNo(eb.getSourceParentMaterialNo());
childEnt.setOriginalMaterialNo(eb.getMaterialNo());
childEnt.setOriginalNum(eb.getNum());
childEnt.setOriginalProjectType(eb.getProjectType());

View File

@ -151,6 +151,8 @@ public class EBomToPBomForFormal31 extends EBomToPbomBase {
childEnt.setParentRowId(parentEnt.getRowId());
childEnt.setFacCode(facCode);
childEnt.setIdentityNo(StrUtil.join("-", parentEnt.getMaterialNo(), eb.getMaterialNo()));
//原ebom父级编码 by luohj 240828
childEnt.setSourceParentMaterialNo(eb.getSourceParentMaterialNo());
childEnt.setOriginalMaterialNo(eb.getMaterialNo());
childEnt.setOriginalNum(eb.getNum());
childEnt.setOriginalProjectType(eb.getProjectType());

View File

@ -121,6 +121,8 @@ public abstract class EBomToPbomBase {
childEnt.setParentRowId(oldParent.getRowId());
childEnt.setFacCode(facCode);
childEnt.setIdentityNo(StrUtil.join("-", oldParent.getMaterialNo(), netT.getMaterialNo()));
//原ebom父级编码 by luohj 240828
childEnt.setSourceParentMaterialNo(netT.getSourceParentMaterialNo());
childEnt.setOriginalMaterialNo(netT.getMaterialNo());
childEnt.setOriginalNum(netT.getNum());
childEnt.setOriginalProjectType(netT.getProjectType());
@ -203,12 +205,9 @@ public abstract class EBomToPbomBase {
} else { //pbom-处于正式表
//Ebom为已发布时则直接跳过 直发包发货前装配包是则需对比Bom明细一致则跳过否则升级
if (!EBomStatusEnum.PUBLISHED.equalsValue(parentVo.getStatus()) || (VirtualPackageTypeEnum.DIRECT_DELIVERY_PACKAGE.equalsValue(parentVo.getVirtualPartType()) || VirtualPackageTypeEnum.PRE_ASSEMBLY_PACKAGE.equalsValue(parentVo.getVirtualPartType()))) {
String version = StrUtil.isBlank(parentVo.getCurrentVersion()) ? VersionUtil.getNextVersion("") : parentVo.getCurrentVersion();
String bomVersion = VersionUtil.compare(version, oldParent.getCurrentVersion()) > 0 ? version : VersionUtil.getNextVersion(oldParent.getCurrentVersion());
return buildParentEntity(parentVo, facCode, oldParent, bomVersion);
}
return null;
return buildParentEntity(parentVo, facCode, oldParent, VersionUtil.getNextVersionForSmallVersion(oldParent.getCurrentVersion()));
}
@ -751,7 +750,7 @@ public abstract class EBomToPbomBase {
//一样则无需转换
if (isSameEBomV2(oldParentChild, newParentChild)) {
parentBom.setNoConvertToPBomIs(1);
// parentBom.setNoConvertToPBomIs(1);
parentBom.setHasChangeState(1);
//只变化项目类别-则使用小版本
} else if (isSameEBomV2FormMaterialNoAndNum(oldParentChild, newParentChild)) {

View File

@ -3,12 +3,14 @@ package com.nflg.product.bomnew.service.domain.EBom.topbomnew;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.util.StrUtil;
import cn.hutool.extra.spring.SpringUtil;
import com.alibaba.excel.enums.BooleanEnum;
import com.baomidou.mybatisplus.core.toolkit.IdWorker;
import com.nflg.product.base.core.conmon.util.SessionUtil;
import com.nflg.product.bomnew.constant.ConvertToPBomModelEnum;
import com.nflg.product.bomnew.constant.EBomConstant;
import com.nflg.product.bomnew.constant.VirtualPackageTypeEnum;
import com.nflg.product.bomnew.mapper.master.BomNewPbomParentMapper;
import com.nflg.product.bomnew.pojo.entity.BomNewPbomChildEntity;
import com.nflg.product.bomnew.pojo.entity.BomNewPbomParentEntity;
import com.nflg.product.bomnew.pojo.vo.BomNewEbomParentVO;
@ -66,9 +68,10 @@ public class EBomToPBomForFormal31New extends FormalEBomToPbomBase {
for (BomNewEbomParentVO data: deliveryPackage1010){
List<BomNewEbomParentVO> subVos = new ArrayList<>();// result.stream().filter(u -> u.getLevelNumber().compareTo(data.getLevelNumber()) >= 0 && u.getLevelNumber().compareTo(NumberUtil.add(data.getLevelNumber(), BigDecimal.valueOf(0.01))) < 0).collect(Collectors.toList());
if(data.getMaterialName().contains("仙桃")){
if(!data.getMaterialName().contains(VirtualPackageTypeEnum.PAINT_PACKAGE.getDescription())) {
// subVos = result.stream().filter(u -> u.getMaterialName().contains("仙桃") && u.getLevelNumber().compareTo(data.getLevelNumber()) >= 0 && u.getLevelNumber().compareTo(NumberUtil.add(data.getLevelNumber(), BigDecimal.valueOf(0.01))) < 0).collect(Collectors.toList());
subVos.add(data);
if(!VirtualPackageTypeEnum.PAINT_PACKAGE.getValue().equals(data.getVirtualPartType())) {
subVos.addAll(result.stream().filter(u -> u.getParentRowId().equals(data.getBomRowId())).collect(Collectors.toList()));
}
}
@ -113,18 +116,25 @@ public class EBomToPBomForFormal31New extends FormalEBomToPbomBase {
List<BomNewEbomParentVO> child = facBomDataMp.get(facCode).stream().filter(u -> u.getParentRowId().equals(vo.getBomRowId()) && !childDelMaterialNos.contains(u.getMaterialNo())).distinct().collect(Collectors.toList());
List<BomNewEbomParentVO> mergeChild = mergeChild(child);
//对比PBOM 版本是否一致跟节点除外
if(!parent.getMaterialNo().equals(vo.getMaterialNo()) && !VirtualPackageTypeEnum.DIRECT_DELIVERY_PACKAGE.equalsValue(vo.getVirtualPartType()) && !VirtualPackageTypeEnum.PRE_ASSEMBLY_PACKAGE.equalsValue(vo.getVirtualPartType())){
continue;
}
if(VirtualPackageTypeEnum.DIRECT_DELIVERY_PACKAGE.equalsValue(vo.getVirtualPartType()) || VirtualPackageTypeEnum.PRE_ASSEMBLY_PACKAGE.equalsValue(vo.getVirtualPartType())){
if(compareContentIsSame(vo,mergeChild,facCode)){
continue;
}
}
// if(!parent.getMaterialNo().equals(vo.getMaterialNo()) && !VirtualPackageTypeEnum.DIRECT_DELIVERY_PACKAGE.equalsValue(vo.getVirtualPartType()) && !VirtualPackageTypeEnum.PRE_ASSEMBLY_PACKAGE.equalsValue(vo.getVirtualPartType())){
// continue;
// }
// if(VirtualPackageTypeEnum.DIRECT_DELIVERY_PACKAGE.equalsValue(vo.getVirtualPartType()) || VirtualPackageTypeEnum.PRE_ASSEMBLY_PACKAGE.equalsValue(vo.getVirtualPartType())){
// if(compareContentIsSame(vo,mergeChild,facCode)){
// continue;
// }
// }
BomNewPbomParentEntity parentEnt = buildPBomParent(vo, facCode,parentList);
if(Objects.isNull(parentEnt)){
continue;
}
//检查是否用户跟用户节点
if(parentEnt.getMaterialNo().equals(parent.getMaterialNo())) {
List<String> childMaterialNos = SpringUtil.getBean(BomNewPbomParentMapper.class).getPBomExistMaterialInChildForWorkList(parent.getMaterialNo());
if (CollUtil.isEmpty(childMaterialNos)) {
parentEnt.setUserRootIs(1);
}
}
//子级
if (CollUtil.isNotEmpty(child)) {

View File

@ -74,14 +74,14 @@ public class EBomToPBomForFormalNew extends FormalEBomToPbomBase {
List<BomNewEbomParentVO> mergeChild = mergeChild(child);
//对比PBOM 版本是否一致跟节点除外
if(!parent.getMaterialNo().equals(vo.getMaterialNo()) && !VirtualPackageTypeEnum.DIRECT_DELIVERY_PACKAGE.equalsValue(vo.getVirtualPartType()) && !VirtualPackageTypeEnum.PRE_ASSEMBLY_PACKAGE.equalsValue(vo.getVirtualPartType())){
continue;
}
if(VirtualPackageTypeEnum.DIRECT_DELIVERY_PACKAGE.equalsValue(vo.getVirtualPartType()) || VirtualPackageTypeEnum.PRE_ASSEMBLY_PACKAGE.equalsValue(vo.getVirtualPartType())){
if(compareContentIsSame(vo,mergeChild,facCode)){
continue;
}
}
// if(!parent.getMaterialNo().equals(vo.getMaterialNo()) && !VirtualPackageTypeEnum.DIRECT_DELIVERY_PACKAGE.equalsValue(vo.getVirtualPartType()) && !VirtualPackageTypeEnum.PRE_ASSEMBLY_PACKAGE.equalsValue(vo.getVirtualPartType())){
// continue;
// }
// if(VirtualPackageTypeEnum.DIRECT_DELIVERY_PACKAGE.equalsValue(vo.getVirtualPartType()) || VirtualPackageTypeEnum.PRE_ASSEMBLY_PACKAGE.equalsValue(vo.getVirtualPartType())){
// if(compareContentIsSame(vo,mergeChild,facCode)){
// continue;
// }
// }
BomNewPbomParentEntity parentEnt = buildPBomParent(vo, facCode,parentList);
@ -89,10 +89,13 @@ public class EBomToPBomForFormalNew extends FormalEBomToPbomBase {
continue;
}
//检查是否用户跟用户节点
List<String> childMaterialNos = SpringUtil.getBean(BomNewPbomParentMapper.class).getPBomExistMaterialInChildForWorkList(parentEnt.getMaterialNo());
if(CollUtil.isEmpty(childMaterialNos)){
parentEnt.setUserRootIs(1);
if(parentEnt.getMaterialNo().equals(parent.getMaterialNo())) {
List<String> childMaterialNos = SpringUtil.getBean(BomNewPbomParentMapper.class).getPBomExistMaterialInChildForWorkList(parent.getMaterialNo());
if (CollUtil.isEmpty(childMaterialNos)) {
parentEnt.setUserRootIs(1);
}
}
//子级
if (CollUtil.isNotEmpty(child)) {
//合并子级