@cpzxrobot/sdk 1.3.69 → 1.3.71

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,13 @@
1
1
  "use strict";
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
+ return new (P || (P = Promise))(function (resolve, reject) {
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
+ });
10
+ };
2
11
  Object.defineProperty(exports, "__esModule", { value: true });
3
12
  exports.CompanyGateway = void 0;
4
13
  const warzone_gateway_1 = require("./warzone_gateway");
@@ -8,120 +17,133 @@ class CompanyGateway extends Object {
8
17
  this.context = context;
9
18
  this.warzone = new warzone_gateway_1.WarzoneGateway(context);
10
19
  }
11
- async list(pageNo, pageSize, pid, companyName) {
12
- var axios = await this.context.ready;
13
- return axios
14
- .get(`/api/v2/company/list?current=${pageNo}&size=${pageSize}&pid=${pid}&companyName=${companyName}`);
20
+ list(pageNo, pageSize, pid, companyName) {
21
+ return __awaiter(this, void 0, void 0, function* () {
22
+ var axios = yield this.context.ready;
23
+ return axios
24
+ .get(`/api/v2/company/list?current=${pageNo}&size=${pageSize}&pid=${pid}&companyName=${companyName}`);
25
+ });
15
26
  }
16
- async detail(id) {
17
- var axios = await this.context.ready;
18
- return axios.get(`/api/v2/company/get?id=${id}`);
27
+ detail(id) {
28
+ return __awaiter(this, void 0, void 0, function* () {
29
+ var axios = yield this.context.ready;
30
+ return axios.get(`/api/v2/company/get?id=${id}`);
31
+ });
19
32
  }
20
- async create(data) {
21
- var axios = await this.context.ready;
22
- return axios.post(`/api/v2/company/add`, data);
33
+ create(data) {
34
+ return __awaiter(this, void 0, void 0, function* () {
35
+ var axios = yield this.context.ready;
36
+ return axios.post(`/api/v2/company/add`, data);
37
+ });
23
38
  }
24
- async update(id, data) {
25
- var axios = await this.context.ready;
26
- data.id = id;
27
- return axios.post(`/api/v2/company/update`, data);
39
+ update(id, data) {
40
+ return __awaiter(this, void 0, void 0, function* () {
41
+ var axios = yield this.context.ready;
42
+ data.id = id;
43
+ return axios.post(`/api/v2/company/update`, data);
44
+ });
28
45
  }
29
- async delete(id) {
30
- var axios = await this.context.ready;
31
- return axios.get(`/api/v2/company/delete?id=${id}`);
46
+ delete(id) {
47
+ return __awaiter(this, void 0, void 0, function* () {
48
+ var axios = yield this.context.ready;
49
+ return axios.get(`/api/v2/company/delete?id=${id}`);
50
+ });
32
51
  }
33
52
  get data() {
34
53
  return {
35
- export: async (companyId, supplier, startDate, endDate) => {
36
- var axios = await this.context.ready;
54
+ export: (companyId, supplier, modelId, startDate, endDate) => __awaiter(this, void 0, void 0, function* () {
55
+ var axios = yield this.context.ready;
37
56
  return axios.getAndSave(`/api/v2/company/${companyId}/data/export`, {
38
57
  params: {
39
58
  supplier,
40
59
  startDate,
41
- endDate
60
+ endDate,
61
+ model: modelId,
42
62
  }
43
63
  });
44
- }
64
+ })
45
65
  };
46
66
  }
47
67
  get rank() {
48
68
  return {
49
- byRevenue: async () => {
50
- var axios = await this.context.ready;
69
+ byRevenue: () => __awaiter(this, void 0, void 0, function* () {
70
+ var axios = yield this.context.ready;
51
71
  return axios.get(`/api/v2/coremde-sale/company/revenue/rank/list`);
52
- },
53
- byProfit: async () => {
54
- var axios = await this.context.ready;
72
+ }),
73
+ byProfit: () => __awaiter(this, void 0, void 0, function* () {
74
+ var axios = yield this.context.ready;
55
75
  return axios.get(`/api/v2/coremde-sale/company/profit/rank/list`);
56
- },
57
- byOrder: async () => {
58
- var axios = await this.context.ready;
76
+ }),
77
+ byOrder: () => __awaiter(this, void 0, void 0, function* () {
78
+ var axios = yield this.context.ready;
59
79
  return axios.get(`/api/v2/coremde-sale/company/order/rank/list`);
60
- },
80
+ }),
61
81
  };
62
82
  }
63
- async attribute(key, companyId = undefined) {
64
- let axios = await this.context.ready;
65
- if (!companyId) {
66
- var selectedFarm = await this.context.user.getSelectedFarm();
67
- companyId = selectedFarm.id;
68
- }
69
- return axios.get(`/api/v2/company/${companyId}/attribute?key=${key}`);
83
+ attribute(key_1) {
84
+ return __awaiter(this, arguments, void 0, function* (key, companyId = undefined) {
85
+ let axios = yield this.context.ready;
86
+ if (!companyId) {
87
+ var selectedFarm = yield this.context.user.getSelectedFarm();
88
+ companyId = selectedFarm.id;
89
+ }
90
+ return axios.get(`/api/v2/company/${companyId}/attribute?key=${key}`);
91
+ });
70
92
  }
71
93
  get department() {
72
94
  return {
73
- list: async (pid) => {
74
- var axios = await this.context.ready;
95
+ list: (pid) => __awaiter(this, void 0, void 0, function* () {
96
+ var axios = yield this.context.ready;
75
97
  return axios.get(`/api/v3/enterprise/department/${pid}`);
76
- },
77
- detail: async (id) => {
78
- var axios = await this.context.ready;
98
+ }),
99
+ detail: (id) => __awaiter(this, void 0, void 0, function* () {
100
+ var axios = yield this.context.ready;
79
101
  return axios.get(`/api/v3/enterprise/department/${id}/detail`);
80
- },
81
- create: async (data) => {
82
- var axios = await this.context.ready;
102
+ }),
103
+ create: (data) => __awaiter(this, void 0, void 0, function* () {
104
+ var axios = yield this.context.ready;
83
105
  return axios.post(`/api/v3/enterprise/department`, data);
84
- },
85
- mark: async (factoryId, departmentId, kind) => {
86
- var axios = await this.context.ready;
106
+ }),
107
+ mark: (factoryId, departmentId, kind) => __awaiter(this, void 0, void 0, function* () {
108
+ var axios = yield this.context.ready;
87
109
  return axios.post(`/api/v3/enterprise/department/${factoryId}/mark`, { departmentId, kind });
88
- },
89
- users: async (id) => {
90
- var axios = await this.context.ready;
110
+ }),
111
+ users: (id) => __awaiter(this, void 0, void 0, function* () {
112
+ var axios = yield this.context.ready;
91
113
  return axios.get("/api/v2/factory/" + id + "/users");
92
- }
114
+ })
93
115
  };
94
116
  }
95
117
  get cost() {
96
118
  return {
97
- byMonth: async (companyId) => {
98
- var axios = await this.context.ready;
119
+ byMonth: (companyId) => __awaiter(this, void 0, void 0, function* () {
120
+ var axios = yield this.context.ready;
99
121
  return axios.get(`/api/v2/coremde-sale/company/cost/month/get?companyId=${companyId}`);
100
- },
101
- byYear: async (companyId) => {
102
- var axios = await this.context.ready;
122
+ }),
123
+ byYear: (companyId) => __awaiter(this, void 0, void 0, function* () {
124
+ var axios = yield this.context.ready;
103
125
  return axios.get(`/api/v2/coremde-sale/company/cost/year/get?companyId=${companyId}`);
104
- }
126
+ })
105
127
  };
106
128
  }
107
129
  get enterprise() {
108
130
  return {
109
- userCount: async () => {
110
- var axios = await this.context.ready;
131
+ userCount: () => __awaiter(this, void 0, void 0, function* () {
132
+ var axios = yield this.context.ready;
111
133
  return axios.get(`/api/v2/coremde-sale/company/enterprise/count/user`);
112
- },
113
- revenue: async () => {
114
- var axios = await this.context.ready;
134
+ }),
135
+ revenue: () => __awaiter(this, void 0, void 0, function* () {
136
+ var axios = yield this.context.ready;
115
137
  return axios.get(`/api/v2/coremde-sale/company/enterprise/revenue/get`);
116
- }
138
+ })
117
139
  };
118
140
  }
119
141
  get revenue() {
120
142
  return {
121
143
  //按类型统计
122
144
  groupSummary: {
123
- byMonth: async (companyId, pageNo = undefined, pageSize = undefined) => {
124
- var axios = await this.context.ready;
145
+ byMonth: (companyId_1, ...args_1) => __awaiter(this, [companyId_1, ...args_1], void 0, function* (companyId, pageNo = undefined, pageSize = undefined) {
146
+ var axios = yield this.context.ready;
125
147
  var params = {
126
148
  pageNo: pageNo,
127
149
  pageSize: pageSize,
@@ -130,9 +152,9 @@ class CompanyGateway extends Object {
130
152
  return axios.get(`/api/v2/coremde-sale/company/revenue/month/list`, {
131
153
  params: params
132
154
  });
133
- },
134
- byYear: async (companyId, pageNo = undefined, pageSize = undefined) => {
135
- var axios = await this.context.ready;
155
+ }),
156
+ byYear: (companyId_1, ...args_1) => __awaiter(this, [companyId_1, ...args_1], void 0, function* (companyId, pageNo = undefined, pageSize = undefined) {
157
+ var axios = yield this.context.ready;
136
158
  var params = {
137
159
  pageNo: pageNo,
138
160
  pageSize: pageSize,
@@ -141,25 +163,25 @@ class CompanyGateway extends Object {
141
163
  return axios.get(`/api/v2/coremde-sale/company/revenue/year/list`, {
142
164
  params: params
143
165
  });
144
- },
166
+ }),
145
167
  },
146
168
  //最新情况统计,最近一个月,最近十天,最近一天
147
169
  recentSummary: {
148
- byDay: async (companyId) => {
149
- var axios = await this.context.ready;
170
+ byDay: (companyId) => __awaiter(this, void 0, void 0, function* () {
171
+ var axios = yield this.context.ready;
150
172
  return axios.get(`/api/v2/coremde-sale/company/revenue/day/get?companyId=${companyId}`);
151
- },
152
- byDecade: async (companyId) => {
153
- var axios = await this.context.ready;
173
+ }),
174
+ byDecade: (companyId) => __awaiter(this, void 0, void 0, function* () {
175
+ var axios = yield this.context.ready;
154
176
  return axios.get(`/api/v2/coremde-sale/company/revenue/decade/get?companyId=${companyId}`);
155
- },
156
- byMonth: async (companyId) => {
157
- var axios = await this.context.ready;
177
+ }),
178
+ byMonth: (companyId) => __awaiter(this, void 0, void 0, function* () {
179
+ var axios = yield this.context.ready;
158
180
  return axios.get(`/api/v2/coremde-sale/company/revenue/month/get?companyId=${companyId}`);
159
- },
181
+ }),
160
182
  },
161
- list: async (companyId, pageNo = undefined, pageSize = undefined) => {
162
- var axios = await this.context.ready;
183
+ list: (companyId_1, ...args_1) => __awaiter(this, [companyId_1, ...args_1], void 0, function* (companyId, pageNo = undefined, pageSize = undefined) {
184
+ var axios = yield this.context.ready;
163
185
  var params = {
164
186
  pageNo: pageNo,
165
187
  pageSize: pageSize,
@@ -168,24 +190,28 @@ class CompanyGateway extends Object {
168
190
  return axios.get(`/api/v2/coremde-sale/company/revenue/list`, {
169
191
  params: params
170
192
  });
171
- },
172
- enterprise: async () => {
173
- var axios = await this.context.ready;
193
+ }),
194
+ enterprise: () => __awaiter(this, void 0, void 0, function* () {
195
+ var axios = yield this.context.ready;
174
196
  return axios.get(`/api/v2/coremde-sale/company/enterprise/revenue/get`);
175
- }
197
+ })
176
198
  };
177
199
  }
178
- async search(args) {
179
- var axios = await this.context.ready;
180
- return axios.post(`/api/v2/company/query`, args);
200
+ search(args) {
201
+ return __awaiter(this, void 0, void 0, function* () {
202
+ var axios = yield this.context.ready;
203
+ return axios.post(`/api/v2/company/query`, args);
204
+ });
181
205
  }
182
206
  //用于获得父节点的子节点列表,用于树形结构展示
183
- async treenode(pid) {
184
- var axios = await this.context.ready;
185
- if (pid == undefined) {
186
- return axios.get(`/api/tenant/groups`);
187
- }
188
- return axios.post(`/api/tenant/groups/${pid}/children`);
207
+ treenode(pid) {
208
+ return __awaiter(this, void 0, void 0, function* () {
209
+ var axios = yield this.context.ready;
210
+ if (pid == undefined) {
211
+ return axios.get(`/api/tenant/groups`);
212
+ }
213
+ return axios.post(`/api/tenant/groups/${pid}/children`);
214
+ });
189
215
  }
190
216
  }
191
217
  exports.CompanyGateway = CompanyGateway;