zhengyuxuan
2025-03-27 d6af4520eb948a5b1ab1c6c4352d9688513e1713
LifePayment/LifePayment.HttpApi/LifePay/LifePayController.cs
@@ -1,4 +1,7 @@
using LifePayment.Application.Contracts;
using Alipay.AopSdk.F2FPay.Model;
using LifePayment.Application.Contracts;
using LifePayment.Application.LifePay;
using LifePayment.Domain.Common;
using LifePayment.Domain.Shared;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
@@ -20,16 +23,25 @@
    public class LifePayController : AbpController
    {
        private readonly ILifePayService _lifePayService;
        private readonly IStatisticsService _statisticsService;
        private readonly IWebClientInfoProvider _webClientInfoProvider;
        private readonly ICommonService _commonService;
        private readonly ILifePayOrderService _lifePayOrderService;
        private readonly ILogger<LifePayController> _logger;
        public LifePayController(
              ILifePayService lifePayService,
              IWebClientInfoProvider webClientInfoProvider
            , ILogger<LifePayController> logger
              IStatisticsService statisticsService,
              IWebClientInfoProvider webClientInfoProvider,
              ICommonService commonService,
              ILifePayOrderService lifePayOrderService,
              ILogger<LifePayController> logger
              )
        {
            _lifePayService = lifePayService;
            _statisticsService = statisticsService;
            _webClientInfoProvider = webClientInfoProvider;
            _commonService = commonService;
            _lifePayOrderService = lifePayOrderService;
            _logger = logger;
        }
@@ -39,12 +51,12 @@
        /// 获取顶部统计数据
        /// </summary>
        /// <returns></returns>
        //[HttpGet]
        //[AllowAnonymous]
        //public async Task<TopStatisticsOutput> GetTopStatistics()
        //{
        //    return await _lifePayService.GetTopStatistics();
        //}
        [HttpGet]
        [AllowAnonymous]
        public async Task<TopStatisticsOutput> GetTopStatistics()
        {
            return await _statisticsService.GetTopStatistics();
        }
        /// <summary>
        /// 获取电费面值
@@ -147,6 +159,17 @@
        }
        /// <summary>
        /// 获取渠道折扣
        /// </summary>
        /// <returns></returns>
        [HttpPost]
        [AllowAnonymous]
        public async Task<ChannelRateOutput> GetChannelRate(ChannelsBaseInput input)
        {
            return await _lifePayService.GetChannelRate(input);
        }
        /// <summary>
        /// 获取手续费费率
        /// </summary>
        /// <returns></returns>
@@ -168,6 +191,16 @@
            return await _lifePayService.GetIntroInfo(type);
        }
        /// <summary>
        /// 获取在线客服
        /// </summary>
        /// <returns></returns>
        [HttpGet]
        [AllowAnonymous]
        public async Task<string> GetOnlineService()
        {
            return await _commonService.GetOnlineService();
        }
        /// <summary>
        /// 获取用户分页数据
@@ -189,6 +222,17 @@
        public async Task<PageOutput<LifePayOrderListOutput>> GetLifePayOrderPage(QueryLifePayOrderListInput input)
        {
            return await _lifePayService.GetLifePayOrderPage(input);
        }
        /// <summary>
        /// 获取退款订单分页数据
        /// </summary>
        /// <param name="input"></param>
        /// <returns></returns>
        [HttpPost]
        public async Task<PageOutput<LifePayOrderListOutput>> GetLifePayRefundOrderPage(QueryLifePayRefundOrderListInput input)
        {
            return await _lifePayService.GetLifePayRefundOrderPage(input);
        }
        /// <summary>
@@ -359,8 +403,75 @@
                var bytes = ExcelHelper.ListToByteForExcel(data, "xlsx");
                return File(bytes, "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet", "订单管理" + ".xlsx");
            }
            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)
        {
            var data = await _lifePayService.GetBillErceiptExport(orderNo);
            return data;
        }
        /// <summary>
        /// 获取充值流水分页数据
        /// </summary>
        /// <param name="input"></param>
        /// <returns></returns>
        [HttpPost]
        public async Task<LifePayRechargeReceiptsPageOutput<LifePayRechargeReceiptsListOutput>> GetLifePayRechargeReceiptsPage(LifePayRechargeReceiptsPageInput input)
        {
            return await _lifePayOrderService.GetLifePayRechargeReceiptsPage(input);
        }
        /// <summary>
        /// 查询支付宝支付订单信息
        /// </summary>
        /// <param name="input"></param>
        /// <returns></returns>
        [HttpPost]
        [AllowAnonymous]
        public async Task<Alipay.EasySDK.Payment.Common.Models.AlipayTradeQueryResponse> QueryAlipayTrade(OrderInQuiryInput input)
        {
            return await _lifePayService.QueryAlipayTrade(input);
        }
        /// <summary>
        /// 查询支付宝退款订单信息
        /// </summary>
        /// <param name="input"></param>
        /// <returns></returns>
        [HttpPost]
        [AllowAnonymous]
        public async Task<Alipay.EasySDK.Payment.Common.Models.AlipayTradeFastpayRefundQueryResponse> QueryAlipayTradeRefund(OrderInQuiryInput input)
        {
            return await _lifePayService.QueryAlipayTradeRefund(input);
        }
        [HttpGet]
        [AllowAnonymous]
        public async Task WxPayDomesticRefundsQuery(string outTradeNo)
        {
            await _lifePayService.WxPayDomesticRefundsQuery(outTradeNo);
        }
        #endregion
@@ -404,6 +515,17 @@
        public async Task<CreateLifePayOrderOutput> CreateLifePayGasOrder(CreateLifePayOrderInput<LifeGasData> input)
        {
            return await _lifePayService.CreateLifePayGasOrder(input);
        }
        /// <summary>
        /// 修改实际到账金额
        /// </summary>
        /// <param name="input"></param>
        /// <returns></returns>
        [HttpPost]
        public async Task<int> UpdateLifePayOrderActualReceivedAmount(UpdateLifePayOrderInput input)
        {
            return await _lifePayService.UpdateLifePayOrderActualReceivedAmount(input);
        }
        /// <summary>
@@ -535,6 +657,30 @@
        }
        /// <summary>
        /// 在线客服配置
        /// </summary>
        /// <param name="input"></param>
        /// <returns></returns>
        [HttpPost]
        public async Task<int> UpdateOnlineService(OnlineServiceInput input)
        {
            await _commonService.UpdateOnlineService(input);
            return Constant.SUCCESS;
        }
        /// <summary>
        /// 上传充值流水
        /// </summary>
        /// <param name="input"></param>
        /// <returns></returns>
        [HttpPost]
        public async Task<int> AddUpdatePayRechargeReceipts(AddUpdatePayRechargeReceiptsInput input)
        {
            await _lifePayOrderService.AddUpdatePayRechargeReceipts(input);
            return Constant.SUCCESS;
        }
        /// <summary>
        /// 设置生活缴费支付类型
        /// </summary>
        /// <param name="input"></param>