瀏覽代碼

update

tmp
DengBiao 9 月之前
父節點
當前提交
f875f96726
共有 2 個檔案被更改,包括 44 行新增26 行删除
  1. +20
    -2
      app/admin/svc/order/svc_central_kitchen_for_school_order.go
  2. +24
    -24
      app/customer/hdl/hdl_demo.go

+ 20
- 2
app/admin/svc/order/svc_central_kitchen_for_school_order.go 查看文件

@@ -17,6 +17,7 @@ import (
"github.com/wechatpay-apiv3/wechatpay-go/core"
"github.com/wechatpay-apiv3/wechatpay-go/services/refunddomestic"
"math"
"strings"
"time"
)

@@ -206,6 +207,7 @@ func CentralKitchenForSchoolOrderRefundAudit(c *gin.Context, req md.CentralKitch
companyWithWxpayInfoDb := db.CompanyWithWxpayInfoDb{}
companyWithWxpayInfoDb.Set()

var isAlreadyReturnDayId []int
for _, v := range req.Ids {
//1、更新状态
if req.State == 1 {
@@ -223,8 +225,9 @@ func CentralKitchenForSchoolOrderRefundAudit(c *gin.Context, req md.CentralKitch

if userWithDay.State == enum.CentralKitchenForSchoolUserWithDayStateForCancel {
//TODO::当前订餐记录,已退款了
returnDay.Memo = "当前退款申请记录,已有其他退款申请完成退款!"
centralKitchenForSchoolUserRefundDayDb.CentralKitchenForSchoolUserRefundDayUpdate(returnDay.Id, returnDay, "memo")
isAlreadyReturnDayId = append(isAlreadyReturnDayId, returnDay.Id)
//returnDay.Memo = "当前退款申请记录,已有其他退款申请完成退款!"
//centralKitchenForSchoolUserRefundDayDb.CentralKitchenForSchoolUserRefundDayUpdate(returnDay.Id, returnDay, "memo")
continue
}

@@ -363,6 +366,21 @@ func CentralKitchenForSchoolOrderRefundAudit(c *gin.Context, req md.CentralKitch

session.Commit()

if len(isAlreadyReturnDayId) > 0 {
//更改 `central_kitchen_for_school_user_with_day` 的 memo
sql := "update central_kitchen_for_school_user_with_day set memo = '当前退款申请记录,已有其他退款申请完成退款!' where id In (%s)"
idsStr := strings.Join(req.Ids, ",")
sql = fmt.Sprintf(sql, idsStr)
fmt.Println(sql)
_, err = db.ExecuteOriginalSql(db.Db, sql)
if err != nil {
utils.FilePutContents("isAlreadyReturnDayId_ERR", utils.SerializeStr(map[string]interface{}{
"sql": sql,
"err": err.Error(),
}))
fmt.Println("isAlreadyReturnDayId_ERR::::::::::::::", err.Error())
}
}
//TODO:: 处理订单状态
for k, _ := range dealReturnOrdMap {
err = svc.JudgePackageOrdOrdState(k)


+ 24
- 24
app/customer/hdl/hdl_demo.go 查看文件

@@ -153,28 +153,28 @@ func Demo(c *gin.Context) {
sysCfgDb.Set()
sysCfg := sysCfgDb.SysCfgFindWithDb(enum.OpenAppletAppid, enum.OpenAppletAppPrivateKey, enum.OpenAppletPublicKey)

err, info := svc.CurlEducateFacepayApply(md.CurlEducateFacepayApplyReq{
Config: struct {
AliAppId string `json:"ali_app_id" label:"支付宝开放平台-小程序-appid"`
AliPrivateKey string `json:"ali_private_key" label:"支付宝开放平台-小程序-应用私钥"`
AliPublicKey string `json:"ali_public_key" label:"支付宝开放平台-小程序-支付宝公钥"`
}{
AliAppId: sysCfg[enum.OpenAppletAppid],
AliPrivateKey: sysCfg[enum.OpenAppletAppPrivateKey],
AliPublicKey: sysCfg[enum.OpenAppletPublicKey],
},
FaceUid: "2088930289907324",
FaceOpenId: "",
SchoolStdCode: "3144003844",
})
if err != nil {
e.OutErr(c, e.ERR, err.Error())
return
}
e.OutSuc(c, info, nil)
return
//err, info := svc.CurlEducateFacepayApply(md.CurlEducateFacepayApplyReq{
// Config: struct {
// AliAppId string `json:"ali_app_id" label:"支付宝开放平台-小程序-appid"`
// AliPrivateKey string `json:"ali_private_key" label:"支付宝开放平台-小程序-应用私钥"`
// AliPublicKey string `json:"ali_public_key" label:"支付宝开放平台-小程序-支付宝公钥"`
// }{
// AliAppId: sysCfg[enum.OpenAppletAppid],
// AliPrivateKey: sysCfg[enum.OpenAppletAppPrivateKey],
// AliPublicKey: sysCfg[enum.OpenAppletPublicKey],
// },
// FaceUid: "2088930289907324",
// FaceOpenId: "",
// SchoolStdCode: "3144003844",
//})
//if err != nil {
// e.OutErr(c, e.ERR, err.Error())
// return
//}
//e.OutSuc(c, info, nil)
//return

err, info = svc.CurlEducateSceneTokenQueryV2(md.CurlEducateSceneTokenReq{
err, info := svc.CurlEducateSceneTokenQueryV2(md.CurlEducateSceneTokenReq{
Config: struct {
AliAppId string `json:"ali_app_id" label:"支付宝开放平台-小程序-appid"`
AliPrivateKey string `json:"ali_private_key" label:"支付宝开放平台-小程序-应用私钥"`
@@ -185,9 +185,9 @@ func Demo(c *gin.Context) {
AliPublicKey: sysCfg[enum.OpenAppletPublicKey],
},
CertType: "1",
CertNo: "411381201103013932",
StudentName: "黄永康",
OutUserId: "6088",
CertNo: "440402201102199098",
StudentName: "陈子豪",
OutUserId: "16141",
SchoolStdCode: "3144003844",
}, &model.UserIdentity{}, "", "")
if err != nil {


Loading…
取消
儲存