fix(pbom): 修复因child表物料分类编码与主物料的物料分类编码不一致导致导入到SAP的排序号错误的问题

This commit is contained in:
曹鹏飞 2024-11-11 12:51:46 +08:00
parent 00a6d47e32
commit 81846b2cca
1 changed files with 4 additions and 2 deletions

View File

@ -371,10 +371,12 @@ public class BomNewPbomExportToSAPImpl implements IBomNewPbomExportToSAP {
private List<BomNewPbomChildEntity> syncMaterial(List<BomNewPbomChildEntity> children) {
if (CollUtil.isNotEmpty(children)) {
List<BaseMaterialVO> materialVOS = materialMainService.getMaterialBaseInfo(children.stream()
.filter(f -> !StrUtil.equalsIgnoreCase(BomConstant.PROJECT_TYPE_TEMPORARY, f.getProjectType()))
.filter(f -> !StrUtil.equalsIgnoreCase(BomConstant.PROJECT_TYPE_TEMPORARY, f.getProjectType())
&& StrUtil.isNotEmpty(f.getMaterialNo()))
.map(BomNewPbomChildEntity::getMaterialNo).collect(Collectors.toList()));
children.forEach(c -> {
if (!StrUtil.equalsIgnoreCase(BomConstant.PROJECT_TYPE_TEMPORARY, c.getProjectType())) {
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()))
.findFirst()