| | |
| | | @Override |
| | | public String checkUserNameUnique(SysUser user) { |
| | | Long userId = StringUtils.isNull(user.getUserId()) ? -1L : user.getUserId(); |
| | | SysUser info = userMapper.checkUserNameUnique(user.getUserName()); |
| | | SysUser info = userMapper.checkUserNameUnique(user); |
| | | if (StringUtils.isNotNull(info) && info.getUserId().longValue() != userId.longValue()) { |
| | | return UserConstants.NOT_UNIQUE; |
| | | } |
| | |
| | | // } |
| | | if (!CollectionUtils.isEmpty(user.getDeptCodes())) { |
| | | for (String deptCode : user.getDeptCodes()) { |
| | | SysDept sysDept = sysDeptMapper.selectDeptByCode(deptCode); |
| | | SysDept sysDept = sysDeptMapper.selectDeptByCode(user.getOrgid(), deptCode); |
| | | if (ObjectUtils.isEmpty(sysDept)) { |
| | | continue; |
| | | } |
| | |
| | | } |
| | | if (!CollectionUtils.isEmpty(user.getWardCodes())) { |
| | | for (String wardCode : user.getWardCodes()) { |
| | | SysDept sysDept = sysDeptMapper.selectDeptByCode(wardCode); |
| | | SysDept sysDept = sysDeptMapper.selectDeptByCode(user.getOrgid(), wardCode); |
| | | if (ObjectUtils.isEmpty(sysDept)) { |
| | | continue; |
| | | } |
| | |
| | | // } |
| | | if (!CollectionUtils.isEmpty(user.getDeptCodes())) { |
| | | for (String deptCode : user.getDeptCodes()) { |
| | | SysDept sysDept = sysDeptMapper.selectDeptByCode(deptCode); |
| | | SysDept sysDept = sysDeptMapper.selectDeptByCode(user.getOrgid(), deptCode); |
| | | if (ObjectUtils.isEmpty(sysDept)) { |
| | | continue; |
| | | } |
| | |
| | | } |
| | | if (!CollectionUtils.isEmpty(user.getWardCodes())) { |
| | | for (String wardCode : user.getWardCodes()) { |
| | | SysDept sysDept = sysDeptMapper.selectDeptByCode(wardCode); |
| | | SysDept sysDept = sysDeptMapper.selectDeptByCode(user.getOrgid(), wardCode); |
| | | if (ObjectUtils.isEmpty(sysDept)) { |
| | | continue; |
| | | } |