wks 3 سال پیش
والد
کامیت
eca5422113
1فایلهای تغییر یافته به همراه13 افزوده شده و 0 حذف شده
  1. 13 0
      src/main/java/com/ydtech/modules/protocol/entity/dto/PtlFactorDto.java

+ 13 - 0
src/main/java/com/ydtech/modules/protocol/entity/dto/PtlFactorDto.java

@@ -5,6 +5,7 @@ import io.swagger.annotations.ApiModelProperty;
 import lombok.Data;
 
 import java.util.List;
+import java.util.stream.Collectors;
 
 @Data
 @ApiModel("因子实体")
@@ -25,5 +26,17 @@ public class PtlFactorDto {
     @ApiModelProperty("最小值")
     private Integer minValue;
 
+    public List<String> getParameter() {
+        return parameter.stream().filter(x -> !x.isEmpty()).collect(Collectors.toList());
+    }
+
+    public Integer getMaxValue() {
+        return maxValue == null || maxValue < 0 ? 0 : minValue;
+    }
+
+    public Integer getMinValue() {
+        return minValue == null || minValue < 0 ? 0 : minValue;
+    }
+
 }