|
@@ -55,6 +55,7 @@ public class FormulaServiceImpl extends BaseServiceImpl<FormulaMapper, Formula>
|
|
|
private Map<String,Object> constantMap;
|
|
|
private List<FormData> formDataList;
|
|
|
private Map<Long,Map<String,Object>> crossDataMap;
|
|
|
+ private Map<String,FormData> formDataMap;
|
|
|
|
|
|
|
|
|
|
|
@@ -266,6 +267,7 @@ public class FormulaServiceImpl extends BaseServiceImpl<FormulaMapper, Formula>
|
|
|
}
|
|
|
}
|
|
|
fd.getFormula().setFormula(tmp);
|
|
|
+ this.formDataMap.put(fd.getCode(),fd);
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -546,6 +548,22 @@ public class FormulaServiceImpl extends BaseServiceImpl<FormulaMapper, Formula>
|
|
|
/*更新依赖*/
|
|
|
relyParse(fd.getFormula());
|
|
|
}
|
|
|
+ }else if(f.contains(".proportion(")){
|
|
|
+ String tf=f.replace(CustomFunction.CLASS_CALL+"proportion","").replaceAll("[()]","");
|
|
|
+ String[] tfa=tf.split(",");
|
|
|
+ List<FormData> target = new ArrayList<>();
|
|
|
+ for(String code:tfa){
|
|
|
+ code=code.replace("E['","").replace("']","");
|
|
|
+ target.add(this.formDataMap.get(code));
|
|
|
+ }
|
|
|
+ if(Func.isNotEmpty(target)){
|
|
|
+ Object data= CustomFunction.proportion(target.stream().map(FormData::getValues).filter(Func::isNotEmpty).map(e->e.get(0)).collect(Collectors.toList()), "优良");
|
|
|
+ String key ="HA"+HashUtil.identityHashCode(data);
|
|
|
+ this.constantMap.put(key,data);
|
|
|
+ fd.getFormula().setFormula(key);
|
|
|
+ }else{
|
|
|
+ fd.getFormula().setFormula(StringPool.EMPTY);
|
|
|
+ }
|
|
|
}
|
|
|
System.out.println("聚合处理");
|
|
|
}
|
|
@@ -558,7 +576,6 @@ public class FormulaServiceImpl extends BaseServiceImpl<FormulaMapper, Formula>
|
|
|
|
|
|
|
|
|
|
|
|
-
|
|
|
}
|
|
|
|
|
|
|