index.ts 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139
  1. /** ================================= 仓单贸易v2 ================================**/
  2. import { getSelectedAccountId } from "@/services/bus/account";
  3. import { getUsrId } from "@/services/bus/user";
  4. import { commonSearch_go } from "@/services/go";
  5. import {
  6. QueryFaProductDetailReq,
  7. QueryFilterItemReq, QueryOrderQuoteDetailReq,
  8. QueryOrderQuoteReq, QueryPerformancePlanReq,
  9. QueryWrGoodsInfoReq,
  10. QueryWrOrderDetailReq,
  11. QueryWrPositionReq, QueryWrSpecialMatchOrderReq,
  12. QueryWrTradeDetailReq, WrFAProductDetail, WrFilterItem,
  13. WrGoodsInfo, WrHoldLB,
  14. WrOrderDetail,
  15. WrOrderQuote,
  16. WrOrderQuoteDetail, WrPerformancePlan,
  17. WrPosition, WrSpecialMatchOrder,
  18. WrTradeDetail
  19. } from "@/services/go/wrtrade/interface";
  20. /**
  21. * 查询筛选框列表 /WrTrade2/QueryFilterItem
  22. * 页面 - 一口价挂牌 - 上方品类 | 仓库 下拉框数据获取
  23. * @param req
  24. */
  25. export function queryFilterItem(req: QueryFilterItemReq): Promise<WrFilterItem[]> {
  26. return commonSearch_go('/WrTrade2/QueryFilterItem', req).catch((err) => {
  27. throw new Error(`查询筛选框列表: ${err}`);
  28. });
  29. }
  30. /**
  31. * 查询大厅行情列表 /WrTrade2/QueryOrderQuote
  32. * @param req
  33. */
  34. export function queryOrderQuote(req: QueryOrderQuoteReq): Promise<WrOrderQuote[]> {
  35. return commonSearch_go('/WrTrade2/QueryOrderQuote', req).catch((err) => {
  36. throw new Error(`查询大厅行情列表: ${err}`);
  37. });
  38. }
  39. /**
  40. * 查询买卖大厅 /WrTrade2/QueryOrderQuoteDetail
  41. * @param req
  42. */
  43. export function queryOrderQuoteDetail(req: QueryOrderQuoteDetailReq): Promise<WrOrderQuoteDetail[]> {
  44. return commonSearch_go('/WrTrade2/QueryOrderQuoteDetail', req).catch((err) => {
  45. throw new Error(`查询买卖大厅: ${err}`);
  46. });
  47. }
  48. /**
  49. * 查询仓单商品信息 /WrTrade2/QueryWrGoodsInfo
  50. * @param req
  51. */
  52. export function queryWrGoodsInfo(req: QueryWrGoodsInfoReq): Promise<WrGoodsInfo[]> {
  53. return commonSearch_go('/WrTrade2/QueryWrGoodsInfo', req).catch((err) => {
  54. throw new Error(`查询仓单商品信息: ${err}`);
  55. });
  56. }
  57. /**
  58. * 页面 现货仓单 | 预售仓单 -> 挂单
  59. * 仓单头寸
  60. * 查询仓单委托单(挂单) /WrTrade2/QueryWrOrderDetail
  61. * @param req
  62. */
  63. export function queryWrOrderDetail(req: QueryWrOrderDetailReq): Promise<WrOrderDetail[]> {
  64. req.userid = getUsrId();
  65. return commonSearch_go('/WrTrade2/QueryWrOrderDetail', req).catch((err) => {
  66. throw new Error(`查询仓单委托单(挂单): ${err}`);
  67. });
  68. }
  69. /**
  70. * 页面 现货仓单->现货汇总/库存汇总/现货明细 ; 预售仓单->订单汇总
  71. * 查询现货(预售)仓单持仓 /WrTrade2/QueryWrPosition
  72. */
  73. export function queryWrPosition(req: QueryWrPositionReq): Promise<WrPosition[]> {
  74. req.userid = getUsrId();
  75. return commonSearch_go('/WrTrade2/QueryWrPosition', req).catch((err) => {
  76. throw new Error(`查询现货(预售)仓单持仓: ${err}`);
  77. });
  78. }
  79. /**
  80. * 查询指定成交 /WrTrade2/QueryWrSpecialMatchOrder
  81. * 页面 现货仓单 | 预售仓单 -> 指定成交
  82. */
  83. export function queryWrSpecialMatchOrder(req: QueryWrSpecialMatchOrderReq): Promise<WrSpecialMatchOrder[]> {
  84. req.userid = getUsrId();
  85. return commonSearch_go('/WrTrade2/QueryWrSpecialMatchOrder', req).catch((err) => {
  86. throw new Error(`查询指定成交: ${err}`);
  87. });
  88. }
  89. /**
  90. * 查询仓单成交明细 /WrTrade2/QueryWrTradeDetail
  91. */
  92. export function queryWrTradeDetail(req: QueryWrTradeDetailReq): Promise<WrTradeDetail[]> {
  93. return commonSearch_go('/WrTrade2/QueryWrTradeDetail', req).catch((err) => {
  94. throw new Error(`查询仓单成交明细: ${err}`);
  95. });
  96. }
  97. /**
  98. * 查询仓单持有记录 /WrTrade2/QueryHoldLB
  99. * 页面 现货仓单 -> 现货明细
  100. * @param req
  101. */
  102. export function queryHoldLB(): Promise<WrHoldLB[]> {
  103. const accountid = getSelectedAccountId()
  104. return commonSearch_go('/WrTrade2/QueryHoldLB', { accountid }).catch((err) => {
  105. throw new Error(`查询仓单持有记录: ${err}`);
  106. });
  107. }
  108. /**
  109. * 查询履约信息 /WrTrade2/QueryPerformancePlan
  110. */
  111. export function QueryPerformancePlan(req: QueryPerformancePlanReq): Promise<WrPerformancePlan[]> {
  112. req.userid = getUsrId();
  113. return commonSearch_go('/WrTrade2/QueryPerformancePlan', req).catch((err) => {
  114. throw new Error(`查询履约信息: ${err}`);
  115. });
  116. }
  117. /**
  118. * 查询融资产品列表 /WrTrade2/QueryFaProductDetail
  119. */
  120. export function queryFaProductDetail(req: QueryFaProductDetailReq): Promise<WrFAProductDetail[]> {
  121. return commonSearch_go('/WrTrade2/QueryFaProductDetail', req).catch((err) => {
  122. throw new Error(`查询融资产品列表: ${err}`);
  123. });
  124. }