index.ts 4.1 KB

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