This commit is contained in:
wr
2025-03-11 09:00:02 +08:00
parent d1101cd157
commit 91e2e9e7fe

View File

@@ -850,25 +850,27 @@ public class DetectionServiceImpl {
errSysDtlMap.put(key, null); errSysDtlMap.put(key, null);
} }
}); });
devMap.forEach((harm, harmDataList) -> { if (CollUtil.isNotEmpty(devMap)) {
PqErrSysDtls errSysDtl = errSysDtlMap.get(harm); devMap.forEach((harm, harmDataList) -> {
DetectionData data = new DetectionData(); PqErrSysDtls errSysDtl = errSysDtlMap.get(harm);
data.setIsData(4); DetectionData data = new DetectionData();
data.setNum(harm); data.setIsData(4);
data.setData(harmDataList.get(0)); data.setNum(harm);
Double v = issueHarmMap.get(harm); data.setData(harmDataList.get(0));
data.setResultData(v); Double v = issueHarmMap.get(harm);
if (ObjectUtil.isNotNull(errSysDtl)) { data.setResultData(v);
PqErrSysDtls errSys = BeanUtil.copyProperties(errSysDtl, PqErrSysDtls.class); if (ObjectUtil.isNotNull(errSysDtl)) {
errSys.setMaxErrorValue(maxErrorMultiply(errSys.getMaxErrorValue(), fData, issueHarmMap.get(harm), errSys.getErrorValueType())); PqErrSysDtls errSys = BeanUtil.copyProperties(errSysDtl, PqErrSysDtls.class);
NumberFormat nf = NumberFormat.getInstance(); errSys.setMaxErrorValue(maxErrorMultiply(errSys.getMaxErrorValue(), fData, issueHarmMap.get(harm), errSys.getErrorValueType()));
nf.setMaximumFractionDigits(6); NumberFormat nf = NumberFormat.getInstance();
nf.setGroupingUsed(false); nf.setMaximumFractionDigits(6);
data.setRadius(nf.format(-errSys.getMaxErrorValue()) + "~" + nf.format(errSys.getMaxErrorValue())); nf.setGroupingUsed(false);
setDetection(dataRule, harmDataList, errSys, data, v); data.setRadius(nf.format(-errSys.getMaxErrorValue()) + "~" + nf.format(errSys.getMaxErrorValue()));
} setDetection(dataRule, harmDataList, errSys, data, v);
info.add(data); }
}); info.add(data);
});
}
return info; return info;
} }
@@ -950,7 +952,7 @@ public class DetectionServiceImpl {
for (DevData devData : dev) { for (DevData devData : dev) {
List<DevData.SqlDataDTO> sqlDataDTOList = devData.getSqlData(); List<DevData.SqlDataDTO> sqlDataDTOList = devData.getSqlData();
Optional<DevData.SqlDataDTO> first = Optional.empty(); Optional<DevData.SqlDataDTO> first = Optional.empty();
if(CollUtil.isNotEmpty(sqlDataDTOList)){ if (CollUtil.isNotEmpty(sqlDataDTOList)) {
first = sqlDataDTOList.stream().filter(x -> x.getDesc().equals(fundCode)).collect(Collectors.toList()).stream().findFirst(); first = sqlDataDTOList.stream().filter(x -> x.getDesc().equals(fundCode)).collect(Collectors.toList()).stream().findFirst();
} }
DevData.SqlDataDTO fund = null; DevData.SqlDataDTO fund = null;
@@ -1221,18 +1223,25 @@ 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)&&num != 1) { 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 ? i : (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)); if ((int) v < harm.getList().getA().size()) {
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) v), fund)); if ((int) v < harm.getList().getB().size()) {
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) v), fund)); if ((int) v < harm.getList().getC().size()) {
integerListMap.get(i).add(multiply(harm.getList().getC().get((int) v), fund));
}
} }
} }
} }
@@ -1241,19 +1250,25 @@ 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)&&num != 1) { 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 ? i : (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)); if ((int) v < harm.getList().getA().size()) {
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) v), fund)); if ((int) v < harm.getList().getB().size()) {
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) v), fund)); if ((int) v < harm.getList().getC().size()) {
integerList.add(multiply(harm.getList().getC().get((int) v), fund));
}
} }
integerListMap.put(i, integerList); integerListMap.put(i, integerList);
} }