@cpzxrobot/sdk 1.2.0 → 1.2.2

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.
@@ -85,6 +85,7 @@ class UnitGateway extends Object {
85
85
  //批次管理
86
86
  get batch() {
87
87
  return {
88
+ // @deprecated
88
89
  bind: (unitDayage, batchNo, type) => {
89
90
  return this.context.ready.then((axios) => {
90
91
  return axios.post(`/api/v2/batch/unit/bind`, {
@@ -94,15 +95,39 @@ class UnitGateway extends Object {
94
95
  });
95
96
  });
96
97
  },
98
+ //创建批次,和bind可以复用
99
+ create: (args) => {
100
+ return this.context.ready.then((axios) => {
101
+ return axios.post(`/api/v2/batch/unit/bind`, args);
102
+ });
103
+ },
104
+ update: (args) => {
105
+ return this.context.ready.then((axios) => {
106
+ return axios.post(`/api/v2/batch/unit/update`, args);
107
+ });
108
+ },
97
109
  clear: (args) => {
98
110
  return this.context.ready.then((axios) => {
99
111
  return axios.post(`/api/v2/batch/unit/empty`, args);
100
112
  });
101
113
  },
102
- //获取某个单元的批次信息
103
- get: (unitNo) => {
114
+ //获取某个批次的所有单元信息
115
+ // deperacated
116
+ get: (batchNo) => {
117
+ return this.context.ready.then((axios) => {
118
+ return axios.get(`/api/v2/batch/unit/${batchNo}?`);
119
+ });
120
+ },
121
+ //获取某个批次的所有单元信息
122
+ getUnits: (batchNo) => {
123
+ return this.context.ready.then((axios) => {
124
+ return axios.get(`/api/v2/batch/unit/${batchNo}?`);
125
+ });
126
+ },
127
+ //查询某个单元的所有批次信息
128
+ searchInUnit: (unitId, args) => {
104
129
  return this.context.ready.then((axios) => {
105
- return axios.get(`/api/v2/batch/unit/${unitNo}`);
130
+ return axios.post(`/api/v2/batch/${unitId}?`, args);
106
131
  });
107
132
  },
108
133
  list: (unitIds) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cpzxrobot/sdk",
3
- "version": "1.2.0",
3
+ "version": "1.2.2",
4
4
  "description": "提供给上海正芯数智APP第三方H5应用使用的SDK",
5
5
  "main": "dist/index.js",
6
6
  "scripts": {
package/readme.md CHANGED
@@ -145,8 +145,11 @@ baseURL: "/"
145
145
  | cpzxrobot().unit.thresholdConfig.bind | 设置单元的阈值配置信息 |
146
146
  | cpzxrobot().unit.thresholdConfig.delete | 删除单元的阈值配置信息,传入get获取的条目的具体id或对象本身 |
147
147
  | cpzxrobot().unit.batch.bind | 绑定单元和生产批次关系 |
148
+ | cpzxrobot().unit.batch.create | 创建生产批次 |
149
+ | cpzxrobot().unit.batch.update | 更新生产批次信息,传入id参数和更新的内容 |
148
150
  | cpzxrobot().unit.batch.clear | 清除单元绑定的生产批次 |
149
- | cpzxrobot().unit.batch.get | 获取单元绑定的生产批次 |
151
+ | cpzxrobot().unit.batch.getUnits | 获取批次的绑定单元信息 |
152
+ | cpzxrobot().unit.batch.searchInUnit | 搜索单元的生产批次信息 |
150
153
  | cpzxrobot().unit.batch.list | 获取多个单元的生产批次信息 |
151
154
  | cpzxrobot().user.add | 添加用户 |
152
155
  | cpzxrobot().user.update | 更新用户 |
package/unit_gateway.ts CHANGED
@@ -102,6 +102,7 @@ export class UnitGateway extends Object {
102
102
  //批次管理
103
103
  get batch() {
104
104
  return {
105
+ // @deprecated
105
106
  bind: (unitDayage: {
106
107
  unitId: Number;
107
108
  dayage: Number;
@@ -115,16 +116,40 @@ export class UnitGateway extends Object {
115
116
  });
116
117
  });
117
118
  },
119
+ //创建批次,和bind可以复用
120
+ create: (args:any) => {
121
+ return this.context.ready.then((axios) => {
122
+ return axios.post(`/api/v2/batch/unit/bind`, args);
123
+ });
124
+ },
125
+ update: (args:any) => {
126
+ return this.context.ready.then((axios) => {
127
+ return axios.post(`/api/v2/batch/unit/update`, args);
128
+ });
129
+ },
118
130
  clear: (args:any) => {
119
131
  return this.context.ready.then((axios) => {
120
132
  return axios.post(
121
133
  `/api/v2/batch/unit/empty`,args);
122
134
  });
123
135
  },
124
- //获取某个单元的批次信息
125
- get: (unitNo: Number) => {
136
+ //获取某个批次的所有单元信息
137
+ // deperacated
138
+ get: (batchNo: Number) => {
139
+ return this.context.ready.then((axios) => {
140
+ return axios.get(`/api/v2/batch/unit/${batchNo}?`);
141
+ });
142
+ },
143
+ //获取某个批次的所有单元信息
144
+ getUnits: (batchNo: Number) => {
145
+ return this.context.ready.then((axios) => {
146
+ return axios.get(`/api/v2/batch/unit/${batchNo}?`);
147
+ });
148
+ },
149
+ //查询某个单元的所有批次信息
150
+ searchInUnit: (unitId: Number,args :any) => {
126
151
  return this.context.ready.then((axios) => {
127
- return axios.get(`/api/v2/batch/unit/${unitNo}`);
152
+ return axios.post(`/api/v2/batch/${unitId}?`,args);
128
153
  });
129
154
  },
130
155
  list: (unitIds: Number[]) => {