Commit b3d8ddb0 authored by caotao's avatar caotao

监盘大屏与运行监盘数据问题错误问题处理。

parent b01d07e2
...@@ -79,6 +79,7 @@ public class MonitorServiceImpl implements MonitorService { ...@@ -79,6 +79,7 @@ public class MonitorServiceImpl implements MonitorService {
List<StationCacheInfoDto> dtos = listMap.get(value.getCode()); List<StationCacheInfoDto> dtos = listMap.get(value.getCode());
map.put("data", dtos == null ? 0 : dtos.size()); map.put("data", dtos == null ? 0 : dtos.size());
map.put("title", dtos == null ? 0 : dtos.stream().filter(obj -> !ObjectUtils.isEmpty(obj.getInstalledCapacity())).mapToDouble(l -> Double.parseDouble(l.getInstalledCapacity())).sum()); map.put("title", dtos == null ? 0 : dtos.stream().filter(obj -> !ObjectUtils.isEmpty(obj.getInstalledCapacity())).mapToDouble(l -> Double.parseDouble(l.getInstalledCapacity())).sum());
map.put("title",keepTwodecimalPlaces(Double.valueOf(map.get("title").toString())));
mapList.add(map); mapList.add(map);
} }
IPage<Map<String, Object>> result = new Page<>(); IPage<Map<String, Object>> result = new Page<>();
......
...@@ -112,8 +112,8 @@ public class MonitorServiceImpl implements MonitorService { ...@@ -112,8 +112,8 @@ public class MonitorServiceImpl implements MonitorService {
String nationalFanUrl = Constants.BASE_URL + "?" + Constants.get_province_item_url + "&type=fan"; String nationalFanUrl = Constants.BASE_URL + "?" + Constants.get_province_item_url + "&type=fan";
//获取光伏 //获取光伏
String nationalPVUrl = Constants.BASE_URL + "?" + Constants.get_province_item_url + "&type=pv"; String nationalPVUrl = Constants.BASE_URL + "?" + Constants.get_province_item_url + "&type=pv";
List<BuDunGenDto> nationalGendto = httpRequestUtil.getResPonse(nationalPVUrl, Constants.REQUEST_GET, "", Constants.resovleRule_data, BuDunGenDto.class); List<BuDunGenDto> nationalGendto = httpRequestUtil.getResPonse(nationalUrl, Constants.REQUEST_GET, "", Constants.resovleRule_data, BuDunGenDto.class);
List<BuDunGenDto> fanGendto = httpRequestUtil.getResPonse(nationalPVUrl, Constants.REQUEST_GET, "", Constants.resovleRule_data, BuDunGenDto.class); List<BuDunGenDto> fanGendto = httpRequestUtil.getResPonse(nationalFanUrl, Constants.REQUEST_GET, "", Constants.resovleRule_data, BuDunGenDto.class);
List<BuDunGenDto> pvGendto = httpRequestUtil.getResPonse(nationalPVUrl, Constants.REQUEST_GET, "", Constants.resovleRule_data, BuDunGenDto.class); List<BuDunGenDto> pvGendto = httpRequestUtil.getResPonse(nationalPVUrl, Constants.REQUEST_GET, "", Constants.resovleRule_data, BuDunGenDto.class);
if (nationalGendto.size() > 0) { if (nationalGendto.size() > 0) {
BuDunGenDto buDunGenDto = nationalGendto.get(0); BuDunGenDto buDunGenDto = nationalGendto.get(0);
...@@ -124,7 +124,7 @@ public class MonitorServiceImpl implements MonitorService { ...@@ -124,7 +124,7 @@ public class MonitorServiceImpl implements MonitorService {
useHoursOfAnnual = buDunGenDto.getYear_hour_number(); useHoursOfAnnual = buDunGenDto.getYear_hour_number();
} }
if (fanGendto.size() > 0) { if (fanGendto.size() > 0) {
BuDunGenDto buDunGenDto = nationalGendto.get(0); BuDunGenDto buDunGenDto = fanGendto.get(0);
powerOfDayFD = buDunGenDto.getDay(); powerOfDayFD = buDunGenDto.getDay();
powerOfMonthFD = buDunGenDto.getMonth(); powerOfMonthFD = buDunGenDto.getMonth();
powerOfAnnualFD = buDunGenDto.getYear(); powerOfAnnualFD = buDunGenDto.getYear();
...@@ -132,7 +132,7 @@ public class MonitorServiceImpl implements MonitorService { ...@@ -132,7 +132,7 @@ public class MonitorServiceImpl implements MonitorService {
useHoursOfAnnualFD = buDunGenDto.getYear_hour_number(); useHoursOfAnnualFD = buDunGenDto.getYear_hour_number();
} }
if (pvGendto.size() > 0) { if (pvGendto.size() > 0) {
BuDunGenDto buDunGenDto = nationalGendto.get(0); BuDunGenDto buDunGenDto = pvGendto.get(0);
powerOfDayGF = buDunGenDto.getDay(); powerOfDayGF = buDunGenDto.getDay();
powerOfMonthGF = buDunGenDto.getMonth(); powerOfMonthGF = buDunGenDto.getMonth();
powerOfAnnualGF = buDunGenDto.getYear(); powerOfAnnualGF = buDunGenDto.getYear();
...@@ -194,7 +194,7 @@ public class MonitorServiceImpl implements MonitorService { ...@@ -194,7 +194,7 @@ public class MonitorServiceImpl implements MonitorService {
stringHashMap11.put("title", String.format(CommonConstans.Fourdecimalplaces, powerOfAnnual)); stringHashMap11.put("title", String.format(CommonConstans.Fourdecimalplaces, powerOfAnnual));
list2.add(stringHashMap11); list2.add(stringHashMap11);
HashMap<String, String> stringHashMap12 = new HashMap<>(); HashMap<String, String> stringHashMap12 = new HashMap<>();
stringHashMap12.put("title", String.format(CommonConstans.Twodecimalplaces, (completeRateOfAnnual * 100))); stringHashMap12.put("title", String.format(CommonConstans.Twodecimalplaces, (completeRateOfAnnual)));
list2.add(stringHashMap12); list2.add(stringHashMap12);
page2.setRecords(list2); page2.setRecords(list2);
try { try {
......
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