Procházet zdrojové kódy

机具驳回仓库、机具回仓库操作,重置创客机具数

lcl před 3 roky
rodič
revize
b5923159c3

+ 10 - 0
AppStart/ExcelHelper.cs

@@ -778,6 +778,7 @@ namespace MySystem
                                     {
                                         Size = list.Rows.Count - DoCount;
                                     }
+                                    List<string> opData = new List<string>();
                                     for (int i = DoCount; i < DoCount + Size; i++)
                                     {
                                         DataRow dr = list.Rows[i];
@@ -821,6 +822,10 @@ namespace MySystem
                                                     if (machine.Id > 0)
                                                     {
                                                         function.WriteLog(DateTime.Now.ToString() + "\n" + Newtonsoft.Json.JsonConvert.SerializeObject(machine), "机具回仓库日志");
+                                                        if(!opData.Contains(machine.BuyUserId + ":" + machine.BrandId))
+                                                        {
+                                                            opData.Add(machine.BuyUserId + ":" + machine.BrandId);
+                                                        }
                                                         machine.StoreId = tostorefor.StoreId;
                                                         machine.BuyUserId = 0;
                                                         machine.UserId = 0;
@@ -955,6 +960,11 @@ namespace MySystem
                                         db.SaveChanges();
                                     }
                                     db.SaveChanges();
+                                    foreach(string sub in opData)
+                                    {
+                                        string[] datalist = sub.Split(":");
+                                        PublicFunction.SycnMachineCount(int.Parse(datalist[0]), int.Parse(datalist[1]));
+                                    }
                                     tran.Commit();
                                     RedisDbconn.Instance.Set("CheckImport:" + checkKey, "success|" + SuccessCount);
                                     RedisDbconn.Instance.SetExpire("CheckImport:" + checkKey, 60000);

+ 16 - 0
Areas/Admin/Controllers/MainServer/StoreHouseController.cs

@@ -919,6 +919,7 @@ namespace MySystem.Areas.Admin.Controllers
                 string error = "";
                 decimal amount = 0;
                 List<string> PosSnList = new List<string>();
+                List<string> opData = new List<string>();
                 for (int i = 1; i < list.Count; i++)
                 {
                     JsonData dr = list[i];
@@ -1045,6 +1046,11 @@ namespace MySystem.Areas.Admin.Controllers
                                     AfterOutNum = toStore.OutNum, //操作后出库数
                                 }).Entity;
                                 db.SaveChanges();
+                                
+                                if(!opData.Contains(posInfo.BuyUserId + ":" + posInfo.BrandId))
+                                {
+                                    opData.Add(posInfo.BuyUserId + ":" + posInfo.BrandId);
+                                }
 
                                 posInfo.StoreId = toStore.Id;
                                 posInfo.BuyUserId = 0;
@@ -1135,6 +1141,11 @@ namespace MySystem.Areas.Admin.Controllers
                                 }).Entity;
                                 db.SaveChanges();
 
+                                if(!opData.Contains(posInfo.BuyUserId + ":" + posInfo.BrandId))
+                                {
+                                    opData.Add(posInfo.BuyUserId + ":" + posInfo.BrandId);
+                                }
+
                                 posInfo.StoreId = toStore.Id;
                                 posInfo.BuyUserId = 0;
                                 posInfo.UserId = 0;
@@ -1174,6 +1185,11 @@ namespace MySystem.Areas.Admin.Controllers
                 {
                     return "Warning|" + error;
                 }
+                foreach(string sub in opData)
+                {
+                    string[] datalist = sub.Split(":");
+                    PublicFunction.SycnMachineCount(int.Parse(datalist[0]), int.Parse(datalist[1]));
+                }
             }
             AddSysLog("0", "MachinesRejectStore", "Import");
             return "success";

+ 16 - 0
Areas/Admin/Controllers/MainServer/SysToolsController.cs

@@ -1602,6 +1602,7 @@ namespace MySystem.Areas.Admin.Controllers
             string[] OldSnList;
             string[] NewSnList;
             decimal amount = 0;
+            List<string> opData = new List<string>();
             //创客坏机换新
             if (ChangeType == "0")
             {
@@ -1716,6 +1717,11 @@ namespace MySystem.Areas.Admin.Controllers
                     newpos.UserId = oldpos.UserId;
                     newpos.PreUserId = oldpos.PreUserId;
 
+                    if(!opData.Contains(oldpos.BuyUserId + ":" + oldpos.BrandId))
+                    {
+                        opData.Add(oldpos.BuyUserId + ":" + oldpos.BrandId);
+                    }
+
                     oldpos.StoreId = storeBack.Id;
                     oldpos.QueryCount = 0;
                     oldpos.UpdateDate = null;
@@ -1905,6 +1911,11 @@ namespace MySystem.Areas.Admin.Controllers
                     newpos.IsFirst = oldpos.IsFirst;
                     newpos.TransferTime = oldpos.TransferTime;
 
+                    if(!opData.Contains(oldpos.BuyUserId + ":" + oldpos.BrandId))
+                    {
+                        opData.Add(oldpos.BuyUserId + ":" + oldpos.BrandId);
+                    }
+
                     oldpos.StoreId = storeBack.Id;
                     oldpos.QueryCount = 0;
                     oldpos.UpdateDate = null;
@@ -2098,6 +2109,11 @@ namespace MySystem.Areas.Admin.Controllers
             //         }));
             //     }
             // }
+            foreach(string sub in opData)
+            {
+                string[] datalist = sub.Split(":");
+                PublicFunction.SycnMachineCount(int.Parse(datalist[0]), int.Parse(datalist[1]));
+            }
             return "success";
         }
         #endregion

+ 16 - 0
Areas/Admin/Controllers/OperateServer/StoreHouseOperateController.cs

@@ -644,6 +644,7 @@ namespace MySystem.Areas.Admin.Controllers
                 string error = "";
                 decimal amount = 0;
                 List<string> PosSnList = new List<string>();
+                List<string> opData = new List<string>();
                 for (int i = 1; i < list.Count; i++)
                 {
                     JsonData dr = list[i];
@@ -770,6 +771,11 @@ namespace MySystem.Areas.Admin.Controllers
                                 }).Entity;
                                 db.SaveChanges();
 
+                                if(!opData.Contains(posInfo.BuyUserId + ":" + posInfo.BrandId))
+                                {
+                                    opData.Add(posInfo.BuyUserId + ":" + posInfo.BrandId);
+                                }
+
                                 posInfo.StoreId = toStore.Id;
                                 posInfo.BuyUserId = 0;
                                 posInfo.UserId = 0;
@@ -858,6 +864,11 @@ namespace MySystem.Areas.Admin.Controllers
                                 }).Entity;
                                 db.SaveChanges();
 
+                                if(!opData.Contains(posInfo.BuyUserId + ":" + posInfo.BrandId))
+                                {
+                                    opData.Add(posInfo.BuyUserId + ":" + posInfo.BrandId);
+                                }
+
                                 posInfo.StoreId = toStore.Id;
                                 posInfo.BuyUserId = 0;
                                 posInfo.UserId = 0;
@@ -897,6 +908,11 @@ namespace MySystem.Areas.Admin.Controllers
                 {
                     return "Warning|" + error;
                 }
+                foreach(string sub in opData)
+                {
+                    string[] datalist = sub.Split(":");
+                    PublicFunction.SycnMachineCount(int.Parse(datalist[0]), int.Parse(datalist[1]));
+                }
             }
             AddSysLog("0", "MachinesRejectStore", "Import");
             return "success";