From c714bbea64da0ad62a3a470e0cd65fc3d4abeac0 Mon Sep 17 00:00:00 2001 From: chfei Date: Wed, 21 Oct 2026 18:27:07 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E5=A4=96=E9=83=A8=E6=8E=A5?= =?UTF-8?q?=E5=8F=A3=20=E6=A0=B9=E6=8D=AE=E8=AE=A2=E5=8D=95=E5=8F=B7?= =?UTF-8?q?=E8=8E=B7=E5=8F=96=E5=95=86=E9=93=BAAppKey=20=E8=B0=83=E6=95=B4?= =?UTF-8?q?=20=E5=95=86=E9=93=BA=E7=BB=9F=E8=AE=A1=20=E6=9B=B4=E6=96=B0?= =?UTF-8?q?=E6=97=B6=E9=97=B4=2002:0--=2000:05?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Controllers/WX/WXShop_N_Controller.cs | 13 ++++++++++++- KJD_WebService/Services/Shops/ShopService.cs | 16 ++++++++++++++++ KJD_WebService/Services/Shops/ShopStatsJob.cs | 4 ++-- 3 files changed, 30 insertions(+), 3 deletions(-) diff --git a/KJD_WebService/Controllers/WX/WXShop_N_Controller.cs b/KJD_WebService/Controllers/WX/WXShop_N_Controller.cs index e7b22de..15b7354 100644 --- a/KJD_WebService/Controllers/WX/WXShop_N_Controller.cs +++ b/KJD_WebService/Controllers/WX/WXShop_N_Controller.cs @@ -18,7 +18,18 @@ public partial class WXShopController : AsmxApiController { _shopService = shopService; } - + public IHttpActionResult GetShopKey(string ordersn) + { + try + { + var appkey = _shopService.GetShopKey(ordersn); + return Ok(ApiResult.Success(appkey, "操作成功")); + } + catch (Exception ex) + { + return Ok(ApiResult.Fail(ex.Message)); + } + } /// /// 更新商铺永久续费 /// diff --git a/KJD_WebService/Services/Shops/ShopService.cs b/KJD_WebService/Services/Shops/ShopService.cs index 6184f33..a9c22c7 100644 --- a/KJD_WebService/Services/Shops/ShopService.cs +++ b/KJD_WebService/Services/Shops/ShopService.cs @@ -1,6 +1,7 @@ using MAX.Core.DependencyInjection; using MAX.Core.Logger; using Org.BouncyCastle.Utilities; +using Store.Contracts.Order.Entitys; using Store.Contracts.Shops; using Store.Contracts.User.Interfaces; using System; @@ -70,4 +71,19 @@ public class ShopService : ITransientDependency .Where(a => shopAppkeys.Contains(a.AppKey)) .ToList(a => a.Id); } + + public string GetShopKey(string orderSn) + { + if (string.IsNullOrEmpty(orderSn)) return ""; + var appKey = _freeSql.Select() + .InnerJoin((a, b) => a.ShopId == b.Id) + .Where((a, b) => a.OrderId == orderSn) + .First((a, b) => b.AppKey); + return appKey; + + // SELECT B.app_key from erp.oms_wei_order AS A + //JOIN erp.o_shop as B on A.shop_id = B.id + // WHERE A.order_id = '3739958894823388160' + + } } \ No newline at end of file diff --git a/KJD_WebService/Services/Shops/ShopStatsJob.cs b/KJD_WebService/Services/Shops/ShopStatsJob.cs index ed96acf..6382f9a 100644 --- a/KJD_WebService/Services/Shops/ShopStatsJob.cs +++ b/KJD_WebService/Services/Shops/ShopStatsJob.cs @@ -10,9 +10,9 @@ using System.Web; namespace KJD_Web.Services.Shops; /// -/// 更新商铺统计 +/// 更新商铺统计 每天0:5分 统计 /// -[Job("ShopStats", "0 2 * * *")] +[Job("ShopStats", "5 0 * * *")] public class ShopStatsJob : IScheduledJobs, ITransientDependency { private readonly ShopRevenueStatisticsService _shopRevenueStatisticsService;