Skip to content

Commit

Permalink
Merge branch 'master-jdk21' of https://gitee.com/zhijiantianya/ruoyi-…
Browse files Browse the repository at this point in the history
  • Loading branch information
YunaiV committed Feb 17, 2024
2 parents 08c2594 + 21452af commit 123a009
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 6 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
package cn.iocoder.yudao.module.crm.framework.web.config;

import cn.iocoder.yudao.framework.swagger.config.YudaoSwaggerAutoConfiguration;
import org.springdoc.core.models.GroupedOpenApi;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
* crm 模块的 web 组件的 Configuration
*
* @author 芋道源码
*/
@Configuration(proxyBeanMethods = false)
public class CrmWebConfiguration {

/**
* crm 模块的 API 分组
*/
@Bean
public GroupedOpenApi crmGroupedOpenApi() {
return YudaoSwaggerAutoConfiguration.buildGroupedOpenApi("crm");
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
/**
* trade 模块的 web 配置
*/
package cn.iocoder.yudao.module.crm.framework.web;
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,10 @@ public interface AdminUserApi {
/**
* 通过用户 ID 查询用户下属
*
* @param userId 用户编号
* @param id 用户编号
* @return 用户下属用户列表
*/
List<AdminUserRespDTO> getUserListBySubordinate(Long userId);
List<AdminUserRespDTO> getUserListBySubordinate(Long id);

/**
* 通过用户 ID 查询用户们
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,9 @@ public AdminUserRespDTO getUser(Long id) {
}

@Override
public List<AdminUserRespDTO> getUserListBySubordinate(Long userId) {
public List<AdminUserRespDTO> getUserListBySubordinate(Long id) {
// 1.1 获取用户负责的部门
AdminUserDO user = userService.getUser(userId);
AdminUserDO user = userService.getUser(id);
if (user == null) {
return Collections.emptyList();
}
Expand All @@ -49,7 +49,7 @@ public List<AdminUserRespDTO> getUserListBySubordinate(Long userId) {
if (dept == null) {
return Collections.emptyList();
}
if (ObjUtil.notEqual(dept.getLeaderUserId(), userId)) { // 校验为负责人
if (ObjUtil.notEqual(dept.getLeaderUserId(), id)) { // 校验为负责人
return Collections.emptyList();
}
deptIds.add(dept.getId());
Expand All @@ -61,7 +61,7 @@ public List<AdminUserRespDTO> getUserListBySubordinate(Long userId) {

// 2. 获取部门对应的用户信息
List<AdminUserDO> users = userService.getUserListByDeptIds(deptIds);
users.removeIf(item -> ObjUtil.equal(item.getId(), userId)); // 排除自己
users.removeIf(item -> ObjUtil.equal(item.getId(), id)); // 排除自己
return BeanUtils.toBean(users, AdminUserRespDTO.class);
}

Expand Down

0 comments on commit 123a009

Please sign in to comment.