li.shaoyi 2 anos atrás
pai
commit
164ddb4c83

+ 60 - 0
public/proto/mtp.js

@@ -2721,6 +2721,10 @@ var $root = ($protobuf.roots["default"] || ($protobuf.roots["default"] = new $pr
       Content: {
         type: "string",
         id: 4
+      },
+      RiskLevel: {
+        type: "int32",
+        id: 5
       }
     }
   },
@@ -8417,6 +8421,10 @@ var $root = ($protobuf.roots["default"] || ($protobuf.roots["default"] = new $pr
       ClientType: {
         type: "uint32",
         id: 11
+      },
+      RealDeliveryQty: {
+        type: "double",
+        id: 12
       }
     }
   },
@@ -8814,6 +8822,58 @@ var $root = ($protobuf.roots["default"] || ($protobuf.roots["default"] = new $pr
       }
     }
   },
+  HolderTransferRefuseReq: {
+    fields: {
+      Header: {
+        type: "MessageHead",
+        id: 1
+      },
+      ApplyID: {
+        type: "uint64",
+        id: 2
+      },
+      AuditorID: {
+        type: "uint32",
+        id: 3
+      },
+      AuditorRemark: {
+        type: "string",
+        id: 4
+      },
+      ClientSerialNo: {
+        type: "string",
+        id: 5
+      },
+      ClientType: {
+        type: "uint32",
+        id: 6
+      }
+    }
+  },
+  HolderTransferRefuseRsp: {
+    fields: {
+      Header: {
+        type: "MessageHead",
+        id: 1
+      },
+      RetCode: {
+        type: "int32",
+        id: 2
+      },
+      RetDesc: {
+        type: "string",
+        id: 3
+      },
+      ApplyID: {
+        type: "uint64",
+        id: 4
+      },
+      ClientSerialNo: {
+        type: "string",
+        id: 5
+      }
+    }
+  },
   SubCommand: {
     fields: {
       CommandCode: {

+ 19 - 0
public/proto/mtp.proto

@@ -821,6 +821,7 @@ message RiskToWebNtf {
 		optional NotifyHead NtfHeader = 2; // NotifyHead 公共消息头
 		optional uint64 MsgId = 3; // uint64 消息ID
 		optional string Content = 4; // string 消息内容
+		optional int32 RiskLevel = 5; // int32 当前风险级别风控级别(RISKLEVEL):无风险0,警告级别1,追加保证金2,斩仓级别3,恢复正常4净值新仓5
 }
 // 管理端个性化风控通知
 message AccountConfigChangeNtf {
@@ -2578,6 +2579,7 @@ message DeliveryManageOperatorReq {
 		optional string Remark = 9; // 操作备注
 		optional string ClientSerialNo = 10; // 客户端流水号
 		optional uint32 ClientType = 11; // 终端类型
+		optional double RealDeliveryQty = 12; // 实际交收数量
 }
 // 交收管理端操作接口响应
 message DeliveryManageOperatorRsp {
@@ -2701,6 +2703,23 @@ message HolderTransferConfirmRsp {
 		optional uint64 ApplyID = 4; // 申请ID,必填
 		optional string ClientSerialNo = 5; // 客户端流水号
 }
+// 持仓过户拒绝接口请求
+message HolderTransferRefuseReq {
+	optional MessageHead Header = 1;
+		optional uint64 ApplyID = 2; // 申请ID,必填
+		optional uint32 AuditorID = 3; // 审核人,必填
+		optional string AuditorRemark = 4; // 审核备注
+		optional string ClientSerialNo = 5; // 客户端流水号
+		optional uint32 ClientType = 6; // 终端类型
+}
+// 持仓过户拒绝接口响应
+message HolderTransferRefuseRsp {
+	optional MessageHead Header = 1; // 消息头
+	optional int32 RetCode = 2; // 返回码
+	optional string RetDesc = 3; // 描述信息
+		optional uint64 ApplyID = 4; // 申请ID,必填
+		optional string ClientSerialNo = 5; // 客户端流水号
+}
 // 账户操作子指令
 message SubCommand {
 		optional uint32 CommandCode = 1; // 子指令操作码

+ 12 - 8
src/packages/gcszt/App.vue

@@ -4,7 +4,7 @@
 
 <script lang="ts" setup>
 import { useNavigation } from '@mobile/router/navigation'
-import { dialog } from '@/utils/vant'
+import { dialog, notify } from '@/utils/vant'
 import { useLogin } from '@/business/login'
 import eventBus from '@/services/bus'
 
@@ -29,12 +29,16 @@ eventBus.$on('LogoutNotify', (msg) => {
 })
 
 // 接收风控通知
-eventBus.$on('RiskToWebNtf', (msg) => {
-  const notify = msg as { title: string, content: string }
-  dialog({
-    title: notify.title,
-    message: notify.content,
-    confirmButtonText: '确定'
-  })
+eventBus.$on('RiskToWebNtf', (msg, type) => {
+  const res = msg as { title: string, content: string }
+  if (type === 1) {
+    notify(res.content, 'warning')
+  } else {
+    dialog({
+      title: res.title,
+      message: res.content,
+      confirmButtonText: '确定'
+    })
+  }
 })
 </script>

+ 12 - 8
src/packages/gstj/App.vue

@@ -4,7 +4,7 @@
 
 <script lang="ts" setup>
 import { useNavigation } from '@mobile/router/navigation'
-import { dialog } from '@/utils/vant'
+import { dialog, notify } from '@/utils/vant'
 import { useLogin } from '@/business/login'
 import eventBus from '@/services/bus'
 
@@ -29,12 +29,16 @@ eventBus.$on('LogoutNotify', (msg) => {
 })
 
 // 接收风控通知
-eventBus.$on('RiskToWebNtf', (msg) => {
-  const notify = msg as { title: string, content: string }
-  dialog({
-    title: notify.title,
-    message: notify.content,
-    confirmButtonText: '确定'
-  })
+eventBus.$on('RiskToWebNtf', (msg, type) => {
+  const res = msg as { title: string, content: string }
+  if (type === 1) {
+    notify(res.content, 'warning')
+  } else {
+    dialog({
+      title: res.title,
+      message: res.content,
+      confirmButtonText: '确定'
+    })
+  }
 })
 </script>

+ 12 - 8
src/packages/mobile/App.vue

@@ -4,7 +4,7 @@
 
 <script lang="ts" setup>
 import { useNavigation } from './router/navigation'
-import { dialog } from '@/utils/vant'
+import { dialog, notify } from '@/utils/vant'
 import { useLogin } from '@/business/login'
 import eventBus from '@/services/bus'
 
@@ -29,12 +29,16 @@ eventBus.$on('LogoutNotify', (msg) => {
 })
 
 // 接收风控通知
-eventBus.$on('RiskToWebNtf', (msg) => {
-  const notify = msg as { title: string, content: string }
-  dialog({
-    title: notify.title,
-    message: notify.content,
-    confirmButtonText: '确定'
-  })
+eventBus.$on('RiskToWebNtf', (msg, type) => {
+  const res = msg as { title: string, content: string }
+  if (type === 1) {
+    notify(res.content, 'warning')
+  } else {
+    dialog({
+      title: res.title,
+      message: res.content,
+      confirmButtonText: '确定'
+    })
+  }
 })
 </script>

+ 12 - 4
src/packages/pc/App.vue

@@ -11,7 +11,7 @@ export default {
 
 <script lang="ts" setup>
 import { useRouter } from 'vue-router'
-import { ElMessageBox } from 'element-plus'
+import { ElMessageBox, ElNotification } from 'element-plus'
 import { useLogin } from '@/business/login'
 import eventBus from '@/services/bus'
 
@@ -29,8 +29,16 @@ eventBus.$on('LogoutNotify', (msg) => {
 })
 
 // 接收风控通知
-eventBus.$on('RiskToWebNtf', (msg) => {
-  const notify = msg as { title: string, content: string }
-  ElMessageBox.alert(notify.content, notify.title)
+eventBus.$on('RiskToWebNtf', (msg, type) => {
+  const res = msg as { title: string, content: string }
+  if (type === 1) {
+    ElNotification({
+      title: res.title,
+      message: res.content,
+      type: 'warning'
+    })
+  } else {
+    ElMessageBox.alert(res.content, res.title)
+  }
 })
 </script>

+ 12 - 8
src/packages/qdhs/App.vue

@@ -4,7 +4,7 @@
 
 <script lang="ts" setup>
 import { useNavigation } from '@mobile/router/navigation'
-import { dialog } from '@/utils/vant'
+import { dialog, notify } from '@/utils/vant'
 import { useLogin } from '@/business/login'
 import eventBus from '@/services/bus'
 
@@ -29,12 +29,16 @@ eventBus.$on('LogoutNotify', (msg) => {
 })
 
 // 接收风控通知
-eventBus.$on('RiskToWebNtf', (msg) => {
-  const notify = msg as { title: string, content: string }
-  dialog({
-    title: notify.title,
-    message: notify.content,
-    confirmButtonText: '确定'
-  })
+eventBus.$on('RiskToWebNtf', (msg, type) => {
+  const res = msg as { title: string, content: string }
+  if (type === 1) {
+    notify(res.content, 'warning')
+  } else {
+    dialog({
+      title: res.title,
+      message: res.content,
+      confirmButtonText: '确定'
+    })
+  }
 })
 </script>

+ 12 - 8
src/packages/qxst/App.vue

@@ -4,7 +4,7 @@
 
 <script lang="ts" setup>
 import { useNavigation } from '@mobile/router/navigation'
-import { dialog } from '@/utils/vant'
+import { dialog, notify } from '@/utils/vant'
 import { useLogin } from '@/business/login'
 import eventBus from '@/services/bus'
 
@@ -29,12 +29,16 @@ eventBus.$on('LogoutNotify', (msg) => {
 })
 
 // 接收风控通知
-eventBus.$on('RiskToWebNtf', (msg) => {
-  const notify = msg as { title: string, content: string }
-  dialog({
-    title: notify.title,
-    message: notify.content,
-    confirmButtonText: '确定'
-  })
+eventBus.$on('RiskToWebNtf', (msg, type) => {
+  const res = msg as { title: string, content: string }
+  if (type === 1) {
+    notify(res.content, 'warning')
+  } else {
+    dialog({
+      title: res.title,
+      message: res.content,
+      confirmButtonText: '确定'
+    })
+  }
 })
 </script>

+ 12 - 8
src/packages/sbyj/App.vue

@@ -4,7 +4,7 @@
 
 <script lang="ts" setup>
 import { useNavigation } from '@mobile/router/navigation'
-import { dialog } from '@/utils/vant'
+import { dialog, notify } from '@/utils/vant'
 import { useLogin } from '@/business/login'
 import eventBus from '@/services/bus'
 
@@ -29,12 +29,16 @@ eventBus.$on('LogoutNotify', (msg) => {
 })
 
 // 接收风控通知
-eventBus.$on('RiskToWebNtf', (msg) => {
-  const notify = msg as { title: string, content: string }
-  dialog({
-    title: notify.title,
-    message: notify.content,
-    confirmButtonText: '确定'
-  })
+eventBus.$on('RiskToWebNtf', (msg, type) => {
+  const res = msg as { title: string, content: string }
+  if (type === 1) {
+    notify(res.content, 'warning')
+  } else {
+    dialog({
+      title: res.title,
+      message: res.content,
+      confirmButtonText: '确定'
+    })
+  }
 })
 </script>

+ 12 - 8
src/packages/tc/App.vue

@@ -4,7 +4,7 @@
 
 <script lang="ts" setup>
 import { useNavigation } from '@mobile/router/navigation'
-import { dialog } from '@/utils/vant'
+import { dialog, notify } from '@/utils/vant'
 import { useLogin } from '@/business/login'
 import eventBus from '@/services/bus'
 
@@ -29,12 +29,16 @@ eventBus.$on('LogoutNotify', (msg) => {
 })
 
 // 接收风控通知
-eventBus.$on('RiskToWebNtf', (msg) => {
-  const notify = msg as { title: string, content: string }
-  dialog({
-    title: notify.title,
-    message: notify.content,
-    confirmButtonText: '确定'
-  })
+eventBus.$on('RiskToWebNtf', (msg, type) => {
+  const res = msg as { title: string, content: string }
+  if (type === 1) {
+    notify(res.content, 'warning')
+  } else {
+    dialog({
+      title: res.title,
+      message: res.content,
+      confirmButtonText: '确定'
+    })
+  }
 })
 </script>

+ 12 - 8
src/packages/tjmd/App.vue

@@ -4,7 +4,7 @@
 
 <script lang="ts" setup>
 import { useNavigation } from '@mobile/router/navigation'
-import { dialog } from '@/utils/vant'
+import { dialog, notify } from '@/utils/vant'
 import { useLogin } from '@/business/login'
 import eventBus from '@/services/bus'
 
@@ -29,12 +29,16 @@ eventBus.$on('LogoutNotify', (msg) => {
 })
 
 // 接收风控通知
-eventBus.$on('RiskToWebNtf', (msg) => {
-  const notify = msg as { title: string, content: string }
-  dialog({
-    title: notify.title,
-    message: notify.content,
-    confirmButtonText: '确定'
-  })
+eventBus.$on('RiskToWebNtf', (msg, type) => {
+  const res = msg as { title: string, content: string }
+  if (type === 1) {
+    notify(res.content, 'warning')
+  } else {
+    dialog({
+      title: res.title,
+      message: res.content,
+      confirmButtonText: '确定'
+    })
+  }
 })
 </script>

+ 12 - 8
src/packages/zrwyt/App.vue

@@ -4,7 +4,7 @@
 
 <script lang="ts" setup>
 import { useNavigation } from '@mobile/router/navigation'
-import { dialog } from '@/utils/vant'
+import { dialog, notify } from '@/utils/vant'
 import { useLogin } from '@/business/login'
 import eventBus from '@/services/bus'
 
@@ -29,12 +29,16 @@ eventBus.$on('LogoutNotify', (msg) => {
 })
 
 // 接收风控通知
-eventBus.$on('RiskToWebNtf', (msg) => {
-  const notify = msg as { title: string, content: string }
-  dialog({
-    title: notify.title,
-    message: notify.content,
-    confirmButtonText: '确定'
-  })
+eventBus.$on('RiskToWebNtf', (msg, type) => {
+  const res = msg as { title: string, content: string }
+  if (type === 1) {
+    notify(res.content, 'warning')
+  } else {
+    dialog({
+      title: res.title,
+      message: res.content,
+      confirmButtonText: '确定'
+    })
+  }
 })
 </script>

+ 2 - 2
src/services/bus/index.ts

@@ -25,10 +25,10 @@ export default new (class {
     }
 
     /** 触发事件 */
-    $emit(eventKey: EventKey, data?: unknown) {
+    $emit(eventKey: EventKey, ...data: unknown[]) {
         for (const e of this.eventMap.values()) {
             if (e.keys.includes(eventKey)) {
-                e.callback(data);
+                e.callback(...data);
             }
         }
     }

+ 1 - 1
src/services/bus/types.ts

@@ -30,5 +30,5 @@ export type EventKey = keyof typeof EventCode
  */
 export interface EventMessage {
     keys: EventKey[];
-    callback: (data: unknown) => void;
+    callback: (...data: unknown[]) => void;
 }

+ 14 - 7
src/services/websocket/message.ts

@@ -85,16 +85,23 @@ export async function pushMessage50(pkg: Package50, contentType: 'encrypted' | '
         }
         case FunCode.RiskToWebNtf: {
             try {
-                // console.log('接收到风控通知', funCode)
+                let res: Proto.RiskToWebNtf
                 if (contentType === 'encrypted') {
-                    const res = await decodeProto<Proto.RiskToWebNtf>('RiskToWebNtf', content)
-                    const msg = JSON.parse(res.Content)
-                    eventBus.$emit('RiskToWebNtf', msg)
+                    res = await decodeProto<Proto.RiskToWebNtf>('RiskToWebNtf', content)
                 } else {
-                    const res = new TextDecoder().decode(content)
-                    const msg = JSON.parse(JSON.parse(res).Content)
-                    eventBus.$emit('RiskToWebNtf', msg)
+                    const data = new TextDecoder().decode(content)
+                    res = JSON.parse(data)
+                }
+                const msg = JSON.parse(res.Content)
+                switch (true) {
+                    case [1, 2].includes(res.RiskLevel):
+                        eventBus.$emit('RiskToWebNtf', msg, 1)
+                        break
+                    case [3, 5].includes(res.RiskLevel):
+                        eventBus.$emit('RiskToWebNtf', msg, 2)
+                        break
                 }
+                console.log('接收到风控通知', funCode, res)
             } catch (err) {
                 console.error('报文解析失败', funCode, err)
             }

+ 1 - 0
src/types/proto/notify.d.ts

@@ -45,6 +45,7 @@ declare global {
             NtfHeader: NotifyHead; // NotifyHead 公共消息头
             MsgId: number; // uint64 消息ID
             Content: string; // string 消息内容
+            RiskLevel: number; // int32 当前风险级别风控级别(RISKLEVEL):无风险0,警告级别1,追加保证金2,斩仓级别3,恢复正常4净值新仓5
         }
     }
 }