Commit 2efd9a45 authored by hezhuozhi's avatar hezhuozhi

修复年发电量完成率

parent 58fbe0c5
...@@ -75,10 +75,10 @@ public class MonitorFanIdxController extends BaseController { ...@@ -75,10 +75,10 @@ public class MonitorFanIdxController extends BaseController {
@Autowired @Autowired
MonitorFanIndicatorMapper monitorFanIndicatorMapper; MonitorFanIndicatorMapper monitorFanIndicatorMapper;
@Autowired @Autowired
EmqKeeper emqKeeper;
@Autowired
MonitoringServiceImpl monitoringService; MonitoringServiceImpl monitoringService;
@Autowired @Autowired
EmqKeeper emqKeeper;
@Autowired
MonitorService monitorService; MonitorService monitorService;
@Autowired @Autowired
StationPlanMapper StationPlanMapper; StationPlanMapper StationPlanMapper;
...@@ -495,8 +495,14 @@ public class MonitorFanIdxController extends BaseController { ...@@ -495,8 +495,14 @@ public class MonitorFanIdxController extends BaseController {
wrapper.eq("station_basic_id", stationBasic.getSequenceNbr()); wrapper.eq("station_basic_id", stationBasic.getSequenceNbr());
wrapper.groupBy("monthly"); wrapper.groupBy("monthly");
List<Map<String, Object>> list1 = StationPlanMapper.selectMaps(wrapper); List<Map<String, Object>> list1 = StationPlanMapper.selectMaps(wrapper);
Double sumValue = list1 != null && !list1.isEmpty() ? (Double) list1.get(0).get("value") : 0; // Double sumValue = list1 != null && !list1.isEmpty() ? (Double) list1.get(0).get("value") : 0;
//此处应该求全部值
Double sumValue = 0.0;
if(CollectionUtils.isNotEmpty(list1)){
for (Map<String, Object> map : list1) {
sumValue+= Objects.isNull(map.get("value"))?0:(Double) map.get("value");
}
}
columnMap.put("年发电量完成率(%)", String.format("%.2f", Double.parseDouble(columnMap.get("年发电量").toString()) / sumValue * 100)); columnMap.put("年发电量完成率(%)", String.format("%.2f", Double.parseDouble(columnMap.get("年发电量").toString()) / sumValue * 100));
// StationBasic stationBasic = stationBasicMapper.selectById(stationId); // StationBasic stationBasic = stationBasicMapper.selectById(stationId);
......
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