/// <summary>
        /// 港股下单
        /// </summary>
        /// <param name="model">港股委托实体</param>
        /// <returns></returns>
        public ResultDataEntity DoHKStockOrder(HKEntrustOrderInfo model)
        {
            var    result = new ResultDataEntity();
            string message;

            LogHelper.WriteDebug("撮合中心管理器港股下单方法:");
            if (model == null || string.IsNullOrEmpty((model.HKSecuritiesCode)))
            {
                message        = "CH-0010:委托单不能为空或者港股代码不能为空;";
                result.Message = message;
                LogHelper.WriteDebug(message);
                return(result);
            }
            if (matchDevices != null)
            {
                if (matchDevices.ContainsKey(model.HKSecuritiesCode.Trim()))
                {
                    return(matchDevices[model.HKSecuritiesCode.Trim()].DoHKStockOrder(model));
                }
                message = "CH-0011:管理中心撮合单元没有分配或撮合中心没有分配此品种类型撮合;";
                LogHelper.WriteDebug(message);
            }
            else
            {
                message = "CH-0012:撮合中心撮合机不存在;";
                LogHelper.WriteDebug(message);
            }
            result.Message = message;
            return(result);
        }
        /// <summary>
        /// 保存错误成交回报
        /// </summary>
        /// <param name="entity">成交回报</param>
        /// <param name="type"></param>
        private bool InsertResultDealBackEntity(ResultDataEntity entity, DealBackEntityType type)
        {
            if (HasAddId(entity.Id))
            {
                return(false);
            }

            BD_UnReckonedDealTableInfo table = new BD_UnReckonedDealTableInfo();

            table.id      = entity.Id;
            table.OrderNo = entity.OrderNo;
            table.Message = entity.Message;
            //table.Price = entity.DealPrice;
            //table.Amount = (int)entity.DealAmount;
            //table.Time = entity.DealTime;

            table.EntityType = (int)type;

            string desc = GetResultDesc(entity);

            LogHelper.WriteDebug("$-------$CrashManager.InsertResultDealBackEntity" + desc);

            SaveEntity(table);

            //entity.Id = table.Id.ToString();
            AddID(entity.Id);
            return(true);
        }
        /// <summary>
        /// 商品期货下单
        /// Create by: 董鹏
        /// Create Date: 2010-01-22
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns>
        public ResultDataEntity DoCommoditiesOrder(CommoditiesDataOrderEntity model)
        {
            var    result = new ResultDataEntity();
            string message;

            LogHelper.WriteDebug("撮合中心管理器商品期货下单方法:");
            if (model == null || string.IsNullOrEmpty((model.StockCode)))
            {
                message        = "CH-0010:委托单不能为空或者期货代码不能为空;";
                result.Message = message;
                LogHelper.WriteDebug(message);
                return(result);
            }
            //撮合中心撮合机不能为空
            if (matchDevices != null)
            {
                if (matchDevices.ContainsKey(model.StockCode.Trim()))
                {
                    return(matchDevices[model.StockCode.Trim()].DoCommoditiesOrder(model));
                }
                message = "CH-0011:管理中心撮合单元没有分配或撮合中心没有分配此品种类型撮合;";
                LogHelper.WriteDebug(message);
            }
            else
            {
                message = "CH-0012:撮合中心撮合机不存在;";
                LogHelper.WriteDebug(message);
            }
            result.Message = message;
            return(result);
        }
Ejemplo n.º 4
0
        /// <summary>
        /// 现货异步委托回报价格异常(废单)
        /// </summary>
        /// <param name="model"></param>
        public void ProcessStockOrderRpt(ResultDataEntity model)
        {
            string desc = CrashManager.GetInstance().GetResultDesc(model);

            LogHelper.WriteDebug("<---现货异步委托回报价格异常(废单)DoCallbackProcess.AcceptXHErrorOrderRpt" + desc);

            if (string.IsNullOrEmpty(model.Id))
            {
                model.Id = Guid.NewGuid().ToString();
            }

            if (CrashManager.GetInstance().InsertXHResultDealBackEntity(model))
            {
                ReckonCenter.Instace.AcceptXHErrorOrderRpt(model);
            }
        }
        private void ProcessResultTable(BD_UnReckonedDealTableInfo table, int type)
        {
            ResultDataEntity entity = new ResultDataEntity();

            entity.Id      = table.id;
            entity.OrderNo = table.OrderNo;
            entity.Message = table.Message;

            switch (type)
            {
            case (int)DealBackEntityType.XHResult:
                LogHelper.WriteInfo("$-------$CrashManger.ProcessResultTable重新发送现货ResultDataEntity" +
                                    GetResultDesc(entity));
                ReckonCenter.Instace.AcceptXHErrorOrderRpt(entity);
                break;

            case (int)DealBackEntityType.HKResult:
                LogHelper.WriteInfo("$-------$CrashManger.ProcessResultTable重新发送现货ResultDataEntity" +
                                    GetResultDesc(entity));
                ReckonCenter.Instace.AcceptHKErrorOrderRpt(entity);
                break;

            case (int)DealBackEntityType.QHResult:
                LogHelper.WriteInfo("$-------$CrashManger.ProcessResultTable重新发送期货ResultDataEntity" +
                                    GetResultDesc(entity));

                ReckonCenter.Instace.AcceptSPQHErrorOrderRpt(entity);
                break;

            case (int)DealBackEntityType.GZQHResult:
                LogHelper.WriteInfo("$-------$CrashManger.ProcessResultTable重新发送股指期货ResultDataEntity" +
                                    GetResultDesc(entity));

                ReckonCenter.Instace.AcceptGZQHErrorOrderRpt(entity);
                break;
            }
        }
        public string GetResultDesc(ResultDataEntity entity)
        {
            string format = "错误成交回报[OrderNo={0},Message={1}, ID={2}, CounterID={3}]";

            return(string.Format(format, entity.OrderNo, entity.Message, entity.Id, CountID));
        }
 public bool InsertGZQHResultDealBackEntity(ResultDataEntity entity)
 {
     return(InsertResultDealBackEntity(entity, DealBackEntityType.GZQHResult));
 }
 /// <summary>
 /// 构造器
 /// </summary>
 /// <param name="errorItem"></param>
 /// <param name="breedClassType"></param>
 public OrderErrorItem(ResultDataEntity errorItem, Types.BreedClassTypeEnum breedClassType)
 {
     ErrorItem      = errorItem;
     BreedClassType = breedClassType;
 }
Ejemplo n.º 9
0
        //void IOrderDealRptCallback.ProcessHKStockOrderRpt(ResultDataEntity model)
        //{
        //    throw new NotImplementedException();
        //}

        IAsyncResult IOrderDealRptCallback.BeginProcessHKStockOrderRpt(ResultDataEntity model, AsyncCallback callback, object asyncState)
        {
            throw new NotImplementedException();
        }
Ejemplo n.º 10
0
 public void saveResult(ResultDataEntity data)
 {
     var p = new Params();
     p.LengthX = (float)lengthX;
     p.LengthY = (float)lengthY;
     p.StepX = N1;
     p.StepY = N2;
     p.Time = (float)T;
     data.Params.Add(p);
     for (int t = 0; t < result.Length; t++)
     {
         for (int y = 0; y <= N2; y++)
         {
             for (int x = 0; x <= N1; x++)
             {
                 var s = new Surface();
                 s.Iteration = t;
                 s.Params = p;
                 s.X = x;
                 s.Y = y;
                 s.F = (float)result[t][y][x];
                 data.Surface.Add(s);
             }
         }
     }
 }