Prechádzať zdrojové kódy

信控集控服务错误修改

shilin 2 rokov pred
rodič
commit
61341c0cea
14 zmenil súbory, kde vykonal 1949 pridanie a 702 odobranie
  1. 8 9
      realtime/generationXK-service/src/main/java/com/gyee/generation/GenerationMain.java
  2. 1 1
      realtime/generationXK-service/src/main/java/com/gyee/generation/service/EquipmentInfo2Service.java
  3. 1 1
      realtime/generationXK-service/src/main/java/com/gyee/generation/service/EquipmentInfo4Service.java
  4. 5 0
      realtime/generationXK-service/src/main/java/com/gyee/generation/service/EquipmentInfo5Service.java
  5. 1 1
      realtime/generationXK-service/src/main/java/com/gyee/generation/service/InputOrOutPutService.java
  6. 6 2
      realtime/generationXK-service/src/main/java/com/gyee/generation/service/LimitEventService.java
  7. 40 677
      realtime/generationXK-service/src/main/java/com/gyee/generation/service/LimitService.java
  8. 1600 0
      realtime/generationXK-service/src/main/java/com/gyee/generation/service/PowerCurveFittingByTimeService.java
  9. 4 1
      realtime/generationXK-service/src/main/java/com/gyee/generation/service/PowerCurveFittingService.java
  10. 5 1
      realtime/generationXK-service/src/main/java/com/gyee/generation/service/ShutdownService.java
  11. 5 0
      realtime/generationXK-service/src/main/java/com/gyee/generation/service/initialpoint/InitialPointGoldenXkByEqService.java
  12. 264 0
      realtime/generationXK-service/src/main/java/com/gyee/generation/task/SaticSchedulePgTask.java
  13. 8 8
      realtime/generationXK-service/src/main/resources/application-xk.yml
  14. 1 1
      realtime/generationXK-service/src/main/resources/application.yml

+ 8 - 9
realtime/generationXK-service/src/main/java/com/gyee/generation/GenerationMain.java

@@ -1,7 +1,6 @@
 package com.gyee.generation;
 
 import com.gyee.generation.service.initialpoint.InitialPointGoldenXkByEqService;
-import com.gyee.generation.service.initialpoint.InitialPointGoldenXkService;
 import com.gyee.generation.util.SpringUtils;
 import org.mybatis.spring.annotation.MapperScan;
 import org.springframework.boot.SpringApplication;
@@ -31,15 +30,15 @@ public class GenerationMain {
 //        InitialPointGoldenXkService.initalFc();
 //        System.out.println("结束导出风场测点。。。。。。");
 
-//        InitialPointGoldenXkByEqService initialPointGoldenXkByEqService= SpringUtils.getBean("initialPointGoldenXkByEqService");
-//
-//        System.out.println("开始导出风机测点。。。。。。");
-//        initialPointGoldenXkByEqService.initalFj();
-//        System.out.println("结束导出风机测点。。。。。。");
+        InitialPointGoldenXkByEqService initialPointGoldenXkByEqService= SpringUtils.getBean("initialPointGoldenXkByEqService");
 
-//        System.out.println("开始导出风场测点。。。。。。");
-//        initialPointGoldenXkByEqService.initalFc();
-//        System.out.println("结束导出风场测点。。。。。。");
+        System.out.println("开始导出风机测点。。。。。。");
+        initialPointGoldenXkByEqService.initalFj();
+        System.out.println("结束导出风机测点。。。。。。");
+
+        System.out.println("开始导出风场测点。。。。。。");
+        initialPointGoldenXkByEqService.initalFc();
+        System.out.println("结束导出风场测点。。。。。。");
 
     }
 }

+ 1 - 1
realtime/generationXK-service/src/main/java/com/gyee/generation/service/EquipmentInfo2Service.java

@@ -34,7 +34,7 @@ public class EquipmentInfo2Service {
     /**
      * 计算设备日信息
      */
-    public void calEquipmentInfoDay2(Date recordDate) throws Exception {
+    public void calEquipmentInfoDay(Date recordDate) throws Exception {
         Calendar c=Calendar.getInstance();
         c.setTime(recordDate);
 

+ 1 - 1
realtime/generationXK-service/src/main/java/com/gyee/generation/service/EquipmentInfo4Service.java

@@ -58,7 +58,7 @@ public class EquipmentInfo4Service {
    
 
    
-    public void calEquipmentInfo4Day(Date recordDate) throws Exception {
+    public void calEquipmentInfoDay(Date recordDate) throws Exception {
         Calendar c = Calendar.getInstance();
         c.setTime(recordDate);
 

+ 5 - 0
realtime/generationXK-service/src/main/java/com/gyee/generation/service/EquipmentInfo5Service.java

@@ -42,6 +42,11 @@ public class EquipmentInfo5Service {
     @Resource
     private IProEconShutdownEventService proEconShutdownEventService;
 
+    public void calEquipmentInfoDay(Date currentDate) throws Exception {
+        resetRate(currentDate);
+        stateRate(currentDate);
+        failRate(currentDate);
+    }
     /**
      * 复位及时率
      */

+ 1 - 1
realtime/generationXK-service/src/main/java/com/gyee/generation/service/InputOrOutPutService.java

@@ -27,7 +27,7 @@ public class InputOrOutPutService {
     @Resource
     private IProEconInputOrOutputSpeedService proEconInputOrOutputSpeedService;
 
-    public void InputOrOutput(Date currentDate) {
+    public void inputOrOutput(Date currentDate) {
         currentDate = DateUtils.truncDay(currentDate);
         Date end = currentDate;
         Date daybegin = DateUtils.addDays(currentDate, -1);

+ 6 - 2
realtime/generationXK-service/src/main/java/com/gyee/generation/service/LimitEventService.java

@@ -358,7 +358,9 @@ public class LimitEventService {
         wplDictionary.get(key).add(windtubineId);
     }
 
-    public void exec() throws Exception {
+    public void execBrownouts() throws Exception {
+
+        init();
         //风场限电事件
         windpowerEvent.clear();
         //风机限电事件
@@ -517,7 +519,9 @@ public class LimitEventService {
 
 
 //限电事件当天
-    public void exec2() throws Exception {
+    public void execBrownouts2() throws Exception {
+
+        init();
         //风场限电事件
         windpowerEvent2.clear();
         //风机限电事件

+ 40 - 677
realtime/generationXK-service/src/main/java/com/gyee/generation/service/LimitService.java

@@ -1,17 +1,12 @@
 package com.gyee.generation.service;
 
 import com.gyee.common.contant.ContantXk;
-import com.gyee.common.model.DNAStatVal;
 import com.gyee.common.model.PointData;
 import com.gyee.generation.init.CacheContext;
-import com.gyee.generation.model.auto.ProBasicEquipmentPoint;
 import com.gyee.generation.model.auto.ProBasicEquipment;
+import com.gyee.generation.model.auto.ProBasicEquipmentPoint;
 import com.gyee.generation.model.auto.ProBasicPowerstationPoint;
-import com.gyee.generation.model.auto.ProEconLineElectrical;
-import com.gyee.generation.model.vo.RealTimeParameterVo;
-import com.gyee.generation.model.vo.SLWindpowerVo;
 import com.gyee.generation.model.vo.StatData;
-import com.gyee.generation.service.auto.IProEconLineElectricalService;
 import com.gyee.generation.util.DateUtils;
 import com.gyee.generation.util.StringUtils;
 import com.gyee.generation.util.realtimesource.IEdosUtil;
@@ -19,477 +14,13 @@ import org.springframework.stereotype.Service;
 
 import javax.annotation.Resource;
 import java.util.*;
-import java.util.function.Function;
-import java.util.stream.Collectors;
 
 @Service
 public  class LimitService {
 
     @Resource
-    private IProEconLineElectricalService proEconLineElectricalService;
-
-
-    
-
-    @Resource
     private IEdosUtil edosUtil;
-   // 受累
-
-    Map<String, SLWindpowerVo> sl;
-
-    Map<String, Integer> slvalue;
-
-    Map<String, ProBasicEquipmentPoint> windSL;
-
-    public void execStatuSL() throws Exception {
-
-
-
-        if (sl == null)
-            initsl();
-        else
-        {
-
-            Map<String, Integer> slv = new HashMap<String, Integer>();
-            Date dt =new Date();
-            Map<String, RealTimeParameterVo> rList = new HashMap<String, RealTimeParameterVo>();
-            for (SLWindpowerVo item : sl.values())
-            {
-
-
-                //事故总
-                if (item.getACCIDENTSIGNAL().size() > 0)
-                {
-                    for (String key : item.getACCIDENTSIGNAL().keySet())
-                    {
-                        Double cx = 0.0;
-                        cx = edosUtil.getRealData(key).getPointValueInDouble();
-                        if (cx == 1)
-                        {
-                            for (String  windturbineid : item.getACCIDENTSIGNAL().get(key))
-                            {
-                                BuilderSL(dt, rList, key, windturbineid, slv, 3);
-                            }
-                        }
-                    }
-                }
-
-
-
-
-                //出线断路器判断
-                if (item.getNETOUTCODE().size() > 0)
-                {
-                    for (String key : item.getNETOUTCODE().keySet())
-                    {
-                        Double cx = 1.0;
-                        cx = edosUtil.getRealData(key).getPointValueInDouble();
-                        if (cx == 0)
-                        {
-                            for (String  windturbineid : item.getNETOUTCODE().get(key))
-                            {
-                                BuilderSL(dt, rList, key, windturbineid, slv, 4);
-                            }
-                        }
-                    }
-                }
-                else
-                {
-                    //主变高压侧
-                    if (item.getNETHIGHCODE().size() > 0)
-                    {
-                        for (String key : item.getNETHIGHCODE().keySet())
-                        {
-                            Double cx = 1.0;
-                            cx = edosUtil.getRealData(key).getPointValueInDouble();
-                            if (cx == 0)
-                            {
-                                for (String windturbineid : item.getNETHIGHCODE().get(key))
-                                {
-                                    BuilderSL(dt, rList, key, windturbineid, slv, 4);
-                                }
-                            }
-                            else
-                            {
-
-                                if (item.getPTCURRENTCODE().containsKey(key) && item.getPTCURRENT().containsKey(key))
-                                {
-                                    String code = item.getPTCURRENTCODE().get(key);
-                                    Double max = item.getPTCURRENT().get(key);
-                                    cx =edosUtil.getRealData(code).getPointValueInDouble();
-
-                                    if (cx > max)
-                                    {
-                                        for (String windturbineid : item.getNETOUTCODE().get(key))
-                                        {
-                                            BuilderSL(dt, rList, key, windturbineid, slv, 4);
-                                        }
-                                    }
-                                }
-                                if (item.getPTVOLTAGECODE().containsKey(key) && item.getPTVOLTAGEHIGH().containsKey(key) && item.getPTVOLTAGELOW().containsKey(key))
-                                {
-                                    String code = item.getPTVOLTAGECODE().get(key);
-                                    Double max = item.getPTVOLTAGEHIGH().get(key);
-                                    Double min = item.getPTVOLTAGELOW().get(key);
-                                    cx =edosUtil.getRealData(code).getPointValueInDouble();
-
-                                    if (cx > max || cx < min)
-                                    {
-                                        for (String windturbineid : item.getNETOUTCODE().get(key))
-                                        {
-                                            BuilderSL(dt, rList, key, windturbineid, slv, 4);
-                                        }
-                                    }
-                                }
-
-                            }
-                        }
-                    }
-                }
-
-
-
-
-                //主变高压侧断路器判断
-                if (item.getNETHIGHCODE().size() > 0)
-                {
-                    for (String key : item.getNETHIGHCODE().keySet())
-                    {
-                        Double cx = 1.0;
-                        cx =edosUtil.getRealData(key).getPointValueInDouble();
-                        if (cx == 0)
-                        {
-                            for (String windturbineid : item.getNETHIGHCODE().get(key))
-                            {
-                                BuilderSL(dt, rList, key, windturbineid, slv, 2);
-                            }
-                        }
-                    }
-                }
-
-
-
-                //主变低压侧断路器判断
-                if (item.getNETLOWCODE().size() > 0)
-                {
-                    for (String key : item.getNETLOWCODE().keySet())
-                    {
-                        Double cx = 1.0;
-                        cx =edosUtil.getRealData(key).getPointValueInDouble();
-                        if (cx == 0)
-                        {
-                            for (String windturbineid : item.getNETLOWCODE().get(key))
-                            {
-                                BuilderSL(dt, rList, key, windturbineid, slv, 2);
-                            }
-                        }
-                    }
-                }
-
-
-                //进线断路器判断
-                if (item.getLINECODE().size() > 0)
-                {
-                    for (String key : item.getLINECODE().keySet())
-                    {
-                        Double cx = 1.0;
-                        cx =edosUtil.getRealData(key).getPointValueInDouble();
-                        if (cx == 0)
-                        {
-                            for (String windturbineid : item.getLINECODE().get(key))
-                            {
-                                BuilderSL(dt, rList, key, windturbineid, slv, 2);
-                            }
-                        }
-                    }
-                }
-            }
-
-//            List<PointData> pols=new ArrayList<>();
-            for (String key : windSL.keySet())
-            {
-
-                double t =edosUtil.getRealData(windSL.get(key).getNemCode()).getPointValueInDouble();
-                if (!slv.containsKey(key))
-                {
-
-                    if (slvalue.get(key) != 0)
-                    {
-                        slvalue.put(key,0);
-
-                        if (t == 2 || t == 3 || t == 4)
-                        {
-                            RealTimeParameterVo rt = new RealTimeParameterVo();
-
-                            rt.setPoint(windSL.get(key).getNemCode());
-                            rt.setTime(dt);
-                            rt.setInsertValue(0.0);
-                            rList.put(key, rt);
-
-//                            PointData po=new PointData();
-//                            po.setEdnaId(windSL.get(key).getId());
-//                            po.setPointTime(dt.getTime());
-//                            po.setPointValueInDouble(0.0);
-//                            pols.add(po);
-                        }
-                    }
-                }
-
-            }
-            if (rList.size() > 0)
-            {
-                //批量插入测点
-                edosUtil.sendMultiRealTimeParamete(rList.values().stream().collect(Collectors.toList()));
-//                ednaHelper.AddRealtimeEDNA(rList.Values.ToList());
-            }
-
-        }
-    }
-
-    private void BuilderSL(Date dt, Map<String, RealTimeParameterVo> rList, String key, String windturbineid, Map<String, Integer> slv, Integer i)
-    {
-
-        if (!slv.containsKey(windturbineid))
-        {
-            slv.put(windturbineid, i);
-            if (i != 3)
-            {
-                if (windSL.containsKey(windturbineid))
-                {
-                    if (slvalue.containsKey(windturbineid))
-                    {
-                        if (slvalue.get(windturbineid) != i)
-                        {
-                            RealTimeParameterVo rt = new RealTimeParameterVo();
-                            rt.setPoint(windSL.get(windturbineid).getNemCode());
-                            rt.setTime(dt);
-                            rt.setInsertValue(i);
-
-
-
-                            if (!rList.containsKey(windturbineid))
-                            {
-                                slvalue.put(windturbineid,i);
-
-                                rList.put(windturbineid, rt);
-                            }
-                        }
-                    }
-                }
-            }
-        }
-        else
-        {
-            if (slv.get(windturbineid) == 3)
-            {
-                i = 3;
-            }
-
-            if (windSL.containsKey(windturbineid))
-            {
-                if (slvalue.containsKey(windturbineid))
-                {
-                    if (slvalue.get(windturbineid) != i)
-                    {
-                        RealTimeParameterVo rt = new RealTimeParameterVo();
-                        rt.setPoint(windSL.get(windturbineid).getNemCode());
-                        rt.setTime(dt);
-                        rt.setInsertValue(i);
-
-
-
-                        if (!rList.containsKey(windturbineid))
-                        {
-                            slvalue.put(windturbineid,i);
-
-                            rList.put(windturbineid, rt);
-                        }
-                    }
-
-                }
-            }
-        }
-    }
-
-    private void initsl()
-    {
-        sl = new HashMap<String, SLWindpowerVo>();
-        slvalue = new HashMap<String, Integer>();
-
-            //var electrical = entity.ProEconLineElectrical.ToList();
-        List<ProBasicEquipment> wtls= CacheContext.wtls;
-        Map<String, Map<String, ProBasicEquipmentPoint>> wtpAimap=CacheContext.wtpAimap;
-        Map<String, ProEconLineElectrical> electrical = proEconLineElectricalService.list().stream().collect(Collectors.toMap(ProEconLineElectrical::getLineId, Function.identity()));
-        wtls.stream().forEach(wt->{
-            if(wt.getWindpowerstationId().contains("FDC"))
-            {
-                Map<String, ProBasicEquipmentPoint> windturbinetestingpointnewMap = wtpAimap.get(wt.getId());
-                if(windturbinetestingpointnewMap.containsKey(ContantXk.GPZT))
-                {
-                    ProBasicEquipmentPoint xdslPoint = windturbinetestingpointnewMap.get(ContantXk.GPZT);
-                    windSL.put(wt.getId(),xdslPoint);
-                }
-
-            }
-
-        });
-
-            for (String key : windSL.keySet())
-            {
-
-                if (!CacheContext.wtmap.containsKey(key))
-                {
-                    continue;
-                }
-                ProBasicEquipment item = CacheContext.wtmap.get(key);
-
-                slvalue.put(item.getId(), 0);
-
-
-                if (!electrical.containsKey(item.getLineId()))
-                {
-                    continue;
-                }
-                ProEconLineElectrical line = electrical.get(item.getLineId());
-
-                if (sl.containsKey(item.getWindpowerstationId()))
-                {
-                    SLWindpowerVo s = sl.get(item.getWindpowerstationId());
-                    initialsl(item, line, s);
-
-                }
-                else
-                {
-
-                    sl.put(item.getWindpowerstationId(), new SLWindpowerVo());
-                    SLWindpowerVo s = sl.get(item.getWindpowerstationId());
-                    s.setLINECODE(new HashMap<String, List<String>>());
-                    s.setNETLOWCODE(new HashMap<String, List<String>>());
-                    s.setNETHIGHCODE(new HashMap<String, List<String>>());
-                    s.setNETOUTCODE(new HashMap<String, List<String>>());
-                    s.setPTVOLTAGEHIGH(new HashMap<String, Double>());
-                    s.setPTVOLTAGELOW(new HashMap<String, Double>());
-                    s.setPTCURRENT(new HashMap<String, Double>());
-                    s.setPTCURRENTCODE(new HashMap<String, String>());
-                    s.setPTVOLTAGECODE(new HashMap<String, String>());
-                    s.setACCIDENTSIGNAL(new HashMap<String, List<String>>());
-
-                    initialsl(item, line, s);
-                }
-            }
-
-
-
-    }
-
-    private static void initialsl(ProBasicEquipment windturbine, ProEconLineElectrical item, SLWindpowerVo s)
-    {
-        //进线断路器
-        if (s.getLINECODE().containsKey(item.getLineCode()))
-        {
-            List<String> t = s.getLINECODE().get(item.getLineCode());
-            t.add(windturbine.getId());
-        }
-        else
-        {
-            List<String> t = new ArrayList<String>();
-            t.add(windturbine.getId());
-            s.getLINECODE().put(item.getLineCode(), t);
-        }
-        //主变低压测
-        if (s.getNETLOWCODE().containsKey(item.getNetLowCode()))
-        {
-            List<String> t = s.getNETLOWCODE().get(item.getNetLowCode());
-            t.add(windturbine.getId());
-        }
-        else
-        {
-            List<String> t = new ArrayList<String>();
-             t.add(windturbine.getId());
-            s.getNETLOWCODE().put(item.getNetLowCode(), t);
-        }
-        //主变高压侧
-        if (s.getNETHIGHCODE().containsKey(item.getNetHighCode()))
-        {
-            List<String> t = s.getNETHIGHCODE().get(item.getNetHighCode());
-             t.add(windturbine.getId());
-        }
-        else
-        {
-            List<String> t = new ArrayList<String>();
-             t.add(windturbine.getId());
-            s.getNETHIGHCODE().put(item.getNetHighCode(), t);
-
-
-            if (!s.getPTCURRENTCODE().containsKey(item.getNetHighCode()))
-            {
-                if (item.getPtcurrentCode() != null)
-                {
-                    s.getPTCURRENTCODE().put(item.getNetHighCode(), item.getPtcurrentCode());
-                }
-            }
-            if (!s.getPTVOLTAGECODE().containsKey(item.getNetHighCode()))
-            {
-                if (item.getPtvoltageCode() != null)
-                {
-                    s.getPTVOLTAGECODE().put(item.getNetHighCode(), item.getPtvoltageCode());
-                }
-            }
-
-
-            if (!s.getPTVOLTAGEHIGH().containsKey(item.getNetHighCode()))
-            {
-                if (item.getPtvoltageHigh() != null)
-                {
-                    s.getPTVOLTAGEHIGH().put(item.getNetHighCode(), item.getPtvoltageHigh().doubleValue());
-                }
-            }
-            if (!s.getPTVOLTAGELOW().containsKey(item.getNetHighCode()))
-            {
-                if (item.getPtvoltageLow() != null)
-                {
-                    s.getPTVOLTAGELOW().put(item.getNetHighCode(),  item.getPtvoltageLow().doubleValue());
-                }
-            }
-            if (!s.getPTCURRENTCODE().containsKey(item.getNetHighCode()))
-            {
-                if (item.getPtcurrent() != null)
-                {
-                    s.getPTCURRENT().put(item.getNetHighCode(), item.getPtcurrent().doubleValue());
-                }
-            }
-
-        }
-        //出线
-        if (s.getNETOUTCODE().containsKey(item.getNetOutCode()))
-        {
-            List<String> t = s.getNETOUTCODE().get(item.getNetOutCode());
-             t.add(windturbine.getId());
-        }
-        else
-        {
-            List<String> t = new ArrayList<String>();
-             t.add(windturbine.getId());
-            s.getNETOUTCODE().put(item.getNetOutCode(), t);
-        }
-
-        //事故总
-        if (s.getACCIDENTSIGNAL().containsKey(item.getAccidentSignal()))
-        {
-            List<String> t = s.getACCIDENTSIGNAL().get(item.getAccidentSignal());
-             t.add(windturbine.getId());
-        }
-        else
-        {
-            List<String> t = new ArrayList<String>();
-             t.add(windturbine.getId());
-            s.getACCIDENTSIGNAL().put(item.getAccidentSignal(), t);
-        }
-
-    }
-
-
-        //region AGC监视限电
+    //AGC监视限电
 
     //限电
     static Map<String, ProBasicEquipmentPoint> WindTurbineE;
@@ -500,9 +31,6 @@ public  class LimitService {
     //限电状态
     static Map<String, Map<String, ProBasicEquipmentPoint>> WindTurbineD;
 
-    //限电受累
-    static Map<String, Map<String, ProBasicEquipmentPoint>> WindTurbineXDSL;
-
 
     //AGC限电指令
     static Map<String, ProBasicPowerstationPoint> WindPowerAGC;
@@ -614,7 +142,7 @@ public  class LimitService {
 
             Date begin = DateUtils.addMinutes(time,-8);
 
-            List<RealTimeParameterVo> projectRT = new ArrayList<RealTimeParameterVo>();
+            List<PointData> projectRT = new ArrayList<PointData>();
 
 
 
@@ -735,21 +263,22 @@ public  class LimitService {
                         {
                             val = 1.0;
                         }
-                        RealTimeParameterVo rt = new RealTimeParameterVo();
+                        PointData rt = new PointData();
 
-                        rt.setPoint(WindTurbineD.get(item).get(key).getNemCode());
-                        rt.setTime(time);
-                        rt.setInsertValue(val);
+
+                        rt.setEdnaId(WindTurbineD.get(item).get(key).getNemCode());
+                        rt.setPointTime(time.getTime());
+                        rt.setPointValueInDouble(val);
                         projectRT.add(rt);
                         //}
 
                     }
 
-                    RealTimeParameterVo fcrt = new RealTimeParameterVo();
+                    PointData fcrt = new PointData();
 
-                    fcrt.setPoint(WindPowerXDZT.get(item).getNemCode());
-                    fcrt.setTime(time);
-                    fcrt.setInsertValue(0.0);
+                    fcrt.setEdnaId(WindPowerXDZT.get(item).getNemCode());
+                    fcrt.setPointTime(time.getTime());
+                    fcrt.setPointValueInDouble(0.0);
                     projectRT.add(fcrt);
 
                 }
@@ -840,30 +369,32 @@ public  class LimitService {
                             {
                                 val = 1.0;
                             }
-                            RealTimeParameterVo rt = new RealTimeParameterVo();
+                            PointData rt = new PointData();
 
-                            rt.setPoint(WindTurbineD.get(item).get(key).getNemCode());
-                            rt.setTime(time);
-                            rt.setInsertValue(val);
+                            rt.setEdnaId(WindTurbineD.get(item).get(key).getNemCode());
+                            rt.setPointTime(time.getTime());
+                            rt.setPointValueInDouble(0.0);
                             projectRT.add(rt);
                             
 
                             //}
 
                         }
-                        RealTimeParameterVo fcrt = new RealTimeParameterVo();
-  
-                        fcrt.setPoint(WindPowerXDZT.get(item).getNemCode());
-                        fcrt.setTime(time);
-                        fcrt.setInsertValue(0.0);
+                        PointData fcrt = new PointData();
+
+
+                        fcrt.setEdnaId(WindPowerXDZT.get(item).getNemCode());
+                        fcrt.setPointTime(time.getTime());
+                        fcrt.setPointValueInDouble(0.0);
                         projectRT.add(fcrt);
                     }
                     else
                     {
-                        RealTimeParameterVo fcrt = new RealTimeParameterVo();
-                        fcrt.setPoint(WindPowerXDZT.get(item).getNemCode());
-                        fcrt.setTime(time);
-                        fcrt.setInsertValue(1.0);
+                        PointData fcrt = new PointData();
+
+                        fcrt.setEdnaId(WindPowerXDZT.get(item).getNemCode());
+                        fcrt.setPointTime(time.getTime());
+                        fcrt.setPointValueInDouble(1.0);
                         projectRT.add(fcrt);
 
                         for (String key : WindTurbineD.get(item).keySet())
@@ -945,54 +476,15 @@ public  class LimitService {
                             {
                                 val = 1.0;
                             }
-                            RealTimeParameterVo rt = new RealTimeParameterVo();
-
-                            rt.setPoint(WindTurbineD.get(item).get(key).getNemCode());
-                            rt.setTime(time);
-                            rt.setInsertValue(val);
-                            projectRT.add(rt);
+                            PointData rt = new PointData();
 
 
+                            rt.setEdnaId(WindTurbineD.get(item).get(key).getNemCode());
+                            rt.setPointTime(time.getTime());
+                            rt.setPointValueInDouble(val);
+                            projectRT.add(rt);
 
 
-                            //if (d == 0d)
-                            //{
-                            //    boolean t = false;
-                            //    if (statuspointDictionary.containsKey(key))
-                            //    {
-                            //        Double start = edosUtil.getRealData(statuspointDictionary[key].ID);
-                            //        if (start != 1)
-                            //        {
-                            //            t = true;
-                            //        }
-
-                            //        else
-                            //        {
-
-                            //            if (WindTurbineE.containsKey(key))
-                            //            {
-                            //                String ids = WindTurbineE[key].ID;
-                            //                if (ids != null && ids.Length > 0)
-                            //                    t = BuildRetValue(new String[] { ids });
-                            //            }
-
-                            //        }
-                            //    }
-
-                            //    if (t)
-                            //    {
-                            //        var val = edosUtil.getRealData(WindTurbineD[item][key].ID);
-
-                            //        if (val != 2 && val != 3 && val != 4 && val != 5)
-                            //        {
-                            //            RealTimeParameterVo rt = new RealTimeParameterVo();
-                            //            rt.point = WindTurbineD[item][key].ID; ;
-                            //            rt.time = time;
-                            //            rt.InsertValue = 1.0;
-                            //            projectRT.Add(rt);
-                            //        }
-                            //    }
-                            //}
                         }
                     }
                 }
@@ -1000,109 +492,23 @@ public  class LimitService {
             }
             if (projectRT.size() > 0)
             {
-                edosUtil.sendMultiRealTimeParamete(projectRT);
+                edosUtil.sendMultiPoint(projectRT);
 
             }
         }
     }
 
 
-    private boolean BuildRetValue(String[] Ids) throws Exception {
-        boolean b = false;
-//        Double[] values = new Double[Ids.length];
-
-        List<PointData> values=edosUtil.getRealData(Ids);
-//        ednaHelper.GetRtValueList(Ids.Length, Ids, values);
-        for (PointData item : values)
-        {
-            if (item.getPointValueInDouble() != 0)
-            {
-                b = true;
-                break;
-            }
-        }
-
-        return b;
-    }
-
-
-
 
 
-
-    List<ProBasicEquipmentPoint> WindTurbineXD;
     Map<String, ProBasicEquipmentPoint> WindturbineXDSL;
-    public void execStatus2() throws Exception {
-        if (WindTurbineXD == null || WindturbineXDSL == null)
-        {
-
-            List<ProBasicEquipment> wtls= CacheContext.wtls;
-            Map<String, Map<String, ProBasicEquipmentPoint>> wtpAimap=CacheContext.wtpAimap;
-            wtls.stream().forEach(wt->{
-                Map<String, ProBasicEquipmentPoint> windturbinetestingpointnewMap = wtpAimap.get(wt.getId());
-                if(windturbinetestingpointnewMap.containsKey(ContantXk.GPZT))
-                {
-                    ProBasicEquipmentPoint xdslPoint = windturbinetestingpointnewMap.get(ContantXk.GPZT);
-                    WindturbineXDSL.put(wt.getId(),xdslPoint);
-                }
-                if(windturbinetestingpointnewMap.containsKey(ContantXk.XDZT))
-                {
-                    ProBasicEquipmentPoint xdztPoint = windturbinetestingpointnewMap.get(ContantXk.XDZT);
-                    WindTurbineXD.add(xdztPoint);
-                }
-            });
-              
-        }
-        else
-        {
-            Date dt = new Date();
-            List<RealTimeParameterVo> insertRt = new ArrayList<RealTimeParameterVo>();
-            for (ProBasicEquipmentPoint xd : WindTurbineXD)
-            {
-                String key = xd.getWindturbineId();
-
-//                if (key == "KB01_010")
-//                {
-//                    Console.WriteLine("1");
-//                }
-                String point = xd.getNemCode();//重点注意!!!!
-                Double val = 0.0;
-
-                if (WindturbineXDSL.containsKey(key))
-                {
-                    Double ret = edosUtil.getRealData(WindturbineXDSL.get(key).getNemCode()).getPointValueInDouble();
 
-                    if (ret == 1)
-                    {
-                        val = 1.0;
-                    }
-                    //else
-                    //{
-                    //    val = 0.0;
-                    //}
-                }
-                RealTimeParameterVo rt = new RealTimeParameterVo();
-
-
-                rt.setPoint(point);
-                rt.setTime(dt);
-                rt.setInsertValue(val);
-                insertRt.add(rt);
-                
-            }
-            edosUtil.sendMultiRealTimeParamete(insertRt);
-        }
-
-    }
 
 
     Map<String, List<String>> WindturbineQXDic;
     List<ProBasicEquipmentPoint> WindTurbineQX;
     Map<String, ProBasicEquipmentPoint> WindturbineQXDic2;
-    Map<String, ProBasicEquipmentPoint> WindturbineQXDic3;
-
 
-    //Map<String, ProBasicEquipmentPoint> WindturbineQXDic4;
     public void execStatus() throws Exception {
 
 
@@ -1142,22 +548,6 @@ public  class LimitService {
                     wtpointls.add(point);
                 }
 
-//                if(windturbinetestingpointnewMap.containsKey(ContantXk.CJ_ZSGD))
-//                {
-//                    ProBasicEquipmentPoint point = windturbinetestingpointnewMap.get(ContantXk.CJ_ZSGD);
-//                    WindturbineQXDic3.put(wt.getId(),point);
-//                }
-//
-//                if(windturbinetestingpointnewMap.containsKey(ContantXk.DI11139))
-//                {
-//                    ProBasicEquipmentPoint point = windturbinetestingpointnewMap.get(ContantXk.DI11139);
-//                    WindturbineQXDic2.put(wt.getNemCode(),point);
-//                }
-//                if(windturbinetestingpointnewMap.containsKey(ContantXk.DI10923))
-//                {
-//                    ProBasicEquipmentPoint point = windturbinetestingpointnewMap.get(ContantXk.DI10923);
-//                    WindturbineQXDic2.put(wt.getNemCode(),point);
-//                }
 
                 if(windturbinetestingpointnewMap.containsKey(ContantXk.XDZT))
                 {
@@ -1180,21 +570,12 @@ public  class LimitService {
         else
         {
             Date dt =new Date();
-            List<RealTimeParameterVo> insertRt = new ArrayList<RealTimeParameterVo>();
+            List<PointData> insertRt = new ArrayList<PointData>();
             for (ProBasicEquipmentPoint item : WindTurbineQX)
             {
                 String key = item.getWindturbineId();
                 String  windows = item.getWindpowerstationId();
-                //if (windows == "KB_FDC" || windows == "CL_FDC")
-                //{
-                //    Console.WriteLine(key);
-                //    continue;
-                //}
-//                if (key == "CL01_001" )
-//                {
-//                    Console.WriteLine(key);
-//
-//                }
+
                 String point = item.getNemCode();//重点注意!!!!
                 Double val = 0.0;
                 if (CacheContext.wtmap.containsKey(key) && WindturbineQXDic.containsKey(key))
@@ -1239,38 +620,20 @@ public  class LimitService {
                     }
 
 
-                    //if (WindturbineQXDic3.containsKey(key))
-                    //{
-                    //    var k = edosUtil.getRealData(WindturbineQXDic3[key].ID);
-                    //    if (modelid.contains("UP77-1500") || modelid.contains("UP82-1500"))
-                    //    {
-                    //        if (k >= 90)
-                    //        {
-                    //            b = true;
-                    //        }
-                    //        else
-                    //        {
-                    //            b = false;
-                    //        }
-                    //    }
-                    //}
-
-
                     val = b ? 0.0 : 1.0;
 
-                    RealTimeParameterVo rt = new RealTimeParameterVo();
-
-                    rt.setPoint(point);
-                    rt.setTime(dt);
-                    rt.setInsertValue(val);
+                    PointData rt = new PointData();
 
+                    rt.setEdnaId(point);
+                    rt.setPointTime(dt.getTime());
+                    rt.setPointValueInDouble(val);
                     insertRt.add(rt);
 
 
                 }
             }
 
-            edosUtil.sendMultiRealTimeParamete(insertRt);
+            edosUtil.sendMultiPoint(insertRt);
             this.execStatusAGCxd();
             //this.execStatuSL();
 

Rozdielové dáta súboru neboli zobrazené, pretože súbor je príliš veľký
+ 1600 - 0
realtime/generationXK-service/src/main/java/com/gyee/generation/service/PowerCurveFittingByTimeService.java


+ 4 - 1
realtime/generationXK-service/src/main/java/com/gyee/generation/service/PowerCurveFittingService.java

@@ -168,7 +168,8 @@ public class PowerCurveFittingService {
             windMap.get(key).setYzyglPoints(new ArrayList<>());
             windMap.get(key).setRsjglPoints(new ArrayList<>());
             windMap.get(key).setRzyglPoints(new ArrayList<>());
-
+            windMap.get(key).setNsjglPoints(new ArrayList<>());
+            windMap.get(key).setNzyglPoints(new ArrayList<>());
 
             if (windMap.get(key).getPointIdGL() == null || windMap.get(key).getPointIdFS() == null || windMap.get(key).getPointIdZT() == null) {
                 logger.info(key);
@@ -234,12 +235,14 @@ public class PowerCurveFittingService {
                 String standardId = CacheContext.wtstandardmap.get(key);
                 if (StringUtils.notEmp(standardId)) {
                     if (windMap.containsKey(key)) {
+                        yearStandardPoints = windMap.get(standardId).getNsjglPoints();
                         monthStandardPoints = windMap.get(standardId).getYsjglPoints();
                         dayStandardPoints = windMap.get(standardId).getRsjglPoints();
                     }
                 }
             }
 
+
             String stringyear = String.valueOf(year);
             String stringmonth = String.valueOf(month);
 

+ 5 - 1
realtime/generationXK-service/src/main/java/com/gyee/generation/service/ShutdownService.java

@@ -225,7 +225,11 @@ public class ShutdownService {
 
 
 
-    public void exec() throws Exception {
+    public void execShutdown() throws Exception {
+
+        init();
+
+
         oldStatusMap.clear();
         oldShutdownEvent.clear();
         oldInterrup.clear();

+ 5 - 0
realtime/generationXK-service/src/main/java/com/gyee/generation/service/initialpoint/InitialPointGoldenXkByEqService.java

@@ -750,7 +750,12 @@ public class InitialPointGoldenXkByEqService implements IinitialPoint {
                     for (int i = 0; i < ls.size(); i++) {
 
 
+
                         ProEconTestingPoint stp = ls.get(i);
+                        if(!stp.getTypeId().contains("jsfw") && !stp.getModel().equals(wt.getModelId()))
+                        {
+                            continue;
+                        }
                         StringBuilder sb = new StringBuilder();
 //                        sb.append(wp.getPhoto());
 

+ 264 - 0
realtime/generationXK-service/src/main/java/com/gyee/generation/task/SaticSchedulePgTask.java

@@ -0,0 +1,264 @@
+//package com.gyee.generation.task;
+//
+//
+//import com.gyee.common.util.DateUtils;
+//import com.gyee.generation.init.CacheContext;
+//import com.gyee.generation.service.*;
+//import com.xxl.job.core.context.XxlJobHelper;
+//import com.xxl.job.core.handler.annotation.XxlJob;
+//import org.slf4j.Logger;
+//import org.slf4j.LoggerFactory;
+//import org.springframework.stereotype.Component;
+//
+//import javax.annotation.Resource;
+//import java.util.Date;
+//
+///**
+// * @ClassName : SaticScheduleTask
+// * @Description : 调度
+// */
+//
+//
+//@Component
+//public class SaticSchedulePgTask {
+//
+//    private static Logger logger = LoggerFactory.getLogger(SaticSchedulePgTask.class);
+//
+//    @Resource
+//    private InputOrOutPutService inputOrOutPutService;
+//    @Resource
+//    private LimitEventService limitEventService;
+//    @Resource
+//    private PowerCurveFittingService powerCurveFittingService;
+//    @Resource
+//    private ShutdownService shutdownService;
+//    @Resource
+//    private WindPowerInfo1Service windPowerInfo1Service;
+//    @Resource
+//    private WindPowerInfo2Service windPowerInfo2Service;
+//    @Resource
+//    private WindPowerInfo3Service windPowerInfo3Service;
+//    @Resource
+//    private WindPowerInfo4Service windPowerInfo4Service;
+//    @Resource
+//    private WindPowerInfo5Service windPowerInfo5Service;
+//    @Resource
+//    private WindPowerInfo6Service windPowerInfo6Service;
+//    @Resource
+//    private EquipmentInfo1Service equipmentInfo1Service;
+//    @Resource
+//    private EquipmentInfo2Service equipmentInfo2Service;
+//    @Resource
+//    private EquipmentInfo3Service equipmentInfo3Service;
+//    @Resource
+//    private EquipmentInfo4Service equipmentInfo4Service;
+//    @Resource
+//    private EquipmentInfo5Service equipmentInfo5Service;
+//    @Resource
+//    private EquipmentInfoDayTopService equipmentInfoDayTopService;
+//    //3.添加定时任务
+//    /**
+//     * 切入切出统计
+//     * 每天执行一次
+//     */
+//
+//    @XxlJob("inputOrOutPut_PG")
+//    public void inputOrOutPut_PG()  {
+//
+//
+//        XxlJobHelper.log("切入切出统计调度程序执行开始!........");
+//        try {
+//            inputOrOutPutService.inputOrOutput(new Date());
+//        } catch (Exception e) {
+//            e.printStackTrace();
+//        }
+//        XxlJobHelper.log("切入切出统计调度任务处理完成!........");
+//    }
+//
+//    /**
+//     * 停机记录
+//     * 每15分钟执行一次
+//     */
+//    @XxlJob("shutdown_PG")
+//    public void shutdown_PG()  {
+//
+//        XxlJobHelper.log("停机记录调度程序执行开始!........");
+//
+//        try {
+//            shutdownService.execShutdown();
+//            limitEventService.execBrownouts2();
+//        } catch (Exception e) {
+//            e.printStackTrace();
+//        }
+//        XxlJobHelper.log("停机记录调度任务处理完成!........");
+//    }
+//
+//    /**
+//     * 限电停机记录
+//     * 每15分钟执行一次
+//     */
+//    @XxlJob("brownouts_PG")
+//    public void brownouts_PG()  {
+//
+//        XxlJobHelper.log("限电停机记录调度程序执行开始!........");
+//
+//        try {
+//            limitEventService.execBrownouts();
+//            limitEventService.execBrownouts2();
+//        } catch (Exception e) {
+//            e.printStackTrace();
+//        }
+//        XxlJobHelper.log("限电停机记录调度任务处理完成!........");
+//    }
+//
+//    /**
+//     * 日、月、年功率曲线拟合
+//     * 每天执行一次
+//     */
+//    @XxlJob("powerCurveFitting_PG")
+//    public void powerCurveFitting_PG()  {
+//
+//        XxlJobHelper.log("日、月、年功率曲线拟合调度程序执行开始!........");
+//
+//        Date date=new Date();
+//        try {
+//            powerCurveFittingService.cureFitting(date,DateUtils.truncate(date),0, CacheContext.wtls);
+//
+//        } catch (Exception e) {
+//            e.printStackTrace();
+//        }
+//
+//        XxlJobHelper.log("日、月、年功率曲线拟合调度任务处理完成!........");
+//    }
+//
+//    /**
+//     * 设备指标统计
+//     *  15分钟只执行一次
+//     *
+//     */
+//    @XxlJob("equipment_PowerInfo_PG")
+//    public void equipment_PowerInfo_PG() throws Exception {
+//
+//        XxlJobHelper.log("项目指标调度程序执行开始!........");
+//        Date date=new Date();
+//
+//        equipmentInfo1Service.calEquipmentInfoDay(date);
+//        equipmentInfo2Service.calEquipmentInfoDay(date);
+//        equipmentInfo3Service.calEquipmentInfoDay(date);
+//        equipmentInfo4Service.calEquipmentInfoDay(date);
+//        equipmentInfo5Service.calEquipmentInfoDay(date);
+//
+//
+//        XxlJobHelper.log("项目指标调度程序执行完成!........");
+//
+//    }
+//    /**
+//     * 线路指标统计
+//     *  15分钟只执行一次
+//     *
+//     */
+//    @XxlJob("Line_PowerInfo_PG")
+//    public void Line_PowerInfo_PG() throws Exception {
+//
+//            XxlJobHelper.log("线路指标调度程序执行开始!........");
+//
+//            Date date=new Date();
+//
+//            windPowerInfo1Service.calLineInfoDay(date);
+//            windPowerInfo2Service.calLineInfoDay(date);
+//            windPowerInfo3Service.calLineInfoDay(date);
+//            windPowerInfo4Service.calLineInfoDay(date);
+//            windPowerInfo5Service.calLineInfoDay(date);
+//            windPowerInfo6Service.calLineInfoDay(date);
+//
+//          XxlJobHelper.log("线路指标调度程序执行完成!........");
+//
+//    }
+//
+//    /**
+//     * 线路指标统计
+//     *  15分钟只执行一次
+//     *
+//     */
+//    @XxlJob("project_PowerInfo_PG")
+//    public void project_PowerInfo_PG() throws Exception {
+//
+//        XxlJobHelper.log("项目指标调度程序执行开始!........");
+//        Date date=new Date();
+//
+//        windPowerInfo1Service.calProjectInfoDay(date);
+//        windPowerInfo2Service.calProjectInfoDay(date);
+//        windPowerInfo3Service.calProjectInfoDay(date);
+//        windPowerInfo4Service.calProjectInfoDay(date);
+//        windPowerInfo5Service.calProjectInfoDay(date);
+//        windPowerInfo6Service.calProjectInfoDay(date);
+//
+//        XxlJobHelper.log("项目指标调度程序执行完成!........");
+//
+//    }
+//
+//
+//    /**
+//     * 区域、公司、场站指标统计
+//     *  15分钟只执行一次
+//     *
+//     */
+//    @XxlJob("station_PowerInfo_PG")
+//    public void station_PowerInfo_PG() throws Exception {
+//
+//        XxlJobHelper.log("场站指标统计调度程序执行开始!........");
+//        Date date=new Date();
+//
+//        windPowerInfo1Service.calWindpowerInfoDay(date);
+//        windPowerInfo2Service.calWindpowerInfoDay(date);
+//        windPowerInfo3Service.calWindpowerInfoDay(date);
+//        windPowerInfo4Service.calWindpowerInfoDay(date);
+//        windPowerInfo5Service.calWindpowerInfoDay(date);
+//        windPowerInfo6Service.calWindpowerInfoDay(date);
+//
+//        XxlJobHelper.log("场站指标统计调度程序执行完成!........");
+//        XxlJobHelper.log("公司指标统计调度程序执行开始!........");
+//
+//
+//        windPowerInfo1Service.calWindpowerInfoDay(date);
+//        windPowerInfo2Service.calWindpowerInfoDay(date);
+//        windPowerInfo3Service.calWindpowerInfoDay(date);
+//        windPowerInfo4Service.calWindpowerInfoDay(date);
+//        windPowerInfo5Service.calWindpowerInfoDay(date);
+//        windPowerInfo6Service.calWindpowerInfoDay(date);
+//
+//        XxlJobHelper.log("公司指标统计调度程序执行完成!........");
+//        XxlJobHelper.log("区域指标统计调度程序执行开始!........");
+//
+//
+//        windPowerInfo1Service.calWindpowerInfoDay(date);
+//        windPowerInfo2Service.calWindpowerInfoDay(date);
+//        windPowerInfo3Service.calWindpowerInfoDay(date);
+//        windPowerInfo4Service.calWindpowerInfoDay(date);
+//        windPowerInfo5Service.calWindpowerInfoDay(date);
+//        windPowerInfo6Service.calWindpowerInfoDay(date);
+//
+//        XxlJobHelper.log("区域统计调度程序执行完成!........");
+//
+//    }
+//
+//    /**
+//     * 等级评估统计
+//     * 每天执行一次
+//     */
+//
+//    @XxlJob("equipmentInfoDayTop_PG")
+//    public void equipmentInfoDayTop_PG()  {
+//
+//
+//        XxlJobHelper.log("等级评估统计调度程序执行开始!........");
+//        try {
+//            equipmentInfoDayTopService.calEquipmentInfoDayTop(new Date());
+//        } catch (Exception e) {
+//            e.printStackTrace();
+//        }
+//        XxlJobHelper.log("等级评估统计调度任务处理完成!........");
+//    }
+//
+//
+//}

+ 8 - 8
realtime/generationXK-service/src/main/resources/application-xk.yml

@@ -9,7 +9,7 @@ spring:
     allow-bean-definition-overriding: true #当遇到同样名字的时候,是否允许覆盖注册
   #redis集群
   redis:
-    host: 120.46.148.180
+    host: 192.168.11.250
     port: 6379
     timeout: 100000
     #    集群环境打开下面注释,单机不需要打开
@@ -27,18 +27,18 @@ spring:
         min-idle: 0
         max-idle: 8
         max-wait: -1
-    database: 0
+    database: 9
   autoconfigure:
     exclude: org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration,org.springframework.boot.autoconfigure.jdbc.DataSourceTransactionManagerAutoConfiguration
   datasource:
     type: com.alibaba.druid.pool.DruidDataSource
     driver-class-name: org.postgresql.Driver
-#    url: jdbc:postgresql://192.168.11.248:5432/eng_mctl
-#    username: postgres
-#    password: postgres
-    url: jdbc:postgresql://120.46.148.180:5432/postgres
-    username: gdprod
-    password: gd123
+    url: jdbc:postgresql://192.168.11.248:5432/IMS_NEM_SD
+    username: postgres
+    password: postgres
+#    url: jdbc:postgresql://120.46.148.180:5432/postgres
+#    username: gdprod
+#    password: gd123
     oracle-schema=:
     #    type: com.alibaba.druid.pool.DruidDataSource
     #    url: jdbc:mysql://127.0.0.1:3306/test?characterEncoding=utf8&serverTimezone=UTC

+ 1 - 1
realtime/generationXK-service/src/main/resources/application.yml

@@ -1,6 +1,6 @@
 spring:
   profiles:
-    active: dev
+    active: xk
 #    active: xk
 
 #    active: td