机器人显示名与站点标题可配;多段联运列表投影;协同群监听对账;工单附件落存;模板与工单后台补强

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
linmianxun
2026-10-19 09:41:59 +08:00
co-authored by Cursor
parent 277cdc1c28
commit 2b528758b4
119 changed files with 6760 additions and 3516 deletions
@@ -357,6 +357,91 @@ class AirRouteOptionsTests(unittest.TestCase):
self.assertNotIn("空运费", names)
self.assertEqual(copy.quote_fee_lines(projected)[0][0], "运输费")
def test_oms_top_fee_items_merged_when_cabin_only_has_surcharges(self) -> None:
"""OMS 表价:空运费在整单 feeItems,舱位只有增点/拆板时群摘要必须带上空运段。"""
quote = {
"total": "3334.0",
"currency": "CNY",
"remark": "空运报价来源:OMS空运表价;顶层价格为排序后的第一条直达航班方案",
"feeItems": [
{
"feeCode": "AIR_FREIGHT",
"feeName": "空运费",
"currency": "CNY",
"unit": "KG",
"unitPrice": 10.0,
"quantity": 333.4,
"amount": 3334.0,
}
],
"airOptions": [
{
"originAirportCode": "NKG",
"destinationAirportCode": "KUL",
"optionNo": "AIR-OPT01",
"salePrice": 3334.0,
"currency": "CNY",
"chargeableWeightKg": 333.4,
"departureCharges": [
{"chargeName": "增点费", "unit": "点", "currency": "CNY", "unitPrice": 100},
{"chargeName": "拆板费", "unit": "板数", "currency": "USD", "unitPrice": 100},
],
}
],
"valid_until": "2026-10-15",
}
facts = {"originCode": "NKG", "destinationCode": "KUL"}
projected = project_group_air_quote(quote, facts)
names = [str(x.get("name") or "") for x in (projected.get("fee_lines") or [])]
self.assertEqual(names, ["空运费", "增点费", "拆板费"])
brief = copy.air_group_brief(
work_order_no="WO202610150047",
facts=facts,
quote=quote,
collab_facts={},
has_price=True,
tms_quote=quote,
)
self.assertIn("空运费", brief)
self.assertIn("增点费", brief)
self.assertIn("拆板费", brief)
def test_oms_injects_air_freight_when_fee_items_missing(self) -> None:
"""落库后若顶层 feeItems 丢失,仅增点/拆板时仍用舱位总价补空运费。"""
quote = {
"total": "4303.0",
"currency": "CNY",
"remark": "空运报价来源:OMS空运表价;顶层价格为排序后的第一条直达航班方案",
"airOptions": [
{
"originAirportCode": "NKG",
"destinationAirportCode": "KUL",
"optionNo": "AIR-OPT01",
"salePrice": 4303.0,
"currency": "CNY",
"chargeableWeightKg": 333.4,
"departureCharges": [
{"chargeName": "增点费", "unit": "点", "currency": "CNY", "unitPrice": 100},
{"chargeName": "拆板费", "unit": "板数", "currency": "USD", "unitPrice": 100},
],
}
],
"valid_until": "2026-10-31",
}
facts = {"originCode": "NKG", "destinationCode": "KUL"}
projected = project_group_air_quote(quote, facts)
names = [str(x.get("name") or "") for x in (projected.get("fee_lines") or [])]
self.assertEqual(names[0], "空运费")
self.assertIn("增点费", names)
private = copy.sea_quote_detail_text(
work_order_no="WO202610170071",
quote=quote,
business_line="AIR",
facts=facts,
)
self.assertIn("空运费", private)
self.assertIn("价格方案如下", private)
def test_air_detail_text_hides_eta_keeps_valid_until(self) -> None:
"""空运没有时效;价格明细只留报价有效期。"""
text = copy.sea_quote_detail_text(