| | |
| | | /// <returns></returns> |
| | | public async Task<PageOutput<LifePayOrderListOutput>> GetLifePayOrderPage(QueryLifePayOrderListInput input) |
| | | { |
| | | 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) |
| | | .WhereIf(input.BeginFinishTime.HasValue, x => x.FinishTime >= input.BeginFinishTime) |
| | | .WhereIf(input.EndFinishTime.HasValue, x => x.FinishTime <= input.EndFinishTime) |
| | |
| | | .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)) |
| | | .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 |
| | |
| | | return; |
| | | } |
| | | |
| | | if (order.PayStatus != LifePayStatusEnum.已支付 || order.LifePayOrderStatus != LifePayOrderStatusEnum.已完成) |
| | | if (order.PayStatus == LifePayStatusEnum.已支付 && order.LifePayOrderStatus != LifePayOrderStatusEnum.已完成 |
| | | && order.LifePayOrderStatus != LifePayOrderStatusEnum.待退款 && order.LifePayOrderStatus != LifePayOrderStatusEnum.已退款) |
| | | { |
| | | order.LifePayOrderStatus = LifePayOrderStatusEnum.待退款; |
| | | order.RefundApplyRemark = input.RefundApplyRemark; |
| | | order.RefundApplyTime = DateTime.Now; |
| | | |
| | | await _lifePayOrderRepository.UpdateAsync(order); |
| | | } |
| | | else |
| | | { |
| | | throw new UserFriendlyException("当前订单状态无法申请退款"); |
| | | } |
| | | |
| | | order.LifePayOrderStatus = LifePayOrderStatusEnum.待退款; |
| | | order.RefundApplyRemark = input.RefundApplyRemark; |
| | | order.RefundApplyTime = DateTime.Now; |
| | | |
| | | await _lifePayOrderRepository.UpdateAsync(order); |
| | | } |
| | | |
| | | /// <summary> |