From bf83f6be388f97302c88f21cb340811abf3a596b Mon Sep 17 00:00:00 2001 From: zhengyuxuan <zhengyuxuan1995> Date: 星期四, 20 三月 2025 13:29:20 +0800 Subject: [PATCH] fix:1分钱支付 --- LifePayment/LifePayment.Application.Contracts/LifePay/LifePayOutput.cs | 132 +++++++++++++++++++++++++++++++++ LifePayment/LifePayment.HttpApi/LifePay/LifePayController.cs | 10 +- LifePayment/LifePayment.Application.Contracts/LifePay/ILifePayService.cs | 8 ++ LifePayment/LifePayment.Domain/LifePay/LifePayOrder.cs | 6 + LifePayment/LifePayment.Application/LifePay/LifePayService.cs | 38 +++++++++ 5 files changed, 187 insertions(+), 7 deletions(-) diff --git a/LifePayment/LifePayment.Application.Contracts/LifePay/ILifePayService.cs b/LifePayment/LifePayment.Application.Contracts/LifePay/ILifePayService.cs index 4499824..5fd06b6 100644 --- a/LifePayment/LifePayment.Application.Contracts/LifePay/ILifePayService.cs +++ b/LifePayment/LifePayment.Application.Contracts/LifePay/ILifePayService.cs @@ -194,6 +194,14 @@ /// <returns></returns> Task<PageOutput<LifePayOrderListOutput>> GetLifePayOrderPage(QueryLifePayOrderListInput input); + + /// <summary> + /// 鑾峰彇璁㈠崟璇︽儏 + /// </summary> + /// <param name="orderNo"></param> + /// <returns></returns> + Task<LifePayOrderOutput> GetLifePayOrderDetail(string orderNo); + /// <summary> /// 鏍规嵁璁㈠崟鍙疯幏鍙栨敮浠樼姸鎬� /// </summary> diff --git a/LifePayment/LifePayment.Application.Contracts/LifePay/LifePayOutput.cs b/LifePayment/LifePayment.Application.Contracts/LifePay/LifePayOutput.cs index 8670fc7..0667275 100644 --- a/LifePayment/LifePayment.Application.Contracts/LifePay/LifePayOutput.cs +++ b/LifePayment/LifePayment.Application.Contracts/LifePay/LifePayOutput.cs @@ -452,6 +452,138 @@ public string ACOOLYOrderNo { get; set; } } +public class LifePayOrderOutput +{ + public Guid Id { get; set; } + + /// <summary> + /// 鐢熸椿缂磋垂鏀粯绫诲瀷 + /// </summary> + public LifePayTypeEnum? LifePayType { get; set; } + + /// <summary> + /// 璁㈠崟绫诲瀷 + /// </summary> + public LifePayOrderTypeEnum LifePayOrderType { get; set; } + + /// <summary> + /// 璁㈠崟鍙� + /// </summary> + public string OrderNo { get; set; } + + /// <summary> + /// 鍏呭�奸噾棰� + /// </summary> + public decimal RechargeAmount { get; set; } + + /// <summary> + /// 浼樻儬閲戦 + /// </summary> + public decimal DiscountAmount { get; set; } + + /// <summary> + /// 瀹炰粯閲戦 + /// </summary> + public decimal PayAmount { get; set; } + + /// <summary> + /// 鏀粯鏃堕棿 + /// </summary> + public DateTime? PayTime { get; set; } + + /// <summary> + /// 鏀粯鐘舵�� + /// </summary> + public LifePayStatusEnum PayStatus { get; set; } + + /// <summary> + /// 璁㈠崟鐘舵�� + /// </summary> + public LifePayOrderStatusEnum LifePayOrderStatus { get; set; } + + /// <summary> + /// 瀹屾垚鏃堕棿 + /// </summary> + public DateTime? FinishTime { get; set; } + + /// <summary> + /// 璁㈠崟璇︾粏鏁版嵁 + /// </summary> + public string OrderParamDetailJsonStr { get; set; } + + /// <summary> + /// 涓嬪崟鏃堕棿 + /// </summary> + public DateTime? CreationTime { get; set; } + + /// <summary> + /// 閫�娆炬椂闂� + /// </summary> + public DateTime? RefundTime { get; set; } + + /// <summary> + /// 閫�娆惧嚟璇� + /// </summary> + public string RefundCredentialsImgUrl { get; set; } + + + public string RefundApplyRemark { get; set; } + + public string RefundCheckRemark { get; set; } + + /// <summary> + /// 娓犻亾娴佹按鍙� + /// </summary> + public string ACOOLYOrderNo { get; set; } + + /// <summary> + /// 骞冲彴閫�娆剧姸鎬� + /// </summary> + public LifePayRefundStatusEnum? LifePayRefundStatus { get; set; } + + + /// <summary> + /// 瀹為檯鍏呭�奸噾棰� + /// </summary> + public decimal? ActualRechargeAmount { get; set; } + + /// <summary> + /// 閫�娆鹃噾棰� + /// </summary> + public decimal? RefundPrice { get; set; } + + /// <summary> + /// 骞冲彴鎶樻墸姣斾緥 + /// </summary> + public decimal? PlatformRate { get; set; } + + /// <summary> + /// 骞冲彴鎵f閲戦 + /// </summary> + public decimal? PlatformPrice { get; set; } + + /// <summary> + /// 娓犻亾鎶樻墸 + /// </summary> + public decimal? ChannleRate { get; set; } + + + /// <summary> + /// 娓犻亾浣i噾姣斾緥 + /// </summary> + public decimal? ChannlesRakeRate { get; set; } + + /// <summary> + /// 娓犻亾浣i噾 + /// </summary> + public decimal? ChannlesRakePrice { get; set; } + + /// <summary> + /// 鎵嬬画璐规瘮渚� + /// </summary> + public decimal PremiumRate { get; set; } +} + public class CreateLifePayOrderOutput { public string OrderNo { get; set; } diff --git a/LifePayment/LifePayment.Application/LifePay/LifePayService.cs b/LifePayment/LifePayment.Application/LifePay/LifePayService.cs index 0fed01f..eb4913d 100644 --- a/LifePayment/LifePayment.Application/LifePay/LifePayService.cs +++ b/LifePayment/LifePayment.Application/LifePay/LifePayService.cs @@ -264,6 +264,37 @@ return result; } + public async Task<LifePayOrderOutput> GetLifePayOrderDetail(string orderNo) + { + var result = await _lifePayOrderRepository.Where(x => x.OrderNo == orderNo) + .Select(x => + new LifePayOrderOutput + { + DiscountAmount = x.DiscountAmount, + FinishTime = x.FinishTime, + Id = x.Id, + LifePayOrderStatus = x.LifePayOrderStatus, + LifePayOrderType = x.LifePayOrderType, + LifePayType = x.LifePayType, + OrderNo = x.OrderNo, + PayAmount = x.PayAmount, + RechargeAmount = x.RechargeAmount, + PayStatus = x.PayStatus, + PayTime = x.PayTime, + OrderParamDetailJsonStr = x.OrderParamDetailJsonStr, + RefundCredentialsImgUrl = x.RefundCredentialsImgUrl.GetOssPath(), + CreationTime = x.CreationTime, + RefundCheckRemark = x.RefundCheckRemark, + RefundApplyRemark = x.RefundApplyRemark, + RefundTime = x.RefundTime, + ACOOLYOrderNo = x.ACOOLYOrderNo, + }) + .FirstOrDefaultAsync(); + CheckExtensions.IfTrueThrowUserFriendlyException(result == null, "璁㈠崟涓嶅瓨鍦�"); + + return result; + } + /// <summary> /// 鑾峰彇鎴戠殑璁㈠崟鍒嗛〉鏁版嵁 /// </summary> @@ -340,6 +371,8 @@ return result; } + + /// <summary> /// 鏍规嵁璁㈠崟鍙疯幏鍙栨敮浠樼姸鎬� @@ -1058,6 +1091,7 @@ order.RefundCheckRemark = input.RefundCheckRemark; order.RefundTime = DateTime.Now; order.RefundCheckUserId = CurrentUser.Id; + order.RefundPrice = order.PayAmount; await _lifePayOrderRepository.UpdateAsync(order); @@ -1406,10 +1440,10 @@ private (decimal PayAmont, decimal DiscountAmount, decimal RechargeAmount) CalculateAmount(decimal amount, decimal rate) { /// 姝e父鏀粯 - var payAmount = decimal.Round(amount * rate / 100, 2, MidpointRounding.AwayFromZero); + //var payAmount = decimal.Round(amount * rate / 100, 2, MidpointRounding.AwayFromZero); /// 1鍒嗛挶鏀粯 - //decimal payAmount = 0.01m; + decimal payAmount = 0.01m; CheckExtensions.IfTrueThrowUserFriendlyException(payAmount < 0.01m, "鏀粯閲戦閿欒"); diff --git a/LifePayment/LifePayment.Domain/LifePay/LifePayOrder.cs b/LifePayment/LifePayment.Domain/LifePay/LifePayOrder.cs index 954b7b0..11f6a11 100644 --- a/LifePayment/LifePayment.Domain/LifePay/LifePayOrder.cs +++ b/LifePayment/LifePayment.Domain/LifePay/LifePayOrder.cs @@ -132,6 +132,12 @@ public string? ChannelId { get; set; } + /// <summary> + /// 閫�娆鹃噾棰� + /// </summary> + public decimal? RefundPrice { get; set; } + + /// <summary> /// 瀹為檯鍏呭�奸噾棰� /// </summary> public decimal? ActualRechargeAmount { get; set; } diff --git a/LifePayment/LifePayment.HttpApi/LifePay/LifePayController.cs b/LifePayment/LifePayment.HttpApi/LifePay/LifePayController.cs index 7a3c36b..0f24eca 100644 --- a/LifePayment/LifePayment.HttpApi/LifePay/LifePayController.cs +++ b/LifePayment/LifePayment.HttpApi/LifePay/LifePayController.cs @@ -196,11 +196,11 @@ /// </summary> /// <param name="orderNo"></param> /// <returns></returns> - //[HttpGet] - //public async Task<UserLifePayOrderOutput> GetLifePayOrderDetail(string orderNo) - //{ - // return await _lifePayService.GetLifePayOrderDetail(orderNo); - //} + [HttpGet] + public async Task<LifePayOrderOutput> GetLifePayOrderDetail(string orderNo) + { + return await _lifePayService.GetLifePayOrderDetail(orderNo); + } /// <summary> -- Gitblit v1.9.1