From 5ee3daf7d3fae3d6ad8b40388ba29103ea549045 Mon Sep 17 00:00:00 2001 From: wanggeng888 <450292408@qq.com> Date: Sun, 10 Jan 2021 21:38:21 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A4=84=E7=90=86BUG?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../system/department/impl/DepartmentServiceImpl.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/cm/serviceusercenter/service/system/department/impl/DepartmentServiceImpl.java b/src/main/java/com/cm/serviceusercenter/service/system/department/impl/DepartmentServiceImpl.java index 9d58ba3..4f8e8e3 100644 --- a/src/main/java/com/cm/serviceusercenter/service/system/department/impl/DepartmentServiceImpl.java +++ b/src/main/java/com/cm/serviceusercenter/service/system/department/impl/DepartmentServiceImpl.java @@ -240,7 +240,10 @@ public class DepartmentServiceImpl extends BaseService implements IDepartmentSer @Override public List listZTreeDepartment(Map params) throws SearchException { - List zTreeDTOs = ArrayListUtil.deepClone(departmentDao.listZTreeDepartments(params), ZTreeDTO.class); + List zTreeDepartment = departmentDao.listZTreeDepartments(params); + List zTreeDTOs = Arrays.asList(new ZTreeDTO[zTreeDepartment.size()]); + Collections.copy(zTreeDTOs, zTreeDepartment); + // List zTreeDTOs = ArrayListUtil.deepClone(departmentDao.listZTreeDepartments(params), ZTreeDTO.class); for (ZTreeDTO zTreeDTO : zTreeDTOs) { Integer subCount = departmentDao.countByParentId(zTreeDTO.getId()); setZTreeInfo(zTreeDTO, subCount); @@ -252,7 +255,7 @@ public class DepartmentServiceImpl extends BaseService implements IDepartmentSer public List listZTreeDepartment(String departmentParentId, Map params) { if (StringUtils.equals(ISystemConstant.TREE_ROOT_ID, departmentParentId)) { List listBaseDepartmentIds = listBaseDepartmentIds(); - if (!Objects.isNull(listBaseDepartmentIds)) { + if (listBaseDepartmentIds != null && !listBaseDepartmentIds.isEmpty()) { params.put("departmentIds", listBaseDepartmentIds); return listZTreeDepartment(params); }