|
@@ -1,6 +1,7 @@
|
|
|
package cn.iocoder.yudao.module.system.controller.admin.user;
|
|
package cn.iocoder.yudao.module.system.controller.admin.user;
|
|
|
|
|
|
|
|
import cn.hutool.core.collection.CollUtil;
|
|
import cn.hutool.core.collection.CollUtil;
|
|
|
|
|
+import cn.hutool.core.util.ObjUtil;
|
|
|
import cn.iocoder.yudao.framework.common.enums.UserTypeEnum;
|
|
import cn.iocoder.yudao.framework.common.enums.UserTypeEnum;
|
|
|
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
|
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
|
|
import cn.iocoder.yudao.framework.datapermission.core.annotation.DataPermission;
|
|
import cn.iocoder.yudao.framework.datapermission.core.annotation.DataPermission;
|
|
@@ -29,6 +30,7 @@ import org.springframework.web.multipart.MultipartFile;
|
|
|
import javax.annotation.Resource;
|
|
import javax.annotation.Resource;
|
|
|
import javax.validation.Valid;
|
|
import javax.validation.Valid;
|
|
|
import java.util.List;
|
|
import java.util.List;
|
|
|
|
|
+import java.util.Set;
|
|
|
|
|
|
|
|
import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
|
|
import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
|
|
|
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
|
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
|
@@ -65,11 +67,21 @@ public class UserProfileController {
|
|
|
List<RoleDO> userRoles = roleService.getRoleListFromCache(permissionService.getUserRoleIdListByUserId(user.getId()));
|
|
List<RoleDO> userRoles = roleService.getRoleListFromCache(permissionService.getUserRoleIdListByUserId(user.getId()));
|
|
|
// 获得部门信息
|
|
// 获得部门信息
|
|
|
DeptDO dept = user.getDeptId() != null ? deptService.getDept(user.getDeptId()) : null;
|
|
DeptDO dept = user.getDeptId() != null ? deptService.getDept(user.getDeptId()) : null;
|
|
|
|
|
+ boolean rdReportFlag = false;
|
|
|
|
|
+ // 获取当前登录人的公司级部门 如果 是 四川瑞都163 则设置 标识 rdReportFlag = true
|
|
|
|
|
+ // 查询瑞都下所有部门
|
|
|
|
|
+ Set<Long> childDeptIds = deptService.getChildDeptIdListFromCache(163l);
|
|
|
|
|
+ childDeptIds.add(163l);
|
|
|
|
|
+ if (ObjUtil.isNotEmpty(dept)) {
|
|
|
|
|
+ if (childDeptIds.contains(dept.getId())) {
|
|
|
|
|
+ rdReportFlag = true;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
// 获得岗位信息
|
|
// 获得岗位信息
|
|
|
List<PostDO> posts = CollUtil.isNotEmpty(user.getPostIds()) ? postService.getPostList(user.getPostIds()) : null;
|
|
List<PostDO> posts = CollUtil.isNotEmpty(user.getPostIds()) ? postService.getPostList(user.getPostIds()) : null;
|
|
|
// 获得社交用户信息
|
|
// 获得社交用户信息
|
|
|
List<SocialUserDO> socialUsers = socialService.getSocialUserList(user.getId(), UserTypeEnum.ADMIN.getValue());
|
|
List<SocialUserDO> socialUsers = socialService.getSocialUserList(user.getId(), UserTypeEnum.ADMIN.getValue());
|
|
|
- return success(UserConvert.INSTANCE.convert(user, userRoles, dept, posts, socialUsers));
|
|
|
|
|
|
|
+ return success(UserConvert.INSTANCE.convert(user, userRoles, dept, posts, socialUsers, rdReportFlag));
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
@PutMapping("/update")
|
|
@PutMapping("/update")
|