zhengyuxuan
2025-03-24 738ac7f47b594f5bf4cf060084d533fd0abc5a44
fix:新增退款订单导出接口
8个文件已修改
137 ■■■■■ 已修改文件
LifePayment/LifePayment.Application.Contracts/LifePay/ILifePayService.cs 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
LifePayment/LifePayment.Application.Contracts/User/CreateBackClientUserInput.cs 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
LifePayment/LifePayment.Application/LifePay/LifePayService.cs 95 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
LifePayment/LifePayment.Application/Setting/OperateHistoryService.cs 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
LifePayment/LifePayment.Domain.Shared/Enum/LifePay/LifePayEnum.cs 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
LifePayment/LifePayment.Host/LifePaymentService.HttpApi.xml 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
LifePayment/LifePayment.Host/LifePaymentServices.Application.Contracts.xml 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
LifePayment/LifePayment.HttpApi/LifePay/LifePayController.cs 18 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
LifePayment/LifePayment.Application.Contracts/LifePay/ILifePayService.cs
@@ -250,6 +250,9 @@
    Task<List<LifePayOrderListTemplate>> GetLifePayOrderPageExport(QueryLifePayOrderListInput input);
    Task<List<LifePayOrderListTemplate>> GetLifePayRefudOrderPageExport(QueryLifePayRefundOrderListInput input);
    Task<string> GetBillErceiptExport(string orderNo);
    /// <summary>
LifePayment/LifePayment.Application.Contracts/User/CreateBackClientUserInput.cs
@@ -15,6 +15,10 @@
        /// 手机号
        /// </summary>
        public string PhoneNumber { get; set; }
        /// <summary>
        /// 密码
        /// </summary>
        public string Password { get; set; }
        /// <summary>
LifePayment/LifePayment.Application/LifePay/LifePayService.cs
@@ -338,6 +338,52 @@
        return result;
    }
    /// <summary>
    /// 退款订单分页
    /// </summary>
    /// <param name="input"></param>
    /// <returns></returns>
    public async Task<List<LifePayOrderListTemplate>> GetLifePayRefudOrderPageExport(QueryLifePayRefundOrderListInput input)
    {
        var result = await (await GetLifePayRefundOrderListFilter(input)).Select(x => new LifePayOrderListTemplate
        {
            DiscountAmount = x.DiscountAmount,
            FinishTime = x.FinishTime,
            LifePayOrderStatus = x.LifePayOrderStatus,
            LifePayOrderType = x.LifePayOrderType,
            LifePayType = x.LifePayType,
            OrderNo = x.OrderNo,
            PayAmount = x.PayAmount,
            PhoneNumber = x.PhoneNumber,
            RechargeAmount = x.RechargeAmount,
            OutOrderNo = x.OutOrderNo,
            PayStatus = x.PayStatus,
            PayTime = x.PayTime,
            ACOOLYOrderNo = x.ACOOLYOrderNo,
            CreationTime = x.CreationTime,
            RefundApplyRemark = x.RefundApplyRemark,
            ChannelName = x.ChannelName
        }).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.yyyyMMddHHmm);
            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.yyyyMMddHHmm);
            s.LifePayTypeStr = s.LifePayType.GetDescription();
            s.PayStatusStr = s.PayStatus.GetDescription();
            s.LifePayOrderStatusStr = s.LifePayOrderStatus.GetDescription();
            s.FinishTimeStr = !s.FinishTime.HasValue ? string.Empty : s.FinishTime.Value.ToString(LifePaymentConstant.DateTimeFormatStr.yyyyMMddHHmm);
        });
        return result;
    }
    public async Task<LifePayOrderOutput> GetLifePayOrderDetail(string orderNo)
    {
        var order = await _lifePayOrderRepository.Where(x => x.OrderNo == orderNo).FirstOrDefaultAsync();
@@ -1904,6 +1950,55 @@
        return result;
    }
    private async Task<IQueryable<LifePayOrderListOutput>> GetLifePayRefundOrderListFilter(QueryLifePayRefundOrderListInput input)
    {
        var result = (from a in _channelFilter.GetChannelLifePayOrderFilter(_lifePayOrderRepository)
     .Where(x => x.LifePayOrderStatus == LifePayOrderStatusEnum.待退款 || x.LifePayOrderStatus == LifePayOrderStatusEnum.已退款 || x.LifePayOrderStatus == LifePayOrderStatusEnum.退款中
     || x.LifePayRefundStatus > LifePayRefundStatusEnum.无需退款)
                                         .WhereIf(input.BeginFinishTime.HasValue, x => x.FinishTime >= input.BeginFinishTime)
                                         .WhereIf(input.EndFinishTime.HasValue, x => x.FinishTime <= input.EndFinishTime)
                                         .WhereIf(input.BeginRefundApplyTime.HasValue, x => x.RefundApplyTime >= input.BeginRefundApplyTime)
                                         .WhereIf(input.LifePayType.HasValue, x => x.LifePayType == input.LifePayType)
                                         .WhereIf(input.EndRefundApplyTime.HasValue, x => x.RefundApplyTime <= input.EndRefundApplyTime)
                                         .WhereIf(input.LifePayOrderStatus.HasValue, x => x.LifePayOrderStatus == input.LifePayOrderStatus.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,
                                RefundApplyTime = a.RefundApplyTime,
                                RefundTime = a.RefundTime,
                                RefundPrice = a.RefundPrice,
                                ChannelName = b.ChannlesName,
                                ActualRechargeAmount = a.ActualRechargeAmount,
                                PlatformDeductionAmount = a.PlatformDeductionAmount,
                                ACOOLYStatus = a.ACOOLYStatus,
                                LifePayRefundStatus = a.LifePayRefundStatus,
                            });
        return result;
    }
    private IQueryable<CreateEditPayChannelsInput> GetLifePayChannlesListFilter()
    {
        return _lifePayChannlesRep.Select(x =>
LifePayment/LifePayment.Application/Setting/OperateHistoryService.cs
@@ -48,7 +48,6 @@
                case OperateHistoryTypeEnum.AccountManage:
                    query = query.Where(x => x.UserId == input.TypeId
                                          && LifePaymentConstant.LogsSpecies.AccountManageOperateNameList.Contains(x.OperateName));
                    break;
                case OperateHistoryTypeEnum.LifePayChannles:
                    query = query.Where(x => x.RelationId == input.TypeId);
LifePayment/LifePayment.Domain.Shared/Enum/LifePay/LifePayEnum.cs
@@ -71,8 +71,8 @@
    [Description("充值中")]
    充值中 = 10,
    //[Description("已失败")]
    //已失败 = 20,
    [Description("已失败")]
    已失败 = 20,
    [Description("已完成")]
    已完成 = 30,
LifePayment/LifePayment.Host/LifePaymentService.HttpApi.xml
@@ -234,6 +234,13 @@
            <param name="input"></param>
            <returns></returns>
        </member>
        <member name="M:LifePayment.HttpApi.LifePayController.GetLifePayRefudOrderPageExport(LifePayment.Application.Contracts.QueryLifePayRefundOrderListInput)">
            <summary>
            导出订单Excel
            </summary>
            <param name="input"></param>
            <returns></returns>
        </member>
        <member name="M:LifePayment.HttpApi.LifePayController.CreateLifePayPhoneOrder(LifePayment.Application.Contracts.CreateLifePayOrderInput{LifePayment.Application.Contracts.LifePhoneData})">
            <summary>
            创建生活缴费话费订单
LifePayment/LifePayment.Host/LifePaymentServices.Application.Contracts.xml
@@ -1990,6 +1990,11 @@
            手机号
            </summary>
        </member>
        <member name="P:LifePayment.Application.Contracts.CreateBackClientUserInput.Password">
            <summary>
            密码
            </summary>
        </member>
        <member name="P:LifePayment.Application.Contracts.CreateBackClientUserInput.UserName">
            <summary>
            账户
LifePayment/LifePayment.HttpApi/LifePay/LifePayController.cs
@@ -376,6 +376,24 @@
            return Json(default);
        }
        /// <summary>
        /// 导出退款订单Excel
        /// </summary>
        /// <param name="input"></param>
        /// <returns></returns>
        [HttpPost]
        public async Task<ActionResult> GetLifePayRefudOrderPageExport(QueryLifePayRefundOrderListInput input)
        {
            var data = await _lifePayService.GetLifePayRefudOrderPageExport(input);
            if (data.Any())
            {
                var bytes = ExcelHelper.ListToByteForExcel(data, "xlsx");
                return File(bytes, "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet", "退款管理" + ".xlsx");
            }
            return Json(default);
        }
        [HttpGet]
        public async Task<string> GetBillErceiptExport(string orderNo)
        {