Jelajahi Sumber

Merge branch 'test-mainserver'

lcl 6 bulan lalu
induk
melakukan
b5e111f8ac

+ 1 - 1
Entity/HaoDa/AddNewMerchant.cs

@@ -39,7 +39,7 @@ namespace MySystem
         public string resserveMobile { get; set; }//银行预留手机号 channelkind为000001时必填
         public string userName { get; set; }//商户法人姓名
         public string periodValidity { get; set; }//法人身份证有效期 格式:20150101-20200101,若结束日期为长期填20150101-长期
-        // public string oprInvitedCode { get; set; }
+        public string oprInvitedCode { get; set; }
         public List<ImageItem> images { get; set; }//图片
 
     }

+ 16 - 0
Entity/HaoDa/HaodaParam.cs

@@ -0,0 +1,16 @@
+using System;
+using System.Collections.Generic;
+namespace MySystem
+{
+    /// <summary>
+    /// 好哒参数
+    /// </summary>
+    public static class HaodaParam
+    {
+        public static string BoxRequestUrl = "https://openapi.iboxpay.com";
+        public static string BoxAppId = "AP8322645764893728768";
+        public static string BoxAppSecret = "je1TElprp3jzWETsG3FcWqtmpreEHqZS";
+        public static string BoxPublicKey = "";
+        public static string BrhCode = "";
+    }
+}

+ 16 - 0
Entity/HaoDa/HaodaUnionParam.cs

@@ -0,0 +1,16 @@
+using System;
+using System.Collections.Generic;
+namespace MySystem
+{
+    /// <summary>
+    /// 银联参数
+    /// </summary>
+    public static class HaodaUnionParam
+    {
+        public static string BoxRequestUrl = "https://openapi.iboxpay.com";
+        public static string BoxAppId = "AP7175619323825451008";
+        public static string BoxAppSecret = "hUfR53gdjyfiZTBR5bILanMqRD1dXD7y";
+        public static string BoxPublicKey = "";
+        public static string BrhCode = "030145";
+    }
+}

+ 22 - 0
Entity/OrderMessage.cs

@@ -0,0 +1,22 @@
+using System;
+namespace MySystem
+{
+    public class OrderMessage
+    {
+        public int brandId { get; set; } //品牌/通道(0直联,1银联,2好哒)
+        public int status { get; set; } //订单状态(0待支付,1已支付)
+        public DateTime createDate { get; set; } //创建时间
+        public DateTime payDate { get; set; } //支付时间
+        public string hdOrderNo { get; set; } //好哒订单号
+        public string tradeNo { get; set; } //支付宝微信平台交易号
+        public string snNo { get; set; } //码牌SN
+        public decimal payMoney { get; set; } //支付金额
+        public int payMode { get; set; } //支付方式(1支付宝,2微信)
+        public string orderNo { get; set; } //订单号
+        public int consumerId { get; set; } //消费者Id
+        public int merchantId { get; set; } //商户Id
+        public int isAct { get; set; } //活动标识(1活动,0非活动)
+        public int userId { get; set; } //创客Id
+        public decimal merchantActualAmount { get; set; } //商家实收金额
+    }
+}

+ 20 - 0
Models/Main/ChangeSettlementCardAuditRecord.cs

@@ -0,0 +1,20 @@
+using System;
+using System.Collections.Generic;
+
+namespace MySystem.Models.Main
+{
+    public partial class ChangeSettlementCardAuditRecord
+    {
+        public int Id { get; set; }
+        public int Sort { get; set; }
+        public int Status { get; set; }
+        public int Version { get; set; }
+        public DateTime? CreateDate { get; set; }
+        public DateTime? UpdateDate { get; set; }
+        public int AuditStatus { get; set; }
+        public string MchtNo { get; set; }
+        public int MerchantId { get; set; }
+        public int TaskId { get; set; }
+        public string Remark { get; set; }
+    }
+}

+ 1 - 0
Models/Main/MerchantAddInfo.cs

@@ -149,5 +149,6 @@ namespace MySystem.Models.Main
         public ulong HdBindWeChat { get; set; }
         public string MerchantType { get; set; }
         public int PlaceType { get; set; }
+        public int BrandId { get; set; }
     }
 }

+ 37 - 0
Models/Main/MerchantChangeSettlementCardRecord.cs

@@ -0,0 +1,37 @@
+using System;
+using System.Collections.Generic;
+
+namespace MySystem.Models.Main
+{
+    public partial class MerchantChangeSettlementCardRecord
+    {
+        public int Id { get; set; }
+        public int Sort { get; set; }
+        public int Status { get; set; }
+        public int Version { get; set; }
+        public DateTime? CreateDate { get; set; }
+        public DateTime? UpdateDate { get; set; }
+        public string HoldAgentProtocol { get; set; }
+        public string AgentIdCardBack { get; set; }
+        public string AgentIdCardFront { get; set; }
+        public string AgentProtocol { get; set; }
+        public string PriLicAgreement { get; set; }
+        public string OpenAccountLicenses { get; set; }
+        public string BankCard { get; set; }
+        public int TaskId { get; set; }
+        public DateTime? AgentCardEndDate { get; set; }
+        public DateTime? AgentCardStartDate { get; set; }
+        public string IdCard { get; set; }
+        public string AcctZbankCode { get; set; }
+        public int AlterType { get; set; }
+        public string ZbankNo { get; set; }
+        public string AccountNo { get; set; }
+        public string AccountName { get; set; }
+        public string MchtNo { get; set; }
+        public string Operator { get; set; }
+        public int AccountType { get; set; }
+        public string Remark { get; set; }
+        public string MerchantName { get; set; }
+        public int MerchantId { get; set; }
+    }
+}

+ 1 - 0
Models/Main/MerchantInfo.cs

@@ -55,5 +55,6 @@ namespace MySystem.Models.Main
         public int Popularity { get; set; }
         public decimal Latitude { get; set; }
         public decimal Longitude { get; set; }
+        public int BrandId { get; set; }
     }
 }

+ 210 - 0
Models/Main/WebCMSEntities.cs

@@ -42,6 +42,7 @@ namespace MySystem.Models.Main
         public virtual DbSet<BusinessScope> BusinessScope { get; set; }
         public virtual DbSet<BusinessScopeType> BusinessScopeType { get; set; }
         public virtual DbSet<BusinessTradeSummary> BusinessTradeSummary { get; set; }
+        public virtual DbSet<ChangeSettlementCardAuditRecord> ChangeSettlementCardAuditRecord { get; set; }
         public virtual DbSet<Col> Col { get; set; }
         public virtual DbSet<ConsumerOpenIds> ConsumerOpenIds { get; set; }
         public virtual DbSet<ConsumerOrderForNo> ConsumerOrderForNo { get; set; }
@@ -92,6 +93,7 @@ namespace MySystem.Models.Main
         public virtual DbSet<MerchantAdmin> MerchantAdmin { get; set; }
         public virtual DbSet<MerchantAmountSummay> MerchantAmountSummay { get; set; }
         public virtual DbSet<MerchantAuth> MerchantAuth { get; set; }
+        public virtual DbSet<MerchantChangeSettlementCardRecord> MerchantChangeSettlementCardRecord { get; set; }
         public virtual DbSet<MerchantClass> MerchantClass { get; set; }
         public virtual DbSet<MerchantCol> MerchantCol { get; set; }
         public virtual DbSet<MerchantComment> MerchantComment { get; set; }
@@ -2290,6 +2292,57 @@ namespace MySystem.Models.Main
                 entity.Property(e => e.VipFlag).HasColumnType("int(11)");
             });
 
+            modelBuilder.Entity<ChangeSettlementCardAuditRecord>(entity =>
+            {
+                entity.HasComment("商户修改结算卡审核表");
+
+                entity.Property(e => e.Id).HasColumnType("int(11)");
+
+                entity.Property(e => e.AuditStatus)
+                    .HasColumnType("int(11)")
+                    .HasComment("审核状态");
+
+                entity.Property(e => e.CreateDate)
+                    .HasColumnType("datetime")
+                    .HasComment("创建时间");
+
+                entity.Property(e => e.MchtNo)
+                    .HasColumnType("varchar(50)")
+                    .HasComment("收款商户号")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.MerchantId)
+                    .HasColumnType("int(11)")
+                    .HasComment("申请商户Id");
+
+                entity.Property(e => e.Remark)
+                    .HasColumnType("varchar(200)")
+                    .HasComment("备注")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.Sort)
+                    .HasColumnType("int(11)")
+                    .HasComment("排序序号");
+
+                entity.Property(e => e.Status)
+                    .HasColumnType("int(11)")
+                    .HasComment("状态");
+
+                entity.Property(e => e.TaskId)
+                    .HasColumnType("int(11)")
+                    .HasComment("申请任务Id");
+
+                entity.Property(e => e.UpdateDate)
+                    .HasColumnType("datetime")
+                    .HasComment("修改时间");
+
+                entity.Property(e => e.Version)
+                    .HasColumnType("int(11)")
+                    .HasComment("版本号");
+            });
+
             modelBuilder.Entity<Col>(entity =>
             {
                 entity.Property(e => e.Id).HasColumnType("int(11)");
@@ -5549,6 +5602,10 @@ namespace MySystem.Models.Main
                     .HasCharSet("utf8")
                     .HasCollation("utf8_general_ci");
 
+                entity.Property(e => e.BrandId)
+                    .HasColumnType("int(11)")
+                    .HasComment("品牌");
+
                 entity.Property(e => e.BusinessCode)
                     .HasColumnType("varchar(50)")
                     .HasCharSet("utf8")
@@ -6353,6 +6410,155 @@ namespace MySystem.Models.Main
                 entity.Property(e => e.Version).HasColumnType("int(11)");
             });
 
+            modelBuilder.Entity<MerchantChangeSettlementCardRecord>(entity =>
+            {
+                entity.HasComment("商户修改结算卡记录表");
+
+                entity.Property(e => e.Id).HasColumnType("int(11)");
+
+                entity.Property(e => e.AccountName)
+                    .HasColumnType("varchar(50)")
+                    .HasComment("开户名")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.AccountNo)
+                    .HasColumnType("varchar(50)")
+                    .HasComment("卡号")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.AccountType)
+                    .HasColumnType("int(11)")
+                    .HasComment("账户类型");
+
+                entity.Property(e => e.AcctZbankCode)
+                    .HasColumnName("AcctZBankCode")
+                    .HasColumnType("varchar(50)")
+                    .HasComment("开户支行地区码")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.AgentCardEndDate)
+                    .HasColumnType("datetime")
+                    .HasComment("非法人身份证有效结束时间");
+
+                entity.Property(e => e.AgentCardStartDate)
+                    .HasColumnType("datetime")
+                    .HasComment("非法人身份证有效开始时间");
+
+                entity.Property(e => e.AgentIdCardBack)
+                    .HasColumnType("varchar(200)")
+                    .HasComment("被委托人身份证国徽面")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.AgentIdCardFront)
+                    .HasColumnType("varchar(200)")
+                    .HasComment("被委托人身份证人像面")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.AgentProtocol)
+                    .HasColumnType("varchar(200)")
+                    .HasComment("委托结算授权书")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.AlterType)
+                    .HasColumnType("int(11)")
+                    .HasComment("结算类型");
+
+                entity.Property(e => e.BankCard)
+                    .HasColumnType("varchar(200)")
+                    .HasComment("银行卡正面照片")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.CreateDate)
+                    .HasColumnType("datetime")
+                    .HasComment("创建时间");
+
+                entity.Property(e => e.HoldAgentProtocol)
+                    .HasColumnType("varchar(200)")
+                    .HasComment("法人手持委托结算授权书")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.IdCard)
+                    .HasColumnType("varchar(18)")
+                    .HasComment("非法人身份证号")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.MchtNo)
+                    .HasColumnType("varchar(50)")
+                    .HasComment("商户号")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.MerchantId)
+                    .HasColumnType("int(11)")
+                    .HasComment("商户Id");
+
+                entity.Property(e => e.MerchantName)
+                    .HasColumnType("varchar(200)")
+                    .HasComment("商户名称")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.OpenAccountLicenses)
+                    .HasColumnType("varchar(200)")
+                    .HasComment("开户许可证")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.Operator)
+                    .HasColumnType("varchar(50)")
+                    .HasComment("操作人")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.PriLicAgreement)
+                    .HasColumnType("varchar(200)")
+                    .HasComment("企业法人对私授权书")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.Remark)
+                    .HasColumnType("varchar(200)")
+                    .HasComment("审核备注")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.Sort)
+                    .HasColumnType("int(11)")
+                    .HasComment("排序序号");
+
+                entity.Property(e => e.Status)
+                    .HasColumnType("int(11)")
+                    .HasComment("状态");
+
+                entity.Property(e => e.TaskId)
+                    .HasColumnType("int(11)")
+                    .HasComment("任务Id");
+
+                entity.Property(e => e.UpdateDate)
+                    .HasColumnType("datetime")
+                    .HasComment("修改时间");
+
+                entity.Property(e => e.Version)
+                    .HasColumnType("int(11)")
+                    .HasComment("版本号");
+
+                entity.Property(e => e.ZbankNo)
+                    .HasColumnName("ZBankNo")
+                    .HasColumnType("varchar(50)")
+                    .HasComment("支行号")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+            });
+
             modelBuilder.Entity<MerchantClass>(entity =>
             {
                 entity.Property(e => e.Id).HasColumnType("int(11)");
@@ -6961,6 +7167,10 @@ namespace MySystem.Models.Main
 
                 entity.Property(e => e.BindStatus).HasColumnType("int(11)");
 
+                entity.Property(e => e.BrandId)
+                    .HasColumnType("int(11)")
+                    .HasComment("品牌");
+
                 entity.Property(e => e.BriefIntroduction)
                     .HasColumnType("longtext")
                     .HasComment("简介")

+ 8 - 8
Startup.cs

@@ -165,15 +165,15 @@ namespace MySystem
                 ProfitHelper.Instance.StartListenProfit(); //每月分润
                 ProfitCheckHelper.Instance.Start(); //检查订单是否在队列里
 
-                AlipayPayBackFeeService.Instance.Start();
-                ActiveRewardService.Instance.StartAct();
-                ActiveRewardService.Instance.StartOpenReward();
-                ActiveRewardService.Instance.StartLeaderReward();
-                ActiveRewardService.Instance.StartOperateReward();
+            //     AlipayPayBackFeeService.Instance.Start();
+            //     ActiveRewardService.Instance.StartAct();
+            //     ActiveRewardService.Instance.StartOpenReward();
+            //     ActiveRewardService.Instance.StartLeaderReward();
+            //     ActiveRewardService.Instance.StartOperateReward();
                 
-                MerchantStandardService.Instance.Start(); //商户缴纳服务费次月活动交易额大于等于1W,奖励进件创客50元
-                MerchantStandardService.Instance.StartThree(); //商户缴纳服务费次月起连续不间断三个月,每月活动交易额大于1W,奖励进件创客100元
-                MerchantStandardService.Instance.StartActive();
+            //     MerchantStandardService.Instance.Start(); //商户缴纳服务费次月活动交易额大于等于1W,奖励进件创客50元
+            //     MerchantStandardService.Instance.StartThree(); //商户缴纳服务费次月起连续不间断三个月,每月活动交易额大于1W,奖励进件创客100元
+            //     MerchantStandardService.Instance.StartActive();
             }
         }
 

+ 23 - 21
Util/HaoDa/AddNewMerchantSetUtil.cs

@@ -19,7 +19,9 @@ namespace MySystem
         public static AddNewMerchant SetValue(MerchantAddInfo AddInfo)
         {
             AddNewMerchant addNewMerchant = new AddNewMerchant();
-            addNewMerchant.brh = HaoDaHelper.BrhCode; //机构号(正式)
+            // addNewMerchant.brh = HaoDaHelper.BrhCode; //机构号(正式)
+            if (AddInfo.BrandId == 1) addNewMerchant.brh = HaodaParam.BrhCode;
+            if (AddInfo.BrandId == 0) addNewMerchant.brh = HaodaUnionParam.BrhCode;
             if (!string.IsNullOrEmpty(AddInfo.MchtNo))
             {
                 addNewMerchant.mchtNo = AddInfo.MchtNo; //收款商户号
@@ -85,10 +87,10 @@ namespace MySystem
             //法人手持身份证正面
             if (!string.IsNullOrEmpty(AddInfo.PersonWithIdCard))
             {
-                var tokenInfo = JsonMapper.ToObject(HaoDaHelper.Instance.GetToken(AddInfo.PersonWithIdCard.Substring(AddInfo.PersonWithIdCard.LastIndexOf("/")).Trim('/'), "0"));
+                var tokenInfo = JsonMapper.ToObject(HaoDaHelper.Instance.GetToken(AddInfo.PersonWithIdCard.Substring(AddInfo.PersonWithIdCard.LastIndexOf("/")).Trim('/'), "0", AddInfo.BrandId));
                 if (tokenInfo["code"].ToString() == "1")
                 {
-                    var returnInfo = HaoDaHelper.Instance.ReturnFileName(tokenInfo["token"].ToString(), AddInfo.PersonWithIdCard);
+                    var returnInfo = HaoDaHelper.Instance.ReturnFileName(tokenInfo["token"].ToString(), AddInfo.PersonWithIdCard, AddInfo.BrandId);
                     if (returnInfo != "false")
                     {
                         imageItem = new ImageItem();
@@ -101,10 +103,10 @@ namespace MySystem
             //收款人银行卡照片
             if (!string.IsNullOrEmpty(AddInfo.BankCard))
             {
-                var tokenInfo = JsonMapper.ToObject(HaoDaHelper.Instance.GetToken(AddInfo.BankCard.Substring(AddInfo.BankCard.LastIndexOf("/")).Trim('/'), "0"));
+                var tokenInfo = JsonMapper.ToObject(HaoDaHelper.Instance.GetToken(AddInfo.BankCard.Substring(AddInfo.BankCard.LastIndexOf("/")).Trim('/'), "0", AddInfo.BrandId));
                 if (tokenInfo["code"].ToString() == "1")
                 {
-                    var returnInfo = HaoDaHelper.Instance.ReturnFileName(tokenInfo["token"].ToString(), AddInfo.BankCard);
+                    var returnInfo = HaoDaHelper.Instance.ReturnFileName(tokenInfo["token"].ToString(), AddInfo.BankCard, AddInfo.BrandId);
                     if (returnInfo != "false")
                     {
                         imageItem = new ImageItem();
@@ -117,10 +119,10 @@ namespace MySystem
             //身份证正面
             if (!string.IsNullOrEmpty(AddInfo.IdCardCopy))
             {
-                var tokenInfo = JsonMapper.ToObject(HaoDaHelper.Instance.GetToken(AddInfo.IdCardCopy.Substring(AddInfo.IdCardCopy.LastIndexOf("/")).Trim('/'), "0"));
+                var tokenInfo = JsonMapper.ToObject(HaoDaHelper.Instance.GetToken(AddInfo.IdCardCopy.Substring(AddInfo.IdCardCopy.LastIndexOf("/")).Trim('/'), "0", AddInfo.BrandId));
                 if (tokenInfo["code"].ToString() == "1")
                 {
-                    var returnInfo = HaoDaHelper.Instance.ReturnFileName(tokenInfo["token"].ToString(), AddInfo.IdCardCopy);
+                    var returnInfo = HaoDaHelper.Instance.ReturnFileName(tokenInfo["token"].ToString(), AddInfo.IdCardCopy, AddInfo.BrandId);
                     if (returnInfo != "false")
                     {
                         imageItem = new ImageItem();
@@ -133,10 +135,10 @@ namespace MySystem
             //身份证反面
             if (!string.IsNullOrEmpty(AddInfo.IdCardNational))
             {
-                var tokenInfo = JsonMapper.ToObject(HaoDaHelper.Instance.GetToken(AddInfo.IdCardNational.Substring(AddInfo.IdCardNational.LastIndexOf("/")).Trim('/'), "0"));
+                var tokenInfo = JsonMapper.ToObject(HaoDaHelper.Instance.GetToken(AddInfo.IdCardNational.Substring(AddInfo.IdCardNational.LastIndexOf("/")).Trim('/'), "0", AddInfo.BrandId));
                 if (tokenInfo["code"].ToString() == "1")
                 {
-                    var returnInfo = HaoDaHelper.Instance.ReturnFileName(tokenInfo["token"].ToString(), AddInfo.IdCardNational);
+                    var returnInfo = HaoDaHelper.Instance.ReturnFileName(tokenInfo["token"].ToString(), AddInfo.IdCardNational, AddInfo.BrandId);
                     if (returnInfo != "false")
                     {
                         imageItem = new ImageItem();
@@ -150,10 +152,10 @@ namespace MySystem
             //开户许可证(对公凭证)
             if (!string.IsNullOrEmpty(AddInfo.OpenAccountLicenses))
             {
-                var tokenInfo = JsonMapper.ToObject(HaoDaHelper.Instance.GetToken(AddInfo.OpenAccountLicenses.Substring(AddInfo.OpenAccountLicenses.LastIndexOf("/")).Trim('/'), "0"));
+                var tokenInfo = JsonMapper.ToObject(HaoDaHelper.Instance.GetToken(AddInfo.OpenAccountLicenses.Substring(AddInfo.OpenAccountLicenses.LastIndexOf("/")).Trim('/'), "0", AddInfo.BrandId));
                 if (tokenInfo["code"].ToString() == "1")
                 {
-                    var returnInfo = HaoDaHelper.Instance.ReturnFileName(tokenInfo["token"].ToString(), AddInfo.OpenAccountLicenses);
+                    var returnInfo = HaoDaHelper.Instance.ReturnFileName(tokenInfo["token"].ToString(), AddInfo.OpenAccountLicenses, AddInfo.BrandId);
                     if (returnInfo != "false")
                     {
                         imageItem = new ImageItem();
@@ -182,10 +184,10 @@ namespace MySystem
             //营业执照
             if (!string.IsNullOrEmpty(AddInfo.LicenseCopy))
             {
-                var tokenInfo = JsonMapper.ToObject(HaoDaHelper.Instance.GetToken(AddInfo.LicenseCopy.Substring(AddInfo.LicenseCopy.LastIndexOf("/")).Trim('/'), "0"));
+                var tokenInfo = JsonMapper.ToObject(HaoDaHelper.Instance.GetToken(AddInfo.LicenseCopy.Substring(AddInfo.LicenseCopy.LastIndexOf("/")).Trim('/'), "0", AddInfo.BrandId));
                 if (tokenInfo["code"].ToString() == "1")
                 {
-                    var returnInfo = HaoDaHelper.Instance.ReturnFileName(tokenInfo["token"].ToString(), AddInfo.LicenseCopy);
+                    var returnInfo = HaoDaHelper.Instance.ReturnFileName(tokenInfo["token"].ToString(), AddInfo.LicenseCopy, AddInfo.BrandId);
                     if (returnInfo != "false")
                     {
                         imageItem = new ImageItem();
@@ -257,10 +259,10 @@ namespace MySystem
             //门头照
             if (!string.IsNullOrEmpty(AddInfo.StoreEntrancePic))
             {
-                var tokenInfo = JsonMapper.ToObject(HaoDaHelper.Instance.GetToken(AddInfo.StoreEntrancePic.Substring(AddInfo.StoreEntrancePic.LastIndexOf("/")).Trim('/'), "0"));
+                var tokenInfo = JsonMapper.ToObject(HaoDaHelper.Instance.GetToken(AddInfo.StoreEntrancePic.Substring(AddInfo.StoreEntrancePic.LastIndexOf("/")).Trim('/'), "0", AddInfo.BrandId));
                 if (tokenInfo["code"].ToString() == "1")
                 {
-                    var returnInfo = HaoDaHelper.Instance.ReturnFileName(tokenInfo["token"].ToString(), AddInfo.StoreEntrancePic);
+                    var returnInfo = HaoDaHelper.Instance.ReturnFileName(tokenInfo["token"].ToString(), AddInfo.StoreEntrancePic, AddInfo.BrandId);
                     if (returnInfo != "false")
                     {
                         imageItem = new ImageItem();
@@ -273,10 +275,10 @@ namespace MySystem
             //收银台
             if (!string.IsNullOrEmpty(AddInfo.CheckstandImg))
             {
-                var tokenInfo = JsonMapper.ToObject(HaoDaHelper.Instance.GetToken(AddInfo.CheckstandImg.Substring(AddInfo.CheckstandImg.LastIndexOf("/")).Trim('/'), "0"));
+                var tokenInfo = JsonMapper.ToObject(HaoDaHelper.Instance.GetToken(AddInfo.CheckstandImg.Substring(AddInfo.CheckstandImg.LastIndexOf("/")).Trim('/'), "0", AddInfo.BrandId));
                 if (tokenInfo["code"].ToString() == "1")
                 {
-                    var returnInfo = HaoDaHelper.Instance.ReturnFileName(tokenInfo["token"].ToString(), AddInfo.CheckstandImg);
+                    var returnInfo = HaoDaHelper.Instance.ReturnFileName(tokenInfo["token"].ToString(), AddInfo.CheckstandImg, AddInfo.BrandId);
                     if (returnInfo != "false")
                     {
                         imageItem = new ImageItem();
@@ -289,10 +291,10 @@ namespace MySystem
             //店铺全景
             if (!string.IsNullOrEmpty(AddInfo.IndoorPic))
             {
-                var tokenInfo = JsonMapper.ToObject(HaoDaHelper.Instance.GetToken(AddInfo.IndoorPic.Substring(AddInfo.IndoorPic.LastIndexOf("/")).Trim('/'), "0"));
+                var tokenInfo = JsonMapper.ToObject(HaoDaHelper.Instance.GetToken(AddInfo.IndoorPic.Substring(AddInfo.IndoorPic.LastIndexOf("/")).Trim('/'), "0", AddInfo.BrandId));
                 if (tokenInfo["code"].ToString() == "1")
                 {
-                    var returnInfo = HaoDaHelper.Instance.ReturnFileName(tokenInfo["token"].ToString(), AddInfo.IndoorPic);
+                    var returnInfo = HaoDaHelper.Instance.ReturnFileName(tokenInfo["token"].ToString(), AddInfo.IndoorPic, AddInfo.BrandId);
                     if (returnInfo != "false")
                     {
                         imageItem = new ImageItem();
@@ -353,10 +355,10 @@ namespace MySystem
             //补充资料
             if (!string.IsNullOrEmpty(AddInfo.Extra1))
             {
-                var tokenInfo = JsonMapper.ToObject(HaoDaHelper.Instance.GetToken(AddInfo.Extra1.Substring(AddInfo.Extra1.LastIndexOf("/")).Trim('/'), "0"));
+                var tokenInfo = JsonMapper.ToObject(HaoDaHelper.Instance.GetToken(AddInfo.Extra1.Substring(AddInfo.Extra1.LastIndexOf("/")).Trim('/'), "0", AddInfo.BrandId));
                 if (tokenInfo["code"].ToString() == "1")
                 {
-                    var returnInfo = HaoDaHelper.Instance.ReturnFileName(tokenInfo["token"].ToString(), AddInfo.Extra1);
+                    var returnInfo = HaoDaHelper.Instance.ReturnFileName(tokenInfo["token"].ToString(), AddInfo.Extra1, AddInfo.BrandId);
                     if (returnInfo != "false")
                     {
                         imageItem = new ImageItem();

+ 12 - 12
Util/HaoDa/AddOpenDivideAccountsUtil.cs

@@ -48,10 +48,10 @@ namespace MySystem
             ImageItem imageItem = new ImageItem();
             //身份证正面
             JsonData tokenInfo = new JsonData();
-            tokenInfo = JsonMapper.ToObject(HaoDaHelper.Instance.GetToken("/static/upload/2023/8/14/1.jpg".Substring("/static/upload/2023/8/14/1.jpg".LastIndexOf("/")).Trim('/'), "0"));
+            tokenInfo = JsonMapper.ToObject(HaoDaHelper.Instance.GetToken("/static/upload/2023/8/14/1.jpg".Substring("/static/upload/2023/8/14/1.jpg".LastIndexOf("/")).Trim('/'), "0", AddInfo.BrandId));
             if (tokenInfo["code"].ToString() == "1")
             {
-                var returnInfo = HaoDaHelper.Instance.ReturnFileName(tokenInfo["token"].ToString(), "/static/upload/2023/8/14/1.jpg");
+                var returnInfo = HaoDaHelper.Instance.ReturnFileName(tokenInfo["token"].ToString(), "/static/upload/2023/8/14/1.jpg", AddInfo.BrandId);
                 if (returnInfo != "false")
                 {
                     imageItem = new ImageItem();
@@ -61,10 +61,10 @@ namespace MySystem
                 }
             }
             //身份证反面
-            tokenInfo = JsonMapper.ToObject(HaoDaHelper.Instance.GetToken("/static/upload/2023/8/14/2.jpg".Substring("/static/upload/2023/8/14/2.jpg".LastIndexOf("/")).Trim('/'), "0"));
+            tokenInfo = JsonMapper.ToObject(HaoDaHelper.Instance.GetToken("/static/upload/2023/8/14/2.jpg".Substring("/static/upload/2023/8/14/2.jpg".LastIndexOf("/")).Trim('/'), "0", AddInfo.BrandId));
             if (tokenInfo["code"].ToString() == "1")
             {
-                var returnInfo = HaoDaHelper.Instance.ReturnFileName(tokenInfo["token"].ToString(), "/static/upload/2023/8/14/2.jpg");
+                var returnInfo = HaoDaHelper.Instance.ReturnFileName(tokenInfo["token"].ToString(), "/static/upload/2023/8/14/2.jpg", AddInfo.BrandId);
                 if (returnInfo != "false")
                 {
                     imageItem = new ImageItem();
@@ -74,10 +74,10 @@ namespace MySystem
                 }
             }
             //法人手持身份证正面
-            tokenInfo = JsonMapper.ToObject(HaoDaHelper.Instance.GetToken("/static/upload/2023/8/14/3.jpg".Substring("/static/upload/2023/8/14/3.jpg".LastIndexOf("/")).Trim('/'), "0"));
+            tokenInfo = JsonMapper.ToObject(HaoDaHelper.Instance.GetToken("/static/upload/2023/8/14/3.jpg".Substring("/static/upload/2023/8/14/3.jpg".LastIndexOf("/")).Trim('/'), "0", AddInfo.BrandId));
             if (tokenInfo["code"].ToString() == "1")
             {
-                var returnInfo = HaoDaHelper.Instance.ReturnFileName(tokenInfo["token"].ToString(), "/static/upload/2023/8/14/3.jpg");
+                var returnInfo = HaoDaHelper.Instance.ReturnFileName(tokenInfo["token"].ToString(), "/static/upload/2023/8/14/3.jpg", AddInfo.BrandId);
                 if (returnInfo != "false")
                 {
                     imageItem = new ImageItem();
@@ -87,10 +87,10 @@ namespace MySystem
                 }
             }
             //结算银行卡照片
-            tokenInfo = JsonMapper.ToObject(HaoDaHelper.Instance.GetToken("/static/upload/2023/8/14/00.jpg".Substring("/static/upload/2023/8/14/00.jpg".LastIndexOf("/")).Trim('/'), "0"));
+            tokenInfo = JsonMapper.ToObject(HaoDaHelper.Instance.GetToken("/static/upload/2023/8/14/00.jpg".Substring("/static/upload/2023/8/14/00.jpg".LastIndexOf("/")).Trim('/'), "0", AddInfo.BrandId));
             if (tokenInfo["code"].ToString() == "1")
             {
-                var returnInfo = HaoDaHelper.Instance.ReturnFileName(tokenInfo["token"].ToString(), "/static/upload/2023/8/14/00.jpg");
+                var returnInfo = HaoDaHelper.Instance.ReturnFileName(tokenInfo["token"].ToString(), "/static/upload/2023/8/14/00.jpg", AddInfo.BrandId);
                 if (returnInfo != "false")
                 {
                     imageItem = new ImageItem();
@@ -100,10 +100,10 @@ namespace MySystem
                 }
             }
             //营业执照
-            tokenInfo = JsonMapper.ToObject(HaoDaHelper.Instance.GetToken("/static/upload/2023/8/14/5.jpg".Substring("/static/upload/2023/8/14/5.jpg".LastIndexOf("/")).Trim('/'), "0"));
+            tokenInfo = JsonMapper.ToObject(HaoDaHelper.Instance.GetToken("/static/upload/2023/8/14/5.jpg".Substring("/static/upload/2023/8/14/5.jpg".LastIndexOf("/")).Trim('/'), "0", AddInfo.BrandId));
             if (tokenInfo["code"].ToString() == "1")
             {
-                var returnInfo = HaoDaHelper.Instance.ReturnFileName(tokenInfo["token"].ToString(), "/static/upload/2023/8/14/5.jpg");
+                var returnInfo = HaoDaHelper.Instance.ReturnFileName(tokenInfo["token"].ToString(), "/static/upload/2023/8/14/5.jpg", AddInfo.BrandId);
                 if (returnInfo != "false")
                 {
                     imageItem = new ImageItem();
@@ -113,10 +113,10 @@ namespace MySystem
                 }
             }
             //开户许可证(对公凭证)
-            tokenInfo = JsonMapper.ToObject(HaoDaHelper.Instance.GetToken("/static/upload/2023/8/14/00.jpg".Substring("/static/upload/2023/8/14/00.jpg".LastIndexOf("/")).Trim('/'), "0"));
+            tokenInfo = JsonMapper.ToObject(HaoDaHelper.Instance.GetToken("/static/upload/2023/8/14/00.jpg".Substring("/static/upload/2023/8/14/00.jpg".LastIndexOf("/")).Trim('/'), "0", AddInfo.BrandId));
             if (tokenInfo["code"].ToString() == "1")
             {
-                var returnInfo = HaoDaHelper.Instance.ReturnFileName(tokenInfo["token"].ToString(), "/static/upload/2023/8/14/00.jpg");
+                var returnInfo = HaoDaHelper.Instance.ReturnFileName(tokenInfo["token"].ToString(), "/static/upload/2023/8/14/00.jpg", AddInfo.BrandId);
                 if (returnInfo != "false")
                 {
                     imageItem = new ImageItem();

+ 8 - 8
Util/HaoDa/ChangeMerchantCardSetUtil.cs

@@ -50,10 +50,10 @@ namespace MySystem
             // 面照片、委托结算授权书照片、法人手持委托结算授权书
             if (alterType == "0")
             {
-                var tokenInfo = JsonMapper.ToObject(HaoDaHelper.Instance.GetToken(AddInfo.BankCard.Substring(AddInfo.BankCard.LastIndexOf("/")).Trim('/'), "0"));
+                var tokenInfo = JsonMapper.ToObject(HaoDaHelper.Instance.GetToken(AddInfo.BankCard.Substring(AddInfo.BankCard.LastIndexOf("/")).Trim('/'), "0", AddInfo.BrandId));
                 if (tokenInfo["code"].ToString() == "1")
                 {
-                    var returnInfo = HaoDaHelper.Instance.ReturnFileName(tokenInfo["token"].ToString(), AddInfo.BankCard);
+                    var returnInfo = HaoDaHelper.Instance.ReturnFileName(tokenInfo["token"].ToString(), AddInfo.BankCard, AddInfo.BrandId);
                     if (returnInfo != "false")
                     {
                         photoItem = new PhotoItem();
@@ -67,10 +67,10 @@ namespace MySystem
             {
                 if (!string.IsNullOrEmpty(AddInfo.OpenAccountLicenses))
                 {
-                    var tokenInfo = JsonMapper.ToObject(HaoDaHelper.Instance.GetToken(AddInfo.BankCard.Substring(AddInfo.OpenAccountLicenses.LastIndexOf("/")).Trim('/'), "0"));
+                    var tokenInfo = JsonMapper.ToObject(HaoDaHelper.Instance.GetToken(AddInfo.BankCard.Substring(AddInfo.OpenAccountLicenses.LastIndexOf("/")).Trim('/'), "0", AddInfo.BrandId));
                     if (tokenInfo["code"].ToString() == "1")
                     {
-                        var returnInfo = HaoDaHelper.Instance.ReturnFileName(tokenInfo["token"].ToString(), AddInfo.OpenAccountLicenses);
+                        var returnInfo = HaoDaHelper.Instance.ReturnFileName(tokenInfo["token"].ToString(), AddInfo.OpenAccountLicenses, AddInfo.BrandId);
                         if (returnInfo != "false")
                         {
                             photoItem = new PhotoItem();
@@ -82,10 +82,10 @@ namespace MySystem
                 }
                 if (!string.IsNullOrEmpty(BankCard))
                 {
-                    var tokenInfo = JsonMapper.ToObject(HaoDaHelper.Instance.GetToken(AddInfo.BankCard.Substring(BankCard.LastIndexOf("/")).Trim('/'), "0"));
+                    var tokenInfo = JsonMapper.ToObject(HaoDaHelper.Instance.GetToken(AddInfo.BankCard.Substring(BankCard.LastIndexOf("/")).Trim('/'), "0", AddInfo.BrandId));
                     if (tokenInfo["code"].ToString() == "1")
                     {
-                        var returnInfo = HaoDaHelper.Instance.ReturnFileName(tokenInfo["token"].ToString(), BankCard);
+                        var returnInfo = HaoDaHelper.Instance.ReturnFileName(tokenInfo["token"].ToString(), BankCard, AddInfo.BrandId);
                         if (returnInfo != "false")
                         {
                             photoItem = new PhotoItem();
@@ -98,10 +98,10 @@ namespace MySystem
             }
             if (alterType == "2")
             {
-                var tokenInfo = JsonMapper.ToObject(HaoDaHelper.Instance.GetToken(AddInfo.BankCard.Substring(AddInfo.BankCard.LastIndexOf("/")).Trim('/'), "0"));
+                var tokenInfo = JsonMapper.ToObject(HaoDaHelper.Instance.GetToken(AddInfo.BankCard.Substring(AddInfo.BankCard.LastIndexOf("/")).Trim('/'), "0", AddInfo.BrandId));
                 if (tokenInfo["code"].ToString() == "1")
                 {
-                    var returnInfo = HaoDaHelper.Instance.ReturnFileName(tokenInfo["token"].ToString(), AddInfo.BankCard);
+                    var returnInfo = HaoDaHelper.Instance.ReturnFileName(tokenInfo["token"].ToString(), AddInfo.BankCard, AddInfo.BrandId);
                     if (returnInfo != "false")
                     {
                         photoItem = new PhotoItem();

+ 2 - 2
Util/HaoDa/CheckWeChatBindService.cs

@@ -29,7 +29,7 @@ namespace MySystem
             {
                 string CheckDate = DateTime.Now.AddMinutes(-15).ToString("yyyy-MM-dd HH:mm:ss");
                 DataTable dt = CustomerSqlConn.dtable("select Id from MerchantAddInfo where HdStatus=3 and HdBindWeChat=0 and HdPassDate<'" + CheckDate + "' and OutMchtNo!='' and OutMchtNo is not null", AppConfig.Base.SqlConnStr);
-                foreach(DataRow dr in dt.Rows)
+                foreach (DataRow dr in dt.Rows)
                 {
                     StartDo(int.Parse(function.CheckInt(dr["Id"].ToString())));
                 }
@@ -46,7 +46,7 @@ namespace MySystem
                 if (merchantadd != null)
                 {
                     //绑定微信appid接口
-                    JsonData bindInfo = JsonMapper.ToObject(HaoDaHelper.Instance.BindWeChatAppId(merchantadd.OutMchtNo, merchantadd.StoreNo, AppConfig.Haoda.SubAppId));
+                    JsonData bindInfo = JsonMapper.ToObject(HaoDaHelper.Instance.BindWeChatAppId(merchantadd.OutMchtNo, merchantadd.StoreNo, AppConfig.Haoda.SubAppId, merchantadd.BrandId));
                     //失败
                     if (bindInfo["resultCode"].ToString() == "0")
                     {

+ 12 - 9
Util/HaoDa/CheckWeChatSignService.cs

@@ -51,7 +51,7 @@ namespace MySystem
                 //     Thread.Sleep(2000);
                 // }
                 DataTable dt = CustomerSqlConn.dtable("select Id,MchtNo from MerchantAddInfo where Id in (select Id from MerchantInfo where Sort=1 and `Status`=0 and QueryCount=0) and MchtNo!='' and MchtNo is not null", AppConfig.Base.SqlConnStr);
-                foreach(DataRow dr in dt.Rows)
+                foreach (DataRow dr in dt.Rows)
                 {
                     StartDo(new QueryMerchantStatus()
                     {
@@ -70,14 +70,18 @@ namespace MySystem
             {
                 var mId = int.Parse(query.MerchantId);
                 WebCMSEntities db = new WebCMSEntities();
+                MerchantAddInfo merchantadd = db.MerchantAddInfo.FirstOrDefault(m => m.Id == mId);
+
+                var BrhCode = HaodaUnionParam.BrhCode;
+                if (merchantadd.BrandId == 1) BrhCode = HaodaParam.BrhCode;
+
                 //查询商户审核状态
-                var returnInfo = HaoDaHelper.Instance.QueryMerchantStatus(HaoDaHelper.BrhCode, query.MerchantNo);
+                var returnInfo = HaoDaHelper.Instance.QueryMerchantStatus(BrhCode, query.MerchantNo, merchantadd.BrandId);
                 JsonData dic = JsonMapper.ToObject(returnInfo);
                 //审核成功(1- 待审核 2 -审核中 3 -审核被拒绝 4 -审核通过 6 -待复核)
                 if (dic["data"]["code"].ToString() == "4" && !string.IsNullOrEmpty(dic["data"]["storeNo"].ToString()) && !string.IsNullOrEmpty(dic["data"]["outMchtNo"].ToString()))
                 {
                     //查询商户是否存在
-                    MerchantAddInfo merchantadd = db.MerchantAddInfo.FirstOrDefault(m => m.Id == mId);
                     if (merchantadd != null)
                     {
                         // merchantadd.Status = 1;
@@ -90,7 +94,7 @@ namespace MySystem
                             merchant.Status = 1;
                         }
                         //商户开通分账
-                        JsonData Info = JsonMapper.ToObject(HaoDaHelper.Instance.OpenDivideAccounts(merchantadd.OutMchtNo, merchantadd.StoreNo));
+                        JsonData Info = JsonMapper.ToObject(HaoDaHelper.Instance.OpenDivideAccounts(merchantadd.OutMchtNo, merchantadd.StoreNo, merchantadd.BrandId));
                         //开通失败
                         if (Info["resultCode"].ToString() == "0")
                         {
@@ -103,7 +107,7 @@ namespace MySystem
                             merchantadd.OpenAct = 1;//是否开通分账(1 是 0 否)
                             merchantadd.HdStatus = 2; //0 待审核 1 已通过 2 已开通分账 3 已添加接收方
                             //分账接收方签约
-                            JsonData Infos = JsonMapper.ToObject(HaoDaHelper.Instance.DivideAccountsSign(AppConfig.Haoda.AcctNo, merchantadd.OutMchtNo, merchantadd.StoreNo));
+                            JsonData Infos = JsonMapper.ToObject(HaoDaHelper.Instance.DivideAccountsSign(AppConfig.Haoda.AcctNo, merchantadd.OutMchtNo, merchantadd.StoreNo, merchantadd.BrandId));
                             //失败
                             if (Infos["resultCode"].ToString() == "0")
                             {
@@ -166,19 +170,18 @@ namespace MySystem
                 //审核被拒绝
                 else if (dic["data"]["code"].ToString() == "3")
                 {
-                    MerchantAddInfo merchantadd = db.MerchantAddInfo.FirstOrDefault(m => m.Id == mId);
                     if (merchantadd != null)
                     {
                         string WeChatRemark = dic["data"]["option"].ToString();
-                        if(WeChatRemark.Contains("租赁协议") && WeChatRemark.Contains("水电煤") && WeChatRemark.Contains("门头合影") && WeChatRemark.Contains("下载地址"))
+                        if (WeChatRemark.Contains("租赁协议") && WeChatRemark.Contains("水电煤") && WeChatRemark.Contains("门头合影") && WeChatRemark.Contains("下载地址"))
                         {
                             WeChatRemark = "门头不一致需补充 “名称不一致说明函”";
                         }
-                        if(WeChatRemark.Contains("盒伙人在门头合影"))
+                        if (WeChatRemark.Contains("盒伙人在门头合影"))
                         {
                             WeChatRemark = "门头不一致需补充 “名称不一致说明函”";
                         }
-                        if(WeChatRemark.Contains("不支持跨商户进件"))
+                        if (WeChatRemark.Contains("不支持跨商户进件"))
                         {
                             WeChatRemark = "该商户已注册,错误指令【404】";
                         }

+ 5 - 3
Util/HaoDa/GetStoreNoHelper.cs

@@ -55,9 +55,11 @@ namespace MySystem
                 MerchantInfo merInfo = db.MerchantInfo.FirstOrDefault(m => m.Id == Id) ?? new MerchantInfo();
                 if (string.IsNullOrEmpty(AddInfo.StoreNo) && string.IsNullOrEmpty(AddInfo.OutMchtNo))
                 {
+                    var BrhCode = HaodaUnionParam.BrhCode;
+                    if (AddInfo.BrandId == 1) BrhCode = HaodaParam.BrhCode;
 
                     //查询商户审核状态
-                    var returnInfo = HaoDaHelper.Instance.QueryMerchantStatus(HaoDaHelper.BrhCode, AddInfo.MchtNo);
+                    var returnInfo = HaoDaHelper.Instance.QueryMerchantStatus(BrhCode, AddInfo.MchtNo, AddInfo.BrandId);
                     var check = false;
                     JsonData jsonObj = JsonMapper.ToObject(returnInfo);
                     if (jsonObj["resultCode"].ToString() == "1")
@@ -73,7 +75,7 @@ namespace MySystem
                         }
 
                         //查询实名认证状态
-                        var result = HaoDaHelper.Instance.QueryAuthStatus(AddInfo.OutMchtNo, AddInfo.StoreNo);
+                        var result = HaoDaHelper.Instance.QueryAuthStatus(AddInfo.OutMchtNo, AddInfo.StoreNo, AddInfo.BrandId);
                         JsonData jsonData = JsonMapper.ToObject(result);
 
                         if (jsonData["resultCode"].ToString() == "1")
@@ -90,7 +92,7 @@ namespace MySystem
                             check = true;
                         }
                     }
-                    
+
                     if (check)
                     {
                         AddInfo.Status = 0;

+ 4 - 4
Util/HaoDa/HaoDaAuthQueryHelper.cs

@@ -30,7 +30,7 @@ public class HaoDaAuthQueryHelper
         while (true)
         {
             DataTable dt = CustomerSqlConn.dtable("select Id,OutMchtNo,StoreNo from MerchantAddInfo where HdStatus=3 and OutMchtNo is not null and StoreNo is not null and ((`Status`=1 and WeChatMerchantId is null) or (`QueryCount`=1 and AliMerchantId is null)) order by Id desc", AppConfig.Base.SqlConnStr);
-            foreach(DataRow dr in dt.Rows)
+            foreach (DataRow dr in dt.Rows)
             {
                 QueryAuthStatus(dr["Id"].ToString(), dr["OutMchtNo"].ToString(), dr["StoreNo"].ToString());
                 Thread.Sleep(2000);
@@ -44,12 +44,12 @@ public class HaoDaAuthQueryHelper
         try
         {
             var Id = int.Parse(MerchantId);
-            var jsonObj = JsonMapper.ToObject(HaoDaHelper.Instance.QueryAuthStatus(MchtNo, StoreNo));
+            WebCMSEntities db = new WebCMSEntities();
+            MerchantAddInfo info = db.MerchantAddInfo.FirstOrDefault(m => m.Id == Id) ?? new MerchantAddInfo();
+            var jsonObj = JsonMapper.ToObject(HaoDaHelper.Instance.QueryAuthStatus(MchtNo, StoreNo, info.BrandId));
             //成功(已认证)
             if (jsonObj["resultCode"].ToString() == "1")
             {
-                WebCMSEntities db = new WebCMSEntities();
-                MerchantAddInfo info = db.MerchantAddInfo.FirstOrDefault(m => m.Id == Id) ?? new MerchantAddInfo();
                 // MerchantInfo merchant = db.MerchantInfo.FirstOrDefault(m => m.Id == Id) ?? new MerchantInfo();
                 var wxcheck = jsonObj["wechatVerifyState"].ToString();
                 var alicheck = jsonObj["aliVerifyState"].ToString();

+ 136 - 53
Util/HaoDa/HaoDaHelper.cs

@@ -32,11 +32,11 @@ namespace MySystem
         // string BrhCode = "001040";
 
         //生产环境
-        string BoxRequestUrl = "https://openapi.iboxpay.com";
-        string BoxAppId = "AP7175619323825451008";
-        string BoxAppSecret = "hUfR53gdjyfiZTBR5bILanMqRD1dXD7y";
-        string BoxPublicKey = "";
-        public static string BrhCode = "030145";
+        // string BoxRequestUrl = "https://openapi.iboxpay.com";
+        // string BoxAppId = "AP7175619323825451008";
+        // string BoxAppSecret = "hUfR53gdjyfiZTBR5bILanMqRD1dXD7y";
+        // string BoxPublicKey = "";
+        // public static string BrhCode = "030145";
 
         // string BoxRequestUrl = "https://openapi.iboxpay.com";
         // string BoxAppId = "AP8322645764893728768";
@@ -50,15 +50,21 @@ namespace MySystem
         /// </summary>
         /// <param name="request"></param>
         /// <returns></returns>
-        public string AddNewMerchant(AddNewMerchant request)
+        public string AddNewMerchant(AddNewMerchant request, int BrandId = 0)
         {
-            request.brh = BrhCode;
-            // request.oprInvitedCode = "T1715836";
+            var BoxRequestUrl = HaodaUnionParam.BoxRequestUrl;
+            if (BrandId == 1)
+            {
+                BoxRequestUrl = HaodaParam.BoxRequestUrl;
+                request.oprInvitedCode = "T1715836";
+            }
+
+            // request.brh = BrhCode;
             LogHelper.Instance.WriteLog(DateTime.Now.ToString(), "好哒新创建商户");
 
             string req = Newtonsoft.Json.JsonConvert.SerializeObject(request);
             LogHelper.Instance.WriteLog(req, "好哒新创建商户");
-            Dictionary<string, string> headdic = GetHeader(req);
+            Dictionary<string, string> headdic = GetHeader(req, BrandId);
             string head = Newtonsoft.Json.JsonConvert.SerializeObject(headdic);
             LogHelper.Instance.WriteLog("请求头\n" + head, "好哒新创建商户");
             LogHelper.Instance.WriteLog("请求参数\n" + req, "好哒新创建商户");
@@ -75,8 +81,11 @@ namespace MySystem
         /// <param name="instId">机构编号</param>
         /// <param name="mchtNo">收款商户号</param>
         /// <returns></returns>
-        public string QueryMerchantStatus(string instId, string mchtNo)
+        public string QueryMerchantStatus(string instId, string mchtNo, int BrandId = 0)
         {
+            var BoxRequestUrl = HaodaUnionParam.BoxRequestUrl;
+            if (BrandId == 1) BoxRequestUrl = HaodaParam.BoxRequestUrl;
+
             LogHelper.Instance.WriteLog(DateTime.Now.ToString(), "好哒查询商户审核状态");
             Dictionary<string, object> reqdic = new Dictionary<string, object>();
             reqdic.Add("instId", instId);
@@ -84,7 +93,7 @@ namespace MySystem
 
             string req = Newtonsoft.Json.JsonConvert.SerializeObject(reqdic);
             LogHelper.Instance.WriteLog(req, "好哒查询商户审核状态");
-            Dictionary<string, string> headdic = GetHeader(req);
+            Dictionary<string, string> headdic = GetHeader(req, BrandId);
             string head = Newtonsoft.Json.JsonConvert.SerializeObject(headdic);
             LogHelper.Instance.WriteLog("请求头\n" + head, "好哒查询商户审核状态");
             LogHelper.Instance.WriteLog("请求参数\n" + req, "好哒查询商户审核状态");
@@ -101,15 +110,18 @@ namespace MySystem
         /// <param name="mchtNo">慧掌柜商户号</param>
         /// <param name="storeNo">慧掌柜门店号</param>
         /// <returns></returns>
-        public string QueryAuthStatus(string mchtNo, string storeNo)
+        public string QueryAuthStatus(string mchtNo, string storeNo, int BrandId = 0)
         {
+            var BoxRequestUrl = HaodaUnionParam.BoxRequestUrl;
+            if (BrandId == 1) BoxRequestUrl = HaodaParam.BoxRequestUrl;
+
             LogHelper.Instance.WriteLog(DateTime.Now.ToString(), "好哒查询实名认证状态");
             Dictionary<string, object> reqdic = new Dictionary<string, object>();
             reqdic.Add("mchtNo", mchtNo); // 慧掌柜商户号
             reqdic.Add("storeNo", storeNo); // 慧掌柜门店号
             string req = Newtonsoft.Json.JsonConvert.SerializeObject(reqdic);
             LogHelper.Instance.WriteLog(req, "好哒查询实名认证状态");
-            Dictionary<string, string> headdic = GetHeader(req);
+            Dictionary<string, string> headdic = GetHeader(req, BrandId);
             string head = Newtonsoft.Json.JsonConvert.SerializeObject(headdic);
             LogHelper.Instance.WriteLog("请求头\n" + head, "好哒查询实名认证状态");
             LogHelper.Instance.WriteLog("请求参数\n" + req, "好哒查询实名认证状态");
@@ -126,15 +138,18 @@ namespace MySystem
         /// <param name="mchtNo">慧掌柜商户号</param>
         /// <param name="storeNo">慧掌柜门店号</param>
         /// <returns></returns>
-        public string QueryAuthQRcode(string mchtNo, string storeNo)
+        public string QueryAuthQRcode(string mchtNo, string storeNo, int BrandId = 0)
         {
+            var BoxRequestUrl = HaodaUnionParam.BoxRequestUrl;
+            if (BrandId == 1) BoxRequestUrl = HaodaParam.BoxRequestUrl;
+
             LogHelper.Instance.WriteLog(DateTime.Now.ToString(), "好哒查询实名认证二维码");
             Dictionary<string, object> reqdic = new Dictionary<string, object>();
             reqdic.Add("mchtNo", mchtNo); // 慧掌柜商户号
             reqdic.Add("storeNo", storeNo); // 慧掌柜门店号
             string req = Newtonsoft.Json.JsonConvert.SerializeObject(reqdic);
             LogHelper.Instance.WriteLog(req, "好哒查询实名认证二维码");
-            Dictionary<string, string> headdic = GetHeader(req);
+            Dictionary<string, string> headdic = GetHeader(req, BrandId);
             string head = Newtonsoft.Json.JsonConvert.SerializeObject(headdic);
             LogHelper.Instance.WriteLog("请求头\n" + head, "好哒查询实名认证二维码");
             LogHelper.Instance.WriteLog("请求参数\n" + req, "好哒查询实名认证二维码");
@@ -159,8 +174,11 @@ namespace MySystem
         /// <param name="subAppIdType">对应的类型,默认为公众号, SUBSCRIPTION: 公众号 MINI_PROGRAM: 小程序</param>
         /// <param name="ledgerModel">分账类型:1不分账 2分账,注意只有开通了分账才能传这个字段</param>
         /// <returns></returns>
-        public string WeChatPay(string mchtNo, string storeNo, string outOrderNo, string transAmount, string callbackUrl, string subOpenId, string confirmCode, string subAppId, string subAppIdType, string ledgerModel)
+        public string WeChatPay(string mchtNo, string storeNo, string outOrderNo, string transAmount, string callbackUrl, string subOpenId, string confirmCode, string subAppId, string subAppIdType, string ledgerModel, int BrandId = 0)
         {
+            var BoxRequestUrl = HaodaUnionParam.BoxRequestUrl;
+            if (BrandId == 1) BoxRequestUrl = HaodaParam.BoxRequestUrl;
+
             LogHelper.Instance.WriteLog(DateTime.Now.ToString(), "好哒微信公众号和小程序支付");
             Dictionary<string, object> reqdic = new Dictionary<string, object>();
             reqdic.Add("mchtNo", mchtNo); //盒子的商户编号
@@ -176,7 +194,7 @@ namespace MySystem
 
             string req = Newtonsoft.Json.JsonConvert.SerializeObject(reqdic);
             LogHelper.Instance.WriteLog(req, "好哒微信公众号和小程序支付");
-            Dictionary<string, string> headdic = GetHeader(req);
+            Dictionary<string, string> headdic = GetHeader(req, BrandId);
             string head = Newtonsoft.Json.JsonConvert.SerializeObject(headdic);
             LogHelper.Instance.WriteLog("请求头\n" + head, "好哒微信公众号和小程序支付");
             LogHelper.Instance.WriteLog("请求参数\n" + req, "好哒微信公众号和小程序支付");
@@ -198,8 +216,11 @@ namespace MySystem
         /// <param name="subOpenId">支付宝用户标识</param>
         /// <param name="confirmCode">支付确认码,由4位纯数字组成,每次请求时随机生成</param>
         /// <returns></returns>
-        public string Alipay(string mchtNo, string storeNo, string outOrderNo, string transAmount, string callbackUrl, string subOpenId, string confirmCode)
+        public string Alipay(string mchtNo, string storeNo, string outOrderNo, string transAmount, string callbackUrl, string subOpenId, string confirmCode, int BrandId = 0)
         {
+            var BoxRequestUrl = HaodaUnionParam.BoxRequestUrl;
+            if (BrandId == 1) BoxRequestUrl = HaodaParam.BoxRequestUrl;
+
             LogHelper.Instance.WriteLog(DateTime.Now.ToString(), "好哒支付宝服务窗支付");
             Dictionary<string, object> reqdic = new Dictionary<string, object>();
             reqdic.Add("mchtNo", mchtNo); //盒子的商户编号
@@ -212,7 +233,7 @@ namespace MySystem
 
             string req = Newtonsoft.Json.JsonConvert.SerializeObject(reqdic);
             LogHelper.Instance.WriteLog(req, "好哒支付宝服务窗支付");
-            Dictionary<string, string> headdic = GetHeader(req);
+            Dictionary<string, string> headdic = GetHeader(req, BrandId);
             string head = Newtonsoft.Json.JsonConvert.SerializeObject(headdic);
             LogHelper.Instance.WriteLog("请求头\n" + head, "好哒支付宝服务窗支付");
             LogHelper.Instance.WriteLog("请求参数\n" + req, "好哒支付宝服务窗支付");
@@ -232,8 +253,11 @@ namespace MySystem
         /// <param name="outOrderNo">商户支付订单号</param>
         /// <param name="refundAmount">退款金额,单位:分</param>
         /// <returns></returns>
-        public string AggregatedPayRefund(string mchtNo, string storeNo, string outRefundNo, string outOrderNo, string refundAmount)
+        public string AggregatedPayRefund(string mchtNo, string storeNo, string outRefundNo, string outOrderNo, string refundAmount, int BrandId = 0)
         {
+            var BoxRequestUrl = HaodaUnionParam.BoxRequestUrl;
+            if (BrandId == 1) BoxRequestUrl = HaodaParam.BoxRequestUrl;
+
             LogHelper.Instance.WriteLog(DateTime.Now.ToString(), "好哒聚合支付退款");
             Dictionary<string, object> reqdic = new Dictionary<string, object>();
 
@@ -246,7 +270,7 @@ namespace MySystem
 
             string req = Newtonsoft.Json.JsonConvert.SerializeObject(reqdic);
             LogHelper.Instance.WriteLog(req, "好哒聚合支付退款");
-            Dictionary<string, string> headdic = GetHeader(req);
+            Dictionary<string, string> headdic = GetHeader(req, BrandId);
             string head = Newtonsoft.Json.JsonConvert.SerializeObject(headdic);
             LogHelper.Instance.WriteLog("请求头\n" + head, "好哒聚合支付退款");
             LogHelper.Instance.WriteLog("请求参数\n" + req, "好哒聚合支付退款");
@@ -263,8 +287,11 @@ namespace MySystem
         /// <param name="mchtNo">慧掌柜商户号(进件接口返回的outMchtNo字段)</param>
         /// <param name="storeNo">慧掌柜门店号</param>
         /// <returns></returns>
-        public string OpenDivideAccounts(string mchtNo, string storeNo)
+        public string OpenDivideAccounts(string mchtNo, string storeNo, int BrandId = 0)
         {
+            var BoxRequestUrl = HaodaUnionParam.BoxRequestUrl;
+            if (BrandId == 1) BoxRequestUrl = HaodaParam.BoxRequestUrl;
+
             LogHelper.Instance.WriteLog(DateTime.Now.ToString(), "好哒开通分账");
             Dictionary<string, object> reqdic = new Dictionary<string, object>();
 
@@ -273,7 +300,7 @@ namespace MySystem
 
             string req = Newtonsoft.Json.JsonConvert.SerializeObject(reqdic);
             LogHelper.Instance.WriteLog(req, "好哒开通分账");
-            Dictionary<string, string> headdic = GetHeader(req);
+            Dictionary<string, string> headdic = GetHeader(req, BrandId);
             string head = Newtonsoft.Json.JsonConvert.SerializeObject(headdic);
             LogHelper.Instance.WriteLog("请求头\n" + head, "好哒开通分账");
             LogHelper.Instance.WriteLog("请求参数\n" + req, "好哒开通分账");
@@ -291,8 +318,11 @@ namespace MySystem
         /// <param name="mchtNo">慧掌柜商户号</param>
         /// <param name="storeNo">慧掌柜门店号</param>
         /// <returns></returns>
-        public string DivideAccountsSign(string acctNo, string mchtNo, string storeNo)
+        public string DivideAccountsSign(string acctNo, string mchtNo, string storeNo, int BrandId = 0)
         {
+            var BoxRequestUrl = HaodaUnionParam.BoxRequestUrl;
+            if (BrandId == 1) BoxRequestUrl = HaodaParam.BoxRequestUrl;
+
             LogHelper.Instance.WriteLog(DateTime.Now.ToString(), "好哒分账接收方签约");
             Dictionary<string, object> reqdic = new Dictionary<string, object>();
             reqdic.Add("acctNo", acctNo); // 账户号	
@@ -300,7 +330,7 @@ namespace MySystem
             reqdic.Add("storeNo", storeNo); // 慧掌柜门店号
             string req = Newtonsoft.Json.JsonConvert.SerializeObject(reqdic);
             LogHelper.Instance.WriteLog(req, "好哒分账接收方签约");
-            Dictionary<string, string> headdic = GetHeader(req);
+            Dictionary<string, string> headdic = GetHeader(req, BrandId);
             string head = Newtonsoft.Json.JsonConvert.SerializeObject(headdic);
             LogHelper.Instance.WriteLog("请求头\n" + head, "好哒分账接收方签约");
             LogHelper.Instance.WriteLog("请求参数\n" + req, "好哒分账接收方签约");
@@ -316,13 +346,16 @@ namespace MySystem
         /// </summary>
         /// <param name="request"></param>
         /// <returns></returns>
-        public string AddOpenDivideAccounts(AddOpenDivideAccounts request)
+        public string AddOpenDivideAccounts(AddOpenDivideAccounts request, int BrandId = 0)
         {
+            var BoxRequestUrl = HaodaUnionParam.BoxRequestUrl;
+            if (BrandId == 1) BoxRequestUrl = HaodaParam.BoxRequestUrl;
+
             LogHelper.Instance.WriteLog(DateTime.Now.ToString(), "好哒添加分账接收方账户");
 
             string req = Newtonsoft.Json.JsonConvert.SerializeObject(request);
             LogHelper.Instance.WriteLog(req, "好哒添加分账接收方账户");
-            Dictionary<string, string> headdic = GetHeader(req);
+            Dictionary<string, string> headdic = GetHeader(req, BrandId);
             string head = Newtonsoft.Json.JsonConvert.SerializeObject(headdic);
             LogHelper.Instance.WriteLog("请求头\n" + head, "好哒添加分账接收方账户");
             LogHelper.Instance.WriteLog("请求参数\n" + req, "好哒添加分账接收方账户");
@@ -339,15 +372,18 @@ namespace MySystem
         /// <param name="mchtNo">慧掌柜商户号</param>
         /// <param name="orderNo">交易订单号	</param>
         /// <returns></returns>
-        public string QueryOrderDivideAccounts(string mchtNo, string orderNo)
+        public string QueryOrderDivideAccounts(string mchtNo, string orderNo, int BrandId = 0)
         {
+            var BoxRequestUrl = HaodaUnionParam.BoxRequestUrl;
+            if (BrandId == 1) BoxRequestUrl = HaodaParam.BoxRequestUrl;
+
             LogHelper.Instance.WriteLog(DateTime.Now.ToString(), "好哒分账交易详情查询");
             Dictionary<string, object> reqdic = new Dictionary<string, object>();
             reqdic.Add("mchtNo", mchtNo); // 慧掌柜商户号
             reqdic.Add("orderNo", orderNo); // 交易订单号	
             string req = Newtonsoft.Json.JsonConvert.SerializeObject(reqdic);
             LogHelper.Instance.WriteLog(req, "好哒分账交易详情查询");
-            Dictionary<string, string> headdic = GetHeader(req);
+            Dictionary<string, string> headdic = GetHeader(req, BrandId);
             string head = Newtonsoft.Json.JsonConvert.SerializeObject(headdic);
             LogHelper.Instance.WriteLog("请求头\n" + head, "好哒分账交易详情查询");
             LogHelper.Instance.WriteLog("请求参数\n" + req, "好哒分账交易详情查询");
@@ -364,13 +400,16 @@ namespace MySystem
         /// <param name="request"></param>
         /// <returns></returns>
         /// 
-        public string OrderDivideAccounts(OrderDivideAccounts request)
+        public string OrderDivideAccounts(OrderDivideAccounts request, int BrandId = 0)
         {
+            var BoxRequestUrl = HaodaUnionParam.BoxRequestUrl;
+            if (BrandId == 1) BoxRequestUrl = HaodaParam.BoxRequestUrl;
+
             LogHelper.Instance.WriteLog(DateTime.Now.ToString(), "好哒订单分账申请");
 
             string req = Newtonsoft.Json.JsonConvert.SerializeObject(request);
             LogHelper.Instance.WriteLog(req, "好哒订单分账申请");
-            Dictionary<string, string> headdic = GetHeader(req);
+            Dictionary<string, string> headdic = GetHeader(req, BrandId);
             string head = Newtonsoft.Json.JsonConvert.SerializeObject(headdic);
             LogHelper.Instance.WriteLog("请求头\n" + head, "好哒订单分账申请");
             LogHelper.Instance.WriteLog("请求参数\n" + req, "好哒订单分账申请");
@@ -387,15 +426,18 @@ namespace MySystem
         /// <param name="applyNo">分账批次号</param>
         /// <param name="mchtNo">慧掌柜商户号</param>
         /// <returns></returns>
-        public string OrderDivideAccountsQuery(string applyNo, string mchtNo)
+        public string OrderDivideAccountsQuery(string applyNo, string mchtNo, int BrandId = 0)
         {
+            var BoxRequestUrl = HaodaUnionParam.BoxRequestUrl;
+            if (BrandId == 1) BoxRequestUrl = HaodaParam.BoxRequestUrl;
+
             LogHelper.Instance.WriteLog(DateTime.Now.ToString(), "好哒订单分账结果查询");
             Dictionary<string, object> reqdic = new Dictionary<string, object>();
             reqdic.Add("applyNo", applyNo); // 账户号	
             reqdic.Add("mchtNo", mchtNo); // 慧掌柜商户号
             string req = Newtonsoft.Json.JsonConvert.SerializeObject(reqdic);
             LogHelper.Instance.WriteLog(req, "好哒订单分账结果查询");
-            Dictionary<string, string> headdic = GetHeader(req);
+            Dictionary<string, string> headdic = GetHeader(req, BrandId);
             string head = Newtonsoft.Json.JsonConvert.SerializeObject(headdic);
             LogHelper.Instance.WriteLog("请求头\n" + head, "好哒订单分账结果查询");
             LogHelper.Instance.WriteLog("请求参数\n" + req, "好哒订单分账结果查询");
@@ -411,13 +453,16 @@ namespace MySystem
         /// </summary>
         /// <param name="request"></param>
         /// <returns></returns>
-        public string ChangeMerchantCard(ChangeMerchantCard request)
+        public string ChangeMerchantCard(ChangeMerchantCard request, int BrandId = 0)
         {
+            var BoxRequestUrl = HaodaUnionParam.BoxRequestUrl;
+            if (BrandId == 1) BoxRequestUrl = HaodaParam.BoxRequestUrl;
+
             LogHelper.Instance.WriteLog(DateTime.Now.ToString(), "好哒商户修改银行卡");
 
             string req = Newtonsoft.Json.JsonConvert.SerializeObject(request);
             LogHelper.Instance.WriteLog(req, "好哒商户修改银行卡");
-            Dictionary<string, string> headdic = GetHeader(req);
+            Dictionary<string, string> headdic = GetHeader(req, BrandId);
             string head = Newtonsoft.Json.JsonConvert.SerializeObject(headdic);
             LogHelper.Instance.WriteLog("请求头\n" + head, "好哒商户修改银行卡");
             LogHelper.Instance.WriteLog("请求参数\n" + req, "好哒商户修改银行卡");
@@ -434,8 +479,11 @@ namespace MySystem
         /// <param name="mchtNo">收款商户号</param>
         /// <param name="taskId">任务id</param>
         /// <returns></returns>
-        public string QueryChangeCardStatus(string mchtNo, string taskId)
+        public string QueryChangeCardStatus(string mchtNo, string taskId, int BrandId = 0)
         {
+            var BoxRequestUrl = HaodaUnionParam.BoxRequestUrl;
+            if (BrandId == 1) BoxRequestUrl = HaodaParam.BoxRequestUrl;
+
             LogHelper.Instance.WriteLog(DateTime.Now.ToString(), "好哒查询修改银行卡任务审核状态");
             Dictionary<string, object> reqdic = new Dictionary<string, object>();
             reqdic.Add("mchtNo", mchtNo);
@@ -443,7 +491,7 @@ namespace MySystem
 
             string req = Newtonsoft.Json.JsonConvert.SerializeObject(reqdic);
             LogHelper.Instance.WriteLog(req, "好哒查询修改银行卡任务审核状态");
-            Dictionary<string, string> headdic = GetHeader(req);
+            Dictionary<string, string> headdic = GetHeader(req, BrandId);
             string head = Newtonsoft.Json.JsonConvert.SerializeObject(headdic);
             LogHelper.Instance.WriteLog("请求头\n" + head, "好哒查询修改银行卡任务审核状态");
             LogHelper.Instance.WriteLog("请求参数\n" + req, "好哒查询修改银行卡任务审核状态");
@@ -462,8 +510,11 @@ namespace MySystem
         /// <param name="storeNo">盒子的门店编号</param>
         /// <param name="subAppId">公众号appid或者小程序appid</param>
         /// <returns></returns>
-        public string BindWeChatAppId(string mchtNo, string storeNo, string subAppId)
+        public string BindWeChatAppId(string mchtNo, string storeNo, string subAppId, int BrandId = 0)
         {
+            var BoxRequestUrl = HaodaUnionParam.BoxRequestUrl;
+            if (BrandId == 1) BoxRequestUrl = HaodaParam.BoxRequestUrl;
+
             LogHelper.Instance.WriteLog(DateTime.Now.ToString(), "好哒绑定微信appid接口");
             Dictionary<string, object> reqdic = new Dictionary<string, object>();
 
@@ -473,7 +524,7 @@ namespace MySystem
 
             string req = Newtonsoft.Json.JsonConvert.SerializeObject(reqdic);
             LogHelper.Instance.WriteLog(req, "好哒绑定微信appid接口");
-            Dictionary<string, string> headdic = GetHeader(req);
+            Dictionary<string, string> headdic = GetHeader(req, BrandId);
             string head = Newtonsoft.Json.JsonConvert.SerializeObject(headdic);
             LogHelper.Instance.WriteLog("请求头\n" + head, "好哒绑定微信appid接口");
             LogHelper.Instance.WriteLog("请求参数\n" + req, "好哒绑定微信appid接口");
@@ -496,8 +547,11 @@ namespace MySystem
         /// <param name="page">当前页数,默认1</param>
         /// <param name="rows">每页大小,默认10,最大500</param>
         /// <returns></returns>
-        public string QueryAccountList(string mchtNo, string startTime, string endTime, string tradeMchtNo, string cardNo, string settleStatus, string page = "1", string rows = "10")
+        public string QueryAccountList(string mchtNo, string startTime, string endTime, string tradeMchtNo, string cardNo, string settleStatus, string page = "1", string rows = "10", int BrandId = 0)
         {
+            var BoxRequestUrl = HaodaUnionParam.BoxRequestUrl;
+            if (BrandId == 1) BoxRequestUrl = HaodaParam.BoxRequestUrl;
+
             LogHelper.Instance.WriteLog(DateTime.Now.ToString(), "好哒到账记录查询");
             Dictionary<string, object> reqdic = new Dictionary<string, object>();
 
@@ -512,7 +566,7 @@ namespace MySystem
 
             string req = Newtonsoft.Json.JsonConvert.SerializeObject(reqdic);
             LogHelper.Instance.WriteLog(req, "好哒到账记录查询");
-            Dictionary<string, string> headdic = GetHeader(req);
+            Dictionary<string, string> headdic = GetHeader(req, BrandId);
             string head = Newtonsoft.Json.JsonConvert.SerializeObject(headdic);
             LogHelper.Instance.WriteLog("请求头\n" + head, "好哒到账记录查询");
             LogHelper.Instance.WriteLog("请求参数\n" + req, "好哒到账记录查询");
@@ -529,8 +583,11 @@ namespace MySystem
         /// <param name="mchtNo">商户号</param>
         /// <param name="id"></param>
         /// <returns></returns>
-        public string QueryAccountDetail(string mchtNo, string id)
+        public string QueryAccountDetail(string mchtNo, string id, int BrandId = 0)
         {
+            var BoxRequestUrl = HaodaUnionParam.BoxRequestUrl;
+            if (BrandId == 1) BoxRequestUrl = HaodaParam.BoxRequestUrl;
+
             LogHelper.Instance.WriteLog(DateTime.Now.ToString(), "好哒到账记录详情");
             Dictionary<string, object> reqdic = new Dictionary<string, object>();
 
@@ -539,7 +596,7 @@ namespace MySystem
 
             string req = Newtonsoft.Json.JsonConvert.SerializeObject(reqdic);
             LogHelper.Instance.WriteLog(req, "好哒到账记录详情");
-            Dictionary<string, string> headdic = GetHeader(req);
+            Dictionary<string, string> headdic = GetHeader(req, BrandId);
             string head = Newtonsoft.Json.JsonConvert.SerializeObject(headdic);
             LogHelper.Instance.WriteLog("请求头\n" + head, "好哒到账记录详情");
             LogHelper.Instance.WriteLog("请求参数\n" + req, "好哒到账记录详情");
@@ -556,8 +613,11 @@ namespace MySystem
         /// <param name="mchtNo">商户号</param>
         /// <param name="outOrderNo">商户订单号</param>
         /// <returns></returns>
-        public string QueryTradeDetail(string mchtNo, string outOrderNo)
+        public string QueryTradeDetail(string mchtNo, string outOrderNo, int BrandId = 0)
         {
+            var BoxRequestUrl = HaodaUnionParam.BoxRequestUrl;
+            if (BrandId == 1) BoxRequestUrl = HaodaParam.BoxRequestUrl;
+
             LogHelper.Instance.WriteLog(DateTime.Now.ToString(), "好哒聚合支付查询");
             Dictionary<string, object> reqdic = new Dictionary<string, object>();
 
@@ -566,7 +626,7 @@ namespace MySystem
 
             string req = Newtonsoft.Json.JsonConvert.SerializeObject(reqdic);
             LogHelper.Instance.WriteLog(req, "好哒聚合支付查询");
-            Dictionary<string, string> headdic = GetHeader(req);
+            Dictionary<string, string> headdic = GetHeader(req, BrandId);
             string head = Newtonsoft.Json.JsonConvert.SerializeObject(headdic);
             LogHelper.Instance.WriteLog("请求头\n" + head, "好哒聚合支付查询");
             LogHelper.Instance.WriteLog("请求参数\n" + req, "好哒聚合支付查询");
@@ -584,8 +644,11 @@ namespace MySystem
         /// <param name="storeNo">门店编号</param>
         /// <param name="outRefundNo">退款订单号</param>
         /// <returns></returns>
-        public string QueryRefundDetail(string mchtNo, string storeNo, string outRefundNo)
+        public string QueryRefundDetail(string mchtNo, string storeNo, string outRefundNo, int BrandId = 0)
         {
+            var BoxRequestUrl = HaodaUnionParam.BoxRequestUrl;
+            if (BrandId == 1) BoxRequestUrl = HaodaParam.BoxRequestUrl;
+
             LogHelper.Instance.WriteLog(DateTime.Now.ToString(), "好哒退款查询");
             Dictionary<string, object> reqdic = new Dictionary<string, object>();
 
@@ -595,7 +658,7 @@ namespace MySystem
 
             string req = Newtonsoft.Json.JsonConvert.SerializeObject(reqdic);
             LogHelper.Instance.WriteLog(req, "好哒退款查询");
-            Dictionary<string, string> headdic = GetHeader(req);
+            Dictionary<string, string> headdic = GetHeader(req, BrandId);
             string head = Newtonsoft.Json.JsonConvert.SerializeObject(headdic);
             LogHelper.Instance.WriteLog("请求头\n" + head, "好哒退款查询");
             LogHelper.Instance.WriteLog("请求参数\n" + req, "好哒退款查询");
@@ -606,8 +669,16 @@ namespace MySystem
             return result;
         }
 
-        public Dictionary<string, string> GetHeader(string req)
+        public Dictionary<string, string> GetHeader(string req, int BrandId = 0)
         {
+            var BoxAppId = HaodaUnionParam.BoxAppId;
+            var BoxAppSecret = HaodaUnionParam.BoxAppSecret;
+            if (BrandId == 1)
+            {
+                BoxAppId = HaodaParam.BoxAppId;
+                BoxAppSecret = HaodaParam.BoxAppSecret;
+            }
+
             Dictionary<string, string> headdic = new Dictionary<string, string>();
             string timestamp = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
             // headdic.Add("appid", BoxAppId);//开发者id
@@ -628,8 +699,11 @@ namespace MySystem
             return sign;
         }
 
-        public bool VerifySign(string toSignStr, string signStr)
+        public bool VerifySign(string toSignStr, string signStr, int BrandId = 0)
         {
+            var BoxPublicKey = HaodaUnionParam.BoxPublicKey;
+            if (BrandId == 1) BoxPublicKey = HaodaParam.BoxPublicKey;
+
             byte[] toSignByte = Encoding.Default.GetBytes(toSignStr);
             byte[] signByte = Convert.FromBase64String(signStr);
             var toKey = Convert.FromBase64String(BoxPublicKey);
@@ -645,8 +719,11 @@ namespace MySystem
             }
         }
 
-        public string SignData(string toSignStr)
+        public string SignData(string toSignStr, int BrandId = 0)
         {
+            var BoxPublicKey = HaodaUnionParam.BoxPublicKey;
+            if (BrandId == 1) BoxPublicKey = HaodaParam.BoxPublicKey;
+
             byte[] toSignByte = Encoding.UTF8.GetBytes(toSignStr);
             var toKey = Convert.FromBase64String(BoxPublicKey);
             var rsaroot = RSA.Create();
@@ -725,8 +802,11 @@ namespace MySystem
         /// <param name="fileName">文件名</param>
         /// <param name="action">操作类型 0 上传图片</param>
         /// <returns></returns>
-        public string GetToken(string fileName, string action)
+        public string GetToken(string fileName, string action, int BrandId = 0)
         {
+            var BoxRequestUrl = HaodaUnionParam.BoxRequestUrl;
+            if (BrandId == 1) BoxRequestUrl = HaodaParam.BoxRequestUrl;
+
             LogHelper.Instance.WriteLog(DateTime.Now.ToString(), "好哒获取文件令牌接口");
             Dictionary<string, object> reqdic = new Dictionary<string, object>();
 
@@ -735,7 +815,7 @@ namespace MySystem
 
             string req = Newtonsoft.Json.JsonConvert.SerializeObject(reqdic);
             LogHelper.Instance.WriteLog(req, "好哒获取文件令牌接口");
-            Dictionary<string, string> headdic = GetHeader(req);
+            Dictionary<string, string> headdic = GetHeader(req, BrandId);
             string head = Newtonsoft.Json.JsonConvert.SerializeObject(headdic);
             LogHelper.Instance.WriteLog("请求头\n" + head, "好哒获取文件令牌接口");
             LogHelper.Instance.WriteLog("请求参数\n" + req, "好哒获取文件令牌接口");
@@ -865,8 +945,11 @@ namespace MySystem
         /// <param name="token">上传图片凭证token</param>
         /// <param name="value">图片路径</param>
         /// <returns></returns>
-        public string ReturnFileName(string token, string value)
+        public string ReturnFileName(string token, string value, int BrandId = 0)
         {
+            var BoxRequestUrl = HaodaUnionParam.BoxRequestUrl;
+            if (BrandId == 1) BoxRequestUrl = HaodaParam.BoxRequestUrl;
+
             Dictionary<string, string> file = new Dictionary<string, string>();
             file.Add("fileName", value.Substring(value.LastIndexOf("/")).Trim('/'));
             if (string.IsNullOrEmpty(value.Split(',')[0]))

+ 2 - 2
Util/HaoDa/MerchantConfirmService.cs

@@ -104,7 +104,7 @@ namespace MySystem
                     if (AddInfo.Status <= 0)
                     {
                         //好哒新建商户
-                        string result = HaoDaHelper.Instance.AddNewMerchant(AddNewMerchantSetUtil.SetValue(AddInfo));
+                        string result = HaoDaHelper.Instance.AddNewMerchant(AddNewMerchantSetUtil.SetValue(AddInfo), AddInfo.BrandId);
                         JsonData jsonObj = JsonMapper.ToObject(result);
                         //创建成功
                         if (jsonObj["resultCode"].ToString() == "1")
@@ -129,7 +129,7 @@ namespace MySystem
                             AddInfo.Status = -1;
                             merchant.Status = -1;
                             string errorDesc = jsonObj["errorDesc"].ToString();
-                            if(errorDesc.Contains("租赁协议") && errorDesc.Contains("水电煤") && errorDesc.Contains("门头合影") && errorDesc.Contains("下载地址"))
+                            if (errorDesc.Contains("租赁协议") && errorDesc.Contains("水电煤") && errorDesc.Contains("门头合影") && errorDesc.Contains("下载地址"))
                             {
                                 errorDesc = "门头不一致,需上传名称不一致说明函";
                             }

+ 30 - 30
Util/HaoDa/ProfitHelper.cs

@@ -154,20 +154,20 @@ namespace MySystem
                                                 if (GetMoney > minProfit)
                                                 {
                                                     MerchantAddInfo merchantAdd = db.MerchantAddInfo.FirstOrDefault(m => m.Id == suborder.MerchantId) ?? new MerchantAddInfo();
-                                                    
+
                                                     //聚合支付退款
                                                     bool BackStatus = false;
 
                                                     //拆单算法
                                                     string MerchantList = function.CheckNull(RedisDbconn.Instance.Get<string>("SplitOrderMerchants"));
                                                     string SplitOrderStatus = function.CheckNull(RedisDbconn.Instance.Get<string>("SplitOrderStatus"));
-                                                    if(MerchantList.Contains("," + suborder.MerchantId + ",") || SplitOrderStatus == "1")
+                                                    if (MerchantList.Contains("," + suborder.MerchantId + ",") || SplitOrderStatus == "1")
                                                     {
-                                                        CheckTime = SplitOrder(suborder.PayMoney,subset.MinPayMoney);
+                                                        CheckTime = SplitOrder(suborder.PayMoney, subset.MinPayMoney);
                                                         function.WriteLog("CheckTime:" + CheckTime, "返现逻辑日志");
-                                                        if(CheckTime > 0)
+                                                        if (CheckTime > 0)
                                                         {
-                                                            if(set.DiviPersons - DiviTimes < CheckTime)
+                                                            if (set.DiviPersons - DiviTimes < CheckTime)
                                                             {
                                                                 CheckTime = set.DiviPersons - DiviTimes;
                                                             }
@@ -175,7 +175,7 @@ namespace MySystem
                                                             GetMoney = GetMoney * CheckTime;
                                                             db.SaveChanges();
                                                             function.WriteLog("CurDiviPersons1:" + CurDiviPersons, "返现逻辑日志");
-                                                            if(RedisDbconn.Instance.Count("ConsumerOrdersHd:Divi:" + PayMode + ":" + MerchantId) >= set.DiviPersons)
+                                                            if (RedisDbconn.Instance.Count("ConsumerOrdersHd:Divi:" + PayMode + ":" + MerchantId) >= set.DiviPersons)
                                                             {
                                                                 CurDiviPersons -= CheckTime - 1;
                                                             }
@@ -191,12 +191,12 @@ namespace MySystem
 
                                                     decimal RefundAmount = GetMoney * 100;
                                                     RefundAmount = PublicFunction.NumberFormat(RefundAmount, 0);
-                                                    if(!orderids.Contains(suborder.Id) && DiviTimes < set.DiviPersons)
+                                                    if (!orderids.Contains(suborder.Id) && DiviTimes < set.DiviPersons)
                                                     {
                                                         function.WriteLog("请求退款接口", "返现逻辑日志");
                                                         string RefundNo = "HDTK" + DateTime.Now.ToString("yyyyMMddHHmmssfff") + function.get_Random(8);
-                                                        var info = HaoDaHelper.Instance.AggregatedPayRefund(merchantAdd.OutMchtNo, merchantAdd.StoreNo, RefundNo, suborder.OrderNo, RefundAmount.ToString("f0"));
-                                                        if(info.Contains("\"resultCode\":\"1\"") && info.Contains("\"tradeStatus\":\"2\""))
+                                                        var info = HaoDaHelper.Instance.AggregatedPayRefund(merchantAdd.OutMchtNo, merchantAdd.StoreNo, RefundNo, suborder.OrderNo, RefundAmount.ToString("f0"), merchantAdd.BrandId);
+                                                        if (info.Contains("\"resultCode\":\"1\"") && info.Contains("\"tradeStatus\":\"2\""))
                                                         {
                                                             db.ConsumerProfit.Add(new ConsumerProfit()
                                                             {
@@ -219,7 +219,7 @@ namespace MySystem
                                                         DiviTimes += CheckTime;
                                                     }
 
-                                                    if(BackStatus)
+                                                    if (BackStatus)
                                                     {
                                                         merchant.ActCurrentAmount += Math.Round(GetMoney, 2); //活动已返金额
                                                         db.SaveChanges();
@@ -301,16 +301,16 @@ namespace MySystem
                     RedisDbconn.Instance.AddList("ConsumerProfitCheck", orderidstring);
                 }
             }
-            db.Dispose();            
+            db.Dispose();
             function.WriteLog("结束返现:" + orderidstring + "\n\n\n", "返现逻辑日志");
         }
 
         //拆单算法
         private int SplitOrder(decimal OrderAmt, decimal MinMoney)
         {
-            decimal percenter = OrderAmt/MinMoney;
+            decimal percenter = OrderAmt / MinMoney;
             int Times = int.Parse(percenter.ToString().Split('.')[0]);
-            if(Times < 1) Times = 1;
+            if (Times < 1) Times = 1;
             return Times;
         }
         #endregion
@@ -330,15 +330,15 @@ namespace MySystem
 
         public void StartListenProfitDo()
         {
-            while(true)
+            while (true)
             {
-                if(DateTime.Now.Day < 10 && DateTime.Now.Hour > 2 && DateTime.Now.Hour < 23)
+                if (DateTime.Now.Day < 10 && DateTime.Now.Hour > 2 && DateTime.Now.Hour < 23)
                 {
                     try
                     {
                         DoProfit();
                     }
-                    catch(Exception ex)
+                    catch (Exception ex)
                     {
                         LogHelper.Instance.WriteLog(DateTime.Now.ToString() + "\n" + ex.ToString(), "来客吧分润异常");
                     }
@@ -356,7 +356,7 @@ namespace MySystem
         {
             string TradeMonth = DateTime.Now.AddMonths(-1).ToString("yyyyMM");
             string check = function.ReadInstance("/ProfitFlag/" + TradeMonth + ".txt");
-            if(!string.IsNullOrEmpty(check))
+            if (!string.IsNullOrEmpty(check))
             {
                 return;
             }
@@ -364,7 +364,7 @@ namespace MySystem
             Models.KxsMain.WebCMSEntities kxsdb = new Models.KxsMain.WebCMSEntities();
             WebCMSEntities dbnew = new WebCMSEntities();
             DataTable dt = CustomerSqlConn.dtable("select IsAct,UserId,sum(TotalAmount) from UserAmountSummary where TradeMonth='" + TradeMonth + "' and SeoTitle='self' group by IsAct,UserId", AppConfig.Base.SqlConnStr);
-            foreach(DataRow dr in dt.Rows)
+            foreach (DataRow dr in dt.Rows)
             {
                 int UserId = int.Parse(dr["UserId"].ToString());
                 bool IsActive = dr["IsAct"].ToString() == "1";
@@ -379,7 +379,7 @@ namespace MySystem
                     {
                         uidstring = us.ParentNav.Trim(',').Replace(",,", ",") + "," + uidstring;
                         string[] parents = us.ParentNav.Trim(',').Replace(",,", ",").Split(',');
-                        if(parents.Length > 1)
+                        if (parents.Length > 1)
                         {
                             TopUserId = int.Parse(function.CheckInt(parents[1]));
                         }
@@ -411,7 +411,7 @@ namespace MySystem
                 Models.KxsMain.Users topUser = kxsdb.Users.FirstOrDefault(a => a.Id == TopUserId) ?? new Models.KxsMain.Users();
                 LogHelper.Instance.WriteLog("---UserId:" + UserId + ";TotalAmount:" + TotalAmount + ";", "来客吧分润日志");
                 List<ProfitResult> list = new List<ProfitResult>();
-                list = StartProft(TotalAmount, 1, users, IsActive);                
+                list = StartProft(TotalAmount, 1, users, IsActive);
                 LogHelper.Instance.WriteLog("---list:" + list.Count + ";", "来客吧分润日志");
                 try
                 {
@@ -446,7 +446,7 @@ namespace MySystem
                             editprofitrecord.RecordNo = RecordNo;
                             dbnew.SaveChanges();
                         }
-                        if(IsActive)
+                        if (IsActive)
                         {
                             editprofitrecord.CreditTradeAmt += TotalAmount;
                             editprofitrecord.CreditTradeProfit += sub.Money;
@@ -461,7 +461,7 @@ namespace MySystem
                     dbnew.SaveChanges();
                 }
                 catch (Exception ex)
-                { 
+                {
                     LogHelper.Instance.WriteLog(ex.ToString(), "分润异常");
                 }
             }
@@ -547,7 +547,7 @@ namespace MySystem
                             }
                         }
                     }
-                    if(curLevel < UserLevel)
+                    if (curLevel < UserLevel)
                     {
                         curLevel = UserLevel;
                     }
@@ -561,7 +561,7 @@ namespace MySystem
         {
             SubUser user = new SubUser();
             DataTable dt = GetDataTable("select * from Users" + Month + " where Id=" + UserId);
-            if(dt.Rows.Count > 0)
+            if (dt.Rows.Count > 0)
             {
                 user.Id = int.Parse(dt.Rows[0]["Id"].ToString());
                 user.ParentUserId = int.Parse(dt.Rows[0]["ParentUserId"].ToString());
@@ -577,9 +577,9 @@ namespace MySystem
         public int GetUserLevel(SubUser user)
         {
             int level = user.UserLevel;
-            if(user.PreUserLevel > level) level = user.PreUserLevel;
-            if(user.PreLeaderLevel > level) level = user.PreLeaderLevel;
-            if(user.PreOpLevel > level) level = user.PreOpLevel;
+            if (user.PreUserLevel > level) level = user.PreUserLevel;
+            if (user.PreLeaderLevel > level) level = user.PreLeaderLevel;
+            if (user.PreOpLevel > level) level = user.PreOpLevel;
             return level;
         }
 
@@ -616,7 +616,7 @@ namespace MySystem
         }
 
         public void SetDivi(string content)
-        { 
+        {
             try
             {
                 JsonData jsonObj = JsonMapper.ToObject(content);
@@ -624,14 +624,14 @@ namespace MySystem
                 decimal diviAmt = decimal.Parse(function.CheckNum(jsonObj["DiviAmt"].ToString()));
                 WebCMSEntities db = new WebCMSEntities();
                 ConsumerOrders order = db.ConsumerOrders.FirstOrDefault(m => m.Id == orderId);
-                if(order != null)
+                if (order != null)
                 {
                     order.CurDivi = diviAmt;
                     db.SaveChanges();
                 }
                 db.Dispose();
             }
-            catch(Exception ex)
+            catch (Exception ex)
             {
                 function.WriteLog(DateTime.Now.ToString() + "\n" + ex.ToString(), "设置订单当前返现金额异常");
             }

+ 6 - 3
Util/HaoDa/ProfitShareService.cs

@@ -52,12 +52,15 @@ namespace MySystem
                 string ApplyNo = jsonObj["ApplyNo"].ToString(); //微信订单号
                 string MchtNo = jsonObj["MchtNo"].ToString(); //商户订单号
                 string OrderNo = jsonObj["OrderNo"].ToString(); //商户订单号
-                JsonData result = JsonMapper.ToObject(HaoDaHelper.Instance.OrderDivideAccountsQuery(ApplyNo, MchtNo));
+                WebCMSEntities db = new WebCMSEntities();
+
+                ConsumerOrders order = db.ConsumerOrders.FirstOrDefault(m => m.OrderNo == OrderNo && m.Status == 2);
+                MerchantAddInfo merchantAdd = db.MerchantAddInfo.FirstOrDefault(m => m.Id == order.MerchantId) ?? new MerchantAddInfo();
+
+                JsonData result = JsonMapper.ToObject(HaoDaHelper.Instance.OrderDivideAccountsQuery(ApplyNo, MchtNo, merchantAdd.BrandId));
                 string state = result["data"]["status"].ToString();
                 if (result["data"]["status"].ToString() == "0")
                 {
-                    WebCMSEntities db = new WebCMSEntities();
-                    ConsumerOrders order = db.ConsumerOrders.FirstOrDefault(m => m.OrderNo == OrderNo && m.Status == 2);
                     if (order != null)
                     {
                         RedisDbconn.Instance.AddList("ConsumerOrdersHd:Divi:" + order.PayMode + ":List", order.Id.ToString());

+ 39 - 32
Util/HaoDa/TestChangeMerchantCardSetUtil.cs

@@ -16,41 +16,48 @@ namespace MySystem
     /// </summary>
     public class TestChangeMerchantCardSetUtil
     {
-        public static ChangeMerchantCard SetValue(MerchantAddInfo AddInfo, string BankCard = "/static/upload/2023/9/11/nb.jpg")
+        // bankCard	银行卡正面	结算类型为1和2时必填,0不填,传上传图片接口得到的token
+        // openAccountLicenses	开户许可证	企业类型商户或结算类型为0时必填,1和2不填,传上传图片接口得到的token
+        // priLicAgreement	企业法人对私授权书	结算类型为1且为企业商户时必填,传上传图片接口得到的token
+        // agentProtocol	委托结算授权书	结算类型为2时必填,传上传图片接口得到的token
+        // agentIdCardFront	被委托人身份证人像面	结算类型为2时必填,传上传图片接口得到的token
+        // agentIdCardBack	被委托人身份证国徽面	结算类型为2时必填,传上传图片接口得到的token
+        // holdAgentProtocol	法人手持委托结算授权书	结算类型为2时必填,传上传图片接口得到的token
+        public static ChangeMerchantCard SetValue(MerchantAddInfo AddInfo, string BankCard = "/static/upload/2024/3/12/Card.jpg")
         {
             ChangeMerchantCard changeMerchantCard = new ChangeMerchantCard();
-            changeMerchantCard.mchtNo = "030510106621391"; //收款商户号
-            changeMerchantCard.accountNo = "6217359952003511113"; //卡号(账户类型 0-对公 时填写对公账号,1-对私 时填写银行卡号)
-            changeMerchantCard.accoutType = "1"; //账户类型 0-对公,1-对私
+            changeMerchantCard.mchtNo = "030510106722615"; //收款商户号
+            changeMerchantCard.accountNo = "694330345"; //卡号(账户类型 0-对公 时填写对公账号,1-对私 时填写银行卡号)
+            changeMerchantCard.accoutType = "0"; //账户类型 0-对公,1-对私
             if (changeMerchantCard.accoutType == "1")
             {
-                changeMerchantCard.accountName = "王亦君"; //开户名(账户名称 账户类型 0-对公 时填写对公账户名,1-对私 时填写银行卡户名)
+                changeMerchantCard.accountName = "黄全芳"; //开户名(账户名称 账户类型 0-对公 时填写对公账户名,1-对私 时填写银行卡户名)
             }
             else
             {
-                changeMerchantCard.accountName = "四川探火网络科技有限责任公司"; //开户名(账户名称 账户类型 0-对公 时填写对公账户名,1-对私 时填写银行卡户名)
+                changeMerchantCard.accountName = "四川佰人商贸有限公司"; //开户名(账户名称 账户类型 0-对公 时填写对公账户名,1-对私 时填写银行卡户名)
             }
-            changeMerchantCard.zbankNo = "313701013316"; //开户支行号
-            changeMerchantCard.alterType = "1"; //结算类型:0-对公结算银行卡;1-法人对私结算银行卡;2-非法人结算
+            changeMerchantCard.zbankNo = "305651000261"; //开户支行号
+            changeMerchantCard.alterType = "0"; //结算类型:0-对公结算银行卡;1-法人对私结算银行卡;2-非法人结算
             // if (AddInfo.AccountType == "0" && AddInfo.LicenceType == "0") changeMerchantCard.alterType = "0"; //结算类型:0-对公结算银行卡;1-法人对私结算银行卡;2-非法人结算
             // if (AddInfo.AccountType == "1" && (AddInfo.LicenceType == "0" || AddInfo.LicenceType == "1")) changeMerchantCard.alterType = "1"; //结算类型:0-对公结算银行卡;1-法人对私结算银行卡;2-非法人结算
             // if (AddInfo.AccountType == "1" && AddInfo.LicenceType == null) changeMerchantCard.alterType = "2"; //结算类型:0-对公结算银行卡;1-法人对私结算银行卡;2-非法人结算
             changeMerchantCard.acctZbankCode = "510107"; //开户支行地区码
-            changeMerchantCard.idCard = "620522199407080017"; //非法人身份证号
-            if (changeMerchantCard.alterType == "2")
-            {
-                changeMerchantCard.idCard = "620522199407080017"; //非法人身份证号(结算类型为2时必填)
-                if (AddInfo.CardPeriodEnd.Value.Year == 2050)
-                {
-                    changeMerchantCard.agentCardDate = AddInfo.CardPeriodBegin.Value.ToString("yyyyMMdd") + "-" + "长期"; //法人身份证有效期 格式:20150101-20200101,若结束日期为长期填20150101-长期
-                }
-                else
-                {
-                    changeMerchantCard.agentCardDate = AddInfo.CardPeriodBegin.Value.ToString("yyyyMMdd") + "-" + AddInfo.CardPeriodEnd.Value.ToString("yyyyMMdd"); //法人身份证有效期 格式:20150101-20200101,若结束日期为长期填20150101-长期
-                }
-                // changeMerchantCard.agentCardDate = "" + "-" + "长期"; //非法人身份证有效期(结算类型为2时必填,格式:20210101-20220101,如长期:20210101-长期)
-                // changeMerchantCard.agentCardDate = "" + "-" + ""; //非法人身份证有效期(结算类型为2时必填,格式:20210101-20220101,如长期:20210101-长期)
-            }
+            // changeMerchantCard.idCard = ""; //非法人身份证号
+            // if (changeMerchantCard.alterType == "2")
+            // {
+            //     changeMerchantCard.idCard = "340123200410150349"; //非法人身份证号(结算类型为2时必填)
+            //     if (AddInfo.CardPeriodEnd.Value.Year == 2050)
+            //     {
+            //         changeMerchantCard.agentCardDate = AddInfo.CardPeriodBegin.Value.ToString("yyyyMMdd") + "-" + "长期"; //法人身份证有效期 格式:20150101-20200101,若结束日期为长期填20150101-长期
+            //     }
+            //     else
+            //     {
+            //         changeMerchantCard.agentCardDate = AddInfo.CardPeriodBegin.Value.ToString("yyyyMMdd") + "-" + AddInfo.CardPeriodEnd.Value.ToString("yyyyMMdd"); //法人身份证有效期 格式:20150101-20200101,若结束日期为长期填20150101-长期
+            //     }
+            //     // changeMerchantCard.agentCardDate = "" + "-" + "长期"; //非法人身份证有效期(结算类型为2时必填,格式:20210101-20220101,如长期:20210101-长期)
+            //     // changeMerchantCard.agentCardDate = "" + "-" + ""; //非法人身份证有效期(结算类型为2时必填,格式:20210101-20220101,如长期:20210101-长期)
+            // }
             List<PhotoItem> photoList = new List<PhotoItem>();
             PhotoItem photoItem = new PhotoItem();
             // alterType结算类型为 0 时,上传 开户许可证照片
@@ -59,10 +66,10 @@ namespace MySystem
             // 面照片、委托结算授权书照片、法人手持委托结算授权书
             if (changeMerchantCard.alterType == "0")
             {
-                var tokenInfo = JsonMapper.ToObject(HaoDaHelper.Instance.GetToken(AddInfo.BankCard.Substring(AddInfo.BankCard.LastIndexOf("/")).Trim('/'), "0"));
+                var tokenInfo = JsonMapper.ToObject(HaoDaHelper.Instance.GetToken(AddInfo.BankCard.Substring(AddInfo.BankCard.LastIndexOf("/")).Trim('/'), "0", AddInfo.BrandId));
                 if (tokenInfo["code"].ToString() == "1")
                 {
-                    var returnInfo = HaoDaHelper.Instance.ReturnFileName(tokenInfo["token"].ToString(), AddInfo.BankCard);
+                    var returnInfo = HaoDaHelper.Instance.ReturnFileName(tokenInfo["token"].ToString(), AddInfo.BankCard, AddInfo.BrandId);
                     if (returnInfo != "false")
                     {
                         photoItem = new PhotoItem();
@@ -74,13 +81,13 @@ namespace MySystem
             }
             if (changeMerchantCard.alterType == "1")
             {
-                var info = "/static/upload/2023/8/14/dd.jpg";
+                var info = "/static/upload/2024/3/12/Card.jpg";
                 if (!string.IsNullOrEmpty(info))
                 {
-                    var tokenInfo = JsonMapper.ToObject(HaoDaHelper.Instance.GetToken(info.Substring(info.LastIndexOf("/")).Trim('/'), "0"));
+                    var tokenInfo = JsonMapper.ToObject(HaoDaHelper.Instance.GetToken(info.Substring(info.LastIndexOf("/")).Trim('/'), "0", AddInfo.BrandId));
                     if (tokenInfo["code"].ToString() == "1")
                     {
-                        var returnInfo = HaoDaHelper.Instance.ReturnFileName(tokenInfo["token"].ToString(), info);
+                        var returnInfo = HaoDaHelper.Instance.ReturnFileName(tokenInfo["token"].ToString(), info, AddInfo.BrandId);
                         if (returnInfo != "false")
                         {
                             photoItem = new PhotoItem();
@@ -92,10 +99,10 @@ namespace MySystem
                 }
                 if (!string.IsNullOrEmpty(BankCard))
                 {
-                    var tokenInfo = JsonMapper.ToObject(HaoDaHelper.Instance.GetToken(BankCard.Substring(BankCard.LastIndexOf("/")).Trim('/'), "0"));
+                    var tokenInfo = JsonMapper.ToObject(HaoDaHelper.Instance.GetToken(BankCard.Substring(BankCard.LastIndexOf("/")).Trim('/'), "0", AddInfo.BrandId));
                     if (tokenInfo["code"].ToString() == "1")
                     {
-                        var returnInfo = HaoDaHelper.Instance.ReturnFileName(tokenInfo["token"].ToString(), BankCard);
+                        var returnInfo = HaoDaHelper.Instance.ReturnFileName(tokenInfo["token"].ToString(), BankCard, AddInfo.BrandId);
                         if (returnInfo != "false")
                         {
                             photoItem = new PhotoItem();
@@ -108,10 +115,10 @@ namespace MySystem
             }
             if (changeMerchantCard.alterType == "2")
             {
-                var tokenInfo = JsonMapper.ToObject(HaoDaHelper.Instance.GetToken(AddInfo.BankCard.Substring(AddInfo.BankCard.LastIndexOf("/")).Trim('/'), "0"));
+                var tokenInfo = JsonMapper.ToObject(HaoDaHelper.Instance.GetToken(AddInfo.BankCard.Substring(AddInfo.BankCard.LastIndexOf("/")).Trim('/'), "0", AddInfo.BrandId));
                 if (tokenInfo["code"].ToString() == "1")
                 {
-                    var returnInfo = HaoDaHelper.Instance.ReturnFileName(tokenInfo["token"].ToString(), AddInfo.BankCard);
+                    var returnInfo = HaoDaHelper.Instance.ReturnFileName(tokenInfo["token"].ToString(), AddInfo.BankCard, AddInfo.BrandId);
                     if (returnInfo != "false")
                     {
                         photoItem = new PhotoItem();

+ 1 - 1
Util/HaoDa/TestHaoDaHelper.cs

@@ -109,7 +109,7 @@ namespace MySystem
             lists.Add("acctType", "0");
             lists.Add("amount", "9862");
             list.Add(lists);
-            
+
             reqdic.Add("detail", list);
             string req = Newtonsoft.Json.JsonConvert.SerializeObject(reqdic);
             LogHelper.Instance.WriteLog(req, "好哒订单分账申请");

+ 45 - 12
Util/HaoDa/TestHaoDaService.cs

@@ -34,9 +34,11 @@ namespace MySystem
             // AlipayAddInfo(828,"202309011037906510");//查询支付宝开户意愿申请状态
             // WeChatAddInfo(826);//提交微信开户意愿申请单
             // WeChatAddInfo(825,"2000002424428809");//查询微信开户意愿申请状态
-            // QueryMerchantStatus(867);//新建商户查询状态
-            // ConfiemMer(808);//新建商户
+            // ConfiemMer(1833);//新建商户
+            // QueryMerchantStatus(1833);//新建商户查询状态
+            // GetTencentAddressInfo(112); //获取商户经纬坐标
             // ChangeMerchantCard(1);//商户修改银行卡
+            // QueryChangeCardStatus(1874);//商户修改银行卡状态
             // AddOpenDivideAccounts(832); //添加分账方
             // QueryAuthStatus(1845);//查询实名认证状态
             // WeChatFunctionForHD.Instance.QueryAuthMerchant("600955391");
@@ -209,7 +211,10 @@ namespace MySystem
         {
             WebCMSEntities db = new WebCMSEntities();
             MerchantAddInfo AddInfo = db.MerchantAddInfo.FirstOrDefault(m => m.Id == MerchantId);
-            var returnInfo = HaoDaHelper.Instance.QueryMerchantStatus(HaoDaHelper.BrhCode, AddInfo.MchtNo);
+
+            var BrhCode = HaodaUnionParam.BrhCode;
+            if (AddInfo.BrandId == 1) BrhCode = HaodaParam.BrhCode;
+            var returnInfo = HaoDaHelper.Instance.QueryMerchantStatus(BrhCode, AddInfo.MchtNo);
             // string result = HaoDaHelper.Instance.AddNewMerchant(AddNewMerchantSetUtil.SetValue(AddInfo));
             db.Dispose();
         }
@@ -574,10 +579,10 @@ namespace MySystem
         public void ChangeMerchantCard(int MerchantId)
         {
             WebCMSEntities db = new WebCMSEntities();
-            // MerchantAddInfo AddInfo = db.MerchantAddInfo.FirstOrDefault(m => m.Id == MerchantId);
-            // var request = TestChangeMerchantCardSetUtil.SetValue(AddInfo);
-            // JsonData Infos = JsonMapper.ToObject(HaoDaHelper.Instance.ChangeMerchantCard(request));
-            // JsonData results = JsonMapper.ToObject(HaoDaHelper.Instance.QueryChangeCardStatus(AddInfo.MchtNo, Infos["taskId"].ToString()));
+            MerchantAddInfo AddInfo = db.MerchantAddInfo.FirstOrDefault(m => m.Id == MerchantId);
+            var request = TestChangeMerchantCardSetUtil.SetValue(AddInfo);
+            JsonData Infos = JsonMapper.ToObject(HaoDaHelper.Instance.ChangeMerchantCard(request));
+            JsonData results = JsonMapper.ToObject(HaoDaHelper.Instance.QueryChangeCardStatus(AddInfo.MchtNo, Infos["data"]["taskId"].ToString()));
             //TODO:修改结算卡变更商户相关信息
             // AccountNumber
             // BankName
@@ -595,12 +600,40 @@ namespace MySystem
         }
 
 
+        //获取商户经纬坐标
+        public void GetTencentAddressInfo(int Id)
+        {
+            WebCMSEntities db = new WebCMSEntities();
+            MerchantInfo merchant = db.MerchantInfo.FirstOrDefault(m => m.Id == Id);
+            string Address = merchant.Areas + merchant.Address;
+            string Key = Library.ConfigurationManager.AppSettings["TencentKey"].ToString();
+            LogHelper.Instance.WriteLog("商户Id\n" + Id + "\n\n", "获取商户经纬坐标");
+            LogHelper.Instance.WriteLog("请求参数\n" + Address + "\n\n", "获取商户经纬坐标");
+            var info = function.GetWebRequest("https://apis.map.qq.com/ws/geocoder/v1/?address=" + Address + "&key=" + Key);
+            JsonData result = JsonMapper.ToObject(info);
+            //创建成功
+            if (result["status"].ToString() == "0")
+            {
+                var merInfo = db.MerchantInfo.FirstOrDefault(m => m.Id == Id) ?? new MerchantInfo();
+                if (merInfo.Id > 0)
+                {
+                    merInfo.Longitude = decimal.Parse(result["result"]["location"]["lng"].ToString());
+                    merInfo.Latitude = decimal.Parse(result["result"]["location"]["lat"].ToString());
+                    db.SaveChanges();
+                    db.Dispose();
+                }
+            }
+            LogHelper.Instance.WriteLog("返回\n" + info + "\n\n", "获取商户经纬坐标");
+            db.Dispose();
+        }
 
-
-
-
-
-
+        public void QueryChangeCardStatus(int MerchantId)
+        {
+            WebCMSEntities db = new WebCMSEntities();
+            MerchantAddInfo AddInfo = db.MerchantAddInfo.FirstOrDefault(m => m.Id == MerchantId);
+            // JsonData results = JsonMapper.ToObject(HaoDaHelper.Instance.QueryChangeCardStatus(AddInfo.MchtNo, Infos["data"]["taskId"].ToString()));
+            JsonData results = JsonMapper.ToObject(HaoDaHelper.Instance.QueryChangeCardStatus(AddInfo.MchtNo, "16592654"));
+        }
         public void refund()
         {
             Thread th = new Thread(refunddo);

+ 4 - 1
Util/HaoDa/WeChatPayBackService.cs

@@ -135,6 +135,9 @@ namespace MySystem
                     }
                     db1.Dispose();
                     LogHelper.Instance.WriteLog(DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fff") + "执行完毕", "微信支付回调监控");
+
+                    //发送订单到客小爽MQ
+                    OrderMessageHelper.SendOrderMsg(order);
                 }
                 else
                 {
@@ -213,7 +216,7 @@ namespace MySystem
                                     servicefee = servicefee * 100;
                                     string seviceAmount = servicefee.ToString("f0"); //服务费
                                     string amountAmount = amount.ToString("f0");
-                                    string result = HaoDaHelper.Instance.OrderDivideAccounts(OrderDivideAccountsUtil.AddValue(applyNo, mchtNo, orderNo, acctNo, sacctNo, acctType, amountAmount, seviceAmount));
+                                    string result = HaoDaHelper.Instance.OrderDivideAccounts(OrderDivideAccountsUtil.AddValue(applyNo, mchtNo, orderNo, acctNo, sacctNo, acctType, amountAmount, seviceAmount), merchantAdd.BrandId);
                                     order.DivideLog = "请求分账日志:" + result;
                                     if (result.Contains("\"resultCode\":\"0\"") && (result.Contains("分账金额不足") || result.Contains("不存在")))
                                     {

+ 36 - 0
Util/OrderMessageHelper.cs

@@ -0,0 +1,36 @@
+using System;
+using MySystem.Models.Main;
+using System.Linq;
+
+namespace MySystem
+{
+    public class OrderMessageHelper
+    {
+        public static void SendOrderMsg(ConsumerOrders order)
+        {
+            WebCMSEntities db = new WebCMSEntities();
+            MerchantInfo merchant = db.MerchantInfo.FirstOrDefault(m => m.Id == order.MerchantId) ?? new MerchantInfo();
+            OrderMessage msg = new OrderMessage()
+            {
+                brandId = merchant.BrandId + 1, //品牌/通道(0直联,1银联,2好哒)
+                status = order.Status, //订单状态(0待支付,1已支付)
+                createDate = order.CreateDate.Value, //创建时间
+                payDate = order.UpdateDate.Value, //支付时间
+                hdOrderNo = order.SeoTitle, //好哒订单号
+                tradeNo = order.SeoKeyword, //支付宝微信平台交易号
+                snNo = order.SnNo, //码牌SN
+                payMoney = order.PayMoney, //支付金额
+                payMode = order.PayMode, //支付方式(1支付宝,2微信)
+                orderNo = order.OrderNo, //订单号
+                consumerId = order.ConsumerId, //消费者Id
+                merchantId = order.MerchantId, //商户Id
+                isAct = (int)order.IsAct, //活动标识(1活动,0非活动)
+                userId = order.UserId, //创客Id
+                merchantActualAmount = order.MerchantActualAmount, //商家实收金额
+            };
+            db.Dispose();
+
+            RedisDbconn.Instance.AddList("MpOrderQueue", Newtonsoft.Json.JsonConvert.SerializeObject(msg));
+        }
+    }
+}