录单
This commit is contained in:
@@ -2127,16 +2127,18 @@ public class JDUtil {
|
|||||||
List<LocalDate> localDates = parseUserDateIfPresent(input);
|
List<LocalDate> localDates = parseUserDateIfPresent(input);
|
||||||
if (localDates != null) {
|
if (localDates != null) {
|
||||||
userDate = localDates;
|
userDate = localDates;
|
||||||
|
logger.info("用户输入的日期 {}", userDate);
|
||||||
} else {
|
} else {
|
||||||
// 2️⃣ 获取有效“今天”
|
// 2️⃣ 获取有效“今天”
|
||||||
LocalDateTime today = getEffectiveToday();
|
LocalDateTime today = getEffectiveToday();
|
||||||
userDate.add(today.toLocalDate());
|
userDate.add(today.toLocalDate());
|
||||||
userDate.add(today.toLocalDate());
|
userDate.add(today.toLocalDate());
|
||||||
|
logger.info("有效“今天” {}", today);
|
||||||
}
|
}
|
||||||
|
|
||||||
// 3️⃣ 构造查询时间范围 - 修正后的代码
|
// 3️⃣ 构造查询时间范围 - 修正后的代码
|
||||||
LocalDateTime startOfDay = userDate.get(0).atStartOfDay();
|
LocalDateTime startOfDay = userDate.get(0).atStartOfDay();
|
||||||
LocalDateTime endOfDay = userDate.get(1).atTime(LocalTime.MAX);
|
LocalDateTime endOfDay = userDate.get(1).atTime(LocalTime.MAX);
|
||||||
|
logger.info("查询时间范围 {} - {}", startOfDay, endOfDay);
|
||||||
|
|
||||||
Date startDate = Date.from(startOfDay.atZone(ZoneId.systemDefault()).toInstant());
|
Date startDate = Date.from(startOfDay.atZone(ZoneId.systemDefault()).toInstant());
|
||||||
Date endDate = Date.from(endOfDay.atZone(ZoneId.systemDefault()).toInstant());
|
Date endDate = Date.from(endOfDay.atZone(ZoneId.systemDefault()).toInstant());
|
||||||
|
|||||||
Reference in New Issue
Block a user