ソースを参照

增加首页功能,其它bug修复

wangb 2 年 前
コミット
9330c3b87a

+ 4 - 1
web/monitor-web-sxjn/src/main/java/com/gyee/frame/util/MathUtil.java

@@ -13,7 +13,10 @@ public class MathUtil {
 	public static Double twoBit(Double dd) {
 		if (dd == null) {
 			return dd;
-		} else {
+		}else if (Double.isNaN(dd) || Double.isInfinite(dd)) {
+			return 0.0;
+		}
+		else {
 			BigDecimal decimal = new BigDecimal(dd);
 			decimal = decimal.setScale(2, BigDecimal.ROUND_HALF_UP);
 			return decimal.doubleValue();

+ 3 - 1
web/monitor-web-sxjn/src/main/java/com/gyee/frame/util/golden/EdosUtil.java

@@ -27,6 +27,8 @@ public class EdosUtil implements IRealTimeDataBaseUtil {
 
     private final String FSGF="FSGFJSFW.";
     private final String JRGF="JRGFJSFW.";
+    private final String GFFZGLYC ="GF-FZ-GLYC.";
+    private final String GFFSGLYC ="GF-FS-GLYC.";
 
     private RestTemplate restTemplate =new RestTemplate();
 
@@ -829,7 +831,7 @@ public class EdosUtil implements IRealTimeDataBaseUtil {
         if(StringUtils.notEmp(pointids) && !pointids.isEmpty() )
         {
 
-            if(!pointids.get(0).startsWith(FSGF) && !pointids.get(0).startsWith(JRGF))
+            if(!pointids.get(0).startsWith(FSGF) && !pointids.get(0).startsWith(JRGF) && !pointids.get(0).startsWith(GFFZGLYC))
             {
                 baseURL = V2Config.getBaseurl();
             }else

+ 50 - 0
web/runeconomy-xk/src/main/java/com/gyee/runeconomy/controller/monitor/MonitorController.java

@@ -0,0 +1,50 @@
+package com.gyee.runeconomy.controller.monitor;
+
+import com.gyee.runeconomy.dto.AjaxResult;
+import com.gyee.runeconomy.service.monitor.MonitorService;
+import com.gyee.runeconomy.util.realtimesource.IEdosUtil;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiImplicitParam;
+import io.swagger.annotations.ApiImplicitParams;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Controller;
+import org.springframework.web.bind.annotation.*;
+
+import javax.annotation.Resource;
+import java.util.HashMap;
+import java.util.Map;
+
+/**
+ * 监视中心首页
+ */
+
+@Controller
+@RequestMapping("/cockpit")
+@Api(value = "驾驶舱", tags = "驾驶舱")
+
+public class MonitorController {
+    @Autowired
+    private MonitorService monitorService;
+
+    @GetMapping("/monitor")
+    @ResponseBody
+    @ApiOperation(value = "首页", notes = "首页")
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "wpId", value = "场站编号", required = true, dataType = "string", paramType = "query")})
+
+    public AjaxResult getinformation(String wpId) throws Exception {
+
+        Map<String, String> map = new HashMap<>();
+        if (!wpId.isEmpty()) {
+            map = monitorService.getcockpit(wpId);
+        }
+        if (null != map) {
+            return AjaxResult.successData(200, map);
+        } else {
+            return AjaxResult.error(500, "操作失败");
+        }
+
+    }
+
+}

+ 142 - 6
web/runeconomy-xk/src/main/java/com/gyee/runeconomy/init/CacheContext.java

@@ -4,13 +4,12 @@ package com.gyee.runeconomy.init;
 import com.alibaba.fastjson.JSONObject;
 import com.alibaba.fastjson.TypeReference;
 import com.gyee.common.model.StringUtils;
-import com.gyee.runeconomy.service.realtimelibrary.TheoreticalPowerService;
-import com.gyee.runeconomy.util.redis.RedisService;
 import com.gyee.runeconomy.model.auto.*;
 import com.gyee.runeconomy.service.auto.*;
+import com.gyee.runeconomy.service.realtimelibrary.TheoreticalPowerService;
+import com.gyee.runeconomy.util.redis.RedisService;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
-import org.springframework.beans.factory.annotation.Value;
 import org.springframework.boot.CommandLineRunner;
 import org.springframework.stereotype.Component;
 
@@ -28,6 +27,8 @@ import java.util.stream.Collectors;
 public class CacheContext implements CommandLineRunner {
     Logger logger = LoggerFactory.getLogger(CacheContext.class);
 
+    private final String QS = "0";
+
     @Resource
     private IProBasicEquipmentService proBasicEquipmentService;
     @Resource
@@ -64,6 +65,12 @@ public class CacheContext implements CommandLineRunner {
     @Resource
     private IProBasicModelPowerRdService proBasicModelPowerRdService;
 
+    @Resource
+    private IProBasicPowerstationPointService proBasicPowerstationPointService;
+
+    @Resource
+    private IProBasicEquipmentPointService proBasicEquipmentPointService;
+
     public static List<ProBasicEquipment> wtls = new ArrayList<>();
     public static List<ProBasicProject> pjls = new ArrayList<>();
     public static List<ProBasicLine>  lnls = new ArrayList<>();
@@ -71,15 +78,22 @@ public class CacheContext implements CommandLineRunner {
     public static List<ProBasicWeatherStation>  weawpls = new ArrayList<>();
     public static List<ProBasicSquare> sqls = new ArrayList<>();
     public static List<ProBasicPowerstation>  wpls = new ArrayList<>();
+    public static List<ProBasicPowerstation>  wplsf = new ArrayList<>();
+    public static List<ProBasicPowerstation>  wplsG = new ArrayList<>(); //光电集合
     public static List<ProBasicPowerstation>  zwpls = new ArrayList<>();
     public static List<ProBasicCompany>  cpls = new ArrayList<>();
+    public static List<ProBasicCompany>  companyList = new ArrayList<>();
     public static List<ProBasicRegion>  rgls = new ArrayList<>();
+    public static List<ProBasicPowerstationPoint> powerpointls = new ArrayList<>();
+    public static List<ProBasicEquipmentPoint> Equipmentpointls = new ArrayList<>();
     public static Map<String,ProBasicProject> pjmap = new HashMap<>();
     public static Map<String,ProBasicLine> lnmap = new HashMap<>();
     public static Map<String,ProBasicRegion> rgmap = new HashMap<>();
     public static Map<String,ProBasicCompany> cpmap = new HashMap<>();
 
     public static Map<String,List<ProBasicPowerstation>> cpwpmap = new HashMap<>();
+    public static Map<String,List<ProBasicPowerstation>> wpmapls = new HashMap<>();
+    public static Map<String,List<ProBasicPowerstation>> stationls = new HashMap<>();
 
     public static Map<String,List<ProBasicCompany>> rgcpmap = new HashMap<>();
     public static Map<String,ProBasicSquare> sqmap = new HashMap<>();
@@ -87,6 +101,7 @@ public class CacheContext implements CommandLineRunner {
     public static List<ProBasicMeterPoint>  meterpoints = new ArrayList<>();
     public static Map<String,ProBasicMeterPoint>  meterpointMap = new HashMap<>();
     public static Map<String,List<ProBasicProject>> wppromap = new HashMap<>();
+    public static Map<String,List<ProBasicProject>> projmap = new HashMap<>();
     public static Map<String,List<ProBasicLine>> prolinemap = new HashMap<>();
     public static Map<String,List<ProBasicEquipment>> wpwtmap = new HashMap<>();
     public static Map<String,List<ProBasicEquipment>> pjwtmap = new HashMap<>();
@@ -96,9 +111,13 @@ public class CacheContext implements CommandLineRunner {
     public static Map<String,Map<String,ProBasicEquipment>> cmwtmap = new HashMap<>();
     public static Map<String,List<ProBasicEquipment>> sqwtmap = new HashMap<>();
     public static Map<String, Map<String, ProBasicEquipmentPoint>> wtpAimap = new HashMap<>();// 风电机测点AI表
+    public static Map<String, Map<String, ProBasicEquipmentPoint>> wtpointmap = new HashMap<>();//
     public static Map<String,Map<String, ProBasicPowerstationPoint>> linepointmap =new HashMap<>();
+    public static Map<String,Map<String, ProBasicPowerstationPoint>> lnPointmap =new HashMap<>();
     public static Map<String,Map<String, ProBasicPowerstationPoint>> propointmap =new HashMap<>();
+    public static Map<String,Map<String, ProBasicPowerstationPoint>> pjPointmap =new HashMap<>();
     public static Map<String,Map<String, ProBasicPowerstationPoint>> wppointmap =new HashMap<>();
+    public static Map<String,Map<String, ProBasicPowerstationPoint>> pointwpmap =new HashMap<>();
     public static Map<String,Map<String, ProBasicPowerstationPoint>> subwppointmap =new HashMap<>();
     public static Map<String,Map<String, ProBasicPowerstationPoint>> weatherwppointmap =new HashMap<>();
     public static Map<String,Map<String, ProBasicPowerstationPoint>> companypointmap =new HashMap<>();
@@ -196,6 +215,9 @@ public class CacheContext implements CommandLineRunner {
 
 
         rgls=proBasicRegionService.list().stream().filter(i->i.getIsAble()==1).collect(Collectors.toList());
+        companyList = proBasicCompanyService.list().stream().filter (i->i.getId().equals("SXJ_KGDL_FLFD_ZGS") || i.getId().equals("SXJ_KGDL_GFFD_ZGS")
+                || i.getId().equals("NMM_KGDL_QH_ZGS")).collect(Collectors.toList());
+
         if  (!rgls.isEmpty())
         {
             for(ProBasicRegion sq:rgls)
@@ -235,7 +257,16 @@ public class CacheContext implements CommandLineRunner {
             }
         }
 
-
+        for(ProBasicPowerstation wp:wpls)
+        {
+            if (cpwpmap.containsKey(wp.getCompanyId())){
+                cpwpmap.get(wp.getCompanyId()).add(wp);
+            }else {
+                List<ProBasicPowerstation> wps = new ArrayList<>();
+                wps.add(wp);
+                cpwpmap.put(wp.getCompanyId(),wps);
+            }
+        }
 
 
         wtls = proBasicEquipmentService.list().stream().filter(i->i.getIsable()==1).collect(Collectors.toList());
@@ -370,6 +401,7 @@ public class CacheContext implements CommandLineRunner {
             propointmap.put(p.getId(),stringWindpowerstationpointnewMap);
 
         });
+        projmap = pjls.stream().collect(Collectors.groupingBy(ProBasicProject::getWindpowerstationId));
 
         subwpls = proBasicSubStationService.list().stream().filter(i-> i.getIsAble()==1).collect(Collectors.toList());
         subwpls.stream().forEach(sub->{
@@ -394,8 +426,7 @@ public class CacheContext implements CommandLineRunner {
 
 
         });
-
-
+        //线路
         lnls = proBasicLineService.list().stream().filter(i-> StringUtils.isNotNull(pjmap.get(i.getProjectId())) && i.getIsAble()==1).collect(Collectors.toList());
         lnls.stream().forEach(l->{
             lnmap.put(l.getId(),l);
@@ -440,6 +471,111 @@ public class CacheContext implements CommandLineRunner {
             wppointmap.put(wp.getId(),stringMapMap);
         });
 
+        if (!wpls.isEmpty()) {
+            for (ProBasicPowerstation wp : wpls) {
+                if (wp.getId().endsWith("FDC_STA")) {
+                    wplsf.add(wp);
+                }
+                if (wp.getId().endsWith("GDC_STA")) {
+                    wplsG.add(wp);
+                }
+
+                if(wpmapls.containsKey(wp.getId()))
+                {
+                    List<ProBasicPowerstation> ls=wpmapls.get(wp.getId());
+                    ls.add(wp);
+                    wpmapls.put(wp.getId(),ls);
+                }else {
+                    List<ProBasicPowerstation> ls=new ArrayList<>();
+                    ls.add(wp);
+                    wpmapls.put(wp.getId(),ls);
+                }
+
+
+//                if(wp.getWindType().equals(-1) && wp.getWindType().equals(-2)){
+//                    List<ProBasicPowerstation> ls = stationls.get(wp.getWindType());
+//                    stationls.put(wp.getWindType()+QS,ls);
+//                }
+
+
+                wpmap.put(wp.getId(),wp);
+            }
+        }
+
+
+        Map<String,ProBasicPowerstationPoint> items=null;
+        powerpointls = proBasicPowerstationPointService.list().stream().filter(i ->i.getId() != null).collect(Collectors.toList());
+        if(powerpointls!=null && !powerpointls.isEmpty()){
+            for(int i=0;i<powerpointls.size();i++){
+
+                if(pjmap.containsKey(powerpointls.get(i).getWindpowerstationId()))
+                {
+                    ProBasicPowerstationPoint point=powerpointls.get(i);
+                    if(pjPointmap.containsKey(point.getWindpowerstationId())){
+                        items=pjPointmap.get(point.getWindpowerstationId());
+                        items.put(point.getUniformCode(), point);
+                    }
+                    else{
+                        items=new HashMap<String,ProBasicPowerstationPoint>();
+                        pjPointmap.put(point.getWindpowerstationId(), items);
+                        items.put(point.getUniformCode(), point);
+                    }
+                }else if(lnmap.containsKey(powerpointls.get(i).getWindpowerstationId()))
+                {
+                    ProBasicPowerstationPoint point=powerpointls.get(i);
+                    if(lnPointmap.containsKey(point.getWindpowerstationId())){
+                        items=lnPointmap.get(point.getWindpowerstationId());
+                        items.put(point.getUniformCode(), point);
+                    }
+                    else{
+                        items=new HashMap<String,ProBasicPowerstationPoint>();
+                        lnPointmap.put(point.getWindpowerstationId(), items);
+                        items.put(point.getUniformCode(), point);
+                    }
+                }else
+                {
+                    ProBasicPowerstationPoint point = powerpointls.get(i);
+                    if(pointwpmap.containsKey(point.getWindpowerstationId())){
+                        items=pointwpmap.get(point.getWindpowerstationId());
+                        items.put(point.getUniformCode(), point);
+                    }
+                    else{
+                        items=new HashMap<String,ProBasicPowerstationPoint>();
+                        pointwpmap.put(point.getWindpowerstationId(), items);
+                        items.put(point.getUniformCode(), point);
+                    }
+                }
+            }
+        }
+
+
+
+
+        List<ProBasicEquipmentPoint> ls = new ArrayList<>();
+        for (ProBasicPowerstation wp : wpls){
+            if (wp.getId().endsWith("FDC_STA")){
+                Equipmentpointls = proBasicEquipmentPointService.list().stream().filter(i ->i.getId() != null).collect(Collectors.toList());
+                ls.addAll(Equipmentpointls);
+            }
+        }
+
+        if(ls != null && !ls.isEmpty()){
+            for(ProBasicEquipmentPoint mp : ls){
+
+                if(wtpointmap.containsKey(mp.getWindturbineId())){
+                    Map<String, ProBasicEquipmentPoint> map = wtpointmap.get(mp.getWindturbineId());
+                    map.put(mp.getUniformCode(), mp);
+                    wtpointmap.put(mp.getWindturbineId(), map);
+                }else{
+                    Map<String, ProBasicEquipmentPoint> map = new HashMap<String, ProBasicEquipmentPoint>();
+                    map.put(mp.getUniformCode(), mp);
+                    wtpointmap.put(mp.getWindturbineId(), map);
+                }
+            }
+        }
+
+
+
 
         String llglString = redisService.get("ZLLGL");
         theoreticalPowerMap = JSONObject.parseObject(llglString, new TypeReference<Map<String, Map<Double,ProBasicModelPowerRd>>>() {

+ 3 - 0
web/runeconomy-xk/src/main/java/com/gyee/runeconomy/service/auto/IProBasicEquipmentPointService.java

@@ -2,6 +2,7 @@ package com.gyee.runeconomy.service.auto;
 
 import com.gyee.runeconomy.model.auto.ProBasicEquipmentPoint;
 import com.baomidou.mybatisplus.extension.service.IService;
+import com.gyee.runeconomy.model.auto.ProBasicPowerstationPoint;
 
 /**
  * <p>
@@ -13,4 +14,6 @@ import com.baomidou.mybatisplus.extension.service.IService;
  */
 public interface IProBasicEquipmentPointService extends IService<ProBasicEquipmentPoint> {
 
+    public ProBasicEquipmentPoint getEquipmentPoint(String wpId, String uniformCode);
+
 }

+ 2 - 0
web/runeconomy-xk/src/main/java/com/gyee/runeconomy/service/auto/IProBasicPowerstationPointService.java

@@ -21,4 +21,6 @@ public interface IProBasicPowerstationPointService extends IService<ProBasicPowe
 
     List<ProBasicPowerstationPoint> getProBasicPowerstationPointList(String windpowerstationId,String uniformCode);
 
+    public ProBasicPowerstationPoint getPowerstationPoint(String wpId, String uniformCode);
+
 }

+ 4 - 1
web/runeconomy-xk/src/main/java/com/gyee/runeconomy/service/auto/IProBasicProjectPlanService.java

@@ -3,6 +3,8 @@ package com.gyee.runeconomy.service.auto;
 import com.gyee.runeconomy.model.auto.ProBasicProjectPlan;
 import com.baomidou.mybatisplus.extension.service.IService;
 
+import java.util.List;
+
 /**
  * <p>
  * 工程计划表 服务类
@@ -12,5 +14,6 @@ import com.baomidou.mybatisplus.extension.service.IService;
  * @since 2022-10-21
  */
 public interface IProBasicProjectPlanService extends IService<ProBasicProjectPlan> {
-
+    public List<ProBasicProjectPlan> getProjectPlanList(String year, String pageNum, String pageSize);
+    List<ProBasicProjectPlan> getList(String year);
 }

+ 24 - 0
web/runeconomy-xk/src/main/java/com/gyee/runeconomy/service/auto/impl/ProBasicEquipmentPointServiceImpl.java

@@ -1,11 +1,15 @@
 package com.gyee.runeconomy.service.auto.impl;
 
+import com.gyee.runeconomy.init.CacheContext;
 import com.gyee.runeconomy.model.auto.ProBasicEquipmentPoint;
 import com.gyee.runeconomy.mapper.auto.ProBasicEquipmentPointMapper;
 import com.gyee.runeconomy.service.auto.IProBasicEquipmentPointService;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.gyee.runeconomy.util.StringUtils;
 import org.springframework.stereotype.Service;
 
+import java.util.Map;
+
 /**
  * <p>
  * 设备测点 服务实现类
@@ -17,4 +21,24 @@ import org.springframework.stereotype.Service;
 @Service
 public class ProBasicEquipmentPointServiceImpl extends ServiceImpl<ProBasicEquipmentPointMapper, ProBasicEquipmentPoint> implements IProBasicEquipmentPointService {
 
+    @Override
+    public ProBasicEquipmentPoint getEquipmentPoint(String wpId, String uniformCode) {
+
+        ProBasicEquipmentPoint point=new ProBasicEquipmentPoint();
+        if(StringUtils.notEmp(wpId) && StringUtils.notEmp(uniformCode) )
+        {
+            if(CacheContext.wtmap.containsKey(wpId))
+            {
+                if(CacheContext.wtpointmap.containsKey(wpId))
+                {
+                    Map<String, ProBasicEquipmentPoint> map=CacheContext.wtpointmap.get(wpId);
+                    if(map.containsKey(uniformCode))
+                    {
+                        point=map.get(uniformCode);
+                    }
+                }
+            }
+        }
+        return  point;
+    }
 }

+ 45 - 0
web/runeconomy-xk/src/main/java/com/gyee/runeconomy/service/auto/impl/ProBasicPowerstationPointServiceImpl.java

@@ -2,6 +2,7 @@ package com.gyee.runeconomy.service.auto.impl;
 
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.gyee.common.model.StringUtils;
+import com.gyee.runeconomy.init.CacheContext;
 import com.gyee.runeconomy.model.auto.ProBasicPowerstationPoint;
 import com.gyee.runeconomy.mapper.auto.ProBasicPowerstationPointMapper;
 import com.gyee.runeconomy.service.auto.IProBasicPowerstationPointService;
@@ -9,6 +10,7 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import org.springframework.stereotype.Service;
 
 import java.util.List;
+import java.util.Map;
 
 /**
  * <p>
@@ -40,4 +42,47 @@ public class ProBasicPowerstationPointServiceImpl extends ServiceImpl<ProBasicPo
 
         return list;
     }
+
+    @Override
+    public ProBasicPowerstationPoint getPowerstationPoint(String wpId, String uniformCode)  {
+        ProBasicPowerstationPoint point=new ProBasicPowerstationPoint();
+
+        if(StringUtils.notEmp(wpId) && StringUtils.notEmp(uniformCode))
+        {
+            if(wpId.endsWith("0") || wpId.endsWith("-1") ||wpId.endsWith("-2") || CacheContext.wpmap.containsKey(wpId))
+            {
+                if(CacheContext.pointwpmap.containsKey(wpId))
+                {
+                    Map<String, ProBasicPowerstationPoint> map=CacheContext.pointwpmap.get(wpId);
+                    if(map.containsKey(uniformCode))
+                    {
+                        point=map.get(uniformCode);
+                    }
+                }
+            }else if(CacheContext.pjmap.containsKey(wpId))
+            {
+                if(CacheContext.pjPointmap.containsKey(wpId))
+                {
+                    Map<String, ProBasicPowerstationPoint> map=CacheContext.pjPointmap.get(wpId);
+                    if(map.containsKey(uniformCode))
+                    {
+                        point=map.get(uniformCode);
+                    }
+                }
+            }else if(CacheContext.lnmap.containsKey(wpId))
+            {
+                if(CacheContext.lnPointmap.containsKey(wpId))
+                {
+                    Map<String, ProBasicPowerstationPoint> map=CacheContext.lnPointmap.get(wpId);
+                    if(map.containsKey(uniformCode))
+                    {
+                        point=map.get(uniformCode);
+                    }
+                }
+            }
+        }
+
+
+        return point;
+    }
 }

+ 28 - 0
web/runeconomy-xk/src/main/java/com/gyee/runeconomy/service/auto/impl/ProBasicProjectPlanServiceImpl.java

@@ -1,11 +1,18 @@
 package com.gyee.runeconomy.service.auto.impl;
 
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.gyee.common.model.StringUtils;
+import com.gyee.common.util.SortUtils;
 import com.gyee.runeconomy.model.auto.ProBasicProjectPlan;
 import com.gyee.runeconomy.mapper.auto.ProBasicProjectPlanMapper;
 import com.gyee.runeconomy.service.auto.IProBasicProjectPlanService;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import org.springframework.stereotype.Service;
 
+import java.util.List;
+
 /**
  * <p>
  * 工程计划表 服务实现类
@@ -16,5 +23,26 @@ import org.springframework.stereotype.Service;
  */
 @Service
 public class ProBasicProjectPlanServiceImpl extends ServiceImpl<ProBasicProjectPlanMapper, ProBasicProjectPlan> implements IProBasicProjectPlanService {
+    @Override
+    public List<ProBasicProjectPlan> getProjectPlanList(String year, String pageNum, String pageSize) {
+        Page<ProBasicProjectPlan> page = new Page<>(Integer.parseInt(pageNum), Integer.parseInt(pageSize));
+        QueryWrapper<ProBasicProjectPlan> qw = new QueryWrapper<>();
+        if (com.gyee.common.model.StringUtils.isNotEmpty(year)) {
+            qw.lambda().eq(ProBasicProjectPlan::getYear, year);
+        }
+        IPage<ProBasicProjectPlan> ProBasicLine = getBaseMapper().selectPage(page, qw);
+        List<ProBasicProjectPlan> list = ProBasicLine.getRecords();
+        SortUtils.sort(list,"projectId",SortUtils.DESC);
+        return list;
+    }
 
+    @Override
+    public List<ProBasicProjectPlan> getList(String year) {
+        QueryWrapper<ProBasicProjectPlan> qw = new QueryWrapper<>();
+        if (StringUtils.isNotEmpty(year)){
+            qw.like("year",year);
+        }
+        List<ProBasicProjectPlan> list = baseMapper.selectList(qw);
+        return list;
+    }
 }

+ 754 - 0
web/runeconomy-xk/src/main/java/com/gyee/runeconomy/service/monitor/MonitorService.java

@@ -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);
+            }
+
+        }
+    }
+    /**********************************************计划电量统计**********************************************************/
+}

+ 124 - 0
web/runeconomy-xk/src/main/java/com/gyee/runeconomy/util/MathUtil.java

@@ -0,0 +1,124 @@
+package com.gyee.runeconomy.util;
+
+import java.math.BigDecimal;
+import java.util.Date;
+
+public class MathUtil {
+
+    // 截取小数点后两位
+    public static Double twoBit(Double dd) {
+        if (dd == null) {
+            return dd;
+        } else {
+            BigDecimal decimal = new BigDecimal(dd);
+            decimal = decimal.setScale(2, BigDecimal.ROUND_HALF_UP);
+            return decimal.doubleValue();
+        }
+    }
+
+    /**
+     * 格式化小数位数,四舍五入
+     *
+     * @param dd
+     * @param Scale
+     *            小数位数
+     * @return
+     */
+    public static Double decimal(Double dd, int Scale) {
+        return new BigDecimal(dd).setScale(Scale, BigDecimal.ROUND_HALF_UP)
+                .doubleValue();
+    }
+
+    /**
+     * 格式化小数位数,四舍五入
+     *
+     * @param dd
+     * @param Scale
+     *            小数位数
+     * @return 无格式字符串 ,末位去零
+     */
+    public static String plain(Double dd, int Scale) {
+        if (dd == 0) {
+            return "0";
+        } else {
+            return new BigDecimal(dd).setScale(Scale, BigDecimal.ROUND_HALF_UP)
+                    .stripTrailingZeros().toPlainString();
+        }
+    }
+
+    /**
+     * 字符串转Double
+     *
+     * @param value
+     * @return
+     */
+    public static Double getDouble(String value) {
+        return new BigDecimal(value).doubleValue();
+    }
+
+    /**
+     * 格式化小数位数,四舍五入
+     *
+     * @param dd
+     * @param Scale
+     *            小数位数
+     * @return
+     */
+    public static Float decimal(Float dd, int Scale) {
+        return new BigDecimal(dd).setScale(Scale, BigDecimal.ROUND_HALF_UP)
+                .floatValue();
+    }
+
+    /**
+     * 格式化小数位数,四舍五入
+     *
+     * @param dd
+     * @param Scale
+     *            小数位数
+     * @return 无格式字符串
+     */
+    public static String plain(Float dd, int Scale) {
+        return new BigDecimal(dd).setScale(Scale, BigDecimal.ROUND_HALF_UP)
+                .toPlainString();
+    }
+
+    /**
+     * 字符串转Float
+     *
+     * @param value
+     * @return
+     */
+    public static Float getFloat(String value) {
+        return new BigDecimal(value).floatValue();
+    }
+
+    /**
+     * 将10进制数转换成二进制数
+     */
+    public static String getBinaryString(Double value) {
+        return Integer.toBinaryString(value.intValue());
+    }
+
+    /**
+     * 在指定时间上加指定的小时
+     * @param date
+     * @param hour
+     * @return
+     */
+    public static Date addHours(Date date, double hour) {
+        return new Date(date.getTime() + (long) (hour * 3600 * 1000));
+    }
+
+    public static Integer toInt(String str) {
+        return Integer.parseInt(str);
+    }
+
+    public static Float toFloat(String str) {
+        return Float.parseFloat(str);
+    }
+
+    public static Double toDouble(String str) {
+        return Double.parseDouble(str);
+    }
+
+}

+ 1 - 1
web/runeconomy-xk/src/main/java/com/gyee/runeconomy/util/realtimesource/EdosUtil.java

@@ -28,7 +28,7 @@ import java.util.*;
 public class EdosUtil implements IEdosUtil {
 
     private RestTemplate restTemplate =new RestTemplate();
-    @Value("${db.url}")
+    @Value("${db.baseURL}")
     private String baseURL;
 
     @Value("${initialcode}")