|
|
@@ -6,8 +6,8 @@ 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.InspectionTypeEnum; |
|
|
|
import com.tuoheng.admin.enums.MarkEnum; |
|
|
|
import com.tuoheng.admin.enums.code.report.QueryInspectionReportCodeEnum; |
|
|
|
import com.tuoheng.admin.mapper.*; |
|
|
|
import com.tuoheng.admin.utils.CurrentUserUtil; |
|
|
@@ -44,7 +44,7 @@ public class QueryInspectionHandleReportService { |
|
|
|
private UserMapper userMapper; |
|
|
|
|
|
|
|
@Autowired |
|
|
|
private DeptMapper deptMapper; |
|
|
|
private DeptMapper deptMapper; |
|
|
|
|
|
|
|
@Autowired |
|
|
|
private ReportMapper reportMapper; |
|
|
@@ -88,7 +88,7 @@ public class QueryInspectionHandleReportService { |
|
|
|
Report report = reportMapper.selectOne(new LambdaQueryWrapper<Report>() |
|
|
|
.eq(Report::getTenantId, tenantId) |
|
|
|
.eq(Report::getId, id) |
|
|
|
.eq(Report::getMark, 1)); |
|
|
|
.eq(Report::getMark, MarkEnum.VALID.getCode()); |
|
|
|
if (null == report) { |
|
|
|
return JsonResult.error(QueryInspectionReportCodeEnum.REPORT_IS_NOT_EXIST.getCode(), QueryInspectionReportCodeEnum.REPORT_IS_NOT_EXIST.getMsg()); |
|
|
|
} |
|
|
@@ -104,9 +104,9 @@ public class QueryInspectionHandleReportService { |
|
|
|
private InspectionReportVo buildInspectionReportVo(Report report) { |
|
|
|
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)); |
|
|
|
.eq(InspectionFile::getInspectionId, report.getInspectionId()) |
|
|
|
.in(InspectionFile::getStatus, GetInspectionFileStatusList.getStatusList()) |
|
|
|
.eq(InspectionFile::getMark, MarkEnum.VALID.getCode())); |
|
|
|
|
|
|
|
List<InspectionFileReportVo> inspectionFileHandleVoList = InspectionFileConverMapper.INSTANCE.fromInspectionFileListToInspectionFileHandleVoList(inspectionFileList); |
|
|
|
|
|
|
@@ -142,9 +142,9 @@ public class QueryInspectionHandleReportService { |
|
|
|
inspectionFileReportVo.setInspectionFileHandleReportVo(inspectionFileHandleReportVo); |
|
|
|
} |
|
|
|
} |
|
|
|
}else { |
|
|
|
} else { |
|
|
|
//如果没有处理的问题,添加图片url域名 |
|
|
|
inspectionFileHandleVoList =this.getImageUrl(inspectionFileHandleVoList); |
|
|
|
inspectionFileHandleVoList = this.getImageUrl(inspectionFileHandleVoList); |
|
|
|
} |
|
|
|
|
|
|
|
String deptName = this.getDeptName(report.getDeptId()); |
|
|
@@ -165,7 +165,6 @@ public class QueryInspectionHandleReportService { |
|
|
|
inspectionFileReportVo.setFileImage(CommonConfig.imageURL + inspectionFileReportVo.getFileImage()); |
|
|
|
inspectionFileReportVo.setFileThumbnail(CommonConfig.imageURL + inspectionFileReportVo.getFileThumbnail()); |
|
|
|
inspectionFileReportVo.setFileOriginal(CommonConfig.imageURL + inspectionFileReportVo.getFileOriginal()); |
|
|
|
|
|
|
|
} |
|
|
|
return inspectionFileHandleVoList; |
|
|
|
} |
|
|
@@ -176,7 +175,7 @@ public class QueryInspectionHandleReportService { |
|
|
|
if (!CollectionUtil.isEmpty(inspectionFileIdList)) { |
|
|
|
inspectionFileHandleList = inspectionFileHandleMapper.selectList(Wrappers.<InspectionFileHandle>lambdaQuery() |
|
|
|
.in(InspectionFileHandle::getInspectionFileId, inspectionFileIdList) |
|
|
|
.eq(InspectionFileHandle::getMark, 1)); |
|
|
|
.eq(InspectionFileHandle::getMark, MarkEnum.VALID.getCode()); |
|
|
|
|
|
|
|
} |
|
|
|
if (CollectionUtil.isEmpty(inspectionFileIdList)) { |
|
|
@@ -209,7 +208,7 @@ public class QueryInspectionHandleReportService { |
|
|
|
} |
|
|
|
List<User> userList = userMapper.selectList(new LambdaQueryWrapper<User>() |
|
|
|
.in(User::getId, userIdList) |
|
|
|
.eq(User::getMark, 1)); |
|
|
|
.eq(User::getMark, MarkEnum.VALID.getCode()); |
|
|
|
Map<String, User> userMap = userList.stream().collect(Collectors.toMap(User::getId, Function.identity())); |
|
|
|
return userMap; |
|
|
|
} |
|
|
@@ -223,7 +222,7 @@ public class QueryInspectionHandleReportService { |
|
|
|
} |
|
|
|
Dept dept = deptMapper.selectOne(new LambdaQueryWrapper<Dept>() |
|
|
|
.eq(Dept::getId, deptId) |
|
|
|
.eq(Dept::getMark, 1)); |
|
|
|
.eq(Dept::getMark, MarkEnum.VALID.getCode())); |
|
|
|
if (null != dept) { |
|
|
|
return dept.getName(); |
|
|
|
} |
|
|
@@ -233,7 +232,7 @@ public class QueryInspectionHandleReportService { |
|
|
|
private List<InspectionResultVo> buildInspectionResult(Report report) { |
|
|
|
List<InspectionResultVo> inspectionResultVoList = new ArrayList<>(); |
|
|
|
List<QuestionType> questionTypeList = questionTypeMapper.selectList(new LambdaQueryWrapper<QuestionType>() |
|
|
|
.eq(QuestionType::getMark, 1)); |
|
|
|
.eq(QuestionType::getMark, MarkEnum.VALID.getCode()); |
|
|
|
QuestionType questionType; |
|
|
|
InspectionResultVo inspectionResultVo; |
|
|
|
for (int i = 0; i < questionTypeList.size(); i++) { |
|
|
@@ -252,7 +251,7 @@ public class QueryInspectionHandleReportService { |
|
|
|
.eq(InspectionFile::getInspectionId, inspectionId) |
|
|
|
.in(InspectionFile::getStatus, GetInspectionFileStatusList.getStatusList()) |
|
|
|
.eq(InspectionFile::getQuestionCode, questionCode) |
|
|
|
.eq(InspectionFile::getMark, 1)); |
|
|
|
.eq(InspectionFile::getMark, MarkEnum.VALID.getCode()); |
|
|
|
return count; |
|
|
|
} |
|
|
|
|