yanyang #17

Merged
yanyang merged 2 commits from yanyang into master 2023-01-03 16:26:31 +08:00
Showing only changes of commit 8b4e6b116e - Show all commits

View File

@ -156,10 +156,20 @@ public class InspectionSheetServiceImpl extends CrudServiceImpl<InspectionSheetM
List<ProductFeaturesDTO> inspectionSheetFeaturesList = getInspectionSheetFeaturesList(params); List<ProductFeaturesDTO> inspectionSheetFeaturesList = getInspectionSheetFeaturesList(params);
if (inspectionSheetFeaturesList != null && inspectionSheetFeaturesList.size() != 0) { if (inspectionSheetFeaturesList != null && inspectionSheetFeaturesList.size() != 0) {
//分组样本数=样本大小=检验特性分组数的最大值 //分组样本数=样本大小=检验特性分组数的最大值
Integer numbersOfSamples = inspectionSheetFeaturesList.stream().max(Comparator.comparing(ProductFeaturesDTO::getSampleSize)).get().getSampleSize(); //Integer numbersOfSamples = inspectionSheetFeaturesList.stream().max(Comparator.comparing(ProductFeaturesDTO::getSampleSize)).get().getSampleSize();
if (numbersOfSamples != null) { //过滤计量型特性
dto.setNumberOfGroupedSamples(numbersOfSamples); List<ProductFeaturesDTO> featuresList = inspectionSheetFeaturesList.stream().filter(s->s.getType()==1).collect(Collectors.toList());
dto.setNumberOfSamples(numbersOfSamples); if(featuresList != null && featuresList.size() != 0) {
Integer numbersOfSamples = featuresList.stream().max(Comparator.comparing(ProductFeaturesDTO::getSampleSize)).get().getSampleSize();
if (numbersOfSamples != null) {
dto.setNumberOfGroupedSamples(numbersOfSamples);
dto.setNumberOfSamples(numbersOfSamples);
}
}
//若只有计数型特性样本大小默认为1
else{
dto.setNumberOfGroupedSamples(1);
dto.setNumberOfSamples(1);
} }
} }
/* /*