From c8ba778798be9470ff8785ae6b5f7ab9eba0bd50 Mon Sep 17 00:00:00 2001 From: DengBiao <2319963317@qq.com> Date: Tue, 5 Dec 2023 19:01:28 +0800 Subject: [PATCH] update --- .../hdl_self_support_for_school.go | 21 +++++++++++++++++++ .../hdl/hdl_self_support_for_school_order.go | 4 ++++ ..._central_kitchen_for_school_package_ord.go | 3 +++ 3 files changed, 28 insertions(+) diff --git a/app/admin/hdl/enterprise_manage/hdl_self_support_for_school.go b/app/admin/hdl/enterprise_manage/hdl_self_support_for_school.go index c473a37..c84f923 100644 --- a/app/admin/hdl/enterprise_manage/hdl_self_support_for_school.go +++ b/app/admin/hdl/enterprise_manage/hdl_self_support_for_school.go @@ -1112,6 +1112,10 @@ func SelfSupportForSchoolOrdList(c *gin.Context) { "name": enum.SelfSupportForSchoolOrdOrderStatus.String(enum.SelfSupportForSchoolOrdOrderStatusForRefund), "value": enum.SelfSupportForSchoolOrdOrderStatusForRefund, }, + { + "name": enum.SelfSupportForSchoolOrdOrderStatus.String(enum.SelfSupportForSchoolOrdOrderStatusForCancel), + "value": enum.SelfSupportForSchoolOrdOrderStatusForCancel, + }, }, }, nil) return @@ -1563,6 +1567,18 @@ func SelfSupportForSchoolArrearsOrdDebtCancel(c *gin.Context) { return } + selfSupportForSchoolOrdDb := db.SelfSupportForSchoolOrd{} + selfSupportForSchoolOrdDb.Set(req.OutOrderNo) + ord, err := selfSupportForSchoolOrdDb.GetSelfSupportForSchoolOrd() + if err != nil { + e.OutErr(c, e.ERR_DB_ORM, err.Error()) + return + } + if ord == nil { + e.OutErr(c, e.ERR_NO_DATA, "未查询到对应订单记录") + return + } + err, resp := svc.CurlAlipayPlanetEcocampusApiDebtCancel(md2.CurlAlipayPlanetEcocampusApiDebtCancel{ OutOrderNo: req.OutOrderNo, MerchantCode: req.MerchantCode, @@ -1571,6 +1587,11 @@ func SelfSupportForSchoolArrearsOrdDebtCancel(c *gin.Context) { e.OutErr(c, e.ERR, err.Error()) return } + + //TODO::修改订单状态为“已撤销” + ord.OrderStatus = enum.SelfSupportForSchoolOrdOrderStatusForRefund + selfSupportForSchoolOrdDb.SelfSupportForSchoolOrdUpdate(ord, "order_status") + e.OutSuc(c, resp, nil) return } diff --git a/app/customer/hdl/hdl_self_support_for_school_order.go b/app/customer/hdl/hdl_self_support_for_school_order.go index aa2b81e..f842a29 100644 --- a/app/customer/hdl/hdl_self_support_for_school_order.go +++ b/app/customer/hdl/hdl_self_support_for_school_order.go @@ -49,6 +49,10 @@ func SelfSupportForSchoolOrderList(c *gin.Context) { "name": enum.SelfSupportForSchoolOrdOrderStatus.String(enum.SelfSupportForSchoolOrdOrderStatusForRefund), "value": enum.SelfSupportForSchoolOrdOrderStatusForRefund, }, + { + "name": enum.SelfSupportForSchoolOrdOrderStatus.String(enum.SelfSupportForSchoolOrdOrderStatusForCancel), + "value": enum.SelfSupportForSchoolOrdOrderStatusForCancel, + }, }, }, nil) return diff --git a/app/enum/enum_central_kitchen_for_school_package_ord.go b/app/enum/enum_central_kitchen_for_school_package_ord.go index 0df4839..67c02fc 100644 --- a/app/enum/enum_central_kitchen_for_school_package_ord.go +++ b/app/enum/enum_central_kitchen_for_school_package_ord.go @@ -6,6 +6,7 @@ const ( SelfSupportForSchoolOrdOrderStatusForWait = 1 SelfSupportForSchoolOrdOrderStatusForSuccess = 2 SelfSupportForSchoolOrdOrderStatusForRefund = 3 + SelfSupportForSchoolOrdOrderStatusForCancel = 4 ) func (gt SelfSupportForSchoolOrdOrderStatus) String() string { @@ -16,6 +17,8 @@ func (gt SelfSupportForSchoolOrdOrderStatus) String() string { return "支付成功" case SelfSupportForSchoolOrdOrderStatusForRefund: return "已退款" + case SelfSupportForSchoolOrdOrderStatusForCancel: + return "已撤销" default: return "未知" }