/// <summary> /// 分析票。计算出包含注数以及金额 /// </summary> public void AnalyzeTicket(string GameCode, decimal price = 2M) { var analyzer = AnalyzerFactory.GetAntecodeAnalyzer(GameCode, GameType); BetCount = 0; TicketMoney = 0; AnteCodeList.ForEach(c => { c.AnalyzeAntecode(analyzer, price); BetCount += c.BetCount; TicketMoney += c.AntecodeMoney * Amount; }); }
/// <summary> /// 分析投注号码,返回注数 /// </summary> /// <param name="gamecode"></param> /// <param name="type"></param> /// <param name="anteCode"></param> /// <returns></returns> public static int AnalyzeAnteCodeBetCount(string gamecode, string type, string anteCode) { var analyzer = AnalyzerFactory.GetAntecodeAnalyzer(gamecode, type); return(analyzer.AnalyzeAnteCode(anteCode)); }
public void PrizeIssuse_AfterTranCommit(string gameCode, string issuseNumber, string winNumber, decimal prevTotalMoney, decimal afterTotalMoney) { var log = Common.Log.LogWriterGetter.GetLogWriter(); log.Write("合买战绩更新-", "。。。", Common.Log.LogType.Information, "", "彩种:" + gameCode + "期号:" + issuseNumber); try { var manager = new SchemeManager(); var bonusManager = new BonusManager(); var lotteryManager = new LotteryGameManager(); //主表SchemeId var togetherMain = manager.QueryTogetherMain(gameCode, issuseNumber); var business = new TogetherBusiness(); //合买中奖数 //成功提升战绩数 var winCount = 0; var beedingsCount = 0; foreach (var item in togetherMain) { var winMoney = 0M; //查询战绩 var togetherBeedings = manager.QueryBeedingsByGame(item.CreateUser.UserId, item.Game.GameCode); // // log.Write("查询主表", "", Common.Log.LogType.Information, "", "FailCount:" + togetherBeedings.FailCount + ";FailWinCount:" + togetherBeedings.FailWinCount + ";FailBeedingsCount:" + togetherBeedings.FailWinCount + ";FailBeedings" + togetherBeedings.FailBeedings); int amount = 0; //得到倍数 var bettingIssuse = manager.QueryTempBettingIssuse(item.SchemeId, issuseNumber); if (bettingIssuse == null) { amount = manager.QueryBettingIssuse(item.SchemeId, issuseNumber).Amount; } else { amount = bettingIssuse.Amount; } manager.QueryAnteCodeBySchemeId(item.SchemeId).ForEach(code => { var analyzer = AnalyzerFactory.GetAntecodeAnalyzer(gameCode, code.GameType); var group = analyzer.CaculateBonus(code.AnteCode, winNumber).GroupBy(l => l); foreach (var item1 in group) { var rule = bonusManager.QueryBonusRule(gameCode, code.GameType, item1.Key) ?? new BonusRule(); winMoney += rule.BonusMoney * item1.Count() * amount; } }); var beeding = 0; //战绩金额 var beedingMoney = winMoney - item.TotalMoney; if (winMoney != 0M)//中奖 { winCount = 1; } if (beedingMoney > 100)//有战绩 { //达到标准增加战绩 beeding = business.StatisticsBeedings(beedingMoney); beedingsCount = 1; } if (item.State != TogetherState.Fail) //合买成功 { togetherBeedings.FinishCount += 1; togetherBeedings.WinCount += winCount; togetherBeedings.BeedingsCount += beedingsCount; togetherBeedings.Beedings += beeding; } else { togetherBeedings.FailCount += 1; togetherBeedings.FailWinCount += winCount; togetherBeedings.FailBeedingsCount += beedingsCount; togetherBeedings.FailBeedings += beeding; } business.UpdateTogetherBeedingsGame(togetherBeedings); } } catch (Exception ex) { log.Write("合买战绩更新-", "异常出错", Common.Log.LogType.Information, "", ex.ToString()); } }
/// <summary> /// 分析号码。计算出包含注数以及号码金额 /// </summary> public void AnalyzeAntecode(string GameCode, decimal price = 2M) { var analyzer = AnalyzerFactory.GetAntecodeAnalyzer(GameCode, GameType); AnalyzeAntecode(analyzer, price); }