feat(backend): 生产总天数返回自然天+工作日两个口径

- ProductResponse 加 production_days(自然天)/production_days_workdays(工作日)
- get_all_products 计算:自然天自创建至今,工作日用 working_duration_hours 排除周末/节假日
- FlowDevice 加 total_days/total_workdays(设备生产总天数,自最早介入至今)
This commit is contained in:
2026-08-28 15:28:56 +08:00
parent 451e24c34c
commit b09187ac6e
3 changed files with 46 additions and 0 deletions

View File

@ -63,6 +63,9 @@ class ProductResponse(BaseModel):
latest_record_assignee_name: str | None = None
# 🔧 当前人滞留时长 — 活跃任务(WIP/PENDING)最早接手时间到现在的时长(小时)
active_duration_hours: float | None = None
# 🔧 生产总天数(自创建至今)
production_days: int = 0 # 自然天
production_days_workdays: int = 0 # 工作日(排除周末/节假日)
model_config = {"from_attributes": True}