Commit 5ba6c06d authored by caotao's avatar caotao

运行监盘-上下数据不同步问题修改处理

parent 556ddc02
...@@ -45,131 +45,137 @@ public class MonitoringMapController extends BaseController { ...@@ -45,131 +45,137 @@ public class MonitoringMapController extends BaseController {
@Autowired @Autowired
MonitoringServiceImpl monitoringServiceImpl; MonitoringServiceImpl monitoringServiceImpl;
@TycloudOperation(ApiLevel = UserType.AGENCY,needAuth = false)
@TycloudOperation(ApiLevel = UserType.AGENCY, needAuth = false)
@ApiOperation(value = "获取监盘全国-安全生产天数") @ApiOperation(value = "获取监盘全国-安全生产天数")
@GetMapping("/getSecDays") @GetMapping("/getSecDays")
public ResponseModel<HashMap<String,String>> getSecDays(@RequestParam (value = "provinceName", required = false)String provinceName,@RequestParam (value = "type", required = false)String type) { public ResponseModel<HashMap<String, String>> getSecDays(@RequestParam(value = "provinceName", required = false) String provinceName, @RequestParam(value = "type", required = false) String type) {
return ResponseHelper.buildResponse(monitoringServiceImpl.getSecDays(secStartDate)); return ResponseHelper.buildResponse(monitoringServiceImpl.getSecDays(secStartDate));
} }
@TycloudOperation(ApiLevel = UserType.AGENCY,needAuth = false)
@TycloudOperation(ApiLevel = UserType.AGENCY, needAuth = false)
@ApiOperation(value = "获取监盘全国地图数据") @ApiOperation(value = "获取监盘全国地图数据")
@GetMapping("/nationwide") @GetMapping("/nationwide")
public ResponseModel<List<RegionNationWideDto>> getNationWideInfo(@RequestParam (value = "provinceName", required = false)String provinceName,@RequestParam (value = "type", required = false)String type) { public ResponseModel<List<RegionNationWideDto>> getNationWideInfo(@RequestParam(value = "provinceName", required = false) String provinceName, @RequestParam(value = "type", required = false) String type) {
return ResponseHelper.buildResponse(monitoringServiceImpl.getNationWideInfo(provinceName,type)); return ResponseHelper.buildResponse(monitoringServiceImpl.getNationWideInfo(provinceName, type));
} }
@TycloudOperation(ApiLevel = UserType.AGENCY,needAuth = false) @TycloudOperation(ApiLevel = UserType.AGENCY, needAuth = false)
@ApiOperation(value = "获取监盘全国地图-发电量数据") @ApiOperation(value = "获取监盘全国地图-发电量数据")
@GetMapping("/getNationalPowerGenerationData") @GetMapping("/getNationalPowerGenerationData")
public ResponseModel<List<HashMap<String,Object>>> getNationalPowerGenerationData() { public ResponseModel<List<HashMap<String, Object>>> getNationalPowerGenerationData() {
return ResponseHelper.buildResponse(monitoringServiceImpl.getNationalPowerGenerationData()); return ResponseHelper.buildResponse(monitoringServiceImpl.getNationalPowerGenerationData());
} }
@TycloudOperation(ApiLevel = UserType.AGENCY,needAuth = false) @TycloudOperation(ApiLevel = UserType.AGENCY, needAuth = false)
@ApiOperation(value = "获取监盘全国地图-获取功率曲线下拉框数据") @ApiOperation(value = "获取监盘全国地图-获取功率曲线下拉框数据")
@GetMapping("/getSelectDataForNational") @GetMapping("/getSelectDataForNational")
public ResponseModel<List<HashMap<String,Object>>> getSelectDataForNational() { public ResponseModel<List<HashMap<String, Object>>> getSelectDataForNational() {
return ResponseHelper.buildResponse(monitoringServiceImpl.getSelectDataForNational()); return ResponseHelper.buildResponse(monitoringServiceImpl.getSelectDataForNational());
} }
@TycloudOperation(ApiLevel = UserType.AGENCY,needAuth = false) @TycloudOperation(ApiLevel = UserType.AGENCY, needAuth = false)
@ApiOperation(value = "获取区域电量指标完成情况") @ApiOperation(value = "获取区域电量指标完成情况")
@GetMapping("/getCompletionOfPowerIndicatorsByProvinceName") @GetMapping("/getCompletionOfPowerIndicatorsByProvinceName")
public ResponseModel<ResultsData> getCompletionOfPowerIndicatorsByProvinceName(@RequestParam(required = true) int current, @RequestParam(required = true) int size, @RequestParam(required = true) String provinceName) { public ResponseModel<ResultsData> getCompletionOfPowerIndicatorsByProvinceName(@RequestParam(required = true) int current, @RequestParam(required = true) int size, @RequestParam(required = true) String provinceName) {
return ResponseHelper.buildResponse(monitoringServiceImpl.getCompletionOfPowerIndicatorsByProvinceName(current,size,provinceName)); return ResponseHelper.buildResponse(monitoringServiceImpl.getCompletionOfPowerIndicatorsByProvinceName(current,size,provinceName));
} }
@TycloudOperation(ApiLevel = UserType.AGENCY,needAuth = false) @TycloudOperation(ApiLevel = UserType.AGENCY, needAuth = false)
@ApiOperation(value = "根据场站id动态获取tab页签") @ApiOperation(value = "根据场站id动态获取tab页签")
@GetMapping("/getTabsByStationBasicId") @GetMapping("/getTabsByStationBasicId")
public ResponseModel<List<TabDto>> getTabsByStationBasicId(@RequestParam(required = true) String stationBasicId) { public ResponseModel<List<TabDto>> getTabsByStationBasicId(@RequestParam(required = true) String stationBasicId) {
return ResponseHelper.buildResponse(monitoringServiceImpl.getTabsByStationBasicId(stationBasicId)); return ResponseHelper.buildResponse(monitoringServiceImpl.getTabsByStationBasicId(stationBasicId));
} }
@TycloudOperation(ApiLevel = UserType.AGENCY,needAuth = false)
@TycloudOperation(ApiLevel = UserType.AGENCY, needAuth = false)
@ApiOperation(value = "监盘首页地图-全国") @ApiOperation(value = "监盘首页地图-全国")
@GetMapping("/getAreaInfo") @GetMapping("/getAreaInfo")
public ResponseModel<List<MapAreaInfoDto>> getAreaInfo() { public ResponseModel<List<MapAreaInfoDto>> getAreaInfo() {
return ResponseHelper.buildResponse(monitoringServiceImpl.getAreaInfo()); return ResponseHelper.buildResponse(monitoringServiceImpl.getAreaInfo());
} }
@TycloudOperation(ApiLevel = UserType.AGENCY,needAuth = false)
@TycloudOperation(ApiLevel = UserType.AGENCY, needAuth = false)
@ApiOperation(value = "监盘首页地图-片区") @ApiOperation(value = "监盘首页地图-片区")
@GetMapping("/getStaitonListInfoByAreaName") @GetMapping("/getStaitonListInfoByAreaName")
public ResponseModel<List<HomeMapStationInfoDto>> getStaitonListInfoByAreaName(@RequestParam(required = true)String areaName) { public ResponseModel<List<HomeMapStationInfoDto>> getStaitonListInfoByAreaName(@RequestParam(required = true) String areaName) {
return ResponseHelper.buildResponse(monitoringServiceImpl.getStaitonListInfoByAreaName(areaName)); return ResponseHelper.buildResponse(monitoringServiceImpl.getStaitonListInfoByAreaName(areaName));
} }
@TycloudOperation(ApiLevel = UserType.AGENCY,needAuth = false) @TycloudOperation(ApiLevel = UserType.AGENCY, needAuth = false)
@ApiOperation(value = "监盘首页-场站分类信息") @ApiOperation(value = "监盘首页-场站分类信息")
@GetMapping("/getStaionCategoryInfo") @GetMapping("/getStaionCategoryInfo")
public ResponseModel<List<Map<String,String>>> getStaionCategoryInfo(@RequestParam(required = false)String areaName) { public ResponseModel<List<Map<String, String>>> getStaionCategoryInfo(@RequestParam(required = false) String areaName) {
return ResponseHelper.buildResponse(monitoringServiceImpl.getStaionCategoryInfo(areaName)); return ResponseHelper.buildResponse(monitoringServiceImpl.getStaionCategoryInfo(areaName));
} }
@TycloudOperation(ApiLevel = UserType.AGENCY,needAuth = false) @TycloudOperation(ApiLevel = UserType.AGENCY, needAuth = false)
@ApiOperation(value = "监盘首页-装机容量") @ApiOperation(value = "监盘首页-装机容量")
@GetMapping("/getInstallCapityByAreaName") @GetMapping("/getInstallCapityByAreaName")
public ResponseModel<HashMap<String,String>> getInstallCapityByAreaName(@RequestParam(required = false)String areaName) { public ResponseModel<HashMap<String, String>> getInstallCapityByAreaName(@RequestParam(required = false) String areaName) {
return ResponseHelper.buildResponse(monitoringServiceImpl.getInstallCapityByAreaName(areaName)); return ResponseHelper.buildResponse(monitoringServiceImpl.getInstallCapityByAreaName(areaName));
} }
@TycloudOperation(ApiLevel = UserType.AGENCY,needAuth = false) @TycloudOperation(ApiLevel = UserType.AGENCY, needAuth = false)
@ApiOperation(value = "监盘首页-有功功率") @ApiOperation(value = "监盘首页-有功功率")
@GetMapping("/getActivePowerByAreaName") @GetMapping("/getActivePowerByAreaName")
public ResponseModel<HashMap<String,String>> getActivePowerByAreaName(@RequestParam(required = false)String areaName) { public ResponseModel<HashMap<String, String>> getActivePowerByAreaName(@RequestParam(required = false) String areaName) {
return ResponseHelper.buildResponse(monitoringServiceImpl.getActivePowerByAreaName(areaName)); return ResponseHelper.buildResponse(monitoringServiceImpl.getActivePowerByAreaName(areaName));
} }
@TycloudOperation(ApiLevel = UserType.AGENCY,needAuth = false) @TycloudOperation(ApiLevel = UserType.AGENCY, needAuth = false)
@ApiOperation(value = "监盘首页-社会贡献") @ApiOperation(value = "监盘首页-社会贡献")
@GetMapping("/getSocialContributionDtoList") @GetMapping("/getSocialContributionDtoList")
public ResponseModel<Page<SocialContributionDto>> getSocialContributionDtoList(@RequestParam(required = false)String areaName, @RequestParam(required = false)String station) { public ResponseModel<Page<SocialContributionDto>> getSocialContributionDtoList(@RequestParam(required = false) String areaName, @RequestParam(required = false) String station) {
return ResponseHelper.buildResponse(monitoringServiceImpl.getSocialContributionDtoList(areaName,station)); return ResponseHelper.buildResponse(monitoringServiceImpl.getSocialContributionDtoList(areaName, station));
} }
@TycloudOperation(ApiLevel = UserType.AGENCY,needAuth = false)
@TycloudOperation(ApiLevel = UserType.AGENCY, needAuth = false)
@ApiOperation(value = "监盘首页-发电量趋势") @ApiOperation(value = "监盘首页-发电量趋势")
@GetMapping("/getPowerGenerationTrendsOfMonth") @GetMapping("/getPowerGenerationTrendsOfMonth")
public ResponseModel<HashMap<String, List<String>>> getPowerGenerationTrendsOfMonth(@RequestParam(required = false)String areaName) { public ResponseModel<HashMap<String, List<String>>> getPowerGenerationTrendsOfMonth(@RequestParam(required = false) String areaName) {
return ResponseHelper.buildResponse(monitoringServiceImpl.getPowerGenerationTrendsOfMonth(areaName)); return ResponseHelper.buildResponse(monitoringServiceImpl.getPowerGenerationTrendsOfMonth(areaName));
} }
@TycloudOperation(ApiLevel = UserType.AGENCY,needAuth = false)
@TycloudOperation(ApiLevel = UserType.AGENCY, needAuth = false)
@ApiOperation(value = "监盘首页-发电量详情") @ApiOperation(value = "监盘首页-发电量详情")
@GetMapping("/getDetailsOnPowergeneration") @GetMapping("/getDetailsOnPowergeneration")
public ResponseModel<Page<HashMap<String,String>>> getDetailsOnPowergeneration(@RequestParam(required = false)String areaName) { public ResponseModel<Page<HashMap<String, String>>> getDetailsOnPowergeneration(@RequestParam(required = false) String areaName) {
return ResponseHelper.buildResponse(monitoringServiceImpl.getDetailsOnPowergeneration(areaName)); return ResponseHelper.buildResponse(monitoringServiceImpl.getDetailsOnPowergeneration(areaName));
} }
@TycloudOperation(ApiLevel = UserType.AGENCY,needAuth = false) @TycloudOperation(ApiLevel = UserType.AGENCY, needAuth = false)
@ApiOperation(value = "监盘首页-发电量趋势完成率") @ApiOperation(value = "监盘首页-发电量趋势完成率")
@GetMapping("/getPowerGenerationTrendsOfCompletionRate") @GetMapping("/getPowerGenerationTrendsOfCompletionRate")
public ResponseModel<HashMap<String, List<String>>> getPowerGenerationTrendsOfCompletionRate(@RequestParam(required = false)String areaName) { public ResponseModel<HashMap<String, List<String>>> getPowerGenerationTrendsOfCompletionRate(@RequestParam(required = false) String areaName) {
return ResponseHelper.buildResponse(monitoringServiceImpl.getPowerGenerationTrendsOfCompletionRate(areaName)); return ResponseHelper.buildResponse(monitoringServiceImpl.getPowerGenerationTrendsOfCompletionRate(areaName));
} }
@TycloudOperation(ApiLevel = UserType.AGENCY,needAuth = false) @TycloudOperation(ApiLevel = UserType.AGENCY, needAuth = false)
@ApiOperation(value = "监盘首页-发电top5") @ApiOperation(value = "监盘首页-发电top5")
@GetMapping("/getPowerGenerationTrendsOfCompletionTopFive") @GetMapping("/getPowerGenerationTrendsOfCompletionTopFive")
public ResponseModel<Page<HashMap<String,String>>> getPowerGenerationTrendsOfCompletionTopFive(@RequestParam(required = false)String areaName) { public ResponseModel<Page<HashMap<String, String>>> getPowerGenerationTrendsOfCompletionTopFive(@RequestParam(required = false) String areaName) {
return ResponseHelper.buildResponse(monitoringServiceImpl.getPowerGenerationTrendsOfCompletionTopFive(areaName)); return ResponseHelper.buildResponse(monitoringServiceImpl.getPowerGenerationTrendsOfCompletionTopFive(areaName));
} }
@TycloudOperation(ApiLevel = UserType.AGENCY,needAuth = false) @TycloudOperation(ApiLevel = UserType.AGENCY, needAuth = false)
@ApiOperation(value = "监盘首页-发电小时排名top3") @ApiOperation(value = "监盘首页-发电小时排名top3")
@GetMapping("/getPowerGenerationTrendsOfCompletionTopThree") @GetMapping("/getPowerGenerationTrendsOfCompletionTopThree")
public ResponseModel<Page<HashMap<String, String>>> getPowerGenerationTrendsOfCompletionTopThree(@RequestParam(required = false)String areaName,@RequestParam(required = false,defaultValue = "0")String tabValue) { public ResponseModel<Page<HashMap<String, String>>> getPowerGenerationTrendsOfCompletionTopThree(@RequestParam(required = false) String areaName, @RequestParam(required = false, defaultValue = "0") String tabValue) {
return ResponseHelper.buildResponse(monitoringServiceImpl.getPowerGenerationTrendsOfCompletionTopThree(tabValue,areaName)); return ResponseHelper.buildResponse(monitoringServiceImpl.getPowerGenerationTrendsOfCompletionTopThree(tabValue, areaName));
} }
@TycloudOperation(ApiLevel = UserType.AGENCY,needAuth = false) @TycloudOperation(ApiLevel = UserType.AGENCY, needAuth = false)
@ApiOperation(value = "运行监盘-获取全国数据") @ApiOperation(value = "运行监盘-获取全国数据")
@GetMapping("/getTotalData") @GetMapping("/getTotalData")
public void getTotalData() { public void getTotalData() {
monitoringServiceImpl.getTotalData(); monitoringServiceImpl.getTotalData();
} }
@TycloudOperation(ApiLevel = UserType.AGENCY,needAuth = false) @TycloudOperation(ApiLevel = UserType.AGENCY, needAuth = false)
@ApiOperation(value = "运行监盘-功率曲线") @ApiOperation(value = "运行监盘-功率曲线")
@GetMapping("/getTheStationPowerCurve") @GetMapping("/getTheStationPowerCurve")
public ResponseModel<HashMap<String, Object>> getTheStationPowerCurve(@RequestParam(required = false)String stationId,@RequestParam(required = false)String date) { public ResponseModel<HashMap<String, Object>> getTheStationPowerCurve(@RequestParam(required = false) String stationId, @RequestParam(required = false) String date) {
return ResponseHelper.buildResponse(monitoringServiceImpl.getTheStationPowerCurve(stationId,date)); return ResponseHelper.buildResponse(monitoringServiceImpl.getTheStationPowerCurve(stationId, date));
} }
} }
...@@ -20,6 +20,7 @@ import org.slf4j.Logger; ...@@ -20,6 +20,7 @@ import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value; import org.springframework.beans.factory.annotation.Value;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.util.ObjectUtils; import org.springframework.util.ObjectUtils;
import org.typroject.tyboot.component.emq.EmqKeeper; import org.typroject.tyboot.component.emq.EmqKeeper;
...@@ -169,7 +170,7 @@ public class MonitoringServiceImpl { ...@@ -169,7 +170,7 @@ public class MonitoringServiceImpl {
return regionNationWideDtoList; return regionNationWideDtoList;
} }
// @Scheduled(cron = "0/60 * * * * ? ")
public ResultsData getCompletionOfPowerIndicatorsByProvinceName(int current, int size, String provinceName) { public ResultsData getCompletionOfPowerIndicatorsByProvinceName(int current, int size, String provinceName) {
List<ColModel> colModels = new ArrayList<>(); List<ColModel> colModels = new ArrayList<>();
...@@ -190,6 +191,11 @@ public class MonitoringServiceImpl { ...@@ -190,6 +191,11 @@ public class MonitoringServiceImpl {
colModels.add(colModelAnnualPower); colModels.add(colModelAnnualPower);
List<StationCacheInfoDto> stationCacheInfoDtoList = commonServiceImpl.getListStationCacheInfoDto(); List<StationCacheInfoDto> stationCacheInfoDtoList = commonServiceImpl.getListStationCacheInfoDto();
List<StationCacheInfoDto> stationCacheInfoDtos = stationCacheInfoDtoList.stream().filter(stationCacheInfoDto -> stationCacheInfoDto.getBelongProvince().equals(provinceName)).collect(Collectors.toList()); List<StationCacheInfoDto> stationCacheInfoDtos = stationCacheInfoDtoList.stream().filter(stationCacheInfoDto -> stationCacheInfoDto.getBelongProvince().equals(provinceName)).collect(Collectors.toList());
if(ObjectUtils.isEmpty(stationCacheInfoDtos)){
DataGridMock dataGridMock = new DataGridMock(current, 0, false, 1, null);
ResultsData resultsData = new ResultsData(dataGridMock, colModels);
return resultsData;
}
//日发电量 //日发电量
AtomicReference<Double> dailyPower = new AtomicReference<>(0.0); AtomicReference<Double> dailyPower = new AtomicReference<>(0.0);
//月发电量 //月发电量
...@@ -199,12 +205,14 @@ public class MonitoringServiceImpl { ...@@ -199,12 +205,14 @@ public class MonitoringServiceImpl {
//年发电量完成比例 //年发电量完成比例
String completionRatio = "0.00"; String completionRatio = "0.00";
//年利用小时数 //年利用小时数
List<StationPlan> fdzPlans = new ArrayList<>();
int year = Calendar.getInstance().get(Calendar.YEAR); int year = Calendar.getInstance().get(Calendar.YEAR);
List<String> fdz = stationCacheInfoDtos.stream().map(StationCacheInfoDto::getStationId).collect(Collectors.toList()); List<String> fdz = stationCacheInfoDtos.stream().map(StationCacheInfoDto::getStationId).collect(Collectors.toList());
LambdaQueryWrapper<StationPlan> queryWrapper = new LambdaQueryWrapper<>(); LambdaQueryWrapper<StationPlan> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.eq(StationPlan::getYear, String.valueOf(year)); queryWrapper.eq(StationPlan::getYear, String.valueOf(year));
queryWrapper.in(StationPlan::getStationBasicId, fdz); queryWrapper.in(StationPlan::getStationBasicId, fdz);
List<StationPlan> fdzPlans = stationPlanMapper.selectList(queryWrapper);
fdzPlans = stationPlanMapper.selectList(queryWrapper);
double value = fdzPlans.stream().mapToDouble(StationPlan::getValue).sum(); double value = fdzPlans.stream().mapToDouble(StationPlan::getValue).sum();
AtomicReference<Double> useHours = new AtomicReference<>(0.0); AtomicReference<Double> useHours = new AtomicReference<>(0.0);
...@@ -298,18 +306,20 @@ public class MonitoringServiceImpl { ...@@ -298,18 +306,20 @@ public class MonitoringServiceImpl {
socialContributionDtoPage.setRecords(socialContributionDtoList); socialContributionDtoPage.setRecords(socialContributionDtoList);
socialContributionDtoPage.setTotal(100); socialContributionDtoPage.setTotal(100);
socialContributionDtoPage.setCurrent(1); socialContributionDtoPage.setCurrent(1);
Integer allsize = completionOfPowerIndicatorsDtoList.size();
DataGridMock dataGridMock = new DataGridMock(current, allsize, false, allsize / size + 1, completionOfPowerIndicatorsDtoList);
ResultsData resultsData = new ResultsData(dataGridMock, colModels);
try { try {
emqKeeper.getMqttClient().publish("completion_of_powerindicator_topic", JSON.toJSON(socialContributionDtoPage).toString().getBytes("UTF-8"), 1, true); emqKeeper.getMqttClient().publish(provinceName + "_completion_of_powerindicator_list_topic", JSON.toJSON(resultsData).toString().getBytes("UTF-8"), 1, true);
emqKeeper.getMqttClient().publish(provinceName + "_completion_of_powerindicator_topic", JSON.toJSON(socialContributionDtoPage).toString().getBytes("UTF-8"), 1, true);
logger.info("-----------------发送区域实时生产数据消息=================== 成功!" + JSON.toJSONString(socialContributionDtoPage)); logger.info("-----------------发送区域实时生产数据消息=================== 成功!" + JSON.toJSONString(socialContributionDtoPage));
} catch (Exception exception) { } catch (Exception exception) {
logger.error("-----------------发送区域实时生产数据消息=================== 失败!"); logger.error("-----------------发送区域实时生产数据消息=================== 失败!");
} }
Integer allsize = completionOfPowerIndicatorsDtoList.size();
DataGridMock dataGridMock = new DataGridMock(current, allsize, false, allsize / size + 1, completionOfPowerIndicatorsDtoList);
ResultsData resultsData = new ResultsData(dataGridMock, colModels);
return resultsData; return resultsData;
} }
public void getCompletionOfPowerIndicatorsByCurrentData(List<StationCacheInfoDto> stationBasicList, String provinceName) { public void getCompletionOfPowerIndicatorsByCurrentData(List<StationCacheInfoDto> stationBasicList, String provinceName) {
String provinceNameTopic = ""; String provinceNameTopic = "";
if (provinceName.contains("黑龙江") || provinceName.contains("内蒙古")) { if (provinceName.contains("黑龙江") || provinceName.contains("内蒙古")) {
...@@ -320,7 +330,7 @@ public class MonitoringServiceImpl { ...@@ -320,7 +330,7 @@ public class MonitoringServiceImpl {
HashMap<String, String> stringHashMap = new HashMap<>(); HashMap<String, String> stringHashMap = new HashMap<>();
stringHashMap.put("title", provinceNameTopic + "区域"); stringHashMap.put("title", provinceNameTopic + "区域");
try { try {
emqKeeper.getMqttClient().publish("proviceName_topic", JSON.toJSON(stringHashMap).toString().getBytes("UTF-8"), 1, true); emqKeeper.getMqttClient().publish(provinceName + "_proviceName_topic", JSON.toJSON(stringHashMap).toString().getBytes("UTF-8"), 1, true);
logger.info("----------------------------------推送省份名称消息成功败--------------------------------"); logger.info("----------------------------------推送省份名称消息成功败--------------------------------");
} catch (Exception e) { } catch (Exception e) {
logger.info("----------------------------------推送省份名称消息失败--------------------------------"); logger.info("----------------------------------推送省份名称消息失败--------------------------------");
...@@ -529,7 +539,6 @@ public class MonitoringServiceImpl { ...@@ -529,7 +539,6 @@ public class MonitoringServiceImpl {
homeMapStationInfoDto.setCurrentPower(String.format(CommonConstans.Twodecimalplaces, commonServiceImpl.getSumByEquipmentIndxName(esEquipmentsList, "220kV夏雩线212线路测控装置PCS-9705TA有功功率一次值"))); homeMapStationInfoDto.setCurrentPower(String.format(CommonConstans.Twodecimalplaces, commonServiceImpl.getSumByEquipmentIndxName(esEquipmentsList, "220kV夏雩线212线路测控装置PCS-9705TA有功功率一次值")));
} else { } else {
// Map<String, List<String>> queryCondtion = new HashMap<>(); // Map<String, List<String>> queryCondtion = new HashMap<>();
// queryCondtion.put(CommonConstans.QueryStringEquipmentIndexName, Arrays.asList("有功功率")); // queryCondtion.put(CommonConstans.QueryStringEquipmentIndexName, Arrays.asList("有功功率"));
...@@ -547,7 +556,7 @@ public class MonitoringServiceImpl { ...@@ -547,7 +556,7 @@ public class MonitoringServiceImpl {
List<ESEquipments> esEquipmentsList = commonServiceImpl.getListDataByCondtions(queryCondtion2, null, ESEquipments.class); List<ESEquipments> esEquipmentsList = commonServiceImpl.getListDataByCondtions(queryCondtion2, null, ESEquipments.class);
homeMapStationInfoDto.setCurrentPower(String.format(CommonConstans.Twodecimalplaces, commonServiceImpl.getSumByEquipmentIndxName(esEquipmentsList, "南瑞光差保护_313P"))); homeMapStationInfoDto.setCurrentPower(String.format(CommonConstans.Twodecimalplaces, commonServiceImpl.getSumByEquipmentIndxName(esEquipmentsList, "南瑞光差保护_313P")));
Map<String, List<String>> queryCondtion1 = new HashMap<>(); Map<String, List<String>> queryCondtion1 = new HashMap<>();
queryCondtion1.put(CommonConstans.QueryStringEquipmentIndexName, Arrays.asList("WTX-801_25_WTX-801_总辐射")); queryCondtion1.put(CommonConstans.QueryStringEquipmentIndexName, Arrays.asList("WTX-801_25_WTX-801_总辐射"));
queryCondtion1.put(CommonConstans.QueryStringGateWayId, Arrays.asList(stationBasic.getBoosterGatewayId())); queryCondtion1.put(CommonConstans.QueryStringGateWayId, Arrays.asList(stationBasic.getBoosterGatewayId()));
...@@ -882,15 +891,14 @@ public class MonitoringServiceImpl { ...@@ -882,15 +891,14 @@ public class MonitoringServiceImpl {
Map<String, String> shouldQueryCondtion = new HashMap<>(); Map<String, String> shouldQueryCondtion = new HashMap<>();
shouldQueryCondtion.put(CommonConstans.QueryStringFrontMoudle, "逆变器"); shouldQueryCondtion.put(CommonConstans.QueryStringFrontMoudle, "逆变器");
List<ESEquipments> result = commonServiceImpl.getListDataByCondtions(queryCondtion, null, ESEquipments.class, shouldQueryCondtion); List<ESEquipments> result = commonServiceImpl.getListDataByCondtions(queryCondtion, null, ESEquipments.class, shouldQueryCondtion);
// total = commonServiceImpl.getSumByEquipmentIndxName(result, finalIndicator) * CommonConstans.pvGenPoweActor * CommonConstans.pvGenPoweActorDay; // total = commonServiceImpl.getSumByEquipmentIndxName(result, finalIndicator) * CommonConstans.pvGenPoweActor * CommonConstans.pvGenPoweActorDay;
if(finalIndicator.equals("日发电量")){ if (finalIndicator.equals("日发电量")) {
total = commonServiceImpl.getSumByEquipmentIndxName(result, finalIndicator) * CommonConstans.pvGenPoweActor * CommonConstans.pvGenPoweActorDay; total = commonServiceImpl.getSumByEquipmentIndxName(result, finalIndicator) * CommonConstans.pvGenPoweActor * CommonConstans.pvGenPoweActorDay;
}else{ } else {
total = commonServiceImpl.getSumByEquipmentIndxName(result, finalIndicator) * CommonConstans.pvGenPoweActor ; total = commonServiceImpl.getSumByEquipmentIndxName(result, finalIndicator) * CommonConstans.pvGenPoweActor;
} }
} else { } else {
Map<String, List<String>> queryCondtion = new HashMap<>(); Map<String, List<String>> queryCondtion = new HashMap<>();
queryCondtion.put(CommonConstans.QueryStringEquipmentIndexName, Arrays.asList(finalIndicator)); queryCondtion.put(CommonConstans.QueryStringEquipmentIndexName, Arrays.asList(finalIndicator));
...@@ -1310,13 +1318,13 @@ public class MonitoringServiceImpl { ...@@ -1310,13 +1318,13 @@ public class MonitoringServiceImpl {
} }
stationBasicListAll.forEach(stationBasic -> { stationBasicListAll.forEach(stationBasic -> {
if(stationBasic.getStationType().equals("FDZ")){ if (stationBasic.getStationType().equals("FDZ")) {
queryCondtion.put(CommonConstans.QueryStringGateWayId, Arrays.asList(stationBasic.getBoosterGatewayId())); queryCondtion.put(CommonConstans.QueryStringGateWayId, Arrays.asList(stationBasic.getBoosterGatewayId()));
queryCondtion.put(CommonConstans.QueryStringEquipmentIndexName, Arrays.asList("220kV夏雩线212线路测控装置PCS-9705TA有功功率一次值")); queryCondtion.put(CommonConstans.QueryStringEquipmentIndexName, Arrays.asList("220kV夏雩线212线路测控装置PCS-9705TA有功功率一次值"));
List<ESEquipments> esEquipmentsList = commonServiceImpl.getListDataByCondtions(queryCondtion, null, ESEquipments.class); List<ESEquipments> esEquipmentsList = commonServiceImpl.getListDataByCondtions(queryCondtion, null, ESEquipments.class);
total.updateAndGet(v -> v + commonServiceImpl.getSumByEquipmentIndxName(esEquipmentsList, "220kV夏雩线212线路测控装置PCS-9705TA有功功率一次值")); total.updateAndGet(v -> v + commonServiceImpl.getSumByEquipmentIndxName(esEquipmentsList, "220kV夏雩线212线路测控装置PCS-9705TA有功功率一次值"));
}else { } else {
queryCondtion1.put(CommonConstans.QueryStringGateWayId, Arrays.asList(stationBasic.getBoosterGatewayId())); queryCondtion1.put(CommonConstans.QueryStringGateWayId, Arrays.asList(stationBasic.getBoosterGatewayId()));
queryCondtion1.put(CommonConstans.QueryStringEquipmentIndexName, Arrays.asList("南瑞光差保护_313P")); queryCondtion1.put(CommonConstans.QueryStringEquipmentIndexName, Arrays.asList("南瑞光差保护_313P"));
List<ESEquipments> esEquipmentsList = commonServiceImpl.getListDataByCondtions(queryCondtion1, null, ESEquipments.class); List<ESEquipments> esEquipmentsList = commonServiceImpl.getListDataByCondtions(queryCondtion1, null, ESEquipments.class);
......
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