Merge remote-tracking branch 'origin/feature/rakor-bug-sap-1111'

This commit is contained in:
10001392 2024-11-12 09:23:29 +08:00
commit c0d736e365
1 changed files with 17 additions and 13 deletions

View File

@ -370,15 +370,18 @@ public class BomNewPbomExportToSAPImpl implements IBomNewPbomExportToSAP {
private List<BomNewPbomChildEntity> syncMaterial(List<BomNewPbomChildEntity> children) {
if (CollUtil.isNotEmpty(children)) {
List<BaseMaterialVO> materialVOS = materialMainService.getMaterialBaseInfo(children.stream()
List<String> materialNos = children.stream()
.filter(f -> !StrUtil.equalsIgnoreCase(BomConstant.PROJECT_TYPE_TEMPORARY, f.getProjectType())
&& StrUtil.isNotEmpty(f.getMaterialNo()))
.map(BomNewPbomChildEntity::getMaterialNo).collect(Collectors.toList()));
.map(BomNewPbomChildEntity::getMaterialNo).collect(Collectors.toList());
if (CollUtil.isNotEmpty(materialNos)) {
List<BaseMaterialVO> materialVOS = materialMainService.getMaterialBaseInfo(materialNos);
children.forEach(c -> {
if (!StrUtil.equalsIgnoreCase(BomConstant.PROJECT_TYPE_TEMPORARY, c.getProjectType())
&& StrUtil.isNotEmpty(c.getMaterialNo())) {
BaseMaterialVO materialVO = materialVOS.stream()
.filter(m -> StrUtil.equals(m.getMaterialNo(), c.getMaterialNo()))
.filter(f -> !StrUtil.equalsIgnoreCase(BomConstant.PROJECT_TYPE_TEMPORARY, f.getProjectType())
&& StrUtil.equals(f.getMaterialNo(), c.getMaterialNo()))
.findFirst()
.orElse(null);
if (Objects.nonNull(materialVO)) {
@ -387,6 +390,7 @@ public class BomNewPbomExportToSAPImpl implements IBomNewPbomExportToSAP {
}
});
}
}
return children;
}