因修改influxDB数据库的部分表结构,谐波模块修改了部分代码
This commit is contained in:
@@ -209,4 +209,26 @@ public interface InfluxDBPublicParam {
|
|||||||
*/
|
*/
|
||||||
String LIMIT_TARGET = "limit_target";
|
String LIMIT_TARGET = "limit_target";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 监测点状态信息表
|
||||||
|
*/
|
||||||
|
String PQS_COMMUNICATE = "pqs_communicate";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 终端在线率表公共字段
|
||||||
|
*/
|
||||||
|
String ONLINEMIN = "onlinemin";
|
||||||
|
|
||||||
|
String OFFLINEMIN = "offlinemin";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 数据完整性表公共字段
|
||||||
|
*/
|
||||||
|
String DUE = "DUE";
|
||||||
|
|
||||||
|
String REAL = "REAL";
|
||||||
|
|
||||||
|
String DEV_INDEX = "dev_id";
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -59,7 +59,7 @@ public class DataTest {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static void main(String[] args) {
|
public static void main(String[] args) {
|
||||||
InfluxDbUtils influxDBUtil = new InfluxDbUtils("root", "123456789", "http://192.168.1.16:8086", "pqsbase", "");
|
InfluxDbUtils influxDBUtil = new InfluxDbUtils("root", "123456789", "http://192.168.1.18:8086", "pqsbase", "");
|
||||||
insert(influxDBUtil);
|
insert(influxDBUtil);
|
||||||
//select(influxDBUtil);
|
//select(influxDBUtil);
|
||||||
}
|
}
|
||||||
@@ -79,118 +79,195 @@ public class DataTest {
|
|||||||
// fields.put("result",1);
|
// fields.put("result",1);
|
||||||
// influxDBUtil.insert("pqs_event_push_logs", tags, fields, time, TimeUnit.MILLISECONDS);
|
// influxDBUtil.insert("pqs_event_push_logs", tags, fields, time, TimeUnit.MILLISECONDS);
|
||||||
|
|
||||||
long time = Long.parseLong("1646180719000");
|
// long time = Long.parseLong("1654141002000");
|
||||||
Map<String, String> tags = new HashMap<>();
|
Map<String, String> tags = new HashMap<>();
|
||||||
tags.put("LineID", "fd4ffb0dd33eafaaf403b07a3fc1afe5");
|
// tags.put("line_id", "5e467a40023b299070682eb21f2ec9a1");
|
||||||
|
// Map<String, Object> fields = new HashMap<>();
|
||||||
|
// fields.put("vu_dev1",5.706);
|
||||||
|
// fields.put("vu_dev2",5.706);
|
||||||
|
// fields.put("vu_dev3",5.706);
|
||||||
|
// fields.put("vu_dev4",5.706);
|
||||||
|
// fields.put("vu_dev5",5.706);
|
||||||
|
// fields.put("freq_dev1",0.534);
|
||||||
|
// fields.put("freq_dev2",0.534);
|
||||||
|
// fields.put("freq_dev3",2.534);
|
||||||
|
// fields.put("freq_dev4",0.534);
|
||||||
|
// fields.put("freq_dev5",0.534);
|
||||||
|
// fields.put("data_plt1",0.604);
|
||||||
|
// fields.put("data_plt2",0.0);
|
||||||
|
// fields.put("data_plt3",0.691);
|
||||||
|
// fields.put("data_plt4",0.910);
|
||||||
|
// fields.put("data_plt5",0.691);
|
||||||
|
// fields.put("v_unbalance1",2.713);
|
||||||
|
// fields.put("v_unbalance2",2.713);
|
||||||
|
// fields.put("v_unbalance3",2.713);
|
||||||
|
// fields.put("v_unbalance4",2.713);
|
||||||
|
// fields.put("v_unbalance5",2.713);
|
||||||
|
// fields.put("v_thd1",20.001);
|
||||||
|
// fields.put("v_thd2",20.003);
|
||||||
|
// fields.put("v_thd3",20.00);
|
||||||
|
// fields.put("v_thd4",20.008);
|
||||||
|
// fields.put("v_thd5",20.00);
|
||||||
|
// fields.put("event1",1.619);
|
||||||
|
// fields.put("event2",1.619);
|
||||||
|
// fields.put("event3",1.619);
|
||||||
|
// fields.put("event4",1.619);
|
||||||
|
// fields.put("event5",1.619);
|
||||||
|
// influxDBUtil.insert("pqs_comasses", tags, fields, time, TimeUnit.MILLISECONDS);
|
||||||
|
// long time = Long.parseLong("1654141002000");
|
||||||
|
// tags.put("line_id", "5e467a40023b299070682eb21f2ec9a1");
|
||||||
|
// tags.put("phasic_type","C");
|
||||||
|
// Map<String, Object> fields = new HashMap<>();
|
||||||
|
// fields.put("alltime",1155);
|
||||||
|
// fields.put("flicker_alltime",550);
|
||||||
|
// fields.put("flicker_overtime",0);
|
||||||
|
// fields.put("freq_dev_overtime",0);
|
||||||
|
// fields.put("voltage_dev_overtime",0);
|
||||||
|
// fields.put("ubalance_overtime",0);
|
||||||
|
// fields.put("uaberrance_overtime",0);
|
||||||
|
// fields.put("i_neg_overtime",0);
|
||||||
|
// fields.put("uharm_2_overtime",0);
|
||||||
|
// fields.put("uharm_3_overtime",0);
|
||||||
|
// fields.put("uharm_4_overtime",0);
|
||||||
|
// fields.put("uharm_5_overtime",0);
|
||||||
|
// fields.put("uharm_6_overtime",0);
|
||||||
|
// fields.put("uharm_7_overtime",0);
|
||||||
|
// fields.put("uharm_8_overtime",0);
|
||||||
|
// fields.put("uharm_9_overtime",0);
|
||||||
|
// fields.put("uharm_10_overtime",0);
|
||||||
|
// fields.put("uharm_11_overtime",0);
|
||||||
|
// fields.put("uharm_12_overtime",0);
|
||||||
|
// fields.put("uharm_13_overtime",0);
|
||||||
|
// fields.put("uharm_14_overtime",0);
|
||||||
|
// fields.put("uharm_15_overtime",0);
|
||||||
|
// fields.put("uharm_16_overtime",0);
|
||||||
|
// fields.put("uharm_17_overtime",0);
|
||||||
|
// fields.put("uharm_18_overtime",0);
|
||||||
|
// fields.put("uharm_19_overtime",0);
|
||||||
|
// fields.put("uharm_20_overtime",0);
|
||||||
|
// fields.put("uharm_21_overtime",0);
|
||||||
|
// fields.put("uharm_22_overtime",0);
|
||||||
|
// fields.put("uharm_23_overtime",0);
|
||||||
|
// fields.put("uharm_24_overtime",0);
|
||||||
|
// fields.put("uharm_25_overtime",0);
|
||||||
|
// fields.put("iharm_2_overtime",0);
|
||||||
|
// fields.put("iharm_3_overtime",0);
|
||||||
|
// fields.put("iharm_4_overtime",0);
|
||||||
|
// fields.put("iharm_5_overtime",0);
|
||||||
|
// fields.put("iharm_6_overtime",0);
|
||||||
|
// fields.put("iharm_7_overtime",0);
|
||||||
|
// fields.put("iharm_8_overtime",0);
|
||||||
|
// fields.put("iharm_9_overtime",0);
|
||||||
|
// fields.put("iharm_10_overtime",0);
|
||||||
|
// fields.put("iharm_11_overtime",0);
|
||||||
|
// fields.put("iharm_12_overtime",0);
|
||||||
|
// fields.put("iharm_13_overtime",0);
|
||||||
|
// fields.put("iharm_14_overtime",0);
|
||||||
|
// fields.put("iharm_15_overtime",0);
|
||||||
|
// fields.put("iharm_16_overtime",0);
|
||||||
|
// fields.put("iharm_17_overtime",0);
|
||||||
|
// fields.put("iharm_18_overtime",0);
|
||||||
|
// fields.put("iharm_19_overtime",0);
|
||||||
|
// fields.put("iharm_20_overtime",0);
|
||||||
|
// fields.put("iharm_21_overtime",0);
|
||||||
|
// fields.put("iharm_22_overtime",0);
|
||||||
|
// fields.put("iharm_23_overtime",0);
|
||||||
|
// fields.put("iharm_24_overtime",0);
|
||||||
|
// fields.put("iharm_25_overtime",0);
|
||||||
|
// fields.put("inuharm_1_overtime",0);
|
||||||
|
// fields.put("inuharm_2_overtime",0);
|
||||||
|
// fields.put("inuharm_3_overtime",0);
|
||||||
|
// fields.put("inuharm_4_overtime",0);
|
||||||
|
// fields.put("inuharm_5_overtime",0);
|
||||||
|
// fields.put("inuharm_6_overtime",0);
|
||||||
|
// fields.put("inuharm_7_overtime",0);
|
||||||
|
// fields.put("inuharm_8_overtime",0);
|
||||||
|
// fields.put("inuharm_9_overtime",0);
|
||||||
|
// fields.put("inuharm_10_overtime",0);
|
||||||
|
// fields.put("inuharm_11_overtime",0);
|
||||||
|
// fields.put("inuharm_12_overtime",0);
|
||||||
|
// fields.put("inuharm_13_overtime",0);
|
||||||
|
// fields.put("inuharm_14_overtime",0);
|
||||||
|
// fields.put("inuharm_15_overtime",0);
|
||||||
|
// fields.put("inuharm_16_overtime",0);
|
||||||
|
// influxDBUtil.insert("limit_rate", tags, fields, time, TimeUnit.MILLISECONDS);
|
||||||
|
|
||||||
|
long time = Long.parseLong("1654141002000");
|
||||||
|
tags.put("line_id", "5e467a40023b299070682eb21f2ec9a1");
|
||||||
|
tags.put("phasic_type","A");
|
||||||
|
tags.put("value_type","CP95");
|
||||||
Map<String, Object> fields = new HashMap<>();
|
Map<String, Object> fields = new HashMap<>();
|
||||||
fields.put("VU_Dev1",5.706);
|
fields.put("voltage_dev",3.6);
|
||||||
fields.put("VU_Dev2",5.706);
|
fields.put("uvoltage_dev",-2.6);
|
||||||
fields.put("VU_Dev3",5.706);
|
fields.put("ubalance",6);
|
||||||
fields.put("VU_Dev4",5.706);
|
fields.put("flicker",0.6);
|
||||||
fields.put("VU_Dev5",5.706);
|
fields.put("uaberrance",2);
|
||||||
fields.put("Freq_Dev1",0.534);
|
fields.put("i_neg",20);
|
||||||
fields.put("Freq_Dev2",0.534);
|
fields.put("uharm_2",0);
|
||||||
fields.put("Freq_Dev3",2.534);
|
fields.put("uharm_3",0);
|
||||||
fields.put("Freq_Dev4",0.534);
|
fields.put("uharm_4",0);
|
||||||
fields.put("Freq_Dev5",0.534);
|
fields.put("uharm_5",0);
|
||||||
fields.put("Data_PST1",0.604);
|
fields.put("uharm_6",0);
|
||||||
fields.put("Data_PST2",0.0);
|
fields.put("uharm_7",0);
|
||||||
fields.put("Data_PST3",0.691);
|
fields.put("uharm_8",0);
|
||||||
fields.put("Data_PST4",0.910);
|
fields.put("uharm_9",0);
|
||||||
fields.put("Data_PST5",0.691);
|
fields.put("uharm_10",0);
|
||||||
fields.put("V_Unbalance1",2.713);
|
fields.put("uharm_11",10);
|
||||||
fields.put("V_Unbalance2",2.713);
|
fields.put("uharm_12",0);
|
||||||
fields.put("V_Unbalance3",2.713);
|
fields.put("uharm_13",0);
|
||||||
fields.put("V_Unbalance4",2.713);
|
fields.put("uharm_14",0);
|
||||||
fields.put("V_Unbalance5",2.713);
|
fields.put("uharm_15",0);
|
||||||
fields.put("V_THD1",20.001);
|
fields.put("uharm_16",15.3);
|
||||||
fields.put("V_THD2",20.003);
|
fields.put("uharm_17",0);
|
||||||
fields.put("V_THD3",20.00);
|
fields.put("uharm_18",0);
|
||||||
fields.put("V_THD4",20.008);
|
fields.put("uharm_19",0);
|
||||||
fields.put("V_THD5",20.00);
|
fields.put("uharm_20",0);
|
||||||
fields.put("Event1",1.619);
|
fields.put("uharm_21",0);
|
||||||
fields.put("Event2",1.619);
|
fields.put("uharm_22",0);
|
||||||
fields.put("Event3",1.619);
|
fields.put("uharm_23",0);
|
||||||
fields.put("Event4",1.619);
|
fields.put("uharm_24",0);
|
||||||
fields.put("Event5",1.619);
|
fields.put("uharm_25",0);
|
||||||
influxDBUtil.insert("PQS_COMASSES", tags, fields, time, TimeUnit.MILLISECONDS);
|
fields.put("iharm_2",0);
|
||||||
// long time = Long.parseLong("1647473742000");
|
fields.put("iharm_3",0);
|
||||||
// tags.put("MYINDEX", "df1ff413949f6d1fc07ffdb5440b4907");
|
fields.put("iharm_4",0);
|
||||||
// Map<String, Object> fields = new HashMap<>();
|
fields.put("iharm_5",6.02);
|
||||||
// fields.put("Phasic_Type","T");
|
fields.put("iharm_6",0);
|
||||||
// fields.put("AllTime",1155);
|
fields.put("iharm_7",0);
|
||||||
// fields.put("Flicker_AllTime",550);
|
fields.put("iharm_8",0);
|
||||||
// fields.put("Flicker_OverTime",0);
|
fields.put("iharm_9",0);
|
||||||
// fields.put("Freq_Dev_OverTime",0);
|
fields.put("iharm_10",0);
|
||||||
// fields.put("Voltage_Dev_OverTime",0);
|
fields.put("iharm_11",0);
|
||||||
// fields.put("UBalance_OverTime",0);
|
fields.put("iharm_12",0);
|
||||||
// fields.put("UAberrance_OverTime",0);
|
fields.put("iharm_13",0);
|
||||||
// fields.put("I_Neg_OverTime",0);
|
fields.put("iharm_14",0);
|
||||||
// fields.put("UHarm_2_OverTime",0);
|
fields.put("iharm_15",3.25);
|
||||||
// fields.put("UHarm_3_OverTime",0);
|
fields.put("iharm_16",0);
|
||||||
// fields.put("UHarm_4_OverTime",0);
|
fields.put("iharm_17",0);
|
||||||
// fields.put("UHarm_5_OverTime",0);
|
fields.put("iharm_18",0);
|
||||||
// fields.put("UHarm_6_OverTime",0);
|
fields.put("iharm_19",0);
|
||||||
// fields.put("UHarm_7_OverTime",0);
|
fields.put("iharm_20",0);
|
||||||
// fields.put("UHarm_8_OverTime",0);
|
fields.put("iharm_21",0);
|
||||||
// fields.put("UHarm_9_OverTime",0);
|
fields.put("iharm_22",0);
|
||||||
// fields.put("UHarm_10_OverTime",0);
|
fields.put("iharm_23",0);
|
||||||
// fields.put("UHarm_11_OverTime",0);
|
fields.put("iharm_24",3.52);
|
||||||
// fields.put("UHarm_12_OverTime",0);
|
fields.put("iharm_25",0);
|
||||||
// fields.put("UHarm_13_OverTime",0);
|
fields.put("inuharm_1",0);
|
||||||
// fields.put("UHarm_14_OverTime",0);
|
fields.put("inuharm_2",0);
|
||||||
// fields.put("UHarm_15_OverTime",0);
|
fields.put("inuharm_3",3.25);
|
||||||
// fields.put("UHarm_16_OverTime",0);
|
fields.put("inuharm_4",0);
|
||||||
// fields.put("UHarm_17_OverTime",0);
|
fields.put("inuharm_5",3.26);
|
||||||
// fields.put("UHarm_18_OverTime",0);
|
fields.put("inuharm_6",0);
|
||||||
// fields.put("UHarm_19_OverTime",0);
|
fields.put("inuharm_7",0);
|
||||||
// fields.put("UHarm_20_OverTime",0);
|
fields.put("inuharm_8",0);
|
||||||
// fields.put("UHarm_21_OverTime",0);
|
fields.put("inuharm_9",0);
|
||||||
// fields.put("UHarm_22_OverTime",0);
|
fields.put("inuharm_10",0);
|
||||||
// fields.put("UHarm_23_OverTime",0);
|
fields.put("inuharm_11",0);
|
||||||
// fields.put("UHarm_24_OverTime",0);
|
fields.put("inuharm_12",6.25);
|
||||||
// fields.put("UHarm_25_OverTime",0);
|
fields.put("inuharm_13",0);
|
||||||
// fields.put("IHarm_2_OverTime",0);
|
fields.put("inuharm_14",0);
|
||||||
// fields.put("IHarm_3_OverTime",0);
|
fields.put("inuharm_15",0);
|
||||||
// fields.put("IHarm_4_OverTime",0);
|
fields.put("inuharm_16",0);
|
||||||
// fields.put("IHarm_5_OverTime",0);
|
influxDBUtil.insert("pqs_abnormaldata", tags, fields, time, TimeUnit.MILLISECONDS);
|
||||||
// fields.put("IHarm_6_OverTime",0);
|
|
||||||
// fields.put("IHarm_7_OverTime",0);
|
|
||||||
// fields.put("IHarm_8_OverTime",0);
|
|
||||||
// fields.put("IHarm_9_OverTime",0);
|
|
||||||
// fields.put("IHarm_10_OverTime",0);
|
|
||||||
// fields.put("IHarm_11_OverTime",0);
|
|
||||||
// fields.put("IHarm_12_OverTime",0);
|
|
||||||
// fields.put("IHarm_13_OverTime",0);
|
|
||||||
// fields.put("IHarm_14_OverTime",0);
|
|
||||||
// fields.put("IHarm_15_OverTime",0);
|
|
||||||
// fields.put("IHarm_16_OverTime",0);
|
|
||||||
// fields.put("IHarm_17_OverTime",0);
|
|
||||||
// fields.put("IHarm_18_OverTime",0);
|
|
||||||
// fields.put("IHarm_19_OverTime",0);
|
|
||||||
// fields.put("IHarm_20_OverTime",0);
|
|
||||||
// fields.put("IHarm_21_OverTime",0);
|
|
||||||
// fields.put("IHarm_22_OverTime",0);
|
|
||||||
// fields.put("IHarm_23_OverTime",0);
|
|
||||||
// fields.put("IHarm_24_OverTime",0);
|
|
||||||
// fields.put("IHarm_25_OverTime",0);
|
|
||||||
// fields.put("InUHARM_1_OverTime",0);
|
|
||||||
// fields.put("InUHARM_2_OverTime",0);
|
|
||||||
// fields.put("InUHARM_3_OverTime",0);
|
|
||||||
// fields.put("InUHARM_4_OverTime",0);
|
|
||||||
// fields.put("InUHARM_5_OverTime",0);
|
|
||||||
// fields.put("InUHARM_6_OverTime",0);
|
|
||||||
// fields.put("InUHARM_7_OverTime",0);
|
|
||||||
// fields.put("InUHARM_8_OverTime",0);
|
|
||||||
// fields.put("InUHARM_9_OverTime",0);
|
|
||||||
// fields.put("InUHARM_10_OverTime",0);
|
|
||||||
// fields.put("InUHARM_11_OverTime",0);
|
|
||||||
// fields.put("InUHARM_12_OverTime",0);
|
|
||||||
// fields.put("InUHARM_13_OverTime",0);
|
|
||||||
// fields.put("InUHARM_14_OverTime",0);
|
|
||||||
// fields.put("InUHARM_15_OverTime",0);
|
|
||||||
// fields.put("InUHARM_16_OverTime",0);
|
|
||||||
// influxDBUtil.insert("LIMIT_RATE", tags, fields, time, TimeUnit.MILLISECONDS);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -53,6 +53,10 @@
|
|||||||
<groupId>com.nimbusds</groupId>
|
<groupId>com.nimbusds</groupId>
|
||||||
<artifactId>nimbus-jose-jwt</artifactId>
|
<artifactId>nimbus-jose-jwt</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.influxdb</groupId>
|
||||||
|
<artifactId>influxdb-java</artifactId>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
</dependencies>
|
</dependencies>
|
||||||
|
|
||||||
|
|||||||
@@ -120,12 +120,13 @@ public class ComAssesUtil {
|
|||||||
for(int i=0;i<pqsComasses.size();i++){
|
for(int i=0;i<pqsComasses.size();i++){
|
||||||
PqsComasses tempPqs=pqsComasses.get(i);
|
PqsComasses tempPqs=pqsComasses.get(i);
|
||||||
//组合二维数组
|
//组合二维数组
|
||||||
float f1[][]={{tempPqs.getFreqDev1(),tempPqs.getFreqDev2(),tempPqs.getFreqDev3(),tempPqs.getFreqDev4(),tempPqs.getFreqDev5()}
|
float f1[][]={{tempPqs.getFreqDev1().floatValue(),tempPqs.getFreqDev2().floatValue(),tempPqs.getFreqDev3().floatValue()
|
||||||
,{tempPqs.getVThd1(),tempPqs.getVThd2(),tempPqs.getVThd3(),tempPqs.getVThd4(),tempPqs.getVThd5(),}
|
,tempPqs.getFreqDev4().floatValue(),tempPqs.getFreqDev5().floatValue()}
|
||||||
,{tempPqs.getDataPst1(),tempPqs.getDataPst2(),tempPqs.getDataPst3(),tempPqs.getDataPst4(),tempPqs.getDataPst5()}
|
,{tempPqs.getVThd1().floatValue(),tempPqs.getVThd2().floatValue(),tempPqs.getVThd3().floatValue(),tempPqs.getVThd4().floatValue(),tempPqs.getVThd5().floatValue(),}
|
||||||
,{tempPqs.getVuDev1(),tempPqs.getVuDev2(),tempPqs.getVuDev3(),tempPqs.getVuDev4(),tempPqs.getVuDev5(),}
|
,{tempPqs.getDataPlt1().floatValue(),tempPqs.getDataPlt2().floatValue(),tempPqs.getDataPlt3().floatValue(),tempPqs.getDataPlt4().floatValue(),tempPqs.getDataPlt5().floatValue()}
|
||||||
,{tempPqs.getVUnbalance1(),tempPqs.getVUnbalance2(),tempPqs.getVUnbalance3(),tempPqs.getVUnbalance4(),tempPqs.getVUnbalance5(),}
|
,{tempPqs.getVuDev1().floatValue(),tempPqs.getVuDev2().floatValue(),tempPqs.getVuDev3().floatValue(),tempPqs.getVuDev4().floatValue(),tempPqs.getVuDev5().floatValue(),}
|
||||||
,{tempPqs.getEvent1(),tempPqs.getEvent2(),tempPqs.getEvent3(),tempPqs.getEvent4(),tempPqs.getEvent5(),}};
|
,{tempPqs.getVUnbalance1().floatValue(),tempPqs.getVUnbalance2().floatValue(),tempPqs.getVUnbalance3().floatValue(),tempPqs.getVUnbalance4().floatValue(),tempPqs.getVUnbalance5().floatValue(),}
|
||||||
|
,{tempPqs.getEvent1().floatValue(),tempPqs.getEvent2().floatValue(),tempPqs.getEvent3().floatValue(),tempPqs.getEvent4().floatValue(),tempPqs.getEvent5().floatValue(),}};
|
||||||
//获取该值返回的数据
|
//获取该值返回的数据
|
||||||
float temp=GetComAsses(f1);
|
float temp=GetComAsses(f1);
|
||||||
allData+=temp;
|
allData+=temp;
|
||||||
@@ -153,18 +154,22 @@ public class ComAssesUtil {
|
|||||||
for (i = 0; i < ST_QT_NUM; i++) {
|
for (i = 0; i < ST_QT_NUM; i++) {
|
||||||
sum[i] = 0;
|
sum[i] = 0;
|
||||||
for (j = 0; j < GRADE_NUM; j++) {
|
for (j = 0; j < GRADE_NUM; j++) {
|
||||||
if (Assess[i][j] != 0)
|
if (Assess[i][j] != 0) {
|
||||||
sum[i] += Assess[i][j] * (Math.log(Assess[i][j]) / Math.log(2.7183));
|
sum[i] += Assess[i][j] * (Math.log(Assess[i][j]) / Math.log(2.7183));
|
||||||
}
|
}
|
||||||
|
}
|
||||||
e[i] = -k * sum[i];
|
e[i] = -k * sum[i];
|
||||||
}
|
}
|
||||||
for (i = 0; i < ST_QT_NUM; i++)
|
for (i = 0; i < ST_QT_NUM; i++) {
|
||||||
d[i] = 1 - e[i];
|
d[i] = 1 - e[i];
|
||||||
|
}
|
||||||
sum[0] = 0;
|
sum[0] = 0;
|
||||||
for (i = 0; i < ST_QT_NUM; i++)
|
for (i = 0; i < ST_QT_NUM; i++) {
|
||||||
sum[0] += d[i];
|
sum[0] += d[i];
|
||||||
for (i = 0; i < ST_QT_NUM; i++)
|
}
|
||||||
|
for (i = 0; i < ST_QT_NUM; i++) {
|
||||||
Weight[i][METHOD_IDX4] = d[i] / sum[0];
|
Weight[i][METHOD_IDX4] = d[i] / sum[0];
|
||||||
|
}
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
logger.error(e.getMessage());
|
logger.error(e.getMessage());
|
||||||
blSqfFlag = false;
|
blSqfFlag = false;
|
||||||
@@ -189,28 +194,33 @@ public class ComAssesUtil {
|
|||||||
//求平均值
|
//求平均值
|
||||||
for (i = 0; i < ST_QT_NUM; i++) {
|
for (i = 0; i < ST_QT_NUM; i++) {
|
||||||
sum = 0;
|
sum = 0;
|
||||||
for (j = 0; j < GRADE_NUM; j++)
|
for (j = 0; j < GRADE_NUM; j++) {
|
||||||
sum += Assess[i][j];
|
sum += Assess[i][j];
|
||||||
|
}
|
||||||
avg_f[i] = sum / GRADE_NUM;
|
avg_f[i] = sum / GRADE_NUM;
|
||||||
}
|
}
|
||||||
//求标准差
|
//求标准差
|
||||||
for (i = 0; i < ST_QT_NUM; i++) {
|
for (i = 0; i < ST_QT_NUM; i++) {
|
||||||
sum = 0;
|
sum = 0;
|
||||||
for (j = 0; j < GRADE_NUM; j++)
|
for (j = 0; j < GRADE_NUM; j++) {
|
||||||
sum += Math.pow((Assess[i][j] - avg_f[i]), 2);
|
sum += Math.pow((Assess[i][j] - avg_f[i]), 2);
|
||||||
|
}
|
||||||
std_f[i] = (float) (Math.sqrt(sum / GRADE_NUM));
|
std_f[i] = (float) (Math.sqrt(sum / GRADE_NUM));
|
||||||
}
|
}
|
||||||
//求变异系数
|
//求变异系数
|
||||||
for (i = 0; i < ST_QT_NUM; i++) {
|
for (i = 0; i < ST_QT_NUM; i++) {
|
||||||
if (avg_f[i] < 0)
|
if (avg_f[i] < 0) {
|
||||||
avg_f[i] = 0 - avg_f[i];
|
avg_f[i] = 0 - avg_f[i];
|
||||||
|
}
|
||||||
byxs[i] = std_f[i] / avg_f[i];
|
byxs[i] = std_f[i] / avg_f[i];
|
||||||
}
|
}
|
||||||
sum = 0;
|
sum = 0;
|
||||||
for (i = 0; i < ST_QT_NUM; i++)
|
for (i = 0; i < ST_QT_NUM; i++) {
|
||||||
sum += byxs[i];
|
sum += byxs[i];
|
||||||
for (i = 0; i < ST_QT_NUM; i++)
|
}
|
||||||
|
for (i = 0; i < ST_QT_NUM; i++) {
|
||||||
Weight[i][METHOD_IDX5] = byxs[i] / sum;
|
Weight[i][METHOD_IDX5] = byxs[i] / sum;
|
||||||
|
}
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
logger.error(e.getMessage());
|
logger.error(e.getMessage());
|
||||||
blBysxfFlag = false;
|
blBysxfFlag = false;
|
||||||
@@ -234,31 +244,37 @@ public class ComAssesUtil {
|
|||||||
//求C
|
//求C
|
||||||
for (i = 0; i < ST_QT_NUM; i++) {
|
for (i = 0; i < ST_QT_NUM; i++) {
|
||||||
tmp1[i] = 0;
|
tmp1[i] = 0;
|
||||||
for (j = 0; j < GRADE_NUM; j++)
|
for (j = 0; j < GRADE_NUM; j++) {
|
||||||
tmp1[i] += 2 * METHOD_NUM * Math.pow(Assess[i][j], 2);
|
tmp1[i] += 2 * METHOD_NUM * Math.pow(Assess[i][j], 2);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
for (i = 0; i < ST_QT_NUM; i++) {
|
for (i = 0; i < ST_QT_NUM; i++) {
|
||||||
for (j = 0; j < ST_QT_NUM; j++) {
|
for (j = 0; j < ST_QT_NUM; j++) {
|
||||||
if (i == j)
|
if (i == j) {
|
||||||
C[i][j] = tmp1[i];
|
C[i][j] = tmp1[i];
|
||||||
else
|
}
|
||||||
|
else {
|
||||||
C[i][j] = 0;
|
C[i][j] = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
//求C的逆矩阵C1,由于C是对角矩阵,简化矩阵求逆
|
//求C的逆矩阵C1,由于C是对角矩阵,简化矩阵求逆
|
||||||
for (i = 0; i < ST_QT_NUM; i++) {
|
for (i = 0; i < ST_QT_NUM; i++) {
|
||||||
for (j = 0; j < ST_QT_NUM; j++) {
|
for (j = 0; j < ST_QT_NUM; j++) {
|
||||||
if (i == j)
|
if (i == j) {
|
||||||
C1[i][j] = (float) 1.0 / C[i][j];
|
C1[i][j] = (float) 1.0 / C[i][j];
|
||||||
else
|
}
|
||||||
|
else {
|
||||||
C1[i][j] = 0;
|
C1[i][j] = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
//求D
|
//求D
|
||||||
for (i = 0; i < ST_QT_NUM; i++) {
|
for (i = 0; i < ST_QT_NUM; i++) {
|
||||||
tmp1[i] = 0;
|
tmp1[i] = 0;
|
||||||
for (k = 0; k < METHOD_NUM; k++)
|
for (k = 0; k < METHOD_NUM; k++) {
|
||||||
tmp1[i] += Weight[i][k];
|
tmp1[i] += Weight[i][k];
|
||||||
|
}
|
||||||
tmp2[i] = 0;
|
tmp2[i] = 0;
|
||||||
for (j = 0; j < GRADE_NUM; j++) {
|
for (j = 0; j < GRADE_NUM; j++) {
|
||||||
tmp2[i] += tmp1[i] * Math.pow(Assess[i][j], 2);
|
tmp2[i] += tmp1[i] * Math.pow(Assess[i][j], 2);
|
||||||
@@ -266,30 +282,37 @@ public class ComAssesUtil {
|
|||||||
D[i] = 2 * tmp2[i];
|
D[i] = 2 * tmp2[i];
|
||||||
}
|
}
|
||||||
//e赋值
|
//e赋值
|
||||||
for (i = 0; i < ST_QT_NUM; i++)
|
for (i = 0; i < ST_QT_NUM; i++) {
|
||||||
e[i] = 1;
|
e[i] = 1;
|
||||||
|
}
|
||||||
//计算eT*C1
|
//计算eT*C1
|
||||||
for (i = 0; i < ST_QT_NUM; i++) {
|
for (i = 0; i < ST_QT_NUM; i++) {
|
||||||
tmp1[i] = 0;
|
tmp1[i] = 0;
|
||||||
for (j = 0; j < ST_QT_NUM; j++)
|
for (j = 0; j < ST_QT_NUM; j++) {
|
||||||
tmp1[i] += e[i] * C1[j][i];
|
tmp1[i] += e[i] * C1[j][i];
|
||||||
}
|
}
|
||||||
|
}
|
||||||
t1 = 0;
|
t1 = 0;
|
||||||
for (i = 0; i < ST_QT_NUM; i++)
|
for (i = 0; i < ST_QT_NUM; i++) {
|
||||||
t1 += tmp1[i] * e[i];
|
t1 += tmp1[i] * e[i];
|
||||||
|
}
|
||||||
t2 = 0;
|
t2 = 0;
|
||||||
for (i = 0; i < ST_QT_NUM; i++)
|
for (i = 0; i < ST_QT_NUM; i++) {
|
||||||
t2 += tmp1[i] * D[i];
|
t2 += tmp1[i] * D[i];
|
||||||
for (i = 0; i < ST_QT_NUM; i++)
|
}
|
||||||
|
for (i = 0; i < ST_QT_NUM; i++) {
|
||||||
e[i] = e[i] * ((1 - t2) / t1);
|
e[i] = e[i] * ((1 - t2) / t1);
|
||||||
for (i = 0; i < ST_QT_NUM; i++)
|
}
|
||||||
|
for (i = 0; i < ST_QT_NUM; i++) {
|
||||||
D[i] = D[i] + e[i];
|
D[i] = D[i] + e[i];
|
||||||
|
}
|
||||||
//求A
|
//求A
|
||||||
for (i = 0; i < ST_QT_NUM; i++) {
|
for (i = 0; i < ST_QT_NUM; i++) {
|
||||||
A[i] = 0;
|
A[i] = 0;
|
||||||
for (j = 0; j < ST_QT_NUM; j++)
|
for (j = 0; j < ST_QT_NUM; j++) {
|
||||||
A[i] += C1[i][j] * D[j];
|
A[i] += C1[i][j] * D[j];
|
||||||
}
|
}
|
||||||
|
}
|
||||||
} catch (Exception ex) {
|
} catch (Exception ex) {
|
||||||
logger.error(ex.getMessage());
|
logger.error(ex.getMessage());
|
||||||
blZhqzfFlag = false;
|
blZhqzfFlag = false;
|
||||||
|
|||||||
@@ -2,42 +2,109 @@ package com.njcn.web.utils;
|
|||||||
|
|
||||||
|
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
import org.influxdb.annotation.Column;
|
||||||
|
import org.influxdb.annotation.Measurement;
|
||||||
|
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
|
import java.time.Instant;
|
||||||
import java.time.LocalDateTime;
|
import java.time.LocalDateTime;
|
||||||
|
|
||||||
@Data
|
@Data
|
||||||
|
@Measurement(name = "pqs_comasses")
|
||||||
public class PqsComasses implements Serializable {
|
public class PqsComasses implements Serializable {
|
||||||
private LocalDateTime timeid;
|
@Column(name = "time")
|
||||||
|
private Instant timeid;
|
||||||
|
|
||||||
|
@Column(name = "line_id")
|
||||||
private String lineid;
|
private String lineid;
|
||||||
private float freqDev1;
|
|
||||||
private float freqDev2;
|
@Column(name = "freq_dev1")
|
||||||
private float freqDev3;
|
private Double freqDev1;
|
||||||
private float freqDev4;
|
|
||||||
private float freqDev5;
|
@Column(name = "freq_dev2")
|
||||||
private float vuDev1;
|
private Double freqDev2;
|
||||||
private float vuDev2;
|
|
||||||
private float vuDev3;
|
@Column(name = "freq_dev3")
|
||||||
private float vuDev4;
|
private Double freqDev3;
|
||||||
private float vuDev5;
|
|
||||||
private float dataPst1;
|
@Column(name = "freq_dev4")
|
||||||
private float dataPst2;
|
private Double freqDev4;
|
||||||
private float dataPst3;
|
|
||||||
private float dataPst4;
|
@Column(name = "freq_dev5")
|
||||||
private float dataPst5;
|
private Double freqDev5;
|
||||||
private float vUnbalance1;
|
|
||||||
private float vUnbalance2;
|
@Column(name = "vu_dev1")
|
||||||
private float vUnbalance3;
|
private Double vuDev1;
|
||||||
private float vUnbalance4;
|
|
||||||
private float vUnbalance5;
|
@Column(name = "vu_dev2")
|
||||||
private float vThd1;
|
private Double vuDev2;
|
||||||
private float vThd2;
|
|
||||||
private float vThd3;
|
@Column(name = "vu_dev3")
|
||||||
private float vThd4;
|
private Double vuDev3;
|
||||||
private float vThd5;
|
|
||||||
private float event1;
|
@Column(name = "vu_dev4")
|
||||||
private float event2;
|
private Double vuDev4;
|
||||||
private float event3;
|
|
||||||
private float event4;
|
@Column(name = "vu_dev5")
|
||||||
private float event5;
|
private Double vuDev5;
|
||||||
|
|
||||||
|
@Column(name = "data_plt1")
|
||||||
|
private Double dataPlt1;
|
||||||
|
|
||||||
|
@Column(name = "data_plt2")
|
||||||
|
private Double dataPlt2;
|
||||||
|
|
||||||
|
@Column(name = "data_plt3")
|
||||||
|
private Double dataPlt3;
|
||||||
|
|
||||||
|
@Column(name = "data_plt4")
|
||||||
|
private Double dataPlt4;
|
||||||
|
|
||||||
|
@Column(name = "data_plt5")
|
||||||
|
private Double dataPlt5;
|
||||||
|
|
||||||
|
@Column(name = "v_unbalance1")
|
||||||
|
private Double vUnbalance1;
|
||||||
|
|
||||||
|
@Column(name = "v_unbalance2")
|
||||||
|
private Double vUnbalance2;
|
||||||
|
|
||||||
|
@Column(name = "v_unbalance3")
|
||||||
|
private Double vUnbalance3;
|
||||||
|
|
||||||
|
@Column(name = "v_unbalance4")
|
||||||
|
private Double vUnbalance4;
|
||||||
|
|
||||||
|
@Column(name = "v_unbalance5")
|
||||||
|
private Double vUnbalance5;
|
||||||
|
|
||||||
|
@Column(name = "v_thd1")
|
||||||
|
private Double vThd1;
|
||||||
|
|
||||||
|
@Column(name = "v_thd2")
|
||||||
|
private Double vThd2;
|
||||||
|
|
||||||
|
@Column(name = "v_thd3")
|
||||||
|
private Double vThd3;
|
||||||
|
|
||||||
|
@Column(name = "v_thd4")
|
||||||
|
private Double vThd4;
|
||||||
|
|
||||||
|
@Column(name = "v_thd5")
|
||||||
|
private Double vThd5;
|
||||||
|
|
||||||
|
@Column(name = "event1")
|
||||||
|
private Double event1;
|
||||||
|
|
||||||
|
@Column(name = "event2")
|
||||||
|
private Double event2;
|
||||||
|
|
||||||
|
@Column(name = "event3")
|
||||||
|
private Double event3;
|
||||||
|
|
||||||
|
@Column(name = "event4")
|
||||||
|
private Double event4;
|
||||||
|
|
||||||
|
@Column(name = "event5")
|
||||||
|
private Double event5;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,9 +3,14 @@ package com.njcn.device.pojo.po;
|
|||||||
import com.baomidou.mybatisplus.annotation.TableName;
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
import com.njcn.db.bo.BaseEntity;
|
import com.njcn.db.bo.BaseEntity;
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
|
import java.time.Instant;
|
||||||
import java.time.LocalDateTime;
|
import java.time.LocalDateTime;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
import lombok.Getter;
|
import lombok.Getter;
|
||||||
import lombok.Setter;
|
import lombok.Setter;
|
||||||
|
import org.influxdb.annotation.Column;
|
||||||
|
import org.influxdb.annotation.Measurement;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* <p>
|
* <p>
|
||||||
@@ -15,9 +20,8 @@ import lombok.Setter;
|
|||||||
* @author cdf
|
* @author cdf
|
||||||
* @since 2022-01-07
|
* @since 2022-01-07
|
||||||
*/
|
*/
|
||||||
@Getter
|
@Data
|
||||||
@Setter
|
@Measurement(name = "pqs_communicate")
|
||||||
@TableName("pq_communicate")
|
|
||||||
public class Communicate {
|
public class Communicate {
|
||||||
|
|
||||||
private static final long serialVersionUID = 1L;
|
private static final long serialVersionUID = 1L;
|
||||||
@@ -25,21 +29,26 @@ public class Communicate {
|
|||||||
/**
|
/**
|
||||||
* 终端Id
|
* 终端Id
|
||||||
*/
|
*/
|
||||||
private String id;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 更新时间
|
* 更新时间
|
||||||
*/
|
*/
|
||||||
private LocalDateTime updateTime;
|
@Column(name = "time")
|
||||||
|
private Instant updateTime;
|
||||||
|
|
||||||
|
@Column(name = "line_id")
|
||||||
|
private String id;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 事件类型(0:中断;1:正常;2:退出)
|
* 事件类型(0:中断;1:正常;2:退出)
|
||||||
*/
|
*/
|
||||||
|
@Column(name = "type")
|
||||||
private Integer type;
|
private Integer type;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 备注
|
* 备注
|
||||||
*/
|
*/
|
||||||
|
@Column(name = "description")
|
||||||
private String remark;
|
private String remark;
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -22,4 +22,6 @@ public class SubstationDetailVO implements Serializable {
|
|||||||
private Double coordX;
|
private Double coordX;
|
||||||
|
|
||||||
private String color;
|
private String color;
|
||||||
|
|
||||||
|
private String scale;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7,12 +7,16 @@
|
|||||||
line.NAME srbName,
|
line.NAME srbName,
|
||||||
sub.Lng coordY,
|
sub.Lng coordY,
|
||||||
sub.Lat coordX,
|
sub.Lat coordX,
|
||||||
"blue" color
|
"blue" color,
|
||||||
|
dic.name scale
|
||||||
FROM
|
FROM
|
||||||
pq_line line,
|
pq_line line,
|
||||||
pq_substation sub
|
pq_substation sub,
|
||||||
|
sys_dict_data dic
|
||||||
WHERE
|
WHERE
|
||||||
line.Id = sub.Id
|
line.Id = sub.Id
|
||||||
|
and
|
||||||
|
sub.scale = dic.id
|
||||||
AND
|
AND
|
||||||
sub.Id IN
|
sub.Id IN
|
||||||
<foreach collection="id" item="item" open="(" close=")" separator=",">
|
<foreach collection="id" item="item" open="(" close=")" separator=",">
|
||||||
|
|||||||
@@ -21,6 +21,7 @@ import com.njcn.device.pojo.param.DeviceInfoParam;
|
|||||||
import com.njcn.device.pojo.po.*;
|
import com.njcn.device.pojo.po.*;
|
||||||
import com.njcn.device.pojo.vo.*;
|
import com.njcn.device.pojo.vo.*;
|
||||||
import com.njcn.device.service.LineService;
|
import com.njcn.device.service.LineService;
|
||||||
|
import com.njcn.influxdb.param.InfluxDBPublicParam;
|
||||||
import com.njcn.influxdb.utils.InfluxDbUtils;
|
import com.njcn.influxdb.utils.InfluxDbUtils;
|
||||||
import com.njcn.system.api.AreaFeignClient;
|
import com.njcn.system.api.AreaFeignClient;
|
||||||
import com.njcn.system.api.DicDataFeignClient;
|
import com.njcn.system.api.DicDataFeignClient;
|
||||||
@@ -38,8 +39,10 @@ import org.springframework.util.CollectionUtils;
|
|||||||
|
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
import java.text.SimpleDateFormat;
|
import java.text.SimpleDateFormat;
|
||||||
|
import java.time.Instant;
|
||||||
import java.time.format.DateTimeFormatter;
|
import java.time.format.DateTimeFormatter;
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
|
import java.util.concurrent.TimeUnit;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
import java.util.stream.Stream;
|
import java.util.stream.Stream;
|
||||||
|
|
||||||
@@ -152,18 +155,17 @@ public class LineServiceImpl extends ServiceImpl<LineMapper, Line> implements Li
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public CommunicateVO getComFlagInfoData(String id, String searchBeginTime, String searchEndTime) {
|
public CommunicateVO getComFlagInfoData(String id, String searchBeginTime, String searchEndTime) {
|
||||||
DateTimeFormatter df = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
|
SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
||||||
String devId = getLineIdByDevId(id);
|
List<Communicate> communicateList = getCommunicate(id,searchBeginTime,searchEndTime);
|
||||||
QueryWrapper<Communicate> queryWrapper = new QueryWrapper<>();
|
|
||||||
queryWrapper.lambda().eq(Communicate::getId, devId)
|
|
||||||
.between(Communicate::getUpdateTime, PubUtils.beginTimeToLocalDateTime(searchBeginTime), PubUtils.endTimeToLocalDateTime(searchEndTime));
|
|
||||||
queryWrapper.orderBy(true, true, "pq_communicate.update_time");
|
|
||||||
List<Communicate> communicateList = communicateMapper.selectList(queryWrapper);
|
|
||||||
CommunicateVO communicateVOList = new CommunicateVO();
|
CommunicateVO communicateVOList = new CommunicateVO();
|
||||||
List<String> updateTime = new ArrayList<>();
|
List<String> updateTime = new ArrayList<>();
|
||||||
List<Integer> comType = new ArrayList<>();
|
List<Integer> comType = new ArrayList<>();
|
||||||
for (Communicate communicate : communicateList) {
|
for (Communicate communicate : communicateList) {
|
||||||
updateTime.add(df.format(communicate.getUpdateTime()));
|
//转化时间
|
||||||
|
Instant now = communicate.getUpdateTime().plusMillis(TimeUnit.HOURS.toMillis(8));
|
||||||
|
Long time = now.toEpochMilli();
|
||||||
|
String timeText = df.format(time);
|
||||||
|
updateTime.add(timeText);
|
||||||
comType.add(communicate.getType());
|
comType.add(communicate.getType());
|
||||||
}
|
}
|
||||||
communicateVOList.setUpdateTime(updateTime);
|
communicateVOList.setUpdateTime(updateTime);
|
||||||
@@ -541,6 +543,7 @@ public class LineServiceImpl extends ServiceImpl<LineMapper, Line> implements Li
|
|||||||
stringBuilder.append("dev_index ='").append(devIndexs.get(i)).append("' ");
|
stringBuilder.append("dev_index ='").append(devIndexs.get(i)).append("' ");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
stringBuilder.append(InfluxDBPublicParam.TIME_ZONE);
|
||||||
String sql = "select sum(onlinemin)/(sum(onlinemin) +sum(offlinemin))*100 as onlinerate from pqs_onlinerate where " + stringBuilder.toString() + "group by dev_index";
|
String sql = "select sum(onlinemin)/(sum(onlinemin) +sum(offlinemin))*100 as onlinerate from pqs_onlinerate where " + stringBuilder.toString() + "group by dev_index";
|
||||||
//获取暂降事件
|
//获取暂降事件
|
||||||
QueryResult result = influxDbUtils.query(sql);
|
QueryResult result = influxDbUtils.query(sql);
|
||||||
@@ -641,4 +644,17 @@ public class LineServiceImpl extends ServiceImpl<LineMapper, Line> implements Li
|
|||||||
return staticsValue;
|
return staticsValue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public List<Communicate> getCommunicate(String lineIndex, String startTime,String endTime) {
|
||||||
|
//组装sql语句
|
||||||
|
StringBuilder stringBuilder = new StringBuilder();
|
||||||
|
stringBuilder.append("time >= '").append(DateUtil.beginOfDay(DateUtil.parse(startTime))).append("' and ").append("time <= '").append(DateUtil.endOfDay(DateUtil.parse(endTime))).append("' and ");
|
||||||
|
stringBuilder.append("line_id = '").append(lineIndex).append("' group by line_id ").append(InfluxDBPublicParam.TIME_ZONE);
|
||||||
|
String sql = "select * from "+InfluxDBPublicParam.PQS_COMMUNICATE+" where " + stringBuilder.toString();
|
||||||
|
//获取暂降事件
|
||||||
|
QueryResult result = influxDbUtils.query(sql);
|
||||||
|
InfluxDBResultMapper influxDBResultMapper = new InfluxDBResultMapper();
|
||||||
|
List<Communicate> communicateList = influxDBResultMapper.toPOJO(result, Communicate.class);
|
||||||
|
return communicateList;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -22,6 +22,7 @@ public interface Param {
|
|||||||
* 终端在线率表公共字段
|
* 终端在线率表公共字段
|
||||||
*/
|
*/
|
||||||
String ONLINEMIN = "onlinemin";
|
String ONLINEMIN = "onlinemin";
|
||||||
|
|
||||||
String OFFLINEMIN = "offlinemin";
|
String OFFLINEMIN = "offlinemin";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -1,15 +1,18 @@
|
|||||||
package com.njcn.harmonic.service.impl;
|
package com.njcn.harmonic.service.impl;
|
||||||
|
|
||||||
|
import com.njcn.device.pojo.po.Communicate;
|
||||||
import com.njcn.harmonic.constant.Param;
|
import com.njcn.harmonic.constant.Param;
|
||||||
import com.njcn.harmonic.pojo.param.PulicTimeStatisParam;
|
import com.njcn.harmonic.pojo.param.PulicTimeStatisParam;
|
||||||
import com.njcn.harmonic.pojo.vo.AssesVO;
|
import com.njcn.harmonic.pojo.vo.AssesVO;
|
||||||
import com.njcn.harmonic.service.AssesService;
|
import com.njcn.harmonic.service.AssesService;
|
||||||
|
import com.njcn.influxdb.param.InfluxDBPublicParam;
|
||||||
import com.njcn.influxdb.utils.InfluxDbUtils;
|
import com.njcn.influxdb.utils.InfluxDbUtils;
|
||||||
import com.njcn.web.utils.ComAssesUtil;
|
import com.njcn.web.utils.ComAssesUtil;
|
||||||
import com.njcn.web.utils.PqsComasses;
|
import com.njcn.web.utils.PqsComasses;
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
import org.apache.commons.lang.StringUtils;
|
import org.apache.commons.lang.StringUtils;
|
||||||
import org.influxdb.dto.QueryResult;
|
import org.influxdb.dto.QueryResult;
|
||||||
|
import org.influxdb.impl.InfluxDBResultMapper;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import org.springframework.util.CollectionUtils;
|
import org.springframework.util.CollectionUtils;
|
||||||
|
|
||||||
@@ -48,88 +51,56 @@ public class AssesServiceImpl implements AssesService {
|
|||||||
* 查询监测点的数据完整性
|
* 查询监测点的数据完整性
|
||||||
*/
|
*/
|
||||||
private Float getCondition(String lineList, String startTime, String endTime) {
|
private Float getCondition(String lineList, String startTime, String endTime) {
|
||||||
List<PqsComasses> pqsComasses = new ArrayList<>();
|
|
||||||
float synData;
|
float synData;
|
||||||
if (!lineList.isEmpty()) {
|
if (!lineList.isEmpty()) {
|
||||||
//组装sql语句
|
//组装sql语句
|
||||||
StringBuilder stringBuilder = new StringBuilder();
|
StringBuilder stringBuilder = new StringBuilder();
|
||||||
stringBuilder.append(Param.TIME + " >= '").append(startTime).append(Param.START_TIME).append("' and ").append(Param.TIME).append(" <= '").append(endTime).append(Param.END_TIME).append("' and (");
|
stringBuilder.append(InfluxDBPublicParam.TIME + " >= '").append(startTime).append(InfluxDBPublicParam.START_TIME).append("' and ").append(InfluxDBPublicParam.TIME).append(" <= '").append(endTime).append(InfluxDBPublicParam.END_TIME).append("' and (");
|
||||||
//sql语句
|
//sql语句
|
||||||
stringBuilder.append(Param.LINEID + "='").append(lineList).append("')");
|
stringBuilder.append(InfluxDBPublicParam.LINE_ID + "='").append(lineList).append("')");
|
||||||
|
stringBuilder.append(" group by " + InfluxDBPublicParam.LINE_ID).append(" ");
|
||||||
|
stringBuilder.append(InfluxDBPublicParam.TIME_ZONE);
|
||||||
String sql = "SELECT" +
|
String sql = "SELECT" +
|
||||||
" MEAN(Freq_Dev1) AS freDev1," +
|
" MEAN(freq_dev1) AS freq_dev1," +
|
||||||
" MEAN(Freq_Dev2) AS freDev2," +
|
" MEAN(freq_dev2) AS freq_dev2," +
|
||||||
" MEAN(Freq_Dev3) AS freDev3," +
|
" MEAN(freq_dev3) AS freq_dev3," +
|
||||||
" MEAN(Freq_Dev4) AS freDev4," +
|
" MEAN(freq_dev4) AS freq_dev4," +
|
||||||
" MEAN(Freq_Dev5) AS freDev5," +
|
" MEAN(freq_dev5) AS freq_dev5," +
|
||||||
" MEAN(VU_Dev1) AS vuDev1," +
|
" MEAN(vu_dev1) AS vu_dev1," +
|
||||||
" MEAN(VU_Dev2) AS vuDev2," +
|
" MEAN(vu_dev2) AS vu_dev2," +
|
||||||
" MEAN(VU_Dev3) AS vuDev3," +
|
" MEAN(vu_dev3) AS vu_dev3," +
|
||||||
" MEAN(VU_Dev4) AS vuDev4," +
|
" MEAN(vu_dev4) AS vu_dev4," +
|
||||||
" MEAN(VU_Dev5) AS vuDev5," +
|
" MEAN(vu_dev5) AS vu_dev5," +
|
||||||
" MEAN(Data_PLT1) AS dataPlt1," +
|
" MEAN(data_plt1) AS data_plt1," +
|
||||||
" MEAN(Data_PLT2) AS dataPlt2," +
|
" MEAN(data_plt2) AS data_plt2," +
|
||||||
" MEAN(Data_PLT3) AS dataPlt3," +
|
" MEAN(data_plt3) AS data_plt3," +
|
||||||
" MEAN(Data_PLT4) AS dataPlt4," +
|
" MEAN(data_plt4) AS data_plt4," +
|
||||||
" MEAN(Data_PLT5) AS dataPlt5," +
|
" MEAN(data_plt5) AS data_plt5," +
|
||||||
" MEAN(V_Unbalance1) AS vUnbalance1," +
|
" MEAN(v_unbalance1) AS v_unbalance1," +
|
||||||
" MEAN(V_Unbalance2) AS vUnbalance2," +
|
" MEAN(v_unbalance2) AS v_unbalance2," +
|
||||||
" MEAN(V_Unbalance3) AS vUnbalance3," +
|
" MEAN(v_unbalance3) AS v_unbalance3," +
|
||||||
" MEAN(V_Unbalance4) AS vUnbalance4," +
|
" MEAN(v_unbalance4) AS v_unbalance4," +
|
||||||
" MEAN(V_Unbalance5) AS vUnbalance5," +
|
" MEAN(v_unbalance5) AS v_unbalance5," +
|
||||||
" MEAN(V_THD1) AS vThd1," +
|
" MEAN(v_thd1) AS v_thd1," +
|
||||||
" MEAN(V_THD2) AS vThd2," +
|
" MEAN(v_thd2) AS v_thd2," +
|
||||||
" MEAN(V_THD3) AS vThd3," +
|
" MEAN(v_thd3) AS v_thd3," +
|
||||||
" MEAN(V_THD4) AS vThd4," +
|
" MEAN(v_thd4) AS v_thd4," +
|
||||||
" MEAN(V_THD5) AS vThd5," +
|
" MEAN(v_thd5) AS v_thd5," +
|
||||||
" MEAN(Event1) AS event1," +
|
" MEAN(event1) AS event1," +
|
||||||
" MEAN(Event2) AS event2," +
|
" MEAN(event2) AS event2," +
|
||||||
" MEAN(Event3) AS event3," +
|
" MEAN(event3) AS event3," +
|
||||||
" MEAN(Event4) AS event4," +
|
" MEAN(event4) AS event4," +
|
||||||
" MEAN(Event5) AS event5" +
|
" MEAN(event5) AS event5" +
|
||||||
" FROM" +
|
" FROM" +
|
||||||
" PQS_COMASSES" +
|
" pqs_comasses" +
|
||||||
" where " + stringBuilder.toString() +
|
" where " + stringBuilder.toString();
|
||||||
" group by " + Param.LINEID;
|
|
||||||
//结果集
|
//结果集
|
||||||
QueryResult result = influxDbUtils.query(sql);
|
QueryResult result = influxDbUtils.query(sql);
|
||||||
//处理结果集
|
//处理结果集
|
||||||
List<QueryResult.Series> list = result.getResults().get(0).getSeries();
|
InfluxDBResultMapper influxDBResultMapper = new InfluxDBResultMapper();
|
||||||
if (!CollectionUtils.isEmpty(list)) {
|
List<PqsComasses> communicateList = influxDBResultMapper.toPOJO(result, PqsComasses.class);
|
||||||
List<List<Object>> valueList = list.get(0).getValues();
|
if (!CollectionUtils.isEmpty(communicateList)) {
|
||||||
PqsComasses pqsComassesData = new PqsComasses();
|
synData = comAssesUtil.getAllComAss(communicateList);
|
||||||
List<Object> value = valueList.get(0);
|
|
||||||
pqsComassesData.setFreqDev1(BigDecimal.valueOf(Float.parseFloat(value.get(1).toString())).setScale(4, BigDecimal.ROUND_HALF_UP).floatValue());
|
|
||||||
pqsComassesData.setFreqDev2(BigDecimal.valueOf(Float.parseFloat(value.get(2).toString())).setScale(4, BigDecimal.ROUND_HALF_UP).floatValue());
|
|
||||||
pqsComassesData.setFreqDev3(BigDecimal.valueOf(Float.parseFloat(value.get(3).toString())).setScale(4, BigDecimal.ROUND_HALF_UP).floatValue());
|
|
||||||
pqsComassesData.setFreqDev4(BigDecimal.valueOf(Float.parseFloat(value.get(4).toString())).setScale(4, BigDecimal.ROUND_HALF_UP).floatValue());
|
|
||||||
pqsComassesData.setFreqDev5(BigDecimal.valueOf(Float.parseFloat(value.get(5).toString())).setScale(4, BigDecimal.ROUND_HALF_UP).floatValue());
|
|
||||||
pqsComassesData.setVuDev1(BigDecimal.valueOf(Float.parseFloat(value.get(6).toString())).setScale(4, BigDecimal.ROUND_HALF_UP).floatValue());
|
|
||||||
pqsComassesData.setVuDev2(BigDecimal.valueOf(Float.parseFloat(value.get(7).toString())).setScale(4, BigDecimal.ROUND_HALF_UP).floatValue());
|
|
||||||
pqsComassesData.setVuDev3(BigDecimal.valueOf(Float.parseFloat(value.get(8).toString())).setScale(4, BigDecimal.ROUND_HALF_UP).floatValue());
|
|
||||||
pqsComassesData.setVuDev4(BigDecimal.valueOf(Float.parseFloat(value.get(9).toString())).setScale(4, BigDecimal.ROUND_HALF_UP).floatValue());
|
|
||||||
pqsComassesData.setVuDev5(BigDecimal.valueOf(Float.parseFloat(value.get(10).toString())).setScale(4, BigDecimal.ROUND_HALF_UP).floatValue());
|
|
||||||
pqsComassesData.setDataPst1(BigDecimal.valueOf(Float.parseFloat(value.get(11).toString())).setScale(4, BigDecimal.ROUND_HALF_UP).floatValue());
|
|
||||||
pqsComassesData.setDataPst2(BigDecimal.valueOf(Float.parseFloat(value.get(12).toString())).setScale(4, BigDecimal.ROUND_HALF_UP).floatValue());
|
|
||||||
pqsComassesData.setDataPst3(BigDecimal.valueOf(Float.parseFloat(value.get(13).toString())).setScale(4, BigDecimal.ROUND_HALF_UP).floatValue());
|
|
||||||
pqsComassesData.setDataPst4(BigDecimal.valueOf(Float.parseFloat(value.get(14).toString())).setScale(4, BigDecimal.ROUND_HALF_UP).floatValue());
|
|
||||||
pqsComassesData.setDataPst5(BigDecimal.valueOf(Float.parseFloat(value.get(15).toString())).setScale(4, BigDecimal.ROUND_HALF_UP).floatValue());
|
|
||||||
pqsComassesData.setVUnbalance1(BigDecimal.valueOf(Float.parseFloat(value.get(16).toString())).setScale(4, BigDecimal.ROUND_HALF_UP).floatValue());
|
|
||||||
pqsComassesData.setVUnbalance2(BigDecimal.valueOf(Float.parseFloat(value.get(17).toString())).setScale(4, BigDecimal.ROUND_HALF_UP).floatValue());
|
|
||||||
pqsComassesData.setVUnbalance3(BigDecimal.valueOf(Float.parseFloat(value.get(18).toString())).setScale(4, BigDecimal.ROUND_HALF_UP).floatValue());
|
|
||||||
pqsComassesData.setVUnbalance4(BigDecimal.valueOf(Float.parseFloat(value.get(19).toString())).setScale(4, BigDecimal.ROUND_HALF_UP).floatValue());
|
|
||||||
pqsComassesData.setVUnbalance5(BigDecimal.valueOf(Float.parseFloat(value.get(20).toString())).setScale(4, BigDecimal.ROUND_HALF_UP).floatValue());
|
|
||||||
pqsComassesData.setVThd1(BigDecimal.valueOf(Float.parseFloat(value.get(21).toString())).setScale(4, BigDecimal.ROUND_HALF_UP).floatValue());
|
|
||||||
pqsComassesData.setVThd2(BigDecimal.valueOf(Float.parseFloat(value.get(22).toString())).setScale(4, BigDecimal.ROUND_HALF_UP).floatValue());
|
|
||||||
pqsComassesData.setVThd3(BigDecimal.valueOf(Float.parseFloat(value.get(23).toString())).setScale(4, BigDecimal.ROUND_HALF_UP).floatValue());
|
|
||||||
pqsComassesData.setVThd4(BigDecimal.valueOf(Float.parseFloat(value.get(24).toString())).setScale(4, BigDecimal.ROUND_HALF_UP).floatValue());
|
|
||||||
pqsComassesData.setVThd5(BigDecimal.valueOf(Float.parseFloat(value.get(25).toString())).setScale(4, BigDecimal.ROUND_HALF_UP).floatValue());
|
|
||||||
pqsComassesData.setEvent1(BigDecimal.valueOf(Float.parseFloat(value.get(26).toString())).setScale(4, BigDecimal.ROUND_HALF_UP).floatValue());
|
|
||||||
pqsComassesData.setEvent2(BigDecimal.valueOf(Float.parseFloat(value.get(27).toString())).setScale(4, BigDecimal.ROUND_HALF_UP).floatValue());
|
|
||||||
pqsComassesData.setEvent3(BigDecimal.valueOf(Float.parseFloat(value.get(28).toString())).setScale(4, BigDecimal.ROUND_HALF_UP).floatValue());
|
|
||||||
pqsComassesData.setEvent4(BigDecimal.valueOf(Float.parseFloat(value.get(29).toString())).setScale(4, BigDecimal.ROUND_HALF_UP).floatValue());
|
|
||||||
pqsComassesData.setEvent5(BigDecimal.valueOf(Float.parseFloat(value.get(30).toString())).setScale(4, BigDecimal.ROUND_HALF_UP).floatValue());
|
|
||||||
pqsComasses.add(pqsComassesData);
|
|
||||||
} else {
|
} else {
|
||||||
//有监测点,但是无数据的处理
|
//有监测点,但是无数据的处理
|
||||||
return 3.14159f;
|
return 3.14159f;
|
||||||
@@ -138,7 +109,6 @@ public class AssesServiceImpl implements AssesService {
|
|||||||
//无监测点前台统一替换为“/”
|
//无监测点前台统一替换为“/”
|
||||||
return 3.1415f;
|
return 3.1415f;
|
||||||
}
|
}
|
||||||
synData = comAssesUtil.getAllComAss(pqsComasses);
|
|
||||||
return synData;
|
return synData;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ import com.njcn.harmonic.pojo.param.PulicTimeParam;
|
|||||||
import com.njcn.harmonic.pojo.param.PulicTimeStatisParam;
|
import com.njcn.harmonic.pojo.param.PulicTimeStatisParam;
|
||||||
import com.njcn.harmonic.pojo.vo.CommunicateStatisticsVO;
|
import com.njcn.harmonic.pojo.vo.CommunicateStatisticsVO;
|
||||||
import com.njcn.harmonic.service.CommunicateService;
|
import com.njcn.harmonic.service.CommunicateService;
|
||||||
|
import com.njcn.influxdb.param.InfluxDBPublicParam;
|
||||||
import com.njcn.influxdb.utils.InfluxDbUtils;
|
import com.njcn.influxdb.utils.InfluxDbUtils;
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
import org.apache.commons.lang.StringUtils;
|
import org.apache.commons.lang.StringUtils;
|
||||||
@@ -63,16 +64,17 @@ public class CommunicateServiceImpl implements CommunicateService {
|
|||||||
final Float[] resultList = {0.0f};
|
final Float[] resultList = {0.0f};
|
||||||
//组装sql语句
|
//组装sql语句
|
||||||
StringBuilder stringBuilder = new StringBuilder();
|
StringBuilder stringBuilder = new StringBuilder();
|
||||||
stringBuilder.append(Param.TIME + " >= '").append(startTime).append(Param.START_TIME).append("' and ").append(Param.TIME).append(" <= '").append(endTime).append(Param.END_TIME).append("' and (");
|
stringBuilder.append(InfluxDBPublicParam.TIME + " >= '").append(startTime).append(InfluxDBPublicParam.START_TIME).append("' and ").append(InfluxDBPublicParam.TIME).append(" <= '").append(endTime).append(InfluxDBPublicParam.END_TIME).append("' and (");
|
||||||
//sql语句
|
//sql语句
|
||||||
String sql = "";
|
String sql = "";
|
||||||
if (state == 0) {
|
if (state == 0) {
|
||||||
stringBuilder.append(Param.LINE_INDEX + "='").append(lineList).append("')");
|
stringBuilder.append(InfluxDBPublicParam.LINE_ID + "='").append(lineList).append("')");
|
||||||
sql = "SELECT SUM(" + Param.REAL + ")/SUM(" + Param.DUE + ") AS integrity FROM PQS_INTEGRITY WHERE " + stringBuilder.toString() + " group by " + Param.LINE_INDEX;
|
sql = "SELECT SUM(" + InfluxDBPublicParam.REAL+ ")/SUM(" + InfluxDBPublicParam.DUE + ") AS integrity FROM pqs_integrity WHERE " + stringBuilder.toString() + " group by " + InfluxDBPublicParam.LINE_ID;
|
||||||
} else {
|
} else {
|
||||||
stringBuilder.append(Param.DEV_INDEX + "='").append(lineList).append("')");
|
stringBuilder.append(InfluxDBPublicParam.DEV_INDEX + "='").append(lineList).append("')");
|
||||||
sql = "SELECT SUM(" + Param.ONLINEMIN + ")/(SUM(" + Param.OFFLINEMIN + ")+SUM(" + Param.ONLINEMIN + ")) AS onlineRate FROM PQS_ONLINERATE WHERE " + stringBuilder.toString() + " group by " + Param.DEV_INDEX;
|
sql = "SELECT SUM(" + InfluxDBPublicParam.ONLINEMIN + ")/(SUM(" + InfluxDBPublicParam.OFFLINEMIN + ")+SUM(" + InfluxDBPublicParam.ONLINEMIN + ")) AS onlineRate FROM pqs_onlinerate WHERE " + stringBuilder.toString() + " group by " + InfluxDBPublicParam.DEV_INDEX;
|
||||||
}
|
}
|
||||||
|
stringBuilder.append(InfluxDBPublicParam.TIME_ZONE);
|
||||||
//结果集
|
//结果集
|
||||||
QueryResult result = influxDbUtils.query(sql);
|
QueryResult result = influxDbUtils.query(sql);
|
||||||
//处理结果集
|
//处理结果集
|
||||||
|
|||||||
@@ -25,8 +25,10 @@ import org.springframework.util.CollectionUtils;
|
|||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
import java.text.DateFormat;
|
import java.text.DateFormat;
|
||||||
import java.text.SimpleDateFormat;
|
import java.text.SimpleDateFormat;
|
||||||
|
import java.time.Instant;
|
||||||
import java.time.format.DateTimeFormatter;
|
import java.time.format.DateTimeFormatter;
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
|
import java.util.concurrent.TimeUnit;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author denghuajun
|
* @author denghuajun
|
||||||
@@ -45,19 +47,22 @@ public class HistoryResultServiceImpl implements HistoryResultService {
|
|||||||
@Override
|
@Override
|
||||||
public List<HistoryDataResultVO> getHistoryResult(HistoryParam historyParam) {
|
public List<HistoryDataResultVO> getHistoryResult(HistoryParam historyParam) {
|
||||||
List<HistoryDataResultVO> historyDataResultVOList = new ArrayList<>();
|
List<HistoryDataResultVO> historyDataResultVOList = new ArrayList<>();
|
||||||
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
|
|
||||||
//获取监测点
|
//获取监测点
|
||||||
String[] points = historyParam.getLineId();
|
String[] points = historyParam.getLineId();
|
||||||
|
SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss.SSS");
|
||||||
Integer number = 0;
|
Integer number = 0;
|
||||||
for (int i = 0; i < points.length; i++) {
|
for (int i = 0; i < points.length; i++) {
|
||||||
HistoryDataResultVO historyDataResultVO;
|
HistoryDataResultVO historyDataResultVO;
|
||||||
List<EventDetail> eventDetailList = eventDetailFeignClient.getEventDetailData(points[i],historyParam.getSearchBeginTime(),historyParam.getSearchEndTime()).getData();
|
List<EventDetail> eventDetailList = eventDetailFeignClient.getEventDetailData(points[i], historyParam.getSearchBeginTime(), historyParam.getSearchEndTime()).getData();
|
||||||
List<EventDetailVO> eventDetailVOList = new ArrayList<>();
|
List<EventDetailVO> eventDetailVOList = new ArrayList<>();
|
||||||
if (!eventDetailList.isEmpty()) {
|
if (!eventDetailList.isEmpty()) {
|
||||||
for (EventDetail eventdetail : eventDetailList) {
|
for (EventDetail eventdetail : eventDetailList) {
|
||||||
|
Instant now = eventdetail.getTimeId().plusMillis(TimeUnit.HOURS.toMillis(8));
|
||||||
|
Long time = now.toEpochMilli();
|
||||||
|
String timeText = format.format(time);
|
||||||
EventDetailVO eventDetailVO = new EventDetailVO();
|
EventDetailVO eventDetailVO = new EventDetailVO();
|
||||||
eventDetailVO.setId(eventdetail.getId());
|
eventDetailVO.setId(eventdetail.getLineId());
|
||||||
eventDetailVO.setTime(formatter.format(eventdetail.getTimeId()));
|
eventDetailVO.setTime(timeText);
|
||||||
eventDetailVOList.add(eventDetailVO);
|
eventDetailVOList.add(eventDetailVO);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -110,12 +115,12 @@ public class HistoryResultServiceImpl implements HistoryResultService {
|
|||||||
List<Float> fValue = new ArrayList<>();
|
List<Float> fValue = new ArrayList<>();
|
||||||
List<List<Object>> objectListData = new ArrayList<>();
|
List<List<Object>> objectListData = new ArrayList<>();
|
||||||
if (!CollectionUtils.isEmpty(list)) {
|
if (!CollectionUtils.isEmpty(list)) {
|
||||||
if (queryResult.getResults().size() == 1) {
|
if (list.size() == 1) {
|
||||||
List<List<Object>> listData = queryResult.getResults().get(0).getSeries().get(0).getValues();
|
List<List<Object>> listData = queryResult.getResults().get(0).getSeries().get(0).getValues();
|
||||||
for (int i = 0; i < listData.size(); i++) {
|
for (int i = 0; i < listData.size(); i++) {
|
||||||
List<Object> objectList = listData.get(i);
|
List<Object> objectList = listData.get(i);
|
||||||
DateFormat formatter = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ssX");
|
DateFormat formatter = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ssX");
|
||||||
TimeZone tx = TimeZone.getTimeZone("Asia/Kolkata");
|
TimeZone tx = TimeZone.getTimeZone("Asia/Shanghai");
|
||||||
formatter.setTimeZone(tx);
|
formatter.setTimeZone(tx);
|
||||||
Date d = formatter.parse(objectList.get(0).toString());
|
Date d = formatter.parse(objectList.get(0).toString());
|
||||||
time.add(d);
|
time.add(d);
|
||||||
@@ -133,14 +138,13 @@ public class HistoryResultServiceImpl implements HistoryResultService {
|
|||||||
historyDataResultVO.setValue(objectListData);
|
historyDataResultVO.setValue(objectListData);
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
for (int i = 0; i < queryResult.getResults().size(); i++) {
|
for (int i = 0; i < list.size(); i++) {
|
||||||
List<QueryResult.Series> listData = queryResult.getResults().get(i).getSeries();
|
List<List<Object>> values = list.get(i).getValues();
|
||||||
List<List<Object>> values = listData.get(0).getValues();
|
|
||||||
for (int j = 0; j < values.size(); j++) {
|
for (int j = 0; j < values.size(); j++) {
|
||||||
List<Object> objectList = values.get(j);
|
List<Object> objectList = values.get(j);
|
||||||
if (i == 0) {
|
if (i == 0) {
|
||||||
DateFormat formatter = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ssX");
|
SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ssX");
|
||||||
TimeZone tx = TimeZone.getTimeZone("Asia/Kolkata");
|
TimeZone tx = TimeZone.getTimeZone("Asia/Shanghai");
|
||||||
formatter.setTimeZone(tx);
|
formatter.setTimeZone(tx);
|
||||||
Date d = formatter.parse(objectList.get(0).toString());
|
Date d = formatter.parse(objectList.get(0).toString());
|
||||||
time.add(d);
|
time.add(d);
|
||||||
@@ -208,7 +212,9 @@ public class HistoryResultServiceImpl implements HistoryResultService {
|
|||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
if (Integer.parseInt(contion) != 60 || Integer.parseInt(contion) != 61 || Integer.parseInt(contion) != 62) {
|
||||||
stringBuilder.append(" and ").append(Param.VALUETYPE + "='").append(valueTypeName).append("'");
|
stringBuilder.append(" and ").append(Param.VALUETYPE + "='").append(valueTypeName).append("'");
|
||||||
|
}
|
||||||
String sql = "";
|
String sql = "";
|
||||||
List<String> phasicType = new ArrayList<>();
|
List<String> phasicType = new ArrayList<>();
|
||||||
List<String> unit = new ArrayList<>();
|
List<String> unit = new ArrayList<>();
|
||||||
@@ -705,7 +711,9 @@ public class HistoryResultServiceImpl implements HistoryResultService {
|
|||||||
} else if ("C".equals(normHistoryParam.getPhaseType()) || "CA".equals(normHistoryParam.getPhaseType())) {
|
} else if ("C".equals(normHistoryParam.getPhaseType()) || "CA".equals(normHistoryParam.getPhaseType())) {
|
||||||
phasicType = "C";
|
phasicType = "C";
|
||||||
}
|
}
|
||||||
|
if (Integer.parseInt(normHistoryParam.getTargetCode()) != 60 || Integer.parseInt(normHistoryParam.getTargetCode()) != 61 || Integer.parseInt(normHistoryParam.getTargetCode()) != 62) {
|
||||||
stringBuilder.append(" and ").append(Param.VALUETYPE + "='").append(valueTypeName).append("'");
|
stringBuilder.append(" and ").append(Param.VALUETYPE + "='").append(valueTypeName).append("'");
|
||||||
|
}
|
||||||
stringBuilder.append(" and ").append("phasic_type ='").append(phasicType).append("'");
|
stringBuilder.append(" and ").append("phasic_type ='").append(phasicType).append("'");
|
||||||
String sql = "";
|
String sql = "";
|
||||||
List<String> unit = new ArrayList<>();
|
List<String> unit = new ArrayList<>();
|
||||||
@@ -715,7 +723,7 @@ public class HistoryResultServiceImpl implements HistoryResultService {
|
|||||||
case 12:
|
case 12:
|
||||||
//电压偏差
|
//电压偏差
|
||||||
sql = "SELECT time as time, vu_dev as aValue FROM data_v WHERE " + stringBuilder.toString() +
|
sql = "SELECT time as time, vu_dev as aValue FROM data_v WHERE " + stringBuilder.toString() +
|
||||||
" order by time asc;";
|
" order by time asc tz('Asia/Shanghai');";
|
||||||
topLimit = overlimit.getVoltageDev();
|
topLimit = overlimit.getVoltageDev();
|
||||||
lowerLimit = overlimit.getUvoltageDev();
|
lowerLimit = overlimit.getUvoltageDev();
|
||||||
unit.add("%");
|
unit.add("%");
|
||||||
@@ -724,7 +732,7 @@ public class HistoryResultServiceImpl implements HistoryResultService {
|
|||||||
case 13:
|
case 13:
|
||||||
//三相电压不平衡度
|
//三相电压不平衡度
|
||||||
sql = "SELECT time as time, v_unbalance as aValue FROM data_v WHERE " + stringBuilder.toString() +
|
sql = "SELECT time as time, v_unbalance as aValue FROM data_v WHERE " + stringBuilder.toString() +
|
||||||
" order by time asc;";
|
" order by time asc tz('Asia/Shanghai');";
|
||||||
topLimit = overlimit.getUbalance();
|
topLimit = overlimit.getUbalance();
|
||||||
unit.add("%");
|
unit.add("%");
|
||||||
targetName = "三相电压不平衡度";
|
targetName = "三相电压不平衡度";
|
||||||
@@ -732,7 +740,7 @@ public class HistoryResultServiceImpl implements HistoryResultService {
|
|||||||
case 15:
|
case 15:
|
||||||
//电压总谐波畸变率
|
//电压总谐波畸变率
|
||||||
sql = "SELECT time as time, v_thd as aValue FROM data_v WHERE " + stringBuilder.toString() +
|
sql = "SELECT time as time, v_thd as aValue FROM data_v WHERE " + stringBuilder.toString() +
|
||||||
" order by time asc;";
|
" order by time asc tz('Asia/Shanghai');";
|
||||||
topLimit = overlimit.getUaberrance();
|
topLimit = overlimit.getUaberrance();
|
||||||
unit.add("%");
|
unit.add("%");
|
||||||
targetName = "电压总谐波畸变率";
|
targetName = "电压总谐波畸变率";
|
||||||
@@ -740,7 +748,7 @@ public class HistoryResultServiceImpl implements HistoryResultService {
|
|||||||
case 22:
|
case 22:
|
||||||
//负序电流
|
//负序电流
|
||||||
sql = "SELECT time as time, i_neg as aValue FROM data_i WHERE " + stringBuilder.toString() +
|
sql = "SELECT time as time, i_neg as aValue FROM data_i WHERE " + stringBuilder.toString() +
|
||||||
" order by time asc;";
|
" order by time asc tz('Asia/Shanghai');";
|
||||||
topLimit = overlimit.getINeg();
|
topLimit = overlimit.getINeg();
|
||||||
unit.add("A");
|
unit.add("A");
|
||||||
targetName = "负序电流";
|
targetName = "负序电流";
|
||||||
@@ -748,7 +756,7 @@ public class HistoryResultServiceImpl implements HistoryResultService {
|
|||||||
case 30:
|
case 30:
|
||||||
//频率 V9暂时代表Freq
|
//频率 V9暂时代表Freq
|
||||||
sql = "SELECT time as time, freq as aValue FROM data_v WHERE " + stringBuilder.toString() +
|
sql = "SELECT time as time, freq as aValue FROM data_v WHERE " + stringBuilder.toString() +
|
||||||
" and phasic_type ='T' order by time asc;";
|
" and phasic_type ='T' order by time asc tz('Asia/Shanghai');";
|
||||||
topLimit = 50 + overlimit.getFreqDev();
|
topLimit = 50 + overlimit.getFreqDev();
|
||||||
lowerLimit = 50 - overlimit.getFreqDev();
|
lowerLimit = 50 - overlimit.getFreqDev();
|
||||||
unit.add("Hz");
|
unit.add("Hz");
|
||||||
@@ -757,11 +765,7 @@ public class HistoryResultServiceImpl implements HistoryResultService {
|
|||||||
case 40:
|
case 40:
|
||||||
//谐波电压含有率
|
//谐波电压含有率
|
||||||
sql = "SELECT time as time, v_" + number + " as aValue FROM data_harmrate_v WHERE " + stringBuilder.toString() +
|
sql = "SELECT time as time, v_" + number + " as aValue FROM data_harmrate_v WHERE " + stringBuilder.toString() +
|
||||||
" and phasic_type ='A' order by time asc;" +
|
" and (phasic_type ='A' or phasic_type ='B' or phasic_type ='C') group by phasic_type order by time asc tz('Asia/Shanghai');";
|
||||||
"SELECT time as time, v_" + number + " as bValue FROM data_harmrate_v WHERE " + stringBuilder.toString() +
|
|
||||||
" and phasic_type ='B' order by time asc;" +
|
|
||||||
"SELECT time as time, v_" + number + " as cValue FROM data_harmrate_v WHERE " + stringBuilder.toString() +
|
|
||||||
" and phasic_type ='C' order by time asc;";
|
|
||||||
topLimit = PubUtils.getValueByMethod(overlimit, "getUharm", number);
|
topLimit = PubUtils.getValueByMethod(overlimit, "getUharm", number);
|
||||||
unit.add("%");
|
unit.add("%");
|
||||||
targetName = "谐波电压含有率";
|
targetName = "谐波电压含有率";
|
||||||
@@ -769,22 +773,14 @@ public class HistoryResultServiceImpl implements HistoryResultService {
|
|||||||
case 41:
|
case 41:
|
||||||
//谐波电流含有率
|
//谐波电流含有率
|
||||||
sql = "SELECT time as time, i_" + number + " as aValue FROM data_harmrate_i WHERE " + stringBuilder.toString() +
|
sql = "SELECT time as time, i_" + number + " as aValue FROM data_harmrate_i WHERE " + stringBuilder.toString() +
|
||||||
" and phasic_type ='A' order by time asc;" +
|
" and (phasic_type ='A' or phasic_type ='B' or phasic_type ='C') group by phasic_type order by time asc tz('Asia/Shanghai');";
|
||||||
"SELECT time as time, i_" + number + " as bValue FROM data_harmrate_i WHERE " + stringBuilder.toString() +
|
|
||||||
" and phasic_type ='B' order by time asc;" +
|
|
||||||
"SELECT time as time, i_" + number + " as cValue FROM data_harmrate_i WHERE " + stringBuilder.toString() +
|
|
||||||
" and phasic_type ='C' order by time asc;";
|
|
||||||
unit.add("%");
|
unit.add("%");
|
||||||
targetName = "谐波电流含有率";
|
targetName = "谐波电流含有率";
|
||||||
break;
|
break;
|
||||||
case 43:
|
case 43:
|
||||||
//谐波电流幅值
|
//谐波电流幅值
|
||||||
sql = "SELECT time as time, i_" + number + " as aValue FROM data_i WHERE " + stringBuilder.toString() +
|
sql = "SELECT time as time, i_" + number + " as aValue FROM data_i WHERE " + stringBuilder.toString() +
|
||||||
" and phasic_type ='A' order by time asc;" +
|
" and (phasic_type ='A' or phasic_type ='B' or phasic_type ='C') group by phasic_type order by time asc tz('Asia/Shanghai');";
|
||||||
"SELECT time as time, i_" + number + " as bValue FROM data_i WHERE " + stringBuilder.toString() +
|
|
||||||
" and phasic_type ='B' order by time asc;" +
|
|
||||||
"SELECT time as time, i_" + number + " as cValue FROM data_i WHERE " + stringBuilder.toString() +
|
|
||||||
" and phasic_type ='C' order by time asc;";
|
|
||||||
topLimit = PubUtils.getValueByMethod(overlimit, "getIharm", number);
|
topLimit = PubUtils.getValueByMethod(overlimit, "getIharm", number);
|
||||||
unit.add("A");
|
unit.add("A");
|
||||||
targetName = "谐波电流幅值";
|
targetName = "谐波电流幅值";
|
||||||
@@ -793,11 +789,7 @@ public class HistoryResultServiceImpl implements HistoryResultService {
|
|||||||
case 46:
|
case 46:
|
||||||
//间谐波电压含有率
|
//间谐波电压含有率
|
||||||
sql = "SELECT time as time, v_" + number + " as aValue FROM data_inharmrate_v WHERE " + stringBuilder.toString() +
|
sql = "SELECT time as time, v_" + number + " as aValue FROM data_inharmrate_v WHERE " + stringBuilder.toString() +
|
||||||
" and phasic_type ='A' order by time asc;" +
|
" and (phasic_type ='A' or phasic_type ='B' or phasic_type ='C') group by phasic_type order by time asc tz('Asia/Shanghai');";
|
||||||
"SELECT time as time, v_" + number + " as bValue FROM data_inharmrate_v WHERE " + stringBuilder.toString() +
|
|
||||||
" and phasic_type ='B' order by time asc;" +
|
|
||||||
"SELECT time as time, v_" + number + " as cValue FROM data_inharmrate_v WHERE " + stringBuilder.toString() +
|
|
||||||
" and phasic_type ='C' order by time asc;";
|
|
||||||
topLimit = PubUtils.getValueByMethod(overlimit, "getInuharm", number);
|
topLimit = PubUtils.getValueByMethod(overlimit, "getInuharm", number);
|
||||||
unit.add("%");
|
unit.add("%");
|
||||||
targetName = "间谐波电压含有率";
|
targetName = "间谐波电压含有率";
|
||||||
@@ -805,11 +797,7 @@ public class HistoryResultServiceImpl implements HistoryResultService {
|
|||||||
case 61:
|
case 61:
|
||||||
//长时闪变
|
//长时闪变
|
||||||
sql = "SELECT time as time, plt as aValue FROM data_plt WHERE " + stringBuilder.toString() +
|
sql = "SELECT time as time, plt as aValue FROM data_plt WHERE " + stringBuilder.toString() +
|
||||||
" and phasic_type ='A' order by time asc;" +
|
" and (phasic_type ='A' or phasic_type ='B' or phasic_type ='C') group by phasic_type order by time asc tz('Asia/Shanghai');";
|
||||||
"SELECT time as time, plt as bValue FROM data_plt WHERE " + stringBuilder.toString() +
|
|
||||||
" and phasic_type ='B' order by time asc;" +
|
|
||||||
"SELECT time as time, plt as cValue FROM data_plt WHERE " + stringBuilder.toString() +
|
|
||||||
" and phasic_type ='C' order by time asc;";
|
|
||||||
targetName = "长时闪变";
|
targetName = "长时闪变";
|
||||||
topLimit = overlimit.getFlicker();
|
topLimit = overlimit.getFlicker();
|
||||||
break;
|
break;
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ import com.njcn.harmonic.constant.Param;
|
|||||||
import com.njcn.harmonic.pojo.param.HistoryHarmOverLimitParam;
|
import com.njcn.harmonic.pojo.param.HistoryHarmOverLimitParam;
|
||||||
import com.njcn.harmonic.pojo.vo.HistoryHarmOverLimitVO;
|
import com.njcn.harmonic.pojo.vo.HistoryHarmOverLimitVO;
|
||||||
import com.njcn.harmonic.service.NormLimitService;
|
import com.njcn.harmonic.service.NormLimitService;
|
||||||
|
import com.njcn.influxdb.param.InfluxDBPublicParam;
|
||||||
import com.njcn.influxdb.utils.InfluxDbUtils;
|
import com.njcn.influxdb.utils.InfluxDbUtils;
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
import lombok.SneakyThrows;
|
import lombok.SneakyThrows;
|
||||||
@@ -13,10 +14,17 @@ import org.influxdb.dto.QueryResult;
|
|||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import org.springframework.util.CollectionUtils;
|
import org.springframework.util.CollectionUtils;
|
||||||
|
|
||||||
|
import java.sql.Timestamp;
|
||||||
import java.text.SimpleDateFormat;
|
import java.text.SimpleDateFormat;
|
||||||
|
import java.time.Instant;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
import java.time.ZoneId;
|
||||||
|
import java.time.format.DateTimeFormatter;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
import java.util.Date;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.TimeZone;
|
import java.util.TimeZone;
|
||||||
|
import java.util.concurrent.TimeUnit;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 类介绍
|
* 类介绍
|
||||||
@@ -94,105 +102,48 @@ public class NormLimitServiceImpl implements NormLimitService {
|
|||||||
if (!lineList.isEmpty()) {
|
if (!lineList.isEmpty()) {
|
||||||
//组装sql语句
|
//组装sql语句
|
||||||
StringBuilder stringBuilder = new StringBuilder();
|
StringBuilder stringBuilder = new StringBuilder();
|
||||||
stringBuilder.append(Param.TIME + " >= '").append(startTime).append(Param.START_TIME).append("' and ").append(Param.TIME).append(" <= '").append(endTime).append(Param.END_TIME).append("' and (");
|
stringBuilder.append(InfluxDBPublicParam.TIME + " >= '").append(startTime).append(InfluxDBPublicParam.START_TIME).append("' and ").append(InfluxDBPublicParam.TIME).append(" <= '").append(endTime).append(InfluxDBPublicParam.END_TIME).append("' and (");
|
||||||
//sql语句
|
//sql语句
|
||||||
stringBuilder.append("lineid='").append(lineList).append("')");
|
stringBuilder.append(InfluxDBPublicParam.LINE_ID).append("='").append(lineList).append("')");
|
||||||
String sql;
|
String sql;
|
||||||
switch (Integer.parseInt(contion)) {
|
switch (Integer.parseInt(contion)) {
|
||||||
case 12:
|
case 12:
|
||||||
//电压偏差
|
//电压偏差
|
||||||
sql = "SELECT time as time, Voltage_Dev as aValue FROM PQS_AbnormalData WHERE " + stringBuilder.toString() +
|
sql = "SELECT time as time, voltage_dev as aValue,phasic_type , value_type FROM pqs_abnormaldata WHERE " + stringBuilder.toString() +
|
||||||
" and phasic_type ='A' and value_type = 'MAX' order by time asc;" +
|
" and (phasic_type ='A' or phasic_type ='B' or phasic_type ='C') " +
|
||||||
"SELECT time as time, Voltage_Dev as aValue FROM PQS_AbnormalData WHERE " + stringBuilder.toString() +
|
" and (value_type = 'MAX' or value_type = 'MIN' or value_type = 'AVG' or value_type = 'CP95') group by phasic_type order by time asc tz('Asia/Shanghai');";
|
||||||
" and phasic_type ='A' and value_type = 'MIN' order by time asc;" +
|
|
||||||
"SELECT time as time, Voltage_Dev as aValue FROM PQS_AbnormalData WHERE " + stringBuilder.toString() +
|
|
||||||
" and phasic_type ='A' and value_type = 'AVG' order by time asc;" +
|
|
||||||
"SELECT time as time, Voltage_Dev as aValue FROM PQS_AbnormalData WHERE " + stringBuilder.toString() +
|
|
||||||
" and phasic_type ='A' and value_type = 'CP95' order by time asc;" +
|
|
||||||
"SELECT time as time, Voltage_Dev as aValue FROM PQS_AbnormalData WHERE " + stringBuilder.toString() +
|
|
||||||
" and phasic_type ='B' and value_type = 'MAX' order by time asc;" +
|
|
||||||
"SELECT time as time, Voltage_Dev as aValue FROM PQS_AbnormalData WHERE " + stringBuilder.toString() +
|
|
||||||
" and phasic_type ='B' and value_type = 'MIN' order by time asc;" +
|
|
||||||
"SELECT time as time, Voltage_Dev as aValue FROM PQS_AbnormalData WHERE " + stringBuilder.toString() +
|
|
||||||
" and phasic_type ='B' and value_type = 'AVG' order by time asc;" +
|
|
||||||
"SELECT time as time, Voltage_Dev as aValue FROM PQS_AbnormalData WHERE " + stringBuilder.toString() +
|
|
||||||
" and phasic_type ='B' and value_type = 'CP95' order by time asc;" +
|
|
||||||
"SELECT time as time, Voltage_Dev as aValue FROM PQS_AbnormalData WHERE " + stringBuilder.toString() +
|
|
||||||
" and phasic_type ='B' and value_type = 'MAX' order by time asc;" +
|
|
||||||
"SELECT time as time, Voltage_Dev as aValue FROM PQS_AbnormalData WHERE " + stringBuilder.toString() +
|
|
||||||
" and phasic_type ='C' and value_type = 'MIN' order by time asc;" +
|
|
||||||
"SELECT time as time, Voltage_Dev as aValue FROM PQS_AbnormalData WHERE " + stringBuilder.toString() +
|
|
||||||
" and phasic_type ='C' and value_type = 'AVG' order by time asc;" +
|
|
||||||
"SELECT time as time, Voltage_Dev as aValue FROM PQS_AbnormalData WHERE " + stringBuilder.toString() +
|
|
||||||
" and phasic_type ='C' and value_type = 'CP95' order by time asc;";
|
|
||||||
queryResult = influxDbUtils.query(sql);
|
queryResult = influxDbUtils.query(sql);
|
||||||
historyHarmOverLimitVOList = getNormData(queryResult, contion, lineList, "电压偏差", "%");
|
historyHarmOverLimitVOList = getNormData(queryResult, contion, lineList, "电压偏差", "%");
|
||||||
break;
|
break;
|
||||||
case 13:
|
case 13:
|
||||||
//三相电压不平衡度
|
//三相电压不平衡度
|
||||||
sql = "SELECT time as time, UBalance as aValue FROM PQS_AbnormalData WHERE " + stringBuilder.toString() +
|
sql = "SELECT time as time, ubalance as aValue,phasic_type , value_type FROM pqs_abnormaldata WHERE " + stringBuilder.toString() +
|
||||||
" and phasic_type ='T' and value_type = 'MAX' order by time asc;" +
|
" and (phasic_type ='T') " +
|
||||||
"SELECT time as time, UBalance as aValue FROM PQS_AbnormalData WHERE " + stringBuilder.toString() +
|
" and (value_type = 'MAX' or value_type = 'MIN' or value_type = 'AVG' or value_type = 'CP95') group by phasic_type order by time asc tz('Asia/Shanghai');";
|
||||||
" and phasic_type ='T' and value_type = 'MIN' order by time asc;" +
|
|
||||||
"SELECT time as time, UBalance as aValue FROM PQS_AbnormalData WHERE " + stringBuilder.toString() +
|
|
||||||
" and phasic_type ='T' and value_type = 'AVG' order by time asc;" +
|
|
||||||
"SELECT time as time, UBalance as aValue FROM PQS_AbnormalData WHERE " + stringBuilder.toString() +
|
|
||||||
" and phasic_type ='T' and value_type = 'CP95' order by time asc;";
|
|
||||||
queryResult = influxDbUtils.query(sql);
|
queryResult = influxDbUtils.query(sql);
|
||||||
historyHarmOverLimitVOList = getNormData(queryResult, contion, lineList, "三相电压不平衡度", "/");
|
historyHarmOverLimitVOList = getNormData(queryResult, contion, lineList, "三相电压不平衡度", "/");
|
||||||
break;
|
break;
|
||||||
case 15:
|
case 15:
|
||||||
//电压总谐波畸变率
|
//电压总谐波畸变率
|
||||||
sql = "SELECT time as time, UAberrance as aValue FROM PQS_AbnormalData WHERE " + stringBuilder.toString() +
|
sql = "SELECT time as time, uaberrance as aValue,phasic_type , value_type FROM pqs_abnormaldata WHERE " + stringBuilder.toString() +
|
||||||
" and phasic_type ='A' and value_type = 'MAX' order by time asc;" +
|
" and (phasic_type ='A' or phasic_type ='B' or phasic_type ='C') " +
|
||||||
"SELECT time as time, UAberrance as bValue FROM PQS_AbnormalData WHERE " + stringBuilder.toString() +
|
" and (value_type = 'MAX' or value_type = 'MIN' or value_type = 'AVG' or value_type = 'CP95') group by phasic_type order by time asc tz('Asia/Shanghai');";
|
||||||
" and phasic_type ='A'and value_type = 'MIN' order by time asc;" +
|
|
||||||
"SELECT time as time, UAberrance as cValue FROM PQS_AbnormalData WHERE " + stringBuilder.toString() +
|
|
||||||
" and phasic_type ='A' and value_type = 'AVG' order by time asc;" +
|
|
||||||
"SELECT time as time, UAberrance as cValue FROM PQS_AbnormalData WHERE " + stringBuilder.toString() +
|
|
||||||
" and phasic_type ='A' and value_type = 'CP95' and value_type = 'AVG' order by time asc;" +
|
|
||||||
" SELECT time as time, UAberrance as aValue FROM PQS_AbnormalData WHERE " + stringBuilder.toString() +
|
|
||||||
" and phasic_type ='B' and value_type = 'MAX' order by time asc;" +
|
|
||||||
"SELECT time as time, UAberrance as bValue FROM PQS_AbnormalData WHERE " + stringBuilder.toString() +
|
|
||||||
" and phasic_type ='B' and value_type = 'MIN' order by time asc;" +
|
|
||||||
"SELECT time as time, UAberrance as cValue FROM PQS_AbnormalData WHERE " + stringBuilder.toString() +
|
|
||||||
" and phasic_type ='B' and value_type = 'AVG' and value_type = 'MIN' order by time asc;" +
|
|
||||||
"SELECT time as time, UAberrance as cValue FROM PQS_AbnormalData WHERE " + stringBuilder.toString() +
|
|
||||||
" and phasic_type ='B' and value_type = 'CP95' order by time asc;" +
|
|
||||||
"SELECT time as time, UAberrance as aValue FROM PQS_AbnormalData WHERE " + stringBuilder.toString() +
|
|
||||||
" and phasic_type ='C' and value_type = 'MAX' order by time asc;" +
|
|
||||||
"SELECT time as time, UAberrance as bValue FROM PQS_AbnormalData WHERE " + stringBuilder.toString() +
|
|
||||||
" and phasic_type ='C' and value_type = 'MIN' order by time asc;" +
|
|
||||||
"SELECT time as time, UAberrance as cValue FROM PQS_AbnormalData WHERE " + stringBuilder.toString() +
|
|
||||||
" and phasic_type ='C' and value_type = 'AVG' order by time asc;" +
|
|
||||||
"SELECT time as time, UAberrance as cValue FROM PQS_AbnormalData WHERE " + stringBuilder.toString() +
|
|
||||||
" and phasic_type ='C' and value_type = 'CP95' order by time asc;";
|
|
||||||
queryResult = influxDbUtils.query(sql);
|
queryResult = influxDbUtils.query(sql);
|
||||||
historyHarmOverLimitVOList = getNormData(queryResult, contion, lineList, "电压总谐波畸变率", "%");
|
historyHarmOverLimitVOList = getNormData(queryResult, contion, lineList, "电压总谐波畸变率", "%");
|
||||||
break;
|
break;
|
||||||
case 22:
|
case 22:
|
||||||
//负序电流
|
//负序电流
|
||||||
sql = "SELECT time as time, I_Neg as aValue FROM PQS_AbnormalData WHERE " + stringBuilder.toString() +
|
sql = "SELECT time as time, i_neg as aValue ,phasic_type , value_type FROM pqs_abnormaldata WHERE " + stringBuilder.toString() +
|
||||||
" and phasic_type ='T' and value_type = 'MAX' order by time asc;" +
|
" and (phasic_type ='T') " +
|
||||||
"SELECT time as time, I_Neg as bValue FROM PQS_AbnormalData WHERE " + stringBuilder.toString() +
|
" and (value_type = 'MAX' or value_type = 'MIN' or value_type = 'AVG' or value_type = 'CP95') group by phasic_type order by time asc tz('Asia/Shanghai');";
|
||||||
" and phasic_type ='T' and value_type = 'MIN' order by time asc;" +
|
|
||||||
"SELECT time as time, I_Neg as cValue FROM PQS_AbnormalData WHERE " + stringBuilder.toString() +
|
|
||||||
" and phasic_type ='T' and value_type = 'AVG' order by time asc;" +
|
|
||||||
"SELECT time as time, I_Neg as aValue FROM PQS_AbnormalData WHERE " + stringBuilder.toString() +
|
|
||||||
" and phasic_type ='T' and value_type = 'CP95' order by time asc;";
|
|
||||||
queryResult = influxDbUtils.query(sql);
|
queryResult = influxDbUtils.query(sql);
|
||||||
historyHarmOverLimitVOList = getNormData(queryResult, contion, lineList, "负序电流", "/");
|
historyHarmOverLimitVOList = getNormData(queryResult, contion, lineList, "负序电流", "/");
|
||||||
break;
|
break;
|
||||||
case 30:
|
case 30:
|
||||||
//频率 V9暂时代表Freq
|
//频率 V9暂时代表Freq
|
||||||
sql = "SELECT time as time, Freq_Dev as aValue FROM PQS_AbnormalData WHERE " + stringBuilder.toString() +
|
sql = "SELECT time as time, freq_dev as aValue ,phasic_type , value_type FROM pqs_abnormaldata WHERE " + stringBuilder.toString() +
|
||||||
" and phasic_type ='T' and value_type = 'MAX' order by time asc;" +
|
" and (phasic_type ='T') " +
|
||||||
"SELECT time as time, Freq_Dev as aValue FROM PQS_AbnormalData WHERE " + stringBuilder.toString() +
|
" and (value_type = 'MAX' or value_type = 'MIN' or value_type = 'AVG' or value_type = 'CP95') group by phasic_type order by time asc tz('Asia/Shanghai');";
|
||||||
" and phasic_type ='T' and value_type = 'MIN' order by time asc;" +
|
|
||||||
"SELECT time as time, Freq_Dev as aValue FROM PQS_AbnormalData WHERE " + stringBuilder.toString() +
|
|
||||||
" and phasic_type ='T' and value_type = 'AVG' order by time asc;" +
|
|
||||||
"SELECT time as time, Freq_Dev as aValue FROM PQS_AbnormalData WHERE " + stringBuilder.toString() +
|
|
||||||
" and phasic_type ='T' and value_type = 'CP95' order by time asc;";
|
|
||||||
queryResult = influxDbUtils.query(sql);
|
queryResult = influxDbUtils.query(sql);
|
||||||
historyHarmOverLimitVOList = getNormData(queryResult, contion, lineList, "频率", "Hz");
|
historyHarmOverLimitVOList = getNormData(queryResult, contion, lineList, "频率", "Hz");
|
||||||
break;
|
break;
|
||||||
@@ -200,30 +151,9 @@ public class NormLimitServiceImpl implements NormLimitService {
|
|||||||
for (int i = 0; i < number.length; i++) {
|
for (int i = 0; i < number.length; i++) {
|
||||||
List<HistoryHarmOverLimitVO> harmOverLimitVOList;
|
List<HistoryHarmOverLimitVO> harmOverLimitVOList;
|
||||||
//谐波电压含有率
|
//谐波电压含有率
|
||||||
sql = "SELECT time as time, UHarm_" + number[i] + " as aValue FROM PQS_AbnormalData WHERE " + stringBuilder.toString() +
|
sql = "SELECT time as time, uharm_" + number[i] + " as aValue ,phasic_type , value_type FROM pqs_abnormaldata WHERE " + stringBuilder.toString() +
|
||||||
" and phasic_type ='A' and value_type = 'MAX' order by time asc;" +
|
" and (phasic_type ='A' or phasic_type ='B' or phasic_type ='C') " +
|
||||||
"SELECT time as time, UHarm_" + number[i] + " as bValue FROM PQS_AbnormalData WHERE " + stringBuilder.toString() +
|
" and (value_type = 'MAX' or value_type = 'MIN' or value_type = 'AVG' or value_type = 'CP95') group by phasic_type order by time asc tz('Asia/Shanghai');";
|
||||||
" and phasic_type ='A' and value_type = 'MIN' order by time asc;" +
|
|
||||||
"SELECT time as time, UHarm_" + number[i] + " as cValue FROM PQS_AbnormalData WHERE " + stringBuilder.toString() +
|
|
||||||
" and phasic_type ='A' and value_type = 'AVG' order by time asc;" +
|
|
||||||
"SELECT time as time, UHarm_" + number[i] + " as aValue FROM PQS_AbnormalData WHERE " + stringBuilder.toString() +
|
|
||||||
" and phasic_type ='A' and value_type = 'CP95' order by time asc;" +
|
|
||||||
"SELECT time as time, UHarm_" + number[i] + " as aValue FROM PQS_AbnormalData WHERE " + stringBuilder.toString() +
|
|
||||||
" and phasic_type ='B' and value_type = 'MAX' order by time asc;" +
|
|
||||||
"SELECT time as time, UHarm_" + number[i] + " as bValue FROM PQS_AbnormalData WHERE " + stringBuilder.toString() +
|
|
||||||
" and phasic_type ='B' and value_type = 'MIN' order by time asc;" +
|
|
||||||
"SELECT time as time, UHarm_" + number[i] + " as cValue FROM PQS_AbnormalData WHERE " + stringBuilder.toString() +
|
|
||||||
" and phasic_type ='B' and value_type = 'AVG' order by time asc;" +
|
|
||||||
"SELECT time as time, UHarm_" + number[i] + " as aValue FROM PQS_AbnormalData WHERE " + stringBuilder.toString() +
|
|
||||||
" and phasic_type ='B' and value_type = 'CP95' order by time asc;" +
|
|
||||||
"SELECT time as time, UHarm_" + number[i] + " as aValue FROM PQS_AbnormalData WHERE " + stringBuilder.toString() +
|
|
||||||
" and phasic_type ='C' and value_type = 'MAX' order by time asc;" +
|
|
||||||
"SELECT time as time, UHarm_" + number[i] + " as bValue FROM PQS_AbnormalData WHERE " + stringBuilder.toString() +
|
|
||||||
" and phasic_type ='C' and value_type = 'MIN' order by time asc;" +
|
|
||||||
"SELECT time as time, UHarm_" + number[i] + " as cValue FROM PQS_AbnormalData WHERE " + stringBuilder.toString() +
|
|
||||||
" and phasic_type ='C' and value_type = 'AVG' order by time asc;" +
|
|
||||||
"SELECT time as time, UHarm_" + number[i] + " as aValue FROM PQS_AbnormalData WHERE " + stringBuilder.toString() +
|
|
||||||
" and phasic_type ='C' and value_type = 'CP95' order by time asc;";
|
|
||||||
queryResult = influxDbUtils.query(sql);
|
queryResult = influxDbUtils.query(sql);
|
||||||
harmOverLimitVOList = getNormData(queryResult, contion, lineList, "谐波电压含有率", "%", number[i]);
|
harmOverLimitVOList = getNormData(queryResult, contion, lineList, "谐波电压含有率", "%", number[i]);
|
||||||
historyHarmOverLimitVOList.addAll(harmOverLimitVOList);
|
historyHarmOverLimitVOList.addAll(harmOverLimitVOList);
|
||||||
@@ -233,30 +163,9 @@ public class NormLimitServiceImpl implements NormLimitService {
|
|||||||
for (int i = 0; i < number.length; i++) {
|
for (int i = 0; i < number.length; i++) {
|
||||||
List<HistoryHarmOverLimitVO> harmOverLimitVOList;
|
List<HistoryHarmOverLimitVO> harmOverLimitVOList;
|
||||||
//谐波电流幅值
|
//谐波电流幅值
|
||||||
sql = "SELECT time as time, IHarm_" + number[i] + " as aValue FROM PQS_AbnormalData WHERE " + stringBuilder.toString() +
|
sql = "SELECT time as time, iharm_" + number[i] + " as aValue ,phasic_type , value_type FROM pqs_abnormaldata WHERE " + stringBuilder.toString() +
|
||||||
" and phasic_type ='A' and value_type = 'MAX' order by time asc;" +
|
" and (phasic_type ='A' or phasic_type ='B' or phasic_type ='C') " +
|
||||||
"SELECT time as time, IHarm_" + number[i] + " as bValue FROM PQS_AbnormalData WHERE " + stringBuilder.toString() +
|
" and (value_type = 'MAX' or value_type = 'MIN' or value_type = 'AVG' or value_type = 'CP95') group by phasic_type order by time asc tz('Asia/Shanghai');";
|
||||||
" and phasic_type ='A' and value_type = 'MIN' order by time asc;" +
|
|
||||||
"SELECT time as time, IHarm_" + number[i] + " as cValue FROM PQS_AbnormalData WHERE " + stringBuilder.toString() +
|
|
||||||
" and phasic_type ='A' and value_type = 'AVG' order by time asc;" +
|
|
||||||
"SELECT time as time, IHarm_" + number[i] + " as aValue FROM PQS_AbnormalData WHERE " + stringBuilder.toString() +
|
|
||||||
" and phasic_type ='A' and value_type = 'CP95' order by time asc;" +
|
|
||||||
"SELECT time as time, IHarm_" + number[i] + " as bValue FROM PQS_AbnormalData WHERE " + stringBuilder.toString() +
|
|
||||||
" and phasic_type ='B' and value_type = 'MAX' order by time asc;" +
|
|
||||||
"SELECT time as time, IHarm_" + number[i] + " as cValue FROM PQS_AbnormalData WHERE " + stringBuilder.toString() +
|
|
||||||
" and phasic_type ='B' and value_type = 'MIN' order by time asc;" +
|
|
||||||
"SELECT time as time, IHarm_" + number[i] + " as aValue FROM PQS_AbnormalData WHERE " + stringBuilder.toString() +
|
|
||||||
" and phasic_type ='B' and value_type = 'AVG' order by time asc;" +
|
|
||||||
"SELECT time as time, IHarm_" + number[i] + " as bValue FROM PQS_AbnormalData WHERE " + stringBuilder.toString() +
|
|
||||||
" and phasic_type ='B' and value_type = 'CP95' order by time asc;" +
|
|
||||||
"SELECT time as time, IHarm_" + number[i] + " as cValue FROM PQS_AbnormalData WHERE " + stringBuilder.toString() +
|
|
||||||
" and phasic_type ='C' and value_type = 'MAX' order by time asc;" +
|
|
||||||
"SELECT time as time, IHarm_" + number[i] + " as aValue FROM PQS_AbnormalData WHERE " + stringBuilder.toString() +
|
|
||||||
" and phasic_type ='C' and value_type = 'MIN' order by time asc;" +
|
|
||||||
"SELECT time as time, IHarm_" + number[i] + " as bValue FROM PQS_AbnormalData WHERE " + stringBuilder.toString() +
|
|
||||||
" and phasic_type ='C' and value_type = 'AVG' order by time asc;" +
|
|
||||||
"SELECT time as time, IHarm_" + number[i] + " as cValue FROM PQS_AbnormalData WHERE " + stringBuilder.toString() +
|
|
||||||
" and phasic_type ='C' and value_type = 'CP95' order by time asc;";
|
|
||||||
queryResult = influxDbUtils.query(sql);
|
queryResult = influxDbUtils.query(sql);
|
||||||
harmOverLimitVOList = getNormData(queryResult, contion, lineList, "谐波电流幅值", "A", number[i]);
|
harmOverLimitVOList = getNormData(queryResult, contion, lineList, "谐波电流幅值", "A", number[i]);
|
||||||
historyHarmOverLimitVOList.addAll(harmOverLimitVOList);
|
historyHarmOverLimitVOList.addAll(harmOverLimitVOList);
|
||||||
@@ -266,30 +175,9 @@ public class NormLimitServiceImpl implements NormLimitService {
|
|||||||
for (int i = 0; i < inHarmNum.length; i++) {
|
for (int i = 0; i < inHarmNum.length; i++) {
|
||||||
List<HistoryHarmOverLimitVO> harmOverLimitVOList;
|
List<HistoryHarmOverLimitVO> harmOverLimitVOList;
|
||||||
//间谐波电压含有率
|
//间谐波电压含有率
|
||||||
sql = "SELECT time as time, InUHARM_" + inHarmNum[i] + " as aValue FROM PQS_AbnormalData WHERE " + stringBuilder.toString() +
|
sql = "SELECT time as time, inuharm_" + inHarmNum[i] + " as aValue ,phasic_type , value_type FROM pqs_abnormaldata WHERE " + stringBuilder.toString() +
|
||||||
" and phasic_type ='A' and value_type = 'MAX' order by time asc;" +
|
" and (phasic_type ='A' or phasic_type ='B' or phasic_type ='C') " +
|
||||||
"SELECT time as time, InUHARM_" + inHarmNum[i] + " as bValue FROM PQS_AbnormalData WHERE " + stringBuilder.toString() +
|
" and (value_type = 'MAX' or value_type = 'MIN' or value_type = 'AVG' or value_type = 'CP95') group by phasic_type order by time asc tz('Asia/Shanghai');";
|
||||||
" and phasic_type ='A' and value_type = 'MIN' order by time asc;" +
|
|
||||||
"SELECT time as time, InUHARM_" + inHarmNum[i] + " as cValue FROM PQS_AbnormalData WHERE " + stringBuilder.toString() +
|
|
||||||
" and phasic_type ='A' and value_type = 'AVG' order by time asc;" +
|
|
||||||
"SELECT time as time, InUHARM_" + inHarmNum[i] + " as aValue FROM PQS_AbnormalData WHERE " + stringBuilder.toString() +
|
|
||||||
" and phasic_type ='A' and value_type = 'CP95' order by time asc;" +
|
|
||||||
"SELECT time as time, InUHARM_" + inHarmNum[i] + " as bValue FROM PQS_AbnormalData WHERE " + stringBuilder.toString() +
|
|
||||||
" and phasic_type ='B' and value_type = 'MAX' order by time asc;" +
|
|
||||||
"SELECT time as time, InUHARM_" + inHarmNum[i] + " as cValue FROM PQS_AbnormalData WHERE " + stringBuilder.toString() +
|
|
||||||
" and phasic_type ='B' and value_type = 'AVG' order by time asc;" +
|
|
||||||
"SELECT time as time, InUHARM_" + inHarmNum[i] + " as aValue FROM PQS_AbnormalData WHERE " + stringBuilder.toString() +
|
|
||||||
" and phasic_type ='B' and value_type = 'MIN' order by time asc;" +
|
|
||||||
"SELECT time as time, InUHARM_" + inHarmNum[i] + " as bValue FROM PQS_AbnormalData WHERE " + stringBuilder.toString() +
|
|
||||||
" and phasic_type ='B' and value_type = 'CP95' order by time asc;" +
|
|
||||||
"SELECT time as time, InUHARM_" + inHarmNum[i] + " as cValue FROM PQS_AbnormalData WHERE " + stringBuilder.toString() +
|
|
||||||
" and phasic_type ='C' and value_type = 'MAX' order by time asc;" +
|
|
||||||
"SELECT time as time, InUHARM_" + inHarmNum[i] + " as aValue FROM PQS_AbnormalData WHERE " + stringBuilder.toString() +
|
|
||||||
" and phasic_type ='C' and value_type = 'MIN' order by time asc;" +
|
|
||||||
"SELECT time as time, InUHARM_" + inHarmNum[i] + " as bValue FROM PQS_AbnormalData WHERE " + stringBuilder.toString() +
|
|
||||||
" and phasic_type ='C' and value_type = 'AVG' order by time asc;" +
|
|
||||||
"SELECT time as time, InUHARM_" + inHarmNum[i] + " as cValue FROM PQS_AbnormalData WHERE " + stringBuilder.toString() +
|
|
||||||
" and phasic_type ='C' and value_type = 'CP95' order by time asc;";
|
|
||||||
queryResult = influxDbUtils.query(sql);
|
queryResult = influxDbUtils.query(sql);
|
||||||
harmOverLimitVOList = getNormData(queryResult, contion, lineList, "间谐波电压含有率", "%", inHarmNum[i]);
|
harmOverLimitVOList = getNormData(queryResult, contion, lineList, "间谐波电压含有率", "%", inHarmNum[i]);
|
||||||
historyHarmOverLimitVOList.addAll(harmOverLimitVOList);
|
historyHarmOverLimitVOList.addAll(harmOverLimitVOList);
|
||||||
@@ -297,30 +185,9 @@ public class NormLimitServiceImpl implements NormLimitService {
|
|||||||
break;
|
break;
|
||||||
case 61:
|
case 61:
|
||||||
//长时闪变
|
//长时闪变
|
||||||
sql = "SELECT time as time, Flicker as aValue FROM PQS_AbnormalData WHERE " + stringBuilder.toString() +
|
sql = "SELECT time as time, flicker as aValue ,phasic_type , value_type FROM pqs_abnormaldata WHERE " + stringBuilder.toString() +
|
||||||
" and phasic_type ='A' and value_type = 'MAX' order by time asc;" +
|
" and (phasic_type ='A' or phasic_type ='B' or phasic_type ='C') " +
|
||||||
"SELECT time as time, Flicker as bValue FROM PQS_AbnormalData WHERE " + stringBuilder.toString() +
|
" and (value_type = 'AVG') group by phasic_type order by time asc tz('Asia/Shanghai');";
|
||||||
" and phasic_type ='A' and value_type = 'MIN' order by time asc;" +
|
|
||||||
"SELECT time as time, Flicker as cValue FROM PQS_AbnormalData WHERE " + stringBuilder.toString() +
|
|
||||||
" and phasic_type ='A' and value_type = 'AVG' order by time asc;" +
|
|
||||||
"SELECT time as time, Flicker as aValue FROM PQS_AbnormalData WHERE " + stringBuilder.toString() +
|
|
||||||
" and phasic_type ='A' and value_type = 'CP95' order by time asc;" +
|
|
||||||
"SELECT time as time, Flicker as bValue FROM PQS_AbnormalData WHERE " + stringBuilder.toString() +
|
|
||||||
" and phasic_type ='B' and value_type = 'MAX' order by time asc;" +
|
|
||||||
"SELECT time as time, Flicker as cValue FROM PQS_AbnormalData WHERE " + stringBuilder.toString() +
|
|
||||||
" and phasic_type ='B' and value_type = 'MIN' order by time asc;" +
|
|
||||||
"SELECT time as time, Flicker as aValue FROM PQS_AbnormalData WHERE " + stringBuilder.toString() +
|
|
||||||
" and phasic_type ='B' and value_type = 'AVG' order by time asc;" +
|
|
||||||
"SELECT time as time, Flicker as bValue FROM PQS_AbnormalData WHERE " + stringBuilder.toString() +
|
|
||||||
" and phasic_type ='B' and value_type = 'CP95' order by time asc;" +
|
|
||||||
"SELECT time as time, Flicker as cValue FROM PQS_AbnormalData WHERE " + stringBuilder.toString() +
|
|
||||||
" and phasic_type ='C' and value_type = 'MAX' order by time asc;" +
|
|
||||||
"SELECT time as time, Flicker as aValue FROM PQS_AbnormalData WHERE " + stringBuilder.toString() +
|
|
||||||
" and phasic_type ='C' and value_type = 'MIN' order by time asc;" +
|
|
||||||
"SELECT time as time, Flicker as bValue FROM PQS_AbnormalData WHERE " + stringBuilder.toString() +
|
|
||||||
" and phasic_type ='C' and value_type = 'AVG' order by time asc;" +
|
|
||||||
"SELECT time as time, Flicker as cValue FROM PQS_AbnormalData WHERE " + stringBuilder.toString() +
|
|
||||||
" and phasic_type ='C' and value_type = 'CP95' order by time asc;";
|
|
||||||
queryResult = influxDbUtils.query(sql);
|
queryResult = influxDbUtils.query(sql);
|
||||||
historyHarmOverLimitVOList = getNormData(queryResult, contion, lineList, "长时闪变", "/");
|
historyHarmOverLimitVOList = getNormData(queryResult, contion, lineList, "长时闪变", "/");
|
||||||
break;
|
break;
|
||||||
@@ -342,48 +209,59 @@ public class NormLimitServiceImpl implements NormLimitService {
|
|||||||
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SS'Z'");
|
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SS'Z'");
|
||||||
sdf.setTimeZone(TimeZone.getTimeZone("UTC"));
|
sdf.setTimeZone(TimeZone.getTimeZone("UTC"));
|
||||||
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");
|
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");
|
||||||
|
|
||||||
//获取监测点详情
|
//获取监测点详情
|
||||||
LineDetailDataVO lineDetailDataVO = lineFeignClient.getLineDetailData(lineList).getData();
|
LineDetailDataVO lineDetailDataVO = lineFeignClient.getLineDetailData(lineList).getData();
|
||||||
if (!CollectionUtils.isEmpty(qusery.get(0).getSeries())) {
|
if (!CollectionUtils.isEmpty(qusery.get(0).getSeries())) {
|
||||||
String time = "";
|
String time = "";
|
||||||
Float aMax = 0.0f, aMin = 0.0f, aAvg = 0.0f, aCp95 = 0.0f, bMax = 0.0f, bMin = 0.0f, bAvg = 0.0f, bCp95 = 0.0f, cMax = 0.0f, cMin = 0.0f, cAvg = 0.0f, cCp95 = 0.0f;
|
Float aMax = 0.0f, aMin = 0.0f, aAvg = 0.0f, aCp95 = 0.0f, bMax = 0.0f, bMin = 0.0f, bAvg = 0.0f, bCp95 = 0.0f, cMax = 0.0f, cMin = 0.0f, cAvg = 0.0f, cCp95 = 0.0f;
|
||||||
for (int i = 0; i < qusery.get(0).getSeries().get(0).getValues().size(); i++) {
|
for (int i = 0; i < qusery.get(0).getSeries().size(); i++) {
|
||||||
|
List<String> columns = qusery.get(0).getSeries().get(i).getColumns();
|
||||||
|
if (qusery.get(0).getSeries().get(i).getTags().get("phasic_type").equals("A")) {
|
||||||
HistoryHarmOverLimitVO historyDataResultVO = new HistoryHarmOverLimitVO();
|
HistoryHarmOverLimitVO historyDataResultVO = new HistoryHarmOverLimitVO();
|
||||||
//A相的最大值
|
if (!CollectionUtils.isEmpty(qusery.get(0).getSeries().get(i).getValues())) {
|
||||||
if (!CollectionUtils.isEmpty(qusery.get(0).getSeries())) {
|
for (int j = 0; j < qusery.get(0).getSeries().get(i).getValues().size(); j++) {
|
||||||
aMax = Float.parseFloat(qusery.get(0).getSeries().get(0).getValues().get(i).get(1).toString());
|
List<Object> objectList = qusery.get(0).getSeries().get(i).getValues().get(j);
|
||||||
historyDataResultVO.setMaxValue(aMax);
|
String aa = String.valueOf(objectList.get(0));
|
||||||
}
|
Date sd = dateFormat.parse(aa);
|
||||||
//A相的最小值
|
time = dateFormat.format(sd);
|
||||||
if (!CollectionUtils.isEmpty(qusery.get(1).getSeries())) {
|
if (Integer.parseInt(contion) == 61) {
|
||||||
aMin = Float.parseFloat(qusery.get(1).getSeries().get(0).getValues().get(i).get(1).toString());
|
historyDataResultVO.setMaxValue((float) 3.14159);
|
||||||
historyDataResultVO.setMinValue(aMin);
|
historyDataResultVO.setMinValue((float) 3.14159);
|
||||||
}
|
historyDataResultVO.setCp95Value((float) 3.14159);
|
||||||
//A相的评价值
|
aAvg = Float.parseFloat(String.valueOf(objectList.get(1)));
|
||||||
if (!CollectionUtils.isEmpty(qusery.get(2).getSeries())) {
|
|
||||||
aAvg = Float.parseFloat(qusery.get(2).getSeries().get(0).getValues().get(i).get(1).toString());
|
|
||||||
historyDataResultVO.setAvgValue(aAvg);
|
historyDataResultVO.setAvgValue(aAvg);
|
||||||
}
|
} else {
|
||||||
//A相的CP95
|
if (objectList.get(3).equals("MAX")) {
|
||||||
if (!CollectionUtils.isEmpty(qusery.get(3).getSeries())) {
|
aMax = Float.parseFloat(String.valueOf(objectList.get(1)));
|
||||||
time = String.valueOf(qusery.get(3).getSeries().get(0).getValues().get(i).get(0));
|
historyDataResultVO.setMaxValue(aMax);
|
||||||
aCp95 = Float.parseFloat(qusery.get(3).getSeries().get(0).getValues().get(i).get(1).toString());
|
} else if (objectList.get(3).equals("MIN")) {
|
||||||
historyDataResultVO.setTime(dateFormat.format(sdf.parse(time)));
|
aMin = Float.parseFloat(String.valueOf(objectList.get(1)));
|
||||||
|
historyDataResultVO.setMinValue(aMin);
|
||||||
|
} else if (objectList.get(3).equals("AVG")) {
|
||||||
|
aAvg = Float.parseFloat(String.valueOf(objectList.get(1)));
|
||||||
|
historyDataResultVO.setAvgValue(aAvg);
|
||||||
|
} else if (objectList.get(3).equals("CP95")) {
|
||||||
|
aCp95 = Float.parseFloat(String.valueOf(objectList.get(1)));
|
||||||
historyDataResultVO.setCp95Value(aCp95);
|
historyDataResultVO.setCp95Value(aCp95);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
historyDataResultVO.setTime(time);
|
||||||
historyDataResultVO.setLineName(lineDetailDataVO.getLineName());
|
historyDataResultVO.setLineName(lineDetailDataVO.getLineName());
|
||||||
historyDataResultVO.setLineId(lineList);
|
historyDataResultVO.setLineId(lineList);
|
||||||
historyDataResultVO.setNumber(0);
|
historyDataResultVO.setNumber(0);
|
||||||
historyDataResultVO.setSubName(lineDetailDataVO.getBdName());
|
historyDataResultVO.setSubName(lineDetailDataVO.getBdName());
|
||||||
historyDataResultVO.setTargetCode(contion);
|
historyDataResultVO.setTargetCode(contion);
|
||||||
historyDataResultVO.setTargetName(phaseName);
|
historyDataResultVO.setTargetName(phaseName);
|
||||||
if (Integer.parseInt(contion)==12 || Integer.parseInt(contion)==15){
|
if (Integer.parseInt(contion) == 12 || Integer.parseInt(contion) == 15) {
|
||||||
historyDataResultVO.setPhaseType("A");
|
historyDataResultVO.setPhaseType("A");
|
||||||
historyDataResultVO.setStatisticalType(Math.abs(aMax) > Math.abs(aMin) ? 3 : 2);
|
historyDataResultVO.setStatisticalType(Math.abs(aMax) > Math.abs(aMin) ? 3 : 2);
|
||||||
}else if(Integer.parseInt(contion)==13 || Integer.parseInt(contion)==22){
|
} else if (Integer.parseInt(contion) == 13 || Integer.parseInt(contion) == 22) {
|
||||||
historyDataResultVO.setPhaseType("/");
|
historyDataResultVO.setPhaseType("/");
|
||||||
historyDataResultVO.setStatisticalType(Math.abs(aMax) > Math.abs(aCp95) ? 3 : 4);
|
historyDataResultVO.setStatisticalType(Math.abs(aMax) > Math.abs(aCp95) ? 3 : 4);
|
||||||
}else {
|
} else {
|
||||||
historyDataResultVO.setPhaseType("A");
|
historyDataResultVO.setPhaseType("A");
|
||||||
historyDataResultVO.setStatisticalType(3);
|
historyDataResultVO.setStatisticalType(3);
|
||||||
}
|
}
|
||||||
@@ -392,93 +270,109 @@ public class NormLimitServiceImpl implements NormLimitService {
|
|||||||
historyHarmOverLimitVOList.add(historyDataResultVO);
|
historyHarmOverLimitVOList.add(historyDataResultVO);
|
||||||
}
|
}
|
||||||
if ("12".equals(contion) || "15".equals(contion) || "40".equals(contion) || "61".equals(contion)) {
|
if ("12".equals(contion) || "15".equals(contion) || "40".equals(contion) || "61".equals(contion)) {
|
||||||
for (int i = 0; i < qusery.get(4).getSeries().get(0).getValues().size(); i++) {
|
if (qusery.get(0).getSeries().get(i).getTags().get("phasic_type").equals("B")) {
|
||||||
HistoryHarmOverLimitVO historyDataResultVOB = new HistoryHarmOverLimitVO();
|
HistoryHarmOverLimitVO historyDataResultVO = new HistoryHarmOverLimitVO();
|
||||||
//B相的最大值
|
if (!CollectionUtils.isEmpty(qusery.get(0).getSeries().get(i).getValues())) {
|
||||||
if (!CollectionUtils.isEmpty(qusery.get(4).getSeries())) {
|
for (int j = 0; j < qusery.get(0).getSeries().get(i).getValues().size(); j++) {
|
||||||
bMax = Float.parseFloat(qusery.get(4).getSeries().get(0).getValues().get(i).get(1).toString());
|
List<Object> objectList = qusery.get(0).getSeries().get(i).getValues().get(j);
|
||||||
historyDataResultVOB.setMaxValue(bMax);
|
String aa = String.valueOf(objectList.get(0));
|
||||||
|
Date sd = dateFormat.parse(aa);
|
||||||
|
time = dateFormat.format(sd);
|
||||||
|
if (Integer.parseInt(contion) == 61) {
|
||||||
|
historyDataResultVO.setMaxValue((float) 3.14159);
|
||||||
|
historyDataResultVO.setMinValue((float) 3.14159);
|
||||||
|
historyDataResultVO.setCp95Value((float) 3.14159);
|
||||||
|
aAvg = Float.parseFloat(String.valueOf(objectList.get(1)));
|
||||||
|
historyDataResultVO.setAvgValue(aAvg);
|
||||||
|
} else {
|
||||||
|
if (objectList.get(3).equals("MAX")) {
|
||||||
|
bMax = Float.parseFloat(String.valueOf(objectList.get(1)));
|
||||||
|
historyDataResultVO.setMaxValue(bMax);
|
||||||
|
} else if (objectList.get(3).equals("MIN")) {
|
||||||
|
bMin = Float.parseFloat(String.valueOf(objectList.get(1)));
|
||||||
|
historyDataResultVO.setMinValue(bMin);
|
||||||
|
} else if (objectList.get(3).equals("AVG")) {
|
||||||
|
bAvg = Float.parseFloat(String.valueOf(objectList.get(1)));
|
||||||
|
historyDataResultVO.setAvgValue(bAvg);
|
||||||
|
} else if (objectList.get(3).equals("CP95")) {
|
||||||
|
bCp95 = Float.parseFloat(String.valueOf(objectList.get(1)));
|
||||||
|
historyDataResultVO.setCp95Value(bCp95);
|
||||||
}
|
}
|
||||||
//B相的最小值
|
|
||||||
if (!CollectionUtils.isEmpty(qusery.get(5).getSeries())) {
|
|
||||||
bMin = Float.parseFloat(qusery.get(5).getSeries().get(0).getValues().get(i).get(1).toString());
|
|
||||||
historyDataResultVOB.setMinValue(bMin);
|
|
||||||
}
|
}
|
||||||
//B相的平均值
|
|
||||||
if (!CollectionUtils.isEmpty(qusery.get(6).getSeries())) {
|
|
||||||
bAvg = Float.parseFloat(qusery.get(6).getSeries().get(0).getValues().get(i).get(1).toString());
|
|
||||||
historyDataResultVOB.setAvgValue(bAvg);
|
|
||||||
}
|
}
|
||||||
//B相的CP95
|
|
||||||
if (!CollectionUtils.isEmpty(qusery.get(7).getSeries())) {
|
|
||||||
time = String.valueOf(qusery.get(7).getSeries().get(0).getValues().get(i).get(0));
|
|
||||||
bCp95 = Float.parseFloat(qusery.get(7).getSeries().get(0).getValues().get(i).get(1).toString());
|
|
||||||
historyDataResultVOB.setTime(dateFormat.format(sdf.parse(time)));
|
|
||||||
historyDataResultVOB.setCp95Value(bCp95);
|
|
||||||
}
|
}
|
||||||
historyDataResultVOB.setLineName(lineDetailDataVO.getLineName());
|
historyDataResultVO.setTime(time);
|
||||||
historyDataResultVOB.setLineId(lineList);
|
historyDataResultVO.setLineName(lineDetailDataVO.getLineName());
|
||||||
historyDataResultVOB.setNumber(0);
|
historyDataResultVO.setLineId(lineList);
|
||||||
historyDataResultVOB.setSubName(lineDetailDataVO.getBdName());
|
historyDataResultVO.setNumber(0);
|
||||||
historyDataResultVOB.setTargetCode(contion);
|
historyDataResultVO.setSubName(lineDetailDataVO.getBdName());
|
||||||
historyDataResultVOB.setTargetName(phaseName);
|
historyDataResultVO.setTargetCode(contion);
|
||||||
if (Integer.parseInt(contion)==12 || Integer.parseInt(contion)==15){
|
historyDataResultVO.setTargetName(phaseName);
|
||||||
historyDataResultVOB.setPhaseType("B");
|
if (Integer.parseInt(contion) == 12 || Integer.parseInt(contion) == 15) {
|
||||||
historyDataResultVOB.setStatisticalType(Math.abs(aMax) > Math.abs(aMin) ? 3 : 2);
|
historyDataResultVO.setPhaseType("B");
|
||||||
}else if(Integer.parseInt(contion)==13 || Integer.parseInt(contion)==22){
|
historyDataResultVO.setStatisticalType(Math.abs(aMax) > Math.abs(aMin) ? 3 : 2);
|
||||||
historyDataResultVOB.setPhaseType("/");
|
} else if (Integer.parseInt(contion) == 13 || Integer.parseInt(contion) == 22) {
|
||||||
historyDataResultVOB.setStatisticalType(Math.abs(aMax) > Math.abs(aCp95) ? 3 : 4);
|
historyDataResultVO.setPhaseType("/");
|
||||||
}else {
|
historyDataResultVO.setStatisticalType(Math.abs(aMax) > Math.abs(aCp95) ? 3 : 4);
|
||||||
historyDataResultVOB.setPhaseType("B");
|
} else {
|
||||||
historyDataResultVOB.setStatisticalType(3);
|
historyDataResultVO.setPhaseType("B");
|
||||||
|
historyDataResultVO.setStatisticalType(3);
|
||||||
}
|
}
|
||||||
historyDataResultVOB.setScale(lineDetailDataVO.getScale());
|
historyDataResultVO.setScale(lineDetailDataVO.getScale());
|
||||||
historyDataResultVOB.setUnit(unit);
|
historyDataResultVO.setUnit(unit);
|
||||||
historyHarmOverLimitVOList.add(historyDataResultVOB);
|
historyHarmOverLimitVOList.add(historyDataResultVO);
|
||||||
|
} else if (qusery.get(0).getSeries().get(i).getTags().get("phasic_type").equals("C")) {
|
||||||
|
if (!CollectionUtils.isEmpty(qusery.get(0).getSeries().get(i).getValues())) {
|
||||||
|
HistoryHarmOverLimitVO historyDataResultVO = new HistoryHarmOverLimitVO();
|
||||||
|
for (int j = 0; j < qusery.get(0).getSeries().get(i).getValues().size(); j++) {
|
||||||
|
List<Object> objectList = qusery.get(0).getSeries().get(i).getValues().get(j);
|
||||||
|
String aa = String.valueOf(objectList.get(0));
|
||||||
|
Date sd = dateFormat.parse(aa);
|
||||||
|
time = dateFormat.format(sd);
|
||||||
|
if (Integer.parseInt(contion) == 61) {
|
||||||
|
historyDataResultVO.setMaxValue((float) 3.14159);
|
||||||
|
historyDataResultVO.setMinValue((float) 3.14159);
|
||||||
|
historyDataResultVO.setCp95Value((float) 3.14159);
|
||||||
|
aAvg = Float.parseFloat(String.valueOf(objectList.get(1)));
|
||||||
|
historyDataResultVO.setAvgValue(aAvg);
|
||||||
|
} else {
|
||||||
|
if (objectList.get(3).equals("MAX")) {
|
||||||
|
cMax = Float.parseFloat(String.valueOf(objectList.get(1)));
|
||||||
|
historyDataResultVO.setMaxValue(cMax);
|
||||||
|
} else if (objectList.get(3).equals("MIN")) {
|
||||||
|
cMin = Float.parseFloat(String.valueOf(objectList.get(1)));
|
||||||
|
historyDataResultVO.setMinValue(cMin);
|
||||||
|
} else if (objectList.get(3).equals("AVG")) {
|
||||||
|
cAvg = Float.parseFloat(String.valueOf(objectList.get(1)));
|
||||||
|
historyDataResultVO.setAvgValue(cAvg);
|
||||||
|
} else if (objectList.get(3).equals("CP95")) {
|
||||||
|
cCp95 = Float.parseFloat(String.valueOf(objectList.get(1)));
|
||||||
|
historyDataResultVO.setCp95Value(cCp95);
|
||||||
}
|
}
|
||||||
for (int i = 0; i < qusery.get(8).getSeries().get(0).getValues().size(); i++) {
|
|
||||||
HistoryHarmOverLimitVO historyDataResultVOC = new HistoryHarmOverLimitVO();
|
|
||||||
//C相的最大值
|
|
||||||
if (!CollectionUtils.isEmpty(qusery.get(8).getSeries())) {
|
|
||||||
cMax = Float.parseFloat(qusery.get(8).getSeries().get(0).getValues().get(i).get(1).toString());
|
|
||||||
historyDataResultVOC.setMaxValue(cMax);
|
|
||||||
}
|
}
|
||||||
//C相的最小值
|
|
||||||
if (!CollectionUtils.isEmpty(qusery.get(9).getSeries())) {
|
|
||||||
cMin = Float.parseFloat(qusery.get(9).getSeries().get(0).getValues().get(i).get(1).toString());
|
|
||||||
historyDataResultVOC.setMinValue(cMin);
|
|
||||||
}
|
}
|
||||||
//C相的平均值
|
historyDataResultVO.setTime(time);
|
||||||
if (!CollectionUtils.isEmpty(qusery.get(10).getSeries())) {
|
historyDataResultVO.setLineName(lineDetailDataVO.getLineName());
|
||||||
cAvg = Float.parseFloat(qusery.get(10).getSeries().get(0).getValues().get(i).get(1).toString());
|
historyDataResultVO.setLineId(lineList);
|
||||||
historyDataResultVOC.setAvgValue(cAvg);
|
historyDataResultVO.setNumber(0);
|
||||||
|
historyDataResultVO.setSubName(lineDetailDataVO.getBdName());
|
||||||
|
historyDataResultVO.setTargetCode(contion);
|
||||||
|
historyDataResultVO.setTargetName(phaseName);
|
||||||
|
if (Integer.parseInt(contion) == 12 || Integer.parseInt(contion) == 15) {
|
||||||
|
historyDataResultVO.setPhaseType("C");
|
||||||
|
historyDataResultVO.setStatisticalType(Math.abs(cMax) > Math.abs(cMin) ? 3 : 2);
|
||||||
|
} else if (Integer.parseInt(contion) == 13 || Integer.parseInt(contion) == 22) {
|
||||||
|
historyDataResultVO.setPhaseType("/");
|
||||||
|
historyDataResultVO.setStatisticalType(Math.abs(cMax) > Math.abs(cCp95) ? 3 : 4);
|
||||||
|
} else {
|
||||||
|
historyDataResultVO.setPhaseType("C");
|
||||||
|
historyDataResultVO.setStatisticalType(3);
|
||||||
}
|
}
|
||||||
//C相的CP95
|
historyDataResultVO.setScale(lineDetailDataVO.getScale());
|
||||||
if (!CollectionUtils.isEmpty(qusery.get(11).getSeries())) {
|
historyDataResultVO.setUnit(unit);
|
||||||
time = String.valueOf(qusery.get(11).getSeries().get(0).getValues().get(i).get(0));
|
historyHarmOverLimitVOList.add(historyDataResultVO);
|
||||||
cCp95 = Float.parseFloat(qusery.get(11).getSeries().get(0).getValues().get(i).get(1).toString());
|
|
||||||
historyDataResultVOC.setTime(dateFormat.format(sdf.parse(time)));
|
|
||||||
historyDataResultVOC.setCp95Value(cCp95);
|
|
||||||
}
|
}
|
||||||
historyDataResultVOC.setLineName(lineDetailDataVO.getLineName());
|
|
||||||
historyDataResultVOC.setLineId(lineList);
|
|
||||||
historyDataResultVOC.setNumber(0);
|
|
||||||
historyDataResultVOC.setSubName(lineDetailDataVO.getBdName());
|
|
||||||
historyDataResultVOC.setTargetCode(contion);
|
|
||||||
historyDataResultVOC.setTargetName(phaseName);
|
|
||||||
if (Integer.parseInt(contion)==12 || Integer.parseInt(contion)==15){
|
|
||||||
historyDataResultVOC.setPhaseType("C");
|
|
||||||
historyDataResultVOC.setStatisticalType(Math.abs(aMax) > Math.abs(aMin) ? 3 : 2);
|
|
||||||
}else if(Integer.parseInt(contion)==13 || Integer.parseInt(contion)==22){
|
|
||||||
historyDataResultVOC.setPhaseType("/");
|
|
||||||
historyDataResultVOC.setStatisticalType(Math.abs(aMax) > Math.abs(aCp95) ? 3 : 4);
|
|
||||||
}else {
|
|
||||||
historyDataResultVOC.setPhaseType("C");
|
|
||||||
historyDataResultVOC.setStatisticalType(3);
|
|
||||||
}
|
}
|
||||||
historyDataResultVOC.setScale(lineDetailDataVO.getScale());
|
|
||||||
historyDataResultVOC.setUnit(unit);
|
|
||||||
historyHarmOverLimitVOList.add(historyDataResultVOC);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ import com.njcn.harmonic.constant.Param;
|
|||||||
import com.njcn.harmonic.pojo.param.PulicTimeStatisParam;
|
import com.njcn.harmonic.pojo.param.PulicTimeStatisParam;
|
||||||
import com.njcn.harmonic.pojo.vo.SteadyInfoData;
|
import com.njcn.harmonic.pojo.vo.SteadyInfoData;
|
||||||
import com.njcn.harmonic.service.SteadyDataService;
|
import com.njcn.harmonic.service.SteadyDataService;
|
||||||
|
import com.njcn.influxdb.param.InfluxDBPublicParam;
|
||||||
import com.njcn.influxdb.utils.InfluxDbUtils;
|
import com.njcn.influxdb.utils.InfluxDbUtils;
|
||||||
import com.njcn.web.pojo.vo.SteadyDataVO;
|
import com.njcn.web.pojo.vo.SteadyDataVO;
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
@@ -49,24 +50,25 @@ public class SteadyDataServiceImpl implements SteadyDataService {
|
|||||||
if (!lineList.isEmpty() || StringUtils.isNotBlank(lineList)) {
|
if (!lineList.isEmpty() || StringUtils.isNotBlank(lineList)) {
|
||||||
//组装sql语句
|
//组装sql语句
|
||||||
StringBuilder stringBuilder = new StringBuilder();
|
StringBuilder stringBuilder = new StringBuilder();
|
||||||
stringBuilder.append(Param.TIME + " >= '").append(startTime).append(Param.START_TIME).append("' and ").append(Param.TIME).append(" <= '").append(endTime).append(Param.END_TIME).append("' and (");
|
stringBuilder.append(InfluxDBPublicParam.TIME + " >= '").append(startTime).append(InfluxDBPublicParam.START_TIME).append("' and ").append(InfluxDBPublicParam.TIME).append(" <= '").append(endTime).append(InfluxDBPublicParam.END_TIME).append("' and (");
|
||||||
//sql语句
|
//sql语句
|
||||||
stringBuilder.append(Param.MYINDEX + "='").append(lineList).append("')");
|
stringBuilder.append(InfluxDBPublicParam.LINE_ID + "='").append(lineList).append("') ");
|
||||||
|
stringBuilder.append(InfluxDBPublicParam.TIME_ZONE);
|
||||||
String sql = "SELECT" +
|
String sql = "SELECT" +
|
||||||
" SUM( AllTime ) AS allTime," +
|
" SUM( alltime ) AS alltime," +
|
||||||
" SUM( Flicket_AllTime ) AS frequency," +
|
" SUM( freq_dev_overtime ) AS frequency," +
|
||||||
" SUM( Freq_Dev_OverTime ) AS uBalance," +
|
" SUM( ubalance_overtime ) AS uBalance," +
|
||||||
" SUM( I_Neg_OverTime ) AS iNeg," +
|
" SUM( i_neg_overtime ) AS iNeg," +
|
||||||
" SUM( IHarm_13_OverTime) AS harmElec," +
|
" SUM( iharm_13_overtime) AS harmElec," +
|
||||||
" SUM( UHarm_4_OverTime) AS harmVoltage," +
|
" SUM( uharm_4_overtime) AS harmVoltage," +
|
||||||
" SUM( Flicker_OverTime ) AS flicker," +
|
" SUM( flicker_overtime ) AS flicker," +
|
||||||
" SUM( Flicket_AllTime ) AS allFlicker," +
|
" SUM( flicker_alltime ) AS allFlicker," +
|
||||||
" SUM( Voltage_Dev_OverTime ) AS voltageDeviation," +
|
" SUM( voltage_dev_overtime ) AS voltageDeviation," +
|
||||||
" SUM( InUHARM_9_OverTime ) AS inUharm" +
|
" SUM( inuharm_9_overtime ) AS inUharm" +
|
||||||
" FROM" +
|
" FROM" +
|
||||||
" LIMIT_RATE" +
|
" limit_rate" +
|
||||||
" WHERE" +
|
" WHERE" +
|
||||||
" Phasic_Type = 'T'" +
|
" phasic_type = 'T'" +
|
||||||
" AND " + stringBuilder.toString();
|
" AND " + stringBuilder.toString();
|
||||||
//结果集
|
//结果集
|
||||||
QueryResult result = influxDbUtils.query(sql);
|
QueryResult result = influxDbUtils.query(sql);
|
||||||
|
|||||||
@@ -60,7 +60,7 @@ public interface AreaMapper extends BaseMapper<Area> {
|
|||||||
*
|
*
|
||||||
* @return 行政区域树(首次)
|
* @return 行政区域树(首次)
|
||||||
*/
|
*/
|
||||||
List<AreaTreeDTO> getAreaDeptTree(@Param("type") Integer type, @Param("state")Integer state);
|
List<AreaTreeDTO> getAreaDeptTree(@Param("id")String id,@Param("type") Integer type, @Param("state")Integer state);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询所有区域
|
* 查询所有区域
|
||||||
|
|||||||
@@ -63,7 +63,9 @@
|
|||||||
sys_area.lng lng,
|
sys_area.lng lng,
|
||||||
sys_area.lat lat
|
sys_area.lat lat
|
||||||
FROM sys_area sys_area
|
FROM sys_area sys_area
|
||||||
WHERE sys_area.type = #{type}
|
WHERE sys_area.id = #{id}
|
||||||
|
or sys_area.pid = #{id}
|
||||||
|
and sys_area.type = #{type}
|
||||||
AND sys_area.state = #{state}
|
AND sys_area.state = #{state}
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
|||||||
@@ -187,7 +187,7 @@ public class AreaServiceImpl extends ServiceImpl<AreaMapper, Area> implements IA
|
|||||||
|
|
||||||
id = deptFeignClient.getAreaIdByDeptId(RequestUtil.getDeptIndex()).getData();
|
id = deptFeignClient.getAreaIdByDeptId(RequestUtil.getDeptIndex()).getData();
|
||||||
}
|
}
|
||||||
areaTreeVOList = this.baseMapper.getAreaDeptTree(type, DataStateEnum.ENABLE.getCode());
|
areaTreeVOList = this.baseMapper.getAreaDeptTree(id,type, DataStateEnum.ENABLE.getCode());
|
||||||
List<AreaTreeDTO> finalAreaTreeVOList = areaTreeVOList;
|
List<AreaTreeDTO> finalAreaTreeVOList = areaTreeVOList;
|
||||||
String finalId = id;
|
String finalId = id;
|
||||||
areaTreeVOS = areaTreeVOList.stream().filter(deptTreeVO ->
|
areaTreeVOS = areaTreeVOList.stream().filter(deptTreeVO ->
|
||||||
|
|||||||
@@ -185,22 +185,6 @@ public class DeptServiceImpl extends ServiceImpl<DeptMapper, Dept> implements ID
|
|||||||
treeDTO.setName(treeDTO.getName() + "(已被绑定)");
|
treeDTO.setName(treeDTO.getName() + "(已被绑定)");
|
||||||
treeDTO.setIsFalse(1);
|
treeDTO.setIsFalse(1);
|
||||||
}
|
}
|
||||||
if (treeDTO.getChildren().size() != 0) {
|
|
||||||
for (AreaTreeDTO areaTreeDTO : treeDTO.getChildren()) {
|
|
||||||
if (areaTreeVO.contains(areaTreeDTO.getId())) {
|
|
||||||
areaTreeDTO.setName(areaTreeDTO.getName() + "(已被绑定)");
|
|
||||||
areaTreeDTO.setIsFalse(1);
|
|
||||||
}
|
|
||||||
if (areaTreeDTO.getChildren().size() != 0) {
|
|
||||||
for (AreaTreeDTO dto : areaTreeDTO.getChildren()) {
|
|
||||||
if (areaTreeVO.contains(dto.getId())) {
|
|
||||||
dto.setName(dto.getName() + "(已被绑定)");
|
|
||||||
dto.setIsFalse(1);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user