Przeglądaj źródła

调整机具驳回仓库
修改相关数据字段
机具管理创客修改为buyuserid显示

DuGuYang 3 lat temu
rodzic
commit
79807693ca

+ 3 - 3
Areas/Admin/Controllers/MainServer/PosMachinesTwoController.cs

@@ -126,11 +126,11 @@ namespace MySystem.Areas.Admin.Controllers
                 if (ActivationState == 0) dic["ActivationState"] = "未激活";
                 if (ActivationState == 1) dic["ActivationState"] = "已激活";
                 //所属创客
-                int UserId = int.Parse(function.CheckInt(dic["UserId"].ToString()));
-                Users userid_Users = db.Users.FirstOrDefault(m => m.Id == UserId) ?? new Users();
+                int BuyUserId = int.Parse(function.CheckInt(dic["BuyUserId"].ToString()));
+                Users userid_Users = db.Users.FirstOrDefault(m => m.Id == BuyUserId) ?? new Users();
                 dic["UserIdMakerCode"] = userid_Users.MakerCode;
                 dic["UserIdRealName"] = userid_Users.RealName;
-                dic.Remove("UserId");
+                dic.Remove("BuyUserId");
                 //所属仓库
                 int StoreId = int.Parse(function.CheckInt(dic["StoreId"].ToString()));
                 StoreHouse storeid_StoreHouse = db.StoreHouse.FirstOrDefault(m => m.Id == StoreId) ?? new StoreHouse();

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

@@ -715,6 +715,7 @@ namespace MySystem.Areas.Admin.Controllers
                         var user = db.Users.FirstOrDefault(m => m.Id == toStore.UserId) ?? new Users();
                         var userAccount = db.UserAccount.FirstOrDefault(m => m.Id == toStore.UserId) ?? new UserAccount();
                         var brandInfo = db.KqProducts.FirstOrDefault(m => m.Id == Convert.ToInt32(BrandId)) ?? new KqProducts();
+                        var fuserMachineData = db.UserMachineData.FirstOrDefault(m => m.IdBrand == user.Id + "_" + brandInfo.Id);
                         if (brandInfo.Name.Contains("电签"))
                         {
                             amount = 200;
@@ -863,7 +864,30 @@ namespace MySystem.Areas.Admin.Controllers
 
                                 posInfo.StoreId = toStore.Id;
                                 posInfo.BuyUserId = 0;
+                                posInfo.UserId = 0;
+                                posInfo.RecycEndDate = null;
+                                posInfo.PosSnType = 0;
+                                posInfo.BindMerchantId = 0;
+                                posInfo.ActivityList = null;
+                                posInfo.ScanQrTrade = 0;
+                                posInfo.DebitCardTrade = 0;
+                                posInfo.PrizeParams = null;
+                                posInfo.IsVip = 0;
+                                posInfo.CreditTrade = 0;
+                                posInfo.UserNav = null;
+                                posInfo.TransferTime = null;
+                                posInfo.IsPurchase = 0;
+                                posInfo.BindingTime = null;
+                                posInfo.BindingState = 0;
+                                posInfo.ActivationTime = null;
+                                posInfo.ActivationState = 0;
+                                posInfo.LeaderUserId = 0;
+                                posInfo.PreUserId = 0;
+                                posInfo.IsFirst = 0;
+                                fuserMachineData.TotalMachineCount -= 1;
+                                fuserMachineData.UnBindCount -= 1;
                                 toStore.LaveNum += 1;
+                                toStore.TotalNum += 1;
                                 db.SaveChanges();
                             }
                             db.SaveChanges();