|
|
@ -1,5 +1,6 @@ |
|
|
package com.hxgk.lowcode.service.impl; |
|
|
package com.hxgk.lowcode.service.impl; |
|
|
|
|
|
|
|
|
|
|
|
import com.alibaba.fastjson2.JSON; |
|
|
import com.baomidou.dynamic.datasource.annotation.DS; |
|
|
import com.baomidou.dynamic.datasource.annotation.DS; |
|
|
import com.hxgk.lowcode.mapper.AppmenusMapper; |
|
|
import com.hxgk.lowcode.mapper.AppmenusMapper; |
|
|
import com.hxgk.lowcode.model.entity.Appmenus; |
|
|
import com.hxgk.lowcode.model.entity.Appmenus; |
|
|
@ -8,6 +9,8 @@ import com.hxgk.lowcode.model.entity.CustomerFormView; |
|
|
import com.hxgk.lowcode.model.entity.Tree; |
|
|
import com.hxgk.lowcode.model.entity.Tree; |
|
|
import com.hxgk.lowcode.service.AppmenusService; |
|
|
import com.hxgk.lowcode.service.AppmenusService; |
|
|
import org.apache.commons.lang3.StringUtils; |
|
|
import org.apache.commons.lang3.StringUtils; |
|
|
|
|
|
import org.slf4j.ILoggerFactory; |
|
|
|
|
|
import org.slf4j.Logger; |
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
import org.springframework.stereotype.Service; |
|
|
import org.springframework.stereotype.Service; |
|
|
|
|
|
|
|
|
@ -16,10 +19,14 @@ import java.util.HashMap; |
|
|
import java.util.List; |
|
|
import java.util.List; |
|
|
import java.util.Map; |
|
|
import java.util.Map; |
|
|
|
|
|
|
|
|
|
|
|
import static com.mysql.cj.conf.PropertyKey.logger; |
|
|
|
|
|
|
|
|
@Service |
|
|
@Service |
|
|
@DS("tidbintranetappplatform") |
|
|
@DS("tidbintranetappplatform") |
|
|
public class AppmenusSerciceImpl implements AppmenusService { |
|
|
public class AppmenusSerciceImpl implements AppmenusService { |
|
|
|
|
|
@Autowired |
|
|
|
|
|
static |
|
|
|
|
|
Logger logger; |
|
|
@Autowired |
|
|
@Autowired |
|
|
AppmenusMapper appmenusMapper; |
|
|
AppmenusMapper appmenusMapper; |
|
|
@Override |
|
|
@Override |
|
|
@ -125,7 +132,12 @@ public class AppmenusSerciceImpl implements AppmenusService { |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
public static Tree findChildren(Tree rootTree,List<Tree> list){ |
|
|
public static Tree findChildren(Tree rootTree,List<Tree> list){ |
|
|
|
|
|
/*System.out.println("11111111111111111111111111111111111111111111111111111111111111111111111111111111111"); |
|
|
|
|
|
System.out.println(JSON.toJSONString(rootTree)); |
|
|
|
|
|
System.out.println(JSON.toJSONString(list));*/ |
|
|
//这个方法是在找rootTree的所有子节点,然后返回rootTree
|
|
|
//这个方法是在找rootTree的所有子节点,然后返回rootTree
|
|
|
|
|
|
|
|
|
|
|
|
if(list.size()>0&&StringUtils.isNotBlank(rootTree.getId())){ |
|
|
for (Tree tree : list) { |
|
|
for (Tree tree : list) { |
|
|
if(rootTree.getId().equals(tree.getParentId())){ |
|
|
if(rootTree.getId().equals(tree.getParentId())){ |
|
|
String cfid = (String)tree.getTreeAttrs().get("customerFormId"); |
|
|
String cfid = (String)tree.getTreeAttrs().get("customerFormId"); |
|
|
@ -165,6 +177,35 @@ public class AppmenusSerciceImpl implements AppmenusService { |
|
|
rootTree.getChildren().add(findChildren(tree,list)); |
|
|
rootTree.getChildren().add(findChildren(tree,list)); |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
}else{ |
|
|
|
|
|
System.out.println("11111111111111111111111111111111111111111111111111111111111111111111111111111111111"); |
|
|
|
|
|
if(null!=rootTree){ |
|
|
|
|
|
System.out.println(JSON.toJSONString(rootTree)); |
|
|
|
|
|
}else{ |
|
|
|
|
|
System.out.println("rootTree 为 null"); |
|
|
|
|
|
} |
|
|
|
|
|
if(null!=list){ |
|
|
|
|
|
System.out.println(JSON.toJSONString(list)); |
|
|
|
|
|
}else{ |
|
|
|
|
|
System.out.println("list 为 null"); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/*if(null!=rootTree){ |
|
|
|
|
|
logger.error(JSON.toJSONString(rootTree)); |
|
|
|
|
|
}else{ |
|
|
|
|
|
logger.error("rootTree 为 null"); |
|
|
|
|
|
} |
|
|
|
|
|
if(null!=list){ |
|
|
|
|
|
logger.error(JSON.toJSONString(list)); |
|
|
|
|
|
}else{ |
|
|
|
|
|
logger.error("list 为 null"); |
|
|
|
|
|
}*/ |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return rootTree; |
|
|
return rootTree; |
|
|
} |
|
|
} |
|
|
|