lcl 11 miesięcy temu
rodzic
commit
c666f42d23

+ 2 - 0
AppStart/Helper/AlipayPayBack2Service.cs

@@ -877,6 +877,8 @@ namespace MySystem
                         if((user.UserType >= 1 || user.LeaderLevel > 0) && Money > 0)
                         {
                             ChangeAccount(db, order, user.Id, Money, ChangeType);
+                            //发送APP推送消息
+                            Utils.Instance.PrizePush(user.Id, Money);
                             Money = 0;
                         }
                     }

+ 3 - 0
AppStart/Helper/OperatePrizeService.cs

@@ -97,6 +97,9 @@ namespace MySystem
                                         QueryCount = PosId,
                                     }).Entity;
                                     db.SaveChanges();
+
+                                    //发送APP推送消息
+                                    Utils.Instance.PrizePush(OpId, ChangeAmount);
                                 }
                             }
                             db.Dispose();

+ 6 - 0
AppStart/Helper/PosCouponPrize/PosCouponPrizeService.cs

@@ -456,6 +456,9 @@ namespace MySystem
                 QueryCount = OrderId,
             }).Entity;
             db.SaveChanges();
+
+            //发送APP推送消息
+            Utils.Instance.PrizePush(UserId, 100 * Count);
         }
     
         /// <summary>
@@ -663,6 +666,9 @@ namespace MySystem
                 Kind = Kind,
             }).Entity;
             db.SaveChanges();
+
+            //发送APP推送消息
+            Utils.Instance.PrizePush(UserId, Money * Count);
         }
 
         /// <summary>

+ 6 - 0
AppStart/Helper/StatService.cs

@@ -856,6 +856,9 @@ namespace MySystem
                     QueryCount = pos.Id, //机具Id
                 }).Entity;
                 db.SaveChanges();
+
+                //发送APP推送消息
+                Utils.Instance.PrizePush(GetUserId, ActPrize);
             }
         }
 
@@ -3323,6 +3326,9 @@ namespace MySystem
                 Kind = 3,
             }).Entity;
             db.SaveChanges();
+
+            //发送APP推送消息
+            Utils.Instance.PrizePush(puser.Id, Prize);
         }
 
         #endregion

+ 15 - 2
Util/Utils.cs

@@ -324,7 +324,20 @@ namespace MySystem
         #endregion 
     
     
-    
-    
+
+        #region 推送奖励信息
+
+        public void PrizePush(int UserId, decimal Prize)
+        {
+            WebCMSEntities db = new WebCMSEntities();
+            Users user = db.Users.FirstOrDefault(m => m.Id == UserId) ?? new Users();
+            if(!string.IsNullOrEmpty(user.DeviceType))
+            {
+                RedisDbconn.Instance.AddList("AliyunPushQueue", "{\"Account\":\"" + user.Mobile + "\",\"Device\":\"" + user.DeviceType.ToUpper() + "\",\"Title\":\"客小爽创客版\",\"Body\":\"奖励到账" + Prize.ToString("f2") +"元,打开收支明细查看!\"}");
+            }
+            db.Dispose();
+        }
+
+        #endregion 
     }
 }