zhengyuxuan
2025-03-27 8d1d296a9a2f1e1fb6b20a9b49ae190bf57650da
fix:充值流水功能开发
6个文件已修改
57 ■■■■■ 已修改文件
LifePayment/LifePayment.Application.Contracts/LifePay/ILifePayOrderService.cs 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
LifePayment/LifePayment.Application.Contracts/LifePay/LifePayOutput.cs 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
LifePayment/LifePayment.Application/LifePay/LifePayOrderService.cs 19 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
LifePayment/LifePayment.Host/LifePaymentService.HttpApi.xml 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
LifePayment/LifePayment.Host/LifePaymentServices.Application.Contracts.xml 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
LifePayment/LifePayment.HttpApi/LifePay/LifePayController.cs 13 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
LifePayment/LifePayment.Application.Contracts/LifePay/ILifePayOrderService.cs
@@ -10,9 +10,8 @@
public interface ILifePayOrderService : IApplicationService
{
    Task<PageOutput<LifePayRechargeReceiptsListOutput>> GetLifePayRechargeReceiptsPage(LifePayRechargeReceiptsPageInput input);
    Task<LifePayRechargeReceiptsPageOutput<LifePayRechargeReceiptsListOutput>> GetLifePayRechargeReceiptsPage(LifePayRechargeReceiptsPageInput input);
    Task<decimal> GetTotalLifePayRechargeReceipts();
    Task AddUpdatePayRechargeReceipts(AddUpdatePayRechargeReceiptsInput input);
}
LifePayment/LifePayment.Application.Contracts/LifePay/LifePayOutput.cs
@@ -2,6 +2,7 @@
using System;
using System.Collections.Generic;
using ZeroD.Base.Web.Models;
using ZeroD.Util;
namespace LifePayment.Application.Contracts;
@@ -1109,6 +1110,16 @@
    /// </summary>
    public string Link { get; set; }
}
public class LifePayRechargeReceiptsPageOutput<T> : PageOutputBase
{
    public List<T> Data { get; set; } = new List<T>();
    /// <summary>
    /// 累计充值
    /// </summary>
    public decimal TotalRechargeAmount { get; set; }
}
public class LifePayRechargeReceiptsListOutput
{
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();
LifePayment/LifePayment.Host/LifePaymentService.HttpApi.xml
@@ -260,12 +260,6 @@
            <param name="input"></param>
            <returns></returns>
        </member>
        <member name="M:LifePayment.HttpApi.LifePayController.GetLifePayRechargeReceiptsPage">
            <summary>
            获取累计充值流水
            </summary>
            <returns></returns>
        </member>
        <member name="M:LifePayment.HttpApi.LifePayController.CreateLifePayPhoneOrder(LifePayment.Application.Contracts.CreateLifePayOrderInput{LifePayment.Application.Contracts.LifePhoneData})">
            <summary>
            创建生活缴费话费订单
LifePayment/LifePayment.Host/LifePaymentServices.Application.Contracts.xml
@@ -1563,6 +1563,11 @@
            在线客服链接
            </summary>
        </member>
        <member name="P:LifePayment.Application.Contracts.LifePayRechargeReceiptsPageOutput`1.TotalRechargeAmount">
            <summary>
            累计充值
            </summary>
        </member>
        <member name="P:LifePayment.Application.Contracts.LifePayRechargeReceiptsListOutput.Id">
            <summary>
            编号
LifePayment/LifePayment.HttpApi/LifePay/LifePayController.cs
@@ -436,21 +436,12 @@
        /// <param name="input"></param>
        /// <returns></returns>
        [HttpPost]
        public async Task<PageOutput<LifePayRechargeReceiptsListOutput>> GetLifePayRechargeReceiptsPage(LifePayRechargeReceiptsPageInput input)
        public async Task<LifePayRechargeReceiptsPageOutput<LifePayRechargeReceiptsListOutput>> GetLifePayRechargeReceiptsPage(LifePayRechargeReceiptsPageInput input)
        {
            return await _lifePayOrderService.GetLifePayRechargeReceiptsPage(input);
        }
        /// <summary>
        /// 获取累计充值流水
        /// </summary>
        /// <returns></returns>
        [HttpGet]
        public async Task<decimal> GetLifePayRechargeReceiptsPage()
        {
            return await _lifePayOrderService.GetTotalLifePayRechargeReceipts();
        }
        #endregion
        #region 操作