Merge remote-tracking branch 'origin/master-convertToPBom-lhj09014'
This commit is contained in:
commit
f45dda1ccf
|
|
@ -993,6 +993,25 @@ public class BomNewEbomParentService extends ServiceImpl<BomNewEbomParentMapper,
|
||||||
|
|
||||||
EBomToPbomBase eBomToPBom =parent.getMaterialNo().startsWith("31")? new EBomToPBomFor31(parent, bomTree, paramDto.getFacCodes(), 0L,EnumUtils.getValueEnum(ConvertToPBomModelEnum.class,paramDto.getConvertMode())):new EBomToPBom(parent, bomTree, paramDto.getFacCodes(), 0L,EnumUtils.getValueEnum(ConvertToPBomModelEnum.class,paramDto.getConvertMode()));
|
EBomToPbomBase eBomToPBom =parent.getMaterialNo().startsWith("31")? new EBomToPBomFor31(parent, bomTree, paramDto.getFacCodes(), 0L,EnumUtils.getValueEnum(ConvertToPBomModelEnum.class,paramDto.getConvertMode())):new EBomToPBom(parent, bomTree, paramDto.getFacCodes(), 0L,EnumUtils.getValueEnum(ConvertToPBomModelEnum.class,paramDto.getConvertMode()));
|
||||||
eBomToPBom.convert();
|
eBomToPBom.convert();
|
||||||
|
//【电控系统】 发货包优化 删除 【直发】【制作】、下的物料 by 10002327 240914
|
||||||
|
if (CollUtil.isNotEmpty(eBomToPBom.getPBomParentResult())) {
|
||||||
|
//1、删掉pbom 父级的数据
|
||||||
|
List<BomNewPbomParentEntity> pbomParent = eBomToPBom.getPBomParentResult().stream().filter(p -> (p.getMaterialDesc().contains("电控系统") && p.getMaterialDesc().contains("直发")) ||
|
||||||
|
(p.getMaterialDesc().contains("电控系统") && p.getMaterialDesc().contains("制作"))).collect(Collectors.toList());
|
||||||
|
eBomToPBom.getPBomParentResult().removeAll(pbomParent);
|
||||||
|
//2、删掉pbom 子级的数据
|
||||||
|
List<BomNewPbomChildEntity> pbomChild = eBomToPBom.getPBomChildResult().stream()
|
||||||
|
.filter(c -> pbomParent.stream().map(BomNewPbomParentEntity::getRowId).collect(Collectors.toList()).contains(c.getParentRowId()))
|
||||||
|
.collect(Collectors.toList());
|
||||||
|
eBomToPBom.getPBomChildResult().removeAll(pbomChild);
|
||||||
|
if(!pbomParent.isEmpty()){
|
||||||
|
//3、删掉ebom 父级的数据
|
||||||
|
List<Long> ebomParentIdList = pbomParent.stream().map(BomNewPbomParentEntity::getSourceRowId).collect(Collectors.toList());
|
||||||
|
this.delBatch(ebomParentIdList);
|
||||||
|
//4、删掉ebom 子级的数据
|
||||||
|
ebomChildService.remove(Wrappers.<BomNewEbomChildEntity>lambdaQuery().in(BomNewEbomChildEntity::getParentRowId,ebomParentIdList));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (CollUtil.isNotEmpty(eBomToPBom.getPBomParentResult())) {
|
if (CollUtil.isNotEmpty(eBomToPBom.getPBomParentResult())) {
|
||||||
pBomParentService.saveOrUpdateBatch(eBomToPBom.getPBomParentResult());
|
pBomParentService.saveOrUpdateBatch(eBomToPBom.getPBomParentResult());
|
||||||
|
|
|
||||||
|
|
@ -141,14 +141,17 @@ public class BomNewPbomExportToSAPImpl implements IBomNewPbomExportToSAP {
|
||||||
|
|
||||||
private Long getZFBBomRowId(List<BomNewPbomChildEntity> children) {
|
private Long getZFBBomRowId(List<BomNewPbomChildEntity> children) {
|
||||||
Long ddpRowId = null;
|
Long ddpRowId = null;
|
||||||
|
//电控系统的无须增加 直发包parent记录 by 10002327 240918
|
||||||
BomNewPbomChildEntity czfb = children.stream()
|
BomNewPbomChildEntity czfb = children.stream()
|
||||||
.filter(c -> Objects.equals(c.getVirtualPartType(), VirtualPackageTypeEnum.DIRECT_DELIVERY_PACKAGE.getValue()))
|
.filter(c -> Objects.equals(c.getVirtualPartType(), VirtualPackageTypeEnum.DIRECT_DELIVERY_PACKAGE.getValue())
|
||||||
|
&& !c.getMaterialDesc().contains("电控系统"))
|
||||||
.findFirst()
|
.findFirst()
|
||||||
.orElse(null);
|
.orElse(null);
|
||||||
if (Objects.nonNull(czfb)) {
|
if (Objects.nonNull(czfb)) {
|
||||||
BomNewPbomParentEntity cpttp = getParent(czfb);
|
BomNewPbomParentEntity cpttp = getParent(czfb);
|
||||||
// VUtils.isTure(Objects.isNull(cpttp)).throwMessage(StrUtil.format("顶层直发包({})对应的parent丢失", czfb.getMaterialNo()));
|
// VUtils.isTure(Objects.isNull(cpttp)).throwMessage(StrUtil.format("顶层直发包({})对应的parent丢失", czfb.getMaterialNo()));
|
||||||
if (Objects.isNull(cpttp)) {
|
|
||||||
|
if (Objects.isNull(cpttp) ) {
|
||||||
//添加直发包的parent
|
//添加直发包的parent
|
||||||
cpttp = addZFBParent(czfb);
|
cpttp = addZFBParent(czfb);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -514,8 +514,9 @@ public class DQBomService {
|
||||||
buildTree(root, parents, children);
|
buildTree(root, parents, children);
|
||||||
dQBomParentService.updateBatchById(parents);
|
dQBomParentService.updateBatchById(parents);
|
||||||
dQBomChildService.updateBatchById(children);
|
dQBomChildService.updateBatchById(children);
|
||||||
savePbomParents(parents, root.getMaterialNo().startsWith("31") ? PBomStatusEnum.FACTORY_CONFIRM : PBomStatusEnum.PUBLISH);
|
//电气BOM发布正式版之后,不再写入导入PBOM中 by 10002327 240914
|
||||||
savePbomChildren(children, parents);
|
//savePbomParents(parents, root.getMaterialNo().startsWith("31") ? PBomStatusEnum.FACTORY_CONFIRM : PBomStatusEnum.PUBLISH);
|
||||||
|
//savePbomChildren(children, parents);
|
||||||
|
|
||||||
// CompletableFuture.runAsync(() -> {
|
// CompletableFuture.runAsync(() -> {
|
||||||
// bomNewPbomParentService.getBaseMapper().updatePBomMaterialUse();
|
// bomNewPbomParentService.getBaseMapper().updatePBomMaterialUse();
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue