Ver Fonte

Merge branch 'master' of http://47.101.159.18:3000/Muchinfo/MTP2.0_WEB

marymelisa há 4 anos atrás
pai
commit
2e0663920a

+ 37 - 1
public/proto/mtp.proto

@@ -1006,6 +1006,7 @@ message HedgePlanOperateReq {
 	optional string ClientTicket = 7; // string 客户端流水号
 	optional HedgePlanInfo Info = 8; // HedgePlanInfo 套保计划信息
 }
+
 // 套保计划操作响应 0 18 3
 message HedgePlanOperateRsp {
 	optional MessageHead Header = 1; // MessageHead 消息头
@@ -1124,6 +1125,41 @@ message ERMCPAreaInOutStockApplyRsp {
 	optional uint64 InOutApplyID = 4; // uint64 申请ID
 }
 
+// 套保品种修改请求 0 29 133
+message ErmsMiddelGoodsEditReq {
+    optional MessageHead Header = 1; // MessageHead
+    optional uint64 middlegoodsid = 2; // uint64 套保品种ID
+    optional int32 goodsunitid = 3; // int32 单位ID
+    optional uint64 relatedgoodsid = 4; // uint64 关联交易商品ID
+    optional double evaluateratio = 5; // double 估价系数
+    optional int32 qtydecimalplace = 6; // int32 数量小数位
+    optional uint64 modifierid = 7; // uint64 修改人
+    optional int32 relatedgoodstype = 8; // int32 关联商品类型 - 1:期货合约 2:现货品种
+    optional double needhedgeratio = 9; // double 套保比率
+    optional uint64 areauserid = 10; // uint64 机构用户ID
+    optional uint64 goodsgroupid = 11; // uint64 关联期货品种ID
+    optional string remark = 12; // string 备注
+}
+// 套保品种修改响应 0 29 134
+message ErmsMiddelGoodsEditRsp {
+    optional MessageHead Header = 1; // MessageHead 消息头
+    optional int32 RetCode = 2; // int32 返回码
+    optional string RetDesc = 3; // string 描述信息
+    optional uint64 middlegoodsid = 4; // uint64 套保品种ID
+}
 
-
+// 现货品种停用请求 0 29 129
+message DeliveryGoodsCancelReq {
+    optional MessageHead Header = 1; // MessageHead
+    optional uint64 wrstandardid = 2; // uint64 现货商品ID
+    optional int32 isvalid = 3; // int32 是否有效 - 0:无效 1:有效
+}
+// 现货品种停用响应 0 29 130
+message DeliveryGoodsCancelRsp {
+    optional MessageHead Header = 1; // MessageHead 消息头
+    optional int32 RetCode = 2; // int32 返回码
+    optional string RetDesc = 3; // string 描述信息
+    optional uint64 wrstandardid = 4; // uint64 现货商品ID
+    optional uint64 deliverygoodsid = 5; // uint64 现货品种ID
+}
 

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

@@ -109,4 +109,9 @@ export const funCode: Code = {
     // 库存审核 - 审核通过
     AreaInOutApplyAuditPassReq: 1179658,  /// 机构出入库申请审核通过请求(1179658)
     AreaInOutApplyAuditPassRsp: 1179659,  /// 机构出入库申请审核通过响应(1179659)
+
+    // 套保品种修改
+    ErmsMiddelGoodsEditReq: 1900677, // 套保品种修改请求
+    ErmsMiddelGoodsEditRsp: 1900678, // 套保品种修改响应
+
 };

+ 79 - 1
src/services/proto/delivery/index.ts

@@ -1,7 +1,11 @@
 import APP from "@/services";
 import { getSelectedAccountId, getUserId } from '@/services/bus/account';
 import { getLongTypeLoginID } from '@/services/bus/login';
-import { DeliveryGoodsApplyReq } from "@/services/proto/delivery/interface";
+import {
+    DeliveryGoodsApplyReq,
+    DeliveryGoodsCancelReq,
+    ErmsMiddelGoodsEditReq
+} from "@/services/proto/delivery/interface";
 import { buildProtoReq50, parseProtoRsp50 } from "@/services/socket/protobuf/buildReq";
 import { Callback } from "@/utils/websocket";
 
@@ -39,4 +43,78 @@ export const addDeliveryGoodsApply = (param: DeliveryGoodsApplyReq): Promise<any
             onFail: (err) => reject(err.message),
         } as Callback);
     });
+}
+
+/**
+ * 修改套保品种请求 ErmsMiddelGoodsEditReq 只能修改比率 但是其它参数也必须传
+ */
+export const ermsMiddelGoodsEdit = (param: ErmsMiddelGoodsEditReq): Promise<any> => {
+
+    param.areauserid = APP.get('userInfo').MemberUserid // 机构用户id
+
+    return new Promise((resolve, reject) => {
+        const req = {
+            version: "3.2",
+            userid: getUserId(),
+            loginid: getLongTypeLoginID() ,
+        };
+        const params = {
+            protobufName: 'ErmsMiddelGoodsEditReq',
+            funCodeName: 'ErmsMiddelGoodsEditReq',
+            reqParams: Object.assign(req, param),
+            msgHeadParams: {
+                AccountID: getSelectedAccountId() === null ? 0 : getSelectedAccountId(),
+                MarketID: 18,   // 目前写死
+                GoodsID: 0, // 目前写死
+            }
+        };
+        const package50 = buildProtoReq50(params);
+        APP.sendTradingServer(package50, undefined, {
+            onSuccess: (res) => {
+                const { isSuccess, result } = parseProtoRsp50(res, 'ErmsMiddelGoodsEditRsp');
+                if (isSuccess) {
+                    resolve(result);
+                } else {
+                    reject(result);
+                }
+            },
+            onFail: (err) => reject(err.message),
+        } as Callback);
+    });
+}
+
+/**
+ * 现货品种停用请求
+ */
+export const deliveryGoodsCancel = (param: DeliveryGoodsCancelReq): Promise<any> => {
+
+    return new Promise((resolve, reject) => {
+        const req = {
+            version: "3.2",
+            userid: getUserId(),
+            loginid: getLongTypeLoginID() ,
+        };
+        const params = {
+            protobufName: 'DeliveryGoodsCancelReq',
+            funCodeName: 'DeliveryGoodsCancelReq',
+            reqParams: Object.assign(req, param),
+            msgHeadParams: {
+                AccountID: getSelectedAccountId() === null ? 0 : getSelectedAccountId(),
+                MarketID: 18,   // 目前写死
+                GoodsID: 0, // 目前写死
+            }
+        };
+        const package50 = buildProtoReq50(params);
+        APP.sendTradingServer(package50, undefined, {
+            onSuccess: (res) => {
+                const { isSuccess, result } = parseProtoRsp50(res, 'DeliveryGoodsCancelRsp');
+                if (isSuccess) {
+                    resolve(result);
+                } else {
+                    reject(result);
+                }
+            },
+            onFail: (err) => reject(err.message),
+        } as Callback);
+    });
 }

+ 34 - 0
src/services/proto/delivery/interface.ts

@@ -31,4 +31,38 @@ export interface WRSConvertDetailEx {
     middlegoodsid: number // uint64 套保品种ID(接口为3.1及以下版本时传套保品种ID,否则传期货品种ID)
     unitid: number // uint64 单位ID
     convertratio: number // double 套保系数
+}
+
+// 套保品种修改请求 0 29 133
+export interface ErmsMiddelGoodsEditReq {
+    middlegoodsid: number; // uint64 套保品种ID
+    goodsunitid: number; // int32 单位ID
+    relatedgoodsid: number; // uint64 关联交易商品ID
+    evaluateratio: number; // double 估价系数
+    qtydecimalplace: number; // int32 数量小数位
+    modifierid: number; // uint64 修改人
+    relatedgoodstype: number; // int32 关联商品类型 - 1:期货合约 2:现货品种
+    needhedgeratio: number; // double 套保比率
+    areauserid?: number; // uint64 机构用户ID
+    goodsgroupid: number; // uint64 关联期货品种ID
+    remark: string; // string 备注
+}
+// 套保品种修改响应 0 29 134
+export interface ErmsMiddelGoodsEditRsp {
+    RetCode: number; // int32 返回码
+    RetDesc: string; // string 描述信息
+    middlegoodsid: number; // uint64 套保品种ID
+}
+
+// 现货品种停用请求 0 29 129
+export interface DeliveryGoodsCancelReq {
+    wrstandardid: string; // uint64 现货商品ID
+    isvalid?: number; // int32 是否有效 - 0:无效 1:有效
+}
+// 现货品种停用响应 0 29 130
+export interface DeliveryGoodsCancelRsp {
+    RetCode: string; // int32 返回码
+    RetDesc: string; // string 描述信息
+    wrstandardid: number; // uint64 现货商品ID
+    deliverygoodsid: number; // uint64 现货品种ID
 }

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

@@ -1,7 +1,7 @@
 // 套保计划
 import APP from "@/services";
 import { getSelectedAccountId, getUserId } from "@/services/bus/account";
-import { ErmcpHedgePlanReq } from "@/services/proto/hedgeplan/interface";
+import {ErmcpHedgePlanReq, HedgePlanOperateReq} from "@/services/proto/hedgeplan/interface";
 import { buildProtoReq50, parseProtoRsp50 } from "@/services/socket/protobuf/buildReq";
 import { Callback } from "@/utils/websocket";
 import moment from "moment";
@@ -46,9 +46,10 @@ export const hedgePlanReq = (param: ErmcpHedgePlanReq): Promise<any> => {
  * 老的计划操作接口 我只负责撤销 传5则进行撤销 !!!!! 注意
  * @param param
  */
-export const oldHedgePlanReq = (param: any): Promise<any> => {
+export const oldHedgePlanReq = (param: HedgePlanOperateReq): Promise<any> => {
     param.OperateSrc = 2; // 操作来源-1:管理端2:终端
     param.ClientTicket = uuidv4(); // 流水号
+    param.Remark = ''
     param.UserID = getUserId()
     return new Promise((resolve, reject) => {
         const params = {

+ 8 - 3
src/views/information/goods/components/disable/index.vue

@@ -117,27 +117,32 @@ import { QueryCustomInfoType } from '@/services/go/ermcp/customInfo/interface';
 import { formatValue } from '@/common/methods';
 import { getStatusName } from '@/views/information/custom/setup';
 import { Modal } from 'ant-design-vue';
+import {stopDeliveryGoods} from "@/views/information/goods/components/setup";
+import {ErmcpDeliveryGoodsDetailEx} from "@/services/go/ermcp/goodsInfo/interface";
 
 export default defineComponent({
     name: 'custom-disable',
     components: {},
     props: {
         selectedRow: {
-            type: Object as PropType<QueryCustomInfoType>,
+            type: Object as PropType<ErmcpDeliveryGoodsDetailEx>,
             default: {},
         },
     },
     setup(props) {
         const { visible, cancel } = closeModal('goods_info_spot_normal_disable');
         const maskClosableFlag = ref<boolean>(false);
-        const { loading, ModifyUserInfo } = updateUserAccount();
+        const loading = ref<boolean>(false);
         function submit() {
             Modal.confirm({
                 title: '是否确认停用客户资料',
                 okText: '确认停用',
                 cancelText: '取消',
                 onOk() {
-                    ModifyUserInfo(props.selectedRow.userid, 6);
+                    stopDeliveryGoods(props.selectedRow.data.deliverygoodsid.toString(), loading)
+                    .then(res => {
+                        cancel()
+                    })
                 },
                 onCancel() {
                     console.log('Cancel');

+ 3 - 1
src/views/information/goods/components/hedgingDetail/index.vue

@@ -1,5 +1,5 @@
 <template>
-  <!-- 修改客户资料 -->
+  <!-- 套保品种详情 -->
   <a-modal class="commonModal modify-custom"
            title="详情"
            v-if="visible"
@@ -8,6 +8,8 @@
            :maskClosable="maskClosableFlag"
            @cancel="cancel"
            width="890px">
+
+
     <template #footer>
       <a-button key="submit"
                 type="primary"

+ 10 - 6
src/views/information/goods/components/hedgingModify/index.vue

@@ -38,9 +38,9 @@
           </a-col>
           <a-col :span="12">
             <a-form-item label="修改后套保比例">
-              <a-input class="dialogInput"
+              <!-- <a-input class="dialogInput"
                        v-model:value="domain.wrstandardname"
-                       placeholder="请输入品类"></a-input>
+                       placeholder="请输入品类"></a-input> -->
             </a-form-item>
           </a-col>
         </a-row>
@@ -70,12 +70,16 @@ import { getGoodsUnitEnumItemName } from '@/common/constants/enumsName';
 export default defineComponent({
     name: 'modify-custom',
     components: {},
-    selctedMG: {
-        default: initMG,
-        type: Object as PropType<Ermcp3MiddleGoodsDetail2>,
+    props: {
+        selctedMG: {
+            default: initMG,
+            type: Object as PropType<Ermcp3MiddleGoodsDetail2>,
+        },
     },
-    setup() {
+
+    setup(props) {
         const { visible, cancel } = closeModal('goods_info_hedge_normal_modify');
+        console.log('selctedMG', props.selctedMG);
 
         const loading = ref<boolean>(false);
         function submit() {

+ 1 - 0
src/views/information/goods/components/rightHedging/index.vue

@@ -136,6 +136,7 @@
     </div>
     <HedgingDetail @selctedMG="selctedMG" />
     <HedgingModify @selctedMG="selctedMG" />
+
   </div>
 </template>
 

+ 1 - 1
src/views/information/goods/components/rightSpot/index.vue

@@ -113,7 +113,7 @@
       </a-collapse>
     </div>
     <Modify :selctedDeliveryGoods="selctedDeliveryGoods" />
-    <Disable />
+    <Disable :selctedDeliveryGoods="selctedDeliveryGoods" />
     <SpotDetail />
   </div>
 </template>

+ 41 - 0
src/views/information/goods/components/setup.ts

@@ -0,0 +1,41 @@
+import {DeliveryGoodsSign} from "@/views/information/goods/setup";
+import {commonResultInfo, getRequestResultInfo} from "@/common/methods/request";
+import {hedgePlanReq} from "@/services/proto/hedgeplan";
+import {deliveryGoodsCancel} from "@/services/proto/delivery";
+import {DeliveryGoodsCancelReq} from "@/services/proto/delivery/interface";
+import {Ref} from "vue";
+
+/**
+ * 现货品种停用请求
+ * @param req
+ * @param loading
+ */
+export function stopDeliveryGoods(wrstandardid: string, loading: Ref<boolean>) :Promise<string>{
+    const sign = getRequestResultInfo(DeliveryGoodsSign, 0)  // 接口请求后的返回提示 这里统一进行管理
+    const result = deliveryGoodsCancel(reqDeliveryGoodsBuilder(wrstandardid, 0))
+    return commonResultInfo(result, sign, loading)
+}
+
+/**
+ * 现货品种恢复请求
+ * @param req
+ * @param loading
+ */
+export function resumeDeliveryGoods(wrstandardid: string, loading: Ref<boolean>) :Promise<string>{
+    const sign = getRequestResultInfo(DeliveryGoodsSign, 1)  // 接口请求后的返回提示 这里统一进行管理
+    const result = deliveryGoodsCancel(reqDeliveryGoodsBuilder(wrstandardid, 1))
+    return commonResultInfo(result, sign, loading)
+}
+
+
+/**
+ * 这里组装请求
+ * @param wrstandardid
+ * @param type 0: 停用 1: 恢复
+ */
+export function reqDeliveryGoodsBuilder(wrstandardid: string, type: number) :DeliveryGoodsCancelReq{
+    return {
+        wrstandardid: wrstandardid,
+        isvalid: type
+    } as DeliveryGoodsCancelReq
+}

+ 1 - 1
src/views/information/goods/components/spotDetail/index.vue

@@ -1,5 +1,5 @@
 <template>
-  <!-- 修改客户资料 -->
+  <!-- 现货品种详情 -->
   <a-modal class="commonModal modify-custom"
            title="详情"
            v-if="visible"

+ 1 - 3
src/views/information/goods/list/hedging-variety/index.vue

@@ -37,15 +37,13 @@ export default defineComponent({
         AddGoods,
     },
     setup() {
-        // 控制弹窗
-        const { openAction: addAction } = openModal('goods_info_hedge_normal_modify');
         const { loading, menuList, isNormal, selctedMG, queryMG, chooseDG } = handleMG();
 
         initData(() => {
             // 加载数据在这里
             queryMG();
         });
-        return { addAction, loading, selctedMG, chooseDG, isNormal, menuList };
+        return { loading, selctedMG, chooseDG, isNormal, menuList };
     },
 });
 </script>

+ 10 - 0
src/views/information/goods/setup.ts

@@ -1,6 +1,7 @@
 import { getThirdMenuData } from '@/common/setup/table/button';
 import { MenuList } from '@/services/go/ermcp/goodsInfo/interface';
 import { Ref, ref } from 'vue';
+import {ResultInfo} from "@/common/methods/request";
 
 interface MenuType {
     menuList: Ref<MenuList[]>;
@@ -25,3 +26,12 @@ export function getInitMenuData(code: 'goods_info_spot' | 'goods_info_hedge'): M
     return { menuList, menuMap }
 }
 
+
+
+/************** 接口请求相关提示 ****************/
+
+// 停用提示
+export const DeliveryGoodsSign = new Map<number, ResultInfo>([
+    [0, ['停用现货品种成功', '停用现货品种失败:']],
+    [1, ['恢复现货品种成功', '恢复现货品种失败:']],
+])