update:调整数据同步用户-部门,用户-岗位同步顺序

This commit is contained in:
hewencai
2025-12-22 11:03:15 +08:00
parent 9b0e63a33e
commit 7ef5545dc0
15 changed files with 494 additions and 102 deletions

View File

@@ -0,0 +1,64 @@
package com.zt.plat.module.system.api.userdept;
import com.zt.plat.framework.common.pojo.CommonResult;
import com.zt.plat.module.system.api.userdept.dto.UserDeptRespDTO;
import com.zt.plat.module.system.api.userdept.dto.UserDeptSaveReqDTO;
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;
/**
* 用户-部门关系 Feign API
*
* @author ZT
*/
@FeignClient(name = ApiConstants.NAME)
@Tag(name = "RPC 服务 - 用户部门关系")
public interface UserDeptApi {
String PREFIX = ApiConstants.PREFIX + "/user-dept";
@PostMapping(PREFIX + "/create")
@Operation(summary = "新增用户部门关系")
CommonResult<Long> createUserDept(@RequestBody UserDeptSaveReqDTO reqVO);
@PutMapping(PREFIX + "/update")
@Operation(summary = "修改用户部门关系")
CommonResult<Boolean> updateUserDept(@RequestBody UserDeptSaveReqDTO reqVO);
@DeleteMapping(PREFIX + "/delete")
@Operation(summary = "删除用户部门关系")
@Parameter(name = "id", description = "关系编号", example = "1", required = true)
CommonResult<Boolean> deleteUserDept(@RequestParam("id") Long id);
@GetMapping(PREFIX + "/get")
@Operation(summary = "通过ID查询用户部门关系")
@Parameter(name = "id", description = "关系编号", example = "1", required = true)
CommonResult<UserDeptRespDTO> getUserDept(@RequestParam("id") Long id);
@GetMapping(PREFIX + "/list-by-user-id")
@Operation(summary = "通过用户ID查询用户部门关系列表")
@Parameter(name = "userId", description = "用户编号", example = "1", required = true)
CommonResult<List<UserDeptRespDTO>> getUserDeptListByUserId(@RequestParam("userId") Long userId);
@GetMapping(PREFIX + "/list-by-dept-id")
@Operation(summary = "通过部门ID查询用户部门关系列表")
@Parameter(name = "deptId", description = "部门编号", example = "1", required = true)
CommonResult<List<UserDeptRespDTO>> getUserDeptListByDeptId(@RequestParam("deptId") Long deptId);
@DeleteMapping(PREFIX + "/delete-by-user-id")
@Operation(summary = "通过用户ID删除用户部门关系")
@Parameter(name = "userId", description = "用户编号", example = "1", required = true)
CommonResult<Boolean> deleteUserDeptByUserId(@RequestParam("userId") Long userId);
@DeleteMapping(PREFIX + "/delete-by-dept-id")
@Operation(summary = "通过部门ID删除用户部门关系")
@Parameter(name = "deptId", description = "部门编号", example = "1", required = true)
CommonResult<Boolean> deleteUserDeptByDeptId(@RequestParam("deptId") Long deptId);
}

View File

@@ -0,0 +1,31 @@
package com.zt.plat.module.system.api.userdept.dto;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import java.time.LocalDateTime;
/**
* 用户部门关系 Response DTO
*
* @author ZT
*/
@Schema(description = "RPC 服务 - 用户部门关系 Response DTO")
@Data
public class UserDeptRespDTO {
@Schema(description = "关系编号", example = "1024")
private Long id;
@Schema(description = "用户编号", example = "1")
private Long userId;
@Schema(description = "部门编号", example = "100")
private Long deptId;
@Schema(description = "备注", example = "主部门")
private String remark;
@Schema(description = "创建时间")
private LocalDateTime createTime;
}

View File

@@ -0,0 +1,26 @@
package com.zt.plat.module.system.api.userdept.dto;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
/**
* 用户部门关系创建/修改 Request DTO
*
* @author ZT
*/
@Schema(description = "RPC 服务 - 用户部门关系创建/修改 Request DTO")
@Data
public class UserDeptSaveReqDTO {
@Schema(description = "关系编号", example = "1024")
private Long id;
@Schema(description = "用户编号", example = "1", required = true)
private Long userId;
@Schema(description = "部门编号", example = "100", required = true)
private Long deptId;
@Schema(description = "备注", example = "主部门")
private String remark;
}

View File

@@ -0,0 +1,64 @@
package com.zt.plat.module.system.api.userpost;
import com.zt.plat.framework.common.pojo.CommonResult;
import com.zt.plat.module.system.api.userpost.dto.UserPostRespDTO;
import com.zt.plat.module.system.api.userpost.dto.UserPostSaveReqDTO;
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;
/**
* 用户-岗位关系 Feign API
*
* @author ZT
*/
@FeignClient(name = ApiConstants.NAME)
@Tag(name = "RPC 服务 - 用户岗位关系")
public interface UserPostApi {
String PREFIX = ApiConstants.PREFIX + "/user-post";
@PostMapping(PREFIX + "/create")
@Operation(summary = "新增用户岗位关系")
CommonResult<Long> createUserPost(@RequestBody UserPostSaveReqDTO reqVO);
@PutMapping(PREFIX + "/update")
@Operation(summary = "修改用户岗位关系")
CommonResult<Boolean> updateUserPost(@RequestBody UserPostSaveReqDTO reqVO);
@DeleteMapping(PREFIX + "/delete")
@Operation(summary = "删除用户岗位关系")
@Parameter(name = "id", description = "关系编号", example = "1", required = true)
CommonResult<Boolean> deleteUserPost(@RequestParam("id") Long id);
@GetMapping(PREFIX + "/get")
@Operation(summary = "通过ID查询用户岗位关系")
@Parameter(name = "id", description = "关系编号", example = "1", required = true)
CommonResult<UserPostRespDTO> getUserPost(@RequestParam("id") Long id);
@GetMapping(PREFIX + "/list-by-user-id")
@Operation(summary = "通过用户ID查询用户岗位关系列表")
@Parameter(name = "userId", description = "用户编号", example = "1", required = true)
CommonResult<List<UserPostRespDTO>> getUserPostListByUserId(@RequestParam("userId") Long userId);
@GetMapping(PREFIX + "/list-by-post-id")
@Operation(summary = "通过岗位ID查询用户岗位关系列表")
@Parameter(name = "postId", description = "岗位编号", example = "1", required = true)
CommonResult<List<UserPostRespDTO>> getUserPostListByPostId(@RequestParam("postId") Long postId);
@DeleteMapping(PREFIX + "/delete-by-user-id")
@Operation(summary = "通过用户ID删除用户岗位关系")
@Parameter(name = "userId", description = "用户编号", example = "1", required = true)
CommonResult<Boolean> deleteUserPostByUserId(@RequestParam("userId") Long userId);
@DeleteMapping(PREFIX + "/delete-by-post-id")
@Operation(summary = "通过岗位ID删除用户岗位关系")
@Parameter(name = "postId", description = "岗位编号", example = "1", required = true)
CommonResult<Boolean> deleteUserPostByPostId(@RequestParam("postId") Long postId);
}

View File

@@ -0,0 +1,28 @@
package com.zt.plat.module.system.api.userpost.dto;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import java.time.LocalDateTime;
/**
* 用户岗位关系 Response DTO
*
* @author ZT
*/
@Schema(description = "RPC 服务 - 用户岗位关系 Response DTO")
@Data
public class UserPostRespDTO {
@Schema(description = "关系编号", example = "1024")
private Long id;
@Schema(description = "用户编号", example = "1")
private Long userId;
@Schema(description = "岗位编号", example = "100")
private Long postId;
@Schema(description = "创建时间")
private LocalDateTime createTime;
}

View File

@@ -0,0 +1,23 @@
package com.zt.plat.module.system.api.userpost.dto;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
/**
* 用户岗位关系创建/修改 Request DTO
*
* @author ZT
*/
@Schema(description = "RPC 服务 - 用户岗位关系创建/修改 Request DTO")
@Data
public class UserPostSaveReqDTO {
@Schema(description = "关系编号", example = "1024")
private Long id;
@Schema(description = "用户编号", example = "1", required = true)
private Long userId;
@Schema(description = "岗位编号", example = "100", required = true)
private Long postId;
}