落地多段联运私聊:齐了才建单拉群,附件只收格子值,核对改正不再整单重开。

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-09-23 15:08:15 +08:00
co-authored by Cursor
parent 6e3e09a316
commit 2334524bb8
30 changed files with 4033 additions and 40 deletions
@@ -68,6 +68,45 @@ class AttachWaveTests(unittest.TestCase):
oral = self.book.compose_oral("s1")
self.assertEqual(oral, "开口字\n海运 宁波到汉堡\n空运 上海到纽约\n只要40尺")
def test_empty_land_quote_sheet_still_makes_multi_with_sea(self) -> None:
"""陆运报价单被整理成空时,仍要按文件名留陆运段,不能只剩海运。"""
from agent.policy.multi_segments import classify_multi_text
self.book.open_wait("s1", precede_text="", token="tok1", now=1.0)
self.book.add_files(
"s1",
["WO202608240017_陆运报价单(1).xlsx", "手工报价海运.xlsx"],
now=2.0,
)
self.book.complete_material("s1", 0, text="")
self.book.complete_material(
"s1",
1,
text="运输方式:海运\n起运港:纽约港\n目的港:巴生西港",
)
oral = self.book.compose_oral("s1")
self.assertIn("陆运", oral)
self.assertIn("海运", oral)
self.assertIn("纽约港", oral)
self.assertEqual(classify_multi_text(oral), "multi")
def test_ltl_filename_counts_as_land_segment(self) -> None:
"""零担询价表文件名没有「陆运」二字,也要和海运表切成两段。"""
from agent.policy.multi_segments import classify_multi_text
self.book.open_wait("s1", precede_text="", token="tok1", now=1.0)
self.book.add_files(
"s1",
["东莞-上海 整车及零担 询价.xlsx", "手工海运报价单.xlsx"],
now=2.0,
)
self.book.complete_material("s1", 0, text="始发站:东莞\n目的站:上海")
self.book.complete_material("s1", 1, text="起运港:宁波港")
oral = self.book.compose_oral("s1")
self.assertIn("陆运", oral)
self.assertIn("海运", oral)
self.assertEqual(classify_multi_text(oral), "multi")
def test_after_business_done_not_active(self) -> None:
self.book.open_wait("s1", precede_text="", token="tok1", now=1.0)
self.book.add_files("s1", ["a.xlsx"], now=2.0)