|
|
@@ -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);
|
|
|
+ });
|
|
|
+}
|