zhengyuxuan
2025-03-21 ecc217f694e03e660ef54bbada24fcb4ee59a728
回单下载
11个文件已修改
199 ■■■■■ 已修改文件
LifePayment/LifePayment.Application.Contracts/LifePay/ILifePayService.cs 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
LifePayment/LifePayment.Application/LifePay/LifePayService.cs 51 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
LifePayment/LifePayment.Domain.Shared/LifePaymentConstant.cs 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
LifePayment/LifePayment.Domain.Shared/WeChat/WxPayPostBaseModel.cs 31 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
LifePayment/LifePayment.Domain/Ali/AliPayApi.cs 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
LifePayment/LifePayment.Domain/WeChat/IWxPayApi.cs 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
LifePayment/LifePayment.Domain/WeChat/WxClient.cs 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
LifePayment/LifePayment.Domain/WeChat/WxPayApi.cs 14 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
LifePayment/LifePayment.Host/LifePaymentService.HttpApi.xml 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
LifePayment/LifePayment.Host/LifePaymentServices.Application.Contracts.xml 74 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
LifePayment/LifePayment.HttpApi/LifePay/LifePayController.cs 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
LifePayment/LifePayment.Application.Contracts/LifePay/ILifePayService.cs
@@ -250,6 +250,8 @@
    Task<List<LifePayOrderListTemplate>> GetLifePayOrderPageExport(QueryLifePayOrderListInput input);
    Task<string> GetBillErceiptExport(string orderNo);
    /// <summary>
    /// 设置生活缴费支付类型
    /// </summary>
LifePayment/LifePayment.Application/LifePay/LifePayService.cs
@@ -25,6 +25,7 @@
using Nest;
using Volo.Abp.Domain.Entities;
using Volo.Abp.ObjectMapping;
using NPOI.SS.Formula.Functions;
namespace LifePayment.Application;
@@ -45,6 +46,7 @@
    private readonly IDataFilter dataFilter;
    private readonly IChannelFilter _channelFilter;
    private readonly IAliPayApi _aliPayApi;
    private readonly IAlipayInterfaceManager _alipayInterfaceManager;
    private readonly IWxPayApi _wxPayApi;
    private readonly WxPayOption _wxPayOptions;
@@ -61,6 +63,7 @@
                          IRepository<DallyStatistics, Guid> dallyStatisticsRepository,
                          IRepository<OperateHistory, Guid> operateHistory,
                          IAliPayApi aliPayApi,
                          IAlipayInterfaceManager aliPayInterfaceManager,
                          IWxPayApi wxPayApi,
                          IOptions<WxPayOption> wxPayOptions,
                          IRepository<LifePayChannles, Guid> lifePayChannlesRep,
@@ -77,6 +80,7 @@
        _lifePayIntroInfoRepository = lifePayIntroInfoRepository;
        _dallyStatisticsRepository = dallyStatisticsRepository;
        _aliPayApi = aliPayApi;
        _alipayInterfaceManager = aliPayInterfaceManager;
        _wxPayApi = wxPayApi;
        _wxPayOptions = wxPayOptions.Value;
        _distributedEventBus = distributedEventBus;
@@ -663,7 +667,54 @@
        });
        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.LifePayType == LifePayTypeEnum.AliPay)
            {
                var elecInfoInput = new DataBillErceiptApplyInput
                {
                    Type = "FUND_DETAIL",
                    Key = orderNo
                };
                var elecInfoOutput = await _alipayInterfaceManager.DataBillErceiptApply(elecInfoInput);
                if (elecInfoOutput != null)
                {
                    var elecFileInput = new DataBillEreceiptQueryInput
                    {
                        FileId = elecInfoOutput.FileId,
                    };
                    var elecFileOutput = await _alipayInterfaceManager.DataBillEreceiptQuery(elecFileInput);
                    if (!string.IsNullOrEmpty(elecFileOutput.DownloadUrl))
                    {
                        return elecFileOutput.DownloadUrl;
                    }
                    return "";
                }
                return "";
            }
            else
            {
                WxPayTradeBillApplyRequest req = new WxPayTradeBillApplyRequest
                {
                    OutBillNo = order.OutOrderNo,
                };
                var res = await _wxPayApi.WxPayTradeBillApply(req);
                return "";
            }
        }
        catch (Exception ex)
        {
            _logger.LogError("获取订单号为{0}电子回单出现错误:{1}", orderNo, ex.Message);
            return "";
        }
    }
    #endregion
    #region 操作
LifePayment/LifePayment.Domain.Shared/LifePaymentConstant.cs
@@ -55,6 +55,10 @@
        public const string WxPayDomesticRefunds = "/v3/refund/domestic/refunds";
        public const string WxPayTradeBillApply = "/v3/fund-app/mch-transfer/elecsign/out-bill-no";
        public const string WxPayTradeBillQuery = "/v3/fund-app/mch-transfer/elecsign/out-bill-no/{out_bill_no}";
        public const string WxRechargeNotifySectionUrl = "/api/WxPayNotify/WxRechargeNotify";
        public const string WxPayDomesticRefundsNotifySectionUrl = "/api/WxPayNotify/WxPayDomesticRefundsNotify";
LifePayment/LifePayment.Domain.Shared/WeChat/WxPayPostBaseModel.cs
@@ -763,5 +763,36 @@
    }
    public class WxPayTradeBillApplyRequest
    {
        /// <summary>
        /// 微信支付订单号
        /// </summary>
        [JsonProperty("out_bill_no")]
        public string OutBillNo { get; set; }
    }
    public class WxPayTradeBillApplyReponse
    {
       /// <summary>
        /// 微信支付订单号
        /// </summary>
        [JsonProperty("transfer_bill_no")]
        public string TransferBillNo { get; set; }
    }
    public class WxPayTradeBillQueryRequest
    {
        /// <summary>
        /// 微信支付订单号
        /// </summary>
        [JsonProperty("transfer_bill_no")]
        public string TransferBillNo { get; set; }
    }
    public class WxPayTradeBillQueryReponse
    {
        [JsonProperty("download_url")]
        public string DownloadUrl { get; set; }
    }
}
LifePayment/LifePayment.Domain/Ali/AliPayApi.cs
@@ -4,6 +4,7 @@
using Alipay.EasySDK.Payment.FaceToFace.Models;
using LifePayment.Domain.Shared;
using Microsoft.Extensions.Options;
using Nest;
using System.Threading.Tasks;
namespace LifePayment.Domain
@@ -39,5 +40,6 @@
            AlipayTradeRefundResponse response = Factory.Payment.Common().Refund(input.OutTradeNo,input.RefundAmount);
            return response;
        }
    }
}
LifePayment/LifePayment.Domain/WeChat/IWxPayApi.cs
@@ -23,5 +23,9 @@
        string GeneratePaySignByKey(string message);
        Task<WxPayDomesticRefundsReponse> WxPayDomesticRefunds(WxPayDomesticRefundsRequest input);
        Task<WxPayTradeBillApplyReponse> WxPayTradeBillApply(WxPayTradeBillApplyRequest input);
        Task<WxPayTradeBillQueryReponse> WxPayTradeBillQuery(WxPayTradeBillQueryRequest input);
    }
}
LifePayment/LifePayment.Domain/WeChat/WxClient.cs
@@ -40,7 +40,7 @@
            return result;
        }
        public async Task<TResult> RefundsPostAsync<TInput, TResult>(TInput input, string function)
        public async Task<TResult> NomalPostAsync<TInput, TResult>(TInput input, string function)
        {
            var client = HttpClientFactory.CreateClient(LifePaymentConstant.WxPayHttpClientName);
            var body = JsonConvert.SerializeObject(input);
LifePayment/LifePayment.Domain/WeChat/WxPayApi.cs
@@ -31,7 +31,19 @@
        public async Task<WxPayDomesticRefundsReponse> WxPayDomesticRefunds(WxPayDomesticRefundsRequest input)
        {
            var result = await RefundsPostAsync<WxPayDomesticRefundsRequest, WxPayDomesticRefundsReponse>(input, LifePaymentConstant.WxPayDomesticRefunds);
            var result = await NomalPostAsync<WxPayDomesticRefundsRequest, WxPayDomesticRefundsReponse>(input, LifePaymentConstant.WxPayDomesticRefunds);
            return result;
        }
        public async Task<WxPayTradeBillApplyReponse> WxPayTradeBillApply(WxPayTradeBillApplyRequest input)
        {
            var result = await NomalPostAsync<WxPayTradeBillApplyRequest, WxPayTradeBillApplyReponse>(input, LifePaymentConstant.WxPayTradeBillApply);
            return result;
        }
        public async Task<WxPayTradeBillQueryReponse> WxPayTradeBillQuery(WxPayTradeBillQueryRequest input)
        {
            var result = await NomalPostAsync<WxPayTradeBillQueryRequest, WxPayTradeBillQueryReponse>(input, LifePaymentConstant.WxPayTradeBillQuery);
            return result;
        }
    }
LifePayment/LifePayment.Host/LifePaymentService.HttpApi.xml
@@ -56,6 +56,12 @@
            </summary>
            <returns></returns>
        </member>
        <member name="M:LifePayment.HttpApi.LifePayController.GetTopStatistics">
            <summary>
            获取顶部统计数据
            </summary>
            <returns></returns>
        </member>
        <member name="M:LifePayment.HttpApi.LifePayController.GetElectricParValue(LifePayment.Domain.Shared.ChannelsBaseInput)">
            <summary>
            获取电费面值
LifePayment/LifePayment.Host/LifePaymentServices.Application.Contracts.xml
@@ -845,6 +845,11 @@
            订单类型
            </summary>
        </member>
        <member name="P:LifePayment.Application.Contracts.LifePayOrderOutput.RefundOrderNo">
            <summary>
            退款订单号
            </summary>
        </member>
        <member name="P:LifePayment.Application.Contracts.LifePayOrderOutput.OrderNo">
            <summary>
            订单号
@@ -875,7 +880,7 @@
            支付状态
            </summary>
        </member>
        <member name="P:LifePayment.Application.Contracts.LifePayOrderOutput.LifePayOrderStatus">
        <member name="P:LifePayment.Application.Contracts.LifePayOrderOutput.Status">
            <summary>
            订单状态
            </summary>
@@ -908,6 +913,16 @@
        <member name="P:LifePayment.Application.Contracts.LifePayOrderOutput.RefundCredentialsImgUrl">
            <summary>
            退款凭证
            </summary>
        </member>
        <member name="P:LifePayment.Application.Contracts.LifePayOrderOutput.RefundApplyRemark">
            <summary>
            退款原因
            </summary>
        </member>
        <member name="P:LifePayment.Application.Contracts.LifePayOrderOutput.RefundCheckRemark">
            <summary>
            驳回原因
            </summary>
        </member>
        <member name="P:LifePayment.Application.Contracts.LifePayOrderOutput.ACOOLYOrderNo">
@@ -1015,7 +1030,7 @@
            支付状态
            </summary>
        </member>
        <member name="P:LifePayment.Application.Contracts.LifePayRefundOrderOutput.LifePayOrderStatus">
        <member name="P:LifePayment.Application.Contracts.LifePayRefundOrderOutput.Status">
            <summary>
            订单状态
            </summary>
@@ -1043,6 +1058,26 @@
        <member name="P:LifePayment.Application.Contracts.LifePayRefundOrderOutput.RefundCredentialsImgUrl">
            <summary>
            退款凭证
            </summary>
        </member>
        <member name="P:LifePayment.Application.Contracts.LifePayRefundOrderOutput.RefundApplyRemark">
            <summary>
            退款申请原因
            </summary>
        </member>
        <member name="P:LifePayment.Application.Contracts.LifePayRefundOrderOutput.RefundApplyTime">
            <summary>
            退款申请时间
            </summary>
        </member>
        <member name="P:LifePayment.Application.Contracts.LifePayRefundOrderOutput.RefundCheckRemark">
            <summary>
            退款驳回原因
            </summary>
        </member>
        <member name="P:LifePayment.Application.Contracts.LifePayRefundOrderOutput.RefundOrderNo">
            <summary>
            退款订单号
            </summary>
        </member>
        <member name="P:LifePayment.Application.Contracts.LifePayRefundOrderOutput.ACOOLYOrderNo">
@@ -1140,6 +1175,41 @@
            累计收款
            </summary>
        </member>
        <member name="P:LifePayment.Application.Contracts.TopStatisticsOutput.ReceiptsYesterda">
            <summary>
            昨日收款
            </summary>
        </member>
        <member name="P:LifePayment.Application.Contracts.TopStatisticsOutput.AccumulatedOrders">
            <summary>
            累计下单
            </summary>
        </member>
        <member name="P:LifePayment.Application.Contracts.TopStatisticsOutput.OrdersNumYesterda">
            <summary>
            昨日下单
            </summary>
        </member>
        <member name="P:LifePayment.Application.Contracts.TopStatisticsOutput.YesterdaSuccess">
            <summary>
            昨日成功
            </summary>
        </member>
        <member name="P:LifePayment.Application.Contracts.TopStatisticsOutput.YesterdaFail">
            <summary>
            昨日失败
            </summary>
        </member>
        <member name="P:LifePayment.Application.Contracts.TopStatisticsOutput.AccumulatedUsers">
            <summary>
            累计用户
            </summary>
        </member>
        <member name="P:LifePayment.Application.Contracts.TopStatisticsOutput.YesterdayActiveUsers">
            <summary>
            昨日活跃用户
            </summary>
        </member>
        <member name="P:LifePayment.Application.Contracts.RecordOperateHistoryEto.RelationId">
            <summary>
            关联关系ID
LifePayment/LifePayment.HttpApi/LifePay/LifePayController.cs
@@ -363,6 +363,15 @@
            return Json(default);
        }
        [HttpGet]
        public async Task<ActionResult> GetBillErceiptExport(string orderNo)
        {
            var data = await _lifePayService.GetBillErceiptExport(orderNo);
            return Json(default);
        }
        #endregion
        #region 操作