销售侧汇总统一叫费用合计,并认准空运费的金额。

企微跳转改为账号密码登录,报价卡上的费用按原金额改回;航线按单价数量金额报价时不再记成海运费。

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-09-24 11:15:33 +08:00
co-authored by Cursor
parent 84207bb4e5
commit 4dfd756bcf
24 changed files with 778 additions and 150 deletions
+43 -6
View File
@@ -210,8 +210,8 @@ class AirGroupCollabTests(unittest.TestCase):
tms_quote=tms,
)
tms_block = text.split("TMS报价:", 1)[1]
self.assertEqual(tms_block.count("总销售价:"), 1)
self.assertIn("总销售价:CNY 183370.0", tms_block)
self.assertEqual(tms_block.count("费用合计:"), 1)
self.assertIn("费用合计:CNY 183370.0", tms_block)
self.assertNotIn("时效", tms_block)
self.assertIn("报价有效期:2026-09-30", tms_block)
self.assertIn("请航线人员回复“确认报价”确定采用TMS报价。", text)
@@ -266,8 +266,8 @@ class AirGroupCollabTests(unittest.TestCase):
self.assertIn("运输费:CNY 11.0", tms_block)
self.assertIn("提送货费:CNY 6.0", tms_block)
self.assertIn("人工费:CNY 123.0", tms_block)
self.assertIn("总销售价:CNY 183370", tms_block)
self.assertEqual(tms_block.count("总销售价:"), 1)
self.assertIn("费用合计:CNY 183370", tms_block)
self.assertEqual(tms_block.count("费用合计:"), 1)
self.assertNotIn("空运费", tms_block)
def test_air_group_brief_multi_route_does_not_borrow_other_air_freight(self) -> None:
@@ -312,8 +312,45 @@ class AirGroupCollabTests(unittest.TestCase):
tms_block = text.split("TMS报价:", 1)[1]
self.assertNotIn("空运费", tms_block)
self.assertNotIn("运输费", tms_block)
self.assertIn("总销售价:CNY 200040", tms_block)
self.assertEqual(tms_block.count("总销售价:"), 1)
self.assertIn("费用合计:CNY 200040", tms_block)
self.assertEqual(tms_block.count("费用合计:"), 1)
def test_work_order_plus_lost_reason_is_deal_not_activate(self) -> None:
"""WO@助手 未成交,原因… 必须当关单,不能只激活。"""
from agent.routing.air_group_intent import INTENT_ACTIVATE, INTENT_LOST
text = "WO202609220014@询价小助手 未成交,原因客户不想送货了"
self.assertEqual(classify_air_group_text(text, allow_network=False), INTENT_LOST)
from unittest.mock import patch
with patch(
"agent.routing.air_group_intent._classify_with_model",
return_value=INTENT_ACTIVATE,
):
self.assertEqual(
classify_air_group_text(text, allow_network=True),
INTENT_LOST,
)
def test_activate_lost_and_reason_same_message(self) -> None:
wo = self._create_air()
phase = handle_air_group(
self._msg(
sender="sales1",
text=f"{wo}@询价小助手 未成交,原因客户不想送货了",
chat="wr_air_1",
mid="lost-inline-wo",
),
flow=self.flow,
ledger=self.ledger,
)
self.assertEqual(phase, "done")
ticket = self.ledger.get_ticket(work_order_no=wo)
self.assertEqual(ticket.status, "未成交")
self.assertEqual(ticket.lost_reason, "客户不想送货了")
joined = "\n".join(self._texts())
self.assertIn("客户不想送货了", joined)
self.assertNotIn("请补充未成交原因", joined)
def test_work_order_only_is_activate_not_quote(self) -> None:
from agent.routing.air_group_intent import INTENT_ACTIVATE