From 73c9f40bedaf8a5fbefd5a59f4e3fb0899761819 Mon Sep 17 00:00:00 2001 From: jianweie Date: Sat, 18 May 2024 17:43:37 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E8=AE=A2=E5=8D=95=E5=8F=96?= =?UTF-8?q?=E6=B6=88=E8=AE=A2=E5=8D=95=E5=B9=B6=E9=80=80=E6=AC=BE=E6=96=B9?= =?UTF-8?q?=E6=B3=95=E5=A4=B1=E6=95=88=E7=9A=84=E9=97=AE=E9=A2=98=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Order/CoreCmsOrderController.cs | 36 +++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/CoreCms.Net.Web.Admin/Controllers/Order/CoreCmsOrderController.cs b/CoreCms.Net.Web.Admin/Controllers/Order/CoreCmsOrderController.cs index aac7fd15..7b044ac1 100644 --- a/CoreCms.Net.Web.Admin/Controllers/Order/CoreCmsOrderController.cs +++ b/CoreCms.Net.Web.Admin/Controllers/Order/CoreCmsOrderController.cs @@ -32,6 +32,7 @@ using CoreCms.Net.WeChat.Service.HttpClients; using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Hosting; using Microsoft.AspNetCore.Mvc; +using Microsoft.IdentityModel.Tokens; using Newtonsoft.Json; using NPOI.HSSF.UserModel; using NPOI.SS.Util; @@ -1700,6 +1701,7 @@ namespace CoreCms.Net.Web.Admin.Controllers return jm; } + var result = await _coreCmsOrderServices.CancelOrder(entity.id); jm.code = result.status ? 0 : 1; jm.msg = result.msg; @@ -1708,6 +1710,40 @@ namespace CoreCms.Net.Web.Admin.Controllers } #endregion + #region 取消订单并退款============================================================ + // POST: Api/CoreCmsOrder/CancelOrderAndRefund/10 + /// + /// 取消订单并退款 + /// + /// + /// + [HttpPost] + [Description("取消订单并退款")] + public async Task CancelOrderAndRefund([FromBody] FMStringId entity) + { + var jm = new AdminUiCallBack(); + + if (entity.id.Length == 0) + { + jm.msg = "请提交要取消的订单号"; + return jm; + } + + if (string.IsNullOrEmpty(entity.id)) + { + jm.msg = "请提交要取消的订单号"; + return jm; + } + + var result = await _coreCmsOrderServices.CancelOrderAndRefund(entity.id); + jm.code = result.status ? 0 : 1; + jm.msg = result.msg; + + return jm; + } + #endregion + + #region 批量删除订单============================================================ // POST: Api/CoreCmsOrder/DeleteOrder/10 ///