fix: 修复导入SAP时的一个bug

This commit is contained in:
曹鹏飞 2024-08-21 08:57:47 +08:00
parent 9140da0752
commit f4aae74c93
2 changed files with 3 additions and 3 deletions

View File

@ -174,7 +174,7 @@ public class BomNewEbomExportToSAP {
BomNewEbomParentEntity p = bomNewEbomParentService.lambdaQuery() BomNewEbomParentEntity p = bomNewEbomParentService.lambdaQuery()
.select(BomNewEbomParentEntity::getRowId, BomNewEbomParentEntity::getMaterialNo .select(BomNewEbomParentEntity::getRowId, BomNewEbomParentEntity::getMaterialNo
, BomNewEbomParentEntity::getMaterialDesc, BomNewEbomParentEntity::getUserRootIs , BomNewEbomParentEntity::getMaterialDesc, BomNewEbomParentEntity::getUserRootIs
, BomNewEbomParentEntity::getSource) , BomNewEbomParentEntity::getSource, BomNewEbomParentEntity::getSapState)
.eq(BomNewEbomParentEntity::getMaterialNo, c.getMaterialNo()) .eq(BomNewEbomParentEntity::getMaterialNo, c.getMaterialNo())
// .eq(BomNewEbomParentEntity::getUserRootIs, 0) // .eq(BomNewEbomParentEntity::getUserRootIs, 0)
.eq(BomNewEbomParentEntity::getStatus, EBomStatusEnum.PUBLISHED.getValue()) .eq(BomNewEbomParentEntity::getStatus, EBomStatusEnum.PUBLISHED.getValue())
@ -182,7 +182,7 @@ public class BomNewEbomExportToSAP {
.orderByDesc(BomNewEbomParentEntity::getCurrentVersion) .orderByDesc(BomNewEbomParentEntity::getCurrentVersion)
.last(" limit 1") .last(" limit 1")
.one(); .one();
if (Objects.nonNull(p) && p.getSapState() >= SapStatusEnum.PUB_ERROR.getValue()) { if (Objects.nonNull(p) && Objects.nonNull(p.getSapState()) && p.getSapState() >= SapStatusEnum.PUB_ERROR.getValue()) {
liPIds.add(p.getRowId()); liPIds.add(p.getRowId());
} }
return p; return p;

View File

@ -341,7 +341,7 @@ public class BomNewPbomExportToSAPImpl implements IBomNewPbomExportToSAP {
.orderByDesc(BomNewPbomParentEntity::getCurrentVersion) .orderByDesc(BomNewPbomParentEntity::getCurrentVersion)
.last(" limit 1") .last(" limit 1")
.one(); .one();
if (Objects.nonNull(parent) && parent.getSapState() >= SapStatusEnum.PUB_ERROR.getValue()) { if (Objects.nonNull(parent) && Objects.nonNull(parent.getSapState()) && parent.getSapState() >= SapStatusEnum.PUB_ERROR.getValue()) {
liPIds.add(parent.getRowId()); liPIds.add(parent.getRowId());
} }
return parent; return parent;