Commit 36316fe9 authored by tangwei's avatar tangwei

解决冲突

parents d197aae2 40edb89b
package com.yeejoin.amos.kgd.config;
import org.springframework.context.annotation.Configuration;
import javax.annotation.PostConstruct;
/**
* @Author: xl
* @Description:
* @Date: 2023/10/9 18:45
*/
@Configuration
public class SocketConfig {
@PostConstruct
public void init() {
}
}
package com.yeejoin.amos.boot.module.jxiop.biz.constants;
import com.sun.javafx.logging.PulseLogger;
import org.checkerframework.checker.units.qual.C;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
public class CommonConstans {
//光伏发电量系数
public static final Double pvGenPoweActor = 0.000001;
public static final Double pvGenPoweActorDay = 1.0;
public static final Double pvGenPoweActorYear = 0.0001;
public static final Double pvGenPoweActorCurrentData = 0.0001;
// 风电站:
// (日/月/年)发电量=场站所有风机(日/月/年)发电量总和
// 装机容量=场站所有风机装机容量总和
......@@ -107,4 +112,10 @@ public class CommonConstans {
public static final String Twodecimalplaces= "%.2f";
public static final String Fourdecimalplaces = "%.4f";
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 {
StationBasic stationBasic = stationBasicMapper.selectById(stationId);
String gatewayId = stationBasic.getFanGatewayId();
String boosterGatewayId = stationBasic.getBoosterGatewayId();
String[] columnList = new String[]{"日发电量", "月发电量", "年发电量"};
String[] columnList = new String[]{CommonConstans.taiHeGenIndicatorDay, CommonConstans.taiHeGenIndicatorMonth, CommonConstans.taiHeGenIndicatorYear};
String[] columnLists = new String[]{"有功功率"};
Map<String, Object> columnMap = new HashMap<>();
//日 月 年发电量同仅统计逆变器数据
List<Map<String, Object>> mapList;
for (String column : columnList) {
Double result = commonService.getTotalByIndicatiorByGF(gatewayId, column);
Double result = commonService.getTotalByIndicatiorByGF(boosterGatewayId, column);
columnMap.put(column, result);
}
......@@ -641,25 +641,25 @@ public class MonitorFanIdxController extends BaseController {
data.put("title", columnMap.get("装机容量").toString());
objects.add(data);
Map<String, Object> data1 = new HashMap<>();
data1.put("title", columnMap.get("日发电量").toString());
data1.put("title", columnMap.get(CommonConstans.taiHeGenIndicatorDay).toString());
objects.add(data1);
Map<String, Object> data2 = new HashMap<>();
data2.put("title", columnMap.get("风机台数").toString().replace(".0", ""));
objects.add(data2);
Map<String, Object> data3 = new HashMap<>();
data3.put("title", columnMap.get("月发电量").toString());
data3.put("title", columnMap.get(CommonConstans.taiHeGenIndicatorMonth).toString());
objects.add(data3);
Map<String, Object> data4 = new HashMap<>();
data4.put("title", String.format("%.2f", commonService.getSumByEquipmentIndxName(result1, "WTX-801_25_WTX-801_总辐射")));
objects.add(data4);
Map<String, Object> data5 = new HashMap<>();
data5.put("title", columnMap.get("年发电量").toString());
data5.put("title", columnMap.get(CommonConstans.taiHeGenIndicatorYear).toString());
objects.add(data5);
Map<String, Object> data6 = new HashMap<>();
data6.put("title", columnMap.get("有功功率").toString());
objects.add(data6);
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);
Map<String, Object> data8 = new HashMap<>();
data8.put("title", String.format("%.2f", commonService.getSumByEquipmentIndxName(result1, "WTX-801_25_WTX-801_总辐射累计")));
......
......@@ -235,24 +235,16 @@ public class CommonServiceImpl {
//用于组装-es查询条件
Map<String, List<String>> queryCondtion = new HashMap<>();
Map<String, String> likeQuerCondtion = new HashMap<>();
queryCondtion.put(CommonConstans.QueryStringEquipmentIndexName, Arrays.asList(indicator));
queryCondtion.put(CommonConstans.QueryStringGateWayId, Arrays.asList(gatewayId));
likeQuerCondtion.put(CommonConstans.QueryStringFrontMoudle, "逆变器");
List<ESEquipments> result = getListDataByCondtions(queryCondtion, null, ESEquipments.class, likeQuerCondtion);
List<ESEquipments> result = getListDataByCondtions(queryCondtion, null, ESEquipments.class);
Double totalvalue = 0.00;
try {
totalvalue = result.stream().filter(stringObjectMap -> !ObjectUtils.isEmpty(stringObjectMap.getValueF())).mapToDouble(l -> Double.parseDouble(l.getValueF().toString())).sum();
} catch (Exception e) {
return totalvalue;
}
if (indicator.equals("日发电量")) {
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));
return Double.valueOf(String.format("%.4f", totalvalue ));
}
public Double getTotalByIndicatiorAndParams(String gatewayId, String indicator, String querySql) {
......
......@@ -219,7 +219,7 @@ public class MonitorFanIndicatorImpl implements IMonitorFanIndicator {
esEquipments.setValue(String.format(CommonConstans.Fourdecimalplaces, Double.valueOf(esEquipments.getValue()) * CommonConstans.pvGenPoweActor * CommonConstans.pvGenPoweActorDay));
}
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 {
}
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) {
HashMap<String, Object> resultMap = new HashMap<>();
Map<String, List<String>> queryCondtion = new HashMap<>();
......@@ -1743,11 +1753,11 @@ public class MonitorFanIndicatorImpl implements IMonitorFanIndicator {
break;
case "日发电量":
double v = Double.parseDouble(e.getValueF().toString()) * CommonConstans.pvGenPoweActor;
map.put("dayNum", keepTwoDecimalPlaces(String.valueOf(v)));
map.put("dayNum", keepFourDecimalPlaces(String.valueOf(v)));
break;
case "总发电量":
double a = Double.parseDouble(e.getValueF().toString()) * CommonConstans.pvGenPoweActor;
map.put("yearNum", keepTwoDecimalPlaces(String.valueOf(a)));
double a = Double.parseDouble(e.getValueF().toString()) * CommonConstans.pvGenPoweActorCurrentData;
map.put("yearNum", keepFourDecimalPlaces(String.valueOf(a)));
break;
}
});
......
......@@ -101,12 +101,11 @@ public class MonitoringServiceIMQTTmpl {
totalSocialContribution.updateAndGet(v -> v + commonServiceImpl.getTotalByIndicatior(stationBasic.getFanGatewayId(), "年发电量"));
} else {
Map<String, List<String>> queryCondtion = new HashMap<>();
queryCondtion.put(CommonConstans.QueryStringEquipmentIndexName, Arrays.asList("日发电量", "月发电量", "年发电量"));
queryCondtion.put(CommonConstans.QueryStringGateWayId, Arrays.asList(stationBasic.getFanGatewayId()));
Map<String, String> shouldQueryCondtion = new HashMap<>();
shouldQueryCondtion.put(CommonConstans.QueryStringFrontMoudle, "逆变器");
List<ESEquipments> result = commonServiceImpl.getListDataByCondtions(queryCondtion, null, ESEquipments.class, shouldQueryCondtion);
totalSocialContribution.updateAndGet(v -> v + commonServiceImpl.getSumByEquipmentIndxName(result, "年发电量") * CommonConstans.pvGenPoweActor);
queryCondtion.put(CommonConstans.QueryStringEquipmentIndexName, Arrays.asList(CommonConstans.taiHeGenIndicatorYear));
queryCondtion.put(CommonConstans.QueryStringGateWayId, Arrays.asList(stationBasic.getBoosterGatewayId()));
List<ESEquipments> result = commonServiceImpl.getListDataByCondtions(queryCondtion, null, ESEquipments.class);
totalSocialContribution.updateAndGet(v -> v + commonServiceImpl.getSumByEquipmentIndxName(result, CommonConstans.taiHeGenIndicatorYear));
}
});
Page<SocialContributionDto> socialContributionDtoPage = commonService.getSocialContributionDtoList(totalSocialContribution.get());
......@@ -154,14 +153,12 @@ public class MonitoringServiceIMQTTmpl {
annualPower.updateAndGet(v -> v + monitoringServiceImpl.keepFourdecimalPlaces(commonServiceImpl.getSumByEquipmentIndxName(result, "年发电量")));
} else {
Map<String, List<String>> queryCondtion = new HashMap<>();
queryCondtion.put(CommonConstans.QueryStringEquipmentIndexName, Arrays.asList("日发电量", "月发电量", "年发电量"));
queryCondtion.put(CommonConstans.QueryStringGateWayId, Arrays.asList(stationBasic.getFanGatewayId()));
Map<String, String> likeQuerCondtion = new HashMap<>();
likeQuerCondtion.put(CommonConstans.QueryStringFrontMoudle, "逆变器");
List<ESEquipments> result = commonServiceImpl.getListDataByCondtions(queryCondtion, null, ESEquipments.class, likeQuerCondtion);
dailyPower.updateAndGet(v -> v + monitoringServiceImpl.keepFourdecimalPlaces(commonServiceImpl.getSumByEquipmentIndxName(result, "日发电量") * CommonConstans.pvGenPoweActor * CommonConstans.pvGenPoweActorDay));
monthlyPower.updateAndGet(v -> v + monitoringServiceImpl.keepFourdecimalPlaces(commonServiceImpl.getSumByEquipmentIndxName(result, "月发电量") * CommonConstans.pvGenPoweActor));
annualPower.updateAndGet(v -> v + monitoringServiceImpl.keepFourdecimalPlaces(commonServiceImpl.getSumByEquipmentIndxName(result, "年发电量") * CommonConstans.pvGenPoweActor));
queryCondtion.put(CommonConstans.QueryStringEquipmentIndexName, CommonConstans.taiHeGenIndicator);
queryCondtion.put(CommonConstans.QueryStringGateWayId, Arrays.asList(stationBasic.getBoosterGatewayId()));
List<ESEquipments> result = commonServiceImpl.getListDataByCondtions(queryCondtion, null, ESEquipments.class);
dailyPower.updateAndGet(v -> v + monitoringServiceImpl.keepFourdecimalPlaces(commonServiceImpl.getSumByEquipmentIndxName(result, CommonConstans.taiHeGenIndicatorDay) ));
monthlyPower.updateAndGet(v -> v + monitoringServiceImpl.keepFourdecimalPlaces(commonServiceImpl.getSumByEquipmentIndxName(result, CommonConstans.taiHeGenIndicatorMonth)));
annualPower.updateAndGet(v -> v + monitoringServiceImpl.keepFourdecimalPlaces(commonServiceImpl.getSumByEquipmentIndxName(result, CommonConstans.taiHeGenIndicatorYear) ));
}
});
......
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