Jelajahi Sumber

推送额外数据统一用ext_field字段

lcl 1 tahun lalu
induk
melakukan
3f14dcd9b2

TEMPAT SAMPAH
.DS_Store


+ 5 - 1
AppStart/Helper/PosPushDataNewHelper.cs

@@ -151,7 +151,7 @@ namespace MySystem
                 dataContent.Add("brand", int.Parse(function.CheckInt(act.ProductType))); //品牌
                 if(act.ProductType == "29")
                 {
-                    dataContent.Add("act_code", act.Field4); //押金活动编码
+                    dataContent.Add("ext_field", act.Field4); //押金活动编码
                 }
                 else if(act.ProductType == "14")
                 {
@@ -377,6 +377,10 @@ namespace MySystem
                 {
                     dataContent.Add("is_first", 1);
                 }
+                if(trade.ProductType == "23")
+                {
+                    dataContent.Add("ext_field", trade.ChannelSerial);
+                }
                 Push("trade", dataContent);
             }
             catch (Exception ex)

+ 2 - 2
AppStart/Helper/SycnSpServer/SycnSpTradeWifiService.cs

@@ -96,8 +96,8 @@ namespace MySystem
 
                             add.Duration = Months;
                             add.Unit = "m";
-                            WifiTradeHelper.Instance.DoOne(db, add.Id, DateTime.Now.ToString("yyyy-MM"), true);
-                            db.SaveChanges();                            
+                            WifiTradeHelper.Instance.DoOne(db, add.Id, DateTime.Now.ToString("yyyy-MM"), trade.TradeSerialNo, true);
+                            db.SaveChanges();
                         }
                         if(trade.SerEntryMode == "1")
                         {

+ 20 - 19
AppStart/WifiTradeHelper.cs

@@ -136,26 +136,26 @@ public class WifiTradeHelper
     }
 
 
-    public void DoSomethingNew(string Month)
-    {
-        WebCMSEntities db = new WebCMSEntities();
-        MySystem.ReadModels.WebCMSEntities rdb = new MySystem.ReadModels.WebCMSEntities();
-        DateTime end = DateTime.Parse(Month + "-01 00:00:00").AddMonths(1);
-        List<string> SnNos = new List<string>();
-        List<MySystem.ReadModels.WifiTradeRecord> trades = rdb.WifiTradeRecord.Where(m => m.Duration >= m.DoMonths && m.CreateDate < end).ToList();
-        foreach(MySystem.ReadModels.WifiTradeRecord trade in trades)
-        {
-            if(trade.Unit == "m" && trade.Duration > 0 && !SnNos.Contains(trade.SnNo))
-            {
-                DoOne(db, trade.Id, Month);
-                SnNos.Add(trade.SnNo);
-            }
-        }
-        db.SaveChanges();
-        db.Dispose();
-    }
+    // public void DoSomethingNew(string Month)
+    // {
+    //     WebCMSEntities db = new WebCMSEntities();
+    //     MySystem.ReadModels.WebCMSEntities rdb = new MySystem.ReadModels.WebCMSEntities();
+    //     DateTime end = DateTime.Parse(Month + "-01 00:00:00").AddMonths(1);
+    //     List<string> SnNos = new List<string>();
+    //     List<MySystem.ReadModels.WifiTradeRecord> trades = rdb.WifiTradeRecord.Where(m => m.Duration >= m.DoMonths && m.CreateDate < end).ToList();
+    //     foreach(MySystem.ReadModels.WifiTradeRecord trade in trades)
+    //     {
+    //         if(trade.Unit == "m" && trade.Duration > 0 && !SnNos.Contains(trade.SnNo))
+    //         {
+    //             DoOne(db, trade.Id, Month, "");
+    //             SnNos.Add(trade.SnNo);
+    //         }
+    //     }
+    //     db.SaveChanges();
+    //     db.Dispose();
+    // }
 
-    public void DoOne(WebCMSEntities db, int Id, string Month, bool time = false)
+    public void DoOne(WebCMSEntities db, int Id, string Month, string OrderNo, bool time = false)
     {
         WifiTradeRecord edit = db.WifiTradeRecord.FirstOrDefault(m => m.Id == Id);
         if(edit != null)
@@ -178,6 +178,7 @@ public class WifiTradeHelper
                     CreateDate = time ? DateTime.Now : DateTime.Parse(Month + "-01 01:00:00"),
                     ProductType = edit.BrandId.ToString(),
                     ErrorMsg = edit.DoMonths == 1 ? edit.TradeAmount.ToString() : "0",
+                    ChannelSerial = OrderNo,
                 });
             }
         }