微调
This commit is contained in:
@@ -318,6 +318,17 @@ public class DataServiceImpl implements IDataService {
|
|||||||
} else if (Objects.equals(last.getDataType(),1)) {
|
} else if (Objects.equals(last.getDataType(),1)) {
|
||||||
moduleVO.setModuleState(Objects.equals(last.getEventCode(),"Alm_Apf_ModDisConnect") ? "离线" : "运行");
|
moduleVO.setModuleState(Objects.equals(last.getEventCode(),"Alm_Apf_ModDisConnect") ? "离线" : "运行");
|
||||||
}
|
}
|
||||||
|
//如果模块掉线超过30分钟,则续上数据
|
||||||
|
LocalDateTime givenTime = last.getTime();
|
||||||
|
LocalDateTime currentTime = LocalDateTime.now();
|
||||||
|
Duration duration = Duration.between(givenTime, currentTime);
|
||||||
|
boolean isMoreThan30Minutes = duration.toMinutes() > 30;
|
||||||
|
if (isMoreThan30Minutes) {
|
||||||
|
EachModuleVO.HarmonicVo vo = new EachModuleVO.HarmonicVo();
|
||||||
|
vo.setTime(LocalDateTime.now());
|
||||||
|
vo.setStateDesc(last.getStateDesc());
|
||||||
|
vo.setDataType(0);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
moduleVO.setModOutList(list2);
|
moduleVO.setModOutList(list2);
|
||||||
moduleVO.setLoadList(list3);
|
moduleVO.setLoadList(list3);
|
||||||
|
|||||||
Reference in New Issue
Block a user