zhengyuxuan
2025-03-27 8d1d296a9a2f1e1fb6b20a9b49ae190bf57650da
LifePayment/LifePayment.Application/LifePay/LifePayOrderService.cs
@@ -29,7 +29,7 @@
        /// </summary>
        /// <param name="input"></param>
        /// <returns></returns>
        public async Task<PageOutput<LifePayRechargeReceiptsListOutput>> GetLifePayRechargeReceiptsPage(LifePayRechargeReceiptsPageInput input)
        public async Task<LifePayRechargeReceiptsPageOutput<LifePayRechargeReceiptsListOutput>> GetLifePayRechargeReceiptsPage(LifePayRechargeReceiptsPageInput input)
        {
            var list = await _lifePayRechargeReceiptsRepository.Where(x => x.IsDeleted == false)
                .WhereIf(input.OrderNo.IsNotNullOrEmpty(), x => x.OrderNo.Contains(input.OrderNo))
@@ -44,14 +44,19 @@
                    Voucher = x.Voucher.GetOssPath(),
                })
                .GetPageResult(input.PageModel);
            return list;
        }
        public async Task<decimal> GetTotalLifePayRechargeReceipts()
        {
            var result = await _lifePayRechargeReceiptsRepository.Where(x => x.IsDeleted == false).SumAsync(x => x.RechargeAmount);
            var total = await _lifePayRechargeReceiptsRepository.Where(x => x.IsDeleted == false).SumAsync(x => x.RechargeAmount);
            LifePayRechargeReceiptsPageOutput<LifePayRechargeReceiptsListOutput> result = new LifePayRechargeReceiptsPageOutput<LifePayRechargeReceiptsListOutput>();
            result.Data = list.Data;
            result.TotalRechargeAmount = total;
            return result;
        }
        //public async Task<decimal> GetTotalLifePayRechargeReceipts()
        //{
        //    var result = await _lifePayRechargeReceiptsRepository.Where(x => x.IsDeleted == false).SumAsync(x => x.RechargeAmount);
        //    return result;
        //}
        /// <summary>
        /// 编辑充值流水
@@ -63,6 +68,8 @@
            CheckExtensions.IfTrueThrowUserFriendlyException(input.OrderNo == null, "请输入业务订单号");
            CheckExtensions.IfTrueThrowUserFriendlyException(input.RechargeAmount <= 0, "充值金额应大于0");
            CheckExtensions.IfTrueThrowUserFriendlyException(input.Voucher == null, "请提交充值凭证");
            var repeat = await _lifePayRechargeReceiptsRepository.Where(x => x.IsDeleted == false && x.OrderNo == input.OrderNo).FirstOrDefaultAsync();
            CheckExtensions.IfTrueThrowUserFriendlyException(repeat != null && repeat.Id != input.Id, "业务订单号重复");
            if (input.Id.HasValue)
            {
                var payRechargeReceipts = await _lifePayRechargeReceiptsRepository.Where(x => x.IsDeleted == false && x.Id == input.Id.Value).FirstOrDefaultAsync();