Esempio n. 1
0
        public static void SyncHistoryData(DateTime?from, DateTime?to)
        {
            if (!to.HasValue)
            {
                to = DateTime.Now.AddDays(1);
            }

            var tradeList = SinaBiz.GetTradeList();

            if (tradeList.IsNullOrEmpty())
            {
                return;
            }
            var stocklist = tradeList;

            for (int i = 0; i < stocklist.Count; i++)
            {
                var fromDate = DailyDAL.GetMaxDaily(stocklist[i].StockCode);
                var list     = WYStockBiz.HistoryTradeList(stocklist[i].StockCode
                                                           , fromDate.GetValueOrDefault(DateTime.Now.AddYears(-10)).AddDays(1)
                                                           , to.Value);
                if (list.Count > 0)
                {
                    ThreadPool.QueueUserWorkItem(state => {
                        DailyDAL.Insert(list);
                    });
                }
                LogFactory.Instance.Write($"{i}/{stocklist.Count}");
            }
        }
Esempio n. 2
0
        public static void SyncFinance()
        {
            var list = WYStockBiz.GetFinanceList(DateTime.Now);

            if (!list.IsNullOrEmpty())
            {
                FinanceDAL.InsertFinance(list);
            }
        }
Esempio n. 3
0
        public static void SyncPlanFinance()
        {
            var date = FinanceDAL.GetMaxPlanIndate();

            if (!date.HasValue)
            {
                date = DateTime.Now.AddYears(-2);
            }
            var list = WYStockBiz.GetPlanFinance(date.Value);

            if (!list.IsNullOrEmpty())
            {
                FinanceDAL.InsertPlan(list);
            }
        }