diff --git a/inspect-main/inspect-main-task/src/main/java/com/inspect/insreport/controller/InspectionReportController.java b/inspect-main/inspect-main-task/src/main/java/com/inspect/insreport/controller/InspectionReportController.java index a29dd53..4af7984 100644 --- a/inspect-main/inspect-main-task/src/main/java/com/inspect/insreport/controller/InspectionReportController.java +++ b/inspect-main/inspect-main-task/src/main/java/com/inspect/insreport/controller/InspectionReportController.java @@ -47,6 +47,8 @@ import javax.servlet.ServletOutputStream; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; +import com.inspect.taskstatus.domain.PatrolTaskStatus; +import com.inspect.taskstatus.service.IPatrolTaskStatusService; import org.apache.poi.hssf.usermodel.HSSFCell; import org.apache.poi.hssf.usermodel.HSSFCellStyle; import org.apache.poi.hssf.usermodel.HSSFClientAnchor; @@ -76,6 +78,9 @@ public class InspectionReportController extends BaseController { private final SftpClient sftpClient; private final IPatrolTaskFtpService patrolTaskFtpService; + @Autowired + private IPatrolTaskStatusService patrolTaskStatusService; + @Autowired private MessageUtils MessageUtils; @@ -140,7 +145,19 @@ public class InspectionReportController extends BaseController { Map map = getImgMap(); InspectionReport inspectionReport = inspectionReportService.selectInspectionReportByLineId(lineId); if(inspectionReport == null) { - return AjaxResult.error("报告不存在: " + lineId); + // 暂时这么处理(进度条报告入口,lineId传的是patrolTaskStatus的lineId) + PatrolTaskStatus patrolTaskStatus = patrolTaskStatusService.selectPatrolTaskStatusByLineId(lineId); + String taskPatrolledId = patrolTaskStatus.getTaskPatrolledId(); + inspectionReport = new InspectionReport(); + inspectionReport.setTaskPatrolledId(taskPatrolledId); + logger.info("进度条报告查看,taskPatrolledId:{}", taskPatrolledId); + List inspectionReports = inspectionReportService.selectInspectionReportList(inspectionReport); + if (inspectionReports.size() > 0) { + inspectionReport = inspectionReports.get(0); + lineId = inspectionReport.getLineId(); + } else { + return AjaxResult.error("报告不存在: " + lineId); + } } InspectionReportData inspectionReportData = new InspectionReportData(); inspectionReportData.setReportId(String.valueOf(lineId));