|
|
@ -14,18 +14,15 @@ import com.hnac.hzims.operational.station.entity.HzimsAnalyzeModelStationEntity; |
|
|
|
import com.hnac.hzims.operational.station.entity.StationEntity; |
|
|
|
import com.hnac.hzims.operational.station.entity.StationEntity; |
|
|
|
import com.hnac.hzims.scheduled.service.equipment.DeviceParamService; |
|
|
|
import com.hnac.hzims.scheduled.service.equipment.DeviceParamService; |
|
|
|
import com.hnac.hzims.scheduled.service.equipment.DeviceService; |
|
|
|
import com.hnac.hzims.scheduled.service.equipment.DeviceService; |
|
|
|
|
|
|
|
import com.hnac.hzims.scheduled.service.operation.fill.*; |
|
|
|
import com.hnac.hzims.scheduled.service.operation.home.ModelStationService; |
|
|
|
import com.hnac.hzims.scheduled.service.operation.home.ModelStationService; |
|
|
|
import com.hnac.hzims.scheduled.service.operation.home.RealTargetService; |
|
|
|
import com.hnac.hzims.scheduled.service.operation.home.RealTargetService; |
|
|
|
import com.hnac.hzims.scheduled.service.operation.fill.GenerateService; |
|
|
|
import com.hnac.hzims.scheduled.service.operation.plate.DataService; |
|
|
|
import com.hnac.hzims.scheduled.service.operation.fill.PowerService; |
|
|
|
|
|
|
|
import com.hnac.hzims.scheduled.service.operation.fill.UseService; |
|
|
|
|
|
|
|
import com.hnac.hzims.scheduled.service.operation.station.StationAttributeService; |
|
|
|
import com.hnac.hzims.scheduled.service.operation.station.StationAttributeService; |
|
|
|
import com.hnac.hzims.scheduled.service.operation.station.StationService; |
|
|
|
import com.hnac.hzims.scheduled.service.operation.station.StationService; |
|
|
|
import com.hnac.hzims.scheduled.service.operation.plate.DataService; |
|
|
|
|
|
|
|
import com.hnac.hzinfo.datasearch.PointData; |
|
|
|
import com.hnac.hzinfo.datasearch.PointData; |
|
|
|
import com.hnac.hzinfo.datasearch.analyse.IAnalyseDataSearchClient; |
|
|
|
import com.hnac.hzinfo.datasearch.analyse.IAnalyseDataSearchClient; |
|
|
|
import com.hnac.hzinfo.datasearch.analyse.domain.FieldsData; |
|
|
|
import com.hnac.hzinfo.datasearch.analyse.domain.FieldsData; |
|
|
|
import com.hnac.hzinfo.datasearch.analyse.po.AnalyseCodeByAnalyseDataPO; |
|
|
|
|
|
|
|
import com.hnac.hzinfo.datasearch.analyse.vo.AnalyseDataTaosVO; |
|
|
|
import com.hnac.hzinfo.datasearch.analyse.vo.AnalyseDataTaosVO; |
|
|
|
import com.hnac.hzinfo.datasearch.analyse.vo.AnalyzeCodeBySignagesVO; |
|
|
|
import com.hnac.hzinfo.datasearch.analyse.vo.AnalyzeCodeBySignagesVO; |
|
|
|
import com.hnac.hzinfo.datasearch.history.IHistoryDataSearchClient; |
|
|
|
import com.hnac.hzinfo.datasearch.history.IHistoryDataSearchClient; |
|
|
@ -80,6 +77,8 @@ public class RealTargetServiceImpl implements RealTargetService { |
|
|
|
private final ModelStationService modelStationService; |
|
|
|
private final ModelStationService modelStationService; |
|
|
|
|
|
|
|
|
|
|
|
private final RedisTemplate redisTemplate; |
|
|
|
private final RedisTemplate redisTemplate; |
|
|
|
|
|
|
|
private final WindService windService; |
|
|
|
|
|
|
|
private final StorageService storageService; |
|
|
|
|
|
|
|
|
|
|
|
private final IHistoryDataSearchClient historyDataSearchClient; |
|
|
|
private final IHistoryDataSearchClient historyDataSearchClient; |
|
|
|
|
|
|
|
|
|
|
@ -1111,7 +1110,50 @@ public class RealTargetServiceImpl implements RealTargetService { |
|
|
|
redisTemplate.opsForValue().set(recent_year_power_data, powerMap); |
|
|
|
redisTemplate.opsForValue().set(recent_year_power_data, powerMap); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
|
|
* 近年发电量数据 |
|
|
|
|
|
|
|
* |
|
|
|
|
|
|
|
* @param param 时间 |
|
|
|
|
|
|
|
* @param serveType 站点类型 |
|
|
|
|
|
|
|
* @param year 近几年 |
|
|
|
|
|
|
|
*/ |
|
|
|
|
|
|
|
@Override |
|
|
|
|
|
|
|
public void loadPowerDataByWindEnergy(String param, List<Integer> types, Integer serveType, int year,String key) { |
|
|
|
|
|
|
|
// 站点查询
|
|
|
|
|
|
|
|
List<StationEntity> stationList = stationService.list(new LambdaQueryWrapper<StationEntity>() {{ |
|
|
|
|
|
|
|
if (ObjectUtil.isNotEmpty(serveType)) { |
|
|
|
|
|
|
|
eq(StationEntity::getServeType, serveType); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
if (CollectionUtil.isNotEmpty(types)) { |
|
|
|
|
|
|
|
in(StationEntity::getType, types); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}}); |
|
|
|
|
|
|
|
// 设备信息
|
|
|
|
|
|
|
|
// List<EminfoAndEmParamVo> devices = JSONObject.parseObject(redisTemplate.opsForValue().get(device_cache_cofig_final).toString(), new TypeReference<List<EminfoAndEmParamVo>>() {
|
|
|
|
|
|
|
|
// });
|
|
|
|
|
|
|
|
// 开始时间
|
|
|
|
|
|
|
|
Calendar calendar = Calendar.getInstance(); |
|
|
|
|
|
|
|
calendar.add(Calendar.MONTH, -calendar.get(Calendar.MONTH) + 12); |
|
|
|
|
|
|
|
calendar.add(Calendar.DATE, -calendar.get(Calendar.DATE) + 1); |
|
|
|
|
|
|
|
String end = DateUtil.format(calendar.getTime(),DateUtil.PATTERN_DATE) + " 00:00:00"; |
|
|
|
|
|
|
|
// 结束日期
|
|
|
|
|
|
|
|
calendar.set(Calendar.YEAR, calendar.get(Calendar.YEAR) - year); |
|
|
|
|
|
|
|
calendar.add(Calendar.MONTH, -calendar.get(Calendar.MONTH)); |
|
|
|
|
|
|
|
String start = DateUtil.format(calendar.getTime(),DateUtil.PATTERN_DATE) + " 00:00:00"; |
|
|
|
|
|
|
|
// 存储数据map :<站点id,<月份,发电量>>
|
|
|
|
|
|
|
|
Map<Long, Map<String, Float>> powerMap = new HashMap<>(); |
|
|
|
|
|
|
|
stationList.forEach(station -> { |
|
|
|
|
|
|
|
// 站点设备集合
|
|
|
|
|
|
|
|
// List<EminfoAndEmParamVo> stationDevices = devices.stream().filter(device -> device.getCreateDept().equals(station.getRefDept())).collect(Collectors.toList());
|
|
|
|
|
|
|
|
// log.error("load_power_data station :" + station.getCode() + "==== device :" + stationDevices );
|
|
|
|
|
|
|
|
Map<String, Float> generateMap = this.getGenerateYearByWindEnergy(station,start,end); |
|
|
|
|
|
|
|
if(MapUtils.isEmpty(generateMap)){ |
|
|
|
|
|
|
|
return; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
powerMap.put(station.getId(),generateMap); |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
redisTemplate.opsForValue().set(key, powerMap); |
|
|
|
|
|
|
|
} |
|
|
|
/** |
|
|
|
/** |
|
|
|
* 当天有功功率 |
|
|
|
* 当天有功功率 |
|
|
|
* @param device |
|
|
|
* @param device |
|
|
@ -1165,7 +1207,21 @@ public class RealTargetServiceImpl implements RealTargetService { |
|
|
|
} |
|
|
|
} |
|
|
|
return datas.stream().collect(Collectors.toMap(PowerMonthVo::getStrMonth, PowerMonthVo::getPower, Float::sum)); |
|
|
|
return datas.stream().collect(Collectors.toMap(PowerMonthVo::getStrMonth, PowerMonthVo::getPower, Float::sum)); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
|
|
|
|
* 获取风电或者储能的年发电量 |
|
|
|
|
|
|
|
* @param start |
|
|
|
|
|
|
|
* @param end |
|
|
|
|
|
|
|
* @return |
|
|
|
|
|
|
|
*/ |
|
|
|
|
|
|
|
private Map<String, Float> getGenerateYearByWindEnergy(StationEntity station, String start, String end) { |
|
|
|
|
|
|
|
List<PowerMonthVo> datas = new ArrayList<>(); |
|
|
|
|
|
|
|
// 补充填报数据
|
|
|
|
|
|
|
|
datas.addAll(this.generateFill(station,start,end)); |
|
|
|
|
|
|
|
if(CollectionUtil.isEmpty(datas)){ |
|
|
|
|
|
|
|
return null; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
return datas.stream().collect(Collectors.toMap(PowerMonthVo::getStrMonth, PowerMonthVo::getPower, Float::sum)); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* 获取填报用电量 |
|
|
|
* 获取填报用电量 |
|
|
@ -1207,6 +1263,12 @@ public class RealTargetServiceImpl implements RealTargetService { |
|
|
|
if(HomePageConstant.PHOTOVOLTAIC.equals(station.getType())){ |
|
|
|
if(HomePageConstant.PHOTOVOLTAIC.equals(station.getType())){ |
|
|
|
return powerService.generateThreeYear(start,end,station.getRefDept()); |
|
|
|
return powerService.generateThreeYear(start,end,station.getRefDept()); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
if(HomePageConstant.WIND_POWER.equals(station.getType())){ |
|
|
|
|
|
|
|
return windService.generateThreeYear(start,end,station.getRefDept()); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
if(HomePageConstant.ENERGY_STORAGE.equals(station.getType())){ |
|
|
|
|
|
|
|
return storageService.generateThreeYear(start,end,station.getRefDept()); |
|
|
|
|
|
|
|
} |
|
|
|
// 水电
|
|
|
|
// 水电
|
|
|
|
return generateService.generateThreeYear(start,end,station.getCode()); |
|
|
|
return generateService.generateThreeYear(start,end,station.getCode()); |
|
|
|
} |
|
|
|
} |
|
|
|