feat(pbom): pbom导入到SAP时,将所有子级发货包数据提层到顶级发货包中

This commit is contained in:
曹鹏飞 2024-05-15 09:38:40 +08:00
parent c0a9a36d42
commit 785e907aa0
1 changed files with 5 additions and 2 deletions

View File

@ -145,11 +145,11 @@ public class BomNewPbomExportToSAPImpl implements IBomNewPbomExportToSAP {
private void buildChildrenForSap(Long cRowId, BomNewPbomParentEntity p, BomNewPbomChildEntity c) {
List<BomNewPbomChildEntity> cc = getChildren(p);
for (BomNewPbomChildEntity it : cc) {
if (is21 && !isForSale && !Objects.equals(it.getVirtualPartType(), VirtualPackageTypeEnum.UN_VIRTUAL_PACKAGE.getValue())) {
if (is21 && !isForSale && !Objects.equals(it.getVirtualPartType(), VirtualPackageTypeEnum.DIRECT_DELIVERY_PACKAGE.getValue())) {
return;
}
if (Objects.equals(it.getVirtualPartType(), VirtualPackageTypeEnum.UN_VIRTUAL_PACKAGE.getValue())) {
if (Objects.equals(c.getVirtualPartType(), VirtualPackageTypeEnum.DELIVERY_PACKAGE.getValue())) {
if (Objects.equals(c.getVirtualPartType(), VirtualPackageTypeEnum.DIRECT_DELIVERY_PACKAGE.getValue())) {
if (Objects.isNull(cRowId)) {
LOGGER.debug("{} 添加物料 编号:{},父级编号:{},数量:{},描述:{}", TAG, it.getMaterialNo(), c.getMaterialNo(), it.getNum().toString(), it.getMaterialDesc());
children.add(convert(it, c.getMaterialNo()));
@ -174,6 +174,9 @@ public class BomNewPbomExportToSAPImpl implements IBomNewPbomExportToSAP {
LOGGER.debug("{} 添加物料 编号:{},父级编号:{},数量:{},描述:{}", TAG, it.getMaterialNo(), c.getMaterialNo(), it.getNum().toString(), it.getMaterialDesc());
children.add(convert(it, c.getMaterialNo()));
}
} else if (!Objects.equals(it.getVirtualPartType(), VirtualPackageTypeEnum.DIRECT_DELIVERY_PACKAGE.getValue())) {
LOGGER.debug("{} 添加物料 编号:{},父级编号:{},数量:{},描述:{}", TAG, it.getMaterialNo(), c.getMaterialNo(), it.getNum().toString(), it.getMaterialDesc());
children.add(convert(it, c.getMaterialNo()));
}
List<BomNewPbomParentEntity> cp = getParents(it);
cp.forEach(cpt -> {