发布(0.4.6): 修复预售兑换记录判定与详情展示并新增工作台强制发放
This commit is contained in:
@@ -383,3 +383,40 @@ def record_douyu_operation_result(
|
||||
"issueCode": issue_code,
|
||||
},
|
||||
)
|
||||
|
||||
|
||||
def record_workbench_force_exchange(
|
||||
db: Session,
|
||||
*,
|
||||
task_id: int,
|
||||
current: User,
|
||||
batch_id: str,
|
||||
douyu_task_id: int,
|
||||
task_type: str,
|
||||
commodity_id: str = "",
|
||||
goods_name: str = "",
|
||||
account_id: int | None = None,
|
||||
account_username: str = "",
|
||||
account_role: str = "",
|
||||
) -> None:
|
||||
"""工作台确认账号和角色一致后强制发放时,在履约时间线记一笔操作留痕(不改订单状态)。"""
|
||||
_append_event(
|
||||
db,
|
||||
int(task_id),
|
||||
"workbench_force_exchange",
|
||||
actor_type="user",
|
||||
actor_id=int(current.id),
|
||||
detail={
|
||||
"operatorId": int(current.id),
|
||||
"operatorUsername": str(current.username or ""),
|
||||
"batchId": batch_id,
|
||||
"douyuTaskId": int(douyu_task_id),
|
||||
"taskType": task_type,
|
||||
"taskLabel": SUPPORTED_DOUYU_TASK_TYPES.get(task_type, task_type),
|
||||
"commodityId": str(commodity_id or ""),
|
||||
"goodsName": str(goods_name or ""),
|
||||
"accountId": int(account_id) if account_id is not None else None,
|
||||
"accountUsername": str(account_username or ""),
|
||||
"accountRole": str(account_role or ""),
|
||||
},
|
||||
)
|
||||
|
||||
@@ -131,6 +131,7 @@ from .runtime import ( # noqa: F401
|
||||
get_settings,
|
||||
record_douyu_operation_result,
|
||||
record_douyu_operation_started,
|
||||
record_workbench_force_exchange,
|
||||
update_settings,
|
||||
)
|
||||
from .views import ( # noqa: F401
|
||||
@@ -168,6 +169,7 @@ __all__ = [
|
||||
"reconcile_binding_state_outbox",
|
||||
"record_douyu_operation_result",
|
||||
"record_douyu_operation_started",
|
||||
"record_workbench_force_exchange",
|
||||
"refresh_active_exchange_eligibility_for_account",
|
||||
"refresh_binding",
|
||||
"refresh_exchange_eligibility",
|
||||
|
||||
Reference in New Issue
Block a user