Exemplo n.º 1
0
        protected override RESULT Process(StringBuilder messager)
        {
            var working = Config.Instance.INFO.BizTime.IsWorkingTime;

            //working = 0;
            if (working > 0)
            {
                // Retrieve Code Data From DB
                var stocks = new List <string>();
                if (CheckTable <DBTStkFavoriteEntity>())
                {
                    accessor.RetrieveEntity <DBTStkFavoriteEntity>().ForEach(data => stocks.Add(StockInfoEntity.FormatedCode(data.Code)));
                }
                if (stocks.Count > 0)
                {
                    service.FetchData <TengxunStockInfoEntity>(stocks).ForEach(info =>
                    {
                        if (info.IsTodayData && info.IsValid)
                        {
                            this.PutData <TengxunStockInfoEntity>(info.Code, info);
                        }
                    });
                }
            }
            else
            {
                Config.Instance.INFO.BizTime.Clear();
                tables.Clear();
            }

            return(RESULT.OK);
        }
Exemplo n.º 2
0
        protected override RESULT Process(StringBuilder messager)
        {
            var working = Config.Instance.INFO.TimeSetting.IsWorkingTime;

            if (working > 0)
            {
                // Retrieve Code Data From DB
                var stocks = new List <string>();
                if (CheckTable <DBTStkFavoriteEntity>())
                {
                    accessor.RetrieveEntity <DBTStkFavoriteEntity>().ForEach(data => stocks.Add(StockInfoEntity.FormatedCode(data.Code)));
                }
                if (stocks.Count > 0)
                {
                    var list = service.FetchData <TengxunStockInfoEntity>(stocks);
                    foreach (TengxunStockInfoEntity info in list)
                    {
                        ProcessStockInfo(info);
                    }
                }
            }
            else
            {
                RecordDailyInfo();
                LastDayEntities.Clear();
                Config.Instance.INFO.TimeSetting.Clear();
                tables.Clear();
                filter4idx.Clear();
                filter4stk.Clear();

                lines.Values.ToList().ForEach(line => line.TriggerSwitch());
                lines.Values.ToList().ForEach(line => line.Clear());
            }

            return(RESULT.OK);
        }