Commit b188f137 authored by caotao's avatar caotao

部盾接口返回解析dto调整。

parent 2e512a4b
......@@ -7,6 +7,8 @@ public class BuDunGenDto {
private Double day;
private Double month;
private Double year;
private Double month_complete;
private Double year_complete;
private Double year_hour_number;
private Double cumulative;
}
......@@ -5,6 +5,7 @@ import lombok.Data;
@Data
public class BudunStationValueDto {
private String station_name;
private Double hours;
private Double value;
private Double genValue;
}
......@@ -493,13 +493,14 @@ public class MonitorServiceImpl implements MonitorService {
AtomicReference<Double> monthlyPower = new AtomicReference<>(0.0);
//年发电量
AtomicReference<Double> annualPower = new AtomicReference<>(0.0);
AtomicReference<Double> totalPower = new AtomicReference<>(0.0);
List<BuDunGenDto> buDunGenDtos = httpRequestUtil.getResPonse(requestUrl, Constants.REQUEST_GET, "", Constants.resovleRule_data, BuDunGenDto.class);
if (buDunGenDtos.size() > 0) {
BuDunGenDto buDunGenDto = buDunGenDtos.get(0);
dailyPower.set(buDunGenDto.getDay());
monthlyPower.set(buDunGenDto.getMonth());
annualPower.set(buDunGenDto.getYear());
annualPower.set(buDunGenDto.getYear());
totalPower.set(buDunGenDto.getCumulative());
}
HashMap<String, String> dayHashMap = new HashMap<>();
dayHashMap.put("title", String.format(CommonConstans.Fourdecimalplaces, dailyPower.get()) + "万kWh");
......@@ -508,7 +509,7 @@ public class MonitorServiceImpl implements MonitorService {
HashMap<String, String> annualHashMap = new HashMap<>();
annualHashMap.put("title", String.format(CommonConstans.Fourdecimalplaces, annualPower.get()) + "万kWh");
HashMap<String, String> totalHashMap = new HashMap<>();
totalHashMap.put("title", String.format(CommonConstans.Fourdecimalplaces, annualPower.get()) + "万kWh");
totalHashMap.put("title", String.format(CommonConstans.Fourdecimalplaces, totalPower.get()) + "万kWh");
hashMapList.add(dayHashMap);
hashMapList.add(monthHashMap);
hashMapList.add(annualHashMap);
......@@ -532,7 +533,7 @@ public class MonitorServiceImpl implements MonitorService {
List<BuDunGenDto> buDunGenDtos = httpRequestUtil.getResPonse(requestUrl, Constants.REQUEST_GET, "", Constants.resovleRule_data, BuDunGenDto.class);
if (buDunGenDtos.size() > 0) {
BuDunGenDto buDunGenDto = buDunGenDtos.get(0);
total.set(buDunGenDto.getYear());
total.set(buDunGenDto.getCumulative());
}
return getSocialContributionDtoList(total.get());
}
......@@ -654,7 +655,7 @@ public class MonitorServiceImpl implements MonitorService {
if (i < (buDunPvFanDto.getFan().size())) {
BudunStationValueDto budunStationValueDto = buDunPvFanDto.getFan().get(i);
stringHashMap.put("stationName1", budunStationValueDto.getStation_name());
stringHashMap.put("hours1", budunStationValueDto.getValue() + "h");
stringHashMap.put("hours1", budunStationValueDto.getHours() + "h");
} else {
stringHashMap.put("stationName1", "");
stringHashMap.put("hours1", "0.00h");
......@@ -662,7 +663,7 @@ public class MonitorServiceImpl implements MonitorService {
if (i < (buDunPvFanDto.getPv().size())) {
BudunStationValueDto budunStationValueDto = buDunPvFanDto.getPv().get(i);
stringHashMap.put("stationName2", budunStationValueDto.getStation_name());
stringHashMap.put("hours2", budunStationValueDto.getValue() + "h");
stringHashMap.put("hours2", budunStationValueDto.getHours() + "h");
} else {
stringHashMap.put("stationName2", "");
stringHashMap.put("hours2", "0.00h");
......
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