index.ts 6.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220
  1. /** ================================= 前海金相关接口 ================================**/
  2. import { getSelectedAccountId } from "@/services/bus/account";
  3. import { getUsrId } from "@/services/bus/user";
  4. import { commonSearch_go } from "@/services/go";
  5. import {
  6. QhjAccountOutInApply,
  7. QhjContract,
  8. QhjCustomer,
  9. QhjMgrPosition,
  10. QhjMgrSubArea, QhjMgrTradeDetailRsp,
  11. QhjMgrTradeOrderDetailRsp,
  12. QhjMgrTradePayOrder,
  13. QhjParentAreaList,
  14. QhjPayOrder,
  15. QhjPickGoods,
  16. QhjReckonPriceLog,
  17. QhjRStrategy,
  18. QhjRSTriggerLog,
  19. QhjTradeGoodsPickup,
  20. QueryAccountInOutApplyReq,
  21. QueryCustomerInfoReq,
  22. QueryPayOrderReq,
  23. QueryReckonPriceLogReq,
  24. QuerySubAreaReq,
  25. QueryTradeDetailReq,
  26. QueryTradeOrderDetailReq,
  27. QueryTradePayOrderReq,
  28. QueryTradePositionReq
  29. } from "@/services/go/ermcp/qhj/interface";
  30. /**
  31. * -- 铂金宝 - 提货查询
  32. * 查询提货 /Qhj/QueryTradeGoodsPickup
  33. * @constructor
  34. */
  35. export function queryTradeGoodsPickup(): Promise<QhjTradeGoodsPickup[]> {
  36. const userid = getUsrId()
  37. return commonSearch_go('/Qhj/QueryTradeGoodsPickup', { userid }).catch((err) => {
  38. throw new Error(`查询提货: ${err}`);
  39. });
  40. }
  41. /**
  42. *
  43. * -- 铂金宝 - 充值提现审核 - 充值审核/提现审核
  44. * 查询充值提现 /QhjMgr/QueryAccountInOutApply
  45. * @param req
  46. */
  47. export function queryAccountInOutApply(req: QueryAccountInOutApplyReq): Promise<QhjAccountOutInApply[]> {
  48. return commonSearch_go('/QhjMgr/QueryAccountInOutApply', req).catch((err) => {
  49. throw new Error(`查询充值提现: ${err}`);
  50. });
  51. }
  52. /**
  53. * -- 铂金宝 - 定投价查询
  54. * 查询定投价(结算价) /Qhj/QueryReckonPriceLog
  55. * @param req
  56. */
  57. export function queryReckonPriceLog(req: QueryReckonPriceLogReq): Promise<QhjReckonPriceLog[]> {
  58. return commonSearch_go('/Qhj/QueryReckonPriceLog', req).catch((err) => {
  59. throw new Error(`定投价查询: ${err}`);
  60. });
  61. }
  62. /**
  63. * -- 铂金宝 - 定投查询 - 定投流水查询
  64. * 查询定投记录(定投管理/详情/定投记录) /Qhj/QueryRSTriggerLog
  65. * @param req
  66. */
  67. export function queryRSTriggerLog(status?: 1 | 2 | 3): Promise<QhjRSTriggerLog[]> {
  68. // fixme 不传userid
  69. // const userid = getUsrId();
  70. // const param = status ? { userid, status } : { userid }
  71. const param = status ? { status } : {}
  72. return commonSearch_go('/Qhj/QueryRSTriggerLog', param).catch((err) => {
  73. throw new Error(`查询定投记录: ${err}`);
  74. });
  75. }
  76. /**
  77. * -- 铂金宝 - 定投查询 - 定投计划查询
  78. * 查询定投设置(我的定投/历史定投[状态=已终止]) /Qhj/set feedback off
  79. * @param req
  80. */
  81. export function queryRStrategy(status?: 1 | 2 | 3): Promise<QhjRStrategy[]> {
  82. // fixme 不传userid
  83. // const userid = getUsrId();
  84. const param = status ? { status } : {}
  85. return commonSearch_go('/Qhj/QueryRStrategy', param).catch((err) => {
  86. throw new Error(`查询定投设置: ${err}`);
  87. });
  88. }
  89. /**
  90. * -- 铂金宝 - 融资信息
  91. * 查询融资明细(合同) /Qhj/QueryContract
  92. * @param 合同id
  93. */
  94. export function queryContract(scfcontractid?: number): Promise<QhjContract[]> {
  95. // fixme 不传userid
  96. // const userid = getUsrId();
  97. const param = scfcontractid ? { scfcontractid } : {}
  98. return commonSearch_go('/Qhj/QueryContract', param).catch((err) => {
  99. throw new Error(`查询融资明细(合同): ${err}`);
  100. });
  101. }
  102. /**
  103. * -- 铂金宝 - 客户资料
  104. * 查询客户资料 /QhjMgr/QueryCustomerInfo
  105. * @param req
  106. */
  107. export function queryCustomerInfo(req: QueryCustomerInfoReq): Promise<QhjCustomer[]> {
  108. return commonSearch_go('/QhjMgr/QueryCustomerInfo', req).catch((err) => {
  109. throw new Error(`查询客户资料: ${err}`);
  110. });
  111. }
  112. /**
  113. * -- 铂金宝 - 查询所属机构列表
  114. * 查询客户资料 /Qhj/QueryParentAreaList
  115. * @param req
  116. */
  117. export function queryParentAreaList(): Promise<QhjParentAreaList[]> {
  118. const userid = getUsrId()
  119. return commonSearch_go('/Qhj/QueryParentAreaList', { userid }).catch((err) => {
  120. throw new Error(`查询所属机构列表: ${err}`);
  121. });
  122. }
  123. /**
  124. * -- 铂金宝 - 查询所属机构列表
  125. * 查询客户资料 /Qhj/QueryPickGoods
  126. * @param req
  127. */
  128. export function queryPickGoods(status?: 1 | 2 | 3): Promise<QhjPickGoods[]> {
  129. const param = status ? { status } : {}
  130. return commonSearch_go('/Qhj/QueryPickGoods', param).catch((err) => {
  131. throw new Error(`查询所属机构列表: ${err}`);
  132. });
  133. }
  134. /**
  135. * -- 铂金宝 - 查询待付款单据
  136. * 查询客户资料 /Qhj/QueryPayOrder
  137. * @param req
  138. */
  139. export function queryPayOrder(req: QueryPayOrderReq): Promise<QhjPayOrder[]> {
  140. const accountid = getSelectedAccountId()?.toNumber()
  141. req.accountid = accountid as number
  142. return commonSearch_go('/Qhj/QueryPayOrder', req).catch((err) => {
  143. throw new Error(`查询待付款单据: ${err}`);
  144. });
  145. }
  146. /**
  147. * -- 铂金宝 - 查询子机构列表
  148. * 查询子机构列表 /QhjMgr/QuerySubArea
  149. * @param req
  150. */
  151. export function querySubArea(req: QuerySubAreaReq): Promise<QhjMgrSubArea[]> {
  152. return commonSearch_go('/QhjMgr/QuerySubArea', req).catch((err) => {
  153. throw new Error(`查询子机构列表: ${err}`);
  154. });
  155. }
  156. /**
  157. * -- 铂金宝 -- 单据查询 -- 持仓
  158. * /QhjMgr/QueryTradePosition
  159. */
  160. export function queryTradePosition(req: QueryTradePositionReq): Promise<QhjMgrPosition[]> {
  161. const userid = getUsrId()
  162. req.userid = userid
  163. return commonSearch_go('/QhjMgr/QueryTradePosition', req).catch((err) => {
  164. throw new Error(`查询持仓汇总: ${err}`);
  165. });
  166. }
  167. /**
  168. * -- 铂金宝 -- 单据查询 -- 委托单
  169. * 查询委托明细 /QhjMgr/QueryTradeOrderDetail
  170. * @param req
  171. */
  172. export function queryTradeOrderDetail(req: QueryTradeOrderDetailReq): Promise<QhjMgrTradeOrderDetailRsp[]> {
  173. const userid = getUsrId()
  174. req.userid = userid
  175. return commonSearch_go('/QhjMgr/QueryTradeOrderDetail', req).catch((err) => {
  176. throw new Error(`查询持仓汇总: ${err}`);
  177. });
  178. }
  179. /**
  180. * -- 铂金宝 -- 单据查询 -- 待付端
  181. * 查询待付款单 /QhjMgr/QueryTradePayOrder
  182. * @param req
  183. */
  184. export function queryTradePayOrder(req: QueryTradePayOrderReq): Promise<QhjMgrTradePayOrder[]> {
  185. const userid = getUsrId()
  186. req.userid = userid
  187. return commonSearch_go('/QhjMgr/QueryTradePayOrder', req).catch((err) => {
  188. throw new Error(`查询持仓汇总: ${err}`);
  189. });
  190. }
  191. /**
  192. * -- 铂金宝 -- 单据查询 -- 成交单
  193. * 查询成交明细 /QhjMgr/QueryTradeDetail
  194. * @param req
  195. */
  196. export function queryTradeDetail(req: QueryTradeDetailReq): Promise<QhjMgrTradeDetailRsp[]> {
  197. return commonSearch_go('/QhjMgr/QueryTradeDetail', req).catch((err) => {
  198. throw new Error(`查询持仓汇总: ${err}`);
  199. });
  200. }