Browse Source

2025-01-25

优化
master
fengyuan_yang 1 year ago
parent
commit
8b62943bfa
  1. 10
      src/main/java/com/spring/modules/part/service/impl/PartInformationServiceImpl.java

10
src/main/java/com/spring/modules/part/service/impl/PartInformationServiceImpl.java

@ -2752,7 +2752,13 @@ public class PartInformationServiceImpl extends ServiceImpl<PartInformationMappe
map.put("bomList", bomList);
} else {
List<BomDetailVo> bomList = partInformationMapper.queryBomAlternativeList(data);
map.put("bomList", bomList);
if ("Manufactured".equals(partInformation.getPartType())) {
List<BomDetailVo> collect = bomList.stream().filter(a -> "Manufacturing".equals(a.getBomType())).collect(Collectors.toList());
map.put("bomList", collect);
} else if ("Purchased".equals(partInformation.getPartType())){
List<BomDetailVo> collect = bomList.stream().filter(a -> "Purchase".equals(a.getBomType())).collect(Collectors.toList());
map.put("bomList", collect);
}
}
List<RoutingDetailEntity> routingList = partInformationMapper.queryRoutingAlternativeList(data);
map.put("routingList", routingList);
@ -2961,7 +2967,7 @@ public class PartInformationServiceImpl extends ServiceImpl<PartInformationMappe
throw new RuntimeException("不存在与该物料相同的BOM类型!");
}
// 对所选替代的版本进行去重
TreeSet<BomDetailVo> bomHeaderList = bomAlternativeList.stream().collect(Collectors.toCollection(() -> new TreeSet<>(Comparator.comparing(BomDetailEntity::getEngChgLevel).thenComparing(BomDetailEntity::getBomType))));
TreeSet<BomDetailVo> bomHeaderList = bomAlternativeList.stream().collect(Collectors.toCollection(() -> new TreeSet<>(Comparator.comparing(BomDetailEntity::getEngChgLevel))));
for (BomDetailVo bomDetailVo : bomHeaderList) {
BomHeaderEntity bomHeader = new BomHeaderEntity();
bomHeader.setSite(ifsPart.getSite());

Loading…
Cancel
Save