示例#1
0
        private List<OutDoorIndexEntity> GetOutDoors(List<int> Ids)
        {
            List<OutDoorIndexEntity> result = new List<OutDoorIndexEntity>();

            var query = db.Set<OutDoor>()
                .Include(x => x.CityCate)
                .Include(x => x.MediaCate)
                //.Include(x => x.AreaCate)
                //.Include(x => x.CrowdCate)
                //.Include(x => x.IndustryCate)
                //.Include(x => x.PurposeCate)
                .Include(x => x.PeriodCate)
                .Include(x => x.FormatCate)
                .Include(x => x.Member)
                .Include(x => x.Member.Company)
                .Where(x => Ids.Contains(x.ID));

            foreach (var entity in query.ToList())
            {
                OutDoorIndexEntity item = new OutDoorIndexEntity();
                item.ID = entity.ID;
                item.MemberID = entity.MemberID;

                var cityIds = entity.CityCodeValue.Split(',').Select(x => Convert.ToInt32(x)).ToList();
                var cityValues = CityCateService.GetALL().Where(x => cityIds.Contains(x.ID)).Select(x => x.CateName).ToList();
                item.CityCode = entity.CityCode;
                item.CityCateCode = entity.CityCate.Code;
                item.CityCateValue = entity.CityCodeValue;
                item.CityCateName = String.Join(",", cityValues);

                var meidaIds = entity.MediaCodeValue.Split(',').Select(x => Convert.ToInt32(x)).ToList();
                var meidaValues = MediaCateService.GetALL().Where(x => meidaIds.Contains(x.ID)).Select(x => x.CateName).ToList();
                item.MediaCode = entity.MediaCode;
                item.MediaCateCode = entity.MediaCate.Code;
                item.MediaCateValue = entity.MediaCodeValue;
                item.MediaCateName = String.Join(",", meidaValues);

                item.TrafficAuto = entity.TrafficAuto;
                item.TrafficPerson = entity.TrafficPerson;
                item.Location = entity.Location;
                item.FormatCode = entity.FormatCode;
                item.FormatName = entity.FormatCate.CateName;
                item.PeriodCode = entity.PeriodCode;
                item.PeriodName = entity.PeriodCate.CateName;
                if (entity.Price == 0)
                {
                    item.Price = 99999;
                }
                else
                {
                    item.Price = entity.Price;
                }
                if (entity.RealPrice == 0)
                {
                    item.RealPrice = 99999;
                }
                else
                {
                    item.RealPrice = entity.RealPrice; ;
                }
                item.OwnerCode = entity.OwnerCode;
                //item.OwnerName = entity.OwnerCate.CateName;
                item.Status = entity.Status;
                item.AuthStatus = entity.AuthStatus;
                item.Title = entity.Name;
                item.Description = entity.Description;
                item.ImgUrl = entity.MediaImg;
                item.FocusImgUrl = entity.MediaFoucsImg;
                if (!string.IsNullOrEmpty(entity.CredentialsImg))
                {
                    item.CredentialsImg = entity.CredentialsImg;
                }
                else
                {
                    item.CredentialsImg = string.Empty;
                }
                item.VideoUrl = entity.VideoUrl;
                //item.AreaCate = string.Join(",", entity.AreaCate.Select(x => x.CateName).ToList());
                //item.CrowdCate = string.Join(",", entity.CrowdCate.Select(x => x.CateName).ToList());
                //item.IndustryCate = string.Join(",", entity.IndustryCate.Select(x => x.CateName).ToList());
                //item.PurposeCate = string.Join(",", entity.PurposeCate.Select(x => x.CateName).ToList());
                item.IsRegular = entity.IsRegular ? 1 : 0;
                item.HasLight = entity.HasLight ? 1 : 0;
                if (entity.HasLight)
                {
                    item.LightStart = entity.LightStart;
                    item.LightEnd = entity.LightEnd;
                }
                if (entity.IsRegular)
                {
                    item.Width = entity.Wdith;
                    item.Height = entity.Height;
                    item.TotalFaces = entity.TotalFaces;
                    item.TotalArea = entity.Wdith * entity.Height * entity.TotalFaces;
                }
                else
                {
                    item.IrRegularArea = entity.IrRegularArea;

                    var areaParams = entity.IrRegularArea.Split('|').ToList();
                    var totalArea = 0.0m;
                    for (var i = 1; i < areaParams.Count; i += 2)
                    {
                        totalArea += Convert.ToDecimal(areaParams[i]) * Convert.ToDecimal(areaParams[i + 1]);
                    }
                    item.TotalArea = totalArea;

                }
                item.Lat = entity.Lat;
                item.Hit = entity.Hit;
                item.SuggestStatus = entity.SuggestStatus;
                item.Lng = entity.Lng;
                item.CompanyName = entity.Member.Company.Name;
                item.DeadLine = entity.Deadline;
                item.Published = entity.LastTime;
                item.MemberStatus = entity.Member.Status;
                result.Add(item);
            }
            return result;
        }
示例#2
0
        private Document CreateDocument(OutDoorIndexEntity OutDoor)
        {
            var document = new Document();

            var field = new Field(OutDoorIndexFields.Title, OutDoor.Title, Field.Store.YES, Field.Index.ANALYZED);
            field.Boost = 2.5f;
            document.Add(field);

            field = new Field(OutDoorIndexFields.Description, OutDoor.Description, Field.Store.YES, Field.Index.ANALYZED);
            field.Boost = 2.1f;
            document.Add(field);

            field = new Field(OutDoorIndexFields.CompanyName, OutDoor.CompanyName, Field.Store.YES, Field.Index.ANALYZED);
            field.Boost = 2.0f;
            document.Add(field);

            field = new Field(OutDoorIndexFields.Location, OutDoor.Location, Field.Store.YES, Field.Index.ANALYZED);
            field.Boost = 2.0f;
            document.Add(field);

            //field = new Field(OutDoorIndexFields.AreaCate, OutDoor.AreaCate, Field.Store.YES, Field.Index.ANALYZED);
            //field.Boost = 1.0f;
            //document.Add(field);

            //field = new Field(OutDoorIndexFields.CrowdCate, OutDoor.CrowdCate, Field.Store.YES, Field.Index.ANALYZED);
            //field.Boost = 1.0f;
            //document.Add(field);

            //field = new Field(OutDoorIndexFields.IndustryCate, OutDoor.IndustryCate, Field.Store.YES, Field.Index.ANALYZED);
            //field.Boost = 1.0f;
            //document.Add(field);

            //field = new Field(OutDoorIndexFields.PurposeCate, OutDoor.PurposeCate, Field.Store.YES, Field.Index.ANALYZED);
            //field.Boost = 1.0f;
            //document.Add(field);

            field = new Field(OutDoorIndexFields.CityCateName, OutDoor.CityCateName, Field.Store.YES, Field.Index.ANALYZED);
            field.Boost = 1.0f;
            document.Add(field);

            field = new Field(OutDoorIndexFields.MediaCateName, OutDoor.MediaCateName, Field.Store.YES, Field.Index.ANALYZED);
            field.Boost = 1.0f;
            document.Add(field);

            field = new Field(OutDoorIndexFields.FormatName, OutDoor.FormatName, Field.Store.YES, Field.Index.ANALYZED);
            field.Boost = 0.2f;
            document.Add(field);

            field = new Field(OutDoorIndexFields.PeriodName, OutDoor.PeriodName, Field.Store.YES, Field.Index.ANALYZED);
            field.Boost = 0.2f;
            document.Add(field);

            //field = new Field(OutDoorIndexFields.OwnerName, OutDoor.OwnerName, Field.Store.YES, Field.Index.ANALYZED);
            //field.Boost = 0.2f;
            //document.Add(field);

            field = new Field(OutDoorIndexFields.ImgUrl, OutDoor.ImgUrl, Field.Store.YES, Field.Index.NOT_ANALYZED);
            document.Add(field);

            field = new Field(OutDoorIndexFields.CredentialsImg, OutDoor.CredentialsImg, Field.Store.YES, Field.Index.NOT_ANALYZED);
            document.Add(field);

            field = new Field(OutDoorIndexFields.FocusImgUrl, OutDoor.FocusImgUrl, Field.Store.YES, Field.Index.NOT_ANALYZED);
            document.Add(field);

            field = new Field(OutDoorIndexFields.VideoUrl, string.IsNullOrEmpty(OutDoor.VideoUrl) ? string.Empty : OutDoor.VideoUrl, Field.Store.YES, Field.Index.NOT_ANALYZED);
            document.Add(field);

            field = new Field(OutDoorIndexFields.CityCateValue, OutDoor.CityCateValue, Field.Store.YES, Field.Index.NOT_ANALYZED);
            document.Add(field);

            field = new Field(OutDoorIndexFields.MediaCateValue, OutDoor.MediaCateValue, Field.Store.YES, Field.Index.NOT_ANALYZED);
            document.Add(field);

            field = new Field(OutDoorIndexFields.ID, OutDoor.ID.ToString(CultureInfo.InvariantCulture), Field.Store.YES, Field.Index.NOT_ANALYZED);
            document.Add(field);

            document.Add(new NumericField(OutDoorIndexFields.Price, Field.Store.YES, true).SetDoubleValue(Convert.ToDouble(OutDoor.Price)));

            document.Add(new NumericField(OutDoorIndexFields.RealPrice, Field.Store.YES, true).SetDoubleValue(Convert.ToDouble(OutDoor.RealPrice)));

            document.Add(new NumericField(OutDoorIndexFields.IsRegular, Field.Store.YES, true).SetIntValue(OutDoor.IsRegular));

            if (OutDoor.IsRegular == 1)
            {
                document.Add(new NumericField(OutDoorIndexFields.Width, Field.Store.YES, true).SetDoubleValue(Convert.ToDouble(OutDoor.Width)));
                document.Add(new NumericField(OutDoorIndexFields.Height, Field.Store.YES, true).SetDoubleValue(Convert.ToDouble(OutDoor.Height)));
                document.Add(new NumericField(OutDoorIndexFields.TotalFaces, Field.Store.YES, true).SetIntValue(OutDoor.TotalFaces));
            }
            else
            {
                field = new Field(OutDoorIndexFields.IrRegularArea, OutDoor.IrRegularArea, Field.Store.YES, Field.Index.NOT_ANALYZED);
                document.Add(field);
            }
            document.Add(new NumericField(OutDoorIndexFields.HasLight, Field.Store.YES, true).SetIntValue(OutDoor.HasLight));
            if (OutDoor.HasLight == 1)
            {
                document.Add(new NumericField(OutDoorIndexFields.LightStart, Field.Store.YES, true).SetIntValue(OutDoor.LightStart));
                document.Add(new NumericField(OutDoorIndexFields.LightEnd, Field.Store.YES, true).SetIntValue(OutDoor.LightEnd));
            }

            document.Add(new NumericField(OutDoorIndexFields.TotalArea, Field.Store.YES, true).SetDoubleValue(Convert.ToDouble(OutDoor.TotalArea)));
            document.Add(new NumericField(OutDoorIndexFields.CityCode, Field.Store.YES, true).SetIntValue(OutDoor.CityCode));
            document.Add(new NumericField(OutDoorIndexFields.CityCateCode, Field.Store.YES, true).SetLongValue(OutDoor.CityCateCode));

            document.Add(new NumericField(OutDoorIndexFields.MediaCode, Field.Store.YES, true).SetIntValue(OutDoor.MediaCode));
            document.Add(new NumericField(OutDoorIndexFields.MediaCateCode, Field.Store.YES, true).SetLongValue(OutDoor.MediaCateCode));
            document.Add(new NumericField(OutDoorIndexFields.FormatCode, Field.Store.YES, true).SetIntValue(OutDoor.FormatCode));
            document.Add(new NumericField(OutDoorIndexFields.PeriodCode, Field.Store.YES, true).SetIntValue(OutDoor.PeriodCode));
            //document.Add(new NumericField(OutDoorIndexFields.OwnerCode, Field.Store.YES, true).SetIntValue(OutDoor.OwnerCode));
            document.Add(new NumericField(OutDoorIndexFields.Status, Field.Store.YES, true).SetIntValue(OutDoor.Status));
            document.Add(new NumericField(OutDoorIndexFields.TrafficAuto, Field.Store.YES, true).SetIntValue(OutDoor.TrafficAuto));
            document.Add(new NumericField(OutDoorIndexFields.TrafficPerson, Field.Store.YES, true).SetIntValue(OutDoor.TrafficPerson));
            document.Add(new NumericField(OutDoorIndexFields.AuthStatus, Field.Store.YES, true).SetIntValue(OutDoor.AuthStatus));

            document.Add(new NumericField(OutDoorIndexFields.Hit, Field.Store.YES, true).SetIntValue(OutDoor.Hit));
            document.Add(new NumericField(OutDoorIndexFields.SuggestStatus, Field.Store.YES, true).SetIntValue(OutDoor.SuggestStatus));
            document.Add(new NumericField(OutDoorIndexFields.Published, Field.Store.YES, true).SetLongValue(OutDoor.Published.Ticks));
            document.Add(new NumericField(OutDoorIndexFields.DeadLine, Field.Store.YES, true).SetLongValue(OutDoor.DeadLine.Ticks));
            document.Add(new NumericField(OutDoorIndexFields.MemberStatus, Field.Store.YES, true).SetIntValue(OutDoor.MemberStatus));
            document.Add(new NumericField(OutDoorIndexFields.Lat, Field.Store.YES, true).SetDoubleValue(OutDoor.Lat));
            document.Add(new NumericField(OutDoorIndexFields.Lng, Field.Store.YES, true).SetDoubleValue(OutDoor.Lng));
            document.Add(new NumericField(OutDoorIndexFields.MemberID, Field.Store.YES, true).SetIntValue(OutDoor.MemberID));
            return document;
        }
示例#3
0
 private void WriteIndex(OutDoorIndexEntity OutDoor)
 {
     var document = CreateDocument(OutDoor);
     _indexWriter.AddDocument(document);
 }
示例#4
0
        private Document CreateDocument(OutDoorIndexEntity OutDoor)
        {
            var document = new Document();

            var field = new Field(OutDoorIndexFields.Title, OutDoor.Title, Field.Store.YES, Field.Index.ANALYZED);

            field.Boost = 2.5f;
            document.Add(field);

            field       = new Field(OutDoorIndexFields.Description, OutDoor.Description, Field.Store.YES, Field.Index.ANALYZED);
            field.Boost = 2.1f;
            document.Add(field);

            field       = new Field(OutDoorIndexFields.CompanyName, OutDoor.CompanyName, Field.Store.YES, Field.Index.ANALYZED);
            field.Boost = 2.0f;
            document.Add(field);

            field       = new Field(OutDoorIndexFields.Location, OutDoor.Location, Field.Store.YES, Field.Index.ANALYZED);
            field.Boost = 2.0f;
            document.Add(field);

            //field = new Field(OutDoorIndexFields.AreaCate, OutDoor.AreaCate, Field.Store.YES, Field.Index.ANALYZED);
            //field.Boost = 1.0f;
            //document.Add(field);

            //field = new Field(OutDoorIndexFields.CrowdCate, OutDoor.CrowdCate, Field.Store.YES, Field.Index.ANALYZED);
            //field.Boost = 1.0f;
            //document.Add(field);

            //field = new Field(OutDoorIndexFields.IndustryCate, OutDoor.IndustryCate, Field.Store.YES, Field.Index.ANALYZED);
            //field.Boost = 1.0f;
            //document.Add(field);

            //field = new Field(OutDoorIndexFields.PurposeCate, OutDoor.PurposeCate, Field.Store.YES, Field.Index.ANALYZED);
            //field.Boost = 1.0f;
            //document.Add(field);

            field       = new Field(OutDoorIndexFields.CityCateName, OutDoor.CityCateName, Field.Store.YES, Field.Index.ANALYZED);
            field.Boost = 1.0f;
            document.Add(field);

            field       = new Field(OutDoorIndexFields.MediaCateName, OutDoor.MediaCateName, Field.Store.YES, Field.Index.ANALYZED);
            field.Boost = 1.0f;
            document.Add(field);

            field       = new Field(OutDoorIndexFields.FormatName, OutDoor.FormatName, Field.Store.YES, Field.Index.ANALYZED);
            field.Boost = 0.2f;
            document.Add(field);

            field       = new Field(OutDoorIndexFields.PeriodName, OutDoor.PeriodName, Field.Store.YES, Field.Index.ANALYZED);
            field.Boost = 0.2f;
            document.Add(field);

            //field = new Field(OutDoorIndexFields.OwnerName, OutDoor.OwnerName, Field.Store.YES, Field.Index.ANALYZED);
            //field.Boost = 0.2f;
            //document.Add(field);

            field = new Field(OutDoorIndexFields.ImgUrl, OutDoor.ImgUrl, Field.Store.YES, Field.Index.NOT_ANALYZED);
            document.Add(field);

            field = new Field(OutDoorIndexFields.CredentialsImg, OutDoor.CredentialsImg, Field.Store.YES, Field.Index.NOT_ANALYZED);
            document.Add(field);

            field = new Field(OutDoorIndexFields.FocusImgUrl, OutDoor.FocusImgUrl, Field.Store.YES, Field.Index.NOT_ANALYZED);
            document.Add(field);

            field = new Field(OutDoorIndexFields.VideoUrl, string.IsNullOrEmpty(OutDoor.VideoUrl) ? string.Empty : OutDoor.VideoUrl, Field.Store.YES, Field.Index.NOT_ANALYZED);
            document.Add(field);

            field = new Field(OutDoorIndexFields.CityCateValue, OutDoor.CityCateValue, Field.Store.YES, Field.Index.NOT_ANALYZED);
            document.Add(field);

            field = new Field(OutDoorIndexFields.MediaCateValue, OutDoor.MediaCateValue, Field.Store.YES, Field.Index.NOT_ANALYZED);
            document.Add(field);


            field = new Field(OutDoorIndexFields.ID, OutDoor.ID.ToString(CultureInfo.InvariantCulture), Field.Store.YES, Field.Index.NOT_ANALYZED);
            document.Add(field);

            document.Add(new NumericField(OutDoorIndexFields.Price, Field.Store.YES, true).SetDoubleValue(Convert.ToDouble(OutDoor.Price)));

            document.Add(new NumericField(OutDoorIndexFields.RealPrice, Field.Store.YES, true).SetDoubleValue(Convert.ToDouble(OutDoor.RealPrice)));

            document.Add(new NumericField(OutDoorIndexFields.IsRegular, Field.Store.YES, true).SetIntValue(OutDoor.IsRegular));

            if (OutDoor.IsRegular == 1)
            {
                document.Add(new NumericField(OutDoorIndexFields.Width, Field.Store.YES, true).SetDoubleValue(Convert.ToDouble(OutDoor.Width)));
                document.Add(new NumericField(OutDoorIndexFields.Height, Field.Store.YES, true).SetDoubleValue(Convert.ToDouble(OutDoor.Height)));
                document.Add(new NumericField(OutDoorIndexFields.TotalFaces, Field.Store.YES, true).SetIntValue(OutDoor.TotalFaces));
            }
            else
            {
                field = new Field(OutDoorIndexFields.IrRegularArea, OutDoor.IrRegularArea, Field.Store.YES, Field.Index.NOT_ANALYZED);
                document.Add(field);
            }
            document.Add(new NumericField(OutDoorIndexFields.HasLight, Field.Store.YES, true).SetIntValue(OutDoor.HasLight));
            if (OutDoor.HasLight == 1)
            {
                document.Add(new NumericField(OutDoorIndexFields.LightStart, Field.Store.YES, true).SetIntValue(OutDoor.LightStart));
                document.Add(new NumericField(OutDoorIndexFields.LightEnd, Field.Store.YES, true).SetIntValue(OutDoor.LightEnd));
            }

            document.Add(new NumericField(OutDoorIndexFields.TotalArea, Field.Store.YES, true).SetDoubleValue(Convert.ToDouble(OutDoor.TotalArea)));
            document.Add(new NumericField(OutDoorIndexFields.CityCode, Field.Store.YES, true).SetIntValue(OutDoor.CityCode));
            document.Add(new NumericField(OutDoorIndexFields.CityCateCode, Field.Store.YES, true).SetLongValue(OutDoor.CityCateCode));

            document.Add(new NumericField(OutDoorIndexFields.MediaCode, Field.Store.YES, true).SetIntValue(OutDoor.MediaCode));
            document.Add(new NumericField(OutDoorIndexFields.MediaCateCode, Field.Store.YES, true).SetLongValue(OutDoor.MediaCateCode));
            document.Add(new NumericField(OutDoorIndexFields.FormatCode, Field.Store.YES, true).SetIntValue(OutDoor.FormatCode));
            document.Add(new NumericField(OutDoorIndexFields.PeriodCode, Field.Store.YES, true).SetIntValue(OutDoor.PeriodCode));
            //document.Add(new NumericField(OutDoorIndexFields.OwnerCode, Field.Store.YES, true).SetIntValue(OutDoor.OwnerCode));
            document.Add(new NumericField(OutDoorIndexFields.Status, Field.Store.YES, true).SetIntValue(OutDoor.Status));
            document.Add(new NumericField(OutDoorIndexFields.TrafficAuto, Field.Store.YES, true).SetIntValue(OutDoor.TrafficAuto));
            document.Add(new NumericField(OutDoorIndexFields.TrafficPerson, Field.Store.YES, true).SetIntValue(OutDoor.TrafficPerson));
            document.Add(new NumericField(OutDoorIndexFields.AuthStatus, Field.Store.YES, true).SetIntValue(OutDoor.AuthStatus));

            document.Add(new NumericField(OutDoorIndexFields.Hit, Field.Store.YES, true).SetIntValue(OutDoor.Hit));
            document.Add(new NumericField(OutDoorIndexFields.SuggestStatus, Field.Store.YES, true).SetIntValue(OutDoor.SuggestStatus));
            document.Add(new NumericField(OutDoorIndexFields.Published, Field.Store.YES, true).SetLongValue(OutDoor.Published.Ticks));
            document.Add(new NumericField(OutDoorIndexFields.DeadLine, Field.Store.YES, true).SetLongValue(OutDoor.DeadLine.Ticks));
            document.Add(new NumericField(OutDoorIndexFields.MemberStatus, Field.Store.YES, true).SetIntValue(OutDoor.MemberStatus));
            document.Add(new NumericField(OutDoorIndexFields.Lat, Field.Store.YES, true).SetDoubleValue(OutDoor.Lat));
            document.Add(new NumericField(OutDoorIndexFields.Lng, Field.Store.YES, true).SetDoubleValue(OutDoor.Lng));
            document.Add(new NumericField(OutDoorIndexFields.MemberID, Field.Store.YES, true).SetIntValue(OutDoor.MemberID));
            return(document);
        }
示例#5
0
        private void WriteIndex(OutDoorIndexEntity OutDoor)
        {
            var document = CreateDocument(OutDoor);

            _indexWriter.AddDocument(document);
        }
示例#6
0
        private List <OutDoorIndexEntity> GetOutDoors(List <int> Ids)
        {
            List <OutDoorIndexEntity> result = new List <OutDoorIndexEntity>();

            var query = db.Set <OutDoor>()
                        .Include(x => x.CityCate)
                        .Include(x => x.MediaCate)
                        //.Include(x => x.AreaCate)
                        //.Include(x => x.CrowdCate)
                        //.Include(x => x.IndustryCate)
                        //.Include(x => x.PurposeCate)
                        .Include(x => x.PeriodCate)
                        .Include(x => x.FormatCate)
                        .Include(x => x.Member)
                        .Include(x => x.Member.Company)
                        .Where(x => Ids.Contains(x.ID));

            foreach (var entity in query.ToList())
            {
                OutDoorIndexEntity item = new OutDoorIndexEntity();
                item.ID       = entity.ID;
                item.MemberID = entity.MemberID;

                var cityIds    = entity.CityCodeValue.Split(',').Select(x => Convert.ToInt32(x)).ToList();
                var cityValues = CityCateService.GetALL().Where(x => cityIds.Contains(x.ID)).Select(x => x.CateName).ToList();
                item.CityCode      = entity.CityCode;
                item.CityCateCode  = entity.CityCate.Code;
                item.CityCateValue = entity.CityCodeValue;
                item.CityCateName  = String.Join(",", cityValues);

                var meidaIds    = entity.MediaCodeValue.Split(',').Select(x => Convert.ToInt32(x)).ToList();
                var meidaValues = MediaCateService.GetALL().Where(x => meidaIds.Contains(x.ID)).Select(x => x.CateName).ToList();
                item.MediaCode      = entity.MediaCode;
                item.MediaCateCode  = entity.MediaCate.Code;
                item.MediaCateValue = entity.MediaCodeValue;
                item.MediaCateName  = String.Join(",", meidaValues);

                item.TrafficAuto   = entity.TrafficAuto;
                item.TrafficPerson = entity.TrafficPerson;
                item.Location      = entity.Location;
                item.FormatCode    = entity.FormatCode;
                item.FormatName    = entity.FormatCate.CateName;
                item.PeriodCode    = entity.PeriodCode;
                item.PeriodName    = entity.PeriodCate.CateName;
                if (entity.Price == 0)
                {
                    item.Price = 99999;
                }
                else
                {
                    item.Price = entity.Price;
                }
                if (entity.RealPrice == 0)
                {
                    item.RealPrice = 99999;
                }
                else
                {
                    item.RealPrice = entity.RealPrice;;
                }
                item.OwnerCode = entity.OwnerCode;
                //item.OwnerName = entity.OwnerCate.CateName;
                item.Status      = entity.Status;
                item.AuthStatus  = entity.AuthStatus;
                item.Title       = entity.Name;
                item.Description = entity.Description;
                item.ImgUrl      = entity.MediaImg;
                item.FocusImgUrl = entity.MediaFoucsImg;
                if (!string.IsNullOrEmpty(entity.CredentialsImg))
                {
                    item.CredentialsImg = entity.CredentialsImg;
                }
                else
                {
                    item.CredentialsImg = string.Empty;
                }
                item.VideoUrl = entity.VideoUrl;
                //item.AreaCate = string.Join(",", entity.AreaCate.Select(x => x.CateName).ToList());
                //item.CrowdCate = string.Join(",", entity.CrowdCate.Select(x => x.CateName).ToList());
                //item.IndustryCate = string.Join(",", entity.IndustryCate.Select(x => x.CateName).ToList());
                //item.PurposeCate = string.Join(",", entity.PurposeCate.Select(x => x.CateName).ToList());
                item.IsRegular = entity.IsRegular ? 1 : 0;
                item.HasLight  = entity.HasLight ? 1 : 0;
                if (entity.HasLight)
                {
                    item.LightStart = entity.LightStart;
                    item.LightEnd   = entity.LightEnd;
                }
                if (entity.IsRegular)
                {
                    item.Width      = entity.Wdith;
                    item.Height     = entity.Height;
                    item.TotalFaces = entity.TotalFaces;
                    item.TotalArea  = entity.Wdith * entity.Height * entity.TotalFaces;
                }
                else
                {
                    item.IrRegularArea = entity.IrRegularArea;

                    var areaParams = entity.IrRegularArea.Split('|').ToList();
                    var totalArea  = 0.0m;
                    for (var i = 1; i < areaParams.Count; i += 2)
                    {
                        totalArea += Convert.ToDecimal(areaParams[i]) * Convert.ToDecimal(areaParams[i + 1]);
                    }
                    item.TotalArea = totalArea;
                }
                item.Lat           = entity.Lat;
                item.Hit           = entity.Hit;
                item.SuggestStatus = entity.SuggestStatus;
                item.Lng           = entity.Lng;
                item.CompanyName   = entity.Member.Company.Name;
                item.DeadLine      = entity.Deadline;
                item.Published     = entity.LastTime;
                item.MemberStatus  = entity.Member.Status;
                result.Add(item);
            }
            return(result);
        }