HandleRefund

This commit is contained in:
jiangyong27 2025-01-15 12:27:44 +08:00
parent d9a2fbf690
commit 4301327ce9
2 changed files with 6 additions and 2 deletions

View File

@ -4,6 +4,7 @@ import (
"enterprise/common/config" "enterprise/common/config"
"enterprise/common/dao" "enterprise/common/dao"
"enterprise/common/global" "enterprise/common/global"
"enterprise/common/model"
"enterprise/server/service" "enterprise/server/service"
"enterprise/server/session" "enterprise/server/session"
"fmt" "fmt"
@ -42,7 +43,7 @@ func (q *QyWeixin) Approve(ctx *gin.Context) {
qyApp.Callback(ctx) qyApp.Callback(ctx)
} }
func (q *QyWeixin) ApproveRefund(ctx *gin.Context) { func (q *QyWeixin) HandleRefund(ctx *gin.Context) {
id := cast.ToInt64(ctx.Query("id")) id := cast.ToInt64(ctx.Query("id"))
approve, err := dao.NewApprovalRefundDao().Get(id) approve, err := dao.NewApprovalRefundDao().Get(id)
if err != nil { if err != nil {
@ -51,6 +52,9 @@ func (q *QyWeixin) ApproveRefund(ctx *gin.Context) {
if approve == nil { if approve == nil {
panic("没有数据") panic("没有数据")
} }
if approve.Status == model.ApprovalRefundStatusPayed {
panic("已支付")
}
corp, err := dao.NewCorpDao().Get(approve.CorpId) corp, err := dao.NewCorpDao().Get(approve.CorpId)
if err != nil { if err != nil {
panic(config.ErrDb.New().Append(err)) panic(config.ErrDb.New().Append(err))

View File

@ -16,7 +16,7 @@ func initRoutge(engine *gin.Engine) {
group.Use(base.Recovery) group.Use(base.Recovery)
apiGroup.Any("/qyweixin/approve/:cid", qyweixin.Approve) apiGroup.Any("/qyweixin/approve/:cid", qyweixin.Approve)
apiGroup.Any("/qyweixin/pay/:cid", qyweixin.Pay) apiGroup.Any("/qyweixin/pay/:cid", qyweixin.Pay)
apiGroup.Any("/qyweixin/pay/refund", qyweixin.ApproveRefund) apiGroup.Any("/qyweixin/handle/refund", qyweixin.HandleRefund)
group.GET("/staff/salary", staff.Salary) group.GET("/staff/salary", staff.Salary)
group.GET("/staff/salary/history", staff.SalaryHistory) group.GET("/staff/salary/history", staff.SalaryHistory)