Commit cf97c5f6 authored by caotao's avatar caotao

1.监盘首页运维概况使用新数据源编写。

parent 134cd187
......@@ -173,5 +173,5 @@ public class StationBasic extends BaseEntity {
* 装机容量
*/
@TableField("installed_capacity")
private Double installedCapacity;
private Double installedCapacity=0.0;
}
......@@ -21,7 +21,7 @@ public class StationCacheInfoDto implements Serializable {
//所属片区
private String belongArea;
//装机容量
private String installedCapacity;
private String installedCapacity="0.0";
//设备数量
private String equipmentNumbers;
//风机网关
......@@ -30,10 +30,10 @@ public class StationCacheInfoDto implements Serializable {
private String boosterGatewayId;
//片区code
private String areaCode;
//
//address
private String address;
//core服务配置的场站名称
private String stationCoreName;
//core服务配置的升压站名称
private String boosterCoreName;
}
......@@ -3,10 +3,36 @@ package com.yeejoin.amos.boot.module.jxiop.biz.service;
import com.yeejoin.amos.boot.module.jxiop.biz.dto.RegionNationWideDto;
import com.yeejoin.amos.boot.module.jxiop.biz.dto.ResultsData;
import java.util.HashMap;
import java.util.List;
public interface MonitorService {
/**
* @description 获取运行监盘全国屏总数数据
*/
public void getTotalData();
/**
* @description 根据省份名称、type字段等判断动态获取地图图钉数据
* @param provinceName 省份名称
* @param type gis、station
* @return 地图图钉数据列表
*/
public List<RegionNationWideDto> getNationWideInfo(String provinceName, String type);
/**
* @description 根据省份名称获取动态表格数据
* @param current 当前页
* @param size 分页大小
* @param provinceName 省份名称
* @return 动态表格数据
*/
public ResultsData getCompletionOfPowerIndicatorsByProvinceName(int current, int size, String provinceName);
/**
* @description 根据地区名称获取有功功率数据
* @param areaName
* @return 有功功率
*/
public HashMap<String, String> getActivePowerByAreaName(String areaName);
}
......@@ -23,6 +23,8 @@ import java.util.*;
import java.util.concurrent.atomic.AtomicReference;
import java.util.stream.Collectors;
import static io.lettuce.core.ZStoreArgs.Builder.sum;
@Service
@Slf4j
@RequiredArgsConstructor
......@@ -432,8 +434,50 @@ public class MonitorServiceImpl implements MonitorService {
return stationCacheInfoDtos;
}
public HashMap<String, String> getActivePowerByAreaName(String areaName) {
List<StationCacheInfoDto> stationCacheInfoDtoList = this.getListStationCacheInfoDto();
List<CoreValuesDto> coreValuesDtos = coreCommonService.getValuesByStationNamesAndPointsNames(null,null);
HashMap<String, String> hashMap = new HashMap<>();
Double total =0.00;
if (!ObjectUtils.isEmpty(areaName)) {
stationCacheInfoDtoList =stationCacheInfoDtoList.stream().filter(stationCacheInfoDto ->stationCacheInfoDto.getBelongArea().equals(areaName)&&stationCacheInfoDto.getStationCoreName()!=null&&stationCacheInfoDto.getBoosterCoreName()!=null).collect(Collectors.toList());
List<String> stationNames =new ArrayList<>();
stationNames.addAll( stationCacheInfoDtoList.stream().map(StationCacheInfoDto::getStationCoreName).collect(Collectors.toList()));
stationNames.addAll( stationCacheInfoDtoList.stream().map(StationCacheInfoDto::getBoosterCoreName).collect(Collectors.toList()));
coreValuesDtos = coreValuesDtos.stream().filter(coreValuesDto ->stationNames.contains(coreValuesDto.getName())).collect(Collectors.toList());
}
total = coreCommonService.getSumOfByPointName(coreValuesDtos,CommonConstans.ACTIVE_POWER);
//有功功率换算
hashMap.put("title", String.format(CommonConstans.Twodecimalplaces,total));
return hashMap;
}
public HashMap<String, String> getInstallCapityByAreaName(String areaName) {
HashMap<String, String> hashMap = new HashMap<>();
List<StationCacheInfoDto> stationCacheInfoDtoList = this.getListStationCacheInfoDto();
Double total = 0.0;
if (!ObjectUtils.isEmpty(areaName)) {
stationCacheInfoDtoList =stationCacheInfoDtoList.stream().filter(stationCacheInfoDto ->stationCacheInfoDto.getBelongArea().equals(areaName)).collect(Collectors.toList());
}
total = stationCacheInfoDtoList.stream().map(StationCacheInfoDto::getInstalledCapacity).collect(Collectors.toList()).stream().mapToDouble(Double::parseDouble).sum();
hashMap.put("title", String.format(CommonConstans.Twodecimalplaces, total));
return hashMap;
}
public Double keepFourdecimalPlaces(Double param) {
return Double.valueOf(String.format("%.4f", param));
}
public List<StationBasic> getListOfStationBasicByAreaName(String areaName) {
List<StationBasic> stationBasicListAll = new ArrayList<>();
MapRegion mapRegion = mapRegionMapper.selectOne(new QueryWrapper<MapRegion>().eq("name", areaName));
//获取片区下的省份名称
ArrayList<String> stringArrayList = mapRegion.getProvince();
//变量获取所有的场站信息
for (int i = 0; i < stringArrayList.size(); i++) {
Region region = regionMapper.selectOne(new QueryWrapper<Region>().eq("LEVEL", 1).like("REGION_NAME", stringArrayList.get(i)));
List<StationBasic> stationBasicList = stationBasicMapper.selectList(new QueryWrapper<StationBasic>().like("belong_area", region.getRegionCode()));
stationBasicListAll.addAll(stationBasicList);
}
return stationBasicListAll;
}
}
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