/// <summary>
        /// 获取期现合约
        /// </summary>
        /// <returns></returns>
        public static List <ContractDetail> GetAllFutureSpotContract()
        {
            var allFutureSpots     = new List <ContractDetail>();
            var allVarietyIds      = SpotContractDao.GetAllVarietyId();
            var allFutureContracts = GetActiveContracts().Where(p => p.FutureType == FutureType.General).ToList();

            allFutureContracts = allFutureContracts.Where(p => allVarietyIds.Contains((int)p.VarietyID)).ToList();
            var allSpotContracts = SpotContractDao.GetAll();

            foreach (var item in allFutureContracts)
            {
                var spotContract = allSpotContracts.FirstOrDefault(p => p.VarietyID == item.VarietyID);
                if (spotContract == null)
                {
                    continue;
                }

                var contract = new ContractDetail();
                contract.ContractID     = item.ContractID;
                contract.VarietyID      = item.VarietyID;
                contract.Symbol         = string.Format("{0}&XH", item.Symbol);
                contract.ContractName   = string.Format("{0}期现", item.ContractName);
                contract.Exchange       = item.Exchange;
                contract.FutureType     = FutureType.FutureSpot;
                contract.ExpireDate     = item.ExpireDate;
                contract.EndDeliverDate = item.EndDeliverDate;
                allFutureSpots.Add(contract);
            }
            return(allFutureSpots);
        }
        /// <summary>
        /// 获取所有现货合约
        /// </summary>
        /// <returns></returns>
        public static List <ContractDetail> GetAllSpotContract()
        {
            var allSpotContracts = SpotContractDao.GetAll();
            var allFutureSpots   = new List <ContractDetail>();

            foreach (var contract in allSpotContracts)
            {
                var model   = new ContractDetail();
                var variety = VarietyDao.Get(contract.VarietyID);
                if (variety != null)
                {
                    model.Exchange = variety.EID;
                }
                model.ContractID   = contract.SpotID;
                model.VarietyID    = contract.VarietyID;
                model.Symbol       = contract.SpotCode;
                model.ContractName = contract.SpotName;
                model.FutureType   = FutureType.Spot;
                allFutureSpots.Add(model);
            }

            return(allFutureSpots);
        }