Prechádzať zdrojové kódy

commit 提交接口修改

xkwg 4 rokov pred
rodič
commit
7194731244

+ 18 - 14
src/services/go/ermcp/exposure/index.ts

@@ -1,6 +1,7 @@
 import APP from '@/services';
 import { commonSearch_go } from '@/services/go';
 import { Ermcp3AreaSpot, Ermcp3AreaSpotDetail, Ermcp3AreaSpotDetailReq, Ermcp3ExposureDetail, Ermcp3ExposureReq, ErmcpExposurePostion, ErmcpExposurePostionReq, ErmcpHedgePosition, ErmcpHedgePositionDetail, ErmcpHedgePositionDetailReq, ErmcpRealExposureModel } from '@/services/go/ermcp/exposure/interface';
+import {getUserId} from "@/services/bus/account";
 
 /** ================================= 业务 - 敞口 ================================**/
 
@@ -9,8 +10,8 @@ import { Ermcp3AreaSpot, Ermcp3AreaSpotDetail, Ermcp3AreaSpotDetailReq, Ermcp3Ex
  * @constructor
  */
 export function QueryActualExposure(): Promise<ErmcpRealExposureModel[]> {
-    const AreaUserID = APP.get('userAccount').memberuserid; // 所属机构id
-    return commonSearch_go('/Ermcp/QueryRealtimeExposure', { AreaUserID }).catch((err) => {
+    const userid = getUserId(); // 所属机构id
+    return commonSearch_go('/Ermcp/QueryRealtimeExposure', { userid }).catch((err) => {
         throw new Error(`查询敞口 -> 实时敞口: ${err.message}`);
     });
 }
@@ -21,8 +22,9 @@ export function QueryActualExposure(): Promise<ErmcpRealExposureModel[]> {
  * @constructor
  */
 export function QueryActualExposureDetail(req: Ermcp3ExposureReq): Promise<Ermcp3ExposureDetail[]> {
-    const areauserid = APP.get('userAccount').memberuserid; // 所属机构id
-    return commonSearch_go('/Ermcp3/QueryExposureDetail', { areauserid, ...req }).catch((err) => {
+    const userid = getUserId(); // 用户id
+    const usertype = 2;  // 用户类型 2-机构 7-企业成员
+    return commonSearch_go('/Ermcp3/QueryExposureDetail', { userid, usertype, ...req }).catch((err) => {
         throw new Error(`查询敞口 ->实时敞口 -> 现货明细: ${err.message}`);
     });
 }
@@ -33,8 +35,8 @@ export function QueryActualExposureDetail(req: Ermcp3ExposureReq): Promise<Ermcp
  * @constructor
  */
 export function QueryAutualExposurePosition(req: ErmcpExposurePostionReq): Promise<ErmcpExposurePostion[]> {
-    const areaUserId = APP.get('userAccount').memberuserid; // 所属机构id
-    return commonSearch_go('/Ermcp/QueryRealtimeExposurePosition', { areaUserId, ...req }).catch((err) => {
+    const userid = getUserId(); // 所属机构id
+    return commonSearch_go('/Ermcp/QueryRealtimeExposurePosition', { userid, ...req }).catch((err) => {
         throw new Error(`查询敞口 ->实时敞口 -> 期货明细: ${err.message}`);
     });
 }
@@ -44,8 +46,9 @@ export function QueryAutualExposurePosition(req: ErmcpExposurePostionReq): Promi
  * @constructor
  */
 export function QuerySpotPosition(): Promise<Ermcp3AreaSpot[]> {
-    const areauserid = APP.get('userAccount').memberuserid; // 所属机构id
-    return commonSearch_go('/Ermcp3/QueryExposureSpot', { areauserid }).catch((err) => {
+    const userid = getUserId(); // 用户id
+    const usertype = 2;  // 用户类型 2-机构 7-企业成员
+    return commonSearch_go('/Ermcp3/QueryExposureSpot', { userid, usertype }).catch((err) => {
         throw new Error(`查询敞口 -> 现货头寸: ${err.message}`);
     });
 }
@@ -56,8 +59,9 @@ export function QuerySpotPosition(): Promise<Ermcp3AreaSpot[]> {
  * @constructor
  */
 export function QuerySpotPositionDetail(req: Ermcp3AreaSpotDetailReq): Promise<Ermcp3AreaSpotDetail[]> {
-    const areauserid = APP.get('userAccount').memberuserid; // 所属机构id
-    return commonSearch_go('/Ermcp3/QueryExposureSpotDetail', { areauserid, ...req }).catch((err) => {
+    const userid = getUserId(); // 用户id
+    const usertype = 2;  // 用户类型 2-机构 7-企业成员
+    return commonSearch_go('/Ermcp3/QueryExposureSpotDetail', { userid, usertype, ...req }).catch((err) => {
         throw new Error(`查询敞口 -> 现货头寸 -> 现货明细: ${err.message}`);
     });
 }
@@ -67,8 +71,8 @@ export function QuerySpotPositionDetail(req: Ermcp3AreaSpotDetailReq): Promise<E
  * @constructor
  */
 export function QueryExposureHedgePosition(): Promise<ErmcpHedgePosition[]> {
-    const areaUserId = APP.get('userAccount').memberuserid; // 所属机构id
-    return commonSearch_go('/Ermcp/QueryExposureHedgePosition', { areaUserId }).catch((err) => {
+    const userid = getUserId(); // 所属机构id
+    return commonSearch_go('/Ermcp/QueryExposureHedgePosition', { userid }).catch((err) => {
         throw new Error(`查询敞口 -> 期货头寸: ${err.message}`);
     });
 }
@@ -79,8 +83,8 @@ export function QueryExposureHedgePosition(): Promise<ErmcpHedgePosition[]> {
  * @constructor
  */
 export function QueryExposureHedgePositionDetail(req: ErmcpHedgePositionDetailReq): Promise<ErmcpHedgePositionDetail[]> {
-    const areaUserId = APP.get('userAccount').memberuserid; // 所属机构id
-    return commonSearch_go('/Ermcp/QueryExposureHedgePositionDetail', { areaUserId, ...req }).catch((err) => {
+    const userid = getUserId(); // 所属机构id
+    return commonSearch_go('/Ermcp/QueryExposureHedgePositionDetail', { userid, ...req }).catch((err) => {
         throw new Error(`查询敞口->期货头寸->期货明细: ${err.message}`);
     });
 }

+ 21 - 13
src/services/go/ermcp/goodsInfo/index.ts

@@ -4,6 +4,7 @@ import APP from '@/services';
 import { getUserId } from "@/services/bus/account";
 import { commonSearch_go } from '@/services/go/index';
 import {
+    DeliveryGoodsDetailReq,
     Ermcp3Brand, Ermcp3GoodsGroup, Ermcp3MiddleGoodsDetailEx,
     Ermcp3Wrstandard,
     ErmcpDeliveryGoodsDetailEx,
@@ -17,8 +18,9 @@ import {
  * @constructor
  */
 export function QueryDeliveryGoods(req: ErmcpDeliveryGoodsReq): Promise<ErmcpDeliveryGoodsRsp[]> {
-    const areauserid = APP.get('userAccount').memberuserid; // 所属机构id
-    return commonSearch_go('/Ermcp3/QueryDeliveryGoods', { areauserid, ...req }).catch((err) => {
+    const userid = getUserId(); // 所属机构id
+    const usertype = 2;  //  用户类型 2-机构 7-企业成员
+    return commonSearch_go('/Ermcp3/QueryDeliveryGoods', { usertype, userid, ...req }).catch((err) => {
         throw new Error(`查询现货商品: ${err.message}`);
     });
 }
@@ -29,8 +31,9 @@ export function QueryDeliveryGoods(req: ErmcpDeliveryGoodsReq): Promise<ErmcpDel
  * @constructor
  */
 export function QueryGoodsWrstandard(deliverygoodsid: number): Promise<Ermcp3Wrstandard[]> {
-    const areauserid = APP.get('userAccount').memberuserid; // 所属机构id
-    return commonSearch_go('/Ermcp3/QueryGoodsWrstandard', { areauserid, deliverygoodsid }).catch((err) => {
+    const userid = getUserId(); // 所属机构id
+    const usertype = 2; //  用户类型 2-机构 7-企业成员
+    return commonSearch_go('/Ermcp3/QueryGoodsWrstandard', { userid, usertype, deliverygoodsid }).catch((err) => {
         throw new Error(`查询商品品类: ${err.message}`);
     });
 }
@@ -40,8 +43,9 @@ export function QueryGoodsWrstandard(deliverygoodsid: number): Promise<Ermcp3Wrs
  * @constructor
  */
 export function QueryGoodsbrand(): Promise<Ermcp3Brand[]> {
-    const areauserid = APP.get('userAccount').memberuserid; // 所属机构id
-    return commonSearch_go('/Ermcp3/QueryGoodsbrand', { areauserid }).catch((err) => {
+    const userid = getUserId(); // 用户id
+    const usertype = 2;  // 用户类型 2-机构 7-企业成员
+    return commonSearch_go('/Ermcp3/QueryGoodsbrand', { userid, usertype }).catch((err) => {
         throw new Error(`查询商品品牌: ${err.message}`);
     });
 }
@@ -52,9 +56,11 @@ export function QueryGoodsbrand(): Promise<Ermcp3Brand[]> {
  * @constructor
  */
 export function QueryDeliveryGoodsDetail(deliverygoodsid?: number): Promise<ErmcpDeliveryGoodsDetailEx[]> {
-    const areauserid = APP.get('userAccount').memberuserid; // 所属机构id
-    const param = deliverygoodsid ? { areauserid, deliverygoodsid } : { areauserid }
-    return commonSearch_go('/Ermcp3/QueryDeliveryGoodsDetail', param).catch((err) => {
+    const req :DeliveryGoodsDetailReq = {
+        deliverygoodsid: deliverygoodsid,
+        userid: getUserId()
+    }
+    return commonSearch_go('/Ermcp3/QueryDeliveryGoodsDetail', req).catch((err) => {
         throw new Error(`查询现货商品详情: ${err.message}`);
     });
 }
@@ -65,8 +71,9 @@ export function QueryDeliveryGoodsDetail(deliverygoodsid?: number): Promise<Ermc
  * @constructor
  */
 export function QueryGoodsfGroup(excludecfg?: number): Promise<Ermcp3GoodsGroup[]> {
-    const areauserid = APP.get('userAccount').memberuserid; // 所属机构id
-    const param = excludecfg ? { areauserid, excludecfg } : { areauserid }
+    const userid = getUserId(); // 用户id
+    const usertype = 2; // 用户类型 2-机构 7-企业成员
+    const param = excludecfg ? { userid, excludecfg, usertype } : { userid, usertype }
     return commonSearch_go('/Ermcp3/QueryGoodsGroup', param).catch((err) => {
         throw new Error(`查询期货商品组: ${err.message}`);
     });
@@ -91,8 +98,9 @@ export function QueryMiddleGoods(status: number): Promise<ErmcpMiddleGoodsModel[
  * @constructor
  */
 export function QueryMiddleGoodsDetail(middlegoodsid: number): Promise<Ermcp3MiddleGoodsDetailEx[]> {
-    const areauserid = APP.get('userAccount').memberuserid; // 所属机构id
-    return commonSearch_go('/Ermcp3/QueryMiddleGoodsDetail', { areauserid, middlegoodsid }).catch((err) => {
+    const userid = getUserId(); // 用户id
+    const usertype = 2  // 用户类型 2-机构 7-企业成员
+    return commonSearch_go('/Ermcp3/QueryMiddleGoodsDetail', { userid, usertype, middlegoodsid }).catch((err) => {
         throw new Error(`查询套保品种详情(套保品种/商品详情): ${err.message}`);
     });
 }

+ 9 - 0
src/services/go/ermcp/goodsInfo/interface.ts

@@ -65,6 +65,15 @@ export interface Ermcp3Brand {
 }
 
 /**
+ * 查询现货商品请求
+ */
+export interface DeliveryGoodsDetailReq {
+    userid: number;            // 用户id
+    usertype?: number;         // 用户类型 2-机构 7-企业成员
+    deliverygoodsid?: number;  // 现货商品id
+}
+
+/**
  * 查询新货商品详情
  */
 export interface ErmcpDeliveryGoodsDetailEx {

+ 1 - 2
src/services/go/ermcp/sell/index.ts

@@ -14,8 +14,7 @@ import { Ermcp3SellBuyContract, SellBuyContractReq } from '@/services/go/ermcp/p
 export function QueryWareHouse(req: SellBuyContractReq): Promise<Ermcp3SellBuyContract[]> {
     const param = {
         userid: getUserId(),
-        areauserid: APP.get('userAccount').memberuserid, // 所属机构id
-        contracttype: -1, // 销售
+        contracttype: -1, // 销售 合同类型 1-采购, -1-销售
     }
     Object.assign(param, req)
     return commonSearch_go('/Ermcp3/QuerySpotContractBS', param).catch((err) => {

+ 3 - 2
src/services/go/ermcp/spot-contract/index.ts

@@ -2,6 +2,7 @@
 import APP from '@/services';
 import { commonSearch_go } from '@/services/go';
 import { Ermcp3ContractReq, Ermcp3ContractRsp } from '@/services/go/ermcp/spot-contract/interface';
+import {getUserId} from "@/services/bus/account";
 
 /**
  * 查询现货合同 /Ermcp3/QuerySpotContract
@@ -12,9 +13,9 @@ import { Ermcp3ContractReq, Ermcp3ContractRsp } from '@/services/go/ermcp/spot-c
  * @constructor
  */
 export function QuerySpotContract(req: Ermcp3ContractReq): Promise<Ermcp3ContractRsp[]> {
-    const areauserid = APP.get('userAccount').memberuserid; // 所属机构id
+    const userid = getUserId(); // 所属机构id
     // const areauserid = 10000; // 所属机构id
-    return commonSearch_go('/Ermcp3/QuerySpotContract', { areauserid, ...req }).catch((err) => {
+    return commonSearch_go('/Ermcp3/QuerySpotContract', { userid, ...req }).catch((err) => {
         throw new Error(`查询现货合同: ${err.message}`);
     });
 }

+ 0 - 1
src/services/go/ermcp/spot-contract/interface.ts

@@ -3,7 +3,6 @@
  */
 export interface Ermcp3ContractReq {
     querytype: number    //  查询类型 1-未提交 2-待审核 3-履约中 4-已完成
-    userid?: number    //  用户ID
     usertype?: number    //  用户类型 2-机构 7-企业成员
     contractid?: string  //  合同ID(SpotContractId)
 }