2 次代碼提交 b420b74403 ... a0cb5514dc

作者 SHA1 備註 提交日期
  DuGuYang a0cb5514dc Merge branch 'feature-dgy-进件区分银联品牌' into feature-dgy-功能测试 6 月之前
  DuGuYang 3bbcb355f1 银联好哒,BrandId=1是,好哒审核通过直接完成,结束流程 6 月之前

+ 1 - 1
Util/HaoDa/CheckWeChatBindService.cs

@@ -28,7 +28,7 @@ namespace MySystem
             while (true)
             {
                 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);
+                DataTable dt = CustomerSqlConn.dtable("select Id from MerchantAddInfo where HdStatus=3 and HdBindWeChat=0 and BrandId=0 and HdPassDate<'" + CheckDate + "' and OutMchtNo!='' and OutMchtNo is not null", AppConfig.Base.SqlConnStr);
                 foreach (DataRow dr in dt.Rows)
                 {
                     StartDo(int.Parse(function.CheckInt(dr["Id"].ToString())));

+ 45 - 36
Util/HaoDa/CheckWeChatSignService.cs

@@ -84,52 +84,66 @@ namespace MySystem
                     //查询商户是否存在
                     if (merchantadd != null)
                     {
-                        // merchantadd.Status = 1;
+                        MerchantInfo merchant = db.MerchantInfo.FirstOrDefault(m => m.Id == mId);
                         merchantadd.StoreNo = dic["data"]["storeNo"].ToString();
                         merchantadd.HdStatus = 1; //0 待审核 1 已通过 2 已开通分账 3 已添加接收方
                         merchantadd.OutMchtNo = dic["data"]["outMchtNo"].ToString();
-                        MerchantInfo merchant = db.MerchantInfo.FirstOrDefault(m => m.Id == mId);
-                        if (merchant != null)
-                        {
-                            merchant.Status = 1;
-                        }
-                        //商户开通分账
-                        JsonData Info = JsonMapper.ToObject(HaoDaHelper.Instance.OpenDivideAccounts(merchantadd.OutMchtNo, merchantadd.StoreNo, merchantadd.BrandId));
-                        //开通失败
-                        if (Info["resultCode"].ToString() == "0")
+                        if (merchantadd.BrandId == 1)
                         {
-                            merchantadd.Status = -1;
-                            merchantadd.WeChatRemark = Info["errorDesc"].ToString();
+                            merchantadd.Status = 2;
+                            merchantadd.QueryCount = 2;
+
+                            merchant.Status = 2;
+                            merchant.QueryCount = 2;
                         }
-                        //开通成功
-                        if (Info["resultCode"].ToString() == "1")
+                        else
                         {
-                            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, merchantadd.BrandId));
-                            //失败
-                            if (Infos["resultCode"].ToString() == "0")
+                            if (merchant != null)
+                            {
+                                merchant.Status = 1;
+                            }
+                            //商户开通分账
+                            JsonData Info = JsonMapper.ToObject(HaoDaHelper.Instance.OpenDivideAccounts(merchantadd.OutMchtNo, merchantadd.StoreNo, merchantadd.BrandId));
+                            //开通失败
+                            if (Info["resultCode"].ToString() == "0")
                             {
-                                merchantadd.WeChatRemark = Infos["errorDesc"].ToString();
+                                merchantadd.Status = -1;
+                                merchantadd.WeChatRemark = Info["errorDesc"].ToString();
                             }
-                            //成功
-                            else
+                            //开通成功
+                            if (Info["resultCode"].ToString() == "1")
                             {
-                                merchantadd.HdStatus = 3; //0 待审核 1 已通过 2 已开通分账 3 已添加接收方
-                                if (!string.IsNullOrEmpty(merchantadd.ToAcctNo))
+                                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, merchantadd.BrandId));
+                                //失败
+                                if (Infos["resultCode"].ToString() == "0")
                                 {
-                                    if (!merchantadd.ToAcctNo.Contains("," + AppConfig.Haoda.AcctNo + ","))
-                                    {
-                                        merchantadd.ToAcctNo += "," + AppConfig.Haoda.AcctNo + ",";
-                                    }
+                                    merchantadd.WeChatRemark = Infos["errorDesc"].ToString();
                                 }
+                                //成功
                                 else
                                 {
-                                    merchantadd.ToAcctNo += "," + AppConfig.Haoda.AcctNo + ",";
+                                    merchantadd.HdStatus = 3; //0 待审核 1 已通过 2 已开通分账 3 已添加接收方
+                                    if (!string.IsNullOrEmpty(merchantadd.ToAcctNo))
+                                    {
+                                        if (!merchantadd.ToAcctNo.Contains("," + AppConfig.Haoda.AcctNo + ","))
+                                        {
+                                            merchantadd.ToAcctNo += "," + AppConfig.Haoda.AcctNo + ",";
+                                        }
+                                    }
+                                    else
+                                    {
+                                        merchantadd.ToAcctNo += "," + AppConfig.Haoda.AcctNo + ",";
+                                    }
+                                    merchantadd.HdPassDate = DateTime.Now;
                                 }
-                                merchantadd.HdPassDate = DateTime.Now;
                             }
+
+                            //开户意愿申请
+                            RedisDbconn.Instance.AddList("AlipayForHaoDaQueue", mId);
+                            RedisDbconn.Instance.AddList("WeChatForHaoDaQueue", mId);
                         }
                         db.SaveChanges();
 
@@ -160,11 +174,6 @@ namespace MySystem
                             db1.SaveChanges();
                         }
                         db1.Dispose();
-
-                        //开户意愿申请
-                        RedisDbconn.Instance.AddList("AlipayForHaoDaQueue", mId);
-                        RedisDbconn.Instance.AddList("WeChatForHaoDaQueue", mId);
-
                     }
                 }
                 //审核被拒绝

+ 1 - 1
Util/HaoDa/HaoDaAuthQueryHelper.cs

@@ -29,7 +29,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);
+            DataTable dt = CustomerSqlConn.dtable("select Id,OutMchtNo,StoreNo from MerchantAddInfo where HdStatus=3 and BrandId=0 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)
             {
                 QueryAuthStatus(dr["Id"].ToString(), dr["OutMchtNo"].ToString(), dr["StoreNo"].ToString());

+ 2 - 2
Util/HaoDa/HaoDaExtQueryAuthHelper.cs

@@ -39,7 +39,7 @@ public class HaoDaExtQueryAuthHelper
             // {
             //     Thread.Sleep(10000);
             // }
-            DataTable dt = CustomerSqlConn.dtable("select Id from MerchantAddInfo where HdStatus=3 and `Status`=1 and WeChatMerchantId!='' and WeChatMerchantId is not null", AppConfig.Base.SqlConnStr);
+            DataTable dt = CustomerSqlConn.dtable("select Id from MerchantAddInfo where HdStatus=3 and BrandId=0 and `Status`=1 and WeChatMerchantId!='' and WeChatMerchantId is not null", AppConfig.Base.SqlConnStr);
             foreach (DataRow dr in dt.Rows)
             {
                 WeChatAddInfo(int.Parse(dr["Id"].ToString()));
@@ -114,7 +114,7 @@ public class HaoDaExtQueryAuthHelper
             // {
             //     Thread.Sleep(10000);
             // }
-            DataTable dt = CustomerSqlConn.dtable("select Id from MerchantAddInfo where HdStatus=3 and `QueryCount`=1 and AliMerchantId!='' and AliMerchantId is not null", AppConfig.Base.SqlConnStr);
+            DataTable dt = CustomerSqlConn.dtable("select Id from MerchantAddInfo where HdStatus=3 and BrandId=0 and `QueryCount`=1 and AliMerchantId!='' and AliMerchantId is not null", AppConfig.Base.SqlConnStr);
             foreach (DataRow dr in dt.Rows)
             {
                 AlipayAddInfo(int.Parse(dr["Id"].ToString()));

+ 2 - 2
Util/HaoDa/HaoDaExtQueryHelper.cs

@@ -39,7 +39,7 @@ public class HaoDaExtQueryHelper
             // {
             //     Thread.Sleep(10000);
             // }
-            DataTable dt = CustomerSqlConn.dtable("select Id,ApplymentId from MerchantAddInfo where HdStatus=3 and `Status`=0 and ApplymentId!='' and ApplymentId is not null", AppConfig.Base.SqlConnStr);
+            DataTable dt = CustomerSqlConn.dtable("select Id,ApplymentId from MerchantAddInfo where HdStatus=3 and BrandId=0 and `Status`=0 and ApplymentId!='' and ApplymentId is not null", AppConfig.Base.SqlConnStr);
             foreach (DataRow dr in dt.Rows)
             {
                 WeChatAddInfo(int.Parse(dr["Id"].ToString()), dr["ApplymentId"].ToString());
@@ -133,7 +133,7 @@ public class HaoDaExtQueryHelper
             // {
             //     Thread.Sleep(10000);
             // }
-            DataTable dt = CustomerSqlConn.dtable("select Id,SeoTitle from MerchantAddInfo where HdStatus=3 and `QueryCount`=0 and SeoTitle!='' and SeoTitle is not null", AppConfig.Base.SqlConnStr);
+            DataTable dt = CustomerSqlConn.dtable("select Id,SeoTitle from MerchantAddInfo where HdStatus=3 and BrandId=0 and `QueryCount`=0 and SeoTitle!='' and SeoTitle is not null", AppConfig.Base.SqlConnStr);
             foreach (DataRow dr in dt.Rows)
             {
                 AlipayAddInfo(int.Parse(dr["Id"].ToString()), dr["SeoTitle"].ToString());