@cpzxrobot/sdk 1.1.31 → 1.1.33
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 +6 -0
- package/company_gateway.ts +30 -4
- package/contract_gateway.ts +0 -1
- package/customer_gateway.ts +8 -0
- package/dist/car_gateway.js +5 -0
- package/dist/company_gateway.js +30 -4
- package/dist/customer_gateway.js +5 -0
- package/dist/index.js +2 -0
- package/dist/news_gateway.js +22 -0
- package/dist/user_gateway.js +5 -0
- package/index.ts +2 -0
- package/news_gateway.ts +33 -0
- package/package.json +1 -1
- package/project_gateway.ts +2 -0
- package/readme.md +12 -2
- package/types.d.ts +1 -0
- package/user_gateway.ts +6 -0
package/car_gateway.ts
CHANGED
|
@@ -33,6 +33,12 @@ export class CarGateway extends Object {
|
|
|
33
33
|
});
|
|
34
34
|
}
|
|
35
35
|
|
|
36
|
+
listByCity(area_code: string) {
|
|
37
|
+
return this.context.ready.then((axios) => {
|
|
38
|
+
return axios.get(`/api/v2/coremde-sale/car/city/get?area_code=${area_code}`);
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
|
|
36
42
|
get stat() {
|
|
37
43
|
return {
|
|
38
44
|
china: () => {
|
package/company_gateway.ts
CHANGED
|
@@ -45,13 +45,39 @@ export class CompanyGateway extends Object {
|
|
|
45
45
|
|
|
46
46
|
get revenue() {
|
|
47
47
|
return {
|
|
48
|
-
|
|
48
|
+
//按类型统计
|
|
49
|
+
groupSummary: {
|
|
50
|
+
byMonth: async (companyId: number, pageNo: number, pageSize: number) => {
|
|
51
|
+
var axios = await this.context.ready;
|
|
52
|
+
return axios.get(`/api/v2/coremde-sale/company/revenue/month/list?pageNo=${pageNo}&pageSize=${pageSize}&companyId=${companyId}`);
|
|
53
|
+
},
|
|
54
|
+
byYear: async (companyId: number, pageNo: number, pageSize: number) => {
|
|
55
|
+
var axios = await this.context.ready;
|
|
56
|
+
return axios.get(`/api/v2/coremde-sale/company/revenue/year/list?pageNo=${pageNo}&pageSize=${pageSize}&companyId=${companyId}`);
|
|
57
|
+
},
|
|
58
|
+
},
|
|
59
|
+
//最新情况统计,最近一个月,最近十天,最近一天
|
|
60
|
+
recentSummary: {
|
|
61
|
+
byDay: async (companyId: number) => {
|
|
62
|
+
var axios = await this.context.ready;
|
|
63
|
+
return axios.get(`/api/v2/coremde-sale/company/revenue/day/get?companyId=${companyId}`);
|
|
64
|
+
},
|
|
65
|
+
byDecade: async (companyId: number) => {
|
|
66
|
+
var axios = await this.context.ready;
|
|
67
|
+
return axios.get(`/api/v2/coremde-sale/company/revenue/decade/get?companyId=${companyId}`);
|
|
68
|
+
},
|
|
69
|
+
byMonth: async (companyId: number) => {
|
|
70
|
+
var axios = await this.context.ready;
|
|
71
|
+
return axios.get(`/api/v2/coremde-sale/company/revenue/month/get?companyId=${companyId}`);
|
|
72
|
+
},
|
|
73
|
+
},
|
|
74
|
+
list: async (companyId: number, pageNo: number, pageSize: number) => {
|
|
49
75
|
var axios = await this.context.ready;
|
|
50
|
-
return axios.get(`/api/v2/coremde-sale/company/revenue/
|
|
76
|
+
return axios.get(`/api/v2/coremde-sale/company/revenue/list?pageNo=${pageNo}&pageSize=${pageSize}`);
|
|
51
77
|
},
|
|
52
|
-
|
|
78
|
+
enterprise: async () => {
|
|
53
79
|
var axios = await this.context.ready;
|
|
54
|
-
return axios.get(`/api/v2/coremde-sale/company/revenue/
|
|
80
|
+
return axios.get(`/api/v2/coremde-sale/company/enterprise/revenue/get`);
|
|
55
81
|
}
|
|
56
82
|
}
|
|
57
83
|
}
|
package/contract_gateway.ts
CHANGED
package/customer_gateway.ts
CHANGED
|
@@ -43,6 +43,14 @@ export class CustomerGateway extends Object {
|
|
|
43
43
|
});
|
|
44
44
|
}
|
|
45
45
|
|
|
46
|
+
accountMagager(customerId: number) {
|
|
47
|
+
return this.context.ready.then((axios) => {
|
|
48
|
+
return axios.get(
|
|
49
|
+
`/api/v2/coremde-sale/customer/account-magager?customerId=${customerId}`,
|
|
50
|
+
);
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
|
|
46
54
|
get visit() {
|
|
47
55
|
return {
|
|
48
56
|
add: (args: any) => {
|
package/dist/car_gateway.js
CHANGED
|
@@ -28,6 +28,11 @@ class CarGateway extends Object {
|
|
|
28
28
|
return axios.get(`/api/v2/coremde-sale/car/province/get?area_code=${area_code}`);
|
|
29
29
|
});
|
|
30
30
|
}
|
|
31
|
+
listByCity(area_code) {
|
|
32
|
+
return this.context.ready.then((axios) => {
|
|
33
|
+
return axios.get(`/api/v2/coremde-sale/car/city/get?area_code=${area_code}`);
|
|
34
|
+
});
|
|
35
|
+
}
|
|
31
36
|
get stat() {
|
|
32
37
|
return {
|
|
33
38
|
china: () => {
|
package/dist/company_gateway.js
CHANGED
|
@@ -41,13 +41,39 @@ class CompanyGateway extends Object {
|
|
|
41
41
|
}
|
|
42
42
|
get revenue() {
|
|
43
43
|
return {
|
|
44
|
-
|
|
44
|
+
//按类型统计
|
|
45
|
+
groupSummary: {
|
|
46
|
+
byMonth: async (companyId, pageNo, pageSize) => {
|
|
47
|
+
var axios = await this.context.ready;
|
|
48
|
+
return axios.get(`/api/v2/coremde-sale/company/revenue/month/list?pageNo=${pageNo}&pageSize=${pageSize}&companyId=${companyId}`);
|
|
49
|
+
},
|
|
50
|
+
byYear: async (companyId, pageNo, pageSize) => {
|
|
51
|
+
var axios = await this.context.ready;
|
|
52
|
+
return axios.get(`/api/v2/coremde-sale/company/revenue/year/list?pageNo=${pageNo}&pageSize=${pageSize}&companyId=${companyId}`);
|
|
53
|
+
},
|
|
54
|
+
},
|
|
55
|
+
//最新情况统计,最近一个月,最近十天,最近一天
|
|
56
|
+
recentSummary: {
|
|
57
|
+
byDay: async (companyId) => {
|
|
58
|
+
var axios = await this.context.ready;
|
|
59
|
+
return axios.get(`/api/v2/coremde-sale/company/revenue/day/get?companyId=${companyId}`);
|
|
60
|
+
},
|
|
61
|
+
byDecade: async (companyId) => {
|
|
62
|
+
var axios = await this.context.ready;
|
|
63
|
+
return axios.get(`/api/v2/coremde-sale/company/revenue/decade/get?companyId=${companyId}`);
|
|
64
|
+
},
|
|
65
|
+
byMonth: async (companyId) => {
|
|
66
|
+
var axios = await this.context.ready;
|
|
67
|
+
return axios.get(`/api/v2/coremde-sale/company/revenue/month/get?companyId=${companyId}`);
|
|
68
|
+
},
|
|
69
|
+
},
|
|
70
|
+
list: async (companyId, pageNo, pageSize) => {
|
|
45
71
|
var axios = await this.context.ready;
|
|
46
|
-
return axios.get(`/api/v2/coremde-sale/company/revenue/
|
|
72
|
+
return axios.get(`/api/v2/coremde-sale/company/revenue/list?pageNo=${pageNo}&pageSize=${pageSize}`);
|
|
47
73
|
},
|
|
48
|
-
|
|
74
|
+
enterprise: async () => {
|
|
49
75
|
var axios = await this.context.ready;
|
|
50
|
-
return axios.get(`/api/v2/coremde-sale/company/revenue/
|
|
76
|
+
return axios.get(`/api/v2/coremde-sale/company/enterprise/revenue/get`);
|
|
51
77
|
}
|
|
52
78
|
};
|
|
53
79
|
}
|
package/dist/customer_gateway.js
CHANGED
|
@@ -31,6 +31,11 @@ class CustomerGateway extends Object {
|
|
|
31
31
|
return axios.post(`/api/v2/coremde-sale/customer/update`, args);
|
|
32
32
|
});
|
|
33
33
|
}
|
|
34
|
+
accountMagager(customerId) {
|
|
35
|
+
return this.context.ready.then((axios) => {
|
|
36
|
+
return axios.get(`/api/v2/coremde-sale/customer/account-magager?customerId=${customerId}`);
|
|
37
|
+
});
|
|
38
|
+
}
|
|
34
39
|
get visit() {
|
|
35
40
|
return {
|
|
36
41
|
add: (args) => {
|
package/dist/index.js
CHANGED
|
@@ -22,6 +22,7 @@ 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
24
|
const company_gateway_1 = require("./company_gateway");
|
|
25
|
+
const news_gateway_1 = require("./news_gateway");
|
|
25
26
|
class Cpzxrobot {
|
|
26
27
|
constructor(appCode) {
|
|
27
28
|
this.pigfarm = new pigfarm_gateway_1.PigfarmGateway(this);
|
|
@@ -36,6 +37,7 @@ class Cpzxrobot {
|
|
|
36
37
|
this.contract = new contract_gateway_1.ContractGateway(this);
|
|
37
38
|
this.customer = new customer_gateway_1.CustomerGateway(this);
|
|
38
39
|
this.company = new company_gateway_1.CompanyGateway(this);
|
|
40
|
+
this.news = new news_gateway_1.NewsGateway(this);
|
|
39
41
|
//获取当前浏览器的域名
|
|
40
42
|
this.ready = new Promise((resolve, reject) => {
|
|
41
43
|
this.resolveReady = resolve;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.NewsGateway = void 0;
|
|
4
|
+
class NewsGateway extends Object {
|
|
5
|
+
constructor(context) {
|
|
6
|
+
super();
|
|
7
|
+
this.context = context;
|
|
8
|
+
}
|
|
9
|
+
list(args) {
|
|
10
|
+
return this.context.ready.then(axios => {
|
|
11
|
+
return axios.get("/api/v2/coremde-sale/news/list", {
|
|
12
|
+
params: args,
|
|
13
|
+
});
|
|
14
|
+
});
|
|
15
|
+
}
|
|
16
|
+
add(args) {
|
|
17
|
+
return this.context.ready.then(axios => {
|
|
18
|
+
return axios.post("/api/v2/coremde-sale/news/add", args);
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
exports.NewsGateway = NewsGateway;
|
package/dist/user_gateway.js
CHANGED
|
@@ -112,6 +112,11 @@ class UserGateway extends Object {
|
|
|
112
112
|
return axios.get(`/api/v2/coremde-sale/user/province/get?area_code=${area_code}`);
|
|
113
113
|
});
|
|
114
114
|
}
|
|
115
|
+
listByCity(area_code) {
|
|
116
|
+
return this.context.ready.then((axios) => {
|
|
117
|
+
return axios.get(`/api/v2/coremde-sale/user/city/get?area_code=${area_code}`);
|
|
118
|
+
});
|
|
119
|
+
}
|
|
115
120
|
async mypermission() {
|
|
116
121
|
var axios = await this.context.ready;
|
|
117
122
|
return axios.get("/api/v2/user/role/mypermission");
|
package/index.ts
CHANGED
|
@@ -17,6 +17,7 @@ import { ProductGateway } from "./product_gateway";
|
|
|
17
17
|
import { ContractGateway } from "./contract_gateway";
|
|
18
18
|
import { CustomerGateway } from "./customer_gateway";
|
|
19
19
|
import { CompanyGateway } from "./company_gateway";
|
|
20
|
+
import { NewsGateway } from "./news_gateway";
|
|
20
21
|
|
|
21
22
|
export class Cpzxrobot {
|
|
22
23
|
device: DeviceGateway;
|
|
@@ -55,6 +56,7 @@ export class Cpzxrobot {
|
|
|
55
56
|
contract: ContractGateway = new ContractGateway(this);
|
|
56
57
|
customer: CustomerGateway = new CustomerGateway(this);
|
|
57
58
|
company: CompanyGateway = new CompanyGateway(this);
|
|
59
|
+
news: NewsGateway = new NewsGateway(this);
|
|
58
60
|
|
|
59
61
|
constructor(appCode: string) {
|
|
60
62
|
//获取当前浏览器的域名
|
package/news_gateway.ts
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { Cpzxrobot, Factory, Unit } from "./types";
|
|
2
|
+
|
|
3
|
+
export class NewsGateway extends Object {
|
|
4
|
+
context: Cpzxrobot;
|
|
5
|
+
|
|
6
|
+
constructor(context: Cpzxrobot) {
|
|
7
|
+
super();
|
|
8
|
+
this.context = context;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
list(args: {
|
|
12
|
+
pageSize?: number;
|
|
13
|
+
pageNo?: number;
|
|
14
|
+
type: string;
|
|
15
|
+
}) {
|
|
16
|
+
return this.context.ready.then(axios => {
|
|
17
|
+
return axios.get("/api/v2/coremde-sale/news/list", {
|
|
18
|
+
params: args,
|
|
19
|
+
});
|
|
20
|
+
})
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
add(args: {
|
|
24
|
+
title: string;
|
|
25
|
+
content: string;
|
|
26
|
+
type: string;
|
|
27
|
+
}) {
|
|
28
|
+
return this.context.ready.then(axios => {
|
|
29
|
+
return axios.post("/api/v2/coremde-sale/news/add", args);
|
|
30
|
+
});
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
}
|
package/package.json
CHANGED
package/project_gateway.ts
CHANGED
package/readme.md
CHANGED
|
@@ -151,6 +151,7 @@ baseURL: "/"
|
|
|
151
151
|
| cpzxrobot().user.searchHistory.add | 添加用户搜索历史记录,传入type参数和搜索内容 |
|
|
152
152
|
| cpzxrobot().user.stat.china | 获得员工在全国的统计信息 |
|
|
153
153
|
| cpzxrobot().user.listByProvince | 获得员工在某个省的统计信息,传入province参数 |
|
|
154
|
+
| cpzxrobot().user.listByCity | 获得员工在某个市的统计信息,传入city参数 |
|
|
154
155
|
| cpzxrobot().product.list | 获得产品列表,传入factory_id和必要的分页参数 |
|
|
155
156
|
| cpzxrobot().product.get | 获得产品信息,传入id参数 |
|
|
156
157
|
| cpzxrobot().product.price.list | 获得产品报价列表 |
|
|
@@ -179,16 +180,25 @@ baseURL: "/"
|
|
|
179
180
|
| cpzxrobot().customer.visit.add | 添加客户拜访记录 |
|
|
180
181
|
| cpzxrobot().customer.stat.china | 获得客户在全国的统计信息 |
|
|
181
182
|
| cpzxrobot().customer.listByProvince | 获得客户在某个省的统计信息,传入province参数 |
|
|
183
|
+
| cpzxrobot().customer.accountManager | 获得客户对应的销售员 |
|
|
182
184
|
| cpzxrobot().company.list | 获得公司列表,传入必要的分页参数 |
|
|
183
185
|
| cpzxrobot().company.rank.byRevenue | 按公司营收获取排名,传入必要的分页参数 |
|
|
184
186
|
| cpzxrobot().company.rank.byProfit | 按公司利润获取排名,传入必要的分页参数 |
|
|
185
187
|
| cpzxrobot().company.rank.byOrder | 按公司订单获取排名,传入必要的分页参数 |
|
|
186
188
|
| cpzxrobot().company.cost.byMonth | 按公司按月成本 |
|
|
187
189
|
| cpzxrobot().company.cost.byYear | 按公司按年成本 |
|
|
188
|
-
| cpzxrobot().company.revenue.byMonth |
|
|
189
|
-
| cpzxrobot().company.revenue.byYear |
|
|
190
|
+
| cpzxrobot().company.revenue.groupSummary.byMonth | 按公司按类别按月营收统计 |
|
|
191
|
+
| cpzxrobot().company.revenue.groupSummary.byYear | 按公司按类别按年营收统计 |
|
|
192
|
+
| cpzxrobot().company.revenue.recentSumary.byMonth | 按公司当月营收统计 |
|
|
193
|
+
| cpzxrobot().company.revenue.recentSumary.byDay | 按公司当日营收统计 |
|
|
194
|
+
| cpzxrobot().company.revenue.recentSumary.byDecade | 按公司按旬营收统计 |
|
|
195
|
+
| cpzxrobot().company.revenue.list | 获得公司营收列表,传入必要的分页参数 |
|
|
196
|
+
| cpzxrobot().company.revenue.enterprise | 获得集团整体营收统计 |
|
|
190
197
|
| cpzxrobot().car.stat.china | 获得车辆在全国的统计信息 |
|
|
191
198
|
| cpzxrobot().car.listByProvince | 获得车辆在某个省的统计信息,传入province参数 |
|
|
199
|
+
| cpzxrobot().car.listByCity | 获得车辆在某个市的统计信息,传入city参数 |
|
|
200
|
+
| cpzxrobot().news.add | 添加新闻 |
|
|
201
|
+
| cpzxrobot().news.list | 获得新闻列表,传入必要的分页参数 |
|
|
192
202
|
|
|
193
203
|
### 工厂信息接口
|
|
194
204
|
|
package/types.d.ts
CHANGED
package/user_gateway.ts
CHANGED
|
@@ -123,6 +123,12 @@ export class UserGateway extends Object {
|
|
|
123
123
|
});
|
|
124
124
|
}
|
|
125
125
|
|
|
126
|
+
listByCity(area_code: string) {
|
|
127
|
+
return this.context.ready.then((axios) => {
|
|
128
|
+
return axios.get(`/api/v2/coremde-sale/user/city/get?area_code=${area_code}`);
|
|
129
|
+
});
|
|
130
|
+
}
|
|
131
|
+
|
|
126
132
|
async mypermission() {
|
|
127
133
|
var axios = await this.context.ready;
|
|
128
134
|
return axios.get("/api/v2/user/role/mypermission");
|