Commit 5adece57 authored by zhangsen's avatar zhangsen

bug修改

parent 5d7db517
......@@ -25,4 +25,6 @@ public class IndexDto {
private String longitude; // 经度
private String latitude; // 纬度
private String frontModule;
private String unit; // 单位
private String F;//风机编号 -- 适应大屏
}
......@@ -36,7 +36,7 @@ public class MonitorFanIdxController extends BaseController {
@TycloudOperation(needAuth = false, ApiLevel = UserType.AGENCY)
@ApiOperation(value = "根据设备编号、网关ID、前段展示模块查询表数据")
@ApiOperation(value = "根据设备编号、场站id、前段展示模块、系统类型查询表数据")
@GetMapping("/getFanIdxInfoByPage")
public ResponseModel<IPage<IndexDto>> getFanIdxInfoByPage(@RequestParam(value = "equipNum", required = false) String equipNum,
@RequestParam(value = "stationId", required = false) String stationId,
......
......@@ -156,9 +156,9 @@ public class MonitorFanIndicatorImpl implements IMonitorFanIndicator {
Page<IndexDto> page = new Page<>(current, size);
String sql = "";
if (StringUtils.isNotEmpty(systemType)) {
sql = String.format("SELECT equipmentIndexName, value, frontModule FROM \"indicators_%s\" WHERE equipmentNumber = '%s' and frontModule =~/%s/ and systemType =~/%s/ ", stationBasic.getFanGatewayId(), equipNum, frontModule, systemType);
sql = String.format("SELECT equipmentIndexName, value, frontModule, unit FROM \"indicators_%s\" WHERE equipmentNumber = '%s' and frontModule =~/%s/ and systemType =~/%s/ ", stationBasic.getFanGatewayId(), equipNum, frontModule, systemType);
} else {
sql = String.format("SELECT equipmentIndexName, value, frontModule FROM \"indicators_%s\" WHERE equipmentNumber = '%s' and frontModule =~/%s/", stationBasic.getFanGatewayId(), equipNum, frontModule);
sql = String.format("SELECT equipmentIndexName, value, frontModule, unit FROM \"indicators_%s\" WHERE equipmentNumber = '%s' and frontModule =~/%s/", stationBasic.getFanGatewayId(), equipNum, frontModule);
}
List<IndexDto> influxDBList = influxDButils.getListData(sql, IndexDto.class);
List<IndexDto> collect = influxDBList.stream()
......@@ -240,9 +240,15 @@ public class MonitorFanIndicatorImpl implements IMonitorFanIndicator {
public List<IndexDto> getFanStatusList(String stationId) {
StationBasic stationBasic = getOneByStationNumber(stationId);
String sql = String.format("SELECT equipmentNumber, equipmentIndexName FROM \"indicators_%s\" WHERE equipmentIndexName =~/^正常运行|告警运行|正常停机|故障停机|限功率|待机状态|维护状态|通讯中断$/ and value = 'true'", stationBasic.getFanGatewayId());
String sql = String.format("SELECT equipmentNumber as F, equipmentIndexName FROM \"indicators_%s\" WHERE equipmentIndexName =~/^正常运行|告警运行|正常停机|故障停机|限功率|待机状态|维护状态|通讯中断$/ and value = 'true'", stationBasic.getFanGatewayId());
List<IndexDto> influxDBList = influxDButils.getListData(sql, IndexDto.class);
return influxDBList;
Map<String, String> collect = influxDBList.stream().collect(Collectors.toMap(IndexDto::getF, IndexDto::getEquipmentIndexName));
String sqlEquipNumList = String.format("SELECT (DISTINCT equipmentNumber) as F FROM \"indicators_%s\"", stationBasic.getFanGatewayId());
List<IndexDto> equipNumList = influxDButils.getListData(sqlEquipNumList, IndexDto.class);
equipNumList.forEach(item -> {
item.setEquipmentIndexName(collect.get(item.getF()));
});
return equipNumList;
}
public Map<String, Long> getFanStatusStatistics(String stationId) {
......
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