落地销售调价:按自然语言改价并单独记销售价,拉群和后台不再把调后价当成 TMS 原价。

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-09-20 14:40:20 +08:00
co-authored by Cursor
parent e4743541f7
commit 26dd5d72a1
36 changed files with 2795 additions and 176 deletions
@@ -42,6 +42,7 @@ class FlowSession:
first_or_same: str = "first"
history_work_order_no: str = ""
quote: dict[str, Any] = field(default_factory=dict)
tms_quote: dict[str, Any] = field(default_factory=dict)
status: str = ""
allowed: tuple[str, ...] = ()
immutable_text: str = ""
@@ -78,6 +79,7 @@ def _session_from_payload(raw: dict[str, Any]) -> FlowSession:
first_or_same=str(raw.get("first_or_same") or "first"),
history_work_order_no=str(raw.get("history_work_order_no") or ""),
quote=dict(raw.get("quote") or {}),
tms_quote=dict(raw.get("tms_quote") or raw.get("tmsQuote") or {}),
status=str(raw.get("status") or ""),
allowed=tuple(str(x) for x in (raw.get("allowed") or ())),
immutable_text=str(raw.get("immutable_text") or ""),
@@ -480,6 +482,12 @@ class AirTextInquiryFlow:
and not (injected_facts and injected_mode)
):
return self._capture_lost_reason(sess, text, reply)
if sess:
from agent.policy.quote_adjust_ops import try_private_adjust
adjusted = try_private_adjust(self, sess, text, reply)
if adjusted:
return adjusted
snap = extract_inquiry_snapshot(
text,
@@ -661,6 +669,7 @@ class AirTextInquiryFlow:
self._save(sess)
return "ledger_fail"
sess.quote = quote
copy.remember_tms_quote(sess, quote)
sess.status = "已报价"
sess.phase = "wait_collab"
sess.allowed = (copy.BTN_SKIP_COLLAB,)
@@ -966,6 +975,7 @@ class AirTextInquiryFlow:
work_order_no=sess.work_order_no,
quote=sess.quote,
facts=sess.facts,
business_line=sess.business_line or "AIR",
).get("template_card") or {}
reply(
"\n".join(
@@ -978,6 +988,7 @@ class AirTextInquiryFlow:
status=sess.status or "已报价",
quote=sess.quote,
facts=sess.facts,
business_line=sess.business_line or "AIR",
),
]
),
@@ -1003,11 +1014,13 @@ class AirTextInquiryFlow:
status=sess.status or "已报价",
quote=sess.quote,
facts=sess.facts,
business_line=sess.business_line or "AIR",
),
copy.deal_wecom_payload(
work_order_no=sess.work_order_no,
quote=sess.quote,
facts=sess.facts,
business_line=sess.business_line or "AIR",
),
)