Browse Source

commit 现货合同接口处理

xkwg 4 năm trước cách đây
mục cha
commit
402641920e

+ 15 - 4
src/services/proto/spotcontract/index.ts

@@ -1,7 +1,9 @@
 import {buildProtoReq50, parseProtoRsp50} from "@/services/socket/protobuf/buildReq";
 import APP from "@/services";
 import {Callback} from "@/utils/websocket";
-import {GldErmcpSpotContractOperateReq} from "@/services/proto/spotcontract/interface";
+import {GldErmcpSpotContractOperateReq, SpotContractStatusModifyReq} from "@/services/proto/spotcontract/interface";
+import {getSelectedAccountId, getUserId} from "@/services/bus/account";
+import { v4 as uuidv4 } from 'uuid';
 
 /**(重点提醒 这里属于管理端接口,仅用于新增)以上来自android代码  回头需要确认
  * 新增 / 修改采购合同报文 (很多修改合同操作也在这)
@@ -9,13 +11,22 @@ import {GldErmcpSpotContractOperateReq} from "@/services/proto/spotcontract/inte
  * @param param
  */
 export const orderContract = (param: GldErmcpSpotContractOperateReq): Promise<any> => {
+
+    const OperateSrc: number = 2; // uint32 操作来源-1:管理端2:终端
+    const ClientTicket: string = uuidv4();  // 客户端流水号
+    const UserID: number = getUserId(); // 用户id
+
+    const reqParams = {
+        ...param , OperateSrc, ClientTicket, UserID
+    }
+
     return new Promise((resolve, reject) => {
         const params = {
             protobufName: 'GldErmcpSpotContractOperateReq',
             funCodeName: 'GldErmcpSpotContractOperateReq',
-            reqParams: param,
+            reqParams: reqParams,
             msgHeadParams: {
-                AccountID: param.accountid,
+                AccountID: getSelectedAccountId(),
                 MarketID: 18,
                 GoodsID: 0,
             }
@@ -33,4 +44,4 @@ export const orderContract = (param: GldErmcpSpotContractOperateReq): Promise<an
             onFail: (err) => reject(err.message),
         } as Callback);
     });
-}
+}

+ 9 - 4
src/services/proto/spotcontract/interface.ts

@@ -1,14 +1,19 @@
 // 现货合同操作请求 0 29 167
 export interface GldErmcpSpotContractOperateReq {
-    accountid: number  // header
     SpotContractID: number // uint64 现货合同ID(602+Unix秒时间戳(10位)+xxxxxx)
     OperateType : number // uint32 操作类型-1:保存草稿2:提交申请3:审核通过4:审核拒绝5:撤回6:正常完结7:异常终止
-    OperateSrc : number // uint32 操作来源-1:管理端2:终端
-    UserID: number // uint64 操作用户ID
     Remark: string // string 操作备注
-    ClientTicket: string // string 客户端流水号
     Info: GldSpotContractInfo // GldSpotContractInfo 现货合同信息
 }
+
+/**
+ * 修改现货合同状态
+ */
+export interface SpotContractStatusModifyReq {
+    SpotContractID: number // uint64 现货合同ID(602+Unix秒时间戳(10位)+xxxxxx)
+    OperateType : number // uint32 操作类型-1:保存草稿2:提交申请3:审核通过4:审核拒绝5:撤回6:正常完结7:异常终止
+}
+
 // 现货合同操作响应 0 29 168
 export interface GldErmcpSpotContractOperateRsp {
     RetCode: number // int32 返回码