瀏覽代碼

预发机还未申请划拨就绑定了,给消创客提示
判断激活条件,划拨时间比绑定时间晚30分钟

lcl 1 年之前
父節點
當前提交
4cc332d927

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

@@ -128,6 +128,13 @@ namespace MySystem
                                     MachineData.BindCount += 1;
                                     MachineData.UnBindCount -= 1;
                                     db.SaveChanges();
+
+                                    if(pos.BuyUserId == 0 && pos.PreUserId > 0)
+                                    {
+                                        RedisDbconn.Instance.Set("CheckUserBindPrePos:" + pos.PreUserId, "您的名下有已绑定的预发机 sn:" + pos.PosSn + " 尚未申请,绑定30分钟内申请即可免费自动补录,请前往客小爽产品中点击机具申请继续完成申请");
+                                        int ExpireTime = 60 * 25;
+                                        RedisDbconn.Instance.SetExpire("CheckUserBindPrePos:" + pos.PreUserId, ExpireTime);
+                                    }
                                 }
                             }
                             tran.Commit();

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

@@ -331,7 +331,8 @@ namespace MySystem
                                             pos.DebitCardTrade += TradeAmount;
                                         }
                                         //判断激活条件并激活
-                                        if (pos.CreditTrade >= CheckMoney && pos.ActivationState == 0 && pos.TransferTime < pos.BindingTime && pos.BindingTime > DateTime.Now.AddDays(-CheckDays))
+                                        DateTime TransferTime = pos.TransferTime == null ? DateTime.Now : pos.TransferTime.Value;
+                                        if (pos.CreditTrade >= CheckMoney && pos.ActivationState == 0 && TransferTime.AddMinutes(-30) < pos.BindingTime && pos.BindingTime > DateTime.Now.AddDays(-CheckDays))
                                         {
                                             pos.ActivationState = 1;
                                             pos.ActivationTime = DateTime.Now;