|
|
|
@ -161,9 +161,12 @@ public class SysDeptServiceImpl implements ISysDeptService {
|
|
|
|
|
* @param deptId 部门ID
|
|
|
|
|
* @return 部门信息
|
|
|
|
|
*/
|
|
|
|
|
@Cacheable(cacheNames = CacheNames.SYS_DEPT, key = "#deptId")
|
|
|
|
|
@Cacheable(cacheNames = CacheNames.SYS_DEPT, key = "#deptId", condition = "#deptId != null")
|
|
|
|
|
@Override
|
|
|
|
|
public SysDeptVo selectDeptById(Long deptId) {
|
|
|
|
|
if (ObjectUtil.isNull(deptId)) {
|
|
|
|
|
return null;
|
|
|
|
|
}
|
|
|
|
|
SysDeptVo dept = baseMapper.selectVoById(deptId);
|
|
|
|
|
if (ObjectUtil.isNull(dept)) {
|
|
|
|
|
return null;
|
|
|
|
@ -198,9 +201,11 @@ public class SysDeptServiceImpl implements ISysDeptService {
|
|
|
|
|
public String selectDeptNameByIds(String deptIds) {
|
|
|
|
|
List<String> list = new ArrayList<>();
|
|
|
|
|
for (Long id : StringUtils.splitTo(deptIds, Convert::toLong)) {
|
|
|
|
|
SysDeptVo vo = SpringUtils.getAopProxy(this).selectDeptById(id);
|
|
|
|
|
if (ObjectUtil.isNotNull(vo)) {
|
|
|
|
|
list.add(vo.getDeptName());
|
|
|
|
|
if (ObjectUtil.isNotNull(id)) {
|
|
|
|
|
SysDeptVo vo = SpringUtils.getAopProxy(this).selectDeptById(id);
|
|
|
|
|
if (ObjectUtil.isNotNull(vo)) {
|
|
|
|
|
list.add(vo.getDeptName());
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return String.join(StringUtils.SEPARATOR, list);
|
|
|
|
|