Commit 40edb89b authored by caotao's avatar caotao

运行监盘-泰和日月年发电量由计算改为测点直取,运行列表、实时数据日月年光伏系数转换。

parent f1162d4d
package com.yeejoin.amos.boot.module.jxiop.biz.constants; package com.yeejoin.amos.boot.module.jxiop.biz.constants;
import com.sun.javafx.logging.PulseLogger;
import org.checkerframework.checker.units.qual.C; import org.checkerframework.checker.units.qual.C;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap; import java.util.HashMap;
import java.util.List;
public class CommonConstans { public class CommonConstans {
//光伏发电量系数 //光伏发电量系数
public static final Double pvGenPoweActor = 0.000001; public static final Double pvGenPoweActor = 0.000001;
public static final Double pvGenPoweActorDay = 1.0; public static final Double pvGenPoweActorDay = 1.0;
public static final Double pvGenPoweActorYear = 0.0001; public static final Double pvGenPoweActorYear = 0.0001;
public static final Double pvGenPoweActorCurrentData = 0.0001;
// 风电站: // 风电站:
// (日/月/年)发电量=场站所有风机(日/月/年)发电量总和 // (日/月/年)发电量=场站所有风机(日/月/年)发电量总和
// 装机容量=场站所有风机装机容量总和 // 装机容量=场站所有风机装机容量总和
...@@ -107,4 +112,10 @@ public class CommonConstans { ...@@ -107,4 +112,10 @@ public class CommonConstans {
public static final String Twodecimalplaces= "%.2f"; public static final String Twodecimalplaces= "%.2f";
public static final String Fourdecimalplaces = "%.4f"; public static final String Fourdecimalplaces = "%.4f";
public static final String QueryStringFrontMoudleNotKeyWord = "frontModule"; public static final String QueryStringFrontMoudleNotKeyWord = "frontModule";
//泰和的发电量数据
public static final List<String> taiHeGenIndicator = new ArrayList<>(Arrays.asList("泰和日发电量总和","泰和月发电量总和","泰和年发电量总和"));
public static final String taiHeGenIndicatorDay = "泰和日发电量总和";
public static final String taiHeGenIndicatorMonth = "泰和月发电量总和";
public static final String taiHeGenIndicatorYear = "泰和年发电量总和";
} }
...@@ -614,14 +614,14 @@ public class MonitorFanIdxController extends BaseController { ...@@ -614,14 +614,14 @@ public class MonitorFanIdxController extends BaseController {
StationBasic stationBasic = stationBasicMapper.selectById(stationId); StationBasic stationBasic = stationBasicMapper.selectById(stationId);
String gatewayId = stationBasic.getFanGatewayId(); String gatewayId = stationBasic.getFanGatewayId();
String boosterGatewayId = stationBasic.getBoosterGatewayId(); String boosterGatewayId = stationBasic.getBoosterGatewayId();
String[] columnList = new String[]{"日发电量", "月发电量", "年发电量"}; String[] columnList = new String[]{CommonConstans.taiHeGenIndicatorDay, CommonConstans.taiHeGenIndicatorMonth, CommonConstans.taiHeGenIndicatorYear};
String[] columnLists = new String[]{"有功功率"}; String[] columnLists = new String[]{"有功功率"};
Map<String, Object> columnMap = new HashMap<>(); Map<String, Object> columnMap = new HashMap<>();
//日 月 年发电量同仅统计逆变器数据 //日 月 年发电量同仅统计逆变器数据
List<Map<String, Object>> mapList; List<Map<String, Object>> mapList;
for (String column : columnList) { for (String column : columnList) {
Double result = commonService.getTotalByIndicatiorByGF(gatewayId, column); Double result = commonService.getTotalByIndicatiorByGF(boosterGatewayId, column);
columnMap.put(column, result); columnMap.put(column, result);
} }
...@@ -641,25 +641,25 @@ public class MonitorFanIdxController extends BaseController { ...@@ -641,25 +641,25 @@ public class MonitorFanIdxController extends BaseController {
data.put("title", columnMap.get("装机容量").toString()); data.put("title", columnMap.get("装机容量").toString());
objects.add(data); objects.add(data);
Map<String, Object> data1 = new HashMap<>(); Map<String, Object> data1 = new HashMap<>();
data1.put("title", columnMap.get("日发电量").toString()); data1.put("title", columnMap.get(CommonConstans.taiHeGenIndicatorDay).toString());
objects.add(data1); objects.add(data1);
Map<String, Object> data2 = new HashMap<>(); Map<String, Object> data2 = new HashMap<>();
data2.put("title", columnMap.get("风机台数").toString().replace(".0", "")); data2.put("title", columnMap.get("风机台数").toString().replace(".0", ""));
objects.add(data2); objects.add(data2);
Map<String, Object> data3 = new HashMap<>(); Map<String, Object> data3 = new HashMap<>();
data3.put("title", columnMap.get("月发电量").toString()); data3.put("title", columnMap.get(CommonConstans.taiHeGenIndicatorMonth).toString());
objects.add(data3); objects.add(data3);
Map<String, Object> data4 = new HashMap<>(); Map<String, Object> data4 = new HashMap<>();
data4.put("title", String.format("%.2f", commonService.getSumByEquipmentIndxName(result1, "WTX-801_25_WTX-801_总辐射"))); data4.put("title", String.format("%.2f", commonService.getSumByEquipmentIndxName(result1, "WTX-801_25_WTX-801_总辐射")));
objects.add(data4); objects.add(data4);
Map<String, Object> data5 = new HashMap<>(); Map<String, Object> data5 = new HashMap<>();
data5.put("title", columnMap.get("年发电量").toString()); data5.put("title", columnMap.get(CommonConstans.taiHeGenIndicatorYear).toString());
objects.add(data5); objects.add(data5);
Map<String, Object> data6 = new HashMap<>(); Map<String, Object> data6 = new HashMap<>();
data6.put("title", columnMap.get("有功功率").toString()); data6.put("title", columnMap.get("有功功率").toString());
objects.add(data6); objects.add(data6);
Map<String, Object> data7 = new HashMap<>(); Map<String, Object> data7 = new HashMap<>();
data7.put("title", String.format("%.2f", ((Double.parseDouble(columnMap.get("日发电量").toString()) * CommonConstans.wkwhToMv) / (Double.parseDouble(columnMap.get("装机容量").toString()))))); data7.put("title", String.format("%.2f", ((Double.parseDouble(columnMap.get(CommonConstans.taiHeGenIndicatorDay).toString()) * CommonConstans.wkwhToMv) / (Double.parseDouble(columnMap.get("装机容量").toString())))));
objects.add(data7); objects.add(data7);
Map<String, Object> data8 = new HashMap<>(); Map<String, Object> data8 = new HashMap<>();
data8.put("title", String.format("%.2f", commonService.getSumByEquipmentIndxName(result1, "WTX-801_25_WTX-801_总辐射累计"))); data8.put("title", String.format("%.2f", commonService.getSumByEquipmentIndxName(result1, "WTX-801_25_WTX-801_总辐射累计")));
......
...@@ -235,24 +235,16 @@ public class CommonServiceImpl { ...@@ -235,24 +235,16 @@ public class CommonServiceImpl {
//用于组装-es查询条件 //用于组装-es查询条件
Map<String, List<String>> queryCondtion = new HashMap<>(); Map<String, List<String>> queryCondtion = new HashMap<>();
Map<String, String> likeQuerCondtion = new HashMap<>();
queryCondtion.put(CommonConstans.QueryStringEquipmentIndexName, Arrays.asList(indicator)); queryCondtion.put(CommonConstans.QueryStringEquipmentIndexName, Arrays.asList(indicator));
queryCondtion.put(CommonConstans.QueryStringGateWayId, Arrays.asList(gatewayId)); queryCondtion.put(CommonConstans.QueryStringGateWayId, Arrays.asList(gatewayId));
likeQuerCondtion.put(CommonConstans.QueryStringFrontMoudle, "逆变器"); List<ESEquipments> result = getListDataByCondtions(queryCondtion, null, ESEquipments.class);
List<ESEquipments> result = getListDataByCondtions(queryCondtion, null, ESEquipments.class, likeQuerCondtion);
Double totalvalue = 0.00; Double totalvalue = 0.00;
try { try {
totalvalue = result.stream().filter(stringObjectMap -> !ObjectUtils.isEmpty(stringObjectMap.getValueF())).mapToDouble(l -> Double.parseDouble(l.getValueF().toString())).sum(); totalvalue = result.stream().filter(stringObjectMap -> !ObjectUtils.isEmpty(stringObjectMap.getValueF())).mapToDouble(l -> Double.parseDouble(l.getValueF().toString())).sum();
} catch (Exception e) { } catch (Exception e) {
return totalvalue; return totalvalue;
} }
if (indicator.equals("日发电量")) { return Double.valueOf(String.format("%.4f", totalvalue ));
return Double.valueOf(String.format("%.4f", totalvalue * CommonConstans.pvGenPoweActor * CommonConstans.pvGenPoweActorDay));
}
if (indicator.equals("年发电量")) {
return Double.valueOf(String.format("%.4f", totalvalue * CommonConstans.pvGenPoweActorYear));
}
return Double.valueOf(String.format("%.4f", totalvalue * CommonConstans.pvGenPoweActor));
} }
public Double getTotalByIndicatiorAndParams(String gatewayId, String indicator, String querySql) { public Double getTotalByIndicatiorAndParams(String gatewayId, String indicator, String querySql) {
......
...@@ -219,7 +219,7 @@ public class MonitorFanIndicatorImpl implements IMonitorFanIndicator { ...@@ -219,7 +219,7 @@ public class MonitorFanIndicatorImpl implements IMonitorFanIndicator {
esEquipments.setValue(String.format(CommonConstans.Fourdecimalplaces, Double.valueOf(esEquipments.getValue()) * CommonConstans.pvGenPoweActor * CommonConstans.pvGenPoweActorDay)); esEquipments.setValue(String.format(CommonConstans.Fourdecimalplaces, Double.valueOf(esEquipments.getValue()) * CommonConstans.pvGenPoweActor * CommonConstans.pvGenPoweActorDay));
} }
if (powerOther.contains(esEquipments.getEquipmentIndexName())) { if (powerOther.contains(esEquipments.getEquipmentIndexName())) {
esEquipments.setValue(String.format(CommonConstans.Fourdecimalplaces, Double.valueOf(esEquipments.getValue()) * CommonConstans.pvGenPoweActor)); esEquipments.setValue(String.format(CommonConstans.Fourdecimalplaces, Double.valueOf(esEquipments.getValue()) * CommonConstans.pvGenPoweActorCurrentData));
} }
}); });
} }
...@@ -1600,7 +1600,17 @@ public class MonitorFanIndicatorImpl implements IMonitorFanIndicator { ...@@ -1600,7 +1600,17 @@ public class MonitorFanIndicatorImpl implements IMonitorFanIndicator {
} }
return s; return s;
} }
public String keepFourDecimalPlaces(String value) {
String s = "0.0000";
if (!ObjectUtils.isEmpty(value)) {
try {
s = String.format(CommonConstans.Fourdecimalplaces, Double.parseDouble(value));
} catch (Exception ex) {
}
}
return s;
}
public HashMap<String, Object> SpeedIndicator(String gatewayId, String equipmentNumber, String equipmentIndexName) { public HashMap<String, Object> SpeedIndicator(String gatewayId, String equipmentNumber, String equipmentIndexName) {
HashMap<String, Object> resultMap = new HashMap<>(); HashMap<String, Object> resultMap = new HashMap<>();
Map<String, List<String>> queryCondtion = new HashMap<>(); Map<String, List<String>> queryCondtion = new HashMap<>();
...@@ -1743,11 +1753,11 @@ public class MonitorFanIndicatorImpl implements IMonitorFanIndicator { ...@@ -1743,11 +1753,11 @@ public class MonitorFanIndicatorImpl implements IMonitorFanIndicator {
break; break;
case "日发电量": case "日发电量":
double v = Double.parseDouble(e.getValueF().toString()) * CommonConstans.pvGenPoweActor; double v = Double.parseDouble(e.getValueF().toString()) * CommonConstans.pvGenPoweActor;
map.put("dayNum", keepTwoDecimalPlaces(String.valueOf(v))); map.put("dayNum", keepFourDecimalPlaces(String.valueOf(v)));
break; break;
case "总发电量": case "总发电量":
double a = Double.parseDouble(e.getValueF().toString()) * CommonConstans.pvGenPoweActor; double a = Double.parseDouble(e.getValueF().toString()) * CommonConstans.pvGenPoweActorCurrentData;
map.put("yearNum", keepTwoDecimalPlaces(String.valueOf(a))); map.put("yearNum", keepFourDecimalPlaces(String.valueOf(a)));
break; break;
} }
}); });
......
...@@ -101,12 +101,11 @@ public class MonitoringServiceIMQTTmpl { ...@@ -101,12 +101,11 @@ public class MonitoringServiceIMQTTmpl {
totalSocialContribution.updateAndGet(v -> v + commonServiceImpl.getTotalByIndicatior(stationBasic.getFanGatewayId(), "年发电量")); totalSocialContribution.updateAndGet(v -> v + commonServiceImpl.getTotalByIndicatior(stationBasic.getFanGatewayId(), "年发电量"));
} else { } else {
Map<String, List<String>> queryCondtion = new HashMap<>(); Map<String, List<String>> queryCondtion = new HashMap<>();
queryCondtion.put(CommonConstans.QueryStringEquipmentIndexName, Arrays.asList("日发电量", "月发电量", "年发电量")); queryCondtion.put(CommonConstans.QueryStringEquipmentIndexName, Arrays.asList(CommonConstans.taiHeGenIndicatorYear));
queryCondtion.put(CommonConstans.QueryStringGateWayId, Arrays.asList(stationBasic.getFanGatewayId())); queryCondtion.put(CommonConstans.QueryStringGateWayId, Arrays.asList(stationBasic.getBoosterGatewayId()));
Map<String, String> shouldQueryCondtion = new HashMap<>();
shouldQueryCondtion.put(CommonConstans.QueryStringFrontMoudle, "逆变器"); List<ESEquipments> result = commonServiceImpl.getListDataByCondtions(queryCondtion, null, ESEquipments.class);
List<ESEquipments> result = commonServiceImpl.getListDataByCondtions(queryCondtion, null, ESEquipments.class, shouldQueryCondtion); totalSocialContribution.updateAndGet(v -> v + commonServiceImpl.getSumByEquipmentIndxName(result, CommonConstans.taiHeGenIndicatorYear));
totalSocialContribution.updateAndGet(v -> v + commonServiceImpl.getSumByEquipmentIndxName(result, "年发电量") * CommonConstans.pvGenPoweActor);
} }
}); });
Page<SocialContributionDto> socialContributionDtoPage = commonService.getSocialContributionDtoList(totalSocialContribution.get()); Page<SocialContributionDto> socialContributionDtoPage = commonService.getSocialContributionDtoList(totalSocialContribution.get());
...@@ -154,14 +153,12 @@ public class MonitoringServiceIMQTTmpl { ...@@ -154,14 +153,12 @@ public class MonitoringServiceIMQTTmpl {
annualPower.updateAndGet(v -> v + monitoringServiceImpl.keepFourdecimalPlaces(commonServiceImpl.getSumByEquipmentIndxName(result, "年发电量"))); annualPower.updateAndGet(v -> v + monitoringServiceImpl.keepFourdecimalPlaces(commonServiceImpl.getSumByEquipmentIndxName(result, "年发电量")));
} else { } else {
Map<String, List<String>> queryCondtion = new HashMap<>(); Map<String, List<String>> queryCondtion = new HashMap<>();
queryCondtion.put(CommonConstans.QueryStringEquipmentIndexName, Arrays.asList("日发电量", "月发电量", "年发电量")); queryCondtion.put(CommonConstans.QueryStringEquipmentIndexName, CommonConstans.taiHeGenIndicator);
queryCondtion.put(CommonConstans.QueryStringGateWayId, Arrays.asList(stationBasic.getFanGatewayId())); queryCondtion.put(CommonConstans.QueryStringGateWayId, Arrays.asList(stationBasic.getBoosterGatewayId()));
Map<String, String> likeQuerCondtion = new HashMap<>(); List<ESEquipments> result = commonServiceImpl.getListDataByCondtions(queryCondtion, null, ESEquipments.class);
likeQuerCondtion.put(CommonConstans.QueryStringFrontMoudle, "逆变器"); dailyPower.updateAndGet(v -> v + monitoringServiceImpl.keepFourdecimalPlaces(commonServiceImpl.getSumByEquipmentIndxName(result, CommonConstans.taiHeGenIndicatorDay) ));
List<ESEquipments> result = commonServiceImpl.getListDataByCondtions(queryCondtion, null, ESEquipments.class, likeQuerCondtion); monthlyPower.updateAndGet(v -> v + monitoringServiceImpl.keepFourdecimalPlaces(commonServiceImpl.getSumByEquipmentIndxName(result, CommonConstans.taiHeGenIndicatorMonth)));
dailyPower.updateAndGet(v -> v + monitoringServiceImpl.keepFourdecimalPlaces(commonServiceImpl.getSumByEquipmentIndxName(result, "日发电量") * CommonConstans.pvGenPoweActor * CommonConstans.pvGenPoweActorDay)); annualPower.updateAndGet(v -> v + monitoringServiceImpl.keepFourdecimalPlaces(commonServiceImpl.getSumByEquipmentIndxName(result, CommonConstans.taiHeGenIndicatorYear) ));
monthlyPower.updateAndGet(v -> v + monitoringServiceImpl.keepFourdecimalPlaces(commonServiceImpl.getSumByEquipmentIndxName(result, "月发电量") * CommonConstans.pvGenPoweActor));
annualPower.updateAndGet(v -> v + monitoringServiceImpl.keepFourdecimalPlaces(commonServiceImpl.getSumByEquipmentIndxName(result, "年发电量") * CommonConstans.pvGenPoweActor));
} }
}); });
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment