Commit 0820bba2 authored by wujiang's avatar wujiang

提交风机告警

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