| | |
| | | |
| | | #region 查询 |
| | | |
| | | |
| | | /// <summary> |
| | | /// 获取电费面值 |
| | | /// </summary> |
| | |
| | | public async Task<PhoneParValueResponse> GetPhoneParValue() |
| | | { |
| | | return await _aCOOLYManager.PhoneParValue(new ACOOLYRequestBaseInput()); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 话费订单查询 |
| | | /// </summary> |
| | | /// <param name="input"></param> |
| | | /// <returns></returns> |
| | | public async Task<QueryPhoneOrderResponse> QueryPhoneOrder(QueryPhoneOrderRequestInput input) |
| | | { |
| | | return await _aCOOLYManager.QueryPhoneOrder(input); |
| | | } |
| | | |
| | | /// <summary> |
| | |
| | | RefundPrice = a.RefundPrice, |
| | | ChannelName = b.ChannlesName, |
| | | ActualRechargeAmount = a.RechargeAmount, |
| | | ActualReceivedAmount = a.ActualReceivedAmount, |
| | | PlatformDeductionAmount = a.PlatformDeductionAmount, |
| | | ACOOLYStatus = a.ACOOLYStatus, |
| | | LifePayRefundStatus = a.LifePayRefundStatus, |
| | |
| | | PremiumPrice = orderpirce.PremiumPrice, |
| | | Profit = orderpirce.Profit, |
| | | RefundOrderNo = order.RefundOrderNo, |
| | | ActualReceivedAmount = order.ActualReceivedAmount |
| | | }; |
| | | |
| | | return result; |
| | |
| | | }); |
| | | return result; |
| | | } |
| | | |
| | | public async Task<List<LifePayOrderListTemplateForChannle>> GetLifePayOrderPageExportForChannle(QueryLifePayOrderListInput input) |
| | | { |
| | | var result = await (await GetLifePayOrderListFilter(input)).Select(x => new LifePayOrderListTemplateForChannle |
| | | { |
| | | DiscountAmount = x.DiscountAmount, |
| | | FinishTime = x.FinishTime, |
| | | LifePayOrderStatus = x.LifePayOrderStatus, |
| | | LifePayOrderType = x.LifePayOrderType, |
| | | LifePayType = x.LifePayType, |
| | | OrderNo = x.OrderNo, |
| | | PayAmount = x.PayAmount, |
| | | ActualRechargeAmount = x.RechargeAmount, |
| | | PhoneNumber = x.PhoneNumber, |
| | | RechargeAmount = x.RechargeAmount, |
| | | OutOrderNo = x.OutOrderNo, |
| | | PayStatus = x.PayStatus, |
| | | PayTime = x.PayTime, |
| | | ACOOLYOrderNo = x.ACOOLYOrderNo, |
| | | CreationTime = x.CreationTime, |
| | | LifePayRefundStatus = x.LifePayRefundStatus, |
| | | ACOOLYStatus = x.ACOOLYStatus, |
| | | //RefundApplyRemark = x.RefundApplyRemark, |
| | | ChannelName = x.ChannelName, |
| | | PlatformPrice = x.PlatformDeductionAmount.HasValue ? x.PlatformDeductionAmount.Value : 0.00m |
| | | }).OrderByDescending(r => r.CreationTime).ToListAsync(); |
| | | var i = 0; |
| | | result.ForEach(s => |
| | | { |
| | | s.SerialNumber = ++i; |
| | | s.LifePayOrderTypeStr = s.LifePayOrderType.GetDescription(); |
| | | s.CreationTimeStr = s.CreationTime.ToString(LifePaymentConstant.DateTimeFormatStr.yyyyMMddHHmmss); |
| | | s.RechargeAmountStr = s.RechargeAmount.ToString("F2"); |
| | | s.PayAmountStr = s.PayAmount.ToString("F2"); |
| | | s.PayTimeStr = !s.PayTime.HasValue ? string.Empty : s.PayTime.Value.ToString(LifePaymentConstant.DateTimeFormatStr.yyyyMMddHHmmss); |
| | | s.LifePayTypeStr = s.LifePayType.GetDescription(); |
| | | s.PayStatusStr = s.PayStatus.GetDescription(); |
| | | s.ActualRechargeAmountStr = s.ActualRechargeAmount.ToString("F2"); |
| | | s.LifePayRefundStatusStr = s.LifePayRefundStatus == LifePayRefundStatusEnum.无需退款 ? "" : 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); |
| | | }); |
| | | return result; |
| | | } |
| | | |
| | | public async Task<string> GetBillErceiptExport(string orderNo) |
| | | { |
| | | try |
| | |
| | | var order = await _lifePayOrderRepository.Where(x => x.OrderNo == orderNo).FirstOrDefaultAsync(); |
| | | CheckExtensions.IfTrueThrowUserFriendlyException(order == null, "订单不存在"); |
| | | |
| | | if (order.PayStatus == LifePayStatusEnum.已支付) |
| | | if (order.PayStatus != LifePayStatusEnum.未支付) |
| | | { |
| | | return; |
| | | } |
| | |
| | | var order = await _lifePayOrderRepository.Where(x => x.OrderNo == orderNo).FirstOrDefaultAsync(); |
| | | CheckExtensions.IfTrueThrowUserFriendlyException(order == null, "订单不存在"); |
| | | |
| | | if (order.LifePayOrderStatus == LifePayOrderStatusEnum.已完成) |
| | | if (order.LifePayOrderStatus == status && order.ACOOLYStatus == acoolyStatus) |
| | | { |
| | | _logger.LogInformation($"订单({orderNo})已处理该状态"); |
| | | return; |
| | | } |
| | | |
| | | //order.PlatformDeductionAmount = payAmount; |
| | | order.ActualReceivedAmount = actualParValue; |
| | | |
| | | if (acoolyOrderNo.IsNotNullOrEmpty()) |
| | | { |
| | |
| | | || order.LifePayOrderStatus == LifePayOrderStatusEnum.已退款) |
| | | { |
| | | order.FinishTime = DateTime.Now; |
| | | order.PlatformDeductionAmount = Math.Round((order.ActualReceivedAmount ?? 0) * (order.PlatformRate ?? 0) / 100, 2); |
| | | order.RefundPrice = Math.Round((1 - ((order.ActualReceivedAmount ?? 0) / (order.RechargeAmount ?? 0))) * (order.PayAmount ?? 0), 2); |
| | | } |
| | | |
| | | await _lifePayOrderRepository.UpdateAsync(order); |
| | |
| | | order.RefundTime = DateTime.Now; |
| | | order.RefundCheckUserId = CurrentUser.Id; |
| | | order.RefundPrice = input.RefundPrice; |
| | | order.ActualReceivedAmount = Math.Round((1 - ((order.RefundPrice ?? 0) / (order.PayAmount ?? 0))) * (order.RechargeAmount ?? 0), 2); |
| | | order.PlatformDeductionAmount = Math.Round((order.ActualReceivedAmount ?? 0) * (order.PlatformRate ?? 0) / 100, 2); |
| | | |
| | | //await _lifePayOrderRepository.UpdateAsync(order); |
| | | |