@@ -5,20 +5,12 @@ | |||
<mapper namespace="com.taauav.admin.mapper.TauvInspectQuestionMapper"> | |||
<select id="selectQuestionList" resultType="com.taauav.admin.vo.TauvInspectQuestionVo"> | |||
select q.*, d.inspect_no as `inspectNo`, f.thumb_img as `imgUrl`, d.driver_area as `driverArea`, t.name as `areaName`, | |||
d.driver_name as `driverName`, d.execution_time as `inspectTime`, o.content as `questionType`, f.location, | |||
f.latitude, f.longitude,a.realname as `createUserName`, b.realname as `assignUserName`, c.realname as `handlerUserName`, | |||
a1.name as `createUserDept`,b1.name as `assignUserDept`,c1.name as `handlerUserDept`, f.original_img as `originUrl` | |||
d.driver_name as `driverName`, d.execution_time as `inspectTime`, o.content as `questionType` | |||
from tauv_inspect_question as q | |||
left join tauv_inspect_driver as d on q.inspect_driver_id = d.id | |||
left join tauv_inspect_file as f on q.inspect_file_id = f.id | |||
left join tauv_question_options as o on f.question_id = o.id | |||
left join sys_city as t on d.driver_area = t.id | |||
left join user_admin as a on q.create_user = a.id | |||
left join sys_city as a1 on a.driver_area = a1.id | |||
left join user_admin as b on q.assign_user = b.id | |||
left join sys_city as b1 on b.driver_area = b1.id | |||
left join user_admin as c on q.handler_user = c.id | |||
left join sys_city as c1 on c.driver_area = c1.id | |||
where q.mark = 1 and d.mark = 1 and f.mark = 1 and o.mark = 1 | |||
<if test="param != null and param.questionNo != null and param.questionNo != ''"> | |||
and q.question_no like concat('%', #{param.questionNo}, '%') |
@@ -16,7 +16,7 @@ import org.springframework.web.bind.annotation.RestController; | |||
* @date 2020-05-20 | |||
*/ | |||
@RestController | |||
@RequestMapping("/front/question") | |||
@RequestMapping("/index/question") | |||
public class IndexQuestionController extends FrontBaseController { | |||
@Autowired | |||
@@ -32,4 +32,14 @@ public class IndexQuestionController extends FrontBaseController { | |||
public Response questionList(IndexQuestionDto indexQuestionDto, BaseQuery query) { | |||
return questionService.selectIndexPage(indexQuestionDto, query); | |||
} | |||
/** | |||
* 获取问题详情 | |||
* @param id | |||
* @return | |||
*/ | |||
@GetMapping("/detail") | |||
public Response getQuestionDetail(Integer id) { | |||
return questionService.getQuestionDetail(id); | |||
} | |||
} |
@@ -78,4 +78,11 @@ public interface UserInspectQuestionMapper extends BaseMapper<UserInspectQuestio | |||
* @return | |||
*/ | |||
IPage<IndexQuestionListVo> selectIndexPageList(IPage page, @Param("param") IndexQuestionDto indexQuestionDto); | |||
/** | |||
* 指挥大屏-问题详情 | |||
* @param id | |||
* @return | |||
*/ | |||
IndexQuestionListVo getQuestionDetail(Integer id); | |||
} |
@@ -86,19 +86,12 @@ | |||
<select id="selectIndexPageList" resultType="com.taauav.front.vo.IndexQuestionListVo"> | |||
select q.*, d.inspect_no as `inspectNo`, f.thumb_img as `imgUrl`, d.driver_area as `driverArea`, t.name as `areaName`, | |||
d.driver_name as `driverName`, d.execution_time as `inspectTime`, o.content as `questionType`, f.location, | |||
f.latitude, f.longitude,a.realname as `createUserName`, b.realname as `assignUserName`, c.realname as `handlerUserName`, | |||
a1.name as `createUserDept`,b1.name as `assignUserDept`,c1.name as `handlerUserDept`, f.original_img as `originUrl` | |||
f.latitude, f.longitude | |||
from tauv_inspect_question as q | |||
left join tauv_inspect_driver as d on q.inspect_driver_id = d.id | |||
left join tauv_inspect_file as f on q.inspect_file_id = f.id | |||
left join tauv_question_options as o on f.question_id = o.id | |||
left join sys_city as t on d.driver_area = t.id | |||
left join user_admin as a on q.create_user = a.id | |||
left join sys_city as a1 on a.driver_area = a1.id | |||
left join user_admin as b on q.assign_user = b.id | |||
left join sys_city as b1 on b.driver_area = b1.id | |||
left join user_admin as c on q.handler_user = c.id | |||
left join sys_city as c1 on c.driver_area = c1.id | |||
where q.mark = 1 and d.mark = 1 and f.mark = 1 and o.mark = 1 | |||
<if test="param != null and param.driverId != null and param.driverId > 0"> | |||
and d.driver_name like concat('%', #{param.driverName}, '%') | |||
@@ -115,4 +108,24 @@ | |||
order by q.id desc | |||
</select> | |||
<!-- 指挥大屏问题详情 --> | |||
<select id="getQuestionDetail" resultType="com.taauav.front.vo.IndexQuestionListVo"> | |||
select q.*, d.inspect_no as `inspectNo`, f.thumb_img as `imgUrl`, d.driver_area as `driverArea`, t.name as `areaName`, | |||
d.driver_name as `driverName`, d.execution_time as `inspectTime`, o.content as `questionType`, f.location, | |||
f.latitude, f.longitude,a.realname as `createUserName`, b.realname as `assignUserName`, c.realname as `handlerUserName`, | |||
a1.name as `createUserDept`,b1.name as `assignUserDept`,c1.name as `handlerUserDept`, f.original_img as `originUrl` | |||
from tauv_inspect_question as q | |||
left join tauv_inspect_driver as d on q.inspect_driver_id = d.id | |||
left join tauv_inspect_file as f on q.inspect_file_id = f.id | |||
left join tauv_question_options as o on f.question_id = o.id | |||
left join user_admin as a on q.create_user = a.id | |||
left join sys_city as a1 on a.driver_area = a1.id | |||
left join user_admin as b on q.assign_user = b.id | |||
left join sys_city as b1 on b.driver_area = b1.id | |||
left join user_admin as c on q.handler_user = c.id | |||
left join sys_city as c1 on c.driver_area = c1.id | |||
left join sys_city as t on d.driver_area = t.id | |||
where q.mark = 1 and d.mark = 1 and f.mark = 1 and o.mark = 1 and t.mark = 1 and q.id = #{id} | |||
</select> | |||
</mapper> |
@@ -66,4 +66,11 @@ public interface IUserInspectQuestionService extends IBaseService<UserInspectQue | |||
* @return | |||
*/ | |||
Response selectIndexPage(IndexQuestionDto indexQuestionDto, BaseQuery query); | |||
/** | |||
* 获取指挥大屏问题详情 | |||
* @param id | |||
* @return | |||
*/ | |||
Response getQuestionDetail(Integer id); | |||
} |
@@ -267,4 +267,29 @@ public class UserInspectQuestionServiceImpl extends BaseServiceImpl<UserInspectQ | |||
} | |||
return response.success(list); | |||
} | |||
/** | |||
* 获取指挥大屏问题详情 | |||
* @param id | |||
* @return | |||
*/ | |||
@Override | |||
public Response getQuestionDetail(Integer id) { | |||
if (id == null || id <= 0) { | |||
return response.failure("问题id不能为空"); | |||
} | |||
IndexQuestionListVo detail = baseMapper.getQuestionDetail(id); | |||
if (detail != null) { | |||
// 状态描述 | |||
detail.setStatusText(FunctionUtils.getArrayText(detail.getStatus().toString(), detail.statusList())); | |||
// 图片路径处理 | |||
if (com.taauav.common.util.StringUtils.isNotEmpty(detail.getImgUrl()) && !detail.getImgUrl().contains("http")) { | |||
detail.setImgUrl(imageUrl + detail.getImgUrl()); | |||
} | |||
if (com.taauav.common.util.StringUtils.isNotEmpty(detail.getOriginUrl()) && !detail.getOriginUrl().contains("http")) { | |||
detail.setOriginUrl(imageUrl + detail.getOriginUrl()); | |||
} | |||
} | |||
return response.success(detail); | |||
} | |||
} |