DengBiao 1 anno fa
parent
commit
48a9dcd8c8
4 ha cambiato i file con 18 aggiunte e 8 eliminazioni
  1. +8
    -7
      app/admin/svc/enterprise_manage/svc_central_kitchen_for_school.go
  2. +1
    -1
      app/admin/svc/order/svc_central_kitchen_for_school_order.go
  3. +8
    -0
      app/customer/hdl/hdl_demo.go
  4. +1
    -0
      app/router/customer_router.go

+ 8
- 7
app/admin/svc/enterprise_manage/svc_central_kitchen_for_school.go Vedi File

@@ -855,34 +855,35 @@ func JudgePackageOrdOrdState(outTradeNo string) (err error) {
}

//1、判断是否有 `待就餐`
count, err := db.Db.Where("ord_no =?", outTradeNo).And("state =?", enum2.CentralKitchenForSchoolUserWithDayStateForWait).Count(&m)
count1, err := db.Db.Where("ord_no =?", outTradeNo).And("state =?", enum2.CentralKitchenForSchoolUserWithDayStateForWait).Count(&m)
if err != nil {
return
}
if count == 0 {
if count1 == 0 {
ordState = enum2.CentralKitchenForSchoolPackageOrdOrdStateForComplete
} else {
ordState = enum2.CentralKitchenForSchoolPackageOrdOrdStateForSuccess
}

//2、判断是否有 `已退款` / `部分退款`
count, err = db.Db.Where("ord_no =?", outTradeNo).And("state =?", enum2.CentralKitchenForSchoolUserWithDayStateForCancel).Count(&m)
count2, err := db.Db.Where("ord_no =?", outTradeNo).And("state =?", enum2.CentralKitchenForSchoolUserWithDayStateForCancel).Count(&m)
if err != nil {
return
}
if count > 0 && count < total {
//if count2 > 0 && count2 < total && count1 > 0 {
if count2 > 0 && count2 < total {
ordState = enum2.CentralKitchenForSchoolPackageOrdOrdStateForPartRefunded
}
if count > 0 && count != total {
if count2 > 0 && count2 == total {
ordState = enum2.CentralKitchenForSchoolPackageOrdOrdStateForRefunded
}

//3、判断是否有 `退款中`
count, err = db.Db.Where("ord_no =?", outTradeNo).And("state =?", enum2.CentralKitchenForSchoolUserWithDayStateForCanceling).Count(&m)
count3, err := db.Db.Where("ord_no =?", outTradeNo).And("state =?", enum2.CentralKitchenForSchoolUserWithDayStateForCanceling).Count(&m)
if err != nil {
return
}
if count > 0 {
if count3 > 0 {
ordState = enum2.CentralKitchenForSchoolPackageOrdOrdStateForRefunding
}



+ 1
- 1
app/admin/svc/order/svc_central_kitchen_for_school_order.go Vedi File

@@ -155,7 +155,7 @@ func CentralKitchenForSchoolOrderRefundAudit(req md.CentralKitchenForSchoolOrder
if req.State == 1 {
returnDay.State = enum.CentralKitchenForSchoolUserRefundDayStateForAuditPass
userWithDay.State = enum.CentralKitchenForSchoolUserWithDayStateForCancel
time.Sleep(1 * time.Second) //TODO::避免频繁调用
//调用支付宝进行退款
err6, _ := svc2.CurlAlipayTradeRefund(md2.CurlAlipayTradeRefundReq{
Config: struct {


+ 8
- 0
app/customer/hdl/hdl_demo.go Vedi File

@@ -2,6 +2,7 @@ package hdl

import (
"applet/app/admin/lib/validate"
svc2 "applet/app/admin/svc/enterprise_manage"
"applet/app/customer/md"
"applet/app/customer/svc"
"applet/app/e"
@@ -25,3 +26,10 @@ func CurlAlipayPlanetEcocampusApiRosterSignUpInfo(c *gin.Context) {
e.OutSuc(c, resp, nil)
return
}

func Demo(c *gin.Context) {
ordNo := c.DefaultQuery("ord_no", "")
svc2.JudgePackageOrdOrdState(ordNo)
e.OutSuc(c, nil, nil)
return
}

+ 1
- 0
app/router/customer_router.go Vedi File

@@ -14,6 +14,7 @@ func CustomerInit(r *gin.RouterGroup) {
rSelfSupportForSchool(r.Group("/selfSupportForSchool"))
rUserIdentity(r.Group("/userIdentity"))

r.POST("/test", hdl.Demo)
r.POST("/curlAlipayPlanetEcocampusApiRosterSignUpInfoTest", hdl.CurlAlipayPlanetEcocampusApiRosterSignUpInfo)

r.POST("/login", hdl.Login)


Caricamento…
Annulla
Salva