public void Send(IMessageSender sender) { this.Log().Info("开始计算个股形态"); DateTime StartDate0 = stockService.GetLatestDate(ObjectType.Stock, "0601988"); DateTime StartDate1 = stockService.GetLatestDate(ObjectType.Stock, "0601318"); var StartDate = StartDate0.CompareTo(StartDate1) >= 0 ? StartDate0 : StartDate1; IList <stockcategory> cateList = cateService.FindAll(); TechCycle[] cycleList = new TechCycle[] { TechCycle.day, TechCycle.week, TechCycle.month }; var log = this.Log(); foreach (var category in cateList) { if (StartDate.ToString("yyyyMMdd") == DateTime.Now.ToString("yyyyMMdd")) { log.Info(string.Format("导入今天日线数据,分类:{1}:从日期{0}", StartDate.ToString("yyyy-MM-dd"), category.name)); var task1 = new PriceUpdate { StartDate = StartDate, CateCode = category.code }; sender.Send(JsonConvert.SerializeObject(task1)); //ImportTodayPrice(stockList); } else { IList <data.stock> stockList = stockService.GetStockByCategory(category.code); foreach (var stock in stockList) { var task1 = new PriceUpdate { StartDate = StartDate, StockCode = stock.code }; sender.Send(JsonConvert.SerializeObject(task1)); //log.Info(string.Format("导入日线开始,股票:{1}:从日期{0}", StartDate.ToString("yyyy-MM-dd"), stock.name)); //ImportDay(stock, StartDate); //log.Info(string.Format("导入周线开始,股票:{1}:从日期{0}", StartDate.ToString("yyyy-MM-dd"), stock.name)); //ImportWeek(stock, StartDate); //log.Info(string.Format("导入月线开始,股票:{1}:从日期{0}", StartDate.ToString("yyyy-MM-dd"), stock.name)); //ImportMonth(stock, StartDate); //log.Info(string.Format("导入结束,股票:{1}:从日期{0}", StartDate.ToString("yyyy-MM-dd"), stock.name)); } } } }
public void Send(IMessageSender sender) { DateTime StartDate0 = objService.GetLatestDate(data.ObjectType.Stock, "0601988"); DateTime StartDate1 = objService.GetLatestDate(data.ObjectType.Stock, "0601318"); var StartDate = StartDate0.CompareTo(StartDate1) >= 0 ? StartDate0 : StartDate1; var task1 = new PriceUpdate { StartDate = StartDate }; sender.Send(JsonConvert.SerializeObject(task1)); }