feat(fulfillment): 支持选号优先级、三皮肤联合资格捆绑与同角色共享租约
This commit is contained in:
@@ -43,6 +43,11 @@ def update_settings(
|
||||
db: Session = Depends(get_db),
|
||||
current: User = Depends(require_permission("platform_fulfillment:admin")),
|
||||
) -> dict[str, Any]:
|
||||
raw_policy = (
|
||||
req.allocation_policy.model_dump(by_alias=True)
|
||||
if hasattr(req.allocation_policy, "model_dump")
|
||||
else req.allocation_policy
|
||||
)
|
||||
result = service.update_settings(
|
||||
db,
|
||||
lease_duration_minutes=req.lease_duration_minutes,
|
||||
@@ -50,13 +55,10 @@ def update_settings(
|
||||
manual_completed_release_delay_minutes=(
|
||||
req.manual_completed_release_delay_minutes
|
||||
),
|
||||
presale_waiting_release_ttl_minutes=(
|
||||
req.presale_waiting_release_ttl_minutes
|
||||
),
|
||||
manual_required_lease_ttl_minutes=(
|
||||
req.manual_required_lease_ttl_minutes
|
||||
),
|
||||
presale_waiting_release_ttl_minutes=(req.presale_waiting_release_ttl_minutes),
|
||||
manual_required_lease_ttl_minutes=(req.manual_required_lease_ttl_minutes),
|
||||
order_match_started_at=req.order_match_started_at,
|
||||
allocation_policy=raw_policy,
|
||||
current=current,
|
||||
)
|
||||
record_audit(
|
||||
@@ -67,11 +69,13 @@ def update_settings(
|
||||
detail=result,
|
||||
)
|
||||
db.commit()
|
||||
from ..services.platform_fulfillment.auto_allocator import wake_auto_allocator
|
||||
from ..services.platform_fulfillment.views import (
|
||||
invalidate_task_list_count_cache,
|
||||
)
|
||||
|
||||
invalidate_task_list_count_cache()
|
||||
wake_auto_allocator()
|
||||
return result
|
||||
|
||||
|
||||
@@ -390,10 +394,9 @@ def allocate_task(
|
||||
db.commit()
|
||||
from ..services.platform_fulfillment.auto_allocator import queue_task_allocation
|
||||
|
||||
result["allocationQueued"] = (
|
||||
result.get("task", {}).get("executionStatus") == "ready"
|
||||
and queue_task_allocation(task_id)
|
||||
)
|
||||
result["allocationQueued"] = result.get("task", {}).get(
|
||||
"executionStatus"
|
||||
) == "ready" and queue_task_allocation(task_id)
|
||||
return result
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user