From 977e7048c4eaf9074dcd307bf4c292f23dc25663 Mon Sep 17 00:00:00 2001 From: bobol Date: Tue, 11 Jun 2024 17:26:56 +0800 Subject: [PATCH] =?UTF-8?q?1=E3=80=81=E4=BF=AE=E6=94=B9updateDeptChildren?= =?UTF-8?q?=E6=96=B9=E6=B3=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/lzbi/system/service/impl/SysDeptServiceImpl.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lzbi-system/src/main/java/com/lzbi/system/service/impl/SysDeptServiceImpl.java b/lzbi-system/src/main/java/com/lzbi/system/service/impl/SysDeptServiceImpl.java index e11bad3..39d0b03 100644 --- a/lzbi-system/src/main/java/com/lzbi/system/service/impl/SysDeptServiceImpl.java +++ b/lzbi-system/src/main/java/com/lzbi/system/service/impl/SysDeptServiceImpl.java @@ -322,6 +322,9 @@ public class SysDeptServiceImpl implements ISysDeptService { * @param oldAncestors 旧的父ID集合 */ public void updateDeptChildren(Long deptId, String newAncestors, String oldAncestors, String newAllName, String oldAllName) { + if (null == oldAllName) { + oldAllName = ""; + } List children = deptMapper.selectChildrenDeptById(deptId); for (SysDept child : children) { child.setAncestors(child.getAncestors().replaceFirst(oldAncestors, newAncestors)); @@ -341,6 +344,9 @@ public class SysDeptServiceImpl implements ISysDeptService { * @param newAllName 新的父ID集合 */ public void updateDeptChildrenNew(Long deptId, String newAllName, String oldAllName) { + if (null == oldAllName) { + oldAllName = ""; + } List children = deptMapper.selectChildrenDeptById(deptId); for (SysDept child : children) { if (!StringUtils.isEmpty(child.getAllName())) {