fix: 导入sap优化

This commit is contained in:
曹鹏飞 2024-06-04 10:01:37 +08:00
parent 925dc231cf
commit ae1d544aa1
2 changed files with 34 additions and 28 deletions

View File

@ -212,6 +212,7 @@ public class BomNewEbomExportToSAP {
, BomNewEbomChildEntity::getMaterialUnit, BomNewEbomChildEntity::getMaterialDesc
, BomNewEbomChildEntity::getVirtualPartType, BomNewEbomChildEntity::getProjectType)
.eq(BomNewEbomChildEntity::getParentRowId, parent.getRowId())
.orderByAsc(BomNewEbomChildEntity::getOrderNumber)
.list();
}

View File

@ -162,6 +162,11 @@ public class BomNewPbomExportToSAPImpl implements IBomNewPbomExportToSAP {
return;
}
for (BomNewPbomChildEntity it : cc) {
handlerItem(cRowId, it, p, c, ignore);
}
}
private void handlerItem(Long cRowId, BomNewPbomChildEntity it, BomNewPbomParentEntity p, BomNewPbomChildEntity c, boolean ignore) {
if (Objects.equals(c.getVirtualPartType(), VirtualPackageTypeEnum.DIRECT_DELIVERY_PACKAGE.getValue())) {
if (Objects.nonNull(cRowId)) {
T1ExtDTO cct = cmap.get(cRowId).stream()
@ -192,7 +197,6 @@ public class BomNewPbomExportToSAPImpl implements IBomNewPbomExportToSAP {
buildChildrenForSap(cRowId, cp, it, ignore);
}
}
}
private List<BomNewPbomChildEntity> getChildren(BomNewPbomParentEntity parent) {
return bomNewPbomChildService.lambdaQuery()
@ -200,6 +204,7 @@ public class BomNewPbomExportToSAPImpl implements IBomNewPbomExportToSAP {
, BomNewPbomChildEntity::getMaterialUnit, BomNewPbomChildEntity::getMaterialDesc
, BomNewPbomChildEntity::getVirtualPartType, BomNewPbomChildEntity::getProjectType)
.eq(BomNewPbomChildEntity::getParentRowId, parent.getRowId())
.orderByAsc(BomNewPbomChildEntity::getOrderNumber)
.list();
}
@ -207,7 +212,7 @@ public class BomNewPbomExportToSAPImpl implements IBomNewPbomExportToSAP {
return bomNewPbomParentService.lambdaQuery()
.eq(BomNewPbomParentEntity::getMaterialNo, child.getMaterialNo())
.eq(!is21, BomNewPbomParentEntity::getStatus, PBomStatusEnum.FACTORY_CONFIRM.getValue())
.eq(is21, BomNewPbomParentEntity::getStatus, PBomStatusEnum.PUBLISH.getValue())
.ge(is21, BomNewPbomParentEntity::getStatus, PBomStatusEnum.PUBLISH.getValue())
.eq(BomNewPbomParentEntity::getFacCode, child.getFacCode())
.ne(BomNewPbomParentEntity::getCreatedBy, "admin")
.orderByDesc(BomNewPbomParentEntity::getCurrentVersion)