Merge pull request !80 from reset/feature/cl
pull/81/MERGE
reset 3 years ago committed by Gitee
commit 07cb72c05c
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F

@ -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())
@ -40,18 +42,12 @@ public class ExtendGroupBO {
//获取非一级
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…
Cancel
Save