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;