refactor: 处理合并冲突

This commit is contained in:
曹鹏飞 2024-04-14 12:24:27 +08:00
parent a655f0e745
commit e4c6973305
1 changed files with 4 additions and 20 deletions

View File

@ -188,29 +188,12 @@ public class BomNewOriginalParentService extends ServiceImpl<BomNewOriginalParen
// }
List<String> parentDrawingNos = new ArrayList<>(getParentMaterialByDrawingNo(queryDrawingNos));
// parentDrawingNos.addAll(queryDrawingNos);
Set<String> parentDrawingNos = new HashSet<>(getParentDrawingNoByMaterialNo(queryDrawingNos));
parentDrawingNos.addAll(queryDrawingNos);
if (CollUtil.isNotEmpty(parentDrawingNos)) {
List<BomOriginalListVO> childs=new ArrayList<>();
List<BomOriginalListVO> parents = this.getBaseMapper().getParentForDrawingNoSeach(parentDrawingNos, query.getStatus());
materialMainService.intiMaterialInfo(parents, EBomConstant.EBOM_IGNORED_FIELDS_INIT_MATERIAL_DEFAULT);
if(CollUtil.isNotEmpty(parents)) {
childs = this.getBaseMapper().getChildForDrawingNoSeach(parentDrawingNos, parents.stream().map(u -> u.getRowId()).collect(Collectors.toSet()));
materialMainService.intiMaterialInfo(childs, EBomConstant.EBOM_IGNORED_FIELDS_INIT_MATERIAL_DEFAULT);
childs.stream().filter(f -> StrUtil.isBlank(f.getCurrentVersion())).forEach(f -> {
if (MaterialshouldBomExistUtil.checkShouldBomExist(f.getMaterialCategoryCode(), f.getMaterialGetType())) {
f.setCurrentVersion(OriginalConstant.NO_BOM_VERSION);
} else {
f.setCurrentVersion(OriginalConstant.DEFAULT_BOM_VERSION);
}
});
}
// List<BomOriginalListVO> data = new ArrayList<>();
// data.addAll(parents);
// data.addAll(childs);
// materialMainService.intiMaterialInfo(data, EBomConstant.EBOM_IGNORED_FIELDS_INIT_MATERIAL_DEFAULT);
materialMainService.intiMaterialInfo(parents, EBomConstant.EBOM_IGNORED_FIELDS_INIT_MATERIAL_DEFAULT2);
List<BomOriginalListVO> childs = this.getBaseMapper().getChildForDrawingNoSeach(parentDrawingNos,query.getStatus());
if (CollUtil.isNotEmpty(parents)) {
childs = this.getBaseMapper().getChildForDrawingNoSeach(parentDrawingNos, parents.stream().map(BomOriginalListVO::getRowId).collect(Collectors.toSet()));
materialMainService.intiMaterialInfo(childs, EBomConstant.EBOM_IGNORED_FIELDS_INIT_MATERIAL_DEFAULT2);
childs.stream().filter(f -> StrUtil.isBlank(f.getCurrentVersion())).forEach(f -> {
if (MaterialshouldBomExistUtil.checkShouldBomExist(f.getMaterialCategoryCode(), f.getMaterialGetType())) {
@ -219,6 +202,7 @@ public class BomNewOriginalParentService extends ServiceImpl<BomNewOriginalParen
f.setCurrentVersion(OriginalConstant.DEFAULT_BOM_VERSION);
}
});
}
result = handSeachToTree(parents, childs);
}
}