@cpzxrobot/sdk 1.1.64 → 1.1.66

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.
@@ -1,4 +1,4 @@
1
- import { Cpzxrobot, Factory } from "./types";
1
+ import { Cpzxrobot } from "./types";
2
2
 
3
3
  export class CompanyGateway extends Object {
4
4
  context: Cpzxrobot;
@@ -45,7 +45,7 @@ export class CompanyGateway extends Object {
45
45
 
46
46
  get enterprise() {
47
47
  return {
48
- userCount: async (companyId: number) => {
48
+ userCount: async () => {
49
49
  var axios = await this.context.ready;
50
50
  return axios.get(`/api/v2/coremde-sale/company/enterprise/count/user`);
51
51
  },
@@ -1,4 +1,4 @@
1
- import { Cpzxrobot, Factory, Unit } from "./types";
1
+ import { Cpzxrobot } from "./types";
2
2
 
3
3
  export class CustomerGateway extends Object {
4
4
  context: Cpzxrobot;
@@ -199,10 +199,11 @@ export class FeedTowerGateway extends DeviceFilter<FeedTower> {
199
199
  force: force
200
200
  });
201
201
  },
202
- correctWeight: (ft: FeedTowerV2, amount: Number) => {
202
+ correctWeight: (ft: FeedTowerV2, amount: Number,displayAmount: Number| undefined = undefined) => {
203
203
  return this.context.axios.post(`/api/v2/device/feedTower/correctWeight`, {
204
204
  id: ft.id,
205
205
  suttle: amount,
206
+ displaySuttle: displayAmount
206
207
  });
207
208
  }
208
209
  };
@@ -41,7 +41,7 @@ class CompanyGateway extends Object {
41
41
  }
42
42
  get enterprise() {
43
43
  return {
44
- userCount: async (companyId) => {
44
+ userCount: async () => {
45
45
  var axios = await this.context.ready;
46
46
  return axios.get(`/api/v2/coremde-sale/company/enterprise/count/user`);
47
47
  },
@@ -137,10 +137,11 @@ class FeedTowerGateway extends device_filter_1.DeviceFilter {
137
137
  force: force
138
138
  });
139
139
  },
140
- correctWeight: (ft, amount) => {
140
+ correctWeight: (ft, amount, displayAmount = undefined) => {
141
141
  return this.context.axios.post(`/api/v2/device/feedTower/correctWeight`, {
142
142
  id: ft.id,
143
143
  suttle: amount,
144
+ displaySuttle: displayAmount
144
145
  });
145
146
  }
146
147
  };
@@ -100,7 +100,13 @@ class UnitGateway extends Object {
100
100
  unitIds
101
101
  });
102
102
  });
103
- }
103
+ },
104
+ //获取某个单元的批次信息
105
+ get: (unitNo) => {
106
+ return this.context.ready.then((axios) => {
107
+ return axios.get(`/api/v2/batch/unit/${unitNo}`);
108
+ });
109
+ },
104
110
  };
105
111
  }
106
112
  v2() {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cpzxrobot/sdk",
3
- "version": "1.1.64",
3
+ "version": "1.1.66",
4
4
  "description": "提供给上海正芯数智APP第三方H5应用使用的SDK",
5
5
  "main": "dist/index.js",
6
6
  "scripts": {
@@ -1,4 +1,4 @@
1
- import { Cpzxrobot, Factory, Unit } from "./types";
1
+ import { Cpzxrobot } from "./types";
2
2
 
3
3
  export class ProjectGateway extends Object {
4
4
  context: Cpzxrobot;
package/readme.md CHANGED
@@ -142,6 +142,7 @@ baseURL: "/"
142
142
  | cpzxrobot().unit.thresholdConfig.delete | 删除单元的阈值配置信息,传入get获取的条目的具体id或对象本身 |
143
143
  | cpzxrobot().unit.batch.bind | 绑定单元和生产批次关系 |
144
144
  | cpzxrobot().unit.batch.clear | 清除单元绑定的生产批次 |
145
+ | cpzxrobot().unit.batch.get | 获取单元绑定的生产批次 |
145
146
  | cpzxrobot().user.add | 添加用户 |
146
147
  | cpzxrobot().user.update | 更新用户 |
147
148
  | cpzxrobot().user.list | 列出用户(传入工厂) |
package/unit_gateway.ts CHANGED
@@ -121,7 +121,13 @@ export class UnitGateway extends Object {
121
121
  unitIds
122
122
  });
123
123
  });
124
- }
124
+ },
125
+ //获取某个单元的批次信息
126
+ get: (unitNo: Number) => {
127
+ return this.context.ready.then((axios) => {
128
+ return axios.get(`/api/v2/batch/unit/${unitNo}`);
129
+ });
130
+ },
125
131
  }
126
132
  }
127
133