Commit 0820bba2 authored by wujiang's avatar wujiang

提交风机告警

parent 8d1bfdaa
...@@ -120,36 +120,54 @@ public class MonitorFanIndicatorImpl implements IMonitorFanIndicator { ...@@ -120,36 +120,54 @@ public class MonitorFanIndicatorImpl implements IMonitorFanIndicator {
public void UpdateMonitorFanIndicator(List<IndexDto> list) { public void UpdateMonitorFanIndicator(List<IndexDto> list) {
monitorFanIndicatorregionMapper.UpdateMonitorFanIndicator(list); monitorFanIndicatorregionMapper.UpdateMonitorFanIndicator(list);
} }
@Override @Override
public ResultsData getNationWideInfo(int current, int size, String gateway, String equipmentNumber) { public ResultsData getNationWideInfo(int current, int size, String gateway, String equipmentNumber) {
String table = gateway; String table = gateway;
Map<String, List<String>> queryCodntion = new HashMap<>(); Map<String, List<String>> queryCodntion = new HashMap<>();
queryCodntion.put(CommonConstans.QueryStringGateWayId, Arrays.asList(gateway)); queryCodntion.put(CommonConstans.QueryStringGateWayId, Arrays.asList(gateway));
queryCodntion.put(CommonConstans.QueryStringIsAlarmKeyword, Arrays.asList("1")); queryCodntion.put(CommonConstans.QueryStringIsAlarmKeyword, Arrays.asList("1"));
List<ESEquipments> alldata = commonServiceImpl.getListDataByCondtionsAndLike(queryCodntion, null, ESEquipments.class, null); List<ESEquipments> alldata = commonServiceImpl.getListDataByCondtionsAndLike(queryCodntion, null,
List<ESEquipments> waringData = alldata.stream().filter(esEquipments -> !esEquipments.getValue().equals("0.0") && !esEquipments.getValue().equals(esEquipments.getValueLabel())).collect(Collectors.toList()); ESEquipments.class, null);
if (StringUtils.isNotEmpty(equipmentNumber)) { List<ESEquipments> waringData = alldata.stream()
waringData = waringData.stream().filter(esEquipments -> esEquipments.getEquipmentNumber().equals(equipmentNumber)).collect(Collectors.toList()); .filter(esEquipments -> (!esEquipments.getValue().equals("0.0")
} && !esEquipments.getValue().equals(esEquipments.getValueLabel())
if (CollectionUtils.isNotEmpty(waringData)) { || (esEquipments.getValue().equals("true"))))
Integer newSize = waringData.size() >= size ? size : waringData.size(); .collect(Collectors.toList());
waringData = waringData.stream().sorted(Comparator.comparing(ESEquipments::getCreatedTime).reversed()).collect(Collectors.toList()).subList(((current - 1) * newSize), (current * newSize)); if (StringUtils.isNotEmpty(equipmentNumber)) {
} waringData = waringData.stream()
//对于查询到的告警信息进行按照时间顺序进行排序 .filter(esEquipments -> esEquipments.getEquipmentNumber().equals(equipmentNumber))
DataGridMock DataGridMock = new DataGridMock(current, !waringData.isEmpty() ? waringData.size() : 0, false, current, waringData); .collect(Collectors.toList());
ColModel colModelequipmentNumber = new ColModel("equipmentNumber", "equipmentNumber", "设备", "设备", "dataGrid", "equipmentNumber"); }
ColModel colModelvalueLabel = new ColModel("valueLabel", "valueLabel", "事件描述", "事件描述", "dataGrid", "valueLabel"); if (CollectionUtils.isNotEmpty(waringData)) {
ColModel colModelcreatedTime = new ColModel("createdTime", "createdTime", "发生时间", "发生时间", "dataGrid", "createdTime"); Integer newSize = waringData.size() >= size ? size : waringData.size();
ColModel colModelvalue = new ColModel("value", "value", "告警值", "告警值", "dataGrid", "value"); waringData = waringData.stream().sorted(Comparator.comparing(ESEquipments::getCreatedTime).reversed())
List<ColModel> listColModel = new ArrayList<>(); .collect(Collectors.toList()).subList(((current - 1) * newSize), (current * newSize));
listColModel.add(colModelequipmentNumber); waringData.forEach(i->{
listColModel.add(colModelvalueLabel); if("true".equals(i.getValue()))
listColModel.add(colModelcreatedTime); {
listColModel.add(colModelvalue); i.setValue("合");
ResultsData resultsData = new ResultsData(DataGridMock, listColModel); }
return resultsData; });
} }
// 对于查询到的告警信息进行按照时间顺序进行排序
DataGridMock DataGridMock = new DataGridMock(current, !waringData.isEmpty() ? waringData.size() : 0, false,
current, waringData);
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");
List<ColModel> listColModel = new ArrayList<>();
listColModel.add(colModelequipmentNumber);
listColModel.add(colModelvalueLabel);
listColModel.add(colModelcreatedTime);
listColModel.add(colModelvalue);
ResultsData resultsData = new ResultsData(DataGridMock, listColModel);
return resultsData;
}
@Override @Override
public ResultsData getLsNationWideInfo(int current, int size, String stationBasicId, String equipmentNumber) { public ResultsData getLsNationWideInfo(int current, int size, String stationBasicId, String equipmentNumber) {
......
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