落地陆运私聊文字询价:选项核对后再建单查价,并按线路拉产品进群。
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -66,6 +66,7 @@ class MemoryLedger:
|
||||
]
|
||||
self.last_render: dict[str, Any] = {}
|
||||
self._sea_staff: list[dict[str, Any]] = []
|
||||
self._land_staff: list[dict[str, Any]] = []
|
||||
self._staff_by_wecom: dict[str, dict[str, Any]] = {}
|
||||
self._staff_by_name: dict[str, dict[str, Any]] = {}
|
||||
|
||||
@@ -355,6 +356,42 @@ class MemoryLedger:
|
||||
hits.append(dict(row))
|
||||
return hits
|
||||
|
||||
def set_land_staff(self, rows: list[dict[str, Any]]) -> None:
|
||||
"""单测注入陆运产品岗。"""
|
||||
with self._lock:
|
||||
self._land_staff = [dict(x) for x in rows]
|
||||
for row in self._land_staff:
|
||||
uid = str(row.get("wecomId") or row.get("wecom_id") or "").strip()
|
||||
name = str(row.get("name") or "").strip()
|
||||
if uid:
|
||||
self._staff_by_wecom[uid] = dict(row)
|
||||
if name:
|
||||
self._staff_by_name[name] = dict(row)
|
||||
|
||||
def match_land_staff(self, *, route_category: str) -> list[dict[str, Any]]:
|
||||
"""
|
||||
岗位=产品·陆运、启用:负责线路整词含本单线路类别才拉。
|
||||
不按斜杠切开「中港/中亚/中欧」。
|
||||
"""
|
||||
want = (route_category or "").strip()
|
||||
hits: list[dict[str, Any]] = []
|
||||
if not want:
|
||||
return hits
|
||||
with self._lock:
|
||||
for row in self._land_staff:
|
||||
if str(row.get("roleCode") or row.get("role_code") or "") != "land":
|
||||
continue
|
||||
if str(row.get("status") or "active") != "active":
|
||||
continue
|
||||
tokens = [
|
||||
p.strip()
|
||||
for p in str(row.get("routes") or "").replace(",", ",").replace("、", ",").split(",")
|
||||
if p.strip()
|
||||
]
|
||||
if want in tokens:
|
||||
hits.append(dict(row))
|
||||
return hits
|
||||
|
||||
def get_staff_by_wecom_id(self, *, wecom_id: str) -> dict[str, Any]:
|
||||
"""按企微 userid 取员工展示名。"""
|
||||
with self._lock:
|
||||
|
||||
Reference in New Issue
Block a user