Beispiel #1
0
        public PlanTrackDetail GetPlanTrackDetail(NormConfigDto userNorm, string lotteryCode, string userId)
        {
            var planInfo           = _planInfoQueryService.GetPlanInfoById(userNorm.PlanId);
            var prodictDatas       = _lotteryPredictDataQueryService.GetNormPredictDatas(userNorm.Id, planInfo.PlanNormTable, userNorm.LookupPeriodCount + 1, lotteryCode);
            var currentPredictData = AutoMapper.Mapper.Map <PredictDataDetail>(prodictDatas.FirstOrDefault(p => p.PredictedResult == 2));

            currentPredictData.PredictType = planInfo.DsType;
            // currentPredictData.LotteryData = _lotteryDataAppService.GetLotteryData(planInfo.LotteryInfo.Id,currentPredictData.CurrentPredictPeriod).Data;
            var historyPredictDatas = AutoMapper.Mapper.Map <ICollection <PredictDataDetail> >(prodictDatas.Where(p => p.PredictedResult != 2).ToList());

            historyPredictDatas.ForEach(item =>
            {
                item.LotteryData = _lotteryDataAppService.GetLotteryData(planInfo.LotteryInfo.Id, item.CurrentPredictPeriod).Data;
                item.PredictType = planInfo.DsType;
            });
            var planTrackDetail = new PlanTrackDetail()
            {
                CurrentPredictData  = currentPredictData,
                FinalLotteryData    = _lotteryDataAppService.GetFinalLotteryData(planInfo.LotteryInfo.Id),
                HistoryPredictDatas = historyPredictDatas,
                NormId        = userNorm.Id,
                PlanId        = planInfo.Id,
                PlanName      = planInfo.PlanName,
                Sort          = userNorm.Sort,
                StatisticData = ComputeStatisticData(currentPredictData, historyPredictDatas, userNorm)
            };

            return(planTrackDetail);
        }
        public ResultMessage <LotteryDataOutput> GetLotteryData(string lotteryType, int?peroiod)
        {
            LotteryDataOutput lotteryData = null;
            var result = _lotteryDataAppService.GetLotteryData(lotteryType, peroiod, out lotteryData);

            if (result)
            {
                return(ResponseUtils.DataResult(lotteryData));
            }
            string peroidStr = peroiod?.ToString() ?? "最后一期";

            return(ResponseUtils.ErrorResult <LotteryDataOutput>($"获取{lotteryType}彩种第{peroidStr}期开奖数据失败,可能正在开奖..."));
        }