|
|
@@ -1,15 +1,14 @@ |
|
|
|
package com.tuoheng.admin.service.inspectionfile.handle; |
|
|
|
|
|
|
|
import cn.hutool.core.util.ObjectUtil; |
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
|
|
|
import com.tuoheng.admin.conver.InspectionFileHandleConverMapper; |
|
|
|
import com.tuoheng.admin.entity.InspectionFile; |
|
|
|
import com.tuoheng.admin.entity.InspectionFileHandle; |
|
|
|
import com.tuoheng.admin.entity.QuestionType; |
|
|
|
import com.tuoheng.admin.entity.User; |
|
|
|
import com.tuoheng.admin.enums.code.inspectionfilehandle.QueryInspectionFileHandleByInspectionFileIdCodeEnum; |
|
|
|
import com.tuoheng.admin.mapper.InspectionFileHandleMapper; |
|
|
|
import com.tuoheng.admin.mapper.InspectionFileMapper; |
|
|
|
import com.tuoheng.admin.mapper.InspectionMapper; |
|
|
|
import com.tuoheng.admin.mapper.QuestionTypeMapper; |
|
|
|
import com.tuoheng.admin.mapper.*; |
|
|
|
import com.tuoheng.admin.vo.inspection.InspectionFileHandleVo; |
|
|
|
import com.tuoheng.common.core.config.common.CommonConfig; |
|
|
|
import com.tuoheng.common.core.utils.JsonResult; |
|
|
@@ -18,7 +17,6 @@ import lombok.extern.slf4j.Slf4j; |
|
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
|
import org.springframework.stereotype.Service; |
|
|
|
|
|
|
|
import java.util.ArrayList; |
|
|
|
import java.util.Arrays; |
|
|
|
import java.util.List; |
|
|
|
import java.util.stream.Collectors; |
|
|
@@ -34,6 +32,9 @@ import java.util.stream.Collectors; |
|
|
|
@Service |
|
|
|
public class QueryInspectionFileHandleByInspectionFileIdService { |
|
|
|
|
|
|
|
@Autowired |
|
|
|
private UserMapper userMapper; |
|
|
|
|
|
|
|
@Autowired |
|
|
|
private InspectionMapper inspectionMapper; |
|
|
|
|
|
|
@@ -59,7 +60,7 @@ public class QueryInspectionFileHandleByInspectionFileIdService { |
|
|
|
.eq(InspectionFileHandle::getInspectionFileId, id) |
|
|
|
.eq(InspectionFileHandle::getMark, 1)); |
|
|
|
|
|
|
|
InspectionFileHandleVo inspectionFileHandleVo = buildInspectionFileHandleVo(inspectionFile, inspectionFileHandle); |
|
|
|
InspectionFileHandleVo inspectionFileHandleVo = this.buildInspectionFileHandleVo(inspectionFile, inspectionFileHandle); |
|
|
|
|
|
|
|
return JsonResult.success(inspectionFileHandleVo); |
|
|
|
} |
|
|
@@ -109,11 +110,19 @@ public class QueryInspectionFileHandleByInspectionFileIdService { |
|
|
|
inspectionFileHandleVo.setHandlerImages(handlerImages); |
|
|
|
} |
|
|
|
QuestionType questionType = questionTypeMapper.selectOne(new LambdaQueryWrapper<QuestionType>() |
|
|
|
.eq(QuestionType::getCode, inspectionFile.getQuestionCode()) |
|
|
|
.eq(QuestionType::getMark, 1)); |
|
|
|
.eq(QuestionType::getCode, inspectionFile.getQuestionCode()) |
|
|
|
.eq(QuestionType::getMark, 1)); |
|
|
|
if (null != questionType) { |
|
|
|
inspectionFileHandleVo.setQuestionName(questionType.getContent()); |
|
|
|
} |
|
|
|
if (StringUtils.isNotEmpty(inspectionFileHandleVo.getHandlerUser())) { |
|
|
|
User user = userMapper.selectOne(new LambdaQueryWrapper<User>() |
|
|
|
.eq(User::getId, inspectionFileHandleVo.getHandlerUser()) |
|
|
|
.eq(User::getMark, 1)); |
|
|
|
if (ObjectUtil.isNotNull(user)) { |
|
|
|
inspectionFileHandleVo.setHandlerUsername(user.getRealname()); |
|
|
|
} |
|
|
|
} |
|
|
|
inspectionFileHandleVo.setQuestionCode(inspectionFile.getQuestionCode()); |
|
|
|
inspectionFileHandleVo.setFileThumbnail(CommonConfig.imageURL + inspectionFile.getFileThumbnail()); |
|
|
|
inspectionFileHandleVo.setFileOriginal(CommonConfig.imageURL + inspectionFile.getFileOriginal()); |