陆运多条线路按段展示 TMS 费用名和时效,选定后再写回该条成本。

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-09-22 18:28:29 +08:00
co-authored by Cursor
parent e769eb9c1d
commit 49faa35f47
23 changed files with 2323 additions and 55 deletions
+16 -13
View File
@@ -280,7 +280,7 @@ class AirTextInquiryTests(unittest.TestCase):
self.assertIn(copy.BTN_SKIP_COLLAB, joined)
self.assertIn("价格明细", joined)
self.assertIn("总销售价", joined)
self.assertIn("时效:", joined)
self.assertNotIn("时效:", joined)
self.assertIn("报价有效期:", joined)
self.assertNotIn("相同询价内容检索", joined)
self.assertNotIn("引用历史工单号", joined)
@@ -324,7 +324,7 @@ class AirTextInquiryTests(unittest.TestCase):
)
rows = {x["keyname"]: x["value"] for x in card["horizontal_content_list"]}
self.assertIn("2.5", rows["货物"])
self.assertEqual(rows["时效"], "3-5 天")
self.assertNotIn("时效", rows)
self.assertNotIn("sub_title_text", card)
n = len(self.replies)
again = self.flow.on_button(
@@ -346,6 +346,7 @@ class AirTextInquiryTests(unittest.TestCase):
self.assertTrue(str(follow.get("task_id") or "").startswith("deal-"))
deal_rows = {r["keyname"]: r["value"] for r in follow.get("horizontal_content_list") or []}
self.assertIn("总销售价", deal_rows)
self.assertNotIn("时效", deal_rows)
self.assertNotIn("历史报价", deal_rows)
self.assertNotIn("工单状态", deal_rows)
self.assertNotIn("来源", deal_rows)
@@ -829,7 +830,7 @@ class AirTextInquiryTests(unittest.TestCase):
self.assertEqual(copy.money_text("14669.60", ""), "14669.60")
self.assertNotIn(copy.collab_hint("WO202609140001"), quote_text)
sub = card["sub_title_text"]
self.assertIn("时效:3-5 天", sub)
self.assertNotIn("时效", sub)
self.assertIn("报价有效期:2026-09-20", sub)
self.assertNotIn("相同询价内容检索", sub)
self.assertNotIn("引用历史工单号", sub)
@@ -866,6 +867,7 @@ class AirTextInquiryTests(unittest.TestCase):
self.assertIn("空运费:USD 1250.00", text)
self.assertIn("总销售价:CNY 142998.53", text)
self.assertNotIn("时效", text)
self.assertIn("报价有效期:2026-09-30", text)
card_text = copy.quote_area_safe_text(long_quote, business_line="AIR")
self.assertIn("总销售价:CNY 142998.53", card_text)
self.assertIn("详见上一条明细", card_text)
@@ -985,7 +987,7 @@ class AirTextInquiryTests(unittest.TestCase):
self.assertIn("起运地:上海", text)
self.assertIn("体积:2.5", text)
self.assertIn("空运费:USD 1,200", text)
self.assertIn("时效:3-5 天", text)
self.assertNotIn("时效", text)
self.assertIn("报价有效期:2026-09-20", text)
self.assertNotIn("报价日期:", text)
self.assertNotIn("工单状态", text)
@@ -1015,20 +1017,20 @@ class AirTextInquiryTests(unittest.TestCase):
self.assertEqual(rows["航线"], "空运SHA→LAX")
self.assertIn("普货", rows["货物"])
self.assertIn("2.5", rows["货物"])
self.assertEqual(rows["时效"], "3-5 天")
self.assertNotIn("时效", rows)
self.assertEqual(rows["报价有效期"], "2026-09-20")
self.assertNotIn("报价日期", rows)
empty_eta = copy.scheme_horizontal_rows(
work_order_no="WO1", facts=COMPLETE_AIR, quote={"valid_until": "2026-09-20"}
)
self.assertEqual({x["keyname"]: x["value"] for x in empty_eta}["时效"], "-")
self.assertNotIn("时效", {x["keyname"] for x in empty_eta})
dashed = copy.scheme_horizontal_rows(
work_order_no="WO1",
facts=COMPLETE_AIR,
quote={"eta": "-3-5 天", "valid_until": "2026-09-20"},
)
dashed_rows = {x["keyname"]: x["value"] for x in dashed}
self.assertEqual(dashed_rows["时效"], "3-5 天")
self.assertNotIn("时效", dashed_rows)
self.assertEqual(len(card["button_list"]), 3)
self.assertEqual(
[x["text"] for x in card["button_list"]],
@@ -1060,8 +1062,7 @@ class AirTextInquiryTests(unittest.TestCase):
self.assertIn("报价单已发送,请跟进成交状态", text)
self.assertIn("咨询成交状态:请选择成交 / 未成交 / 协商中(未成交需补充原因)。", text)
self.assertIn("总销售价:CNY 722.5", text)
self.assertIn("时效:2天", text)
self.assertNotIn("时效(要求/TMS)", text)
self.assertNotIn("时效", text)
self.assertNotIn("- / -", text)
self.assertIn("报价有效期:2026-08-24", text)
self.assertNotIn("历史报价", text)
@@ -1081,7 +1082,6 @@ class AirTextInquiryTests(unittest.TestCase):
rows,
{
"总销售价": "CNY 722.5",
"时效": "2天",
"报价有效期": "2026-08-24",
},
)
@@ -1102,10 +1102,13 @@ class AirTextInquiryTests(unittest.TestCase):
self.assertEqual(copy.canonical_button("negotiate:WO202608210017"), copy.BTN_NEGOTIATE)
empty_rows = {
x["keyname"]: x["value"]
for x in copy.deal_horizontal_rows(quote={"total": "-", "valid_until": "-"})
for x in copy.deal_horizontal_rows(
quote={"total": "-", "valid_until": "-"},
business_line="AIR",
)
}
self.assertEqual(empty_rows["时效"], "-")
self.assertNotEqual(empty_rows["时效"], "- / -")
self.assertNotIn("时效", empty_rows)
self.assertEqual(empty_rows["报价有效期"], "-")
def test_same_demand_cites_latest_even_if_closed(self) -> None:
ledger = MemoryLedger()