public List <IsUploadImg> IsUploadImg(long buid)
        {
            List <IsUploadImg> isUploadImg = new List <IsUploadImg>();
            bx_userinfo        userinfo    = _userInfoRepository.FindByBuid(buid);

            if (userinfo == null)
            {
                return(new List <IsUploadImg>());
            }
            if (!userinfo.IsSingleSubmit.HasValue)
            {
                return(new List <IsUploadImg>());
            }
            //获取图片bx_picture
            List <bx_picture> picList = _pictureRepository.GetAllList(o => o.b_uid == buid);
            //获取报了哪些保司
            List <long> sourceList = SourceGroupAlgorithm.ParseSource(userinfo.IsSingleSubmit.Value);

            if (sourceList.Any() && picList.Any())
            {
                foreach (int itk in sourceList)
                {
                    var oit = SourceGroupAlgorithm.GetOldSource(itk);//获取到旧的source值
                    //拼装上传的图片模型
                    bx_picture model = picList.FirstOrDefault(l => l.source == oit);
                    if (model != null && model.id != 0 && model.state == 5)
                    {
                        IsUploadImg newmodel = new IsUploadImg()
                        {
                            IsUpload = 1,//已上传
                            Source   = itk
                        };
                        isUploadImg.Add(newmodel);
                    }
                    else
                    {
                        IsUploadImg newmodel = new IsUploadImg()
                        {
                            IsUpload = 0,//未上传
                            Source   = itk
                        };
                        isUploadImg.Add(newmodel);
                    }
                }
            }
            return(isUploadImg);
        }
        public MyBaoJiaViewModel SetPrecisePriceItem(MyBaoJiaViewModel my, bx_userinfo userinfo, GetMyBjdDetailRequest request, List <bx_quoteresult_carinfo> quoteresultCarinfo, int reqseatcount)
        {
            var sourceList = _setPrecisePriceItem.FindSource(userinfo, request);
            //获取图片bx_picture
            List <bx_picture> picList = _pictureRepository.GetAllList(o => o.b_uid == userinfo.Id);
            //报价单资源对象
            bx_savequote          sq      = _saveQuoteRepository.GetSavequoteByBuid(userinfo.Id);
            List <bx_quoteresult> qrList  = _quoteResultRepository.GetQuoteResultList(userinfo.Id);
            List <bx_submit_info> siList  = _submitInfoRepository.GetSubmitInfoList(userinfo.Id);
            List <bx_ywxdetail>   ywxList = _ywxdetailRepository.GetList(userinfo.Id);
            //渠道列表
            List <AgentConfigNameModel> agentChannelList = new List <AgentConfigNameModel>();

            if (siList.Any())
            {
                agentChannelList = _agentConfigRepository.FindListById(siList.Select(l => l.channel_id).Join(","));
            }
            //图片url
            List <IsUploadImg> isUploadImg = new List <IsUploadImg>();
            //报价信息模型,包括险种和报价
            List <MyPrecisePriceItemViewModel> listquoteTotal = new List <MyPrecisePriceItemViewModel>();

            var hebaodianweis = _hebaoDianweiRepository.FindList(userinfo.Id, SourceGroupAlgorithm.GetOldSources(sourceList.ToArray()));

            if (sourceList.Any() && userinfo.QuoteStatus > -1)
            {
                foreach (int itk in sourceList)
                {
                    //20160905修改source1248=>0123,传入的新数据转换
                    var oit    = SourceGroupAlgorithm.GetOldSource(itk);//获取到旧的source值
                    var submit = siList.FirstOrDefault(i => i.source == oit);
                    var qr     = qrList.FirstOrDefault(i => i.Source == oit);
                    var jy     = ywxList.Where(i => i.source == oit).ToList();
                    if (oit == 3)
                    {
                        if (!string.IsNullOrEmpty(request.NewRate) && qr != null)
                        {
                            qr.NewRate = decimal.Parse(request.NewRate);
                            _quoteResultRepository.Update(qr);
                        }
                        else if (string.IsNullOrEmpty(request.NewRate) && qr != null && qr.NewRate != 0 && qr.NewRate != null)
                        {
                            request.NewRate = qr.NewRate.ToString();
                        }
                        if (!string.IsNullOrEmpty(request.NewRate))
                        {
                            my.NewRate = double.Parse(request.NewRate).ToString("#0.00000");
                        }
                    }
                    var model = ConvertToViewModelNew(oit, sq,
                                                      qr, submit, userinfo.QuoteStatus.Value, agentChannelList, userinfo.CarVIN, jy, request.NewRate);

                    var hebaodianwei = hebaodianweis.FirstOrDefault(heb => heb.source == oit);
                    if (hebaodianwei != null && my.IsShowCalc == 0)
                    {
                        model.BizSysRate = hebaodianwei.system_biz_rate.HasValue
                            ? Convert.ToDecimal(hebaodianwei.system_biz_rate.Value)
                            : 0;
                        model.ForceSysRate = hebaodianwei.system_force_rate.HasValue
                            ? Convert.ToDecimal(hebaodianwei.system_force_rate.Value)
                            : 0;
                        //优惠费率
                        model.BenefitRate = hebaodianwei.agent_id == hebaodianwei.parent_agent_id
                            ? Convert.ToDecimal(hebaodianwei.zhike_biz_rate.Value)
                            : Convert.ToDecimal(hebaodianwei.agent_biz_rate.Value);
                    }
                    var qcinfo = quoteresultCarinfo.FirstOrDefault(l => l.source == oit);
                    if (qcinfo != null)
                    {
                        model.CarUsedType = qcinfo.car_used_type ?? 0;
                        model.SeatCount   = qcinfo.seat_count ?? 0;//座位数赋值
                    }
                    if (model.SeatCount == 0)
                    {
                        //如果报价结果没拿到座位数,将请求的赋值进去
                        model.SeatCount = reqseatcount;
                    }
                    model.JingSuanKouJing = submit != null ? (submit.RbJSKJ ?? "") : "";
                    listquoteTotal.Add(model);

                    //拼装上传的图片模型
                    if (picList.Any())
                    {
                        bx_picture picture = picList.FirstOrDefault(l => l.source == oit);
                        if (picture != null && picture.id != 0)
                        {
                            IsUploadImg newmodel = new IsUploadImg()
                            {
                                IsUpload = 1,
                                Source   = itk
                            };
                            isUploadImg.Add(newmodel);
                        }
                    }
                }
                my.PrecisePriceItem = listquoteTotal;
                my.IsUploadImg      = isUploadImg;
            }
            else
            {
                my.PrecisePriceItem = new List <MyPrecisePriceItemViewModel>();
            }
            return(my);
        }