|
@@ -1,17 +1,12 @@
|
|
package com.gyee.generation.service;
|
|
package com.gyee.generation.service;
|
|
|
|
|
|
import com.gyee.common.contant.ContantXk;
|
|
import com.gyee.common.contant.ContantXk;
|
|
-import com.gyee.common.model.DNAStatVal;
|
|
|
|
import com.gyee.common.model.PointData;
|
|
import com.gyee.common.model.PointData;
|
|
import com.gyee.generation.init.CacheContext;
|
|
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.ProBasicEquipment;
|
|
|
|
+import com.gyee.generation.model.auto.ProBasicEquipmentPoint;
|
|
import com.gyee.generation.model.auto.ProBasicPowerstationPoint;
|
|
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.model.vo.StatData;
|
|
-import com.gyee.generation.service.auto.IProEconLineElectricalService;
|
|
|
|
import com.gyee.generation.util.DateUtils;
|
|
import com.gyee.generation.util.DateUtils;
|
|
import com.gyee.generation.util.StringUtils;
|
|
import com.gyee.generation.util.StringUtils;
|
|
import com.gyee.generation.util.realtimesource.IEdosUtil;
|
|
import com.gyee.generation.util.realtimesource.IEdosUtil;
|
|
@@ -19,477 +14,13 @@ import org.springframework.stereotype.Service;
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
import javax.annotation.Resource;
|
|
import java.util.*;
|
|
import java.util.*;
|
|
-import java.util.function.Function;
|
|
|
|
-import java.util.stream.Collectors;
|
|
|
|
|
|
|
|
@Service
|
|
@Service
|
|
public class LimitService {
|
|
public class LimitService {
|
|
|
|
|
|
@Resource
|
|
@Resource
|
|
- private IProEconLineElectricalService proEconLineElectricalService;
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
- @Resource
|
|
|
|
private IEdosUtil edosUtil;
|
|
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;
|
|
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>> WindTurbineD;
|
|
|
|
|
|
- //限电受累
|
|
|
|
- static Map<String, Map<String, ProBasicEquipmentPoint>> WindTurbineXDSL;
|
|
|
|
-
|
|
|
|
|
|
|
|
//AGC限电指令
|
|
//AGC限电指令
|
|
static Map<String, ProBasicPowerstationPoint> WindPowerAGC;
|
|
static Map<String, ProBasicPowerstationPoint> WindPowerAGC;
|
|
@@ -614,7 +142,7 @@ public class LimitService {
|
|
|
|
|
|
Date begin = DateUtils.addMinutes(time,-8);
|
|
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;
|
|
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);
|
|
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);
|
|
projectRT.add(fcrt);
|
|
|
|
|
|
}
|
|
}
|
|
@@ -840,30 +369,32 @@ public class LimitService {
|
|
{
|
|
{
|
|
val = 1.0;
|
|
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);
|
|
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);
|
|
projectRT.add(fcrt);
|
|
}
|
|
}
|
|
else
|
|
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);
|
|
projectRT.add(fcrt);
|
|
|
|
|
|
for (String key : WindTurbineD.get(item).keySet())
|
|
for (String key : WindTurbineD.get(item).keySet())
|
|
@@ -945,54 +476,15 @@ public class LimitService {
|
|
{
|
|
{
|
|
val = 1.0;
|
|
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)
|
|
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;
|
|
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;
|
|
Map<String, List<String>> WindturbineQXDic;
|
|
List<ProBasicEquipmentPoint> WindTurbineQX;
|
|
List<ProBasicEquipmentPoint> WindTurbineQX;
|
|
Map<String, ProBasicEquipmentPoint> WindturbineQXDic2;
|
|
Map<String, ProBasicEquipmentPoint> WindturbineQXDic2;
|
|
- Map<String, ProBasicEquipmentPoint> WindturbineQXDic3;
|
|
|
|
-
|
|
|
|
|
|
|
|
- //Map<String, ProBasicEquipmentPoint> WindturbineQXDic4;
|
|
|
|
public void execStatus() throws Exception {
|
|
public void execStatus() throws Exception {
|
|
|
|
|
|
|
|
|
|
@@ -1142,22 +548,6 @@ public class LimitService {
|
|
wtpointls.add(point);
|
|
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))
|
|
if(windturbinetestingpointnewMap.containsKey(ContantXk.XDZT))
|
|
{
|
|
{
|
|
@@ -1180,21 +570,12 @@ public class LimitService {
|
|
else
|
|
else
|
|
{
|
|
{
|
|
Date dt =new Date();
|
|
Date dt =new Date();
|
|
- List<RealTimeParameterVo> insertRt = new ArrayList<RealTimeParameterVo>();
|
|
|
|
|
|
+ List<PointData> insertRt = new ArrayList<PointData>();
|
|
for (ProBasicEquipmentPoint item : WindTurbineQX)
|
|
for (ProBasicEquipmentPoint item : WindTurbineQX)
|
|
{
|
|
{
|
|
String key = item.getWindturbineId();
|
|
String key = item.getWindturbineId();
|
|
String windows = item.getWindpowerstationId();
|
|
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();//重点注意!!!!
|
|
String point = item.getNemCode();//重点注意!!!!
|
|
Double val = 0.0;
|
|
Double val = 0.0;
|
|
if (CacheContext.wtmap.containsKey(key) && WindturbineQXDic.containsKey(key))
|
|
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;
|
|
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);
|
|
insertRt.add(rt);
|
|
|
|
|
|
|
|
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
- edosUtil.sendMultiRealTimeParamete(insertRt);
|
|
|
|
|
|
+ edosUtil.sendMultiPoint(insertRt);
|
|
this.execStatusAGCxd();
|
|
this.execStatusAGCxd();
|
|
//this.execStatuSL();
|
|
//this.execStatuSL();
|
|
|
|
|