zhengyuxuan
2025-03-27 01962d7f7d9bb4963546eb0c79b921995e6fe271
提交
3个文件已添加
8个文件已修改
327 ■■■■■ 已修改文件
LifePayment/LifePayment.Application.Contracts/LifePay/ILifePayOrderService.cs 15 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
LifePayment/LifePayment.Application.Contracts/LifePay/LifePayInput.cs 42 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
LifePayment/LifePayment.Application.Contracts/LifePay/LifePayOutput.cs 28 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
LifePayment/LifePayment.Application/LifePay/LifePayOrderService.cs 90 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
LifePayment/LifePayment.Application/LifePay/LifePayService.cs 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
LifePayment/LifePayment.Domain/Common/ChannelFilter.cs 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
LifePayment/LifePayment.Domain/LifePay/LifePayRechargeReceipts.cs 37 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
LifePayment/LifePayment.EntityFrameworkCore/LifePaymentServicesDbContext.cs 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
LifePayment/LifePayment.Host/LifePaymentService.HttpApi.xml 14 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
LifePayment/LifePayment.Host/LifePaymentServices.Application.Contracts.xml 60 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
LifePayment/LifePayment.HttpApi/LifePay/LifePayController.cs 30 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
LifePayment/LifePayment.Application.Contracts/LifePay/ILifePayOrderService.cs
New file
@@ -0,0 +1,15 @@
using LifePayment.Domain.Shared;
using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using Volo.Abp;
using Volo.Abp.Application.Services;
using ZeroD.Util;
namespace LifePayment.Application.Contracts;
public interface ILifePayOrderService : IApplicationService
{
    Task<PageOutput<LifePayRechargeReceiptsListOutput>> GetLifePayRechargeReceiptsPage(LifePayRechargeReceiptsPageInput input);
    Task AddUpdatePayRechargeReceipts(AddUpdatePayRechargeReceiptsInput input);
}
LifePayment/LifePayment.Application.Contracts/LifePay/LifePayInput.cs
@@ -586,4 +586,46 @@
    public decimal Profit { get; set; }
}
public class LifePayRechargeReceiptsPageInput : ChannelsBaseInput
{
    public string? OrderNo { get; set; }
    /// <summary>
    /// 记账开始时间
    /// </summary>
    public DateTime? CreationTimeBegin { get; set; }
    /// <summary>
    /// 记账结束时间
    /// </summary>
    public DateTime? CreationTimeEnd { get; set; }
}
public class AddUpdatePayRechargeReceiptsInput
{
    /// <summary>
    /// 编号
    /// </summary>
    public Guid? Id { get; set; }
    /// <summary>
    /// 业务订单号
    /// </summary>
    public string OrderNo { get; set; }
    /// <summary>
    /// 充值金额
    /// </summary>
    public decimal RechargeAmount { get; set; }
    /// <summary>
    /// 备注
    /// </summary>
    public string? Remark { get; set; }
    /// <summary>
    /// 充值凭证
    /// </summary>
    public string Voucher { get; set; }
}
LifePayment/LifePayment.Application.Contracts/LifePay/LifePayOutput.cs
@@ -1108,4 +1108,32 @@
    /// 在线客服链接
    /// </summary>
    public string Link { get; set; }
}
public class LifePayRechargeReceiptsListOutput
{
    /// <summary>
    /// 编号
    /// </summary>
    public Guid Id { get; set; }
    /// <summary>
    /// 业务订单号
    /// </summary>
    public string OrderNo { get; set; }
    /// <summary>
    /// 充值金额
    /// </summary>
    public decimal RechargeAmount { get; set; }
    /// <summary>
    /// 备注
    /// </summary>
    public string Remark { get; set; }
    /// <summary>
    /// 凭证
    /// </summary>
    public string Voucher { get; set; }
}
LifePayment/LifePayment.Application/LifePay/LifePayOrderService.cs
New file
@@ -0,0 +1,90 @@
using LifePayment.Application.Contracts;
using LifePayment.Domain.LifePay;
using LifePayment.Domain.Models;
using LifePayment.Domain.Shared;
using LifePayment.Domain;
using Microsoft.Extensions.Logging;
using Microsoft.Extensions.Options;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Volo.Abp.Application.Services;
using Volo.Abp.Domain.Repositories;
using Microsoft.EntityFrameworkCore;
using ZeroD.Util;
namespace LifePayment.Application.LifePay
{
    public class LifePayOrderService : ApplicationService, ILifePayOrderService
    {
        private readonly IRepository<LifePayRechargeReceipts, Guid> _lifePayRechargeReceiptsRepository;
        public LifePayOrderService(
                              IRepository<LifePayRechargeReceipts, Guid> lifePayRechargeReceiptsRepository)
        {
            _lifePayRechargeReceiptsRepository = lifePayRechargeReceiptsRepository;
        }
        /// <summary>
        /// 获取充值流水
        /// </summary>
        /// <param name="input"></param>
        /// <returns></returns>
        public async Task<PageOutput<LifePayRechargeReceiptsListOutput>> GetLifePayRechargeReceiptsPage(LifePayRechargeReceiptsPageInput input)
        {
            var list = await _lifePayRechargeReceiptsRepository.Where(x => x.IsDeleted == false)
                .WhereIf(input.OrderNo.IsNotNullOrEmpty(), x => x.OrderNo.Contains(input.OrderNo))
                .WhereIf(input.CreationTimeBegin.HasValue, x => x.CreationTime >= input.CreationTimeBegin)
                .WhereIf(input.CreationTimeEnd.HasValue, x => x.CreationTime <= input.CreationTimeEnd)
                .Select(x => new LifePayRechargeReceiptsListOutput()
                {
                    Id = x.Id,
                    OrderNo = x.OrderNo,
                    RechargeAmount = x.RechargeAmount,
                    Remark = x.Remark,
                    Voucher = x.Voucher,
                })
                .GetPageResult(input.PageModel);
            return list;
        }
        //public async Task GetTotalLifePayRechargeReceipts()
        //{
        //}
        /// <summary>
        /// 编辑充值流水
        /// </summary>
        /// <param name="input"></param>
        /// <returns></returns>
        public async Task AddUpdatePayRechargeReceipts(AddUpdatePayRechargeReceiptsInput input)
        {
            CheckExtensions.IfTrueThrowUserFriendlyException(input.OrderNo == null, "请输入业务订单号");
            CheckExtensions.IfTrueThrowUserFriendlyException(input.RechargeAmount <= 0, "充值金额应大于0");
            CheckExtensions.IfTrueThrowUserFriendlyException(input.Voucher == null, "请提交充值凭证");
            if (input.Id.HasValue)
            {
                var payRechargeReceipts = await _lifePayRechargeReceiptsRepository.Where(x => x.IsDeleted == false && x.Id == input.Id.Value).FirstOrDefaultAsync();
                payRechargeReceipts.OrderNo = input.OrderNo;
                payRechargeReceipts.RechargeAmount = input.RechargeAmount;
                payRechargeReceipts.Remark = input.Remark;
                payRechargeReceipts.Voucher = input.Voucher;
            }
            else
            {
                LifePayRechargeReceipts payRechargeReceipts = new LifePayRechargeReceipts()
                {
                    Id = Guid.NewGuid(),
                    OrderNo = input.OrderNo,
                    RechargeAmount = input.RechargeAmount,
                    Remark = input.Remark,
                    Voucher = input.Voucher,
                };
                await _lifePayRechargeReceiptsRepository.InsertAsync(payRechargeReceipts);
            }
        }
    }
}
LifePayment/LifePayment.Application/LifePay/LifePayService.cs
@@ -837,10 +837,10 @@
        var channle = await GetLifePayChannlesDtoByNum(input.ChannelId);
        CheckExtensions.IfTrueThrowUserFriendlyException(channle == null, "渠道不存在");
        var repeatOrder = await _lifePayOrderRepository.Where(x => x.LifePayOrderType == LifePayOrderTypeEnum.话费订单
        var repeatOrder = await _lifePayOrderRepository.Where(x => x.LifePayOrderType == LifePayOrderTypeEnum.话费订单 && x.PayStatus == LifePayStatusEnum.已支付
        && x.LifePayOrderStatus == LifePayOrderStatusEnum.充值中 && x.OrderParamDetailJsonStr.Contains(input.ProductData.IspCode)
        && x.OrderParamDetailJsonStr.Contains(input.ProductData.Phone)).ToListAsync();
        CheckExtensions.IfTrueThrowUserFriendlyException(repeatOrder.Count() > 0, "您有同户号订单正在充值中,请勿重复充值");
         CheckExtensions.IfTrueThrowUserFriendlyException(repeatOrder.Count() > 0, "您有同户号订单正在充值中,请勿重复充值");
        //var rate = await GetRate();
        //CheckExtensions.IfTrueThrowUserFriendlyException(rate.IsNullOrEmpty(), "未配置折扣");
@@ -898,7 +898,7 @@
        //var rate = await GetRate();
        //CheckExtensions.IfTrueThrowUserFriendlyException(rate.IsNullOrEmpty(), "未配置折扣");
        var repeatOrder = await _lifePayOrderRepository.Where(x => x.LifePayOrderType == LifePayOrderTypeEnum.电费订单
        var repeatOrder = await _lifePayOrderRepository.Where(x => x.LifePayOrderType == LifePayOrderTypeEnum.电费订单 && x.PayStatus == LifePayStatusEnum.已支付
         && x.LifePayOrderStatus == LifePayOrderStatusEnum.充值中 && x.OrderParamDetailJsonStr.Contains(input.ProductData.ElectricType)
         && x.OrderParamDetailJsonStr.Contains(input.ProductData.ElectricAccount)).ToListAsync();
                CheckExtensions.IfTrueThrowUserFriendlyException(repeatOrder.Count() > 0, "您有同户号订单正在充值中,请勿重复充值");
@@ -953,7 +953,7 @@
        //var rate = await GetRate();
        //CheckExtensions.IfTrueThrowUserFriendlyException(rate.IsNullOrEmpty(), "未配置折扣");
        var repeatOrder = await _lifePayOrderRepository.Where(x => x.LifePayOrderType == LifePayOrderTypeEnum.燃气订单
        var repeatOrder = await _lifePayOrderRepository.Where(x => x.LifePayOrderType == LifePayOrderTypeEnum.燃气订单 && x.PayStatus == LifePayStatusEnum.已支付
        && x.LifePayOrderStatus == LifePayOrderStatusEnum.充值中 && x.OrderParamDetailJsonStr.Contains(input.ProductData.GasOrgType)
        && x.OrderParamDetailJsonStr.Contains(input.ProductData.GasAccount)).ToListAsync();
        CheckExtensions.IfTrueThrowUserFriendlyException(repeatOrder.Count() > 0, "您有同户号订单正在充值中,请勿重复充值");
LifePayment/LifePayment.Domain/Common/ChannelFilter.cs
@@ -40,7 +40,6 @@
                var queryUser = UserChannleRepository.Where(r => r.UserId == CurrentUser.Id).Select(s => s.ChannleId).ToList();
                if (queryUser.Count() > 0)
                {
                    var queryResult = query.Where(s => (!string.IsNullOrEmpty(s.CreationChannleNum) && queryUser.Contains(s.CreationChannleNum)) || string.IsNullOrEmpty(s.CreationChannleNum));
                    return queryResult;
                }
LifePayment/LifePayment.Domain/LifePay/LifePayRechargeReceipts.cs
New file
@@ -0,0 +1,37 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Volo.Abp.Domain.Entities.Auditing;
using Volo.Abp;
namespace LifePayment.Domain.LifePay
{
    public class LifePayRechargeReceipts : FullAuditedEntity<Guid>, IDataUserFilter
    {
        public LifePayRechargeReceipts()
        {
        }
        /// <summary>
        /// 业务订单号
        /// </summary>
        public string OrderNo { get; set; }
        /// <summary>
        /// 充值金额
        /// </summary>
        public decimal RechargeAmount { get; set; }
        /// <summary>
        /// 备注
        /// </summary>
        public string Remark { get; set; }
        /// <summary>
        /// 凭证
        /// </summary>
        public string Voucher { get; set; }
    }
}
LifePayment/LifePayment.EntityFrameworkCore/LifePaymentServicesDbContext.cs
@@ -25,6 +25,8 @@
        public virtual DbSet<LifePayPremium> LifePayPremium { get; set; }
        public virtual DbSet<LifePayRechargeReceipts> LifePayRechargeReceipts { get; set; }
        public virtual DbSet<Area> Area { get; set; }
        public virtual DbSet<User> Users { get; set; }
LifePayment/LifePayment.Host/LifePaymentService.HttpApi.xml
@@ -253,6 +253,13 @@
            <param name="input"></param>
            <returns></returns>
        </member>
        <member name="M:LifePayment.HttpApi.LifePayController.GetLifePayRechargeReceiptsPage(LifePayment.Application.Contracts.LifePayRechargeReceiptsPageInput)">
            <summary>
            获取充值流水分页数据
            </summary>
            <param name="input"></param>
            <returns></returns>
        </member>
        <member name="M:LifePayment.HttpApi.LifePayController.CreateLifePayPhoneOrder(LifePayment.Application.Contracts.CreateLifePayOrderInput{LifePayment.Application.Contracts.LifePhoneData})">
            <summary>
            创建生活缴费话费订单
@@ -361,6 +368,13 @@
            <param name="input"></param>
            <returns></returns>
        </member>
        <member name="M:LifePayment.HttpApi.LifePayController.AddUpdatePayRechargeReceipts(LifePayment.Application.Contracts.AddUpdatePayRechargeReceiptsInput)">
            <summary>
            上传充值流水
            </summary>
            <param name="input"></param>
            <returns></returns>
        </member>
        <member name="M:LifePayment.HttpApi.LifePayController.SetLifePayOrderPayType(LifePayment.Domain.Shared.SetLifePayOrderPayTypeInput)">
            <summary>
            设置生活缴费支付类型
LifePayment/LifePayment.Host/LifePaymentServices.Application.Contracts.xml
@@ -683,6 +683,41 @@
            利润
            </summary>
        </member>
        <member name="P:LifePayment.Application.Contracts.LifePayRechargeReceiptsPageInput.CreationTimeBegin">
            <summary>
            记账开始时间
            </summary>
        </member>
        <member name="P:LifePayment.Application.Contracts.LifePayRechargeReceiptsPageInput.CreationTimeEnd">
            <summary>
            记账结束时间
            </summary>
        </member>
        <member name="P:LifePayment.Application.Contracts.AddUpdatePayRechargeReceiptsInput.Id">
            <summary>
            编号
            </summary>
        </member>
        <member name="P:LifePayment.Application.Contracts.AddUpdatePayRechargeReceiptsInput.OrderNo">
            <summary>
            业务订单号
            </summary>
        </member>
        <member name="P:LifePayment.Application.Contracts.AddUpdatePayRechargeReceiptsInput.RechargeAmount">
            <summary>
            充值金额
            </summary>
        </member>
        <member name="P:LifePayment.Application.Contracts.AddUpdatePayRechargeReceiptsInput.Remark">
            <summary>
            备注
            </summary>
        </member>
        <member name="P:LifePayment.Application.Contracts.AddUpdatePayRechargeReceiptsInput.Voucher">
            <summary>
            充值凭证
            </summary>
        </member>
        <member name="P:LifePayment.Application.Contracts.LifePayIntroInfoInput.LifePayType">
            <summary>
            生活缴费类型
@@ -1528,6 +1563,31 @@
            在线客服链接
            </summary>
        </member>
        <member name="P:LifePayment.Application.Contracts.LifePayRechargeReceiptsListOutput.Id">
            <summary>
            编号
            </summary>
        </member>
        <member name="P:LifePayment.Application.Contracts.LifePayRechargeReceiptsListOutput.OrderNo">
            <summary>
            业务订单号
            </summary>
        </member>
        <member name="P:LifePayment.Application.Contracts.LifePayRechargeReceiptsListOutput.RechargeAmount">
            <summary>
            充值金额
            </summary>
        </member>
        <member name="P:LifePayment.Application.Contracts.LifePayRechargeReceiptsListOutput.Remark">
            <summary>
            备注
            </summary>
        </member>
        <member name="P:LifePayment.Application.Contracts.LifePayRechargeReceiptsListOutput.Voucher">
            <summary>
            凭证
            </summary>
        </member>
        <member name="P:LifePayment.Application.Contracts.RecordOperateHistoryEto.RelationId">
            <summary>
            关联关系ID
LifePayment/LifePayment.HttpApi/LifePay/LifePayController.cs
@@ -1,4 +1,5 @@
using LifePayment.Application.Contracts;
using LifePayment.Application.LifePay;
using LifePayment.Domain.Common;
using LifePayment.Domain.Shared;
using Microsoft.AspNetCore.Authorization;
@@ -24,19 +25,22 @@
        private readonly IStatisticsService _statisticsService;
        private readonly IWebClientInfoProvider _webClientInfoProvider;
        private readonly ICommonService _commonService;
        private readonly ILifePayOrderService _lifePayOrderService;
        private readonly ILogger<LifePayController> _logger;
        public LifePayController(
              ILifePayService lifePayService,
              IStatisticsService statisticsService,
              IWebClientInfoProvider webClientInfoProvider,
              ICommonService commonService
            , ILogger<LifePayController> logger
              ICommonService commonService,
              ILifePayOrderService lifePayOrderService,
              ILogger<LifePayController> logger
              )
        {
            _lifePayService = lifePayService;
            _statisticsService = statisticsService;
            _webClientInfoProvider = webClientInfoProvider;
            _commonService = commonService;
            _lifePayOrderService = lifePayOrderService;
            _logger = logger;
        }
@@ -426,6 +430,17 @@
            return data;
        }
        /// <summary>
        /// 获取充值流水分页数据
        /// </summary>
        /// <param name="input"></param>
        /// <returns></returns>
        [HttpPost]
        public async Task<PageOutput<LifePayRechargeReceiptsListOutput>> GetLifePayRechargeReceiptsPage(LifePayRechargeReceiptsPageInput input)
        {
            return await _lifePayOrderService.GetLifePayRechargeReceiptsPage(input);
        }
        #endregion
@@ -621,6 +636,17 @@
            return Constant.SUCCESS;
        }
        /// <summary>
        /// 上传充值流水
        /// </summary>
        /// <param name="input"></param>
        /// <returns></returns>
        [HttpPost]
        public async Task<int> AddUpdatePayRechargeReceipts(AddUpdatePayRechargeReceiptsInput input)
        {
            await _lifePayOrderService.AddUpdatePayRechargeReceipts(input);
            return Constant.SUCCESS;
        }
        /// <summary>
        /// 设置生活缴费支付类型