Explorar el Código

处理辅助工具

lichunlei hace 4 años
padre
commit
ad019a819d

+ 4 - 10
Areas/Admin/Controllers/MainServer/SysToolsController.cs

@@ -1194,10 +1194,10 @@ namespace MySystem.Areas.Admin.Controllers
                 {
                     return "原机具SN不正确";
                 }
-                if (oldpos.BindingState != 1)
-                {
-                    return "原机具未绑定";
-                }
+                // if (oldpos.BindingState != 1)
+                // {
+                //     return "原机具未绑定";
+                // }
                 PosMachinesTwo newpos = db.PosMachinesTwo.FirstOrDefault(m => m.Id == newForSnNo.SnId);
                 if (oldpos == null)
                 {
@@ -1266,9 +1266,6 @@ namespace MySystem.Areas.Admin.Controllers
                 BackProductName = newPosBrand.Name;
                 ChangeDeviceName = oldpos.DeviceName;
                 ChangeSnExpand += oldpos.PosSn + "\n";
-                RedisDbconn.Instance.Clear("PosMachinesTwo:" + oldpos.Id);
-                RedisDbconn.Instance.Clear("PosMachinesTwo:" + newpos.Id);
-                RedisDbconn.Instance.Clear("PosMerchantInfo:" + merchant.Id);
                 PublicFunction.SycnMachineCount(oldpos.BuyUserId, oldpos.BrandId);
             }
             add.BackProductType = BackProductType; //退回产品类型
@@ -1366,15 +1363,12 @@ namespace MySystem.Areas.Admin.Controllers
                 ApplyNo = "U" + DateTime.Now.ToString("yyyyMMddHHmmssfff") + function.get_Random(8),
             });
             pos.BindMerchantId = 0;
-            pos.Status = -2;
             pos.BindingState = 0;
             pos.BindingTime = DateTime.Parse("1900-01-01");
             pos.UserId = pos.BuyUserId;
             string IdBrand = pos.BuyUserId + "_" + pos.BrandId;
             db.SaveChanges();
             PublicFunction.SycnMachineCount(pos.BuyUserId, pos.BrandId);
-            RedisDbconn.Instance.Clear("UserMachineData:" + IdBrand);
-            RedisDbconn.Instance.Clear("PosMachinesTwo:" + pos.Id);
             return "success";
         }
         #endregion

+ 7 - 4
Controllers/HomeController.cs

@@ -268,10 +268,13 @@ namespace MySystem.Controllers
                     Orders order = db.Orders.FirstOrDefault(m => m.Id == apply.QueryCount);
                     if(order != null)
                     {
-                        string[] SwapSnExpands = order.SnNos.TrimEnd('\n').Split('\n');
-                        foreach(string no in SwapSnExpands)
+                        if(!string.IsNullOrEmpty(order.SnNos))
                         {
-                            ChildNo(db, no, coupon.LeaderUserId);
+                            string[] SwapSnExpands = order.SnNos.TrimEnd('\n').Split('\n');
+                            foreach(string no in SwapSnExpands)
+                            {
+                                ChildNo(db, no, coupon.LeaderUserId);
+                            }
                         }
                     }
                 }
@@ -304,7 +307,7 @@ namespace MySystem.Controllers
                         if(pos != null)
                         {
                             // pos.LeaderUserId = LeaderUserId;
-                            Library.function.WriteLog(LeaderUserId + ":" + pos.PosSn, "大盟主奖励标记机具");
+                            Library.function.WriteLog(LeaderUserId + ":" + pos.PosSn + ":" + apply.SwapSnExpand.TrimEnd('\n').Split('\n').Length, "大盟主奖励标记机具");
                         }
                     }
                 }

+ 5 - 5
Startup.cs

@@ -133,11 +133,11 @@ namespace MySystem
                     pattern: "{controller=Home}/{action=Index}/{Id?}");
             });
 
-            ResetUserTradeService.Instance.Start();
-            ResetMerchantTradeService.Instance.Start();
-            SycnProfitService.Instance.Start();
-            ExcelHelper.Instance.Start();
-            TestHelper.Instance.Start();
+            // ResetUserTradeService.Instance.Start();
+            // ResetMerchantTradeService.Instance.Start();
+            // SycnProfitService.Instance.Start();
+            // ExcelHelper.Instance.Start();
+            // TestHelper.Instance.Start();
         }
 
 

+ 2 - 2
appsettings.json

@@ -11,8 +11,8 @@
     "ConnectionStrings": "",
     "Host": "http://test.bs.kexiaoshuang.com/",
     "Database": "KxsMainServer",
-    "SqlConnStr": "server=47.109.31.237;port=3306;user=KxsMainServer;password=Rw2imhXQQt5ODWIF;database=KxsMainServer;charset=utf8;",
-    "StatSqlConnStr": "server=47.109.31.237;port=3306;user=KxsMainServer;password=Rw2imhXQQt5ODWIF;database=KxsMainServer;charset=utf8;ConnectionTimeout=600;DefaultCommandTimeout=600;",
+    "SqlConnStr": "server=47.108.231.170;port=3306;user=KxsMainServer;password=Rw2imhXQQt5ODWIF;database=KxsMainServer;charset=utf8;",
+    "StatSqlConnStr": "server=47.108.231.170;port=3306;user=KxsMainServer;password=Rw2imhXQQt5ODWIF;database=KxsMainServer;charset=utf8;ConnectionTimeout=600;DefaultCommandTimeout=600;",
     "BsSqlConnStr": "server=47.109.31.237;port=3306;user=KxsBsServer;password=wyA1bEhi6aAkN8SB;database=KxsBsServer;charset=utf8;",
     "SpSqlConnStr": "server=47.109.31.237;port=3306;user=KxsSpServer;password=jJ9qKsvwWgQA9xWG;database=KxsSpServer;charset=utf8;",
     "CashSqlConnStr": "server=47.109.31.237;port=3306;user=KxsCashServer;password=LNGvM18W6SaIGKBC;database=KxsCashServer;charset=utf8;",