|
|
|
@ -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;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|