Kaynağa Gözat

commit 套保计划

xkwg 4 yıl önce
ebeveyn
işleme
984a7c7208
2 değiştirilmiş dosya ile 53 ekleme ve 4 silme
  1. 15 1
      public/proto/mtp.proto
  2. 38 3
      src/services/proto/hedgeplan/index.ts

+ 15 - 1
public/proto/mtp.proto

@@ -996,7 +996,7 @@ message HedgePlanOperateReq {
 	optional uint64 UserID = 5; // uint64 操作用户ID
 	optional string Remark = 6; // string 备注
 	optional string ClientTicket = 7; // string 客户端流水号
-	optional ErmcpMI1.HedgePlanInfo Info = 8; // HedgePlanInfo 套保计划信息
+	optional HedgePlanInfo Info = 8; // HedgePlanInfo 套保计划信息
 }
 // 套保计划操作响应 0 18 3
 message HedgePlanOperateRsp {
@@ -1009,4 +1009,18 @@ message HedgePlanOperateRsp {
 	optional string ClientTicket = 7; // string 客户端流水号
 }
 
+// 套保计划信息 0 18 1
+message HedgePlanInfo {
+	optional string HedgePlanNo = 1; // string 套保计划编号
+	optional int32 ContractType = 2; // int32 计划类型-1:采购-1:销售
+	optional uint32 AreaUserID = 3; // uint32 机构ID
+	optional uint32 DeliveryGoodsID = 4; // uint32 现货品种ID
+	optional uint32 WrStandardID = 5; // uint32 现货商品ID
+	optional uint32 ProductType = 6; // uint32 产品类型-1:标准仓单2:等标3:非标
+	optional string SpotGoodsDesc = 7; // string 商品型号
+	optional double PlanQty = 8; // double 计划数量
+	optional double ConvertFactor = 9; // double 标仓系数
+	optional string PlanTime = 10; // string 计划时间
+}
+
 

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

@@ -2,8 +2,9 @@
 import {buildProtoReq50, parseProtoRsp50} from "@/services/socket/protobuf/buildReq";
 import APP from "@/services";
 import {Callback} from "@/utils/websocket";
-import {ErmcpHedgePlanReq} from "@/services/proto/hedgeplan/interface";
-import {getSelectedAccountId} from "@/services/bus/account";
+import {ErmcpHedgePlanReq, HedgePlanOperateReq} from "@/services/proto/hedgeplan/interface";
+import {getSelectedAccountId, getUserId} from "@/services/bus/account";
+import {v4 as uuidv4} from "uuid";
 
 /**
  * 套保计划操作请求
@@ -11,7 +12,7 @@ import {getSelectedAccountId} from "@/services/bus/account";
  * @param param.OperateType Int 操作类型-1:保存草稿2:提交申请3:审核通过4:审核拒绝5:撤回
  */
 export const hedgePlanReq = (param: ErmcpHedgePlanReq): Promise<any> => {
-    param.ApplySrc = 1; // 申请来源 - 1:管理端 2:终端
+    param.ApplySrc = 2; // 申请来源 - 1:管理端 2:终端
 
     return new Promise((resolve, reject) => {
         const params = {
@@ -39,3 +40,37 @@ export const hedgePlanReq = (param: ErmcpHedgePlanReq): Promise<any> => {
     });
 }
 
+/**
+ * 老的计划操作接口 我只负责删除 操作类型-1:保存草稿2:提交申请3:删除4审核通过5审核拒绝
+ * @param param
+ */
+export const oldHedgePlanReq = (param: HedgePlanOperateReq): Promise<any> => {
+    param.OperateSrc = 2; // 操作来源-1:管理端2:终端
+    param.ClientTicket = uuidv4(); // 流水号
+    param.UserID = getUserId()
+
+    return new Promise((resolve, reject) => {
+        const params = {
+            protobufName: 'HedgePlanOperateReq',
+            funCodeName: 'HedgePlanOperateReq',
+            reqParams:  param,
+            msgHeadParams: {
+                AccountID: getSelectedAccountId(),
+                MarketID: 18,
+                GoodsID: 0,
+            }
+        };
+        const package50 = buildProtoReq50(params);
+        APP.sendTradingServer(package50, undefined, {
+            onSuccess: (res) => {
+                const { isSuccess, result } = parseProtoRsp50(res, 'HedgePlanOperateRsp');
+                if (isSuccess) {
+                    resolve(result);
+                } else {
+                    reject(result);
+                }
+            },
+            onFail: (err) => reject(err.message),
+        } as Callback);
+    });
+}