Эх сурвалжийг харах

互斥日志和开机奖励日志,详细一点

lcl 2 жил өмнө
parent
commit
cc201862e9

+ 7 - 0
AppStart/Helper/StatService.cs

@@ -886,17 +886,21 @@ namespace MySystem
                         List<PosMachinesTwo> posList = db.PosMachinesTwo.Where(m => m.Id == PosId && m.ActivationState == 1 && !string.IsNullOrEmpty(m.SeoKeyword) && m.SeoKeyword != "0" && m.CreditTrade >= 1000).ToList();
                         foreach (PosMachinesTwo pos in posList)
                         {
+                            function.WriteLog("\n\n" + DateTime.Now.ToString() + "\nsn:" + pos.PosSn, "开机奖励发放日志");
                             if (pos.BindingTime > DateTime.Now.AddDays(-30))
                             {
                                 decimal ActPrize = decimal.Parse(function.CheckNum(pos.SeoKeyword));
+                                function.WriteLog("押金:" + pos.SeoKeyword, "开机奖励发放日志");
                                 if (ActPrize > 0)
                                 {
                                     PosMerchantInfo merchant = db.PosMerchantInfo.FirstOrDefault(m => m.Id == pos.BindMerchantId);
                                     if (merchant != null)
                                     {
+                                        function.WriteLog("商户:" + merchant.KqMerNo, "开机奖励发放日志");
                                         Users user = db.Users.FirstOrDefault(m => m.Id == pos.BuyUserId);
                                         if (user != null)
                                         {
+                                            function.WriteLog("所属人:" + user.MakerCode, "开机奖励发放日志");
                                             if (!string.IsNullOrEmpty(user.ParentNav))
                                             {
                                                 decimal Prize = 20;
@@ -907,13 +911,16 @@ namespace MySystem
                                                     Users puser = db.Users.FirstOrDefault(m => m.Id == UserId && m.AuthFlag == 1);
                                                     if (puser != null && Prize > 0)
                                                     {
+                                                        function.WriteLog("上级:" + puser.MakerCode, "开机奖励发放日志");
                                                         int machineCount = db.PosMachinesTwo.Count(m => m.BuyUserId == puser.Id && m.PosSnType == 0 && m.ActivationState == 0); //判断是否拥有3台兑换机
                                                         int ActiveCount = db.PosMachinesTwo.Count(m => m.BuyUserId == puser.Id && m.ActivationState == 1); //判断是否拥有3台激活机(不限购买或赠送)
                                                         int couponCount = db.PosCoupons.Count(m => m.UserId == puser.Id && m.IsUse == 0); //判断是否拥有3张券
                                                         // int BigCount = db.PosMachinesTwo.Count(m => m.UserId == puser.Id && m.BrandId == 3); //判断是否拥有2台大机
                                                         // int BigActiveCount = db.PosMachinesTwo.Count(m => m.UserId == puser.Id && m.ActivationState == 1 && m.BrandId == 3); //判断是否拥有2台激活大机(不限购买或赠送)
+                                                        function.WriteLog("条件:machineCount:" + machineCount + ",ActiveCount:" + ActiveCount + ",couponCount:" + couponCount + "", "开机奖励发放日志");
                                                         if (machineCount + ActiveCount + couponCount >= 3)
                                                         {
+                                                            function.WriteLog("满足条件", "开机奖励发放日志");
                                                             int pTopUserId = 0;
                                                             if (!string.IsNullOrEmpty(puser.ParentNav))
                                                             {

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

@@ -90,9 +90,10 @@ namespace MySystem
                                         Name = Name.Replace("企业户", "");
                                         Name = Name.Replace("企业商户", "");
                                         function.WriteLog(DateTime.Now.ToString() + "-----startNo:" + startNo + ",endNo:" + endNo + ",Name:" + Name, "监控机具是否互斥");
-                                        bool check = db.PosMerchantInfo.Any(m => m.MerIdcardNo.StartsWith(startNo) && m.MerIdcardNo.EndsWith(endNo) && m.MerchantName.Contains(Name));
-                                        if(check)
+                                        PxcModels.PosMerchantInfo check = db.PosMerchantInfo.FirstOrDefault(m => m.MerIdcardNo.StartsWith(startNo) && m.MerIdcardNo.EndsWith(endNo) && m.MerchantName.Contains(Name));
+                                        if(check != null)
                                         {
+                                            function.WriteLog("互斥机具---sn:" + check.KqSnNo + ",merno:" + check.KqMerNo + ",name:" + check.MerchantName, "监控机具是否互斥");
                                             IsFirst = 0;
                                         }
                                     }

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

@@ -242,9 +242,10 @@ namespace MySystem
                                                     string Name = merchant.MerchantName;
                                                     Name = Name.Replace("*", "");
                                                     function.WriteLog(DateTime.Now.ToString() + "-----startNo:" + startNo + ",endNo:" + endNo + ",Name:" + Name, "监控机具是否互斥");
-                                                    bool chk = db.PosMerchantInfo.Any(m => m.MerIdcardNo.StartsWith(startNo) && m.MerIdcardNo.EndsWith(endNo) && m.MerchantName.Contains(Name));
-                                                    if(chk)
+                                                    PxcModels.PosMerchantInfo chk = db.PosMerchantInfo.FirstOrDefault(m => m.MerIdcardNo.StartsWith(startNo) && m.MerIdcardNo.EndsWith(endNo) && m.MerchantName.Contains(Name));
+                                                    if(chk != null)
                                                     {
+                                                        function.WriteLog("互斥机具---sn:" + chk.KqSnNo + ",merno:" + chk.KqMerNo + ",name:" + chk.MerchantName, "监控机具是否互斥");
                                                         pos.IsFirst = 0;
                                                     }
                                                 }