Browse Source

解决问题详情处理人姓名

tags/v1.0.0^2
wanjing 1 year ago
parent
commit
97fbd126db
2 changed files with 19 additions and 8 deletions
  1. +17
    -8
      tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/service/inspectionfile/handle/QueryInspectionFileHandleByInspectionFileIdService.java
  2. +2
    -0
      tuoheng-service/tuoheng-miniprogram/src/main/java/com/tuoheng/miniprogram/service/impl/InspectionFileHandleServiceImpl.java

+ 17
- 8
tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/service/inspectionfile/handle/QueryInspectionFileHandleByInspectionFileIdService.java View File

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());

+ 2
- 0
tuoheng-service/tuoheng-miniprogram/src/main/java/com/tuoheng/miniprogram/service/impl/InspectionFileHandleServiceImpl.java View File

inspectionFileHandle.setCreateUser(user.getId()); inspectionFileHandle.setCreateUser(user.getId());
inspectionFileHandle.setCreateTime(DateUtils.now()); inspectionFileHandle.setCreateTime(DateUtils.now());
inspectionFileHandle.setMark(1); inspectionFileHandle.setMark(1);


int count = inspectionFileHandleMapper.insert(inspectionFileHandle); int count = inspectionFileHandleMapper.insert(inspectionFileHandle);
if(count<=0){ if(count<=0){
return JsonResult.error(); return JsonResult.error();

Loading…
Cancel
Save