Преглед изворни кода

重构报告代码

tags/v1.0.0^2
wanjing пре 1 година
родитељ
комит
4d0c2b9f2c
6 измењених фајлова са 25 додато и 13 уклоњено
  1. +2
    -2
      tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/request/report/QueryReportPageListRequest.java
  2. +2
    -6
      tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/service/report/query/QueryInspectionHandleReportService.java
  3. +8
    -0
      tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/service/report/query/QueryInspectionReportService.java
  4. +2
    -4
      tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/service/report/query/QueryReportPageListService.java
  5. +10
    -0
      tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/vo/inspection/InspectionFileReportVo.java
  6. +1
    -1
      tuoheng-service/tuoheng-admin/src/main/resources/mapper/ReportMapper.xml

+ 2
- 2
tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/request/report/QueryReportPageListRequest.java Прегледај датотеку

@@ -14,9 +14,9 @@ import lombok.Data;
public class QueryReportPageListRequest extends BaseQuery {

/**
* 任务名称
* 任务编码
*/
private String inspectionName;
private String inspectionCode;

/**
* 巡检任务类型: 1 临时巡检(目前只有该一种类型)

+ 2
- 6
tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/service/report/query/QueryInspectionHandleReportService.java Прегледај датотеку

@@ -52,20 +52,14 @@ public class QueryInspectionHandleReportService {

public JsonResult getInspectionHandleReport(String id) {
log.info("进入查看巡检处理报告业务");

String userId = CurrentUserUtil.getUserId();
String tenantId = CurrentUserUtil.getTenantId();

JsonResult result = this.check(tenantId, id);
if (0 != result.getCode()) {
log.info("进入查看巡检处理报告业务:校验失败:{}", result.getMsg());
return result;
}

Report report = (Report) result.getData();

InspectionReportVo inspectionReportVo = this.buildInspectionReportVo(report);

return JsonResult.success(inspectionReportVo);
}

@@ -114,6 +108,8 @@ public class QueryInspectionHandleReportService {
List<String> handlerImageList = null;
for (InspectionFileReportVo inspectionFileReportVo : inspectionFileHandleVoList) {
inspectionFileHandle = inspectionFileHandleMap.get(inspectionFileReportVo.getId());
inspectionFileReportVo.setFileThumbnail(CommonConfig.imageURL + inspectionFileReportVo.getFileThumbnail());
inspectionFileReportVo.setFileOriginal(CommonConfig.imageURL + inspectionFileReportVo.getFileOriginal());
if (null != inspectionFileHandle) {
handlerImageList = new ArrayList<>();
String[] arr = inspectionFileHandle.getHandlerImage().split(",");

+ 8
- 0
tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/service/report/query/QueryInspectionReportService.java Прегледај датотеку

@@ -1,5 +1,6 @@
package com.tuoheng.admin.service.report.query;

import cn.hutool.core.collection.CollectionUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.tuoheng.admin.conver.InspectionFileConverMapper;
import com.tuoheng.admin.conver.ReportConverMapper;
@@ -13,6 +14,7 @@ import com.tuoheng.admin.utils.CurrentUserUtil;
import com.tuoheng.admin.vo.inspection.InspectionFileReportVo;
import com.tuoheng.admin.vo.inspection.InspectionReportVo;
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.StringUtils;
import lombok.extern.slf4j.Slf4j;
@@ -102,6 +104,12 @@ public class QueryInspectionReportService {
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) {
inspectionFileReportVo.setFileThumbnail(CommonConfig.imageURL + inspectionFileReportVo.getFileThumbnail());
inspectionFileReportVo.setFileOriginal(CommonConfig.imageURL + inspectionFileReportVo.getFileOriginal());
}
}
inspectionReportVo.setDeptName(deptName);
inspectionReportVo.setInspectionResultVoList(inspectionResultVoList);
inspectionReportVo.setInspectionFileReportVoList(inspectionFileHandleVoList);

+ 2
- 4
tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/service/report/query/QueryReportPageListService.java Прегледај датотеку

@@ -78,7 +78,7 @@ public class QueryReportPageListService {
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<>();
@@ -118,12 +118,10 @@ public class QueryReportPageListService {
/**
* 构造返回的数据列表
*
* @param user
* @param dept
* @param reportList
* @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);
return reportPageListVoList;
}

+ 10
- 0
tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/vo/inspection/InspectionFileReportVo.java Прегледај датотеку

@@ -27,11 +27,21 @@ public class InspectionFileReportVo {
*/
private String questionName;

/**
* 文件名称
*/
private String fileName;

/**
* 缩略图
*/
private String fileThumbnail;

/**
* 原图
*/
private String fileOriginal;

/**
* 纬度
*/

+ 1
- 1
tuoheng-service/tuoheng-admin/src/main/resources/mapper/ReportMapper.xml Прегледај датотеку

@@ -73,7 +73,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<include refid="selectReportVo"/>
<where>
<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.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>

Loading…
Откажи
Сачувај