Browse Source

perf: 优化巡视报告列表页接口加载速度,去掉info字段查询

master
yinhuaiwei 1 month ago
parent
commit
cbbda2229a
1 changed files with 0 additions and 18 deletions
  1. +0
    -18
      inspect-main/inspect-main-task/src/main/java/com/inspect/insreport/controller/InspectionReportController.java

+ 0
- 18
inspect-main/inspect-main-task/src/main/java/com/inspect/insreport/controller/InspectionReportController.java View File

@ -96,26 +96,8 @@ public class InspectionReportController extends BaseController {
@GetMapping({"/list"})
public TableDataInfo list(InspectionReport inspectionReport) {
startPage();
Map<String, String> imgMap = getImgMap();
List<InspectionReport> inspectionReportList = inspectionReportService.selectByAllList(inspectionReport);
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);
}


Loading…
Cancel
Save