Merge branch 'refs/heads/zt-test' into test
# Conflicts: # zt-module-infra/zt-module-infra-server/src/main/resources/application.yaml
This commit is contained in:
@@ -137,7 +137,12 @@
|
||||
<groupId>com.zt.plat</groupId>
|
||||
<artifactId>zt-spring-boot-starter-monitor</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- Seata 达梦数据库补丁,必须最先引入以覆盖 seata-all 中的类 -->
|
||||
<dependency>
|
||||
<groupId>com.zt.plat</groupId>
|
||||
<artifactId>zt-spring-boot-starter-seata-dm</artifactId>
|
||||
<version>${revision}</version>
|
||||
</dependency>
|
||||
<!-- 分布式事务 -->
|
||||
<dependency>
|
||||
<groupId>org.apache.seata</groupId>
|
||||
@@ -190,6 +195,10 @@
|
||||
<groupId>com.zt.plat</groupId>
|
||||
<artifactId>zt-spring-boot-starter-mq</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>cn.hutool</groupId>
|
||||
<artifactId>hutool-all</artifactId>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -54,6 +54,9 @@ public class DatabusUserProviderApiImpl implements DatabusUserProviderApi {
|
||||
// 构建游标查询条件
|
||||
LambdaQueryWrapper<AdminUserDO> queryWrapper = new LambdaQueryWrapper<>();
|
||||
|
||||
// ⚠️ 只同步 userSource = 2 的用户
|
||||
queryWrapper.eq(AdminUserDO::getUserSource, 2);
|
||||
|
||||
// 游标条件:create_time > cursorTime OR (create_time = cursorTime AND id > cursorId)
|
||||
if (!reqDTO.isFirstPage()) {
|
||||
queryWrapper.and(w -> w
|
||||
@@ -100,6 +103,8 @@ public class DatabusUserProviderApiImpl implements DatabusUserProviderApi {
|
||||
Long total = null;
|
||||
if (reqDTO.isFirstPage()) {
|
||||
LambdaQueryWrapper<AdminUserDO> countWrapper = new LambdaQueryWrapper<>();
|
||||
// ⚠️ 只统计 userSource = 2 的用户
|
||||
countWrapper.eq(AdminUserDO::getUserSource, 2);
|
||||
if (reqDTO.getTenantId() != null) {
|
||||
countWrapper.eq(AdminUserDO::getTenantId, reqDTO.getTenantId());
|
||||
}
|
||||
@@ -143,6 +148,8 @@ public class DatabusUserProviderApiImpl implements DatabusUserProviderApi {
|
||||
@Override
|
||||
public CommonResult<Long> count(Long tenantId) {
|
||||
LambdaQueryWrapper<AdminUserDO> queryWrapper = new LambdaQueryWrapper<>();
|
||||
// ⚠️ 只统计 userSource = 2 的用户
|
||||
queryWrapper.eq(AdminUserDO::getUserSource, 2);
|
||||
if (tenantId != null) {
|
||||
queryWrapper.eq(AdminUserDO::getTenantId, 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);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -10,6 +10,7 @@ import com.zt.plat.module.system.controller.admin.dept.vo.post.PostSaveReqVO;
|
||||
import com.zt.plat.module.system.dal.dataobject.dept.PostDO;
|
||||
import com.zt.plat.module.system.service.dept.PostService;
|
||||
import jakarta.annotation.Resource;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
@@ -20,6 +21,7 @@ import java.util.List;
|
||||
|
||||
import static com.zt.plat.framework.common.pojo.CommonResult.success;
|
||||
|
||||
@Slf4j
|
||||
@RestController // 提供 RESTful API 接口,给 Feign 调用
|
||||
@Validated
|
||||
public class PostApiImpl implements PostApi {
|
||||
@@ -49,6 +51,7 @@ public class PostApiImpl implements PostApi {
|
||||
|
||||
@Override
|
||||
public CommonResult<PostRespDTO> getPost(Long id) {
|
||||
log.error("cccccccc"+id);
|
||||
PostDO post = postService.getPost(id);
|
||||
return success(BeanUtils.toBean(post, PostRespDTO.class));
|
||||
}
|
||||
@@ -72,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);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -6,6 +6,7 @@ import com.zt.plat.framework.common.util.object.BeanUtils;
|
||||
import com.zt.plat.module.system.api.permission.dto.*;
|
||||
import com.zt.plat.module.system.controller.admin.permission.vo.permission.PermissionAssignRoleDataScopeReqVO;
|
||||
import com.zt.plat.module.system.controller.admin.permission.vo.permission.PermissionAssignUserRoleReqVO;
|
||||
import com.zt.plat.module.system.enums.permission.DataScopeEnum;
|
||||
import com.zt.plat.module.system.service.permission.PermissionService;
|
||||
import org.springframework.context.annotation.Primary;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
@@ -65,6 +66,11 @@ public class PermissionApiImpl implements PermissionApi {
|
||||
return success(permissionService.getUserRoleIdListByUserIdFromCache(userId));
|
||||
}
|
||||
|
||||
@Override
|
||||
public CommonResult<DataScopeEnum> getUserDataPermissionLevel(Long userId) {
|
||||
return success(permissionService.getUserDataPermissionLevel(userId));
|
||||
}
|
||||
|
||||
@Override
|
||||
public CommonResult<Boolean> hasAnyPermissions(Long userId, String... permissions) {
|
||||
return success(permissionService.hasAnyPermissions(userId, permissions));
|
||||
|
||||
@@ -149,4 +149,11 @@ public class AdminUserApiImpl implements AdminUserApi {
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public CommonResult<Boolean> syncUser(AdminUserSaveReqDTO syncReqDTO) {
|
||||
UserSaveReqVO reqVO = BeanUtils.toBean(syncReqDTO, UserSaveReqVO.class);
|
||||
userService.syncUser(reqVO);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,88 @@
|
||||
package com.zt.plat.module.system.api.userdept;
|
||||
|
||||
import com.zt.plat.framework.common.pojo.CommonResult;
|
||||
import com.zt.plat.framework.common.util.object.BeanUtils;
|
||||
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.dal.dataobject.userdept.UserDeptDO;
|
||||
import com.zt.plat.module.system.service.userdept.UserDeptService;
|
||||
import jakarta.annotation.Resource;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import static com.zt.plat.framework.common.pojo.CommonResult.success;
|
||||
|
||||
/**
|
||||
* 用户-部门关系 API 实现类
|
||||
*
|
||||
* @author ZT
|
||||
*/
|
||||
@Slf4j
|
||||
@RestController
|
||||
@Validated
|
||||
public class UserDeptApiImpl implements UserDeptApi {
|
||||
|
||||
@Resource
|
||||
private UserDeptService userDeptService;
|
||||
|
||||
@Override
|
||||
public CommonResult<Long> createUserDept(UserDeptSaveReqDTO reqVO) {
|
||||
UserDeptDO userDept = BeanUtils.toBean(reqVO, UserDeptDO.class);
|
||||
Long id = userDeptService.createUserDept(userDept);
|
||||
return success(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public CommonResult<Boolean> updateUserDept(UserDeptSaveReqDTO reqVO) {
|
||||
UserDeptDO userDept = BeanUtils.toBean(reqVO, UserDeptDO.class);
|
||||
userDeptService.updateUserDept(userDept);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public CommonResult<Boolean> deleteUserDept(Long id) {
|
||||
userDeptService.deleteUserDept(id);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public CommonResult<UserDeptRespDTO> getUserDept(Long id) {
|
||||
UserDeptDO userDept = userDeptService.getUserDept(id);
|
||||
return success(BeanUtils.toBean(userDept, UserDeptRespDTO.class));
|
||||
}
|
||||
|
||||
@Override
|
||||
public CommonResult<List<UserDeptRespDTO>> getUserDeptListByUserId(Long userId) {
|
||||
List<UserDeptDO> list = userDeptService.getValidUserDeptListByUserIds(List.of(userId));
|
||||
return success(BeanUtils.toBean(list, UserDeptRespDTO.class));
|
||||
}
|
||||
|
||||
@Override
|
||||
public CommonResult<List<UserDeptRespDTO>> getUserDeptListByDeptId(Long deptId) {
|
||||
List<UserDeptDO> list = userDeptService.getValidUserDeptListByDeptIds(List.of(deptId));
|
||||
return success(BeanUtils.toBean(list, UserDeptRespDTO.class));
|
||||
}
|
||||
|
||||
@Override
|
||||
public CommonResult<Boolean> deleteUserDeptByUserId(Long userId) {
|
||||
userDeptService.deleteUserDeptByUserId(userId);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public CommonResult<Boolean> deleteUserDeptByDeptId(Long deptId) {
|
||||
// 需要实现此方法,暂时返回成功
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public CommonResult<Boolean> syncUserDept(UserDeptSaveReqDTO syncReqDTO) {
|
||||
UserDeptDO userDept = BeanUtils.toBean(syncReqDTO, UserDeptDO.class);
|
||||
userDeptService.syncUserDept(userDept);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user