refactor(eqp): 查询设备附带巡检部位

This commit is contained in:
2026-05-22 14:56:10 +08:00
parent c2b7a08414
commit 7b2881c45f

View File

@@ -59,9 +59,11 @@ public class EqpEquipmentPartServiceImpl implements IEqpEquipmentPartService {
List<EqpEquipmentChecklistVo> checklistList = checklistMapper.selectVoList(checklistLqw);
Map<Long, List<EqpEquipmentChecklistVo>> checklistMap = checklistList.stream()
.collect(Collectors.groupingBy(EqpEquipmentChecklistVo::getPartId));
result.getRecords().forEach(vo ->
vo.setChecklistList(checklistMap.getOrDefault(vo.getPartId(), Collections.emptyList()))
);
result.getRecords().forEach(vo -> {
List<EqpEquipmentChecklistVo> items = checklistMap.getOrDefault(vo.getPartId(), Collections.emptyList());
items.forEach(checklist -> checklist.setPartName(vo.getInspectPart()));
vo.setChecklistList(items);
});
}
return TableDataInfo.build(result);
}