|
@@ -6,6 +6,8 @@ import com.diagbot.dto.NodeNeoDTO;
|
|
|
import com.diagbot.dto.WordCrfDTO;
|
|
|
import com.diagbot.util.CoreUtil;
|
|
|
|
|
|
+import java.math.BigDecimal;
|
|
|
+
|
|
|
/**
|
|
|
* @description: 年龄规则
|
|
|
* @author: zhoutg
|
|
@@ -25,15 +27,23 @@ public class AgeRule {
|
|
|
Boolean flag = false;
|
|
|
if (ageNeoDTO != null && wordCrfDTO.getAge() != null) {
|
|
|
Integer age = wordCrfDTO.getAge();
|
|
|
- Integer minAge = ageNeoDTO.getMin().intValue();
|
|
|
- if (minAge != null) {
|
|
|
- if (age < minAge) {
|
|
|
+ BigDecimal min = ageNeoDTO.getMin();
|
|
|
+ BigDecimal max = ageNeoDTO.getMax();
|
|
|
+
|
|
|
+ if (min != null && max != null) {
|
|
|
+ int minAge = min.intValue();
|
|
|
+ int maxAge = max.intValue();
|
|
|
+ if (minAge <= age && age <= maxAge) {
|
|
|
flag = true;
|
|
|
}
|
|
|
- }
|
|
|
- Integer maxAge = ageNeoDTO.getMax().intValue();
|
|
|
- if (maxAge != null) {
|
|
|
- if (age > minAge) {
|
|
|
+ } else if (min != null && max == null) {
|
|
|
+ int minAge = min.intValue();
|
|
|
+ if (minAge <= age) {
|
|
|
+ flag = true;
|
|
|
+ }
|
|
|
+ } else if (min == null && max != null) {
|
|
|
+ int maxAge = max.intValue();
|
|
|
+ if (age <= maxAge) {
|
|
|
flag = true;
|
|
|
}
|
|
|
}
|