fix: 报告进度只算中期产出 + 移除无效日报接收人
All checks were successful
Build and Deploy Backend / build-and-deploy (push) Successful in 4m11s
Build and Deploy Web / build-and-deploy (push) Successful in 2m52s

- 日报/周报进度从 total_submitted_seconds 改为只算 PRODUCTION 阶段
  (修复魔法少女 398%→118% 等虚高问题)
- 移除日报接收人 17762840667(飞书发送失败)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
seaislee1209 2026-03-05 21:51:36 +08:00
parent 6361c94204
commit bc9fa5a798
2 changed files with 15 additions and 7 deletions

View File

@ -15,6 +15,6 @@ FEISHU_APP_ID=cli_a90478156bf85bd7
FEISHU_APP_SECRET=87N2nnx6Yv56TPjl2GraLdKOjFiGOSGp FEISHU_APP_SECRET=87N2nnx6Yv56TPjl2GraLdKOjFiGOSGp
# 日报接收人手机号(主管+组长+制片+股东) # 日报接收人手机号(主管+组长+制片+股东)
DAILY_REPORT_RECEIVERS=18002277047,13811803069,13636518028,13811126887,19521028015,13570527019,15920585849,17762840667,17798147128,13726331058,13751770010,18826166683 DAILY_REPORT_RECEIVERS=18002277047,13811803069,13636518028,13811126887,19521028015,13570527019,15920585849,17798147128,13726331058,13751770010,18826166683
# 周报/月报接收人手机号(含成本信息,仅股东+主管) # 周报/月报接收人手机号(含成本信息,仅股东+主管)
REPORT_RECEIVERS=18002277047,13811803069,13636518028,13811126887 REPORT_RECEIVERS=18002277047,13811803069,13636518028,13811126887

View File

@ -93,10 +93,14 @@ def generate_daily_report(db: Session) -> dict:
projects_data = [] projects_data = []
for p in active_projects: for p in active_projects:
waste = calc_waste_for_project(p.id, db) # 只用中期产出算进度(与项目详情页一致)
total_secs = waste.get("total_submitted_seconds", 0) prod_secs = db.query(sa_func.sum(Submission.total_seconds)).filter(
Submission.project_id == p.id,
Submission.total_seconds > 0,
Submission.project_phase == PhaseGroup.PRODUCTION,
).scalar() or 0
target = p.target_total_seconds target = p.target_total_seconds
progress = round(total_secs / target * 100, 1) if target > 0 else 0 progress = round(prod_secs / target * 100, 1) if target > 0 else 0
proj_today_secs = sum( proj_today_secs = sum(
s.total_seconds for s in today_subs s.total_seconds for s in today_subs
@ -191,10 +195,14 @@ def generate_weekly_report(db: Session) -> dict:
projects_data = [] projects_data = []
for p in active_projects: for p in active_projects:
waste = calc_waste_for_project(p.id, db) # 只用中期产出算进度(与项目详情页一致)
total_secs = waste.get("total_submitted_seconds", 0) prod_secs = db.query(sa_func.sum(Submission.total_seconds)).filter(
Submission.project_id == p.id,
Submission.total_seconds > 0,
Submission.project_phase == PhaseGroup.PRODUCTION,
).scalar() or 0
target = p.target_total_seconds target = p.target_total_seconds
progress = round(total_secs / target * 100, 1) if target > 0 else 0 progress = round(prod_secs / target * 100, 1) if target > 0 else 0
proj_week_secs = sum( proj_week_secs = sum(
s.total_seconds for s in week_subs s.total_seconds for s in week_subs