/// <summary> /// 向内部缓存数据添加数据初始化 /// 程序启动时对些方法调用一次 /// </summary> public void Initialize() { try { ShowMessage.Instanse.ShowFormTitleMessage("正在获取管理中心数据初始化内部参数"); commotity.Fill(key => key.CommodityCode, GetAllCommodity()); bourseTypes.Fill(key => key.BourseTypeID, GetAllBourseType()); breedClasss.Fill(key => key.BreedClassID, GetAllBreedClass()); breedClassTypes.Fill(key => key.BreedClassTypeID, GetAllBreedClassType()); //缓存根据期货品种类型缓存相关代码 privateInitCommotityByBreedClassID(); //=========== commodityFuses.Fill(key => key.CommodityCode, GetAllCommodityFuse()); //fieldRanages.Fill(key => key.FieldRangeID, GetAllFieldRange()); fuseTimeSections.Fill(key => key.TimesectionID, GetAllFuseTimesection()); //minChangePriceValues.Fill(key => key.BreedClassID.ToString() + "@" + key.FieldRangeID.ToString(), GetAllMinChangePriceValue()); qh_HighLowStopScopeType.Fill(key => key.HighLowStopScopeID, GetAllQH_HighLowStopScopeType()); qh_FuturesTradeRules.Fill(key => key.BreedClassID, GetAllQH_FutureTradeRules()); RC_MatchCenter model = GetMatchCenterByAddress(); int matchCenterID = model.MatchCenterID; matchCenter.Add(matchCenterID, model); matchMachine.Fill(key => key.MatchMachineID, GetAllMatchMachineByMatchCenterID(matchCenterID)); tradeCommodityAssign.Fill(key => key.CommodityCode, GetAllTradeCommodityAssign()); spotTradeRules.Fill(key => key.BreedClassID, GetAllSpotTradeRules()); //tradeTimes.Fill(key => key.TradeTimeID, GetAllTradeTime()); //改由以下以交易所ID为主键 privateInitTradeTime(); validDeclareTypes.Fill(key => key.BreedClassValidID, GetAllValidDeclareType()); validDeclareValues.Fill(key => key.ValidDeclareValueID, GetAllValidDeclareValue()); xh_SpotHighLowControlType.Fill(key => key.BreedClassHighLowID, GetAllSpotHighLowControlType()); xh_SpotHighLowValues.Fill(key => key.HightLowValueID, GetAllSpotHighLowValue()); zFCommodity.Fill(key => key.stkcd.ToString() + "@" + key.paydt.ToString(), GetAllZFCommodity()); //获取所有非交易日的日期 cm_notTradeDate.Fill(key => key.BourseTypeID.Value + "@" + key.NotTradeDay.Value.ToString("yyyy-MM-dd"), GetAllCMNotTradeDate()); qh_LastTradingDay.Fill(key => key.LastTradingDayID, GetAllLastTradingDay()); #region 港股部分 hk_MinPriceFiled.Fill(key => key.FieldRangeID, GetHKMinChangePriceFieldRange()); hk_spotTradeRules.Fill(key => key.BreedClassID, GetHKSpotTradeRules()); hk_commodity.Fill(key => key.HKCommodityCode, GetAllHKCommodity()); //hkSpotCosts.Fill(key => key.BreedClassID, get()); #endregion ShowMessage.Instanse.ShowFormTitleMessage("获取管理中心数据初始化内部参数(完)"); } catch (Exception ex) { LogHelper.WriteError("CH-0002:初始化缓存数据异常0001", ex); ShowMessage.Instanse.ShowFormTitleMessage("获取管理中心数据初始化内部参数异常"); throw ex; } }