| | |
| | | using DynamicQuery.Net.Dto.Input; |
| | | using LifePayment.Application.Contracts; |
| | | using LifePayment.Application.Contracts; |
| | | using LifePayment.Domain; |
| | | using LifePayment.Domain.LifePay; |
| | | using LifePayment.Domain.Models; |
| | | using LifePayment.Domain.Shared; |
| | | using MailKit.Search; |
| | | using Microsoft.EntityFrameworkCore; |
| | | using Microsoft.Extensions.Logging; |
| | | using Microsoft.Extensions.Options; |
| | | using Nest; |
| | | using Newtonsoft.Json; |
| | | using NPOI.OpenXmlFormats.Dml.Chart; |
| | | using NPOI.SS.Formula.Functions; |
| | | using StackExchange.Redis; |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | | using System.Security.Cryptography; |
| | | using System.Linq.Dynamic.Core; |
| | | using System.Threading.Tasks; |
| | | using Volo.Abp; |
| | | using Volo.Abp.Application.Services; |
| | | using Volo.Abp.Domain.Entities; |
| | | using Volo.Abp.Data; |
| | | using Volo.Abp.Domain.Repositories; |
| | | using Volo.Abp.EventBus.Distributed; |
| | | using ZeroD.Util; |
| | | using ZeroD.Util.Fadd; |
| | | using static LifePayment.Domain.Shared.LifePaymentConstant; |
| | | using Volo.Abp.Data; |
| | | using Z.EntityFramework.Plus; |
| | | using LifePayment.Domain.LifePay; |
| | | using pingan.openbank.api.sdk.enums; |
| | | using System.Linq.Dynamic.Core; |
| | | using static Volo.Abp.Identity.Settings.IdentitySettingNames; |
| | | using ZeroD.Util; |
| | | using static LifePayment.Domain.Shared.LifePaymentConstant; |
| | | |
| | | namespace LifePayment.Application; |
| | | |
| | |
| | | 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; |
| | |
| | | IOptions<WxPayOption> wxPayOptions, |
| | | IRepository<LifePayChannles, Guid> lifePayChannlesRep, |
| | | IRepository<LifePayAccount, Guid> lifePayAccount, |
| | | IDataFilter dataFilter) |
| | | IDataFilter dataFilter, |
| | | IChannelFilter channelFilter) |
| | | { |
| | | _logger = logger; |
| | | _aCOOLYManager = aCOOLYManager; |
| | |
| | | _lifePayChannlesRep = lifePayChannlesRep; |
| | | _lifePayAccount = lifePayAccount; |
| | | this.dataFilter = dataFilter; |
| | | _channelFilter = channelFilter; |
| | | } |
| | | |
| | | #region 查询 |
| | |
| | | public async Task<List<LifePayIntroInfoOutput>> GetIntroInfo(LifePayOrderTypeEnum lifePayType) |
| | | { |
| | | return await _lifePayIntroInfoRepository.Where(x => x.IsDeleted == false && x.LifePayType == lifePayType).OrderBy(x => x.Sequence) |
| | | .Select(x => new LifePayIntroInfoOutput() { Type = x.Type, ContentSummary = x.ContentSummary, Content = x.Content, LifePayType = x.LifePayType,Path = x.Path,Sequence = x.Sequence }) |
| | | .Select(x => new LifePayIntroInfoOutput() { Type = x.Type, ContentSummary = x.ContentSummary, Content = x.Content, LifePayType = x.LifePayType, Path = x.Path, Sequence = x.Sequence }) |
| | | .ToListAsync(); |
| | | } |
| | | |
| | |
| | | /// <returns></returns> |
| | | public async Task<PageOutput<UserListOutput>> GetUserPage(QueryUserPageInput input) |
| | | { |
| | | return await _lifePayUserRepository.Where(x => x.IsDeleted == false) |
| | | return await _channelFilter.GetChannelLifePayUserFilter(_lifePayUserRepository).Where(x => x.IsDeleted == false) |
| | | .WhereIf(!string.IsNullOrEmpty(input.QueryCondition), x => x.PhoneNumber.Contains(input.QueryCondition) || x.Name.Contains(input.QueryCondition)) |
| | | .WhereIf(input.CreationTime.HasValue, x => x.CreationTime.ToString("yyyy-MM-dd") == input.CreationTime.Value.ToString("yyyy-MM-dd")) |
| | | .Select(x => |
| | |
| | | }) |
| | | .GetPageResult(input.PageModel); |
| | | } |
| | | |
| | | } |
| | | |
| | | /// <summary> |
| | |
| | | /// <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) |
| | |
| | | .WhereIf(input.LifePayOrderType.HasValue, x => x.LifePayOrderType == input.LifePayOrderType.Value) |
| | | .WhereIf(input.UserId.HasValue, x => x.UserId == input.UserId.Value) |
| | | .WhereIf(input.KeyWords.IsNotNullOrEmpty(), x => x.PhoneNumber.Contains(input.KeyWords) || x.OrderNo.Contains(input.KeyWords) || x.OutOrderNo.Contains(input.KeyWords) || x.ACOOLYOrderNo.Contains(input.KeyWords)) |
| | | join b in _lifePayChannlesRep on a.ChannelId equals b.Id into temp |
| | | join b in _lifePayChannlesRep on a.ChannelId equals b.ChannlesNum into temp |
| | | from b in temp.DefaultIfEmpty() |
| | | select new LifePayOrderListOutput |
| | | { |
| | |
| | | return new PageOutput<UserLifePayOrderOutput>(); |
| | | } |
| | | |
| | | return await _lifePayOrderRepository.Where(x => x.PayStatus != LifePayStatusEnum.未支付) |
| | | return await _channelFilter.GetChannelLifePayOrderFilter(_lifePayOrderRepository).Where(x => x.PayStatus != LifePayStatusEnum.未支付) |
| | | .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) |
| | |
| | | |
| | | public async Task<UserLifePayOrderRefundOutput> GetUserLifePayOrderRefund(Guid id) |
| | | { |
| | | var order = await _lifePayOrderRepository.Where(x => x.Id == id).Select(x => |
| | | var order = await _channelFilter.GetChannelLifePayOrderFilter(_lifePayOrderRepository).Where(x => x.Id == id).Select(x => |
| | | new UserLifePayOrderRefundOutput |
| | | { |
| | | Id = x.Id, |
| | |
| | | .WhereIf(input.LifePayOrderType.HasValue, x => x.LifePayOrderType == input.LifePayOrderType.Value) |
| | | .WhereIf(input.UserId.HasValue, x => x.UserId == input.UserId.Value) |
| | | .WhereIf(input.KeyWords.IsNotNullOrEmpty(), x => x.PhoneNumber.Contains(input.KeyWords) || x.OrderNo.Contains(input.KeyWords) || x.OutOrderNo.Contains(input.KeyWords) || x.ACOOLYOrderNo.Contains(input.KeyWords)) |
| | | join b in _lifePayChannlesRep on a.ChannelId equals b.Id into temp |
| | | join b in _lifePayChannlesRep on a.ChannelId equals b.ChannlesNum into temp |
| | | from b in temp.DefaultIfEmpty() |
| | | select new LifePayOrderListOutput |
| | | { |
| | |
| | | }); |
| | | } |
| | | |
| | | #endregion |
| | | } |
| | | #endregion |
| | | } |