|
@@ -505,7 +505,21 @@ public class ZhcxProjectManageServiceImpl extends ServiceImpl<ZhcxProjectManageD
|
|
ZhcxProjectRectifyVo vo = new ZhcxProjectRectifyVo();
|
|
ZhcxProjectRectifyVo vo = new ZhcxProjectRectifyVo();
|
|
//copier.copy(rectify, vo, null);
|
|
//copier.copy(rectify, vo, null);
|
|
BeanUtil.copyProperties(rectify, vo);
|
|
BeanUtil.copyProperties(rectify, vo);
|
|
- vo.setData(machineVos == null ? new ArrayList<>() : machineVos);
|
|
|
|
|
|
+ // 如果 machineVos 不为空,按机号合并部门
|
|
|
|
+ if (machineVos != null) {
|
|
|
|
+ List<ZhcxProjectRectifyMachineVo> mergedMachineVos = machineVos.stream()
|
|
|
|
+ .collect(Collectors.toMap(
|
|
|
|
+ ZhcxProjectRectifyMachineVo::getMachineno,
|
|
|
|
+ voItem -> voItem, // 初始对象
|
|
|
|
+ ZhcxProjectRectifyMachineVo::merge // 使用自定义方法合并对象
|
|
|
|
+ ))
|
|
|
|
+ .values().stream().collect(Collectors.toList());
|
|
|
|
+
|
|
|
|
+ vo.setData(mergedMachineVos);
|
|
|
|
+ } else {
|
|
|
|
+ vo.setData(new ArrayList<>());
|
|
|
|
+ }
|
|
|
|
+ //vo.setData(machineVos == null ? new ArrayList<>() : machineVos);
|
|
list.add(vo);
|
|
list.add(vo);
|
|
});
|
|
});
|
|
list.forEach(ev -> {
|
|
list.forEach(ev -> {
|