Commit d1dae55d authored by xinglei's avatar xinglei

Merge branch 'developer' of http://39.98.45.134:8090/moa/amos-boot-biz into developer

parents 996d6238 0208da4c
...@@ -26,6 +26,7 @@ import org.typroject.tyboot.component.emq.EmqKeeper; ...@@ -26,6 +26,7 @@ import org.typroject.tyboot.component.emq.EmqKeeper;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.net.URLDecoder; import java.net.URLDecoder;
import java.time.LocalDate;
import java.util.*; import java.util.*;
import java.util.concurrent.atomic.AtomicReference; import java.util.concurrent.atomic.AtomicReference;
import java.util.stream.Collectors; import java.util.stream.Collectors;
...@@ -74,7 +75,8 @@ public class MonitoringServiceImpl { ...@@ -74,7 +75,8 @@ public class MonitoringServiceImpl {
// InfluxdbUtil influxdbUtil; // InfluxdbUtil influxdbUtil;
@Autowired @Autowired
IndicatorDataMapper indicatorDataMapper; IndicatorDataMapper indicatorDataMapper;
@Autowired
StationPlanMapper StationPlanMapper;
/** /**
* 根据场站编号获取该场站的装机容量 * 根据场站编号获取该场站的装机容量
* *
...@@ -824,7 +826,18 @@ public class MonitoringServiceImpl { ...@@ -824,7 +826,18 @@ public class MonitoringServiceImpl {
List<ESEquipments> result = commonServiceImpl.getListDataByCondtions(queryCondtion, null, ESEquipments.class); List<ESEquipments> result = commonServiceImpl.getListDataByCondtions(queryCondtion, null, ESEquipments.class);
total.set(commonServiceImpl.getSumByEquipmentIndxName(result, finalIndicator)); total.set(commonServiceImpl.getSumByEquipmentIndxName(result, finalIndicator));
} }
stationBasic.setAddress(String.format(CommonConstans.Twodecimalplaces, total.get() % 100)); QueryWrapper<StationPlan> wrapper2 = new QueryWrapper<>();
LocalDate currentDate = LocalDate.now();
int month = currentDate.getMonthValue();
wrapper2.select("ifnull(sum(value), 0) as sum_value");
wrapper2.eq("monthly", month);
wrapper2.eq("station_basic_id", stationBasic.getSequenceNbr());
List<Map<String, Object>> list = StationPlanMapper.selectMaps(wrapper2);
System.out.println(total.get()+"9999999999999999999999");
Double sumValue = list != null && !list.isEmpty() ? (Double) list.get(0).get("sum_value") : 0;
stationBasic.setAddress(String.format(CommonConstans.Twodecimalplaces, total.get()/sumValue*100 ));
}); });
List<StationBasic> sorted = stationBasicListAll.stream().sorted(Comparator.comparing(StationBasic::getAddress, Comparator.comparingDouble(Double::parseDouble)).reversed()).collect(Collectors.toList()); List<StationBasic> sorted = stationBasicListAll.stream().sorted(Comparator.comparing(StationBasic::getAddress, Comparator.comparingDouble(Double::parseDouble)).reversed()).collect(Collectors.toList());
sorted.forEach(stationBasic -> { sorted.forEach(stationBasic -> {
......
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