Commit 662587f1 authored by chenzhao's avatar chenzhao

修改代码

parent 54e4b694
......@@ -303,11 +303,13 @@ public class MonitorFanIdxController extends BaseController {
@ApiOperation(value = "升压站光字牌/开关-通用")
@GetMapping("/getStatusGzp")
public ResponseModel<IPage<Map<String, Object>>> getStatusGzp(@RequestParam(value = "stationId")String stationId,String frontModule,String systemType) {
public ResponseModel<IPage<Map<String, Object>>> getStatusGzp(@RequestParam(value = "stationId")String stationId,String frontModule,String systemType,String equipNum,@RequestParam(required = false) String stationType) {
StationBasic stationBasic = stationBasicMapper.selectById(stationId);
String gatewayId = stationBasic.getBoosterGatewayId();
List<Map<String, Object>> statusMonitoring = monitorFanIndicator.getStatusGzp(gatewayId ,systemType,frontModule);
if (null != stationType){
gatewayId = stationBasic.getFanGatewayId();
}
List<Map<String, Object>> statusMonitoring = monitorFanIndicator.getStatusGzp(gatewayId ,systemType,frontModule,equipNum);
IPage<Map<String,Object>> result = new Page<>();
result.setRecords(statusMonitoring);
result.setCurrent(1);
......@@ -332,7 +334,7 @@ public class MonitorFanIdxController extends BaseController {
stringStringHashMap.put("agzp", "A套保护光字牌");
stringStringHashMap.put("bgzp", "B套保护光字牌");
for (Map.Entry<String, String> stringStringEntry : stringStringHashMap.entrySet()) {
List<Map<String, Object>> statusMonitoring = monitorFanIndicator.getStatusGzp(gatewayId ,stringStringEntry.getValue(), name);
List<Map<String, Object>> statusMonitoring = monitorFanIndicator.getStatusGzp(gatewayId ,stringStringEntry.getValue(), name,null);
IPage<Map<String,Object>> result = new Page<>();
result.setRecords(statusMonitoring);
result.setCurrent(1);
......@@ -533,7 +535,7 @@ public class MonitorFanIdxController extends BaseController {
Map<String, Object> switchUrl = monitorFanIndicatorImpl.getSwitchUrl(gatewayId, name);
List<Map<String, Object>> statusMonitoring = monitorFanIndicator.getStatusGzp(gatewayId ,"网络",name);
List<Map<String, Object>> statusMonitoring = monitorFanIndicator.getStatusGzp(gatewayId ,"网络",name,null);
IPage<Map<String, Object>> result = new Page<>();
switchUrl.put("records",statusMonitoring);
switchUrl.put("current",1);
......@@ -619,7 +621,7 @@ public class MonitorFanIdxController extends BaseController {
public ResponseModel<Map<String,Object>> getEquipInfoByEquipNum(@RequestParam(value = "equipNum", required = false) String equipNum,
@RequestParam(value = "stationId", required = false) String stationId) {
StationBasic stationBasic = stationBasicMapper.selectById(stationId);
String gatewayId = stationBasic.getBoosterGatewayId();
String gatewayId = stationBasic.getFanGatewayId();
return ResponseHelper.buildResponse(monitorFanIndicator.getEquipInfoByEquipNum(gatewayId,equipNum ));
}
......
......@@ -32,11 +32,12 @@ public class IndicatorsDto {
private String state;
public String getTime() {
String[] ts= time.replace(":00Z","").split("T");
if (null != time) {
String[] ts = time.replace(":00Z", "").split("T");
return ts[1];
}
return null;
}
public void setTime(String time) {
this.time = time;
......
......@@ -138,7 +138,7 @@ public class MonitorFanIndicatorImpl implements IMonitorFanIndicator {
ArrayList<IndexDto> lisSort= (ArrayList<IndexDto>) list.stream().sorted(Comparator.comparing(IndexDto::getTimeString,Comparator.comparingLong(Long::parseLong)).reversed()).collect(Collectors.toList());
//构建平台数据
DataGridMock DataGridMock = new DataGridMock(current, !list1.isEmpty()? list1.get(0).getCount() : 0, false, current, lisSort);
ColModel colModelequipmentNumber = new ColModel("equipmentNumber", "equipmentNumber", "风机号", "风机号", "dataGrid", "equipmentNumber");
ColModel colModelequipmentNumber = new ColModel("equipmentNumber", "equipmentNumber", "设备", "风机号", "dataGrid", "equipmentNumber");
ColModel colModelvalueLabel = new ColModel("valueLabel", "valueLabel", "事件描述", "事件描述", "dataGrid", "valueLabel");
ColModel colModelcreatedTime = new ColModel("createdTime", "createdTime", "发生时间", "发生时间", "dataGrid", "createdTime");
ColModel colModelvalue = new ColModel("value", "value", "告警值", "告警值", "dataGrid", "value");
......@@ -815,14 +815,17 @@ public class MonitorFanIndicatorImpl implements IMonitorFanIndicator {
}
public List<Map<String,Object>> getStatusGzp(String gatewayId,String systemType,String frontModule){
String sql = " SELECT displayName , value as state FROM indicators_"+gatewayId+" WHERE frontModule =~/"+frontModule+"/ and systemType = '"+systemType+"'";
public List<Map<String,Object>> getStatusGzp(String gatewayId,String systemType,String frontModule,String equipNum){
String sql = " SELECT displayName , value as state,equipmentIndexName FROM indicators_"+gatewayId+" WHERE frontModule =~/"+frontModule+"/ and systemType = '"+systemType+"'";
if (null != equipNum){
sql = " SELECT displayName , value as state,equipmentIndexName FROM indicators_"+gatewayId+" WHERE frontModule =~/"+frontModule+"/ and systemType = '"+systemType+"' and equipmentNumber ='"+equipNum+"'";
}
List<IndicatorsDto> listData = influxDButils.getListData(sql, IndicatorsDto.class);
List<Map<String,Object>> statusMaps = new ArrayList<>();
for (IndicatorsDto listDatum : listData) {
Map<String, Object> statusMap = new HashMap<>();
statusMap.put("data",listDatum.getDisplayName());
statusMap.put("data",StringUtils.isEmpty(listDatum.getDisplayName())?listDatum.getEquipmentIndexName():listDatum.getDisplayName());
statusMap.put("state",listDatum.getState().equals("true")? 1:0);
statusMap.put("status",listDatum.getState().equals("true")? 1:0);
statusMap.put("title",listDatum.getState().equals("true")?"断":"通");
......@@ -1426,7 +1429,8 @@ public class MonitorFanIndicatorImpl implements IMonitorFanIndicator {
if (!ValidationUtil.isEmpty(list)){
resultMap.put("equipmentSpecificName",list.get(0).getEquipmentSpecificName());
resultMap.put("equipmentIndexName",list.get(0).getEquipmentSpecificName());
resultMap.put("status",list.get(0).getValue());
resultMap.put("equipmentInfoName",list.get(0).getEquipmentSpecificName().substring(5).replace("/"," "));
resultMap.put("status",list.get(0).getValue().equals("true")?"异常":"正常运行");
}
return resultMap;
}
......@@ -1448,7 +1452,7 @@ public class MonitorFanIndicatorImpl implements IMonitorFanIndicator {
for (IndicatorsDto listDatum : data) {
Map<String, Object> statusMap = new HashMap<>();
statusMap.put("equipmentNumber",listDatum.getEquipmentNumber());
statusMap.put("equipmentSpecificName",listDatum.getEquipmentSpecificName());
statusMap.put("equipmentSpecificName",listDatum.getEquipmentSpecificName().substring(5).replace("/"," "));
statusMaps.add(statusMap);
}
return statusMaps;
......
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