浏览代码

测试新的参数进件

lcl 1 月之前
父节点
当前提交
7ba4bf7b66

+ 9 - 94
Controllers/HomeController.cs

@@ -130,100 +130,15 @@ namespace MySystem.Controllers
 
         public string test()
         {
-            // WebCMSEntities db = new WebCMSEntities();
-            // MerchantAddInfo merchantadd = db.MerchantAddInfo.FirstOrDefault(m => m.Id == 5660) ?? new MerchantAddInfo();
-            // SortedList<string, string> obj = new SortedList<string, string>();
-            // obj.Add("bind_time", DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"));
-            // obj.Add("merch_no", merchantadd.MchtNo);
-            // obj.Add("name", merchantadd.CertMerchantName);
-            // string IdCardNumber = merchantadd.IdCardNumber;
-            // if(!string.IsNullOrEmpty(IdCardNumber))
-            // {
-            //     IdCardNumber = IdCardNumber.Substring(0, 6) + "**********" + IdCardNumber.Substring(IdCardNumber.Length - 4);
-            // }
-            // obj.Add("supplement_info", IdCardNumber);
-            // obj.Add("mobile", merchantadd.MobilePhone);
-            // obj.Add("maker_code", "C00000001");
-            // PushHelper.Instance.Do(obj);
-            // string content = function.ReadInstance("/好哒地区.txt");
-            // string[] contents = content.Split('\n');
-            // foreach(string sub in contents)
-            // {
-            //     string[] data = sub.Split(',');
-            //     if(data.Length == 6)
-            //     {
-            //         string CityName = "中国," + data[1];
-            //         bool op = db.OpenBankCityTable.Any(m => m.CityName == CityName);
-            //         if(!op)
-            //         {
-            //             db.OpenBankCityTable.Add(new OpenBankCityTable()
-            //             {
-            //                 CityName = CityName,
-            //                 Code = data[0] + "0000",
-            //             });
-            //             db.SaveChanges();
-            //         }
-            //         CityName = "中国," + data[1] + "," + data[3];
-            //         op = db.OpenBankCityTable.Any(m => m.CityName == CityName);
-            //         if(!op)
-            //         {
-            //             db.OpenBankCityTable.Add(new OpenBankCityTable()
-            //             {
-            //                 CityName = CityName,
-            //                 Code = data[2] + "00",
-            //             });
-            //             db.SaveChanges();
-            //         }
-            //         CityName = "中国," + data[1] + "," + data[3] + "," + data[5];
-            //         op = db.OpenBankCityTable.Any(m => m.CityName == CityName);
-            //         if(!op)
-            //         {
-            //             db.OpenBankCityTable.Add(new OpenBankCityTable()
-            //             {
-            //                 CityName = CityName,
-            //                 Code = data[4],
-            //             });
-            //             db.SaveChanges();
-            //         }
-            //     }
-            //     else
-            //     {
-            //         string CityName = "中国,," + data[1];
-            //         bool op = db.OpenBankCityTable.Any(m => m.CityName == CityName);
-            //         if(!op)
-            //         {
-            //             db.OpenBankCityTable.Add(new OpenBankCityTable()
-            //             {
-            //                 CityName = CityName,
-            //                 Code = data[0] + "0000",
-            //             });
-            //             db.SaveChanges();
-            //         }
-            //         CityName = "中国,," + data[1] + "," + data[3];
-            //         op = db.OpenBankCityTable.Any(m => m.CityName == CityName);
-            //         if(!op)
-            //         {
-            //             db.OpenBankCityTable.Add(new OpenBankCityTable()
-            //             {
-            //                 CityName = CityName,
-            //                 Code = data[2],
-            //             });
-            //             db.SaveChanges();
-            //         }
-            //     }
-            // }
-            // db.Dispose();
-            // DateTime start = DateTime.Parse("2025-01-01 00:00:00");
-            // Models.KxsMain.WebCMSEntities db = new Models.KxsMain.WebCMSEntities();
-            // List<Models.KxsMain.ChangeTypes> brands = db.ChangeTypes.ToList();
-            // List<Models.KxsMain.UserAccountRecord> records = db.UserAccountRecord.Where(m => m.CreateDate >= start && m.ChangeType > 300).ToList();
-            // foreach(Models.KxsMain.UserAccountRecord record in records)
-            // {
-            //     string name = brands.FirstOrDefault(m => m.Id == record.ChangeType).Name;
-            //     PrizePushHelper.Instance.Do(DateTime.Now.ToString("yyyyMMddHHmmssfff") + function.get_Random(8), name, record.ChangeType.ToString(), record.ChangeAmount, record.UserId, "{\"brand_id\":101,\"user_id\":" + record.UserId + "}");
-            // }
-            // db.SaveChanges();
-
+            WebCMSEntities db = new WebCMSEntities();
+            MerchantAddInfo AddInfo = db.MerchantAddInfo.FirstOrDefault(m => m.Id == 1) ?? new MerchantAddInfo();
+            db.Dispose();
+            // string result = HaoDaHelper.Instance.AddNewMerchant(AddNewMerchantSetUtil.SetValue(AddInfo), AddInfo.BrandId, AddInfo.AgentName);
+            CheckWeChatSignService.Instance.StartDo(new QueryMerchantStatus()
+            {
+                MerchantId = AddInfo.Id.ToString(),
+                MerchantNo = AddInfo.MchtNo,
+            });
             return "ok";
         }
 

+ 12 - 1
Util/HaoDa/AddNewMerchantSetUtil.cs

@@ -20,7 +20,18 @@ namespace MySystem
         {
             AddNewMerchant addNewMerchant = new AddNewMerchant();
             // addNewMerchant.brh = HaoDaHelper.BrhCode; //机构号(正式)
-            if (AddInfo.BrandId == 1) addNewMerchant.brh = HaodaParam.BrhCode;
+            // if (AddInfo.BrandId == 1) addNewMerchant.brh = HaodaParam.BrhCode;
+            if (AddInfo.BrandId == 1)
+            {
+                if(string.IsNullOrEmpty(RedisDbconn.Instance.Get<string>("AgentBrhCode:" + AddInfo.AgentName)))
+                {
+                    addNewMerchant.brh = HaodaParam.BrhCode;
+                }
+                else
+                {
+                    addNewMerchant.brh = RedisDbconn.Instance.Get<string>("AgentBrhCode:" + AddInfo.AgentName);
+                }
+            }
             if (AddInfo.BrandId == 0) addNewMerchant.brh = HaodaUnionParam.BrhCode;
             if (!string.IsNullOrEmpty(AddInfo.MchtNo))
             {

+ 11 - 1
Util/HaoDa/CheckWeChatSignService.cs

@@ -57,7 +57,17 @@ namespace MySystem
                 MerchantAddInfo merchantadd = db.MerchantAddInfo.FirstOrDefault(m => m.Id == mId);
 
                 var BrhCode = HaodaUnionParam.BrhCode;
-                if (merchantadd.BrandId == 1) BrhCode = HaodaParam.BrhCode;
+                if (merchantadd.BrandId == 1)
+                {
+                    if(string.IsNullOrEmpty(RedisDbconn.Instance.Get<string>("AgentBrhCode:" + merchantadd.AgentName)))
+                    {
+                        BrhCode = HaodaParam.BrhCode;
+                    }
+                    else
+                    {
+                        BrhCode = RedisDbconn.Instance.Get<string>("AgentBrhCode:" + merchantadd.AgentName);
+                    }
+                }
 
                 //查询商户审核状态
                 var returnInfo = HaoDaHelper.Instance.QueryMerchantStatus(BrhCode, query.MerchantNo, merchantadd.BrandId, merchantadd.AgentName);

+ 14 - 1
Util/HaoDa/GetStoreNoHelper.cs

@@ -56,7 +56,20 @@ namespace MySystem
                 if (string.IsNullOrEmpty(AddInfo.StoreNo) && string.IsNullOrEmpty(AddInfo.OutMchtNo))
                 {
                     var BrhCode = HaodaUnionParam.BrhCode;
-                    if (AddInfo.BrandId == 1) BrhCode = HaodaParam.BrhCode;
+                    if (AddInfo.BrandId == 1)
+                    {
+                        if (AddInfo.BrandId == 1)
+                        {
+                            if(string.IsNullOrEmpty(RedisDbconn.Instance.Get<string>("AgentBrhCode:" + AddInfo.AgentName)))
+                            {
+                                BrhCode = HaodaParam.BrhCode;
+                            }
+                            else
+                            {
+                                BrhCode = RedisDbconn.Instance.Get<string>("AgentBrhCode:" + AddInfo.AgentName);
+                            }
+                        }
+                    }
 
                     //查询商户审核状态
                     var returnInfo = HaoDaHelper.Instance.QueryMerchantStatus(BrhCode, AddInfo.MchtNo, AddInfo.BrandId);