Commit 35af08af authored by caotao's avatar caotao

BUG:14399 进入片区,江西区域电量指标完成情况>日月年发电量数据对不上

parent 43b30bf5
...@@ -190,7 +190,7 @@ public class MonitoringServiceIMQTTmpl { ...@@ -190,7 +190,7 @@ public class MonitoringServiceIMQTTmpl {
socialContributionDtoPage.setTotal(100); socialContributionDtoPage.setTotal(100);
socialContributionDtoPage.setCurrent(1); socialContributionDtoPage.setCurrent(1);
try { try {
emqKeeper.getMqttClient().publish("completionofpowerindicator_topic", JSON.toJSON(socialContributionDtoPage).toString().getBytes("UTF-8"), 1, true); // emqKeeper.getMqttClient().publish("completionofpowerindicator_topic", JSON.toJSON(socialContributionDtoPage).toString().getBytes("UTF-8"), 1, true);
logger.info("-----------------发送区域实时生产数据消息=================== 成功!" + JSON.toJSONString(socialContributionDtoPage)); logger.info("-----------------发送区域实时生产数据消息=================== 成功!" + JSON.toJSONString(socialContributionDtoPage));
} catch (Exception exception) { } catch (Exception exception) {
logger.error("-----------------发送区域实时生产数据消息=================== 失败!"); logger.error("-----------------发送区域实时生产数据消息=================== 失败!");
......
...@@ -172,7 +172,6 @@ public class MonitoringServiceImpl { ...@@ -172,7 +172,6 @@ public class MonitoringServiceImpl {
public ResultsData getCompletionOfPowerIndicatorsByProvinceName(int current, int size, String provinceName) { public ResultsData getCompletionOfPowerIndicatorsByProvinceName(int current, int size, String provinceName) {
List<ColModel> colModels = new ArrayList<>(); List<ColModel> colModels = new ArrayList<>();
List<CompletionOfPowerIndicatorsDto> completionOfPowerIndicatorsDtoList = new ArrayList<>(); List<CompletionOfPowerIndicatorsDto> completionOfPowerIndicatorsDtoList = new ArrayList<>();
ColModel colModelStatitonName = new ColModel("stationName", "stationName", "场站", "场站", "dataGrid", "stationName"); ColModel colModelStatitonName = new ColModel("stationName", "stationName", "场站", "场站", "dataGrid", "stationName");
...@@ -191,6 +190,30 @@ public class MonitoringServiceImpl { ...@@ -191,6 +190,30 @@ public class MonitoringServiceImpl {
colModels.add(colModelAnnualPower); colModels.add(colModelAnnualPower);
List<StationCacheInfoDto> stationCacheInfoDtoList = commonServiceImpl.getListStationCacheInfoDto(); List<StationCacheInfoDto> stationCacheInfoDtoList = commonServiceImpl.getListStationCacheInfoDto();
List<StationCacheInfoDto> stationCacheInfoDtos = stationCacheInfoDtoList.stream().filter(stationCacheInfoDto -> stationCacheInfoDto.getBelongProvince().equals(provinceName)).collect(Collectors.toList()); List<StationCacheInfoDto> stationCacheInfoDtos = stationCacheInfoDtoList.stream().filter(stationCacheInfoDto -> stationCacheInfoDto.getBelongProvince().equals(provinceName)).collect(Collectors.toList());
//日发电量
AtomicReference<Double> dailyPower = new AtomicReference<>(0.0);
//月发电量
AtomicReference<Double> monthlyPower = new AtomicReference<>(0.0);
//年发电量
AtomicReference<Double> annualPower = new AtomicReference<>(0.0);
//年发电量完成比例
String completionRatio = "0.00";
//年利用小时数
int year = Calendar.getInstance().get(Calendar.YEAR);
List<String> fdz = stationCacheInfoDtos.stream().map(StationCacheInfoDto::getStationId).collect(Collectors.toList());
LambdaQueryWrapper<StationPlan> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.eq(StationPlan::getYear, String.valueOf(year));
queryWrapper.in(StationPlan::getStationBasicId, fdz);
List<StationPlan> fdzPlans = stationPlanMapper.selectList(queryWrapper);
double value = fdzPlans.stream().mapToDouble(StationPlan::getValue).sum();
AtomicReference<Double> useHours = new AtomicReference<>(0.0);
AtomicReference<Double> installCapacity = new AtomicReference<>(0.0);
AtomicReference<Double> fdzInstallCapacity = new AtomicReference<>(0.0);
AtomicReference<Double> gfzinstallCapacity = new AtomicReference<>(0.0);
//年发电量
AtomicReference<Double> fdzannualPower = new AtomicReference<>(0.0);
AtomicReference<Double> gfzannualPower = new AtomicReference<>(0.0);
//遍历列表 //遍历列表
stationCacheInfoDtos.forEach(stationCacheInfoDto -> { stationCacheInfoDtos.forEach(stationCacheInfoDto -> {
CompletionOfPowerIndicatorsDto completionOfPowerIndicatorsDto = new CompletionOfPowerIndicatorsDto(); CompletionOfPowerIndicatorsDto completionOfPowerIndicatorsDto = new CompletionOfPowerIndicatorsDto();
...@@ -213,6 +236,11 @@ public class MonitoringServiceImpl { ...@@ -213,6 +236,11 @@ public class MonitoringServiceImpl {
completionOfPowerIndicatorsDto.setDailyPower(String.format(CommonConstans.Fourdecimalplaces, commonServiceImpl.getSumByEquipmentIndxName(result, "日发电量"))); completionOfPowerIndicatorsDto.setDailyPower(String.format(CommonConstans.Fourdecimalplaces, commonServiceImpl.getSumByEquipmentIndxName(result, "日发电量")));
completionOfPowerIndicatorsDto.setMonthlyPower(String.format(CommonConstans.Fourdecimalplaces, commonServiceImpl.getSumByEquipmentIndxName(result, "月发电量"))); completionOfPowerIndicatorsDto.setMonthlyPower(String.format(CommonConstans.Fourdecimalplaces, commonServiceImpl.getSumByEquipmentIndxName(result, "月发电量")));
completionOfPowerIndicatorsDto.setAnnualPower(String.format(CommonConstans.Fourdecimalplaces, commonServiceImpl.getSumByEquipmentIndxName(result, "年发电量"))); completionOfPowerIndicatorsDto.setAnnualPower(String.format(CommonConstans.Fourdecimalplaces, commonServiceImpl.getSumByEquipmentIndxName(result, "年发电量")));
dailyPower.updateAndGet(v -> v + keepFourdecimalPlaces(commonServiceImpl.getSumByEquipmentIndxName(result, "日发电量")));
monthlyPower.updateAndGet(v -> v + keepFourdecimalPlaces(commonServiceImpl.getSumByEquipmentIndxName(result, "月发电量")));
annualPower.updateAndGet(v -> v + keepFourdecimalPlaces(commonServiceImpl.getSumByEquipmentIndxName(result, "年发电量")));
fdzannualPower.updateAndGet(v -> v + keepFourdecimalPlaces(commonServiceImpl.getSumByEquipmentIndxName(result, "年发电量")));
fdzInstallCapacity.updateAndGet(v -> v + Double.parseDouble(stationCacheInfoDto.getInstalledCapacity()));
} 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("日发电量", "月发电量", "年发电量"));
...@@ -229,6 +257,11 @@ public class MonitoringServiceImpl { ...@@ -229,6 +257,11 @@ public class MonitoringServiceImpl {
completionOfPowerIndicatorsDto.setDailyPower(String.format(CommonConstans.Fourdecimalplaces, commonServiceImpl.getSumByEquipmentIndxName(result, "日发电量") * CommonConstans.pvGenPoweActor * CommonConstans.pvGenPoweActorDay)); completionOfPowerIndicatorsDto.setDailyPower(String.format(CommonConstans.Fourdecimalplaces, commonServiceImpl.getSumByEquipmentIndxName(result, "日发电量") * CommonConstans.pvGenPoweActor * CommonConstans.pvGenPoweActorDay));
completionOfPowerIndicatorsDto.setMonthlyPower(String.format(CommonConstans.Fourdecimalplaces, commonServiceImpl.getSumByEquipmentIndxName(result, "月发电量") * CommonConstans.pvGenPoweActor)); completionOfPowerIndicatorsDto.setMonthlyPower(String.format(CommonConstans.Fourdecimalplaces, commonServiceImpl.getSumByEquipmentIndxName(result, "月发电量") * CommonConstans.pvGenPoweActor));
completionOfPowerIndicatorsDto.setAnnualPower(String.format(CommonConstans.Fourdecimalplaces, commonServiceImpl.getSumByEquipmentIndxName(result, "年发电量") * CommonConstans.pvGenPoweActor)); completionOfPowerIndicatorsDto.setAnnualPower(String.format(CommonConstans.Fourdecimalplaces, commonServiceImpl.getSumByEquipmentIndxName(result, "年发电量") * CommonConstans.pvGenPoweActor));
dailyPower.updateAndGet(v -> v + keepFourdecimalPlaces(commonServiceImpl.getSumByEquipmentIndxName(result, "日发电量") * CommonConstans.pvGenPoweActor * CommonConstans.pvGenPoweActorDay));
monthlyPower.updateAndGet(v -> v + keepFourdecimalPlaces(commonServiceImpl.getSumByEquipmentIndxName(result, "月发电量") * CommonConstans.pvGenPoweActor));
annualPower.updateAndGet(v -> v + keepFourdecimalPlaces(commonServiceImpl.getSumByEquipmentIndxName(result, "年发电量") * CommonConstans.pvGenPoweActor));
gfzannualPower.updateAndGet(v -> v + keepFourdecimalPlaces(commonServiceImpl.getSumByEquipmentIndxName(result, "年发电量") * CommonConstans.pvGenPoweActor));
gfzinstallCapacity.updateAndGet(v -> v + Double.parseDouble(stationCacheInfoDto.getInstalledCapacity()));
} }
} catch (Exception exception) { } catch (Exception exception) {
completionOfPowerIndicatorsDto.setWindSpeedOrIrradiance("0"); completionOfPowerIndicatorsDto.setWindSpeedOrIrradiance("0");
...@@ -239,82 +272,8 @@ public class MonitoringServiceImpl { ...@@ -239,82 +272,8 @@ public class MonitoringServiceImpl {
} }
completionOfPowerIndicatorsDtoList.add(completionOfPowerIndicatorsDto); completionOfPowerIndicatorsDtoList.add(completionOfPowerIndicatorsDto);
}); });
Integer allsize = completionOfPowerIndicatorsDtoList.size();
DataGridMock dataGridMock = new DataGridMock(current, allsize, false, allsize / size + 1, completionOfPowerIndicatorsDtoList);
ResultsData resultsData = new ResultsData(dataGridMock, colModels);
return resultsData;
}
public void getCompletionOfPowerIndicatorsByCurrentData(List<StationCacheInfoDto> stationBasicList, String provinceName) {
String provinceNameTopic = "";
if (provinceName.contains("黑龙江") || provinceName.contains("内蒙古")) {
provinceNameTopic = provinceName.substring(0, 3);
} else {
provinceNameTopic = provinceName.substring(0, 2);
}
HashMap<String, String> stringHashMap = new HashMap<>();
stringHashMap.put("title", provinceNameTopic + "区域");
try {
emqKeeper.getMqttClient().publish("proviceName_topic", JSON.toJSON(stringHashMap).toString().getBytes("UTF-8"), 1, true);
logger.info("----------------------------------推送省份名称消息成功败--------------------------------");
} catch (Exception e) {
logger.info("----------------------------------推送省份名称消息失败--------------------------------");
}
Page<SocialContributionDto> socialContributionDtoPage = new Page<SocialContributionDto>(); Page<SocialContributionDto> socialContributionDtoPage = new Page<SocialContributionDto>();
logger.error("--------------------------区域实时数据消息开始发送----------------------------------------------");
List<SocialContributionDto> socialContributionDtoList = new ArrayList<>(); List<SocialContributionDto> socialContributionDtoList = new ArrayList<>();
//日发电量
AtomicReference<Double> dailyPower = new AtomicReference<>(0.0);
//月发电量
AtomicReference<Double> monthlyPower = new AtomicReference<>(0.0);
//年发电量
AtomicReference<Double> annualPower = new AtomicReference<>(0.0);
//年发电量完成比例
String completionRatio = "0.00";
//年利用小时数
int year = Calendar.getInstance().get(Calendar.YEAR);
List<String> fdz = stationBasicList.stream().map(StationCacheInfoDto::getStationId).collect(Collectors.toList());
LambdaQueryWrapper<StationPlan> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.eq(StationPlan::getYear, String.valueOf(year));
queryWrapper.in(StationPlan::getStationBasicId, fdz);
List<StationPlan> fdzPlans = stationPlanMapper.selectList(queryWrapper);
double value = fdzPlans.stream().mapToDouble(StationPlan::getValue).sum();
AtomicReference<Double> useHours = new AtomicReference<>(0.0);
AtomicReference<Double> installCapacity = new AtomicReference<>(0.0);
AtomicReference<Double> fdzInstallCapacity = new AtomicReference<>(0.0);
AtomicReference<Double> gfzinstallCapacity = new AtomicReference<>(0.0);
//年发电量
AtomicReference<Double> fdzannualPower = new AtomicReference<>(0.0);
AtomicReference<Double> gfzannualPower = new AtomicReference<>(0.0);
stationBasicList.forEach(stationCacheInfoDto -> {
Map<String, List<String>> queryMap = new HashMap<>();
queryMap.put("equipmentIndexName.keyword", Arrays.asList("日发电量", "月发电量", "年发电量"));
queryMap.put("gatewayId.keyword", Arrays.asList(stationCacheInfoDto.getFanGatewayId()));
if ("FDZ".equals(stationCacheInfoDto.getStationType())) {
Map<String, List<String>> queryCondtion = new HashMap<>();
queryCondtion.put(CommonConstans.QueryStringEquipmentIndexName, Arrays.asList("日发电量", "月发电量", "年发电量"));
queryCondtion.put(CommonConstans.QueryStringGateWayId, Arrays.asList(stationCacheInfoDto.getFanGatewayId()));
List<ESEquipments> result = commonServiceImpl.getListDataByCondtions(queryCondtion, null, ESEquipments.class);
dailyPower.updateAndGet(v -> v + keepFourdecimalPlaces(commonServiceImpl.getSumByEquipmentIndxName(result, "日发电量")));
monthlyPower.updateAndGet(v -> v + keepFourdecimalPlaces(commonServiceImpl.getSumByEquipmentIndxName(result, "月发电量")));
annualPower.updateAndGet(v -> v + keepFourdecimalPlaces(commonServiceImpl.getSumByEquipmentIndxName(result, "年发电量")));
fdzannualPower.updateAndGet(v -> v + keepFourdecimalPlaces(commonServiceImpl.getSumByEquipmentIndxName(result, "年发电量")));
fdzInstallCapacity.updateAndGet(v -> v + Double.parseDouble(stationCacheInfoDto.getInstalledCapacity()));
} else {
Map<String, List<String>> queryCondtion = new HashMap<>();
queryCondtion.put(CommonConstans.QueryStringEquipmentIndexName, Arrays.asList("日发电量", "月发电量", "年发电量"));
queryCondtion.put(CommonConstans.QueryStringGateWayId, Arrays.asList(stationCacheInfoDto.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 + keepFourdecimalPlaces(commonServiceImpl.getSumByEquipmentIndxName(result, "日发电量") * CommonConstans.pvGenPoweActor * CommonConstans.pvGenPoweActorDay));
monthlyPower.updateAndGet(v -> v + keepFourdecimalPlaces(commonServiceImpl.getSumByEquipmentIndxName(result, "月发电量") * CommonConstans.pvGenPoweActor));
annualPower.updateAndGet(v -> v + keepFourdecimalPlaces(commonServiceImpl.getSumByEquipmentIndxName(result, "年发电量") * CommonConstans.pvGenPoweActor));
gfzannualPower.updateAndGet(v -> v + keepFourdecimalPlaces(commonServiceImpl.getSumByEquipmentIndxName(result, "年发电量") * CommonConstans.pvGenPoweActor));
gfzinstallCapacity.updateAndGet(v -> v + Double.parseDouble(stationCacheInfoDto.getInstalledCapacity()));
}
});
completionRatio = String.format("%.2f", (annualPower.get() * 100) / value); completionRatio = String.format("%.2f", (annualPower.get() * 100) / value);
SocialContributionDto dailyPowerdto = new SocialContributionDto(); SocialContributionDto dailyPowerdto = new SocialContributionDto();
dailyPowerdto.setTitle(String.format(CommonConstans.Twodecimalplaces, dailyPower.get())); dailyPowerdto.setTitle(String.format(CommonConstans.Twodecimalplaces, dailyPower.get()));
...@@ -340,11 +299,117 @@ public class MonitoringServiceImpl { ...@@ -340,11 +299,117 @@ public class MonitoringServiceImpl {
socialContributionDtoPage.setTotal(100); socialContributionDtoPage.setTotal(100);
socialContributionDtoPage.setCurrent(1); socialContributionDtoPage.setCurrent(1);
try { try {
emqKeeper.getMqttClient().publish("completionofpowerindicator_topic", JSON.toJSON(socialContributionDtoPage).toString().getBytes("UTF-8"), 1, true); emqKeeper.getMqttClient().publish("completionofpowerindicator_topic", JSON.toJSON(socialContributionDtoPage).toString().getBytes("UTF-8"), 1, false);
logger.info("-----------------发送区域实时生产数据消息=================== 成功!" + JSON.toJSONString(socialContributionDtoPage)); logger.info("-----------------发送区域实时生产数据消息=================== 成功!" + JSON.toJSONString(socialContributionDtoPage));
} catch (Exception exception) { } catch (Exception exception) {
logger.error("-----------------发送区域实时生产数据消息=================== 失败!"); logger.error("-----------------发送区域实时生产数据消息=================== 失败!");
} }
Integer allsize = completionOfPowerIndicatorsDtoList.size();
DataGridMock dataGridMock = new DataGridMock(current, allsize, false, allsize / size + 1, completionOfPowerIndicatorsDtoList);
ResultsData resultsData = new ResultsData(dataGridMock, colModels);
return resultsData;
}
public void getCompletionOfPowerIndicatorsByCurrentData(List<StationCacheInfoDto> stationBasicList, String provinceName) {
String provinceNameTopic = "";
if (provinceName.contains("黑龙江") || provinceName.contains("内蒙古")) {
provinceNameTopic = provinceName.substring(0, 3);
} else {
provinceNameTopic = provinceName.substring(0, 2);
}
HashMap<String, String> stringHashMap = new HashMap<>();
stringHashMap.put("title", provinceNameTopic + "区域");
try {
emqKeeper.getMqttClient().publish("proviceName_topic", JSON.toJSON(stringHashMap).toString().getBytes("UTF-8"), 1, true);
logger.info("----------------------------------推送省份名称消息成功败--------------------------------");
} catch (Exception e) {
logger.info("----------------------------------推送省份名称消息失败--------------------------------");
}
// Page<SocialContributionDto> socialContributionDtoPage = new Page<SocialContributionDto>();
// logger.error("--------------------------区域实时数据消息开始发送----------------------------------------------");
// List<SocialContributionDto> socialContributionDtoList = new ArrayList<>();
// //日发电量
// AtomicReference<Double> dailyPower = new AtomicReference<>(0.0);
// //月发电量
// AtomicReference<Double> monthlyPower = new AtomicReference<>(0.0);
// //年发电量
// AtomicReference<Double> annualPower = new AtomicReference<>(0.0);
// //年发电量完成比例
// String completionRatio = "0.00";
// //年利用小时数
// int year = Calendar.getInstance().get(Calendar.YEAR);
// List<String> fdz = stationBasicList.stream().map(StationCacheInfoDto::getStationId).collect(Collectors.toList());
// LambdaQueryWrapper<StationPlan> queryWrapper = new LambdaQueryWrapper<>();
// queryWrapper.eq(StationPlan::getYear, String.valueOf(year));
// queryWrapper.in(StationPlan::getStationBasicId, fdz);
// List<StationPlan> fdzPlans = stationPlanMapper.selectList(queryWrapper);
// double value = fdzPlans.stream().mapToDouble(StationPlan::getValue).sum();
//
// AtomicReference<Double> useHours = new AtomicReference<>(0.0);
// AtomicReference<Double> installCapacity = new AtomicReference<>(0.0);
// AtomicReference<Double> fdzInstallCapacity = new AtomicReference<>(0.0);
// AtomicReference<Double> gfzinstallCapacity = new AtomicReference<>(0.0);
// //年发电量
// AtomicReference<Double> fdzannualPower = new AtomicReference<>(0.0);
// AtomicReference<Double> gfzannualPower = new AtomicReference<>(0.0);
// stationBasicList.forEach(stationCacheInfoDto -> {
// Map<String, List<String>> queryMap = new HashMap<>();
// queryMap.put("equipmentIndexName.keyword", Arrays.asList("日发电量", "月发电量", "年发电量"));
// queryMap.put("gatewayId.keyword", Arrays.asList(stationCacheInfoDto.getFanGatewayId()));
// if ("FDZ".equals(stationCacheInfoDto.getStationType())) {
// Map<String, List<String>> queryCondtion = new HashMap<>();
// queryCondtion.put(CommonConstans.QueryStringEquipmentIndexName, Arrays.asList("日发电量", "月发电量", "年发电量"));
// queryCondtion.put(CommonConstans.QueryStringGateWayId, Arrays.asList(stationCacheInfoDto.getFanGatewayId()));
// List<ESEquipments> result = commonServiceImpl.getListDataByCondtions(queryCondtion, null, ESEquipments.class);
// dailyPower.updateAndGet(v -> v + keepFourdecimalPlaces(commonServiceImpl.getSumByEquipmentIndxName(result, "日发电量")));
// monthlyPower.updateAndGet(v -> v + keepFourdecimalPlaces(commonServiceImpl.getSumByEquipmentIndxName(result, "月发电量")));
// annualPower.updateAndGet(v -> v + keepFourdecimalPlaces(commonServiceImpl.getSumByEquipmentIndxName(result, "年发电量")));
// fdzannualPower.updateAndGet(v -> v + keepFourdecimalPlaces(commonServiceImpl.getSumByEquipmentIndxName(result, "年发电量")));
// fdzInstallCapacity.updateAndGet(v -> v + Double.parseDouble(stationCacheInfoDto.getInstalledCapacity()));
// } else {
// Map<String, List<String>> queryCondtion = new HashMap<>();
// queryCondtion.put(CommonConstans.QueryStringEquipmentIndexName, Arrays.asList("日发电量", "月发电量", "年发电量"));
// queryCondtion.put(CommonConstans.QueryStringGateWayId, Arrays.asList(stationCacheInfoDto.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 + keepFourdecimalPlaces(commonServiceImpl.getSumByEquipmentIndxName(result, "日发电量") * CommonConstans.pvGenPoweActor * CommonConstans.pvGenPoweActorDay));
// monthlyPower.updateAndGet(v -> v + keepFourdecimalPlaces(commonServiceImpl.getSumByEquipmentIndxName(result, "月发电量") * CommonConstans.pvGenPoweActor));
// annualPower.updateAndGet(v -> v + keepFourdecimalPlaces(commonServiceImpl.getSumByEquipmentIndxName(result, "年发电量") * CommonConstans.pvGenPoweActor));
// gfzannualPower.updateAndGet(v -> v + keepFourdecimalPlaces(commonServiceImpl.getSumByEquipmentIndxName(result, "年发电量") * CommonConstans.pvGenPoweActor));
// gfzinstallCapacity.updateAndGet(v -> v + Double.parseDouble(stationCacheInfoDto.getInstalledCapacity()));
// }
// });
// completionRatio = String.format("%.2f", (annualPower.get() * 100) / value);
// SocialContributionDto dailyPowerdto = new SocialContributionDto();
// dailyPowerdto.setTitle(String.format(CommonConstans.Twodecimalplaces, dailyPower.get()));
// dailyPowerdto.setUnit("万kWh");
// SocialContributionDto monthlyPowerdto = new SocialContributionDto();
// monthlyPowerdto.setTitle(String.format(CommonConstans.Twodecimalplaces, monthlyPower.get()));
// monthlyPowerdto.setUnit("万kWh");
// SocialContributionDto annualPowerdto = new SocialContributionDto();
// annualPowerdto.setTitle(String.format(CommonConstans.Twodecimalplaces, annualPower.get()));
// annualPowerdto.setUnit("万kWh");
// SocialContributionDto completionRatioDto = new SocialContributionDto();
// completionRatioDto.setTitle(completionRatio);
// completionRatioDto.setUnit("%");
// SocialContributionDto useHoursDto = new SocialContributionDto();
// useHoursDto.setTitle(String.format(CommonConstans.Twodecimalplaces, (fdzannualPower.get() * CommonConstans.wkwhToMv / fdzInstallCapacity.get() + gfzannualPower.get() * CommonConstans.wkwhToMv / gfzinstallCapacity.get())));
// useHoursDto.setUnit("h");
// socialContributionDtoList.add(dailyPowerdto);
// socialContributionDtoList.add(monthlyPowerdto);
// socialContributionDtoList.add(annualPowerdto);
// socialContributionDtoList.add(completionRatioDto);
// socialContributionDtoList.add(useHoursDto);
// socialContributionDtoPage.setRecords(socialContributionDtoList);
// socialContributionDtoPage.setTotal(100);
// socialContributionDtoPage.setCurrent(1);
// try {
// emqKeeper.getMqttClient().publish("completionofpowerindicator_topic", JSON.toJSON(socialContributionDtoPage).toString().getBytes("UTF-8"), 1, false);
// logger.info("-----------------发送区域实时生产数据消息=================== 成功!" + JSON.toJSONString(socialContributionDtoPage));
// } catch (Exception exception) {
// logger.error("-----------------发送区域实时生产数据消息=================== 失败!");
// }
} }
public List<TabDto> getTabsByStationBasicId(String stationBasicId) { public List<TabDto> getTabsByStationBasicId(String stationBasicId) {
......
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