From 49e9beea54b7ada9ab5d09e6f9cd93a489d87e23 Mon Sep 17 00:00:00 2001 From: zhengyuxuan <zhengyuxuan1995> Date: 星期四, 20 三月 2025 13:50:21 +0800 Subject: [PATCH] fix:上传 --- LifePayment/LifePayment.Application/LifePay/LifePayService.cs | 58 ++++++++++++++++++++++++++++++++++++++++++++++++++++------ 1 files changed, 52 insertions(+), 6 deletions(-) diff --git a/LifePayment/LifePayment.Application/LifePay/LifePayService.cs b/LifePayment/LifePayment.Application/LifePay/LifePayService.cs index 00e2476..0a8d5cf 100644 --- a/LifePayment/LifePayment.Application/LifePay/LifePayService.cs +++ b/LifePayment/LifePayment.Application/LifePay/LifePayService.cs @@ -21,6 +21,8 @@ using ZeroD.Util; using Alipay.EasySDK.Payment.Common.Models; using static LifePayment.Domain.Shared.LifePaymentConstant; +using ZeroD.Util.Fadd; +using Nest; namespace LifePayment.Application; @@ -257,8 +259,49 @@ ChannelName = b.ChannlesName, ActualRechargeAmount = a.ActualRechargeAmount, PlatformDeductionAmount = a.PlatformDeductionAmount, - ACOOLYStatus = a.ACOOLYStatus + ACOOLYStatus = a.ACOOLYStatus, + LifePayRefundStatus = a.LifePayRefundStatus, }).GetPageResult(input.PageModel); + + return result; + } + + public async Task<LifePayOrderOutput> GetLifePayOrderDetail(string orderNo) + { + var order = await _lifePayOrderRepository.Where(x => x.OrderNo == orderNo).FirstOrDefaultAsync(); + var platformRate = await _lifePayRateRepository.FirstOrDefaultAsync(r => r.RateType == LifePayRateTypeEnum.渚涘簲鍟嗘姌鎵d环); + var channleRate = await _lifePayChannlesRep.FirstOrDefaultAsync(r => r.ChannlesNum == order.ChannelId); + CheckExtensions.IfTrueThrowUserFriendlyException(order == null, "璁㈠崟涓嶅瓨鍦�"); + var result = new LifePayOrderOutput() + { + DiscountAmount = order.DiscountAmount, + FinishTime = order.FinishTime, + Id = order.Id, + LifePayOrderStatus = order.LifePayOrderStatus, + LifePayOrderType = order.LifePayOrderType, + LifePayType = order.LifePayType, + OrderNo = order.OrderNo, + PayAmount = order.PayAmount, + RechargeAmount = order.RechargeAmount, + PayStatus = order.PayStatus, + PayTime = order.PayTime, + OrderParamDetailJsonStr = order.OrderParamDetailJsonStr, + RefundCredentialsImgUrl = order.RefundCredentialsImgUrl.GetOssPath(), + CreationTime = order.CreationTime, + RefundCheckRemark = order.RefundCheckRemark, + RefundApplyRemark = order.RefundApplyRemark, + RefundTime = order.RefundTime, + ACOOLYOrderNo = order.ACOOLYOrderNo, + LifePayRefundStatus = order.LifePayRefundStatus, + ActualRechargeAmount = order.ActualRechargeAmount, + RefundPrice = order.RefundPrice, + PlatformRate = platformRate.Rate, + PlatformPrice = order.PlatformDeductionAmount, + ChannleRate = channleRate.ChannlesRate, + ChannlesRakeRate = channleRate.ChannlesRakeRate, + ChannlesRakePrice = (order.PayAmount - order.PlatformDeductionAmount) * channleRate.ChannlesRakeRate, + //PremiumRate = + }; return result; } @@ -339,6 +382,8 @@ return result; } + + /// <summary> /// 鏍规嵁璁㈠崟鍙疯幏鍙栨敮浠樼姸鎬� @@ -552,7 +597,7 @@ var orderInput = new CreateLifePayOrderInput { - OrderNo = CreateOrderNo(), + OrderNo = channle.ChannlesNum + CreateOrderNo(), LifePayOrderStatus = LifePayOrderStatusEnum.寰呯‘璁�, LifePayOrderType = LifePayOrderTypeEnum.璇濊垂璁㈠崟, //LifePayType = input.LifePayType, @@ -596,7 +641,7 @@ var orderInput = new CreateLifePayOrderInput { - OrderNo = CreateOrderNo(), + OrderNo = channle.ChannlesNum + CreateOrderNo(), LifePayOrderStatus = LifePayOrderStatusEnum.寰呯‘璁�, LifePayOrderType = LifePayOrderTypeEnum.鐢佃垂璁㈠崟, // LifePayType = input.LifePayType, @@ -640,7 +685,7 @@ var orderInput = new CreateLifePayOrderInput { - OrderNo = CreateOrderNo(), + OrderNo = channle.ChannlesNum + CreateOrderNo(), LifePayOrderStatus = LifePayOrderStatusEnum.寰呯‘璁�, LifePayOrderType = LifePayOrderTypeEnum.鐕冩皵璁㈠崟, // LifePayType = input.LifePayType, @@ -1057,6 +1102,7 @@ order.RefundCheckRemark = input.RefundCheckRemark; order.RefundTime = DateTime.Now; order.RefundCheckUserId = CurrentUser.Id; + order.RefundPrice = order.PayAmount; await _lifePayOrderRepository.UpdateAsync(order); @@ -1405,10 +1451,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, "鏀粯閲戦閿欒"); -- Gitblit v1.9.1