Commit fe2f1e01 authored by wujiang's avatar wujiang

修改查询显示

parent 1804918c
...@@ -147,6 +147,7 @@ public class MonitorFanIndicatorImpl implements IMonitorFanIndicator { ...@@ -147,6 +147,7 @@ public class MonitorFanIndicatorImpl implements IMonitorFanIndicator {
if("true".equals(i.getValue())) if("true".equals(i.getValue()))
{ {
i.setValue("合"); i.setValue("合");
i.setValueLabel(i.getEquipmentIndexName());
} }
}); });
} }
...@@ -2143,94 +2144,93 @@ public class MonitorFanIndicatorImpl implements IMonitorFanIndicator { ...@@ -2143,94 +2144,93 @@ public class MonitorFanIndicatorImpl implements IMonitorFanIndicator {
return deaviationRateDtoPage; return deaviationRateDtoPage;
} }
@Scheduled(cron = "0 */10 * * * ?") // @Scheduled(cron = "0 */10 * * * ?")
//@Scheduled(cron = "0/1 * * * * ?") // //@Scheduled(cron = "0/1 * * * * ?")
public void addNbqAlarmEvent() { // public void addNbqAlarmEvent() {
//
LambdaQueryWrapper<StationBasic> wrapper = new LambdaQueryWrapper<>(); // LambdaQueryWrapper<StationBasic> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(BaseEntity::getIsDelete, false); // wrapper.eq(BaseEntity::getIsDelete, false);
wrapper.like(StationBasic::getStationType, "GFDZ"); // wrapper.like(StationBasic::getStationType, "GFDZ");
List<StationBasic> stationBasics = stationBasicMapper.selectList(wrapper); // List<StationBasic> stationBasics = stationBasicMapper.selectList(wrapper);
for (StationBasic stationBasic : stationBasics) { // for (StationBasic stationBasic : stationBasics) {
Map<String, List<String>> queryCondtion = new HashMap<>(); // Map<String, List<String>> queryCondtion = new HashMap<>();
Map<String, String> shouldCondtion = new HashMap<>(); // Map<String, String> shouldCondtion = new HashMap<>();
queryCondtion.put(CommonConstans.QueryStringGateWayId, Arrays.asList(stationBasic.getFanGatewayId())); // queryCondtion.put(CommonConstans.QueryStringGateWayId, Arrays.asList(stationBasic.getFanGatewayId()));
queryCondtion.put(CommonConstans.QueryStringEquipmentIndexName, // queryCondtion.put(CommonConstans.QueryStringEquipmentIndexName,
Arrays.asList("待机", "停机", "告警运行", "限额运行", "降额运行", "故障停机", "通讯故障", "运行")); // Arrays.asList("待机", "停机", "告警运行", "限额运行", "降额运行", "故障停机", "通讯故障", "运行"));
queryCondtion.put(CommonConstans.QueryStringValueKeyword, Arrays.asList("true")); // queryCondtion.put(CommonConstans.QueryStringValueKeyword, Arrays.asList("true"));
//
/** // /**
* 逆变器 // * 逆变器
*/ // */
List<ESEquipments> indicatorsDtoList = commonServiceImpl.getListDataByCondtions(queryCondtion, null, // List<ESEquipments> indicatorsDtoList = commonServiceImpl.getListDataByCondtions(queryCondtion, null,
ESEquipments.class); // ESEquipments.class);
Collections.sort(indicatorsDtoList, (a, b) -> (b.getCreatedTime()) // Collections.sort(indicatorsDtoList, (a, b) -> (b.getCreatedTime())
.compareTo(a.getCreatedTime())); // .compareTo(a.getCreatedTime()));
//
//过滤重复状态 // //过滤重复状态
List<ESEquipments> nindicatorsDtoList=indicatorsDtoList.stream().collect(Collectors.collectingAndThen( // List<ESEquipments> nindicatorsDtoList=indicatorsDtoList.stream().collect(Collectors.collectingAndThen(
Collectors.toCollection(() -> new TreeSet<>(Comparator.comparing(ESEquipments::getDisplayName))), ArrayList::new)); // Collectors.toCollection(() -> new TreeSet<>(Comparator.comparing(ESEquipments::getDisplayName))), ArrayList::new));
//
//
// /**
/** // * 汇流箱
* 汇流箱 // */
*/ // queryCondtion.remove(CommonConstans.QueryStringEquipmentIndexName);
queryCondtion.remove(CommonConstans.QueryStringEquipmentIndexName); // queryCondtion.remove(CommonConstans.QueryStringValueKeyword);
queryCondtion.remove(CommonConstans.QueryStringValueKeyword); // queryCondtion.put(CommonConstans.QueryStringDataType, Arrays.asList("state"));
queryCondtion.put(CommonConstans.QueryStringDataType, Arrays.asList("state")); // shouldCondtion.put(CommonConstans.QueryStringFrontMoudle, "汇流箱");
shouldCondtion.put(CommonConstans.QueryStringFrontMoudle, "汇流箱"); // List<ESEquipments> indicatorsDtoListHLX = commonServiceImpl.getListDataByCondtions(queryCondtion,
List<ESEquipments> indicatorsDtoListHLX = commonServiceImpl.getListDataByCondtions(queryCondtion, // shouldCondtion, ESEquipments.class);
shouldCondtion, ESEquipments.class); // /**
/** // * 箱变
* 箱变 // */
*/ // shouldCondtion.put(CommonConstans.QueryStringFrontMoudle, "箱变");
shouldCondtion.put(CommonConstans.QueryStringFrontMoudle, "箱变"); // List<ESEquipments> indicatorsDtoListXB = commonServiceImpl.getListDataByCondtions(queryCondtion,
List<ESEquipments> indicatorsDtoListXB = commonServiceImpl.getListDataByCondtions(queryCondtion, // shouldCondtion, ESEquipments.class);
shouldCondtion, ESEquipments.class); // nindicatorsDtoList.addAll(indicatorsDtoListHLX);
nindicatorsDtoList.addAll(indicatorsDtoListHLX); // nindicatorsDtoList.addAll(indicatorsDtoListXB);
nindicatorsDtoList.addAll(indicatorsDtoListXB); //
// List<EquipAlarmEvent> newEquipAlarmEvents = new ArrayList<>();
List<EquipAlarmEvent> newEquipAlarmEvents = new ArrayList<>(); // List<EquipAlarmEvent> newEquipAlarmEvent = new ArrayList<>();
List<EquipAlarmEvent> newEquipAlarmEvent = new ArrayList<>(); // long time = new Date().getTime();
long time = new Date().getTime(); // if (CollectionUtils.isNotEmpty(nindicatorsDtoList)) {
if (CollectionUtils.isNotEmpty(nindicatorsDtoList)) { // for (ESEquipments esEquipments : nindicatorsDtoList) {
for (ESEquipments esEquipments : nindicatorsDtoList) { // EquipAlarmEvent equipAlarmEvent = new EquipAlarmEvent();
EquipAlarmEvent equipAlarmEvent = new EquipAlarmEvent(); // equipAlarmEvent.setEquipIndex(esEquipments.getEquipmentNumber());
equipAlarmEvent.setEquipIndex(esEquipments.getEquipmentNumber()); // equipAlarmEvent.setEquipName(esEquipments.getEquipmentSpecificName());
equipAlarmEvent.setEquipName(esEquipments.getEquipmentSpecificName()); // equipAlarmEvent.setAlarmDesc(AlarmDesc.getCode(esEquipments.getEquipmentIndexName()));
equipAlarmEvent.setAlarmDesc(AlarmDesc.getCode(esEquipments.getEquipmentIndexName())); // equipAlarmEvent.setAlarmDesc(
equipAlarmEvent.setAlarmDesc( // StringUtils.isEmpty(equipAlarmEvent.getAlarmDesc()) ? esEquipments.getEquipmentIndexName()
StringUtils.isEmpty(equipAlarmEvent.getAlarmDesc()) ? esEquipments.getEquipmentIndexName() // : equipAlarmEvent.getAlarmDesc());
: equipAlarmEvent.getAlarmDesc()); // equipAlarmEvent.setCreatedTime(esEquipments.getCreatedTime());
equipAlarmEvent.setCreatedTime(esEquipments.getCreatedTime()); // equipAlarmEvent.setGatewayId(stationBasic.getFanGatewayId());
equipAlarmEvent.setGatewayId(stationBasic.getFanGatewayId()); // equipAlarmEvent.setSort(time);
equipAlarmEvent.setSort(time); // equipAlarmEvent.setFrontModule(esEquipments.getFrontModule());
equipAlarmEvent.setFrontModule(esEquipments.getFrontModule()); // equipAlarmEvent.setValue(esEquipments.getValue());
equipAlarmEvent.setValue(esEquipments.getValue()); // newEquipAlarmEvents.add(equipAlarmEvent);
newEquipAlarmEvents.add(equipAlarmEvent); // newEquipAlarmEvent.add(equipAlarmEvent);
newEquipAlarmEvent.add(equipAlarmEvent); // }
} // }
} //
// String lastSort = equipAlarmEventMapper.getLastDataBySort(stationBasic.getFanGatewayId());
String lastSort = equipAlarmEventMapper.getLastDataBySort(stationBasic.getFanGatewayId()); // if (null != lastSort) {
if (null != lastSort) { // List<EquipAlarmEvent> oldEquipAlarmEvents = equipAlarmEventMapper.getOldDataBySort(lastSort,
List<EquipAlarmEvent> oldEquipAlarmEvents = equipAlarmEventMapper.getOldDataBySort(lastSort, // stationBasic.getFanGatewayId());
stationBasic.getFanGatewayId()); // for (EquipAlarmEvent oldEquipAlarmEvent : oldEquipAlarmEvents) {
for (EquipAlarmEvent oldEquipAlarmEvent : oldEquipAlarmEvents) { // for (EquipAlarmEvent equipAlarmEvent : newEquipAlarmEvents) {
for (EquipAlarmEvent equipAlarmEvent : newEquipAlarmEvents) { // if (oldEquipAlarmEvent.getEquipIndex().equals(equipAlarmEvent.getEquipIndex())
if (oldEquipAlarmEvent.getEquipIndex().equals(equipAlarmEvent.getEquipIndex()) // && oldEquipAlarmEvent.getAlarmDesc().equals(equipAlarmEvent.getAlarmDesc())
&& oldEquipAlarmEvent.getAlarmDesc().equals(equipAlarmEvent.getAlarmDesc()) // && oldEquipAlarmEvent.getValue().equals(equipAlarmEvent.getValue())) {
&& oldEquipAlarmEvent.getValue().equals(equipAlarmEvent.getValue())) { // newEquipAlarmEvent.remove(equipAlarmEvent);
newEquipAlarmEvent.remove(equipAlarmEvent); // }
} // }
} // }
} // }
} // equipAlarmEventService.saveBatch(newEquipAlarmEvent);
equipAlarmEventService.saveBatch(newEquipAlarmEvent); //
// }
} // }
}
public HashMap<String, String> getPvNBQStationBy(String gatewayId) { public HashMap<String, String> getPvNBQStationBy(String gatewayId) {
HashMap<String, String> result = new HashMap<>(); HashMap<String, String> result = new HashMap<>();
......
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