From e484c8de88c5744d979a12c2864ba5af4265a10b Mon Sep 17 00:00:00 2001 From: DengBiao <2319963317@qq.com> Date: Wed, 11 Oct 2023 11:14:22 +0800 Subject: [PATCH] update --- app/admin/hdl/hdl_audit_center.go | 16 ++++++------- .../svc_central_kitchen_for_school_order.go | 24 ++++++++++++------- 2 files changed, 24 insertions(+), 16 deletions(-) diff --git a/app/admin/hdl/hdl_audit_center.go b/app/admin/hdl/hdl_audit_center.go index 033b5db..62a97b6 100644 --- a/app/admin/hdl/hdl_audit_center.go +++ b/app/admin/hdl/hdl_audit_center.go @@ -165,6 +165,14 @@ func CentralKitchenForSchoolOrderRefundAudit(c *gin.Context) { e.OutErr(c, e.ERR_DB_ORM, errors.New("更新退款就餐记录状态失败2")) return } + + //2、处理订单状态 + err5 := svc.JudgePackageOrdOrdState(returnDay.OutTradeNo) + if err5 != nil { + _ = session.Rollback() + e.OutErr(c, e.ERR, err5.Error()) + return + } } returnDay.Memo = req.Memo @@ -179,14 +187,6 @@ func CentralKitchenForSchoolOrderRefundAudit(c *gin.Context) { e.OutErr(c, e.ERR_DB_ORM, errors.New("更新退款订单记录状态失败1")) return } - - //2、处理订单状态 - err5 := svc.JudgePackageOrdOrdState(returnDay.OutTradeNo) - if err5 != nil { - _ = session.Rollback() - e.OutErr(c, e.ERR, err5.Error()) - return - } } err = session.Commit() 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 8a1f671..b68863d 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 @@ -261,13 +261,6 @@ func CentralKitchenForSchoolOrderRefundAudit(c *gin.Context, req md.CentralKitch return } - //2、处理订单状态 - err5 := svc.JudgePackageOrdOrdState(returnDay.OutTradeNo) - if err5 != nil { - _ = session.Rollback() - return err5 - } - updateAck1, err4 := centralKitchenForSchoolUserWithDayDb.CentralKitchenForSchoolUserWithDayUpdate(userWithDay.Id, userWithDay, "state") if err4 != nil { _ = session.Rollback() @@ -335,5 +328,20 @@ func CentralKitchenForSchoolOrderRefundAudit(c *gin.Context, req md.CentralKitch time.Sleep(20 * time.Millisecond) //TODO::避免频繁调用 } - return session.Commit() + session.Commit() + + //TODO:: 处理订单状态 + for k, _ := range dealReturnOrdMap { + err = svc.JudgePackageOrdOrdState(k) + if err != nil { + return err + } + } + for k, _ := range dealReturnOrdMapForWx { + err = svc.JudgePackageOrdOrdState(k) + if err != nil { + return err + } + } + return }