sunpengfei
2025-09-02 0e25fabc3a96cd35ca8824e841532c04389e006d
FlexJobApi.UserServer.Application/EnterpriseWallets/Commands/AlipayFundExpandindirectCommandHandler.cs
@@ -7,6 +7,7 @@
using Mapster;
using MediatR;
using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.Options;
using System;
using System.Collections.Generic;
using System.Linq;
@@ -19,6 +20,7 @@
    /// 支付宝资金二级商户KYB代进件
    /// </summary>
    public class AlipayFundExpandindirectCommandHandler(
            IOptions<AlipayOptions> options,
            AlipayUtils alipayUtils,
            IHttpRemoteService httpRemoteService,
            IRepository<AlipayFundExpandindirectOrder> rep
@@ -27,6 +29,7 @@
        IRequestHandler<AlipayFundExpandindirectOrderCancelCommand, Guid>,
        IRequestHandler<AlipayFundExpandindirectCreateNotifyCommand, Guid>
    {
        private readonly IOptions<AlipayOptions> options = options;
        private readonly AlipayUtils alipayUtils = alipayUtils;
        private readonly IHttpRemoteService httpRemoteService = httpRemoteService;
        private readonly IRepository<AlipayFundExpandindirectOrder> rep = rep;
@@ -74,8 +77,24 @@
            {
                await rep.InsertNowAsync(entity);
            }
            var model = entity.Adapt<AlipayFundExpandindirectCreateModel>();
            var result = alipayUtils.FundExpandindirectCreate(model);
            var model = new AlipayFundExpandindirectCreateModel();
            model.ProductCode = entity.ProductCode;
            model.BizScene = entity.BizScene;
            model.OutBizNo = entity.OutBizNo;
            model.BizType = entity.BizType;
            model.OriginalOrderId = entity.OriginalOrderId;
            model.SceneCode = entity.SceneCode;
            model.SceneDirections = entity.SceneDirections;
            model.SceneImage = entity.SceneImage;
            model.SceneQualificationImage = entity.SceneQualificationImage;
            model.Sites = entity.Sites;
            var secondaryPartnerInfo = new SecondaryPartnerInfo();
            secondaryPartnerInfo.Identity = entity.Identity;
            secondaryPartnerInfo.Name = entity.Name;
            secondaryPartnerInfo.IdentityType = entity.IdentityType;
            model.SecondaryPartnerInfo = secondaryPartnerInfo;
            var result = alipayUtils.FundExpandindirectCreate(model, $"{options.Value.NotifyUrl}/api/user/enterpriseWallet/alipayFundExpandindirectCreateNotify");
            if (result.IsError)
            {
                entity.RiskReviewRemark = result.Msg;