@@ -47,7 +47,7 @@ public class InspectionFileController { | |||
* @return | |||
*/ | |||
@GetMapping("/page/list") | |||
public JsonResult getPageList(@RequestBody QueryInspectionFilePageListRequest request){ | |||
public JsonResult getPageList(QueryInspectionFilePageListRequest request){ | |||
return iInspectionFileService.getPageList(request); | |||
} | |||
@@ -81,4 +81,16 @@ public class InspectionFileController { | |||
return iInspectionFileService.ignore(idList); | |||
} | |||
/** | |||
* | |||
* 查看问题处理 | |||
* | |||
* @param id | |||
* @return | |||
*/ | |||
@GetMapping("/handle/{id}") | |||
public JsonResult getHandle(@PathVariable("id") String id) { | |||
return iInspectionFileService.getHandle(id); | |||
} | |||
} |
@@ -0,0 +1,15 @@ | |||
package com.tuoheng.admin.conver; | |||
import com.tuoheng.admin.entity.InspectionFileHandle; | |||
import com.tuoheng.admin.vo.InspectionFileHandleVo; | |||
import org.mapstruct.Mapper; | |||
import org.mapstruct.factory.Mappers; | |||
@Mapper | |||
public interface InspectionFileHandleConverMapper { | |||
InspectionFileHandleConverMapper INSTANCE = Mappers.getMapper(InspectionFileHandleConverMapper.class); | |||
InspectionFileHandleVo fromInspectionFileHandleToInspectionFileHandleVo(InspectionFileHandle inspectionFileHandle); | |||
} |
@@ -0,0 +1,49 @@ | |||
package com.tuoheng.admin.enums.code.inspectionfilehandle; | |||
/** | |||
* 查询任务问题处理返回码 | |||
* 模块代码:25(问题管理) | |||
* 接口代码:04 (查询任务问题处理) | |||
* | |||
* @author wanjing | |||
* @team tuoheng | |||
* @date 2022-12-06 | |||
*/ | |||
public enum QueryInspectionFileHandleByInspectionFileIdCodeEnum { | |||
QUERY_IS_FAILED(1250400, "查询任务问题处理结果失败"), | |||
INSPECTION_FILE_ID_IS_NULL(1250401, "任务问题id为空"), | |||
INSPECTION_FILE_IS_NOT_EXIST(1250402, "任务问题不存在"); | |||
/** | |||
* 错误码 | |||
*/ | |||
private int code; | |||
/** | |||
* 错误信息 | |||
*/ | |||
private String msg; | |||
QueryInspectionFileHandleByInspectionFileIdCodeEnum(int code, String msg){ | |||
this.code = code; | |||
this.msg = msg; | |||
} | |||
public int getCode() { | |||
return code; | |||
} | |||
public void setCode(int code) { | |||
this.code = code; | |||
} | |||
public String getMsg() { | |||
return msg; | |||
} | |||
public void setMsg(String msg) { | |||
this.msg = msg; | |||
} | |||
} |
@@ -52,5 +52,12 @@ public interface IInspectionFileService { | |||
*/ | |||
JsonResult ignore(List<String> idList); | |||
/** | |||
* | |||
* 获取任务问题处理结果 | |||
* | |||
* @param id | |||
* @return | |||
*/ | |||
JsonResult getHandle(String id); | |||
} |
@@ -17,6 +17,7 @@ import com.tuoheng.admin.request.inspectionfile.QueryInspectionFilePageListByIns | |||
import com.tuoheng.admin.request.inspectionfile.QueryInspectionFilePageListRequest; | |||
import com.tuoheng.admin.service.IInspectionFileService; | |||
import com.tuoheng.admin.service.inspectionfile.confirm.InspectionFileConfirmService; | |||
import com.tuoheng.admin.service.inspectionfile.handle.QueryInspectionFileHandleByInspectionFileIdService; | |||
import com.tuoheng.admin.service.inspectionfile.ignore.InspectionFileIgnoreService; | |||
import com.tuoheng.admin.service.inspectionfile.query.QueryInspectionFilePageListByInspectionIdService; | |||
import com.tuoheng.admin.service.inspectionfile.query.QueryInspectionFilePageListService; | |||
@@ -74,6 +75,9 @@ public class InspectionFileServiceImpl implements IInspectionFileService { | |||
@Autowired | |||
private InspectionFileConfirmService inspectionFileConfirmService; | |||
@Autowired | |||
private QueryInspectionFileHandleByInspectionFileIdService queryInspectionFileHandleByInspectionFileIdService; | |||
/** | |||
* 问题类型和任务名称 | |||
* | |||
@@ -306,4 +310,16 @@ public class InspectionFileServiceImpl implements IInspectionFileService { | |||
public JsonResult ignore(List<String> idList) { | |||
return inspectionFileIgnoreService.ignore(idList); | |||
} | |||
/** | |||
* | |||
* 获取任务问题处理结果 | |||
* | |||
* @param id | |||
* @return | |||
*/ | |||
@Override | |||
public JsonResult getHandle(String id) { | |||
return queryInspectionFileHandleByInspectionFileIdService.handle(id); | |||
} | |||
} |
@@ -0,0 +1,122 @@ | |||
package com.tuoheng.admin.service.inspectionfile.handle; | |||
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.enums.code.inspectionfile.QueryInspectionFilePageListByInspectionIdCodeEnum; | |||
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.vo.InspectionFileHandleVo; | |||
import com.tuoheng.common.core.config.common.CommonConfig; | |||
import com.tuoheng.common.core.utils.JsonResult; | |||
import com.tuoheng.common.core.utils.StringUtils; | |||
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; | |||
/** | |||
* 根据任务问题ID查询任务问题处理业务层处理 | |||
* | |||
* @author wanjing | |||
* @team tuoheng | |||
* @date 2022-12-06 | |||
*/ | |||
@Slf4j | |||
@Service | |||
public class QueryInspectionFileHandleByInspectionFileIdService { | |||
@Autowired | |||
private InspectionMapper inspectionMapper; | |||
@Autowired | |||
private InspectionFileMapper inspectionFileMapper; | |||
@Autowired | |||
private InspectionFileHandleMapper inspectionFileHandleMapper; | |||
@Autowired | |||
private QuestionTypeMapper questionTypeMapper; | |||
public JsonResult handle(String id) { | |||
log.info("进入根据任务问题ID查询任务问题处理业务, id:{}", id); | |||
JsonResult result = this.check(id); | |||
if (0 != result.getCode()) { | |||
log.info("进入根据任务ID查询巡检任务问题分页列表业务:校验失败:{}", result.getMsg()); | |||
return result; | |||
} | |||
InspectionFile inspectionFile = (InspectionFile) result.getData(); | |||
InspectionFileHandle inspectionFileHandle = inspectionFileHandleMapper.selectOne(new LambdaQueryWrapper<InspectionFileHandle>() | |||
.eq(InspectionFileHandle::getInspectionFileId, id) | |||
.eq(InspectionFileHandle::getMark, 1)); | |||
InspectionFileHandleVo inspectionFileHandleVo = buildInspectionFileHandleVo(inspectionFile, inspectionFileHandle); | |||
return JsonResult.success(inspectionFileHandleVo); | |||
} | |||
/** | |||
* 检查参数 | |||
* | |||
* @param id | |||
* @return | |||
*/ | |||
private JsonResult check(String id) { | |||
// 判断任务问题id是否为空 | |||
if (StringUtils.isEmpty(id)) { | |||
return JsonResult.error(QueryInspectionFileHandleByInspectionFileIdCodeEnum.INSPECTION_FILE_ID_IS_NULL.getCode(), QueryInspectionFileHandleByInspectionFileIdCodeEnum.INSPECTION_FILE_ID_IS_NULL.getMsg()); | |||
} | |||
// 判断任务是否存在 | |||
InspectionFile inspectionFile = inspectionFileMapper.selectOne(new LambdaQueryWrapper<InspectionFile>() | |||
.eq(InspectionFile::getId, id) | |||
.eq(InspectionFile::getMark, 1)); | |||
if (null == inspectionFile) { | |||
return JsonResult.error(QueryInspectionFileHandleByInspectionFileIdCodeEnum.INSPECTION_FILE_IS_NOT_EXIST.getCode(), QueryInspectionFileHandleByInspectionFileIdCodeEnum.INSPECTION_FILE_IS_NOT_EXIST.getMsg()); | |||
} | |||
return JsonResult.success(inspectionFile); | |||
} | |||
/** | |||
* 处理字段 | |||
*/ | |||
private InspectionFileHandleVo buildInspectionFileHandleVo(InspectionFile inspectionFile, InspectionFileHandle inspectionFileHandle) { | |||
InspectionFileHandleVo inspectionFileHandleVo = InspectionFileHandleConverMapper.INSTANCE.fromInspectionFileHandleToInspectionFileHandleVo(inspectionFileHandle); | |||
List<String> handlerImageList = null; | |||
if (!StringUtils.isEmpty(inspectionFileHandle.getHandlerImage())) { | |||
handlerImageList = new ArrayList<>(); | |||
String[] arr = inspectionFileHandle.getHandlerImage().split(","); | |||
List<String> list = Arrays.stream(arr).map(String::toString).collect(Collectors.toList()); | |||
for (String str : list) { | |||
handlerImageList.add(CommonConfig.imageURL + str); | |||
} | |||
} | |||
QuestionType questionType = questionTypeMapper.selectOne(new LambdaQueryWrapper<QuestionType>() | |||
.eq(QuestionType::getId, inspectionFile.getQuestionId()) | |||
.eq(QuestionType::getMark, 1)); | |||
if (null != questionType) { | |||
inspectionFileHandleVo.setQuestionName(questionType.getName()); | |||
inspectionFileHandleVo.setQuestionContent(questionType.getContent()); | |||
} | |||
inspectionFileHandleVo.setQuestionId(inspectionFile.getQuestionId()); | |||
inspectionFileHandleVo.setFileThumbnail(CommonConfig.imageURL + inspectionFile.getFileThumbnail()); | |||
inspectionFileHandleVo.setHandlerImageList(handlerImageList); | |||
return inspectionFileHandleVo; | |||
} | |||
} |
@@ -0,0 +1,60 @@ | |||
package com.tuoheng.admin.vo; | |||
import com.fasterxml.jackson.annotation.JsonFormat; | |||
import lombok.Data; | |||
import java.util.Date; | |||
import java.util.List; | |||
/** | |||
* 任务问题处理返回实体类 | |||
* | |||
* @author wanjing | |||
* @team tuoheng | |||
* @date 2022-12-06 | |||
*/ | |||
@Data | |||
public class InspectionFileHandleVo { | |||
/** | |||
* 问题类型:1坑槽,2积水,3裂缝 | |||
*/ | |||
private String questionId; | |||
/** | |||
* 问题名称:1坑槽,2积水,3裂缝 | |||
*/ | |||
private Integer questionName; | |||
/** | |||
* 问题内容 | |||
*/ | |||
private String questionContent; | |||
/** | |||
* 缩略图 | |||
*/ | |||
private String fileThumbnail; | |||
/** | |||
* 处理人 | |||
*/ | |||
private String handlerUser; | |||
/** | |||
* 处理后图片列表 | |||
*/ | |||
private List<String> handlerImageList; | |||
/** | |||
* 处理结果 | |||
*/ | |||
private String handlerResult; | |||
/** | |||
* 处理完成时间 | |||
*/ | |||
@JsonFormat(pattern = "yyyy-MM-dd") | |||
private Date handlerTime; | |||
} |
@@ -133,7 +133,16 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" | |||
<if test="1 == 1"> and tif.mark = 1 </if> | |||
<if test="request.key != null and request.key != 0"> and (ti.code like concat('%', #{request.key}, '%') or ti.name like concat('%', #{request.key}, '%')) </if> | |||
<if test="request.questionId != null and request.questionId != ''"> and tif.question_id = #{request.questionId} </if> | |||
<if test="request.status != null and request.status != 0"> and tif.status = #{request.status} </if> | |||
<if test="request.status != null"> | |||
<choose> | |||
<when test="request.status != 0"> | |||
and tif.status = #{request.status} | |||
</when> | |||
<otherwise> | |||
and tif.status in (15, 20, 25) | |||
</otherwise> | |||
</choose> | |||
</if> | |||
<if test="request.deptIdList != null and request.deptIdList.size() > 0"> | |||
and ti.dept_id in | |||
<foreach item="deptId" collection="request.deptIdList" open="(" separator="," close=")"> |