禅道问题修复:站内信模版/消息、日志管理、组织权限使用时间区间查询当日数据失效修复

This commit is contained in:
gaoqr
2024-10-08 14:23:17 +08:00
parent f651fb643f
commit 4fe3cfda62
5 changed files with 24 additions and 0 deletions
@@ -1,6 +1,7 @@
package com.cf.imes.framework.common.util.date;
import cn.hutool.core.date.LocalDateTimeUtil;
import cn.hutool.core.util.ObjectUtil;
import java.time.Duration;
import java.time.LocalDate;
@@ -132,4 +133,19 @@ public class LocalDateTimeUtils {
return LocalDateTimeUtil.between(dateTime, LocalDateTime.now(), ChronoUnit.DAYS);
}
/**
* 生成起时间0点和止时间12点的区间
*
* @param dateSection
* @return
*/
public static LocalDateTime[] generateTimeSection(LocalDateTime[] dateSection) {
if (ObjectUtil.isNotNull(dateSection) && dateSection.length == 2) {
LocalDateTime[] result = new LocalDateTime[2];
result[0] = dateSection[0].withHour(0).withMinute(0).withSecond(0);
result[1] = dateSection[1].withHour(23).withMinute(59).withSecond(59);
return result;
}
return dateSection;
}
}