机器人显示名与站点标题可配;多段联运列表投影;协同群监听对账;工单附件落存;模板与工单后台补强
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
"""
|
||||
主账内存假账本(单测 / 无 8180 时)。
|
||||
主账内存假账本(单测 / 无 8080 时)。
|
||||
|
||||
本文件职责:实现建单(每次新开)、相似检索、TMS fixture、报价写入、六态流转,语义对齐 Java 主账。
|
||||
禁止:冒充已打真实 TMS;禁止被生产 Worker 当默认 Owner(生产必须 HTTP 主账)。
|
||||
@@ -427,9 +427,11 @@ class MemoryLedger:
|
||||
quote: Optional[dict[str, Any]] = None,
|
||||
format: str = "xlsx",
|
||||
sales_wecom_id: str = "",
|
||||
persist_attachment: bool = False,
|
||||
) -> dict[str, Any]:
|
||||
"""
|
||||
按询价需求匹配内存模板。不填真实 xlsx,只回假字节供流程/单测。
|
||||
persist_attachment 与主账同语义:True 表示应登记附件(单测可断言 attachmentSaved)。
|
||||
"""
|
||||
from agent.quote_templates.match import FAIL_MESSAGE, pick_quote_template
|
||||
|
||||
@@ -459,6 +461,8 @@ class MemoryLedger:
|
||||
"fileBase64": "UEsDBAoAAAAAA",
|
||||
"needsPdf": False,
|
||||
"facts": dict(facts or {}),
|
||||
"attachmentSaved": bool(persist_attachment),
|
||||
"persistAttachmentRequested": bool(persist_attachment),
|
||||
}
|
||||
with self._lock:
|
||||
ticket = self._tickets.get((work_order_no or "").strip())
|
||||
@@ -745,6 +749,26 @@ class MemoryLedger:
|
||||
ticket.attachments.append(row)
|
||||
return {"ok": True, "file_name": file_name}
|
||||
|
||||
def attach_file_bytes(
|
||||
self,
|
||||
*,
|
||||
work_order_no: str,
|
||||
file_name: str,
|
||||
file_bytes: bytes,
|
||||
content_type: str = "",
|
||||
sender_id: str = "",
|
||||
) -> dict[str, Any]:
|
||||
"""单测:字节附件只记元数据,不写真实对象存储。"""
|
||||
_ = file_bytes
|
||||
key = f"memory/{work_order_no}/{file_name or 'file.bin'}"
|
||||
return self.attach_file(
|
||||
work_order_no=work_order_no,
|
||||
file_name=file_name,
|
||||
object_key=key,
|
||||
content_type=content_type,
|
||||
sender_id=sender_id,
|
||||
)
|
||||
|
||||
def upsert_product_quote(
|
||||
self,
|
||||
*,
|
||||
|
||||
Reference in New Issue
Block a user