Przeglądaj źródła

接收数据判断wifi来源

lcl 9 miesięcy temu
rodzic
commit
1d96173936

+ 21 - 19
AppStart/Helper/SycnSpServer/SycnSpMerchantService.cs

@@ -207,26 +207,28 @@ namespace MySystem
                                 //WIFI设备默认设置押金
                                 if(pos.BrandId >= 23 && pos.BrandId <= 26 && pos.ActivationState == 0)
                                 {
-                                    decimal Prize = 0;
-                                    if(pos.BrandId == 23)
+                                    if(Mer.Field1 != "v2")
                                     {
-                                        pos.SeoKeyword = "30";
-                                        pos.PrizeParams = "30";
-                                    }
-                                    if(pos.BrandId == 24)
-                                    {
-                                        pos.SeoKeyword = "120";
-                                        pos.PrizeParams = "120";
-                                    }
-                                    if(pos.BrandId == 25)
-                                    {
-                                        pos.SeoKeyword = "200";
-                                        pos.PrizeParams = "200";
-                                    }
-                                    if(pos.BrandId == 26)
-                                    {
-                                        pos.SeoKeyword = "750";
-                                        pos.PrizeParams = "750";
+                                        if(pos.BrandId == 23)
+                                        {
+                                            pos.SeoKeyword = "30";
+                                            pos.PrizeParams = "30";
+                                        }
+                                        if(pos.BrandId == 24)
+                                        {
+                                            pos.SeoKeyword = "120";
+                                            pos.PrizeParams = "120";
+                                        }
+                                        if(pos.BrandId == 25)
+                                        {
+                                            pos.SeoKeyword = "200";
+                                            pos.PrizeParams = "200";
+                                        }
+                                        if(pos.BrandId == 26)
+                                        {
+                                            pos.SeoKeyword = "750";
+                                            pos.PrizeParams = "750";
+                                        }
                                     }
 
                                     pos.ActivationState = 1;

+ 42 - 17
AppStart/Helper/SycnSpServer/SycnSpTradeWifiService.cs

@@ -36,7 +36,7 @@ namespace MySystem
                     foreach (TradeRecord trade in trades.ToList())
                     {
                         bool check = db.SpOrderNos.Any(m => m.OrderNo == trade.TradeSerialNo);
-                        if (!check)
+                        if (!check && trade.SerEntryMode != "1")
                         {
                             decimal TradeAmount = trade.TradeAmount / 100;
                             PxcModels.PosMachinesTwo pos = db.PosMachinesTwo.FirstOrDefault(m => m.PosSn == trade.TradeSnNo);
@@ -61,25 +61,34 @@ namespace MySystem
                             //开始统计
                             int Months = 0;
 
-                            if(pos.BrandId == 23 && TradeAmount == 49) Months = 1;
-                            if(pos.BrandId == 23 && TradeAmount == 79) Months = 3;
-                            if(pos.BrandId == 23 && TradeAmount == 119) Months = 12;
-                            if(pos.BrandId == 23 && TradeAmount == 199) Months = 24;
+                            if(trade.SeoTitle == "v2")
+                            {
+                                string duration = trade.Field2; //设备套餐时长
+                                string unit = trade.Field3; //套餐单位 0:按天 1:按月
+                                if(unit == "1") Months = int.Parse(function.CheckInt(duration));
+                            }
+                            else
+                            {
+                                if(pos.BrandId == 23 && TradeAmount == 49) Months = 1;
+                                if(pos.BrandId == 23 && TradeAmount == 79) Months = 3;
+                                if(pos.BrandId == 23 && TradeAmount == 119) Months = 12;
+                                if(pos.BrandId == 23 && TradeAmount == 199) Months = 24;
 
-                            if(pos.BrandId == 24 && TradeAmount == 59) Months = 1;
-                            if(pos.BrandId == 24 && TradeAmount == 159) Months = 3;
-                            if(pos.BrandId == 24 && TradeAmount == 399) Months = 12;
-                            if(pos.BrandId == 24 && TradeAmount == 699) Months = 24;
+                                if(pos.BrandId == 24 && TradeAmount == 59) Months = 1;
+                                if(pos.BrandId == 24 && TradeAmount == 159) Months = 3;
+                                if(pos.BrandId == 24 && TradeAmount == 399) Months = 12;
+                                if(pos.BrandId == 24 && TradeAmount == 699) Months = 24;
 
-                            if(pos.BrandId == 25 && TradeAmount == 69) Months = 1;
-                            if(pos.BrandId == 25 && TradeAmount == 199) Months = 3;
-                            if(pos.BrandId == 25 && TradeAmount == 499) Months = 12;
-                            if(pos.BrandId == 25 && TradeAmount == 799) Months = 24;
+                                if(pos.BrandId == 25 && TradeAmount == 69) Months = 1;
+                                if(pos.BrandId == 25 && TradeAmount == 199) Months = 3;
+                                if(pos.BrandId == 25 && TradeAmount == 499) Months = 12;
+                                if(pos.BrandId == 25 && TradeAmount == 799) Months = 24;
 
-                            if(pos.BrandId == 26 && TradeAmount == 219) Months = 1;
-                            if(pos.BrandId == 26 && TradeAmount == 449) Months = 3;
-                            if(pos.BrandId == 26 && TradeAmount == 1399) Months = 12;
-                            if(pos.BrandId == 26 && TradeAmount == 2698) Months = 24;
+                                if(pos.BrandId == 26 && TradeAmount == 219) Months = 1;
+                                if(pos.BrandId == 26 && TradeAmount == 449) Months = 3;
+                                if(pos.BrandId == 26 && TradeAmount == 1399) Months = 12;
+                                if(pos.BrandId == 26 && TradeAmount == 2698) Months = 24;
+                            }
 
                             if(Months > 0)
                             {
@@ -110,6 +119,22 @@ namespace MySystem
                             }
                             
                         }
+                        if(trade.SerEntryMode == "1")
+                        {
+                            PxcModels.PosMachinesTwo pos = db.PosMachinesTwo.FirstOrDefault(m => m.PosSn == trade.TradeSnNo);
+                            if (pos != null)
+                            {
+                                pos.SeoKeyword = trade.TradeAmount.ToString();
+                                pos.PrizeParams = trade.TradeAmount.ToString();
+                                db.SaveChanges();
+                            }
+                            TradeRecord edit = spdb.TradeRecord.FirstOrDefault(m => m.Id == trade.Id);
+                            if (edit != null)
+                            {
+                                edit.Status = 2;
+                                spdb.SaveChanges();
+                            }
+                        }
                     }           
                     spdb.Dispose();
                     db.Dispose();