|
@@ -536,18 +536,20 @@ public class SysSystemServiceImpl extends ServiceImpl<SysSystemMapper, SysSystem
|
|
|
.select(SysDept::getId)
|
|
.select(SysDept::getId)
|
|
|
.eq(SysDept::getSystemCode, sysSystem.getSysCode())).stream()
|
|
.eq(SysDept::getSystemCode, sysSystem.getSysCode())).stream()
|
|
|
.map(SysDept::getId).collect(Collectors.toList());
|
|
.map(SysDept::getId).collect(Collectors.toList());
|
|
|
- if (CollUtil.isNotEmpty(deptIdList)) {
|
|
|
|
|
|
|
+ // 需要排除当前租户自己
|
|
|
|
|
+ if (CollUtil.isNotEmpty(deptIdList) && CollUtil.size(deptIdList) > 1) {
|
|
|
errorStr = "租户["+sysSystem.getSysName()+"]还有部分子机构,请将这些子机构删除后,再进行删除!";
|
|
errorStr = "租户["+sysSystem.getSysName()+"]还有部分子机构,请将这些子机构删除后,再进行删除!";
|
|
|
return errorStr;
|
|
return errorStr;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- Long count = sysUserJzgInfoMapper.selectCount(new LambdaQueryWrapper<SysUserJzgInfo>()
|
|
|
|
|
|
|
+ List<SysUserJzgInfo> sysUserJzgInfos = sysUserJzgInfoMapper.selectList(new LambdaQueryWrapper<SysUserJzgInfo>()
|
|
|
.eq(SysUserJzgInfo::getSystemCode, sysSystem.getSysCode())
|
|
.eq(SysUserJzgInfo::getSystemCode, sysSystem.getSysCode())
|
|
|
.eq(SysUserJzgInfo::getIsEnable, 0)
|
|
.eq(SysUserJzgInfo::getIsEnable, 0)
|
|
|
.eq(SysUserJzgInfo::getIsDelete, 0));
|
|
.eq(SysUserJzgInfo::getIsDelete, 0));
|
|
|
|
|
|
|
|
- if(count > 0){
|
|
|
|
|
- errorStr = "租户["+sysSystem.getSysName()+"]还有部分员工,请将这些员工变更机构或者删除后,再进行删除!";
|
|
|
|
|
|
|
+ if(CollUtil.size(sysUserJzgInfos) > 0){
|
|
|
|
|
+ String names = sysUserJzgInfos.stream().map(SysUserJzgInfo::getName).collect(Collectors.joining("、"));
|
|
|
|
|
+ errorStr = "租户["+sysSystem.getSysName()+"]还有[" + names + "]等员工,请将这些员工变更机构或者删除后,再进行删除!";
|
|
|
return errorStr;
|
|
return errorStr;
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|