@cpzxrobot/sdk 1.1.28 → 1.1.30

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/car_gateway.ts CHANGED
@@ -7,20 +7,39 @@ export class CarGateway extends Object {
7
7
  this.context = context;
8
8
  }
9
9
 
10
- weightRecords(factory: Factory,date: Date) {
11
- return this.context.axios
12
- .get(`/api/v2/car/${factory.pid}/weightRecords?date=`+date.toISOString())
10
+ async weightRecords(factory: Factory, date: Date) {
11
+ var axios = await this.context.ready;
12
+ return axios
13
+ .get(`/api/v2/car/${factory.pid}/weightRecords?date=` + date.toISOString())
13
14
  .then((res) => res.data);
14
15
  }
15
16
 
16
- detections(factory: Factory,date: Date) {
17
- return this.context.axios
18
- .get(`/api/v2/car/${factory.pid}/detections?date=`+ date.toISOString())
17
+ async detections(factory: Factory, date: Date) {
18
+ var axios = await this.context.ready;
19
+ return axios
20
+ .get(`/api/v2/car/${factory.pid}/detections?date=` + date.toISOString())
19
21
  .then((res) => res.data);
20
22
  }
21
23
 
22
- orders(factory: Factory,date: Date) {
23
- return this.context.axios
24
- .get(`/api/v2/car/${factory.pid}/orders?date=`+ date.toISOString())
25
- }
24
+ async orders(factory: Factory, date: Date) {
25
+ var axios = await this.context.ready;
26
+ return axios
27
+ .get(`/api/v2/car/${factory.pid}/orders?date=` + date.toISOString())
28
+ }
29
+
30
+ listByProvince(area_code: string) {
31
+ return this.context.ready.then((axios) => {
32
+ return axios.get(`/api/v2/coremde-sale/car/province/get?area_code=${area_code}`);
33
+ });
34
+ }
35
+
36
+ get stat() {
37
+ return {
38
+ china: () => {
39
+ return this.context.ready.then((axios) => {
40
+ return axios.get(`/api/v2/coremde-sale/car/stat/china`);
41
+ });
42
+ },
43
+ }
44
+ }
26
45
  }
@@ -0,0 +1,58 @@
1
+ import { Cpzxrobot, Factory } from "./types";
2
+
3
+ export class CompanyGateway extends Object {
4
+ context: Cpzxrobot;
5
+ constructor(context: Cpzxrobot) {
6
+ super();
7
+ this.context = context;
8
+ }
9
+
10
+ async list() {
11
+ var axios = await this.context.ready;
12
+ return axios
13
+ .get(`/api/v2/company/list`);
14
+ }
15
+
16
+ get rank() {
17
+ return {
18
+ byRevenue: async (pageNo: number, pageSize: number) => {
19
+ var axios = await this.context.ready;
20
+ return axios.get(`/api/v2/coremde-sale/company/revenue/rank/list?pageNo=${pageNo}&pageSize=${pageSize}`);
21
+ },
22
+ byProfit: async (pageNo: number, pageSize: number) => {
23
+ var axios = await this.context.ready;
24
+ return axios.get(`/api/v2/coremde-sale/company/profit/rank/list?pageNo=${pageNo}&pageSize=${pageSize}`);
25
+ },
26
+ byOrder: async (pageNo: number, pageSize: number) => {
27
+ var axios = await this.context.ready;
28
+ return axios.get(`/api/v2/coremde-sale/company/order/rank/list?pageNo=${pageNo}&pageSize=${pageSize}`);
29
+ },
30
+ }
31
+ }
32
+
33
+ get cost() {
34
+ return {
35
+ byMonth: async (companyId: number) => {
36
+ var axios = await this.context.ready;
37
+ return axios.get(`/api/v2/coremde-sale/company/cost/month/get?companyId=${companyId}`);
38
+ },
39
+ byYear: async (companyId: number) => {
40
+ var axios = await this.context.ready;
41
+ return axios.get(`/api/v2/coremde-sale/company/cost/year/get?companyId=${companyId}`);
42
+ }
43
+ }
44
+ }
45
+
46
+ get revenue() {
47
+ return {
48
+ byMonth: async (pageNo: number, pageSize: number) => {
49
+ var axios = await this.context.ready;
50
+ return axios.get(`/api/v2/coremde-sale/company/revenue/month/list?pageNo=${pageNo}&pageSize=${pageSize}`);
51
+ },
52
+ byYear: async (pageNo: number, pageSize: number) => {
53
+ var axios = await this.context.ready;
54
+ return axios.get(`/api/v2/coremde-sale/company/revenue/year/list?pageNo=${pageNo}&pageSize=${pageSize}`);
55
+ }
56
+ }
57
+ }
58
+ }
@@ -19,6 +19,12 @@ export class CustomerGateway extends Object {
19
19
  });
20
20
  }
21
21
 
22
+ listByProvince(area_code:string){
23
+ return this.context.ready.then((axios) => {
24
+ return axios.get(`/api/v2/coremde-sale/customer/province/get?area_code=${area_code}`);
25
+ });
26
+ }
27
+
22
28
  get(id: number) {
23
29
  return this.context.ready.then((axios) => {
24
30
  return axios.get(`/api/v2/coremde-sale/customer/get?id=${id}`);
@@ -50,4 +56,14 @@ export class CustomerGateway extends Object {
50
56
  }
51
57
  }
52
58
 
59
+ get stat() {
60
+ return {
61
+ china: () => {
62
+ return this.context.ready.then((axios) => {
63
+ return axios.get(`/api/v2/coremde-sale/customer/stat/china`);
64
+ });
65
+ },
66
+ }
67
+ }
68
+
53
69
  }
@@ -6,19 +6,36 @@ class CarGateway extends Object {
6
6
  super();
7
7
  this.context = context;
8
8
  }
9
- weightRecords(factory, date) {
10
- return this.context.axios
9
+ async weightRecords(factory, date) {
10
+ var axios = await this.context.ready;
11
+ return axios
11
12
  .get(`/api/v2/car/${factory.pid}/weightRecords?date=` + date.toISOString())
12
13
  .then((res) => res.data);
13
14
  }
14
- detections(factory, date) {
15
- return this.context.axios
15
+ async detections(factory, date) {
16
+ var axios = await this.context.ready;
17
+ return axios
16
18
  .get(`/api/v2/car/${factory.pid}/detections?date=` + date.toISOString())
17
19
  .then((res) => res.data);
18
20
  }
19
- orders(factory, date) {
20
- return this.context.axios
21
+ async orders(factory, date) {
22
+ var axios = await this.context.ready;
23
+ return axios
21
24
  .get(`/api/v2/car/${factory.pid}/orders?date=` + date.toISOString());
22
25
  }
26
+ listByProvince(area_code) {
27
+ return this.context.ready.then((axios) => {
28
+ return axios.get(`/api/v2/coremde-sale/car/province/get?area_code=${area_code}`);
29
+ });
30
+ }
31
+ get stat() {
32
+ return {
33
+ china: () => {
34
+ return this.context.ready.then((axios) => {
35
+ return axios.get(`/api/v2/coremde-sale/car/stat/china`);
36
+ });
37
+ },
38
+ };
39
+ }
23
40
  }
24
41
  exports.CarGateway = CarGateway;
@@ -1,20 +1,55 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.ProductGateway = void 0;
4
- class ProductGateway extends Object {
3
+ exports.CompanyGateway = void 0;
4
+ class CompanyGateway extends Object {
5
5
  constructor(context) {
6
6
  super();
7
7
  this.context = context;
8
8
  }
9
- list(args) {
10
- return this.context.ready.then((axios) => {
11
- return axios.post(`/api/v2/coremde-sale/product/list`, args);
12
- });
9
+ async list() {
10
+ var axios = await this.context.ready;
11
+ return axios
12
+ .get(`/api/v2/company/list`);
13
13
  }
14
- get(id) {
15
- return this.context.ready.then((axios) => {
16
- return axios.get(`/api/v2/coremde-sale/product/get?id=${id}`);
17
- });
14
+ get rank() {
15
+ return {
16
+ byRevenue: async (pageNo, pageSize) => {
17
+ var axios = await this.context.ready;
18
+ return axios.get(`/api/v2/coremde-sale/company/revenue/rank/list?pageNo=${pageNo}&pageSize=${pageSize}`);
19
+ },
20
+ byProfit: async (pageNo, pageSize) => {
21
+ var axios = await this.context.ready;
22
+ return axios.get(`/api/v2/coremde-sale/company/profit/rank/list?pageNo=${pageNo}&pageSize=${pageSize}`);
23
+ },
24
+ byOrder: async (pageNo, pageSize) => {
25
+ var axios = await this.context.ready;
26
+ return axios.get(`/api/v2/coremde-sale/company/order/rank/list?pageNo=${pageNo}&pageSize=${pageSize}`);
27
+ },
28
+ };
29
+ }
30
+ get cost() {
31
+ return {
32
+ byMonth: async (companyId) => {
33
+ var axios = await this.context.ready;
34
+ return axios.get(`/api/v2/coremde-sale/company/cost/month/get?companyId=${companyId}`);
35
+ },
36
+ byYear: async (companyId) => {
37
+ var axios = await this.context.ready;
38
+ return axios.get(`/api/v2/coremde-sale/company/cost/year/get?companyId=${companyId}`);
39
+ }
40
+ };
41
+ }
42
+ get revenue() {
43
+ return {
44
+ byMonth: async (pageNo, pageSize) => {
45
+ var axios = await this.context.ready;
46
+ return axios.get(`/api/v2/coremde-sale/company/revenue/month/list?pageNo=${pageNo}&pageSize=${pageSize}`);
47
+ },
48
+ byYear: async (pageNo, pageSize) => {
49
+ var axios = await this.context.ready;
50
+ return axios.get(`/api/v2/coremde-sale/company/revenue/year/list?pageNo=${pageNo}&pageSize=${pageSize}`);
51
+ }
52
+ };
18
53
  }
19
54
  }
20
- exports.ProductGateway = ProductGateway;
55
+ exports.CompanyGateway = CompanyGateway;
@@ -11,6 +11,11 @@ class CustomerGateway extends Object {
11
11
  return axios.post(`/api/v2/coremde-sale/customer/list`, args);
12
12
  });
13
13
  }
14
+ listByProvince(area_code) {
15
+ return this.context.ready.then((axios) => {
16
+ return axios.get(`/api/v2/coremde-sale/customer/province/get?area_code=${area_code}`);
17
+ });
18
+ }
14
19
  get(id) {
15
20
  return this.context.ready.then((axios) => {
16
21
  return axios.get(`/api/v2/coremde-sale/customer/get?id=${id}`);
@@ -35,5 +40,14 @@ class CustomerGateway extends Object {
35
40
  },
36
41
  };
37
42
  }
43
+ get stat() {
44
+ return {
45
+ china: () => {
46
+ return this.context.ready.then((axios) => {
47
+ return axios.get(`/api/v2/coremde-sale/customer/stat/china`);
48
+ });
49
+ },
50
+ };
51
+ }
38
52
  }
39
53
  exports.CustomerGateway = CustomerGateway;
package/dist/index.js CHANGED
@@ -21,6 +21,7 @@ const project_gateway_1 = require("./project_gateway");
21
21
  const product_gateway_1 = require("./product_gateway");
22
22
  const contract_gateway_1 = require("./contract_gateway");
23
23
  const customer_gateway_1 = require("./customer_gateway");
24
+ const company_gateway_1 = require("./company_gateway");
24
25
  class Cpzxrobot {
25
26
  constructor(appCode) {
26
27
  this.pigfarm = new pigfarm_gateway_1.PigfarmGateway(this);
@@ -34,6 +35,7 @@ class Cpzxrobot {
34
35
  this.product = new product_gateway_1.ProductGateway(this);
35
36
  this.contract = new contract_gateway_1.ContractGateway(this);
36
37
  this.customer = new customer_gateway_1.CustomerGateway(this);
38
+ this.company = new company_gateway_1.CompanyGateway(this);
37
39
  //获取当前浏览器的域名
38
40
  this.ready = new Promise((resolve, reject) => {
39
41
  this.resolveReady = resolve;
@@ -18,11 +18,11 @@ class ProjectGateway extends Object {
18
18
  }
19
19
  get feedback() {
20
20
  return {
21
- add: (userId, address) => {
21
+ add: (projectId, content) => {
22
22
  return this.context.ready.then((axios) => {
23
- return axios.post(`/api/v2/coremde-sale/checkin/add`, {
24
- userId,
25
- address
23
+ return axios.post(`/api/v2/coremde-sale/feedback/add`, {
24
+ projectId,
25
+ content
26
26
  });
27
27
  });
28
28
  },
@@ -34,6 +34,60 @@ class ProjectGateway extends Object {
34
34
  }
35
35
  };
36
36
  }
37
+ get stat() {
38
+ return {
39
+ china: () => {
40
+ return this.context.ready.then((axios) => {
41
+ return axios.get(`/api/v2/coremde-sale/project/stat/china`);
42
+ });
43
+ },
44
+ };
45
+ }
46
+ get attendance() {
47
+ return {
48
+ // 获取考勤列表
49
+ list: async (projectId) => {
50
+ var axios = await this.context.ready;
51
+ return axios.get(`/api/v2/coremde-sale/project/attendance/get?id=${projectId}`);
52
+ }
53
+ };
54
+ }
55
+ get constructionTeam() {
56
+ return {
57
+ // 获取施工队列表
58
+ list: (projectId) => {
59
+ return this.context.ready.then((axios) => {
60
+ return axios.get(`/api/v2/coremde-sale/project/construction/team/get?id=${projectId}`);
61
+ });
62
+ },
63
+ };
64
+ }
65
+ get document() {
66
+ return {
67
+ // 获取施工队列表
68
+ list: (args) => {
69
+ return this.context.ready.then((axios) => {
70
+ return axios.post(`/api/v2/coremde-sale/project/document/list`, args);
71
+ });
72
+ },
73
+ };
74
+ }
75
+ get meterial() {
76
+ return {
77
+ // 获取材料列表
78
+ list: (args) => {
79
+ return this.context.ready.then((axios) => {
80
+ return axios.post(`/api/v2/coremde-sale/project/meterial/list`, args);
81
+ });
82
+ }
83
+ };
84
+ }
85
+ //根据省份获取项目
86
+ listByProvince(area_code) {
87
+ return this.context.ready.then((axios) => {
88
+ return axios.get(`/api/v2/coremde-sale/project/province/get?area_code=${area_code}`);
89
+ });
90
+ }
37
91
  get inquiry() {
38
92
  return {
39
93
  // 获取询价列表
@@ -58,11 +58,11 @@ class UnitGateway extends Object {
58
58
  });
59
59
  },
60
60
  //绑定阈值配置
61
- bind: (unit, thresholdConfig) => {
61
+ bind: (unit, ids) => {
62
62
  return this.context.ready.then((axios) => {
63
63
  return axios.post(`/api/v2/unit/threshold`, {
64
64
  unitId: unit.id,
65
- configId: thresholdConfig.id,
65
+ ids: ids,
66
66
  });
67
67
  });
68
68
  },
@@ -107,6 +107,11 @@ class UserGateway extends Object {
107
107
  var axios = await this.context.ready;
108
108
  return axios.get("/api/v2/" + factory.id + "/users");
109
109
  }
110
+ listByProvince(area_code) {
111
+ return this.context.ready.then((axios) => {
112
+ return axios.get(`/api/v2/coremde-sale/user/province/get?area_code=${area_code}`);
113
+ });
114
+ }
110
115
  async mypermission() {
111
116
  var axios = await this.context.ready;
112
117
  return axios.get("/api/v2/user/role/mypermission");
@@ -141,11 +146,12 @@ class UserGateway extends Object {
141
146
  }
142
147
  get checkin() {
143
148
  return {
144
- add: (userId, address) => {
149
+ add: (userId, address, areaCode) => {
145
150
  return this.context.ready.then((axios) => {
146
151
  return axios.post(`/api/v2/coremde-sale/checkin/add`, {
147
152
  userId,
148
- address
153
+ address,
154
+ areaCode
149
155
  });
150
156
  });
151
157
  },
@@ -208,5 +214,14 @@ class UserGateway extends Object {
208
214
  }
209
215
  };
210
216
  }
217
+ get stat() {
218
+ return {
219
+ china: () => {
220
+ return this.context.ready.then((axios) => {
221
+ return axios.get(`/api/v2/coremde-sale/user/stat/china`);
222
+ });
223
+ },
224
+ };
225
+ }
211
226
  }
212
227
  exports.UserGateway = UserGateway;
package/index.ts CHANGED
@@ -16,6 +16,7 @@ import { ProjectGateway } from "./project_gateway";
16
16
  import { ProductGateway } from "./product_gateway";
17
17
  import { ContractGateway } from "./contract_gateway";
18
18
  import { CustomerGateway } from "./customer_gateway";
19
+ import { CompanyGateway } from "./company_gateway";
19
20
 
20
21
  export class Cpzxrobot {
21
22
  device: DeviceGateway;
@@ -53,6 +54,7 @@ export class Cpzxrobot {
53
54
  product: ProductGateway = new ProductGateway(this);
54
55
  contract: ContractGateway = new ContractGateway(this);
55
56
  customer: CustomerGateway = new CustomerGateway(this);
57
+ company: CompanyGateway = new CompanyGateway(this);
56
58
 
57
59
  constructor(appCode: string) {
58
60
  //获取当前浏览器的域名
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cpzxrobot/sdk",
3
- "version": "1.1.28",
3
+ "version": "1.1.30",
4
4
  "description": "提供给上海正芯数智APP第三方H5应用使用的SDK",
5
5
  "main": "dist/index.js",
6
6
  "scripts": {
@@ -28,11 +28,11 @@ export class ProjectGateway extends Object {
28
28
 
29
29
  get feedback() {
30
30
  return {
31
- add: (userId: number,address: String) => {
31
+ add: (projectId: number, content: String) => {
32
32
  return this.context.ready.then((axios) => {
33
- return axios.post(`/api/v2/coremde-sale/checkin/add`, {
34
- userId,
35
- address
33
+ return axios.post(`/api/v2/coremde-sale/feedback/add`, {
34
+ projectId,
35
+ content
36
36
  });
37
37
  });
38
38
  },
@@ -49,6 +49,77 @@ export class ProjectGateway extends Object {
49
49
  };
50
50
  }
51
51
 
52
+ get stat() {
53
+ return {
54
+ china: () => {
55
+ return this.context.ready.then((axios) => {
56
+ return axios.get(`/api/v2/coremde-sale/project/stat/china`);
57
+ });
58
+ },
59
+ }
60
+ }
61
+
62
+
63
+
64
+ get attendance() {
65
+ return {
66
+ // 获取考勤列表
67
+ list: async (projectId: number) => {
68
+ var axios = await this.context.ready;
69
+ return axios.get(`/api/v2/coremde-sale/project/attendance/get?id=${projectId}`);
70
+ }
71
+ }
72
+ }
73
+
74
+ get constructionTeam() {
75
+ return {
76
+ // 获取施工队列表
77
+ list: (projectId: number) => {
78
+ return this.context.ready.then((axios) => {
79
+ return axios.get(`/api/v2/coremde-sale/project/construction/team/get?id=${projectId}`);
80
+ });
81
+ },
82
+ };
83
+ }
84
+
85
+ get document() {
86
+ return {
87
+ // 获取施工队列表
88
+ list: (args: {
89
+ pageNo: number;
90
+ pageSize: number;
91
+ projectId: number;
92
+ }) => {
93
+ return this.context.ready.then((axios) => {
94
+ return axios.post(`/api/v2/coremde-sale/project/document/list`, args);
95
+ });
96
+ },
97
+ };
98
+ }
99
+
100
+
101
+ get meterial() {
102
+ return {
103
+ // 获取材料列表
104
+ list: (args: {
105
+ pageNo: number;
106
+ pageSize: number;
107
+ projectId: number;
108
+ }) => {
109
+ return this.context.ready.then((axios) => {
110
+ return axios.post(`/api/v2/coremde-sale/project/meterial/list`, args);
111
+ });
112
+ }
113
+ }
114
+ }
115
+
116
+ //根据省份获取项目
117
+ listByProvince(area_code: string) {
118
+ return this.context.ready.then((axios) => {
119
+ return axios.get(`/api/v2/coremde-sale/project/province/get?area_code=${area_code}`);
120
+ });
121
+ }
122
+
52
123
  get inquiry() {
53
124
  return {
54
125
  // 获取询价列表
package/readme.md CHANGED
@@ -149,14 +149,46 @@ baseURL: "/"
149
149
  | cpzxrobot().user.checkin.list | 列出用户签到记录,传入userId和date参数 |
150
150
  | cpzxrobot().user.searchHistory.list | 列出用户搜索历史记录,传入type参数 |
151
151
  | cpzxrobot().user.searchHistory.add | 添加用户搜索历史记录,传入type参数和搜索内容 |
152
+ | cpzxrobot().user.stat.china | 获得员工在全国的统计信息 |
153
+ | cpzxrobot().user.listByProvince | 获得员工在某个省的统计信息,传入province参数 |
152
154
  | cpzxrobot().product.list | 获得产品列表,传入factory_id和必要的分页参数 |
153
155
  | cpzxrobot().product.get | 获得产品信息,传入id参数 |
156
+ | cpzxrobot().product.price.list | 获得产品报价列表 |
157
+ | cpzxrobot().product.price.get | 获得产品报价信息,传入id参数 |
158
+ | cpzxrobot().product.price.add | 添加产品报价信息 |
154
159
  | cpzxrobot().project.list | 获得项目列表,传入factory_id和必要的分页参数 |
155
160
  | cpzxrobot().project.feedback.list | 获得项目反馈列表,传入project_id参数 |
161
+ | cpzxrobot().project.feedback.add | 添加项目反馈信息,传入project_id和反馈内容 |
156
162
  | cpzxrobot().project.get | 获得项目信息,传入id参数 |
163
+ | cpzxrobot().project.stat.china | 获得项目在全国的统计信息 |
164
+ | cpzxrobot().project.inquiry.list | 获得项目询盘列表,传入project_id参数 |
165
+ | cpzxrobot().project.inquiry.get | 获得项目询盘信息,传入id参数 |
166
+ | cpzxrobot().project.inquiry.add | 添加项目询盘信息,传入project_id和询盘内容 |
167
+ | cpzxrobot().project.document.list | 获得项目文档列表,传入project_id参数 |
168
+ | cpzxrobot().project.material.list | 获得项目物料到货列表,传入project_id参数 |
169
+ | cpzxrobot().project.attendance.list | 获得项目到岗列表,传入project_id参数 |
170
+ | cpzxrobot().project.constructionTeam.list | 获得项目施工队列表,传入project_id参数 |
171
+ | cpzxrobot().project.listByProvince | 获得项目在某个省的统计信息,传入province参数 |
157
172
  | cpzxrobot().contract.list | 获得合同列表,传入factory_id和必要的分页参数 |
158
173
  | cpzxrobot().contract.get | 获得合同信息,传入id参数 |
159
174
  | cpzxrobot().contract.add | 添加合同 |
175
+ | cpzxrobot().customer.list | 获得客户列表,传入factory_id和必要的分页参数 |
176
+ | cpzxrobot().customer.get | 获得客户信息,传入id参数 |
177
+ | cpzxrobot().customer.add | 添加客户 |
178
+ | cpzxrobot().customer.update | 更新客户 |
179
+ | cpzxrobot().customer.visit.add | 添加客户拜访记录 |
180
+ | cpzxrobot().customer.stat.china | 获得客户在全国的统计信息 |
181
+ | cpzxrobot().customer.listByProvince | 获得客户在某个省的统计信息,传入province参数 |
182
+ | cpzxrobot().company.list | 获得公司列表,传入必要的分页参数 |
183
+ | cpzxrobot().company.rank.byRevenue | 按公司营收获取排名,传入必要的分页参数 |
184
+ | cpzxrobot().company.rank.byProfit | 按公司利润获取排名,传入必要的分页参数 |
185
+ | cpzxrobot().company.rank.byOrder | 按公司订单获取排名,传入必要的分页参数 |
186
+ | cpzxrobot().company.cost.byMonth | 按公司按月成本 |
187
+ | cpzxrobot().company.cost.byYear | 按公司按年成本 |
188
+ | cpzxrobot().company.revenue.byMonth | 按公司按月营收 |
189
+ | cpzxrobot().company.revenue.byYear | 按公司按年营收 |
190
+ | cpzxrobot().car.stat.china | 获得车辆在全国的统计信息 |
191
+ | cpzxrobot().car.listByProvince | 获得车辆在某个省的统计信息,传入province参数 |
160
192
 
161
193
  ### 工厂信息接口
162
194
 
package/types.d.ts CHANGED
@@ -12,6 +12,7 @@ import { ProjectGateway } from "@cpzxrobot/sdk/project_gateway";
12
12
  import { ProductGateway } from "@cpzxrobot/sdk/product_gateway";
13
13
  import { ContractGateway } from "@cpzxrobot/sdk/contract_gateway";
14
14
  import { CustomerGateway } from "@cpzxrobot/sdk/customer_gateway";
15
+ import { CompanyGateway } from "@cpzxrobot/sdk/company_gateway";
15
16
 
16
17
  type Device = {
17
18
  id: number;
@@ -315,6 +316,7 @@ class Cpzxrobot {
315
316
  project: ProjectGateway;
316
317
  contract: ContractGateway;
317
318
  customer: CustomerGateway;
319
+ company: CompanyGateway;
318
320
  dict: (key: string) => any;
319
321
  _getSelectedFarmFromMiniApp: () => Promise<Factory>;
320
322
  _getSelectedUnitFromMiniApp: () => Promise<Unit>;
package/unit_gateway.ts CHANGED
@@ -75,11 +75,11 @@ export class UnitGateway extends Object {
75
75
  });
76
76
  },
77
77
  //绑定阈值配置
78
- bind: (unit: Unit, thresholdConfig: any) => {
78
+ bind: (unit: Unit, ids: number[]) => {
79
79
  return this.context.ready.then((axios) => {
80
80
  return axios.post(`/api/v2/unit/threshold`, {
81
81
  unitId: unit.id,
82
- configId: thresholdConfig.id,
82
+ ids: ids,
83
83
  });
84
84
  });
85
85
  },
package/user_gateway.ts CHANGED
@@ -116,6 +116,13 @@ export class UserGateway extends Object {
116
116
  return axios.get("/api/v2/" + factory.id + "/users");
117
117
  }
118
118
 
119
+
120
+ listByProvince(area_code: string) {
121
+ return this.context.ready.then((axios) => {
122
+ return axios.get(`/api/v2/coremde-sale/user/province/get?area_code=${area_code}`);
123
+ });
124
+ }
125
+
119
126
  async mypermission() {
120
127
  var axios = await this.context.ready;
121
128
  return axios.get("/api/v2/user/role/mypermission");
@@ -154,11 +161,12 @@ export class UserGateway extends Object {
154
161
 
155
162
  get checkin() {
156
163
  return {
157
- add: (userId: number, address: String) => {
164
+ add: (userId: number, address: String, areaCode: String) => {
158
165
  return this.context.ready.then((axios) => {
159
166
  return axios.post(`/api/v2/coremde-sale/checkin/add`, {
160
167
  userId,
161
- address
168
+ address,
169
+ areaCode
162
170
  });
163
171
  });
164
172
  },
@@ -223,4 +231,14 @@ export class UserGateway extends Object {
223
231
  }
224
232
  };
225
233
  }
234
+
235
+ get stat() {
236
+ return {
237
+ china: () => {
238
+ return this.context.ready.then((axios) => {
239
+ return axios.get(`/api/v2/coremde-sale/user/stat/china`);
240
+ });
241
+ },
242
+ }
243
+ }
226
244
  }