Ver código fonte

加入性别过滤

kongwz 6 anos atrás
pai
commit
344feafb82

+ 5 - 2
graph-web/src/main/java/org/diagbot/graphWeb/work/GraphCalculate.java

@@ -78,7 +78,10 @@ public class GraphCalculate {
                 Map<String, String> sexAgeMap = sexAgeCache.get(dis);
                 if(sexAgeMap != null){
                     String sexType = sexAgeMap.get("sexType");
-//                    if(("1".equals(sexType) &&sex.equals(sexType)) || ("2".equals(sexType) &&sex.equals(sexType)) || "3".equals(sexType)){
+                    Integer min_age = Integer.parseInt(sexAgeMap.get("min_age"));
+                    Integer max_age = Integer.parseInt(sexAgeMap.get("max_age"));
+
+                    if(("1".equals(sexType) &&sex.equals(sexType)) || ("2".equals(sexType) &&sex.equals(sexType)) || "3".equals(sexType)){
                         FeatureRate featureRate = new FeatureRate();
                         featureRate.setFeatureName(dis);
                         featureRate.setExtraProperty("");
@@ -87,7 +90,7 @@ public class GraphCalculate {
                         featureRate.setDesc(s);
                         featureRate.setRate("neo4j");
                         featureRates.add(featureRate);
-//                    }
+                    }
                 }
             }
         }