Browse Source

fix:任务状态页签报告查看异常

master
wangguangyuan 7 months ago
parent
commit
daae43ac25
1 changed files with 18 additions and 1 deletions
  1. +18
    -1
      inspect-main/inspect-main-task/src/main/java/com/inspect/insreport/controller/InspectionReportController.java

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

@ -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<String, String> 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<InspectionReport> 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));


Loading…
Cancel
Save