diff --git a/detection/src/main/java/com/njcn/gather/detection/handler/SocketDevResponseService.java b/detection/src/main/java/com/njcn/gather/detection/handler/SocketDevResponseService.java index 55239bc7..83da2f29 100644 --- a/detection/src/main/java/com/njcn/gather/detection/handler/SocketDevResponseService.java +++ b/detection/src/main/java/com/njcn/gather/detection/handler/SocketDevResponseService.java @@ -999,7 +999,7 @@ public class SocketDevResponseService { successComm.add(devData.getId()); if (SocketManager.clockMap.containsKey(sourceIssue.getIndex())) { - SocketManager.clockMap.put(sourceIssue.getIndex(), 0L); + SocketManager.clockMap.put(sourceIssue.getIndex(), 0L); } if (successComm.size() == FormalTestManager.monitorIdListComm.size()) { @@ -1579,7 +1579,7 @@ public class SocketDevResponseService { adHarmonicResult.setAdType(checkDataMap.get(sqlDataDTO.getDesc())); 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())) { DevData.SqlDataDTO.ListDTO vvv = data.getSqlData().get(0).getList(); Double aV = vvv.getA(); @@ -1604,20 +1604,39 @@ public class SocketDevResponseService { List c = tem.getC(); Class example = (Class) adHarmonicResult.getClass(); - for (int i = 2; i <= 50; i++) { - try { - Field aField = example.getDeclaredField("aValue" + i); - Field bField = example.getDeclaredField("bValue" + i); - Field cField = example.getDeclaredField("cValue" + i); + if(DicDataEnum.HSV.getCode().equals(sourceIssue.getType()) || DicDataEnum.HSI.getCode().equals(sourceIssue.getType())){ + for (int i = 1; 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(); + aField.setAccessible(true); + aField.set(adHarmonicResult, a.get(i - 1)); + bField.setAccessible(true); + bField.set(adHarmonicResult, b.get(i - 1)); + cField.setAccessible(true); + cField.set(adHarmonicResult, c.get(i - 1)); + } catch (NoSuchFieldException | IllegalAccessException e) { + 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); diff --git a/detection/src/main/java/com/njcn/gather/detection/service/impl/DetectionServiceImpl.java b/detection/src/main/java/com/njcn/gather/detection/service/impl/DetectionServiceImpl.java index 9ab855b6..faa97961 100644 --- a/detection/src/main/java/com/njcn/gather/detection/service/impl/DetectionServiceImpl.java +++ b/detection/src/main/java/com/njcn/gather/detection/service/impl/DetectionServiceImpl.java @@ -772,7 +772,7 @@ public class DetectionServiceImpl { dataMap.forEach((key, value) -> { try { // 设置 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); if (ObjectUtil.isNull(value.getIsData())) { idField.set(harmonicResult, value.getData()); @@ -937,12 +937,12 @@ public class DetectionServiceImpl { Integer num) { Map>> map = new HashMap<>(3); List harmNum = new ArrayList<>(); - harmNum.add(1.0); if (1 == num) { harmNum.addAll(sourceIssue.getChannelList().stream() .flatMap(x -> x.getInharmList().stream().map(f -> f.getInharm())) .sorted().distinct().collect(Collectors.toList())); } else { + harmNum.add(1.0); harmNum.addAll(sourceIssue.getChannelList().stream() .flatMap(x -> x.getHarmList().stream().map(f -> f.getHarm())) .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_C, map, harmNum, harm, String.valueOf(fund.getList().getC()), num); } else { - harmPut(TYPE_A, map, harmNum, harm, "0.0", num); - harmPut(TYPE_B, map, harmNum, harm, "0.0", num); - harmPut(TYPE_C, map, harmNum, harm, "0.0", num); + harmPut(TYPE_A, map, harmNum, harm, "1.0", num); + harmPut(TYPE_B, map, harmNum, harm, "1.0", num); + harmPut(TYPE_C, map, harmNum, harm, "1.0", num); } } @@ -1221,10 +1221,10 @@ public class DetectionServiceImpl { Map> integerListMap = map.get(type); for (Double i : harmNum) { if (integerListMap.containsKey(i)) { - if (i.equals(1.0)) { + if (i.equals(1.0)&&num != 1) { integerListMap.get(1.0).add(multiply(fund, fund)); } else { - double v = (num == 1 ? num : (i - num)); + double v = (num == 1 ? i : (i - num)); if (type.equals("A")) { integerListMap.get(i).add(multiply(harm.getList().getA().get((int) v), fund)); } @@ -1241,11 +1241,11 @@ public class DetectionServiceImpl { Map> integerListMap = new LinkedHashMap<>(5); for (Double i : harmNum) { List integerList = new ArrayList<>(); - if (i.equals(1.0)) { + if (i.equals(1.0)&&num != 1) { integerList.add(multiply(fund, fund)); integerListMap.put(1.0, integerList); } else { - double v = (num == 1 ? num : (i - num)); + double v = (num == 1 ? i : (i - num)); if (type.equals("A")) { integerList.add(multiply(harm.getList().getA().get((int) v), fund)); } diff --git a/detection/src/main/java/com/njcn/gather/script/service/impl/PqScriptCheckDataServiceImpl.java b/detection/src/main/java/com/njcn/gather/script/service/impl/PqScriptCheckDataServiceImpl.java index c8118eb6..0d5b459f 100644 --- a/detection/src/main/java/com/njcn/gather/script/service/impl/PqScriptCheckDataServiceImpl.java +++ b/detection/src/main/java/com/njcn/gather/script/service/impl/PqScriptCheckDataServiceImpl.java @@ -54,15 +54,13 @@ public class PqScriptCheckDataServiceImpl extends ServiceImpl checkData = pqScriptCheckData.stream().map(x -> x.getDataType() + "$" + x.getValueType()).distinct().collect(Collectors.toList()); String U = REAL + DetectionCodeEnum.U1.getCode(); if(!checkData.contains(U)){ - if(checkData.contains(REAL+DetectionCodeEnum.V2_50.getCode())|| - checkData.contains(REAL+DetectionCodeEnum.SV_1_49.getCode())){ + if(checkData.contains(REAL+DetectionCodeEnum.V2_50.getCode())){ checkData.add(U); } } String I = REAL + DetectionCodeEnum.I1.getCode(); if(!checkData.contains(I)){ - if(checkData.contains(REAL+DetectionCodeEnum.I2_50.getCode())|| - checkData.contains(REAL+DetectionCodeEnum.SI_1_49.getCode())){ + if(checkData.contains(REAL+DetectionCodeEnum.I2_50.getCode())){ checkData.add(I); } } diff --git a/storage/src/main/java/com/njcn/gather/storage/service/impl/AdHarmonicServiceImpl.java b/storage/src/main/java/com/njcn/gather/storage/service/impl/AdHarmonicServiceImpl.java index 2ea993ab..676be6f1 100644 --- a/storage/src/main/java/com/njcn/gather/storage/service/impl/AdHarmonicServiceImpl.java +++ b/storage/src/main/java/com/njcn/gather/storage/service/impl/AdHarmonicServiceImpl.java @@ -267,7 +267,7 @@ public class AdHarmonicServiceImpl extends ServiceImpl