Hotfix/bug repair
This commit is contained in:
@ -72,6 +72,7 @@ public class DeptServiceImpl implements DeptService {
|
||||
Set<DeptDTO> depts= new LinkedHashSet<>();
|
||||
List<String> deptNames = deptDtos.stream().map(DeptDTO::getName).collect(Collectors.toList());
|
||||
boolean isChild;
|
||||
List<Dept> deptList = deptRepository.findAll();
|
||||
for (DeptDTO deptDTO : deptDtos) {
|
||||
isChild = false;
|
||||
if ("0".equals(deptDTO.getPid().toString())) {
|
||||
@ -88,8 +89,11 @@ public class DeptServiceImpl implements DeptService {
|
||||
}
|
||||
if(isChild) {
|
||||
depts.add(deptDTO);
|
||||
} else if(!deptNames.contains(deptRepository.findNameById(deptDTO.getPid()))) {
|
||||
depts.add(deptDTO);
|
||||
for (Dept dept : deptList) {
|
||||
if(dept.getId() == deptDTO.getPid() && !deptNames.contains(dept.getName())){
|
||||
depts.add(deptDTO);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -158,4 +162,4 @@ public class DeptServiceImpl implements DeptService {
|
||||
}
|
||||
return deptDtos;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -49,7 +49,7 @@ spring:
|
||||
database: 0
|
||||
host: 127.0.0.1
|
||||
port: 6379
|
||||
password:
|
||||
password: root
|
||||
#连接超时时间
|
||||
timeout: 5000
|
||||
|
||||
@ -82,9 +82,9 @@ swagger:
|
||||
|
||||
# 文件存储路径
|
||||
file:
|
||||
path: E:\yshop\file\
|
||||
avatar: E:\yshop\avatar\
|
||||
path: D:\yshop\file\
|
||||
avatar: D:\yshop\avatar\
|
||||
# 文件大小 /M
|
||||
maxSize: 100
|
||||
avatarMaxSize: 5
|
||||
localUrl: http://localhost:8000
|
||||
localUrl: http://localhost:8000
|
||||
|
Reference in New Issue
Block a user