feat(pl): set recharge apply to pending when entering disburse node

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
wuzilongandCursor committed 2026-11-12 19:43:57 +08:00
1 parent 01d607d766
commit c8174ab3f2
3 files changed
+118 -7

No files matched your search

@@ -58,8 +58,8 @@ def _current_node(
user: DbUserContext,
tenant_no: str,
) -> BxWorkflowNode:
if apply.status != "in_approval" or not apply.current_node:
raise HTTPException(status_code=400, detail="申请单不在审批中")
if apply.status not in ("in_approval", "pending") or not apply.current_node:
raise HTTPException(status_code=400, detail="申请单不在可审批/发放状态")
node = (
db.query(BxWorkflowNode)
.filter(
@@ -145,7 +145,7 @@ def list_pending(
.filter(
PlVehicleRechargeApply.tenant_no == tenant_no,
PlVehicleRechargeApply.del_flag == 0,
PlVehicleRechargeApply.status == "in_approval",
PlVehicleRechargeApply.status.in_(("in_approval", "pending")),
BxWorkflowNode.tenant_no == tenant_no,
BxWorkflowNode.del_flag == 0,
BxWorkflowNode.approver_id == user.id,
@@ -294,7 +294,11 @@ def approve_apply(
opinion=opinion,
now=now,
)
apply.current_node = nodes[idx + 1].id
next_node = nodes[idx + 1]
apply.current_node = next_node.id
next_action = (next_node.action_type or "approve").strip() or "approve"
if next_action == "disburse":
apply.status = "pending"
apply.update_by = user.id
apply.update_time = now
sync_approval_notifications(