Преглед изворни кода

Merge pull request 'yanyang' (#17) from yanyang into master

Reviewed-on: #17
master
闫阳 пре 1 година
родитељ
комит
5e32971f26
1 измењених фајлова са 14 додато и 4 уклоњено
  1. +14
    -4
      ym-process-inspection/src/main/java/com/cnbm/processInspection/service/impl/InspectionSheetServiceImpl.java

+ 14
- 4
ym-process-inspection/src/main/java/com/cnbm/processInspection/service/impl/InspectionSheetServiceImpl.java Прегледај датотеку

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


Loading…
Откажи
Сачувај