|
@@ -11,6 +11,7 @@
|
11
|
11
|
| 1.0.2 | `HTTP`协议电量查询,实现按月、按天、按小时查询。 | 季建新 | 2021.2.21 |
|
12
|
12
|
| 1.0.3 | `UDP`协议电量查询,实现按月、按天、按小时查询。 | 季建新 | 2021.2.21 |
|
13
|
13
|
| 1.0.4 | 获取`HTTP`协议模块是否在线; 模块和项目绑定;模块和项目解除绑定;获取60分钟内负荷; 获取任意多开关任意时间段内的电量。 | 季建新 | 2021.3.19 |
|
|
14
|
+| 1.0.5 | 获取项目下的模块;获取项目下的所有模块及线路;获取任意多个线路的累积负荷;获取任意多开关任意时间段内的按小时、按天、按月电量;获取任意多开关任意时间段内的电量。 | 季建新 | 2021.3.22 |
|
14
|
15
|
|
15
|
16
|
|
16
|
17
|
|
|
@@ -358,6 +359,168 @@ Body:
|
358
|
359
|
|
359
|
360
|
|
360
|
361
|
|
|
362
|
+## 获取项目下的模块
|
|
363
|
+
|
|
364
|
+请求
|
|
365
|
+
|
|
366
|
+```
|
|
367
|
+POST http://47.103.61.198:5008/api/hd/macs/byproject
|
|
368
|
+
|
|
369
|
+Headers:
|
|
370
|
+
|
|
371
|
+Content-Type: application/json
|
|
372
|
+DD-Open-Key: bde2d876-993d-440d-aba1-3a06007a25a3
|
|
373
|
+
|
|
374
|
+Body:
|
|
375
|
+
|
|
376
|
+{
|
|
377
|
+ "ProjectId":"2"
|
|
378
|
+}
|
|
379
|
+```
|
|
380
|
+
|
|
381
|
+
|
|
382
|
+
|
|
383
|
+响应
|
|
384
|
+
|
|
385
|
+```
|
|
386
|
+{
|
|
387
|
+ "data": {
|
|
388
|
+ "macs": [
|
|
389
|
+ "187ED53338C4",
|
|
390
|
+ "187ED5311111",
|
|
391
|
+ "187ED5322222",
|
|
392
|
+ "187ED5333333",
|
|
393
|
+ "187ED5344444",
|
|
394
|
+ "187ED5355555",
|
|
395
|
+ "187ED5366666"
|
|
396
|
+ ],
|
|
397
|
+ "projectId": "2"
|
|
398
|
+ },
|
|
399
|
+ "isError": false,
|
|
400
|
+ "message": "success",
|
|
401
|
+ "code": 200
|
|
402
|
+}
|
|
403
|
+```
|
|
404
|
+
|
|
405
|
+
|
|
406
|
+
|
|
407
|
+## 获取项目下的所有模块及线路
|
|
408
|
+
|
|
409
|
+请求
|
|
410
|
+
|
|
411
|
+```
|
|
412
|
+POST http://47.103.61.198:5008/api/hd/addrs/byprojectmac
|
|
413
|
+
|
|
414
|
+Headers:
|
|
415
|
+
|
|
416
|
+Content-Type: application/json
|
|
417
|
+DD-Open-Key: bde2d876-993d-440d-aba1-3a06007a25a3
|
|
418
|
+
|
|
419
|
+Body:
|
|
420
|
+
|
|
421
|
+{
|
|
422
|
+ "ProjectId":"2"
|
|
423
|
+}
|
|
424
|
+```
|
|
425
|
+
|
|
426
|
+
|
|
427
|
+
|
|
428
|
+响应
|
|
429
|
+
|
|
430
|
+```
|
|
431
|
+{
|
|
432
|
+ "data": {
|
|
433
|
+ "projectId": "2",
|
|
434
|
+ "macs": {
|
|
435
|
+ "187ED53338C4": [
|
|
436
|
+ "1",
|
|
437
|
+ "2",
|
|
438
|
+ "3"
|
|
439
|
+ ],
|
|
440
|
+ "187ED5311111": [
|
|
441
|
+ "1",
|
|
442
|
+ "2",
|
|
443
|
+ "3",
|
|
444
|
+ "4",
|
|
445
|
+ "5",
|
|
446
|
+ "6",
|
|
447
|
+ "7",
|
|
448
|
+ "8",
|
|
449
|
+ "9",
|
|
450
|
+ "10"
|
|
451
|
+ ],
|
|
452
|
+ "187ED5322222": [
|
|
453
|
+ "1",
|
|
454
|
+ "2",
|
|
455
|
+ "3",
|
|
456
|
+ "4",
|
|
457
|
+ "5",
|
|
458
|
+ "6",
|
|
459
|
+ "7",
|
|
460
|
+ "8",
|
|
461
|
+ "9",
|
|
462
|
+ "10"
|
|
463
|
+ ],
|
|
464
|
+ "187ED5333333": [
|
|
465
|
+ "1",
|
|
466
|
+ "2",
|
|
467
|
+ "3",
|
|
468
|
+ "4",
|
|
469
|
+ "5",
|
|
470
|
+ "6",
|
|
471
|
+ "7",
|
|
472
|
+ "8",
|
|
473
|
+ "9",
|
|
474
|
+ "10"
|
|
475
|
+ ],
|
|
476
|
+ "187ED5344444": [
|
|
477
|
+ "1",
|
|
478
|
+ "2",
|
|
479
|
+ "3",
|
|
480
|
+ "4",
|
|
481
|
+ "5",
|
|
482
|
+ "6",
|
|
483
|
+ "7",
|
|
484
|
+ "8",
|
|
485
|
+ "9",
|
|
486
|
+ "10"
|
|
487
|
+ ],
|
|
488
|
+ "187ED5355555": [
|
|
489
|
+ "1",
|
|
490
|
+ "2",
|
|
491
|
+ "3",
|
|
492
|
+ "4",
|
|
493
|
+ "5",
|
|
494
|
+ "6",
|
|
495
|
+ "7",
|
|
496
|
+ "8",
|
|
497
|
+ "9",
|
|
498
|
+ "10"
|
|
499
|
+ ],
|
|
500
|
+ "187ED5366666": [
|
|
501
|
+ "1",
|
|
502
|
+ "2",
|
|
503
|
+ "3",
|
|
504
|
+ "4",
|
|
505
|
+ "5",
|
|
506
|
+ "6",
|
|
507
|
+ "7",
|
|
508
|
+ "8",
|
|
509
|
+ "9",
|
|
510
|
+ "10"
|
|
511
|
+ ]
|
|
512
|
+ }
|
|
513
|
+ },
|
|
514
|
+ "isError": false,
|
|
515
|
+ "message": "success",
|
|
516
|
+ "code": 200
|
|
517
|
+}
|
|
518
|
+```
|
|
519
|
+
|
|
520
|
+
|
|
521
|
+
|
|
522
|
+
|
|
523
|
+
|
361
|
524
|
## 获取最近60分钟的负荷
|
362
|
525
|
|
363
|
526
|
当需要统计某个项目、公司、位置下的某些开关最近60分钟内负荷时调用本接口。
|
|
@@ -655,7 +818,7 @@ Body:
|
655
|
818
|
|
656
|
819
|
|
657
|
820
|
|
658
|
|
-## 获取某个线路的累积负荷
|
|
821
|
+## 获取任意多个线路的累积负荷
|
659
|
822
|
|
660
|
823
|
|
661
|
824
|
|
|
@@ -672,8 +835,7 @@ DD-Open-Key: bde2d876-993d-440d-aba1-3a06007a25a3
|
672
|
835
|
Body:
|
673
|
836
|
|
674
|
837
|
{
|
675
|
|
- "Mac":"187ED5311111",
|
676
|
|
- "Addr":1
|
|
838
|
+ "Macs":["187ED5311111_1", "187ED5322222_2"]//一个元素就代表一个开关,不能是187ED5311111_1,2
|
677
|
839
|
}
|
678
|
840
|
```
|
679
|
841
|
|
|
@@ -684,7 +846,10 @@ Body:
|
684
|
846
|
```
|
685
|
847
|
{
|
686
|
848
|
"data": {
|
687
|
|
- "wp": 120
|
|
849
|
+ "macs": {
|
|
850
|
+ "187ED5311111_1": 48.9,
|
|
851
|
+ "187ED5322222_2": 123.8
|
|
852
|
+ }
|
688
|
853
|
},
|
689
|
854
|
"isError": false,
|
690
|
855
|
"message": "success",
|
|
@@ -742,14 +907,14 @@ Body:
|
742
|
907
|
|
743
|
908
|
|
744
|
909
|
|
745
|
|
-## 获取任意多开关任意时间段内的按小时电量
|
|
910
|
+## 获取任意多开关任意时间段内的按小时、按天、按月电量
|
746
|
911
|
|
747
|
912
|
|
748
|
913
|
|
749
|
|
-请求
|
|
914
|
+请求, 按小时
|
750
|
915
|
|
751
|
916
|
```
|
752
|
|
-POST http://47.103.61.198:5008/api/breaker/power/random/byhours
|
|
917
|
+POST http://47.103.61.198:5008/api/breaker/power/random/by
|
753
|
918
|
|
754
|
919
|
Headers:
|
755
|
920
|
|
|
@@ -767,16 +932,18 @@ Body:
|
767
|
932
|
"EndYear":2021,
|
768
|
933
|
"EndMonth":3,
|
769
|
934
|
"EndDay":5,
|
770
|
|
- "EndHour":0
|
|
935
|
+ "EndHour":0,
|
|
936
|
+ "PType":"HOURS"
|
771
|
937
|
}
|
772
|
938
|
|
773
|
939
|
```
|
774
|
940
|
|
775
|
|
-响应
|
|
941
|
+响应, 按小时
|
776
|
942
|
|
777
|
943
|
```
|
778
|
944
|
{
|
779
|
945
|
"data": {
|
|
946
|
+ "pType": "HOURS",
|
780
|
947
|
"powers": {
|
781
|
948
|
"2021-03-01 00:00:00.000": 0.72,
|
782
|
949
|
"2021-03-01 01:00:00.000": 0.72,
|
|
@@ -883,3 +1050,270 @@ Body:
|
883
|
1050
|
}
|
884
|
1051
|
```
|
885
|
1052
|
|
|
1053
|
+
|
|
1054
|
+
|
|
1055
|
+请求, 按天
|
|
1056
|
+
|
|
1057
|
+```
|
|
1058
|
+POST http://47.103.61.198:5008/api/breaker/power/random/by
|
|
1059
|
+
|
|
1060
|
+Headers:
|
|
1061
|
+
|
|
1062
|
+Content-Type: application/json
|
|
1063
|
+DD-Open-Key: bde2d876-993d-440d-aba1-3a06007a25a3
|
|
1064
|
+
|
|
1065
|
+Body:
|
|
1066
|
+
|
|
1067
|
+{
|
|
1068
|
+ "MacAddrs":["187ED5311111_1", "187ED5322222_2"],
|
|
1069
|
+ "StartYear":2021,
|
|
1070
|
+ "StartMonth":3,
|
|
1071
|
+ "StartDay":1,
|
|
1072
|
+ "StartHour":0,
|
|
1073
|
+ "EndYear":2021,
|
|
1074
|
+ "EndMonth":3,
|
|
1075
|
+ "EndDay":5,
|
|
1076
|
+ "EndHour":0,
|
|
1077
|
+ "PType":"DAY"
|
|
1078
|
+}
|
|
1079
|
+
|
|
1080
|
+```
|
|
1081
|
+
|
|
1082
|
+响应, 按天
|
|
1083
|
+
|
|
1084
|
+```
|
|
1085
|
+{
|
|
1086
|
+ "data": {
|
|
1087
|
+ "pType": "DAY",
|
|
1088
|
+ "powers": {
|
|
1089
|
+ "2021-03-01 00:00:00.000": 42.5,
|
|
1090
|
+ "2021-03-02 00:00:00.000": 42.5,
|
|
1091
|
+ "2021-03-03 00:00:00.000": 42.5,
|
|
1092
|
+ "2021-03-04 00:00:00.000": 42.5,
|
|
1093
|
+ "2021-03-05 00:00:00.000": 42.5
|
|
1094
|
+ }
|
|
1095
|
+ },
|
|
1096
|
+ "isError": false,
|
|
1097
|
+ "message": "success",
|
|
1098
|
+ "code": 200
|
|
1099
|
+}
|
|
1100
|
+```
|
|
1101
|
+
|
|
1102
|
+请求,按月
|
|
1103
|
+
|
|
1104
|
+```
|
|
1105
|
+POST http://47.103.61.198:5008/api/breaker/power/random/by
|
|
1106
|
+
|
|
1107
|
+Headers:
|
|
1108
|
+
|
|
1109
|
+Content-Type: application/json
|
|
1110
|
+DD-Open-Key: bde2d876-993d-440d-aba1-3a06007a25a3
|
|
1111
|
+
|
|
1112
|
+{
|
|
1113
|
+ "MacAddrs":["187ED5311111_1", "187ED5322222_2"],
|
|
1114
|
+ "StartYear":2021,
|
|
1115
|
+ "StartMonth":1,
|
|
1116
|
+ "StartDay":1,
|
|
1117
|
+ "StartHour":0,
|
|
1118
|
+ "EndYear":2021,
|
|
1119
|
+ "EndMonth":3,
|
|
1120
|
+ "EndDay":5,
|
|
1121
|
+ "EndHour":0,
|
|
1122
|
+ "PType":"MONTH"
|
|
1123
|
+}
|
|
1124
|
+```
|
|
1125
|
+
|
|
1126
|
+响应,按月
|
|
1127
|
+
|
|
1128
|
+```
|
|
1129
|
+{
|
|
1130
|
+ "data": {
|
|
1131
|
+ "pType": "MONTH",
|
|
1132
|
+ "powers": {
|
|
1133
|
+ "2021-01-01 00:00:00.000": 356,
|
|
1134
|
+ "2021-02-01 00:00:00.000": 347,
|
|
1135
|
+ "2021-03-01 00:00:00.000": 359
|
|
1136
|
+ }
|
|
1137
|
+ },
|
|
1138
|
+ "isError": false,
|
|
1139
|
+ "message": "success",
|
|
1140
|
+ "code": 200
|
|
1141
|
+}
|
|
1142
|
+```
|
|
1143
|
+
|
|
1144
|
+
|
|
1145
|
+
|
|
1146
|
+## 获取任意多开关任意时间段内的电量
|
|
1147
|
+
|
|
1148
|
+
|
|
1149
|
+
|
|
1150
|
+请求
|
|
1151
|
+
|
|
1152
|
+```
|
|
1153
|
+POST http://47.103.61.198:5008/api/breaker/power/random/byaddr
|
|
1154
|
+
|
|
1155
|
+Headers:
|
|
1156
|
+
|
|
1157
|
+Content-Type: application/json
|
|
1158
|
+DD-Open-Key: bde2d876-993d-440d-aba1-3a06007a25a3
|
|
1159
|
+
|
|
1160
|
+{
|
|
1161
|
+ "MacAddrs":["187ED5311111_1", "187ED5322222_2"],
|
|
1162
|
+ "StartYear":2021,
|
|
1163
|
+ "StartMonth":1,
|
|
1164
|
+ "StartDay":1,
|
|
1165
|
+ "StartHour":0,
|
|
1166
|
+ "EndYear":2021,
|
|
1167
|
+ "EndMonth":3,
|
|
1168
|
+ "EndDay":5,
|
|
1169
|
+ "EndHour":0
|
|
1170
|
+}
|
|
1171
|
+```
|
|
1172
|
+
|
|
1173
|
+
|
|
1174
|
+
|
|
1175
|
+响应
|
|
1176
|
+
|
|
1177
|
+```
|
|
1178
|
+{
|
|
1179
|
+ "data": {
|
|
1180
|
+ "powers": {
|
|
1181
|
+ "187ED5311111_1": 641.15,
|
|
1182
|
+ "187ED5322222_2": 398.77
|
|
1183
|
+ }
|
|
1184
|
+ },
|
|
1185
|
+ "isError": false,
|
|
1186
|
+ "message": "success",
|
|
1187
|
+ "code": 200
|
|
1188
|
+}
|
|
1189
|
+```
|
|
1190
|
+
|
|
1191
|
+
|
|
1192
|
+
|
|
1193
|
+## 获取任意多模块任意线路的报警
|
|
1194
|
+
|
|
1195
|
+请求
|
|
1196
|
+
|
|
1197
|
+```
|
|
1198
|
+POST http://47.103.61.198:5008/api/breaker/warning/bymacs
|
|
1199
|
+
|
|
1200
|
+Headers:
|
|
1201
|
+
|
|
1202
|
+Content-Type: application/json
|
|
1203
|
+DD-Open-Key: bde2d876-993d-440d-aba1-3a06007a25a3
|
|
1204
|
+
|
|
1205
|
+{
|
|
1206
|
+ "Macs":["187ED5311111_2","187ED53338C4_1"],
|
|
1207
|
+ "StartYear":2021,
|
|
1208
|
+ "StartMonth":3,
|
|
1209
|
+ "StartDay":1,
|
|
1210
|
+ "StartHour":0,
|
|
1211
|
+ "EndYear":2021,
|
|
1212
|
+ "EndMonth":3,
|
|
1213
|
+ "EndDay":2,
|
|
1214
|
+ "EndHour":0
|
|
1215
|
+}
|
|
1216
|
+```
|
|
1217
|
+
|
|
1218
|
+响应
|
|
1219
|
+
|
|
1220
|
+```
|
|
1221
|
+{
|
|
1222
|
+ "data": {
|
|
1223
|
+ "warnings": [
|
|
1224
|
+ {
|
|
1225
|
+ "addr": 2,
|
|
1226
|
+ "start": "2021-03-01 04:04:00.000",
|
|
1227
|
+ "end": "2021-03-01 05:04:00.000",
|
|
1228
|
+ "wtype": "0",
|
|
1229
|
+ "level": 3,
|
|
1230
|
+ "val": "265 v",
|
|
1231
|
+ "limit": "260 V",
|
|
1232
|
+ "mac": "187ed5311111",
|
|
1233
|
+ "ts": "2021-03-18 15:26:10.724"
|
|
1234
|
+ },
|
|
1235
|
+ {
|
|
1236
|
+ "addr": 2,
|
|
1237
|
+ "start": "2021-03-01 05:05:00.000",
|
|
1238
|
+ "end": "2021-03-01 06:05:00.000",
|
|
1239
|
+ "wtype": "0",
|
|
1240
|
+ "level": 3,
|
|
1241
|
+ "val": "100 V",
|
|
1242
|
+ "limit": "175 V",
|
|
1243
|
+ "mac": "187ed5311111",
|
|
1244
|
+ "ts": "2021-03-18 15:26:26.468"
|
|
1245
|
+ },
|
|
1246
|
+ ......
|
|
1247
|
+ ]
|
|
1248
|
+ },
|
|
1249
|
+ "isError": false,
|
|
1250
|
+ "message": "success",
|
|
1251
|
+ "code": 200
|
|
1252
|
+}
|
|
1253
|
+```
|
|
1254
|
+
|
|
1255
|
+
|
|
1256
|
+
|
|
1257
|
+## 获取某个线路的报警
|
|
1258
|
+
|
|
1259
|
+请求
|
|
1260
|
+
|
|
1261
|
+```
|
|
1262
|
+POST http://47.103.61.198:5008/api/breaker/power/random/byaddr
|
|
1263
|
+
|
|
1264
|
+Headers:
|
|
1265
|
+
|
|
1266
|
+Content-Type: application/json
|
|
1267
|
+DD-Open-Key: bde2d876-993d-440d-aba1-3a06007a25a3
|
|
1268
|
+
|
|
1269
|
+{
|
|
1270
|
+ "Mac":"187ED5311111",
|
|
1271
|
+ "Addr":2,
|
|
1272
|
+ "StartYear":2021,
|
|
1273
|
+ "StartMonth":3,
|
|
1274
|
+ "StartDay":1,
|
|
1275
|
+ "StartHour":0,
|
|
1276
|
+ "EndYear":2021,
|
|
1277
|
+ "EndMonth":3,
|
|
1278
|
+ "EndDay":2,
|
|
1279
|
+ "EndHour":0
|
|
1280
|
+}
|
|
1281
|
+```
|
|
1282
|
+
|
|
1283
|
+响应
|
|
1284
|
+
|
|
1285
|
+```
|
|
1286
|
+{
|
|
1287
|
+ "data": {
|
|
1288
|
+ "warnings": [
|
|
1289
|
+ {
|
|
1290
|
+ "addr": 2,
|
|
1291
|
+ "start": "2021-03-01 04:04:00.000",
|
|
1292
|
+ "end": "2021-03-01 05:04:00.000",
|
|
1293
|
+ "wtype": "0",
|
|
1294
|
+ "level": 3,
|
|
1295
|
+ "val": "265 v",
|
|
1296
|
+ "limit": "260 V",
|
|
1297
|
+ "mac": "187ed5311111",
|
|
1298
|
+ "ts": "2021-03-18 15:26:10.724"
|
|
1299
|
+ },
|
|
1300
|
+ {
|
|
1301
|
+ "addr": 2,
|
|
1302
|
+ "start": "2021-03-01 05:05:00.000",
|
|
1303
|
+ "end": "2021-03-01 06:05:00.000",
|
|
1304
|
+ "wtype": "0",
|
|
1305
|
+ "level": 3,
|
|
1306
|
+ "val": "100 V",
|
|
1307
|
+ "limit": "175 V",
|
|
1308
|
+ "mac": "187ed5311111",
|
|
1309
|
+ "ts": "2021-03-18 15:26:26.468"
|
|
1310
|
+ },
|
|
1311
|
+ ......
|
|
1312
|
+ ]
|
|
1313
|
+ },
|
|
1314
|
+ "isError": false,
|
|
1315
|
+ "message": "success",
|
|
1316
|
+ "code": 200
|
|
1317
|
+}
|
|
1318
|
+```
|
|
1319
|
+
|