|
@@ -5,6 +5,7 @@ import cn.hutool.core.util.ObjectUtil;
|
|
|
import cn.hutool.core.util.StrUtil;
|
|
|
import com.alibaba.fastjson2.JSONObject;
|
|
|
import com.baomidou.dynamic.datasource.annotation.DS;
|
|
|
+import com.fjhx.tenant.utils.DeptUstil;
|
|
|
import com.ruoyi.common.annotation.RepeatSubmit;
|
|
|
import com.ruoyi.common.annotation.TenantIgnore;
|
|
|
import com.ruoyi.common.constant.BaseSourceConstant;
|
|
@@ -86,7 +87,7 @@ public class UserTenantController extends BaseController {
|
|
|
user.setPassword(SecurityUtils.encryptPassword(user.getPassword()));
|
|
|
|
|
|
//赋值归属公司
|
|
|
- user.setCompanyId(getCompanyByDeptId(user.getDeptId()).getDeptId());
|
|
|
+ user.setCompanyId(DeptUstil.getCompanyByDeptId(user.getDeptId()).getDeptId());
|
|
|
|
|
|
userService.insertUser(user);
|
|
|
}
|
|
@@ -120,22 +121,11 @@ public class UserTenantController extends BaseController {
|
|
|
}
|
|
|
|
|
|
//赋值归属公司
|
|
|
- user.setCompanyId(getCompanyByDeptId(user.getDeptId()).getDeptId());
|
|
|
+ user.setCompanyId(DeptUstil.getCompanyByDeptId(user.getDeptId()).getDeptId());
|
|
|
|
|
|
userService.updateUser(user);
|
|
|
}
|
|
|
|
|
|
- private SysDept getCompanyByDeptId(Long deptId) {
|
|
|
- SysDept dept = sysDeptService.getById(deptId);
|
|
|
- if (ObjectUtil.isEmpty(dept)) {
|
|
|
- throw new ServiceException("查询不到该部门公司信息");
|
|
|
- }
|
|
|
- if (Objects.equals(dept.getType(), 0)) {
|
|
|
- return dept;
|
|
|
- }
|
|
|
- return getCompanyByDeptId(dept.getParentId());
|
|
|
- }
|
|
|
-
|
|
|
/**
|
|
|
* 修改用户业务员编号
|
|
|
*/
|