新增外部接口 根据订单号获取商铺AppKey

调整 商铺统计 更新时间 02:0-- 00:05
This commit is contained in:
chfei committed 2026-10-21 18:27:07 +08:00
1 parent d4051474e3
commit c714bbea64
3 files changed
+30 -3

No files matched your search

@@ -18,7 +18,18 @@ public partial class WXShopController : AsmxApiController
{ {
_shopService = shopService; _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));
}
}
/// <summary> /// <summary>
/// 更新商铺永久续费 /// 更新商铺永久续费
/// </summary> /// </summary>
@@ -1,6 +1,7 @@
using MAX.Core.DependencyInjection; using MAX.Core.DependencyInjection;
using MAX.Core.Logger; using MAX.Core.Logger;
using Org.BouncyCastle.Utilities; using Org.BouncyCastle.Utilities;
using Store.Contracts.Order.Entitys;
using Store.Contracts.Shops; using Store.Contracts.Shops;
using Store.Contracts.User.Interfaces; using Store.Contracts.User.Interfaces;
using System; using System;
@@ -70,4 +71,19 @@ public class ShopService : ITransientDependency
.Where(a => shopAppkeys.Contains(a.AppKey)) .Where(a => shopAppkeys.Contains(a.AppKey))
.ToList(a => a.Id); .ToList(a => a.Id);
} }
public string GetShopKey(string orderSn)
{
if (string.IsNullOrEmpty(orderSn)) return "";
var appKey = _freeSql.Select<WeiOrderEntity, WXShopEntity>()
.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'
}
} }
@@ -10,9 +10,9 @@ using System.Web;
namespace KJD_Web.Services.Shops; namespace KJD_Web.Services.Shops;
/// <summary> /// <summary>
/// 更新商铺统计 /// 更新商铺统计 每天0:5分 统计
/// </summary> /// </summary>
[Job("ShopStats", "0 2 * * *")] [Job("ShopStats", "5 0 * * *")]
public class ShopStatsJob : IScheduledJobs, ITransientDependency public class ShopStatsJob : IScheduledJobs, ITransientDependency
{ {
private readonly ShopRevenueStatisticsService _shopRevenueStatisticsService; private readonly ShopRevenueStatisticsService _shopRevenueStatisticsService;