index.ts 9.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296
  1. /** ================================= 前海金相关接口 ================================**/
  2. import { getSelectedAccountId } from "@/services/bus/account";
  3. import { getUserId } from "@/services/bus/user";
  4. import { commonSearch_go } from "@/services/go";
  5. import {
  6. Ermcp3SpotGoodsPrice, Ermcp3SpotGoodsPriceLog,
  7. QhjAccountOutInApply, QhjAgreementChangeLog, QhjAgreementConfig,
  8. QhjContract,
  9. QhjCustomer, QhjCustomerSignStatus,
  10. QhjMgrPosition,
  11. QhjMgrSubArea, QhjMgrTradeDetailRsp,
  12. QhjMgrTradeOrderDetailRsp,
  13. QhjMgrTradePayOrder,
  14. QhjParentAreaList,
  15. QhjPayOrder,
  16. QhjPickGoods,
  17. QhjReckonPriceLog,
  18. QhjRStrategy,
  19. QhjRSTriggerLog,
  20. QhjTradeGoodsPickup,
  21. QueryAccountInOutApplyReq, QueryAgreementChangeLogReq, QueryAgreementConfigReq,
  22. QueryBrokerApplyRsp,
  23. QueryBrokerApplyRsq,
  24. QueryContractLogReq,
  25. QueryContractLogRsp, QueryCustomerInfoReq, QueryCustomerSignStatusReq,
  26. QueryPayOrderReq,
  27. QueryReckonPriceLogReq, QuerySpotGoodsPrice, QuerySpotGoodsPriceLogReq,
  28. QuerySubAreaReq,
  29. QueryTradeDetailReq,
  30. QueryTradeOrderDetailReq,
  31. QueryTradePayOrderReq,
  32. QueryTradePositionReq
  33. } from "@/services/go/ermcp/qhj/interface";
  34. /**
  35. * -- 铂金宝 - 提货查询
  36. * 查询提货 /Qhj/QueryTradeGoodsPickup
  37. * @constructor
  38. */
  39. export function queryTradeGoodsPickup(): Promise<QhjTradeGoodsPickup[]> {
  40. const userid = getUserId()
  41. return commonSearch_go('/Qhj/QueryTradeGoodsPickup', { userid }).catch((err) => {
  42. throw new Error(`查询提货: ${err}`);
  43. });
  44. }
  45. /**
  46. * -- 铂金宝 - 定投价查询
  47. * 查询定投价(结算价) /Qhj/QueryReckonPriceLog
  48. * @param req
  49. */
  50. export function queryReckonPriceLog(req: QueryReckonPriceLogReq): Promise<QhjReckonPriceLog[]> {
  51. return commonSearch_go('/Qhj/QueryReckonPriceLog', req).catch((err) => {
  52. throw new Error(`定投价查询: ${err}`);
  53. });
  54. }
  55. /**
  56. * -- 铂金宝 - 定投查询 - 定投流水查询
  57. * 查询定投记录(定投管理/详情/定投记录) /Qhj/QueryRSTriggerLog
  58. * @param req
  59. */
  60. export function queryRSTriggerLog(status?: 1 | 2 | 3): Promise<QhjRSTriggerLog[]> {
  61. // fixme 不传userid
  62. // const userid = getUserId();
  63. // const param = status ? { userid, status } : { userid }
  64. const param = status ? { status } : {}
  65. return commonSearch_go('/Qhj/QueryRSTriggerLog', param).catch((err) => {
  66. throw new Error(`查询定投记录: ${err}`);
  67. });
  68. }
  69. /**
  70. * -- 铂金宝 - 定投查询 - 定投计划查询
  71. * 查询定投设置(我的定投/历史定投[状态=已终止]) /Qhj/set feedback off
  72. * @param req
  73. */
  74. export function queryRStrategy(status?: 1 | 2 | 3): Promise<QhjRStrategy[]> {
  75. // fixme 不传userid
  76. // const userid = getUserId();
  77. const param = status ? { status } : {}
  78. return commonSearch_go('/Qhj/QueryRStrategy', param).catch((err) => {
  79. throw new Error(`查询定投设置: ${err}`);
  80. });
  81. }
  82. /**
  83. * -- 铂金宝 - 融资明细流水
  84. * 查询融资明细流水(融资明细详情页中的流水) /Qhj/QueryContractLog
  85. * @param 合同id
  86. */
  87. export function queryContractLog(param: QueryContractLogReq): Promise<QueryContractLogRsp[]> {
  88. return commonSearch_go('/Qhj/QueryContractLog', param).catch((err) => {
  89. throw new Error(`融资明细详情页中的流水): ${err}`);
  90. });
  91. }
  92. /**
  93. * -- 铂金宝 - 查询所属机构列表
  94. * 查询客户资料 /Qhj/QueryParentAreaList
  95. * @param req
  96. */
  97. export function queryParentAreaList(): Promise<QhjParentAreaList[]> {
  98. const userid = getUserId()
  99. return commonSearch_go('/Qhj/QueryParentAreaList', { userid }).catch((err) => {
  100. throw new Error(`查询所属机构列表: ${err}`);
  101. });
  102. }
  103. /**
  104. * -- 铂金宝 - 查询经纪人申请(所属客户经理)
  105. * 查询客户资料 /QhjMgr/QueryBrokerApply
  106. * @param req
  107. */
  108. export function QueryBrokerApply(param: QueryBrokerApplyRsq): Promise<QueryBrokerApplyRsp[]> {
  109. return commonSearch_go('/QhjMgr/QueryBrokerApply', param).catch((err) => {
  110. throw new Error(`查询所属机构列表: ${err}`);
  111. });
  112. }
  113. /**
  114. * -- 铂金宝 - 查询待付款单据
  115. * 查询客户资料 /Qhj/QueryPayOrder
  116. * @param req
  117. */
  118. export function queryPayOrder(req: QueryPayOrderReq): Promise<QhjPayOrder[]> {
  119. req.accountid = getSelectedAccountId()
  120. return commonSearch_go('/Qhj/QueryPayOrder', req).catch((err) => {
  121. throw new Error(`查询待付款单据: ${err}`);
  122. });
  123. }
  124. /****************** (Ermcp3) ****************/
  125. /**
  126. * -- 查询现货市价(现货市价)
  127. * /Ermcp3/QuerySpotGoodsPrice
  128. */
  129. export function querySpotGoodsPrice(req: QuerySpotGoodsPrice): Promise<Ermcp3SpotGoodsPrice[]> {
  130. const param = {
  131. userid: getUserId(),
  132. }
  133. Object.assign(param, req)
  134. return commonSearch_go('/Ermcp3/QuerySpotGoodsPrice', param).catch((err) => {
  135. throw new Error(`查询现货市价: ${err}`);
  136. });
  137. }
  138. /**
  139. * 查询现货市价详情(现货市价/详情)
  140. * /Ermcp3/QuerySpotGoodsPriceLog
  141. */
  142. export function querySpotGoodsPriceLog(req: QuerySpotGoodsPriceLogReq): Promise<Ermcp3SpotGoodsPriceLog[]> {
  143. return commonSearch_go('/Ermcp3/QuerySpotGoodsPriceLog', req).catch((err) => {
  144. throw new Error(`查询现货市价详情: ${err}`);
  145. });
  146. }
  147. /****************** 大连千海金(PCWeb) (QhjMgr)*******************************/
  148. /**
  149. * -- 铂金宝 - 充值提现审核 - 充值审核/提现审核
  150. * 查询充值提现 /QhjMgr/QueryAccountInOutApply
  151. * @param req
  152. */
  153. export function queryAccountInOutApply(req: QueryAccountInOutApplyReq): Promise<QhjAccountOutInApply[]> {
  154. return commonSearch_go('/QhjMgr/QueryAccountInOutApply', req).catch((err) => {
  155. throw new Error(`查询充值提现: ${err}`);
  156. });
  157. }
  158. /**
  159. * -- 铂金宝 - 融资信息
  160. * 查询融资明细(合同) /QhjMgr/QueryContract
  161. * @param 合同id
  162. */
  163. export function queryContract(scfcontractid?: number): Promise<QhjContract[]> {
  164. return commonSearch_go('/QhjMgr/QueryContract', {}).catch((err) => {
  165. throw new Error(`查询融资明细(合同): ${err}`);
  166. });
  167. }
  168. /**
  169. * -- 铂金宝 - 客户资料
  170. * 查询客户资料 /QhjMgr/QueryCustomerInfo
  171. * @param req
  172. */
  173. export function queryCustomerInfo(req: QueryCustomerInfoReq): Promise<QhjCustomer[]> {
  174. return commonSearch_go('/QhjMgr/QueryCustomerInfo', req).catch((err) => {
  175. throw new Error(`查询客户资料: ${err}`);
  176. });
  177. }
  178. /**
  179. * -- 铂金宝 - 查询提货商品
  180. * 查询客户资料 /QhjMgr/QueryPickGoods
  181. * @param req 状态(可多选,逗号隔开) - 1:正常 2:停用 3:注销
  182. */
  183. export function queryPickGoods(status?: string): Promise<QhjPickGoods[]> {
  184. const param = status ? { status } : {}
  185. return commonSearch_go('/QhjMgr/QueryPickGoods', param).catch((err) => {
  186. throw new Error(`查询提货商品: ${err}`);
  187. });
  188. }
  189. /**
  190. * -- 铂金宝 - 查询子机构列表
  191. * 查询子机构列表 /QhjMgr/QuerySubArea
  192. * @param req
  193. */
  194. export function querySubArea(req: QuerySubAreaReq): Promise<QhjMgrSubArea[]> {
  195. return commonSearch_go('/QhjMgr/QuerySubArea', req).catch((err) => {
  196. throw new Error(`查询子机构列表: ${err}`);
  197. });
  198. }
  199. /**
  200. * -- 铂金宝 -- 单据查询 -- 成交单
  201. * 查询成交明细 /QhjMgr/QueryTradeDetail
  202. * @param req
  203. */
  204. export function queryTradeDetail(req: QueryTradeDetailReq): Promise<QhjMgrTradeDetailRsp[]> {
  205. return commonSearch_go('/QhjMgr/QueryTradeDetail', req).catch((err) => {
  206. throw new Error(`查询持仓汇总: ${err}`);
  207. });
  208. }
  209. /**
  210. * -- 铂金宝 -- 单据查询 -- 委托单
  211. * 查询委托明细 /QhjMgr/QueryTradeOrderDetail
  212. * @param req
  213. */
  214. export function queryTradeOrderDetail(req: QueryTradeOrderDetailReq): Promise<QhjMgrTradeOrderDetailRsp[]> {
  215. return commonSearch_go('/QhjMgr/QueryTradeOrderDetail', req).catch((err) => {
  216. throw new Error(`查询持仓汇总: ${err}`);
  217. });
  218. }
  219. /**
  220. * -- 铂金宝 -- 单据查询 -- 待付端
  221. * 查询待付款单 /QhjMgr/QueryTradePayOrder
  222. * @param req
  223. */
  224. export function queryTradePayOrder(req: QueryTradePayOrderReq): Promise<QhjMgrTradePayOrder[]> {
  225. return commonSearch_go('/QhjMgr/QueryTradePayOrder', req).catch((err) => {
  226. throw new Error(`查询持仓汇总: ${err}`);
  227. });
  228. }
  229. /**
  230. * -- 铂金宝 -- 单据查询 -- 持仓
  231. * /QhjMgr/QueryTradePosition
  232. */
  233. export function queryTradePosition(req: QueryTradePositionReq): Promise<QhjMgrPosition[]> {
  234. return commonSearch_go('/QhjMgr/QueryTradePosition', req).catch((err) => {
  235. throw new Error(`查询持仓汇总: ${err}`);
  236. });
  237. }
  238. /****************** 大连千海金(协议和签约信息)(QhjSys) *********************/
  239. /**
  240. * 查询协议配置变更流水
  241. * /QhjSys/QueryAgreementChangeLog
  242. */
  243. export function queryAgreementChangeLog(req: QueryAgreementChangeLogReq): Promise<QhjAgreementChangeLog[]> {
  244. return commonSearch_go('/QhjSys/QueryAgreementChangeLog', req).catch((err) => {
  245. throw new Error(`查询协议配置变更流水: ${err}`);
  246. });
  247. }
  248. /**
  249. * 查询协议配置
  250. * /QhjSys/QueryAgreementConfig
  251. */
  252. export function queryAgreementConfig(req: QueryAgreementConfigReq): Promise<QhjAgreementConfig[]> {
  253. return commonSearch_go('/QhjSys/QueryAgreementConfig', req).catch((err) => {
  254. throw new Error(`查询协议配置: ${err}`);
  255. });
  256. }
  257. /**
  258. * 查询客户协议签约状态
  259. * /QhjSys/QueryCustomerSignStatus
  260. */
  261. export function queryCustomerSignStatus(req: QueryCustomerSignStatusReq): Promise<QhjCustomerSignStatus[]> {
  262. return commonSearch_go('/QhjSys/QueryCustomerSignStatus', req).catch((err) => {
  263. throw new Error(`查询客户协议签约状态: ${err}`);
  264. });
  265. }