lichunlei 4 лет назад
Родитель
Сommit
a6f3d02ca3

+ 13 - 3
Areas/Admin/Controllers/MainServer/SysToolsController.cs

@@ -103,7 +103,7 @@ namespace MySystem.Areas.Admin.Controllers
         }
         }
 
 
         [HttpPost]
         [HttpPost]
-        public string CheckMachineDo(string MakerCode, string PosSn, string MerNo = "", int AddActPrize = 0)
+        public string CheckMachineDo(string MakerCode, string PosSn, string MerNo = "", int AddActPrize = 0, int IsPre = 0)
         {
         {
             if (string.IsNullOrEmpty(MakerCode))
             if (string.IsNullOrEmpty(MakerCode))
             {
             {
@@ -123,6 +123,17 @@ namespace MySystem.Areas.Admin.Controllers
             {
             {
                 return "创客编号不存在";
                 return "创客编号不存在";
             }
             }
+            if(IsPre == 1)
+            {
+                if(pos.BuyUserId == 0)
+                {
+                    pos.BuyUserId = user.Id;
+                }
+                if(pos.UserId == 0)
+                {
+                    pos.UserId = user.Id;
+                }
+            }
             if (pos.BindingState == 0)
             if (pos.BindingState == 0)
             {
             {
                 SpModels.BindRecord bind = spdb.BindRecord.FirstOrDefault(m => m.MerSnNo == PosSn);
                 SpModels.BindRecord bind = spdb.BindRecord.FirstOrDefault(m => m.MerSnNo == PosSn);
@@ -324,8 +335,7 @@ namespace MySystem.Areas.Admin.Controllers
                 pos.BindMerchantId = merchant.Id;
                 pos.BindMerchantId = merchant.Id;
             }
             }
             db.SaveChanges();
             db.SaveChanges();
-            RedisDbconn.Instance.Clear("PosMerchantInfo:" + merchant.Id);
-            RedisDbconn.Instance.Clear("PosMachinesTwo:" + pos.Id);
+            function.WriteLog(DateTime.Now.ToString() + "\n" + SysUserName + "\nMakerCode:" + MakerCode + ", PosSn:" + PosSn + ", MerNo:" + MerNo + ", AddActPrize:" + AddActPrize + ", IsPre:" + IsPre, "机具补录日志");
             return "success";
             return "success";
         }
         }
         public IActionResult CheckMachine2(string right)
         public IActionResult CheckMachine2(string right)

+ 7 - 0
Areas/Admin/Views/MainServer/SysTools/CheckMachine.cshtml

@@ -57,6 +57,13 @@
                                             lay-skin="switch" lay-filter="switchTest" title="开关">
                                             lay-skin="switch" lay-filter="switchTest" title="开关">
                                     </div>
                                     </div>
                                 </div>
                                 </div>
+                                <div class="layui-form-item">
+                                    <label class="layui-form-label">是否预发机</label>
+                                    <div class="layui-input-block">
+                                        <input type="checkbox" id="IsPre" name="IsPre" value="1"
+                                            lay-skin="switch" lay-filter="switchTest" title="开关">
+                                    </div>
+                                </div>
                             </div>
                             </div>
 
 
                         </div>
                         </div>