From f875f9672696ed53beb241bd8bb98b679e2ddaf6 Mon Sep 17 00:00:00 2001 From: DengBiao <2319963317@qq.com> Date: Wed, 21 Feb 2024 12:20:28 +0800 Subject: [PATCH] update --- .../svc_central_kitchen_for_school_order.go | 22 ++++++++- app/customer/hdl/hdl_demo.go | 48 +++++++++---------- 2 files changed, 44 insertions(+), 26 deletions(-) diff --git a/app/admin/svc/order/svc_central_kitchen_for_school_order.go b/app/admin/svc/order/svc_central_kitchen_for_school_order.go index d7b9c5f..b5906e0 100644 --- a/app/admin/svc/order/svc_central_kitchen_for_school_order.go +++ b/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) diff --git a/app/customer/hdl/hdl_demo.go b/app/customer/hdl/hdl_demo.go index a2036b9..b21df11 100644 --- a/app/customer/hdl/hdl_demo.go +++ b/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 {