自定义树页面修好
This commit is contained in:
parent
6e7c76ac0d
commit
cde0608e02
|
|
@ -1,7 +1,10 @@
|
|||
package com.engine.organization.entity.extend.bo;
|
||||
|
||||
import com.engine.organization.entity.extend.po.ExtendGroupPO;
|
||||
import com.engine.organization.entity.extend.po.ExtendTitlePO;
|
||||
import com.engine.organization.entity.fieldset.vo.TypeTreeVO;
|
||||
import com.engine.organization.mapper.extend.ExtendTitleMapper;
|
||||
import com.engine.organization.util.db.MapperProxyFactory;
|
||||
import org.apache.commons.collections.CollectionUtils;
|
||||
|
||||
import java.util.Collections;
|
||||
|
|
@ -29,7 +32,6 @@ public class ExtendGroupBO {
|
|||
.canClick(true)
|
||||
.domid(String.valueOf(e.getId()))
|
||||
.hasGroup(isHasGroup(e.getId()))
|
||||
.haschild(getHasChild(e.getId()))
|
||||
.isShow(e.getIsShow())
|
||||
.key(e.getId())
|
||||
.name(e.getGroupName())
|
||||
|
|
@ -38,20 +40,14 @@ public class ExtendGroupBO {
|
|||
.build()).collect(Collectors.toList());
|
||||
|
||||
//获取非一级
|
||||
Map<Long, List<TypeTreeVO>> collects = typeTreeVOS.stream().filter(item -> item.getPid() != null).collect(Collectors.groupingBy(TypeTreeVO ::getPid));
|
||||
Map<Long, List<TypeTreeVO>> collects = typeTreeVOS.stream().filter(item -> item.getPid() != null).collect(Collectors.groupingBy(TypeTreeVO :: getPid));
|
||||
|
||||
return typeTreeVOS.stream().peek(e -> e.setSubs(collects.get(e.getKey()))).filter(item -> item.getPid() == null).collect(Collectors.toList());
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
private static boolean getHasChild(Long id) {
|
||||
return true;
|
||||
return typeTreeVOS.stream().peek(e -> {e.setChilds(collects.get(e.getKey())); e.setHaschild(collects.get(e.getKey()) != null && collects.get(e.getKey()).size() > 0);}).filter(item -> item.getPid() == null).collect(Collectors.toList());
|
||||
}
|
||||
|
||||
|
||||
private static boolean isHasGroup(Long id) {
|
||||
return true;
|
||||
List<ExtendTitlePO> titlesByGroupID = MapperProxyFactory.getProxy(ExtendTitleMapper.class).getTitlesByGroupID(id);
|
||||
return titlesByGroupID.size() > 0;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@ import lombok.Builder;
|
|||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
|
|
@ -58,11 +59,13 @@ public class TypeTreeVO {
|
|||
private String name;
|
||||
|
||||
//子节点
|
||||
private List<TypeTreeVO> subs;
|
||||
private List<TypeTreeVO> childs;
|
||||
|
||||
//
|
||||
private int viewAttr;
|
||||
|
||||
private ArrayList<TypeTreeVO> subs;
|
||||
|
||||
//父节点id
|
||||
private Long pid;
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue