Browse Source

#风电驾驶舱

zhongwei
yang_shj 1 year ago
parent
commit
f435b48327
  1. 14
      hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/main/vo/WindSubordinateVo.java
  2. 22
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/service/impl/WindHomeServiceImpl.java

14
hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/main/vo/WindSubordinateVo.java

@ -22,6 +22,20 @@ public class WindSubordinateVo {
@ApiModelProperty(value = "机构名称") @ApiModelProperty(value = "机构名称")
private String departName; private String departName;
@ApiModelProperty(value = "地市编码")
private String areaCode;
@ApiModelProperty(value = "地市名称")
private String areaName;
@ApiModelProperty("经度(东经)")
@JsonSerialize(nullsUsing = NullSerializer.class)
private Float lgtd;
@ApiModelProperty("纬度(北纬)")
@JsonSerialize(nullsUsing = NullSerializer.class)
private Float lttd;
@ApiModelProperty(value = "温度") @ApiModelProperty(value = "温度")
private String temp; private String temp;

22
hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/service/impl/WindHomeServiceImpl.java

@ -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());
} }
/** /**

Loading…
Cancel
Save