kangwei: 巡检分析功能每个统计的数据都需要增加详情,查看各水厂数据清单 16h
正在显示
8 个修改的文件
包含
518 行增加
和
7 行删除
... | @@ -160,7 +160,18 @@ public class InspectionAnalysisController { | ... | @@ -160,7 +160,18 @@ public class InspectionAnalysisController { |
160 | result.setResult(inspectionTaskIndicatorsVO); | 160 | result.setResult(inspectionTaskIndicatorsVO); |
161 | return result; | 161 | return result; |
162 | } | 162 | } |
163 | 163 | @ApiOperation(value = "巡检分析-巡检任务指标-详情", notes = "巡检分析-巡检任务指标-详情") | |
164 | @GetMapping("/getInspectionTaskIndicatorsDetail") | ||
165 | public Result<List<InspectionEquipIndicatorsDetailVO>> getInspectionTaskIndicatorsDetail(String departId,String startDate,String endDate){ | ||
166 | Result<List<InspectionEquipIndicatorsDetailVO>> result = new Result<>(); | ||
167 | if(StringUtils.isEmpty(departId)){ | ||
168 | departId = BaseContextHandler.getDeparts(); | ||
169 | } | ||
170 | List<InspectionEquipIndicatorsDetailVO> dataList = inspectionAnalysisService.getInspectionTaskIndicatorsDetail( JSUtils.quoteEach(departId,",") ,startDate,endDate); | ||
171 | result.setSuccess(true); | ||
172 | result.setResult(dataList); | ||
173 | return result; | ||
174 | } | ||
164 | /** | 175 | /** |
165 | * <pre> | 176 | * <pre> |
166 | * 巡检分析-巡检任务概况 | 177 | * 巡检分析-巡检任务概况 |
... | @@ -180,6 +191,20 @@ public class InspectionAnalysisController { | ... | @@ -180,6 +191,20 @@ public class InspectionAnalysisController { |
180 | return result; | 191 | return result; |
181 | } | 192 | } |
182 | 193 | ||
194 | |||
195 | @ApiOperation(value = "巡检分析-巡检任务概况-详情", notes = "巡检分析-巡检任务概况-详情") | ||
196 | @GetMapping("/getInspectionTaskOverviewDetail") | ||
197 | public Result<List<InspectionTaskOverviewDetailVO>> getInspectionTaskOverviewDetail(String departId, String startDate, String endDate){ | ||
198 | Result<List<InspectionTaskOverviewDetailVO>> result = new Result<>(); | ||
199 | if(StringUtils.isEmpty(departId)){ | ||
200 | departId = BaseContextHandler.getDeparts(); | ||
201 | } | ||
202 | List<InspectionTaskOverviewDetailVO> dataList = inspectionAnalysisService.getInspectionTaskOverviewDetail(JSUtils.quoteEach(departId,","),startDate,endDate); | ||
203 | result.setSuccess(true); | ||
204 | result.setResult(dataList); | ||
205 | return result; | ||
206 | } | ||
207 | |||
183 | /** | 208 | /** |
184 | * <pre> | 209 | * <pre> |
185 | * 巡检分析-巡检设备指标 | 210 | * 巡检分析-巡检设备指标 |
... | @@ -198,7 +223,18 @@ public class InspectionAnalysisController { | ... | @@ -198,7 +223,18 @@ public class InspectionAnalysisController { |
198 | result.setResult(inspectionEquipIndicatorsVO); | 223 | result.setResult(inspectionEquipIndicatorsVO); |
199 | return result; | 224 | return result; |
200 | } | 225 | } |
201 | 226 | @ApiOperation(value = "巡检分析-巡检设备指标-详情", notes = "巡检分析-巡检设备指标-详情") | |
227 | @GetMapping("/getInspectionEquipIndicatorsDetail") | ||
228 | public Result<List<InspectionEquipIndicatorsDetailVO>> getInspectionEquipIndicators(String departId,String startDate, String endDate){ | ||
229 | Result<List<InspectionEquipIndicatorsDetailVO>> result = new Result<>(); | ||
230 | if(StringUtils.isEmpty(departId)){ | ||
231 | departId = BaseContextHandler.getDeparts(); | ||
232 | } | ||
233 | List<InspectionEquipIndicatorsDetailVO> dataList = inspectionAnalysisService.getInspectionEquipIndicatorsDetail(JSUtils.quoteEach(departId,","),startDate,endDate); | ||
234 | result.setSuccess(true); | ||
235 | result.setResult(dataList); | ||
236 | return result; | ||
237 | } | ||
202 | /** | 238 | /** |
203 | * <pre> | 239 | * <pre> |
204 | * 巡检分析-巡检设备概况 | 240 | * 巡检分析-巡检设备概况 |
... | @@ -217,4 +253,17 @@ public class InspectionAnalysisController { | ... | @@ -217,4 +253,17 @@ public class InspectionAnalysisController { |
217 | result.setResult(inspectionEquipOverviewVO); | 253 | result.setResult(inspectionEquipOverviewVO); |
218 | return result; | 254 | return result; |
219 | } | 255 | } |
256 | |||
257 | @ApiOperation(value = "巡检分析-巡检设备概况-详情", notes = "巡检分析-巡检设备概况-详情") | ||
258 | @GetMapping("/getInspectionEquipOverviewDetail") | ||
259 | public Result<List<InspectionEquipIndicatorsDetailVO>> getInspectionEquipOverviewDetail(String departId,String startDate, String endDate){ | ||
260 | Result<List<InspectionEquipIndicatorsDetailVO>> result = new Result<>(); | ||
261 | if(StringUtils.isEmpty(departId)){ | ||
262 | departId = BaseContextHandler.getDeparts(); | ||
263 | } | ||
264 | List<InspectionEquipIndicatorsDetailVO> dataList = inspectionAnalysisService.getInspectionEquipOverviewDetail(JSUtils.quoteEach(departId,","),startDate,endDate); | ||
265 | result.setSuccess(true); | ||
266 | result.setResult(dataList); | ||
267 | return result; | ||
268 | } | ||
220 | } | 269 | } | ... | ... |
... | @@ -3,6 +3,9 @@ package com.skua.modules.inspection.mapper; | ... | @@ -3,6 +3,9 @@ package com.skua.modules.inspection.mapper; |
3 | import com.baomidou.mybatisplus.core.mapper.BaseMapper; | 3 | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
4 | import com.skua.modules.inspection.entity.InspectionFillChoice; | 4 | import com.skua.modules.inspection.entity.InspectionFillChoice; |
5 | import com.skua.modules.inspection.vo.InspectionAbnormalItemsTrendVO; | 5 | import com.skua.modules.inspection.vo.InspectionAbnormalItemsTrendVO; |
6 | import com.skua.modules.inspection.vo.InspectionEquipIndicatorsDetailVO; | ||
7 | import com.skua.modules.inspection.vo.InspectionEquipIndicatorsVO; | ||
8 | import com.skua.modules.inspection.vo.InspectionTaskOverviewDetailVO; | ||
6 | import org.apache.ibatis.annotations.Param; | 9 | import org.apache.ibatis.annotations.Param; |
7 | 10 | ||
8 | import java.util.List; | 11 | import java.util.List; |
... | @@ -21,5 +24,21 @@ public interface InspectionAnalysisMapper { | ... | @@ -21,5 +24,21 @@ public interface InspectionAnalysisMapper { |
21 | * @return | 24 | * @return |
22 | */ | 25 | */ |
23 | public List<InspectionAbnormalItemsTrendVO> getInspectionAbnormalItemsTrendDetail(@Param("departIds") String departIds,@Param("startDate") String startDate, @Param("endDate") String endDate); | 26 | public List<InspectionAbnormalItemsTrendVO> getInspectionAbnormalItemsTrendDetail(@Param("departIds") String departIds,@Param("startDate") String startDate, @Param("endDate") String endDate); |
27 | /*** | ||
28 | * 巡检分析-巡检设备指标--详情 | ||
29 | * @param startDate | ||
30 | * @param endDate | ||
31 | * @return | ||
32 | */ | ||
33 | public List<InspectionEquipIndicatorsDetailVO> getInspectionEquipIndicatorsDetail(@Param("departIds") String departIds,@Param("startDate") String startDate, @Param("endDate") String endDate); | ||
34 | |||
35 | /*** | ||
36 | * 巡检分析-巡检任务概况 | ||
37 | * @param departIds | ||
38 | * @param startDate | ||
39 | * @param endDate | ||
40 | * @return | ||
41 | */ | ||
42 | List<InspectionTaskOverviewDetailVO> getInspectionTaskOverviewDetail(@Param("departIds") String departIds,@Param("startDate") String startDate, @Param("endDate") String endDate); | ||
24 | } | 43 | } |
25 | 44 | ... | ... |
... | @@ -37,4 +37,180 @@ | ... | @@ -37,4 +37,180 @@ |
37 | order by ddd.total_count desc | 37 | order by ddd.total_count desc |
38 | </select> | 38 | </select> |
39 | 39 | ||
40 | <!-- 巡检分析-巡检设备指标(详情) --> | ||
41 | <select id="getInspectionEquipIndicatorsDetail" resultType="com.skua.modules.inspection.vo.InspectionEquipIndicatorsDetailVO"> | ||
42 | SELECT | ||
43 | d.depart_name , ifnull(aaa.count,0) 'totalInspectionEquipCount', ifnull(bbb.count,0) 'checkedInspectionEquipCount',ifnull(ccc.count ,0)'abnormalInspectionEquipCount' , ifnull(eee.count,0) 'abnormalItemsCount', ifnull(ddd.state,0) 'processedAbnormalItemsCount' | ||
44 | FROM sys_depart d | ||
45 | |||
46 | left join ( | ||
47 | select aa.depart_id ,count(1) 'count' from ( | ||
48 | select t.depart_id ,itpfg.equip_info_id from inspection_task_point_fill_group itpfg , inspection_task t | ||
49 | where itpfg.inspection_task_id = t.id and itpfg.equip_info_id IS NOT NULL AND itpfg.equip_info_id <> '' | ||
50 | AND t.task_state IN ('2','3') | ||
51 | <if test="startDate != null "> | ||
52 | AND DATE_FORMAT(t.inspection_cycle_start_date,'%Y-%m-%d') >= #{startDate} | ||
53 | </if> | ||
54 | <if test="endDate != null "> | ||
55 | AND DATE_FORMAT(t.inspection_cycle_start_date,'%Y-%m-%d') <= #{endDate} | ||
56 | </if> | ||
57 | group by t.depart_id , itpfg.equip_info_id | ||
58 | )aa group by aa.depart_id | ||
59 | )aaa on aaa.depart_id = d.id | ||
60 | |||
61 | left join ( | ||
62 | select bb.depart_id ,count(1) 'count' from ( | ||
63 | select t.depart_id ,itpfg.equip_info_id | ||
64 | from inspection_task_fill_content isfc ,inspection_task_point_fill_group itpfg,inspection_task t | ||
65 | where | ||
66 | isfc.inspection_task_id = itpfg.inspection_task_id and isfc.inspection_point_fill_group_id = itpfg.inspection_point_fill_group_id | ||
67 | and itpfg.inspection_task_id = t.id and isfc.inspection_task_id = t.id | ||
68 | |||
69 | AND t.task_state IN ('2','3') | ||
70 | <if test="startDate != null "> | ||
71 | AND DATE_FORMAT(t.inspection_cycle_start_date,'%Y-%m-%d') >= #{startDate} | ||
72 | </if> | ||
73 | <if test="endDate != null "> | ||
74 | AND DATE_FORMAT(t.inspection_cycle_start_date,'%Y-%m-%d') <= #{endDate} | ||
75 | </if> | ||
76 | and itpfg.equip_info_id IS NOT NULL AND itpfg.equip_info_id <> '' AND isfc.fill_content IS NOT NULL AND isfc.fill_content <> '' | ||
77 | GROUP BY t.depart_id ,itpfg.equip_info_id | ||
78 | )bb group by bb.depart_id | ||
79 | )bbb on bbb.depart_id = d.id | ||
80 | |||
81 | left join ( | ||
82 | select cc.depart_id ,count(1) 'count' from ( | ||
83 | select t.depart_id ,itpfg.equip_info_id | ||
84 | from inspection_task_fill_content isfc ,inspection_task_point_fill_group itpfg,inspection_task t | ||
85 | where | ||
86 | isfc.inspection_task_id = itpfg.inspection_task_id and isfc.inspection_point_fill_group_id = itpfg.inspection_point_fill_group_id | ||
87 | and itpfg.inspection_task_id = t.id and isfc.inspection_task_id = t.id | ||
88 | |||
89 | AND t.task_state IN ('2','3') | ||
90 | <if test="startDate != null "> | ||
91 | AND DATE_FORMAT(t.inspection_cycle_start_date,'%Y-%m-%d') >= #{startDate} | ||
92 | </if> | ||
93 | <if test="endDate != null "> | ||
94 | AND DATE_FORMAT(t.inspection_cycle_start_date,'%Y-%m-%d') <= #{endDate} | ||
95 | </if> | ||
96 | and itpfg.equip_info_id IS NOT NULL AND itpfg.equip_info_id <> '' AND isfc.fill_content IS NOT NULL AND isfc.fill_content <> '' and isfc.choice_state =0 | ||
97 | GROUP BY t.depart_id ,itpfg.equip_info_id | ||
98 | )cc group by cc.depart_id | ||
99 | )ccc on ccc.depart_id = d.id | ||
100 | |||
101 | left join( | ||
102 | select t.depart_id , | ||
103 | sum( IF( (SELECT ACT_ID_ AS EndActivityId FROM ACT_HI_ACTINST WHERE PROC_INST_ID_ = prp.process_instance_id AND END_TIME_ IS NOT NULL ORDER BY END_TIME_ DESC LIMIT 1) IS NULL, 0, 1) ) AS state | ||
104 | from problem_report_plan prp , inspection_task_problem_report itpr , inspection_task t | ||
105 | where prp.id = itpr.problem_report_plan_id and itpr.inspection_task_id = t.id | ||
106 | AND t.task_state IN ('2','3') | ||
107 | <if test="startDate != null "> | ||
108 | AND DATE_FORMAT(t.inspection_cycle_start_date,'%Y-%m-%d') >= #{startDate} | ||
109 | </if> | ||
110 | <if test="endDate != null "> | ||
111 | AND DATE_FORMAT(t.inspection_cycle_start_date,'%Y-%m-%d') <= #{endDate} | ||
112 | </if> | ||
113 | |||
114 | group by t.depart_id | ||
115 | )ddd on ddd.depart_id = d.id | ||
116 | |||
117 | left join ( | ||
118 | select t.depart_id ,ifnull(count(1),0) 'count' from problem_report_plan prp , inspection_task_problem_report itpr , inspection_task t | ||
119 | where prp.id = itpr.problem_report_plan_id and itpr.inspection_task_id = t.id | ||
120 | AND t.task_state IN ('2','3') | ||
121 | <if test="startDate != null "> | ||
122 | AND DATE_FORMAT(t.inspection_cycle_start_date,'%Y-%m-%d') >= #{startDate} | ||
123 | </if> | ||
124 | <if test="endDate != null "> | ||
125 | AND DATE_FORMAT(t.inspection_cycle_start_date,'%Y-%m-%d') <= #{endDate} | ||
126 | </if> | ||
127 | group by t.depart_id | ||
128 | )eee on eee.depart_id = d.id | ||
129 | WHERE | ||
130 | d.depart_type = 1 | ||
131 | <if test="departIds != null "> | ||
132 | and d.id in(${departIds}) | ||
133 | </if> | ||
134 | order by aaa.count desc | ||
135 | </select> | ||
136 | |||
137 | <!-- 巡检分析-巡检任务概况--> | ||
138 | <select id="getInspectionTaskOverviewDetail" resultType="com.skua.modules.inspection.vo.InspectionTaskOverviewDetailVO"> | ||
139 | SELECT | ||
140 | d.depart_name , d.id 'depart_id' ,ifnull(aaa.totalCount,0) 'totalInspectionTaskCount' , ifnull(aaa.count1,0) 'inProgressInspectionTaskCount', ifnull(aaa.count2,0) 'checkedInspectionTaskCount', ifnull(aaa.count3,0) 'notCheckedInspectionTaskCount', | ||
141 | ifnull(ccc.count , 0) 'abnormalInspectionTaskCount', ifnull(eee.count,0) 'abnormalItemsCount', ifnull(ddd.state,0) 'processedAbnormalItemsCount' | ||
142 | FROM sys_depart d | ||
143 | |||
144 | left join ( | ||
145 | select t.depart_id ,count(1) 'totalCount' , | ||
146 | sum(CASE WHEN t.task_state = '1' THEN 1 ELSE 0 END) AS 'count1' , | ||
147 | sum(CASE WHEN t.task_state = '2' THEN 1 ELSE 0 END) AS 'count2', | ||
148 | sum(CASE WHEN t.task_state = '3' THEN 1 ELSE 0 END) AS 'count3' | ||
149 | from inspection_task t | ||
150 | where 1=1 | ||
151 | <if test="startDate != null "> | ||
152 | AND DATE_FORMAT(t.inspection_cycle_start_date,'%Y-%m-%d') >= #{startDate} | ||
153 | </if> | ||
154 | <if test="endDate != null "> | ||
155 | AND DATE_FORMAT(t.inspection_cycle_start_date,'%Y-%m-%d') <= #{endDate} | ||
156 | </if> | ||
157 | group by t.depart_id | ||
158 | )aaa on aaa.depart_id = d.id | ||
159 | |||
160 | |||
161 | left join ( | ||
162 | select cc.depart_id ,count(cc.inspection_task_id) 'count' from ( | ||
163 | SELECT t.depart_id, itfc.inspection_task_id FROM inspection_task_fill_content itfc ,inspection_task t | ||
164 | WHERE inspection_task_id =t.id | ||
165 | and t.task_state IN ('2') | ||
166 | <if test="startDate != null "> | ||
167 | AND DATE_FORMAT(t.inspection_cycle_start_date,'%Y-%m-%d') >= #{startDate} | ||
168 | </if> | ||
169 | <if test="endDate != null "> | ||
170 | AND DATE_FORMAT(t.inspection_cycle_start_date,'%Y-%m-%d') <= #{endDate} | ||
171 | </if> | ||
172 | AND choice_state = '0' | ||
173 | GROUP BY itfc.inspection_task_id ,t.depart_id) cc group by cc.depart_id | ||
174 | )ccc on ccc.depart_id = d.id | ||
175 | |||
176 | left join( | ||
177 | select t.depart_id , | ||
178 | sum( IF( (SELECT ACT_ID_ AS EndActivityId FROM ACT_HI_ACTINST WHERE PROC_INST_ID_ = prp.process_instance_id AND END_TIME_ IS NOT NULL ORDER BY END_TIME_ DESC LIMIT 1) IS NULL, 0, 1) ) AS state | ||
179 | |||
180 | from problem_report_plan prp , inspection_task_problem_report itpr , inspection_task t | ||
181 | where prp.id = itpr.problem_report_plan_id and itpr.inspection_task_id = t.id | ||
182 | and t.task_state IN ('2') | ||
183 | <if test="startDate != null "> | ||
184 | AND DATE_FORMAT(t.inspection_cycle_start_date,'%Y-%m-%d') >= #{startDate} | ||
185 | </if> | ||
186 | <if test="endDate != null "> | ||
187 | AND DATE_FORMAT(t.inspection_cycle_start_date,'%Y-%m-%d') <= #{endDate} | ||
188 | </if> | ||
189 | group by t.depart_id | ||
190 | )ddd on ddd.depart_id = d.id | ||
191 | |||
192 | left join ( | ||
193 | select t.depart_id ,ifnull(count(1),0) 'count' from problem_report_plan prp , inspection_task_problem_report itpr , inspection_task t | ||
194 | where prp.id = itpr.problem_report_plan_id and itpr.inspection_task_id = t.id | ||
195 | and t.task_state IN ('2') | ||
196 | <if test="startDate != null "> | ||
197 | AND DATE_FORMAT(t.inspection_cycle_start_date,'%Y-%m-%d') >= #{startDate} | ||
198 | </if> | ||
199 | <if test="endDate != null "> | ||
200 | AND DATE_FORMAT(t.inspection_cycle_start_date,'%Y-%m-%d') <= #{endDate} | ||
201 | </if> | ||
202 | group by t.depart_id | ||
203 | )eee on eee.depart_id = d.id | ||
204 | |||
205 | WHERE | ||
206 | d.depart_type = 1 | ||
207 | <if test="departIds != null "> | ||
208 | and d.id in(${departIds}) | ||
209 | </if> | ||
210 | order by aaa.totalCount desc | ||
211 | </select> | ||
212 | |||
213 | |||
214 | |||
215 | |||
40 | </mapper> | 216 | </mapper> | ... | ... |
... | @@ -13,9 +13,23 @@ public interface IInspectionAnalysisService { | ... | @@ -13,9 +13,23 @@ public interface IInspectionAnalysisService { |
13 | 13 | ||
14 | List<Map<String, Object>> getDepartInspectionHistoryAnalysis(String moduleType, String startTime, String endTime,String departId)throws Exception; | 14 | List<Map<String, Object>> getDepartInspectionHistoryAnalysis(String moduleType, String startTime, String endTime,String departId)throws Exception; |
15 | 15 | ||
16 | /*** | ||
17 | * 巡检分析-巡检任务指标 | ||
18 | * @param startDate | ||
19 | * @param endDate | ||
20 | * @return | ||
21 | */ | ||
16 | InspectionTaskIndicatorsVO getInspectionTaskIndicators(String startDate, String endDate); | 22 | InspectionTaskIndicatorsVO getInspectionTaskIndicators(String startDate, String endDate); |
17 | 23 | ||
18 | /*** | 24 | /*** |
25 | * 巡检分析-巡检任务指标-详情 | ||
26 | * @param departIds | ||
27 | * @param startDate | ||
28 | * @param endDate | ||
29 | * @return | ||
30 | */ | ||
31 | List<InspectionEquipIndicatorsDetailVO> getInspectionTaskIndicatorsDetail(String departIds, String startDate, String endDate); | ||
32 | /*** | ||
19 | * 巡检分析-巡检设备指标 | 33 | * 巡检分析-巡检设备指标 |
20 | * @param startDate | 34 | * @param startDate |
21 | * @param endDate | 35 | * @param endDate |
... | @@ -23,9 +37,31 @@ public interface IInspectionAnalysisService { | ... | @@ -23,9 +37,31 @@ public interface IInspectionAnalysisService { |
23 | */ | 37 | */ |
24 | InspectionEquipIndicatorsVO getInspectionEquipIndicators(String startDate, String endDate); | 38 | InspectionEquipIndicatorsVO getInspectionEquipIndicators(String startDate, String endDate); |
25 | 39 | ||
40 | /*** | ||
41 | * 巡检分析-巡检设备指标--详情 | ||
42 | * @param startDate | ||
43 | * @param endDate | ||
44 | * @return | ||
45 | */ | ||
46 | List<InspectionEquipIndicatorsDetailVO> getInspectionEquipIndicatorsDetail(String departIds,String startDate, String endDate); | ||
47 | |||
48 | /*** | ||
49 | * 巡检分析-巡检任务概况 | ||
50 | * @param startDate | ||
51 | * @param endDate | ||
52 | * @return | ||
53 | */ | ||
26 | InspectionTaskOverviewVO getInspectionTaskOverview(String startDate, String endDate); | 54 | InspectionTaskOverviewVO getInspectionTaskOverview(String startDate, String endDate); |
27 | 55 | ||
28 | /*** | 56 | /*** |
57 | * 巡检分析-巡检任务概况 | ||
58 | * @param departIds | ||
59 | * @param startDate | ||
60 | * @param endDate | ||
61 | * @return | ||
62 | */ | ||
63 | List<InspectionTaskOverviewDetailVO> getInspectionTaskOverviewDetail(String departIds, String startDate, String endDate); | ||
64 | /*** | ||
29 | * 巡检分析-巡检设备概况 | 65 | * 巡检分析-巡检设备概况 |
30 | * @param startDate | 66 | * @param startDate |
31 | * @param endDate | 67 | * @param endDate |
... | @@ -34,6 +70,15 @@ public interface IInspectionAnalysisService { | ... | @@ -34,6 +70,15 @@ public interface IInspectionAnalysisService { |
34 | InspectionEquipOverviewVO getInspectionEquipOverview(String startDate, String endDate); | 70 | InspectionEquipOverviewVO getInspectionEquipOverview(String startDate, String endDate); |
35 | 71 | ||
36 | /*** | 72 | /*** |
73 | * 巡检分析-巡检设备概况-详情 | ||
74 | * @param departIds | ||
75 | * @param startDate | ||
76 | * @param endDate | ||
77 | * @return | ||
78 | */ | ||
79 | List<InspectionEquipIndicatorsDetailVO> getInspectionEquipOverviewDetail(String departIds, String startDate, String endDate); | ||
80 | |||
81 | /*** | ||
37 | * 巡检分析-巡检任务异常项趋势 | 82 | * 巡检分析-巡检任务异常项趋势 |
38 | * @param startDate | 83 | * @param startDate |
39 | * @param endDate | 84 | * @param endDate |
... | @@ -49,4 +94,7 @@ public interface IInspectionAnalysisService { | ... | @@ -49,4 +94,7 @@ public interface IInspectionAnalysisService { |
49 | * @return | 94 | * @return |
50 | */ | 95 | */ |
51 | List<InspectionAbnormalItemsTrendVO> getInspectionAbnormalItemsTrendDetail(String departIds, String startDate, String endDate); | 96 | List<InspectionAbnormalItemsTrendVO> getInspectionAbnormalItemsTrendDetail(String departIds, String startDate, String endDate); |
97 | |||
98 | |||
99 | |||
52 | } | 100 | } | ... | ... |
... | @@ -353,7 +353,13 @@ public class InspectionAnalysisServiceImpl implements IInspectionAnalysisService | ... | @@ -353,7 +353,13 @@ public class InspectionAnalysisServiceImpl implements IInspectionAnalysisService |
353 | 353 | ||
354 | return resultMap; | 354 | return resultMap; |
355 | } | 355 | } |
356 | 356 | /*** | |
357 | * 巡检分析-巡检任务指标 | ||
358 | * @param departIds | ||
359 | * @param startDate | ||
360 | * @param endDate | ||
361 | * @return | ||
362 | */ | ||
357 | @Override | 363 | @Override |
358 | public InspectionTaskIndicatorsVO getInspectionTaskIndicators(String startDate, String endDate) { | 364 | public InspectionTaskIndicatorsVO getInspectionTaskIndicators(String startDate, String endDate) { |
359 | InspectionTaskIndicatorsVO inspectionTaskIndicatorsVO = new InspectionTaskIndicatorsVO(); | 365 | InspectionTaskIndicatorsVO inspectionTaskIndicatorsVO = new InspectionTaskIndicatorsVO(); |
... | @@ -470,6 +476,18 @@ public class InspectionAnalysisServiceImpl implements IInspectionAnalysisService | ... | @@ -470,6 +476,18 @@ public class InspectionAnalysisServiceImpl implements IInspectionAnalysisService |
470 | return inspectionTaskIndicatorsVO; | 476 | return inspectionTaskIndicatorsVO; |
471 | } | 477 | } |
472 | 478 | ||
479 | |||
480 | |||
481 | /*** | ||
482 | * 巡检分析-巡检任务指标-详情 | ||
483 | * @param departIds | ||
484 | * @param startDate | ||
485 | * @param endDate | ||
486 | * @return | ||
487 | */ | ||
488 | public List<InspectionEquipIndicatorsDetailVO> getInspectionTaskIndicatorsDetail(String departIds, String startDate, String endDate){ | ||
489 | return inspectionAnalysisMapper.getInspectionEquipIndicatorsDetail(departIds, startDate, endDate); | ||
490 | } | ||
473 | /*** | 491 | /*** |
474 | * 巡检分析-巡检设备指标 | 492 | * 巡检分析-巡检设备指标 |
475 | * @param startDate | 493 | * @param startDate |
... | @@ -513,9 +531,9 @@ public class InspectionAnalysisServiceImpl implements IInspectionAnalysisService | ... | @@ -513,9 +531,9 @@ public class InspectionAnalysisServiceImpl implements IInspectionAnalysisService |
513 | int abnormalInspectionEquipCount = 0; | 531 | int abnormalInspectionEquipCount = 0; |
514 | if (inspectionPointFillGroupIdList.size() > 0) { | 532 | if (inspectionPointFillGroupIdList.size() > 0) { |
515 | QueryWrapper<InspectionTaskFillContent> inspectionTaskFillContentQueryWrapper = new QueryWrapper<>(); | 533 | QueryWrapper<InspectionTaskFillContent> inspectionTaskFillContentQueryWrapper = new QueryWrapper<>(); |
516 | inspectionTaskFillContentQueryWrapper.in("isfc.inspection_task_id", inspectionTaskIdList); | 534 | inspectionTaskFillContentQueryWrapper.in("isfc.inspection_task_id", inspectionTaskIdList);//任务id集合 |
517 | inspectionTaskFillContentQueryWrapper.in("isfc.inspection_point_fill_group_id", inspectionPointFillGroupIdList); | 535 | inspectionTaskFillContentQueryWrapper.in("isfc.inspection_point_fill_group_id", inspectionPointFillGroupIdList);//巡检点-填报组ID |
518 | inspectionTaskFillContentQueryWrapper.in("isfc.inspection_fill_group_id",inspectionFillGroupIdList); | 536 | inspectionTaskFillContentQueryWrapper.in("isfc.inspection_fill_group_id",inspectionFillGroupIdList);//填报组ID |
519 | inspectionTaskFillContentQueryWrapper.isNotNull("itpfg.equip_info_id"); | 537 | inspectionTaskFillContentQueryWrapper.isNotNull("itpfg.equip_info_id"); |
520 | inspectionTaskFillContentQueryWrapper.ne("itpfg.equip_info_id", ""); | 538 | inspectionTaskFillContentQueryWrapper.ne("itpfg.equip_info_id", ""); |
521 | inspectionTaskFillContentQueryWrapper.groupBy("itpfg.equip_info_id"); | 539 | inspectionTaskFillContentQueryWrapper.groupBy("itpfg.equip_info_id"); |
... | @@ -594,6 +612,22 @@ public class InspectionAnalysisServiceImpl implements IInspectionAnalysisService | ... | @@ -594,6 +612,22 @@ public class InspectionAnalysisServiceImpl implements IInspectionAnalysisService |
594 | return inspectionEquipIndicatorsVO; | 612 | return inspectionEquipIndicatorsVO; |
595 | } | 613 | } |
596 | 614 | ||
615 | /*** | ||
616 | * 巡检分析-巡检设备指标--详情 | ||
617 | * @param startDate | ||
618 | * @param endDate | ||
619 | * @return | ||
620 | */ | ||
621 | public List<InspectionEquipIndicatorsDetailVO> getInspectionEquipIndicatorsDetail(String departIds, String startDate, String endDate){ | ||
622 | return inspectionAnalysisMapper.getInspectionEquipIndicatorsDetail( departIds, startDate, endDate); | ||
623 | } | ||
624 | |||
625 | /*** | ||
626 | * 巡检分析-巡检任务概况 | ||
627 | * @param startDate | ||
628 | * @param endDate | ||
629 | * @return | ||
630 | */ | ||
597 | @Override | 631 | @Override |
598 | public InspectionTaskOverviewVO getInspectionTaskOverview(String startDate, String endDate) { | 632 | public InspectionTaskOverviewVO getInspectionTaskOverview(String startDate, String endDate) { |
599 | InspectionTaskOverviewVO inspectionTaskOverviewVO = new InspectionTaskOverviewVO(); | 633 | InspectionTaskOverviewVO inspectionTaskOverviewVO = new InspectionTaskOverviewVO(); |
... | @@ -699,6 +733,17 @@ public class InspectionAnalysisServiceImpl implements IInspectionAnalysisService | ... | @@ -699,6 +733,17 @@ public class InspectionAnalysisServiceImpl implements IInspectionAnalysisService |
699 | return inspectionTaskOverviewVO; | 733 | return inspectionTaskOverviewVO; |
700 | } | 734 | } |
701 | 735 | ||
736 | |||
737 | /*** | ||
738 | * 巡检分析-巡检任务概况 | ||
739 | * @param departIds | ||
740 | * @param startDate | ||
741 | * @param endDate | ||
742 | * @return | ||
743 | */ | ||
744 | public List<InspectionTaskOverviewDetailVO> getInspectionTaskOverviewDetail(String departIds, String startDate, String endDate){ | ||
745 | return inspectionAnalysisMapper.getInspectionTaskOverviewDetail(departIds, startDate, endDate); | ||
746 | } | ||
702 | /*** | 747 | /*** |
703 | * 巡检分析-巡检设备概况 | 748 | * 巡检分析-巡检设备概况 |
704 | * @param startDate | 749 | * @param startDate |
... | @@ -812,6 +857,18 @@ public class InspectionAnalysisServiceImpl implements IInspectionAnalysisService | ... | @@ -812,6 +857,18 @@ public class InspectionAnalysisServiceImpl implements IInspectionAnalysisService |
812 | return inspectionEquipOverviewVO; | 857 | return inspectionEquipOverviewVO; |
813 | } | 858 | } |
814 | 859 | ||
860 | |||
861 | /*** | ||
862 | * 巡检分析-巡检设备概况-详情 | ||
863 | * @param departIds | ||
864 | * @param startDate | ||
865 | * @param endDate | ||
866 | * @return | ||
867 | */ | ||
868 | public List<InspectionEquipIndicatorsDetailVO> getInspectionEquipOverviewDetail(String departIds, String startDate, String endDate){ | ||
869 | return inspectionAnalysisMapper.getInspectionEquipIndicatorsDetail( departIds, startDate, endDate); | ||
870 | //return null; | ||
871 | } | ||
815 | @Override | 872 | @Override |
816 | public List<InspectionAbnormalItemsTrendVO> getInspectionAbnormalItemsTrend(String startDate, String endDate) { | 873 | public List<InspectionAbnormalItemsTrendVO> getInspectionAbnormalItemsTrend(String startDate, String endDate) { |
817 | List<InspectionAbnormalItemsTrendVO> inspectionAbnormalItemsTrendVOList = new ArrayList<>(); | 874 | List<InspectionAbnormalItemsTrendVO> inspectionAbnormalItemsTrendVOList = new ArrayList<>(); |
... | @@ -892,7 +949,7 @@ public class InspectionAnalysisServiceImpl implements IInspectionAnalysisService | ... | @@ -892,7 +949,7 @@ public class InspectionAnalysisServiceImpl implements IInspectionAnalysisService |
892 | * @return | 949 | * @return |
893 | */ | 950 | */ |
894 | public List<InspectionAbnormalItemsTrendVO> getInspectionAbnormalItemsTrendDetail(String departIds, String startDate, String endDate){ | 951 | public List<InspectionAbnormalItemsTrendVO> getInspectionAbnormalItemsTrendDetail(String departIds, String startDate, String endDate){ |
895 | return inspectionAnalysisMapper.getInspectionAbnormalItemsTrendDetail( departIds, startDate, endDate); | 952 | return inspectionAnalysisMapper.getInspectionAbnormalItemsTrendDetail( departIds, startDate, endDate); |
896 | } | 953 | } |
897 | public static List<String[]> getCycleList(int cycleNum, String startTime, String endTime) throws ParseException { | 954 | public static List<String[]> getCycleList(int cycleNum, String startTime, String endTime) throws ParseException { |
898 | // System.out.println("统计的时间段为:从" + startTime + "到" + endTime); | 955 | // System.out.println("统计的时间段为:从" + startTime + "到" + endTime); | ... | ... |
1 | package com.skua.modules.inspection.vo; | ||
2 | |||
3 | import com.skua.tool.util.JSUtils; | ||
4 | import io.swagger.annotations.ApiModel; | ||
5 | import io.swagger.annotations.ApiModelProperty; | ||
6 | import lombok.Data; | ||
7 | import lombok.EqualsAndHashCode; | ||
8 | |||
9 | /** | ||
10 | * <pre> | ||
11 | * 巡检设备指标--详情 | ||
12 | * </pre> | ||
13 | * @author Xie Chao | ||
14 | * @version 1.0,4/23/23 4:21 PM | ||
15 | */ | ||
16 | @Data | ||
17 | @EqualsAndHashCode(callSuper = false) | ||
18 | @ApiModel(value="巡检设备指标-详情", description="巡检设备指标-详情") | ||
19 | public class InspectionEquipIndicatorsDetailVO { | ||
20 | @ApiModelProperty(value = "厂站编号") | ||
21 | private String departId; | ||
22 | @ApiModelProperty(value = "厂站名称") | ||
23 | private String departName; | ||
24 | @ApiModelProperty(value = "应检设备数") | ||
25 | private Integer totalInspectionEquipCount; | ||
26 | @ApiModelProperty(value = "已检查数量") | ||
27 | private Integer checkedInspectionEquipCount; | ||
28 | @ApiModelProperty(value = "异常数量") | ||
29 | private Integer abnormalInspectionEquipCount; | ||
30 | |||
31 | @ApiModelProperty(value = "正常设备数") | ||
32 | private Integer normalInspectionEquipCount; | ||
33 | |||
34 | @ApiModelProperty(value = "异常项数量(问题上报)") | ||
35 | private Integer abnormalItemsCount; | ||
36 | @ApiModelProperty(value = "已处理异常项数量(问题上报)") | ||
37 | private Integer processedAbnormalItemsCount; | ||
38 | |||
39 | @ApiModelProperty(value = "未检设备数") | ||
40 | private Integer notCheckedInspectionEquipCount; | ||
41 | |||
42 | @ApiModelProperty(value = "完成率") | ||
43 | private String completionRate; | ||
44 | @ApiModelProperty(value = "未检率") | ||
45 | private String unCompletionRate; | ||
46 | @ApiModelProperty(value = "异常率") | ||
47 | private String abnormalRate; | ||
48 | @ApiModelProperty(value = "异常项处理率") | ||
49 | private String processedAbnormalRate; | ||
50 | |||
51 | public Integer getNormalInspectionEquipCount() { | ||
52 | normalInspectionEquipCount = 0 ; | ||
53 | normalInspectionEquipCount = checkedInspectionEquipCount - abnormalInspectionEquipCount; | ||
54 | return normalInspectionEquipCount; | ||
55 | } | ||
56 | |||
57 | public String getCompletionRate() { | ||
58 | completionRate = "0";//完成率 | ||
59 | if (totalInspectionEquipCount != 0) { | ||
60 | completionRate = JSUtils.divide( checkedInspectionEquipCount*100 ,totalInspectionEquipCount ); | ||
61 | } | ||
62 | return completionRate; | ||
63 | } | ||
64 | |||
65 | public Integer getNotCheckedInspectionEquipCount() { | ||
66 | notCheckedInspectionEquipCount = 0 ; | ||
67 | notCheckedInspectionEquipCount = totalInspectionEquipCount - checkedInspectionEquipCount; | ||
68 | return notCheckedInspectionEquipCount; | ||
69 | } | ||
70 | |||
71 | public String getUnCompletionRate() { | ||
72 | //未检率 | ||
73 | unCompletionRate = "0"; | ||
74 | //未检设备数量 | ||
75 | if (totalInspectionEquipCount != 0) { | ||
76 | unCompletionRate = JSUtils.divide(notCheckedInspectionEquipCount *100, totalInspectionEquipCount ); | ||
77 | } | ||
78 | return unCompletionRate; | ||
79 | } | ||
80 | |||
81 | public String getAbnormalRate() { | ||
82 | //异常率 | ||
83 | abnormalRate = "0"; | ||
84 | if (checkedInspectionEquipCount != 0) { | ||
85 | abnormalRate = JSUtils.divide(abnormalInspectionEquipCount *100, checkedInspectionEquipCount); | ||
86 | } | ||
87 | return abnormalRate; | ||
88 | } | ||
89 | |||
90 | public String getProcessedAbnormalRate() { | ||
91 | //异常项处理率 | ||
92 | processedAbnormalRate = "0"; | ||
93 | if (abnormalItemsCount != 0) { | ||
94 | processedAbnormalRate = JSUtils.divide(processedAbnormalItemsCount *100,abnormalItemsCount ); | ||
95 | } | ||
96 | return processedAbnormalRate; | ||
97 | } | ||
98 | |||
99 | //覆盖率 | ||
100 | |||
101 | |||
102 | |||
103 | |||
104 | } |
... | @@ -16,6 +16,8 @@ import lombok.EqualsAndHashCode; | ... | @@ -16,6 +16,8 @@ import lombok.EqualsAndHashCode; |
16 | @EqualsAndHashCode(callSuper = false) | 16 | @EqualsAndHashCode(callSuper = false) |
17 | @ApiModel(value="巡检任务指标", description="巡检任务指标") | 17 | @ApiModel(value="巡检任务指标", description="巡检任务指标") |
18 | public class InspectionTaskIndicatorsVO { | 18 | public class InspectionTaskIndicatorsVO { |
19 | |||
20 | |||
19 | @ApiModelProperty(value = "完成率") | 21 | @ApiModelProperty(value = "完成率") |
20 | private String completionRate; | 22 | private String completionRate; |
21 | @ApiModelProperty(value = "未检率") | 23 | @ApiModelProperty(value = "未检率") | ... | ... |
1 | package com.skua.modules.inspection.vo; | ||
2 | |||
3 | import com.skua.tool.util.JSUtils; | ||
4 | import io.swagger.annotations.ApiModel; | ||
5 | import io.swagger.annotations.ApiModelProperty; | ||
6 | import lombok.Data; | ||
7 | import lombok.EqualsAndHashCode; | ||
8 | |||
9 | /** | ||
10 | * <pre> | ||
11 | * 巡检任务概况 | ||
12 | * </pre> | ||
13 | * @author Xie Chao | ||
14 | * @version 1.0,4/23/23 4:21 PM | ||
15 | */ | ||
16 | @Data | ||
17 | @EqualsAndHashCode(callSuper = false) | ||
18 | @ApiModel(value="巡检任务概况", description="巡检任务概况") | ||
19 | public class InspectionTaskOverviewDetailVO { | ||
20 | @ApiModelProperty(value = "厂站编号") | ||
21 | private String departId; | ||
22 | @ApiModelProperty(value = "厂站名称") | ||
23 | private String departName; | ||
24 | |||
25 | @ApiModelProperty(value = "异常项数量(问题上报)") | ||
26 | private Integer abnormalItemsCount; | ||
27 | @ApiModelProperty(value = "已处理异常项数量(问题上报)") | ||
28 | private Integer processedAbnormalItemsCount; | ||
29 | |||
30 | |||
31 | @ApiModelProperty(value = "应检任务数") | ||
32 | private Integer totalInspectionTaskCount; | ||
33 | @ApiModelProperty(value = "已检任务数") | ||
34 | private Integer checkedInspectionTaskCount; | ||
35 | @ApiModelProperty(value = "未检任务数") | ||
36 | private Integer notCheckedInspectionTaskCount; | ||
37 | @ApiModelProperty(value = "正常任务数") | ||
38 | private Integer normalInspectionTaskCount; | ||
39 | |||
40 | @ApiModelProperty(value = "异常任务数") | ||
41 | private Integer abnormalInspectionTaskCount; | ||
42 | |||
43 | |||
44 | @ApiModelProperty(value = "异常项处理率") | ||
45 | private String processedAbnormalRate; | ||
46 | |||
47 | |||
48 | public String getProcessedAbnormalRate() { | ||
49 | //异常项处理率 | ||
50 | processedAbnormalRate = "0"; | ||
51 | if (abnormalItemsCount != 0) { | ||
52 | processedAbnormalRate = JSUtils.divide(processedAbnormalItemsCount *100, abnormalItemsCount ); | ||
53 | } | ||
54 | return processedAbnormalRate; | ||
55 | } | ||
56 | } |
-
请 注册 或 登录 后发表评论