| | |
| | | using Alipay.AopSdk.F2FPay.Model; |
| | | using LifePayment.Application.Contracts; |
| | | using LifePayment.Application.LifePay; |
| | | using LifePayment.Domain; |
| | | using LifePayment.Domain.Common; |
| | | using LifePayment.Domain.Shared; |
| | | using Microsoft.AspNetCore.Authorization; |
| | |
| | | /// <summary> |
| | | /// 获取顶部统计数据 |
| | | /// </summary> |
| | | /// <param name="input"></param> |
| | | /// <returns></returns> |
| | | [HttpGet] |
| | | [HttpPost] |
| | | [AllowAnonymous] |
| | | public async Task<TopStatisticsOutput> GetTopStatistics(string channleId = "") |
| | | public async Task<TopStatisticsOutput> GetTopStatistics(TopStatisticsInput input) |
| | | { |
| | | return await _statisticsService.GetTopStatistics(channleId); |
| | | return await _statisticsService.GetTopStatistics(input.ChannleList); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 获取30日收款统计 |
| | | /// </summary> |
| | | /// <param name="input"></param> |
| | | /// <returns></returns> |
| | | [HttpPost] |
| | | [AllowAnonymous] |
| | | public async Task<ReceiptsListOutPut> GetReceiptsList(TopStatisticsInput input) |
| | | { |
| | | return await _statisticsService.GetReceiptsList(input.ChannleList); |
| | | } |
| | | |
| | | [HttpPost] |
| | | [AllowAnonymous] |
| | | public async Task<ChannelDataListOutPut> GetChannelDataList(TopStatisticsInput input) |
| | | { |
| | | return await _statisticsService.GetChannelDataList(input.ChannleList); |
| | | } |
| | | |
| | | /// <summary> |
| | |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 获取渠道分佣分页列表 |
| | | /// </summary> |
| | | /// <param name="input"></param> |
| | | /// <returns></returns> |
| | | [HttpPost] |
| | | public async Task<PageOutput<LifePayChannlesRakeListOutput>> GetLifePayChannlesRakePage(LifePayChannlesRakePageInput input) |
| | | { |
| | | return await _lifePayOrderService.GetLifePayChannlesRakePage(input); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 导出渠道分佣Excel |
| | | /// </summary> |
| | | /// <param name="input"></param> |
| | | /// <returns></returns> |
| | | [HttpPost] |
| | | public async Task<ActionResult> GetLifePayChannlesRakePageExport(LifePayChannlesRakePageInput input) |
| | | { |
| | | var data = await _lifePayOrderService.GetLifePayChannlesRakePageExport(input); |
| | | if (data.Any()) |
| | | { |
| | | var bytes = ExcelHelper.ListToByteForExcel(data, "xlsx"); |
| | | return File(bytes, "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet", "渠道分佣" + ".xlsx"); |
| | | } |
| | | return Json(default); |
| | | } |
| | | /// <summary> |
| | | /// 获取收支流水分页数据 |
| | | /// </summary> |
| | | /// <param name="input"></param> |
| | |
| | | public async Task<WxPayDomesticRefundsQueryReponse> WxPayDomesticRefundsQuery(string outTradeNo) |
| | | { |
| | | var res = await _lifePayService.WxPayDomesticRefundsQuery(outTradeNo); |
| | | await _lifePayOrderService.AddLifePayExpensesReceipts(new AddLifePayExpensesReceiptsInput() |
| | | if (res.Code == WxpayResultCode.Success) |
| | | { |
| | | OrderNo = res.OutTradeNo, |
| | | OutOrderNo = res.TransactionId, |
| | | LifePayType = LifePayTypeEnum.WxPay, |
| | | ExpensesReceiptsType = ExpensesReceiptsTypeEnum.Expenses, |
| | | Amount = Convert.ToDecimal(res.Amount.Total) |
| | | }); |
| | | await _lifePayOrderService.AddLifePayExpensesReceipts(new AddLifePayExpensesReceiptsInput() |
| | | { |
| | | OrderNo = res.OutTradeNo, |
| | | OutRefundNo = res.RefundId, |
| | | OutOrderNo = res.TransactionId, |
| | | LifePayType = LifePayTypeEnum.WxPay, |
| | | ExpensesReceiptsType = ExpensesReceiptsTypeEnum.Expenses, |
| | | Amount = Convert.ToDecimal(res.Amount.Total) |
| | | }); |
| | | } |
| | | return res; |
| | | |
| | | } |
| | | |
| | | /// <summary> |
| | |
| | | await _lifePayOrderService.GetAllLifePayExpensesReceipts(); |
| | | } |
| | | |
| | | |
| | | /// <summary> |
| | | /// 同步订单 |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | [HttpGet] |
| | | [AllowAnonymous] |
| | | public async Task GetAllChannlesRake() |
| | | { |
| | | await _lifePayOrderService.GetAllChannlesRake(); |
| | | } |
| | | |
| | | |
| | | #endregion |
| | | |