瀏覽代碼

commit 敞口相关接口

xkwg 4 年之前
父節點
當前提交
177f030304
共有 2 個文件被更改,包括 146 次插入14 次删除
  1. 64 13
      src/goServiceAPI/ermcp/exposure/index.ts
  2. 82 1
      src/goServiceAPI/ermcp/exposure/interface.ts

+ 64 - 13
src/goServiceAPI/ermcp/exposure/index.ts

@@ -1,55 +1,106 @@
 import APP from "@/services";
 import APP from "@/services";
 import {commonSearch_go} from "@/goServiceAPI";
 import {commonSearch_go} from "@/goServiceAPI";
 import {
 import {
-    Ermcp3AreaSpot, Ermcp3AreaSpotDetail,
+    Ermcp3AreaSpot,
+    Ermcp3AreaSpotDetail,
+    Ermcp3AreaSpotDetailReq,
     Ermcp3ExposureDetail,
     Ermcp3ExposureDetail,
     Ermcp3ExposureReq,
     Ermcp3ExposureReq,
+    ErmcpExposurePostion,
+    ErmcpExposurePostionReq,
+    ErmcpHedgePosition,
+    ErmcpHedgePositionDetail,
+    ErmcpHedgePositionDetailReq,
     ErmcpRealExposureModel
     ErmcpRealExposureModel
 } from "@/goServiceAPI/ermcp/exposure/interface";
 } from "@/goServiceAPI/ermcp/exposure/interface";
 
 
 /** ================================= 敞口 ================================**/
 /** ================================= 敞口 ================================**/
 
 
 /**
 /**
- * 请求实时敞口 /Ermcp/QueryRealtimeExposure
+ * 请求实时敞口 (敞口 -> 实时敞口) /Ermcp/QueryRealtimeExposure
  * @constructor
  * @constructor
  */
  */
 export function QueryActualExposure() : Promise<ErmcpRealExposureModel[]>{
 export function QueryActualExposure() : Promise<ErmcpRealExposureModel[]>{
     const AreaUserID = APP.get('userAccount').memberuserid; // 所属机构id
     const AreaUserID = APP.get('userAccount').memberuserid; // 所属机构id
     return commonSearch_go('/Ermcp/QueryRealtimeExposure', {AreaUserID})
     return commonSearch_go('/Ermcp/QueryRealtimeExposure', {AreaUserID})
         .catch(err => {
         .catch(err => {
-            throw new Error(`查询实时敞口: ${err.message}`);
+            throw new Error(`查询敞口 -> 实时敞口: ${err.message}`);
         })
         })
 }
 }
 
 
 /**
 /**
- * 请求实时敞口现货明细信息 /Ermcp3/QueryExposureDetail
- * @param req
+ * 请求实时敞口现货明细信息 (敞口 ->实时敞口 -> 现货明细) /Ermcp3/QueryExposureDetail
+ * @param req.middlegoodsid 套保商品
  * @constructor
  * @constructor
  */
  */
 export function QueryActualExposureDetail(req: Ermcp3ExposureReq) : Promise<Ermcp3ExposureDetail[]>{
 export function QueryActualExposureDetail(req: Ermcp3ExposureReq) : Promise<Ermcp3ExposureDetail[]>{
     const areauserid = APP.get('userAccount').memberuserid; // 所属机构id
     const areauserid = APP.get('userAccount').memberuserid; // 所属机构id
     return commonSearch_go('/Ermcp3/QueryExposureDetail', {areauserid, ...req})
     return commonSearch_go('/Ermcp3/QueryExposureDetail', {areauserid, ...req})
         .catch(err => {
         .catch(err => {
-            throw new Error(`查询实时敞口现货明细: ${err.message}`);
+            throw new Error(`查询敞口 ->实时敞口 -> 现货明细: ${err.message}`);
         })
         })
 }
 }
 
 
 /**
 /**
- * 请求敞口现货头寸 /Ermcp3/QueryExposureSpot
+ * 查询实时敞口期货头寸明细 (敞口 ->实时敞口 -> 期货明细) /Ermcp/QueryRealtimeExposurePosition
+ * @param req.middleGoodsId 套保商品ID
+ * @constructor
+ */
+export function QueryAutualExposurePosition(req: ErmcpExposurePostionReq): Promise<ErmcpExposurePostion[]>{
+    const areaUserId = APP.get('userAccount').memberuserid; // 所属机构id
+    return commonSearch_go('/Ermcp3/QueryExposureDetail', {areaUserId, ...req})
+        .catch(err => {
+            throw new Error(`查询敞口 ->实时敞口 -> 期货明细: ${err.message}`);
+        })
+}
+
+/**
+ * 请求敞口现货头寸 (敞口 -> 现货头寸) /Ermcp3/QueryExposureSpot
  * @constructor
  * @constructor
  */
  */
 export function QuerySpotPosition() : Promise<Ermcp3AreaSpot[]>{
 export function QuerySpotPosition() : Promise<Ermcp3AreaSpot[]>{
     const areauserid = APP.get('userAccount').memberuserid; // 所属机构id
     const areauserid = APP.get('userAccount').memberuserid; // 所属机构id
-    return commonSearch_go('/Ermcp/QueryExposureSpot', {areauserid})
+    return commonSearch_go('/Ermcp3/QueryExposureSpot', {areauserid})
         .catch(err => {
         .catch(err => {
-            throw new Error(`查询敞口现货头寸: ${err.message}`);
+            throw new Error(`查询敞口 -> 现货头寸: ${err.message}`);
         })
         })
 }
 }
 
 
-export function QuerySpotPositionDetail() : Promise<Ermcp3AreaSpotDetail[]>{
+/**
+ * 查询敞口现货头寸明细(敞口 -> 现货头寸 -> 现货明细) /Ermcp3/QueryExposureSpotDetail
+ * req.deliverygoodsid  现货品种ID
+ * @constructor
+ */
+export function QuerySpotPositionDetail(req: Ermcp3AreaSpotDetailReq) : Promise<Ermcp3AreaSpotDetail[]>{
     const areauserid = APP.get('userAccount').memberuserid; // 所属机构id
     const areauserid = APP.get('userAccount').memberuserid; // 所属机构id
-    return commonSearch_go('/Ermcp/QueryExposureSpot', {areauserid})
+    return commonSearch_go('/Ermcp3/QueryExposureSpotDetail', {areauserid, ...req})
+        .catch(err => {
+            throw new Error(`查询敞口 -> 现货头寸 -> 现货明细: ${err.message}`);
+        })
+}
+
+/**
+ * 查询敞口期货头寸(菜单:敞口-> 期货头寸) /Ermcp/QueryExposureHedgePosition
+ * @constructor
+ */
+export function QueryExposureHedgePosition() : Promise<ErmcpHedgePosition>{
+    const areaUserId = APP.get('userAccount').memberuserid; // 所属机构id
+    return commonSearch_go('/Ermcp/QueryExposureHedgePosition', {areaUserId})
         .catch(err => {
         .catch(err => {
-            throw new Error(`查询敞口现货头寸: ${err.message}`);
+            throw new Error(`查询敞口 -> 期货头寸: ${err.message}`);
         })
         })
-}
+}
+
+/**
+ * 查询敞口期货头寸期货明细(菜单:敞口 -> 期货头寸 -> 期货明细) /Ermcp/QueryExposureHedgePositionDetail
+ * @param req.goodsId  商品id
+ * @constructor
+ */
+export function QueryExposureHedgePositionDetail(req : ErmcpHedgePositionDetailReq) :Promise<ErmcpHedgePositionDetail[]>{
+    const areaUserId = APP.get('userAccount').memberuserid; // 所属机构id
+    return commonSearch_go('/Ermcp/QueryExposureHedgePositionDetail', {areaUserId, ...req})
+        .catch(err => {
+            throw new Error(`查询敞口->期货头寸->期货明细: ${err.message}`);
+        })
+}
+

+ 82 - 1
src/goServiceAPI/ermcp/exposure/interface.ts

@@ -63,6 +63,31 @@ export interface Ermcp3ExposureDetail{
 }
 }
 
 
 /**
 /**
+ * 实时敞口期货明细请求
+ */
+export interface ErmcpExposurePostionReq{
+    middleGoodsId: number //套保商品ID
+}
+
+/**
+ * 实时敞口期货明细返回
+ */
+export interface ErmcpExposurePostion{
+    agreeunit	:string;//合约单位
+    areauserid	:number;//所属机构id
+    convertratio	:number;//期货品种系数(折算系数)
+    curqty	:number;//当前持仓
+    diffhedgeqty	:number;//套保品种变动量=持仓变动量期货合约单位期货品种系数
+    diffqty	:number;//持仓变动量=当前持仓-昨日持仓
+    goodscode	:string;//商品代码
+    goodsid	:number;//商品id
+    goodsname	:string;//商品名称
+    middlegoodsid	:number;//套保商品id
+    ydqty	:number;//昨日持仓
+}
+
+
+/**
  * 敞口现货头寸返回
  * 敞口现货头寸返回
  */
  */
 export interface Ermcp3AreaSpot{
 export interface Ermcp3AreaSpot{
@@ -79,8 +104,11 @@ export interface Ermcp3AreaSpot{
     updatetime	:string;//更新时间
     updatetime	:string;//更新时间
 }
 }
 
 
+/**
+ * 敞口现货头寸明细请求
+ */
 export interface Ermcp3AreaSpotDetailReq{
 export interface Ermcp3AreaSpotDetailReq{
-
+    deliverygoodsid: number  // 现货品种ID
 }
 }
 
 
 /**
 /**
@@ -101,4 +129,57 @@ export interface Ermcp3AreaSpotDetail{
     strtime	:string;//时间
     strtime	:string;//时间
 }
 }
 
 
+/**
+ * 敞口 -> 期货头寸 敞口期货头寸返回
+ */
+export interface ErmcpHedgePosition{
+    accountid	:number;//资金账号[外部母账户]
+    curbuyposition	:number;//期末买头寸
+    cursellposition	:number;//期末卖头寸
+    curtdbuyposition	:number;//期末今日买头寸
+    curtdsellposition	:number;//期末今日卖头寸
+    curydbuyposition	:number;//期末上日买头寸
+    curydsellposition	:number;//期末上日卖头寸
+    decreaseqty	:number;//减少数量 = (期末卖头寸 - 期初卖头寸)-1
+    fretdbuyposition	:number;//冻结今日买头寸
+    fretdsellposition	:number;//冻结今日卖头寸
+    freydbuyposition	:number;//冻结上日买头寸
+    freydsellposition	:number;//冻结上日卖头寸
+    goodscode	:string;//商品代码
+    goodsid	:number;//商品id
+    goodsname	:string;//商品名称
+    hedgeaccountcode	:string;//对冲账号
+    hedgegoodsid	:number;//对冲合约ID
+    increaseqty	:number;//增加数量 = 期末买头寸 - 期初买头寸
+    marketid	:number;//市场ID
+    relateduserid	:number;//关联用户id
+    totalcurqty	:number;//当前数量(净头寸) = 期末买头寸 - 期末卖头寸
+    totalydqty	:number;//昨日数量(净头寸) = 期初买头寸 - 期初卖头寸
+    tradedate	:string;//交易日(yyyyMMdd)
+    ydbuyposition	:number;//期初买头寸
+    ydsellposition	:number;//期初卖头寸
+}
+
+/**
+ * 查询敞口期货头寸期货明细 请求
+ */
+export interface ErmcpHedgePositionDetailReq{
+    goodsId: number // 商品id
+}
+
+/**
+ * 查询敞口期货头寸期货明细  敞口 -> 期货头寸 -> 期货明细
+ */
+export interface ErmcpHedgePositionDetail{
+    buyorsell	:number;//买卖方向 number;
+//-买 1-卖
+    channelbuildtype	:number;//开平方向 1-建仓 2-平仓
+    goodscode	:string;//商品代码
+    goodsname	:string;//商品名称
+    hedgegoodsid	:number;//商品id
+    tradeqty	:number;//数量(成交数量)
+    tradetime	:string;//时间(成交时间)
+}
+
+