Browse Source

platfrom serviceproxy

main
hulei 3 weeks ago
parent
commit
cea988d567
36 changed files with 3660 additions and 0 deletions
  1. 127
    0
      ant-design-pro-vue3/src/views/front/platfrom/serviceproxy/CommonFunction.ts
  2. 20
    0
      ant-design-pro-vue3/src/views/front/platfrom/serviceproxy/ServiceFunction/AttachFile.ts
  3. 50
    0
      ant-design-pro-vue3/src/views/front/platfrom/serviceproxy/ServiceFunction/Entitys/AttchedFiles.ts
  4. 27
    0
      ant-design-pro-vue3/src/views/front/platfrom/serviceproxy/ServiceFunction/Entitys/AuthCondInf.ts
  5. 15
    0
      ant-design-pro-vue3/src/views/front/platfrom/serviceproxy/ServiceFunction/Entitys/AuthResult.ts
  6. 28
    0
      ant-design-pro-vue3/src/views/front/platfrom/serviceproxy/ServiceFunction/Entitys/IsAuthResult.ts
  7. 45
    0
      ant-design-pro-vue3/src/views/front/platfrom/serviceproxy/ServiceFunction/Entitys/PFUsedFileInfo.ts
  8. 50
    0
      ant-design-pro-vue3/src/views/front/platfrom/serviceproxy/ServiceFunction/Entitys/PicpCheckRecords.ts
  9. 74
    0
      ant-design-pro-vue3/src/views/front/platfrom/serviceproxy/ServiceFunction/Entitys/PicpCheckResInfo.ts
  10. 38
    0
      ant-design-pro-vue3/src/views/front/platfrom/serviceproxy/ServiceFunction/Entitys/ProcessInfo.ts
  11. 47
    0
      ant-design-pro-vue3/src/views/front/platfrom/serviceproxy/ServiceFunction/Entitys/THotKeyMessage.ts
  12. 52
    0
      ant-design-pro-vue3/src/views/front/platfrom/serviceproxy/ServiceFunction/Entitys/TPrintData.ts
  13. 36
    0
      ant-design-pro-vue3/src/views/front/platfrom/serviceproxy/ServiceFunction/Entitys/TTellerHotKey.ts
  14. 30
    0
      ant-design-pro-vue3/src/views/front/platfrom/serviceproxy/ServiceFunction/Entitys/TellerInfo.ts
  15. 61
    0
      ant-design-pro-vue3/src/views/front/platfrom/serviceproxy/ServiceFunction/Entitys/TradeForms.ts
  16. 41
    0
      ant-design-pro-vue3/src/views/front/platfrom/serviceproxy/ServiceFunction/Entitys/TradeInfo.ts
  17. 36
    0
      ant-design-pro-vue3/src/views/front/platfrom/serviceproxy/ServiceFunction/Entitys/TradePrintMessage.ts
  18. 42
    0
      ant-design-pro-vue3/src/views/front/platfrom/serviceproxy/ServiceFunction/Entitys/WorkItemDesc.ts
  19. 13
    0
      ant-design-pro-vue3/src/views/front/platfrom/serviceproxy/ServiceFunction/Interfaces/IEntity.ts
  20. 11
    0
      ant-design-pro-vue3/src/views/front/platfrom/serviceproxy/ServiceFunction/Interfaces/ITransitInvoker.ts
  21. 48
    0
      ant-design-pro-vue3/src/views/front/platfrom/serviceproxy/ServiceFunction/MsgHandle/CryptTools.ts
  22. 297
    0
      ant-design-pro-vue3/src/views/front/platfrom/serviceproxy/ServiceFunction/MsgHandle/MessageHandle.ts
  23. 158
    0
      ant-design-pro-vue3/src/views/front/platfrom/serviceproxy/ServiceFunction/MsgHandle/SocketTran.ts
  24. 73
    0
      ant-design-pro-vue3/src/views/front/platfrom/serviceproxy/ServiceFunction/ServiceInstance/NettyInvoker.ts
  25. 18
    0
      ant-design-pro-vue3/src/views/front/platfrom/serviceproxy/ServiceFunction/ServiceInstance/WebserviceInvoker.ts
  26. 102
    0
      ant-design-pro-vue3/src/views/front/platfrom/serviceproxy/ServiceFunction/ServiceManager.ts
  27. 22
    0
      ant-design-pro-vue3/src/views/front/platfrom/serviceproxy/ServiceFunction/TransitEntity.ts
  28. 15
    0
      ant-design-pro-vue3/src/views/front/platfrom/serviceproxy/ServiceFunction/Types.ts
  29. 400
    0
      ant-design-pro-vue3/src/views/front/platfrom/serviceproxy/ServiceHelper/FilesHandle.ts
  30. 142
    0
      ant-design-pro-vue3/src/views/front/platfrom/serviceproxy/ServiceHelper/HotKeysHandle.ts
  31. 182
    0
      ant-design-pro-vue3/src/views/front/platfrom/serviceproxy/ServiceHelper/InitializeHandle.ts
  32. 107
    0
      ant-design-pro-vue3/src/views/front/platfrom/serviceproxy/ServiceHelper/PicpHandle.ts
  33. 228
    0
      ant-design-pro-vue3/src/views/front/platfrom/serviceproxy/ServiceHelper/PrintHandle.ts
  34. 373
    0
      ant-design-pro-vue3/src/views/front/platfrom/serviceproxy/ServiceHelper/TradeHandle.ts
  35. 321
    0
      ant-design-pro-vue3/src/views/front/platfrom/serviceproxy/ServiceHelper/UserManagerHandle.ts
  36. 331
    0
      ant-design-pro-vue3/src/views/front/platfrom/serviceproxy/ServiceHelper/WorkFlowHandle.ts

+ 127
- 0
ant-design-pro-vue3/src/views/front/platfrom/serviceproxy/CommonFunction.ts View File

@@ -0,0 +1,127 @@
1
+// 假设 IEntity 接口定义如下
2
+interface IEntity {
3
+    ChangeToTable(): string[];
4
+    ChangeFromTable(parms: any[]): void;
5
+}
6
+
7
+class CommonFunction {
8
+    static enqualSign = "&&"; // 行分隔符
9
+    static splitSign = "##"; // 列分隔符
10
+
11
+    static ChangeDicToStr(dic: { [key: string]: string }): string {
12
+        let result = '';
13
+        if (dic) {
14
+            let dicstr = '';
15
+            for (const [key, value] of Object.entries(dic)) {
16
+                dicstr += `${key}${this.enqualSign}${value}${this.splitSign}`;
17
+            }
18
+            if (dicstr.endsWith(this.splitSign)) {
19
+                result = dicstr.slice(0, -this.splitSign.length);
20
+            }
21
+        }
22
+        return result;
23
+    }
24
+
25
+    static ChangeStrToDic(str: string): { [key: string]: string } | null {
26
+        const result: { [key: string]: string } = {};
27
+        if (str) {
28
+            const tmpstr = str.split(this.splitSign);
29
+            for (const tmps of tmpstr) {
30
+                const tmp = tmps.split(this.enqualSign);
31
+                if (tmp.length !== 2) {
32
+                    return null;
33
+                }
34
+                result[tmp[0]] = tmp[1];
35
+            }
36
+        }
37
+        return result;
38
+    }
39
+
40
+    static ChangStrToArray(str: string): string[] {
41
+        if (str) {
42
+            return str.split(this.splitSign);
43
+        }
44
+        return [];
45
+    }
46
+
47
+    static ChangArrayToStr(stringarray: string[]): string {
48
+        let result = '';
49
+        if (stringarray) {
50
+            let dicstr = '';
51
+            for (const tmp of stringarray) {
52
+                dicstr += `${tmp}${this.splitSign}`;
53
+            }
54
+            if (dicstr.endsWith(this.splitSign)) {
55
+                result = dicstr.slice(0, -this.splitSign.length);
56
+            }
57
+        }
58
+        return result;
59
+    }
60
+
61
+    static ChangeDicToTable(dic: { [key: string]: string }): any[] {
62
+        const result: any[] = [];
63
+        if (dic) {
64
+            for (const [key, value] of Object.entries(dic)) {
65
+                result.push({ Key: key, Value: value });
66
+            }
67
+        }
68
+        return result;
69
+    }
70
+
71
+    static ChangeTableToDic(table: any[]): { [key: string]: string } | null {
72
+        const result: { [key: string]: string } = {};
73
+        if (table) {
74
+            for (const tmp of table) {
75
+                const itemArray = Object.values(tmp);
76
+                if (itemArray.length !== 2) {
77
+                    return null;
78
+                }
79
+                result[itemArray[0].toString()] = itemArray[1].toString();
80
+            }
81
+        }
82
+        return result;
83
+    }
84
+
85
+    static ChangeEntityToTable(entitys: IEntity[]): any[] {
86
+        const result: any[] = [];
87
+        if (entitys) {
88
+            for (const tmpentity of entitys) {
89
+                if (tmpentity) {
90
+                    const tmpvalues = tmpentity.ChangeToTable();
91
+                    if (tmpvalues) {
92
+                        if (result.length === 0) {
93
+                            for (let i = 1; i <= tmpvalues.length; i++) {
94
+                                result.push({});
95
+                            }
96
+                        }
97
+                        for (let i = 0; i < tmpvalues.length; i++) {
98
+                            result[i][`column${i + 1}`] = tmpvalues[i];
99
+                        }
100
+                    }
101
+                }
102
+            }
103
+        }
104
+        return result;
105
+    }
106
+
107
+    static ChangeTableToEntitys<T extends IEntity>(table: any[]): T[] {
108
+        const result: T[] = [];
109
+        if (table) {
110
+            for (const list of table) {
111
+                const tmp = new (class implements IEntity {
112
+                    ChangeToTable(): string[] {
113
+                        throw new Error("Method not implemented.");
114
+                    }
115
+                    ChangeFromTable(parms: any[]): void {
116
+                        throw new Error("Method not implemented.");
117
+                    }
118
+                })() as T;
119
+                tmp.ChangeFromTable(Object.values(list));
120
+                result.push(tmp);
121
+            }
122
+        }
123
+        return result;
124
+    }
125
+}
126
+
127
+export default CommonFunction;

+ 20
- 0
ant-design-pro-vue3/src/views/front/platfrom/serviceproxy/ServiceFunction/AttachFile.ts View File

@@ -0,0 +1,20 @@
1
+export class AttachFile {
2
+    /**
3
+     * 附件在服务方法中做为参数的位置
4
+     */
5
+    public AttachIndex: string;
6
+    /**
7
+     * 附件类型: 0:Table类型 1:Base基本类型 2:Byte数组类型
8
+     */
9
+    public AttachType: string;
10
+    /**
11
+     * 附件值
12
+     */
13
+    public AttachValue: any;
14
+
15
+    constructor(attachIndex: string, attachType: string, attachValue: any) {
16
+        this.AttachIndex = attachIndex;
17
+        this.AttachType = attachType;
18
+        this.AttachValue = attachValue;
19
+    }
20
+}

+ 50
- 0
ant-design-pro-vue3/src/views/front/platfrom/serviceproxy/ServiceFunction/Entitys/AttchedFiles.ts View File

@@ -0,0 +1,50 @@
1
+// 假设 IEntity 接口定义如下
2
+interface IEntity {
3
+    ChangeToTable(): string[];
4
+    ChangeFromTable(parms: any[]): void;
5
+}
6
+
7
+// 定义 CommonFunction 类,实现 ChangeDicToStr 和 ChangeStrToDic 方法
8
+class CommonFunction {
9
+    static ChangeDicToStr(dic: { [key: string]: string }): string {
10
+        return Object.entries(dic).map(([key, value]) => `${key}:${value}`).join(',');
11
+    }
12
+
13
+    static ChangeStrToDic(str: string): { [key: string]: string } {
14
+        return str.split(',').reduce((acc, pair) => {
15
+            const [key, value] = pair.split(':');
16
+            if (key && value) {
17
+                acc[key] = value;
18
+            }
19
+            return acc;
20
+        }, {} as { [key: string]: string });
21
+    }
22
+}
23
+
24
+export class AttchedFiles implements IEntity {
25
+    // 附件数据
26
+    public Filedata: Uint8Array;
27
+    // 附件信息
28
+    public Fileinfo: { [key: string]: string };
29
+    // ID
30
+    public Id: string;
31
+    // 记录Filedata长度,做附件传递用,不对外公开
32
+    public FiledataLength: number;
33
+
34
+    constructor() {
35
+        this.Filedata = new Uint8Array();
36
+        this.Fileinfo = {};
37
+        this.Id = '';
38
+        this.FiledataLength = 0;
39
+    }
40
+
41
+    public ChangeToTable(): string[] {
42
+        return [this.Id, CommonFunction.ChangeDicToStr(this.Fileinfo), this.Filedata.length.toString()];
43
+    }
44
+
45
+    public ChangeFromTable(parms: any[]): void {
46
+        this.Id = parms[0].toString();
47
+        this.Fileinfo = CommonFunction.ChangeStrToDic(parms[1].toString());
48
+        this.FiledataLength = parseInt(parms[2].toString(), 10);
49
+    }
50
+}

+ 27
- 0
ant-design-pro-vue3/src/views/front/platfrom/serviceproxy/ServiceFunction/Entitys/AuthCondInf.ts View File

@@ -0,0 +1,27 @@
1
+export class AuthCondInf {
2
+    Tx_code: string;
3
+    Seqn: number;
4
+    Mod: number;
5
+    Cond: string;
6
+    Des: string;
7
+    Uncondflag: number;
8
+    Funcnum: string;
9
+
10
+    constructor(
11
+        Tx_code: string,
12
+        Seqn: number,
13
+        Mod: number,
14
+        Cond: string,
15
+        Des: string,
16
+        Uncondflag: number,
17
+        Funcnum: string
18
+    ) {
19
+        this.Tx_code = Tx_code;
20
+        this.Seqn = Seqn;
21
+        this.Mod = Mod;
22
+        this.Cond = Cond;
23
+        this.Des = Des;
24
+        this.Uncondflag = Uncondflag;
25
+        this.Funcnum = Funcnum;
26
+    }
27
+}

+ 15
- 0
ant-design-pro-vue3/src/views/front/platfrom/serviceproxy/ServiceFunction/Entitys/AuthResult.ts View File

@@ -0,0 +1,15 @@
1
+export class AuthResult {
2
+    /**
3
+     * 授权结果
4
+     */
5
+    public IsSuccess: boolean;
6
+    /**
7
+     * 授权结果提示信息
8
+     */
9
+    public Msg: string;
10
+
11
+    constructor(isSuccess: boolean, msg: string) {
12
+        this.IsSuccess = isSuccess;
13
+        this.Msg = msg;
14
+    }
15
+}

+ 28
- 0
ant-design-pro-vue3/src/views/front/platfrom/serviceproxy/ServiceFunction/Entitys/IsAuthResult.ts View File

@@ -0,0 +1,28 @@
1
+export class IsAuthResult {
2
+    /**
3
+     * 授权模式: 
4
+     * 1、 本地授权
5
+     * 2、 远程授权
6
+     * 3、 即可本地又可远程授权
7
+     */
8
+    public Mode: number;
9
+    /**
10
+     * 授权级别
11
+     */
12
+    public Lvl: string;
13
+    /**
14
+     * 是否需要授权
15
+     */
16
+    public Isauth: boolean;
17
+    /**
18
+     * 授权流水
19
+     */
20
+    public Records: string;
21
+
22
+    constructor(mode: number, lvl: string, isauth: boolean, records: string) {
23
+        this.Mode = mode;
24
+        this.Lvl = lvl;
25
+        this.Isauth = isauth;
26
+        this.Records = records;
27
+    }
28
+}

+ 45
- 0
ant-design-pro-vue3/src/views/front/platfrom/serviceproxy/ServiceFunction/Entitys/PFUsedFileInfo.ts View File

@@ -0,0 +1,45 @@
1
+// 假设 IEntity 接口定义如下
2
+interface IEntity {
3
+    ChangeToTable(): string[];
4
+    ChangeFromTable(parms: any[]): void;
5
+}
6
+
7
+export class PFUsedFileInfo implements IEntity {
8
+    /**
9
+     * fileinfo表里的唯一编号
10
+     */
11
+    public Id: string;
12
+
13
+    /**
14
+     * 文件在客户端的路径
15
+     */
16
+    public FilePath: string;
17
+
18
+    /**
19
+     * 文件名
20
+     */
21
+    public FileName: string;
22
+
23
+    /**
24
+     * Md5码
25
+     */
26
+    public Md5: string;
27
+
28
+    constructor() {
29
+        this.Id = '';
30
+        this.FilePath = '';
31
+        this.FileName = '';
32
+        this.Md5 = '';
33
+    }
34
+
35
+    public ChangeToTable(): string[] {
36
+        return [this.Id, this.FilePath, this.FileName, this.Md5];
37
+    }
38
+
39
+    public ChangeFromTable(parms: any[]): void {
40
+        this.Id = parms[0].toString();
41
+        this.FilePath = parms[1].toString();
42
+        this.FileName = parms[2].toString();
43
+        this.Md5 = parms[3].toString();
44
+    }
45
+}

+ 50
- 0
ant-design-pro-vue3/src/views/front/platfrom/serviceproxy/ServiceFunction/Entitys/PicpCheckRecords.ts View File

@@ -0,0 +1,50 @@
1
+export interface PicpCheckRecords {
2
+    /**
3
+     * 核查流水号
4
+     */
5
+    seqNo: string;
6
+    /**
7
+     * 流水号
8
+     */
9
+    serialNo: string;
10
+    /**
11
+     * 报文类型
12
+     */
13
+    msgNo: string;
14
+    /**
15
+     * 交易号
16
+     */
17
+    tradeNo: string;
18
+    /**
19
+     * 核查柜员
20
+     */
21
+    checkTel: string;
22
+    /**
23
+     * 核查机构
24
+     */
25
+    checkBrNo: string;
26
+    /**
27
+     * 核查方式
28
+     */
29
+    checkType: string;
30
+    /**
31
+     * 核查日期
32
+     */
33
+    checkDate: string;
34
+    /**
35
+     * 核查时间
36
+     */
37
+    checkTime: string;
38
+    /**
39
+     * 核查信息:身份证号,姓名
40
+     */
41
+    checkInfoKVs: { [key: string]: any };
42
+    /**
43
+     * 核查是否成功
44
+     */
45
+    success: string;
46
+    /**
47
+     * 备注
48
+     */
49
+    comments: string;
50
+}

+ 74
- 0
ant-design-pro-vue3/src/views/front/platfrom/serviceproxy/ServiceFunction/Entitys/PicpCheckResInfo.ts View File

@@ -0,0 +1,74 @@
1
+export interface PicpCheckResInfo {
2
+    /**
3
+     * 返回报文类型
4
+     */
5
+    resMsgNo: string;
6
+    /**
7
+     * 身份证号
8
+     */
9
+    idNo: string;
10
+    /**
11
+     * 姓名
12
+     */
13
+    name: string;
14
+    /**
15
+     * 核查结果
16
+     */
17
+    checkResult: string;
18
+    /**
19
+     * 签发机构
20
+     */
21
+    issue: string;
22
+    /**
23
+     * 曾用名
24
+     */
25
+    formerName: string;
26
+    /**
27
+     * 性别
28
+     */
29
+    sex: string;
30
+    /**
31
+     * 生日
32
+     */
33
+    birthday: string;
34
+    /**
35
+     * 出生地
36
+     */
37
+    birthPlace: string;
38
+    /**
39
+     * 籍贯
40
+     */
41
+    nativePlace: string;
42
+    /**
43
+     * 文化程度
44
+     */
45
+    eduLevel: string;
46
+    /**
47
+     * 婚姻状况
48
+     */
49
+    marriage: string;
50
+    /**
51
+     * 职业
52
+     */
53
+    job: string;
54
+    /**
55
+     * 服务处所
56
+     */
57
+    engageAddr: string;
58
+    /**
59
+     * 住址
60
+     */
61
+    address: string;
62
+    /**
63
+     * 照片64bit压缩编码
64
+     */
65
+    photoData: number[];
66
+    /**
67
+     * 备注
68
+     */
69
+    comments: string;
70
+    /**
71
+     * 照片数据长度
72
+     */
73
+    photoDataLength: number;
74
+}

+ 38
- 0
ant-design-pro-vue3/src/views/front/platfrom/serviceproxy/ServiceFunction/Entitys/ProcessInfo.ts View File

@@ -0,0 +1,38 @@
1
+export interface ProcessInfo {
2
+    /**
3
+     * 流程实例的唯一标识符
4
+     */
5
+    ProcessInstanceId: string;
6
+    /**
7
+     * 流水号
8
+     */
9
+    SerialNo: string;
10
+    /**
11
+     * 流程的创建时间
12
+     */
13
+    StartTime: string;
14
+    /**
15
+     * 流程的结束时间
16
+     */
17
+    EndTime: string;
18
+    /**
19
+     * 当前流程节点的相关信息
20
+     */
21
+    ActivitiInfo: string;
22
+    /**
23
+     * 表示流程的状态,0 代表未结束,1 代表已结束
24
+     */
25
+    IsActive: string;
26
+    /**
27
+     * 负责办理该流程的柜员
28
+     */
29
+    Assignee: string;
30
+    /**
31
+     * 流程结束的原因
32
+     */
33
+    EndReason: string;
34
+    /**
35
+     * 发起该流程的交易号
36
+     */
37
+    TradeNo: string;
38
+}

+ 47
- 0
ant-design-pro-vue3/src/views/front/platfrom/serviceproxy/ServiceFunction/Entitys/THotKeyMessage.ts View File

@@ -0,0 +1,47 @@
1
+// 假设 IEntity 接口定义如下
2
+interface IEntity {
3
+    ChangeToTable(): string[];
4
+    ChangeFromTable(parms: any[]): void;
5
+}
6
+
7
+export class THotKeyMessage implements IEntity {
8
+    public Tellernum: string;
9
+    public KeyName: string;
10
+    public KeyDes: string;
11
+    public KeyState: number;
12
+    public KeyValue: string;
13
+    public KeyType: number;
14
+    public KeyIndex: number;
15
+
16
+    constructor() {
17
+        this.Tellernum = '';
18
+        this.KeyName = '';
19
+        this.KeyDes = '';
20
+        this.KeyState = 0;
21
+        this.KeyValue = '';
22
+        this.KeyType = 0;
23
+        this.KeyIndex = 0;
24
+    }
25
+
26
+    public ChangeToTable(): string[] {
27
+        return [
28
+            this.Tellernum,
29
+            this.KeyName,
30
+            this.KeyDes,
31
+            this.KeyState.toString(),
32
+            this.KeyValue,
33
+            this.KeyType.toString(),
34
+            this.KeyIndex.toString()
35
+        ];
36
+    }
37
+
38
+    public ChangeFromTable(parms: any[]): void {
39
+        this.Tellernum = parms[0].toString();
40
+        this.KeyName = parms[1].toString();
41
+        this.KeyDes = parms[2].toString();
42
+        this.KeyState = parseInt(parms[3].toString(), 10);
43
+        this.KeyValue = parms[4].toString();
44
+        this.KeyType = parseInt(parms[5].toString(), 10);
45
+        this.KeyIndex = parseInt(parms[6].toString(), 10);
46
+    }
47
+}

+ 52
- 0
ant-design-pro-vue3/src/views/front/platfrom/serviceproxy/ServiceFunction/Entitys/TPrintData.ts View File

@@ -0,0 +1,52 @@
1
+// 假设 IEntity 接口定义如下
2
+interface IEntity {
3
+    ChangeToTable(): string[];
4
+    ChangeFromTable(parms: any[]): void;
5
+}
6
+
7
+export class TPrintData implements IEntity {
8
+    // 编号
9
+    public Id: string;
10
+    // 交易实例号
11
+    public BusinessId: string;
12
+    // 表单所属模板号
13
+    public Formid: string;
14
+    // 表单所属模板名称
15
+    public Formname: string;
16
+    // 表单数据
17
+    public Formdata: Uint8Array;
18
+    // 权限次数
19
+    public Rolecount: number;
20
+    // 文件长度
21
+    public FormdataLength: number;
22
+
23
+    constructor() {
24
+        this.Id = '';
25
+        this.BusinessId = '';
26
+        this.Formid = '';
27
+        this.Formname = '';
28
+        this.Formdata = new Uint8Array();
29
+        this.Rolecount = 0;
30
+        this.FormdataLength = 0;
31
+    }
32
+
33
+    public ChangeToTable(): string[] {
34
+        return [
35
+            this.Id,
36
+            this.BusinessId,
37
+            this.Formid,
38
+            this.Formname,
39
+            this.Rolecount.toString(),
40
+            this.Formdata.length.toString()
41
+        ];
42
+    }
43
+
44
+    public ChangeFromTable(parms: any[]): void {
45
+        this.Id = parms[0].toString();
46
+        this.BusinessId = parms[1].toString();
47
+        this.Formid = parms[2].toString();
48
+        this.Formname = parms[3].toString();
49
+        this.Rolecount = parseInt(parms[4].toString(), 10);
50
+        this.FormdataLength = parseInt(parms[5].toString(), 10);
51
+    }
52
+}

+ 36
- 0
ant-design-pro-vue3/src/views/front/platfrom/serviceproxy/ServiceFunction/Entitys/TTellerHotKey.ts View File

@@ -0,0 +1,36 @@
1
+// 假设 IEntity 接口定义如下
2
+interface IEntity {
3
+    ChangeToTable(): string[];
4
+    ChangeFromTable(parms: any[]): void;
5
+}
6
+
7
+export class TTellerHotKey implements IEntity {
8
+    /**
9
+     * 对应快捷键基础表中的快捷键标识
10
+     */
11
+    public KeyName: string;
12
+    /**
13
+     * 柜员号
14
+     */
15
+    public TellerNum: string;
16
+    /**
17
+     * 键值
18
+     */
19
+    public KeyValue: string;
20
+
21
+    constructor() {
22
+        this.KeyName = '';
23
+        this.TellerNum = '';
24
+        this.KeyValue = '';
25
+    }
26
+
27
+    public ChangeToTable(): string[] {
28
+        return [this.KeyName, this.TellerNum, this.KeyValue];
29
+    }
30
+
31
+    public ChangeFromTable(parms: any[]): void {
32
+        this.KeyName = parms[0].toString();
33
+        this.TellerNum = parms[1].toString();
34
+        this.KeyValue = parms[2].toString();
35
+    }
36
+}

+ 30
- 0
ant-design-pro-vue3/src/views/front/platfrom/serviceproxy/ServiceFunction/Entitys/TellerInfo.ts View File

@@ -0,0 +1,30 @@
1
+export interface TellerInfo {
2
+    /**
3
+     * 交易号
4
+     */
5
+    TradeNo: string;
6
+    /**
7
+     * 柜员号
8
+     */
9
+    TellerNo: string;
10
+    /**
11
+     * 柜员权限
12
+     */
13
+    Tlrlvl: string;
14
+    /**
15
+     * 机构号
16
+     */
17
+    BrNo: string;
18
+    /**
19
+     * 交易文件名
20
+     */
21
+    TradeFileName: string;
22
+    /**
23
+     * 流程状态:0:未完成 ;1:正常完成;2:非正常完成
24
+     */
25
+    Status: number;
26
+    /**
27
+     * 后台流水号
28
+     */
29
+    BlackSerialNo: string;
30
+}

+ 61
- 0
ant-design-pro-vue3/src/views/front/platfrom/serviceproxy/ServiceFunction/Entitys/TradeForms.ts View File

@@ -0,0 +1,61 @@
1
+// 假设 IEntity 接口定义如下
2
+interface IEntity {
3
+    ChangeToTable(): string[];
4
+    ChangeFromTable(parms: any[]): void;
5
+}
6
+
7
+export class TradeForms implements IEntity {
8
+    /**
9
+     * 表单模板号
10
+     */
11
+    public FormId: string;
12
+    /**
13
+     * 表单模板名称
14
+     */
15
+    public FormName: string;
16
+    /**
17
+     * 权限次数
18
+     */
19
+    public RoleCount: number;
20
+    /**
21
+     * 是否启用
22
+     */
23
+    public IsEnabled: number;
24
+    /**
25
+     * 打印排序号
26
+     */
27
+    public SortIndex: number;
28
+    /**
29
+     * 可授权级别
30
+     */
31
+    public AuthLevel: string;
32
+
33
+    constructor() {
34
+        this.FormId = '';
35
+        this.FormName = '';
36
+        this.RoleCount = 0;
37
+        this.IsEnabled = 0;
38
+        this.SortIndex = 0;
39
+        this.AuthLevel = '';
40
+    }
41
+
42
+    public ChangeToTable(): string[] {
43
+        return [
44
+            this.FormId,
45
+            this.FormName,
46
+            this.RoleCount.toString(),
47
+            this.IsEnabled.toString(),
48
+            this.SortIndex.toString(),
49
+            this.AuthLevel
50
+        ];
51
+    }
52
+
53
+    public ChangeFromTable(parms: any[]): void {
54
+        this.FormId = parms[0].toString();
55
+        this.FormName = parms[1].toString();
56
+        this.RoleCount = parseInt(parms[2].toString(), 10);
57
+        this.IsEnabled = parseInt(parms[3].toString(), 10);
58
+        this.SortIndex = parseInt(parms[4].toString(), 10);
59
+        this.AuthLevel = parms[5].toString();
60
+    }
61
+}

+ 41
- 0
ant-design-pro-vue3/src/views/front/platfrom/serviceproxy/ServiceFunction/Entitys/TradeInfo.ts View File

@@ -0,0 +1,41 @@
1
+/**
2
+ * 交易信息类,用于存储交易相关的信息。
3
+ */
4
+export class TradeInfo {
5
+    /**
6
+     * 交易号
7
+     */
8
+    public TxCode: string;
9
+    /**
10
+     * 操作员
11
+     */
12
+    public Tel: string;
13
+    /**
14
+     * 交易机构
15
+     */
16
+    public TxBrNo: string;
17
+    /**
18
+     * 授权要素信息
19
+     */
20
+    public AuthElement: string;
21
+    /**
22
+     * 方法序号
23
+     */
24
+    public FuncNum: string;
25
+
26
+    /**
27
+     * 构造函数,用于初始化交易信息对象。
28
+     * @param txCode 交易号
29
+     * @param tel 操作员
30
+     * @param txBrNo 交易机构
31
+     * @param authElement 授权要素信息
32
+     * @param funcNum 方法序号
33
+     */
34
+    constructor(txCode: string, tel: string, txBrNo: string, authElement: string, funcNum: string) {
35
+        this.TxCode = txCode;
36
+        this.Tel = tel;
37
+        this.TxBrNo = txBrNo;
38
+        this.AuthElement = authElement;
39
+        this.FuncNum = funcNum;
40
+    }
41
+}

+ 36
- 0
ant-design-pro-vue3/src/views/front/platfrom/serviceproxy/ServiceFunction/Entitys/TradePrintMessage.ts View File

@@ -0,0 +1,36 @@
1
+// 假设 IEntity 接口定义如下
2
+interface IEntity {
3
+    ChangeToTable(): string[];
4
+    ChangeFromTable(parms: any[]): void;
5
+}
6
+
7
+export class TradePrintMessage implements IEntity {
8
+    /**
9
+     * 交易号
10
+     */
11
+    public TradeNo: string;
12
+    /**
13
+     * 交易名称
14
+     */
15
+    public TradeName: string;
16
+    /**
17
+     * 已有表单数
18
+     */
19
+    public FormCount: number;
20
+
21
+    constructor() {
22
+        this.TradeNo = '';
23
+        this.TradeName = '';
24
+        this.FormCount = 0;
25
+    }
26
+
27
+    public ChangeToTable(): string[] {
28
+        return [this.TradeNo, this.TradeName, this.FormCount.toString()];
29
+    }
30
+
31
+    public ChangeFromTable(parms: any[]): void {
32
+        this.TradeNo = parms[0].toString();
33
+        this.TradeName = parms[1].toString();
34
+        this.FormCount = parseInt(parms[2].toString(), 10);
35
+    }
36
+}

+ 42
- 0
ant-design-pro-vue3/src/views/front/platfrom/serviceproxy/ServiceFunction/Entitys/WorkItemDesc.ts View File

@@ -0,0 +1,42 @@
1
+export interface WorkItemDesc {
2
+    /**
3
+     * 流水号
4
+     */
5
+    SerialNo: string;
6
+    /**
7
+     * 交易号
8
+     */
9
+    TradeNo: string;
10
+    /**
11
+     * 流程创建时间
12
+     */
13
+    BegTime: string;
14
+    /**
15
+     * 完成时间
16
+     */
17
+    EndTime: string;
18
+    /**
19
+     * 任务描述
20
+     */
21
+    TaskDes: string;
22
+    /**
23
+     * 工作项Id
24
+     */
25
+    WorkItemId: string;
26
+    /**
27
+     * 流程Id
28
+     */
29
+    ProcessId: string;
30
+    /**
31
+     * 数据总线数据
32
+     */
33
+    ProcessVariables: { [key: string]: any };
34
+    /**
35
+     * 任务变量数据
36
+     */
37
+    ItemVariables: { [key: string]: any };
38
+    /**
39
+     * 节点名称
40
+     */
41
+    NodeName: string;
42
+}

+ 13
- 0
ant-design-pro-vue3/src/views/front/platfrom/serviceproxy/ServiceFunction/Interfaces/IEntity.ts View File

@@ -0,0 +1,13 @@
1
+/**
2
+ * 服务端实体对象接口
3
+ */
4
+export interface IEntity {
5
+    /**
6
+     * 将服务实体对象向 table 结构转换
7
+     */
8
+    ChangeToTable(): string[];
9
+    /**
10
+     * 将 table 结构数据向服务实体对象转换
11
+     */
12
+    ChangeFromTable(parms: any[]): void;
13
+}

+ 11
- 0
ant-design-pro-vue3/src/views/front/platfrom/serviceproxy/ServiceFunction/Interfaces/ITransitInvoker.ts View File

@@ -0,0 +1,11 @@
1
+import { AttachFile } from '../AttachFile';
2
+import { TransitEntity } from '../TransitEntity';
3
+
4
+export interface ITransitInvoker {
5
+    /**
6
+     * 向服务端做服务方法通讯
7
+     * @param transitentity 传输实体
8
+     * @returns 附件文件列表
9
+     */
10
+    commit(transitentity: TransitEntity): Promise<AttachFile[]>;
11
+}

+ 48
- 0
ant-design-pro-vue3/src/views/front/platfrom/serviceproxy/ServiceFunction/MsgHandle/CryptTools.ts View File

@@ -0,0 +1,48 @@
1
+import CryptoJS from 'crypto-js';
2
+
3
+// 假设 PlatformSettings 类的定义
4
+class PlatformSettings {
5
+    static EncryptsKey: string = 'your_encrypts_key';
6
+    static Encoding = {
7
+        GetBytes: (str: string) => CryptoJS.enc.Utf8.parse(str),
8
+        GetString: (bytes: CryptoJS.lib.WordArray) => CryptoJS.enc.Utf8.stringify(bytes)
9
+    };
10
+}
11
+
12
+export class CryptTools {
13
+    // 加密KEY
14
+    private static KEY = PlatformSettings.EncryptsKey;
15
+
16
+    /**
17
+     * 加密方法
18
+     * @param msg 明文
19
+     * @returns 加密后的字节数组
20
+     */
21
+    public static DesEncryptFixKey(msg: CryptoJS.lib.WordArray): CryptoJS.lib.WordArray {
22
+        const byKey = PlatformSettings.Encoding.GetBytes(this.KEY);
23
+        const IV = CryptoJS.enc.Hex.parse('1234567890ABCDEF');
24
+        const encrypted = CryptoJS.DES.encrypt(msg, byKey, {
25
+            iv: IV,
26
+            mode: CryptoJS.mode.CBC,
27
+            padding: CryptoJS.pad.Pkcs7
28
+        });
29
+        return CryptoJS.enc.Utf8.parse(encrypted.toString());
30
+    }
31
+
32
+    /**
33
+     * 解密方法
34
+     * @param msg 需要解密的字节数组
35
+     * @returns 解密后的字节数组
36
+     */
37
+    public static DesDecryptFixKey(msg: CryptoJS.lib.WordArray): CryptoJS.lib.WordArray {
38
+        const byKey = PlatformSettings.Encoding.GetBytes(this.KEY);
39
+        const IV = CryptoJS.enc.Hex.parse('1234567890ABCDEF');
40
+        const encryptedStr = PlatformSettings.Encoding.GetString(msg);
41
+        const decrypted = CryptoJS.DES.decrypt(encryptedStr, byKey, {
42
+            iv: IV,
43
+            mode: CryptoJS.mode.CBC,
44
+            padding: CryptoJS.pad.Pkcs7
45
+        });
46
+        return decrypted;
47
+    }
48
+}

+ 297
- 0
ant-design-pro-vue3/src/views/front/platfrom/serviceproxy/ServiceFunction/MsgHandle/MessageHandle.ts View File

@@ -0,0 +1,297 @@
1
+import { EncrypDecryptHelper } from '../../../common/BasicFunctions/BaseClasses/EncrypDecryptHelper'
2
+
3
+// 假设 TransitEntity 和 AttachFile 类型定义如下
4
+interface TransitEntity {
5
+    ServiceName: string;
6
+    FuncName: string;
7
+    Parameters: { [key: string]: string };
8
+    AttachFiles: AttachFile[];
9
+}
10
+
11
+interface AttachFile {
12
+    AttachType: string;
13
+    AttachValue: any;
14
+    AttachIndex: string;
15
+}
16
+
17
+// 假设 PlatformSettings 和 PlatformLogger 定义如下
18
+const PlatformSettings = {
19
+    Encoding: {
20
+        BodyName: 'utf-8',
21
+        GetBytes: (str: string) => new TextEncoder().encode(str),
22
+        GetString: (bytes: Uint8Array) => new TextDecoder().decode(bytes)
23
+    },
24
+    IsEncrypt: true
25
+};
26
+
27
+const PlatformLogger = {
28
+    SystemInfo: (info: string) => console.log(info)
29
+};
30
+
31
+// 假设 Types 定义如下
32
+const Types = {
33
+    BaseType: '1',
34
+    ByteType: '2',
35
+    TableType: '3'
36
+};
37
+
38
+// 假设 LoginUserInfo 定义如下
39
+const LoginUserInfo = {
40
+    TellerNo: '123456'
41
+};
42
+
43
+// 假设 EncrypDecryptHelper 定义如下
44
+// const EncrypDecryptHelper = {
45
+//     Encrypt: (data: Uint8Array, flag: boolean) => data, // 简单示例,实际需要实现加密逻辑
46
+//     Decrypt: (data: Uint8Array, flag: boolean) => data  // 简单示例,实际需要实现解密逻辑
47
+// };
48
+
49
+class MessageHandle {
50
+    static GroupMessage(transitentity: TransitEntity): Uint8Array {
51
+        const ms = new Uint8Array(0);
52
+        const logInfo = new StringBuilder();
53
+        const xmlMark = `<?xml version="1.0" encoding="${PlatformSettings.Encoding.BodyName}"?>`;
54
+        let header = '';
55
+        let data = '';
56
+        const doc = new DOMParser().parseFromString('<root></root>', 'text/xml');
57
+
58
+        logInfo.appendLine();
59
+        logInfo.appendLine('组包开始:');
60
+
61
+        // 数据域
62
+        const content = doc.createElement('Content');
63
+        const servicename = doc.createElement('ServiceName');
64
+        servicename.textContent = transitentity.ServiceName;
65
+        const methodname = doc.createElement('MethodName');
66
+        methodname.textContent = transitentity.FuncName;
67
+        const parameters = doc.createElement('Parameters');
68
+        logInfo.appendLine(`服务方法:${transitentity.ServiceName}:${transitentity.FuncName}`);
69
+
70
+        for (const [key, value] of Object.entries(transitentity.Parameters)) {
71
+            const parameter = doc.createElement('Parameter');
72
+            parameter.setAttribute('Index', key);
73
+            parameter.setAttribute('Value', value);
74
+            parameters.appendChild(parameter);
75
+            logInfo.appendLine(`参数:第${key}位参数:${value}`);
76
+        }
77
+
78
+        content.appendChild(servicename);
79
+        content.appendChild(methodname);
80
+        content.appendChild(parameters);
81
+        doc.documentElement.appendChild(content);
82
+        data = xmlMark + new XMLSerializer().serializeToString(doc.documentElement);
83
+        const dataByte = PlatformSettings.Encoding.GetBytes(data);
84
+
85
+        // 附件
86
+        let fileByte = new Uint8Array(0);
87
+        if (transitentity.AttachFiles.length > 0) {
88
+            const fileMs = new Uint8Array(0);
89
+            let index = 0;
90
+            for (const item of transitentity.AttachFiles) {
91
+                let fileValue = '';
92
+                let fByte: Uint8Array;
93
+                let fileType: Uint8Array;
94
+
95
+                if (item.AttachType === Types.BaseType) {
96
+                    fileType = PlatformSettings.Encoding.GetBytes(Types.BaseType);
97
+                    fByte = PlatformSettings.Encoding.GetBytes(item.AttachValue.toString());
98
+                } else if (item.AttachType === Types.ByteType) {
99
+                    fileType = PlatformSettings.Encoding.GetBytes(Types.ByteType);
100
+                    fByte = item.AttachValue as Uint8Array;
101
+                } else if (item.AttachType === Types.TableType) {
102
+                    fileType = PlatformSettings.Encoding.GetBytes(Types.TableType);
103
+                    const tableDoc = new DOMParser().parseFromString('<Table></Table>', 'text/xml');
104
+                    const fileTable = item.AttachValue; // 假设是一个合适的表格数据结构
105
+                    if (fileTable) {
106
+                        const table = tableDoc.documentElement;
107
+                        const rowNumber = tableDoc.createElement('RowNumber');
108
+                        const columnNumber = tableDoc.createElement('ColumnNumber');
109
+                        rowNumber.textContent = fileTable.length.toString();
110
+                        columnNumber.textContent = fileTable[0]?.length.toString() || '0';
111
+                        table.appendChild(rowNumber);
112
+                        table.appendChild(columnNumber);
113
+
114
+                        if (fileTable[0]?.length > 0) {
115
+                            const columns = tableDoc.createElement('Columns');
116
+                            table.appendChild(columns);
117
+                            const fields = tableDoc.createElement('Fields');
118
+                            columns.appendChild(fields);
119
+                            for (const column of fileTable[0]) {
120
+                                const field = tableDoc.createElement('Field');
121
+                                field.textContent = column;
122
+                                fields.appendChild(field);
123
+                            }
124
+                        }
125
+
126
+                        if (fileTable.length > 0) {
127
+                            const rows = tableDoc.createElement('Rows');
128
+                            table.appendChild(rows);
129
+                            for (const list of fileTable) {
130
+                                const row = tableDoc.createElement('row');
131
+                                rows.appendChild(row);
132
+                                const fields = tableDoc.createElement('Fields');
133
+                                row.appendChild(fields);
134
+                                for (const fileCell of list) {
135
+                                    const field = tableDoc.createElement('Field');
136
+                                    field.textContent = fileCell.toString();
137
+                                    fields.appendChild(field);
138
+                                }
139
+                            }
140
+                        }
141
+                    }
142
+                    fileValue = xmlMark + new XMLSerializer().serializeToString(tableDoc.documentElement);
143
+                    fByte = PlatformSettings.Encoding.GetBytes(fileValue);
144
+                }
145
+
146
+                const flen = PlatformSettings.Encoding.GetBytes(fByte.length.toString().padStart(8, '0'));
147
+                const findex = PlatformSettings.Encoding.GetBytes(item.AttachIndex.padStart(2, '0'));
148
+                const fbak = PlatformSettings.Encoding.GetBytes(''.padStart(19, '0'));
149
+
150
+                // 模拟写入操作
151
+                fileByte = new Uint8Array([...fileByte, ...flen, ...fileType, ...findex, ...fbak, ...fByte]);
152
+
153
+                logInfo.appendLine(`第${++index}附件为:${fileValue}`);
154
+            }
155
+        }
156
+
157
+        // 报文头
158
+        const dataLen = dataByte.length.toString().padStart(6, '0');
159
+        const sendType = '0';
160
+        const branchNo = '000000';
161
+        const terminalNo = '000000000000';
162
+        const sendChannel = '0';
163
+        const encryptType = '0';
164
+        const fileCnt = transitentity.AttachFiles.length.toString();
165
+        const terllerNo = LoginUserInfo.TellerNo.padStart(10, ' ');
166
+        const bak = ''.padStart(26, '0');
167
+
168
+        header = dataLen + sendType + branchNo + terminalNo + sendChannel + encryptType + fileCnt + terllerNo + bak;
169
+        logInfo.appendLine(`64位报文头:${header}`);
170
+        const headerByte = PlatformSettings.Encoding.GetBytes(header);
171
+
172
+        // 报文加密与长度计算
173
+        let msgByte = new Uint8Array([...headerByte, ...dataByte, ...fileByte]);
174
+        if (PlatformSettings.IsEncrypt) {
175
+            msgByte = EncrypDecryptHelper.Encrypt(msgByte, true);
176
+        }
177
+        const xmlLenByte = PlatformSettings.Encoding.GetBytes(msgByte.length.toString().padStart(8, '0'));
178
+        const resultByte = new Uint8Array([...xmlLenByte, ...msgByte]);
179
+
180
+        logInfo.appendLine('组包结束');
181
+        PlatformLogger.SystemInfo(logInfo.toString());
182
+        return resultByte;
183
+    }
184
+
185
+    static AnalyseMessage(msg: Uint8Array): AttachFile[] | null {
186
+        let attachfiles: AttachFile[] | null = null;
187
+        const ms = msg;
188
+        const logInfo = new StringBuilder();
189
+
190
+        if (msg.length === 0) {
191
+            logInfo.appendLine('解包数据异常');
192
+            PlatformLogger.SystemInfo(logInfo.toString());
193
+            return null;
194
+        }
195
+
196
+        const doc = new DOMParser().parseFromString('<root></root>', 'text/xml');
197
+        logInfo.appendLine();
198
+        logInfo.appendLine('解包开始');
199
+
200
+        // 报文头 验证总长度
201
+        const lenthByte = ms.slice(0, 8);
202
+        const xmlLen = parseInt(PlatformSettings.Encoding.GetString(lenthByte), 10);
203
+        if (xmlLen !== ms.length - 8) {
204
+            logInfo.appendLine('报文总长度验证失败');
205
+            PlatformLogger.SystemInfo(logInfo.toString());
206
+            return null;
207
+        }
208
+
209
+        let message = ms.slice(8);
210
+        let finalmessage = message;
211
+        if (PlatformSettings.IsEncrypt) {
212
+            finalmessage = EncrypDecryptHelper.Decrypt(message, true);
213
+        }
214
+
215
+        const headerByte = finalmessage.slice(0, 64);
216
+        const header = PlatformSettings.Encoding.GetString(headerByte);
217
+        logInfo.appendLine(`64位报文头:${header}`);
218
+
219
+        const dataLen = parseInt(header.substring(0, 6), 10);
220
+        const FileCnt = parseInt(header.substring(27, 28), 10);
221
+
222
+        // 附件
223
+        if (FileCnt > 0) {
224
+            attachfiles = [];
225
+            let fileByte = finalmessage.slice(64 + dataLen);
226
+            let fl = 0;
227
+            for (let i = 0; i < FileCnt; i++) {
228
+                const attachfile: AttachFile = {
229
+                    AttachType: '',
230
+                    AttachValue: null,
231
+                    AttachIndex: ''
232
+                };
233
+                const fhead = PlatformSettings.Encoding.GetString(fileByte.slice(0, 30));
234
+                const flen = parseInt(fhead.substring(0, 8), 10);
235
+                const fileValue = fileByte.slice(30, 30 + flen);
236
+
237
+                if (fhead.substring(8, 9) === Types.BaseType) {
238
+                    attachfile.AttachType = Types.BaseType;
239
+                    attachfile.AttachValue = PlatformSettings.Encoding.GetString(fileValue);
240
+                } else if (fhead.substring(8, 9) === Types.ByteType) {
241
+                    attachfile.AttachType = Types.ByteType;
242
+                    attachfile.AttachValue = fileValue;
243
+                } else if (fhead.substring(8, 9) === Types.TableType) {
244
+                    attachfile.AttachType = Types.TableType;
245
+                    const fileDt = PlatformSettings.Encoding.GetString(fileValue);
246
+                    const tableDoc = new DOMParser().parseFromString(fileDt, 'text/xml');
247
+                    logInfo.appendLine(`DataTable附件${i + 1}:${fileDt}`);
248
+
249
+                    const table = tableDoc.querySelector('Table');
250
+                    if (table) {
251
+                        const dataTable = [];
252
+                        const columns = table.querySelector('Columns');
253
+                        if (columns) {
254
+                            const fields = columns.querySelectorAll('Field');
255
+                            const columnNames = Array.from(fields).map(field => field.textContent);
256
+                            dataTable.push(columnNames);
257
+                        }
258
+                        const rows = table.querySelector('Rows');
259
+                        if (rows) {
260
+                            const rowElements = rows.querySelectorAll('row');
261
+                            // for (const rowElement of rowElements) {
262
+                            //     const fields = rowElement.querySelectorAll('Field');
263
+                            //     const rowData = Array.from(fields).map(field => field.textContent);
264
+                            //     dataTable.push(rowData);
265
+                            // }
266
+                            //TODO报错了待解决
267
+                        }
268
+                        attachfile.AttachValue = dataTable;
269
+                    }
270
+                }
271
+
272
+                fl += flen + 30;
273
+                fileByte = finalmessage.slice(64 + dataLen + fl);
274
+                attachfiles.push(attachfile);
275
+            }
276
+        }
277
+
278
+        logInfo.appendLine('解包结束');
279
+        PlatformLogger.SystemInfo(logInfo.toString());
280
+        return attachfiles;
281
+    }
282
+}
283
+
284
+// 简单的 StringBuilder 实现
285
+class StringBuilder {
286
+    private value = '';
287
+
288
+    appendLine(line = '') {
289
+        this.value += line + '\n';
290
+    }
291
+
292
+    toString() {
293
+        return this.value;
294
+    }
295
+}
296
+
297
+export default MessageHandle;

+ 158
- 0
ant-design-pro-vue3/src/views/front/platfrom/serviceproxy/ServiceFunction/MsgHandle/SocketTran.ts View File

@@ -0,0 +1,158 @@
1
+// 假设 PlatformSettings 是一个全局对象,这里简单模拟
2
+const PlatformSettings = {
3
+    ServiceAddress: 'localhost:8080',
4
+    Timeout: 5000,
5
+    Encoding: 'utf-8'
6
+};
7
+
8
+// 假设 PlatformLogger 是一个全局对象,这里简单模拟
9
+const PlatformLogger = {
10
+    SystemErrorInfo: (message: string, error: Error) => {
11
+        console.error(`${message} ${error.message}`);
12
+    }
13
+};
14
+
15
+class SocketTran {
16
+    private static readonly _transDataLen = 1024;
17
+    private _mySocket: WebSocket | null = null;
18
+    private readonly _serviceAddress = PlatformSettings.ServiceAddress;
19
+    private readonly _timeout = PlatformSettings.Timeout;
20
+
21
+    private constructor() {}
22
+
23
+    static GetInstance(): SocketTran {
24
+        return new SocketTran();
25
+    }
26
+
27
+    private async Connect(timeout = 0): Promise<boolean> {
28
+        try {
29
+            const [address, portStr] = PlatformSettings.ServiceAddress.split(':');
30
+            const portArray = portStr.split(',');
31
+            const port = parseInt(portArray[Math.floor(Math.random() * portArray.length)], 10);
32
+            const url = `ws://${address}:${port}`;
33
+
34
+            return new Promise<boolean>((resolve, reject) => {
35
+                const socket = new WebSocket(url);
36
+                this._mySocket = socket;
37
+
38
+                const timeoutId = setTimeout(() => {
39
+                    socket.close();
40
+                    reject(new Error('Connection timed out'));
41
+                }, timeout <= 0 ? this._timeout : timeout);
42
+
43
+                socket.onopen = () => {
44
+                    clearTimeout(timeoutId);
45
+                    resolve(true);
46
+                };
47
+
48
+                socket.onerror = (error) => {
49
+                    clearTimeout(timeoutId);
50
+                    PlatformLogger.SystemErrorInfo('Socket连接失败!', error as Error);
51
+                    resolve(false);
52
+                };
53
+            });
54
+        } catch (e) {
55
+            PlatformLogger.SystemErrorInfo('Socket连接失败!', e as Error);
56
+            return false;
57
+        }
58
+    }
59
+
60
+    async Send(msgData: Uint8Array, timeout = 0): Promise<Uint8Array> {
61
+        for (let i = 0; i < 3; i++) {
62
+            if (await this.Connect(timeout)) {
63
+                break;
64
+            }
65
+            await new Promise(resolve => setTimeout(resolve, 100));
66
+        }
67
+
68
+        return this.MsgSend(msgData);
69
+    }
70
+
71
+    private async MsgSend(integrateData: Uint8Array): Promise<Uint8Array> {
72
+        if (!this._mySocket) {
73
+            throw new Error('Socket is not connected');
74
+        }
75
+
76
+        try {
77
+            let index = 0;
78
+            let lastCnt = integrateData.length;
79
+
80
+            // 循环发送数据
81
+            while (lastCnt > 0) {
82
+                let tmpData: Uint8Array;
83
+                if (lastCnt > SocketTran._transDataLen) {
84
+                    tmpData = new Uint8Array(SocketTran._transDataLen);
85
+                    tmpData.set(integrateData.subarray(index, index + SocketTran._transDataLen));
86
+                    this._mySocket.send(tmpData);
87
+                    index += SocketTran._transDataLen;
88
+                    lastCnt -= SocketTran._transDataLen;
89
+                } else {
90
+                    tmpData = new Uint8Array(lastCnt);
91
+                    tmpData.set(integrateData.subarray(index, index + lastCnt));
92
+                    this._mySocket.send(tmpData);
93
+                    lastCnt = 0;
94
+                }
95
+            }
96
+
97
+            // 接收头部8位数据长度
98
+            const headByte = await this.receiveBytes(8);
99
+            const header = new TextDecoder(PlatformSettings.Encoding).decode(headByte);
100
+            const getDataLength = parseInt(header, 10);
101
+
102
+            // 接收数据包
103
+            const memoryStream = new Uint8Array(getDataLength + 8);
104
+            memoryStream.set(headByte, 0);
105
+            let receivedLength = 0;
106
+
107
+            while (receivedLength < getDataLength) {
108
+                const receiveBuffer = await this.receiveBytes(Math.min(getDataLength - receivedLength, SocketTran._transDataLen));
109
+                memoryStream.set(receiveBuffer, 8 + receivedLength);
110
+                receivedLength += receiveBuffer.length;
111
+            }
112
+
113
+            this._mySocket.close();
114
+            return memoryStream;
115
+        } catch (ex) {
116
+            if (this._mySocket) {
117
+                this._mySocket.close();
118
+            }
119
+            PlatformLogger.SystemErrorInfo('Socket通讯失败!错误原因:', ex as Error);
120
+            throw ex;
121
+        }
122
+    }
123
+
124
+    private receiveBytes(length: number): Promise<Uint8Array> {
125
+        if (!this._mySocket) {
126
+            throw new Error('Socket is not connected');
127
+        }
128
+
129
+        return new Promise<Uint8Array>((resolve, reject) => {
130
+            const buffer = new Uint8Array(length);
131
+            let receivedLength = 0;
132
+
133
+            const onMessage = (event: MessageEvent) => {
134
+                const data = new Uint8Array(event.data);
135
+                const remainingLength = length - receivedLength;
136
+                const copyLength = Math.min(remainingLength, data.length);
137
+                buffer.set(data.subarray(0, copyLength), receivedLength);
138
+                receivedLength += copyLength;
139
+
140
+                if (receivedLength === length) {
141
+                    this._mySocket?.removeEventListener('message', onMessage);
142
+                    resolve(buffer);
143
+                }
144
+            };
145
+
146
+            const onError = (error: Event) => {
147
+                this._mySocket?.removeEventListener('message', onMessage);
148
+                this._mySocket?.removeEventListener('error', onError);
149
+                reject(error);
150
+            };
151
+
152
+            this._mySocket.addEventListener('message', onMessage);
153
+            this._mySocket.addEventListener('error', onError);
154
+        });
155
+    }
156
+}
157
+
158
+export default SocketTran;

+ 73
- 0
ant-design-pro-vue3/src/views/front/platfrom/serviceproxy/ServiceFunction/ServiceInstance/NettyInvoker.ts View File

@@ -0,0 +1,73 @@
1
+// 假设这些类型定义已经存在
2
+interface TransitEntity {
3
+    Timeout: number;
4
+    // 其他可能的属性
5
+}
6
+
7
+interface AttachFile {
8
+    // 定义 AttachFile 的属性
9
+}
10
+
11
+interface ITransitlnvoker {
12
+    Commit(transitentity: TransitEntity): Promise<AttachFile[]>;
13
+}
14
+
15
+class MessageHandle {
16
+    static GroupMessage(transitentity: TransitEntity): Uint8Array | null {
17
+        // 实现组报文逻辑
18
+        return null;
19
+    }
20
+
21
+    static AnalyseMessage(reseivemsg: Uint8Array): AttachFile[] | null {
22
+        // 实现解析报文逻辑
23
+        return null;
24
+    }
25
+}
26
+
27
+class SocketTran {
28
+    private static instance: SocketTran;
29
+    private constructor() {}
30
+
31
+    static GetInstance(): SocketTran {
32
+        if (!this.instance) {
33
+            this.instance = new SocketTran();
34
+        }
35
+        return this.instance;
36
+    }
37
+
38
+    async Send(sendmsg: Uint8Array, timeout: number): Promise<Uint8Array | null> {
39
+        // 实现发送报文逻辑
40
+        return null;
41
+    }
42
+}
43
+
44
+class PlatformLogger {
45
+    static SystemErrorInfo(message: string, error: Error): void {
46
+        console.error(message, error);
47
+    }
48
+}
49
+
50
+export class NettyInvoker implements ITransitlnvoker {
51
+    async Commit(transitentity: TransitEntity): Promise<AttachFile[]> {
52
+        let result: AttachFile[] | null = null;
53
+        let sendmsg: Uint8Array | null = null;
54
+        let reseivemsg: Uint8Array | null = null;
55
+        try {
56
+            // 组报文
57
+            sendmsg = MessageHandle.GroupMessage(transitentity);
58
+            if (sendmsg) {
59
+                reseivemsg = await SocketTran.GetInstance().Send(sendmsg, transitentity.Timeout);
60
+                if (reseivemsg) {
61
+                    // 解析报文
62
+                    result = MessageHandle.AnalyseMessage(reseivemsg);
63
+                }
64
+            }
65
+        } catch (e) {
66
+            if (e instanceof Error) {
67
+                PlatformLogger.SystemErrorInfo("报文通讯异常:", e);
68
+            }
69
+            throw new Error("网络通讯失败,请检查网络环境!");
70
+        }
71
+        return result || [];
72
+    }
73
+}

+ 18
- 0
ant-design-pro-vue3/src/views/front/platfrom/serviceproxy/ServiceFunction/ServiceInstance/WebserviceInvoker.ts View File

@@ -0,0 +1,18 @@
1
+// 假设这些类型已经在项目中定义
2
+interface ITransitlnvoker {
3
+    Commit(transitentity: TransitEntity): AttachFile[];
4
+}
5
+
6
+interface TransitEntity {
7
+    // 这里可以根据实际情况定义 TransitEntity 的属性
8
+}
9
+
10
+interface AttachFile {
11
+    // 这里可以根据实际情况定义 AttachFile 的属性
12
+}
13
+
14
+export class WebserviceInvoker implements ITransitlnvoker {
15
+    public Commit(transitentity: TransitEntity): AttachFile[] {
16
+        return null;
17
+    }
18
+}

+ 102
- 0
ant-design-pro-vue3/src/views/front/platfrom/serviceproxy/ServiceFunction/ServiceManager.ts View File

@@ -0,0 +1,102 @@
1
+// 假设以下接口和类已经定义
2
+interface ITransitlnvoker {
3
+    Commit(transitentity: TransitEntity): AttachFile[];
4
+}
5
+
6
+class TransitEntity {
7
+    ServiceName: string;
8
+    FuncName: string;
9
+    Parameters: { [key: string]: string };
10
+}
11
+
12
+class AttachFile {
13
+    AttachValue: any;
14
+}
15
+
16
+class NettyInvoker implements ITransitlnvoker {
17
+    Commit(transitentity: TransitEntity): AttachFile[] {
18
+        // 实现具体逻辑
19
+        return [];
20
+    }
21
+}
22
+
23
+class WebserviceInvoker implements ITransitlnvoker {
24
+    Commit(transitentity: TransitEntity): AttachFile[] {
25
+        // 实现具体逻辑
26
+        return [];
27
+    }
28
+}
29
+
30
+class EncrypDecryptHelper {
31
+    static Instance: EncrypDecryptHelper = new EncrypDecryptHelper();
32
+    Mode = {
33
+        Sm2: 'Sm2'
34
+    };
35
+    Init(mode: string, callback: (input: { [key: string]: string }) => { [key: string]: string } | null): boolean {
36
+        // 实现具体逻辑
37
+        return true;
38
+    }
39
+}
40
+
41
+class CommonFunction {
42
+    static ChangeStrToDic(str: string): { [key: string]: string } {
43
+        // 实现具体逻辑
44
+        return {};
45
+    }
46
+}
47
+
48
+class ServiceManager {
49
+    private transitlnvoker: ITransitlnvoker;
50
+    private static instance: ServiceManager;
51
+
52
+    public static GetInstance(): ServiceManager {
53
+        if (!this.instance) {
54
+            this.instance = new ServiceManager();
55
+        }
56
+        return this.instance;
57
+    }
58
+
59
+    private constructor() {
60
+        this.transitlnvoker = this.GetTransit("netty");
61
+        const flag = EncrypDecryptHelper.Instance.Init(EncrypDecryptHelper.Instance.Mode.Sm2, (input) => {
62
+            const entity = new TransitEntity();
63
+            entity.ServiceName = "UtilService";
64
+            entity.FuncName = "ExChangeKey";
65
+            entity.Parameters = { "1": input["ServerRandomRequest"] };
66
+            const tmpresult = this.Commit(entity);
67
+            if (tmpresult && tmpresult.length === 1) {
68
+                const tradeReturn = CommonFunction.ChangeStrToDic(tmpresult[0].AttachValue.toString());
69
+                if (tradeReturn.hasOwnProperty("dataResult") && tradeReturn.hasOwnProperty("KeyHandle")) {
70
+                    return { "ServerRandom": tradeReturn["dataResult"], "ServerHandle": tradeReturn["KeyHandle"] };
71
+                }
72
+            }
73
+            return null;
74
+        });
75
+        if (!flag) {
76
+            throw new Error("报文通讯加解密初始化异常!");
77
+        }
78
+    }
79
+
80
+    private GetTransit(transittype: string): ITransitlnvoker {
81
+        switch (transittype) {
82
+            case "netty":
83
+                return new NettyInvoker();
84
+            case "webservice":
85
+                return new WebserviceInvoker();
86
+            default:
87
+                return new NettyInvoker();
88
+        }
89
+    }
90
+
91
+    public Commit(transitentity: TransitEntity): AttachFile[] {
92
+        const func = (entity: TransitEntity) => this.transitlnvoker.Commit(entity);
93
+        if (!this.CommitWrapper) {
94
+            return func(transitentity);
95
+        }
96
+        return this.CommitWrapper(transitentity, func);
97
+    }
98
+
99
+    public CommitWrapper: ((transitentity: TransitEntity, func: (entity: TransitEntity) => AttachFile[]) => AttachFile[]) | null = null;
100
+}
101
+
102
+export default ServiceManager;

+ 22
- 0
ant-design-pro-vue3/src/views/front/platfrom/serviceproxy/ServiceFunction/TransitEntity.ts View File

@@ -0,0 +1,22 @@
1
+// 假设 AttachFile 类的定义如下,实际使用时需要根据具体情况修改
2
+class AttachFile {
3
+    // 这里可以添加 AttachFile 类的具体属性和方法
4
+}
5
+
6
+export default class TransitEntity {
7
+    // 服务方法名
8
+    public FuncName: string;
9
+    // 服务类名
10
+    public ServiceName: string;
11
+    // 方法参数(以Dictionary方式,key为参数在方法中的位置,value为参数值)
12
+    public Parameters: { [key: string]: string };
13
+    // 附件列表,特殊结构(转换成table结构)与大数据byte[]参数做为附件传递
14
+    public AttachFiles?: AttachFile[];
15
+    // 超时设置,单位ms
16
+    public Timeout?: number;
17
+
18
+    constructor() {
19
+        this.Parameters = {};
20
+        this.AttachFiles = [];
21
+    }
22
+}

+ 15
- 0
ant-design-pro-vue3/src/views/front/platfrom/serviceproxy/ServiceFunction/Types.ts View File

@@ -0,0 +1,15 @@
1
+// 定义一个 Types 对象,包含三种类型的常量
2
+export const Types = {
3
+    /**
4
+     * 基本类型:String;Int;Boolean等
5
+     */
6
+    BaseType: "1",
7
+    /**
8
+     * Table类型
9
+     */
10
+    TableType: "0",
11
+    /**
12
+     * byte数组类型
13
+     */
14
+    ByteType: "2"
15
+};

+ 400
- 0
ant-design-pro-vue3/src/views/front/platfrom/serviceproxy/ServiceHelper/FilesHandle.ts View File

@@ -0,0 +1,400 @@
1
+import axios, { AxiosResponse } from 'axios';
2
+import FileHandle from '../../common/BasicFunctions/Handles/FileHandle'
3
+
4
+// 假设这些类型在其他文件中定义
5
+interface AttchedFiles {
6
+    Filedata: number[];
7
+    FiledataLength: number;
8
+}
9
+
10
+interface TransitEntity {
11
+    ServiceName: string;
12
+    FuncName: string;
13
+    Parameters?: { [key: string]: string };
14
+    AttachFiles?: AttachFile[];
15
+    Timeout?: number;
16
+}
17
+
18
+interface AttachFile {
19
+    AttachIndex: string;
20
+    AttachType: string;
21
+    AttachValue: any;
22
+}
23
+
24
+interface PFUsedFileInfo {
25
+    Md5: string;
26
+    // 其他属性根据实际情况添加
27
+}
28
+
29
+// 假设这些工具函数在其他文件中定义
30
+class CommonFunction {
31
+    static ChangeEntityToTable(imageList: AttchedFiles[]): any {
32
+        // 实现具体逻辑
33
+        return [];
34
+    }
35
+    static ChangStrToArray(str: string): string[] {
36
+        // 实现具体逻辑
37
+        return [];
38
+    }
39
+    static ChangArrayToStr(arr: string[]): string {
40
+        // 实现具体逻辑
41
+        return '';
42
+    }
43
+    static ChangeTableToEntitys<T>(table: any): T[] {
44
+        // 实现具体逻辑
45
+        return [] as T[];
46
+    }
47
+    static ChangeStrToDic(str: string): { [key: string]: string } {
48
+        // 实现具体逻辑
49
+        return {};
50
+    }
51
+}
52
+
53
+class ServiceManager {
54
+    static async Commit(entity: TransitEntity): Promise<AttachFile[]> {
55
+        // 模拟请求
56
+        const response: AxiosResponse<AttachFile[]> = await axios.post('/api/service', entity);
57
+        return response.data;
58
+    }
59
+}
60
+
61
+class PlatformLogger {
62
+    static SystemErrorInfo(message: string, error: Error) {
63
+        console.error(message, error);
64
+    }
65
+}
66
+
67
+// class FileHandle {
68
+//     static GetFileMD5(fileInfo: any): string {
69
+//         // 实现具体逻辑
70
+//         return '';
71
+//     }
72
+//     static SaveFile(fileInfo: any, data: number[], append: boolean): boolean {
73
+//         // 实现具体逻辑
74
+//         return true;
75
+//     }
76
+// }
77
+
78
+class PlatformSettings {
79
+    static PagesDirectory: string = 'pages';
80
+}
81
+
82
+export default class FilesHandle {
83
+    static UpdateAssemblys: { [key: string]: boolean } = {};
84
+
85
+    static async PutAttachedFiles(imageList: AttchedFiles[]): Promise<string[]> {
86
+        let tradeReturn: string[] | null = null;
87
+        try {
88
+            const entity: TransitEntity = {
89
+                ServiceName: 'ProcessService',
90
+                FuncName: 'PutAttachedFiles',
91
+                AttachFiles: []
92
+            };
93
+
94
+            const attcheds: AttachFile = {
95
+                AttachIndex: '1',
96
+                AttachType: 'TableType',
97
+                AttachValue: CommonFunction.ChangeEntityToTable(imageList)
98
+            };
99
+            entity.AttachFiles.push(attcheds);
100
+
101
+            const memoryStream = new Uint8Array();
102
+            for (const tmp of imageList) {
103
+                memoryStream.set(tmp.Filedata, memoryStream.length);
104
+            }
105
+            const filedata = new Uint8Array(memoryStream.length);
106
+            filedata.set(memoryStream);
107
+
108
+            const attcheds2: AttachFile = {
109
+                AttachIndex: '2',
110
+                AttachType: 'ByteType',
111
+                AttachValue: filedata
112
+            };
113
+            entity.AttachFiles.push(attcheds2);
114
+
115
+            const tmpresult = await ServiceManager.Commit(entity);
116
+            if (tmpresult && tmpresult.length === 1) {
117
+                tradeReturn = CommonFunction.ChangStrToArray(tmpresult[0].AttachValue.toString());
118
+            }
119
+        } catch (e) {
120
+            PlatformLogger.SystemErrorInfo('PutAttachedFiles方法出现异常:', e as Error);
121
+            throw e;
122
+        }
123
+        return tradeReturn!;
124
+    }
125
+
126
+    static async GetAttachedFiles(fileIDs: string[]): Promise<AttchedFiles[]> {
127
+        let tradeReturn: AttchedFiles[] | null = null;
128
+        try {
129
+            const entity: TransitEntity = {
130
+                ServiceName: 'ProcessService',
131
+                FuncName: 'GetAttachedFiles',
132
+                Parameters: { '1': CommonFunction.ChangArrayToStr(fileIDs) }
133
+            };
134
+
135
+            const tmpresult = await ServiceManager.Commit(entity);
136
+            if (tmpresult && tmpresult.length === 2) {
137
+                tradeReturn = CommonFunction.ChangeTableToEntitys<AttchedFiles>(tmpresult[0].AttachValue as any);
138
+                if (tradeReturn) {
139
+                    let i = 0;
140
+                    for (const tmp of tradeReturn) {
141
+                        tmp.Filedata = new Array(tmp.FiledataLength);
142
+                        // tmp.Filedata.set(tmpresult[1].AttachValue.slice(i, i + tmp.FiledataLength));TODO
143
+                        i += tmp.FiledataLength;
144
+                    }
145
+                }
146
+            }
147
+        } catch (e) {
148
+            PlatformLogger.SystemErrorInfo('GetAttachedFiles方法出现异常:', e as Error);
149
+            throw e;
150
+        }
151
+        return tradeReturn!;
152
+    }
153
+
154
+    static async CheckMD5(localFilePath: string, serverFilePath: string): Promise<boolean> {
155
+        let result = false;
156
+        try {
157
+            const entity: TransitEntity = {
158
+                ServiceName: 'UtilService',
159
+                FuncName: 'GetFileMD5',
160
+                Parameters: { '1': serverFilePath }
161
+            };
162
+
163
+            const tmpresult = await ServiceManager.Commit(entity);
164
+            if (tmpresult && tmpresult.length === 1) {
165
+                const serverMd5 = tmpresult[0].AttachValue as string;
166
+                const fileInfo = new FileHandle();
167
+                const localMd5 = "";// fileInfo.GetFileMD5(localFilePath);//微软自带的fileInfo TODO
168
+                result = localMd5.toUpperCase() === serverMd5.toUpperCase();
169
+            }
170
+        } catch (e) {
171
+            PlatformLogger.SystemErrorInfo('GetFileMD5方法出现异常:', e as Error);
172
+            throw e;
173
+        }
174
+        return result;
175
+    }
176
+
177
+    static async UpdateTradeDll(actionName: string): Promise<boolean> {
178
+        if (this.UpdateAssemblys[actionName]) {
179
+            delete this.UpdateAssemblys[actionName];
180
+        }
181
+
182
+        let result = false;
183
+        try {
184
+            const fileName = `${actionName}.dll`;
185
+            const localFilePath = `${process.cwd()}/${PlatformSettings.PagesDirectory}/${fileName}`;
186
+
187
+            const localFile = new FileHandle();
188
+            if (localFile) {
189
+                const files = await this.GetUsedFilesInfo(`/${PlatformSettings.PagesDirectory}`, fileName, '1');
190
+                if (files.length === 1) {
191
+                    const localMd5 = "";// localFile.GetFileMD5(localFilePath);////微软自带的fileInfo TODO
192
+                    const serverMd5 = files[0].Md5;
193
+                    if (localMd5.toUpperCase() === serverMd5.toUpperCase()) {
194
+                        this.UpdateAssemblys[actionName] = false;
195
+                        return true;
196
+                    }
197
+                } else {
198
+                    this.UpdateAssemblys[actionName] = false;
199
+                    return false;
200
+                }
201
+            }
202
+
203
+            const data = await this.GetDllFile(fileName, `/${PlatformSettings.PagesDirectory}`);
204
+            if (data) {
205
+                result = true;// localFile.SaveFile(localFilePath, data, false);//localFile TODO
206
+                this.UpdateAssemblys[actionName] = true;
207
+            }
208
+        } catch (e) {
209
+            PlatformLogger.SystemErrorInfo('更新DLL文件UpdateTradeDll方法出现异常:', e as Error);
210
+        }
211
+        return result;
212
+    }
213
+
214
+    static async GetDllFile(fileName: string, filePath: string): Promise<number[] | null> {
215
+        let result: number[] | null = null;
216
+        try {
217
+            const entity: TransitEntity = {
218
+                ServiceName: 'PlatFormService',
219
+                FuncName: 'GetDllFile',
220
+                Parameters: { '1': fileName, '2': filePath }
221
+            };
222
+
223
+            const tmpresult = await ServiceManager.Commit(entity);
224
+            if (tmpresult && tmpresult.length === 1) {
225
+                result = tmpresult[0].AttachValue as number[];
226
+            }
227
+        } catch (e) {
228
+            PlatformLogger.SystemErrorInfo('GetDllFile方法出现异常:', e as Error);
229
+            throw e;
230
+        }
231
+        return result;
232
+    }
233
+
234
+    static async GetServerFileNames(serverFilePath: string): Promise<{ [key: string]: string } | null> {
235
+        let tradeReturn: { [key: string]: string } | null = null;
236
+        if (!serverFilePath) {
237
+            throw new Error('参数不能为空');
238
+        }
239
+        try {
240
+            const entity: TransitEntity = {
241
+                ServiceName: 'UtilService',
242
+                FuncName: 'GetListFileNames',
243
+                Parameters: { '1': serverFilePath }
244
+            };
245
+
246
+            const tmpresult = await ServiceManager.Commit(entity);
247
+            if (tmpresult && tmpresult.length === 1) {
248
+                tradeReturn = CommonFunction.ChangeStrToDic(tmpresult[0].AttachValue.toString());
249
+            }
250
+        } catch (e) {
251
+            PlatformLogger.SystemErrorInfo('GetListFileNames方法出现异常:', e as Error);
252
+            throw e;
253
+        }
254
+        return tradeReturn;
255
+    }
256
+
257
+    static async SaveFileData(serverFilePath: string, fileData: number[], append: boolean): Promise<boolean> {
258
+        let tradeReturn = false;
259
+        try {
260
+            const entity: TransitEntity = {
261
+                ServiceName: 'UtilService',
262
+                FuncName: 'SaveFile',
263
+                Parameters: { '1': serverFilePath, '3': append.toString() },
264
+                AttachFiles: []
265
+            };
266
+
267
+            const file: AttachFile = {
268
+                AttachIndex: '2',
269
+                AttachType: 'ByteType',
270
+                AttachValue: fileData
271
+            };
272
+            entity.AttachFiles.push(file);
273
+
274
+            const tmpresult = await ServiceManager.Commit(entity);
275
+            if (tmpresult && tmpresult.length === 1) {
276
+                tradeReturn = Boolean(tmpresult[0].AttachValue);
277
+            }
278
+        } catch (e) {
279
+            PlatformLogger.SystemErrorInfo('SaveFile方法出现异常:', e as Error);
280
+            throw e;
281
+        }
282
+        return tradeReturn;
283
+    }
284
+
285
+    static async DownloadFile(localFilePath: string, serverFilePath: string): Promise<boolean> {
286
+        let SaveFileresult;
287
+        try {
288
+            if (!serverFilePath || !localFilePath) {
289
+                throw new Error('参数不能为空');
290
+            }
291
+
292
+            const result = await this.GetFileData(serverFilePath);
293
+            if (result && result.length > 0) {
294
+                //const fileHandle = new FileHandle();
295
+                SaveFileresult = FileHandle.SaveFile(localFilePath, result, false);//类中的GetFileData的将原来的byte转换成额buffer
296
+            }
297
+        } catch (e) {
298
+            PlatformLogger.SystemErrorInfo('DownloadFile方法出现异常:', e as Error);
299
+            throw e;
300
+        }
301
+        return SaveFileresult;
302
+    }
303
+
304
+    static async GetFileData(serverFilePath: string): Promise<Buffer | null> {
305
+        const size = 1024 * 50;
306
+        let tradeReturn: Buffer | null = null;
307
+        let len = 0;
308
+        try {
309
+            len = await this.GetFileBlockLength(serverFilePath);
310
+
311
+            if (len <= size) {
312
+                const entity2: TransitEntity = {
313
+                    ServiceName: 'UtilService',
314
+                    FuncName: 'GetFile',
315
+                    Parameters: { '1': serverFilePath },
316
+                    Timeout: 10000
317
+                };
318
+
319
+                const tmpresult2 = await ServiceManager.Commit(entity2);
320
+                if (tmpresult2 && tmpresult2.length === 1) {
321
+                    tradeReturn = tmpresult2[0].AttachValue as Buffer;
322
+                }
323
+            } else {
324
+                //tradeReturn = new Array(len);
325
+                let offset = 0;
326
+                while (offset < len) {
327
+                    const lens = len - offset > size ? size : len - offset;
328
+                    const result = await this.GetFileBlock(serverFilePath, offset, lens);
329
+                    //tradeReturn.set(result, offset);TODO
330
+                    offset += size;
331
+                }
332
+            }
333
+        } catch (e) {
334
+            PlatformLogger.SystemErrorInfo('GetFile方法出现异常:', e as Error);
335
+            throw e;
336
+        }
337
+        return tradeReturn;
338
+    }
339
+
340
+    static async GetUsedFilesInfo(fileName: string, filePath: string, fileType: string): Promise<PFUsedFileInfo[]> {
341
+        let result: PFUsedFileInfo[] | null = null;
342
+        try {
343
+            const entity: TransitEntity = {
344
+                ServiceName: 'PlatFormService',
345
+                FuncName: 'GetUsedFilesInfo',
346
+                Parameters: { '1': fileName, '2': filePath, '3': fileType }
347
+            };
348
+
349
+            const tmpresult = await ServiceManager.Commit(entity);
350
+            if (tmpresult && tmpresult.length === 1) {
351
+                result = CommonFunction.ChangeTableToEntitys<PFUsedFileInfo>(tmpresult[0].AttachValue as any);
352
+            }
353
+        } catch (e) {
354
+            PlatformLogger.SystemErrorInfo('GetUsedFilesInfo方法出现异常:', e as Error);
355
+            throw e;
356
+        }
357
+        return result!;
358
+    }
359
+
360
+    static async GetFileBlock(fileName: string, offset: number, length: number): Promise<number[] | null> {
361
+        let result: number[] | null = null;
362
+        try {
363
+            const entity: TransitEntity = {
364
+                ServiceName: 'UtilService',
365
+                FuncName: 'GetFileByLength',
366
+                Parameters: { '1': fileName, '2': offset.toString(), '3': length.toString() },
367
+                Timeout: 10000
368
+            };
369
+
370
+            const tmpresult = await ServiceManager.Commit(entity);
371
+            if (tmpresult && tmpresult.length === 1) {
372
+                result = tmpresult[0].AttachValue as number[];
373
+            }
374
+        } catch (e) {
375
+            PlatformLogger.SystemErrorInfo('GetFileByLength方法出现异常:', e as Error);
376
+            throw e;
377
+        }
378
+        return result;
379
+    }
380
+
381
+    static async GetFileBlockLength(fileName: string): Promise<number> {
382
+        let len = 0;
383
+        try {
384
+            const entity: TransitEntity = {
385
+                ServiceName: 'UtilService',
386
+                FuncName: 'GetFileLength',
387
+                Parameters: { '1': fileName }
388
+            };
389
+
390
+            const tmpresult = await ServiceManager.Commit(entity);
391
+            if (tmpresult && tmpresult.length === 1) {
392
+                len = Number(tmpresult[0].AttachValue);
393
+            }
394
+        } catch (e) {
395
+            PlatformLogger.SystemErrorInfo('GetFileLength方法出现异常:', e as Error);
396
+            throw e;
397
+        }
398
+        return len;
399
+    }
400
+}

+ 142
- 0
ant-design-pro-vue3/src/views/front/platfrom/serviceproxy/ServiceHelper/HotKeysHandle.ts View File

@@ -0,0 +1,142 @@
1
+// 假设这些类型定义在其他文件中,这里简单模拟
2
+interface TransitEntity {
3
+    ServiceName: string;
4
+    FuncName: string;
5
+    Parameters: { [key: string]: string };
6
+    AttachFiles?: { AttachIndex: string; AttachType: any; AttachValue: any }[];
7
+}
8
+
9
+interface AttachFile {
10
+    AttachIndex: string;
11
+    AttachType: any;
12
+    AttachValue: any;
13
+}
14
+
15
+interface THotKeyMessage {
16
+    // 这里可以根据实际情况补充属性
17
+}
18
+
19
+interface TTellerHotKey {
20
+    // 这里可以根据实际情况补充属性
21
+}
22
+
23
+class ServiceManager {
24
+    private static instance: ServiceManager;
25
+
26
+    private constructor() { }
27
+
28
+    static GetInstance() {
29
+        if (!this.instance) {
30
+            this.instance = new ServiceManager();
31
+        }
32
+        return this.instance;
33
+    }
34
+
35
+    Commit(entity: TransitEntity): AttachFile[] {
36
+        // 这里需要实现实际的提交逻辑
37
+        return [];
38
+    }
39
+}
40
+
41
+class CommonFunction {
42
+    static ChangeTableToEntitys<T>(table: any): T[] {
43
+        // 这里需要实现实际的转换逻辑
44
+        return [] as T[];
45
+    }
46
+
47
+    static ChangeEntityToTable(entity: any): any {
48
+        // 这里需要实现实际的转换逻辑
49
+        return {};
50
+    }
51
+}
52
+
53
+class PlatformLogger {
54
+    static SystemErrorInfo(message: string, error: Error) {
55
+        console.error(message, error);
56
+    }
57
+}
58
+
59
+export class HotKeysHandle {
60
+    static GetKeyByTeller(tellerNum: string): THotKeyMessage[] {
61
+        let result: THotKeyMessage[] = null;
62
+        try {
63
+            const entity: TransitEntity = {
64
+                ServiceName: "HotKeyService",
65
+                FuncName: "GetKeyByTeller",
66
+                Parameters: { "1": tellerNum }
67
+            };
68
+            const tmpresult = ServiceManager.GetInstance().Commit(entity);
69
+            if (tmpresult && tmpresult.length === 1) {
70
+                result = CommonFunction.ChangeTableToEntitys<THotKeyMessage>(tmpresult[0].AttachValue);
71
+            }
72
+        } catch (e) {
73
+            PlatformLogger.SystemErrorInfo("GetKeyByTeller方法出现异常:", e as Error);
74
+            throw e;
75
+        }
76
+        return result;
77
+    }
78
+
79
+    static DelKeyMessage(keyName: string, tellerNum: string): boolean {
80
+        let result = false;
81
+        try {
82
+            const entity: TransitEntity = {
83
+                ServiceName: "HotKeyService",
84
+                FuncName: "DelKeyMessage",
85
+                Parameters: { "1": keyName, "2": tellerNum }
86
+            };
87
+            const tmpresult = ServiceManager.GetInstance().Commit(entity);
88
+            if (tmpresult && tmpresult.length === 1) {
89
+                result = Boolean(tmpresult[0].AttachValue);
90
+            }
91
+        } catch (e) {
92
+            PlatformLogger.SystemErrorInfo("DelKeyMessage方法出现异常:", e as Error);
93
+            throw e;
94
+        }
95
+        return result;
96
+    }
97
+
98
+    static DelKeyValue(keyName: string, tellerNum: string, keyValue: string): boolean {
99
+        let result = false;
100
+        try {
101
+            const entity: TransitEntity = {
102
+                ServiceName: "HotKeyService",
103
+                FuncName: "DelKeyValue",
104
+                Parameters: { "1": keyName, "2": tellerNum, "3": keyValue }
105
+            };
106
+            const tmpresult = ServiceManager.GetInstance().Commit(entity);
107
+            if (tmpresult && tmpresult.length === 1) {
108
+                result = Boolean(tmpresult[0].AttachValue);
109
+            }
110
+        } catch (e) {
111
+            PlatformLogger.SystemErrorInfo("DelKeyValue方法出现异常:", e as Error);
112
+            throw e;
113
+        }
114
+        return result;
115
+    }
116
+
117
+    static UpdateKeyMessage(tTellerHotkey: TTellerHotKey): boolean {
118
+        let result = false;
119
+        try {
120
+            const entity: TransitEntity = {
121
+                ServiceName: "HotKeyService",
122
+                FuncName: "UpdateKeyMessage",
123
+                AttachFiles: [],
124
+                Parameters: {}
125
+            };
126
+            const attach: AttachFile = {
127
+                AttachIndex: "1",
128
+                AttachType: "TableType", // 这里假设 TableType 是一个常量或类型
129
+                AttachValue: CommonFunction.ChangeEntityToTable([tTellerHotkey])
130
+            };
131
+            entity.AttachFiles.push(attach);
132
+            const tmpresult = ServiceManager.GetInstance().Commit(entity);
133
+            if (tmpresult && tmpresult.length === 1) {
134
+                result = Boolean(tmpresult[0].AttachValue);
135
+            }
136
+        } catch (e) {
137
+            PlatformLogger.SystemErrorInfo("UpdateKeyMessage方法出现异常:", e as Error);
138
+            throw e;
139
+        }
140
+        return result;
141
+    }
142
+}

+ 182
- 0
ant-design-pro-vue3/src/views/front/platfrom/serviceproxy/ServiceHelper/InitializeHandle.ts View File

@@ -0,0 +1,182 @@
1
+
2
+import TransitEntity from '../ServiceFunction/TransitEntity';
3
+import ServiceManager from '../ServiceFunction/ServiceManager';
4
+import CommonFunction from '../CommonFunction';
5
+import FilesHandle from '../ServiceHelper/FilesHandle'
6
+
7
+//import { CommonParames, TradeParames } from '../../Common/RunningParameters/CommonParames';
8
+
9
+// 假设这些类型和方法在其他文件中定义 TODO 
10
+// interface TransitEntity {
11
+//     ServiceName: string;
12
+//     FuncName: string;
13
+//     Parameters?: { [key: string]: string };
14
+// }
15
+
16
+interface AttachFile {
17
+    AttachValue: any;
18
+}
19
+
20
+
21
+// 假设这些全局参数在其他文件中定义
22
+namespace CommonParames {
23
+    export let MsgErrorMap: { [key: string]: string };
24
+    export let Coding: string;
25
+    export let SysName: string;
26
+    export let UpdatedClientPath: string;
27
+    export let TradeInfoPath: string;
28
+    export let ConfigFilePath: string;
29
+    export let TempFilePath: string;
30
+    export let TellerSysHelp: string;
31
+}
32
+
33
+namespace TradeParames {
34
+    export let MsgFormat: { [key: string]: { [key: string]: any } };
35
+}
36
+
37
+export class InitializeHandle {
38
+    static async InitMsgFormat() {
39
+        if (!TradeParames.MsgFormat) {
40
+            // TradeParames.MsgFormat = await this.GetMessageFormatMap();//TODO
41
+        }
42
+    }
43
+
44
+    static async InitErrorMap() {
45
+        if (!CommonParames.MsgErrorMap) {
46
+            CommonParames.MsgErrorMap = await this.GetErrorMap();
47
+        }
48
+    }
49
+
50
+    static async InitConfig() {
51
+        try {
52
+            let result: string | null = null;
53
+            const entity: TransitEntity = {
54
+                ServiceName: "CommonService",
55
+                FuncName: "GetClientConfig",
56
+                Parameters: {},
57
+                AttachFiles: null,
58
+                Timeout: 10000
59
+            };
60
+            const tmpresult = ServiceManager.GetInstance().Commit(entity);
61
+            if (tmpresult && tmpresult.length === 1) {
62
+                result = tmpresult[0].AttachValue as string;
63
+            }
64
+
65
+            const dict = CommonFunction.ChangeStrToDic(result);
66
+            // 初始化配置文件
67
+            CommonParames.Coding = dict["CharacterSet"];
68
+            CommonParames.SysName = dict["MsgTitle"];
69
+            CommonParames.UpdatedClientPath = dict["UpdatedClientPath"];
70
+            CommonParames.TradeInfoPath = dict["TradeInfoPath"];
71
+            CommonParames.ConfigFilePath = dict["ConfigFilePath"];
72
+            CommonParames.TempFilePath = dict["TempFilePath"];
73
+            CommonParames.TellerSysHelp = dict["TellerSysHelp"];
74
+        } catch (e) {
75
+            throw e;
76
+        }
77
+        return true;
78
+    }
79
+
80
+    static async GetFdItemMap() {
81
+        const table: { [key: string]: string }[] = [];
82
+        const entity: TransitEntity = {
83
+            ServiceName: "TradeService",
84
+            FuncName: "GetFdItemMap",
85
+            Parameters: {},
86
+            AttachFiles: null,
87
+            Timeout: 10000
88
+        };
89
+        const tmpresult = ServiceManager.GetInstance().Commit(entity);
90
+        let data: string | null = null;
91
+        if (tmpresult && tmpresult.length === 1) {
92
+            data = tmpresult[0].AttachValue as string;
93
+        }
94
+        if (data) {
95
+            const lines = data.split('\n');
96
+            for (const line of lines) {
97
+                if (line) {
98
+                    const rows = line.split('|');
99
+                    const item = {
100
+                        Code: rows[0],
101
+                        Type: rows[1],
102
+                        Length: rows[2],
103
+                        DotLength: rows[3],
104
+                        Description: rows[4],
105
+                        FieldType: rows[5],
106
+                        MaxLength: rows[6],
107
+                        DataName: rows[7]
108
+                    };
109
+                    table.push(item);
110
+                }
111
+            }
112
+        }
113
+        return table;
114
+    }
115
+
116
+    static async GetMessageFormatMap() {
117
+        // const messageFormatMap: { [key in Transit]: { [key: string]: any } } = {} as any;
118
+        // const transits = Object.values(Transit);
119
+        // for (const transit of transits) {
120
+        //    const dictionary = await this.GetTradeMessageFormat(transit.toString());
121
+        //    if (dictionary && Object.keys(dictionary).length > 0) {
122
+        //        messageFormatMap[transit as Transit] = dictionary;
123
+        //    }
124
+        //  }
125
+        return "";
126
+    }
127
+
128
+    static async GetTradeMessageFormat(transitName: string) {
129
+        let dictionary: { [key: string]: any } | null = null;
130
+        try {
131
+            const entity: TransitEntity = {
132
+                ServiceName: "TradeService",
133
+                FuncName: "GetTradeMessageFormat",
134
+                Parameters: { "1": transitName },
135
+                AttachFiles: null,
136
+                Timeout: 10000
137
+            };
138
+            const tmpresult = ServiceManager.GetInstance().Commit(entity);
139
+            if (tmpresult && tmpresult.length === 1) {
140
+                dictionary = CommonFunction.ChangeStrToDic(tmpresult[0].AttachValue.toString());
141
+            }
142
+        } catch (e) {
143
+            throw e;
144
+        }
145
+        return dictionary;
146
+    }
147
+
148
+    static async GetErrorMap() {
149
+        // TODO: 暂时先这样处理,考虑移动到更新管理中去
150
+        const localPath = `${process.cwd()}/errorMap.xml`;
151
+        const serverPath = `${CommonParames.ConfigFilePath}errorMap.xml`;
152
+        const fs = require('fs').promises;
153
+        const isFileValid = await FilesHandle.CheckMD5(localPath, serverPath);
154
+        if (!fs.existsSync(localPath) || !isFileValid) {
155
+            // 更新文件
156
+            if (fs.existsSync(localPath)) {
157
+                await fs.unlink(localPath);
158
+            }
159
+            const data = await FilesHandle.GetFileData(serverPath);
160
+            await fs.writeFile(localPath, Buffer.from(data));
161
+        }
162
+        // 读取配置文件
163
+        const dictionary: { [key: string]: string } = {};
164
+        const xml = await fs.readFile(localPath, 'utf-8');
165
+        const DOMParser = require('xmldom').DOMParser;
166
+        const document = new DOMParser().parseFromString(xml, 'text/xml');
167
+        const root = document.documentElement;
168
+        if (root) {
169
+            for (let i = 0; i < root.childNodes.length; i++) {
170
+                const node = root.childNodes[i];
171
+                if (node.nodeName === "error") {
172
+                    const name = node.attributes.getNamedItem("name")?.value;
173
+                    const value = node.attributes.getNamedItem("value")?.value;
174
+                    if (name && value) {
175
+                        dictionary[name] = value;
176
+                    }
177
+                }
178
+            }
179
+        }
180
+        return dictionary;
181
+    }
182
+}

+ 107
- 0
ant-design-pro-vue3/src/views/front/platfrom/serviceproxy/ServiceHelper/PicpHandle.ts View File

@@ -0,0 +1,107 @@
1
+//TODO此代码没用
2
+
3
+// // 假设这些类型定义在其他文件中,需要根据实际情况导入
4
+// //import { AttachFile, PicpCheckRecords, PicpCheckResInfo, Types } from './your-entity-types';
5
+
6
+// import TransitEntity from '../ServiceFunction/TransitEntity';
7
+// import ServiceManager from '../ServiceFunction/ServiceManager';
8
+// import CommonFunction from '../CommonFunction';
9
+// import FilesHandle from '../ServiceHelper/FilesHandle'
10
+// export class PicpHandle {
11
+//     public static async PicpCommonRequest(msgStr: string): Promise<Uint8Array | null> {
12
+//         let tradeReturn: Uint8Array | null = null;
13
+//         try {
14
+//             const entity: TransitEntity = {
15
+//                 ServiceName: "PicpService",
16
+//                 FuncName: "PicpCommonRequest",
17
+//                 Parameters: { "1": msgStr }
18
+//             };
19
+//             const tmpresult = await ServiceManager.GetInstance().Commit(entity);
20
+//             if (tmpresult && tmpresult.length === 1) {
21
+//                 tradeReturn = tmpresult[0].AttachValue as Uint8Array;
22
+//             }
23
+//         } catch (e) {
24
+//             throw e;
25
+//         }
26
+//         return tradeReturn;
27
+//     }
28
+
29
+//     public static async PicpCheckRequest(picpCheckRecords: PicpCheckRecords): Promise<PicpCheckResInfo | null> {
30
+//         let tradeReturn: PicpCheckResInfo | null = null;
31
+//         try {
32
+//             const entity: TransitEntity = {
33
+//                 ServiceName: "PicpService",
34
+//                 FuncName: "PicpCheckRequest",
35
+//                 Parameters: {},
36
+//                 AttachFiles: []
37
+//             };
38
+//             const attcheds: AttachFile = {
39
+//                 AttachIndex: "1",
40
+//                 AttachType: Types.TableType,
41
+//                 //  AttachValue: CommonFunction.ChangeEntityTable<PicpCheckRecords[], any>([picpCheckRecords])
42
+//             };
43
+//             entity.AttachFiles.push(attcheds);
44
+//             const tmpresult = await ServiceManager.GetInstance().Commit(entity);
45
+//             if (tmpresult && tmpresult.length === 1) {
46
+//                 //tradeReturn = CommonFunction.ChangeEntityTable<any, PicpCheckResInfo>(tmpresult[0].AttachValue as any);
47
+//                 if (tradeReturn) {
48
+//                     tradeReturn.photoData = tmpresult[1].AttachValue as Uint8Array;
49
+//                 }
50
+//             }
51
+//         } catch (e) {
52
+//             throw e;
53
+//         }
54
+//         return tradeReturn;
55
+//     }
56
+
57
+//     public static async GenCheckReqMessage(picpCheckRecords: PicpCheckRecords): Promise<string | null> {
58
+//         let tradeReturn: string | null = null;
59
+//         try {
60
+//             const entity: TransitEntity = {
61
+//                 ServiceName: "PicpService",
62
+//                 FuncName: "GenCheckReqMessage",
63
+//                 AttachFiles: []
64
+//             };
65
+//             const attcheds: AttachFile = {
66
+//                 AttachIndex: "1",
67
+//                 AttachType: Types.TableType,
68
+//                 AttachValue: CommonFunction.ChangeEntityTable<PicpCheckRecords[], any>([picpCheckRecords])
69
+//             };
70
+//             entity.AttachFiles.push(attcheds);
71
+//             const tmpresult = await ServiceManager.GetInstance().Commit(entity);
72
+//             if (tmpresult && tmpresult.length === 1) {
73
+//                 tradeReturn = tmpresult[0].AttachValue.toString();
74
+//             }
75
+//         } catch (e) {
76
+//             throw e;
77
+//         }
78
+//         return tradeReturn;
79
+//     }
80
+
81
+//     public static async AnalyzeCheckResMessage(recvData: Uint8Array): Promise<PicpCheckResInfo | null> {
82
+//         let tradeReturn: PicpCheckResInfo | null = null;
83
+//         try {
84
+//             const entity: TransitEntity = {
85
+//                 ServiceName: "PicpService",
86
+//                 FuncName: "AnalyzeCheckResMessage",
87
+//                 AttachFiles: []
88
+//             };
89
+//             const attcheds2: AttachFile = {
90
+//                 AttachIndex: "1",
91
+//                 AttachType: Types.ByteType,
92
+//                 AttachValue: recvData
93
+//             };
94
+//             entity.AttachFiles.push(attcheds2);
95
+//             const tmpresult = await ServiceManager.GetInstance().Commit(entity);
96
+//             if (tmpresult && tmpresult.length === 1) {
97
+//                 tradeReturn = CommonFunction.ChangeEntityTable<any, PicpCheckResInfo>(tmpresult[0].AttachValue as any);
98
+//                 if (tradeReturn) {
99
+//                     tradeReturn.photoData = tmpresult[1].AttachValue as Uint8Array;
100
+//                 }
101
+//             }
102
+//         } catch (e) {
103
+//             throw e;
104
+//         }
105
+//         return tradeReturn;
106
+//     }
107
+// }

+ 228
- 0
ant-design-pro-vue3/src/views/front/platfrom/serviceproxy/ServiceHelper/PrintHandle.ts View File

@@ -0,0 +1,228 @@
1
+import axios from 'axios';
2
+
3
+// 假设这些类型定义在其他文件中
4
+interface TransitEntity {
5
+  ServiceName: string;
6
+  FuncName: string;
7
+  Parameters: { [key: string]: string };
8
+  AttachFiles: AttachFile[];
9
+}
10
+
11
+interface AttachFile {
12
+  AttachIndex: string;
13
+  AttachType: string;
14
+  AttachValue: any;
15
+}
16
+
17
+interface TradeForms {}
18
+interface TradePrintMessage {}
19
+interface TPrintData {
20
+  Formdata: any;
21
+  FormdataLength: number;
22
+}
23
+
24
+// 假设 ServiceManager 类的 Commit 方法对应一个 HTTP 请求
25
+const ServiceManager = {
26
+  GetInstance: () => ({
27
+    Commit: async (entity: TransitEntity) => {
28
+      try {
29
+        const response = await axios.post('/api/print-service', entity);
30
+        return response.data;
31
+      } catch (error) {
32
+        throw error;
33
+      }
34
+    },
35
+  }),
36
+};
37
+
38
+// 假设 CommonFunction 类的方法已经实现
39
+class CommonFunction {
40
+  static ChangeEntityToTable(entity: any) {
41
+    // 实现实体到 DataTable 的转换逻辑
42
+    return null;
43
+  }
44
+
45
+  static ChangeTableToEntitys<T>(table: any): T[] {
46
+    // 实现 DataTable 到实体数组的转换逻辑
47
+    return [];
48
+  }
49
+}
50
+
51
+// 假设 PlatformLogger 类的方法已经实现
52
+class PlatformLogger {
53
+  static SystemErrorInfo(message: string, error: any) {
54
+    console.error(message, error);
55
+  }
56
+}
57
+
58
+export class PrintHandle {
59
+  static async AddTradeForm(tradeid: string, tradeform: TradeForms[]): Promise<boolean> {
60
+    try {
61
+      const entity: TransitEntity = {
62
+        ServiceName: 'PrintService',
63
+        FuncName: 'AddTradeForm',
64
+        Parameters: { '1': tradeid },
65
+        AttachFiles: [],
66
+      };
67
+
68
+      const data: AttachFile = {
69
+        AttachIndex: '2',
70
+        AttachType: 'TableType',
71
+        AttachValue: CommonFunction.ChangeEntityToTable(tradeform),
72
+      };
73
+      entity.AttachFiles.push(data);
74
+
75
+      const tmpresult = await ServiceManager.GetInstance().Commit(entity);
76
+      if (tmpresult && tmpresult.length === 1) {
77
+        return Boolean(tmpresult[0].AttachValue);
78
+      }
79
+      return false;
80
+    } catch (e) {
81
+      PlatformLogger.SystemErrorInfo('AddTradeForm方法出现异常:', e);
82
+      throw e;
83
+    }
84
+  }
85
+
86
+  static async GetTradePrintMessage(tradeno: string, tradename: string): Promise<TradePrintMessage[]> {
87
+    try {
88
+      const entity: TransitEntity = {
89
+        ServiceName: 'PrintService',
90
+        FuncName: 'GetTradePrintMessage',
91
+        Parameters: { '1': tradeno, '2': tradename },
92
+        AttachFiles: [],
93
+      };
94
+
95
+      const tmpresult = await ServiceManager.GetInstance().Commit(entity);
96
+      if (tmpresult && tmpresult.length === 1) {
97
+        return CommonFunction.ChangeTableToEntitys<TradePrintMessage>(tmpresult[0].AttachValue);
98
+      }
99
+      return [];
100
+    } catch (e) {
101
+      PlatformLogger.SystemErrorInfo('GetTradePrintMessage方法出现异常:', e);
102
+      throw e;
103
+    }
104
+  }
105
+
106
+  static async GetTradeFormsByTradecode(tradecode: string): Promise<TradeForms[]> {
107
+    try {
108
+      const entity: TransitEntity = {
109
+        ServiceName: 'PrintService',
110
+        FuncName: 'GetTradeFormsByTradecode',
111
+        Parameters: { '1': tradecode },
112
+        AttachFiles: [],
113
+      };
114
+
115
+      const tmpresult = await ServiceManager.GetInstance().Commit(entity);
116
+      if (tmpresult && tmpresult.length === 1) {
117
+        return CommonFunction.ChangeTableToEntitys<TradeForms>(tmpresult[0].AttachValue);
118
+      }
119
+      return [];
120
+    } catch (e) {
121
+      PlatformLogger.SystemErrorInfo('GetTradeFormsByTradecode方法出现异常:', e);
122
+      throw e;
123
+    }
124
+  }
125
+
126
+  static async AddPrintData(printdata: TPrintData): Promise<string> {
127
+    try {
128
+      const entity: TransitEntity = {
129
+        ServiceName: 'PrintService',
130
+        FuncName: 'AddPrintData',
131
+        Parameters: {},
132
+        AttachFiles: [],
133
+      };
134
+
135
+      const attcheds: AttachFile = {
136
+        AttachIndex: '1',
137
+        AttachType: 'TableType',
138
+        AttachValue: CommonFunction.ChangeEntityToTable([printdata]),
139
+      };
140
+      entity.AttachFiles.push(attcheds);
141
+
142
+      const attcheds2: AttachFile = {
143
+        AttachIndex: '2',
144
+        AttachType: 'ByteType',
145
+        AttachValue: printdata.Formdata,
146
+      };
147
+      entity.AttachFiles.push(attcheds2);
148
+
149
+      const tmpresult = await ServiceManager.GetInstance().Commit(entity);
150
+      if (tmpresult && tmpresult.length === 1) {
151
+        return tmpresult[0].AttachValue as string;
152
+      }
153
+      return null;
154
+    } catch (e) {
155
+      PlatformLogger.SystemErrorInfo('AddPrintData方法出现异常:', e);
156
+      throw e;
157
+    }
158
+  }
159
+
160
+  static async GetPrintDataByBusinessId(businessId: string): Promise<TPrintData[]> {
161
+    try {
162
+      const entity: TransitEntity = {
163
+        ServiceName: 'PrintService',
164
+        FuncName: 'GetPrintDataByBusinessId',
165
+        Parameters: { '1': businessId },
166
+        AttachFiles: [],
167
+      };
168
+
169
+      const tmpresult = await ServiceManager.GetInstance().Commit(entity);
170
+      if (tmpresult && tmpresult.length === 2) {
171
+        const result = CommonFunction.ChangeTableToEntitys<TPrintData>(tmpresult[0].AttachValue);
172
+        let i = 0;
173
+        if (result) {
174
+          result.forEach((tmp) => {
175
+            tmp.Formdata = new Uint8Array(tmp.FormdataLength);
176
+            tmp.Formdata.set(tmpresult[1].AttachValue.slice(i, i + tmp.FormdataLength));
177
+            i += tmp.FormdataLength;
178
+          });
179
+        }
180
+        return result;
181
+      }
182
+      return [];
183
+    } catch (e) {
184
+      PlatformLogger.SystemErrorInfo('GetPrintDataByBusinessId方法出现异常:', e);
185
+      throw e;
186
+    }
187
+  }
188
+
189
+  static async GetFormPrintedCount(id: string): Promise<number> {
190
+    try {
191
+      const entity: TransitEntity = {
192
+        ServiceName: 'PrintService',
193
+        FuncName: 'GetFormPrintedCount',
194
+        Parameters: { '1': id },
195
+        AttachFiles: [],
196
+      };
197
+
198
+      const tmpresult = await ServiceManager.GetInstance().Commit(entity);
199
+      if (tmpresult && tmpresult.length === 1) {
200
+        return Number(tmpresult[0].AttachValue);
201
+      }
202
+      return 0;
203
+    } catch (e) {
204
+      PlatformLogger.SystemErrorInfo('GetFormPrintedCount方法出现异常:', e);
205
+      throw e;
206
+    }
207
+  }
208
+
209
+  static async AddPrintHistory(pdid: string, worker: string, author: string): Promise<boolean> {
210
+    try {
211
+      const entity: TransitEntity = {
212
+        ServiceName: 'PrintService',
213
+        FuncName: 'AddPrintHistory',
214
+        Parameters: { '1': pdid, '2': worker, '3': author },
215
+        AttachFiles: [],
216
+      };
217
+
218
+      const tmpresult = await ServiceManager.GetInstance().Commit(entity);
219
+      if (tmpresult && tmpresult.length === 1) {
220
+        return Boolean(tmpresult[0].AttachValue);
221
+      }
222
+      return false;
223
+    } catch (e) {
224
+      PlatformLogger.SystemErrorInfo('AddPrintHistory方法出现异常:', e);
225
+      throw e;
226
+    }
227
+  }
228
+}

+ 373
- 0
ant-design-pro-vue3/src/views/front/platfrom/serviceproxy/ServiceHelper/TradeHandle.ts View File

@@ -0,0 +1,373 @@
1
+import axios from 'axios';
2
+
3
+// 假设这些类型在其他文件中定义
4
+type Transit = string;
5
+type AttachFile = {
6
+  AttachIndex: string;
7
+  AttachType: string;
8
+  AttachValue: any;
9
+};
10
+type TransitEntity = {
11
+  ServiceName: string;
12
+  FuncName: string;
13
+  Parameters: { [key: string]: string };
14
+  AttachFiles: AttachFile[];
15
+};
16
+type TradeInfo = any;
17
+type IsAuthResult = any;
18
+type AuthResult = any;
19
+type AuthCondInf = any;
20
+
21
+// 假设 ServiceManager 封装了 HTTP 请求逻辑
22
+class ServiceManager {
23
+  private static instance: ServiceManager;
24
+
25
+  private constructor() {}
26
+
27
+  public static GetInstance(): ServiceManager {
28
+    if (!this.instance) {
29
+      this.instance = new ServiceManager();
30
+    }
31
+    return this.instance;
32
+  }
33
+
34
+  public async Commit(entity: TransitEntity): Promise<AttachFile[]> {
35
+    try {
36
+      const response = await axios.post('/api/service', entity);
37
+      return response.data as AttachFile[];
38
+    } catch (error) {
39
+      throw error;
40
+    }
41
+  }
42
+}
43
+
44
+// 假设这些常量和函数在其他文件中定义
45
+const CommonParames = {
46
+  TempFilePath: '',
47
+  Coding: 'utf-8'
48
+};
49
+const FilesHandle = {
50
+  GetFileData: async (filePath: string): Promise<Uint8Array> => {
51
+    try {
52
+      const response = await axios.get(filePath, { responseType: 'arraybuffer' });
53
+      return new Uint8Array(response.data);
54
+    } catch (error) {
55
+      throw error;
56
+    }
57
+  }
58
+};
59
+const CommonFunction = {
60
+  ChangeEntityTable: <TIn, TOut>(input: TIn): TOut => {
61
+    // 这里需要根据实际逻辑实现转换
62
+    return {} as TOut;
63
+  },
64
+  ChangStrToArray: (str: string): string[] => {
65
+    return str.split(',');
66
+  }
67
+};
68
+
69
+export class TradeHandle {
70
+  public static async DoTrade(
71
+    transit: Transit,
72
+    integrateData: Uint8Array,
73
+    kinBrno: string,
74
+    fileName: string,
75
+    fileFlag: boolean,
76
+    args: any[]
77
+  ): Promise<Uint8Array | null> {
78
+    let result: Uint8Array | null = null;
79
+    try {
80
+      const entity: TransitEntity = {
81
+        ServiceName: 'TradeService',
82
+        FuncName: 'DoTradeByTransit',
83
+        Parameters: {
84
+          '1': transit.toString(),
85
+          '3': kinBrno,
86
+          '4': fileName,
87
+          '5': fileFlag.toString(),
88
+          '6': ''
89
+        },
90
+        AttachFiles: []
91
+      };
92
+      const data: AttachFile = {
93
+        AttachIndex: '2',
94
+        AttachType: 'ByteType',
95
+        AttachValue: integrateData
96
+      };
97
+      entity.AttachFiles.push(data);
98
+      const tmpresult = await ServiceManager.GetInstance().Commit(entity);
99
+      if (tmpresult && tmpresult.length === 1) {
100
+        result = tmpresult[0].AttachValue as Uint8Array;
101
+      }
102
+    } catch (error) {
103
+      throw error;
104
+    }
105
+    return result;
106
+  }
107
+
108
+  public static async GetTradeFile(fileName: string): Promise<Uint8Array | null> {
109
+    const filePath = CommonParames.TempFilePath + fileName + 'dhcc';
110
+    try {
111
+      return await FilesHandle.GetFileData(filePath);
112
+    } catch (error) {
113
+      throw error;
114
+    }
115
+  }
116
+
117
+  public static async ClearvFile(fileName: string): Promise<boolean> {
118
+    const vfileName = CommonParames.TempFilePath + fileName;
119
+    let result = false;
120
+    try {
121
+      const entity: TransitEntity = {
122
+        ServiceName: 'UtilService',
123
+        FuncName: 'SaveFile',
124
+        Parameters: {
125
+          '1': fileName,
126
+          '3': false.toString()
127
+        },
128
+        AttachFiles: []
129
+      };
130
+      const data: AttachFile = {
131
+        AttachIndex: '2',
132
+        AttachType: 'ByteType',
133
+        AttachValue: new Uint8Array()
134
+      };
135
+      entity.AttachFiles.push(data);
136
+      const tmpresult = await ServiceManager.GetInstance().Commit(entity);
137
+      if (tmpresult && tmpresult.length === 1) {
138
+        result = Boolean(tmpresult[0].AttachValue);
139
+      }
140
+    } catch (error) {
141
+      throw error;
142
+    }
143
+    return result;
144
+  }
145
+
146
+  public static async Addvfile(fileName: string, fileContent: string): Promise<boolean> {
147
+    const vfileName = CommonParames.TempFilePath + fileName;
148
+    const data = new TextEncoder().encode(fileContent);
149
+    let result = false;
150
+    try {
151
+      const entity: TransitEntity = {
152
+        ServiceName: 'UtilService',
153
+        FuncName: 'SaveFile',
154
+        Parameters: {
155
+          '1': vfileName,
156
+          '3': true.toString()
157
+        },
158
+        AttachFiles: []
159
+      };
160
+      const attachdata: AttachFile = {
161
+        AttachIndex: '2',
162
+        AttachType: 'ByteType',
163
+        AttachValue: data
164
+      };
165
+      entity.AttachFiles.push(attachdata);
166
+      const tmpresult = await ServiceManager.GetInstance().Commit(entity);
167
+      if (tmpresult && tmpresult.length === 1) {
168
+        result = Boolean(tmpresult[0].AttachValue);
169
+      }
170
+    } catch (error) {
171
+      throw error;
172
+    }
173
+    return result;
174
+  }
175
+
176
+  public static async CheckAuth(inf: TradeInfo): Promise<IsAuthResult | null> {
177
+    let result: IsAuthResult | null = null;
178
+    try {
179
+      const entity: TransitEntity = {
180
+        ServiceName: 'TradeService',
181
+        FuncName: 'CheckAuth',
182
+        Parameters: {},
183
+        AttachFiles: []
184
+      };
185
+      const data: AttachFile = {
186
+        AttachIndex: '1',
187
+        AttachType: 'TableType',
188
+        AttachValue: CommonFunction.ChangeEntityTable<TradeInfo[], any>([inf])
189
+      };
190
+      entity.AttachFiles.push(data);
191
+      const tmpresult = await ServiceManager.GetInstance().Commit(entity);
192
+      if (tmpresult && tmpresult.length === 1) {
193
+        const rmpresult = CommonFunction.ChangeEntityTable<any, IsAuthResult[]>(
194
+          tmpresult[0].AttachValue as any
195
+        );
196
+        result = rmpresult[0];
197
+      }
198
+    } catch (error) {
199
+      throw error;
200
+    }
201
+    return result;
202
+  }
203
+
204
+  public static async DoAuthByAuthno(authno: string): Promise<AuthResult | null> {
205
+    let result: AuthResult | null = null;
206
+    try {
207
+      const entity: TransitEntity = {
208
+        ServiceName: 'TradeService',
209
+        FuncName: 'DoAuthByAuthno',
210
+        Parameters: {
211
+          '1': authno
212
+        },
213
+        AttachFiles: []
214
+      };
215
+      const tmpresult = await ServiceManager.GetInstance().Commit(entity);
216
+      if (tmpresult && tmpresult.length === 1) {
217
+        const rmpresult = CommonFunction.ChangeEntityTable<any, AuthResult[]>(
218
+          tmpresult[0].AttachValue as any
219
+        );
220
+        result = rmpresult[0];
221
+      }
222
+    } catch (error) {
223
+      throw error;
224
+    }
225
+    return result;
226
+  }
227
+
228
+  public static async DoAuthByAuth(
229
+    auth: string,
230
+    pwd: string,
231
+    lvl: string | null,
232
+    records: string
233
+  ): Promise<AuthResult | null> {
234
+    let result: AuthResult | null = null;
235
+    try {
236
+      const entity: TransitEntity = {
237
+        ServiceName: 'TradeService',
238
+        FuncName: 'DoAuthByAuth',
239
+        Parameters: {
240
+          '1': auth,
241
+          '2': pwd,
242
+          '3': lvl || '',
243
+          '4': records
244
+        },
245
+        AttachFiles: []
246
+      };
247
+      const tmpresult = await ServiceManager.GetInstance().Commit(entity);
248
+      if (tmpresult && tmpresult.length === 1) {
249
+        const rmpresult = CommonFunction.ChangeEntityTable<any, AuthResult[]>(
250
+          tmpresult[0].AttachValue as any
251
+        );
252
+        result = rmpresult[0];
253
+      }
254
+    } catch (error) {
255
+      throw error;
256
+    }
257
+    return result;
258
+  }
259
+
260
+  public static async CheckAuthBytxno(txno: string): Promise<number> {
261
+    let result = 0;
262
+    try {
263
+      const entity: TransitEntity = {
264
+        ServiceName: 'TradeService',
265
+        FuncName: 'CheckAuthBytxno',
266
+        Parameters: {
267
+          '1': txno
268
+        },
269
+        AttachFiles: []
270
+      };
271
+      const tmpresult = await ServiceManager.GetInstance().Commit(entity);
272
+      if (tmpresult && tmpresult.length === 1) {
273
+        result = Number(tmpresult[0].AttachValue);
274
+      }
275
+    } catch (error) {
276
+      throw error;
277
+    }
278
+    return result;
279
+  }
280
+
281
+  public static async Getuserlvl(txno: string): Promise<string | null> {
282
+    let result: string | null = null;
283
+    try {
284
+      const entity: TransitEntity = {
285
+        ServiceName: 'TradeService',
286
+        FuncName: 'Getuserlvl',
287
+        Parameters: {
288
+          '1': txno
289
+        },
290
+        AttachFiles: []
291
+      };
292
+      const tmpresult = await ServiceManager.GetInstance().Commit(entity);
293
+      if (tmpresult && tmpresult.length === 1) {
294
+        result = tmpresult[0].AttachValue as string;
295
+      }
296
+    } catch (error) {
297
+      throw error;
298
+    }
299
+    return result;
300
+  }
301
+
302
+  public static async AddAuthCond(
303
+    txcode: string,
304
+    authcondinf: AuthCondInf[]
305
+  ): Promise<boolean> {
306
+    let result = false;
307
+    try {
308
+      const entity: TransitEntity = {
309
+        ServiceName: 'TradeService',
310
+        FuncName: 'AddAuthCond',
311
+        Parameters: {
312
+          '1': txcode
313
+        },
314
+        AttachFiles: []
315
+      };
316
+      const data: AttachFile = {
317
+        AttachIndex: '2',
318
+        AttachType: 'TableType',
319
+        AttachValue: CommonFunction.ChangeEntityTable<AuthCondInf[], any>(authcondinf)
320
+      };
321
+      entity.AttachFiles.push(data);
322
+      const tmpresult = await ServiceManager.GetInstance().Commit(entity);
323
+      if (tmpresult && tmpresult.length === 1) {
324
+        result = Boolean(tmpresult[0].AttachValue);
325
+      }
326
+    } catch (error) {
327
+      throw error;
328
+    }
329
+    return result;
330
+  }
331
+
332
+  public static async GetAuthCondByTradecode(txcode: string): Promise<AuthCondInf[] | null> {
333
+    let result: AuthCondInf[] | null = null;
334
+    try {
335
+      const entity: TransitEntity = {
336
+        ServiceName: 'TradeService',
337
+        FuncName: 'GetAuthCondByTradecode',
338
+        Parameters: {
339
+          '1': txcode
340
+        },
341
+        AttachFiles: []
342
+      };
343
+      const tmpresult = await ServiceManager.GetInstance().Commit(entity);
344
+      if (tmpresult && tmpresult.length === 1) {
345
+        result = CommonFunction.ChangeEntityTable<any, AuthCondInf[]>(
346
+          tmpresult[0].AttachValue as any
347
+        );
348
+      }
349
+    } catch (error) {
350
+      throw error;
351
+    }
352
+    return result;
353
+  }
354
+
355
+  public static async GetAuthLvls(): Promise<string[] | null> {
356
+    let result: string[] | null = null;
357
+    try {
358
+      const entity: TransitEntity = {
359
+        ServiceName: 'TradeService',
360
+        FuncName: 'GetAuthLvls',
361
+        Parameters: {},
362
+        AttachFiles: []
363
+      };
364
+      const tmpresult = await ServiceManager.GetInstance().Commit(entity);
365
+      if (tmpresult && tmpresult.length === 1) {
366
+        result = CommonFunction.ChangStrToArray(tmpresult[0].AttachValue as string);
367
+      }
368
+    } catch (error) {
369
+      throw error;
370
+    }
371
+    return result;
372
+  }
373
+}

+ 321
- 0
ant-design-pro-vue3/src/views/front/platfrom/serviceproxy/ServiceHelper/UserManagerHandle.ts View File

@@ -0,0 +1,321 @@
1
+// import { ServiceManager } from './ServiceManager'; // 假设 ServiceManager 已经在项目中定义
2
+// import { TransitEntity, AttachFile } from './TransitEntity'; // 假设 TransitEntity 和 AttachFile 已经在项目中定义
3
+// import { CommonFunction } from './CommonFunction'; // 假设 CommonFunction 已经在项目中定义
4
+// import { THotKeyMessage, TTellerHotKey } from './Entitys'; // 假设 THotKeyMessage 和 TTellerHotKey 已经在项目中定义
5
+// import { CommonParames } from './CommonParames'; // 假设 CommonParames 已经在项目中定义
6
+
7
+// export class UserManagerHandle {
8
+//     // 快捷键管理模块
9
+//     public static async GetKeyByTeller(tellerNum: string): Promise<THotKeyMessage[] | null> {
10
+//         try {
11
+//             const entity = new TransitEntity();
12
+//             entity.ServiceName = 'HotKeyService';
13
+//             entity.FuncName = 'GetKeyByTeller';
14
+//             entity.Parameters = { '1': tellerNum };
15
+//             const tmpresult = await ServiceManager.getInstance().Commit(entity);
16
+//             if (tmpresult && tmpresult.length === 1) {
17
+//                 return CommonFunction.ChangeEntityTable<DataTable, THotKeyMessage[]>((tmpresult[0].AttachValue as DataTable));
18
+//             }
19
+//             return null;
20
+//         } catch (e) {
21
+//             throw e;
22
+//         }
23
+//     }
24
+
25
+//     public static async DelKeyMessage(keyName: string, tellerNum: string): Promise<boolean> {
26
+//         try {
27
+//             const entity = new TransitEntity();
28
+//             entity.ServiceName = 'HotKeyService';
29
+//             entity.FuncName = 'DelKeyMessage';
30
+//             entity.Parameters = { '1': keyName, '2': tellerNum };
31
+//             const tmpresult = await ServiceManager.getInstance().Commit(entity);
32
+//             if (tmpresult && tmpresult.length === 1) {
33
+//                 return Boolean(tmpresult[0].AttachValue);
34
+//             }
35
+//             return false;
36
+//         } catch (e) {
37
+//             throw e;
38
+//         }
39
+//     }
40
+
41
+//     public static async DelKeyValue(keyName: string, tellerNum: string, keyValue: string): Promise<boolean> {
42
+//         try {
43
+//             const entity = new TransitEntity();
44
+//             entity.ServiceName = 'HotKeyService';
45
+//             entity.FuncName = 'DelKeyValue';
46
+//             entity.Parameters = { '1': keyName, '2': tellerNum, '3': keyValue };
47
+//             const tmpresult = await ServiceManager.getInstance().Commit(entity);
48
+//             if (tmpresult && tmpresult.length === 1) {
49
+//                 return Boolean(tmpresult[0].AttachValue);
50
+//             }
51
+//             return false;
52
+//         } catch (e) {
53
+//             throw e;
54
+//         }
55
+//     }
56
+
57
+//     public static async UpdateKeyMessage(tTellerHotkey: TTellerHotKey): Promise<boolean> {
58
+//         try {
59
+//             const entity = new TransitEntity();
60
+//             entity.ServiceName = 'HotKeyService';
61
+//             entity.FuncName = 'UpdateKeyMessage';
62
+//             const attach = new AttachFile();
63
+//             attach.AttachIndex = '1';
64
+//             attach.AttachType = 'TableType';
65
+//             const tmp = [tTellerHotkey];
66
+//             attach.AttachValue = CommonFunction.ChangeEntityTable<TTellerHotKey[], DataTable>(tmp);
67
+//             entity.AttachFiles.push(attach);
68
+//             const tmpresult = await ServiceManager.getInstance().Commit(entity);
69
+//             if (tmpresult && tmpresult.length === 1) {
70
+//                 return Boolean(tmpresult[0].AttachValue);
71
+//             }
72
+//             return false;
73
+//         } catch (e) {
74
+//             throw e;
75
+//         }
76
+//     }
77
+
78
+//     // 柜员管理模块
79
+//     public static async SendMessage(key: string, sender: string, time: string, title: string): Promise<void> {
80
+//         try {
81
+//             const entity = new TransitEntity();
82
+//             entity.ServiceName = 'UtilService';
83
+//             entity.FuncName = 'SocketSendMessage';
84
+//             entity.Parameters = { '1': key, '2': sender, '3': time, '4': title };
85
+//             await ServiceManager.getInstance().Commit(entity);
86
+//         } catch (e) {
87
+//             throw e;
88
+//         }
89
+//     }
90
+
91
+//     public static async SendMessage(sender: string, message: string, TradeNo: string[]): Promise<void> {
92
+//         try {
93
+//             const entity = new TransitEntity();
94
+//             entity.ServiceName = 'UtilService';
95
+//             entity.FuncName = 'SendMessage';
96
+//             entity.Parameters = { '1': sender, '2': message, '3': CommonFunction.ChangArrayToStr(TradeNo) };
97
+//             await ServiceManager.getInstance().Commit(entity);
98
+//         } catch (e) {
99
+//             throw e;
100
+//         }
101
+//     }
102
+
103
+//     public static async GetOutOfData(tradeno: string, tradetype: string, key_words: string, branch_no: string): Promise<string | null> {
104
+//         try {
105
+//             const entity = new TransitEntity();
106
+//             entity.ServiceName = 'TradeService';
107
+//             entity.FuncName = 'GetOutOfData';
108
+//             entity.Parameters = { '1': tradeno, '2': tradetype, '3': key_words, '4': branch_no };
109
+//             const tmpresult = await ServiceManager.getInstance().Commit(entity);
110
+//             if (tmpresult && tmpresult.length === 1) {
111
+//                 return tmpresult[0].AttachValue as string;
112
+//             }
113
+//             return null;
114
+//         } catch (e) {
115
+//             throw e;
116
+//         }
117
+//     }
118
+
119
+//     public static async SetOutOfData(guid: string, tradenum: string, tradetype: string, keywords: string, tradedata: string, tellerno: string, branch_no: string): Promise<boolean> {
120
+//         try {
121
+//             const entity = new TransitEntity();
122
+//             entity.ServiceName = 'TradeService';
123
+//             entity.FuncName = 'SetOutOfData';
124
+//             entity.Parameters = { '1': guid, '2': tradenum, '3': tradetype, '4': keywords, '5': tradedata, '6': tellerno, '7': branch_no };
125
+//             const tmpresult = await ServiceManager.getInstance().Commit(entity);
126
+//             if (tmpresult && tmpresult.length === 1) {
127
+//                 return Boolean(tmpresult[0].AttachValue);
128
+//             }
129
+//             return false;
130
+//         } catch (e) {
131
+//             throw e;
132
+//         }
133
+//     }
134
+
135
+//     public static async UpdateOutOfData(Guid: string, tradedata: string): Promise<boolean> {
136
+//         try {
137
+//             const entity = new TransitEntity();
138
+//             entity.ServiceName = 'TradeService';
139
+//             entity.FuncName = 'UpdateOutOfData';
140
+//             entity.Parameters = { '1': Guid, '2': tradedata };
141
+//             const tmpresult = await ServiceManager.getInstance().Commit(entity);
142
+//             if (tmpresult && tmpresult.length === 1) {
143
+//                 return Boolean(tmpresult[0].AttachValue);
144
+//             }
145
+//             return false;
146
+//         } catch (e) {
147
+//             throw e;
148
+//         }
149
+//     }
150
+
151
+//     public static async InsertBlob(tableName: string, columnName: string, strWhere: string, data: Uint8Array): Promise<boolean> {
152
+//         try {
153
+//             const entity = new TransitEntity();
154
+//             entity.ServiceName = 'UtilService';
155
+//             entity.FuncName = 'InsertBlob';
156
+//             entity.Parameters = { '1': tableName, '2': columnName, '3': strWhere };
157
+//             const files = new AttachFile();
158
+//             files.AttachIndex = '4';
159
+//             files.AttachType = 'ByteType';
160
+//             files.AttachValue = data;
161
+//             entity.AttachFiles.push(files);
162
+//             const tmpresult = await ServiceManager.getInstance().Commit(entity);
163
+//             if (tmpresult && tmpresult.length === 1) {
164
+//                 return Boolean(tmpresult[0].AttachValue);
165
+//             }
166
+//             return false;
167
+//         } catch (e) {
168
+//             throw e;
169
+//         }
170
+//     }
171
+
172
+//     public static async DeleteFolderOrFile(sPath: string): Promise<boolean> {
173
+//         try {
174
+//             const entity = new TransitEntity();
175
+//             entity.ServiceName = 'UtilService';
176
+//             entity.FuncName = 'DeleteFolder';
177
+//             entity.Parameters = { '1': sPath };
178
+//             const tmpresult = await ServiceManager.getInstance().Commit(entity);
179
+//             if (tmpresult && tmpresult.length === 1) {
180
+//                 return Boolean(tmpresult[0].AttachValue);
181
+//             }
182
+//             return false;
183
+//         } catch (e) {
184
+//             throw e;
185
+//         }
186
+//     }
187
+
188
+//     public static async GetBlob(tableName: string, columnName: string, strWhere: string): Promise<Uint8Array | null> {
189
+//         try {
190
+//             const entity = new TransitEntity();
191
+//             entity.ServiceName = 'UtilService';
192
+//             entity.FuncName = 'GetBlobColumn';
193
+//             entity.Parameters = { '1': tableName, '2': columnName, '3': strWhere };
194
+//             const tmpresult = await ServiceManager.getInstance().Commit(entity);
195
+//             if (tmpresult && tmpresult.length === 1) {
196
+//                 return tmpresult[0].AttachValue as Uint8Array;
197
+//             }
198
+//             return null;
199
+//         } catch (e) {
200
+//             throw e;
201
+//         }
202
+//     }
203
+
204
+//     public static async SaveConfFile(fileName: string, file: Uint8Array, flag: boolean): Promise<boolean> {
205
+//         try {
206
+//             const entity = new TransitEntity();
207
+//             entity.ServiceName = 'UtilService';
208
+//             entity.FuncName = 'SaveFile';
209
+//             entity.Parameters = { '1': CommonParames.ConfigFilePath + fileName, '3': flag.toString() };
210
+//             const files = new AttachFile();
211
+//             files.AttachIndex = '2';
212
+//             files.AttachType = 'ByteType';
213
+//             files.AttachValue = file;
214
+//             entity.AttachFiles.push(files);
215
+//             const tmpresult = await ServiceManager.getInstance().Commit(entity);
216
+//             if (tmpresult && tmpresult.length === 1) {
217
+//                 return Boolean(tmpresult[0].AttachValue);
218
+//             }
219
+//             return false;
220
+//         } catch (e) {
221
+//             throw e;
222
+//         }
223
+//     }
224
+
225
+//     public static async findReportFile(path: string): Promise<string[] | null> {
226
+//         try {
227
+//             const entity = new TransitEntity();
228
+//             entity.ServiceName = 'UtilService';
229
+//             entity.FuncName = 'FindReportFile';
230
+//             entity.Parameters = { '1': path };
231
+//             const tmpresult = await ServiceManager.getInstance().Commit(entity);
232
+//             if (tmpresult && tmpresult.length === 1) {
233
+//                 return CommonFunction.ChangStrToArray(tmpresult[0].AttachValue as string);
234
+//             }
235
+//             return null;
236
+//         } catch (e) {
237
+//             throw e;
238
+//         }
239
+//     }
240
+
241
+//     public static async GetConfFile(fileName: string): Promise<Uint8Array | null> {
242
+//         try {
243
+//             const entity = new TransitEntity();
244
+//             entity.ServiceName = 'UtilService';
245
+//             entity.FuncName = 'GetFile';
246
+//             entity.Parameters = { '1': CommonParames.ConfigFilePath + fileName };
247
+//             const tmpresult = await ServiceManager.getInstance().Commit(entity);
248
+//             if (tmpresult && tmpresult.length === 1) {
249
+//                 return tmpresult[0].AttachValue as Uint8Array;
250
+//             }
251
+//             return null;
252
+//         } catch (e) {
253
+//             throw e;
254
+//         }
255
+//     }
256
+
257
+//     public static async ExecuteSql(strsql: string): Promise<number> {
258
+//         try {
259
+//             const entity = new TransitEntity();
260
+//             entity.ServiceName = 'UtilService';
261
+//             entity.FuncName = 'ExecuteSql';
262
+//             entity.Parameters = { '1': strsql };
263
+//             const tmpresult = await ServiceManager.getInstance().Commit(entity);
264
+//             if (tmpresult && tmpresult.length === 1) {
265
+//                 return Number(tmpresult[0].AttachValue);
266
+//             }
267
+//             return 0;
268
+//         } catch (e) {
269
+//             throw e;
270
+//         }
271
+//     }
272
+
273
+//     public static async ExecuteQuery(sql: string): Promise<string[] | null> {
274
+//         try {
275
+//             const entity = new TransitEntity();
276
+//             entity.ServiceName = 'UtilService';
277
+//             entity.FuncName = 'ExecuteQuery';
278
+//             entity.Parameters = { '1': sql };
279
+//             const tmpresult = await ServiceManager.getInstance().Commit(entity);
280
+//             if (tmpresult && tmpresult.length === 1) {
281
+//                 return CommonFunction.ChangStrToArray(tmpresult[0].AttachValue as string);
282
+//             }
283
+//             return null;
284
+//         } catch (e) {
285
+//             throw e;
286
+//         }
287
+//     }
288
+
289
+//     public static async ExecuteSQLTran(SQLStringList: string[]): Promise<boolean> {
290
+//         try {
291
+//             const entity = new TransitEntity();
292
+//             entity.ServiceName = 'UtilService';
293
+//             entity.FuncName = 'ExecuteSQLTran';
294
+//             entity.Parameters = { '1': CommonFunction.ChangArrayToStr(SQLStringList) };
295
+//             const tmpresult = await ServiceManager.getInstance().Commit(entity);
296
+//             if (tmpresult && tmpresult.length === 1) {
297
+//                 return Boolean(tmpresult[0].AttachValue);
298
+//             }
299
+//             return false;
300
+//         } catch (e) {
301
+//             throw e;
302
+//         }
303
+//     }
304
+
305
+//     public static async SortSockAddress(Address: string[]): Promise<string | null> {
306
+//         try {
307
+//             const entity = new TransitEntity();
308
+//             entity.ServiceName = 'UtilService';
309
+//             entity.FuncName = 'SortSockAddress';
310
+//             entity.Parameters = { '1': CommonFunction.ChangArrayToStr(Address) };
311
+//             const tmpresult = await ServiceManager.getInstance().Commit(entity);
312
+//             if (tmpresult && tmpresult.length === 1) {
313
+//                 return tmpresult[0].AttachValue as string;
314
+//             }
315
+//             return null;
316
+//         } catch (e) {
317
+//             throw e;
318
+//         }
319
+//     }
320
+// }
321
+//TODO此代码没用

+ 331
- 0
ant-design-pro-vue3/src/views/front/platfrom/serviceproxy/ServiceHelper/WorkFlowHandle.ts View File

@@ -0,0 +1,331 @@
1
+// 假设以下类型和类的定义
2
+interface TransitEntity {
3
+    ServiceName: string;
4
+    FuncName: string;
5
+    Parameters: { [key: string]: string };
6
+    AttachFiles?: AttachFile[];
7
+}
8
+
9
+interface AttachFile {
10
+    AttachIndex: string;
11
+    AttachType: any;
12
+    AttachValue: any;
13
+}
14
+
15
+interface TellerInfo {
16
+    // 假设 TellerInfo 有具体的属性
17
+}
18
+
19
+interface WorkItemDesc {
20
+    // 假设 WorkItemDesc 有具体的属性
21
+}
22
+
23
+interface ProcessInfo {
24
+    // 假设 ProcessInfo 有具体的属性
25
+}
26
+
27
+class ServiceManager {
28
+    private static instance: ServiceManager;
29
+    private constructor() {}
30
+
31
+    public static GetInstance(): ServiceManager {
32
+        if (!this.instance) {
33
+            this.instance = new ServiceManager();
34
+        }
35
+        return this.instance;
36
+    }
37
+
38
+    public async Commit(entity: TransitEntity): Promise<AttachFile[]> {
39
+        // 这里需要实现具体的提交逻辑,例如发送 HTTP 请求
40
+        return [];
41
+    }
42
+}
43
+
44
+class CommonFunction {
45
+    static ChangeDicToStr(dic: { [key: string]: any }): string {
46
+        return JSON.stringify(dic);
47
+    }
48
+
49
+    static ChangeStrToDic(str: string): { [key: string]: any } {
50
+        return JSON.parse(str);
51
+    }
52
+
53
+    static ChangeEntityTable<TInput, TOutput>(input: TInput): TOutput {
54
+        // 这里需要实现具体的转换逻辑
55
+        return {} as TOutput;
56
+    }
57
+}
58
+
59
+export class WorkFlowHandle {
60
+    public static async GetWorkFlowTradeReturn(workflowId: string): Promise<string | null> {
61
+        let tradeReturn: string | null = null;
62
+        try {
63
+            const entity: TransitEntity = {
64
+                ServiceName: "ProcessService",
65
+                FuncName: "TradeRequest",
66
+                Parameters: { "1": workflowId }
67
+            };
68
+            const tmpresult = await ServiceManager.GetInstance().Commit(entity);
69
+            if (tmpresult && tmpresult.length === 1) {
70
+                tradeReturn = tmpresult[0].AttachValue as string;
71
+            }
72
+        } catch (e) {
73
+            throw e;
74
+        }
75
+        return tradeReturn;
76
+    }
77
+
78
+    public static async GetWorkFlowTradeSubmit(
79
+        tellerinfo: TellerInfo,
80
+        tradePageData: Uint8Array,
81
+        alldatas: { [key: string]: object },
82
+        id: string,
83
+        serialNo: string,
84
+        isWorkFlow: boolean,
85
+        firstNodeFlag: boolean
86
+    ): Promise<string | null> {
87
+        let tradeReturn: string | null = null;
88
+        try {
89
+            const entity: TransitEntity = {
90
+                ServiceName: "ProcessService",
91
+                FuncName: "TradeSubmit",
92
+                Parameters: {
93
+                    "3": CommonFunction.ChangeDicToStr(alldatas),
94
+                    "4": id,
95
+                    "5": serialNo,
96
+                    "6": isWorkFlow.toString(),
97
+                    "7": firstNodeFlag.toString()
98
+                },
99
+                AttachFiles: []
100
+            };
101
+
102
+            const teller: AttachFile = {
103
+                AttachIndex: "1",
104
+                AttachType: null, // 需要根据实际情况设置
105
+                AttachValue: CommonFunction.ChangeEntityTable<TellerInfo[], any>([tellerinfo])
106
+            };
107
+            entity.AttachFiles.push(teller);
108
+
109
+            const pagedata: AttachFile = {
110
+                AttachIndex: "2",
111
+                AttachType: null, // 需要根据实际情况设置
112
+                AttachValue: tradePageData
113
+            };
114
+            entity.AttachFiles.push(pagedata);
115
+
116
+            const tmpresult = await ServiceManager.GetInstance().Commit(entity);
117
+            if (tmpresult && tmpresult.length === 1) {
118
+                tradeReturn = tmpresult[0].AttachValue as string;
119
+            }
120
+        } catch (e) {
121
+            throw e;
122
+        }
123
+        return tradeReturn;
124
+    }
125
+
126
+    public static async GetWorkFlowWorkItem(tellerNo: string, state: string): Promise<WorkItemDesc[] | null> {
127
+        let tradeReturn: WorkItemDesc[] | null = null;
128
+        try {
129
+            const entity: TransitEntity = {
130
+                ServiceName: "ProcessService",
131
+                FuncName: "GetWorkItems",
132
+                Parameters: { "1": tellerNo, "2": state } // 原代码参数键重复,修正为不同键
133
+            };
134
+            const tmpresult = await ServiceManager.GetInstance().Commit(entity);
135
+            if (tmpresult && tmpresult.length === 1) {
136
+                tradeReturn = CommonFunction.ChangeEntityTable<any, WorkItemDesc[]>(tmpresult[0].AttachValue);
137
+            }
138
+        } catch (e) {
139
+            throw e;
140
+        }
141
+        return tradeReturn;
142
+    }
143
+
144
+    public static async ProcessSuspend(processid: string): Promise<string | null> {
145
+        let tradeReturn: string | null = null;
146
+        try {
147
+            const entity: TransitEntity = {
148
+                ServiceName: "ProcessService",
149
+                FuncName: "ProcessSuspend",
150
+                Parameters: { "1": processid }
151
+            };
152
+            const tmpresult = await ServiceManager.GetInstance().Commit(entity);
153
+            if (tmpresult && tmpresult.length === 1) {
154
+                tradeReturn = tmpresult[0].AttachValue as string;
155
+            }
156
+        } catch (e) {
157
+            throw e;
158
+        }
159
+        return tradeReturn;
160
+    }
161
+
162
+    public static async ProcessResume(processid: string): Promise<string | null> {
163
+        let tradeReturn: string | null = null;
164
+        try {
165
+            const entity: TransitEntity = {
166
+                ServiceName: "ProcessService",
167
+                FuncName: "ProcessResume",
168
+                Parameters: { "1": processid }
169
+            };
170
+            const tmpresult = await ServiceManager.GetInstance().Commit(entity);
171
+            if (tmpresult && tmpresult.length === 1) {
172
+                tradeReturn = tmpresult[0].AttachValue as string;
173
+            }
174
+        } catch (e) {
175
+            throw e;
176
+        }
177
+        return tradeReturn;
178
+    }
179
+
180
+    public static async ProcessDelete(processid: string): Promise<string | null> {
181
+        let tradeReturn: string | null = null;
182
+        try {
183
+            const entity: TransitEntity = {
184
+                ServiceName: "ProcessService",
185
+                FuncName: "ProcessDelete",
186
+                Parameters: { "1": processid }
187
+            };
188
+            const tmpresult = await ServiceManager.GetInstance().Commit(entity);
189
+            if (tmpresult && tmpresult.length === 1) {
190
+                tradeReturn = tmpresult[0].AttachValue as string;
191
+            }
192
+        } catch (e) {
193
+            throw e;
194
+        }
195
+        return tradeReturn;
196
+    }
197
+
198
+    public static async GetTradePageData(serialNo: string, ActiviteName: string): Promise<Uint8Array | null> {
199
+        let result: Uint8Array | null = null;
200
+        try {
201
+            const entity: TransitEntity = {
202
+                ServiceName: "ProcessService",
203
+                FuncName: "GetTradePageData",
204
+                Parameters: { "1": serialNo, "2": ActiviteName }
205
+            };
206
+            const tmpresult = await ServiceManager.GetInstance().Commit(entity);
207
+            if (tmpresult && tmpresult.length === 1) {
208
+                result = tmpresult[0].AttachValue as Uint8Array;
209
+            }
210
+        } catch (e) {
211
+            throw e;
212
+        }
213
+        return result;
214
+    }
215
+
216
+    public static async GetTradedataBySerialNo(serialNo: string): Promise<{ [key: string]: object } | null> {
217
+        let result: { [key: string]: object } | null = null;
218
+        try {
219
+            const entity: TransitEntity = {
220
+                ServiceName: "ProcessService",
221
+                FuncName: "GetTradedataBySerialNo",
222
+                Parameters: { "1": serialNo }
223
+            };
224
+            const tmpresult = await ServiceManager.GetInstance().Commit(entity);
225
+            if (tmpresult && tmpresult.length === 1) {
226
+                result = CommonFunction.ChangeStrToDic(tmpresult[0].AttachValue.toString());
227
+            }
228
+        } catch (e) {
229
+            throw e;
230
+        }
231
+        return result;
232
+    }
233
+
234
+    public static async getProcessInfosByUserId(userId: string): Promise<ProcessInfo[] | null> {
235
+        let result: ProcessInfo[] | null = null;
236
+        try {
237
+            const entity: TransitEntity = {
238
+                ServiceName: "ProcessService",
239
+                FuncName: "GetProcessInfosByUserId",
240
+                Parameters: { "1": userId }
241
+            };
242
+            const tmpresult = await ServiceManager.GetInstance().Commit(entity);
243
+            if (tmpresult && tmpresult.length === 1) {
244
+                result = CommonFunction.ChangeEntityTable<any, ProcessInfo[]>(tmpresult[0].AttachValue);
245
+            }
246
+        } catch (e) {
247
+            throw e;
248
+        }
249
+        return result;
250
+    }
251
+
252
+    public static async deleteProcessInsById(proInsId: string, delReason: string): Promise<void> {
253
+        try {
254
+            const entity: TransitEntity = {
255
+                ServiceName: "ProcessService",
256
+                FuncName: "DeleteProcessInsById",
257
+                Parameters: { "1": proInsId, "2": delReason }
258
+            };
259
+            await ServiceManager.GetInstance().Commit(entity);
260
+        } catch (e) {
261
+            throw e;
262
+        }
263
+    }
264
+
265
+    public static async deleteHisTaskInsByuserId(TellerNo: string): Promise<void> {
266
+        try {
267
+            const entity: TransitEntity = {
268
+                ServiceName: "ProcessService",
269
+                FuncName: "DeleteHisTaskInsByuserId",
270
+                Parameters: { "1": TellerNo }
271
+            };
272
+            await ServiceManager.GetInstance().Commit(entity);
273
+        } catch (e) {
274
+            throw e;
275
+        }
276
+    }
277
+
278
+    public static async deleteHisProcessInsByuserId(TellerNo: string): Promise<void> {
279
+        try {
280
+            const entity: TransitEntity = {
281
+                ServiceName: "ProcessService",
282
+                FuncName: "DeleteHisProcessInsByuserId",
283
+                Parameters: { "1": TellerNo }
284
+            };
285
+            await ServiceManager.GetInstance().Commit(entity);
286
+        } catch (e) {
287
+            throw e;
288
+        }
289
+    }
290
+
291
+    public static async GiveUpTask(taskid: string): Promise<void> {
292
+        try {
293
+            const entity: TransitEntity = {
294
+                ServiceName: "ProcessService",
295
+                FuncName: "GiveUpTask",
296
+                Parameters: { "1": taskid }
297
+            };
298
+            await ServiceManager.GetInstance().Commit(entity);
299
+        } catch (e) {
300
+            throw e;
301
+        }
302
+    }
303
+
304
+    public static async GenNextSerialNo(
305
+        tradeNo: string,
306
+        telNo: string,
307
+        brNo: string,
308
+        isWorkFlow: boolean
309
+    ): Promise<string | null> {
310
+        let result: string | null = null;
311
+        try {
312
+            const entity: TransitEntity = {
313
+                ServiceName: "ProcessService",
314
+                FuncName: "GenNextSerialNo",
315
+                Parameters: {
316
+                    "1": tradeNo,
317
+                    "2": telNo,
318
+                    "3": brNo,
319
+                    "4": isWorkFlow.toString()
320
+                }
321
+            };
322
+            const tmpresult = await ServiceManager.GetInstance().Commit(entity);
323
+            if (tmpresult && tmpresult.length === 1) {
324
+                result = tmpresult[0].AttachValue as string;
325
+            }
326
+        } catch (e) {
327
+            throw e;
328
+        }
329
+        return result;
330
+    }
331
+}

Loading…
Cancel
Save