|
|
@ -20,11 +20,14 @@ import com.hnac.hzims.operational.station.service.IStationService; |
|
|
|
import lombok.RequiredArgsConstructor; |
|
|
|
import lombok.RequiredArgsConstructor; |
|
|
|
import lombok.extern.slf4j.Slf4j; |
|
|
|
import lombok.extern.slf4j.Slf4j; |
|
|
|
import org.apache.commons.collections4.MapUtils; |
|
|
|
import org.apache.commons.collections4.MapUtils; |
|
|
|
|
|
|
|
import org.springblade.core.tool.api.R; |
|
|
|
import org.springblade.core.tool.utils.CollectionUtil; |
|
|
|
import org.springblade.core.tool.utils.CollectionUtil; |
|
|
|
import org.springblade.core.tool.utils.DateUtil; |
|
|
|
import org.springblade.core.tool.utils.DateUtil; |
|
|
|
import org.springblade.core.tool.utils.ObjectUtil; |
|
|
|
import org.springblade.core.tool.utils.ObjectUtil; |
|
|
|
import org.springblade.core.tool.utils.StringUtil; |
|
|
|
import org.springblade.core.tool.utils.StringUtil; |
|
|
|
import org.springblade.system.entity.Dept; |
|
|
|
import org.springblade.system.entity.Dept; |
|
|
|
|
|
|
|
import org.springblade.system.entity.Region; |
|
|
|
|
|
|
|
import org.springblade.system.feign.ISysClient; |
|
|
|
import org.springframework.data.redis.core.RedisTemplate; |
|
|
|
import org.springframework.data.redis.core.RedisTemplate; |
|
|
|
import org.springframework.stereotype.Service; |
|
|
|
import org.springframework.stereotype.Service; |
|
|
|
|
|
|
|
|
|
|
@ -54,6 +57,8 @@ public class WindHomeServiceImpl implements WindHomeService { |
|
|
|
|
|
|
|
|
|
|
|
private final RedisTemplate redisTemplate; |
|
|
|
private final RedisTemplate redisTemplate; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private final ISysClient sysClient; |
|
|
|
|
|
|
|
|
|
|
|
public final static String device_cache_final = "hzims:equipment:emInfo:deviceCode.emInfoList"; |
|
|
|
public final static String device_cache_final = "hzims:equipment:emInfo:deviceCode.emInfoList"; |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
@ -183,6 +188,20 @@ public class WindHomeServiceImpl implements WindHomeService { |
|
|
|
Map<String, HeWeatherWeatherDailyResponse> weekWeather = this.weatherService.getWeekWeather(stations); |
|
|
|
Map<String, HeWeatherWeatherDailyResponse> weekWeather = this.weatherService.getWeekWeather(stations); |
|
|
|
return areas.entrySet().stream().map(entry -> { |
|
|
|
return areas.entrySet().stream().map(entry -> { |
|
|
|
WindSubordinateVo subordinate = new WindSubordinateVo(); |
|
|
|
WindSubordinateVo subordinate = new WindSubordinateVo(); |
|
|
|
|
|
|
|
// 获取第一个站点经纬度、行政编码信息
|
|
|
|
|
|
|
|
StationEntity station = entry.getValue().get(0); |
|
|
|
|
|
|
|
subordinate.setLttd(station.getLttd()); |
|
|
|
|
|
|
|
subordinate.setLgtd(station.getLgtd()); |
|
|
|
|
|
|
|
// 省市编码
|
|
|
|
|
|
|
|
String areaCode = station.getAreaCode(); |
|
|
|
|
|
|
|
subordinate.setAreaCode(areaCode); |
|
|
|
|
|
|
|
if (!StringUtil.isEmpty(areaCode)) { |
|
|
|
|
|
|
|
String[] arrCode = areaCode.split(","); |
|
|
|
|
|
|
|
R<Region> R = sysClient.getRegion(arrCode[1]); |
|
|
|
|
|
|
|
if (R.isSuccess() && ObjectUtil.isNotEmpty(R.getData())) { |
|
|
|
|
|
|
|
subordinate.setAreaName(R.getData().getName()); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
// 机构Id
|
|
|
|
// 机构Id
|
|
|
|
subordinate.setDepartId(entry.getKey().getId()); |
|
|
|
subordinate.setDepartId(entry.getKey().getId()); |
|
|
|
// 机构名称
|
|
|
|
// 机构名称
|
|
|
@ -218,7 +237,8 @@ public class WindHomeServiceImpl implements WindHomeService { |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
return subordinate; |
|
|
|
return subordinate; |
|
|
|
}).sorted(Comparator.comparing(WindSubordinateVo::getGeneration).reversed()).collect(Collectors.toList()); |
|
|
|
}).filter(o-> Math.abs(o.getGeneration()) > 0 || Math.abs(o.getGenerationRate()) > 0 || Math.abs(o.getGenerationComplete()) > 0 |
|
|
|
|
|
|
|
|| Math.abs(o.getFactoryUse()) > 0 || Math.abs(o.getFanUse()) > 0 ).sorted(Comparator.comparing(WindSubordinateVo::getGeneration).reversed()).collect(Collectors.toList()); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|