大屏组件接口修改
正在显示
6 个修改的文件
包含
459 行增加
和
6 行删除
... | @@ -66,6 +66,16 @@ public class FactoryCenterController { | ... | @@ -66,6 +66,16 @@ public class FactoryCenterController { |
66 | return result; | 66 | return result; |
67 | } | 67 | } |
68 | 68 | ||
69 | @ApiOperation(value="厂区驾驶舱耗电量分析", notes="厂区驾驶舱耗电量分析") | ||
70 | @GetMapping(value = "/getDhData") | ||
71 | public Result<Map<String, Object>> getDhData(StatisticsParam statisticsParam) { | ||
72 | Result<Map<String, Object>> result = new Result<Map<String, Object>>(); | ||
73 | Map<String, Object> map = factoryCenterService.getDhData(statisticsParam); | ||
74 | result.setSuccess(true); | ||
75 | result.setResult(map); | ||
76 | return result; | ||
77 | } | ||
78 | |||
69 | //污水处理水量统计 | 79 | //污水处理水量统计 |
70 | @ApiOperation(value="厂区驾驶舱污水处理水量统计", notes="厂区驾驶舱污水处理水量统计") | 80 | @ApiOperation(value="厂区驾驶舱污水处理水量统计", notes="厂区驾驶舱污水处理水量统计") |
71 | @GetMapping(value = "/getWssltj") | 81 | @GetMapping(value = "/getWssltj") |
... | @@ -77,6 +87,26 @@ public class FactoryCenterController { | ... | @@ -77,6 +87,26 @@ public class FactoryCenterController { |
77 | return result; | 87 | return result; |
78 | } | 88 | } |
79 | 89 | ||
90 | @ApiOperation(value="厂区驾驶舱处理水量分析", notes="厂区驾驶舱处理水量分析") | ||
91 | @GetMapping(value = "/getSlData") | ||
92 | public Result<Map<String, Object>> getSlData(StatisticsParam statisticsParam) { | ||
93 | Result<Map<String, Object>> result = new Result<Map<String, Object>>(); | ||
94 | Map<String, Object> map = factoryCenterService.getSlData(statisticsParam); | ||
95 | result.setSuccess(true); | ||
96 | result.setResult(map); | ||
97 | return result; | ||
98 | } | ||
99 | |||
100 | @ApiOperation(value="厂区驾驶舱污水电耗统计", notes="厂区驾驶舱污水电耗统计") | ||
101 | @GetMapping(value = "/getWsDhTj") | ||
102 | public Result<Map<String, Object>> getWsDhTj(StatisticsParam statisticsParam) { | ||
103 | Result<Map<String, Object>> result = new Result<Map<String, Object>>(); | ||
104 | Map<String, Object> map = factoryCenterService.getWsDhTj(statisticsParam); | ||
105 | result.setSuccess(true); | ||
106 | result.setResult(map); | ||
107 | return result; | ||
108 | } | ||
109 | |||
80 | //厂区驾驶舱药耗统计 | 110 | //厂区驾驶舱药耗统计 |
81 | @ApiOperation(value="厂区驾驶舱药耗统计", notes="厂区驾驶舱药耗统计") | 111 | @ApiOperation(value="厂区驾驶舱药耗统计", notes="厂区驾驶舱药耗统计") |
82 | @GetMapping(value = "/getYhtj") | 112 | @GetMapping(value = "/getYhtj") |
... | @@ -88,6 +118,17 @@ public class FactoryCenterController { | ... | @@ -88,6 +118,17 @@ public class FactoryCenterController { |
88 | return result; | 118 | return result; |
89 | } | 119 | } |
90 | 120 | ||
121 | //厂区驾驶舱药耗分析 | ||
122 | @ApiOperation(value="厂区驾驶舱药耗分析", notes="厂区驾驶舱药耗分析") | ||
123 | @GetMapping(value = "/getYhData") | ||
124 | public Result<Map<String, Object>> getYhData(StatisticsParam statisticsParam) { | ||
125 | Result<Map<String, Object>> result = new Result<Map<String, Object>>(); | ||
126 | Map<String, Object> map = factoryCenterService.getYhData(statisticsParam); | ||
127 | result.setSuccess(true); | ||
128 | result.setResult(map); | ||
129 | return result; | ||
130 | } | ||
131 | |||
91 | //厂区削减量统计 | 132 | //厂区削减量统计 |
92 | @ApiOperation(value="厂区削减量统计", notes="厂区削减量统计") | 133 | @ApiOperation(value="厂区削减量统计", notes="厂区削减量统计") |
93 | @GetMapping(value = "/getXjltj") | 134 | @GetMapping(value = "/getXjltj") | ... | ... |
... | @@ -36,4 +36,19 @@ public interface FactoryCenterMapper { | ... | @@ -36,4 +36,19 @@ public interface FactoryCenterMapper { |
36 | @Param("departId") String departId, @Param("view2119") String view2119); | 36 | @Param("departId") String departId, @Param("view2119") String view2119); |
37 | 37 | ||
38 | List<Map<String, Object>> getEquiptj(@Param("departId") String departId); | 38 | List<Map<String, Object>> getEquiptj(@Param("departId") String departId); |
39 | |||
40 | Map<String, Object> getYhData(@Param("startDate") String startDate, @Param("endDate") String endDate, | ||
41 | @Param("departId") String departId, | ||
42 | @Param("dataView3a24") String dataView3a24, @Param("dataView2119") String dataView2119); | ||
43 | |||
44 | Map<String, Object> getDhData(@Param("startDate") String startDate, @Param("endDate") String endDate, | ||
45 | @Param("departId") String departId, | ||
46 | @Param("dataView3a24") String dataView3a24, @Param("dataView2119") String dataView2119); | ||
47 | |||
48 | Map<String, Object> getSlData(@Param("startDate") String startDate, @Param("endDate") String endDate, | ||
49 | @Param("departId") String departId, @Param("dataView2119") String dataView2119); | ||
50 | |||
51 | List<Map<String, Object>> getDsdhListGroupByDepart(@Param("startDate") String startDate, @Param("endDate") String endDate, | ||
52 | @Param("departId") String departId, | ||
53 | @Param("dataView3a24") String dataView3a24, @Param("dataView2119") String dataView2119); | ||
39 | } | 54 | } | ... | ... |
... | @@ -6,13 +6,16 @@ | ... | @@ -6,13 +6,16 @@ |
6 | SELECT | 6 | SELECT |
7 | LEFT ( v.time, 7 ) AS time, | 7 | LEFT ( v.time, 7 ) AS time, |
8 | round( sum( v.CSL ) / 10000, 2 ) AS clsl, | 8 | round( sum( v.CSL ) / 10000, 2 ) AS clsl, |
9 | ifnull(v2.clsl,0) as clsl_tb | 9 | ifnull(v2.clsl,0) as clsl_tb, |
10 | round( sum( v.JSL ) / 10000, 2 ) AS jsl, | ||
11 | ifnull(v2.jsl,0) as jsl_tb | ||
10 | FROM | 12 | FROM |
11 | ${view2119} v | 13 | ${view2119} v |
12 | left join ( | 14 | left join ( |
13 | SELECT | 15 | SELECT |
14 | RIGHT( LEFT ( v2119.time, 7 ), 2 ) AS time, | 16 | RIGHT( LEFT ( v2119.time, 7 ), 2 ) AS time, |
15 | round( sum( v2119.CSL ) / 10000, 2 ) AS clsl | 17 | round( sum( v2119.CSL ) / 10000, 2 ) AS clsl, |
18 | round( sum( v2119.JSL ) / 10000, 2 ) AS jsl | ||
16 | FROM | 19 | FROM |
17 | ${view2119tb} v2119 | 20 | ${view2119tb} v2119 |
18 | WHERE | 21 | WHERE |
... | @@ -293,4 +296,110 @@ | ... | @@ -293,4 +296,110 @@ |
293 | </foreach> | 296 | </foreach> |
294 | </if> | 297 | </if> |
295 | </select> | 298 | </select> |
299 | |||
300 | <select id="getYhData" resultType="java.util.HashMap"> | ||
301 | select | ||
302 | v3.zyh,v3.rjyh,ROUND(v3.zyh/v2.clsl,2) AS dsyh | ||
303 | from (select ROUND(SUM(v.CSL),2) as clsl,'yh' as type from ${dataView2119} v | ||
304 | where time >= #{startDate} and time <= #{endDate} | ||
305 | <if test="departId!=null and departId!=''"> | ||
306 | AND v.depart_id in | ||
307 | <foreach item="item" index="index" collection="departId.split(',')" open="(" separator="," close=")"> | ||
308 | '${item}' | ||
309 | </foreach> | ||
310 | </if>) v2 | ||
311 | left join (select ROUND(SUM(IFNULL(v.PAMRJ,0)+IFNULL(v.SCLPAMZ,0)+IFNULL(v.SCLPAMF,0)+IFNULL(v.NACLO,0)+IFNULL(v.PACGT,0)+IFNULL(v.PACYT,0)+ | ||
312 | IFNULL(v.PFS,0)+IFNULL(v.FHTY,0)+IFNULL(v.RYXNJ,0)+IFNULL(v.YWL,0)+IFNULL(v.GXCLJ,0)+IFNULL(v.CH3COONA,0)+IFNULL(v.HXT,0)+IFNULL(v.FECL3,0)+ | ||
313 | IFNULL(v.SH,0)+IFNULL(v.CH3COOH,0)+IFNULL(v.FESO4G,0)+IFNULL(v.FESO4Y,0)+IFNULL(v.H2O2,0)),2) AS zyh,ROUND(AVG(IFNULL(v.PAMRJ,0)+ | ||
314 | IFNULL(v.SCLPAMZ,0)+IFNULL(v.SCLPAMF,0)+IFNULL(v.NACLO,0)+IFNULL(v.PACGT,0)+IFNULL(v.PACYT,0)+IFNULL(v.PFS,0)+IFNULL(v.FHTY,0)+ | ||
315 | IFNULL(v.RYXNJ,0)+IFNULL(v.YWL,0)+IFNULL(v.GXCLJ,0)+IFNULL(v.CH3COONA,0)+IFNULL(v.HXT,0)+IFNULL(v.FECL3,0)+IFNULL(v.SH,0)+IFNULL(v.CH3COOH,0)+ | ||
316 | IFNULL(v.FESO4G,0)+IFNULL(v.FESO4Y,0)+IFNULL(v.H2O2,0)),2) AS rjyh,'yh' as type from ${dataView3a24} v | ||
317 | where v.time >= #{startDate} and v.time <= #{endDate} | ||
318 | <if test="departId!=null and departId!=''"> | ||
319 | AND v.depart_id in | ||
320 | <foreach item="item" index="index" collection="departId.split(',')" open="(" separator="," close=")"> | ||
321 | '${item}' | ||
322 | </foreach> | ||
323 | </if>) v3 ON v2.type = v3.type | ||
324 | </select> | ||
325 | |||
326 | <select id="getDhData" resultType="java.util.HashMap"> | ||
327 | select | ||
328 | v3.zdh,v3.rjdh,ROUND(v3.zdh/v2.clsl,2) AS dsdh | ||
329 | from (select ROUND(SUM(v.CSL),2) as clsl,'dh' as type from ${dataView2119} v | ||
330 | where time >= #{startDate} and time <= #{endDate} | ||
331 | <if test="departId!=null and departId!=''"> | ||
332 | AND v.depart_id in | ||
333 | <foreach item="item" index="index" collection="departId.split(',')" open="(" separator="," close=")"> | ||
334 | '${item}' | ||
335 | </foreach> | ||
336 | </if>) v2 | ||
337 | left join (select ROUND(SUM(IFNULL(v.DLHJ,0)),2) AS zdh, | ||
338 | ROUND(AVG(IFNULL(v.DLHJ,0)),2) AS rjdh,'dh' as type from ${dataView3a24} v | ||
339 | where v.time >= #{startDate} and v.time <= #{endDate} | ||
340 | <if test="departId!=null and departId!=''"> | ||
341 | AND v.depart_id in | ||
342 | <foreach item="item" index="index" collection="departId.split(',')" open="(" separator="," close=")"> | ||
343 | '${item}' | ||
344 | </foreach> | ||
345 | </if>) v3 ON v2.type = v3.type | ||
346 | </select> | ||
347 | |||
348 | <select id="getSlData" resultType="java.util.HashMap"> | ||
349 | select | ||
350 | f.sjgm, | ||
351 | v2.clsl, | ||
352 | v2.rjclsl | ||
353 | from (select ROUND(SUM(pro_scale),2) AS sjgm,'sl' AS type from sys_factory_info | ||
354 | <if test="departId!=null and departId!=''"> | ||
355 | WHERE depart_id in | ||
356 | <foreach item="item" index="index" collection="departId.split(',')" open="(" separator="," close=")"> | ||
357 | '${item}' | ||
358 | </foreach> | ||
359 | </if> | ||
360 | ) f | ||
361 | left join ( | ||
362 | select | ||
363 | ROUND(SUM(v.CSL)/10000,2) as clsl, | ||
364 | ROUND(AVG(v.CSL)/10000,2) as rjclsl, | ||
365 | 'sl' AS type | ||
366 | from ${dataView2119} v | ||
367 | where v.time >= #{startDate} and v.time <= #{endDate} | ||
368 | <if test="departId!=null and departId!=''"> | ||
369 | AND v.depart_id in | ||
370 | <foreach item="item" index="index" collection="departId.split(',')" open="(" separator="," close=")"> | ||
371 | '${item}' | ||
372 | </foreach> | ||
373 | </if> | ||
374 | ) v2 ON f.type = v2.type | ||
375 | </select> | ||
376 | <select id="getDsdhListGroupByDepart" resultType="java.util.HashMap"> | ||
377 | select | ||
378 | d.id AS depart_id, | ||
379 | IFNULL(ROUND(IFNULL(v3.dlhj,0)/IFNULL(v2.clsl,2),2),0) AS dsdh | ||
380 | from sys_depart d | ||
381 | left join ( | ||
382 | select SUM(v.DLHJ) AS dlhj,v.depart_id from ${dataView3a24} v | ||
383 | where v.time >= #{startDate} and v.time <= #{endDate} | ||
384 | <if test="departId!=null and departId!=''"> | ||
385 | AND v.depart_id in | ||
386 | <foreach item="item" index="index" collection="departId.split(',')" open="(" separator="," close=")"> | ||
387 | '${item}' | ||
388 | </foreach> | ||
389 | </if> | ||
390 | GROUP BY v.depart_id | ||
391 | ) v3 on d.id = v3.depart_id | ||
392 | left join ( | ||
393 | select SUM(v.CSL) AS clsl,v.depart_id from ${dataView2119} v | ||
394 | where v.time >= #{startDate} and v.time <= #{endDate} | ||
395 | <if test="departId!=null and departId!=''"> | ||
396 | AND v.depart_id in | ||
397 | <foreach item="item" index="index" collection="departId.split(',')" open="(" separator="," close=")"> | ||
398 | '${item}' | ||
399 | </foreach> | ||
400 | </if> | ||
401 | GROUP BY v.depart_id | ||
402 | ) v2 on d.id = v2.depart_id | ||
403 | where depart_type = '1' | ||
404 | </select> | ||
296 | </mapper> | 405 | </mapper> | ... | ... |
... | @@ -32,5 +32,13 @@ public interface IFactoryCenterService { | ... | @@ -32,5 +32,13 @@ public interface IFactoryCenterService { |
32 | List<Map<String, Object>> getSzXjltj(StatisticsParam statisticsParam); | 32 | List<Map<String, Object>> getSzXjltj(StatisticsParam statisticsParam); |
33 | 33 | ||
34 | List<Map<String, Object>> getEquiptj(StatisticsParam statisticsParam); | 34 | List<Map<String, Object>> getEquiptj(StatisticsParam statisticsParam); |
35 | |||
36 | Map<String, Object> getYhData(StatisticsParam statisticsParam); | ||
37 | |||
38 | Map<String, Object> getDhData(StatisticsParam statisticsParam); | ||
39 | |||
40 | Map<String, Object> getSlData(StatisticsParam statisticsParam); | ||
41 | |||
42 | Map<String, Object> getWsDhTj(StatisticsParam statisticsParam); | ||
35 | } | 43 | } |
36 | 44 | ... | ... |
... | @@ -22,6 +22,7 @@ import org.springframework.stereotype.Service; | ... | @@ -22,6 +22,7 @@ import org.springframework.stereotype.Service; |
22 | import org.springframework.util.CollectionUtils; | 22 | import org.springframework.util.CollectionUtils; |
23 | 23 | ||
24 | import javax.annotation.Resource; | 24 | import javax.annotation.Resource; |
25 | import java.text.DecimalFormat; | ||
25 | import java.text.SimpleDateFormat; | 26 | import java.text.SimpleDateFormat; |
26 | import java.time.LocalDate; | 27 | import java.time.LocalDate; |
27 | import java.time.YearMonth; | 28 | import java.time.YearMonth; |
... | @@ -41,6 +42,8 @@ public class FactoryCenterServiceImpl implements IFactoryCenterService { | ... | @@ -41,6 +42,8 @@ public class FactoryCenterServiceImpl implements IFactoryCenterService { |
41 | @Autowired | 42 | @Autowired |
42 | private ISysMonitorMetricInfoService sysMonitorMetricInfoService; | 43 | private ISysMonitorMetricInfoService sysMonitorMetricInfoService; |
43 | 44 | ||
45 | private static DecimalFormat df = new DecimalFormat("#.##"); | ||
46 | |||
44 | @Override | 47 | @Override |
45 | public List<WaterQualityMonitoringDetailVO> queryMonitoringData(String departId) { | 48 | public List<WaterQualityMonitoringDetailVO> queryMonitoringData(String departId) { |
46 | List<WaterQualityMonitoringDetailVO> list = new ArrayList<>(); | 49 | List<WaterQualityMonitoringDetailVO> list = new ArrayList<>(); |
... | @@ -404,8 +407,8 @@ public class FactoryCenterServiceImpl implements IFactoryCenterService { | ... | @@ -404,8 +407,8 @@ public class FactoryCenterServiceImpl implements IFactoryCenterService { |
404 | String endDate = statisticsParam.getEndDate(); | 407 | String endDate = statisticsParam.getEndDate(); |
405 | String startDateTb = DateUtils.getTbDate(startDate); | 408 | String startDateTb = DateUtils.getTbDate(startDate); |
406 | String endDateTb = DateUtils.getTbDate(endDate); | 409 | String endDateTb = DateUtils.getTbDate(endDate); |
407 | String dataView2119 = ReportViewUtil.buildView(ReportConstant.view2119, "CSL", statisticsParam.getDepartId(), startDate,endDate); | 410 | String dataView2119 = ReportViewUtil.buildView(ReportConstant.view2119, "JSL,CSL", statisticsParam.getDepartId(), startDate,endDate); |
408 | String dataView2119tb = ReportViewUtil.buildView(ReportConstant.view2119, "CSL", statisticsParam.getDepartId(), startDateTb,endDateTb); | 411 | String dataView2119tb = ReportViewUtil.buildView(ReportConstant.view2119, "JSL,CSL", statisticsParam.getDepartId(), startDateTb,endDateTb); |
409 | list = factoryCenterMapper.getWssltj(startDate,endDate,startDateTb,endDateTb,statisticsParam.getDepartId(),dataView2119,dataView2119tb); | 412 | list = factoryCenterMapper.getWssltj(startDate,endDate,startDateTb,endDateTb,statisticsParam.getDepartId(),dataView2119,dataView2119tb); |
410 | if(list.size() == 0){ | 413 | if(list.size() == 0){ |
411 | List<String> monthList = getMonthsBetween(startDate,endDate); | 414 | List<String> monthList = getMonthsBetween(startDate,endDate); |
... | @@ -414,6 +417,8 @@ public class FactoryCenterServiceImpl implements IFactoryCenterService { | ... | @@ -414,6 +417,8 @@ public class FactoryCenterServiceImpl implements IFactoryCenterService { |
414 | map.put("time",month); | 417 | map.put("time",month); |
415 | map.put("clsl","0"); | 418 | map.put("clsl","0"); |
416 | map.put("clsl_tb","0"); | 419 | map.put("clsl_tb","0"); |
420 | map.put("jsl","0"); | ||
421 | map.put("jsl_tb","0"); | ||
417 | list.add(map); | 422 | list.add(map); |
418 | } | 423 | } |
419 | } | 424 | } |
... | @@ -642,6 +647,197 @@ public class FactoryCenterServiceImpl implements IFactoryCenterService { | ... | @@ -642,6 +647,197 @@ public class FactoryCenterServiceImpl implements IFactoryCenterService { |
642 | return list; | 647 | return list; |
643 | } | 648 | } |
644 | 649 | ||
650 | @Override | ||
651 | public Map<String, Object> getYhData(StatisticsParam statisticsParam) { | ||
652 | Map<String, Object> resMap = new HashMap<>(); | ||
653 | double zyh = 0.00;double zyhTb = 0.00;double zyhHb = 0.00; | ||
654 | double rjyh = 0.00;double rjyhTb = 0.00;double rjyhHb = 0.00; | ||
655 | double dsyh = 0.00;double dsyhTb = 0.00;double dsyhHb = 0.00; | ||
656 | String startDate = statisticsParam.getStartDate(); | ||
657 | String endDate = statisticsParam.getEndDate(); | ||
658 | String startDateTb = DateUtils.getTbDate(startDate); | ||
659 | String endDateTb = DateUtils.getTbDate(endDate); | ||
660 | String startDateHb = DateUtils.getHbDate(startDate); | ||
661 | String endDateHb = DateUtils.getHbDate(endDate); | ||
662 | String yjField = "PAMRJ,SCLPAMZ,SCLPAMF,NACLO,PACGT,PACYT,PFS,FHTY,RYXNJ,YWL,GXCLJ,CH3COONA,HXT,FECL3,SH,CH3COOH,FESO4G,FESO4Y,H2O2"; | ||
663 | String dataView3a24 = ReportViewUtil.buildView(ReportConstant.view3a24, yjField, statisticsParam.getDepartId(), startDate,endDate); | ||
664 | String dataView2119 = ReportViewUtil.buildView(ReportConstant.view2119, "CSL", statisticsParam.getDepartId(), startDate, endDate); | ||
665 | String dataView3a24tb = ReportViewUtil.buildView(ReportConstant.view3a24, yjField, statisticsParam.getDepartId(), startDateTb,endDateTb); | ||
666 | String dataView2119tb = ReportViewUtil.buildView(ReportConstant.view2119, "CSL", statisticsParam.getDepartId(), startDateTb, endDateTb); | ||
667 | String dataView3a24hb = ReportViewUtil.buildView(ReportConstant.view3a24, yjField, statisticsParam.getDepartId(), startDateHb,endDateHb); | ||
668 | String dataView2119hb = ReportViewUtil.buildView(ReportConstant.view2119, "CSL", statisticsParam.getDepartId(), startDateHb, endDateHb); | ||
669 | Map<String, Object> map = factoryCenterMapper.getYhData(startDate, endDate, statisticsParam.getDepartId(), dataView3a24, dataView2119); | ||
670 | if(map!=null){ | ||
671 | zyh = Double.parseDouble(map.get("zyh").toString()); | ||
672 | rjyh = Double.parseDouble(map.get("rjyh").toString()); | ||
673 | dsyh = Double.parseDouble(map.get("dsyh").toString()); | ||
674 | } | ||
675 | resMap.put("zyh", zyh); | ||
676 | resMap.put("rjyh", rjyh); | ||
677 | resMap.put("dsyh", dsyh); | ||
678 | Map<String, Object> maptb = factoryCenterMapper.getYhData(startDateTb, endDateTb, statisticsParam.getDepartId(), dataView3a24tb, dataView2119tb); | ||
679 | if(maptb!=null){ | ||
680 | zyhTb = Double.parseDouble(maptb.get("zyh").toString()); | ||
681 | rjyhTb = Double.parseDouble(maptb.get("rjyh").toString()); | ||
682 | dsyhTb = Double.parseDouble(maptb.get("dsyh").toString()); | ||
683 | zyhTb = Double.parseDouble(df.format(100*(zyh - zyhTb)/zyhTb)); | ||
684 | rjyhTb = Double.parseDouble(df.format(100*(rjyh - rjyhTb)/rjyhTb)); | ||
685 | dsyhTb = Double.parseDouble(df.format(100*(dsyh - dsyhTb)/dsyhTb)); | ||
686 | } | ||
687 | resMap.put("zyh_tb", zyhTb); | ||
688 | resMap.put("rjyh_tb", rjyhTb); | ||
689 | resMap.put("dsyh_tb", dsyhTb); | ||
690 | Map<String, Object> maphb = factoryCenterMapper.getYhData(startDateHb, endDateHb, statisticsParam.getDepartId(), dataView3a24hb, dataView2119hb); | ||
691 | if(maphb!=null){ | ||
692 | zyhHb = Double.parseDouble(maphb.get("zyh").toString()); | ||
693 | rjyhHb = Double.parseDouble(maphb.get("rjyh").toString()); | ||
694 | dsyhHb = Double.parseDouble(maphb.get("dsyh").toString()); | ||
695 | zyhHb = Double.parseDouble(df.format(100*(zyh - zyhHb)/zyhHb)); | ||
696 | rjyhHb = Double.parseDouble(df.format(100*(rjyh - rjyhHb)/rjyhHb)); | ||
697 | dsyhHb = Double.parseDouble(df.format(100*(dsyh - dsyhHb)/dsyhHb)); | ||
698 | } | ||
699 | resMap.put("zyh_hb", zyhHb); | ||
700 | resMap.put("rjyh_hb", rjyhHb); | ||
701 | resMap.put("dsyh_hb", dsyhHb); | ||
702 | return resMap; | ||
703 | } | ||
704 | |||
705 | @Override | ||
706 | public Map<String, Object> getDhData(StatisticsParam statisticsParam) { | ||
707 | Map<String, Object> resMap = new HashMap<>(); | ||
708 | double zdh = 0.00;double zdhTb = 0.00;double zdhHb = 0.00; | ||
709 | double rjdh = 0.00;double rjdhTb = 0.00;double rjdhHb = 0.00; | ||
710 | double dsdh = 0.00;double dsdhTb = 0.00;double dsdhHb = 0.00; | ||
711 | String startDate = statisticsParam.getStartDate(); | ||
712 | String endDate = statisticsParam.getEndDate(); | ||
713 | String startDateTb = DateUtils.getTbDate(startDate); | ||
714 | String endDateTb = DateUtils.getTbDate(endDate); | ||
715 | String startDateHb = DateUtils.getHbDate(startDate); | ||
716 | String endDateHb = DateUtils.getHbDate(endDate); | ||
717 | String dataView3a24 = ReportViewUtil.buildView(ReportConstant.view3a24, "DLHJ", statisticsParam.getDepartId(), startDate,endDate); | ||
718 | String dataView2119 = ReportViewUtil.buildView(ReportConstant.view2119, "CSL", statisticsParam.getDepartId(), startDate, endDate); | ||
719 | String dataView3a24tb = ReportViewUtil.buildView(ReportConstant.view3a24, "DLHJ", statisticsParam.getDepartId(), startDateTb,endDateTb); | ||
720 | String dataView2119tb = ReportViewUtil.buildView(ReportConstant.view2119, "CSL", statisticsParam.getDepartId(), startDateTb, endDateTb); | ||
721 | String dataView3a24hb = ReportViewUtil.buildView(ReportConstant.view3a24, "DLHJ", statisticsParam.getDepartId(), startDateHb,endDateHb); | ||
722 | String dataView2119hb = ReportViewUtil.buildView(ReportConstant.view2119, "CSL", statisticsParam.getDepartId(), startDateHb, endDateHb); | ||
723 | Map<String, Object> map = factoryCenterMapper.getDhData(startDate, endDate, statisticsParam.getDepartId(), dataView3a24, dataView2119); | ||
724 | if(map!=null){ | ||
725 | zdh = Double.parseDouble(map.get("zdh").toString()); | ||
726 | rjdh = Double.parseDouble(map.get("rjdh").toString()); | ||
727 | dsdh = Double.parseDouble(map.get("dsdh").toString()); | ||
728 | } | ||
729 | resMap.put("zdh", zdh); | ||
730 | resMap.put("rjdh", rjdh); | ||
731 | resMap.put("dsdh", dsdh); | ||
732 | Map<String, Object> maptb = factoryCenterMapper.getDhData(startDateTb, endDateTb, statisticsParam.getDepartId(), dataView3a24tb, dataView2119tb); | ||
733 | if(maptb!=null){ | ||
734 | zdhTb = Double.parseDouble(maptb.get("zdh").toString()); | ||
735 | rjdhTb = Double.parseDouble(maptb.get("rjdh").toString()); | ||
736 | dsdhTb = Double.parseDouble(maptb.get("dsdh").toString()); | ||
737 | zdhTb = Double.parseDouble(df.format(100*(zdh - zdhTb)/zdhTb)); | ||
738 | rjdhTb = Double.parseDouble(df.format(100*(rjdh - rjdhTb)/rjdhTb)); | ||
739 | dsdhTb = Double.parseDouble(df.format(100*(dsdh - dsdhTb)/dsdhTb)); | ||
740 | } | ||
741 | resMap.put("zdh_tb", zdhTb); | ||
742 | resMap.put("rjdh_tb", rjdhTb); | ||
743 | resMap.put("dsdh_tb", dsdhTb); | ||
744 | Map<String, Object> maphb = factoryCenterMapper.getDhData(startDateHb, endDateHb, statisticsParam.getDepartId(), dataView3a24hb, dataView2119hb); | ||
745 | if(maphb!=null){ | ||
746 | zdhHb = Double.parseDouble(maphb.get("zdh").toString()); | ||
747 | rjdhHb = Double.parseDouble(maphb.get("rjdh").toString()); | ||
748 | dsdhHb = Double.parseDouble(maphb.get("dsdh").toString()); | ||
749 | zdhHb = Double.parseDouble(df.format(100*(zdh - zdhHb)/zdhHb)); | ||
750 | rjdhHb = Double.parseDouble(df.format(100*(rjdh - rjdhHb)/rjdhHb)); | ||
751 | dsdhHb = Double.parseDouble(df.format(100*(dsdh - dsdhHb)/dsdhHb)); | ||
752 | } | ||
753 | resMap.put("zdh_hb", zdhHb); | ||
754 | resMap.put("rjdh_hb", rjdhHb); | ||
755 | resMap.put("dsdh_hb", dsdhHb); | ||
756 | return resMap; | ||
757 | } | ||
758 | |||
759 | @Override | ||
760 | public Map<String, Object> getSlData(StatisticsParam statisticsParam) { | ||
761 | Map<String, Object> resMap = new HashMap<>(); | ||
762 | double clsl = 0.00;double clslTb = 0.00;double clslHb = 0.00; | ||
763 | double rjclsl = 0.00;double rjclslTb = 0.00;double rjclslHb = 0.00; | ||
764 | double sjgm = 0.00;double sjgmTb = 0.00;double sjgmHb = 0.00; | ||
765 | String startDate = statisticsParam.getStartDate(); | ||
766 | String endDate = statisticsParam.getEndDate(); | ||
767 | String startDateTb = DateUtils.getTbDate(startDate); | ||
768 | String endDateTb = DateUtils.getTbDate(endDate); | ||
769 | String startDateHb = DateUtils.getHbDate(startDate); | ||
770 | String endDateHb = DateUtils.getHbDate(endDate); | ||
771 | String dataView2119 = ReportViewUtil.buildView(ReportConstant.view2119, "CSL", statisticsParam.getDepartId(), startDate,endDate); | ||
772 | String dataView2119tb = ReportViewUtil.buildView(ReportConstant.view2119, "CSL", statisticsParam.getDepartId(), startDateTb,endDateTb); | ||
773 | String dataView2119hb = ReportViewUtil.buildView(ReportConstant.view2119, "CSL", statisticsParam.getDepartId(), startDateHb,endDateHb); | ||
774 | Map<String, Object> map = factoryCenterMapper.getSlData(startDate,endDate,statisticsParam.getDepartId(),dataView2119); | ||
775 | if(map!=null){ | ||
776 | clsl = Double.parseDouble(map.get("clsl").toString()); | ||
777 | rjclsl = Double.parseDouble(map.get("rjclsl").toString()); | ||
778 | sjgm = Double.parseDouble(map.get("sjgm").toString()); | ||
779 | } | ||
780 | resMap.put("clsl", clsl); | ||
781 | resMap.put("rjclsl", rjclsl); | ||
782 | resMap.put("sjgm", sjgm); | ||
783 | Map<String, Object> maptb = factoryCenterMapper.getSlData(startDateTb,endDateTb,statisticsParam.getDepartId(),dataView2119tb); | ||
784 | if(maptb!=null){ | ||
785 | clslTb = Double.parseDouble(maptb.get("clsl").toString()); | ||
786 | rjclslTb = Double.parseDouble(maptb.get("rjclsl").toString()); | ||
787 | clslTb = Double.parseDouble(df.format(100*(clsl - clslTb)/clslTb)); | ||
788 | rjclslTb = Double.parseDouble(df.format(100*(rjclsl - rjclslTb)/rjclslTb)); | ||
789 | } | ||
790 | resMap.put("clsl_tb", clslTb); | ||
791 | resMap.put("rjclsl_tb", rjclslTb); | ||
792 | resMap.put("sjgm_tb", sjgmTb); | ||
793 | Map<String, Object> maphb = factoryCenterMapper.getSlData(startDateHb,endDateHb,statisticsParam.getDepartId(),dataView2119hb); | ||
794 | if(maphb!=null){ | ||
795 | clslHb = Double.parseDouble(maphb.get("clsl").toString()); | ||
796 | rjclslHb = Double.parseDouble(maphb.get("rjclsl").toString()); | ||
797 | clslHb = Double.parseDouble(df.format(100*(clsl - clslHb)/clslHb)); | ||
798 | rjclslHb = Double.parseDouble(df.format(100*(rjclsl - rjclslHb)/rjclslHb)); | ||
799 | } | ||
800 | resMap.put("clsl_hb", clslHb); | ||
801 | resMap.put("rjclsl_hb", rjclslHb); | ||
802 | resMap.put("sjgm_hb", sjgmHb); | ||
803 | return resMap; | ||
804 | } | ||
805 | |||
806 | @Override | ||
807 | public Map<String, Object> getWsDhTj(StatisticsParam statisticsParam) { | ||
808 | Map<String, Object> resMap = new HashMap<>(); | ||
809 | int low = 0;int normal = 0;int up = 0;int upper = 0; | ||
810 | String startDate = statisticsParam.getStartDate(); | ||
811 | String endDate = statisticsParam.getEndDate(); | ||
812 | String dataView3a24 = ReportViewUtil.buildView(ReportConstant.view3a24, "DLHJ", statisticsParam.getDepartId(), startDate,endDate); | ||
813 | String dataView2119 = ReportViewUtil.buildView(ReportConstant.view2119, "CSL", statisticsParam.getDepartId(), startDate, endDate); | ||
814 | List<Map<String,Object>> list = factoryCenterMapper.getDsdhListGroupByDepart(startDate,endDate,statisticsParam.getDepartId(),dataView3a24,dataView2119); | ||
815 | resMap = getDhData(statisticsParam); | ||
816 | if(list.size()>0){ | ||
817 | for (Map<String,Object> dsdhMap : list) { | ||
818 | if(dsdhMap.get("dsdh")!=null){ | ||
819 | double dsdh = Double.parseDouble(dsdhMap.get("dsdh").toString()); | ||
820 | if(dsdh<0.4){ | ||
821 | low++; | ||
822 | }else if(dsdh<0.5 && dsdh>=0.4){ | ||
823 | normal++; | ||
824 | }else if(dsdh<0.7 && dsdh>=0.5){ | ||
825 | up++; | ||
826 | }else{ | ||
827 | upper++; | ||
828 | } | ||
829 | }else{ | ||
830 | low++; | ||
831 | } | ||
832 | } | ||
833 | } | ||
834 | resMap.put("low", low);//<0.4 | ||
835 | resMap.put("normal", normal);//0.4-0.5 | ||
836 | resMap.put("up", up);//0.5-0.7 | ||
837 | resMap.put("upper", upper);//>0.7 | ||
838 | return resMap; | ||
839 | } | ||
840 | |||
645 | /** | 841 | /** |
646 | * 获取时间之间的月份 | 842 | * 获取时间之间的月份 |
647 | * @param start | 843 | * @param start | ... | ... |
1 | package com.skua.modules.report.entity; | 1 | package com.skua.modules.report.entity; |
2 | 2 | ||
3 | import java.io.Serializable; | ||
4 | import java.util.Date; | 3 | import java.util.Date; |
5 | import com.baomidou.mybatisplus.annotation.IdType; | 4 | import com.baomidou.mybatisplus.annotation.IdType; |
6 | import com.baomidou.mybatisplus.annotation.TableId; | 5 | import com.baomidou.mybatisplus.annotation.TableId; |
7 | import com.baomidou.mybatisplus.annotation.TableName; | 6 | import com.baomidou.mybatisplus.annotation.TableName; |
8 | import com.baomidou.mybatisplus.annotation.TableField; | ||
9 | import com.skua.core.aspect.annotation.Dict; | 7 | import com.skua.core.aspect.annotation.Dict; |
10 | import io.swagger.annotations.ApiModel; | 8 | import io.swagger.annotations.ApiModel; |
11 | import io.swagger.annotations.ApiModelProperty; | 9 | import io.swagger.annotations.ApiModelProperty; |
... | @@ -46,6 +44,92 @@ public class ReportTargetConfig { | ... | @@ -46,6 +44,92 @@ public class ReportTargetConfig { |
46 | @Excel(name = "药量目标", width = 15) | 44 | @Excel(name = "药量目标", width = 15) |
47 | @ApiModelProperty(value = "药量目标") | 45 | @ApiModelProperty(value = "药量目标") |
48 | private String targetDrug; | 46 | private String targetDrug; |
47 | |||
48 | /**PAC(液)目标*/ | ||
49 | @Excel(name = "PAC(液)目标", width = 15) | ||
50 | @ApiModelProperty(value = "PAC(液)目标") | ||
51 | private String targetPacyt; | ||
52 | /**PAC(固)目标*/ | ||
53 | @Excel(name = "PAC(固)目标", width = 15) | ||
54 | @ApiModelProperty(value = "PAC(固)目标") | ||
55 | private String targetPacgt; | ||
56 | /**NaClO目标*/ | ||
57 | @Excel(name = "NaClO目标", width = 15) | ||
58 | @ApiModelProperty(value = "NaClO目标") | ||
59 | private String targetNaclo; | ||
60 | /**水处理PAM(-)目标*/ | ||
61 | @Excel(name = "水处理PAM(-)目标", width = 15) | ||
62 | @ApiModelProperty(value = "水处理PAM(-)目标") | ||
63 | private String targetSclpamf; | ||
64 | /**水处理PAM(+)目标*/ | ||
65 | @Excel(name = "水处理PAM(+)目标", width = 15) | ||
66 | @ApiModelProperty(value = "水处理PAM(+)目标") | ||
67 | private String targetSclpamz; | ||
68 | /**污脱PAM乳剂目标*/ | ||
69 | @Excel(name = "污脱PAM乳剂目标", width = 15) | ||
70 | @ApiModelProperty(value = "污脱PAM乳剂目标") | ||
71 | private String targetPamrj; | ||
72 | /**污脱PAM(-)目标*/ | ||
73 | @Excel(name = "污脱PAM(-)目标", width = 15) | ||
74 | @ApiModelProperty(value = "污脱PAM(-)目标") | ||
75 | private String targetPamf; | ||
76 | /**污脱PAM(+)目标*/ | ||
77 | @Excel(name = "污脱PAM(+)目标", width = 15) | ||
78 | @ApiModelProperty(value = "污脱PAM(+)目标") | ||
79 | private String targetPamz; | ||
80 | /**PFS目标*/ | ||
81 | @Excel(name = "PFS目标", width = 15) | ||
82 | @ApiModelProperty(value = "PFS目标") | ||
83 | private String targetPfs; | ||
84 | /**复合铁盐目标*/ | ||
85 | @Excel(name = "复合铁盐目标", width = 15) | ||
86 | @ApiModelProperty(value = "复合铁盐目标") | ||
87 | private String targetFhty; | ||
88 | /**乳液絮凝剂目标*/ | ||
89 | @Excel(name = "乳液絮凝剂目标", width = 15) | ||
90 | @ApiModelProperty(value = "乳液絮凝剂目标") | ||
91 | private String targetRyxnj; | ||
92 | /**益维磷目标*/ | ||
93 | @Excel(name = "益维磷目标", width = 15) | ||
94 | @ApiModelProperty(value = "益维磷目标") | ||
95 | private String targetYwl; | ||
96 | /**高效除磷剂目标*/ | ||
97 | @Excel(name = "高效除磷剂目标", width = 15) | ||
98 | @ApiModelProperty(value = "高效除磷剂目标") | ||
99 | private String targetGxclj; | ||
100 | /**CH₃COONa目标*/ | ||
101 | @Excel(name = "CH₃COONa目标", width = 15) | ||
102 | @ApiModelProperty(value = "CH₃COONa目标") | ||
103 | private String targetCh3coona; | ||
104 | /**活性炭目标*/ | ||
105 | @Excel(name = "活性炭目标", width = 15) | ||
106 | @ApiModelProperty(value = "活性炭目标") | ||
107 | private String targetHxt; | ||
108 | /**FeCl3目标*/ | ||
109 | @Excel(name = "FeCl3目标", width = 15) | ||
110 | @ApiModelProperty(value = "FeCl3目标") | ||
111 | private String targetFecl3; | ||
112 | /**石灰目标*/ | ||
113 | @Excel(name = "石灰目标", width = 15) | ||
114 | @ApiModelProperty(value = "石灰目标") | ||
115 | private String targetSh; | ||
116 | /**CH3COOH目标*/ | ||
117 | @Excel(name = "CH3COOH目标", width = 15) | ||
118 | @ApiModelProperty(value = "CH3COOH目标") | ||
119 | private String targetCh3cooh; | ||
120 | /**FeSO4固目标*/ | ||
121 | @Excel(name = "FeSO4固目标", width = 15) | ||
122 | @ApiModelProperty(value = "FeSO4固目标") | ||
123 | private String targetFeso4g; | ||
124 | /**FeSO4液目标*/ | ||
125 | @Excel(name = "FeSO4液目标", width = 15) | ||
126 | @ApiModelProperty(value = "FeSO4液目标") | ||
127 | private String targetFeso4y; | ||
128 | /**H2O2目标*/ | ||
129 | @Excel(name = "H2O2目标", width = 15) | ||
130 | @ApiModelProperty(value = "H2O2目标") | ||
131 | private String targetH2o2; | ||
132 | |||
49 | /**所属厂区*/ | 133 | /**所属厂区*/ |
50 | @Excel(name = "所属厂区", width = 15) | 134 | @Excel(name = "所属厂区", width = 15) |
51 | @Dict(dictTable = "sys_depart", dicCode = "id", dicText = "depart_name") | 135 | @Dict(dictTable = "sys_depart", dicCode = "id", dicText = "depart_name") | ... | ... |
-
请 注册 或 登录 后发表评论