HandleRefund
This commit is contained in:
parent
d9a2fbf690
commit
4301327ce9
|
@ -4,6 +4,7 @@ import (
|
|||
"enterprise/common/config"
|
||||
"enterprise/common/dao"
|
||||
"enterprise/common/global"
|
||||
"enterprise/common/model"
|
||||
"enterprise/server/service"
|
||||
"enterprise/server/session"
|
||||
"fmt"
|
||||
|
@ -42,7 +43,7 @@ func (q *QyWeixin) Approve(ctx *gin.Context) {
|
|||
qyApp.Callback(ctx)
|
||||
}
|
||||
|
||||
func (q *QyWeixin) ApproveRefund(ctx *gin.Context) {
|
||||
func (q *QyWeixin) HandleRefund(ctx *gin.Context) {
|
||||
id := cast.ToInt64(ctx.Query("id"))
|
||||
approve, err := dao.NewApprovalRefundDao().Get(id)
|
||||
if err != nil {
|
||||
|
@ -51,6 +52,9 @@ func (q *QyWeixin) ApproveRefund(ctx *gin.Context) {
|
|||
if approve == nil {
|
||||
panic("没有数据")
|
||||
}
|
||||
if approve.Status == model.ApprovalRefundStatusPayed {
|
||||
panic("已支付")
|
||||
}
|
||||
corp, err := dao.NewCorpDao().Get(approve.CorpId)
|
||||
if err != nil {
|
||||
panic(config.ErrDb.New().Append(err))
|
||||
|
|
|
@ -16,7 +16,7 @@ func initRoutge(engine *gin.Engine) {
|
|||
group.Use(base.Recovery)
|
||||
apiGroup.Any("/qyweixin/approve/:cid", qyweixin.Approve)
|
||||
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/history", staff.SalaryHistory)
|
||||
|
|
Loading…
Reference in New Issue