Compare commits
8 Commits
0072234893
...
e4c8d308f3
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e4c8d308f3 | ||
|
|
b245bed7da | ||
|
|
b86a9a2811 | ||
|
|
09c9276deb | ||
|
|
797cd2abd9 | ||
|
|
88b280a33f | ||
|
|
2e761d1867 | ||
|
|
b155b1a00a |
@@ -25,7 +25,7 @@ CREATE TABLE infra_api_access_log (
|
||||
user_ip varchar(50) NOT NULL,
|
||||
user_agent varchar(512) NOT NULL,
|
||||
operate_module varchar(50) DEFAULT NULL NULL,
|
||||
operate_name varchar(50) DEFAULT NULL NULL,
|
||||
operate_name varchar(256) DEFAULT NULL NULL,
|
||||
operate_type smallint DEFAULT 0 NULL,
|
||||
begin_time datetime NOT NULL,
|
||||
end_time datetime NOT NULL,
|
||||
|
||||
@@ -25,6 +25,7 @@ public interface GlobalErrorCodeConstants {
|
||||
ErrorCode METHOD_NOT_ALLOWED = new ErrorCode(405, "请求方法不正确");
|
||||
ErrorCode LOCKED = new ErrorCode(423, "请求失败,请稍后重试"); // 并发请求,不允许
|
||||
ErrorCode TOO_MANY_REQUESTS = new ErrorCode(429, "请求过于频繁,请稍后重试");
|
||||
ErrorCode NOT_NULL_REQUEST_ERROR = new ErrorCode(430, "请求参数不能为空");
|
||||
|
||||
// ========== 服务端错误段 ==========
|
||||
|
||||
|
||||
@@ -19,6 +19,10 @@ public class CompanyDataPermissionIgnoreAspect {
|
||||
public Object around(ProceedingJoinPoint joinPoint, CompanyDataPermissionIgnore companyDataPermissionIgnore) throws Throwable {
|
||||
boolean oldIgnore = CompanyContextHolder.isIgnore();
|
||||
try {
|
||||
if (companyDataPermissionIgnore == null) {
|
||||
Class<?> targetClass = joinPoint.getTarget().getClass();
|
||||
companyDataPermissionIgnore = targetClass.getAnnotation(CompanyDataPermissionIgnore.class);
|
||||
}
|
||||
Object enable = SpringExpressionUtils.parseExpression(companyDataPermissionIgnore.enable());
|
||||
if (Boolean.TRUE.equals(enable)) {
|
||||
CompanyContextHolder.setIgnore(true);
|
||||
|
||||
@@ -19,6 +19,10 @@ public class DeptDataPermissionIgnoreAspect {
|
||||
public Object around(ProceedingJoinPoint joinPoint, DeptDataPermissionIgnore deptDataPermissionIgnore) throws Throwable {
|
||||
boolean oldIgnore = DeptContextHolder.shouldIgnore();
|
||||
try {
|
||||
if (deptDataPermissionIgnore == null) {
|
||||
Class<?> targetClass = joinPoint.getTarget().getClass();
|
||||
deptDataPermissionIgnore = targetClass.getAnnotation(DeptDataPermissionIgnore.class);
|
||||
}
|
||||
Object enable = SpringExpressionUtils.parseExpression(deptDataPermissionIgnore.enable());
|
||||
if (Boolean.TRUE.equals(enable)) {
|
||||
DeptContextHolder.setIgnore(true);
|
||||
|
||||
@@ -36,7 +36,7 @@ public class ApiDefinitionStepSaveReqVO {
|
||||
@Schema(description = "响应映射表达式(JSON)")
|
||||
private String responseMappingExpr;
|
||||
|
||||
@Schema(description = "超时时间(毫秒)", example = "5000")
|
||||
@Schema(description = "超时时间(毫秒),缺省 20000(20s)", example = "20000")
|
||||
private Long timeout;
|
||||
|
||||
@Schema(description = "降级策略(JSON)")
|
||||
|
||||
@@ -48,6 +48,7 @@ public class HttpStepHandler implements ApiStepHandler {
|
||||
|
||||
private static final Duration RETRY_DELAY = Duration.ofMillis(200);
|
||||
private static final int RETRY_ATTEMPTS = 3;
|
||||
private static final Duration DEFAULT_TIMEOUT = Duration.ofSeconds(20);
|
||||
|
||||
private static final Set<String> DEFAULT_FORWARDED_HEADERS = Set.of(
|
||||
"authorization",
|
||||
@@ -229,7 +230,7 @@ public class HttpStepHandler implements ApiStepHandler {
|
||||
private Duration resolveTimeout(ApiStepDefinition stepDefinition) {
|
||||
Long timeout = stepDefinition.getStep().getTimeout();
|
||||
if (timeout == null || timeout <= 0) {
|
||||
return Duration.ofSeconds(5);
|
||||
return DEFAULT_TIMEOUT;
|
||||
}
|
||||
return Duration.ofMillis(timeout);
|
||||
}
|
||||
|
||||
@@ -37,14 +37,20 @@ spring:
|
||||
primary: master
|
||||
datasource:
|
||||
master:
|
||||
url: jdbc:dm://172.16.46.247:1050?schema=RUOYI-VUE-PRO
|
||||
#url: jdbc:dm://172.16.46.247:1050?schema=RUOYI-VUE-PRO
|
||||
#username: SYSDBA
|
||||
#password: pgbsci6ddJ6Sqj@e
|
||||
url: jdbc:dm://172.17.11.98:20870?schema=JYGK_TEST
|
||||
username: SYSDBA
|
||||
password: pgbsci6ddJ6Sqj@e
|
||||
password: P@ssword25
|
||||
slave: # 模拟从库,可根据自己需要修改 # 模拟从库,可根据自己需要修改
|
||||
lazy: true # 开启懒加载,保证启动速度
|
||||
url: jdbc:dm://172.16.46.247:1050?schema=RUOYI-VUE-PRO
|
||||
#url: jdbc:dm://172.16.46.247:1050?schema=RUOYI-VUE-PRO
|
||||
#username: SYSDBA
|
||||
#password: pgbsci6ddJ6Sqj@e
|
||||
url: jdbc:dm://172.17.11.98:20870?schema=JYGK_TEST
|
||||
username: SYSDBA
|
||||
password: pgbsci6ddJ6Sqj@e
|
||||
password: P@ssword25
|
||||
|
||||
# Redis 配置。Redisson 默认的配置足够使用,一般不需要进行调优
|
||||
data:
|
||||
@@ -52,9 +58,8 @@ spring:
|
||||
host: 172.16.46.63 # 地址
|
||||
port: 30379 # 端口
|
||||
database: 0 # 数据库索引
|
||||
username: zt-redis
|
||||
username: zt-redis # 密码,建议生产环境开启
|
||||
password: P@ssword25
|
||||
# password: 123456 # 密码,建议生产环境开启
|
||||
|
||||
xxl:
|
||||
job:
|
||||
|
||||
@@ -39,14 +39,20 @@ spring:
|
||||
primary: master
|
||||
datasource:
|
||||
master:
|
||||
url: jdbc:dm://172.16.46.247:1050?schema=RUOYI-VUE-PRO
|
||||
#url: jdbc:dm://172.16.46.247:1050?schema=RUOYI-VUE-PRO
|
||||
#username: SYSDBA
|
||||
#password: pgbsci6ddJ6Sqj@e
|
||||
url: jdbc:dm://172.17.11.98:20870?schema=JYGK_TEST
|
||||
username: SYSDBA
|
||||
password: pgbsci6ddJ6Sqj@e
|
||||
password: P@ssword25
|
||||
slave: # 模拟从库,可根据自己需要修改 # 模拟从库,可根据自己需要修改
|
||||
lazy: true # 开启懒加载,保证启动速度
|
||||
url: jdbc:dm://172.16.46.247:1050?schema=RUOYI-VUE-PRO
|
||||
#url: jdbc:dm://172.16.46.247:1050?schema=RUOYI-VUE-PRO
|
||||
#username: SYSDBA
|
||||
#password: pgbsci6ddJ6Sqj@e
|
||||
url: jdbc:dm://172.17.11.98:20870?schema=JYGK_TEST
|
||||
username: SYSDBA
|
||||
password: pgbsci6ddJ6Sqj@e
|
||||
password: P@ssword25
|
||||
|
||||
# Redis 配置。Redisson 默认的配置足够使用,一般不需要进行调优
|
||||
data:
|
||||
@@ -54,7 +60,8 @@ spring:
|
||||
host: 172.16.46.63 # 地址
|
||||
port: 30379 # 端口
|
||||
database: 0 # 数据库索引
|
||||
# password: 123456 # 密码,建议生产环境开启
|
||||
username: zt-redis # 密码,建议生产环境开启
|
||||
password: P@ssword25
|
||||
|
||||
xxl:
|
||||
job:
|
||||
|
||||
@@ -50,7 +50,7 @@ spring:
|
||||
time-to-live: 1h # 设置过期时间为 1 小时
|
||||
|
||||
server:
|
||||
port: 48100
|
||||
port: 48108
|
||||
|
||||
logging:
|
||||
file:
|
||||
|
||||
@@ -38,14 +38,20 @@ spring:
|
||||
primary: master
|
||||
datasource:
|
||||
master:
|
||||
url: jdbc:dm://172.16.46.247:1050?schema=RUOYI-VUE-PRO
|
||||
#url: jdbc:dm://172.16.46.247:1050?schema=RUOYI-VUE-PRO
|
||||
#username: SYSDBA
|
||||
#password: pgbsci6ddJ6Sqj@e
|
||||
url: jdbc:dm://172.17.11.98:20870?schema=JYGK_TEST
|
||||
username: SYSDBA
|
||||
password: pgbsci6ddJ6Sqj@e
|
||||
password: P@ssword25
|
||||
slave: # 模拟从库,可根据自己需要修改 # 模拟从库,可根据自己需要修改
|
||||
lazy: true # 开启懒加载,保证启动速度
|
||||
url: jdbc:dm://172.16.46.247:1050?schema=RUOYI-VUE-PRO
|
||||
#url: jdbc:dm://172.16.46.247:1050?schema=RUOYI-VUE-PRO
|
||||
#username: SYSDBA
|
||||
#password: pgbsci6ddJ6Sqj@e
|
||||
url: jdbc:dm://172.17.11.98:20870?schema=JYGK_TEST
|
||||
username: SYSDBA
|
||||
password: pgbsci6ddJ6Sqj@e
|
||||
password: P@ssword25
|
||||
|
||||
# Redis 配置。Redisson 默认的配置足够使用,一般不需要进行调优
|
||||
data:
|
||||
|
||||
@@ -43,14 +43,20 @@ spring:
|
||||
primary: master
|
||||
datasource:
|
||||
master:
|
||||
url: jdbc:dm://172.16.46.247:1050?schema=RUOYI-VUE-PRO
|
||||
#url: jdbc:dm://172.16.46.247:1050?schema=RUOYI-VUE-PRO
|
||||
#username: SYSDBA
|
||||
#password: pgbsci6ddJ6Sqj@e
|
||||
url: jdbc:dm://172.17.11.98:20870?schema=JYGK_TEST
|
||||
username: SYSDBA
|
||||
password: pgbsci6ddJ6Sqj@e
|
||||
password: P@ssword25
|
||||
slave: # 模拟从库,可根据自己需要修改 # 模拟从库,可根据自己需要修改
|
||||
lazy: true # 开启懒加载,保证启动速度
|
||||
url: jdbc:dm://172.16.46.247:1050?schema=RUOYI-VUE-PRO
|
||||
#url: jdbc:dm://172.16.46.247:1050?schema=RUOYI-VUE-PRO
|
||||
#username: SYSDBA
|
||||
#password: pgbsci6ddJ6Sqj@e
|
||||
url: jdbc:dm://172.17.11.98:20870?schema=JYGK_TEST
|
||||
username: SYSDBA
|
||||
password: pgbsci6ddJ6Sqj@e
|
||||
password: P@ssword25
|
||||
|
||||
# Redis 配置。Redisson 默认的配置足够使用,一般不需要进行调优
|
||||
data:
|
||||
|
||||
@@ -38,14 +38,20 @@ spring:
|
||||
primary: master
|
||||
datasource:
|
||||
master:
|
||||
url: jdbc:dm://172.16.46.247:1050?schema=RUOYI-VUE-PRO
|
||||
#url: jdbc:dm://172.16.46.247:1050?schema=RUOYI-VUE-PRO
|
||||
#username: SYSDBA
|
||||
#password: pgbsci6ddJ6Sqj@e
|
||||
url: jdbc:dm://172.17.11.98:20870?schema=JYGK_TEST
|
||||
username: SYSDBA
|
||||
password: pgbsci6ddJ6Sqj@e
|
||||
password: P@ssword25
|
||||
slave: # 模拟从库,可根据自己需要修改 # 模拟从库,可根据自己需要修改
|
||||
lazy: true # 开启懒加载,保证启动速度
|
||||
url: jdbc:dm://172.16.46.247:1050?schema=RUOYI-VUE-PRO
|
||||
#url: jdbc:dm://172.16.46.247:1050?schema=RUOYI-VUE-PRO
|
||||
#username: SYSDBA
|
||||
#password: pgbsci6ddJ6Sqj@e
|
||||
url: jdbc:dm://172.17.11.98:20870?schema=JYGK_TEST
|
||||
username: SYSDBA
|
||||
password: pgbsci6ddJ6Sqj@e
|
||||
password: P@ssword25
|
||||
|
||||
# Redis 配置。Redisson 默认的配置足够使用,一般不需要进行调优
|
||||
data:
|
||||
|
||||
@@ -40,14 +40,20 @@ spring:
|
||||
primary: master
|
||||
datasource:
|
||||
master:
|
||||
url: jdbc:dm://172.16.46.247:1050?schema=RUOYI-VUE-PRO
|
||||
#url: jdbc:dm://172.16.46.247:1050?schema=RUOYI-VUE-PRO
|
||||
#username: SYSDBA
|
||||
#password: pgbsci6ddJ6Sqj@e
|
||||
url: jdbc:dm://172.17.11.98:20870?schema=JYGK_TEST
|
||||
username: SYSDBA
|
||||
password: pgbsci6ddJ6Sqj@e
|
||||
password: P@ssword25
|
||||
slave: # 模拟从库,可根据自己需要修改 # 模拟从库,可根据自己需要修改
|
||||
lazy: true # 开启懒加载,保证启动速度
|
||||
url: jdbc:dm://172.16.46.247:1050?schema=RUOYI-VUE-PRO
|
||||
#url: jdbc:dm://172.16.46.247:1050?schema=RUOYI-VUE-PRO
|
||||
#username: SYSDBA
|
||||
#password: pgbsci6ddJ6Sqj@e
|
||||
url: jdbc:dm://172.17.11.98:20870?schema=JYGK_TEST
|
||||
username: SYSDBA
|
||||
password: pgbsci6ddJ6Sqj@e
|
||||
password: P@ssword25
|
||||
|
||||
# Redis 配置。Redisson 默认的配置足够使用,一般不需要进行调优
|
||||
data:
|
||||
|
||||
@@ -1,18 +1,15 @@
|
||||
package com.zt.plat.module.system.api.esp;
|
||||
|
||||
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.api.esp.dto.EspDto;
|
||||
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)
|
||||
@Tag(name = "RPC 服务 - 部门")
|
||||
@@ -20,75 +17,8 @@ public interface EspApi {
|
||||
|
||||
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);
|
||||
|
||||
// ========== 数据同步专用接口 ==========
|
||||
|
||||
@PostMapping(PREFIX + "/sync")
|
||||
@Operation(summary = "同步部门")
|
||||
CommonResult<Boolean> syncDept(@RequestBody DeptSaveReqDTO syncReqDTO);
|
||||
@PostMapping(PREFIX + "/pushMsg")
|
||||
@Operation(summary = "推送消息")
|
||||
CommonResult<List<EspDto>> pushMsg(@RequestBody DeptSaveReqDTO syncReqDTO);
|
||||
|
||||
}
|
||||
|
||||
@@ -13,7 +13,6 @@ 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.Collection;
|
||||
import java.util.Collections;
|
||||
import java.util.Comparator;
|
||||
|
||||
@@ -0,0 +1,33 @@
|
||||
package com.zt.plat.module.system.api.esp;
|
||||
|
||||
import com.zt.plat.framework.common.exception.enums.GlobalErrorCodeConstants;
|
||||
import com.zt.plat.framework.common.pojo.CommonResult;
|
||||
import com.zt.plat.framework.common.util.object.ObjectUtils;
|
||||
import com.zt.plat.module.system.api.dept.dto.DeptSaveReqDTO;
|
||||
import com.zt.plat.module.system.api.esp.dto.EspDto;
|
||||
import com.zt.plat.module.system.service.dept.IEspService;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
@RestController
|
||||
@Validated
|
||||
public class EspApiImpl implements EspApi {
|
||||
|
||||
|
||||
@Resource
|
||||
private IEspService deptService;
|
||||
@Override
|
||||
public CommonResult<List<EspDto>> pushMsg(DeptSaveReqDTO syncReqDTO)
|
||||
{
|
||||
if(Objects.isNull(syncReqDTO) || null == syncReqDTO.getId())
|
||||
{
|
||||
return CommonResult.error(GlobalErrorCodeConstants.BAD_REQUEST.getCode(),
|
||||
"ID不能为空");
|
||||
}
|
||||
return CommonResult.success(deptService.pushMsg(syncReqDTO));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -14,6 +14,7 @@ import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import jakarta.annotation.Resource;
|
||||
import jakarta.validation.Valid;
|
||||
import org.apache.commons.collections.CollectionUtils;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
@@ -94,13 +95,13 @@ public class EspController
|
||||
|
||||
|
||||
private void fillDeptInfo(List<EspSaveRespVo> list) {
|
||||
if (list == null || list.isEmpty()) {
|
||||
if (CollectionUtils.isEmpty(list)) {
|
||||
return;
|
||||
}
|
||||
Set<Long> deptIds = list.stream()
|
||||
.map(EspSaveRespVo::getDeptId)
|
||||
.collect(Collectors.toCollection(HashSet::new));
|
||||
if (deptIds == null || deptIds.isEmpty()) {
|
||||
if (CollectionUtils.isEmpty(deptIds)) {
|
||||
return;
|
||||
}
|
||||
Map<Long, DeptDO> deptMap = deptService.getDeptList(deptIds).stream()
|
||||
|
||||
@@ -25,4 +25,7 @@ public class EspSaveRespVo extends DeptExternalCodeBaseVO {
|
||||
@Schema(description = "最后更新时间")
|
||||
private LocalDateTime updateTime;
|
||||
|
||||
@Schema(description = "是否发送消息")
|
||||
private Integer isSendMsg;
|
||||
|
||||
}
|
||||
|
||||
@@ -6,6 +6,7 @@ import com.zt.plat.module.system.controller.admin.integration.iwork.vo.*;
|
||||
import com.zt.plat.module.system.service.integration.iwork.IWorkIntegrationService;
|
||||
import com.zt.plat.module.system.service.integration.iwork.IWorkOrgRestService;
|
||||
import com.zt.plat.module.system.service.integration.iwork.IWorkSyncService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import jakarta.annotation.security.PermitAll;
|
||||
@@ -18,9 +19,7 @@ import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import static com.zt.plat.framework.common.pojo.CommonResult.success;
|
||||
|
||||
/**
|
||||
* 提供统一 iWork 流程能力的管理端接口。
|
||||
*/
|
||||
@@ -29,6 +28,7 @@ import static com.zt.plat.framework.common.pojo.CommonResult.success;
|
||||
@RequestMapping("/system/integration/iwork")
|
||||
@RequiredArgsConstructor
|
||||
@Validated
|
||||
@Slf4j
|
||||
public class IWorkIntegrationController {
|
||||
|
||||
private final IWorkIntegrationService integrationService;
|
||||
@@ -139,6 +139,17 @@ public class IWorkIntegrationController {
|
||||
return success(syncService.fullSyncUsers(reqVO));
|
||||
}
|
||||
|
||||
// ----------------- 根据ID同步到本地 -----------------
|
||||
|
||||
@PostMapping("/syncById")
|
||||
@Operation(summary = "根据ID触发 iWork 同步公司")
|
||||
public CommonResult<IWorkFullSyncRespVO> syncById(@Valid @RequestBody IWorkSyncByIdReqVO reqVO) {
|
||||
|
||||
log.error("IWork集成后端手动录入syncById{}",reqVO);
|
||||
return success(syncService.manuallySyncData(reqVO));
|
||||
}
|
||||
|
||||
|
||||
private ResponseEntity<String> buildOaResponse(IWorkOaRawResponse resp) {
|
||||
if (resp == null) {
|
||||
return ResponseEntity.internalServerError().body("OA 响应为空");
|
||||
|
||||
@@ -56,4 +56,8 @@ public class IWorkFullSyncReqVO {
|
||||
}
|
||||
return resolved;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,99 @@
|
||||
package com.zt.plat.module.system.controller.admin.integration.iwork.vo;
|
||||
|
||||
import com.zt.plat.module.system.enums.integration.IWorkSyncEntityTypeEnum;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import jakarta.validation.constraints.Max;
|
||||
import jakarta.validation.constraints.Min;
|
||||
import jakarta.validation.constraints.NotBlank;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.EnumSet;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* iWork 手动同步请求
|
||||
*/
|
||||
@Data
|
||||
public class IWorkSyncByIdReqVO {
|
||||
|
||||
|
||||
@Schema(description = "起始页码,从 1 开始", example = "1")
|
||||
@Min(1)
|
||||
private Integer startPage = 1;
|
||||
|
||||
@Schema(description = "最大处理页数,null 表示处理至 iWork 返回的末页", example = "10")
|
||||
@Min(1)
|
||||
private Integer maxPages;
|
||||
|
||||
@Schema(description = "每次分页从 iWork 拉取的记录数", example = "100")
|
||||
@Min(1)
|
||||
@Max(500)
|
||||
private Integer pageSize = 100;
|
||||
|
||||
@Schema(description = "同步范围列表,默认同步全部。可选:subcompany、department、jobTitle、user")
|
||||
private List<String> scopes;
|
||||
|
||||
@Schema(description = "是否包含已失效(canceled=1)的记录", example = "false")
|
||||
private Boolean includeCanceled = Boolean.FALSE;
|
||||
|
||||
@Schema(description = "是否允许更新已存在的本地实体", example = "false")
|
||||
private Boolean allowUpdate = Boolean.FALSE;
|
||||
|
||||
|
||||
@Schema(description = "指定同步记录的 iWork ID。传入后仅同步对应记录", example = "12345")
|
||||
@NotBlank(message = "ID不能为空")
|
||||
private String 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 String parentId;
|
||||
|
||||
@Schema(description = "负责人的用户编号", example = "2048")
|
||||
private String leaderUserId;
|
||||
|
||||
@Schema(description = "联系电话", example = "15601691000")
|
||||
private String phone;
|
||||
|
||||
@Schema(description = "邮箱", example = "zt@iocoder.cn")
|
||||
private String email;
|
||||
|
||||
@Schema(description = "状态,见 CommonStatusEnum 枚举0 开启 1 关闭", example = "0")
|
||||
private Integer status;
|
||||
|
||||
private Long tenantId;
|
||||
|
||||
@Schema(description = "是否公司", example = "false")
|
||||
private boolean isCompany;
|
||||
|
||||
@Schema(description = "是否集团", example = "false")
|
||||
private boolean isGroup;
|
||||
|
||||
private boolean hasChildren;
|
||||
|
||||
|
||||
public Set<IWorkSyncEntityTypeEnum> resolveScopes() {
|
||||
EnumSet<IWorkSyncEntityTypeEnum> defaults = EnumSet.allOf(IWorkSyncEntityTypeEnum.class);
|
||||
if (scopes == null || scopes.isEmpty()) {
|
||||
return defaults;
|
||||
}
|
||||
Set<IWorkSyncEntityTypeEnum> resolved = scopes.stream()
|
||||
.map(IWorkSyncEntityTypeEnum::fromCode)
|
||||
.filter(java.util.Objects::nonNull)
|
||||
.collect(Collectors.toCollection(() -> EnumSet.noneOf(IWorkSyncEntityTypeEnum.class)));
|
||||
if (resolved.isEmpty()) {
|
||||
return defaults;
|
||||
}
|
||||
return resolved;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -55,4 +55,9 @@ public class DeptPushMsgDO extends TenantBaseDO {
|
||||
*/
|
||||
private String remark;
|
||||
|
||||
/**
|
||||
* 是否发送消息
|
||||
*/
|
||||
private Integer isSendMsg;
|
||||
|
||||
}
|
||||
|
||||
@@ -3,10 +3,12 @@ package com.zt.plat.module.system.dal.mysql.dept;
|
||||
import com.zt.plat.framework.common.pojo.PageResult;
|
||||
import com.zt.plat.framework.mybatis.core.mapper.BaseMapperX;
|
||||
import com.zt.plat.framework.mybatis.core.query.LambdaQueryWrapperX;
|
||||
import com.zt.plat.module.system.api.dept.dto.DeptSaveReqDTO;
|
||||
import com.zt.plat.module.system.controller.admin.dept.vo.depexternalcode.EspPageReqVO;
|
||||
import com.zt.plat.module.system.controller.admin.dept.vo.depexternalcode.EspSaveRespVo;
|
||||
import com.zt.plat.module.system.dal.dataobject.dept.DeptPushMsgDO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.apache.ibatis.annotations.Select;
|
||||
import java.util.List;
|
||||
/**
|
||||
* 部门推送消息接口Mapper
|
||||
@@ -54,4 +56,10 @@ public interface EspMapper extends BaseMapperX<DeptPushMsgDO> {
|
||||
return selectList(DeptPushMsgDO::getSystemCode, systemCode);
|
||||
}
|
||||
|
||||
@Select("SELECT ID,DEPT_ID, SYSTEM_CODE,EXTERNAL_DEPT_CODE,EXTERNAL_DEPT_NAME,STATUS,REMARK,TENANT_ID,CREATOR,CREATE_TIME,UPDATER,UPDATE_TIME" +
|
||||
"FROM" +
|
||||
"SYSTEM_DEPT_PUSH_MSG" +
|
||||
"WHERE" +
|
||||
" ID = #{id} AND IS_SEND_MSG = '0' AND DELETED = '0' ")
|
||||
List<DeptPushMsgDO> selectpushMsg(@Param("syncReqDTO") DeptSaveReqDTO syncReqDTO);
|
||||
}
|
||||
|
||||
@@ -4,6 +4,8 @@ import cn.hutool.core.util.StrUtil;
|
||||
import com.zt.plat.framework.common.enums.CommonStatusEnum;
|
||||
import com.zt.plat.framework.common.pojo.PageResult;
|
||||
import com.zt.plat.framework.common.util.object.BeanUtils;
|
||||
import com.zt.plat.module.system.api.dept.dto.DeptSaveReqDTO;
|
||||
import com.zt.plat.module.system.api.esp.dto.EspDto;
|
||||
import com.zt.plat.module.system.controller.admin.dept.vo.depexternalcode.EspPageReqVO;
|
||||
import com.zt.plat.module.system.controller.admin.dept.vo.depexternalcode.EspSaveRespVo;
|
||||
import com.zt.plat.module.system.dal.dataobject.dept.DeptDO;
|
||||
@@ -12,6 +14,8 @@ import com.zt.plat.module.system.dal.mysql.dept.DeptMapper;
|
||||
import com.zt.plat.module.system.dal.mysql.dept.EspMapper;
|
||||
import com.zt.plat.module.system.dal.redis.RedisKeyConstants;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.apache.commons.collections.CollectionUtils;
|
||||
import org.apache.seata.common.result.Result;
|
||||
import org.springframework.cache.CacheManager;
|
||||
import org.springframework.cache.annotation.CacheEvict;
|
||||
import org.springframework.cache.annotation.Cacheable;
|
||||
@@ -51,6 +55,7 @@ public class EspServiceImpl implements IEspService {
|
||||
if (entity.getStatus() == null) {
|
||||
entity.setStatus(CommonStatusEnum.ENABLE.getStatus());
|
||||
}
|
||||
entity.setIsSendMsg(0);
|
||||
espMapper.insert(entity);
|
||||
return entity.getId();
|
||||
}
|
||||
@@ -68,6 +73,7 @@ public class EspServiceImpl implements IEspService {
|
||||
if (updateObj.getStatus() == null) {
|
||||
updateObj.setStatus(exists.getStatus() == null ? CommonStatusEnum.ENABLE.getStatus() : exists.getStatus());
|
||||
}
|
||||
updateObj.setIsSendMsg(updateReqVO.getIsSendMsg());
|
||||
espMapper.updateById(updateObj);
|
||||
evictCacheSafely(exists.getDeptId());
|
||||
evictCacheSafely(updateObj.getDeptId());
|
||||
@@ -97,68 +103,11 @@ public class EspServiceImpl implements IEspService {
|
||||
return espMapper.selectListByDeptId(deptId);
|
||||
}
|
||||
|
||||
/* @Override
|
||||
public DeptExternalCodeDO getBySystemCodeAndExternalCode(String systemCode, String externalDeptCode) {
|
||||
if (StrUtil.hasEmpty(systemCode, externalDeptCode)) {
|
||||
return null;
|
||||
}
|
||||
return espMapper.selectBySystemCodeAndExternalCode(systemCode.trim(), externalDeptCode.trim());
|
||||
}*/
|
||||
@Override
|
||||
public List<EspDto> pushMsg(DeptSaveReqDTO syncReqDTO) {
|
||||
|
||||
/* @Override
|
||||
public DeptExternalCodeDO getBySystemCodeAndDeptId(String systemCode, Long deptId) {
|
||||
if (StrUtil.isBlank(systemCode) || deptId == null) {
|
||||
return null;
|
||||
}
|
||||
return espMapper.selectBySystemCodeAndDeptId(systemCode.trim(), deptId);
|
||||
}*/
|
||||
|
||||
/* @Override
|
||||
public Long getDeptPushMsgDetails(Long deptId, String systemCode, String externalDeptCode,
|
||||
String externalDeptName, Integer status) {
|
||||
|
||||
if (StrUtil.hasEmpty(systemCode, externalDeptCode) || deptId == null) {
|
||||
return null;
|
||||
}
|
||||
String normalizedSystemCode = systemCode.trim();
|
||||
String normalizedExternalCode = externalDeptCode.trim();
|
||||
String normalizedExternalName = StrUtil.blankToDefault(StrUtil.trimToNull(externalDeptName), null);
|
||||
|
||||
disableActiveMappingIfConflict(deptId, normalizedSystemCode, normalizedExternalCode);
|
||||
|
||||
// 如果存在则更新,否则创建
|
||||
DeptExternalCodeDO exists = espMapper.selectBySystemCodeAndDeptId(normalizedSystemCode, deptId);
|
||||
if (exists != null) {
|
||||
DeptExternalCodeSaveReqVO updateReqVO = new DeptExternalCodeSaveReqVO();
|
||||
updateReqVO.setId(exists.getId());
|
||||
updateReqVO.setDeptId(deptId);
|
||||
updateReqVO.setSystemCode(normalizedSystemCode);
|
||||
updateReqVO.setExternalDeptCode(normalizedExternalCode);
|
||||
updateReqVO.setExternalDeptName(normalizedExternalName);
|
||||
updateReqVO.setStatus(status == null ? exists.getStatus() : status);
|
||||
|
||||
//TODO
|
||||
//getDeptPushMsgDetails(updateReqVO);
|
||||
return exists.getId();
|
||||
}
|
||||
|
||||
DeptExternalCodeSaveReqVO createReqVO = new DeptExternalCodeSaveReqVO();
|
||||
createReqVO.setDeptId(deptId);
|
||||
createReqVO.setSystemCode(normalizedSystemCode);
|
||||
createReqVO.setExternalDeptCode(normalizedExternalCode);
|
||||
createReqVO.setExternalDeptName(normalizedExternalName);
|
||||
createReqVO.setStatus(status == null ? CommonStatusEnum.ENABLE.getStatus() : status);
|
||||
return getDeptPushMsgDetails(createReqVO);
|
||||
}*/
|
||||
|
||||
/* @Override
|
||||
public void deleteDeptExternalCodesByDeptId(Long deptId) {
|
||||
if (deptId == null) {
|
||||
return;
|
||||
}
|
||||
espMapper.deleteByDeptId(deptId);
|
||||
evictCacheSafely(deptId);
|
||||
}*/
|
||||
return BeanUtils.toBean(espMapper.selectpushMsg(syncReqDTO), EspDto.class);
|
||||
}
|
||||
|
||||
private DeptPushMsgDO validateExists(Long id) {
|
||||
if (id == null) {
|
||||
|
||||
@@ -1,10 +1,11 @@
|
||||
package com.zt.plat.module.system.service.dept;
|
||||
|
||||
import com.zt.plat.framework.common.pojo.PageResult;
|
||||
import com.zt.plat.module.system.api.dept.dto.DeptSaveReqDTO;
|
||||
import com.zt.plat.module.system.api.esp.dto.EspDto;
|
||||
import com.zt.plat.module.system.controller.admin.dept.vo.depexternalcode.EspPageReqVO;
|
||||
import com.zt.plat.module.system.controller.admin.dept.vo.depexternalcode.EspSaveRespVo;
|
||||
import com.zt.plat.module.system.dal.dataobject.dept.DeptPushMsgDO;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
@@ -27,7 +28,6 @@ public interface IEspService {
|
||||
|
||||
/**
|
||||
* 删除映射关系
|
||||
*
|
||||
* @param id 记录编号
|
||||
*/
|
||||
void deleteDeptPushMsg(Long id);
|
||||
@@ -47,33 +47,11 @@ public interface IEspService {
|
||||
*/
|
||||
List<DeptPushMsgDO> getPushMsgByDeptId(Long deptId);
|
||||
|
||||
/**
|
||||
* 根据部门与外部系统保存/更新映射(存在则更新,不存在则创建)
|
||||
* @param deptId 本系统部门 ID
|
||||
* @param systemCode 外部系统标识
|
||||
* @param externalDeptCode 外部系统组织编码
|
||||
* @param externalDeptName 外部系统组织名称(可选)
|
||||
* @param status 状态,默认启用
|
||||
* @return 映射记录 ID
|
||||
*/
|
||||
/* Long getDeptPushMsgDetails(Long deptId, String systemCode, String externalDeptCode, String externalDeptName,
|
||||
Integer status);*/
|
||||
|
||||
/**
|
||||
* 根据部门删除全部外部编码映射
|
||||
*
|
||||
* @param deptId 部门编号
|
||||
* 推送部门数据到外部系统
|
||||
* @param syncReqDTO 同步请求
|
||||
*/
|
||||
//void deleteDeptExternalCodesByDeptId(Long deptId);
|
||||
|
||||
/**
|
||||
* 根据外部系统与外部组织编码查询映射
|
||||
*/
|
||||
//DeptExternalCodeDO getBySystemCodeAndExternalCode(String systemCode, String externalDeptCode);
|
||||
|
||||
/**
|
||||
* 根据外部系统与部门编号查询映射
|
||||
*/
|
||||
//DeptExternalCodeDO getBySystemCodeAndDeptId(String systemCode, Long deptId);
|
||||
List<EspDto> pushMsg(DeptSaveReqDTO syncReqDTO);
|
||||
|
||||
}
|
||||
|
||||
@@ -19,19 +19,19 @@ public interface IWorkSyncProcessor {
|
||||
|
||||
BatchResult syncSubcompanies(List<IWorkHrSubcompanyPageRespVO.Subcompany> data,
|
||||
SyncOptions options);
|
||||
|
||||
// 同步子公司
|
||||
BatchResult syncSubcompanies(List<IWorkHrSubcompanyPageRespVO.Subcompany> data,
|
||||
SyncOptions options,
|
||||
DeptSyncContext context);
|
||||
|
||||
BatchResult syncDepartments(List<IWorkHrDepartmentPageRespVO.Department> data, SyncOptions options);
|
||||
|
||||
// 同步部门
|
||||
BatchResult syncDepartments(List<IWorkHrDepartmentPageRespVO.Department> data,
|
||||
SyncOptions options,
|
||||
DeptSyncContext context);
|
||||
|
||||
// 同步岗位
|
||||
BatchResult syncJobTitles(List<IWorkHrJobTitlePageRespVO.JobTitle> data, SyncOptions options);
|
||||
|
||||
// 同步用户
|
||||
BatchResult syncUsers(List<IWorkHrUserPageRespVO.User> data, SyncOptions options);
|
||||
|
||||
/**
|
||||
|
||||
@@ -2,6 +2,9 @@ package com.zt.plat.module.system.service.integration.iwork;
|
||||
|
||||
import com.zt.plat.module.system.controller.admin.integration.iwork.vo.IWorkFullSyncReqVO;
|
||||
import com.zt.plat.module.system.controller.admin.integration.iwork.vo.IWorkFullSyncRespVO;
|
||||
import com.zt.plat.module.system.controller.admin.integration.iwork.vo.IWorkSyncByIdReqVO;
|
||||
import jakarta.validation.Valid;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* iWork 组织/人员同步服务
|
||||
@@ -28,4 +31,8 @@ public interface IWorkSyncService {
|
||||
*/
|
||||
IWorkFullSyncRespVO fullSyncUsers(IWorkFullSyncReqVO reqVO);
|
||||
|
||||
/**
|
||||
* 手动同步
|
||||
*/
|
||||
IWorkFullSyncRespVO manuallySyncData(@Valid IWorkSyncByIdReqVO list);
|
||||
}
|
||||
|
||||
@@ -52,7 +52,7 @@ public class IWorkSyncProcessorImpl implements IWorkSyncProcessor {
|
||||
public BatchResult syncSubcompanies(List<IWorkHrSubcompanyPageRespVO.Subcompany> data, SyncOptions options) {
|
||||
return syncSubcompanies(data, options, null);
|
||||
}
|
||||
|
||||
//1、同步子公司
|
||||
@Override
|
||||
public BatchResult syncSubcompanies(List<IWorkHrSubcompanyPageRespVO.Subcompany> data,
|
||||
SyncOptions options,
|
||||
@@ -154,7 +154,7 @@ public class IWorkSyncProcessorImpl implements IWorkSyncProcessor {
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
//2、同步部门
|
||||
@Override
|
||||
public BatchResult syncDepartments(List<IWorkHrDepartmentPageRespVO.Department> data, SyncOptions options) {
|
||||
return syncDepartments(data, options, null);
|
||||
@@ -272,7 +272,7 @@ public class IWorkSyncProcessorImpl implements IWorkSyncProcessor {
|
||||
result.merge(syncDepartmentsInternal(Collections.emptyList(), options, context, true));
|
||||
return result;
|
||||
}
|
||||
|
||||
//TODO 3、同步岗位
|
||||
@Override
|
||||
public BatchResult syncJobTitles(List<IWorkHrJobTitlePageRespVO.JobTitle> data, SyncOptions options) {
|
||||
List<IWorkHrJobTitlePageRespVO.JobTitle> records = CollUtil.emptyIfNull(data);
|
||||
@@ -310,7 +310,7 @@ public class IWorkSyncProcessorImpl implements IWorkSyncProcessor {
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
//TODO 4、同步用户
|
||||
@Override
|
||||
public BatchResult syncUsers(List<IWorkHrUserPageRespVO.User> data, SyncOptions options) {
|
||||
List<IWorkHrUserPageRespVO.User> records = CollUtil.emptyIfNull(data);
|
||||
@@ -377,7 +377,7 @@ public class IWorkSyncProcessorImpl implements IWorkSyncProcessor {
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
//TODO
|
||||
private DeptSyncOutcome upsertDept(Long deptId,
|
||||
DeptSaveReqVO desired,
|
||||
boolean disabled,
|
||||
|
||||
@@ -12,6 +12,7 @@ import com.zt.plat.module.system.service.integration.iwork.IWorkSyncService;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.EnumSet;
|
||||
@@ -34,32 +35,59 @@ public class IWorkSyncServiceImpl implements IWorkSyncService {
|
||||
private final IWorkSyncProcessor syncProcessor;
|
||||
private final DeptService deptService;
|
||||
|
||||
/**
|
||||
* 同步部门
|
||||
*/
|
||||
@Override
|
||||
public IWorkFullSyncRespVO fullSyncDepartments(IWorkFullSyncReqVO reqVO) {
|
||||
return runFullSync(reqVO, EnumSet.of(IWorkSyncEntityTypeEnum.DEPARTMENT));
|
||||
}
|
||||
|
||||
/**
|
||||
* 仅同步分部
|
||||
*/
|
||||
@Override
|
||||
public IWorkFullSyncRespVO fullSyncSubcompanies(IWorkFullSyncReqVO reqVO) {
|
||||
return runFullSync(reqVO, EnumSet.of(IWorkSyncEntityTypeEnum.SUBCOMPANY));
|
||||
}
|
||||
|
||||
/**
|
||||
* 仅同步岗位
|
||||
*/
|
||||
@Override
|
||||
public IWorkFullSyncRespVO fullSyncJobTitles(IWorkFullSyncReqVO reqVO) {
|
||||
return runFullSync(reqVO, EnumSet.of(IWorkSyncEntityTypeEnum.JOB_TITLE));
|
||||
}
|
||||
|
||||
/**
|
||||
* 仅同步人员(会自动包含依赖的分部、部门)
|
||||
*/
|
||||
@Override
|
||||
public IWorkFullSyncRespVO fullSyncUsers(IWorkFullSyncReqVO reqVO) {
|
||||
return runFullSync(reqVO, EnumSet.of(IWorkSyncEntityTypeEnum.USER));
|
||||
}
|
||||
|
||||
/**
|
||||
* 手动同步
|
||||
*/
|
||||
@Transactional
|
||||
@Override
|
||||
public IWorkFullSyncRespVO manuallySyncData(IWorkSyncByIdReqVO reqVO) {
|
||||
return manuallySyncData(reqVO, EnumSet.of(IWorkSyncEntityTypeEnum.USER));
|
||||
}
|
||||
|
||||
/**
|
||||
* 全量同步方法
|
||||
* @param reqVO 请求参数
|
||||
* @param scopes 同步范围
|
||||
* @return 响应对象
|
||||
*/
|
||||
private IWorkFullSyncRespVO runFullSync(IWorkFullSyncReqVO reqVO, Set<IWorkSyncEntityTypeEnum> scopes) {
|
||||
IWorkFullSyncRespVO respVO = new IWorkFullSyncRespVO();
|
||||
IWorkFullSyncRespVO respVO = new IWorkFullSyncRespVO();//1 初始化响应对象:创建响应VO并设置分页大小和批次统计列表
|
||||
respVO.setPageSize(reqVO.getPageSize());
|
||||
List<IWorkSyncBatchStatVO> batchStats = new ArrayList<>();
|
||||
respVO.setBatches(batchStats);
|
||||
|
||||
//2 解析同步范围:根据传入的scopes确定需要同步的实体类型(用户、部门、分部、岗位)
|
||||
boolean syncUsers = scopes.contains(IWorkSyncEntityTypeEnum.USER);
|
||||
boolean syncDepartments = scopes.contains(IWorkSyncEntityTypeEnum.DEPARTMENT);
|
||||
boolean syncSubcompanies = scopes.contains(IWorkSyncEntityTypeEnum.SUBCOMPANY);
|
||||
@@ -69,18 +97,20 @@ public class IWorkSyncServiceImpl implements IWorkSyncService {
|
||||
IWorkSyncProcessor.DeptSyncContext deptSyncContext = (syncDepartments || syncSubcompanies)
|
||||
? new IWorkSyncProcessor.DeptSyncContext()
|
||||
: null;
|
||||
if (syncSubcompanies) {
|
||||
//3 按类型执行同步:依次执行分部、部门、岗位、用户的分页同步操作
|
||||
if (syncSubcompanies) { //公司
|
||||
processedPages += executeSubcompanyFullSync(reqVO, options, respVO.getSubcompanyStat(), batchStats, deptSyncContext);
|
||||
}
|
||||
if (syncDepartments) {
|
||||
if (syncDepartments) { //部门
|
||||
processedPages += executeDepartmentFullSync(reqVO, options, respVO.getDepartmentStat(), batchStats, deptSyncContext);
|
||||
}
|
||||
if (syncJobTitle) {
|
||||
if (syncJobTitle) { // 岗位
|
||||
processedPages += executeJobTitleFullSync(reqVO, options, respVO.getJobTitleStat(), batchStats);
|
||||
}
|
||||
if (syncUsers) {
|
||||
if (syncUsers) { //人员
|
||||
processedPages += executeUserFullSync(reqVO, options, respVO.getUserStat(), batchStats);
|
||||
}
|
||||
//4、处理部门上下文:对部门和分部同步进行特殊处理,包括刷新待处理数据和补全部门编码
|
||||
if (deptSyncContext != null) {
|
||||
IWorkSyncProcessor.BatchResult flushResult = syncProcessor.flushDeptPending(deptSyncContext, options);
|
||||
updateStat(respVO.getDepartmentStat(), flushResult, 0);
|
||||
@@ -92,6 +122,9 @@ public class IWorkSyncServiceImpl implements IWorkSyncService {
|
||||
return respVO;
|
||||
}
|
||||
|
||||
/**
|
||||
* 全量执行子公司全量同步
|
||||
*/
|
||||
private int executeSubcompanyFullSync(IWorkFullSyncReqVO reqVO,
|
||||
IWorkSyncProcessor.SyncOptions options,
|
||||
IWorkSyncEntityStatVO stat,
|
||||
@@ -103,7 +136,7 @@ public class IWorkSyncServiceImpl implements IWorkSyncService {
|
||||
query.setPagesize(pageSize);
|
||||
applyQueryConditions(query, reqVO);
|
||||
IWorkHrSubcompanyPageRespVO pageResp = orgRestService.listSubcompanies(query);
|
||||
ensureIWorkSuccess("拉取分部", pageResp.isSuccess(), pageResp.getMessage());
|
||||
ensureIWorkSuccess("拉取分部", pageResp.isSuccess(), pageResp.getMessage());// IWork执行成功
|
||||
List<IWorkHrSubcompanyPageRespVO.Subcompany> dataList = CollUtil.emptyIfNull(pageResp.getDataList());
|
||||
IWorkSyncProcessor.BatchResult result = syncProcessor.syncSubcompanies(dataList, options, context);
|
||||
updateStat(stat, result, dataList.size());
|
||||
@@ -111,6 +144,9 @@ public class IWorkSyncServiceImpl implements IWorkSyncService {
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 执行部门全量同步
|
||||
*/
|
||||
private int executeDepartmentFullSync(IWorkFullSyncReqVO reqVO,
|
||||
IWorkSyncProcessor.SyncOptions options,
|
||||
IWorkSyncEntityStatVO stat,
|
||||
@@ -130,6 +166,9 @@ public class IWorkSyncServiceImpl implements IWorkSyncService {
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 执行岗位全量同步
|
||||
*/
|
||||
private int executeJobTitleFullSync(IWorkFullSyncReqVO reqVO,
|
||||
IWorkSyncProcessor.SyncOptions options,
|
||||
IWorkSyncEntityStatVO stat,
|
||||
@@ -148,6 +187,9 @@ public class IWorkSyncServiceImpl implements IWorkSyncService {
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 执行用户全量同步
|
||||
*/
|
||||
private int executeUserFullSync(IWorkFullSyncReqVO reqVO,
|
||||
IWorkSyncProcessor.SyncOptions options,
|
||||
IWorkSyncEntityStatVO stat,
|
||||
@@ -193,6 +235,12 @@ public class IWorkSyncServiceImpl implements IWorkSyncService {
|
||||
return processedPages;
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新统计
|
||||
* @param stat 统计
|
||||
* @param result 结果
|
||||
* @param pulled 拉取数量
|
||||
*/
|
||||
private void updateStat(IWorkSyncEntityStatVO stat, IWorkSyncProcessor.BatchResult result, int pulled) {
|
||||
stat.incrementPulled(pulled);
|
||||
stat.incrementCreated(result.getCreated());
|
||||
@@ -201,6 +249,11 @@ public class IWorkSyncServiceImpl implements IWorkSyncService {
|
||||
stat.incrementFailed(result.getFailed());
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询条件
|
||||
* @param query 查询条件
|
||||
* @param reqVO 请求
|
||||
*/
|
||||
private void applyQueryConditions(IWorkOrgBaseQueryReqVO query, IWorkFullSyncReqVO reqVO) {
|
||||
if (query == null || reqVO == null) {
|
||||
return;
|
||||
@@ -216,6 +269,9 @@ public class IWorkSyncServiceImpl implements IWorkSyncService {
|
||||
params.put("id", reqVO.getId());
|
||||
}
|
||||
|
||||
/**
|
||||
* 全量同步
|
||||
*/
|
||||
private IWorkSyncProcessor.SyncOptions buildFullSyncOptions(IWorkFullSyncReqVO reqVO) {
|
||||
boolean includeCanceled = Boolean.TRUE.equals(reqVO.getIncludeCanceled());
|
||||
boolean allowUpdate = Boolean.TRUE.equals(reqVO.getAllowUpdate());
|
||||
@@ -237,4 +293,197 @@ public class IWorkSyncServiceImpl implements IWorkSyncService {
|
||||
|
||||
private record BatchExecution(IWorkSyncProcessor.BatchResult result, int totalPulled) {
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 根据ID同步
|
||||
*/
|
||||
private IWorkFullSyncRespVO manuallySyncData(IWorkSyncByIdReqVO reqVO, Set<IWorkSyncEntityTypeEnum> scopes) {
|
||||
|
||||
//1 初始化响应对象:创建响应VO并设置分页大小和批次统计列表
|
||||
IWorkFullSyncRespVO respVO = new IWorkFullSyncRespVO();
|
||||
List<IWorkSyncBatchStatVO> batchStats = new ArrayList<>();
|
||||
respVO.setBatches(batchStats);
|
||||
//2 解析同步范围:根据传入的scopes确定需要同步的实体类型(用户、部门、分部、岗位)
|
||||
boolean syncUsers = scopes.contains(IWorkSyncEntityTypeEnum.USER);
|
||||
boolean syncDepartments = scopes.contains(IWorkSyncEntityTypeEnum.DEPARTMENT);
|
||||
boolean syncSubcompanies = scopes.contains(IWorkSyncEntityTypeEnum.SUBCOMPANY);
|
||||
boolean syncJobTitle = scopes.contains(IWorkSyncEntityTypeEnum.JOB_TITLE);
|
||||
int processedPages = 0;
|
||||
IWorkSyncProcessor.SyncOptions options = manualSync(reqVO);
|
||||
IWorkSyncProcessor.DeptSyncContext deptSyncContext = (syncDepartments || syncSubcompanies)
|
||||
? new IWorkSyncProcessor.DeptSyncContext()
|
||||
: null;
|
||||
//3 按类型执行同步:依次执行分部、部门、岗位、用户的分页同步操作
|
||||
if (syncSubcompanies) {
|
||||
processedPages += runManualFullSyncForSubsidiaries(reqVO, options, respVO.getSubcompanyStat(), batchStats, deptSyncContext);//分部统计信息
|
||||
}
|
||||
if (syncDepartments) {
|
||||
processedPages += departments(reqVO, options, respVO.getDepartmentStat(), batchStats, deptSyncContext);//部门统计信息
|
||||
}
|
||||
if (syncJobTitle) {
|
||||
processedPages += syncPositionsManually(reqVO, options, respVO.getJobTitleStat(), batchStats);//岗位统计信息
|
||||
}
|
||||
if (syncUsers) {
|
||||
processedPages += syncUsers(reqVO, options, respVO.getUserStat(), batchStats);//用户统计信息
|
||||
}
|
||||
//4、处理部门上下文:对部门和分部同步进行特殊处理,包括刷新待处理数据和补全部门编码
|
||||
if (deptSyncContext != null) {
|
||||
IWorkSyncProcessor.BatchResult flushResult = syncProcessor.flushDeptPending(deptSyncContext, options);
|
||||
updateStat(respVO.getDepartmentStat(), flushResult, 0);//部门统计信息
|
||||
if (CollUtil.isNotEmpty(deptSyncContext.getPlaceholderDeptIds())) {
|
||||
deptService.backfillMissingCodesWithoutEvent(deptSyncContext.getPlaceholderDeptIds());
|
||||
}
|
||||
}
|
||||
respVO.setProcessedPages(processedPages);
|
||||
return respVO;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 手动同步
|
||||
*/
|
||||
private IWorkSyncProcessor.SyncOptions manualSync(IWorkSyncByIdReqVO reqVO) {
|
||||
boolean includeCanceled = Boolean.TRUE.equals(reqVO.getIncludeCanceled());
|
||||
boolean allowUpdate = Boolean.TRUE.equals(reqVO.getAllowUpdate());
|
||||
return IWorkSyncProcessor.SyncOptions.custom(includeCanceled, allowUpdate, true);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 手动执行子公司全量同步f
|
||||
*/
|
||||
private int runManualFullSyncForSubsidiaries(IWorkSyncByIdReqVO reqVO,
|
||||
IWorkSyncProcessor.SyncOptions options,
|
||||
IWorkSyncEntityStatVO stat,
|
||||
List<IWorkSyncBatchStatVO> batches,
|
||||
IWorkSyncProcessor.DeptSyncContext context) {
|
||||
return paged(reqVO, IWorkSyncEntityTypeEnum.SUBCOMPANY, batches, (page, pageSize) -> {
|
||||
IWorkSubcompanyQueryReqVO query = new IWorkSubcompanyQueryReqVO();
|
||||
query.setCurpage(page);
|
||||
query.setPagesize(pageSize);
|
||||
applyQuery(query, reqVO);//查询条件
|
||||
IWorkHrSubcompanyPageRespVO pageResp = orgRestService.listSubcompanies(query);
|
||||
ensureIWorkSuccess("拉取分部", pageResp.isSuccess(), pageResp.getMessage());// IWork执行成功
|
||||
List<IWorkHrSubcompanyPageRespVO.Subcompany> dataList = CollUtil.emptyIfNull(pageResp.getDataList());
|
||||
IWorkSyncProcessor.BatchResult result = syncProcessor.syncSubcompanies(dataList, options, context);
|
||||
updateStat(stat, result, dataList.size());
|
||||
return new BatchExecution(result, dataList.size());
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 查询条件
|
||||
* @param query 查询条件
|
||||
* @param reqVO 请求
|
||||
*/
|
||||
private void applyQuery(IWorkOrgBaseQueryReqVO query, IWorkSyncByIdReqVO reqVO) {
|
||||
if (query == null || reqVO == null) {
|
||||
return;
|
||||
}
|
||||
if (StrUtil.isBlank(reqVO.getId())) {
|
||||
return;
|
||||
}
|
||||
Map<String, Object> params = query.getParams();
|
||||
if (params == null) {
|
||||
params = new HashMap<>();
|
||||
query.setParams(params);
|
||||
}
|
||||
params.put("id", reqVO.getId());
|
||||
}
|
||||
|
||||
|
||||
private int paged(IWorkSyncByIdReqVO reqVO,
|
||||
IWorkSyncEntityTypeEnum type,
|
||||
List<IWorkSyncBatchStatVO> batches,
|
||||
PageExecutor executor) {
|
||||
int startPage = reqVO.getStartPage() == null ? 1 : reqVO.getStartPage();
|
||||
int pageSize = reqVO.getPageSize() == null ? 100 : reqVO.getPageSize();
|
||||
int pagesLimit = reqVO.getMaxPages() == null ? Integer.MAX_VALUE : reqVO.getMaxPages();
|
||||
int processedPages = 0;
|
||||
for (int page = startPage; processedPages < pagesLimit; page++) {
|
||||
BatchExecution execution = executor.execute(page, pageSize);
|
||||
if (execution == null || execution.totalPulled == 0) {
|
||||
break;
|
||||
}
|
||||
processedPages++;
|
||||
IWorkSyncBatchStatVO batchStat = new IWorkSyncBatchStatVO();
|
||||
batchStat.setEntityType(type);
|
||||
batchStat.setPageNumber(page);
|
||||
batchStat.setPulled(execution.totalPulled);
|
||||
batchStat.setCreated(execution.result.getCreated());
|
||||
batchStat.setSkippedExisting(execution.result.getSkipped());
|
||||
batchStat.setDisabled(execution.result.getDisabled());
|
||||
batchStat.setFailed(execution.result.getFailed());
|
||||
batches.add(batchStat);
|
||||
}
|
||||
return processedPages;
|
||||
}
|
||||
|
||||
/**
|
||||
* 手动执行部门同步
|
||||
*/
|
||||
private int departments(IWorkSyncByIdReqVO reqVO,
|
||||
IWorkSyncProcessor.SyncOptions options,
|
||||
IWorkSyncEntityStatVO stat,
|
||||
List<IWorkSyncBatchStatVO> batches,
|
||||
IWorkSyncProcessor.DeptSyncContext context) {
|
||||
return paged(reqVO, IWorkSyncEntityTypeEnum.DEPARTMENT, batches, (page, pageSize) -> {
|
||||
IWorkDepartmentQueryReqVO query = new IWorkDepartmentQueryReqVO();
|
||||
query.setCurpage(page);
|
||||
query.setPagesize(pageSize);
|
||||
applyQuery(query, reqVO);
|
||||
IWorkHrDepartmentPageRespVO pageResp = orgRestService.listDepartments(query);
|
||||
ensureIWorkSuccess("拉取部门", pageResp.isSuccess(), pageResp.getMessage());
|
||||
List<IWorkHrDepartmentPageRespVO.Department> dataList = CollUtil.emptyIfNull(pageResp.getDataList());
|
||||
IWorkSyncProcessor.BatchResult result = syncProcessor.syncDepartments(dataList, options, context);
|
||||
updateStat(stat, result, dataList.size());
|
||||
return new BatchExecution(result, dataList.size());
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 手动执行岗位同步
|
||||
*/
|
||||
private int syncPositionsManually(IWorkSyncByIdReqVO reqVO,
|
||||
IWorkSyncProcessor.SyncOptions options,
|
||||
IWorkSyncEntityStatVO stat,
|
||||
List<IWorkSyncBatchStatVO> batches) {
|
||||
return paged(reqVO, IWorkSyncEntityTypeEnum.JOB_TITLE, batches, (page, pageSize) -> {
|
||||
IWorkJobTitleQueryReqVO query = new IWorkJobTitleQueryReqVO();
|
||||
query.setCurpage(page);
|
||||
query.setPagesize(pageSize);
|
||||
applyQuery(query, reqVO);
|
||||
IWorkHrJobTitlePageRespVO pageResp = orgRestService.listJobTitles(query);
|
||||
ensureIWorkSuccess("拉取岗位", pageResp.isSuccess(), pageResp.getMessage());
|
||||
List<IWorkHrJobTitlePageRespVO.JobTitle> dataList = CollUtil.emptyIfNull(pageResp.getDataList());
|
||||
IWorkSyncProcessor.BatchResult result = syncProcessor.syncJobTitles(dataList, options);
|
||||
updateStat(stat, result, dataList.size());
|
||||
return new BatchExecution(result, dataList.size());
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 手动执行用户同步
|
||||
*/
|
||||
private int syncUsers(IWorkSyncByIdReqVO reqVO,
|
||||
IWorkSyncProcessor.SyncOptions options,
|
||||
IWorkSyncEntityStatVO stat,
|
||||
List<IWorkSyncBatchStatVO> batches) {
|
||||
return paged(reqVO, IWorkSyncEntityTypeEnum.USER, batches, (page, pageSize) -> {
|
||||
IWorkUserQueryReqVO query = new IWorkUserQueryReqVO();
|
||||
query.setCurpage(page);
|
||||
query.setPagesize(pageSize);
|
||||
applyQuery(query, reqVO);
|
||||
IWorkHrUserPageRespVO pageResp = orgRestService.listUsers(query);
|
||||
ensureIWorkSuccess("拉取人员", pageResp.isSuccess(), pageResp.getMessage());
|
||||
List<IWorkHrUserPageRespVO.User> dataList = CollUtil.emptyIfNull(pageResp.getDataList());
|
||||
IWorkSyncProcessor.BatchResult result = syncProcessor.syncUsers(dataList, options);
|
||||
updateStat(stat, result, dataList.size());
|
||||
return new BatchExecution(result, dataList.size());
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -38,14 +38,20 @@ spring:
|
||||
primary: master
|
||||
datasource:
|
||||
master:
|
||||
url: jdbc:dm://172.16.46.247:1050?schema=RUOYI-VUE-PRO
|
||||
#url: jdbc:dm://172.16.46.247:1050?schema=RUOYI-VUE-PRO
|
||||
#username: SYSDBA
|
||||
#password: pgbsci6ddJ6Sqj@e
|
||||
url: jdbc:dm://172.17.11.98:20870?schema=JYGK_TEST
|
||||
username: SYSDBA
|
||||
password: pgbsci6ddJ6Sqj@e
|
||||
password: P@ssword25
|
||||
slave: # 模拟从库,可根据自己需要修改 # 模拟从库,可根据自己需要修改
|
||||
lazy: true # 开启懒加载,保证启动速度
|
||||
url: jdbc:dm://172.16.46.247:1050?schema=RUOYI-VUE-PRO
|
||||
#url: jdbc:dm://172.16.46.247:1050?schema=RUOYI-VUE-PRO
|
||||
#username: SYSDBA
|
||||
#password: pgbsci6ddJ6Sqj@e
|
||||
url: jdbc:dm://172.17.11.98:20870?schema=JYGK_TEST
|
||||
username: SYSDBA
|
||||
password: pgbsci6ddJ6Sqj@e
|
||||
password: P@ssword25
|
||||
|
||||
# Redis 配置。Redisson 默认的配置足够使用,一般不需要进行调优
|
||||
data:
|
||||
|
||||
@@ -39,14 +39,20 @@ spring:
|
||||
primary: master
|
||||
datasource:
|
||||
master:
|
||||
url: jdbc:dm://172.16.46.247:1050?schema=RUOYI-VUE-PRO
|
||||
#url: jdbc:dm://172.16.46.247:1050?schema=RUOYI-VUE-PRO
|
||||
#username: SYSDBA
|
||||
#password: pgbsci6ddJ6Sqj@e
|
||||
url: jdbc:dm://172.17.11.98:20870?schema=JYGK_TEST
|
||||
username: SYSDBA
|
||||
password: pgbsci6ddJ6Sqj@e
|
||||
password: P@ssword25
|
||||
slave: # 模拟从库,可根据自己需要修改 # 模拟从库,可根据自己需要修改
|
||||
lazy: true # 开启懒加载,保证启动速度
|
||||
url: jdbc:dm://172.16.46.247:1050?schema=RUOYI-VUE-PRO
|
||||
#url: jdbc:dm://172.16.46.247:1050?schema=RUOYI-VUE-PRO
|
||||
#username: SYSDBA
|
||||
#password: pgbsci6ddJ6Sqj@e
|
||||
url: jdbc:dm://172.17.11.98:20870?schema=JYGK_TEST
|
||||
username: SYSDBA
|
||||
password: pgbsci6ddJ6Sqj@e
|
||||
password: P@ssword25
|
||||
|
||||
# Redis 配置。Redisson 默认的配置足够使用,一般不需要进行调优
|
||||
data:
|
||||
|
||||
@@ -38,14 +38,20 @@ spring:
|
||||
primary: master
|
||||
datasource:
|
||||
master:
|
||||
url: jdbc:dm://172.16.46.247:1050?schema=RUOYI-VUE-PRO
|
||||
#url: jdbc:dm://172.16.46.247:1050?schema=RUOYI-VUE-PRO
|
||||
#username: SYSDBA
|
||||
#password: pgbsci6ddJ6Sqj@e
|
||||
url: jdbc:dm://172.17.11.98:20870?schema=JYGK_TEST
|
||||
username: SYSDBA
|
||||
password: pgbsci6ddJ6Sqj@e
|
||||
password: P@ssword25
|
||||
slave: # 模拟从库,可根据自己需要修改 # 模拟从库,可根据自己需要修改
|
||||
lazy: true # 开启懒加载,保证启动速度
|
||||
url: jdbc:dm://172.16.46.247:1050?schema=RUOYI-VUE-PRO
|
||||
#url: jdbc:dm://172.16.46.247:1050?schema=RUOYI-VUE-PRO
|
||||
#username: SYSDBA
|
||||
#password: pgbsci6ddJ6Sqj@e
|
||||
url: jdbc:dm://172.17.11.98:20870?schema=JYGK_TEST
|
||||
username: SYSDBA
|
||||
password: pgbsci6ddJ6Sqj@e
|
||||
password: P@ssword25
|
||||
|
||||
# Redis 配置。Redisson 默认的配置足够使用,一般不需要进行调优
|
||||
data:
|
||||
|
||||
@@ -40,14 +40,20 @@ spring:
|
||||
primary: master
|
||||
datasource:
|
||||
master:
|
||||
url: jdbc:dm://172.16.46.247:1050?schema=RUOYI-VUE-PRO
|
||||
#url: jdbc:dm://172.16.46.247:1050?schema=RUOYI-VUE-PRO
|
||||
#username: SYSDBA
|
||||
#password: pgbsci6ddJ6Sqj@e
|
||||
url: jdbc:dm://172.17.11.98:20870?schema=JYGK_TEST
|
||||
username: SYSDBA
|
||||
password: pgbsci6ddJ6Sqj@e
|
||||
password: P@ssword25
|
||||
slave: # 模拟从库,可根据自己需要修改 # 模拟从库,可根据自己需要修改
|
||||
lazy: true # 开启懒加载,保证启动速度
|
||||
url: jdbc:dm://172.16.46.247:1050?schema=RUOYI-VUE-PRO
|
||||
#url: jdbc:dm://172.16.46.247:1050?schema=RUOYI-VUE-PRO
|
||||
#username: SYSDBA
|
||||
#password: pgbsci6ddJ6Sqj@e
|
||||
url: jdbc:dm://172.17.11.98:20870?schema=JYGK_TEST
|
||||
username: SYSDBA
|
||||
password: pgbsci6ddJ6Sqj@e
|
||||
password: P@ssword25
|
||||
|
||||
# Redis 配置。Redisson 默认的配置足够使用,一般不需要进行调优
|
||||
data:
|
||||
|
||||
Reference in New Issue
Block a user