|
@@ -228,7 +228,7 @@ public class FormulaServiceImpl extends BaseServiceImpl<FormulaMapper, Formula>
|
|
this.constantMap.put(TEXT_INFO_MAP,tmap);
|
|
this.constantMap.put(TEXT_INFO_MAP,tmap);
|
|
}
|
|
}
|
|
/*公式参数*/
|
|
/*公式参数*/
|
|
- FormulaOption formulaOption = this.formulaOptionService.getOne(Wrappers.<FormulaOption>lambdaQuery().eq(FormulaOption::getParentId,one.getId()).eq(FormulaOption::getContractId,contractId));
|
|
|
|
|
|
+ FormulaOption formulaOption = this.formulaOptionService.getOne(Wrappers.<FormulaOption>lambdaQuery().eq(FormulaOption::getParentId,one.getRelateId()).eq(FormulaOption::getContractId,contractId));
|
|
if(formulaOption!=null){
|
|
if(formulaOption!=null){
|
|
/*数据格式 {tablename:{keyxxx:{option:[1|0]}}}*/
|
|
/*数据格式 {tablename:{keyxxx:{option:[1|0]}}}*/
|
|
this.constantMap.put(FMOT,JSON.parseObject(formulaOption.getVal(),LinkedHashMap.class));
|
|
this.constantMap.put(FMOT,JSON.parseObject(formulaOption.getVal(),LinkedHashMap.class));
|
|
@@ -243,24 +243,26 @@ public class FormulaServiceImpl extends BaseServiceImpl<FormulaMapper, Formula>
|
|
Map<String, Object> elementInfoMap=this.getElementInfoByCodes(String.join(",",missingList));
|
|
Map<String, Object> elementInfoMap=this.getElementInfoByCodes(String.join(",",missingList));
|
|
/*1从当前节点其它表格中查找匹配的元素*/
|
|
/*1从当前节点其它表格中查找匹配的元素*/
|
|
List<String> removeList=new ArrayList<>();
|
|
List<String> removeList=new ArrayList<>();
|
|
- for(String r:missingList){
|
|
|
|
- String tn = r.substring(0,r.indexOf(StringPool.COLON));
|
|
|
|
- String key =r.substring(r.indexOf(StringPool.COLON)+1);
|
|
|
|
- List<AppWbsTreeContractVO> nodeList = this.tec.getTableAll().stream().filter(e->e.getInitTableName().equals(tn)).collect(Collectors.toList());
|
|
|
|
- if(Func.isNotEmpty(nodeList)){
|
|
|
|
- removeList.add(r);
|
|
|
|
- Map<String,Object> elementInfo= (Map<String, Object>) elementInfoMap.get(r);
|
|
|
|
- String tableName = nodeList.get(0).getInitTableName();
|
|
|
|
- if(!this.tec.getCoordinateMap().containsKey(tableName)){
|
|
|
|
- this.tec.getCoordinateMap().put(tableName, CustomFunction.getElementCell(nodeList.get(0).getHtmlUrl()));
|
|
|
|
|
|
+ if(false) {//全加载后,关闭当前节的搜索,假如后期改成依赖加载可以再次利用
|
|
|
|
+ for (String r : missingList) {
|
|
|
|
+ String tn = r.substring(0, r.indexOf(StringPool.COLON));
|
|
|
|
+ String key = r.substring(r.indexOf(StringPool.COLON) + 1);
|
|
|
|
+ List<AppWbsTreeContractVO> nodeList = this.tec.getTableAll().stream().filter(e -> e.getInitTableName().equals(tn)).collect(Collectors.toList());
|
|
|
|
+ if (Func.isNotEmpty(nodeList)) {
|
|
|
|
+ removeList.add(r);
|
|
|
|
+ Map<String, Object> elementInfo = (Map<String, Object>) elementInfoMap.get(r);
|
|
|
|
+ String tableName = nodeList.get(0).getInitTableName();
|
|
|
|
+ if (!this.tec.getCoordinateMap().containsKey(tableName)) {
|
|
|
|
+ this.tec.getCoordinateMap().put(tableName, CustomFunction.getElementCell(nodeList.get(0).getHtmlUrl()));
|
|
|
|
+ }
|
|
|
|
+ List<Map<String, Object>> tableDatas = this.jdbcTemplate.queryForList("select * from " + tableName + " where p_key_id in(" + nodeList.stream().map(AppWbsTreeContractVO::getPKeyId).map(StringUtils::handleNull).collect(Collectors.joining(",")) + ")");
|
|
|
|
+ fill(tableDatas, removeList, tn, key, StringUtils.handleNull(elementInfo.get("ename")));
|
|
}
|
|
}
|
|
- List<Map<String,Object>> tableDatas= this.jdbcTemplate.queryForList("select * from "+tableName+" where p_key_id in("+nodeList.stream().map(AppWbsTreeContractVO::getPKeyId).map(StringUtils::handleNull).collect(Collectors.joining(","))+")");
|
|
|
|
- fill(tableDatas,removeList,tn,key,StringUtils.handleNull(elementInfo.get("ename")));
|
|
|
|
}
|
|
}
|
|
- }
|
|
|
|
- if(Func.isNotEmpty(removeList)){
|
|
|
|
- /*移除已经找到的元素数据*/
|
|
|
|
- missingList.removeIf(removeList::contains);
|
|
|
|
|
|
+ if (Func.isNotEmpty(removeList)) {
|
|
|
|
+ /*移除已经找到的元素数据*/
|
|
|
|
+ missingList.removeIf(removeList::contains);
|
|
|
|
+ }
|
|
}
|
|
}
|
|
if(Func.isNotEmpty(missingList)){
|
|
if(Func.isNotEmpty(missingList)){
|
|
/*2从当前节点的兄弟节点中查找匹配的元素*/
|
|
/*2从当前节点的兄弟节点中查找匹配的元素*/
|