|
@@ -38,29 +38,25 @@ public class StationPowerService {
|
|
|
Map<String, Map<String, ProBasicPowerstationPoint>> propointmap = CacheContext.propointmap;
|
|
|
Map<String, Map<String, ProBasicPowerstationPoint>> wppointmap = CacheContext.wppointmap;
|
|
|
|
|
|
-// 获取当前日期
|
|
|
+ // 获取当前日期
|
|
|
Date currentDate = new Date();
|
|
|
|
|
|
-// 创建 Calendar 对象,并设置为当前日期
|
|
|
+ // 创建 Calendar 对象,并设置为当前日期
|
|
|
Calendar calendar = Calendar.getInstance();
|
|
|
calendar.setTime(currentDate);
|
|
|
|
|
|
-// 将时间设为0点
|
|
|
+ // 将时间设为0点
|
|
|
calendar.set(Calendar.HOUR_OF_DAY, 0);
|
|
|
calendar.set(Calendar.MINUTE, 0);
|
|
|
calendar.set(Calendar.SECOND, 0);
|
|
|
calendar.set(Calendar.MILLISECOND, 0);
|
|
|
|
|
|
-// 设置 beginDate 为当天的0点
|
|
|
+ // 设置 beginDate 为前一天的0点
|
|
|
+ calendar.add(Calendar.DAY_OF_MONTH, -1);
|
|
|
Date beginDate = calendar.getTime();
|
|
|
|
|
|
-// 将时间设为23点59分59秒
|
|
|
- calendar.set(Calendar.HOUR_OF_DAY, 23);
|
|
|
- calendar.set(Calendar.MINUTE, 59);
|
|
|
- calendar.set(Calendar.SECOND, 59);
|
|
|
- calendar.set(Calendar.MILLISECOND, 999);
|
|
|
-
|
|
|
-// 设置 endDate 为当天的23点59分59秒
|
|
|
+ // 设置 endDate 为当天的0点
|
|
|
+ calendar.add(Calendar.DAY_OF_MONTH, 1);
|
|
|
Date endDate = calendar.getTime();
|
|
|
|
|
|
String wpId = null;
|
|
@@ -79,11 +75,8 @@ public class StationPowerService {
|
|
|
ProBasicPowerstationPoint sjgl = null;
|
|
|
|
|
|
for (ProBasicPowerstation Wp : wplLs) {
|
|
|
-
|
|
|
- if (Wp.getId().contains("MLJ"))continue;
|
|
|
+ if (Wp.getId().contains("MLJ")) continue;
|
|
|
wpId = Wp.getId();
|
|
|
-
|
|
|
-
|
|
|
pjllist = new ArrayList();
|
|
|
//得到此循环场站期次
|
|
|
for (ProBasicProject pj : pjls) {
|
|
@@ -113,129 +106,219 @@ public class StationPowerService {
|
|
|
sjgl = null;
|
|
|
|
|
|
if (wpId.endsWith("FDC_STA") && type.equals("F")) {
|
|
|
- ycgl = propointMap.get(ContantXk.ZYCGL);
|
|
|
+ ycgl = propointMap.get(ContantXk.GLYC);
|
|
|
sjgl = propointMap.get(ContantXk.PJGL15);
|
|
|
}
|
|
|
if (wpId.endsWith("GDC_STA") && type.equals("G")) {
|
|
|
- ycgl = propointMap.get(ContantXk.ZYCGL);
|
|
|
+ ycgl = propointMap.get(ContantXk.GLYC);
|
|
|
sjgl = propointMap.get(ContantXk.PJGL15);
|
|
|
}
|
|
|
|
|
|
- if (sjgl != null) {
|
|
|
+ if (ycgl != null && sjgl != null) {
|
|
|
+
|
|
|
List<PointData> ycglls = edosUtil.getHistoryDatasSnap(ycgl, beginDate.getTime() / 1000, endDate.getTime() / 1000, null, 900L);
|
|
|
List<PointData> sjglls = edosUtil.getHistoryDatasSnap(sjgl, beginDate.getTime() / 1000, endDate.getTime() / 1000, null, 900L);
|
|
|
|
|
|
+
|
|
|
+ double temp1 = 0;
|
|
|
+ double temp2 = 0;
|
|
|
double temp3 = 0;
|
|
|
double temp4 = 0;
|
|
|
+ double temp5 = 0;
|
|
|
|
|
|
- if (wpId.contains("GJY")) {
|
|
|
- for (int i = 0; i < sjglls.size(); i++) {
|
|
|
+ if (wp.getId().contains("SXJ_KGDL_GJYF01_EG") || wp.getId().equals("SXJ_KGDL_GJYF03_EG")) {
|
|
|
+ for (int i = 0; i < ycglls.size(); i++) {
|
|
|
ForecastVo vo = new ForecastVo();
|
|
|
+//
|
|
|
vo.setSjgl(0.0); //实际功率
|
|
|
vo.setYcgl(0.0); //功率预测
|
|
|
+//
|
|
|
vo.setHours(2023L); //时间戳
|
|
|
vo.setName(wpId);
|
|
|
|
|
|
- vo.setHours(sjglls.get(i).getPointTime());
|
|
|
+ vo.setHours(ycglls.get(i).getPointTime());
|
|
|
vo.setName("平鲁高家堰风电场");
|
|
|
|
|
|
vo.setId(wpId);
|
|
|
|
|
|
- temp3 = ycglls.get(i).getPointValueInDouble();
|
|
|
- vo.setYcgl(StringUtils.round(temp3, 2));
|
|
|
+ if (ycglls != null && !ycglls.isEmpty() && i < ycglls.size() && ycglls.get(i).getPointName() != null) {
|
|
|
+ temp3 = ycglls.get(i).getPointValueInDouble();
|
|
|
+ vo.setYcgl(StringUtils.round(temp3, 2));
|
|
|
+ }
|
|
|
+ if (sjglls != null && !sjglls.isEmpty() && i < sjglls.size() && sjglls.get(i).getPointName() != null) {
|
|
|
+ temp4 = sjglls.get(i).getPointValueInDouble();
|
|
|
+ vo.setSjgl(StringUtils.round(temp4 / 1000, 2));
|
|
|
+ }
|
|
|
|
|
|
- temp4 = sjglls.get(i).getPointValueInDouble();
|
|
|
- vo.setSjgl(StringUtils.round(temp4 /1000, 2));
|
|
|
+ vos1.add(vo);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ else if (wp.getId().contains("SXJ_KGDL_GJYF02_EG")) {
|
|
|
+ for (int i = 0; i < ycglls.size(); i++) {
|
|
|
+ ForecastVo vo = new ForecastVo();
|
|
|
+
|
|
|
+ vo.setSjgl(0.0); //实际功率
|
|
|
+ vo.setYcgl(0.0); //功率预测
|
|
|
+ vo.setHours(2023L); //时间戳
|
|
|
+ vo.setName(wpId);
|
|
|
+
|
|
|
+ vo.setHours(ycglls.get(i).getPointTime());
|
|
|
+ vo.setName("平鲁高家堰风电场");
|
|
|
+
|
|
|
+ vo.setId(wpId);
|
|
|
+
|
|
|
+
|
|
|
+ if (ycglls != null && !ycglls.isEmpty() && i < ycglls.size() && ycglls.get(i).getPointName() != null) {
|
|
|
+ temp3 = ycglls.get(i).getPointValueInDouble();
|
|
|
+ vo.setYcgl(StringUtils.round(temp3, 2));
|
|
|
+ }
|
|
|
+ if (sjglls != null && !sjglls.isEmpty() && i < sjglls.size() && sjglls.get(i).getPointName() != null) {
|
|
|
+ temp4 = sjglls.get(i).getPointValueInDouble();
|
|
|
+ vo.setSjgl(StringUtils.round(temp4 / 1000, 2));
|
|
|
+ }
|
|
|
|
|
|
vos1.add(vo);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- if (wpId.contains("TZ_GDC_STA")) {
|
|
|
- for (int i = 0; i < sjglls.size(); i++) {
|
|
|
+ if (wp.getId().contains("SXJ_KGDL_TZG01_EG") || wp.getId().contains("SXJ_KGDL_TZG05_EG")) {
|
|
|
+ for (int i = 0; i < ycglls.size(); i++) {
|
|
|
ForecastVo vo2 = new ForecastVo();
|
|
|
+
|
|
|
vo2.setSjgl(0.0); //实际功率
|
|
|
vo2.setYcgl(0.0); //功率预测
|
|
|
+
|
|
|
vo2.setHours(2023L); //时间戳
|
|
|
vo2.setName(wpId);
|
|
|
|
|
|
- vo2.setHours(sjglls.get(i).getPointTime());
|
|
|
+ vo2.setHours(ycglls.get(i).getPointTime());
|
|
|
vo2.setName("天镇电站");
|
|
|
vo2.setId(wpId);
|
|
|
|
|
|
- temp3 = ycglls.get(i).getPointValueInDouble();
|
|
|
- vo2.setYcgl(StringUtils.round(temp3, 2));
|
|
|
|
|
|
- temp4 = sjglls.get(i).getPointValueInDouble();
|
|
|
- vo2.setSjgl(StringUtils.round(temp4 /1000, 2));
|
|
|
+ if (ycglls != null && !ycglls.isEmpty() && i < ycglls.size() && ycglls.get(i).getPointName() != null) {
|
|
|
+ temp3 = ycglls.get(i).getPointValueInDouble();
|
|
|
+ vo2.setYcgl(StringUtils.round(temp3, 2));
|
|
|
+ }
|
|
|
+
|
|
|
+ if (sjglls != null && !sjglls.isEmpty() && i < sjglls.size() && sjglls.get(i).getPointName() != null) {
|
|
|
+ temp4 = sjglls.get(i).getPointValueInDouble();
|
|
|
+ vo2.setSjgl(StringUtils.round(temp4 / 1000, 2));
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ vos2.add(vo2);
|
|
|
+ }
|
|
|
+ }else if (wpId.contains("TZ_GDC_STA")) {
|
|
|
+ for (int i = 0; i < ycglls.size(); i++) {
|
|
|
+ ForecastVo vo2 = new ForecastVo();
|
|
|
+
|
|
|
+ vo2.setSjgl(0.0); //实际功率
|
|
|
+ vo2.setYcgl(0.0); //功率预测
|
|
|
+ vo2.setHours(2023L); //时间戳
|
|
|
+ vo2.setName(wpId);
|
|
|
+
|
|
|
+ vo2.setHours(ycglls.get(i).getPointTime());
|
|
|
+ vo2.setName("天镇电站");
|
|
|
+ vo2.setId(wpId);
|
|
|
+
|
|
|
+
|
|
|
+ if (ycglls != null && !ycglls.isEmpty() && i < ycglls.size() && ycglls.get(i).getPointName() != null) {
|
|
|
+ temp3 = ycglls.get(i).getPointValueInDouble();
|
|
|
+ vo2.setYcgl(StringUtils.round(temp3, 2));
|
|
|
+ }
|
|
|
+
|
|
|
+ if (sjglls != null && !sjglls.isEmpty() && i < sjglls.size() && sjglls.get(i).getPointName() != null) {
|
|
|
+ temp4 = sjglls.get(i).getPointValueInDouble();
|
|
|
+ vo2.setSjgl(StringUtils.round(temp4 / 1000, 2));
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
|
|
|
vos2.add(vo2);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
if (wpId.contains("PTZ_FDC_STA")) {
|
|
|
- for (int i = 0; i < sjglls.size(); i++) {
|
|
|
+ for (int i = 0; i < ycglls.size(); i++) {
|
|
|
ForecastVo vo3 = new ForecastVo();
|
|
|
+
|
|
|
vo3.setSjgl(0.0); //实际功率
|
|
|
vo3.setYcgl(0.0); //功率预测
|
|
|
vo3.setHours(2023L); //时间戳
|
|
|
vo3.setName(wpId);
|
|
|
|
|
|
- vo3.setHours(sjglls.get(i).getPointTime());
|
|
|
+ vo3.setHours(ycglls.get(i).getPointTime());
|
|
|
|
|
|
vo3.setName("寿阳平头镇风电场");
|
|
|
|
|
|
vo3.setId(wpId);
|
|
|
|
|
|
- temp3 = ycglls.get(i).getPointValueInDouble();
|
|
|
- vo3.setYcgl(StringUtils.round(temp3, 2));
|
|
|
|
|
|
- temp4 = sjglls.get(i).getPointValueInDouble();
|
|
|
- vo3.setSjgl(StringUtils.round(temp4 /1000, 2));
|
|
|
+ if (ycglls != null && !ycglls.isEmpty() && i < ycglls.size() && ycglls.get(i).getPointName() != null) {
|
|
|
+ temp3 = ycglls.get(i).getPointValueInDouble();
|
|
|
+ vo3.setYcgl(StringUtils.round(temp3, 2));
|
|
|
+ }
|
|
|
+ if (sjglls != null && !sjglls.isEmpty() && i < sjglls.size() && sjglls.get(i).getPointName() != null) {
|
|
|
+ temp4 = sjglls.get(i).getPointValueInDouble();
|
|
|
+ vo3.setSjgl(StringUtils.round(temp4 / 1000, 2));
|
|
|
+ }
|
|
|
+
|
|
|
vos3.add(vo3);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
if (wpId.contains("NJL")) {
|
|
|
- for (int i = 0; i < sjglls.size(); i++) {
|
|
|
+ for (int i = 0; i < ycglls.size(); i++) {
|
|
|
ForecastVo vo4 = new ForecastVo();
|
|
|
+
|
|
|
vo4.setSjgl(0.0); //实际功率
|
|
|
vo4.setYcgl(0.0); //功率预测
|
|
|
vo4.setHours(2023L); //时间戳
|
|
|
vo4.setName(wpId);
|
|
|
|
|
|
- vo4.setHours(sjglls.get(i).getPointTime());
|
|
|
+ vo4.setHours(ycglls.get(i).getPointTime());
|
|
|
|
|
|
vo4.setName("朔城牛家岭风电场");
|
|
|
|
|
|
vo4.setId(wpId);
|
|
|
|
|
|
- temp3 = ycglls.get(i).getPointValueInDouble();
|
|
|
- vo4.setYcgl(StringUtils.round(temp3, 2));
|
|
|
+ if (ycglls != null && !ycglls.isEmpty() && i < ycglls.size() && ycglls.get(i).getPointName() != null) {
|
|
|
+ temp3 = ycglls.get(i).getPointValueInDouble();
|
|
|
+ vo4.setYcgl(StringUtils.round(temp3, 2));
|
|
|
+ }
|
|
|
+
|
|
|
+ if (sjglls != null && !sjglls.isEmpty() && i < sjglls.size() && sjglls.get(i).getPointName() != null) {
|
|
|
+ temp4 = sjglls.get(i).getPointValueInDouble();
|
|
|
+ vo4.setSjgl(StringUtils.round(temp4 / 1000, 2));
|
|
|
+ }
|
|
|
+
|
|
|
|
|
|
- temp4 = sjglls.get(i).getPointValueInDouble();
|
|
|
- vo4.setSjgl(StringUtils.round(temp4 /1000, 2));
|
|
|
vos4.add(vo4);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
if (wpId.contains("SY")) {
|
|
|
- for (int i = 0; i < sjglls.size(); i++) {
|
|
|
+ for (int i = 0; i < ycglls.size(); i++) {
|
|
|
ForecastVo vo5 = new ForecastVo();
|
|
|
+
|
|
|
vo5.setSjgl(0.0); //实际功率
|
|
|
vo5.setYcgl(0.0); //功率预测
|
|
|
vo5.setHours(2023L); //时间戳
|
|
|
vo5.setName(wpId);
|
|
|
|
|
|
- vo5.setHours(sjglls.get(i).getPointTime());
|
|
|
+ vo5.setHours(ycglls.get(i).getPointTime());
|
|
|
vo5.setName("山阴电站");
|
|
|
vo5.setId(wpId);
|
|
|
|
|
|
- temp3 = ycglls.get(i).getPointValueInDouble();
|
|
|
- vo5.setYcgl(StringUtils.round(temp3, 2));
|
|
|
-
|
|
|
- temp4 = sjglls.get(i).getPointValueInDouble();
|
|
|
- vo5.setSjgl(StringUtils.round(temp4 /1000, 2));
|
|
|
+ if (ycglls != null && !ycglls.isEmpty() && i < ycglls.size() && ycglls.get(i).getPointName() != null) {
|
|
|
+ temp3 = ycglls.get(i).getPointValueInDouble();
|
|
|
+ vo5.setYcgl(StringUtils.round(temp3, 2));
|
|
|
+ }
|
|
|
+ if (sjglls != null && !sjglls.isEmpty() && i < sjglls.size() && sjglls.get(i).getPointName() != null) {
|
|
|
+ temp4 = sjglls.get(i).getPointValueInDouble();
|
|
|
+ vo5.setSjgl(StringUtils.round(temp4 / 1000, 2));
|
|
|
+ }
|
|
|
|
|
|
vos5.add(vo5);
|
|
|
}
|
|
@@ -243,61 +326,128 @@ public class StationPowerService {
|
|
|
|
|
|
|
|
|
if (wpId.contains("GJY")) {
|
|
|
- if (map.containsKey("SXJ_KGDL_GJYF01_EG")) {
|
|
|
- List<ForecastVo> previousVos1 = (List<ForecastVo>) map.get("SXJ_KGDL_GJYF01_EG");
|
|
|
- for (int i = 0; i < vos1.size(); i++) {
|
|
|
- ForecastVo previousVo1 = previousVos1.get(i);
|
|
|
- ForecastVo currentVo1 = vos1.get(i);
|
|
|
-
|
|
|
- currentVo1.setSjgl(previousVo1.getSjgl() + currentVo1.getSjgl());
|
|
|
- currentVo1.setYcgl(previousVo1.getYcgl() + currentVo1.getYcgl());
|
|
|
+ if (map.containsKey("SXJ_KGDL_GJY_FDC_STA")) {
|
|
|
+ List<ForecastVo> previousVos1 = (List<ForecastVo>) map.get("SXJ_KGDL_GJY_FDC_STA");
|
|
|
+ List<ForecastVo> currentVos1 = vos1; // 新建一个currentVos1列表来保存当前数据
|
|
|
+
|
|
|
+ if (previousVos1.size() != currentVos1.size()) {
|
|
|
+ int sizeDiff = Math.abs(previousVos1.size() - currentVos1.size());
|
|
|
+ if (previousVos1.size() > currentVos1.size()) {
|
|
|
+ // 如果previousVos1.size()大于currentVos1.size()
|
|
|
+ // 添加缺失的currentVo1对象到currentVos1列表中
|
|
|
+ for (int i = 0; i < sizeDiff; i++) {
|
|
|
+ currentVos1.add(null);
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ // 如果previousVos1.size()小于currentVos1.size()
|
|
|
+ // 添加缺失的previousVo1对象到previousVos1列表中
|
|
|
+ for (int i = 0; i < sizeDiff; i++) {
|
|
|
+ previousVos1.add(null);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
|
|
|
+ for (int i = 0; i < previousVos1.size(); i++) {
|
|
|
+ ForecastVo previousVo1 = previousVos1.get(i);
|
|
|
+ ForecastVo currentVo1 = currentVos1.get(i);
|
|
|
+ if (previousVo1 != null && currentVo1 != null) {
|
|
|
+ if (previousVo1.getSjgl() != null && currentVo1.getSjgl() != null) {
|
|
|
+ currentVo1.setSjgl(StringUtils.round(previousVo1.getSjgl() + currentVo1.getSjgl(),2));
|
|
|
+ }
|
|
|
+ if (previousVo1.getYcgl() != null && currentVo1.getYcgl() != null) {
|
|
|
+ currentVo1.setYcgl(StringUtils.round(previousVo1.getYcgl() + currentVo1.getYcgl(),2));
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
} else if (wpId.contains("TZ_GDC_STA")) {
|
|
|
- if (map.containsKey("SXJ_KGDL_TZG01_EG")) {
|
|
|
- List<ForecastVo> previousVos1 = (List<ForecastVo>) map.get("SXJ_KGDL_TZG01_EG");
|
|
|
- for (int i = 0; i < vos2.size(); i++) {
|
|
|
+ if (map.containsKey("SXJ_KGDL_TZ_GDC_STA")) {
|
|
|
+ List<ForecastVo> previousVos1 = (List<ForecastVo>) map.get("SXJ_KGDL_TZ_GDC_STA");
|
|
|
+ List<ForecastVo> currentVos1 = vos2; // 新建一个currentVos1列表来保存当前数据
|
|
|
+
|
|
|
+ if (previousVos1.size() != currentVos1.size()) {
|
|
|
+ int sizeDiff = Math.abs(previousVos1.size() - currentVos1.size());
|
|
|
+ if (previousVos1.size() > currentVos1.size()) {
|
|
|
+ // 如果previousVos1.size()大于currentVos1.size()
|
|
|
+ // 添加缺失的currentVo1对象到currentVos1列表中
|
|
|
+ for (int i = 0; i < sizeDiff; i++) {
|
|
|
+ currentVos1.add(null);
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ // 如果previousVos1.size()小于currentVos1.size()
|
|
|
+ // 添加缺失的previousVo1对象到previousVos1列表中
|
|
|
+ for (int i = 0; i < sizeDiff; i++) {
|
|
|
+ previousVos1.add(null);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ for (int i = 0; i < previousVos1.size(); i++) {
|
|
|
ForecastVo previousVo1 = previousVos1.get(i);
|
|
|
- ForecastVo currentVo1 = vos2.get(i);
|
|
|
+ ForecastVo currentVo1 = currentVos1.get(i);
|
|
|
+ if (previousVo1 != null && currentVo1 != null) {
|
|
|
|
|
|
- currentVo1.setSjgl(previousVo1.getSjgl() + currentVo1.getSjgl());
|
|
|
- currentVo1.setYcgl(previousVo1.getYcgl() + currentVo1.getYcgl());
|
|
|
+ if (previousVo1.getSjgl() != null && currentVo1.getSjgl() != null) {
|
|
|
+ currentVo1.setSjgl(StringUtils.round(previousVo1.getSjgl() + currentVo1.getSjgl(),2));
|
|
|
+ }
|
|
|
+ if (previousVo1.getYcgl() != null && currentVo1.getYcgl() != null) {
|
|
|
+ currentVo1.setYcgl(StringUtils.round(previousVo1.getYcgl() + currentVo1.getYcgl(),2));
|
|
|
+ }
|
|
|
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
} else if (wpId.contains("SY")) {
|
|
|
- if (map.containsKey("SXJ_KGDL_SYG01_EG")) {
|
|
|
- List<ForecastVo> previousVos1 = (List<ForecastVo>) map.get("SXJ_KGDL_SYG01_EG");
|
|
|
+ if (map.containsKey("SXJ_KGDL_SY_GDC_STA")) {
|
|
|
+ List<ForecastVo> previousVos1 = (List<ForecastVo>) map.get("SXJ_KGDL_SY_GDC_STA");
|
|
|
for (int i = 0; i < vos5.size(); i++) {
|
|
|
ForecastVo previousVo1 = previousVos1.get(i);
|
|
|
ForecastVo currentVo1 = vos5.get(i);
|
|
|
+ if (previousVo1 != null && currentVo1 != null) {
|
|
|
|
|
|
- currentVo1.setSjgl(previousVo1.getSjgl() + currentVo1.getSjgl());
|
|
|
- currentVo1.setYcgl(previousVo1.getYcgl() + currentVo1.getYcgl());
|
|
|
+ if (previousVo1.getSjgl() != null && currentVo1.getSjgl() != null) {
|
|
|
+ currentVo1.setSjgl(StringUtils.round(previousVo1.getSjgl() + currentVo1.getSjgl(),2));
|
|
|
+ }
|
|
|
+ if (previousVo1.getYcgl() != null && currentVo1.getYcgl() != null) {
|
|
|
+ currentVo1.setYcgl(StringUtils.round(previousVo1.getYcgl() + currentVo1.getYcgl(),2));
|
|
|
+ }
|
|
|
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
} else if (wpId.contains("NJL")) {
|
|
|
- if (map.containsKey("SXJ_KGDL_NJLF01_EG")) {
|
|
|
- List<ForecastVo> previousVos1 = (List<ForecastVo>) map.get("SXJ_KGDL_NJLF01_EG");
|
|
|
+ if (map.containsKey("SXJ_KGDL_NJL_FDC_STA")) {
|
|
|
+ List<ForecastVo> previousVos1 = (List<ForecastVo>) map.get("SXJ_KGDL_NJL_FDC_STA");
|
|
|
for (int i = 0; i < vos4.size(); i++) {
|
|
|
ForecastVo previousVo1 = previousVos1.get(i);
|
|
|
ForecastVo currentVo1 = vos4.get(i);
|
|
|
+ if (previousVo1 != null && currentVo1 != null) {
|
|
|
|
|
|
- currentVo1.setSjgl(previousVo1.getSjgl() + currentVo1.getSjgl());
|
|
|
- currentVo1.setYcgl(previousVo1.getYcgl() + currentVo1.getYcgl());
|
|
|
+ if (previousVo1.getSjgl() != null && currentVo1.getSjgl() != null) {
|
|
|
+ currentVo1.setSjgl(StringUtils.round(previousVo1.getSjgl() + currentVo1.getSjgl(),2));
|
|
|
+ }
|
|
|
+ if (previousVo1.getYcgl() != null && currentVo1.getYcgl() != null) {
|
|
|
+ currentVo1.setYcgl(StringUtils.round(previousVo1.getYcgl() + currentVo1.getYcgl(),2));
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
} else if (wpId.contains("PTZ_FDC_STA")) {
|
|
|
- if (map.containsKey("SXJ_KGDL_PTZF01_EG")) {
|
|
|
- List<ForecastVo> previousVos1 = (List<ForecastVo>) map.get("SXJ_KGDL_PTZF01_EG");
|
|
|
+ if (map.containsKey("SXJ_KGDL_PTZ_FDC_STA")) {
|
|
|
+ List<ForecastVo> previousVos1 = (List<ForecastVo>) map.get("SXJ_KGDL_PTZ_FDC_STA");
|
|
|
for (int i = 0; i < vos3.size(); i++) {
|
|
|
ForecastVo previousVo1 = previousVos1.get(i);
|
|
|
ForecastVo currentVo1 = vos3.get(i);
|
|
|
-
|
|
|
- currentVo1.setSjgl(previousVo1.getSjgl() + currentVo1.getSjgl());
|
|
|
- currentVo1.setYcgl(previousVo1.getYcgl() + currentVo1.getYcgl());
|
|
|
+ if (previousVo1 != null && currentVo1 != null) {
|
|
|
+ if (previousVo1.getSjgl() != null && currentVo1.getSjgl() != null) {
|
|
|
+ currentVo1.setSjgl(StringUtils.round(previousVo1.getSjgl() + currentVo1.getSjgl(),2));
|
|
|
+ }
|
|
|
+ if (previousVo1.getYcgl() != null && currentVo1.getYcgl() != null) {
|
|
|
+ currentVo1.setYcgl(StringUtils.round(previousVo1.getYcgl() + currentVo1.getYcgl(),2));
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -320,7 +470,7 @@ public class StationPowerService {
|
|
|
}
|
|
|
|
|
|
if (wpId.contains("SY")) {
|
|
|
- map.put("SXJ_KGDL_SY_FDC_STA", vos5);
|
|
|
+ map.put("SXJ_KGDL_SY_GDC_STA", vos5);
|
|
|
}
|
|
|
|
|
|
}
|
|
@@ -329,38 +479,47 @@ public class StationPowerService {
|
|
|
} else {
|
|
|
for (ProBasicPowerstation wp : station) {
|
|
|
vos = new ArrayList<>();
|
|
|
+
|
|
|
Map<String, ProBasicPowerstationPoint> proBasicWppointMap = wppointmap.get(wp.getId());
|
|
|
ProBasicPowerstationPoint ycgl1 = null;
|
|
|
ProBasicPowerstationPoint sjgl1 = null;
|
|
|
|
|
|
if (wpId.endsWith("FDC_STA") && type.equals("F")) {
|
|
|
- ycgl1 = proBasicWppointMap.get( ContantXk.ZYCGL);
|
|
|
+ ycgl1 = proBasicWppointMap.get( ContantXk.GLYC);
|
|
|
sjgl1 = proBasicWppointMap.get(ContantXk.PJGL15);
|
|
|
}
|
|
|
if (wpId.endsWith("GDC_STA") && type.equals("G")) {
|
|
|
- ycgl1 = proBasicWppointMap.get(ContantXk.ZYCGL);
|
|
|
+ ycgl1 = proBasicWppointMap.get(ContantXk.GLYC);
|
|
|
sjgl1 = proBasicWppointMap.get(ContantXk.PJGL15);
|
|
|
}
|
|
|
- if (sjgl1 != null) {
|
|
|
+ if (ycgl1 != null && sjgl1 != null) {
|
|
|
+
|
|
|
List<PointData> ycglls = edosUtil.getHistoryDatasSnap(ycgl1, beginDate.getTime() / 1000, endDate.getTime() / 1000, null, 900L);
|
|
|
List<PointData> sjglls = edosUtil.getHistoryDatasSnap(sjgl1, beginDate.getTime() / 1000, endDate.getTime() / 1000, null, 900L);
|
|
|
-
|
|
|
+ double temp1 = 0;
|
|
|
+ double temp2 = 0;
|
|
|
double temp3 = 0;
|
|
|
double temp4 = 0;
|
|
|
- for (int i = 0; i < sjglls.size(); i++) {
|
|
|
+ double temp5 = 0;
|
|
|
+ for (int i = 0; i < ycglls.size(); i++) {
|
|
|
|
|
|
ForecastVo vo = new ForecastVo();
|
|
|
vo.setSjgl(0.0); //实际功率
|
|
|
vo.setYcgl(0.0); //功率预测
|
|
|
+
|
|
|
vo.setHours(2023L); //时间戳
|
|
|
vo.setName(wpId);
|
|
|
|
|
|
- temp3 = ycglls.get(i).getPointValueInDouble();
|
|
|
- vo.setYcgl(StringUtils.round(temp3, 2));
|
|
|
|
|
|
- temp4 = sjglls.get(i).getPointValueInDouble();
|
|
|
- vo.setSjgl(StringUtils.round(temp4 /1000, 2));
|
|
|
- vo.setHours(sjglls.get(i).getPointTime());
|
|
|
+ if (ycglls != null && !ycglls.isEmpty() && i < ycglls.size() && ycglls.get(i).getPointName() != null) {
|
|
|
+ temp3 = ycglls.get(i).getPointValueInDouble();
|
|
|
+ vo.setYcgl(StringUtils.round(temp3, 2));
|
|
|
+ }
|
|
|
+ if (sjglls != null && !sjglls.isEmpty() && i < sjglls.size() && sjglls.get(i).getPointName() != null) {
|
|
|
+ temp4 = sjglls.get(i).getPointValueInDouble();
|
|
|
+ vo.setSjgl(StringUtils.round(temp4 / 1000, 2));
|
|
|
+ }
|
|
|
+ vo.setHours(ycglls.get(i).getPointTime());
|
|
|
|
|
|
vo.setName(wp.getAname());
|
|
|
vo.setId(wpId);
|
|
@@ -404,7 +563,7 @@ public class StationPowerService {
|
|
|
power.setId(StringUtils.getUUID());
|
|
|
power.setPowerAccuracy(BigDecimal.valueOf(accuracy));
|
|
|
power.setWindpowerstationId(p1.getId());
|
|
|
- power.setRecordDate(currenttime);
|
|
|
+ power.setRecordDate(beginDate);
|
|
|
power.setDayPowerForecast(BigDecimal.valueOf(dlycTotal));
|
|
|
stringList.add(power);
|
|
|
powerService.batchAdd(stringList);
|