From 6614292617685cd25e09d760dac47b54ed679df3 Mon Sep 17 00:00:00 2001 From: tiger_zhou Date: Thu, 12 Oct 2023 13:27:53 +0800 Subject: [PATCH] =?UTF-8?q?=E5=91=8A=E8=AD=A6=E7=A1=AE=E8=AE=A4=E8=B0=83?= =?UTF-8?q?=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../club/joylink/xiannccda/service/AlertRecordService.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/main/java/club/joylink/xiannccda/service/AlertRecordService.java b/src/main/java/club/joylink/xiannccda/service/AlertRecordService.java index fe0625c..3be6582 100644 --- a/src/main/java/club/joylink/xiannccda/service/AlertRecordService.java +++ b/src/main/java/club/joylink/xiannccda/service/AlertRecordService.java @@ -128,7 +128,12 @@ public class AlertRecordService { if (Objects.nonNull(id)) { Optional alertTipOptional = alertTips.stream().filter(d -> StringUtils.isNotEmpty(d.getTipTimeRef())) .filter(d -> Splitter.on(StringPool.COMMA).splitToList(d.getTipTimeRef()).contains(id.toString())).findFirst(); - return alertTipOptional.orElseGet(() -> alertTips.get(0)); + if (alertTipOptional.isPresent()) { + return alertTipOptional.get(); + } else { + alertTipOptional = alertTips.stream().filter(d -> StringUtils.isEmpty(d.getTipTimeRef())).findFirst(); + return alertTipOptional.orElseGet(() -> alertTips.get(0)); + } } else { return alertTips.get(0); }