Ejemplo n.º 1
0
        public static CaseSpiderCountInfo GetCaseSpiderInfo(List <get_案例信息_获取时间段内城市网站的爬取个数Result> lastWeekSpiderCaseCountList,
                                                            List <get_案例信息_获取时间段内城市网站的爬取个数Result> weekSpiderCaseCountList,
                                                            List <get_案例信息_获取时间段内城市网站的已入库的案例个数Result> importCaseCountList,
                                                            List <get_案例信息_获取时间段内城市网站的未入库的案例个数Result> notImportCaseCountList, int cityId, string cityName, int webId, string webName)
        {
            int lastWeekCount = 0; int weekCount = 0; double floatValue = 0; int importCount = 0; int notImportCount = 0;
            //上周数量
            get_案例信息_获取时间段内城市网站的爬取个数Result ajkCount1     = lastWeekSpiderCaseCountList.Find(
                delegate(get_案例信息_获取时间段内城市网站的爬取个数Result obj)
                { return(obj.城市ID == cityId && obj.网站ID == webId); });

            if (ajkCount1 != null)
            {
                lastWeekCount = Convert.ToInt32(ajkCount1.个数);
            }
            //本周数量
            get_案例信息_获取时间段内城市网站的爬取个数Result ajkCount2     = weekSpiderCaseCountList.Find(
                delegate(get_案例信息_获取时间段内城市网站的爬取个数Result obj)
                { return(obj.城市ID == cityId && obj.网站ID == webId); });

            if (ajkCount2 != null)
            {
                weekCount = Convert.ToInt32(ajkCount2.个数);
            }
            //浮动值
            floatValue = 0;
            if (lastWeekCount > 0)
            {
                floatValue = (Convert.ToDouble(weekCount) / Convert.ToDouble(lastWeekCount)) - 1;
                floatValue = Convert.ToDouble(Decimal.Round(Convert.ToDecimal(floatValue), 4));
            }
            else if (weekCount > 0)
            {
                floatValue = 1;
            }
            //已入库案例数
            get_案例信息_获取时间段内城市网站的已入库的案例个数Result import    = importCaseCountList.Find(
                delegate(get_案例信息_获取时间段内城市网站的已入库的案例个数Result obj)
                { return(obj.城市ID == cityId && obj.网站ID == webId); });

            if (import != null)
            {
                importCount = Convert.ToInt32(import.个数);
            }
            //已入库案例数
            get_案例信息_获取时间段内城市网站的未入库的案例个数Result notImport = notImportCaseCountList.Find(
                delegate(get_案例信息_获取时间段内城市网站的未入库的案例个数Result obj)
                { return(obj.城市ID == cityId && obj.网站ID == webId); });

            if (notImport != null)
            {
                notImportCount = Convert.ToInt32(notImport.个数);
            }
            CaseSpiderCountInfo en = new CaseSpiderCountInfo(cityName, cityId, webName, webId, lastWeekCount, weekCount, floatValue, importCount, notImportCount);

            return(en);
        }
Ejemplo n.º 2
0
        public static void GetCaseSpiderInfoByWebIdAndCityId(List <get_案例信息_获取时间段内城市网站的爬取个数Result> lastWeekSpiderCaseCountList,
                                                             List <get_案例信息_获取时间段内城市网站的爬取个数Result> weekSpiderCaseCountList,
                                                             List <get_案例信息_获取时间段内城市网站的已入库的案例个数Result> importCaseCountList,
                                                             List <get_案例信息_获取时间段内城市网站的未入库的案例个数Result> notImportCaseCountList,
                                                             int cityId, int webId, out int lastWeekCount, out int weekCount, out decimal floatValue, out int importCount, out int notImportCount)
        {
            lastWeekCount = 0; weekCount = 0; floatValue = 0; importCount = 0; notImportCount = 0;
            //上周数量
            get_案例信息_获取时间段内城市网站的爬取个数Result ajkCount1 = lastWeekSpiderCaseCountList.Find(
                delegate(get_案例信息_获取时间段内城市网站的爬取个数Result obj)
                { return(obj.城市ID == cityId && obj.网站ID == webId); });

            if (ajkCount1 != null)
            {
                lastWeekCount = Convert.ToInt32(ajkCount1.个数);
            }
            //本周数量
            get_案例信息_获取时间段内城市网站的爬取个数Result ajkCount2 = weekSpiderCaseCountList.Find(
                delegate(get_案例信息_获取时间段内城市网站的爬取个数Result obj)
                { return(obj.城市ID == cityId && obj.网站ID == webId); });

            if (ajkCount2 != null)
            {
                weekCount = Convert.ToInt32(ajkCount2.个数);
            }
            //浮动值
            floatValue = (Convert.ToDecimal(weekCount) / Convert.ToDecimal(lastWeekCount)) - 1;
            floatValue = Decimal.Round(floatValue, 4);
            //已入库案例数
            get_案例信息_获取时间段内城市网站的已入库的案例个数Result ajkImport = importCaseCountList.Find(
                delegate(get_案例信息_获取时间段内城市网站的已入库的案例个数Result obj)
                { return(obj.城市ID == cityId && obj.网站ID == webId); });

            if (ajkImport != null)
            {
                importCount = Convert.ToInt32(ajkImport.个数);
            }
            //已入库案例数
            get_案例信息_获取时间段内城市网站的未入库的案例个数Result ajkNotImport = notImportCaseCountList.Find(
                delegate(get_案例信息_获取时间段内城市网站的未入库的案例个数Result obj)
                { return(obj.城市ID == cityId && obj.网站ID == webId); });

            if (ajkNotImport != null)
            {
                importCount = Convert.ToInt32(ajkNotImport.个数);
            }
        }