@cpzxrobot/sdk 1.0.23 → 1.0.24
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/dist/pigfarm_gateway.js +4 -6
- package/dist/transport_gateway.js +5 -1
- package/package.json +1 -1
- package/pigfarm_gateway.ts +10 -25
- package/transport_gateway.ts +5 -1
package/dist/pigfarm_gateway.js
CHANGED
|
@@ -22,7 +22,7 @@ class PigfarmGateway extends Object {
|
|
|
22
22
|
dailyReportForUnit(unit, type) {
|
|
23
23
|
return this.context.ready.then((axios) => {
|
|
24
24
|
return axios.post(`/api/v1/pigfarm/today/${unit.id}`, {
|
|
25
|
-
type
|
|
25
|
+
type,
|
|
26
26
|
});
|
|
27
27
|
});
|
|
28
28
|
}
|
|
@@ -31,7 +31,7 @@ class PigfarmGateway extends Object {
|
|
|
31
31
|
return this.context.ready.then((axios) => {
|
|
32
32
|
return axios.post(`/api/v1/pigfarm/statistics/${unit.id}`, {
|
|
33
33
|
time: time,
|
|
34
|
-
type: type
|
|
34
|
+
type: type,
|
|
35
35
|
});
|
|
36
36
|
});
|
|
37
37
|
}
|
|
@@ -39,10 +39,8 @@ class PigfarmGateway extends Object {
|
|
|
39
39
|
peakValleyForUnit(unit, start, end) {
|
|
40
40
|
return this.context.ready.then((axios) => {
|
|
41
41
|
return axios.post(`/api/v1/pigfarm/electric/${unit.id}`, {
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
end: end
|
|
45
|
-
}
|
|
42
|
+
start: start,
|
|
43
|
+
end: end,
|
|
46
44
|
});
|
|
47
45
|
});
|
|
48
46
|
}
|
|
@@ -28,7 +28,11 @@ class TransportGateway extends Object {
|
|
|
28
28
|
});
|
|
29
29
|
});
|
|
30
30
|
},
|
|
31
|
-
|
|
31
|
+
//获取打料详情
|
|
32
|
+
get inputs() {
|
|
33
|
+
return this.getDetail;
|
|
34
|
+
},
|
|
35
|
+
//获取设备打料数据 deperecated
|
|
32
36
|
getDetail: (ids, date) => {
|
|
33
37
|
return this.context.ready.then(() => {
|
|
34
38
|
return this.context.axios
|
package/package.json
CHANGED
package/pigfarm_gateway.ts
CHANGED
|
@@ -21,16 +21,10 @@ export class PigfarmGateway extends Object {
|
|
|
21
21
|
}
|
|
22
22
|
|
|
23
23
|
//获得当日统计
|
|
24
|
-
dailyReportForUnit(
|
|
25
|
-
unit: Unit,
|
|
26
|
-
type:
|
|
27
|
-
| "feed"
|
|
28
|
-
| "water"
|
|
29
|
-
| "electric"
|
|
30
|
-
) {
|
|
24
|
+
dailyReportForUnit(unit: Unit, type: "feed" | "water" | "electric") {
|
|
31
25
|
return this.context.ready.then((axios) => {
|
|
32
|
-
return axios.post(`/api/v1/pigfarm/today/${unit.id}`,{
|
|
33
|
-
type
|
|
26
|
+
return axios.post(`/api/v1/pigfarm/today/${unit.id}`, {
|
|
27
|
+
type,
|
|
34
28
|
});
|
|
35
29
|
});
|
|
36
30
|
}
|
|
@@ -39,31 +33,22 @@ export class PigfarmGateway extends Object {
|
|
|
39
33
|
periodReportForUnit(
|
|
40
34
|
unit: Unit,
|
|
41
35
|
time: "week" | "month" | "season",
|
|
42
|
-
type:
|
|
43
|
-
| "feed"
|
|
44
|
-
| "water"
|
|
45
|
-
| "electric"
|
|
36
|
+
type: "feed" | "water" | "electric"
|
|
46
37
|
) {
|
|
47
38
|
return this.context.ready.then((axios) => {
|
|
48
|
-
return axios.post(`/api/v1/pigfarm/statistics/${unit.id}`,{
|
|
39
|
+
return axios.post(`/api/v1/pigfarm/statistics/${unit.id}`, {
|
|
49
40
|
time: time,
|
|
50
|
-
type: type
|
|
41
|
+
type: type,
|
|
51
42
|
});
|
|
52
43
|
});
|
|
53
44
|
}
|
|
54
45
|
|
|
55
46
|
//获得周期时间内的峰谷平能耗统计
|
|
56
|
-
peakValleyForUnit(
|
|
57
|
-
unit: Unit,
|
|
58
|
-
start: string,
|
|
59
|
-
end: string
|
|
60
|
-
) {
|
|
47
|
+
peakValleyForUnit(unit: Unit, start: string, end: string) {
|
|
61
48
|
return this.context.ready.then((axios) => {
|
|
62
|
-
return axios.post(`/api/v1/pigfarm/electric/${unit.id}`,{
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
end: end
|
|
66
|
-
}
|
|
49
|
+
return axios.post(`/api/v1/pigfarm/electric/${unit.id}`, {
|
|
50
|
+
start: start,
|
|
51
|
+
end: end,
|
|
67
52
|
});
|
|
68
53
|
});
|
|
69
54
|
}
|
package/transport_gateway.ts
CHANGED
|
@@ -37,7 +37,11 @@ export class TransportGateway extends Object {
|
|
|
37
37
|
});
|
|
38
38
|
});
|
|
39
39
|
},
|
|
40
|
-
|
|
40
|
+
//获取打料详情
|
|
41
|
+
get inputs() {
|
|
42
|
+
return this.getDetail;
|
|
43
|
+
},
|
|
44
|
+
//获取设备打料数据 deperecated
|
|
41
45
|
getDetail: (ids: Array<number>, date: string): Promise<any> => {
|
|
42
46
|
return this.context.ready.then(() => {
|
|
43
47
|
return this.context.axios
|