Commit 5b582b00 authored by caotao's avatar caotao

新增离散率数据接口

parent 9d2e04a8
...@@ -14,6 +14,7 @@ import com.yeejoin.amos.boot.module.jxiop.api.entity.StationBasic; ...@@ -14,6 +14,7 @@ import com.yeejoin.amos.boot.module.jxiop.api.entity.StationBasic;
import com.yeejoin.amos.boot.module.jxiop.api.mapper.MonitorFanIndicatorMapper; import com.yeejoin.amos.boot.module.jxiop.api.mapper.MonitorFanIndicatorMapper;
import com.yeejoin.amos.boot.module.jxiop.api.mapper.StationBasicMapper; import com.yeejoin.amos.boot.module.jxiop.api.mapper.StationBasicMapper;
import com.yeejoin.amos.boot.module.jxiop.biz.constants.CommonConstans; import com.yeejoin.amos.boot.module.jxiop.biz.constants.CommonConstans;
import com.yeejoin.amos.boot.module.jxiop.biz.dto.DeaviationRateDto;
import com.yeejoin.amos.boot.module.jxiop.biz.dto.ResultsData; 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.CommonServiceImpl;
import com.yeejoin.amos.boot.module.jxiop.biz.service.impl.MonitorFanIndicatorImpl; import com.yeejoin.amos.boot.module.jxiop.biz.service.impl.MonitorFanIndicatorImpl;
...@@ -736,6 +737,12 @@ public class MonitorFanIdxController extends BaseController { ...@@ -736,6 +737,12 @@ public class MonitorFanIdxController extends BaseController {
String gatewayId = stationBasic.getFanGatewayId(); String gatewayId = stationBasic.getFanGatewayId();
return ResponseHelper.buildResponse(monitorFanIndicatorImpl.collectingBox(gatewayId,current, size )); return ResponseHelper.buildResponse(monitorFanIndicatorImpl.collectingBox(gatewayId,current, size ));
} }
@TycloudOperation(needAuth = false, ApiLevel = UserType.AGENCY)
@ApiOperation(value = "汇流箱支路电流偏差率")
@GetMapping("/getDeaviAtionRate")
public ResponseModel<Page<DeaviationRateDto>> getDeaviAtionRate(@RequestParam(value = "stationId") String stationId, String equipNumber) {
return ResponseHelper.buildResponse(monitorFanIndicatorImpl.getDeaviAtionRate(stationId,equipNumber ));
}
@TycloudOperation(needAuth = false, ApiLevel = UserType.AGENCY) @TycloudOperation(needAuth = false, ApiLevel = UserType.AGENCY)
......
package com.yeejoin.amos.boot.module.jxiop.biz.dto;
import lombok.Data;
//偏差率Dto
@Data
public class DeaviationRateDto {
private String name;
private String currentValue;
private String offset;
private String attValue;
}
...@@ -1507,7 +1507,6 @@ public class MonitorFanIndicatorImpl implements IMonitorFanIndicator { ...@@ -1507,7 +1507,6 @@ public class MonitorFanIndicatorImpl implements IMonitorFanIndicator {
} }
return statusMaps; return statusMaps;
} }
public String keepTwoDecimalPlaces(String value) { public String keepTwoDecimalPlaces(String value) {
String s = "0.00"; String s = "0.00";
if (!ObjectUtils.isEmpty(value)) { if (!ObjectUtils.isEmpty(value)) {
...@@ -1623,6 +1622,7 @@ public class MonitorFanIndicatorImpl implements IMonitorFanIndicator { ...@@ -1623,6 +1622,7 @@ public class MonitorFanIndicatorImpl implements IMonitorFanIndicator {
} }
public List<Map<String, Object>> solarPowerOperation(String gatewayId) { public List<Map<String, Object>> solarPowerOperation(String gatewayId) {
String sql = "SELECT * FROM indicators_" + gatewayId + " WHERE equipmentIndexName = '有功功率' or equipmentIndexName = '逆变器效率' or equipmentIndexName ='总直流功率' or equipmentIndexName ='日发电量' or equipmentIndexName ='总发电量' "; String sql = "SELECT * FROM indicators_" + gatewayId + " WHERE equipmentIndexName = '有功功率' or equipmentIndexName = '逆变器效率' or equipmentIndexName ='总直流功率' or equipmentIndexName ='日发电量' or equipmentIndexName ='总发电量' ";
List<IndicatorsDto> list = influxDButils.getListData(sql, IndicatorsDto.class); List<IndicatorsDto> list = influxDButils.getListData(sql, IndicatorsDto.class);
...@@ -1966,5 +1966,23 @@ public class MonitorFanIndicatorImpl implements IMonitorFanIndicator { ...@@ -1966,5 +1966,23 @@ public class MonitorFanIndicatorImpl implements IMonitorFanIndicator {
return hashMap; return hashMap;
} }
public Page<DeaviationRateDto> getDeaviAtionRate(String stationId, String equipNumber) {
StationCacheInfoDto stationCacheInfoDto = commonServiceImpl.getStationCacheInfoDtoByStationId(stationId);
Page<DeaviationRateDto> deaviationRateDtoPage = new Page<>(1,100);
List<DeaviationRateDto> deaviationRateDtoList =new ArrayList<>();
String sql = "SELECT * FROM indicators_" + stationCacheInfoDto.getFanGatewayId() + " WHERE equipmentIndexName =~/路电流/ and and equipmentNumber ='+" + equipNumber+"'";
List<IndicatorsDto> indicatorsDtoList = influxDButils.getListData(sql,IndicatorsDto.class);
Random random = new Random();
indicatorsDtoList.forEach(indicatorsDto -> {
DeaviationRateDto deaviationRateDto = new DeaviationRateDto();
deaviationRateDto.setName(indicatorsDto.getEquipmentIndexName());
deaviationRateDto.setCurrentValue(indicatorsDto.getValue());
deaviationRateDto.setOffset(String.valueOf(random.nextDouble()));
deaviationRateDto.setAttValue(String.valueOf(random.nextDouble()));
deaviationRateDtoList.add(deaviationRateDto);
});
deaviationRateDtoPage.setRecords(deaviationRateDtoList);
return deaviationRateDtoPage;
}
} }
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