|
@@ -300,7 +300,13 @@ public class EmployeeServiceImpl implements EmployeeService {
|
|
|
System.out.println("当前人员所有父部门id列表:" + deptIdList);
|
|
|
|
|
|
//从右往左获取第三层级部门(即客户要求展示的部门层级id)
|
|
|
- String a = deptIdList.get(deptIdList.size() - 3).toString();
|
|
|
+ System.out.println("嘻嘻嘻嘻嘻" + JSON.toJSONString(deptIdList));
|
|
|
+ String a = "";
|
|
|
+ if (deptIdList.size() > 2) {
|
|
|
+ a = deptIdList.get(deptIdList.size() - 3).toString();
|
|
|
+ } else {
|
|
|
+ a = deptIdList.get(deptIdList.size() - 1).toString();
|
|
|
+ }
|
|
|
long zhanshiDept = Long.parseLong(a);
|
|
|
System.out.println("展示主部门的id:" + zhanshiDept);
|
|
|
|
|
@@ -510,7 +516,12 @@ public class EmployeeServiceImpl implements EmployeeService {
|
|
|
System.out.println("当前人员所有父部门id列表:" + deptIdList);
|
|
|
|
|
|
//从右往左获取第三层级部门(即客户要求展示的部门层级id)
|
|
|
- String a = deptIdList.get(deptIdList.size() - 3).toString();
|
|
|
+ String a ;
|
|
|
+ if (deptIdList.size() > 2) {
|
|
|
+ a = deptIdList.get(deptIdList.size() - 3).toString();
|
|
|
+ } else {
|
|
|
+ a = deptIdList.get(deptIdList.size() - 1).toString();
|
|
|
+ }
|
|
|
long zhanshiDept = Long.parseLong(a);
|
|
|
System.out.println("展示主部门的id:" + zhanshiDept);
|
|
|
|