需要获取部门的树型结构,同时展示部门下有哪些用户,请问该如何实现?

Blade 未结 1 766
xjjxjjchd
xjjxjjchd 剑童 2021-09-16 10:43
悬赏:10

一、该问题的重现步骤是什么?

1.曾尝试将DeptServiceImpl中的tree方法改造,但是在遍历该方法返回的 List<DeptVO>集合时 时候发生类型转换异常。image.png

2. 


3.


二、你期待的结果是什么?实际看到的又是什么?


三、你正在使用的是什么产品,什么版本?在什么操作系统上?

bladeX-boot  win10

四、请提供详细的错误堆栈信息,这很重要。

java.lang.ClassCastException: com.blade.core.tool.node.TreeNode cannot be cast to com.blade.vo.DeptVO

at com.blade.system.service.impl.DeptServiceImpl.getTreeSetUsers(DeptServiceImpl.java:120)

at com.blade.system.service.impl.DeptServiceImpl.tree(DeptServiceImpl.java:113)

at com.blade.system.service.impl.DeptServiceImpl$$FastClassBySpringCGLIB$$469add22.invoke(<generated>)

at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:218)

at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:688)

at com.blade.system.service.impl.DeptServiceImpl$$EnhancerBySpringCGLIB$$88be8b17.tree(<generated>)

at com.blade.system.controller.DeptController.tree(DeptController.java:123)

at com.blade.system.controller.DeptController$$FastClassBySpringCGLIB$$7a6e814c.invoke(<generated>)

at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:218)

at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:779)

at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:163)

at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(CglibAopProxy.java:750)

at org.springframework.aop.aspectj.MethodInvocationProceedingJoinPoint.proceed(MethodInvocationProceedingJoinPoint.java:88)

at com.blade.core.secure.aspect.AuthAspect.preAuth(AuthAspect.java:68)

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

at java.lang.reflect.Method.invoke(Method.java:498)

at org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethodWithGivenArgs(AbstractAspectJAdvice.ja

五、若有更多详细信息,请在下面提供。


1条回答
  • 2021-09-16 16:07

    for循环的时候要改成TreeNode

    0 讨论(0)
提交回复