Merge branch 'master' of http://120.26.58.240:8888/r/LifePaymentApi
| New file |
| | |
| | | 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); |
| | | } |
| New file |
| | |
| | | using 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); |
| | | |
| | | Task<CreateEditRateChannelOutput> GetRateChannelByCode(string code); |
| | | } |
| New file |
| | |
| | | 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; } |
| | | } |
| | |
| | | public class QueryLifePayChannlesInput |
| | | { |
| | | public LifePayChannelsStatsEnum? Status { get; set; } |
| | | } |
| | | |
| | | public class GetLifePayRateOutput |
| | | { |
| | | public decimal SupplierRate { get; set; } |
| | | |
| | | public decimal Rate { get; set; } |
| | | } |
| | |
| | | /// </summary> |
| | | public bool IsBackClientUser { get; set; } |
| | | |
| | | public string[] Roles { get; set; } |
| | | |
| | | public bool IsSystem { get; set; } |
| | | |
| | | /// <summary> |
| New file |
| | |
| | | using 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 string Code { get; set; } |
| | | |
| | | /// <summary> |
| | | /// 供应商折扣 |
| | | /// </summary> |
| | | [Required(ErrorMessage = "供应商折扣是必填项。")] |
| | | 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; } |
| | | |
| | | /// <summary> |
| | | /// 充值类型 |
| | | /// </summary> |
| | | public LifePayOrderTypeEnum? LifePayOrderType { get; set; } |
| | | } |
| New file |
| | |
| | | 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; |
| | | } |
| | | } |
| | | } |
| | |
| | | var query = await _wxPayApi.WxPayDomesticRefundsQuery(input.OutRefundNo); |
| | | if (query.Status == WxPayRefundStatus.退款成功) |
| | | { |
| | | data.OrderNo = input.OutRefundNo; |
| | | data.OrderNo = input.OrderNo; |
| | | data.ExtraProperties = JsonConvert.SerializeObject(query); |
| | | data.FinishTime = Convert.ToDateTime(query.SuccessTime); |
| | | data.Amount = Convert.ToDecimal(query.Amount.Total) / 100; |
| New file |
| | |
| | | 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 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.LifePayOrderType.HasValue, x => x.LifePayOrderType == input.LifePayOrderType) |
| | | .WhereIf(input.Status.HasValue, x => x.Status == input.Status) |
| | | .OrderBy(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, "供应商折扣设置错误"); |
| | | CheckExtensions.IfTrueThrowUserFriendlyException(input.PlatformRate < 0.01m, "平台折扣设置错误"); |
| | | CheckExtensions.IfTrueThrowUserFriendlyException(input.PlatformRate < input.SupplierRate, "平台折扣无法低于供应商折扣"); |
| | | 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) |
| | | { |
| | | 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; |
| | | } |
| | | |
| | | 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 |
| | | 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; |
| | | } |
| | | } |
| | |
| | | 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; |
| | |
| | | private readonly IAliPayApi _aliPayApi; |
| | | private readonly IAlipayInterfaceManager _alipayInterfaceManager; |
| | | private readonly IWxPayApi _wxPayApi; |
| | | private readonly ILifePayRateService _lifePayRateService; |
| | | private readonly WxPayOption _wxPayOptions; |
| | | private readonly InitSetting _initSettingOptions; |
| | | |
| | |
| | | IRepository<LifePayAccount, Guid> lifePayAccount, |
| | | IDataFilter dataFilter, |
| | | IChannelFilter channelFilter, |
| | | ILifePayRateService lifePayRateService, |
| | | IAbpDistributedLock distributedLock) |
| | | { |
| | | _logger = logger; |
| | |
| | | _channelFilter = channelFilter; |
| | | this.distributedLock = distributedLock; |
| | | _operateHistory = operateHistory; |
| | | _lifePayRateService = lifePayRateService; |
| | | } |
| | | |
| | | #region 查询 |
| | |
| | | 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.供应商折扣价); |
| | | //var platformRate = await _lifePayRateRepository.FirstOrDefaultAsync(r => r.RateType == LifePayRateTypeEnum.供应商折扣价); |
| | | 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, "订单不存在"); |
| | |
| | | && 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 |
| | | { |
| | |
| | | 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, |
| | | }; |
| | |
| | | && 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.供应商折扣价); |
| | | //供应商折扣价 |
| | | var platformRate = rateChannel.SupplierRate; |
| | | |
| | | var orderInput = new CreateLifePayOrderInput |
| | | { |
| | |
| | | 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, |
| | | }; |
| | |
| | | && 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 |
| | | { |
| | |
| | | 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, |
| | | }; |
| | |
| | | if (order.LifePayOrderStatus == status && order.ACOOLYStatus == acoolyStatus) |
| | | { |
| | | _logger.LogInformation($"订单({orderNo})已处理该状态"); |
| | | return; |
| | | } |
| | | |
| | | if (order.LifePayOrderStatus == LifePayOrderStatusEnum.已退款) |
| | | { |
| | | _logger.LogInformation($"订单已退款,不在处理"); |
| | | return; |
| | | } |
| | | |
| | |
| | | dto.PromoterId = promoter.Id; |
| | | } |
| | | |
| | | //TODO 后续需要修改 现在的供应商折扣价根据运营商不同 配置不同 不是统一配置了 |
| | | var rate = await _lifePayRateRepository.FirstOrDefaultAsync(it => it.RateType == LifePayRateTypeEnum.供应商折扣价); |
| | | CheckExtensions.IfTrueThrowUserFriendlyException(rate != null && input.ChannlesRate < rate.Rate, "渠道折扣无法低于供应商折扣"); |
| | | |
| | |
| | | }; |
| | | } |
| | | |
| | | 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 |
| | | }; |
| | | } |
| | | } |
| | | |
| | |
| | | using AutoMapper; |
| | | using LifePayment.Application.Contracts; |
| | | using LifePayment.Application.Contracts.LifePay; |
| | | using LifePayment.Application.Contracts.Sync; |
| | | using LifePayment.Domain; |
| | | using LifePayment.Domain.LifePay; |
| | |
| | | CreateMap<CreateChannelConsultationFollowupInput, LifePayChannelConsultationFollowup>(MemberList.None); |
| | | |
| | | CreateMap<LogFrontInput, LogFrontRecord>(MemberList.None); |
| | | |
| | | CreateMap<CreateEditRateChannelInput, LifePayRateChannel>(MemberList.None); |
| | | |
| | | CreateMap<CreateEditLifePayAnnouncementInput, LifePayAnnouncement>(MemberList.None); |
| | | CreateMap<LifePayAnnouncement, CreateEditLifePayAnnouncementOutput>(MemberList.None); |
| | | } |
| | | } |
| | | } |
| | |
| | | { |
| | | IsBackClientUser = CurrentUser.ClientId == Constant.ClientType.Back, |
| | | IsSystem = CurrentUser.IsSystem, |
| | | Roles = CurrentUser.Roles, |
| | | ChannleList = channleList |
| | | }; |
| | | return result; |
| New file |
| | |
| | | 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, |
| | | } |
| New file |
| | |
| | | using 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("liantong")] |
| | | // 中国移动 = 10, |
| | | |
| | | // /// <summary> |
| | | // /// 中国联通 |
| | | // /// </summary> |
| | | // [Description("中国联通")] |
| | | // 中国联通 = 20, |
| | | |
| | | // /// <summary> |
| | | // /// 中国电信 |
| | | // /// </summary> |
| | | // [Description("中国电信")] |
| | | // 中国电信 = 30, |
| | | |
| | | // /// <summary> |
| | | // /// 国家电网 |
| | | // /// </summary> |
| | | // [Description("国家电网")] |
| | | // 国家电网 = 40, |
| | | |
| | | // /// <summary> |
| | | // /// 南方电网 |
| | | // /// </summary> |
| | | // [Description("南方电网")] |
| | | // 南方电网 = 50, |
| | | //} |
| | | |
| | | public static class LifePayRateChannelCode |
| | | { |
| | | 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"; |
| | | } |
| New file |
| | |
| | | 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; } |
| | | } |
| New file |
| | |
| | | using 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 string 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; } |
| | | } |
| | |
| | | |
| | | public virtual DbSet<DallyStatistics> DallyStatistics { get; set; } |
| | | |
| | | public virtual DbSet<LifePayRateChannel> LifePayRateChannel { get; set; } |
| | | |
| | | public virtual DbSet<LifePayAnnouncement> LifePayAnnouncement { get; set; } |
| | | |
| | | [UnitOfWork] |
| | | protected override void OnModelCreating(ModelBuilder builder) |
| | | { |
| | |
| | | </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> |
| | | 获取顶部统计数据 |
| | |
| | | <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> |
| | | 记录前端日志 |
| | |
| | | <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> |
| | | 获取折扣通道配置分页 |
| | | </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> |
| | | 获取电费面值 |
| | |
| | | <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> |
| | |
| | | 结算时间 |
| | | </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="P:LifePayment.Application.Contracts.LifePay.QueryRateChannelInput.LifePayOrderType"> |
| | | <summary> |
| | | 充值类型 |
| | | </summary> |
| | | </member> |
| | | <member name="M:LifePayment.Application.Contracts.ILogService.LogFront(LifePayment.Domain.Shared.LogFrontInput)"> |
| | | <summary> |
| | | 记录前端日志 |
| | |
| | | "ConnectionStrings": { |
| | | "AbpIdentity": "Server=120.26.58.240; Database=Dev_LifePaymentIdentity; User=bole;Password=Bole1472589", |
| | | "LifePaymentServices": "Server=120.26.58.240; Database=Dev_LifePayment; User=bole;Password=Bole1472589", |
| | | //"LifePaymentServices": "Server=rm-bp1mt744021h1s6dg4o.sqlserver.rds.aliyuncs.com,2333;Database=Dev_LifePayment;Uid=bole;Pwd=Blcs20@%27;", |
| | | //"AbpIdentity": "Server=rm-bp1mt744021h1s6dg4o.sqlserver.rds.aliyuncs.com,2333;Database=Dev_LifePaymentIdentity;Uid=bole;Pwd=Blcs20@%27;", |
| | | //"LifePaymentServices": "Server=rm-bp1mt744021h1s6dg4o.sqlserver.rds.aliyuncs.com,2333;Database=Pro_LifePayment;Uid=bole;Pwd=Blcs20@%27;", |
| | | //"AbpIdentity": "Server=rm-bp1mt744021h1s6dg4o.sqlserver.rds.aliyuncs.com,2333;Database=Pro_LifePaymentIdentity;Uid=bole;Pwd=Blcs20@%27;", |
| | | |
| | | "SyncAbpIdentity": "Server=120.26.58.240; Database=Dev_LifePaymentIdentity; User=bole;Password=Bole1472589", |
| | | "SyncLifePaymentServices": "Server=120.26.58.240; Database=Dev_LifePayment; User=bole;Password=Bole1472589" |
| New file |
| | |
| | | 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); |
| | | } |
| | | } |
| | | } |
| | | |
| New file |
| | |
| | | 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 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] |
| | | [AllowAnonymous] |
| | | 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); |
| | | } |
| | | } |
| | | } |
| | |
| | | using LifePayment.Application.Contracts; |
| | | using Alipay.AopSdk.Core.Domain; |
| | | using LifePayment.Application.Contracts; |
| | | using LifePayment.Domain; |
| | | using LifePayment.Domain.Shared; |
| | | using Medallion.Threading; |
| | |
| | | { |
| | | try |
| | | { |
| | | _logger.LogError($"微信退款回调通知:进入微信回调"); |
| | | var req = input.ToJson(); |
| | | _logger.LogError($"微信退款回调通知:进入微信回调:" + req); |
| | | var data = _wxPayApi.AesGcmDecrypt(input.Resource.AssociatedData, input.Resource.Nonce, input.Resource.Ciphertext); |
| | | _logger.LogError($"微信退款回调通知data:" + data); |
| | | var wxPayNotice = JsonConvert.DeserializeObject<WxPayDomesticRefundsNotice>(data); |
| | |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | |
| | | _logger.LogError($"微信退款回调通知错误:" + ex.Message); |
| | | return new WxRechargeNotifyResult |
| | | { |
| | | Code = "FAIL", |
| | |
| | | Code = "SUCCESS", |
| | | }; |
| | | } |
| | | |
| | | [HttpPost] |
| | | [UnitOfWork] |
| | | public async Task WxPayDomesticRefundsNotifyImp(WxPayDomesticRefundsNotice input) |
| | | { |
| | | var wxPayNotice = input; |
| | | if (wxPayNotice.OutTradeNo.Contains("JF")) |
| | | { |
| | | |
| | | switch (wxPayNotice.RefundStatus) |
| | | { |
| | | case LifePaymentConstant.WxPayRefundStatus.退款成功: |
| | | await _lifePayService.LifePayRefundsHandler(wxPayNotice.OutTradeNo, LifePayRefundStatusEnum.已退款); |
| | | // 插入收支流水 |
| | | await _lifePayOrderService.AddLifePayExpensesReceipts(new AddLifePayExpensesReceiptsInput() |
| | | { |
| | | OrderNo = wxPayNotice.OutTradeNo, |
| | | OutRefundNo = wxPayNotice.OutRefundNo, |
| | | OutOrderNo = wxPayNotice.TransactionId, |
| | | LifePayType = LifePayTypeEnum.WxPay, |
| | | ExpensesReceiptsType = ExpensesReceiptsTypeEnum.Receipts, |
| | | Amount = wxPayNotice.Amount.Total |
| | | }); |
| | | break; |
| | | case LifePaymentConstant.WxPayRefundStatus.退款关闭: |
| | | case LifePaymentConstant.WxPayRefundStatus.退款处理中: |
| | | case LifePaymentConstant.WxPayRefundStatus.退款异常: |
| | | await _lifePayService.LifePayRefundsHandler(wxPayNotice.OutTradeNo, LifePayRefundStatusEnum.退款中); |
| | | break; |
| | | default: await _lifePayService.LifePayRefundsHandler(wxPayNotice.OutTradeNo, LifePayRefundStatusEnum.退款中); break; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |