feat: 在客户经理工作台突出退回项目

This commit is contained in:
NathanAlex7
2026-09-15 11:56:32 +08:00
parent 090e849a9a
commit 370ec46775
5 changed files with 20 additions and 3 deletions
+8 -2
View File
@@ -166,12 +166,18 @@ class ProjectAssistantService(DocumentsMixin, ExperiencesMixin):
project["submitted_at"] = submitted_at
project["review_started_at"] = project.get("review_started_at") or (review and review["started_at"])
project["review_wait_hours"] = self._hours(submitted_at, project["review_started_at"]) if submitted_at else None
project["review_state"] = "评审中" if project.get("reviewer_id") else "待领取" if submitted_at else "尚未送审"
decisions = listing(db, "review_decision", project["id"])
latest_return = next((item for item in decisions if item.get("decision") == "退回" and not item.get("finding_id") and not item.get("node_id")), None)
project["return_reason"] = (latest_return or {}).get("opinion", "")
project["returned_at"] = project.get("review_decided_at") or (latest_return or {}).get("updated_at")
project["review_state"] = "已退回" if project.get("workflow_state") == "returned" else "评审中" if project.get("reviewer_id") else "待领取" if submitted_at else "尚未送审"
runs = listing(db, "run", project["id"])
project["latest_run"] = self.public_run(runs[0]) if runs else None
project["open_findings"] = sum(f["status"] not in ("已解决", "不适用") for f in listing(db, "finding", project["id"]))
reports = listing(db, "report", project["id"])
if not runs:
if project.get("workflow_state") == "returned":
project["next_action"] = "查看退回要求并补充材料"
elif not runs:
project["next_action"] = "发起AI预审"
elif runs[0]["status"] in ("queued", "running"):
project["next_action"] = "查看预审进度"