Parcourir la source

解决问题详情处理人姓名

tags/v1.0.0^2
wanjing il y a 1 an
Parent
révision
97fbd126db
2 fichiers modifiés avec 19 ajouts et 8 suppressions
  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 Voir le fichier

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

+ 2
- 0
tuoheng-service/tuoheng-miniprogram/src/main/java/com/tuoheng/miniprogram/service/impl/InspectionFileHandleServiceImpl.java Voir le fichier

@@ -83,6 +83,8 @@ public class InspectionFileHandleServiceImpl implements IInspectionFileHandleSer
inspectionFileHandle.setCreateUser(user.getId());
inspectionFileHandle.setCreateTime(DateUtils.now());
inspectionFileHandle.setMark(1);


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

Chargement…
Annuler
Enregistrer