陆运补问把货物品名放进选项清单,并按销售原文回显已填项。
空着的运输分类不再被菜单第一项认成已填。空运报价改为货物信息加价格方案,锁舱成功回执补起运地、目的地、航司和航班日期。 Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -69,6 +69,42 @@ def _ticket_flight_date(ticket: object) -> str:
|
||||
).strip()
|
||||
|
||||
|
||||
def _lock_receipt_fields(
|
||||
ticket: object,
|
||||
quote: dict[str, Any],
|
||||
option_no: str,
|
||||
airline: str,
|
||||
) -> tuple[str, str, str, str]:
|
||||
"""
|
||||
锁舱成功回执的起运地、目的地、航司、航班日期。
|
||||
|
||||
优先级与主账出站一致:舱位三字码/航班日优先,没有再用工单事实。
|
||||
航司用本次实际锁出去的两位码。不编造。
|
||||
"""
|
||||
from agent.schema.air_route_options import airport_code_for_display, option_flight_date
|
||||
|
||||
row = _option_row(quote, option_no) or _selected_cabin_row(quote) or {}
|
||||
facts = dict(ticket_view(ticket).get("facts") or {})
|
||||
origin = airport_code_for_display(
|
||||
str(row.get("originAirportCode") or row.get("origin") or facts.get("originCode") or ""),
|
||||
str(facts.get("起运地") or facts.get("起运港") or ""),
|
||||
)
|
||||
destination = airport_code_for_display(
|
||||
str(
|
||||
row.get("destinationAirportCode")
|
||||
or row.get("destination")
|
||||
or facts.get("destinationCode")
|
||||
or ""
|
||||
),
|
||||
str(facts.get("目的地") or facts.get("目的港") or ""),
|
||||
)
|
||||
airline_text = (airline or "").strip().upper()
|
||||
if not airline_text:
|
||||
airline_text = str(row.get("airlineCode") or row.get("airline") or "").strip().upper()
|
||||
flight_date = option_flight_date(row) or _ticket_flight_date(ticket)
|
||||
return origin, destination, airline_text, flight_date
|
||||
|
||||
|
||||
def is_airline(flow: Any, sender_id: str) -> bool:
|
||||
"""员工管理岗位=航线·空运且启用。"""
|
||||
uid = (sender_id or "").strip()
|
||||
@@ -1001,6 +1037,9 @@ def apply_air_lock(
|
||||
flight_no=flight_no,
|
||||
instruction=instruction,
|
||||
)
|
||||
origin, destination, airline_label, flight_date = _lock_receipt_fields(
|
||||
ticket, quote, picked, air_code
|
||||
)
|
||||
missing = _missing_lock_labels(picked, air_code, flight)
|
||||
if missing and _quote_ready_for_lock(quote):
|
||||
_remember_partial_lock(
|
||||
@@ -1119,12 +1158,14 @@ def apply_air_lock(
|
||||
conversation_target=chat_id,
|
||||
extra={
|
||||
"option_no": picked,
|
||||
"airline": air_code,
|
||||
"airline": airline_label or air_code,
|
||||
"flight_no": flight,
|
||||
"instruction": instruction,
|
||||
"sender_id": sender_id,
|
||||
"operator_name": name,
|
||||
"flight_date": _ticket_flight_date(ticket),
|
||||
"flight_date": flight_date,
|
||||
"origin": origin,
|
||||
"destination": destination,
|
||||
},
|
||||
),
|
||||
ledger=flow.ledger,
|
||||
@@ -1155,6 +1196,10 @@ def apply_air_lock(
|
||||
option_no=picked,
|
||||
exec_no=exec_no,
|
||||
quote_no=quote_no,
|
||||
origin=origin,
|
||||
destination=destination,
|
||||
airline=airline_label,
|
||||
flight_date=flight_date,
|
||||
),
|
||||
)
|
||||
from agent.policy.system_exception import clear_system_exception, ticket_is_paused
|
||||
|
||||
Reference in New Issue
Block a user