Commit b65cf519 authored by caotao's avatar caotao

监盘地图省份-数据推送错误问题处理

parent cf8609a4
...@@ -3,7 +3,6 @@ package com.yeejoin.amos.boot.module.jxiop.biz.service.impl; ...@@ -3,7 +3,6 @@ package com.yeejoin.amos.boot.module.jxiop.biz.service.impl;
import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSON;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.boot.module.common.api.enums.TitleEnum;
import com.yeejoin.amos.boot.module.jxiop.api.entity.MapRegion; import com.yeejoin.amos.boot.module.jxiop.api.entity.MapRegion;
import com.yeejoin.amos.boot.module.jxiop.api.entity.Region; import com.yeejoin.amos.boot.module.jxiop.api.entity.Region;
import com.yeejoin.amos.boot.module.jxiop.api.entity.StationBasic; import com.yeejoin.amos.boot.module.jxiop.api.entity.StationBasic;
...@@ -21,7 +20,6 @@ import org.springframework.beans.factory.annotation.Value; ...@@ -21,7 +20,6 @@ import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.util.ObjectUtils; import org.springframework.util.ObjectUtils;
import org.typroject.tyboot.component.emq.EmqKeeper; import org.typroject.tyboot.component.emq.EmqKeeper;
import org.unbescape.css.CssIdentifierEscapeLevel;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.net.URLDecoder; import java.net.URLDecoder;
...@@ -271,19 +269,19 @@ public class MonitoringServiceImpl { ...@@ -271,19 +269,19 @@ public class MonitoringServiceImpl {
String completionRatio = "0.00"; String completionRatio = "0.00";
//年利用小时数 //年利用小时数
AtomicReference<Double> useHours = new AtomicReference<>(0.0); AtomicReference<Double> useHours = new AtomicReference<>(0.0);
AtomicReference<Double> installCapacity = new AtomicReference<>(0.0);
stationBasicList.forEach(stationBasic -> { stationBasicList.forEach(stationBasic -> {
List<Map<String, Object>> mapList = new ArrayList<>(); List<Map<String, Object>> mapList = new ArrayList<>();
if (stationBasic.getStationType().equals("FDZ")) { if (stationBasic.getStationType().equals("FDZ")) {
mapList = influxdbUtil.query("SELECT * FROM indicators_" + stationBasic.getFanGatewayId() + "where (equipmentIndexName='日发电量' or equipmentIndexName='月发电量' or equipmentIndexName='年发电量' )"); mapList = influxdbUtil.query("SELECT * FROM indicators_" + stationBasic.getFanGatewayId() + " where (equipmentIndexName='日发电量' or equipmentIndexName='月发电量' or equipmentIndexName='年发电量' )");
} else { } else {
mapList = influxdbUtil.query("SELECT * FROM indicators_" + stationBasic.getFanGatewayId() + "where frontModule=~/逆变器/ and (equipmentIndexName='日发电量' or equipmentIndexName='月发电量' or equipmentIndexName='年发电量' )"); mapList = influxdbUtil.query("SELECT * FROM indicators_" + stationBasic.getFanGatewayId() + " where frontModule=~/逆变器/ and (equipmentIndexName='日发电量' or equipmentIndexName='月发电量' or equipmentIndexName='年发电量' )");
} }
List<Map<String, Object>> finalMapList = mapList; List<Map<String, Object>> finalMapList = mapList;
dailyPower.updateAndGet(v -> v + commonServiceImpl.getTotalByIndicatior(finalMapList, "日发电量")); dailyPower.updateAndGet(v -> v + commonServiceImpl.getTotalByIndicatior(finalMapList, "日发电量"));
monthlyPower.updateAndGet(v -> v + commonServiceImpl.getTotalByIndicatior(finalMapList, "月发电量")); monthlyPower.updateAndGet(v -> v + commonServiceImpl.getTotalByIndicatior(finalMapList, "月发电量"));
annualPower.updateAndGet(v -> v + commonServiceImpl.getTotalByIndicatior(finalMapList, "年发电量")); annualPower.updateAndGet(v -> v + commonServiceImpl.getTotalByIndicatior(finalMapList, "年发电量"));
useHours.updateAndGet(v -> v + commonServiceImpl.getTotalByIndicatior(finalMapList, "日工作时间")); installCapacity.updateAndGet(v -> v + getStationCaPACITYL(stationBasic.getStationNumber()));
}); });
SocialContributionDto dailyPowerdto = new SocialContributionDto(); SocialContributionDto dailyPowerdto = new SocialContributionDto();
dailyPowerdto.setTitle(String.format("%.2f", dailyPower.get())); dailyPowerdto.setTitle(String.format("%.2f", dailyPower.get()));
...@@ -302,7 +300,7 @@ public class MonitoringServiceImpl { ...@@ -302,7 +300,7 @@ public class MonitoringServiceImpl {
} }
completionRatioDto.setUnit("%"); completionRatioDto.setUnit("%");
SocialContributionDto useHoursDto = new SocialContributionDto(); SocialContributionDto useHoursDto = new SocialContributionDto();
useHoursDto.setTitle(String.format("%.2f", useHours.get())); useHoursDto.setTitle(String.format("%.2f", annualPower.get()/installCapacity.get()));
useHoursDto.setUnit("h"); useHoursDto.setUnit("h");
socialContributionDtoList.add(dailyPowerdto); socialContributionDtoList.add(dailyPowerdto);
socialContributionDtoList.add(monthlyPowerdto); socialContributionDtoList.add(monthlyPowerdto);
...@@ -596,9 +594,9 @@ public class MonitoringServiceImpl { ...@@ -596,9 +594,9 @@ public class MonitoringServiceImpl {
stationBasicList.forEach(stationBasic -> { stationBasicList.forEach(stationBasic -> {
List<Map<String, Object>> mapList = new ArrayList<>(); List<Map<String, Object>> mapList = new ArrayList<>();
if (stationBasic.getStationType().equals("FDZ")) { if (stationBasic.getStationType().equals("FDZ")) {
mapList = influxdbUtil.query("SELECT * FROM indicators_" + stationBasic.getFanGatewayId() + "where (equipmentIndexName='日发电量' or equipmentIndexName='月发电量' or equipmentIndexName='年发电量' )"); mapList = influxdbUtil.query("SELECT * FROM indicators_" + stationBasic.getFanGatewayId() + " where (equipmentIndexName='日发电量' or equipmentIndexName='月发电量' or equipmentIndexName='年发电量' )");
} else { } else {
mapList = influxdbUtil.query("SELECT * FROM indicators_" + stationBasic.getFanGatewayId() + "where frontModule=~/逆变器/ and (equipmentIndexName='日发电量' or equipmentIndexName='月发电量' or equipmentIndexName='年发电量' )"); mapList = influxdbUtil.query("SELECT * FROM indicators_" + stationBasic.getFanGatewayId() + " where frontModule=~/逆变器/ and (equipmentIndexName='日发电量' or equipmentIndexName='月发电量' or equipmentIndexName='年发电量' )");
} }
List<Map<String, Object>> finalMapList = mapList; List<Map<String, Object>> finalMapList = mapList;
dailyPower.updateAndGet(v -> v + commonServiceImpl.getTotalByIndicatior(finalMapList, "日发电量")); dailyPower.updateAndGet(v -> v + commonServiceImpl.getTotalByIndicatior(finalMapList, "日发电量"));
......
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