落地空运群内协同与锁舱出站。

群里按 BOT 通道激活当前工单、航线报价和成交跟进;没有 TMS 报价编号时用工单字段补齐仍调锁舱,避免被本地规则拦住。

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-09-16 17:25:42 +08:00
co-authored by Cursor
parent 12219cacb1
commit d9029dec89
62 changed files with 6772 additions and 159 deletions
+58
View File
@@ -219,6 +219,14 @@ class HttpLedger:
return out
return {}
def list_staff_by_role(self, *, role_code: str) -> list[dict[str, Any]]:
"""按岗位列出启用员工。空运群 @ 航线。"""
out = self._post("/inquiry/agent/staff/listByRole", {"roleCode": role_code})
rows = out.get("staff") or out.get("result") or []
if isinstance(rows, list):
return [dict(x) for x in rows if isinstance(x, dict)]
return []
def find_staff_by_name(self, *, name: str) -> dict[str, Any]:
"""按后台员工姓名取企微 userid。会话存档账号「询价机器人」走这里。"""
out = self._post("/inquiry/agent/staff/byName", {"name": name})
@@ -266,6 +274,56 @@ class HttpLedger:
idem=f"collab-facts:{work_order_no}:{sorted(facts)}",
)
def activate_air_group(self, *, chat_id: str, work_order_no: str) -> dict[str, Any]:
"""空运群激活/切换当前工单。一单一群。"""
return self._post(
"/inquiry/agent/ticket/activateAirGroup",
{"chatId": chat_id, "workOrderNo": work_order_no},
idem=f"air-activate:{chat_id}:{work_order_no}",
)
def lock_cabin(
self,
*,
work_order_no: str,
option_no: str,
sender_id: str = "",
operator_name: str = "",
instruction_text: str = "",
) -> dict[str, Any]:
return self._post(
"/inquiry/agent/tms/lockCabin",
{
"workOrderNo": work_order_no,
"optionNo": option_no,
"operatorUserId": sender_id,
"operatorName": operator_name,
"instructionText": instruction_text,
},
idem=f"air-lock:{work_order_no}:{option_no}",
)
def release_cabin(
self,
*,
work_order_no: str,
lock_id: str,
sender_id: str = "",
operator_name: str = "",
instruction_text: str = "",
) -> dict[str, Any]:
return self._post(
"/inquiry/agent/tms/releaseCabin",
{
"workOrderNo": work_order_no,
"lockId": lock_id,
"operatorUserId": sender_id,
"operatorName": operator_name,
"instructionText": instruction_text,
},
idem=f"air-release:{work_order_no}:{lock_id}",
)
def find_by_collab_chat(self, *, chat_id: str) -> dict[str, Any] | None:
"""用协同群 chat_id 找回工单。对不上返回 None。"""
out = self._post("/inquiry/agent/ticket/byCollabChat", {"chatId": chat_id})