更新密码找回uniapp
This commit is contained in:
1 parent
7f9a66da0f
commit
3fdda89833
1304 files changed
+3503
-26132
No files matched your search
@@ -12,19 +12,10 @@ import (
|
||||
"github.com/beego/beego/v2/client/orm"
|
||||
)
|
||||
|
||||
// reimburse_approval_core.go 报销单「审批人视角」操作共享逻辑。
|
||||
//
|
||||
// Web 端(/backend/reimbursements/approve|reject|my-approve-task)与
|
||||
// 小程序端(/api/oa/expense/approve|reject|my-approve-task)共用本文件;
|
||||
// 审批中心 TaskAct 也复用其中的 biz_type 判定与时间线回写。
|
||||
|
||||
// isReimburseBizType 判断审批任务/实例是否属于报销类单据。
|
||||
func isReimburseBizType(bizType string) bool {
|
||||
return approvalEngine.IsReimburseBizType(bizType)
|
||||
}
|
||||
|
||||
// claimsReimburseUIDs 当前登录用户可能出现在 approver_id 上的两种口径:
|
||||
// 认证中心 identity_id 与本租户 uid(历史上两种写法并存,这里都兼容)。
|
||||
func claimsReimburseUIDs(claims *jwtutil.Claims) []interface{} {
|
||||
raw := uint64(claims.UserID)
|
||||
out := []interface{}{raw}
|
||||
@@ -34,7 +25,6 @@ func claimsReimburseUIDs(claims *jwtutil.Claims) []interface{} {
|
||||
return out
|
||||
}
|
||||
|
||||
// reimburseMyTaskCore 查当前用户在报销单 id 上的待办审批任务;无待办返回 (nil, nil)。
|
||||
func reimburseMyTaskCore(claims *jwtutil.Claims, id uint64) (*models.ApprovalTask, error) {
|
||||
tid := uint64(claims.TenantId)
|
||||
var task models.ApprovalTask
|
||||
@@ -56,10 +46,6 @@ func reimburseMyTaskCore(claims *jwtutil.Claims, id uint64) (*models.ApprovalTas
|
||||
return &task, nil
|
||||
}
|
||||
|
||||
// reimburseActCore 报销单审批操作共享逻辑(pass=true 通过 / false 驳回)。
|
||||
//
|
||||
// 返回 (httpCode, errMsg, hint):errMsg 非空表示失败;成功时 hint 为提示文案。
|
||||
// 节点流转交由统一审批引擎,本函数负责定位当前用户的待办任务并补记业务时间线。
|
||||
func reimburseActCore(claims *jwtutil.Claims, id uint64, pass bool, comment string) (int, string, string) {
|
||||
if _, err := findOwnedReimbursement(claims, id); err != nil {
|
||||
return 404, "报销单不存在", ""
|
||||
@@ -96,9 +82,6 @@ func reimburseActCore(claims *jwtutil.Claims, id uint64, pass bool, comment stri
|
||||
return 200, "", hint
|
||||
}
|
||||
|
||||
// applyReimburseApprovalResult 把一次审批动作回写到报销业务侧:
|
||||
// 补记 yz_backend_approval_records 时间线;流程结束时同步单据终态(引擎的
|
||||
// SyncBizResult 也会做同样的事,这里按终态幂等,避免重复插记录)。
|
||||
func applyReimburseApprovalResult(tid, bizID, actorID uint64, actorName string, step int,
|
||||
pass bool, comment string, finished bool, instStatus int8) {
|
||||
if tid == 0 || bizID == 0 {
|
||||
@@ -115,7 +98,6 @@ func applyReimburseApprovalResult(tid, bizID, actorID uint64, actorName string,
|
||||
return
|
||||
}
|
||||
|
||||
// 终态同步(审批中→通过/驳回),引擎已同步过则跳过
|
||||
var bizStatus int8
|
||||
if finished {
|
||||
switch instStatus {
|
||||
@@ -131,7 +113,6 @@ func applyReimburseApprovalResult(tid, bizID, actorID uint64, actorName string,
|
||||
}
|
||||
}
|
||||
|
||||
// 时间线去重:同一步骤同一动作只记一次
|
||||
dup := models.Orm.QueryTable(new(models.BackendApprovalRecord)).
|
||||
Filter("tid", tid).Filter("reimbursement_id", bizID).
|
||||
Filter("approver_id", actorID).Filter("action", action).
|
||||
|
||||
Reference in new issue
Block a user