巡检记录增加设备筛选
正在显示
7 个修改的文件
包含
80 行增加
和
23 行删除
... | @@ -49,7 +49,6 @@ public class InspectionTaskController { | ... | @@ -49,7 +49,6 @@ public class InspectionTaskController { |
49 | * @param inspectionTaskVO 巡检任务对象 | 49 | * @param inspectionTaskVO 巡检任务对象 |
50 | * @param pageNo 页码 | 50 | * @param pageNo 页码 |
51 | * @param pageSize 每页大小 | 51 | * @param pageSize 每页大小 |
52 | * @param req | ||
53 | * @author Xie Chao,2021-08-11 13:56 | 52 | * @author Xie Chao,2021-08-11 13:56 |
54 | */ | 53 | */ |
55 | @AutoLog(value = "巡检任务-分页列表查询") | 54 | @AutoLog(value = "巡检任务-分页列表查询") |
... | @@ -57,31 +56,36 @@ public class InspectionTaskController { | ... | @@ -57,31 +56,36 @@ public class InspectionTaskController { |
57 | @GetMapping(value = "/list") | 56 | @GetMapping(value = "/list") |
58 | public Result<IPage<InspectionTask>> queryPageList(InspectionTaskVO inspectionTaskVO, | 57 | public Result<IPage<InspectionTask>> queryPageList(InspectionTaskVO inspectionTaskVO, |
59 | @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo, | 58 | @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo, |
60 | @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize, | 59 | @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize) { |
61 | HttpServletRequest req) { | ||
62 | Result<IPage<InspectionTask>> result = new Result<>(); | 60 | Result<IPage<InspectionTask>> result = new Result<>(); |
63 | QueryWrapper<InspectionTask> queryWrapper = new QueryWrapper<>(); | 61 | // QueryWrapper<InspectionTask> queryWrapper = new QueryWrapper<>(); |
62 | // if (StringUtils.isNotBlank(inspectionTaskVO.getStartTime()) | ||
63 | // && StringUtils.isNotBlank(inspectionTaskVO.getEndTime())) { | ||
64 | // queryWrapper.ge("inspection_cycle_start_date", inspectionTaskVO.getStartTime() + " 00:00:00"); | ||
65 | // queryWrapper.le("inspection_cycle_start_date", inspectionTaskVO.getEndTime() + " 23:59:59"); | ||
66 | // } | ||
64 | if (StringUtils.isNotBlank(inspectionTaskVO.getStartTime()) | 67 | if (StringUtils.isNotBlank(inspectionTaskVO.getStartTime()) |
65 | && StringUtils.isNotBlank(inspectionTaskVO.getEndTime())) { | 68 | && StringUtils.isNotBlank(inspectionTaskVO.getEndTime())) { |
66 | queryWrapper.ge("inspection_cycle_start_date", inspectionTaskVO.getStartTime() + " 00:00:00"); | 69 | inspectionTaskVO.setStartTime(inspectionTaskVO.getStartTime() + " 00:00:00"); |
67 | queryWrapper.le("inspection_cycle_start_date", inspectionTaskVO.getEndTime() + " 23:59:59"); | 70 | inspectionTaskVO.setEndTime(inspectionTaskVO.getEndTime() + " 23:59:59"); |
68 | } | ||
69 | if (StringUtils.isNotBlank(inspectionTaskVO.getTaskName())) { | ||
70 | queryWrapper.like("task_name", inspectionTaskVO.getTaskName()); | ||
71 | } | ||
72 | if (StringUtils.isNotBlank(inspectionTaskVO.getTaskState())) { | ||
73 | queryWrapper.eq("task_state", inspectionTaskVO.getTaskState()); | ||
74 | } | ||
75 | if (StringUtils.isNotBlank(inspectionTaskVO.getDepartId())) { | ||
76 | queryWrapper.eq("depart_id", inspectionTaskVO.getDepartId()); | ||
77 | } | ||
78 | queryWrapper.eq("del_flag","1"); | ||
79 | queryWrapper.orderByDesc("task_start_time"); | ||
80 | if (inspectionTaskVO.getGroupName() != null && !"".equals(inspectionTaskVO.getGroupName())) { | ||
81 | queryWrapper.like("inspection_working_group_name", inspectionTaskVO.getInspectionWorkingGroupName()); | ||
82 | } | 71 | } |
72 | // if (StringUtils.isNotBlank(inspectionTaskVO.getTaskName())) { | ||
73 | // queryWrapper.like("task_name", inspectionTaskVO.getTaskName()); | ||
74 | // } | ||
75 | // if (StringUtils.isNotBlank(inspectionTaskVO.getTaskState())) { | ||
76 | // queryWrapper.eq("task_state", inspectionTaskVO.getTaskState()); | ||
77 | // } | ||
78 | // if (StringUtils.isNotBlank(inspectionTaskVO.getDepartId())) { | ||
79 | // queryWrapper.eq("depart_id", inspectionTaskVO.getDepartId()); | ||
80 | // } | ||
81 | // queryWrapper.eq("del_flag","1"); | ||
82 | // queryWrapper.orderByDesc("task_start_time"); | ||
83 | // if (inspectionTaskVO.getGroupName() != null && !"".equals(inspectionTaskVO.getGroupName())) { | ||
84 | // queryWrapper.like("inspection_working_group_name", inspectionTaskVO.getInspectionWorkingGroupName()); | ||
85 | // } | ||
83 | Page<InspectionTask> page = new Page<>(pageNo, pageSize); | 86 | Page<InspectionTask> page = new Page<>(pageNo, pageSize); |
84 | IPage<InspectionTask> pageList = inspectionTaskService.page(page, queryWrapper); | 87 | // IPage<InspectionTask> pageList = inspectionTaskService.page(page, queryWrapper); |
88 | IPage<InspectionTask> pageList = inspectionTaskService.getPage(page, inspectionTaskVO); | ||
85 | result.setSuccess(true); | 89 | result.setSuccess(true); |
86 | result.setResult(pageList); | 90 | result.setResult(pageList); |
87 | return result; | 91 | return result; | ... | ... |
1 | package com.skua.modules.inspection.entity; | 1 | package com.skua.modules.inspection.entity; |
2 | 2 | ||
3 | import com.baomidou.mybatisplus.annotation.IdType; | ||
4 | import com.baomidou.mybatisplus.annotation.TableId; | ||
5 | import com.baomidou.mybatisplus.annotation.TableName; | 3 | import com.baomidou.mybatisplus.annotation.TableName; |
6 | import com.fasterxml.jackson.annotation.JsonFormat; | 4 | import com.fasterxml.jackson.annotation.JsonFormat; |
7 | import com.skua.core.aspect.annotation.Dict; | 5 | import com.skua.core.aspect.annotation.Dict; | ... | ... |
... | @@ -32,4 +32,6 @@ public interface InspectionTaskMapper extends BaseMapper<InspectionTask> { | ... | @@ -32,4 +32,6 @@ public interface InspectionTaskMapper extends BaseMapper<InspectionTask> { |
32 | 32 | ||
33 | @Select("select * from equipment_info ${ew.customSqlSegment}") | 33 | @Select("select * from equipment_info ${ew.customSqlSegment}") |
34 | Map<String, Object> getEquipmentInfo(@Param(Constants.WRAPPER)QueryWrapper queryWrapper); | 34 | Map<String, Object> getEquipmentInfo(@Param(Constants.WRAPPER)QueryWrapper queryWrapper); |
35 | |||
36 | List<InspectionTask> getList(@Param("inspectionTaskVO") InspectionTaskVO inspectionTaskVO); | ||
35 | } | 37 | } | ... | ... |
... | @@ -10,4 +10,40 @@ | ... | @@ -10,4 +10,40 @@ |
10 | and fill_user_id = #{userId} | 10 | and fill_user_id = #{userId} |
11 | group by fill_user_id,inspection_task_id)a | 11 | group by fill_user_id,inspection_task_id)a |
12 | </select> | 12 | </select> |
13 | |||
14 | <select id="getList" parameterType="com.skua.modules.inspection.vo.InspectionTaskVO" resultType="com.skua.modules.inspection.entity.InspectionTask"> | ||
15 | select | ||
16 | * | ||
17 | from inspection_task | ||
18 | where inspection_plan_id in ( | ||
19 | select inspection_plan_id | ||
20 | from inspection_plan_point | ||
21 | where inspection_point_id in ( | ||
22 | select inspection_point_id | ||
23 | from inspection_point_fill_group | ||
24 | <if test="inspectionTaskVO.equipInfoId!=null and inspectionTaskVO.equipInfoId!=''"> | ||
25 | where equip_info_id = #{inspectionTaskVO.equipInfoId} | ||
26 | </if> | ||
27 | )) | ||
28 | and del_flag = 1 | ||
29 | <if test="inspectionTaskVO.startTime !=null and inspectionTaskVO.startTime!=''"> | ||
30 | and inspection_cycle_start_date BETWEEN #{inspectionTaskVO.startTime} and #{inspectionTaskVO.endTime} | ||
31 | </if> | ||
32 | <if test="inspectionTaskVO.taskName!=null and inspectionTaskVO.taskName!=''"> | ||
33 | and task_name like CONCAT('%',#{inspectionTaskVO.taskName},'%') | ||
34 | </if> | ||
35 | <if test="inspectionTaskVO.taskState!=null and inspectionTaskVO.taskState!=''"> | ||
36 | and task_state = #{inspectionTaskVO.taskState} | ||
37 | </if> | ||
38 | <if test="inspectionTaskVO.departId!=null and inspectionTaskVO.departId!=''"> | ||
39 | and depart_id = #{inspectionTaskVO.departId} | ||
40 | </if> | ||
41 | <if test="inspectionTaskVO.groupName!=null and inspectionTaskVO.groupName!=''"> | ||
42 | and inspection_working_group_name like CONCAT('%',#{inspectionTaskVO.groupName},'%') | ||
43 | </if> | ||
44 | <if test="inspectionTaskVO.inspectionWorkingGroupName!=null and inspectionTaskVO.inspectionWorkingGroupName!=''"> | ||
45 | and inspection_working_group_name like CONCAT('%',#{inspectionTaskVO.inspectionWorkingGroupName},'%') | ||
46 | </if> | ||
47 | ORDER BY task_start_time desc | ||
48 | </select> | ||
13 | </mapper> | 49 | </mapper> |
... | \ No newline at end of file | ... | \ No newline at end of file | ... | ... |
... | @@ -2,6 +2,8 @@ package com.skua.modules.inspection.service; | ... | @@ -2,6 +2,8 @@ package com.skua.modules.inspection.service; |
2 | 2 | ||
3 | import com.alibaba.fastjson.JSONObject; | 3 | import com.alibaba.fastjson.JSONObject; |
4 | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; | 4 | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
5 | import com.baomidou.mybatisplus.core.metadata.IPage; | ||
6 | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; | ||
5 | import com.baomidou.mybatisplus.extension.service.IService; | 7 | import com.baomidou.mybatisplus.extension.service.IService; |
6 | import com.skua.modules.inspection.entity.InspectionTask; | 8 | import com.skua.modules.inspection.entity.InspectionTask; |
7 | import com.skua.modules.inspection.vo.InspectionTaskVO; | 9 | import com.skua.modules.inspection.vo.InspectionTaskVO; |
... | @@ -35,4 +37,6 @@ public interface IInspectionTaskService extends IService<InspectionTask> { | ... | @@ -35,4 +37,6 @@ public interface IInspectionTaskService extends IService<InspectionTask> { |
35 | List<Map<String, Object>> getInspectionFill(String pipenetworkTubewellId, String taskId); | 37 | List<Map<String, Object>> getInspectionFill(String pipenetworkTubewellId, String taskId); |
36 | 38 | ||
37 | boolean checkInspectionTriggerEquipQr(String equipmentInfoId, String code); | 39 | boolean checkInspectionTriggerEquipQr(String equipmentInfoId, String code); |
40 | |||
41 | IPage<InspectionTask> getPage(Page<InspectionTask> page, InspectionTaskVO inspectionTaskVO); | ||
38 | } | 42 | } | ... | ... |
... | @@ -2,6 +2,8 @@ package com.skua.modules.inspection.service.impl; | ... | @@ -2,6 +2,8 @@ package com.skua.modules.inspection.service.impl; |
2 | 2 | ||
3 | import com.alibaba.fastjson.JSONObject; | 3 | import com.alibaba.fastjson.JSONObject; |
4 | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; | 4 | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
5 | import com.baomidou.mybatisplus.core.metadata.IPage; | ||
6 | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; | ||
5 | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; | 7 | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
6 | import com.skua.core.util.DateUtils; | 8 | import com.skua.core.util.DateUtils; |
7 | import com.skua.modules.inspection.entity.*; | 9 | import com.skua.modules.inspection.entity.*; |
... | @@ -787,6 +789,14 @@ public class InspectionTaskServiceImpl extends ServiceImpl<InspectionTaskMapper, | ... | @@ -787,6 +789,14 @@ public class InspectionTaskServiceImpl extends ServiceImpl<InspectionTaskMapper, |
787 | return flag; | 789 | return flag; |
788 | } | 790 | } |
789 | 791 | ||
792 | @Override | ||
793 | public IPage<InspectionTask> getPage(Page<InspectionTask> page, InspectionTaskVO inspectionTaskVO) { | ||
794 | List<InspectionTask> list = this.baseMapper.getList(inspectionTaskVO); | ||
795 | page.setRecords(list); | ||
796 | page.setTotal(list.size()); | ||
797 | return page; | ||
798 | } | ||
799 | |||
790 | public List<Map<String, Object>> correctionInspectionTrack(List<Map<String, Object>> pointList) throws Exception { | 800 | public List<Map<String, Object>> correctionInspectionTrack(List<Map<String, Object>> pointList) throws Exception { |
791 | List<Map<String, Object>> resultList; | 801 | List<Map<String, Object>> resultList; |
792 | String url = "http://api.map.baidu.com/rectify/v1/track"; | 802 | String url = "http://api.map.baidu.com/rectify/v1/track"; | ... | ... |
... | @@ -158,4 +158,7 @@ public class InspectionTaskVO { | ... | @@ -158,4 +158,7 @@ public class InspectionTaskVO { |
158 | 158 | ||
159 | /**班组名称*/ | 159 | /**班组名称*/ |
160 | private String groupName; | 160 | private String groupName; |
161 | |||
162 | /**关联设备ID*/ | ||
163 | private String equipInfoId; | ||
161 | } | 164 | } |
... | \ No newline at end of file | ... | \ No newline at end of file | ... | ... |
-
请 注册 或 登录 后发表评论