员工岗位可重新启用;调价认空运航线;会话存档跳号补拉;陆运报价按车型列回填

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
linmianxun
2026-10-28 19:48:47 +08:00
co-authored by Cursor
parent 2b528758b4
commit 56ba8e93b5
62 changed files with 2960 additions and 793 deletions
+5 -2
View File
@@ -117,11 +117,14 @@ def handle_card_action(
wo = copy.work_order_from_card_meta(payload)
code = str((payload or {}).get("response_code") or extra.get("response_code") or "")[:24]
msgtype = str(extra.get("msgtype") or "text")
# 文本 ack 按工单+动作去重;置灰更新仍带 code(每次 ResponseCode 只能用一次)
# 文本/方案卡按工单+动作+waitVersion 去重。
# 调价后再点「生成」时正文前缀相同,若不带 waitVersion,第二次方案卡会被 PG 唯一键吃掉,
# 价格卡已置灰成「已提交」但销售收不到生成 Excel/PDF 的方案卡。
wait_ver = int(getattr(sess, "wait_version", 0) or 0) if sess is not None else 0
if msgtype == "update_template_card":
dedupe_key = f"card-grey:{sender_id}:{wo}:{code}:{action}"
else:
dedupe_key = f"card-ack:{sender_id}:{wo}:{action}:{body[:24]}"
dedupe_key = f"card-ack:{sender_id}:{wo}:{action}:v{wait_ver}:{body[:24]}"
ok, info = msg_store.enqueue_outbound(
touser=sender_id,
content=body,