Procházet zdrojové kódy

Merge branch 'master' of http://47.101.159.18:3000/Muchinfo/MTP2.0_WEB

zhou.xiaoning před 4 roky
rodič
revize
29a62c86d0

+ 1 - 1
src/goServiceAPI/ermcp/exposure-report/index.ts

@@ -13,7 +13,7 @@ import {QueryExposureDayReportReq} from "./interface";
 export async function QueryExposureDayReport(queryInfo:QueryExposureDayReportReq):Promise<type.QueryExposureDayReportRsp[]>
 {
     try {
-        return commonSearch_go('/Ermcp/QryReportDayExposure', { queryInfo });
+        return commonSearch_go('/Ermcp/QryReportDayExposure',  queryInfo );
     } catch (err) {
         throw new Error(err.message);
     }

+ 55 - 1
src/goServiceAPI/ermcp/exposure/index.ts

@@ -1 +1,55 @@
-/** ================================= 敞口 ================================**/
+import APP from "@/services";
+import {commonSearch_go} from "@/goServiceAPI";
+import {
+    Ermcp3AreaSpot, Ermcp3AreaSpotDetail,
+    Ermcp3ExposureDetail,
+    Ermcp3ExposureReq,
+    ErmcpRealExposureModel
+} from "@/goServiceAPI/ermcp/exposure/interface";
+
+/** ================================= 敞口 ================================**/
+
+/**
+ * 请求实时敞口 /Ermcp/QueryRealtimeExposure
+ * @constructor
+ */
+export function QueryActualExposure() : Promise<ErmcpRealExposureModel[]>{
+    const AreaUserID = APP.get('userAccount').memberuserid; // 所属机构id
+    return commonSearch_go('/Ermcp/QueryRealtimeExposure', {AreaUserID})
+        .catch(err => {
+            throw new Error(`查询实时敞口: ${err.message}`);
+        })
+}
+
+/**
+ * 请求实时敞口现货明细信息 /Ermcp3/QueryExposureDetail
+ * @param req
+ * @constructor
+ */
+export function QueryActualExposureDetail(req: Ermcp3ExposureReq) : Promise<Ermcp3ExposureDetail[]>{
+    const areauserid = APP.get('userAccount').memberuserid; // 所属机构id
+    return commonSearch_go('/Ermcp3/QueryExposureDetail', {areauserid, ...req})
+        .catch(err => {
+            throw new Error(`查询实时敞口现货明细: ${err.message}`);
+        })
+}
+
+/**
+ * 请求敞口现货头寸 /Ermcp3/QueryExposureSpot
+ * @constructor
+ */
+export function QuerySpotPosition() : Promise<Ermcp3AreaSpot[]>{
+    const areauserid = APP.get('userAccount').memberuserid; // 所属机构id
+    return commonSearch_go('/Ermcp/QueryExposureSpot', {areauserid})
+        .catch(err => {
+            throw new Error(`查询敞口现货头寸: ${err.message}`);
+        })
+}
+
+export function QuerySpotPositionDetail() : Promise<Ermcp3AreaSpotDetail[]>{
+    const areauserid = APP.get('userAccount').memberuserid; // 所属机构id
+    return commonSearch_go('/Ermcp/QueryExposureSpot', {areauserid})
+        .catch(err => {
+            throw new Error(`查询敞口现货头寸: ${err.message}`);
+        })
+}

+ 104 - 0
src/goServiceAPI/ermcp/exposure/interface.ts

@@ -0,0 +1,104 @@
+/**
+ * 实时敞口信息返回
+ */
+export interface ErmcpRealExposureModel{
+    AreaUserID	:number;//所属机构
+    BuyFutureQty	:number;//买入期货数量
+    BuyPlanQty	:number;//采购计划数量
+    BuyPricedQty	:number;//采购合同已定价数量
+    MiddleGoodsCode	:string;//套保品种代码
+    MiddleGoodsHedgeRatio	:number;//应套保比例
+    MiddleGoodsID	:number;//套保品种
+    MiddleGoodsName	:string;//套保品种名称
+    NeedHedgeExposoure	:number;//应套保敞口
+    NeedHedgeRatio	:number;//应套保敞口比例
+    OriBuyFutureQty	:number;//期初买入期货数量
+    OriBuyPlanQty	:number;//期初采购计划数量
+    OriBuyPricedQty	:number;//期初采购合同已定价数量
+    OriSellFutureQty	:number;//期初卖出期货数量
+    OriSellPlanQty	:number;//期初销售计划数量
+    OriSellPricedQty	:number;//期初销售合同已定价数量
+    SellFutureQty	:number;//卖出期货数量
+    SellPlanQty	:number;//销售计划数量
+    SellPricedQty	:number;//销售合同已定价数量
+    TotalExposure	:number;//总敞口
+    TotalFutureQty	:number;//期货数量
+    TotalHedgeRatio	:number;//敞口比例
+    TotalNeedHedgeQty	:number;//期货应套保量
+    TotalSpotQty	:number;//现货数量
+    diffFutuQty	:number;//今日变动量(期货) = (买入 - 买入期初) - (卖出 - 卖出期初)
+    diffSpotQty	:number;//今日变动量(现货) = 现货数量 - 期初现货数量
+    enumdicname	:string;//单位名称
+    oriTotalFutuQty	:number;//期初期货数量=期初买入期货数量-期初卖出期货数量
+    oriTotalSpotQty	:number;//期初现货数量=(期初销售计划数量-期初销售合同已定价数量)-(期初采购计划数量-期初采购合同已定价数量)
+}
+
+/**
+ * 查询实时敞口现货明细请求
+ */
+export interface Ermcp3ExposureReq{
+    middlegoodsid: number  //    套保商品
+}
+
+/**
+ * 实时敞口现货明细返回
+ */
+export interface Ermcp3ExposureDetail{
+    areauserid	:number;//机构ID
+    changeQty	:number;//套保变动量
+    contracttype	:number;//现货合同类型 - 1:采购 -1:销售
+    convertfactor	:number;//标仓系数
+    convertratio	:number;//套保系数
+    createtime	:string;//时间
+    deliverygoodscode	:string;//现货品种代码
+    deliverygoodsid	:number;//现货品种id
+    deliverygoodsname	:string;//现货品种名称
+    enumdicname	:string;//现货商品单位名称
+    logtype	:number;//类型 - 1:套保计划 2:现货合同
+    middlegoodsId	:number;//套保商品id
+    middlegoodscode	:string;//套保商品代码
+    middlegoodsname	:string;//套保商品名称
+    qty	:number;//数量
+    relateNo	:string;//现货合同/套保计划编号
+}
+
+/**
+ * 敞口现货头寸返回
+ */
+export interface Ermcp3AreaSpot{
+    areauserid	:number;//所属机构
+    decreaseqty	:number;//减少数量=-(销售已定价数量+采购计划数量)
+    deliverygoodscode	:string;//现货品种代码
+    deliverygoodsid	:number;//现货品种id
+    deliverygoodsname	:string;//现货品种名称
+    enumdicname	:string;//单位名称
+    goodsunitid	:number;//现货品种单位id
+    increaseqty	:number;//增加数量=销售计划数量+采购已定价数量
+    oritoalspotqty	:number;//昨日数量
+    totalspotqty	:number;//当前数量(现货头寸总量) = (销售计划数量 - 销售已定价数量) - (采购计划数量 - 采购已定价数量)
+    updatetime	:string;//更新时间
+}
+
+export interface Ermcp3AreaSpotDetailReq{
+
+}
+
+/**
+ * 敞口现货头寸明细(敞口 -> 现货头寸 ->现货明细)
+ */
+export interface Ermcp3AreaSpotDetail{
+    contracttype	:number;//合同类型 1-采购 -1-销售
+    createtime	:string;//创建时间
+    deliverygoodscode	:string;//现货品种代码
+    deliverygoodsid	:number;//现货品种id
+    deliverygoodsname	:string;//现货品种名称
+    enumdicname	:string;//现货商品单位名称
+    logtype	:number;//记录类型 1-套保 2-现货合同
+    qty	:number;//数量
+    recordname	:string;//类型名称
+    relatedid	:string;//套保计划ID/现货合同ID
+    relatedno	:string;//编号
+    strtime	:string;//时间
+}
+
+

+ 2 - 2
src/goServiceAPI/ermcp/finance-report/index.ts

@@ -14,7 +14,7 @@ import {QueryFinanceMonthReportReq} from "./interface";
 export async function QueryFinanceDayReport(queryInfo:QueryFinanceDayReportReq):Promise<type.QueryFinanceDayReportRsp[]>
 {
     try {
-        return commonSearch_go('/Ermcp/QryReportDayFinance', { queryInfo });
+        return commonSearch_go('/Ermcp/QryReportDayFinance',  queryInfo );
     } catch (err) {
         throw new Error(err.message);
     }
@@ -28,7 +28,7 @@ export async function QueryFinanceDayReport(queryInfo:QueryFinanceDayReportReq):
 export async function QueryFinanceInvoiceDayReport(queryInfo:QueryFinanceDayReportReq):Promise<type.QueryFinanceInvoiceDayReportRsp[]>
 {
     try {
-        return commonSearch_go('/Ermcp/QryReportDayFinanceFp', { queryInfo });
+        return commonSearch_go('/Ermcp/QryReportDayFinanceFp', queryInfo );
     } catch (err) {
         throw new Error(err.message);
     }

+ 2 - 2
src/goServiceAPI/ermcp/inventory-report/index.ts

@@ -12,7 +12,7 @@ import {QueryAreaStockReportDetailReq} from "./interface";
 export async function QueryAreaStockReport(queryInfo:QueryAreaStockReportReq):Promise<type.QueryAreaStockReportRsp[]>
 {
     try {
-        return commonSearch_go('/Ermcp3/QueryAreaStockReport', { queryInfo });
+        return commonSearch_go('/Ermcp3/QueryAreaStockReport',  queryInfo );
     } catch (err) {
         throw new Error(err.message);
     }
@@ -26,7 +26,7 @@ export async function QueryAreaStockReport(queryInfo:QueryAreaStockReportReq):Pr
 export async function QueryAreaStockReportDetail(queryInfo:QueryAreaStockReportDetailReq):Promise<type.QueryAreaStockReportDetailRsp[]>
 {
     try {
-        return commonSearch_go('/Ermcp3/QueryAreaStockReportDetail', { queryInfo });
+        return commonSearch_go('/Ermcp3/QueryAreaStockReportDetail',  queryInfo );
     } catch (err) {
         throw new Error(err.message);
     }

+ 1 - 1
src/goServiceAPI/ermcp/purchase/index.ts

@@ -13,7 +13,7 @@ import {Ermcp3SellBuyContract, SellBuyContractReq} from "@/goServiceAPI/ermcp/pu
  * @constructor
  */
 export function QueryPurchase( req : SellBuyContractReq) : Promise<Ermcp3SellBuyContract[]>{
-    return commonSearch_go('/Ermcp3/QuerySpotContractBS', {req})
+    return commonSearch_go('/Ermcp3/QuerySpotContractBS', req)
         .catch(err => {
             throw new Error(`查询采购信息: ${err.message}`);
         })

+ 1 - 1
src/goServiceAPI/ermcp/sell/index.ts

@@ -13,7 +13,7 @@ import {commonSearch_go} from "@/goServiceAPI";
  * @constructor
  */
 export function QueryWareHouse(req : SellBuyContractReq) : Promise<Ermcp3SellBuyContract[]>{
-    return commonSearch_go('/Ermcp3/QuerySpotContractBS', {req})
+    return commonSearch_go('/Ermcp3/QuerySpotContractBS', req)
         .catch(err => {
             throw new Error(`查询销售信息: ${err.message}`);
         })

+ 2 - 2
src/goServiceAPI/ermcp/spot-report/index.ts

@@ -14,7 +14,7 @@ import {QuerySpotMonthReportDetailReq} from "./interface";
  export async function QuerySpotDayReport(queryInfo:QuerySpotDayReportReq):Promise<type.QuerySpotDayReportRsp[]>
  {
      try {
-         return commonSearch_go('/Ermcp/QryReportDaySpot', { queryInfo });
+         return commonSearch_go('/Ermcp/QryReportDaySpot',  queryInfo );
      } catch (err) {
          throw new Error(err.message);
      }
@@ -28,7 +28,7 @@ import {QuerySpotMonthReportDetailReq} from "./interface";
  export async function QuerySpotDayReportDetail(queryInfo:QuerySpotDayReportDetailReq):Promise<type.QuerySpotDayReportDetailRsp[]>
  {
      try {
-         return commonSearch_go('/Ermcp/QryReportDaySpotDetail', { queryInfo });
+         return commonSearch_go('/Ermcp/QryReportDaySpotDetail',  queryInfo );
      } catch (err) {
          throw new Error(err.message);
      }