public void ProcessDoOrder(OrderResponse response, HKOrderRequest request) { HKMessage message = new HKMessage(); message.BuySell = request.BuySell == GTA.VTS.Common.CommonObject.Types.TransactionDirection.Buying ? "买" : "卖"; message.CapitalAccount = request.FundAccountId; message.Code = request.Code; message.EntrustAmount = request.OrderAmount.ToString(); message.EntrustNumber = response.OrderId; message.EntrustPrice = request.OrderPrice.ToString(); //message.EntrustType = request.OrderWay == TypesOrderPriceType.OPTLimited ? "限价" : "市价"; switch (request.OrderWay) { case Types.HKPriceType.LO: message.EntrustType = "限价单"; break; case Types.HKPriceType.ELO: message.EntrustType = "增强限价单"; break; case Types.HKPriceType.SLO: message.EntrustType = "特别限价单"; break; } message.OrderMessage = response.OrderMessage; message.OrderStatus = "未报02"; message.TradeAmount = "0"; message.TradeTime = ""; listLock.EnterWriteLock(); try { hkMessageList.Add(message); } finally { listLock.ExitWriteLock(); } if (!response.IsSuccess) { message.EntrustNumber = System.Guid.NewGuid().ToString(); message.OrderStatus = "废单06"; } hkMessageCache.Add(message.EntrustNumber, message); HasChanged = true; }
public void InsertModifyBack(HK_TodayEntrustInfo tet) { HKMessage message = new HKMessage(); message.BuySell = tet.BuySellTypeID == (int)GTA.VTS.Common.CommonObject.Types.TransactionDirection.Buying ? "买" : "卖"; message.CapitalAccount = tet.CapitalAccount; message.Code = tet.Code; message.EntrustAmount = tet.EntrustAmount.ToString(); message.EntrustNumber = tet.EntrustNumber; message.EntrustPrice = tet.EntrustPrice.ToString(); message.IsModifyOrder = "是"; message.ModifyOrderNumber = tet.ModifyOrderNumber; switch (tet.OrderPriceType) { case (int)Types.HKPriceType.LO: message.EntrustType = "限价单"; break; case (int)Types.HKPriceType.ELO: message.EntrustType = "增强限价单"; break; case (int)Types.HKPriceType.SLO: message.EntrustType = "特别限价单"; break; } message.OrderMessage = tet.OrderMessage; message.OrderStatus = Utils.GetOrderStateMsg(tet.OrderStatusID); message.TradeAmount = tet.TradeAmount.ToString(); message.TradeTime = ""; listLock.EnterWriteLock(); try { hkMessageList.Add(message); } finally { listLock.ExitWriteLock(); } hkMessageCache.Add(message.EntrustNumber, message); HasChanged = true; }