瀏覽代碼

对接拉卡拉

lcl 7 月之前
父節點
當前提交
73693bdc73

+ 1 - 1
AppStart/Helper/SycnSpServer/SycnSpBindService.cs

@@ -40,7 +40,7 @@ namespace MySystem
                         var tran = db.Database.BeginTransaction();
                         try
                         {
-                            if(Bind.Field1 == "解绑" && (Bind.ProductType == "1" || Bind.ProductType == "23" || Bind.ProductType == "27"))
+                            if((Bind.Field1 == "解绑" || Bind.Field1 == "UNBIND") && (Bind.ProductType == "1" || Bind.ProductType == "23" || Bind.ProductType == "27" || Bind.ProductType == "30"))
                             {
                                 // 删除对应商户,激活机具除外
                                 PxcModels.PosMachinesTwo pos = db.PosMachinesTwo.FirstOrDefault(m => m.PosSn == Bind.MerSnNo) ?? new PxcModels.PosMachinesTwo();

+ 1 - 27
AppStart/Helper/SycnSpServer/SycnSpMerchantRecordService.cs

@@ -31,7 +31,7 @@ namespace MySystem
                     PxcModels.WebCMSEntities db = new PxcModels.WebCMSEntities();
                     DateTime start = DateTime.Now.AddDays(-30);
                     int StartId = int.Parse(function.CheckInt(function.ReadInstance("/SycnSp/MerchantRecordId.txt")));
-                    var Mers = spdb.MerchantRecord.Where(m => m.Id >= StartId && m.CreateTime >= start && m.Status == 1 && m.ProductType == "12").OrderByDescending(m => m.Id).Take(10).ToList();
+                    var Mers = spdb.MerchantRecord.Where(m => m.Id >= StartId && m.CreateTime >= start && m.Status == 1 && (m.ProductType == "12" || m.ProductType == "30")).OrderByDescending(m => m.Id).Take(10).ToList();
                     foreach (var Mer in Mers)
                     {
                         var tran = db.Database.BeginTransaction();
@@ -58,25 +58,6 @@ namespace MySystem
                                 string startNo = Mer.LegalIdCard.Substring(0, 6);
                                 string endNo = Mer.LegalIdCard.Substring(Mer.LegalIdCard.Length - 4, 4).ToUpper();
                                 string Name = Mer.MerName;
-                                if (Mer.ProductType == "2")
-                                {
-                                    if (Name.Contains("-"))
-                                    {
-                                        Name = Name.Split('-')[1];
-                                    }
-                                    else if (Name.Contains("_"))
-                                    {
-                                        Name = Name.Split('_')[1];
-                                    }
-                                }
-                                else if (Mer.ProductType == "4" || Mer.ProductType == "8" || Mer.ProductType == "9")
-                                {
-                                    Name = Mer.SeoTitle;
-                                }
-                                else if (Mer.ProductType == "10")
-                                {
-                                    Name = Name.Replace("*", "");
-                                }
                                 Name = Name.Replace("个体户", "");
                                 Name = Name.Replace("个体商户", "");
                                 Name = Name.Replace("企业户", "");
@@ -95,13 +76,6 @@ namespace MySystem
                             }
                             pos.IsFirst = IsFirst;
                             db.SaveChanges();
-
-                            // if(pos.PrizeParams == "0")
-                            // {
-                            //     int RecordId = PublicFunction.FeeSetRecord(db, pos, merinfo, 0.63M);
-                            //     string info = "{\"RecordId\":\"" + RecordId + "\",\"PosId\":\"" + pos.Id + "\",\"Fee\": \"0.63\",\"Kind\": \"2\",\"OpMan\": \""+"系统"+"\"}";
-                            //     RedisDbconn.Instance.AddList("SetDepositQueue", info);
-                            // }
                             
                             MerchantRecord edit = spdb.MerchantRecord.FirstOrDefault(m => m.Id == Mer.Id);
                             if (edit != null)

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

@@ -38,7 +38,7 @@ namespace MySystem
                         try
                         {
                             PxcModels.PosMachinesTwo pos = db.PosMachinesTwo.FirstOrDefault(m => m.PosSn == Mer.SnNo) ?? new PxcModels.PosMachinesTwo();
-                            if (pos.BindingState == 1 && Mer.Field2 != "解绑")
+                            if (pos.BindingState == 1 && Mer.Field2 != "解绑" && Mer.Field2 != "UNBIND")
                             {
                                 PxcModels.Users user = db.Users.FirstOrDefault(m => m.Id == pos.UserId) ?? new PxcModels.Users();
                                 int TopUserId = 0;
@@ -47,7 +47,7 @@ namespace MySystem
                                     TopUserId = int.Parse(user.ParentNav.Trim(',').Replace(",,", ",").Split(',')[0]);
                                 }
                                 int BrandId = pos.BrandId;
-                                if (BrandId == 12 || BrandId == 13)
+                                if (BrandId == 12 || BrandId == 13 || BrandId == 30 || BrandId == 31)
                                 {
                                     MerchantRecord merinfo = spdb.MerchantRecord.FirstOrDefault(m => m.MerNo == Mer.MerNo);
                                     if(merinfo != null)

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

@@ -202,6 +202,29 @@ namespace MySystem
                                 spdb.SaveChanges();
                             }
                         }
+                        else if (trade.SerEntryMode == "DEPOSIT" && trade.ProductType == "30") //拉卡拉押金获取
+                        {
+                            if (trade.TradeAmount == 9900 || trade.TradeAmount == 19900 || trade.TradeAmount == 29900)
+                            {
+                                op = false;
+                                PxcModels.MachineForSnNo posFor = db.MachineForSnNo.FirstOrDefault(m => m.SnNo == TradeSnNo) ?? new PxcModels.MachineForSnNo();
+                                PxcModels.PosMachinesTwo pos = db.PosMachinesTwo.FirstOrDefault(m => m.Id == posFor.SnId);
+                                if (pos != null)
+                                {
+                                    if(string.IsNullOrEmpty(pos.SeoKeyword)) Utils.Instance.SendActData(pos);
+                                    pos.SeoKeyword = trade.TradeAmount.ToString("f2");
+                                    db.SaveChanges();
+                                    isDeposit = true;
+                                    function.WriteLog("押金监控:" + trade.MerNo, "服务费奖励发放日志");
+                                }
+                                TradeRecord edit = spdb.TradeRecord.FirstOrDefault(m => m.Id == trade.Id);
+                                if (edit != null)
+                                {
+                                    edit.Status = 2;
+                                }
+                                spdb.SaveChanges();
+                            }
+                        }
                         if (trade.DiscountRateFlag == "True")
                         {
                             op = false;

+ 1 - 1
Startup.cs

@@ -180,7 +180,7 @@ namespace MySystem
                 SycnSpTradeService.Instance.StartTradeStatus(); //恢复原始交易没有统计上的数据
                 SycnSpChangeBindService.Instance.Start(); //同步SP换绑数据
                 SycnSpUnBindService.Instance.Start(); //同步SP解绑数据
-                SycnSpMerchantRecordService.Instance.Start(); //同步SP商户记录数据 
+                SycnSpMerchantRecordService.Instance.Start(); //同步SP商户记录数据
 
                 StatService.Instance.StartActiveReward(); //实时处理激活奖励
                 StatService.Instance.StartActiveReward1(); //实时处理0押激活奖励