public void Execute(IJobExecutionContext context)
        {
            IStockCategoryService categoryService = new StockCategoryService();
            //导入行情分类的组
            IStockSync sync = new StockSync_Tencent();

            data.stock_category_group categoryGroup = sync.initCategoryGroup();
            categoryService.AddCategoryGroup(categoryGroup);

            //导入行情分类
            IList <data.stockcategory> cateList = sync.GetCategorys();

            foreach (data.stockcategory sc in cateList)
            {
                if (string.IsNullOrEmpty(sc.code) || string.IsNullOrEmpty(sc.name))
                {
                    continue;
                }
                if (categoryService.Find(sc.code) == null)
                {
                    categoryService.Add(sc);
                    this.Log().Info("导入行业:" + sc.name);
                }
            }
            //遍历类别,导入股票
            IStockService stockService           = new StockService();
            IList <data.stockcategory> cateList2 = categoryService.GetCategoryList(categoryGroup.code);

            foreach (data.stockcategory cate in cateList2)
            {
                IList <data.stock> stockLIst = sync.GetStocks(cate);
                if (stockLIst == null || stockLIst.Count == 0)
                {
                    continue;
                }
                foreach (data.stock s in stockLIst)
                {
                    s.stock_category_map.Add(new stock_category_map
                    {
                        cate_code  = cate.code,
                        stock_code = s.code,
                        stock_name = s.name
                    });
                    if (stockService.Find(s.code) == null)
                    {
                        stockService.Add(s);
                    }
                    else
                    {
                        stockService.Update(s);
                    }
                    this.Log().Info("导入股票:" + s.name);
                }
            }

            this.Log().Info("导入完成");
        }
        public void Execute(IJobExecutionContext context)
        {
            var cateService = new StockCategoryService();



            var cycleType = this.CycleType;

            IList <stockcategory> cateList = cateService.GetCategoryList("tencent");

            foreach (var category in cateList)
            {
                var priceList = cateService.GetPriceInfo(category.code, cycleType);
                this.Log().Error("开始计算行业技术指数:" + category.name + ",Code:" + category.code);
                var tech = new TechCalculate(ObjectType.Category, cycleType, category.code, priceList);

                tech.Run();
                this.Log().Error("开始计算:" + category.name + ",Code:" + category.code);
            }
        }