|
@@ -100,6 +100,7 @@ public class FormulaServiceImpl extends BaseServiceImpl<FormulaMapper, Formula>
|
|
|
@Override
|
|
|
public IFormulaService init() {
|
|
|
this.formDataMap=new HashMap<>();
|
|
|
+ this.crossDataMap=new HashMap<>();
|
|
|
List<FormData> list =this.tec.getFds();
|
|
|
Long contractId=this.tec.getContractId();
|
|
|
CurrentNode one=this.tec.getCurrentNode();
|
|
@@ -136,7 +137,13 @@ public class FormulaServiceImpl extends BaseServiceImpl<FormulaMapper, Formula>
|
|
|
/*暂时先只取第一个满足条件的*/
|
|
|
if(Func.isNotEmpty(targets)){
|
|
|
WbsTreeContract cross = targets.get(0);
|
|
|
- Map<String,Object> dataMap= this.crossDataMap.computeIfAbsent(cross.getPKeyId(),(k)->this.jdbcTemplate.queryForMap("select * from " + arr[1] + " where p_key_id=" + k));
|
|
|
+ Map<String,Object> dataMap= this.crossDataMap.computeIfAbsent(cross.getPKeyId(),(k)->{List<Map<String,Object>> dmap=this.jdbcTemplate.queryForList("select * from " + arr[1] + " where p_key_id=" + k);
|
|
|
+ if(Func.isNotEmpty(dmap)){
|
|
|
+ return dmap.get(0);
|
|
|
+ }else{
|
|
|
+ return new HashMap<>();
|
|
|
+ }
|
|
|
+ });
|
|
|
if(dataMap.size()>0){
|
|
|
String v= StringUtils.handleNull(dataMap.get(arr[2]));
|
|
|
if(StringUtils.isNotEmpty(v)){
|
|
@@ -584,6 +591,7 @@ public class FormulaServiceImpl extends BaseServiceImpl<FormulaMapper, Formula>
|
|
|
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);
|
|
|
+ fd.getFormula().setFormula(key);
|
|
|
this.constantMap.put(key,data);
|
|
|
}else{
|
|
|
fd.getFormula().setFormula(StringPool.EMPTY);
|