|
@@ -5,6 +5,7 @@ import java.util.List;
|
|
|
import java.util.stream.Collectors;
|
|
import java.util.stream.Collectors;
|
|
|
import javax.validation.Validator;
|
|
import javax.validation.Validator;
|
|
|
|
|
|
|
|
|
|
+import com.ruoyi.common.core.domain.entity.SysDept;
|
|
|
import com.ruoyi.common.enums.UserRolesType;
|
|
import com.ruoyi.common.enums.UserRolesType;
|
|
|
import com.ruoyi.project.domain.ProjectStaff;
|
|
import com.ruoyi.project.domain.ProjectStaff;
|
|
|
import com.ruoyi.project.domain.ProjectTask;
|
|
import com.ruoyi.project.domain.ProjectTask;
|
|
@@ -603,7 +604,8 @@ public class SysUserServiceImpl implements ISysUserService
|
|
|
|
|
|
|
|
@Override
|
|
@Override
|
|
|
public boolean checkJobNumber(SysUser user) {
|
|
public boolean checkJobNumber(SysUser user) {
|
|
|
- SysUser sysUser = userMapper.checkJobNumber(user.getJobNumber());
|
|
|
|
|
|
|
+ Long companyId = getCompany(user.getDeptId());
|
|
|
|
|
+ SysUser sysUser = userMapper.checkJobNumber(user.getJobNumber(),companyId);
|
|
|
if (StringUtils.isNotNull(user.getUserId())&&user.getUserId().equals(sysUser.getUserId())){
|
|
if (StringUtils.isNotNull(user.getUserId())&&user.getUserId().equals(sysUser.getUserId())){
|
|
|
return false;
|
|
return false;
|
|
|
}else {
|
|
}else {
|
|
@@ -612,4 +614,12 @@ public class SysUserServiceImpl implements ISysUserService
|
|
|
return false;
|
|
return false;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ private Long getCompany(Long deptId) {
|
|
|
|
|
+ SysDept sysDept = deptService.selectDeptById(deptId);
|
|
|
|
|
+ String ancestors = sysDept.getAncestors();
|
|
|
|
|
+ String[] split = ancestors.split(",");
|
|
|
|
|
+ if (split.length>2)return Long.valueOf(split[2]);
|
|
|
|
|
+ else return deptId;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
}
|
|
}
|