1.解决间谐波存值问题,取消基波存值
2.解决原始值和结果值入库不一致问题
This commit is contained in:
@@ -999,7 +999,7 @@ public class SocketDevResponseService {
|
|||||||
successComm.add(devData.getId());
|
successComm.add(devData.getId());
|
||||||
|
|
||||||
if (SocketManager.clockMap.containsKey(sourceIssue.getIndex())) {
|
if (SocketManager.clockMap.containsKey(sourceIssue.getIndex())) {
|
||||||
SocketManager.clockMap.put(sourceIssue.getIndex(), 0L);
|
SocketManager.clockMap.put(sourceIssue.getIndex(), 0L);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (successComm.size() == FormalTestManager.monitorIdListComm.size()) {
|
if (successComm.size() == FormalTestManager.monitorIdListComm.size()) {
|
||||||
@@ -1579,7 +1579,7 @@ public class SocketDevResponseService {
|
|||||||
adHarmonicResult.setAdType(checkDataMap.get(sqlDataDTO.getDesc()));
|
adHarmonicResult.setAdType(checkDataMap.get(sqlDataDTO.getDesc()));
|
||||||
adHarmonicResult.setDataType("avg");
|
adHarmonicResult.setDataType("avg");
|
||||||
|
|
||||||
if (!DicDataEnum.HI.getCode().equals(sourceIssue.getType()) && !DicDataEnum.HSI.getCode().equals(sourceIssue.getType()) && !DicDataEnum.HP.getCode().equals(sourceIssue.getType())) {
|
if (!DicDataEnum.HSV.getCode().equals(sourceIssue.getType()) && !DicDataEnum.HSI.getCode().equals(sourceIssue.getType()) && !DicDataEnum.HP.getCode().equals(sourceIssue.getType())) {
|
||||||
if (CollUtil.isNotEmpty(data.getSqlData())) {
|
if (CollUtil.isNotEmpty(data.getSqlData())) {
|
||||||
DevData.SqlDataDTO.ListDTO vvv = data.getSqlData().get(0).getList();
|
DevData.SqlDataDTO.ListDTO vvv = data.getSqlData().get(0).getList();
|
||||||
Double aV = vvv.getA();
|
Double aV = vvv.getA();
|
||||||
@@ -1604,20 +1604,39 @@ public class SocketDevResponseService {
|
|||||||
List<String> c = tem.getC();
|
List<String> c = tem.getC();
|
||||||
|
|
||||||
Class<AdHarmonicResult> example = (Class<AdHarmonicResult>) adHarmonicResult.getClass();
|
Class<AdHarmonicResult> example = (Class<AdHarmonicResult>) adHarmonicResult.getClass();
|
||||||
for (int i = 2; i <= 50; i++) {
|
if(DicDataEnum.HSV.getCode().equals(sourceIssue.getType()) || DicDataEnum.HSI.getCode().equals(sourceIssue.getType())){
|
||||||
try {
|
for (int i = 1; i < a.size()+1; i++) {
|
||||||
Field aField = example.getDeclaredField("aValue" + i);
|
try {
|
||||||
Field bField = example.getDeclaredField("bValue" + i);
|
Field aField = example.getDeclaredField("aValue" + i);
|
||||||
Field cField = example.getDeclaredField("cValue" + i);
|
Field bField = example.getDeclaredField("bValue" + i);
|
||||||
|
Field cField = example.getDeclaredField("cValue" + i);
|
||||||
|
|
||||||
aField.setAccessible(true);
|
aField.setAccessible(true);
|
||||||
aField.set(adHarmonicResult, a.get(i - 2));
|
aField.set(adHarmonicResult, a.get(i - 1));
|
||||||
bField.setAccessible(true);
|
bField.setAccessible(true);
|
||||||
bField.set(adHarmonicResult, b.get(i - 2));
|
bField.set(adHarmonicResult, b.get(i - 1));
|
||||||
cField.setAccessible(true);
|
cField.setAccessible(true);
|
||||||
cField.set(adHarmonicResult, c.get(i - 2));
|
cField.set(adHarmonicResult, c.get(i - 1));
|
||||||
} catch (NoSuchFieldException | IllegalAccessException e) {
|
} catch (NoSuchFieldException | IllegalAccessException e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}else{
|
||||||
|
for (int i = 2; i <= a.size()+1; i++) {
|
||||||
|
try {
|
||||||
|
Field aField = example.getDeclaredField("aValue" + i);
|
||||||
|
Field bField = example.getDeclaredField("bValue" + i);
|
||||||
|
Field cField = example.getDeclaredField("cValue" + i);
|
||||||
|
|
||||||
|
aField.setAccessible(true);
|
||||||
|
aField.set(adHarmonicResult, a.get(i - 2));
|
||||||
|
bField.setAccessible(true);
|
||||||
|
bField.set(adHarmonicResult, b.get(i - 2));
|
||||||
|
cField.setAccessible(true);
|
||||||
|
cField.set(adHarmonicResult, c.get(i - 2));
|
||||||
|
} catch (NoSuchFieldException | IllegalAccessException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
adHarmonicResultList.add(adHarmonicResult);
|
adHarmonicResultList.add(adHarmonicResult);
|
||||||
|
|||||||
@@ -772,7 +772,7 @@ public class DetectionServiceImpl {
|
|||||||
dataMap.forEach((key, value) -> {
|
dataMap.forEach((key, value) -> {
|
||||||
try {
|
try {
|
||||||
// 设置 id 字段;
|
// 设置 id 字段;
|
||||||
Field idField = AdHarmonicResult.class.getDeclaredField(phase + "Value" + (num == 1 ? (int) (key + 1.5) : key.intValue()));
|
Field idField = AdHarmonicResult.class.getDeclaredField(phase + "Value" + (num == 1 ? (int) (key + 0.5) : key.intValue()));
|
||||||
idField.setAccessible(true);
|
idField.setAccessible(true);
|
||||||
if (ObjectUtil.isNull(value.getIsData())) {
|
if (ObjectUtil.isNull(value.getIsData())) {
|
||||||
idField.set(harmonicResult, value.getData());
|
idField.set(harmonicResult, value.getData());
|
||||||
@@ -937,12 +937,12 @@ public class DetectionServiceImpl {
|
|||||||
Integer num) {
|
Integer num) {
|
||||||
Map<String, Map<Double, List<Double>>> map = new HashMap<>(3);
|
Map<String, Map<Double, List<Double>>> map = new HashMap<>(3);
|
||||||
List<Double> harmNum = new ArrayList<>();
|
List<Double> harmNum = new ArrayList<>();
|
||||||
harmNum.add(1.0);
|
|
||||||
if (1 == num) {
|
if (1 == num) {
|
||||||
harmNum.addAll(sourceIssue.getChannelList().stream()
|
harmNum.addAll(sourceIssue.getChannelList().stream()
|
||||||
.flatMap(x -> x.getInharmList().stream().map(f -> f.getInharm()))
|
.flatMap(x -> x.getInharmList().stream().map(f -> f.getInharm()))
|
||||||
.sorted().distinct().collect(Collectors.toList()));
|
.sorted().distinct().collect(Collectors.toList()));
|
||||||
} else {
|
} else {
|
||||||
|
harmNum.add(1.0);
|
||||||
harmNum.addAll(sourceIssue.getChannelList().stream()
|
harmNum.addAll(sourceIssue.getChannelList().stream()
|
||||||
.flatMap(x -> x.getHarmList().stream().map(f -> f.getHarm()))
|
.flatMap(x -> x.getHarmList().stream().map(f -> f.getHarm()))
|
||||||
.sorted().distinct().collect(Collectors.toList()));
|
.sorted().distinct().collect(Collectors.toList()));
|
||||||
@@ -965,9 +965,9 @@ public class DetectionServiceImpl {
|
|||||||
harmPut(TYPE_B, map, harmNum, harm, String.valueOf(fund.getList().getB()), num);
|
harmPut(TYPE_B, map, harmNum, harm, String.valueOf(fund.getList().getB()), num);
|
||||||
harmPut(TYPE_C, map, harmNum, harm, String.valueOf(fund.getList().getC()), num);
|
harmPut(TYPE_C, map, harmNum, harm, String.valueOf(fund.getList().getC()), num);
|
||||||
} else {
|
} else {
|
||||||
harmPut(TYPE_A, map, harmNum, harm, "0.0", num);
|
harmPut(TYPE_A, map, harmNum, harm, "1.0", num);
|
||||||
harmPut(TYPE_B, map, harmNum, harm, "0.0", num);
|
harmPut(TYPE_B, map, harmNum, harm, "1.0", num);
|
||||||
harmPut(TYPE_C, map, harmNum, harm, "0.0", num);
|
harmPut(TYPE_C, map, harmNum, harm, "1.0", num);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1221,10 +1221,10 @@ public class DetectionServiceImpl {
|
|||||||
Map<Double, List<Double>> integerListMap = map.get(type);
|
Map<Double, List<Double>> integerListMap = map.get(type);
|
||||||
for (Double i : harmNum) {
|
for (Double i : harmNum) {
|
||||||
if (integerListMap.containsKey(i)) {
|
if (integerListMap.containsKey(i)) {
|
||||||
if (i.equals(1.0)) {
|
if (i.equals(1.0)&&num != 1) {
|
||||||
integerListMap.get(1.0).add(multiply(fund, fund));
|
integerListMap.get(1.0).add(multiply(fund, fund));
|
||||||
} else {
|
} else {
|
||||||
double v = (num == 1 ? num : (i - num));
|
double v = (num == 1 ? i : (i - num));
|
||||||
if (type.equals("A")) {
|
if (type.equals("A")) {
|
||||||
integerListMap.get(i).add(multiply(harm.getList().getA().get((int) v), fund));
|
integerListMap.get(i).add(multiply(harm.getList().getA().get((int) v), fund));
|
||||||
}
|
}
|
||||||
@@ -1241,11 +1241,11 @@ public class DetectionServiceImpl {
|
|||||||
Map<Double, List<Double>> integerListMap = new LinkedHashMap<>(5);
|
Map<Double, List<Double>> integerListMap = new LinkedHashMap<>(5);
|
||||||
for (Double i : harmNum) {
|
for (Double i : harmNum) {
|
||||||
List<Double> integerList = new ArrayList<>();
|
List<Double> integerList = new ArrayList<>();
|
||||||
if (i.equals(1.0)) {
|
if (i.equals(1.0)&&num != 1) {
|
||||||
integerList.add(multiply(fund, fund));
|
integerList.add(multiply(fund, fund));
|
||||||
integerListMap.put(1.0, integerList);
|
integerListMap.put(1.0, integerList);
|
||||||
} else {
|
} else {
|
||||||
double v = (num == 1 ? num : (i - num));
|
double v = (num == 1 ? i : (i - num));
|
||||||
if (type.equals("A")) {
|
if (type.equals("A")) {
|
||||||
integerList.add(multiply(harm.getList().getA().get((int) v), fund));
|
integerList.add(multiply(harm.getList().getA().get((int) v), fund));
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -54,15 +54,13 @@ public class PqScriptCheckDataServiceImpl extends ServiceImpl<PqScriptCheckDataM
|
|||||||
List<String> checkData = pqScriptCheckData.stream().map(x -> x.getDataType() + "$" + x.getValueType()).distinct().collect(Collectors.toList());
|
List<String> checkData = pqScriptCheckData.stream().map(x -> x.getDataType() + "$" + x.getValueType()).distinct().collect(Collectors.toList());
|
||||||
String U = REAL + DetectionCodeEnum.U1.getCode();
|
String U = REAL + DetectionCodeEnum.U1.getCode();
|
||||||
if(!checkData.contains(U)){
|
if(!checkData.contains(U)){
|
||||||
if(checkData.contains(REAL+DetectionCodeEnum.V2_50.getCode())||
|
if(checkData.contains(REAL+DetectionCodeEnum.V2_50.getCode())){
|
||||||
checkData.contains(REAL+DetectionCodeEnum.SV_1_49.getCode())){
|
|
||||||
checkData.add(U);
|
checkData.add(U);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
String I = REAL + DetectionCodeEnum.I1.getCode();
|
String I = REAL + DetectionCodeEnum.I1.getCode();
|
||||||
if(!checkData.contains(I)){
|
if(!checkData.contains(I)){
|
||||||
if(checkData.contains(REAL+DetectionCodeEnum.I2_50.getCode())||
|
if(checkData.contains(REAL+DetectionCodeEnum.I2_50.getCode())){
|
||||||
checkData.contains(REAL+DetectionCodeEnum.SI_1_49.getCode())){
|
|
||||||
checkData.add(I);
|
checkData.add(I);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -267,7 +267,7 @@ public class AdHarmonicServiceImpl extends ServiceImpl<AdHarmonicMappper, AdHarm
|
|||||||
if (value == value.longValue()) {
|
if (value == value.longValue()) {
|
||||||
return value;
|
return value;
|
||||||
} else {
|
} else {
|
||||||
return value + 1.5;
|
return value + 0.5;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user