落地陆运群内协同:按填写样例拉群并只列本单协同项,进群把私聊已抽到的字段带上。

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-09-18 13:38:02 +08:00
co-authored by Cursor
parent be95d823a2
commit 982b3a2317
25 changed files with 1451 additions and 315 deletions
+21 -1
View File
@@ -514,6 +514,24 @@ class SeaTextInquiryFlow(AirTextInquiryFlow):
product_ids=product_ids,
)
from agent.schema.field_validate import collab_fields_for_ticket, pick_collab_from_facts
line = (sess.business_line or "SEA").upper()
keys = collab_fields_for_ticket(sess.facts, line)
seeded = pick_collab_from_facts(sess.facts, keys)
if seeded:
merged = dict(sess.collab_facts or {})
for k, v in seeded.items():
if v and not str(merged.get(k) or "").strip():
merged[k] = v
sess.collab_facts = merged
self.apply_collab_facts(
work_order_no=no,
facts=seeded,
sender_id=sess.sender_id,
allowed_keys=keys,
)
brief = copy.sea_group_brief(
work_order_no=no,
facts=sess.facts,
@@ -638,6 +656,7 @@ class SeaTextInquiryFlow(AirTextInquiryFlow):
work_order_no: str,
facts: dict[str, str],
sender_id: str,
allowed_keys: tuple[str, ...] | None = None,
) -> dict[str, Any]:
"""
群里静默写入协同字段。不改六态、不回复、不出报价版本。
@@ -647,10 +666,11 @@ class SeaTextInquiryFlow(AirTextInquiryFlow):
from agent.schema.field_validate import SEA_COLLAB_FIELDS
no = (work_order_no or "").strip()
keys = tuple(allowed_keys) if allowed_keys is not None else SEA_COLLAB_FIELDS
cleaned = {
k: str(v).strip()
for k, v in (facts or {}).items()
if k in SEA_COLLAB_FIELDS and str(v or "").strip()
if k in keys and str(v or "").strip()
}
if not no or not cleaned:
return {"ok": False, "updated": []}