lingling
2025-03-19 8c4e906848c5f453369ead6cd8024aeb7b113771
添加过滤
4个文件已修改
1个文件已添加
1个文件已删除
116 ■■■■ 已修改文件
LifePayment/LifePayment.Application/LifePay/LifePayService.cs 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
LifePayment/LifePayment.Domain/Common/AbstractChannelFilter.cs 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
LifePayment/LifePayment.Domain/Common/ChannelFilter.cs 10 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
LifePayment/LifePayment.Domain/Common/ChannelHelper.cs 47 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
LifePayment/LifePayment.Domain/Common/IChannelFilter.cs 41 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
LifePayment/LifePayment.Host/LifePaymentServices.Application.Contracts.xml 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
LifePayment/LifePayment.Application/LifePay/LifePayService.cs
@@ -45,7 +45,7 @@
    private readonly IRepository<LifePayChannles, Guid> _lifePayChannlesRep;
    private readonly IRepository<LifePayAccount, Guid> _lifePayAccount;
    private readonly IDataFilter dataFilter;
    private readonly IChannelFilter _channelFilter;
    private readonly IAliPayApi _aliPayApi;
    private readonly IWxPayApi _wxPayApi;
    private readonly WxPayOption _wxPayOptions;
@@ -65,7 +65,8 @@
                          IOptions<WxPayOption> wxPayOptions,
                          IRepository<LifePayChannles, Guid> lifePayChannlesRep,
                          IRepository<LifePayAccount, Guid> lifePayAccount,
                          IDataFilter dataFilter)
                          IDataFilter dataFilter,
                          IChannelFilter channelFilter)
    {
        _logger = logger;
        _aCOOLYManager = aCOOLYManager;
@@ -81,6 +82,7 @@
        _lifePayChannlesRep = lifePayChannlesRep;
        _lifePayAccount = lifePayAccount;
        this.dataFilter = dataFilter;
        _channelFilter = channelFilter;
    }
    #region 查询
@@ -222,7 +224,8 @@
    /// <returns></returns>
    public async Task<PageOutput<LifePayOrderListOutput>> GetLifePayOrderPage(QueryLifePayOrderListInput input)
    {
        var result = await (from a in _lifePayOrderRepository.Where(x => x.PayStatus != LifePayStatusEnum.未支付)
        var result = await (from a in _channelFilter.GetChannelLifePayOrderFilter(_lifePayOrderRepository)
                      .WhereIf(input.BeginFinishTime.HasValue, x => x.FinishTime >= input.BeginFinishTime)
                                            .WhereIf(input.EndFinishTime.HasValue, x => x.FinishTime <= input.EndFinishTime)
                                            .WhereIf(input.BeginPayTime.HasValue, x => x.PayTime >= input.BeginPayTime)
LifePayment/LifePayment.Domain/Common/AbstractChannelFilter.cs
@@ -12,9 +12,9 @@
namespace LifePayment.Domain.Common
{
    public abstract class AbstractChannelFilter
    public abstract class AbstractChannelFilter : IChannelFilter, ISingletonDependency
    {
        public abstract Task<IQueryable<ChannelsBase>> GetChannelFilter(IQueryable<ChannelsBase> query);
        public abstract IQueryable<LifePayOrder> GetChannelLifePayOrderFilter(IQueryable<LifePayOrder> query);
        public IAbpLazyServiceProvider LazyServiceProvider { get; set; }
LifePayment/LifePayment.Domain/Common/ChannelFilter.cs
@@ -5,6 +5,7 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Channels;
using System.Threading.Tasks;
using Volo.Abp;
using Volo.Abp.Application.Services;
@@ -17,12 +18,17 @@
{
    public class ChannelFilter : AbstractChannelFilter
    {
        public async override Task<IQueryable<ChannelsBase>> GetChannelFilter(IQueryable<ChannelsBase> query)
        public  override IQueryable<LifePayOrder> GetChannelLifePayOrderFilter(IQueryable<LifePayOrder> query)
        {
            if (CurrentUser.ClientId == Constant.ClientType.Back)
        {
            var queryUser = UserChannleRepository.Where(r => r.UserId == CurrentUser.Id).Select(s => s.ChannleId).ToList();
            var queryResult = query.Where(s => queryUser.Contains(s.ChannleId));
                var queryResult = query.Where(s => (s.ChannelId.HasValue && queryUser.Contains(s.ChannelId.Value)) || !s.ChannelId.HasValue);
            return queryResult;
        }
            return query;
        }
    }
    public class ChannelsBase : Entity<Guid>
LifePayment/LifePayment.Domain/Common/ChannelHelper.cs
File was deleted
LifePayment/LifePayment.Domain/Common/IChannelFilter.cs
New file
@@ -0,0 +1,41 @@
using LifePayment.Domain.Models;
using System.Linq;
using System.Threading.Tasks;
using Volo.Abp.Domain.Entities;
namespace LifePayment.Domain
{
    public interface IChannelFilter
    {
        public IQueryable<LifePayOrder> GetChannelLifePayOrderFilter(IQueryable<LifePayOrder> query);
        //public static IQueryable<T> GetChannleQuery<T>(this IQueryable<T> query, ChannelFilterInput input) where T : class, IChannelData
        //{
        //    if (query == null)
        //    {
        //        return query;
        //    }
        //    if (input.Channels != null && input.Channels.Any())
        //    {
        //        query = query.Where(r => input.Channels.Contains(r.ChannelId));
        //    }
        //    return query;
        //}
    }
    //public interface IChannelData
    //{
    //   public Guid ChannleId { get; set; }
    //}
    //public class ChannelFilterInput
    //{
    //    public List<Guid> Channels { get; set; } = new List<Guid>();
    //}
}
LifePayment/LifePayment.Host/LifePaymentServices.Application.Contracts.xml
@@ -1715,6 +1715,11 @@
            角色
            </summary>
        </member>
        <member name="P:LifePayment.Application.Contracts.CreateAccountInput.ChannlesId">
            <summary>
            渠道列表
            </summary>
        </member>
        <member name="P:LifePayment.Application.Contracts.CreateAccountInput.OpenId">
            <summary>
            小程序OpenId