@@ -2,6 +2,7 @@ package com.tuoheng.admin.controller; | |||
import com.tuoheng.admin.entity.request.QuestionStatusRequest; | |||
import com.tuoheng.admin.entity.request.WorkOrderHandleRequest; | |||
import com.tuoheng.admin.entity.request.WorkOrderQuestionRequest; | |||
import com.tuoheng.admin.entity.request.WorkOrderRequest; | |||
import com.tuoheng.admin.service.IWorkOrderService; | |||
import com.tuoheng.common.utils.JsonResult; | |||
@@ -62,4 +63,16 @@ public class WorkOrderController { | |||
public JsonResult handle(@RequestBody WorkOrderHandleRequest request) { | |||
return workOrderService.handle(request); | |||
} | |||
/** | |||
* 工单问题列表 | |||
* | |||
* @param | |||
* @return | |||
*/ | |||
@GetMapping("/question/page") | |||
public JsonResult questionPage(WorkOrderQuestionRequest request) { | |||
return workOrderService.questionPage(request); | |||
} | |||
} |
@@ -0,0 +1,20 @@ | |||
package com.tuoheng.admin.entity.request; | |||
import com.tuoheng.common.common.BaseQuery; | |||
import lombok.Data; | |||
@Data | |||
public class WorkOrderQuestionRequest extends BaseQuery { | |||
/** | |||
* 问题编码 | |||
*/ | |||
private String questionType; | |||
/** | |||
* 问题状态:0待处理 1已处理 | |||
*/ | |||
private Integer status; | |||
} |
@@ -0,0 +1,54 @@ | |||
package com.tuoheng.admin.entity.vo; | |||
import com.fasterxml.jackson.annotation.JsonFormat; | |||
import lombok.Data; | |||
import org.springframework.format.annotation.DateTimeFormat; | |||
import java.util.Date; | |||
@Data | |||
public class WorkOrderQuestionVO { | |||
/** | |||
* 问题类型名称 | |||
*/ | |||
private String questionName; | |||
/** | |||
* 原图片地址 | |||
*/ | |||
private String fileOriginalUrl; | |||
/** | |||
* 分析后的图片地址 | |||
*/ | |||
private String fileMarkerUrl; | |||
/** | |||
* 经度 | |||
*/ | |||
private String lng; | |||
/** | |||
* 纬度 | |||
*/ | |||
private String lat; | |||
/** | |||
* 处理状态:0待处理 1已处理 | |||
*/ | |||
private Integer status; | |||
/** | |||
* 发现时间 | |||
*/ | |||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") | |||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") | |||
private Date createTime; | |||
/** | |||
* 处理人员 | |||
*/ | |||
private Integer handlerUser; | |||
/** | |||
* 处理人员名称 | |||
*/ | |||
private String handlerUserName; | |||
} |
@@ -1,7 +1,13 @@ | |||
package com.tuoheng.admin.mapper; | |||
import com.baomidou.mybatisplus.core.mapper.BaseMapper; | |||
import com.baomidou.mybatisplus.core.metadata.IPage; | |||
import com.tuoheng.admin.entity.domain.WorkOrder; | |||
import com.tuoheng.admin.entity.request.WorkOrderQuestionRequest; | |||
import com.tuoheng.admin.entity.vo.WorkOrderQuestionVO; | |||
import org.apache.ibatis.annotations.Param; | |||
public interface WorkOrderMapper extends BaseMapper<WorkOrder> { | |||
IPage<WorkOrderQuestionVO> questionPage(@Param("page") IPage page, @Param("request") WorkOrderQuestionRequest request); | |||
} |
@@ -2,6 +2,7 @@ package com.tuoheng.admin.service; | |||
import com.tuoheng.admin.entity.domain.WorkOrder; | |||
import com.tuoheng.admin.entity.request.WorkOrderHandleRequest; | |||
import com.tuoheng.admin.entity.request.WorkOrderQuestionRequest; | |||
import com.tuoheng.admin.entity.request.WorkOrderRequest; | |||
import com.tuoheng.common.common.IBaseService; | |||
import com.tuoheng.common.utils.JsonResult; | |||
@@ -15,4 +16,6 @@ public interface IWorkOrderService extends IBaseService<WorkOrder> { | |||
JsonResult assign(WorkOrderRequest request); | |||
JsonResult handle(WorkOrderHandleRequest request); | |||
JsonResult questionPage(WorkOrderQuestionRequest request); | |||
} |
@@ -6,10 +6,14 @@ import com.baomidou.mybatisplus.core.metadata.IPage; | |||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; | |||
import com.tuoheng.admin.common.ServiceExceptionEnum; | |||
import com.tuoheng.admin.entity.domain.QuestionHandle; | |||
import com.tuoheng.admin.entity.domain.ThInspection; | |||
import com.tuoheng.admin.entity.domain.WorkOrder; | |||
import com.tuoheng.admin.entity.domain.WorkOrderQuestion; | |||
import com.tuoheng.admin.entity.request.WorkOrderHandleRequest; | |||
import com.tuoheng.admin.entity.request.WorkOrderQuestionRequest; | |||
import com.tuoheng.admin.entity.request.WorkOrderRequest; | |||
import com.tuoheng.admin.entity.vo.WorkOrderInfoVO; | |||
import com.tuoheng.admin.entity.vo.WorkOrderQuestionVO; | |||
import com.tuoheng.admin.enums.MarkTypeEnum; | |||
import com.tuoheng.admin.enums.WorkOrderStatusEnum; | |||
import com.tuoheng.admin.mapper.QuestionHandleMapper; | |||
@@ -171,4 +175,16 @@ public class WorkOrderServiceImpl extends BaseServiceImpl<WorkOrderMapper, WorkO | |||
} | |||
return JsonResult.success(); | |||
} | |||
@Override | |||
public JsonResult questionPage(WorkOrderQuestionRequest request) { | |||
// 设置分页参数 | |||
IPage<WorkOrderQuestionVO> page = new Page<>(request.getPage(), request.getLimit()); | |||
// 查询结果 | |||
IPage<WorkOrderQuestionVO> pageInfo = workOrderMapper.questionPage(page, request); | |||
return JsonResult.success(pageInfo); | |||
} | |||
} |
@@ -0,0 +1,29 @@ | |||
<?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.admin.mapper.WorkOrderMapper"> | |||
<select id="questionPage" resultType="com.tuoheng.admin.entity.vo.WorkOrderQuestionVO"> | |||
SELECT | |||
q.question_name AS questionName, | |||
q.file_original_url AS fileOriginalUrl, | |||
q.file_marker_url AS fileMarkerUrl, | |||
q.lng AS lng, | |||
q.lat AS lat, | |||
woq.`status` AS status, | |||
q.create_time AS createTime, | |||
qh.handler_user AS handlerUser, | |||
u.realname AS handlerUserName | |||
FROM th_work_order wo | |||
LEFT JOIN th_work_order_question woq on wo.id = woq.work_order_id | |||
LEFT JOIN th_question q on woq.question_id = q.id | |||
LEFT JOIN th_question_handle qh on q.id = qh.question_id | |||
LEFT JOIN sys_user u on qh.handler_user = u.id | |||
<if test="request.type != '' and request.type != null"> | |||
AND q.type = #{request.type} | |||
</if> | |||
<if test="request.status != null"> | |||
AND woq.`status` = #{request.status} | |||
</if> | |||
</select> | |||
</mapper> |