|
|
|
|
|
|
|
|
package com.tuoheng.admin.service.inspectionfile.handle; |
|
|
package com.tuoheng.admin.service.inspectionfile.handle; |
|
|
|
|
|
|
|
|
|
|
|
import cn.hutool.core.util.ObjectUtil; |
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
|
|
import com.tuoheng.admin.conver.InspectionFileHandleConverMapper; |
|
|
import com.tuoheng.admin.conver.InspectionFileHandleConverMapper; |
|
|
import com.tuoheng.admin.entity.InspectionFile; |
|
|
import com.tuoheng.admin.entity.InspectionFile; |
|
|
import com.tuoheng.admin.entity.InspectionFileHandle; |
|
|
import com.tuoheng.admin.entity.InspectionFileHandle; |
|
|
import com.tuoheng.admin.entity.QuestionType; |
|
|
import com.tuoheng.admin.entity.QuestionType; |
|
|
|
|
|
import com.tuoheng.admin.entity.User; |
|
|
import com.tuoheng.admin.enums.code.inspectionfilehandle.QueryInspectionFileHandleByInspectionFileIdCodeEnum; |
|
|
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.admin.vo.inspection.InspectionFileHandleVo; |
|
|
import com.tuoheng.common.core.config.common.CommonConfig; |
|
|
import com.tuoheng.common.core.config.common.CommonConfig; |
|
|
import com.tuoheng.common.core.utils.JsonResult; |
|
|
import com.tuoheng.common.core.utils.JsonResult; |
|
|
|
|
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
import org.springframework.stereotype.Service; |
|
|
import org.springframework.stereotype.Service; |
|
|
|
|
|
|
|
|
import java.util.ArrayList; |
|
|
|
|
|
import java.util.Arrays; |
|
|
import java.util.Arrays; |
|
|
import java.util.List; |
|
|
import java.util.List; |
|
|
import java.util.stream.Collectors; |
|
|
import java.util.stream.Collectors; |
|
|
|
|
|
|
|
|
@Service |
|
|
@Service |
|
|
public class QueryInspectionFileHandleByInspectionFileIdService { |
|
|
public class QueryInspectionFileHandleByInspectionFileIdService { |
|
|
|
|
|
|
|
|
|
|
|
@Autowired |
|
|
|
|
|
private UserMapper userMapper; |
|
|
|
|
|
|
|
|
@Autowired |
|
|
@Autowired |
|
|
private InspectionMapper inspectionMapper; |
|
|
private InspectionMapper inspectionMapper; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
.eq(InspectionFileHandle::getInspectionFileId, id) |
|
|
.eq(InspectionFileHandle::getInspectionFileId, id) |
|
|
.eq(InspectionFileHandle::getMark, 1)); |
|
|
.eq(InspectionFileHandle::getMark, 1)); |
|
|
|
|
|
|
|
|
InspectionFileHandleVo inspectionFileHandleVo = buildInspectionFileHandleVo(inspectionFile, inspectionFileHandle); |
|
|
|
|
|
|
|
|
InspectionFileHandleVo inspectionFileHandleVo = this.buildInspectionFileHandleVo(inspectionFile, inspectionFileHandle); |
|
|
|
|
|
|
|
|
return JsonResult.success(inspectionFileHandleVo); |
|
|
return JsonResult.success(inspectionFileHandleVo); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
inspectionFileHandleVo.setHandlerImages(handlerImages); |
|
|
inspectionFileHandleVo.setHandlerImages(handlerImages); |
|
|
} |
|
|
} |
|
|
QuestionType questionType = questionTypeMapper.selectOne(new LambdaQueryWrapper<QuestionType>() |
|
|
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) { |
|
|
if (null != questionType) { |
|
|
inspectionFileHandleVo.setQuestionName(questionType.getContent()); |
|
|
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.setQuestionCode(inspectionFile.getQuestionCode()); |
|
|
inspectionFileHandleVo.setFileThumbnail(CommonConfig.imageURL + inspectionFile.getFileThumbnail()); |
|
|
inspectionFileHandleVo.setFileThumbnail(CommonConfig.imageURL + inspectionFile.getFileThumbnail()); |
|
|
inspectionFileHandleVo.setFileOriginal(CommonConfig.imageURL + inspectionFile.getFileOriginal()); |
|
|
inspectionFileHandleVo.setFileOriginal(CommonConfig.imageURL + inspectionFile.getFileOriginal()); |