Commit c7f2e54b authored by zhangsen's avatar zhangsen

API bug

parent ae6bc0ad
...@@ -813,6 +813,13 @@ public class MonitorFanIdxController extends BaseController { ...@@ -813,6 +813,13 @@ public class MonitorFanIdxController extends BaseController {
return ResponseHelper.buildResponse(result); return ResponseHelper.buildResponse(result);
} }
@ApiOperation(value = "逆变器状态数量")
@GetMapping("/nbqStatus")
public ResponseModel<Page<Map<String, Object>>> nbqStatus(String stationId) {
StationBasic stationBasic = stationBasicMapper.selectById(stationId);
Page<Map<String, Object>> result = monitorFanIndicator.nbqStatus(stationBasic.getFanGatewayId());
return ResponseHelper.buildResponse(result);
}
@ApiOperation(value = "电站排名") @ApiOperation(value = "电站排名")
@Scheduled(cron = "0/10 * * * * ? ") @Scheduled(cron = "0/10 * * * * ? ")
......
...@@ -1805,7 +1805,8 @@ public class MonitorFanIndicatorImpl implements IMonitorFanIndicator { ...@@ -1805,7 +1805,8 @@ public class MonitorFanIndicatorImpl implements IMonitorFanIndicator {
} }
public Map<String, Object> nbqStatus(String gatewayId) {
public Page<Map<String, Object>> nbqStatus(String gatewayId) {
// String sql = " SELECT * FROM indicators_" + gatewayId + " WHERE (equipmentIndexName ='待机' or equipmentIndexName ='故障停机' or equipmentIndexName ='告警运行' or equipmentIndexName ='限额运行' or equipmentIndexName ='停机') and value = 'true'"; // String sql = " SELECT * FROM indicators_" + gatewayId + " WHERE (equipmentIndexName ='待机' or equipmentIndexName ='故障停机' or equipmentIndexName ='告警运行' or equipmentIndexName ='限额运行' or equipmentIndexName ='停机') and value = 'true'";
// List<IndicatorsDto> indicatorsDtoList = influxDButils.getListData(sql, IndicatorsDto.class); // List<IndicatorsDto> indicatorsDtoList = influxDButils.getListData(sql, IndicatorsDto.class);
// //
...@@ -1921,7 +1922,7 @@ public class MonitorFanIndicatorImpl implements IMonitorFanIndicator { ...@@ -1921,7 +1922,7 @@ public class MonitorFanIndicatorImpl implements IMonitorFanIndicator {
} }
} }
String querySql = " SELECT * FROM indicators_" + gatewayId + " equipmentIndexName ='运行' and value = 'true'"; String querySql = " SELECT * FROM indicators_" + gatewayId + " where equipmentIndexName ='运行' and value = 'true'";
List<IndicatorsDto> queryList = influxDButils.getListData(querySql, IndicatorsDto.class); List<IndicatorsDto> queryList = influxDButils.getListData(querySql, IndicatorsDto.class);
if (!ValidationUtil.isEmpty(queryList)) { if (!ValidationUtil.isEmpty(queryList)) {
List<String> collect = queryList.stream().map(IndicatorsDto::getEquipmentNumber).collect(Collectors.toList()); List<String> collect = queryList.stream().map(IndicatorsDto::getEquipmentNumber).collect(Collectors.toList());
...@@ -1929,7 +1930,7 @@ public class MonitorFanIndicatorImpl implements IMonitorFanIndicator { ...@@ -1929,7 +1930,7 @@ public class MonitorFanIndicatorImpl implements IMonitorFanIndicator {
zcNum = collect.size() - strings.size(); zcNum = collect.size() - strings.size();
} }
String querySql1 = " SELECT * FROM indicators_" + gatewayId + " equipmentIndexName ='通讯异常' and value = 'true'"; String querySql1 = " SELECT * FROM indicators_" + gatewayId + " where equipmentIndexName ='通讯异常' and value = 'true'";
List<IndicatorsDto> queryList1 = influxDButils.getListData(querySql1, IndicatorsDto.class); List<IndicatorsDto> queryList1 = influxDButils.getListData(querySql1, IndicatorsDto.class);
if (!ValidationUtil.isEmpty(queryList1)) { if (!ValidationUtil.isEmpty(queryList1)) {
List<String> collect1 = queryList.stream().map(IndicatorsDto::getEquipmentNumber).collect(Collectors.toList()); List<String> collect1 = queryList.stream().map(IndicatorsDto::getEquipmentNumber).collect(Collectors.toList());
...@@ -1937,16 +1938,58 @@ public class MonitorFanIndicatorImpl implements IMonitorFanIndicator { ...@@ -1937,16 +1938,58 @@ public class MonitorFanIndicatorImpl implements IMonitorFanIndicator {
txNum = collect1.size() - strings1.size(); txNum = collect1.size() - strings1.size();
} }
numMap.put("djNum", djNum); Page<Map<String, Object>> mapPage = new Page<>();
numMap.put("gzNum", gzNum); ArrayList<Map<String, Object>> resultList = new ArrayList<>();
numMap.put("gjNum", gjNum); HashMap<String, Object> map = new HashMap<>();
numMap.put("xeNum", xeNum); map.put("count", zcNum);
numMap.put("xdNum", xdNum); map.put("equipmentIndexName", "正常运行");
numMap.put("txNum", txNum); map.put("color", "#00AA00");
numMap.put("tjNum", tjNum); resultList.add(map);
numMap.put("zcNum", zcNum); HashMap<String, Object> map2 = new HashMap<>();
map2.put("count", zcNum);
return numMap; map2.put("equipmentIndexName", "正常运行");
map2.put("color", "#00AA00");
resultList.add(map2);
HashMap<String, Object> map3 = new HashMap<>();
map3.put("count", zcNum);
map3.put("equipmentIndexName", "正常运行");
map3.put("color", "#00AA00");
resultList.add(map3);
HashMap<String, Object> map4 = new HashMap<>();
map4.put("count", zcNum);
map4.put("equipmentIndexName", "正常运行");
map4.put("color", "#00AA00");
resultList.add(map4);
HashMap<String, Object> map5 = new HashMap<>();
map5.put("count", zcNum);
map5.put("equipmentIndexName", "正常运行");
map5.put("color", "#00AA00");
resultList.add(map5);
HashMap<String, Object> map6 = new HashMap<>();
map6.put("count", zcNum);
map6.put("equipmentIndexName", "正常运行");
map6.put("color", "#00AA00");
resultList.add(map6);
HashMap<String, Object> map7 = new HashMap<>();
map7.put("count", zcNum);
map7.put("equipmentIndexName", "正常运行");
map7.put("color", "#00AA00");
resultList.add(map7);
HashMap<String, Object> map8 = new HashMap<>();
map8.put("count", zcNum);
map8.put("equipmentIndexName", "正常运行");
map8.put("color", "#00AA00");
resultList.add(map8);
mapPage.setTotal(8);
mapPage.setSize(8);
mapPage.setCurrent(1);
mapPage.setRecords(resultList);
return mapPage;
} }
......
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