2d0f6e74 康伟

kangwei:节能环保大屏数据展示

1 个父辈 f470c6e2
...@@ -345,6 +345,27 @@ public class JSUtils { ...@@ -345,6 +345,27 @@ public class JSUtils {
345 return result; 345 return result;
346 } 346 }
347 347
348 /***
349 * 分割字符串,然后拼接
350 * @param str 带分隔字符串
351 * @param splitStr 分割符号
352 * @return
353 */
354 public static String quoteEach(String str,String splitStr) {
355 if( str != null && str.length() > 0 ){
356 String[] items = str.split(splitStr);
357 StringBuilder sb = new StringBuilder();
358 for (int i = 0; i < items.length; i++) {
359 if (i > 0) {
360 sb.append(", ");
361 }
362 sb.append('\'').append(items[i]).append('\'');
363 }
364 return sb.toString();
365 }
366 return str;
367 }
368
348 /* ScriptEngine se = new ScriptEngineManager().getEngineByName("JavaScript"); 369 /* ScriptEngine se = new ScriptEngineManager().getEngineByName("JavaScript");
349 Object eval = null; 370 Object eval = null;
350 try { 371 try {
......
...@@ -361,7 +361,6 @@ public class SysCommandCentreController { ...@@ -361,7 +361,6 @@ public class SysCommandCentreController {
361 @GetMapping("/getCLSLXQ") 361 @GetMapping("/getCLSLXQ")
362 public Result<List<WaterTreatmentVO>> getCLSLXQ(@RequestParam(name = "time", required = true)String time){ 362 public Result<List<WaterTreatmentVO>> getCLSLXQ(@RequestParam(name = "time", required = true)String time){
363 Result<List<WaterTreatmentVO>> result = new Result<>(); 363 Result<List<WaterTreatmentVO>> result = new Result<>();
364 //String departIds = "1818215093192753152,1818214519948836864,1818214145808531456";
365 List<WaterTreatmentVO> waterTrendVOList = commandCentreService.statisticsCLSLXQ(time, BaseContextHandler.getDeparts()); 364 List<WaterTreatmentVO> waterTrendVOList = commandCentreService.statisticsCLSLXQ(time, BaseContextHandler.getDeparts());
366 result.setResult(waterTrendVOList ); 365 result.setResult(waterTrendVOList );
367 return result; 366 return result;
......
...@@ -175,7 +175,6 @@ public class CommandCentreServiceImpl implements ICommandCentreService { ...@@ -175,7 +175,6 @@ public class CommandCentreServiceImpl implements ICommandCentreService {
175 175
176 long differenceDay = DateUtils.differenceDay(dateVO.getNowMonthStartDate(), dateVO.getNowMonthEndDate()); 176 long differenceDay = DateUtils.differenceDay(dateVO.getNowMonthStartDate(), dateVO.getNowMonthEndDate());
177 String departIdssss = BaseUtil.quoteEach(departIds , ","); 177 String departIdssss = BaseUtil.quoteEach(departIds , ",");
178 System.out.println("departIds = "+departIds);
179 //String factorySql = "select fi.depart_id ,d.depart_name, fi.pro_scale*10000 'pro_scale' from sys_factory_info fi , sys_depart d where fi.depart_id = d.id and d.depart_type =1 and d.id in("+departIdssss+")"; 178 //String factorySql = "select fi.depart_id ,d.depart_name, fi.pro_scale*10000 'pro_scale' from sys_factory_info fi , sys_depart d where fi.depart_id = d.id and d.depart_type =1 and d.id in("+departIdssss+")";
180 String factorySql = "select group_concat(fi.depart_id) from sys_factory_info fi , sys_depart d where fi.depart_id = d.id and d.depart_type =1 and d.id in("+departIdssss+")"; 179 String factorySql = "select group_concat(fi.depart_id) from sys_factory_info fi , sys_depart d where fi.depart_id = d.id and d.depart_type =1 and d.id in("+departIdssss+")";
181 //水厂部门编号集合 180 //水厂部门编号集合
......
...@@ -45,12 +45,12 @@ public class ReportItemVO { ...@@ -45,12 +45,12 @@ public class ReportItemVO {
45 */ 45 */
46 46
47 public String getValueTbBl() { 47 public String getValueTbBl() {
48 valueTbBl = JSUtils.executeExpression("("+this.getValue() + " - " + this.getValueTb() + ") / " +this.getValueTb(),"0.00") ; 48 valueTbBl = JSUtils.executeExpression("("+this.getValue() + " - " + this.getValueTb() + ") *100/ " +this.getValueTb(),"0.00") ;
49 return valueTbBl; 49 return valueTbBl;
50 } 50 }
51 51
52 public String getValueHbBl() { 52 public String getValueHbBl() {
53 valueHbBl = JSUtils.executeExpression("("+this.getValue() + " - " + this.getValueHb() + ") / " +this.getValueHb(),"0.00") ; 53 valueHbBl = JSUtils.executeExpression("("+this.getValue() + " - " + this.getValueHb() + ")*100/ " +this.getValueHb(),"0.00") ;
54 return valueHbBl; 54 return valueHbBl;
55 } 55 }
56 } 56 }
......
...@@ -111,5 +111,5 @@ public interface IFCustomReportDatasetService extends IService<FCustomReportData ...@@ -111,5 +111,5 @@ public interface IFCustomReportDatasetService extends IService<FCustomReportData
111 * 节能环保 大屏展示 111 * 节能环保 大屏展示
112 * @return 112 * @return
113 */ 113 */
114 JnhbLargeScreenVO jnhbLargeScreenShow(DataVO dataVO); 114 JnhbLargeScreenVO jnhbLargeScreenShow(String departIds,String time);
115 } 115 }
......
...@@ -5,6 +5,7 @@ import com.google.common.collect.Maps; ...@@ -5,6 +5,7 @@ import com.google.common.collect.Maps;
5 import com.skua.common.report.ReportViewUtil; 5 import com.skua.common.report.ReportViewUtil;
6 import com.skua.core.api.vo.Result; 6 import com.skua.core.api.vo.Result;
7 import com.skua.core.aspect.annotation.AutoLog; 7 import com.skua.core.aspect.annotation.AutoLog;
8 import com.skua.core.context.BaseContextHandler;
8 import com.skua.core.util.ConvertUtils; 9 import com.skua.core.util.ConvertUtils;
9 import com.skua.core.util.DateUtils; 10 import com.skua.core.util.DateUtils;
10 import com.skua.modules.custom.service.IFCustomReportDatasetService; 11 import com.skua.modules.custom.service.IFCustomReportDatasetService;
...@@ -194,8 +195,8 @@ public class ReportDataController { ...@@ -194,8 +195,8 @@ public class ReportDataController {
194 @GetMapping(value = "/jnhbLargeScreenShow") 195 @GetMapping(value = "/jnhbLargeScreenShow")
195 public Result<JnhbLargeScreenVO> jnhbLargeScreenShow( @RequestParam(name="time") String time) { //time 196 public Result<JnhbLargeScreenVO> jnhbLargeScreenShow( @RequestParam(name="time") String time) { //time
196 Result<JnhbLargeScreenVO> result = new Result<>(); 197 Result<JnhbLargeScreenVO> result = new Result<>();
197 DataVO dataVO = new DataVO(time); 198 String departIds = BaseContextHandler.getDeparts();
198 JnhbLargeScreenVO jnhbLargeScreenVO = fCustomReportDatasetService.jnhbLargeScreenShow(dataVO); 199 JnhbLargeScreenVO jnhbLargeScreenVO = fCustomReportDatasetService.jnhbLargeScreenShow(departIds,time);
199 result.setResult(jnhbLargeScreenVO); 200 result.setResult(jnhbLargeScreenVO);
200 return result; 201 return result;
201 } 202 }
......
...@@ -41,45 +41,6 @@ public class JnhbLargeScreenExpressionVO { ...@@ -41,45 +41,6 @@ public class JnhbLargeScreenExpressionVO {
41 private String head_eyhtpfl_expression_tb ="0";//C02 41 private String head_eyhtpfl_expression_tb ="0";//C02
42 private String head_dsdh_expression_tb = "0";//吨水电耗 42 private String head_dsdh_expression_tb = "0";//吨水电耗
43 43
44 public void setHeadStatisticsValue(JnhbReportData reportData){
45 // wssjcll, wsfhl, dh, qy, xinshui, zhnyxhl, eyhtpfl, dsdh
46 ////水处理量,系统负荷率,电耗,汽油,新水,综合能耗,C02,吨水
47 if(StringUtils.isNotEmpty( reportData.getWssjcll() )) head_wssjcll_expression = ConvertUtils.getString(reportData.getWssjcll() ,"0") +" + " + head_wssjcll_expression;//污水处理量 ;
48 if(StringUtils.isNotEmpty( reportData.getWsfhl() )) head_wsfhl_expression = ConvertUtils.getString(reportData.getWsfhl() ,"0") +" + " + head_wssjcll_expression;//系统负荷率 ;
49 if(StringUtils.isNotEmpty( reportData.getDh() )) head_dh_expression = ConvertUtils.getString(reportData.getDh() ,"0") +" + " + head_wssjcll_expression;//电耗 ;
50 if(StringUtils.isNotEmpty( reportData.getQy() )) head_qy_expression = ConvertUtils.getString(reportData.getQy() ,"0") +" + " + head_wssjcll_expression;//汽油 ;
51 if(StringUtils.isNotEmpty( reportData.getXssyl() )) head_xssyl_expression = ConvertUtils.getString(reportData.getXssyl() ,"0") +" + " + head_wssjcll_expression;//新水使用量 ;
52 if(StringUtils.isNotEmpty( reportData.getZhnyxhl() )) head_zhnyxhl_expression = ConvertUtils.getString(reportData.getZhnyxhl() ,"0") +" + " + head_wssjcll_expression;//综合能源消费量 ;
53 if(StringUtils.isNotEmpty( reportData.getEyhtpfl() )) head_eyhtpfl_expression = ConvertUtils.getString(reportData.getEyhtpfl() ,"0") +" + " + head_wssjcll_expression;//二氧化碳排放量CO2 ;
54 if(StringUtils.isNotEmpty( reportData.getDsdh() )) head_dsdh_expression = ConvertUtils.getString(reportData.getDsdh() ,"0") +" + " + head_wssjcll_expression;//吨水电耗 ;
55 }
56
57 public void setHeadStatisticsValueTB(JnhbReportData reportData){
58 // wssjcll, wsfhl, dh, qy, xinshui, zhnyxhl, eyhtpfl, dsdh
59 ////水处理量,系统负荷率,电耗,汽油,新水,综合能耗,C02,吨水
60 if(StringUtils.isNotEmpty( reportData.getWssjcll() )) head_wssjcll_expression_tb = ConvertUtils.getString(reportData.getWssjcll() ,"0") +" + " + head_wssjcll_expression_tb;//污水处理量 ;
61 if(StringUtils.isNotEmpty( reportData.getWsfhl() )) head_wsfhl_expression_tb = ConvertUtils.getString(reportData.getWsfhl() ,"0") +" + " + head_wssjcll_expression_tb;//系统负荷率 ;
62 if(StringUtils.isNotEmpty( reportData.getDh() )) head_dh_expression_tb = ConvertUtils.getString(reportData.getDh() ,"0") +" + " + head_wssjcll_expression_tb;//电耗 ;
63 if(StringUtils.isNotEmpty( reportData.getQy() )) head_qy_expression_tb = ConvertUtils.getString(reportData.getQy() ,"0") +" + " + head_wssjcll_expression_tb;//汽油 ;
64 if(StringUtils.isNotEmpty( reportData.getXssyl() )) head_xssyl_expression_tb = ConvertUtils.getString(reportData.getXssyl() ,"0") +" + " + head_wssjcll_expression_tb;//新水使用量 ;
65 if(StringUtils.isNotEmpty( reportData.getZhnyxhl() )) head_zhnyxhl_expression_tb = ConvertUtils.getString(reportData.getZhnyxhl() ,"0") +" + " + head_wssjcll_expression_tb;//综合能源消费量 ;
66 if(StringUtils.isNotEmpty( reportData.getEyhtpfl() )) head_eyhtpfl_expression_tb = ConvertUtils.getString(reportData.getEyhtpfl() ,"0") +" + " + head_wssjcll_expression_tb;//二氧化碳排放量CO2 ;
67 if(StringUtils.isNotEmpty( reportData.getDsdh() )) head_dsdh_expression_tb = ConvertUtils.getString(reportData.getDsdh() ,"0") +" + " + head_wssjcll_expression_tb;//吨水电耗 ;
68 }
69 public void setHeadStatisticsValueHB(JnhbReportData reportData){
70 // wssjcll, wsfhl, dh, qy, xinshui, zhnyxhl, eyhtpfl, dsdh
71 ////水处理量,系统负荷率,电耗,汽油,新水,综合能耗,C02,吨水
72 if(StringUtils.isNotEmpty( reportData.getWssjcll() )) head_wssjcll_expression_hb = ConvertUtils.getString(reportData.getWssjcll() ,"0") +" + " + head_wssjcll_expression_hb;//污水处理量 ;
73 if(StringUtils.isNotEmpty( reportData.getWsfhl() )) head_wsfhl_expression_hb = ConvertUtils.getString(reportData.getWsfhl() ,"0") +" + " + head_wssjcll_expression_hb;//系统负荷率 ;
74 if(StringUtils.isNotEmpty( reportData.getDh() )) head_dh_expression_hb = ConvertUtils.getString(reportData.getDh() ,"0") +" + " + head_wssjcll_expression_hb;//电耗 ;
75 if(StringUtils.isNotEmpty( reportData.getQy() )) head_qy_expression_hb = ConvertUtils.getString(reportData.getQy() ,"0") +" + " + head_wssjcll_expression_hb;//汽油 ;
76 if(StringUtils.isNotEmpty( reportData.getXssyl() )) head_xssyl_expression_hb = ConvertUtils.getString(reportData.getXssyl() ,"0") +" + " + head_wssjcll_expression_hb;//新水使用量 ;
77 if(StringUtils.isNotEmpty( reportData.getZhnyxhl() )) head_zhnyxhl_expression_hb = ConvertUtils.getString(reportData.getZhnyxhl() ,"0") +" + " + head_wssjcll_expression_hb;//综合能源消费量 ;
78 if(StringUtils.isNotEmpty( reportData.getEyhtpfl() )) head_eyhtpfl_expression_hb = ConvertUtils.getString(reportData.getEyhtpfl() ,"0") +" + " + head_wssjcll_expression_hb;//二氧化碳排放量CO2 ;
79 if(StringUtils.isNotEmpty( reportData.getDsdh() )) head_dsdh_expression_hb = ConvertUtils.getString(reportData.getDsdh() ,"0") +" + " + head_wssjcll_expression_hb;//吨水电耗 ;
80 }
81
82
83 44
84 /*** 45 /***
85 * 消减量统计 46 * 消减量统计
......
...@@ -22,7 +22,6 @@ public class JnhbLargeScreenVO { ...@@ -22,7 +22,6 @@ public class JnhbLargeScreenVO {
22 @ApiModelProperty(value = "各站点能源消耗排名") 22 @ApiModelProperty(value = "各站点能源消耗排名")
23 private List<PowerConsumeVO> powerConsumeVOList = new ArrayList(); 23 private List<PowerConsumeVO> powerConsumeVOList = new ArrayList();
24 24
25
26 @ApiModelProperty(value = "负荷率对象") 25 @ApiModelProperty(value = "负荷率对象")
27 private List<LoadRateVO> loadRateVOList = new ArrayList<>(); 26 private List<LoadRateVO> loadRateVOList = new ArrayList<>();
28 27
...@@ -47,23 +46,6 @@ public class JnhbLargeScreenVO { ...@@ -47,23 +46,6 @@ public class JnhbLargeScreenVO {
47 private Integer equipmentL2; 46 private Integer equipmentL2;
48 47
49 private JnhbLargeScreenExpressionVO largeScreenExpressionVO; 48 private JnhbLargeScreenExpressionVO largeScreenExpressionVO;
50 /***
51 * 设置头文件
52 */
53
54 public void setHeadStatisticsValue(){
55 // wssjcll, wsfhl, dh, qy, xinshui, zhnyxhl, eyhtpfl, dsdh
56 ////污水处理量,系统负荷率,电耗,汽油,新水,综合能耗,C02,吨水
57 this.getHeadStatisticsList().add( getResultNumberVO( "污水处理量","wssjcll","万吨", this.getLargeScreenExpressionVO().getHead_wssjcll_expression() , this.getLargeScreenExpressionVO().getHead_wssjcll_expression_hb() , this.getLargeScreenExpressionVO().getHead_wssjcll_expression_tb()) );//污水处理量
58 this.getHeadStatisticsList().add( getResultNumberVO( "系统负荷率","wsfhl", "%",this.getLargeScreenExpressionVO().getHead_wsfhl_expression() , this.getLargeScreenExpressionVO().getHead_wsfhl_expression_hb() , this.getLargeScreenExpressionVO().getHead_wsfhl_expression_tb()) );//系统负荷率
59 this.getHeadStatisticsList().add( getResultNumberVO( "电耗","dh","万千瓦时",this.getLargeScreenExpressionVO().getHead_dh_expression() , this.getLargeScreenExpressionVO().getHead_dh_expression_hb() , this.getLargeScreenExpressionVO().getHead_dh_expression_tb()) );//电耗
60 this.getHeadStatisticsList().add( getResultNumberVO( "汽油","qy","吨",this.getLargeScreenExpressionVO().getHead_qy_expression() , this.getLargeScreenExpressionVO().getHead_qy_expression_hb() , this.getLargeScreenExpressionVO().getHead_qy_expression_tb()) );//汽油
61 this.getHeadStatisticsList().add( getResultNumberVO( "新水使用量","xinshui", "吨" ,this.getLargeScreenExpressionVO().getHead_xssyl_expression() , this.getLargeScreenExpressionVO().getHead_xssyl_expression_hb() , this.getLargeScreenExpressionVO().getHead_xssyl_expression_tb()) );//薪水
62 this.getHeadStatisticsList().add( getResultNumberVO( "综合能耗消费量","zhnyxhl","吨标准煤",this.getLargeScreenExpressionVO().getHead_zhnyxhl_expression() , this.getLargeScreenExpressionVO().getHead_zhnyxhl_expression_hb() , this.getLargeScreenExpressionVO().getHead_zhnyxhl_expression_tb()) );//综合能耗
63 this.getHeadStatisticsList().add( getResultNumberVO( "二氧化碳排放量","eyhtpfl","吨CO2当量",this.getLargeScreenExpressionVO().getHead_eyhtpfl_expression() , this.getLargeScreenExpressionVO().getHead_eyhtpfl_expression_hb() , this.getLargeScreenExpressionVO().getHead_eyhtpfl_expression_tb()) );//C02
64 this.getHeadStatisticsList().add( getResultNumberVO( "吨水电耗","dsdh","千瓦时/吨",this.getLargeScreenExpressionVO().getHead_dsdh_expression() , this.getLargeScreenExpressionVO().getHead_dsdh_expression_hb() , this.getLargeScreenExpressionVO().getHead_dsdh_expression_tb()) );//吨水电耗
65 }
66
67 49
68 /*** 50 /***
69 * 设置:消减统计记录 51 * 设置:消减统计记录
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!