功能调整
This commit is contained in:
@@ -296,18 +296,15 @@ public class DataServiceImpl implements IDataService {
|
||||
EleEpdPqd epdPqd = epdFeignClient.findByName(item.getTag()).getData();
|
||||
EachModuleVO.HarmonicVo vo = new EachModuleVO.HarmonicVo();
|
||||
vo.setTime(item.getStartTime());
|
||||
//查询事件状态 如果往前查寻没有数据、则往后查询事件
|
||||
if (Objects.equals("Alm_Apf_ModConnect",item.getTag())) {
|
||||
if (ObjectUtil.isNotEmpty(list1)) {
|
||||
Optional<EachModuleVO.HarmonicVo> optional = list1.stream()
|
||||
// 筛选时间早于参考时间且目标字段等于指定值的记录
|
||||
.filter(vo1 -> vo1.getTime().isBefore(item.getStartTime()))
|
||||
.filter(vo2 -> vo2.getDataType() == 0)
|
||||
.max(Comparator.comparing(EachModuleVO.HarmonicVo::getTime));
|
||||
if (optional.isPresent()) {
|
||||
vo.setStateDesc(optional.get().getStateDesc());
|
||||
} else {
|
||||
vo.setStateDesc("无状态");
|
||||
}
|
||||
.findFirst();
|
||||
optional.ifPresent(harmonicVo -> vo.setStateDesc(harmonicVo.getStateDesc()));
|
||||
}
|
||||
} else {
|
||||
vo.setStateDesc(channelState2(item.getTag()));
|
||||
@@ -326,6 +323,22 @@ public class DataServiceImpl implements IDataService {
|
||||
List<EachModuleVO.HarmonicVo> dataList = list1.stream()
|
||||
.sorted(Comparator.comparing(EachModuleVO.HarmonicVo::getTime))
|
||||
.collect(Collectors.toList());
|
||||
//处理APF模块连接事件状态
|
||||
dataList.forEach(item->{
|
||||
if (Objects.equals(item.getEventCode(),"Alm_Apf_ModConnect")) {
|
||||
Optional<EachModuleVO.HarmonicVo> optional = dataList.stream()
|
||||
// 筛选时间早于参考时间且目标字段等于指定值的记录
|
||||
.filter(vo1 -> vo1.getTime().isAfter(item.getTime()) && vo1.getDataType() == 1)
|
||||
.filter(vo2 -> !Objects.equals("Alm_Apf_ModDisConnect",vo2.getEventCode()) && !Objects.equals("Alm_Apf_ModConnect",vo2.getEventCode()))
|
||||
.findFirst();
|
||||
if (optional.isPresent()) {
|
||||
item.setStateDesc(optional.get().getStateDesc());
|
||||
} else {
|
||||
item.setStateDesc("无状态");
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
EachModuleVO.HarmonicVo last = dataList.get(dataList.size() - 1);
|
||||
moduleVO.setModuleState(last.getStateDesc());
|
||||
//如果模块掉线超过30分钟,则续上数据
|
||||
|
||||
Reference in New Issue
Block a user