Browse Source

通道变更成功后通知消息给创客

lcl 1 year ago
parent
commit
e5cbdf0399
1 changed files with 14 additions and 0 deletions
  1. 14 0
      AppStart/PosChannelHelper.cs

+ 14 - 0
AppStart/PosChannelHelper.cs

@@ -62,6 +62,20 @@ 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'>尊敬的" + user.RealName + "盟主您好:<br/>您名下的机具" + pos.PosSn + ",通道已更改为" + ChannelName + ",请知悉</ div > ",//内容
+                            CreateDate = DateTime.Now,
+                        }));
                     }
                 }
             }