生成报告监测点结果下拉框展示
This commit is contained in:
@@ -50,7 +50,8 @@ public class ContrastNonHarmonicServiceImpl extends ServiceImpl<ContrastNonHarmo
|
||||
.isNull(ObjectUtil.isNull(waveNum), ContrastNonHarmonicResult::getWaveNum)
|
||||
.in(CollUtil.isNotEmpty(adTypeList), ContrastNonHarmonicResult::getAdType, adTypeList);
|
||||
if (isWave) {
|
||||
wrapper.eq(ObjectUtil.isNotNull(waveNum), ContrastNonHarmonicResult::getWaveNum, waveNum);
|
||||
wrapper.isNotNull(ContrastNonHarmonicResult::getWaveNum)
|
||||
.eq(ObjectUtil.isNotNull(waveNum), ContrastNonHarmonicResult::getWaveNum, waveNum);
|
||||
} else {
|
||||
wrapper.isNull(ContrastNonHarmonicResult::getWaveNum);
|
||||
}
|
||||
|
||||
@@ -186,7 +186,7 @@ public class SimAndDigHarmonicServiceImpl extends ServiceImpl<SimAndDigHarmonicM
|
||||
if (ObjectUtil.isNotNull(a)) {
|
||||
dataVO.setRadius(a.getRadius());
|
||||
}
|
||||
dataVO.setIsData(setResultFlag(Arrays.asList(a, b, c)));
|
||||
dataVO.setIsData(StorageUtil.setResultFlag(Arrays.asList(a, b, c)));
|
||||
} catch (NoSuchFieldException e) {
|
||||
throw new RuntimeException(e);
|
||||
} catch (IllegalAccessException e) {
|
||||
@@ -276,36 +276,4 @@ public class SimAndDigHarmonicServiceImpl extends ServiceImpl<SimAndDigHarmonicM
|
||||
DynamicTableNameHandler.remove();
|
||||
return results;
|
||||
}
|
||||
|
||||
public static Integer setResultFlag(List<RawResultDataVO.DetectionData> numbers) {
|
||||
List<Integer> isData = numbers.stream().filter(Objects::nonNull)
|
||||
.filter(x -> ObjectUtil.isNotNull(x.getData()))
|
||||
.map(RawResultDataVO.DetectionData::getIsData)
|
||||
.distinct()
|
||||
.collect(Collectors.toList());
|
||||
return getInteger(isData);
|
||||
}
|
||||
|
||||
public static Integer getInteger(List<Integer> isData) {
|
||||
if (CollUtil.isNotEmpty(isData)) {
|
||||
List<Integer> isQualified = isData.stream().filter(x -> 1 == x || 2 == x).collect(Collectors.toList());
|
||||
if (CollUtil.isNotEmpty(isQualified)) {
|
||||
if (isQualified.size() > 1) {
|
||||
if (isQualified.contains(2)) {
|
||||
return 2;
|
||||
}
|
||||
}
|
||||
return isQualified.get(0);
|
||||
} else {
|
||||
if (isData.contains(4)) {
|
||||
return 4;
|
||||
}
|
||||
if (isData.contains(5)) {
|
||||
return 5;
|
||||
}
|
||||
}
|
||||
}
|
||||
return 4;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,5 +1,13 @@
|
||||
package com.njcn.gather.util;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.njcn.gather.storage.pojo.vo.RawResultDataVO;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* @author caozehui
|
||||
* @data 2025-08-21
|
||||
@@ -113,4 +121,35 @@ public class StorageUtil {
|
||||
}
|
||||
return unit;
|
||||
}
|
||||
|
||||
public static Integer setResultFlag(List<RawResultDataVO.DetectionData> numbers) {
|
||||
List<Integer> isData = numbers.stream().filter(Objects::nonNull)
|
||||
.filter(x -> ObjectUtil.isNotNull(x.getData()))
|
||||
.map(RawResultDataVO.DetectionData::getIsData)
|
||||
.distinct()
|
||||
.collect(Collectors.toList());
|
||||
return getInteger(isData);
|
||||
}
|
||||
|
||||
public static Integer getInteger(List<Integer> isData) {
|
||||
if (CollUtil.isNotEmpty(isData)) {
|
||||
List<Integer> isQualified = isData.stream().filter(x -> 1 == x || 2 == x).collect(Collectors.toList());
|
||||
if (CollUtil.isNotEmpty(isQualified)) {
|
||||
if (isQualified.size() > 1) {
|
||||
if (isQualified.contains(2)) {
|
||||
return 2;
|
||||
}
|
||||
}
|
||||
return isQualified.get(0);
|
||||
} else {
|
||||
if (isData.contains(4)) {
|
||||
return 4;
|
||||
}
|
||||
if (isData.contains(5)) {
|
||||
return 5;
|
||||
}
|
||||
}
|
||||
}
|
||||
return 4;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user