@cpzxrobot/sdk 1.1.86 → 1.1.87
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 +9 -0
- package/dist/car_gateway.js +8 -0
- package/dist/transport_gateway.js +14 -2
- package/package.json +1 -1
- package/readme.md +3 -0
- package/transport_gateway.ts +20 -8
package/car_gateway.ts
CHANGED
|
@@ -21,12 +21,21 @@ export class CarGateway extends Object {
|
|
|
21
21
|
.then((res) => res.data);
|
|
22
22
|
}
|
|
23
23
|
|
|
24
|
+
//根据工厂pid获取订单列表,注意,该接口和
|
|
24
25
|
async orders(factory: Factory, date: Date) {
|
|
25
26
|
var axios = await this.context.ready;
|
|
26
27
|
return axios
|
|
27
28
|
.get(`/api/v2/car/${factory.pid}/orders?date=` + date.toISOString())
|
|
28
29
|
}
|
|
29
30
|
|
|
31
|
+
async ordersByFactory(factory: Factory, date: Date) {
|
|
32
|
+
var axios = await this.context.ready;
|
|
33
|
+
//filter=未分配的
|
|
34
|
+
return axios
|
|
35
|
+
.get(`/api/v2/car/${factory.id}/order?date=` + date.toISOString()+"&filter=unallocated")
|
|
36
|
+
.then((res) => res.data);
|
|
37
|
+
}
|
|
38
|
+
|
|
30
39
|
listByProvince(area_code: string) {
|
|
31
40
|
return this.context.ready.then((axios) => {
|
|
32
41
|
return axios.get(`/api/v2/coremde-sale/car/province/get?area_code=${area_code}`);
|
package/dist/car_gateway.js
CHANGED
|
@@ -18,11 +18,19 @@ class CarGateway extends Object {
|
|
|
18
18
|
.get(`/api/v2/car/${factory.pid}/detections?date=` + date.toISOString())
|
|
19
19
|
.then((res) => res.data);
|
|
20
20
|
}
|
|
21
|
+
//根据工厂pid获取订单列表,注意,该接口和
|
|
21
22
|
async orders(factory, date) {
|
|
22
23
|
var axios = await this.context.ready;
|
|
23
24
|
return axios
|
|
24
25
|
.get(`/api/v2/car/${factory.pid}/orders?date=` + date.toISOString());
|
|
25
26
|
}
|
|
27
|
+
async ordersByFactory(factory, date) {
|
|
28
|
+
var axios = await this.context.ready;
|
|
29
|
+
//filter=未分配的
|
|
30
|
+
return axios
|
|
31
|
+
.get(`/api/v2/car/${factory.id}/order?date=` + date.toISOString() + "&filter=unallocated")
|
|
32
|
+
.then((res) => res.data);
|
|
33
|
+
}
|
|
26
34
|
listByProvince(area_code) {
|
|
27
35
|
return this.context.ready.then((axios) => {
|
|
28
36
|
return axios.get(`/api/v2/coremde-sale/car/province/get?area_code=${area_code}`);
|
|
@@ -67,12 +67,24 @@ class TransportGateway extends Object {
|
|
|
67
67
|
create: (data) => {
|
|
68
68
|
return this.context.ready.then(() => {
|
|
69
69
|
return this.context.axios
|
|
70
|
-
.post("/api/
|
|
70
|
+
.post("/api/v2/pigfarm/feedTower/fodder/save", data)
|
|
71
71
|
.then((res) => {
|
|
72
72
|
if (res.data.code != 200) {
|
|
73
73
|
throw res.data.message;
|
|
74
74
|
}
|
|
75
|
-
return res.data
|
|
75
|
+
return res.data;
|
|
76
|
+
});
|
|
77
|
+
});
|
|
78
|
+
},
|
|
79
|
+
addImage: () => {
|
|
80
|
+
return this.context.ready.then(() => {
|
|
81
|
+
return this.context.axios
|
|
82
|
+
.upload("/api/v2/pigfarm/feedTower/fodder/photo/add")
|
|
83
|
+
.then((res) => {
|
|
84
|
+
if (res.data.code != 200) {
|
|
85
|
+
throw res.data.message;
|
|
86
|
+
}
|
|
87
|
+
return res.data;
|
|
76
88
|
});
|
|
77
89
|
});
|
|
78
90
|
},
|
package/package.json
CHANGED
package/readme.md
CHANGED
|
@@ -232,6 +232,9 @@ baseURL: "/"
|
|
|
232
232
|
| cpzxrobot().car.stat.china | 获得车辆在全国的统计信息 |
|
|
233
233
|
| cpzxrobot().car.listByProvince | 获得车辆在某个省的统计信息,传入province参数 |
|
|
234
234
|
| cpzxrobot().car.listByCity | 获得车辆在某个市的统计信息,传入city参数 |
|
|
235
|
+
| cpzxrobot().car.listByDistrict | 获得车辆在某个区域的统计信息,传入district参数 |
|
|
236
|
+
| cpzxrobot().car.orders | 获得车辆运单列表,传入工厂(按工厂上级返回) |
|
|
237
|
+
| cpzxrobot().car.ordersByFactory | 获得车辆运单列表,传入工厂,按工厂id返回 ,只返回未分配的运单 |
|
|
235
238
|
| cpzxrobot().news.add | 添加新闻 |
|
|
236
239
|
| cpzxrobot().news.list | 获得新闻列表,传入必要的分页参数 |
|
|
237
240
|
| cpzxrobot().news.alarm.add | 添加报警信息 |
|
package/transport_gateway.ts
CHANGED
|
@@ -21,12 +21,12 @@ export class TransportGateway extends Object {
|
|
|
21
21
|
unitId: number | undefined;
|
|
22
22
|
factoryId: number | undefined;
|
|
23
23
|
} = {
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
24
|
+
current: 1,
|
|
25
|
+
pageSize: 10,
|
|
26
|
+
deviceId: id,
|
|
27
|
+
unitId: undefined,
|
|
28
|
+
factoryId: undefined,
|
|
29
|
+
}
|
|
30
30
|
): Promise<FodderOrder[]> => {
|
|
31
31
|
return this.context.ready.then(() => {
|
|
32
32
|
return this.context.axios
|
|
@@ -78,12 +78,24 @@ export class TransportGateway extends Object {
|
|
|
78
78
|
create: (data: FodderOrder) => {
|
|
79
79
|
return this.context.ready.then(() => {
|
|
80
80
|
return this.context.axios
|
|
81
|
-
.post("/api/
|
|
81
|
+
.post("/api/v2/pigfarm/feedTower/fodder/save", data)
|
|
82
82
|
.then((res) => {
|
|
83
83
|
if (res.data.code != 200) {
|
|
84
84
|
throw res.data.message;
|
|
85
85
|
}
|
|
86
|
-
return res.data
|
|
86
|
+
return res.data;
|
|
87
|
+
});
|
|
88
|
+
});
|
|
89
|
+
},
|
|
90
|
+
addImage: () => {
|
|
91
|
+
return this.context.ready.then(() => {
|
|
92
|
+
return this.context.axios
|
|
93
|
+
.upload("/api/v2/pigfarm/feedTower/fodder/photo/add")
|
|
94
|
+
.then((res) => {
|
|
95
|
+
if (res.data.code != 200) {
|
|
96
|
+
throw res.data.message;
|
|
97
|
+
}
|
|
98
|
+
return res.data;
|
|
87
99
|
});
|
|
88
100
|
});
|
|
89
101
|
},
|