1. 统一 iwork 的同步组织代码生成逻辑

This commit is contained in:
chenbowen
2025-12-18 14:18:56 +08:00
parent 870c6a5f88
commit 1fa7416905
3 changed files with 29 additions and 4 deletions

View File

@@ -12,9 +12,11 @@ import com.zt.plat.module.system.dal.mysql.dept.DeptExternalCodeMapper;
import com.zt.plat.module.system.dal.mysql.dept.DeptMapper;
import com.zt.plat.module.system.dal.redis.RedisKeyConstants;
import com.zt.plat.module.system.enums.dept.DeptSourceEnum;
import com.zt.plat.module.system.service.permission.PermissionService;
import jakarta.annotation.Resource;
import org.junit.jupiter.api.Test;
import org.springframework.boot.test.context.TestConfiguration;
import org.springframework.boot.test.mock.mockito.MockBean;
import org.springframework.cache.CacheManager;
import org.springframework.cache.annotation.EnableCaching;
import org.springframework.cache.concurrent.ConcurrentMapCacheManager;
@@ -51,6 +53,9 @@ public class DeptServiceImplTest extends BaseDbUnitTest {
@Resource
private CacheManager cacheManager;
@MockBean
private PermissionService permissionService;
@TestConfiguration
@EnableCaching
static class CacheConfig {

View File

@@ -12,7 +12,7 @@ create table IF NOT EXISTS system_user_dept (
);
CREATE TABLE IF NOT EXISTS "system_dept" (
"id" bigint NOT NULL GENERATED BY DEFAULT AS IDENTITY,
"code" varchar(64) NOT NULL DEFAULT '',
"code" varchar(64) DEFAULT NULL,
"name" varchar(30) NOT NULL DEFAULT '',
"short_name" varchar(30) DEFAULT '',
"parent_id" bigint NOT NULL DEFAULT '0',
@@ -51,9 +51,8 @@ CREATE TABLE IF NOT EXISTS "system_dept_external_code" (
PRIMARY KEY ("id")
) COMMENT '部门外部组织编码映射';
CREATE UNIQUE INDEX IF NOT EXISTS "uk_system_dept_external_code_ext" ON "system_dept_external_code" ("tenant_id", "system_code", "external_dept_code");
CREATE UNIQUE INDEX IF NOT EXISTS "uk_system_dept_external_code_dept" ON "system_dept_external_code" ("tenant_id", "system_code", "dept_id");
CREATE INDEX IF NOT EXISTS "idx_system_dept_external_code_dept" ON "system_dept_external_code" ("tenant_id", "dept_id");
CREATE INDEX IF NOT EXISTS "idx_system_dept_external_code_ext" ON "system_dept_external_code" ("tenant_id", "system_code", "external_dept_code");
CREATE INDEX IF NOT EXISTS "idx_system_dept_external_code_dept" ON "system_dept_external_code" ("tenant_id", "system_code", "dept_id");
CREATE TABLE IF NOT EXISTS "system_dict_data" (
"id" bigint NOT NULL GENERATED BY DEFAULT AS IDENTITY,