|
@@ -287,7 +287,7 @@ public class FormulaServiceImpl extends BaseServiceImpl<FormulaMapper, Formula>
|
|
|
if (g != null) {
|
|
|
List<ItemBlock> itemBlockList = g.getList();
|
|
|
int originSize = itemBlockList.size();
|
|
|
- List<Long> ids =getNodeType46().stream().map(CurrentNode::getId).collect(Collectors.toList());
|
|
|
+ List<Long> ids =getNodeType46().stream().map(CurrentNode::getPkId).collect(Collectors.toList());
|
|
|
/*清除那些已经不存在的工序*/
|
|
|
itemBlockList.removeIf(ik -> !ids.contains(ik.getPkeyId()));
|
|
|
if (itemBlockList.size() > 0) {
|
|
@@ -338,9 +338,25 @@ public class FormulaServiceImpl extends BaseServiceImpl<FormulaMapper, Formula>
|
|
|
}
|
|
|
|
|
|
|
|
|
+ public void descendantType46(Object id, List<Map<String,Object>> listMaps){
|
|
|
+ String sql="select p_Key_id pkId,id,node_type nodeType,table_type tableType from m_wbs_tree_contract where parent_id =? and is_deleted=0";
|
|
|
+ List<Map<String,Object>> tmp=this.jdbcTemplate.queryForList(sql,id);
|
|
|
+ if(tmp.size()>0){
|
|
|
+ for(Map<String,Object>map:tmp){
|
|
|
+ if(StringUtils.isEquals(map.get("nodeType"),6)){
|
|
|
+ listMaps.add(map);
|
|
|
+ }else{
|
|
|
+ descendantType46(map.get("id"),listMaps);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
public List<CurrentNode> getNodeType46(){
|
|
|
if(tec.getCurrentNode().getDivisional().size()==0){
|
|
|
- List<Map<String,Object>> listMaps=this.jdbcTemplate.queryForList("select b.p_Key_id pkId,b.id from m_wbs_tree_contract a join m_wbs_tree_contract b on (a.contract_id=b.contract_id and b.ancestors like CONCAT(a.ancestors,'%')) where a.p_key_id="+tec.getCurrentNode().getPkId()+" and b.is_deleted=0 and b.node_type=6 ORDER BY b.sort");
|
|
|
+ // List<Map<String,Object>> listMaps=this.jdbcTemplate.queryForList("select b.p_Key_id pkId,b.id from m_wbs_tree_contract a join m_wbs_tree_contract b on (a.contract_id=b.contract_id and b.ancestors like CONCAT(a.ancestors,'%')) where a.p_key_id="+tec.getCurrentNode().getPkId()+" and b.is_deleted=0 and b.node_type=6 ORDER BY b.sort");
|
|
|
+ List<Map<String,Object>> listMaps =new ArrayList<>();
|
|
|
+ descendantType46(tec.getCurrentNode().getParentId(),listMaps);
|
|
|
if(listMaps.size()>0){
|
|
|
tec.getCurrentNode().getDivisional().addAll(listMaps.stream().map(m->BeanUtil.toBean(m,CurrentNode.class)).collect(Collectors.toList()));
|
|
|
}
|