Prechádzať zdrojové kódy

删除冗余代码,调整消息推送执行顺序

DuGuYang 2 rokov pred
rodič
commit
f6ccc24506

+ 23 - 22
Areas/Admin/Controllers/MainServer/SysToolsController.cs

@@ -626,17 +626,6 @@ namespace MySystem.Areas.Admin.Controllers
             {
                 return "创客编号不存在";
             }
-            if (pos.PreUserId > 0)
-            {
-                if (pos.BuyUserId == 0)
-                {
-                    pos.BuyUserId = user.Id;
-                }
-                if (pos.UserId == 0)
-                {
-                    pos.UserId = user.Id;
-                }
-            }
             if (pos.BindingState == 0)
             {
                 SpModels.BindRecord bind = spdb.BindRecord.FirstOrDefault(m => m.MerSnNo == PosSn);
@@ -759,18 +748,18 @@ namespace MySystem.Areas.Admin.Controllers
                 {
                     if (AddActPrize == 1)
                     {
-                        if (IsSend == 1)
-                        {
-                            RedisDbconn.Instance.AddList("MsgPersonalQueue", Newtonsoft.Json.JsonConvert.SerializeObject(new MsgPersonal()
-                            {
-                                UserId = pos.BuyUserId, //接收创客
-                                MsgType = 2,
-                                Title = "补录成功通知", //标题
-                                Summary = "您的 " + kqProducts.Name + " SN:" + pos.PosSn + "已经成功补录,请查收。",
-                                CreateDate = DateTime.Now,
+                        // if (IsSend == 1)
+                        // {
+                        //     RedisDbconn.Instance.AddList("MsgPersonalQueue", Newtonsoft.Json.JsonConvert.SerializeObject(new MsgPersonal()
+                        //     {
+                        //         UserId = pos.BuyUserId, //接收创客
+                        //         MsgType = 2,
+                        //         Title = "补录成功通知", //标题
+                        //         Summary = "您的 " + kqProducts.Name + " SN:" + pos.PosSn + "已经成功补录,请查收。",
+                        //         CreateDate = DateTime.Now,
 
-                            }));
-                        }
+                        //     }));
+                        // }
                         return "激活奖励已补录";
                     }
                     else
@@ -868,6 +857,18 @@ namespace MySystem.Areas.Admin.Controllers
                 pos.BindMerchantId = merchant.Id;
             }
             db.SaveChanges();
+            if (IsSend == 1)
+            {
+                RedisDbconn.Instance.AddList("MsgPersonalQueue", Newtonsoft.Json.JsonConvert.SerializeObject(new MsgPersonal()
+                {
+                    UserId = pos.BuyUserId, //接收创客
+                    MsgType = 2,
+                    Title = "补录成功通知", //标题
+                    Summary = "您的 " + kqProducts.Name + " SN:" + pos.PosSn + "已经成功补录,请查收。",
+                    CreateDate = DateTime.Now,
+
+                }));
+            }
             function.WriteLog(DateTime.Now.ToString() + "\n" + SysUserName + "\nMakerCode:" + MakerCode + ", PosSn:" + PosSn + ", MerNo:" + MerNo + ", AddActPrize:" + AddActPrize, "机具补录日志");
             return "success";
         }