|
@@ -0,0 +1,754 @@
|
|
|
+package com.gyee.runeconomy.service.monitor;
|
|
|
+
|
|
|
+
|
|
|
+import com.gyee.common.contant.ContantXk;
|
|
|
+import com.gyee.common.model.PointData;
|
|
|
+import com.gyee.runeconomy.init.CacheContext;
|
|
|
+import com.gyee.runeconomy.model.auto.*;
|
|
|
+import com.gyee.runeconomy.service.auto.IProBasicEquipmentPointService;
|
|
|
+import com.gyee.runeconomy.service.auto.IProBasicPowerstationPointService;
|
|
|
+import com.gyee.runeconomy.service.auto.IProBasicProjectPlanService;
|
|
|
+import com.gyee.runeconomy.util.StringUtils;
|
|
|
+import com.gyee.runeconomy.util.realtimesource.IEdosUtil;
|
|
|
+import org.slf4j.Logger;
|
|
|
+import org.slf4j.LoggerFactory;
|
|
|
+import org.springframework.stereotype.Service;
|
|
|
+
|
|
|
+import javax.annotation.Resource;
|
|
|
+import java.util.*;
|
|
|
+import java.util.stream.Collectors;
|
|
|
+
|
|
|
+@Service
|
|
|
+public class MonitorService {
|
|
|
+ private static Logger logger = LoggerFactory.getLogger(MonitorService.class);
|
|
|
+ @Resource
|
|
|
+ private IProBasicProjectPlanService proBasicProjectPlanService;
|
|
|
+ @Resource
|
|
|
+ private IProBasicPowerstationPointService proBasicPowerstationPointService;
|
|
|
+ @Resource
|
|
|
+ private IProBasicEquipmentPointService proBasicEquipmentPointService;
|
|
|
+
|
|
|
+ private final String QS = "0";
|
|
|
+ private final String FD = "-1";
|
|
|
+ private final String GF = "-2";
|
|
|
+
|
|
|
+ @Resource
|
|
|
+ private IEdosUtil edosUtil;
|
|
|
+ Map<String, Object> map = new HashMap<>();
|
|
|
+
|
|
|
+
|
|
|
+ public Map getcockpit(String wpId) throws Exception {
|
|
|
+
|
|
|
+ if (wpId.endsWith(QS) || wpId.endsWith(FD) || wpId.endsWith(GF) || CacheContext.wpmapls.containsKey(wpId)) {
|
|
|
+
|
|
|
+ List<ProBasicPowerstation> wplist = new ArrayList<>();
|
|
|
+ if (CacheContext.wpmapls.containsKey(wpId)) {
|
|
|
+ wplist = CacheContext.wpmapls.get(wpId);
|
|
|
+ }
|
|
|
+ for (ProBasicPowerstation wp : CacheContext.wpls) {
|
|
|
+ if (wpId.equals(FD)) {
|
|
|
+ if (wp.getId().endsWith("FDC_STA")) {
|
|
|
+ wplist.add(wp);
|
|
|
+ }
|
|
|
+ } else if (wpId.equals(GF)) {
|
|
|
+ if (wp.getId().endsWith("GDC_STA")) {
|
|
|
+ wplist.add(wp);
|
|
|
+ }
|
|
|
+ } else if (wpId.equals(QS)) {
|
|
|
+ wplist.add(wp);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ /**********************************************首页各风电场容量、线路、装机容量、风机台数统计**********************************************************/
|
|
|
+
|
|
|
+ if (!wpId.isEmpty()) {
|
|
|
+ for (ProBasicPowerstation wp : CacheContext.wpls) {
|
|
|
+ if (wp.getId().equals(wpId)) {
|
|
|
+ ProBasicPowerstation station = CacheContext.wpmap.get(wpId);
|
|
|
+
|
|
|
+ String code = station.getId();
|
|
|
+ List<ProBasicProject> project = CacheContext.projmap.get(code);
|
|
|
+ Map czxx = new LinkedHashMap();
|
|
|
+ List<Map> qc = new ArrayList<>();
|
|
|
+
|
|
|
+ int linenum = 0;
|
|
|
+ int i = 0;
|
|
|
+
|
|
|
+ czxx.put("zjrl", station.getCapacity());//装机容量
|
|
|
+ for (ProBasicProject p : project) {
|
|
|
+ Map qcls = new LinkedHashMap();
|
|
|
+ i++;
|
|
|
+ qcls.put("id", i);
|
|
|
+ qcls.put("name", p.getName()); //name
|
|
|
+ qcls.put("value", p.getCapacity() / 1000);//value :45
|
|
|
+ linenum = linenum + CacheContext.prolinemap.get(p.getId()).size();
|
|
|
+ qc.add(qcls);
|
|
|
+ }
|
|
|
+
|
|
|
+ czxx.put("linenum", linenum);
|
|
|
+ czxx.put("fjts", station.getJrwindQuantityLd());//风机台数
|
|
|
+ czxx.put("issue", qc);
|
|
|
+ map.put("czxx", czxx);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ /**********************************************首页各风电场容量、线路、装机容量、风机台数统计**********************************************************/
|
|
|
+
|
|
|
+
|
|
|
+ /**********************************************首页场站所有风场信息展示统计**********************************************************/
|
|
|
+
|
|
|
+ List<ProBasicPowerstation> wpls1 = CacheContext.wpls;
|
|
|
+ Map<String, Double> xx = new LinkedHashMap<>();
|
|
|
+ Map<String, Object> czxx = new LinkedHashMap<>();
|
|
|
+ if (!wpls1.isEmpty()) {
|
|
|
+ for (ProBasicPowerstation wp : wpls1) {
|
|
|
+ String id = wp.getId();
|
|
|
+ if (CacheContext.wpmap.containsKey(id)) {
|
|
|
+ xx.put("zjts", Double.valueOf(wp.getWindQuantityLd()));
|
|
|
+ xx.put("zjrl", wp.getJrwindCapacity());
|
|
|
+ double gl = 0.0;
|
|
|
+ ProBasicPowerstationPoint glvalue = proBasicPowerstationPointService.getPowerstationPoint(id, ContantXk.SSZGL);
|
|
|
+ gl = edosUtil.getRealData(glvalue).getPointValueInDouble();
|
|
|
+ xx.put("gl",gl);
|
|
|
+ }
|
|
|
+ czxx.put(id, xx);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ map.put("station",czxx);
|
|
|
+
|
|
|
+ /**********************************************首页场站所有风场信息展示统计**********************************************************/
|
|
|
+
|
|
|
+ /**********************************************首页穿透线路信息统计**********************************************************/
|
|
|
+
|
|
|
+ Map<String, Double> xl = new LinkedHashMap<>();
|
|
|
+ Map<String, Object> xlmap = new LinkedHashMap<>();
|
|
|
+ if (!wpls1.isEmpty()){
|
|
|
+ for (ProBasicLine ls : CacheContext.lnls){
|
|
|
+ String lineid = ls.getId();
|
|
|
+ double xlgl = 0.0;
|
|
|
+ ProBasicPowerstationPoint xlglvalue = proBasicPowerstationPointService.getPowerstationPoint(lineid, ContantXk.SSZGL);
|
|
|
+ xlgl = edosUtil.getRealData(xlglvalue).getPointValueInDouble();
|
|
|
+ xl.put("xlgl",xlgl);
|
|
|
+ xlmap.put(lineid,xl);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ map.put("xlmap",xlmap);
|
|
|
+ /**********************************************首页穿透线路信息统计**********************************************************/
|
|
|
+
|
|
|
+
|
|
|
+ /**********************************************首页明细状态统计**********************************************************/
|
|
|
+
|
|
|
+ double fd_yxnum = 0;
|
|
|
+ double fd_jxnum = 0;
|
|
|
+ double fd_gznum = 0;
|
|
|
+ double fd_lxnum = 0;
|
|
|
+ double fd_djnum = 0;
|
|
|
+ double fd_xdnum = 0;
|
|
|
+
|
|
|
+ double gf_yxnum = 0;
|
|
|
+ double gf_jxnum = 0;
|
|
|
+ double gf_gznum = 0;
|
|
|
+ double gf_lxnum = 0;
|
|
|
+ double gf_djnum = 0;
|
|
|
+ double gf_xdnum = 0;
|
|
|
+
|
|
|
+ for (ProBasicPowerstation wp : wplist){
|
|
|
+
|
|
|
+ List<String> fjztls = new ArrayList<>();
|
|
|
+ List<String> gfztls = new ArrayList<>();
|
|
|
+
|
|
|
+ if (wp.getId().endsWith("FDC_STA") && CacheContext.sqwtmap.containsKey(wp.getId())){
|
|
|
+ List<ProBasicEquipment> wtls = new ArrayList<>();
|
|
|
+ for (ProBasicEquipment wt : wtls){
|
|
|
+ fjztls.add(proBasicEquipmentPointService.getEquipmentPoint(wt.getId(), ContantXk.MXZT).getUniformCode());
|
|
|
+ }
|
|
|
+
|
|
|
+ List<PointData> fjzblist = edosUtil.getRealData(fjztls);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ /**********************************************首页明细状态统计**********************************************************/
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ /**********************************************首页安全天数、实时功率及节能减排等信息统计**********************************************************/
|
|
|
+
|
|
|
+ double aqts = 0.0;
|
|
|
+ double sjgl = 0.0;
|
|
|
+ double jys = 0.0;
|
|
|
+ double jym = 0.0;
|
|
|
+ double co2 = 0.0;
|
|
|
+ double so2 = 0.0;
|
|
|
+
|
|
|
+ Map<String, Double> qt = new HashMap<>();
|
|
|
+
|
|
|
+ if (wpId.equals(QS) || wpId.equals(FD) || wpId.equals(GF)) {
|
|
|
+ wpId = "SXJ_RGN" + wpId;
|
|
|
+ //安全天数
|
|
|
+ ProBasicPowerstationPoint aqtsvalue = proBasicPowerstationPointService.getPowerstationPoint(wpId, ContantXk.AQTS);
|
|
|
+ aqts = edosUtil.getRealData(aqtsvalue).getPointValueInDouble();
|
|
|
+ //实时功率
|
|
|
+ ProBasicPowerstationPoint sjglvalue = proBasicPowerstationPointService.getPowerstationPoint(wpId, ContantXk.SSZGL);
|
|
|
+ sjgl = edosUtil.getRealData(sjglvalue).getPointValueInDouble();
|
|
|
+ //节约水
|
|
|
+ ProBasicPowerstationPoint jysvalue = proBasicPowerstationPointService.getPowerstationPoint(wpId, ContantXk.JYS);
|
|
|
+ jys = edosUtil.getRealData(jysvalue).getPointValueInDouble();
|
|
|
+ //节约煤
|
|
|
+ ProBasicPowerstationPoint jymvalue = proBasicPowerstationPointService.getPowerstationPoint(wpId, ContantXk.JYM);
|
|
|
+ jym = edosUtil.getRealData(jymvalue).getPointValueInDouble();
|
|
|
+ //减排二氧化碳
|
|
|
+ ProBasicPowerstationPoint co2value = proBasicPowerstationPointService.getPowerstationPoint(wpId, ContantXk.JYEYHT);
|
|
|
+ co2 = edosUtil.getRealData(co2value).getPointValueInDouble();
|
|
|
+ //减排二氧化硫
|
|
|
+ ProBasicPowerstationPoint so2value = proBasicPowerstationPointService.getPowerstationPoint(wpId, ContantXk.JYEYHL);
|
|
|
+ so2 = edosUtil.getRealData(so2value).getPointValueInDouble();
|
|
|
+
|
|
|
+ } else {
|
|
|
+ //安全天数
|
|
|
+ ProBasicPowerstationPoint aqtsvalue = proBasicPowerstationPointService.getPowerstationPoint(wpId, ContantXk.AQTS);
|
|
|
+ aqts = edosUtil.getRealData(aqtsvalue).getPointValueInDouble();
|
|
|
+ //实时功率
|
|
|
+ ProBasicPowerstationPoint sjglvalue = proBasicPowerstationPointService.getPowerstationPoint(wpId, ContantXk.SSZGL);
|
|
|
+ sjgl = edosUtil.getRealData(sjglvalue).getPointValueInDouble();
|
|
|
+ //节约水
|
|
|
+ ProBasicPowerstationPoint jysvalue = proBasicPowerstationPointService.getPowerstationPoint(wpId, ContantXk.JYS);
|
|
|
+ jys = edosUtil.getRealData(jysvalue).getPointValueInDouble();
|
|
|
+ //减排二氧化碳
|
|
|
+ ProBasicPowerstationPoint co2value = proBasicPowerstationPointService.getPowerstationPoint(wpId, ContantXk.JYEYHT);
|
|
|
+ co2 = edosUtil.getRealData(co2value).getPointValueInDouble();
|
|
|
+ //减排二氧化硫
|
|
|
+ ProBasicPowerstationPoint so2value = proBasicPowerstationPointService.getPowerstationPoint(wpId, ContantXk.JYEYHL);
|
|
|
+ so2 = edosUtil.getRealData(so2value).getPointValueInDouble();
|
|
|
+ //节约煤
|
|
|
+ ProBasicPowerstationPoint jymvalue = proBasicPowerstationPointService.getPowerstationPoint(wpId, ContantXk.JYM);
|
|
|
+ jym = edosUtil.getRealData(jymvalue).getPointValueInDouble();
|
|
|
+
|
|
|
+ }
|
|
|
+ qt.put("aqts", aqts);
|
|
|
+ qt.put("sjgl", sjgl);
|
|
|
+ qt.put("jys", jys);
|
|
|
+ qt.put("jym", jym);
|
|
|
+ qt.put("co2", co2);
|
|
|
+ qt.put("so2", so2);
|
|
|
+
|
|
|
+ map.put("qt", qt);
|
|
|
+ /**********************************************首页安全天数、实时功率及节能减排等信息统计**********************************************************/
|
|
|
+
|
|
|
+
|
|
|
+ /**********************************************首页电量统计**********************************************************/
|
|
|
+ Calendar cal = Calendar.getInstance();
|
|
|
+ cal.setTime(new Date());
|
|
|
+ int year = cal.get(Calendar.YEAR);
|
|
|
+
|
|
|
+ double fd_r_jhdl = 0;
|
|
|
+ double fd_y_jhdl = 0;
|
|
|
+ double fd_n_jhdl = 0;
|
|
|
+ double gf_r_jhdl = 0;
|
|
|
+ double gf_y_jhdl = 0;
|
|
|
+ double gf_n_jhdl = 0;
|
|
|
+
|
|
|
+ double fd_r_sjdl = 0;
|
|
|
+ double fd_y_sjdl = 0;
|
|
|
+ double fd_n_sjdl = 0;
|
|
|
+ double gf_r_sjdl = 0;
|
|
|
+ double gf_y_sjdl = 0;
|
|
|
+ double gf_n_sjdl = 0;
|
|
|
+
|
|
|
+
|
|
|
+ List<ProBasicProjectPlan> pjls = proBasicProjectPlanService.getList(String.valueOf(year));
|
|
|
+
|
|
|
+ // 获取计划发电量信息
|
|
|
+ Map<String, Map<String, Double>> planmap = new HashMap<>();
|
|
|
+
|
|
|
+ setPlanInfoByType(planmap, pjls, wpId);
|
|
|
+
|
|
|
+ for (ProBasicPowerstation wp : wplist) {
|
|
|
+ if (planmap.containsKey(wp.getId())) {
|
|
|
+ Map<String, Double> valuemap = planmap.get(wp.getId());
|
|
|
+
|
|
|
+ double yfdljh = 0.0;
|
|
|
+ double yfdlsj = 0.0;
|
|
|
+ double nfdljh = 0.0;
|
|
|
+ double nfdlsj = 0.0;
|
|
|
+ if (valuemap.containsKey("yfdljh")) {
|
|
|
+ yfdljh = valuemap.get("yfdljh");
|
|
|
+ }
|
|
|
+ if (valuemap.containsKey("yfdlsj")) {
|
|
|
+ yfdlsj = valuemap.get("yfdlsj");
|
|
|
+ }
|
|
|
+ if (valuemap.containsKey("nfdljh")) {
|
|
|
+ nfdljh = valuemap.get("nfdljh");
|
|
|
+ }
|
|
|
+ if (valuemap.containsKey("nfdlsj")) {
|
|
|
+ nfdlsj = valuemap.get("nfdlsj");
|
|
|
+ }
|
|
|
+ if (wp.getId().indexOf("FDC_STA") >= 0) {
|
|
|
+ fd_r_jhdl = fd_r_jhdl + yfdljh / 30;
|
|
|
+ fd_y_jhdl = fd_y_jhdl + yfdljh;
|
|
|
+ fd_n_jhdl = fd_n_jhdl + nfdljh;
|
|
|
+
|
|
|
+ fd_r_sjdl = fd_r_sjdl + yfdlsj / 30;
|
|
|
+ fd_y_sjdl = fd_y_sjdl + yfdlsj;
|
|
|
+ fd_n_sjdl = fd_n_sjdl + nfdlsj;
|
|
|
+ } else {
|
|
|
+ gf_r_jhdl = gf_r_jhdl + yfdljh / 30;
|
|
|
+ gf_y_jhdl = gf_y_jhdl + yfdljh;
|
|
|
+ gf_n_jhdl = gf_n_jhdl + nfdljh;
|
|
|
+
|
|
|
+ gf_r_sjdl = gf_r_sjdl + yfdlsj / 30;
|
|
|
+ gf_y_sjdl = gf_y_sjdl + yfdlsj;
|
|
|
+ gf_n_sjdl = gf_n_sjdl + nfdlsj;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ Map<String, Double> proplanmap = new HashMap<>();
|
|
|
+
|
|
|
+ proplanmap.put("fd_r_jhdl", StringUtils.round(fd_r_jhdl, 0));
|
|
|
+ proplanmap.put("fd_y_jhdl", StringUtils.round(fd_y_jhdl, 0));
|
|
|
+ proplanmap.put("fd_n_jhdl", StringUtils.round(fd_n_jhdl, 0));
|
|
|
+ proplanmap.put("fd_r_sjdl", StringUtils.round(fd_r_sjdl, 2));
|
|
|
+ proplanmap.put("fd_y_sjdl", StringUtils.round(fd_y_sjdl, 2));
|
|
|
+ proplanmap.put("fd_n_sjdl", StringUtils.round(fd_n_sjdl, 2));
|
|
|
+
|
|
|
+ proplanmap.put("gf_r_jhdl", StringUtils.round(gf_r_jhdl, 0));
|
|
|
+ proplanmap.put("gf_y_jhdl", StringUtils.round(gf_y_jhdl, 0));
|
|
|
+ proplanmap.put("gf_n_jhdl", StringUtils.round(gf_n_jhdl, 0));
|
|
|
+ proplanmap.put("gf_r_sjdl", StringUtils.round(gf_r_sjdl, 2));
|
|
|
+ proplanmap.put("gf_y_sjdl", StringUtils.round(gf_y_sjdl, 2));
|
|
|
+ proplanmap.put("gf_n_sjdl", StringUtils.round(gf_n_sjdl, 2));
|
|
|
+
|
|
|
+ map.put("proplanmap", proplanmap);
|
|
|
+ /**********************************************首页电量统计**********************************************************/
|
|
|
+
|
|
|
+
|
|
|
+ /**********************************************首页弹窗**********************************************************/
|
|
|
+ List<ProBasicPowerstation> wpls = CacheContext.wpls;
|
|
|
+ Map<String, Double> sxqyxx = new LinkedHashMap<>();
|
|
|
+ Map<String, Double> nmqyxx = new LinkedHashMap<>();
|
|
|
+ Map<String, Double> xjqyxx = new LinkedHashMap<>();
|
|
|
+ Map<String, Double> hbqyxx = new LinkedHashMap<>();
|
|
|
+ Map<String, Double> xsqyxx = new LinkedHashMap<>();
|
|
|
+ Map<String, Double> sdqyxx = new LinkedHashMap<>();
|
|
|
+ Map<String, Double> xzqyxx = new LinkedHashMap<>();
|
|
|
+ Map<String, Map> sytc = new LinkedHashMap<>();
|
|
|
+
|
|
|
+ Double sxcyfdzjrl = 0.0;
|
|
|
+ double sxcyfdcsl = 0;
|
|
|
+
|
|
|
+ Double sxcygfzjrl = 0.0;
|
|
|
+ double sxcygfcsl = 0;
|
|
|
+
|
|
|
+ Double sxgsfdzjrl = 0.0;
|
|
|
+ double sxgsfdcsl = 0;
|
|
|
+
|
|
|
+ Double sxgsgfzjrl = 0.0;
|
|
|
+ double sxgsgfcsl = 0;
|
|
|
+
|
|
|
+ Double nmcyfdzjrl = 0.0;
|
|
|
+ double nmcyfdcsl = 0;
|
|
|
+
|
|
|
+ Double nmcygfzjrl = 0.0;
|
|
|
+ double nmcygfcsl = 0;
|
|
|
+
|
|
|
+ Double nmgsfdzjrl = 0.0;
|
|
|
+ double nmgsfdcsl = 0;
|
|
|
+
|
|
|
+ Double nmgsgfzjrl = 0.0;
|
|
|
+ double nmgsgfcsl = 0;
|
|
|
+
|
|
|
+ Double xjcyfdzjrl = 0.0;
|
|
|
+ double xjcyfdcsl = 0;
|
|
|
+
|
|
|
+ Double xjcygfzjrl = 0.0;
|
|
|
+ double xjcygfcsl = 0;
|
|
|
+
|
|
|
+ Double hbcyfdzjrl = 0.0;
|
|
|
+ double hbcyfdcsl = 0;
|
|
|
+
|
|
|
+ Double hbcygfzjrl = 0.0;
|
|
|
+ double hbcygfcsl = 0;
|
|
|
+
|
|
|
+ Double xscyfdzjrl = 0.0;
|
|
|
+ double xscyfdcsl = 0;
|
|
|
+
|
|
|
+ Double xscygfzjrl = 0.0;
|
|
|
+ double xscygfcsl = 0;
|
|
|
+
|
|
|
+ Double sdcyfdzjrl = 0.0;
|
|
|
+ double sdcyfdcsl = 0;
|
|
|
+
|
|
|
+ Double sdcygfzjrl = 0.0;
|
|
|
+ double sdcygfcsl = 0;
|
|
|
+
|
|
|
+ Double xzcyfdzjrl = 0.0;
|
|
|
+ double xzcyfdcsl = 0;
|
|
|
+
|
|
|
+ Double xzcygfzjrl = 0.0;
|
|
|
+ double xzcygfcsl = 0;
|
|
|
+
|
|
|
+ if (!wpls.isEmpty()) {
|
|
|
+ //山西产业
|
|
|
+ List<ProBasicPowerstation> sxfdcy = wpls.stream().filter(wp -> wp.getRegionId().equals("SXJ_RGN") && wp.getId()
|
|
|
+ .endsWith("FDC_STA")).collect(Collectors.toList());
|
|
|
+ for (ProBasicPowerstation powerstation : sxfdcy) {
|
|
|
+ sxcyfdzjrl += powerstation.getJrwindCapacity();
|
|
|
+ sxcyfdcsl = sxfdcy.size();
|
|
|
+ }
|
|
|
+ List<ProBasicPowerstation> sxgfcy = wpls.stream().filter(wp -> wp.getRegionId().equals("SXJ_RGN") && wp.getId()
|
|
|
+ .endsWith("GDC_STA")).collect(Collectors.toList());
|
|
|
+ for (ProBasicPowerstation powerstation : sxgfcy) {
|
|
|
+ sxcygfzjrl += powerstation.getJrCapacity();
|
|
|
+ sxcygfcsl = sxgfcy.size();
|
|
|
+ }
|
|
|
+
|
|
|
+ //山西公司
|
|
|
+ List<ProBasicPowerstation> sxfdgs = wpls.stream().filter(wp -> wp.getRegionId().equals("SXJ_RGN") && wp.getId()
|
|
|
+ .endsWith("FDC_STA") && wp.getCompanyId().endsWith("SXJ_KGDL_FLFD_ZGS")).collect(Collectors.toList());
|
|
|
+ for (ProBasicPowerstation powerstation : sxfdgs) {
|
|
|
+ sxgsfdzjrl += powerstation.getJrwindCapacity();
|
|
|
+ sxgsfdcsl = sxfdgs.size();
|
|
|
+ }
|
|
|
+
|
|
|
+ List<ProBasicPowerstation> sxgfgs = wpls.stream().filter(wp -> wp.getRegionId().equals("SXJ_RGN") && wp.getId()
|
|
|
+ .endsWith("GDC_STA") && wp.getCompanyId().endsWith("SXJ_KGDL_GFFD_ZGS")).collect(Collectors.toList());
|
|
|
+ for (ProBasicPowerstation powerstation : sxgfgs) {
|
|
|
+ sxgsgfzjrl += powerstation.getJrCapacity();
|
|
|
+ sxgsgfcsl = sxgfgs.size();
|
|
|
+ }
|
|
|
+
|
|
|
+ sxqyxx.put("sxcyzzjrl", (sxcyfdzjrl + sxcygfzjrl) / 1000);
|
|
|
+ sxqyxx.put("sxcyfdzjrl", sxcyfdzjrl / 1000);
|
|
|
+ sxqyxx.put("sxcyfdcsl", StringUtils.round(sxcyfdcsl, 0));
|
|
|
+ sxqyxx.put("sxcygfzjrl", sxcygfzjrl / 1000);
|
|
|
+ sxqyxx.put("sxcygfcsl", sxcygfcsl);
|
|
|
+
|
|
|
+ sxqyxx.put("sxgszzjrl", (sxgsfdzjrl + sxgsgfzjrl) / 1000);
|
|
|
+ sxqyxx.put("sxgsfdzjrl", sxgsfdzjrl / 1000);
|
|
|
+ sxqyxx.put("sxgsfdcsl", StringUtils.round(sxgsfdcsl, 0));
|
|
|
+ sxqyxx.put("sxgsgfzjrl", sxgsgfzjrl / 1000);
|
|
|
+ sxqyxx.put("sxgsgfcsl", StringUtils.round(sxgsgfcsl, 0));
|
|
|
+ sytc.put("sxqyxx", sxqyxx);
|
|
|
+
|
|
|
+ //内蒙产业
|
|
|
+ List<ProBasicPowerstation> nmfdcy = wpls.stream().filter(wp -> wp.getRegionId().equals("NMM_RGN") && wp.getId()
|
|
|
+ .endsWith("FDC_STA")).collect(Collectors.toList());
|
|
|
+ for (ProBasicPowerstation powerstation : nmfdcy) {
|
|
|
+ nmcyfdzjrl += powerstation.getJrwindCapacity();
|
|
|
+ nmcyfdcsl = nmfdcy.size();
|
|
|
+ }
|
|
|
+
|
|
|
+ List<ProBasicPowerstation> nmgfcy = wpls.stream().filter(wp -> wp.getRegionId().equals("NMM_RGN") && wp.getId()
|
|
|
+ .endsWith("GDC_STA")).collect(Collectors.toList());
|
|
|
+ for (ProBasicPowerstation powerstation : nmgfcy) {
|
|
|
+ nmcygfzjrl += powerstation.getJrCapacity();
|
|
|
+ nmcygfcsl = nmgfcy.size();
|
|
|
+ }
|
|
|
+
|
|
|
+ //内蒙公司
|
|
|
+ List<ProBasicPowerstation> nmfdgs = wpls.stream().filter(wp -> wp.getRegionId().equals("NMM_RGN") && wp.getId()
|
|
|
+ .endsWith("FDC_STA") && wp.getCompanyId().endsWith("NMM_KGDL_QH_ZGS")).collect(Collectors.toList());
|
|
|
+ for (ProBasicPowerstation powerstation : nmfdgs) {
|
|
|
+ nmgsfdzjrl += powerstation.getJrwindCapacity();
|
|
|
+ nmgsfdcsl = nmfdgs.size();
|
|
|
+ }
|
|
|
+
|
|
|
+ List<ProBasicPowerstation> nmgfgs = wpls.stream().filter(wp -> wp.getRegionId().equals("NMM_RGN") && wp.getId()
|
|
|
+ .endsWith("GDC_STA") && wp.getCompanyId().endsWith("NMM_KGDL_QH_ZGS")).collect(Collectors.toList());
|
|
|
+ for (ProBasicPowerstation powerstation : nmgfgs) {
|
|
|
+ nmgsgfzjrl += powerstation.getJrCapacity();
|
|
|
+ nmgsgfcsl = nmgfgs.size();
|
|
|
+ }
|
|
|
+
|
|
|
+ nmqyxx.put("nmcyzzjrl", (nmcyfdzjrl + nmcygfzjrl) / 1000);
|
|
|
+ nmqyxx.put("nmcyfdzjrl", nmcyfdzjrl / 1000);
|
|
|
+ nmqyxx.put("nmcyfdcsl", StringUtils.round(nmcyfdcsl, 0));
|
|
|
+ nmqyxx.put("nmcygfzjrl", nmcygfzjrl / 1000);
|
|
|
+ nmqyxx.put("nmcygfcsl", nmcygfcsl);
|
|
|
+
|
|
|
+ nmqyxx.put("nmgszzjrl", (nmgsfdzjrl + nmgsgfzjrl) / 1000);
|
|
|
+ nmqyxx.put("nmgsfdzjrl", nmgsfdzjrl / 1000);
|
|
|
+ nmqyxx.put("nmgsfdcsl", StringUtils.round(nmgsfdcsl, 0));
|
|
|
+ nmqyxx.put("nmgsgfzjrl", nmgsgfzjrl / 1000);
|
|
|
+ nmqyxx.put("nmgsgfcsl", StringUtils.round(nmgsgfcsl, 0));
|
|
|
+ sytc.put("nmqyxx", nmqyxx);
|
|
|
+
|
|
|
+
|
|
|
+ //新疆产业
|
|
|
+ List<ProBasicPowerstation> xjfdcy = wpls.stream().filter(wp -> wp.getRegionId().equals("XJX_RGN") && wp.getId()
|
|
|
+ .endsWith("FDC_STA")).collect(Collectors.toList());
|
|
|
+ for (ProBasicPowerstation powerstation : xjfdcy) {
|
|
|
+ xjcyfdzjrl += powerstation.getJrwindCapacity();
|
|
|
+ xjcyfdcsl = xjfdcy.size();
|
|
|
+ }
|
|
|
+
|
|
|
+ List<ProBasicPowerstation> xjgfcy = wpls.stream().filter(wp -> wp.getRegionId().equals("XJX_RGN") && wp.getId()
|
|
|
+ .endsWith("GDC_STA")).collect(Collectors.toList());
|
|
|
+ for (ProBasicPowerstation powerstation : xjgfcy) {
|
|
|
+ xjcygfzjrl += powerstation.getJrCapacity();
|
|
|
+ xjcygfcsl = xjgfcy.size();
|
|
|
+ }
|
|
|
+
|
|
|
+ xjqyxx.put("xjcyzzjrl", (xjcyfdzjrl + xjcygfzjrl) / 1000);
|
|
|
+ xjqyxx.put("xjcyfdzjrl", xjcyfdzjrl / 1000);
|
|
|
+ xjqyxx.put("xjcyfdcsl", StringUtils.round(xjcyfdcsl, 0));
|
|
|
+ xjqyxx.put("xjcygfzjrl", xjcygfzjrl / 1000);
|
|
|
+ xjqyxx.put("xjcygfcsl", xjcygfcsl);
|
|
|
+ sytc.put("xjqyxx", xjqyxx);
|
|
|
+
|
|
|
+
|
|
|
+ //河北产业
|
|
|
+ List<ProBasicPowerstation> hbfdcy = wpls.stream().filter(wp -> wp.getRegionId().equals("HBJ_RGN") && wp.getId()
|
|
|
+ .endsWith("FDC_STA")).collect(Collectors.toList());
|
|
|
+ for (ProBasicPowerstation powerstation : hbfdcy) {
|
|
|
+ hbcyfdzjrl += powerstation.getJrwindCapacity();
|
|
|
+ hbcyfdcsl = hbfdcy.size();
|
|
|
+ }
|
|
|
+
|
|
|
+ List<ProBasicPowerstation> hbgfcy = wpls.stream().filter(wp -> wp.getRegionId().equals("HBJ_RGN") && wp.getId()
|
|
|
+ .endsWith("GDC_STA")).collect(Collectors.toList());
|
|
|
+ for (ProBasicPowerstation powerstation : hbgfcy) {
|
|
|
+ hbcygfzjrl += powerstation.getJrCapacity();
|
|
|
+ hbcygfcsl = hbgfcy.size();
|
|
|
+ }
|
|
|
+
|
|
|
+ hbqyxx.put("hbcyzzjrl", (hbcyfdzjrl + hbcygfzjrl) / 1000);
|
|
|
+ hbqyxx.put("hbcyfdzjrl", hbcyfdzjrl / 1000);
|
|
|
+ hbqyxx.put("hbcyfdcsl", StringUtils.round(hbcyfdcsl, 0));
|
|
|
+ hbqyxx.put("hbcygfzjrl", hbcygfzjrl / 1000);
|
|
|
+ hbqyxx.put("hbcygfcsl", hbcygfcsl);
|
|
|
+ sytc.put("hbqyxx", hbqyxx);
|
|
|
+
|
|
|
+ //陕西产业
|
|
|
+ List<ProBasicPowerstation> xsfdcy = wpls.stream().filter(wp -> wp.getRegionId().equals("SXS_RGN") && wp.getId()
|
|
|
+ .endsWith("FDC_STA")).collect(Collectors.toList());
|
|
|
+ for (ProBasicPowerstation powerstation : xsfdcy) {
|
|
|
+ xscyfdzjrl += powerstation.getJrwindCapacity();
|
|
|
+ xscyfdcsl = xsfdcy.size();
|
|
|
+ }
|
|
|
+
|
|
|
+ List<ProBasicPowerstation> xsgfcy = wpls.stream().filter(wp -> wp.getRegionId().equals("SXS_RGN") && wp.getId()
|
|
|
+ .endsWith("GDC_STA")).collect(Collectors.toList());
|
|
|
+ for (ProBasicPowerstation powerstation : xsgfcy) {
|
|
|
+ xscygfzjrl += powerstation.getJrCapacity();
|
|
|
+ xscygfcsl = xsgfcy.size();
|
|
|
+ }
|
|
|
+
|
|
|
+ xsqyxx.put("xscyzzjrl", (xscyfdzjrl + xscygfzjrl) / 1000);
|
|
|
+ xsqyxx.put("xscyfdzjrl", xscyfdzjrl / 1000);
|
|
|
+ xsqyxx.put("xscyfdcsl", StringUtils.round(xscyfdcsl, 0));
|
|
|
+ xsqyxx.put("xscygfzjrl", xscygfzjrl / 1000);
|
|
|
+ xsqyxx.put("xscygfcsl", xscygfcsl);
|
|
|
+ sytc.put("xsqyxx", xsqyxx);
|
|
|
+
|
|
|
+ //山东产业
|
|
|
+ List<ProBasicPowerstation> sdfdcy = wpls.stream().filter(wp -> wp.getRegionId().equals("SDL_RGN") && wp.getId()
|
|
|
+ .endsWith("FDC_STA")).collect(Collectors.toList());
|
|
|
+ for (ProBasicPowerstation powerstation : sdfdcy) {
|
|
|
+ sdcyfdzjrl += powerstation.getJrwindCapacity();
|
|
|
+ sdcyfdcsl = sdfdcy.size();
|
|
|
+ }
|
|
|
+
|
|
|
+ List<ProBasicPowerstation> sdgfcy = wpls.stream().filter(wp -> wp.getRegionId().equals("SDL_RGN") && wp.getId()
|
|
|
+ .endsWith("GDC_STA")).collect(Collectors.toList());
|
|
|
+ for (ProBasicPowerstation powerstation : sdgfcy) {
|
|
|
+ sdcygfzjrl += powerstation.getJrCapacity();
|
|
|
+ sdcygfcsl = sdgfcy.size();
|
|
|
+ }
|
|
|
+
|
|
|
+ sdqyxx.put("sdcyzzjrl", (sdcyfdzjrl + sdcygfzjrl) / 1000);
|
|
|
+ sdqyxx.put("sdcyfdzjrl", sdcyfdzjrl / 1000);
|
|
|
+ sdqyxx.put("sdcyfdcsl", StringUtils.round(sdcyfdcsl, 0));
|
|
|
+ sdqyxx.put("sdcygfzjrl", sdcygfzjrl / 1000);
|
|
|
+ sdqyxx.put("sdcygfcsl", sdcygfcsl);
|
|
|
+ sytc.put("sdqyxx", sdqyxx);
|
|
|
+
|
|
|
+
|
|
|
+ //西藏产业
|
|
|
+ List<ProBasicPowerstation> xzfdcy = wpls.stream().filter(wp -> wp.getRegionId().equals("XZZ_RGN") && wp.getId()
|
|
|
+ .endsWith("FDC_STA")).collect(Collectors.toList());
|
|
|
+ for (ProBasicPowerstation powerstation : xzfdcy) {
|
|
|
+ xzcyfdzjrl += powerstation.getJrwindCapacity();
|
|
|
+ xzcyfdcsl = xzfdcy.size();
|
|
|
+ }
|
|
|
+
|
|
|
+ List<ProBasicPowerstation> xzgfcy = wpls.stream().filter(wp -> wp.getRegionId().equals("XZZ_RGN") && wp.getId()
|
|
|
+ .endsWith("GDC_STA")).collect(Collectors.toList());
|
|
|
+ for (ProBasicPowerstation powerstation : xzgfcy) {
|
|
|
+ xzcygfzjrl += powerstation.getJrCapacity();
|
|
|
+ xzcygfcsl = xzgfcy.size();
|
|
|
+ }
|
|
|
+
|
|
|
+ xzqyxx.put("xzcyzzjrl", (xzcyfdzjrl + xzcygfzjrl) / 1000);
|
|
|
+ xzqyxx.put("xzcyfdzjrl", xzcyfdzjrl / 1000);
|
|
|
+ xzqyxx.put("xzcyfdcsl", StringUtils.round(xzcyfdcsl, 0));
|
|
|
+ xzqyxx.put("xzcygfzjrl", xzcygfzjrl / 1000);
|
|
|
+ xzqyxx.put("xzcygfcsl", xzcygfcsl);
|
|
|
+ sytc.put("xzqyxx", xzqyxx);
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ map.put("sytc", sytc);
|
|
|
+
|
|
|
+ /**********************************************首页弹窗**********************************************************/
|
|
|
+
|
|
|
+
|
|
|
+ /**********************************************首页清洁能源公司以及系统接入信息展示**********************************************************/
|
|
|
+
|
|
|
+ List<ProBasicCompany> cplist = CacheContext.companyList;
|
|
|
+ double qjny_fd_zjrl = 0;
|
|
|
+ double qjny_gf_zjrl = 0;
|
|
|
+ double qjny_fcts = 0;
|
|
|
+ double qjny_gfts = 0;
|
|
|
+ double qjny_fj_ts = 0;
|
|
|
+ double qjny_gf_zcts = 0;
|
|
|
+ double qjny_gf_jzts = 0;
|
|
|
+
|
|
|
+ double jr_fd_zjrl = 0;
|
|
|
+ double jr_gf_zjrl = 0;
|
|
|
+ double jr_fcts = 0;
|
|
|
+ double jr_gfts = 0;
|
|
|
+ double jr_fj_ts = 0;
|
|
|
+ double jr_gf_zcts = 0;
|
|
|
+ double jr_gf_jzts = 0;
|
|
|
+ if (!cplist.isEmpty()) {
|
|
|
+// ProBasicCompany pg = cplist.get(0);
|
|
|
+ for (ProBasicCompany pg : cplist) {
|
|
|
+
|
|
|
+ //清洁能源风电装机容量
|
|
|
+ qjny_fd_zjrl += null != pg.getWindCapacity() ? pg.getWindCapacity() : 0.0;
|
|
|
+ //清洁能源光伏装机容量
|
|
|
+ qjny_gf_zjrl += null != pg.getCapacity() ? pg.getCapacity() : 0.0;
|
|
|
+ //接入风电装机容量
|
|
|
+ jr_fd_zjrl += null != pg.getWindCapacity() ? pg.getWindCapacity() : 0.0;
|
|
|
+ //接入光伏装机容量
|
|
|
+ jr_gf_zjrl += null != pg.getJrCapacity() ? pg.getJrCapacity() : 0.0;
|
|
|
+ //清洁能源风场数量
|
|
|
+ qjny_fcts += null != pg.getWindNumber() ? pg.getWindNumber() : 0.0;
|
|
|
+ //清洁能源光伏电站数量
|
|
|
+ qjny_gfts += null != pg.getNumber() ? pg.getNumber() : 0.0;
|
|
|
+ //接入风场数量
|
|
|
+ jr_fcts += null != pg.getJrWindNumber() ? pg.getJrWindNumber() : 0.0;
|
|
|
+ //接入光伏电站数量
|
|
|
+ jr_gfts += null != pg.getJrNumber() ? pg.getJrNumber() : 0.0;
|
|
|
+ //清洁能源风机数量
|
|
|
+ qjny_fj_ts += null != pg.getWindQuantityLd() ? pg.getWindQuantityLd() : 0.0;
|
|
|
+ //清洁能源光伏组串数量
|
|
|
+ qjny_gf_zcts += null != pg.getQuantityZc() ? pg.getQuantityZc() : 0.0;
|
|
|
+ //清洁能源光伏集中数量
|
|
|
+ qjny_gf_jzts += null != pg.getQuantityJz() ? pg.getQuantityJz() : 0.0;
|
|
|
+ //接入风机数量
|
|
|
+ jr_fj_ts += null != pg.getJrwindQuantityLd() ? pg.getJrwindQuantityLd() : 0.0;
|
|
|
+ //接入光伏组串数量
|
|
|
+ jr_gf_zcts += null != pg.getJrquantityZc() ? pg.getJrquantityZc() : 0.0;
|
|
|
+ //接入光伏集中数量
|
|
|
+ jr_gf_jzts += null != pg.getJrquantityJz() ? pg.getJrquantityJz() : 0.0;
|
|
|
+
|
|
|
+ }
|
|
|
+ }
|
|
|
+ Map<String, Double> cblpoint = new LinkedHashMap<>();
|
|
|
+ cblpoint.put("qjny_fd_zjrl", StringUtils.round(qjny_fd_zjrl, 2));
|
|
|
+ cblpoint.put("qjny_gf_zjrl", StringUtils.round(qjny_gf_zjrl, 2));
|
|
|
+ cblpoint.put("qjny_zzjrl", StringUtils.round(qjny_gf_zjrl + qjny_fd_zjrl, 2));
|
|
|
+ cblpoint.put("jr_fd_zjrl", StringUtils.round(jr_fd_zjrl, 2));
|
|
|
+ cblpoint.put("jr_gf_zjrl", StringUtils.round(jr_gf_zjrl, 2));
|
|
|
+ cblpoint.put("jr_zzjrl", StringUtils.round(jr_gf_zjrl + jr_fd_zjrl, 2));
|
|
|
+ cblpoint.put("qjny_fcts", StringUtils.round(qjny_fcts, 2));
|
|
|
+ cblpoint.put("qjny_gfts", StringUtils.round(qjny_gfts, 2));
|
|
|
+ cblpoint.put("jr_fcts", StringUtils.round(jr_fcts, 2));
|
|
|
+ cblpoint.put("jr_gfts", StringUtils.round(jr_gfts, 2));
|
|
|
+ cblpoint.put("qjny_fj_ts", StringUtils.round(qjny_fj_ts, 2));
|
|
|
+ cblpoint.put("qjny_gf_zcts", StringUtils.round(qjny_gf_zcts, 2));
|
|
|
+ cblpoint.put("qjny_gf_jzts", StringUtils.round(qjny_gf_jzts, 2));
|
|
|
+ cblpoint.put("jr_fj_ts", StringUtils.round(jr_fj_ts, 2));
|
|
|
+ cblpoint.put("jr_gf_zcts", StringUtils.round(jr_gf_zcts, 2));
|
|
|
+ cblpoint.put("jr_gf_jzts", StringUtils.round(jr_gf_jzts, 2));
|
|
|
+
|
|
|
+ map.put("cblpoint", cblpoint);
|
|
|
+
|
|
|
+ /**********************************************首页清洁能源公司以及系统接入信息展示**********************************************************/
|
|
|
+
|
|
|
+
|
|
|
+ }
|
|
|
+ return map;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ /**********************************************计划电量统计**********************************************************/
|
|
|
+ private void setPlanInfoByType
|
|
|
+ (Map<String, Map<String, Double>> gxkmap, List<ProBasicProjectPlan> planls, String wpId) {
|
|
|
+
|
|
|
+ double yfdljh = 0.0;
|
|
|
+ double yfdlsj = 0.0;
|
|
|
+ double nfdljh = 0.0;
|
|
|
+ double nfdlsj = 0.0;
|
|
|
+
|
|
|
+ Calendar cal = Calendar.getInstance();
|
|
|
+ cal.setTime(new Date());
|
|
|
+ int month = cal.get(Calendar.MONTH) + 1;
|
|
|
+
|
|
|
+
|
|
|
+ for (ProBasicProjectPlan plan : planls) {
|
|
|
+
|
|
|
+ double fdl = null != plan.getGeneratingCapacity() ? Double.valueOf(plan.getGeneratingCapacity()) : 0.0;
|
|
|
+
|
|
|
+ double sjfdl = null != plan.getOutageHours() ? Double.valueOf(plan.getOutageHours()) : 0.0;
|
|
|
+
|
|
|
+
|
|
|
+ if (gxkmap.containsKey(plan.getWindpowerstationId())) {
|
|
|
+
|
|
|
+ Map<String, Double> map = gxkmap.get(plan.getWindpowerstationId());
|
|
|
+ if (StringUtils.notEmp(plan.getMonth())) {
|
|
|
+ int planmonth = Integer.valueOf(plan.getMonth());
|
|
|
+ if (planmonth == month) {
|
|
|
+
|
|
|
+ yfdljh = map.get("yfdljh");
|
|
|
+ yfdlsj = map.get("yfdlsj");
|
|
|
+
|
|
|
+ yfdljh = yfdljh + fdl;
|
|
|
+ yfdlsj = yfdlsj + sjfdl;
|
|
|
+
|
|
|
+ map.put("yfdljh", yfdljh);
|
|
|
+ map.put("yfdlsj", yfdlsj);
|
|
|
+ }
|
|
|
+
|
|
|
+ nfdljh = map.get("nfdljh");
|
|
|
+ nfdlsj = map.get("nfdlsj");
|
|
|
+ nfdlsj = nfdlsj + sjfdl;
|
|
|
+ nfdljh = nfdljh + Double.parseDouble(plan.getGeneratingCapacity());
|
|
|
+ map.put("nfdljh", nfdljh);
|
|
|
+ map.put("nfdlsj", nfdlsj);
|
|
|
+
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ Map<String, Double> map = new HashMap<>();
|
|
|
+
|
|
|
+ if (StringUtils.notEmp(plan.getMonth())) {
|
|
|
+ int planmonth = Integer.valueOf(plan.getMonth());
|
|
|
+ if (planmonth == month) {
|
|
|
+
|
|
|
+ map.put("yfdljh", fdl);
|
|
|
+ map.put("yfdlsj", sjfdl);
|
|
|
+ map.put("nfdljh", 0.00);
|
|
|
+ map.put("nfdlsj", 0.00);
|
|
|
+ } else {
|
|
|
+ map.put("nfdljh", fdl);
|
|
|
+ map.put("nfdlsj", sjfdl);
|
|
|
+ map.put("yfdljh", 0.00);
|
|
|
+ map.put("yfdlsj", 0.00);
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ }
|
|
|
+ gxkmap.put(plan.getWindpowerstationId(), map);
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+ }
|
|
|
+ /**********************************************计划电量统计**********************************************************/
|
|
|
+}
|