feat:自动处理邮箱邮件监控时间单位

This commit is contained in:
nieziyan 2024-05-06 09:50:46 +08:00
parent fc978d459e
commit ebf8958f60

View File

@ -147,8 +147,10 @@ public class EmailJob extends Monitor{
int res = 1;
DateTimeFormatter formatter = DateTimeFormatter.ofPattern(DateConstant.DATE_TIME);
LocalDateTime minusHours = LocalDateTime.now().minusHours(undealHours);
LocalDateTime minusMinutes = LocalDateTime.now().minusMinutes(undealHours);
String hoursAgo = minusHours.format(formatter);
Boolean result = getAlarmClient().hoursAgo(emailId, hoursAgo);
String minutesAgo = minusMinutes.format(formatter);
Boolean result = getAlarmClient().hoursAgo(emailId, minutesAgo);
if (ObjectUtil.isNotNull(result) && result)
res = 0;
return res;