天一电厂UPS动环数据对接,SNMP协议
whycxzp
2024-02-29 ac476c867af05823e33c7746eb2ec37dd26abe7a
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
package com.whyc.service;
 
import com.whyc.constant.Constant_SNMP_OID_A_250;
import com.whyc.constant.Constant_SNMP_OID_B_247;
import com.whyc.dto.Response;
import com.whyc.pojo.UpsPowerAlarm;
import com.whyc.pojo.UpsPowerAlarmHistory;
import com.whyc.pojo.UpsPowerSignal;
import com.whyc.pojo.UpsPowerSimulate;
import lombok.extern.slf4j.Slf4j;
import org.snmp4j.PDU;
import org.snmp4j.Snmp;
import org.snmp4j.Target;
import org.snmp4j.event.ResponseEvent;
import org.snmp4j.smi.*;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.system.ApplicationHome;
import org.springframework.stereotype.Service;
 
import java.io.*;
import java.util.*;
import java.util.stream.Collectors;
 
@Service
@Slf4j
public class SNMPConnectService {
 
    @Autowired
    private Target target;
    @Autowired
    private Snmp snmp;
    @Autowired
    private Address address;
 
    @Autowired
    private UpsPowerAlarmService alarmService;
 
    @Autowired
    private UpsPowerAlarmHistoryService alarmHistoryService;
 
    @Autowired
    private UpsPowerSimulateService simulateService;
 
    @Autowired
    private UpsPowerSignalService signalService;
 
 
    public Response getData() {
        ApplicationHome applicationHome = new ApplicationHome(SNMPConnectService.class);
        File dir = applicationHome.getDir();
 
        List<String> oIdList = getDataOIDList();
        //List<String> oIdList = new LinkedList<>();
        //oIdList.add("1.3.6.1.2.1.1.3.0");
        //oIdList.add("1.3.6.1.2.1.1.1.0");
        //oIdList.add("1.3.6.1.2.4.1.1.0");
 
        PDU pdu = new PDU();
        for (String oId : oIdList) {
            OID oid = new OID(oId);
            pdu.add(new VariableBinding(oid));
        }
        pdu.setType(PDU.GET);
        try {
            ResponseEvent responseEvent = snmp.send(pdu, target);
            String responseRecord = "Synchronize(同步) message(消息) from(来自) "
                    + responseEvent.getPeerAddress() + "\r\n" + "request(发送的请求):"
                    + responseEvent.getRequest() + "\r\n" + "response(返回的响应):"
                    + responseEvent.getResponse();
            PDU pduBack = responseEvent.getResponse();
 
            System.out.println(responseRecord);
 
            FileOutputStream fileOutputStream = new FileOutputStream(dir.getAbsolutePath() + File.separator+"data.txt");
            byte[] bytes = responseRecord.getBytes();
            fileOutputStream.write(bytes);
        } catch (IOException e) {
            e.printStackTrace();
        }
        return new Response().set(1);
 
    }
 
    public Response getSignal() {
        ApplicationHome applicationHome = new ApplicationHome(SNMPConnectService.class);
        File dir = applicationHome.getDir();
 
        List<String> oIdList = getSignalOIDList();
 
        PDU pdu = new PDU();
        for (String oId : oIdList) {
            OID oid = new OID(oId);
            pdu.add(new VariableBinding(oid));
        }
        pdu.setType(PDU.GET);
        try {
            ResponseEvent responseEvent = snmp.send(pdu, target);
            String responseRecord = "Synchronize(同步) message(消息) from(来自) "
                    + responseEvent.getPeerAddress() + "\r\n" + "request(发送的请求):"
                    + responseEvent.getRequest() + "\r\n" + "response(返回的响应):"
                    + responseEvent.getResponse();
            FileOutputStream fileOutputStream = new FileOutputStream(dir.getAbsolutePath() + File.separator+"signal.txt");
            byte[] bytes = responseRecord.getBytes();
            fileOutputStream.write(bytes);
 
            System.out.println(responseRecord);
        } catch (IOException e) {
            e.printStackTrace();
        }
        return new Response().set(1);
 
    }
 
    public Response getAlarm() {
        ApplicationHome applicationHome = new ApplicationHome(SNMPConnectService.class);
        File dir = applicationHome.getDir();
 
        List<String> oIdList = getAlarmOIDList();
 
        PDU pdu = new PDU();
        for (String oId : oIdList) {
            OID oid = new OID(oId);
            pdu.add(new VariableBinding(oid));
        }
        pdu.setType(PDU.GET);
        try {
            ResponseEvent responseEvent = snmp.send(pdu, target);
            String responseRecord = "Synchronize(同步) message(消息) from(来自) "
                    + responseEvent.getPeerAddress() + "\r\n" + "request(发送的请求):"
                    + responseEvent.getRequest() + "\r\n" + "response(返回的响应):"
                    + responseEvent.getResponse();
            FileOutputStream fileOutputStream = new FileOutputStream(dir.getAbsolutePath() + File.separator+"alarm.txt");
            byte[] bytes = responseRecord.getBytes();
            fileOutputStream.write(bytes);
 
            System.out.println(responseRecord);
        } catch (IOException e) {
            e.printStackTrace();
        }
        return new Response().set(1);
 
    }
 
    private List<String> getDataOIDList() {
        List<String> oIdList = new LinkedList<>();
        //A相输入电压
        oIdList.add(".1.3.6.1.4.1.41477.3.5.247.2.0");
        //B相输入电压
        oIdList.add(".1.3.6.1.4.1.41477.3.5.247.3.0");
        //C相输入电压
        oIdList.add(".1.3.6.1.4.1.41477.3.5.247.4.0");
        //A相输出电压
        oIdList.add(".1.3.6.1.4.1.41477.3.5.247.5.0");
        //B相输出电压
        oIdList.add(".1.3.6.1.4.1.41477.3.5.247.6.0");
        //C相输出电压
        oIdList.add(".1.3.6.1.4.1.41477.3.5.247.7.0");
        //A相输出电流
        oIdList.add(".1.3.6.1.4.1.41477.3.5.247.8.0");
        //B相输出电流
        oIdList.add(".1.3.6.1.4.1.41477.3.5.247.9.0");
        //C相输出电流
        oIdList.add(".1.3.6.1.4.1.41477.3.5.247.10.0");
        //直流输入电压
        oIdList.add(".1.3.6.1.4.1.41477.3.5.247.11.0");
        //输出频率
        oIdList.add(".1.3.6.1.4.1.41477.3.5.247.12.0");
        //AB线输入电压
        oIdList.add(".1.3.6.1.4.1.41477.3.5.247.19.0");
        //BC线输入电压
        oIdList.add(".1.3.6.1.4.1.41477.3.5.247.20.0");
        //CA线输入电压
        oIdList.add(".1.3.6.1.4.1.41477.3.5.247.21.0");
        //A相输入电流
        oIdList.add(".1.3.6.1.4.1.41477.3.5.247.22.0");
        //B相输入电流
        oIdList.add(".1.3.6.1.4.1.41477.3.5.247.23.0");
        //C相输入电流
        oIdList.add(".1.3.6.1.4.1.41477.3.5.247.24.0");
        //输入频率
        oIdList.add(".1.3.6.1.4.1.41477.3.5.247.25.0");
        //A相输入功率因数
        oIdList.add(".1.3.6.1.4.1.41477.3.5.247.26.0");
        //B相输入功率因数
        oIdList.add(".1.3.6.1.4.1.41477.3.5.247.27.0");
        //C相输入功率因数
        oIdList.add(".1.3.6.1.4.1.41477.3.5.247.28.0");
        //A相旁路电压
        oIdList.add(".1.3.6.1.4.1.41477.3.5.247.29.0");
        //B相旁路电压
        oIdList.add(".1.3.6.1.4.1.41477.3.5.247.30.0");
        //C相旁路电压
        oIdList.add(".1.3.6.1.4.1.41477.3.5.247.31.0");
        //旁路频率
        oIdList.add(".1.3.6.1.4.1.41477.3.5.247.32.0");
        //AB线输出电压
        oIdList.add(".1.3.6.1.4.1.41477.3.5.247.33.0");
        //BC线输出电压
        oIdList.add(".1.3.6.1.4.1.41477.3.5.247.34.0");
        //CA线输出电压
        oIdList.add(".1.3.6.1.4.1.41477.3.5.247.35.0");
        //AB线旁路电压
        oIdList.add(".1.3.6.1.4.1.41477.3.5.247.36.0");
        //BC线旁路电压
        oIdList.add(".1.3.6.1.4.1.41477.3.5.247.37.0");
        //CA线旁路电压
        oIdList.add(".1.3.6.1.4.1.41477.3.5.247.38.0");
        //A相输出功率因数
        oIdList.add(".1.3.6.1.4.1.41477.3.5.247.42.0");
        //B相输出功率因数
        oIdList.add(".1.3.6.1.4.1.41477.3.5.247.43.0");
        //C相输出功率因数
        oIdList.add(".1.3.6.1.4.1.41477.3.5.247.44.0");
        //A相输出峰值比
        oIdList.add(".1.3.6.1.4.1.41477.3.5.247.45.0");
        //B相输出峰值比
        oIdList.add(".1.3.6.1.4.1.41477.3.5.247.46.0");
        //C相输出峰值比
        oIdList.add(".1.3.6.1.4.1.41477.3.5.247.47.0");
        //A相输出有功功率
        oIdList.add(".1.3.6.1.4.1.41477.3.5.247.48.0");
        //B相输出有功功率
        oIdList.add(".1.3.6.1.4.1.41477.3.5.247.49.0");
        //C相输出有功功率
        oIdList.add(".1.3.6.1.4.1.41477.3.5.247.50.0");
        //A相输出无功功率
        oIdList.add(".1.3.6.1.4.1.41477.3.5.247.51.0");
        //B相输出无功功率
        oIdList.add(".1.3.6.1.4.1.41477.3.5.247.52.0");
        //C相输出无功功率
        oIdList.add(".1.3.6.1.4.1.41477.3.5.247.53.0");
        //A相输出视在功率
        oIdList.add(".1.3.6.1.4.1.41477.3.5.247.54.0");
        //B相输出视在功率
        oIdList.add(".1.3.6.1.4.1.41477.3.5.247.55.0");
        //C相输出视在功率
        oIdList.add(".1.3.6.1.4.1.41477.3.5.247.56.0");
        //A相输出负载百分比
        oIdList.add(".1.3.6.1.4.1.41477.3.5.247.57.0");
        //B相输出负载百分比
        oIdList.add(".1.3.6.1.4.1.41477.3.5.247.58.0");
        //C相输出负载百分比
        oIdList.add(".1.3.6.1.4.1.41477.3.5.247.59.0");
        //系统A相输出有功功率
        oIdList.add(".1.3.6.1.4.1.41477.3.5.247.62.0");
        //系统B相输出有功功率
        oIdList.add(".1.3.6.1.4.1.41477.3.5.247.63.0");
        //系统C相输出有功功率
        oIdList.add(".1.3.6.1.4.1.41477.3.5.247.64.0");
        //系统A相输出视在功率
        oIdList.add(".1.3.6.1.4.1.41477.3.5.247.65.0");
        //系统B相输出视在功率
        oIdList.add(".1.3.6.1.4.1.41477.3.5.247.66.0");
        //系统C相输出视在功率
        oIdList.add(".1.3.6.1.4.1.41477.3.5.247.67.0");
        //系统A相输出无功功率
        oIdList.add(".1.3.6.1.4.1.41477.3.5.247.68.0");
        //系统B相输出无功功率
        oIdList.add(".1.3.6.1.4.1.41477.3.5.247.69.0");
        //系统C相输出无功功率
        oIdList.add(".1.3.6.1.4.1.41477.3.5.247.70.0");
        //整机环境温度
        oIdList.add(".1.3.6.1.4.1.41477.3.5.247.71.0");
        //电池后备时间
        oIdList.add(".1.3.6.1.4.1.41477.3.5.247.75.0");
        //正电池电压
        oIdList.add(".1.3.6.1.4.1.41477.3.5.247.76.0");
        //正电池电流
        oIdList.add(".1.3.6.1.4.1.41477.3.5.247.77.0");
        //负电池电压
        oIdList.add(".1.3.6.1.4.1.41477.3.5.247.78.0");
        //负电池电流
        oIdList.add(".1.3.6.1.4.1.41477.3.5.247.79.0");
        //电池老化系数
        oIdList.add(".1.3.6.1.4.1.41477.3.5.247.80.0");
        //电池温度
        oIdList.add(".1.3.6.1.4.1.41477.3.5.247.81.0");
        //环境温度
        oIdList.add(".1.3.6.1.4.1.41477.3.5.247.82.0");
        //A相输入电压
        oIdList.add(".1.3.6.1.4.1.41477.3.5.250.2.0");
        //B相输入电压
        oIdList.add(".1.3.6.1.4.1.41477.3.5.250.3.0");
        //C相输入电压
        oIdList.add(".1.3.6.1.4.1.41477.3.5.250.4.0");
        //A相输出电压
        oIdList.add(".1.3.6.1.4.1.41477.3.5.250.5.0");
        //B相输出电压
        oIdList.add(".1.3.6.1.4.1.41477.3.5.250.6.0");
        //C相输出电压
        oIdList.add(".1.3.6.1.4.1.41477.3.5.250.7.0");
        //A相输出电流
        oIdList.add(".1.3.6.1.4.1.41477.3.5.250.8.0");
        //B相输出电流
        oIdList.add(".1.3.6.1.4.1.41477.3.5.250.9.0");
        //C相输出电流
        oIdList.add(".1.3.6.1.4.1.41477.3.5.250.10.0");
        //直流输入电压
        oIdList.add(".1.3.6.1.4.1.41477.3.5.250.11.0");
        //输出频率
        oIdList.add(".1.3.6.1.4.1.41477.3.5.250.12.0");
        //AB线输入电压
        oIdList.add(".1.3.6.1.4.1.41477.3.5.250.19.0");
        //BC线输入电压
        oIdList.add(".1.3.6.1.4.1.41477.3.5.250.20.0");
        //CA线输入电压
        oIdList.add(".1.3.6.1.4.1.41477.3.5.250.21.0");
        //A相输入电流
        oIdList.add(".1.3.6.1.4.1.41477.3.5.250.22.0");
        //B相输入电流
        oIdList.add(".1.3.6.1.4.1.41477.3.5.250.23.0");
        //C相输入电流
        oIdList.add(".1.3.6.1.4.1.41477.3.5.250.24.0");
        //输入频率
        oIdList.add(".1.3.6.1.4.1.41477.3.5.250.25.0");
        //A相输入功率因数
        oIdList.add(".1.3.6.1.4.1.41477.3.5.250.26.0");
        //B相输入功率因数
        oIdList.add(".1.3.6.1.4.1.41477.3.5.250.27.0");
        //C相输入功率因数
        oIdList.add(".1.3.6.1.4.1.41477.3.5.250.28.0");
        //A相旁路电压
        oIdList.add(".1.3.6.1.4.1.41477.3.5.250.29.0");
        //B相旁路电压
        oIdList.add(".1.3.6.1.4.1.41477.3.5.250.30.0");
        //C相旁路电压
        oIdList.add(".1.3.6.1.4.1.41477.3.5.250.31.0");
        //旁路频率
        oIdList.add(".1.3.6.1.4.1.41477.3.5.250.32.0");
        //AB线输出电压
        oIdList.add(".1.3.6.1.4.1.41477.3.5.250.33.0");
        //BC线输出电压
        oIdList.add(".1.3.6.1.4.1.41477.3.5.250.34.0");
        //CA线输出电压
        oIdList.add(".1.3.6.1.4.1.41477.3.5.250.35.0");
        //AB线旁路电压
        oIdList.add(".1.3.6.1.4.1.41477.3.5.250.36.0");
        //BC线旁路电压
        oIdList.add(".1.3.6.1.4.1.41477.3.5.250.37.0");
        //CA线旁路电压
        oIdList.add(".1.3.6.1.4.1.41477.3.5.250.38.0");
        //A相输出功率因数
        oIdList.add(".1.3.6.1.4.1.41477.3.5.250.42.0");
        //B相输出功率因数
        oIdList.add(".1.3.6.1.4.1.41477.3.5.250.43.0");
        //C相输出功率因数
        oIdList.add(".1.3.6.1.4.1.41477.3.5.250.44.0");
        //A相输出峰值比
        oIdList.add(".1.3.6.1.4.1.41477.3.5.250.45.0");
        //B相输出峰值比
        oIdList.add(".1.3.6.1.4.1.41477.3.5.250.46.0");
        //C相输出峰值比
        oIdList.add(".1.3.6.1.4.1.41477.3.5.250.47.0");
        //A相输出有功功率
        oIdList.add(".1.3.6.1.4.1.41477.3.5.250.48.0");
        //B相输出有功功率
        oIdList.add(".1.3.6.1.4.1.41477.3.5.250.49.0");
        //C相输出有功功率
        oIdList.add(".1.3.6.1.4.1.41477.3.5.250.50.0");
        //A相输出无功功率
        oIdList.add(".1.3.6.1.4.1.41477.3.5.250.51.0");
        //B相输出无功功率
        oIdList.add(".1.3.6.1.4.1.41477.3.5.250.52.0");
        //C相输出无功功率
        oIdList.add(".1.3.6.1.4.1.41477.3.5.250.53.0");
        //A相输出视在功率
        oIdList.add(".1.3.6.1.4.1.41477.3.5.250.54.0");
        //B相输出视在功率
        oIdList.add(".1.3.6.1.4.1.41477.3.5.250.55.0");
        //C相输出视在功率
        oIdList.add(".1.3.6.1.4.1.41477.3.5.250.56.0");
        //A相输出负载百分比
        oIdList.add(".1.3.6.1.4.1.41477.3.5.250.57.0");
        //B相输出负载百分比
        oIdList.add(".1.3.6.1.4.1.41477.3.5.250.58.0");
        //C相输出负载百分比
        oIdList.add(".1.3.6.1.4.1.41477.3.5.250.59.0");
        //系统A相输出有功功率
        oIdList.add(".1.3.6.1.4.1.41477.3.5.250.62.0");
        //系统B相输出有功功率
        oIdList.add(".1.3.6.1.4.1.41477.3.5.250.63.0");
        //系统C相输出有功功率
        oIdList.add(".1.3.6.1.4.1.41477.3.5.250.64.0");
        //系统A相输出视在功率
        oIdList.add(".1.3.6.1.4.1.41477.3.5.250.65.0");
        //系统B相输出视在功率
        oIdList.add(".1.3.6.1.4.1.41477.3.5.250.66.0");
        //系统C相输出视在功率
        oIdList.add(".1.3.6.1.4.1.41477.3.5.250.67.0");
        //系统A相输出无功功率
        oIdList.add(".1.3.6.1.4.1.41477.3.5.250.68.0");
        //系统B相输出无功功率
        oIdList.add(".1.3.6.1.4.1.41477.3.5.250.69.0");
        //系统C相输出无功功率
        oIdList.add(".1.3.6.1.4.1.41477.3.5.250.70.0");
        //整机环境温度
        oIdList.add(".1.3.6.1.4.1.41477.3.5.250.71.0");
        //电池后备时间
        oIdList.add(".1.3.6.1.4.1.41477.3.5.250.75.0");
        //正电池电压
        oIdList.add(".1.3.6.1.4.1.41477.3.5.250.76.0");
        //正电池电流
        oIdList.add(".1.3.6.1.4.1.41477.3.5.250.77.0");
        //负电池电压
        oIdList.add(".1.3.6.1.4.1.41477.3.5.250.78.0");
        //负电池电流
        oIdList.add(".1.3.6.1.4.1.41477.3.5.250.79.0");
        //电池老化系数
        oIdList.add(".1.3.6.1.4.1.41477.3.5.250.80.0");
        //电池温度
        oIdList.add(".1.3.6.1.4.1.41477.3.5.250.81.0");
        //环境温度
        oIdList.add(".1.3.6.1.4.1.41477.3.5.250.82.0");
        return oIdList;
    }
 
    private List<String> getSignalOIDList() {
        List<String> oIdList = new LinkedList<>();
        //供电方式
        oIdList.add(".1.3.6.1.4.1.41477.3.5.247.84.0");
        //电池自检
        oIdList.add(".1.3.6.1.4.1.41477.3.5.247.86.0");
        //电池充电状态
        oIdList.add(".1.3.6.1.4.1.41477.3.5.247.87.0");
        //逆变器开/关机状态
        oIdList.add(".1.3.6.1.4.1.41477.3.5.247.88.0");
        //整流器供电状态
        oIdList.add(".1.3.6.1.4.1.41477.3.5.247.89.0");
        //发电机接入状态
        oIdList.add(".1.3.6.1.4.1.41477.3.5.247.90.0");
        //输入空开状态
        oIdList.add(".1.3.6.1.4.1.41477.3.5.247.91.0");
        //维修空开状态
        oIdList.add(".1.3.6.1.4.1.41477.3.5.247.92.0");
        //旁路空开状态
        oIdList.add(".1.3.6.1.4.1.41477.3.5.247.93.0");
        //输出空开状态
        oIdList.add(".1.3.6.1.4.1.41477.3.5.247.94.0");
        //整机工作模式
        oIdList.add(".1.3.6.1.4.1.41477.3.5.247.95.0");
        //并机系统供电状态
        oIdList.add(".1.3.6.1.4.1.41477.3.5.247.96.0");
        //模块1在线状态
        oIdList.add(".1.3.6.1.4.1.41477.3.5.247.97.0");
        //模块2在线状态
        oIdList.add(".1.3.6.1.4.1.41477.3.5.247.98.0");
        //模块3在线状态
        oIdList.add(".1.3.6.1.4.1.41477.3.5.247.99.0");
        //模块4在线状态
        oIdList.add(".1.3.6.1.4.1.41477.3.5.247.100.0");
        //模块5在线状态
        oIdList.add(".1.3.6.1.4.1.41477.3.5.247.101.0");
        //模块6在线状态
        oIdList.add(".1.3.6.1.4.1.41477.3.5.247.102.0");
        //模块7在线状态
        oIdList.add(".1.3.6.1.4.1.41477.3.5.247.103.0");
        //模块8在线状态
        oIdList.add(".1.3.6.1.4.1.41477.3.5.247.104.0");
        //模块9在线状态
        oIdList.add(".1.3.6.1.4.1.41477.3.5.247.105.0");
        //模块10在线状态
        oIdList.add(".1.3.6.1.4.1.41477.3.5.247.106.0");
        //模块11在线状态
        oIdList.add(".1.3.6.1.4.1.41477.3.5.247.107.0");
        //模块12在线状态
        oIdList.add(".1.3.6.1.4.1.41477.3.5.247.108.0");
        //供电方式
        oIdList.add(".1.3.6.1.4.1.41477.3.5.250.84.0");
        //电池自检
        oIdList.add(".1.3.6.1.4.1.41477.3.5.250.86.0");
        //电池充电状态
        oIdList.add(".1.3.6.1.4.1.41477.3.5.250.87.0");
        //逆变器开/关机状态
        oIdList.add(".1.3.6.1.4.1.41477.3.5.250.88.0");
        //整流器供电状态
        oIdList.add(".1.3.6.1.4.1.41477.3.5.250.89.0");
        //发电机接入状态
        oIdList.add(".1.3.6.1.4.1.41477.3.5.250.90.0");
        //输入空开状态
        oIdList.add(".1.3.6.1.4.1.41477.3.5.250.91.0");
        //维修空开状态
        oIdList.add(".1.3.6.1.4.1.41477.3.5.250.92.0");
        //旁路空开状态
        oIdList.add(".1.3.6.1.4.1.41477.3.5.250.93.0");
        //输出空开状态
        oIdList.add(".1.3.6.1.4.1.41477.3.5.250.94.0");
        //整机工作模式
        oIdList.add(".1.3.6.1.4.1.41477.3.5.250.95.0");
        //并机系统供电状态
        oIdList.add(".1.3.6.1.4.1.41477.3.5.250.96.0");
        //模块1在线状态
        oIdList.add(".1.3.6.1.4.1.41477.3.5.250.97.0");
        //模块2在线状态
        oIdList.add(".1.3.6.1.4.1.41477.3.5.250.98.0");
        //模块3在线状态
        oIdList.add(".1.3.6.1.4.1.41477.3.5.250.99.0");
        //模块4在线状态
        oIdList.add(".1.3.6.1.4.1.41477.3.5.250.100.0");
        //模块5在线状态
        oIdList.add(".1.3.6.1.4.1.41477.3.5.250.101.0");
        //模块6在线状态
        oIdList.add(".1.3.6.1.4.1.41477.3.5.250.102.0");
        //模块7在线状态
        oIdList.add(".1.3.6.1.4.1.41477.3.5.250.103.0");
        //模块8在线状态
        oIdList.add(".1.3.6.1.4.1.41477.3.5.250.104.0");
        //模块9在线状态
        oIdList.add(".1.3.6.1.4.1.41477.3.5.250.105.0");
        //模块10在线状态
        oIdList.add(".1.3.6.1.4.1.41477.3.5.250.106.0");
        //模块11在线状态
        oIdList.add(".1.3.6.1.4.1.41477.3.5.250.107.0");
        //模块12在线状态
        oIdList.add(".1.3.6.1.4.1.41477.3.5.250.108.0");
 
        return oIdList;
    }
 
    private List<String> getAlarmOIDList() {
        List<String> oIdList = new LinkedList<>();
        //逆变器同步/不同步
        oIdList.add(".1.3.6.1.4.1.41477.3.5.247.110.0");
        //主路电压
        oIdList.add(".1.3.6.1.4.1.41477.3.5.247.111.0");
        //整流器
        oIdList.add(".1.3.6.1.4.1.41477.3.5.247.112.0");
        //逆变
        oIdList.add(".1.3.6.1.4.1.41477.3.5.247.113.0");
        //旁路
        oIdList.add(".1.3.6.1.4.1.41477.3.5.247.114.0");
        //电池
        oIdList.add(".1.3.6.1.4.1.41477.3.5.247.115.0");
        //ParaMonCAN通讯
        oIdList.add(".1.3.6.1.4.1.41477.3.5.247.118.0");
        //PowerCAN通讯
        oIdList.add(".1.3.6.1.4.1.41477.3.5.247.119.0");
        //整流DSP程序
        oIdList.add(".1.3.6.1.4.1.41477.3.5.247.120.0");
        //整流FPGA程序
        oIdList.add(".1.3.6.1.4.1.41477.3.5.247.121.0");
        //逆变DSP程序
        oIdList.add(".1.3.6.1.4.1.41477.3.5.247.122.0");
        //逆变FPGA程序
        oIdList.add(".1.3.6.1.4.1.41477.3.5.247.123.0");
        //旁路DSP程序
        oIdList.add(".1.3.6.1.4.1.41477.3.5.247.124.0");
        //旁路FPGA程序
        oIdList.add(".1.3.6.1.4.1.41477.3.5.247.125.0");
        //机架内离散总线通讯
        oIdList.add(".1.3.6.1.4.1.41477.3.5.247.126.0");
        //机架间离散总线通讯
        oIdList.add(".1.3.6.1.4.1.41477.3.5.247.127.0");
        //主控模块设置
        oIdList.add(".1.3.6.1.4.1.41477.3.5.247.132.0");
        //LBS
        oIdList.add(".1.3.6.1.4.1.41477.3.5.247.133.0");
        //紧急关机状态
        oIdList.add(".1.3.6.1.4.1.41477.3.5.247.134.0");
        //旁路晶闸管
        oIdList.add(".1.3.6.1.4.1.41477.3.5.247.135.0");
        //旁路相序反
        oIdList.add(".1.3.6.1.4.1.41477.3.5.247.136.0");
        //旁路过流
        oIdList.add(".1.3.6.1.4.1.41477.3.5.247.137.0");
        //旁路异常关机
        oIdList.add(".1.3.6.1.4.1.41477.3.5.247.138.0");
        //切换次数
        oIdList.add(".1.3.6.1.4.1.41477.3.5.247.139.0");
        //ECO切换次数
        oIdList.add(".1.3.6.1.4.1.41477.3.5.247.140.0");
        //ParaPowerCAN通讯
        oIdList.add(".1.3.6.1.4.1.41477.3.5.247.141.0");
        //电池放电
        oIdList.add(".1.3.6.1.4.1.41477.3.5.247.142.0");
        //放电器
        oIdList.add(".1.3.6.1.4.1.41477.3.5.247.143.0");
        //充电器
        oIdList.add(".1.3.6.1.4.1.41477.3.5.247.144.0");
        //LBS连接线
        oIdList.add(".1.3.6.1.4.1.41477.3.5.247.145.0");
        //电池维护
        oIdList.add(".1.3.6.1.4.1.41477.3.5.247.146.0");
        //电池温度
        oIdList.add(".1.3.6.1.4.1.41477.3.5.247.147.0");
        //电池接地
        oIdList.add(".1.3.6.1.4.1.41477.3.5.247.148.0");
        //主路频率
        oIdList.add(".1.3.6.1.4.1.41477.3.5.247.149.0");
        //模块温度
        oIdList.add(".1.3.6.1.4.1.41477.3.5.247.150.0");
        //从控模块设置
        oIdList.add(".1.3.6.1.4.1.41477.3.5.247.151.0");
        //接口模块设置
        oIdList.add(".1.3.6.1.4.1.41477.3.5.247.152.0");
        //均充时间
        oIdList.add(".1.3.6.1.4.1.41477.3.5.247.153.0");
        //辅助电源
        oIdList.add(".1.3.6.1.4.1.41477.3.5.247.154.0");
        //主路相序反
        oIdList.add(".1.3.6.1.4.1.41477.3.5.247.155.0");
        //整流器软启动
        oIdList.add(".1.3.6.1.4.1.41477.3.5.247.156.0");
        //用户操作
        oIdList.add(".1.3.6.1.4.1.41477.3.5.247.157.0");
        //输出熔丝
        oIdList.add(".1.3.6.1.4.1.41477.3.5.247.158.0");
        //输出过载
        oIdList.add(".1.3.6.1.4.1.41477.3.5.247.159.0");
        //系统过载
        oIdList.add(".1.3.6.1.4.1.41477.3.5.247.160.0");
        //输出过载超时
        oIdList.add(".1.3.6.1.4.1.41477.3.5.247.161.0");
        //负载冲击转旁路
        oIdList.add(".1.3.6.1.4.1.41477.3.5.247.162.0");
        //并机均流
        oIdList.add(".1.3.6.1.4.1.41477.3.5.247.163.0");
        //母线异常关机
        oIdList.add(".1.3.6.1.4.1.41477.3.5.247.164.0");
        //邻机请求转旁路
        oIdList.add(".1.3.6.1.4.1.41477.3.5.247.165.0");
        //直流母线过压
        oIdList.add(".1.3.6.1.4.1.41477.3.5.247.166.0");
        //MonCAN通讯
        oIdList.add(".1.3.6.1.4.1.41477.3.5.247.167.0");
        //输入缺零故障
        oIdList.add(".1.3.6.1.4.1.41477.3.5.247.168.0");
        //逆变继电器
        oIdList.add(".1.3.6.1.4.1.41477.3.5.247.169.0");
        //主路反灌
        oIdList.add(".1.3.6.1.4.1.41477.3.5.247.170.0");
        //输入电流异常
        oIdList.add(".1.3.6.1.4.1.41477.3.5.247.171.0");
        //输出电压异常
        oIdList.add(".1.3.6.1.4.1.41477.3.5.247.172.0");
        //输入电流超限
        oIdList.add(".1.3.6.1.4.1.41477.3.5.247.173.0");
        //旁路过温
        oIdList.add(".1.3.6.1.4.1.41477.3.5.247.174.0");
        //邻机旁路晶闸管
        oIdList.add(".1.3.6.1.4.1.41477.3.5.247.175.0");
        //并机连接线
        oIdList.add(".1.3.6.1.4.1.41477.3.5.247.176.0");
        //充电器温度
        oIdList.add(".1.3.6.1.4.1.41477.3.5.247.177.0");
        //电池端口短路
        oIdList.add(".1.3.6.1.4.1.41477.3.5.247.178.0");
        //电池房环境异常
        oIdList.add(".1.3.6.1.4.1.41477.3.5.247.179.0");
        //风扇异常
        oIdList.add(".1.3.6.1.4.1.41477.3.5.247.180.0");
        //旁路缺零故障
        oIdList.add(".1.3.6.1.4.1.41477.3.5.247.181.0");
        //旁路接管
        oIdList.add(".1.3.6.1.4.1.41477.3.5.247.182.0");
        //BCB1状态异常
        oIdList.add(".1.3.6.1.4.1.41477.3.5.247.183.0");
        //BCB2状态异常
        oIdList.add(".1.3.6.1.4.1.41477.3.5.247.184.0");
        //BCB3状态异常
        oIdList.add(".1.3.6.1.4.1.41477.3.5.247.185.0");
        //BCB4状态异常
        oIdList.add(".1.3.6.1.4.1.41477.3.5.247.186.0");
        //旁路SCR风扇
        oIdList.add(".1.3.6.1.4.1.41477.3.5.247.187.0");
        //平衡电路故障
        oIdList.add(".1.3.6.1.4.1.41477.3.5.247.188.0");
        //平衡电路过流
        oIdList.add(".1.3.6.1.4.1.41477.3.5.247.189.0");
        //平衡电路过温
        oIdList.add(".1.3.6.1.4.1.41477.3.5.247.190.0");
        //失去冗余
        oIdList.add(".1.3.6.1.4.1.41477.3.5.247.191.0");
        //容量过载
        oIdList.add(".1.3.6.1.4.1.41477.3.5.247.192.0");
        //功率板设置
        oIdList.add(".1.3.6.1.4.1.41477.3.5.247.193.0");
        //旁路设置
        oIdList.add(".1.3.6.1.4.1.41477.3.5.247.194.0");
        //上抽风风扇
        oIdList.add(".1.3.6.1.4.1.41477.3.5.247.195.0");
        //系统A相输出熔丝
        oIdList.add(".1.3.6.1.4.1.41477.3.5.247.196.0");
        //系统B相输出熔丝
        oIdList.add(".1.3.6.1.4.1.41477.3.5.247.197.0");
        //系统C相输出熔丝
        oIdList.add(".1.3.6.1.4.1.41477.3.5.247.198.0");
        //旁路无效
        oIdList.add(".1.3.6.1.4.1.41477.3.5.247.199.0");
        //整流器过流
        oIdList.add(".1.3.6.1.4.1.41477.3.5.247.200.0");
        //旁路过流超时
        oIdList.add(".1.3.6.1.4.1.41477.3.5.247.201.0");
        //输出零地过压
        oIdList.add(".1.3.6.1.4.1.41477.3.5.247.202.0");
        //输入熔丝断
        oIdList.add(".1.3.6.1.4.1.41477.3.5.247.203.0");
        //旁路熔丝断
        oIdList.add(".1.3.6.1.4.1.41477.3.5.247.204.0");
        //逆变器同步/不同步
        oIdList.add(".1.3.6.1.4.1.41477.3.5.250.110.0");
        //主路电压
        oIdList.add(".1.3.6.1.4.1.41477.3.5.250.111.0");
        //整流器
        oIdList.add(".1.3.6.1.4.1.41477.3.5.250.112.0");
        //逆变
        oIdList.add(".1.3.6.1.4.1.41477.3.5.250.113.0");
        //旁路
        oIdList.add(".1.3.6.1.4.1.41477.3.5.250.114.0");
        //电池
        oIdList.add(".1.3.6.1.4.1.41477.3.5.250.115.0");
        //ParaMonCAN通讯
        oIdList.add(".1.3.6.1.4.1.41477.3.5.250.118.0");
        //PowerCAN通讯
        oIdList.add(".1.3.6.1.4.1.41477.3.5.250.119.0");
        //整流DSP程序
        oIdList.add(".1.3.6.1.4.1.41477.3.5.250.120.0");
        //整流FPGA程序
        oIdList.add(".1.3.6.1.4.1.41477.3.5.250.121.0");
        //逆变DSP程序
        oIdList.add(".1.3.6.1.4.1.41477.3.5.250.122.0");
        //逆变FPGA程序
        oIdList.add(".1.3.6.1.4.1.41477.3.5.250.123.0");
        //旁路DSP程序
        oIdList.add(".1.3.6.1.4.1.41477.3.5.250.124.0");
        //旁路FPGA程序
        oIdList.add(".1.3.6.1.4.1.41477.3.5.250.125.0");
        //机架内离散总线通讯
        oIdList.add(".1.3.6.1.4.1.41477.3.5.250.126.0");
        //机架间离散总线通讯
        oIdList.add(".1.3.6.1.4.1.41477.3.5.250.127.0");
        //主控模块设置
        oIdList.add(".1.3.6.1.4.1.41477.3.5.250.132.0");
        //LBS
        oIdList.add(".1.3.6.1.4.1.41477.3.5.250.133.0");
        //紧急关机状态
        oIdList.add(".1.3.6.1.4.1.41477.3.5.250.134.0");
        //旁路晶闸管
        oIdList.add(".1.3.6.1.4.1.41477.3.5.250.135.0");
        //旁路相序反
        oIdList.add(".1.3.6.1.4.1.41477.3.5.250.136.0");
        //旁路过流
        oIdList.add(".1.3.6.1.4.1.41477.3.5.250.137.0");
        //旁路异常关机
        oIdList.add(".1.3.6.1.4.1.41477.3.5.250.138.0");
        //切换次数
        oIdList.add(".1.3.6.1.4.1.41477.3.5.250.139.0");
        //ECO切换次数
        oIdList.add(".1.3.6.1.4.1.41477.3.5.250.140.0");
        //ParaPowerCAN通讯
        oIdList.add(".1.3.6.1.4.1.41477.3.5.250.141.0");
        //电池放电
        oIdList.add(".1.3.6.1.4.1.41477.3.5.250.142.0");
        //放电器
        oIdList.add(".1.3.6.1.4.1.41477.3.5.250.143.0");
        //充电器
        oIdList.add(".1.3.6.1.4.1.41477.3.5.250.144.0");
        //LBS连接线
        oIdList.add(".1.3.6.1.4.1.41477.3.5.250.145.0");
        //电池维护
        oIdList.add(".1.3.6.1.4.1.41477.3.5.250.146.0");
        //电池温度
        oIdList.add(".1.3.6.1.4.1.41477.3.5.250.147.0");
        //电池接地
        oIdList.add(".1.3.6.1.4.1.41477.3.5.250.148.0");
        //主路频率
        oIdList.add(".1.3.6.1.4.1.41477.3.5.250.149.0");
        //模块温度
        oIdList.add(".1.3.6.1.4.1.41477.3.5.250.150.0");
        //从控模块设置
        oIdList.add(".1.3.6.1.4.1.41477.3.5.250.151.0");
        //接口模块设置
        oIdList.add(".1.3.6.1.4.1.41477.3.5.250.152.0");
        //均充时间
        oIdList.add(".1.3.6.1.4.1.41477.3.5.250.153.0");
        //辅助电源
        oIdList.add(".1.3.6.1.4.1.41477.3.5.250.154.0");
        //主路相序反
        oIdList.add(".1.3.6.1.4.1.41477.3.5.250.155.0");
        //整流器软启动
        oIdList.add(".1.3.6.1.4.1.41477.3.5.250.156.0");
        //用户操作
        oIdList.add(".1.3.6.1.4.1.41477.3.5.250.157.0");
        //输出熔丝
        oIdList.add(".1.3.6.1.4.1.41477.3.5.250.158.0");
        //输出过载
        oIdList.add(".1.3.6.1.4.1.41477.3.5.250.159.0");
        //系统过载
        oIdList.add(".1.3.6.1.4.1.41477.3.5.250.160.0");
        //输出过载超时
        oIdList.add(".1.3.6.1.4.1.41477.3.5.250.161.0");
        //负载冲击转旁路
        oIdList.add(".1.3.6.1.4.1.41477.3.5.250.162.0");
        //并机均流
        oIdList.add(".1.3.6.1.4.1.41477.3.5.250.163.0");
        //母线异常关机
        oIdList.add(".1.3.6.1.4.1.41477.3.5.250.164.0");
        //邻机请求转旁路
        oIdList.add(".1.3.6.1.4.1.41477.3.5.250.165.0");
        //直流母线过压
        oIdList.add(".1.3.6.1.4.1.41477.3.5.250.166.0");
        //MonCAN通讯
        oIdList.add(".1.3.6.1.4.1.41477.3.5.250.167.0");
        //输入缺零故障
        oIdList.add(".1.3.6.1.4.1.41477.3.5.250.168.0");
        //逆变继电器
        oIdList.add(".1.3.6.1.4.1.41477.3.5.250.169.0");
        //主路反灌
        oIdList.add(".1.3.6.1.4.1.41477.3.5.250.170.0");
        //输入电流异常
        oIdList.add(".1.3.6.1.4.1.41477.3.5.250.171.0");
        //输出电压异常
        oIdList.add(".1.3.6.1.4.1.41477.3.5.250.172.0");
        //输入电流超限
        oIdList.add(".1.3.6.1.4.1.41477.3.5.250.173.0");
        //旁路过温
        oIdList.add(".1.3.6.1.4.1.41477.3.5.250.174.0");
        //邻机旁路晶闸管
        oIdList.add(".1.3.6.1.4.1.41477.3.5.250.175.0");
        //并机连接线
        oIdList.add(".1.3.6.1.4.1.41477.3.5.250.176.0");
        //充电器温度
        oIdList.add(".1.3.6.1.4.1.41477.3.5.250.177.0");
        //电池端口短路
        oIdList.add(".1.3.6.1.4.1.41477.3.5.250.178.0");
        //电池房环境异常
        oIdList.add(".1.3.6.1.4.1.41477.3.5.250.179.0");
        //风扇异常
        oIdList.add(".1.3.6.1.4.1.41477.3.5.250.180.0");
        //旁路缺零故障
        oIdList.add(".1.3.6.1.4.1.41477.3.5.250.181.0");
        //旁路接管
        oIdList.add(".1.3.6.1.4.1.41477.3.5.250.182.0");
        //BCB1状态异常
        oIdList.add(".1.3.6.1.4.1.41477.3.5.250.183.0");
        //BCB2状态异常
        oIdList.add(".1.3.6.1.4.1.41477.3.5.250.184.0");
        //BCB3状态异常
        oIdList.add(".1.3.6.1.4.1.41477.3.5.250.185.0");
        //BCB4状态异常
        oIdList.add(".1.3.6.1.4.1.41477.3.5.250.186.0");
        //旁路SCR风扇
        oIdList.add(".1.3.6.1.4.1.41477.3.5.250.187.0");
        //平衡电路故障
        oIdList.add(".1.3.6.1.4.1.41477.3.5.250.188.0");
        //平衡电路过流
        oIdList.add(".1.3.6.1.4.1.41477.3.5.250.189.0");
        //平衡电路过温
        oIdList.add(".1.3.6.1.4.1.41477.3.5.250.190.0");
        //失去冗余
        oIdList.add(".1.3.6.1.4.1.41477.3.5.250.191.0");
        //容量过载
        oIdList.add(".1.3.6.1.4.1.41477.3.5.250.192.0");
        //功率板设置
        oIdList.add(".1.3.6.1.4.1.41477.3.5.250.193.0");
        //旁路设置
        oIdList.add(".1.3.6.1.4.1.41477.3.5.250.194.0");
        //上抽风风扇
        oIdList.add(".1.3.6.1.4.1.41477.3.5.250.195.0");
        //系统A相输出熔丝
        oIdList.add(".1.3.6.1.4.1.41477.3.5.250.196.0");
        //系统B相输出熔丝
        oIdList.add(".1.3.6.1.4.1.41477.3.5.250.197.0");
        //系统C相输出熔丝
        oIdList.add(".1.3.6.1.4.1.41477.3.5.250.198.0");
        //旁路无效
        oIdList.add(".1.3.6.1.4.1.41477.3.5.250.199.0");
        //整流器过流
        oIdList.add(".1.3.6.1.4.1.41477.3.5.250.200.0");
        //旁路过流超时
        oIdList.add(".1.3.6.1.4.1.41477.3.5.250.201.0");
        //输出零地过压
        oIdList.add(".1.3.6.1.4.1.41477.3.5.250.202.0");
        //输入熔丝断
        oIdList.add(".1.3.6.1.4.1.41477.3.5.250.203.0");
        //旁路熔丝断
        oIdList.add(".1.3.6.1.4.1.41477.3.5.250.204.0");
        return oIdList;
    }
 
    public void getAndSaveB247(){
        List<String> oidListAll = Constant_SNMP_OID_B_247.getOidListAll();
        /*List<String> oIdList = new LinkedList<>();
        oIdList.add(".1.3.6.1.2.1.1.3.0");
        oIdList.add(".1.3.6.1.2.1.1.1.0");
        oIdList.add(".1.3.6.1.4.1.1.1.0");*/
 
        PDU pdu = new PDU();
        for (String oId : oidListAll) {
            OID oid = new OID(oId);
            pdu.add(new VariableBinding(oid));
        }
        pdu.setType(PDU.GET);
        try {
            ResponseEvent responseEvent = snmp.send(pdu, target);
            PDU pduBack = responseEvent.getResponse();
            //处理返回数据
            Vector<? extends VariableBinding> bindings = pduBack.getVariableBindings();
 
            List<UpsPowerAlarm> alarmListInDB = alarmService.getListByDeviceId(116000247);
            Map<String, Object> dataMap = Constant_SNMP_OID_B_247.assembleBindings(bindings, alarmListInDB);
 
            UpsPowerSignal signal = (UpsPowerSignal) dataMap.get("signal");
            UpsPowerSimulate simulate = (UpsPowerSimulate) dataMap.get("simulate");
            List<UpsPowerAlarm> alarmAddList = (List<UpsPowerAlarm>) dataMap.get("alarmAddList");
            List<UpsPowerAlarm> alarmRemoveList = (List<UpsPowerAlarm>) dataMap.get("alarmRemoveList");
            List<UpsPowerAlarmHistory> alarmHistoryAddList = (List<UpsPowerAlarmHistory>) dataMap.get("alarmHistoryAddList");
 
            List<UpsPowerSignal> signalListInDB = signalService.getList();
            List<UpsPowerSimulate> simulateListInDB = simulateService.getList();
            List<Integer> signalDeviceIdList = signalListInDB.stream().map(UpsPowerSignal::getPowerDeviceId).collect(Collectors.toList());
            List<Integer> simulateDeviceIdList = simulateListInDB.stream().map(UpsPowerSimulate::getPowerDeviceId).collect(Collectors.toList());
 
            if(signalDeviceIdList.contains(signal.getPowerDeviceId())){ //存在,更新
                signalService.update(signal);
            }else{
                signalService.add(signal);
            }
 
            if(simulateDeviceIdList.contains(simulate.getPowerDeviceId())){ //存在,更新
                simulateService.update(simulate);
            }else{
                simulateService.add(simulate);
            }
 
            if(alarmRemoveList.size()>0) {
                alarmService.removeList(alarmRemoveList.stream().map(UpsPowerAlarm::getNum).collect(Collectors.toList()));
            }
            if(alarmAddList.size()>0) {
                alarmService.addBatch(alarmAddList);
            }
            if(alarmHistoryAddList.size()>0) {
                alarmHistoryService.addBatch(alarmHistoryAddList);
            }
 
            /*for (VariableBinding binding : bindings) {
                OID oid = binding.getOid();
                String oidStr = oid.toString();
                Variable variable = binding.getVariable();
                if(variable instanceof Null) {
                    System.out.println("是null");
                    String value = binding.getVariable().toString();
                    System.out.println(value);
                }
 
            }*/
        }catch (Exception e){
            //e.printStackTrace();
        }
 
    }
 
    public void getAndSaveA250(){
        List<String> oidListAll = Constant_SNMP_OID_A_250.getOidListAll();
        /*List<String> oIdList = new LinkedList<>();
        oIdList.add(".1.3.6.1.2.1.1.3.0");
        oIdList.add(".1.3.6.1.2.1.1.1.0");
        oIdList.add(".1.3.6.1.4.1.1.1.0");*/
 
        PDU pdu = new PDU();
        for (String oId : oidListAll) {
            OID oid = new OID(oId);
            pdu.add(new VariableBinding(oid));
        }
        pdu.setType(PDU.GET);
        try {
            ResponseEvent responseEvent = snmp.send(pdu, target);
            PDU pduBack = responseEvent.getResponse();
            //处理返回数据
            Vector<? extends VariableBinding> bindings = pduBack.getVariableBindings();
 
            List<UpsPowerAlarm> alarmListInDB = alarmService.getListByDeviceId(116000250);
            Map<String, Object> dataMap = Constant_SNMP_OID_A_250.assembleBindings(bindings, alarmListInDB);
 
            UpsPowerSignal signal = (UpsPowerSignal) dataMap.get("signal");
            UpsPowerSimulate simulate = (UpsPowerSimulate) dataMap.get("simulate");
            List<UpsPowerAlarm> alarmAddList = (List<UpsPowerAlarm>) dataMap.get("alarmAddList");
            List<UpsPowerAlarm> alarmRemoveList = (List<UpsPowerAlarm>) dataMap.get("alarmRemoveList");
            List<UpsPowerAlarmHistory> alarmHistoryAddList = (List<UpsPowerAlarmHistory>) dataMap.get("alarmHistoryAddList");
 
            List<UpsPowerSignal> signalListInDB = signalService.getList();
            List<UpsPowerSimulate> simulateListInDB = simulateService.getList();
            List<Integer> signalDeviceIdList = signalListInDB.stream().map(UpsPowerSignal::getPowerDeviceId).collect(Collectors.toList());
            List<Integer> simulateDeviceIdList = simulateListInDB.stream().map(UpsPowerSimulate::getPowerDeviceId).collect(Collectors.toList());
 
            if(signalDeviceIdList.contains(signal.getPowerDeviceId())){ //存在,更新
                signalService.update(signal);
            }else{
                signalService.add(signal);
            }
 
            if(simulateDeviceIdList.contains(simulate.getPowerDeviceId())){ //存在,更新
                simulateService.update(simulate);
            }else{
                simulateService.add(simulate);
            }
 
            if(alarmRemoveList.size()>0) {
                alarmService.removeList(alarmRemoveList.stream().map(UpsPowerAlarm::getNum).collect(Collectors.toList()));
            }
            if(alarmAddList.size()>0) {
                alarmService.addBatch(alarmAddList);
            }
            if(alarmHistoryAddList.size()>0) {
                alarmHistoryService.addBatch(alarmHistoryAddList);
            }
 
            /*for (VariableBinding binding : bindings) {
                OID oid = binding.getOid();
                String oidStr = oid.toString();
                Variable variable = binding.getVariable();
                if(variable instanceof Null) {
                    System.out.println("是null");
                    String value = binding.getVariable().toString();
                    System.out.println(value);
                }
 
            }*/
        }catch (Exception e){
            //e.printStackTrace();
        }
 
    }
 
}