index.ts 4.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. import APP from '@/services';
  2. import { commonSearch_go } from '@/services/go';
  3. import { Ermcp3AreaSpot, Ermcp3AreaSpotDetail, Ermcp3AreaSpotDetailReq, Ermcp3ExposureDetail, Ermcp3ExposureReq, ErmcpExposurePostion, ErmcpExposurePostionReq, ErmcpHedgePosition, ErmcpHedgePositionDetail, ErmcpHedgePositionDetailReq, ErmcpRealExposureModel } from '@/services/go/ermcp/exposure/interface';
  4. /** ================================= 业务 - 敞口 ================================**/
  5. /**
  6. * 请求实时敞口 (敞口 -> 实时敞口) /Ermcp/QueryRealtimeExposure
  7. * @constructor
  8. */
  9. export function QueryActualExposure(): Promise<ErmcpRealExposureModel[]> {
  10. const AreaUserID = APP.get('userAccount').memberuserid; // 所属机构id
  11. return commonSearch_go('/Ermcp/QueryRealtimeExposure', { AreaUserID }).catch((err) => {
  12. throw new Error(`查询敞口 -> 实时敞口: ${err.message}`);
  13. });
  14. }
  15. /**
  16. * 请求实时敞口现货明细信息 (敞口 ->实时敞口 -> 现货明细) /Ermcp3/QueryExposureDetail
  17. * @param req.middlegoodsid 套保商品
  18. * @constructor
  19. */
  20. export function QueryActualExposureDetail(req: Ermcp3ExposureReq): Promise<Ermcp3ExposureDetail[]> {
  21. const areauserid = APP.get('userAccount').memberuserid; // 所属机构id
  22. return commonSearch_go('/Ermcp3/QueryExposureDetail', { areauserid, ...req }).catch((err) => {
  23. throw new Error(`查询敞口 ->实时敞口 -> 现货明细: ${err.message}`);
  24. });
  25. }
  26. /**
  27. * 查询实时敞口期货头寸明细 (敞口 ->实时敞口 -> 期货明细) /Ermcp/QueryRealtimeExposurePosition
  28. * @param req.middleGoodsId 套保商品ID
  29. * @constructor
  30. */
  31. export function QueryAutualExposurePosition(req: ErmcpExposurePostionReq): Promise<ErmcpExposurePostion[]> {
  32. const areaUserId = APP.get('userAccount').memberuserid; // 所属机构id
  33. return commonSearch_go('/Ermcp/QueryRealtimeExposurePosition', { areaUserId, ...req }).catch((err) => {
  34. throw new Error(`查询敞口 ->实时敞口 -> 期货明细: ${err.message}`);
  35. });
  36. }
  37. /**
  38. * 请求敞口现货头寸 (敞口 -> 现货头寸) /Ermcp3/QueryExposureSpot
  39. * @constructor
  40. */
  41. export function QuerySpotPosition(): Promise<Ermcp3AreaSpot[]> {
  42. const areauserid = APP.get('userAccount').memberuserid; // 所属机构id
  43. return commonSearch_go('/Ermcp3/QueryExposureSpot', { areauserid }).catch((err) => {
  44. throw new Error(`查询敞口 -> 现货头寸: ${err.message}`);
  45. });
  46. }
  47. /**
  48. * 查询敞口现货头寸明细(敞口 -> 现货头寸 -> 现货明细) /Ermcp3/QueryExposureSpotDetail
  49. * req.deliverygoodsid 现货品种ID
  50. * @constructor
  51. */
  52. export function QuerySpotPositionDetail(req: Ermcp3AreaSpotDetailReq): Promise<Ermcp3AreaSpotDetail[]> {
  53. const areauserid = APP.get('userAccount').memberuserid; // 所属机构id
  54. return commonSearch_go('/Ermcp3/QueryExposureSpotDetail', { areauserid, ...req }).catch((err) => {
  55. throw new Error(`查询敞口 -> 现货头寸 -> 现货明细: ${err.message}`);
  56. });
  57. }
  58. /**
  59. * 查询敞口期货头寸(菜单:敞口-> 期货头寸) /Ermcp/QueryExposureHedgePosition
  60. * @constructor
  61. */
  62. export function QueryExposureHedgePosition(): Promise<ErmcpHedgePosition> {
  63. const areaUserId = APP.get('userAccount').memberuserid; // 所属机构id
  64. return commonSearch_go('/Ermcp/QueryExposureHedgePosition', { areaUserId }).catch((err) => {
  65. throw new Error(`查询敞口 -> 期货头寸: ${err.message}`);
  66. });
  67. }
  68. /**
  69. * 查询敞口期货头寸期货明细(菜单:敞口 -> 期货头寸 -> 期货明细) /Ermcp/QueryExposureHedgePositionDetail
  70. * @param req.goodsId 商品id
  71. * @constructor
  72. */
  73. export function QueryExposureHedgePositionDetail(req: ErmcpHedgePositionDetailReq): Promise<ErmcpHedgePositionDetail[]> {
  74. const areaUserId = APP.get('userAccount').memberuserid; // 所属机构id
  75. return commonSearch_go('/Ermcp/QueryExposureHedgePositionDetail', { areaUserId, ...req }).catch((err) => {
  76. throw new Error(`查询敞口->期货头寸->期货明细: ${err.message}`);
  77. });
  78. }