@@ -6,7 +6,6 @@ import com.tuoheng.miniprogram.service.IInspectionService; | |||
import com.tuoheng.miniprogram.vo.AirLineVO; | |||
import com.tuoheng.miniprogram.vo.AirPortVO; | |||
import lombok.extern.slf4j.Slf4j; | |||
import org.apache.ibatis.annotations.Delete; | |||
import org.springframework.beans.factory.annotation.Autowired; | |||
import org.springframework.web.bind.annotation.*; | |||
@@ -77,14 +76,4 @@ public class InspectionController { | |||
} | |||
} |
@@ -1,13 +1,13 @@ | |||
package com.tuoheng.miniprogram.controller; | |||
import com.tuoheng.common.core.utils.JsonResult; | |||
import com.tuoheng.miniprogram.entity.InspectionFile; | |||
import com.tuoheng.miniprogram.entity.dto.QuestionIdentificationDto; | |||
import com.tuoheng.miniprogram.entity.query.InspectionFileQuery; | |||
import com.tuoheng.miniprogram.service.IInspectionFileService; | |||
import com.tuoheng.miniprogram.service.IInspectionService; | |||
import org.springframework.beans.factory.annotation.Autowired; | |||
import org.springframework.web.bind.annotation.GetMapping; | |||
import org.springframework.web.bind.annotation.RequestMapping; | |||
import org.springframework.web.bind.annotation.RestController; | |||
import org.springframework.web.bind.annotation.*; | |||
/** | |||
* 问题管理 前端控制器 | |||
@@ -52,6 +52,39 @@ public class InspectionFileController { | |||
return iInspectionFileService.ignoredQuestion(query); | |||
} | |||
/** | |||
* 确认问题 | |||
* @param entity | |||
* @return | |||
*/ | |||
@PutMapping("/confirm") | |||
public JsonResult confirm(@RequestBody InspectionFile entity){ | |||
return iInspectionFileService.confirm(entity); | |||
} | |||
/** | |||
* 忽略问题 | |||
* @param entity | |||
* @return | |||
*/ | |||
@PutMapping("/ignore") | |||
public JsonResult ignore(@RequestBody InspectionFile entity){ | |||
return iInspectionFileService.ignore(entity); | |||
} | |||
/** | |||
* 问题标识 | |||
* @param dto | |||
* @return | |||
*/ | |||
@PutMapping("/identification") | |||
public JsonResult questionIdentification(@RequestBody QuestionIdentificationDto dto){ | |||
return iInspectionFileService.questionIdentification(dto); | |||
} | |||
@@ -0,0 +1,30 @@ | |||
package com.tuoheng.miniprogram.controller; | |||
import com.tuoheng.common.core.utils.JsonResult; | |||
import com.tuoheng.miniprogram.service.IQuestionTypeService; | |||
import org.springframework.beans.factory.annotation.Autowired; | |||
import org.springframework.web.bind.annotation.GetMapping; | |||
import org.springframework.web.bind.annotation.RequestMapping; | |||
import org.springframework.web.bind.annotation.RestController; | |||
/** | |||
* @Author ChengWang | |||
* @Date 2022/11/25 | |||
*/ | |||
@RestController | |||
@RequestMapping("/questionType") | |||
public class QuestionTypeController { | |||
@Autowired | |||
private IQuestionTypeService iQuestionTypeService; | |||
/** | |||
* 问题类型列表 | |||
* @return | |||
*/ | |||
@GetMapping("/getList") | |||
public JsonResult getList(){ | |||
return iQuestionTypeService.getList(); | |||
} | |||
} |
@@ -0,0 +1,11 @@ | |||
package com.tuoheng.miniprogram.dao; | |||
import com.baomidou.mybatisplus.core.mapper.BaseMapper; | |||
import com.tuoheng.miniprogram.entity.QuestionType; | |||
/** | |||
* @Author ChengWang | |||
* @Date 2022/11/25 | |||
*/ | |||
public interface QuestionTypeMapper extends BaseMapper<QuestionType> { | |||
} |
@@ -15,7 +15,7 @@ import lombok.experimental.Accessors; | |||
@Data | |||
@EqualsAndHashCode(callSuper = true) | |||
@Accessors(chain = true) | |||
@TableName("th_inspection_file_handle") | |||
@TableName("th_inspection_history") | |||
public class InspectionHistory extends BaseEntity { | |||
private static final long serialVersionUID = 1L; | |||
@@ -15,7 +15,7 @@ import lombok.experimental.Accessors; | |||
@Data | |||
@EqualsAndHashCode(callSuper = true) | |||
@Accessors(chain = true) | |||
@TableName("th_inspection_file_handle") | |||
@TableName("th_question_type") | |||
public class QuestionType extends BaseEntity { | |||
private static final long serialVersionUID = 1L; | |||
@@ -0,0 +1,28 @@ | |||
package com.tuoheng.miniprogram.entity.dto; | |||
import lombok.Data; | |||
/** | |||
* @Author ChengWang | |||
* @Date 2022/11/25 | |||
*/ | |||
@Data | |||
public class QuestionIdentificationDto { | |||
/** | |||
* 问题id | |||
*/ | |||
private String id; | |||
/** | |||
* 租户id | |||
*/ | |||
private String tenantId; | |||
/** | |||
* 问题类型二级分类id | |||
*/ | |||
private String questionId; | |||
} |
@@ -1,6 +1,8 @@ | |||
package com.tuoheng.miniprogram.service; | |||
import com.tuoheng.common.core.utils.JsonResult; | |||
import com.tuoheng.miniprogram.entity.InspectionFile; | |||
import com.tuoheng.miniprogram.entity.dto.QuestionIdentificationDto; | |||
import com.tuoheng.miniprogram.entity.query.InspectionFileQuery; | |||
/** | |||
@@ -13,4 +15,10 @@ public interface IInspectionFileService { | |||
JsonResult confirmedQuestion(InspectionFileQuery query); | |||
JsonResult ignoredQuestion(InspectionFileQuery query); | |||
JsonResult questionIdentification(QuestionIdentificationDto dto); | |||
JsonResult confirm(InspectionFile entity); | |||
JsonResult ignore(InspectionFile entity); | |||
} |
@@ -0,0 +1,11 @@ | |||
package com.tuoheng.miniprogram.service; | |||
import com.tuoheng.common.core.utils.JsonResult; | |||
/** | |||
* @Author ChengWang | |||
* @Date 2022/11/25 | |||
*/ | |||
public interface IQuestionTypeService { | |||
JsonResult getList(); | |||
} |
@@ -2,6 +2,7 @@ package com.tuoheng.miniprogram.service.impl; | |||
import cn.hutool.core.convert.Convert; | |||
import cn.hutool.core.util.ObjectUtil; | |||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; | |||
import com.baomidou.mybatisplus.core.metadata.IPage; | |||
import com.baomidou.mybatisplus.core.toolkit.Wrappers; | |||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; | |||
@@ -19,6 +20,7 @@ import com.tuoheng.miniprogram.entity.Inspection; | |||
import com.tuoheng.miniprogram.entity.InspectionFile; | |||
import com.tuoheng.miniprogram.entity.RoadInformation; | |||
import com.tuoheng.miniprogram.entity.User; | |||
import com.tuoheng.miniprogram.entity.dto.QuestionIdentificationDto; | |||
import com.tuoheng.miniprogram.entity.query.InspectionFileQuery; | |||
import com.tuoheng.miniprogram.service.IInspectionFileService; | |||
import com.tuoheng.miniprogram.vo.InspectionFileInfoVo; | |||
@@ -123,7 +125,7 @@ public class InspectionFileServiceImpl implements IInspectionFileService { | |||
} | |||
/** | |||
* 已忽略问题 | |||
* 已忽略问题 status状态为10 | |||
* @param query | |||
* @return | |||
*/ | |||
@@ -160,6 +162,84 @@ public class InspectionFileServiceImpl implements IInspectionFileService { | |||
} | |||
/** | |||
* 问题标识 | |||
* @param dto | |||
* @return | |||
*/ | |||
@Override | |||
public JsonResult questionIdentification(QuestionIdentificationDto dto) { | |||
if(StringUtils.isEmpty(dto.getId())) return JsonResult.error("问题id不存在"); | |||
//查询任务此问题 | |||
InspectionFile inspectionFile = inspectionFileMapper.selectOne(Wrappers.<InspectionFile>lambdaQuery() | |||
.eq(InspectionFile::getId, dto.getId()) | |||
.eq(InspectionFile::getMark, 1) | |||
.eq(StringUtils.isNotEmpty(dto.getTenantId()), InspectionFile::getTenantId, dto.getTenantId())); | |||
//修改对应的问题类型 | |||
inspectionFile.setQuestionId(dto.getQuestionId()); | |||
int count = inspectionFileMapper.updateById(inspectionFile); | |||
if(count<=0){ | |||
return JsonResult.error(); | |||
} | |||
//设置图片添加域名 | |||
if(StringUtils.isNotEmpty(inspectionFile.getFileThumbnail())){ | |||
inspectionFile.setFileThumbnail(CommonConfig.imageURL+inspectionFile.getFileThumbnail()); | |||
} | |||
if(StringUtils.isNotEmpty(inspectionFile.getFileOriginal())){ | |||
inspectionFile.setFileOriginal(CommonConfig.imageURL+inspectionFile.getFileOriginal()); | |||
} | |||
if(StringUtils.isNotEmpty(inspectionFile.getFileImage())){ | |||
inspectionFile.setFileImage(CommonConfig.imageURL+inspectionFile.getFileImage()); | |||
} | |||
return JsonResult.success(inspectionFile); | |||
} | |||
/** | |||
* 确认问题 | |||
* @param entity | |||
* @return | |||
*/ | |||
@Override | |||
public JsonResult confirm(InspectionFile entity) { | |||
if(StringUtils.isEmpty(entity.getId())) { | |||
return JsonResult.error("问题id为空"); | |||
} | |||
//查询当前问题 | |||
LambdaUpdateWrapper<InspectionFile> qw = new LambdaUpdateWrapper<>(); | |||
qw.eq(InspectionFile::getId,entity.getId()); | |||
qw.eq(InspectionFile::getMark,1); | |||
qw.set(InspectionFile::getStatus,15); | |||
int count = inspectionFileMapper.update(entity, qw); | |||
if(count<=0){ | |||
return JsonResult.error(); | |||
} | |||
return JsonResult.success("确认问题成功"); | |||
} | |||
/** | |||
* 忽略问题 | |||
* @param entity | |||
* @return | |||
*/ | |||
@Override | |||
public JsonResult ignore(InspectionFile entity) { | |||
if(null == entity.getId()) { | |||
return JsonResult.error("问题id为空"); | |||
} | |||
//查询当前问题 | |||
LambdaUpdateWrapper<InspectionFile> qw = new LambdaUpdateWrapper<>(); | |||
qw.eq(InspectionFile::getId,entity.getId()); | |||
qw.eq(InspectionFile::getMark,1); | |||
qw.set(InspectionFile::getStatus,10); | |||
int count = inspectionFileMapper.update(entity, qw); | |||
if(count<=0){ | |||
return JsonResult.error(); | |||
} | |||
return JsonResult.success("忽略问题成功"); | |||
} | |||
private IPage<InspectionFileInfoVo> getInspectionFileInfoVoIPage(Inspection inspection, IPage<InspectionFile> result) { | |||
//数据转换 | |||
return result.convert(t -> { |
@@ -0,0 +1,34 @@ | |||
package com.tuoheng.miniprogram.service.impl; | |||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; | |||
import com.tuoheng.common.core.utils.JsonResult; | |||
import com.tuoheng.miniprogram.dao.QuestionTypeMapper; | |||
import com.tuoheng.miniprogram.entity.QuestionType; | |||
import com.tuoheng.miniprogram.service.IQuestionTypeService; | |||
import lombok.extern.slf4j.Slf4j; | |||
import org.springframework.beans.factory.annotation.Autowired; | |||
import org.springframework.stereotype.Service; | |||
import java.util.List; | |||
/** | |||
* @Author ChengWang | |||
* @Date 2022/11/25 | |||
*/ | |||
@Service | |||
@Slf4j | |||
public class QuestionTypeServiceImpl implements IQuestionTypeService { | |||
@Autowired | |||
private QuestionTypeMapper questionTypeMapper; | |||
/** | |||
* 获取问题类型 | |||
* @return | |||
*/ | |||
@Override | |||
public JsonResult getList(){ | |||
List<QuestionType> questionTypeList = questionTypeMapper.selectList(new LambdaQueryWrapper<QuestionType>() | |||
.eq(QuestionType::getMark, 1)); | |||
return JsonResult.success(questionTypeList); | |||
} | |||
} |
@@ -0,0 +1,7 @@ | |||
<?xml version="1.0" encoding="UTF-8" ?> | |||
<!DOCTYPE mapper | |||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" | |||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd"> | |||
<mapper namespace="com.tuoheng.miniprogram.dao.QuestionTypeMapper"> | |||
</mapper> |