chore: 保存进行中的未提交改动(企微定向推送+搜索筛选UI等)
保存合并前工作树中遗留的进行中改动,避免分支合并时丢失: - scheduler: 填报汇总改为定向推送给支局长/领导(而非广播@all) - router: JWT token 校验修复,bind token(UUID)不被误剥离 - 工作计划/计划列表: 搜索+筛选+分页 UI - 各列表 API 增加 search 参数支持 - docker-compose.backend.yml + backend/.dockerignore 纳入版本管理 Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -80,33 +80,33 @@ async def check_daily_reporting(db: AsyncSession) -> dict:
|
||||
f"📋 今日填报提醒\n\n{desc}\n未填报:{names_text}\n\n请尽快完成填报 🙏\nhttps://qj.dhdx.fun/m",
|
||||
)
|
||||
|
||||
# 2. Send summary to director
|
||||
# 2. Send summary to directors/leaders only (not broadcast to @all)
|
||||
directors = await db.execute(
|
||||
select(User).where(User.role.in_(["director", "leader"]), User.wecom_userid.isnot(None))
|
||||
)
|
||||
for d in directors.scalars().all():
|
||||
if managers:
|
||||
effective_total = len(managers) - len(on_leave_names)
|
||||
if effective_total > 0:
|
||||
pct = len(reported_map) / effective_total * 100
|
||||
else:
|
||||
pct = 100.0
|
||||
leave_note = ""
|
||||
if on_leave_names:
|
||||
leave_note = f"\n> 请假中(已豁免):{len(on_leave_names)}人\n"
|
||||
leave_note += "".join(f"- {n} (请假)\n" for n in on_leave_names)
|
||||
summary = (
|
||||
f"## 📊 今日填报汇总\n\n"
|
||||
f"> 日期:{today}\n"
|
||||
f"> 填报率:**{pct:.0f}%** ({len(reported_map)}/{effective_total})\n"
|
||||
)
|
||||
if leave_note:
|
||||
summary += leave_note + "\n"
|
||||
if not_reported:
|
||||
summary += "**未填报:**\n" + "".join(f"- {m.name}\n" for m in not_reported)
|
||||
else:
|
||||
summary += "✅ 全体已完成今日填报"
|
||||
await wecom_client.send_markdown_message(summary) # broadcast for director visibility
|
||||
director_ids = [d.wecom_userid for d in directors.scalars().all()]
|
||||
if managers and director_ids:
|
||||
effective_total = len(managers) - len(on_leave_names)
|
||||
if effective_total > 0:
|
||||
pct = len(reported_map) / effective_total * 100
|
||||
else:
|
||||
pct = 100.0
|
||||
leave_note = ""
|
||||
if on_leave_names:
|
||||
leave_note = f"\n> 请假中(已豁免):{len(on_leave_names)}人\n"
|
||||
leave_note += "".join(f"- {n} (请假)\n" for n in on_leave_names)
|
||||
summary = (
|
||||
f"## 📊 今日填报汇总\n\n"
|
||||
f"> 日期:{today}\n"
|
||||
f"> 填报率:**{pct:.0f}%** ({len(reported_map)}/{effective_total})\n"
|
||||
)
|
||||
if leave_note:
|
||||
summary += leave_note + "\n"
|
||||
if not_reported:
|
||||
summary += "**未填报:**\n" + "".join(f"- {m.name}\n" for m in not_reported)
|
||||
else:
|
||||
summary += "✅ 全体已完成今日填报"
|
||||
await wecom_client.send_markdown_message(summary, user_ids=director_ids)
|
||||
|
||||
return {
|
||||
"status": "ok",
|
||||
|
||||
Reference in New Issue
Block a user