kangwei : 联调:能环保态势大屏-后端
正在显示
9 个修改的文件
包含
140 行增加
和
59 行删除
... | @@ -108,7 +108,9 @@ public class DigitalUtils { | ... | @@ -108,7 +108,9 @@ public class DigitalUtils { |
108 | */ | 108 | */ |
109 | public static String division(String dividend , String divisor ){ | 109 | public static String division(String dividend , String divisor ){ |
110 | String resultStr = null; | 110 | String resultStr = null; |
111 | try{ | 111 | String expression = dividend+ "/ "+ divisor; |
112 | resultStr = JSUtils.executeExpression(expression,"0.00"); | ||
113 | /* try{ | ||
112 | if( isNumber(dividend) && isNumber( divisor) && Double.parseDouble(divisor) != 0 ){ | 114 | if( isNumber(dividend) && isNumber( divisor) && Double.parseDouble(divisor) != 0 ){ |
113 | BigDecimal dividend_BD = new BigDecimal(dividend); | 115 | BigDecimal dividend_BD = new BigDecimal(dividend); |
114 | BigDecimal divisor_BD = new BigDecimal(divisor); | 116 | BigDecimal divisor_BD = new BigDecimal(divisor); |
... | @@ -116,8 +118,9 @@ public class DigitalUtils { | ... | @@ -116,8 +118,9 @@ public class DigitalUtils { |
116 | resultStr = result.toString(); | 118 | resultStr = result.toString(); |
117 | } | 119 | } |
118 | }catch(Exception e){ | 120 | }catch(Exception e){ |
121 | System.out.println("dividend = "+ dividend +"; divisor = "+ divisor); | ||
119 | e.printStackTrace(); | 122 | e.printStackTrace(); |
120 | } | 123 | }*/ |
121 | 124 | ||
122 | //System.out.print("请输入被除数:");double dividend =scanner.nextDouble(); | 125 | //System.out.print("请输入被除数:");double dividend =scanner.nextDouble(); |
123 | // System.out.print("请输入除数:");double divisor =scanner.nextDouble(); | 126 | // System.out.print("请输入除数:");double divisor =scanner.nextDouble(); | ... | ... |
此文件的差异被折叠,
点击展开。
... | @@ -29,7 +29,6 @@ public class SkApplication { | ... | @@ -29,7 +29,6 @@ public class SkApplication { |
29 | "swagger-ui: \thttp://" + ip + ":" + port + path + "/swagger-ui.html\n\t" + | 29 | "swagger-ui: \thttp://" + ip + ":" + port + path + "/swagger-ui.html\n\t" + |
30 | "Doc: \t\thttp://" + ip + ":" + port + path + "/doc.html\n" + | 30 | "Doc: \t\thttp://" + ip + ":" + port + path + "/doc.html\n" + |
31 | "----------------------------------------------------------"); | 31 | "----------------------------------------------------------"); |
32 | |||
33 | } | 32 | } |
34 | 33 | ||
35 | // @Configuration | 34 | // @Configuration | ... | ... |
... | @@ -59,8 +59,7 @@ public class EmergencyRiskEventController { | ... | @@ -59,8 +59,7 @@ public class EmergencyRiskEventController { |
59 | Result<List<Map<String,Object>>> result = new Result<>(); | 59 | Result<List<Map<String,Object>>> result = new Result<>(); |
60 | QueryWrapper<EmergencyRiskEvent> queryWrapper = new QueryWrapper<EmergencyRiskEvent>();//QueryGenerator.initQueryWrapper(equipmentDefectManagement, req.getParameterMap()); | 60 | QueryWrapper<EmergencyRiskEvent> queryWrapper = new QueryWrapper<EmergencyRiskEvent>();//QueryGenerator.initQueryWrapper(equipmentDefectManagement, req.getParameterMap()); |
61 | queryWrapper.select("count(id) count,handle_result handleResult"); | 61 | queryWrapper.select("count(id) count,handle_result handleResult"); |
62 | queryWrapper.ge(StringUtils.isNotEmpty(equipmentDefectManagement.getStartTime()),"report_date",equipmentDefectManagement.getStartTime()); | 62 | |
63 | queryWrapper.le(StringUtils.isNotEmpty(equipmentDefectManagement.getEndTime()),"report_date",equipmentDefectManagement.getEndTime()); | ||
64 | queryWrapper.groupBy("handle_result"); | 63 | queryWrapper.groupBy("handle_result"); |
65 | List<Map<String,Object>> list = emergencyRiskEventService.listMaps(queryWrapper); | 64 | List<Map<String,Object>> list = emergencyRiskEventService.listMaps(queryWrapper); |
66 | result.setSuccess(true); | 65 | result.setSuccess(true); |
... | @@ -79,8 +78,7 @@ public class EmergencyRiskEventController { | ... | @@ -79,8 +78,7 @@ public class EmergencyRiskEventController { |
79 | emergencyRiskEventQueryWrapper.eq("handle_result","1"); | 78 | emergencyRiskEventQueryWrapper.eq("handle_result","1"); |
80 | emergencyRiskEventQueryWrapper.ne("event_type",""); | 79 | emergencyRiskEventQueryWrapper.ne("event_type",""); |
81 | emergencyRiskEventQueryWrapper.isNotNull("event_type"); | 80 | emergencyRiskEventQueryWrapper.isNotNull("event_type"); |
82 | emergencyRiskEventQueryWrapper.ge(StringUtils.isNotEmpty(equipmentDefectManagement.getStartTime()),"report_date",equipmentDefectManagement.getStartTime()); | 81 | |
83 | emergencyRiskEventQueryWrapper.le(StringUtils.isNotEmpty(equipmentDefectManagement.getEndTime()),"report_date",equipmentDefectManagement.getEndTime()); | ||
84 | emergencyRiskEventQueryWrapper.groupBy("handle_result","event_type"); | 82 | emergencyRiskEventQueryWrapper.groupBy("handle_result","event_type"); |
85 | List<Map<String,Object>> list = emergencyRiskEventService.listMaps(emergencyRiskEventQueryWrapper); | 83 | List<Map<String,Object>> list = emergencyRiskEventService.listMaps(emergencyRiskEventQueryWrapper); |
86 | //已处理应急事件 | 84 | //已处理应急事件 |
... | @@ -89,8 +87,7 @@ public class EmergencyRiskEventController { | ... | @@ -89,8 +87,7 @@ public class EmergencyRiskEventController { |
89 | emergencyRiskEventQueryWrapper.eq("handle_result","3"); | 87 | emergencyRiskEventQueryWrapper.eq("handle_result","3"); |
90 | emergencyRiskEventQueryWrapper.ne("event_type",""); | 88 | emergencyRiskEventQueryWrapper.ne("event_type",""); |
91 | emergencyRiskEventQueryWrapper.isNotNull("event_type"); | 89 | emergencyRiskEventQueryWrapper.isNotNull("event_type"); |
92 | emergencyRiskEventQueryWrapper.ge(StringUtils.isNotEmpty(equipmentDefectManagement.getStartTime()),"report_date",equipmentDefectManagement.getStartTime()); | 90 | |
93 | emergencyRiskEventQueryWrapper.le(StringUtils.isNotEmpty(equipmentDefectManagement.getEndTime()),"report_date",equipmentDefectManagement.getEndTime()); | ||
94 | emergencyRiskEventQueryWrapper.groupBy("handle_result","event_type"); | 91 | emergencyRiskEventQueryWrapper.groupBy("handle_result","event_type"); |
95 | List<Map<String,Object>> yclList = emergencyRiskEventService.listMaps(emergencyRiskEventQueryWrapper); | 92 | List<Map<String,Object>> yclList = emergencyRiskEventService.listMaps(emergencyRiskEventQueryWrapper); |
96 | //获取未处理、已处理中的应急事件类型 | 93 | //获取未处理、已处理中的应急事件类型 |
... | @@ -133,19 +130,16 @@ public class EmergencyRiskEventController { | ... | @@ -133,19 +130,16 @@ public class EmergencyRiskEventController { |
133 | @RequestParam(name="pageSize", defaultValue="10") Integer pageSize, | 130 | @RequestParam(name="pageSize", defaultValue="10") Integer pageSize, |
134 | HttpServletRequest req) { | 131 | HttpServletRequest req) { |
135 | Result<IPage<EmergencyRiskEvent>> result = new Result<IPage<EmergencyRiskEvent>>(); | 132 | Result<IPage<EmergencyRiskEvent>> result = new Result<IPage<EmergencyRiskEvent>>(); |
133 | //2023-10-05 00:00:00 2023-10-05 23:59:59 | ||
136 | QueryWrapper<EmergencyRiskEvent> queryWrapper = QueryGenerator.initQueryWrapper(emergencyRiskEvent, req.getParameterMap()); | 134 | QueryWrapper<EmergencyRiskEvent> queryWrapper = QueryGenerator.initQueryWrapper(emergencyRiskEvent, req.getParameterMap()); |
137 | Page<EmergencyRiskEvent> page = new Page<EmergencyRiskEvent>(pageNo, pageSize); | 135 | Page<EmergencyRiskEvent> page = new Page<EmergencyRiskEvent>(pageNo, pageSize); |
138 | 136 | ||
139 | if(StringUtils.isNotEmpty(emergencyRiskEvent.getStartTime())){ | 137 | |
140 | queryWrapper.ge("report_date",emergencyRiskEvent.getStartTime()); | ||
141 | } | ||
142 | if(StringUtils.isNotEmpty(emergencyRiskEvent.getEndTime())){ | ||
143 | queryWrapper.le("report_date",emergencyRiskEvent.getEndTime()); | ||
144 | } | ||
145 | IPage<EmergencyRiskEvent> pageList = emergencyRiskEventService.page(page, queryWrapper); | 138 | IPage<EmergencyRiskEvent> pageList = emergencyRiskEventService.page(page, queryWrapper); |
146 | 139 | ||
147 | //获取流程状态 | 140 | //获取流程状态 |
148 | List<EmergencyRiskEvent> records = pageList.getRecords(); | 141 | List<EmergencyRiskEvent> records = pageList.getRecords(); |
142 | if(records != null && !records.isEmpty()){ | ||
149 | Set<String> processInstanceIdSet = records.stream().filter(data-> StringUtils.isNotBlank(data.getProcessInstanceId())) | 143 | Set<String> processInstanceIdSet = records.stream().filter(data-> StringUtils.isNotBlank(data.getProcessInstanceId())) |
150 | .map(EmergencyRiskEvent::getProcessInstanceId).collect(Collectors.toSet()); | 144 | .map(EmergencyRiskEvent::getProcessInstanceId).collect(Collectors.toSet()); |
151 | Map<String, Map<String, String>> processInstanceMap; | 145 | Map<String, Map<String, String>> processInstanceMap; |
... | @@ -161,12 +155,15 @@ public class EmergencyRiskEventController { | ... | @@ -161,12 +155,15 @@ public class EmergencyRiskEventController { |
161 | record.getFlow().setStatus(processInstanceMap.getOrDefault(record.getProcessInstanceId(), new HashMap<>()).get("state")); | 155 | record.getFlow().setStatus(processInstanceMap.getOrDefault(record.getProcessInstanceId(), new HashMap<>()).get("state")); |
162 | record.getFlow().setTaskName(processInstanceMap.getOrDefault(record.getProcessInstanceId(), new HashMap<>()).get("processDefinitionName")); | 156 | record.getFlow().setTaskName(processInstanceMap.getOrDefault(record.getProcessInstanceId(), new HashMap<>()).get("processDefinitionName")); |
163 | } | 157 | } |
158 | } | ||
159 | |||
164 | 160 | ||
165 | result.setSuccess(true); | 161 | result.setSuccess(true); |
166 | result.setResult(pageList); | 162 | result.setResult(pageList); |
167 | return result; | 163 | return result; |
168 | } | 164 | } |
169 | 165 | ||
166 | |||
170 | /** | 167 | /** |
171 | 168 | ||
172 | /** | 169 | /** | ... | ... |
... | @@ -143,10 +143,5 @@ public class EmergencyRiskEvent extends FlowEntity { | ... | @@ -143,10 +143,5 @@ public class EmergencyRiskEvent extends FlowEntity { |
143 | @Excel(name = "删除标识,0:正常,1:删除", width = 15) | 143 | @Excel(name = "删除标识,0:正常,1:删除", width = 15) |
144 | @ApiModelProperty(value = "删除标识,0:正常,1:删除") | 144 | @ApiModelProperty(value = "删除标识,0:正常,1:删除") |
145 | private Integer delFlag; | 145 | private Integer delFlag; |
146 | @TableField(exist = false) | 146 | |
147 | @ApiModelProperty(value = "开始时间") | ||
148 | private String startTime; | ||
149 | @TableField(exist = false) | ||
150 | @ApiModelProperty(value = "结束时间") | ||
151 | private String endTime; | ||
152 | } | 147 | } | ... | ... |
... | @@ -2,6 +2,8 @@ package com.skua.modules.custom.service.impl; | ... | @@ -2,6 +2,8 @@ package com.skua.modules.custom.service.impl; |
2 | 2 | ||
3 | import com.skua.common.report.ReportViewUtil; | 3 | import com.skua.common.report.ReportViewUtil; |
4 | import com.skua.core.context.SpringContextUtils; | 4 | import com.skua.core.context.SpringContextUtils; |
5 | import com.skua.core.excel.demo.Student; | ||
6 | import com.skua.core.util.ConvertUtils; | ||
5 | import com.skua.modules.custom.entity.FCustomReportDataset; | 7 | import com.skua.modules.custom.entity.FCustomReportDataset; |
6 | import com.skua.modules.custom.mapper.FCustomReportDatasetMapper; | 8 | import com.skua.modules.custom.mapper.FCustomReportDatasetMapper; |
7 | import com.skua.modules.custom.service.IFCustomReportDatasetService; | 9 | import com.skua.modules.custom.service.IFCustomReportDatasetService; |
... | @@ -279,18 +281,18 @@ public class FCustomReportDatasetServiceImpl extends ServiceImpl<FCustomReportDa | ... | @@ -279,18 +281,18 @@ public class FCustomReportDatasetServiceImpl extends ServiceImpl<FCustomReportDa |
279 | JnhbLargeScreenVO largeScreenVO = new JnhbLargeScreenVO(); | 281 | JnhbLargeScreenVO largeScreenVO = new JnhbLargeScreenVO(); |
280 | //当月数据 | 282 | //当月数据 |
281 | String dataViewName2 = ReportViewUtil.buildView("2119ecbf53a1d2d0708258ff67cfd9e1","CSL", null, dataVO.getNowStartTime(), dataVO.getNowEndTime()); | 283 | String dataViewName2 = ReportViewUtil.buildView("2119ecbf53a1d2d0708258ff67cfd9e1","CSL", null, dataVO.getNowStartTime(), dataVO.getNowEndTime()); |
282 | String dataViewName3 = ReportViewUtil.buildView("3a243d5715b9e1a3753c180872ca0df9","DLHJ,GFFDL,QY,WNL,WNHSL,GFCZL,WFCSL,WFCZL", null, dataVO.getNowStartTime(), dataVO.getNowEndTime()); | 284 | String dataViewName3 = ReportViewUtil.buildView("3a243d5715b9e1a3753c180872ca0df9","DLHJ,GFFDL,QY,YSL,WNL,WNHSL,GFCZL,WFCSL,WFCZL", null, dataVO.getNowStartTime(), dataVO.getNowEndTime()); |
283 | List<JnhbReportData> jnhbReportDataList = mapper.getJnhbReport(dataViewName2, dataViewName3, dataVO.getNowStartTime(), dataVO.getNowEndTime(), null); | 285 | List<JnhbReportData> jnhbReportDataList = mapper.getJnhbReport(dataViewName2, dataViewName3, dataVO.getNowStartTime(), dataVO.getNowEndTime(), null); |
284 | 286 | ||
285 | // 上月数据 同比 | 287 | // 上月数据 同比 |
286 | dataViewName2 = ReportViewUtil.buildView("2119ecbf53a1d2d0708258ff67cfd9e1","CSL", null, dataVO.getLastMonthStartTime(), dataVO.getLastMonthEndTime()); | 288 | dataViewName2 = ReportViewUtil.buildView("2119ecbf53a1d2d0708258ff67cfd9e1","CSL", null, dataVO.getLastMonthStartTime(), dataVO.getLastMonthEndTime()); |
287 | dataViewName3 = ReportViewUtil.buildView("3a243d5715b9e1a3753c180872ca0df9","DLHJ,GFFDL,QY,WNL,WNHSL,GFCZL,WFCSL,WFCZL", null, dataVO.getLastMonthStartTime(), dataVO.getLastMonthEndTime()); | 289 | dataViewName3 = ReportViewUtil.buildView("3a243d5715b9e1a3753c180872ca0df9","DLHJ,GFFDL,QY,YSL,WNL,WNHSL,GFCZL,WFCSL,WFCZL", null, dataVO.getLastMonthStartTime(), dataVO.getLastMonthEndTime()); |
288 | List<JnhbReportData> lastMonthReportDataList = mapper.getJnhbReport(dataViewName2, dataViewName3, dataVO.getLastMonthStartTime(), dataVO.getLastMonthEndTime(), null); | 290 | List<JnhbReportData> lastMonthReportDataList = mapper.getJnhbReport(dataViewName2, dataViewName3, dataVO.getLastMonthStartTime(), dataVO.getLastMonthEndTime(), null); |
289 | 291 | ||
290 | Map<String,JnhbReportData> lastMonthMapData= convertJnhbReportDataMap(lastMonthReportDataList); | 292 | Map<String,JnhbReportData> lastMonthMapData= convertJnhbReportDataMap(lastMonthReportDataList); |
291 | // 去年数据 环比 | 293 | // 去年数据 环比 |
292 | dataViewName2 = ReportViewUtil.buildView("2119ecbf53a1d2d0708258ff67cfd9e1","CSL", null, dataVO.getLastYearStartTime(), dataVO.getLastYearEndTime()); | 294 | dataViewName2 = ReportViewUtil.buildView("2119ecbf53a1d2d0708258ff67cfd9e1","CSL", null, dataVO.getLastYearStartTime(), dataVO.getLastYearEndTime()); |
293 | dataViewName3 = ReportViewUtil.buildView("3a243d5715b9e1a3753c180872ca0df9","DLHJ,GFFDL,QY,WNL,WNHSL,GFCZL,WFCSL,WFCZL", null, dataVO.getLastYearStartTime(), dataVO.getLastYearEndTime()); | 295 | dataViewName3 = ReportViewUtil.buildView("3a243d5715b9e1a3753c180872ca0df9","DLHJ,GFFDL,QY,YSL,WNL,WNHSL,GFCZL,WFCSL,WFCZL", null, dataVO.getLastYearStartTime(), dataVO.getLastYearEndTime()); |
294 | List<JnhbReportData> lastYearReportDataList = mapper.getJnhbReport(dataViewName2, dataViewName3, dataVO.getLastYearStartTime(), dataVO.getLastYearEndTime(), null); | 296 | List<JnhbReportData> lastYearReportDataList = mapper.getJnhbReport(dataViewName2, dataViewName3, dataVO.getLastYearStartTime(), dataVO.getLastYearEndTime(), null); |
295 | Map<String,JnhbReportData> lastYearMapData= convertJnhbReportDataMap(lastYearReportDataList); | 297 | Map<String,JnhbReportData> lastYearMapData= convertJnhbReportDataMap(lastYearReportDataList); |
296 | 298 | ||
... | @@ -316,6 +318,7 @@ public class FCustomReportDatasetServiceImpl extends ServiceImpl<FCustomReportDa | ... | @@ -316,6 +318,7 @@ public class FCustomReportDatasetServiceImpl extends ServiceImpl<FCustomReportDa |
316 | powerConsumeVO = new PowerConsumeVO(reportData.getDepartId(),reportData.getDepartName(),reportData.getDh(), reportData.getGffdl(), reportData.getQy(), reportData.getZhnyxhl() , reportData.getEyhtpfl() , reportData.getDsdh() ); | 318 | powerConsumeVO = new PowerConsumeVO(reportData.getDepartId(),reportData.getDepartName(),reportData.getDh(), reportData.getGffdl(), reportData.getQy(), reportData.getZhnyxhl() , reportData.getEyhtpfl() , reportData.getDsdh() ); |
317 | 319 | ||
318 | c02NumberVO = new ResultNumberVO(); | 320 | c02NumberVO = new ResultNumberVO(); |
321 | c02NumberVO.setName( reportData.getDepartName() ); | ||
319 | c02NumberVO.setValue( reportData.getCodxjl() ); | 322 | c02NumberVO.setValue( reportData.getCodxjl() ); |
320 | cod_NumberVO = new ResultNumberVO();cod_NumberVO.setValue(reportData.getCodxjl()); | 323 | cod_NumberVO = new ResultNumberVO();cod_NumberVO.setValue(reportData.getCodxjl()); |
321 | nh3n_NumberVO = new ResultNumberVO();nh3n_NumberVO.setValue(reportData.getTnxjl()); | 324 | nh3n_NumberVO = new ResultNumberVO();nh3n_NumberVO.setValue(reportData.getTnxjl()); |
... | @@ -380,6 +383,35 @@ public class FCustomReportDatasetServiceImpl extends ServiceImpl<FCustomReportDa | ... | @@ -380,6 +383,35 @@ public class FCustomReportDatasetServiceImpl extends ServiceImpl<FCustomReportDa |
380 | 383 | ||
381 | int count2 = masterDB.queryForObject("select count(1) from equipment_info where energy_level = 2",Integer.class); | 384 | int count2 = masterDB.queryForObject("select count(1) from equipment_info where energy_level = 2",Integer.class); |
382 | largeScreenVO.setEquipmentL2( count2 ); | 385 | largeScreenVO.setEquipmentL2( count2 ); |
386 | |||
387 | // 各站点系统负荷率排名:负荷率排序、设置排名 | ||
388 | if(largeScreenVO.getLoadRateVOList() != null && !largeScreenVO.getLoadRateVOList().isEmpty()){ | ||
389 | // 根据分数排序 | ||
390 | Collections.sort(largeScreenVO.getLoadRateVOList(), new Comparator<LoadRateVO>() { | ||
391 | public int compare(LoadRateVO s1, LoadRateVO s2) { | ||
392 | return Double.compare(ConvertUtils.getDouble(s1.getWsfhl(),0d), ConvertUtils.getDouble(s1.getWsfhl(),0d)); // 降序排序 | ||
393 | } | ||
394 | }); | ||
395 | /*int rank = 1; // 设置排名 | ||
396 | for( LoadRateVO loadRateVORank: largeScreenVO.getLoadRateVOList()){ | ||
397 | loadRateVORank.setRank( rank++); | ||
398 | }*/ | ||
399 | } | ||
400 | //各站点能源消耗排名 吨水电耗 | ||
401 | if(largeScreenVO.getPowerConsumeVOList() != null && !largeScreenVO.getPowerConsumeVOList().isEmpty()) { | ||
402 | // 根据分数排序 | ||
403 | Collections.sort(largeScreenVO.getPowerConsumeVOList(), new Comparator<PowerConsumeVO>() { | ||
404 | public int compare(PowerConsumeVO s1, PowerConsumeVO s2) { | ||
405 | return Double.compare(ConvertUtils.getDouble(s1.getDh(), 0d), ConvertUtils.getDouble(s1.getDh(), 0d)); // 降序排序 | ||
406 | } | ||
407 | }); | ||
408 | /*int rank = 1; // 设置排名 | ||
409 | for( LoadRateVO loadRateVORank: largeScreenVO.getLoadRateVOList()){ | ||
410 | loadRateVORank.setRank( rank++); | ||
411 | }*/ | ||
412 | } | ||
413 | |||
414 | |||
383 | return largeScreenVO; | 415 | return largeScreenVO; |
384 | } | 416 | } |
385 | /**转换为Map<部门编号,JnhbReportData> */ | 417 | /**转换为Map<部门编号,JnhbReportData> */ | ... | ... |
... | @@ -50,38 +50,39 @@ public class JnhbLargeScreenVO { | ... | @@ -50,38 +50,39 @@ public class JnhbLargeScreenVO { |
50 | public void setHeadStatisticsValue(JnhbReportData reportData){ | 50 | public void setHeadStatisticsValue(JnhbReportData reportData){ |
51 | // wssjcll, wsfhl, dh, qy, xinshui, zhnyxhl, eyhtpfl, dsdh | 51 | // wssjcll, wsfhl, dh, qy, xinshui, zhnyxhl, eyhtpfl, dsdh |
52 | ////水处理量,系统负荷率,电耗,汽油,新水,综合能耗,C02,吨水 | 52 | ////水处理量,系统负荷率,电耗,汽油,新水,综合能耗,C02,吨水 |
53 | this.getHeadStatisticsList().get(0).setValue( reportData.getWssjcll() ); | 53 | this.getHeadStatisticsList().get(0).setValue( DigitalUtils.add( this.getHeadStatisticsList().get(0).getValue() , reportData.getWssjcll()) ); |
54 | this.getHeadStatisticsList().get(1).setValue( reportData.getWsfhl() ); | 54 | this.getHeadStatisticsList().get(1).setValue(DigitalUtils.add( this.getHeadStatisticsList().get(1).getValue() , reportData.getWsfhl()) ); |
55 | this.getHeadStatisticsList().get(2).setValue( reportData.getDh() ); | 55 | this.getHeadStatisticsList().get(2).setValue(DigitalUtils.add( this.getHeadStatisticsList().get(2).getValue() , reportData.getDh() )); |
56 | this.getHeadStatisticsList().get(3).setValue( reportData.getQy() ); | 56 | this.getHeadStatisticsList().get(3).setValue(DigitalUtils.add( this.getHeadStatisticsList().get(3).getValue() , reportData.getQy()) ); |
57 | this.getHeadStatisticsList().get(4).setValue( reportData.getXssyl() ); | 57 | this.getHeadStatisticsList().get(4).setValue(DigitalUtils.add( this.getHeadStatisticsList().get(4).getValue() , reportData.getXssyl()) ); |
58 | this.getHeadStatisticsList().get(5).setValue( reportData.getZhnyxhl() ); | 58 | this.getHeadStatisticsList().get(5).setValue(DigitalUtils.add( this.getHeadStatisticsList().get(5).getValue() , reportData.getZhnyxhl()) ); |
59 | this.getHeadStatisticsList().get(6).setValue( reportData.getEyhtpfl() ); | 59 | this.getHeadStatisticsList().get(6).setValue(DigitalUtils.add( this.getHeadStatisticsList().get(6).getValue() , reportData.getEyhtpfl() )); |
60 | this.getHeadStatisticsList().get(7).setValue( reportData.getDsdh() ); | 60 | this.getHeadStatisticsList().get(7).setValue(DigitalUtils.add( this.getHeadStatisticsList().get(7).getValue() , reportData.getDsdh() )); |
61 | } | 61 | } |
62 | public void setHeadStatisticsValueTB(JnhbReportData reportData){ | 62 | public void setHeadStatisticsValueTB(JnhbReportData reportData){ |
63 | // wssjcll, wsfhl, dh, qy, xinshui, zhnyxhl, eyhtpfl, dsdh | 63 | // wssjcll, wsfhl, dh, qy, xinshui, zhnyxhl, eyhtpfl, dsdh |
64 | ////水处理量,系统负荷率,电耗,汽油,新水,综合能耗,C02,吨水 | 64 | ////水处理量,系统负荷率,电耗,汽油,新水,综合能耗,C02,吨水 |
65 | this.getHeadStatisticsList().get(0).setValueTb( reportData.getWssjcll() ); | 65 | |
66 | this.getHeadStatisticsList().get(1).setValueTb( reportData.getWsfhl() ); | 66 | this.getHeadStatisticsList().get(0).setValueTb( DigitalUtils.add( this.getHeadStatisticsList().get(0).getValueTb() , reportData.getWssjcll()) ); |
67 | this.getHeadStatisticsList().get(2).setValueTb( reportData.getDh() ); | 67 | this.getHeadStatisticsList().get(1).setValueTb(DigitalUtils.add( this.getHeadStatisticsList().get(1).getValueTb() , reportData.getWsfhl()) ); |
68 | this.getHeadStatisticsList().get(3).setValueTb( reportData.getQy() ); | 68 | this.getHeadStatisticsList().get(2).setValueTb(DigitalUtils.add( this.getHeadStatisticsList().get(2).getValueTb() , reportData.getDh() )); |
69 | this.getHeadStatisticsList().get(4).setValueTb( reportData.getXssyl() ); | 69 | this.getHeadStatisticsList().get(3).setValueTb(DigitalUtils.add( this.getHeadStatisticsList().get(3).getValueTb() , reportData.getQy()) ); |
70 | this.getHeadStatisticsList().get(5).setValueTb( reportData.getZhnyxhl() ); | 70 | this.getHeadStatisticsList().get(4).setValueTb(DigitalUtils.add( this.getHeadStatisticsList().get(4).getValueTb() , reportData.getXssyl()) ); |
71 | this.getHeadStatisticsList().get(6).setValueTb( reportData.getEyhtpfl() ); | 71 | this.getHeadStatisticsList().get(5).setValueTb(DigitalUtils.add( this.getHeadStatisticsList().get(5).getValueTb() , reportData.getZhnyxhl()) ); |
72 | this.getHeadStatisticsList().get(7).setValueTb( reportData.getDsdh() ); | 72 | this.getHeadStatisticsList().get(6).setValueTb(DigitalUtils.add( this.getHeadStatisticsList().get(6).getValueTb() , reportData.getEyhtpfl() )); |
73 | this.getHeadStatisticsList().get(7).setValueTb(DigitalUtils.add( this.getHeadStatisticsList().get(7).getValueTb() , reportData.getDsdh() )); | ||
73 | } | 74 | } |
74 | public void setHeadStatisticsValueHB(JnhbReportData reportData){ | 75 | public void setHeadStatisticsValueHB(JnhbReportData reportData){ |
75 | // wssjcll, wsfhl, dh, qy, xinshui, zhnyxhl, eyhtpfl, dsdh | 76 | // wssjcll, wsfhl, dh, qy, xinshui, zhnyxhl, eyhtpfl, dsdh |
76 | ////水处理量,系统负荷率,电耗,汽油,新水,综合能耗,C02,吨水 | 77 | ////水处理量,系统负荷率,电耗,汽油,新水,综合能耗,C02,吨水 |
77 | this.getHeadStatisticsList().get(0).setValueHb( reportData.getWssjcll() ); | 78 | this.getHeadStatisticsList().get(0).setValueHb( DigitalUtils.add( this.getHeadStatisticsList().get(0).getValueHb() , reportData.getWssjcll()) ); |
78 | this.getHeadStatisticsList().get(1).setValueHb( reportData.getWsfhl() ); | 79 | this.getHeadStatisticsList().get(1).setValueHb(DigitalUtils.add( this.getHeadStatisticsList().get(1).getValueHb() , reportData.getWsfhl()) ); |
79 | this.getHeadStatisticsList().get(2).setValueHb( reportData.getDh() ); | 80 | this.getHeadStatisticsList().get(2).setValueHb(DigitalUtils.add( this.getHeadStatisticsList().get(2).getValueHb() , reportData.getDh() )); |
80 | this.getHeadStatisticsList().get(3).setValueHb( reportData.getQy() ); | 81 | this.getHeadStatisticsList().get(3).setValueHb(DigitalUtils.add( this.getHeadStatisticsList().get(3).getValueHb() , reportData.getQy()) ); |
81 | this.getHeadStatisticsList().get(4).setValueHb( reportData.getXssyl() ); | 82 | this.getHeadStatisticsList().get(4).setValueHb(DigitalUtils.add( this.getHeadStatisticsList().get(4).getValueHb() , reportData.getXssyl()) ); |
82 | this.getHeadStatisticsList().get(5).setValueHb( reportData.getZhnyxhl() ); | 83 | this.getHeadStatisticsList().get(5).setValueHb(DigitalUtils.add( this.getHeadStatisticsList().get(5).getValueHb() , reportData.getZhnyxhl()) ); |
83 | this.getHeadStatisticsList().get(6).setValueHb( reportData.getEyhtpfl() ); | 84 | this.getHeadStatisticsList().get(6).setValueHb(DigitalUtils.add( this.getHeadStatisticsList().get(6).getValueHb() , reportData.getEyhtpfl() )); |
84 | this.getHeadStatisticsList().get(7).setValueHb( reportData.getDsdh() ); | 85 | this.getHeadStatisticsList().get(7).setValueHb(DigitalUtils.add( this.getHeadStatisticsList().get(7).getValueHb() , reportData.getDsdh() )); |
85 | } | 86 | } |
86 | 87 | ||
87 | /*** | 88 | /*** |
... | @@ -98,13 +99,17 @@ public class JnhbLargeScreenVO { | ... | @@ -98,13 +99,17 @@ public class JnhbLargeScreenVO { |
98 | public JnhbLargeScreenVO(){ | 99 | public JnhbLargeScreenVO(){ |
99 | //头部数值统计 | 100 | //头部数值统计 |
100 | String names = "污水处理量,系统负荷率,电耗,汽油,新水,综合能耗,C02,吨水"; | 101 | String names = "污水处理量,系统负荷率,电耗,汽油,新水,综合能耗,C02,吨水"; |
102 | String unit = "万吨,%,万千瓦时,吨,吨,吨标准煤,吨CO2当量,千瓦时/吨"; | ||
101 | String[] nameList = names.split(","); | 103 | String[] nameList = names.split(","); |
104 | String[] unitList = unit.split(","); | ||
102 | ResultNumberVO numberVO = null; | 105 | ResultNumberVO numberVO = null; |
103 | for(String name : nameList){ | 106 | for(int i = 0 ; i< nameList.length ; i++){ |
104 | numberVO = new ResultNumberVO(); | 107 | numberVO = new ResultNumberVO(); |
105 | numberVO.setName( name); | 108 | numberVO.setName( nameList[i]); |
109 | numberVO.setUnit(unitList[i] ); | ||
106 | this.getHeadStatisticsList().add(numberVO) ; | 110 | this.getHeadStatisticsList().add(numberVO) ; |
107 | } | 111 | } |
112 | |||
108 | //消减量统计 | 113 | //消减量统计 |
109 | names= "COD,NH3-N,TP,TN"; | 114 | names= "COD,NH3-N,TP,TN"; |
110 | nameList = names.split(","); | 115 | nameList = names.split(","); | ... | ... |
1 | package com.skua.modules.report.vo.largeScreen; | 1 | package com.skua.modules.report.vo.largeScreen; |
2 | 2 | ||
3 | import com.skua.core.util.ConvertUtils; | ||
3 | import com.skua.modules.report.vo.JnhbReportData; | 4 | import com.skua.modules.report.vo.JnhbReportData; |
4 | import com.skua.tool.util.DigitalUtils; | 5 | import com.skua.tool.util.DigitalUtils; |
5 | import io.swagger.annotations.ApiModel; | 6 | import io.swagger.annotations.ApiModel; |
... | @@ -32,10 +33,10 @@ public class ResultChartsVO { | ... | @@ -32,10 +33,10 @@ public class ResultChartsVO { |
32 | 33 | ||
33 | public void setData(JnhbReportData reportData ){ | 34 | public void setData(JnhbReportData reportData ){ |
34 | this.getXLine().add( reportData.getDepartName() ) ; | 35 | this.getXLine().add( reportData.getDepartName() ) ; |
35 | this.getCodDataList().add( reportData.getCodxjl() ) ; | 36 | this.getCodDataList().add(ConvertUtils.getString(reportData.getCodxjl(),"0") ) ; |
36 | this.getNh3DataList().add( reportData.getTnxjl() ) ; | 37 | this.getNh3DataList().add( ConvertUtils.getString(reportData.getTnxjl(),"0") ) ; |
37 | this.getTpDataList().add( reportData.getTpxjl() ) ; | 38 | this.getTpDataList().add( ConvertUtils.getString( reportData.getTpxjl(),"0") ) ; |
38 | this.getTnDataList().add( reportData.getTnxjl() ) ; | 39 | this.getTnDataList().add( ConvertUtils.getString(reportData.getTnxjl(),"0") ) ; |
39 | } | 40 | } |
40 | public void setDataByZhnyxhl(JnhbReportData reportData ){ | 41 | public void setDataByZhnyxhl(JnhbReportData reportData ){ |
41 | this.getXLine().add( reportData.getDepartName() ) ; | 42 | this.getXLine().add( reportData.getDepartName() ) ; | ... | ... |
1 | package com.skua.modules.report.vo.largeScreen; | 1 | package com.skua.modules.report.vo.largeScreen; |
2 | 2 | ||
3 | import com.skua.tool.util.DigitalUtils; | 3 | import com.skua.tool.util.DigitalUtils; |
4 | import com.skua.tool.util.JSUtils; | ||
4 | import io.swagger.annotations.ApiModel; | 5 | import io.swagger.annotations.ApiModel; |
5 | import io.swagger.annotations.ApiModelProperty; | 6 | import io.swagger.annotations.ApiModelProperty; |
6 | import lombok.Data; | 7 | import lombok.Data; |
... | @@ -14,6 +15,8 @@ public class ResultNumberVO { | ... | @@ -14,6 +15,8 @@ public class ResultNumberVO { |
14 | 15 | ||
15 | @ApiModelProperty(value = "名称") | 16 | @ApiModelProperty(value = "名称") |
16 | private String name; | 17 | private String name; |
18 | @ApiModelProperty(value = "单位") | ||
19 | private String unit; | ||
17 | 20 | ||
18 | @ApiModelProperty(value = "结果") | 21 | @ApiModelProperty(value = "结果") |
19 | private String value; | 22 | private String value; |
... | @@ -24,25 +27,71 @@ public class ResultNumberVO { | ... | @@ -24,25 +27,71 @@ public class ResultNumberVO { |
24 | @ApiModelProperty(value = "环比(上月)") | 27 | @ApiModelProperty(value = "环比(上月)") |
25 | private String valueHb; | 28 | private String valueHb; |
26 | 29 | ||
27 | @ApiModelProperty(value = "同比(去年同期)排名") | 30 | /* @ApiModelProperty(value = "同比(去年同期)排名") |
28 | private String valueTbRank; | 31 | private String valueTbRank;*/ |
29 | 32 | ||
30 | @ApiModelProperty(value = "环比(上月)排名") | 33 | @ApiModelProperty(value = "环比(上月)排名") |
31 | private String valueHbRank; | 34 | private Integer rank; |
35 | |||
36 | /* @ApiModelProperty(value = "环比(上月)排名") | ||
37 | private String valueHbRank;*/ | ||
32 | 38 | ||
33 | 39 | ||
34 | @ApiModelProperty(value = "同比比例") | 40 | @ApiModelProperty(value = "同比比例") |
35 | private String valueTbRatio; | 41 | private String valueTbRatio; |
42 | @ApiModelProperty(value = "同比比例箭头") | ||
43 | private Boolean valueTbArrow; | ||
44 | |||
45 | |||
36 | @ApiModelProperty(value = "环比比例") | 46 | @ApiModelProperty(value = "环比比例") |
37 | private String valueHbRatio; | 47 | private String valueHbRatio; |
48 | @ApiModelProperty(value = "环比比例箭头") | ||
49 | private Boolean valueHbArrow; | ||
38 | 50 | ||
39 | public String getValueTbRatio() { | 51 | public String getValueTbRatio() { |
40 | this.valueTbRatio = DigitalUtils.division( this.value , this.valueTb) ; | 52 | String expression = this.getValue() +">" + this.getValueTb(); |
53 | Boolean result = JSUtils.executeExpressionForBoolean(expression); | ||
54 | if( result != null ){ | ||
55 | if(result){ | ||
56 | expression = "" +this.getValue() +"/"+this.getValueTb()+"* 100 - 100"; | ||
57 | } | ||
58 | if( !result ){ | ||
59 | expression = " 100-" +this.getValue() +"/"+this.getValueTb()+"* 100 "; | ||
60 | } | ||
61 | } | ||
62 | this.valueTbRatio = JSUtils.executeExpression(expression,"0.0");// DigitalUtils.division( this.value , this.valueTb) ; | ||
41 | return valueTbRatio; | 63 | return valueTbRatio; |
42 | } | 64 | } |
43 | 65 | ||
44 | public String getValueHbRatio() { | 66 | public String getValueHbRatio() { |
45 | this.valueHbRatio = DigitalUtils.division( this.value , this.valueHb) ; | 67 | //this.valueHbRatio = DigitalUtils.division( this.value , this.valueHb) ; |
68 | // String expression = "" +this.value +"/"+this.valueHb+"* 100 - 100"; | ||
69 | |||
70 | String expression = this.getValue() +">" + this.getValueHb(); | ||
71 | Boolean result = JSUtils.executeExpressionForBoolean(expression); | ||
72 | if( result != null ){ | ||
73 | if(result){ | ||
74 | expression = "" +this.getValue() +"/"+this.getValueHb()+"* 100 - 100"; | ||
75 | } | ||
76 | if( !result ){ | ||
77 | expression = " 100 -" +this.getValue() +"/"+this.getValueHb()+"* 100 "; | ||
78 | } | ||
79 | } | ||
80 | this.valueHbRatio = JSUtils.executeExpression(expression,"0.0");// DigitalUtils.division( this.value , this.valueTb) ; | ||
46 | return valueHbRatio; | 81 | return valueHbRatio; |
47 | } | 82 | } |
83 | |||
84 | public Boolean getValueTbArrow() { | ||
85 | String expression = this.getValue() +">" + this.getValueHb(); | ||
86 | Boolean result = JSUtils.executeExpressionForBoolean(expression); | ||
87 | if(result == null ) result = true; | ||
88 | return result; | ||
89 | } | ||
90 | |||
91 | public Boolean getValueHbArrow() { | ||
92 | String expression = this.getValue() +">" + this.getValueHb(); | ||
93 | Boolean result = JSUtils.executeExpressionForBoolean(expression); | ||
94 | if(result == null ) result = true; | ||
95 | return result; | ||
96 | } | ||
48 | } | 97 | } | ... | ... |
-
请 注册 或 登录 后发表评论