public class QueryReportPageListRequest extends BaseQuery { | public class QueryReportPageListRequest extends BaseQuery { | ||||
/** | /** | ||||
* 任务名称 | |||||
* 任务编码 | |||||
*/ | */ | ||||
private String inspectionName; | |||||
private String inspectionCode; | |||||
/** | /** | ||||
* 巡检任务类型: 1 临时巡检(目前只有该一种类型) | * 巡检任务类型: 1 临时巡检(目前只有该一种类型) |
public JsonResult getInspectionHandleReport(String id) { | public JsonResult getInspectionHandleReport(String id) { | ||||
log.info("进入查看巡检处理报告业务"); | log.info("进入查看巡检处理报告业务"); | ||||
String userId = CurrentUserUtil.getUserId(); | |||||
String tenantId = CurrentUserUtil.getTenantId(); | String tenantId = CurrentUserUtil.getTenantId(); | ||||
JsonResult result = this.check(tenantId, id); | JsonResult result = this.check(tenantId, id); | ||||
if (0 != result.getCode()) { | if (0 != result.getCode()) { | ||||
log.info("进入查看巡检处理报告业务:校验失败:{}", result.getMsg()); | log.info("进入查看巡检处理报告业务:校验失败:{}", result.getMsg()); | ||||
return result; | return result; | ||||
} | } | ||||
Report report = (Report) result.getData(); | Report report = (Report) result.getData(); | ||||
InspectionReportVo inspectionReportVo = this.buildInspectionReportVo(report); | InspectionReportVo inspectionReportVo = this.buildInspectionReportVo(report); | ||||
return JsonResult.success(inspectionReportVo); | return JsonResult.success(inspectionReportVo); | ||||
} | } | ||||
List<String> handlerImageList = null; | List<String> handlerImageList = null; | ||||
for (InspectionFileReportVo inspectionFileReportVo : inspectionFileHandleVoList) { | for (InspectionFileReportVo inspectionFileReportVo : inspectionFileHandleVoList) { | ||||
inspectionFileHandle = inspectionFileHandleMap.get(inspectionFileReportVo.getId()); | inspectionFileHandle = inspectionFileHandleMap.get(inspectionFileReportVo.getId()); | ||||
inspectionFileReportVo.setFileThumbnail(CommonConfig.imageURL + inspectionFileReportVo.getFileThumbnail()); | |||||
inspectionFileReportVo.setFileOriginal(CommonConfig.imageURL + inspectionFileReportVo.getFileOriginal()); | |||||
if (null != inspectionFileHandle) { | if (null != inspectionFileHandle) { | ||||
handlerImageList = new ArrayList<>(); | handlerImageList = new ArrayList<>(); | ||||
String[] arr = inspectionFileHandle.getHandlerImage().split(","); | String[] arr = inspectionFileHandle.getHandlerImage().split(","); |
package com.tuoheng.admin.service.report.query; | package com.tuoheng.admin.service.report.query; | ||||
import cn.hutool.core.collection.CollectionUtil; | |||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; | ||||
import com.tuoheng.admin.conver.InspectionFileConverMapper; | import com.tuoheng.admin.conver.InspectionFileConverMapper; | ||||
import com.tuoheng.admin.conver.ReportConverMapper; | import com.tuoheng.admin.conver.ReportConverMapper; | ||||
import com.tuoheng.admin.vo.inspection.InspectionFileReportVo; | import com.tuoheng.admin.vo.inspection.InspectionFileReportVo; | ||||
import com.tuoheng.admin.vo.inspection.InspectionReportVo; | import com.tuoheng.admin.vo.inspection.InspectionReportVo; | ||||
import com.tuoheng.admin.vo.inspection.InspectionResultVo; | import com.tuoheng.admin.vo.inspection.InspectionResultVo; | ||||
import com.tuoheng.common.core.config.common.CommonConfig; | |||||
import com.tuoheng.common.core.utils.JsonResult; | import com.tuoheng.common.core.utils.JsonResult; | ||||
import com.tuoheng.common.core.utils.StringUtils; | import com.tuoheng.common.core.utils.StringUtils; | ||||
import lombok.extern.slf4j.Slf4j; | import lombok.extern.slf4j.Slf4j; | ||||
String deptName = this.getDeptName(report.getDeptId()); | String deptName = this.getDeptName(report.getDeptId()); | ||||
List<InspectionResultVo> inspectionResultVoList = this.buildInspectionResult(report); | List<InspectionResultVo> inspectionResultVoList = this.buildInspectionResult(report); | ||||
List<InspectionFileReportVo> inspectionFileHandleVoList = InspectionFileConverMapper.INSTANCE.fromInspectionFileListToInspectionFileHandleVoList(inspectionFileList); | List<InspectionFileReportVo> inspectionFileHandleVoList = InspectionFileConverMapper.INSTANCE.fromInspectionFileListToInspectionFileHandleVoList(inspectionFileList); | ||||
if (CollectionUtil.isNotEmpty(inspectionFileHandleVoList)) { | |||||
for (InspectionFileReportVo inspectionFileReportVo : inspectionFileHandleVoList) { | |||||
inspectionFileReportVo.setFileThumbnail(CommonConfig.imageURL + inspectionFileReportVo.getFileThumbnail()); | |||||
inspectionFileReportVo.setFileOriginal(CommonConfig.imageURL + inspectionFileReportVo.getFileOriginal()); | |||||
} | |||||
} | |||||
inspectionReportVo.setDeptName(deptName); | inspectionReportVo.setDeptName(deptName); | ||||
inspectionReportVo.setInspectionResultVoList(inspectionResultVoList); | inspectionReportVo.setInspectionResultVoList(inspectionResultVoList); | ||||
inspectionReportVo.setInspectionFileReportVoList(inspectionFileHandleVoList); | inspectionReportVo.setInspectionFileReportVoList(inspectionFileHandleVoList); |
IPage<Report> pageData = reportMapper.selectPageList(page, request); | IPage<Report> pageData = reportMapper.selectPageList(page, request); | ||||
// 构造返回结果对象 | // 构造返回结果对象 | ||||
List<ReportPageListVo> reportPageListVoList = this.buildReportPageListVoList(user, dept, pageData.getRecords()); | |||||
List<ReportPageListVo> reportPageListVoList = this.buildReportPageListVoList(pageData.getRecords()); | |||||
// 重写返回结果对象 | // 重写返回结果对象 | ||||
IPage<ReportPageListVo> reportVoPageData = new Page<>(); | IPage<ReportPageListVo> reportVoPageData = new Page<>(); | ||||
/** | /** | ||||
* 构造返回的数据列表 | * 构造返回的数据列表 | ||||
* | * | ||||
* @param user | |||||
* @param dept | |||||
* @param reportList | * @param reportList | ||||
* @return | * @return | ||||
*/ | */ | ||||
private List<ReportPageListVo> buildReportPageListVoList(User user, Dept dept, List<Report> reportList) { | |||||
private List<ReportPageListVo> buildReportPageListVoList(List<Report> reportList) { | |||||
List<ReportPageListVo> reportPageListVoList = ReportConverMapper.INSTANCE.fromReportListToReportPageListList(reportList); | List<ReportPageListVo> reportPageListVoList = ReportConverMapper.INSTANCE.fromReportListToReportPageListList(reportList); | ||||
return reportPageListVoList; | return reportPageListVoList; | ||||
} | } |
*/ | */ | ||||
private String questionName; | private String questionName; | ||||
/** | |||||
* 文件名称 | |||||
*/ | |||||
private String fileName; | |||||
/** | /** | ||||
* 缩略图 | * 缩略图 | ||||
*/ | */ | ||||
private String fileThumbnail; | private String fileThumbnail; | ||||
/** | |||||
* 原图 | |||||
*/ | |||||
private String fileOriginal; | |||||
/** | /** | ||||
* 纬度 | * 纬度 | ||||
*/ | */ |
<include refid="selectReportVo"/> | <include refid="selectReportVo"/> | ||||
<where> | <where> | ||||
<if test="1 == 1"> and mark = 1 </if> | <if test="1 == 1"> and mark = 1 </if> | ||||
<if test="request.inspectionName != null and request.inspectionName != ''"> and inspection_name like concat('%', #{request.code}, '%') </if> | |||||
<if test="request.inspectionCode!= null and request.inspectionCode != ''"> and inspection_code like concat('%', #{request.inspectionCode}, '%') </if> | |||||
<if test="request.airportId != null and request.airportId != 0"> and airport_id = #{request.airportId} </if> | <if test="request.airportId != null and request.airportId != 0"> and airport_id = #{request.airportId} </if> | ||||
<if test="request.type != null and request.type != 0"> and type = #{request.type} </if> | <if test="request.type != null and request.type != 0"> and type = #{request.type} </if> | ||||
<if test="request.createUser != null and request.createUser != ''"> and create_user = #{request.createUser} </if> | <if test="request.createUser != null and request.createUser != ''"> and create_user = #{request.createUser} </if> |