index.ts 6.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201
  1. /** ================================= 仓单贸易v2 ================================**/
  2. /* 更新全部接口 20210803 */
  3. import { getSelectedAccountId } from "@/services/bus/account";
  4. import { getUsrId } from "@/services/bus/user";
  5. import { commonSearch_go } from "@/services/go";
  6. import {
  7. QueryFaProductDetailReq,
  8. QueryFilterItemReq, QueryFtDeliveryGoodsReq, QueryHoldLBReq, QueryOrderQuoteDetailReq,
  9. QueryOrderQuoteReq, QueryPerformancePlanReq, QueryWrFactorTypeInfoReq,
  10. QueryWrGoodsInfoReq, QueryWrMarketTradeConfigReq,
  11. QueryWrOrderDetailReq,
  12. QueryWrPositionReq, QueryWrSpecialMatchOrderReq, QueryWrStandardFactoryItemReq,
  13. QueryWrTradeDetailReq, WrFactorTypeInfo, WrFAProductDetail, WrFilterItem, WrFtDeliveryGoods,
  14. WrGoodsInfo, WrHoldLB, WrMarketTradeConfig,
  15. WrOrderDetail,
  16. WrOrderQuote,
  17. WrOrderQuoteDetail, WrPerformancePlan,
  18. WrPosition, WrSpecialMatchOrder, WrStandardFactoryItemEx,
  19. WrTradeDetail
  20. } from "@/services/go/wrtrade/interface";
  21. /**
  22. * 查询融资产品列表 /WrTrade2/QueryFaProductDetail
  23. */
  24. export function queryFaProductDetail(req: QueryFaProductDetailReq): Promise<WrFAProductDetail[]> {
  25. return commonSearch_go('/WrTrade2/QueryFaProductDetail', req).catch((err) => {
  26. throw new Error(`查询融资产品列表: ${err}`);
  27. });
  28. }
  29. /**
  30. * 查询筛选框列表 /WrTrade2/QueryFilterItem
  31. * 页面 - 一口价挂牌 - 上方品类 | 仓库 下拉框数据获取
  32. * @param req
  33. */
  34. export function queryFilterItem(req: QueryFilterItemReq): Promise<WrFilterItem[]> {
  35. return commonSearch_go('/WrTrade2/QueryFilterItem', req).catch((err) => {
  36. throw new Error(`查询筛选框列表: ${err}`);
  37. });
  38. }
  39. /**
  40. * 查询品种品类筛选框列表 /WrTrade2/QueryFtDeliveryGoods
  41. * @param req
  42. */
  43. export function queryFtDeliveryGoods(req: QueryFtDeliveryGoodsReq): Promise<WrFtDeliveryGoods> {
  44. return commonSearch_go('/WrTrade2/QueryFtDeliveryGoods', req).catch((err) => {
  45. throw new Error(`查询品种品类筛选框列表: ${err}`);
  46. });
  47. }
  48. /**
  49. * 查询仓单持有记录 /WrTrade2/QueryHoldLB
  50. * 页面 现货仓单 -> 现货明细
  51. * @param req
  52. */
  53. export function queryHoldLB(): Promise<WrHoldLB[]> {
  54. const accountid = getSelectedAccountId()
  55. return commonSearch_go('/WrTrade2/QueryHoldLB', { accountid }).catch((err) => {
  56. throw new Error(`查询仓单持有记录: ${err}`);
  57. });
  58. }
  59. /**
  60. * 页面 现货仓单->现货明细? , 表名叫仓单持有记录, 有挂单特有维度,为防误解汇总也有相关维度, 新写接口,不跟汇总合在一起了。
  61. * 查询仓单持有记录 /WrTrade2/QueryHoldLB
  62. * 页面 现货仓单 -> 现货明细
  63. * @param req
  64. */
  65. export function queryHoldLBFilter(req: QueryHoldLBReq): Promise<WrHoldLB[]> {
  66. const accountid = getSelectedAccountId()
  67. return commonSearch_go('/WrTrade2/QueryHoldLB', req).catch((err) => {
  68. throw new Error(`查询仓单持有记录: ${err}`);
  69. });
  70. }
  71. /**
  72. * 查询大厅行情列表 /WrTrade2/QueryOrderQuote
  73. * @param req
  74. */
  75. export function queryOrderQuote(req: QueryOrderQuoteReq): Promise<WrOrderQuote[]> {
  76. return commonSearch_go('/WrTrade2/QueryOrderQuote', req).catch((err) => {
  77. throw new Error(`查询大厅行情列表: ${err}`);
  78. });
  79. }
  80. /**
  81. * 查询买卖大厅 /WrTrade2/QueryOrderQuoteDetail
  82. * @param req
  83. */
  84. export function queryOrderQuoteDetail(req: QueryOrderQuoteDetailReq): Promise<WrOrderQuoteDetail[]> {
  85. return commonSearch_go('/WrTrade2/QueryOrderQuoteDetail', req).catch((err) => {
  86. throw new Error(`查询买卖大厅: ${err}`);
  87. });
  88. }
  89. /**
  90. * 查询履约信息 /WrTrade2/QueryPerformancePlan
  91. */
  92. export function QueryPerformancePlan(req: QueryPerformancePlanReq): Promise<WrPerformancePlan[]> {
  93. req.userid = getUsrId();
  94. return commonSearch_go('/WrTrade2/QueryPerformancePlan', req).catch((err) => {
  95. throw new Error(`查询履约信息: ${err}`);
  96. });
  97. }
  98. /**
  99. * 查询仓单要素详细信息 /WrTrade2/QueryWrFactorTypeInfo
  100. * @param req
  101. * @constructor
  102. */
  103. export function queryWrFactorTypeInfo(req: QueryWrFactorTypeInfoReq): Promise<WrFactorTypeInfo[]> {
  104. return commonSearch_go('/WrTrade2/QueryWrFactorTypeInfo', req).catch((err) => {
  105. throw new Error(`查询仓单要素详细信息: ${err}`);
  106. });
  107. }
  108. /**
  109. * 查询仓单商品信息 /WrTrade2/QueryWrGoodsInfo
  110. * @param req
  111. */
  112. export function queryWrGoodsInfo(req: QueryWrGoodsInfoReq): Promise<WrGoodsInfo[]> {
  113. return commonSearch_go('/WrTrade2/QueryWrGoodsInfo', req).catch((err) => {
  114. throw new Error(`查询仓单商品信息: ${err}`);
  115. });
  116. }
  117. /**
  118. * 查询市场交易参数配置 /WrTrade2/QueryWrMarketTradeConfig
  119. * @param req
  120. */
  121. export function queryWrMarketTradeConfig(req: QueryWrMarketTradeConfigReq): Promise<WrMarketTradeConfig[]> {
  122. return commonSearch_go('/WrTrade2/QueryWrMarketTradeConfig', req).catch((err) => {
  123. throw new Error(`查询市场交易参数配置: ${err}`);
  124. });
  125. }
  126. /**
  127. * 页面 现货仓单 | 预售仓单 -> 挂单
  128. * 仓单头寸
  129. * 查询仓单委托单(挂单) /WrTrade2/QueryWrOrderDetail
  130. * @param req
  131. */
  132. export function queryWrOrderDetail(req: QueryWrOrderDetailReq): Promise<WrOrderDetail[]> {
  133. req.userid = getUsrId();
  134. return commonSearch_go('/WrTrade2/QueryWrOrderDetail', req).catch((err) => {
  135. throw new Error(`查询仓单委托单(挂单): ${err}`);
  136. });
  137. }
  138. /**
  139. * 页面 现货仓单->现货汇总/库存汇总/现货明细 ; 预售仓单->订单汇总
  140. * 查询现货(预售)仓单持仓 /WrTrade2/QueryWrPosition
  141. */
  142. export function queryWrPosition(req: QueryWrPositionReq): Promise<WrPosition[]> {
  143. req.userid = getUsrId();
  144. return commonSearch_go('/WrTrade2/QueryWrPosition', req).catch((err) => {
  145. throw new Error(`查询现货(预售)仓单持仓: ${err}`);
  146. });
  147. }
  148. /**
  149. * 查询指定成交 /WrTrade2/QueryWrSpecialMatchOrder
  150. * 页面 现货仓单 | 预售仓单 -> 指定成交
  151. */
  152. export function queryWrSpecialMatchOrder(req: QueryWrSpecialMatchOrderReq): Promise<WrSpecialMatchOrder[]> {
  153. req.userid = getUsrId();
  154. return commonSearch_go('/WrTrade2/QueryWrSpecialMatchOrder', req).catch((err) => {
  155. throw new Error(`查询指定成交: ${err}`);
  156. });
  157. }
  158. /**
  159. * 查询品类要素定义项 /WrTrade2/QueryWrStandardFactoryItem
  160. * @param req
  161. */
  162. export function queryWrStandardFactoryItem(req: QueryWrStandardFactoryItemReq): Promise<WrStandardFactoryItemEx[]> {
  163. return commonSearch_go('/WrTrade2/QueryWrStandardFactoryItem', req).catch((err) => {
  164. throw new Error(`查询品类要素定义项: ${err}`);
  165. });
  166. }
  167. /**
  168. * 查询仓单成交明细 /WrTrade2/QueryWrTradeDetail
  169. */
  170. export function queryWrTradeDetail(req: QueryWrTradeDetailReq): Promise<WrTradeDetail[]> {
  171. req.userid = getUsrId();
  172. return commonSearch_go('/WrTrade2/QueryWrTradeDetail', req).catch((err) => {
  173. throw new Error(`查询仓单成交明细: ${err}`);
  174. });
  175. }