@@ -21,6 +21,15 @@ public class MissionStatusRequest implements Serializable { | |||
@NotNull(message = "巡检任务ID不能为空!") | |||
private Integer id; | |||
/** | |||
* 视频推流地址 | |||
* | |||
* 机场平台根据hhz小程序需求调整,传该字段; | |||
* 目前高速小程序播放的都是已经完成的任务,使用的是aiVideoUrl字段,不需要使用该字段,因此暂未使用该字段 | |||
* | |||
*/ | |||
private String playUrl; | |||
/** | |||
* 视频推流地址 | |||
*/ |
@@ -7,11 +7,13 @@ import com.tuoheng.admin.entity.InspectionFile; | |||
import com.tuoheng.admin.entity.InspectionFileHandle; | |||
import com.tuoheng.admin.entity.Report; | |||
import com.tuoheng.admin.entity.Tenant; | |||
import com.tuoheng.admin.enums.InspectionFileStatusEnum; | |||
import com.tuoheng.admin.enums.code.report.ExportInspectionHandleReportCodeEnum; | |||
import com.tuoheng.admin.mapper.InspectionFileHandleMapper; | |||
import com.tuoheng.admin.mapper.InspectionFileMapper; | |||
import com.tuoheng.admin.mapper.ReportMapper; | |||
import com.tuoheng.admin.mapper.TenantMapper; | |||
import com.tuoheng.admin.service.report.query.GetInspectionFileStatusList; | |||
import com.tuoheng.admin.utils.DownloadUtil; | |||
import com.tuoheng.admin.utils.CurrentUserUtil; | |||
import com.tuoheng.common.core.config.UploadFileConfig; | |||
@@ -23,6 +25,7 @@ import org.springframework.stereotype.Service; | |||
import javax.servlet.http.HttpServletResponse; | |||
import java.io.File; | |||
import java.util.ArrayList; | |||
import java.util.List; | |||
import java.util.stream.Collectors; | |||
@@ -66,8 +69,9 @@ public class ExportInspectionHandleReportService { | |||
// 查询问题清单 | |||
List<InspectionFile> inspectionFileList = inspectionFileMapper.selectList(new LambdaQueryWrapper<InspectionFile>() | |||
.eq(InspectionFile::getTenantId, tenantId) | |||
.eq(InspectionFile::getInspectionId, report.getInspectionId())); | |||
.eq(InspectionFile::getTenantId, tenantId) | |||
.in(InspectionFile::getStatus, GetInspectionFileStatusList.getStatusList()) | |||
.eq(InspectionFile::getInspectionId, report.getInspectionId())); | |||
// 查询问题处理结果 | |||
List<String> inspectionFileIdList = inspectionFileList.stream().map(o -> o.getId()).collect(Collectors.toList()); |
@@ -6,11 +6,13 @@ import com.baomidou.mybatisplus.core.toolkit.Wrappers; | |||
import com.tuoheng.admin.entity.InspectionFile; | |||
import com.tuoheng.admin.entity.Report; | |||
import com.tuoheng.admin.entity.Tenant; | |||
import com.tuoheng.admin.enums.InspectionFileStatusEnum; | |||
import com.tuoheng.admin.enums.code.report.ExportInspectionReportReportCodeEnum; | |||
import com.tuoheng.admin.mapper.InspectionFileHandleMapper; | |||
import com.tuoheng.admin.mapper.InspectionFileMapper; | |||
import com.tuoheng.admin.mapper.ReportMapper; | |||
import com.tuoheng.admin.mapper.TenantMapper; | |||
import com.tuoheng.admin.service.report.query.GetInspectionFileStatusList; | |||
import com.tuoheng.admin.utils.DownloadUtil; | |||
import com.tuoheng.admin.utils.CurrentUserUtil; | |||
import com.tuoheng.common.core.config.UploadFileConfig; | |||
@@ -22,6 +24,7 @@ import org.springframework.stereotype.Service; | |||
import javax.servlet.http.HttpServletResponse; | |||
import java.io.File; | |||
import java.util.ArrayList; | |||
import java.util.List; | |||
/** | |||
@@ -64,8 +67,9 @@ public class ExportInspectionReportService { | |||
// 查询问题清单 | |||
List<InspectionFile> inspectionFileList = inspectionFileMapper.selectList(new LambdaQueryWrapper<InspectionFile>() | |||
.eq(InspectionFile::getTenantId, tenantId) | |||
.eq(InspectionFile::getInspectionId, report.getInspectionId())); | |||
.eq(InspectionFile::getTenantId, tenantId) | |||
.in(InspectionFile::getStatus, GetInspectionFileStatusList.getStatusList()) | |||
.eq(InspectionFile::getInspectionId, report.getInspectionId())); | |||
String filename = report.getReportCode() + ".doc"; | |||
String filePath = UploadFileConfig.uploadFolder + "/doc/" + filename; |
@@ -4,7 +4,9 @@ import cn.hutool.core.collection.CollectionUtil; | |||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; | |||
import com.lowagie.text.*; | |||
import com.tuoheng.admin.entity.*; | |||
import com.tuoheng.admin.enums.InspectionFileStatusEnum; | |||
import com.tuoheng.admin.mapper.*; | |||
import com.tuoheng.admin.service.report.query.GetInspectionFileStatusList; | |||
import com.tuoheng.admin.utils.WordUtils; | |||
import com.tuoheng.common.core.config.common.CommonConfig; | |||
import com.tuoheng.common.core.utils.DateUtils; | |||
@@ -17,6 +19,7 @@ import org.springframework.stereotype.Service; | |||
import java.io.IOException; | |||
import java.net.MalformedURLException; | |||
import java.util.ArrayList; | |||
import java.util.Arrays; | |||
import java.util.List; | |||
import java.util.Map; | |||
@@ -234,6 +237,7 @@ public class GenerateReportWordService { | |||
private String getCount(String inspectionId, String questionCode) { | |||
Integer count = inspectionFileMapper.selectCount(new LambdaQueryWrapper<InspectionFile>() | |||
.eq(InspectionFile::getInspectionId, inspectionId) | |||
.in(InspectionFile::getStatus, GetInspectionFileStatusList.getStatusList()) | |||
.eq(InspectionFile::getQuestionCode, questionCode) | |||
.eq(InspectionFile::getMark, 1)); | |||
return Integer.toString(count); |
@@ -7,6 +7,7 @@ import com.tuoheng.admin.entity.*; | |||
import com.tuoheng.admin.enums.InspectionFileStatusEnum; | |||
import com.tuoheng.admin.enums.code.report.GenerateReportCodeEnum; | |||
import com.tuoheng.admin.mapper.*; | |||
import com.tuoheng.admin.service.report.query.GetInspectionFileStatusList; | |||
import com.tuoheng.admin.utils.CurrentUserUtil; | |||
import com.tuoheng.common.core.utils.DateUtils; | |||
import com.tuoheng.common.core.utils.JsonResult; | |||
@@ -107,14 +108,9 @@ public class GenerateReportService { | |||
report.setInspectionName(inspection.getName()); | |||
report.setCreateUser(userId); | |||
report.setCreateTime(DateUtils.now()); | |||
List<Integer> statusList = new ArrayList<>(); | |||
statusList.add(InspectionFileStatusEnum.CONFIRMED.getCode()); | |||
statusList.add(InspectionFileStatusEnum.GENERATE_ORDER.getCode()); | |||
statusList.add(InspectionFileStatusEnum.PROCESSED.getCode()); | |||
List<InspectionFile> inspectionFileList = inspectionFileMapper.selectList(Wrappers.<InspectionFile>lambdaQuery() | |||
.eq(InspectionFile::getInspectionId, inspection.getId()) | |||
.in(InspectionFile::getStatus, statusList) | |||
.in(InspectionFile::getStatus, GetInspectionFileStatusList.getStatusList()) | |||
.eq(InspectionFile::getMark, 1)); | |||
List<String> inspectionFileIdList = null; | |||
if (!CollectionUtil.isEmpty(inspectionFileList)) { |
@@ -0,0 +1,20 @@ | |||
package com.tuoheng.admin.service.report.query; | |||
import com.tuoheng.admin.enums.InspectionFileStatusEnum; | |||
import java.util.ArrayList; | |||
import java.util.List; | |||
public final class GetInspectionFileStatusList { | |||
public static List<Integer> getStatusList() { | |||
List<Integer> statusList = new ArrayList<>(); | |||
statusList.add(InspectionFileStatusEnum.CONFIRMED.getCode()); | |||
statusList.add(InspectionFileStatusEnum.GENERATE_ORDER.getCode()); | |||
statusList.add(InspectionFileStatusEnum.PROCESSED.getCode()); | |||
return statusList; | |||
} | |||
} | |||
@@ -6,15 +6,14 @@ import com.baomidou.mybatisplus.core.toolkit.Wrappers; | |||
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.code.report.QueryInspectionReportCodeEnum; | |||
import com.tuoheng.admin.mapper.InspectionFileHandleMapper; | |||
import com.tuoheng.admin.mapper.InspectionFileMapper; | |||
import com.tuoheng.admin.mapper.ReportMapper; | |||
import com.tuoheng.admin.mapper.UserMapper; | |||
import com.tuoheng.admin.mapper.*; | |||
import com.tuoheng.admin.utils.CurrentUserUtil; | |||
import com.tuoheng.admin.vo.inspection.InspectionFileHandleReportVo; | |||
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; | |||
@@ -43,9 +42,15 @@ public class QueryInspectionHandleReportService { | |||
@Autowired | |||
private UserMapper userMapper; | |||
@Autowired | |||
private DeptMapper deptMapper; | |||
@Autowired | |||
private ReportMapper reportMapper; | |||
@Autowired | |||
private QuestionTypeMapper questionTypeMapper; | |||
@Autowired | |||
private InspectionFileMapper inspectionFileMapper; | |||
@@ -99,6 +104,7 @@ public class QueryInspectionHandleReportService { | |||
InspectionReportVo inspectionReportVo = ReportConverMapper.INSTANCE.fromReportToInspectionReportVo(report); | |||
List<InspectionFile> inspectionFileList = inspectionFileMapper.selectList(new LambdaQueryWrapper<InspectionFile>() | |||
.eq(InspectionFile::getInspectionId, report.getInspectionId()) | |||
.in(InspectionFile::getStatus, GetInspectionFileStatusList.getStatusList()) | |||
.eq(InspectionFile::getMark, 1)); | |||
List<InspectionFileReportVo> inspectionFileHandleVoList = InspectionFileConverMapper.INSTANCE.fromInspectionFileListToInspectionFileHandleVoList(inspectionFileList); | |||
@@ -133,6 +139,10 @@ public class QueryInspectionHandleReportService { | |||
} | |||
} | |||
} | |||
String deptName = this.getDeptName(report.getDeptId()); | |||
List<InspectionResultVo> inspectionResultVoList = this.buildInspectionResult(report); | |||
inspectionReportVo.setDeptName(deptName); | |||
inspectionReportVo.setInspectionResultVoList(inspectionResultVoList); | |||
inspectionReportVo.setInspectionFileReportVoList(inspectionFileHandleVoList); | |||
return inspectionReportVo; | |||
@@ -175,4 +185,47 @@ public class QueryInspectionHandleReportService { | |||
Map<String, User> userMap = userList.stream().collect(Collectors.toMap(User::getId, Function.identity())); | |||
return userMap; | |||
} | |||
/** | |||
* 获取部门路名称 | |||
*/ | |||
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.getCode()); | |||
inspectionResultVo.setQuestionTypeContent(questionType.getContent()); | |||
inspectionResultVo.setCount(count); | |||
inspectionResultVoList.add(inspectionResultVo); | |||
} | |||
return inspectionResultVoList; | |||
} | |||
private Integer getCount(String inspectionId, String questionCode) { | |||
Integer count = inspectionFileMapper.selectCount(new LambdaQueryWrapper<InspectionFile>() | |||
.eq(InspectionFile::getInspectionId, inspectionId) | |||
.in(InspectionFile::getStatus, GetInspectionFileStatusList.getStatusList()) | |||
.eq(InspectionFile::getQuestionCode, questionCode) | |||
.eq(InspectionFile::getMark, 1)); | |||
return count; | |||
} | |||
} |
@@ -5,6 +5,7 @@ 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.code.report.QueryInspectionReportCodeEnum; | |||
import com.tuoheng.admin.mapper.DeptMapper; | |||
import com.tuoheng.admin.mapper.InspectionFileMapper; | |||
@@ -100,6 +101,7 @@ public class QueryInspectionReportService { | |||
InspectionReportVo inspectionReportVo = ReportConverMapper.INSTANCE.fromReportToInspectionReportVo(report); | |||
List<InspectionFile> inspectionFileList = inspectionFileMapper.selectList(new LambdaQueryWrapper<InspectionFile>() | |||
.eq(InspectionFile::getInspectionId, report.getInspectionId()) | |||
.in(InspectionFile::getStatus, GetInspectionFileStatusList.getStatusList()) | |||
.eq(InspectionFile::getMark, 1)); | |||
String deptName = this.getDeptName(report.getDeptId()); | |||
List<InspectionResultVo> inspectionResultVoList = this.buildInspectionResult(report); | |||
@@ -151,9 +153,11 @@ public class QueryInspectionReportService { | |||
private Integer getCount(String inspectionId, String questionCode) { | |||
Integer count = inspectionFileMapper.selectCount(new LambdaQueryWrapper<InspectionFile>() | |||
.eq(InspectionFile::getInspectionId, inspectionId) | |||
.eq(InspectionFile::getQuestionCode, questionCode) | |||
.eq(InspectionFile::getMark, 1)); | |||
.eq(InspectionFile::getInspectionId, inspectionId) | |||
.in(InspectionFile::getStatus, GetInspectionFileStatusList.getStatusList()) | |||
.eq(InspectionFile::getQuestionCode, questionCode) | |||
.eq(InspectionFile::getMark, 1)); | |||
return count; | |||
} | |||
} |