Compare commits

..

No commits in common. "5e32971f262dce5ab333a0d14b6f42d4d2aeb583" and "04e8cc187a61a8194958b4baf653da5fcbbfbdd7" have entirely different histories.

View File

@ -156,22 +156,12 @@ 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();
//过滤计量型特性
List<ProductFeaturesDTO> featuresList = inspectionSheetFeaturesList.stream().filter(s->s.getType()==1).collect(Collectors.toList());
if(featuresList != null && featuresList.size() != 0) {
Integer numbersOfSamples = featuresList.stream().max(Comparator.comparing(ProductFeaturesDTO::getSampleSize)).get().getSampleSize();
if (numbersOfSamples != null) { if (numbersOfSamples != null) {
dto.setNumberOfGroupedSamples(numbersOfSamples); dto.setNumberOfGroupedSamples(numbersOfSamples);
dto.setNumberOfSamples(numbersOfSamples); dto.setNumberOfSamples(numbersOfSamples);
} }
} }
//若只有计数型特性样本大小默认为1
else{
dto.setNumberOfGroupedSamples(1);
dto.setNumberOfSamples(1);
}
}
/* /*
if (inspectionSheetFeaturesList == null || inspectionSheetFeaturesList.size() == 0) { if (inspectionSheetFeaturesList == null || inspectionSheetFeaturesList.size() == 0) {
throw new RuntimeException("没有发现检验参数"); throw new RuntimeException("没有发现检验参数");