@cpzxrobot/sdk 1.3.68 → 1.3.70

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,106 +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
+ });
51
+ }
52
+ get data() {
53
+ return {
54
+ export: (companyId, supplier, modelId, startDate, endDate) => __awaiter(this, void 0, void 0, function* () {
55
+ var axios = yield this.context.ready;
56
+ return axios.getAndSave(`/api/v2/company/${companyId}/data/export`, {
57
+ params: {
58
+ supplier,
59
+ startDate,
60
+ endDate,
61
+ model: modelId,
62
+ }
63
+ });
64
+ })
65
+ };
32
66
  }
33
67
  get rank() {
34
68
  return {
35
- byRevenue: async () => {
36
- var axios = await this.context.ready;
69
+ byRevenue: () => __awaiter(this, void 0, void 0, function* () {
70
+ var axios = yield this.context.ready;
37
71
  return axios.get(`/api/v2/coremde-sale/company/revenue/rank/list`);
38
- },
39
- byProfit: async () => {
40
- var axios = await this.context.ready;
72
+ }),
73
+ byProfit: () => __awaiter(this, void 0, void 0, function* () {
74
+ var axios = yield this.context.ready;
41
75
  return axios.get(`/api/v2/coremde-sale/company/profit/rank/list`);
42
- },
43
- byOrder: async () => {
44
- var axios = await this.context.ready;
76
+ }),
77
+ byOrder: () => __awaiter(this, void 0, void 0, function* () {
78
+ var axios = yield this.context.ready;
45
79
  return axios.get(`/api/v2/coremde-sale/company/order/rank/list`);
46
- },
80
+ }),
47
81
  };
48
82
  }
49
- async attribute(key, companyId = undefined) {
50
- let axios = await this.context.ready;
51
- if (!companyId) {
52
- var selectedFarm = await this.context.user.getSelectedFarm();
53
- companyId = selectedFarm.id;
54
- }
55
- 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
+ });
56
92
  }
57
93
  get department() {
58
94
  return {
59
- list: async (pid) => {
60
- var axios = await this.context.ready;
95
+ list: (pid) => __awaiter(this, void 0, void 0, function* () {
96
+ var axios = yield this.context.ready;
61
97
  return axios.get(`/api/v3/enterprise/department/${pid}`);
62
- },
63
- detail: async (id) => {
64
- var axios = await this.context.ready;
98
+ }),
99
+ detail: (id) => __awaiter(this, void 0, void 0, function* () {
100
+ var axios = yield this.context.ready;
65
101
  return axios.get(`/api/v3/enterprise/department/${id}/detail`);
66
- },
67
- create: async (data) => {
68
- var axios = await this.context.ready;
102
+ }),
103
+ create: (data) => __awaiter(this, void 0, void 0, function* () {
104
+ var axios = yield this.context.ready;
69
105
  return axios.post(`/api/v3/enterprise/department`, data);
70
- },
71
- mark: async (factoryId, departmentId, kind) => {
72
- 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;
73
109
  return axios.post(`/api/v3/enterprise/department/${factoryId}/mark`, { departmentId, kind });
74
- },
75
- users: async (id) => {
76
- var axios = await this.context.ready;
110
+ }),
111
+ users: (id) => __awaiter(this, void 0, void 0, function* () {
112
+ var axios = yield this.context.ready;
77
113
  return axios.get("/api/v2/factory/" + id + "/users");
78
- }
114
+ })
79
115
  };
80
116
  }
81
117
  get cost() {
82
118
  return {
83
- byMonth: async (companyId) => {
84
- var axios = await this.context.ready;
119
+ byMonth: (companyId) => __awaiter(this, void 0, void 0, function* () {
120
+ var axios = yield this.context.ready;
85
121
  return axios.get(`/api/v2/coremde-sale/company/cost/month/get?companyId=${companyId}`);
86
- },
87
- byYear: async (companyId) => {
88
- var axios = await this.context.ready;
122
+ }),
123
+ byYear: (companyId) => __awaiter(this, void 0, void 0, function* () {
124
+ var axios = yield this.context.ready;
89
125
  return axios.get(`/api/v2/coremde-sale/company/cost/year/get?companyId=${companyId}`);
90
- }
126
+ })
91
127
  };
92
128
  }
93
129
  get enterprise() {
94
130
  return {
95
- userCount: async () => {
96
- var axios = await this.context.ready;
131
+ userCount: () => __awaiter(this, void 0, void 0, function* () {
132
+ var axios = yield this.context.ready;
97
133
  return axios.get(`/api/v2/coremde-sale/company/enterprise/count/user`);
98
- },
99
- revenue: async () => {
100
- var axios = await this.context.ready;
134
+ }),
135
+ revenue: () => __awaiter(this, void 0, void 0, function* () {
136
+ var axios = yield this.context.ready;
101
137
  return axios.get(`/api/v2/coremde-sale/company/enterprise/revenue/get`);
102
- }
138
+ })
103
139
  };
104
140
  }
105
141
  get revenue() {
106
142
  return {
107
143
  //按类型统计
108
144
  groupSummary: {
109
- byMonth: async (companyId, pageNo = undefined, pageSize = undefined) => {
110
- 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;
111
147
  var params = {
112
148
  pageNo: pageNo,
113
149
  pageSize: pageSize,
@@ -116,9 +152,9 @@ class CompanyGateway extends Object {
116
152
  return axios.get(`/api/v2/coremde-sale/company/revenue/month/list`, {
117
153
  params: params
118
154
  });
119
- },
120
- byYear: async (companyId, pageNo = undefined, pageSize = undefined) => {
121
- 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;
122
158
  var params = {
123
159
  pageNo: pageNo,
124
160
  pageSize: pageSize,
@@ -127,25 +163,25 @@ class CompanyGateway extends Object {
127
163
  return axios.get(`/api/v2/coremde-sale/company/revenue/year/list`, {
128
164
  params: params
129
165
  });
130
- },
166
+ }),
131
167
  },
132
168
  //最新情况统计,最近一个月,最近十天,最近一天
133
169
  recentSummary: {
134
- byDay: async (companyId) => {
135
- var axios = await this.context.ready;
170
+ byDay: (companyId) => __awaiter(this, void 0, void 0, function* () {
171
+ var axios = yield this.context.ready;
136
172
  return axios.get(`/api/v2/coremde-sale/company/revenue/day/get?companyId=${companyId}`);
137
- },
138
- byDecade: async (companyId) => {
139
- var axios = await this.context.ready;
173
+ }),
174
+ byDecade: (companyId) => __awaiter(this, void 0, void 0, function* () {
175
+ var axios = yield this.context.ready;
140
176
  return axios.get(`/api/v2/coremde-sale/company/revenue/decade/get?companyId=${companyId}`);
141
- },
142
- byMonth: async (companyId) => {
143
- var axios = await this.context.ready;
177
+ }),
178
+ byMonth: (companyId) => __awaiter(this, void 0, void 0, function* () {
179
+ var axios = yield this.context.ready;
144
180
  return axios.get(`/api/v2/coremde-sale/company/revenue/month/get?companyId=${companyId}`);
145
- },
181
+ }),
146
182
  },
147
- list: async (companyId, pageNo = undefined, pageSize = undefined) => {
148
- 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;
149
185
  var params = {
150
186
  pageNo: pageNo,
151
187
  pageSize: pageSize,
@@ -154,24 +190,28 @@ class CompanyGateway extends Object {
154
190
  return axios.get(`/api/v2/coremde-sale/company/revenue/list`, {
155
191
  params: params
156
192
  });
157
- },
158
- enterprise: async () => {
159
- var axios = await this.context.ready;
193
+ }),
194
+ enterprise: () => __awaiter(this, void 0, void 0, function* () {
195
+ var axios = yield this.context.ready;
160
196
  return axios.get(`/api/v2/coremde-sale/company/enterprise/revenue/get`);
161
- }
197
+ })
162
198
  };
163
199
  }
164
- async search(args) {
165
- var axios = await this.context.ready;
166
- 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
+ });
167
205
  }
168
206
  //用于获得父节点的子节点列表,用于树形结构展示
169
- async treenode(pid) {
170
- var axios = await this.context.ready;
171
- if (pid == undefined) {
172
- return axios.get(`/api/tenant/groups`);
173
- }
174
- 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
+ });
175
215
  }
176
216
  }
177
217
  exports.CompanyGateway = CompanyGateway;