Compare commits
3 Commits
f9af03b030
...
20a36755b9
Author | SHA1 | Date | |
---|---|---|---|
20a36755b9 | |||
46f51e656e | |||
e950cbbe9c |
@ -142,13 +142,19 @@ public class WoPackagingBoxServiceBizImpl extends CrudServiceImpl<WoPackagingBox
|
||||
QueryWrapper<WoPackagingBoxSubstrate> wrapper = new QueryWrapper<>();
|
||||
wrapper.eq(StringUtils.isNotBlank(entity.getBoxNo()), WoPackagingBoxSubstrate.PACKAGING_BOX_ID, entity.getBoxNo());
|
||||
//重复上片基板去重
|
||||
// wrapper.select("DISTINCT WO_SUBSTRATE_ID").orderByDesc("CREATE_TIME");
|
||||
// wrapper.orderByAsc(WoPackagingBoxSubstrate.SLOT);
|
||||
List<WoPackagingBoxSubstrate> woPackagingBoxSubstrateList = substrateMapper.selectList(wrapper);
|
||||
List<WoPackagingBoxSubstrate> distinctList = woPackagingBoxSubstrateList.stream().collect(
|
||||
Collectors.collectingAndThen(
|
||||
Collectors.toCollection(() -> new TreeSet<>(Comparator.comparing(WoPackagingBoxSubstrate::getWoSubstrateId))), ArrayList::new)
|
||||
);
|
||||
List<WoPackagingBoxSubstrate> distinctList = new ArrayList<>();
|
||||
Map<String, List<WoPackagingBoxSubstrate>> map = woPackagingBoxSubstrateList.stream().sorted(Comparator.comparing(WoPackagingBoxSubstrate::getCreateTime).reversed())
|
||||
.collect(Collectors.groupingBy(WoPackagingBoxSubstrate::getWoSubstrateId));
|
||||
for (Map.Entry<String, List<WoPackagingBoxSubstrate>> entry : map.entrySet()) {
|
||||
//取list首并放入到新list中
|
||||
distinctList.add(entry.getValue().get(0));
|
||||
}
|
||||
// List<WoPackagingBoxSubstrate> distinctList = woPackagingBoxSubstrateList.stream().collect(
|
||||
// Collectors.collectingAndThen(
|
||||
// Collectors.toCollection(() -> new TreeSet<>(Comparator.comparing(WoPackagingBoxSubstrate::getWoSubstrateId))), ArrayList::new)
|
||||
// );
|
||||
List<WoPackagingBoxSubstrate> sortedDistinctList = distinctList.stream().sorted(Comparator.comparing(WoPackagingBoxSubstrate::getSlot)).collect(Collectors.toList());
|
||||
dto.setSubstrateList(sortedDistinctList);
|
||||
return dto;
|
||||
|
Loading…
Reference in New Issue
Block a user