feat(ebom): 导入到sap时,如果是直发包,且没有下级,则不要提交到sap去
This commit is contained in:
parent
7717cecc5a
commit
4aeb7db929
|
|
@ -1007,7 +1007,18 @@ public class BomNewEbomParentService extends ServiceImpl<BomNewEbomParentMapper,
|
||||||
.list();
|
.list();
|
||||||
if (CollUtil.isNotEmpty(children)) {
|
if (CollUtil.isNotEmpty(children)) {
|
||||||
String dateYMD = DateUtil.format(new Date(), "yyyyMMdd");
|
String dateYMD = DateUtil.format(new Date(), "yyyyMMdd");
|
||||||
children.forEach(c -> {
|
for (BomNewEbomChildEntity c : children) {
|
||||||
|
BomNewEbomParentEntity cp = lambdaQuery()
|
||||||
|
.eq(BomNewEbomParentEntity::getMaterialNo, c.getMaterialNo())
|
||||||
|
.eq(BomNewEbomParentEntity::getStatus, EBomStatusEnum.PUBLISHED.getValue())
|
||||||
|
.orderByDesc(BomNewEbomParentEntity::getRowId)
|
||||||
|
.last(" limit 1")
|
||||||
|
.one();
|
||||||
|
if (Objects.equals(c.getVirtualPartType(), VirtualPackageTypeEnum.DIRECT_DELIVERY_PACKAGE.getValue())) {
|
||||||
|
if (Objects.nonNull(cp) && !ebomChildService.lambdaQuery().eq(BomNewEbomChildEntity::getParentRowId, cp.getRowId()).exists()) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
}
|
||||||
T1DTO t1 = new T1DTO();
|
T1DTO t1 = new T1DTO();
|
||||||
t1.setID(RandomUtil.randomNumbers(5));
|
t1.setID(RandomUtil.randomNumbers(5));
|
||||||
t1.setMATNR(parent.getMaterialNo());
|
t1.setMATNR(parent.getMaterialNo());
|
||||||
|
|
@ -1021,14 +1032,11 @@ public class BomNewEbomParentService extends ServiceImpl<BomNewEbomParentMapper,
|
||||||
}
|
}
|
||||||
t1.setDATUM(dateYMD);
|
t1.setDATUM(dateYMD);
|
||||||
t1s.add(t1);
|
t1s.add(t1);
|
||||||
BomNewEbomParentEntity cp = lambdaQuery()
|
|
||||||
.eq(BomNewEbomParentEntity::getMaterialNo, c.getMaterialNo())
|
|
||||||
.eq(BomNewEbomParentEntity::getStatus, EBomStatusEnum.PUBLISHED.getValue())
|
|
||||||
.one();
|
|
||||||
if (!Objects.isNull(cp)) {
|
if (!Objects.isNull(cp)) {
|
||||||
buildChildrenForSap(cp, t1s);
|
buildChildrenForSap(cp, t1s);
|
||||||
}
|
}
|
||||||
});
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue