Beispiel #1
0
        public MyBaoJiaViewModel GetMyBjdDetail(GetMyBjdDetailRequest request, IEnumerable <KeyValuePair <string, string> > pairs)
        {
            DateTime    date1    = DateTime.Now;
            bx_userinfo userinfo = _userInfoRepository.FindByBuid(request.Buid);
            //校验
            var my = _checkRequestService.CheckRequest(userinfo, request);

            if (my.BusinessStatus != 1)
            {
                return(my);
            }
            my.BusinessStatus = 1;
            //获取修改时间
            my.UpdateTime = userinfo.LatestQuoteTime.HasValue ? userinfo.LatestQuoteTime.Value.ToString("yyyy-MM-dd HH:mm:ss") : "";

            //获取在该报价单在预约单中记录
            my = _setOrderService.SetOrder(my, userinfo);

            //从userinfo获取关系人 和一些其他配置
            my = _setBaseInfoService.SetBaseInfo(my, userinfo);
            List <bx_quoteresult_carinfo> quoteresultCarinfo;

            //获取车辆信息bx_quoteresult_carinfo
            my = _setCarInfoService.SetCarInfo(my, userinfo, out quoteresultCarinfo);

            //取商业险和交强险开始时间
            string postForceStartDate;//交强险起始时间
            string postBizStartDate;

            postForceStartDate = _getDateService.GetDate(userinfo, out postBizStartDate);
            //请求报价的信息
            my = _setQuoteReqService.SetQuoteReq(my, userinfo, ref postBizStartDate, ref postForceStartDate);
            //给交强商业起始时间、到期时间赋值
            my = _setDateService.SetDate(my, userinfo, postBizStartDate, postForceStartDate);

            my = _setPrecisePriceItemService.SetPrecisePriceItem(my, userinfo, request, quoteresultCarinfo, my.SeatCount ?? 0);

            //获取出险记录
            my = _setClaimsService.SetClaims(my, request, userinfo);
            //获取优惠活动
            my = _setActivitiesService.SetActivities(my, request);
            //获取图片
            my.Images = _imagesRepository.FindByBuid(userinfo.Id);
            //是否是临时被保险人
            my.IsTempInsured = GetTempInsured(userinfo.Id);
            //赋值代理人信息,并初始化费率 展示费率
            my                   = _setAgentService.SetAgent(my, userinfo, request);
            my.QuoteTime         = userinfo.LatestQuoteTime.HasValue ? userinfo.LatestQuoteTime.Value.ToString("yyyy-MM-dd HH:mm:ss") : "";
            my.LatestRenewalTime = userinfo.LatestRenewalTime.HasValue ? userinfo.LatestRenewalTime.Value.ToString("yyyy-MM-dd HH:mm:ss") : "";
            if (request.ShowCarProperties <= 0)
            {
                my.IsLoans      = null;
                my.TransferDate = null;
            }
            return(my);
        }
Beispiel #2
0
        public MyBaoJiaViewModel GetMyBjdDetail(GetBjdDetailFromHistoryRequest request, IEnumerable <KeyValuePair <string, string> > pairs)
        {
            DateTime    date1    = DateTime.Now;
            bx_userinfo userinfo = _userInfoRepository.FindByBuid(request.Buid);

            var my = new MyBaoJiaViewModel();
            //校验
            //var my = _checkRequestService.CheckRequest(userinfo, request);
            //if (my.BusinessStatus != 1)
            //{
            //    return my;
            //}
            Tuple <bx_savequote, bx_quotereq_carinfo, List <bx_quoteresult>, List <bx_submit_info>, string, List <int> > historyList = _getModelsFromQuoteHistory.GetModels(request.Buid, request.GroupSpan);

            List <long> quote01 = new List <long>(); //报价1+0的数据 成功+失败
            List <long> quote1  = new List <long>(); //报价1的数据 成功

            if (historyList.Item4 != null && historyList.Item4.Any())
            {
                List <int> intquote1 = historyList.Item4.Where(w => w.quote_status > 0).Select(l => l.source.Value).ToList();
                if (intquote1 != null && intquote1.Any())
                {
                    foreach (var i in intquote1)
                    {
                        quote1.Add(i);
                    }
                }
            }
            if (historyList.Item6.Any())
            {
                foreach (var i in historyList.Item6)
                {
                    quote01.Add(i);
                }
            }

            //获取修改时间
            my.UpdateTime = historyList.Item5;

            //获取在该报价单在预约单中记录
            my = _setOrderNewService.SetOrder(my, userinfo);

            //从userinfo获取关系人 和一些其他配置
            var relationitem = _quotehistoryRelatedRepository.GetModel(request.Buid, request.GroupSpan);

            if (relationitem != null && relationitem.id > 0)
            {
                my = _setBaseInfoHistoryService.SetBaseInfoHistory(my, userinfo, relationitem);
            }
            else
            {
                my = _setBaseInfoService.SetBaseInfo(my, userinfo);
            }

            List <bx_quoteresult_carinfo> quoteresultCarinfo;

            //获取车辆信息
            my = _setCarInfoService.SetCarInfo(my, userinfo, out quoteresultCarinfo);

            //取商业险和交强险开始时间
            Tuple <string, string> startDate = _getDateNewService.GetDate(historyList.Item3);
            string postBizStartDate          = startDate.Item1; //商业险起始时间
            string postForceStartDate        = startDate.Item2; //交强险起始时间

            //请求报价的信息
            my = _setQuoteReqNewService.SetQuoteReq(my, quote1, historyList.Item2, ref postBizStartDate, ref postForceStartDate);
            //给交强商业起始时间、到期时间赋值
            //顺便给出险次数赋值。因为平安从bx_claimdetails没办法拿值,中心沟通从此表取值
            my = _setDateService.SetDate(my, userinfo, postBizStartDate, postForceStartDate);

            GetMyBjdDetailRequest request1 = new GetMyBjdDetailRequest()
            {
                Agent   = request.Agent,
                Source  = -1,
                NewRate = null
            };

            my = _setPrecisePriceItemNewService.SetPrecisePriceItem(my, userinfo, quoteresultCarinfo, quote01, quote1.Count == 0, historyList.Item1, historyList.Item3, historyList.Item4);

            //获取出险记录
            //my = _setClaimsService.SetClaims(my, request, userinfo);
            //获取优惠活动
            //my = _setActivitiesService.SetActivities(my, request);
            //获取图片
            //my.Images = _imagesRepository.FindByBuid(userinfo.Id);
            my.Images = new List <bx_images>();
            //是否是临时被保险人
            my.IsTempInsured = GetTempInsured(userinfo.Id);
            //赋值代理人信息,并初始化费率 展示费率
            //my = _setAgentService.SetAgent(my, userinfo, request);
            my.QuoteTime         = historyList.Item5; //userinfo.LatestQuoteTime.HasValue ? userinfo.LatestQuoteTime.Value.ToString("yyyy-MM-dd HH:mm:ss") : "";
            my.LatestRenewalTime = "";                // userinfo.LatestRenewalTime.HasValue ? userinfo.LatestRenewalTime.Value.ToString("yyyy-MM-dd HH:mm:ss") : "";
            return(my);
        }