index.ts 1.4 KB

1234567891011121314151617181920212223242526272829303132
  1. // 套保计划
  2. import APP from "@/services";
  3. import { getUserId } from '@/services/bus/user';
  4. import { ErmcpHedgePlanReq, HedgePlanOperateReq } from "@/services/proto/hedgeplan/interface";
  5. import { buildProtoReq50, parseProtoRsp50, protoMiddleware } from "@/services/socket/protobuf/buildReq";
  6. import { Callback } from "@/utils/websocket";
  7. import moment from "moment";
  8. import { v4 as uuidv4 } from "uuid";
  9. import { GldErmcpSpotContractOperateReq } from "@/services/proto/spotcontract/interface";
  10. /**
  11. * 套保计划操作请求
  12. * @param param.hedgePlanID Long 套保计划id
  13. * @param param.OperateType Int 操作类型-1:保存草稿2:提交申请3:删除4审核通过5审核拒绝
  14. */
  15. export const hedgePlanReq = (param: ErmcpHedgePlanReq): Promise<any> => {
  16. param.ApplySrc = 2; // 申请来源 - 1:管理端 2:终端
  17. param.TradeDate = moment().format("YYMMDD");
  18. return protoMiddleware<ErmcpHedgePlanReq>(param, 'ErmcpHedgePlanReq', 'ErmcpHedgePlanRsp', 2)
  19. }
  20. /**
  21. * 老的计划操作接口 我只负责撤销 传5则进行撤销 !!!!! 注意
  22. * @param param
  23. */
  24. // export const oldHedgePlanReq = (param: HedgePlanOperateReq): Promise<any> => {
  25. // param.OperateSrc = 2; // 操作来源-1:管理端2:终端
  26. // param.ClientTicket = uuidv4(); // 流水号
  27. // param.Remark = ''
  28. // param.UserID = getUserId()
  29. // return protoMiddleware<HedgePlanOperateReq>(param, 'HedgePlanOperateReq', 'HedgePlanOperateRsp', 2)
  30. // }