2d0f6e74 康伟

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

1 个父辈 f470c6e2
......@@ -345,6 +345,27 @@ public class JSUtils {
return result;
}
/***
* 分割字符串,然后拼接
* @param str 带分隔字符串
* @param splitStr 分割符号
* @return
*/
public static String quoteEach(String str,String splitStr) {
if( str != null && str.length() > 0 ){
String[] items = str.split(splitStr);
StringBuilder sb = new StringBuilder();
for (int i = 0; i < items.length; i++) {
if (i > 0) {
sb.append(", ");
}
sb.append('\'').append(items[i]).append('\'');
}
return sb.toString();
}
return str;
}
/* ScriptEngine se = new ScriptEngineManager().getEngineByName("JavaScript");
Object eval = null;
try {
......
......@@ -361,7 +361,6 @@ public class SysCommandCentreController {
@GetMapping("/getCLSLXQ")
public Result<List<WaterTreatmentVO>> getCLSLXQ(@RequestParam(name = "time", required = true)String time){
Result<List<WaterTreatmentVO>> result = new Result<>();
//String departIds = "1818215093192753152,1818214519948836864,1818214145808531456";
List<WaterTreatmentVO> waterTrendVOList = commandCentreService.statisticsCLSLXQ(time, BaseContextHandler.getDeparts());
result.setResult(waterTrendVOList );
return result;
......
......@@ -175,7 +175,6 @@ public class CommandCentreServiceImpl implements ICommandCentreService {
long differenceDay = DateUtils.differenceDay(dateVO.getNowMonthStartDate(), dateVO.getNowMonthEndDate());
String departIdssss = BaseUtil.quoteEach(departIds , ",");
System.out.println("departIds = "+departIds);
//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+")";
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+")";
//水厂部门编号集合
......
......@@ -45,12 +45,12 @@ public class ReportItemVO {
*/
public String getValueTbBl() {
valueTbBl = JSUtils.executeExpression("("+this.getValue() + " - " + this.getValueTb() + ") / " +this.getValueTb(),"0.00") ;
valueTbBl = JSUtils.executeExpression("("+this.getValue() + " - " + this.getValueTb() + ") *100/ " +this.getValueTb(),"0.00") ;
return valueTbBl;
}
public String getValueHbBl() {
valueHbBl = JSUtils.executeExpression("("+this.getValue() + " - " + this.getValueHb() + ") / " +this.getValueHb(),"0.00") ;
valueHbBl = JSUtils.executeExpression("("+this.getValue() + " - " + this.getValueHb() + ")*100/ " +this.getValueHb(),"0.00") ;
return valueHbBl;
}
}
......
......@@ -111,5 +111,5 @@ public interface IFCustomReportDatasetService extends IService<FCustomReportData
* 节能环保 大屏展示
* @return
*/
JnhbLargeScreenVO jnhbLargeScreenShow(DataVO dataVO);
JnhbLargeScreenVO jnhbLargeScreenShow(String departIds,String time);
}
......
......@@ -5,6 +5,7 @@ import com.google.common.collect.Maps;
import com.skua.common.report.ReportViewUtil;
import com.skua.core.api.vo.Result;
import com.skua.core.aspect.annotation.AutoLog;
import com.skua.core.context.BaseContextHandler;
import com.skua.core.util.ConvertUtils;
import com.skua.core.util.DateUtils;
import com.skua.modules.custom.service.IFCustomReportDatasetService;
......@@ -194,8 +195,8 @@ public class ReportDataController {
@GetMapping(value = "/jnhbLargeScreenShow")
public Result<JnhbLargeScreenVO> jnhbLargeScreenShow( @RequestParam(name="time") String time) { //time
Result<JnhbLargeScreenVO> result = new Result<>();
DataVO dataVO = new DataVO(time);
JnhbLargeScreenVO jnhbLargeScreenVO = fCustomReportDatasetService.jnhbLargeScreenShow(dataVO);
String departIds = BaseContextHandler.getDeparts();
JnhbLargeScreenVO jnhbLargeScreenVO = fCustomReportDatasetService.jnhbLargeScreenShow(departIds,time);
result.setResult(jnhbLargeScreenVO);
return result;
}
......
......@@ -41,45 +41,6 @@ public class JnhbLargeScreenExpressionVO {
private String head_eyhtpfl_expression_tb ="0";//C02
private String head_dsdh_expression_tb = "0";//吨水电耗
public void setHeadStatisticsValue(JnhbReportData reportData){
// wssjcll, wsfhl, dh, qy, xinshui, zhnyxhl, eyhtpfl, dsdh
////水处理量,系统负荷率,电耗,汽油,新水,综合能耗,C02,吨水
if(StringUtils.isNotEmpty( reportData.getWssjcll() )) head_wssjcll_expression = ConvertUtils.getString(reportData.getWssjcll() ,"0") +" + " + head_wssjcll_expression;//污水处理量 ;
if(StringUtils.isNotEmpty( reportData.getWsfhl() )) head_wsfhl_expression = ConvertUtils.getString(reportData.getWsfhl() ,"0") +" + " + head_wssjcll_expression;//系统负荷率 ;
if(StringUtils.isNotEmpty( reportData.getDh() )) head_dh_expression = ConvertUtils.getString(reportData.getDh() ,"0") +" + " + head_wssjcll_expression;//电耗 ;
if(StringUtils.isNotEmpty( reportData.getQy() )) head_qy_expression = ConvertUtils.getString(reportData.getQy() ,"0") +" + " + head_wssjcll_expression;//汽油 ;
if(StringUtils.isNotEmpty( reportData.getXssyl() )) head_xssyl_expression = ConvertUtils.getString(reportData.getXssyl() ,"0") +" + " + head_wssjcll_expression;//新水使用量 ;
if(StringUtils.isNotEmpty( reportData.getZhnyxhl() )) head_zhnyxhl_expression = ConvertUtils.getString(reportData.getZhnyxhl() ,"0") +" + " + head_wssjcll_expression;//综合能源消费量 ;
if(StringUtils.isNotEmpty( reportData.getEyhtpfl() )) head_eyhtpfl_expression = ConvertUtils.getString(reportData.getEyhtpfl() ,"0") +" + " + head_wssjcll_expression;//二氧化碳排放量CO2 ;
if(StringUtils.isNotEmpty( reportData.getDsdh() )) head_dsdh_expression = ConvertUtils.getString(reportData.getDsdh() ,"0") +" + " + head_wssjcll_expression;//吨水电耗 ;
}
public void setHeadStatisticsValueTB(JnhbReportData reportData){
// wssjcll, wsfhl, dh, qy, xinshui, zhnyxhl, eyhtpfl, dsdh
////水处理量,系统负荷率,电耗,汽油,新水,综合能耗,C02,吨水
if(StringUtils.isNotEmpty( reportData.getWssjcll() )) head_wssjcll_expression_tb = ConvertUtils.getString(reportData.getWssjcll() ,"0") +" + " + head_wssjcll_expression_tb;//污水处理量 ;
if(StringUtils.isNotEmpty( reportData.getWsfhl() )) head_wsfhl_expression_tb = ConvertUtils.getString(reportData.getWsfhl() ,"0") +" + " + head_wssjcll_expression_tb;//系统负荷率 ;
if(StringUtils.isNotEmpty( reportData.getDh() )) head_dh_expression_tb = ConvertUtils.getString(reportData.getDh() ,"0") +" + " + head_wssjcll_expression_tb;//电耗 ;
if(StringUtils.isNotEmpty( reportData.getQy() )) head_qy_expression_tb = ConvertUtils.getString(reportData.getQy() ,"0") +" + " + head_wssjcll_expression_tb;//汽油 ;
if(StringUtils.isNotEmpty( reportData.getXssyl() )) head_xssyl_expression_tb = ConvertUtils.getString(reportData.getXssyl() ,"0") +" + " + head_wssjcll_expression_tb;//新水使用量 ;
if(StringUtils.isNotEmpty( reportData.getZhnyxhl() )) head_zhnyxhl_expression_tb = ConvertUtils.getString(reportData.getZhnyxhl() ,"0") +" + " + head_wssjcll_expression_tb;//综合能源消费量 ;
if(StringUtils.isNotEmpty( reportData.getEyhtpfl() )) head_eyhtpfl_expression_tb = ConvertUtils.getString(reportData.getEyhtpfl() ,"0") +" + " + head_wssjcll_expression_tb;//二氧化碳排放量CO2 ;
if(StringUtils.isNotEmpty( reportData.getDsdh() )) head_dsdh_expression_tb = ConvertUtils.getString(reportData.getDsdh() ,"0") +" + " + head_wssjcll_expression_tb;//吨水电耗 ;
}
public void setHeadStatisticsValueHB(JnhbReportData reportData){
// wssjcll, wsfhl, dh, qy, xinshui, zhnyxhl, eyhtpfl, dsdh
////水处理量,系统负荷率,电耗,汽油,新水,综合能耗,C02,吨水
if(StringUtils.isNotEmpty( reportData.getWssjcll() )) head_wssjcll_expression_hb = ConvertUtils.getString(reportData.getWssjcll() ,"0") +" + " + head_wssjcll_expression_hb;//污水处理量 ;
if(StringUtils.isNotEmpty( reportData.getWsfhl() )) head_wsfhl_expression_hb = ConvertUtils.getString(reportData.getWsfhl() ,"0") +" + " + head_wssjcll_expression_hb;//系统负荷率 ;
if(StringUtils.isNotEmpty( reportData.getDh() )) head_dh_expression_hb = ConvertUtils.getString(reportData.getDh() ,"0") +" + " + head_wssjcll_expression_hb;//电耗 ;
if(StringUtils.isNotEmpty( reportData.getQy() )) head_qy_expression_hb = ConvertUtils.getString(reportData.getQy() ,"0") +" + " + head_wssjcll_expression_hb;//汽油 ;
if(StringUtils.isNotEmpty( reportData.getXssyl() )) head_xssyl_expression_hb = ConvertUtils.getString(reportData.getXssyl() ,"0") +" + " + head_wssjcll_expression_hb;//新水使用量 ;
if(StringUtils.isNotEmpty( reportData.getZhnyxhl() )) head_zhnyxhl_expression_hb = ConvertUtils.getString(reportData.getZhnyxhl() ,"0") +" + " + head_wssjcll_expression_hb;//综合能源消费量 ;
if(StringUtils.isNotEmpty( reportData.getEyhtpfl() )) head_eyhtpfl_expression_hb = ConvertUtils.getString(reportData.getEyhtpfl() ,"0") +" + " + head_wssjcll_expression_hb;//二氧化碳排放量CO2 ;
if(StringUtils.isNotEmpty( reportData.getDsdh() )) head_dsdh_expression_hb = ConvertUtils.getString(reportData.getDsdh() ,"0") +" + " + head_wssjcll_expression_hb;//吨水电耗 ;
}
/***
* 消减量统计
......
......@@ -22,7 +22,6 @@ public class JnhbLargeScreenVO {
@ApiModelProperty(value = "各站点能源消耗排名")
private List<PowerConsumeVO> powerConsumeVOList = new ArrayList();
@ApiModelProperty(value = "负荷率对象")
private List<LoadRateVO> loadRateVOList = new ArrayList<>();
......@@ -47,23 +46,6 @@ public class JnhbLargeScreenVO {
private Integer equipmentL2;
private JnhbLargeScreenExpressionVO largeScreenExpressionVO;
/***
* 设置头文件
*/
public void setHeadStatisticsValue(){
// wssjcll, wsfhl, dh, qy, xinshui, zhnyxhl, eyhtpfl, dsdh
////污水处理量,系统负荷率,电耗,汽油,新水,综合能耗,C02,吨水
this.getHeadStatisticsList().add( getResultNumberVO( "污水处理量","wssjcll","万吨", this.getLargeScreenExpressionVO().getHead_wssjcll_expression() , this.getLargeScreenExpressionVO().getHead_wssjcll_expression_hb() , this.getLargeScreenExpressionVO().getHead_wssjcll_expression_tb()) );//污水处理量
this.getHeadStatisticsList().add( getResultNumberVO( "系统负荷率","wsfhl", "%",this.getLargeScreenExpressionVO().getHead_wsfhl_expression() , this.getLargeScreenExpressionVO().getHead_wsfhl_expression_hb() , this.getLargeScreenExpressionVO().getHead_wsfhl_expression_tb()) );//系统负荷率
this.getHeadStatisticsList().add( getResultNumberVO( "电耗","dh","万千瓦时",this.getLargeScreenExpressionVO().getHead_dh_expression() , this.getLargeScreenExpressionVO().getHead_dh_expression_hb() , this.getLargeScreenExpressionVO().getHead_dh_expression_tb()) );//电耗
this.getHeadStatisticsList().add( getResultNumberVO( "汽油","qy","吨",this.getLargeScreenExpressionVO().getHead_qy_expression() , this.getLargeScreenExpressionVO().getHead_qy_expression_hb() , this.getLargeScreenExpressionVO().getHead_qy_expression_tb()) );//汽油
this.getHeadStatisticsList().add( getResultNumberVO( "新水使用量","xinshui", "吨" ,this.getLargeScreenExpressionVO().getHead_xssyl_expression() , this.getLargeScreenExpressionVO().getHead_xssyl_expression_hb() , this.getLargeScreenExpressionVO().getHead_xssyl_expression_tb()) );//薪水
this.getHeadStatisticsList().add( getResultNumberVO( "综合能耗消费量","zhnyxhl","吨标准煤",this.getLargeScreenExpressionVO().getHead_zhnyxhl_expression() , this.getLargeScreenExpressionVO().getHead_zhnyxhl_expression_hb() , this.getLargeScreenExpressionVO().getHead_zhnyxhl_expression_tb()) );//综合能耗
this.getHeadStatisticsList().add( getResultNumberVO( "二氧化碳排放量","eyhtpfl","吨CO2当量",this.getLargeScreenExpressionVO().getHead_eyhtpfl_expression() , this.getLargeScreenExpressionVO().getHead_eyhtpfl_expression_hb() , this.getLargeScreenExpressionVO().getHead_eyhtpfl_expression_tb()) );//C02
this.getHeadStatisticsList().add( getResultNumberVO( "吨水电耗","dsdh","千瓦时/吨",this.getLargeScreenExpressionVO().getHead_dsdh_expression() , this.getLargeScreenExpressionVO().getHead_dsdh_expression_hb() , this.getLargeScreenExpressionVO().getHead_dsdh_expression_tb()) );//吨水电耗
}
/***
* 设置:消减统计记录
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!