refactor(sis): 1
This commit is contained in:
@@ -249,6 +249,7 @@ public class TbMeterRecordServiceImpl implements ITbMeterRecordService {
|
||||
.toArray(BigDecimal[]::new);
|
||||
hourMap.put("categories", hourCategories);
|
||||
hourMap.put("data", hourData);
|
||||
hourMap.put("total" , hourList.stream().map(map -> new BigDecimal(map.get("total_consumption").toString())).reduce(BigDecimal::add).orElse(BigDecimal.ZERO).floatValue());
|
||||
|
||||
// day
|
||||
String[] monthArr = month.split("-");
|
||||
@@ -262,6 +263,7 @@ public class TbMeterRecordServiceImpl implements ITbMeterRecordService {
|
||||
.toArray(BigDecimal[]::new);
|
||||
dayMap.put("categories", dayCategories);
|
||||
dayMap.put("data", dayData);
|
||||
dayMap.put("total", dayList.stream().map(map -> new BigDecimal(map.get("total_consumption").toString())).reduce(BigDecimal::add).orElse(BigDecimal.ZERO).floatValue());
|
||||
|
||||
// month
|
||||
List<Map<String, Object>> monthList = baseMapper.getMonthTrend(StrUtil.isBlank(floorId) ? null : Long.parseLong(floorId), StrUtil.isBlank(meterId) ? null : Long.parseLong(meterId), meterType, year);
|
||||
@@ -274,6 +276,7 @@ public class TbMeterRecordServiceImpl implements ITbMeterRecordService {
|
||||
.toArray(BigDecimal[]::new);
|
||||
monthMap.put("categories", monthCategories);
|
||||
monthMap.put("data", monthData);
|
||||
monthMap.put("total", monthList.stream().map(map -> new BigDecimal(map.get("total_consumption").toString())).reduce(BigDecimal::add).orElse(BigDecimal.ZERO).floatValue());
|
||||
|
||||
|
||||
resultMap.put("hour", hourMap);
|
||||
|
Reference in New Issue
Block a user