@cpzxrobot/sdk 1.3.117 → 1.3.119

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/AIFORM_GATEWAY.md CHANGED
@@ -134,14 +134,13 @@ if (response.code === 200) {
134
134
 
135
135
  ### 3. 上传表格图片
136
136
 
137
- **方法**: `upload(file: File, templateId: number): Promise<AiformFileUploadResponse>`
137
+ **方法**: `upload(templateId: number): Promise<AiformFileUploadResponse>`
138
138
 
139
139
  **接口路径**: `POST /api/v2/aiform/file/upload`
140
140
 
141
141
  **功能**: 上传表格图片到 MinIO,并关联到指定的模板。上传成功后自动异步触发大模型解析。
142
142
 
143
143
  **参数**:
144
- - `file` (File): 表格图片文件,必填
145
144
  - `templateId` (number): 关联的模板ID,必填
146
145
 
147
146
  **返回值**:
@@ -173,22 +172,12 @@ interface File {
173
172
  **使用示例**:
174
173
 
175
174
  ```javascript
176
- // HTML文件输入示例
177
- <input type="file" id="fileInput" accept="image/*">
178
-
179
175
  // 上传文件
180
176
  async function uploadFile() {
181
- const fileInput = document.getElementById('fileInput');
182
- const file = fileInput.files[0];
183
177
  const templateId = 1; // 模板ID
184
178
 
185
- if (!file) {
186
- alert('请选择文件');
187
- return;
188
- }
189
-
190
179
  try {
191
- const response = await cpzxrobot().aiform.record.upload(file, templateId);
180
+ const response = await cpzxrobot().aiform.record.upload(templateId);
192
181
  console.log('上传成功:', response.data);
193
182
  console.log('文件状态:', getFileStatusText(response.data.status));
194
183
  console.log('访问链接:', response.data.accessUrl);
@@ -209,8 +198,8 @@ function getFileStatusText(status) {
209
198
  return statusMap[status] || '未知';
210
199
  }
211
200
 
212
- // 绑定事件
213
- document.getElementById('fileInput').addEventListener('change', uploadFile);
201
+ // 调用示例
202
+ uploadFile();
214
203
  ```
215
204
 
216
205
  ### 4. 根据模板ID查询上传记录
@@ -219,7 +208,7 @@ function getFileStatusText(status) {
219
208
 
220
209
  **接口路径**: `GET /api/v2/aiform/file/list/{templateId}`
221
210
 
222
- **功能**: 根据模板ID查询该模板下所有上传的文件记录,按创建时间倒序排列。
211
+ **功能**: 根据模板ID查询该模板下所有上传的文件记录,按创建时间倒序排列(返回精简版记录)。
223
212
 
224
213
  **参数**:
225
214
  - `templateId` (number): 模板ID,必填
@@ -229,7 +218,7 @@ function getFileStatusText(status) {
229
218
  interface AiformFileListResponse {
230
219
  code: number; // 状态码
231
220
  message: string; // 提示信息
232
- data: File[]; // 文件记录列表
221
+ data: File[]; // 文件记录列表(精简版)
233
222
  }
234
223
  ```
235
224
 
@@ -262,7 +251,47 @@ async function getTemplateRecords(templateId) {
262
251
  getTemplateRecords(1); // 查询模板ID为1的上传记录
263
252
  ```
264
253
 
265
- ### 5. 轮询文件解析状态
254
+ ### 5. 根据文件业务编码获取详情
255
+
256
+ **方法**: `detail(code: string): Promise<AiformFileDetailResponse>`
257
+
258
+ **接口路径**: `GET /api/v2/aiform/file/detail/{code}`
259
+
260
+ **功能**: 根据文件业务编码获取解析结果详情。
261
+
262
+ **参数**:
263
+ - `code` (string): 文件业务编码,必填
264
+
265
+ **返回值**:
266
+ ```typescript
267
+ interface AiformFileDetailResponse {
268
+ code: number; // 状态码
269
+ message: string; // 提示信息
270
+ data: any; // 解析结果详情
271
+ }
272
+ ```
273
+
274
+ **使用示例**:
275
+
276
+ ```javascript
277
+ // 获取文件详情
278
+ async function getFileDetail(code) {
279
+ try {
280
+ const response = await cpzxrobot().aiform.record.detail(code);
281
+
282
+ if (response.code === 200) {
283
+ console.log('文件详情:', response.data);
284
+ }
285
+ } catch (error) {
286
+ console.error('获取文件详情失败:', error.message);
287
+ }
288
+ }
289
+
290
+ // 调用示例
291
+ getFileDetail('FILE_20240101_001'); // 查询业务编码为FILE_20240101_001的文件详情
292
+ ```
293
+
294
+ ### 6. 轮询文件解析状态
266
295
 
267
296
  **功能**: 上传文件后,需要轮询文件状态以确认解析进度。
268
297
 
@@ -359,6 +388,14 @@ try {
359
388
  } catch (error) {
360
389
  console.error('获取记录失败:', error.message);
361
390
  }
391
+
392
+ try {
393
+ // 尝试获取文件详情
394
+ const response = await cpzxrobot().aiform.record.detail('FILE_20240101_001');
395
+ console.log('文件详情:', response.data);
396
+ } catch (error) {
397
+ console.error('获取文件详情失败:', error.message);
398
+ }
362
399
  ```
363
400
 
364
401
  ## 完整使用示例
@@ -447,3 +484,9 @@ manageAITemplates();
447
484
 
448
485
  - **SDK版本**: 1.3.114+
449
486
  - **接口版本**: v2
487
+
488
+ ## 接口变更说明
489
+
490
+ - **新增接口**: `cpzxrobot().aiform.record.detail(code)` - 根据文件业务编码获取解析结果详情
491
+ - **变更接口**: `cpzxrobot().aiform.record.upload()` - 不再需要传递File参数,改为内部处理文件选择
492
+ - **变更接口**: `cpzxrobot().aiform.record.list()` - 返回精简版文件记录,去掉了内容字段
package/aiform_gateway.ts CHANGED
@@ -5,6 +5,7 @@ import type {
5
5
  AiformTemplateSaveResponse,
6
6
  AiformFileUploadResponse,
7
7
  AiformFileListResponse,
8
+ AiformFileDetailResponse,
8
9
  } from ".";
9
10
 
10
11
  export class AiformGateway extends Object {
@@ -73,7 +74,6 @@ export class AiformGateway extends Object {
73
74
  return {
74
75
  /**
75
76
  * 上传表格图片
76
- * @param file 表格图片文件
77
77
  * @param templateId 关联的模板ID
78
78
  * @returns Promise 包含文件记录信息
79
79
  */
@@ -100,7 +100,7 @@ export class AiformGateway extends Object {
100
100
  /**
101
101
  * 根据模板ID查询上传记录
102
102
  * @param templateId 模板ID
103
- * @returns Promise 包含文件记录列表
103
+ * @returns Promise 包含文件记录列表(精简版)
104
104
  */
105
105
  list: async (templateId: number): Promise<AiformFileListResponse> => {
106
106
  const axios = await this.context.ready;
@@ -117,6 +117,27 @@ export class AiformGateway extends Object {
117
117
  return res.data;
118
118
  });
119
119
  },
120
+
121
+ /**
122
+ * 根据文件业务编码获取详情
123
+ * @param code 文件业务编码
124
+ * @returns Promise 包含解析结果详情
125
+ */
126
+ detail: async (code: string): Promise<AiformFileDetailResponse> => {
127
+ const axios = await this.context.ready;
128
+
129
+ // 参数验证
130
+ if (!code) {
131
+ throw new Error('文件业务编码不能为空');
132
+ }
133
+
134
+ return axios.get(`/api/v2/aiform/file/detail/${code}`).then((res) => {
135
+ if (res.data.code !== 200) {
136
+ throw new Error(res.data.message || '获取文件详情失败');
137
+ }
138
+ return res.data;
139
+ });
140
+ },
120
141
  };
121
142
  }
122
143
  }
@@ -1,207 +1,211 @@
1
- import { Cpzxrobot } from "./types";
2
- import { WarzoneGateway } from "./warzone_gateway";
3
-
4
- export class CompanyGateway extends Object {
5
- context: Cpzxrobot;
6
- warzone!: WarzoneGateway;
7
- constructor(context: Cpzxrobot) {
8
- super();
9
- this.context = context;
10
- this.warzone = new WarzoneGateway(context);
11
- }
12
-
13
- async list(pageNo: number, pageSize: number, pid: number, companyName: string) {
14
- var axios = await this.context.ready;
15
- return axios
16
- .get(`/api/v2/company/list?current=${pageNo}&size=${pageSize}&pid=${pid}&companyName=${companyName}`)
17
- }
18
-
19
- async detail(id: number) {
20
- var axios = await this.context.ready;
21
- return axios.get(`/api/v2/company/get?id=${id}`);
22
- }
23
-
24
- async create(data: any) {
25
- var axios = await this.context.ready;
26
- return axios.post(`/api/v2/company/add`, data);
27
- }
28
-
29
- async update(id: number, data: any) {
30
- var axios = await this.context.ready;
31
- data.id = id;
32
- return axios.post(`/api/v2/company/update`, data);
33
- }
34
-
35
- async delete(id: number) {
36
- var axios = await this.context.ready;
37
- return axios.get(`/api/v2/company/delete?id=${id}`);
38
- }
39
-
40
- get data() {
41
- return {
42
- export: async (companyId: string, supplier?: string,modelId?: string, startDate?: string, endDate?: string) => {
43
- var axios = await this.context.ready;
44
- return axios.getAndSave(`/api/v2/company/${companyId}/data/export`, {
45
- params: {
46
- supplier,
47
- startDate,
48
- endDate,
49
- model: modelId,
50
- }
51
- });
52
- }
53
- }
54
- }
55
-
56
- get rank() {
57
- return {
58
- byRevenue: async () => {
59
- var axios = await this.context.ready;
60
- return axios.get(`/api/v2/coremde-sale/company/revenue/rank/list`);
61
- },
62
- byProfit: async () => {
63
- var axios = await this.context.ready;
64
- return axios.get(`/api/v2/coremde-sale/company/profit/rank/list`);
65
- },
66
- byOrder: async () => {
67
- var axios = await this.context.ready;
68
- return axios.get(`/api/v2/coremde-sale/company/order/rank/list`);
69
- },
70
- }
71
- }
72
-
73
- async attribute(key: string, companyId: number | undefined = undefined) {
74
- let axios = await this.context.ready;
75
- if (!companyId) {
76
- var selectedFarm = await this.context.user.getSelectedFarm();
77
- companyId = selectedFarm.id;
78
- }
79
- return axios.get(`/api/v2/company/${companyId}/attribute?key=${key}`);
80
- }
81
-
82
- get department() {
83
- return {
84
- list: async (pid: string) => {
85
- var axios = await this.context.ready;
86
- return axios.get(`/api/v3/enterprise/department/${pid}`);
87
- },
88
- detail: async (id: string|number) => {
89
- var axios = await this.context.ready;
90
- return axios.get(`/api/v3/enterprise/department/${id}/detail`);
91
- },
92
- create: async (data: any) => {
93
- var axios = await this.context.ready;
94
- return axios.post(`/api/v3/enterprise/department`, data);
95
- },
96
- mark: async (factoryId: string, departmentId: string, kind: "maintenance") => {
97
- var axios = await this.context.ready;
98
- return axios.post(`/api/v3/enterprise/department/${factoryId}/mark`, { departmentId, kind });
99
- },
100
- users: async (id: number) => {
101
- var axios = await this.context.ready;
102
- return axios.get("/api/v2/factory/" + id + "/users");
103
- }
104
- }
105
- }
106
-
107
- get cost() {
108
- return {
109
- byMonth: async (companyId: number) => {
110
- var axios = await this.context.ready;
111
- return axios.get(`/api/v2/coremde-sale/company/cost/month/get?companyId=${companyId}`);
112
- },
113
- byYear: async (companyId: number) => {
114
- var axios = await this.context.ready;
115
- return axios.get(`/api/v2/coremde-sale/company/cost/year/get?companyId=${companyId}`);
116
- }
117
- }
118
- }
119
-
120
- get enterprise() {
121
- return {
122
- userCount: async () => {
123
- var axios = await this.context.ready;
124
- return axios.get(`/api/v2/coremde-sale/company/enterprise/count/user`);
125
- },
126
- revenue: async () => {
127
- var axios = await this.context.ready;
128
- return axios.get(`/api/v2/coremde-sale/company/enterprise/revenue/get`);
129
- }
130
- }
131
- }
132
-
133
- get revenue() {
134
- return {
135
- //按类型统计
136
- groupSummary: {
137
- byMonth: async (companyId: number, pageNo: number | undefined = undefined, pageSize: number | undefined = undefined) => {
138
- var axios = await this.context.ready;
139
- var params = {
140
- pageNo: pageNo,
141
- pageSize: pageSize,
142
- companyId: companyId
143
- }
144
- return axios.get(`/api/v2/coremde-sale/company/revenue/month/list`, {
145
- params: params
146
- });
147
- },
148
- byYear: async (companyId: number, pageNo: number | undefined = undefined, pageSize: number | undefined = undefined) => {
149
- var axios = await this.context.ready;
150
- var params = {
151
- pageNo: pageNo,
152
- pageSize: pageSize,
153
- companyId: companyId
154
- }
155
- return axios.get(`/api/v2/coremde-sale/company/revenue/year/list`, {
156
- params: params
157
- });
158
- },
159
- },
160
- //最新情况统计,最近一个月,最近十天,最近一天
161
- recentSummary: {
162
- byDay: async (companyId: number) => {
163
- var axios = await this.context.ready;
164
- return axios.get(`/api/v2/coremde-sale/company/revenue/day/get?companyId=${companyId}`);
165
- },
166
- byDecade: async (companyId: number) => {
167
- var axios = await this.context.ready;
168
- return axios.get(`/api/v2/coremde-sale/company/revenue/decade/get?companyId=${companyId}`);
169
- },
170
- byMonth: async (companyId: number) => {
171
- var axios = await this.context.ready;
172
- return axios.get(`/api/v2/coremde-sale/company/revenue/month/get?companyId=${companyId}`);
173
- },
174
- },
175
- list: async (companyId: number, pageNo: number | undefined = undefined, pageSize: number | undefined = undefined) => {
176
- var axios = await this.context.ready;
177
- var params = {
178
- pageNo: pageNo,
179
- pageSize: pageSize,
180
- companyId: companyId
181
- }
182
- return axios.get(`/api/v2/coremde-sale/company/revenue/list`, {
183
- params: params
184
- });
185
- },
186
- enterprise: async () => {
187
- var axios = await this.context.ready;
188
- return axios.get(`/api/v2/coremde-sale/company/enterprise/revenue/get`);
189
- }
190
- }
191
- }
192
-
193
- async search(args: any) {
194
- var axios = await this.context.ready;
195
- return axios.post(`/api/v2/company/query`, args);
196
- }
197
-
198
- //用于获得父节点的子节点列表,用于树形结构展示
199
- async treenode(pid: number | undefined) {
200
- var axios = await this.context.ready;
201
- if (pid == undefined) {
202
- return axios.get(`/api/tenant/groups`);
203
- }
204
- return axios.post(`/api/tenant/groups/${pid}/children`);
205
- }
206
-
207
- }
1
+ import { Cpzxrobot } from "./types";
2
+ import { WarzoneGateway } from "./warzone_gateway";
3
+
4
+ export class CompanyGateway extends Object {
5
+ context: Cpzxrobot;
6
+ warzone!: WarzoneGateway;
7
+ constructor(context: Cpzxrobot) {
8
+ super();
9
+ this.context = context;
10
+ this.warzone = new WarzoneGateway(context);
11
+ }
12
+
13
+ async list(pageNo: number, pageSize: number, pid: number,
14
+ companyName: string, type?: string) {
15
+ var params: any = {
16
+ current: pageNo, size: pageSize, pid: pid, companyName: companyName
17
+ };
18
+ var axios = await this.context.ready;
19
+ if (type) params.type = type; // 新增:可选的 type 参数
20
+ return axios.get(`/api/v2/company/list`, { params });
21
+ }
22
+
23
+ async detail(id: number) {
24
+ var axios = await this.context.ready;
25
+ return axios.get(`/api/v2/company/get?id=${id}`);
26
+ }
27
+
28
+ async create(data: any) {
29
+ var axios = await this.context.ready;
30
+ return axios.post(`/api/v2/company/add`, data);
31
+ }
32
+
33
+ async update(id: number, data: any) {
34
+ var axios = await this.context.ready;
35
+ data.id = id;
36
+ return axios.post(`/api/v2/company/update`, data);
37
+ }
38
+
39
+ async delete(id: number) {
40
+ var axios = await this.context.ready;
41
+ return axios.get(`/api/v2/company/delete?id=${id}`);
42
+ }
43
+
44
+ get data() {
45
+ return {
46
+ export: async (companyId: string, supplier?: string,modelId?: string, startDate?: string, endDate?: string) => {
47
+ var axios = await this.context.ready;
48
+ return axios.getAndSave(`/api/v2/company/${companyId}/data/export`, {
49
+ params: {
50
+ supplier,
51
+ startDate,
52
+ endDate,
53
+ model: modelId,
54
+ }
55
+ });
56
+ }
57
+ }
58
+ }
59
+
60
+ get rank() {
61
+ return {
62
+ byRevenue: async () => {
63
+ var axios = await this.context.ready;
64
+ return axios.get(`/api/v2/coremde-sale/company/revenue/rank/list`);
65
+ },
66
+ byProfit: async () => {
67
+ var axios = await this.context.ready;
68
+ return axios.get(`/api/v2/coremde-sale/company/profit/rank/list`);
69
+ },
70
+ byOrder: async () => {
71
+ var axios = await this.context.ready;
72
+ return axios.get(`/api/v2/coremde-sale/company/order/rank/list`);
73
+ },
74
+ }
75
+ }
76
+
77
+ async attribute(key: string, companyId: number | undefined = undefined) {
78
+ let axios = await this.context.ready;
79
+ if (!companyId) {
80
+ var selectedFarm = await this.context.user.getSelectedFarm();
81
+ companyId = selectedFarm.id;
82
+ }
83
+ return axios.get(`/api/v2/company/${companyId}/attribute?key=${key}`);
84
+ }
85
+
86
+ get department() {
87
+ return {
88
+ list: async (pid: string) => {
89
+ var axios = await this.context.ready;
90
+ return axios.get(`/api/v3/enterprise/department/${pid}`);
91
+ },
92
+ detail: async (id: string|number) => {
93
+ var axios = await this.context.ready;
94
+ return axios.get(`/api/v3/enterprise/department/${id}/detail`);
95
+ },
96
+ create: async (data: any) => {
97
+ var axios = await this.context.ready;
98
+ return axios.post(`/api/v3/enterprise/department`, data);
99
+ },
100
+ mark: async (factoryId: string, departmentId: string, kind: "maintenance") => {
101
+ var axios = await this.context.ready;
102
+ return axios.post(`/api/v3/enterprise/department/${factoryId}/mark`, { departmentId, kind });
103
+ },
104
+ users: async (id: number) => {
105
+ var axios = await this.context.ready;
106
+ return axios.get("/api/v2/factory/" + id + "/users");
107
+ }
108
+ }
109
+ }
110
+
111
+ get cost() {
112
+ return {
113
+ byMonth: async (companyId: number) => {
114
+ var axios = await this.context.ready;
115
+ return axios.get(`/api/v2/coremde-sale/company/cost/month/get?companyId=${companyId}`);
116
+ },
117
+ byYear: async (companyId: number) => {
118
+ var axios = await this.context.ready;
119
+ return axios.get(`/api/v2/coremde-sale/company/cost/year/get?companyId=${companyId}`);
120
+ }
121
+ }
122
+ }
123
+
124
+ get enterprise() {
125
+ return {
126
+ userCount: async () => {
127
+ var axios = await this.context.ready;
128
+ return axios.get(`/api/v2/coremde-sale/company/enterprise/count/user`);
129
+ },
130
+ revenue: async () => {
131
+ var axios = await this.context.ready;
132
+ return axios.get(`/api/v2/coremde-sale/company/enterprise/revenue/get`);
133
+ }
134
+ }
135
+ }
136
+
137
+ get revenue() {
138
+ return {
139
+ //按类型统计
140
+ groupSummary: {
141
+ byMonth: async (companyId: number, pageNo: number | undefined = undefined, pageSize: number | undefined = undefined) => {
142
+ var axios = await this.context.ready;
143
+ var params = {
144
+ pageNo: pageNo,
145
+ pageSize: pageSize,
146
+ companyId: companyId
147
+ }
148
+ return axios.get(`/api/v2/coremde-sale/company/revenue/month/list`, {
149
+ params: params
150
+ });
151
+ },
152
+ byYear: async (companyId: number, pageNo: number | undefined = undefined, pageSize: number | undefined = undefined) => {
153
+ var axios = await this.context.ready;
154
+ var params = {
155
+ pageNo: pageNo,
156
+ pageSize: pageSize,
157
+ companyId: companyId
158
+ }
159
+ return axios.get(`/api/v2/coremde-sale/company/revenue/year/list`, {
160
+ params: params
161
+ });
162
+ },
163
+ },
164
+ //最新情况统计,最近一个月,最近十天,最近一天
165
+ recentSummary: {
166
+ byDay: async (companyId: number) => {
167
+ var axios = await this.context.ready;
168
+ return axios.get(`/api/v2/coremde-sale/company/revenue/day/get?companyId=${companyId}`);
169
+ },
170
+ byDecade: async (companyId: number) => {
171
+ var axios = await this.context.ready;
172
+ return axios.get(`/api/v2/coremde-sale/company/revenue/decade/get?companyId=${companyId}`);
173
+ },
174
+ byMonth: async (companyId: number) => {
175
+ var axios = await this.context.ready;
176
+ return axios.get(`/api/v2/coremde-sale/company/revenue/month/get?companyId=${companyId}`);
177
+ },
178
+ },
179
+ list: async (companyId: number, pageNo: number | undefined = undefined, pageSize: number | undefined = undefined) => {
180
+ var axios = await this.context.ready;
181
+ var params = {
182
+ pageNo: pageNo,
183
+ pageSize: pageSize,
184
+ companyId: companyId
185
+ }
186
+ return axios.get(`/api/v2/coremde-sale/company/revenue/list`, {
187
+ params: params
188
+ });
189
+ },
190
+ enterprise: async () => {
191
+ var axios = await this.context.ready;
192
+ return axios.get(`/api/v2/coremde-sale/company/enterprise/revenue/get`);
193
+ }
194
+ }
195
+ }
196
+
197
+ async search(args: any) {
198
+ var axios = await this.context.ready;
199
+ return axios.post(`/api/v2/company/query`, args);
200
+ }
201
+
202
+ //用于获得父节点的子节点列表,用于树形结构展示
203
+ async treenode(pid: number | undefined) {
204
+ var axios = await this.context.ready;
205
+ if (pid == undefined) {
206
+ return axios.get(`/api/tenant/groups`);
207
+ }
208
+ return axios.post(`/api/tenant/groups/${pid}/children`);
209
+ }
210
+
211
+ }
@@ -67,7 +67,6 @@ class AiformGateway extends Object {
67
67
  return {
68
68
  /**
69
69
  * 上传表格图片
70
- * @param file 表格图片文件
71
70
  * @param templateId 关联的模板ID
72
71
  * @returns Promise 包含文件记录信息
73
72
  */
@@ -91,7 +90,7 @@ class AiformGateway extends Object {
91
90
  /**
92
91
  * 根据模板ID查询上传记录
93
92
  * @param templateId 模板ID
94
- * @returns Promise 包含文件记录列表
93
+ * @returns Promise 包含文件记录列表(精简版)
95
94
  */
96
95
  list: (templateId) => __awaiter(this, void 0, void 0, function* () {
97
96
  const axios = yield this.context.ready;
@@ -106,6 +105,24 @@ class AiformGateway extends Object {
106
105
  return res.data;
107
106
  });
108
107
  }),
108
+ /**
109
+ * 根据文件业务编码获取详情
110
+ * @param code 文件业务编码
111
+ * @returns Promise 包含解析结果详情
112
+ */
113
+ detail: (code) => __awaiter(this, void 0, void 0, function* () {
114
+ const axios = yield this.context.ready;
115
+ // 参数验证
116
+ if (!code) {
117
+ throw new Error('文件业务编码不能为空');
118
+ }
119
+ return axios.get(`/api/v2/aiform/file/detail/${code}`).then((res) => {
120
+ if (res.data.code !== 200) {
121
+ throw new Error(res.data.message || '获取文件详情失败');
122
+ }
123
+ return res.data;
124
+ });
125
+ }),
109
126
  };
110
127
  }
111
128
  }
@@ -17,11 +17,15 @@ class CompanyGateway extends Object {
17
17
  this.context = context;
18
18
  this.warzone = new warzone_gateway_1.WarzoneGateway(context);
19
19
  }
20
- list(pageNo, pageSize, pid, companyName) {
20
+ list(pageNo, pageSize, pid, companyName, type) {
21
21
  return __awaiter(this, void 0, void 0, function* () {
22
+ var params = {
23
+ current: pageNo, size: pageSize, pid: pid, companyName: companyName
24
+ };
22
25
  var axios = yield this.context.ready;
23
- return axios
24
- .get(`/api/v2/company/list?current=${pageNo}&size=${pageSize}&pid=${pid}&companyName=${companyName}`);
26
+ if (type)
27
+ params.type = type; // 新增:可选的 type 参数
28
+ return axios.get(`/api/v2/company/list`, { params });
25
29
  });
26
30
  }
27
31
  detail(id) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cpzxrobot/sdk",
3
- "version": "1.3.117",
3
+ "version": "1.3.119",
4
4
  "description": "提供给上海正芯数智APP第三方H5应用使用的SDK",
5
5
  "main": "dist/index.js",
6
6
  "scripts": {
package/types.d.ts CHANGED
@@ -866,7 +866,7 @@ interface File {
866
866
  /** 文件记录ID */
867
867
  id: number;
868
868
  /** 业务编码 */
869
- code?: string;
869
+ code: string;
870
870
  /** 关联业务ID(此处为模板ID) */
871
871
  tableKey: number;
872
872
  /** 关联业务表名(固定值 aiform_template) */
@@ -877,8 +877,6 @@ interface File {
877
877
  storageName: string;
878
878
  /** MinIO存储路径 */
879
879
  fileUrl: string;
880
- /** 预签名访问链接(动态生成,有效期7天,不存数据库) */
881
- accessUrl: string;
882
880
  /** 文件扩展名 */
883
881
  fileExt: string;
884
882
  /** 存储服务(minio) */
@@ -887,12 +885,48 @@ interface File {
887
885
  type: string;
888
886
  /** 状态:0-已上传 1-解析中 2-已解析 */
889
887
  status: number;
888
+ /** 创建用户ID */
889
+ createUserId: number;
890
890
  /** 创建时间 */
891
891
  createTime: string;
892
892
  /** 更新时间 */
893
893
  updateTime: string;
894
894
  }
895
895
 
896
+ /**
897
+ * 文件列表项接口(FileVO)
898
+ */
899
+ interface FileVO {
900
+ /** 业务编码(用于调用详情接口) */
901
+ code: string;
902
+ /** 存储文件名 */
903
+ storageName: string;
904
+ /** 状态:0-已上传 1-解析中 2-已解析 */
905
+ status: number;
906
+ /** 创建用户ID */
907
+ createUserId: number;
908
+ /** 创建时间(RFC 3339 格式) */
909
+ createTime: string;
910
+ /** 更新时间(RFC 3339 格式) */
911
+ updateTime: string;
912
+ }
913
+
914
+ /**
915
+ * 解析结果详情接口(AiformParseResultVO)
916
+ */
917
+ interface AiformParseResultVO {
918
+ /** markdown 解析的表格内容 */
919
+ content: string;
920
+ /** 疑似不清晰处的描述说明 */
921
+ unclears: string[];
922
+ /** 整体解析说明 */
923
+ description: string;
924
+ /** 解析结果(兼容旧数据或解析失败时的原始结果) */
925
+ parseResult: string | null;
926
+ /** 预签名访问链接(有效期7天) */
927
+ accessUrl: string;
928
+ }
929
+
896
930
  /**
897
931
  * 文件上传响应接口
898
932
  */
@@ -914,7 +948,19 @@ interface AiformFileListResponse {
914
948
  /** 提示信息 */
915
949
  message: string;
916
950
  /** 文件记录列表 */
917
- data: File[];
951
+ data: FileVO[];
952
+ }
953
+
954
+ /**
955
+ * 文件详情响应接口
956
+ */
957
+ interface AiformFileDetailResponse {
958
+ /** 响应码 */
959
+ code: number;
960
+ /** 提示信息 */
961
+ message: string;
962
+ /** 解析结果详情 */
963
+ data: AiformParseResultVO;
918
964
  }
919
965
 
920
966
  declare class Cpzxrobot {
@@ -1025,8 +1071,11 @@ declare module "@cpzxrobot/sdk" {
1025
1071
  AiformTemplateSaveRequest,
1026
1072
  AiformTemplateSaveResponse,
1027
1073
  File,
1074
+ FileVO,
1075
+ AiformParseResultVO,
1028
1076
  AiformFileUploadResponse,
1029
1077
  AiformFileListResponse,
1078
+ AiformFileDetailResponse,
1030
1079
  AlarmRuleDetail,
1031
1080
  AlarmRuleListResponse,
1032
1081
  AlarmRuleDetailResponse,