feat: 仪表盘+催办在休息日跳过填报检查

- 新增 is_working_day() 工具函数,自动跳过周末 + 可配置法定假日
- 仪表盘填报进度新增 is_rest_day 字段,休息日显示灰「休」印章
- 催办调度改用 is_working_day() 替代原始 weekday 检查
- 系统设置新增「法定节假日」配置卡片,支局长可管理假日日期

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
2026-07-12 14:13:32 +08:00
parent dcb0b826de
commit a63bd6874c
6 changed files with 129 additions and 14 deletions
+18
View File
@@ -11,3 +11,21 @@ def today_cst() -> date:
def parse_date(s: str) -> date:
"""Parse a date string that may be YYYY-MM-DD or a full ISO datetime."""
return date.fromisoformat(s[:10])
def is_working_day(d: date | None = None, holidays: set[date] | None = None) -> bool:
"""Check if a date is a Chinese working day.
Returns False for:
- Saturdays and Sundays (weekday >= 5)
- Dates in the holidays set (configurable via system_config)
Note: makeup workdays (调休, where Saturday/Sunday becomes a workday)
are not currently handled. If needed, add a 'workdays' config set.
"""
d = d or today_cst()
if d.weekday() >= 5: # Saturday or Sunday
return False
if holidays and d in holidays:
return False
return True