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