Parcourir la source

commit 接口修改

xkwg il y a 4 ans
Parent
commit
de94347c98

+ 23 - 1
public/proto/mtp.proto

@@ -898,7 +898,7 @@ message ErmcpHedgePlanReq {
 		optional int32 ApplySrc = 13; // int32 申请来源 - 1:管理端 2:终端
 		optional uint64 ApplyId = 14; // uint64 申请人
 		optional string Remark = 15; // string 计划备注
-	optional int32 OperateType = 16; // int32 操作类型-1:保存草稿2:提交申请
+	optional int32 OperateType = 16; // uint32 操作类型-1:保存草稿2:提交申请3:删除4审核通过5审核拒绝
 }
 // 套保计划响应 0 29 165
 message ErmcpHedgePlanRsp {
@@ -987,4 +987,26 @@ message SpotContractInfo {
 	optional uint32 RelatedUserID = 37; // uint32 关联用户ID
 }
 
+// 套保计划操作请求 0 18 2
+message HedgePlanOperateReq {
+	optional MessageHead Header = 1; // MessageHead
+	optional uint64 HedgePlanID = 2; // uint64 套保计划ID(601+Unix秒时间戳(10位)+xxxxxx)
+	optional uint32 OperateType = 3; // uint32 操作类型-1:保存草稿2:提交申请3:审核通过4:审核拒绝5:撤回
+	optional uint32 OperateSrc = 4; // uint32 操作来源-1:管理端2:终端
+	optional uint64 UserID = 5; // uint64 操作用户ID
+	optional string Remark = 6; // string 备注
+	optional string ClientTicket = 7; // string 客户端流水号
+	optional ErmcpMI1.HedgePlanInfo Info = 8; // HedgePlanInfo 套保计划信息
+}
+// 套保计划操作响应 0 18 3
+message HedgePlanOperateRsp {
+	optional MessageHead Header = 1; // MessageHead 消息头
+	optional int32 RetCode = 2; // int32 返回码
+	optional string RetDesc = 3; // string 描述信息
+	optional uint64 HedgePlanID = 4; // uint64 套保计划ID(601+Unix秒时间戳(10位)+xxxxxx)
+	optional uint32 OperateType = 5; // uint32 操作类型-1:保存草稿2:提交申请3:审核通过4:审核拒绝5:撤回
+	optional uint32 OperateSrc = 6; // uint32 操作来源-1:管理端2:终端
+	optional string ClientTicket = 7; // string 客户端流水号
+}
+
 

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

@@ -88,6 +88,9 @@ export const funCode: Code = {
     // 套保计划 -- 新增套保计划
     ErmcpHedgePlanReq: 1900708,  /// 套保计划操作请求(1179650)
     ErmcpHedgePlanRsp: 1900709,  /// 套保计划操作响应(1179651)
+    // 套保计划 -- (old接口)
+    HedgePlanOperateReq: 1179650, /// 套保计划操作请求(1179650)
+    HedgePlanOperateRsp: 1179651, /// 套保计划操作响应(1179651)
 
     // 信息 - 客户资料 - 审核
     UserInfoCheckMangeReq: 1900666,    /// 客户信息审核通过请求

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

@@ -37,4 +37,5 @@ export const hedgePlanReq = (param: ErmcpHedgePlanReq): Promise<any> => {
             onFail: (err) => reject(err.message),
         } as Callback);
     });
-}
+}
+

+ 3 - 2
src/views/information/spot-contract/components/add/index.vue

@@ -427,7 +427,8 @@ export default defineComponent({
     },
     setup(props,context) {
         const { visible, cancel } = closeModal('spot_contract_btn_add');
-        const { loading, sendReq } = addContractReq();
+        const { sendReq } = addContractReq();
+        const loading = ref<boolean>(false);
 
         // 表单
         const formRef = ref();
@@ -490,7 +491,7 @@ export default defineComponent({
                     }
                     console.log('values', formState);
 
-                    sendReq(param, OperateType)
+                    sendReq(param, loading)
                         .then((res) => {
                             context.emit('refresh');
                             cancel();

+ 18 - 7
src/views/information/spot-contract/components/add/setup.ts

@@ -5,13 +5,18 @@ import { QueryCustomInfo } from '@/services/go/ermcp/customInfo';
 import { QueryCustomInfoType } from '@/services/go/ermcp/customInfo/interface';
 import { QueryDeliveryGoods, QueryDeliveryGoodsDetail } from '@/services/go/ermcp/goodsInfo';
 import { Ermcp3Brand, Ermcp3Wrstandard, ErmcpDeliveryGoodsRsp } from '@/services/go/ermcp/goodsInfo/interface';
-import { GldSpotContractInfo } from "@/services/proto/spotcontract/interface";
-import { changeOrderContract } from "@/views/information/spot-contract/components/setup";
+import {
+    GldErmcpSpotContractOperateReq,
+    GldSpotContractInfo,
+    SpotContractOperateReq
+} from "@/services/proto/spotcontract/interface";
+import { orderContractControl } from "@/views/information/spot-contract/components/setup";
 import { message } from 'ant-design-vue';
 import { RuleObject } from 'ant-design-vue/lib/form/interface';
 import moment, { Moment } from 'moment';
-import { reactive, ref, UnwrapRef } from 'vue';
+import {reactive, Ref, ref, UnwrapRef} from 'vue';
 import { FormState } from "./interface";
+import Long from "long";
 
 export function handleFromState() {
     const formState: UnwrapRef<FormState> = reactive({
@@ -56,12 +61,12 @@ export function handleFromState() {
  * 新增现货合同 表单提交
  */
 export function addContractReq() {
-    const { loading, orderContractState } = changeOrderContract()
     /**
      * @param form 表单信息
      *  @Param type  1: 保存草稿  2: 提交申请
      */
-    function sendReq(form: FormState, type: number): Promise<string> {
+    function sendReq(form: FormState, loading: Ref<boolean>): Promise<string> {
+        loading.value = true
         const info: GldSpotContractInfo = {
             UserID: APP.get('userAccount').memberuserid,//  机构ID
             ProductType: 1, //                              产品类型 产品类型-1:标准仓单2:等标3:非标
@@ -101,7 +106,13 @@ export function addContractReq() {
             // TradeUserID: form.TradeUserID, //           交易员ID
             // SaleUserID: form.SaleUserID,//             业务员id
         }
-        return orderContractState('0', type, info)
+        const params : GldErmcpSpotContractOperateReq = {
+            SpotContractID: 0,
+            OperateType: 1,
+            Remark: '',
+            Info: info,
+        }
+        return orderContractControl(params, loading)
             .then(res => {
                 return Promise.resolve(res);
             })
@@ -110,7 +121,7 @@ export function addContractReq() {
             })
     }
 
-    return { loading, sendReq }
+    return { sendReq }
 }
 
 /**

+ 10 - 3
src/views/information/spot-contract/components/cancel/index.vue

@@ -188,7 +188,9 @@ import {
     getPriceTypeName
 } from "@/views/information/spot-contract/setup";
 import {message, Modal} from "ant-design-vue";
-import { OrderContractControl} from "@/views/information/spot-contract/components/setup";
+import { orderContractOperateControl } from "@/views/information/spot-contract/components/setup";
+import {SpotContractOperateReq} from "@/services/proto/spotcontract/interface";
+import Long from "long";
 
 export default defineComponent({
     name: 'spot-contract-detail',
@@ -201,7 +203,7 @@ export default defineComponent({
     },
     setup(props, context) {
         const { visible, cancel } = closeModal('spot_contract_btn_cancel');
-        const {loading, orderContractState} = OrderContractControl()
+        const loading = ref<boolean>(false);
         const maskClosableFlag = ref<boolean>(false);
         function submit() {
             Modal.confirm({
@@ -209,8 +211,13 @@ export default defineComponent({
                 okText: '确认撤销',
                 cancelText: '取消',
                 onOk() {
+                    const params : SpotContractOperateReq = {
+                        SpotContractID: Long.fromString(props.selectedRow.spotcontractid),
+                        OperateType: 5,
+                        Remark: '',
+                    }
                     // 撤销合同
-                    orderContractState(props.selectedRow.spotcontractid, 5)
+                    orderContractOperateControl(params, loading)
                         .then(res => {
                             // 通知上层  刷新数据
                             context.emit('refresh');

+ 16 - 5
src/views/information/spot-contract/components/check/index.vue

@@ -229,9 +229,11 @@ import { closeModal } from '@/common/setup/modal/index';
 import { getBizTypeName, getContractStatusName, getContractTypeName, getPriceTypeName } from '@/views/information/spot-contract/setup';
 import { Ermcp3ContractRsp } from '@/services/go/ermcp/spot-contract/interface';
 import { formatTime, formatValue, initData } from '@/common/methods';
-import { changeOrderContract, OrderContractControl } from '@/views/information/spot-contract/components/setup';
+import { orderContractControl, orderContractOperateControl} from '@/views/information/spot-contract/components/setup';
 import { Modal } from 'ant-design-vue';
 import { handleAccountManager, handleForm } from './setup';
+import {GldErmcpSpotContractOperateReq, SpotContractOperateReq} from "@/services/proto/spotcontract/interface";
+import Long from "long";
 
 export default defineComponent({
     name: 'spot-contract-detail',
@@ -247,7 +249,7 @@ export default defineComponent({
         // 账号列表: 交易用户 业务员 跟单员
         const { traderList, businesserList, merchandiserList, getRoleList, getBusinesserList } = handleAccountManager();
 
-        const { loading, orderContractState } = changeOrderContract();
+        const loading = ref<boolean>(false);
         // 表单
         const { rules, formState, formRef } = handleForm();
 
@@ -258,8 +260,13 @@ export default defineComponent({
                 okText: '确认审核通过',
                 cancelText: '取消',
                 onOk() {
+                    const reqs: GldErmcpSpotContractOperateReq = {
+                        SpotContractID: Long.fromString(props.selectedRow.spotcontractid),
+                        OperateType: 4,
+                        Remark: '',
+                    }
                     // 审核通过
-                    orderContractState(props.selectedRow.spotcontractid, 4)
+                    orderContractControl(reqs, loading)
                         .then((res) => {
                             cancel();
                             context.emit('refresh');
@@ -277,9 +284,13 @@ export default defineComponent({
                 okText: '确认审核拒绝',
                 cancelText: '取消',
                 onOk() {
+                    const reqs: SpotContractOperateReq = {
+                        SpotContractID: Long.fromString(props.selectedRow.spotcontractid),
+                        OperateType: 4,
+                        Remark: '',
+                    }
                     // 审核拒绝
-                    OrderContractControl()
-                        .orderContractState(props.selectedRow.spotcontractid, 4)
+                    orderContractOperateControl(reqs, loading)
                         .then((res) => {
                             cancel();
                             context.emit('refresh');

+ 10 - 3
src/views/information/spot-contract/components/delete/index.vue

@@ -188,7 +188,9 @@ import {
     getPriceTypeName
 } from "@/views/information/spot-contract/setup";
 import {message, Modal} from "ant-design-vue";
-import {changeOrderContract, OrderContractControl} from "@/views/information/spot-contract/components/setup";
+import {orderContractControl} from "@/views/information/spot-contract/components/setup";
+import {GldErmcpSpotContractOperateReq} from "@/services/proto/spotcontract/interface";
+import Long from "long";
 
 export default defineComponent({
     name: 'delete-spot-contract',
@@ -201,7 +203,7 @@ export default defineComponent({
     },
     setup(props, context) {
         const { visible, cancel } = closeModal('spot_contract_btn_delete');
-        const  { loading, orderContractState } = changeOrderContract()
+        const loading = ref<boolean>(false);
         const maskClosableFlag = ref<boolean>(false);
         function submit() {
             Modal.confirm({
@@ -209,8 +211,13 @@ export default defineComponent({
                 okText: '确认删除',
                 cancelText: '取消',
                 onOk() {
+                    let params: GldErmcpSpotContractOperateReq = {
+                        SpotContractID: Long.fromString(props.selectedRow.spotcontractid),
+                        OperateType: 3,
+                        Remark: "",
+                    }
                     // 删除客户资料
-                    orderContractState(props.selectedRow.spotcontractid, 3)
+                    orderContractControl(params, loading)
                         .then(res => {
                             // 通知上层  刷新数据
                             context.emit('refresh');

+ 10 - 4
src/views/information/spot-contract/components/finish/index.vue

@@ -187,8 +187,10 @@ import {
     getPriceTypeName
 } from "@/views/information/spot-contract/setup";
 import {Ermcp3ContractRsp} from "@/services/go/ermcp/spot-contract/interface";
-import { OrderContractControl} from "@/views/information/spot-contract/components/setup";
+import {orderContractOperateControl} from "@/views/information/spot-contract/components/setup";
 import {message, Modal} from "ant-design-vue";
+import {SpotContractOperateReq} from "@/services/proto/spotcontract/interface";
+import Long from "long";
 
 export default defineComponent({
     name: 'spot-contract-detail',
@@ -201,17 +203,21 @@ export default defineComponent({
     },
     setup(props, context) {
         const { visible, cancel } = closeModal('spot_contract_btn_finish');
-        const {loading, orderContractState} = OrderContractControl()
         const maskClosableFlag = ref<boolean>(false);
+        const loading = ref<boolean>(false);
         function submit() {
-            loading.value = true;
             Modal.confirm({
                 title: '是否确认完结',
                 okText: '确认完结',
                 cancelText: '取消',
                 onOk() {
+                    const params: SpotContractOperateReq = {
+                        SpotContractID: Long.fromString(props.selectedRow.spotcontractid),
+                        OperateType: 6,
+                        Remark: '',
+                    }
                     // 完结合同
-                    orderContractState(props.selectedRow.spotcontractid, 6)
+                    orderContractOperateControl(params, loading)
                         .then(res => {
                             // 通知上层  刷新数据
                             context.emit('refresh');

+ 2 - 10
src/views/information/spot-contract/components/setup.ts

@@ -8,17 +8,13 @@ import { ContractStateSign, GldContractStateSign } from "@/views/information/spo
 import Long from 'long';
 import { Ref } from "vue";
 
-
-/**
- * 
- */
 /**
  * 合同操作相关 针对操作类型 1: 保存草稿  2: 提交申请 3: 删除成功 4:审核通过
  * @param reqs GldErmcpSpotContractOperateReq
  * @param loading 
  * @returns 
  */
-export function orderContractState1(reqs: GldErmcpSpotContractOperateReq, loading: Ref<boolean>): Promise<string> {
+export function orderContractControl(reqs: GldErmcpSpotContractOperateReq, loading: Ref<boolean>): Promise<string> {
     //处理 合同id
     if (reqs.SpotContractID) {
         reqs.SpotContractID = Long.fromString(reqs.SpotContractID)
@@ -34,16 +30,12 @@ export function orderContractState1(reqs: GldErmcpSpotContractOperateReq, loadin
 }
 
 /**
- * 
- * 4:审核拒绝 6:正常完结 5:撤销
- */
-/**
  * 修改合同类型 针对操作类型 4:审核拒绝 6:正常完结 5:撤销
  * @param reqs 
  * @param loading 
  * @returns 
  */
-export function orderContractState2(reqs: SpotContractOperateReq, loading: Ref<boolean>): Promise<string> {
+export function orderContractOperateControl(reqs: SpotContractOperateReq, loading: Ref<boolean>): Promise<string> {
     // loading 效果
     loading.value = true
     // 获取提示信息