Quellcode durchsuchen

Merge branch 'develop' of gitadmin/tuoheng_freeway into release

tags/V1.3.3
wanjing vor 1 Jahr
Ursprung
Commit
b0968031c9
3 geänderte Dateien mit 32 neuen und 7 gelöschten Zeilen
  1. +5
    -0
      tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/request/user/QueryUserPageListRequest.java
  2. +14
    -2
      tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/service/dept/query/QueryListTreeByDeptIdService.java
  3. +13
    -5
      tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/service/user/query/QueryUserPageListService.java

+ 5
- 0
tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/request/user/QueryUserPageListRequest.java Datei anzeigen

@@ -31,6 +31,11 @@ public class QueryUserPageListRequest extends BaseQuery {
*/
private Integer roleId;

/**
* 部门ID
*/
private String deptId;

/**
* 部门及子部门Id列表
*/

+ 14
- 2
tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/service/dept/query/QueryListTreeByDeptIdService.java Datei anzeigen

@@ -7,6 +7,7 @@ import com.tuoheng.admin.constant.SystemConstant;
import com.tuoheng.admin.conver.DeptConverMapper;
import com.tuoheng.admin.entity.Dept;
import com.tuoheng.admin.entity.User;
import com.tuoheng.admin.enums.DataPermissionEnum;
import com.tuoheng.admin.enums.code.dept.QueryDeptTreeListCodeEnum;
import com.tuoheng.admin.mapper.DeptMapper;
import com.tuoheng.admin.utils.CurrentUserUtil;
@@ -44,8 +45,19 @@ public class QueryListTreeByDeptIdService {
public JsonResult getListTree(String deptId) {
List<DeptTreeVo> deptTreeVoList = new ArrayList<>();
User user = CurrentUserUtil.getUserInfo();
// 查询当前部门下所有有效的部门数据
List<String> deptIdList = deptMapper.selectAllChildListById(user.getDeptId());

List<String> deptIdList;
if (DataPermissionEnum.ALL.getCode() == user.getDataPermission() || DataPermissionEnum.DEPT_AND_SUB_DEPT.getCode() == user.getDataPermission()) {
deptIdList = deptMapper.selectAllChildListById(deptId);
} else {
deptIdList = new ArrayList<>();
deptIdList.add(user.getDeptId());
}
if (CollectionUtil.isEmpty(deptIdList)) {
log.info("获取部门列表为空");
return JsonResult.success();
}

List<Dept> deptList = deptMapper.selectListByIdList(deptIdList);
// 找出当前部门
Dept currentDept = deptList.stream()

+ 13
- 5
tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/service/user/query/QueryUserPageListService.java Datei anzeigen

@@ -16,10 +16,12 @@ import com.tuoheng.admin.request.user.QueryUserPageListRequest;
import com.tuoheng.admin.utils.CurrentUserUtil;
import com.tuoheng.admin.vo.user.UserPageListVo;
import com.tuoheng.common.core.utils.JsonResult;
import com.tuoheng.common.core.utils.StringUtils;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.function.Function;
@@ -62,7 +64,7 @@ public class QueryUserPageListService {
String tenantId = user.getTenantId();
request.setTenantId(tenantId);

List<String> deptIdList = this.getDeptIdList(user);
List<String> deptIdList = this.getDeptIdList(user, request.getDeptId());
request.setDeptIdList(deptIdList);

// 查询分页数据
@@ -110,14 +112,20 @@ public class QueryUserPageListService {
* @param user
* @return
*/
private List<String> getDeptIdList(User user) {
List<String> deptIdList;
private List<String> getDeptIdList(User user, String deptId) {
List<String> deptIdList = new ArrayList<>();
if (StringUtils.isNotEmpty(deptId)) {
deptIdList.add(deptId);
return deptIdList;
}
if (DataPermissionEnum.ALL.getCode() == user.getDataPermission()) {
return null;
} else {
} else if (DataPermissionEnum.DEPT_AND_SUB_DEPT.getCode() == user.getDataPermission()) {
deptIdList = deptMapper.selectAllChildListById(user.getDeptId());
return deptIdList;
} else if (DataPermissionEnum.DEPT.getCode() == user.getDataPermission()) {
deptIdList.add(user.getDeptId());
}
return deptIdList;
}

/**

Laden…
Abbrechen
Speichern