refactor(eqp): 查询设备附带巡检部位
This commit is contained in:
@@ -59,9 +59,11 @@ public class EqpEquipmentPartServiceImpl implements IEqpEquipmentPartService {
|
|||||||
List<EqpEquipmentChecklistVo> checklistList = checklistMapper.selectVoList(checklistLqw);
|
List<EqpEquipmentChecklistVo> checklistList = checklistMapper.selectVoList(checklistLqw);
|
||||||
Map<Long, List<EqpEquipmentChecklistVo>> checklistMap = checklistList.stream()
|
Map<Long, List<EqpEquipmentChecklistVo>> checklistMap = checklistList.stream()
|
||||||
.collect(Collectors.groupingBy(EqpEquipmentChecklistVo::getPartId));
|
.collect(Collectors.groupingBy(EqpEquipmentChecklistVo::getPartId));
|
||||||
result.getRecords().forEach(vo ->
|
result.getRecords().forEach(vo -> {
|
||||||
vo.setChecklistList(checklistMap.getOrDefault(vo.getPartId(), Collections.emptyList()))
|
List<EqpEquipmentChecklistVo> items = checklistMap.getOrDefault(vo.getPartId(), Collections.emptyList());
|
||||||
);
|
items.forEach(checklist -> checklist.setPartName(vo.getInspectPart()));
|
||||||
|
vo.setChecklistList(items);
|
||||||
|
});
|
||||||
}
|
}
|
||||||
return TableDataInfo.build(result);
|
return TableDataInfo.build(result);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user