LifePayment/LifePayment.Application.Contracts/LifePay/ILifePayService.cs
@@ -113,7 +113,26 @@ Task SetLifePayChannelsStatus(Guid id, LifePayChannelsStatsEnum status); /// <summary> /// 编辑折扣 /// </summary> /// <param name="input"></param> /// <returns></returns> Task CreateEditLifePayRate(List<LifePayRateInput> input); /// <summary> /// 编辑手续费费率 /// </summary> /// <param name="input"></param> /// <returns></returns> Task CreateEditLifePayPremium(List<LifePayPremiumInput> input); /// <summary> /// 须知配置 /// </summary> /// <param name="input"></param> /// <returns></returns> Task EditIntroInfo(LifePayIntroInfoInput input); /// <summary> /// 获取折扣 @@ -122,6 +141,18 @@ Task<List<LifePayRateListOutput>> GetRate(); /// <summary> /// 获取手续费费率 /// </summary> /// <returns></returns> Task<List<LifePayPremiumListOutput>> GetPremium(); /// <summary> /// 获取须知 /// </summary> /// <returns></returns> Task<List<LifePayIntroInfoOutput>> GetIntroInfo(LifePayOrderTypeEnum type); /// <summary> /// 获取我的订单分页数据 /// </summary> /// <param name="input"></param> LifePayment/LifePayment.Application.Contracts/LifePay/LifePayOutput.cs
@@ -1,5 +1,6 @@ using LifePayment.Domain.Shared; using System; using System.Collections.Generic; using ZeroD.Base.Web.Models; namespace LifePayment.Application.Contracts; @@ -21,6 +22,98 @@ public Guid? Id { get; set; } } public class LifePayPremiumInput { public LifePayTypeEnum PremiumType { get; set; } public decimal Rate { get; set; } public Guid? Id { get; set; } } public class LifePayIntroInfoInput { /// <summary> /// 生活缴费类型 /// </summary> public LifePayOrderTypeEnum LifePayType { get; set; } /// <summary> /// 更新内容 /// </summary> public List<LifePayIntroInfoDetail> Data { get; set; } } public class LifePayIntroInfoDetail { /// <summary> /// 类型 /// </summary> public IntroInfoTypeEnum Type { get; set; } /// <summary> /// 摘要 /// </summary> public string ContentSummary { get; set; } /// <summary> /// 文本内容 /// </summary> public string Content { get; set; } /// <summary> /// 图片/视频路径 /// </summary> public string Path { get; set; } /// <summary> /// 排序 /// </summary> public int Sequence { get; set; } } public class LifePayPremiumListOutput { public LifePayTypeEnum PremiumType { get; set; } public decimal Rate { get; set; } public Guid Id { get; set; } } public class LifePayIntroInfoOutput { /// <summary> /// 类型 /// </summary> public IntroInfoTypeEnum Type { get; set; } /// <summary> /// 生活缴费类型 /// </summary> public LifePayOrderTypeEnum LifePayType { get; set; } /// <summary> /// 摘要 /// </summary> public string ContentSummary { get; set; } /// <summary> /// 文本内容 /// </summary> public string Content { get; set; } /// <summary> /// 图片/视频路径 /// </summary> public string Path { get; set; } /// <summary> /// 排序 /// </summary> public int Sequence { get; set; } } public class UserListOutput { LifePayment/LifePayment.Application/LifePay/LifePayService.cs
@@ -25,9 +25,10 @@ using ZeroD.Util; using ZeroD.Util.Fadd; using static LifePayment.Domain.Shared.LifePaymentConstant; using static IdentityServer4.Models.IdentityResources; using Volo.Abp.Data; using Z.EntityFramework.Plus; using LifePayment.Domain.LifePay; using pingan.openbank.api.sdk.enums; namespace LifePayment.Application; @@ -37,8 +38,10 @@ private readonly ILogger<LifePayService> _logger; private readonly IRepository<LifePayRate, Guid> _lifePayRateRepository; private readonly IRepository<LifePayPremium, Guid> _lifePayPremiumRepository; private readonly IRepository<LifePayOrder, Guid> _lifePayOrderRepository; private readonly IRepository<LifePayUser, Guid> _lifePayUserRepository; private readonly IRepository<LifePayIntroInfo, Guid> _lifePayIntroInfoRepository; private readonly IRepository<LifePayChannles, Guid> _lifePayChannlesRep; private readonly IRepository<LifePayAccount, Guid> _lifePayAccount; private readonly IDataFilter dataFilter; @@ -55,6 +58,8 @@ IRepository<LifePayRate, Guid> lifePayRateRepository, IRepository<LifePayOrder, Guid> lifePayOrderRepository, IRepository<LifePayUser, Guid> lifePayUserRepository, IRepository<LifePayPremium, Guid> lifePayPremiumRepository, IRepository<LifePayIntroInfo, Guid> lifePayIntroInfoRepository, IAliPayApi aliPayApi, IWxPayApi wxPayApi, IOptions<WxPayOption> wxPayOptions, @@ -67,6 +72,8 @@ _lifePayRateRepository = lifePayRateRepository; _lifePayOrderRepository = lifePayOrderRepository; _lifePayUserRepository = lifePayUserRepository; _lifePayPremiumRepository = lifePayPremiumRepository; _lifePayIntroInfoRepository = lifePayIntroInfoRepository; _aliPayApi = aliPayApi; _wxPayApi = wxPayApi; _wxPayOptions = wxPayOptions.Value; @@ -133,6 +140,27 @@ public async Task<List<LifePayRateListOutput>> GetRate() { return await _lifePayRateRepository.Where(x => x.IsDeleted == false).Select(x => new LifePayRateListOutput() { Id = x.Id, Rate = x.Rate, RateType = x.RateType }) .ToListAsync(); } /// <summary> /// 获取手续费费率 /// </summary> /// <returns></returns> public async Task<List<LifePayPremiumListOutput>> GetPremium() { return await _lifePayPremiumRepository.Where(x => x.IsDeleted == false).Select(x => new LifePayPremiumListOutput() { Id = x.Id, Rate = x.Rate, PremiumType = x.PremiumType }) .ToListAsync(); } /// <summary> /// 须知配置 /// </summary> /// <returns></returns> 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 }) .ToListAsync(); } @@ -1219,6 +1247,7 @@ CheckExtensions.IfTrueThrowUserFriendlyException(dto.Status == LifePayChannelsStatsEnum.禁用, "当前渠道商已禁用"); return true; } public async Task CreateEditLifePayRate(List<LifePayRateInput> input) { CheckExtensions.IfTrueThrowUserFriendlyException(input.Where(r => r.Rate <= 0).Any(), "折扣不得小于等于0"); @@ -1248,11 +1277,62 @@ { await _lifePayRateRepository.InsertManyAsync(listData); } } public async Task CreateEditLifePayPremium(List<LifePayPremiumInput> input) { CheckExtensions.IfTrueThrowUserFriendlyException(input.Where(r => r.Rate < 0).Any(), "折扣不得小于0"); var listData = new List<LifePayPremium>(); foreach (var item in input) { var tmpDto = await _lifePayPremiumRepository.FirstOrDefaultAsync(r => r.PremiumType == item.PremiumType); if (tmpDto != null) { tmpDto.Rate = item.Rate; } else { listData.Add(new LifePayPremium { CreationTime = DateTime.Now, Rate = item.Rate, PremiumType = item.PremiumType, Id = Guid.NewGuid(), }); } } if (listData.Any()) { await _lifePayPremiumRepository.InsertManyAsync(listData); } } public async Task EditIntroInfo(LifePayIntroInfoInput input) { var listData = new List<LifePayIntroInfo>(); foreach (var item in input.Data) { var tmpDto = await _lifePayIntroInfoRepository.Where(r => r.LifePayType == input.LifePayType).DeleteAsync(); listData.Add(new LifePayIntroInfo { LifePayType = input.LifePayType, CreationTime = DateTime.Now, Type = item.Type, ContentSummary = item.ContentSummary, Content = item.Content, Path = item.Path, Sequence = item.Sequence, Id = Guid.NewGuid(), }); } if (listData.Any()) { await _lifePayIntroInfoRepository.InsertManyAsync(listData); } } #endregion #region 私有 LifePayment/LifePayment.Domain.Shared/Enum/LifePay/LifePayEnum.cs
@@ -89,7 +89,6 @@ 供应商折扣价=40, } public enum LifePaySwitchTypeEnum { H5 = 10, @@ -111,4 +110,15 @@ 内部渠道 = 10, 外部渠道 = 20, } public enum IntroInfoTypeEnum { [Description("文本")] 文本 = 0, [Description("图片")] 图片 = 1, [Description("视频")] 视频 = 2 } LifePayment/LifePayment.Domain/LifePay/LifePayIntroInfo.cs
New file @@ -0,0 +1,43 @@ using LifePayment.Domain.Shared; using System; using Volo.Abp; using Volo.Abp.Domain.Entities.Auditing; namespace LifePayment.Domain.LifePay; public partial class LifePayIntroInfo : FullAuditedEntity<Guid>, IDataUserFilter { public LifePayIntroInfo() { } /// <summary> /// 类型 /// </summary> public IntroInfoTypeEnum Type { get; set; } /// <summary> /// 生活缴费类型 /// </summary> public LifePayOrderTypeEnum LifePayType { get; set; } /// <summary> /// 摘要 /// </summary> public string ContentSummary { get; set; } /// <summary> /// 文本内容 /// </summary> public string Content { get; set; } /// <summary> /// 图片/视频路径 /// </summary> public string Path { get; set; } /// <summary> /// 排序 /// </summary> public int Sequence { get; set; } } LifePayment/LifePayment.Domain/LifePay/LifePayPremium.cs
New file @@ -0,0 +1,17 @@ using LifePayment.Domain.Shared; using System; using Volo.Abp; using Volo.Abp.Domain.Entities.Auditing; namespace LifePayment.Domain; public partial class LifePayPremium : FullAuditedEntity<Guid>, IDataUserFilter { public LifePayPremium() { } public LifePayTypeEnum PremiumType { get; set; } public decimal Rate { get; set; } } LifePayment/LifePayment.EntityFrameworkCore/LifePaymentServicesDbContext.cs
@@ -1,4 +1,5 @@ using LifePayment.Domain; using LifePayment.Domain.LifePay; using LifePayment.Domain.Models; using Microsoft.EntityFrameworkCore; using Volo.Abp.Data; @@ -22,12 +23,15 @@ public virtual DbSet<LifePayRate> LifePayRate { get; set; } public virtual DbSet<LifePayPremium> LifePayPremium { get; set; } public virtual DbSet<Area> Area { get; set; } public virtual DbSet<User> Users { get; set; } public virtual DbSet<Role> Roles { get; set; } public virtual DbSet<LifePayIntroInfo> LifePayIntroInfo { get; set; } public virtual DbSet<UserRole> UserRoles { get; set; } LifePayment/LifePayment.Host/LifePaymentService.HttpApi.xml
@@ -92,6 +92,18 @@ </summary> <returns></returns> </member> <member name="M:LifePayment.HttpApi.LifePayController.GetPremium"> <summary> 获取手续费费率 </summary> <returns></returns> </member> <member name="M:LifePayment.HttpApi.LifePayController.GetIntroInfo(LifePayment.Domain.Shared.LifePayOrderTypeEnum)"> <summary> 获取须知 </summary> <returns></returns> </member> <member name="M:LifePayment.HttpApi.LifePayController.GetUserPage(ZeroD.Util.PageInput)"> <summary> 获取用户分页数据 @@ -264,6 +276,20 @@ <param name="input"></param> <returns></returns> </member> <member name="M:LifePayment.HttpApi.LifePayController.CreateEditLifePayPremium(System.Collections.Generic.List{LifePayment.Application.Contracts.LifePayPremiumInput})"> <summary> 手续费费率配置 </summary> <param name="input"></param> <returns></returns> </member> <member name="M:LifePayment.HttpApi.LifePayController.EditIntroInfo(LifePayment.Application.Contracts.LifePayIntroInfoInput)"> <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
@@ -101,9 +101,42 @@ <param name="id"></param> <returns></returns> </member> <member name="M:LifePayment.Application.Contracts.ILifePayService.CreateEditLifePayRate(System.Collections.Generic.List{LifePayment.Application.Contracts.LifePayRateInput})"> <summary> 编辑折扣 </summary> <param name="input"></param> <returns></returns> </member> <member name="M:LifePayment.Application.Contracts.ILifePayService.CreateEditLifePayPremium(System.Collections.Generic.List{LifePayment.Application.Contracts.LifePayPremiumInput})"> <summary> 编辑手续费费率 </summary> <param name="input"></param> <returns></returns> </member> <member name="M:LifePayment.Application.Contracts.ILifePayService.EditIntroInfo(LifePayment.Application.Contracts.LifePayIntroInfoInput)"> <summary> 须知配置 </summary> <param name="input"></param> <returns></returns> </member> <member name="M:LifePayment.Application.Contracts.ILifePayService.GetRate"> <summary> 获取折扣 </summary> <returns></returns> </member> <member name="M:LifePayment.Application.Contracts.ILifePayService.GetPremium"> <summary> 获取手续费费率 </summary> <returns></returns> </member> <member name="M:LifePayment.Application.Contracts.ILifePayService.GetIntroInfo(LifePayment.Domain.Shared.LifePayOrderTypeEnum)"> <summary> 获取须知 </summary> <returns></returns> </member> @@ -463,6 +496,71 @@ 备注 </summary> </member> <member name="P:LifePayment.Application.Contracts.LifePayIntroInfoInput.LifePayType"> <summary> 生活缴费类型 </summary> </member> <member name="P:LifePayment.Application.Contracts.LifePayIntroInfoInput.Data"> <summary> 更新内容 </summary> </member> <member name="P:LifePayment.Application.Contracts.LifePayIntroInfoDetail.Type"> <summary> 类型 </summary> </member> <member name="P:LifePayment.Application.Contracts.LifePayIntroInfoDetail.ContentSummary"> <summary> 摘要 </summary> </member> <member name="P:LifePayment.Application.Contracts.LifePayIntroInfoDetail.Content"> <summary> 文本内容 </summary> </member> <member name="P:LifePayment.Application.Contracts.LifePayIntroInfoDetail.Path"> <summary> 图片/视频路径 </summary> </member> <member name="P:LifePayment.Application.Contracts.LifePayIntroInfoDetail.Sequence"> <summary> 排序 </summary> </member> <member name="P:LifePayment.Application.Contracts.LifePayIntroInfoOutput.Type"> <summary> 类型 </summary> </member> <member name="P:LifePayment.Application.Contracts.LifePayIntroInfoOutput.LifePayType"> <summary> 生活缴费类型 </summary> </member> <member name="P:LifePayment.Application.Contracts.LifePayIntroInfoOutput.ContentSummary"> <summary> 摘要 </summary> </member> <member name="P:LifePayment.Application.Contracts.LifePayIntroInfoOutput.Content"> <summary> 文本内容 </summary> </member> <member name="P:LifePayment.Application.Contracts.LifePayIntroInfoOutput.Path"> <summary> 图片/视频路径 </summary> </member> <member name="P:LifePayment.Application.Contracts.LifePayIntroInfoOutput.Sequence"> <summary> 排序 </summary> </member> <member name="P:LifePayment.Application.Contracts.UserListOutput.PhoneNumber"> <summary> 用户手机号 LifePayment/LifePayment.HttpApi/LifePay/ACOOLYNotifyController.cs
@@ -63,6 +63,8 @@ orderNo = confirmElectricOrderResponse.ElectricChargeOrder.OutOrderNo; acoolyOrderNo = confirmElectricOrderResponse.ElectricChargeOrder.BusiOrderNo; _logger.LogError("ACOOLY回调通处理结果状态:" + confirmElectricOrderResponse.ElectricChargeOrder.Status); /// TODO 状态不正确 if (!confirmElectricOrderResponse.Success || (confirmElectricOrderResponse.Code != ACOOLYConstant.Code.SUCCESS && confirmElectricOrderResponse.Code != ACOOLYConstant.Code.PROCESSING)) { LifePayment/LifePayment.HttpApi/LifePay/LifePayController.cs
@@ -118,6 +118,29 @@ } /// <summary> /// 获取手续费费率 /// </summary> /// <returns></returns> [HttpGet] [AllowAnonymous] public async Task<List<LifePayPremiumListOutput>> GetPremium() { return await _lifePayService.GetPremium(); } /// <summary> /// 获取须知 /// </summary> /// <returns></returns> [HttpGet] [AllowAnonymous] public async Task<List<LifePayIntroInfoOutput>> GetIntroInfo(LifePayOrderTypeEnum type) { return await _lifePayService.GetIntroInfo(type); } /// <summary> /// 获取用户分页数据 /// </summary> /// <param name="input"></param> @@ -428,6 +451,30 @@ } /// <summary> /// 手续费费率配置 /// </summary> /// <param name="input"></param> /// <returns></returns> [HttpPost] public async Task<int> CreateEditLifePayPremium(List<LifePayPremiumInput> input) { await _lifePayService.CreateEditLifePayPremium(input); return Constant.SUCCESS; } /// <summary> /// 须知配置 /// </summary> /// <param name="input"></param> /// <returns></returns> [HttpPost] public async Task<int> EditIntroInfo(LifePayIntroInfoInput input) { await _lifePayService.EditIntroInfo(input); return Constant.SUCCESS; } /// <summary> /// 设置生活缴费支付类型 /// </summary> /// <param name="input"></param>