index.ts 9.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270
  1. /** ================================= 仓单贸易v2 ================================**/
  2. /* 更新全部接口 20210803 */
  3. import APP from '@/services';
  4. import { getSelectedAccountId } from "@/services/bus/account";
  5. import { getUsrId } from "@/services/bus/user";
  6. import { commonSearch_go } from "@/services/go";
  7. import {
  8. QueryFaProductDetailReq,
  9. QueryFilterItemReq, QueryHoldLBReq,
  10. QueryOrderQuoteDetailReq,
  11. QueryOrderQuoteReq,
  12. QueryPerformancePlanReq,
  13. QueryWrBuybackDetailReq,
  14. QueryWrFactorTypeInfoReq, QueryWrGoodsInfoReq,
  15. QueryWrMarketTradeConfigReq,
  16. QueryWrOrderDetailReq, QueryWrPerformancePlanStepReq,
  17. QueryWrPositionReq, QueryWrScfContractInterestReq, QueryWrSpecialMatchOrderReq,
  18. QueryWrStandardFactoryItemReq,
  19. QueryWrTradeDetailReq, WrBuybackDetail,
  20. WrFactorTypeInfo,
  21. WrFAProductDetail,
  22. WrFilterItem,
  23. WrFinanceBuyApply,
  24. WrFtDeliveryGoods,
  25. WrGoodsInfo,
  26. WrHoldLB, WrOrderDetail,
  27. WrOrderQuote,
  28. WrOrderQuoteDetail, WrOutInApply,
  29. WrPerformancePlan,
  30. WrPerformancePlanStep,
  31. WrPosition,
  32. WrScfContract, WrScfContractInterest,
  33. WrSpecialMatchOrder,
  34. WrStandardFactoryItemEx,
  35. WrTradeDetail
  36. } from "@/services/go/wrtrade/interface";
  37. /**
  38. * 查询融资产品列表 /WrTrade2/QueryFaProductDetail
  39. */
  40. export function queryFaProductDetail(req: QueryFaProductDetailReq): Promise<WrFAProductDetail[]> {
  41. return commonSearch_go('/WrTrade2/QueryFaProductDetail', req).catch((err) => {
  42. throw new Error(`查询融资产品列表: ${err}`);
  43. });
  44. }
  45. /**
  46. * 查询筛选框列表 /WrTrade2/QueryFilterItem
  47. * 页面 - 一口价挂牌 - 上方品类 | 仓库 下拉框数据获取
  48. * @param req
  49. */
  50. export function queryFilterItem(req: QueryFilterItemReq): Promise<WrFilterItem[]> {
  51. return commonSearch_go('/WrTrade2/QueryFilterItem', req).catch((err) => {
  52. throw new Error(`查询筛选框列表: ${err}`);
  53. });
  54. }
  55. /**
  56. * 查询品种品类筛选框列表 /WrTrade2/QueryFtDeliveryGoods
  57. * @param req
  58. */
  59. export function queryFtDeliveryGoods(): Promise<WrFtDeliveryGoods[]> {
  60. return commonSearch_go('/WrTrade2/QueryFtDeliveryGoods', {}).catch((err) => {
  61. throw new Error(`查询品种品类筛选框列表: ${err}`);
  62. });
  63. }
  64. /**
  65. * 查询仓单持有记录 /WrTrade2/QueryHoldLB
  66. * 页面 现货仓单 -> 现货明细
  67. * @param req
  68. */
  69. export function queryHoldLB(): Promise<WrHoldLB[]> {
  70. const accountid = getSelectedAccountId()
  71. return commonSearch_go('/WrTrade2/QueryHoldLB', { accountid }).catch((err) => {
  72. throw new Error(`查询仓单持有记录: ${err}`);
  73. });
  74. }
  75. /**
  76. * 页面 现货仓单->现货明细? , 表名叫仓单持有记录, 有挂单特有维度,为防误解汇总也有相关维度, 新写接口,不跟汇总合在一起了。
  77. * 查询仓单持有记录 /WrTrade2/QueryHoldLB
  78. * 页面 现货仓单 -> 现货明细
  79. * @param req
  80. */
  81. export function queryHoldLBFilter(req: QueryHoldLBReq): Promise<WrHoldLB[]> {
  82. const accountid = getSelectedAccountId()
  83. return commonSearch_go('/WrTrade2/QueryHoldLB', req).catch((err) => {
  84. throw new Error(`查询仓单持有记录: ${err}`);
  85. });
  86. }
  87. /**
  88. * 查询大厅行情列表 /WrTrade2/QueryOrderQuote
  89. * @param req
  90. */
  91. export function queryOrderQuote(req: QueryOrderQuoteReq): Promise<WrOrderQuote[]> {
  92. return commonSearch_go('/WrTrade2/QueryOrderQuote', req).catch((err) => {
  93. throw new Error(`查询大厅行情列表: ${err}`);
  94. });
  95. }
  96. /**
  97. * 查询买卖大厅 /WrTrade2/QueryOrderQuoteDetail
  98. * @param req
  99. */
  100. export function queryOrderQuoteDetail(req: QueryOrderQuoteDetailReq): Promise<WrOrderQuoteDetail[]> {
  101. return commonSearch_go('/WrTrade2/QueryOrderQuoteDetail', req).catch((err) => {
  102. throw new Error(`查询买卖大厅: ${err}`);
  103. });
  104. }
  105. /**
  106. * 查询履约信息 /WrTrade2/QueryPerformancePlan
  107. */
  108. export function QueryPerformancePlan(req: QueryPerformancePlanReq): Promise<WrPerformancePlan[]> {
  109. req.userid = getUsrId();
  110. return commonSearch_go('/WrTrade2/QueryPerformancePlan', req).catch((err) => {
  111. throw new Error(`查询履约信息: ${err}`);
  112. });
  113. }
  114. /**
  115. * 查询仓单要素详细信息 /WrTrade2/QueryWrFactorTypeInfo
  116. * @param req
  117. * @constructor
  118. */
  119. export function queryWrFactorTypeInfo(req: QueryWrFactorTypeInfoReq): Promise<WrFactorTypeInfo[]> {
  120. return commonSearch_go('/WrTrade2/QueryWrFactorTypeInfo', req).catch((err) => {
  121. throw new Error(`查询仓单要素详细信息: ${err}`);
  122. });
  123. }
  124. /**
  125. * 查询仓单商品信息 /WrTrade2/QueryWrGoodsInfo
  126. * @param req
  127. */
  128. export function queryWrGoodsInfo(req: QueryWrGoodsInfoReq): Promise<WrGoodsInfo[]> {
  129. return commonSearch_go('/WrTrade2/QueryWrGoodsInfo', req).catch((err) => {
  130. throw new Error(`查询仓单商品信息: ${err}`);
  131. });
  132. }
  133. /**
  134. * 查询市场交易参数配置 /WrTrade2/QueryWrMarketTradeConfig
  135. * @param req
  136. */
  137. export function queryWrMarketTradeConfig(req: QueryWrMarketTradeConfigReq): Promise<string> {
  138. return commonSearch_go('/WrTrade2/QueryWrMarketTradeConfig', req).then(res => {
  139. APP.set('rules', res)
  140. return 'ok'
  141. }).catch((err) => {
  142. throw new Error(`查询市场交易参数配置: ${err}`);
  143. });
  144. }
  145. /**
  146. * 页面 现货仓单 | 预售仓单 -> 挂单
  147. * 仓单头寸
  148. * 查询仓单委托单(挂单) /WrTrade2/QueryWrOrderDetail
  149. * @param req
  150. */
  151. export function queryWrOrderDetail(req: QueryWrOrderDetailReq): Promise<WrOrderDetail[]> {
  152. req.userid = getUsrId();
  153. return commonSearch_go('/WrTrade2/QueryWrOrderDetail', req).catch((err) => {
  154. throw new Error(`查询仓单委托单(挂单): ${err}`);
  155. });
  156. }
  157. /**
  158. * 页面 现货仓单->现货汇总/库存汇总/现货明细 ; 预售仓单->订单汇总
  159. * 查询现货(预售)仓单持仓 /WrTrade2/QueryWrPosition
  160. */
  161. export function queryWrPosition(req: QueryWrPositionReq): Promise<WrPosition[]> {
  162. req.userid = getUsrId();
  163. return commonSearch_go('/WrTrade2/QueryWrPosition', req).catch((err) => {
  164. throw new Error(`查询现货(预售)仓单持仓: ${err}`);
  165. });
  166. }
  167. /**
  168. * 查询指定成交 /WrTrade2/QueryWrSpecialMatchOrder
  169. * 页面 现货仓单 | 预售仓单 -> 指定成交
  170. */
  171. export function queryWrSpecialMatchOrder(req: QueryWrSpecialMatchOrderReq): Promise<WrSpecialMatchOrder[]> {
  172. req.userid = getUsrId();
  173. return commonSearch_go('/WrTrade2/QueryWrSpecialMatchOrder', req).catch((err) => {
  174. throw new Error(`查询指定成交: ${err}`);
  175. });
  176. }
  177. /**
  178. * 查询品类要素定义项 /WrTrade2/QueryWrStandardFactoryItem
  179. * @param req
  180. */
  181. export function queryWrStandardFactoryItem(req: QueryWrStandardFactoryItemReq): Promise<WrStandardFactoryItemEx[]> {
  182. return commonSearch_go('/WrTrade2/QueryWrStandardFactoryItem', req).catch((err) => {
  183. throw new Error(`查询品类要素定义项: ${err}`);
  184. });
  185. }
  186. /**
  187. * 查询仓单成交明细 /WrTrade2/QueryWrTradeDetail
  188. */
  189. export function queryWrTradeDetail(req: QueryWrTradeDetailReq): Promise<WrTradeDetail[]> {
  190. req.userid = getUsrId();
  191. return commonSearch_go('/WrTrade2/QueryWrTradeDetail', req).catch((err) => {
  192. throw new Error(`查询仓单成交明细: ${err}`);
  193. });
  194. }
  195. /**
  196. * 查询履约信息详情 /WrTrade2/QueryWrPerformancePlanStep
  197. */
  198. export function queryWrPerformancePlanStep(req: QueryWrPerformancePlanStepReq): Promise<WrPerformancePlanStep[]> {
  199. return commonSearch_go('/WrTrade2/QueryWrPerformancePlanStep', req).catch((err) => {
  200. throw new Error(`查询履约信息详情: ${err}`);
  201. });
  202. }
  203. /**
  204. * 查询仓单贸易融资合同 /WrTrade2/QueryWrScfContract 融资管理 - 合同
  205. */
  206. export function queryWrScfContract(scfcontractid?: number): Promise<WrScfContract[]> {
  207. const userid = getUsrId()
  208. const param = scfcontractid ? { scfcontractid, userid } : { userid }
  209. return commonSearch_go('/WrTrade2/QueryWrScfContract', param).catch((err) => {
  210. throw new Error(`查询仓单贸易融资合同: ${err}`);
  211. });
  212. }
  213. /**
  214. * 查询融资购买申请 /WrTrade2/QueryWrFinanceBuyApply 融资管理 - 申请单
  215. */
  216. export function queryWrFinanceBuyApply(): Promise<WrFinanceBuyApply[]> {
  217. const userid = getUsrId()
  218. return commonSearch_go('/WrTrade2/QueryWrFinanceBuyApply', { userid }).catch((err) => {
  219. throw new Error(`查询融资购买申请: ${err}`);
  220. });
  221. }
  222. /**
  223. * 查询仓单回购明细 /WrTrade2/QueryWrBuybackDetail
  224. */
  225. export function queryWrBuybackDetail(req: QueryWrBuybackDetailReq): Promise<WrBuybackDetail[]> {
  226. return commonSearch_go('/WrTrade2/QueryWrBuybackDetail', req).catch((err) => {
  227. throw new Error(`查询仓单回购明细: ${err}`);
  228. });
  229. }
  230. /**
  231. *查询融资合同费用明细 /WrTrade2/QueryWrScfContractInterest
  232. */
  233. export function queryWrScfContractInterest(req: QueryWrScfContractInterestReq): Promise<WrScfContractInterest[]> {
  234. return commonSearch_go('/WrTrade2/QueryWrScfContractInterest', req).catch((err) => {
  235. throw new Error(`查询融资合同费用明细: ${err}`);
  236. });
  237. }
  238. /**
  239. * 查询提货申请 /WrTrade2/QueryWrOutInApply
  240. */
  241. export function queryWrOutInApply(): Promise<WrOutInApply[]> {
  242. const userid = getUsrId()
  243. return commonSearch_go('/WrTrade2/QueryWrOutInApply', { userid }).catch((err) => {
  244. throw new Error(`查询提货申请: ${err}`);
  245. });
  246. }