|
|
|
@ -71,24 +71,24 @@ public class SysUserController extends BaseController {
|
|
|
|
|
AuthAdminResponse authAdminResponse = new AuthAdminResponse();
|
|
|
|
|
BeanUtils.copyProperties(item, authAdminResponse);
|
|
|
|
|
List<Long> roles = sysRoleService.selectRoleListByUserId(authAdminResponse.getId());
|
|
|
|
|
List<DeptUserResponse> deptUserResponses=null;
|
|
|
|
|
if("key".equals(filterAuthUserRequest.getKey())){
|
|
|
|
|
List<DeptUserResponse> deptUserResponses = null;
|
|
|
|
|
if ("key".equals(filterAuthUserRequest.getKey())) {
|
|
|
|
|
deptUserResponses = deptUserService.selectByUserIdKey(authAdminResponse.getId());
|
|
|
|
|
}else{
|
|
|
|
|
} else {
|
|
|
|
|
deptUserResponses = deptUserService.selectByUserId(authAdminResponse.getId());
|
|
|
|
|
}
|
|
|
|
|
if (CollUtil.isNotEmpty(deptUserResponses)) {
|
|
|
|
|
List<Long> depts = new ArrayList<>();
|
|
|
|
|
String deptName = "";
|
|
|
|
|
for (DeptUserResponse deptUserResponse : deptUserResponses) {
|
|
|
|
|
if(deptUserResponse.getDeptId()!=1){
|
|
|
|
|
if (deptUserResponse.getDeptId() != 1) {
|
|
|
|
|
depts.add(deptUserResponse.getDeptId());
|
|
|
|
|
deptName = deptName + "," + deptUserResponse.getDeptName();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if(deptName.length()!=0){
|
|
|
|
|
if (deptName.length() != 0) {
|
|
|
|
|
authAdminResponse.setDeptName(deptName.substring(1));
|
|
|
|
|
}else{
|
|
|
|
|
} else {
|
|
|
|
|
authAdminResponse.setDeptName(deptName);
|
|
|
|
|
}
|
|
|
|
|
authAdminResponse.setDepts(depts);
|
|
|
|
@ -190,9 +190,9 @@ public class SysUserController extends BaseController {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//默认插入第一部门
|
|
|
|
|
List<Long> deptCodeList=authUserSaveRequest.getDepts();
|
|
|
|
|
if(deptCodeList == null){
|
|
|
|
|
deptCodeList=new ArrayList<>();
|
|
|
|
|
List<Long> deptCodeList = authUserSaveRequest.getDepts();
|
|
|
|
|
if (deptCodeList == null) {
|
|
|
|
|
deptCodeList = new ArrayList<>();
|
|
|
|
|
}
|
|
|
|
|
deptCodeList.add(1L);
|
|
|
|
|
authUserSaveRequest.setDepts(deptCodeList);
|
|
|
|
@ -270,19 +270,19 @@ public class SysUserController extends BaseController {
|
|
|
|
|
FilterDeptUserReqeust filterDeptUserReqeust = new FilterDeptUserReqeust();
|
|
|
|
|
filterDeptUserReqeust.setUserId(authUserSaveRequest.getId());
|
|
|
|
|
List<DeptUserEntity> deptUserEntities = deptUserService.selectDeptUser(filterDeptUserReqeust);
|
|
|
|
|
if(deptUserEntities == null){
|
|
|
|
|
if (deptUserEntities == null) {
|
|
|
|
|
deptCodeList.add(1L);
|
|
|
|
|
authUserSaveRequest.setDepts(deptCodeList);
|
|
|
|
|
}else{
|
|
|
|
|
Boolean checkDeptId=false;
|
|
|
|
|
} else {
|
|
|
|
|
Boolean checkDeptId = false;
|
|
|
|
|
for (DeptUserEntity deptUserEntity : deptUserEntities) {
|
|
|
|
|
if(deptUserEntity.getDeptId() == 1){
|
|
|
|
|
checkDeptId=true;
|
|
|
|
|
}else{
|
|
|
|
|
if (deptUserEntity.getDeptId() == 1) {
|
|
|
|
|
checkDeptId = true;
|
|
|
|
|
} else {
|
|
|
|
|
deptCodeList.add(deptUserEntity.getDeptId());
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if(checkDeptId==false){
|
|
|
|
|
if (checkDeptId == false) {
|
|
|
|
|
deptCodeList.add(1L);
|
|
|
|
|
authUserSaveRequest.setDepts(deptCodeList);
|
|
|
|
|
}
|
|
|
|
|