落地销售调价:按自然语言改价并单独记销售价,拉群和后台不再把调后价当成 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
+21 -7
View File
@@ -408,14 +408,28 @@ class HttpLedger:
work_order_no: str,
quote: dict[str, Any],
to_status: str = "已报价",
remark: str = "",
kind: str = "",
) -> dict[str, Any]:
"""产品报价写入主账并迁已报价。"""
"""
手工报价 / 销售调价写入主账新版本。
幂等键带合计和备注,避免连续调价被同一把钥匙吞掉。
"""
src = dict(quote or {})
note = (remark or "").strip()
body: dict[str, Any] = {
"workOrderNo": work_order_no,
"quote": src,
"toStatus": to_status,
}
if note:
body["remark"] = note
if (kind or "").strip():
body["kind"] = kind.strip()
sig = f"{src.get('total') or ''}|{note}|{kind or ''}|{len(src.get('fee_rows') or src.get('fee_lines') or [])}"
return self._post(
"/inquiry/agent/ticket/upsertProductQuote",
{
"workOrderNo": work_order_no,
"quote": quote,
"toStatus": to_status,
},
idem=f"product-quote:{work_order_no}:{sorted((quote or {}).keys())}",
body,
idem=f"manual-quote:{work_order_no}:{sig}",
)