|
@@ -262,9 +262,7 @@ public class FormulaServiceImpl extends BaseServiceImpl<FormulaMapper, Formula>
|
|
/*获取type=1的检验单或者type=4的监表*/
|
|
/*获取type=1的检验单或者type=4的监表*/
|
|
List<WbsTreeContract> tableList= (List<WbsTreeContract>) this.constantMap.get(TABLE_LIST);
|
|
List<WbsTreeContract> tableList= (List<WbsTreeContract>) this.constantMap.get(TABLE_LIST);
|
|
Optional<WbsTreeContract> wop=tableList.stream().filter(e->e.getTableType()==1||e.getTableType()==4).findAny();
|
|
Optional<WbsTreeContract> wop=tableList.stream().filter(e->e.getTableType()==1||e.getTableType()==4).findAny();
|
|
- if(wop.isPresent()){
|
|
|
|
- this.jdbcTemplate.queryForList("select c.e_name name ,c.init_table_name tableName,c.e_key ekey from m_wbs_tree_contract a INNER JOIN m_wbs_tree b on (a.id=b.id or a.old_id=b.id) INNER join m_wbs_form_element c on b.init_table_id=c.f_id where a.id={} \n");
|
|
|
|
- }
|
|
|
|
|
|
+ wop.ifPresent(wbsTreeContract -> this.jdbcTemplate.queryForList("select c.e_name name ,c.init_table_name tableName,c.e_key ekey from m_wbs_tree_contract a INNER JOIN m_wbs_tree b on (a.id=b.id or a.old_id=b.id) INNER join m_wbs_form_element c on b.init_table_id=c.f_id where a.id=" + wbsTreeContract.getPKeyId()));
|
|
}
|
|
}
|
|
fd.getFormula().setFormula(tmp);
|
|
fd.getFormula().setFormula(tmp);
|
|
this.formDataMap.put(fd.getCode(),fd);
|
|
this.formDataMap.put(fd.getCode(),fd);
|
|
@@ -545,44 +543,36 @@ public class FormulaServiceImpl extends BaseServiceImpl<FormulaMapper, Formula>
|
|
this.constantMap.put(key,data);
|
|
this.constantMap.put(key,data);
|
|
f = f.replace(CustomFunction.CLASS_CALL + m.group(), key);
|
|
f = f.replace(CustomFunction.CLASS_CALL + m.group(), key);
|
|
fd.getFormula().setFormula(f);
|
|
fd.getFormula().setFormula(f);
|
|
- /*更新依赖*/
|
|
|
|
- relyParse(fd.getFormula());
|
|
|
|
}
|
|
}
|
|
- }else if(f.contains(".proportion(")){
|
|
|
|
- String tf=f.replace(CustomFunction.CLASS_CALL+"proportion","").replaceAll("[()]","");
|
|
|
|
- String[] tfa=tf.split(",");
|
|
|
|
|
|
+ }else if(f.contains(CustomFunction.CLASS_CALL+"proportion(")||f.contains(CustomFunction.CLASS_CALL+"ladder(")||f.contains(CustomFunction.CLASS_CALL+"major(")||f.contains(CustomFunction.CLASS_CALL+"reasonable(")
|
|
|
|
+ ||f.contains(CustomFunction.CLASS_CALL+"goodSize(")){
|
|
|
|
+ String tf=f.replaceAll("^T\\(com.mixsmart.utils.CustomFunction\\)\\.\\w+\\(","").replaceAll("[)]$","");
|
|
List<FormData> target = new ArrayList<>();
|
|
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);
|
|
|
|
- }
|
|
|
|
- relyParse(fd.getFormula());
|
|
|
|
- }else if(f.contains(".ladder(")){
|
|
|
|
- String tf=f.replace(CustomFunction.CLASS_CALL+"ladder","").replaceAll("[()]","");
|
|
|
|
String[] tfa=tf.split(",");
|
|
String[] tfa=tf.split(",");
|
|
- List<FormData> target = new ArrayList<>();
|
|
|
|
for(String code:tfa){
|
|
for(String code:tfa){
|
|
code=code.replace("E['","").replace("']","");
|
|
code=code.replace("E['","").replace("']","");
|
|
target.add(this.formDataMap.get(code));
|
|
target.add(this.formDataMap.get(code));
|
|
}
|
|
}
|
|
if(Func.isNotEmpty(target)){
|
|
if(Func.isNotEmpty(target)){
|
|
- Object data= CustomFunction.ladder(target.stream().map(FormData::getValues).filter(Func::isNotEmpty).map(e->e.get(0)).collect(Collectors.toList()));
|
|
|
|
|
|
+ Object data=null;
|
|
|
|
+ if(f.contains("proportion")){
|
|
|
|
+ data= CustomFunction.proportion(target.stream().map(FormData::getValues).filter(Func::isNotEmpty).map(e->e.get(0)).collect(Collectors.toList()), "优良");
|
|
|
|
+ }else if(f.contains("ladder")){
|
|
|
|
+ data= CustomFunction.ladder(target.stream().map(FormData::getValues).filter(Func::isNotEmpty).map(e->e.get(0)).collect(Collectors.toList()));
|
|
|
|
+ }else if(f.contains("major")){
|
|
|
|
+ data= CustomFunction.major(target.stream().map(FormData::getValues).filter(Func::isNotEmpty).map(e->e.get(0)).collect(Collectors.toList()));
|
|
|
|
+ }else if(f.contains("reasonable")){
|
|
|
|
+ data= CustomFunction.reasonable(target.stream().map(FormData::getValues).filter(Func::isNotEmpty).map(e->e.get(0)).collect(Collectors.toList()));
|
|
|
|
+ }else if(f.contains("goodSize")){
|
|
|
|
+ data= CustomFunction.goodSize(target.stream().map(FormData::getValues).filter(Func::isNotEmpty).map(e->e.get(0)).collect(Collectors.toList()),"优良");
|
|
|
|
+ }
|
|
String key ="HA"+HashUtil.identityHashCode(data);
|
|
String key ="HA"+HashUtil.identityHashCode(data);
|
|
this.constantMap.put(key,data);
|
|
this.constantMap.put(key,data);
|
|
- fd.getFormula().setFormula(key);
|
|
|
|
}else{
|
|
}else{
|
|
fd.getFormula().setFormula(StringPool.EMPTY);
|
|
fd.getFormula().setFormula(StringPool.EMPTY);
|
|
}
|
|
}
|
|
- relyParse(fd.getFormula());
|
|
|
|
}
|
|
}
|
|
|
|
+ relyParse(fd.getFormula());
|
|
System.out.println("聚合处理");
|
|
System.out.println("聚合处理");
|
|
}
|
|
}
|
|
}catch (Exception e){
|
|
}catch (Exception e){
|
|
@@ -592,8 +582,6 @@ public class FormulaServiceImpl extends BaseServiceImpl<FormulaMapper, Formula>
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
-
|
|
|
|
-
|
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|