|
@@ -7,6 +7,9 @@ import com.alibaba.fastjson2.JSONObject;
|
|
|
import com.alibaba.fastjson2.TypeReference;
|
|
|
import com.zjugis.framework.common.pojo.CommonResult;
|
|
|
import com.zjugis.framework.workflow.spring.SpringUtils;
|
|
|
+import com.zjugis.module.system.api.dept.dto.PostRespDTO;
|
|
|
+import com.zjugis.module.system.api.permission.RoleApi;
|
|
|
+import com.zjugis.module.system.api.permission.dto.RoleRespDto;
|
|
|
import com.zjugis.module.system.api.user.AdminUserApi;
|
|
|
import com.zjugis.module.system.api.user.dto.AdminUserRespDTO;
|
|
|
import com.zjugis.z_workflow.base.utils.ServiceApiUtils;
|
|
@@ -17,6 +20,8 @@ import org.springframework.util.CollectionUtils;
|
|
|
import java.util.*;
|
|
|
import java.util.function.Function;
|
|
|
|
|
|
+import static com.zjugis.framework.common.util.collection.CollectionUtils.convertSet;
|
|
|
+
|
|
|
/**
|
|
|
* @ClassName:
|
|
|
* @Description: 〈一句话功能简述〉
|
|
@@ -35,7 +40,8 @@ public class MethodHandler {
|
|
|
public static Function<Map<String, Object>, Set<Map<String, Object>>> getUserByDeptFun = postData -> {
|
|
|
|
|
|
AdminUserApi adminUserApi = SpringUtils.getBean(AdminUserApi.class);
|
|
|
- CommonResult<List<AdminUserRespDTO>> result = adminUserApi.getUserListByDeptIds(Collections.singleton((String) postData.get("dID")));
|
|
|
+ String deptID = (String) postData.get("dID");
|
|
|
+ CommonResult<List<AdminUserRespDTO>> result = adminUserApi.getDeptChildUserListByDeptId(deptID);
|
|
|
return handledResult(result.getCheckedData());
|
|
|
};
|
|
|
|
|
@@ -87,21 +93,27 @@ public class MethodHandler {
|
|
|
return handledResult(result.getCheckedData());
|
|
|
};
|
|
|
|
|
|
-// /**
|
|
|
-// * 指定用户所在部门
|
|
|
-// */
|
|
|
-// public static Function<Map<String, Object>, Set<Map<String, Object>>> getUserByWithDeptFun = postData -> {
|
|
|
-// String postUrl = YmlUtil.getzUserOrgRightUrl() + WorkFlowConstant.USER_API_FIND_DEPT_USER_BY_USER_ID;
|
|
|
-// return post(postUrl, postData);
|
|
|
-// };
|
|
|
-//
|
|
|
-// /**
|
|
|
-// * 指定用户所在职位
|
|
|
-// */
|
|
|
-// public static Function<Map<String, Object>, Set<Map<String, Object>>> getUserByWithPositionFun = postData -> {
|
|
|
-// String postUrl = YmlUtil.getzUserOrgRightUrl() + WorkFlowConstant.USER_API_FIND_POSITION_USER_BY_USER_ID;
|
|
|
-// return post(postUrl, postData);
|
|
|
-// };
|
|
|
+ /**
|
|
|
+ * 指定用户所在部门
|
|
|
+ */
|
|
|
+ public static Function<Map<String, Object>, Set<Map<String, Object>>> getUserByWithDeptFun = postData -> {
|
|
|
+ AdminUserApi adminUserApi = SpringUtils.getBean(AdminUserApi.class);
|
|
|
+ String id = postData.getOrDefault("id", "").toString();
|
|
|
+ AdminUserRespDTO user = adminUserApi.getUser(id).getCheckedData();
|
|
|
+ CommonResult<List<AdminUserRespDTO>> result = adminUserApi.getUserListByDeptIds(Collections.singleton(user.getDeptId()));
|
|
|
+ return handledResult(result.getCheckedData());
|
|
|
+ };
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 指定用户所在职位
|
|
|
+ */
|
|
|
+ public static Function<Map<String, Object>, Set<Map<String, Object>>> getUserByWithPositionFun = postData -> {
|
|
|
+ AdminUserApi adminUserApi = SpringUtils.getBean(AdminUserApi.class);
|
|
|
+ String id = postData.getOrDefault("id", "").toString();
|
|
|
+ AdminUserRespDTO user = adminUserApi.getUser(id).getCheckedData();
|
|
|
+ CommonResult<List<AdminUserRespDTO>> result = adminUserApi.getUserListByPostIds(user.getPostIds());
|
|
|
+ return handledResult(result.getCheckedData());
|
|
|
+ };
|
|
|
|
|
|
// /**
|
|
|
// * 指定用户所在部门职位
|
|
@@ -111,13 +123,19 @@ public class MethodHandler {
|
|
|
// return post(postUrl, postData);
|
|
|
// };
|
|
|
//
|
|
|
-// /**
|
|
|
-// * 指定用户所在角色
|
|
|
-// */
|
|
|
-// public static Function<Map<String, Object>, Set<Map<String, Object>>> getUserByWithRoleFun = postData -> {
|
|
|
-// String postUrl = YmlUtil.getzUserOrgRightUrl() + WorkFlowConstant.USER_API_FIND_ROLE_USER_BY_USER_ID;
|
|
|
-// return post(postUrl, postData);
|
|
|
-// };
|
|
|
+ /**
|
|
|
+ * 指定用户所在角色
|
|
|
+ */
|
|
|
+ public static Function<Map<String, Object>, Set<Map<String, Object>>> getUserByWithRoleFun = postData -> {
|
|
|
+ AdminUserApi adminUserApi = SpringUtils.getBean(AdminUserApi.class);
|
|
|
+ RoleApi roleApi = SpringUtils.getBean(RoleApi.class);
|
|
|
+ String id = postData.getOrDefault("id", "").toString();
|
|
|
+ AdminUserRespDTO user = adminUserApi.getUser(id).getCheckedData();
|
|
|
+ List<RoleRespDto> roleList = roleApi.getRoleByUser(user.getId()).getCheckedData();
|
|
|
+ Set<Long> roleIds = convertSet(roleList, RoleRespDto::getId);
|
|
|
+ CommonResult<List<AdminUserRespDTO>> result = adminUserApi.getUserListByRoleIds(roleIds);
|
|
|
+ return handledResult(result.getCheckedData());
|
|
|
+ };
|
|
|
|
|
|
/**
|
|
|
* 指定用户的分管领导
|