|
|
@@ -1,18 +1,17 @@ |
|
|
|
package com.tuoheng.admin.service.report.query; |
|
|
|
|
|
|
|
import cn.hutool.core.collection.CollectionUtil; |
|
|
|
import cn.hutool.core.util.ObjectUtil; |
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
|
|
|
import com.tuoheng.admin.conver.InspectionFileConverMapper; |
|
|
|
import com.tuoheng.admin.conver.ReportConverMapper; |
|
|
|
import com.tuoheng.admin.entity.*; |
|
|
|
import com.tuoheng.admin.enums.InspectionFileStatusEnum; |
|
|
|
import com.tuoheng.admin.enums.InspectionTypeEnum; |
|
|
|
import com.tuoheng.admin.enums.code.report.QueryInspectionReportCodeEnum; |
|
|
|
import com.tuoheng.admin.mapper.DeptMapper; |
|
|
|
import com.tuoheng.admin.mapper.InspectionFileMapper; |
|
|
|
import com.tuoheng.admin.mapper.QuestionTypeMapper; |
|
|
|
import com.tuoheng.admin.mapper.ReportMapper; |
|
|
|
import com.tuoheng.admin.mapper.*; |
|
|
|
import com.tuoheng.admin.service.third.airport.AirportService; |
|
|
|
import com.tuoheng.admin.utils.CurrentUserUtil; |
|
|
|
import com.tuoheng.admin.vo.AirportInfoVo; |
|
|
|
import com.tuoheng.admin.vo.inspection.InspectionFileReportVo; |
|
|
|
import com.tuoheng.admin.vo.inspection.InspectionReportVo; |
|
|
|
import com.tuoheng.admin.vo.inspection.InspectionResultVo; |
|
|
@@ -49,6 +48,12 @@ public class QueryInspectionReportService { |
|
|
|
@Autowired |
|
|
|
private QuestionTypeMapper questionTypeMapper; |
|
|
|
|
|
|
|
@Autowired |
|
|
|
private AirportService airportService; |
|
|
|
|
|
|
|
@Autowired |
|
|
|
private RoadInformationMapper roadInformationMapper; |
|
|
|
|
|
|
|
public JsonResult getInspectionReport(String id) { |
|
|
|
log.info("进入查看巡检报告业务"); |
|
|
|
String tenantId = CurrentUserUtil.getTenantId(); |
|
|
@@ -103,6 +108,7 @@ public class QueryInspectionReportService { |
|
|
|
.eq(InspectionFile::getMark, 1)); |
|
|
|
String deptName = this.getDeptName(report.getDeptId()); |
|
|
|
List<InspectionResultVo> inspectionResultVoList = this.buildInspectionResult(report); |
|
|
|
|
|
|
|
List<InspectionFileReportVo> inspectionFileHandleVoList = InspectionFileConverMapper.INSTANCE.fromInspectionFileListToInspectionFileHandleVoList(inspectionFileList); |
|
|
|
if (CollectionUtil.isNotEmpty(inspectionFileHandleVoList)) { |
|
|
|
for (InspectionFileReportVo inspectionFileReportVo : inspectionFileHandleVoList) { |
|
|
@@ -111,16 +117,51 @@ public class QueryInspectionReportService { |
|
|
|
inspectionFileReportVo.setFileOriginal(CommonConfig.imageURL + inspectionFileReportVo.getFileOriginal()); |
|
|
|
} |
|
|
|
} |
|
|
|
// 机场任务没有设备名称,暂定使用机场名称作为设备名称 |
|
|
|
if (InspectionTypeEnum.AIRPORT.getCode() == report.getInspectionType()) { |
|
|
|
inspectionReportVo.setEquipmentName(report.getAirportName()); |
|
|
|
|
|
|
|
AirportInfoVo airport = this.getAirport(report); |
|
|
|
RoadInformation road = this.getRoad(report); |
|
|
|
|
|
|
|
//设备名称 机场任务没有设备名称,暂定使用机场名称作为设备名称 |
|
|
|
if (InspectionTypeEnum.AIRPORT.getCode() == report.getInspectionType() && ObjectUtil.isNotEmpty(airport)) { |
|
|
|
inspectionReportVo.setEquipmentName(airport.getName()); |
|
|
|
inspectionReportVo.setAirportName(airport.getName()); |
|
|
|
inspectionReportVo.setRoadName(road.getName()); |
|
|
|
} |
|
|
|
|
|
|
|
inspectionReportVo.setDeptName(deptName); |
|
|
|
inspectionReportVo.setInspectionResultVoList(inspectionResultVoList); |
|
|
|
inspectionReportVo.setInspectionFileReportVoList(inspectionFileHandleVoList); |
|
|
|
return inspectionReportVo; |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* 查询机场 |
|
|
|
* @param report |
|
|
|
* @return |
|
|
|
*/ |
|
|
|
private AirportInfoVo getAirport(Report report) { |
|
|
|
String airportIds = String.valueOf(report.getAirportId()); |
|
|
|
List<AirportInfoVo> airportInfoVoList = airportService.getAirportInfoList(airportIds); |
|
|
|
if (CollectionUtil.isEmpty(airportInfoVoList)) { |
|
|
|
return null; |
|
|
|
} |
|
|
|
return airportInfoVoList.get(0); |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* 查询公路 |
|
|
|
* @param report |
|
|
|
* @return |
|
|
|
*/ |
|
|
|
private RoadInformation getRoad(Report report) { |
|
|
|
String roadId = report.getRoadId(); |
|
|
|
RoadInformation roadInformation = roadInformationMapper.selectById(roadId); |
|
|
|
if (ObjectUtil.isEmpty(roadInformation)) { |
|
|
|
return null; |
|
|
|
} |
|
|
|
return roadInformation; |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* 获取部门路名称 |
|
|
|
*/ |