Files
KJD_WebService/KJD_WebService/Services/Shops/ShopStatsJob.cs
T
chfei c714bbea64 新增外部接口 根据订单号获取商铺AppKey
调整 商铺统计 更新时间 02:0-- 00:05
2026-10-21 18:27:07 +08:00

35 lines
1.0 KiB
C#

using MAX.Core.DependencyInjection;
using MAX.Core.Logger;
using Store.Framework.Jobs;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using System.Web;
namespace KJD_Web.Services.Shops;
/// <summary>
/// 更新商铺统计 每天0:5分 统计
/// </summary>
[Job("ShopStats", "5 0 * * *")]
public class ShopStatsJob : IScheduledJobs, ITransientDependency
{
private readonly ShopRevenueStatisticsService _shopRevenueStatisticsService;
private readonly ILoggerFacade _logger;
public ShopStatsJob(ShopRevenueStatisticsService shopRevenueStatisticsService, ILoggerFacade logger)
{
_shopRevenueStatisticsService = shopRevenueStatisticsService;
_logger = logger;
}
public Task RunAsync()
{
var data = DateTime.Now.AddDays(-1).Date;
_logger.Info($">>> 执行商铺统计更新:{data.ToString("yyyy-MM-dd")}");
_shopRevenueStatisticsService.UpdateStats(data);
_logger.Info($"<<< 执行商铺更新:{data.ToString("yyyy-MM-dd")}");
return Task.CompletedTask;
}
}