谐波更改相关功能
This commit is contained in:
@@ -164,6 +164,7 @@ public class PubUtils {
|
||||
|
||||
/**
|
||||
* 用于获取对象中,前缀一样,后缀为2~50的属性值
|
||||
*
|
||||
* @param object 待操作对象
|
||||
* @param methodPrefix 方法前缀
|
||||
* @param number 方法后缀
|
||||
@@ -231,4 +232,17 @@ public class PubUtils {
|
||||
return "";
|
||||
}
|
||||
}
|
||||
|
||||
public static Integer ptTypeName(String ptType) {
|
||||
switch (ptType) {
|
||||
case "星型接线":
|
||||
return 0;
|
||||
case "三角型接线":
|
||||
return 1;
|
||||
case "开口三角型接线":
|
||||
return 2;
|
||||
default:
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -68,6 +68,13 @@ public class DataTest {
|
||||
}
|
||||
//单条数据插入
|
||||
public static void insert(InfluxDbUtils influxDBUtil) {
|
||||
Map<String, String> tags = new HashMap<>();
|
||||
long time = Long.parseLong("1654141002000");
|
||||
tags.put("line_id", "5e467a40023b299070682eb21f2ec9a1");
|
||||
Map<String, Object> fields = new HashMap<>();
|
||||
fields.put("due",1440);
|
||||
fields.put("real",1200);
|
||||
influxDBUtil.insert("pqs_integrity", tags, fields, time, TimeUnit.MILLISECONDS);
|
||||
// long time = Long.parseLong("1655135328135");
|
||||
// Map<String, String> tags = new HashMap<>();
|
||||
// // tags.put("line_id", "127fad1dcb0077ac2979141b8473a5e4");
|
||||
@@ -80,7 +87,6 @@ public class DataTest {
|
||||
// influxDBUtil.insert("pqs_event_push_logs", tags, fields, time, TimeUnit.MILLISECONDS);
|
||||
|
||||
// long time = Long.parseLong("1654141002000");
|
||||
Map<String, String> tags = new HashMap<>();
|
||||
// tags.put("line_id", "5e467a40023b299070682eb21f2ec9a1");
|
||||
// Map<String, Object> fields = new HashMap<>();
|
||||
// fields.put("vu_dev1",5.706);
|
||||
@@ -192,82 +198,82 @@ public class DataTest {
|
||||
// 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<>();
|
||||
fields.put("voltage_dev",3.6);
|
||||
fields.put("uvoltage_dev",-2.6);
|
||||
fields.put("ubalance",6);
|
||||
fields.put("flicker",0.6);
|
||||
fields.put("uaberrance",2);
|
||||
fields.put("i_neg",20);
|
||||
fields.put("uharm_2",0);
|
||||
fields.put("uharm_3",0);
|
||||
fields.put("uharm_4",0);
|
||||
fields.put("uharm_5",0);
|
||||
fields.put("uharm_6",0);
|
||||
fields.put("uharm_7",0);
|
||||
fields.put("uharm_8",0);
|
||||
fields.put("uharm_9",0);
|
||||
fields.put("uharm_10",0);
|
||||
fields.put("uharm_11",10);
|
||||
fields.put("uharm_12",0);
|
||||
fields.put("uharm_13",0);
|
||||
fields.put("uharm_14",0);
|
||||
fields.put("uharm_15",0);
|
||||
fields.put("uharm_16",15.3);
|
||||
fields.put("uharm_17",0);
|
||||
fields.put("uharm_18",0);
|
||||
fields.put("uharm_19",0);
|
||||
fields.put("uharm_20",0);
|
||||
fields.put("uharm_21",0);
|
||||
fields.put("uharm_22",0);
|
||||
fields.put("uharm_23",0);
|
||||
fields.put("uharm_24",0);
|
||||
fields.put("uharm_25",0);
|
||||
fields.put("iharm_2",0);
|
||||
fields.put("iharm_3",0);
|
||||
fields.put("iharm_4",0);
|
||||
fields.put("iharm_5",6.02);
|
||||
fields.put("iharm_6",0);
|
||||
fields.put("iharm_7",0);
|
||||
fields.put("iharm_8",0);
|
||||
fields.put("iharm_9",0);
|
||||
fields.put("iharm_10",0);
|
||||
fields.put("iharm_11",0);
|
||||
fields.put("iharm_12",0);
|
||||
fields.put("iharm_13",0);
|
||||
fields.put("iharm_14",0);
|
||||
fields.put("iharm_15",3.25);
|
||||
fields.put("iharm_16",0);
|
||||
fields.put("iharm_17",0);
|
||||
fields.put("iharm_18",0);
|
||||
fields.put("iharm_19",0);
|
||||
fields.put("iharm_20",0);
|
||||
fields.put("iharm_21",0);
|
||||
fields.put("iharm_22",0);
|
||||
fields.put("iharm_23",0);
|
||||
fields.put("iharm_24",3.52);
|
||||
fields.put("iharm_25",0);
|
||||
fields.put("inuharm_1",0);
|
||||
fields.put("inuharm_2",0);
|
||||
fields.put("inuharm_3",3.25);
|
||||
fields.put("inuharm_4",0);
|
||||
fields.put("inuharm_5",3.26);
|
||||
fields.put("inuharm_6",0);
|
||||
fields.put("inuharm_7",0);
|
||||
fields.put("inuharm_8",0);
|
||||
fields.put("inuharm_9",0);
|
||||
fields.put("inuharm_10",0);
|
||||
fields.put("inuharm_11",0);
|
||||
fields.put("inuharm_12",6.25);
|
||||
fields.put("inuharm_13",0);
|
||||
fields.put("inuharm_14",0);
|
||||
fields.put("inuharm_15",0);
|
||||
fields.put("inuharm_16",0);
|
||||
influxDBUtil.insert("pqs_abnormaldata", 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<>();
|
||||
// fields.put("voltage_dev",3.6);
|
||||
// fields.put("uvoltage_dev",-2.6);
|
||||
// fields.put("ubalance",6);
|
||||
// fields.put("flicker",0.6);
|
||||
// fields.put("uaberrance",2);
|
||||
// fields.put("i_neg",20);
|
||||
// fields.put("uharm_2",0);
|
||||
// fields.put("uharm_3",0);
|
||||
// fields.put("uharm_4",0);
|
||||
// fields.put("uharm_5",0);
|
||||
// fields.put("uharm_6",0);
|
||||
// fields.put("uharm_7",0);
|
||||
// fields.put("uharm_8",0);
|
||||
// fields.put("uharm_9",0);
|
||||
// fields.put("uharm_10",0);
|
||||
// fields.put("uharm_11",10);
|
||||
// fields.put("uharm_12",0);
|
||||
// fields.put("uharm_13",0);
|
||||
// fields.put("uharm_14",0);
|
||||
// fields.put("uharm_15",0);
|
||||
// fields.put("uharm_16",15.3);
|
||||
// fields.put("uharm_17",0);
|
||||
// fields.put("uharm_18",0);
|
||||
// fields.put("uharm_19",0);
|
||||
// fields.put("uharm_20",0);
|
||||
// fields.put("uharm_21",0);
|
||||
// fields.put("uharm_22",0);
|
||||
// fields.put("uharm_23",0);
|
||||
// fields.put("uharm_24",0);
|
||||
// fields.put("uharm_25",0);
|
||||
// fields.put("iharm_2",0);
|
||||
// fields.put("iharm_3",0);
|
||||
// fields.put("iharm_4",0);
|
||||
// fields.put("iharm_5",6.02);
|
||||
// fields.put("iharm_6",0);
|
||||
// fields.put("iharm_7",0);
|
||||
// fields.put("iharm_8",0);
|
||||
// fields.put("iharm_9",0);
|
||||
// fields.put("iharm_10",0);
|
||||
// fields.put("iharm_11",0);
|
||||
// fields.put("iharm_12",0);
|
||||
// fields.put("iharm_13",0);
|
||||
// fields.put("iharm_14",0);
|
||||
// fields.put("iharm_15",3.25);
|
||||
// fields.put("iharm_16",0);
|
||||
// fields.put("iharm_17",0);
|
||||
// fields.put("iharm_18",0);
|
||||
// fields.put("iharm_19",0);
|
||||
// fields.put("iharm_20",0);
|
||||
// fields.put("iharm_21",0);
|
||||
// fields.put("iharm_22",0);
|
||||
// fields.put("iharm_23",0);
|
||||
// fields.put("iharm_24",3.52);
|
||||
// fields.put("iharm_25",0);
|
||||
// fields.put("inuharm_1",0);
|
||||
// fields.put("inuharm_2",0);
|
||||
// fields.put("inuharm_3",3.25);
|
||||
// fields.put("inuharm_4",0);
|
||||
// fields.put("inuharm_5",3.26);
|
||||
// fields.put("inuharm_6",0);
|
||||
// fields.put("inuharm_7",0);
|
||||
// fields.put("inuharm_8",0);
|
||||
// fields.put("inuharm_9",0);
|
||||
// fields.put("inuharm_10",0);
|
||||
// fields.put("inuharm_11",0);
|
||||
// fields.put("inuharm_12",6.25);
|
||||
// fields.put("inuharm_13",0);
|
||||
// fields.put("inuharm_14",0);
|
||||
// fields.put("inuharm_15",0);
|
||||
// fields.put("inuharm_16",0);
|
||||
// influxDBUtil.insert("pqs_abnormaldata", tags, fields, time, TimeUnit.MILLISECONDS);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package com.njcn.harmonic.service.impl;
|
||||
|
||||
import com.njcn.common.utils.PubUtils;
|
||||
import com.njcn.device.api.LineFeignClient;
|
||||
import com.njcn.device.pojo.vo.LineDetailDataVO;
|
||||
import com.njcn.harmonic.constant.Param;
|
||||
@@ -216,7 +217,6 @@ public class NormLimitServiceImpl implements NormLimitService {
|
||||
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;
|
||||
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();
|
||||
if (!CollectionUtils.isEmpty(qusery.get(0).getSeries().get(i).getValues())) {
|
||||
@@ -256,13 +256,21 @@ public class NormLimitServiceImpl implements NormLimitService {
|
||||
historyDataResultVO.setTargetCode(contion);
|
||||
historyDataResultVO.setTargetName(phaseName);
|
||||
if (Integer.parseInt(contion) == 12 || Integer.parseInt(contion) == 15) {
|
||||
if (PubUtils.ptTypeName(lineDetailDataVO.getPtType()) != 0) {
|
||||
historyDataResultVO.setPhaseType("AB");
|
||||
} else {
|
||||
historyDataResultVO.setPhaseType("A");
|
||||
}
|
||||
historyDataResultVO.setStatisticalType(Math.abs(aMax) > Math.abs(aMin) ? 3 : 2);
|
||||
} else if (Integer.parseInt(contion) == 13 || Integer.parseInt(contion) == 22) {
|
||||
historyDataResultVO.setPhaseType("/");
|
||||
historyDataResultVO.setStatisticalType(Math.abs(aMax) > Math.abs(aCp95) ? 3 : 4);
|
||||
} else {
|
||||
if (PubUtils.ptTypeName(lineDetailDataVO.getPtType()) != 0) {
|
||||
historyDataResultVO.setPhaseType("AB");
|
||||
} else {
|
||||
historyDataResultVO.setPhaseType("A");
|
||||
}
|
||||
historyDataResultVO.setStatisticalType(3);
|
||||
}
|
||||
historyDataResultVO.setScale(lineDetailDataVO.getScale());
|
||||
@@ -309,13 +317,21 @@ public class NormLimitServiceImpl implements NormLimitService {
|
||||
historyDataResultVO.setTargetCode(contion);
|
||||
historyDataResultVO.setTargetName(phaseName);
|
||||
if (Integer.parseInt(contion) == 12 || Integer.parseInt(contion) == 15) {
|
||||
if (PubUtils.ptTypeName(lineDetailDataVO.getPtType()) != 0) {
|
||||
historyDataResultVO.setPhaseType("BC");
|
||||
} else {
|
||||
historyDataResultVO.setPhaseType("B");
|
||||
}
|
||||
historyDataResultVO.setStatisticalType(Math.abs(aMax) > Math.abs(aMin) ? 3 : 2);
|
||||
} else if (Integer.parseInt(contion) == 13 || Integer.parseInt(contion) == 22) {
|
||||
historyDataResultVO.setPhaseType("/");
|
||||
historyDataResultVO.setStatisticalType(Math.abs(aMax) > Math.abs(aCp95) ? 3 : 4);
|
||||
} else {
|
||||
if (PubUtils.ptTypeName(lineDetailDataVO.getPtType()) != 0) {
|
||||
historyDataResultVO.setPhaseType("BC");
|
||||
} else {
|
||||
historyDataResultVO.setPhaseType("B");
|
||||
}
|
||||
historyDataResultVO.setStatisticalType(3);
|
||||
}
|
||||
historyDataResultVO.setScale(lineDetailDataVO.getScale());
|
||||
@@ -359,13 +375,21 @@ public class NormLimitServiceImpl implements NormLimitService {
|
||||
historyDataResultVO.setTargetCode(contion);
|
||||
historyDataResultVO.setTargetName(phaseName);
|
||||
if (Integer.parseInt(contion) == 12 || Integer.parseInt(contion) == 15) {
|
||||
if (PubUtils.ptTypeName(lineDetailDataVO.getPtType()) != 0) {
|
||||
historyDataResultVO.setPhaseType("CA");
|
||||
} else {
|
||||
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 {
|
||||
if (PubUtils.ptTypeName(lineDetailDataVO.getPtType()) != 0) {
|
||||
historyDataResultVO.setPhaseType("CA");
|
||||
} else {
|
||||
historyDataResultVO.setPhaseType("C");
|
||||
}
|
||||
historyDataResultVO.setStatisticalType(3);
|
||||
}
|
||||
historyDataResultVO.setScale(lineDetailDataVO.getScale());
|
||||
|
||||
Reference in New Issue
Block a user