功能调整
This commit is contained in:
@@ -296,7 +296,22 @@ public class DataServiceImpl implements IDataService {
|
|||||||
EleEpdPqd epdPqd = epdFeignClient.findByName(item.getTag()).getData();
|
EleEpdPqd epdPqd = epdFeignClient.findByName(item.getTag()).getData();
|
||||||
EachModuleVO.HarmonicVo vo = new EachModuleVO.HarmonicVo();
|
EachModuleVO.HarmonicVo vo = new EachModuleVO.HarmonicVo();
|
||||||
vo.setTime(item.getStartTime());
|
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("无状态");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
vo.setStateDesc(channelState2(item.getTag()));
|
vo.setStateDesc(channelState2(item.getTag()));
|
||||||
|
}
|
||||||
vo.setEventCode(item.getTag());
|
vo.setEventCode(item.getTag());
|
||||||
vo.setDataType(1);
|
vo.setDataType(1);
|
||||||
if (ObjectUtil.isNotNull(epdPqd)) {
|
if (ObjectUtil.isNotNull(epdPqd)) {
|
||||||
@@ -312,11 +327,7 @@ public class DataServiceImpl implements IDataService {
|
|||||||
.sorted(Comparator.comparing(EachModuleVO.HarmonicVo::getTime))
|
.sorted(Comparator.comparing(EachModuleVO.HarmonicVo::getTime))
|
||||||
.collect(Collectors.toList());
|
.collect(Collectors.toList());
|
||||||
EachModuleVO.HarmonicVo last = dataList.get(dataList.size() - 1);
|
EachModuleVO.HarmonicVo last = dataList.get(dataList.size() - 1);
|
||||||
if (Objects.equals(last.getDataType(),0)) {
|
|
||||||
moduleVO.setModuleState(last.getStateDesc());
|
moduleVO.setModuleState(last.getStateDesc());
|
||||||
} else if (Objects.equals(last.getDataType(),1)) {
|
|
||||||
moduleVO.setModuleState(channelState2(last.getEventCode()));
|
|
||||||
}
|
|
||||||
//如果模块掉线超过30分钟,则续上数据
|
//如果模块掉线超过30分钟,则续上数据
|
||||||
LocalDateTime givenTime = last.getTime();
|
LocalDateTime givenTime = last.getTime();
|
||||||
LocalDateTime currentTime = LocalDateTime.now();
|
LocalDateTime currentTime = LocalDateTime.now();
|
||||||
@@ -432,7 +443,7 @@ public class DataServiceImpl implements IDataService {
|
|||||||
String str = null;
|
String str = null;
|
||||||
if ("Alm_Apf_ModDisConnect".equals(code)) {
|
if ("Alm_Apf_ModDisConnect".equals(code)) {
|
||||||
str = "离线";
|
str = "离线";
|
||||||
} else if ("Alm_Apf_ModRunStop".equals(code) || "Alm_Apf_JT_stsLock".equals(code) ) {
|
} else if ("Alm_Apf_ModRunStop".equals(code) || "Alm_Apf_JT_stsLock".equals(code) || "Alm_Apf_JT_stsUnLock".equals(code)) {
|
||||||
str = "停止";
|
str = "停止";
|
||||||
} else if ("Alm_Apf_ModRunRun".equals(code)) {
|
} else if ("Alm_Apf_ModRunRun".equals(code)) {
|
||||||
str = "运行";
|
str = "运行";
|
||||||
|
|||||||
Reference in New Issue
Block a user