|
@@ -13,6 +13,7 @@ import org.springframework.stereotype.Component;
|
|
|
import javax.annotation.Resource;
|
|
|
import java.time.DayOfWeek;
|
|
|
import java.time.LocalDate;
|
|
|
+import java.time.format.DateTimeFormatter;
|
|
|
import java.util.concurrent.TimeUnit;
|
|
|
|
|
|
/**
|
|
@@ -67,8 +68,17 @@ public class HolidayUtil {
|
|
|
}
|
|
|
|
|
|
// 是否法定假期
|
|
|
- if (holiday.contains(now + "")){
|
|
|
- return true;
|
|
|
+ String nowStr = now + "";
|
|
|
+ if (holiday.contains(nowStr)){
|
|
|
+
|
|
|
+ // 判断是否要节后补班
|
|
|
+ String dayKey = now.format(DateTimeFormatter.ofPattern("MM-dd"));
|
|
|
+ log.info("dayKey:{}", dayKey);
|
|
|
+ JSONObject resJson = JSONObject.parseObject(holiday);
|
|
|
+ // 2023-06-25
|
|
|
+ JSONObject dayJson = resJson.getJSONObject("holiday").getJSONObject(dayKey);
|
|
|
+ log.info("{}今天详情:{}", now, dayJson);
|
|
|
+ return dayJson.getBooleanValue("holiday");
|
|
|
}
|
|
|
|
|
|
// 是否周末
|
|
@@ -98,6 +108,8 @@ public class HolidayUtil {
|
|
|
// 获取当前日期
|
|
|
LocalDate date = LocalDate.now();
|
|
|
|
|
|
+ System.out.println(date.format(DateTimeFormatter.ofPattern("MM-dd")));
|
|
|
+
|
|
|
DayOfWeek dayOfWeek = date.getDayOfWeek();
|
|
|
|
|
|
System.out.println("11111111111111111");
|