增加 CRM 模块

This commit is contained in:
YunaiV
2024-02-17 23:25:41 +08:00
parent 5f53986d5e
commit 0e55c4da6d
270 changed files with 17975 additions and 9 deletions

View File

@@ -43,9 +43,14 @@ public interface DeptApi {
* @param ids 部门编号数组
* @return 部门 Map
*/
default Map<Long, DeptRespDTO> getDeptMap(Set<Long> ids) {
default Map<Long, DeptRespDTO> getDeptMap(Collection<Long> ids) {
List<DeptRespDTO> list = getDeptList(ids).getCheckedData();
return CollectionUtils.convertMap(list, DeptRespDTO::getId);
}
@GetMapping(PREFIX + "/list-child")
@Operation(summary = "获得指定部门的所有子部门")
@Parameter(name = "id", description = "部门编号", example = "1024", required = true)
CommonResult<List<DeptRespDTO>> getChildDeptList(@RequestParam("id") Long id);
}

View File

@@ -1,6 +1,10 @@
package cn.iocoder.yudao.module.system.api.dept;
import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.map.MapUtil;
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
import cn.iocoder.yudao.framework.common.util.collection.CollectionUtils;
import cn.iocoder.yudao.module.system.api.dept.dto.PostRespDTO;
import cn.iocoder.yudao.module.system.enums.ApiConstants;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
@@ -10,6 +14,8 @@ import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
import java.util.Collection;
import java.util.List;
import java.util.Map;
@FeignClient(name = ApiConstants.NAME) // TODO 芋艿fallbackFactory =
@Tag(name = "RPC 服务 - 岗位")
@@ -22,4 +28,18 @@ public interface PostApi {
@Parameter(name = "ids", description = "岗位编号数组", example = "1,2", required = true)
CommonResult<Boolean> validPostList(@RequestParam("ids") Collection<Long> ids);
@GetMapping(PREFIX + "/list")
@Operation(summary = "获得岗位列表")
@Parameter(name = "ids", description = "岗位编号数组", example = "1,2", required = true)
CommonResult<List<PostRespDTO>> getPostList(@RequestParam("ids") Collection<Long> ids);
default Map<Long, PostRespDTO> getPostMap(Collection<Long> ids) {
if (CollUtil.isEmpty(ids)) {
return MapUtil.empty();
}
List<PostRespDTO> list = getPostList(ids).getData();
return CollectionUtils.convertMap(list, PostRespDTO::getId);
}
}

View File

@@ -0,0 +1,30 @@
package cn.iocoder.yudao.module.system.api.dept.dto;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
/**
* 岗位 Response DTO
*
* @author 芋道源码
*/
@Schema(description = "RPC 服务 - 岗位 Response DTO")
@Data
public class PostRespDTO {
@Schema(description = "岗位编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
private Long id;
@Schema(description = "岗位名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "小土豆")
private String name;
@Schema(description = "岗位编码", requiredMode = Schema.RequiredMode.REQUIRED, example = "yudao")
private String code;
@Schema(description = "岗位排序", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
private Integer sort;
@Schema(description = "状态", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
private Integer status; // 参见 CommonStatusEnum 枚举
}

View File

@@ -24,6 +24,11 @@ public interface AdminUserApi {
@Parameter(name = "id", description = "用户编号", example = "1", required = true)
CommonResult<AdminUserRespDTO> getUser(@RequestParam("id") Long id);
@GetMapping(PREFIX + "/list-by-subordinate")
@Operation(summary = "通过用户 ID 查询用户下属")
@Parameter(name = "id", description = "用户编号", example = "1", required = true)
CommonResult<List<AdminUserRespDTO>> getUserListBySubordinate(@RequestParam("id") Long id);
@GetMapping(PREFIX + "/list")
@Operation(summary = "通过用户 ID 查询用户们")
@Parameter(name = "ids", description = "部门编号数组", example = "1,2", required = true)
@@ -64,6 +69,6 @@ public interface AdminUserApi {
@GetMapping(PREFIX + "/valid")
@Operation(summary = "校验用户们是否有效")
@Parameter(name = "ids", description = "用户编号数组", example = "3,5", required = true)
CommonResult<Boolean> validateUserList(@RequestParam("ids") Set<Long> ids);
CommonResult<Boolean> validateUserList(@RequestParam("ids") Collection<Long> ids);
}