@cpzxrobot/sdk 1.2.2 → 1.2.4

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.
@@ -22,7 +22,6 @@ export class CustomerGateway extends Object {
22
22
  }
23
23
 
24
24
  listV2(args: any) {
25
-
26
25
  return this.context.ready.then((axios) => {
27
26
  return axios.post(`/api/v2/coremde-sale/customer/list/v2`, args);
28
27
  });
@@ -53,6 +52,12 @@ export class CustomerGateway extends Object {
53
52
  });
54
53
  }
55
54
 
55
+ delete(id: number) {
56
+ return this.context.ready.then((axios) => {
57
+ return axios.get(`/api/v2/coremde-sale/customer/delete?id=${id}`);
58
+ });
59
+ }
60
+
56
61
  accountManager(customerId: number, pageNo: number | undefined = undefined, pageSize: number | undefined = undefined) {
57
62
  return this.context.ready.then((axios) => {
58
63
  var params = {
@@ -100,6 +105,14 @@ export class CustomerGateway extends Object {
100
105
  );
101
106
  });
102
107
  },
108
+ list: (args: any) => {
109
+ return this.context.ready.then((axios) => {
110
+ return axios.post(
111
+ `/api/v2/coremde-sale/customer/visit/list`,
112
+ args,
113
+ );
114
+ });
115
+ },
103
116
  }
104
117
  }
105
118
 
@@ -113,6 +126,16 @@ export class CustomerGateway extends Object {
113
126
  }
114
127
  }
115
128
 
129
+ get count() {
130
+ return {
131
+ byStatus: () => {
132
+ return this.context.ready.then((axios) => {
133
+ return axios.get(`/api/v2/coremde-sale/customer/status/list-count`);
134
+ });
135
+ },
136
+ }
137
+ }
138
+
116
139
  //获得客户状态列表
117
140
  status() {
118
141
  return this.context.ready.then((axios) => {
@@ -120,10 +143,19 @@ export class CustomerGateway extends Object {
120
143
  });
121
144
  }
122
145
 
146
+
147
+
123
148
  //获得客户类型列表
124
149
  types() {
125
150
  return this.context.ready.then((axios) => {
126
- return axios.get(`/api/v2/coremde-sale/customer/types`);
151
+ return axios.get(`/api/v2/coremde-sale/customer/type/list`);
152
+ });
153
+ }
154
+
155
+ //获取客户类别列表
156
+ categories() {
157
+ return this.context.ready.then((axios) => {
158
+ return axios.get(`/api/v2/coremde-sale/customer/category/list`);
127
159
  });
128
160
  }
129
161
 
@@ -37,6 +37,11 @@ class CustomerGateway extends Object {
37
37
  return axios.post(`/api/v2/coremde-sale/customer/update`, args);
38
38
  });
39
39
  }
40
+ delete(id) {
41
+ return this.context.ready.then((axios) => {
42
+ return axios.get(`/api/v2/coremde-sale/customer/delete?id=${id}`);
43
+ });
44
+ }
40
45
  accountManager(customerId, pageNo = undefined, pageSize = undefined) {
41
46
  return this.context.ready.then((axios) => {
42
47
  var params = {
@@ -71,6 +76,11 @@ class CustomerGateway extends Object {
71
76
  return axios.get(`/api/v2/coremde-sale/customer/visit/get?id=${id}`);
72
77
  });
73
78
  },
79
+ list: (args) => {
80
+ return this.context.ready.then((axios) => {
81
+ return axios.post(`/api/v2/coremde-sale/customer/visit/list`, args);
82
+ });
83
+ },
74
84
  };
75
85
  }
76
86
  get stat() {
@@ -82,6 +92,15 @@ class CustomerGateway extends Object {
82
92
  },
83
93
  };
84
94
  }
95
+ get count() {
96
+ return {
97
+ byStatus: () => {
98
+ return this.context.ready.then((axios) => {
99
+ return axios.get(`/api/v2/coremde-sale/customer/status/list-count`);
100
+ });
101
+ },
102
+ };
103
+ }
85
104
  //获得客户状态列表
86
105
  status() {
87
106
  return this.context.ready.then((axios) => {
@@ -91,7 +110,13 @@ class CustomerGateway extends Object {
91
110
  //获得客户类型列表
92
111
  types() {
93
112
  return this.context.ready.then((axios) => {
94
- return axios.get(`/api/v2/coremde-sale/customer/types`);
113
+ return axios.get(`/api/v2/coremde-sale/customer/type/list`);
114
+ });
115
+ }
116
+ //获取客户类别列表
117
+ categories() {
118
+ return this.context.ready.then((axios) => {
119
+ return axios.get(`/api/v2/coremde-sale/customer/category/list`);
95
120
  });
96
121
  }
97
122
  }
@@ -16,5 +16,45 @@ class RobotGateway extends Object {
16
16
  var axios = await this.context.ready;
17
17
  return axios.get(`/api/v2/robot/getAlarmList/${unitId}`);
18
18
  }
19
+ // 获取任务列表
20
+ async getInspectTaskList(unitId) {
21
+ var axios = await this.context.ready;
22
+ return axios.get(`/api/v2/robot/inspectTask/list/${unitId}`);
23
+ }
24
+ // 获取任务详情
25
+ async getInspectTaskDetail(id) {
26
+ var axios = await this.context.ready;
27
+ return axios.get(`/api/v2/robot/inspectTask/${id}`);
28
+ }
29
+ // 新增任务
30
+ async addInspectTask(data) {
31
+ var axios = await this.context.ready;
32
+ return axios.post('/api/v2/robot/inspectTask/add', data);
33
+ }
34
+ // 修改任务
35
+ async updateInspectTask(data) {
36
+ var axios = await this.context.ready;
37
+ return axios.post('/api/v2/robot/inspectTask/update', data);
38
+ }
39
+ // 删除任务
40
+ async deleteInspectTask(id) {
41
+ var axios = await this.context.ready;
42
+ return axios.get(`/api/v2/robot/inspectTask/delete/${id}`);
43
+ }
44
+ // 获取未下发任务列表
45
+ async getNotAssignedInspectTaskList() {
46
+ var axios = await this.context.ready;
47
+ return axios.get('/api/v2/robot/inspectTask/notAssignedList');
48
+ }
49
+ // 下发任务
50
+ async assignInspectTask(taskId) {
51
+ var axios = await this.context.ready;
52
+ return axios.get(`/api/v2/robot/inspectTask/assign/${taskId}`);
53
+ }
54
+ // 获取巡检结果
55
+ async getInspectRecordList(taskId) {
56
+ var axios = await this.context.ready;
57
+ return axios.get(`/api/v2/robot/inspectRecord/list/${taskId}`);
58
+ }
19
59
  }
20
60
  exports.RobotGateway = RobotGateway;
@@ -137,6 +137,14 @@ class UnitGateway extends Object {
137
137
  });
138
138
  });
139
139
  },
140
+ // operations:(batchNo:string) => {
141
+ // return this.context.ready.then((axios) => {
142
+ // return axios.post(
143
+ // `/api/v2/batch/operationRecord`,{
144
+ // unitIds
145
+ // });
146
+ // });
147
+ // }
140
148
  };
141
149
  }
142
150
  v2() {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cpzxrobot/sdk",
3
- "version": "1.2.2",
3
+ "version": "1.2.4",
4
4
  "description": "提供给上海正芯数智APP第三方H5应用使用的SDK",
5
5
  "main": "dist/index.js",
6
6
  "scripts": {
package/readme.md CHANGED
@@ -219,8 +219,12 @@ baseURL: "/"
219
219
  | cpzxrobot().customer.stat.china | 获得客户在全国的统计信息 |
220
220
  | cpzxrobot().customer.listByProvince | 获得客户在某个省的统计信息,传入province参数 |
221
221
  | cpzxrobot().customer.accountManager | 获得客户对应的销售员 |
222
+ | cpzxrobot().customer.delete | 删除客户,传入id参数 |
222
223
  | cpzxrobot().customer.types | 获得客户类型列表 |
223
224
  | cpzxrobot().customer.status | 获得客户状态列表 |
225
+ | cpzxrobot().customer.categories | 获得客户类别列表 |
226
+ | cpzxrobot().customer.count.byStatus | 获取客户状态列表及各状态下的客户数量 |
227
+ | cpzxrobot().customer.visit.list | 获取客户拜访列表 |
224
228
  | cpzxrobot().company.list | 获得公司列表,传入必要的分页参数 |
225
229
  | cpzxrobot().company.rank.byRevenue | 按公司营收获取排名,传入必要的分页参数 |
226
230
  | cpzxrobot().company.rank.byProfit | 按公司利润获取排名,传入必要的分页参数 |
@@ -306,3 +310,80 @@ heatlamp 属性提供了一组方法,用于管理猪场的热灯配置。它
306
310
  **cpzxrobot().pigfarm.heatlamp.get(id)**:获取指定 ID 的热灯配置。
307
311
  **cpzxrobot().pigfarm.heatlamp.update(lamp)**:更新热灯配置。
308
312
 
313
+ ### 巡检任务相关接口
314
+
315
+ 以下是新增的巡检任务相关接口,这些接口都在 `cpzxrobot().robot` 命名空间下:
316
+
317
+ 1. **获取任务列表**
318
+ ```typescript
319
+ cpzxrobot().robot.getInspectTaskList(unitId: number)
320
+ ```
321
+ - 描述:获取指定单元的巡检任务列表
322
+ - 参数:`unitId` - 单元ID
323
+ - HTTP方法:GET
324
+ - 接口路径:`/api/v2/robot/inspectTask/list/{unitId}`
325
+
326
+ 2. **获取任务详情**
327
+ ```typescript
328
+ cpzxrobot().robot.getInspectTaskDetail(id: number)
329
+ ```
330
+ - 描述:获取指定巡检任务的详细信息
331
+ - 参数:`id` - 任务ID
332
+ - HTTP方法:GET
333
+ - 接口路径:`/api/v2/robot/inspectTask/{id}`
334
+
335
+ 3. **新增任务**
336
+ ```typescript
337
+ cpzxrobot().robot.addInspectTask(data: any)
338
+ ```
339
+ - 描述:添加新的巡检任务
340
+ - 参数:`data` - 包含任务信息的对象
341
+ - HTTP方法:POST
342
+ - 接口路径:`/api/v2/robot/inspectTask/add`
343
+
344
+ 4. **修改任务**
345
+ ```typescript
346
+ cpzxrobot().robot.updateInspectTask(data: any)
347
+ ```
348
+ - 描述:更新现有的巡检任务
349
+ - 参数:`data` - 包含更新信息的对象
350
+ - HTTP方法:POST
351
+ - 接口路径:`/api/v2/robot/inspectTask/update`
352
+
353
+ 5. **删除任务**
354
+ ```typescript
355
+ cpzxrobot().robot.deleteInspectTask(id: number)
356
+ ```
357
+ - 描述:删除指定的巡检任务
358
+ - 参数:`id` - 任务ID
359
+ - HTTP方法:GET
360
+ - 接口路径:`/api/v2/robot/inspectTask/delete/{id}`
361
+
362
+ 6. **获取未下发任务列表**
363
+ ```typescript
364
+ cpzxrobot().robot.getNotAssignedInspectTaskList()
365
+ ```
366
+ - 描述:获取所有未下发的巡检任务列表
367
+ - HTTP方法:GET
368
+ - 接口路径:`/api/v2/robot/inspectTask/notAssignedList`
369
+
370
+ 7. **下发任务**
371
+ ```typescript
372
+ cpzxrobot().robot.assignInspectTask(taskId: number)
373
+ ```
374
+ - 描述:下发指定的巡检任务
375
+ - 参数:`taskId` - 任务ID
376
+ - HTTP方法:GET
377
+ - 接口路径:`/api/v2/robot/inspectTask/assign/{taskId}`
378
+
379
+ 8. **获取巡检结果**
380
+ ```typescript
381
+ cpzxrobot().robot.getInspectRecordList(taskId: number)
382
+ ```
383
+ - 描述:获取指定巡检任务的结果列表
384
+ - 参数:`taskId` - 任务ID
385
+ - HTTP方法:GET
386
+ - 接口路径:`/api/v2/robot/inspectRecord/list/{taskId}`
387
+
388
+ 注意:对于POST请求的接口,body参数统一使用 `any` 类型,具体参数结构需要根据实际API要求进行定义。
389
+
package/robot_gateway.ts CHANGED
@@ -20,4 +20,51 @@ export class RobotGateway extends Object {
20
20
  return axios.get(`/api/v2/robot/getAlarmList/${unitId}`);
21
21
  }
22
22
 
23
+ // 获取任务列表
24
+ async getInspectTaskList(unitId: number) {
25
+ var axios = await this.context.ready;
26
+ return axios.get(`/api/v2/robot/inspectTask/list/${unitId}`);
27
+ }
28
+
29
+ // 获取任务详情
30
+ async getInspectTaskDetail(id: number) {
31
+ var axios = await this.context.ready;
32
+ return axios.get(`/api/v2/robot/inspectTask/${id}`);
33
+ }
34
+
35
+ // 新增任务
36
+ async addInspectTask(data: any) {
37
+ var axios = await this.context.ready;
38
+ return axios.post('/api/v2/robot/inspectTask/add', data);
39
+ }
40
+
41
+ // 修改任务
42
+ async updateInspectTask(data: any) {
43
+ var axios = await this.context.ready;
44
+ return axios.post('/api/v2/robot/inspectTask/update', data);
45
+ }
46
+
47
+ // 删除任务
48
+ async deleteInspectTask(id: number) {
49
+ var axios = await this.context.ready;
50
+ return axios.get(`/api/v2/robot/inspectTask/delete/${id}`);
51
+ }
52
+
53
+ // 获取未下发任务列表
54
+ async getNotAssignedInspectTaskList() {
55
+ var axios = await this.context.ready;
56
+ return axios.get('/api/v2/robot/inspectTask/notAssignedList');
57
+ }
58
+
59
+ // 下发任务
60
+ async assignInspectTask(taskId: number) {
61
+ var axios = await this.context.ready;
62
+ return axios.get(`/api/v2/robot/inspectTask/assign/${taskId}`);
63
+ }
64
+
65
+ // 获取巡检结果
66
+ async getInspectRecordList(taskId: number) {
67
+ var axios = await this.context.ready;
68
+ return axios.get(`/api/v2/robot/inspectRecord/list/${taskId}`);
69
+ }
23
70
  }
package/unit_gateway.ts CHANGED
@@ -135,13 +135,13 @@ export class UnitGateway extends Object {
135
135
  },
136
136
  //获取某个批次的所有单元信息
137
137
  // deperacated
138
- get: (batchNo: Number) => {
138
+ get: (batchNo: string) => {
139
139
  return this.context.ready.then((axios) => {
140
140
  return axios.get(`/api/v2/batch/unit/${batchNo}?`);
141
141
  });
142
142
  },
143
143
  //获取某个批次的所有单元信息
144
- getUnits: (batchNo: Number) => {
144
+ getUnits: (batchNo: string) => {
145
145
  return this.context.ready.then((axios) => {
146
146
  return axios.get(`/api/v2/batch/unit/${batchNo}?`);
147
147
  });
@@ -160,6 +160,14 @@ export class UnitGateway extends Object {
160
160
  });
161
161
  });
162
162
  },
163
+ // operations:(batchNo:string) => {
164
+ // return this.context.ready.then((axios) => {
165
+ // return axios.post(
166
+ // `/api/v2/batch/operationRecord`,{
167
+ // unitIds
168
+ // });
169
+ // });
170
+ // }
163
171
  }
164
172
  }
165
173