Browse Source

Merge branch 'develop' of gitadmin/tuoheng_freeway into release

pull/380/head
suqin 10 months ago
parent
commit
cc43add169
2 changed files with 94 additions and 11 deletions
  1. +45
    -3
      tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/service/report/query/QueryInspectionHandleReportService.java
  2. +49
    -8
      tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/service/report/query/QueryInspectionReportService.java

+ 45
- 3
tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/service/report/query/QueryInspectionHandleReportService.java View File

@@ -1,6 +1,7 @@
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.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.tuoheng.admin.conver.InspectionFileConverMapper;
@@ -10,7 +11,9 @@ 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.*;
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.InspectionFileHandleReportVo;
import com.tuoheng.admin.vo.inspection.InspectionFileReportVo;
import com.tuoheng.admin.vo.inspection.InspectionReportVo;
@@ -58,6 +61,12 @@ public class QueryInspectionHandleReportService {
@Autowired
private InspectionFileHandleMapper inspectionFileHandleMapper;

@Autowired
private AirportService airportService;

@Autowired
private RoadInformationMapper roadInformationMapper;

public JsonResult getInspectionHandleReport(String id) {
log.info("进入查看巡检处理报告业务");
String tenantId = CurrentUserUtil.getTenantId();
@@ -149,13 +158,46 @@ public class QueryInspectionHandleReportService {
inspectionReportVo.setInspectionResultVoList(inspectionResultVoList);
inspectionReportVo.setInspectionFileReportVoList(inspectionFileHandleVoList);

// 机场任务没有设备名称,暂定使用机场名称作为设备名称
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());
}

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;
}

private List<InspectionFileHandle> getInspectionFileHandleList(List<InspectionFile> inspectionFileList) {
List<String> inspectionFileIdList = inspectionFileList.stream().map(o -> o.getId()).collect(Collectors.toList());
List<InspectionFileHandle> inspectionFileHandleList = null;

+ 49
- 8
tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/service/report/query/QueryInspectionReportService.java View File

@@ -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;
}

/**
* 获取部门路名称
*/

Loading…
Cancel
Save