zhengyiming
20 小时以前 f7bb0825bc06b8cea32caa44d2326dde51990e77
feat: 公告
6个文件已添加
12个文件已修改
688 ■■■■■ 已修改文件
LifePayment/LifePayment.Application.Contracts/LifePay/ILifePayAnnouncementService.cs 40 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
LifePayment/LifePayment.Application.Contracts/LifePay/ILifePayRateService.cs 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
LifePayment/LifePayment.Application.Contracts/LifePay/LifePayAnnouncementInput.cs 63 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
LifePayment/LifePayment.Application.Contracts/LifePay/LifePayInput.cs 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
LifePayment/LifePayment.Application.Contracts/LifePay/LifePayRateInput.cs 7 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
LifePayment/LifePayment.Application/LifePay/LifePayAnnouncementService.cs 151 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
LifePayment/LifePayment.Application/LifePay/LifePayRateService.cs 31 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
LifePayment/LifePayment.Application/LifePay/LifePayService.cs 63 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
LifePayment/LifePayment.Application/LifePaymentServicesApplicationModuleAutoMapperProfile.cs 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
LifePayment/LifePayment.Domain.Shared/Enum/LifePay/LifePayAnnouncement.cs 44 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
LifePayment/LifePayment.Domain.Shared/Enum/LifePay/LifePayRateChannel.cs 72 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
LifePayment/LifePayment.Domain/LifePay/LifePayAnnouncement.cs 37 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
LifePayment/LifePayment.Domain/LifePay/LifePayRateChannel.cs 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
LifePayment/LifePayment.EntityFrameworkCore/LifePaymentServicesDbContext.cs 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
LifePayment/LifePayment.Host/LifePaymentService.HttpApi.xml 27 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
LifePayment/LifePayment.Host/LifePaymentServices.Application.Contracts.xml 52 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
LifePayment/LifePayment.HttpApi/LifePay/LifePayAnnouncementController.cs 84 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
LifePayment/LifePayment.HttpApi/LifePay/LifePayRateController.cs 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
LifePayment/LifePayment.Application.Contracts/LifePay/ILifePayAnnouncementService.cs
New file
@@ -0,0 +1,40 @@
using LifePayment.Application.Contracts.LifePay;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Volo.Abp.Application.Services;
using ZeroD.Util;
namespace LifePayment.Application.Contracts;
public interface ILifePayAnnouncementService : IApplicationService
{
    /// <summary>
    /// 获取公告分页
    /// </summary>
    /// <param name="input"></param>
    /// <returns></returns>
    Task<PageOutput<CreateEditLifePayAnnouncementOutput>> GetLifePayAnnouncementPage(GetLifePayAnnouncementPageInput input);
    /// <summary>
    /// 新增编辑公告
    /// </summary>
    /// <param name="input"></param>
    /// <returns></returns>
    Task<int> CreateOrEditLifePayAnnouncement(CreateEditLifePayAnnouncementInput input);
    /// <summary>
    /// 删除公告
    /// </summary>
    /// <param name="id"></param>
    /// <returns></returns>
    Task<int> DeleteLifePayAnnouncement(Guid id);
    /// <summary>
    /// 获取当前展示中的公告
    /// </summary>
    /// <returns></returns>
    Task<CreateEditLifePayAnnouncementOutput> GetShowingLifePayAnnouncement(GetShowingLifePayAnnouncementInput input);
}
LifePayment/LifePayment.Application.Contracts/LifePay/ILifePayRateService.cs
@@ -47,4 +47,6 @@
    /// <param name="id"></param>
    /// <returns></returns>
    Task<int> DeleteRateChannel(Guid id);
    Task<CreateEditRateChannelOutput> GetRateChannelByCode(string code);
}
LifePayment/LifePayment.Application.Contracts/LifePay/LifePayAnnouncementInput.cs
New file
@@ -0,0 +1,63 @@
using LifePayment.Domain.Shared;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using ZeroD.Util;
namespace LifePayment.Application.Contracts;
public class CreateEditLifePayAnnouncementInput
{
    public Guid? Id { get; set; }
    /// <summary>
    /// 公告类型
    /// </summary>
    [Required(ErrorMessage = "公告类型是必填项。")]
    public AnnouncementTypeEnum AnnouncementType { get; set; }
    /// <summary>
    /// 生效日期
    /// </summary>
    [Required(ErrorMessage = "生效日期是必填项。")]
    public DateTime StartTime { get; set; }
    /// <summary>
    /// 截止日期
    /// </summary>
    [Required(ErrorMessage = "截止日期是必填项。")]
    public DateTime EndTime { get; set; }
    /// <summary>
    /// 公告内容
    /// </summary>
    [Required(ErrorMessage = "公告内容是必填项。")]
    public string AnnouncementContent { get; set; }
}
public class CreateEditLifePayAnnouncementOutput: CreateEditLifePayAnnouncementInput
{
    public DateTime CreationTime { get; set; }
    public AnnouncementStatusEnum Status { get; set; }
}
public class GetLifePayAnnouncementPageInput : PageInput
{
    public DateTime? CreationTimeBegin { get; set; }
    public DateTime? CreationTimeEnd { get; set; }
    public DateTime? StartTime { get; set; }
    public DateTime? EndTime { get; set; }
    public AnnouncementStatusEnum? Status { get; set; }
}
public class GetShowingLifePayAnnouncementInput
{
    public AnnouncementTypeEnum? AnnouncementType { get; set; }
}
LifePayment/LifePayment.Application.Contracts/LifePay/LifePayInput.cs
@@ -887,4 +887,11 @@
public class QueryLifePayChannlesInput
{
    public LifePayChannelsStatsEnum? Status { get; set; }
}
public class GetLifePayRateOutput
{
    public decimal SupplierRate { get; set; }
    public decimal Rate { get; set; }
}
LifePayment/LifePayment.Application.Contracts/LifePay/LifePayRateInput.cs
@@ -26,7 +26,7 @@
    /// ID
    /// </summary>
    [Required(ErrorMessage = "ID是必填项。")]
    public int Code { get; set; }
    public string Code { get; set; }
    /// <summary>
    /// 供应商折扣
@@ -61,4 +61,9 @@
public class QueryRateChannelInput
{
    public LifePayRateChannelStatus? Status { get; set; }
    /// <summary>
    /// 充值类型
    /// </summary>
    public LifePayOrderTypeEnum? LifePayOrderType { get; set; }
}
LifePayment/LifePayment.Application/LifePay/LifePayAnnouncementService.cs
New file
@@ -0,0 +1,151 @@
using AutoMapper.QueryableExtensions;
using 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 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 Volo.Abp.ObjectMapping;
using ZeroD.Util;
using ZeroD.Util.Fadd;
namespace LifePayment.Application.LifePay;
public class LifePayAnnouncementService : ApplicationService, ILifePayAnnouncementService
{
    private readonly IRepository<LifePayAnnouncement, Guid> _lifePayAnnouncementRepository;
    public LifePayAnnouncementService(IRepository<LifePayAnnouncement, Guid> lifePayAnnouncementRepository)
    {
        _lifePayAnnouncementRepository = lifePayAnnouncementRepository;
    }
    /// <summary>
    /// 获取公告分页
    /// </summary>
    /// <param name="input"></param>
    /// <returns></returns>
    public async Task<PageOutput<CreateEditLifePayAnnouncementOutput>> GetLifePayAnnouncementPage(GetLifePayAnnouncementPageInput input)
    {
        var currentTime = DateTime.Now;
        var query = _lifePayAnnouncementRepository
            .WhereIf(input.CreationTimeBegin.HasValue, x => x.CreationTime >= input.CreationTimeBegin)
            .WhereIf(input.CreationTimeEnd.HasValue, x => x.CreationTime <= input.CreationTimeEnd)
            .WhereIf(input.StartTime.HasValue, x => x.StartTime >= input.StartTime)
            .WhereIf(input.EndTime.HasValue, x => x.EndTime <= input.EndTime)
            .WhereIf(input.Status.HasValue, x => input.Status.Value == AnnouncementStatusEnum.Wait
                ? currentTime < x.StartTime
                    : input.Status.Value == AnnouncementStatusEnum.Showing
                        ? currentTime >= x.StartTime && currentTime <= x.EndTime
                        : input.Status.Value == AnnouncementStatusEnum.Stop
                            ? currentTime > x.EndTime
                            : false)
            .Select(x =>
                    new CreateEditLifePayAnnouncementOutput()
                    {
                        Id = x.Id,
                        AnnouncementType = x.AnnouncementType,
                        StartTime = x.StartTime,
                        EndTime = x.EndTime,
                        AnnouncementContent = x.AnnouncementContent,
                        CreationTime = x.CreationTime,
                        Status = GetLifePayAnnouncementStatus(x.StartTime, x.EndTime)
                    });
        var result = await query.GetPageResult(input.PageModel);
        return result;
    }
    /// <summary>
    /// 新增编辑公告
    /// </summary>
    /// <param name="input"></param>
    /// <returns></returns>
    public async Task<int> CreateOrEditLifePayAnnouncement(CreateEditLifePayAnnouncementInput input)
    {
        CheckExtensions.IfTrueThrowUserFriendlyException(input.EndTime <= input.StartTime, "截止日期不能低于生效日期");
        bool isExist = await _lifePayAnnouncementRepository.AnyAsync(r => (!input.Id.HasValue||r.Id != input.Id.Value)&&input.AnnouncementType==r.AnnouncementType&&!(input.EndTime < r.StartTime || input.StartTime > r.EndTime));
        CheckExtensions.IfTrueThrowUserFriendlyException(isExist, "同一时间段只能存在一条公告");
        if (input.Id.HasValue)
        {
            var dto = await _lifePayAnnouncementRepository.FirstOrDefaultAsync(r => r.Id == input.Id.Value);
            CheckExtensions.IfTrueThrowUserFriendlyException(dto == null, "未获取到公告数据");
            dto.AnnouncementType = input.AnnouncementType;
            dto.StartTime = input.StartTime;
            dto.EndTime = input.EndTime;
            dto.AnnouncementContent = input.AnnouncementContent;
        }
        else
        {
            input.Id = Guid.NewGuid();
            var entity = ObjectMapper.Map<CreateEditLifePayAnnouncementInput, LifePayAnnouncement>(input);
            await _lifePayAnnouncementRepository.InsertAsync(entity);
        }
        return Constant.SUCCESS;
    }
    /// <summary>
    /// 删除公告
    /// </summary>
    /// <param name="id"></param>
    /// <returns></returns>
    public async Task<int> DeleteLifePayAnnouncement(Guid id)
    {
        await _lifePayAnnouncementRepository.DeleteAsync(s => s.Id == id);
        return Constant.SUCCESS;
    }
    /// <summary>
    /// 获取当前展示中的公告
    /// </summary>
    /// <returns></returns>
    public async Task<CreateEditLifePayAnnouncementOutput> GetShowingLifePayAnnouncement(GetShowingLifePayAnnouncementInput input)
    {
        DateTime now = DateTime.Now;
        var announcement = await _lifePayAnnouncementRepository
            .WhereIf(input.AnnouncementType.HasValue,x=>x.AnnouncementType==input.AnnouncementType)
            .Where(x => now >= x.StartTime && now <= x.EndTime).OrderBy(r => r.StartTime).FirstOrDefaultAsync();
        if (announcement == null)
        {
            return null;
        }
        var model = ObjectMapper.Map<LifePayAnnouncement, CreateEditLifePayAnnouncementOutput>(announcement);
        model.Status = GetLifePayAnnouncementStatus(announcement.StartTime, announcement.EndTime);
        return model;
    }
    private static AnnouncementStatusEnum GetLifePayAnnouncementStatus(DateTime startTime, DateTime endTime)
    {
        DateTime now = DateTime.Now;
        if (now < startTime)
        {
            return AnnouncementStatusEnum.Wait;
        }
        else if (now >= startTime && now <= endTime)
        {
            return AnnouncementStatusEnum.Showing;
        }
        else
        {
            return AnnouncementStatusEnum.Stop;
        }
    }
}
LifePayment/LifePayment.Application/LifePay/LifePayRateService.cs
@@ -46,7 +46,10 @@
    /// <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();
        return await GetLifePayRateChannelListFilter()
            .WhereIf(input.LifePayOrderType.HasValue, x => x.LifePayOrderType == input.LifePayOrderType)
            .WhereIf(input.Status.HasValue, x => x.Status == input.Status)
            .OrderBy(r => r.CreationTime).ToListAsync();
    }
    /// <summary>
@@ -59,7 +62,7 @@
        CheckExtensions.IfTrueThrowUserFriendlyException(input.SupplierRate < 0.01m, "供应商折扣设置错误");
        CheckExtensions.IfTrueThrowUserFriendlyException(input.PlatformRate < 0.01m, "平台折扣设置错误");
        CheckExtensions.IfTrueThrowUserFriendlyException(input.PlatformRate < input.SupplierRate, "平台折扣无法低于供应商折扣");
        bool isExist = await _lifePayRateChannelRepository.AnyAsync(r => r.Code == input.Code);
        bool isExist = await _lifePayRateChannelRepository.AnyAsync(r => (!input.Id.HasValue || r.Id != input.Id.Value) && r.Code == input.Code);
        CheckExtensions.IfTrueThrowUserFriendlyException(isExist, "ID已存在");
        if (input.Id.HasValue)
        {
@@ -112,6 +115,30 @@
        return Constant.SUCCESS;
    }
    public async Task<CreateEditRateChannelOutput> GetRateChannelByCode(string code)
    {
        var dto = await _lifePayRateChannelRepository.FirstOrDefaultAsync(x => x.Code == code);
        if (dto == null)
        {
            return new CreateEditRateChannelOutput();
        }
        else
        {
            return new CreateEditRateChannelOutput
            {
                Id = dto.Id,
                LifePayOrderType = dto.LifePayOrderType,
                RateChannelName = dto.RateChannelName,
                Code = dto.Code,
                SupplierRate = dto.SupplierRate,
                PlatformRate = dto.PlatformRate,
                Status = dto.Status,
                Remark = dto.Remark,
                CreationTime = dto.CreationTime,
            };
        }
    }
    private IQueryable<CreateEditRateChannelOutput> GetLifePayRateChannelListFilter()
    {
        var query = from x in _lifePayRateChannelRepository
LifePayment/LifePayment.Application/LifePay/LifePayService.cs
@@ -1,5 +1,6 @@
using Alipay.EasySDK.Payment.Common.Models;
using LifePayment.Application.Contracts;
using LifePayment.Application.LifePay;
using LifePayment.Domain;
using LifePayment.Domain.LifePay;
using LifePayment.Domain.Models;
@@ -50,6 +51,7 @@
    private readonly IAliPayApi _aliPayApi;
    private readonly IAlipayInterfaceManager _alipayInterfaceManager;
    private readonly IWxPayApi _wxPayApi;
    private readonly ILifePayRateService _lifePayRateService;
    private readonly WxPayOption _wxPayOptions;
    private readonly InitSetting _initSettingOptions;
@@ -77,6 +79,7 @@
                          IRepository<LifePayAccount, Guid> lifePayAccount,
                          IDataFilter dataFilter,
                          IChannelFilter channelFilter,
                          ILifePayRateService lifePayRateService,
                          IAbpDistributedLock distributedLock)
    {
        _logger = logger;
@@ -101,6 +104,7 @@
        _channelFilter = channelFilter;
        this.distributedLock = distributedLock;
        _operateHistory = operateHistory;
        _lifePayRateService = lifePayRateService;
    }
    #region 查询
@@ -1086,11 +1090,14 @@
        && x.OrderParamDetailJsonStr.Contains(input.ProductData.Phone)).AnyAsync();
        CheckExtensions.IfTrueThrowUserFriendlyException(repeatOrder, "您有同户号订单正在充值中,请勿重复充值");
        var rate = await GetLifePayRate(channle, LifePayRateTypeEnum.默认话费折扣);
        var rateChannel = await GetLifePayRate(channle,input.ProductData.IspCode);
        //平台折扣
        var rate = rateChannel.Rate;
        var amount = CalculateAmount(input.ProductData.ParValue, rate);
        var platformRate = await _lifePayRateRepository.FirstOrDefaultAsync(r => r.RateType == LifePayRateTypeEnum.供应商折扣价);
        //供应商折扣价
        var platformRate = rateChannel.SupplierRate;
        var orderInput = new CreateLifePayOrderInput
        {
@@ -1106,8 +1113,8 @@
            DiscountAmount = amount.DiscountAmount,
            RechargeAmount = amount.RechargeAmount,
            ChannelId = channle.ChannlesNum,
            PlatformRate = platformRate.Rate,
            PlatformDeductionAmount = amount.RechargeAmount * platformRate.Rate / 100,
            PlatformRate = platformRate,
            PlatformDeductionAmount = amount.RechargeAmount * platformRate / 100,
            ChannleRate = rate,
            ChannlesRakeRate = channle.ChannlesRakeRate,
        };
@@ -1140,16 +1147,13 @@
         && x.OrderParamDetailJsonStr.Contains(input.ProductData.ElectricAccount)).AnyAsync();
        CheckExtensions.IfTrueThrowUserFriendlyException(repeatOrder, "您有同户号订单正在充值中,请勿重复充值");
        var rateChannel = await GetLifePayRate(channle, input.ProductData.ElectricType);
        //平台折扣
        var rate = rateChannel.Rate;
        var rate = await GetLifePayRate(channle, LifePayRateTypeEnum.默认电费折扣);
        var amount = CalculateAmount(input.ProductData.ParValue, rate);
        var platformRate = await _lifePayRateRepository.FirstOrDefaultAsync(r => r.RateType == LifePayRateTypeEnum.供应商折扣价);
        //TODO 相关单项折扣调节功能未上线 目前针对情况临时写死
        if (input.ProductData.ElectricType == "guowang")
        {
            platformRate.Rate = 95;
        }
        //供应商折扣价
        var platformRate = rateChannel.SupplierRate;
        var orderInput = new CreateLifePayOrderInput
        {
@@ -1164,8 +1168,8 @@
            DiscountAmount = amount.DiscountAmount,
            RechargeAmount = amount.RechargeAmount,
            ChannelId = channle.ChannlesNum,
            PlatformRate = platformRate.Rate,
            PlatformDeductionAmount = amount.RechargeAmount * platformRate.Rate / 100,
            PlatformRate = platformRate,
            PlatformDeductionAmount = amount.RechargeAmount * platformRate / 100,
            ChannleRate = rate,
            ChannlesRakeRate = channle.ChannlesRakeRate,
        };
@@ -1198,12 +1202,14 @@
        && x.OrderParamDetailJsonStr.Contains(input.ProductData.GasAccount)).AnyAsync();
        CheckExtensions.IfTrueThrowUserFriendlyException(repeatOrder, "您有同户号订单正在充值中,请勿重复充值");
        var rate = await GetLifePayRate(channle, LifePayRateTypeEnum.默认燃气折扣);
        var rateChannel = await GetLifePayRate(channle, input.ProductData.GasOrgType);
        //平台折扣
        var rate = rateChannel.Rate;
        var amount = CalculateAmount(input.ProductData.ParValue, rate);
        var platformRate = await _lifePayRateRepository.FirstOrDefaultAsync(r => r.RateType == LifePayRateTypeEnum.供应商折扣价);
        //供应商折扣价
        var platformRate = rateChannel.SupplierRate;
        var orderInput = new CreateLifePayOrderInput
        {
@@ -1219,8 +1225,8 @@
            DiscountAmount = amount.DiscountAmount,
            RechargeAmount = amount.RechargeAmount,
            ChannelId = channle.ChannlesNum,
            PlatformRate = platformRate.Rate,
            PlatformDeductionAmount = amount.RechargeAmount * platformRate.Rate / 100,
            PlatformRate = platformRate,
            PlatformDeductionAmount = amount.RechargeAmount * platformRate / 100,
            ChannleRate = rate,
            ChannlesRakeRate = channle.ChannlesRakeRate,
        };
@@ -1923,6 +1929,7 @@
                dto.PromoterId = promoter.Id;
            }
            //TODO 后续需要修改 现在的供应商折扣价根据运营商不同 配置不同 不是统一配置了
            var rate = await _lifePayRateRepository.FirstOrDefaultAsync(it => it.RateType == LifePayRateTypeEnum.供应商折扣价);
            CheckExtensions.IfTrueThrowUserFriendlyException(rate != null && input.ChannlesRate < rate.Rate, "渠道折扣无法低于供应商折扣");
@@ -2455,18 +2462,24 @@
        };
    }
    public async Task<decimal> GetLifePayRate(CreateEditPayChannelsInput channel, LifePayRateTypeEnum lifePayRateType)
    public async Task<GetLifePayRateOutput> GetLifePayRate(CreateEditPayChannelsInput channel, string code)
    {
        var rateChannel = await _lifePayRateService.GetRateChannelByCode(code);
            CheckExtensions.IfTrueThrowUserFriendlyException(rateChannel.Id.IsEmpty(), "未配置折扣");
        if (channel == null)
        {
            var rate = await GetRate();
            CheckExtensions.IfTrueThrowUserFriendlyException(rate.IsNullOrEmpty(), "未配置折扣");
            var result = rate.FirstOrDefault(x => x.RateType == lifePayRateType).Rate;
            return result;
            return new GetLifePayRateOutput
            {
                Rate = rateChannel.PlatformRate,
                SupplierRate = rateChannel.SupplierRate
            };
        }
        else
        {
            return channel.ChannlesRate;
            return new GetLifePayRateOutput {
                Rate= channel.ChannlesRate,
                SupplierRate = rateChannel.SupplierRate
            };
        }
    }
LifePayment/LifePayment.Application/LifePaymentServicesApplicationModuleAutoMapperProfile.cs
@@ -43,6 +43,9 @@
            CreateMap<LogFrontInput, LogFrontRecord>(MemberList.None);
            CreateMap<CreateEditRateChannelInput, LifePayRateChannel>(MemberList.None);
            CreateMap<CreateEditLifePayAnnouncementInput, LifePayAnnouncement>(MemberList.None);
            CreateMap<LifePayAnnouncement, CreateEditLifePayAnnouncementOutput>(MemberList.None);
        }
    }
}
LifePayment/LifePayment.Domain.Shared/Enum/LifePay/LifePayAnnouncement.cs
New file
@@ -0,0 +1,44 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace LifePayment.Domain.Shared;
public enum AnnouncementTypeEnum
{
    /// <summary>
    /// 普通公告
    /// </summary>
    [Description("普通公告")]
    Normal = 10,
    /// <summary>
    /// 弹窗公告
    /// </summary>
    [Description("弹窗公告")]
    Dialog = 20,
}
public enum AnnouncementStatusEnum
{
    /// <summary>
    /// 展示中
    /// </summary>
    [Description("展示中")]
    Showing = 10,
    /// <summary>
    /// 待展示
    /// </summary>
    [Description("待展示")]
    Wait = 20,
    /// <summary>
    /// 已停止
    /// </summary>
    [Description("已停止")]
    Stop = 30,
}
LifePayment/LifePayment.Domain.Shared/Enum/LifePay/LifePayRateChannel.cs
@@ -18,35 +18,47 @@
}
public enum LifePayRateChannelCodeEnum
//public enum LifePayRateChannelCodeEnum
//{
//    /// <summary>
//    /// 中国移动
//    /// </summary>
//    [Description("liantong")]
//    中国移动 = 10,
//    /// <summary>
//    /// 中国联通
//    /// </summary>
//    [Description("中国联通")]
//    中国联通 = 20,
//    /// <summary>
//    /// 中国电信
//    /// </summary>
//    [Description("中国电信")]
//    中国电信 = 30,
//    /// <summary>
//    /// 国家电网
//    /// </summary>
//    [Description("国家电网")]
//    国家电网 = 40,
//    /// <summary>
//    /// 南方电网
//    /// </summary>
//    [Description("南方电网")]
//    南方电网 = 50,
//}
public static class LifePayRateChannelCode
{
    /// <summary>
    /// 中国移动
    /// </summary>
    [Description("中国移动")]
    中国移动 = 10,
    /// <summary>
    /// 中国联通
    /// </summary>
    [Description("中国联通")]
    中国联通 = 20,
    /// <summary>
    /// 中国电信
    /// </summary>
    [Description("中国电信")]
    中国电信 = 30,
    /// <summary>
    /// 国家电网
    /// </summary>
    [Description("国家电网")]
    国家电网 = 40,
    /// <summary>
    /// 南方电网
    /// </summary>
    [Description("南方电网")]
    南方电网 = 50,
    public const string 中国移动 = "yidong";
    public const string 中国联通 = "liantong";
    public const string 中国电信 = "dianxin";
    public const string 国家电网 = "guowang";
    public const string 南方电网 = "nanwang";
    public const string 中燃燃气 = "zhong_ran";
    public const string 新奥燃气 = "xin_ao";
    public const string 北京燃气 = "bei_jing";
}
LifePayment/LifePayment.Domain/LifePay/LifePayAnnouncement.cs
New file
@@ -0,0 +1,37 @@
using LifePayment.Domain.Shared;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Volo.Abp;
using Volo.Abp.Domain.Entities.Auditing;
namespace LifePayment.Domain.LifePay;
public partial class LifePayAnnouncement : FullAuditedEntity<Guid>, IDataUserFilter
{
    public LifePayAnnouncement()
    {
    }
    /// <summary>
    /// 公告类型
    /// </summary>
    public AnnouncementTypeEnum AnnouncementType { get; set; }
    /// <summary>
    /// 生效日期
    /// </summary>
    public DateTime StartTime { get; set; }
    /// <summary>
    /// 截止日期
    /// </summary>
    public DateTime EndTime { get; set; }
    /// <summary>
    /// 公告内容
    /// </summary>
    public string AnnouncementContent { get; set; }
}
LifePayment/LifePayment.Domain/LifePay/LifePayRateChannel.cs
@@ -24,7 +24,7 @@
    /// <summary>
    /// ID
    /// </summary>
    public int Code { get; set; }
    public string Code { get; set; }
    /// <summary>
    /// 供应商折扣
LifePayment/LifePayment.EntityFrameworkCore/LifePaymentServicesDbContext.cs
@@ -65,6 +65,8 @@
        public virtual DbSet<LifePayRateChannel> LifePayRateChannel { get; set; }
        public virtual DbSet<LifePayAnnouncement> LifePayAnnouncement { get; set; }
        [UnitOfWork]
        protected override void OnModelCreating(ModelBuilder builder)
        {
LifePayment/LifePayment.Host/LifePaymentService.HttpApi.xml
@@ -63,6 +63,33 @@
            </summary>
            <returns></returns>
        </member>
        <member name="M:LifePayment.HttpApi.LifePayAnnouncementController.GetLifePayAnnouncementPage(LifePayment.Application.Contracts.GetLifePayAnnouncementPageInput)">
            <summary>
            获取公告分页
            </summary>
            <param name="input"></param>
            <returns></returns>
        </member>
        <member name="M:LifePayment.HttpApi.LifePayAnnouncementController.CreateOrEditLifePayAnnouncement(LifePayment.Application.Contracts.CreateEditLifePayAnnouncementInput)">
            <summary>
            新增编辑公告
            </summary>
            <param name="input"></param>
            <returns></returns>
        </member>
        <member name="M:LifePayment.HttpApi.LifePayAnnouncementController.DeleteLifePayAnnouncement(System.Guid)">
            <summary>
            删除公告
            </summary>
            <param name="id"></param>
            <returns></returns>
        </member>
        <member name="M:LifePayment.HttpApi.LifePayAnnouncementController.GetShowingLifePayAnnouncement(LifePayment.Application.Contracts.GetShowingLifePayAnnouncementInput)">
            <summary>
            获取当前展示中的公告
            </summary>
            <returns></returns>
        </member>
        <member name="M:LifePayment.HttpApi.LifePayController.GetTopStatistics(LifePayment.Application.Contracts.TopStatisticsInput)">
            <summary>
            获取顶部统计数据
LifePayment/LifePayment.Host/LifePaymentServices.Application.Contracts.xml
@@ -4,6 +4,33 @@
        <name>LifePayment.Application.Contracts</name>
    </assembly>
    <members>
        <member name="M:LifePayment.Application.Contracts.ILifePayAnnouncementService.GetLifePayAnnouncementPage(LifePayment.Application.Contracts.GetLifePayAnnouncementPageInput)">
            <summary>
            获取公告分页
            </summary>
            <param name="input"></param>
            <returns></returns>
        </member>
        <member name="M:LifePayment.Application.Contracts.ILifePayAnnouncementService.CreateOrEditLifePayAnnouncement(LifePayment.Application.Contracts.CreateEditLifePayAnnouncementInput)">
            <summary>
            新增编辑公告
            </summary>
            <param name="input"></param>
            <returns></returns>
        </member>
        <member name="M:LifePayment.Application.Contracts.ILifePayAnnouncementService.DeleteLifePayAnnouncement(System.Guid)">
            <summary>
            删除公告
            </summary>
            <param name="id"></param>
            <returns></returns>
        </member>
        <member name="M:LifePayment.Application.Contracts.ILifePayAnnouncementService.GetShowingLifePayAnnouncement(LifePayment.Application.Contracts.GetShowingLifePayAnnouncementInput)">
            <summary>
            获取当前展示中的公告
            </summary>
            <returns></returns>
        </member>
        <member name="M:LifePayment.Application.Contracts.ILifePayRateService.GetLifePayRateChannelPage(ZeroD.Util.PageInput)">
            <summary>
            获取折扣通道配置分页
@@ -339,6 +366,26 @@
            <param name="amount"></param>
            <returns></returns>
            <exception cref="T:Volo.Abp.UserFriendlyException"></exception>
        </member>
        <member name="P:LifePayment.Application.Contracts.CreateEditLifePayAnnouncementInput.AnnouncementType">
            <summary>
            公告类型
            </summary>
        </member>
        <member name="P:LifePayment.Application.Contracts.CreateEditLifePayAnnouncementInput.StartTime">
            <summary>
            生效日期
            </summary>
        </member>
        <member name="P:LifePayment.Application.Contracts.CreateEditLifePayAnnouncementInput.EndTime">
            <summary>
            截止日期
            </summary>
        </member>
        <member name="P:LifePayment.Application.Contracts.CreateEditLifePayAnnouncementInput.AnnouncementContent">
            <summary>
            公告内容
            </summary>
        </member>
        <member name="P:LifePayment.Application.Contracts.CreateLifePayOrderInput`1.ChannelId">
            <summary>
@@ -2310,6 +2357,11 @@
            通知内容
            </summary>
        </member>
        <member name="P:LifePayment.Application.Contracts.LifePay.QueryRateChannelInput.LifePayOrderType">
            <summary>
            充值类型
            </summary>
        </member>
        <member name="M:LifePayment.Application.Contracts.ILogService.LogFront(LifePayment.Domain.Shared.LogFrontInput)">
            <summary>
            记录前端日志
LifePayment/LifePayment.HttpApi/LifePay/LifePayAnnouncementController.cs
New file
@@ -0,0 +1,84 @@
using 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 LifePayAnnouncementController : AbpController
    {
        private readonly ILifePayAnnouncementService _lifePayAnnouncementService;
        public LifePayAnnouncementController(
              ILifePayAnnouncementService lifePayAnnouncementService
              )
        {
            _lifePayAnnouncementService = lifePayAnnouncementService;
        }
        /// <summary>
        /// 获取公告分页
        /// </summary>
        /// <param name="input"></param>
        /// <returns></returns>
        [HttpPost]
        public async Task<PageOutput<CreateEditLifePayAnnouncementOutput>> GetLifePayAnnouncementPage(GetLifePayAnnouncementPageInput input)
        {
            return await _lifePayAnnouncementService.GetLifePayAnnouncementPage(input);
        }
        /// <summary>
        /// 新增编辑公告
        /// </summary>
        /// <param name="input"></param>
        /// <returns></returns>
        [HttpPost]
        public async Task<int> CreateOrEditLifePayAnnouncement(CreateEditLifePayAnnouncementInput input)
        {
            return await _lifePayAnnouncementService.CreateOrEditLifePayAnnouncement(input);
        }
        /// <summary>
        /// 删除公告
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        [HttpGet]
        public async Task<int> DeleteLifePayAnnouncement(Guid id)
        {
            return await _lifePayAnnouncementService.DeleteLifePayAnnouncement(id);
        }
        /// <summary>
        /// 获取当前展示中的公告
        /// </summary>
        /// <returns></returns>
        [HttpPost]
        [AllowAnonymous]
        public async Task<CreateEditLifePayAnnouncementOutput> GetShowingLifePayAnnouncement(GetShowingLifePayAnnouncementInput input)
        {
            return await _lifePayAnnouncementService.GetShowingLifePayAnnouncement(input);
        }
    }
}
LifePayment/LifePayment.HttpApi/LifePay/LifePayRateController.cs
@@ -52,6 +52,7 @@
        /// <param name="input"></param>
        /// <returns></returns>
        [HttpPost]
        [AllowAnonymous]
        public async Task<List<CreateEditRateChannelOutput>> GetLifePayRateChannelAllList(QueryRateChannelInput input)
        {
            return await _lifePayRateService.GetLifePayRateChannelAllList(input);