index.ts 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387
  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,
  10. QueryHoldLBReq,
  11. QueryOrderQuoteDetailReq,
  12. QueryOrderQuoteMyqQsp, QueryOrderQuoteMyqReq,
  13. QueryOrderQuoteReq,
  14. QueryPerformancePlanReq,
  15. QueryPermancePlanTmpReq,
  16. QueryPermancePlanTmpRsp,
  17. QueryWrBuybackDetailReq,
  18. QueryWrDeliveryAvalidHoldLBReq,
  19. QueryWrFactorTypeInfoReq,
  20. QueryWrFriendApplyRsp,
  21. QueryWrGoodsInfoReq,
  22. QueryWrMarketTradeConfigReq,
  23. QueryWrOrderDetailReq,
  24. QueryWrPerformancePlanStepReq,
  25. QueryWrPositionReq,
  26. QueryWrScfContractInterestReq,
  27. QueryWrSpecialMatchOrderReq,
  28. QueryWrStandardFactoryItemReq,
  29. QueryWrTradeBargainApplyQsp,
  30. QueryWrTradeBargainApplyReq,
  31. QueryWrTradeDetailReq,
  32. WrAverageTradePriceQsp,
  33. WrAverageTradePriceQsq,
  34. WrBsGoodsInfo,
  35. WrBuybackDetail,
  36. WrDeliveryAvalidHoldLB,
  37. WrDeliveryDetail,
  38. WrFactorTypeInfo,
  39. WrFAProductDetail,
  40. WrFilterItem,
  41. WrFinanceBuyApply,
  42. WrFtDeliveryGoods,
  43. WrGoodsInfo,
  44. WrHoldLB,
  45. WrOrderDetail,
  46. WrOrderQuote,
  47. WrOrderQuoteDetail,
  48. WrOutInApply,
  49. WrPerformancePlan,
  50. WrPerformancePlanStep,
  51. WrPosition,
  52. WrScfContract,
  53. WrScfContractInterest,
  54. WrSpecialMatchOrder,
  55. WrStandardFactoryItemEx,
  56. WrTradeDetail,
  57. WrTradeOrderDetailReq,
  58. WrTradeOrderDetailRsp
  59. } from "@/services/go/wrtrade/interface";
  60. /**
  61. * 查询融资产品列表 /WrTrade2/QueryFaProductDetail
  62. */
  63. export function queryFaProductDetail(req: QueryFaProductDetailReq): Promise<WrFAProductDetail[]> {
  64. return commonSearch_go('/WrTrade2/QueryFaProductDetail', req).catch((err) => {
  65. throw new Error(`查询融资产品列表: ${err}`);
  66. });
  67. }
  68. /**
  69. * 查询筛选框列表 /WrTrade2/QueryFilterItem
  70. * 页面 - 一口价挂牌 - 上方品类 | 仓库 下拉框数据获取
  71. * @param req
  72. */
  73. export function queryFilterItem(req: QueryFilterItemReq): Promise<WrFilterItem[]> {
  74. return commonSearch_go('/WrTrade2/QueryFilterItem', req).catch((err) => {
  75. throw new Error(`查询筛选框列表: ${err}`);
  76. });
  77. }
  78. /**
  79. * 查询品种品类筛选框列表 /WrTrade2/QueryFtDeliveryGoods
  80. * @param req
  81. */
  82. export function queryFtDeliveryGoods(): Promise<WrFtDeliveryGoods[]> {
  83. return commonSearch_go('/WrTrade2/QueryFtDeliveryGoods', {}).catch((err) => {
  84. throw new Error(`查询品种品类筛选框列表: ${err}`);
  85. });
  86. }
  87. /**
  88. * 查询仓单持有记录 /WrTrade2/QueryHoldLB
  89. * 页面 现货仓单 -> 现货明细
  90. * @param req
  91. */
  92. export function queryHoldLB(): Promise<WrHoldLB[]> {
  93. const accountid = getSelectedAccountId()
  94. return commonSearch_go('/WrTrade2/QueryHoldLB', { accountid }).catch((err) => {
  95. throw new Error(`查询仓单持有记录: ${err}`);
  96. });
  97. }
  98. /**
  99. * 页面 现货仓单->现货明细? , 表名叫仓单持有记录, 有挂单特有维度,为防误解汇总也有相关维度, 新写接口,不跟汇总合在一起了。
  100. * 查询仓单持有记录 /WrTrade2/QueryHoldLB
  101. * 页面 现货仓单 -> 现货明细
  102. * @param req
  103. */
  104. export function queryHoldLBFilter(req: QueryHoldLBReq): Promise<WrHoldLB[]> {
  105. const accountid = getSelectedAccountId()
  106. return commonSearch_go('/WrTrade2/QueryHoldLB', req).catch((err) => {
  107. throw new Error(`查询仓单持有记录: ${err}`);
  108. });
  109. }
  110. /**
  111. * 查询大厅行情列表 /WrTrade2/QueryOrderQuote
  112. * @param req
  113. */
  114. export function queryOrderQuote(req: QueryOrderQuoteReq): Promise<WrOrderQuote[]> {
  115. return commonSearch_go('/WrTrade2/QueryOrderQuote', req).catch((err) => {
  116. throw new Error(`查询大厅行情列表: ${err}`);
  117. });
  118. }
  119. /**
  120. * 查询买卖大厅 /WrTrade2/QueryOrderQuoteDetail
  121. * @param req
  122. */
  123. export function queryOrderQuoteDetail(req: QueryOrderQuoteDetailReq): Promise<WrOrderQuoteDetail[]> {
  124. return commonSearch_go('/WrTrade2/QueryOrderQuoteDetail', req).catch((err) => {
  125. throw new Error(`查询买卖大厅: ${err}`);
  126. });
  127. }
  128. /**
  129. * 查询履约信息 /WrTrade2/QueryPerformancePlan
  130. */
  131. export function QueryPerformancePlan(req: QueryPerformancePlanReq): Promise<WrPerformancePlan[]> {
  132. req.userid = getUsrId();
  133. return commonSearch_go('/WrTrade2/QueryPerformancePlan', req).catch((err) => {
  134. throw new Error(`查询履约信息: ${err}`);
  135. });
  136. }
  137. /**
  138. * 查询仓单要素详细信息 /WrTrade2/QueryWrFactorTypeInfo
  139. * @param req
  140. * @constructor
  141. */
  142. export function queryWrFactorTypeInfo(req: QueryWrFactorTypeInfoReq): Promise<WrFactorTypeInfo[]> {
  143. return commonSearch_go('/WrTrade2/QueryWrFactorTypeInfo', req).catch((err) => {
  144. throw new Error(`查询仓单要素详细信息: ${err}`);
  145. });
  146. }
  147. /**
  148. * 查询仓单商品信息 /WrTrade2/QueryWrGoodsInfo
  149. * @param req
  150. */
  151. export function queryWrGoodsInfo(req: QueryWrGoodsInfoReq): Promise<WrGoodsInfo[]> {
  152. return commonSearch_go('/WrTrade2/QueryWrGoodsInfo', req).catch((err) => {
  153. throw new Error(`查询仓单商品信息: ${err}`);
  154. });
  155. }
  156. /**
  157. * 查询合约交易买卖大厅详情 /WrTrade2/QueryWrBsGoodsInfo
  158. * @param req
  159. */
  160. export function queryWrBsGoodsInfo(goodsid: number): Promise<WrBsGoodsInfo[]> {
  161. return commonSearch_go('/WrTrade2/QueryWrBsGoodsInfo', { goodsid }).catch((err) => {
  162. throw new Error(`查询合约交易买卖大厅详情: ${err}`);
  163. });
  164. }
  165. /**
  166. * 查询市场交易参数配置 /WrTrade2/QueryWrMarketTradeConfig
  167. * @param req
  168. */
  169. export function queryWrMarketTradeConfig(req: QueryWrMarketTradeConfigReq): Promise<string> {
  170. return commonSearch_go('/WrTrade2/QueryWrMarketTradeConfig', req).then(res => {
  171. APP.set('rules', res)
  172. return 'ok'
  173. }).catch((err) => {
  174. throw new Error(`查询市场交易参数配置: ${err}`);
  175. });
  176. }
  177. /**
  178. * 页面 现货仓单 | 预售仓单 -> 挂单
  179. * 仓单头寸
  180. * 查询仓单委托单(挂单) /WrTrade2/QueryWrOrderDetail
  181. * @param req
  182. */
  183. export function queryWrOrderDetail(req: QueryWrOrderDetailReq): Promise<WrOrderDetail[]> {
  184. req.userid = getUsrId();
  185. return commonSearch_go('/WrTrade2/QueryWrOrderDetail', req).catch((err) => {
  186. throw new Error(`查询仓单委托单(挂单): ${err}`);
  187. });
  188. }
  189. /**
  190. * 页面 现货仓单->现货汇总/库存汇总/现货明细 ; 预售仓单->订单汇总
  191. * 查询现货(预售)仓单持仓 /WrTrade2/QueryWrPosition
  192. */
  193. export function queryWrPosition(req: QueryWrPositionReq): Promise<WrPosition[]> {
  194. req.userid = getUsrId();
  195. return commonSearch_go('/WrTrade2/QueryWrPosition', req).catch((err) => {
  196. throw new Error(`查询现货(预售)仓单持仓: ${err}`);
  197. });
  198. }
  199. /**
  200. * 查询指定成交 /WrTrade2/QueryWrSpecialMatchOrder
  201. * 页面 现货仓单 | 预售仓单 -> 指定成交
  202. */
  203. export function queryWrSpecialMatchOrder(req: QueryWrSpecialMatchOrderReq): Promise<WrSpecialMatchOrder[]> {
  204. req.userid = getUsrId();
  205. return commonSearch_go('/WrTrade2/QueryWrSpecialMatchOrder', req).catch((err) => {
  206. throw new Error(`查询指定成交: ${err}`);
  207. });
  208. }
  209. /**
  210. * 查询品类要素定义项 /WrTrade2/QueryWrStandardFactoryItem
  211. * @param req
  212. */
  213. export function queryWrStandardFactoryItem(req: QueryWrStandardFactoryItemReq): Promise<WrStandardFactoryItemEx[]> {
  214. return commonSearch_go('/WrTrade2/QueryWrStandardFactoryItem', req).catch((err) => {
  215. throw new Error(`查询品类要素定义项: ${err}`);
  216. });
  217. }
  218. /**
  219. * 查询仓单成交明细 /WrTrade2/QueryWrTradeDetail
  220. */
  221. export function queryWrTradeDetail(req: QueryWrTradeDetailReq): Promise<WrTradeDetail[]> {
  222. req.userid = getUsrId();
  223. return commonSearch_go('/WrTrade2/QueryWrTradeDetail', req).catch((err) => {
  224. throw new Error(`查询仓单成交明细: ${err}`);
  225. });
  226. }
  227. /**
  228. * 查询履约信息详情 /WrTrade2/QueryWrPerformancePlanStep
  229. */
  230. export function queryWrPerformancePlanStep(req: QueryWrPerformancePlanStepReq): Promise<WrPerformancePlanStep[]> {
  231. return commonSearch_go('/WrTrade2/QueryWrPerformancePlanStep', req).catch((err) => {
  232. throw new Error(`查询履约信息详情: ${err}`);
  233. });
  234. }
  235. /**
  236. * 查询仓单贸易融资合同 /WrTrade2/QueryWrScfContract 融资管理 - 合同
  237. */
  238. export function queryWrScfContract(scfcontractid?: number): Promise<WrScfContract[]> {
  239. const userid = getUsrId()
  240. const param = scfcontractid ? { scfcontractid, userid } : { userid }
  241. return commonSearch_go('/WrTrade2/QueryWrScfContract', param).catch((err) => {
  242. throw new Error(`查询仓单贸易融资合同: ${err}`);
  243. });
  244. }
  245. /**
  246. * 查询融资购买申请 /WrTrade2/QueryWrFinanceBuyApply 融资管理 - 申请单
  247. */
  248. export function queryWrFinanceBuyApply(): Promise<WrFinanceBuyApply[]> {
  249. const userid = getUsrId()
  250. return commonSearch_go('/WrTrade2/QueryWrFinanceBuyApply', { userid }).catch((err) => {
  251. throw new Error(`查询融资购买申请: ${err}`);
  252. });
  253. }
  254. /**
  255. * 查询仓单回购明细 /WrTrade2/QueryWrBuybackDetail
  256. */
  257. export function queryWrBuybackDetail(req: QueryWrBuybackDetailReq): Promise<WrBuybackDetail[]> {
  258. return commonSearch_go('/WrTrade2/QueryWrBuybackDetail', req).catch((err) => {
  259. throw new Error(`查询仓单回购明细: ${err}`);
  260. });
  261. }
  262. /**
  263. *查询融资合同费用明细 /WrTrade2/QueryWrScfContractInterest
  264. */
  265. export function queryWrScfContractInterest(req: QueryWrScfContractInterestReq): Promise<WrScfContractInterest[]> {
  266. return commonSearch_go('/WrTrade2/QueryWrScfContractInterest', req).catch((err) => {
  267. throw new Error(`查询融资合同费用明细: ${err}`);
  268. });
  269. }
  270. /**
  271. * 查询提货申请 /WrTrade2/QueryWrOutInApply
  272. */
  273. export function queryWrOutInApply(): Promise<WrOutInApply[]> {
  274. const userid = getUsrId()
  275. return commonSearch_go('/WrTrade2/QueryWrOutInApply', { userid }).catch((err) => {
  276. throw new Error(`查询提货申请: ${err}`);
  277. });
  278. }
  279. /**
  280. * 查询交收 /WrTrade2/QueryWrDeliveryDetail
  281. * 资金账号id
  282. */
  283. export function queryWrDeliveryDetail(): Promise<WrDeliveryDetail[]> {
  284. const accountid = getSelectedAccountId()
  285. const userid = getUsrId()
  286. return commonSearch_go('/WrTrade2/QueryWrDeliveryDetail', { userid, accountid }).catch((err) => {
  287. throw new Error(`查询交收: ${err}`);
  288. });
  289. }
  290. /**
  291. * 查询合约交易买卖大厅 /WrTrade2/QueryWrTradeOrderDetail
  292. * @param WrTradeOrderDetailReq
  293. */
  294. export function queryWrTradeOrderDetail(param: WrTradeOrderDetailReq): Promise<WrTradeOrderDetailRsp[]> {
  295. return commonSearch_go('/WrTrade2/QueryWrTradeOrderDetail', param).catch((err) => {
  296. throw new Error(`查询合约交易买卖大厅: ${err}`);
  297. });
  298. }
  299. /**
  300. * 询成交价(历史走势)WrTrade2/QueryWrAverageTradePrice
  301. * @param WrTradeOrderDetailReq
  302. */
  303. export function queryWrAverageTradePrice(param: WrAverageTradePriceQsq): Promise<WrAverageTradePriceQsp[]> {
  304. return commonSearch_go('/WrTrade2/QueryWrAverageTradePrice', param).catch((err) => {
  305. throw new Error(`询成交价(历史走势): ${err}`);
  306. });
  307. }
  308. /**
  309. * /WrTrade2/QueryWrDeliveryAvalidHoldLB 查询合约交收可点选仓单
  310. * @param QueryWrDeliveryAvalidHoldLBReq
  311. */
  312. export function queryWrDeliveryAvalidHoldLB(param: QueryWrDeliveryAvalidHoldLBReq): Promise<WrDeliveryAvalidHoldLB[]> {
  313. return commonSearch_go('/WrTrade2/QueryWrDeliveryAvalidHoldLB', param).catch((err) => {
  314. throw new Error(`查询合约交收可点选仓单: ${err}`);
  315. });
  316. }
  317. /**
  318. * /WrTrade2/QueryOrderQuoteMyq 查询贸易圈挂牌大厅
  319. * @param QueryOrderQuoteMyq
  320. */
  321. export function queryQueryOrderQuoteMyq(param: QueryOrderQuoteMyqReq): Promise<QueryOrderQuoteMyqQsp[]> {
  322. if (!param.userid) {
  323. param.userid = getUsrId()
  324. }
  325. return commonSearch_go('/WrTrade2/QueryOrderQuoteMyq', param).catch((err) => {
  326. throw new Error(`查询贸易圈挂牌大厅: ${err}`);
  327. });
  328. }
  329. /**
  330. * /WrTrade2/QueryWrTradeBargainApply 查询议价单
  331. * @param QueryWrTradeBargainApply
  332. */
  333. export function queryQueryWrTradeBargainApply(param: QueryWrTradeBargainApplyReq): Promise<QueryWrTradeBargainApplyQsp[]> {
  334. return commonSearch_go('/WrTrade2/QueryWrTradeBargainApply', param).catch((err) => {
  335. throw new Error(`查询议价单: ${err}`);
  336. });
  337. }
  338. /**
  339. * /WrTrade2/QueryWrUserFriend 查询查询我的朋友
  340. * @param QueryWrFriendApply
  341. */
  342. export function queryQueryWrFriend(newuserid?: string): Promise<QueryWrFriendApplyRsp[]> {
  343. const userid = getUsrId()
  344. const param = newuserid ? { userid, newuserid } : { userid }
  345. return commonSearch_go('/WrTrade2/QueryWrUserFriend', param).catch((err) => {
  346. throw new Error(`查询议价单: ${err}`);
  347. });
  348. }
  349. /**
  350. * /WrTrade2/QueryPermancePlanTmp 查询履约模板
  351. * @param QueryPermancePlanTmpReq
  352. */
  353. export function queryQueryPermancePlanTmp(param: QueryPermancePlanTmpReq): Promise<QueryPermancePlanTmpRsp[]> {
  354. return commonSearch_go('/WrTrade2/QueryPermancePlanTmp', param).catch((err) => {
  355. throw new Error(`查询议价单: ${err}`);
  356. });
  357. }