Browse Source

巡检报告中添加处理结果字段

tags/v1.0.0^2
wanjing 1 year ago
parent
commit
bd9d2b68d9
6 changed files with 97 additions and 9 deletions
  1. +0
    -1
      tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/service/report/export/GenerateReportWordService.java
  2. +55
    -1
      tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/service/report/query/QueryInspectionReportService.java
  3. +6
    -6
      tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/vo/inspection/InspectionFileHandleReportVo.java
  4. +1
    -1
      tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/vo/inspection/InspectionFileReportVo.java
  5. +10
    -0
      tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/vo/inspection/InspectionReportVo.java
  6. +25
    -0
      tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/vo/inspection/InspectionResultVo.java

+ 0
- 1
tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/service/report/export/GenerateReportWordService.java View File

@@ -167,7 +167,6 @@ public class GenerateReportWordService {
return "";
}


/**
* 获取公路名称
*/

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

@@ -5,17 +5,21 @@ import com.tuoheng.admin.conver.InspectionFileConverMapper;
import com.tuoheng.admin.conver.ReportConverMapper;
import com.tuoheng.admin.entity.*;
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.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.utils.JsonResult;
import com.tuoheng.common.core.utils.StringUtils;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.ArrayList;
import java.util.List;

/**
@@ -35,6 +39,12 @@ public class QueryInspectionReportService {
@Autowired
private ReportMapper reportMapper;

@Autowired
private DeptMapper deptMapper;

@Autowired
private QuestionTypeMapper questionTypeMapper;

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

@@ -89,9 +99,53 @@ public class QueryInspectionReportService {
List<InspectionFile> inspectionFileList = inspectionFileMapper.selectList(new LambdaQueryWrapper<InspectionFile>()
.eq(InspectionFile::getInspectionId, report.getInspectionId())
.eq(InspectionFile::getMark, 1));

String deptName = this.getDeptName(report.getDeptId());
List<InspectionResultVo> inspectionResultVoList = this.buildInspectionResult(report);
List<InspectionFileReportVo> inspectionFileHandleVoList = InspectionFileConverMapper.INSTANCE.fromInspectionFileListToInspectionFileHandleVoList(inspectionFileList);
inspectionReportVo.setDeptName(deptName);
inspectionReportVo.setInspectionResultVoList(inspectionResultVoList);
inspectionReportVo.setInspectionFileReportVoList(inspectionFileHandleVoList);
return inspectionReportVo;
}

/**
* 获取部门路名称
*/
private String getDeptName(String deptId) {
if (StringUtils.isEmpty(deptId)) {
return "";
}
Dept dept = deptMapper.selectOne(new LambdaQueryWrapper<Dept>()
.eq(Dept::getId, deptId)
.eq(Dept::getMark, 1));
if (null != dept) {
return dept.getName();
}
return "";
}

private List<InspectionResultVo> buildInspectionResult(Report report) {
List<InspectionResultVo> inspectionResultVoList = new ArrayList<>();
List<QuestionType> questionTypeList = questionTypeMapper.selectList(new LambdaQueryWrapper<QuestionType>()
.eq(QuestionType::getMark, 1));
QuestionType questionType;
InspectionResultVo inspectionResultVo;
for (int i = 0; i < questionTypeList.size(); i++) {
inspectionResultVo = new InspectionResultVo();
questionType = questionTypeList.get(i);
Integer count = this.getCount(report.getInspectionId(), questionType.getId());
inspectionResultVo.setQuestionTypeContent(questionType.getContent());
inspectionResultVo.setCount(count);
inspectionResultVoList.add(inspectionResultVo);
}
return inspectionResultVoList;
}

private Integer getCount(String inspectionId, String questionTypeId) {
Integer count = inspectionFileMapper.selectCount(new LambdaQueryWrapper<InspectionFile>()
.eq(InspectionFile::getInspectionId, inspectionId)
.eq(InspectionFile::getQuestionId, questionTypeId)
.eq(InspectionFile::getMark, 1));
return count;
}
}

+ 6
- 6
tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/vo/inspection/InspectionFileHandleReportVo.java View File

@@ -17,15 +17,10 @@ import java.util.List;
public class InspectionFileHandleReportVo {

/**
* 处理人ID
* 处理人
*/
private String handlerUser;

/**
* 处理后图片(多个图片逗号“,”分隔)
*/
private List<String> handlerImageList;

/**
* 处理结果
*/
@@ -37,4 +32,9 @@ public class InspectionFileHandleReportVo {
@JsonFormat(pattern = "yyyy-MM-dd")
private Date handlerTime;

/**
* 处理后图片列表
*/
private List<String> handlerImageList;

}

+ 1
- 1
tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/vo/inspection/InspectionFileReportVo.java View File

@@ -38,7 +38,7 @@ public class InspectionFileReportVo {
private String fileThumbnail;

/**
*
*
*/
private String latitude;


+ 10
- 0
tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/vo/inspection/InspectionReportVo.java View File

@@ -32,6 +32,11 @@ public class InspectionReportVo {
*/
private String deptId;

/**
* 部门名称
*/
private String deptName;

/**
* 报告编号
*/
@@ -275,6 +280,11 @@ public class InspectionReportVo {
*/
private String patrolLocation;

/**
* 巡检结果列表
*/
private List<InspectionResultVo> inspectionResultVoList;

/**
* 问题列表
*/

+ 25
- 0
tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/vo/inspection/InspectionResultVo.java View File

@@ -0,0 +1,25 @@
package com.tuoheng.admin.vo.inspection;

import lombok.Data;

/**
* 返回巡检报告视图Vo
*
* @author wanjing
* @team tuoheng
* @date 2022-12-22
*/
@Data
public class InspectionResultVo {

/**
* 巡检内容
*/
private String questionTypeContent;

/**
* 巡检条数
*/
private Integer count;

}

Loading…
Cancel
Save