| | |
| | | using ZeroD.Util; |
| | | using Alipay.EasySDK.Payment.Common.Models; |
| | | using static LifePayment.Domain.Shared.LifePaymentConstant; |
| | | using ZeroD.Util.Fadd; |
| | | using Nest; |
| | | |
| | | namespace LifePayment.Application; |
| | | |
| | |
| | | |
| | | public async Task<LifePayOrderOutput> GetLifePayOrderDetail(string orderNo) |
| | | { |
| | | var result = await _lifePayOrderRepository.Where(x => x.OrderNo == orderNo) |
| | | .Select(x => |
| | | new LifePayOrderOutput |
| | | var order = await _lifePayOrderRepository.Where(x => x.OrderNo == orderNo).FirstOrDefaultAsync(); |
| | | var platformRate = await _lifePayRateRepository.FirstOrDefaultAsync(r => r.RateType == LifePayRateTypeEnum.供应商折扣价); |
| | | var channleRate = await _lifePayChannlesRep.FirstOrDefaultAsync(r => r.ChannlesNum == order.ChannelId); |
| | | CheckExtensions.IfTrueThrowUserFriendlyException(order == null, "订单不存在"); |
| | | var result = 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, "订单不存在"); |
| | | 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; |
| | | } |