Commit 4e62e172 authored by chenzhao's avatar chenzhao

Merge branch 'developer' of http://39.98.45.134:8090/moa/amos-boot-biz into developer

parents 661e74c0 ef6a4ab0
......@@ -994,7 +994,7 @@ public class MonitorFanIndicatorImpl implements IMonitorFanIndicator {
stringStringHashMap.put("wind", item.getValue());
stringStringHashMap.put("power", powerSqlMap.get(item.getEquipmentNumber()));
stringStringHashMap.put("windSpeed", windSpeedSqlMap.get(item.getEquipmentNumber()));
stringStringHashMap.put("electricity", electricitySqlMap.get(item.getEquipmentNumber()));
stringStringHashMap.put("electricity", String.format("%.4f",Double.valueOf(electricitySqlMap.get(item.getEquipmentNumber()))));
resultList.add(stringStringHashMap);
});
//构建平台数据
......
......@@ -16,6 +16,7 @@ import com.yeejoin.amos.boot.module.jxiop.biz.dto.IndicatorsDto;
import com.yeejoin.amos.boot.module.jxiop.biz.dto.ResultsData;
import com.yeejoin.amos.boot.module.jxiop.biz.service.impl.CommonServiceImpl;
import com.yeejoin.amos.boot.module.jxiop.biz.service.impl.MonitorFanIndicatorImpl;
import com.yeejoin.amos.component.influxdb.InfluxdbUtil;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.eclipse.paho.client.mqttv3.MqttException;
......@@ -66,7 +67,8 @@ public class MonitorFanIdxController extends BaseController {
@Autowired
EmqKeeper emqKeeper;
@Autowired
InfluxdbUtil influxdbUtil;
@TycloudOperation(needAuth = false, ApiLevel = UserType.AGENCY)
@ApiOperation(value = "根据设备编号、场站id、前段展示模块、系统类型查询表数据")
@GetMapping("/getFanIdxInfoByPage")
......@@ -579,18 +581,19 @@ public class MonitorFanIdxController extends BaseController {
String [] columnLists = new String[]{"有功功率"};
String [] syLists = new String[]{"总辐射累计","总辐射"};
Map<String, Object> columnMap = new HashMap<>();
//日 月 年发电量同仅统计逆变器数据
List<Map<String, Object>> mapList;
mapList = influxdbUtil.query("SELECT * FROM indicators_" + stationBasic.getFanGatewayId() + " where frontModule=~/逆变器/ and(equipmentIndexName='日发电量' or equipmentIndexName='月发电量' or equipmentIndexName='年发电量' or equipmentIndexName='有功功率')");
//日-月-年-发电量需要保留四位小数问题修改
for (String column : columnList) {
Double result = commonService.getTotalByIndicatior(gatewayId, column);
columnMap.put(column, String.format("%.2f",result));
Double result = commonService.getTotalByIndicatior(mapList, column);
columnMap.put(column, String.format("%.4f",result));
}
for (String column : syLists) {
Double result = commonService.getNumByIndicatior(boosterGatewayId, column);
columnMap.put(column, String.format("%.2f",result));
}
for (String column : columnLists) {
Double result = commonService.getAvgvalueByIndicatior(gatewayId, column);
columnMap.put(column, String.format("%.2f",result));
......@@ -600,7 +603,8 @@ public class MonitorFanIdxController extends BaseController {
columnMap.put("风机台数",num);
Double capacityl = commonService.getStationCapactityByStationWerks(stationBasic.getStationNumber());
columnMap.put("装机容量",capacityl);
//装机容量保留两位小数
columnMap.put("装机容量",String.format("%.2f",capacityl));
......
......@@ -3,6 +3,7 @@ package com.yeejoin.amos.boot.module.jxiop.biz.dto;
import com.baomidou.mybatisplus.annotation.TableField;
import lombok.Data;
import lombok.experimental.Accessors;
import org.springframework.util.ObjectUtils;
import java.util.Date;
@Data
......
......@@ -78,7 +78,7 @@ public class CommonServiceImpl {
public Double getTotalByIndicatior(List<Map<String,Object>> mapList,String indicator){
Double totalvalue = 0.0;
totalvalue =mapList.stream().filter(stringObjectMap ->stringObjectMap.get("equipmentIndexName").toString().contains(indicator)&&!ObjectUtils.isEmpty(stringObjectMap.get("value"))).mapToDouble(l->Double.parseDouble((String) l.get("value"))).sum();
return Double.valueOf(String.format("%.2f",totalvalue));
return Double.valueOf(String.format("%.4f",totalvalue));
}
/**
* @deprecated 获取指标值平均值
......
......@@ -994,7 +994,7 @@ public class MonitorFanIndicatorImpl implements IMonitorFanIndicator {
stringStringHashMap.put("wind", item.getValue());
stringStringHashMap.put("power", powerSqlMap.get(item.getEquipmentNumber()));
stringStringHashMap.put("windSpeed", windSpeedSqlMap.get(item.getEquipmentNumber()));
stringStringHashMap.put("electricity", electricitySqlMap.get(item.getEquipmentNumber()));
stringStringHashMap.put("electricity", String.format("%.4f",Double.valueOf(electricitySqlMap.get(item.getEquipmentNumber()))));
resultList.add(stringStringHashMap);
});
//构建平台数据
......@@ -1016,7 +1016,7 @@ public class MonitorFanIndicatorImpl implements IMonitorFanIndicator {
List<AlarmEventDto> alarmEventList = alarmEventMapper.getAlarmEventList(null, stationId,current,size);
List<AlarmEventDto> sorrtedAlarmEventList = alarmEventList.stream().sorted(Comparator.comparing(AlarmEventDto::getCreatedTime).reversed()).collect(Collectors.toList());
ArrayList<Map<String, String>> resultList = new ArrayList<>();
alarmEventList.forEach(item -> {
HashMap<String, String> stringStringHashMap = new HashMap<>();
......@@ -1050,7 +1050,7 @@ public class MonitorFanIndicatorImpl implements IMonitorFanIndicator {
HashMap<String, String> stringStringHashMap = new HashMap<>();
stringStringHashMap.put("name", stringListEntry.getKey());
for (IndicatorsDto indicatorsDto : stringListEntry.getValue()) {
stringStringHashMap.put(ElectricQuantity.getCode(indicatorsDto.getDisplayName()), String.format("%.2f",ObjectUtils.isEmpty(indicatorsDto.getValue())?0.0:Double.parseDouble(indicatorsDto.getValue())));
stringStringHashMap.put(ElectricQuantity.getCode(indicatorsDto.getDisplayName()), String.format("%.3f",ObjectUtils.isEmpty(indicatorsDto.getValue())?0.0:Double.parseDouble(indicatorsDto.getValue())));
}
resultList.add(stringStringHashMap);
}
......
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