员工岗位可重新启用;调价认空运航线;会话存档跳号补拉;陆运报价按车型列回填

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
linmianxun
2026-10-28 19:48:47 +08:00
co-authored by Cursor
parent 2b528758b4
commit 56ba8e93b5
62 changed files with 2960 additions and 793 deletions
@@ -1427,6 +1427,64 @@ class SeaGroupCollabFieldTests(unittest.TestCase):
self.assertEqual(str(rows["增值费"].get("project") or ""), "起运港")
self.assertEqual(str(rows["增值费"].get("amount") or ""), "1000")
def test_air_origin_fee_unit_ci_keeps_qty_and_amount(self) -> None:
"""WO081:打板费单位「次」必须认出数量100/金额1000,不能落成数量1、金额=单价。"""
from agent.llm.extract_text import extract_product_quote
quote = extract_product_quote(
"@智价通AIQ 起运港,打板费,次,单价CNY10,数量100,金额CNY1000",
business_line="AIR",
)
rows = {str(x.get("name") or ""): x for x in (quote.get("fee_rows") or [])}
self.assertIn("打板费", rows)
self.assertEqual(str(rows["打板费"].get("unit") or ""), "次")
self.assertEqual(str(rows["打板费"].get("unit_price") or ""), "10")
self.assertEqual(str(rows["打板费"].get("quantity") or ""), "100")
self.assertEqual(str(rows["打板费"].get("amount") or ""), "1000")
self.assertEqual(str(rows["打板费"].get("project") or ""), "起运港")
def test_air_origin_fee_unit_ren_keeps_qty_and_amount(self) -> None:
"""单位「人」同样要能抽出数量与金额。"""
from agent.llm.extract_text import extract_product_quote
quote = extract_product_quote(
"起运港,人工费,人,单价CNY50,数量2,金额CNY100",
business_line="AIR",
)
rows = {str(x.get("name") or ""): x for x in (quote.get("fee_rows") or [])}
self.assertIn("人工费", rows)
self.assertEqual(str(rows["人工费"].get("unit") or ""), "人")
self.assertEqual(str(rows["人工费"].get("quantity") or ""), "2")
self.assertEqual(str(rows["人工费"].get("amount") or ""), "100")
def test_air_origin_fee_unit_slash_ci_ren(self) -> None:
"""单位表「次/人」整段保留,不能拆成只认「次」。"""
from agent.llm.extract_text import extract_product_quote
quote = extract_product_quote(
"起运港,操作费,次/人,单价CNY20,数量3,金额CNY60",
business_line="AIR",
)
rows = {str(x.get("name") or ""): x for x in (quote.get("fee_rows") or [])}
self.assertIn("操作费", rows)
self.assertEqual(str(rows["操作费"].get("unit") or ""), "次/人")
self.assertEqual(str(rows["操作费"].get("quantity") or ""), "3")
self.assertEqual(str(rows["操作费"].get("amount") or ""), "60")
def test_air_origin_fee_unit_hour_per_person(self) -> None:
"""单位表「小时/人」整段保留。"""
from agent.llm.extract_text import extract_product_quote
quote = extract_product_quote(
"起运港,仓储费,小时/人,单价CNY30,数量4,金额CNY120",
business_line="AIR",
)
rows = {str(x.get("name") or ""): x for x in (quote.get("fee_rows") or [])}
self.assertIn("仓储费", rows)
self.assertEqual(str(rows["仓储费"].get("unit") or ""), "小时/人")
self.assertEqual(str(rows["仓储费"].get("quantity") or ""), "4")
self.assertEqual(str(rows["仓储费"].get("amount") or ""), "120")
def test_fee_line_text_is_a_product_quote(self) -> None:
"""产品按行改价:码头操作费100CNY / 报关费改为300CNY,必须抽出费用名,不能只当海运费合计。"""
from agent.llm.extract_text import extract_product_quote