From 946e61a3eec7ee3beb63a70105f47a0cb978791b Mon Sep 17 00:00:00 2001 From: zhengyuxuan <zhengyuxuan1995> Date: 星期四, 20 三月 2025 17:43:13 +0800 Subject: [PATCH] fix:bug修复 --- LifePayment/LifePayment.Domain/LifePay/LifePayAccount.cs | 1 LifePayment/LifePayment.Application.Contracts/LifePay/LifePayOutput.cs | 43 ++++++++++++++ LifePayment/LifePayment.HttpApi/LifePay/LifePayController.cs | 12 ++-- LifePayment/LifePayment.Domain/LifePay/DallyStatistics.cs | 64 +++++++++++++++++++++ LifePayment/LifePayment.EntityFrameworkCore/LifePaymentServicesDbContext.cs | 2 LifePayment/LifePayment.Application.Contracts/LifePay/ILifePayService.cs | 2 LifePayment/LifePayment.Application/LifePay/LifePayService.cs | 25 ++++++++ 7 files changed, 140 insertions(+), 9 deletions(-) diff --git a/LifePayment/LifePayment.Application.Contracts/LifePay/ILifePayService.cs b/LifePayment/LifePayment.Application.Contracts/LifePay/ILifePayService.cs index 929f209..853074a 100644 --- a/LifePayment/LifePayment.Application.Contracts/LifePay/ILifePayService.cs +++ b/LifePayment/LifePayment.Application.Contracts/LifePay/ILifePayService.cs @@ -12,7 +12,7 @@ { - //Task<ElectricParValueResponse> GetTopStatistics(); + Task<TopStatisticsOutput> GetTopStatistics(); /// <summary> /// 鑾峰彇鐢佃垂闈㈠�� diff --git a/LifePayment/LifePayment.Application.Contracts/LifePay/LifePayOutput.cs b/LifePayment/LifePayment.Application.Contracts/LifePay/LifePayOutput.cs index a56a2db..dc33a4a 100644 --- a/LifePayment/LifePayment.Application.Contracts/LifePay/LifePayOutput.cs +++ b/LifePayment/LifePayment.Application.Contracts/LifePay/LifePayOutput.cs @@ -657,10 +657,12 @@ /// </summary> public LifePayStatusEnum PayStatus { get; set; } + + /// <summary> /// 璁㈠崟鐘舵�� /// </summary> - public LifePayOrderStatusEnum LifePayOrderStatus { get; set; } + public LifePayOrderStatusEnum Status { get; set; } /// <summary> /// 瀹屾垚鏃堕棿 @@ -692,6 +694,11 @@ public string RefundApplyRemark { get; set; } public string RefundCheckRemark { get; set; } + + /// <summary> + /// 閫�娆捐鍗曞彿 + /// </summary> + public string? RefundOrderNo { get; set; } /// <summary> /// 娓犻亾娴佹按鍙� @@ -807,5 +814,39 @@ /// </summary> public string AccumulatedReceipts { get; set; } + /// <summary> + /// 鏄ㄦ棩鏀舵 + /// </summary> + public string ReceiptsYesterda { get; set; } + + /// <summary> + /// 绱涓嬪崟 + /// </summary> + public string AccumulatedOrders { get; set; } + + /// <summary> + /// 鏄ㄦ棩涓嬪崟 + /// </summary> + public string OrdersNumYesterda { get; set; } + + /// <summary> + /// 鏄ㄦ棩鎴愬姛 + /// </summary> + public string YesterdaSuccess { get; set; } + + /// <summary> + /// 鏄ㄦ棩澶辫触 + /// </summary> + public string YesterdaFail { get; set; } + + /// <summary> + /// 绱鐢ㄦ埛 + /// </summary> + public string AccumulatedUsers { get; set; } + + /// <summary> + /// 鏄ㄦ棩娲昏穬鐢ㄦ埛 + /// </summary> + public string YesterdayActiveUsers { get; set; } } \ No newline at end of file diff --git a/LifePayment/LifePayment.Application/LifePay/LifePayService.cs b/LifePayment/LifePayment.Application/LifePay/LifePayService.cs index c6e55a9..866cf83 100644 --- a/LifePayment/LifePayment.Application/LifePay/LifePayService.cs +++ b/LifePayment/LifePayment.Application/LifePay/LifePayService.cs @@ -23,6 +23,8 @@ using static LifePayment.Domain.Shared.LifePaymentConstant; using ZeroD.Util.Fadd; using Nest; +using Volo.Abp.Domain.Entities; +using Volo.Abp.ObjectMapping; namespace LifePayment.Application; @@ -36,6 +38,7 @@ private readonly IRepository<LifePayOrder, Guid> _lifePayOrderRepository; private readonly IRepository<LifePayUser, Guid> _lifePayUserRepository; private readonly IRepository<LifePayIntroInfo, Guid> _lifePayIntroInfoRepository; + private readonly IRepository<DallyStatistics, Guid> _dallyStatisticsRepository; private readonly IRepository<LifePayChannles, Guid> _lifePayChannlesRep; private readonly IRepository<LifePayAccount, Guid> _lifePayAccount; private readonly IDataFilter dataFilter; @@ -54,6 +57,7 @@ IRepository<LifePayUser, Guid> lifePayUserRepository, IRepository<LifePayPremium, Guid> lifePayPremiumRepository, IRepository<LifePayIntroInfo, Guid> lifePayIntroInfoRepository, + IRepository<DallyStatistics, Guid> dallyStatisticsRepository, IAliPayApi aliPayApi, IWxPayApi wxPayApi, IOptions<WxPayOption> wxPayOptions, @@ -69,6 +73,7 @@ _lifePayUserRepository = lifePayUserRepository; _lifePayPremiumRepository = lifePayPremiumRepository; _lifePayIntroInfoRepository = lifePayIntroInfoRepository; + _dallyStatisticsRepository = dallyStatisticsRepository; _aliPayApi = aliPayApi; _wxPayApi = wxPayApi; _wxPayOptions = wxPayOptions.Value; @@ -80,6 +85,23 @@ } #region 鏌ヨ + + public async Task<TopStatisticsOutput> GetTopStatistics() + { + var today = DateTime.Now.ToString("yyyy-MM-dd"); + var statistics = await _dallyStatisticsRepository.Where(x => x.CreationTime.ToString("yyyy-MM-dd") == today).FirstOrDefaultAsync(); + if (statistics == null) + { + + return new TopStatisticsOutput(); + } + else + { + var result = ObjectMapper.Map<DallyStatistics,TopStatisticsOutput>(statistics); + return result; + } + + } /// <summary> /// 鑾峰彇鐢佃垂闈㈠�� @@ -336,7 +358,7 @@ Id = order.Id, OutOrderNo = order.OutOrderNo, LifePayChannle = channle.ChannlesName, - LifePayOrderStatus = order.LifePayOrderStatus, + Status = order.LifePayOrderStatus, LifePayOrderType = order.LifePayOrderType, LifePayType = order.LifePayType, OrderNo = order.OrderNo, @@ -349,6 +371,7 @@ RefundCheckRemark = order.RefundCheckRemark, RefundApplyRemark = order.RefundApplyRemark, RefundTime = order.RefundTime, + RefundOrderNo = order.RefundOrderNo, ACOOLYOrderNo = order.ACOOLYOrderNo, LifePayRefundStatus = order.LifePayRefundStatus, ActualRechargeAmount = order.ActualRechargeAmount, diff --git a/LifePayment/LifePayment.Domain/LifePay/DallyStatistics.cs b/LifePayment/LifePayment.Domain/LifePay/DallyStatistics.cs new file mode 100644 index 0000000..5573d52 --- /dev/null +++ b/LifePayment/LifePayment.Domain/LifePay/DallyStatistics.cs @@ -0,0 +1,64 @@ +锘縰sing LifePayment.Domain.Shared; +using System; +using Volo.Abp; +using Volo.Abp.Domain.Entities; +using Volo.Abp.Domain.Entities.Auditing; + +namespace LifePayment.Domain; + +public partial class DallyStatistics : Entity<Guid> +{ + public DallyStatistics() + { + } + + /// <summary> + /// 缁熻鏃堕棿 + /// </summary> + public DateTime CreationTime { get; set; } + + /// <summary> + /// 璐︽埛浣欓 + /// </summary> + public string Amount { get; set; } + + /// <summary> + /// 绱鏀舵 + /// </summary> + public string AccumulatedReceipts { get; set; } + + /// <summary> + /// 鏄ㄦ棩鏀舵 + /// </summary> + public string ReceiptsYesterda { get; set; } + + /// <summary> + /// 绱涓嬪崟 + /// </summary> + public string AccumulatedOrders { get; set; } + + /// <summary> + /// 鏄ㄦ棩涓嬪崟 + /// </summary> + public string OrdersNumYesterda { get; set; } + + /// <summary> + /// 鏄ㄦ棩鎴愬姛 + /// </summary> + public string YesterdaSuccess { get; set; } + + /// <summary> + /// 鏄ㄦ棩澶辫触 + /// </summary> + public string YesterdaFail { get; set; } + + /// <summary> + /// 绱鐢ㄦ埛 + /// </summary> + public string AccumulatedUsers { get; set; } + + /// <summary> + /// 鏄ㄦ棩娲昏穬鐢ㄦ埛 + /// </summary> + public string YesterdayActiveUsers { get; set; } +} \ No newline at end of file diff --git a/LifePayment/LifePayment.Domain/LifePay/LifePayAccount.cs b/LifePayment/LifePayment.Domain/LifePay/LifePayAccount.cs index e2db0a5..e9207e6 100644 --- a/LifePayment/LifePayment.Domain/LifePay/LifePayAccount.cs +++ b/LifePayment/LifePayment.Domain/LifePay/LifePayAccount.cs @@ -10,6 +10,7 @@ public LifePayAccount() { } + /// <summary> /// 鐢ㄦ埛缂栧彿 /// </summary> diff --git a/LifePayment/LifePayment.EntityFrameworkCore/LifePaymentServicesDbContext.cs b/LifePayment/LifePayment.EntityFrameworkCore/LifePaymentServicesDbContext.cs index 7b57d02..effc166 100644 --- a/LifePayment/LifePayment.EntityFrameworkCore/LifePaymentServicesDbContext.cs +++ b/LifePayment/LifePayment.EntityFrameworkCore/LifePaymentServicesDbContext.cs @@ -42,6 +42,8 @@ public virtual DbSet<LifePayAccount> LifePayAccount { get; set; } + public virtual DbSet<DallyStatistics> DallyStatistics { get; set; } + [UnitOfWork] protected override void OnModelCreating(ModelBuilder builder) { diff --git a/LifePayment/LifePayment.HttpApi/LifePay/LifePayController.cs b/LifePayment/LifePayment.HttpApi/LifePay/LifePayController.cs index e3c7a06..893a7e7 100644 --- a/LifePayment/LifePayment.HttpApi/LifePay/LifePayController.cs +++ b/LifePayment/LifePayment.HttpApi/LifePay/LifePayController.cs @@ -39,12 +39,12 @@ /// 鑾峰彇椤堕儴缁熻鏁版嵁 /// </summary> /// <returns></returns> - //[HttpGet] - //[AllowAnonymous] - //public async Task<TopStatisticsOutput> GetTopStatistics() - //{ - // return await _lifePayService.GetTopStatistics(); - //} + [HttpGet] + [AllowAnonymous] + public async Task<TopStatisticsOutput> GetTopStatistics() + { + return await _lifePayService.GetTopStatistics(); + } /// <summary> /// 鑾峰彇鐢佃垂闈㈠�� -- Gitblit v1.9.1