Commit f529b34a authored by chenzhao's avatar chenzhao

监盘问题 总概览修复

parent 1344d134
package com.yeejoin.amos.boot.module.jxiop.biz.controller;
import cn.hutool.core.util.StrUtil;
import cn.hutool.extra.pinyin.PinyinUtil;
import com.alibaba.fastjson.JSON;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
......@@ -210,7 +209,7 @@ public class MonitorFanIdxController extends BaseController {
StationBasic stationBasic = stationBasicMapper.selectById(stationId);
String gatewayId = stationBasic.getFanGatewayId();
String [] columnList = new String[]{"日发电量","月发电量","年发电量"};
String [] columnLists = new String[]{"有功功率","瞬时风速"};
String [] columnLists = new String[]{"瞬时风速"};
Map<String, Object> columnMap = new HashMap<>();
for (String column : columnList) {
......@@ -222,6 +221,12 @@ public class MonitorFanIdxController extends BaseController {
columnMap.put(column, String.format("%.2f",result));
}
Map<String, List<String>> queryCondtion1 = new HashMap<>();
queryCondtion1.put(CommonConstans.QueryStringEquipmentIndexName, Arrays.asList("220kV夏雩线212线路测控装置PCS-9705TA有功功率一次值"));
queryCondtion1.put(CommonConstans.QueryStringGateWayId, Arrays.asList(stationBasic.getBoosterGatewayId()));
List<ESEquipments> result1 = commonService.getListDataByCondtions(queryCondtion1, null, ESEquipments.class);
columnMap.put("有功功率", String.format("%.2f",result1.get(0).getValueDouble()));
String num = monitorFanIndicator.getEquipCount(gatewayId,"FDZ");
columnMap.put("风机台数",num);
......@@ -249,7 +254,7 @@ public class MonitorFanIdxController extends BaseController {
data5.put("title",columnMap.get("年发电量").toString());
objects.add(data5);
Map<String, Object> data6 = new HashMap<>();
data6.put("title", String.format("%.2f",Double.parseDouble(columnMap.get("有功功率").toString())/1000)) ;
data6.put("title", columnMap.get("有功功率")) ;
objects.add(data6);
Map<String, Object> data7 = new HashMap<>();
......@@ -494,10 +499,9 @@ public class MonitorFanIdxController extends BaseController {
@ApiOperation(value = "故障记录API")
@GetMapping("/alarmEventtList")
public ResponseModel<ResultsData> getAlarmEventList(@RequestParam(value = "current") int current,
@RequestParam(value = "size") int size,
@RequestParam(value = "stationId") String stationId,
@RequestParam(value = "type", required = false) String type) {
type = StrUtil.isEmpty(type) ? "0" : type;
@RequestParam(value = "size") int size,
@RequestParam(value = "stationId") String stationId,
@RequestParam(value = "type") String type) {
ResultsData resultsData = new ResultsData();
if (type.equals("0")){
resultsData = monitorFanIndicatorImpl.getAlarmEventList(current, size, stationId);
......@@ -599,10 +603,22 @@ public class MonitorFanIdxController extends BaseController {
String boosterGatewayId = stationBasic.getBoosterGatewayId();
String [] columnList = new String[]{"日发电量","月发电量","年发电量"};
String [] columnLists = new String[]{"有功功率"};
String [] syLists = new String[]{"总辐射累计","总辐射","日照时数"};
String [] syLists = new String[]{"WTX-801_25_WTX-801_总辐射累计","WTX-801_25_WTX-801_总辐射","日照时数"};
Map<String, Object> columnMap = new HashMap<>();
//日 月 年发电量同仅统计逆变器数据
List<Map<String, Object>> mapList;
for (String column : columnList) {
Double result = commonService.getTotalByIndicatiorByGF(gatewayId, column);
columnMap.put(column, String.format("%.2f",result));
}
Map<String, List<String>> queryCondtion = new HashMap<>();
queryCondtion.put(CommonConstans.QueryStringEquipmentIndexName, Arrays.asList("南瑞光差保护_313P"));
queryCondtion.put(CommonConstans.QueryStringGateWayId, Arrays.asList(stationBasic.getBoosterGatewayId()));
List<ESEquipments> result1 = commonService.getListDataByCondtions(queryCondtion, null, ESEquipments.class);
columnMap.put("有功功率", String.format("%.2f",result1.get(0).getValueDouble()));
mapList = influxdbUtil.query("SELECT * FROM indicators_" + stationBasic.getFanGatewayId() + " where frontModule=~/逆变器/ and(equipmentIndexName='日发电量' or equipmentIndexName='月发电量' or equipmentIndexName='年发电量' or equipmentIndexName='有功功率')");
//日-月-年-发电量需要保留四位小数问题修改
for (String column : columnList) {
......@@ -639,7 +655,7 @@ public class MonitorFanIdxController extends BaseController {
data3.put("title",columnMap.get("月发电量").toString());
objects.add(data3);
Map<String, Object> data4 = new HashMap<>();
data4.put("title",columnMap.get("总辐射").toString());
data4.put("title",columnMap.get("WTX-801_25_WTX-801_总辐射").toString());
objects.add(data4);
Map<String, Object> data5 = new HashMap<>();
data5.put("title",columnMap.get("年发电量").toString());
......@@ -651,7 +667,7 @@ public class MonitorFanIdxController extends BaseController {
data7.put("title",columnMap.get("日照时数").toString());
objects.add(data7);
Map<String, Object> data8 = new HashMap<>();
data8.put("title",columnMap.get("总辐射累计").toString());
data8.put("title",columnMap.get("WTX-801_25_WTX-801_总辐射累计").toString());
objects.add(data8);
Map<String, Object> data9 = new HashMap<>();
data9.put("title","0.00%");//综合效率
......
......@@ -233,6 +233,24 @@ public class CommonServiceImpl {
return Double.valueOf(String.format("%.2f", totalvalue));
}
public Double getTotalByIndicatiorByGF(String gatewayId, String indicator) {
//用于组装-es查询条件
Map<String, List<String>> queryCondtion = new HashMap<>();
Map<String, String> likeQuerCondtion = new HashMap<>();
queryCondtion.put(CommonConstans.QueryStringEquipmentIndexName, Arrays.asList(indicator));
queryCondtion.put(CommonConstans.QueryStringGateWayId, Arrays.asList(gatewayId));
likeQuerCondtion.put(CommonConstans.QueryStringFrontMoudle, "逆变器");
List<ESEquipments> result = getListDataByCondtions(queryCondtion, null, ESEquipments.class,likeQuerCondtion);
Double totalvalue = 0.00;
try {
totalvalue = result.stream().filter(stringObjectMap -> !ObjectUtils.isEmpty(stringObjectMap.getValueDouble())).mapToDouble(l -> Double.parseDouble(l.getValueDouble().toString())).sum();
} catch (Exception e) {
return totalvalue;
}
return Double.valueOf(String.format("%.2f", totalvalue));
}
public Double getTotalByIndicatiorAndParams(String gatewayId, String indicator, String querySql) {
String sql = "SELECT * FROM indicators_" + gatewayId + " where equipmentIndexName='" + indicator + "'";
Double totalvalue = 0.00;
......
......@@ -196,28 +196,32 @@ public class MonitoringServiceImpl {
if (stationCacheInfoDto.getStationType().equals("FDZ")) {
//用于组装-es查询条件
Map<String, List<String>> queryCondtion = new HashMap<>();
Map<String, List<String>> queryCondtion1 = new HashMap<>();
queryCondtion1.put(CommonConstans.QueryStringEquipmentIndexName, Arrays.asList("220kV夏雩线212线路测控装置PCS-9705TA有功功率一次值"));
queryCondtion1.put(CommonConstans.QueryStringGateWayId, Arrays.asList(stationCacheInfoDto.getBoosterGatewayId()));
List<ESEquipments> result1 = commonServiceImpl.getListDataByCondtions(queryCondtion1, null, ESEquipments.class);
queryCondtion.put(CommonConstans.QueryStringEquipmentIndexName, Arrays.asList("瞬时风速", "有功功率", "日发电量", "月发电量", "年发电量","220kV夏雩线212线路测控装置PCS-9705TA有功功率一次值"));
queryCondtion.put(CommonConstans.QueryStringEquipmentIndexName, Arrays.asList("瞬时风速", "日发电量", "月发电量", "年发电量"));
queryCondtion.put(CommonConstans.QueryStringGateWayId, Arrays.asList(stationCacheInfoDto.getFanGatewayId()));
List<ESEquipments> result = commonServiceImpl.getListDataByCondtions(queryCondtion, null, ESEquipments.class);
completionOfPowerIndicatorsDto.setWindSpeedOrIrradiance(String.format(CommonConstans.Twodecimalplaces, commonServiceImpl.getAvagerByEquipmentIndxName(result, "瞬时风速")));
completionOfPowerIndicatorsDto.setActivePower(String.format(CommonConstans.Twodecimalplaces, commonServiceImpl.getSumByEquipmentIndxName(result, "有功功率")));
completionOfPowerIndicatorsDto.setActivePower(String.format(CommonConstans.Twodecimalplaces, commonServiceImpl.getSumByEquipmentIndxName(result1, "220kV夏雩线212线路测控装置PCS-9705TA有功功率一次值")));
completionOfPowerIndicatorsDto.setDailyPower(String.format(CommonConstans.Fourdecimalplaces, commonServiceImpl.getSumByEquipmentIndxName(result, "日发电量")));
completionOfPowerIndicatorsDto.setMonthlyPower(String.format(CommonConstans.Fourdecimalplaces, commonServiceImpl.getSumByEquipmentIndxName(result, "月发电量")));
completionOfPowerIndicatorsDto.setAnnualPower(String.format(CommonConstans.Fourdecimalplaces, commonServiceImpl.getSumByEquipmentIndxName(result, "年发电量")));
} else {
Map<String, List<String>> queryCondtion = new HashMap<>();
queryCondtion.put(CommonConstans.QueryStringEquipmentIndexName, Arrays.asList("南瑞光差保护_313P", "日发电量", "月发电量", "年发电量"));
queryCondtion.put(CommonConstans.QueryStringEquipmentIndexName, Arrays.asList( "日发电量", "月发电量", "年发电量"));
queryCondtion.put(CommonConstans.QueryStringGateWayId, Arrays.asList(stationCacheInfoDto.getFanGatewayId()));
Map<String, String> shouldQueryCondtion = new HashMap<>();
shouldQueryCondtion.put("frontModule", "逆变器");
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_总辐射","南瑞光差保护_313P"));
queryCondtion1.put(CommonConstans.QueryStringGateWayId, Arrays.asList(stationCacheInfoDto.getBoosterGatewayId()));
List<ESEquipments> result = commonServiceImpl.getListDataByCondtions(queryCondtion, shouldQueryCondtion, ESEquipments.class);
List<ESEquipments> result1 = commonServiceImpl.getListDataByCondtions(queryCondtion1, null, ESEquipments.class);
completionOfPowerIndicatorsDto.setWindSpeedOrIrradiance(String.format(CommonConstans.Twodecimalplaces, commonServiceImpl.getSumByEquipmentIndxName(result1, "WTX-801_25_WTX-801_总辐射")));
completionOfPowerIndicatorsDto.setActivePower(String.format(CommonConstans.Twodecimalplaces, commonServiceImpl.getSumByEquipmentIndxName(result, "南瑞光差保护_313P")));
completionOfPowerIndicatorsDto.setActivePower(String.format(CommonConstans.Twodecimalplaces, commonServiceImpl.getSumByEquipmentIndxName(result1, "南瑞光差保护_313P")));
completionOfPowerIndicatorsDto.setDailyPower(String.format(CommonConstans.Fourdecimalplaces, commonServiceImpl.getSumByEquipmentIndxName(result, "日发电量") * CommonConstans.pvGenPoweActor));
completionOfPowerIndicatorsDto.setMonthlyPower(String.format(CommonConstans.Fourdecimalplaces, commonServiceImpl.getSumByEquipmentIndxName(result, "月发电量") * CommonConstans.pvGenPoweActor));
completionOfPowerIndicatorsDto.setAnnualPower(String.format(CommonConstans.Fourdecimalplaces, new BigDecimal(commonServiceImpl.getSumByEquipmentIndxName(result, "年发电量") * CommonConstans.pvGenPoweActor)));
......
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