解决间谐波检测脚本问题
This commit is contained in:
@@ -676,9 +676,9 @@ public class DetectionServiceImpl {
|
|||||||
DetectionData c;
|
DetectionData c;
|
||||||
if (DUR.equals(dur)) {
|
if (DUR.equals(dur)) {
|
||||||
c = rangeDURComparisonList(mag.get(typeC), magErrList, fData, channelTypeCList.get(0).getDipData().getRetainTime(), dataRule);
|
c = rangeDURComparisonList(mag.get(typeC), magErrList, fData, channelTypeCList.get(0).getDipData().getRetainTime(), dataRule);
|
||||||
}else {
|
} else {
|
||||||
List<Double> ampData = mag.get(typeC).stream()
|
List<Double> ampData = mag.get(typeC).stream()
|
||||||
.filter(x->ObjectUtil.isNotNull(x))
|
.filter(x -> ObjectUtil.isNotNull(x))
|
||||||
.map(x -> x * channelTypeCList.get(0).getFAmp() * 0.01)
|
.map(x -> x * channelTypeCList.get(0).getFAmp() * 0.01)
|
||||||
.collect(Collectors.toList());
|
.collect(Collectors.toList());
|
||||||
c = rangeComparisonList(ampData, magErrList, fData, channelTypeCList.get(0).getDipData().getFTransValue(), dataRule);
|
c = rangeComparisonList(ampData, magErrList, fData, channelTypeCList.get(0).getDipData().getFTransValue(), dataRule);
|
||||||
@@ -1003,6 +1003,7 @@ public class DetectionServiceImpl {
|
|||||||
});
|
});
|
||||||
return map;
|
return map;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 处理数据是否合格
|
* 处理数据是否合格
|
||||||
*
|
*
|
||||||
@@ -1219,14 +1220,15 @@ public class DetectionServiceImpl {
|
|||||||
if (i.equals(1.0)) {
|
if (i.equals(1.0)) {
|
||||||
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);
|
||||||
if (type.equals("A")) {
|
if (type.equals("A")) {
|
||||||
integerListMap.get(i).add(multiply(harm.getList().getA().get((int) (i - num)), fund));
|
integerListMap.get(i).add(multiply(harm.getList().getA().get((int) v), fund));
|
||||||
}
|
}
|
||||||
if (type.equals("B")) {
|
if (type.equals("B")) {
|
||||||
integerListMap.get(i).add(multiply(harm.getList().getB().get((int) (i - num)), fund));
|
integerListMap.get(i).add(multiply(harm.getList().getB().get((int) v), fund));
|
||||||
}
|
}
|
||||||
if (type.equals("C")) {
|
if (type.equals("C")) {
|
||||||
integerListMap.get(i).add(multiply(harm.getList().getC().get((int) (i - num)), fund));
|
integerListMap.get(i).add(multiply(harm.getList().getC().get((int) v), fund));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1239,14 +1241,15 @@ public class DetectionServiceImpl {
|
|||||||
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);
|
||||||
if (type.equals("A")) {
|
if (type.equals("A")) {
|
||||||
integerList.add(multiply(harm.getList().getA().get((int) (i - num)), fund));
|
integerList.add(multiply(harm.getList().getA().get((int) v), fund));
|
||||||
}
|
}
|
||||||
if (type.equals("B")) {
|
if (type.equals("B")) {
|
||||||
integerList.add(multiply(harm.getList().getB().get((int) (i - num)), fund));
|
integerList.add(multiply(harm.getList().getB().get((int) v), fund));
|
||||||
}
|
}
|
||||||
if (type.equals("C")) {
|
if (type.equals("C")) {
|
||||||
integerList.add(multiply(harm.getList().getC().get((int) (i - num)), fund));
|
integerList.add(multiply(harm.getList().getC().get((int) v), fund));
|
||||||
}
|
}
|
||||||
integerListMap.put(i, integerList);
|
integerListMap.put(i, integerList);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -99,18 +99,15 @@ public class AdHarmonicServiceImpl extends ServiceImpl<AdHarmonicMappper, AdHarm
|
|||||||
|
|
||||||
Field fieldA = harmonicResult.getClass().getDeclaredField("aValue" + isHarmOrInHarm(i).intValue());
|
Field fieldA = harmonicResult.getClass().getDeclaredField("aValue" + isHarmOrInHarm(i).intValue());
|
||||||
fieldA.setAccessible(true);
|
fieldA.setAccessible(true);
|
||||||
BigDecimal decimalA = new BigDecimal(fieldA.get(harmonicResult) + "");
|
dataVO.setDataA(ObjectUtil.isNotNull(fieldA.get(harmonicResult)) ? new BigDecimal(fieldA.get(harmonicResult) + "").toPlainString() : null);
|
||||||
dataVO.setDataA(decimalA.toPlainString());
|
|
||||||
|
|
||||||
Field fieldB = harmonicResult.getClass().getDeclaredField("bValue" + isHarmOrInHarm(i).intValue());
|
Field fieldB = harmonicResult.getClass().getDeclaredField("bValue" + isHarmOrInHarm(i).intValue());
|
||||||
fieldB.setAccessible(true);
|
fieldB.setAccessible(true);
|
||||||
BigDecimal decimalB = new BigDecimal(fieldB.get(harmonicResult) + "");
|
dataVO.setDataB(ObjectUtil.isNotNull(fieldB.get(harmonicResult)) ? new BigDecimal(fieldB.get(harmonicResult) + "").toPlainString() : null);
|
||||||
dataVO.setDataB(decimalB.toPlainString());
|
|
||||||
|
|
||||||
Field fieldC = harmonicResult.getClass().getDeclaredField("cValue" + isHarmOrInHarm(i).intValue());
|
Field fieldC = harmonicResult.getClass().getDeclaredField("cValue" + isHarmOrInHarm(i).intValue());
|
||||||
fieldC.setAccessible(true);
|
fieldC.setAccessible(true);
|
||||||
BigDecimal decimalC = new BigDecimal(fieldC.get(harmonicResult) + "");
|
dataVO.setDataC(ObjectUtil.isNotNull(fieldC.get(harmonicResult)) ? new BigDecimal(fieldC.get(harmonicResult) + "").toPlainString() : null);
|
||||||
dataVO.setDataC(decimalC.toPlainString());
|
|
||||||
} catch (NoSuchFieldException e) {
|
} catch (NoSuchFieldException e) {
|
||||||
throw new RuntimeException(e);
|
throw new RuntimeException(e);
|
||||||
} catch (IllegalAccessException e) {
|
} catch (IllegalAccessException e) {
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ public class TableGenServiceImpl implements TableGenService {
|
|||||||
StringBuilder A = new StringBuilder();
|
StringBuilder A = new StringBuilder();
|
||||||
StringBuilder B = new StringBuilder();
|
StringBuilder B = new StringBuilder();
|
||||||
StringBuilder C = new StringBuilder();
|
StringBuilder C = new StringBuilder();
|
||||||
for (int i = 1; i <= 50; i++) {
|
for (int i = 1; i <= 51; i++) {
|
||||||
if (i == 1) {
|
if (i == 1) {
|
||||||
A.append("A_Value_").append(i).append(" json NULL COMMENT 'A相基波',");
|
A.append("A_Value_").append(i).append(" json NULL COMMENT 'A相基波',");
|
||||||
B.append("B_Value_").append(i).append(" json NULL COMMENT 'B相基波',");
|
B.append("B_Value_").append(i).append(" json NULL COMMENT 'B相基波',");
|
||||||
@@ -74,7 +74,7 @@ public class TableGenServiceImpl implements TableGenService {
|
|||||||
.append(",ad_non_harmonic_result_").append(code).append(",");
|
.append(",ad_non_harmonic_result_").append(code).append(",");
|
||||||
}
|
}
|
||||||
sb.deleteCharAt(sb.length() - 1);
|
sb.deleteCharAt(sb.length() - 1);
|
||||||
tableGenMapper.genAdHarmonicTable("DROP TABLE IF EXISTS " + sb.toString());
|
tableGenMapper.genAdHarmonicTable("DROP TABLE IF EXISTS " + sb);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user