|
@@ -238,7 +238,7 @@ public class FormulaServiceImpl extends BaseServiceImpl<FormulaMapper, Formula>
|
|
String tableName = nodeList.get(0).getInitTableName();
|
|
String tableName = nodeList.get(0).getInitTableName();
|
|
try {
|
|
try {
|
|
if(!this.tec.getCoordinateMap().containsKey(tableName)){
|
|
if(!this.tec.getCoordinateMap().containsKey(tableName)){
|
|
- this.tec.getCoordinateMap().put(tableName, getTableCols(nodeList.get(0)));
|
|
|
|
|
|
+ this.tec.getCoordinateMap().put(tableName, getTableCols(nodeList.get(0).getHtmlUrl()));
|
|
}
|
|
}
|
|
} catch (FileNotFoundException e) {
|
|
} catch (FileNotFoundException e) {
|
|
e.printStackTrace();
|
|
e.printStackTrace();
|
|
@@ -254,7 +254,7 @@ public class FormulaServiceImpl extends BaseServiceImpl<FormulaMapper, Formula>
|
|
if(Func.isNotEmpty(missingList)){
|
|
if(Func.isNotEmpty(missingList)){
|
|
/*2从当前节点的兄弟节点中查找匹配的元素*/
|
|
/*2从当前节点的兄弟节点中查找匹配的元素*/
|
|
CurrentNode currentNode = this.tec.getCurrentNode();
|
|
CurrentNode currentNode = this.tec.getCurrentNode();
|
|
- List<Map<String,Object>> tableNamePkIdsMaps= this.jdbcTemplate.queryForList("select c.init_table_name tableName,c.p_key_id pkId from (select b.id from (select * from m_wbs_tree_contract where p_key_id="+currentNode.getPkId()+") a join m_wbs_tree_contract b on b.parent_id=a.parent_id where b.contract_id="+this.tec.getContractId()+" and b.is_deleted=0) k join m_wbs_tree_contract c on c.parent_id = k.id where c.contract_id="+this.tec.getContractId()+" and c.is_deleted=0 ");
|
|
|
|
|
|
+ List<Map<String,Object>> tableNamePkIdsMaps= this.jdbcTemplate.queryForList("select c.init_table_name tableName,c.p_key_id pkId,c.html_url url from (select b.id from (select * from m_wbs_tree_contract where p_key_id="+currentNode.getPkId()+") a join m_wbs_tree_contract b on b.parent_id=a.parent_id where b.contract_id="+this.tec.getContractId()+" and b.is_deleted=0) k join m_wbs_tree_contract c on c.parent_id = k.id where c.contract_id="+this.tec.getContractId()+" and c.is_deleted=0 ");
|
|
if(Func.isNotEmpty(tableNamePkIdsMaps)){
|
|
if(Func.isNotEmpty(tableNamePkIdsMaps)){
|
|
removeList.clear();
|
|
removeList.clear();
|
|
missingList.forEach(miss->{
|
|
missingList.forEach(miss->{
|
|
@@ -263,6 +263,15 @@ public class FormulaServiceImpl extends BaseServiceImpl<FormulaMapper, Formula>
|
|
String key =miss.substring(miss.indexOf(StringPool.COLON)+1);
|
|
String key =miss.substring(miss.indexOf(StringPool.COLON)+1);
|
|
String targetIds=tableNamePkIdsMaps.stream().filter(m->StringUtils.isEquals(m.get("tableName"),tn)).map(m->m.get("pkId")).map(StringUtils::handleNull).collect(Collectors.joining(","));
|
|
String targetIds=tableNamePkIdsMaps.stream().filter(m->StringUtils.isEquals(m.get("tableName"),tn)).map(m->m.get("pkId")).map(StringUtils::handleNull).collect(Collectors.joining(","));
|
|
if(Func.isNotEmpty(targetIds)){
|
|
if(Func.isNotEmpty(targetIds)){
|
|
|
|
+ if(!this.tec.getCoordinateMap().containsKey(tn)){
|
|
|
|
+ tableNamePkIdsMaps.stream().filter(m->StringUtils.isEquals(m.get("tableName"),tn)).findAny().ifPresent(m->{
|
|
|
|
+ try {
|
|
|
|
+ this.tec.getCoordinateMap().put(tn,getTableCols(StringUtils.handleNull(m.get("url"))));
|
|
|
|
+ } catch (FileNotFoundException e) {
|
|
|
|
+ e.printStackTrace();
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+ }
|
|
List<Map<String,Object>> tableDatas= this.jdbcTemplate.queryForList("select * from "+tn+" where p_key_id in ("+targetIds+")");
|
|
List<Map<String,Object>> tableDatas= this.jdbcTemplate.queryForList("select * from "+tn+" where p_key_id in ("+targetIds+")");
|
|
String tmp =elementInfo==null?"":StringUtils.handleNull(elementInfo.get("ename"));
|
|
String tmp =elementInfo==null?"":StringUtils.handleNull(elementInfo.get("ename"));
|
|
fill(tableDatas,removeList,tn,key,tmp);
|
|
fill(tableDatas,removeList,tn,key,tmp);
|
|
@@ -344,9 +353,9 @@ public class FormulaServiceImpl extends BaseServiceImpl<FormulaMapper, Formula>
|
|
return null;
|
|
return null;
|
|
}
|
|
}
|
|
|
|
|
|
- public Map<String, String> getTableCols(AppWbsTreeContractVO wbsTreeContract) throws FileNotFoundException {
|
|
|
|
|
|
+ public Map<String, String> getTableCols(String htmlUri) throws FileNotFoundException {
|
|
Map<String, String> dataMap = new HashMap<>();
|
|
Map<String, String> dataMap = new HashMap<>();
|
|
- File file1 = ResourceUtil.getFile(wbsTreeContract.getHtmlUrl());
|
|
|
|
|
|
+ File file1 = ResourceUtil.getFile(htmlUri);
|
|
FileInputStream fileInputStream = new FileInputStream(file1);
|
|
FileInputStream fileInputStream = new FileInputStream(file1);
|
|
String htmlString = IoUtil.readToString(fileInputStream);
|
|
String htmlString = IoUtil.readToString(fileInputStream);
|
|
Document doc = Jsoup.parse(htmlString);
|
|
Document doc = Jsoup.parse(htmlString);
|
|
@@ -543,10 +552,6 @@ public class FormulaServiceImpl extends BaseServiceImpl<FormulaMapper, Formula>
|
|
}
|
|
}
|
|
}
|
|
}
|
|
ele.forEach(e->{
|
|
ele.forEach(e->{
|
|
- /*步进处理*/
|
|
|
|
- if(e.getCode().equals("m_20220928135543_1575001284954554368:key_31")){
|
|
|
|
- e.setStep(10);
|
|
|
|
- }
|
|
|
|
fdMap.put(e.getCode(),e);
|
|
fdMap.put(e.getCode(),e);
|
|
});
|
|
});
|
|
CompositeDataAccess cda = new CompositeDataAccess(fdMap);
|
|
CompositeDataAccess cda = new CompositeDataAccess(fdMap);
|