瀏覽代碼

奖励埋点结束

lcl 1 年之前
父節點
當前提交
d2d8c569da

+ 6 - 0
AppStart/Helper/AlipayPayBack2Service.cs

@@ -248,6 +248,9 @@ namespace MySystem
                                 if(Prize > 0 && BeforeLeaderLevel < 2 && user.UserType == 0)
                                 {
                                     LeaderRecommendPrize(db, order, user.Id, Prize, 122);
+
+                                    //发放奖励MQ
+                                    PrizeSetHelper.Do("7", order.OrderNo);
                                 }
                             }
                         }
@@ -265,6 +268,9 @@ namespace MySystem
                             if(Prize > 0 && BeforeLeaderLevel < 1 && user.UserType == 0)
                             {
                                 LeaderRecommendPrize(db, order, user.Id, Prize, 123);
+
+                                //发放奖励MQ
+                                PrizeSetHelper.Do("7", order.OrderNo);
                             }
                         }
                     }

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

@@ -303,6 +303,9 @@ namespace MySystem
                             }
                         }
                     }
+
+                    //发放奖励MQ
+                    PrizeSetHelper.Do("3", order.OrderNo);
                 }
             }
             db.Dispose();

+ 13 - 1
AppStart/Helper/PrizeSetHelper.cs

@@ -17,7 +17,19 @@ namespace MySystem
 
         public static void Do(string type, string no)
         {
-            
+            try
+            {
+                string field = "PosSn";
+                if(type == "3" || type == "7") field = "OrderNo";
+                Dictionary<string, string> data = new Dictionary<string, string>();
+                data.Add("prize_tag", type);
+                data.Add("content", "{\"" + field + "\":\"" + no + "\"}");
+                RedisDbconn.Instance.AddList("PrizeSendQueue", Newtonsoft.Json.JsonConvert.SerializeObject(data));
+            }
+            catch(Exception ex)
+            {
+                function.WriteLog(DateTime.Now.ToString() + "\n" + ex.ToString(), "发送MQ奖励数据异常");
+            }
         }
     }
 }

+ 11 - 0
AppStart/Helper/SycnSpServer/SycnSpActiveService.cs

@@ -206,6 +206,9 @@ namespace MySystem
                                     {
                                         RedisDbconn.Instance.AddList("OperatePrizeQueue", pos.Id);
                                     }
+
+                                    //发放奖励MQ
+                                    PrizeSetHelper.Do("5", pos.PosSn);
                                 }
                                 else
                                 {
@@ -216,6 +219,11 @@ namespace MySystem
                                     db.SaveChanges();
                                 }
                             }
+                            else
+                            {
+                                //发放奖励MQ
+                                PrizeSetHelper.Do("1", pos.PosSn);
+                            }
 
                             ActivateRecord edit = spdb.ActivateRecord.FirstOrDefault(m => m.Id == act.Id);
                             if (edit != null)
@@ -226,6 +234,9 @@ namespace MySystem
                         pos = db.PosMachinesTwo.FirstOrDefault(m => m.PosSn == act.SnNo && m.ActivationState == 1);
                         if (pos != null)
                         {
+                            //发放奖励MQ
+                            PrizeSetHelper.Do("1", pos.PosSn);
+
                             ActivateRecord edit = spdb.ActivateRecord.FirstOrDefault(m => m.Id == act.Id);
                             if (edit != null)
                             {

+ 6 - 0
AppStart/Helper/SycnSpServer/SycnSpBindService.cs

@@ -393,6 +393,12 @@ namespace MySystem
                                 {
                                     bool PrizeFlag = pos.CardType > 0 && ActualAmount >= 100;
                                     SycnSpTradeService.Instance.ActPos(db, pos, 0, 30, PrizeFlag, Bind.SeoKeyword);
+
+                                    if(PrizeFlag)
+                                    {
+                                        //发放奖励MQ
+                                        PrizeSetHelper.Do("4", pos.PosSn);
+                                    }
                                 }
                                 db.SaveChanges();
                             }

+ 3 - 0
AppStart/Helper/SycnSpServer/SycnSpMerchantService.cs

@@ -237,6 +237,9 @@ namespace MySystem
 
                                     //检查交易状态,并发奖励
                                     WifiSendPrize(db, pos, add);
+
+                                    //发放奖励MQ
+                                    PrizeSetHelper.Do("6", pos.PosSn);
                                 }
 
                                 Merchants edit = spdb.Merchants.FirstOrDefault(m => m.Id == Mer.Id);

+ 3 - 0
AppStart/Helper/SycnSpServer/SycnSpTradeService.cs

@@ -575,6 +575,9 @@ namespace MySystem
                                         //     string Send = "{\"Kind\":\"4\",\"Data\":{\"PosId\":\"" + pos.Id + "\",\"TradeMonth\":\"" + trade.CreateDate.Value.ToString("yyyyMM") + "\",\"TradeAmount\":\"" + TradeAmount + "\"}}";
                                         //     RedisDbconn.Instance.AddList("RecommendActStatQueue", Send);
                                         // }
+
+                                        //发放奖励MQ
+                                        PrizeSetHelper.Do("1", pos.PosSn);
                                     }
                                     TradeRecord edit = spdb.TradeRecord.FirstOrDefault(m => m.Id == trade.Id);
                                     if (edit != null)