| | |
| | | RefundApplyRemark = a.RefundApplyRemark, |
| | | RefundTime = a.RefundTime, |
| | | ChannelName = b.ChannlesName, |
| | | ActualRechargeAmount = a.ActualRechargeAmount, |
| | | ActualRechargeAmount = a.RechargeAmount, |
| | | PlatformDeductionAmount = a.PlatformDeductionAmount, |
| | | ACOOLYStatus = a.ACOOLYStatus, |
| | | LifePayRefundStatus = a.LifePayRefundStatus, |
| | |
| | | |
| | | 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) |
| | |
| | | RefundTime = a.RefundTime, |
| | | RefundPrice = a.RefundPrice, |
| | | ChannelName = b.ChannlesName, |
| | | ActualRechargeAmount = a.ActualRechargeAmount, |
| | | ActualRechargeAmount = a.RechargeAmount, |
| | | PlatformDeductionAmount = a.PlatformDeductionAmount, |
| | | ACOOLYStatus = a.ACOOLYStatus, |
| | | LifePayRefundStatus = a.LifePayRefundStatus, |
| | |
| | | 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(); |
| | |
| | | RefundTime = order.RefundTime, |
| | | ACOOLYOrderNo = order.ACOOLYOrderNo, |
| | | LifePayRefundStatus = order.LifePayRefundStatus, |
| | | ActualRechargeAmount = order.ActualRechargeAmount, |
| | | ActualRechargeAmount = order.RechargeAmount, |
| | | RefundPrice = order.RefundPrice, |
| | | PlatformRate = order.PlatformRate, |
| | | PlatformPrice = order.PlatformDeductionAmount, |
| | |
| | | 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 => |
| | |
| | | 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.GetDescription(); |
| | | s.ACOOLYStatusStr = s.ACOOLYStatus.GetDescription(); |
| | | //s.LifePayOrderStatusStr = s.LifePayOrderStatus.GetDescription(); |
| | | s.FinishTimeStr = !s.FinishTime.HasValue ? string.Empty : s.FinishTime.Value.ToString(LifePaymentConstant.DateTimeFormatStr.yyyyMMddHHmmss); |
| | |
| | | order.ACOOLYOrderNo = acoolyOrderNo; |
| | | } |
| | | |
| | | if (status == LifePayOrderStatusEnum.待退款) |
| | | { |
| | | order.LifePayRefundStatus = LifePayRefundStatusEnum.待退款; |
| | | } |
| | | |
| | | if (refundApplyRemark.IsNotNullOrEmpty()) |
| | | { |
| | | order.RefundApplyRemark = refundApplyRemark; |
| | |
| | | |
| | | 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 = Convert.ToInt32(input.RefundPrice).ToString() }); |
| | | if (aliRefundResult.Code != AlipayResultCode.Success) |
| | | { |
| | | throw new UserFriendlyException("退款失败"); |
| | | throw new UserFriendlyException("退款失败:" + aliRefundResult.SubMsg); |
| | | } |
| | | |
| | | order.LifePayOrderStatus = LifePayOrderStatusEnum.已退款; |
| | |
| | | |
| | | 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) |
| | | .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; |
| | | } |
| | | |
| | |
| | | { |
| | | 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) |