|
|
@@ -551,14 +551,14 @@ public class AdminUserServiceImpl implements AdminUserService {
|
|
|
|
|
|
// 2.2.1 判断如果不存在,在进行插入
|
|
|
AdminUserDO existUser = userMapper.selectByUsername(importUser.getUsername());
|
|
|
+ //部门
|
|
|
+ DeptDO dept = deptService.getDeptByCode(importUser.getDeptId());
|
|
|
+ if (dept == null) {
|
|
|
+ respVO.getFailureUsernames().put(importUser.getUsername(), DEPT_NOT_FOUND.getMsg());
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ importUser.setDeptId(dept.getId());
|
|
|
if (existUser == null) {
|
|
|
-
|
|
|
- DeptDO dept = deptService.getDeptByCode(importUser.getDeptId());
|
|
|
- if (dept == null) {
|
|
|
- respVO.getFailureUsernames().put(importUser.getUsername(), DEPT_NOT_FOUND.getMsg());
|
|
|
- return;
|
|
|
- }
|
|
|
- importUser.setDeptId(dept.getId());
|
|
|
userMapper.insert(BeanUtils.toBean(importUser, AdminUserDO.class)
|
|
|
.setPassword(encodePassword(initPassword)).setPostIds(new HashSet<>())); // 设置默认密码及空岗位编号数组
|
|
|
respVO.getCreateUsernames().add(importUser.getUsername());
|