1. 统一包名修改

This commit is contained in:
chenbowen
2025-09-22 11:55:27 +08:00
parent a001fc8f16
commit 0d46897482
2739 changed files with 512 additions and 512 deletions

24
zt-module-system/pom.xml Normal file
View File

@@ -0,0 +1,24 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<groupId>com.zt.plat</groupId>
<artifactId>zt</artifactId>
<version>${revision}</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<modules>
<module>zt-module-system-api</module>
<module>zt-module-system-server</module>
</modules>
<artifactId>zt-module-system</artifactId>
<packaging>pom</packaging>
<name>${project.artifactId}</name>
<description>
system 模块下,我们放通用业务,支撑上层的核心业务。
例如说:用户、部门、权限、数据字典等等
</description>
</project>

View File

@@ -0,0 +1,48 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<groupId>com.zt.plat</groupId>
<artifactId>zt-module-system</artifactId>
<version>${revision}</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>zt-module-system-api</artifactId>
<packaging>jar</packaging>
<name>${project.artifactId}</name>
<description>
system 模块 API暴露给其它模块调用
</description>
<dependencies>
<dependency>
<groupId>com.zt.plat</groupId>
<artifactId>zt-common</artifactId>
</dependency>
<!-- Web 相关 -->
<dependency>
<groupId>org.springdoc</groupId> <!-- 接口文档:使用最新版本的 Swagger 模型 -->
<artifactId>springdoc-openapi-starter-webmvc-api</artifactId>
<scope>provided</scope>
</dependency>
<!-- 参数校验 -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-validation</artifactId>
<optional>true</optional>
</dependency>
<!-- RPC 远程调用相关 -->
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-openfeign</artifactId>
<optional>true</optional>
</dependency>
</dependencies>
</project>

View File

@@ -0,0 +1,89 @@
package com.zt.plat.module.system.api.dept;
import com.zt.plat.framework.common.pojo.CommonResult;
import com.zt.plat.framework.common.util.collection.CollectionUtils;
import com.zt.plat.module.system.api.dept.dto.*;
import com.zt.plat.module.system.enums.ApiConstants;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;
import java.util.Collection;
import java.util.List;
import java.util.Map;
import java.util.Set;
@FeignClient(name = ApiConstants.NAME) // TODO 芋艿fallbackFactory =
@Tag(name = "RPC 服务 - 部门")
public interface DeptApi {
String PREFIX = ApiConstants.PREFIX + "/dept";
// === 以下为补全的接口方法 ===
@PostMapping(PREFIX + "/create")
@Operation(summary = "新增部门")
CommonResult<Long> createDept(@RequestBody DeptSaveReqDTO createReqVO);
@PutMapping(PREFIX + "/update")
@Operation(summary = "修改部门")
CommonResult<Boolean> updateDept(@RequestBody DeptSaveReqDTO updateReqVO);
@DeleteMapping(PREFIX + "/delete")
@Operation(summary = "删除部门")
CommonResult<Boolean> deleteDept(@RequestParam("id") Long id);
@PostMapping(PREFIX + "/list-all")
@Operation(summary = "获得部门列表")
CommonResult<List<DeptDetailRespDTO>> getDeptList(@RequestBody DeptListReqDTO reqVO);
@GetMapping(PREFIX + "/simple-list")
@Operation(summary = "获得部门精简信息列表")
CommonResult<List<DeptSimpleRespDTO>> getSimpleDeptList();
@GetMapping(PREFIX + "/simple-company-list")
@Operation(summary = "获得公司精简信息列表")
CommonResult<List<DeptSimpleRespDTO>> getSimpleCompanyList();
@GetMapping(PREFIX + "/all-company-list")
@Operation(summary = "获得所有公司精简信息列表")
CommonResult<List<DeptSimpleRespDTO>> getAllCompanyList();
@GetMapping(PREFIX + "/get")
@Operation(summary = "获得部门信息")
@Parameter(name = "id", description = "部门编号", example = "1024", required = true)
CommonResult<DeptRespDTO> getDept(@RequestParam("id") Long id);
@GetMapping(PREFIX + "/list")
@Operation(summary = "获得部门信息数组")
@Parameter(name = "ids", description = "部门编号数组", example = "1,2", required = true)
CommonResult<List<DeptRespDTO>> getDeptList(@RequestParam("ids") Collection<Long> ids);
@GetMapping(PREFIX + "/valid")
@Operation(summary = "校验部门是否合法")
@Parameter(name = "ids", description = "部门编号数组", example = "1,2", required = true)
CommonResult<Boolean> validateDeptList(@RequestParam("ids") Collection<Long> ids);
/**
* 获得指定编号的部门 Map
*
* @param ids 部门编号数组
* @return 部门 Map
*/
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);
@GetMapping(PREFIX + "/company-dept-info")
@Operation(summary = "获得指定用户的公司部门信息")
@Parameter(name = "userId", description = "用户编号", example = "1", required = true)
CommonResult<Set<CompanyDeptInfoRespDTO>> getCompanyDeptInfoListByUserId(@RequestParam("userId") Long userId);
}

View File

@@ -0,0 +1,67 @@
package com.zt.plat.module.system.api.dept;
import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.map.MapUtil;
import com.zt.plat.framework.common.pojo.CommonResult;
import com.zt.plat.framework.common.util.collection.CollectionUtils;
import com.zt.plat.module.system.api.dept.dto.PostRespDTO;
import com.zt.plat.module.system.api.dept.dto.PostSaveReqDTO;
import com.zt.plat.module.system.api.dept.dto.PostSimpleRespDTO;
import com.zt.plat.module.system.enums.ApiConstants;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;
import java.util.Collection;
import java.util.List;
import java.util.Map;
@FeignClient(name = ApiConstants.NAME) // TODO 芋艿fallbackFactory =
@Tag(name = "RPC 服务 - 岗位")
public interface PostApi {
String PREFIX = ApiConstants.PREFIX + "/post";
// === 以下为补全的接口方法 ===
@PostMapping(PREFIX + "/create")
@Operation(summary = "新增岗位")
CommonResult<Long> createPost(@RequestBody PostSaveReqDTO createReqVO);
@PutMapping(PREFIX + "/update")
@Operation(summary = "修改岗位")
CommonResult<Boolean> updatePost(@RequestBody PostSaveReqDTO updateReqVO);
@DeleteMapping(PREFIX + "/delete")
@Operation(summary = "删除岗位")
CommonResult<Boolean> deletePost(@RequestParam("id") Long id);
@GetMapping(PREFIX + "/get")
@Operation(summary = "获得岗位详情")
CommonResult<PostRespDTO> getPost(@RequestParam("id") Long id);
@GetMapping(PREFIX + "/simple-list")
@Operation(summary = "获得岗位精简信息列表")
CommonResult<List<PostSimpleRespDTO>> getSimplePostList();
@GetMapping(PREFIX + "/valid")
@Operation(summary = "校验岗位是否合法")
@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,27 @@
package com.zt.plat.module.system.api.dept.dto;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
/**
* 公司部门信息 Response DTO
*
* @author ZT
*/
@Schema(description = "RPC 服务 - 公司部门信息 Response DTO")
@Data
public class CompanyDeptInfoRespDTO {
@Schema(description = "公司编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
private Long companyId;
@Schema(description = "公司名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "ZT源码")
private String companyName;
@Schema(description = "部门编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
private Long deptId;
@Schema(description = "部门名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "研发部")
private String deptName;
}

View File

@@ -0,0 +1,53 @@
package com.zt.plat.module.system.api.dept.dto;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import java.time.LocalDateTime;
/**
* 部门信息 Response DTO
*
* @author system
*/
@Schema(description = "RPC 服务 - 部门信息 Response DTO")
@Data
public class DeptDetailRespDTO {
@Schema(description = "部门编号", example = "1024")
private Long id;
@Schema(description = "部门名称", example = "ZT")
private String name;
@Schema(description = "父部门 ID", example = "1024")
private Long parentId;
@Schema(description = "显示顺序", example = "1024")
private Integer sort;
@Schema(description = "负责人的用户编号", example = "2048")
private Long leaderUserId;
@Schema(description = "联系电话", example = "15601691000")
private String phone;
@Schema(description = "邮箱", example = "cloud@iocoder.cn")
private String email;
@Schema(description = "状态,见 CommonStatusEnum 枚举", example = "1")
private Integer status;
@Schema(description = "创建时间")
private LocalDateTime createTime;
@Schema(description = "租户编号", example = "1024")
private Long tenantId;
@Schema(description = "是否公司", example = "false")
private Boolean isCompany;
@Schema(description = "是否集团", example = "false")
private Boolean isGroup;
}

View File

@@ -0,0 +1,27 @@
package com.zt.plat.module.system.api.dept.dto;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
/**
* 部门列表 Request DTO
*
* @author system
*/
@Schema(description = "RPC 服务 - 部门列表 Request DTO")
@Data
public class DeptListReqDTO {
@Schema(description = "部门名称,模糊匹配", example = "ZT")
private String name;
@Schema(description = "展示状态,参见 CommonStatusEnum 枚举类", example = "1")
private Integer status;
@Schema(description = "是否公司", example = "false")
private Boolean isCompany;
@Schema(description = "是否集团", example = "false")
private Boolean isGroup;
}

View File

@@ -0,0 +1,34 @@
package com.zt.plat.module.system.api.dept.dto;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
@Schema(description = "RPC 服务 - 部门 Response DTO")
@Data
public class DeptRespDTO {
@Schema(description = "部门编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
private Long id;
@Schema(description = "部门名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "研发部")
private String name;
@Schema(description = "部门编码", example = "XXXXXXX")
private String code;
@Schema(description = "父部门编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
private Long parentId;
@Schema(description = "负责人的用户编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
private Long leaderUserId;
@Schema(description = "部门状态", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
private Integer status; // 参见 CommonStatusEnum 枚举
@Schema(description = "是否公司", example = "false")
private Boolean isCompany;
@Schema(description = "是否集团", example = "false")
private Boolean isGroup;
}

View File

@@ -0,0 +1,39 @@
package com.zt.plat.module.system.api.dept.dto;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
/**
* 部门创建/修改 Request DTO
*
* @author system
*/
@Schema(description = "RPC 服务 - 部门创建/修改 Request DTO")
@Data
public class DeptSaveReqDTO {
@Schema(description = "部门编号", example = "1024")
private Long id;
@Schema(description = "部门名称", example = "ZT")
private String name;
@Schema(description = "父部门 ID", example = "1024")
private Long parentId;
@Schema(description = "显示顺序", example = "1024")
private Integer sort;
@Schema(description = "负责人的用户编号", example = "2048")
private Long leaderUserId;
@Schema(description = "联系电话", example = "15601691000")
private String phone;
@Schema(description = "邮箱", example = "cloud@iocoder.cn")
private String email;
@Schema(description = "状态,见 CommonStatusEnum 枚举0 开启 1 关闭", example = "0")
private Integer status;
}

View File

@@ -0,0 +1,30 @@
package com.zt.plat.module.system.api.dept.dto;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
/**
* 部门精简信息 Response DTO
*
* @author system
*/
@Schema(description = "RPC 服务 - 部门精简信息 Response DTO")
@Data
public class DeptSimpleRespDTO {
@Schema(description = "部门编号", example = "1024")
private Long id;
@Schema(description = "部门名称", example = "ZT")
private String name;
@Schema(description = "父部门 ID", example = "1024")
private Long parentId;
@Schema(description = "是否公司", example = "false")
private Boolean isCompany;
@Schema(description = "是否集团", example = "false")
private Boolean isGroup;
}

Some files were not shown because too many files have changed in this diff Show More