@cpzxrobot/sdk 1.2.4 → 1.2.6

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.
@@ -128,9 +128,9 @@ export class CustomerGateway extends Object {
128
128
 
129
129
  get count() {
130
130
  return {
131
- byStatus: () => {
131
+ byStatus: (companyId: Number) => {
132
132
  return this.context.ready.then((axios) => {
133
- return axios.get(`/api/v2/coremde-sale/customer/status/list-count`);
133
+ return axios.get(`/api/v2/coremde-sale/customer/status/list-count?companyId=${companyId}`);
134
134
  });
135
135
  },
136
136
  }
@@ -94,9 +94,9 @@ class CustomerGateway extends Object {
94
94
  }
95
95
  get count() {
96
96
  return {
97
- byStatus: () => {
97
+ byStatus: (companyId) => {
98
98
  return this.context.ready.then((axios) => {
99
- return axios.get(`/api/v2/coremde-sale/customer/status/list-count`);
99
+ return axios.get(`/api/v2/coremde-sale/customer/status/list-count?companyId=${companyId}`);
100
100
  });
101
101
  },
102
102
  };
@@ -100,6 +100,20 @@ class TransportGateway extends Object {
100
100
  });
101
101
  });
102
102
  },
103
+ delete: (id) => {
104
+ return this.context.ready.then(() => {
105
+ return this.context.axios
106
+ .get("/api/v2/pigfarm/feedTower/fodder/delete", {
107
+ params: { id }
108
+ })
109
+ .then((res) => {
110
+ if (res.data.code != 200) {
111
+ throw res.data.message;
112
+ }
113
+ return res.data;
114
+ });
115
+ });
116
+ },
103
117
  };
104
118
  }
105
119
  }
@@ -137,14 +137,26 @@ 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
+ // 获取批次操作记录
141
+ operation: (batchNo) => {
142
+ return this.context.ready.then((axios) => {
143
+ return axios.get(`/api/v2/batch/operation`, {
144
+ params: {
145
+ batchNo
146
+ }
147
+ });
148
+ });
149
+ },
150
+ // 删除批次
151
+ delete: (id) => {
152
+ return this.context.ready.then((axios) => {
153
+ return axios.get(`/api/v2/batch/delete`, {
154
+ params: {
155
+ id
156
+ }
157
+ });
158
+ });
159
+ }
148
160
  };
149
161
  }
150
162
  v2() {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cpzxrobot/sdk",
3
- "version": "1.2.4",
3
+ "version": "1.2.6",
4
4
  "description": "提供给上海正芯数智APP第三方H5应用使用的SDK",
5
5
  "main": "dist/index.js",
6
6
  "scripts": {
package/readme.md CHANGED
@@ -103,6 +103,7 @@ baseURL: "/"
103
103
  | cpzxrobot().factory.workshop.delete | 删除车间信息,需要传入id参数 |
104
104
  | cpzxrobot().factory.batch.list | 获得批次列表,传入factoryId参数 |ldiba
105
105
  | cpzxrobot().transport.fodder.getDeviceByFodderld | 获得料单对应的设备 |
106
+ | cpzxrobot().transport.fodder.delete | 删除饲料信息,需要传入id参数 |
106
107
  | cpzxrobot().pigfarm.heatlamp.xxx | 操作保温灯 |
107
108
  | cpzxrobot().pigfarm.weightMeter.config.list | 获取称重计的配置信息 |
108
109
  | cpzxrobot().pigfarm.weightMeter.config.bind | 添加称重计的配置信息,绑定到料塔 |
@@ -151,6 +152,8 @@ baseURL: "/"
151
152
  | cpzxrobot().unit.batch.getUnits | 获取批次的绑定单元信息 |
152
153
  | cpzxrobot().unit.batch.searchInUnit | 搜索单元的生产批次信息 |
153
154
  | cpzxrobot().unit.batch.list | 获取多个单元的生产批次信息 |
155
+ | cpzxrobot().unit.batch.operation | 获取批次操作记录,传入 batchNo 参数 |
156
+ | cpzxrobot().unit.batch.deleteBatch | 删除批次,传入批次 id 参数 |
154
157
  | cpzxrobot().user.add | 添加用户 |
155
158
  | cpzxrobot().user.update | 更新用户 |
156
159
  | cpzxrobot().user.list | 列出用户(传入工厂) |
@@ -116,6 +116,20 @@ export class TransportGateway extends Object {
116
116
  });
117
117
  });
118
118
  },
119
+ delete: (id: number): Promise<any> => {
120
+ return this.context.ready.then(() => {
121
+ return this.context.axios
122
+ .get("/api/v2/pigfarm/feedTower/fodder/delete", {
123
+ params: { id }
124
+ })
125
+ .then((res) => {
126
+ if (res.data.code != 200) {
127
+ throw res.data.message;
128
+ }
129
+ return res.data;
130
+ });
131
+ });
132
+ },
119
133
  };
120
134
  }
121
135
  }
package/unit_gateway.ts CHANGED
@@ -160,14 +160,26 @@ 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
+ // 获取批次操作记录
164
+ operation: (batchNo: string) => {
165
+ return this.context.ready.then((axios) => {
166
+ return axios.get(`/api/v2/batch/operation`, {
167
+ params: {
168
+ batchNo
169
+ }
170
+ });
171
+ });
172
+ },
173
+ // 删除批次
174
+ delete: (id: string) => {
175
+ return this.context.ready.then((axios) => {
176
+ return axios.get(`/api/v2/batch/delete`, {
177
+ params: {
178
+ id
179
+ }
180
+ });
181
+ });
182
+ }
171
183
  }
172
184
  }
173
185
 
@@ -212,4 +224,4 @@ export class UnitGateway extends Object {
212
224
  },
213
225
  };
214
226
  }
215
- }
227
+ }