Commit 9e4cf658 authored by chenzhao's avatar chenzhao

批量将valueDouble 修改成 valueF

parent 50a037b2
......@@ -3,7 +3,6 @@ package com.yeejoin.amos.boot.module.jxiop.biz.ESDto;
import io.github.classgraph.json.Id;
import lombok.Data;
import lombok.experimental.Accessors;
import org.springframework.data.elasticsearch.annotations.DateFormat;
import org.springframework.data.elasticsearch.annotations.Document;
import org.springframework.data.elasticsearch.annotations.Field;
import org.springframework.data.elasticsearch.annotations.FieldType;
......@@ -43,7 +42,7 @@ public class ESEquipments {
@Field(type = FieldType.Text, index = false)
private String value;
@Field(type = FieldType.Float, index = false)
private Float valueDouble;
private Float valueF;
@Field(type = FieldType.Text , index = false)
private String valueLabel;
@Field(type = FieldType.Text , index = false)
......@@ -62,9 +61,9 @@ public class ESEquipments {
private String displayName;
public ESEquipments(Float valueDouble,String id, String address, String dataType, String equipmentSpecificName, String gatewayId, String isAlarm, Date createdTime, String unit, String value, String valueLabel, String traceId, String equipmentIndexName, String equipmentNumber, String frontModule, String systemType, String pictureName, String displayName) {
public ESEquipments(Float valueF, String id, String address, String dataType, String equipmentSpecificName, String gatewayId, String isAlarm, Date createdTime, String unit, String value, String valueLabel, String traceId, String equipmentIndexName, String equipmentNumber, String frontModule, String systemType, String pictureName, String displayName) {
this.valueDouble = valueDouble;
this.valueF = valueF;
this.id = id;
this.address = address;
this.dataType = dataType;
......
......@@ -23,23 +23,16 @@ import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.apache.commons.io.IOUtils;
import org.eclipse.paho.client.mqttv3.MqttException;
import org.elasticsearch.action.search.SearchRequest;
import org.elasticsearch.action.search.SearchResponse;
import org.elasticsearch.client.RequestOptions;
import org.elasticsearch.client.RestHighLevelClient;
import org.elasticsearch.index.query.BoolQueryBuilder;
import org.elasticsearch.index.query.QueryBuilder;
import org.elasticsearch.index.query.QueryBuilders;
import org.elasticsearch.rest.RestStatus;
import org.elasticsearch.search.aggregations.Aggregation;
import org.elasticsearch.search.aggregations.Aggregations;
import org.elasticsearch.search.aggregations.bucket.terms.Terms;
import org.elasticsearch.search.aggregations.metrics.ParsedSum;
import org.elasticsearch.search.builder.SearchSourceBuilder;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.core.io.Resource;
import org.springframework.data.domain.PageRequest;
import org.springframework.data.elasticsearch.core.ElasticsearchRestTemplate;
import org.springframework.data.elasticsearch.core.SearchHit;
import org.springframework.data.elasticsearch.core.SearchHits;
......@@ -1047,12 +1040,12 @@ public class MonitorFanIdxController extends BaseController {
map.put("name",key);
for (ESEquipments equip : resultMap.get(key)) {
if (!stationBasic.getStationType().equals("FDZ")){
float value = equip.getValueDouble();
float value = equip.getValueF();
float v = CommonConstans.pvGenPoweActor.floatValue();
equip.setValueDouble(value * v);
equip.setValueF(value * v);
}
String value = String.format("%.4f", equip.getValueDouble());
String value = String.format("%.4f", equip.getValueF());
switch(equip.getEquipmentIndexName()){
case "日发电量":
map.put("dayNum",value);
......
......@@ -9,7 +9,6 @@ import com.yeejoin.amos.boot.module.jxiop.api.mapper.MapRegionMapper;
import com.yeejoin.amos.boot.module.jxiop.api.mapper.RegionMapper;
import com.yeejoin.amos.boot.module.jxiop.api.mapper.StationBasicMapper;
import com.yeejoin.amos.boot.module.jxiop.biz.ESDto.ESEquipments;
import com.yeejoin.amos.boot.module.jxiop.biz.dto.IndicatorsDto;
import com.yeejoin.amos.boot.module.jxiop.biz.dto.QueryDto;
import com.yeejoin.amos.boot.module.jxiop.biz.dto.SocialContributionDto;
import com.yeejoin.amos.boot.module.jxiop.biz.dto.StationCacheInfoDto;
......@@ -284,7 +283,7 @@ public class CommonServiceImpl {
public Double getSumByEquipmentIndxName(List<ESEquipments> equipments, String indexName) {
Double result = 0.00;
result = equipments.stream().filter(esEquipments -> esEquipments.getEquipmentIndexName().equals(indexName)).mapToDouble(ESEquipments::getValueDouble).sum();
result = equipments.stream().filter(esEquipments -> esEquipments.getEquipmentIndexName().equals(indexName)).mapToDouble(ESEquipments::getValueF).sum();
return result;
}
......
......@@ -10,12 +10,10 @@ import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
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.utils.DateUtils;
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.dto.IndexDto;
import com.yeejoin.amos.boot.module.jxiop.api.dto.TreeDto;
import com.yeejoin.amos.boot.module.jxiop.api.entity.MonitorFanIndicator;
import com.yeejoin.amos.boot.module.jxiop.api.entity.Region;
import com.yeejoin.amos.boot.module.jxiop.api.entity.StationBasic;
import com.yeejoin.amos.boot.module.jxiop.api.mapper.MonitorFanIndicatorMapper;
......@@ -35,16 +33,11 @@ import com.yeejoin.amos.component.robot.BadRequest;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.io.IOUtils;
import org.apache.commons.lang3.StringUtils;
import org.apache.velocity.runtime.directive.Break;
import org.eclipse.paho.client.mqttv3.MqttException;
import org.elasticsearch.common.recycler.Recycler;
import org.elasticsearch.index.Index;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.core.io.Resource;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Service;
import org.springframework.util.ObjectUtils;
import org.typroject.tyboot.component.emq.EmqKeeper;
......@@ -616,7 +609,7 @@ public class MonitorFanIndicatorImpl implements IMonitorFanIndicator {
}
queryCondtion.put(CommonConstans.QueryStringEquipmentIndexName, Arrays.asList("220kV夏雩线212线路测控装置PCS-9705TA有功功率一次值", "南瑞光差保护_313P"));
List<ESEquipments> indicatorsDtoList = commonServiceImpl.getListDataByCondtions(queryCondtion, null, ESEquipments.class);
double sum = indicatorsDtoList.stream().mapToDouble(t -> Double.parseDouble(t.getValueDouble().toString())).sum();
double sum = indicatorsDtoList.stream().mapToDouble(t -> Double.parseDouble(t.getValueF().toString())).sum();
Double format = Double.parseDouble(String.format("%.2f", sum / installedCapacity));
List<Map<String, Object>> list = temporaryDataMapper.timingTemporarysSorageData(gatewayId);
Map<String,Object> map = new HashMap<>();
......
......@@ -40,7 +40,7 @@ public class ESEquipments {
@Field(type = FieldType.Text)
private String value;
@Field(type = FieldType.Float, index = false)
private Float valueDouble;
private Float valueF;
@Field(type = FieldType.Text)
private String valueLabel;
@Field(type = FieldType.Text , index = false)
......@@ -59,9 +59,9 @@ public class ESEquipments {
private String displayName;
public ESEquipments(Float valueDouble,String id, String address, String dataType, String equipmentSpecificName, String gatewayId, String isAlarm, Date createdTime, String unit, String value, String valueLabel, String traceId, String equipmentIndexName, String equipmentNumber, String frontModule, String systemType, String pictureName, String displayName) {
public ESEquipments(Float valueF, String id, String address, String dataType, String equipmentSpecificName, String gatewayId, String isAlarm, Date createdTime, String unit, String value, String valueLabel, String traceId, String equipmentIndexName, String equipmentNumber, String frontModule, String systemType, String pictureName, String displayName) {
this.valueDouble = valueDouble;
this.valueF = valueF;
this.id = id;
this.address = address;
this.dataType = dataType;
......
package com.yeejoin.amos.boot.module.jxiop.biz.controller;
import cn.hutool.extra.pinyin.PinyinUtil;
import com.alibaba.fastjson.JSON;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.boot.biz.common.controller.BaseController;
import com.yeejoin.amos.boot.module.common.biz.utils.CommonResponseUtil;
import com.yeejoin.amos.boot.module.jxiop.api.Enum.GeneratingCapacity;
import com.yeejoin.amos.boot.module.jxiop.api.dto.IndexDto;
import com.yeejoin.amos.boot.module.jxiop.api.dto.TreeDto;
import com.yeejoin.amos.boot.module.jxiop.api.entity.StationBasic;
......@@ -225,7 +223,7 @@ public class MonitorFanIdxController extends BaseController {
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()));
columnMap.put("有功功率", String.format("%.2f",result1.get(0).getValueF()));
String num = monitorFanIndicator.getEquipCount(gatewayId,"FDZ");
columnMap.put("风机台数",num);
......@@ -617,7 +615,7 @@ public class MonitorFanIdxController extends BaseController {
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()));
columnMap.put("有功功率", String.format("%.2f",result1.get(0).getValueF()));
mapList = influxdbUtil.query("SELECT * FROM indicators_" + stationBasic.getFanGatewayId() + " where frontModule=~/逆变器/ and(equipmentIndexName='日发电量' or equipmentIndexName='月发电量' or equipmentIndexName='年发电量' or equipmentIndexName='有功功率')");
//日-月-年-发电量需要保留四位小数问题修改
......
......@@ -15,7 +15,7 @@ public class ESEquipmentsDTO {
private Date createdTime;
private String unit;
private String value;
private Float valueDouble;
private Float valueF;
private String valueLabel;
private String traceId;
private String equipmentIndexName;
......
......@@ -40,7 +40,6 @@ import org.springframework.stereotype.Service;
import org.springframework.util.ObjectUtils;
import javax.annotation.Resource;
import javax.sql.rowset.serial.SerialJavaObject;
import java.util.*;
import java.util.stream.Collectors;
......@@ -226,7 +225,7 @@ public class CommonServiceImpl {
List<ESEquipments> result = getListDataByCondtions(queryCondtion, null, ESEquipments.class);
Double totalvalue = 0.00;
try {
totalvalue = result.stream().filter(stringObjectMap -> !ObjectUtils.isEmpty(stringObjectMap.getValueDouble())).mapToDouble(l -> Double.parseDouble(l.getValueDouble().toString())).sum();
totalvalue = result.stream().filter(stringObjectMap -> !ObjectUtils.isEmpty(stringObjectMap.getValueF())).mapToDouble(l -> Double.parseDouble(l.getValueF().toString())).sum();
} catch (Exception e) {
return totalvalue;
}
......@@ -244,7 +243,7 @@ public class CommonServiceImpl {
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();
totalvalue = result.stream().filter(stringObjectMap -> !ObjectUtils.isEmpty(stringObjectMap.getValueF())).mapToDouble(l -> Double.parseDouble(l.getValueF().toString())).sum();
} catch (Exception e) {
return totalvalue;
}
......@@ -574,13 +573,13 @@ public class CommonServiceImpl {
}
public Double getAvagerByEquipmentIndxName(List<ESEquipments> equipments, String indexName) {
Double result = 0.00;
result = equipments.stream().filter(esEquipments -> esEquipments.getEquipmentIndexName().equals(indexName)).mapToDouble(ESEquipments::getValueDouble).average().getAsDouble();
result = equipments.stream().filter(esEquipments -> esEquipments.getEquipmentIndexName().equals(indexName)).mapToDouble(ESEquipments::getValueF).average().getAsDouble();
return result;
}
public Double getSumByEquipmentIndxName(List<ESEquipments> equipments, String indexName) {
Double result = 0.00;
result = equipments.stream().filter(esEquipments -> esEquipments.getEquipmentIndexName().equals(indexName)).mapToDouble(ESEquipments::getValueDouble).sum();
result = equipments.stream().filter(esEquipments -> esEquipments.getEquipmentIndexName().equals(indexName)).mapToDouble(ESEquipments::getValueF).sum();
return result;
}
......
......@@ -5,21 +5,17 @@ import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.Query;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.BeanUtils;
import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
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.utils.DateUtils;
import com.yeejoin.amos.boot.module.jxiop.api.Enum.AlarmDesc;
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.dto.IndexDto;
import com.yeejoin.amos.boot.module.jxiop.api.dto.TreeDto;
import com.yeejoin.amos.boot.module.jxiop.api.entity.MonitorFanIndicator;
import com.yeejoin.amos.boot.module.jxiop.api.entity.Region;
import com.yeejoin.amos.boot.module.jxiop.api.entity.StationBasic;
import com.yeejoin.amos.boot.module.jxiop.api.mapper.MonitorFanIndicatorMapper;
......@@ -32,13 +28,11 @@ import com.yeejoin.amos.boot.module.jxiop.biz.entity.*;
import com.yeejoin.amos.boot.module.jxiop.biz.mapper2.*;
import com.yeejoin.amos.boot.module.jxiop.biz.utils.InfluxDButils;
import com.yeejoin.amos.boot.module.jxiop.biz.service.IMonitorFanIndicator;
import com.yeejoin.amos.component.influxdb.InfluxdbUtil;
import com.yeejoin.amos.component.robot.BadRequest;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.io.IOUtils;
import org.apache.commons.lang3.StringUtils;
import org.eclipse.paho.client.mqttv3.MqttException;
import org.elasticsearch.gateway.GatewayAllocator;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.core.io.Resource;
......@@ -199,7 +193,7 @@ public class MonitorFanIndicatorImpl implements IMonitorFanIndicator {
}
List<ESEquipments> result = commonServiceImpl.getListDataByCondtionsAndLike(queryCondtion, null, ESEquipments.class, likeMap);
result.stream().forEach(e -> {
e.setValue(String.format(CommonConstans.Twodecimalplaces, e.getValueDouble()));
e.setValue(String.format(CommonConstans.Twodecimalplaces, e.getValueF()));
});
Collator instance = Collator.getInstance(Locale.CHINA);
Collections.sort(result, (e1, e2) -> {
......@@ -395,7 +389,7 @@ public class MonitorFanIndicatorImpl implements IMonitorFanIndicator {
ESEquipments esEquipments = result.get(i);
if (esEquipments.getEquipmentIndexName().contains("温度")) {
xList.add(esEquipments.getEquipmentIndexName());
yList.add(esEquipments.getValueDouble().toString());
yList.add(esEquipments.getValueF().toString());
}
}
realTimeTemperatureResult.put("axisData", xList);
......@@ -421,8 +415,8 @@ public class MonitorFanIndicatorImpl implements IMonitorFanIndicator {
queryCondtion.put(CommonConstans.QueryStringGateWayId, Arrays.asList(stationBasic.getFanGatewayId()));
queryCondtion.put(CommonConstans.QueryStringEquipmentNumberKeyword, Arrays.asList(equipNum));
List<ESEquipments> equipNumList = commonServiceImpl.getListDataByCondtionsAndLike(queryCondtion, null, ESEquipments.class, likeMap);
if (CollectionUtils.isNotEmpty(equipNumList) && StringUtils.isNotEmpty(equipNumList.get(0).getValueDouble().toString())) {
return equipNumList.get(0).getValueDouble().toString();
if (CollectionUtils.isNotEmpty(equipNumList) && StringUtils.isNotEmpty(equipNumList.get(0).getValueF().toString())) {
return equipNumList.get(0).getValueF().toString();
} else {
return "0";
}
......@@ -659,7 +653,7 @@ public class MonitorFanIndicatorImpl implements IMonitorFanIndicator {
temporaryData.setCreatedTime(time.split(" ")[1]);
temporaryData.setEquipmentIndexName(indicatorsDto.getEquipmentIndexName());
temporaryData.setGatewayId(indicatorsDto.getGatewayId());
temporaryData.setValue(indicatorsDto.getValueDouble());
temporaryData.setValue(indicatorsDto.getValueF());
temporaryData.setEquipmentNumber(indicatorsDto.getEquipmentNumber());
temporaryDatas.add(temporaryData);
} catch (Exception e) {
......@@ -673,7 +667,7 @@ public class MonitorFanIndicatorImpl implements IMonitorFanIndicator {
temporaryData.setCreatedTime(time.split(" ")[1]);
temporaryData.setEquipmentIndexName(indicatorsDto.getEquipmentIndexName());
temporaryData.setGatewayId(indicatorsDto.getGatewayId());
temporaryData.setValue(indicatorsDto.getValueDouble());
temporaryData.setValue(indicatorsDto.getValueF());
temporaryData.setEquipmentNumber(indicatorsDto.getEquipmentNumber());
temporaryDatass.add(temporaryData);
} catch (Exception e) {
......@@ -902,7 +896,7 @@ public class MonitorFanIndicatorImpl implements IMonitorFanIndicator {
for (ESEquipments listDatum : listData) {
for (ESEquipments indicatorsDto : listData1) {
if (listDatum.getEquipmentNumber().equals(indicatorsDto.getEquipmentNumber())) {
listDatum.setValueLabel(String.valueOf(indicatorsDto.getValueDouble()/1000));
listDatum.setValueLabel(String.valueOf(indicatorsDto.getValueF()/1000));
}
}
......@@ -912,7 +906,7 @@ public class MonitorFanIndicatorImpl implements IMonitorFanIndicator {
map.put("title", prefix + listDatum.getEquipmentNumber());
//用于参数传递
map.put("title1", listDatum.getEquipmentNumber());
map.put("windSpeed", listDatum.getValueDouble());
map.put("windSpeed", listDatum.getValueF());
map.put("power", listDatum.getValueLabel());
//获取风机状态如果获取到的状态为空-则默认为正常运行状态
String fantStatus = ObjectUtils.isEmpty(fanstatutsHashMap.get(listDatum.getEquipmentNumber())) ? "通讯中断" : fanstatutsHashMap.get(listDatum.getEquipmentNumber());
......@@ -1045,7 +1039,7 @@ public class MonitorFanIndicatorImpl implements IMonitorFanIndicator {
HashMap<String, String> stringStringHashMap = new HashMap<>();
stringStringHashMap.put("name", stringListEntry.getKey());
for (ESEquipments indicatorsDto : stringListEntry.getValue()) {
stringStringHashMap.put(ElectricQuantity.getCode(indicatorsDto.getDisplayName()), String.format("%.3f", ObjectUtils.isEmpty(indicatorsDto.getValueDouble()) ? 0.0 : indicatorsDto.getValueDouble()));
stringStringHashMap.put(ElectricQuantity.getCode(indicatorsDto.getDisplayName()), String.format("%.3f", ObjectUtils.isEmpty(indicatorsDto.getValueF()) ? 0.0 : indicatorsDto.getValueF()));
}
if (stringListEntry.getKey().contains("SVG")){
resultList1.add(stringStringHashMap);
......@@ -1153,9 +1147,9 @@ public class MonitorFanIndicatorImpl implements IMonitorFanIndicator {
HashMap<String, Object> resultMap = new HashMap<>();
xianData.forEach(item -> {
if ("220kVⅠ母PT".equals(item.getFrontModule())) {
resultMap.put("220" + item.getDisplayName(), keepTwoDecimalPlaces(item.getValueDouble().toString()));
resultMap.put("220" + item.getDisplayName(), keepTwoDecimalPlaces(item.getValueF().toString()));
} else if ("35kVⅠ母PT".equals(item.getFrontModule())) {
resultMap.put("35" + item.getDisplayName(), keepTwoDecimalPlaces(item.getValueDouble().toString()));
resultMap.put("35" + item.getDisplayName(), keepTwoDecimalPlaces(item.getValueF().toString()));
}
});
List<String> xyxDisplayNameList = Arrays.asList("Ia", "P", "Q", "Ux");
......@@ -1165,9 +1159,9 @@ public class MonitorFanIndicatorImpl implements IMonitorFanIndicator {
// 正向总有功正向总无功需要计算
dlbjSqlData.forEach(item -> {
if ("正向总有功".equals(item.getDisplayName())) {
resultMap.put("2000S1", keepTwoDecimalPlaces(String.valueOf((Double.parseDouble(item.getValueDouble().toString()) / 1000))));
resultMap.put("2000S1", keepTwoDecimalPlaces(String.valueOf((Double.parseDouble(item.getValueF().toString()) / 1000))));
} else if ("正向总无功".equals(item.getDisplayName())) {
resultMap.put("2000S2", keepTwoDecimalPlaces(String.valueOf((Double.parseDouble(item.getValueDouble().toString()) / 1000))));
resultMap.put("2000S2", keepTwoDecimalPlaces(String.valueOf((Double.parseDouble(item.getValueF().toString()) / 1000))));
}
});
......@@ -1179,13 +1173,13 @@ public class MonitorFanIndicatorImpl implements IMonitorFanIndicator {
resultMap.put("value4", "0.0");
zb1SqlData.forEach(item -> {
if ("档位".equals(item.getDisplayName())) {
resultMap.put("value4", ObjectUtils.isEmpty(item.getValueDouble().toString()) ? "0" : String.format("%.0f", Double.parseDouble(item.getValueDouble().toString())));
resultMap.put("value4", ObjectUtils.isEmpty(item.getValueF().toString()) ? "0" : String.format("%.0f", Double.parseDouble(item.getValueF().toString())));
} else if ("油面温1".equals(item.getDisplayName())) {
resultMap.put("value1", ObjectUtils.isEmpty(item.getValueDouble().toString()) ? "0.0" : String.format("%.1f", Double.parseDouble(item.getValueDouble().toString())));
resultMap.put("value1", ObjectUtils.isEmpty(item.getValueF().toString()) ? "0.0" : String.format("%.1f", Double.parseDouble(item.getValueF().toString())));
} else if ("油面温2".equals(item.getDisplayName())) {
resultMap.put("value2", ObjectUtils.isEmpty(item.getValueDouble().toString()) ? "0.0" : String.format("%.1f", Double.parseDouble(item.getValueDouble().toString())));
resultMap.put("value2", ObjectUtils.isEmpty(item.getValueF().toString()) ? "0.0" : String.format("%.1f", Double.parseDouble(item.getValueF().toString())));
} else if ("绕组温度".equals(item.getDisplayName())) {
resultMap.put("value3", ObjectUtils.isEmpty(item.getValueDouble().toString()) ? "0.0" : String.format("%.1f", Double.parseDouble(item.getValueDouble().toString())));
resultMap.put("value3", ObjectUtils.isEmpty(item.getValueF().toString()) ? "0.0" : String.format("%.1f", Double.parseDouble(item.getValueF().toString())));
}
});
......@@ -1221,13 +1215,13 @@ public class MonitorFanIndicatorImpl implements IMonitorFanIndicator {
stringStringHashMap.put("value3", "0.0");
listData.forEach(item -> {
if (item.getDisplayName().equals("Ia")) {
stringStringHashMap.put("value1", keepTwoDecimalPlaces(item.getValueDouble().toString()));
stringStringHashMap.put("value1", keepTwoDecimalPlaces(item.getValueF().toString()));
}
if (item.getDisplayName().equals("P")) {
stringStringHashMap.put("value2", keepTwoDecimalPlaces(item.getValueDouble().toString()));
stringStringHashMap.put("value2", keepTwoDecimalPlaces(item.getValueF().toString()));
}
if (item.getDisplayName().equals("Q")) {
stringStringHashMap.put("value3", keepTwoDecimalPlaces(item.getValueDouble().toString()));
stringStringHashMap.put("value3", keepTwoDecimalPlaces(item.getValueF().toString()));
}
});
resultList.add(stringStringHashMap);
......@@ -1266,11 +1260,11 @@ public class MonitorFanIndicatorImpl implements IMonitorFanIndicator {
// 10kVⅡ段母线数据
List<ESEquipments> xianData = esEquipmentsList.stream().filter(esEquipments -> esEquipments.getFrontModule().contains("35kVⅠ母PT")).collect(Collectors.toList());
HashMap<String, Object> resultMap = new HashMap<>();
xianData.forEach(item -> resultMap.put(item.getDisplayName(), keepTwoDecimalPlaces(item.getValueDouble().toString())));
xianData.forEach(item -> resultMap.put(item.getDisplayName(), keepTwoDecimalPlaces(item.getValueF().toString())));
List<String> xyxDisplayNameList = Arrays.asList("Ia", "P", "Q");
List<ESEquipments> xyxSqlData = esEquipmentsList.stream().filter(esEquipments -> esEquipments.getFrontModule().equals("35kV前万线") && xyxDisplayNameList.contains(esEquipments.getDisplayName())).collect(Collectors.toList());
xyxSqlData.forEach(item -> resultMap.put("35qwx" + item.getDisplayName(), keepTwoDecimalPlaces(item.getValueDouble().toString())));
xyxSqlData.forEach(item -> resultMap.put("35qwx" + item.getDisplayName(), keepTwoDecimalPlaces(item.getValueF().toString())));
// 主线路图上各个路线名称
resultMap.put("35qwx", "35kV前万线");
......@@ -1299,13 +1293,13 @@ public class MonitorFanIndicatorImpl implements IMonitorFanIndicator {
stringStringHashMap.put("value3", "0.0");
listData.forEach(item -> {
if (item.getDisplayName().equals("Ia")) {
stringStringHashMap.put("value1", keepTwoDecimalPlaces(item.getValueDouble().toString()));
stringStringHashMap.put("value1", keepTwoDecimalPlaces(item.getValueF().toString()));
}
if (item.getDisplayName().equals("P")) {
stringStringHashMap.put("value2", keepTwoDecimalPlaces(item.getValueDouble().toString()));
stringStringHashMap.put("value2", keepTwoDecimalPlaces(item.getValueF().toString()));
}
if (item.getDisplayName().equals("Q")) {
stringStringHashMap.put("value3", keepTwoDecimalPlaces(item.getValueDouble().toString()));
stringStringHashMap.put("value3", keepTwoDecimalPlaces(item.getValueF().toString()));
}
});
resultList.add(stringStringHashMap);
......@@ -1504,7 +1498,7 @@ public class MonitorFanIndicatorImpl implements IMonitorFanIndicator {
queryCondtion.put(CommonConstans.QueryStringEquipmentIndexName, Arrays.asList("220kV夏雩线212线路测控装置PCS-9705TA有功功率一次值", "南瑞光差保护_313P"));
queryCondtion.put(CommonConstans.QueryStringGateWayId, Arrays.asList(stationCacheInfoDto.getBoosterGatewayId()));
List<ESEquipments> listData = commonServiceImpl.getListDataByCondtions(queryCondtion, null, ESEquipments.class);
String load = String.format(CommonConstans.Twodecimalplaces, Double.parseDouble(String.valueOf(listData.get(0).getValueDouble())) / Double.parseDouble(stationCacheInfoDto.getInstalledCapacity()));
String load = String.format(CommonConstans.Twodecimalplaces, Double.parseDouble(String.valueOf(listData.get(0).getValueF())) / Double.parseDouble(stationCacheInfoDto.getInstalledCapacity()));
List<Map<String, Object>> list = temporaryDataMapper.timingTemporarysSorageDataByIndexName(gatewayId,equipmentIndexName);
......@@ -1588,7 +1582,7 @@ public class MonitorFanIndicatorImpl implements IMonitorFanIndicator {
queryCondtion.put(CommonConstans.QueryStringEquipmentIndexName, Arrays.asList(equipmentIndexName));
List<ESEquipments> list = commonServiceImpl.getListDataByCondtions(queryCondtion, null, ESEquipments.class);
if (!ValidationUtil.isEmpty(list)) {
resultMap.put("value", String.format(CommonConstans.Twodecimalplaces, Double.parseDouble(list.get(0).getValueDouble().toString())));
resultMap.put("value", String.format(CommonConstans.Twodecimalplaces, Double.parseDouble(list.get(0).getValueF().toString())));
}
return resultMap;
}
......@@ -1658,7 +1652,7 @@ public class MonitorFanIndicatorImpl implements IMonitorFanIndicator {
List<ESEquipments> indicatorsDtos = collect.get(s);
HashMap<String, Object> resultMap = new HashMap<>();
Double avageValue = 0.0;
avageValue = indicatorsDtos.stream().filter(e -> !ObjectUtils.isEmpty(e.getValueDouble())).mapToDouble(l -> Double.parseDouble(l.getValueDouble().toString())).average().getAsDouble();
avageValue = indicatorsDtos.stream().filter(e -> !ObjectUtils.isEmpty(e.getValueF())).mapToDouble(l -> Double.parseDouble(l.getValueF().toString())).average().getAsDouble();
avageValue = Double.valueOf(String.format(CommonConstans.Twodecimalplaces, avageValue));
resultMap.put("avg", avageValue);
String[] name = s.split("-");
......@@ -1670,10 +1664,10 @@ public class MonitorFanIndicatorImpl implements IMonitorFanIndicator {
List<ESEquipments> dtos = list1.stream().filter(e -> e.getEquipmentNumber().equals(s)).collect(Collectors.toList());
if (!ValidationUtil.isEmpty(dtos)) {
for (ESEquipments esEquipments : indicatorsDtos) {
lsv = lsv + Math.pow(esEquipments.getValueDouble() - dtos.get(0).getValueDouble(), 2);
lsv = lsv + Math.pow(esEquipments.getValueF() - dtos.get(0).getValueF(), 2);
}
}
lsv = Math.sqrt(lsv) / dtos.get(0).getValueDouble();
lsv = Math.sqrt(lsv) / dtos.get(0).getValueF();
}
......@@ -1712,20 +1706,20 @@ public class MonitorFanIndicatorImpl implements IMonitorFanIndicator {
indicatorsDtos.forEach(e -> {
switch (e.getEquipmentIndexName()) {
case "总直流功率":
map.put("sr", keepTwoDecimalPlaces(e.getValueDouble().toString()));
map.put("sr", keepTwoDecimalPlaces(e.getValueF().toString()));
break;
case "有功功率":
map.put("sc", keepTwoDecimalPlaces(e.getValueDouble().toString()));
map.put("sc", keepTwoDecimalPlaces(e.getValueF().toString()));
break;
case "逆变器效率":
map.put("efficiency", keepTwoDecimalPlaces(e.getValueDouble().toString()));
map.put("efficiency", keepTwoDecimalPlaces(e.getValueF().toString()));
break;
case "日发电量":
double v = Double.parseDouble(e.getValueDouble().toString()) * CommonConstans.pvGenPoweActor;
double v = Double.parseDouble(e.getValueF().toString()) * CommonConstans.pvGenPoweActor;
map.put("dayNum", keepTwoDecimalPlaces(String.valueOf(v)));
break;
case "总发电量":
double a = Double.parseDouble(e.getValueDouble().toString()) * CommonConstans.pvGenPoweActor;
double a = Double.parseDouble(e.getValueF().toString()) * CommonConstans.pvGenPoweActor;
map.put("yearNum", keepTwoDecimalPlaces(String.valueOf(a)));
break;
}
......@@ -1795,7 +1789,7 @@ public class MonitorFanIndicatorImpl implements IMonitorFanIndicator {
for (ESEquipments listDatum : listData) {
for (ESEquipments esEquipments : listData1) {
if (esEquipments.getEquipmentNumber().equals(listDatum.getEquipmentNumber())) {
esEquipments.setValueLabel(listDatum.getValueDouble().toString());
esEquipments.setValueLabel(listDatum.getValueF().toString());
}
}
}
......@@ -1810,7 +1804,7 @@ public class MonitorFanIndicatorImpl implements IMonitorFanIndicator {
String number = equipNum.substring(equipNum.length() - 1);
map.put("titie", String.valueOf(num));
map.put("titie" + number, equipNum);
map.put("value" + number, String.format(CommonConstans.Twodecimalplaces, esEquipments.getValueDouble()));
map.put("value" + number, String.format(CommonConstans.Twodecimalplaces, esEquipments.getValueF()));
map.put("valueLabel" + number, String.format(CommonConstans.Twodecimalplaces, Double.parseDouble(esEquipments.getValueLabel())));
map.put("state" + number, equipStatesMap.get(esEquipments.getEquipmentNumber()));
maps.add(map);
......
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