IOrderService.cs 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265
  1. //----------------------------------------------------------------
  2. //Module Name: IOrderService
  3. //Purpose:
  4. //CopyRight: Muchinfo
  5. //History:
  6. //----------------------------------------------------------------
  7. //DateTime Author Description
  8. //----------------------------------------------------------------
  9. //2014-03-22 deng.yinping Create
  10. //----------------------------------------------------------------
  11. using Muchinfo.MTPClient.Data;
  12. using Muchinfo.MTPClient.Data.Enums;
  13. using Muchinfo.MTPClient.Data.Model;
  14. using Muchinfo.MTPClient.Data.Model.Account;
  15. using System;
  16. using System.Collections.Generic;
  17. using System.Collections.ObjectModel;
  18. namespace Muchinfo.MTPClient.IService
  19. {
  20. public interface IOrderService
  21. {
  22. /// <summary>
  23. /// 即期下单委托
  24. /// </summary>
  25. /// <param name="entrustOrder">委托内容</param>
  26. /// <param name="successAction">成功回应</param>
  27. /// <param name="errorAction">失败回应</param>
  28. void MakeMarketEntrustOrder(NewEntrustOrder entrustOrder, Action<OrderDetail> successAction,
  29. Action<ErrorEntity> errorAction);
  30. /// <summary>
  31. /// 竞价下单委托
  32. /// </summary>
  33. /// <param name="entrustOrder">委托内容</param>
  34. /// <param name="successAction">成功回应</param>
  35. /// <param name="errorAction">失败回应</param>
  36. void BidMarketEntrustOrder(NewEntrustOrder entrustOrder, Action<OrderDetail> successAction,
  37. Action<ErrorEntity> errorAction);
  38. /// <summary>
  39. /// 混合修改止损止盈
  40. /// </summary>
  41. /// <param name="entrustOrder">委托下单</param>
  42. /// <param name="successAction"></param>
  43. /// <param name="errorAction"></param>
  44. void MixModifyEntrustOrder(NewEntrustOrder entrustOrder, Action<OrderDetail> successAction,
  45. Action<ErrorEntity> errorAction);
  46. /// <summary>
  47. /// 混合下单委托
  48. /// </summary>
  49. /// <param name="entrustOrder">委托内容</param>
  50. /// <param name="successAction">成功回应</param>
  51. /// <param name="errorAction">失败回应</param>
  52. void MixMarketEntrustOrder(NewEntrustOrder entrustOrder, Action<OrderDetail> successAction,
  53. Action<ErrorEntity> errorAction);
  54. /// <summary>
  55. /// 撤单
  56. /// </summary>
  57. /// <param name="entrustOrder"></param>
  58. /// <param name="successAction"></param>
  59. /// <param name="errorAction"></param>
  60. void CancelOrder(NewEntrustOrder entrustOrder, Action successAction,
  61. Action<ErrorEntity> errorAction);
  62. void CancelOrderWithoutResult(NewEntrustOrder entrustOrder);
  63. /// <summary>
  64. /// 查询持仓单,更新本地缓存
  65. /// </summary>
  66. /// <param name="statement">sqlId</param>
  67. /// <param name="queryCommonParams">参数</param>
  68. /// <param name="successAction">成功返回</param>
  69. /// <param name="errorAction">失败返回</param>
  70. void QueryHoldingPosistion(string statement, List<QueryCommonParam> queryCommonParams, Action<List<HoldingSummary>> successAction, Action<ErrorEntity> errorAction);
  71. /// <summary>
  72. /// 查询持仓汇总
  73. /// </summary>
  74. /// <param name="statement"></param>
  75. /// <param name="queryCommonParams"></param>
  76. /// <param name="successAction"></param>
  77. /// <param name="errorAction"></param>
  78. void QueryHoldingSummarys(string statement, List<QueryCommonParam> queryCommonParams,
  79. Action<List<HoldingSummary>> successAction, Action<ErrorEntity> errorAction);
  80. /// <summary>
  81. /// 委托单查询,
  82. /// </summary>
  83. /// <param name="statement">sql id</param>
  84. /// <param name="queryCommonParams">通用查询参数</param>
  85. /// <param name="successAction">成功查询回调</param>
  86. /// <param name="errorAction">失败返回回调</param>
  87. void QueryEntrustOrder(string statement, List<QueryCommonParam> queryCommonParams,
  88. Action<List<OrderDetail>> successAction, Action<ErrorEntity> errorAction);
  89. /// <summary>
  90. /// 根据持仓汇总查询持仓明细
  91. /// </summary>
  92. /// <param name="statement"></param>
  93. /// <param name="queryCommonParams"></param>
  94. /// <param name="successAction"></param>
  95. /// <param name="errorAction"></param>
  96. void QueryHoldLstBySummary(string statement, List<QueryCommonParam> queryCommonParams, Action<List<HoldingOrder20>> successAction, Action<ErrorEntity> errorAction);
  97. /// <summary>
  98. /// 成交单查询
  99. /// </summary>
  100. /// <param name="statement">sql id</param>
  101. /// <param name="queryCommonParams">通用查询参数</param>
  102. /// <param name="successAction">成功返回</param>
  103. /// <param name="errorAction">错误返回</param>
  104. void QueryComplateOrders(string statement, List<QueryCommonParam> queryCommonParams,
  105. Action<List<CompleteOrder>> successAction, Action<ErrorEntity> errorAction);
  106. /// <summary>
  107. /// 成交单查询
  108. /// </summary>
  109. /// <param name="statement">sql id</param>
  110. /// <param name="queryCommonParams">通用查询参数</param>
  111. /// <param name="successAction">成功返回</param>
  112. /// <param name="errorAction">错误返回</param>
  113. void QueryUserLogs(string statement, List<QueryCommonParam> queryCommonParams,
  114. Action<List<UserLog>> successAction, Action<ErrorEntity> errorAction);
  115. /// <summary>
  116. /// 查询平仓单
  117. /// </summary>
  118. /// <param name="statement">执行的Sql语句</param>
  119. /// <param name="queryCommonParams">通用查询参数</param>
  120. /// <param name="successAction">成功</param>wfyf
  121. /// <param name="errorAction"></param>
  122. void QueryCloseOrders(string statement, List<QueryCommonParam> queryCommonParams,
  123. Action<List<CloseOrder>> successAction, Action<ErrorEntity> errorAction);
  124. /// <summary>
  125. /// 按市场类型查询平仓单
  126. /// </summary>
  127. /// <param name="marketType">市场类型</param>
  128. /// <param name="queryCommonParams">查询参数</param>
  129. /// <param name="successAction">成功回应</param>
  130. /// <param name="errorAction">错误回应</param>
  131. void QueryMarketCloseOrders(eTradeMode marketType, List<QueryCommonParam> queryCommonParams,
  132. Action<eTradeMode,List<CloseOrder>> successAction, Action<ErrorEntity> errorAction);
  133. /// <summary>
  134. /// 按市场类型查询建仓单
  135. /// </summary>
  136. /// <param name="marketType">市场类型</param>
  137. /// <param name="queryCommonParams">查询参数</param>
  138. /// <param name="successAction">成功回应</param>
  139. /// <param name="errorAction">错误回应</param>
  140. void QueryMarketOpenOrders(eTradeMode marketType, List<QueryCommonParam> queryCommonParams,
  141. Action<eTradeMode,List<CompleteOrder>> successAction, Action<ErrorEntity> errorAction);
  142. /// <summary>
  143. /// 按市场类型查询预埋单
  144. /// </summary>
  145. /// <param name="marketType">市场类型</param>
  146. /// <param name="queryCommonParams">查询参数</param>
  147. /// <param name="successAction">成功回应</param>
  148. /// <param name="errorAction">错误回应</param>
  149. void QueryPrePostOrders(eTradeMode marketType, List<QueryCommonParam> queryCommonParams,
  150. Action<eTradeMode, List<PrePostDetail>> successAction, Action<ErrorEntity> errorAction);
  151. /// <summary>
  152. /// 按市场类型查询委托单
  153. /// </summary>
  154. /// <param name="marketType">市场类型</param>
  155. /// <param name="queryCommonParams">查询参数</param>
  156. /// <param name="successAction">成功回应</param>
  157. /// <param name="errorAction">错误回应</param>
  158. void QueryMarketOrderDetails(eTradeMode marketType, List<QueryCommonParam> queryCommonParams,
  159. Action<eTradeMode,List<OrderDetail>> successAction, Action<ErrorEntity> errorAction);
  160. /// <summary>
  161. /// 查询 单据数量
  162. /// </summary>
  163. /// <param name="queryCommonParams"></param>
  164. /// <param name="successAction"></param>
  165. /// <param name="errorAction"></param>
  166. void QueryMarketOrderCount(string searchId, List<QueryCommonParam> queryCommonParams,
  167. Action<List<MarketOrderCount>> successAction, Action<ErrorEntity> errorAction);
  168. /// <summary>
  169. /// 查询会员风控信息
  170. /// </summary>
  171. /// <param name="successAction"></param>
  172. /// <param name="errorAction"></param>
  173. void QueryMemberMonitor(uint accountId, Action<List<MemberAccountInfo>> successAction, Action<ErrorEntity> errorAction);
  174. /// <summary>
  175. /// 查询账号资金流水
  176. /// </summary>
  177. /// <param name="isHistory"></param>
  178. /// <param name="queryCommonParams"></param>
  179. /// <param name="successAction"></param>
  180. /// <param name="errorAction"></param>
  181. void QueryTaAmountLog(bool isHistory,List<QueryCommonParam> queryCommonParams, Action<List<AccountAmountLog>> successAction, Action<ErrorEntity> errorAction);
  182. /// <summary>
  183. /// 查询协议平仓
  184. /// </summary>
  185. /// <param name="accountId">账号id</param>
  186. /// <param name="successAction"></param>
  187. /// <param name="errorAction"></param>
  188. void QueryDealCloseSetting(ulong accountId, Action<List<DealCloseModel>> successAction,
  189. Action<ErrorEntity> errorAction);
  190. /// <summary>
  191. /// 协议平仓确认
  192. /// </summary>
  193. /// <param name="dealClose">协议平仓</param>
  194. /// <param name="successAction"></param>
  195. /// <param name="errorAction"></param>
  196. void DealCloseComfirm(DealCloseOrder dealClose, Action<DealCloseOrder> successAction,
  197. Action<ErrorEntity> errorAction);
  198. /// <summary>
  199. /// 查询市场状态
  200. /// </summary>
  201. /// <param name="queryCommonParams"></param>
  202. /// <param name="successAction"></param>
  203. /// <param name="errorAction"></param>
  204. void QueryMarketTypeStatus(Action<List<MarketTypeProperty>> successAction, Action<ErrorEntity> errorAction);
  205. /// <summary>
  206. /// 查询账号所属的运营中心
  207. /// </summary>
  208. /// <param name="queryCommonParams"></param>
  209. /// <param name="successAction"></param>
  210. /// <param name="errorAction"></param>
  211. void QueryAccountArea(uint AreaId, Action<List<AreaModel>> successAction, Action<ErrorEntity> errorAction);
  212. /// <summary>
  213. /// 查询历史单据
  214. /// </summary>
  215. /// <param name="accountId">账号id</param>
  216. /// <param name="history">单据类型</param>
  217. /// <param name="successAction"></param>
  218. /// <param name="errorAction"></param>
  219. void QueryHistoryOrderBase(ulong accountId, HistoryOrder history, DateTime strarTime, DateTime endTime, Action<List<OrderBase>> successAction, Action<ErrorEntity> errorAction);
  220. /// <summary>
  221. /// 资管下单委托
  222. /// </summary>
  223. /// <param name="entrustOrder">委托内容</param>
  224. /// <param name="successAction">成功回应</param>
  225. /// <param name="errorAction">失败回应</param>
  226. void ChannelEntrustOrder(NewEntrustOrder entrustOrder, Action<OrderDetail> successAction, Action<ErrorEntity> errorAction);
  227. /// <summary>
  228. /// 资管止盈止损下单
  229. /// </summary>
  230. /// <param name="entrustOrder">The entrust order.</param>
  231. /// <param name="successAction">The success action.</param>
  232. /// <param name="errorAction">The error action.</param>
  233. void ChannelSPSLOrder(NewEntrustOrder entrustOrder, Action<OrderDetail> successAction, Action<ErrorEntity> errorAction);
  234. }
  235. }