Commit d68bbb88 authored by tangwei's avatar tangwei

解决冲突

parents 753df955 f8215b2e
......@@ -621,7 +621,7 @@ public class MonitorFanIdxController extends BaseController {
for (String column : columnList) {
Double result = commonServiceImpl.getTotalByIndicatior(gatewayId, column);
columnMap.put(column, String.format("%.2f",result));
columnMap.put(column, String.format("%.4f",result * CommonConstans.pvGenPoweActor));
}
for (String column : syLists) {
Double result = commonServiceImpl.getNumByIndicatior(boosterGatewayId, column);
......@@ -898,7 +898,7 @@ public class MonitorFanIdxController extends BaseController {
monthDataFJ.add(monthMap);
yearDataFJ.add(yearMap);
} else {
querySql = " and frontModule = '逆变器'";
querySql = " and frontModule =~/逆变器/";
Map<String, Object> map = monitorFanIndicator.generatingCapacity(gatewayId,querySql);
Map<String, Object> dayMap = new HashMap<>();
Map<String, Object> monthMap = new HashMap<>();
......@@ -991,10 +991,12 @@ public class MonitorFanIdxController extends BaseController {
@TycloudOperation(needAuth = false, ApiLevel = UserType.AGENCY)
@ApiOperation(value = "设备发电量 ")
@GetMapping("/equipGeneratingCapacity")
public ResponseModel<ResultsData> equipGeneratingCapacity(@RequestParam(value = "current") int current,
public ResponseModel<IPage<Map<String,Object>>> equipGeneratingCapacity(@RequestParam(value = "current") int current,
@RequestParam(value = "size") int size,
@RequestParam(value = "stationId") String stationId) {
Page<ESEquipments> result = new Page<ESEquipments>(current, size);
StationBasic stationBasic = stationBasicMapper.selectById(stationId);
String gatewayId = stationBasic.getFanGatewayId();
BoolQueryBuilder boolMustAll = QueryBuilders.boolQuery();
//警情状态
......@@ -1002,7 +1004,12 @@ public class MonitorFanIdxController extends BaseController {
String[] keys = new String[] {"日发电量","月发电量","年发电量"};
List<String> list = Arrays.asList(keys);
BoolQueryBuilder boolQueryBuilder = QueryBuilders.boolQuery();
boolQueryBuilder.must((QueryBuilders.termsQuery("equipmentIndexName.keyword", list))).must(QueryBuilders.matchQuery("gatewayId.keyword","1668801435891929089"));
if (!stationBasic.getStationType().equals("FDZ")){
boolQueryBuilder.must((QueryBuilders.termsQuery("equipmentIndexName.keyword", list))).must(QueryBuilders.matchQuery("gatewayId.keyword",gatewayId)).must(QueryBuilders.matchQuery("frontModule","逆变器"));
}else {
boolQueryBuilder.must((QueryBuilders.termsQuery("equipmentIndexName.keyword", list))).must(QueryBuilders.matchQuery("gatewayId.keyword",gatewayId));
}
should.add(boolQueryBuilder);
// 创建查询构造器
......@@ -1035,30 +1042,43 @@ public class MonitorFanIdxController extends BaseController {
Map<String,Object> map = new HashMap<>();
map.put("name",key);
for (ESEquipments equip : resultMap.get(key)) {
switch(equip.getEquipmentIndexName()){
if (!stationBasic.getStationType().equals("FDZ")){
float value = equip.getValueDouble();
float v = CommonConstans.pvGenPoweActor.floatValue();
equip.setValueDouble(value * v);
}
String value = String.format("%.4f", equip.getValueDouble());
switch(equip.getEquipmentIndexName()){
case "日发电量":
map.put("dayNum",equip.getValueDouble());
map.put("dayNum",value);
break;
case "月发电量":
map.put("monthNum",equip.getValueDouble());
map.put("monthNum",value);
break;
case "年发电量":
map.put("yearNum",equip.getValueDouble());
map.put("yearNum",value);
break;
}
}
esEquipmentsMap.add(map);
}
//构建平台数据
DataGridMock DataGridMock = new DataGridMock(current, esEquipmentsMap.size(), false, current, esEquipmentsMap);
ColModel colModelEquipmentNumber = new ColModel("name", "name", "设备名称", "设备名称", "dataGrid", "name");
ColModel colModelPower = new ColModel("dayNum", "dayNum", "日发电量", "日发电量", "dataGrid", "dayNum");
ColModel colModelWindSpeed = new ColModel("monthNum", "monthNum", "月发电量", "月发电量", "dataGrid", "monthNum");
ColModel colModelWind = new ColModel("yearNum", "yearNum", "年发电量", "年发电量", "dataGrid", "yearNum");
List<ColModel> listColModel = Arrays.asList(colModelEquipmentNumber, colModelPower, colModelWindSpeed, colModelWind);
ResultsData resultsData = new ResultsData(DataGridMock, listColModel);
return ResponseHelper.buildResponse(resultsData);
IPage<Map<String,Object>> page = new Page<>();
page.setTotal(esEquipmentsMap.size());
page.setSize(999);
page.setCurrent(1);
page.setRecords(esEquipmentsMap);
return ResponseHelper.buildResponse(page);
// //构建平台数据
// DataGridMock DataGridMock = new DataGridMock(current, esEquipmentsMap.size(), false, current, esEquipmentsMap);
// ColModel colModelEquipmentNumber = new ColModel("name", "name", "设备名称", "设备名称", "dataGrid", "name");
// ColModel colModelPower = new ColModel("dayNum", "dayNum", "日发电量", "日发电量", "dataGrid", "dayNum");
// ColModel colModelWindSpeed = new ColModel("monthNum", "monthNum", "月发电量", "月发电量", "dataGrid", "monthNum");
// ColModel colModelWind = new ColModel("yearNum", "yearNum", "年发电量", "年发电量", "dataGrid", "yearNum");
// List<ColModel> listColModel = Arrays.asList(colModelEquipmentNumber, colModelPower, colModelWindSpeed, colModelWind);
// ResultsData resultsData = new ResultsData(DataGridMock, listColModel);
// return ResponseHelper.buildResponse(resultsData);
}
......@@ -1117,7 +1137,7 @@ public class MonitorFanIdxController extends BaseController {
}
@TycloudOperation(needAuth = false, ApiLevel = UserType.AGENCY)
@Scheduled(cron = "0 0/10 * * * ? ")
@Scheduled(cron = "0/30 * * * * ? ")
@ApiOperation(value = "接入情况 ")
@GetMapping("/accessSituation")
public ResponseModel<Map<String,Object>> accessSituation(){
......@@ -1137,11 +1157,11 @@ public class MonitorFanIdxController extends BaseController {
} catch (MqttException e) {
}
return ResponseHelper.buildResponse(map);
return CommonResponseUtil.success();
}
@TycloudOperation(needAuth = false, ApiLevel = UserType.AGENCY)
@Scheduled(cron = "0 0/10 * * * ? ")
@Scheduled(cron = "0/30 * * * * ? ")
@ApiOperation(value = "区域接入情况 ")
@GetMapping("/qyAccessSituation")
public ResponseModel<Map<String,Object>> qyAccessSituation(){
......@@ -1165,8 +1185,50 @@ public class MonitorFanIdxController extends BaseController {
}
}
return ResponseHelper.buildResponse(map);
return CommonResponseUtil.success();
}
@TycloudOperation(needAuth = false, ApiLevel = UserType.AGENCY)
@ApiOperation(value = "健康运行百分比 ")
@GetMapping("/getFanStatusByZC")
public ResponseModel<Map<String,Object>> getFanStatusByZC(@RequestParam(value = "stationId", required = false) String stationId
) {
List<IndexDto> fanStatusList = monitorFanIndicator.getFanStatusStatistics(stationId);
int healthNum = 0;
int sum = 0;
for (IndexDto indexDto : fanStatusList) {
if (indexDto.getEquipmentIndexName().equals("正常运行")){
healthNum = Integer.parseInt(indexDto.getCountString());
}
sum += Integer.parseInt(indexDto.getCountString());
}
Map<String, Object> hashMap = new HashMap<>() ;
double percent = (double) healthNum / sum * 100;
int value = (int) percent;
String[] values = new String[]{String.valueOf(value)};
hashMap.put("seriesData",values);
hashMap.put("title",healthNum+"/"+sum);
return ResponseHelper.buildResponse(hashMap);
}
@TycloudOperation(needAuth = false, ApiLevel = UserType.AGENCY)
@ApiOperation(value = "单个风机状态")
@GetMapping("/getFanStatusByEquipNum")
public ResponseModel<Map<String,Object>> getFanStatusList(@RequestParam(value = "stationId", required = false) String stationId,
@RequestParam(value="equip")String equipNum) {
List<IndexDto> fanStatusList = monitorFanIndicator.getFanStatusList(stationId);
Map<String, Object> hashMap = new HashMap<>() ;
String status = "";
for (IndexDto indexDto : fanStatusList) {
if (indexDto.getEquipmentNumber().equals(equipNum)){
status =indexDto.getState();
}
}
hashMap.put("title",status);
return ResponseHelper.buildResponse(hashMap);
}
}
/*
package com.yeejoin.amos.boot.module.jxiop.biz.service.impl;
import com.alibaba.fastjson.JSON;
......@@ -50,9 +51,11 @@ public class MonitoringServiceIMQTTmpl {
private final String fanCurrentDataCron = "0 0/1 * * * *";
@Value("${fan.statuts.stattuspath}")
private String fanStatusImagePathPrefix;
/**
*/
/**
* 场站mapper
*/
*//*
@Autowired
StationBasicMapper stationBasicMapper;
......@@ -74,9 +77,11 @@ public class MonitoringServiceIMQTTmpl {
private MonitorFanIndicatorMapper monitorFanIndicatorregionMapper;
/**
*/
/**
* 社会贡献定时消息发送 1分钟推送一次
*/
*//*
@Scheduled(cron = totalSocialContributionCron)
public void getTotalSocialContribution() {
Page<SocialContributionDto> socialContributionDtoPage = new Page<SocialContributionDto>();
......@@ -97,12 +102,14 @@ public class MonitoringServiceIMQTTmpl {
SocialContributionDto toner = new SocialContributionDto();
//二氧化硫贡献度
SocialContributionDto so2 = new SocialContributionDto();
/** 社会贡献原始计算公式,后边的数据已经经过处理
*/
/** 社会贡献原始计算公式,后边的数据已经经过处理
//二氧化碳计算公式 *10000*832/10000/1000/1000
//标准煤计算公式 *10000*304.9/10000/1000/1000
//碳粉尘计算公式 *10000*0.032/1000/1000
//二氧化硫计算公式 =A2*10000*0.16/1000/1000
*/
*//*
co2.setUnit("二氧化碳减排量(万t)");
co2.setTitle(String.format("%.2f",totalSocialContribution.get() * 0.000832));
socialContributionDtoList.add(co2);
......@@ -126,9 +133,11 @@ public class MonitoringServiceIMQTTmpl {
}
}
/**
*/
/**
* 区域实时数据消息推送-30s一次
*/
*//*
// @Scheduled(cron = completionOfPowerIndicatorsByProvinceNameCron)
public void getCompletionOfPowerIndicatorsByProvinceName() {
Page<SocialContributionDto> socialContributionDtoPage = new Page<SocialContributionDto>();
......@@ -183,9 +192,11 @@ public class MonitoringServiceIMQTTmpl {
}
}
/**
*/
/**
* 实时推送-风电站风机状态统计数据
*/
*//*
@Scheduled(cron = fanStatusStatisticsCron)
public void getFanStatusStatistics() {
List<StationBasic> stationBasicList = stationBasicMapper.selectList(new QueryWrapper<StationBasic>().isNotNull("sequence_nbr").eq("station_type", "FDZ"));
......@@ -206,9 +217,11 @@ public class MonitoringServiceIMQTTmpl {
});
}
/**
*/
/**
* 实时推送-风电站风场总概览
*/
*//*
@Scheduled(cron = fanstationOverviewCron)
public void getFanstationOverview() {
List<StationBasic> stationBasicList = stationBasicMapper.selectList(new QueryWrapper<StationBasic>().isNotNull("sequence_nbr").eq("station_type", "FDZ"));
......@@ -269,9 +282,11 @@ public class MonitoringServiceIMQTTmpl {
});
}
/**
*/
/**
* 实时推送-场站功率曲线总概览
*/
*//*
@Scheduled(cron = fanStationPowerBightCron)
public void getFanStationPowerBight() {
List<StationBasic> stationBasicList = stationBasicMapper.selectList(new QueryWrapper<StationBasic>().isNotNull("sequence_nbr").eq("station_type", "FDZ"));
......@@ -287,9 +302,11 @@ public class MonitoringServiceIMQTTmpl {
});
}
/**
*/
/**
* 实时同送-获取各场站的风机列表
*/
*//*
@Scheduled(cron = fanStatusListCron)
public void getFanStatusList() {
List<StationBasic> stationBasicList = stationBasicMapper.selectList(new QueryWrapper<StationBasic>().isNotNull("sequence_nbr").eq("station_type", "FDZ"));
......@@ -394,11 +411,13 @@ public class MonitoringServiceIMQTTmpl {
});
}
/**
*/
/**
* @param collect 根据网关id查询出来的数据
* @return 加工后风机实时运行状态图列表数据
* @deprecated 根据查询出来的风机状态返回风机的状态图片
*/
*//*
public IPage<HashMap<String, String>> getFanStatusListImages(List<IndexDto> collect) {
IPage<HashMap<String, String>> page = new Page<>();
HashMap<String, String> hashMap = new HashMap<>();
......@@ -460,3 +479,4 @@ public class MonitoringServiceIMQTTmpl {
}
}
}
*/
......@@ -25,7 +25,7 @@ public class ESEquipments {
@Field(type = FieldType.Text, index = false)
private String address;
@Field(type = FieldType.Text, index = false)
@Field(type = FieldType.Text)
private String dataType;
@Field(type = FieldType.Text)
private String equipmentSpecificName;
......@@ -37,11 +37,11 @@ public class ESEquipments {
private Date createdTime;
@Field(type = FieldType.Text , index = false)
private String unit;
@Field(type = FieldType.Text, index = false)
@Field(type = FieldType.Text)
private String value;
@Field(type = FieldType.Float, index = false)
private Float valueDouble;
@Field(type = FieldType.Text , index = false)
@Field(type = FieldType.Text)
private String valueLabel;
@Field(type = FieldType.Text , index = false)
private String traceId;
......@@ -55,7 +55,7 @@ public class ESEquipments {
private String systemType;
@Field(type = FieldType.Text , index = false)
private String pictureName;
@Field(type = FieldType.Text , index = false)
@Field(type = FieldType.Text)
private String displayName;
......
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