Merge branch 'master-jdk21' of https://gitee.com/zhijiantianya/ruoyi-vue-pro
This commit is contained in:
commit
123a009394
|
@ -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");
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,4 @@
|
||||||
|
/**
|
||||||
|
* trade 模块的 web 配置
|
||||||
|
*/
|
||||||
|
package cn.iocoder.yudao.module.crm.framework.web;
|
|
@ -26,10 +26,10 @@ public interface AdminUserApi {
|
||||||
/**
|
/**
|
||||||
* 通过用户 ID 查询用户下属
|
* 通过用户 ID 查询用户下属
|
||||||
*
|
*
|
||||||
* @param userId 用户编号
|
* @param id 用户编号
|
||||||
* @return 用户下属用户列表
|
* @return 用户下属用户列表
|
||||||
*/
|
*/
|
||||||
List<AdminUserRespDTO> getUserListBySubordinate(Long userId);
|
List<AdminUserRespDTO> getUserListBySubordinate(Long id);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 通过用户 ID 查询用户们
|
* 通过用户 ID 查询用户们
|
||||||
|
|
|
@ -38,9 +38,9 @@ public class AdminUserApiImpl implements AdminUserApi {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<AdminUserRespDTO> getUserListBySubordinate(Long userId) {
|
public List<AdminUserRespDTO> getUserListBySubordinate(Long id) {
|
||||||
// 1.1 获取用户负责的部门
|
// 1.1 获取用户负责的部门
|
||||||
AdminUserDO user = userService.getUser(userId);
|
AdminUserDO user = userService.getUser(id);
|
||||||
if (user == null) {
|
if (user == null) {
|
||||||
return Collections.emptyList();
|
return Collections.emptyList();
|
||||||
}
|
}
|
||||||
|
@ -49,7 +49,7 @@ public class AdminUserApiImpl implements AdminUserApi {
|
||||||
if (dept == null) {
|
if (dept == null) {
|
||||||
return Collections.emptyList();
|
return Collections.emptyList();
|
||||||
}
|
}
|
||||||
if (ObjUtil.notEqual(dept.getLeaderUserId(), userId)) { // 校验为负责人
|
if (ObjUtil.notEqual(dept.getLeaderUserId(), id)) { // 校验为负责人
|
||||||
return Collections.emptyList();
|
return Collections.emptyList();
|
||||||
}
|
}
|
||||||
deptIds.add(dept.getId());
|
deptIds.add(dept.getId());
|
||||||
|
@ -61,7 +61,7 @@ public class AdminUserApiImpl implements AdminUserApi {
|
||||||
|
|
||||||
// 2. 获取部门对应的用户信息
|
// 2. 获取部门对应的用户信息
|
||||||
List<AdminUserDO> users = userService.getUserListByDeptIds(deptIds);
|
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);
|
return BeanUtils.toBean(users, AdminUserRespDTO.class);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue