From 083ef091d15d227c8112b9b24819b2744c949a75 Mon Sep 17 00:00:00 2001 From: zhengyiming <540361168@qq.com> Date: 星期三, 26 三月 2025 14:37:41 +0800 Subject: [PATCH] fix: bug --- LifePayment/LifePayment.Application/LifePay/LifePayService.cs | 196 ++++++++++++++++++++++++++++++------------------ 1 files changed, 123 insertions(+), 73 deletions(-) diff --git a/LifePayment/LifePayment.Application/LifePay/LifePayService.cs b/LifePayment/LifePayment.Application/LifePay/LifePayService.cs index 7987669..a05844f 100644 --- a/LifePayment/LifePayment.Application/LifePay/LifePayService.cs +++ b/LifePayment/LifePayment.Application/LifePay/LifePayService.cs @@ -27,6 +27,7 @@ using Volo.Abp.ObjectMapping; using NPOI.SS.Formula.Functions; using StackExchange.Redis; +using static Volo.Abp.Identity.Settings.IdentitySettingNames; namespace LifePayment.Application; @@ -157,7 +158,7 @@ /// <returns></returns> public async Task<ChannelRateOutput> GetChannelRate(ChannelsBaseInput input) { - return _lifePayChannlesRep.Where(x => x.IsDeleted == false && x.ChannlesNum == input.CheckChannelId).Select(x => new ChannelRateOutput() { ChannlesRate = x.ChannlesRate }) + return _lifePayChannlesRep.Where(x => x.IsDeleted == false && x.ChannlesNum == input.CheckChannelId).Select(x => new ChannelRateOutput() { ChannlesRate = x.ChannlesRate }) .FirstOrDefault(); } @@ -246,6 +247,7 @@ { var channles = await _lifePayChannlesRep.Where(x => x.ChannlesName.Contains(input.KeyWords)).Select(x => x.ChannlesNum).ToListAsync(); var result = await (from a in _channelFilter.GetChannelLifePayOrderFilter(_lifePayOrderRepository) + .Where(x => x.PayStatus != LifePayStatusEnum.鏈敮浠�) .WhereIf(input.BeginFinishTime.HasValue, x => x.FinishTime >= input.BeginFinishTime) .WhereIf(input.EndFinishTime.HasValue, x => x.FinishTime <= input.EndFinishTime) .WhereIf(input.BeginPayTime.HasValue, x => x.PayTime >= input.BeginPayTime) @@ -283,7 +285,7 @@ RefundApplyRemark = a.RefundApplyRemark, RefundTime = a.RefundTime, ChannelName = b.ChannlesName, - ActualRechargeAmount = a.ActualRechargeAmount, + ActualRechargeAmount = a.RechargeAmount, PlatformDeductionAmount = a.PlatformDeductionAmount, ACOOLYStatus = a.ACOOLYStatus, LifePayRefundStatus = a.LifePayRefundStatus, @@ -302,7 +304,7 @@ var result = await (from a in _channelFilter.GetChannelLifePayOrderFilter(_lifePayOrderRepository) .Where(x => x.LifePayOrderStatus == LifePayOrderStatusEnum.寰呴��娆� || x.LifePayOrderStatus == LifePayOrderStatusEnum.宸查��娆� || x.LifePayOrderStatus == LifePayOrderStatusEnum.閫�娆句腑 - || x.LifePayRefundStatus > LifePayRefundStatusEnum.鏃犻渶閫�娆�) + || (x.LifePayRefundStatus > LifePayRefundStatusEnum.鏃犻渶閫�娆� && x.LifePayRefundStatus != LifePayRefundStatusEnum.閫�娆鹃┏鍥�)) .WhereIf(input.BeginRefundTime.HasValue, x => x.RefundTime >= input.BeginRefundTime) .WhereIf(input.EndRefundTime.HasValue, x => x.RefundTime <= input.EndRefundTime) .WhereIf(input.BeginRefundApplyTime.HasValue, x => x.RefundApplyTime >= input.BeginRefundApplyTime) @@ -337,10 +339,11 @@ RefundCheckRemark = a.RefundCheckRemark, RefundApplyRemark = a.RefundApplyRemark, RefundApplyTime = a.RefundApplyTime, + RefundOrderNo = a.RefundOrderNo, RefundTime = a.RefundTime, RefundPrice = a.RefundPrice, ChannelName = b.ChannlesName, - ActualRechargeAmount = a.ActualRechargeAmount, + ActualRechargeAmount = a.RechargeAmount, PlatformDeductionAmount = a.PlatformDeductionAmount, ACOOLYStatus = a.ACOOLYStatus, LifePayRefundStatus = a.LifePayRefundStatus, @@ -365,6 +368,7 @@ PayAmount = x.PayAmount, PhoneNumber = x.PhoneNumber, RefundOrderNo = x.RefundOrderNo, + RefundApplyTime = x.RefundApplyTime, ChannelName = x.ChannelName, CreationTime = x.CreationTime, ACOOLYStatus = x.ACOOLYStatus, @@ -380,13 +384,13 @@ s.SerialNumber = ++i; s.ACOOLYStatusStr = s.ACOOLYStatus.GetDescription(); s.LifePayOrderTypeStr = s.LifePayOrderType.GetDescription(); - s.CreationTimeStr = s.CreationTime.ToString(LifePaymentConstant.DateTimeFormatStr.yyyyMMddHHmm); s.RechargeAmountStr = s.RechargeAmount.ToString("F2"); s.ActualReceivedAmount = s.ActualReceivedAmount; - s.LifePayRefundStatusStr = s.LifePayRefundStatus.GetDescription(); + s.LifePayRefundStatusStr = s.LifePayRefundStatus == LifePayRefundStatusEnum.鏃犻渶閫�娆� ? "" : s.LifePayRefundStatus.GetDescription(); s.PayAmountStr = s.PayAmount.ToString("F2"); s.LifePayTypeStr = s.LifePayType.GetDescription(); s.FinishTimeStr = !s.FinishTime.HasValue ? string.Empty : s.FinishTime.Value.ToString(LifePaymentConstant.DateTimeFormatStr.yyyyMMddHHmm); + s.RefundApplyTimeStr = !s.RefundApplyTime.HasValue ? string.Empty : s.RefundApplyTime.Value.ToString(LifePaymentConstant.DateTimeFormatStr.yyyyMMddHHmm); }); return result; } @@ -396,14 +400,14 @@ { var order = await _lifePayOrderRepository.Where(x => x.OrderNo == orderNo).FirstOrDefaultAsync(); var channle = await _lifePayChannlesRep.FirstOrDefaultAsync(r => r.ChannlesNum == order.ChannelId); - CheckExtensions.IfTrueThrowUserFriendlyException(order == null, "璁㈠崟涓嶅瓨鍦�"); + CheckExtensions.IfTrueThrowUserFriendlyException(order == null, "璁㈠崟涓嶅瓨鍦�"); var user = await _lifePayUserRepository.FirstOrDefaultAsync(x => x.Id == order.UserId); var channlesRakePrice = (order.PayAmount - (order.PlatformDeductionAmount == null ? 0 : order.PlatformDeductionAmount)) * channle.ChannlesRakeRate / 100; - var orderpirce = await GetOrderPrice(order.RechargeAmount, order.PayAmount,order.PlatformRate, order.ChannleRate, order.ChannlesRakeRate,order.PremiumRate); + var orderpirce = await GetOrderPrice(order.RechargeAmount, order.PayAmount, order.PlatformRate, order.ChannleRate, order.ChannlesRakeRate, order.PremiumRate); var result = new LifePayOrderOutput() - { + { UserName = user.Name, UserPhoneNumber = user.PhoneNumber, DiscountAmount = order.DiscountAmount, @@ -427,7 +431,7 @@ RefundTime = order.RefundTime, ACOOLYOrderNo = order.ACOOLYOrderNo, LifePayRefundStatus = order.LifePayRefundStatus, - ActualRechargeAmount = order.ActualRechargeAmount, + ActualRechargeAmount = order.RechargeAmount, RefundPrice = order.RefundPrice, PlatformRate = order.PlatformRate, PlatformPrice = order.PlatformDeductionAmount, @@ -438,7 +442,8 @@ ChannlesRakePrice = orderpirce.ChannlesRakePrice, PremiumRate = order.PremiumRate, PremiumPrice = orderpirce.PremiumPrice, - Profit = orderpirce.Profit + Profit = orderpirce.Profit, + RefundOrderNo = order.RefundOrderNo, }; return result; @@ -725,12 +730,12 @@ { DiscountAmount = x.DiscountAmount, FinishTime = x.FinishTime, - //LifePayOrderStatus = x.LifePayOrderStatus, + LifePayOrderStatus = x.LifePayOrderStatus, LifePayOrderType = x.LifePayOrderType, LifePayType = x.LifePayType, OrderNo = x.OrderNo, PayAmount = x.PayAmount, - ActualRechargeAmount = x.ActualRechargeAmount.HasValue?x.ActualRechargeAmount.Value:0, + ActualRechargeAmount = x.RechargeAmount, PhoneNumber = x.PhoneNumber, RechargeAmount = x.RechargeAmount, OutOrderNo = x.OutOrderNo, @@ -742,7 +747,7 @@ ACOOLYStatus = x.ACOOLYStatus, //RefundApplyRemark = x.RefundApplyRemark, ChannelName = x.ChannelName, - PlatformPrice = x.PlatformDeductionAmount.HasValue ? x.PlatformDeductionAmount.Value : 0 + PlatformPrice = x.PlatformDeductionAmount.HasValue ? x.PlatformDeductionAmount.Value : 0.00m }).OrderByDescending(r => r.CreationTime).ToListAsync(); var i = 0; result.ForEach(s => @@ -756,9 +761,9 @@ s.LifePayTypeStr = s.LifePayType.GetDescription(); s.PayStatusStr = s.PayStatus.GetDescription(); s.ActualRechargeAmountStr = s.ActualRechargeAmount.ToString("F2"); - s.LifePayRefundStatusStr = s.LifePayRefundStatusStr.GetDescription(); + s.LifePayRefundStatusStr = s.LifePayRefundStatus == LifePayRefundStatusEnum.鏃犻渶閫�娆� ? "" : s.LifePayRefundStatus.GetDescription(); s.ACOOLYStatusStr = s.ACOOLYStatus.GetDescription(); - //s.LifePayOrderStatusStr = s.LifePayOrderStatus.GetDescription(); + s.LifePayOrderStatusStr = s.LifePayOrderStatus.GetDescription(); s.FinishTimeStr = !s.FinishTime.HasValue ? string.Empty : s.FinishTime.Value.ToString(LifePaymentConstant.DateTimeFormatStr.yyyyMMddHHmmss); }); return result; @@ -831,15 +836,15 @@ var channle = await GetLifePayChannlesDtoByNum(input.ChannelId); CheckExtensions.IfTrueThrowUserFriendlyException(channle == null, "娓犻亾涓嶅瓨鍦�"); - var rate = await GetRate(); - CheckExtensions.IfTrueThrowUserFriendlyException(rate.IsNullOrEmpty(), "鏈厤缃姌鎵�"); + //var rate = await GetRate(); + //CheckExtensions.IfTrueThrowUserFriendlyException(rate.IsNullOrEmpty(), "鏈厤缃姌鎵�"); - //var rate = await GetLifePayRate(); + var rate = await GetLifePayRate(channle, LifePayRateTypeEnum.榛樿璇濊垂鎶樻墸); - var amount = CalculateAmount(input.ProductData.ParValue, rate.FirstOrDefault(x => x.RateType == LifePayRateTypeEnum.榛樿璇濊垂鎶樻墸).Rate); + var amount = CalculateAmount(input.ProductData.ParValue, rate); var platformRate = await _lifePayRateRepository.FirstOrDefaultAsync(r => r.RateType == LifePayRateTypeEnum.渚涘簲鍟嗘姌鎵d环); - + var orderInput = new CreateLifePayOrderInput { @@ -857,7 +862,7 @@ ChannelId = channle.ChannlesNum, PlatformRate = platformRate.Rate, PlatformDeductionAmount = amount.RechargeAmount * platformRate.Rate /100, - ChannleRate = channle.ChannlesRate, + ChannleRate = rate, ChannlesRakeRate = channle.ChannlesRakeRate, //ChannlesRakePrice = amount.RechargeAmount * (channle.ChannlesRate - platformRate.Rate) / 100 * channle.ChannlesRakeRate / 100 }; @@ -885,10 +890,13 @@ CheckExtensions.IfTrueThrowUserFriendlyException(channle == null, "娓犻亾涓嶅瓨鍦�"); CheckExtensions.IfTrueThrowUserFriendlyException(channle.Status == LifePayChannelsStatsEnum.绂佺敤, "娓犻亾宸茶绂佺敤"); - var rate = await GetRate(); - CheckExtensions.IfTrueThrowUserFriendlyException(rate.IsNullOrEmpty(), "鏈厤缃姌鎵�"); + //var rate = await GetRate(); + //CheckExtensions.IfTrueThrowUserFriendlyException(rate.IsNullOrEmpty(), "鏈厤缃姌鎵�"); - var amount = CalculateAmount(input.ProductData.ParValue, rate.FirstOrDefault(x => x.RateType == LifePayRateTypeEnum.榛樿鐢佃垂鎶樻墸).Rate); + + var rate = await GetLifePayRate(channle, LifePayRateTypeEnum.榛樿鐢佃垂鎶樻墸); + + var amount = CalculateAmount(input.ProductData.ParValue, rate); var platformRate = await _lifePayRateRepository.FirstOrDefaultAsync(r => r.RateType == LifePayRateTypeEnum.渚涘簲鍟嗘姌鎵d环); @@ -907,7 +915,7 @@ RechargeAmount = amount.RechargeAmount, ChannelId = channle.ChannlesNum, PlatformRate = platformRate.Rate, - ChannleRate = channle.ChannlesRate, + ChannleRate = rate, ChannlesRakeRate = channle.ChannlesRakeRate, }; @@ -934,10 +942,13 @@ CheckExtensions.IfTrueThrowUserFriendlyException(channle == null, "娓犻亾涓嶅瓨鍦�"); CheckExtensions.IfTrueThrowUserFriendlyException(channle.Status == LifePayChannelsStatsEnum.绂佺敤, "娓犻亾宸茶绂佺敤"); - var rate = await GetRate(); - CheckExtensions.IfTrueThrowUserFriendlyException(rate.IsNullOrEmpty(), "鏈厤缃姌鎵�"); + //var rate = await GetRate(); + //CheckExtensions.IfTrueThrowUserFriendlyException(rate.IsNullOrEmpty(), "鏈厤缃姌鎵�"); - var amount = CalculateAmount(input.ProductData.ParValue, rate.FirstOrDefault(x => x.RateType == LifePayRateTypeEnum.榛樿鐕冩皵鎶樻墸).Rate); + + var rate = await GetLifePayRate(channle, LifePayRateTypeEnum.榛樿鐕冩皵鎶樻墸); + + var amount = CalculateAmount(input.ProductData.ParValue, rate); var platformRate = await _lifePayRateRepository.FirstOrDefaultAsync(r => r.RateType == LifePayRateTypeEnum.渚涘簲鍟嗘姌鎵d环); @@ -954,7 +965,10 @@ PayAmount = amount.PayAmont, DiscountAmount = amount.DiscountAmount, RechargeAmount = amount.RechargeAmount, - ChannelId = channle.ChannlesNum + ChannelId = channle.ChannlesNum, + PlatformRate = platformRate.Rate, + ChannleRate = rate, + ChannlesRakeRate = channle.ChannlesRakeRate, }; await CreateLifePayOrder(orderInput); @@ -1011,7 +1025,7 @@ } /// <summary> - /// 璁剧疆鐢熸椿缂磋垂鏀粯绫诲瀷 + /// 鑾峰彇寰俊鏀粯鐨凧SAPI /// </summary> /// <param name="input"></param> /// <returns></returns> @@ -1023,6 +1037,8 @@ CheckExtensions.IfTrueThrowUserFriendlyException(order.LifePayType.HasValue, "褰撳墠璁㈠崟宸查�夋嫨鏀粯绫诲瀷"); order.LifePayType = input.LifePayType; + var premium = await _lifePayPremiumRepository.Where(x => x.IsDeleted == false && x.PremiumType == order.LifePayType).FirstOrDefaultAsync(); + order.PremiumRate = premium == null ? 0 : premium.Rate; await _lifePayOrderRepository.UpdateAsync(order); var desc = "鐢熸椿缂磋垂-"; @@ -1052,6 +1068,25 @@ //var payUrl = await GetPayQRCode(order.LifePayType.Value, order.OrderNo, desc, 0.01m, ip, input.H5Type); //var payUrl = await GetPayQRCode(order.LifePayType.Value, order.OrderNo, desc, order.PayAmount, ip, input.H5Type); + } + + /// <summary> + /// 淇敼瀹為檯鍒拌处閲戦 + /// </summary> + /// <param name="input"></param> + /// <returns></returns> + public async Task<int> UpdateLifePayOrderActualReceivedAmount(UpdateLifePayOrderInput input) + { + var order = await _lifePayOrderRepository.Where(x => x.Id == input.Id).FirstOrDefaultAsync(); + + CheckExtensions.IfTrueThrowUserFriendlyException(order == null, "璁㈠崟涓嶅瓨鍦�"); + CheckExtensions.IfTrueThrowUserFriendlyException(order.ACOOLYStatus != ACOOLYStatusEnum.閮ㄥ垎鍏呭�兼垚鍔�, "璇ヨ鍗曟棤娉曚慨鏀瑰埌璐﹂噾棰�"); + + order.ActualReceivedAmount = input.ActualReceivedAmount; + + await _lifePayOrderRepository.UpdateAsync(order); + + return Constant.SUCCESS; } /// <summary> @@ -1090,7 +1125,7 @@ #endif CheckExtensions.IfTrueThrowUserFriendlyException(!result.Success || (result.Code != ACOOLYConstant.Code.SUCCESS && result.Code != ACOOLYConstant.Code.PROCESSING), - "璋冪敤ACOOLY鎺ュ彛ConfirmElectricOrder杩斿洖閿欒:" + JsonConvert.SerializeObject(result)); + result.Message); return (result.Code, requestInput.RequestNo, result.PhoneChargeOrder.BusiOrderNo); } @@ -1121,7 +1156,7 @@ #endif CheckExtensions.IfTrueThrowUserFriendlyException(!result.Success || (result.Code != ACOOLYConstant.Code.SUCCESS && result.Code != ACOOLYConstant.Code.PROCESSING), - "璋冪敤ACOOLY鎺ュ彛ConfirmElectricOrder杩斿洖閿欒:" + JsonConvert.SerializeObject(result)); + result.Message); return (result.Code, requestInput.RequestNo, result.ElectricChargeOrder.BusiOrderNo); } @@ -1149,7 +1184,7 @@ #endif CheckExtensions.IfTrueThrowUserFriendlyException(!result.Success || (result.Code != ACOOLYConstant.Code.SUCCESS && result.Code != ACOOLYConstant.Code.PROCESSING), - "璋冪敤ACOOLY鎺ュ彛ConfirmElectricOrder杩斿洖閿欒:" + JsonConvert.SerializeObject(result)); + result.Message); return (result.Code, requestInput.RequestNo, result.GasChargeOrder.BusiOrderNo); } @@ -1267,6 +1302,7 @@ _logger.LogError(ex, "澶勭悊鐢熸椿缂磋垂鏀粯鎴愬姛鍥炶皟鏃跺紓甯�"); order.LifePayOrderStatus = LifePayOrderStatusEnum.寰呴��娆�; order.LifePayRefundStatus = LifePayRefundStatusEnum.寰呴��娆�; + order.RefundApplyRemark = ex.Message; } _logger.LogError("鐢熸椿缂磋垂璁㈠崟鐘舵�侊細" + order.LifePayOrderStatus.ToString()); await _lifePayOrderRepository.UpdateAsync(order); @@ -1310,6 +1346,11 @@ if (acoolyOrderNo.IsNotNullOrEmpty()) { order.ACOOLYOrderNo = acoolyOrderNo; + } + + if (status == LifePayOrderStatusEnum.寰呴��娆�) + { + order.LifePayRefundStatus = LifePayRefundStatusEnum.寰呴��娆�; } if (refundApplyRemark.IsNotNullOrEmpty()) @@ -1383,10 +1424,10 @@ break; case LifePayTypeEnum.AliPay: - var aliRefundResult = await AliTradeRefund(new AlipayTradeRefundRequest() { OutTradeNo = order.OrderNo, RefundAmount = Convert.ToInt32(input.RefundPrice * 100).ToString() }); + var aliRefundResult = await AliTradeRefund(new AlipayTradeRefundRequest() { OutTradeNo = order.OrderNo, RefundAmount = input.RefundPrice.ToString() }); if (aliRefundResult.Code != AlipayResultCode.Success) { - throw new UserFriendlyException("閫�娆惧け璐�"); + throw new UserFriendlyException("閫�娆惧け璐�:" + aliRefundResult.SubMsg); } order.LifePayOrderStatus = LifePayOrderStatusEnum.宸查��娆�; @@ -1760,10 +1801,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, "鏀粯閲戦閿欒"); @@ -1968,42 +2009,53 @@ private async Task<IQueryable<LifePayOrderListOutput>> GetLifePayOrderListFilter(QueryLifePayOrderListInput input) { - var result = (from a in _lifePayOrderRepository.Where(x => x.PayStatus != LifePayStatusEnum.鏈敮浠�) - .WhereIf(input.BeginFinishTime.HasValue, x => x.FinishTime >= input.BeginFinishTime) + var channles = await _lifePayChannlesRep.Where(x => x.ChannlesName.Contains(input.KeyWords)).Select(x => x.ChannlesNum).ToListAsync(); + var result = (from a in _channelFilter.GetChannelLifePayOrderFilter(_lifePayOrderRepository) + .Where(x => x.PayStatus != LifePayStatusEnum.鏈敮浠�) + .WhereIf(input.BeginFinishTime.HasValue, x => x.FinishTime >= input.BeginFinishTime) .WhereIf(input.EndFinishTime.HasValue, x => x.FinishTime <= input.EndFinishTime) .WhereIf(input.BeginPayTime.HasValue, x => x.PayTime >= input.BeginPayTime) + .WhereIf(input.LifePayType.HasValue, x => x.LifePayType == input.LifePayType) .WhereIf(input.EndPayTime.HasValue, x => x.PayTime <= input.EndPayTime) .WhereIf(input.LifePayOrderStatus.HasValue, x => x.LifePayOrderStatus == input.LifePayOrderStatus.Value) .WhereIf(input.PayStatus.HasValue, x => x.PayStatus == input.PayStatus.Value) + .WhereIf(input.ACOOLYStatus.HasValue, x => x.ACOOLYStatus == input.ACOOLYStatus.Value) .WhereIf(input.LifePayOrderType.HasValue, x => x.LifePayOrderType == input.LifePayOrderType.Value) .WhereIf(input.UserId.HasValue, x => x.UserId == input.UserId.Value) - .WhereIf(input.KeyWords.IsNotNullOrEmpty(), x => x.PhoneNumber.Contains(input.KeyWords) || x.OrderNo.Contains(input.KeyWords) || x.OutOrderNo.Contains(input.KeyWords) || x.ACOOLYOrderNo.Contains(input.KeyWords)) - join b in _lifePayChannlesRep on a.ChannelId equals b.ChannlesNum into temp - from b in temp.DefaultIfEmpty() - select new LifePayOrderListOutput - { - DiscountAmount = a.DiscountAmount, - FinishTime = a.FinishTime, - Id = a.Id, - LifePayOrderStatus = a.LifePayOrderStatus, - LifePayOrderType = a.LifePayOrderType, - LifePayType = a.LifePayType, - OrderNo = a.OrderNo, - PayAmount = a.PayAmount, - PhoneNumber = a.PhoneNumber, - RechargeAmount = a.RechargeAmount, - UserId = a.UserId, - OutOrderNo = a.OutOrderNo, - PayStatus = a.PayStatus, - PayTime = a.PayTime, - ACOOLYOrderNo = a.ACOOLYOrderNo, - RefundCredentialsImgUrl = a.RefundCredentialsImgUrl.GetOssPath(), - CreationTime = a.CreationTime, - RefundCheckRemark = a.RefundCheckRemark, - RefundApplyRemark = a.RefundApplyRemark, - RefundTime = a.RefundTime, - ChannelName = b.ChannlesName - }); + .WhereIf(input.KeyWords.IsNotNullOrEmpty(), x => x.OrderNo.Contains(input.KeyWords) || x.OutOrderNo.Contains(input.KeyWords) || x.ACOOLYOrderNo.Contains(input.KeyWords) || channles.Contains(x.ChannelId)) + join b in _lifePayChannlesRep on a.ChannelId equals b.ChannlesNum into temp + from b in temp.DefaultIfEmpty() + select new LifePayOrderListOutput + { + DiscountAmount = a.DiscountAmount, + FinishTime = a.FinishTime, + Id = a.Id, + LifePayOrderStatus = a.LifePayOrderStatus, + LifePayOrderType = a.LifePayOrderType, + LifePayType = a.LifePayType, + OrderNo = a.OrderNo, + PayAmount = a.PayAmount, + PhoneNumber = a.PhoneNumber, + RechargeAmount = a.RechargeAmount, + UserId = a.UserId, + OutOrderNo = a.OutOrderNo, + PayStatus = a.PayStatus, + PayTime = a.PayTime, + ACOOLYOrderNo = a.ACOOLYOrderNo, + RefundCredentialsImgUrl = a.RefundCredentialsImgUrl.GetOssPath(), + RefundPrice = a.RefundPrice, + CreationTime = a.CreationTime, + RefundCheckRemark = a.RefundCheckRemark, + RefundApplyRemark = a.RefundApplyRemark, + RefundTime = a.RefundTime, + ChannelName = b.ChannlesName, + ActualRechargeAmount = a.ActualRechargeAmount, + PlatformDeductionAmount = a.PlatformDeductionAmount, + ACOOLYStatus = a.ACOOLYStatus, + LifePayRefundStatus = a.LifePayRefundStatus, + }); + + return result; } @@ -2011,7 +2063,7 @@ { var result = (from a in _channelFilter.GetChannelLifePayOrderFilter(_lifePayOrderRepository) .Where(x => x.LifePayOrderStatus == LifePayOrderStatusEnum.寰呴��娆� || x.LifePayOrderStatus == LifePayOrderStatusEnum.宸查��娆� || x.LifePayOrderStatus == LifePayOrderStatusEnum.閫�娆句腑 - || x.LifePayRefundStatus > LifePayRefundStatusEnum.鏃犻渶閫�娆�) + || (x.LifePayRefundStatus > LifePayRefundStatusEnum.鏃犻渶閫�娆� && x.LifePayRefundStatus != LifePayRefundStatusEnum.閫�娆鹃┏鍥�)) .WhereIf(input.BeginRefundTime.HasValue, x => x.RefundTime >= input.BeginRefundTime) .WhereIf(input.EndRefundTime.HasValue, x => x.RefundTime <= input.EndRefundTime) .WhereIf(input.BeginRefundApplyTime.HasValue, x => x.RefundApplyTime >= input.BeginRefundApplyTime) @@ -2047,6 +2099,7 @@ RefundApplyRemark = a.RefundApplyRemark, RefundApplyTime = a.RefundApplyTime, RefundTime = a.RefundTime, + RefundOrderNo = a.RefundOrderNo, RefundPrice = a.RefundPrice, ChannelName = b.ChannlesName, ActualRechargeAmount = a.ActualRechargeAmount, @@ -2100,9 +2153,9 @@ }; } - public async Task<decimal> GetLifePayRate(string channelId, LifePayRateTypeEnum lifePayRateType) + public async Task<decimal> GetLifePayRate(CreateEditPayChannelsInput channel, LifePayRateTypeEnum lifePayRateType) { - if (string.IsNullOrEmpty(channelId)) + if (channel == null) { var rate = await GetRate(); CheckExtensions.IfTrueThrowUserFriendlyException(rate.IsNullOrEmpty(), "鏈厤缃姌鎵�"); @@ -2111,9 +2164,6 @@ } else { - var channel = await _lifePayChannlesRep.Where(x => x.ChannlesNum == channelId).FirstOrDefaultAsync(); - - CheckExtensions.IfTrueThrowUserFriendlyException(channel == null, "鏈壘鍒板搴旀笭閬�"); return channel.ChannlesRate; } } -- Gitblit v1.9.1