From f99f2d0410f811f6679149e6a8eea6037b80474a Mon Sep 17 00:00:00 2001 From: zhengyiming <540361168@qq.com> Date: 星期三, 10 九月 2025 09:22:02 +0800 Subject: [PATCH] fix: s --- LifePayment/LifePayment.HttpApi/LifePay/LifePayRateController.cs | 94 +++++++++ LifePayment/LifePayment.Application/LifePay/LifePayRateService.cs | 132 +++++++++++++ LifePayment/LifePayment.Domain.Shared/Enum/LifePay/LifePayRateChannel.cs | 52 +++++ LifePayment/LifePayment.Host/LifePaymentServices.Application.Contracts.xml | 71 +++++++ LifePayment/LifePayment.Application.Contracts/LifePay/LifePayRateInput.cs | 64 ++++++ LifePayment/LifePayment.Application.Contracts/LifePay/ILifePayRateService.cs | 50 +++++ LifePayment/LifePayment.EntityFrameworkCore/LifePaymentServicesDbContext.cs | 2 LifePayment/LifePayment.Domain/LifePay/LifePayRateChannel.cs | 48 ++++ LifePayment/LifePayment.Host/LifePaymentService.HttpApi.xml | 36 +++ LifePayment/LifePayment.Application/LifePay/LifePayService.cs | 2 LifePayment/LifePayment.Application/LifePaymentServicesApplicationModuleAutoMapperProfile.cs | 3 11 files changed, 553 insertions(+), 1 deletions(-) diff --git a/LifePayment/LifePayment.Application.Contracts/LifePay/ILifePayRateService.cs b/LifePayment/LifePayment.Application.Contracts/LifePay/ILifePayRateService.cs new file mode 100644 index 0000000..d76b1a0 --- /dev/null +++ b/LifePayment/LifePayment.Application.Contracts/LifePay/ILifePayRateService.cs @@ -0,0 +1,50 @@ +锘縰sing Alipay.EasySDK.Payment.Common.Models; +using LifePayment.Application.Contracts.LifePay; +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 ILifePayRateService : IApplicationService +{ + /// <summary> + /// 鑾峰彇鎶樻墸閫氶亾閰嶇疆鍒嗛〉 + /// </summary> + /// <param name="input"></param> + /// <returns></returns> + Task<PageOutput<CreateEditRateChannelOutput>> GetLifePayRateChannelPage(PageInput input); + + /// <summary> + /// 鑾峰彇鎶樻墸閫氶亾閰嶇疆鍒楄〃 + /// </summary> + /// <param name="input"></param> + /// <returns></returns> + Task<List<CreateEditRateChannelOutput>> GetLifePayRateChannelAllList(QueryRateChannelInput input); + + /// <summary> + /// 鏂板缂栬緫鎶樻墸閫氶亾閰嶇疆 + /// </summary> + /// <param name="input"></param> + /// <returns></returns> + Task<int> CreateOrEditLifePayRateChannel(CreateEditRateChannelInput input); + + /// <summary> + /// 璁剧疆鎶樻墸閫氶亾鐘舵�� + /// </summary> + /// <param name="id"></param> + /// <param name="status"></param> + /// <returns></returns> + Task<int> SetRateChannelStatus(Guid id, LifePayRateChannelStatus status); + + /// <summary> + /// 鍒犻櫎鎶樻墸閫氶亾 + /// </summary> + /// <param name="id"></param> + /// <returns></returns> + Task<int> DeleteRateChannel(Guid id); +} \ No newline at end of file diff --git a/LifePayment/LifePayment.Application.Contracts/LifePay/LifePayRateInput.cs b/LifePayment/LifePayment.Application.Contracts/LifePay/LifePayRateInput.cs new file mode 100644 index 0000000..fd93e98 --- /dev/null +++ b/LifePayment/LifePayment.Application.Contracts/LifePay/LifePayRateInput.cs @@ -0,0 +1,64 @@ +锘縰sing LifePayment.Domain.Shared; +using Newtonsoft.Json; +using System; +using System.Collections.Generic; +using System.ComponentModel.DataAnnotations; + +namespace LifePayment.Application.Contracts.LifePay; + +public class CreateEditRateChannelInput +{ + public Guid? Id { get; set; } + + /// <summary> + /// 鍏呭�肩被鍨� + /// </summary> + [Required(ErrorMessage = "鍏呭�肩被鍨嬫槸蹇呭~椤广��")] + public LifePayOrderTypeEnum LifePayOrderType { get; set; } + + /// <summary> + /// 閫氶亾 + /// </summary> + [Required(ErrorMessage = "閫氶亾鏄繀濉」銆�")] + public string RateChannelName { get; set; } + + /// <summary> + /// ID + /// </summary> + [Required(ErrorMessage = "ID鏄繀濉」銆�")] + public int Code { get; set; } + + /// <summary> + /// 渚涘簲鍟嗘姌鎵� + /// </summary> + [Required(ErrorMessage = "渚涘簲鍟嗘姌鎵f槸蹇呭~椤广��")] + public decimal SupplierRate { get; set; } + + /// <summary> + /// 骞冲彴鎶樻墸 + /// </summary> + [Required(ErrorMessage = "骞冲彴鎶樻墸鏄繀濉」銆�")] + public decimal PlatformRate { get; set; } + + /// <summary> + /// 閫氶亾鐘舵�� + /// </summary> + [Required(ErrorMessage = "閫氶亾鐘舵�佹槸蹇呭~椤广��")] + public LifePayRateChannelStatus Status { get; set; } + + /// <summary> + /// 閫氱煡鍐呭 + /// </summary> + [Required(ErrorMessage = "閫氱煡鍐呭鏄繀濉」銆�")] + public string Remark { get; set; } +} + +public class CreateEditRateChannelOutput: CreateEditRateChannelInput +{ + public DateTime CreationTime { get; set; } +} + +public class QueryRateChannelInput +{ + public LifePayRateChannelStatus? Status { get; set; } +} \ No newline at end of file diff --git a/LifePayment/LifePayment.Application/LifePay/LifePayRateService.cs b/LifePayment/LifePayment.Application/LifePay/LifePayRateService.cs new file mode 100644 index 0000000..d8aca53 --- /dev/null +++ b/LifePayment/LifePayment.Application/LifePay/LifePayRateService.cs @@ -0,0 +1,132 @@ +锘縰sing LifePayment.Application.Contracts; +using LifePayment.Application.Contracts.LifePay; +using LifePayment.Domain; +using LifePayment.Domain.LifePay; +using LifePayment.Domain.Models; +using LifePayment.Domain.Shared; +using Microsoft.EntityFrameworkCore; +using Nest; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Linq.Dynamic.Core; +using System.Text; +using System.Threading.Tasks; +using Volo.Abp.Application.Services; +using Volo.Abp.Domain.Repositories; +using Volo.Abp.ObjectMapping; +using Z.EntityFramework.Plus; +using ZeroD.Util; +using static Microsoft.EntityFrameworkCore.DbLoggerCategory; + +namespace LifePayment.Application.LifePay; + +public class LifePayRateService : ApplicationService, ILifePayRateService +{ + private readonly IRepository<LifePayRateChannel, Guid> _lifePayRateChannelRepository; + public LifePayRateService(IRepository<LifePayRateChannel, Guid> lifePayRateChannelRepository) + { + _lifePayRateChannelRepository = lifePayRateChannelRepository; + } + + /// <summary> + /// 鑾峰彇鎶樻墸閫氶亾閰嶇疆鍒嗛〉 + /// </summary> + /// <param name="input"></param> + /// <returns></returns> + public async Task<PageOutput<CreateEditRateChannelOutput>> GetLifePayRateChannelPage(PageInput input) + { + return await GetLifePayRateChannelListFilter().GetPageResult(input.PageModel); + } + + /// <summary> + /// 鑾峰彇鎶樻墸閫氶亾閰嶇疆鍒楄〃 + /// </summary> + /// <param name="input"></param> + /// <returns></returns> + public async Task<List<CreateEditRateChannelOutput>> GetLifePayRateChannelAllList(QueryRateChannelInput input) + { + return await GetLifePayRateChannelListFilter().WhereIf(input.Status.HasValue, x => x.Status == input.Status).OrderByDescending(r => r.CreationTime).ToListAsync(); + } + + /// <summary> + /// 鏂板缂栬緫鎶樻墸閫氶亾閰嶇疆 + /// </summary> + /// <param name="input"></param> + /// <returns></returns> + public async Task<int> CreateOrEditLifePayRateChannel(CreateEditRateChannelInput input) + { + CheckExtensions.IfTrueThrowUserFriendlyException(input.SupplierRate < 0.01m, "渚涘簲鍟嗘姌鎵h缃敊璇�"); + CheckExtensions.IfTrueThrowUserFriendlyException(input.PlatformRate < 0.01m, "骞冲彴鎶樻墸璁剧疆閿欒"); + CheckExtensions.IfTrueThrowUserFriendlyException(input.PlatformRate < input.SupplierRate, "骞冲彴鎶樻墸鏃犳硶浣庝簬渚涘簲鍟嗘姌鎵�"); + bool isExist = await _lifePayRateChannelRepository.AnyAsync(r => r.Code == input.Code); + CheckExtensions.IfTrueThrowUserFriendlyException(isExist, "ID宸插瓨鍦�"); + if (input.Id.HasValue) + { + var dto = await _lifePayRateChannelRepository.FirstOrDefaultAsync(r => r.Id == input.Id.Value); + CheckExtensions.IfTrueThrowUserFriendlyException(dto == null, "鏈幏鍙栧埌鎶樻墸閫氶亾鏁版嵁"); + + dto.LifePayOrderType = input.LifePayOrderType; + dto.RateChannelName = input.RateChannelName; + dto.Code = input.Code; + dto.SupplierRate = input.SupplierRate; + dto.PlatformRate = input.PlatformRate; + dto.Status = input.Status; + dto.Remark = input.Remark; + } + else + { + input.Id = Guid.NewGuid(); + var entity = ObjectMapper.Map<CreateEditRateChannelInput, LifePayRateChannel>(input); + await _lifePayRateChannelRepository.InsertAsync(entity); + } + + return Constant.SUCCESS; + } + + /// <summary> + /// 璁剧疆鎶樻墸閫氶亾鐘舵�� + /// </summary> + /// <param name="id"></param> + /// <param name="status"></param> + /// <returns></returns> + public async Task<int> SetRateChannelStatus(Guid id, LifePayRateChannelStatus status) + { + await _lifePayRateChannelRepository.Where(r => r.Id == id).UpdateAsync(r => new LifePayRateChannel + { + Status = status, + }); + + return Constant.SUCCESS; + } + + /// <summary> + /// 鍒犻櫎鎶樻墸閫氶亾 + /// </summary> + /// <param name="id"></param> + /// <returns></returns> + public async Task<int> DeleteRateChannel(Guid id) + { + await _lifePayRateChannelRepository.DeleteAsync(s => s.Id == id); + + return Constant.SUCCESS; + } + + private IQueryable<CreateEditRateChannelOutput> GetLifePayRateChannelListFilter() + { + var query = from x in _lifePayRateChannelRepository + select new CreateEditRateChannelOutput + { + Id = x.Id, + LifePayOrderType = x.LifePayOrderType, + RateChannelName = x.RateChannelName, + Code = x.Code, + SupplierRate = x.SupplierRate, + PlatformRate = x.PlatformRate, + Status = x.Status, + Remark = x.Remark, + CreationTime = x.CreationTime, + }; + return query; + } +} \ No newline at end of file diff --git a/LifePayment/LifePayment.Application/LifePay/LifePayService.cs b/LifePayment/LifePayment.Application/LifePay/LifePayService.cs index 6a6bbf7..b658491 100644 --- a/LifePayment/LifePayment.Application/LifePay/LifePayService.cs +++ b/LifePayment/LifePayment.Application/LifePay/LifePayService.cs @@ -512,7 +512,7 @@ public async Task<LifePayRefundOrderOutput> GetLifePayRefundOrderDetail(string orderNo) { var order = await _lifePayOrderRepository.Where(x => x.OrderNo == orderNo).FirstOrDefaultAsync(); - var platformRate = await _lifePayRateRepository.FirstOrDefaultAsync(r => r.RateType == LifePayRateTypeEnum.渚涘簲鍟嗘姌鎵d环); + //var platformRate = await _lifePayRateRepository.FirstOrDefaultAsync(r => r.RateType == LifePayRateTypeEnum.渚涘簲鍟嗘姌鎵d环); var channle = await _lifePayChannlesRep.FirstOrDefaultAsync(r => r.ChannlesNum == order.ChannelId); var premium = await _lifePayPremiumRepository.Where(x => x.PremiumType == order.LifePayType).FirstOrDefaultAsync(); CheckExtensions.IfTrueThrowUserFriendlyException(order == null, "璁㈠崟涓嶅瓨鍦�"); diff --git a/LifePayment/LifePayment.Application/LifePaymentServicesApplicationModuleAutoMapperProfile.cs b/LifePayment/LifePayment.Application/LifePaymentServicesApplicationModuleAutoMapperProfile.cs index 12a9b84..2b5b250 100644 --- a/LifePayment/LifePayment.Application/LifePaymentServicesApplicationModuleAutoMapperProfile.cs +++ b/LifePayment/LifePayment.Application/LifePaymentServicesApplicationModuleAutoMapperProfile.cs @@ -1,5 +1,6 @@ using AutoMapper; using LifePayment.Application.Contracts; +using LifePayment.Application.Contracts.LifePay; using LifePayment.Application.Contracts.Sync; using LifePayment.Domain; using LifePayment.Domain.LifePay; @@ -40,6 +41,8 @@ CreateMap<CreateChannelConsultationFollowupInput, LifePayChannelConsultationFollowup>(MemberList.None); CreateMap<LogFrontInput, LogFrontRecord>(MemberList.None); + + CreateMap<CreateEditRateChannelInput, LifePayRateChannel>(MemberList.None); } } } \ No newline at end of file diff --git a/LifePayment/LifePayment.Domain.Shared/Enum/LifePay/LifePayRateChannel.cs b/LifePayment/LifePayment.Domain.Shared/Enum/LifePay/LifePayRateChannel.cs new file mode 100644 index 0000000..97f587d --- /dev/null +++ b/LifePayment/LifePayment.Domain.Shared/Enum/LifePay/LifePayRateChannel.cs @@ -0,0 +1,52 @@ +锘縰sing System.ComponentModel; + +namespace LifePayment.Domain.Shared; + +public enum LifePayRateChannelStatus +{ + /// <summary> + /// 鍚敤 + /// </summary> + [Description("鍚敤")] + Disabled = -10, + + /// <summary> + /// 绂佺敤 + /// </summary> + [Description("绂佺敤")] + Enabled = 10, + +} + +public enum LifePayRateChannelCodeEnum +{ + /// <summary> + /// 涓浗绉诲姩 + /// </summary> + [Description("涓浗绉诲姩")] + 涓浗绉诲姩 = 10, + + /// <summary> + /// 涓浗鑱旈�� + /// </summary> + [Description("涓浗鑱旈��")] + 涓浗鑱旈�� = 20, + + /// <summary> + /// 涓浗鐢典俊 + /// </summary> + [Description("涓浗鐢典俊")] + 涓浗鐢典俊 = 30, + + /// <summary> + /// 鍥藉鐢电綉 + /// </summary> + [Description("鍥藉鐢电綉")] + 鍥藉鐢电綉 = 40, + + /// <summary> + /// 鍗楁柟鐢电綉 + /// </summary> + [Description("鍗楁柟鐢电綉")] + 鍗楁柟鐢电綉 = 50, +} \ No newline at end of file diff --git a/LifePayment/LifePayment.Domain/LifePay/LifePayRateChannel.cs b/LifePayment/LifePayment.Domain/LifePay/LifePayRateChannel.cs new file mode 100644 index 0000000..53b1817 --- /dev/null +++ b/LifePayment/LifePayment.Domain/LifePay/LifePayRateChannel.cs @@ -0,0 +1,48 @@ +锘縰sing LifePayment.Domain.Shared; +using System; +using Volo.Abp; +using Volo.Abp.Domain.Entities.Auditing; + +namespace LifePayment.Domain; + +public partial class LifePayRateChannel : FullAuditedEntity<Guid>, IDataUserFilter +{ + public LifePayRateChannel() + { + } + + /// <summary> + /// 鍏呭�肩被鍨� + /// </summary> + public LifePayOrderTypeEnum LifePayOrderType { get; set; } + + /// <summary> + /// 閫氶亾 + /// </summary> + public string RateChannelName { get; set; } + + /// <summary> + /// ID + /// </summary> + public int Code { get; set; } + + /// <summary> + /// 渚涘簲鍟嗘姌鎵� + /// </summary> + public decimal SupplierRate { get; set; } + + /// <summary> + /// 骞冲彴鎶樻墸 + /// </summary> + public decimal PlatformRate { get; set; } + + /// <summary> + /// 閫氶亾鐘舵�� + /// </summary> + public LifePayRateChannelStatus Status { get; set; } + + /// <summary> + /// 閫氱煡鍐呭 + /// </summary> + public string Remark { get; set; } +} \ No newline at end of file diff --git a/LifePayment/LifePayment.EntityFrameworkCore/LifePaymentServicesDbContext.cs b/LifePayment/LifePayment.EntityFrameworkCore/LifePaymentServicesDbContext.cs index b8a7052..75d275d 100644 --- a/LifePayment/LifePayment.EntityFrameworkCore/LifePaymentServicesDbContext.cs +++ b/LifePayment/LifePayment.EntityFrameworkCore/LifePaymentServicesDbContext.cs @@ -63,6 +63,8 @@ public virtual DbSet<DallyStatistics> DallyStatistics { get; set; } + public virtual DbSet<LifePayRateChannel> LifePayRateChannel { get; set; } + [UnitOfWork] protected override void OnModelCreating(ModelBuilder builder) { diff --git a/LifePayment/LifePayment.Host/LifePaymentService.HttpApi.xml b/LifePayment/LifePayment.Host/LifePaymentService.HttpApi.xml index 59af98a..d688770 100644 --- a/LifePayment/LifePayment.Host/LifePaymentService.HttpApi.xml +++ b/LifePayment/LifePayment.Host/LifePaymentService.HttpApi.xml @@ -513,6 +513,42 @@ <param name="input"></param> <returns></returns> </member> + <member name="M:LifePayment.HttpApi.LifePayRateController.GetLifePayRateChannelPage(ZeroD.Util.PageInput)"> + <summary> + 鑾峰彇鎶樻墸閫氶亾閰嶇疆鍒嗛〉 + </summary> + <param name="input"></param> + <returns></returns> + </member> + <member name="M:LifePayment.HttpApi.LifePayRateController.GetLifePayRateChannelAllList(LifePayment.Application.Contracts.LifePay.QueryRateChannelInput)"> + <summary> + 鑾峰彇鎶樻墸閫氶亾閰嶇疆鍒楄〃 + </summary> + <param name="input"></param> + <returns></returns> + </member> + <member name="M:LifePayment.HttpApi.LifePayRateController.CreateOrEditLifePayRateChannel(LifePayment.Application.Contracts.LifePay.CreateEditRateChannelInput)"> + <summary> + 鏂板缂栬緫鎶樻墸閫氶亾閰嶇疆 + </summary> + <param name="input"></param> + <returns></returns> + </member> + <member name="M:LifePayment.HttpApi.LifePayRateController.SetRateChannelStatus(System.Guid,LifePayment.Domain.Shared.LifePayRateChannelStatus)"> + <summary> + 璁剧疆鎶樻墸閫氶亾鐘舵�� + </summary> + <param name="id"></param> + <param name="status"></param> + <returns></returns> + </member> + <member name="M:LifePayment.HttpApi.LifePayRateController.DeleteRateChannel(System.Guid)"> + <summary> + 鍒犻櫎鎶樻墸閫氶亾 + </summary> + <param name="id"></param> + <returns></returns> + </member> <member name="M:LifePayment.HttpApi.LogController.LogFront(LifePayment.Domain.Shared.LogFrontInput)"> <summary> 璁板綍鍓嶇鏃ュ織 diff --git a/LifePayment/LifePayment.Host/LifePaymentServices.Application.Contracts.xml b/LifePayment/LifePayment.Host/LifePaymentServices.Application.Contracts.xml index ae83b50..9bc041a 100644 --- a/LifePayment/LifePayment.Host/LifePaymentServices.Application.Contracts.xml +++ b/LifePayment/LifePayment.Host/LifePaymentServices.Application.Contracts.xml @@ -4,6 +4,42 @@ <name>LifePayment.Application.Contracts</name> </assembly> <members> + <member name="M:LifePayment.Application.Contracts.ILifePayRateService.GetLifePayRateChannelPage(ZeroD.Util.PageInput)"> + <summary> + 鑾峰彇鎶樻墸閫氶亾閰嶇疆鍒嗛〉 + </summary> + <param name="input"></param> + <returns></returns> + </member> + <member name="M:LifePayment.Application.Contracts.ILifePayRateService.GetLifePayRateChannelAllList(LifePayment.Application.Contracts.LifePay.QueryRateChannelInput)"> + <summary> + 鑾峰彇鎶樻墸閫氶亾閰嶇疆鍒楄〃 + </summary> + <param name="input"></param> + <returns></returns> + </member> + <member name="M:LifePayment.Application.Contracts.ILifePayRateService.CreateOrEditLifePayRateChannel(LifePayment.Application.Contracts.LifePay.CreateEditRateChannelInput)"> + <summary> + 鏂板缂栬緫鎶樻墸閫氶亾閰嶇疆 + </summary> + <param name="input"></param> + <returns></returns> + </member> + <member name="M:LifePayment.Application.Contracts.ILifePayRateService.SetRateChannelStatus(System.Guid,LifePayment.Domain.Shared.LifePayRateChannelStatus)"> + <summary> + 璁剧疆鎶樻墸閫氶亾鐘舵�� + </summary> + <param name="id"></param> + <param name="status"></param> + <returns></returns> + </member> + <member name="M:LifePayment.Application.Contracts.ILifePayRateService.DeleteRateChannel(System.Guid)"> + <summary> + 鍒犻櫎鎶樻墸閫氶亾 + </summary> + <param name="id"></param> + <returns></returns> + </member> <member name="M:LifePayment.Application.Contracts.ILifePayService.GetElectricParValue"> <summary> 鑾峰彇鐢佃垂闈㈠�� @@ -2239,6 +2275,41 @@ 缁撶畻鏃堕棿 </summary> </member> + <member name="P:LifePayment.Application.Contracts.LifePay.CreateEditRateChannelInput.LifePayOrderType"> + <summary> + 鍏呭�肩被鍨� + </summary> + </member> + <member name="P:LifePayment.Application.Contracts.LifePay.CreateEditRateChannelInput.RateChannelName"> + <summary> + 閫氶亾 + </summary> + </member> + <member name="P:LifePayment.Application.Contracts.LifePay.CreateEditRateChannelInput.Code"> + <summary> + ID + </summary> + </member> + <member name="P:LifePayment.Application.Contracts.LifePay.CreateEditRateChannelInput.SupplierRate"> + <summary> + 渚涘簲鍟嗘姌鎵� + </summary> + </member> + <member name="P:LifePayment.Application.Contracts.LifePay.CreateEditRateChannelInput.PlatformRate"> + <summary> + 骞冲彴鎶樻墸 + </summary> + </member> + <member name="P:LifePayment.Application.Contracts.LifePay.CreateEditRateChannelInput.Status"> + <summary> + 閫氶亾鐘舵�� + </summary> + </member> + <member name="P:LifePayment.Application.Contracts.LifePay.CreateEditRateChannelInput.Remark"> + <summary> + 閫氱煡鍐呭 + </summary> + </member> <member name="M:LifePayment.Application.Contracts.ILogService.LogFront(LifePayment.Domain.Shared.LogFrontInput)"> <summary> 璁板綍鍓嶇鏃ュ織 diff --git a/LifePayment/LifePayment.HttpApi/LifePay/LifePayRateController.cs b/LifePayment/LifePayment.HttpApi/LifePay/LifePayRateController.cs new file mode 100644 index 0000000..f6dcee8 --- /dev/null +++ b/LifePayment/LifePayment.HttpApi/LifePay/LifePayRateController.cs @@ -0,0 +1,94 @@ +锘縰sing Alipay.AopSdk.F2FPay.Model; +using LifePayment.Application; +using LifePayment.Application.Contracts; +using LifePayment.Application.Contracts.LifePay; +using LifePayment.Application.LifePay; +using LifePayment.Domain; +using LifePayment.Domain.Common; +using LifePayment.Domain.Shared; +using Microsoft.AspNetCore.Authorization; +using Microsoft.AspNetCore.Mvc; +using Microsoft.Extensions.Logging; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; +using Volo.Abp; +using Volo.Abp.AspNetCore.Mvc; +using Volo.Abp.AspNetCore.WebClientInfo; +using ZeroD.Util; +using ZeroD.Util.Fadd; + +namespace LifePayment.HttpApi +{ + [Route("api/[controller]/[action]")] + [ApiController] + [Authorize] + public class LifePayRateController : AbpController + { + private readonly ILifePayRateService _lifePayRateService; + + public LifePayRateController( + ILifePayRateService lifePayRateService + ) + { + _lifePayRateService = lifePayRateService; + } + + /// <summary> + /// 鑾峰彇鎶樻墸閫氶亾閰嶇疆鍒嗛〉 + /// </summary> + /// <param name="input"></param> + /// <returns></returns> + [HttpPost] + public async Task<PageOutput<CreateEditRateChannelOutput>> GetLifePayRateChannelPage(PageInput input) + { + return await _lifePayRateService.GetLifePayRateChannelPage(input); + } + + /// <summary> + /// 鑾峰彇鎶樻墸閫氶亾閰嶇疆鍒楄〃 + /// </summary> + /// <param name="input"></param> + /// <returns></returns> + [HttpPost] + public async Task<List<CreateEditRateChannelOutput>> GetLifePayRateChannelAllList(QueryRateChannelInput input) + { + return await _lifePayRateService.GetLifePayRateChannelAllList(input); + } + + /// <summary> + /// 鏂板缂栬緫鎶樻墸閫氶亾閰嶇疆 + /// </summary> + /// <param name="input"></param> + /// <returns></returns> + [HttpPost] + public async Task<int> CreateOrEditLifePayRateChannel(CreateEditRateChannelInput input) + { + return await _lifePayRateService.CreateOrEditLifePayRateChannel(input); + } + + /// <summary> + /// 璁剧疆鎶樻墸閫氶亾鐘舵�� + /// </summary> + /// <param name="id"></param> + /// <param name="status"></param> + /// <returns></returns> + [HttpGet] + public async Task<int> SetRateChannelStatus(Guid id, LifePayRateChannelStatus status) + { + return await _lifePayRateService.SetRateChannelStatus(id, status); + } + + /// <summary> + /// 鍒犻櫎鎶樻墸閫氶亾 + /// </summary> + /// <param name="id"></param> + /// <returns></returns> + [HttpPost] + public async Task<int> DeleteRateChannel(Guid id) + { + return await _lifePayRateService.DeleteRateChannel(id); + } + } +} -- Gitblit v1.9.1