Commit 2b5deeb5 authored by taabe's avatar taabe

修改树节点对象,添加节点类型字段

parent 5c0be843
......@@ -2,6 +2,9 @@ package com.yeejoin.amos.boot.biz.common.utils;
import java.util.List;
/**
* @author DELL
*/
public class MenuFrom {
public String id;
public String key;
......@@ -10,73 +13,104 @@ public class MenuFrom {
public String label;
public String name;
public String parentId;
public Boolean isLeaf=true;
public Boolean isLeaf = true;
public List<MenuFrom> children;
/**
* 节点类型
*/
public String nodeType;
public MenuFrom(String id, String value, String key, String title, String label, String name, String parentId,
String nodeType) {
super();
this.id = id;
this.value = value;
this.key = key;
this.title = title;
this.label = label;
this.name = name;
this.parentId = parentId;
this.nodeType = nodeType;
}
public MenuFrom(String key, String name, String parentId, String nodeType) {
super();
this.id = key;
this.value = key;
this.key = key;
this.title = name;
this.label = name;
this.name = name;
this.parentId = parentId;
this.nodeType = nodeType;
}
public MenuFrom() {
super();
}
public String getKey() {
return key;
}
public void setKey(String key) {
this.key = key;
}
public String getTitle() {
return title;
}
public void setTitle(String title) {
this.title = title;
}
public String getLabel() {
return label;
}
public void setLabel(String label) {
this.label = label;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getParentId() {
return parentId;
}
public void setParentId(String parentId) {
this.parentId = parentId;
}
public Boolean getIsLeaf() {
return isLeaf;
}
public void setIsLeaf(Boolean isLeaf) {
this.isLeaf = isLeaf;
}
public List<MenuFrom> getChildren() {
return children;
}
public void setChildren(List<MenuFrom> children) {
this.children = children;
}
public MenuFrom(String id,String value,String key, String title, String label, String name, String parentId) {
super();
this.id = id;
this.value = value;
this.key = key;
this.title = title;
this.label = label;
this.name = name;
this.parentId = parentId;
}
public MenuFrom(String key, String name, String parentId) {
super();
this.id = key;
this.value = key;
this.key = key;
this.title = name;
this.label = name;
this.name = name;
this.parentId = parentId;
}
public MenuFrom() {
super();
public String getNodeType() {
return nodeType;
}
public void setNodeType(String nodeType) {
this.nodeType = nodeType;
}
}
package com.yeejoin.amos.boot.biz.common.utils;
import org.typroject.tyboot.core.foundation.utils.ValidationUtil;
import java.lang.reflect.Method;
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
import java.util.Map;
/**
* 生成树工具类
* @return
* <PRE>
*
* @return <PRE>
* author tw
* date 2021/6/10
* </PRE>
*/
public class TreeParser{
public class TreeParser {
/**
* @param topId 父id
* @param entityList 数据集合
......@@ -30,12 +32,13 @@ public class TreeParser{
* </PRE>
*/
@SuppressWarnings("unchecked")
public static List<Menu> getTree(Long topId, @SuppressWarnings("rawtypes") Collection entityList,String packageURL,String IDMethodName,int IDHierarchy, String NAMEMethodName,String PARENTIDMethodName,List<FirefightersTreeDto> list) throws Exception{
List<Menu> resultList=new ArrayList<>();
public static List<Menu> getTree(Long topId, @SuppressWarnings("rawtypes") Collection entityList, String packageURL, String IDMethodName, int IDHierarchy, String NAMEMethodName, String PARENTIDMethodName, List<FirefightersTreeDto> list) throws Exception {
List<Menu> resultList = new ArrayList<>();
@SuppressWarnings("rawtypes")
Class clazz= Class.forName(packageURL);
Class clazz = Class.forName(packageURL);
Method IDMethodNameme = null;
switch (IDHierarchy) { case 1:
switch (IDHierarchy) {
case 1:
IDMethodNameme = clazz.getDeclaredMethod(IDMethodName);
break;
case 2:
......@@ -57,27 +60,28 @@ public class TreeParser{
Object entity = clazz.cast(ob);
parentId=PARENTIDMethodNameme.invoke(entity)!=null? Long.valueOf(String.valueOf(PARENTIDMethodNameme.invoke(entity))):null;
parentId = PARENTIDMethodNameme.invoke(entity) != null ? Long.valueOf(String.valueOf(PARENTIDMethodNameme.invoke(entity))) : null;
if(parentId==null||topId==parentId){
String codeString= String.valueOf(IDMethodNameme.invoke(entity));
Integer num=0;
if(list!=null&&list.size()>0) {
if (parentId == null || topId == parentId) {
String codeString = String.valueOf(IDMethodNameme.invoke(entity));
Integer num = 0;
if (list != null && list.size() > 0) {
for (FirefightersTreeDto map : list) {
if(map.getJobTitleCode().equals(codeString) ){
num=Integer.valueOf((String) map.getNum());
if (map.getJobTitleCode().equals(codeString)) {
num = Integer.valueOf((String) map.getNum());
break;
}
};
}
;
}
Menu menu=new Menu(Long.valueOf(codeString), String.valueOf(NAMEMethodNameme.invoke(entity)), parentId,num);
Menu menu = new Menu(Long.valueOf(codeString), String.valueOf(NAMEMethodNameme.invoke(entity)), parentId, num);
resultList.add(menu);
}
}
//获取每个顶层元素的子数据集合
for (Menu entity : resultList) {
entity.setChildren(getSub(entity.getId(), entityList, packageURL, IDMethodName,IDHierarchy, NAMEMethodName, PARENTIDMethodName,list));
entity.setChildren(getSub(entity.getId(), entityList, packageURL, IDMethodName, IDHierarchy, NAMEMethodName, PARENTIDMethodName, list));
}
return resultList;
......@@ -87,10 +91,10 @@ public class TreeParser{
* 获取子数据集合
*/
@SuppressWarnings("unchecked")
private static List<Menu> getSub(Long topId, @SuppressWarnings("rawtypes") Collection entityList,String packageURL,String IDMethodName,int IDHierarchy,String NAMEMethodName,String PARENTIDMethodName ,List<FirefightersTreeDto> list) throws Exception{
List<Menu> childList=new ArrayList<>();
private static List<Menu> getSub(Long topId, @SuppressWarnings("rawtypes") Collection entityList, String packageURL, String IDMethodName, int IDHierarchy, String NAMEMethodName, String PARENTIDMethodName, List<FirefightersTreeDto> list) throws Exception {
List<Menu> childList = new ArrayList<>();
@SuppressWarnings("rawtypes")
Class clazz= Class.forName(packageURL);
Class clazz = Class.forName(packageURL);
Method IDMethodNameme = null;
switch (IDHierarchy) {
case 1:
......@@ -113,41 +117,43 @@ public class TreeParser{
for (Object ob : entityList) {
Object entity = clazz.cast(ob);
parentId=PARENTIDMethodNameme.invoke(entity)!=null? Long.valueOf(String.valueOf(PARENTIDMethodNameme.invoke(entity))):null;
parentId = PARENTIDMethodNameme.invoke(entity) != null ? Long.valueOf(String.valueOf(PARENTIDMethodNameme.invoke(entity))) : null;
if(parentId==null) {
if(topId==parentId){
if (parentId == null) {
if (topId == parentId) {
String codeString= String.valueOf(IDMethodNameme.invoke(entity));
Integer num=0;
if(list!=null&&list.size()>0) {
String codeString = String.valueOf(IDMethodNameme.invoke(entity));
Integer num = 0;
if (list != null && list.size() > 0) {
for (FirefightersTreeDto map : list) {
if(map.getJobTitleCode().equals(codeString) ){
num=Integer.valueOf((String) map.getNum());
if (map.getJobTitleCode().equals(codeString)) {
num = Integer.valueOf((String) map.getNum());
break;
}
};
}
;
}
Menu menu=new Menu(Long.valueOf(codeString), String.valueOf(NAMEMethodNameme.invoke(entity)), parentId,num);
Menu menu = new Menu(Long.valueOf(codeString), String.valueOf(NAMEMethodNameme.invoke(entity)), parentId, num);
childList.add(menu);
}
}else {
if(topId.longValue()==parentId.longValue()){
} else {
if (topId.longValue() == parentId.longValue()) {
String codeString= String.valueOf(IDMethodNameme.invoke(entity));
Integer num=0;
if(list!=null&&list.size()>0) {
String codeString = String.valueOf(IDMethodNameme.invoke(entity));
Integer num = 0;
if (list != null && list.size() > 0) {
for (FirefightersTreeDto map : list) {
if(map.getJobTitleCode().equals(codeString) ){
num=Integer.valueOf((String) map.getNum());
if (map.getJobTitleCode().equals(codeString)) {
num = Integer.valueOf((String) map.getNum());
break;
}
};
}
;
}
Menu menu=new Menu(Long.valueOf(codeString), String.valueOf(NAMEMethodNameme.invoke(entity)), parentId,num);
Menu menu = new Menu(Long.valueOf(codeString), String.valueOf(NAMEMethodNameme.invoke(entity)), parentId, num);
childList.add(menu);
}
}
......@@ -156,11 +162,11 @@ public class TreeParser{
//子集的间接子对象
for (Menu entity : childList) {
entity.setChildren(getSub(entity.getId(), entityList, packageURL, IDMethodName,IDHierarchy, NAMEMethodName, PARENTIDMethodName,list));
entity.setChildren(getSub(entity.getId(), entityList, packageURL, IDMethodName, IDHierarchy, NAMEMethodName, PARENTIDMethodName, list));
}
//递归退出条件
if(childList.size()==0){
if (childList.size() == 0) {
return null;
}
......@@ -168,9 +174,6 @@ public class TreeParser{
}
/**
* @param topId 父id
* @param entityList 数据集合
......@@ -186,12 +189,16 @@ public class TreeParser{
* </PRE>
*/
@SuppressWarnings("unchecked")
public static List<MenuFrom> getTreexin(String topId, @SuppressWarnings("rawtypes") Collection entityList,String packageURL,String IDMethodName,int IDHierarchy, String NAMEMethodName,String PARENTIDMethodName ) throws Exception{
List<MenuFrom> resultList=new ArrayList<>();
public static List<MenuFrom> getTreexin(String topId, @SuppressWarnings("rawtypes") Collection entityList,
String packageURL, String IDMethodName, int IDHierarchy,
String NAMEMethodName, String PARENTIDMethodName,
String nodeTypeMethodName) throws Exception {
List<MenuFrom> resultList = new ArrayList<>();
@SuppressWarnings("rawtypes")
Class clazz= Class.forName(packageURL);
Class clazz = Class.forName(packageURL);
Method IDMethodNameme = null;
switch (IDHierarchy) { case 1:
switch (IDHierarchy) {
case 1:
IDMethodNameme = clazz.getDeclaredMethod(IDMethodName);
break;
case 2:
......@@ -207,23 +214,33 @@ public class TreeParser{
Method NAMEMethodNameme = clazz.getDeclaredMethod(NAMEMethodName);
Method PARENTIDMethodNameme = clazz.getDeclaredMethod(PARENTIDMethodName);
Method nodeTypeMethod = null;
if (!ValidationUtil.isEmpty(nodeTypeMethodName)) {
nodeTypeMethod = clazz.getDeclaredMethod(nodeTypeMethodName);
}
//获取顶层元素集合
String parentId;
for (Object ob : entityList) {
Object entity = clazz.cast(ob);
parentId=PARENTIDMethodNameme.invoke(entity)!=null? String.valueOf(PARENTIDMethodNameme.invoke(entity)):null;
parentId = PARENTIDMethodNameme.invoke(entity) != null ? String.valueOf(PARENTIDMethodNameme.invoke(entity)) : null;
if(parentId==null||parentId.equals(topId)){
MenuFrom menu=new MenuFrom(String.valueOf(IDMethodNameme.invoke(entity)),String.valueOf(IDMethodNameme.invoke(entity)),String.valueOf(IDMethodNameme.invoke(entity)), String.valueOf(NAMEMethodNameme.invoke(entity)),String.valueOf(NAMEMethodNameme.invoke(entity)), String.valueOf(NAMEMethodNameme.invoke(entity)),parentId);
if (parentId == null || parentId.equals(topId)) {
MenuFrom menu = new MenuFrom(String.valueOf(IDMethodNameme.invoke(entity)),
String.valueOf(IDMethodNameme.invoke(entity)), String.valueOf(IDMethodNameme.invoke(entity)),
String.valueOf(NAMEMethodNameme.invoke(entity)),
String.valueOf(NAMEMethodNameme.invoke(entity)),
String.valueOf(NAMEMethodNameme.invoke(entity)), parentId,
String.valueOf(nodeTypeMethod == null ? "0" : nodeTypeMethod.invoke(entity)));
resultList.add(menu);
}
}
//获取每个顶层元素的子数据集合
for (MenuFrom entity : resultList) {
List<MenuFrom> list=getSubxin(entity.getKey(), entityList, packageURL, IDMethodName,IDHierarchy, NAMEMethodName, PARENTIDMethodName);
if(list!=null&&list.size()>0) {
List<MenuFrom> list = getSubxin(entity.getKey(), entityList, packageURL, IDMethodName, IDHierarchy,
NAMEMethodName, PARENTIDMethodName, nodeTypeMethodName);
if (list != null && list.size() > 0) {
entity.setIsLeaf(false);
}
entity.setChildren(list);
......@@ -236,10 +253,13 @@ public class TreeParser{
* 获取子数据集合
*/
@SuppressWarnings("unchecked")
private static List<MenuFrom> getSubxin(String topId, @SuppressWarnings("rawtypes") Collection entityList,String packageURL,String IDMethodName,int IDHierarchy,String NAMEMethodName,String PARENTIDMethodName ) throws Exception{
List<MenuFrom> childList=new ArrayList<>();
private static List<MenuFrom> getSubxin(String topId, @SuppressWarnings("rawtypes") Collection entityList,
String packageURL, String IDMethodName, int IDHierarchy,
String NAMEMethodName, String PARENTIDMethodName,
String nodeTypeMethodName) throws Exception {
List<MenuFrom> childList = new ArrayList<>();
@SuppressWarnings("rawtypes")
Class clazz= Class.forName(packageURL);
Class clazz = Class.forName(packageURL);
Method IDMethodNameme = null;
switch (IDHierarchy) {
case 1:
......@@ -257,21 +277,36 @@ public class TreeParser{
}
Method NAMEMethodNameme = clazz.getDeclaredMethod(NAMEMethodName);
Method PARENTIDMethodNameme = clazz.getDeclaredMethod(PARENTIDMethodName);
Method nodeTypeMethod = null;
if (!ValidationUtil.isEmpty(nodeTypeMethodName)) {
nodeTypeMethod = clazz.getDeclaredMethod(nodeTypeMethodName);
}
String parentId;
//子集的直接子对象
for (Object ob : entityList) {
Object entity = clazz.cast(ob);
parentId=PARENTIDMethodNameme.invoke(entity)!=null? String.valueOf(PARENTIDMethodNameme.invoke(entity)):null;
parentId = PARENTIDMethodNameme.invoke(entity) != null ? String.valueOf(PARENTIDMethodNameme.invoke(entity)) : null;
if(parentId==null) {
if(parentId==topId){
MenuFrom menu=new MenuFrom(String.valueOf(IDMethodNameme.invoke(entity)),String.valueOf(IDMethodNameme.invoke(entity)),String.valueOf(IDMethodNameme.invoke(entity)), String.valueOf(NAMEMethodNameme.invoke(entity)),String.valueOf(NAMEMethodNameme.invoke(entity)), String.valueOf(NAMEMethodNameme.invoke(entity)),parentId);
if (parentId == null) {
if (parentId == topId) {
MenuFrom menu = new MenuFrom(String.valueOf(IDMethodNameme.invoke(entity)),
String.valueOf(IDMethodNameme.invoke(entity)), String.valueOf(IDMethodNameme.invoke(entity)),
String.valueOf(NAMEMethodNameme.invoke(entity)),
String.valueOf(NAMEMethodNameme.invoke(entity)),
String.valueOf(NAMEMethodNameme.invoke(entity)), parentId,
String.valueOf(nodeTypeMethod == null ? "0" : nodeTypeMethod.invoke(entity)));
childList.add(menu);
}
}else {
if(topId!=null&&topId.equals(parentId)){
MenuFrom menu=new MenuFrom(String.valueOf(IDMethodNameme.invoke(entity)),String.valueOf(IDMethodNameme.invoke(entity)),String.valueOf(IDMethodNameme.invoke(entity)), String.valueOf(NAMEMethodNameme.invoke(entity)),String.valueOf(NAMEMethodNameme.invoke(entity)), String.valueOf(NAMEMethodNameme.invoke(entity)),parentId);
} else {
if (topId != null && topId.equals(parentId)) {
MenuFrom menu = new MenuFrom(String.valueOf(IDMethodNameme.invoke(entity)),
String.valueOf(IDMethodNameme.invoke(entity)),
String.valueOf(IDMethodNameme.invoke(entity)),
String.valueOf(NAMEMethodNameme.invoke(entity)),
String.valueOf(NAMEMethodNameme.invoke(entity)),
String.valueOf(NAMEMethodNameme.invoke(entity)), parentId,
String.valueOf(nodeTypeMethod == null ? "0" : nodeTypeMethod.invoke(entity)));
menu.setIsLeaf(false);
childList.add(menu);
}
......@@ -281,11 +316,12 @@ public class TreeParser{
//子集的间接子对象
for (MenuFrom entity : childList) {
entity.setChildren(getSubxin(entity.getKey(), entityList, packageURL, IDMethodName,IDHierarchy, NAMEMethodName, PARENTIDMethodName));
entity.setChildren(getSubxin(entity.getKey(), entityList, packageURL, IDMethodName, IDHierarchy,
NAMEMethodName, PARENTIDMethodName, nodeTypeMethodName));
}
//递归退出条件
if(childList.size()==0){
if (childList.size() == 0) {
return null;
}
......@@ -293,14 +329,4 @@ public class TreeParser{
}
}
......@@ -21,4 +21,10 @@ public class FireTeamListDto {
@ApiModelProperty(value = "父级id")
private Long parent;
@ApiModelProperty(value = "树节点类型(1:单位,0:队伍)")
private String nodeType;
@ApiModelProperty(value = "树节点id")
private Long id;
}
......@@ -26,10 +26,12 @@
cb_fire_team a
WHERE
a.is_delete = 0
<if test='par.parent!=null'>and a.parent = #{par.parent}</if>
<if test='par.typeCode!=null'>and a.type_code = #{par.typeCode}</if>
<if test='par.companyCode!=null'>and a.company_code = #{par.companyCode}</if>
<if test='par.name!=null'>and a.name like concat('%', #{par.name}, '%')</if>
<if test='par.parent != null'>and a.parent = #{par.parent}</if>
<if test='par.typeCode != null'>and a.type_code = #{par.typeCode}</if>
<if test='par.companyCode != null'>and a.company_code = #{par.companyCode}</if>
<if test='par.name != null'>and a.name like concat('%', #{par.name}, '%')</if>
<if test='par.nodeType != null and par.nodeType == "1"'>and a.company = #{par.id}</if>
<if test='par.nodeType != null and par.nodeType == "0"'>and a.parent = #{par.id}</if>
</select>
<select id="listFireTeamDto" resultType="com.yeejoin.amos.boot.module.common.api.dto.FireTeamDto">
......
......@@ -211,8 +211,9 @@ public class DataDictionaryController extends BaseController {
return ResponseHelper.buildResponse(obj);
}else{
Collection<DataDictionary> list=iDataDictionaryService.list(queryWrapper);
List<MenuFrom> menus =TreeParser.getTreexin(null, list, DataDictionary.class.getName(),"getCode",0, "getName", "getParent");
MenuFrom Me= new MenuFrom( "-1", "-1", "-1", "危化品库", "危化品库", "危化品库", "-1");
List<MenuFrom> menus =TreeParser.getTreexin(null, list, DataDictionary.class.getName(),"getCode",0,
"getName", "getParent", "getNodeType");
MenuFrom Me= new MenuFrom( "-1", "-1", "-1", "危化品库", "危化品库", "危化品库", "-1", null);
Me.setIsLeaf(false);
Me.setChildren(menus);
redisUtils.set(RedisKey.DATA_DICTIONARY_CODE+type, JSON.toJSON(Me),time);
......@@ -240,7 +241,8 @@ public class DataDictionaryController extends BaseController {
}else{
Collection<DataDictionary> list=iDataDictionaryService.list(queryWrapper);
List<MenuFrom> menus = null;
menus = TreeParser.getTreexin(null, list, DataDictionary.class.getName(),"getCode",0, "getName", "getParent");
menus = TreeParser.getTreexin(null, list, DataDictionary.class.getName(),"getCode",0, "getName",
"getParent", "getNodeType");
redisUtils.set(RedisKey.DATA_DICTIONARY_CODE_XIN+type, JSON.toJSON(menus),time);
objectObjectHashMap.put(type,menus);
}
......
......@@ -30,7 +30,7 @@ public class EquipmentServiceImpl {
List<Map<String, Object>> fireSystemMapList = (List<Map<String, Object>>) response.getResult();
List<MenuFrom> fireSystemDtoList = Lists.newArrayList();
fireSystemMapList.forEach(system -> {
MenuFrom menuFrom = new MenuFrom((String) system.get("id"), (String) system.get("name"), "0");
MenuFrom menuFrom = new MenuFrom((String) system.get("id"), (String) system.get("name"), "0", "0");
fireSystemDtoList.add(menuFrom);
});
return fireSystemDtoList;
......@@ -45,7 +45,8 @@ public class EquipmentServiceImpl {
List<Map<String, Object>> buildingMapList = (List<Map<String, Object>>) response.getResult();
List<MenuFrom> buildingTreeList = Lists.newArrayList();
buildingMapList.forEach(building -> {
MenuFrom menuFrom = new MenuFrom((String) building.get("id"), "全部建筑", (String) building.get("parentId"));
MenuFrom menuFrom = new MenuFrom((String) building.get("id"), "全部建筑", (String) building.get("parentId"),
"0");
List<Map<String, Object>> children = (List<Map<String, Object>>) building.get("children");
menuFrom.setChildren(parseTree(menuFrom, children));
menuFrom.setIsLeaf(false);
......@@ -58,7 +59,8 @@ public class EquipmentServiceImpl {
List<MenuFrom> menuFromList = Lists.newArrayList();
if (!ValidationUtil.isEmpty(children)) {
children.forEach(child -> {
MenuFrom menuFrom = new MenuFrom((String) child.get("id"), (String) child.get("name"), (String) child.get("parentId"));
MenuFrom menuFrom = new MenuFrom((String) child.get("id"), (String) child.get("name"),
(String) child.get("parentId"), "0");
if (!ValidationUtil.isEmpty(child.get("children"))) {
parseTree(menuFrom, (List<Map<String, Object>>) child.get("children"));
} else {
......
......@@ -14,7 +14,6 @@ import com.yeejoin.amos.boot.module.common.api.dto.FireTeamListDto;
import com.yeejoin.amos.boot.module.common.api.entity.FireTeam;
import com.yeejoin.amos.boot.module.common.api.entity.OrgUsr;
import com.yeejoin.amos.boot.module.common.api.mapper.FireTeamMapper;
import com.yeejoin.amos.boot.module.common.api.mapper.OrgUsrMapper;
import com.yeejoin.amos.boot.module.common.api.service.IFireTeamService;
import com.yeejoin.amos.boot.module.common.biz.service.impl.OrgUsrServiceImpl;
import com.yeejoin.amos.boot.module.jcs.api.feign.EquipFeignClient;
......@@ -29,7 +28,6 @@ import java.util.Collection;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
import java.util.stream.Stream;
/**
* 消防队伍 服务实现类
......@@ -112,7 +110,7 @@ public class FireTeamServiceImpl extends BaseService<FireTeamDto, FireTeam, Fire
* @return
*/
public List<MenuFrom> getCompanyTeamTree() throws Exception {
MenuFrom root = new MenuFrom("-1", "消防队伍", null);
MenuFrom root = new MenuFrom("-1", "消防队伍", null, null);
// 机场单位
List<OrgUsr> companyDeptList = orgUsrService.selectCompanyDepartmentMsg();
List<MenuFrom> companyDeptMenuList = Lists.newArrayList();
......@@ -120,7 +118,8 @@ public class FireTeamServiceImpl extends BaseService<FireTeamDto, FireTeam, Fire
if (ValidationUtil.isEmpty(o.getParentId())) {
o.setParentId("-1");
}
companyDeptMenuList.add(new MenuFrom(o.getSequenceNbr().toString(), o.getBizOrgName(), o.getParentId()));
companyDeptMenuList.add(new MenuFrom(o.getSequenceNbr().toString(), o.getBizOrgName(), o.getParentId(),
"1"));
});
// 消防队伍
List<MenuFrom> teamMenuList = Lists.newArrayList();
......@@ -130,12 +129,12 @@ public class FireTeamServiceImpl extends BaseService<FireTeamDto, FireTeam, Fire
// 将单位下没有上级队伍的队伍直接挂在单位下(方便组成树结构)
team.setParent(team.getCompany());
}
teamMenuList.add(new MenuFrom(team.getSequenceNbr().toString(), team.getName(), team.getParent().toString()));
teamMenuList.add(new MenuFrom(team.getSequenceNbr().toString(), team.getName(),
team.getParent().toString(), "1"));
});
companyDeptMenuList.addAll(teamMenuList);
List<MenuFrom> menuList = TreeParser.getTreexin("-1", companyDeptMenuList, MenuFrom.class.getName(), "getKey",
1, "getName",
"getParentId");
1, "getName", "getParentId", "getNodeType");
root.setChildren(menuList);
return Lists.newArrayList(root);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment