Commit 6119753e authored by caotao's avatar caotao

全景监控大屏 泰和日月年发电量数据来源修改

parent d25d7dbf
...@@ -46,7 +46,7 @@ public class CommonConstans { ...@@ -46,7 +46,7 @@ public class CommonConstans {
//万Kwh转MV //万Kwh转MV
public static final Integer wkwhToMv = 10; public static final Integer wkwhToMv = 10;
//kw转MV //kw转MV
public static final Double kwToMv = 0.0001; public static final Double kwToMv = 0.001;
// 正常运行 发电状态=1 // 正常运行 发电状态=1
// 告警运行 报警状态=1 // 告警运行 报警状态=1
......
...@@ -75,7 +75,7 @@ public class LargeScreenImpl { ...@@ -75,7 +75,7 @@ public class LargeScreenImpl {
value.add(ZFSLJ); value.add(ZFSLJ);
Map<String, List<String>> map = new HashMap<>(); Map<String, List<String>> map = new HashMap<>();
map.put("equipmentIndexName.keyword", value); map.put("equipmentIndexName.keyword", value);
List<StationCacheInfoDto> stationCacheInfoDtos = commonServiceImpl.getListStationCacheInfoDto();
List<? extends Terms.Bucket> lidate = commonServiceImpl.getgroupavg(map, "valueF", "equipmentIndexName.keyword", ESEquipments.class); List<? extends Terms.Bucket> lidate = commonServiceImpl.getgroupavg(map, "valueF", "equipmentIndexName.keyword", ESEquipments.class);
DecimalFormat format2 = new DecimalFormat("#.0000"); DecimalFormat format2 = new DecimalFormat("#.0000");
for (Terms.Bucket bucket : lidate) { for (Terms.Bucket bucket : lidate) {
...@@ -99,34 +99,65 @@ public class LargeScreenImpl { ...@@ -99,34 +99,65 @@ public class LargeScreenImpl {
} }
} }
} }
//日发电量
AtomicReference<Double> dailyPower = new AtomicReference<>(0.0);
//月发电量
AtomicReference<Double> monthlyPower = new AtomicReference<>(0.0);
//年发电量
AtomicReference<Double> annualPower = new AtomicReference<>(0.0);
for (StationCacheInfoDto stationCacheInfoDto : stationCacheInfoDtos) {
//总和 if ("FDZ".equals(stationCacheInfoDto.getStationType())) {
value.clear(); Map<String, List<String>> queryCondtion = new HashMap<>();
value.add(RSD); queryCondtion.put(CommonConstans.QueryStringEquipmentIndexName, Arrays.asList("日发电量", "月发电量", "年发电量"));
value.add(YFD); queryCondtion.put(CommonConstans.QueryStringGateWayId, Arrays.asList(stationCacheInfoDto.getFanGatewayId()));
value.add(NFD); List<ESEquipments> result = commonServiceImpl.getListDataByCondtions(queryCondtion, null, ESEquipments.class);
List<? extends Terms.Bucket> lidatesum = commonServiceImpl.getgroupsum(map, "valueF", "equipmentIndexName.keyword", ESEquipments.class); dailyPower.updateAndGet(v -> v + keepFourdecimalPlaces(commonServiceImpl.getSumByEquipmentIndxName(result, "日发电量")));
monthlyPower.updateAndGet(v -> v + keepFourdecimalPlaces(commonServiceImpl.getSumByEquipmentIndxName(result, "月发电量")));
for (Terms.Bucket bucket : lidatesum) { annualPower.updateAndGet(v -> v + keepFourdecimalPlaces(commonServiceImpl.getSumByEquipmentIndxName(result, "年发电量")));
Aggregations aggregation = bucket.getAggregations(); } else {
List<Aggregation> listdata = Objects.nonNull(aggregation) ? aggregation.asList() : null; Map<String, List<String>> queryCondtion = new HashMap<>();
for (Aggregation agg : listdata) { queryCondtion.put(CommonConstans.QueryStringEquipmentIndexName, CommonConstans.taiHeGenIndicator);
ParsedSum parsedSum = (ParsedSum) agg; queryCondtion.put(CommonConstans.QueryStringGateWayId, Arrays.asList(stationCacheInfoDto.getBoosterGatewayId()));
switch (bucket.getKeyAsString()) { List<ESEquipments> result = commonServiceImpl.getListDataByCondtions(queryCondtion, null, ESEquipments.class);
case RSD: dailyPower.updateAndGet(v -> v + keepFourdecimalPlaces(commonServiceImpl.getSumByEquipmentIndxName(result, CommonConstans.taiHeGenIndicatorDay)));
mapdta.put("RSD", Double.valueOf(format2.format(parsedSum.getValue()*CommonConstans.pvGenPoweActor* CommonConstans.pvGenPoweActorDay))); monthlyPower.updateAndGet(v -> v + keepFourdecimalPlaces(commonServiceImpl.getSumByEquipmentIndxName(result, CommonConstans.taiHeGenIndicatorMonth)));
break; annualPower.updateAndGet(v -> v + keepFourdecimalPlaces(commonServiceImpl.getSumByEquipmentIndxName(result, CommonConstans.taiHeGenIndicatorYear)));
case YFD:
mapdta.put("YFD", Double.valueOf(format2.format(parsedSum.getValue()*CommonConstans.pvGenPoweActornew)));
break;
case NFD:
mapdta.put("NFD", Double.valueOf(format2.format(parsedSum.getValue()*CommonConstans.pvGenPoweActorYear)));
break;
default:
break;
}
} }
} }
mapdta.put("RSD", keepFourdecimalPlaces(dailyPower.get()));
mapdta.put("YFD", keepFourdecimalPlaces(monthlyPower.get()));
mapdta.put("NFD", keepFourdecimalPlaces(annualPower.get()));
//总和
// value.clear();
// value.add(RSD);
// value.add(YFD);
// value.add(NFD);
// List<? extends Terms.Bucket> lidatesum = commonServiceImpl.getgroupsum(map, "valueF", "equipmentIndexName.keyword", ESEquipments.class);
//
// for (Terms.Bucket bucket : lidatesum) {
// Aggregations aggregation = bucket.getAggregations();
// List<Aggregation> listdata = Objects.nonNull(aggregation) ? aggregation.asList() : null;
// for (Aggregation agg : listdata) {
// ParsedSum parsedSum = (ParsedSum) agg;
// switch (bucket.getKeyAsString()) {
// case RSD:
// mapdta.put("RSD", Double.valueOf(format2.format(parsedSum.getValue()*CommonConstans.pvGenPoweActor* CommonConstans.pvGenPoweActorDay)));
// break;
// case YFD:
// mapdta.put("YFD", Double.valueOf(format2.format(parsedSum.getValue()*CommonConstans.pvGenPoweActornew)));
// break;
// case NFD:
// mapdta.put("NFD", Double.valueOf(format2.format(parsedSum.getValue()*CommonConstans.pvGenPoweActorYear)));
// break;
// default:
// break;
// }
// }
// }
//计算月完成百分比 //计算月完成百分比
//当前月份 获取 //当前月份 获取
LocalDate currentDate = LocalDate.now(); LocalDate currentDate = LocalDate.now();
...@@ -238,17 +269,14 @@ public class LargeScreenImpl { ...@@ -238,17 +269,14 @@ public class LargeScreenImpl {
annualPower.updateAndGet(v -> v + keepFourdecimalPlaces(commonServiceImpl.getSumByEquipmentIndxName(result, "年发电量"))); annualPower.updateAndGet(v -> v + keepFourdecimalPlaces(commonServiceImpl.getSumByEquipmentIndxName(result, "年发电量")));
} else { } else {
Map<String, List<String>> queryCondtion = new HashMap<>(); Map<String, List<String>> queryCondtion = new HashMap<>();
Map<String, String> shouldQueryCondtion = new HashMap<>(); queryCondtion.put(CommonConstans.QueryStringEquipmentIndexName, CommonConstans.taiHeGenIndicator);
shouldQueryCondtion.put(CommonConstans.QueryStringFrontMoudle, "逆变器"); queryCondtion.put(CommonConstans.QueryStringGateWayId, Arrays.asList(stationBasic.getBoosterGatewayId()));
queryCondtion.put(CommonConstans.QueryStringEquipmentIndexName, Arrays.asList("日发电量", "月发电量", "年发电量")); List<ESEquipments> result = commonServiceImpl.getListDataByCondtions(queryCondtion, null, ESEquipments.class);
queryCondtion.put(CommonConstans.QueryStringGateWayId, Arrays.asList(stationBasic.getFanGatewayId())); dailyPower.updateAndGet(v -> v + keepFourdecimalPlaces(commonServiceImpl.getSumByEquipmentIndxName(result, CommonConstans.taiHeGenIndicatorDay)));
List<ESEquipments> result = commonServiceImpl.getListDataByCondtions(queryCondtion, null, ESEquipments.class, shouldQueryCondtion); monthlyPower.updateAndGet(v -> v + keepFourdecimalPlaces(commonServiceImpl.getSumByEquipmentIndxName(result, CommonConstans.taiHeGenIndicatorMonth)));
dailyPower.updateAndGet(v -> v + keepFourdecimalPlaces(commonServiceImpl.getSumByEquipmentIndxName(result, "日发电量") * CommonConstans.pvGenPoweActor * CommonConstans.pvGenPoweActorDay)); annualPower.updateAndGet(v -> v + keepFourdecimalPlaces(commonServiceImpl.getSumByEquipmentIndxName(result, CommonConstans.taiHeGenIndicatorYear)));
monthlyPower.updateAndGet(v -> v + keepFourdecimalPlaces(commonServiceImpl.getSumByEquipmentIndxName(result, "月发电量") * CommonConstans.pvGenPoweActornew));
annualPower.updateAndGet(v -> v + keepFourdecimalPlaces(commonServiceImpl.getSumByEquipmentIndxName(result, "年发电量") * CommonConstans.pvGenPoweActorYear));
} }
} }
mapdta.put("RSD", keepFourdecimalPlaces(dailyPower.get())); mapdta.put("RSD", keepFourdecimalPlaces(dailyPower.get()));
......
...@@ -10,6 +10,7 @@ import com.baomidou.mybatisplus.core.toolkit.CollectionUtils; ...@@ -10,6 +10,7 @@ import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.boot.biz.common.utils.DateUtils; import com.yeejoin.amos.boot.biz.common.utils.DateUtils;
import com.yeejoin.amos.boot.biz.common.entity.BaseEntity; import com.yeejoin.amos.boot.biz.common.entity.BaseEntity;
import com.yeejoin.amos.boot.biz.common.utils.QRCodeUtil;
import com.yeejoin.amos.boot.module.jxiop.api.Enum.ElectricQuantity; import com.yeejoin.amos.boot.module.jxiop.api.Enum.ElectricQuantity;
import com.yeejoin.amos.boot.module.jxiop.api.Enum.KGName; import com.yeejoin.amos.boot.module.jxiop.api.Enum.KGName;
import com.yeejoin.amos.boot.module.jxiop.api.dto.IndexDto; import com.yeejoin.amos.boot.module.jxiop.api.dto.IndexDto;
...@@ -1936,22 +1937,27 @@ public class MonitorFanIndicatorImpl implements IMonitorFanIndicator { ...@@ -1936,22 +1937,27 @@ public class MonitorFanIndicatorImpl implements IMonitorFanIndicator {
queryCondtion.put(CommonConstans.QueryStringGateWayId, Arrays.asList(gatewayId)); queryCondtion.put(CommonConstans.QueryStringGateWayId, Arrays.asList(gatewayId));
Map<String, String> likeQuerCondtion = new HashMap<>(); Map<String, String> likeQuerCondtion = new HashMap<>();
if(query!=null){ if(query!=null){
likeQuerCondtion.put(CommonConstans.QueryStringFrontMoudle, "逆变器"); queryCondtion.put(CommonConstans.QueryStringEquipmentIndexName,CommonConstans.taiHeGenIndicator);
}
List<ESEquipments> result = commonServiceImpl.getListDataByCondtions(queryCondtion, null, ESEquipments.class);
Double powerOfDay = 0.0000;
Double powerOfMonth = 0.0000;
Double powerOfAnnual = 0.0000;
if(ObjectUtils.isEmpty(query)){
powerOfDay = powerOfDay + keepFourdecimalPlaces(commonServiceImpl.getSumByEquipmentIndxName(result, "日发电量"));
powerOfMonth = powerOfMonth + keepFourdecimalPlaces(commonServiceImpl.getSumByEquipmentIndxName(result, "月发电量"));
powerOfAnnual = powerOfAnnual + keepFourdecimalPlaces(commonServiceImpl.getSumByEquipmentIndxName(result, "年发电量"));
}else {
powerOfDay = powerOfDay + keepFourdecimalPlaces(commonServiceImpl.getSumByEquipmentIndxName(result, CommonConstans.taiHeGenIndicatorDay));
powerOfMonth = powerOfMonth + keepFourdecimalPlaces(commonServiceImpl.getSumByEquipmentIndxName(result, CommonConstans.taiHeGenIndicatorMonth));
powerOfAnnual = powerOfAnnual + keepFourdecimalPlaces(commonServiceImpl.getSumByEquipmentIndxName(result, CommonConstans.taiHeGenIndicatorYear));
} }
List<ESEquipments> result = commonServiceImpl.getListDataByCondtions(queryCondtion, null, ESEquipments.class, likeQuerCondtion);
Double powerOfDayFD = 0.0000;
Double powerOfMonthFD = 0.0000;
Double powerOfAnnualFD = 0.0000;
powerOfDayFD = powerOfDayFD + keepFourdecimalPlaces(commonServiceImpl.getSumByEquipmentIndxName(result, "日发电量"));
powerOfMonthFD = powerOfMonthFD + keepFourdecimalPlaces(commonServiceImpl.getSumByEquipmentIndxName(result, "月发电量"));
powerOfAnnualFD = powerOfAnnualFD + keepFourdecimalPlaces(commonServiceImpl.getSumByEquipmentIndxName(result, "年发电量"));
Map<String, Object> hashMap = new HashMap<>(); Map<String, Object> hashMap = new HashMap<>();
hashMap.put("日发电量",powerOfDayFD); hashMap.put("日发电量",powerOfDay);
hashMap.put("月发电量",powerOfMonthFD); hashMap.put("月发电量",powerOfMonth);
hashMap.put("年发电量",powerOfAnnualFD); hashMap.put("年发电量",powerOfAnnual);
return hashMap; return hashMap;
} }
......
...@@ -88,16 +88,15 @@ public class PowerGenerationImpl { ...@@ -88,16 +88,15 @@ public class PowerGenerationImpl {
//"日发电量" //"日发电量"
if("日发电量".equals(value)){ if("日发电量".equals(value)){
//"日发电量" //"日发电量"
flags= CommonConstans.pvGenPoweActor * CommonConstans.pvGenPoweActorDay; value= CommonConstans.taiHeGenIndicatorDay;
}else if("月发电量".equals(value)){ }else if("月发电量".equals(value)){
//"月发电量" //"月发电量"
flags= CommonConstans.pvGenPoweActornew; value= CommonConstans.taiHeGenIndicatorMonth;
}else{ }else{
//"年发电量" //"年发电量"
flags= CommonConstans.pvGenPoweActorYear; value= CommonConstans.taiHeGenIndicatorYear;
} }
indexDto= indicatorDataMapper.selectlastgf(value, stationCacheInfoDto.getBoosterGatewayId(), startTime, endTime);
indexDto= indicatorDataMapper.selectlastgf(value, gatewayId, startTime, endTime);
//indexDto= this.getlastgf(gatewayId,value,datyvalue); //indexDto= this.getlastgf(gatewayId,value,datyvalue);
} }
......
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