public List <UFXMultipleHoldingResponse> QueryMultipleHolding(List <UFXHoldingRequest> requests) { DataParser parser = SubmitSync <UFXHoldingRequest>(UFXFunctionCode.QueryMultipleHolding, requests); return(UFXDataSetHelper.ParseData <UFXMultipleHoldingResponse>(parser)); }
public List <UFXFutureHoldingDetailResponse> QueryFutureHoldingDetail(List <UFXFutureHoldingDetailRequest> requests) { DataParser parser = SubmitSync <UFXFutureHoldingDetailRequest>(UFXFunctionCode.QueryFutureDetailHolding, requests); return(UFXDataSetHelper.ParseData <UFXFutureHoldingDetailResponse>(parser)); }
/// <summary> /// 可以批量撤销委托证券 /// </summary> /// <param name="requests"></param> /// <returns></returns> public List <UFXBasketWithdrawResponse> Withdraw(List <UFXWithdrawRequest> requests) { DataParser parser = SubmitSync <UFXWithdrawRequest>(UFXFunctionCode.Withdraw, requests); return(GetResponse(parser)); }
public List <UFXQueryMoneyResponse> QueryAccountMoney(List <UFXQueryMoneyRequest> requests) { DataParser parser = SubmitSync <UFXQueryMoneyRequest>(UFXFunctionCode.QueryAccountMoney, requests); return(UFXDataSetHelper.ParseData <UFXQueryMoneyResponse>(parser)); }
public DataParser SubmitSync <T>(UFXFunctionCode functionCode, List <T> requests) { DataParser parser = new DataParser(); FunctionItem functionItem = ConfigManager.Instance.GetFunctionConfig().GetFunctionItem(functionCode); if (functionItem == null || functionItem.RequestFields == null || functionItem.RequestFields.Count == 0) { string msg = string.Format("提交UFX请求号[{0}]未定义!", functionCode); logger.Error(msg); parser.ErrorCode = ConnectionCode.ErrorNoFunctionCode; return(parser); } string userToken = LoginManager.Instance.LoginUser.Token; if (string.IsNullOrEmpty(userToken)) { string msg = string.Format("提交UFX请求[{0}]令牌失效!", functionCode); logger.Error(msg); parser.ErrorCode = ConnectionCode.ErrorLogin; return(parser); } CT2BizMessage bizMessage = new CT2BizMessage(); //初始化 bizMessage.SetFunction((int)functionCode); bizMessage.SetPacketType(CT2tag_def.REQUEST_PACKET); //业务包 CT2Packer packer = new CT2Packer(2); packer.BeginPack(); foreach (FieldItem item in functionItem.RequestFields) { packer.AddField(item.Name, item.Type, item.Width, item.Scale); } var dataFieldMap = UFXDataBindingHelper.GetProperty <T>(); foreach (var request in requests) { foreach (FieldItem item in functionItem.RequestFields) { if (dataFieldMap.ContainsKey(item.Name)) { SetRequestField <T>(ref packer, request, item, dataFieldMap); } else { SetRequestDefaultField(ref packer, item, userToken); } } } packer.EndPack(); #if DEBUG OutputParam <T>(functionCode, requests); #endif unsafe { bizMessage.SetContent(packer.GetPackBuf(), packer.GetPackLen()); } parser = _t2SDKWrap.SendSync2(bizMessage); return(parser); }