|
@@ -80,14 +80,14 @@ public class NewIvPvCurveFittingService {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- public Map<String, List<PhotovoltaicInfo>> getDatas2File1(String stationid, long start, long end, int interval) {
|
|
|
+ public Map<String, List<PhotovoltaicInfo>> getDatas2File1(String stationid,List<String> inverters, long start, long end, int interval) {
|
|
|
|
|
|
int daym = 24 * 60 * 60 * 1000;
|
|
|
Map<String, List<PhotovoltaicInfo>> wj = new HashMap<>();
|
|
|
//按天
|
|
|
for (long i = start; i < end; i += daym) {
|
|
|
|
|
|
- List<List<PhotovoltaicInfo>> datas = getDatas(stationid, i, i + daym, interval);
|
|
|
+ List<List<PhotovoltaicInfo>> datas = getDatasnotfile(stationid,inverters, i, i + daym, interval);
|
|
|
for (List<PhotovoltaicInfo> data : datas) {
|
|
|
List<PhotovoltaicInfo> infos = wj.get(data.get(0).getInverter());
|
|
|
if (infos == null) {
|
|
@@ -629,6 +629,120 @@ public class NewIvPvCurveFittingService {
|
|
|
return infosLit;
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 获取数据
|
|
|
+ *
|
|
|
+ * @return 逆变器,列表
|
|
|
+ */
|
|
|
+ public List<List<PhotovoltaicInfo>> getDatasnotfile(String stationid,List<String> inverters, long start, long end, int interval) {
|
|
|
+ //间隔
|
|
|
+ interval = 5 * 60; //5分钟-300
|
|
|
+
|
|
|
+ //获得测点
|
|
|
+ Map<String, String> zglpoints = getPoints1(stationid,inverters, "zgl");
|
|
|
+ Map<String, String> llglpoints = getPoints1(stationid,inverters, "llgl");
|
|
|
+ Map<String, String> adypoints = getPoints1(stationid,inverters, "ady");
|
|
|
+ Map<String, String> bdypoints = getPoints1(stationid, inverters,"bdy");
|
|
|
+ Map<String, String> cdypoints = getPoints1(stationid, inverters,"cdy");
|
|
|
+ Map<String, String> adlpoints = getPoints1(stationid,inverters, "adl");
|
|
|
+ Map<String, String> bdlpoints = getPoints1(stationid, inverters,"bdl");
|
|
|
+ Map<String, String> cdlpoints = getPoints1(stationid, inverters,"cdl");
|
|
|
+
|
|
|
+ List<ProBasicWeatherStation> weatherStations = weatherStationService.getBaseMapper().selectList(null);
|
|
|
+ List<ProBasicWeatherStation> collect = weatherStations.stream().filter(c -> stationid.equals(c.getWindpowerstationId())).collect(Collectors.toList());
|
|
|
+
|
|
|
+ String station = collect.get(0).getId();
|
|
|
+
|
|
|
+ ProBasicPowerstationPoint zfsPoint = InitialRunner.newzfsMap.get(stationid);
|
|
|
+ ProBasicPowerstationPoint zjwdPoint = InitialRunner.newzjwdMap.get(station);
|
|
|
+
|
|
|
+ //总辐射
|
|
|
+ // List<TsDoubleData> zfsDatas = adpClient.getHistorySnap(zfsPoint.getNemCode(), start, end, interval);
|
|
|
+
|
|
|
+ List<TsDoubleData> zfsDatas = remoteService.adapterfd().getHistorySnap(zfsPoint.getNemCode(), start, end, interval);
|
|
|
+
|
|
|
+ //组件温度
|
|
|
+ // List<TsDoubleData> zjwdDatas = adpClient.getHistorySnap(zjwdPoint.getNemCode(), start, end, interval);
|
|
|
+
|
|
|
+ List<TsDoubleData> zjwdDatas = remoteService.adaptergf().getHistorySnap(zjwdPoint.getNemCode(), start, end, interval);
|
|
|
+
|
|
|
+ List<List<PhotovoltaicInfo>> infosLit = new ArrayList<>();
|
|
|
+ //按逆变器
|
|
|
+ for (String wtid : zglpoints.keySet()) {
|
|
|
+
|
|
|
+ //总功率
|
|
|
+ // List<TsDoubleData> zglDatas = adpClient.getHistorySnap(zglpoints.get(wtid), start, end, interval);
|
|
|
+ List<TsDoubleData> zglDatas = remoteService.adaptergf().getHistorySnap(zglpoints.get(wtid), start, end, interval);
|
|
|
+ List<TsDoubleData> llglDatas = remoteService.adapterfd().getHistorySnap(llglpoints.get(wtid), start, end, interval);
|
|
|
+
|
|
|
+ //电网A相电压
|
|
|
+ // List<TsDoubleData> adyDatas = adpClient.getHistorySnap(adypoints.get(wtid), start, end, interval);
|
|
|
+ List<TsDoubleData> adyDatas = remoteService.adaptergf().getHistorySnap(adypoints.get(wtid), start, end, interval);
|
|
|
+ //电网A相电流
|
|
|
+ // List<TsDoubleData> adlDatas = adpClient.getHistorySnap(adlpoints.get(wtid), start, end, interval);
|
|
|
+ List<TsDoubleData> adlDatas = remoteService.adaptergf().getHistorySnap(adlpoints.get(wtid), start, end, interval);
|
|
|
+
|
|
|
+ List<PhotovoltaicInfo> infos = new ArrayList<>();
|
|
|
+
|
|
|
+ List<TsDoubleData> bdyDatas = null, cdyDatas = null, bdlDatas = null, cdlDatas = null;
|
|
|
+ if ("HZJ_GDC".equals(stationid) || "AK_GDC".equals(stationid)) {
|
|
|
+ //电网B相电压
|
|
|
+ bdyDatas = adpClient.getHistorySnap(bdypoints.get(wtid), start, end, interval);
|
|
|
+ //电网C相电压
|
|
|
+ cdyDatas = adpClient.getHistorySnap(cdypoints.get(wtid), start, end, interval);
|
|
|
+ //电网B相电流
|
|
|
+ bdlDatas = adpClient.getHistorySnap(bdlpoints.get(wtid), start, end, interval);
|
|
|
+ //电网C相电流
|
|
|
+ cdlDatas = adpClient.getHistorySnap(cdlpoints.get(wtid), start, end, interval);
|
|
|
+ }
|
|
|
+
|
|
|
+ for (int j = 0; j < zfsDatas.size(); j++) {
|
|
|
+ PhotovoltaicInfo info = new PhotovoltaicInfo();
|
|
|
+ info.setStation(stationid);
|
|
|
+ info.setInverter(wtid);
|
|
|
+ long ts = zfsDatas.get(j).getTs();
|
|
|
+ info.setTime(ts);
|
|
|
+ info.setDatetime(DateUtils.date2StringL(new Date(ts)));
|
|
|
+
|
|
|
+ info.setT(double3Decimal(zjwdDatas.get(j).getDoubleValue()));
|
|
|
+ info.setS(double3Decimal(zfsDatas.get(j).getDoubleValue(), false));
|
|
|
+ if ("HZJ_GDC".equals(stationid) || "AK_GDC".equals(stationid)) {
|
|
|
+ info.setAI(double3Decimal(adlDatas.get(j).getDoubleValue(), false));
|
|
|
+ info.setBI(double3Decimal(bdlDatas.get(j).getDoubleValue(), false));
|
|
|
+ info.setCI(double3Decimal(cdlDatas.get(j).getDoubleValue(), false));
|
|
|
+ info.setAV(double3Decimal(adyDatas.get(j).getDoubleValue(), true));
|
|
|
+ info.setBV(double3Decimal(bdyDatas.get(j).getDoubleValue(), true));
|
|
|
+ info.setCV(double3Decimal(cdyDatas.get(j).getDoubleValue(), true));
|
|
|
+ } else {
|
|
|
+ if (adlDatas.size() >= 1) {
|
|
|
+ info.setI(double3Decimal(adlDatas.get(j).getDoubleValue(), false));
|
|
|
+ } else {
|
|
|
+ info.setI(0);
|
|
|
+ }
|
|
|
+ if (adyDatas.size() >= 1) {
|
|
|
+ info.setV(double3Decimal(adyDatas.get(j).getDoubleValue(), true));
|
|
|
+ } else {
|
|
|
+ info.setV(0);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (zglDatas.size() >= 1) {
|
|
|
+ info.setActualP(double3Decimal(zglDatas.get(j).getDoubleValue(), false));
|
|
|
+ } else {
|
|
|
+ info.setActualP(0);
|
|
|
+ }
|
|
|
+ if (llglDatas.size() >= 1) {
|
|
|
+ info.setIdeaP(double3Decimal(llglDatas.get(j).getDoubleValue(), false));
|
|
|
+ } else {
|
|
|
+ info.setIdeaP(0);
|
|
|
+ }
|
|
|
+ infos.add(info);
|
|
|
+ }
|
|
|
+ infosLit.add(infos);
|
|
|
+ }
|
|
|
+
|
|
|
+ return infosLit;
|
|
|
+ }
|
|
|
+
|
|
|
private double double3Decimal(double d) {
|
|
|
BigDecimal bd = new BigDecimal(d);
|
|
|
return bd.setScale(3, BigDecimal.ROUND_HALF_UP).doubleValue();
|
|
@@ -686,6 +800,48 @@ public class NewIvPvCurveFittingService {
|
|
|
return new HashMap<>();
|
|
|
}
|
|
|
|
|
|
+ private Map<String, String> getPoints1(String stationid, List<String> inverters, String key) {
|
|
|
+
|
|
|
+ for (String wt : inverters) {
|
|
|
+ switch (key) {
|
|
|
+ case "zgl":
|
|
|
+ //总功率
|
|
|
+ return InitialRunner.newzglMap.get(stationid).stream().filter(c -> !c.getNemCode().equals("INTIAL") && c.getWindturbineId().equals(wt)).collect(Collectors.toMap(ProBasicEquipmentPoint::getWindturbineId, ProBasicEquipmentPoint::getNemCode));
|
|
|
+ case "llgl":
|
|
|
+ //总功率
|
|
|
+ return InitialRunner.newllglMap.get(stationid).stream().filter(c -> !c.getNemCode().equals("INTIAL")&& c.getWindturbineId().equals(wt)).collect(Collectors.toMap(ProBasicEquipmentPoint::getWindturbineId, ProBasicEquipmentPoint::getNemCode));
|
|
|
+
|
|
|
+ case "ady":
|
|
|
+ List<ProBasicEquipmentPoint> adyPoints = null;
|
|
|
+ if ("HZJ_GDC".equals(stationid)) {
|
|
|
+ //电网A相电压
|
|
|
+ adyPoints = proBasicEquipmentPointService.getPoints(stationid, null, "AIG005");
|
|
|
+ } else {
|
|
|
+ //电网A相电压
|
|
|
+ adyPoints = proBasicEquipmentPointService.getPoints(stationid, null, "AIG005");
|
|
|
+ }
|
|
|
+
|
|
|
+ return adyPoints.stream().filter(c -> !c.getNemCode().equals("INTIAL")&& c.getWindturbineId().equals(wt)).collect(Collectors.toMap(ProBasicEquipmentPoint::getWindturbineId, ProBasicEquipmentPoint::getNemCode));
|
|
|
+ case "bdy":
|
|
|
+ List<ProBasicEquipmentPoint> bdyPoints = proBasicEquipmentPointService.getPoints(stationid, null, "AIG008");
|
|
|
+ return bdyPoints.stream().filter(c -> !c.getNemCode().equals("INTIAL")&& c.getWindturbineId().equals(wt)).collect(Collectors.toMap(ProBasicEquipmentPoint::getWindturbineId, ProBasicEquipmentPoint::getNemCode));
|
|
|
+ case "cdy":
|
|
|
+ List<ProBasicEquipmentPoint> cdyPoints = proBasicEquipmentPointService.getPoints(stationid, null, "AIG011");
|
|
|
+ return cdyPoints.stream().filter(c -> !c.getNemCode().equals("INTIAL")&& c.getWindturbineId().equals(wt)).collect(Collectors.toMap(ProBasicEquipmentPoint::getWindturbineId, ProBasicEquipmentPoint::getNemCode));
|
|
|
+ case "adl":
|
|
|
+ List<ProBasicEquipmentPoint> adlPoints = proBasicEquipmentPointService.getPoints(stationid, null, "AIG004");
|
|
|
+ return adlPoints.stream().filter(c -> !c.getNemCode().equals("INTIAL")&& c.getWindturbineId().equals(wt)).collect(Collectors.toMap(ProBasicEquipmentPoint::getWindturbineId, ProBasicEquipmentPoint::getNemCode));
|
|
|
+ case "bdl":
|
|
|
+ List<ProBasicEquipmentPoint> bdlPoints = proBasicEquipmentPointService.getPoints(stationid, null, "AIG007");
|
|
|
+ return bdlPoints.stream().filter(c -> !c.getNemCode().equals("INTIAL")&& c.getWindturbineId().equals(wt)).collect(Collectors.toMap(ProBasicEquipmentPoint::getWindturbineId, ProBasicEquipmentPoint::getNemCode));
|
|
|
+ case "cdl":
|
|
|
+ List<ProBasicEquipmentPoint> cdlPoints = proBasicEquipmentPointService.getPoints(stationid, null, "AIG010");
|
|
|
+ return cdlPoints.stream().filter(c -> !c.getNemCode().equals("INTIAL")&& c.getWindturbineId().equals(wt)).collect(Collectors.toMap(ProBasicEquipmentPoint::getWindturbineId, ProBasicEquipmentPoint::getNemCode));
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return new HashMap<>();
|
|
|
+ }
|
|
|
+
|
|
|
public int deleteFiles(List<String> fileList) {
|
|
|
String fs = config.getFilePathPrepare() + "gf";
|
|
|
List<PhotovoltaicInfo> infoList = new ArrayList<>();
|
|
@@ -748,7 +904,9 @@ public class NewIvPvCurveFittingService {
|
|
|
if (!StringUtils.isEmpty(yk)) {
|
|
|
String[] key = yk.split(",");
|
|
|
for (String k : key) {
|
|
|
- list.addAll(dataScangfService.getMapYY().get(k));
|
|
|
+ Map<String, List<PhotovoltaicInfo>> mapYY = dataScangfService.getMapYY();
|
|
|
+ List<PhotovoltaicInfo> photovoltaicInfos = mapYY.get(k);
|
|
|
+ list.addAll(photovoltaicInfos);
|
|
|
}
|
|
|
}
|
|
|
if (!StringUtils.isEmpty(wk)) {
|