|
|
|
@ -98,8 +98,9 @@ public class EcologyFlowStationServiceImpl extends BaseServiceImpl<EcologyFlowSt
|
|
|
|
|
* @return |
|
|
|
|
*/ |
|
|
|
|
@Override |
|
|
|
|
public EcologFlowStationVo station_top() { |
|
|
|
|
List<EcologyFlowStationEntity> stations = this.list(); |
|
|
|
|
public EcologFlowStationVo station_top(String city) { |
|
|
|
|
List<EcologyFlowStationEntity> stations = this.list(Wrappers.<EcologyFlowStationEntity>lambdaQuery() |
|
|
|
|
.eq(EcologyFlowStationEntity::getCity,city)); |
|
|
|
|
if(CollectionUtil.isEmpty(stations)){ |
|
|
|
|
return new EcologFlowStationVo(); |
|
|
|
|
} |
|
|
|
@ -110,8 +111,9 @@ public class EcologyFlowStationServiceImpl extends BaseServiceImpl<EcologyFlowSt
|
|
|
|
|
station.setTimely(BigDecimal.valueOf((int) stations.stream().filter(o -> o.getIsTimely().equals(1L)).count() / (double) stations.size() * 100).setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue()); |
|
|
|
|
station.setCount(stations.size()); |
|
|
|
|
|
|
|
|
|
List<EcologyFlowDataEntity> datas = dataService.list(Wrappers.<EcologyFlowDataEntity>lambdaQuery(). |
|
|
|
|
like(EcologyFlowDataEntity::getMon, DateUtil.format(new Date(),"yyyy-MM"))); |
|
|
|
|
List<EcologyFlowDataEntity> datas = dataService.list(Wrappers.<EcologyFlowDataEntity>lambdaQuery() |
|
|
|
|
.like(EcologyFlowDataEntity::getMon, DateUtil.format(new Date(),"yyyy-MM")) |
|
|
|
|
.in(EcologyFlowDataEntity::getStationId,stations.stream().map(EcologyFlowStationEntity::getStationId).collect(Collectors.toList()))); |
|
|
|
|
if(CollectionUtil.isEmpty(datas)){ |
|
|
|
|
return station; |
|
|
|
|
} |
|
|
|
@ -132,8 +134,14 @@ public class EcologyFlowStationServiceImpl extends BaseServiceImpl<EcologyFlowSt
|
|
|
|
|
* @return |
|
|
|
|
*/ |
|
|
|
|
@Override |
|
|
|
|
public List<TrendChartVo> trend_chart(String type) { |
|
|
|
|
public List<TrendChartVo> trend_chart(String city,String type) { |
|
|
|
|
List<EcologyFlowStationEntity> stations = this.list(Wrappers.<EcologyFlowStationEntity>lambdaQuery() |
|
|
|
|
.eq(EcologyFlowStationEntity::getCity,city)); |
|
|
|
|
if(CollectionUtil.isEmpty(stations)){ |
|
|
|
|
return new ArrayList<>(); |
|
|
|
|
} |
|
|
|
|
LambdaQueryWrapper<EcologyFlowDataEntity> wrapper = new LambdaQueryWrapper<>(); |
|
|
|
|
wrapper.in(EcologyFlowDataEntity::getStationId,stations.stream().map(EcologyFlowStationEntity::getStationId).collect(Collectors.toList())); |
|
|
|
|
if("0".equals(type)){ |
|
|
|
|
wrapper.like(EcologyFlowDataEntity::getMon, DateUtil.format(new Date(),"yyyy")); |
|
|
|
|
} |
|
|
|
@ -179,7 +187,7 @@ public class EcologyFlowStationServiceImpl extends BaseServiceImpl<EcologyFlowSt
|
|
|
|
|
@Override |
|
|
|
|
public List<StationVo> station() { |
|
|
|
|
List<StationEntity> stations = stationService.list(Wrappers.<StationEntity>lambdaQuery() |
|
|
|
|
.in(StationEntity::getCode,Arrays.asList("902400000054","902400052664"))); |
|
|
|
|
.in(StationEntity::getCode,Arrays.asList("902400000054","902400052664","902400056791"))); |
|
|
|
|
if(CollectionUtil.isEmpty(stations)){ |
|
|
|
|
return new ArrayList<>(); |
|
|
|
|
} |
|
|
|
|