@@ -86,4 +86,10 @@ public interface DeptApi {
|
||||
@Parameter(name = "userId", description = "用户编号", example = "1", required = true)
|
||||
CommonResult<Set<CompanyDeptInfoRespDTO>> getCompanyDeptInfoListByUserId(@RequestParam("userId") Long userId);
|
||||
|
||||
// ========== 数据同步专用接口 ==========
|
||||
|
||||
@PostMapping(PREFIX + "/sync")
|
||||
@Operation(summary = "同步部门")
|
||||
CommonResult<Boolean> syncDept(@RequestBody DeptSaveReqDTO syncReqDTO);
|
||||
|
||||
}
|
||||
|
||||
@@ -64,4 +64,10 @@ public interface PostApi {
|
||||
return CollectionUtils.convertMap(list, PostRespDTO::getId);
|
||||
}
|
||||
|
||||
// ========== 数据同步专用接口 ==========
|
||||
|
||||
@PostMapping(PREFIX + "/sync")
|
||||
@Operation(summary = "同步岗位")
|
||||
CommonResult<Boolean> syncPost(@RequestBody PostSaveReqDTO syncReqDTO);
|
||||
|
||||
}
|
||||
|
||||
@@ -15,9 +15,15 @@ public class DeptSaveReqDTO {
|
||||
@Schema(description = "部门编号", example = "1024")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "部门编码", example = "ZT001")
|
||||
private String code;
|
||||
|
||||
@Schema(description = "部门名称", example = "ZT")
|
||||
private String name;
|
||||
|
||||
@Schema(description = "部门简称", example = "技术")
|
||||
private String shortName;
|
||||
|
||||
@Schema(description = "父部门 ID", example = "1024")
|
||||
private Long parentId;
|
||||
|
||||
@@ -36,6 +42,15 @@ public class DeptSaveReqDTO {
|
||||
@Schema(description = "状态,见 CommonStatusEnum 枚举0 开启 1 关闭", example = "0")
|
||||
private Integer status;
|
||||
|
||||
@Schema(description = "是否集团", example = "false")
|
||||
private Boolean isGroup;
|
||||
|
||||
@Schema(description = "是否公司", example = "false")
|
||||
private Boolean isCompany;
|
||||
|
||||
@Schema(description = "部门来源类型", example = "1")
|
||||
private Integer deptSource;
|
||||
|
||||
@Schema(description = "外部系统标识,用于建立编码映射", example = "ERP")
|
||||
private String externalSystemCode;
|
||||
|
||||
|
||||
@@ -104,6 +104,12 @@ public interface AdminUserApi extends AutoTransable<AdminUserRespDTO> {
|
||||
@Parameter(name = "ids", description = "用户编号数组", example = "3,5", required = true)
|
||||
CommonResult<Boolean> validateUserList(@RequestParam("ids") Collection<Long> ids);
|
||||
|
||||
// ========== 数据同步专用接口 ==========
|
||||
|
||||
@PostMapping(PREFIX + "/sync")
|
||||
@Operation(summary = "同步用户")
|
||||
CommonResult<Boolean> syncUser(@RequestBody AdminUserSaveReqDTO syncReqDTO);
|
||||
|
||||
@Override
|
||||
@FeignIgnore
|
||||
default List<AdminUserRespDTO> selectByIds(List<?> ids) {
|
||||
|
||||
@@ -50,4 +50,10 @@ public class AdminUserSaveReqDTO {
|
||||
@Schema(description = "密码", example = "123456")
|
||||
private String password;
|
||||
|
||||
@Schema(description = "工号", example = "A00123")
|
||||
private String workcode;
|
||||
|
||||
@Schema(description = "用户来源类型", example = "1")
|
||||
private Integer userSource;
|
||||
|
||||
}
|
||||
@@ -61,4 +61,10 @@ public interface UserDeptApi {
|
||||
@Operation(summary = "通过部门ID删除用户部门关系")
|
||||
@Parameter(name = "deptId", description = "部门编号", example = "1", required = true)
|
||||
CommonResult<Boolean> deleteUserDeptByDeptId(@RequestParam("deptId") Long deptId);
|
||||
|
||||
// ========== 数据同步专用接口 ==========
|
||||
|
||||
@PostMapping(PREFIX + "/sync")
|
||||
@Operation(summary = "同步用户部门关系")
|
||||
CommonResult<Boolean> syncUserDept(@RequestBody UserDeptSaveReqDTO syncReqDTO);
|
||||
}
|
||||
|
||||
@@ -61,4 +61,10 @@ public interface UserPostApi {
|
||||
@Operation(summary = "通过岗位ID删除用户岗位关系")
|
||||
@Parameter(name = "postId", description = "岗位编号", example = "1", required = true)
|
||||
CommonResult<Boolean> deleteUserPostByPostId(@RequestParam("postId") Long postId);
|
||||
|
||||
// ========== 数据同步专用接口 ==========
|
||||
|
||||
@PostMapping(PREFIX + "/sync")
|
||||
@Operation(summary = "同步用户岗位关系")
|
||||
CommonResult<Boolean> syncUserPost(@RequestBody UserPostSaveReqDTO syncReqDTO);
|
||||
}
|
||||
|
||||
@@ -38,7 +38,7 @@ public class DatabusUserDeptProviderApiImpl implements DatabusUserDeptProviderAp
|
||||
// 多查一条判断是否有更多数据
|
||||
int limit = reqDTO.getBatchSize() != null ? reqDTO.getBatchSize() : 100;
|
||||
|
||||
// ⚠️ 使用关联查询,只查询 userSource = 2 的用户的部门关系
|
||||
// 查询用户部门关系
|
||||
List<UserDeptDO> list = userDeptMapper.selectPageByCursorWithUserSource(
|
||||
reqDTO.isFirstPage() ? null : reqDTO.getCursorTime(),
|
||||
reqDTO.isFirstPage() ? null : reqDTO.getCursorId(),
|
||||
@@ -67,7 +67,7 @@ public class DatabusUserDeptProviderApiImpl implements DatabusUserDeptProviderAp
|
||||
// 首次查询时返<E697B6><E8BF94><EFBFBD>总数
|
||||
Long total = null;
|
||||
if (reqDTO.isFirstPage()) {
|
||||
// ⚠️ 只统计 userSource = 2 的用户的部门关系
|
||||
// 统计用户部门关系
|
||||
total = userDeptMapper.countWithUserSource(reqDTO.getTenantId());
|
||||
}
|
||||
|
||||
@@ -107,7 +107,7 @@ public class DatabusUserDeptProviderApiImpl implements DatabusUserDeptProviderAp
|
||||
|
||||
@Override
|
||||
public CommonResult<Long> count(Long tenantId) {
|
||||
// ⚠️ 只统计 userSource = 2 的用户的部门关系
|
||||
// 统计用户部门关系
|
||||
return success(userDeptMapper.countWithUserSource(tenantId));
|
||||
}
|
||||
|
||||
|
||||
@@ -107,4 +107,13 @@ public class DeptApiImpl implements DeptApi {
|
||||
return success(BeanUtils.toBean(companyDeptInfos, CompanyDeptInfoRespDTO.class));
|
||||
}
|
||||
|
||||
// ========== 数据同步专用接口 ==========
|
||||
|
||||
@Override
|
||||
public CommonResult<Boolean> syncDept(DeptSaveReqDTO syncReqDTO) {
|
||||
DeptSaveReqVO reqVO = BeanUtils.toBean(syncReqDTO, DeptSaveReqVO.class);
|
||||
deptService.syncDept(reqVO);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -38,7 +38,6 @@ public class PostApiImpl implements PostApi {
|
||||
|
||||
@Override
|
||||
public CommonResult<Boolean> updatePost(PostSaveReqDTO updateReqVO) {
|
||||
log.error("ssssssssss");
|
||||
PostSaveReqVO reqVO = BeanUtils.toBean(updateReqVO, PostSaveReqVO.class);
|
||||
postService.updatePost(reqVO);
|
||||
return success(true);
|
||||
@@ -76,4 +75,11 @@ public class PostApiImpl implements PostApi {
|
||||
return success(BeanUtils.toBean(list, PostRespDTO.class));
|
||||
}
|
||||
|
||||
@Override
|
||||
public CommonResult<Boolean> syncPost(PostSaveReqDTO syncReqDTO) {
|
||||
PostSaveReqVO reqVO = BeanUtils.toBean(syncReqDTO, PostSaveReqVO.class);
|
||||
postService.syncPost(reqVO);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user