Răsfoiți Sursa

Merge branch 'DuGuYang' into develop

lcl 3 ani în urmă
părinte
comite
fc79bd68ce
1 a modificat fișierele cu 82 adăugiri și 0 ștergeri
  1. 82 0
      Areas/Admin/Controllers/MainServer/SysToolsController.cs

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

@@ -4157,6 +4157,88 @@ namespace MySystem.Areas.Admin.Controllers
         }
 
         [HttpPost]
+        public string BadPosToStoreDo(string OldSn)
+        {
+            string[] OldSnList;
+            OldSnList = OldSn.Replace("\r", "").Split('\n');
+            string error = "";
+            List<string> opData = new List<string>();
+            for (int i = 0; i < OldSnList.Length; i++)
+            {
+                string OldSnNum = OldSnList[i];
+                MachineForSnNo oldForSnNo = db.MachineForSnNo.FirstOrDefault(m => m.SnNo == OldSnNum) ?? new MachineForSnNo();
+                PosMachinesTwo oldpos = db.PosMachinesTwo.FirstOrDefault(m => m.Id == oldForSnNo.SnId) ?? new PosMachinesTwo();
+                if (!opData.Contains(oldpos.BuyUserId + ":" + oldpos.BrandId))
+                {
+                    opData.Add(oldpos.BuyUserId + ":" + oldpos.BrandId);
+                }
+                oldpos.Status = 1;
+                oldpos.PosSnType = 0;
+                oldpos.QueryCount = 0;
+                oldpos.UpdateDate = null;
+                oldpos.ActivityList = null;
+                oldpos.SeoKeyword = null;
+                oldpos.SeoDescription = null;
+                oldpos.OrderId = 0;
+                oldpos.RecycEndDate = null;
+                oldpos.RecycBackCount = 0;
+                oldpos.PrizeParams = null;
+                oldpos.ScanQrTrade = 0;
+                oldpos.BindMerchantId = 0;
+                oldpos.CreditTrade = 0;
+                oldpos.DebitCardTrade = 0;
+                oldpos.IsVip = 0;
+                oldpos.UserNav = null;
+                oldpos.TransferTime = null;
+                oldpos.IsPurchase = 0;
+                oldpos.Detail = null;
+                oldpos.BindingTime = null;
+                oldpos.BindingState = 0;
+                oldpos.ActivationTime = null;
+                oldpos.ActivationState = 0;
+                oldpos.LeaderUserId = 0;
+                oldpos.PreUserId = 0;
+                oldpos.IsFirst = 0;
+                oldpos.DownFeeMan = null;
+                oldpos.DownFeeFlag = 0;
+                oldpos.DownFeeDate = null;
+                oldpos.UpFeeMan = null;
+                oldpos.UpFeeFlag = 0;
+                oldpos.UpFeeDate = null;
+                oldpos.OpReserve1 = 0;
+                oldpos.OpReserve2 = 0;
+                oldpos.OpReserve3 = 0;
+                oldpos.OpId = 0;
+                oldpos.RecycStartDate = null;
+                oldpos.SourcePosSn = null;
+                oldpos.BuyUserId = 0;
+                oldpos.UserId = 0;
+                PublicFunction.ClearPosHistory(db, oldpos.PosSn); //清除机具历史记录
+            }
+            if (!string.IsNullOrEmpty(error))
+            {
+                return "Warning|" + error;
+            }
+            db.SaveChanges();
+            foreach (string sub in opData)
+            {
+                string[] datalist = sub.Split(":");
+                PublicFunction.SycnMachineCount(int.Parse(datalist[0]), int.Parse(datalist[1]));
+            }
+            return "success";
+        }
+        #endregion
+
+        #region 划拨创客机具券
+
+        public IActionResult TransferPosCoupon(string right)
+        {
+            ViewBag.RightInfo = RightInfo;
+            ViewBag.right = right;
+
+            return View();
+        }
+
         public string TransferPosCouponDo(string Kind, string PosCouponCodes, string FromMakerCode, string ToMakerCode, string LeaderMakerCode = "")
         {
             if (string.IsNullOrEmpty(Kind))