feat(履约绑定): 支持工作台修改客户资料、扫码不匹配时间线及确认后斗鱼复核
This commit is contained in:
@@ -265,6 +265,37 @@ class DouyuBatchRunnerCore:
|
||||
"[douyu] 同步直播账号履约状态失败: task_id={}", douyu_task_id
|
||||
)
|
||||
|
||||
def _verify_platform_binding(
|
||||
self,
|
||||
douyu_task_id: int,
|
||||
*,
|
||||
enabled: bool,
|
||||
) -> None:
|
||||
"""确认绑定完成后,再去斗鱼实时查询复核一次。"""
|
||||
if not enabled:
|
||||
return
|
||||
try:
|
||||
from ..database import WorkerSessionLocal
|
||||
from .platform_fulfillment.service import verify_active_binding_for_douyu_task
|
||||
|
||||
verify_db = WorkerSessionLocal()
|
||||
try:
|
||||
task = verify_db.get(DouyuTask, int(douyu_task_id))
|
||||
if task is None or task.status != "success":
|
||||
return
|
||||
verify_active_binding_for_douyu_task(
|
||||
verify_db,
|
||||
douyu_task_id=int(douyu_task_id),
|
||||
actor_id=int(task.created_by),
|
||||
)
|
||||
finally:
|
||||
verify_db.close()
|
||||
except Exception: # noqa: BLE001 - 复核异常不能覆盖主任务提交
|
||||
logger.exception(
|
||||
"[douyu] 自动复核直播履约绑定状态失败: task_id={}",
|
||||
douyu_task_id,
|
||||
)
|
||||
|
||||
def _refresh_platform_exchange_eligibility(
|
||||
self,
|
||||
douyu_task_id: int,
|
||||
@@ -405,6 +436,10 @@ class DouyuBatchRunnerCore:
|
||||
task_id,
|
||||
enabled=sync_platform_fulfillment,
|
||||
)
|
||||
self._verify_platform_binding(
|
||||
task_id,
|
||||
enabled=(status == "success" and task.task_type == "confirm_bind"),
|
||||
)
|
||||
self._refresh_platform_exchange_eligibility(
|
||||
task_id,
|
||||
enabled=(
|
||||
|
||||
Reference in New Issue
Block a user