/// <summary>
        /// 设置问题结果
        /// </summary>
        /// <param name="userId">用户userId</param>
        /// <param name="pkid">问题pkid</param>
        /// <param name="resOptions">用户选项</param>
        /// <returns></returns>
        public async Task <OperationResult <QuestionAnsResponse> > SetAnswerResAsync(QuestionAnsRequestModel request)
        {
            Regex regex = new Regex("^([0-9]|[a-z]|[A-Z]){7}([0-9]|[a-z]|[A-Z])$");

            if (!regex.IsMatch(request.hashKey))
            {
                return(OperationResult.FromResult(new QuestionAnsResponse()
                {
                    IsReal = false
                }));
            }

            if (request.pkid <= 0)
            {
                return(OperationResult.FromResult(new QuestionAnsResponse()
                {
                    IsReal = false
                }));
            }
            if (string.IsNullOrWhiteSpace(request.resOptions))
            {
                return(OperationResult.FromResult(new QuestionAnsResponse()
                {
                    IsReal = false
                }));
            }
            var list = await QuesAnsManager.GetBigBrandQuesList(request.userId, request.hashKey, false);

            var realValue  = list?.Where(_ => _.IsFinish == true)?.Where(_ => _.ResValue == _.OptionsReal)?.Count();
            var errorValue = list?.Where(_ => _.IsFinish == true)?.Where(_ => _.ResValue != _.OptionsReal)?.Count();
            await QuesAnsManager.UpdateBigBrandQues(request.pkid, request.resOptions);

            var entity = await QuesAnsManager.GetBigBrandQuesEntity(request.pkid);

            return(OperationResult.FromResult(new QuestionAnsResponse()
            {
                IsReal = entity?.OptionsReal == request.resOptions, OptionsReal = entity?.OptionsReal, RealValue = entity?.OptionsReal == request.resOptions ? (realValue + 1):realValue, Error = entity?.OptionsReal == request.resOptions ? (errorValue) : (errorValue + 1)
            }));
        }
        /// <summary>
        /// 问题列表
        /// </summary>
        /// <param name="userId">用户</param>
        /// <param name="hashKey">抽奖hashKey</param>
        /// <returns></returns>
        public async Task <OperationResult <List <BigBrandQuesList> > > GetQuestionListAsync(Guid userId, string hashKey)
        {
            Regex regex = new Regex("^([0-9]|[a-z]|[A-Z]){7}([0-9]|[a-z]|[A-Z])$");

            if (!regex.IsMatch(hashKey))
            {
                return(null);
            }

            var list = await QuesAnsManager.GetBigBrandQuesList(userId, hashKey);

            if (list == null || list?.Where(_ => _.IsFinish == false)?.Count() == 0)
            {
                var quesList = await QuesAnsManager.GetAnswerInfoList();

                if (quesList?.Count <= 0)
                {
                    throw new Exception("问答题库没有信息");
                }
                //生成问答试卷
                Random random = new Random(Guid.NewGuid().GetHashCode());

                string curNo    = DateTime.Now.ToString("yyyyMMddHHmmss") + (random.Next(0, quesList.Count)).ToString("0000");
                var    bigBrand = await BigBrandManager.GetBigBrand(hashKey);

                if (bigBrand.AnsQuesConfig == null || bigBrand?.AnsQuesConfig?.TipCount == 0)
                {
                    throw new Exception("没有配置问答抽奖的题目数量");
                }

                List <BigBrandQuesList> quesModelList = new List <BigBrandQuesList>();
                #region 生成题库随机集合
                List <int> indexs = new List <int>();
                while (indexs?.Count < bigBrand.AnsQuesConfig?.TipCount)
                {
                    random = new Random(Guid.NewGuid().GetHashCode());
                    var number = random.Next(0, quesList.Count);
                    if (!indexs.Exists(_ => _ == number))
                    {
                        indexs.Add(number);
                    }
                    else
                    {
                        number++;
                        if (number >= quesList.Count || indexs.Exists(_ => _ == number))
                        {
                            continue;
                        }
                        else
                        {
                            indexs.Add(number);
                        }
                    }
                }
                #endregion

                int orderby = 1;

                #region 创建试卷
                foreach (var index in indexs)
                {
                    var item = quesList[index];
                    BigBrandQuesList model = new BigBrandQuesList()
                    {
                        Answer             = item.Answer,
                        CreateDateTime     = DateTime.Now,
                        CurAnsNo           = curNo,
                        HashKey            = hashKey,
                        IsFinish           = false,
                        LastUpdateDateTime = DateTime.Now,
                        OptionsA           = item.OptionsA,
                        OptionsB           = item.OptionsB,
                        OptionsC           = item.OptionsC,
                        OptionsD           = item.OptionsD,
                        OptionsReal        = item.OptionsReal,
                        OrderBy            = orderby++,
                        Tip    = item.Tip,
                        UserId = userId
                    };
                    quesModelList.Add(model);
                }
                #endregion
                var result = QuesAnsManager.InsertBigBrandQues(quesModelList);
                if (result)
                {
                    list = await QuesAnsManager.GetBigBrandQuesList(userId, hashKey, false);
                }
            }

            return(OperationResult.FromResult(list));
        }