Hotfix/bug repair

This commit is contained in:
徐文波
2020-05-01 18:03:31 +08:00
parent 1a6e7b0887
commit 52dc1a5d83
29 changed files with 500 additions and 142 deletions

View File

@ -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;
}
}
}

View File

@ -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