Пример #1
0
        public IList <PredictDataDto> NewLotteryDataList(string lotteryId, string userId)
        {
            var lotteryInfo      = _lotteryQueryService.GetLotteryInfoByCode(lotteryId);
            var finalLotteryData = _lotteryFinalDataQueryService.GetFinalData(lotteryId);
            var predictPeroid    = finalLotteryData.FinalPeriod + 1;

            var predictDatas = new List <PredictDataDto>();
            var userNorms    = _normConfigQueryService.GetUserOrDefaultNormConfigs(lotteryId, userId);

            foreach (var userNorm in userNorms.Safe())
            {
                predictDatas.AddRange(PredictNormData(lotteryInfo, userNorm, predictPeroid));
            }
            return(predictDatas);
        }
Пример #2
0
 protected RunLotteryAbstractJob()
 {
     PreInitialize();
     LastStart                     = DateTime.Now;
     _lotteryQueryService          = ObjectContainer.Resolve <ILotteryQueryService>();
     _lotteryFinalDataQueryService = ObjectContainer.Resolve <ILotteryFinalDataQueryService>();
     _commandService               = ObjectContainer.Resolve <ICommandService>();
     _lotteryDataQueryService      = ObjectContainer.Resolve <ILotteryDataQueryService>();
     _lotteryInfo                  = _lotteryQueryService.GetLotteryInfoByCode(_lotteryCode);
     _timeRuleManager              = new TimeRuleManager(_lotteryInfo);
     _lotteryFinalData             = _lotteryFinalDataQueryService.GetFinalData(_lotteryInfo.Id);
     _dataUpdateItems              = DataUpdateContext.GetDataUpdateItems(_lotteryInfo.Id);
     _isStart = true;
     PostinItialize();
 }
Пример #3
0
        private bool ValidateClient(string clientType, out string clientTypeId)
        {
            if (LotteryConstants.BackOfficeKey.Equals(clientType, StringComparison.CurrentCultureIgnoreCase))
            {
                clientTypeId = LotteryConstants.BackOfficeKey;
                return(true);
            }
            if (LotteryConstants.OfficialWebsite.Equals(clientType, StringComparison.CurrentCultureIgnoreCase))
            {
                clientTypeId = LotteryConstants.OfficialWebsite;
                return(true);
            }
            var result = _lotteryQueryService.GetLotteryInfoByCode(clientType);

            if (result == null)
            {
                throw new LotteryDataException($"不存在编码为{clientType}的彩种");
            }
            clientTypeId = result.Id;
            return(true);
        }