修复(履约绑定): 收敛活动别名中的瞬时历史角色
This commit is contained in:
@@ -211,18 +211,43 @@ def build_binding_evidence(
|
||||
action_pending_role = (
|
||||
_text((action_pending or {}).get("roleName")) if action_pending else ""
|
||||
)
|
||||
legacy_role = _text((legacy_latest or {}).get("roleName"))
|
||||
action_alias_has_role = any(
|
||||
item["alias"] in action_aliases and item["roleName"]
|
||||
for item in candidates
|
||||
)
|
||||
account_current_role = _text(account.game_name) if account is not None else ""
|
||||
# scannedRole 只认“本次新扫码”:
|
||||
# - 新 pending(QYOOB bindAct=0 / 可确认角色);
|
||||
# - legacy(cjm) 上出现的扫码角色;
|
||||
# - decision 明确可确认时的角色。
|
||||
# 不能用 result.role_name / before_bind_info 的 baseline 兜底,否则会把
|
||||
# 账号上一单的旧角色误报成本次扫码,详情就会和列表的“待扫码”冲突。
|
||||
decision_role = (
|
||||
_text(decision.get("role_name"))
|
||||
if decision.get("confirmable")
|
||||
and (
|
||||
selected_alias in action_aliases
|
||||
or not action_alias_has_role
|
||||
)
|
||||
else ""
|
||||
)
|
||||
scanned_role = _text(
|
||||
pending_role
|
||||
or (legacy_latest or {}).get("roleName")
|
||||
or action_pending_role
|
||||
or (decision.get("role_name") if decision.get("confirmable") else "")
|
||||
or decision_role
|
||||
)
|
||||
if (
|
||||
not scanned_role
|
||||
and action_current is not None
|
||||
and account_current_role
|
||||
and legacy_role
|
||||
and legacy_role == account_current_role
|
||||
and _text(action_current.get("roleName")) == account_current_role
|
||||
):
|
||||
scanned_role = account_current_role
|
||||
if not scanned_role and not action_alias_has_role:
|
||||
scanned_role = legacy_role
|
||||
# 取消 QYOOB-only 门禁后,cjm 的新角色同样可以成为客户确认目标;
|
||||
# 这里展示真实本次扫码角色,避免详情说“不可确认”但客户页可以确认。
|
||||
target_role = scanned_role
|
||||
@@ -231,7 +256,6 @@ def build_binding_evidence(
|
||||
or (selected_info or {}).get("role_name")
|
||||
or (result.get("before_bind_info") or {}).get("role_name")
|
||||
)
|
||||
account_current_role = _text(account.game_name) if account is not None else ""
|
||||
same_pair = bool(
|
||||
scanned_role
|
||||
and account_current_role
|
||||
|
||||
Reference in New Issue
Block a user