Merge branch 'master' of http://118.89.139.230:10101/r/powerIntelligenceSystem into master
# Conflicts:
# src/main/java/com/whyc/service/StationInfService.java
1 文件已重命名
44个文件已修改
2个文件已删除
105个文件已添加
| | |
| | | <artifactId>spring-context-support</artifactId> |
| | | <version>5.3.9</version> |
| | | </dependency> |
| | | <!--poi--> |
| | | <dependency> |
| | | <groupId>org.apache.poi</groupId> |
| | | <artifactId>poi-ooxml</artifactId> |
| | | <version>3.10.1</version> |
| | | </dependency> |
| | | |
| | | <!--<dependency> |
| | | <groupId>org.springframework.plugin</groupId> |
New file |
| | |
| | | package com.whyc.constant; |
| | | |
| | | import java.util.HashMap; |
| | | import java.util.Map; |
| | | |
| | | public enum BattAlarmIdEnum { |
| | | ALARM_119001(119001,"在线电压告警"), |
| | | ALARM_119002(119002,"组端电压告警"), |
| | | ALARM_119003(119003,"充电电流告警"), |
| | | ALARM_119004(119004,"放电电流告警"), |
| | | ALARM_119005(119005,"单体电压告警"), |
| | | ALARM_119006(119006,"单体温度告警"), |
| | | ALARM_119007(119007,"单体内阻告警") |
| | | ; |
| | | |
| | | private Integer stateId; |
| | | private String stateName; |
| | | |
| | | BattAlarmIdEnum(Integer stateId, String stateName) { |
| | | this.stateId = stateId; |
| | | this.stateName = stateName; |
| | | } |
| | | |
| | | public Integer getStateId() { |
| | | return stateId; |
| | | } |
| | | |
| | | public String getStateName() { |
| | | return stateName; |
| | | } |
| | | |
| | | public static String getValue(Integer stateId) { |
| | | if(stateId==null){ |
| | | return ""; |
| | | } |
| | | for (BattAlarmIdEnum ele : values()) { |
| | | if(ele.getStateId().equals(stateId)) { |
| | | return ele.getStateName(); |
| | | } |
| | | } |
| | | return null; |
| | | } |
| | | public static Map<Integer,String> getOpInfo() { |
| | | Map<Integer,String> map=new HashMap<>(); |
| | | for (BattAlarmIdEnum logOpEnum : BattAlarmIdEnum.values()) { |
| | | map.put(logOpEnum.getStateId(),logOpEnum.getStateName()); |
| | | } |
| | | return map; |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | package com.whyc.constant; |
| | | |
| | | public enum BattSingalIdEnum { |
| | | ALARM_1(1,"在线电压上上限告警"), |
| | | ALARM_2(2,"在线电压上限告警"), |
| | | ALARM_3(3,"在线电压下限告警"), |
| | | ALARM_4(4,"在线电压下下限告警"), |
| | | ALARM_5(5,"组端电压上上限告警"), |
| | | ALARM_6(6,"组端电压上限告警"), |
| | | ALARM_7(7,"组端电压下限告警"), |
| | | ALARM_8(8,"组端电压下下限告警"), |
| | | ALARM_9(9,"充电电流上上限告警"), |
| | | ALARM_10(10,"充电电流上限告警"), |
| | | ALARM_11(11,"充电电流下限告警"), |
| | | ALARM_12(12,"充电电流下下限告警"), |
| | | ALARM_13(13,"放电电流上上限告警"), |
| | | ALARM_14(14,"放电电流上限告警"), |
| | | ALARM_15(15,"放电电流下限告警"), |
| | | ALARM_16(16,"放电电流下下限告警"), |
| | | ALARM_17(17,"单体电压上上限告警"), |
| | | ALARM_18(18,"单体电压上限告警"), |
| | | ALARM_19(19,"单体电压下限告警"), |
| | | ALARM_20(20,"单体电压下下限告警"), |
| | | ALARM_21(21,"单体温度上上限告警"), |
| | | ALARM_22(22,"单体温度上限告警"), |
| | | ALARM_23(23,"单体温度下限告警"), |
| | | ALARM_24(24,"单体温度下下限告警"), |
| | | ALARM_25(25,"单体内阻上上限告警"), |
| | | ALARM_26(26,"单体内阻上限告警"), |
| | | ALARM_27(27,"单体内阻下限告警"), |
| | | ALARM_28(28,"单体内阻下下限告警"), |
| | | ; |
| | | |
| | | private Integer stateId; |
| | | private String stateName; |
| | | |
| | | BattSingalIdEnum(Integer stateId, String stateName) { |
| | | this.stateId = stateId; |
| | | this.stateName = stateName; |
| | | } |
| | | |
| | | public Integer getStateId() { |
| | | return stateId; |
| | | } |
| | | |
| | | public String getStateName() { |
| | | return stateName; |
| | | } |
| | | |
| | | public static String getValue(Integer stateId) { |
| | | if(stateId==null){ |
| | | return ""; |
| | | } |
| | | for (BattSingalIdEnum ele : values()) { |
| | | if(ele.getStateId().equals(stateId)) { |
| | | return ele.getStateName(); |
| | | } |
| | | } |
| | | return null; |
| | | } |
| | | } |
New file |
| | |
| | | package com.whyc.constant; |
| | | |
| | | import java.util.HashMap; |
| | | import java.util.Map; |
| | | |
| | | public enum BattStateEnum { |
| | | BATTSTATE_0(0,"未知"), |
| | | BATTSTATE_1(1,"浮充"), |
| | | BATTSTATE_2(2,"充电"), |
| | | BATTSTATE_3(3,"放电"), |
| | | BATTSTATE_4(4,"内阻测试") |
| | | ; |
| | | |
| | | private Integer stateId; |
| | | private String stateName; |
| | | |
| | | BattStateEnum(Integer stateId, String stateName) { |
| | | this.stateId = stateId; |
| | | this.stateName = stateName; |
| | | } |
| | | |
| | | public Integer getStateId() { |
| | | return stateId; |
| | | } |
| | | |
| | | public String getStateName() { |
| | | return stateName; |
| | | } |
| | | |
| | | public static String getValue(Integer stateId) { |
| | | if(stateId==null){ |
| | | return ""; |
| | | } |
| | | for (BattStateEnum ele : values()) { |
| | | if(ele.getStateId().equals(stateId)) { |
| | | return ele.getStateName(); |
| | | } |
| | | } |
| | | return null; |
| | | } |
| | | public static Map<Integer,String> getOpInfo() { |
| | | Map<Integer,String> map=new HashMap<>(); |
| | | for (BattStateEnum logOpEnum : BattStateEnum.values()) { |
| | | map.put(logOpEnum.getStateId(),logOpEnum.getStateName()); |
| | | } |
| | | return map; |
| | | } |
| | | } |
New file |
| | |
| | | package com.whyc.constant; |
| | | |
| | | import java.util.HashMap; |
| | | import java.util.Map; |
| | | |
| | | public enum Capperformance { |
| | | BATTSTATE_1(1,"优秀"), |
| | | BATTSTATE_2(2,"劣化"), |
| | | BATTSTATE_3(3,"损坏"), |
| | | BATTSTATE_4(4,"未放电"), |
| | | ; |
| | | |
| | | private Integer stateId; |
| | | private String stateName; |
| | | |
| | | Capperformance(Integer stateId, String stateName) { |
| | | this.stateId = stateId; |
| | | this.stateName = stateName; |
| | | } |
| | | |
| | | public Integer getStateId() { |
| | | return stateId; |
| | | } |
| | | |
| | | public String getStateName() { |
| | | return stateName; |
| | | } |
| | | |
| | | public static String getValue(Integer stateId) { |
| | | if(stateId==null){ |
| | | return ""; |
| | | } |
| | | for (Capperformance ele : values()) { |
| | | if(ele.getStateId().equals(stateId)) { |
| | | return ele.getStateName(); |
| | | } |
| | | } |
| | | return null; |
| | | } |
| | | public static Map<Integer,String> getOpInfo() { |
| | | Map<Integer,String> map=new HashMap<>(); |
| | | for (Capperformance logOpEnum : Capperformance.values()) { |
| | | map.put(logOpEnum.getStateId(),logOpEnum.getStateName()); |
| | | } |
| | | return map; |
| | | } |
| | | } |
New file |
| | |
| | | package com.whyc.constant; |
| | | |
| | | import java.util.HashMap; |
| | | import java.util.Map; |
| | | |
| | | public enum ChargeTypeEnum { |
| | | ChargeType_1(1,"已放电"), |
| | | ChargeTyp_2(2,"未放电"), |
| | | ; |
| | | |
| | | private Integer stateId; |
| | | private String stateName; |
| | | |
| | | ChargeTypeEnum(Integer stateId, String stateName) { |
| | | this.stateId = stateId; |
| | | this.stateName = stateName; |
| | | } |
| | | |
| | | public Integer getStateId() { |
| | | return stateId; |
| | | } |
| | | |
| | | public String getStateName() { |
| | | return stateName; |
| | | } |
| | | |
| | | public static String getValue(Integer stateId) { |
| | | if(stateId==null){ |
| | | return ""; |
| | | } |
| | | for (ChargeTypeEnum ele : values()) { |
| | | if(ele.getStateId().equals(stateId)) { |
| | | return ele.getStateName(); |
| | | } |
| | | } |
| | | return null; |
| | | } |
| | | public static Map<Integer,String> getOpInfo() { |
| | | Map<Integer,String> map=new HashMap<>(); |
| | | for (ChargeTypeEnum logOpEnum : ChargeTypeEnum.values()) { |
| | | map.put(logOpEnum.getStateId(),logOpEnum.getStateName()); |
| | | } |
| | | return map; |
| | | } |
| | | } |
New file |
| | |
| | | package com.whyc.constant; |
| | | |
| | | import java.util.HashMap; |
| | | import java.util.Map; |
| | | |
| | | public enum DevAlarmEnum { |
| | | ALARM_119020(119020,"通信故障"), |
| | | ALARM_119021(119021,"设备高温告警"), |
| | | ALARM_618501(618501,"继电器告警"), |
| | | ALARM_618502(618502,"汇集器通讯故障告警"), |
| | | ALARM_618503(618503,"设备过温告警"), |
| | | ALARM_618504(618504,"二极管D1告警"), |
| | | ALARM_618505(618505,"干接点告警") |
| | | ; |
| | | |
| | | private Integer stateId; |
| | | private String stateName; |
| | | |
| | | DevAlarmEnum(Integer stateId, String stateName) { |
| | | this.stateId = stateId; |
| | | this.stateName = stateName; |
| | | } |
| | | |
| | | public Integer getStateId() { |
| | | return stateId; |
| | | } |
| | | |
| | | public String getStateName() { |
| | | return stateName; |
| | | } |
| | | |
| | | public static String getValue(Integer stateId) { |
| | | if(stateId==null){ |
| | | return ""; |
| | | } |
| | | for (DevAlarmEnum ele : values()) { |
| | | if(ele.getStateId().equals(stateId)) { |
| | | return ele.getStateName(); |
| | | } |
| | | } |
| | | return null; |
| | | } |
| | | public static Map<Integer,String> getOpInfo() { |
| | | Map<Integer,String> map=new HashMap<>(); |
| | | for (DevAlarmEnum logOpEnum : DevAlarmEnum.values()) { |
| | | map.put(logOpEnum.getStateId(),logOpEnum.getStateName()); |
| | | } |
| | | return map; |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | package com.whyc.constant; |
| | | |
| | | |
| | | import java.util.HashMap; |
| | | import java.util.Map; |
| | | |
| | | public enum DevStateEnum { |
| | | DEVSTATE_0(0,"直连充电"), |
| | | DEVSTATE_1(1,"充电测试"), |
| | | DEVSTATE_2(2,"放电测试"), |
| | | DEVSTATE_3(3,"停电放电"), |
| | | DEVSTATE_4(4,"内阻测试") |
| | | ; |
| | | |
| | | private Integer stateId; |
| | | private String stateName; |
| | | |
| | | DevStateEnum(Integer stateId, String stateName) { |
| | | this.stateId = stateId; |
| | | this.stateName = stateName; |
| | | } |
| | | |
| | | public Integer getStateId() { |
| | | return stateId; |
| | | } |
| | | |
| | | public String getStateName() { |
| | | return stateName; |
| | | } |
| | | |
| | | public static String getValue(Integer stateId) { |
| | | if(stateId==null){ |
| | | return ""; |
| | | } |
| | | for (DevStateEnum ele : values()) { |
| | | if(ele.getStateId().equals(stateId)) { |
| | | return ele.getStateName(); |
| | | } |
| | | } |
| | | return null; |
| | | } |
| | | public static Map<Integer,String> getOpInfo() { |
| | | Map<Integer,String> map=new HashMap<>(); |
| | | for (DevStateEnum logOpEnum : DevStateEnum.values()) { |
| | | map.put(logOpEnum.getStateId(),logOpEnum.getStateName()); |
| | | } |
| | | return map; |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | package com.whyc.constant; |
| | | |
| | | import java.util.HashMap; |
| | | import java.util.Map; |
| | | |
| | | public enum FailReasonEnum { |
| | | FAILREASON_3(3,"内部通信故障"), |
| | | FAILREASON_4(4,"系统存在告警"), |
| | | FAILREASON_5(5,"系统测试中"), |
| | | FAILREASON_6(6,"输入电压过高"), |
| | | FAILREASON_7(7,"输入电压过低"), |
| | | FAILREASON_8(8,"负载功率太小"), |
| | | FAILREASON_9(9,"两段直流母线压差大"), |
| | | FAILREASON_10(10,"两段电池组压差大"), |
| | | FAILREASON_11(11,"远程闭锁状态"), |
| | | FAILREASON_12(12,"急停状态"), |
| | | FAILREASON_13(13,"切换开关粘连或电源状态异常"), |
| | | FAILREASON_14(14,"启动频繁"), |
| | | FAILREASON_15(15,"系统正在内阻测试"), |
| | | ; |
| | | |
| | | private Integer stateId; |
| | | private String stateName; |
| | | |
| | | FailReasonEnum(Integer stateId, String stateName) { |
| | | this.stateId = stateId; |
| | | this.stateName = stateName; |
| | | } |
| | | |
| | | public Integer getStateId() { |
| | | return stateId; |
| | | } |
| | | |
| | | public String getStateName() { |
| | | return stateName; |
| | | } |
| | | |
| | | public static String getValue(Integer stateId) { |
| | | if(stateId==null){ |
| | | return ""; |
| | | } |
| | | for (FailReasonEnum ele : values()) { |
| | | if(ele.getStateId().equals(stateId)) { |
| | | return ele.getStateName(); |
| | | } |
| | | } |
| | | return null; |
| | | } |
| | | public static Map<Integer,String> getOpInfo() { |
| | | Map<Integer,String> map=new HashMap<>(); |
| | | for (FailReasonEnum logOpEnum : FailReasonEnum.values()) { |
| | | map.put(logOpEnum.getStateId(),logOpEnum.getStateName()); |
| | | } |
| | | return map; |
| | | } |
| | | } |
New file |
| | |
| | | package com.whyc.constant; |
| | | |
| | | import java.util.HashMap; |
| | | import java.util.Map; |
| | | |
| | | public enum PowerAlarmEnum { |
| | | |
| | | ALARM_3000001(3000001,"电源告警"), |
| | | ALARM_3000002(3000002,"防雷器故障告警"), |
| | | ALARM_3000003(3000003,"负载熔断告警"), |
| | | ALARM_3000004(3000004,"交流总故障告警"), |
| | | ALARM_3000005(3000005,"监控器故障告警"), |
| | | ALARM_3000006(3000006,"开关柜总报警"), |
| | | ALARM_3000007(3000007,"协转通信故障告警"), |
| | | ALARM_3000008(3000008,"电源通信故障告警"), |
| | | |
| | | |
| | | ALARM_3100001(3100001,"交流输入1跳闸告警"), |
| | | ALARM_3100002(3100002,"交流输入2跳闸告警"), |
| | | ALARM_3100003(3100003,"交流输入1熔丝告警"), |
| | | ALARM_3100004(3100004,"交流输入2熔丝告警"), |
| | | ALARM_3100005(3100005,"交流输入1三相不平衡告警"), |
| | | ALARM_3100006(3100006,"交流输入2三相不平衡告警"), |
| | | ALARM_3100007(3100007,"交流输入1频率异常告警"), |
| | | ALARM_3100008(3100008,"交流输入2频率异常告警"), |
| | | ALARM_3100009(3100009,"交流输入1停电告警"), |
| | | ALARM_3100010(3100010,"交流输入2停电告警"), |
| | | ALARM_3100011(3100011,"交流1采集通信故障告警"), |
| | | ALARM_3100012(3100012,"交流2采集通信故障告警"), |
| | | ALARM_3100013(3100013,"交流停电通信故障"), |
| | | ALARM_3100014(3100014,"交流停电告警"), |
| | | |
| | | ALARM_3200001(3200001,"1路交流A相过压告警"), |
| | | ALARM_3200002(3200002,"1路交流A相欠压告警"), |
| | | ALARM_3200003(3200003,"1路交流A相缺相告警"), |
| | | ALARM_3200004(3200004,"1路交流B相过压告警"), |
| | | ALARM_3200005(3200005,"1路交流B相欠压告警"), |
| | | ALARM_3200006(3200006,"1路交流B相缺相告警"), |
| | | ALARM_3200007(3200007,"1路交流C相过压告警"), |
| | | ALARM_3200008(3200008,"1路交流C相欠压告警"), |
| | | ALARM_3200009(3200009,"1路交流C相缺相告警"), |
| | | ALARM_3200010(3200010,"2路交流A相过压告警"), |
| | | ALARM_3200011(3200011,"2路交流A相欠压告警"), |
| | | ALARM_3200012(3200012,"2路交流A相缺相告警"), |
| | | ALARM_3200013(3200013,"2路交流B相过压告警"), |
| | | ALARM_3200014(3200014,"2路交流B相欠压告警"), |
| | | ALARM_3200015(3200015,"2路交流B相缺相告警"), |
| | | ALARM_3200016(3200016,"2路交流C相过压告警"), |
| | | ALARM_3200017(3200017,"2路交流C相欠压告警"), |
| | | ALARM_3200018(3200018,"2路交流C相缺相告警"), |
| | | ALARM_3200019(3200019,"交流A相过流告警"), |
| | | ALARM_3200020(3200020,"交流B相过流告警"), |
| | | ALARM_3200021(3200021,"交流C相过流告警"), |
| | | |
| | | ALARM_3300001(3300001,"整流器1总故障告警"), |
| | | ALARM_3300002(3300002,"整流器2总故障告警"), |
| | | ALARM_3300003(3300003,"整流器3总故障告警"), |
| | | ALARM_3300004(3300004,"整流器4总故障告警"), |
| | | ALARM_3300005(3300005,"整流器5总故障告警"), |
| | | ALARM_3300006(3300006,"整流器6总故障告警"), |
| | | ALARM_3300007(3300007,"整流器7总故障告警"), |
| | | ALARM_3300008(3300008,"整流器8总故障告警"), |
| | | ALARM_3300009(3300009,"整流器9总故障告警"), |
| | | ALARM_3300010(3300010,"整流器10总故障告警"), |
| | | ALARM_3300011(3300011,"整流器11总故障告警"), |
| | | ALARM_3300012(3300012,"整流器12总故障告警"), |
| | | ALARM_3300013(3300013,"整流器13总故障告警"), |
| | | ALARM_3300014(3300014,"整流器14总故障告警"), |
| | | ALARM_3300015(3300015,"整流器15总故障告警"), |
| | | ALARM_3300016(3300016,"整流器16总故障告警"), |
| | | ALARM_3300017(3300017,"整流器1过压告警"), |
| | | ALARM_3300018(3300018,"整流器2过压告警"), |
| | | ALARM_3300019(3300019,"整流器3过压告警"), |
| | | ALARM_3300020(3300020,"整流器4过压告警"), |
| | | ALARM_3300021(3300021,"整流器5过压告警"), |
| | | ALARM_3300022(3300022,"整流器6过压告警"), |
| | | ALARM_3300023(3300023,"整流器7过压告警"), |
| | | ALARM_3300024(3300024,"整流器8过压告警"), |
| | | ALARM_3300025(3300025,"整流器9过压告警"), |
| | | ALARM_3300026(3300026,"整流器10过压告警"), |
| | | ALARM_3300027(3300027,"整流器11过压告警"), |
| | | ALARM_3300028(3300028,"整流器12过压告警"), |
| | | ALARM_3300029(3300029,"整流器13过压告警"), |
| | | ALARM_3300030(3300030,"整流器14过压告警"), |
| | | ALARM_3300031(3300031,"整流器15过压告警"), |
| | | ALARM_3300032(3300032,"整流器16过压告警"), |
| | | ALARM_3300033(3300033,"整流器1欠压告警"), |
| | | ALARM_3300034(3300034,"整流器2欠压告警"), |
| | | ALARM_3300035(3300035,"整流器3欠压告警"), |
| | | ALARM_3300036(3300036,"整流器4欠压告警"), |
| | | ALARM_3300037(3300037,"整流器5欠压告警"), |
| | | ALARM_3300038(3300038,"整流器6欠压告警"), |
| | | ALARM_3300039(3300039,"整流器7欠压告警"), |
| | | ALARM_3300040(3300040,"整流器8欠压告警"), |
| | | ALARM_3300041(3300041,"整流器9欠压告警"), |
| | | ALARM_3300042(3300042,"整流器10欠压告警"), |
| | | ALARM_3300043(3300043,"整流器11欠压告警"), |
| | | ALARM_3300044(3300044,"整流器12欠压告警"), |
| | | ALARM_3300045(3300045,"整流器13欠压告警"), |
| | | ALARM_3300046(3300046,"整流器14欠压告警"), |
| | | ALARM_3300047(3300047,"整流器15欠压告警"), |
| | | ALARM_3300048(3300048,"整流器16欠压告警"), |
| | | ALARM_3300049(3300049,"整流器1过流告警"), |
| | | ALARM_3300050(3300050,"整流器2过流告警"), |
| | | ALARM_3300051(3300051,"整流器3过流告警"), |
| | | ALARM_3300052(3300052,"整流器4过流告警"), |
| | | ALARM_3300053(3300053,"整流器5过流告警"), |
| | | ALARM_3300054(3300054,"整流器6过流告警"), |
| | | ALARM_3300055(3300055,"整流器7过流告警"), |
| | | ALARM_3300056(3300056,"整流器8过流告警"), |
| | | ALARM_3300057(3300057,"整流器9过流告警"), |
| | | ALARM_3300058(3300058,"整流器10过流告警"), |
| | | ALARM_3300059(3300059,"整流器11过流告警"), |
| | | ALARM_3300060(3300060,"整流器12过流告警"), |
| | | ALARM_3300061(3300061,"整流器13过流告警"), |
| | | ALARM_3300062(3300062,"整流器14过流告警"), |
| | | ALARM_3300063(3300063,"整流器15过流告警"), |
| | | ALARM_3300064(3300064,"整流器16过流告警"), |
| | | ALARM_3300065(3300065,"整流器1交流异常告警"), |
| | | ALARM_3300066(3300066,"整流器2交流异常告警"), |
| | | ALARM_3300067(3300067,"整流器3交流异常告警"), |
| | | ALARM_3300068(3300068,"整流器4交流异常告警"), |
| | | ALARM_3300069(3300069,"整流器5交流异常告警"), |
| | | ALARM_3300070(3300070,"整流器6交流异常告警"), |
| | | ALARM_3300071(3300071,"整流器7交流异常告警"), |
| | | ALARM_3300072(3300072,"整流器8交流异常告警"), |
| | | ALARM_3300073(3300073,"整流器9交流异常告警"), |
| | | ALARM_3300074(3300074,"整流器10交流异常告警"), |
| | | ALARM_3300075(3300075,"整流器11交流异常告警"), |
| | | ALARM_3300076(3300076,"整流器12交流异常告警"), |
| | | ALARM_3300077(3300077,"整流器13交流异常告警"), |
| | | ALARM_3300078(3300078,"整流器14交流异常告警"), |
| | | ALARM_3300079(3300079,"整流器15交流异常告警"), |
| | | ALARM_3300080(3300080,"整流器16交流异常告警"), |
| | | |
| | | ALARM_3400001(3400001,"电池组1熔断告警"), |
| | | ALARM_3400002(3400002,"电池组2熔断告警"), |
| | | ALARM_3400003(3400003,"电池组1电压低告警"), |
| | | ALARM_3400004(3400004,"电池组2电压低告警"), |
| | | ALARM_3400005(3400005,"电池组1下电告警"), |
| | | ALARM_3400006(3400006,"电池组2下电告警"), |
| | | ALARM_3400007(3400007,"电池组1充电过流告警"), |
| | | ALARM_3400008(3400008,"电池组2充电过流告警"), |
| | | |
| | | ALARM_3500001(3500001,"温感1通信故障告警"), |
| | | ALARM_3500002(3500002,"温感2通信故障告警"), |
| | | ALARM_3500003(3500003,"温感3通信故障告警"), |
| | | ALARM_3500004(3500004,"湿感1通信故障告警"), |
| | | ALARM_3500005(3500005,"湿感2通信故障告警"), |
| | | ALARM_3500006(3500006,"湿感3通信故障告警"), |
| | | ALARM_3500007(3500007,"烟感1报警告警"), |
| | | ALARM_3500008(3500008,"烟感2报警告警"), |
| | | ALARM_3500009(3500009,"烟感3报警告警"), |
| | | ALARM_3500010(3500010,"烟感1通信故障告警"), |
| | | ALARM_3500011(3500011,"烟感2通信故障告警"), |
| | | ALARM_3500012(3500012,"烟感3通信故障告警"), |
| | | |
| | | |
| | | |
| | | ALARM_3600001(3600001,"直流电压过高告警"), |
| | | ALARM_3600002(3600002,"直流电压过低告警"), |
| | | ALARM_3600003(3600003,"直流总故障告警"), |
| | | ALARM_3600004(3600004,"直流过流告警") |
| | | |
| | | ; |
| | | |
| | | private Integer stateId; |
| | | private String stateName; |
| | | |
| | | PowerAlarmEnum(Integer stateId, String stateName) { |
| | | this.stateId = stateId; |
| | | this.stateName = stateName; |
| | | } |
| | | |
| | | public Integer getStateId() { |
| | | return stateId; |
| | | } |
| | | |
| | | public String getStateName() { |
| | | return stateName; |
| | | } |
| | | |
| | | public static String getValue(Integer stateId) { |
| | | if(stateId==null){ |
| | | return ""; |
| | | } |
| | | for (PowerAlarmEnum ele : values()) { |
| | | if(ele.getStateId().equals(stateId)) { |
| | | return ele.getStateName(); |
| | | } |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | public static Map<String,Map<Integer,String>> getOpInfo() { |
| | | Map<String,Map<Integer,String>> map=new HashMap<>(); |
| | | Map<Integer,String> almmap30=new HashMap<>(); |
| | | Map<Integer,String> almmap31=new HashMap<>(); |
| | | Map<Integer,String> almmap32=new HashMap<>(); |
| | | Map<Integer,String> almmap33=new HashMap<>(); |
| | | Map<Integer,String> almmap34=new HashMap<>(); |
| | | Map<Integer,String> almmap35=new HashMap<>(); |
| | | Map<Integer,String> almmap36=new HashMap<>(); |
| | | for (PowerAlarmEnum logOpEnum : PowerAlarmEnum.values()) { |
| | | if(logOpEnum.getStateId()/100000==30){ |
| | | almmap30.put(logOpEnum.getStateId(),logOpEnum.getStateName()); |
| | | map.put("故障告警",almmap30); |
| | | } |
| | | if(logOpEnum.getStateId()/100000==31){ |
| | | almmap31.put(logOpEnum.getStateId(),logOpEnum.getStateName()); |
| | | map.put("交流输入告警",almmap31); |
| | | } |
| | | if(logOpEnum.getStateId()/100000==32){ |
| | | almmap32.put(logOpEnum.getStateId(),logOpEnum.getStateName()); |
| | | map.put("交流ABC告警",almmap32); |
| | | } |
| | | if(logOpEnum.getStateId()/100000==33){ |
| | | almmap33.put(logOpEnum.getStateId(),logOpEnum.getStateName()); |
| | | map.put("整流器告警",almmap33); |
| | | } |
| | | if(logOpEnum.getStateId()/100000==34){ |
| | | almmap34.put(logOpEnum.getStateId(),logOpEnum.getStateName()); |
| | | map.put("蓄电池告警",almmap34); |
| | | } |
| | | if(logOpEnum.getStateId()/100000==35){ |
| | | almmap35.put(logOpEnum.getStateId(),logOpEnum.getStateName()); |
| | | map.put("温湿度烟感告警",almmap35); |
| | | } |
| | | if(logOpEnum.getStateId()/100000==36){ |
| | | almmap36.put(logOpEnum.getStateId(),logOpEnum.getStateName()); |
| | | map.put("直流告警",almmap36); |
| | | } |
| | | } |
| | | return map; |
| | | } |
| | | } |
New file |
| | |
| | | package com.whyc.constant; |
| | | |
| | | import java.util.HashMap; |
| | | import java.util.Map; |
| | | |
| | | public enum StopReasonEnum { |
| | | STOPREASON_1001(1001,"放电时间到终止"), |
| | | STOPREASON_1002(1001,"放电容量到终止"), |
| | | STOPREASON_1003(1001,"单体电压下限到终止"), |
| | | STOPREASON_1004(1004,"组端电压下限到终止"), |
| | | |
| | | STOPREASON_2001(2001,"设备掉电终止"), |
| | | STOPREASON_2002(2002,"手动终止"), |
| | | STOPREASON_2003(2003,"单体温度上限到终止"), |
| | | STOPREASON_2004(2004,"市电中断终止"), |
| | | STOPREASON_2005(2005,"单体通信异常终止"), |
| | | STOPREASON_2006(2006,"存储数据满终止"), |
| | | STOPREASON_2007(2007,"机内温度异常终止"), |
| | | STOPREASON_2008(2008,"放电电流异常终止"), |
| | | STOPREASON_2009(2009,"后台通信中断终止"), |
| | | STOPREASON_2010(2010,"内部程序异常终止"), |
| | | STOPREASON_2011(2011,"电源电压高终止"), |
| | | STOPREASON_2012(2012,"协转通信异常"), |
| | | STOPREASON_2013(2013,"切换装置通信故障"), |
| | | STOPREASON_2014(2014,"切换装置故障"), |
| | | STOPREASON_2015(2015,"逆变器模块故障"), |
| | | STOPREASON_2016(2016,"负载功率小"), |
| | | STOPREASON_2017(2017,"干接点输入故障"), |
| | | STOPREASON_2018(2018,"母联通信异常"), |
| | | STOPREASON_2019(2019,"母联手动关闭或信号异常"), |
| | | STOPREASON_2020(2020,"逆变器通信故障"), |
| | | STOPREASON_2021(2021,"防雷器故障"), |
| | | STOPREASON_2022(2022,"机柜表头通信故障"), |
| | | STOPREASON_2023(2023,"限流充电模块故障"), |
| | | STOPREASON_2024(2024,"紧急停止"), |
| | | STOPREASON_2025(2025,"远程闭锁"), |
| | | STOPREASON_2026(2026,"切换装置开关异常"), |
| | | STOPREASON_2027(2027,"交流空开异常"), |
| | | STOPREASON_2028(2028,"交流接触器异常"), |
| | | STOPREASON_2029(2029,"直流空开异常"), |
| | | STOPREASON_2030(2030,"切换开关粘连或电源状态异常"), |
| | | STOPREASON_2031(2031,"电阻箱温度过高"), |
| | | STOPREASON_2032(2032,"降压模块过温限流"), |
| | | STOPREASON_2033(2033,"降压模块风扇故障"), |
| | | STOPREASON_2034(2034,"降压模块过流故障"), |
| | | STOPREASON_2035(2035,"充电截止到"), |
| | | STOPREASON_2036(2036,"在线接触器状态异常") |
| | | ; |
| | | |
| | | private Integer stateId; |
| | | private String stateName; |
| | | |
| | | StopReasonEnum(Integer stateId, String stateName) { |
| | | this.stateId = stateId; |
| | | this.stateName = stateName; |
| | | } |
| | | |
| | | public Integer getStateId() { |
| | | return stateId; |
| | | } |
| | | |
| | | public String getStateName() { |
| | | return stateName; |
| | | } |
| | | |
| | | public static String getValue(Integer stateId) { |
| | | if(stateId==null){ |
| | | return ""; |
| | | } |
| | | for (StopReasonEnum ele : values()) { |
| | | if(ele.getStateId().equals(stateId)) { |
| | | return ele.getStateName(); |
| | | } |
| | | } |
| | | return null; |
| | | } |
| | | public static Map<String,Map<Integer,String>> getOpInfo() { |
| | | Map<String,Map<Integer,String>> map=new HashMap<>(); |
| | | Map<Integer,String> almmap1=new HashMap<>(); |
| | | Map<Integer,String> almmap2=new HashMap<>(); |
| | | for (StopReasonEnum logOpEnum : StopReasonEnum.values()) { |
| | | if(logOpEnum.getStateId()/1000==1){ |
| | | almmap1.put(logOpEnum.getStateId(),logOpEnum.getStateName()); |
| | | map.put("正常核容终止",almmap1); |
| | | } |
| | | if(logOpEnum.getStateId()/1000==2){ |
| | | almmap2.put(logOpEnum.getStateId(),logOpEnum.getStateName()); |
| | | map.put("异常核容终止",almmap2); |
| | | } |
| | | } |
| | | return map; |
| | | } |
| | | } |
New file |
| | |
| | | package com.whyc.controller; |
| | | |
| | | import com.whyc.dto.Real.AlmDto; |
| | | import com.whyc.dto.Response; |
| | | import com.whyc.pojo.db_alarm.BattalarmData; |
| | | import com.whyc.pojo.db_alarm.DevalarmData; |
| | | import com.whyc.pojo.db_pwrdev_alarm.PwrdevAlarm; |
| | | import com.whyc.service.BattalarmDataService; |
| | | import com.whyc.service.DevalarmDataService; |
| | | import com.whyc.service.PwrdevAlarmService; |
| | | import com.whyc.util.ActionUtil; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | @RestController |
| | | @Api(tags = "告警管理") |
| | | @RequestMapping("alm") |
| | | public class AlarmController { |
| | | @Autowired |
| | | private BattalarmDataService battalarmDataService; |
| | | |
| | | @Autowired |
| | | private DevalarmDataService devalarmDataService; |
| | | |
| | | @Autowired |
| | | private PwrdevAlarmService pwrdevAlarmService; |
| | | |
| | | @PostMapping("getBattAlmReal") |
| | | @ApiOperation("获取电池组实时告警信息") |
| | | public Response getBattAlmReal(@RequestBody AlmDto almDto){ |
| | | almDto.setUid(ActionUtil.getUser().getId()); |
| | | return battalarmDataService.getBattAlmReal(almDto); |
| | | } |
| | | |
| | | @PostMapping("getDevAlmReal") |
| | | @ApiOperation("获取设备实时告警信息") |
| | | public Response getDevAlmReal(@RequestBody AlmDto almDto){ |
| | | almDto.setUid(ActionUtil.getUser().getId()); |
| | | return devalarmDataService.getDevAlmReal(almDto); |
| | | } |
| | | |
| | | @PostMapping("getPwrAlmReal") |
| | | @ApiOperation("获取电源实时告警信息") |
| | | public Response getPwrAlmReal(@RequestBody AlmDto almDto){ |
| | | almDto.setUid(ActionUtil.getUser().getId()); |
| | | return pwrdevAlarmService.getPwrAlmReal(almDto); |
| | | } |
| | | |
| | | @GetMapping("updateBattConfrim") |
| | | @ApiOperation(value = "确认电池告警") |
| | | public Response updateBattConfrim(@RequestParam Integer num){ |
| | | return battalarmDataService.updateBattConfrim(num); |
| | | } |
| | | |
| | | @GetMapping("updateDevConfrim") |
| | | @ApiOperation(value = "确认设备告警") |
| | | public Response updateDevConfrim(@RequestParam Integer num){ |
| | | return devalarmDataService.updateDevConfrim(num); |
| | | } |
| | | |
| | | @GetMapping("updatePwrConfrim") |
| | | @ApiOperation(value = "确认电源告警") |
| | | public Response updatePwrConfrim(@RequestParam Integer num){ |
| | | return pwrdevAlarmService.updatePwrConfrim(num); |
| | | } |
| | | } |
New file |
| | |
| | | package com.whyc.controller; |
| | | |
| | | import com.whyc.dto.AlmHis.BattAlmPar; |
| | | import com.whyc.dto.AlmHis.DevAlmPar; |
| | | import com.whyc.dto.AlmHis.PwrAlmPar; |
| | | import com.whyc.dto.Real.AlmDto; |
| | | import com.whyc.dto.Response; |
| | | import com.whyc.service.AlarmHisService; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import java.text.ParseException; |
| | | |
| | | @RestController |
| | | @Api(tags = "告警历史管理") |
| | | @RequestMapping("almHis") |
| | | public class AlarmHistoryController { |
| | | @Autowired |
| | | private AlarmHisService service; |
| | | |
| | | @PostMapping("getBattAlmHis") |
| | | @ApiOperation(value = "电池告警历史记录查询") |
| | | public Response serchByInfo(@RequestBody BattAlmPar almDto) throws ParseException, InterruptedException { |
| | | return service.getBattAlmHis(almDto); |
| | | } |
| | | |
| | | @PostMapping("getDevAlmHis") |
| | | @ApiOperation(value = "设备告警历史记录查询") |
| | | public Response getDevAlmHis(@RequestBody DevAlmPar almDto) throws ParseException, InterruptedException { |
| | | return service.getDevAlmHis(almDto); |
| | | } |
| | | |
| | | @PostMapping("getPwrAlmHis") |
| | | @ApiOperation(value = "电源告警历史记录查询") |
| | | public Response getPwrAlmHis(@RequestBody PwrAlmPar almDto) throws ParseException, InterruptedException { |
| | | return service.getPwrAlmHis(almDto); |
| | | } |
| | | } |
New file |
| | |
| | | package com.whyc.controller; |
| | | |
| | | import com.whyc.dto.Real.AlmDto; |
| | | import com.whyc.dto.Response; |
| | | import com.whyc.pojo.db_param.BattAlmparam; |
| | | import com.whyc.pojo.db_param.DevAlmparam; |
| | | import com.whyc.pojo.db_pwrdev_alarm.PwrdevAlarmParam; |
| | | import com.whyc.service.BattAlmparamService; |
| | | import com.whyc.service.DevAlmparamService; |
| | | import com.whyc.service.PwrdevAlarmParamService; |
| | | import com.whyc.util.ActionUtil; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.util.List; |
| | | |
| | | @RestController |
| | | @Api(tags = "告警参数管理") |
| | | @RequestMapping("almParam") |
| | | public class AlmParamController { |
| | | @Autowired |
| | | private BattAlmparamService battAlmparamService; |
| | | |
| | | @Autowired |
| | | private DevAlmparamService devAlmparamService; |
| | | |
| | | @Autowired |
| | | private PwrdevAlarmParamService pwrAlmparamService; |
| | | |
| | | |
| | | @PostMapping("getBattAlmParam") |
| | | @ApiOperation("获取电池告警参数") |
| | | public Response getBattAlmParam(@RequestBody AlmDto almDto){ |
| | | almDto.setUid(ActionUtil.getUser().getId()); |
| | | return battAlmparamService.getBattAlmParam(almDto); |
| | | } |
| | | |
| | | @PostMapping("setBattAlmParam") |
| | | @ApiOperation("修改电池告警参数") |
| | | public Response setBattAlmParam(@RequestBody List<BattAlmparam> almparamList){ |
| | | return battAlmparamService.setBattAlmParam(almparamList); |
| | | } |
| | | |
| | | @GetMapping("getDevAlmParam") |
| | | @ApiOperation("获取设备告警参数") |
| | | public Response getDevAlmParam(@RequestParam(required = false) Integer almId,@RequestParam Integer pageNum,@RequestParam Integer pageSize){ |
| | | return devAlmparamService.getDevAlmParam(almId,pageNum,pageSize); |
| | | } |
| | | |
| | | @PostMapping("setDevAlmParam") |
| | | @ApiOperation("修改设备告警参数") |
| | | public Response setDevAlmParam(@RequestBody List<DevAlmparam> almparamList){ |
| | | return devAlmparamService.setDevAlmParam(almparamList); |
| | | } |
| | | |
| | | @PostMapping("getPwrAlmParam") |
| | | @ApiOperation("获取电源告警参数") |
| | | public Response getPwrAlmParam(@RequestBody AlmDto almDto){ |
| | | almDto.setUid(ActionUtil.getUser().getId()); |
| | | return pwrAlmparamService.getPwrAlmParam(almDto); |
| | | } |
| | | |
| | | @PostMapping("setPwrAlmParam") |
| | | @ApiOperation("修改电源告警参数") |
| | | public Response setPwrAlmParam(@RequestBody List<PwrdevAlarmParam> almparamList){ |
| | | return pwrAlmparamService.setPwrAlmParam(almparamList); |
| | | } |
| | | } |
New file |
| | |
| | | package com.whyc.controller; |
| | | |
| | | import com.whyc.dto.Response; |
| | | import com.whyc.pojo.db_ram_db.AlmparamFromDevice; |
| | | import com.whyc.service.AlmparamFromDeviceService; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | @RequestMapping("almparamFromDevice") |
| | | @RestController |
| | | @Api(tags = "设备的告警参数管理") |
| | | public class AlmparamFromDeviceController { |
| | | @Autowired |
| | | private AlmparamFromDeviceService service; |
| | | |
| | | @ApiOperation(value = "设备的告警参数设置") |
| | | @PostMapping("setAlarmFromDevice") |
| | | public Response setAlarmFromDevice(@RequestBody AlmparamFromDevice par){ |
| | | return service.setAlarmFromDevice(par); |
| | | } |
| | | |
| | | @ApiOperation(value = "设备的告警参数读取") |
| | | @GetMapping("getAlarmFromDevice") |
| | | public Response getAlarmFromDevice(@RequestParam int devId){ |
| | | return service.getAlarmFromDevice(devId); |
| | | } |
| | | } |
| | |
| | | |
| | | import com.whyc.dto.Response; |
| | | import com.whyc.pojo.db_user.User; |
| | | import com.whyc.service.BaojigroupService; |
| | | import com.whyc.service.BattInfService; |
| | | import com.whyc.service.PowerInfService; |
| | | import com.whyc.service.StationInfService; |
| | | import com.whyc.service.*; |
| | | import com.whyc.util.ActionUtil; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | |
| | | |
| | | @Autowired |
| | | private BattInfService binfService; |
| | | |
| | | @Autowired |
| | | private BattalarmDataService almDataService; |
| | | |
| | | @Autowired |
| | | private DevalarmDataService devAlmService; |
| | | |
| | | @Autowired |
| | | private PwrdevAlarmService pwrAlmService; |
| | | |
| | | @Autowired |
| | | private DeviceStateService deviceStateService; |
| | | |
| | | @Autowired |
| | | private BattRtstateService rtstateService; |
| | | |
| | | @Autowired |
| | | private BatttestdataInfService tinfService; |
| | | |
| | | @ApiOperation("获取所有的省份(下拉)") |
| | | @GetMapping("getProviceByUid") |
| | |
| | | return bjGroupService.getBaojiUserByUid(uinf.getId()); |
| | | } |
| | | |
| | | @ApiOperation(value = "获取电池告警类型(下拉)") |
| | | @GetMapping("getAlarmIdType") |
| | | public Response getAlarmIdType(){ |
| | | return almDataService.getAlarmIdType(); |
| | | } |
| | | |
| | | @ApiOperation(value = "获取设备告警类型(下拉)") |
| | | @GetMapping("getDevAlmIdType") |
| | | public Response getDevAlmIdType(){ |
| | | return devAlmService.getDevAlmIdType(); |
| | | } |
| | | @ApiOperation(value = "获取电源告警类型(下拉)") |
| | | @GetMapping("getPwrAlmIdType") |
| | | public Response getPwrAlmIdType(){ |
| | | return pwrAlmService.getPwrAlmIdType(); |
| | | } |
| | | @ApiOperation(value = "获取核容停止原因类型(下拉)") |
| | | @GetMapping("getStopReasonType") |
| | | public Response getStopReasonType(){ |
| | | return tinfService.getStopReasonType(); |
| | | } |
| | | |
| | | @ApiOperation(value = "获取容量性能(下拉)") |
| | | @GetMapping("getCapperformance") |
| | | public Response getCapperformance(){ |
| | | return binfService.getCapperformance(); |
| | | } |
| | | |
| | | @ApiOperation(value = "获取设备工作类型(下拉)") |
| | | @GetMapping("getDevState") |
| | | public Response getDevState(){ |
| | | return deviceStateService.getDevState(); |
| | | } |
| | | @ApiOperation(value = "获取电池组工作状态类型(下拉)") |
| | | @GetMapping("getBattState") |
| | | public Response getBattState(){ |
| | | return rtstateService.getBattState(); |
| | | } |
| | | |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.whyc.controller; |
| | | |
| | | import com.whyc.dto.Response; |
| | | import com.whyc.pojo.db_ram_db.DeviceSetparam; |
| | | import com.whyc.pojo.db_user.User; |
| | | import com.whyc.service.DeviceSetparamService; |
| | | import com.whyc.util.ActionUtil; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | @RestController |
| | | @Api(tags = "设备远程控制管理") |
| | | @RequestMapping("devSetparam") |
| | | public class DeviceSetparamController { |
| | | @Autowired |
| | | private DeviceSetparamService service; |
| | | |
| | | |
| | | @ApiOperation("设置放电参数") |
| | | @PostMapping("updateParam") |
| | | public Response updateParam(@RequestBody DeviceSetparam param) { |
| | | return service.updateParam(param); |
| | | } |
| | | @ApiOperation("读取放电参数") |
| | | @GetMapping("getParam") |
| | | public Response getParam(@RequestParam int devId, @RequestParam int battGroupNum) { |
| | | return service.getParam(devId, battGroupNum); |
| | | } |
| | | |
| | | @ApiOperation("远程重启") |
| | | @GetMapping("restart") |
| | | public Response restart(@RequestParam int devId, @RequestParam int battGroupNum) { |
| | | return service.restart(devId, battGroupNum); |
| | | } |
| | | |
| | | @ApiOperation("远程核容") |
| | | @GetMapping("startDis") |
| | | public Response startDis(@RequestParam int devId, @RequestParam int battGroupNum) { |
| | | return service.startDis(devId, battGroupNum); |
| | | } |
| | | |
| | | @ApiOperation("内阻测试") |
| | | @GetMapping("startRes") |
| | | public Response startRes(@RequestParam int devId, @RequestParam int battGroupNum) { |
| | | return service.startRes(devId, battGroupNum); |
| | | } |
| | | |
| | | @ApiOperation("停止内阻测试") |
| | | @GetMapping("stopRes") |
| | | public Response stopRes(@RequestParam int devId, @RequestParam int battGroupNum) { |
| | | return service.stopRes(devId, battGroupNum); |
| | | } |
| | | } |
New file |
| | |
| | | package com.whyc.controller; |
| | | |
| | | import com.whyc.dto.Statistic.MonStic; |
| | | import com.whyc.service.ExportService; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.text.ParseException; |
| | | |
| | | @RestController |
| | | @Api(tags = "导出文件") |
| | | @RequestMapping("export") |
| | | public class ExportFileController { |
| | | @Autowired |
| | | private ExportService service; |
| | | |
| | | @PostMapping("exportBattTinfStatistic") |
| | | @ApiOperation(value = "单节数量统计导出(1.2.14)") |
| | | public void exportBattTinfStatistic(HttpServletRequest req, HttpServletResponse resp ,@RequestBody MonStic stic) throws ParseException { |
| | | service.exportBattTinfStatistic(req,resp,stic); |
| | | } |
| | | } |
New file |
| | |
| | | package com.whyc.controller; |
| | | |
| | | import com.whyc.dto.Response; |
| | | import com.whyc.pojo.db_user.User; |
| | | import com.whyc.service.BattRealdataIdService; |
| | | import com.whyc.service.StationInfService; |
| | | import com.whyc.util.ActionUtil; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RequestParam; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | @RestController |
| | | @Api(tags = "历史实时管理") |
| | | @RequestMapping("hisId") |
| | | public class HistoryIdController { |
| | | @Autowired |
| | | private BattRealdataIdService battHisIdService; |
| | | |
| | | |
| | | @ApiOperation("获取电池组最近一季度的电压数据") |
| | | @GetMapping("getBattQuarterVol") |
| | | public Response getBattQuarterVol(@RequestParam Integer battgroupId) { |
| | | return battHisIdService.getBattQuarterVol(battgroupId); |
| | | } |
| | | |
| | | @ApiOperation("获取电池组最近一季度的内阻数据") |
| | | @GetMapping("getBattQuarterRes") |
| | | public Response getBattQuarterRes(@RequestParam Integer battgroupId) { |
| | | return battHisIdService.getBattQuarterRes(battgroupId); |
| | | } |
| | | |
| | | @ApiOperation("获取电池组最近一季度的温度数据") |
| | | @GetMapping("getBattQuarterTmp") |
| | | public Response getBattQuarterTmp(@RequestParam Integer battgroupId) { |
| | | return battHisIdService.getBattQuarterTmp(battgroupId); |
| | | } |
| | | } |
| | |
| | | |
| | | @RestController |
| | | @Api(tags = "机房,电源,电池组管理") |
| | | @RequestMapping("condition") |
| | | @RequestMapping("info") |
| | | public class InfoContoller { |
| | | |
| | | @Autowired |
New file |
| | |
| | | package com.whyc.controller; |
| | | |
| | | import com.whyc.dto.Response; |
| | | import com.whyc.pojo.db_pwrdev_alarm.PwrdevAlarmParamStand; |
| | | import com.whyc.service.PwrdevAlarmParamStandService; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiImplicitParam; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | |
| | | import java.io.IOException; |
| | | |
| | | @RestController |
| | | @Api(tags = "标准参数管理") |
| | | @RequestMapping("stand") |
| | | public class PwrdevAlarmParamStandController { |
| | | @Autowired |
| | | private PwrdevAlarmParamStandService service; |
| | | |
| | | @ApiOperation(value = "查询标准参数") |
| | | @GetMapping("getPwrStandParam") |
| | | public Response getPwrStandParam(@RequestParam Integer powerType){ |
| | | return service.getPwrStandParam(powerType); |
| | | } |
| | | |
| | | @ApiOperation(value = "设置标准参数") |
| | | @PostMapping("setPwrStandParam") |
| | | public Response setPwrStandParam(@RequestBody PwrdevAlarmParamStand stand){ |
| | | return service.setPwrStandParam(stand); |
| | | } |
| | | |
| | | @ApiOperation(value = "查询规范文件") |
| | | @GetMapping("getStandFile") |
| | | public Response getStandFile(@RequestParam Integer powerType,@RequestParam String fileName){ |
| | | return service.getStandFile(powerType,fileName); |
| | | } |
| | | @ApiOperation(value = "上传规范文件") |
| | | @PostMapping("uploadStandFile") |
| | | public Response uploadStandFile(@RequestParam MultipartFile multipartFile,@RequestParam String num) throws IOException { |
| | | return service.uploadStandFile(multipartFile,num); |
| | | } |
| | | |
| | | @ApiOperation(value = "添加标准参数") |
| | | @PostMapping("addPwrStandParam") |
| | | public Response addPwrStandParam(@RequestBody PwrdevAlarmParamStand stand){ |
| | | return service.addPwrStandParam(stand); |
| | | } |
| | | } |
New file |
| | |
| | | package com.whyc.controller; |
| | | |
| | | import com.whyc.dto.Response; |
| | | import com.whyc.pojo.db_data_history.PwrdevHistorydataId; |
| | | import com.whyc.pojo.db_user.User; |
| | | import com.whyc.service.*; |
| | | import com.whyc.util.ActionUtil; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RequestParam; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import java.text.ParseException; |
| | | |
| | | @RestController |
| | | @Api(tags = "实时页面") |
| | | @RequestMapping("real") |
| | | public class RealContoller { |
| | | @Autowired |
| | | private PwrdevHistorydataIdService pwrdevHistorydataIdService; |
| | | |
| | | @Autowired |
| | | private BattRealdataIdService battRealdataIdService; |
| | | |
| | | @Autowired |
| | | private BatttestdataInfService tinfService; |
| | | |
| | | @Autowired |
| | | private BatttestdataIdService tdataIdService; |
| | | |
| | | @ApiOperation(value = "系统概览获取半小时交流输入统计") |
| | | @GetMapping("getHalfHourPwrHisAcinData") |
| | | public Response getHalfHourPwrHisAcinData(@RequestParam Integer powerId,@RequestParam Integer granularity){ |
| | | return pwrdevHistorydataIdService.getHalfHourPwrHisAcinData(powerId,granularity); |
| | | } |
| | | |
| | | @ApiOperation(value = "系统概览获取半小时直流输出统计") |
| | | @GetMapping("getHalfHourPwrHisDcoutData") |
| | | public Response getHalfHourPwrHisDcoutData(@RequestParam Integer powerId,@RequestParam Integer granularity){ |
| | | return pwrdevHistorydataIdService.getHalfHourPwrHisDcoutData(powerId,granularity); |
| | | } |
| | | |
| | | @ApiOperation(value = "系统概览获取半小时核容设备信息") |
| | | @GetMapping("getHalfHourBattDevData") |
| | | public Response getHalfHourBattDevData(@RequestParam Integer battgroupId,@RequestParam Integer granularity){ |
| | | return battRealdataIdService.getHalfHourBattDevData(battgroupId,granularity); |
| | | } |
| | | |
| | | @ApiOperation(value = "历史测试记录") |
| | | @GetMapping("getBattTinf") |
| | | public Response getBattTinf(@RequestParam Integer battgroupId){ |
| | | return tinfService.getBattTinf(battgroupId); |
| | | } |
| | | |
| | | @ApiOperation(value = "历史测试记录具体某一次放电数据详情") |
| | | @GetMapping("getTinfDataWithTestRecordCount") |
| | | public Response getTinfDataWithTestRecordCount(@RequestParam Integer battgroupId,@RequestParam Integer testRecordCount |
| | | ,@RequestParam Integer recordNum,@RequestParam Integer granularity){ |
| | | return tdataIdService.getTinfDataWithTestRecordCount(battgroupId,testRecordCount,recordNum,granularity); |
| | | } |
| | | |
| | | @ApiOperation(value = "历史实时查询") |
| | | @GetMapping("getBattRealDataHis") |
| | | public Response getBattRealDataHis(@RequestParam Integer battgroupId,@RequestParam Integer granularity |
| | | ,@RequestParam String startTime,@RequestParam String endTime) throws ParseException, InterruptedException { |
| | | return battRealdataIdService.getBattRealDataHis(battgroupId,granularity,startTime,endTime); |
| | | } |
| | | } |
| | |
| | | package com.whyc.controller; |
| | | |
| | | import com.whyc.dto.Response; |
| | | import com.whyc.dto.Statistic.StationStic; |
| | | import com.whyc.pojo.db_station.StationInf; |
| | | import com.whyc.pojo.db_user.User; |
| | | import com.whyc.service.StationInfService; |
| | | import com.whyc.util.ActionUtil; |
| | |
| | | return service.getLeftStation(uinf.getId()); |
| | | } |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.whyc.controller; |
| | | |
| | | import com.whyc.dto.Response; |
| | | import com.whyc.dto.Statistic.*; |
| | | import com.whyc.pojo.db_user.User; |
| | | import com.whyc.service.*; |
| | | import com.whyc.util.ActionUtil; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import java.util.Map; |
| | | |
| | | @RestController |
| | | @Api(tags = "统计管理") |
| | | @RequestMapping("statistic") |
| | | public class StatisticController { |
| | | @Autowired |
| | | private StationInfService stationInfService; |
| | | |
| | | @Autowired |
| | | private BatttestdataInfService battTinfService; |
| | | |
| | | @Autowired |
| | | private BattInfService battService; |
| | | |
| | | @Autowired |
| | | private PowerInfService powerInfService; |
| | | |
| | | @Autowired |
| | | private DeviceStateService deviceStateService; |
| | | |
| | | @ApiOperation(value = "电源信息统计(1.2.1/1.2.13)") |
| | | @PostMapping("getPowerStatistic") |
| | | public Response getPowerStatistic(@RequestBody StationStic stic){ |
| | | User uinf= ActionUtil.getUser(); |
| | | stic.setUid(uinf.getId()); |
| | | return powerInfService.getPowerStatistic(stic); |
| | | } |
| | | |
| | | @ApiOperation(value = "设备信息统计(1.2.2)") |
| | | @PostMapping("getDevStatistic") |
| | | public Response getDevStatistic(@RequestBody StationStic stic){ |
| | | User uinf= ActionUtil.getUser(); |
| | | stic.setUid(uinf.getId()); |
| | | return battService.getDevStatistic(stic); |
| | | } |
| | | |
| | | @ApiOperation(value = "蓄电池组信息统计(1.2.3/1.2.12)") |
| | | @PostMapping("getBattStatistic") |
| | | public Response getBattStatistic(@RequestBody StationStic stic){ |
| | | User uinf= ActionUtil.getUser(); |
| | | stic.setUid(uinf.getId()); |
| | | return battService.getBattStatistic(stic); |
| | | } |
| | | |
| | | @ApiOperation(value = "单节数量统计(1.2.4)") |
| | | @PostMapping("getMonStatistic") |
| | | public Response getMonStatistic(@RequestBody MonStic stic){ |
| | | User uinf= ActionUtil.getUser(); |
| | | stic.setUid(uinf.getId()); |
| | | Map<String,Object> map= battTinfService.getMonStatistic(stic); |
| | | return new Response().setII(1,true,map,"单节数量统计"); |
| | | } |
| | | |
| | | @ApiOperation(value = "本年度已放电数量统计(1.2.5)") |
| | | @PostMapping("getDischr5Statistic") |
| | | public Response getDischr5Statistic(@RequestBody DisChargeStic stic){ |
| | | User uinf= ActionUtil.getUser(); |
| | | stic.setUid(uinf.getId()); |
| | | return battTinfService.getDischr5Statistic(stic); |
| | | } |
| | | |
| | | @ApiOperation(value = "本年度未放电数量统计(1.2.6)") |
| | | @PostMapping("getDischr6Statistic") |
| | | public Response getDischr6Statistic(@RequestBody DisChargeStic stic){ |
| | | User uinf= ActionUtil.getUser(); |
| | | stic.setUid(uinf.getId()); |
| | | if(stic.getTypeList()==null||stic.getTypeList().size()==0){ |
| | | stic.setStopReasonType(0); |
| | | }else{ |
| | | stic.setStopReasonType(1); |
| | | } |
| | | return battTinfService.getDischr6Statistic(stic); |
| | | } |
| | | |
| | | @ApiOperation(value = "电池组电池性能统计(未放电,优秀,劣化,损坏)统计(1.2.8/9/10)") |
| | | @PostMapping("getPerformanceStatistic") |
| | | public Response getPerformanceStatistic(@RequestBody PerformanceStic stic){ |
| | | User uinf= ActionUtil.getUser(); |
| | | stic.setUid(uinf.getId()); |
| | | return battTinfService.getPerformanceStatistic(stic); |
| | | } |
| | | |
| | | |
| | | @ApiOperation(value = "站点信息统计(1.2.11)") |
| | | @PostMapping("getStationStatistic") |
| | | public Response getStationStatistic(@RequestBody StationStic stic){ |
| | | User uinf= ActionUtil.getUser(); |
| | | stic.setUid(uinf.getId()); |
| | | return stationInfService.getStationStatistic(stic); |
| | | } |
| | | |
| | | @ApiOperation(value = "蓄电池核容信息统计(1.2.14)") |
| | | @PostMapping("getBattTinfStatistic") |
| | | public Response getBattTinfStatistic(@RequestBody BattTinfStic stic){ |
| | | User uinf= ActionUtil.getUser(); |
| | | stic.setUid(uinf.getId()); |
| | | return battTinfService.getBattTinfStatistic(stic); |
| | | } |
| | | @ApiOperation(value = "蓄电池组对比分析界面(同一品牌同一时间)(1.2.15)") |
| | | @PostMapping("getBattCompare15Statistic") |
| | | public Response getBattCompare15Statistic(@RequestBody BattCompareStic stic){ |
| | | User uinf= ActionUtil.getUser(); |
| | | stic.setUid(uinf.getId()); |
| | | return battTinfService.getBattCompare15Statistic(stic); |
| | | } |
| | | |
| | | @ApiOperation(value = "蓄电池组对比分析界面(不同品牌同一时间)(1.2.16)") |
| | | @PostMapping("getBattCompare16Statistic") |
| | | public Response getBattCompare16Statistic(@RequestBody BattCompareStic stic){ |
| | | User uinf= ActionUtil.getUser(); |
| | | stic.setUid(uinf.getId()); |
| | | return battTinfService.getBattCompare16Statistic(stic); |
| | | } |
| | | |
| | | @ApiOperation(value = "蓄电池组对比分析界面(同一品牌不同时间)(1.2.17)") |
| | | @PostMapping("getBattCompare17Statistic") |
| | | public Response getBattCompare17Statistic(@RequestBody BattCompareStic stic){ |
| | | User uinf= ActionUtil.getUser(); |
| | | stic.setUid(uinf.getId()); |
| | | return battTinfService.getBattCompare17Statistic(stic); |
| | | } |
| | | |
| | | @ApiOperation(value = "设备工作状态统计(1.2.21)") |
| | | @PostMapping("getDeviceStateStatistic") |
| | | public Response getDeviceStateStatistic(@RequestBody DeviceStateStic stic){ |
| | | User uinf= ActionUtil.getUser(); |
| | | stic.setUid(uinf.getId()); |
| | | return deviceStateService.getDeviceStateStatistic(stic); |
| | | } |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.whyc.dto.AlmHis; |
| | | |
| | | import com.whyc.pojo.db_alarm.BattalarmDataHistory; |
| | | import lombok.AllArgsConstructor; |
| | | import lombok.Data; |
| | | import lombok.NoArgsConstructor; |
| | | import lombok.ToString; |
| | | |
| | | import java.io.Serializable; |
| | | import java.util.List; |
| | | |
| | | @Data |
| | | @AllArgsConstructor |
| | | @NoArgsConstructor |
| | | @ToString |
| | | public class BattAlarmRes implements Serializable { |
| | | private int battgroupId;//电池组id |
| | | private String stationName;//机房名称 |
| | | private String provice;//机房名称 |
| | | private String city;//机房名称 |
| | | private String country;//机房名称 |
| | | private String stationId;//机房id |
| | | private String battGroupName;//电池组名称 |
| | | private List<BattalarmDataHistory> adataHs;//历史告警信息 |
| | | } |
New file |
| | |
| | | package com.whyc.dto.AlmHis; |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import lombok.Data; |
| | | |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | @Data |
| | | public class BattAlmPar { |
| | | private String provice; |
| | | private String city; |
| | | private String country; |
| | | private String stationName; |
| | | private List<Integer> almIds; |
| | | private Integer almLevel; |
| | | private Integer pageNum; |
| | | private Integer pageSize; |
| | | private Integer uid; |
| | | |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private Date almStartTime;//开始时间 |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private Date almEndTime;//结束时间 |
| | | |
| | | private String recordYear; |
| | | private Integer limitStart; |
| | | private Integer limitEnd; |
| | | } |
New file |
| | |
| | | package com.whyc.dto.AlmHis; |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import lombok.Data; |
| | | |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | @Data |
| | | public class DevAlmPar { |
| | | private String provice; |
| | | private String city; |
| | | private String country; |
| | | private String stationName; |
| | | private List<Integer> almIds; |
| | | private Integer almLevel; |
| | | private Integer pageNum; |
| | | private Integer pageSize; |
| | | private Integer uid; |
| | | |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private Date almStartTime;//开始时间 |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private Date almEndTime;//结束时间 |
| | | |
| | | private String recordYear; |
| | | private Integer limitStart; |
| | | private Integer limitEnd; |
| | | } |
New file |
| | |
| | | package com.whyc.dto.AlmHis; |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import lombok.Data; |
| | | |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | @Data |
| | | public class PwrAlmPar { |
| | | private String provice; |
| | | private String city; |
| | | private String country; |
| | | private String stationName; |
| | | private List<Integer> almIds; |
| | | private Integer almLevel; |
| | | private Integer pageNum; |
| | | private Integer pageSize; |
| | | private Integer uid; |
| | | |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private Date almStartTime;//开始时间 |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private Date almEndTime;//结束时间 |
| | | |
| | | private String recordYear; |
| | | private Integer limitStart; |
| | | private Integer limitEnd; |
| | | } |
New file |
| | |
| | | package com.whyc.dto.CmdDto; |
| | | |
| | | public class DevCmd { |
| | | |
| | | final public static int CMD_Start=81; |
| | | final public static int CMD_Stop=83; |
| | | final public static int CMD_StartAck=82; |
| | | final public static int CMD_StopAck=84; |
| | | final public static int CMD_SetDischargeParm=40; //设置参数 |
| | | final public static int CMD_GetDischargeParm=41; //读取参数 |
| | | final public static int CMD_SetDischargeParmAck=39; |
| | | final public static int CMD_GetDischargeParmAck=48; |
| | | |
| | | final public static int CMD_StartResDischarge = 0x32; //启动内阻测试 |
| | | final public static int CMD_StopResDischarge = 0x33; //停止内阻测试 |
| | | |
| | | public static final int CMD_StartDischarge = 0x25; //启动放电37 |
| | | public static final int CMD_StartDischargeAck = 0x26; //启动放电成功38 |
| | | public static final int CMD_StopDischarge = 0x23; //停止放电35 |
| | | public static final int CMD_StopDischargeAck = 0x24; //停止放电成功36 |
| | | |
| | | public static final int CMD_ResetSystemAck = 0x0F;//15 |
| | | public static final int CMD_ResetSystem = 0x10;//重启16 |
| | | |
| | | |
| | | //核容6185专属告警配置 |
| | | public static final int CMD_ReadAlarmParam = 0xC5; //读取告警197 |
| | | public static final int CMD_ReadAlarmParam_ACK = 0xC6; //读取告警成功198 |
| | | public static final int CMD_WriteAlarmParam = 0xC7; //设置告警199 |
| | | public static final int CMD_WriteAlarmParam_ACK = 0xC8; //设置告警成功200 |
| | | } |
| | |
| | | @ApiModelProperty(value = "电源类型:1:直流,2:通讯,3配网") |
| | | private Integer powerType; |
| | | |
| | | @JsonFormat(pattern = "yyyy-MM-dd",timezone = "Asia/Shanghai") |
| | | private Date powerInuseTime; |
| | | |
| | | @ApiModelProperty(value = "整流器使能[bit0-模块1 bit15-模块16]【1-可用 0-不可以】") |
| | | private Long modelCfg; |
| | | |
| | | |
| | | |
| | | @ApiModelProperty(value = "设备id") |
| | |
| | | @ApiModelProperty(value = "型号") |
| | | private String battModel; |
| | | |
| | | @TableField(fill = FieldFill.INSERT) |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "Asia/Shanghai") |
| | | private Date createTime; |
| | | |
| | | @JsonFormat(pattern = "yyyy-MM-dd",timezone = "Asia/Shanghai") |
| | | private Date inuseTime; |
| | | |
| | | @ApiModelProperty(value = "标识是否加入电池组1:添加,0不添加") |
| | | private Integer addBinfFlag; |
New file |
| | |
| | | package com.whyc.dto.Real; |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | @Data |
| | | public class AlmDto { |
| | | private String provice; |
| | | private String city; |
| | | private String country; |
| | | private String stationName; |
| | | private String powerName; |
| | | private String battgroupName; |
| | | private List<Integer> almIds; |
| | | private Integer almLevel; |
| | | private Integer pageNum; |
| | | private Integer pageSize; |
| | | private Integer uid; |
| | | |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private Date almStartTime;//开始时间 |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private Date almEndTime;//结束时间 |
| | | } |
New file |
| | |
| | | package com.whyc.dto.Real; |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.util.Date; |
| | | |
| | | @Data |
| | | public class BattHisRealDto { |
| | | @ApiModelProperty(value = "记录时间") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "Asia/Shanghai") |
| | | private Date recordTime; |
| | | |
| | | @ApiModelProperty(value = "组端电压") |
| | | private Float groupVol; |
| | | |
| | | @ApiModelProperty(value = "在线电压") |
| | | private Float onlineVol; |
| | | |
| | | @ApiModelProperty(value = "电池电流") |
| | | private Float groupCurr; |
| | | |
| | | @ApiModelProperty(value = "设备温度") |
| | | private Float groupTmp; |
| | | |
| | | @ApiModelProperty(value = "负载电流") |
| | | private Float loadCurr; |
| | | } |
New file |
| | |
| | | package com.whyc.dto.Real; |
| | | |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | public class CompareDto { |
| | | private Float maxData; |
| | | private Float minData; |
| | | private Float avgData; |
| | | } |
New file |
| | |
| | | package com.whyc.dto.Real; |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.util.Date; |
| | | |
| | | @Data |
| | | public class PwrHisRealAcInDto { |
| | | @ApiModelProperty(value = "更新时间") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "Asia/Shanghai") |
| | | private Date recordDatetime; |
| | | |
| | | @ApiModelProperty(value = "1路交流输入A相电压") |
| | | private Float acin1Vola; |
| | | |
| | | @ApiModelProperty(value = "1路交流输入B相电压") |
| | | private Float acin1Volb; |
| | | |
| | | @ApiModelProperty(value = "交流1路输入C相电压") |
| | | private Float acin1Volc; |
| | | |
| | | @ApiModelProperty(value = "2路交流输入A相电压") |
| | | private Float acin2Vola; |
| | | |
| | | @ApiModelProperty(value = "2路交流输入B相电压") |
| | | private Float acin2Volb; |
| | | |
| | | @ApiModelProperty(value = "2路交流输入C相电压") |
| | | private Float acin2Volc; |
| | | |
| | | @ApiModelProperty(value = "交流1路输入A相电流") |
| | | private Float acin1Curra; |
| | | |
| | | @ApiModelProperty(value = "交流1路输入B相电流") |
| | | private Float acin1Currb; |
| | | |
| | | @ApiModelProperty(value = "交流1路输入C相电流") |
| | | private Float acin1Currc; |
| | | |
| | | @ApiModelProperty(value = "交流2路输入A相电流") |
| | | private Float acin2Curra; |
| | | |
| | | @ApiModelProperty(value = "交流2路输入B相电流") |
| | | private Float acin2Currb; |
| | | |
| | | @ApiModelProperty(value = "交流2路输入C相电流") |
| | | private Float acin2Currc; |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.whyc.dto.Real; |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.util.Date; |
| | | |
| | | @Data |
| | | public class PwrHisRealDcoutInDto { |
| | | @ApiModelProperty(value = "更新时间") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "Asia/Shanghai") |
| | | private Date recordDatetime; |
| | | |
| | | @ApiModelProperty(value = "整流模块总输出电压") |
| | | private Float mOutputvol; |
| | | |
| | | @ApiModelProperty(value = "模块1输出电流") |
| | | private Float m1Outcurr; |
| | | |
| | | @ApiModelProperty(value = "模块2输出电流") |
| | | private Float m2Outcurr; |
| | | |
| | | @ApiModelProperty(value = "模块3输出电流") |
| | | private Float m3Outcurr; |
| | | |
| | | @ApiModelProperty(value = "模块4输出电流") |
| | | private Float m4Outcurr; |
| | | |
| | | @ApiModelProperty(value = "模块5输出电流") |
| | | private Float m5Outcurr; |
| | | |
| | | @ApiModelProperty(value = "模块6输出电流") |
| | | private Float m6Outcurr; |
| | | |
| | | @ApiModelProperty(value = "模块7输出电流") |
| | | private Float m7Outcurr; |
| | | |
| | | @ApiModelProperty(value = "模块8输出电流") |
| | | private Float m8Outcurr; |
| | | |
| | | @ApiModelProperty(value = "模块9输出电流") |
| | | private Float m9Outcurr; |
| | | |
| | | @ApiModelProperty(value = "模块10输出电流") |
| | | private Float m10Outcurr; |
| | | |
| | | @ApiModelProperty(value = "模块11输出电流") |
| | | private Float m11Outcurr; |
| | | |
| | | @ApiModelProperty(value = "模块12输出电流") |
| | | private Float m12Outcurr; |
| | | |
| | | @ApiModelProperty(value = "模块13输出电流") |
| | | private Float m13Outcurr; |
| | | |
| | | @ApiModelProperty(value = "模块14输出电流") |
| | | private Float m14Outcurr; |
| | | |
| | | @ApiModelProperty(value = "模块15输出电流") |
| | | private Float m15Outcurr; |
| | | |
| | | @ApiModelProperty(value = "模块16输出电流") |
| | | private Float m16Outcurr; |
| | | |
| | | @ApiModelProperty(value = "模块1输出电压") |
| | | private Float m1OutVol; |
| | | |
| | | @ApiModelProperty(value = "模块2输出电压") |
| | | private Float m2OutVol; |
| | | |
| | | @ApiModelProperty(value = "模块3输出电压") |
| | | private Float m3OutVol; |
| | | |
| | | @ApiModelProperty(value = "模块4输出电压") |
| | | private Float m4OutVol; |
| | | |
| | | @ApiModelProperty(value = "模块5输出电压") |
| | | private Float m5OutVol; |
| | | |
| | | @ApiModelProperty(value = "模块6输出电压") |
| | | private Float m6OutVol; |
| | | |
| | | @ApiModelProperty(value = "模块7输出电压") |
| | | private Float m7OutVol; |
| | | |
| | | @ApiModelProperty(value = "模块8输出电压") |
| | | private Float m8OutVol; |
| | | |
| | | @ApiModelProperty(value = "模块9输出电压") |
| | | private Float m9OutVol; |
| | | |
| | | @ApiModelProperty(value = "模块10输出电压") |
| | | private Float m10OutVol; |
| | | |
| | | @ApiModelProperty(value = "模块11输出电压") |
| | | private Float m11OutVol; |
| | | |
| | | @ApiModelProperty(value = "模块12输出电压") |
| | | private Float m12OutVol; |
| | | |
| | | @ApiModelProperty(value = "模块13输出电压") |
| | | private Float m13OutVol; |
| | | |
| | | @ApiModelProperty(value = "模块14输出电压") |
| | | private Float m14OutVol; |
| | | |
| | | @ApiModelProperty(value = "模块15输出电压") |
| | | private Float m15OutVol; |
| | | |
| | | @ApiModelProperty(value = "模块16输出电压") |
| | | private Float m16OutVol; |
| | | |
| | | } |
New file |
| | |
| | | package com.whyc.dto.Real; |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import lombok.Data; |
| | | |
| | | import java.sql.Timestamp; |
| | | import java.util.Date; |
| | | |
| | | @Data |
| | | public class QuarterDto { |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8") |
| | | private Date recordTime; |
| | | private Integer monNum; |
| | | private Float numValue; |
| | | } |
New file |
| | |
| | | package com.whyc.dto.Real; |
| | | |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.AllArgsConstructor; |
| | | import lombok.Data; |
| | | import lombok.NoArgsConstructor; |
| | | |
| | | import java.util.Date; |
| | | |
| | | @Data |
| | | @AllArgsConstructor |
| | | @NoArgsConstructor |
| | | public class RealDateDTO { |
| | | @ApiModelProperty(value = "记录时间") |
| | | private Date recordTime; |
| | | @ApiModelProperty(value = "组端电压") |
| | | private Float groupVol; |
| | | @ApiModelProperty(value = "在线电压") |
| | | private Float onlineVol; |
| | | @ApiModelProperty(value = "组端电流") |
| | | private Float groupCurr; |
| | | @ApiModelProperty(value = "单体电压") |
| | | private Float monVol; |
| | | @ApiModelProperty(value = "单体温度") |
| | | private Float monTmp; |
| | | @ApiModelProperty(value = "单体内阻") |
| | | private Float monRes; |
| | | @ApiModelProperty(value = "单体编号") |
| | | private Integer monNum; |
| | | @ApiModelProperty(value = "单体编号") |
| | | private Integer recordNum; |
| | | } |
New file |
| | |
| | | package com.whyc.dto.Real; |
| | | |
| | | import lombok.Data; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | |
| | | @Data |
| | | public class SticRealRtdataDto { |
| | | private Float maxCap; |
| | | private Float minCap; |
| | | private List<Integer> maxCapNumList; |
| | | private List<Integer> minCapNumList; |
| | | private Float maxVol; |
| | | private Float minVol; |
| | | private List<Integer> maxVolNumList; |
| | | private List<Integer> minVolNumList; |
| | | private Float maxTmp; |
| | | private Float minTmp; |
| | | private List<Integer> maxTmpNumList; |
| | | private List<Integer> minTmpNumList; |
| | | private Float maxRes; |
| | | private Float minRes; |
| | | private List<Integer> maxResNumList; |
| | | private List<Integer> minResNumList; |
| | | |
| | | public SticRealRtdataDto() { |
| | | maxCap = 0.0f; |
| | | minCap = 0.0f; |
| | | maxVol = 0.0f; |
| | | minVol = 0.0f; |
| | | maxTmp = 0.0f; |
| | | minTmp = 0.0f; |
| | | maxRes = 0.0f; |
| | | minRes = 0.0f; |
| | | maxCapNumList = new ArrayList<>(); |
| | | minCapNumList = new ArrayList<>(); |
| | | maxVolNumList = new ArrayList<>(); |
| | | minVolNumList = new ArrayList<>(); |
| | | maxTmpNumList = new ArrayList<>(); |
| | | minTmpNumList = new ArrayList<>(); |
| | | maxResNumList = new ArrayList<>(); |
| | | minResNumList = new ArrayList<>(); |
| | | } |
| | | } |
New file |
| | |
| | | package com.whyc.dto.Real; |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import lombok.Data; |
| | | |
| | | import java.util.Date; |
| | | |
| | | @Data |
| | | public class TestDataDto { |
| | | private Float onlineVol; //第一笔放电记录的在线电压 |
| | | private Float groupCurr; //第一笔放电记录的电池电池 |
| | | private Integer testTimeLong; |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | private Date testStarttime; |
| | | private Float testCap; |
| | | private Float realCap; |
| | | private Float restTime; |
| | | private Float monCount; |
| | | private Float moncapstd; |
| | | private Float monvolstd; |
| | | private Integer battgroupId; |
| | | private Integer recordNum; |
| | | private Integer testRecordCount; |
| | | private Float floatchartVol; //浮充电压 |
| | | } |
| | |
| | | |
| | | @Data |
| | | public class TopDto { |
| | | private Integer systemState; |
| | | private Integer devState; |
| | | private Integer battState; |
| | | private Integer systemState; //系统状态 |
| | | private String systemStateName; |
| | | private Integer devState; //设备状态 |
| | | private String devStateName; |
| | | private Integer battState; //电池状态 |
| | | private String battStateName; |
| | | private Integer pwrState; //电源状态 |
| | | private String pwrStateName; |
| | | private Float vbusVol; //母线电压 |
| | | private Float onlineVol; //在线电压 |
| | | private Integer battALmNum;//电池组实时告警数 |
| | | private Integer devALmNum; //设备实时告警数 |
| | | private Integer pwrALmNum; //电源实时告警数 |
| | | private Integer allALmNum; //总实时告警数 |
| | | //仅在设备状态为核容测试有效 |
| | | private Float captestGroupvol; //组端电压 |
| | | private Float captestCurr; //电池电流 |
| | | private Integer captestTimelong; //测试时长 |
| | | private Float captestCap; //测试容量 |
| | | private Float restCap; //预估剩余容量 |
| | | private Float restTime; //预估剩余续航时间 |
| | | private String recordtime; //更新时间 |
| | | private String stationName; |
| | | private String provice; |
| | | private String city; |
| | | private String county; |
| | | private String fullName; |
| | | private String powerName; |
| | | private String devName; |
| | | private String battGroupName; |
| | | |
| | | |
| | | public TopDto() { |
| | | this.systemState = 0; |
| | | this.systemStateName = ""; |
| | | this.devState = 0; |
| | | this.devStateName = ""; |
| | | this.battState = 0; |
| | | this.battStateName = ""; |
| | | this.pwrState = 0; |
| | | this.pwrStateName=""; |
| | | this.vbusVol = 0.0f; |
| | | this.onlineVol = 0.0f; |
| | | this.battALmNum = 0; |
| | | this.devALmNum = 0; |
| | | this.pwrALmNum = 0; |
| | | this.allALmNum = 0; |
| | | this.captestGroupvol = 0.0f; |
| | | this.captestCurr = 0.0f; |
| | | this.captestTimelong = 0; |
| | | this.captestCap = 0.0f; |
| | | this.restCap = 0.0f; |
| | | this.restTime = 0.0f; |
| | | this.allALmNum = 0; |
| | | this.recordtime = "1972-01-01 00:00:00"; |
| | | this.stationName = ""; |
| | | this.provice = ""; |
| | | this.city = ""; |
| | | this.county = ""; |
| | | this.fullName = ""; |
| | | this.powerName = ""; |
| | | this.devName = ""; |
| | | this.battGroupName = ""; |
| | | } |
| | | } |
New file |
| | |
| | | package com.whyc.dto.Statistic; |
| | | |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | public class BanZu { |
| | | private Integer baojiGroupId; |
| | | private String baojiGroupName; |
| | | private Integer dischargeNum; |
| | | private Integer nochargeNum; |
| | | } |
New file |
| | |
| | | package com.whyc.dto.Statistic; |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import lombok.Data; |
| | | |
| | | import java.util.Date; |
| | | |
| | | @Data |
| | | public class BattCompareStic { |
| | | private String provice; |
| | | private String city; |
| | | private String country; |
| | | private String stationName; |
| | | private Integer uid; |
| | | private Integer pageNum; |
| | | private Integer pageSize; |
| | | private Integer performance;//电池性能:1优秀,2劣化,3损坏 4未放电 不传全部 |
| | | private String product; |
| | | private Float moncapstd;//标称容量 |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private Date testStartTime;//开始时间 |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private Date testEndTime;//结束时间 |
| | | |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private Date inuseStartTime;//开始时间 |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private Date inuseEndTime;//结束时间 |
| | | } |
New file |
| | |
| | | package com.whyc.dto.Statistic; |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import lombok.Data; |
| | | |
| | | import java.util.Date; |
| | | |
| | | @Data |
| | | public class BattTinfStic { |
| | | private String provice; |
| | | private String city; |
| | | private String country; |
| | | private String stationName; |
| | | private Integer uid; |
| | | private Integer pageNum; |
| | | private Integer pageSize; |
| | | private Integer testType; |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private Date testStartTime;//开始时间 |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private Date testEndTime;//结束时间 |
| | | } |
New file |
| | |
| | | package com.whyc.dto.Statistic; |
| | | |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | public class DeviceStateStic { |
| | | private String provice; |
| | | private String city; |
| | | private String country; |
| | | private String stationName; |
| | | private Integer uid; |
| | | private Integer pageNum; |
| | | private Integer pageSize; |
| | | private Integer devWorkstate; |
| | | } |
New file |
| | |
| | | package com.whyc.dto.Statistic; |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import lombok.Data; |
| | | |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | @Data |
| | | public class DisChargeStic { |
| | | private String provice; |
| | | private String city; |
| | | private String country; |
| | | private String stationName; |
| | | private Integer disChargeType; //1.已放电 2.未放电 不传全部 |
| | | private Integer uid; |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private Date testStartTime;//开始时间 |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private Date testEndTime;//结束时间 |
| | | private Integer pageNum; |
| | | private Integer pageSize; |
| | | private List<Integer> typeList; //停止原因集合 |
| | | private Integer stopReasonType; //0全部,1符合筛选条件的放电记录 |
| | | } |
New file |
| | |
| | | package com.whyc.dto.Statistic; |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import lombok.Data; |
| | | |
| | | import java.util.Date; |
| | | |
| | | @Data |
| | | public class MonStic { |
| | | private String product; |
| | | @JsonFormat(pattern = "yyyy-MM-dd",timezone = "Asia/Shanghai") |
| | | private Date startTime; |
| | | @JsonFormat(pattern = "yyyy-MM-dd",timezone = "Asia/Shanghai") |
| | | private Date endTime; |
| | | private Float moncapstd; |
| | | private Float monvolstd; |
| | | private Integer uid; |
| | | private String topPic; //头部柱状图 |
| | | private String goodVolPic ; //优秀电压图 |
| | | private String goodResPic ; //优秀内阻 |
| | | private String badVolPic ; //劣化电压图 |
| | | private String badResPic ; //劣化内阻 |
| | | private String damageVolPic ; //损坏电压图 |
| | | private String damageResPic ; //损坏内阻 |
| | | } |
New file |
| | |
| | | package com.whyc.dto.Statistic; |
| | | |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | public class PerformanceRes { |
| | | private String provice; |
| | | private String city; |
| | | private String country; |
| | | private String stationName; |
| | | private String battgroupName; |
| | | private Float monvolstd; |
| | | private Float moncapstd; |
| | | private Float moncount; |
| | | private String product; |
| | | private Integer inuseYear; |
| | | private Float realCap; //实际容量 |
| | | private String capperformance; //性能 |
| | | } |
New file |
| | |
| | | package com.whyc.dto.Statistic; |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import lombok.Data; |
| | | |
| | | import java.util.Date; |
| | | |
| | | @Data |
| | | public class PerformanceStic { |
| | | private String provice; |
| | | private String city; |
| | | private String country; |
| | | private String stationName; |
| | | private Integer performance;//电池性能:1优秀,2劣化,3损坏 4未放电 不传全部 |
| | | private Integer uid; |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private Date testStartTime;//开始时间 |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private Date testEndTime;//结束时间 |
| | | private Integer pageNum; |
| | | private Integer pageSize; |
| | | } |
New file |
| | |
| | | package com.whyc.dto.Statistic; |
| | | |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | public class StationStic { |
| | | private String provice; |
| | | private String city; |
| | | private String country; |
| | | private String stationName; |
| | | private String product; |
| | | private Float monvolstd; |
| | | private Integer uid; |
| | | private String stationType; |
| | | private Integer pageNum; |
| | | private Integer pageSize; |
| | | private String company; //电源厂家品牌 |
| | | } |
New file |
| | |
| | | package com.whyc.dto.Statistic; |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | @Data |
| | | public class SticCompare15Res { |
| | | private String provice; |
| | | private String city; |
| | | private String country; |
| | | private String stationName; |
| | | private String battgroupName; |
| | | private String devName; |
| | | private String product; |
| | | @JsonFormat(pattern = "yyyy-MM-dd") |
| | | private Date inuseTime; |
| | | private Float monvolstd; |
| | | private List<Integer> monNums; //损坏单体编号 |
| | | private Float realCap; //实际容量 |
| | | private String precentCap; //容量百分比 |
| | | private String capperformance; //性能 |
| | | private Integer stationId; |
| | | private Integer powerId; |
| | | private Integer devId; |
| | | private Integer battgroupId; |
| | | } |
New file |
| | |
| | | package com.whyc.dto.Statistic; |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import lombok.Data; |
| | | |
| | | import java.util.Date; |
| | | |
| | | @Data |
| | | public class SticCompare16Res { |
| | | private String provice; |
| | | private String city; |
| | | private String country; |
| | | private String stationName; |
| | | private String battgroupName; |
| | | private String devName; |
| | | private String product; |
| | | @JsonFormat(pattern = "yyyy-MM-dd") |
| | | private Date inuseTime; |
| | | private Float monvolstd; |
| | | private Float moncapstd; |
| | | private String stopReason; |
| | | private Float score; //评分 |
| | | private Float realCap; //实际容量 |
| | | private String precentCap; //容量百分比 |
| | | private String capperformance; //性能 |
| | | private Integer stationId; |
| | | private Integer powerId; |
| | | private Integer devId; |
| | | private Integer battgroupId; |
| | | } |
New file |
| | |
| | | package com.whyc.dto.Statistic; |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import lombok.Data; |
| | | |
| | | import java.util.Date; |
| | | |
| | | @Data |
| | | public class SticCompare17Res { |
| | | private String provice; |
| | | private String city; |
| | | private String country; |
| | | private String stationName; |
| | | private String battgroupName; |
| | | private String devName; |
| | | private String product; |
| | | @JsonFormat(pattern = "yyyy-MM-dd") |
| | | private Date inuseTime; |
| | | private Float monvolstd; |
| | | private Integer monNum;//单体编号 |
| | | private Float monrealCap; //单体实际容量 |
| | | private String monprecentCap; //单体容量百分比 |
| | | private String moncapperformance; //单体性能 |
| | | private Integer stationId; |
| | | private Integer powerId; |
| | | private Integer devId; |
| | | private Integer battgroupId; |
| | | } |
New file |
| | |
| | | package com.whyc.dto.Statistic; |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import lombok.Data; |
| | | |
| | | import java.util.Date; |
| | | |
| | | @Data |
| | | public class SticDischarge5Res { |
| | | private String provice; |
| | | private String city; |
| | | private String country; |
| | | private String stationName; |
| | | private String battgroupName; |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private Date testStartTime; |
| | | private Float realCap; //实际容量 |
| | | private Integer testTimelong; //测试时长 |
| | | private Float testCap; //测试容量 |
| | | private String stopReason; //停止原因 |
| | | private String capperformance; //电池性能 |
| | | private Integer disChargeType; //1.已放电 2.未放电 不传全部 |
| | | } |
New file |
| | |
| | | package com.whyc.dto.Statistic; |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import com.whyc.pojo.db_batt_testdata.BatttestdataInf; |
| | | import lombok.Data; |
| | | |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | @Data |
| | | public class SticDischarge6Res { |
| | | private String provice; |
| | | private String city; |
| | | private String country; |
| | | private String stationName; |
| | | private String battgroupName; |
| | | private Float monvolstd; |
| | | private Float moncapstd; |
| | | private Float moncount; |
| | | private String product; |
| | | private Integer errorNum; |
| | | private List<String> stopList; |
| | | private BatttestdataInf tinf; |
| | | private Integer stopReasonType; //0全部,1符合筛选条件的放电记录 |
| | | } |
New file |
| | |
| | | package com.whyc.dto.Statistic; |
| | | |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | public class SticMonRes { |
| | | private Integer battgroupId; |
| | | private String stationName; |
| | | private String devName; |
| | | private String battgroupName; |
| | | private Integer monNum; |
| | | private Float monVol; |
| | | private Float monRes; |
| | | } |
New file |
| | |
| | | package com.whyc.factory; |
| | | |
| | | public class BattCapFactory { |
| | | public static int CapType_Rest = 0; //当查询剩余容量时传递 |
| | | public static int CapType_Real = 1; //当查询实际容量时传递 |
| | | |
| | | public static int CapType_type=2; //容量 |
| | | public static int CapType_name=1; //次低 |
| | | public static int CapType_method=0; //标称 |
| | | // 获取标纯电流 |
| | | public static double GetFDCurrent(double stdcap, int hourrate) |
| | | { |
| | | double res = 0.055; |
| | | switch(hourrate) |
| | | { |
| | | case 1: res = 0.514; break; |
| | | case 2: res = 0.306; break; |
| | | case 3: res = 0.250; break; |
| | | case 4: res = 0.200; break; |
| | | case 5: res = 0.166; break; |
| | | case 6: res = 0.146; break; |
| | | case 7: res = 0.131; break; |
| | | case 8: res = 0.118; break; |
| | | case 9: res = 0.108; break; |
| | | case 10: res = 0.100; break; |
| | | case 20: res = 0.055; break; |
| | | default: res = 0.055; break; |
| | | } |
| | | |
| | | return (stdcap * res); |
| | | } |
| | | //------------------------------------------------------------------------------ |
| | | //------------------------------------------------------------------------------ |
| | | // 获取放电小时率 stdah:标纯容量 current:当前电流 |
| | | public static int GetHourRate(double stdah, double current) |
| | | { |
| | | int index = 0; |
| | | double value[]={5.14, 3.06, 2.50, 2.00, 1.66, 1.46, 1.31, 1.18, 1.08, 1.00, 0.55, 0.40}; |
| | | double res; |
| | | current = Math.abs(current); |
| | | res = current/(stdah/10); |
| | | if(res >= 5.14) return 1; |
| | | else if(res <= 0.55) return 20; |
| | | else |
| | | { |
| | | for(index=0; index<10; index++) |
| | | { |
| | | if((res<=value[index]) && (res>value[index+1])) |
| | | break; |
| | | else continue; |
| | | } |
| | | if((value[index]-res) < (res-value[index+1])) |
| | | { |
| | | return (index+1); |
| | | } |
| | | else |
| | | { |
| | | if(index+2 > 10) return (20); |
| | | else return (index+2); |
| | | } |
| | | } |
| | | } |
| | | //------------------------------------------------------------------------------ |
| | | //------------------------------------------------------------------------------ |
| | | public static double N_TO_10H(int n_H) |
| | | { |
| | | switch(n_H) |
| | | { |
| | | case 1 : return(1/0.55); |
| | | case 2 : return(1/0.61); |
| | | case 3 : return(1/0.75); |
| | | case 4 : return(1/0.79); |
| | | case 5 : return(1/0.833); |
| | | case 6 : return(1/0.876); |
| | | case 7 : return(1/0.917); |
| | | case 8 : return(1/0.944); |
| | | case 9 : return(1/0.974); |
| | | case 10: return(1/1); |
| | | case 20: return(1/1.1); |
| | | } |
| | | return 1.0; |
| | | } |
| | | //------------------------------------------------------------------------------- |
| | | //------------------------------------------------------------------------------- |
| | | //获取剩余容量 STDAH:标称容量 HourRate:放电小时率 SumAH:测试容量 MaxMonomerVol:最大电池电压 MonomerVol:当前电池组的最低单体电压 |
| | | //MonomerVolType:电池电压类型 电池标称电压 2v,6v,12v CapType:容量类型(定值是常量) |
| | | |
| | | //小时率 已测试容量 最容量 |
| | | public static double GetMonomerCap(double STDAH, int HourRate, double SumAH, double MaxMonomerVol, |
| | | |
| | | double MonomerVol, double MonomerVolType, int CapType) |
| | | { |
| | | if((MaxMonomerVol - MonomerVolType*0.9) <= 0) |
| | | return 0; |
| | | |
| | | if(SumAH < 0) |
| | | SumAH *= (-1); |
| | | |
| | | double tmp_cap; |
| | | tmp_cap = MonomerVol - MonomerVolType * 0.9; |
| | | tmp_cap *= (STDAH - SumAH * N_TO_10H(HourRate)); |
| | | double dt_vol = MaxMonomerVol - MonomerVolType*0.9; |
| | | if(dt_vol < 0.01) |
| | | dt_vol = 0.01; |
| | | tmp_cap = tmp_cap/dt_vol; |
| | | if(tmp_cap < 0) |
| | | tmp_cap = 0; |
| | | |
| | | if(CapType == CapType_Rest) |
| | | return tmp_cap; |
| | | else if(CapType == CapType_Real) |
| | | return (tmp_cap + SumAH * N_TO_10H(HourRate)); |
| | | else |
| | | return ((tmp_cap + SumAH * N_TO_10H(HourRate))*100 / STDAH); |
| | | } |
| | | //---------------------------------------------------------------------------------- |
| | | //---------------------------------------------------------------------------------- |
| | | //获取后备时间 |
| | | public static int GetRestTimeSecond(double restcap, double curr) |
| | | { |
| | | double tmp_curr = Math.abs(curr); |
| | | if(tmp_curr < 0.1) |
| | | tmp_curr = 0.1; |
| | | |
| | | int rest_time = (int)((restcap / tmp_curr) * 3600); |
| | | if(rest_time > (99*3600)) |
| | | rest_time = (99*3600); |
| | | |
| | | return rest_time; |
| | | } |
| | | /*//判断通过实际容量判断某次放电测试是否有效 |
| | | *//* |
| | | * STDAH:标存容量 |
| | | * param:容量有效参数*//* |
| | | public static int Judge(double realCap,float param,double STDAH){ |
| | | int flag=0; |
| | | if(Math.abs(realCap)>(param*STDAH)){ |
| | | flag=1; |
| | | }else{ |
| | | flag=0; |
| | | } |
| | | return flag; |
| | | } |
| | | //判断通过实际容量判断某次放电测试是否有效 |
| | | *//* |
| | | * STDAH:标存容量 |
| | | * param:容量告警参数*//* |
| | | public static int JudgeAlarm(double realCap,float param,float Cparam,double STDAH){ |
| | | int flag=0; |
| | | if(realCap>(param*STDAH)){ |
| | | flag=1; |
| | | }else{ |
| | | if(realCap<(Cparam*STDAH)){ |
| | | flag=AlarmDaoFactory.Alarm_CapChange; |
| | | }else{ |
| | | flag=AlarmDaoFactory.Alarm_CapAlarm; |
| | | } |
| | | |
| | | } |
| | | return flag; |
| | | }*/ |
| | | |
| | | /** |
| | | * 电池组的续航时长计算,单位:分钟 |
| | | */ |
| | | public static float getTheoryTime(float loadCurr, float restcap, float battGroupCapStd){ |
| | | double realCurr = 53*loadCurr/45; |
| | | double hourRate = N_TO_10H(GetHourRate((int) Math.floor(battGroupCapStd), realCurr)); |
| | | float theoryTimeHour = realCurr == 0?0: (float) (restcap / hourRate / realCurr); |
| | | return theoryTimeHour*60; |
| | | } |
| | | } |
| | |
| | | .setPowerType(info.getPowerType()) |
| | | .setPowerModel(info.getPowerModel()) |
| | | .setProtocol(info.getProtocol()) |
| | | .setPowerIp(info.getPowerIp()); |
| | | .setPowerIp(info.getPowerIp()) |
| | | .setModelCfg(info.getModelCfg()) |
| | | .setPowerInuseTime(info.getPowerInuseTime()); |
| | | if(info.getPowerId()!=null){ |
| | | pinf.setPowerId(info.getPowerId()); |
| | | } |
| | |
| | | if(info.getDevName()!=null){ |
| | | binf.setDevName(info.getDevName()); |
| | | } |
| | | if(info.getInuseTime()!=null){ |
| | | binf.setInuseTime(info.getInuseTime()); |
| | | } |
| | | return binf; |
| | | } |
| | | } |
| | |
| | | private static ThreadPoolExecutor init() { |
| | | //线程池初始化,拒绝策略为丢弃 |
| | | UserThreadFactory userThreadFactory = new UserThreadFactory("br"); |
| | | ThreadPoolExecutor pool = new ThreadPoolExecutor(8, 48, 10, TimeUnit.SECONDS, new LinkedBlockingDeque<>(16), userThreadFactory,new ThreadPoolExecutor.AbortPolicy()); |
| | | ThreadPoolExecutor pool = new ThreadPoolExecutor(10, 48, 10, TimeUnit.SECONDS, new LinkedBlockingDeque<>(16), userThreadFactory,new ThreadPoolExecutor.AbortPolicy()); |
| | | poolExecutor = pool; |
| | | return pool; |
| | | } |
| | |
| | | resp.setHeader("X-XSS-Protection","1; mode=block"); |
| | | resp.setHeader("X-Download-Options","noopen"); |
| | | resp.setHeader("Strict-Transport-Security","max-age=63072000; includeSubdomains; preload"); |
| | | |
| | | resp.setHeader("Access-Control-Expose-Headers", "Content-Disposition"); |
| | | //单页面应用,只允许一个页面index.html |
| | | String servletPath = req.getServletPath(); |
| | | if(servletPath.contains(".html")){ |
New file |
| | |
| | | package com.whyc.mapper; |
| | | |
| | | import com.whyc.pojo.db_ram_db.AlmparamFromDevice; |
| | | |
| | | public interface AlmparamFromDeviceMapper extends CustomMapper<AlmparamFromDevice>{ |
| | | } |
New file |
| | |
| | | package com.whyc.mapper; |
| | | |
| | | import com.whyc.pojo.db_param.AppParam; |
| | | |
| | | public interface AppParamMapper extends CustomMapper<AppParam>{ |
| | | } |
New file |
| | |
| | | package com.whyc.mapper; |
| | | |
| | | import com.whyc.dto.Real.AlmDto; |
| | | import com.whyc.pojo.db_param.BattAlmparam; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.List; |
| | | |
| | | public interface BattAlmparamMapper extends CustomMapper<BattAlmparam>{ |
| | | //获取电池告警参数 |
| | | List<BattAlmparam> getBattAlmParam(@Param("almDto") AlmDto almDto); |
| | | } |
| | |
| | | |
| | | import com.whyc.dto.BattDto; |
| | | import com.whyc.dto.InfoDto; |
| | | import com.whyc.dto.Statistic.*; |
| | | import com.whyc.pojo.db_station.BattInf; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | |
| | | |
| | | //获取标称内阻(下拉) |
| | | List<Float> getMonResByUid(@Param("uid") Integer uid); |
| | | //设备信息统计 |
| | | List<BattInf> getDevStatistic(@Param("stic") StationStic stic); |
| | | //获取设备下电池组个数 |
| | | Integer getBattCountBydevId(Integer devId); |
| | | //蓄电池组信息统计 |
| | | List<BattInf> getBattStatistic(@Param("stic") StationStic stic); |
| | | //单体统计查询符合条件的电池组 |
| | | List<BattInf> getMonStatistic(@Param("stic") MonStic stic); |
| | | //蓄电池组对比分析界面 |
| | | List<BattInf> getBattCompare15Statistic(@Param("stic") BattCompareStic stic); |
| | | //蓄电池组对比分析界面 |
| | | List<BattInf> getBattCompare16Statistic(@Param("stic") BattCompareStic stic); |
| | | //蓄电池组对比分析界面 |
| | | List<BattInf> getBattCompare17Statistic(@Param("stic") BattCompareStic stic); |
| | | //本年度已放电数量统计(1.2.5) |
| | | List<BattInf> getDischr5Statistic(@Param("stic") DisChargeStic stic); |
| | | //本年度已放电数量统计(1.2.6) |
| | | List<BattInf> getDischr6Statistic(@Param("stic") DisChargeStic stic); |
| | | //电池组电池性能统计(未放电,优秀,劣化,损坏)统计(1.2.8/9/10) |
| | | List<BattInf> getPerformanceStatistic(@Param("stic") PerformanceStic stic); |
| | | } |
New file |
| | |
| | | package com.whyc.mapper; |
| | | |
| | | import com.whyc.pojo.db_ram_db.BattRtdata; |
| | | |
| | | public interface BattRtdataMapper extends CustomMapper<BattRtdata>{ |
| | | } |
New file |
| | |
| | | package com.whyc.mapper; |
| | | |
| | | import com.whyc.pojo.db_ram_db.BattRtstate; |
| | | |
| | | public interface BattRtstateMapper extends CustomMapper<BattRtstate>{ |
| | | } |
New file |
| | |
| | | package com.whyc.mapper; |
| | | |
| | | import com.whyc.dto.Real.AlmDto; |
| | | import com.whyc.pojo.db_alarm.BattalarmData; |
| | | |
| | | import java.util.List; |
| | | |
| | | public interface BattalarmDataMapper extends CustomMapper<BattalarmData>{ |
| | | //获取电池组实时告警信息 |
| | | List<BattalarmData> getBattAlmReal(AlmDto almDto); |
| | | } |
New file |
| | |
| | | package com.whyc.mapper; |
| | | |
| | | import com.whyc.pojo.db_batt_testdata.BattresdataInf; |
| | | |
| | | public interface BattresdataInfMapper extends CustomMapper<BattresdataInf>{ |
| | | } |
New file |
| | |
| | | package com.whyc.mapper; |
| | | |
| | | import com.whyc.dto.Statistic.BattTinfStic; |
| | | import com.whyc.pojo.db_batt_testdata.BatttestdataInf; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | public interface BatttestdataInfMapper extends CustomMapper<BatttestdataInf>{ |
| | | //蓄电池核容信息统计 |
| | | List<BatttestdataInf> getBattTinfStatistic(@Param("stic") BattTinfStic stic); |
| | | //获取电池组未放电记录(指定时间段的标准核容放电) |
| | | List<BatttestdataInf> getNoDischargeData(@Param("battgroupId") Integer battgroupId,@Param("testStartTime") Date testStartTime |
| | | , @Param("testEndTime") Date testEndTime, @Param("typeList") List<Integer> typeList); |
| | | } |
| | |
| | | //Object getMaxValue(String schema,String table,String field,String valuePrefix); |
| | | Object getMaxValue(@Param("schema") String schema,@Param("table") String table,@Param("field") String field); |
| | | |
| | | boolean existTable(String dbName, String tableName); |
| | | String existTable(String dbName, String tableName); |
| | | |
| | | //void truncate(String dbName, String tableName); |
| | | |
New file |
| | |
| | | package com.whyc.mapper; |
| | | |
| | | import com.whyc.dto.Real.AlmDto; |
| | | import com.whyc.pojo.db_param.BattAlmparam; |
| | | import com.whyc.pojo.db_param.DevAlmparam; |
| | | |
| | | import java.util.List; |
| | | |
| | | public interface DevAlmparamMapper extends CustomMapper<DevAlmparam>{ |
| | | } |
New file |
| | |
| | | package com.whyc.mapper; |
| | | |
| | | import com.whyc.dto.Real.AlmDto; |
| | | import com.whyc.pojo.db_alarm.BattalarmData; |
| | | import com.whyc.pojo.db_alarm.DevalarmData; |
| | | |
| | | import java.util.List; |
| | | |
| | | public interface DevalarmDataMapper extends CustomMapper<DevalarmData>{ |
| | | //获取设备实时告警信息 |
| | | List<DevalarmData> getDevAlmReal(AlmDto almDto); |
| | | } |
New file |
| | |
| | | package com.whyc.mapper; |
| | | |
| | | import com.whyc.pojo.db_ram_db.DeviceSetparam; |
| | | |
| | | public interface DeviceSetparamMapper extends CustomMapper<DeviceSetparam>{ |
| | | //设置放电参数 |
| | | Boolean updateParam(DeviceSetparam param); |
| | | //读取放电参数 |
| | | DeviceSetparam getParam(int devId, int battGroupNum); |
| | | } |
New file |
| | |
| | | package com.whyc.mapper; |
| | | |
| | | import com.whyc.dto.Statistic.DeviceStateStic; |
| | | import com.whyc.pojo.db_ram_db.DeviceState; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.List; |
| | | |
| | | public interface DeviceStateMapper extends CustomMapper<DeviceState>{ |
| | | //设备工作状态统计 |
| | | List<DeviceState> getDeviceStateStatistic(@Param("stic") DeviceStateStic stic); |
| | | } |
| | |
| | | package com.whyc.mapper; |
| | | |
| | | import com.whyc.dto.PowerDto; |
| | | import com.whyc.dto.Statistic.StationStic; |
| | | import com.whyc.pojo.db_station.PowerInf; |
| | | import com.whyc.pojo.db_station.StationInf; |
| | | import org.apache.ibatis.annotations.Param; |
| | |
| | | List<String> getPowerModelByUid(Integer uid); |
| | | //获取电源协议(下拉) |
| | | List<String> getProtocolByUid(Integer uid); |
| | | //电源信息统计 |
| | | List<PowerInf> getPowerStatistic(@Param("stic") StationStic stic); |
| | | //查询机房所在的班组 |
| | | String getGroupName(Integer powerId); |
| | | } |
New file |
| | |
| | | package com.whyc.mapper; |
| | | |
| | | import com.whyc.pojo.db_ram_db.PwrdevAcdcdata; |
| | | |
| | | public interface PwrdevAcdcdataMapper extends CustomMapper<PwrdevAcdcdata>{ |
| | | } |
New file |
| | |
| | | package com.whyc.mapper; |
| | | |
| | | import com.whyc.dto.Real.AlmDto; |
| | | import com.whyc.pojo.db_pwrdev_alarm.PwrdevAlarm; |
| | | |
| | | import java.util.List; |
| | | |
| | | public interface PwrdevAlarmMapper extends CustomMapper<PwrdevAlarm>{ |
| | | //获取电源实时告警信息 |
| | | List<PwrdevAlarm> getPwrAlmReal(AlmDto almDto); |
| | | } |
New file |
| | |
| | | package com.whyc.mapper; |
| | | |
| | | import com.whyc.dto.Real.AlmDto; |
| | | import com.whyc.pojo.db_pwrdev_alarm.PwrdevAlarmParam; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.List; |
| | | |
| | | public interface PwrdevAlarmParamMapper extends CustomMapper<PwrdevAlarmParam>{ |
| | | //获取电源告警参数 |
| | | List<PwrdevAlarmParam> getPwrAlmParam(@Param("almDto") AlmDto almDto); |
| | | } |
New file |
| | |
| | | package com.whyc.mapper; |
| | | |
| | | import com.whyc.pojo.db_pwrdev_alarm.PwrdevAlarmParamStand; |
| | | |
| | | public interface PwrdevAlarmParamStandMapper extends CustomMapper<PwrdevAlarmParamStand>{ |
| | | } |
| | |
| | | package com.whyc.mapper; |
| | | |
| | | import com.whyc.dto.Station.Provice; |
| | | import com.whyc.dto.Statistic.StationStic; |
| | | import com.whyc.pojo.db_station.PowerInf; |
| | | import com.whyc.pojo.db_station.StationInf; |
| | | import org.apache.ibatis.annotations.Param; |
| | |
| | | List<PowerInf> getPowerByUid(@Param("uid") Integer uid, @Param("provice") String provice, @Param("city") String city, @Param("country") String country, @Param("stationName") String stationName); |
| | | //获取电压等级(下拉) |
| | | List<String> getStationTypeByUid(@Param("uid") Integer uid); |
| | | //站点信息统计 |
| | | List<StationInf> getStationStatistic(@Param("stic") StationStic stic); |
| | | } |
| | |
| | | package com.whyc.pojo.db_alarm; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import io.swagger.annotations.ApiModel; |
| | |
| | | @ApiModelProperty(value = "告警类型") |
| | | private Integer almSignalId; |
| | | |
| | | @TableField(exist = false) |
| | | private String almName; |
| | | |
| | | @ApiModelProperty(value = "告警等级") |
| | | private Integer almLevel; |
| | | |
| | |
| | | @ApiModelProperty(value = "告警重要等级[0:重要;1:紧急]") |
| | | private Integer almSeverity; |
| | | |
| | | @TableField(exist = false) |
| | | private String battgroupName; |
| | | |
| | | @TableField(exist = false) |
| | | private String stationName; |
| | | @TableField(exist = false) |
| | | private String provice; |
| | | @TableField(exist = false) |
| | | private String city; |
| | | @TableField(exist = false) |
| | | private String country; |
| | | @TableField(exist = false) |
| | | private String fullName; |
| | | |
| | | } |
| | |
| | | package com.whyc.pojo.db_alarm; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import io.swagger.annotations.ApiModel; |
| | |
| | | @ApiModelProperty(value = "电池告警ID") |
| | | private Integer almId; |
| | | |
| | | @TableField(exist = false) |
| | | private String almName; |
| | | |
| | | @ApiModelProperty(value = "告警类型") |
| | | private Integer almSignalId; |
| | | |
| | |
| | | @ApiModelProperty(value = "告警重要等级[0:重要;1:紧急]") |
| | | private Integer almSeverity; |
| | | |
| | | @TableField(exist = false) |
| | | private String stationName;//机房名称 |
| | | @TableField(exist = false) |
| | | private String provice;//机房名称 |
| | | @TableField(exist = false) |
| | | private String city;//机房名称 |
| | | @TableField(exist = false) |
| | | private String country;//机房名称 |
| | | @TableField(exist = false) |
| | | private String battgroupName;//电池组名称 |
| | | |
| | | } |
| | |
| | | package com.whyc.pojo.db_alarm; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import io.swagger.annotations.ApiModel; |
| | |
| | | @ApiModelProperty(value = "告警ID") |
| | | private Integer almId; |
| | | |
| | | @TableField(exist = false) |
| | | private String almName; |
| | | |
| | | @ApiModelProperty(value = "告警等级") |
| | | private Integer almLevel; |
| | | |
| | |
| | | private Integer almSeverity; |
| | | |
| | | |
| | | @TableField(exist = false) |
| | | private String devName; |
| | | |
| | | @TableField(exist = false) |
| | | private String stationName; |
| | | |
| | | @TableField(exist = false) |
| | | private String provice; |
| | | @TableField(exist = false) |
| | | private String city; |
| | | @TableField(exist = false) |
| | | private String country; |
| | | @TableField(exist = false) |
| | | private String fullName; |
| | | |
| | | } |
| | |
| | | package com.whyc.pojo.db_alarm; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import io.swagger.annotations.ApiModel; |
| | |
| | | @ApiModelProperty(value = "告警ID") |
| | | private Integer almId; |
| | | |
| | | @TableField(exist = false) |
| | | private String almName; |
| | | |
| | | @ApiModelProperty(value = "告警等级") |
| | | private Integer almLevel; |
| | | |
| | |
| | | @ApiModelProperty(value = "告警重要等级[0:重要;1:紧急]") |
| | | private Integer almSeverity; |
| | | |
| | | @TableField(exist = false) |
| | | private String stationName; |
| | | @TableField(exist = false) |
| | | private String provice; |
| | | @TableField(exist = false) |
| | | private String city; |
| | | @TableField(exist = false) |
| | | private String country; |
| | | @TableField(exist = false) |
| | | private String devName; |
| | | |
| | | } |
New file |
| | |
| | | package com.whyc.pojo.db_batt_testdata; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | import lombok.experimental.Accessors; |
| | | |
| | | import java.io.Serializable; |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * <p> |
| | | * 电池组内阻测试详情表 |
| | | * </p> |
| | | * |
| | | * @author lxw |
| | | * @since 2025-05-29 |
| | | */ |
| | | @Data |
| | | @EqualsAndHashCode(callSuper = false) |
| | | @Accessors(chain = true) |
| | | @ApiModel(value="BattresdataId", description="电池组内阻测试详情表") |
| | | public class BattresdataId implements Serializable { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | @ApiModelProperty(value = "自增主键") |
| | | @TableId(value = "num", type = IdType.AUTO) |
| | | private Long num; |
| | | |
| | | @ApiModelProperty(value = "电池组ID") |
| | | private Integer battgroupId; |
| | | |
| | | @ApiModelProperty(value = "测试次数") |
| | | private Integer testRecordCount; |
| | | |
| | | @ApiModelProperty(value = "测试类型") |
| | | private Integer testType; |
| | | |
| | | @ApiModelProperty(value = "是否是最新数据") |
| | | private Integer dataNew; |
| | | |
| | | @ApiModelProperty(value = "数据是否有效") |
| | | private Integer dataAvailable; |
| | | |
| | | @ApiModelProperty(value = "测试开始时间") |
| | | private Date testStarttime; |
| | | |
| | | @ApiModelProperty(value = "组端电压") |
| | | private Float groupVol; |
| | | |
| | | @ApiModelProperty(value = "测试电流") |
| | | private Float testCurr; |
| | | |
| | | @ApiModelProperty(value = "单体编号") |
| | | private Integer monNum; |
| | | |
| | | @ApiModelProperty(value = "单体电压") |
| | | private Float monVol; |
| | | |
| | | @ApiModelProperty(value = "单体温度") |
| | | private Float monTmp; |
| | | |
| | | @ApiModelProperty(value = "单体内阻") |
| | | private Float monRes; |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.whyc.pojo.db_batt_testdata; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | import lombok.experimental.Accessors; |
| | | |
| | | import java.io.Serializable; |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * <p> |
| | | * 内阻测试总表 |
| | | * </p> |
| | | * |
| | | * @author lxw |
| | | * @since 2025-05-29 |
| | | */ |
| | | @Data |
| | | @EqualsAndHashCode(callSuper = false) |
| | | @Accessors(chain = true) |
| | | @TableName(schema = "db_batt_testdata",value ="tb_battresdata_inf") |
| | | @ApiModel(value="BattresdataInf对象", description="内阻测试总表") |
| | | public class BattresdataInf implements Serializable { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | @ApiModelProperty(value = "自增主键") |
| | | @TableId(value = "num", type = IdType.AUTO) |
| | | private Long num; |
| | | |
| | | @ApiModelProperty(value = "电池组ID") |
| | | private Integer battgroupId; |
| | | |
| | | @ApiModelProperty(value = "测试次数") |
| | | private Integer testRecordCount; |
| | | |
| | | @ApiModelProperty(value = "下一次测试次数") |
| | | private Integer testRecordCountEx; |
| | | |
| | | @ApiModelProperty(value = "测试类型") |
| | | private Integer testType; |
| | | |
| | | @ApiModelProperty(value = "是否是最新数据") |
| | | private Integer dataNew; |
| | | |
| | | @ApiModelProperty(value = "数据是否有效") |
| | | private Integer dataAvailable; |
| | | |
| | | @ApiModelProperty(value = "测试开始时间") |
| | | private Date testStarttime; |
| | | |
| | | @ApiModelProperty(value = "记录时间") |
| | | private Date recordTime; |
| | | |
| | | @ApiModelProperty(value = "组端电压") |
| | | private Float groupVol; |
| | | |
| | | @ApiModelProperty(value = "测试电流") |
| | | private Float testCurr; |
| | | |
| | | |
| | | } |
| | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | @TableId(value = "num", type = IdType.AUTO) |
| | | private Long num; |
| | | private Integer num; |
| | | |
| | | @ApiModelProperty(value = "电池组ID") |
| | | private Integer battgroupId; |
| | |
| | | package com.whyc.pojo.db_batt_testdata; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.AllArgsConstructor; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | import lombok.NoArgsConstructor; |
| | | import lombok.experimental.Accessors; |
| | | |
| | | import java.io.Serializable; |
| | |
| | | @Data |
| | | @EqualsAndHashCode(callSuper = false) |
| | | @Accessors(chain = true) |
| | | @AllArgsConstructor |
| | | @NoArgsConstructor |
| | | @TableName(schema = "db_batt_testdata",value ="tb_batttestdata_inf") |
| | | @ApiModel(value="BatttestdataInf对象", description="电池组历史测试数据总表") |
| | | public class BatttestdataInf implements Serializable { |
| | |
| | | @ApiModelProperty(value = "测试停止原因") |
| | | private Integer testStoptype; |
| | | |
| | | @ApiModelProperty(value = "测试停止原因") |
| | | @TableField(exist = false) |
| | | private String testStoptypeReason; |
| | | |
| | | @ApiModelProperty(value = "在线电压") |
| | | private Float onlineVol; |
| | | |
| | |
| | | @ApiModelProperty(value = "山西61850监测放电数据标识【0:监测放电;1停电放电】") |
| | | private Integer testDatatype; |
| | | |
| | | @TableField(exist = false) |
| | | private String stationName; |
| | | |
| | | @TableField(exist = false) |
| | | private Integer stationId; |
| | | |
| | | @TableField(exist = false) |
| | | private Integer powerId; |
| | | |
| | | @TableField(exist = false) |
| | | private Integer devId; |
| | | |
| | | @TableField(exist = false) |
| | | private String battgroupName; |
| | | |
| | | @TableField(exist = false) |
| | | private String provice; |
| | | @TableField(exist = false) |
| | | private String city; |
| | | @TableField(exist = false) |
| | | private String country; |
| | | @TableField(exist = false) |
| | | private String fullName; |
| | | |
| | | @TableField(exist = false) |
| | | private Float restCap; |
| | | @TableField(exist = false) |
| | | private Float restTime; |
| | | |
| | | @TableField(exist = false) |
| | | private Float realCap; |
| | | |
| | | @TableField(exist = false) |
| | | private String precentCap; |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.whyc.pojo.db_data_history; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | import lombok.experimental.Accessors; |
| | | |
| | | import java.io.Serializable; |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * <p> |
| | | * 电池组1000288_2025_04历史实时数据表 |
| | | * </p> |
| | | * |
| | | * @author lxw |
| | | * @since 2025-05-29 |
| | | */ |
| | | @Data |
| | | @EqualsAndHashCode(callSuper = false) |
| | | @Accessors(chain = true) |
| | | @ApiModel(value="BattRealdataId", description="电池组历史实时数据表") |
| | | public class BattRealdataId implements Serializable { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | @TableId(value = "num", type = IdType.AUTO) |
| | | private Long num; |
| | | |
| | | @ApiModelProperty(value = "电池组ID") |
| | | private Integer battgroupId; |
| | | |
| | | @ApiModelProperty(value = "编号") |
| | | private Integer recordNum; |
| | | |
| | | @ApiModelProperty(value = "记录时间") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "Asia/Shanghai") |
| | | private Date recordTime; |
| | | |
| | | @ApiModelProperty(value = "记录时间") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "Asia/Shanghai") |
| | | @TableField(exist = false) |
| | | private Date recordTime1; |
| | | |
| | | @ApiModelProperty(value = "组端电压") |
| | | private Float groupVol; |
| | | |
| | | @ApiModelProperty(value = "在线电压") |
| | | private Float onlineVol; |
| | | |
| | | @ApiModelProperty(value = "电池电流") |
| | | private Float groupCurr; |
| | | |
| | | @ApiModelProperty(value = "设备温度") |
| | | private Float groupTmp; |
| | | |
| | | @ApiModelProperty(value = "电池状态") |
| | | private Integer battState; |
| | | |
| | | @ApiModelProperty(value = "电池测试类型") |
| | | private Integer battTestType; |
| | | |
| | | @ApiModelProperty(value = "测试开始时间") |
| | | private Date battTestStarttime; |
| | | |
| | | @ApiModelProperty(value = "测试时长") |
| | | private Integer battTestTlong; |
| | | |
| | | @ApiModelProperty(value = "测试容量") |
| | | private Float battTestCap; |
| | | |
| | | @ApiModelProperty(value = "单体编号") |
| | | private Integer monNum; |
| | | |
| | | @ApiModelProperty(value = "单体电压") |
| | | private Float monVol; |
| | | |
| | | @ApiModelProperty(value = "单体温度") |
| | | private Float monTmp; |
| | | |
| | | @ApiModelProperty(value = "单体内阻") |
| | | private Float monRes; |
| | | |
| | | @ApiModelProperty(value = "单体电导") |
| | | private Float monSer; |
| | | |
| | | @ApiModelProperty(value = "单体容量") |
| | | private Float monCap; |
| | | |
| | | @ApiModelProperty(value = "单体均衡电流") |
| | | private Float monJhCurr; |
| | | |
| | | @ApiModelProperty(value = "备注") |
| | | private String note; |
| | | |
| | | @ApiModelProperty(value = "接触器阻抗") |
| | | private Float dev_conresist; |
| | | |
| | | @ApiModelProperty(value = "导通压降") |
| | | private Float dev_condvoldp; |
| | | |
| | | @ApiModelProperty(value = "负载电流") |
| | | private Float loadCurr; |
| | | |
| | | @TableField(exist = false) |
| | | private String tableName; |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.whyc.pojo.db_data_history; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | import lombok.experimental.Accessors; |
| | | |
| | | import java.io.Serializable; |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * <p> |
| | | * 电源110000005_2024_03历史实时数据表 |
| | | * </p> |
| | | * |
| | | * @author lxw |
| | | * @since 2025-05-29 |
| | | */ |
| | | @Data |
| | | @EqualsAndHashCode(callSuper = false) |
| | | @Accessors(chain = true) |
| | | @ApiModel(value="PwrdevHistorydataId", description="电源历史实时数据表") |
| | | public class PwrdevHistorydataId implements Serializable { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | @TableId(value = "num", type = IdType.AUTO) |
| | | private Long num; |
| | | |
| | | @ApiModelProperty(value = "电源ID") |
| | | private Long powerId; |
| | | |
| | | @ApiModelProperty(value = "更新时间") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "Asia/Shanghai") |
| | | private Date recordDatetime; |
| | | |
| | | @ApiModelProperty(value = "编号") |
| | | private Integer recordNum; |
| | | |
| | | @ApiModelProperty(value = "1路交流输入A相电压") |
| | | private Float acin1Vola; |
| | | |
| | | @ApiModelProperty(value = "1路交流输入B相电压") |
| | | private Float acin1Volb; |
| | | |
| | | @ApiModelProperty(value = "交流1路输入C相电压") |
| | | private Float acin1Volc; |
| | | |
| | | @ApiModelProperty(value = "2路交流输入A相电压") |
| | | private Float acin2Vola; |
| | | |
| | | @ApiModelProperty(value = "2路交流输入B相电压") |
| | | private Float acin2Volb; |
| | | |
| | | @ApiModelProperty(value = "2路交流输入C相电压") |
| | | private Float acin2Volc; |
| | | |
| | | @ApiModelProperty(value = "交流A相输出电压") |
| | | private Float acoutVola; |
| | | |
| | | @ApiModelProperty(value = "交流B相输出电压") |
| | | private Float acoutVolb; |
| | | |
| | | @ApiModelProperty(value = "交流C相输出电压") |
| | | private Float acoutVolc; |
| | | |
| | | @ApiModelProperty(value = "交流A相输出电流") |
| | | private Float acoutCurra; |
| | | |
| | | @ApiModelProperty(value = "交流B相输出电流") |
| | | private Float acoutCurrb; |
| | | |
| | | @ApiModelProperty(value = "交流C相输出电流") |
| | | private Float acoutCurrc; |
| | | |
| | | @ApiModelProperty(value = "直流输出电压") |
| | | private Float dcoutVol; |
| | | |
| | | @ApiModelProperty(value = "直流输出电流") |
| | | private Float dcoutCurr; |
| | | |
| | | @ApiModelProperty(value = "电池组1组端电压") |
| | | private Float battgroup1Vol; |
| | | |
| | | @ApiModelProperty(value = "电池组1电流") |
| | | private Float battgroup1Curr; |
| | | |
| | | @ApiModelProperty(value = "电池组2组端电压") |
| | | private Float battgroup2Vol; |
| | | |
| | | @ApiModelProperty(value = "电池组2电流") |
| | | private Float battgroup2Curr; |
| | | |
| | | @ApiModelProperty(value = "环境温度") |
| | | private Float temprature; |
| | | |
| | | @ApiModelProperty(value = "整流模块总输出电压") |
| | | private Float mOutputvol; |
| | | |
| | | @ApiModelProperty(value = "模块1输出电流") |
| | | private Float m1Outcurr; |
| | | |
| | | @ApiModelProperty(value = "模块2输出电流") |
| | | private Float m2Outcurr; |
| | | |
| | | @ApiModelProperty(value = "模块3输出电流") |
| | | private Float m3Outcurr; |
| | | |
| | | @ApiModelProperty(value = "模块4输出电流") |
| | | private Float m4Outcurr; |
| | | |
| | | @ApiModelProperty(value = "模块5输出电流") |
| | | private Float m5Outcurr; |
| | | |
| | | @ApiModelProperty(value = "模块6输出电流") |
| | | private Float m6Outcurr; |
| | | |
| | | @ApiModelProperty(value = "模块7输出电流") |
| | | private Float m7Outcurr; |
| | | |
| | | @ApiModelProperty(value = "模块8输出电流") |
| | | private Float m8Outcurr; |
| | | |
| | | @ApiModelProperty(value = "模块9输出电流") |
| | | private Float m9Outcurr; |
| | | |
| | | @ApiModelProperty(value = "模块10输出电流") |
| | | private Float m10Outcurr; |
| | | |
| | | @ApiModelProperty(value = "模块11输出电流") |
| | | private Float m11Outcurr; |
| | | |
| | | @ApiModelProperty(value = "模块12输出电流") |
| | | private Float m12Outcurr; |
| | | |
| | | @ApiModelProperty(value = "模块13输出电流") |
| | | private Float m13Outcurr; |
| | | |
| | | @ApiModelProperty(value = "模块14输出电流") |
| | | private Float m14Outcurr; |
| | | |
| | | @ApiModelProperty(value = "模块15输出电流") |
| | | private Float m15Outcurr; |
| | | |
| | | @ApiModelProperty(value = "模块16输出电流") |
| | | private Float m16Outcurr; |
| | | |
| | | @ApiModelProperty(value = "第一路交流A相输入过压") |
| | | private Integer isAcin1OverVola; |
| | | |
| | | @ApiModelProperty(value = "第一路交流A相输入欠压") |
| | | private Integer isAcin1UnderVola; |
| | | |
| | | @ApiModelProperty(value = "第一路交流A相输入缺相") |
| | | private Integer isAcin1LessA; |
| | | |
| | | @ApiModelProperty(value = "第一路交流B相输入过压") |
| | | private Integer isAcin1OverVolb; |
| | | |
| | | @ApiModelProperty(value = "第一路交流B相输入欠压") |
| | | private Integer isAcin1UnderVolb; |
| | | |
| | | @ApiModelProperty(value = "第一路交流B相输入缺相") |
| | | private Integer isAcin1LessB; |
| | | |
| | | @ApiModelProperty(value = "第一路交流C相输入过压") |
| | | private Integer isAcin1OverVolc; |
| | | |
| | | @ApiModelProperty(value = "第一路交流C相输入欠压") |
| | | private Integer isAcin1UnderVolc; |
| | | |
| | | @ApiModelProperty(value = "第一路交流C相输入缺相") |
| | | private Integer isAcin1LessC; |
| | | |
| | | @ApiModelProperty(value = "交流输入1防雷器故障") |
| | | private Integer isAcin1ThunderErr; |
| | | |
| | | @ApiModelProperty(value = "交流输入1停电") |
| | | private Integer isAcin1Powerdown; |
| | | |
| | | @ApiModelProperty(value = "第二路交流A相输入过压") |
| | | private Integer isAcin2OverVola; |
| | | |
| | | @ApiModelProperty(value = "第二路交流A相输入欠压") |
| | | private Integer isAcin2UnderVola; |
| | | |
| | | @ApiModelProperty(value = "第二路交流A相输入缺相") |
| | | private Integer isAcin2LessA; |
| | | |
| | | @ApiModelProperty(value = "第二路交流B相输入过压") |
| | | private Integer isAcin2OverVolb; |
| | | |
| | | @ApiModelProperty(value = "第二路交流B相输入欠压") |
| | | private Integer isAcin2UnderVolb; |
| | | |
| | | @ApiModelProperty(value = "第二路交流B相输入缺相") |
| | | private Integer isAcin2LessB; |
| | | |
| | | @ApiModelProperty(value = "第二路交流C相输入过压") |
| | | private Integer isAcin2OverVolc; |
| | | |
| | | @ApiModelProperty(value = "第二路交流C相输入欠压") |
| | | private Integer isAcin2UnderVolc; |
| | | |
| | | @ApiModelProperty(value = "第二路交流C相输入缺相") |
| | | private Integer isAcin2LessC; |
| | | |
| | | @ApiModelProperty(value = "交流输入1防雷器故障") |
| | | private Integer isAcin2ThunderErr; |
| | | |
| | | @ApiModelProperty(value = "交流输入2停电") |
| | | private Integer isAcin2Powerdown; |
| | | |
| | | @ApiModelProperty(value = "监控器故障") |
| | | private Integer isAcinMonitorerr; |
| | | |
| | | @ApiModelProperty(value = "直流输出过压") |
| | | private Integer isDcoutOverVol; |
| | | |
| | | @ApiModelProperty(value = "直流输出欠压") |
| | | private Integer isDcoutUnderVol; |
| | | |
| | | @ApiModelProperty(value = "电池组1下电告警") |
| | | private Integer isBattgroup1Down; |
| | | |
| | | @ApiModelProperty(value = "电源均充") |
| | | private Integer isJunCharge; |
| | | |
| | | @ApiModelProperty(value = "整流模块1故障") |
| | | private Float isAcdcmod1Err; |
| | | |
| | | @ApiModelProperty(value = "整流模块1关机") |
| | | private Float isAcdcmod1Off; |
| | | |
| | | @ApiModelProperty(value = "整流模块2故障") |
| | | private Float isAcdcmod2Err; |
| | | |
| | | @ApiModelProperty(value = "整流模块2关机") |
| | | private Float isAcdcmod2Off; |
| | | |
| | | @ApiModelProperty(value = "整流模块3故障") |
| | | private Float isAcdcmod3Err; |
| | | |
| | | @ApiModelProperty(value = "整流模块3关机") |
| | | private Float isAcdcmod3Off; |
| | | |
| | | @ApiModelProperty(value = "整流模块4故障") |
| | | private Float isAcdcmod4Err; |
| | | |
| | | @ApiModelProperty(value = "整流模块4关机") |
| | | private Float isAcdcmod4Off; |
| | | |
| | | @ApiModelProperty(value = "整流模块5故障") |
| | | private Float isAcdcmod5Err; |
| | | |
| | | @ApiModelProperty(value = "整流模块5关机") |
| | | private Float isAcdcmod5Off; |
| | | |
| | | @ApiModelProperty(value = "整流模块6故障") |
| | | private Float isAcdcmod6Err; |
| | | |
| | | @ApiModelProperty(value = "整流模块6关机") |
| | | private Float isAcdcmod6Off; |
| | | |
| | | @ApiModelProperty(value = "整流模块7故障") |
| | | private Float isAcdcmod7Err; |
| | | |
| | | @ApiModelProperty(value = "整流模块7关机") |
| | | private Float isAcdcmod7Off; |
| | | |
| | | @ApiModelProperty(value = "整流模块8故障") |
| | | private Float isAcdcmod8Err; |
| | | |
| | | @ApiModelProperty(value = "整流模块8关机") |
| | | private Float isAcdcmod8Off; |
| | | |
| | | @ApiModelProperty(value = "整流模块9故障") |
| | | private Float isAcdcmod9Err; |
| | | |
| | | @ApiModelProperty(value = "整流模块9关机") |
| | | private Float isAcdcmod9Off; |
| | | |
| | | @ApiModelProperty(value = "整流模块10故障") |
| | | private Float isAcdcmod10Err; |
| | | |
| | | @ApiModelProperty(value = "整流模块10关机") |
| | | private Float isAcdcmod10Off; |
| | | |
| | | @ApiModelProperty(value = "整流模块11故障") |
| | | private Float isAcdcmod11Err; |
| | | |
| | | @ApiModelProperty(value = "整流模块11关机") |
| | | private Float isAcdcmod11Off; |
| | | |
| | | @ApiModelProperty(value = "整流模块12故障") |
| | | private Float isAcdcmod12Err; |
| | | |
| | | @ApiModelProperty(value = "整流模块12关机") |
| | | private Float isAcdcmod12Off; |
| | | |
| | | @ApiModelProperty(value = "整流模块13故障") |
| | | private Float isAcdcmod13Err; |
| | | |
| | | @ApiModelProperty(value = "整流模块13关机") |
| | | private Float isAcdcmod13Off; |
| | | |
| | | @ApiModelProperty(value = "整流模块14故障") |
| | | private Float isAcdcmod14Err; |
| | | |
| | | @ApiModelProperty(value = "整流模块14关机") |
| | | private Float isAcdcmod14Off; |
| | | |
| | | @ApiModelProperty(value = "整流模块15故障") |
| | | private Float isAcdcmod15Err; |
| | | |
| | | @ApiModelProperty(value = "整流模块15关机") |
| | | private Float isAcdcmod15Off; |
| | | |
| | | @ApiModelProperty(value = "整流模块16故障") |
| | | private Float isAcdcmod16Err; |
| | | |
| | | @ApiModelProperty(value = "整流模块16关机") |
| | | private Float isAcdcmod16Off; |
| | | |
| | | @ApiModelProperty(value = "交流输入1跳闸") |
| | | private Integer isAcin1Trip; |
| | | |
| | | @ApiModelProperty(value = "交流输入2跳闸") |
| | | private Integer isAcin2Trip; |
| | | |
| | | @ApiModelProperty(value = "负载熔断") |
| | | private Integer isLoaderFuse; |
| | | |
| | | @ApiModelProperty(value = "电池组1熔断") |
| | | private Integer isBattgroup1Fuse; |
| | | |
| | | @ApiModelProperty(value = "电池组2熔断") |
| | | private Integer isBattgroup2Fuse; |
| | | |
| | | @ApiModelProperty(value = "电源总告警") |
| | | private Integer isTotalAlarm; |
| | | |
| | | @ApiModelProperty(value = "交流1路输入A相电流") |
| | | private Float acin1Curra; |
| | | |
| | | @ApiModelProperty(value = "交流1路输入B相电流") |
| | | private Float acin1Currb; |
| | | |
| | | @ApiModelProperty(value = "交流1路输入C相电流") |
| | | private Float acin1Currc; |
| | | |
| | | @ApiModelProperty(value = "负载电流") |
| | | private Float loaderCurr; |
| | | |
| | | @ApiModelProperty(value = "电池组1容量") |
| | | private Float battgroup1Ah; |
| | | |
| | | @ApiModelProperty(value = "电池组1温度") |
| | | private Float battgroup1Temp; |
| | | |
| | | @ApiModelProperty(value = "电池组2容量") |
| | | private Float battgroup2Ah; |
| | | |
| | | @ApiModelProperty(value = "电池组2温度") |
| | | private Float battgroup2Temp; |
| | | |
| | | @ApiModelProperty(value = "ACDC开关柜温度") |
| | | private Float acdcmTemp; |
| | | |
| | | @ApiModelProperty(value = "模块1输出电压") |
| | | private Float m1OutVol; |
| | | |
| | | @ApiModelProperty(value = "模块2输出电压") |
| | | private Float m2OutVol; |
| | | |
| | | @ApiModelProperty(value = "模块3输出电压") |
| | | private Float m3OutVol; |
| | | |
| | | @ApiModelProperty(value = "模块4输出电压") |
| | | private Float m4OutVol; |
| | | |
| | | @ApiModelProperty(value = "模块5输出电压") |
| | | private Float m5OutVol; |
| | | |
| | | @ApiModelProperty(value = "模块6输出电压") |
| | | private Float m6OutVol; |
| | | |
| | | @ApiModelProperty(value = "模块7输出电压") |
| | | private Float m7OutVol; |
| | | |
| | | @ApiModelProperty(value = "模块8输出电压") |
| | | private Float m8OutVol; |
| | | |
| | | @ApiModelProperty(value = "模块9输出电压") |
| | | private Float m9OutVol; |
| | | |
| | | @ApiModelProperty(value = "模块10输出电压") |
| | | private Float m10OutVol; |
| | | |
| | | @ApiModelProperty(value = "模块11输出电压") |
| | | private Float m11OutVol; |
| | | |
| | | @ApiModelProperty(value = "模块12输出电压") |
| | | private Float m12OutVol; |
| | | |
| | | @ApiModelProperty(value = "模块13输出电压") |
| | | private Float m13OutVol; |
| | | |
| | | @ApiModelProperty(value = "模块14输出电压") |
| | | private Float m14OutVol; |
| | | |
| | | @ApiModelProperty(value = "模块15输出电压") |
| | | private Float m15OutVol; |
| | | |
| | | @ApiModelProperty(value = "模块16输出电压") |
| | | private Float m16OutVol; |
| | | |
| | | @ApiModelProperty(value = "交流A相过流") |
| | | private Integer isAcb1OverCurra; |
| | | |
| | | @ApiModelProperty(value = "交流B相过流") |
| | | private Integer isAcb1OverCurrb; |
| | | |
| | | @ApiModelProperty(value = "交流C相过流") |
| | | private Integer isAcb1OverCurrc; |
| | | |
| | | @ApiModelProperty(value = "交流1路有电") |
| | | private Integer isAcin1Poweron; |
| | | |
| | | @ApiModelProperty(value = "交流2路有电") |
| | | private Integer isAcin2Poweron; |
| | | |
| | | @ApiModelProperty(value = "直流输出过流告警") |
| | | private Integer isDcoutOverCurr; |
| | | |
| | | @ApiModelProperty(value = "电池组1充放电指示[1-充 0-放]") |
| | | private Integer isBattgroup1State; |
| | | |
| | | @ApiModelProperty(value = "电池组2充放电指示[1-充 0-放]") |
| | | private Integer isBattgroup2State; |
| | | |
| | | @ApiModelProperty(value = "电池组2下电告警") |
| | | private Integer isBattgroup2Down; |
| | | |
| | | @ApiModelProperty(value = "电池组1充电过流") |
| | | private Integer isBattgroup1Overchgcurr; |
| | | |
| | | @ApiModelProperty(value = "电池组2充电过流") |
| | | private Integer isBattgroup2Overchgcurr; |
| | | |
| | | @ApiModelProperty(value = "模块1过压") |
| | | private Integer isAcdcmod1Overvol; |
| | | |
| | | @ApiModelProperty(value = "模块1欠压") |
| | | private Integer isAcdcmod1Undervol; |
| | | |
| | | @ApiModelProperty(value = "模块1过流") |
| | | private Integer isAcdcmod1Overcurr; |
| | | |
| | | @ApiModelProperty(value = "模块1交流异常") |
| | | private Integer isAcdcmod1Acerr; |
| | | |
| | | @ApiModelProperty(value = "模块1限流") |
| | | private Integer isAcdcmod1Limitcurr; |
| | | |
| | | @ApiModelProperty(value = "模块2过压") |
| | | private Integer isAcdcmod2Overvol; |
| | | |
| | | @ApiModelProperty(value = "模块2欠压") |
| | | private Integer isAcdcmod2Undervol; |
| | | |
| | | @ApiModelProperty(value = "模块2过流") |
| | | private Integer isAcdcmod2Overcurr; |
| | | |
| | | @ApiModelProperty(value = "模块2交流异常") |
| | | private Integer isAcdcmod2Acerr; |
| | | |
| | | @ApiModelProperty(value = "模块2限流") |
| | | private Integer isAcdcmod2Limitcurr; |
| | | |
| | | @ApiModelProperty(value = "模块3过压") |
| | | private Integer isAcdcmod3Overvol; |
| | | |
| | | @ApiModelProperty(value = "模块3欠压") |
| | | private Integer isAcdcmod3Undervol; |
| | | |
| | | @ApiModelProperty(value = "模块3过流") |
| | | private Integer isAcdcmod3Overcurr; |
| | | |
| | | @ApiModelProperty(value = "模块3交流异常") |
| | | private Integer isAcdcmod3Acerr; |
| | | |
| | | @ApiModelProperty(value = "模块3限流") |
| | | private Integer isAcdcmod3Limitcurr; |
| | | |
| | | @ApiModelProperty(value = "模块4过压") |
| | | private Integer isAcdcmod4Overvol; |
| | | |
| | | @ApiModelProperty(value = "模块4欠压") |
| | | private Integer isAcdcmod4Undervol; |
| | | |
| | | @ApiModelProperty(value = "模块4过流") |
| | | private Integer isAcdcmod4Overcurr; |
| | | |
| | | @ApiModelProperty(value = "模块4交流异常") |
| | | private Integer isAcdcmod4Acerr; |
| | | |
| | | @ApiModelProperty(value = "模块4限流") |
| | | private Integer isAcdcmod4Limitcurr; |
| | | |
| | | @ApiModelProperty(value = "模块5过压") |
| | | private Integer isAcdcmod5Overvol; |
| | | |
| | | @ApiModelProperty(value = "模块5欠压") |
| | | private Integer isAcdcmod5Undervol; |
| | | |
| | | @ApiModelProperty(value = "模块5过流") |
| | | private Integer isAcdcmod5Overcurr; |
| | | |
| | | @ApiModelProperty(value = "模块5交流异常") |
| | | private Integer isAcdcmod5Acerr; |
| | | |
| | | @ApiModelProperty(value = "模块5限流") |
| | | private Integer isAcdcmod5Limitcurr; |
| | | |
| | | @ApiModelProperty(value = "模块6过压") |
| | | private Integer isAcdcmod6Overvol; |
| | | |
| | | @ApiModelProperty(value = "模块6欠压") |
| | | private Integer isAcdcmod6Undervol; |
| | | |
| | | @ApiModelProperty(value = "模块6过流") |
| | | private Integer isAcdcmod6Overcurr; |
| | | |
| | | @ApiModelProperty(value = "模块6交流异常") |
| | | private Integer isAcdcmod6Acerr; |
| | | |
| | | @ApiModelProperty(value = "模块6限流") |
| | | private Integer isAcdcmod6Limitcurr; |
| | | |
| | | @ApiModelProperty(value = "模块7过压") |
| | | private Integer isAcdcmod7Overvol; |
| | | |
| | | @ApiModelProperty(value = "模块7欠压") |
| | | private Integer isAcdcmod7Undervol; |
| | | |
| | | @ApiModelProperty(value = "模块7过流") |
| | | private Integer isAcdcmod7Overcurr; |
| | | |
| | | @ApiModelProperty(value = "模块7交流异常") |
| | | private Integer isAcdcmod7Acerr; |
| | | |
| | | @ApiModelProperty(value = "模块7限流") |
| | | private Integer isAcdcmod7Limitcurr; |
| | | |
| | | @ApiModelProperty(value = "模块8过压") |
| | | private Integer isAcdcmod8Overvol; |
| | | |
| | | @ApiModelProperty(value = "模块8欠压") |
| | | private Integer isAcdcmod8Undervol; |
| | | |
| | | @ApiModelProperty(value = "模块8过流") |
| | | private Integer isAcdcmod8Overcurr; |
| | | |
| | | @ApiModelProperty(value = "模块8交流异常") |
| | | private Integer isAcdcmod8Acerr; |
| | | |
| | | @ApiModelProperty(value = "模块8限流") |
| | | private Integer isAcdcmod8Limitcurr; |
| | | |
| | | @ApiModelProperty(value = "模块9过压") |
| | | private Integer isAcdcmod9Overvol; |
| | | |
| | | @ApiModelProperty(value = "模块9欠压") |
| | | private Integer isAcdcmod9Undervol; |
| | | |
| | | @ApiModelProperty(value = "模块9过流") |
| | | private Integer isAcdcmod9Overcurr; |
| | | |
| | | @ApiModelProperty(value = "模块9交流异常") |
| | | private Integer isAcdcmod9Acerr; |
| | | |
| | | @ApiModelProperty(value = "模块9限流") |
| | | private Integer isAcdcmod9Limitcurr; |
| | | |
| | | @ApiModelProperty(value = "模块10过压") |
| | | private Integer isAcdcmod10Overvol; |
| | | |
| | | @ApiModelProperty(value = "模块10欠压") |
| | | private Integer isAcdcmod10Undervol; |
| | | |
| | | @ApiModelProperty(value = "模块10过流") |
| | | private Integer isAcdcmod10Overcurr; |
| | | |
| | | @ApiModelProperty(value = "模块10交流异常") |
| | | private Integer isAcdcmod10Acerr; |
| | | |
| | | @ApiModelProperty(value = "模块10限流") |
| | | private Integer isAcdcmod10Limitcurr; |
| | | |
| | | @ApiModelProperty(value = "模块11过压") |
| | | private Integer isAcdcmod11Overvol; |
| | | |
| | | @ApiModelProperty(value = "模块11欠压") |
| | | private Integer isAcdcmod11Undervol; |
| | | |
| | | @ApiModelProperty(value = "模块11过流") |
| | | private Integer isAcdcmod11Overcurr; |
| | | |
| | | @ApiModelProperty(value = "模块11交流异常") |
| | | private Integer isAcdcmod11Acerr; |
| | | |
| | | @ApiModelProperty(value = "模块11限流") |
| | | private Integer isAcdcmod11Limitcurr; |
| | | |
| | | @ApiModelProperty(value = "模块12过压") |
| | | private Integer isAcdcmod12Overvol; |
| | | |
| | | @ApiModelProperty(value = "模块12欠压") |
| | | private Integer isAcdcmod12Undervol; |
| | | |
| | | @ApiModelProperty(value = "模块12过流") |
| | | private Integer isAcdcmod12Overcurr; |
| | | |
| | | @ApiModelProperty(value = "模块12交流异常") |
| | | private Integer isAcdcmod12Acerr; |
| | | |
| | | @ApiModelProperty(value = "模块12限流") |
| | | private Integer isAcdcmod12Limitcurr; |
| | | |
| | | @ApiModelProperty(value = "模块13过压") |
| | | private Integer isAcdcmod13Overvol; |
| | | |
| | | @ApiModelProperty(value = "模块13欠压") |
| | | private Integer isAcdcmod13Undervol; |
| | | |
| | | @ApiModelProperty(value = "模块13过流") |
| | | private Integer isAcdcmod13Overcurr; |
| | | |
| | | @ApiModelProperty(value = "模块13交流异常") |
| | | private Integer isAcdcmod13Acerr; |
| | | |
| | | @ApiModelProperty(value = "模块13限流") |
| | | private Integer isAcdcmod13Limitcurr; |
| | | |
| | | @ApiModelProperty(value = "模块14过压") |
| | | private Integer isAcdcmod14Overvol; |
| | | |
| | | @ApiModelProperty(value = "模块14欠压") |
| | | private Integer isAcdcmod14Undervol; |
| | | |
| | | @ApiModelProperty(value = "模块14过流") |
| | | private Integer isAcdcmod14Overcurr; |
| | | |
| | | @ApiModelProperty(value = ".模块14交流异常") |
| | | private Integer isAcdcmod14Acerr; |
| | | |
| | | @ApiModelProperty(value = "模块14限流") |
| | | private Integer isAcdcmod14Limitcurr; |
| | | |
| | | @ApiModelProperty(value = "模块15过压") |
| | | private Integer isAcdcmod15Overvol; |
| | | |
| | | @ApiModelProperty(value = "模块15欠压") |
| | | private Integer isAcdcmod15Undervol; |
| | | |
| | | @ApiModelProperty(value = "模块15过流") |
| | | private Integer isAcdcmod15Overcurr; |
| | | |
| | | @ApiModelProperty(value = "模块15交流异常") |
| | | private Integer isAcdcmod15Acerr; |
| | | |
| | | @ApiModelProperty(value = "模块15限流") |
| | | private Integer isAcdcmod15Limitcurr; |
| | | |
| | | @ApiModelProperty(value = "模块16过压") |
| | | private Integer isAcdcmod16Overvol; |
| | | |
| | | @ApiModelProperty(value = "模块16欠压") |
| | | private Integer isAcdcmod16Undervol; |
| | | |
| | | @ApiModelProperty(value = "模块16过流") |
| | | private Integer isAcdcmod16Overcurr; |
| | | |
| | | @ApiModelProperty(value = "模块16交流异常") |
| | | private Integer isAcdcmod16Acerr; |
| | | |
| | | @ApiModelProperty(value = "模块16限流") |
| | | private Integer isAcdcmod16Limitcurr; |
| | | |
| | | @ApiModelProperty(value = "交流输入1熔断") |
| | | private Integer isAcin1Fuse; |
| | | |
| | | @ApiModelProperty(value = "交流输入2熔断") |
| | | private Integer isAcin2Fuse; |
| | | |
| | | @ApiModelProperty(value = "交流输入1三相不平衡") |
| | | private Integer isAcin1Unbanlance; |
| | | |
| | | @ApiModelProperty(value = "交流输入2三相不平衡") |
| | | private Integer isAcin2Unbanlance; |
| | | |
| | | @ApiModelProperty(value = "交流输入1频率异常") |
| | | private Integer isAcin1Freqerr; |
| | | |
| | | @ApiModelProperty(value = "交流输入2频率异常") |
| | | private Integer isAcin2Freqerr; |
| | | |
| | | @ApiModelProperty(value = "电池组1电压低") |
| | | @TableField("is_battgroup1_volLow") |
| | | private Integer isBattgroup1Vollow; |
| | | |
| | | @ApiModelProperty(value = "电池组2电压低") |
| | | @TableField("is_battgroup2_volLow") |
| | | private Integer isBattgroup2Vollow; |
| | | |
| | | @ApiModelProperty(value = "直流总故障") |
| | | private Integer isDcoutTotalAlarm; |
| | | |
| | | @ApiModelProperty(value = "交流总故障") |
| | | private Integer isAcinTotalAlarm; |
| | | |
| | | @ApiModelProperty(value = "模块1均充") |
| | | private Integer isAcdcmod1Junchg; |
| | | |
| | | @ApiModelProperty(value = "模块2均充") |
| | | private Integer isAcdcmod2Junchg; |
| | | |
| | | @ApiModelProperty(value = "模块3均充") |
| | | private Integer isAcdcmod3Junchg; |
| | | |
| | | @ApiModelProperty(value = "模块4均充") |
| | | private Integer isAcdcmod4Junchg; |
| | | |
| | | @ApiModelProperty(value = "模块5均充") |
| | | private Integer isAcdcmod5Junchg; |
| | | |
| | | @ApiModelProperty(value = "模块6均充") |
| | | private Integer isAcdcmod6Junchg; |
| | | |
| | | @ApiModelProperty(value = "模块7均充") |
| | | private Integer isAcdcmod7Junchg; |
| | | |
| | | @ApiModelProperty(value = "模块8均充") |
| | | private Integer isAcdcmod8Junchg; |
| | | |
| | | @ApiModelProperty(value = "模块9均充") |
| | | private Integer isAcdcmod9Junchg; |
| | | |
| | | @ApiModelProperty(value = "模块10均充") |
| | | private Integer isAcdcmod10Junchg; |
| | | |
| | | @ApiModelProperty(value = "模块11均充") |
| | | private Integer isAcdcmod11Junchg; |
| | | |
| | | @ApiModelProperty(value = "模块12均充") |
| | | private Integer isAcdcmod12Junchg; |
| | | |
| | | @ApiModelProperty(value = "模块13均充") |
| | | private Integer isAcdcmod13Junchg; |
| | | |
| | | @ApiModelProperty(value = "模块14均充") |
| | | private Integer isAcdcmod14Junchg; |
| | | |
| | | @ApiModelProperty(value = "模块15均充") |
| | | private Integer isAcdcmod15Junchg; |
| | | |
| | | @ApiModelProperty(value = "模块16均充") |
| | | private Integer isAcdcmod16Junchg; |
| | | |
| | | @ApiModelProperty(value = "协转与电源通信故障") |
| | | private Integer isPowerdevCommerr; |
| | | |
| | | @ApiModelProperty(value = "交流1路输入A相电压-电表") |
| | | private Float useracin1Vola; |
| | | |
| | | @ApiModelProperty(value = "交流1路输入B相电压-电表") |
| | | private Float useracin1Volb; |
| | | |
| | | @ApiModelProperty(value = "交流1路输入C相电压-电表") |
| | | private Float useracin1Volc; |
| | | |
| | | @ApiModelProperty(value = "交流1路输入A相电流-电表") |
| | | private Float useracin1Curra; |
| | | |
| | | @ApiModelProperty(value = "交流1路输入B相电流-电表") |
| | | private Float useracin1Currb; |
| | | |
| | | @ApiModelProperty(value = "交流1路输入C相电流-电表") |
| | | private Float useracin1Currc; |
| | | |
| | | @ApiModelProperty(value = "交流1路频率-电表") |
| | | private Float useracin1Freq; |
| | | |
| | | @ApiModelProperty(value = "交流2路输入A相电压-电表") |
| | | private Float useracin2Vola; |
| | | |
| | | @ApiModelProperty(value = "交流2路输入B相电压-电表") |
| | | private Float useracin2Volb; |
| | | |
| | | @ApiModelProperty(value = "交流2路输入C相电压-电表") |
| | | private Float useracin2Volc; |
| | | |
| | | @ApiModelProperty(value = "交流2路输入A相电流-电表") |
| | | private Float useracin2Curra; |
| | | |
| | | @ApiModelProperty(value = "交流2路输入B相电流-电表") |
| | | private Float useracin2Currb; |
| | | |
| | | @ApiModelProperty(value = "交流2路输入C相电流-电表") |
| | | private Float useracin2Currc; |
| | | |
| | | @ApiModelProperty(value = "交流2路频率-电表") |
| | | private Float useracin2Freq; |
| | | |
| | | @ApiModelProperty(value = "温度1-电表") |
| | | private Float mTemper1; |
| | | |
| | | @ApiModelProperty(value = "温度2-电表") |
| | | private Float mTemper2; |
| | | |
| | | @ApiModelProperty(value = "温度3-电表") |
| | | private Float mTemper3; |
| | | |
| | | @ApiModelProperty(value = "湿度1-电表") |
| | | private Float mHumidity1; |
| | | |
| | | @ApiModelProperty(value = "湿度2-电表") |
| | | private Float mHumidity2; |
| | | |
| | | @ApiModelProperty(value = "湿度3-电表") |
| | | private Float mHumidity3; |
| | | |
| | | @ApiModelProperty(value = "交流1路停电-电表") |
| | | private Integer useracin1Powerdown; |
| | | |
| | | @ApiModelProperty(value = "交流1路电表通信故障-电表") |
| | | private Integer useracin1Commerr; |
| | | |
| | | @ApiModelProperty(value = "交流2路停电-电表") |
| | | private Integer useracin2Powerdown; |
| | | |
| | | @ApiModelProperty(value = "交流2路电表通信故障-电表") |
| | | private Integer useracin2Commerr; |
| | | |
| | | @ApiModelProperty(value = "温度传感器1通信故障-电表") |
| | | private Integer isTempCommerr1; |
| | | |
| | | @ApiModelProperty(value = "温度传感器2通信故障-电表") |
| | | private Integer isTempCommerr2; |
| | | |
| | | @ApiModelProperty(value = "温度传感器3通信故障-电表") |
| | | private Integer isTempCommerr3; |
| | | |
| | | @ApiModelProperty(value = "湿度传感器1通信故障-电表") |
| | | private Integer isHumiCommerr1; |
| | | |
| | | @ApiModelProperty(value = "湿度传感器2通信故障-电表") |
| | | private Integer isHumiCommerr2; |
| | | |
| | | @ApiModelProperty(value = "湿度传感器3通信故障-电表") |
| | | private Integer isHumiCommerr3; |
| | | |
| | | @ApiModelProperty(value = "烟雾1告警-电表") |
| | | private Integer isSmokeAlarm1; |
| | | |
| | | @ApiModelProperty(value = "烟雾1传感器通信故障-电表") |
| | | private Integer isSmokeCommerr1; |
| | | |
| | | @ApiModelProperty(value = "烟雾2告警-电表") |
| | | private Integer isSmokeAlarm2; |
| | | |
| | | @ApiModelProperty(value = "烟雾2传感器通信故障-电表") |
| | | private Integer isSmokeCommerr2; |
| | | |
| | | @ApiModelProperty(value = "烟雾3告警-电表") |
| | | private Integer isSmokeAlarm3; |
| | | |
| | | @ApiModelProperty(value = "烟雾3传感器通信故障-电表") |
| | | private Integer isSmokeCommerr3; |
| | | |
| | | @ApiModelProperty(value = "交流2路输入A相电流") |
| | | private Float acin2Curra; |
| | | |
| | | @ApiModelProperty(value = "交流2路输入B相电流") |
| | | private Float acin2Currb; |
| | | |
| | | @ApiModelProperty(value = "交流2路输入C相电流") |
| | | private Float acin2Currc; |
| | | |
| | | @ApiModelProperty(value = "交流输入1分合闸状态:0---未知(用于兼容以前的),1-分闸,2-合闸,3-脱扣") |
| | | private Integer acin1SwitchSt; |
| | | |
| | | @ApiModelProperty(value = "交流输入2分合闸状态 :0---未知(用于兼容以前的),1-分闸,2-合闸,3-脱扣") |
| | | private Integer acin2SwitchSt; |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.whyc.pojo.db_param; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | import lombok.experimental.Accessors; |
| | | |
| | | import java.io.Serializable; |
| | | |
| | | /** |
| | | * <p> |
| | | * 平台参数表 |
| | | * </p> |
| | | * |
| | | * @author lxw |
| | | * @since 2025-06-04 |
| | | */ |
| | | @Data |
| | | @EqualsAndHashCode(callSuper = false) |
| | | @Accessors(chain = true) |
| | | @TableName(schema = "db_param",value ="tb_app_param") |
| | | @ApiModel(value="AppParam对象", description="平台参数表") |
| | | public class AppParam implements Serializable { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | @ApiModelProperty(value = "自增主键") |
| | | @TableId(value = "id", type = IdType.AUTO) |
| | | private Long id; |
| | | |
| | | @ApiModelProperty(value = "参数名称") |
| | | private String paramName; |
| | | |
| | | @ApiModelProperty(value = "参数类别[1-单体判别阈值]") |
| | | private Integer categoryId; |
| | | |
| | | @ApiModelProperty(value = "参数值") |
| | | private Float paramValue; |
| | | |
| | | @ApiModelProperty(value = "参数名称(英文)") |
| | | private String paramNamePsx; |
| | | |
| | | |
| | | } |
| | |
| | | package com.whyc.pojo.db_param; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import io.swagger.annotations.ApiModel; |
| | |
| | | @ApiModelProperty(value = "下下限告警使能") |
| | | private Integer almLowCoeLowerEn; |
| | | |
| | | @TableField(exist = false) |
| | | private String provice; |
| | | |
| | | @TableField(exist = false) |
| | | private String city; |
| | | |
| | | @TableField(exist = false) |
| | | private String country; |
| | | |
| | | @TableField(exist = false) |
| | | private String fullName; |
| | | |
| | | @TableField(exist = false) |
| | | private String stationName; |
| | | |
| | | @TableField(exist = false) |
| | | private String battgroupName; |
| | | |
| | | } |
| | |
| | | package com.whyc.pojo.db_pwrdev_alarm; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import io.swagger.annotations.ApiModel; |
| | |
| | | @ApiModelProperty(value = "告警ID") |
| | | private Integer almId; |
| | | |
| | | @TableField(exist = false) |
| | | private String almName; |
| | | |
| | | @ApiModelProperty(value = "告警等级") |
| | | private Integer almLevel; |
| | | |
| | |
| | | @ApiModelProperty(value = "告警重要等级[0:重要;1:紧急]") |
| | | private Integer almSeverity; |
| | | |
| | | @TableField(exist = false) |
| | | private String powerName; |
| | | |
| | | @TableField(exist = false) |
| | | private String stationName; |
| | | @TableField(exist = false) |
| | | private String provice; |
| | | @TableField(exist = false) |
| | | private String city; |
| | | @TableField(exist = false) |
| | | private String country; |
| | | @TableField(exist = false) |
| | | private String fullName; |
| | | } |
| | |
| | | package com.whyc.pojo.db_pwrdev_alarm; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import io.swagger.annotations.ApiModel; |
| | |
| | | private Long num; |
| | | |
| | | @ApiModelProperty(value = "电源ID") |
| | | private Long powerId; |
| | | private Integer powerId; |
| | | |
| | | @ApiModelProperty(value = "告警ID") |
| | | private Integer almId; |
| | | |
| | | @TableField(exist = false) |
| | | private String almName; |
| | | |
| | | @ApiModelProperty(value = "告警等级") |
| | | private Integer almLevel; |
| | |
| | | @ApiModelProperty(value = "告警重要等级[0:重要;1:紧急]") |
| | | private Integer almSeverity; |
| | | |
| | | @TableField(exist = false) |
| | | private String stationName; |
| | | @TableField(exist = false) |
| | | private String provice; |
| | | @TableField(exist = false) |
| | | private String city; |
| | | @TableField(exist = false) |
| | | private String country; |
| | | @TableField(exist = false) |
| | | private String powerName; |
| | | |
| | | |
| | | } |
| | |
| | | package com.whyc.pojo.db_pwrdev_alarm; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import io.swagger.annotations.ApiModel; |
| | |
| | | private Integer alarmLimithLevel; |
| | | |
| | | |
| | | @TableField(exist = false) |
| | | private String provice; |
| | | |
| | | @TableField(exist = false) |
| | | private String city; |
| | | |
| | | @TableField(exist = false) |
| | | private String country; |
| | | |
| | | @TableField(exist = false) |
| | | private String fullName; |
| | | |
| | | @TableField(exist = false) |
| | | private String stationName; |
| | | |
| | | @TableField(exist = false) |
| | | private String powerName; |
| | | |
| | | |
| | | |
| | | } |
| | |
| | | @ApiModelProperty(value = "参数类型") |
| | | private Integer paramType; |
| | | |
| | | @ApiModelProperty(value = "标准参数对应数据名称") |
| | | private Integer paramName; |
| | | |
| | | @ApiModelProperty(value = "基准值") |
| | | private Float basisVal; |
| | | |
| | |
| | | @ApiModelProperty(value = "规范文件保存路径") |
| | | private String standFilePath; |
| | | |
| | | @ApiModelProperty(value = "文件名") |
| | | private String fileName; |
| | | |
| | | |
| | | } |
File was renamed from src/main/java/com/whyc/pojo/db_ram_db/DevAlmparam.java |
| | |
| | | @Data |
| | | @EqualsAndHashCode(callSuper = false) |
| | | @Accessors(chain = true) |
| | | @TableName(schema = "db_ram_db",value ="tb_dev_almparam") |
| | | @ApiModel(value="DevAlmparam对象", description="设备告警阈值遥调表") |
| | | public class DevAlmparam implements Serializable { |
| | | @TableName(schema = "db_ram_db",value ="tb_almparam_from_device") |
| | | @ApiModel(value="AlmparamFromDevice对象", description="设备告警阈值遥调表") |
| | | public class AlmparamFromDevice implements Serializable { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | |
| | | package com.whyc.pojo.db_ram_db; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import io.swagger.annotations.ApiModel; |
| | |
| | | @ApiModelProperty(value = "启动失败原因") |
| | | private Integer controlFailType; |
| | | |
| | | @ApiModelProperty(value = "启动失败原因") |
| | | @TableField(exist = false) |
| | | private String controlFailTypeReason; |
| | | |
| | | @ApiModelProperty(value = "上一次核容终止原因") |
| | | private Integer lastCaptestStopType; |
| | | |
| | | @ApiModelProperty(value = "上一次核容终止原因") |
| | | @TableField(exist = false) |
| | | private String lastCaptestStopTypeReason; |
| | | |
| | | @ApiModelProperty(value = "负载电流") |
| | | private Float loadCurr; |
| | | |
| | | |
| | | } |
| | |
| | | package com.whyc.pojo.db_ram_db; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import io.swagger.annotations.ApiModel; |
| | |
| | | private Long num; |
| | | |
| | | @ApiModelProperty(value = "设备ID") |
| | | private Long devId; |
| | | private Integer devId; |
| | | |
| | | @ApiModelProperty(value = "远程命令") |
| | | private Integer opCmd; |
| | |
| | | private Integer diswaittime; |
| | | |
| | | @ApiModelProperty(value = "标称容量") |
| | | private Integer moncapstd; |
| | | private Float moncapstd; |
| | | |
| | | @TableField(exist = false) |
| | | private String battgroupName; |
| | | @TableField(exist = false) |
| | | private String stationName; |
| | | @TableField(exist = false) |
| | | private String provice; |
| | | @TableField(exist = false) |
| | | private String city; |
| | | @TableField(exist = false) |
| | | private String country; |
| | | @TableField(exist = false) |
| | | private String fullName; |
| | | |
| | | |
| | | |
| | | } |
| | |
| | | package com.whyc.pojo.db_ram_db; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import io.swagger.annotations.ApiModel; |
| | |
| | | @ApiModelProperty(value = "测试组号") |
| | | private Integer devTestgroupnum; |
| | | |
| | | @ApiModelProperty(value = "设备测试类型") |
| | | @ApiModelProperty(value = "设备工作类型") |
| | | private Integer devWorkstate; |
| | | |
| | | @ApiModelProperty(value = "设备告警状态") |
| | |
| | | private Float devConresist1; |
| | | |
| | | @ApiModelProperty(value = "61850设备告警") |
| | | @TableField(value = "dev_61850alarms") |
| | | private String dev61850alarms; |
| | | |
| | | @ApiModelProperty(value = "组2二极管压降") |
| | |
| | | @ApiModelProperty(value = "充放电一体机组2组端电流") |
| | | private Float groupCurr2; |
| | | |
| | | @TableField(exist = false) |
| | | private String stationName; |
| | | |
| | | @TableField(exist = false) |
| | | private String stationId; |
| | | |
| | | @TableField(exist = false) |
| | | private Integer powerId; |
| | | |
| | | @TableField(exist = false) |
| | | private String devName; |
| | | |
| | | @TableField(exist = false) |
| | | private String provice; |
| | | @TableField(exist = false) |
| | | private String city; |
| | | @TableField(exist = false) |
| | | private String country; |
| | | @TableField(exist = false) |
| | | private String fullName; |
| | | |
| | | } |
| | |
| | | @ApiModelProperty(value = "型号") |
| | | private String battModel; |
| | | |
| | | @TableField(fill = FieldFill.INSERT) |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "Asia/Shanghai") |
| | | private Date createTime; |
| | | |
| | | @JsonFormat(pattern = "yyyy-MM-dd",timezone = "Asia/Shanghai") |
| | | private Date inuseTime; |
| | | |
| | | @TableField(exist = false) |
| | | private String stationName; |
| | |
| | | @ApiModelProperty(value = "0:设备下新建电池组,1新建一个设备一个电池组") |
| | | private Integer addBinfFlag; |
| | | |
| | | @TableField(exist = false) |
| | | private String provice; |
| | | |
| | | @TableField(exist = false) |
| | | private String city; |
| | | |
| | | @TableField(exist = false) |
| | | private String country; |
| | | |
| | | @TableField(exist = false) |
| | | private String fullName; |
| | | |
| | | @TableField(exist = false) |
| | | private String stationType; |
| | | |
| | | @TableField(exist = false) |
| | | @ApiModelProperty(value = "设备下电池组个数") |
| | | private Integer battCount; |
| | | |
| | | @TableField(exist = false) |
| | | @ApiModelProperty(value = "包机组名称") |
| | | private String baojiGroupName; |
| | | } |
| | |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | |
| | | import lombok.experimental.Accessors; |
| | | |
| | | import java.io.Serializable; |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | @ApiModelProperty(value = "电源类型:1:直流,2:通讯,3配网") |
| | | private Integer powerType; |
| | | |
| | | @ApiModelProperty(value = "整流器使能[bit0-模块1 bit15-模块16]【1-可用 0-不可以】") |
| | | private Long modelCfg; |
| | | |
| | | @JsonFormat(pattern = "yyyy-MM-dd",timezone = "Asia/Shanghai") |
| | | private Date powerInuseTime; |
| | | |
| | | @TableField(exist = false) |
| | | private StationInf sinf; |
| | | |
| | |
| | | @TableField(exist = false) |
| | | private String city; |
| | | |
| | | |
| | | @TableField(exist = false) |
| | | private String country; |
| | | |
| | | @TableField(exist = false) |
| | | private String fullName; |
| | | |
| | | @TableField(exist = false) |
| | | private String stationType; |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.whyc.service; |
| | | |
| | | import com.github.pagehelper.PageInfo; |
| | | import com.whyc.constant.BattAlarmIdEnum; |
| | | import com.whyc.constant.BattSingalIdEnum; |
| | | import com.whyc.constant.DevAlarmEnum; |
| | | import com.whyc.constant.PowerAlarmEnum; |
| | | import com.whyc.dto.AlmHis.BattAlmPar; |
| | | import com.whyc.dto.AlmHis.DevAlmPar; |
| | | import com.whyc.dto.AlmHis.PwrAlmPar; |
| | | import com.whyc.dto.Real.AlmDto; |
| | | import com.whyc.dto.Response; |
| | | import com.whyc.pojo.db_alarm.BattalarmDataHistory; |
| | | import com.whyc.pojo.db_alarm.DevalarmDataHistory; |
| | | import com.whyc.pojo.db_pwrdev_alarm.PwrdevAlarmHistory; |
| | | import com.whyc.pojo.db_user.User; |
| | | import com.whyc.util.ActionUtil; |
| | | import com.whyc.util.MessageUtils; |
| | | import com.whyc.util.SubTablePageInfoUtils; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.text.ParseException; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | @Service |
| | | public class AlarmHisService { |
| | | @Resource |
| | | private SubTablePageInfoUtils subTablePageInfoUtils; |
| | | //电池告警历史记录查询 |
| | | public Response getBattAlmHis(BattAlmPar almDto) throws ParseException, InterruptedException { |
| | | //分页信息 |
| | | Integer pageNum = almDto.getPageNum(); |
| | | Integer pageSize = almDto.getPageSize(); |
| | | User uinf = ActionUtil.getUser(); |
| | | int uid = uinf.getId(); |
| | | almDto.setUid(uid); |
| | | Date almStartTime = almDto.getAlmStartTime(); |
| | | Date almEndTime = almDto.getAlmEndTime(); |
| | | PageInfo<Object> pageInfo = subTablePageInfoUtils.getPageInfoByMonthTable(pageNum, pageSize, almStartTime, almEndTime, |
| | | "db_alarm", "tb_battalarm_data_history", almDto); |
| | | List<Object> list = pageInfo.getList(); |
| | | for (Object data : list) { |
| | | BattalarmDataHistory dataH = (BattalarmDataHistory) data; |
| | | dataH.setAlmName(BattSingalIdEnum.getValue(dataH.getAlmSignalId())); |
| | | } |
| | | return new Response().setII(1, list!=null, pageInfo, "电池告警历史记录查询"); |
| | | } |
| | | //设备告警历史记录查询 |
| | | public Response getDevAlmHis(DevAlmPar almDto) throws ParseException, InterruptedException { |
| | | Integer pageNum = almDto.getPageNum(); |
| | | Integer pageSize = almDto.getPageSize(); |
| | | Date almStartTime = almDto.getAlmStartTime(); |
| | | Date almEndTime = almDto.getAlmEndTime(); |
| | | User uinf = ActionUtil.getUser(); |
| | | int uid = uinf.getId(); |
| | | almDto.setUid(uid); |
| | | PageInfo<Object> pageInfo = subTablePageInfoUtils.getPageInfoByMonthTable(pageNum, pageSize, almStartTime, almEndTime, |
| | | "db_alarm", "tb_devalarm_data_history", almDto); |
| | | List<Object> list = pageInfo.getList(); |
| | | for (Object data : list) { |
| | | DevalarmDataHistory dataH = (DevalarmDataHistory) data; |
| | | dataH.setAlmName(DevAlarmEnum.getValue(dataH.getAlmId())); |
| | | } |
| | | return new Response().setII(1, pageInfo.getList()!=null, pageInfo, "返回结果"); |
| | | } |
| | | //电源告警历史记录查询 |
| | | public Response getPwrAlmHis(PwrAlmPar almDto) throws ParseException { |
| | | Integer pageNum = almDto.getPageNum(); |
| | | Integer pageSize = almDto.getPageSize(); |
| | | Date almStartTime = almDto.getAlmStartTime(); |
| | | Date almEndTime = almDto.getAlmEndTime(); |
| | | //recordId = 1 普通电源 |
| | | //param.setRecordId(1L); |
| | | User uinf = ActionUtil.getUser(); |
| | | int uid = uinf.getId(); |
| | | almDto.setUid(uid); |
| | | PageInfo<Object> pageInfo = subTablePageInfoUtils.getPageInfo(pageNum, pageSize, almStartTime, almEndTime, |
| | | "db_pwrdev_alarm", "tb_pwrdev_alarm_history", almDto); |
| | | List<Object> list = pageInfo.getList(); |
| | | for (Object data : list) { |
| | | PwrdevAlarmHistory dataH = (PwrdevAlarmHistory) data; |
| | | dataH.setAlmName(PowerAlarmEnum.getValue(dataH.getAlmId())); |
| | | } |
| | | return new Response<>().setII(1, pageInfo, null, "电源告警历史记录查询"); |
| | | } |
| | | } |
New file |
| | |
| | | package com.whyc.service; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; |
| | | import com.github.pagehelper.PageHelper; |
| | | import com.whyc.dto.CmdDto.DevCmd; |
| | | import com.whyc.dto.Response; |
| | | import com.whyc.mapper.AlmparamFromDeviceMapper; |
| | | import com.whyc.pojo.db_ram_db.AlmparamFromDevice; |
| | | import com.whyc.util.ActionUtil; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | @Service |
| | | public class AlmparamFromDeviceService { |
| | | @Autowired(required = false) |
| | | private AlmparamFromDeviceMapper mapper; |
| | | |
| | | public boolean sendCmdTo6185Alarm(int opCmd,int devId) |
| | | { |
| | | int cmd = opCmd; |
| | | int cmd_ack = 0; |
| | | switch(cmd) { |
| | | case DevCmd.CMD_ReadAlarmParam: cmd_ack = DevCmd.CMD_ReadAlarmParam_ACK; break; |
| | | case DevCmd.CMD_WriteAlarmParam: cmd_ack = DevCmd.CMD_WriteAlarmParam_ACK; break; |
| | | default: |
| | | return false; |
| | | } |
| | | //更新op_cmd |
| | | UpdateWrapper updateWrapper=new UpdateWrapper(); |
| | | updateWrapper.set("op_cmd",cmd); |
| | | updateWrapper.eq("dev_id",devId); |
| | | int flag=mapper.update((AlmparamFromDevice) ActionUtil.objeNull,updateWrapper); |
| | | boolean res_exe = false; |
| | | if(flag>0) |
| | | { |
| | | PageHelper.startPage(1,1); |
| | | QueryWrapper queryWrapper=new QueryWrapper(); |
| | | queryWrapper.eq("dev_id",devId); |
| | | for(int n=0; n<40; n++) |
| | | { |
| | | |
| | | AlmparamFromDevice param=mapper.selectOne(queryWrapper); |
| | | if(param!=null){ |
| | | if(param.getOpCmd()==cmd_ack){ |
| | | res_exe = true; |
| | | break; |
| | | } |
| | | try { |
| | | Thread.sleep(500); |
| | | } catch (InterruptedException e) { |
| | | e.printStackTrace(); |
| | | } |
| | | }else { |
| | | break; |
| | | } |
| | | } |
| | | } |
| | | return res_exe; |
| | | } |
| | | //设备的告警参数设置 |
| | | public Response setAlarmFromDevice(AlmparamFromDevice par) { |
| | | UpdateWrapper wrapper=new UpdateWrapper(); |
| | | wrapper.set("groupvol_high_val",par.getGroupvolHighVal()); |
| | | wrapper.set("groupvol_low_val",par.getGroupvolLowVal()); |
| | | wrapper.set("monvol_high_val",par.getMonvolHighVal()); |
| | | wrapper.set("monvol_low_val",par.getMonvolLowVal()); |
| | | wrapper.set("montmp_high_val",par.getMontmpHighVal()); |
| | | wrapper.set("montmp_low_val",par.getMontmpLowVal()); |
| | | wrapper.set("monres_high_val",par.getMonresHighVal()); |
| | | wrapper.set("monres_low_val",par.getMonresLowVal()); |
| | | wrapper.set("moncap_high_val",par.getMoncapHighVal()); |
| | | wrapper.set("moncap_low_val",par.getMoncapLowVal()); |
| | | wrapper.set("battgroupnum",par.getBattgroupnum()); |
| | | wrapper.set("onlinevol_high_val",par.getOnlinevolHighVal()); |
| | | wrapper.set("onlinevol_low_val",par.getOnlinevolLowVal()); |
| | | wrapper.set("onlinevol_en",par.getOnlinevolEn()); |
| | | wrapper.set("groupvol_en",par.getGroupvolEn()); |
| | | wrapper.set("monvol_en",par.getMonvolEn()); |
| | | wrapper.set("montmp_en",par.getMontmpEn()); |
| | | wrapper.set("monres_en",par.getMonresEn()); |
| | | wrapper.set("moncap_en",par.getMoncapEn()); |
| | | wrapper.set("discurr_high_val",par.getDiscurrHighVal()); |
| | | wrapper.set("discurr_en",par.getDiscurrEn()); |
| | | wrapper.set("chrcurr_high_val",par.getChrcurrHighVal()); |
| | | wrapper.set("chrcurr_en",par.getChrcurrEn()); |
| | | wrapper.eq("dev_id",par.getDevId()); |
| | | int flag=mapper.update((AlmparamFromDevice) ActionUtil.objeNull,wrapper); |
| | | boolean bl=false; |
| | | if(flag>0){ |
| | | bl= sendCmdTo6185Alarm(DevCmd.CMD_WriteAlarmParam, par.getDevId()); |
| | | } |
| | | return new Response().set(1, bl, bl == true ? "设置成功!" : "设置失败,请检查网络!"); |
| | | } |
| | | //设备的告警参数读取 |
| | | public Response getAlarmFromDevice(int devId) { |
| | | boolean bl = sendCmdTo6185Alarm(DevCmd.CMD_ReadAlarmParam, devId); |
| | | UpdateWrapper wrapper = new UpdateWrapper(); |
| | | wrapper.eq("dev_id", devId); |
| | | wrapper.last("limit 1"); |
| | | AlmparamFromDevice par = mapper.selectOne(wrapper); |
| | | return new Response().setII(1, bl,par, bl == true ? "读取成功!" : "读取失败,请检查网络!"); |
| | | } |
| | | } |
New file |
| | |
| | | package com.whyc.service; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.whyc.mapper.AppParamMapper; |
| | | import com.whyc.pojo.db_param.AppParam; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | |
| | | @Service |
| | | public class AppParamService { |
| | | @Autowired(required = false) |
| | | private AppParamMapper mapper; |
| | | //获取核容优劣,损坏参数 |
| | | public List<AppParam> getHrParam() { |
| | | QueryWrapper wrapper=new QueryWrapper(); |
| | | List<String> params=new ArrayList<>(); |
| | | params.add("batt_mon_deteriorate_val"); |
| | | params.add("batt_mon_damage_val"); |
| | | wrapper.in("param_name_psx",params); |
| | | wrapper.orderByAsc("id"); |
| | | return mapper.selectList(wrapper); |
| | | } |
| | | } |
| | |
| | | update.eq("station_id",sid); |
| | | bjPowermapper.delete(update); |
| | | } |
| | | //查询机房所在的班组 |
| | | public String getGroupName(Integer powerId) { |
| | | String groupName = powerInfMapper.getGroupName(powerId); |
| | | return groupName; |
| | | } |
| | | //查询所有的包机组名集合 |
| | | public List<Baojigroup> getGroupList() { |
| | | QueryWrapper wrapper=new QueryWrapper(); |
| | | wrapper.eq("team_flag",1); |
| | | List<Baojigroup> list=mapper.selectList(wrapper); |
| | | return list; |
| | | } |
| | | } |
New file |
| | |
| | | package com.whyc.service; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; |
| | | import com.github.pagehelper.PageHelper; |
| | | import com.github.pagehelper.PageInfo; |
| | | import com.whyc.dto.Real.AlmDto; |
| | | import com.whyc.dto.Response; |
| | | import com.whyc.mapper.BattAlmparamMapper; |
| | | import com.whyc.pojo.db_param.BattAlmparam; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.List; |
| | | |
| | | @Service |
| | | public class BattAlmparamService { |
| | | @Autowired(required = false) |
| | | private BattAlmparamMapper mapper; |
| | | //获取电池告警参数 |
| | | public Response getBattAlmParam(AlmDto almDto) { |
| | | PageHelper.startPage(almDto.getPageNum(),almDto.getPageSize()); |
| | | List<BattAlmparam> list = mapper.getBattAlmParam(almDto); |
| | | PageInfo pageInfo=new PageInfo(list); |
| | | return new Response().setII(1,list!=null,pageInfo,"获取电池告警参数"); |
| | | } |
| | | //修改电池告警参数 |
| | | public Response setBattAlmParam(List<BattAlmparam> almparamList) { |
| | | for (BattAlmparam param:almparamList) { |
| | | UpdateWrapper wrapper=new UpdateWrapper(); |
| | | wrapper.eq("battgroup_id",param.getBattgroupId()); |
| | | wrapper.eq("alm_id",param.getAlmId()); |
| | | mapper.update(param,wrapper); |
| | | } |
| | | return new Response().set(1,true,"修改电池告警参数"); |
| | | } |
| | | |
| | | |
| | | } |
| | |
| | | import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; |
| | | import com.github.pagehelper.PageHelper; |
| | | import com.github.pagehelper.PageInfo; |
| | | import com.whyc.constant.Capperformance; |
| | | import com.whyc.constant.PowerAlarmEnum; |
| | | import com.whyc.dto.BattDto; |
| | | import com.whyc.dto.InfoDto; |
| | | import com.whyc.dto.Real.QuarterDto; |
| | | import com.whyc.dto.Response; |
| | | import com.whyc.dto.Statistic.*; |
| | | import com.whyc.factory.InfoFactory; |
| | | import com.whyc.mapper.BattInfMapper; |
| | | import com.whyc.mapper.PowerInfMapper; |
| | |
| | | import java.util.ArrayList; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | @Service |
| | | public class BattInfService { |
| | |
| | | if(pinf.getPowerType()!=null){ |
| | | wrapper2.set("power_type",pinf.getPowerType()); |
| | | } |
| | | if(pinf.getPowerInuseTime()!=null){ |
| | | wrapper2.set("power_inuse_time",pinf.getPowerInuseTime()); |
| | | } |
| | | if(pinf.getModelCfg()!=null){ |
| | | wrapper2.set("model_cfg",pinf.getModelCfg()); |
| | | } |
| | | /*if(pinf.getPowerName()!=null){ |
| | | //检测该机房下要修改的电源名是否存在 |
| | | QueryWrapper queryWrapper1=new QueryWrapper(); |
| | |
| | | } |
| | | if (binf.getBattModel() != null) { |
| | | wrapper4.set("batt_model", binf.getBattModel()); |
| | | } |
| | | if (binf.getInuseTime() != null) { |
| | | wrapper4.set("inuse_time", binf.getInuseTime()); |
| | | } |
| | | wrapper4.eq("battgroup_id", binf.getBattgroupId()); |
| | | mapper.update((BattInf) ActionUtil.objeNull,wrapper3); |
| | |
| | | return new Response().setII(1,list.size()>0,list,"获取设备型号(下拉)"); |
| | | } |
| | | |
| | | //根据电池组id获取电池组信息 |
| | | public BattInf getBinfByBattgroupId(Integer battgroupId) { |
| | | QueryWrapper wrapper=new QueryWrapper(); |
| | | wrapper.eq("battgroup_id",battgroupId); |
| | | wrapper.last("limit 1"); |
| | | BattInf binf=mapper.selectOne(wrapper); |
| | | return binf; |
| | | } |
| | | //当没有内助测试时初始内阻值为标称内阻 |
| | | public List<QuarterDto> getBinfResStd(Integer battgroupId) { |
| | | QueryWrapper wrapper=new QueryWrapper(); |
| | | wrapper.eq("battgroup_id",battgroupId); |
| | | wrapper.last("limit 1"); |
| | | BattInf binf=mapper.selectOne(wrapper); |
| | | Float monresstd=binf.getMonresstd(); |
| | | List<QuarterDto> list=new ArrayList<>(); |
| | | for(int i=0;i<binf.getMoncount();i++){ |
| | | QuarterDto dto=new QuarterDto(); |
| | | dto.setRecordTime(binf.getCreateTime()); |
| | | dto.setMonNum(i+1); |
| | | dto.setNumValue(monresstd); |
| | | } |
| | | return list; |
| | | } |
| | | |
| | | //设备信息统计 |
| | | public Response getDevStatistic(StationStic stic) { |
| | | PageHelper.startPage(stic.getPageNum(),stic.getPageSize()); |
| | | List<BattInf> list=mapper.getDevStatistic(stic); |
| | | for (BattInf binf:list) { |
| | | //获取设备下电池组个数 |
| | | int battCount=mapper.getBattCountBydevId(binf.getDevId()); |
| | | binf.setBattCount(battCount); |
| | | } |
| | | PageInfo<BattInf> pageInfo=new PageInfo<>(list); |
| | | return new Response().setII(1,list.size()>0,pageInfo,"设备信息统计"); |
| | | } |
| | | //蓄电池组信息统计 |
| | | public Response getBattStatistic(StationStic stic) { |
| | | PageHelper.startPage(stic.getPageNum(),stic.getPageSize()); |
| | | List<BattInf> list=mapper.getBattStatistic(stic); |
| | | PageInfo<BattInf> pageInfo=new PageInfo<>(list); |
| | | return new Response().setII(1,list.size()>0,pageInfo,"蓄电池组信息统计"); |
| | | } |
| | | //单体统计查询符合条件的电池组 |
| | | public List<BattInf> getMonStatistic(MonStic stic) { |
| | | return mapper.getMonStatistic(stic); |
| | | } |
| | | //蓄电池组对比分析界面15 |
| | | public List<BattInf> getBattCompare15Statistic(BattCompareStic stic) { |
| | | return mapper.getBattCompare15Statistic(stic); |
| | | } |
| | | //获取容量性能(下拉) |
| | | public Response getCapperformance() { |
| | | Map<Integer,String> map= Capperformance.getOpInfo(); |
| | | return new Response().setII(1,true,map,"获取容量性能(下拉)"); |
| | | } |
| | | //蓄电池组对比分析界面16 |
| | | public List<BattInf> getBattCompare16Statistic(BattCompareStic stic) { |
| | | return mapper.getBattCompare16Statistic(stic); |
| | | } |
| | | //蓄电池组对比分析界面17 |
| | | public List<BattInf> getBattCompare17Statistic(BattCompareStic stic) { |
| | | return mapper.getBattCompare17Statistic(stic); |
| | | } |
| | | //本年度已放电数量统计(1.2.5) |
| | | public List<BattInf> getDischr5Statistic(DisChargeStic stic) { |
| | | return mapper.getDischr5Statistic(stic); |
| | | } |
| | | //本年度已放电数量统计(1.2.6) |
| | | public List<BattInf> getDischr6Statistic(DisChargeStic stic) { |
| | | return mapper.getDischr6Statistic(stic); |
| | | } |
| | | //电池组电池性能统计(未放电,优秀,劣化,损坏)统计(1.2.8/9/10) |
| | | public List<BattInf> getPerformanceStatistic(PerformanceStic stic) { |
| | | return mapper.getPerformanceStatistic(stic); |
| | | } |
| | | } |
New file |
| | |
| | | package com.whyc.service; |
| | | |
| | | import com.whyc.dto.Real.BattHisRealDto; |
| | | import com.whyc.dto.Real.CompareDto; |
| | | import com.whyc.dto.Real.QuarterDto; |
| | | import com.whyc.dto.Real.RealDateDTO; |
| | | import com.whyc.dto.Response; |
| | | import com.whyc.factory.ThreadPoolExecutorFactory; |
| | | import com.whyc.mapper.CommonMapper; |
| | | |
| | | import com.whyc.pojo.db_data_history.BattRealdataId; |
| | | import com.whyc.util.ActionUtil; |
| | | import com.whyc.util.DateUtil; |
| | | import com.whyc.util.ThreadLocalUtil; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.text.ParseException; |
| | | import java.time.LocalDateTime; |
| | | import java.time.format.DateTimeFormatter; |
| | | import java.util.*; |
| | | import java.util.concurrent.CountDownLatch; |
| | | import java.util.concurrent.ThreadPoolExecutor; |
| | | import java.util.concurrent.TimeUnit; |
| | | import java.util.stream.Collectors; |
| | | |
| | | import static java.lang.Thread.sleep; |
| | | |
| | | @Service |
| | | public class BattRealdataIdService { |
| | | @Autowired |
| | | private SubTablePageInfoService subTablePageInfoService; |
| | | @Resource |
| | | private CommonMapper commonMapper; |
| | | |
| | | @Autowired |
| | | private BattresdataInfService resInfService; |
| | | |
| | | @Autowired |
| | | private BattInfService binfService; |
| | | |
| | | |
| | | //获取电池组最近一季度的单体数据 |
| | | public Response getBattQuarterVol(Integer battgroupId) { |
| | | HashMap<String,Object> map = new HashMap<>(); |
| | | Float maxData=0f; |
| | | Float minData=0f; |
| | | Float avgData=0f; |
| | | int num=0; |
| | | List<String> datelist = ActionUtil.getLastQuarterYearMonths(); |
| | | for (int i=0;i<datelist.size();i++) { |
| | | String date=datelist.get(i); |
| | | String tableName ="db_data_history.tb_batt_realdata_"+battgroupId+"_"+date; |
| | | String existTableName = commonMapper.existTable("db_data_history", "tb_batt_realdata_"+battgroupId+"_"+date); |
| | | if(existTableName == null){ |
| | | continue; |
| | | } |
| | | //判断表是否存在 |
| | | List<QuarterDto> datalist=subTablePageInfoService.getBattRealHis(tableName,"mon_vol"); |
| | | map.put(date,datalist); |
| | | //获取表中最大,最小,平均数据值 |
| | | CompareDto compareData=subTablePageInfoService.getBattCompareHis(tableName,"mon_vol"); |
| | | if(num==0){ |
| | | maxData=compareData.getMaxData(); |
| | | minData=compareData.getMinData(); |
| | | } |
| | | if (compareData.getMaxData() >= maxData) { |
| | | maxData =compareData.getMaxData(); |
| | | } |
| | | if (compareData.getMinData() <= minData) { |
| | | minData= compareData.getMinData(); |
| | | } |
| | | avgData+= compareData.getAvgData(); |
| | | map.put("maxData",maxData); |
| | | map.put("minData",minData); |
| | | map.put("avgData",avgData/datelist.size()); |
| | | num++; |
| | | } |
| | | return new Response().setII(1,map.size()>0,map,"获取电池组最近一季度的电压数据"); |
| | | } |
| | | //获取电池组最近一季度的内阻数据 |
| | | public Response getBattQuarterRes(Integer battgroupId) { |
| | | HashMap<String,Object> map = new HashMap<>(); |
| | | Float maxData=0f; |
| | | Float minData=0f; |
| | | Float avgData=0f; |
| | | int num=0; |
| | | List<String> datelist = ActionUtil.getLastQuarterYearMonths(); |
| | | //获取内阻初始数据(第一次内阻测试的第一笔数据) |
| | | List<QuarterDto> list=resInfService.getFirstResData(battgroupId); |
| | | if(list==null){//当初始值为0时使用标称内阻 |
| | | list=binfService.getBinfResStd(battgroupId); |
| | | } |
| | | map.put("startRes",list); |
| | | for (int i=0;i<datelist.size();i++) { |
| | | String date=datelist.get(i); |
| | | String tableName ="db_data_history.tb_batt_realdata_"+battgroupId+"_"+date; |
| | | String existTableName = commonMapper.existTable("db_data_history", "tb_batt_realdata_"+battgroupId+"_"+date); |
| | | if(existTableName == null){ |
| | | continue; |
| | | } |
| | | //判断表是否存在 |
| | | List<QuarterDto> datalist=subTablePageInfoService.getBattRealHis(tableName,"mon_res"); |
| | | map.put(date,datalist); |
| | | //获取表中最大,最小,平均数据值 |
| | | CompareDto compareData=subTablePageInfoService.getBattCompareHis(tableName,"mon_res"); |
| | | if(num==0){ |
| | | maxData=compareData.getMaxData(); |
| | | minData=compareData.getMinData(); |
| | | } |
| | | if (compareData.getMaxData() >= maxData) { |
| | | maxData =compareData.getMaxData(); |
| | | } |
| | | if (compareData.getMinData() <= minData) { |
| | | minData= compareData.getMinData(); |
| | | } |
| | | avgData+= compareData.getAvgData(); |
| | | map.put("maxData",maxData); |
| | | map.put("minData",minData); |
| | | map.put("avgData",avgData/datelist.size()); |
| | | num++; |
| | | } |
| | | return new Response().setII(1,map.size()>0,map,"获取电池组最近一季度的内阻数据"); |
| | | } |
| | | //获取电池组最近一季度的温度数据 |
| | | public Response getBattQuarterTmp(Integer battgroupId) { |
| | | HashMap<String,Object> map = new HashMap<>(); |
| | | Float maxData=0f; |
| | | Float minData=0f; |
| | | Float avgData=0f; |
| | | int num=0; |
| | | List<String> datelist = ActionUtil.getLastQuarterYearMonths(); |
| | | for (int i=0;i<datelist.size();i++) { |
| | | String date=datelist.get(i); |
| | | String tableName ="db_data_history.tb_batt_realdata_"+battgroupId+"_"+date; |
| | | String existTableName = commonMapper.existTable("db_data_history", "tb_batt_realdata_"+battgroupId+"_"+date); |
| | | //判断表是否存在 |
| | | if(existTableName == null){ |
| | | continue; |
| | | } |
| | | List<QuarterDto> datalist=subTablePageInfoService.getBattRealHis(tableName,"mon_tmp"); |
| | | map.put(date,datalist); |
| | | //获取表中最大,最小,平均数据值 |
| | | CompareDto compareData=subTablePageInfoService.getBattCompareHis(tableName,"mon_tmp"); |
| | | if(num==0){ |
| | | maxData=compareData.getMaxData(); |
| | | minData=compareData.getMinData(); |
| | | } |
| | | if (compareData.getMaxData() >= maxData) { |
| | | maxData =compareData.getMaxData(); |
| | | } |
| | | if (compareData.getMinData() <= minData) { |
| | | minData= compareData.getMinData(); |
| | | } |
| | | avgData+= compareData.getAvgData(); |
| | | map.put("maxData",maxData); |
| | | map.put("minData",minData); |
| | | map.put("avgData",avgData/datelist.size()); |
| | | num++; |
| | | } |
| | | return new Response().setII(1,map.size()>0,map,"获取电池组最近一季度的温度数据"); |
| | | } |
| | | //系统概览获取半小时核容设备信息 |
| | | public Response getHalfHourBattDevData(Integer battgroupId,Integer granularity) { |
| | | String dateTime = ActionUtil.sdfwithOutday.format(new Date()); |
| | | String tableName ="db_data_history.tb_batt_realdata_"+battgroupId+"_"+dateTime; |
| | | //获取前半个小时数据 |
| | | LocalDateTime now = LocalDateTime.now(); |
| | | // 计算半小时前的时间点 |
| | | LocalDateTime halfHourAgo = now.minusMinutes(30); |
| | | // 格式化输出 |
| | | DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"); |
| | | String halfHourAgoTime=halfHourAgo.format(formatter); |
| | | String existTableName = commonMapper.existTable("db_data_history", "tb_batt_realdata_"+battgroupId+"_"+dateTime); |
| | | if(existTableName == null){ |
| | | return new Response().set(1,false,"当前电池组不存在前面小时数据"); |
| | | } |
| | | List<BattHisRealDto> datalist=subTablePageInfoService.getHalfHourBattDevData(tableName,granularity,halfHourAgoTime); |
| | | return new Response().setII(1,datalist.size()>0,datalist,"获取半小时内核容设备信息"); |
| | | } |
| | | //历史实时数据 |
| | | public Response getBattRealDataHis(Integer battgroupId, Integer granularity,String startTime,String endTime) throws ParseException, InterruptedException { |
| | | List<RealDateDTO> dataList = new LinkedList<>(); |
| | | List<List<Date>> monthTimeList = DateUtil.getMonthTime(ThreadLocalUtil.parse(startTime,1), ThreadLocalUtil.parse(endTime,1)); |
| | | ThreadPoolExecutor pool = ThreadPoolExecutorFactory.getPoolExecutor(); |
| | | CountDownLatch latch = new CountDownLatch(monthTimeList.size()); |
| | | for (int i = 0; i < monthTimeList.size(); i++) { |
| | | int finalI = i; |
| | | pool.execute(() -> { |
| | | int finalII = finalI; |
| | | BattRealdataId realdata = new BattRealdataId(); |
| | | realdata.setRecordTime(monthTimeList.get(finalII).get(0)); |
| | | realdata.setRecordTime1(monthTimeList.get(finalII).get(1)); |
| | | String table = battgroupId + "_" + ThreadLocalUtil.format(realdata.getRecordTime(),2); |
| | | realdata.setTableName(table);//表名时间格式部分 |
| | | //判断表是否存在 |
| | | int tableNum = subTablePageInfoService.judgeTable_realdata(table); |
| | | List<RealDateDTO> list = new ArrayList(); |
| | | if (tableNum > 0) { |
| | | //获取指定时间段内最大最小recordNum确保数据的完整 |
| | | List recordNums= subTablePageInfoService.getMaxAndMinRecordNum(realdata); |
| | | Integer maxRecordNum= 0; |
| | | Integer minRecordNum= 0; |
| | | if(recordNums.size()>0){ |
| | | maxRecordNum=(Integer)recordNums.get(0); |
| | | minRecordNum=(Integer)recordNums.get(1); |
| | | } |
| | | list = subTablePageInfoService.getBattRealDataHis(realdata,granularity,maxRecordNum,minRecordNum); |
| | | } |
| | | dataList.addAll(list); |
| | | latch.countDown(); |
| | | }); |
| | | sleep(200); |
| | | } |
| | | latch.await(10, TimeUnit.MINUTES); |
| | | List dataListSorted = dataList.stream().sorted(Comparator.comparing(RealDateDTO::getRecordTime)).collect(Collectors.toList()); |
| | | return new Response().set(1, dataListSorted); |
| | | |
| | | } |
| | | } |
New file |
| | |
| | | package com.whyc.service; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.whyc.mapper.BattRtdataMapper; |
| | | import com.whyc.pojo.db_ram_db.BattRtdata; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.List; |
| | | |
| | | @Service |
| | | public class BattRtdataService { |
| | | @Autowired(required = false) |
| | | private BattRtdataMapper mapper; |
| | | //实时获取单体信息 |
| | | public List<BattRtdata> getRtdataRealInfo(Integer battgroupId) { |
| | | QueryWrapper wrapper=new QueryWrapper(); |
| | | wrapper.eq("battgroup_id",battgroupId); |
| | | wrapper.orderByAsc("mon_num"); |
| | | List<BattRtdata> list=mapper.selectList(wrapper); |
| | | return list; |
| | | } |
| | | //获取单体的实时数据 |
| | | public BattRtdata getRtdataByNum(Integer battgroupId, Integer monNum) { |
| | | QueryWrapper wrapper=new QueryWrapper(); |
| | | wrapper.eq("battgroup_id",battgroupId); |
| | | wrapper.eq("mon_num",monNum); |
| | | wrapper.last("limit 1"); |
| | | BattRtdata rtdata=mapper.selectOne(wrapper); |
| | | return rtdata; |
| | | } |
| | | } |
New file |
| | |
| | | package com.whyc.service; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.whyc.constant.BattStateEnum; |
| | | import com.whyc.constant.DevStateEnum; |
| | | import com.whyc.dto.Response; |
| | | import com.whyc.mapper.BattRtstateMapper; |
| | | import com.whyc.pojo.db_ram_db.BattRtstate; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.Map; |
| | | |
| | | @Service |
| | | public class BattRtstateService { |
| | | @Autowired(required = false) |
| | | private BattRtstateMapper mapper; |
| | | //实时获取电池组信息 |
| | | public BattRtstate getBattRealInfo(Integer battgroupId) { |
| | | QueryWrapper wrapper=new QueryWrapper(); |
| | | wrapper.eq("battgroup_id",battgroupId); |
| | | wrapper.last("limit 1"); |
| | | BattRtstate batt=mapper.selectOne(wrapper); |
| | | return batt; |
| | | } |
| | | //获取电池组工作状态类型(下拉) |
| | | public Response getBattState() { |
| | | Map<Integer,String> map= BattStateEnum.getOpInfo(); |
| | | return new Response().setII(1,true,map,"获取电池组工作状态类型(下拉)"); |
| | | } |
| | | } |
New file |
| | |
| | | package com.whyc.service; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; |
| | | import com.github.pagehelper.PageHelper; |
| | | import com.github.pagehelper.PageInfo; |
| | | import com.whyc.constant.BattAlarmIdEnum; |
| | | import com.whyc.constant.BattSingalIdEnum; |
| | | import com.whyc.constant.DevAlarmEnum; |
| | | import com.whyc.dto.Real.AlmDto; |
| | | import com.whyc.dto.Response; |
| | | import com.whyc.mapper.BattalarmDataMapper; |
| | | import com.whyc.pojo.db_alarm.BattalarmData; |
| | | import com.whyc.util.ActionUtil; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | @Service |
| | | public class BattalarmDataService { |
| | | @Autowired(required = false) |
| | | private BattalarmDataMapper mapper; |
| | | //获取电池组实时告警信息 |
| | | public Response getBattAlmReal(AlmDto almDto) { |
| | | PageHelper.startPage(almDto.getPageNum(),almDto.getPageSize()); |
| | | List<BattalarmData> list=mapper.getBattAlmReal(almDto); |
| | | list.forEach(data->{ |
| | | data.setAlmName(BattSingalIdEnum.getValue(data.getAlmSignalId())); |
| | | }); |
| | | PageInfo pageInfo=new PageInfo(list); |
| | | return new Response().setII(1,list!=null,pageInfo,"获取电池组实时告警信息"); |
| | | } |
| | | //确认电池告警 |
| | | public Response updateBattConfrim(Integer num) { |
| | | UpdateWrapper wrapper = new UpdateWrapper<>(); |
| | | wrapper.set("alm_is_confirmed",1); |
| | | wrapper.set("alm_confirmed_time",new SimpleDateFormat(ActionUtil.time_yyyyMMddHHmmss).format(new Date())); |
| | | // 通过num修改 |
| | | wrapper.eq("num",num); |
| | | int flag=mapper.update((BattalarmData) ActionUtil.objeNull,wrapper); |
| | | return new Response().set(1,flag>0,flag>0?"确认成功":"确认失败"); |
| | | } |
| | | //获取一级未处理实时告警数 |
| | | public Integer getBattAlmNum(Integer battgroupId) { |
| | | QueryWrapper wrapper=new QueryWrapper(); |
| | | wrapper.eq("battgroup_id",battgroupId); |
| | | wrapper.eq("alm_is_confirmed",0); |
| | | wrapper.eq("alm_level",1); |
| | | List<BattalarmData> list=mapper.selectList(wrapper); |
| | | return list!=null?list.size():0; |
| | | } |
| | | //获取电池告警类型(下拉) |
| | | public Response getAlarmIdType() { |
| | | Map<Integer,String> map= BattAlarmIdEnum.getOpInfo(); |
| | | return new Response().setII(1,true,map,"获取电池告警类型(下拉)"); |
| | | } |
| | | } |
New file |
| | |
| | | package com.whyc.service; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.whyc.dto.Real.QuarterDto; |
| | | import com.whyc.mapper.BattresdataInfMapper; |
| | | import com.whyc.mapper.CommonMapper; |
| | | import com.whyc.pojo.db_batt_testdata.BattresdataId; |
| | | import com.whyc.pojo.db_batt_testdata.BattresdataInf; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.List; |
| | | |
| | | @Service |
| | | public class BattresdataInfService { |
| | | @Autowired(required = false) |
| | | private BattresdataInfMapper mapper; |
| | | |
| | | @Autowired(required = false) |
| | | private SubTablePageInfoService subTablePageInfoService; |
| | | |
| | | @Resource |
| | | private CommonMapper commonMapper; |
| | | |
| | | //上一次内阻测试数据 |
| | | public BattresdataInf getLastTestData(Integer battgroupId) { |
| | | QueryWrapper wrapper = new QueryWrapper(); |
| | | wrapper.eq("battgroup_id", battgroupId); |
| | | wrapper.last(" limit 1"); |
| | | wrapper.last(" ORDER BY test_starttime DESC "); |
| | | BattresdataInf rinf = mapper.selectOne(wrapper); |
| | | return rinf; |
| | | } |
| | | //获取内阻初始数据(第一次内阻测试的第一笔数据) |
| | | public List<QuarterDto> getFirstResData(Integer battgroupId) { |
| | | QueryWrapper wrapper = new QueryWrapper(); |
| | | wrapper.eq("battgroup_id", battgroupId); |
| | | wrapper.last(" limit 1"); |
| | | wrapper.last(" ORDER BY test_record_count asc "); |
| | | BattresdataInf rinf = mapper.selectOne(wrapper); |
| | | if(rinf!=null){ |
| | | String tableName ="db_batt_testdata.tb_battresdata_"+battgroupId; |
| | | String existTableName = commonMapper.existTable("db_batt_testdata", "tb_battresdata_"+battgroupId); |
| | | if(existTableName != null){ |
| | | List<QuarterDto> list=subTablePageInfoService.getBattResInfData(battgroupId,rinf.getTestRecordCount()); |
| | | return list; |
| | | } |
| | | } |
| | | return null; |
| | | } |
| | | } |
New file |
| | |
| | | package com.whyc.service; |
| | | |
| | | import com.whyc.dto.Response; |
| | | import com.whyc.mapper.CommonMapper; |
| | | import com.whyc.pojo.db_batt_testdata.BatttestdataId; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.List; |
| | | |
| | | @Service |
| | | public class BatttestdataIdService { |
| | | @Autowired |
| | | private SubTablePageInfoService subTablePageInfoService; |
| | | @Resource |
| | | private CommonMapper commonMapper; |
| | | |
| | | //找这次放电的指定的一笔数据 |
| | | public List<BatttestdataId> getLastDataByBattgroupId(Integer battgroupId, Integer testRecordCount, Integer recordNum) { |
| | | List<BatttestdataId> list=subTablePageInfoService.getLastDataByBattgroupId(battgroupId, testRecordCount, recordNum); |
| | | return list; |
| | | } |
| | | //历史测试记录具体某一次放电数据详情 |
| | | public Response getTinfDataWithTestRecordCount(Integer battgroupId, Integer testRecordCount,Integer recordNum, Integer granularity) { |
| | | String tableName ="db_batt_testdata.tb_batttestdata_"+battgroupId; |
| | | String existTableName = commonMapper.existTable("db_batt_testdata", "tb_batttestdata_"+battgroupId); |
| | | if(existTableName == null){ |
| | | return new Response().set(1,false,battgroupId+"电池组找不到第"+testRecordCount+"次放电记录"); |
| | | } |
| | | List<BatttestdataId> list=subTablePageInfoService.getTinfDataWithTestRecordCount(tableName,testRecordCount,recordNum,granularity); |
| | | return new Response().setII(1,list.size()>0,list,"获取历史测试记录数据详情"); |
| | | } |
| | | } |
New file |
| | |
| | | package com.whyc.service; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.github.pagehelper.PageHelper; |
| | | import com.github.pagehelper.PageInfo; |
| | | import com.whyc.constant.Capperformance; |
| | | import com.whyc.constant.PowerAlarmEnum; |
| | | import com.whyc.constant.StopReasonEnum; |
| | | import com.whyc.dto.Real.TestDataDto; |
| | | import com.whyc.dto.Response; |
| | | import com.whyc.dto.Statistic.*; |
| | | import com.whyc.factory.BattCapFactory; |
| | | import com.whyc.mapper.BatttestdataInfMapper; |
| | | import com.whyc.pojo.db_batt_testdata.BatttestdataId; |
| | | import com.whyc.pojo.db_batt_testdata.BatttestdataInf; |
| | | import com.whyc.pojo.db_param.AppParam; |
| | | import com.whyc.pojo.db_ram_db.BattRtdata; |
| | | import com.whyc.pojo.db_ram_db.BattRtstate; |
| | | import com.whyc.pojo.db_station.BattInf; |
| | | import com.whyc.pojo.db_user.Baojigroup; |
| | | import com.whyc.util.ActionUtil; |
| | | import com.whyc.util.PageInfoUtils; |
| | | import com.whyc.util.ThreadLocalUtil; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.*; |
| | | |
| | | @Service |
| | | public class BatttestdataInfService { |
| | | @Autowired(required = false) |
| | | private BatttestdataInfMapper mapper; |
| | | |
| | | @Autowired(required = false) |
| | | private BattRtstateService rtstateService; |
| | | |
| | | @Autowired(required = false) |
| | | private BattRtdataService rtdataService; |
| | | |
| | | @Autowired(required = false) |
| | | private BattInfService battInfService; |
| | | |
| | | @Autowired(required = false) |
| | | private BatttestdataIdService battTestdataIdService; |
| | | |
| | | @Autowired(required = false) |
| | | private AppParamService appParamService; |
| | | |
| | | @Autowired(required = false) |
| | | private BaojigroupService bjService; |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | //获取最后一次测试数据并计算剩余容量 |
| | | public Float getLastTestDataRestCap(Integer battgroupId) { |
| | | //获取放电记录 |
| | | QueryWrapper wrapper=new QueryWrapper(); |
| | | wrapper.eq("battgroup_id",battgroupId); |
| | | wrapper.orderByDesc("test_starttime"); |
| | | wrapper.last("limit 1"); |
| | | BatttestdataInf tinf=mapper.selectOne(wrapper); |
| | | if(tinf!=null){ |
| | | int hourRate = BattCapFactory.GetHourRate(tinf.getTestCap(), tinf.getTestCurr()); |
| | | Float restcap = (float) BattCapFactory.GetMonomerCap(tinf.getTestCap(), hourRate, tinf.getTestCap(), tinf.getMaxMonvol(), tinf.getMinMonvol(), tinf.getGroupVol(), BattCapFactory.CapType_Rest); |
| | | return restcap; |
| | | }else{ |
| | | return 0f; |
| | | } |
| | | } |
| | | //蓄电池核容信息统计 |
| | | public Response getBattTinfStatistic(BattTinfStic stic) { |
| | | PageHelper.startPage(stic.getPageNum(), stic.getPageSize()); |
| | | List<BatttestdataInf> list=mapper.getBattTinfStatistic(stic); |
| | | if(list!=null&&list.size()>0){ |
| | | for (BatttestdataInf tinf:list) { |
| | | //剩余容量和剩余时间计算 |
| | | int hourRate = BattCapFactory.GetHourRate(tinf.getTestCap(), tinf.getTestCurr()); |
| | | Float restCap = (float) BattCapFactory.GetMonomerCap(tinf.getTestCap(), hourRate, tinf.getTestCap(), tinf.getMaxMonvol(), tinf.getMinMonvol(), tinf.getGroupVol(), BattCapFactory.CapType_Rest); |
| | | Float realCap = (float) BattCapFactory.GetMonomerCap(tinf.getTestCap(), hourRate, tinf.getTestCap(), tinf.getMaxMonvol(), tinf.getMinMonvol(), tinf.getGroupVol(), BattCapFactory.CapType_Real); |
| | | tinf.setRestCap(restCap); |
| | | tinf.setRealCap(realCap); |
| | | tinf.setRestTime(0f); |
| | | //获取电池组实时数据 |
| | | BattRtstate battRtstate=rtstateService.getBattRealInfo(tinf.getBattgroupId()); |
| | | //获取电池组信息 |
| | | BattInf binf=battInfService.getBinfByBattgroupId(tinf.getBattgroupId()); |
| | | //实时组端电流,剩余容量,标称容量 |
| | | if(battRtstate!=null){ |
| | | Float restTime= BattCapFactory.getTheoryTime(battRtstate.getLoadCurr(), restCap, binf.getMoncapstd()); |
| | | tinf.setRestTime(restTime); |
| | | } |
| | | //保留5位小数 |
| | | String precentCap = String.format("%.5f",(restCap/binf.getMoncapstd()*100)); |
| | | tinf.setPrecentCap(precentCap); |
| | | } |
| | | } |
| | | |
| | | PageInfo pageInfo=new PageInfo(list); |
| | | return new Response().setII(1,list.size()>0,pageInfo,"蓄电池核容信息统计"); |
| | | } |
| | | //获取上一次标准核容信息(标准核容的界定为单测核容时间达 2小时及以上的核容测试) |
| | | public BatttestdataInf getLastStandardTestData(Integer battgroupId) { |
| | | QueryWrapper wrapper = new QueryWrapper(); |
| | | wrapper.eq("battgroup_id", battgroupId); |
| | | wrapper.eq("test_type", 3); |
| | | wrapper.eq("test_starttype", 3); |
| | | wrapper.last(" and test_timelong >= 7200 ORDER BY test_starttime DESC "); |
| | | wrapper.last("limit 1"); |
| | | BatttestdataInf tinf = mapper.selectOne(wrapper); |
| | | tinf.setTestStoptypeReason(StopReasonEnum.getValue(tinf.getTestStoptype())); |
| | | return tinf; |
| | | } |
| | | |
| | | //获取电池组在给定时间段的放电记录(指定时间段的标准核容放电) |
| | | private BatttestdataInf getLastStandardTestDataByTime(Integer battgroupId, Date testStartTime, Date testEndTime) { |
| | | QueryWrapper wrapper = new QueryWrapper(); |
| | | wrapper.eq("battgroup_id", battgroupId); |
| | | wrapper.eq("test_type", 3); |
| | | wrapper.eq("test_starttype", 3); |
| | | if(testStartTime!=null){ |
| | | wrapper.gt("test_starttime",testStartTime); |
| | | } |
| | | if(testEndTime!=null){ |
| | | wrapper.lt("test_starttime",testEndTime); |
| | | } |
| | | wrapper.last(" and test_timelong >= 7200 ORDER BY test_starttime DESC "); |
| | | wrapper.last("limit 1"); |
| | | BatttestdataInf tinf = mapper.selectOne(wrapper); |
| | | return tinf; |
| | | } |
| | | /*单节数量统计 |
| | | 1筛选满足条件的电池组,找最近一次标准核容放电记录的最后一笔数据 |
| | | 2再按照公式计算单体实际容量, |
| | | 3然后找到判断优秀,劣化,损坏的参数,得到结果。 |
| | | 4浮充电压图,需要显示单体+实时数据的单体电压,单体内阻 |
| | | */ |
| | | public Map getMonStatistic(MonStic stic) { |
| | | Map<String,Object> map=new HashMap<>(); |
| | | List<SticMonRes> goodlist=new ArrayList(); |
| | | List<SticMonRes> badlist=new ArrayList(); |
| | | List<SticMonRes> damagelist=new ArrayList(); |
| | | map.put("goodlist",goodlist); |
| | | map.put("badlist",badlist); |
| | | map.put("damagelist",damagelist); |
| | | map.put("goodlistNum",0); |
| | | map.put("badlistNum",0); |
| | | map.put("damagelistNum",0); |
| | | //获取核容优劣,损坏参数 |
| | | List<AppParam> paramList=appParamService.getHrParam(); |
| | | Float badValue=0f; |
| | | Float damageValue=0f; |
| | | if(paramList!=null){ |
| | | for (AppParam param:paramList) { |
| | | if(param.getParamNamePsx().equals("batt_mon_deteriorate_val")){ |
| | | badValue=param.getParamValue(); |
| | | } |
| | | if(param.getParamNamePsx().equals("batt_mon_damage_val")){ |
| | | damageValue=param.getParamValue(); |
| | | } |
| | | |
| | | } |
| | | } |
| | | List<BattInf> binfList=battInfService.getMonStatistic(stic); |
| | | Float realCap=0f; |
| | | if(binfList==null){ |
| | | return map; |
| | | } |
| | | for (BattInf binf:binfList) { |
| | | BatttestdataInf tinf =getLastStandardTestData(binf.getBattgroupId()); |
| | | if(tinf==null){ |
| | | //将不满足条件的电池组的所有单体放入damage中 |
| | | setDamage(damagelist,binf); |
| | | continue; |
| | | } |
| | | //找这次放电的最后一笔数据 |
| | | List<BatttestdataId> idDataList=battTestdataIdService.getLastDataByBattgroupId(tinf.getBattgroupId(),tinf.getTestRecordCount(),tinf.getRecordNum()); |
| | | if(idDataList==null||idDataList.size()==0){ |
| | | //将不满足条件的电池组的所有单体放入damage中 |
| | | setDamage(damagelist,binf); |
| | | continue; |
| | | } |
| | | int hourRate = BattCapFactory.GetHourRate(tinf.getTestCap(), tinf.getTestCurr()); |
| | | Float moncapStd=binf.getMoncapstd(); |
| | | for (BatttestdataId data:idDataList) {//求单体的 实际容量,最小值就是单体的单体电压 |
| | | realCap = (float) BattCapFactory.GetMonomerCap(tinf.getTestCap(), hourRate, tinf.getTestCap(), tinf.getMaxMonvol(),data.getMonVol() , tinf.getGroupVol(), BattCapFactory.CapType_Real); |
| | | SticMonRes res=new SticMonRes(); |
| | | res.setBattgroupId(binf.getBattgroupId()); |
| | | res.setBattgroupName(binf.getBattgroupName()); |
| | | res.setStationName(binf.getStationName()); |
| | | res.setDevName(binf.getDevName()); |
| | | res.setMonNum(data.getMonNum()); |
| | | //获取单体的实时数据 |
| | | BattRtdata rtdata=rtdataService.getRtdataByNum(binf.getBattgroupId(),data.getMonNum()); |
| | | if(rtdata==null){ |
| | | res.setMonVol(0f); |
| | | res.setMonRes(0f); |
| | | }else{ |
| | | res.setMonVol(rtdata.getMonVol()); |
| | | res.setMonRes(rtdata.getMonRes()); |
| | | } |
| | | if(realCap>=moncapStd*badValue){ |
| | | goodlist.add(res); |
| | | } |
| | | if(realCap<=moncapStd*damageValue){ |
| | | damagelist.add(res); |
| | | } |
| | | if((realCap>moncapStd*damageValue)&&(realCap<moncapStd*badValue)){ |
| | | badlist.add(res); |
| | | } |
| | | } |
| | | } |
| | | map.put("goodlist",goodlist); |
| | | map.put("badlist",badlist); |
| | | map.put("damagelist",damagelist); |
| | | map.put("goodlistNum",goodlist.size()); |
| | | map.put("badlistNum",badlist.size()); |
| | | map.put("damagelistNum",damagelist.size()); |
| | | return map; |
| | | |
| | | } |
| | | //将不满足条件的电池组的所有单体放入damage中 |
| | | private void setDamage(List damagelist, BattInf binf) { |
| | | //获取电池组的实时数据 |
| | | List<BattRtdata> rtdataList=rtdataService.getRtdataRealInfo(binf.getBattgroupId()); |
| | | if(rtdataList==null||rtdataList.size()==0){ |
| | | for (int i=0;i<binf.getMoncount();i++){ |
| | | SticMonRes res=new SticMonRes(); |
| | | res.setBattgroupId(binf.getBattgroupId()); |
| | | res.setBattgroupName(binf.getBattgroupName()); |
| | | res.setStationName(binf.getStationName()); |
| | | res.setDevName(binf.getDevName()); |
| | | res.setMonNum(i+1); |
| | | res.setMonVol(0f); |
| | | res.setMonRes(0f); |
| | | damagelist.add(res); |
| | | } |
| | | }else { |
| | | for (BattRtdata rtdata:rtdataList) { |
| | | SticMonRes res=new SticMonRes(); |
| | | res.setBattgroupId(binf.getBattgroupId()); |
| | | res.setBattgroupName(binf.getBattgroupName()); |
| | | res.setStationName(binf.getStationName()); |
| | | res.setDevName(binf.getDevName()); |
| | | res.setMonNum(rtdata.getMonNum()); |
| | | res.setMonVol(rtdata.getMonVol()); |
| | | res.setMonRes(rtdata.getMonRes()); |
| | | damagelist.add(res); |
| | | } |
| | | } |
| | | } |
| | | /*蓄电池组对比分析界面(同一品牌同一时间) |
| | | *1.查询出符合条件的电池组信息 |
| | | * 2.计算电池组的预估剩余容量 |
| | | *3.判断性能和百分比 |
| | | * 4.分页 |
| | | */ |
| | | public Response getBattCompare15Statistic(BattCompareStic stic) { |
| | | //获取核容优劣,损坏参数 |
| | | List<AppParam> paramList=appParamService.getHrParam(); |
| | | Float badValue=0f; |
| | | Float damageValue=0f; |
| | | if(paramList!=null){ |
| | | for (AppParam param:paramList) { |
| | | if(param.getParamNamePsx().equals("batt_mon_deteriorate_val")){ |
| | | badValue=param.getParamValue(); |
| | | } |
| | | if(param.getParamNamePsx().equals("batt_mon_damage_val")){ |
| | | damageValue=param.getParamValue(); |
| | | } |
| | | |
| | | } |
| | | } |
| | | //1查询符合条件的电池组 |
| | | List<BattInf> binfList=battInfService.getBattCompare15Statistic(stic); |
| | | if(binfList==null||binfList.size()==0){ |
| | | return new Response().set(1,false,"当前用户未管理满足条件的电池组"); |
| | | } |
| | | List<SticCompare15Res> reslist=new ArrayList<>(); |
| | | for (BattInf binf:binfList) { |
| | | SticCompare15Res res=new SticCompare15Res(); |
| | | res.setProvice(binf.getProvice()); |
| | | res.setCity(binf.getCity()); |
| | | res.setCountry(binf.getCountry()); |
| | | res.setStationName(binf.getStationName()); |
| | | res.setBattgroupName(binf.getBattgroupName()); |
| | | res.setDevName(binf.getDevName()); |
| | | res.setProduct(binf.getProduct()); |
| | | res.setInuseTime(binf.getInuseTime()); |
| | | res.setMonvolstd(binf.getMonvolstd()); |
| | | res.setStationId(binf.getStationId()); |
| | | res.setPowerId(binf.getPowerId()); |
| | | res.setDevId(binf.getDevId()); |
| | | res.setBattgroupId(binf.getBattgroupId()); |
| | | //2.获取电池组在给定时间段的放电记录(指定时间段的标准核容放电) |
| | | BatttestdataInf tinf =getLastStandardTestDataByTime(binf.getBattgroupId(),stic.getTestStartTime(),stic.getTestEndTime()); |
| | | if(tinf==null){ |
| | | res.setRealCap(0f); |
| | | res.setPrecentCap("0"); |
| | | res.setCapperformance(Capperformance.getValue(Capperformance.BATTSTATE_4.getStateId())); |
| | | continue; |
| | | } |
| | | //找这次放电的最后一笔数据 |
| | | List<BatttestdataId> idDataList=battTestdataIdService.getLastDataByBattgroupId(tinf.getBattgroupId(),tinf.getTestRecordCount(),tinf.getRecordNum()); |
| | | if(idDataList==null||idDataList.size()==0){ |
| | | res.setRealCap(0f); |
| | | res.setPrecentCap("0"); |
| | | res.setCapperformance(Capperformance.getValue(Capperformance.BATTSTATE_4.getStateId())); |
| | | continue; |
| | | } |
| | | Float moncapStd=binf.getMoncapstd(); |
| | | int hourRate = BattCapFactory.GetHourRate(tinf.getTestCap(), tinf.getTestCurr()); |
| | | Float grouprealCap = (float) BattCapFactory.GetMonomerCap(tinf.getTestCap(), hourRate, tinf.getTestCap(), tinf.getMaxMonvol(), tinf.getMinMonvol(), tinf.getGroupVol(), BattCapFactory.CapType_Real); |
| | | //Float restCap = (float) BattCapFactory.GetMonomerCap(tinf.getTestCap(), hourRate, tinf.getTestCap(), tinf.getMaxMonvol(), tinf.getMinMonvol(), tinf.getGroupVol(), BattCapFactory.CapType_Rest); |
| | | res.setRealCap(grouprealCap); |
| | | if(grouprealCap>=moncapStd*badValue){ |
| | | res.setCapperformance(Capperformance.getValue(Capperformance.BATTSTATE_1.getStateId())); |
| | | } |
| | | if(grouprealCap<=moncapStd*damageValue){ |
| | | res.setCapperformance(Capperformance.getValue(Capperformance.BATTSTATE_3.getStateId())); |
| | | } |
| | | if((grouprealCap>moncapStd*damageValue)&&(grouprealCap<moncapStd*badValue)){ |
| | | res.setCapperformance(Capperformance.getValue(Capperformance.BATTSTATE_2.getStateId())); |
| | | } |
| | | //保留5位小数 |
| | | String precentCap = String.format("%.5f",(grouprealCap/binf.getMoncapstd()*100)); |
| | | res.setPrecentCap(precentCap); |
| | | List<Integer> monNums=new ArrayList<>(); |
| | | for (BatttestdataId data:idDataList) {//求单体的 实际容量,最小值就是单体的单体电压 |
| | | Float monrealCap = (float) BattCapFactory.GetMonomerCap(tinf.getTestCap(), hourRate, tinf.getTestCap(), tinf.getMaxMonvol(), data.getMonVol(), tinf.getGroupVol(), BattCapFactory.CapType_Real); |
| | | if (monrealCap <= moncapStd * damageValue) {//损坏的 |
| | | monNums.add(data.getMonNum()); |
| | | } |
| | | } |
| | | res.setMonNums(monNums); |
| | | if(stic.getPerformance()==null){ |
| | | reslist.add(res); |
| | | }else{ |
| | | if(res.getCapperformance().equals(Capperformance.getValue(stic.getPerformance()))){ |
| | | reslist.add(res); |
| | | } |
| | | } |
| | | |
| | | } |
| | | PageInfo pageInfo=PageInfoUtils.list2PageInfo(reslist, stic.getPageNum(), stic.getPageSize()); |
| | | return new Response().setII(1,reslist.size()>0,pageInfo,"蓄电池组对比分析界面(同一品牌同一时间)"); |
| | | } |
| | | |
| | | //蓄电池组对比分析界面(不同品牌同一时间)(1.2.16) |
| | | public Response getBattCompare16Statistic(BattCompareStic stic) { |
| | | //获取核容优劣,损坏参数 |
| | | List<AppParam> paramList=appParamService.getHrParam(); |
| | | Float badValue=0f; |
| | | Float damageValue=0f; |
| | | if(paramList!=null){ |
| | | for (AppParam param:paramList) { |
| | | if(param.getParamNamePsx().equals("batt_mon_deteriorate_val")){ |
| | | badValue=param.getParamValue(); |
| | | } |
| | | if(param.getParamNamePsx().equals("batt_mon_damage_val")){ |
| | | damageValue=param.getParamValue(); |
| | | } |
| | | |
| | | } |
| | | } |
| | | //1查询符合条件的电池组 |
| | | List<BattInf> binfList=battInfService.getBattCompare16Statistic(stic); |
| | | if(binfList==null||binfList.size()==0){ |
| | | return new Response().set(1,false,"当前用户未管理满足条件的电池组"); |
| | | } |
| | | List<SticCompare16Res> reslist=new ArrayList<>(); |
| | | for (BattInf binf:binfList) { |
| | | SticCompare16Res res=new SticCompare16Res(); |
| | | res.setProvice(binf.getProvice()); |
| | | res.setCity(binf.getCity()); |
| | | res.setCountry(binf.getCountry()); |
| | | res.setStationName(binf.getStationName()); |
| | | res.setBattgroupName(binf.getBattgroupName()); |
| | | res.setDevName(binf.getDevName()); |
| | | res.setProduct(binf.getProduct()); |
| | | res.setInuseTime(binf.getInuseTime()); |
| | | res.setMonvolstd(binf.getMonvolstd()); |
| | | res.setMoncapstd(binf.getMoncapstd()); |
| | | res.setStationId(binf.getStationId()); |
| | | res.setPowerId(binf.getPowerId()); |
| | | res.setDevId(binf.getDevId()); |
| | | res.setBattgroupId(binf.getBattgroupId()); |
| | | //2.获取电池组在给定时间段的放电记录(指定时间段的标准核容放电) |
| | | BatttestdataInf tinf =getLastStandardTestDataByTime(binf.getBattgroupId(),stic.getTestStartTime(),stic.getTestEndTime()); |
| | | if(tinf==null){ |
| | | res.setRealCap(0f); |
| | | res.setPrecentCap("0"); |
| | | res.setCapperformance(Capperformance.getValue(Capperformance.BATTSTATE_3.getStateId())); |
| | | res.setStopReason("--"); |
| | | continue; |
| | | } |
| | | res.setStopReason(StopReasonEnum.getValue(tinf.getTestStoptype())); |
| | | Float moncapStd=binf.getMoncapstd(); |
| | | int hourRate = BattCapFactory.GetHourRate(tinf.getTestCap(), tinf.getTestCurr()); |
| | | Float grouprealCap = (float) BattCapFactory.GetMonomerCap(tinf.getTestCap(), hourRate, tinf.getTestCap(), tinf.getMaxMonvol(), tinf.getMinMonvol(), tinf.getGroupVol(), BattCapFactory.CapType_Real); |
| | | //Float restCap = (float) BattCapFactory.GetMonomerCap(tinf.getTestCap(), hourRate, tinf.getTestCap(), tinf.getMaxMonvol(), tinf.getMinMonvol(), tinf.getGroupVol(), BattCapFactory.CapType_Rest); |
| | | res.setRealCap(grouprealCap); |
| | | if(grouprealCap>=moncapStd*badValue){ |
| | | res.setCapperformance(Capperformance.getValue(Capperformance.BATTSTATE_1.getStateId())); |
| | | } |
| | | if(grouprealCap<=moncapStd*damageValue){ |
| | | res.setCapperformance(Capperformance.getValue(Capperformance.BATTSTATE_3.getStateId())); |
| | | } |
| | | if((grouprealCap>moncapStd*damageValue)&&(grouprealCap<moncapStd*badValue)){ |
| | | res.setCapperformance(Capperformance.getValue(Capperformance.BATTSTATE_2.getStateId())); |
| | | } |
| | | //保留5位小数 |
| | | String precentCap = String.format("%.5f",(grouprealCap/binf.getMoncapstd()*100)); |
| | | //评分的逻辑 |
| | | res.setScore(0f); |
| | | res.setPrecentCap(precentCap); |
| | | if(stic.getPerformance()==null){ |
| | | reslist.add(res); |
| | | }else{ |
| | | if(res.getCapperformance().equals(Capperformance.getValue(stic.getPerformance()))){ |
| | | reslist.add(res); |
| | | } |
| | | } |
| | | |
| | | } |
| | | PageInfo pageInfo=PageInfoUtils.list2PageInfo(reslist, stic.getPageNum(), stic.getPageSize()); |
| | | return new Response().setII(1,reslist.size()>0,pageInfo,"蓄电池组对比分析界面(不同品牌同一时间)"); |
| | | } |
| | | //蓄电池组对比分析界面(同一品牌不同时间)(1.2.17) |
| | | public Response getBattCompare17Statistic(BattCompareStic stic) { |
| | | //获取核容优劣,损坏参数 |
| | | List<AppParam> paramList=appParamService.getHrParam(); |
| | | Float badValue=0f; |
| | | Float damageValue=0f; |
| | | if(paramList!=null){ |
| | | for (AppParam param:paramList) { |
| | | if(param.getParamNamePsx().equals("batt_mon_deteriorate_val")){ |
| | | badValue=param.getParamValue(); |
| | | } |
| | | if(param.getParamNamePsx().equals("batt_mon_damage_val")){ |
| | | damageValue=param.getParamValue(); |
| | | } |
| | | |
| | | } |
| | | } |
| | | //1查询符合条件的电池组 |
| | | List<BattInf> binfList=battInfService.getBattCompare17Statistic(stic); |
| | | if(binfList==null||binfList.size()==0){ |
| | | return new Response().set(1,false,"当前用户未管理满足条件的电池组"); |
| | | } |
| | | List<SticCompare17Res> reslist=new ArrayList<>(); |
| | | for (BattInf binf:binfList) { |
| | | //2.获取电池组在给定时间段的放电记录(指定时间段的标准核容放电) |
| | | BatttestdataInf tinf =getLastStandardTestDataByTime(binf.getBattgroupId(),stic.getTestStartTime(),stic.getTestEndTime()); |
| | | if(tinf==null){ |
| | | //不存在放电记录则默认为实际预估容量全为0 |
| | | setSticCompare17Res(binf,reslist,stic.getPerformance()); |
| | | continue; |
| | | } |
| | | //找这次放电的最后一笔数据 |
| | | List<BatttestdataId> idDataList=battTestdataIdService.getLastDataByBattgroupId(tinf.getBattgroupId(),tinf.getTestRecordCount(),tinf.getRecordNum()); |
| | | if(idDataList==null||idDataList.size()==0){ |
| | | //不存在放电记录则默认为实际预估容量全为0 |
| | | setSticCompare17Res(binf,reslist,stic.getPerformance()); |
| | | continue; |
| | | } |
| | | Float moncapStd=binf.getMoncapstd(); |
| | | int hourRate = BattCapFactory.GetHourRate(tinf.getTestCap(), tinf.getTestCurr()); |
| | | for (BatttestdataId data:idDataList) {//求单体的 实际容量,最小值就是单体的单体电压 |
| | | SticCompare17Res res=new SticCompare17Res(); |
| | | res.setProvice(binf.getProvice()); |
| | | res.setCity(binf.getCity()); |
| | | res.setCountry(binf.getCountry()); |
| | | res.setStationName(binf.getStationName()); |
| | | res.setDevName(binf.getDevName()); |
| | | res.setBattgroupName(binf.getBattgroupName()); |
| | | res.setProduct(binf.getProduct()); |
| | | res.setInuseTime(binf.getInuseTime()); |
| | | res.setMonvolstd(binf.getMonvolstd()); |
| | | res.setMonNum(data.getMonNum()); |
| | | res.setStationId(binf.getStationId()); |
| | | res.setPowerId(binf.getPowerId()); |
| | | res.setDevId(binf.getDevId()); |
| | | res.setBattgroupId(binf.getBattgroupId()); |
| | | Float monrealCap = (float) BattCapFactory.GetMonomerCap(tinf.getTestCap(), hourRate, tinf.getTestCap(), tinf.getMaxMonvol(), data.getMonVol(), tinf.getGroupVol(), BattCapFactory.CapType_Real); |
| | | res.setMonrealCap(monrealCap); |
| | | //保留5位小数 |
| | | String monprecentCap = String.format("%.5f",(monrealCap/binf.getMoncapstd()*100)); |
| | | res.setMonprecentCap(monprecentCap); |
| | | if(monrealCap>=moncapStd*badValue){ |
| | | res.setMoncapperformance(Capperformance.getValue(Capperformance.BATTSTATE_1.getStateId())); |
| | | } |
| | | if (monrealCap <= moncapStd * damageValue) {//损坏的 |
| | | res.setMoncapperformance(Capperformance.getValue(Capperformance.BATTSTATE_3.getStateId())); |
| | | } |
| | | if((monrealCap>moncapStd*damageValue)&&(monrealCap<moncapStd*badValue)){ |
| | | res.setMoncapperformance(Capperformance.getValue(Capperformance.BATTSTATE_2.getStateId())); |
| | | } |
| | | if(stic.getPerformance()==null){ |
| | | reslist.add(res); |
| | | }else{ |
| | | if(res.getMoncapperformance().equals(Capperformance.getValue(stic.getPerformance()))){ |
| | | reslist.add(res); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | PageInfo pageInfo=PageInfoUtils.list2PageInfo(reslist, stic.getPageNum(), stic.getPageSize()); |
| | | return new Response().setII(1,reslist.size()>0,pageInfo,"蓄电池组对比分析界面(同一品牌同一时间)"); |
| | | } |
| | | //不存在放电记录则默认为实际预估容量全为0 |
| | | private void setSticCompare17Res( BattInf binf, List<SticCompare17Res> reslist,Integer performance) { |
| | | for (int i=0;i<binf.getMoncount();i++){ |
| | | SticCompare17Res res=new SticCompare17Res(); |
| | | res.setProvice(binf.getProvice()); |
| | | res.setCity(binf.getCity()); |
| | | res.setCountry(binf.getCountry()); |
| | | res.setStationName(binf.getStationName()); |
| | | res.setDevName(binf.getDevName()); |
| | | res.setBattgroupName(binf.getBattgroupName()); |
| | | res.setProduct(binf.getProduct()); |
| | | res.setInuseTime(binf.getInuseTime()); |
| | | res.setMonvolstd(binf.getMonvolstd()); |
| | | res.setStationId(binf.getStationId()); |
| | | res.setPowerId(binf.getPowerId()); |
| | | res.setDevId(binf.getDevId()); |
| | | res.setBattgroupId(binf.getBattgroupId()); |
| | | res.setMonNum(i+1); |
| | | res.setMonrealCap(0f); |
| | | res.setMonprecentCap("0"); |
| | | res.setMoncapperformance(Capperformance.getValue(Capperformance.BATTSTATE_4.getStateId())); |
| | | if(performance==null){ |
| | | reslist.add(res); |
| | | }else{ |
| | | if(res.getMoncapperformance().equals(Capperformance.getValue(performance))){ |
| | | reslist.add(res); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | //历史测试记录 |
| | | public Response getBattTinf(Integer battgroupId) { |
| | | Map<String, Object> map=new HashMap<>(); |
| | | List<TestDataDto> List1=new ArrayList<>(); |
| | | List<TestDataDto> List2=new ArrayList<>(); |
| | | List<TestDataDto> List3=new ArrayList<>(); |
| | | List<TestDataDto> List4=new ArrayList<>(); |
| | | List<TestDataDto> List5=new ArrayList<>(); |
| | | map.put("1",List1); //核容放电 |
| | | map.put("2",List2); //核容充电 |
| | | map.put("3",List3); //监测放电 |
| | | map.put("4",List4); //监测充电 |
| | | map.put("5",List5); //停电放电 |
| | | QueryWrapper wrapper=new QueryWrapper(); |
| | | wrapper.eq("battgroup_id",battgroupId); |
| | | wrapper.orderByDesc("test_starttime"); |
| | | List<BatttestdataInf> list=mapper.selectList(wrapper); |
| | | for (BatttestdataInf tinf:list) { |
| | | TestDataDto dto=new TestDataDto(); |
| | | dto.setTestStarttime(tinf.getTestStarttime()); |
| | | dto.setBattgroupId(tinf.getBattgroupId()); |
| | | dto.setTestRecordCount(tinf.getTestRecordCount()); |
| | | dto.setRecordNum(tinf.getRecordNum()); |
| | | dto.setTestCap(tinf.getTestCap()); |
| | | dto.setTestTimeLong(tinf.getTestTimelong()); |
| | | int hourRate = BattCapFactory.GetHourRate(tinf.getTestCap(), tinf.getTestCurr()); |
| | | Float realCap = (float) BattCapFactory.GetMonomerCap(tinf.getTestCap(), hourRate, tinf.getTestCap(), tinf.getMaxMonvol(), tinf.getMinMonvol(), tinf.getGroupVol(), BattCapFactory.CapType_Real); |
| | | dto.setRealCap(realCap); |
| | | //实时获取电池组信息 |
| | | BattRtstate battRtstate = rtstateService.getBattRealInfo(tinf.getBattgroupId()); |
| | | //获取电池组信息 |
| | | BattInf binf = battInfService.getBinfByBattgroupId(tinf.getBattgroupId()); |
| | | dto.setMoncapstd(binf.getMoncapstd()); |
| | | dto.setMonCount(binf.getMoncount()); |
| | | dto.setMonvolstd(binf.getMonvolstd()); |
| | | if(battRtstate!=null){ |
| | | Float restTime= BattCapFactory.getTheoryTime(battRtstate.getLoadCurr(), realCap, binf.getMoncapstd()); |
| | | dto.setRestTime(restTime); |
| | | dto.setFloatchartVol(battRtstate.getGroupVol()); |
| | | }else{ |
| | | dto.setRestTime(0f); |
| | | dto.setFloatchartVol(0f); |
| | | } |
| | | //找这次放电的指定一笔数据 |
| | | List<BatttestdataId> idDataList=battTestdataIdService.getLastDataByBattgroupId(tinf.getBattgroupId(),tinf.getTestRecordCount(),1); |
| | | if(idDataList!=null&&idDataList.size()>=0){ |
| | | BatttestdataId idData=idDataList.get(0); |
| | | dto.setOnlineVol(idData.getOnlineVol()); |
| | | dto.setGroupCurr(idData.getTestCurr()); |
| | | }else { |
| | | dto.setOnlineVol(0f); |
| | | dto.setGroupCurr(0f); |
| | | } |
| | | if (tinf.getTestType() == 3) { |
| | | // 测试类型为放电 |
| | | if (tinf.getTestStarttype() == 3) { |
| | | List1.add(dto); |
| | | } else if(tinf.getTestStarttype() == 4){ |
| | | List5.add(dto); |
| | | }else { |
| | | List3.add(dto); |
| | | } |
| | | } else if (tinf.getTestType() == 2) { |
| | | // 测试类型为充电 |
| | | if (tinf.getTestStarttype() == 3) { |
| | | List2.add(dto); |
| | | } else { |
| | | List4.add(dto); |
| | | } |
| | | } |
| | | } |
| | | return new Response().setII(1,true,map,"历史测试记录"); |
| | | } |
| | | //本年度已放电数量统计(1.2.5) |
| | | public Response getDischr5Statistic(DisChargeStic stic) { |
| | | Map<String, Object> map=new HashMap<>(); |
| | | //查询出所有的班组并赋予初始值 |
| | | setBanZuDefault(map); |
| | | //获取核容优劣,损坏参数 |
| | | List<AppParam> paramList=appParamService.getHrParam(); |
| | | Float badValue=0f; |
| | | Float damageValue=0f; |
| | | if(paramList!=null){ |
| | | for (AppParam param:paramList) { |
| | | if(param.getParamNamePsx().equals("batt_mon_deteriorate_val")){ |
| | | badValue=param.getParamValue(); |
| | | } |
| | | if(param.getParamNamePsx().equals("batt_mon_damage_val")){ |
| | | damageValue=param.getParamValue(); |
| | | } |
| | | |
| | | } |
| | | } |
| | | //1查询符合条件的电池组 |
| | | List<BattInf> binfList=battInfService.getDischr5Statistic(stic); |
| | | if(binfList==null||binfList.size()==0){ |
| | | return new Response().set(1,false,"当前用户未管理满足条件的电池组"); |
| | | } |
| | | List<SticDischarge5Res> reslist=new ArrayList<>(); |
| | | for (BattInf binf:binfList) { |
| | | //查询电池组所在的班组 |
| | | String groupName=bjService.getGroupName(binf.getPowerId()); |
| | | SticDischarge5Res res=new SticDischarge5Res(); |
| | | res.setProvice(binf.getProvice()); |
| | | res.setCity(binf.getCity()); |
| | | res.setCountry(binf.getCountry()); |
| | | res.setStationName(binf.getStationName()); |
| | | res.setBattgroupName(binf.getBattgroupName()); |
| | | //2.获取电池组在给定时间段的放电记录(指定时间段的标准核容放电) |
| | | BatttestdataInf tinf =getLastStandardTestDataByTime(binf.getBattgroupId(),stic.getTestStartTime(),stic.getTestEndTime()); |
| | | if(tinf==null){ |
| | | res.setRealCap(0f); |
| | | res.setTestStartTime(ThreadLocalUtil.parse("1972-01-01 00:00:00",1)); |
| | | res.setTestTimelong(0); |
| | | res.setTestCap(0f); |
| | | res.setStopReason(""); |
| | | res.setCapperformance(Capperformance.getValue(Capperformance.BATTSTATE_4.getStateId())); |
| | | res.setDisChargeType(2); |
| | | if(!groupName.equals("none")){ |
| | | BanZu bz= (BanZu) map.get(groupName); |
| | | int nochargeNum=bz.getNochargeNum(); |
| | | bz.setNochargeNum(nochargeNum+1); |
| | | map.put(groupName,bz); |
| | | } |
| | | continue; |
| | | } |
| | | if(!groupName.equals("none")){ |
| | | BanZu bz= (BanZu) map.get(groupName); |
| | | int dischargeNum=bz.getDischargeNum(); |
| | | bz.setDischargeNum(dischargeNum+1); |
| | | map.put(groupName,bz); |
| | | } |
| | | res.setTestStartTime(tinf.getTestStarttime()); |
| | | res.setTestTimelong(tinf.getTestTimelong()); |
| | | res.setTestCap(tinf.getTestCap()); |
| | | res.setStopReason(StopReasonEnum.getValue(tinf.getTestStoptype())); |
| | | Float moncapStd=binf.getMoncapstd(); |
| | | int hourRate = BattCapFactory.GetHourRate(tinf.getTestCap(), tinf.getTestCurr()); |
| | | Float grouprealCap = (float) BattCapFactory.GetMonomerCap(tinf.getTestCap(), hourRate, tinf.getTestCap(), tinf.getMaxMonvol(), tinf.getMinMonvol(), tinf.getGroupVol(), BattCapFactory.CapType_Real); |
| | | res.setRealCap(grouprealCap); |
| | | res.setDisChargeType(1); |
| | | if(grouprealCap>=moncapStd*badValue){ |
| | | res.setCapperformance(Capperformance.getValue(Capperformance.BATTSTATE_1.getStateId())); |
| | | } |
| | | if(grouprealCap<=moncapStd*damageValue){ |
| | | res.setCapperformance(Capperformance.getValue(Capperformance.BATTSTATE_3.getStateId())); |
| | | } |
| | | if((grouprealCap>moncapStd*damageValue)&&(grouprealCap<moncapStd*badValue)){ |
| | | res.setCapperformance(Capperformance.getValue(Capperformance.BATTSTATE_2.getStateId())); |
| | | } |
| | | if(stic.getDisChargeType()==null){ |
| | | reslist.add(res); |
| | | }else{ |
| | | if(res.getDisChargeType()==stic.getDisChargeType()){ |
| | | reslist.add(res); |
| | | } |
| | | } |
| | | } |
| | | PageInfo pageInfo=PageInfoUtils.list2PageInfo(reslist, stic.getPageNum(), stic.getPageSize()); |
| | | return new Response().setIII(1,reslist.size()>0,pageInfo,map,"本年度已放电数量统计"); |
| | | } |
| | | //查询出所有的班组并赋予初始值 |
| | | private void setBanZuDefault(Map<String, Object> map) { |
| | | List<Baojigroup> banZuList=bjService.getGroupList(); |
| | | for (Baojigroup bj:banZuList) { |
| | | BanZu bz=new BanZu(); |
| | | bz.setBaojiGroupId(bj.getBaojiGroupId()); |
| | | bz.setBaojiGroupName(bj.getBaojiGroupName()); |
| | | bz.setDischargeNum(0); |
| | | bz.setNochargeNum(0); |
| | | map.put(bj.getBaojiGroupName(),bz); |
| | | } |
| | | } |
| | | |
| | | //本年度未放电数量统计(1.2.6) |
| | | public Response getDischr6Statistic(DisChargeStic stic) { |
| | | Map<String, Object> map=new HashMap<>(); |
| | | //查询出所有的班组并赋予初始值 |
| | | setBanZuDefault(map); |
| | | |
| | | //1查询符合条件的电池组 |
| | | List<BattInf> binfList=battInfService.getDischr6Statistic(stic); |
| | | if(binfList==null||binfList.size()==0){ |
| | | return new Response().set(1,false,"当前用户未管理满足条件的电池组"); |
| | | } |
| | | List<SticDischarge6Res> reslist=new ArrayList<>(); |
| | | for (BattInf binf:binfList) { |
| | | //查询电池组所在的班组 |
| | | String groupName=bjService.getGroupName(binf.getPowerId()); |
| | | SticDischarge6Res res=new SticDischarge6Res(); |
| | | res.setProvice(binf.getProvice()); |
| | | res.setCity(binf.getCity()); |
| | | res.setCountry(binf.getCountry()); |
| | | res.setStationName(binf.getStationName()); |
| | | res.setBattgroupName(binf.getBattgroupName()); |
| | | res.setMoncapstd(binf.getMoncapstd()); |
| | | res.setMonvolstd(binf.getMonvolstd()); |
| | | res.setMoncount(binf.getMoncount()); |
| | | res.setProduct(binf.getProduct()); |
| | | //获取电池组未放电记录(指定时间段的标准核容放电) |
| | | getNoDischargeData(binf.getBattgroupId(),stic.getTestStartTime(),stic.getTestEndTime(),stic.getTypeList(),res); |
| | | //2.获取电池组在给定时间段的放电记录(指定时间段的标准核容放电) |
| | | BatttestdataInf tinf =getLastStandardTestDataByTime(binf.getBattgroupId(),stic.getTestStartTime(),stic.getTestEndTime()); |
| | | res.setTinf(tinf); |
| | | if(stic.getStopReasonType()==0){ |
| | | reslist.add(res); |
| | | }else { |
| | | if(res.getStopReasonType()==stic.getStopReasonType()){ |
| | | reslist.add(res); |
| | | } |
| | | } |
| | | if(tinf==null){ |
| | | if(!groupName.equals("none")){ |
| | | BanZu bz= (BanZu) map.get(groupName); |
| | | int nochargeNum=bz.getNochargeNum(); |
| | | bz.setNochargeNum(nochargeNum+1); |
| | | map.put(groupName,bz); |
| | | } |
| | | continue; |
| | | } |
| | | if(!groupName.equals("none")){ |
| | | BanZu bz= (BanZu) map.get(groupName); |
| | | int dischargeNum=bz.getDischargeNum(); |
| | | bz.setDischargeNum(dischargeNum+1); |
| | | map.put(groupName,bz); |
| | | } |
| | | } |
| | | PageInfo pageInfo=PageInfoUtils.list2PageInfo(reslist, stic.getPageNum(), stic.getPageSize()); |
| | | return new Response().setIII(1,reslist.size()>0,pageInfo,map,"本年度未放电数量统计"); |
| | | } |
| | | //2.获取电池组未放电记录(指定时间段的标准核容放电) |
| | | private void getNoDischargeData(Integer battgroupId, Date testStartTime, Date testEndTime, List<Integer> typeList, SticDischarge6Res res) { |
| | | List<BatttestdataInf> tinfList=mapper.getNoDischargeData(battgroupId,testStartTime,testEndTime,typeList); |
| | | List<String> stopList=new ArrayList<>(); |
| | | if(tinfList!=null&&tinfList.size()>0){ |
| | | res.setErrorNum(tinfList.size()); |
| | | res.setStopReasonType(1); |
| | | for (BatttestdataInf tinf:tinfList) { |
| | | String stopReason=StopReasonEnum.getValue(tinf.getTestStoptype()); |
| | | stopList.add(stopReason); |
| | | } |
| | | res.setStopList(stopList); |
| | | }else { |
| | | res.setErrorNum(0); |
| | | res.setStopList(new ArrayList<>()); |
| | | res.setStopReasonType(0); |
| | | } |
| | | } |
| | | //获取核容停止原因类型(下拉) |
| | | public Response getStopReasonType() { |
| | | Map<String,Map<Integer,String>> map= StopReasonEnum.getOpInfo(); |
| | | return new Response().setII(1,true,map,"获取核容停止原因类型(下拉)"); |
| | | } |
| | | //电池组电池性能统计(未放电,优秀,劣化,损坏)统计(1.2.8/9/10) |
| | | public Response getPerformanceStatistic(PerformanceStic stic) { |
| | | //获取核容优劣,损坏参数 |
| | | List<AppParam> paramList=appParamService.getHrParam(); |
| | | Float badValue=0f; |
| | | Float damageValue=0f; |
| | | if(paramList!=null){ |
| | | for (AppParam param:paramList) { |
| | | if(param.getParamNamePsx().equals("batt_mon_deteriorate_val")){ |
| | | badValue=param.getParamValue(); |
| | | } |
| | | if(param.getParamNamePsx().equals("batt_mon_damage_val")){ |
| | | damageValue=param.getParamValue(); |
| | | } |
| | | |
| | | } |
| | | } |
| | | //1查询符合条件的电池组 |
| | | List<BattInf> binfList=battInfService.getPerformanceStatistic(stic); |
| | | if(binfList==null||binfList.size()==0){ |
| | | return new Response().set(1,false,"当前用户未管理满足条件的电池组"); |
| | | } |
| | | List<PerformanceRes> reslist=new ArrayList<>(); |
| | | for (BattInf binf:binfList) { |
| | | PerformanceRes res=new PerformanceRes(); |
| | | res.setProvice(binf.getProvice()); |
| | | res.setCity(binf.getCity()); |
| | | res.setCountry(binf.getCountry()); |
| | | res.setStationName(binf.getStationName()); |
| | | res.setBattgroupName(binf.getBattgroupName()); |
| | | res.setProduct(binf.getProduct()); |
| | | res.setInuseYear(ActionUtil.getDateYear(new Date())-ActionUtil.getDateYear(binf.getInuseTime())); |
| | | res.setMonvolstd(binf.getMonvolstd()); |
| | | res.setMoncapstd(binf.getMoncapstd()); |
| | | res.setMoncount(binf.getMoncount()); |
| | | //2.获取电池组在给定时间段的放电记录(指定时间段的标准核容放电) |
| | | BatttestdataInf tinf =getLastStandardTestDataByTime(binf.getBattgroupId(),stic.getTestStartTime(),stic.getTestEndTime()); |
| | | if(stic.getPerformance()==null){ |
| | | reslist.add(res); |
| | | }else{ |
| | | if(res.getCapperformance().equals(Capperformance.getValue(stic.getPerformance()))){ |
| | | reslist.add(res); |
| | | } |
| | | } |
| | | if(tinf==null){ |
| | | res.setRealCap(0f); |
| | | res.setCapperformance(Capperformance.getValue(Capperformance.BATTSTATE_4.getStateId())); |
| | | continue; |
| | | } |
| | | //找这次放电的最后一笔数据 |
| | | List<BatttestdataId> idDataList=battTestdataIdService.getLastDataByBattgroupId(tinf.getBattgroupId(),tinf.getTestRecordCount(),tinf.getRecordNum()); |
| | | if(idDataList==null||idDataList.size()==0){ |
| | | res.setRealCap(0f); |
| | | res.setCapperformance(Capperformance.getValue(Capperformance.BATTSTATE_4.getStateId())); |
| | | continue; |
| | | } |
| | | Float moncapStd=binf.getMoncapstd(); |
| | | int hourRate = BattCapFactory.GetHourRate(tinf.getTestCap(), tinf.getTestCurr()); |
| | | Float grouprealCap = (float) BattCapFactory.GetMonomerCap(tinf.getTestCap(), hourRate, tinf.getTestCap(), tinf.getMaxMonvol(), tinf.getMinMonvol(), tinf.getGroupVol(), BattCapFactory.CapType_Real); |
| | | res.setRealCap(grouprealCap); |
| | | if(grouprealCap>=moncapStd*badValue){ |
| | | res.setCapperformance(Capperformance.getValue(Capperformance.BATTSTATE_1.getStateId())); |
| | | } |
| | | if(grouprealCap<=moncapStd*damageValue){ |
| | | res.setCapperformance(Capperformance.getValue(Capperformance.BATTSTATE_3.getStateId())); |
| | | } |
| | | if((grouprealCap>moncapStd*damageValue)&&(grouprealCap<moncapStd*badValue)){ |
| | | res.setCapperformance(Capperformance.getValue(Capperformance.BATTSTATE_2.getStateId())); |
| | | } |
| | | } |
| | | PageInfo pageInfo=PageInfoUtils.list2PageInfo(reslist, stic.getPageNum(), stic.getPageSize()); |
| | | return new Response().setII(1,reslist.size()>0,pageInfo,"电池组电池性能统计(未放电,优秀,劣化,损坏)统计(1.2.8/9/10)"); |
| | | } |
| | | } |
New file |
| | |
| | | package com.whyc.service; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; |
| | | import com.github.pagehelper.PageHelper; |
| | | import com.github.pagehelper.PageInfo; |
| | | import com.whyc.dto.Real.AlmDto; |
| | | import com.whyc.dto.Response; |
| | | import com.whyc.mapper.DevAlmparamMapper; |
| | | import com.whyc.pojo.db_param.BattAlmparam; |
| | | import com.whyc.pojo.db_param.DevAlmparam; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.web.bind.annotation.RequestParam; |
| | | |
| | | import java.util.List; |
| | | |
| | | @Service |
| | | public class DevAlmparamService { |
| | | @Autowired(required = false) |
| | | private DevAlmparamMapper mapper; |
| | | |
| | | //获取设备告警参数 |
| | | public Response getDevAlmParam(Integer almId,Integer pageNum, Integer pageSize) { |
| | | PageHelper.startPage(pageNum,pageSize); |
| | | QueryWrapper wrapper=new QueryWrapper(); |
| | | if(almId!=null){ |
| | | wrapper.eq("alm_id",almId); |
| | | } |
| | | wrapper.orderByAsc("alm_id"); |
| | | List<DevAlmparam> list=mapper.selectList(wrapper); |
| | | PageInfo pageInfo=new PageInfo(list); |
| | | return new Response().setII(1,list!=null,pageInfo,"获取设备告警参数"); |
| | | } |
| | | //修改设备告警参数 |
| | | public Response setDevAlmParam(List<DevAlmparam> almparamList) { |
| | | for (DevAlmparam param:almparamList) { |
| | | UpdateWrapper wrapper=new UpdateWrapper(); |
| | | wrapper.eq("alm_id",param.getAlmId()); |
| | | mapper.update(param,wrapper); |
| | | } |
| | | return new Response().set(1,true,"修改设备告警参数"); |
| | | } |
| | | } |
New file |
| | |
| | | package com.whyc.service; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; |
| | | import com.github.pagehelper.PageHelper; |
| | | import com.github.pagehelper.PageInfo; |
| | | import com.whyc.constant.BattAlarmIdEnum; |
| | | import com.whyc.constant.BattSingalIdEnum; |
| | | import com.whyc.constant.DevAlarmEnum; |
| | | import com.whyc.dto.Real.AlmDto; |
| | | import com.whyc.dto.Response; |
| | | import com.whyc.mapper.DevalarmDataMapper; |
| | | import com.whyc.pojo.db_alarm.DevalarmData; |
| | | import com.whyc.util.ActionUtil; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | @Service |
| | | public class DevalarmDataService { |
| | | @Autowired(required = false) |
| | | private DevalarmDataMapper mapper; |
| | | //获取设备实时告警信息 |
| | | public Response getDevAlmReal(AlmDto almDto) { |
| | | PageHelper.startPage(almDto.getPageNum(),almDto.getPageSize()); |
| | | List<DevalarmData> list=mapper.getDevAlmReal(almDto); |
| | | list.forEach(data->{ |
| | | data.setAlmName(DevAlarmEnum.getValue(data.getAlmId())); |
| | | }); |
| | | PageInfo pageInfo=new PageInfo(list); |
| | | return new Response().setII(1,list!=null,pageInfo,"获取设备实时告警信息"); |
| | | } |
| | | //确认设备告警 |
| | | public Response updateDevConfrim(Integer num) { |
| | | UpdateWrapper wrapper = new UpdateWrapper<>(); |
| | | wrapper.set("alm_is_confirmed",1); |
| | | wrapper.set("alm_confirmed_time",new SimpleDateFormat(ActionUtil.time_yyyyMMddHHmmss).format(new Date())); |
| | | // 通过num修改 |
| | | wrapper.eq("num",num); |
| | | int flag=mapper.update((DevalarmData) ActionUtil.objeNull,wrapper); |
| | | return new Response().set(1,flag>0,flag>0?"确认成功":"确认失败"); |
| | | } |
| | | //获取一级未处理实时告警数 |
| | | public Integer getDevAlmNum(Integer devId) { |
| | | QueryWrapper wrapper=new QueryWrapper(); |
| | | wrapper.eq("dev_id",devId); |
| | | wrapper.eq("alm_is_confirmed",0); |
| | | wrapper.eq("alm_level",1); |
| | | List<DevalarmData> list=mapper.selectList(wrapper); |
| | | return list!=null?list.size():0; |
| | | } |
| | | //获取设备告警类型(下拉) |
| | | public Response getDevAlmIdType() { |
| | | Map<Integer,String> map= DevAlarmEnum.getOpInfo(); |
| | | return new Response().setII(1,true,map,"获取设备告警类型(下拉)"); |
| | | } |
| | | } |
New file |
| | |
| | | package com.whyc.service; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; |
| | | import com.github.pagehelper.PageHelper; |
| | | import com.whyc.dto.CmdDto.DevCmd; |
| | | import com.whyc.dto.Response; |
| | | import com.whyc.mapper.DeviceSetparamMapper; |
| | | import com.whyc.pojo.db_ram_db.DeviceSetparam; |
| | | import com.whyc.util.ActionUtil; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | @Service |
| | | public class DeviceSetparamService { |
| | | @Autowired(required = false) |
| | | private DeviceSetparamMapper mapper; |
| | | //机房命令操作设备时的cmd和ack校验 test_type -->默认启动测试的类型 |
| | | public boolean sendCmdToDev(int cmd, int test_type, int dev_id, int battGroupNum) { |
| | | int cmd_ack = 0; |
| | | switch (cmd) { |
| | | case DevCmd.CMD_Start: |
| | | cmd_ack = DevCmd.CMD_StartAck; |
| | | break; |
| | | case DevCmd.CMD_Stop: |
| | | cmd_ack = DevCmd.CMD_StopAck; |
| | | break; |
| | | case DevCmd.CMD_SetDischargeParm: |
| | | cmd_ack = DevCmd.CMD_SetDischargeParmAck; |
| | | break; |
| | | case DevCmd.CMD_GetDischargeParm: |
| | | cmd_ack = DevCmd.CMD_GetDischargeParmAck; |
| | | break; |
| | | case DevCmd.CMD_StartDischarge: |
| | | cmd_ack = DevCmd.CMD_StartDischargeAck; |
| | | break; |
| | | case DevCmd.CMD_StopDischarge: |
| | | cmd_ack = DevCmd.CMD_StopDischargeAck; |
| | | break; |
| | | case DevCmd.CMD_ResetSystem: |
| | | cmd_ack = DevCmd.CMD_ResetSystemAck; |
| | | case DevCmd.CMD_StartResDischarge: |
| | | cmd_ack = DevCmd.CMD_StopResDischarge; |
| | | default: |
| | | return false; |
| | | } |
| | | UpdateWrapper updateWrapper=new UpdateWrapper(); |
| | | updateWrapper.set("op_cmd",cmd); |
| | | updateWrapper.set("battgroupnum",battGroupNum); |
| | | if(test_type > 0 && (cmd == DevCmd.CMD_Start||cmd == DevCmd.CMD_Stop)){ //启动测试时未点击设定参数按钮,会出现启动内阻测试bug修复 |
| | | updateWrapper.set("test_cmd",test_type); |
| | | } |
| | | updateWrapper.eq("dev_id",dev_id); |
| | | int flag=mapper.update((DeviceSetparam) ActionUtil.objeNull,updateWrapper); |
| | | boolean res_exe = false; |
| | | if(flag>0) |
| | | { |
| | | PageHelper.startPage(1,1); |
| | | QueryWrapper queryWrapper=new QueryWrapper(); |
| | | queryWrapper.eq("dev_id",dev_id); |
| | | for(int n=0; n<1; n++) |
| | | { |
| | | DeviceSetparam DeviceSetparam=mapper.selectOne(queryWrapper); |
| | | if(DeviceSetparam!=null){ |
| | | if(DeviceSetparam.getOpCmd()==cmd_ack){ |
| | | res_exe = true; |
| | | break; |
| | | } |
| | | try { |
| | | Thread.sleep(500); |
| | | } catch (InterruptedException e) { |
| | | // TODO Auto-generated catch block |
| | | e.printStackTrace(); |
| | | } |
| | | }else { |
| | | break; |
| | | } |
| | | } |
| | | } |
| | | return res_exe; |
| | | } |
| | | //设置放电参数 |
| | | public Response updateParam(DeviceSetparam param) { |
| | | Boolean b=mapper.updateParam(param); |
| | | boolean bl=false; |
| | | if(b){ |
| | | bl=sendCmdToDev(DevCmd.CMD_SetDischargeParm,0,param.getDevId(),param.getBattgroupnum()); |
| | | } |
| | | return new Response().set(1,bl,bl==true?"设置参数成功!":"设置参数失败,请检查网络!"); |
| | | } |
| | | //读取参数 |
| | | public Response getParam(int devId, int battGroupNum) { |
| | | PageHelper.startPage(1, 1); |
| | | QueryWrapper wrapper = new QueryWrapper(); |
| | | wrapper.eq("dev_id", devId); |
| | | boolean bl = sendCmdToDev(DevCmd.CMD_GetDischargeParm,0, devId, battGroupNum); |
| | | DeviceSetparam param = mapper.getParam(devId,battGroupNum); |
| | | return new Response().setII(1, bl, param, bl == true ? "读取参数成功!" : "读取放电参数,请检查网络!"); |
| | | } |
| | | //远程重启 |
| | | public Response restart(int devId, int battGroupNum) { |
| | | boolean bl = sendCmdToDev(DevCmd.CMD_ResetSystem,0, devId, battGroupNum); |
| | | return new Response().set(1,bl,bl==true?"设备远程重启成功!":"设备远程重启失败!"); |
| | | } |
| | | //远程核容 |
| | | public Response startDis(int devId, int battGroupNum) { |
| | | boolean bl = sendCmdToDev(DevCmd.CMD_Start,DevCmd.CMD_StartDischarge, devId, battGroupNum); |
| | | return new Response().set(1,bl,bl==true?"远程核容成功!":"远程核容失败!"); |
| | | } |
| | | //内阻测试 |
| | | public Response startRes(int devId, int battGroupNum) { |
| | | boolean bl = sendCmdToDev(DevCmd.CMD_Start,DevCmd.CMD_StartResDischarge, devId, battGroupNum); |
| | | return new Response().set(1,bl,bl==true?"启动内阻测试成功!":"启动内阻测试失败!"); |
| | | } |
| | | //停止内阻测试 |
| | | public Response stopRes(int devId, int battGroupNum) { |
| | | boolean bl = sendCmdToDev(DevCmd.CMD_Stop,DevCmd.CMD_StopDischarge, devId, battGroupNum); |
| | | return new Response().set(1,bl,bl==true?"停止内阻测试成功!":"停止内阻测试失败!"); |
| | | } |
| | | } |
New file |
| | |
| | | package com.whyc.service; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.github.pagehelper.PageHelper; |
| | | import com.github.pagehelper.PageInfo; |
| | | import com.whyc.constant.DevStateEnum; |
| | | import com.whyc.dto.Response; |
| | | import com.whyc.dto.Statistic.DeviceStateStic; |
| | | import com.whyc.mapper.DeviceStateMapper; |
| | | import com.whyc.pojo.db_ram_db.DeviceState; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | @Service |
| | | public class DeviceStateService { |
| | | @Autowired(required = false) |
| | | private DeviceStateMapper mapper; |
| | | //实时获取设备信息 |
| | | public DeviceState getDevRealInfo(Integer devId) { |
| | | QueryWrapper wrapper=new QueryWrapper(); |
| | | wrapper.eq("dev_id",devId); |
| | | wrapper.last("limit 1"); |
| | | DeviceState dev=mapper.selectOne(wrapper); |
| | | return dev; |
| | | } |
| | | //设备工作状态统计 |
| | | public Response getDeviceStateStatistic(DeviceStateStic stic) { |
| | | PageHelper.startPage(stic.getPageNum(),stic.getPageSize()); |
| | | List<DeviceState> list=mapper.getDeviceStateStatistic(stic); |
| | | PageInfo pageInfo=new PageInfo(list); |
| | | return new Response().setII(1,list.size()>0,pageInfo,"设备工作状态统计"); |
| | | } |
| | | //获取设备工作类型(下拉) |
| | | public Response getDevState() { |
| | | Map<Integer,String> map= DevStateEnum.getOpInfo(); |
| | | return new Response().setII(1,true,map,"获取设备工作类型(下拉)"); |
| | | } |
| | | } |
New file |
| | |
| | | package com.whyc.service; |
| | | |
| | | import com.whyc.dto.Statistic.MonStic; |
| | | import com.whyc.dto.Statistic.SticMonRes; |
| | | import com.whyc.pojo.db_user.User; |
| | | import com.whyc.util.ActionUtil; |
| | | import com.whyc.util.ServletUtils; |
| | | import org.apache.poi.hssf.usermodel.*; |
| | | import org.apache.poi.ss.formula.functions.T; |
| | | import org.apache.poi.ss.usermodel.ClientAnchor; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import sun.misc.BASE64Decoder; |
| | | |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.io.IOException; |
| | | import java.io.OutputStream; |
| | | import java.io.UnsupportedEncodingException; |
| | | import java.net.URLEncoder; |
| | | import java.text.ParseException; |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.ArrayList; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | @Service |
| | | public class ExportService { |
| | | |
| | | @Autowired |
| | | private BatttestdataInfService battTinfService; |
| | | |
| | | |
| | | //单节数量统计导出(1.2.14) |
| | | public void exportBattTinfStatistic(HttpServletRequest req, HttpServletResponse resp, MonStic stic) throws ParseException { |
| | | String topPic = stic.getTopPic(); //头部柱状图 |
| | | String goodVolPic = stic.getGoodVolPic(); //优秀电压图 |
| | | String goodResPic = stic.getGoodResPic(); //优秀内阻 |
| | | String badVolPic = stic.getBadVolPic(); //劣化电压图 |
| | | String badResPic = stic.getBadResPic(); //劣化内阻 |
| | | String damageVolPic = stic.getDamageVolPic(); //损坏电压图 |
| | | String damageResPic = stic.getDamageResPic(); //损坏内阻 |
| | | User uinf= ActionUtil.getUser(); |
| | | stic.setUid(uinf.getId()); |
| | | Map<String,Object> map= battTinfService.getMonStatistic(stic); |
| | | List<byte[]> bytes = new ArrayList<byte[]>(); |
| | | //处理图片 |
| | | try { |
| | | if (ServletUtils.isNotNull(topPic)) { |
| | | String[] url = topPic.split(","); |
| | | bytes.add(new BASE64Decoder().decodeBuffer(url[1])); |
| | | } |
| | | if (ServletUtils.isNotNull(goodVolPic)) { |
| | | String[] url = goodVolPic.split(","); |
| | | bytes.add(new BASE64Decoder().decodeBuffer(url[1])); |
| | | } |
| | | if (ServletUtils.isNotNull(goodResPic)) { |
| | | String[] url = goodResPic.split(","); |
| | | bytes.add(new BASE64Decoder().decodeBuffer(url[1])); |
| | | } |
| | | if (ServletUtils.isNotNull(badVolPic)) { |
| | | String[] url = badVolPic.split(","); |
| | | bytes.add(new BASE64Decoder().decodeBuffer(url[1])); |
| | | } |
| | | if (ServletUtils.isNotNull(badResPic)) { |
| | | String[] url = badResPic.split(","); |
| | | bytes.add(new BASE64Decoder().decodeBuffer(url[1])); |
| | | } |
| | | if (ServletUtils.isNotNull(damageVolPic)) { |
| | | String[] url = damageVolPic.split(","); |
| | | bytes.add(new BASE64Decoder().decodeBuffer(url[1])); |
| | | } |
| | | if (ServletUtils.isNotNull(damageResPic)) { |
| | | String[] url = damageResPic.split(","); |
| | | bytes.add(new BASE64Decoder().decodeBuffer(url[1])); |
| | | } |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | } |
| | | |
| | | //当前日期 |
| | | String nowFormat = new SimpleDateFormat("yyyyMMddHHmmss").format(new Date()); |
| | | String excelName = "单节数量统计-"+nowFormat; |
| | | |
| | | HSSFWorkbook wb = new HSSFWorkbook(); |
| | | //单体性能统计表 |
| | | createMonSicPic(wb, bytes); |
| | | List<SticMonRes> goodList=(List<SticMonRes>) map.get("goodlist"); |
| | | //创建优秀单体数据表 |
| | | createMonSicTable(wb, goodList,"优秀单体数据表"); |
| | | List<SticMonRes> badList=(List<SticMonRes>) map.get("badlist"); |
| | | //创建劣化单体数据表 |
| | | createMonSicTable(wb, badList,"劣化单体数据表"); |
| | | List<SticMonRes> damageList=(List<SticMonRes>) map.get("damagelist"); |
| | | //创建损坏单体数据表 |
| | | createMonSicTable(wb, damageList,"损坏单体数据表"); |
| | | |
| | | try { |
| | | // 转码防止乱码 |
| | | resp.setHeader("Content-Disposition", "attachment;filename=" + URLEncoder.encode ( excelName+".xlsx", "utf-8")); |
| | | OutputStream out = resp.getOutputStream(); |
| | | wb.write(out); |
| | | out.close(); |
| | | } catch (UnsupportedEncodingException e) { |
| | | e.printStackTrace(); |
| | | } catch (IOException e) { |
| | | e.printStackTrace(); |
| | | } |
| | | } |
| | | |
| | | //创建优秀/劣化/损坏单体数据表 |
| | | private void createMonSicTable(HSSFWorkbook wb, List<SticMonRes> list,String sheetName) { |
| | | HSSFSheet sheet = wb.createSheet(sheetName); |
| | | sheet.setDefaultColumnWidth(15); //设置默认列宽,实际上回多出2个字符,不知道为什么 |
| | | sheet.setDefaultRowHeight((short) (1 * 256));//设置默认行高,表示2个字符的高度 |
| | | int rownum = 1; |
| | | |
| | | String[] arrTh = new String[]{ |
| | | "机房名称","设备名称","电池组名称","单体编号","浮充电压(V)","单体内阻(mΩ)" |
| | | }; |
| | | sheet.createRow(rownum); |
| | | for(int i = 0 ;i<arrTh.length;i++){ |
| | | sheet.getRow(rownum).createCell(i+1).setCellValue(arrTh[i]); |
| | | } |
| | | rownum++; |
| | | if(list!=null&&list.size()>=0){ |
| | | for(SticMonRes res:list){ |
| | | sheet.createRow(rownum); |
| | | sheet.getRow(rownum).createCell(1).setCellValue(res.getStationName()); |
| | | sheet.getRow(rownum).createCell(2).setCellValue(res.getDevName()); |
| | | sheet.getRow(rownum).createCell(3).setCellValue(res.getBattgroupName()); |
| | | sheet.getRow(rownum).createCell(4).setCellValue(res.getMonNum()); |
| | | sheet.getRow(rownum).createCell(5).setCellValue(res.getMonVol()); |
| | | sheet.getRow(rownum).createCell(6).setCellValue(res.getMonRes()); |
| | | rownum++; |
| | | } |
| | | } |
| | | } |
| | | |
| | | //单体性能统计表 |
| | | private void createMonSicPic(HSSFWorkbook wb, List<byte[]> bytes) { |
| | | |
| | | HSSFSheet sheet = wb.createSheet("单体性能统计表"); |
| | | sheet.setDefaultColumnWidth(15); //设置默认列宽,实际上回多出2个字符,不知道为什么 |
| | | sheet.setDefaultRowHeight((short) (2 * 256)); //设置默认行高,表示2个字符的高度 |
| | | //字体格式-加粗 |
| | | HSSFCellStyle cellStyle = wb.createCellStyle(); |
| | | HSSFFont font = wb.createFont(); |
| | | font.setBold(true); |
| | | cellStyle.setFont(font); |
| | | |
| | | //图片元素 |
| | | HSSFPatriarch patriarch = sheet.createDrawingPatriarch(); |
| | | int rowNum = 1; |
| | | int rowNumAdd=25; |
| | | //插入图片 |
| | | int picNum = 0; |
| | | String[] picName = new String[]{ |
| | | "单体性能统计图", "优秀单体电压图", "优秀单体内阻图", "劣化单体电压图", "劣化单体内阻图", "损坏单体电压图", "损坏单体内阻图" |
| | | }; |
| | | for (int i = 0; i < picName.length; i++) { |
| | | sheet.createRow(rowNum - 1); |
| | | sheet.getRow(rowNum - 1).createCell(0).setCellValue(picName[i]); |
| | | HSSFClientAnchor anchor = new HSSFClientAnchor(0, 0, 512, 255, (short) 0, rowNum, (short) 10, rowNum + rowNumAdd); |
| | | anchor.setAnchorType(ClientAnchor.AnchorType.MOVE_DONT_RESIZE); |
| | | patriarch.createPicture(anchor, wb.addPicture(bytes.get(picNum), HSSFWorkbook.PICTURE_TYPE_PNG)).resize(1); |
| | | picNum++; |
| | | rowNum = rowNum+rowNumAdd+5; |
| | | } |
| | | } |
| | | } |
| | |
| | | import com.github.pagehelper.PageInfo; |
| | | import com.whyc.dto.PowerDto; |
| | | import com.whyc.dto.Response; |
| | | import com.whyc.dto.Statistic.StationStic; |
| | | import com.whyc.mapper.BaojigroupPowerMapper; |
| | | import com.whyc.mapper.BaojigroupUsrMapper; |
| | | import com.whyc.mapper.PowerInfMapper; |
| | | import com.whyc.mapper.StationInfMapper; |
| | | import com.whyc.pojo.db_station.BattInf; |
| | | import com.whyc.pojo.db_station.PowerInf; |
| | | import com.whyc.pojo.db_station.StationInf; |
| | | import com.whyc.pojo.db_user.BaojigroupPower; |
| | |
| | | List<String> list=mapper.getProtocolByUid(uid); |
| | | return new Response().setII(1,list.size()>0,list,"获取电源协议(下拉)"); |
| | | } |
| | | //获取电源信息 |
| | | public PowerInf getPowerInfById(Integer powerId) { |
| | | QueryWrapper wrapper=new QueryWrapper(); |
| | | wrapper.eq("power_id",powerId); |
| | | wrapper.last("limit 1"); |
| | | PowerInf pinf=mapper.selectOne(wrapper); |
| | | return pinf; |
| | | } |
| | | //电源信息统计 |
| | | public Response getPowerStatistic(StationStic stic) { |
| | | PageHelper.startPage(stic.getPageNum(),stic.getPageSize()); |
| | | List<PowerInf> list=mapper.getPowerStatistic(stic); |
| | | PageInfo<PowerInf> pageInfo=new PageInfo<>(list); |
| | | return new Response().setII(1,list.size()>0,pageInfo,"电源信息统计"); |
| | | } |
| | | } |
New file |
| | |
| | | package com.whyc.service; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.whyc.mapper.PwrdevAcdcdataMapper; |
| | | import com.whyc.pojo.db_ram_db.BattRtstate; |
| | | import com.whyc.pojo.db_ram_db.PwrdevAcdcdata; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | @Service |
| | | public class PwrdevAcdcdataService { |
| | | @Autowired(required = false) |
| | | private PwrdevAcdcdataMapper mapper; |
| | | //实时获取电源信息 |
| | | public PwrdevAcdcdata getPwrRealInfo(Integer powerId) { |
| | | QueryWrapper wrapper=new QueryWrapper(); |
| | | wrapper.eq("power_id",powerId); |
| | | wrapper.last("limit 1"); |
| | | PwrdevAcdcdata pwr=mapper.selectOne(wrapper); |
| | | return pwr; |
| | | } |
| | | } |
New file |
| | |
| | | package com.whyc.service; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; |
| | | import com.github.pagehelper.PageHelper; |
| | | import com.github.pagehelper.PageInfo; |
| | | import com.whyc.dto.Real.AlmDto; |
| | | import com.whyc.dto.Response; |
| | | import com.whyc.mapper.PwrdevAlarmParamMapper; |
| | | import com.whyc.pojo.db_param.BattAlmparam; |
| | | import com.whyc.pojo.db_pwrdev_alarm.PwrdevAlarmParam; |
| | | import com.whyc.util.ActionUtil; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | |
| | | import java.util.List; |
| | | |
| | | @Service |
| | | public class PwrdevAlarmParamService { |
| | | @Autowired(required = false) |
| | | private PwrdevAlarmParamMapper mapper; |
| | | |
| | | //获取电源告警参数 |
| | | public Response getPwrAlmParam(AlmDto almDto) { |
| | | PageHelper.startPage(almDto.getPageNum(),almDto.getPageSize()); |
| | | List<PwrdevAlarmParam> list = mapper.getPwrAlmParam(almDto); |
| | | PageInfo pageInfo=new PageInfo(list); |
| | | return new Response().setII(1,list!=null,pageInfo,"获取电源告警参数"); |
| | | } |
| | | //修改电源告警参数 |
| | | public Response setPwrAlmParam(List<PwrdevAlarmParam> almparamList) { |
| | | for (PwrdevAlarmParam param:almparamList) { |
| | | UpdateWrapper wrapper=new UpdateWrapper(); |
| | | wrapper.eq("power_id",param.getPowerId()); |
| | | wrapper.eq("alm_id",param.getAlmId()); |
| | | mapper.update(param,wrapper); |
| | | } |
| | | return new Response().set(1,true,"修改电源告警参数"); |
| | | } |
| | | } |
New file |
| | |
| | | package com.whyc.service; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; |
| | | import com.whyc.dto.Response; |
| | | import com.whyc.mapper.PwrdevAlarmParamStandMapper; |
| | | import com.whyc.pojo.db_pwrdev_alarm.PwrdevAlarmParamStand; |
| | | import com.whyc.util.ActionUtil; |
| | | import com.whyc.util.DateUtil; |
| | | import com.whyc.util.FileUtil; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | |
| | | import java.io.IOException; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | @Service |
| | | public class PwrdevAlarmParamStandService { |
| | | @Autowired(required = false) |
| | | private PwrdevAlarmParamStandMapper mapper; |
| | | //查询标准参数 |
| | | public Response getPwrStandParam(Integer powerType) { |
| | | QueryWrapper queryWrapper = new QueryWrapper(); |
| | | queryWrapper.eq("power_type",powerType); |
| | | queryWrapper.orderByAsc("num"); |
| | | List<PwrdevAlarmParamStand> list=mapper.selectList(queryWrapper); |
| | | return new Response().setII(1,list!=null,list,"查询标准参数"); |
| | | } |
| | | //查询规范文件 |
| | | public Response getStandFile(Integer powerType, String fileName) { |
| | | QueryWrapper queryWrapper = new QueryWrapper(); |
| | | queryWrapper.select("file_name","stand_file_path"); |
| | | queryWrapper.eq("power_type",powerType); |
| | | queryWrapper.like("file_name",fileName); |
| | | List<PwrdevAlarmParamStand> list=mapper.selectList(queryWrapper); |
| | | return new Response().setII(1,list!=null,list,"查询规范文件"); |
| | | } |
| | | //设置标准参数 |
| | | public Response setPwrStandParam(PwrdevAlarmParamStand stand) { |
| | | UpdateWrapper wrapper=new UpdateWrapper(); |
| | | if(stand.getAlarmLimith()!=null){ |
| | | wrapper.set("alarm_limith",stand.getAlarmLimith()); |
| | | } |
| | | if(stand.getAlarmLimitl()!=null){ |
| | | wrapper.set("alarm_limitl",stand.getAlarmLimitl()); |
| | | } |
| | | if(stand.getAlarmLimithUpeper()!=null){ |
| | | wrapper.set("alarm_limith_upeper",stand.getAlarmLimithUpeper()); |
| | | } |
| | | if(stand.getAlarmLimitlLower()!=null){ |
| | | wrapper.set("alarm_limitl_lower",stand.getAlarmLimitlLower()); |
| | | } |
| | | if(stand.getBasisVal()!=null){ |
| | | wrapper.set("basis_val",stand.getBasisVal()); |
| | | } |
| | | wrapper.eq("num",stand.getNum()); |
| | | int flag=mapper.update((PwrdevAlarmParamStand) ActionUtil.objeNull,wrapper); |
| | | return new Response().set(1,flag>0,flag>0?"设置成功":"设置失败"); |
| | | } |
| | | //上传规范文件 |
| | | public Response uploadStandFile(MultipartFile multipartFile, String num) throws IOException { |
| | | Date now = new Date(); |
| | | String originalFilename = multipartFile.getOriginalFilename(); |
| | | String[] fileNameSplit = originalFilename.split("\\."); |
| | | String dateFormat = DateUtil.YYYY_MM_DD_HH_MM_SS_UNION.format(now); |
| | | String newFileName = fileNameSplit[0]+"_"+dateFormat+"."+fileNameSplit[1]; |
| | | String fileUrlTemp = FileUtil.saveFile(multipartFile,"/stand/"+newFileName); |
| | | UpdateWrapper wrapper=new UpdateWrapper(); |
| | | wrapper.set("stand_file_path",fileUrlTemp); |
| | | wrapper.set("file_name",newFileName); |
| | | wrapper.eq("num",num); |
| | | int flag=mapper.update((PwrdevAlarmParamStand) ActionUtil.objeNull,wrapper); |
| | | return new Response().set(1,flag>0,flag>0?"上传成功":"上传失败"); |
| | | } |
| | | //添加标准参数 |
| | | public Response addPwrStandParam(PwrdevAlarmParamStand stand) { |
| | | int flag=mapper.insert(stand); |
| | | return new Response().set(1,flag>0,flag>0?"添加成功":"添加失败"); |
| | | } |
| | | } |
New file |
| | |
| | | package com.whyc.service; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; |
| | | import com.github.pagehelper.PageHelper; |
| | | import com.github.pagehelper.PageInfo; |
| | | import com.whyc.constant.DevAlarmEnum; |
| | | import com.whyc.constant.PowerAlarmEnum; |
| | | import com.whyc.dto.Real.AlmDto; |
| | | import com.whyc.dto.Response; |
| | | import com.whyc.mapper.PwrdevAlarmMapper; |
| | | import com.whyc.pojo.db_alarm.DevalarmData; |
| | | import com.whyc.pojo.db_pwrdev_alarm.PwrdevAlarm; |
| | | import com.whyc.util.ActionUtil; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | @Service |
| | | public class PwrdevAlarmService { |
| | | @Autowired(required = false) |
| | | private PwrdevAlarmMapper mapper; |
| | | //获取电源实时告警信息 |
| | | public Response getPwrAlmReal(AlmDto almDto) { |
| | | PageHelper.startPage(almDto.getPageNum(),almDto.getPageSize()); |
| | | List<PwrdevAlarm> list=mapper.getPwrAlmReal(almDto); |
| | | list.forEach(data->{ |
| | | data.setAlmName(PowerAlarmEnum.getValue(data.getAlmId())); |
| | | }); |
| | | PageInfo pageInfo=new PageInfo(list); |
| | | return new Response().setII(1,list!=null,pageInfo,"获取电源实时告警信息"); |
| | | } |
| | | //确认电源告警 |
| | | public Response updatePwrConfrim(Integer num) { |
| | | UpdateWrapper wrapper = new UpdateWrapper<>(); |
| | | wrapper.set("alm_is_confirmed",1); |
| | | wrapper.set("alm_confirmed_time",new SimpleDateFormat(ActionUtil.time_yyyyMMddHHmmss).format(new Date())); |
| | | // 通过num修改 |
| | | wrapper.eq("num",num); |
| | | int flag=mapper.update((PwrdevAlarm) ActionUtil.objeNull,wrapper); |
| | | return new Response().set(1,flag>0,flag>0?"确认成功":"确认失败"); |
| | | } |
| | | //获取一级未处理实时告警数 |
| | | public Integer getPwrAlmNum(Integer powerId) { |
| | | QueryWrapper wrapper=new QueryWrapper(); |
| | | wrapper.eq("power_id",powerId); |
| | | wrapper.eq("alm_is_confirmed",0); |
| | | wrapper.eq("alm_level",1); |
| | | List<DevalarmData> list=mapper.selectList(wrapper); |
| | | return list!=null?list.size():0; |
| | | } |
| | | //获取电源告警类型(下拉) |
| | | public Response getPwrAlmIdType() { |
| | | Map<String,Map<Integer,String>> map= PowerAlarmEnum.getOpInfo(); |
| | | return new Response().setII(1,true,map,"获取电源告警类型(下拉)"); |
| | | } |
| | | } |
New file |
| | |
| | | package com.whyc.service; |
| | | |
| | | import com.whyc.dto.Real.PwrHisRealAcInDto; |
| | | import com.whyc.dto.Real.PwrHisRealDcoutInDto; |
| | | import com.whyc.dto.Response; |
| | | import com.whyc.mapper.CommonMapper; |
| | | import com.whyc.pojo.db_data_history.BattRealdataId; |
| | | import com.whyc.pojo.db_data_history.PwrdevHistorydataId; |
| | | import com.whyc.pojo.db_station.PowerInf; |
| | | import com.whyc.util.ActionUtil; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.time.LocalDateTime; |
| | | import java.time.format.DateTimeFormatter; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | @Service |
| | | public class PwrdevHistorydataIdService { |
| | | @Autowired |
| | | private SubTablePageInfoService subTablePageInfoService; |
| | | @Resource |
| | | private CommonMapper commonMapper; |
| | | |
| | | @Autowired |
| | | private PowerInfService powerInfService; |
| | | |
| | | //系统概览获取半小时交流输入统计 |
| | | public Response getHalfHourPwrHisAcinData(Integer powerId,Integer granularity) { |
| | | String dateTime = ActionUtil.sdfwithOutday.format(new Date()); |
| | | //获取前半个小时数据 |
| | | LocalDateTime now = LocalDateTime.now(); |
| | | // 计算半小时前的时间点 |
| | | LocalDateTime halfHourAgo = now.minusMinutes(30); |
| | | // 格式化输出 |
| | | DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"); |
| | | String halfHourAgoTime=halfHourAgo.format(formatter); |
| | | String tableName ="db_data_history.tb_pwrdev_historydata_"+powerId+"_"+dateTime; |
| | | String existTableName = commonMapper.existTable("db_data_history", "tb_pwrdev_historydata_"+powerId+"_"+dateTime); |
| | | if(existTableName == null){ |
| | | return new Response().set(1,false,"当前电池组不存在前面小时数据"); |
| | | } |
| | | List<PwrHisRealAcInDto> datalist=subTablePageInfoService.getHalfHourPwrHisAcinData(tableName,granularity,halfHourAgoTime); |
| | | return new Response().setII(1,datalist.size()>0,datalist,"获取半小时内交流输入统计"); |
| | | |
| | | } |
| | | //系统概览获取半小时直流输出统计 |
| | | public Response getHalfHourPwrHisDcoutData(Integer powerId,Integer granularity) { |
| | | String dateTime = ActionUtil.sdfwithOutday.format(new Date()); |
| | | //获取前半个小时数据 |
| | | LocalDateTime now = LocalDateTime.now(); |
| | | // 计算半小时前的时间点 |
| | | LocalDateTime halfHourAgo = now.minusMinutes(30); |
| | | // 格式化输出 |
| | | DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"); |
| | | String halfHourAgoTime=halfHourAgo.format(formatter); |
| | | |
| | | String tableName ="db_data_history.tb_pwrdev_historydata_"+powerId+"_"+dateTime; |
| | | String existTableName = commonMapper.existTable("db_data_history", "tb_pwrdev_historydata_"+powerId+"_"+dateTime); |
| | | if(existTableName == null){ |
| | | return new Response().set(1,false,"当前电源不存在前面小时数据"); |
| | | } |
| | | List<PwrHisRealDcoutInDto> datalist=subTablePageInfoService.getHalfHourPwrHisDcoutData(tableName,granularity,halfHourAgoTime); |
| | | Long modelCfg=0l; |
| | | PowerInf pinf=powerInfService.getPowerInfById(powerId); |
| | | if(pinf!=null){ |
| | | modelCfg=pinf.getModelCfg(); |
| | | } |
| | | return new Response().setIII(1,datalist.size()>0,datalist,modelCfg,"获取半小时内直流输出统计"); |
| | | } |
| | | } |
| | |
| | | import com.github.pagehelper.PageInfo; |
| | | import com.whyc.dto.Response; |
| | | import com.whyc.dto.Station.Provice; |
| | | import com.whyc.dto.Statistic.StationStic; |
| | | import com.whyc.mapper.StationInfMapper; |
| | | import com.whyc.pojo.db_station.PowerInf; |
| | | import com.whyc.pojo.db_station.StationInf; |
| | |
| | | return mapper.selectList(query); |
| | | |
| | | } |
| | | //站点信息统计 |
| | | public Response getStationStatistic(StationStic stic) { |
| | | PageHelper.startPage(stic.getPageNum(),stic.getPageSize()); |
| | | List<StationInf> list=mapper.getStationStatistic(stic); |
| | | PageInfo<StationInf> pageInfo=new PageInfo<>(list); |
| | | return new Response().setII(1,list.size()>0,pageInfo,"站点信息统计"); |
| | | } |
| | | //获取机房信息 |
| | | public StationInf getStationInfById(Integer stationId) { |
| | | QueryWrapper wrapper=new QueryWrapper(); |
| | | wrapper.eq("station_id",stationId); |
| | | wrapper.last("limit 1"); |
| | | StationInf sinf=mapper.selectOne(wrapper); |
| | | return sinf; |
| | | } |
| | | } |
| | |
| | | //package com.whyc.service; |
| | | // |
| | | //import com.whyc.dto.DevA200AlarmDto; |
| | | //import com.whyc.mapper.CallBack; |
| | | //import com.whyc.pojo.db_alarm.DevLithiumAlarmDataYear; |
| | | //import com.whyc.pojo.db_lithium_testdata.BattLithiumTestData; |
| | | //import com.whyc.util.ThreadLocalUtil; |
| | | //import org.springframework.beans.factory.annotation.Autowired; |
| | | //import org.springframework.stereotype.Service; |
| | | // |
| | | //import java.sql.ResultSet; |
| | | //import java.sql.SQLException; |
| | | //import java.util.ArrayList; |
| | | //import java.util.LinkedList; |
| | | //import java.util.List; |
| | | // |
| | | //@Service |
| | | //public class SubTablePageInfoService { |
| | | // @Autowired |
| | | // private MybatisSqlExecuteService sqlExecuteService; |
| | | // //获取设备某次记录详细的单体放电过程 |
| | | // public List<BattLithiumTestData> getTdataById(Integer devId, Integer testRecordCount) { |
| | | // String sql="select * from db_batt_testdata.tb_batttestdata_" +devId |
| | | // +" where need_test=1 and test_record_count="+testRecordCount+" "; |
| | | // sql+=" ORDER BY record_num asc "; |
| | | // List list = sqlExecuteService.executeQuery_call(sql, new CallBack() { |
| | | // @Override |
| | | // public List getResults(ResultSet rs) throws SQLException { |
| | | // List<BattLithiumTestData> list=new ArrayList<>(); |
| | | // while (rs.next()){ |
| | | // BattLithiumTestData tdata=new BattLithiumTestData(); |
| | | // tdata.setNum(rs.getInt("num")); |
| | | // tdata.setDevId(rs.getInt("dev_id")); |
| | | // tdata.setBattIdx(rs.getInt("batt_idx")); |
| | | // tdata.setTestRecordCount(rs.getInt("test_record_count")); |
| | | // tdata.setTestType(rs.getInt("test_type")); |
| | | // tdata.setRecordNum(rs.getInt("record_num")); |
| | | // tdata.setTestStarttime(rs.getTimestamp("test_starttime")); |
| | | // tdata.setRecordTime(rs.getTimestamp("record_time")); |
| | | // tdata.setTestTimelong(rs.getInt("test_timelong")); |
| | | // tdata.setGroupVol(rs.getDouble("group_vol")); |
| | | // tdata.setTestCurr(rs.getDouble("test_curr")); |
| | | // tdata.setTestCap(rs.getDouble("test_cap")); |
| | | // tdata.setMonNum(rs.getInt("mon_num")); |
| | | // tdata.setMonVol(rs.getDouble("mon_vol")); |
| | | // tdata.setMonTmp(rs.getDouble("mon_tmp")); |
| | | // tdata.setMonCurr(rs.getDouble("mon_curr")); |
| | | // tdata.setMonCap(rs.getDouble("mon_cap")); |
| | | // tdata.setMonWh(rs.getDouble("mon_wh")); |
| | | // tdata.setMonState(rs.getString("mon_state")); |
| | | // tdata.setMonFault(rs.getString("mon_fault")); |
| | | // tdata.setNeedTest(rs.getInt("need_test")); |
| | | // list.add(tdata); |
| | | // } |
| | | // return list; |
| | | // } |
| | | // }); |
| | | // return list; |
| | | // } |
| | | // |
| | | // //获取设备某次记录详细的单体放电过程 |
| | | // public List<BattLithiumTestData> getTdataByIdWithListA200(Integer devId, Integer testRecordCount) { |
| | | // String sql="select * from db_lithium_testdata.tb_batttestdata_" +devId |
| | | // +" where need_test=1 and test_record_count="+testRecordCount+" "; |
| | | // sql+=" ORDER BY record_num asc "; |
| | | // List list = sqlExecuteService.executeQuery_call(sql, new CallBack() { |
| | | // @Override |
| | | // public List getResults(ResultSet rs) throws SQLException { |
| | | // List list=new ArrayList<>(); |
| | | // List<Float> monVols=null; |
| | | // List<Integer> monNums=null; |
| | | // BattLithiumTestData tdata=null; |
| | | // int num=0; |
| | | // try { |
| | | // while (rs.next()){ |
| | | // int monNum=rs.getInt("mon_num"); |
| | | // float monvol=rs.getFloat("mon_vol"); |
| | | // int recordNum=rs.getInt("record_num"); |
| | | // if(num!=recordNum){ |
| | | // if(num!=0){ |
| | | // tdata.setMonVols(monVols); |
| | | // tdata.setMonNums(monNums); |
| | | // list.add(tdata); |
| | | // } |
| | | // tdata=new BattLithiumTestData(); |
| | | // monVols=new ArrayList<>(); |
| | | // monNums=new ArrayList<>(); |
| | | // tdata.setDevId(rs.getInt("dev_id")); |
| | | // tdata.setBattIdx(rs.getInt("batt_idx")); |
| | | // tdata.setTestRecordCount(rs.getInt("test_record_count")); |
| | | // tdata.setTestType(rs.getInt("test_type")); |
| | | // tdata.setRecordNum(recordNum); |
| | | // tdata.setTestStarttime(rs.getTimestamp("test_starttime")); |
| | | // tdata.setRecordTime(rs.getTimestamp("record_time")); |
| | | // tdata.setTestTimelong(rs.getInt("test_timelong")); |
| | | // tdata.setGroupVol(rs.getDouble("group_vol")); |
| | | // tdata.setTestCurr(rs.getDouble("test_curr")); |
| | | // tdata.setTestCap(rs.getDouble("test_cap")); |
| | | // tdata.setNeedTest(rs.getInt("need_test")); |
| | | // tdata.setMaxTemp(rs.getFloat("max_temp")); |
| | | // tdata.setMinTemp(rs.getFloat("min_temp")); |
| | | // num=recordNum; |
| | | // } |
| | | // monVols.add(monvol); |
| | | // monNums.add(monNum); |
| | | // } |
| | | // tdata.setMonVols(monVols); |
| | | // tdata.setMonNums(monNums); |
| | | // list.add(tdata); |
| | | // } catch (SQLException e) { |
| | | // e.printStackTrace(); |
| | | // } |
| | | // return list; |
| | | // } |
| | | // }); |
| | | // return list; |
| | | // } |
| | | // //查询DevAlm历史告警数量 |
| | | // public int getCountForDevAlm(DevA200AlarmDto dto) { |
| | | // String sql="select count(distinct num) as number from db_alarm." +dto.getTableName() |
| | | // +" where 1=1 "; |
| | | // |
| | | // if(dto.getStartTime()!=null){ |
| | | // sql+=" and alm_starttime >='"+ ThreadLocalUtil.format(dto.getStartTime(),1)+"' "; |
| | | // } |
| | | // if(dto.getEndTime()!=null){ |
| | | // sql+=" and alm_endtime <='"+ThreadLocalUtil.format(dto.getEndTime(),1)+"' "; |
| | | // } |
| | | // if(dto.getDevType()!=null){ |
| | | // sql+=" and FLOOR(dev_id/100000000)="+dto.getDevType(); |
| | | // } |
| | | // if(dto.getDevId()!=null){ |
| | | // sql+=" and dev_id="+dto.getDevId(); |
| | | // } |
| | | // if(dto.getAlmId()!=null){ |
| | | // sql+=" and alm_id="+dto.getAlmId(); |
| | | // } |
| | | // sql+=" and dev_id in (" + |
| | | // " SELECT distinct dev_id from db_user.tb_battgroup_baojigroup,db_user.tb_battgroup_usr" + |
| | | // " where tb_battgroup_baojigroup.baoji_group_id=tb_battgroup_usr.baoji_group_id" + |
| | | // " and uid="+dto.getUid()+ |
| | | // ")"; |
| | | // sql+=" order by alm_starttime desc "; |
| | | // List list = sqlExecuteService.executeQuery_call(sql, new CallBack() { |
| | | // @Override |
| | | // public List getResults(ResultSet rs) throws SQLException { |
| | | // LinkedList<Object> temp = new LinkedList<>(); |
| | | // try { |
| | | // while (rs.next()) |
| | | // temp.add(rs.getInt("number")); |
| | | // } catch (SQLException e) { |
| | | // e.printStackTrace(); |
| | | // } |
| | | // return temp; |
| | | // } |
| | | // }); |
| | | // int num =0; |
| | | // if(list!=null){ |
| | | // num= (int) list.get(0); |
| | | // } |
| | | // return num; |
| | | // } |
| | | // //查询devalm历史告警 |
| | | // public List getListDevAlm(DevA200AlarmDto dto){ |
| | | // String sql="select * from db_alarm." +dto.getTableName() |
| | | // +" where 1=1 "; |
| | | // |
| | | // if(dto.getStartTime()!=null){ |
| | | // sql+=" and alm_starttime >='"+ ThreadLocalUtil.format(dto.getStartTime(),1)+"' "; |
| | | // } |
| | | // if(dto.getEndTime()!=null){ |
| | | // sql+=" and alm_endtime <='"+ThreadLocalUtil.format(dto.getEndTime(),1)+"' "; |
| | | // } |
| | | // if(dto.getDevType()!=null){ |
| | | // sql+=" and FLOOR(dev_id/100000000)="+dto.getDevType(); |
| | | // } |
| | | // if(dto.getDevId()!=null){ |
| | | // sql+=" and dev_id="+dto.getDevId(); |
| | | // } |
| | | // if(dto.getAlmId()!=null){ |
| | | // sql+=" and alm_id="+dto.getAlmId(); |
| | | // } |
| | | // sql+=" and dev_id in (" + |
| | | // " SELECT distinct dev_id from db_user.tb_battgroup_baojigroup,db_user.tb_battgroup_usr" + |
| | | // " where tb_battgroup_baojigroup.baoji_group_id=tb_battgroup_usr.baoji_group_id" + |
| | | // " and uid="+dto.getUid()+ |
| | | // ")"; |
| | | // sql+=" ORDER BY alm_starttime desc limit "+dto.getLimitStart()+","+dto.getLimitEnd()+" "; |
| | | // List list = sqlExecuteService.executeQuery_call(sql, new CallBack() { |
| | | // @Override |
| | | // public List getResults(ResultSet rs) throws SQLException { |
| | | // List<DevLithiumAlarmDataYear> list=new ArrayList<>(); |
| | | // while (rs.next()){ |
| | | // DevLithiumAlarmDataYear dataYear=new DevLithiumAlarmDataYear(); |
| | | // dataYear.setNum(rs.getInt("num")); |
| | | // dataYear.setDevId(rs.getInt("dev_id")); |
| | | // dataYear.setAlmId(rs.getInt("alm_id")); |
| | | // dataYear.setAlmSignalId(rs.getInt("alm_signal_id")); |
| | | // dataYear.setAlmStarttime(rs.getTimestamp("alm_starttime")); |
| | | // dataYear.setAlmValue(rs.getFloat("alm_value")); |
| | | // dataYear.setAlmIsConfirmed(rs.getInt("alm_is_confirmed")); |
| | | // dataYear.setConfirmedUid(rs.getInt("confirmed_uid")); |
| | | // dataYear.setConfirmedTime(rs.getTimestamp("confirmed_time")); |
| | | // dataYear.setAlmEndtime(rs.getTimestamp("alm_endtime")); |
| | | // dataYear.setAlmClearedType(rs.getInt("alm_cleared_type")); |
| | | // list.add(dataYear); |
| | | // } |
| | | // return list; |
| | | // } |
| | | // }); |
| | | // return list; |
| | | // } |
| | | // |
| | | // |
| | | // public List<BattLithiumTestData> getTdataByIdWithListActm(Integer devId, Integer testRecordCount) { |
| | | // String sql="select * from db_batt_testdata.tb_batttestdata_" +devId |
| | | // +" where need_test=1 and test_record_count="+testRecordCount+" "; |
| | | // sql+=" ORDER BY record_num asc "; |
| | | // List list = sqlExecuteService.executeQuery_call(sql, new CallBack() { |
| | | // @Override |
| | | // public List getResults(ResultSet rs) throws SQLException { |
| | | // List list=new ArrayList<>(); |
| | | // List<Float> monVols=null; |
| | | // List<Float> monCurrs=null; |
| | | // List<Float> monCaps=null; |
| | | // List<Float> monWhs=null; |
| | | // List<Integer> monNums=null; |
| | | // BattLithiumTestData tdata=null; |
| | | // int num=0; |
| | | // try { |
| | | // while (rs.next()){ |
| | | // int monNum=rs.getInt("mon_num"); |
| | | // float monvol=rs.getFloat("mon_vol"); |
| | | // float monCurr=rs.getFloat("mon_curr"); |
| | | // float monCap=rs.getFloat("mon_cap"); |
| | | // float monWh=rs.getFloat("mon_wh"); |
| | | // int recordNum=rs.getInt("record_num"); |
| | | // |
| | | // if(num!=recordNum){ |
| | | // if(num!=0){ |
| | | // tdata.setMonVols(monVols); |
| | | // tdata.setMonNums(monNums); |
| | | // tdata.setMonCurrs(monCurrs); |
| | | // tdata.setMonCaps(monCaps); |
| | | // tdata.setMonWhs(monWhs); |
| | | // list.add(tdata); |
| | | // } |
| | | // tdata=new BattLithiumTestData(); |
| | | // monVols=new ArrayList<>(); |
| | | // monNums=new ArrayList<>(); |
| | | // monCurrs=new ArrayList<>(); |
| | | // monCaps=new ArrayList<>(); |
| | | // monWhs=new ArrayList<>(); |
| | | // tdata.setDevId(rs.getInt("dev_id")); |
| | | // tdata.setBattIdx(rs.getInt("batt_idx")); |
| | | // tdata.setTestRecordCount(rs.getInt("test_record_count")); |
| | | // tdata.setTestType(rs.getInt("test_type")); |
| | | // tdata.setRecordNum(recordNum); |
| | | // tdata.setTestStarttime(rs.getTimestamp("test_starttime")); |
| | | // tdata.setRecordTime(rs.getTimestamp("record_time")); |
| | | // tdata.setTestTimelong(rs.getInt("test_timelong")); |
| | | // tdata.setGroupVol(rs.getDouble("group_vol")); |
| | | // tdata.setTestCurr(rs.getDouble("test_curr")); |
| | | // tdata.setTestCap(rs.getDouble("test_cap")); |
| | | // tdata.setNeedTest(rs.getInt("need_test")); |
| | | // tdata.setMonTmp(rs.getDouble("mon_tmp")); |
| | | // num=recordNum; |
| | | // } |
| | | // monVols.add(monvol); |
| | | // monNums.add(monNum); |
| | | // monCurrs.add(monCurr); |
| | | // monCaps.add(monCap); |
| | | // monWhs.add(monWh); |
| | | // } |
| | | // |
| | | // tdata.setMonVols(monVols); |
| | | // tdata.setMonNums(monNums); |
| | | // tdata.setMonCurrs(monCurrs); |
| | | // tdata.setMonCaps(monCaps); |
| | | // tdata.setMonWhs(monWhs); |
| | | // list.add(tdata); |
| | | // } catch (SQLException e) { |
| | | // e.printStackTrace(); |
| | | // } |
| | | // return list; |
| | | // } |
| | | // }); |
| | | // return list; |
| | | // } |
| | | //} |
| | | package com.whyc.service; |
| | | |
| | | import com.whyc.dto.AlmHis.BattAlmPar; |
| | | import com.whyc.dto.AlmHis.DevAlmPar; |
| | | import com.whyc.dto.AlmHis.PwrAlmPar; |
| | | import com.whyc.dto.Real.*; |
| | | import com.whyc.mapper.CallBack; |
| | | import com.whyc.pojo.db_alarm.BattalarmDataHistory; |
| | | import com.whyc.pojo.db_alarm.DevalarmDataHistory; |
| | | import com.whyc.pojo.db_batt_testdata.BatttestdataId; |
| | | import com.whyc.pojo.db_data_history.BattRealdataId; |
| | | import com.whyc.pojo.db_data_history.PwrdevHistorydataId; |
| | | import com.whyc.pojo.db_pwrdev_alarm.PwrdevAlarmHistory; |
| | | import com.whyc.util.ThreadLocalUtil; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.sql.ResultSet; |
| | | import java.sql.SQLException; |
| | | import java.util.*; |
| | | |
| | | @Service |
| | | public class SubTablePageInfoService { |
| | | @Autowired |
| | | private MybatisSqlExecuteService sqlExecuteService; |
| | | |
| | | |
| | | |
| | | //获取电池组历史告警数量 |
| | | public int getBattAlmHisCount(BattAlmPar param){ |
| | | String sql="select count(distinct history.num) as number " + |
| | | " from db_alarm."+param.getRecordYear()+" history,db_station.tb_station_inf,db_station.tb_batt_inf " + |
| | | " where history.battgroup_id=tb_batt_inf.battgroup_id " + |
| | | " and tb_batt_inf.station_id=tb_station_inf.station_id " + |
| | | " and alm_start_time>='"+ThreadLocalUtil.format(param.getAlmStartTime(),1)+"' and alm_start_time <='"+ThreadLocalUtil.format(param.getAlmEndTime(),1)+"' " ; |
| | | if(param.getProvice()!=null){ |
| | | sql+=" and tb_station_inf.provice='"+param.getProvice()+"' "; |
| | | } |
| | | if(param.getCity()!=null){ |
| | | sql+=" and tb_station_inf.city='"+param.getCity()+"' "; |
| | | } |
| | | if(param.getCountry()!=null){ |
| | | sql+=" and tb_station_inf.country='"+param.getCountry()+"' "; |
| | | } |
| | | if(param.getStationName()!=null){ |
| | | sql+=" and tb_station_inf.station_name like '%"+param.getStationName()+"%' "; |
| | | } |
| | | if(param.getAlmLevel()!=null){ |
| | | sql+=" and history.alm_level="+param.getAlmLevel()+" "; |
| | | } |
| | | List<Integer> almIds=param.getAlmIds(); |
| | | if(almIds!=null&&almIds.size()>0){ |
| | | sql+=" and history.alm_id in ( "; |
| | | for (int i=0;i<almIds.size();i++) { |
| | | sql+=almIds.get(i); |
| | | if(i!=(almIds.size()-1)){ |
| | | sql+=","; |
| | | } |
| | | } |
| | | sql+=")"; |
| | | } |
| | | if(param.getUid()>100){ |
| | | sql+=" and tb_batt_inf.station_id in(" + |
| | | " select distinct station_id from db_user.tb_baojigroup_power,db_user.tb_baojigroup_usr " + |
| | | " where tb_baojigroup_power.baoji_group_id=tb_baojigroup_usr.baoji_group_id " + |
| | | " and tb_baojigroup_usr.uid="+param.getUid()+ |
| | | " )"; |
| | | } |
| | | List list = sqlExecuteService.executeQuery_call(sql, new CallBack() { |
| | | @Override |
| | | public List getResults(ResultSet rs) throws SQLException { |
| | | LinkedList<Object> temp = new LinkedList<>(); |
| | | try { |
| | | while (rs.next()) |
| | | temp.add(rs.getInt("number")); |
| | | } catch (SQLException e) { |
| | | e.printStackTrace(); |
| | | } |
| | | return temp; |
| | | } |
| | | }); |
| | | int num =0; |
| | | if(list!=null){ |
| | | num= (int) list.get(0); |
| | | } |
| | | return num; |
| | | } |
| | | //获取电池组历史告警集合 |
| | | public List<BattalarmDataHistory> getBattAlmHisList(BattAlmPar param){ |
| | | String sql="select history.battgroup_id,history.num,alm_signal_id,history.mon_num,alm_value,alm_level,alm_is_confirmed,alm_confirmed_time,alm_start_time,alm_end_time,alm_severity " + |
| | | " ,tb_station_inf.station_name,tb_station_inf.provice,tb_station_inf.city,tb_station_inf.country,tb_batt_inf.battgroup_name " + |
| | | " from db_alarm."+param.getRecordYear()+" history,db_station.tb_station_inf,db_station.tb_batt_inf " + |
| | | " where history.battgroup_id=tb_batt_inf.battgroup_id " + |
| | | " and tb_batt_inf.station_id=tb_station_inf.station_id " + |
| | | " and alm_start_time>='"+ThreadLocalUtil.format(param.getAlmStartTime(),1)+"' and alm_start_time <='"+ThreadLocalUtil.format(param.getAlmEndTime(),1)+"' " ; |
| | | if(param.getProvice()!=null){ |
| | | sql+=" and tb_station_inf.provice='"+param.getProvice()+"' "; |
| | | } |
| | | if(param.getCity()!=null){ |
| | | sql+=" and tb_station_inf.city='"+param.getCity()+"' "; |
| | | } |
| | | if(param.getCountry()!=null){ |
| | | sql+=" and tb_station_inf.country='"+param.getCountry()+"' "; |
| | | } |
| | | if(param.getStationName()!=null){ |
| | | sql+=" and tb_station_inf.station_name like '%"+param.getStationName()+"%' "; |
| | | } |
| | | if(param.getAlmLevel()!=null){ |
| | | sql+=" and history.alm_level="+param.getAlmLevel()+" "; |
| | | } |
| | | List<Integer> almIds=param.getAlmIds(); |
| | | if(almIds!=null&&almIds.size()>0){ |
| | | sql+=" and history.alm_id in ( "; |
| | | for (int i=0;i<almIds.size();i++) { |
| | | sql+=almIds.get(i); |
| | | if(i!=(almIds.size()-1)){ |
| | | sql+=","; |
| | | } |
| | | } |
| | | sql+=")"; |
| | | } |
| | | if(param.getUid()>100){ |
| | | sql+=" and tb_batt_inf.station_id in(" + |
| | | " select distinct station_id from db_user.tb_baojigroup_power,db_user.tb_baojigroup_usr " + |
| | | " where tb_baojigroup_power.baoji_group_id=tb_baojigroup_usr.baoji_group_id " + |
| | | " and tb_baojigroup_usr.uid="+param.getUid()+ |
| | | " )"; |
| | | } |
| | | sql+=" order by history.alm_start_time desc,history.battgroup_id asc,history.mon_num asc limit "+param.getLimitStart()+","+param.getLimitEnd()+" "; |
| | | |
| | | /*List<BattAlarmRes> list = sqlExecuteService.executeQuery_call(sql, new CallBack() { |
| | | @Override |
| | | public List getResults(ResultSet rs) throws SQLException { |
| | | List<BattAlarmRes> list=new ArrayList<>(); |
| | | int id=0; |
| | | int i=0; |
| | | List dataList=new ArrayList(); |
| | | BattAlarmRes ph=new BattAlarmRes(); |
| | | while (rs.next()){ |
| | | int battGroupId=rs.getInt("battgroup_id"); |
| | | if(battGroupId!=id){ |
| | | ph.setAdataHs(dataList); |
| | | dataList=new ArrayList(); |
| | | } |
| | | BattalarmDataHistory data=new BattalarmDataHistory(); |
| | | data.setNum(rs.getLong("num")); |
| | | data.setBattgroupId(rs.getInt("battgroup_id")); |
| | | data.setAlmSignalId(rs.getInt("alm_signal_id")); |
| | | data.setMonNum(rs.getInt("mon_num")); |
| | | data.setAlmValue(rs.getFloat("alm_value")); |
| | | data.setAlmLevel(rs.getInt("alm_level")); |
| | | data.setAlmIsConfirmed(rs.getInt("alm_is_confirmed")); |
| | | data.setAlmConfirmedTime(rs.getTimestamp("alm_confirmed_time")); |
| | | data.setAlmStartTime(rs.getTimestamp("alm_start_time")); |
| | | data.setAlmEndTime(rs.getTimestamp("alm_end_time")); |
| | | data.setAlmSeverity(rs.getInt("alm_severity")); |
| | | dataList.add(data); |
| | | if(battGroupId!=id){ |
| | | if(i!=0){ |
| | | list.add(ph); |
| | | } |
| | | id=battGroupId; |
| | | ph=new BattAlarmRes(); |
| | | ph.setBattgroupId(battGroupId); |
| | | ph.setStationName(rs.getString("station_name")); |
| | | ph.setProvice(rs.getString("provice")); |
| | | ph.setCity(rs.getString("city")); |
| | | ph.setCountry(rs.getString("country")); |
| | | ph.setBattGroupName(rs.getString("battgroup_name")); |
| | | } |
| | | if(rs.isLast()){ |
| | | ph.setAdataHs(dataList); |
| | | list.add(ph); |
| | | } |
| | | i++; |
| | | } |
| | | return list; |
| | | } |
| | | });*/ |
| | | List<BattalarmDataHistory> list = sqlExecuteService.executeQuery_call(sql, new CallBack() { |
| | | @Override |
| | | public List getResults(ResultSet rs) throws SQLException { |
| | | List<BattalarmDataHistory> list=new ArrayList<>(); |
| | | while (rs.next()){ |
| | | BattalarmDataHistory data=new BattalarmDataHistory(); |
| | | data.setNum(rs.getLong("num")); |
| | | data.setBattgroupId(rs.getInt("battgroup_id")); |
| | | data.setAlmSignalId(rs.getInt("alm_signal_id")); |
| | | data.setMonNum(rs.getInt("mon_num")); |
| | | data.setAlmValue(rs.getFloat("alm_value")); |
| | | data.setAlmLevel(rs.getInt("alm_level")); |
| | | data.setAlmIsConfirmed(rs.getInt("alm_is_confirmed")); |
| | | data.setAlmConfirmedTime(rs.getTimestamp("alm_confirmed_time")); |
| | | data.setAlmStartTime(rs.getTimestamp("alm_start_time")); |
| | | data.setAlmEndTime(rs.getTimestamp("alm_end_time")); |
| | | data.setAlmSeverity(rs.getInt("alm_severity")); |
| | | data.setBattgroupId(rs.getInt("battgroup_id")); |
| | | data.setStationName(rs.getString("station_name")); |
| | | data.setProvice(rs.getString("provice")); |
| | | data.setCity(rs.getString("city")); |
| | | data.setCountry(rs.getString("country")); |
| | | data.setBattgroupName(rs.getString("battgroup_name")); |
| | | list.add(data); |
| | | } |
| | | return list; |
| | | } |
| | | }); |
| | | return list; |
| | | } |
| | | |
| | | //获取设备历史告警数量 |
| | | public int getDevAlmHisCount(DevAlmPar param){ |
| | | String sql="SELECT count(distinct history.num) as number FROM db_alarm."+param.getRecordYear()+" history,db_station.tb_batt_inf,db_station.tb_station_inf " + |
| | | " where history.dev_id=tb_batt_inf.dev_id "+ |
| | | " and tb_batt_inf.station_id=tb_station_inf.station_id "+ |
| | | " and alm_start_time>='"+ThreadLocalUtil.format(param.getAlmStartTime(),1)+"' and alm_start_time <='"+ThreadLocalUtil.format(param.getAlmEndTime(),1)+"' " ; |
| | | if(param.getProvice()!=null){ |
| | | sql+=" and tb_station_inf.provice='"+param.getProvice()+"' "; |
| | | } |
| | | if(param.getCity()!=null){ |
| | | sql+=" and tb_station_inf.city='"+param.getCity()+"' "; |
| | | } |
| | | if(param.getCountry()!=null){ |
| | | sql+=" and tb_station_inf.country='"+param.getCountry()+"' "; |
| | | } |
| | | if(param.getStationName()!=null){ |
| | | sql+=" and tb_station_inf.station_name like '%"+param.getStationName()+"%' "; |
| | | } |
| | | if(param.getAlmLevel()!=null){ |
| | | sql+=" and history.alm_level="+param.getAlmLevel()+" "; |
| | | } |
| | | List<Integer> almIds=param.getAlmIds(); |
| | | if(almIds!=null&&almIds.size()>0){ |
| | | sql+=" and history.alm_id in ( "; |
| | | for (int i=0;i<almIds.size();i++) { |
| | | sql+=almIds.get(i); |
| | | if(i!=(almIds.size()-1)){ |
| | | sql+=","; |
| | | } |
| | | } |
| | | sql+=")"; |
| | | } |
| | | if(param.getUid()>100){ |
| | | sql+=" and tb_batt_inf.station_id in(" + |
| | | " select distinct station_id from db_user.tb_baojigroup_power,db_user.tb_baojigroup_usr " + |
| | | " where tb_baojigroup_power.baoji_group_id=tb_baojigroup_usr.baoji_group_id " + |
| | | " and tb_baojigroup_usr.uid="+param.getUid()+ |
| | | " )"; |
| | | } |
| | | List list = sqlExecuteService.executeQuery_call(sql, new CallBack() { |
| | | @Override |
| | | public List getResults(ResultSet rs) throws SQLException { |
| | | LinkedList<Object> temp = new LinkedList<>(); |
| | | try { |
| | | while (rs.next()) |
| | | temp.add(rs.getInt("number")); |
| | | } catch (SQLException e) { |
| | | e.printStackTrace(); |
| | | } |
| | | return temp; |
| | | } |
| | | }); |
| | | int num =0; |
| | | if(list!=null){ |
| | | num= (int) list.get(0); |
| | | } |
| | | return num; |
| | | } |
| | | //获取设备历史告警集合 |
| | | public List getDevAlmHisList(DevAlmPar param){ |
| | | String sql="SELECT history.*, " + |
| | | " tb_station_inf.station_name,tb_station_inf.provice,tb_station_inf.city,tb_station_inf.country,tb_batt_inf.dev_name " + |
| | | " FROM db_alarm."+param.getRecordYear()+" history,db_station.tb_batt_inf,db_station.tb_station_inf " + |
| | | " where history.dev_id=tb_batt_inf.dev_id "+ |
| | | " and tb_batt_inf.station_id=tb_station_inf.station_id "+ |
| | | " and alm_start_time>='"+ThreadLocalUtil.format(param.getAlmStartTime(),1)+"' and alm_start_time <='"+ThreadLocalUtil.format(param.getAlmEndTime(),1)+"' " ; |
| | | if(param.getProvice()!=null){ |
| | | sql+=" and tb_station_inf.provice='"+param.getProvice()+"' "; |
| | | } |
| | | if(param.getCity()!=null){ |
| | | sql+=" and tb_station_inf.city='"+param.getCity()+"' "; |
| | | } |
| | | if(param.getCountry()!=null){ |
| | | sql+=" and tb_station_inf.country='"+param.getCountry()+"' "; |
| | | } |
| | | if(param.getStationName()!=null){ |
| | | sql+=" and tb_station_inf.station_name like '%"+param.getStationName()+"%' "; |
| | | } |
| | | if(param.getAlmLevel()!=null){ |
| | | sql+=" and history.alm_level="+param.getAlmLevel()+" "; |
| | | } |
| | | List<Integer> almIds=param.getAlmIds(); |
| | | if(almIds!=null&&almIds.size()>0){ |
| | | sql+=" and history.alm_id in ( "; |
| | | for (int i=0;i<almIds.size();i++) { |
| | | sql+=almIds.get(i); |
| | | if(i!=(almIds.size()-1)){ |
| | | sql+=","; |
| | | } |
| | | } |
| | | sql+=")"; |
| | | } |
| | | if(param.getUid()>100){ |
| | | sql+=" and tb_batt_inf.station_id in(" + |
| | | " select distinct station_id from db_user.tb_baojigroup_power,db_user.tb_baojigroup_usr " + |
| | | " where tb_baojigroup_power.baoji_group_id=tb_baojigroup_usr.baoji_group_id " + |
| | | " and tb_baojigroup_usr.uid="+param.getUid()+ |
| | | " )"; |
| | | } |
| | | sql+=" order by history.alm_start_time desc,history.dev_id asc limit "+param.getLimitStart()+","+param.getLimitEnd()+" "; |
| | | List list = sqlExecuteService.executeQuery_call(sql, new CallBack() { |
| | | @Override |
| | | public List getResults(ResultSet rs) throws SQLException { |
| | | List<DevalarmDataHistory> list=new ArrayList<>(); |
| | | while (rs.next()){ |
| | | DevalarmDataHistory ph=new DevalarmDataHistory(); |
| | | ph.setNum(rs.getLong("num")); |
| | | ph.setDevId(rs.getInt("dev_id")); |
| | | ph.setDevIp(rs.getString("dev_ip")); |
| | | ph.setAlmId(rs.getInt("alm_id")); |
| | | ph.setAlmLevel(rs.getInt("alm_level")); |
| | | ph.setAlmStartTime(rs.getTimestamp("alm_start_time")); |
| | | ph.setAlmEndTime(rs.getTimestamp("alm_end_time")); |
| | | ph.setAlmIsConfirmed(rs.getInt("alm_is_confirmed")); |
| | | ph.setAlmConfirmedTime(rs.getTimestamp("alm_confirmed_time")); |
| | | ph.setAlmClearedType(rs.getInt("alm_cleared_type")); |
| | | ph.setDevName(rs.getString("dev_name")); |
| | | ph.setStationName(rs.getString("station_name")); |
| | | ph.setProvice(rs.getString("provice")); |
| | | ph.setCity(rs.getString("city")); |
| | | ph.setCountry(rs.getString("country")); |
| | | list.add(ph); |
| | | } |
| | | return list; |
| | | } |
| | | }); |
| | | return list; |
| | | } |
| | | //电源历史告警数 |
| | | public int getPwrAlmHisCount(PwrAlmPar param){ |
| | | String sql="select count(distinct alarm.num) as number from db_pwrdev_alarm."+param.getRecordYear()+" alarm" + |
| | | ",db_station.tb_power_inf,db_station.tb_station_inf " + |
| | | " where alarm.power_id = tb_power_inf.power_id " + |
| | | " and tb_power_inf.station_id=tb_station_inf.station_id "+ |
| | | " and alm_start_time>='"+ThreadLocalUtil.format(param.getAlmStartTime(),1)+"' and alm_start_time <='"+ThreadLocalUtil.format(param.getAlmEndTime(),1)+"' " ; |
| | | if(param.getProvice()!=null){ |
| | | sql+=" and tb_station_inf.provice='"+param.getProvice()+"' "; |
| | | } |
| | | if(param.getCity()!=null){ |
| | | sql+=" and tb_station_inf.city='"+param.getCity()+"' "; |
| | | } |
| | | if(param.getCountry()!=null){ |
| | | sql+=" and tb_station_inf.country='"+param.getCountry()+"' "; |
| | | } |
| | | if(param.getStationName()!=null){ |
| | | sql+=" and tb_station_inf.station_name like '%"+param.getStationName()+"%' "; |
| | | } |
| | | if(param.getAlmLevel()!=null){ |
| | | sql+=" and alarm.alm_level="+param.getAlmLevel()+" "; |
| | | } |
| | | List<Integer> almIds=param.getAlmIds(); |
| | | if(almIds!=null&&almIds.size()>0){ |
| | | sql+=" and alarm.alm_id in ( "; |
| | | for (int i=0;i<almIds.size();i++) { |
| | | sql+=almIds.get(i); |
| | | if(i!=(almIds.size()-1)){ |
| | | sql+=","; |
| | | } |
| | | } |
| | | sql+=")"; |
| | | } |
| | | if(param.getUid()>100){ |
| | | sql+=" and tb_power_inf.power_id in(" + |
| | | " select distinct power_id from db_user.tb_baojigroup_power,db_user.tb_baojigroup_usr " + |
| | | " where tb_baojigroup_power.baoji_group_id=tb_baojigroup_usr.baoji_group_id " + |
| | | " and tb_baojigroup_usr.uid="+param.getUid()+ |
| | | " )"; |
| | | } |
| | | List list = sqlExecuteService.executeQuery_call(sql, new CallBack() { |
| | | @Override |
| | | public List getResults(ResultSet rs) throws SQLException { |
| | | LinkedList<Object> temp = new LinkedList<>(); |
| | | try { |
| | | while (rs.next()) |
| | | temp.add(rs.getInt("number")); |
| | | } catch (SQLException e) { |
| | | e.printStackTrace(); |
| | | } |
| | | return temp; |
| | | } |
| | | }); |
| | | int num =0; |
| | | if(list!=null){ |
| | | num= (int) list.get(0); |
| | | } |
| | | return num; |
| | | } |
| | | //电源历史告警集合 |
| | | public List<PwrdevAlarmHistory> getPwrAlmHisList(PwrAlmPar param){ |
| | | String sql="select alarm.*," + |
| | | " tb_station_inf.station_name,tb_station_inf.provice,tb_station_inf.city,tb_station_inf.country,tb_power_inf.power_name " + |
| | | " from db_pwrdev_alarm."+param.getRecordYear()+" alarm" + |
| | | ",db_station.tb_power_inf,db_station.tb_station_inf " + |
| | | " where alarm.power_id = tb_power_inf.power_id " + |
| | | " and tb_power_inf.station_id=tb_station_inf.station_id "+ |
| | | " and alm_start_time>='"+ThreadLocalUtil.format(param.getAlmStartTime(),1)+"' and alm_start_time <='"+ThreadLocalUtil.format(param.getAlmEndTime(),1)+"' " ; |
| | | if(param.getProvice()!=null){ |
| | | sql+=" and tb_station_inf.provice='"+param.getProvice()+"' "; |
| | | } |
| | | if(param.getCity()!=null){ |
| | | sql+=" and tb_station_inf.city='"+param.getCity()+"' "; |
| | | } |
| | | if(param.getCountry()!=null){ |
| | | sql+=" and tb_station_inf.country='"+param.getCountry()+"' "; |
| | | } |
| | | if(param.getStationName()!=null){ |
| | | sql+=" and tb_station_inf.station_name like '%"+param.getStationName()+"%' "; |
| | | } |
| | | if(param.getAlmLevel()!=null){ |
| | | sql+=" and alarm.alm_level="+param.getAlmLevel()+" "; |
| | | } |
| | | List<Integer> almIds=param.getAlmIds(); |
| | | if(almIds!=null&&almIds.size()>0){ |
| | | sql+=" and alarm.alm_id in ( "; |
| | | for (int i=0;i<almIds.size();i++) { |
| | | sql+=almIds.get(i); |
| | | if(i!=(almIds.size()-1)){ |
| | | sql+=","; |
| | | } |
| | | } |
| | | sql+=")"; |
| | | } |
| | | if(param.getUid()>100){ |
| | | sql+=" and tb_power_inf.power_id in(" + |
| | | " select distinct power_id from db_user.tb_baojigroup_power,db_user.tb_baojigroup_usr " + |
| | | " where tb_baojigroup_power.baoji_group_id=tb_baojigroup_usr.baoji_group_id " + |
| | | " and tb_baojigroup_usr.uid="+param.getUid()+ |
| | | " )"; |
| | | } |
| | | sql+="order by alarm.alm_start_time desc limit "+param.getLimitStart()+","+param.getLimitEnd()+" "; |
| | | List<PwrdevAlarmHistory> list = sqlExecuteService.executeQuery_call(sql, new CallBack() { |
| | | @Override |
| | | public List getResults(ResultSet rs) throws SQLException { |
| | | List<PwrdevAlarmHistory> list=new ArrayList<>(); |
| | | while (rs.next()){ |
| | | PwrdevAlarmHistory ph=new PwrdevAlarmHistory(); |
| | | ph.setNum(rs.getLong("num")); |
| | | ph.setPowerId(rs.getInt("power_id")); |
| | | ph.setAlmId(rs.getInt("alm_id")); |
| | | ph.setPowerName(rs.getString("power_name")); |
| | | ph.setAlmLevel(rs.getInt("alm_level")); |
| | | ph.setAlmStartTime(rs.getTimestamp("alm_start_time")); |
| | | ph.setAlmEndTime(rs.getTimestamp("alm_end_time")); |
| | | ph.setAlmValue(rs.getFloat("alm_value")); |
| | | ph.setAlmIsConfirmed(rs.getInt("alm_is_confirmed")); |
| | | ph.setAlmConfirmedTime(rs.getTimestamp("alm_confirmed_time")); |
| | | ph.setAlmClearedType(rs.getInt("alm_cleared_type")); |
| | | ph.setUsrId(rs.getInt("usr_Id")); |
| | | ph.setAlmTrigger(rs.getInt("alm_trigger")); |
| | | ph.setAlmSeverity(rs.getInt("alm_severity")); |
| | | ph.setStationName(rs.getString("station_name")); |
| | | ph.setProvice(rs.getString("provice")); |
| | | ph.setCity(rs.getString("city")); |
| | | ph.setCountry(rs.getString("country")); |
| | | list.add(ph); |
| | | } |
| | | return list; |
| | | } |
| | | }); |
| | | return list; |
| | | } |
| | | //获取电池组某一年月的数据 |
| | | public List<QuarterDto> getBattRealHis(String tableName, String columnName) { |
| | | String sql="select distinct mon_num,record_time,"+columnName+" from "+tableName+" order by record_time asc"; |
| | | List<QuarterDto> list = sqlExecuteService.executeQuery_call(sql, new CallBack() { |
| | | @Override |
| | | public List getResults(ResultSet rs) throws SQLException { |
| | | List<QuarterDto> list=new ArrayList<>(); |
| | | while (rs.next()){ |
| | | QuarterDto data=new QuarterDto(); |
| | | data.setRecordTime(rs.getTimestamp("record_time")); |
| | | data.setNumValue(rs.getFloat(columnName)); |
| | | data.setMonNum(rs.getInt("mon_num")); |
| | | list.add(data); |
| | | } |
| | | return list; |
| | | } |
| | | }); |
| | | return list; |
| | | } |
| | | //获取表中最大,最小,平均数据值 |
| | | public CompareDto getBattCompareHis(String tableName, String columnName) { |
| | | String sql="select max("+columnName+") as maxData,min("+columnName+") as minData,avg("+columnName+") as avgData"+" from "+tableName; |
| | | List<CompareDto> list = sqlExecuteService.executeQuery_call(sql, new CallBack() { |
| | | @Override |
| | | public List getResults(ResultSet rs) throws SQLException { |
| | | List<CompareDto> list=new ArrayList<>(); |
| | | while (rs.next()){ |
| | | CompareDto data=new CompareDto(); |
| | | data.setMaxData(rs.getFloat("maxData")); |
| | | data.setMinData(rs.getFloat("minData")); |
| | | data.setAvgData(rs.getFloat("avgData")); |
| | | list.add(data); |
| | | } |
| | | return list; |
| | | } |
| | | }); |
| | | if(list!=null&&list.size()>0){ |
| | | return list.get(0); |
| | | }else { |
| | | return null; |
| | | } |
| | | } |
| | | //获取内阻数据 |
| | | public List<QuarterDto> getBattResInfData(Integer battgroupId,Integer testRecordCount) { |
| | | String sql="select distinct mon_num,test_starttime,mon_res, from db_batt_testdata.tb_battresdata_"+battgroupId |
| | | +" where test_record_count="+testRecordCount+" order by mon_num asc"; |
| | | List<QuarterDto> list = sqlExecuteService.executeQuery_call(sql, new CallBack() { |
| | | @Override |
| | | public List getResults(ResultSet rs) throws SQLException { |
| | | List<QuarterDto> list=new ArrayList<>(); |
| | | while (rs.next()){ |
| | | QuarterDto data=new QuarterDto(); |
| | | data.setMonNum(rs.getInt("mon_num")); |
| | | data.setNumValue(rs.getFloat("mon_res")); |
| | | data.setRecordTime(rs.getTimestamp("test_starttime")); |
| | | list.add(data); |
| | | } |
| | | return list; |
| | | } |
| | | }); |
| | | return list; |
| | | } |
| | | //找这次放电的指定一笔数据 |
| | | public List<BatttestdataId> getLastDataByBattgroupId(Integer battgroupId, Integer testRecordCount, Integer recordNum) { |
| | | String sql="select distinct * from db_batt_testdata.tb_batttestdata_"+battgroupId |
| | | +" where test_record_count="+testRecordCount+" and record_num="+recordNum+ " order by mon_num asc"; |
| | | List<BatttestdataId> list = sqlExecuteService.executeQuery_call(sql, new CallBack() { |
| | | @Override |
| | | public List getResults(ResultSet rs) throws SQLException { |
| | | List<BatttestdataId> list=new ArrayList<>(); |
| | | while (rs.next()){ |
| | | BatttestdataId data=new BatttestdataId(); |
| | | data.setBattgroupId(rs.getInt("battgroup_id")); |
| | | data.setTestRecordCount(rs.getInt("test_record_count")); |
| | | data.setTestStarttime(rs.getTimestamp("test_starttime")); |
| | | data.setOnlineVol(rs.getFloat("online_vol")); |
| | | data.setGroupVol(rs.getFloat("group_vol")); |
| | | data.setTestCurr(rs.getFloat("test_curr")); |
| | | data.setTestCap(rs.getFloat("test_cap")); |
| | | data.setMonNum(rs.getInt("mon_num")); |
| | | data.setMonVol(rs.getFloat("mon_vol")); |
| | | data.setMonRes(rs.getFloat("mon_res")); |
| | | data.setMonTmp(rs.getFloat("mon_tmp")); |
| | | list.add(data); |
| | | } |
| | | return list; |
| | | } |
| | | }); |
| | | return list; |
| | | } |
| | | //系统概览获取半小时核容设备信息(组端信息取一个单体信息即可) |
| | | public List<BattHisRealDto> getHalfHourBattDevData(String tableName,Integer granularity,String halfHourAgoTime) { |
| | | String sql="select distinct mon_num,record_time,group_vol,online_vol,group_curr,group_tmp,load_curr " + |
| | | "from (select a.*, (@i:= @i+1) as number " + |
| | | " from (select * from "+tableName+" "+ |
| | | " where record_time>='"+halfHourAgoTime+"' and mon_num=1) a, " + |
| | | " (select @i:=0) b) c "+ |
| | | " where c.number%"+granularity+"=0 or c.number=1 "; |
| | | sql+=" order by record_time asc"; |
| | | List<BattHisRealDto> list = sqlExecuteService.executeQuery_call(sql, new CallBack() { |
| | | @Override |
| | | public List getResults(ResultSet rs) throws SQLException { |
| | | List<BattHisRealDto> list=new ArrayList<>(); |
| | | while (rs.next()){ |
| | | BattHisRealDto data=new BattHisRealDto(); |
| | | data.setRecordTime(rs.getTimestamp("record_time")); |
| | | data.setGroupVol(rs.getFloat("group_vol")); |
| | | data.setOnlineVol(rs.getFloat("online_vol")); |
| | | data.setGroupCurr(rs.getFloat("group_curr")); |
| | | data.setGroupTmp(rs.getFloat("group_tmp")); |
| | | data.setLoadCurr(rs.getFloat("load_curr")); |
| | | list.add(data); |
| | | } |
| | | return list; |
| | | } |
| | | }); |
| | | return list; |
| | | } |
| | | //系统概览获取半小时交流输入统计 |
| | | public List<PwrHisRealAcInDto> getHalfHourPwrHisAcinData(String tableName,Integer granularity,String halfHourAgoTime) { |
| | | String sql="select distinct record_datetime,acin1_vola,acin1_volb,acin1_volc,acin2_vola,acin2_volb,acin2_volc " + |
| | | ",acin1_curra,acin1_currb,acin1_currc,acin2_curra,acin2_currb,acin2_currc " + |
| | | "from (select a.*, (@i:= @i+1) as number " + |
| | | " from (select * from "+tableName+" "+ |
| | | " where record_datetime>='"+halfHourAgoTime+"') a, " + |
| | | " (select @i:=0) b) c "+ |
| | | " where c.number%"+granularity+"=0 or c.number=1 "; |
| | | sql+=" order by record_datetime asc"; |
| | | List<PwrHisRealAcInDto> list = sqlExecuteService.executeQuery_call(sql, new CallBack() { |
| | | @Override |
| | | public List getResults(ResultSet rs) throws SQLException { |
| | | List<PwrHisRealAcInDto> list=new ArrayList<>(); |
| | | while (rs.next()){ |
| | | PwrHisRealAcInDto data=new PwrHisRealAcInDto(); |
| | | data.setRecordDatetime(rs.getTimestamp("record_datetime")); |
| | | data.setAcin1Vola(rs.getFloat("acin1_vola")); |
| | | data.setAcin1Volb(rs.getFloat("acin1_volb")); |
| | | data.setAcin1Volc(rs.getFloat("acin1_volc")); |
| | | data.setAcin2Vola(rs.getFloat("acin2_vola")); |
| | | data.setAcin2Volb(rs.getFloat("acin2_volb")); |
| | | data.setAcin2Volc(rs.getFloat("acin2_volc")); |
| | | data.setAcin1Curra(rs.getFloat("acin1_curra")); |
| | | data.setAcin1Currb(rs.getFloat("acin1_currb")); |
| | | data.setAcin1Currc(rs.getFloat("acin1_currc")); |
| | | data.setAcin2Curra(rs.getFloat("acin2_curra")); |
| | | data.setAcin2Currb(rs.getFloat("acin2_currb")); |
| | | data.setAcin2Currc(rs.getFloat("acin2_currc")); |
| | | list.add(data); |
| | | } |
| | | return list; |
| | | } |
| | | }); |
| | | return list; |
| | | } |
| | | |
| | | public List<PwrHisRealDcoutInDto> getHalfHourPwrHisDcoutData(String tableName,Integer granularity,String halfHourAgoTime) { |
| | | String sql="select distinct * " + |
| | | "from (select a.*, (@i:= @i+1) as number " + |
| | | " from (select * from "+tableName+" "+ |
| | | " where record_datetime>='"+halfHourAgoTime+"') a, " + |
| | | " (select @i:=0) b) c "+ |
| | | " where c.number%"+granularity+"=0 or c.number=1 "; |
| | | sql+=" order by record_datetime asc"; |
| | | List<PwrHisRealDcoutInDto> list = sqlExecuteService.executeQuery_call(sql, new CallBack() { |
| | | @Override |
| | | public List getResults(ResultSet rs) throws SQLException { |
| | | List<PwrHisRealDcoutInDto> list=new ArrayList<>(); |
| | | while (rs.next()){ |
| | | PwrHisRealDcoutInDto data=new PwrHisRealDcoutInDto(); |
| | | data.setRecordDatetime(rs.getTimestamp("record_datetime")); |
| | | data.setMOutputvol(rs.getFloat("m_outputvol")); |
| | | data.setM1Outcurr(rs.getFloat("m1_outcurr")); |
| | | data.setM2Outcurr(rs.getFloat("m2_outcurr")); |
| | | data.setM3Outcurr(rs.getFloat("m3_outcurr")); |
| | | data.setM4Outcurr(rs.getFloat("m4_outcurr")); |
| | | data.setM5Outcurr(rs.getFloat("m5_outcurr")); |
| | | data.setM6Outcurr(rs.getFloat("m6_outcurr")); |
| | | data.setM7Outcurr(rs.getFloat("m7_outcurr")); |
| | | data.setM8Outcurr(rs.getFloat("m8_outcurr")); |
| | | data.setM9Outcurr(rs.getFloat("m9_outcurr")); |
| | | data.setM10Outcurr(rs.getFloat("m10_outcurr")); |
| | | data.setM11Outcurr(rs.getFloat("m11_outcurr")); |
| | | data.setM12Outcurr(rs.getFloat("m12_outcurr")); |
| | | data.setM13Outcurr(rs.getFloat("m13_outcurr")); |
| | | data.setM14Outcurr(rs.getFloat("m14_outcurr")); |
| | | data.setM15Outcurr(rs.getFloat("m15_outcurr")); |
| | | data.setM16Outcurr(rs.getFloat("m16_outcurr")); |
| | | data.setM1OutVol(rs.getFloat("m1_out_vol")); |
| | | data.setM2OutVol(rs.getFloat("m2_out_vol")); |
| | | data.setM3OutVol(rs.getFloat("m3_out_vol")); |
| | | data.setM4OutVol(rs.getFloat("m4_out_vol")); |
| | | data.setM5OutVol(rs.getFloat("m5_out_vol")); |
| | | data.setM6OutVol(rs.getFloat("m6_out_vol")); |
| | | data.setM7OutVol(rs.getFloat("m7_out_vol")); |
| | | data.setM8OutVol(rs.getFloat("m8_out_vol")); |
| | | data.setM9OutVol(rs.getFloat("m9_out_vol")); |
| | | data.setM10OutVol(rs.getFloat("m10_out_vol")); |
| | | data.setM11OutVol(rs.getFloat("m11_out_vol")); |
| | | data.setM12OutVol(rs.getFloat("m12_out_vol")); |
| | | data.setM13OutVol(rs.getFloat("m13_out_vol")); |
| | | data.setM14OutVol(rs.getFloat("m14_out_vol")); |
| | | data.setM15OutVol(rs.getFloat("m15_out_vol")); |
| | | data.setM16OutVol(rs.getFloat("m16_out_vol")); |
| | | list.add(data); |
| | | } |
| | | return list; |
| | | } |
| | | }); |
| | | return list; |
| | | } |
| | | //历史测试记录具体某一次放电数据详情 |
| | | public List<BatttestdataId> getTinfDataWithTestRecordCount(String tableName, Integer testRecordCount, Integer recordNum, Integer granularity) { |
| | | String sql="select distinct * from "+tableName+" "+ |
| | | " where test_record_count="+testRecordCount+" " + |
| | | " and record_num%"+granularity+"=0 or record_num=1 or record_num="+recordNum; |
| | | sql+=" order by record_time asc"; |
| | | List<BatttestdataId> list = sqlExecuteService.executeQuery_call(sql, new CallBack() { |
| | | @Override |
| | | public List getResults(ResultSet rs) throws SQLException { |
| | | List<BatttestdataId> list=new ArrayList<>(); |
| | | while (rs.next()){ |
| | | BatttestdataId data=new BatttestdataId(); |
| | | data.setNum(rs.getInt("num")); |
| | | data.setBattgroupId(rs.getInt("battgroup_id")); |
| | | data.setTestRecordCount(rs.getInt("test_record_count")); |
| | | data.setTestType(rs.getInt("test_type")); |
| | | data.setRecordNum(rs.getInt("record_num")); |
| | | data.setDataNew(rs.getInt("data_new")); |
| | | data.setDataAvailable(rs.getInt("data_available")); |
| | | data.setTestTimelong(rs.getInt("test_timelong")); |
| | | data.setTestCurr(rs.getFloat("test_curr")); |
| | | data.setTestCap(rs.getFloat("test_cap")); |
| | | data.setMonNum(rs.getInt("mon_num")); |
| | | data.setMonVol(rs.getFloat("mon_vol")); |
| | | data.setMonTmp(rs.getFloat("mon_tmp")); |
| | | data.setMonRes(rs.getFloat("mon_res")); |
| | | data.setTestStarttime(rs.getTimestamp("test_starttime")); |
| | | data.setRecordTime(rs.getTimestamp("record_time")); |
| | | data.setGroupVol(rs.getFloat("group_vol")); |
| | | data.setOnlineVol(rs.getFloat("online_vol")); |
| | | list.add(data); |
| | | } |
| | | return list; |
| | | } |
| | | }); |
| | | return list; |
| | | } |
| | | //判断历史实时表是否存在 |
| | | public int judgeTable_realdata( String table){ |
| | | String sql="select count(*) as tableNum " + |
| | | " from INFORMATION_SCHEMA.TABLES " + |
| | | " where TABLE_SCHEMA = 'db_data_history' " + |
| | | " and TABLE_NAME = 'tb_batt_realdata_"+table+"'"; |
| | | List list = sqlExecuteService.executeQuery_call(sql, new CallBack() { |
| | | @Override |
| | | public List getResults(ResultSet rs) throws SQLException { |
| | | LinkedList<Object> temp = new LinkedList<>(); |
| | | try { |
| | | while (rs.next()) |
| | | temp.add(rs.getInt("tableNum")); |
| | | } catch (SQLException e) { |
| | | e.printStackTrace(); |
| | | } |
| | | return temp; |
| | | } |
| | | }); |
| | | int tableNum =0; |
| | | if(list!=null){ |
| | | tableNum= (int) list.get(0); |
| | | } |
| | | return tableNum; |
| | | } |
| | | |
| | | //电池数据历史实时处理 |
| | | public List<RealDateDTO> getBattRealDataHis(BattRealdataId realdata, int granularity,Integer maxRecordNum,Integer minRecordNum) { |
| | | String sql=" select record_time, group_vol, online_vol,group_curr, mon_vol, mon_tmp, mon_res, mon_num,record_num " + |
| | | " from db_data_history.tb_batt_realdata_"+realdata.getTableName()+" " + |
| | | " where record_time >= '"+ThreadLocalUtil.format(realdata.getRecordTime(),1)+"' " + |
| | | " and record_time <= '"+ThreadLocalUtil.format(realdata.getRecordTime1(),1)+"' "+ |
| | | " and (record_num-"+minRecordNum+")%"+granularity+"=0 or record_num="+maxRecordNum+" or record_num="+minRecordNum ; |
| | | List<RealDateDTO> list = sqlExecuteService.executeQuery_call(sql, new CallBack() { |
| | | @Override |
| | | public List getResults(ResultSet rs) throws SQLException { |
| | | List<RealDateDTO> list=new ArrayList<>(); |
| | | while (rs.next()){ |
| | | RealDateDTO ph=new RealDateDTO(); |
| | | ph.setRecordTime(rs.getTimestamp("record_time")); |
| | | ph.setGroupVol(rs.getFloat("group_vol")); |
| | | ph.setOnlineVol(rs.getFloat("online_vol")); |
| | | ph.setGroupCurr(rs.getFloat("group_curr")); |
| | | ph.setMonVol(rs.getFloat("mon_vol")); |
| | | ph.setMonTmp(rs.getFloat("mon_tmp")); |
| | | ph.setMonRes(rs.getFloat("mon_res")); |
| | | ph.setMonNum(rs.getInt("mon_num")); |
| | | ph.setRecordNum(rs.getInt("record_num")); |
| | | list.add(ph); |
| | | } |
| | | return list; |
| | | } |
| | | }); |
| | | return list; |
| | | } |
| | | //获取指定时间段内最大最小recordNum确保数据的完整 |
| | | public List getMaxAndMinRecordNum(BattRealdataId realdata) { |
| | | String sql="select max(record_num) as maxRecordNum,min(record_num) as minRecordNum " + |
| | | " from db_data_history.tb_batt_realdata_" + realdata.getTableName()+" " + |
| | | " where record_time >= '"+ThreadLocalUtil.format(realdata.getRecordTime(),1)+"' " + |
| | | " and record_time <= '"+ThreadLocalUtil.format(realdata.getRecordTime1(),1)+"' " + |
| | | " limit 1"; |
| | | List list = sqlExecuteService.executeQuery_call(sql, new CallBack() { |
| | | @Override |
| | | public List getResults(ResultSet rs) throws SQLException { |
| | | List list = new ArrayList<>(); |
| | | while (rs.next()) { |
| | | list.add(rs.getInt("maxRecordNum")); |
| | | list.add(rs.getInt("minRecordNum")); |
| | | } |
| | | return list; |
| | | } |
| | | }); |
| | | return list; |
| | | } |
| | | } |
| | |
| | | import com.google.gson.Gson; |
| | | import com.google.gson.GsonBuilder; |
| | | import com.google.gson.JsonSyntaxException; |
| | | import com.whyc.pojo.db_user.User; |
| | | import org.apache.commons.codec.digest.DigestUtils; |
| | | import org.springframework.web.context.request.RequestContextHolder; |
| | | import org.springframework.web.context.request.ServletRequestAttributes; |
| | |
| | | import java.lang.reflect.Type; |
| | | import java.text.ParseException; |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.Calendar; |
| | | import java.util.Date; |
| | | import java.util.Locale; |
| | | import java.time.LocalDate; |
| | | import java.util.*; |
| | | import java.util.regex.Matcher; |
| | | import java.util.regex.Pattern; |
| | | import com.whyc.pojo.db_user.User; |
| | | |
| | | public class ActionUtil { |
| | | |
| | |
| | | } else {//相等 |
| | | return 0; |
| | | } |
| | | } |
| | | /** |
| | | } |
| | | //计算当前月的上一个季度年_月份集合 |
| | | public static List<String> getLastQuarterYearMonths() { |
| | | LocalDate currentDate = LocalDate.now(); |
| | | int currentYear = currentDate.getYear(); |
| | | int currentMonth = currentDate.getMonthValue(); |
| | | |
| | | int quarter = (currentMonth - 1) / 3 + 1; // 计算当前季度 |
| | | int lastQuarter = quarter - 1; // 上一季度 |
| | | |
| | | if (lastQuarter == 0) { |
| | | lastQuarter = 4; // 如果当前是第一季度,则上一季度为第四季度 |
| | | } |
| | | |
| | | List<String> yearMonths = new ArrayList<>(); |
| | | for (int i = 1; i <= 3; i++) { |
| | | int month = (lastQuarter - 1) * 3 + i; |
| | | int year = currentYear; |
| | | // 如果上一季度是第四季度,则年份需要减一年 |
| | | if (lastQuarter == 4) { |
| | | year = currentYear - 1; |
| | | } |
| | | yearMonths.add(year + "_" + (month < 10 ? "0" + month : month)); // 保证月份为两位格式 |
| | | } |
| | | |
| | | return yearMonths; |
| | | } |
| | | /** |
| | | * @Description: 根据图片地址转换为base64编码字符串 |
| | | * @Author: |
| | | * @CreateTime: |
| | |
| | | String baseDirPath; |
| | | if(YamlProperties.runModel == 1) { |
| | | //开发路径 |
| | | baseDirPath = jarFile.getParentFile().toString()+File.separator+"fg_file"+File.separator; |
| | | baseDirPath = jarFile.getParentFile().toString()+File.separator+"pis_file"+File.separator; |
| | | }else { |
| | | //打包路径 |
| | | baseDirPath = jarFile.toString()+File.separator+"fg_file"+File.separator; |
| | | baseDirPath = jarFile.toString()+File.separator+"pis_file"+File.separator; |
| | | } |
| | | return baseDirPath; |
| | | } |
| | |
| | | package com.whyc.util; |
| | | |
| | | import java.io.File; |
| | | import org.apache.commons.compress.archivers.ArchiveEntry; |
| | | import org.apache.commons.compress.archivers.ArchiveException; |
| | | import org.apache.commons.compress.archivers.ArchiveInputStream; |
| | | import org.apache.commons.compress.archivers.ArchiveStreamFactory; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.io.*; |
| | | import java.net.URLEncoder; |
| | | import java.nio.file.Files; |
| | | import java.util.ArrayList; |
| | | import java.util.LinkedList; |
| | | import java.util.List; |
| | | |
| | | public class FileUtil { |
| | | |
| | | |
| | | public static List<String> getStaticFilePath(File file, List<String> list){ |
| | | |
| | | //如果是文件的情况 |
| | | if (file.isFile()){ |
| | | list.add(file.getAbsolutePath()); |
| | | }else{ |
| | | //如果是目录的情况 |
| | | //创建一个File数组来存储当前目录下所有文件和目录的绝对路径 |
| | | File[] files = file.listFiles(); |
| | | //循环遍历files |
| | | for (File fileTemp : files){ |
| | | if(fileTemp.getName().contains(".zip")){ |
| | | continue; |
| | | } |
| | | //子级是目录 |
| | | if (fileTemp.isDirectory()){ |
| | | //递归再次进行判断 |
| | | getStaticFilePath(fileTemp, list); |
| | | }else{ |
| | | //子级是文件 |
| | | String absolutePath = fileTemp.getAbsolutePath(); |
| | | list.add(absolutePath); |
| | | //System.out.println(temp + "文件 :" + fileTemp.getName() + "\t"); |
| | | } |
| | | } |
| | | } |
| | | return list; |
| | | } |
| | | |
| | | public static List<String> getStaticFilePathII(File file, List<String> list){ |
| | | |
| | | //如果是文件的情况 |
| | | if (file.isFile()){ |
| | | list.add(file.getAbsolutePath()); |
| | | }else{ |
| | | //如果是目录的情况 |
| | | //创建一个File数组来存储当前目录下所有文件和目录的绝对路径 |
| | | File[] files = file.listFiles(); |
| | | //循环遍历files |
| | | for (File fileTemp : files){ |
| | | //子级是目录 |
| | | if (fileTemp.isDirectory()){ |
| | | //递归再次进行判断 |
| | | getStaticFilePathII(fileTemp, list); |
| | | }else{ |
| | | //子级是文件 |
| | | String absolutePath = fileTemp.getAbsolutePath(); |
| | | list.add(absolutePath); |
| | | //System.out.println(temp + "文件 :" + fileTemp.getName() + "\t"); |
| | | } |
| | | } |
| | | } |
| | | return list; |
| | | } |
| | | |
| | | public static Boolean deleteFile(File file) { |
| | | //判断文件不为null或文件目录存在 |
| | | if (file == null || !file.exists()) { |
| | |
| | | file.delete(); |
| | | return true; |
| | | } |
| | | |
| | | public static void download(HttpServletResponse resp,String inFilePath,String outFileFullName){ |
| | | try { |
| | | // 转码防止乱码 |
| | | //resp.addHeader("Content-Disposition", "attachment;filename=" + new String(softwareName.getBytes("UTF-8"), "ISO8859-1")); |
| | | resp.setHeader("Content-Disposition", "attachment;filename=" + URLEncoder.encode ( outFileFullName, "utf-8")); |
| | | OutputStream out = resp.getOutputStream(); |
| | | FileInputStream in = new FileInputStream(inFilePath); |
| | | int len=0; |
| | | byte[] buffer =new byte[1024]; |
| | | //7. 将缓冲区中的数据输出 |
| | | while ((len=in.read(buffer))>0){ |
| | | out.write(buffer,0,len); |
| | | } |
| | | in.close(); |
| | | out.close(); |
| | | } catch (FileNotFoundException | UnsupportedEncodingException e) { |
| | | e.printStackTrace(); |
| | | } catch (IOException e) { |
| | | e.printStackTrace(); |
| | | } |
| | | } |
| | | |
| | | public static String saveFile(MultipartFile multipartFile,String fileName) throws IOException { |
| | | String rootFile = CommonUtil.getRootFile(); |
| | | |
| | | String filePath = rootFile + fileName; |
| | | File file = new File(filePath); |
| | | File parentFile = file.getParentFile(); |
| | | if(!parentFile.exists()){ |
| | | parentFile.mkdirs(); |
| | | } |
| | | //存储 |
| | | multipartFile.transferTo(file); |
| | | return "pis_file"+fileName; |
| | | } |
| | | |
| | | /** |
| | | * 复制文件夹内的所有文件到另一个文件夹 |
| | | */ |
| | | public static void copyDirectory(File source, File destination) { |
| | | if (source.isDirectory()) { |
| | | if (!destination.exists()) { |
| | | destination.mkdir(); |
| | | } |
| | | for (File file : source.listFiles()) { |
| | | copyDirectory(file, new File(destination, file.getName())); |
| | | } |
| | | } else { |
| | | try (FileInputStream inputStream = new FileInputStream(source); |
| | | FileOutputStream outputStream = new FileOutputStream(destination)) { |
| | | byte[] buffer = new byte[1024]; |
| | | int length; |
| | | while ((length = inputStream.read(buffer)) > 0) { |
| | | outputStream.write(buffer, 0, length); |
| | | } |
| | | } catch (IOException e) { |
| | | e.printStackTrace(); |
| | | } |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 解压N层 |
| | | * @param compressedFileUrl doc_file/xxx/xxx.zip 或者 rar |
| | | * @return |
| | | */ |
| | | public static List<String> decompress(String compressedFileUrl) throws ArchiveException, IOException, InterruptedException { |
| | | List<Object> resList = decompressOne(compressedFileUrl); |
| | | File outputFolderFile = (File) resList.get(0); |
| | | List<String> fileList = (List<String>) resList.get(1); |
| | | boolean existCompressedFile = false; |
| | | int checkDecompress = 0; |
| | | //遍历文件列表,判断是否存在压缩文件 |
| | | for(String tempFileName:fileList){ |
| | | if(tempFileName.endsWith("zip") || tempFileName.endsWith("rar")){ |
| | | //存在压缩文件,解压一次 |
| | | decompressOne(tempFileName); |
| | | File file = new File(tempFileName); |
| | | //解除文件占用并删除文件 |
| | | //boolean delete = file.delete(); |
| | | Files.delete(file.toPath()); |
| | | existCompressedFile = true; |
| | | } |
| | | } |
| | | //如果存在压缩文件并已解压,则需要检查一次是否还有压缩文件 |
| | | if(existCompressedFile){ |
| | | checkDecompress ++; |
| | | } |
| | | for (int i = 0; i < checkDecompress; i++) { |
| | | decompress(compressedFileUrl); |
| | | } |
| | | |
| | | List<String> finalList = new LinkedList<>(); |
| | | getStaticFilePathII(outputFolderFile,finalList); |
| | | return finalList; |
| | | } |
| | | |
| | | /** |
| | | * 解压一层 |
| | | * @param compressedFileUrl doc_file/xxx/xxx.zip 或者 rar |
| | | * @return |
| | | */ |
| | | public static List<Object> decompressOne(String compressedFileUrl) throws IOException, ArchiveException, InterruptedException { |
| | | List<Object> resList = new LinkedList<>(); |
| | | String projectDir = CommonUtil.getProjectDir() + File.separator; |
| | | String fullFilePath; |
| | | String separator = File.separator; |
| | | String outputFolderSuffix; |
| | | if(compressedFileUrl.startsWith(projectDir)) { // 非第一层解压,已经是全路径 |
| | | fullFilePath = compressedFileUrl; |
| | | compressedFileUrl = compressedFileUrl.substring(compressedFileUrl.indexOf("decompress")+11); |
| | | //outputFolderSuffix = compressedFileUrl.substring(0,compressedFileUrl.lastIndexOf(separator)) + separator + "decompress_" + compressedFileUrl.substring(compressedFileUrl.lastIndexOf(separator)+1); |
| | | outputFolderSuffix = compressedFileUrl +"_decompress"; |
| | | }else{ //第一层解压 |
| | | fullFilePath = projectDir + compressedFileUrl; |
| | | outputFolderSuffix = compressedFileUrl.replace(separator, "@"); |
| | | } |
| | | File file = new File(fullFilePath); |
| | | |
| | | |
| | | String outputFolder = CommonUtil.getRootFile() + separator + "decompress" + separator + outputFolderSuffix; |
| | | File outputFolderFile = new File(outputFolder); |
| | | if(!outputFolderFile.exists()){ |
| | | outputFolderFile.mkdirs(); |
| | | if(compressedFileUrl.endsWith("zip")){ |
| | | decompressZip(file, outputFolder); |
| | | }else { //rar |
| | | decompressRar(file, outputFolder); |
| | | } |
| | | } |
| | | //返回文件夹所有文件 |
| | | LinkedList<String> list = new LinkedList<>(); |
| | | getStaticFilePathII(outputFolderFile,list); |
| | | resList.add(outputFolderFile); |
| | | resList.add(list); |
| | | return resList; |
| | | } |
| | | |
| | | private static void decompressZip(File file, String outputFolder) throws IOException, ArchiveException { |
| | | ArchiveInputStream ais = new ArchiveStreamFactory("GBK").createArchiveInputStream("zip", new FileInputStream(file)); |
| | | ArchiveEntry entry; |
| | | while ((entry = ais.getNextEntry()) != null) { |
| | | if (!ais.canReadEntryData(entry) || entry.isDirectory()) { |
| | | continue; |
| | | } |
| | | byte[] buffer = new byte[4096]; |
| | | int bytesRead; |
| | | String entryName = entry.getName(); |
| | | //if(entryName.contains(File.separator)){ |
| | | if(entryName.contains("/")){ |
| | | String entryNameDir = entryName.substring(0, entryName.lastIndexOf("/")); |
| | | String entryDirStr = outputFolder + File.separator + entryNameDir; |
| | | File entryDir = new File(entryDirStr); |
| | | if(!entryDir.exists()){ |
| | | entryDir.mkdirs(); |
| | | } |
| | | } |
| | | |
| | | OutputStream outputStream = new FileOutputStream(new File(outputFolder + File.separator + entryName)); |
| | | |
| | | while ((bytesRead = ais.read(buffer)) > -1) { |
| | | outputStream.write(buffer, 0, bytesRead); |
| | | } |
| | | |
| | | //关流 |
| | | outputStream.close(); |
| | | } |
| | | //关流 |
| | | ais.close(); |
| | | |
| | | } |
| | | private static void decompressRar(File file, String outputFolder) throws IOException, InterruptedException { |
| | | String winrarPath = "C:\\Program Files\\WinRAR\\WinRAR.exe"; |
| | | String cmd = winrarPath + " X " + file + " " + outputFolder; |
| | | Process proc = Runtime.getRuntime().exec(cmd); |
| | | proc.waitFor(); |
| | | } |
| | | |
| | | //读取文件夹下的所有文件(不读取文件夹内的文件) |
| | | public static List getFileNameWithOutDirectory(String filePath) { |
| | | File folder = new File(filePath); // 文件夹路径 |
| | | List nameList=new ArrayList(); |
| | | File[] listOfFiles = folder.listFiles(); |
| | | if (listOfFiles != null) { |
| | | for (File file : listOfFiles) { |
| | | if (file.isFile()) { |
| | | nameList.add(file.getName()); |
| | | } |
| | | } |
| | | } |
| | | return nameList; |
| | | } |
| | | |
| | | //private static void decompressRar(File file, String outputFolder) throws IOException, RarException { |
| | | // Archive archive = new Archive(file); |
| | | // FileHeader fileHeader = archive.nextFileHeader(); |
| | | // if (fileHeader != null) { |
| | | // while (fileHeader != null) { |
| | | // if (fileHeader.isDirectory()) { |
| | | // fileHeader = archive.nextFileHeader(); |
| | | // continue; |
| | | // } |
| | | // String tempFilePath = fileHeader.getFileName(); |
| | | // File out = new File(outputFolder + File.separator + tempFilePath); |
| | | // if (!out.exists()) { |
| | | // if (!out.getParentFile().exists()) { |
| | | // out.getParentFile().mkdirs(); |
| | | // } |
| | | // out.createNewFile(); |
| | | // } |
| | | // FileOutputStream os = new FileOutputStream(out); |
| | | // archive.extractFile(fileHeader, os); |
| | | // os.close(); |
| | | // fileHeader = archive.nextFileHeader(); |
| | | // } |
| | | // } |
| | | // archive.close(); |
| | | // |
| | | //} |
| | | |
| | | public static void main(String[] args) { |
| | | //File file = new File("C:\\Users\\29550\\Desktop\\AppScan10.rar"); |
| | | File file = new File("C:\\code\\web\\CadDrawManager\\target\\doc_file\\decompress\\doc_file@product@FBS-9600-GDPDX-XS1-DC220V-JH@standard@3@3++.rar"); |
| | | if(file.exists()) { |
| | | boolean delete = file.delete(); |
| | | System.out.println(delete); |
| | | } |
| | | } |
| | | } |
| | |
| | | } |
| | | } |
| | | return resultMap; |
| | | |
| | | } |
| | | } |
New file |
| | |
| | | package com.whyc.util; |
| | | |
| | | public class ServletUtils { |
| | | public static boolean isNotNull(Object obj){ |
| | | boolean flag=false; |
| | | if(obj!=null){ |
| | | if(obj.toString().trim().length()>0){ |
| | | flag=true; |
| | | } |
| | | } |
| | | return flag; |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | package com.whyc.util; |
| | | |
| | | import com.github.pagehelper.PageInfo; |
| | | import com.whyc.dto.AlmHis.BattAlarmRes; |
| | | import com.whyc.dto.AlmHis.BattAlmPar; |
| | | import com.whyc.dto.AlmHis.DevAlmPar; |
| | | import com.whyc.dto.AlmHis.PwrAlmPar; |
| | | import com.whyc.factory.ThreadPoolExecutorFactory; |
| | | import com.whyc.mapper.CommonMapper; |
| | | import com.whyc.pojo.db_alarm.BattalarmDataHistory; |
| | | import com.whyc.pojo.db_alarm.DevalarmDataHistory; |
| | | import com.whyc.pojo.db_pwrdev_alarm.PwrdevAlarmHistory; |
| | | import com.whyc.service.SubTablePageInfoService; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.text.ParseException; |
| | | import java.util.*; |
| | | import java.util.concurrent.CountDownLatch; |
| | | import java.util.concurrent.ThreadPoolExecutor; |
| | | import java.util.regex.Pattern; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | | * 数据量极大的表,按照年份分表,分页查询时获取数据 |
| | | */ |
| | | @Component |
| | | public class SubTablePageInfoUtils { |
| | | |
| | | @Resource |
| | | private CommonMapper commonMapper; |
| | | |
| | | @Autowired |
| | | private SubTablePageInfoService subService; |
| | | |
| | | /**按年份表分页查询*/ |
| | | public PageInfo<Object> getPageInfo(int pageNum,int pageSize, |
| | | Date startTime,Date endTime, |
| | | String dbName,String tablePrefix, |
| | | Object pojo) throws ParseException { |
| | | Map<String, List<Date>> queryTimeForSubTables = DateUtil.getQueryTimeForSubTablesDesc(startTime, endTime); |
| | | //查询分表是否存在,存在则查询结果 |
| | | Map<String,Integer> queryCountMap = new LinkedHashMap<>(); |
| | | Set<String> tableYearKeySet = queryTimeForSubTables.keySet(); |
| | | for (String tableYear : tableYearKeySet) { |
| | | List<Date> queryTime = queryTimeForSubTables.get(tableYear); |
| | | String tableName=tablePrefix+"_"+tableYear;; |
| | | String existTableName = commonMapper.existTable(dbName, tableName); |
| | | if(existTableName == null){ |
| | | continue; |
| | | } |
| | | //====== 根据不同类型类型对象对应调整 ====== |
| | | if(pojo instanceof PwrAlmPar) { |
| | | PwrAlmPar param = (PwrAlmPar) pojo; |
| | | param.setAlmStartTime(queryTime.get(0)); |
| | | param.setAlmEndTime(queryTime.get(1)); |
| | | param.setRecordYear(tableName); |
| | | int currentCount = subService.getPwrAlmHisCount(param); |
| | | queryCountMap.put(tableYear, currentCount); |
| | | } |
| | | } |
| | | |
| | | //分页信息 |
| | | //确认总页数,总记录数 |
| | | PageInfo<Object> pageInfo = new PageInfo<>(); |
| | | |
| | | int total = 0; |
| | | Set<String> queryKeySet = queryCountMap.keySet(); |
| | | for (String queryKey : queryKeySet) { |
| | | int size = queryCountMap.get(queryKey); |
| | | total+=size; |
| | | } |
| | | int pages = (int) Math.ceil(Float.parseFloat(String.valueOf(total))/pageSize); |
| | | pageInfo.setTotal(total); |
| | | pageInfo.setPages(pages); |
| | | pageInfo.setPageNum(pageNum); |
| | | pageInfo.setPageSize(pageSize); |
| | | //根据当前页所需记录,查询当前页记录 |
| | | int startNum = (pageNum-1)*pageSize+1; |
| | | int endNum = pageNum*pageSize; |
| | | |
| | | //最后一个算法:上面不应该先查询所有记录,应该取count. 这后面定位到哪个表或哪几张表后,采取limit获取当前页记录数; |
| | | //格式:{表名,[limit 2,20]} |
| | | Map<String,List<Integer>> tableAndLimitMap = MathUtil.getQueryTableAndLimit(startNum,endNum,pageSize,queryCountMap); |
| | | Set<String> keySet = tableAndLimitMap.keySet(); |
| | | List<Object> dataList = new LinkedList<>(); |
| | | for (String key : keySet) { |
| | | List<Date> queryTime = queryTimeForSubTables.get(key); |
| | | //====== 根据不同类型类型对象对应调整 ====== |
| | | String recordYear = key.equals("default") ? tablePrefix : tablePrefix + "_" + key; |
| | | |
| | | |
| | | if (pojo instanceof PwrAlmPar) { |
| | | PwrAlmPar data = (PwrAlmPar) pojo; |
| | | data.setAlmStartTime(queryTime.get(0)); |
| | | data.setAlmEndTime(queryTime.get(1)); |
| | | List<Integer> limitList = tableAndLimitMap.get(key); |
| | | data.setLimitStart(limitList.get(0)); |
| | | data.setLimitEnd(limitList.get(1)); |
| | | data.setRecordYear(recordYear); |
| | | List<PwrdevAlarmHistory> list= subService.getPwrAlmHisList(data); |
| | | dataList.addAll(list); |
| | | } |
| | | |
| | | } |
| | | pageInfo.setList(dataList); |
| | | return pageInfo; |
| | | } |
| | | /**按月分表,分页查询*/ |
| | | public PageInfo<Object> getPageInfoByMonthTable(int pageNum,int pageSize, |
| | | Date startTime,Date endTime, |
| | | String dbName,String tablePrefix, |
| | | Object pojo) throws ParseException, InterruptedException { |
| | | Map<String, List<Date>> queryTimeForSubTables = DateUtil.getQueryTimeForSubTablesByMonthDesc(startTime, endTime); |
| | | //查询分表是否存在,存在则查询结果 |
| | | Map<String,Integer> queryCountMap = new LinkedHashMap<>(); |
| | | Set<String> tableYearKeySet = queryTimeForSubTables.keySet(); |
| | | //优化1-查询所有的符合月份规则的表和主表 |
| | | List<String> tableNameListDB = getTableList(dbName, tablePrefix, tablePrefix + "(_[0-9]{4}_[0-9]{2})?"); |
| | | List<String> tableYearListInDB = new LinkedList<>(); //查询时间段内的年月分表集合且在数据库中存在 |
| | | //过滤掉时间段内数据库中不存在的年月分表 |
| | | for (String tableYear : tableYearKeySet) { |
| | | |
| | | String tableName; |
| | | if(!tableYear.equals("default")){ |
| | | //数值 |
| | | tableName = tablePrefix+"_"+tableYear; |
| | | //String existTableName = commonMapper.existTable(dbName, tableName); |
| | | if(!tableNameListDB.contains(tableName)){ //优化1-数据库中不存在,去除多次查表,一次查出 |
| | | continue; |
| | | } |
| | | } |
| | | tableYearListInDB.add(tableYear); |
| | | } |
| | | //查询年月分表的记录数 |
| | | //优化2:多线程读取 |
| | | ThreadPoolExecutor pool = ThreadPoolExecutorFactory.getPoolExecutor(); |
| | | CountDownLatch latch = new CountDownLatch(tableYearListInDB.size()); |
| | | for (String tableYear : tableYearListInDB) { |
| | | List<Date> queryTime = queryTimeForSubTables.get(tableYear); |
| | | String tableName; |
| | | if(!tableYear.equals("default")){ |
| | | //数值 |
| | | tableName = tablePrefix+"_"+tableYear; |
| | | }else{ |
| | | tableName = tablePrefix; |
| | | } |
| | | pool.execute(()-> { |
| | | //====== 根据不同类型类型对象对应调整 ====== |
| | | if (pojo instanceof BattAlmPar) { //电池告警历史 |
| | | BattAlmPar param = new BattAlmPar(); |
| | | BeanUtils.copyProperties(pojo,param); |
| | | param.setAlmStartTime(queryTime.get(0)); |
| | | param.setAlmEndTime(queryTime.get(1)); |
| | | param.setRecordYear(tableName); |
| | | int currentCount = subService.getBattAlmHisCount(param); |
| | | queryCountMap.put(tableYear, currentCount); |
| | | } |
| | | else if (pojo instanceof DevAlmPar) { |
| | | DevAlmPar param = new DevAlmPar(); |
| | | BeanUtils.copyProperties(pojo,param); |
| | | param.setAlmStartTime(queryTime.get(0)); |
| | | param.setAlmEndTime(queryTime.get(1)); |
| | | param.setRecordYear(tableName); |
| | | int currentCount = subService.getDevAlmHisCount(param); |
| | | queryCountMap.put(tableYear, currentCount); |
| | | } |
| | | |
| | | latch.countDown(); |
| | | }); |
| | | } |
| | | latch.await(); |
| | | //因为多线程后无序,需要重排序 |
| | | List<String> keySetDesc = queryCountMap.keySet().stream().sorted(Comparator.reverseOrder()).collect(Collectors.toList()); |
| | | Map<String,Integer> queryCountMapDesc = new LinkedHashMap<>(); |
| | | for (String key : keySetDesc) { |
| | | Integer count = queryCountMap.get(key); |
| | | queryCountMapDesc.put(key,count); |
| | | } |
| | | //分页信息 |
| | | //确认总页数,总记录数 |
| | | PageInfo<Object> pageInfo = new PageInfo<>(); |
| | | |
| | | int total = 0; |
| | | Set<String> queryKeySet = queryCountMap.keySet(); |
| | | for (String queryKey : queryKeySet) { |
| | | int size = queryCountMap.get(queryKey); |
| | | total+=size; |
| | | } |
| | | int pages = (int) Math.ceil(Float.parseFloat(String.valueOf(total))/pageSize); |
| | | pageInfo.setTotal(total); |
| | | pageInfo.setPages(pages); |
| | | pageInfo.setPageNum(pageNum); |
| | | pageInfo.setPageSize(pageSize); |
| | | //根据当前页所需记录,查询当前页记录 |
| | | int startNum = (pageNum-1)*pageSize+1; |
| | | int endNum = pageNum*pageSize; |
| | | |
| | | //最后一个算法:上面不应该先查询所有记录,应该取count. 这后面定位到哪个表或哪几张表后,采取limit获取当前页记录数; |
| | | //格式:{表名,[limit 2,20]} |
| | | Map<String,List<Integer>> tableAndLimitMap = MathUtil.getQueryTableAndLimit(startNum,endNum,pageSize,queryCountMapDesc); |
| | | Set<String> keySet = tableAndLimitMap.keySet(); |
| | | List<Object> dataList = new LinkedList<>(); |
| | | for (String key : keySet) { |
| | | List<Date> queryTime = queryTimeForSubTables.get(key); |
| | | //====== 根据不同类型类型对象对应调整 ====== |
| | | String recordYear = key.equals("default") ? tablePrefix : tablePrefix + "_" + key; |
| | | if (pojo instanceof BattAlmPar) { |
| | | BattAlmPar data = (BattAlmPar) pojo; |
| | | data.setAlmStartTime(queryTime.get(0)); |
| | | data.setAlmEndTime(queryTime.get(1)); |
| | | |
| | | List<Integer> limitList = tableAndLimitMap.get(key); |
| | | data.setLimitStart(limitList.get(0)); |
| | | data.setLimitEnd(limitList.get(1)); |
| | | data.setRecordYear(recordYear); |
| | | List<BattalarmDataHistory> list = subService.getBattAlmHisList(data); |
| | | dataList.addAll(list); |
| | | } |
| | | else if (pojo instanceof DevAlmPar) { |
| | | DevAlmPar data = (DevAlmPar) pojo; |
| | | data.setAlmStartTime(queryTime.get(0)); |
| | | data.setAlmEndTime(queryTime.get(1)); |
| | | |
| | | List<Integer> limitList = tableAndLimitMap.get(key); |
| | | data.setLimitStart(limitList.get(0)); |
| | | data.setLimitEnd(limitList.get(1)); |
| | | data.setRecordYear(recordYear); |
| | | List<DevalarmDataHistory> list = subService.getDevAlmHisList(data); |
| | | dataList.addAll(list); |
| | | } |
| | | |
| | | |
| | | } |
| | | pageInfo.setList(dataList); |
| | | return pageInfo; |
| | | } |
| | | |
| | | /**查询是否包含特定规则的表,存在,则返回表名*/ |
| | | public List<String> getTableList(String dbName,String tableLike,String regex){ |
| | | List<String> resultTableList = new LinkedList<>(); |
| | | List<String> tableList = commonMapper.getTableListLike(dbName,tableLike); |
| | | for (String tableName : tableList) { |
| | | boolean matches = Pattern.matches(regex, tableName); |
| | | if(matches){ |
| | | resultTableList.add(tableName); |
| | | } |
| | | } |
| | | return resultTableList; |
| | | } |
| | | |
| | | /* *//**所有记录分为四级查询个数*//* |
| | | public List<Integer> getLevelList(int uId,String dbName,String tableLike,String regex,List<Integer> almTypes ){ |
| | | List<Integer> result = new LinkedList<>(); |
| | | List<String> tableList = getTableList(dbName, tableLike, regex); |
| | | List<Integer> levelList = new LinkedList(); |
| | | for (String tableName : tableList) { |
| | | List<BattalarmDataHistory> levelInfoSubList; |
| | | List<Integer> levelSubList; |
| | | if(tableLike.equals("tb_battalarm_data_history")) { |
| | | //levelInfoSubList = battAlarmDataHistoryMapper.getLevelSubList(uId, tableName); |
| | | levelInfoSubList = subService.getLevelSubList_batt(uId, tableName); |
| | | } |
| | | else if(tableLike.equals("tb_devalarm_data_history")){ |
| | | //levelInfoSubList = devAlarmDataHistoryMapper.getLevelSubList(uId, tableName); |
| | | levelInfoSubList = subService.getLevelSubList_dev(uId, tableName); |
| | | } |
| | | else{ |
| | | //levelInfoSubList = powerAlarmHistoryMapper.getLevelSubList(uId, tableName,almTypes); |
| | | levelInfoSubList = subService.getLevelSubList_pwr(uId, tableName,almTypes); |
| | | } |
| | | levelSubList = levelInfoSubList.stream().map(BattalarmDataHistory::getAlmLevel).collect(Collectors.toList()); |
| | | levelList.addAll(levelSubList); |
| | | } |
| | | //分为四级查询个数 |
| | | Map<Integer, List<Integer>> levelMap = levelList.stream().collect(Collectors.groupingBy(Integer::intValue)); |
| | | Set<Integer> levelSet = levelMap.keySet(); |
| | | List<Integer> listOfLevelSet = new LinkedList(); |
| | | //补齐1,2,3,4四级 |
| | | listOfLevelSet.add(1); |
| | | listOfLevelSet.add(2); |
| | | listOfLevelSet.add(3); |
| | | listOfLevelSet.add(4); |
| | | if(!levelSet.contains(1)){ |
| | | levelMap.put(1,new LinkedList<>()); |
| | | } |
| | | if(!levelSet.contains(2)){ |
| | | levelMap.put(2,new LinkedList<>()); |
| | | } |
| | | if(!levelSet.contains(3)){ |
| | | levelMap.put(3,new LinkedList<>()); |
| | | } |
| | | if(!levelSet.contains(4)){ |
| | | levelMap.put(4,new LinkedList<>()); |
| | | } |
| | | //待测试 |
| | | for (Integer level : listOfLevelSet) { |
| | | result.add(levelMap.get(level).size()); |
| | | } |
| | | return result; |
| | | } |
| | | */ |
| | | public static void main(String[] args) { |
| | | //String regex = "tb_battalarm_data_history_?[0-9]*"; |
| | | String regex = "tb_battalarm_data_history(_[0-9]{4}_[0-9]{2})?"; |
| | | //String table = "tb_battalarm_data_history"; |
| | | String table = "tb_battalarm_data_history_0222_04"; |
| | | System.out.println(Pattern.matches(regex,table)); |
| | | } |
| | | } |
New file |
| | |
| | | package com.whyc.webSocket; |
| | | |
| | | import com.whyc.config.WebSocketConfig; |
| | | import com.whyc.dto.Real.AlmDto; |
| | | import com.whyc.dto.Response; |
| | | import com.whyc.pojo.db_user.User; |
| | | import com.whyc.service.BattalarmDataService; |
| | | import com.whyc.util.JsonUtil; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | import javax.servlet.http.HttpSession; |
| | | import javax.websocket.*; |
| | | import javax.websocket.server.ServerEndpoint; |
| | | import java.util.HashMap; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * 实时 |
| | | */ |
| | | @Component |
| | | @ServerEndpoint(value = "/battAlmReal",encoders = WebSocketEncoder.class,configurator = WebSocketConfig.class) |
| | | public class BattAlmRealSocket { |
| | | private Session session; |
| | | |
| | | private Thread thread; |
| | | |
| | | private static BattalarmDataService service; |
| | | |
| | | private static HttpSession httpSession; |
| | | |
| | | private volatile boolean runFlag = true; |
| | | |
| | | private volatile Map<String, Thread> threadMap = new HashMap<>(); |
| | | |
| | | private volatile Map<Long,Boolean> threadFlagMap = new HashMap<>(); |
| | | |
| | | @Autowired |
| | | public void setBattalarmDataService(BattalarmDataService service) { |
| | | BattAlmRealSocket.service = service; |
| | | } |
| | | |
| | | |
| | | @OnOpen |
| | | public void onOpen(Session session, EndpointConfig config) { |
| | | this.session = session; |
| | | this.httpSession = (HttpSession) config.getUserProperties().get("httpSession"); |
| | | } |
| | | @OnMessage |
| | | public void onMessage(Session session, String message) { |
| | | AlmDto dto= JsonUtil.getGson().fromJson(message,AlmDto.class); |
| | | if(httpSession!=null){ |
| | | User user = (User) httpSession.getAttribute("user"); |
| | | dto.setUid(user.getId()); |
| | | }else{ |
| | | dto.setUid(1005); |
| | | } |
| | | thread = new Thread("Thread_realLockSocket") { |
| | | @Override |
| | | public void run() { |
| | | while (runFlag && !isInterrupted()) { |
| | | Thread thread = currentThread(); |
| | | threadFlagMap.put(thread.getId(), true); |
| | | try { |
| | | Response res= service.getBattAlmReal(dto); |
| | | if (session.isOpen()) { |
| | | //推送信息 |
| | | synchronized (session) { |
| | | session.getBasicRemote().sendObject(res); |
| | | } |
| | | threadFlagMap.put(thread.getId(), false); |
| | | } |
| | | sleep(4000); |
| | | } catch (Exception e) { |
| | | interrupt(); |
| | | } |
| | | } |
| | | } |
| | | }; |
| | | thread.start(); |
| | | threadFlagMap.put(thread.getId(),true); |
| | | //停止老的socket线程 |
| | | Thread threadBefore = threadMap.get(session.getId()); |
| | | if(threadBefore !=null && threadBefore.isAlive()){ |
| | | while (threadFlagMap.get(threadBefore.getId())){ |
| | | } |
| | | threadBefore.interrupt(); |
| | | } |
| | | //将线程存储,便于调用定位 |
| | | threadMap.put(session.getId(), this.thread); |
| | | } |
| | | @OnClose |
| | | public void onClose(CloseReason closeReason){ |
| | | System.err.println("closeReason = " + closeReason); |
| | | runFlag = false; |
| | | if (thread != null && thread.isAlive()) { |
| | | thread.interrupt(); |
| | | } |
| | | threadMap.remove(session.getId()); |
| | | } |
| | | |
| | | @OnError |
| | | public void onError(Throwable error) { |
| | | error.printStackTrace(); |
| | | if (thread != null && thread.isAlive()) { |
| | | thread.interrupt(); |
| | | } |
| | | threadMap.remove(session.getId()); |
| | | } |
| | | } |
New file |
| | |
| | | package com.whyc.webSocket; |
| | | |
| | | import com.whyc.config.WebSocketConfig; |
| | | import com.whyc.dto.Real.AlmDto; |
| | | import com.whyc.dto.Response; |
| | | import com.whyc.pojo.db_user.User; |
| | | import com.whyc.service.BattalarmDataService; |
| | | import com.whyc.service.DevalarmDataService; |
| | | import com.whyc.util.JsonUtil; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | import javax.servlet.http.HttpSession; |
| | | import javax.websocket.*; |
| | | import javax.websocket.server.ServerEndpoint; |
| | | import java.util.HashMap; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * 实时 |
| | | */ |
| | | @Component |
| | | @ServerEndpoint(value = "/devAlmReal",encoders = WebSocketEncoder.class,configurator = WebSocketConfig.class) |
| | | public class DevAlmRealSocket { |
| | | private Session session; |
| | | |
| | | private Thread thread; |
| | | |
| | | private static DevalarmDataService service; |
| | | |
| | | private static HttpSession httpSession; |
| | | |
| | | private volatile boolean runFlag = true; |
| | | |
| | | private volatile Map<String, Thread> threadMap = new HashMap<>(); |
| | | |
| | | private volatile Map<Long,Boolean> threadFlagMap = new HashMap<>(); |
| | | |
| | | @Autowired |
| | | public void setDevalarmDataService(DevalarmDataService service) { |
| | | DevAlmRealSocket.service = service; |
| | | } |
| | | |
| | | |
| | | @OnOpen |
| | | public void onOpen(Session session, EndpointConfig config) { |
| | | this.session = session; |
| | | this.httpSession = (HttpSession) config.getUserProperties().get("httpSession"); |
| | | } |
| | | @OnMessage |
| | | public void onMessage(Session session, String message) { |
| | | AlmDto dto= JsonUtil.getGson().fromJson(message,AlmDto.class); |
| | | if(httpSession!=null){ |
| | | User user = (User) httpSession.getAttribute("user"); |
| | | dto.setUid(user.getId()); |
| | | }else{ |
| | | dto.setUid(1005); |
| | | } |
| | | thread = new Thread("Thread_realLockSocket") { |
| | | @Override |
| | | public void run() { |
| | | while (runFlag && !isInterrupted()) { |
| | | Thread thread = currentThread(); |
| | | threadFlagMap.put(thread.getId(), true); |
| | | try { |
| | | Response res= service.getDevAlmReal(dto); |
| | | if (session.isOpen()) { |
| | | //推送信息 |
| | | synchronized (session) { |
| | | session.getBasicRemote().sendObject(res); |
| | | } |
| | | threadFlagMap.put(thread.getId(), false); |
| | | } |
| | | sleep(4000); |
| | | } catch (Exception e) { |
| | | interrupt(); |
| | | } |
| | | } |
| | | } |
| | | }; |
| | | thread.start(); |
| | | threadFlagMap.put(thread.getId(),true); |
| | | //停止老的socket线程 |
| | | Thread threadBefore = threadMap.get(session.getId()); |
| | | if(threadBefore !=null && threadBefore.isAlive()){ |
| | | while (threadFlagMap.get(threadBefore.getId())){ |
| | | } |
| | | threadBefore.interrupt(); |
| | | } |
| | | //将线程存储,便于调用定位 |
| | | threadMap.put(session.getId(), this.thread); |
| | | } |
| | | @OnClose |
| | | public void onClose(CloseReason closeReason){ |
| | | System.err.println("closeReason = " + closeReason); |
| | | runFlag = false; |
| | | if (thread != null && thread.isAlive()) { |
| | | thread.interrupt(); |
| | | } |
| | | threadMap.remove(session.getId()); |
| | | } |
| | | |
| | | @OnError |
| | | public void onError(Throwable error) { |
| | | error.printStackTrace(); |
| | | if (thread != null && thread.isAlive()) { |
| | | thread.interrupt(); |
| | | } |
| | | threadMap.remove(session.getId()); |
| | | } |
| | | } |
New file |
| | |
| | | package com.whyc.webSocket; |
| | | |
| | | import com.whyc.config.WebSocketConfig; |
| | | import com.whyc.dto.Real.AlmDto; |
| | | import com.whyc.dto.Response; |
| | | import com.whyc.pojo.db_user.User; |
| | | import com.whyc.service.DevalarmDataService; |
| | | import com.whyc.service.PwrdevAlarmService; |
| | | import com.whyc.util.JsonUtil; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | import javax.servlet.http.HttpSession; |
| | | import javax.websocket.*; |
| | | import javax.websocket.server.ServerEndpoint; |
| | | import java.util.HashMap; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * 实时 |
| | | */ |
| | | @Component |
| | | @ServerEndpoint(value = "/pwrAlmReal",encoders = WebSocketEncoder.class,configurator = WebSocketConfig.class) |
| | | public class PwrAlmRealSocket { |
| | | private Session session; |
| | | |
| | | private Thread thread; |
| | | |
| | | private static PwrdevAlarmService service; |
| | | |
| | | private static HttpSession httpSession; |
| | | |
| | | private volatile boolean runFlag = true; |
| | | |
| | | private volatile Map<String, Thread> threadMap = new HashMap<>(); |
| | | |
| | | private volatile Map<Long,Boolean> threadFlagMap = new HashMap<>(); |
| | | |
| | | @Autowired |
| | | public void setPwrdevAlarmService(PwrdevAlarmService service) { |
| | | PwrAlmRealSocket.service = service; |
| | | } |
| | | |
| | | |
| | | @OnOpen |
| | | public void onOpen(Session session, EndpointConfig config) { |
| | | this.session = session; |
| | | this.httpSession = (HttpSession) config.getUserProperties().get("httpSession"); |
| | | } |
| | | @OnMessage |
| | | public void onMessage(Session session, String message) { |
| | | AlmDto dto= JsonUtil.getGson().fromJson(message,AlmDto.class); |
| | | if(httpSession!=null){ |
| | | User user = (User) httpSession.getAttribute("user"); |
| | | dto.setUid(user.getId()); |
| | | }else{ |
| | | dto.setUid(1005); |
| | | } |
| | | thread = new Thread("Thread_realLockSocket") { |
| | | @Override |
| | | public void run() { |
| | | while (runFlag && !isInterrupted()) { |
| | | Thread thread = currentThread(); |
| | | threadFlagMap.put(thread.getId(), true); |
| | | try { |
| | | Response res= service.getPwrAlmReal(dto); |
| | | if (session.isOpen()) { |
| | | //推送信息 |
| | | synchronized (session) { |
| | | session.getBasicRemote().sendObject(res); |
| | | } |
| | | threadFlagMap.put(thread.getId(), false); |
| | | } |
| | | sleep(4000); |
| | | } catch (Exception e) { |
| | | interrupt(); |
| | | } |
| | | } |
| | | } |
| | | }; |
| | | thread.start(); |
| | | threadFlagMap.put(thread.getId(),true); |
| | | //停止老的socket线程 |
| | | Thread threadBefore = threadMap.get(session.getId()); |
| | | if(threadBefore !=null && threadBefore.isAlive()){ |
| | | while (threadFlagMap.get(threadBefore.getId())){ |
| | | } |
| | | threadBefore.interrupt(); |
| | | } |
| | | //将线程存储,便于调用定位 |
| | | threadMap.put(session.getId(), this.thread); |
| | | } |
| | | @OnClose |
| | | public void onClose(CloseReason closeReason){ |
| | | System.err.println("closeReason = " + closeReason); |
| | | runFlag = false; |
| | | if (thread != null && thread.isAlive()) { |
| | | thread.interrupt(); |
| | | } |
| | | threadMap.remove(session.getId()); |
| | | } |
| | | |
| | | @OnError |
| | | public void onError(Throwable error) { |
| | | error.printStackTrace(); |
| | | if (thread != null && thread.isAlive()) { |
| | | thread.interrupt(); |
| | | } |
| | | threadMap.remove(session.getId()); |
| | | } |
| | | } |
| | |
| | | package com.whyc.webSocket; |
| | | |
| | | import com.whyc.config.WebSocketConfig; |
| | | import com.whyc.constant.BattStateEnum; |
| | | import com.whyc.constant.DevStateEnum; |
| | | import com.whyc.constant.FailReasonEnum; |
| | | import com.whyc.constant.StopReasonEnum; |
| | | import com.whyc.dto.Real.SticRealRtdataDto; |
| | | import com.whyc.dto.Real.TopDto; |
| | | import com.whyc.dto.RealTimeDto; |
| | | import com.whyc.dto.Response; |
| | | import com.whyc.factory.BattCapFactory; |
| | | import com.whyc.pojo.db_batt_testdata.BattresdataInf; |
| | | import com.whyc.pojo.db_batt_testdata.BatttestdataInf; |
| | | import com.whyc.pojo.db_ram_db.BattRtdata; |
| | | import com.whyc.pojo.db_ram_db.BattRtstate; |
| | | import com.whyc.pojo.db_ram_db.DeviceState; |
| | | import com.whyc.pojo.db_ram_db.PwrdevAcdcdata; |
| | | import com.whyc.pojo.db_station.BattInf; |
| | | import com.whyc.pojo.db_station.PowerInf; |
| | | import com.whyc.pojo.db_station.StationInf; |
| | | import com.whyc.pojo.db_user.User; |
| | | import com.whyc.service.*; |
| | | import com.whyc.util.ActionUtil; |
| | | import com.whyc.util.ThreadLocalUtil; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | import javax.servlet.http.HttpSession; |
| | | import javax.websocket.*; |
| | | import javax.websocket.server.ServerEndpoint; |
| | | import java.util.ArrayList; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | @Component |
| | |
| | | private Session session; |
| | | |
| | | private Thread thread; |
| | | //实时数据 |
| | | private static BattRtstateService battRtstateService; |
| | | |
| | | //private static LockAlarmService almService; |
| | | private static DeviceStateService deviceStateService; |
| | | |
| | | private static PwrdevAcdcdataService pwrdevAcdcdataService; |
| | | |
| | | //实时告警 |
| | | private static BattalarmDataService battalarmDataService; |
| | | |
| | | private static DevalarmDataService devalarmDataService; |
| | | |
| | | private static PwrdevAlarmService pwrdevAlarmService; |
| | | |
| | | //放电记录 |
| | | private static BatttestdataInfService batttestdataInfService; |
| | | |
| | | //电池组信息 |
| | | private static BattInfService battInfService; |
| | | |
| | | //机房信息 |
| | | private static StationInfService stationInfService; |
| | | |
| | | //电源信息 |
| | | private static PowerInfService powerInfService; |
| | | |
| | | //单体信息 |
| | | private static BattRtdataService rtdataService; |
| | | |
| | | //内阻测试信息 |
| | | private static BattresdataInfService battresdataInfService; |
| | | |
| | | |
| | | private volatile boolean runFlag = true; |
| | |
| | | |
| | | private volatile Map<Long,Boolean> threadFlagMap = new HashMap<>(); |
| | | |
| | | /*@Autowired |
| | | public void setLockAlarmService(LockAlarmService almService) { |
| | | LockAlmRtSocket.almService = almService; |
| | | }*/ |
| | | @Autowired |
| | | public void setBattRtstateService(BattRtstateService battRtstateService) { |
| | | RealTimeSocket.battRtstateService = battRtstateService; |
| | | } |
| | | |
| | | @Autowired |
| | | public void setDeviceStateService(DeviceStateService deviceStateService) { |
| | | RealTimeSocket.deviceStateService = deviceStateService; |
| | | } |
| | | |
| | | @Autowired |
| | | public void setPwrdevAcdcdataService(PwrdevAcdcdataService pwrdevAcdcdataService) { |
| | | RealTimeSocket.pwrdevAcdcdataService = pwrdevAcdcdataService; |
| | | } |
| | | |
| | | @Autowired |
| | | public void setBattalarmDataService(BattalarmDataService battalarmDataService) { |
| | | RealTimeSocket.battalarmDataService = battalarmDataService; |
| | | } |
| | | |
| | | @Autowired |
| | | public void setDevalarmDataService(DevalarmDataService devalarmDataService) { |
| | | RealTimeSocket.devalarmDataService = devalarmDataService; |
| | | } |
| | | |
| | | @Autowired |
| | | public void setPwrdevAlarmService(PwrdevAlarmService pwrdevAlarmService) { |
| | | RealTimeSocket.pwrdevAlarmService = pwrdevAlarmService; |
| | | } |
| | | |
| | | @Autowired |
| | | public void setBatttestdataInfService(BatttestdataInfService batttestdataInfService) { |
| | | RealTimeSocket.batttestdataInfService = batttestdataInfService; |
| | | } |
| | | |
| | | @Autowired |
| | | public void setBattInfService(BattInfService battInfService) { |
| | | RealTimeSocket.battInfService = battInfService; |
| | | } |
| | | |
| | | @Autowired |
| | | public void setStationInfService(StationInfService stationInfService) { |
| | | RealTimeSocket.stationInfService = stationInfService; |
| | | } |
| | | |
| | | @Autowired |
| | | public void setPowerInfService(PowerInfService powerInfService) { |
| | | RealTimeSocket.powerInfService = powerInfService; |
| | | } |
| | | |
| | | @Autowired |
| | | public void setBattRtdataService(BattRtdataService rtdataService) { |
| | | RealTimeSocket.rtdataService = rtdataService; |
| | | } |
| | | |
| | | @Autowired |
| | | public void setBattresdataInfService(BattresdataInfService battresdataInfService) { |
| | | RealTimeSocket.battresdataInfService = battresdataInfService; |
| | | } |
| | | |
| | | |
| | | |
| | | @OnOpen |
| | |
| | | if (session.isOpen()) { |
| | | //推送信息 |
| | | synchronized (session) { |
| | | session.getBasicRemote().sendObject(new Response<>().set(1,map)); |
| | | session.getBasicRemote().sendObject(new Response<>().setII(1,true,map,"实时页面数据推送")); |
| | | } |
| | | threadFlagMap.put(thread.getId(), false); |
| | | } |
| | |
| | | } |
| | | //获取头部信息 |
| | | private Response getTop(RealTimeDto realDto) { |
| | | return new Response().set(1); |
| | | TopDto topDto = new TopDto(); |
| | | try { |
| | | //实时获取电池组信息 |
| | | BattRtstate battRtstate = battRtstateService.getBattRealInfo(realDto.getBattgroupId()); |
| | | if (battRtstate != null) { |
| | | topDto.setBattState(battRtstate.getBattState()); |
| | | topDto.setBattStateName(BattStateEnum.getValue(battRtstate.getBattState())); |
| | | topDto.setVbusVol(battRtstate.getVbusVol()); |
| | | topDto.setOnlineVol(battRtstate.getOnlineVol()); |
| | | topDto.setRecordtime(ThreadLocalUtil.format(battRtstate.getRecDatetime(),1)); |
| | | } |
| | | //实时获取电池组信息 |
| | | BattInf binf=battInfService.getBinfByBattgroupId(realDto.getBattgroupId()); |
| | | if(binf!=null){ |
| | | topDto.setBattGroupName(binf.getBattgroupName()); |
| | | topDto.setDevName(binf.getDevName()); |
| | | } |
| | | //获取机房信息 |
| | | StationInf stationInf = stationInfService.getStationInfById(binf.getStationId()); |
| | | if(stationInf!=null){ |
| | | topDto.setStationName(stationInf.getStationName()); |
| | | topDto.setProvice(stationInf.getProvice()); |
| | | topDto.setCity(stationInf.getCity()); |
| | | topDto.setCounty(stationInf.getCountry()); |
| | | topDto.setFullName(stationInf.getFullName()); |
| | | } |
| | | //获取电源信息 |
| | | PowerInf powerInf = powerInfService.getPowerInfById(binf.getPowerId()); |
| | | if(powerInf!=null){ |
| | | topDto.setPowerName(powerInf.getPowerName()); |
| | | } |
| | | //实时获取设备信息 |
| | | DeviceState deviceState = deviceStateService.getDevRealInfo(realDto.getDevId()); |
| | | if (deviceState != null) { |
| | | topDto.setDevState(deviceState.getDevWorkstate()); |
| | | topDto.setDevStateName(DevStateEnum.getValue(deviceState.getDevWorkstate())); |
| | | if (deviceState.getDevWorkstate() == DevStateEnum.DEVSTATE_2.getStateId()) {//核容放电 |
| | | topDto.setCaptestGroupvol(deviceState.getDevCaptestGroupvol()); |
| | | topDto.setCaptestCurr(deviceState.getDevCaptestCurr()); |
| | | topDto.setCaptestTimelong(deviceState.getDevCaptestTimelong()); |
| | | topDto.setCaptestCap(deviceState.getDevCaptestCap()); |
| | | //剩余容量和剩余时间计算 |
| | | Float restCap = batttestdataInfService.getLastTestDataRestCap(realDto.getBattgroupId()); |
| | | topDto.setRestCap(restCap); |
| | | //实时组端电流,剩余容量,标称容量 |
| | | if(battRtstate!=null){ |
| | | Float restTime= BattCapFactory.getTheoryTime(battRtstate.getLoadCurr(), restCap, binf.getMoncapstd()); |
| | | topDto.setRestTime(restTime); |
| | | } |
| | | } |
| | | |
| | | //获取一级未处理实时告警数 |
| | | Integer battALmNum = battalarmDataService.getBattAlmNum(realDto.getBattgroupId()); |
| | | topDto.setBattALmNum(battALmNum); |
| | | |
| | | Integer devALmNum = devalarmDataService.getDevAlmNum(realDto.getDevId()); |
| | | topDto.setDevALmNum(devALmNum); |
| | | |
| | | Integer pwrALmNum = pwrdevAlarmService.getPwrAlmNum(realDto.getPowerId()); |
| | | topDto.setPwrALmNum(pwrALmNum); |
| | | |
| | | //实时获取电源信息(是否存在电源告警信息) |
| | | //PwrdevAcdcdata pwrdevAcdcdata = pwrdevAcdcdataService.getPwrRealInfo(realDto.getPowerId()); |
| | | topDto.setPwrState((pwrALmNum > 0 ? 1 : 0)); |
| | | topDto.setPwrStateName((pwrALmNum > 0 ? "电源异常" : "电源正常")); |
| | | |
| | | Integer allALmNum = battALmNum + devALmNum + pwrALmNum; |
| | | topDto.setAllALmNum(allALmNum); |
| | | topDto.setSystemState((allALmNum > 0 ? 1 : 0)); |
| | | topDto.setSystemStateName((allALmNum > 0 ? "系统异常" : "系统正常")); |
| | | } |
| | | return new Response().setII(1, true, topDto, "实时页面头部数据推送"); |
| | | } catch (Exception e) { |
| | | return new Response().set(1, false, "实时页面头部数据推送"); |
| | | } |
| | | } |
| | | |
| | | //根据pageType获取返回界面 |
| | |
| | | } |
| | | //获取管理界面信息 |
| | | private Response getManagePage(RealTimeDto realDto) { |
| | | return new Response().set(1); |
| | | Map<String, Object> map=new HashMap<>(); |
| | | try { |
| | | StationInf sinf=stationInfService.getStationInfById(realDto.getStaitonId()); |
| | | map.put("sinf",sinf); |
| | | PowerInf pinf=powerInfService.getPowerInfById(realDto.getPowerId()); |
| | | map.put("pinf",pinf); |
| | | BattInf binf=battInfService.getBinfByBattgroupId(realDto.getBattgroupId()); |
| | | map.put("binf",binf); |
| | | map.put("pageType",realDto.getPageType()); |
| | | return new Response().setII(1,true,map,"管理界面信息推送"); |
| | | }catch (Exception e){ |
| | | return new Response().set(1,false,"管理界面信息推送"); |
| | | } |
| | | } |
| | | //获取自愈能力界面信息 |
| | | private Response getSelfPage(RealTimeDto realDto) { |
| | | return new Response().set(1); |
| | | Map<String, Object> map=new HashMap<>(); |
| | | map.put("pageType",realDto.getPageType()); |
| | | return new Response().setII(1,true,map,"自愈能力界面信息推送"); |
| | | } |
| | | //获取3D界面信息 |
| | | private Response get3DPage(RealTimeDto realDto) { |
| | | return new Response().set(1); |
| | | Map<String, Object> map=new HashMap<>(); |
| | | map.put("pageType",realDto.getPageType()); |
| | | return new Response().setII(1,true,map,"3D界面信息信息推送"); |
| | | } |
| | | //获取图片界面信息 |
| | | private Response getImgPage(RealTimeDto realDto) { |
| | | return new Response().set(1); |
| | | Map<String, Object> map=new HashMap<>(); |
| | | map.put("pageType",realDto.getPageType()); |
| | | return new Response().setII(1,true,map,"图片界面信息信息推送"); |
| | | } |
| | | //获取温度界面信息 |
| | | private Response getTmpPage(RealTimeDto realDto) { |
| | | return new Response().set(1); |
| | | Map<String, Object> map=new HashMap<>(); |
| | | Float maxData=0f; |
| | | Float minData=0f; |
| | | Float avgData=0f; |
| | | try { |
| | | //实时获取单体信息 |
| | | List<BattRtdata> rtdataList = rtdataService.getRtdataRealInfo(realDto.getBattgroupId()); |
| | | if(rtdataList!=null&&rtdataList.size()>0){ |
| | | for(int i=0;i<rtdataList.size();i++) { |
| | | BattRtdata battRtdata=rtdataList.get(i); |
| | | if(i==0){ |
| | | maxData=battRtdata.getMonTmp(); |
| | | minData=battRtdata.getMonTmp(); |
| | | } |
| | | if (battRtdata.getMonTmp() >= maxData) { |
| | | maxData = battRtdata.getMonTmp(); |
| | | } |
| | | if (battRtdata.getMonTmp() <= minData) { |
| | | minData = battRtdata.getMonTmp(); |
| | | } |
| | | avgData += battRtdata.getMonTmp(); |
| | | } |
| | | avgData=avgData/rtdataList.size(); |
| | | } |
| | | map.put("rtdataList",rtdataList!=null?rtdataList:""); |
| | | map.put("maxData",maxData); |
| | | map.put("minData",minData); |
| | | map.put("avgData",avgData); |
| | | map.put("pageType",realDto.getPageType()); |
| | | return new Response().setII(1,true,map,"温度界面信息推送"); |
| | | }catch (Exception e){ |
| | | return new Response().set(1,false,"温度界面信息推送"); |
| | | } |
| | | } |
| | | //获取内阻界面信息 |
| | | private Response getResPage(RealTimeDto realDto) { |
| | | return new Response().set(1); |
| | | Map<String, Object> map=new HashMap<>(); |
| | | Float maxData=0f; |
| | | Float minData=0f; |
| | | Float avgData=0f; |
| | | try { |
| | | //实时获取单体信息 |
| | | List<BattRtdata> rtdataList = rtdataService.getRtdataRealInfo(realDto.getBattgroupId()); |
| | | if(rtdataList!=null&&rtdataList.size()>0){ |
| | | for(int i=0;i<rtdataList.size();i++) { |
| | | BattRtdata battRtdata=rtdataList.get(i); |
| | | if(i==0){ |
| | | maxData=battRtdata.getMonRes(); |
| | | minData=battRtdata.getMonRes(); |
| | | } |
| | | if (battRtdata.getMonRes() >= maxData) { |
| | | maxData = battRtdata.getMonRes(); |
| | | } |
| | | if (battRtdata.getMonRes() <= minData) { |
| | | minData = battRtdata.getMonRes(); |
| | | } |
| | | avgData += battRtdata.getMonRes(); |
| | | } |
| | | avgData=avgData/rtdataList.size(); |
| | | } |
| | | map.put("rtdataList",rtdataList!=null?rtdataList:""); |
| | | map.put("maxData",maxData); |
| | | map.put("minData",minData); |
| | | map.put("avgData",avgData); |
| | | //上一次内阻测试数据 |
| | | BattresdataInf rinfData= battresdataInfService.getLastTestData(realDto.getBattgroupId()); |
| | | map.put("rinfData",rinfData!=null?rinfData:""); |
| | | map.put("pageType",realDto.getPageType()); |
| | | return new Response().setII(1,true,map,"内阻界面信息推送"); |
| | | }catch (Exception e){ |
| | | return new Response().set(1,false,"内阻界面信息推送"); |
| | | } |
| | | } |
| | | //获取电压界面信息 |
| | | private Response getVolPage(RealTimeDto realDto) { |
| | | return new Response().set(1); |
| | | Map<String, Object> map=new HashMap<>(); |
| | | Float maxData=0f; |
| | | Float minData=0f; |
| | | Float avgData=0f; |
| | | try { |
| | | //实时获取单体信息 |
| | | List<BattRtdata> rtdataList = rtdataService.getRtdataRealInfo(realDto.getBattgroupId()); |
| | | if(rtdataList!=null&&rtdataList.size()>0){ |
| | | for(int i=0;i<rtdataList.size();i++) { |
| | | BattRtdata battRtdata=rtdataList.get(i); |
| | | if(i==0){ |
| | | maxData=battRtdata.getMonVol(); |
| | | minData=battRtdata.getMonVol(); |
| | | } |
| | | if (battRtdata.getMonVol() >= maxData) { |
| | | maxData = battRtdata.getMonVol(); |
| | | } |
| | | if (battRtdata.getMonVol() <= minData) { |
| | | minData = battRtdata.getMonVol(); |
| | | } |
| | | avgData += battRtdata.getMonVol(); |
| | | } |
| | | avgData=avgData/rtdataList.size(); |
| | | } |
| | | map.put("rtdataList",rtdataList!=null?rtdataList:""); |
| | | map.put("maxData",maxData); |
| | | map.put("minData",minData); |
| | | map.put("avgData",avgData); |
| | | map.put("pageType",realDto.getPageType()); |
| | | return new Response().setII(1,true,map,"电压界面信息推送"); |
| | | }catch (Exception e){ |
| | | return new Response().set(1,false,"电压界面信息推送"); |
| | | } |
| | | } |
| | | //获取电源界面信息 |
| | | private Response getPowerPage(RealTimeDto realDto) { |
| | | return new Response().set(1); |
| | | Map<String, Object> map=new HashMap<>(); |
| | | try { |
| | | //实时获取电源信息 |
| | | PwrdevAcdcdata pwrdevAcdcdata = pwrdevAcdcdataService.getPwrRealInfo(realDto.getPowerId()); |
| | | map.put("pwrdevAcdcdata",pwrdevAcdcdata!=null?pwrdevAcdcdata:""); |
| | | map.put("pageType",realDto.getPageType()); |
| | | return new Response().setII(1,true,map,"电源界面信息推送"); |
| | | }catch (Exception e){ |
| | | return new Response().set(1,false,"电源界面信息推送"); |
| | | } |
| | | } |
| | | //获取系统概述界面信息 |
| | | private Response getSystemPage(RealTimeDto realDto) { |
| | | return new Response().set(1); |
| | | Map<String, Object> map=new HashMap<>(); |
| | | map.put("pageType",realDto.getPageType()); |
| | | try { |
| | | //实时获取电池组信息 |
| | | BattRtstate battRtstate = battRtstateService.getBattRealInfo(realDto.getBattgroupId()); |
| | | if(battRtstate!=null){ |
| | | battRtstate.setLastCaptestStopTypeReason(StopReasonEnum.getValue(battRtstate.getLastCaptestStopType())); |
| | | battRtstate.setControlFailTypeReason(FailReasonEnum.getValue(battRtstate.getControlFailType())); |
| | | } |
| | | map.put("battRtstate",battRtstate!=null?battRtstate:""); |
| | | //实时获取设备信息 |
| | | DeviceState deviceState = deviceStateService.getDevRealInfo(realDto.getDevId()); |
| | | map.put("deviceState",deviceState!=null?deviceState:""); |
| | | //获取上一次标准核容信息 |
| | | BatttestdataInf tinfData= batttestdataInfService.getLastStandardTestData(realDto.getBattgroupId()); |
| | | map.put("tinfData",tinfData!=null?tinfData:""); |
| | | //获取近半小时电源数据,整流器数据,核容设备数据(推送实时,接口查询最近半小时数据) |
| | | PwrdevAcdcdata pwrdevAcdcdata = pwrdevAcdcdataService.getPwrRealInfo(realDto.getPowerId()); |
| | | map.put("pwrdevAcdcdata",pwrdevAcdcdata!=null?pwrdevAcdcdata:""); |
| | | //电源对象(整流器使用情况) |
| | | PowerInf powerInf = powerInfService.getPowerInfById(realDto.getPowerId()); |
| | | map.put("powerInf",powerInf!=null?powerInf:""); |
| | | //获取电池组的蓄电池信息 |
| | | List<BattRtdata> battRtdataList = rtdataService.getRtdataRealInfo(realDto.getBattgroupId()); |
| | | SticRealRtdataDto dto=setMaxMinData(battRtdataList); |
| | | map.put("sticRtdata",dto); |
| | | return new Response().setII(1,true,map,"系统概述推送"); |
| | | }catch (Exception e) { |
| | | e.printStackTrace(); |
| | | } |
| | | return new Response().set(1,false,"系统概述推送"); |
| | | } |
| | | |
| | | //计算集合中单体电压,内阻,温度,容量的最大最小值 |
| | | public SticRealRtdataDto setMaxMinData(List<BattRtdata> battRtdataList){ |
| | | SticRealRtdataDto dto=new SticRealRtdataDto(); |
| | | Float maxCap = 0.0f; |
| | | Float minCap = 0.0f; |
| | | Float maxVol = 0.0f; |
| | | Float minVol = 0.0f; |
| | | Float maxTmp = 0.0f; |
| | | Float minTmp = 0.0f; |
| | | Float maxRes = 0.0f; |
| | | Float minRes = 0.0f; |
| | | List<Integer> maxCapNumList = new ArrayList<>(); |
| | | List<Integer> minCapNumList = new ArrayList<>(); |
| | | List<Integer> maxVolNumList = new ArrayList<>(); |
| | | List<Integer> minVolNumList = new ArrayList<>(); |
| | | List<Integer> maxTmpNumList = new ArrayList<>(); |
| | | List<Integer> minTmpNumList = new ArrayList<>(); |
| | | List<Integer> maxResNumList = new ArrayList<>(); |
| | | List<Integer> minResNumList = new ArrayList<>(); |
| | | //计算集合中单体电压,内阻,温度,容量的最大最小值 |
| | | for (int i=0;i<battRtdataList.size();i++) { |
| | | BattRtdata rtdata=battRtdataList.get(i); |
| | | if(i==0){ |
| | | //赋值初始值 |
| | | maxVol = rtdata.getMonVol(); |
| | | minVol = rtdata.getMonVol(); |
| | | maxTmp = rtdata.getMonTmp(); |
| | | minTmp = rtdata.getMonTmp(); |
| | | maxRes = rtdata.getMonRes(); |
| | | minRes = rtdata.getMonRes(); |
| | | maxCap = rtdata.getMonCap(); |
| | | minCap = rtdata.getMonCap(); |
| | | } |
| | | if(rtdata.getMonVol()>=maxVol){ |
| | | maxVol = rtdata.getMonVol(); |
| | | } |
| | | if(rtdata.getMonVol()<=minVol){ |
| | | minVol = rtdata.getMonVol(); |
| | | } |
| | | if(rtdata.getMonTmp()>=maxTmp){ |
| | | maxTmp = rtdata.getMonTmp(); |
| | | } |
| | | if(rtdata.getMonTmp()<=minTmp){ |
| | | minTmp = rtdata.getMonTmp(); |
| | | } |
| | | if(rtdata.getMonRes()>=maxRes){ |
| | | maxRes = rtdata.getMonRes(); |
| | | } |
| | | if(rtdata.getMonRes()<=minRes){ |
| | | minRes = rtdata.getMonRes(); |
| | | } |
| | | if(rtdata.getMonCap()>=maxCap){ |
| | | maxCap = rtdata.getMonCap(); |
| | | } |
| | | if(rtdata.getMonCap()<=minCap){ |
| | | minCap = rtdata.getMonCap(); |
| | | } |
| | | } |
| | | dto.setMaxCap(maxCap); |
| | | dto.setMinCap(minCap); |
| | | dto.setMaxVol(maxVol); |
| | | dto.setMinVol(minVol); |
| | | dto.setMaxTmp(maxTmp); |
| | | dto.setMinTmp(minTmp); |
| | | dto.setMaxRes(maxRes); |
| | | dto.setMinRes(minRes); |
| | | for (BattRtdata rtdata:battRtdataList) { |
| | | if(rtdata.getMonVol()==maxVol){ |
| | | maxVolNumList.add(rtdata.getMonNum()); |
| | | } |
| | | if(rtdata.getMonVol()==minVol){ |
| | | minVolNumList.add(rtdata.getMonNum()); |
| | | } |
| | | if(rtdata.getMonTmp()==maxTmp){ |
| | | maxTmpNumList.add(rtdata.getMonNum()); |
| | | } |
| | | if(rtdata.getMonTmp()==minTmp){ |
| | | minTmpNumList.add(rtdata.getMonNum()); |
| | | } |
| | | if(rtdata.getMonRes()==maxRes){ |
| | | maxResNumList.add(rtdata.getMonNum()); |
| | | } |
| | | if(rtdata.getMonRes()==minRes){ |
| | | minResNumList.add(rtdata.getMonNum()); |
| | | } |
| | | if(rtdata.getMonCap()==maxCap){ |
| | | maxCapNumList.add(rtdata.getMonNum()); |
| | | } |
| | | if(rtdata.getMonCap()==minCap){ |
| | | minCapNumList.add(rtdata.getMonNum()); |
| | | } |
| | | } |
| | | dto.setMaxCapNumList(maxCapNumList); |
| | | dto.setMinCapNumList(minCapNumList); |
| | | dto.setMaxVolNumList(maxVolNumList); |
| | | dto.setMinVolNumList(minVolNumList); |
| | | dto.setMaxTmpNumList(maxTmpNumList); |
| | | dto.setMinTmpNumList(minTmpNumList); |
| | | dto.setMaxResNumList(maxResNumList); |
| | | dto.setMinResNumList(minResNumList); |
| | | return dto; |
| | | } |
| | | @OnClose |
| | | public void onClose(CloseReason closeReason){ |
| | | System.err.println("closeReason = " + closeReason); |
New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="com.whyc.mapper.BattAlmparamMapper"> |
| | | |
| | | <select id="getBattAlmParam" resultType="com.whyc.pojo.db_param.BattAlmparam"> |
| | | select distinct tb_batt_almparam.*,tb_batt_inf.battgroup_name |
| | | ,tb_station_inf.station_type,tb_station_inf.station_name,tb_station_inf.provice,tb_station_inf.city,tb_station_inf.country,tb_station_inf.full_name |
| | | from db_station.tb_batt_inf,db_station.tb_station_inf,db_param.tb_batt_almparam |
| | | <where> |
| | | tb_batt_inf.battgroup_id=tb_batt_almparam.battgroup_id |
| | | and tb_batt_inf.station_id=tb_station_inf.station_id |
| | | <if test="almDto.provice!=null"> |
| | | and tb_station_inf.provice=#{almDto.provice} |
| | | </if> |
| | | <if test="almDto.city!=null"> |
| | | and tb_station_inf.city=#{almDto.city} |
| | | </if> |
| | | <if test="almDto.country!=null"> |
| | | and tb_station_inf.country=#{almDto.country} |
| | | </if> |
| | | <if test="almDto.stationName!=null"> |
| | | and tb_station_inf.station_name=#{almDto.stationName} |
| | | </if> |
| | | <if test="almDto.battgroupName!=null"> |
| | | and tb_batt_inf.battgroup_name=#{almDto.battgroupName} |
| | | </if> |
| | | <if test="almDto.uid>100"> |
| | | and tb_batt_inf.station_id in( |
| | | select distinct station_id from db_user.tb_baojigroup_power,db_user.tb_baojigroup_usr |
| | | where tb_baojigroup_power.baoji_group_id=tb_baojigroup_usr.baoji_group_id |
| | | and tb_baojigroup_usr.uid=#{almDto.uid} |
| | | ) |
| | | </if> |
| | | order by tb_batt_inf.dev_id asc,battgroup_id asc |
| | | </where> |
| | | </select> |
| | | </mapper> |
| | |
| | | </if> |
| | | </where> |
| | | </select> |
| | | |
| | | <select id="getDevStatistic" resultType="com.whyc.pojo.db_station.BattInf"> |
| | | select distinct tb_batt_inf.dev_id,tb_batt_inf.dev_name,tb_batt_inf.dev_type,tb_batt_inf.dev_num,tb_batt_inf.dev_ip |
| | | ,tb_batt_inf.station_id,tb_batt_inf.power_id |
| | | ,tb_station_inf.station_type,tb_station_inf.station_name,tb_station_inf.provice,tb_station_inf.city,tb_station_inf.country,tb_station_inf.full_name |
| | | from db_station.tb_batt_inf,db_station.tb_station_inf |
| | | <where> |
| | | tb_batt_inf.station_id=tb_station_inf.station_id |
| | | <if test="stic.provice!=null"> |
| | | and tb_station_inf.provice=#{stic.provice} |
| | | </if> |
| | | <if test="stic.city!=null"> |
| | | and tb_station_inf.city=#{stic.city} |
| | | </if> |
| | | <if test="stic.country!=null"> |
| | | and tb_station_inf.country=#{stic.country} |
| | | </if> |
| | | <if test="stic.stationName!=null"> |
| | | and tb_station_inf.station_name=#{stic.stationName} |
| | | </if> |
| | | <if test="stic.uid>100"> |
| | | and tb_batt_inf.station_id in( |
| | | select distinct station_id from db_user.tb_baojigroup_power,db_user.tb_baojigroup_usr |
| | | where tb_baojigroup_power.baoji_group_id=tb_baojigroup_usr.baoji_group_id |
| | | and tb_baojigroup_usr.uid=#{stic.uid} |
| | | ) |
| | | </if> |
| | | order by tb_batt_inf.dev_id asc |
| | | </where> |
| | | </select> |
| | | <select id="getBattCountBydevId" resultType="java.lang.Integer"> |
| | | select ifnull(count(*),0) from db_station.tb_batt_inf |
| | | <where> |
| | | dev_id=#{devId} |
| | | </where> |
| | | </select> |
| | | <select id="getBattStatistic" resultType="com.whyc.pojo.db_station.BattInf"> |
| | | select distinct tb_batt_inf.* |
| | | ,tb_station_inf.station_type,tb_station_inf.station_name,tb_station_inf.provice,tb_station_inf.city,tb_station_inf.country,tb_station_inf.full_name |
| | | from db_station.tb_batt_inf,db_station.tb_station_inf |
| | | <where> |
| | | tb_batt_inf.station_id=tb_station_inf.station_id |
| | | <if test="stic.provice!=null"> |
| | | and tb_station_inf.provice=#{stic.provice} |
| | | </if> |
| | | <if test="stic.city!=null"> |
| | | and tb_station_inf.city=#{stic.city} |
| | | </if> |
| | | <if test="stic.country!=null"> |
| | | and tb_station_inf.country=#{stic.country} |
| | | </if> |
| | | <if test="stic.stationName!=null"> |
| | | and tb_station_inf.station_name=#{stic.stationName} |
| | | </if> |
| | | <if test="stic.stationType!=null"> |
| | | and tb_station_inf.station_type=#{stic.stationType} |
| | | </if> |
| | | <if test="stic.product!=null"> |
| | | and tb_batt_inf.product=#{stic.product} |
| | | </if> |
| | | <if test="stic.monvolstd!=null"> |
| | | and tb_batt_inf.monvolstd=#{stic.monvolstd} |
| | | </if> |
| | | <if test="stic.uid>100"> |
| | | and tb_batt_inf.station_id in( |
| | | select distinct station_id from db_user.tb_baojigroup_power,db_user.tb_baojigroup_usr |
| | | where tb_baojigroup_power.baoji_group_id=tb_baojigroup_usr.baoji_group_id |
| | | and tb_baojigroup_usr.uid=#{stic.uid} |
| | | ) |
| | | </if> |
| | | order by tb_batt_inf.dev_id asc,battgroup_id asc |
| | | </where> |
| | | </select> |
| | | <select id="getMonStatistic" resultType="com.whyc.pojo.db_station.BattInf"> |
| | | select distinct tb_batt_inf.*,tb_station_inf.station_name from db_station.tb_batt_inf,db_station.tb_station_inf |
| | | <where> |
| | | tb_batt_inf.station_id=tb_station_inf.station_id |
| | | <if test="stic.product!=null"> |
| | | and tb_batt_inf.product=#{stic.product} |
| | | </if> |
| | | <if test="stic.moncapstd!=null"> |
| | | and tb_batt_inf.moncapstd=#{stic.moncapstd} |
| | | </if> |
| | | <if test="stic.monvolstd!=null"> |
| | | and tb_batt_inf.monvolstd=#{stic.monvolstd} |
| | | </if> |
| | | <if test="stic.startTime!=null"> |
| | | and tb_batt_inf.inuse_time>=#{stic.startTime} |
| | | </if> |
| | | <if test="stic.endTime!=null"> |
| | | and tb_batt_inf.inuse_time<=#{stic.endTime} |
| | | </if> |
| | | <if test="stic.uid>100"> |
| | | and tb_batt_inf.station_id in( |
| | | select distinct station_id from db_user.tb_baojigroup_power,db_user.tb_baojigroup_usr |
| | | where tb_baojigroup_power.baoji_group_id=tb_baojigroup_usr.baoji_group_id |
| | | and tb_baojigroup_usr.uid=#{stic.uid} |
| | | ) |
| | | </if> |
| | | </where> |
| | | </select> |
| | | <select id="getBattCompare15Statistic" resultType="com.whyc.pojo.db_station.BattInf"> |
| | | select distinct tb_batt_inf.* |
| | | ,tb_station_inf.station_type,tb_station_inf.station_name,tb_station_inf.provice,tb_station_inf.city,tb_station_inf.country,tb_station_inf.full_name |
| | | from db_station.tb_batt_inf,db_station.tb_station_inf |
| | | <where> |
| | | tb_batt_inf.station_id=tb_station_inf.station_id |
| | | <if test="stic.provice!=null"> |
| | | and tb_station_inf.provice=#{stic.provice} |
| | | </if> |
| | | <if test="stic.city!=null"> |
| | | and tb_station_inf.city=#{stic.city} |
| | | </if> |
| | | <if test="stic.country!=null"> |
| | | and tb_station_inf.country=#{stic.country} |
| | | </if> |
| | | <if test="stic.stationName!=null"> |
| | | and tb_station_inf.station_name=#{stic.stationName} |
| | | </if> |
| | | <if test="stic.product!=null"> |
| | | and tb_batt_inf.product=#{stic.product} |
| | | </if> |
| | | <if test="stic.uid>100"> |
| | | and tb_batt_inf.station_id in( |
| | | select distinct station_id from db_user.tb_baojigroup_power,db_user.tb_baojigroup_usr |
| | | where tb_baojigroup_power.baoji_group_id=tb_baojigroup_usr.baoji_group_id |
| | | and tb_baojigroup_usr.uid=#{stic.uid} |
| | | ) |
| | | </if> |
| | | order by tb_batt_inf.dev_id asc,battgroup_id asc |
| | | </where> |
| | | </select> |
| | | <select id="getBattCompare16Statistic" resultType="com.whyc.pojo.db_station.BattInf"> |
| | | select distinct tb_batt_inf.* |
| | | ,tb_station_inf.station_type,tb_station_inf.station_name,tb_station_inf.provice,tb_station_inf.city,tb_station_inf.country,tb_station_inf.full_name |
| | | from db_station.tb_batt_inf,db_station.tb_station_inf |
| | | <where> |
| | | tb_batt_inf.station_id=tb_station_inf.station_id |
| | | <if test="stic.provice!=null"> |
| | | and tb_station_inf.provice=#{stic.provice} |
| | | </if> |
| | | <if test="stic.city!=null"> |
| | | and tb_station_inf.city=#{stic.city} |
| | | </if> |
| | | <if test="stic.country!=null"> |
| | | and tb_station_inf.country=#{stic.country} |
| | | </if> |
| | | <if test="stic.stationName!=null"> |
| | | and tb_station_inf.station_name=#{stic.stationName} |
| | | </if> |
| | | <if test="stic.product!=null"> |
| | | and tb_batt_inf.product=#{stic.product} |
| | | </if> |
| | | <if test="stic.moncapstd!=null"> |
| | | and tb_batt_inf.moncapstd=#{stic.moncapstd} |
| | | </if> |
| | | <if test="stic.inuseStartTime!=null"> |
| | | and tb_batt_inf.inuse_time>=#{stic.inuseStartTime} |
| | | </if> |
| | | <if test="stic.inuseEndTime!=null"> |
| | | and tb_batt_inf.inuse_time<=#{stic.inuseEndTimee} |
| | | </if> |
| | | <if test="stic.uid>100"> |
| | | and tb_batt_inf.station_id in( |
| | | select distinct station_id from db_user.tb_baojigroup_power,db_user.tb_baojigroup_usr |
| | | where tb_baojigroup_power.baoji_group_id=tb_baojigroup_usr.baoji_group_id |
| | | and tb_baojigroup_usr.uid=#{stic.uid} |
| | | ) |
| | | </if> |
| | | order by tb_batt_inf.dev_id asc,battgroup_id asc |
| | | </where> |
| | | </select> |
| | | <select id="getBattCompare17Statistic" resultType="com.whyc.pojo.db_station.BattInf"> |
| | | select distinct tb_batt_inf.* |
| | | ,tb_station_inf.station_type,tb_station_inf.station_name,tb_station_inf.provice,tb_station_inf.city,tb_station_inf.country,tb_station_inf.full_name |
| | | from db_station.tb_batt_inf,db_station.tb_station_inf |
| | | <where> |
| | | tb_batt_inf.station_id=tb_station_inf.station_id |
| | | <if test="stic.provice!=null"> |
| | | and tb_station_inf.provice=#{stic.provice} |
| | | </if> |
| | | <if test="stic.city!=null"> |
| | | and tb_station_inf.city=#{stic.city} |
| | | </if> |
| | | <if test="stic.country!=null"> |
| | | and tb_station_inf.country=#{stic.country} |
| | | </if> |
| | | <if test="stic.stationName!=null"> |
| | | and tb_station_inf.station_name=#{stic.stationName} |
| | | </if> |
| | | <if test="stic.product!=null"> |
| | | and tb_batt_inf.product=#{stic.product} |
| | | </if> |
| | | <if test="stic.inuseStartTime!=null"> |
| | | and tb_batt_inf.inuse_time>=#{stic.inuseStartTime} |
| | | </if> |
| | | <if test="stic.inuseEndTime!=null"> |
| | | and tb_batt_inf.inuse_time<=#{stic.inuseEndTimee} |
| | | </if> |
| | | <if test="stic.uid>100"> |
| | | and tb_batt_inf.station_id in( |
| | | select distinct station_id from db_user.tb_baojigroup_power,db_user.tb_baojigroup_usr |
| | | where tb_baojigroup_power.baoji_group_id=tb_baojigroup_usr.baoji_group_id |
| | | and tb_baojigroup_usr.uid=#{stic.uid} |
| | | ) |
| | | </if> |
| | | order by tb_batt_inf.dev_id asc,battgroup_id asc |
| | | </where> |
| | | </select> |
| | | <select id="getDischr5Statistic" resultType="com.whyc.pojo.db_station.BattInf"> |
| | | select distinct tb_batt_inf.* |
| | | ,tb_station_inf.station_type,tb_station_inf.station_name,tb_station_inf.provice,tb_station_inf.city,tb_station_inf.country,tb_station_inf.full_name |
| | | from db_station.tb_batt_inf,db_station.tb_station_inf |
| | | <where> |
| | | tb_batt_inf.station_id=tb_station_inf.station_id |
| | | <if test="stic.provice!=null"> |
| | | and tb_station_inf.provice=#{stic.provice} |
| | | </if> |
| | | <if test="stic.city!=null"> |
| | | and tb_station_inf.city=#{stic.city} |
| | | </if> |
| | | <if test="stic.country!=null"> |
| | | and tb_station_inf.country=#{stic.country} |
| | | </if> |
| | | <if test="stic.stationName!=null"> |
| | | and tb_station_inf.station_name=#{stic.stationName} |
| | | </if> |
| | | <if test="stic.uid>100"> |
| | | and tb_batt_inf.station_id in( |
| | | select distinct station_id from db_user.tb_baojigroup_power,db_user.tb_baojigroup_usr |
| | | where tb_baojigroup_power.baoji_group_id=tb_baojigroup_usr.baoji_group_id |
| | | and tb_baojigroup_usr.uid=#{stic.uid} |
| | | ) |
| | | </if> |
| | | order by tb_batt_inf.dev_id asc,battgroup_id asc |
| | | </where> |
| | | </select> |
| | | <select id="getDischr6Statistic" resultType="com.whyc.pojo.db_station.BattInf"> |
| | | select distinct tb_batt_inf.* |
| | | ,tb_station_inf.station_type,tb_station_inf.station_name,tb_station_inf.provice,tb_station_inf.city,tb_station_inf.country,tb_station_inf.full_name |
| | | from db_station.tb_batt_inf,db_station.tb_station_inf |
| | | <where> |
| | | tb_batt_inf.station_id=tb_station_inf.station_id |
| | | <if test="stic.provice!=null"> |
| | | and tb_station_inf.provice=#{stic.provice} |
| | | </if> |
| | | <if test="stic.city!=null"> |
| | | and tb_station_inf.city=#{stic.city} |
| | | </if> |
| | | <if test="stic.country!=null"> |
| | | and tb_station_inf.country=#{stic.country} |
| | | </if> |
| | | <if test="stic.stationName!=null"> |
| | | and tb_station_inf.station_name=#{stic.stationName} |
| | | </if> |
| | | <if test="stic.uid>100"> |
| | | and tb_batt_inf.station_id in( |
| | | select distinct station_id from db_user.tb_baojigroup_power,db_user.tb_baojigroup_usr |
| | | where tb_baojigroup_power.baoji_group_id=tb_baojigroup_usr.baoji_group_id |
| | | and tb_baojigroup_usr.uid=#{stic.uid} |
| | | ) |
| | | </if> |
| | | order by tb_batt_inf.dev_id asc,battgroup_id asc |
| | | </where> |
| | | </select> |
| | | <select id="getPerformanceStatistic" resultType="com.whyc.pojo.db_station.BattInf"> |
| | | select distinct tb_batt_inf.* |
| | | ,tb_station_inf.station_type,tb_station_inf.station_name,tb_station_inf.provice,tb_station_inf.city,tb_station_inf.country,tb_station_inf.full_name |
| | | from db_station.tb_batt_inf,db_station.tb_station_inf |
| | | <where> |
| | | tb_batt_inf.station_id=tb_station_inf.station_id |
| | | <if test="stic.provice!=null"> |
| | | and tb_station_inf.provice=#{stic.provice} |
| | | </if> |
| | | <if test="stic.city!=null"> |
| | | and tb_station_inf.city=#{stic.city} |
| | | </if> |
| | | <if test="stic.country!=null"> |
| | | and tb_station_inf.country=#{stic.country} |
| | | </if> |
| | | <if test="stic.stationName!=null"> |
| | | and tb_station_inf.station_name=#{stic.stationName} |
| | | </if> |
| | | <if test="stic.uid>100"> |
| | | and tb_batt_inf.station_id in( |
| | | select distinct station_id from db_user.tb_baojigroup_power,db_user.tb_baojigroup_usr |
| | | where tb_baojigroup_power.baoji_group_id=tb_baojigroup_usr.baoji_group_id |
| | | and tb_baojigroup_usr.uid=#{stic.uid} |
| | | ) |
| | | </if> |
| | | order by tb_batt_inf.dev_id asc,battgroup_id asc |
| | | </where> |
| | | </select> |
| | | </mapper> |
New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="com.whyc.mapper.BattalarmDataMapper"> |
| | | |
| | | <select id="getBattAlmReal" resultType="com.whyc.pojo.db_alarm.BattalarmData"> |
| | | select tb_battalarm_data.*,tb_batt_inf.battgroup_name,tb_station_inf.station_name,tb_station_inf.provice,tb_station_inf.city,tb_station_inf.country,tb_station_inf.full_name |
| | | from db_alarm.tb_battalarm_data,db_station.tb_batt_inf,db_station.tb_station_inf |
| | | <where> |
| | | tb_battalarm_data.battgroup_id=tb_batt_inf.battgroup_id |
| | | and tb_batt_inf.station_id=tb_station_inf.station_id |
| | | <if test="provice!=null"> |
| | | and tb_station_inf.provice=#{provice} |
| | | </if> |
| | | <if test="city!=null"> |
| | | and tb_station_inf.city=#{city} |
| | | </if> |
| | | <if test="country!=null"> |
| | | and tb_station_inf.country=#{country} |
| | | </if> |
| | | <if test="stationName!=null"> |
| | | and tb_station_inf.station_name like concat('%',#{stationName},'%') |
| | | </if> |
| | | <if test="almLevel!=null"> |
| | | and tb_battalarm_data.alm_level=#{almLevel} |
| | | </if> |
| | | <if test="almIds!=null"> |
| | | <if test="almIds.size==0"> |
| | | and tb_battalarm_data.alm_id =0 |
| | | </if> |
| | | <if test="almIds.size>0"> |
| | | and tb_battalarm_data.alm_id in |
| | | <foreach collection="almIds" item="almId" open="(" separator="," close=")"> |
| | | #{almId} |
| | | </foreach> |
| | | </if> |
| | | </if> |
| | | <if test="uid>100"> |
| | | and tb_batt_inf.station_id in( |
| | | select distinct station_id from db_user.tb_baojigroup_power,db_user.tb_baojigroup_usr |
| | | where tb_baojigroup_power.baoji_group_id=tb_baojigroup_usr.baoji_group_id |
| | | and tb_baojigroup_usr.uid=#{uid} |
| | | ) |
| | | </if> |
| | | |
| | | </where> |
| | | </select> |
| | | </mapper> |
New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="com.whyc.mapper.BatttestdataInfMapper"> |
| | | |
| | | <select id="getBattTinfStatistic" resultType="com.whyc.pojo.db_batt_testdata.BatttestdataInf"> |
| | | select tb_batttestdata_inf.* |
| | | ,tb_station_inf.station_name,tb_station_inf.provice,tb_station_inf.city,tb_station_inf.country,tb_station_inf.full_name |
| | | ,tb_batt_inf.battgroup_name,tb_batt_inf.power_id,tb_batt_inf.station_id,tb_batt_inf.dev_id |
| | | from db_batt_testdata.tb_batttestdata_inf,db_station.tb_station_inf,db_station.tb_batt_inf |
| | | <where> |
| | | tb_batttestdata_inf.battgroup_id=tb_batt_inf.battgroup_id |
| | | and tb_batt_inf.station_id=tb_station_inf.station_id |
| | | <if test="stic.provice!=null"> |
| | | and tb_station_inf.provice=#{stic.provice} |
| | | </if> |
| | | <if test="stic.city!=null"> |
| | | and tb_station_inf.city= #{stic.city} |
| | | </if> |
| | | <if test="stic.country!=null"> |
| | | and tb_station_inf.country= #{stic.country} |
| | | </if> |
| | | <if test="stic.stationName!=null"> |
| | | and tb_station_inf.station_name= #{stic.stationName} |
| | | </if> |
| | | <if test="stic.testType!=null"> |
| | | and tb_batttestdata_inf.test_type= #{stic.testType} |
| | | </if> |
| | | <if test="stic.testStartTime!=null"> |
| | | and tb_batttestdata_inf.test_starttime>=#{stic.testStartTime} |
| | | </if> |
| | | <if test="stic.testEndTime!=null"> |
| | | and tb_batttestdata_inf.test_starttime<=#{stic.testEndTime} |
| | | </if> |
| | | <if test="stic.uid>100"> |
| | | and tb_station_inf.station_id in( |
| | | select distinct station_id from db_user.tb_baojigroup_power,db_user.tb_baojigroup_usr |
| | | where tb_baojigroup_power.baoji_group_id=tb_baojigroup_usr.baoji_group_id |
| | | and tb_baojigroup_usr.uid=#{stic.uid} |
| | | ) |
| | | </if> |
| | | </where> |
| | | order by tb_batttestdata_inf.battgroup_id asc, tb_batttestdata_inf.test_record_count asc |
| | | </select> |
| | | <select id="getNoDischargeData" resultType="com.whyc.pojo.db_batt_testdata.BatttestdataInf"> |
| | | select * from db_batt_testdata.tb_batttestdata_inf |
| | | <where> |
| | | battgroup_id=#{battgroupId} and test_type=3 |
| | | and (test_starttype!=3 or test_timelong <7200) |
| | | <if test="testStartTime!=null"> |
| | | and tb_batttestdata_inf.test_starttime>=#{stic.testStartTime} |
| | | </if> |
| | | <if test="testEndTime!=null"> |
| | | and tb_batttestdata_inf.test_starttime<=#{stic.testEndTime} |
| | | </if> |
| | | <if test="typeList!=null"> |
| | | and test_stoptype in |
| | | <foreach item="item" index="index" collection="typeList" open="(" separator="," close=")"> |
| | | #{item} |
| | | </foreach> |
| | | </if> |
| | | </where> |
| | | </select> |
| | | </mapper> |
| | |
| | | <select id="getMaxValue" resultType="java.lang.Object"> |
| | | select max(${field}) from ${schema}.${table} |
| | | </select> |
| | | <select id="existTable" resultType="java.lang.Boolean"> |
| | | <select id="existTable" resultType="java.lang.String"> |
| | | select |
| | | table_name |
| | | from `INFORMATION_SCHEMA`.`TABLES` |
New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="com.whyc.mapper.DevalarmDataMapper"> |
| | | <select id="getDevAlmReal" resultType="com.whyc.pojo.db_alarm.DevalarmData"> |
| | | select tb_devalarm_data.*,tb_batt_inf.dev_name,tb_station_inf.station_name,tb_station_inf.provice,tb_station_inf.city,tb_station_inf.country,tb_station_inf.full_name |
| | | from db_alarm.tb_devalarm_data,db_station.tb_batt_inf,db_station.tb_station_inf |
| | | <where> |
| | | tb_devalarm_data.dev_id=tb_batt_inf.dev_id |
| | | and tb_batt_inf.station_id=tb_station_inf.station_id |
| | | <if test="provice!=null"> |
| | | and tb_station_inf.provice=#{provice} |
| | | </if> |
| | | <if test="city!=null"> |
| | | and tb_station_inf.city=#{city} |
| | | </if> |
| | | <if test="country!=null"> |
| | | and tb_station_inf.country=#{country} |
| | | </if> |
| | | <if test="stationName!=null"> |
| | | and tb_station_inf.station_name like concat('%',#{stationName},'%') |
| | | </if> |
| | | <if test="almLevel!=null"> |
| | | and tb_devalarm_data.alm_level=#{almLevel} |
| | | </if> |
| | | <if test="almIds!=null"> |
| | | <if test="almIds.size==0"> |
| | | and tb_devalarm_data.alm_id =0 |
| | | </if> |
| | | <if test="almIds.size>0"> |
| | | and tb_devalarm_data.alm_id in |
| | | <foreach collection="almIds" item="almId" open="(" separator="," close=")"> |
| | | #{almId} |
| | | </foreach> |
| | | </if> |
| | | </if> |
| | | <if test="uid>100"> |
| | | and tb_batt_inf.station_id in( |
| | | select distinct station_id from db_user.tb_baojigroup_power,db_user.tb_baojigroup_usr |
| | | where tb_baojigroup_power.baoji_group_id=tb_baojigroup_usr.baoji_group_id |
| | | and tb_baojigroup_usr.uid=#{uid} |
| | | ) |
| | | </if> |
| | | |
| | | </where> |
| | | </select> |
| | | </mapper> |
New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="com.whyc.mapper.DeviceSetparamMapper"> |
| | | |
| | | <update id="updateParam"> |
| | | update db_ram_db.tb_device_setparam |
| | | set |
| | | hourrate=#{hourrate}, |
| | | discurr=#{discurr}, |
| | | discap=#{discap}, |
| | | distime=#{distime}, |
| | | groupvol_low=#{groupvolLow}, |
| | | monomervol_low=#{monomervolLow}, |
| | | monomerlowcount=#{monomerlowcount}, |
| | | onlinevollowaction=#{onlinevollowaction}, |
| | | dcvolhighlimit=#{dcvolhighlimit}, |
| | | chargecurrset=#{chargecurrset}, |
| | | monomertmp_high=#{monomertmpHigh}, |
| | | monvolstd=#{monvolstd}, |
| | | diswaittime=#{diswaittime}, |
| | | moncapstd=#{moncapstd} |
| | | where dev_id = #{devId} |
| | | </update> |
| | | <select id="getParam" resultType="com.whyc.pojo.db_ram_db.DeviceSetparam"> |
| | | select tb_device_setparam.*, tb_batt_inf.battgroup_name, tb_batt_inf.dev_name,tb_station_inf.station_name, tb_station_inf.provice, tb_station_inf.city, tb_station_inf.country, tb_station_inf.full_name |
| | | from db_ram_db.tb_device_setparam, db_station.tb_batt_inf, db_station.tb_station_inf |
| | | where tb_device_setparam.dev_id = tb_batt_inf.dev_id |
| | | and tb_batt_inf.station_id = tb_station_inf.station_id |
| | | and tb_device_setparam.dev_id = #{devId} and tb_device_setparam.battgroupnum = #{battGroupNum} |
| | | </select> |
| | | </mapper> |
New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="com.whyc.mapper.DeviceStateMapper"> |
| | | |
| | | <select id="getDeviceStateStatistic" resultType="com.whyc.pojo.db_ram_db.DeviceState"> |
| | | select tb_device_state.* |
| | | ,tb_station_inf.station_name,tb_station_inf.provice,tb_station_inf.city,tb_station_inf.country,tb_station_inf.full_name,tb_batt_inf.dev_name |
| | | ,tb_batt_inf.power_id,tb_batt_inf.station_id |
| | | from db_ram_db.tb_device_state,db_station.tb_station_inf,db_station.tb_batt_inf |
| | | <where> |
| | | tb_device_state.dev_id=tb_batt_inf.dev_id |
| | | and tb_batt_inf.station_id=tb_station_inf.station_id |
| | | <if test="stic.provice!=null"> |
| | | and tb_station_inf.provice=#{stic.provice} |
| | | </if> |
| | | <if test="stic.city!=null"> |
| | | and tb_station_inf.city= #{stic.city} |
| | | </if> |
| | | <if test="stic.country!=null"> |
| | | and tb_station_inf.country= #{stic.country} |
| | | </if> |
| | | <if test="stic.stationName!=null"> |
| | | and tb_station_inf.station_name= #{stic.stationName} |
| | | </if> |
| | | <if test="stic.devWorkstate!=null"> |
| | | and tb_device_state.dev_workstate= #{stic.devWorkstate} |
| | | </if> |
| | | <if test="stic.uid>100"> |
| | | and tb_station_inf.station_id in( |
| | | select distinct station_id from db_user.tb_baojigroup_power,db_user.tb_baojigroup_usr |
| | | where tb_baojigroup_power.baoji_group_id=tb_baojigroup_usr.baoji_group_id |
| | | and tb_baojigroup_usr.uid=#{stic.uid} |
| | | ) |
| | | </if> |
| | | order by tb_device_state.dev_id asc |
| | | </where> |
| | | </select> |
| | | </mapper> |
| | |
| | | </if> |
| | | </where> |
| | | </select> |
| | | <select id="getPowerStatistic" resultType="com.whyc.pojo.db_station.PowerInf"> |
| | | select distinct tb_power_inf.* |
| | | ,tb_station_inf.station_type,tb_station_inf.station_name,tb_station_inf.provice,tb_station_inf.city,tb_station_inf.country,tb_station_inf.full_name |
| | | from db_station.tb_power_inf,db_station.tb_station_inf |
| | | <where> |
| | | tb_power_inf.station_id=tb_station_inf.station_id |
| | | <if test="stic.provice!=null"> |
| | | and tb_station_inf.provice=#{stic.provice} |
| | | </if> |
| | | <if test="stic.city!=null"> |
| | | and tb_station_inf.city=#{stic.city} |
| | | </if> |
| | | <if test="stic.country!=null"> |
| | | and tb_station_inf.country=#{stic.country} |
| | | </if> |
| | | <if test="stic.stationName!=null"> |
| | | and tb_station_inf.station_name=#{stic.stationName} |
| | | </if> |
| | | <if test="stic.stationType!=null"> |
| | | and tb_station_inf.station_type=#{stic.stationType} |
| | | </if> |
| | | <if test="stic.stationType!=null"> |
| | | and tb_power_inf.company=#{stic.company} |
| | | </if> |
| | | <if test="stic.uid>100"> |
| | | and tb_power_inf.power_id in( |
| | | select distinct power_id from db_user.tb_baojigroup_power,db_user.tb_baojigroup_usr |
| | | where tb_baojigroup_power.baoji_group_id=tb_baojigroup_usr.baoji_group_id |
| | | and tb_baojigroup_usr.uid=#{stic.uid} |
| | | ) |
| | | </if> |
| | | order by tb_power_inf.power_id asc |
| | | </where> |
| | | </select> |
| | | <select id="getGroupName" resultType="java.lang.String"> |
| | | select distinct ifnull(baoji_group_name,'none') from db_user.tb_baojigroup,db_user.tb_baojigroup_power |
| | | <where> |
| | | tb_baojigroup.baoji_group_id=tb_baojigroup_power.baoji_group_id |
| | | and tb_baojigroup.team_flag=1 |
| | | <if test="powerId!=null"> |
| | | and power_id=#{powerId} |
| | | </if> |
| | | </where> |
| | | </select> |
| | | |
| | | </mapper> |
New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="com.whyc.mapper.PwrdevAlarmMapper"> |
| | | <select id="getPwrAlmReal" resultType="com.whyc.pojo.db_pwrdev_alarm.PwrdevAlarm"> |
| | | select tb_pwrdev_alarm.*,tb_power_inf.power_name,tb_station_inf.station_name,tb_station_inf.provice,tb_station_inf.city,tb_station_inf.country,tb_station_inf.full_name |
| | | from db_pwrdev_alarm.tb_pwrdev_alarm,db_station.tb_power_inf,db_station.tb_station_inf |
| | | <where> |
| | | tb_pwrdev_alarm.power_id=tb_power_inf.power_id |
| | | and tb_power_inf.station_id=tb_station_inf.station_id |
| | | <if test="provice!=null"> |
| | | and tb_station_inf.provice=#{provice} |
| | | </if> |
| | | <if test="city!=null"> |
| | | and tb_station_inf.city=#{city} |
| | | </if> |
| | | <if test="country!=null"> |
| | | and tb_station_inf.country=#{country} |
| | | </if> |
| | | <if test="stationName!=null"> |
| | | and tb_station_inf.station_name like concat('%',#{stationName},'%') |
| | | </if> |
| | | <if test="almLevel!=null"> |
| | | and tb_pwrdev_alarm.alm_level=#{almLevel} |
| | | </if> |
| | | <if test="almIds!=null"> |
| | | <if test="almIds.size==0"> |
| | | and tb_pwrdev_alarm.alm_id =0 |
| | | </if> |
| | | <if test="almIds.size>0"> |
| | | and tb_pwrdev_alarm.alm_id in |
| | | <foreach collection="almIds" item="almId" open="(" separator="," close=")"> |
| | | #{almId} |
| | | </foreach> |
| | | </if> |
| | | </if> |
| | | |
| | | <if test="uid>100"> |
| | | and tb_pwrdev_alarm.power_id in( |
| | | select distinct power_id from db_user.tb_baojigroup_power,db_user.tb_baojigroup_usr |
| | | where tb_baojigroup_power.baoji_group_id=tb_baojigroup_usr.baoji_group_id |
| | | and tb_baojigroup_usr.uid=#{uid} |
| | | ) |
| | | </if> |
| | | |
| | | </where> |
| | | </select> |
| | | </mapper> |
New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="com.whyc.mapper.PwrdevAlarmParamMapper"> |
| | | |
| | | <select id="getPwrAlmParam" resultType="com.whyc.pojo.db_pwrdev_alarm.PwrdevAlarmParam"> |
| | | select distinct tb_pwrdev_alarm_param.*,tb_power_inf.power_name |
| | | ,tb_station_inf.station_type,tb_station_inf.station_name,tb_station_inf.provice,tb_station_inf.city,tb_station_inf.country,tb_station_inf.full_name |
| | | from db_station.tb_power_inf,db_station.tb_station_inf,db_pwrdev_alarm.tb_pwrdev_alarm_param |
| | | <where> |
| | | tb_power_inf.power_id=tb_pwrdev_alarm_param.power_id |
| | | and tb_power_inf.station_id=tb_station_inf.station_id |
| | | <if test="almDto.provice!=null"> |
| | | and tb_station_inf.provice=#{almDto.provice} |
| | | </if> |
| | | <if test="almDto.city!=null"> |
| | | and tb_station_inf.city=#{almDto.city} |
| | | </if> |
| | | <if test="almDto.country!=null"> |
| | | and tb_station_inf.country=#{almDto.country} |
| | | </if> |
| | | <if test="almDto.stationName!=null"> |
| | | and tb_station_inf.station_name=#{almDto.stationName} |
| | | </if> |
| | | <if test="almDto.powerName!=null"> |
| | | and tb_power_inf.power_name=#{almDto.powerName} |
| | | </if> |
| | | <if test="almDto.uid>100"> |
| | | and tb_power_inf.power_id in( |
| | | select distinct power_id from db_user.tb_baojigroup_power,db_user.tb_baojigroup_usr |
| | | where tb_baojigroup_power.baoji_group_id=tb_baojigroup_usr.baoji_group_id |
| | | and tb_baojigroup_usr.uid=#{almDto.uid} |
| | | ) |
| | | </if> |
| | | order by tb_power_inf.power_id asc |
| | | </where> |
| | | </select> |
| | | </mapper> |
| | |
| | | </if> |
| | | </where> |
| | | </select> |
| | | <select id="getStationStatistic" resultType="com.whyc.pojo.db_station.StationInf"> |
| | | select distinct * from db_station.tb_station_inf |
| | | <where> |
| | | <if test="stic.provice!=null"> |
| | | and provice=#{stic.provice} |
| | | </if> |
| | | <if test="stic.city!=null"> |
| | | and city=#{stic.city} |
| | | </if> |
| | | <if test="stic.country!=null"> |
| | | and country=#{stic.country} |
| | | </if> |
| | | <if test="stic.stationName!=null"> |
| | | and station_name=#{stic.stationName} |
| | | </if> |
| | | <if test="stic.stationType!=null"> |
| | | and station_type=#{stic.stationType} |
| | | </if> |
| | | <if test="stic.uid>100"> |
| | | and tb_station_inf.station_id in( |
| | | select distinct station_id from db_user.tb_baojigroup_power,db_user.tb_baojigroup_usr |
| | | where tb_baojigroup_power.baoji_group_id=tb_baojigroup_usr.baoji_group_id |
| | | and tb_baojigroup_usr.uid=#{stic.uid} |
| | | ) |
| | | </if> |
| | | order by station_id asc |
| | | </where> |
| | | </select> |
| | | |
| | | </mapper> |
| | |
| | | id in( |
| | | select distinct uid from db_user.tb_baojigroup_usr |
| | | <where> |
| | | baoji_group_id in( |
| | | baoji_group_id in |
| | | <foreach collection="baojiIdList" item="baojiId" open="(" separator="," close=")"> |
| | | #{baojiId} |
| | | </foreach> |
| | | ) |
| | | </where> |
| | | ) |
| | | </where> |