|
@@ -595,6 +595,11 @@ public class FormulaController {
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
+ public List<Object> calc(String formula,Map<String,List<ElementData>> dataSource){
|
|
|
|
+ return null;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+
|
|
/**
|
|
/**
|
|
* @Description 根据元素码和当前工序pkeyId返回元素数据
|
|
* @Description 根据元素码和当前工序pkeyId返回元素数据
|
|
* @Param [codes, pkeyId]
|
|
* @Param [codes, pkeyId]
|
|
@@ -606,6 +611,7 @@ public class FormulaController {
|
|
String s = codes.stream().collect(Collectors.joining("','","'","'"));
|
|
String s = codes.stream().collect(Collectors.joining("','","'","'"));
|
|
List<Map<String,Object>> listMap = this.jdbcTemplate.queryForList("select a.id elementId,a.e_key ekey,a.e_name eName,b.init_table_name tableName,b.html_url url,b.p_key_id pkeyId,b.node_name nodeName,CONCAT(b.init_table_name,':',a.e_key) tk from m_wbs_form_element a join m_wbs_tree_private b on a.f_id=b.init_table_id where b.parent_id="+wtp.getParentId()
|
|
List<Map<String,Object>> listMap = this.jdbcTemplate.queryForList("select a.id elementId,a.e_key ekey,a.e_name eName,b.init_table_name tableName,b.html_url url,b.p_key_id pkeyId,b.node_name nodeName,CONCAT(b.init_table_name,':',a.e_key) tk from m_wbs_form_element a join m_wbs_tree_private b on a.f_id=b.init_table_id where b.parent_id="+wtp.getParentId()
|
|
+" and b.project_id="+wtp.getProjectId()+" and b.is_deleted=0 and a.is_deleted=0 and CONCAT(b.init_table_name,':',a.e_key) in("+s+") ORDER BY b.sort,b.create_time");
|
|
+" and b.project_id="+wtp.getProjectId()+" and b.is_deleted=0 and a.is_deleted=0 and CONCAT(b.init_table_name,':',a.e_key) in("+s+") ORDER BY b.sort,b.create_time");
|
|
|
|
+ Map<String,List<ElementData>> result = new HashMap<>();
|
|
if(listMap.size()>codes.size()){
|
|
if(listMap.size()>codes.size()){
|
|
Map<String,Map<String,String>> coordsMap = new HashMap<>();
|
|
Map<String,Map<String,String>> coordsMap = new HashMap<>();
|
|
for(Map<String,Object> m:listMap){
|
|
for(Map<String,Object> m:listMap){
|
|
@@ -629,8 +635,16 @@ public class FormulaController {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
});
|
|
});
|
|
|
|
+ Map<String,FormData> fdMap= codes.stream().map(c->{
|
|
|
|
+ String[] tc=c.split(":");
|
|
|
|
+ return FormulaUtils.createFormDataFast(c,c,codeDataMap.get(c),coordsMap.get(tc[0]).get(tc[1]));
|
|
|
|
+ }).filter(Objects::nonNull).collect(Collectors.toMap(FormData::getCode, f->f));
|
|
|
|
+ if(fdMap.size()>0){
|
|
|
|
+ fdMap.forEach((k,v)->{
|
|
|
|
+ result.put(k,v.getValues());
|
|
|
|
+ });
|
|
|
|
+ }
|
|
}
|
|
}
|
|
- Map<String,List<ElementData>> result = new HashMap<>();
|
|
|
|
return result;
|
|
return result;
|
|
}
|
|
}
|
|
|
|
|
|
@@ -650,4 +664,45 @@ public class FormulaController {
|
|
return formula;
|
|
return formula;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+
|
|
|
|
+ @GetMapping("/table-name")
|
|
|
|
+ public R<Object> lack() {
|
|
|
|
+ List<Map<String,Object>> listMap=this.jdbcTemplate.queryForList("select p_key_id pkeyId,node_name nodeName from m_wbs_tree_contract where project_id=1630011899725201410 and table_type>0 and is_deleted=0 and init_table_name is null ");
|
|
|
|
+ Map<Long,String> idMap= listMap.stream().collect(Collectors.toMap(m->Long.parseLong(m.get("pkeyId").toString()),m->m.get("nodeName").toString()));
|
|
|
|
+ List<Map<String,Object>> tn = this.jdbcTemplate.queryForList("select tab_ch_name ch,tab_en_name en from m_table_info where tab_ch_name in("+idMap.values().stream().distinct().map(Object::toString).collect(Collectors.joining("','","'","'"))+")");
|
|
|
|
+ Map<String,String> tbMap= tn.stream().collect(Collectors.toMap(m->m.get("ch").toString(),m->m.get("en").toString()));
|
|
|
|
+ List<WbsTreeContract> list = this.wbsTreeContractService.list(Wrappers.<WbsTreeContract>lambdaQuery().in(WbsTreeContract::getPKeyId,idMap.keySet()));
|
|
|
|
+ list.forEach(e->{
|
|
|
|
+ if(Func.isBlank(e.getInitTableName())){
|
|
|
|
+ e.setInitTableName(tbMap.get(e.getFullName()));
|
|
|
|
+ this.wbsTreeContractService.update(Wrappers.<WbsTreeContract>lambdaUpdate().set(WbsTreeContract::getInitTableName,e.getInitTableName()).eq(WbsTreeContract::getPKeyId,e.getPKeyId()));
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+ return R.success("成功");
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ public R<Object> flushPri(){
|
|
|
|
+ /*刷inittablename*/
|
|
|
|
+ List<Map<String,Object>> listMap=this.jdbcTemplate.queryForList("select p_key_id nodeId,init_table_id tableId from m_wbs_tree_private where project_id=1630011899725201410 and init_table_id is not null and init_table_name is null and is_deleted=0");
|
|
|
|
+ if(listMap.size()>0){
|
|
|
|
+ Map<Long,Long> idMap= listMap.stream().collect(Collectors.toMap(m->Long.parseLong(m.get("nodeId").toString()),m->Long.parseLong(m.get("tableId").toString())));
|
|
|
|
+ List<Map<String,Object>> tn = this.jdbcTemplate.queryForList("select id,tab_en_name tbName from m_table_info where id in("+idMap.values().stream().distinct().map(Object::toString).collect(Collectors.joining(","))+")");
|
|
|
|
+ Map<String,String> tbMap= tn.stream().collect(Collectors.toMap(m->m.get("id").toString(),m->m.get("tbName").toString()));
|
|
|
|
+ List<WbsTreePrivate> updateList = new ArrayList<>();
|
|
|
|
+ List<WbsTreePrivate> list = this.wbsTreePrivateService.list(Wrappers.<WbsTreePrivate>lambdaQuery().in(WbsTreePrivate::getPKeyId,idMap.keySet()));
|
|
|
|
+ list.forEach(e->{
|
|
|
|
+ if(e.getInitTableId()!=null&&e.getInitTableName()==null){
|
|
|
|
+ e.setInitTableName(tbMap.get(e.getInitTableId()));
|
|
|
|
+ this.wbsTreePrivateService.update(Wrappers.<WbsTreePrivate>lambdaUpdate().set(WbsTreePrivate::getInitTableName,e.getInitTableName()).eq(WbsTreePrivate::getPKeyId,e.getPKeyId()));
|
|
|
|
+ updateList.add(e);
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+ if(updateList.size()>0){
|
|
|
|
+ // this.wbsTreePrivateService.saveOrUpdateBatch(updateList,500);
|
|
|
|
+ }
|
|
|
|
+ return R.success("成功");
|
|
|
|
+ }
|
|
|
|
+ return R.fail("失败");
|
|
|
|
+ }
|
|
}
|
|
}
|