|
|
@ -96,26 +96,8 @@ public class InspectionReportController extends BaseController { |
|
|
@GetMapping({"/list"}) |
|
|
@GetMapping({"/list"}) |
|
|
public TableDataInfo list(InspectionReport inspectionReport) { |
|
|
public TableDataInfo list(InspectionReport inspectionReport) { |
|
|
startPage(); |
|
|
startPage(); |
|
|
Map<String, String> imgMap = getImgMap(); |
|
|
|
|
|
List<InspectionReport> inspectionReportList = inspectionReportService.selectByAllList(inspectionReport); |
|
|
List<InspectionReport> inspectionReportList = inspectionReportService.selectByAllList(inspectionReport); |
|
|
logger.info("[REPORT] inspectionReportList size: {}", inspectionReportList.size()); |
|
|
logger.info("[REPORT] inspectionReportList size: {}", inspectionReportList.size()); |
|
|
InspectionReportData reportParam = new InspectionReportData(); |
|
|
|
|
|
Map<String, Object> map = new HashMap<>(); |
|
|
|
|
|
String[] reportIds = inspectionReportList.stream().map((item) -> item.getLineId().toString()).toArray(String[]::new); |
|
|
|
|
|
map.put("reportIds", reportIds); |
|
|
|
|
|
reportParam.setParams(map); |
|
|
|
|
|
List<InspectionReportData> inspectionReportDataList = inspectionReportDataService.selectInspectionReportDataList(reportParam); |
|
|
|
|
|
for(InspectionReport report : inspectionReportList) { |
|
|
|
|
|
List<InspectionReportData> infoList = inspectionReportDataList.stream().filter(item -> item.getReportId().equals(report.getLineId())).collect(Collectors.toList()); |
|
|
|
|
|
if(infoList != null && !infoList.isEmpty()) { |
|
|
|
|
|
report.setInfo(infoList); |
|
|
|
|
|
} |
|
|
|
|
|
for (InspectionReportData reportData : inspectionReportDataList) { |
|
|
|
|
|
if (imgMap != null && imgMap.get((reportData.getLineId()).trim()) != null) { |
|
|
|
|
|
reportData.setInspectionImg(imgMap.get((reportData.getLineId()).trim())); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
return getDataTable(inspectionReportList); |
|
|
return getDataTable(inspectionReportList); |
|
|
} |
|
|
} |
|
|
|