录单
This commit is contained in:
@@ -2124,17 +2124,19 @@ public class JDUtil {
|
|||||||
|
|
||||||
public void manman(String input, String fromWxid) {
|
public void manman(String input, String fromWxid) {
|
||||||
// 1️⃣ 调用封装好的方法提取日期
|
// 1️⃣ 调用封装好的方法提取日期
|
||||||
LocalDate userDate = parseUserDateIfPresent(input);
|
List<LocalDate> userDate = parseUserDateIfPresent(input);
|
||||||
|
|
||||||
// 2️⃣ 获取有效“今天”
|
// 2️⃣ 获取有效“今天”
|
||||||
LocalDateTime today = getEffectiveToday();
|
LocalDateTime today = getEffectiveToday();
|
||||||
if (userDate != null) {
|
if (userDate == null) {
|
||||||
today = userDate.atStartOfDay(); // ⬅️ 用户指定了日期
|
userDate.add(today.toLocalDate());
|
||||||
|
}
|
||||||
|
if (userDate.size() == 1) {
|
||||||
|
userDate.add(today.toLocalDate());
|
||||||
}
|
}
|
||||||
|
|
||||||
// 3️⃣ 构造查询时间范围
|
// 3️⃣ 构造查询时间范围
|
||||||
LocalDateTime startOfDay = today.with(LocalTime.MIN);
|
LocalDateTime startOfDay = LocalDateTime.from(userDate.get(0).with(LocalTime.MIN));
|
||||||
LocalDateTime endOfDay = today.with(LocalTime.MAX);
|
LocalDateTime endOfDay = LocalDateTime.from(userDate.get(1).with(LocalTime.MAX));
|
||||||
|
|
||||||
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