Sfoglia il codice sorgente

commit 两个proto接口 现货

xkwg 4 anni fa
parent
commit
922b447987

+ 37 - 1
public/proto/mtp.proto

@@ -1006,6 +1006,7 @@ message HedgePlanOperateReq {
 	optional string ClientTicket = 7; // string 客户端流水号
 	optional HedgePlanInfo Info = 8; // HedgePlanInfo 套保计划信息
 }
+
 // 套保计划操作响应 0 18 3
 message HedgePlanOperateRsp {
 	optional MessageHead Header = 1; // MessageHead 消息头
@@ -1124,6 +1125,41 @@ message ERMCPAreaInOutStockApplyRsp {
 	optional uint64 InOutApplyID = 4; // uint64 申请ID
 }
 
+// 套保品种修改请求 0 29 133
+message ErmsMiddelGoodsEditReq {
+    optional MessageHead Header = 1; // MessageHead
+    optional uint64 middlegoodsid = 2; // uint64 套保品种ID
+    optional int32 goodsunitid = 3; // int32 单位ID
+    optional uint64 relatedgoodsid = 4; // uint64 关联交易商品ID
+    optional double evaluateratio = 5; // double 估价系数
+    optional int32 qtydecimalplace = 6; // int32 数量小数位
+    optional uint64 modifierid = 7; // uint64 修改人
+    optional int32 relatedgoodstype = 8; // int32 关联商品类型 - 1:期货合约 2:现货品种
+    optional double needhedgeratio = 9; // double 套保比率
+    optional uint64 areauserid = 10; // uint64 机构用户ID
+    optional uint64 goodsgroupid = 11; // uint64 关联期货品种ID
+    optional string remark = 12; // string 备注
+}
+// 套保品种修改响应 0 29 134
+message ErmsMiddelGoodsEditRsp {
+    optional MessageHead Header = 1; // MessageHead 消息头
+    optional int32 RetCode = 2; // int32 返回码
+    optional string RetDesc = 3; // string 描述信息
+    optional uint64 middlegoodsid = 4; // uint64 套保品种ID
+}
 
-
+// 现货品种停用请求 0 29 129
+message DeliveryGoodsCancelReq {
+    optional MessageHead Header = 1; // MessageHead
+    optional uint64 wrstandardid = 2; // uint64 现货商品ID
+    optional int32 isvalid = 3; // int32 是否有效 - 0:无效 1:有效
+}
+// 现货品种停用响应 0 29 130
+message DeliveryGoodsCancelRsp {
+    optional MessageHead Header = 1; // MessageHead 消息头
+    optional int32 RetCode = 2; // int32 返回码
+    optional string RetDesc = 3; // string 描述信息
+    optional uint64 wrstandardid = 4; // uint64 现货商品ID
+    optional uint64 deliverygoodsid = 5; // uint64 现货品种ID
+}
 

+ 5 - 0
src/services/funcode/index.ts

@@ -109,4 +109,9 @@ export const funCode: Code = {
     // 库存审核 - 审核通过
     AreaInOutApplyAuditPassReq: 1179658,  /// 机构出入库申请审核通过请求(1179658)
     AreaInOutApplyAuditPassRsp: 1179659,  /// 机构出入库申请审核通过响应(1179659)
+
+    // 套保品种修改
+    ErmsMiddelGoodsEditReq: 1900677, // 套保品种修改请求
+    ErmsMiddelGoodsEditRsp: 1900678, // 套保品种修改响应
+
 };

+ 79 - 1
src/services/proto/delivery/index.ts

@@ -1,7 +1,11 @@
 import APP from "@/services";
 import { getSelectedAccountId, getUserId } from '@/services/bus/account';
 import { getLongTypeLoginID } from '@/services/bus/login';
-import { DeliveryGoodsApplyReq } from "@/services/proto/delivery/interface";
+import {
+    DeliveryGoodsApplyReq,
+    DeliveryGoodsCancelReq,
+    ErmsMiddelGoodsEditReq
+} from "@/services/proto/delivery/interface";
 import { buildProtoReq50, parseProtoRsp50 } from "@/services/socket/protobuf/buildReq";
 import { Callback } from "@/utils/websocket";
 
@@ -39,4 +43,78 @@ export const addDeliveryGoodsApply = (param: DeliveryGoodsApplyReq): Promise<any
             onFail: (err) => reject(err.message),
         } as Callback);
     });
+}
+
+/**
+ * 修改套保品种请求 ErmsMiddelGoodsEditReq 只能修改比率 但是其它参数也必须传
+ */
+export const ermsMiddelGoodsEdit = (param: ErmsMiddelGoodsEditReq): Promise<any> => {
+
+    param.areauserid = APP.get('userInfo').MemberUserid // 机构用户id
+
+    return new Promise((resolve, reject) => {
+        const req = {
+            version: "3.2",
+            userid: getUserId(),
+            loginid: getLongTypeLoginID() ,
+        };
+        const params = {
+            protobufName: 'ErmsMiddelGoodsEditReq',
+            funCodeName: 'ErmsMiddelGoodsEditReq',
+            reqParams: Object.assign(req, param),
+            msgHeadParams: {
+                AccountID: getSelectedAccountId() === null ? 0 : getSelectedAccountId(),
+                MarketID: 18,   // 目前写死
+                GoodsID: 0, // 目前写死
+            }
+        };
+        const package50 = buildProtoReq50(params);
+        APP.sendTradingServer(package50, undefined, {
+            onSuccess: (res) => {
+                const { isSuccess, result } = parseProtoRsp50(res, 'ErmsMiddelGoodsEditRsp');
+                if (isSuccess) {
+                    resolve(result);
+                } else {
+                    reject(result);
+                }
+            },
+            onFail: (err) => reject(err.message),
+        } as Callback);
+    });
+}
+
+/**
+ * 现货品种停用请求
+ */
+export const deliveryGoodsCancel = (param: DeliveryGoodsCancelReq): Promise<any> => {
+
+    return new Promise((resolve, reject) => {
+        const req = {
+            version: "3.2",
+            userid: getUserId(),
+            loginid: getLongTypeLoginID() ,
+        };
+        const params = {
+            protobufName: 'DeliveryGoodsCancelReq',
+            funCodeName: 'DeliveryGoodsCancelReq',
+            reqParams: Object.assign(req, param),
+            msgHeadParams: {
+                AccountID: getSelectedAccountId() === null ? 0 : getSelectedAccountId(),
+                MarketID: 18,   // 目前写死
+                GoodsID: 0, // 目前写死
+            }
+        };
+        const package50 = buildProtoReq50(params);
+        APP.sendTradingServer(package50, undefined, {
+            onSuccess: (res) => {
+                const { isSuccess, result } = parseProtoRsp50(res, 'DeliveryGoodsCancelRsp');
+                if (isSuccess) {
+                    resolve(result);
+                } else {
+                    reject(result);
+                }
+            },
+            onFail: (err) => reject(err.message),
+        } as Callback);
+    });
 }

+ 34 - 0
src/services/proto/delivery/interface.ts

@@ -31,4 +31,38 @@ export interface WRSConvertDetailEx {
     middlegoodsid: number // uint64 套保品种ID(接口为3.1及以下版本时传套保品种ID,否则传期货品种ID)
     unitid: number // uint64 单位ID
     convertratio: number // double 套保系数
+}
+
+// 套保品种修改请求 0 29 133
+export interface ErmsMiddelGoodsEditReq {
+    middlegoodsid: number; // uint64 套保品种ID
+    goodsunitid: number; // int32 单位ID
+    relatedgoodsid: number; // uint64 关联交易商品ID
+    evaluateratio: number; // double 估价系数
+    qtydecimalplace: number; // int32 数量小数位
+    modifierid: number; // uint64 修改人
+    relatedgoodstype: number; // int32 关联商品类型 - 1:期货合约 2:现货品种
+    needhedgeratio: number; // double 套保比率
+    areauserid?: number; // uint64 机构用户ID
+    goodsgroupid: number; // uint64 关联期货品种ID
+    remark: string; // string 备注
+}
+// 套保品种修改响应 0 29 134
+export interface ErmsMiddelGoodsEditRsp {
+    RetCode: number; // int32 返回码
+    RetDesc: string; // string 描述信息
+    middlegoodsid: number; // uint64 套保品种ID
+}
+
+// 现货品种停用请求 0 29 129
+export interface DeliveryGoodsCancelReq {
+    wrstandardid: string; // uint64 现货商品ID
+    isvalid: number; // int32 是否有效 - 0:无效 1:有效
+}
+// 现货品种停用响应 0 29 130
+export interface DeliveryGoodsCancelRsp {
+    RetCode: string; // int32 返回码
+    RetDesc: string; // string 描述信息
+    wrstandardid: number; // uint64 现货商品ID
+    deliverygoodsid: number; // uint64 现货品种ID
 }

+ 3 - 2
src/services/proto/hedgeplan/index.ts

@@ -1,7 +1,7 @@
 // 套保计划
 import APP from "@/services";
 import { getSelectedAccountId, getUserId } from "@/services/bus/account";
-import { ErmcpHedgePlanReq } from "@/services/proto/hedgeplan/interface";
+import {ErmcpHedgePlanReq, HedgePlanOperateReq} from "@/services/proto/hedgeplan/interface";
 import { buildProtoReq50, parseProtoRsp50 } from "@/services/socket/protobuf/buildReq";
 import { Callback } from "@/utils/websocket";
 import moment from "moment";
@@ -46,9 +46,10 @@ export const hedgePlanReq = (param: ErmcpHedgePlanReq): Promise<any> => {
  * 老的计划操作接口 我只负责撤销 传5则进行撤销 !!!!! 注意
  * @param param
  */
-export const oldHedgePlanReq = (param: any): Promise<any> => {
+export const oldHedgePlanReq = (param: HedgePlanOperateReq): Promise<any> => {
     param.OperateSrc = 2; // 操作来源-1:管理端2:终端
     param.ClientTicket = uuidv4(); // 流水号
+    param.Remark = ''
     param.UserID = getUserId()
     return new Promise((resolve, reject) => {
         const params = {

+ 3 - 1
src/views/information/goods/components/hedgingDetail/index.vue

@@ -1,5 +1,5 @@
 <template>
-  <!-- 修改客户资料 -->
+  <!-- 套保品种详情 -->
   <a-modal class="commonModal modify-custom"
            title="详情"
            v-if="visible"
@@ -8,6 +8,8 @@
            :maskClosable="maskClosableFlag"
            @cancel="cancel"
            width="890px">
+
+
     <template #footer>
       <a-button key="submit"
                 type="primary"

+ 1 - 1
src/views/information/goods/components/spotDetail/index.vue

@@ -1,5 +1,5 @@
 <template>
-  <!-- 修改客户资料 -->
+  <!-- 现货品种详情 -->
   <a-modal class="commonModal modify-custom"
            title="详情"
            v-if="visible"