Selaa lähdekoodia

通道审核成功推送消息逻辑变更

lcl 1 vuosi sitten
vanhempi
commit
9bda870144
1 muutettua tiedostoa jossa 15 lisäystä ja 14 poistoa
  1. 15 14
      AppStart/PosChannelHelper.cs

+ 15 - 14
AppStart/PosChannelHelper.cs

@@ -51,6 +51,7 @@ public class PosChannelHelper
         foreach(PosChannelSet main in mains)
         {
             int PassCount = 0;
+            string PosSnList = "";
             List<PosChannelSetRecord> list = db.PosChannelSetRecord.Where(m => m.RecordId == main.Id).ToList();
             foreach(PosChannelSetRecord sub in list)
             {
@@ -66,20 +67,7 @@ public class PosChannelHelper
                         {
                             edit.Status = 1;
                             db.SaveChanges();
-                            PosMachinesTwo pos = db.PosMachinesTwo.FirstOrDefault(m => m.Id == edit.PosId) ?? new PosMachinesTwo();
-                            Users user = db.Users.FirstOrDefault(m => m.Id == pos.BuyUserId) ?? new Users();
-                            string ChannelName = "";
-                            if(sub.ChannelNo == "48130000") ChannelName = "环讯";
-                            if(sub.ChannelNo == "48310000") ChannelName = "易生";
-                            if(sub.ChannelNo == "48330000") ChannelName = "海科";
-                            if(sub.ChannelNo == "48470000") ChannelName = "中付";
-                            RedisDbconn.Instance.AddList("MsgPersonalQueue", Newtonsoft.Json.JsonConvert.SerializeObject(new MsgPersonal()
-                            {
-                                UserId = pos.BuyUserId, //创客
-                                Title = "机具通道变更通知", //标题
-                                Content = "<div class='f16' style='padding:12px 16px;'>尊敬的" + user.RealName + "盟主您好:<br/><br/><div class='f14' style='text-indent:2em;'>您名下的机具" + pos.PosSn + ",通道已更改为" + ChannelName + ",请知悉!</ div> </ div>", //内容
-                                CreateDate = DateTime.Now,
-                            }));
+                            PosSnList += edit.PosSn + ",";
                             PassCount += 1;
                         }
                     // }
@@ -92,6 +80,19 @@ public class PosChannelHelper
                 {
                     edit.Status = 1;
                     db.SaveChanges();
+                    Users user = db.Users.FirstOrDefault(m => m.Id == edit.UserId) ?? new Users();
+                    string ChannelName = "";
+                    if(edit.ChannelNo == "48130000") ChannelName = "环讯";
+                    if(edit.ChannelNo == "48310000") ChannelName = "易生";
+                    if(edit.ChannelNo == "48330000") ChannelName = "海科";
+                    if(edit.ChannelNo == "48470000") ChannelName = "中付";
+                    RedisDbconn.Instance.AddList("MsgPersonalQueue", Newtonsoft.Json.JsonConvert.SerializeObject(new MsgPersonal()
+                    {
+                        UserId = edit.UserId, //创客
+                        Title = "机具通道变更通知", //标题
+                        Content = "<div class='f16' style='padding:12px 16px;'>尊敬的" + user.RealName + "盟主您好:<br/><br/><div class='f14' style='text-indent:2em;'>您名下的机具" + PosSnList.TrimEnd(',') + ",通道已更改为" + ChannelName + ",请知悉!</ div> </ div>", //内容
+                        CreateDate = DateTime.Now,
+                    }));
                 }
             }
         }