/// <summary> /// 检查普通订单频繁投注 /// </summary> public string CheckGeneralRepeatBetting(string currUserId, LotteryBettingInfo info) { try { //todo:备用 info.IsSubmit = false; if (_bettingListInfo == null || !_bettingListInfo.ContainsKey(currUserId)) { info.CurrentBetTime = DateTime.Now; _bettingListInfo.Add(currUserId, info); return(string.Empty); } var cacheInfo = _bettingListInfo.FirstOrDefault(s => s.Key == currUserId && s.Value.GameCode == info.GameCode.ToUpper() && s.Value.SchemeSource == info.SchemeSource && s.Value.BettingCategory == info.BettingCategory && s.Value.TotalMoney == info.TotalMoney); if (string.IsNullOrEmpty(cacheInfo.Key) || cacheInfo.Value == null) { _bettingListInfo.Remove(currUserId); info.CurrentBetTime = DateTime.Now; _bettingListInfo.Add(currUserId, info); return(string.Empty); } if (!info.Equals(cacheInfo.Value)) { //不重复 _bettingListInfo.Remove(currUserId); info.CurrentBetTime = DateTime.Now; _bettingListInfo.Add(currUserId, info); return(string.Empty); } //投注内容相同 if (info.IsRepeat) { _bettingListInfo.Remove(currUserId); info.CurrentBetTime = DateTime.Now; _bettingListInfo.Add(currUserId, info); return(string.Empty); } var timeSpan = DateTime.Now - cacheInfo.Value.CurrentBetTime; if (timeSpan.TotalSeconds > 5) { //大于间隔时间 _bettingListInfo.Remove(currUserId); info.CurrentBetTime = DateTime.Now; _bettingListInfo.Add(currUserId, info); return(string.Empty); } return("Repeat"); } catch (Exception) { _bettingListInfo.Clear(); return(string.Empty); } }
public void BettingLottery_AfterTranCommit(string userId, LotteryBettingInfo bettingOrder, string schemeId, string keyLine) { // 更新最新动态,忽略异常,异常只记录日志 if (bettingOrder.IssuseNumberList.Count > 1) { UsefullHelper.TryDoAction(() => UpdateProfileDynamic(userId, schemeId, bettingOrder.GameCode, bettingOrder.IssuseNumberList[0].IssuseNumber, bettingOrder.TotalMoney, "代购")); } else { UsefullHelper.TryDoAction(() => UpdateProfileDynamic(userId, schemeId, bettingOrder.GameCode, bettingOrder.IssuseNumberList[0].IssuseNumber, bettingOrder.TotalMoney, "代购")); } // 更新统计数据 UsefullHelper.TryDoAction(() => UpdateProfileDataReport(userId, 1, null, null, null)); //普通用户推广 UsefullHelper.TryDoAction(() => UpdateSporeadUserData(userId, bettingOrder.GameCode, bettingOrder.TotalMoney)); //分享推广活动 用户购彩了 送红包 只送一次 //UsefullHelper.TryDoAction(() => FirstLotteryGiveRedBag(userId)); }