From 145b9031857a622686106b0db1e9cc3a9878c5a4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=96=AF=E7=8B=82=E7=9A=84=E7=8B=AE=E5=AD=90Li?= <15040126243@163.com> Date: Tue, 13 Jan 2026 16:14:52 +0800 Subject: [PATCH] =?UTF-8?q?[=E9=87=8D=E5=A4=A7=E6=9B=B4=E6=94=B9]=20?= =?UTF-8?q?=E7=A7=BB=E9=99=A4=E5=A4=9A=E7=A7=9F=E6=88=B7=E7=9B=B8=E5=85=B3?= =?UTF-8?q?=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../web/controller/AuthController.java | 65 +- .../dromara/web/domain/vo/LoginTenantVo.java | 7 - .../dromara/web/domain/vo/TenantListVo.java | 31 - .../web/listener/UserActionListener.java | 33 +- .../dromara/web/service/SysLoginService.java | 54 +- .../web/service/SysRegisterService.java | 24 +- .../web/service/impl/EmailAuthStrategy.java | 16 +- .../service/impl/PasswordAuthStrategy.java | 20 +- .../web/service/impl/SmsAuthStrategy.java | 16 +- .../web/service/impl/SocialAuthStrategy.java | 21 +- .../web/service/impl/XcxAuthStrategy.java | 1 - .../src/main/resources/application.yml | 17 - .../main/resources/i18n/messages.properties | 6 +- .../resources/i18n/messages_en_US.properties | 6 +- .../resources/i18n/messages_zh_CN.properties | 6 +- ruoyi-common/pom.xml | 1 - ruoyi-common/ruoyi-common-bom/pom.xml | 7 - .../common/core/constant/CacheNames.java | 5 - .../common/core/constant/SystemConstants.java | 5 + .../common/core/constant/TenantConstants.java | 35 - .../core/domain/event/ProcessDeleteEvent.java | 5 - .../core/domain/event/ProcessEvent.java | 5 - .../core/domain/event/ProcessTaskEvent.java | 5 - .../common/core/domain/model/LoginBody.java | 5 - .../common/core/domain/model/LoginUser.java | 5 - .../common/core/service/WorkflowService.java | 7 - .../dromara/common/log/aspect/LogAspect.java | 1 - .../common/log/event/LogininforEvent.java | 5 - .../common/log/event/OperLogEvent.java | 5 - .../mybatis/config/MybatisPlusConfig.java | 9 - .../handler/PlusDataPermissionHandler.java | 2 +- .../common/oss/factory/OssFactory.java | 12 +- .../common/oss/properties/OssProperties.java | 5 - .../common/satoken/utils/LoginHelper.java | 41 +- ruoyi-common/ruoyi-common-tenant/pom.xml | 32 - .../common/tenant/config/TenantConfig.java | 71 --- .../common/tenant/core/TenantEntity.java | 21 - .../common/tenant/core/TenantSaTokenDao.java | 158 ----- .../tenant/exception/TenantException.java | 20 - .../tenant/handle/PlusTenantLineHandler.java | 56 -- .../tenant/handle/TenantKeyPrefixHandler.java | 83 --- .../common/tenant/helper/TenantHelper.java | 231 ------- .../manager/TenantSpringCacheManager.java | 41 -- .../tenant/properties/TenantProperties.java | 27 - ...ot.autoconfigure.AutoConfiguration.imports | 1 - ruoyi-modules/ruoyi-demo/pom.xml | 5 - .../org/dromara/demo/domain/TestDemo.java | 4 +- .../org/dromara/demo/domain/TestTree.java | 4 +- .../src/main/resources/vm/java/domain.java.vm | 13 - ruoyi-modules/ruoyi-system/pom.xml | 5 - .../controller/system/SysMenuController.java | 37 +- .../system/SysTenantController.java | 211 ------ .../system/SysTenantPackageController.java | 143 ----- .../controller/system/SysUserController.java | 16 +- .../org/dromara/system/domain/SysConfig.java | 4 +- .../org/dromara/system/domain/SysDept.java | 4 +- .../dromara/system/domain/SysDictData.java | 4 +- .../dromara/system/domain/SysDictType.java | 4 +- .../dromara/system/domain/SysLogininfor.java | 5 - .../org/dromara/system/domain/SysNotice.java | 4 +- .../org/dromara/system/domain/SysOperLog.java | 5 - .../org/dromara/system/domain/SysOss.java | 4 +- .../org/dromara/system/domain/SysPost.java | 4 +- .../org/dromara/system/domain/SysRole.java | 4 +- .../org/dromara/system/domain/SysSocial.java | 4 +- .../org/dromara/system/domain/SysTenant.java | 103 --- .../system/domain/SysTenantPackage.java | 60 -- .../org/dromara/system/domain/SysUser.java | 4 +- .../system/domain/bo/SysLogininforBo.java | 5 - .../system/domain/bo/SysOperLogBo.java | 5 - .../dromara/system/domain/bo/SysSocialBo.java | 4 +- .../dromara/system/domain/bo/SysTenantBo.java | 115 ---- .../system/domain/bo/SysTenantPackageBo.java | 59 -- .../system/domain/vo/ProfileUserVo.java | 5 - .../system/domain/vo/SysLogininforVo.java | 5 - .../system/domain/vo/SysOperLogVo.java | 5 - .../dromara/system/domain/vo/SysSocialVo.java | 5 - .../system/domain/vo/SysTenantPackageVo.java | 66 -- .../dromara/system/domain/vo/SysTenantVo.java | 115 ---- .../dromara/system/domain/vo/SysUserVo.java | 5 - .../system/mapper/SysTenantMapper.java | 14 - .../system/mapper/SysTenantPackageMapper.java | 14 - .../system/service/ISysConfigService.java | 4 +- .../system/service/ISysMenuService.java | 8 - .../service/ISysTenantPackageService.java | 62 -- .../system/service/ISysTenantService.java | 92 --- .../system/service/ISysUserService.java | 2 +- .../service/impl/SysConfigServiceImpl.java | 9 +- .../impl/SysLogininforServiceImpl.java | 1 - .../service/impl/SysMenuServiceImpl.java | 33 - .../impl/SysPermissionServiceImpl.java | 4 +- .../service/impl/SysRoleServiceImpl.java | 3 +- .../service/impl/SysSensitiveServiceImpl.java | 4 - .../impl/SysTenantPackageServiceImpl.java | 149 ----- .../service/impl/SysTenantServiceImpl.java | 567 ---------------- .../service/impl/SysUserServiceImpl.java | 3 +- .../mapper/system/SysTenantMapper.xml | 7 - .../mapper/system/SysTenantPackageMapper.xml | 7 - ruoyi-modules/ruoyi-workflow/pom.xml | 4 - .../dromara/workflow/domain/FlowCategory.java | 4 +- .../workflow/domain/FlowInstanceBizExt.java | 4 +- .../workflow/domain/vo/FlowDefinitionVo.java | 5 - .../workflow/domain/vo/FlowHisTaskVo.java | 5 - .../workflow/domain/vo/FlowInstanceVo.java | 5 - .../workflow/domain/vo/FlowTaskVo.java | 5 - .../handler/FlowProcessEventHandler.java | 19 +- .../service/IFlwDefinitionService.java | 6 - .../impl/FlwDefinitionServiceImpl.java | 72 --- .../service/impl/FlwTaskServiceImpl.java | 2 +- .../service/impl/WorkflowServiceImpl.java | 10 - script/sql/oracle/oracle_ry_vue_5.X.sql | 338 +++------- script/sql/oracle/oracle_ry_workflow.sql | 68 +- script/sql/postgres/postgres_ry_vue_5.X.sql | 342 +++------- script/sql/postgres/postgres_ry_workflow.sql | 74 +-- script/sql/ry_vue_5.X.sql | 290 +++------ script/sql/ry_workflow.sql | 71 +-- script/sql/sqlserver/sqlserver_ry_vue_5.X.sql | 603 ++++-------------- .../sql/sqlserver/sqlserver_ry_workflow.sql | 68 +- 118 files changed, 676 insertions(+), 4576 deletions(-) delete mode 100644 ruoyi-admin/src/main/java/org/dromara/web/domain/vo/TenantListVo.java delete mode 100644 ruoyi-common/ruoyi-common-core/src/main/java/org/dromara/common/core/constant/TenantConstants.java delete mode 100644 ruoyi-common/ruoyi-common-tenant/pom.xml delete mode 100644 ruoyi-common/ruoyi-common-tenant/src/main/java/org/dromara/common/tenant/config/TenantConfig.java delete mode 100644 ruoyi-common/ruoyi-common-tenant/src/main/java/org/dromara/common/tenant/core/TenantEntity.java delete mode 100644 ruoyi-common/ruoyi-common-tenant/src/main/java/org/dromara/common/tenant/core/TenantSaTokenDao.java delete mode 100644 ruoyi-common/ruoyi-common-tenant/src/main/java/org/dromara/common/tenant/exception/TenantException.java delete mode 100644 ruoyi-common/ruoyi-common-tenant/src/main/java/org/dromara/common/tenant/handle/PlusTenantLineHandler.java delete mode 100644 ruoyi-common/ruoyi-common-tenant/src/main/java/org/dromara/common/tenant/handle/TenantKeyPrefixHandler.java delete mode 100644 ruoyi-common/ruoyi-common-tenant/src/main/java/org/dromara/common/tenant/helper/TenantHelper.java delete mode 100644 ruoyi-common/ruoyi-common-tenant/src/main/java/org/dromara/common/tenant/manager/TenantSpringCacheManager.java delete mode 100644 ruoyi-common/ruoyi-common-tenant/src/main/java/org/dromara/common/tenant/properties/TenantProperties.java delete mode 100644 ruoyi-common/ruoyi-common-tenant/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports delete mode 100644 ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/controller/system/SysTenantController.java delete mode 100644 ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/controller/system/SysTenantPackageController.java delete mode 100644 ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/domain/SysTenant.java delete mode 100644 ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/domain/SysTenantPackage.java delete mode 100644 ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/domain/bo/SysTenantBo.java delete mode 100644 ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/domain/bo/SysTenantPackageBo.java delete mode 100644 ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/domain/vo/SysTenantPackageVo.java delete mode 100644 ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/domain/vo/SysTenantVo.java delete mode 100644 ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/mapper/SysTenantMapper.java delete mode 100644 ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/mapper/SysTenantPackageMapper.java delete mode 100644 ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/service/ISysTenantPackageService.java delete mode 100644 ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/service/ISysTenantService.java delete mode 100644 ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/service/impl/SysTenantPackageServiceImpl.java delete mode 100644 ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/service/impl/SysTenantServiceImpl.java delete mode 100644 ruoyi-modules/ruoyi-system/src/main/resources/mapper/system/SysTenantMapper.xml delete mode 100644 ruoyi-modules/ruoyi-system/src/main/resources/mapper/system/SysTenantPackageMapper.xml diff --git a/ruoyi-admin/src/main/java/org/dromara/web/controller/AuthController.java b/ruoyi-admin/src/main/java/org/dromara/web/controller/AuthController.java index c448a60d3..ba57254fd 100644 --- a/ruoyi-admin/src/main/java/org/dromara/web/controller/AuthController.java +++ b/ruoyi-admin/src/main/java/org/dromara/web/controller/AuthController.java @@ -1,10 +1,7 @@ package org.dromara.web.controller; import cn.dev33.satoken.annotation.SaIgnore; -import cn.dev33.satoken.exception.NotLoginException; import cn.dev33.satoken.stp.StpUtil; -import cn.hutool.core.codec.Base64; -import cn.hutool.core.collection.CollUtil; import cn.hutool.core.util.ObjectUtil; import jakarta.servlet.http.HttpServletRequest; import lombok.RequiredArgsConstructor; @@ -18,7 +15,10 @@ import org.dromara.common.core.domain.R; import org.dromara.common.core.domain.model.LoginBody; import org.dromara.common.core.domain.model.RegisterBody; import org.dromara.common.core.domain.model.SocialLoginBody; -import org.dromara.common.core.utils.*; +import org.dromara.common.core.utils.DateUtils; +import org.dromara.common.core.utils.MessageUtils; +import org.dromara.common.core.utils.StringUtils; +import org.dromara.common.core.utils.ValidatorUtils; import org.dromara.common.encrypt.annotation.ApiEncrypt; import org.dromara.common.json.utils.JsonUtils; import org.dromara.common.ratelimiter.annotation.RateLimiter; @@ -29,29 +29,20 @@ import org.dromara.common.social.config.properties.SocialProperties; import org.dromara.common.social.utils.SocialUtils; import org.dromara.common.sse.dto.SseMessageDto; import org.dromara.common.sse.utils.SseMessageUtils; -import org.dromara.common.tenant.helper.TenantHelper; -import org.dromara.system.domain.bo.SysTenantBo; import org.dromara.system.domain.vo.SysClientVo; -import org.dromara.system.domain.vo.SysTenantVo; import org.dromara.system.service.ISysClientService; import org.dromara.system.service.ISysConfigService; import org.dromara.system.service.ISysSocialService; -import org.dromara.system.service.ISysTenantService; import org.dromara.web.domain.vo.LoginTenantVo; import org.dromara.web.domain.vo.LoginVo; -import org.dromara.web.domain.vo.TenantListVo; import org.dromara.web.service.IAuthStrategy; import org.dromara.web.service.SysLoginService; import org.dromara.web.service.SysRegisterService; import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.*; -import java.net.URL; -import java.nio.charset.StandardCharsets; import java.util.Date; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.concurrent.ScheduledExecutorService; import java.util.concurrent.TimeUnit; @@ -71,7 +62,6 @@ public class AuthController { private final SysLoginService loginService; private final SysRegisterService registerService; private final ISysConfigService configService; - private final ISysTenantService tenantService; private final ISysSocialService socialUserService; private final ISysClientService clientService; private final ScheduledExecutorService scheduledExecutorService; @@ -99,8 +89,6 @@ public class AuthController { } else if (!SystemConstants.NORMAL.equals(client.getStatus())) { return R.fail(MessageUtils.message("auth.grant.type.blocked")); } - // 校验租户 - loginService.checkTenant(loginBody.getTenantId()); // 登录 LoginVo loginVo = IAuthStrategy.login(body, client, grantType); @@ -121,18 +109,13 @@ public class AuthController { * @return 结果 */ @GetMapping("/binding/{source}") - public R authBinding(@PathVariable("source") String source, - @RequestParam String tenantId, @RequestParam String domain) { + public R authBinding(@PathVariable("source") String source) { SocialLoginConfigProperties obj = socialProperties.getType().get(source); if (ObjectUtil.isNull(obj)) { return R.fail(source + "平台账号暂不支持"); } AuthRequest authRequest = SocialUtils.getAuthRequest(source, socialProperties); - Map map = new HashMap<>(); - map.put("tenantId", tenantId); - map.put("domain", domain); - map.put("state", AuthStateUtils.createState()); - String authorizeUrl = authRequest.authorize(Base64.encode(JsonUtils.toJsonString(map), StandardCharsets.UTF_8)); + String authorizeUrl = authRequest.authorize(AuthStateUtils.createState()); return R.ok("操作成功", authorizeUrl); } @@ -189,7 +172,7 @@ public class AuthController { @ApiEncrypt @PostMapping("/register") public R register(@Validated @RequestBody RegisterBody user) { - if (!configService.selectRegisterEnabled(user.getTenantId())) { + if (!configService.selectRegisterEnabled()) { return R.fail("当前系统没有开启注册功能!"); } registerService.register(user); @@ -204,39 +187,9 @@ public class AuthController { @RateLimiter(time = 60, count = 20, limitType = LimitType.IP) @GetMapping("/tenant/list") public R tenantList(HttpServletRequest request) throws Exception { - // 返回对象 + // 暂时预留给前端使用 后续删除 LoginTenantVo result = new LoginTenantVo(); - boolean enable = TenantHelper.isEnable(); - result.setTenantEnabled(enable); - // 如果未开启租户这直接返回 - if (!enable) { - return R.ok(result); - } - - List tenantList = tenantService.queryList(new SysTenantBo()); - List voList = MapstructUtils.convert(tenantList, TenantListVo.class); - try { - // 如果只超管返回所有租户 - if (LoginHelper.isSuperAdmin()) { - result.setVoList(voList); - return R.ok(result); - } - } catch (NotLoginException ignored) { - } - - // 获取域名 - String host; - String referer = request.getHeader("referer"); - if (StringUtils.isNotBlank(referer)) { - // 这里从referer中取值是为了本地使用hosts添加虚拟域名,方便本地环境调试 - host = referer.split("//")[1].split("/")[0]; - } else { - host = new URL(request.getRequestURL().toString()).getHost(); - } - // 根据域名进行筛选 - List list = StreamUtils.filter(voList, vo -> - StringUtils.equalsIgnoreCase(vo.getDomain(), host)); - result.setVoList(CollUtil.isNotEmpty(list) ? list : voList); + result.setTenantEnabled(false); return R.ok(result); } diff --git a/ruoyi-admin/src/main/java/org/dromara/web/domain/vo/LoginTenantVo.java b/ruoyi-admin/src/main/java/org/dromara/web/domain/vo/LoginTenantVo.java index 0a83acea6..554d667c8 100644 --- a/ruoyi-admin/src/main/java/org/dromara/web/domain/vo/LoginTenantVo.java +++ b/ruoyi-admin/src/main/java/org/dromara/web/domain/vo/LoginTenantVo.java @@ -2,8 +2,6 @@ package org.dromara.web.domain.vo; import lombok.Data; -import java.util.List; - /** * 登录租户对象 * @@ -17,9 +15,4 @@ public class LoginTenantVo { */ private Boolean tenantEnabled; - /** - * 租户对象列表 - */ - private List voList; - } diff --git a/ruoyi-admin/src/main/java/org/dromara/web/domain/vo/TenantListVo.java b/ruoyi-admin/src/main/java/org/dromara/web/domain/vo/TenantListVo.java deleted file mode 100644 index db9c2712c..000000000 --- a/ruoyi-admin/src/main/java/org/dromara/web/domain/vo/TenantListVo.java +++ /dev/null @@ -1,31 +0,0 @@ -package org.dromara.web.domain.vo; - -import org.dromara.system.domain.vo.SysTenantVo; -import io.github.linpeilie.annotations.AutoMapper; -import lombok.Data; - -/** - * 租户列表 - * - * @author Lion Li - */ -@Data -@AutoMapper(target = SysTenantVo.class) -public class TenantListVo { - - /** - * 租户编号 - */ - private String tenantId; - - /** - * 企业名称 - */ - private String companyName; - - /** - * 域名 - */ - private String domain; - -} diff --git a/ruoyi-admin/src/main/java/org/dromara/web/listener/UserActionListener.java b/ruoyi-admin/src/main/java/org/dromara/web/listener/UserActionListener.java index 6c8accb69..4d22dbd84 100644 --- a/ruoyi-admin/src/main/java/org/dromara/web/listener/UserActionListener.java +++ b/ruoyi-admin/src/main/java/org/dromara/web/listener/UserActionListener.java @@ -1,9 +1,7 @@ package org.dromara.web.listener; import cn.dev33.satoken.listener.SaTokenListener; -import cn.dev33.satoken.stp.StpUtil; import cn.dev33.satoken.stp.parameter.SaLoginParameter; -import cn.hutool.core.convert.Convert; import cn.hutool.http.useragent.UserAgent; import cn.hutool.http.useragent.UserAgentUtil; import lombok.RequiredArgsConstructor; @@ -18,7 +16,6 @@ import org.dromara.common.core.utils.ip.AddressUtils; import org.dromara.common.log.event.LogininforEvent; import org.dromara.common.redis.utils.RedisUtils; import org.dromara.common.satoken.utils.LoginHelper; -import org.dromara.common.tenant.helper.TenantHelper; import org.dromara.web.service.SysLoginService; import org.springframework.stereotype.Component; @@ -51,21 +48,18 @@ public class UserActionListener implements SaTokenListener { dto.setLoginTime(System.currentTimeMillis()); dto.setTokenId(tokenValue); String username = (String) loginParameter.getExtra(LoginHelper.USER_NAME_KEY); - String tenantId = (String) loginParameter.getExtra(LoginHelper.TENANT_KEY); dto.setUserName(username); dto.setClientKey((String) loginParameter.getExtra(LoginHelper.CLIENT_KEY)); dto.setDeviceType(loginParameter.getDeviceType()); dto.setDeptName((String) loginParameter.getExtra(LoginHelper.DEPT_NAME_KEY)); - TenantHelper.dynamic(tenantId, () -> { - if(loginParameter.getTimeout() == -1) { - RedisUtils.setCacheObject(CacheConstants.ONLINE_TOKEN_KEY + tokenValue, dto); - } else { - RedisUtils.setCacheObject(CacheConstants.ONLINE_TOKEN_KEY + tokenValue, dto, Duration.ofSeconds(loginParameter.getTimeout())); - } - }); + if (loginParameter.getTimeout() == -1) { + RedisUtils.setCacheObject(CacheConstants.ONLINE_TOKEN_KEY + tokenValue, dto); + } else { + RedisUtils.setCacheObject(CacheConstants.ONLINE_TOKEN_KEY + tokenValue, dto, Duration.ofSeconds(loginParameter.getTimeout())); + } + // 记录登录日志 LogininforEvent logininforEvent = new LogininforEvent(); - logininforEvent.setTenantId(tenantId); logininforEvent.setUsername(username); logininforEvent.setStatus(Constants.LOGIN_SUCCESS); logininforEvent.setMessage(MessageUtils.message("user.login.success")); @@ -81,10 +75,7 @@ public class UserActionListener implements SaTokenListener { */ @Override public void doLogout(String loginType, Object loginId, String tokenValue) { - String tenantId = Convert.toStr(StpUtil.getExtra(tokenValue, LoginHelper.TENANT_KEY)); - TenantHelper.dynamic(tenantId, () -> { - RedisUtils.deleteObject(CacheConstants.ONLINE_TOKEN_KEY + tokenValue); - }); + RedisUtils.deleteObject(CacheConstants.ONLINE_TOKEN_KEY + tokenValue); log.info("user doLogout, userId:{}, token:{}", loginId, tokenValue); } @@ -93,10 +84,7 @@ public class UserActionListener implements SaTokenListener { */ @Override public void doKickout(String loginType, Object loginId, String tokenValue) { - String tenantId = Convert.toStr(StpUtil.getExtra(tokenValue, LoginHelper.TENANT_KEY)); - TenantHelper.dynamic(tenantId, () -> { - RedisUtils.deleteObject(CacheConstants.ONLINE_TOKEN_KEY + tokenValue); - }); + RedisUtils.deleteObject(CacheConstants.ONLINE_TOKEN_KEY + tokenValue); log.info("user doKickout, userId:{}, token:{}", loginId, tokenValue); } @@ -105,10 +93,7 @@ public class UserActionListener implements SaTokenListener { */ @Override public void doReplaced(String loginType, Object loginId, String tokenValue) { - String tenantId = Convert.toStr(StpUtil.getExtra(tokenValue, LoginHelper.TENANT_KEY)); - TenantHelper.dynamic(tenantId, () -> { - RedisUtils.deleteObject(CacheConstants.ONLINE_TOKEN_KEY + tokenValue); - }); + RedisUtils.deleteObject(CacheConstants.ONLINE_TOKEN_KEY + tokenValue); log.info("user doReplaced, userId:{}, token:{}", loginId, tokenValue); } diff --git a/ruoyi-admin/src/main/java/org/dromara/web/service/SysLoginService.java b/ruoyi-admin/src/main/java/org/dromara/web/service/SysLoginService.java index 41a802b44..9a87b99a6 100644 --- a/ruoyi-admin/src/main/java/org/dromara/web/service/SysLoginService.java +++ b/ruoyi-admin/src/main/java/org/dromara/web/service/SysLoginService.java @@ -12,8 +12,6 @@ import lombok.extern.slf4j.Slf4j; import me.zhyd.oauth.model.AuthUser; import org.dromara.common.core.constant.CacheConstants; import org.dromara.common.core.constant.Constants; -import org.dromara.common.core.constant.SystemConstants; -import org.dromara.common.core.constant.TenantConstants; import org.dromara.common.core.domain.dto.PostDTO; import org.dromara.common.core.domain.dto.RoleDTO; import org.dromara.common.core.domain.model.LoginUser; @@ -25,8 +23,6 @@ import org.dromara.common.log.event.LogininforEvent; import org.dromara.common.mybatis.helper.DataPermissionHelper; import org.dromara.common.redis.utils.RedisUtils; import org.dromara.common.satoken.utils.LoginHelper; -import org.dromara.common.tenant.exception.TenantException; -import org.dromara.common.tenant.helper.TenantHelper; import org.dromara.system.domain.SysUser; import org.dromara.system.domain.bo.SysSocialBo; import org.dromara.system.domain.vo.*; @@ -36,7 +32,6 @@ import org.springframework.beans.factory.annotation.Value; import org.springframework.stereotype.Service; import java.time.Duration; -import java.util.Date; import java.util.List; import java.util.function.Supplier; @@ -56,7 +51,6 @@ public class SysLoginService { @Value("${user.password.lockTime}") private Integer lockTime; - private final ISysTenantService tenantService; private final ISysPermissionService permissionService; private final ISysSocialService sysSocialService; private final ISysRoleService roleService; @@ -113,11 +107,7 @@ public class SysLoginService { if (ObjectUtil.isNull(loginUser)) { return; } - if (TenantHelper.isEnable() && LoginHelper.isSuperAdmin()) { - // 超级管理员 登出清除动态租户 - TenantHelper.clearDynamic(); - } - recordLogininfor(loginUser.getTenantId(), loginUser.getUsername(), Constants.LOGOUT, MessageUtils.message("user.logout.success")); + recordLogininfor(loginUser.getUsername(), Constants.LOGOUT, MessageUtils.message("user.logout.success")); } catch (NotLoginException ignored) { } finally { try { @@ -130,14 +120,12 @@ public class SysLoginService { /** * 记录登录信息 * - * @param tenantId 租户ID * @param username 用户名 * @param status 状态 * @param message 消息内容 */ - public void recordLogininfor(String tenantId, String username, String status, String message) { + public void recordLogininfor(String username, String status, String message) { LogininforEvent logininforEvent = new LogininforEvent(); - logininforEvent.setTenantId(tenantId); logininforEvent.setUsername(username); logininforEvent.setStatus(status); logininforEvent.setMessage(message); @@ -151,7 +139,6 @@ public class SysLoginService { public LoginUser buildLoginUser(SysUserVo user) { LoginUser loginUser = new LoginUser(); Long userId = user.getUserId(); - loginUser.setTenantId(user.getTenantId()); loginUser.setUserId(userId); loginUser.setDeptId(user.getDeptId()); loginUser.setUsername(user.getUserName()); @@ -188,7 +175,7 @@ public class SysLoginService { /** * 登录校验 */ - public void checkLogin(LoginType loginType, String tenantId, String username, Supplier supplier) { + public void checkLogin(LoginType loginType, String username, Supplier supplier) { String errorKey = CacheConstants.PWD_ERR_CNT_KEY + username; String loginFail = Constants.LOGIN_FAIL; @@ -196,7 +183,7 @@ public class SysLoginService { int errorNumber = ObjectUtil.defaultIfNull(RedisUtils.getCacheObject(errorKey), 0); // 锁定时间内登录 则踢出 if (errorNumber >= maxRetryCount) { - recordLogininfor(tenantId, username, loginFail, MessageUtils.message(loginType.getRetryLimitExceed(), maxRetryCount, lockTime)); + recordLogininfor(username, loginFail, MessageUtils.message(loginType.getRetryLimitExceed(), maxRetryCount, lockTime)); throw new UserException(loginType.getRetryLimitExceed(), maxRetryCount, lockTime); } @@ -206,11 +193,11 @@ public class SysLoginService { RedisUtils.setCacheObject(errorKey, errorNumber, Duration.ofMinutes(lockTime)); // 达到规定错误次数 则锁定登录 if (errorNumber >= maxRetryCount) { - recordLogininfor(tenantId, username, loginFail, MessageUtils.message(loginType.getRetryLimitExceed(), maxRetryCount, lockTime)); + recordLogininfor(username, loginFail, MessageUtils.message(loginType.getRetryLimitExceed(), maxRetryCount, lockTime)); throw new UserException(loginType.getRetryLimitExceed(), maxRetryCount, lockTime); } else { // 未达到规定错误次数 - recordLogininfor(tenantId, username, loginFail, MessageUtils.message(loginType.getRetryLimitCount(), errorNumber)); + recordLogininfor(username, loginFail, MessageUtils.message(loginType.getRetryLimitCount(), errorNumber)); throw new UserException(loginType.getRetryLimitCount(), errorNumber); } } @@ -219,33 +206,4 @@ public class SysLoginService { RedisUtils.deleteObject(errorKey); } - /** - * 校验租户 - * - * @param tenantId 租户ID - */ - public void checkTenant(String tenantId) { - if (!TenantHelper.isEnable()) { - return; - } - if (StringUtils.isBlank(tenantId)) { - throw new TenantException("tenant.number.not.blank"); - } - if (TenantConstants.DEFAULT_TENANT_ID.equals(tenantId)) { - return; - } - SysTenantVo tenant = tenantService.queryByTenantId(tenantId); - if (ObjectUtil.isNull(tenant)) { - log.info("登录租户:{} 不存在.", tenantId); - throw new TenantException("tenant.not.exists"); - } else if (SystemConstants.DISABLE.equals(tenant.getStatus())) { - log.info("登录租户:{} 已被停用.", tenantId); - throw new TenantException("tenant.blocked"); - } else if (ObjectUtil.isNotNull(tenant.getExpireTime()) - && new Date().after(tenant.getExpireTime())) { - log.info("登录租户:{} 已超过有效期.", tenantId); - throw new TenantException("tenant.expired"); - } - } - } diff --git a/ruoyi-admin/src/main/java/org/dromara/web/service/SysRegisterService.java b/ruoyi-admin/src/main/java/org/dromara/web/service/SysRegisterService.java index 5a3351d05..8306151cd 100644 --- a/ruoyi-admin/src/main/java/org/dromara/web/service/SysRegisterService.java +++ b/ruoyi-admin/src/main/java/org/dromara/web/service/SysRegisterService.java @@ -16,7 +16,6 @@ import org.dromara.common.core.utils.SpringUtils; import org.dromara.common.core.utils.StringUtils; import org.dromara.common.log.event.LogininforEvent; import org.dromara.common.redis.utils.RedisUtils; -import org.dromara.common.tenant.helper.TenantHelper; import org.dromara.common.web.config.properties.CaptchaProperties; import org.dromara.system.domain.SysUser; import org.dromara.system.domain.bo.SysUserBo; @@ -41,7 +40,6 @@ public class SysRegisterService { * 注册 */ public void register(RegisterBody registerBody) { - String tenantId = registerBody.getTenantId(); String username = registerBody.getUsername(); String password = registerBody.getPassword(); // 校验用户类型是否存在 @@ -50,7 +48,7 @@ public class SysRegisterService { boolean captchaEnabled = captchaProperties.getEnable(); // 验证码开关 if (captchaEnabled) { - validateCaptcha(tenantId, username, registerBody.getCode(), registerBody.getUuid()); + validateCaptcha(username, registerBody.getCode(), registerBody.getUuid()); } SysUserBo sysUser = new SysUserBo(); sysUser.setUserName(username); @@ -58,18 +56,16 @@ public class SysRegisterService { sysUser.setPassword(BCrypt.hashpw(password)); sysUser.setUserType(userType); - boolean exist = TenantHelper.dynamic(tenantId, () -> { - return userMapper.exists(new LambdaQueryWrapper() - .eq(SysUser::getUserName, sysUser.getUserName())); - }); + boolean exist = userMapper.exists(new LambdaQueryWrapper() + .eq(SysUser::getUserName, sysUser.getUserName())); if (exist) { throw new UserException("user.register.save.error", username); } - boolean regFlag = userService.registerUser(sysUser, tenantId); + boolean regFlag = userService.registerUser(sysUser); if (!regFlag) { throw new UserException("user.register.error"); } - recordLogininfor(tenantId, username, Constants.REGISTER, MessageUtils.message("user.register.success")); + recordLogininfor(username, Constants.REGISTER, MessageUtils.message("user.register.success")); } /** @@ -79,16 +75,16 @@ public class SysRegisterService { * @param code 验证码 * @param uuid 唯一标识 */ - public void validateCaptcha(String tenantId, String username, String code, String uuid) { + public void validateCaptcha(String username, String code, String uuid) { String verifyKey = GlobalConstants.CAPTCHA_CODE_KEY + StringUtils.blankToDefault(uuid, ""); String captcha = RedisUtils.getCacheObject(verifyKey); RedisUtils.deleteObject(verifyKey); if (captcha == null) { - recordLogininfor(tenantId, username, Constants.LOGIN_FAIL, MessageUtils.message("user.jcaptcha.expire")); + recordLogininfor(username, Constants.LOGIN_FAIL, MessageUtils.message("user.jcaptcha.expire")); throw new CaptchaExpireException(); } if (!StringUtils.equalsIgnoreCase(code, captcha)) { - recordLogininfor(tenantId, username, Constants.LOGIN_FAIL, MessageUtils.message("user.jcaptcha.error")); + recordLogininfor(username, Constants.LOGIN_FAIL, MessageUtils.message("user.jcaptcha.error")); throw new CaptchaException(); } } @@ -96,15 +92,13 @@ public class SysRegisterService { /** * 记录登录信息 * - * @param tenantId 租户ID * @param username 用户名 * @param status 状态 * @param message 消息内容 * @return */ - private void recordLogininfor(String tenantId, String username, String status, String message) { + private void recordLogininfor(String username, String status, String message) { LogininforEvent logininforEvent = new LogininforEvent(); - logininforEvent.setTenantId(tenantId); logininforEvent.setUsername(username); logininforEvent.setStatus(status); logininforEvent.setMessage(message); diff --git a/ruoyi-admin/src/main/java/org/dromara/web/service/impl/EmailAuthStrategy.java b/ruoyi-admin/src/main/java/org/dromara/web/service/impl/EmailAuthStrategy.java index e4315dc59..f12997659 100644 --- a/ruoyi-admin/src/main/java/org/dromara/web/service/impl/EmailAuthStrategy.java +++ b/ruoyi-admin/src/main/java/org/dromara/web/service/impl/EmailAuthStrategy.java @@ -20,7 +20,6 @@ import org.dromara.common.core.utils.ValidatorUtils; import org.dromara.common.json.utils.JsonUtils; import org.dromara.common.redis.utils.RedisUtils; import org.dromara.common.satoken.utils.LoginHelper; -import org.dromara.common.tenant.helper.TenantHelper; import org.dromara.system.domain.SysUser; import org.dromara.system.domain.vo.SysClientVo; import org.dromara.system.domain.vo.SysUserVo; @@ -47,15 +46,12 @@ public class EmailAuthStrategy implements IAuthStrategy { public LoginVo login(String body, SysClientVo client) { EmailLoginBody loginBody = JsonUtils.parseObject(body, EmailLoginBody.class); ValidatorUtils.validate(loginBody); - String tenantId = loginBody.getTenantId(); String email = loginBody.getEmail(); String emailCode = loginBody.getEmailCode(); - LoginUser loginUser = TenantHelper.dynamic(tenantId, () -> { - SysUserVo user = loadUserByEmail(email); - loginService.checkLogin(LoginType.EMAIL, tenantId, user.getUserName(), () -> !validateEmailCode(tenantId, email, emailCode)); - // 此处可根据登录用户的数据不同 自行创建 loginUser 属性不够用继承扩展就行了 - return loginService.buildLoginUser(user); - }); + SysUserVo user = loadUserByEmail(email); + loginService.checkLogin(LoginType.EMAIL, user.getUserName(), () -> !validateEmailCode(email, emailCode)); + // 此处可根据登录用户的数据不同 自行创建 loginUser 属性不够用继承扩展就行了 + LoginUser loginUser = loginService.buildLoginUser(user); loginUser.setClientKey(client.getClientKey()); loginUser.setDeviceType(client.getDeviceType()); SaLoginParameter model = new SaLoginParameter(); @@ -78,10 +74,10 @@ public class EmailAuthStrategy implements IAuthStrategy { /** * 校验邮箱验证码 */ - private boolean validateEmailCode(String tenantId, String email, String emailCode) { + private boolean validateEmailCode(String email, String emailCode) { String code = RedisUtils.getCacheObject(GlobalConstants.CAPTCHA_CODE_KEY + email); if (StringUtils.isBlank(code)) { - loginService.recordLogininfor(tenantId, email, Constants.LOGIN_FAIL, MessageUtils.message("user.jcaptcha.expire")); + loginService.recordLogininfor(email, Constants.LOGIN_FAIL, MessageUtils.message("user.jcaptcha.expire")); throw new CaptchaExpireException(); } return code.equals(emailCode); diff --git a/ruoyi-admin/src/main/java/org/dromara/web/service/impl/PasswordAuthStrategy.java b/ruoyi-admin/src/main/java/org/dromara/web/service/impl/PasswordAuthStrategy.java index abf590b36..8fffea97f 100644 --- a/ruoyi-admin/src/main/java/org/dromara/web/service/impl/PasswordAuthStrategy.java +++ b/ruoyi-admin/src/main/java/org/dromara/web/service/impl/PasswordAuthStrategy.java @@ -22,7 +22,6 @@ import org.dromara.common.core.utils.ValidatorUtils; import org.dromara.common.json.utils.JsonUtils; import org.dromara.common.redis.utils.RedisUtils; import org.dromara.common.satoken.utils.LoginHelper; -import org.dromara.common.tenant.helper.TenantHelper; import org.dromara.common.web.config.properties.CaptchaProperties; import org.dromara.system.domain.SysUser; import org.dromara.system.domain.vo.SysClientVo; @@ -51,7 +50,6 @@ public class PasswordAuthStrategy implements IAuthStrategy { public LoginVo login(String body, SysClientVo client) { PasswordLoginBody loginBody = JsonUtils.parseObject(body, PasswordLoginBody.class); ValidatorUtils.validate(loginBody); - String tenantId = loginBody.getTenantId(); String username = loginBody.getUsername(); String password = loginBody.getPassword(); String code = loginBody.getCode(); @@ -60,14 +58,12 @@ public class PasswordAuthStrategy implements IAuthStrategy { boolean captchaEnabled = captchaProperties.getEnable(); // 验证码开关 if (captchaEnabled) { - validateCaptcha(tenantId, username, code, uuid); + validateCaptcha(username, code, uuid); } - LoginUser loginUser = TenantHelper.dynamic(tenantId, () -> { - SysUserVo user = loadUserByUsername(username); - loginService.checkLogin(LoginType.PASSWORD, tenantId, username, () -> !BCrypt.checkpw(password, user.getPassword())); - // 此处可根据登录用户的数据不同 自行创建 loginUser - return loginService.buildLoginUser(user); - }); + SysUserVo user = loadUserByUsername(username); + loginService.checkLogin(LoginType.PASSWORD, username, () -> !BCrypt.checkpw(password, user.getPassword())); + // 此处可根据登录用户的数据不同 自行创建 loginUser + LoginUser loginUser = loginService.buildLoginUser(user); loginUser.setClientKey(client.getClientKey()); loginUser.setDeviceType(client.getDeviceType()); SaLoginParameter model = new SaLoginParameter(); @@ -94,16 +90,16 @@ public class PasswordAuthStrategy implements IAuthStrategy { * @param code 验证码 * @param uuid 唯一标识 */ - private void validateCaptcha(String tenantId, String username, String code, String uuid) { + private void validateCaptcha(String username, String code, String uuid) { String verifyKey = GlobalConstants.CAPTCHA_CODE_KEY + StringUtils.blankToDefault(uuid, ""); String captcha = RedisUtils.getCacheObject(verifyKey); RedisUtils.deleteObject(verifyKey); if (captcha == null) { - loginService.recordLogininfor(tenantId, username, Constants.LOGIN_FAIL, MessageUtils.message("user.jcaptcha.expire")); + loginService.recordLogininfor(username, Constants.LOGIN_FAIL, MessageUtils.message("user.jcaptcha.expire")); throw new CaptchaExpireException(); } if (!StringUtils.equalsIgnoreCase(code, captcha)) { - loginService.recordLogininfor(tenantId, username, Constants.LOGIN_FAIL, MessageUtils.message("user.jcaptcha.error")); + loginService.recordLogininfor(username, Constants.LOGIN_FAIL, MessageUtils.message("user.jcaptcha.error")); throw new CaptchaException(); } } diff --git a/ruoyi-admin/src/main/java/org/dromara/web/service/impl/SmsAuthStrategy.java b/ruoyi-admin/src/main/java/org/dromara/web/service/impl/SmsAuthStrategy.java index 597a6013b..bca14f660 100644 --- a/ruoyi-admin/src/main/java/org/dromara/web/service/impl/SmsAuthStrategy.java +++ b/ruoyi-admin/src/main/java/org/dromara/web/service/impl/SmsAuthStrategy.java @@ -20,7 +20,6 @@ import org.dromara.common.core.utils.ValidatorUtils; import org.dromara.common.json.utils.JsonUtils; import org.dromara.common.redis.utils.RedisUtils; import org.dromara.common.satoken.utils.LoginHelper; -import org.dromara.common.tenant.helper.TenantHelper; import org.dromara.system.domain.SysUser; import org.dromara.system.domain.vo.SysClientVo; import org.dromara.system.domain.vo.SysUserVo; @@ -47,15 +46,12 @@ public class SmsAuthStrategy implements IAuthStrategy { public LoginVo login(String body, SysClientVo client) { SmsLoginBody loginBody = JsonUtils.parseObject(body, SmsLoginBody.class); ValidatorUtils.validate(loginBody); - String tenantId = loginBody.getTenantId(); String phonenumber = loginBody.getPhonenumber(); String smsCode = loginBody.getSmsCode(); - LoginUser loginUser = TenantHelper.dynamic(tenantId, () -> { - SysUserVo user = loadUserByPhonenumber(phonenumber); - loginService.checkLogin(LoginType.SMS, tenantId, user.getUserName(), () -> !validateSmsCode(tenantId, phonenumber, smsCode)); - // 此处可根据登录用户的数据不同 自行创建 loginUser 属性不够用继承扩展就行了 - return loginService.buildLoginUser(user); - }); + SysUserVo user = loadUserByPhonenumber(phonenumber); + loginService.checkLogin(LoginType.SMS, user.getUserName(), () -> !validateSmsCode(phonenumber, smsCode)); + // 此处可根据登录用户的数据不同 自行创建 loginUser 属性不够用继承扩展就行了 + LoginUser loginUser = loginService.buildLoginUser(user); loginUser.setClientKey(client.getClientKey()); loginUser.setDeviceType(client.getDeviceType()); SaLoginParameter model = new SaLoginParameter(); @@ -78,10 +74,10 @@ public class SmsAuthStrategy implements IAuthStrategy { /** * 校验短信验证码 */ - private boolean validateSmsCode(String tenantId, String phonenumber, String smsCode) { + private boolean validateSmsCode(String phonenumber, String smsCode) { String code = RedisUtils.getCacheObject(GlobalConstants.CAPTCHA_CODE_KEY + phonenumber); if (StringUtils.isBlank(code)) { - loginService.recordLogininfor(tenantId, phonenumber, Constants.LOGIN_FAIL, MessageUtils.message("user.jcaptcha.expire")); + loginService.recordLogininfor(phonenumber, Constants.LOGIN_FAIL, MessageUtils.message("user.jcaptcha.expire")); throw new CaptchaExpireException(); } return code.equals(smsCode); diff --git a/ruoyi-admin/src/main/java/org/dromara/web/service/impl/SocialAuthStrategy.java b/ruoyi-admin/src/main/java/org/dromara/web/service/impl/SocialAuthStrategy.java index e01666ea6..23edbb6b5 100644 --- a/ruoyi-admin/src/main/java/org/dromara/web/service/impl/SocialAuthStrategy.java +++ b/ruoyi-admin/src/main/java/org/dromara/web/service/impl/SocialAuthStrategy.java @@ -13,13 +13,11 @@ import org.dromara.common.core.domain.model.LoginUser; import org.dromara.common.core.domain.model.SocialLoginBody; import org.dromara.common.core.exception.ServiceException; import org.dromara.common.core.exception.user.UserException; -import org.dromara.common.core.utils.StreamUtils; import org.dromara.common.core.utils.ValidatorUtils; import org.dromara.common.json.utils.JsonUtils; import org.dromara.common.satoken.utils.LoginHelper; import org.dromara.common.social.config.properties.SocialProperties; import org.dromara.common.social.utils.SocialUtils; -import org.dromara.common.tenant.helper.TenantHelper; import org.dromara.system.domain.vo.SysClientVo; import org.dromara.system.domain.vo.SysSocialVo; import org.dromara.system.domain.vo.SysUserVo; @@ -31,7 +29,6 @@ import org.dromara.web.service.SysLoginService; import org.springframework.stereotype.Service; import java.util.List; -import java.util.Optional; /** * 第三方授权策略 @@ -70,21 +67,9 @@ public class SocialAuthStrategy implements IAuthStrategy { if (CollUtil.isEmpty(list)) { throw new ServiceException("你还没有绑定第三方账号,绑定后才可以登录!"); } - SysSocialVo social; - if (TenantHelper.isEnable()) { - Optional opt = StreamUtils.findAny(list, x -> x.getTenantId().equals(loginBody.getTenantId())); - if (opt.isEmpty()) { - throw new ServiceException("对不起,你没有权限登录当前租户!"); - } - social = opt.get(); - } else { - social = list.get(0); - } - LoginUser loginUser = TenantHelper.dynamic(social.getTenantId(), () -> { - SysUserVo user = loadUser(social.getUserId()); - // 此处可根据登录用户的数据不同 自行创建 loginUser 属性不够用继承扩展就行了 - return loginService.buildLoginUser(user); - }); + SysUserVo user = loadUser(list.get(0).getUserId()); + // 此处可根据登录用户的数据不同 自行创建 loginUser 属性不够用继承扩展就行了 + LoginUser loginUser = loginService.buildLoginUser(user); loginUser.setClientKey(client.getClientKey()); loginUser.setDeviceType(client.getDeviceType()); SaLoginParameter model = new SaLoginParameter(); diff --git a/ruoyi-admin/src/main/java/org/dromara/web/service/impl/XcxAuthStrategy.java b/ruoyi-admin/src/main/java/org/dromara/web/service/impl/XcxAuthStrategy.java index f223dd88f..142651994 100644 --- a/ruoyi-admin/src/main/java/org/dromara/web/service/impl/XcxAuthStrategy.java +++ b/ruoyi-admin/src/main/java/org/dromara/web/service/impl/XcxAuthStrategy.java @@ -67,7 +67,6 @@ public class XcxAuthStrategy implements IAuthStrategy { SysUserVo user = loadUserByOpenid(openid); // 此处可根据登录用户的数据不同 自行创建 loginUser 属性不够用继承扩展就行了 XcxLoginUser loginUser = new XcxLoginUser(); - loginUser.setTenantId(user.getTenantId()); loginUser.setUserId(user.getUserId()); loginUser.setUsername(user.getUserName()); loginUser.setNickname(user.getNickName()); diff --git a/ruoyi-admin/src/main/resources/application.yml b/ruoyi-admin/src/main/resources/application.yml index c90883ef8..7a8d07cc1 100644 --- a/ruoyi-admin/src/main/resources/application.yml +++ b/ruoyi-admin/src/main/resources/application.yml @@ -114,23 +114,6 @@ security: - /*/api-docs/** - /warm-flow-ui/config -# 多租户配置 -tenant: - # 是否开启 - enable: true - # 排除表 - excludes: - - sys_menu - - sys_tenant - - sys_tenant_package - - sys_role_dept - - sys_role_menu - - sys_user_post - - sys_user_role - - sys_client - - sys_oss_config - - flow_spel - # MyBatisPlus配置 # https://baomidou.com/config/ mybatis-plus: diff --git a/ruoyi-admin/src/main/resources/i18n/messages.properties b/ruoyi-admin/src/main/resources/i18n/messages.properties index e1e5263b8..d4120c712 100644 --- a/ruoyi-admin/src/main/resources/i18n/messages.properties +++ b/ruoyi-admin/src/main/resources/i18n/messages.properties @@ -55,8 +55,4 @@ xcx.code.not.blank=小程序[code]不能为空 social.source.not.blank=第三方登录平台[source]不能为空 social.code.not.blank=第三方登录平台[code]不能为空 social.state.not.blank=第三方登录平台[state]不能为空 -##租户 -tenant.number.not.blank=租户编号不能为空 -tenant.not.exists=对不起, 您的租户不存在,请联系管理员 -tenant.blocked=对不起,您的租户已禁用,请联系管理员 -tenant.expired=对不起,您的租户已过期,请联系管理员 + diff --git a/ruoyi-admin/src/main/resources/i18n/messages_en_US.properties b/ruoyi-admin/src/main/resources/i18n/messages_en_US.properties index 306a48f6a..f62719866 100644 --- a/ruoyi-admin/src/main/resources/i18n/messages_en_US.properties +++ b/ruoyi-admin/src/main/resources/i18n/messages_en_US.properties @@ -55,8 +55,4 @@ xcx.code.not.blank=Mini program [code] cannot be blank social.source.not.blank=Social login platform [source] cannot be blank social.code.not.blank=Social login platform [code] cannot be blank social.state.not.blank=Social login platform [state] cannot be blank -##租户 -tenant.number.not.blank=Tenant number cannot be blank -tenant.not.exists=Sorry, your tenant does not exist. Please contact the administrator -tenant.blocked=Sorry, your tenant is disabled. Please contact the administrator -tenant.expired=Sorry, your tenant has expired. Please contact the administrator. + diff --git a/ruoyi-admin/src/main/resources/i18n/messages_zh_CN.properties b/ruoyi-admin/src/main/resources/i18n/messages_zh_CN.properties index e1e5263b8..d4120c712 100644 --- a/ruoyi-admin/src/main/resources/i18n/messages_zh_CN.properties +++ b/ruoyi-admin/src/main/resources/i18n/messages_zh_CN.properties @@ -55,8 +55,4 @@ xcx.code.not.blank=小程序[code]不能为空 social.source.not.blank=第三方登录平台[source]不能为空 social.code.not.blank=第三方登录平台[code]不能为空 social.state.not.blank=第三方登录平台[state]不能为空 -##租户 -tenant.number.not.blank=租户编号不能为空 -tenant.not.exists=对不起, 您的租户不存在,请联系管理员 -tenant.blocked=对不起,您的租户已禁用,请联系管理员 -tenant.expired=对不起,您的租户已过期,请联系管理员 + diff --git a/ruoyi-common/pom.xml b/ruoyi-common/pom.xml index 2930fd0b0..4bb554439 100644 --- a/ruoyi-common/pom.xml +++ b/ruoyi-common/pom.xml @@ -31,7 +31,6 @@ ruoyi-common-sensitive ruoyi-common-json ruoyi-common-encrypt - ruoyi-common-tenant ruoyi-common-websocket ruoyi-common-sse diff --git a/ruoyi-common/ruoyi-common-bom/pom.xml b/ruoyi-common/ruoyi-common-bom/pom.xml index 3324cbe5f..6115158ae 100644 --- a/ruoyi-common/ruoyi-common-bom/pom.xml +++ b/ruoyi-common/ruoyi-common-bom/pom.xml @@ -158,13 +158,6 @@ ${revision} - - - org.dromara - ruoyi-common-tenant - ${revision} - - org.dromara diff --git a/ruoyi-common/ruoyi-common-core/src/main/java/org/dromara/common/core/constant/CacheNames.java b/ruoyi-common/ruoyi-common-core/src/main/java/org/dromara/common/core/constant/CacheNames.java index c38f39b47..b1f546d36 100644 --- a/ruoyi-common/ruoyi-common-core/src/main/java/org/dromara/common/core/constant/CacheNames.java +++ b/ruoyi-common/ruoyi-common-core/src/main/java/org/dromara/common/core/constant/CacheNames.java @@ -36,11 +36,6 @@ public interface CacheNames { */ String SYS_DICT_TYPE = "sys_dict_type"; - /** - * 租户 - */ - String SYS_TENANT = GlobalConstants.GLOBAL_REDIS_KEY + "sys_tenant#30d"; - /** * 客户端 */ diff --git a/ruoyi-common/ruoyi-common-core/src/main/java/org/dromara/common/core/constant/SystemConstants.java b/ruoyi-common/ruoyi-common-core/src/main/java/org/dromara/common/core/constant/SystemConstants.java index e38d9fd2d..3ae5af6c6 100644 --- a/ruoyi-common/ruoyi-common-core/src/main/java/org/dromara/common/core/constant/SystemConstants.java +++ b/ruoyi-common/ruoyi-common-core/src/main/java/org/dromara/common/core/constant/SystemConstants.java @@ -72,6 +72,11 @@ public interface SystemConstants { */ Long SUPER_ADMIN_ID = 1L; + /** + * 超级管理员角色 roleKey + */ + String SUPER_ADMIN_ROLE_KEY = "superadmin"; + /** * 根部门祖级列表 */ diff --git a/ruoyi-common/ruoyi-common-core/src/main/java/org/dromara/common/core/constant/TenantConstants.java b/ruoyi-common/ruoyi-common-core/src/main/java/org/dromara/common/core/constant/TenantConstants.java deleted file mode 100644 index 33ce0cf6c..000000000 --- a/ruoyi-common/ruoyi-common-core/src/main/java/org/dromara/common/core/constant/TenantConstants.java +++ /dev/null @@ -1,35 +0,0 @@ -package org.dromara.common.core.constant; - -/** - * 租户常量信息 - * - * @author Lion Li - */ -public interface TenantConstants { - - /** - * 超级管理员ID - */ - Long SUPER_ADMIN_ID = 1L; - - /** - * 超级管理员角色 roleKey - */ - String SUPER_ADMIN_ROLE_KEY = "superadmin"; - - /** - * 租户管理员角色 roleKey - */ - String TENANT_ADMIN_ROLE_KEY = "admin"; - - /** - * 租户管理员角色名称 - */ - String TENANT_ADMIN_ROLE_NAME = "管理员"; - - /** - * 默认租户ID - */ - String DEFAULT_TENANT_ID = "000000"; - -} diff --git a/ruoyi-common/ruoyi-common-core/src/main/java/org/dromara/common/core/domain/event/ProcessDeleteEvent.java b/ruoyi-common/ruoyi-common-core/src/main/java/org/dromara/common/core/domain/event/ProcessDeleteEvent.java index d570c314e..03e786766 100644 --- a/ruoyi-common/ruoyi-common-core/src/main/java/org/dromara/common/core/domain/event/ProcessDeleteEvent.java +++ b/ruoyi-common/ruoyi-common-core/src/main/java/org/dromara/common/core/domain/event/ProcessDeleteEvent.java @@ -16,11 +16,6 @@ public class ProcessDeleteEvent implements Serializable { @Serial private static final long serialVersionUID = 1L; - /** - * 租户ID - */ - private String tenantId; - /** * 流程定义编码 */ diff --git a/ruoyi-common/ruoyi-common-core/src/main/java/org/dromara/common/core/domain/event/ProcessEvent.java b/ruoyi-common/ruoyi-common-core/src/main/java/org/dromara/common/core/domain/event/ProcessEvent.java index d830dbe03..9763d3bce 100644 --- a/ruoyi-common/ruoyi-common-core/src/main/java/org/dromara/common/core/domain/event/ProcessEvent.java +++ b/ruoyi-common/ruoyi-common-core/src/main/java/org/dromara/common/core/domain/event/ProcessEvent.java @@ -17,11 +17,6 @@ public class ProcessEvent implements Serializable { @Serial private static final long serialVersionUID = 1L; - /** - * 租户ID - */ - private String tenantId; - /** * 流程定义编码 */ diff --git a/ruoyi-common/ruoyi-common-core/src/main/java/org/dromara/common/core/domain/event/ProcessTaskEvent.java b/ruoyi-common/ruoyi-common-core/src/main/java/org/dromara/common/core/domain/event/ProcessTaskEvent.java index 0984727ac..b24df8d70 100644 --- a/ruoyi-common/ruoyi-common-core/src/main/java/org/dromara/common/core/domain/event/ProcessTaskEvent.java +++ b/ruoyi-common/ruoyi-common-core/src/main/java/org/dromara/common/core/domain/event/ProcessTaskEvent.java @@ -17,11 +17,6 @@ public class ProcessTaskEvent implements Serializable { @Serial private static final long serialVersionUID = 1L; - /** - * 租户ID - */ - private String tenantId; - /** * 流程定义编码 */ diff --git a/ruoyi-common/ruoyi-common-core/src/main/java/org/dromara/common/core/domain/model/LoginBody.java b/ruoyi-common/ruoyi-common-core/src/main/java/org/dromara/common/core/domain/model/LoginBody.java index 63bee0ddc..7fd5b703e 100644 --- a/ruoyi-common/ruoyi-common-core/src/main/java/org/dromara/common/core/domain/model/LoginBody.java +++ b/ruoyi-common/ruoyi-common-core/src/main/java/org/dromara/common/core/domain/model/LoginBody.java @@ -30,11 +30,6 @@ public class LoginBody implements Serializable { @NotBlank(message = "{auth.grant.type.not.blank}") private String grantType; - /** - * 租户ID - */ - private String tenantId; - /** * 验证码 */ diff --git a/ruoyi-common/ruoyi-common-core/src/main/java/org/dromara/common/core/domain/model/LoginUser.java b/ruoyi-common/ruoyi-common-core/src/main/java/org/dromara/common/core/domain/model/LoginUser.java index 338d4d70a..dd0fc5c2f 100644 --- a/ruoyi-common/ruoyi-common-core/src/main/java/org/dromara/common/core/domain/model/LoginUser.java +++ b/ruoyi-common/ruoyi-common-core/src/main/java/org/dromara/common/core/domain/model/LoginUser.java @@ -22,11 +22,6 @@ public class LoginUser implements Serializable { @Serial private static final long serialVersionUID = 1L; - /** - * 租户ID - */ - private String tenantId; - /** * 用户ID */ diff --git a/ruoyi-common/ruoyi-common-core/src/main/java/org/dromara/common/core/service/WorkflowService.java b/ruoyi-common/ruoyi-common-core/src/main/java/org/dromara/common/core/service/WorkflowService.java index 8efeb76ef..262d3eaed 100644 --- a/ruoyi-common/ruoyi-common-core/src/main/java/org/dromara/common/core/service/WorkflowService.java +++ b/ruoyi-common/ruoyi-common-core/src/main/java/org/dromara/common/core/service/WorkflowService.java @@ -61,13 +61,6 @@ public interface WorkflowService { */ Long getInstanceIdByBusinessId(String businessId); - /** - * 新增租户流程定义 - * - * @param tenantId 租户id - */ - void syncDef(String tenantId); - /** * 启动流程 * diff --git a/ruoyi-common/ruoyi-common-log/src/main/java/org/dromara/common/log/aspect/LogAspect.java b/ruoyi-common/ruoyi-common-log/src/main/java/org/dromara/common/log/aspect/LogAspect.java index 2c22811ae..a3cc90b60 100644 --- a/ruoyi-common/ruoyi-common-log/src/main/java/org/dromara/common/log/aspect/LogAspect.java +++ b/ruoyi-common/ruoyi-common-log/src/main/java/org/dromara/common/log/aspect/LogAspect.java @@ -81,7 +81,6 @@ public class LogAspect { // *========数据库日志=========*// OperLogEvent operLog = new OperLogEvent(); - operLog.setTenantId(LoginHelper.getTenantId()); operLog.setStatus(BusinessStatus.SUCCESS.ordinal()); // 请求的地址 String ip = ServletUtils.getClientIP(); diff --git a/ruoyi-common/ruoyi-common-log/src/main/java/org/dromara/common/log/event/LogininforEvent.java b/ruoyi-common/ruoyi-common-log/src/main/java/org/dromara/common/log/event/LogininforEvent.java index 938eaadde..e54693c8e 100644 --- a/ruoyi-common/ruoyi-common-log/src/main/java/org/dromara/common/log/event/LogininforEvent.java +++ b/ruoyi-common/ruoyi-common-log/src/main/java/org/dromara/common/log/event/LogininforEvent.java @@ -19,11 +19,6 @@ public class LogininforEvent implements Serializable { @Serial private static final long serialVersionUID = 1L; - /** - * 租户ID - */ - private String tenantId; - /** * 用户账号 */ diff --git a/ruoyi-common/ruoyi-common-log/src/main/java/org/dromara/common/log/event/OperLogEvent.java b/ruoyi-common/ruoyi-common-log/src/main/java/org/dromara/common/log/event/OperLogEvent.java index 03861929c..05b20d428 100644 --- a/ruoyi-common/ruoyi-common-log/src/main/java/org/dromara/common/log/event/OperLogEvent.java +++ b/ruoyi-common/ruoyi-common-log/src/main/java/org/dromara/common/log/event/OperLogEvent.java @@ -23,11 +23,6 @@ public class OperLogEvent implements Serializable { */ private Long operId; - /** - * 租户ID - */ - private String tenantId; - /** * 操作模块 */ diff --git a/ruoyi-common/ruoyi-common-mybatis/src/main/java/org/dromara/common/mybatis/config/MybatisPlusConfig.java b/ruoyi-common/ruoyi-common-mybatis/src/main/java/org/dromara/common/mybatis/config/MybatisPlusConfig.java index b08825731..f061989f4 100644 --- a/ruoyi-common/ruoyi-common-mybatis/src/main/java/org/dromara/common/mybatis/config/MybatisPlusConfig.java +++ b/ruoyi-common/ruoyi-common-mybatis/src/main/java/org/dromara/common/mybatis/config/MybatisPlusConfig.java @@ -8,16 +8,13 @@ import com.baomidou.mybatisplus.core.incrementer.IdentifierGenerator; import com.baomidou.mybatisplus.extension.plugins.MybatisPlusInterceptor; import com.baomidou.mybatisplus.extension.plugins.inner.OptimisticLockerInnerInterceptor; import com.baomidou.mybatisplus.extension.plugins.inner.PaginationInnerInterceptor; -import com.baomidou.mybatisplus.extension.plugins.inner.TenantLineInnerInterceptor; import org.dromara.common.core.factory.YmlPropertySourceFactory; -import org.dromara.common.core.utils.SpringUtils; import org.dromara.common.mybatis.aspect.DataPermissionPointcutAdvisor; import org.dromara.common.mybatis.handler.InjectionMetaObjectHandler; import org.dromara.common.mybatis.handler.MybatisExceptionHandler; import org.dromara.common.mybatis.handler.PlusPostInitTableInfoHandler; import org.dromara.common.mybatis.interceptor.PlusDataPermissionInterceptor; import org.mybatis.spring.annotation.MapperScan; -import org.springframework.beans.BeansException; import org.springframework.beans.factory.config.BeanDefinition; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.PropertySource; @@ -38,12 +35,6 @@ public class MybatisPlusConfig { @Bean public MybatisPlusInterceptor mybatisPlusInterceptor() { MybatisPlusInterceptor interceptor = new MybatisPlusInterceptor(); - // 多租户插件 必须放到第一位 - try { - TenantLineInnerInterceptor tenant = SpringUtils.getBean(TenantLineInnerInterceptor.class); - interceptor.addInnerInterceptor(tenant); - } catch (BeansException ignore) { - } // 数据权限处理 interceptor.addInnerInterceptor(dataPermissionInterceptor()); // 分页插件 diff --git a/ruoyi-common/ruoyi-common-mybatis/src/main/java/org/dromara/common/mybatis/handler/PlusDataPermissionHandler.java b/ruoyi-common/ruoyi-common-mybatis/src/main/java/org/dromara/common/mybatis/handler/PlusDataPermissionHandler.java index 5c2ca983b..676ad6441 100644 --- a/ruoyi-common/ruoyi-common-mybatis/src/main/java/org/dromara/common/mybatis/handler/PlusDataPermissionHandler.java +++ b/ruoyi-common/ruoyi-common-mybatis/src/main/java/org/dromara/common/mybatis/handler/PlusDataPermissionHandler.java @@ -66,7 +66,7 @@ public class PlusDataPermissionHandler { DataPermissionHelper.setVariable("user", currentUser); } // 如果是超级管理员或租户管理员,则不过滤数据 - if (LoginHelper.isSuperAdmin() || LoginHelper.isTenantAdmin()) { + if (LoginHelper.isSuperAdmin()) { return where; } // 构造数据过滤条件的 SQL 片段 diff --git a/ruoyi-common/ruoyi-common-oss/src/main/java/org/dromara/common/oss/factory/OssFactory.java b/ruoyi-common/ruoyi-common-oss/src/main/java/org/dromara/common/oss/factory/OssFactory.java index 3da1ba5cd..1d5ae66cb 100644 --- a/ruoyi-common/ruoyi-common-oss/src/main/java/org/dromara/common/oss/factory/OssFactory.java +++ b/ruoyi-common/ruoyi-common-oss/src/main/java/org/dromara/common/oss/factory/OssFactory.java @@ -48,20 +48,16 @@ public class OssFactory { } OssProperties properties = JsonUtils.parseObject(json, OssProperties.class); // 使用租户标识避免多个租户相同key实例覆盖 - String key = configKey; - if (StringUtils.isNotBlank(properties.getTenantId())) { - key = properties.getTenantId() + ":" + configKey; - } - OssClient client = CLIENT_CACHE.get(key); + OssClient client = CLIENT_CACHE.get(configKey); // 客户端不存在或配置不相同则重新构建 if (client == null || !client.checkPropertiesSame(properties)) { LOCK.lock(); try { - client = CLIENT_CACHE.get(key); + client = CLIENT_CACHE.get(configKey); if (client == null || !client.checkPropertiesSame(properties)) { - CLIENT_CACHE.put(key, new OssClient(configKey, properties)); + CLIENT_CACHE.put(configKey, new OssClient(configKey, properties)); log.info("创建OSS实例 key => {}", configKey); - return CLIENT_CACHE.get(key); + return CLIENT_CACHE.get(configKey); } } finally { LOCK.unlock(); diff --git a/ruoyi-common/ruoyi-common-oss/src/main/java/org/dromara/common/oss/properties/OssProperties.java b/ruoyi-common/ruoyi-common-oss/src/main/java/org/dromara/common/oss/properties/OssProperties.java index cb37206ea..697530b54 100644 --- a/ruoyi-common/ruoyi-common-oss/src/main/java/org/dromara/common/oss/properties/OssProperties.java +++ b/ruoyi-common/ruoyi-common-oss/src/main/java/org/dromara/common/oss/properties/OssProperties.java @@ -10,11 +10,6 @@ import lombok.Data; @Data public class OssProperties { - /** - * 租户id - */ - private String tenantId; - /** * 访问站点 */ diff --git a/ruoyi-common/ruoyi-common-satoken/src/main/java/org/dromara/common/satoken/utils/LoginHelper.java b/ruoyi-common/ruoyi-common-satoken/src/main/java/org/dromara/common/satoken/utils/LoginHelper.java index 730bae29d..6a7b48cf9 100644 --- a/ruoyi-common/ruoyi-common-satoken/src/main/java/org/dromara/common/satoken/utils/LoginHelper.java +++ b/ruoyi-common/ruoyi-common-satoken/src/main/java/org/dromara/common/satoken/utils/LoginHelper.java @@ -3,18 +3,14 @@ package org.dromara.common.satoken.utils; import cn.dev33.satoken.session.SaSession; import cn.dev33.satoken.stp.StpUtil; import cn.dev33.satoken.stp.parameter.SaLoginParameter; -import cn.hutool.core.collection.CollUtil; import cn.hutool.core.convert.Convert; import cn.hutool.core.util.ObjectUtil; import lombok.AccessLevel; import lombok.NoArgsConstructor; import org.dromara.common.core.constant.SystemConstants; -import org.dromara.common.core.constant.TenantConstants; import org.dromara.common.core.domain.model.LoginUser; import org.dromara.common.core.enums.UserType; -import java.util.Set; - /** * 登录鉴权助手 @@ -32,7 +28,6 @@ import java.util.Set; public class LoginHelper { public static final String LOGIN_USER_KEY = "loginUser"; - public static final String TENANT_KEY = "tenantId"; public static final String USER_KEY = "userId"; public static final String USER_NAME_KEY = "userName"; public static final String DEPT_KEY = "deptId"; @@ -50,8 +45,7 @@ public class LoginHelper { public static void login(LoginUser loginUser, SaLoginParameter model) { model = ObjectUtil.defaultIfNull(model, new SaLoginParameter()); StpUtil.login(loginUser.getLoginId(), - model.setExtra(TENANT_KEY, loginUser.getTenantId()) - .setExtra(USER_KEY, loginUser.getUserId()) + model.setExtra(USER_KEY, loginUser.getUserId()) .setExtra(USER_NAME_KEY, loginUser.getUsername()) .setExtra(DEPT_KEY, loginUser.getDeptId()) .setExtra(DEPT_NAME_KEY, loginUser.getDeptName()) @@ -105,13 +99,6 @@ public class LoginHelper { return Convert.toStr(getExtra(USER_NAME_KEY)); } - /** - * 获取租户ID - */ - public static String getTenantId() { - return Convert.toStr(getExtra(TENANT_KEY)); - } - /** * 获取部门ID */ @@ -174,32 +161,6 @@ public class LoginHelper { return isSuperAdmin(getUserId()); } - /** - * 是否为租户管理员 - * - * @param rolePermission 角色权限标识组 - * @return 结果 - */ - public static boolean isTenantAdmin(Set rolePermission) { - if (CollUtil.isEmpty(rolePermission)) { - return false; - } - return rolePermission.contains(TenantConstants.TENANT_ADMIN_ROLE_KEY); - } - - /** - * 是否为租户管理员 - * - * @return 结果 - */ - public static boolean isTenantAdmin() { - LoginUser loginUser = getLoginUser(); - if (loginUser == null) { - return false; - } - return Convert.toBool(isTenantAdmin(loginUser.getRolePermission())); - } - /** * 检查当前用户是否已登录 * diff --git a/ruoyi-common/ruoyi-common-tenant/pom.xml b/ruoyi-common/ruoyi-common-tenant/pom.xml deleted file mode 100644 index 8e1a6ab1e..000000000 --- a/ruoyi-common/ruoyi-common-tenant/pom.xml +++ /dev/null @@ -1,32 +0,0 @@ - - - - org.dromara - ruoyi-common - ${revision} - - 4.0.0 - - ruoyi-common-tenant - - - ruoyi-common-tenant 租户模块 - - - - - org.dromara - ruoyi-common-mybatis - true - - - - org.dromara - ruoyi-common-redis - - - - - diff --git a/ruoyi-common/ruoyi-common-tenant/src/main/java/org/dromara/common/tenant/config/TenantConfig.java b/ruoyi-common/ruoyi-common-tenant/src/main/java/org/dromara/common/tenant/config/TenantConfig.java deleted file mode 100644 index ce54fb5e1..000000000 --- a/ruoyi-common/ruoyi-common-tenant/src/main/java/org/dromara/common/tenant/config/TenantConfig.java +++ /dev/null @@ -1,71 +0,0 @@ -package org.dromara.common.tenant.config; - -import cn.dev33.satoken.dao.SaTokenDao; -import com.baomidou.mybatisplus.extension.plugins.inner.TenantLineInnerInterceptor; -import org.dromara.common.redis.config.RedisConfig; -import org.dromara.common.redis.config.properties.RedissonProperties; -import org.dromara.common.tenant.core.TenantSaTokenDao; -import org.dromara.common.tenant.handle.PlusTenantLineHandler; -import org.dromara.common.tenant.handle.TenantKeyPrefixHandler; -import org.dromara.common.tenant.manager.TenantSpringCacheManager; -import org.dromara.common.tenant.properties.TenantProperties; -import org.redisson.spring.starter.RedissonAutoConfigurationCustomizer; -import org.springframework.boot.autoconfigure.AutoConfiguration; -import org.springframework.boot.autoconfigure.condition.ConditionalOnClass; -import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; -import org.springframework.boot.context.properties.EnableConfigurationProperties; -import org.springframework.cache.CacheManager; -import org.springframework.context.annotation.Bean; -import org.springframework.context.annotation.Primary; - -/** - * 租户配置类 - * - * @author Lion Li - */ -@EnableConfigurationProperties(TenantProperties.class) -@AutoConfiguration(after = {RedisConfig.class}) -@ConditionalOnProperty(value = "tenant.enable", havingValue = "true") -public class TenantConfig { - - @ConditionalOnClass(TenantLineInnerInterceptor.class) - @AutoConfiguration - static class MybatisPlusConfiguration { - - /** - * 多租户插件 - */ - @Bean - public TenantLineInnerInterceptor tenantLineInnerInterceptor(TenantProperties tenantProperties) { - return new TenantLineInnerInterceptor(new PlusTenantLineHandler(tenantProperties)); - } - - } - - @Bean - public RedissonAutoConfigurationCustomizer tenantRedissonCustomizer(RedissonProperties redissonProperties) { - return config -> { - // 设置多租户 redis key前缀 - config.setNameMapper(new TenantKeyPrefixHandler(redissonProperties.getKeyPrefix())); - }; - } - - /** - * 多租户缓存管理器 - */ - @Primary - @Bean - public CacheManager tenantCacheManager() { - return new TenantSpringCacheManager(); - } - - /** - * 多租户鉴权dao实现 - */ - @Primary - @Bean - public SaTokenDao tenantSaTokenDao() { - return new TenantSaTokenDao(); - } - -} diff --git a/ruoyi-common/ruoyi-common-tenant/src/main/java/org/dromara/common/tenant/core/TenantEntity.java b/ruoyi-common/ruoyi-common-tenant/src/main/java/org/dromara/common/tenant/core/TenantEntity.java deleted file mode 100644 index 8ad0d2ccc..000000000 --- a/ruoyi-common/ruoyi-common-tenant/src/main/java/org/dromara/common/tenant/core/TenantEntity.java +++ /dev/null @@ -1,21 +0,0 @@ -package org.dromara.common.tenant.core; - -import org.dromara.common.mybatis.core.domain.BaseEntity; -import lombok.Data; -import lombok.EqualsAndHashCode; - -/** - * 租户基类 - * - * @author Michelle.Chung - */ -@Data -@EqualsAndHashCode(callSuper = true) -public class TenantEntity extends BaseEntity { - - /** - * 租户编号 - */ - private String tenantId; - -} diff --git a/ruoyi-common/ruoyi-common-tenant/src/main/java/org/dromara/common/tenant/core/TenantSaTokenDao.java b/ruoyi-common/ruoyi-common-tenant/src/main/java/org/dromara/common/tenant/core/TenantSaTokenDao.java deleted file mode 100644 index 9aaa753ec..000000000 --- a/ruoyi-common/ruoyi-common-tenant/src/main/java/org/dromara/common/tenant/core/TenantSaTokenDao.java +++ /dev/null @@ -1,158 +0,0 @@ -package org.dromara.common.tenant.core; - -import org.dromara.common.core.constant.GlobalConstants; -import org.dromara.common.redis.utils.RedisUtils; -import org.dromara.common.satoken.core.dao.PlusSaTokenDao; - -import java.time.Duration; -import java.util.List; - -/** - * SaToken 认证数据持久层 适配多租户 - * - * @author Lion Li - */ -public class TenantSaTokenDao extends PlusSaTokenDao { - - @Override - public String get(String key) { - return super.get(GlobalConstants.GLOBAL_REDIS_KEY + key); - } - - @Override - public void set(String key, String value, long timeout) { - super.set(GlobalConstants.GLOBAL_REDIS_KEY + key, value, timeout); - } - - /** - * 修修改指定key-value键值对 (过期时间不变) - */ - @Override - public void update(String key, String value) { - long expire = getTimeout(key); - // -2 = 无此键 - if (expire == NOT_VALUE_EXPIRE) { - return; - } - this.set(key, value, expire); - } - - /** - * 删除Value - */ - @Override - public void delete(String key) { - super.delete(GlobalConstants.GLOBAL_REDIS_KEY + key); - } - - /** - * 获取Value的剩余存活时间 (单位: 秒) - */ - @Override - public long getTimeout(String key) { - return super.getTimeout(GlobalConstants.GLOBAL_REDIS_KEY + key); - } - - /** - * 修改Value的剩余存活时间 (单位: 秒) - */ - @Override - public void updateTimeout(String key, long timeout) { - // 判断是否想要设置为永久 - if (timeout == NEVER_EXPIRE) { - long expire = getTimeout(key); - if (expire == NEVER_EXPIRE) { - // 如果其已经被设置为永久,则不作任何处理 - } else { - // 如果尚未被设置为永久,那么再次set一次 - this.set(key, this.get(key), timeout); - } - return; - } - RedisUtils.expire(GlobalConstants.GLOBAL_REDIS_KEY + key, Duration.ofSeconds(timeout)); - } - - - /** - * 获取Object,如无返空 - */ - @Override - public Object getObject(String key) { - return super.getObject(GlobalConstants.GLOBAL_REDIS_KEY + key); - } - - /** - * 获取 Object (指定反序列化类型),如无返空 - * - * @param key 键名称 - * @return object - */ - @Override - public T getObject(String key, Class classType) { - return super.getObject(GlobalConstants.GLOBAL_REDIS_KEY + key, classType); - } - - /** - * 写入Object,并设定存活时间 (单位: 秒) - */ - @Override - public void setObject(String key, Object object, long timeout) { - super.setObject(GlobalConstants.GLOBAL_REDIS_KEY + key, object, timeout); - } - - /** - * 更新Object (过期时间不变) - */ - @Override - public void updateObject(String key, Object object) { - long expire = getObjectTimeout(key); - // -2 = 无此键 - if (expire == NOT_VALUE_EXPIRE) { - return; - } - this.setObject(key, object, expire); - } - - /** - * 删除Object - */ - @Override - public void deleteObject(String key) { - super.deleteObject(GlobalConstants.GLOBAL_REDIS_KEY + key); - } - - /** - * 获取Object的剩余存活时间 (单位: 秒) - */ - @Override - public long getObjectTimeout(String key) { - return super.getObjectTimeout(GlobalConstants.GLOBAL_REDIS_KEY + key); - } - - /** - * 修改Object的剩余存活时间 (单位: 秒) - */ - @Override - public void updateObjectTimeout(String key, long timeout) { - // 判断是否想要设置为永久 - if (timeout == NEVER_EXPIRE) { - long expire = getObjectTimeout(key); - if (expire == NEVER_EXPIRE) { - // 如果其已经被设置为永久,则不作任何处理 - } else { - // 如果尚未被设置为永久,那么再次set一次 - this.setObject(key, this.getObject(key), timeout); - } - return; - } - RedisUtils.expire(GlobalConstants.GLOBAL_REDIS_KEY + key, Duration.ofSeconds(timeout)); - } - - /** - * 搜索数据 - */ - @Override - public List searchData(String prefix, String keyword, int start, int size, boolean sortType) { - return super.searchData(GlobalConstants.GLOBAL_REDIS_KEY + prefix, keyword, start, size, sortType); - } -} diff --git a/ruoyi-common/ruoyi-common-tenant/src/main/java/org/dromara/common/tenant/exception/TenantException.java b/ruoyi-common/ruoyi-common-tenant/src/main/java/org/dromara/common/tenant/exception/TenantException.java deleted file mode 100644 index ee2bc97c0..000000000 --- a/ruoyi-common/ruoyi-common-tenant/src/main/java/org/dromara/common/tenant/exception/TenantException.java +++ /dev/null @@ -1,20 +0,0 @@ -package org.dromara.common.tenant.exception; - -import org.dromara.common.core.exception.base.BaseException; - -import java.io.Serial; - -/** - * 租户异常类 - * - * @author Lion Li - */ -public class TenantException extends BaseException { - - @Serial - private static final long serialVersionUID = 1L; - - public TenantException(String code, Object... args) { - super("tenant", code, args, null); - } -} diff --git a/ruoyi-common/ruoyi-common-tenant/src/main/java/org/dromara/common/tenant/handle/PlusTenantLineHandler.java b/ruoyi-common/ruoyi-common-tenant/src/main/java/org/dromara/common/tenant/handle/PlusTenantLineHandler.java deleted file mode 100644 index f6d224bd6..000000000 --- a/ruoyi-common/ruoyi-common-tenant/src/main/java/org/dromara/common/tenant/handle/PlusTenantLineHandler.java +++ /dev/null @@ -1,56 +0,0 @@ -package org.dromara.common.tenant.handle; - -import cn.hutool.core.collection.ListUtil; -import com.baomidou.mybatisplus.extension.plugins.handler.TenantLineHandler; -import lombok.AllArgsConstructor; -import lombok.extern.slf4j.Slf4j; -import net.sf.jsqlparser.expression.Expression; -import net.sf.jsqlparser.expression.NullValue; -import net.sf.jsqlparser.expression.StringValue; -import org.dromara.common.core.utils.StringUtils; -import org.dromara.common.tenant.helper.TenantHelper; -import org.dromara.common.tenant.properties.TenantProperties; - -import java.util.List; - -/** - * 自定义租户处理器 - * - * @author Lion Li - */ -@Slf4j -@AllArgsConstructor -public class PlusTenantLineHandler implements TenantLineHandler { - - private final TenantProperties tenantProperties; - - @Override - public Expression getTenantId() { - String tenantId = TenantHelper.getTenantId(); - if (StringUtils.isBlank(tenantId)) { - log.error("无法获取有效的租户id -> Null"); - return new NullValue(); - } - // 返回固定租户 - return new StringValue(tenantId); - } - - @Override - public boolean ignoreTable(String tableName) { - String tenantId = TenantHelper.getTenantId(); - // 判断是否有租户 - if (StringUtils.isNotBlank(tenantId)) { - // 不需要过滤租户的表 - List excludes = tenantProperties.getExcludes(); - // 非业务表 - List tables = ListUtil.toList( - "gen_table", - "gen_table_column" - ); - tables.addAll(excludes); - return StringUtils.equalsAnyIgnoreCase(tableName, tables.toArray(new String[0])); - } - return true; - } - -} diff --git a/ruoyi-common/ruoyi-common-tenant/src/main/java/org/dromara/common/tenant/handle/TenantKeyPrefixHandler.java b/ruoyi-common/ruoyi-common-tenant/src/main/java/org/dromara/common/tenant/handle/TenantKeyPrefixHandler.java deleted file mode 100644 index dcdef6e62..000000000 --- a/ruoyi-common/ruoyi-common-tenant/src/main/java/org/dromara/common/tenant/handle/TenantKeyPrefixHandler.java +++ /dev/null @@ -1,83 +0,0 @@ -package org.dromara.common.tenant.handle; - -import com.baomidou.mybatisplus.core.plugins.InterceptorIgnoreHelper; -import lombok.extern.slf4j.Slf4j; -import org.dromara.common.core.constant.GlobalConstants; -import org.dromara.common.core.utils.StringUtils; -import org.dromara.common.redis.handler.KeyPrefixHandler; -import org.dromara.common.tenant.helper.TenantHelper; - -/** - * 多租户redis缓存key前缀处理 - * - * @author Lion Li - */ -@Slf4j -public class TenantKeyPrefixHandler extends KeyPrefixHandler { - - public TenantKeyPrefixHandler(String keyPrefix) { - super(keyPrefix); - } - - /** - * 增加前缀 - */ - @Override - public String map(String name) { - if (StringUtils.isBlank(name)) { - return null; - } - try { - if (InterceptorIgnoreHelper.willIgnoreTenantLine("")) { - return super.map(name); - } - } catch (NoClassDefFoundError ignore) { - // 有些服务不需要mp导致类不存在 忽略即可 - } - if (StringUtils.contains(name, GlobalConstants.GLOBAL_REDIS_KEY)) { - return super.map(name); - } - String tenantId = TenantHelper.getTenantId(); - if (StringUtils.isBlank(tenantId)) { - log.debug("无法获取有效的租户id -> Null"); - return super.map(name); - } - if (StringUtils.startsWith(name, tenantId + "")) { - // 如果存在则直接返回 - return super.map(name); - } - return super.map(tenantId + ":" + name); - } - - /** - * 去除前缀 - */ - @Override - public String unmap(String name) { - String unmap = super.unmap(name); - if (StringUtils.isBlank(unmap)) { - return null; - } - try { - if (InterceptorIgnoreHelper.willIgnoreTenantLine("")) { - return unmap; - } - } catch (NoClassDefFoundError ignore) { - // 有些服务不需要mp导致类不存在 忽略即可 - } - if (StringUtils.contains(name, GlobalConstants.GLOBAL_REDIS_KEY)) { - return unmap; - } - String tenantId = TenantHelper.getTenantId(); - if (StringUtils.isBlank(tenantId)) { - log.debug("无法获取有效的租户id -> Null"); - return unmap; - } - if (StringUtils.startsWith(unmap, tenantId + "")) { - // 如果存在则删除 - return unmap.substring((tenantId + ":").length()); - } - return unmap; - } - -} diff --git a/ruoyi-common/ruoyi-common-tenant/src/main/java/org/dromara/common/tenant/helper/TenantHelper.java b/ruoyi-common/ruoyi-common-tenant/src/main/java/org/dromara/common/tenant/helper/TenantHelper.java deleted file mode 100644 index 98f03f3ad..000000000 --- a/ruoyi-common/ruoyi-common-tenant/src/main/java/org/dromara/common/tenant/helper/TenantHelper.java +++ /dev/null @@ -1,231 +0,0 @@ -package org.dromara.common.tenant.helper; - -import cn.dev33.satoken.context.SaHolder; -import cn.dev33.satoken.context.model.SaStorage; -import cn.hutool.core.collection.CollectionUtil; -import cn.hutool.core.convert.Convert; -import cn.hutool.core.util.ObjectUtil; -import com.baomidou.mybatisplus.core.plugins.IgnoreStrategy; -import com.baomidou.mybatisplus.core.plugins.InterceptorIgnoreHelper; -import lombok.AccessLevel; -import lombok.NoArgsConstructor; -import lombok.extern.slf4j.Slf4j; -import org.dromara.common.core.constant.GlobalConstants; -import org.dromara.common.core.utils.SpringUtils; -import org.dromara.common.core.utils.StringUtils; -import org.dromara.common.core.utils.reflect.ReflectUtils; -import org.dromara.common.redis.utils.RedisUtils; -import org.dromara.common.satoken.utils.LoginHelper; - -import java.util.Stack; -import java.util.function.Supplier; - -/** - * 租户助手 - * - * @author Lion Li - */ -@Slf4j -@NoArgsConstructor(access = AccessLevel.PRIVATE) -public class TenantHelper { - - private static final String DYNAMIC_TENANT_KEY = GlobalConstants.GLOBAL_REDIS_KEY + "dynamicTenant"; - - private static final ThreadLocal TEMP_DYNAMIC_TENANT = new ThreadLocal<>(); - - private static final ThreadLocal> REENTRANT_IGNORE = ThreadLocal.withInitial(Stack::new); - - /** - * 租户功能是否启用 - */ - public static boolean isEnable() { - return Convert.toBool(SpringUtils.getProperty("tenant.enable"), false); - } - - private static IgnoreStrategy getIgnoreStrategy() { - Object ignoreStrategyLocal = ReflectUtils.getStaticFieldValue(ReflectUtils.getField(InterceptorIgnoreHelper.class, "IGNORE_STRATEGY_LOCAL")); - if (ignoreStrategyLocal instanceof ThreadLocal IGNORE_STRATEGY_LOCAL) { - if (IGNORE_STRATEGY_LOCAL.get() instanceof IgnoreStrategy ignoreStrategy) { - return ignoreStrategy; - } - } - return null; - } - - /** - * 开启忽略租户(开启后需手动调用 {@link #disableIgnore()} 关闭) - */ - private static void enableIgnore() { - IgnoreStrategy ignoreStrategy = getIgnoreStrategy(); - if (ObjectUtil.isNull(ignoreStrategy)) { - InterceptorIgnoreHelper.handle(IgnoreStrategy.builder().tenantLine(true).build()); - } else { - ignoreStrategy.setTenantLine(true); - } - Stack reentrantStack = REENTRANT_IGNORE.get(); - reentrantStack.push(reentrantStack.size() + 1); - } - - /** - * 关闭忽略租户 - */ - private static void disableIgnore() { - IgnoreStrategy ignoreStrategy = getIgnoreStrategy(); - if (ObjectUtil.isNotNull(ignoreStrategy)) { - boolean noOtherIgnoreStrategy = !Boolean.TRUE.equals(ignoreStrategy.getDynamicTableName()) - && !Boolean.TRUE.equals(ignoreStrategy.getBlockAttack()) - && !Boolean.TRUE.equals(ignoreStrategy.getIllegalSql()) - && !Boolean.TRUE.equals(ignoreStrategy.getDataPermission()) - && CollectionUtil.isEmpty(ignoreStrategy.getOthers()); - Stack reentrantStack = REENTRANT_IGNORE.get(); - boolean empty = reentrantStack.isEmpty() || reentrantStack.pop() == 1; - if (noOtherIgnoreStrategy && empty) { - InterceptorIgnoreHelper.clearIgnoreStrategy(); - } else if (empty) { - ignoreStrategy.setTenantLine(false); - } - } - } - - /** - * 在忽略租户中执行 - * - * @param handle 处理执行方法 - */ - public static void ignore(Runnable handle) { - enableIgnore(); - try { - handle.run(); - } finally { - disableIgnore(); - } - } - - /** - * 在忽略租户中执行 - * - * @param handle 处理执行方法 - */ - public static T ignore(Supplier handle) { - enableIgnore(); - try { - return handle.get(); - } finally { - disableIgnore(); - } - } - - public static void setDynamic(String tenantId) { - setDynamic(tenantId, false); - } - - /** - * 设置动态租户(一直有效 需要手动清理) - *

- * 如果为未登录状态下 那么只在当前线程内生效 - * - * @param tenantId 租户id - * @param global 是否全局生效 - */ - public static void setDynamic(String tenantId, boolean global) { - if (!isEnable()) { - return; - } - if (!LoginHelper.isLogin() || !global) { - TEMP_DYNAMIC_TENANT.set(tenantId); - return; - } - String cacheKey = DYNAMIC_TENANT_KEY + ":" + LoginHelper.getUserId(); - RedisUtils.setCacheObject(cacheKey, tenantId); - SaHolder.getStorage().set(cacheKey, tenantId); - } - - /** - * 获取动态租户(一直有效 需要手动清理) - *

- * 如果为未登录状态下 那么只在当前线程内生效 - */ - public static String getDynamic() { - if (!isEnable()) { - return null; - } - if (!LoginHelper.isLogin()) { - return TEMP_DYNAMIC_TENANT.get(); - } - // 如果线程内有值 优先返回 - String tenantId = TEMP_DYNAMIC_TENANT.get(); - if (StringUtils.isNotBlank(tenantId)) { - return tenantId; - } - SaStorage storage = SaHolder.getStorage(); - String cacheKey = DYNAMIC_TENANT_KEY + ":" + LoginHelper.getUserId(); - tenantId = storage.getString(cacheKey); - // 如果为 -1 说明已经查过redis并且不存在值 则直接返回null - if (StringUtils.isNotBlank(tenantId)) { - return tenantId.equals("-1") ? null : tenantId; - } - tenantId = RedisUtils.getCacheObject(cacheKey); - storage.set(cacheKey, StringUtils.isBlank(tenantId) ? "-1" : tenantId); - return tenantId; - } - - /** - * 清除动态租户 - */ - public static void clearDynamic() { - if (!isEnable()) { - return; - } - if (!LoginHelper.isLogin()) { - TEMP_DYNAMIC_TENANT.remove(); - return; - } - TEMP_DYNAMIC_TENANT.remove(); - String cacheKey = DYNAMIC_TENANT_KEY + ":" + LoginHelper.getUserId(); - RedisUtils.deleteObject(cacheKey); - SaHolder.getStorage().delete(cacheKey); - } - - /** - * 在动态租户中执行 - * - * @param handle 处理执行方法 - */ - public static void dynamic(String tenantId, Runnable handle) { - setDynamic(tenantId); - try { - handle.run(); - } finally { - clearDynamic(); - } - } - - /** - * 在动态租户中执行 - * - * @param handle 处理执行方法 - */ - public static T dynamic(String tenantId, Supplier handle) { - setDynamic(tenantId); - try { - return handle.get(); - } finally { - clearDynamic(); - } - } - - /** - * 获取当前租户id(动态租户优先) - */ - public static String getTenantId() { - if (!isEnable()) { - return null; - } - String tenantId = TenantHelper.getDynamic(); - if (StringUtils.isBlank(tenantId)) { - tenantId = LoginHelper.getTenantId(); - } - return tenantId; - } - -} diff --git a/ruoyi-common/ruoyi-common-tenant/src/main/java/org/dromara/common/tenant/manager/TenantSpringCacheManager.java b/ruoyi-common/ruoyi-common-tenant/src/main/java/org/dromara/common/tenant/manager/TenantSpringCacheManager.java deleted file mode 100644 index 346e36f1c..000000000 --- a/ruoyi-common/ruoyi-common-tenant/src/main/java/org/dromara/common/tenant/manager/TenantSpringCacheManager.java +++ /dev/null @@ -1,41 +0,0 @@ -package org.dromara.common.tenant.manager; - -import com.baomidou.mybatisplus.core.plugins.InterceptorIgnoreHelper; -import lombok.extern.slf4j.Slf4j; -import org.dromara.common.core.constant.GlobalConstants; -import org.dromara.common.core.utils.StringUtils; -import org.dromara.common.redis.manager.PlusSpringCacheManager; -import org.dromara.common.tenant.helper.TenantHelper; -import org.springframework.cache.Cache; - -/** - * 重写 cacheName 处理方法 支持多租户 - * - * @author Lion Li - */ -@Slf4j -public class TenantSpringCacheManager extends PlusSpringCacheManager { - - public TenantSpringCacheManager() { - } - - @Override - public Cache getCache(String name) { - if (InterceptorIgnoreHelper.willIgnoreTenantLine("")) { - return super.getCache(name); - } - if (StringUtils.contains(name, GlobalConstants.GLOBAL_REDIS_KEY)) { - return super.getCache(name); - } - String tenantId = TenantHelper.getTenantId(); - if (StringUtils.isBlank(tenantId)) { - log.error("无法获取有效的租户id -> Null"); - } - if (StringUtils.startsWith(name, tenantId)) { - // 如果存在则直接返回 - return super.getCache(name); - } - return super.getCache(tenantId + ":" + name); - } - -} diff --git a/ruoyi-common/ruoyi-common-tenant/src/main/java/org/dromara/common/tenant/properties/TenantProperties.java b/ruoyi-common/ruoyi-common-tenant/src/main/java/org/dromara/common/tenant/properties/TenantProperties.java deleted file mode 100644 index 1675ccf58..000000000 --- a/ruoyi-common/ruoyi-common-tenant/src/main/java/org/dromara/common/tenant/properties/TenantProperties.java +++ /dev/null @@ -1,27 +0,0 @@ -package org.dromara.common.tenant.properties; - -import lombok.Data; -import org.springframework.boot.context.properties.ConfigurationProperties; - -import java.util.List; - -/** - * 租户 配置属性 - * - * @author Lion Li - */ -@Data -@ConfigurationProperties(prefix = "tenant") -public class TenantProperties { - - /** - * 是否启用 - */ - private Boolean enable; - - /** - * 排除表 - */ - private List excludes; - -} diff --git a/ruoyi-common/ruoyi-common-tenant/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports b/ruoyi-common/ruoyi-common-tenant/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports deleted file mode 100644 index f837191ef..000000000 --- a/ruoyi-common/ruoyi-common-tenant/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports +++ /dev/null @@ -1 +0,0 @@ -org.dromara.common.tenant.config.TenantConfig diff --git a/ruoyi-modules/ruoyi-demo/pom.xml b/ruoyi-modules/ruoyi-demo/pom.xml index 119fe61b7..0a91fdc62 100644 --- a/ruoyi-modules/ruoyi-demo/pom.xml +++ b/ruoyi-modules/ruoyi-demo/pom.xml @@ -93,11 +93,6 @@ ruoyi-common-encrypt - - org.dromara - ruoyi-common-tenant - - org.dromara ruoyi-common-websocket diff --git a/ruoyi-modules/ruoyi-demo/src/main/java/org/dromara/demo/domain/TestDemo.java b/ruoyi-modules/ruoyi-demo/src/main/java/org/dromara/demo/domain/TestDemo.java index d3af0c963..6477f0aa5 100644 --- a/ruoyi-modules/ruoyi-demo/src/main/java/org/dromara/demo/domain/TestDemo.java +++ b/ruoyi-modules/ruoyi-demo/src/main/java/org/dromara/demo/domain/TestDemo.java @@ -1,9 +1,9 @@ package org.dromara.demo.domain; import com.baomidou.mybatisplus.annotation.*; -import org.dromara.common.tenant.core.TenantEntity; import lombok.Data; import lombok.EqualsAndHashCode; +import org.dromara.common.mybatis.core.domain.BaseEntity; import java.io.Serial; @@ -16,7 +16,7 @@ import java.io.Serial; @Data @EqualsAndHashCode(callSuper = true) @TableName("test_demo") -public class TestDemo extends TenantEntity { +public class TestDemo extends BaseEntity { @Serial private static final long serialVersionUID = 1L; diff --git a/ruoyi-modules/ruoyi-demo/src/main/java/org/dromara/demo/domain/TestTree.java b/ruoyi-modules/ruoyi-demo/src/main/java/org/dromara/demo/domain/TestTree.java index fd6825386..2f8c6bbdb 100644 --- a/ruoyi-modules/ruoyi-demo/src/main/java/org/dromara/demo/domain/TestTree.java +++ b/ruoyi-modules/ruoyi-demo/src/main/java/org/dromara/demo/domain/TestTree.java @@ -4,9 +4,9 @@ import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableLogic; import com.baomidou.mybatisplus.annotation.TableName; import com.baomidou.mybatisplus.annotation.Version; -import org.dromara.common.tenant.core.TenantEntity; import lombok.Data; import lombok.EqualsAndHashCode; +import org.dromara.common.mybatis.core.domain.BaseEntity; import java.io.Serial; @@ -19,7 +19,7 @@ import java.io.Serial; @Data @EqualsAndHashCode(callSuper = true) @TableName("test_tree") -public class TestTree extends TenantEntity { +public class TestTree extends BaseEntity { @Serial private static final long serialVersionUID = 1L; diff --git a/ruoyi-modules/ruoyi-generator/src/main/resources/vm/java/domain.java.vm b/ruoyi-modules/ruoyi-generator/src/main/resources/vm/java/domain.java.vm index 205fb7308..ef38136aa 100644 --- a/ruoyi-modules/ruoyi-generator/src/main/resources/vm/java/domain.java.vm +++ b/ruoyi-modules/ruoyi-generator/src/main/resources/vm/java/domain.java.vm @@ -1,15 +1,6 @@ package ${packageName}.domain; -#foreach ($column in $columns) -#if($column.javaField=='tenantId') -#set($IsTenant=1) -#end -#end -#if($IsTenant==1) -import org.dromara.common.tenant.core.TenantEntity; -#else import org.dromara.common.mybatis.core.domain.BaseEntity; -#end import com.baomidou.mybatisplus.annotation.*; import lombok.Data; import lombok.EqualsAndHashCode; @@ -25,11 +16,7 @@ import java.io.Serial; * @author ${author} * @date ${datetime} */ -#if($IsTenant==1) -#set($Entity="TenantEntity") -#else #set($Entity="BaseEntity") -#end @Data @EqualsAndHashCode(callSuper = true) @TableName("${tableName}") diff --git a/ruoyi-modules/ruoyi-system/pom.xml b/ruoyi-modules/ruoyi-system/pom.xml index 0fc6d5513..1893ab096 100644 --- a/ruoyi-modules/ruoyi-system/pom.xml +++ b/ruoyi-modules/ruoyi-system/pom.xml @@ -60,11 +60,6 @@ ruoyi-common-sms - - org.dromara - ruoyi-common-tenant - - org.dromara ruoyi-common-security diff --git a/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/controller/system/SysMenuController.java b/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/controller/system/SysMenuController.java index 9d95880e8..3bea85ea3 100644 --- a/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/controller/system/SysMenuController.java +++ b/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/controller/system/SysMenuController.java @@ -6,7 +6,6 @@ import cn.dev33.satoken.annotation.SaMode; import cn.hutool.core.lang.tree.Tree; import lombok.RequiredArgsConstructor; import org.dromara.common.core.constant.SystemConstants; -import org.dromara.common.core.constant.TenantConstants; import org.dromara.common.core.domain.R; import org.dromara.common.core.utils.StringUtils; import org.dromara.common.idempotent.annotation.RepeatSubmit; @@ -22,7 +21,6 @@ import org.dromara.system.service.ISysMenuService; import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.*; -import java.util.ArrayList; import java.util.List; /** @@ -53,8 +51,7 @@ public class SysMenuController extends BaseController { * 获取菜单列表 */ @SaCheckRole(value = { - TenantConstants.SUPER_ADMIN_ROLE_KEY, - TenantConstants.TENANT_ADMIN_ROLE_KEY + SystemConstants.SUPER_ADMIN_ROLE_KEY, }, mode = SaMode.OR) @SaCheckPermission("system:menu:list") @GetMapping("/list") @@ -69,8 +66,7 @@ public class SysMenuController extends BaseController { * @param menuId 菜单ID */ @SaCheckRole(value = { - TenantConstants.SUPER_ADMIN_ROLE_KEY, - TenantConstants.TENANT_ADMIN_ROLE_KEY + SystemConstants.SUPER_ADMIN_ROLE_KEY, }, mode = SaMode.OR) @SaCheckPermission("system:menu:query") @GetMapping(value = "/{menuId}") @@ -103,31 +99,10 @@ public class SysMenuController extends BaseController { return R.ok(selectVo); } - /** - * 加载对应租户套餐菜单列表树 - * - * @param packageId 租户套餐ID - */ - @SaCheckRole(TenantConstants.SUPER_ADMIN_ROLE_KEY) - @SaCheckPermission("system:menu:query") - @GetMapping(value = "/tenantPackageMenuTreeselect/{packageId}") - public R tenantPackageMenuTreeselect(@PathVariable("packageId") Long packageId) { - List menus = menuService.selectMenuList(LoginHelper.getUserId()); - List> list = menuService.buildMenuTreeSelect(menus); - // 删除租户管理菜单 - list.removeIf(menu -> menu.getId() == 6L); - List ids = new ArrayList<>(); - if (packageId > 0L) { - ids = menuService.selectMenuListByPackageId(packageId); - } - MenuTreeSelectVo selectVo = new MenuTreeSelectVo(ids, list); - return R.ok(selectVo); - } - /** * 新增菜单 */ - @SaCheckRole(TenantConstants.SUPER_ADMIN_ROLE_KEY) + @SaCheckRole(SystemConstants.SUPER_ADMIN_ROLE_KEY) @SaCheckPermission("system:menu:add") @Log(title = "菜单管理", businessType = BusinessType.INSERT) @RepeatSubmit() @@ -146,7 +121,7 @@ public class SysMenuController extends BaseController { /** * 修改菜单 */ - @SaCheckRole(TenantConstants.SUPER_ADMIN_ROLE_KEY) + @SaCheckRole(SystemConstants.SUPER_ADMIN_ROLE_KEY) @SaCheckPermission("system:menu:edit") @Log(title = "菜单管理", businessType = BusinessType.UPDATE) @RepeatSubmit() @@ -169,7 +144,7 @@ public class SysMenuController extends BaseController { * * @param menuId 菜单ID */ - @SaCheckRole(TenantConstants.SUPER_ADMIN_ROLE_KEY) + @SaCheckRole(SystemConstants.SUPER_ADMIN_ROLE_KEY) @SaCheckPermission("system:menu:remove") @Log(title = "菜单管理", businessType = BusinessType.DELETE) @DeleteMapping("/{menuId}") @@ -197,7 +172,7 @@ public class SysMenuController extends BaseController { * * @param menuIds 菜单ID串 */ - @SaCheckRole(TenantConstants.SUPER_ADMIN_ROLE_KEY) + @SaCheckRole(SystemConstants.SUPER_ADMIN_ROLE_KEY) @SaCheckPermission("system:menu:remove") @Log(title = "菜单管理", businessType = BusinessType.DELETE) @DeleteMapping("/cascade/{menuIds}") diff --git a/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/controller/system/SysTenantController.java b/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/controller/system/SysTenantController.java deleted file mode 100644 index b29e68110..000000000 --- a/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/controller/system/SysTenantController.java +++ /dev/null @@ -1,211 +0,0 @@ -package org.dromara.system.controller.system; - -import cn.dev33.satoken.annotation.SaCheckPermission; -import cn.dev33.satoken.annotation.SaCheckRole; -import com.baomidou.lock.annotation.Lock4j; -import jakarta.servlet.http.HttpServletResponse; -import jakarta.validation.constraints.NotBlank; -import jakarta.validation.constraints.NotEmpty; -import jakarta.validation.constraints.NotNull; -import lombok.RequiredArgsConstructor; -import org.dromara.common.core.constant.TenantConstants; -import org.dromara.common.core.domain.R; -import org.dromara.common.core.validate.AddGroup; -import org.dromara.common.core.validate.EditGroup; -import org.dromara.common.encrypt.annotation.ApiEncrypt; -import org.dromara.common.excel.utils.ExcelUtil; -import org.dromara.common.idempotent.annotation.RepeatSubmit; -import org.dromara.common.log.annotation.Log; -import org.dromara.common.log.enums.BusinessType; -import org.dromara.common.mybatis.core.page.PageQuery; -import org.dromara.common.mybatis.core.page.TableDataInfo; -import org.dromara.common.tenant.helper.TenantHelper; -import org.dromara.common.web.core.BaseController; -import org.dromara.system.domain.bo.SysTenantBo; -import org.dromara.system.domain.vo.SysTenantVo; -import org.dromara.system.service.ISysTenantService; -import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; -import org.springframework.validation.annotation.Validated; -import org.springframework.web.bind.annotation.*; - -import java.util.List; - -/** - * 租户管理 - * - * @author Michelle.Chung - */ -@Validated -@RequiredArgsConstructor -@RestController -@RequestMapping("/system/tenant") -@ConditionalOnProperty(value = "tenant.enable", havingValue = "true") -public class SysTenantController extends BaseController { - - private final ISysTenantService tenantService; - - /** - * 查询租户列表 - */ - @SaCheckRole(TenantConstants.SUPER_ADMIN_ROLE_KEY) - @SaCheckPermission("system:tenant:list") - @GetMapping("/list") - public TableDataInfo list(SysTenantBo bo, PageQuery pageQuery) { - return tenantService.queryPageList(bo, pageQuery); - } - - /** - * 导出租户列表 - */ - @SaCheckRole(TenantConstants.SUPER_ADMIN_ROLE_KEY) - @SaCheckPermission("system:tenant:export") - @Log(title = "租户管理", businessType = BusinessType.EXPORT) - @PostMapping("/export") - public void export(SysTenantBo bo, HttpServletResponse response) { - List list = tenantService.queryList(bo); - ExcelUtil.exportExcel(list, "租户", SysTenantVo.class, response); - } - - /** - * 获取租户详细信息 - * - * @param id 主键 - */ - @SaCheckRole(TenantConstants.SUPER_ADMIN_ROLE_KEY) - @SaCheckPermission("system:tenant:query") - @GetMapping("/{id}") - public R getInfo(@NotNull(message = "主键不能为空") - @PathVariable Long id) { - return R.ok(tenantService.queryById(id)); - } - - /** - * 新增租户 - */ - @ApiEncrypt - @SaCheckRole(TenantConstants.SUPER_ADMIN_ROLE_KEY) - @SaCheckPermission("system:tenant:add") - @Log(title = "租户管理", businessType = BusinessType.INSERT) - @Lock4j - @RepeatSubmit() - @PostMapping() - public R add(@Validated(AddGroup.class) @RequestBody SysTenantBo bo) { - if (!tenantService.checkCompanyNameUnique(bo)) { - return R.fail("新增租户'" + bo.getCompanyName() + "'失败,企业名称已存在"); - } - return toAjax(TenantHelper.ignore(() -> tenantService.insertByBo(bo))); - } - - /** - * 修改租户 - */ - @SaCheckRole(TenantConstants.SUPER_ADMIN_ROLE_KEY) - @SaCheckPermission("system:tenant:edit") - @Log(title = "租户管理", businessType = BusinessType.UPDATE) - @RepeatSubmit() - @PutMapping() - public R edit(@Validated(EditGroup.class) @RequestBody SysTenantBo bo) { - tenantService.checkTenantAllowed(bo.getTenantId()); - if (!tenantService.checkCompanyNameUnique(bo)) { - return R.fail("修改租户'" + bo.getCompanyName() + "'失败,公司名称已存在"); - } - return toAjax(tenantService.updateByBo(bo)); - } - - /** - * 状态修改 - */ - @SaCheckRole(TenantConstants.SUPER_ADMIN_ROLE_KEY) - @SaCheckPermission("system:tenant:edit") - @Log(title = "租户管理", businessType = BusinessType.UPDATE) - @RepeatSubmit() - @PutMapping("/changeStatus") - public R changeStatus(@RequestBody SysTenantBo bo) { - tenantService.checkTenantAllowed(bo.getTenantId()); - return toAjax(tenantService.updateTenantStatus(bo)); - } - - /** - * 删除租户 - * - * @param ids 主键串 - */ - @SaCheckRole(TenantConstants.SUPER_ADMIN_ROLE_KEY) - @SaCheckPermission("system:tenant:remove") - @Log(title = "租户管理", businessType = BusinessType.DELETE) - @DeleteMapping("/{ids}") - public R remove(@NotEmpty(message = "主键不能为空") - @PathVariable Long[] ids) { - return toAjax(tenantService.deleteWithValidByIds(List.of(ids), true)); - } - - /** - * 动态切换租户 - * - * @param tenantId 租户ID - */ - @SaCheckRole(TenantConstants.SUPER_ADMIN_ROLE_KEY) - @GetMapping("/dynamic/{tenantId}") - public R dynamicTenant(@NotBlank(message = "租户ID不能为空") @PathVariable String tenantId) { - TenantHelper.setDynamic(tenantId, true); - return R.ok(); - } - - /** - * 清除动态租户 - */ - @SaCheckRole(TenantConstants.SUPER_ADMIN_ROLE_KEY) - @GetMapping("/dynamic/clear") - public R dynamicClear() { - TenantHelper.clearDynamic(); - return R.ok(); - } - - - /** - * 同步租户套餐 - * - * @param tenantId 租户id - * @param packageId 套餐id - */ - @SaCheckRole(TenantConstants.SUPER_ADMIN_ROLE_KEY) - @SaCheckPermission("system:tenant:edit") - @Log(title = "租户管理", businessType = BusinessType.UPDATE) - @Lock4j - @GetMapping("/syncTenantPackage") - public R syncTenantPackage(@NotBlank(message = "租户ID不能为空") String tenantId, - @NotNull(message = "套餐ID不能为空") Long packageId) { - return toAjax(TenantHelper.ignore(() -> tenantService.syncTenantPackage(tenantId, packageId))); - } - - /** - * 同步租户字典 - */ - @SaCheckRole(TenantConstants.SUPER_ADMIN_ROLE_KEY) - @Log(title = "租户管理", businessType = BusinessType.INSERT) - @Lock4j - @GetMapping("/syncTenantDict") - public R syncTenantDict() { - if (!TenantHelper.isEnable()) { - return R.fail("当前未开启租户模式"); - } - tenantService.syncTenantDict(); - return R.ok("同步租户字典成功"); - } - - /** - * 同步租户参数配置 - */ - @SaCheckRole(TenantConstants.SUPER_ADMIN_ROLE_KEY) - @Log(title = "租户管理", businessType = BusinessType.INSERT) - @Lock4j - @GetMapping("/syncTenantConfig") - public R syncTenantConfig() { - if (!TenantHelper.isEnable()) { - return R.fail("当前未开启租户模式"); - } - tenantService.syncTenantConfig(); - return R.ok("同步租户参数配置成功"); - } - -} diff --git a/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/controller/system/SysTenantPackageController.java b/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/controller/system/SysTenantPackageController.java deleted file mode 100644 index 0f724bec4..000000000 --- a/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/controller/system/SysTenantPackageController.java +++ /dev/null @@ -1,143 +0,0 @@ -package org.dromara.system.controller.system; - -import cn.dev33.satoken.annotation.SaCheckPermission; -import cn.dev33.satoken.annotation.SaCheckRole; -import org.dromara.common.core.constant.TenantConstants; -import org.dromara.common.core.domain.R; -import org.dromara.common.core.validate.AddGroup; -import org.dromara.common.core.validate.EditGroup; -import org.dromara.common.excel.utils.ExcelUtil; -import org.dromara.common.idempotent.annotation.RepeatSubmit; -import org.dromara.common.log.annotation.Log; -import org.dromara.common.log.enums.BusinessType; -import org.dromara.common.mybatis.core.page.PageQuery; -import org.dromara.common.mybatis.core.page.TableDataInfo; -import org.dromara.common.web.core.BaseController; -import org.dromara.system.domain.bo.SysTenantPackageBo; -import org.dromara.system.domain.vo.SysTenantPackageVo; -import org.dromara.system.service.ISysTenantPackageService; -import jakarta.servlet.http.HttpServletResponse; -import jakarta.validation.constraints.NotEmpty; -import jakarta.validation.constraints.NotNull; -import lombok.RequiredArgsConstructor; -import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; -import org.springframework.validation.annotation.Validated; -import org.springframework.web.bind.annotation.*; - -import java.util.List; - -/** - * 租户套餐管理 - * - * @author Michelle.Chung - */ -@Validated -@RequiredArgsConstructor -@RestController -@RequestMapping("/system/tenant/package") -@ConditionalOnProperty(value = "tenant.enable", havingValue = "true") -public class SysTenantPackageController extends BaseController { - - private final ISysTenantPackageService tenantPackageService; - - /** - * 查询租户套餐列表 - */ - @SaCheckRole(TenantConstants.SUPER_ADMIN_ROLE_KEY) - @SaCheckPermission("system:tenantPackage:list") - @GetMapping("/list") - public TableDataInfo list(SysTenantPackageBo bo, PageQuery pageQuery) { - return tenantPackageService.queryPageList(bo, pageQuery); - } - - /** - * 查询租户套餐下拉选列表 - */ - @SaCheckRole(TenantConstants.SUPER_ADMIN_ROLE_KEY) - @SaCheckPermission("system:tenantPackage:list") - @GetMapping("/selectList") - public R> selectList() { - return R.ok(tenantPackageService.selectList()); - } - - /** - * 导出租户套餐列表 - */ - @SaCheckRole(TenantConstants.SUPER_ADMIN_ROLE_KEY) - @SaCheckPermission("system:tenantPackage:export") - @Log(title = "租户套餐", businessType = BusinessType.EXPORT) - @PostMapping("/export") - public void export(SysTenantPackageBo bo, HttpServletResponse response) { - List list = tenantPackageService.queryList(bo); - ExcelUtil.exportExcel(list, "租户套餐", SysTenantPackageVo.class, response); - } - - /** - * 获取租户套餐详细信息 - * - * @param packageId 主键 - */ - @SaCheckRole(TenantConstants.SUPER_ADMIN_ROLE_KEY) - @SaCheckPermission("system:tenantPackage:query") - @GetMapping("/{packageId}") - public R getInfo(@NotNull(message = "主键不能为空") - @PathVariable Long packageId) { - return R.ok(tenantPackageService.queryById(packageId)); - } - - /** - * 新增租户套餐 - */ - @SaCheckRole(TenantConstants.SUPER_ADMIN_ROLE_KEY) - @SaCheckPermission("system:tenantPackage:add") - @Log(title = "租户套餐", businessType = BusinessType.INSERT) - @RepeatSubmit() - @PostMapping() - public R add(@Validated(AddGroup.class) @RequestBody SysTenantPackageBo bo) { - if (!tenantPackageService.checkPackageNameUnique(bo)) { - return R.fail("新增套餐'" + bo.getPackageName() + "'失败,套餐名称已存在"); - } - return toAjax(tenantPackageService.insertByBo(bo)); - } - - /** - * 修改租户套餐 - */ - @SaCheckRole(TenantConstants.SUPER_ADMIN_ROLE_KEY) - @SaCheckPermission("system:tenantPackage:edit") - @Log(title = "租户套餐", businessType = BusinessType.UPDATE) - @RepeatSubmit() - @PutMapping() - public R edit(@Validated(EditGroup.class) @RequestBody SysTenantPackageBo bo) { - if (!tenantPackageService.checkPackageNameUnique(bo)) { - return R.fail("修改套餐'" + bo.getPackageName() + "'失败,套餐名称已存在"); - } - return toAjax(tenantPackageService.updateByBo(bo)); - } - - /** - * 状态修改 - */ - @SaCheckRole(TenantConstants.SUPER_ADMIN_ROLE_KEY) - @SaCheckPermission("system:tenantPackage:edit") - @Log(title = "租户套餐", businessType = BusinessType.UPDATE) - @RepeatSubmit() - @PutMapping("/changeStatus") - public R changeStatus(@RequestBody SysTenantPackageBo bo) { - return toAjax(tenantPackageService.updatePackageStatus(bo)); - } - - /** - * 删除租户套餐 - * - * @param packageIds 主键串 - */ - @SaCheckRole(TenantConstants.SUPER_ADMIN_ROLE_KEY) - @SaCheckPermission("system:tenantPackage:remove") - @Log(title = "租户套餐", businessType = BusinessType.DELETE) - @DeleteMapping("/{packageIds}") - public R remove(@NotEmpty(message = "主键不能为空") - @PathVariable Long[] packageIds) { - return toAjax(tenantPackageService.deleteWithValidByIds(List.of(packageIds), true)); - } -} diff --git a/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/controller/system/SysUserController.java b/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/controller/system/SysUserController.java index 2847fc299..471da5bb0 100644 --- a/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/controller/system/SysUserController.java +++ b/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/controller/system/SysUserController.java @@ -23,7 +23,6 @@ import org.dromara.common.mybatis.core.page.PageQuery; import org.dromara.common.mybatis.core.page.TableDataInfo; import org.dromara.common.mybatis.helper.DataPermissionHelper; import org.dromara.common.satoken.utils.LoginHelper; -import org.dromara.common.tenant.helper.TenantHelper; import org.dromara.common.web.core.BaseController; import org.dromara.system.domain.bo.SysDeptBo; import org.dromara.system.domain.bo.SysPostBo; @@ -31,7 +30,10 @@ import org.dromara.system.domain.bo.SysRoleBo; import org.dromara.system.domain.bo.SysUserBo; import org.dromara.system.domain.vo.*; import org.dromara.system.listener.SysUserImportListener; -import org.dromara.system.service.*; +import org.dromara.system.service.ISysDeptService; +import org.dromara.system.service.ISysPostService; +import org.dromara.system.service.ISysRoleService; +import org.dromara.system.service.ISysUserService; import org.springframework.http.MediaType; import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.*; @@ -55,7 +57,6 @@ public class SysUserController extends BaseController { private final ISysRoleService roleService; private final ISysPostService postService; private final ISysDeptService deptService; - private final ISysTenantService tenantService; /** * 获取用户列表 @@ -108,10 +109,6 @@ public class SysUserController extends BaseController { public R getInfo() { UserInfoVo userInfoVo = new UserInfoVo(); LoginUser loginUser = LoginHelper.getLoginUser(); - if (TenantHelper.isEnable() && LoginHelper.isSuperAdmin()) { - // 超级管理员 如果重新加载用户信息需清除动态租户 - TenantHelper.clearDynamic(); - } SysUserVo user = DataPermissionHelper.ignore(() -> userService.selectUserById(loginUser.getUserId())); if (ObjectUtil.isNull(user)) { @@ -168,11 +165,6 @@ public class SysUserController extends BaseController { } else if (StringUtils.isNotEmpty(user.getEmail()) && !userService.checkEmailUnique(user)) { return R.fail("新增用户'" + user.getUserName() + "'失败,邮箱账号已存在"); } - if (TenantHelper.isEnable()) { - if (!tenantService.checkAccountBalance(TenantHelper.getTenantId())) { - return R.fail("当前租户下用户名额不足,请联系管理员"); - } - } user.setPassword(BCrypt.hashpw(user.getPassword())); return toAjax(userService.insertUser(user)); } diff --git a/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/domain/SysConfig.java b/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/domain/SysConfig.java index 6fcb88fef..60a4ced61 100644 --- a/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/domain/SysConfig.java +++ b/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/domain/SysConfig.java @@ -2,9 +2,9 @@ package org.dromara.system.domain; import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableName; -import org.dromara.common.tenant.core.TenantEntity; import lombok.Data; import lombok.EqualsAndHashCode; +import org.dromara.common.mybatis.core.domain.BaseEntity; /** * 参数配置表 sys_config @@ -15,7 +15,7 @@ import lombok.EqualsAndHashCode; @Data @EqualsAndHashCode(callSuper = true) @TableName("sys_config") -public class SysConfig extends TenantEntity { +public class SysConfig extends BaseEntity { /** * 参数主键 diff --git a/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/domain/SysDept.java b/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/domain/SysDept.java index d436a1cfc..5ad19db14 100644 --- a/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/domain/SysDept.java +++ b/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/domain/SysDept.java @@ -6,7 +6,7 @@ import com.baomidou.mybatisplus.annotation.TableLogic; import com.baomidou.mybatisplus.annotation.TableName; import lombok.Data; import lombok.EqualsAndHashCode; -import org.dromara.common.tenant.core.TenantEntity; +import org.dromara.common.mybatis.core.domain.BaseEntity; import java.io.Serial; import java.util.ArrayList; @@ -21,7 +21,7 @@ import java.util.List; @Data @EqualsAndHashCode(callSuper = true) @TableName("sys_dept") -public class SysDept extends TenantEntity { +public class SysDept extends BaseEntity { @Serial private static final long serialVersionUID = 1L; diff --git a/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/domain/SysDictData.java b/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/domain/SysDictData.java index 9d83736e5..3493662bd 100644 --- a/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/domain/SysDictData.java +++ b/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/domain/SysDictData.java @@ -5,7 +5,7 @@ import com.baomidou.mybatisplus.annotation.TableName; import lombok.Data; import lombok.EqualsAndHashCode; import org.dromara.common.core.constant.SystemConstants; -import org.dromara.common.tenant.core.TenantEntity; +import org.dromara.common.mybatis.core.domain.BaseEntity; /** * 字典数据表 sys_dict_data @@ -16,7 +16,7 @@ import org.dromara.common.tenant.core.TenantEntity; @Data @EqualsAndHashCode(callSuper = true) @TableName("sys_dict_data") -public class SysDictData extends TenantEntity { +public class SysDictData extends BaseEntity { /** * 字典编码 diff --git a/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/domain/SysDictType.java b/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/domain/SysDictType.java index 955af85fb..c8f099b2e 100644 --- a/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/domain/SysDictType.java +++ b/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/domain/SysDictType.java @@ -2,9 +2,9 @@ package org.dromara.system.domain; import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableName; -import org.dromara.common.tenant.core.TenantEntity; import lombok.Data; import lombok.EqualsAndHashCode; +import org.dromara.common.mybatis.core.domain.BaseEntity; /** * 字典类型表 sys_dict_type @@ -15,7 +15,7 @@ import lombok.EqualsAndHashCode; @Data @EqualsAndHashCode(callSuper = true) @TableName("sys_dict_type") -public class SysDictType extends TenantEntity { +public class SysDictType extends BaseEntity { /** * 字典主键 diff --git a/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/domain/SysLogininfor.java b/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/domain/SysLogininfor.java index c57dc0a52..e646fc83d 100644 --- a/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/domain/SysLogininfor.java +++ b/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/domain/SysLogininfor.java @@ -27,11 +27,6 @@ public class SysLogininfor implements Serializable { @TableId(value = "info_id") private Long infoId; - /** - * 租户编号 - */ - private String tenantId; - /** * 用户账号 */ diff --git a/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/domain/SysNotice.java b/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/domain/SysNotice.java index bfcc2bc7f..9ef00a484 100644 --- a/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/domain/SysNotice.java +++ b/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/domain/SysNotice.java @@ -2,9 +2,9 @@ package org.dromara.system.domain; import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableName; -import org.dromara.common.tenant.core.TenantEntity; import lombok.Data; import lombok.EqualsAndHashCode; +import org.dromara.common.mybatis.core.domain.BaseEntity; /** @@ -15,7 +15,7 @@ import lombok.EqualsAndHashCode; @Data @EqualsAndHashCode(callSuper = true) @TableName("sys_notice") -public class SysNotice extends TenantEntity { +public class SysNotice extends BaseEntity { /** * 公告ID diff --git a/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/domain/SysOperLog.java b/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/domain/SysOperLog.java index 41a8c59fa..6b5a325a6 100644 --- a/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/domain/SysOperLog.java +++ b/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/domain/SysOperLog.java @@ -27,11 +27,6 @@ public class SysOperLog implements Serializable { @TableId(value = "oper_id") private Long operId; - /** - * 租户编号 - */ - private String tenantId; - /** * 操作模块 */ diff --git a/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/domain/SysOss.java b/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/domain/SysOss.java index 2285a5da7..374844531 100644 --- a/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/domain/SysOss.java +++ b/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/domain/SysOss.java @@ -2,9 +2,9 @@ package org.dromara.system.domain; import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableName; -import org.dromara.common.tenant.core.TenantEntity; import lombok.Data; import lombok.EqualsAndHashCode; +import org.dromara.common.mybatis.core.domain.BaseEntity; /** * OSS对象存储对象 @@ -14,7 +14,7 @@ import lombok.EqualsAndHashCode; @Data @EqualsAndHashCode(callSuper = true) @TableName("sys_oss") -public class SysOss extends TenantEntity { +public class SysOss extends BaseEntity { /** * 对象存储主键 diff --git a/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/domain/SysPost.java b/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/domain/SysPost.java index 2c985da6a..bd58c7870 100644 --- a/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/domain/SysPost.java +++ b/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/domain/SysPost.java @@ -2,9 +2,9 @@ package org.dromara.system.domain; import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableName; -import org.dromara.common.tenant.core.TenantEntity; import lombok.Data; import lombok.EqualsAndHashCode; +import org.dromara.common.mybatis.core.domain.BaseEntity; /** * 岗位表 sys_post @@ -15,7 +15,7 @@ import lombok.EqualsAndHashCode; @Data @EqualsAndHashCode(callSuper = true) @TableName("sys_post") -public class SysPost extends TenantEntity { +public class SysPost extends BaseEntity { /** * 岗位序号 diff --git a/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/domain/SysRole.java b/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/domain/SysRole.java index aa1b19a4f..d55a3a4c7 100644 --- a/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/domain/SysRole.java +++ b/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/domain/SysRole.java @@ -3,10 +3,10 @@ package org.dromara.system.domain; import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableLogic; import com.baomidou.mybatisplus.annotation.TableName; -import org.dromara.common.tenant.core.TenantEntity; import lombok.Data; import lombok.EqualsAndHashCode; import lombok.NoArgsConstructor; +import org.dromara.common.mybatis.core.domain.BaseEntity; /** * 角色表 sys_role @@ -18,7 +18,7 @@ import lombok.NoArgsConstructor; @NoArgsConstructor @EqualsAndHashCode(callSuper = true) @TableName("sys_role") -public class SysRole extends TenantEntity { +public class SysRole extends BaseEntity { /** * 角色ID diff --git a/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/domain/SysSocial.java b/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/domain/SysSocial.java index 10f2936c1..6210036ab 100644 --- a/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/domain/SysSocial.java +++ b/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/domain/SysSocial.java @@ -4,7 +4,7 @@ import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableName; import lombok.Data; import lombok.EqualsAndHashCode; -import org.dromara.common.tenant.core.TenantEntity; +import org.dromara.common.mybatis.core.domain.BaseEntity; import java.io.Serial; @@ -16,7 +16,7 @@ import java.io.Serial; @Data @EqualsAndHashCode(callSuper = true) @TableName("sys_social") -public class SysSocial extends TenantEntity { +public class SysSocial extends BaseEntity { @Serial private static final long serialVersionUID = 1L; diff --git a/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/domain/SysTenant.java b/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/domain/SysTenant.java deleted file mode 100644 index 9800c3075..000000000 --- a/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/domain/SysTenant.java +++ /dev/null @@ -1,103 +0,0 @@ -package org.dromara.system.domain; - -import com.baomidou.mybatisplus.annotation.TableId; -import com.baomidou.mybatisplus.annotation.TableLogic; -import com.baomidou.mybatisplus.annotation.TableName; -import org.dromara.common.mybatis.core.domain.BaseEntity; -import lombok.Data; -import lombok.EqualsAndHashCode; - -import java.io.Serial; -import java.util.Date; - -/** - * 租户对象 sys_tenant - * - * @author Michelle.Chung - */ -@Data -@EqualsAndHashCode(callSuper = true) -@TableName("sys_tenant") -public class SysTenant extends BaseEntity { - - @Serial - private static final long serialVersionUID = 1L; - - /** - * id - */ - @TableId(value = "id") - private Long id; - - /** - * 租户编号 - */ - private String tenantId; - - /** - * 联系人 - */ - private String contactUserName; - - /** - * 联系电话 - */ - private String contactPhone; - - /** - * 企业名称 - */ - private String companyName; - - /** - * 统一社会信用代码 - */ - private String licenseNumber; - - /** - * 地址 - */ - private String address; - - /** - * 域名 - */ - private String domain; - - /** - * 企业简介 - */ - private String intro; - - /** - * 备注 - */ - private String remark; - - /** - * 租户套餐编号 - */ - private Long packageId; - - /** - * 过期时间 - */ - private Date expireTime; - - /** - * 用户数量(-1不限制) - */ - private Long accountCount; - - /** - * 租户状态(0正常 1停用) - */ - private String status; - - /** - * 删除标志(0代表存在 1代表删除) - */ - @TableLogic - private String delFlag; - -} diff --git a/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/domain/SysTenantPackage.java b/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/domain/SysTenantPackage.java deleted file mode 100644 index 5f58e3eca..000000000 --- a/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/domain/SysTenantPackage.java +++ /dev/null @@ -1,60 +0,0 @@ -package org.dromara.system.domain; - -import com.baomidou.mybatisplus.annotation.*; -import lombok.Data; -import lombok.EqualsAndHashCode; -import java.io.Serial; - -import org.dromara.common.mybatis.core.domain.BaseEntity; - -/** - * 租户套餐对象 sys_tenant_package - * - * @author Michelle.Chung - */ -@Data -@EqualsAndHashCode(callSuper = true) -@TableName("sys_tenant_package") -public class SysTenantPackage extends BaseEntity { - - @Serial - private static final long serialVersionUID = 1L; - - /** - * 租户套餐id - */ - @TableId(value = "package_id") - private Long packageId; - - /** - * 套餐名称 - */ - private String packageName; - - /** - * 关联菜单id - */ - private String menuIds; - - /** - * 备注 - */ - private String remark; - - /** - * 菜单树选择项是否关联显示( 0:父子不互相关联显示 1:父子互相关联显示) - */ - private Boolean menuCheckStrictly; - - /** - * 状态(0正常 1停用) - */ - private String status; - - /** - * 删除标志(0代表存在 1代表删除) - */ - @TableLogic - private String delFlag; - -} diff --git a/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/domain/SysUser.java b/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/domain/SysUser.java index a06172f66..6e00417cf 100644 --- a/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/domain/SysUser.java +++ b/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/domain/SysUser.java @@ -5,7 +5,7 @@ import lombok.Data; import lombok.EqualsAndHashCode; import lombok.NoArgsConstructor; import org.dromara.common.core.constant.SystemConstants; -import org.dromara.common.tenant.core.TenantEntity; +import org.dromara.common.mybatis.core.domain.BaseEntity; import java.util.Date; @@ -19,7 +19,7 @@ import java.util.Date; @NoArgsConstructor @EqualsAndHashCode(callSuper = true) @TableName("sys_user") -public class SysUser extends TenantEntity { +public class SysUser extends BaseEntity { /** * 用户ID diff --git a/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/domain/bo/SysLogininforBo.java b/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/domain/bo/SysLogininforBo.java index 464616278..8cce2547d 100644 --- a/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/domain/bo/SysLogininforBo.java +++ b/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/domain/bo/SysLogininforBo.java @@ -23,11 +23,6 @@ public class SysLogininforBo { */ private Long infoId; - /** - * 租户编号 - */ - private String tenantId; - /** * 用户账号 */ diff --git a/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/domain/bo/SysOperLogBo.java b/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/domain/bo/SysOperLogBo.java index f16400a2f..8f547ee31 100644 --- a/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/domain/bo/SysOperLogBo.java +++ b/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/domain/bo/SysOperLogBo.java @@ -29,11 +29,6 @@ public class SysOperLogBo { */ private Long operId; - /** - * 租户编号 - */ - private String tenantId; - /** * 模块标题 */ diff --git a/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/domain/bo/SysSocialBo.java b/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/domain/bo/SysSocialBo.java index cede1e945..c3292d168 100644 --- a/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/domain/bo/SysSocialBo.java +++ b/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/domain/bo/SysSocialBo.java @@ -8,7 +8,7 @@ import lombok.EqualsAndHashCode; import lombok.NoArgsConstructor; import org.dromara.common.core.validate.AddGroup; import org.dromara.common.core.validate.EditGroup; -import org.dromara.common.tenant.core.TenantEntity; +import org.dromara.common.mybatis.core.domain.BaseEntity; import org.dromara.system.domain.SysSocial; /** @@ -20,7 +20,7 @@ import org.dromara.system.domain.SysSocial; @NoArgsConstructor @EqualsAndHashCode(callSuper = true) @AutoMapper(target = SysSocial.class, reverseConvertGenerate = false) -public class SysSocialBo extends TenantEntity { +public class SysSocialBo extends BaseEntity { /** * 主键 diff --git a/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/domain/bo/SysTenantBo.java b/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/domain/bo/SysTenantBo.java deleted file mode 100644 index 3757f9a26..000000000 --- a/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/domain/bo/SysTenantBo.java +++ /dev/null @@ -1,115 +0,0 @@ -package org.dromara.system.domain.bo; - -import io.github.linpeilie.annotations.AutoMapper; -import jakarta.validation.constraints.NotBlank; -import jakarta.validation.constraints.NotNull; -import lombok.Data; -import lombok.EqualsAndHashCode; -import org.dromara.common.core.validate.AddGroup; -import org.dromara.common.core.validate.EditGroup; -import org.dromara.common.mybatis.core.domain.BaseEntity; -import org.dromara.system.domain.SysTenant; - -import java.util.Date; - -/** - * 租户业务对象 sys_tenant - * - * @author Michelle.Chung - */ - -@Data -@EqualsAndHashCode(callSuper = true) -@AutoMapper(target = SysTenant.class, reverseConvertGenerate = false) -public class SysTenantBo extends BaseEntity { - - /** - * id - */ - @NotNull(message = "id不能为空", groups = { EditGroup.class }) - private Long id; - - /** - * 租户编号 - */ - private String tenantId; - - /** - * 联系人 - */ - @NotBlank(message = "联系人不能为空", groups = { AddGroup.class, EditGroup.class }) - private String contactUserName; - - /** - * 联系电话 - */ - @NotBlank(message = "联系电话不能为空", groups = { AddGroup.class, EditGroup.class }) - private String contactPhone; - - /** - * 企业名称 - */ - @NotBlank(message = "企业名称不能为空", groups = { AddGroup.class, EditGroup.class }) - private String companyName; - - /** - * 用户名(创建系统用户) - */ - @NotBlank(message = "用户名不能为空", groups = { AddGroup.class }) - private String username; - - /** - * 密码(创建系统用户) - */ - @NotBlank(message = "密码不能为空", groups = { AddGroup.class }) -// @Pattern(regexp = RegexConstants.PASSWORD, message = "{user.password.format.valid}", groups = { AddGroup.class }) - private String password; - - /** - * 统一社会信用代码 - */ - private String licenseNumber; - - /** - * 地址 - */ - private String address; - - /** - * 域名 - */ - private String domain; - - /** - * 企业简介 - */ - private String intro; - - /** - * 备注 - */ - private String remark; - - /** - * 租户套餐编号 - */ - @NotNull(message = "租户套餐不能为空", groups = { AddGroup.class }) - private Long packageId; - - /** - * 过期时间 - */ - private Date expireTime; - - /** - * 用户数量(-1不限制) - */ - private Long accountCount; - - /** - * 租户状态(0正常 1停用) - */ - private String status; - - -} diff --git a/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/domain/bo/SysTenantPackageBo.java b/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/domain/bo/SysTenantPackageBo.java deleted file mode 100644 index b27a40694..000000000 --- a/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/domain/bo/SysTenantPackageBo.java +++ /dev/null @@ -1,59 +0,0 @@ -package org.dromara.system.domain.bo; - -import org.dromara.common.core.validate.AddGroup; -import org.dromara.common.core.validate.EditGroup; -import org.dromara.system.domain.SysTenantPackage; -import io.github.linpeilie.annotations.AutoMapper; -import io.github.linpeilie.annotations.AutoMapping; -import lombok.Data; -import lombok.EqualsAndHashCode; -import jakarta.validation.constraints.*; - -import org.dromara.common.mybatis.core.domain.BaseEntity; - -/** - * 租户套餐业务对象 sys_tenant_package - * - * @author Michelle.Chung - */ - -@Data -@EqualsAndHashCode(callSuper = true) -@AutoMapper(target = SysTenantPackage.class, reverseConvertGenerate = false) -public class SysTenantPackageBo extends BaseEntity { - - /** - * 租户套餐id - */ - @NotNull(message = "租户套餐id不能为空", groups = { EditGroup.class }) - private Long packageId; - - /** - * 套餐名称 - */ - @NotBlank(message = "套餐名称不能为空", groups = { AddGroup.class, EditGroup.class }) - private String packageName; - - /** - * 关联菜单id - */ - @AutoMapping(target = "menuIds", expression = "java(org.dromara.common.core.utils.StringUtils.joinComma(source.getMenuIds()))") - private Long[] menuIds; - - /** - * 备注 - */ - private String remark; - - /** - * 菜单树选择项是否关联显示 - */ - private Boolean menuCheckStrictly; - - /** - * 状态(0正常 1停用) - */ - private String status; - - -} diff --git a/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/domain/vo/ProfileUserVo.java b/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/domain/vo/ProfileUserVo.java index 70fc5d3bc..bf00f8675 100644 --- a/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/domain/vo/ProfileUserVo.java +++ b/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/domain/vo/ProfileUserVo.java @@ -25,11 +25,6 @@ public class ProfileUserVo implements Serializable { */ private Long userId; - /** - * 租户ID - */ - private String tenantId; - /** * 部门ID */ diff --git a/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/domain/vo/SysLogininforVo.java b/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/domain/vo/SysLogininforVo.java index 3086aa74a..da640f7c2 100644 --- a/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/domain/vo/SysLogininforVo.java +++ b/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/domain/vo/SysLogininforVo.java @@ -34,11 +34,6 @@ public class SysLogininforVo implements Serializable { @ExcelProperty(value = "序号") private Long infoId; - /** - * 租户编号 - */ - private String tenantId; - /** * 用户账号 */ diff --git a/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/domain/vo/SysOperLogVo.java b/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/domain/vo/SysOperLogVo.java index 00b334432..8ad9179be 100644 --- a/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/domain/vo/SysOperLogVo.java +++ b/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/domain/vo/SysOperLogVo.java @@ -33,11 +33,6 @@ public class SysOperLogVo implements Serializable { @ExcelProperty(value = "日志主键") private Long operId; - /** - * 租户编号 - */ - private String tenantId; - /** * 模块标题 */ diff --git a/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/domain/vo/SysSocialVo.java b/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/domain/vo/SysSocialVo.java index 948dbcc7b..4e4e00def 100644 --- a/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/domain/vo/SysSocialVo.java +++ b/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/domain/vo/SysSocialVo.java @@ -31,11 +31,6 @@ public class SysSocialVo implements Serializable { */ private Long userId; - /** - * 租户ID - */ - private String tenantId; - /** * 的唯一ID */ diff --git a/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/domain/vo/SysTenantPackageVo.java b/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/domain/vo/SysTenantPackageVo.java deleted file mode 100644 index ead9229b9..000000000 --- a/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/domain/vo/SysTenantPackageVo.java +++ /dev/null @@ -1,66 +0,0 @@ -package org.dromara.system.domain.vo; - -import cn.idev.excel.annotation.ExcelIgnoreUnannotated; -import cn.idev.excel.annotation.ExcelProperty; -import org.dromara.common.excel.annotation.ExcelDictFormat; -import org.dromara.common.excel.convert.ExcelDictConvert; -import org.dromara.system.domain.SysTenantPackage; -import io.github.linpeilie.annotations.AutoMapper; -import lombok.Data; - -import java.io.Serial; -import java.io.Serializable; - - -/** - * 租户套餐视图对象 sys_tenant_package - * - * @author Michelle.Chung - */ -@Data -@ExcelIgnoreUnannotated -@AutoMapper(target = SysTenantPackage.class) -public class SysTenantPackageVo implements Serializable { - - @Serial - private static final long serialVersionUID = 1L; - - /** - * 租户套餐id - */ - @ExcelProperty(value = "租户套餐id") - private Long packageId; - - /** - * 套餐名称 - */ - @ExcelProperty(value = "套餐名称") - private String packageName; - - /** - * 关联菜单id - */ - @ExcelProperty(value = "关联菜单id") - private String menuIds; - - /** - * 备注 - */ - @ExcelProperty(value = "备注") - private String remark; - - /** - * 菜单树选择项是否关联显示 - */ - @ExcelProperty(value = "菜单树选择项是否关联显示") - private Boolean menuCheckStrictly; - - /** - * 状态(0正常 1停用) - */ - @ExcelProperty(value = "状态", converter = ExcelDictConvert.class) - @ExcelDictFormat(readConverterExp = "0=正常,1=停用") - private String status; - - -} diff --git a/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/domain/vo/SysTenantVo.java b/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/domain/vo/SysTenantVo.java deleted file mode 100644 index 021c66488..000000000 --- a/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/domain/vo/SysTenantVo.java +++ /dev/null @@ -1,115 +0,0 @@ -package org.dromara.system.domain.vo; - -import java.util.Date; -import cn.idev.excel.annotation.ExcelIgnoreUnannotated; -import cn.idev.excel.annotation.ExcelProperty; -import org.dromara.common.excel.annotation.ExcelDictFormat; -import org.dromara.common.excel.convert.ExcelDictConvert; -import org.dromara.system.domain.SysTenant; -import io.github.linpeilie.annotations.AutoMapper; -import lombok.Data; - -import java.io.Serial; -import java.io.Serializable; - - -/** - * 租户视图对象 sys_tenant - * - * @author Michelle.Chung - */ -@Data -@ExcelIgnoreUnannotated -@AutoMapper(target = SysTenant.class) -public class SysTenantVo implements Serializable { - - @Serial - private static final long serialVersionUID = 1L; - - /** - * id - */ - @ExcelProperty(value = "id") - private Long id; - - /** - * 租户编号 - */ - @ExcelProperty(value = "租户编号") - private String tenantId; - - /** - * 联系人 - */ - @ExcelProperty(value = "联系人") - private String contactUserName; - - /** - * 联系电话 - */ - @ExcelProperty(value = "联系电话") - private String contactPhone; - - /** - * 企业名称 - */ - @ExcelProperty(value = "企业名称") - private String companyName; - - /** - * 统一社会信用代码 - */ - @ExcelProperty(value = "统一社会信用代码") - private String licenseNumber; - - /** - * 地址 - */ - @ExcelProperty(value = "地址") - private String address; - - /** - * 域名 - */ - @ExcelProperty(value = "域名") - private String domain; - - /** - * 企业简介 - */ - @ExcelProperty(value = "企业简介") - private String intro; - - /** - * 备注 - */ - @ExcelProperty(value = "备注") - private String remark; - - /** - * 租户套餐编号 - */ - @ExcelProperty(value = "租户套餐编号") - private Long packageId; - - /** - * 过期时间 - */ - @ExcelProperty(value = "过期时间") - private Date expireTime; - - /** - * 用户数量(-1不限制) - */ - @ExcelProperty(value = "用户数量") - private Long accountCount; - - /** - * 租户状态(0正常 1停用) - */ - @ExcelProperty(value = "租户状态", converter = ExcelDictConvert.class) - @ExcelDictFormat(readConverterExp = "0=正常,1=停用") - private String status; - - -} diff --git a/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/domain/vo/SysUserVo.java b/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/domain/vo/SysUserVo.java index 755dcf81d..dcce871e3 100644 --- a/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/domain/vo/SysUserVo.java +++ b/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/domain/vo/SysUserVo.java @@ -33,11 +33,6 @@ public class SysUserVo implements Serializable { */ private Long userId; - /** - * 租户ID - */ - private String tenantId; - /** * 部门ID */ diff --git a/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/mapper/SysTenantMapper.java b/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/mapper/SysTenantMapper.java deleted file mode 100644 index 7e1167aa3..000000000 --- a/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/mapper/SysTenantMapper.java +++ /dev/null @@ -1,14 +0,0 @@ -package org.dromara.system.mapper; - -import org.dromara.system.domain.SysTenant; -import org.dromara.system.domain.vo.SysTenantVo; -import org.dromara.common.mybatis.core.mapper.BaseMapperPlus; - -/** - * 租户Mapper接口 - * - * @author Michelle.Chung - */ -public interface SysTenantMapper extends BaseMapperPlus { - -} diff --git a/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/mapper/SysTenantPackageMapper.java b/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/mapper/SysTenantPackageMapper.java deleted file mode 100644 index 10ca1700f..000000000 --- a/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/mapper/SysTenantPackageMapper.java +++ /dev/null @@ -1,14 +0,0 @@ -package org.dromara.system.mapper; - -import org.dromara.common.mybatis.core.mapper.BaseMapperPlus; -import org.dromara.system.domain.SysTenantPackage; -import org.dromara.system.domain.vo.SysTenantPackageVo; - -/** - * 租户套餐Mapper接口 - * - * @author Michelle.Chung - */ -public interface SysTenantPackageMapper extends BaseMapperPlus { - -} diff --git a/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/service/ISysConfigService.java b/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/service/ISysConfigService.java index a101643e8..baa5962df 100644 --- a/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/service/ISysConfigService.java +++ b/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/service/ISysConfigService.java @@ -41,10 +41,10 @@ public interface ISysConfigService { /** * 获取注册开关 - * @param tenantId 租户id + * * @return true开启,false关闭 */ - boolean selectRegisterEnabled(String tenantId); + boolean selectRegisterEnabled(); /** * 查询参数配置列表 diff --git a/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/service/ISysMenuService.java b/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/service/ISysMenuService.java index 8888c3c39..c092f6772 100644 --- a/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/service/ISysMenuService.java +++ b/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/service/ISysMenuService.java @@ -65,14 +65,6 @@ public interface ISysMenuService { */ List selectMenuListByRoleId(Long roleId); - /** - * 根据租户套餐ID查询菜单树信息 - * - * @param packageId 租户套餐ID - * @return 选中菜单列表 - */ - List selectMenuListByPackageId(Long packageId); - /** * 构建前端路由所需要的菜单 * diff --git a/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/service/ISysTenantPackageService.java b/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/service/ISysTenantPackageService.java deleted file mode 100644 index d060b68cd..000000000 --- a/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/service/ISysTenantPackageService.java +++ /dev/null @@ -1,62 +0,0 @@ -package org.dromara.system.service; - -import org.dromara.common.mybatis.core.page.PageQuery; -import org.dromara.common.mybatis.core.page.TableDataInfo; -import org.dromara.system.domain.bo.SysTenantPackageBo; -import org.dromara.system.domain.vo.SysTenantPackageVo; - -import java.util.Collection; -import java.util.List; - -/** - * 租户套餐Service接口 - * - * @author Michelle.Chung - */ -public interface ISysTenantPackageService { - - /** - * 查询租户套餐 - */ - SysTenantPackageVo queryById(Long packageId); - - /** - * 查询租户套餐列表 - */ - TableDataInfo queryPageList(SysTenantPackageBo bo, PageQuery pageQuery); - - /** - * 查询租户套餐已启用列表 - */ - List selectList(); - - /** - * 查询租户套餐列表 - */ - List queryList(SysTenantPackageBo bo); - - /** - * 新增租户套餐 - */ - Boolean insertByBo(SysTenantPackageBo bo); - - /** - * 修改租户套餐 - */ - Boolean updateByBo(SysTenantPackageBo bo); - - /** - * 校验套餐名称是否唯一 - */ - boolean checkPackageNameUnique(SysTenantPackageBo bo); - - /** - * 修改套餐状态 - */ - int updatePackageStatus(SysTenantPackageBo bo); - - /** - * 校验并批量删除租户套餐信息 - */ - Boolean deleteWithValidByIds(Collection ids, Boolean isValid); -} diff --git a/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/service/ISysTenantService.java b/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/service/ISysTenantService.java deleted file mode 100644 index 1c763e0ec..000000000 --- a/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/service/ISysTenantService.java +++ /dev/null @@ -1,92 +0,0 @@ -package org.dromara.system.service; - -import org.dromara.common.mybatis.core.page.PageQuery; -import org.dromara.common.mybatis.core.page.TableDataInfo; -import org.dromara.system.domain.bo.SysTenantBo; -import org.dromara.system.domain.vo.SysTenantVo; - -import java.util.Collection; -import java.util.List; - -/** - * 租户Service接口 - * - * @author Michelle.Chung - */ -public interface ISysTenantService { - - /** - * 查询租户 - */ - SysTenantVo queryById(Long id); - - /** - * 基于租户ID查询租户 - */ - SysTenantVo queryByTenantId(String tenantId); - - /** - * 查询租户列表 - */ - TableDataInfo queryPageList(SysTenantBo bo, PageQuery pageQuery); - - /** - * 查询租户列表 - */ - List queryList(SysTenantBo bo); - - /** - * 新增租户 - */ - Boolean insertByBo(SysTenantBo bo); - - /** - * 修改租户 - */ - Boolean updateByBo(SysTenantBo bo); - - /** - * 修改租户状态 - */ - int updateTenantStatus(SysTenantBo bo); - - /** - * 校验租户是否允许操作 - */ - void checkTenantAllowed(String tenantId); - - /** - * 校验并批量删除租户信息 - */ - Boolean deleteWithValidByIds(Collection ids, Boolean isValid); - - /** - * 校验企业名称是否唯一 - */ - boolean checkCompanyNameUnique(SysTenantBo bo); - - /** - * 校验账号余额 - */ - boolean checkAccountBalance(String tenantId); - - /** - * 校验有效期 - */ - boolean checkExpireTime(String tenantId); - - /** - * 同步租户套餐 - */ - Boolean syncTenantPackage(String tenantId, Long packageId); - - /** - * 同步租户字典 - */ - void syncTenantDict(); - - /** - * 同步租户参数配置 - */ - void syncTenantConfig(); -} diff --git a/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/service/ISysUserService.java b/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/service/ISysUserService.java index 9e255f992..ed6463619 100644 --- a/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/service/ISysUserService.java +++ b/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/service/ISysUserService.java @@ -152,7 +152,7 @@ public interface ISysUserService { * @param user 用户信息 * @return 结果 */ - boolean registerUser(SysUserBo user, String tenantId); + boolean registerUser(SysUserBo user); /** * 修改用户信息 diff --git a/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/service/impl/SysConfigServiceImpl.java b/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/service/impl/SysConfigServiceImpl.java index 6b0b2a27e..8ff90d51d 100644 --- a/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/service/impl/SysConfigServiceImpl.java +++ b/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/service/impl/SysConfigServiceImpl.java @@ -19,7 +19,6 @@ import org.dromara.common.json.utils.JsonUtils; import org.dromara.common.mybatis.core.page.PageQuery; import org.dromara.common.mybatis.core.page.TableDataInfo; import org.dromara.common.redis.utils.CacheUtils; -import org.dromara.common.tenant.helper.TenantHelper; import org.dromara.system.domain.SysConfig; import org.dromara.system.domain.bo.SysConfigBo; import org.dromara.system.domain.vo.SysConfigVo; @@ -85,15 +84,11 @@ public class SysConfigServiceImpl implements ISysConfigService, ConfigService { /** * 获取注册开关 * - * @param tenantId 租户id * @return true开启,false关闭 */ @Override - public boolean selectRegisterEnabled(String tenantId) { - String configValue = TenantHelper.dynamic(tenantId, () -> - this.selectConfigByKey("sys.account.registerUser") - ); - return Convert.toBool(configValue); + public boolean selectRegisterEnabled() { + return Convert.toBool(this.selectConfigByKey("sys.account.registerUser")); } /** diff --git a/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/service/impl/SysLogininforServiceImpl.java b/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/service/impl/SysLogininforServiceImpl.java index c388d9919..be04ccc5c 100644 --- a/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/service/impl/SysLogininforServiceImpl.java +++ b/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/service/impl/SysLogininforServiceImpl.java @@ -80,7 +80,6 @@ public class SysLogininforServiceImpl implements ISysLogininforService { String browser = userAgent.getBrowser().getName(); // 封装对象 SysLogininforBo logininfor = new SysLogininforBo(); - logininfor.setTenantId(logininforEvent.getTenantId()); logininfor.setUserName(logininforEvent.getUsername()); if (ObjectUtil.isNotNull(client)) { logininfor.setClientKey(client.getClientKey()); diff --git a/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/service/impl/SysMenuServiceImpl.java b/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/service/impl/SysMenuServiceImpl.java index 854c836d2..8bca14784 100644 --- a/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/service/impl/SysMenuServiceImpl.java +++ b/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/service/impl/SysMenuServiceImpl.java @@ -1,7 +1,6 @@ package org.dromara.system.service.impl; import cn.hutool.core.collection.CollUtil; -import cn.hutool.core.convert.Convert; import cn.hutool.core.lang.tree.Tree; import cn.hutool.core.util.ObjectUtil; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; @@ -17,7 +16,6 @@ import org.dromara.common.satoken.utils.LoginHelper; import org.dromara.system.domain.SysMenu; import org.dromara.system.domain.SysRole; import org.dromara.system.domain.SysRoleMenu; -import org.dromara.system.domain.SysTenantPackage; import org.dromara.system.domain.bo.SysMenuBo; import org.dromara.system.domain.vo.MetaVo; import org.dromara.system.domain.vo.RouterVo; @@ -25,7 +23,6 @@ import org.dromara.system.domain.vo.SysMenuVo; import org.dromara.system.mapper.SysMenuMapper; import org.dromara.system.mapper.SysRoleMapper; import org.dromara.system.mapper.SysRoleMenuMapper; -import org.dromara.system.mapper.SysTenantPackageMapper; import org.dromara.system.service.ISysMenuService; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; @@ -48,7 +45,6 @@ public class SysMenuServiceImpl implements ISysMenuService { private final SysMenuMapper baseMapper; private final SysRoleMapper roleMapper; private final SysRoleMenuMapper roleMenuMapper; - private final SysTenantPackageMapper tenantPackageMapper; /** * 根据用户查询系统菜单列表 @@ -144,35 +140,6 @@ public class SysMenuServiceImpl implements ISysMenuService { return baseMapper.selectMenuListByRoleId(roleId, role.getMenuCheckStrictly()); } - /** - * 根据租户套餐ID查询菜单树信息 - * - * @param packageId 租户套餐ID - * @return 选中菜单列表 - */ - @Override - public List selectMenuListByPackageId(Long packageId) { - SysTenantPackage tenantPackage = tenantPackageMapper.selectById(packageId); - List menuIds = StringUtils.splitTo(tenantPackage.getMenuIds(), Convert::toLong); - if (CollUtil.isEmpty(menuIds)) { - return List.of(); - } - List parentIds = null; - if (tenantPackage.getMenuCheckStrictly()) { - parentIds = baseMapper.selectObjs(new LambdaQueryWrapper() - .select(SysMenu::getParentId) - .in(SysMenu::getMenuId, menuIds), x -> { - return Convert.toLong(x); - }); - } - return baseMapper.selectObjs(new LambdaQueryWrapper() - .select(SysMenu::getMenuId) - .in(SysMenu::getMenuId, menuIds) - .notIn(CollUtil.isNotEmpty(parentIds), SysMenu::getMenuId, parentIds), x -> { - return Convert.toLong(x); - }); - } - /** * 构建前端路由所需要的菜单 * 路由name命名规则 path首字母转大写 + id diff --git a/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/service/impl/SysPermissionServiceImpl.java b/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/service/impl/SysPermissionServiceImpl.java index 4bf697420..4401c46c1 100644 --- a/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/service/impl/SysPermissionServiceImpl.java +++ b/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/service/impl/SysPermissionServiceImpl.java @@ -1,7 +1,7 @@ package org.dromara.system.service.impl; import lombok.RequiredArgsConstructor; -import org.dromara.common.core.constant.TenantConstants; +import org.dromara.common.core.constant.SystemConstants; import org.dromara.common.core.service.PermissionService; import org.dromara.common.satoken.utils.LoginHelper; import org.dromara.system.service.ISysMenuService; @@ -35,7 +35,7 @@ public class SysPermissionServiceImpl implements ISysPermissionService, Permissi Set roles = new HashSet<>(); // 管理员拥有所有权限 if (LoginHelper.isSuperAdmin(userId)) { - roles.add(TenantConstants.SUPER_ADMIN_ROLE_KEY); + roles.add(SystemConstants.SUPER_ADMIN_ROLE_KEY); } else { roles.addAll(roleService.selectRolePermissionByUserId(userId)); } diff --git a/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/service/impl/SysRoleServiceImpl.java b/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/service/impl/SysRoleServiceImpl.java index 53d270f0d..18d82fb71 100644 --- a/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/service/impl/SysRoleServiceImpl.java +++ b/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/service/impl/SysRoleServiceImpl.java @@ -13,7 +13,6 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import lombok.RequiredArgsConstructor; import org.dromara.common.core.constant.CacheNames; import org.dromara.common.core.constant.SystemConstants; -import org.dromara.common.core.constant.TenantConstants; import org.dromara.common.core.domain.model.LoginUser; import org.dromara.common.core.exception.ServiceException; import org.dromara.common.core.service.RoleService; @@ -224,7 +223,7 @@ public class SysRoleServiceImpl implements ISysRoleService, RoleService { if (ObjectUtil.isNotNull(role.getRoleId()) && LoginHelper.isSuperAdmin(role.getRoleId())) { throw new ServiceException("不允许操作超级管理员角色"); } - String[] keys = new String[]{TenantConstants.SUPER_ADMIN_ROLE_KEY, TenantConstants.TENANT_ADMIN_ROLE_KEY}; + String[] keys = new String[]{SystemConstants.SUPER_ADMIN_ROLE_KEY}; // 新增不允许使用 管理员标识符 if (ObjectUtil.isNull(role.getRoleId()) && StringUtils.equalsAny(role.getRoleKey(), keys)) { diff --git a/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/service/impl/SysSensitiveServiceImpl.java b/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/service/impl/SysSensitiveServiceImpl.java index 8a0d45ef3..77f05e28a 100644 --- a/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/service/impl/SysSensitiveServiceImpl.java +++ b/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/service/impl/SysSensitiveServiceImpl.java @@ -4,7 +4,6 @@ import cn.dev33.satoken.stp.StpUtil; import cn.hutool.core.util.ArrayUtil; import org.dromara.common.satoken.utils.LoginHelper; import org.dromara.common.sensitive.core.SensitiveService; -import org.dromara.common.tenant.helper.TenantHelper; import org.springframework.stereotype.Service; /** @@ -38,9 +37,6 @@ public class SysSensitiveServiceImpl implements SensitiveService { return false; } - if (TenantHelper.isEnable()) { - return !LoginHelper.isSuperAdmin() && !LoginHelper.isTenantAdmin(); - } return !LoginHelper.isSuperAdmin(); } diff --git a/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/service/impl/SysTenantPackageServiceImpl.java b/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/service/impl/SysTenantPackageServiceImpl.java deleted file mode 100644 index baefdf792..000000000 --- a/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/service/impl/SysTenantPackageServiceImpl.java +++ /dev/null @@ -1,149 +0,0 @@ -package org.dromara.system.service.impl; - -import cn.hutool.core.collection.CollUtil; -import cn.hutool.core.util.ObjectUtil; -import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; -import com.baomidou.mybatisplus.core.toolkit.Wrappers; -import com.baomidou.mybatisplus.extension.plugins.pagination.Page; -import lombok.RequiredArgsConstructor; -import org.dromara.common.core.constant.SystemConstants; -import org.dromara.common.core.exception.ServiceException; -import org.dromara.common.core.utils.MapstructUtils; -import org.dromara.common.core.utils.StringUtils; -import org.dromara.common.mybatis.core.page.PageQuery; -import org.dromara.common.mybatis.core.page.TableDataInfo; -import org.dromara.system.domain.SysTenant; -import org.dromara.system.domain.SysTenantPackage; -import org.dromara.system.domain.bo.SysTenantPackageBo; -import org.dromara.system.domain.vo.SysTenantPackageVo; -import org.dromara.system.mapper.SysTenantMapper; -import org.dromara.system.mapper.SysTenantPackageMapper; -import org.dromara.system.service.ISysTenantPackageService; -import org.springframework.stereotype.Service; -import org.springframework.transaction.annotation.Transactional; - -import java.util.Arrays; -import java.util.Collection; -import java.util.List; - -/** - * 租户套餐Service业务层处理 - * - * @author Michelle.Chung - */ -@RequiredArgsConstructor -@Service -public class SysTenantPackageServiceImpl implements ISysTenantPackageService { - - private final SysTenantPackageMapper baseMapper; - private final SysTenantMapper tenantMapper; - - /** - * 查询租户套餐 - */ - @Override - public SysTenantPackageVo queryById(Long packageId){ - return baseMapper.selectVoById(packageId); - } - - /** - * 查询租户套餐列表 - */ - @Override - public TableDataInfo queryPageList(SysTenantPackageBo bo, PageQuery pageQuery) { - LambdaQueryWrapper lqw = buildQueryWrapper(bo); - Page result = baseMapper.selectVoPage(pageQuery.build(), lqw); - return TableDataInfo.build(result); - } - - @Override - public List selectList() { - return baseMapper.selectVoList(new LambdaQueryWrapper() - .eq(SysTenantPackage::getStatus, SystemConstants.NORMAL)); - } - - /** - * 查询租户套餐列表 - */ - @Override - public List queryList(SysTenantPackageBo bo) { - LambdaQueryWrapper lqw = buildQueryWrapper(bo); - return baseMapper.selectVoList(lqw); - } - - private LambdaQueryWrapper buildQueryWrapper(SysTenantPackageBo bo) { - LambdaQueryWrapper lqw = Wrappers.lambdaQuery(); - lqw.like(StringUtils.isNotBlank(bo.getPackageName()), SysTenantPackage::getPackageName, bo.getPackageName()); - lqw.eq(StringUtils.isNotBlank(bo.getStatus()), SysTenantPackage::getStatus, bo.getStatus()); - lqw.orderByAsc(SysTenantPackage::getPackageId); - return lqw; - } - - /** - * 新增租户套餐 - */ - @Override - @Transactional(rollbackFor = Exception.class) - public Boolean insertByBo(SysTenantPackageBo bo) { - SysTenantPackage add = MapstructUtils.convert(bo, SysTenantPackage.class); - // 保存菜单id - List menuIds = Arrays.asList(bo.getMenuIds()); - add.setMenuIds(CollUtil.isNotEmpty(menuIds) ? StringUtils.joinComma(menuIds) : ""); - boolean flag = baseMapper.insert(add) > 0; - if (flag) { - bo.setPackageId(add.getPackageId()); - } - return flag; - } - - /** - * 修改租户套餐 - */ - @Override - @Transactional(rollbackFor = Exception.class) - public Boolean updateByBo(SysTenantPackageBo bo) { - SysTenantPackage update = MapstructUtils.convert(bo, SysTenantPackage.class); - // 保存菜单id - List menuIds = Arrays.asList(bo.getMenuIds()); - update.setMenuIds(CollUtil.isNotEmpty(menuIds) ? StringUtils.joinComma(menuIds) : ""); - return baseMapper.updateById(update) > 0; - } - - /** - * 校验套餐名称是否唯一 - */ - @Override - public boolean checkPackageNameUnique(SysTenantPackageBo bo) { - boolean exist = baseMapper.exists(new LambdaQueryWrapper() - .eq(SysTenantPackage::getPackageName, bo.getPackageName()) - .ne(ObjectUtil.isNotNull(bo.getPackageId()), SysTenantPackage::getPackageId, bo.getPackageId())); - return !exist; - } - - /** - * 修改套餐状态 - * - * @param bo 套餐信息 - * @return 结果 - */ - @Override - public int updatePackageStatus(SysTenantPackageBo bo) { - SysTenantPackage tenantPackage = MapstructUtils.convert(bo, SysTenantPackage.class); - return baseMapper.updateById(tenantPackage); - } - - /** - * 批量删除租户套餐 - */ - @Override - @Transactional(rollbackFor = Exception.class) - public Boolean deleteWithValidByIds(Collection ids, Boolean isValid) { - if(isValid){ - boolean exists = tenantMapper.exists(new LambdaQueryWrapper().in(SysTenant::getPackageId, ids)); - if (exists) { - throw new ServiceException("租户套餐已被使用"); - } - } - return baseMapper.deleteByIds(ids) > 0; - } -} diff --git a/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/service/impl/SysTenantServiceImpl.java b/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/service/impl/SysTenantServiceImpl.java deleted file mode 100644 index efbb040d5..000000000 --- a/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/service/impl/SysTenantServiceImpl.java +++ /dev/null @@ -1,567 +0,0 @@ -package org.dromara.system.service.impl; - -import cn.hutool.core.bean.BeanUtil; -import cn.hutool.core.collection.CollUtil; -import cn.hutool.core.convert.Convert; -import cn.hutool.core.util.ObjectUtil; -import cn.hutool.core.util.RandomUtil; -import cn.hutool.crypto.digest.BCrypt; -import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; -import com.baomidou.mybatisplus.core.toolkit.Wrappers; -import com.baomidou.mybatisplus.extension.plugins.pagination.Page; -import lombok.RequiredArgsConstructor; -import org.dromara.common.core.constant.CacheNames; -import org.dromara.common.core.constant.Constants; -import org.dromara.common.core.constant.SystemConstants; -import org.dromara.common.core.constant.TenantConstants; -import org.dromara.common.core.exception.ServiceException; -import org.dromara.common.core.service.WorkflowService; -import org.dromara.common.core.utils.MapstructUtils; -import org.dromara.common.core.utils.SpringUtils; -import org.dromara.common.core.utils.StreamUtils; -import org.dromara.common.core.utils.StringUtils; -import org.dromara.common.mybatis.core.page.PageQuery; -import org.dromara.common.mybatis.core.page.TableDataInfo; -import org.dromara.common.redis.utils.CacheUtils; -import org.dromara.common.tenant.core.TenantEntity; -import org.dromara.common.tenant.helper.TenantHelper; -import org.dromara.system.domain.*; -import org.dromara.system.domain.bo.SysTenantBo; -import org.dromara.system.domain.vo.SysTenantVo; -import org.dromara.system.mapper.*; -import org.dromara.system.service.ISysTenantService; -import org.springframework.cache.annotation.CacheEvict; -import org.springframework.cache.annotation.Cacheable; -import org.springframework.stereotype.Service; -import org.springframework.transaction.annotation.Transactional; - -import java.util.*; - -/** - * 租户Service业务层处理 - * - * @author Michelle.Chung - */ -@RequiredArgsConstructor -@Service -public class SysTenantServiceImpl implements ISysTenantService { - - private final SysTenantMapper baseMapper; - private final SysTenantPackageMapper tenantPackageMapper; - private final SysUserMapper userMapper; - private final SysDeptMapper deptMapper; - private final SysRoleMapper roleMapper; - private final SysRoleMenuMapper roleMenuMapper; - private final SysRoleDeptMapper roleDeptMapper; - private final SysUserRoleMapper userRoleMapper; - private final SysDictTypeMapper dictTypeMapper; - private final SysDictDataMapper dictDataMapper; - private final SysConfigMapper configMapper; - - /** - * 查询租户 - */ - @Override - public SysTenantVo queryById(Long id) { - return baseMapper.selectVoById(id); - } - - /** - * 基于租户ID查询租户 - */ - @Cacheable(cacheNames = CacheNames.SYS_TENANT, key = "#tenantId") - @Override - public SysTenantVo queryByTenantId(String tenantId) { - return baseMapper.selectVoOne(new LambdaQueryWrapper().eq(SysTenant::getTenantId, tenantId)); - } - - /** - * 查询租户列表 - */ - @Override - public TableDataInfo queryPageList(SysTenantBo bo, PageQuery pageQuery) { - LambdaQueryWrapper lqw = buildQueryWrapper(bo); - Page result = baseMapper.selectVoPage(pageQuery.build(), lqw); - return TableDataInfo.build(result); - } - - /** - * 查询租户列表 - */ - @Override - public List queryList(SysTenantBo bo) { - LambdaQueryWrapper lqw = buildQueryWrapper(bo); - return baseMapper.selectVoList(lqw); - } - - private LambdaQueryWrapper buildQueryWrapper(SysTenantBo bo) { - LambdaQueryWrapper lqw = Wrappers.lambdaQuery(); - lqw.eq(StringUtils.isNotBlank(bo.getTenantId()), SysTenant::getTenantId, bo.getTenantId()); - lqw.like(StringUtils.isNotBlank(bo.getContactUserName()), SysTenant::getContactUserName, bo.getContactUserName()); - lqw.eq(StringUtils.isNotBlank(bo.getContactPhone()), SysTenant::getContactPhone, bo.getContactPhone()); - lqw.like(StringUtils.isNotBlank(bo.getCompanyName()), SysTenant::getCompanyName, bo.getCompanyName()); - lqw.eq(StringUtils.isNotBlank(bo.getLicenseNumber()), SysTenant::getLicenseNumber, bo.getLicenseNumber()); - lqw.eq(StringUtils.isNotBlank(bo.getAddress()), SysTenant::getAddress, bo.getAddress()); - lqw.eq(StringUtils.isNotBlank(bo.getIntro()), SysTenant::getIntro, bo.getIntro()); - lqw.like(StringUtils.isNotBlank(bo.getDomain()), SysTenant::getDomain, bo.getDomain()); - lqw.eq(bo.getPackageId() != null, SysTenant::getPackageId, bo.getPackageId()); - lqw.eq(bo.getExpireTime() != null, SysTenant::getExpireTime, bo.getExpireTime()); - lqw.eq(bo.getAccountCount() != null, SysTenant::getAccountCount, bo.getAccountCount()); - lqw.eq(StringUtils.isNotBlank(bo.getStatus()), SysTenant::getStatus, bo.getStatus()); - lqw.orderByAsc(SysTenant::getId); - return lqw; - } - - /** - * 新增租户 - */ - @Override - @Transactional(rollbackFor = Exception.class) - public Boolean insertByBo(SysTenantBo bo) { - SysTenant add = MapstructUtils.convert(bo, SysTenant.class); - - // 获取所有租户编号 - List tenantIds = baseMapper.selectObjs( - new LambdaQueryWrapper().select(SysTenant::getTenantId), x -> { - return Convert.toStr(x); - }); - String tenantId = generateTenantId(tenantIds); - add.setTenantId(tenantId); - boolean flag = baseMapper.insert(add) > 0; - if (!flag) { - throw new ServiceException("创建租户失败"); - } - bo.setId(add.getId()); - - // 根据套餐创建角色 - Long roleId = createTenantRole(tenantId, bo.getPackageId()); - - // 创建部门: 公司名是部门名称 - SysDept dept = new SysDept(); - dept.setTenantId(tenantId); - dept.setDeptName(bo.getCompanyName()); - dept.setParentId(Constants.TOP_PARENT_ID); - dept.setAncestors(Constants.TOP_PARENT_ID.toString()); - deptMapper.insert(dept); - Long deptId = dept.getDeptId(); - - // 角色和部门关联表 - SysRoleDept roleDept = new SysRoleDept(); - roleDept.setRoleId(roleId); - roleDept.setDeptId(deptId); - roleDeptMapper.insert(roleDept); - - // 创建系统用户 - SysUser user = new SysUser(); - user.setTenantId(tenantId); - user.setUserName(bo.getUsername()); - user.setNickName(bo.getUsername()); - user.setPassword(BCrypt.hashpw(bo.getPassword())); - user.setDeptId(deptId); - userMapper.insert(user); - //新增系统用户后,默认当前用户为部门的负责人 - SysDept sd = new SysDept(); - sd.setLeader(user.getUserId()); - sd.setDeptId(deptId); - deptMapper.updateById(sd); - - // 用户和角色关联表 - SysUserRole userRole = new SysUserRole(); - userRole.setUserId(user.getUserId()); - userRole.setRoleId(roleId); - userRoleMapper.insert(userRole); - - String defaultTenantId = TenantConstants.DEFAULT_TENANT_ID; - List dictTypeList = dictTypeMapper.selectList( - new LambdaQueryWrapper().eq(SysDictType::getTenantId, defaultTenantId)); - List dictDataList = dictDataMapper.selectList( - new LambdaQueryWrapper().eq(SysDictData::getTenantId, defaultTenantId)); - for (SysDictType dictType : dictTypeList) { - dictType.setDictId(null); - dictType.setTenantId(tenantId); - dictType.setCreateDept(null); - dictType.setCreateBy(null); - dictType.setCreateTime(null); - dictType.setUpdateBy(null); - dictType.setUpdateTime(null); - } - for (SysDictData dictData : dictDataList) { - dictData.setDictCode(null); - dictData.setTenantId(tenantId); - dictData.setCreateDept(null); - dictData.setCreateBy(null); - dictData.setCreateTime(null); - dictData.setUpdateBy(null); - dictData.setUpdateTime(null); - } - dictTypeMapper.insertBatch(dictTypeList); - dictDataMapper.insertBatch(dictDataList); - - List sysConfigList = configMapper.selectList( - new LambdaQueryWrapper().eq(SysConfig::getTenantId, defaultTenantId)); - for (SysConfig config : sysConfigList) { - config.setConfigId(null); - config.setTenantId(tenantId); - config.setCreateDept(null); - config.setCreateBy(null); - config.setCreateTime(null); - config.setUpdateBy(null); - config.setUpdateTime(null); - } - configMapper.insertBatch(sysConfigList); - - // 未开启工作流不执行下方操作 - if (SpringUtils.getProperty("warm-flow.enabled", Boolean.class, false)) { - WorkflowService workflowService = SpringUtils.getBean(WorkflowService.class); - // 新增租户流程定义 - workflowService.syncDef(tenantId); - } - return true; - } - - /** - * 生成租户id - * - * @param tenantIds 已有租户id列表 - * @return 租户id - */ - private String generateTenantId(List tenantIds) { - // 随机生成6位 - String numbers = RandomUtil.randomNumbers(6); - // 判断是否存在,如果存在则重新生成 - if (tenantIds.contains(numbers)) { - return generateTenantId(tenantIds); - } - return numbers; - } - - /** - * 根据租户菜单创建租户角色 - * - * @param tenantId 租户编号 - * @param packageId 租户套餐id - * @return 角色id - */ - private Long createTenantRole(String tenantId, Long packageId) { - // 获取租户套餐 - SysTenantPackage tenantPackage = tenantPackageMapper.selectById(packageId); - if (ObjectUtil.isNull(tenantPackage)) { - throw new ServiceException("套餐不存在"); - } - // 获取套餐菜单id - List menuIds = StringUtils.splitTo(tenantPackage.getMenuIds(), Convert::toLong); - - // 创建角色 - SysRole role = new SysRole(); - role.setTenantId(tenantId); - role.setRoleName(TenantConstants.TENANT_ADMIN_ROLE_NAME); - role.setRoleKey(TenantConstants.TENANT_ADMIN_ROLE_KEY); - role.setRoleSort(1); - role.setStatus(SystemConstants.NORMAL); - roleMapper.insert(role); - Long roleId = role.getRoleId(); - - // 创建角色菜单 - List roleMenus = new ArrayList<>(menuIds.size()); - menuIds.forEach(menuId -> { - SysRoleMenu roleMenu = new SysRoleMenu(); - roleMenu.setRoleId(roleId); - roleMenu.setMenuId(menuId); - roleMenus.add(roleMenu); - }); - roleMenuMapper.insertBatch(roleMenus); - - return roleId; - } - - /** - * 修改租户 - */ - @CacheEvict(cacheNames = CacheNames.SYS_TENANT, key = "#bo.tenantId") - @Override - public Boolean updateByBo(SysTenantBo bo) { - SysTenant tenant = MapstructUtils.convert(bo, SysTenant.class); - tenant.setTenantId(null); - tenant.setPackageId(null); - return baseMapper.updateById(tenant) > 0; - } - - /** - * 修改租户状态 - * - * @param bo 租户信息 - * @return 结果 - */ - @CacheEvict(cacheNames = CacheNames.SYS_TENANT, key = "#bo.tenantId") - @Override - public int updateTenantStatus(SysTenantBo bo) { - SysTenant tenant = new SysTenant(); - tenant.setId(bo.getId()); - tenant.setStatus(bo.getStatus()); - return baseMapper.updateById(tenant); - } - - /** - * 校验租户是否允许操作 - * - * @param tenantId 租户ID - */ - @Override - public void checkTenantAllowed(String tenantId) { - if (ObjectUtil.isNotNull(tenantId) && TenantConstants.DEFAULT_TENANT_ID.equals(tenantId)) { - throw new ServiceException("不允许操作管理租户"); - } - } - - /** - * 批量删除租户 - */ - @CacheEvict(cacheNames = CacheNames.SYS_TENANT, allEntries = true) - @Override - public Boolean deleteWithValidByIds(Collection ids, Boolean isValid) { - if (isValid) { - // 做一些业务上的校验,判断是否需要校验 - if (ids.contains(TenantConstants.SUPER_ADMIN_ID)) { - throw new ServiceException("超管租户不能删除"); - } - } - return baseMapper.deleteByIds(ids) > 0; - } - - /** - * 校验企业名称是否唯一 - */ - @Override - public boolean checkCompanyNameUnique(SysTenantBo bo) { - boolean exist = baseMapper.exists(new LambdaQueryWrapper() - .eq(SysTenant::getCompanyName, bo.getCompanyName()) - .ne(ObjectUtil.isNotNull(bo.getTenantId()), SysTenant::getTenantId, bo.getTenantId())); - return !exist; - } - - /** - * 校验账号余额 - */ - @Override - public boolean checkAccountBalance(String tenantId) { - SysTenantVo tenant = SpringUtils.getAopProxy(this).queryByTenantId(tenantId); - // 如果余额为-1代表不限制 - if (tenant.getAccountCount() == -1) { - return true; - } - Long userNumber = userMapper.selectCount(new LambdaQueryWrapper<>()); - // 如果余额大于0代表还有可用名额 - return tenant.getAccountCount() - userNumber > 0; - } - - /** - * 校验有效期 - */ - @Override - public boolean checkExpireTime(String tenantId) { - SysTenantVo tenant = SpringUtils.getAopProxy(this).queryByTenantId(tenantId); - // 如果未设置过期时间代表不限制 - if (ObjectUtil.isNull(tenant.getExpireTime())) { - return true; - } - // 如果当前时间在过期时间之前则通过 - return new Date().before(tenant.getExpireTime()); - } - - /** - * 同步租户套餐 - */ - @Override - @Transactional(rollbackFor = Exception.class) - public Boolean syncTenantPackage(String tenantId, Long packageId) { - SysTenantPackage tenantPackage = tenantPackageMapper.selectById(packageId); - List roles = roleMapper.selectList( - new LambdaQueryWrapper().eq(SysRole::getTenantId, tenantId)); - List roleIds = new ArrayList<>(roles.size() - 1); - List menuIds = StringUtils.splitTo(tenantPackage.getMenuIds(), Convert::toLong); - roles.forEach(item -> { - if (TenantConstants.TENANT_ADMIN_ROLE_KEY.equals(item.getRoleKey())) { - List roleMenus = new ArrayList<>(menuIds.size()); - menuIds.forEach(menuId -> { - SysRoleMenu roleMenu = new SysRoleMenu(); - roleMenu.setRoleId(item.getRoleId()); - roleMenu.setMenuId(menuId); - roleMenus.add(roleMenu); - }); - roleMenuMapper.delete(new LambdaQueryWrapper().eq(SysRoleMenu::getRoleId, item.getRoleId())); - roleMenuMapper.insertBatch(roleMenus); - } else { - roleIds.add(item.getRoleId()); - } - }); - if (!roleIds.isEmpty()) { - roleMenuMapper.delete( - new LambdaQueryWrapper().in(SysRoleMenu::getRoleId, roleIds).notIn(!menuIds.isEmpty(), SysRoleMenu::getMenuId, menuIds)); - } - return true; - } - - /** - * 同步租户字典 - */ - @Transactional(rollbackFor = Exception.class) - @Override - public void syncTenantDict() { - // 查询超管 所有字典数据 - List dictTypeList = new ArrayList<>(); - List dictDataList = new ArrayList<>(); - TenantHelper.ignore(() -> { - dictTypeList.addAll(dictTypeMapper.selectList()); - dictDataList.addAll(dictDataMapper.selectList()); - }); - // 所有租户字典类型 - Map> dictTypeMap = StreamUtils.groupByKey(dictTypeList, TenantEntity::getTenantId); - // 所有租户字典数据 - Map>> dictDataMap = StreamUtils.groupBy2Key(dictDataList, TenantEntity::getTenantId, SysDictData::getDictType); - - // 默认租户字典类型列表 - List defaultDictTypeList = dictTypeMap.get(TenantConstants.DEFAULT_TENANT_ID); - // 默认租户字典数据 - Map> defaultDictDataMap = dictDataMap.get(TenantConstants.DEFAULT_TENANT_ID); - - // 获取所有租户编号 - List tenantIds = baseMapper.selectObjs( - new LambdaQueryWrapper().select(SysTenant::getTenantId) - .eq(SysTenant::getStatus, SystemConstants.NORMAL), x -> { - return Convert.toStr(x); - }); - // 待入库的字典类型和字典数据 - List saveTypeList = new ArrayList<>(); - List saveDataList = new ArrayList<>(); - // 待同步的租户编号(用于清除对于租户的字典缓存) - Set syncTenantIds = new HashSet<>(); - // 循环所有租户,处理需要同步的数据 - for (String tenantId : tenantIds) { - // 排除默认租户 - if (TenantConstants.DEFAULT_TENANT_ID.equals(tenantId)) { - continue; - } - // 根据默认租户的字典类型进行数据同步 - for (SysDictType dictType : defaultDictTypeList) { - // 获取当前租户的字典类型列表 - List typeList = StreamUtils.toList(dictTypeMap.get(tenantId), SysDictType::getDictType); - // 根据字典类型获取默认租户的字典数据 - List defaultDictDataList = defaultDictDataMap.get(dictType.getDictType()); - // 排除不需要同步的字典数据 - Set excludeDictDataSet = CollUtil.newHashSet(); - // 处理 存在type不存在data 的情况 - if (typeList.contains(dictType.getDictType())) { - // 获取租户字典数据 - Optional.ofNullable(dictDataMap.get(tenantId)) - // 获取租户当前字典类型的字典数据 - .map(tenantDictDataMap -> tenantDictDataMap.get(dictType.getDictType())) - // 保存字典数据项的字典键值,用于判断数据是否需要同步 - .map(data -> StreamUtils.toSet(data, SysDictData::getDictValue)) - // 添加到排除集合中 - .ifPresent(excludeDictDataSet::addAll); - } else { - // 同步字典类型 - SysDictType type = BeanUtil.toBean(dictType, SysDictType.class); - type.setDictId(null); - type.setTenantId(tenantId); - type.setCreateTime(null); - type.setUpdateTime(null); - syncTenantIds.add(tenantId); - saveTypeList.add(type); - } - - // 默认租户字典数据不为空再去处理 - if (CollUtil.isNotEmpty(defaultDictDataList)) { - // 提前优化排除判断if条件语句,对于 && 并联条件,该优化可以避免不必要的 excludeDictDataSet.contains() 函数调用 - boolean isExclude = CollUtil.isNotEmpty(excludeDictDataSet); - // 筛选出 dictType 对应的 data - for (SysDictData dictData : defaultDictDataList) { - // 排除不需要同步的字典数据 - if (isExclude && excludeDictDataSet.contains(dictData.getDictValue())) { - continue; - } - SysDictData data = BeanUtil.toBean(dictData, SysDictData.class); - // 设置字典编码为 null - data.setDictCode(null); - data.setTenantId(tenantId); - data.setCreateTime(null); - data.setUpdateTime(null); - data.setCreateDept(null); - data.setCreateBy(null); - data.setUpdateBy(null); - syncTenantIds.add(tenantId); - saveDataList.add(data); - } - } - } - } - TenantHelper.ignore(() -> { - if (CollUtil.isNotEmpty(saveTypeList)) { - dictTypeMapper.insertBatch(saveTypeList); - } - if (CollUtil.isNotEmpty(saveDataList)) { - dictDataMapper.insertBatch(saveDataList); - } - }); - for (String tenantId : syncTenantIds) { - TenantHelper.dynamic(tenantId, () -> CacheUtils.clear(CacheNames.SYS_DICT)); - } - } - - /** - * 同步租户参数配置 - */ - @Transactional(rollbackFor = Exception.class) - @Override - public void syncTenantConfig() { - // 查询超管 所有参数配置 - List configList = TenantHelper.ignore(() -> configMapper.selectList()); - - // 所有租户参数配置 - Map> configMap = StreamUtils.groupByKey(configList, TenantEntity::getTenantId); - - // 默认租户字典类型列表 - List defaultConfigList = configMap.get(TenantConstants.DEFAULT_TENANT_ID); - - // 获取所有租户编号 - List tenantIds = baseMapper.selectObjs( - new LambdaQueryWrapper().select(SysTenant::getTenantId) - .eq(SysTenant::getStatus, SystemConstants.NORMAL), x -> { - return Convert.toStr(x); - }); - // 待入库的字典类型和字典数据 - List saveConfigList = new ArrayList<>(); - // 待同步的租户编号(用于清除对于租户的字典缓存) - Set syncTenantIds = new HashSet<>(); - // 循环所有租户,处理需要同步的数据 - for (String tenantId : tenantIds) { - // 排除默认租户 - if (TenantConstants.DEFAULT_TENANT_ID.equals(tenantId)) { - continue; - } - // 根据默认租户的字典类型进行数据同步 - for (SysConfig config : defaultConfigList) { - // 获取当前租户的字典类型列表 - List typeList = StreamUtils.toList(configMap.get(tenantId), SysConfig::getConfigKey); - if (!typeList.contains(config.getConfigKey())) { - SysConfig type = BeanUtil.toBean(config, SysConfig.class); - type.setConfigId(null); - type.setTenantId(tenantId); - type.setCreateTime(null); - type.setUpdateTime(null); - syncTenantIds.add(tenantId); - saveConfigList.add(type); - } - } - } - TenantHelper.ignore(() -> { - if (CollUtil.isNotEmpty(saveConfigList)) { - configMapper.insertBatch(saveConfigList); - } - }); - for (String tenantId : syncTenantIds) { - TenantHelper.dynamic(tenantId, () -> CacheUtils.clear(CacheNames.SYS_CONFIG)); - } - } - -} diff --git a/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/service/impl/SysUserServiceImpl.java b/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/service/impl/SysUserServiceImpl.java index 39ad4cb91..466d41d39 100644 --- a/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/service/impl/SysUserServiceImpl.java +++ b/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/service/impl/SysUserServiceImpl.java @@ -328,11 +328,10 @@ public class SysUserServiceImpl implements ISysUserService, UserService { * @return 结果 */ @Override - public boolean registerUser(SysUserBo user, String tenantId) { + public boolean registerUser(SysUserBo user) { user.setCreateBy(0L); user.setUpdateBy(0L); SysUser sysUser = MapstructUtils.convert(user, SysUser.class); - sysUser.setTenantId(tenantId); return baseMapper.insert(sysUser) > 0; } diff --git a/ruoyi-modules/ruoyi-system/src/main/resources/mapper/system/SysTenantMapper.xml b/ruoyi-modules/ruoyi-system/src/main/resources/mapper/system/SysTenantMapper.xml deleted file mode 100644 index 0d96e134d..000000000 --- a/ruoyi-modules/ruoyi-system/src/main/resources/mapper/system/SysTenantMapper.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - - - diff --git a/ruoyi-modules/ruoyi-system/src/main/resources/mapper/system/SysTenantPackageMapper.xml b/ruoyi-modules/ruoyi-system/src/main/resources/mapper/system/SysTenantPackageMapper.xml deleted file mode 100644 index 79cf4c56b..000000000 --- a/ruoyi-modules/ruoyi-system/src/main/resources/mapper/system/SysTenantPackageMapper.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - - - diff --git a/ruoyi-modules/ruoyi-workflow/pom.xml b/ruoyi-modules/ruoyi-workflow/pom.xml index d195fafa3..7b4b8c7b6 100644 --- a/ruoyi-modules/ruoyi-workflow/pom.xml +++ b/ruoyi-modules/ruoyi-workflow/pom.xml @@ -62,10 +62,6 @@ org.dromara ruoyi-common-translation - - org.dromara - ruoyi-common-tenant - org.dromara ruoyi-common-security diff --git a/ruoyi-modules/ruoyi-workflow/src/main/java/org/dromara/workflow/domain/FlowCategory.java b/ruoyi-modules/ruoyi-workflow/src/main/java/org/dromara/workflow/domain/FlowCategory.java index 28918f1d9..5247efee9 100644 --- a/ruoyi-modules/ruoyi-workflow/src/main/java/org/dromara/workflow/domain/FlowCategory.java +++ b/ruoyi-modules/ruoyi-workflow/src/main/java/org/dromara/workflow/domain/FlowCategory.java @@ -6,7 +6,7 @@ import com.baomidou.mybatisplus.annotation.TableLogic; import com.baomidou.mybatisplus.annotation.TableName; import lombok.Data; import lombok.EqualsAndHashCode; -import org.dromara.common.tenant.core.TenantEntity; +import org.dromara.common.mybatis.core.domain.BaseEntity; import java.io.Serial; import java.util.ArrayList; @@ -21,7 +21,7 @@ import java.util.List; @Data @EqualsAndHashCode(callSuper = true) @TableName("flow_category") -public class FlowCategory extends TenantEntity { +public class FlowCategory extends BaseEntity { @Serial private static final long serialVersionUID = 1L; diff --git a/ruoyi-modules/ruoyi-workflow/src/main/java/org/dromara/workflow/domain/FlowInstanceBizExt.java b/ruoyi-modules/ruoyi-workflow/src/main/java/org/dromara/workflow/domain/FlowInstanceBizExt.java index 932b0380e..fc62210c2 100644 --- a/ruoyi-modules/ruoyi-workflow/src/main/java/org/dromara/workflow/domain/FlowInstanceBizExt.java +++ b/ruoyi-modules/ruoyi-workflow/src/main/java/org/dromara/workflow/domain/FlowInstanceBizExt.java @@ -5,7 +5,7 @@ import com.baomidou.mybatisplus.annotation.TableLogic; import com.baomidou.mybatisplus.annotation.TableName; import lombok.Data; import lombok.EqualsAndHashCode; -import org.dromara.common.tenant.core.TenantEntity; +import org.dromara.common.mybatis.core.domain.BaseEntity; import java.io.Serial; @@ -18,7 +18,7 @@ import java.io.Serial; @Data @EqualsAndHashCode(callSuper = true) @TableName("flow_instance_biz_ext") -public class FlowInstanceBizExt extends TenantEntity { +public class FlowInstanceBizExt extends BaseEntity { @Serial private static final long serialVersionUID = 1L; diff --git a/ruoyi-modules/ruoyi-workflow/src/main/java/org/dromara/workflow/domain/vo/FlowDefinitionVo.java b/ruoyi-modules/ruoyi-workflow/src/main/java/org/dromara/workflow/domain/vo/FlowDefinitionVo.java index aef75739a..210f1de22 100644 --- a/ruoyi-modules/ruoyi-workflow/src/main/java/org/dromara/workflow/domain/vo/FlowDefinitionVo.java +++ b/ruoyi-modules/ruoyi-workflow/src/main/java/org/dromara/workflow/domain/vo/FlowDefinitionVo.java @@ -31,11 +31,6 @@ public class FlowDefinitionVo implements Serializable { */ private Date updateTime; - /** - * 租户ID - */ - private String tenantId; - /** * 删除标记 */ diff --git a/ruoyi-modules/ruoyi-workflow/src/main/java/org/dromara/workflow/domain/vo/FlowHisTaskVo.java b/ruoyi-modules/ruoyi-workflow/src/main/java/org/dromara/workflow/domain/vo/FlowHisTaskVo.java index a9f6a60f4..1bc084503 100644 --- a/ruoyi-modules/ruoyi-workflow/src/main/java/org/dromara/workflow/domain/vo/FlowHisTaskVo.java +++ b/ruoyi-modules/ruoyi-workflow/src/main/java/org/dromara/workflow/domain/vo/FlowHisTaskVo.java @@ -35,11 +35,6 @@ public class FlowHisTaskVo implements Serializable { */ private Date updateTime; - /** - * 租户ID - */ - private String tenantId; - /** * 删除标记 */ diff --git a/ruoyi-modules/ruoyi-workflow/src/main/java/org/dromara/workflow/domain/vo/FlowInstanceVo.java b/ruoyi-modules/ruoyi-workflow/src/main/java/org/dromara/workflow/domain/vo/FlowInstanceVo.java index b03f73b13..7a7a3e346 100644 --- a/ruoyi-modules/ruoyi-workflow/src/main/java/org/dromara/workflow/domain/vo/FlowInstanceVo.java +++ b/ruoyi-modules/ruoyi-workflow/src/main/java/org/dromara/workflow/domain/vo/FlowInstanceVo.java @@ -27,11 +27,6 @@ public class FlowInstanceVo { */ private Date updateTime; - /** - * 租户ID - */ - private String tenantId; - /** * 删除标记 */ diff --git a/ruoyi-modules/ruoyi-workflow/src/main/java/org/dromara/workflow/domain/vo/FlowTaskVo.java b/ruoyi-modules/ruoyi-workflow/src/main/java/org/dromara/workflow/domain/vo/FlowTaskVo.java index ffe804912..e26a63c1b 100644 --- a/ruoyi-modules/ruoyi-workflow/src/main/java/org/dromara/workflow/domain/vo/FlowTaskVo.java +++ b/ruoyi-modules/ruoyi-workflow/src/main/java/org/dromara/workflow/domain/vo/FlowTaskVo.java @@ -36,11 +36,6 @@ public class FlowTaskVo implements Serializable { */ private Date updateTime; - /** - * 租户ID - */ - private String tenantId; - /** * 删除标记 */ diff --git a/ruoyi-modules/ruoyi-workflow/src/main/java/org/dromara/workflow/handler/FlowProcessEventHandler.java b/ruoyi-modules/ruoyi-workflow/src/main/java/org/dromara/workflow/handler/FlowProcessEventHandler.java index 1965f67e8..71920aee0 100644 --- a/ruoyi-modules/ruoyi-workflow/src/main/java/org/dromara/workflow/handler/FlowProcessEventHandler.java +++ b/ruoyi-modules/ruoyi-workflow/src/main/java/org/dromara/workflow/handler/FlowProcessEventHandler.java @@ -1,11 +1,10 @@ package org.dromara.workflow.handler; import lombok.extern.slf4j.Slf4j; -import org.dromara.common.core.domain.event.ProcessTaskEvent; import org.dromara.common.core.domain.event.ProcessDeleteEvent; import org.dromara.common.core.domain.event.ProcessEvent; +import org.dromara.common.core.domain.event.ProcessTaskEvent; import org.dromara.common.core.utils.SpringUtils; -import org.dromara.common.tenant.helper.TenantHelper; import org.dromara.warm.flow.core.entity.Instance; import org.dromara.warm.flow.core.entity.Task; import org.dromara.workflow.common.ConditionalOnEnable; @@ -34,11 +33,9 @@ public class FlowProcessEventHandler { * @param submit 当为true时为申请人节点办理 */ public void processHandler(String flowCode, Instance instance, String status, Map params, boolean submit) { - String tenantId = TenantHelper.getTenantId(); - log.info("【流程事件发布】租户ID: {}, 流程编码: {}, 业务ID: {}, 流程状态: {}, 节点类型: {}, 节点编码: {}, 节点名称: {}, 是否申请人节点: {}, 参数: {}", - tenantId, flowCode, instance.getBusinessId(), status, instance.getNodeType(), instance.getNodeCode(), instance.getNodeName(), submit, params); + log.info("【流程事件发布】流程编码: {}, 业务ID: {}, 流程状态: {}, 节点类型: {}, 节点编码: {}, 节点名称: {}, 是否申请人节点: {}, 参数: {}", + flowCode, instance.getBusinessId(), status, instance.getNodeType(), instance.getNodeCode(), instance.getNodeName(), submit, params); ProcessEvent processEvent = new ProcessEvent(); - processEvent.setTenantId(tenantId); processEvent.setFlowCode(flowCode); processEvent.setInstanceId(instance.getId()); processEvent.setBusinessId(instance.getBusinessId()); @@ -60,11 +57,9 @@ public class FlowProcessEventHandler { * @param params 上一个任务的办理参数 */ public void processTaskHandler(String flowCode, Instance instance, Task nextTask, Map params) { - String tenantId = TenantHelper.getTenantId(); - log.info("【流程任务事件发布】租户ID: {}, 流程编码: {}, 业务ID: {}, 节点类型: {}, 节点编码: {}, 节点名称: {}, 任务ID: {}", - tenantId, flowCode, instance.getBusinessId(), nextTask.getNodeType(), nextTask.getNodeCode(), nextTask.getNodeName(), nextTask.getId()); + log.info("【流程任务事件发布】流程编码: {}, 业务ID: {}, 节点类型: {}, 节点编码: {}, 节点名称: {}, 任务ID: {}", + flowCode, instance.getBusinessId(), nextTask.getNodeType(), nextTask.getNodeCode(), nextTask.getNodeName(), nextTask.getId()); ProcessTaskEvent processTaskEvent = new ProcessTaskEvent(); - processTaskEvent.setTenantId(tenantId); processTaskEvent.setFlowCode(flowCode); processTaskEvent.setInstanceId(instance.getId()); processTaskEvent.setBusinessId(instance.getBusinessId()); @@ -84,10 +79,8 @@ public class FlowProcessEventHandler { * @param businessId 业务ID */ public void processDeleteHandler(String flowCode, String businessId) { - String tenantId = TenantHelper.getTenantId(); - log.info("【流程删除事件发布】租户ID: {}, 流程编码: {}, 业务ID: {}", tenantId, flowCode, businessId); + log.info("【流程删除事件发布】流程编码: {}, 业务ID: {}", flowCode, businessId); ProcessDeleteEvent processDeleteEvent = new ProcessDeleteEvent(); - processDeleteEvent.setTenantId(tenantId); processDeleteEvent.setFlowCode(flowCode); processDeleteEvent.setBusinessId(businessId); SpringUtils.context().publishEvent(processDeleteEvent); diff --git a/ruoyi-modules/ruoyi-workflow/src/main/java/org/dromara/workflow/service/IFlwDefinitionService.java b/ruoyi-modules/ruoyi-workflow/src/main/java/org/dromara/workflow/service/IFlwDefinitionService.java index 54743b72b..a2d611099 100644 --- a/ruoyi-modules/ruoyi-workflow/src/main/java/org/dromara/workflow/service/IFlwDefinitionService.java +++ b/ruoyi-modules/ruoyi-workflow/src/main/java/org/dromara/workflow/service/IFlwDefinitionService.java @@ -69,10 +69,4 @@ public interface IFlwDefinitionService { */ boolean removeDef(List ids); - /** - * 新增租户流程定义 - * - * @param tenantId 租户id - */ - void syncDef(String tenantId); } diff --git a/ruoyi-modules/ruoyi-workflow/src/main/java/org/dromara/workflow/service/impl/FlwDefinitionServiceImpl.java b/ruoyi-modules/ruoyi-workflow/src/main/java/org/dromara/workflow/service/impl/FlwDefinitionServiceImpl.java index 1cc61fee4..995eea42c 100644 --- a/ruoyi-modules/ruoyi-workflow/src/main/java/org/dromara/workflow/service/impl/FlwDefinitionServiceImpl.java +++ b/ruoyi-modules/ruoyi-workflow/src/main/java/org/dromara/workflow/service/impl/FlwDefinitionServiceImpl.java @@ -23,14 +23,11 @@ import org.dromara.warm.flow.core.service.DefService; import org.dromara.warm.flow.orm.entity.FlowDefinition; import org.dromara.warm.flow.orm.entity.FlowHisTask; import org.dromara.warm.flow.orm.entity.FlowNode; -import org.dromara.warm.flow.orm.entity.FlowSkip; import org.dromara.warm.flow.orm.mapper.FlowDefinitionMapper; import org.dromara.warm.flow.orm.mapper.FlowHisTaskMapper; import org.dromara.warm.flow.orm.mapper.FlowNodeMapper; import org.dromara.warm.flow.orm.mapper.FlowSkipMapper; import org.dromara.workflow.common.ConditionalOnEnable; -import org.dromara.workflow.common.constant.FlowConstant; -import org.dromara.workflow.domain.FlowCategory; import org.dromara.workflow.domain.vo.FlowDefinitionVo; import org.dromara.workflow.mapper.FlwCategoryMapper; import org.dromara.workflow.service.IFlwCommonService; @@ -45,8 +42,6 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.List; -import static org.dromara.common.core.constant.TenantConstants.DEFAULT_TENANT_ID; - /** * 流程定义 服务层实现 * @@ -200,71 +195,4 @@ public class FlwDefinitionServiceImpl implements IFlwDefinitionService { return true; } - /** - * 新增租户流程定义 - * - * @param tenantId 租户id - */ - @Override - @Transactional(rollbackFor = Exception.class) - public void syncDef(String tenantId) { - FlowCategory flowCategory = flwCategoryMapper.selectOne(new LambdaQueryWrapper() - .eq(FlowCategory::getTenantId, DEFAULT_TENANT_ID) - .eq(FlowCategory::getCategoryId, FlowConstant.FLOW_CATEGORY_ID)); - flowCategory.setCategoryId(null); - flowCategory.setTenantId(tenantId); - flowCategory.setCreateDept(null); - flowCategory.setCreateBy(null); - flowCategory.setCreateTime(null); - flowCategory.setUpdateBy(null); - flowCategory.setUpdateTime(null); - flwCategoryMapper.insert(flowCategory); - - List flowDefinitions = flowDefinitionMapper.selectList(new LambdaQueryWrapper().eq(FlowDefinition::getTenantId, DEFAULT_TENANT_ID)); - if (CollUtil.isEmpty(flowDefinitions)) { - return; - } - List defIds = StreamUtils.toList(flowDefinitions, FlowDefinition::getId); - List flowNodes = flowNodeMapper.selectList(new LambdaQueryWrapper().in(FlowNode::getDefinitionId, defIds)); - List flowSkips = flowSkipMapper.selectList(new LambdaQueryWrapper().in(FlowSkip::getDefinitionId, defIds)); - for (FlowDefinition definition : flowDefinitions) { - FlowDefinition flowDefinition = BeanUtil.toBean(definition, FlowDefinition.class); - flowDefinition.setId(null); - flowDefinition.setTenantId(tenantId); - flowDefinition.setIsPublish(0); - flowDefinition.setCategory(Convert.toStr(flowCategory.getCategoryId())); - int insert = flowDefinitionMapper.insert(flowDefinition); - if (insert <= 0) { - log.info("同步流程定义【{}】失败!", definition.getFlowCode()); - continue; - } - log.info("同步流程定义【{}】成功!", definition.getFlowCode()); - Long definitionId = flowDefinition.getId(); - if (CollUtil.isNotEmpty(flowNodes)) { - List nodes = StreamUtils.filter(flowNodes, node -> node.getDefinitionId().equals(definition.getId())); - if (CollUtil.isNotEmpty(nodes)) { - List flowNodeList = BeanUtil.copyToList(nodes, FlowNode.class); - flowNodeList.forEach(e -> { - e.setId(null); - e.setDefinitionId(definitionId); - e.setTenantId(tenantId); - e.setPermissionFlag(null); - }); - flowNodeMapper.insertOrUpdate(flowNodeList); - } - } - if (CollUtil.isNotEmpty(flowSkips)) { - List skips = StreamUtils.filter(flowSkips, skip -> skip.getDefinitionId().equals(definition.getId())); - if (CollUtil.isNotEmpty(skips)) { - List flowSkipList = BeanUtil.copyToList(skips, FlowSkip.class); - flowSkipList.forEach(e -> { - e.setId(null); - e.setDefinitionId(definitionId); - e.setTenantId(tenantId); - }); - flowSkipMapper.insertOrUpdate(flowSkipList); - } - } - } - } } diff --git a/ruoyi-modules/ruoyi-workflow/src/main/java/org/dromara/workflow/service/impl/FlwTaskServiceImpl.java b/ruoyi-modules/ruoyi-workflow/src/main/java/org/dromara/workflow/service/impl/FlwTaskServiceImpl.java index 0a8bdc72d..5fd3838ac 100644 --- a/ruoyi-modules/ruoyi-workflow/src/main/java/org/dromara/workflow/service/impl/FlwTaskServiceImpl.java +++ b/ruoyi-modules/ruoyi-workflow/src/main/java/org/dromara/workflow/service/impl/FlwTaskServiceImpl.java @@ -720,7 +720,7 @@ public class FlwTaskServiceImpl implements IFlwTaskService { @Transactional(rollbackFor = Exception.class) public boolean taskOperation(TaskOperationBo bo, String taskOperation) { FlowParams flowParams = FlowParams.build().message(bo.getMessage()); - if (LoginHelper.isSuperAdmin() || LoginHelper.isTenantAdmin()) { + if (LoginHelper.isSuperAdmin()) { flowParams.ignore(true); } diff --git a/ruoyi-modules/ruoyi-workflow/src/main/java/org/dromara/workflow/service/impl/WorkflowServiceImpl.java b/ruoyi-modules/ruoyi-workflow/src/main/java/org/dromara/workflow/service/impl/WorkflowServiceImpl.java index 8d6b8d211..c64e878a6 100644 --- a/ruoyi-modules/ruoyi-workflow/src/main/java/org/dromara/workflow/service/impl/WorkflowServiceImpl.java +++ b/ruoyi-modules/ruoyi-workflow/src/main/java/org/dromara/workflow/service/impl/WorkflowServiceImpl.java @@ -104,16 +104,6 @@ public class WorkflowServiceImpl implements WorkflowService { return ObjectUtil.isNotNull(flowInstance) ? flowInstance.getId() : null; } - /** - * 新增租户流程定义 - * - * @param tenantId 租户id - */ - @Override - public void syncDef(String tenantId) { - flwDefinitionService.syncDef(tenantId); - } - /** * 启动流程 * diff --git a/script/sql/oracle/oracle_ry_vue_5.X.sql b/script/sql/oracle/oracle_ry_vue_5.X.sql index 3a9cef456..8834dbe77 100644 --- a/script/sql/oracle/oracle_ry_vue_5.X.sql +++ b/script/sql/oracle/oracle_ry_vue_5.X.sql @@ -5,7 +5,6 @@ create table sys_social ( id number(20) not null, user_id number(20) not null, - tenant_id varchar2(20) default '000000', auth_id varchar2(255) not null, source varchar2(255) not null, open_id varchar2(255) default null, @@ -39,7 +38,6 @@ alter table sys_social add constraint pk_sys_social primary key (id); comment on table sys_social is '社会化关系表'; comment on column sys_social.id is '主键'; comment on column sys_social.user_id is '用户ID'; -comment on column sys_social.tenant_id is '租户id'; comment on column sys_social.auth_id is '平台+平台唯一id'; comment on column sys_social.source is '用户来源'; comment on column sys_social.open_id is '平台编号唯一id'; @@ -67,101 +65,11 @@ comment on column sys_social.update_by is '更新者'; comment on column sys_social.update_time is '更新时间'; comment on column sys_social.del_flag is '删除标志(0代表存在 1代表删除)'; --- ---------------------------- --- 租户表 --- ---------------------------- -create table sys_tenant ( - id number(20) not null, - tenant_id varchar2(20) not null, - contact_user_name varchar2(20) default '', - contact_phone varchar2(20) default '', - company_name varchar2(30) default '', - license_number varchar2(30) default '', - address varchar2(200) default '', - intro varchar2(200) default '', - domain varchar2(200) default '', - remark varchar2(200) default '', - package_id number(20) default null, - expire_time date default null, - account_count number(4) default -1, - status char(1) default '0', - del_flag char(1) default '0', - create_dept number(20) default null, - create_by number(20) default null, - create_time date, - update_by number(20) default null, - update_time date -); - -alter table sys_tenant add constraint pk_sys_tenant primary key (id); - -comment on table sys_tenant is '租户表'; -comment on column sys_tenant.tenant_id is '租户编号'; -comment on column sys_tenant.contact_phone is '联系电话'; -comment on column sys_tenant.company_name is '企业名称'; -comment on column sys_tenant.company_name is '联系人'; -comment on column sys_tenant.license_number is '统一社会信用代码'; -comment on column sys_tenant.address is '地址'; -comment on column sys_tenant.intro is '企业简介'; -comment on column sys_tenant.remark is '备注'; -comment on column sys_tenant.package_id is '租户套餐编号'; -comment on column sys_tenant.expire_time is '过期时间'; -comment on column sys_tenant.account_count is '用户数量(-1不限制)'; -comment on column sys_tenant.status is '租户状态(0正常 1停用)'; -comment on column sys_tenant.del_flag is '删除标志(0代表存在 1代表删除)'; -comment on column sys_tenant.create_dept is '创建部门'; -comment on column sys_tenant.create_by is '创建者'; -comment on column sys_tenant.create_time is '创建时间'; -comment on column sys_tenant.update_by is '更新者'; -comment on column sys_tenant.update_time is '更新时间'; - --- ---------------------------- --- 初始化-租户表数据 --- ---------------------------- - -insert into sys_tenant values(1, '000000', '管理组', '15888888888', 'XXX有限公司', null, null, '多租户通用后台管理管理系统', null, null, null, null, -1, '0', '0', 103, 1, sysdate, null, null); - - --- ---------------------------- --- 租户套餐表 --- ---------------------------- -create table sys_tenant_package ( - package_id number(20) not null, - package_name varchar2(20) default '', - menu_ids varchar2(3000) default '', - remark varchar2(200) default '', - menu_check_strictly number(1) default 1, - status char(1) default '0', - del_flag char(1) default '0', - create_dept number(20) default null, - create_by number(20) default null, - create_time date, - update_by number(20) default null, - update_time date -); - -alter table sys_tenant_package add constraint pk_sys_tenant_package primary key (package_id); - -comment on table sys_tenant_package is '租户套餐表'; -comment on column sys_tenant_package.package_id is '租户套餐id'; -comment on column sys_tenant_package.package_name is '套餐名称'; -comment on column sys_tenant_package.menu_ids is '关联菜单id'; -comment on column sys_tenant_package.remark is '备注'; -comment on column sys_tenant_package.status is '状态(0正常 1停用)'; -comment on column sys_tenant_package.del_flag is '删除标志(0代表存在 1代表删除)'; -comment on column sys_tenant_package.create_dept is '创建部门'; -comment on column sys_tenant_package.create_by is '创建者'; -comment on column sys_tenant_package.create_time is '创建时间'; -comment on column sys_tenant_package.update_by is '更新者'; -comment on column sys_tenant_package.update_time is '更新时间'; - - -- ---------------------------- -- 1、部门表 -- ---------------------------- create table sys_dept ( dept_id number(20) not null, - tenant_id varchar2(20) default '000000', parent_id number(20) default 0, ancestors varchar2(500) default '', dept_name varchar2(30) default '', @@ -183,7 +91,6 @@ alter table sys_dept add constraint pk_sys_dept primary key (dept_id); comment on table sys_dept is '部门表'; comment on column sys_dept.dept_id is '部门id'; -comment on column sys_dept.tenant_id is '租户编号'; comment on column sys_dept.parent_id is '父部门id'; comment on column sys_dept.ancestors is '祖级列表'; comment on column sys_dept.dept_name is '部门名称'; @@ -204,16 +111,16 @@ comment on column sys_dept.update_time is '更新时间'; -- 初始化-部门表数据 -- ---------------------------- -insert into sys_dept values(100, '000000', 0, '0', 'XXX科技', null,0, null, '15888888888', 'xxx@qq.com', '0', '0', 103, 1, sysdate, null, null); -insert into sys_dept values(101, '000000', 100, '0,100', '深圳总公司', null,1, null, '15888888888', 'xxx@qq.com', '0', '0', 103, 1, sysdate, null, null); -insert into sys_dept values(102, '000000', 100, '0,100', '长沙分公司', null,2, null, '15888888888', 'xxx@qq.com', '0', '0', 103, 1, sysdate, null, null); -insert into sys_dept values(103, '000000', 101, '0,100,101', '研发部门', null,1, 1, '15888888888', 'xxx@qq.com', '0', '0', 103, 1, sysdate, null, null); -insert into sys_dept values(104, '000000', 101, '0,100,101', '市场部门', null,2, null, '15888888888', 'xxx@qq.com', '0', '0', 103, 1, sysdate, null, null); -insert into sys_dept values(105, '000000', 101, '0,100,101', '测试部门', null,3, null, '15888888888', 'xxx@qq.com', '0', '0', 103, 1, sysdate, null, null); -insert into sys_dept values(106, '000000', 101, '0,100,101', '财务部门', null,4, null, '15888888888', 'xxx@qq.com', '0', '0', 103, 1, sysdate, null, null); -insert into sys_dept values(107, '000000', 101, '0,100,101', '运维部门', null,5, null, '15888888888', 'xxx@qq.com', '0', '0', 103, 1, sysdate, null, null); -insert into sys_dept values(108, '000000', 102, '0,100,102', '市场部门', null,1, null, '15888888888', 'xxx@qq.com', '0', '0', 103, 1, sysdate, null, null); -insert into sys_dept values(109, '000000', 102, '0,100,102', '财务部门', null,2, null, '15888888888', 'xxx@qq.com', '0', '0', 103, 1, sysdate, null, null); +insert into sys_dept values(100, 0, '0', 'XXX科技', null,0, null, '15888888888', 'xxx@qq.com', '0', '0', 103, 1, sysdate, null, null); +insert into sys_dept values(101, 100, '0,100', '深圳总公司', null,1, null, '15888888888', 'xxx@qq.com', '0', '0', 103, 1, sysdate, null, null); +insert into sys_dept values(102, 100, '0,100', '长沙分公司', null,2, null, '15888888888', 'xxx@qq.com', '0', '0', 103, 1, sysdate, null, null); +insert into sys_dept values(103, 101, '0,100,101', '研发部门', null,1, 1, '15888888888', 'xxx@qq.com', '0', '0', 103, 1, sysdate, null, null); +insert into sys_dept values(104, 101, '0,100,101', '市场部门', null,2, null, '15888888888', 'xxx@qq.com', '0', '0', 103, 1, sysdate, null, null); +insert into sys_dept values(105, 101, '0,100,101', '测试部门', null,3, null, '15888888888', 'xxx@qq.com', '0', '0', 103, 1, sysdate, null, null); +insert into sys_dept values(106, 101, '0,100,101', '财务部门', null,4, null, '15888888888', 'xxx@qq.com', '0', '0', 103, 1, sysdate, null, null); +insert into sys_dept values(107, 101, '0,100,101', '运维部门', null,5, null, '15888888888', 'xxx@qq.com', '0', '0', 103, 1, sysdate, null, null); +insert into sys_dept values(108, 102, '0,100,102', '市场部门', null,1, null, '15888888888', 'xxx@qq.com', '0', '0', 103, 1, sysdate, null, null); +insert into sys_dept values(109, 102, '0,100,102', '财务部门', null,2, null, '15888888888', 'xxx@qq.com', '0', '0', 103, 1, sysdate, null, null); -- ---------------------------- @@ -221,7 +128,6 @@ insert into sys_dept values(109, '000000', 102, '0,100,102', '财务部门', -- ---------------------------- create table sys_user ( user_id number(20) not null, - tenant_id varchar2(20) default '000000', dept_id number(20) default null, user_name varchar2(40) not null, nick_name varchar2(40) not null, @@ -247,7 +153,6 @@ alter table sys_user add constraint pk_sys_user primary key (user_id); comment on table sys_user is '用户信息表'; comment on column sys_user.user_id is '用户ID'; -comment on column sys_user.tenant_id is '租户编号'; comment on column sys_user.dept_id is '部门ID'; comment on column sys_user.user_name is '用户账号'; comment on column sys_user.nick_name is '用户昵称'; @@ -271,16 +176,15 @@ comment on column sys_user.remark is '备注'; -- ---------------------------- -- 初始化-用户信息表数据 -- ---------------------------- -insert into sys_user values(1, '000000', 103, 'admin', '疯狂的狮子Li', 'sys_user', 'crazyLionLi@163.com', '15888888888', '1', null, '$2a$10$7JB720yubVSZvUI0rEqK/.VqGOZTH.ulu33dHOiBE8ByOhJIrdAu2', '0', '0', '127.0.0.1', sysdate, 103, 1, sysdate, null, null, '管理员'); -insert into sys_user values(3, '000000', 108, 'test', '本部门及以下 密码666666', 'sys_user', '', '', '0', null, '$2a$10$b8yUzN0C71sbz.PhNOCgJe.Tu1yWC3RNrTyjSQ8p1W0.aaUXUJ.Ne', '0', '0', '127.0.0.1', sysdate, 103, 1, sysdate, null, null, ''); -insert into sys_user values(4, '000000', 102, 'test1', '仅本人 密码666666', 'sys_user', '', '', '0', null, '$2a$10$b8yUzN0C71sbz.PhNOCgJe.Tu1yWC3RNrTyjSQ8p1W0.aaUXUJ.Ne', '0', '0', '127.0.0.1', sysdate, 103, 1, sysdate, null, null, ''); +insert into sys_user values(1, 103, 'admin', '疯狂的狮子Li', 'sys_user', 'crazyLionLi@163.com', '15888888888', '1', null, '$2a$10$7JB720yubVSZvUI0rEqK/.VqGOZTH.ulu33dHOiBE8ByOhJIrdAu2', '0', '0', '127.0.0.1', sysdate, 103, 1, sysdate, null, null, '管理员'); +insert into sys_user values(3, 108, 'test', '本部门及以下 密码666666', 'sys_user', '', '', '0', null, '$2a$10$b8yUzN0C71sbz.PhNOCgJe.Tu1yWC3RNrTyjSQ8p1W0.aaUXUJ.Ne', '0', '0', '127.0.0.1', sysdate, 103, 1, sysdate, null, null, ''); +insert into sys_user values(4, 102, 'test1', '仅本人 密码666666', 'sys_user', '', '', '0', null, '$2a$10$b8yUzN0C71sbz.PhNOCgJe.Tu1yWC3RNrTyjSQ8p1W0.aaUXUJ.Ne', '0', '0', '127.0.0.1', sysdate, 103, 1, sysdate, null, null, ''); -- ---------------------------- -- 3、岗位信息表 -- ---------------------------- create table sys_post ( post_id number(20) not null, - tenant_id varchar2(20) default '000000', dept_id number(20) not null, post_code varchar2(64) not null, post_category varchar2(64) default null, @@ -299,7 +203,6 @@ alter table sys_post add constraint pk_sys_post primary key (post_id); comment on table sys_post is '岗位信息表'; comment on column sys_post.post_id is '岗位ID'; -comment on column sys_post.tenant_id is '租户编号'; comment on column sys_post.dept_id is '部门id'; comment on column sys_post.post_code is '岗位编码'; comment on column sys_post.post_category is '岗位类别编码'; @@ -316,10 +219,10 @@ comment on column sys_post.remark is '备注'; -- ---------------------------- -- 初始化-岗位信息表数据 -- ---------------------------- -insert into sys_post values(1, '000000', 103, 'ceo', null, '董事长', 1, '0', 103, 1, sysdate, null, null, ''); -insert into sys_post values(2, '000000', 100, 'se', null, '项目经理', 2, '0', 103, 1, sysdate, null, null, ''); -insert into sys_post values(3, '000000', 100, 'hr', null, '人力资源', 3, '0', 103, 1, sysdate, null, null, ''); -insert into sys_post values(4, '000000', 100, 'user', null, '普通员工', 4, '0', 103, 1, sysdate, null, null, ''); +insert into sys_post values(1, 103, 'ceo', null, '董事长', 1, '0', 103, 1, sysdate, null, null, ''); +insert into sys_post values(2, 100, 'se', null, '项目经理', 2, '0', 103, 1, sysdate, null, null, ''); +insert into sys_post values(3, 100, 'hr', null, '人力资源', 3, '0', 103, 1, sysdate, null, null, ''); +insert into sys_post values(4, 100, 'user', null, '普通员工', 4, '0', 103, 1, sysdate, null, null, ''); -- ---------------------------- @@ -327,7 +230,6 @@ insert into sys_post values(4, '000000', 100, 'user', null, '普通员工', 4, -- ---------------------------- create table sys_role ( role_id number(20) not null, - tenant_id varchar2(20) default '000000', role_name varchar2(30) not null, role_key varchar2(100) not null, role_sort number(4) not null, @@ -348,7 +250,6 @@ alter table sys_role add constraint pk_sys_role primary key (role_id); comment on table sys_role is '角色信息表'; comment on column sys_role.role_id is '角色ID'; -comment on column sys_role.tenant_id is '租户编号'; comment on column sys_role.role_name is '角色名称'; comment on column sys_role.role_key is '角色权限字符串'; comment on column sys_role.role_sort is '显示顺序'; @@ -367,9 +268,9 @@ comment on column sys_role.remark is '备注'; -- ---------------------------- -- 初始化-角色信息表数据 -- ---------------------------- -insert into sys_role values('1', '000000', '超级管理员', 'superadmin', 1, 1, 1, 1, '0', '0', 103, 1, sysdate, null, null, '超级管理员'); -insert into sys_role values('3', '000000', '本部门及以下', 'test1', 3, 4, 1, 1, '0', '0', 103, 1, sysdate, null, null, null); -insert into sys_role values('4', '000000', '仅本人', 'test2', 4, 5, 1, 1, '0', '0', 103, 1, sysdate, null, null, null); +insert into sys_role values('1', '超级管理员', 'superadmin', 1, 1, 1, 1, '0', '0', 103, 1, sysdate, null, null, '超级管理员'); +insert into sys_role values('3', '本部门及以下', 'test1', 3, 4, 1, 1, '0', '0', 103, 1, sysdate, null, null, null); +insert into sys_role values('4', '仅本人', 'test2', 4, 5, 1, 1, '0', '0', 103, 1, sysdate, null, null, null); -- ---------------------------- -- 5、菜单权限表 @@ -426,7 +327,6 @@ comment on column sys_menu.remark is '备注'; -- ---------------------------- -- 一级菜单 insert into sys_menu values('1', '系统管理', '0', '1', 'system', null, '', 1, 0, 'M', '0', '0', '', 'system', 103, 1, sysdate, null, null, '系统管理目录'); -insert into sys_menu values('6', '租户管理', '0', '2', 'tenant', null, '', 1, 0, 'M', '0', '0', '', 'chart', 103, 1, sysdate, null, null, '租户管理目录'); insert into sys_menu values('2', '系统监控', '0', '3', 'monitor', null, '', 1, 0, 'M', '0', '0', '', 'monitor', 103, 1, sysdate, null, null, '系统监控目录'); insert into sys_menu values('3', '系统工具', '0', '4', 'tool', null, '', 1, 0, 'M', '0', '0', '', 'tool', 103, 1, sysdate, null, null, '系统工具目录'); insert into sys_menu values('4', 'PLUS官网', '0', '5', 'https://gitee.com/dromara/RuoYi-Vue-Plus', null, '', 0, 0, 'M', '0', '0', '', 'guide', 103, 1, sysdate, null, null, 'RuoYi-Vue-Plus官网地址'); @@ -444,8 +344,6 @@ insert into sys_menu values('108', '日志管理', '1', '9', 'log', insert into sys_menu values('109', '在线用户', '2', '1', 'online', 'monitor/online/index', '', 1, 0, 'C', '0', '0', 'monitor:online:list', 'online', 103, 1, sysdate, null, null, '在线用户菜单'); insert into sys_menu values('113', '缓存监控', '2', '5', 'cache', 'monitor/cache/index', '', 1, 0, 'C', '0', '0', 'monitor:cache:list', 'redis', 103, 1, sysdate, null, null, '缓存监控菜单'); insert into sys_menu values('115', '代码生成', '3', '2', 'gen', 'tool/gen/index', '', 1, 0, 'C', '0', '0', 'tool:gen:list', 'code', 103, 1, sysdate, null, null, '代码生成菜单'); -insert into sys_menu values('121', '租户管理', '6', '1', 'tenant', 'system/tenant/index', '', 1, 0, 'C', '0', '0', 'system:tenant:list', 'list', 103, 1, sysdate, null, null, '租户管理菜单'); -insert into sys_menu values('122', '租户套餐管理', '6', '2', 'tenantPackage', 'system/tenantPackage/index', '', 1, 0, 'C', '0', '0', 'system:tenantPackage:list', 'form', 103, 1, sysdate, null, null, '租户套餐管理菜单'); insert into sys_menu values('123', '客户端管理', '1', '11', 'client', 'system/client/index', '', 1, 0, 'C', '0', '0', 'system:client:list', 'international', 103, 1, sysdate, null, null, '客户端管理菜单'); insert into sys_menu values('116', '修改生成配置', '3', '2', 'gen-edit/index/:tableId', 'tool/gen/editTable', '', 1, 1, 'C', '1', '0', 'tool:gen:edit', '#', 103, 1, sysdate, null, null, '/tool/gen'); insert into sys_menu values('130', '分配用户', '1', '2', 'role-auth/user/:roleId', 'system/role/authUser', '', 1, 1, 'C', '1', '0', 'system:role:edit', '#', 103, 1, sysdate, null, null, '/system/role'); @@ -539,18 +437,6 @@ insert into sys_menu values('1620', '配置列表', '118', '5', '#', '', '', 1, insert into sys_menu values('1621', '配置添加', '118', '6', '#', '', '', 1, 0, 'F', '0', '0', 'system:ossConfig:add', '#', 103, 1, sysdate, null, null, ''); insert into sys_menu values('1622', '配置编辑', '118', '6', '#', '', '', 1, 0, 'F', '0', '0', 'system:ossConfig:edit', '#', 103, 1, sysdate, null, null, ''); insert into sys_menu values('1623', '配置删除', '118', '6', '#', '', '', 1, 0, 'F', '0', '0', 'system:ossConfig:remove', '#', 103, 1, sysdate, null, null, ''); --- 租户管理相关按钮 -insert into sys_menu values('1606', '租户查询', '121', '1', '#', '', '', 1, 0, 'F', '0', '0', 'system:tenant:query', '#', 103, 1, sysdate, null, null, ''); -insert into sys_menu values('1607', '租户新增', '121', '2', '#', '', '', 1, 0, 'F', '0', '0', 'system:tenant:add', '#', 103, 1, sysdate, null, null, ''); -insert into sys_menu values('1608', '租户修改', '121', '3', '#', '', '', 1, 0, 'F', '0', '0', 'system:tenant:edit', '#', 103, 1, sysdate, null, null, ''); -insert into sys_menu values('1609', '租户删除', '121', '4', '#', '', '', 1, 0, 'F', '0', '0', 'system:tenant:remove', '#', 103, 1, sysdate, null, null, ''); -insert into sys_menu values('1610', '租户导出', '121', '5', '#', '', '', 1, 0, 'F', '0', '0', 'system:tenant:export', '#', 103, 1, sysdate, null, null, ''); --- 租户套餐管理相关按钮 -insert into sys_menu values('1611', '租户套餐查询', '122', '1', '#', '', '', 1, 0, 'F', '0', '0', 'system:tenantPackage:query', '#', 103, 1, sysdate, null, null, ''); -insert into sys_menu values('1612', '租户套餐新增', '122', '2', '#', '', '', 1, 0, 'F', '0', '0', 'system:tenantPackage:add', '#', 103, 1, sysdate, null, null, ''); -insert into sys_menu values('1613', '租户套餐修改', '122', '3', '#', '', '', 1, 0, 'F', '0', '0', 'system:tenantPackage:edit', '#', 103, 1, sysdate, null, null, ''); -insert into sys_menu values('1614', '租户套餐删除', '122', '4', '#', '', '', 1, 0, 'F', '0', '0', 'system:tenantPackage:remove', '#', 103, 1, sysdate, null, null, ''); -insert into sys_menu values('1615', '租户套餐导出', '122', '5', '#', '', '', 1, 0, 'F', '0', '0', 'system:tenantPackage:export', '#', 103, 1, sysdate, null, null, ''); -- 客户端管理按钮 insert into sys_menu values('1061', '客户端管理查询', '123', '1', '#', '', '', 1, 0, 'F', '0', '0', 'system:client:query', '#', 103, 1, sysdate, null, null, ''); insert into sys_menu values('1062', '客户端管理新增', '123', '2', '#', '', '', 1, 0, 'F', '0', '0', 'system:client:add', '#', 103, 1, sysdate, null, null, ''); @@ -768,7 +654,6 @@ insert into sys_user_post values ('1', '1'); -- ---------------------------- create table sys_oper_log ( oper_id number(20) not null, - tenant_id varchar2(20) default '000000', title varchar2(50) default '', business_type number(2) default 0, method varchar2(100) default '', @@ -794,7 +679,6 @@ create index idx_sys_oper_log_ot on sys_oper_log (oper_time); comment on table sys_oper_log is '操作日志记录'; comment on column sys_oper_log.oper_id is '日志主键'; -comment on column sys_oper_log.tenant_id is '租户编号'; comment on column sys_oper_log.title is '模块标题'; comment on column sys_oper_log.business_type is '业务类型(0其它 1新增 2修改 3删除)'; comment on column sys_oper_log.method is '方法名称'; @@ -818,7 +702,6 @@ comment on column sys_oper_log.cost_time is '消耗时间'; -- ---------------------------- create table sys_dict_type ( dict_id number(20) not null, - tenant_id varchar2(20) default '000000', dict_name varchar2(100) default '', dict_type varchar2(100) default '', create_dept number(20) default null, @@ -834,7 +717,6 @@ create unique index sys_dict_type_index1 on sys_dict_type (tenant_id, dict_type) comment on table sys_dict_type is '字典类型表'; comment on column sys_dict_type.dict_id is '字典主键'; -comment on column sys_dict_type.tenant_id is '租户编号'; comment on column sys_dict_type.dict_name is '字典名称'; comment on column sys_dict_type.dict_type is '字典类型'; comment on column sys_dict_type.create_dept is '创建部门'; @@ -844,16 +726,16 @@ comment on column sys_dict_type.update_by is '更新者'; comment on column sys_dict_type.update_time is '更新时间'; comment on column sys_dict_type.remark is '备注'; -insert into sys_dict_type values(1, '000000', '用户性别', 'sys_user_sex', 103, 1, sysdate, null, null, '用户性别列表'); -insert into sys_dict_type values(2, '000000', '菜单状态', 'sys_show_hide', 103, 1, sysdate, null, null, '菜单状态列表'); -insert into sys_dict_type values(3, '000000', '系统开关', 'sys_normal_disable', 103, 1, sysdate, null, null, '系统开关列表'); -insert into sys_dict_type values(6, '000000', '系统是否', 'sys_yes_no', 103, 1, sysdate, null, null, '系统是否列表'); -insert into sys_dict_type values(7, '000000', '通知类型', 'sys_notice_type', 103, 1, sysdate, null, null, '通知类型列表'); -insert into sys_dict_type values(8, '000000', '通知状态', 'sys_notice_status', 103, 1, sysdate, null, null, '通知状态列表'); -insert into sys_dict_type values(9, '000000', '操作类型', 'sys_oper_type', 103, 1, sysdate, null, null, '操作类型列表'); -insert into sys_dict_type values(10, '000000', '系统状态', 'sys_common_status', 103, 1, sysdate, null, null, '登录状态列表'); -insert into sys_dict_type values(11, '000000', '授权类型', 'sys_grant_type', 103, 1, sysdate, null, null, '认证授权类型'); -insert into sys_dict_type values(12, '000000', '设备类型', 'sys_device_type', 103, 1, sysdate, null, null, '客户端设备类型'); +insert into sys_dict_type values(1, '用户性别', 'sys_user_sex', 103, 1, sysdate, null, null, '用户性别列表'); +insert into sys_dict_type values(2, '菜单状态', 'sys_show_hide', 103, 1, sysdate, null, null, '菜单状态列表'); +insert into sys_dict_type values(3, '系统开关', 'sys_normal_disable', 103, 1, sysdate, null, null, '系统开关列表'); +insert into sys_dict_type values(6, '系统是否', 'sys_yes_no', 103, 1, sysdate, null, null, '系统是否列表'); +insert into sys_dict_type values(7, '通知类型', 'sys_notice_type', 103, 1, sysdate, null, null, '通知类型列表'); +insert into sys_dict_type values(8, '通知状态', 'sys_notice_status', 103, 1, sysdate, null, null, '通知状态列表'); +insert into sys_dict_type values(9, '操作类型', 'sys_oper_type', 103, 1, sysdate, null, null, '操作类型列表'); +insert into sys_dict_type values(10, '系统状态', 'sys_common_status', 103, 1, sysdate, null, null, '登录状态列表'); +insert into sys_dict_type values(11, '授权类型', 'sys_grant_type', 103, 1, sysdate, null, null, '认证授权类型'); +insert into sys_dict_type values(12, '设备类型', 'sys_device_type', 103, 1, sysdate, null, null, '客户端设备类型'); -- ---------------------------- @@ -861,7 +743,6 @@ insert into sys_dict_type values(12, '000000', '设备类型', 'sys_device_type' -- ---------------------------- create table sys_dict_data ( dict_code number(20) not null, - tenant_id varchar2(20) default '000000', dict_sort number(4) default 0, dict_label varchar2(100) default '', dict_value varchar2(100) default '', @@ -881,7 +762,6 @@ alter table sys_dict_data add constraint pk_sys_dict_data primary key (dict_code comment on table sys_dict_data is '字典数据表'; comment on column sys_dict_data.dict_code is '字典主键'; -comment on column sys_dict_data.tenant_id is '租户编号'; comment on column sys_dict_data.dict_sort is '字典排序'; comment on column sys_dict_data.dict_label is '字典标签'; comment on column sys_dict_data.dict_value is '字典键值'; @@ -896,40 +776,40 @@ comment on column sys_dict_data.update_by is '更新者'; comment on column sys_dict_data.update_time is '更新时间'; comment on column sys_dict_data.remark is '备注'; -insert into sys_dict_data values(1, '000000', 1, '男', '0', 'sys_user_sex', '', '', 'Y', 103, 1, sysdate, null, null, '性别男'); -insert into sys_dict_data values(2, '000000', 2, '女', '1', 'sys_user_sex', '', '', 'N', 103, 1, sysdate, null, null, '性别女'); -insert into sys_dict_data values(3, '000000', 3, '未知', '2', 'sys_user_sex', '', '', 'N', 103, 1, sysdate, null, null, '性别未知'); -insert into sys_dict_data values(4, '000000', 1, '显示', '0', 'sys_show_hide', '', 'primary', 'Y', 103, 1, sysdate, null, null, '显示菜单'); -insert into sys_dict_data values(5, '000000', 2, '隐藏', '1', 'sys_show_hide', '', 'danger', 'N', 103, 1, sysdate, null, null, '隐藏菜单'); -insert into sys_dict_data values(6, '000000', 1, '正常', '0', 'sys_normal_disable', '', 'primary', 'Y', 103, 1, sysdate, null, null, '正常状态'); -insert into sys_dict_data values(7, '000000', 2, '停用', '1', 'sys_normal_disable', '', 'danger', 'N', 103, 1, sysdate, null, null, '停用状态'); -insert into sys_dict_data values(12, '000000', 1, '是', 'Y', 'sys_yes_no', '', 'primary', 'Y', 103, 1, sysdate, null, null, '系统默认是'); -insert into sys_dict_data values(13, '000000', 2, '否', 'N', 'sys_yes_no', '', 'danger', 'N', 103, 1, sysdate, null, null, '系统默认否'); -insert into sys_dict_data values(14, '000000', 1, '通知', '1', 'sys_notice_type', '', 'warning', 'Y', 103, 1, sysdate, null, null, '通知'); -insert into sys_dict_data values(15, '000000', 2, '公告', '2', 'sys_notice_type', '', 'success', 'N', 103, 1, sysdate, null, null, '公告'); -insert into sys_dict_data values(16, '000000', 1, '正常', '0', 'sys_notice_status', '', 'primary', 'Y', 103, 1, sysdate, null, null, '正常状态'); -insert into sys_dict_data values(17, '000000', 2, '关闭', '1', 'sys_notice_status', '', 'danger', 'N', 103, 1, sysdate, null, null, '关闭状态'); -insert into sys_dict_data values(29, '000000', 99, '其他', '0', 'sys_oper_type', '', 'info', 'N', 103, 1, sysdate, null, null, '其他操作'); -insert into sys_dict_data values(18, '000000', 1, '新增', '1', 'sys_oper_type', '', 'info', 'N', 103, 1, sysdate, null, null, '新增操作'); -insert into sys_dict_data values(19, '000000', 2, '修改', '2', 'sys_oper_type', '', 'info', 'N', 103, 1, sysdate, null, null, '修改操作'); -insert into sys_dict_data values(20, '000000', 3, '删除', '3', 'sys_oper_type', '', 'danger', 'N', 103, 1, sysdate, null, null, '删除操作'); -insert into sys_dict_data values(21, '000000', 4, '授权', '4', 'sys_oper_type', '', 'primary', 'N', 103, 1, sysdate, null, null, '授权操作'); -insert into sys_dict_data values(22, '000000', 5, '导出', '5', 'sys_oper_type', '', 'warning', 'N', 103, 1, sysdate, null, null, '导出操作'); -insert into sys_dict_data values(23, '000000', 6, '导入', '6', 'sys_oper_type', '', 'warning', 'N', 103, 1, sysdate, null, null, '导入操作'); -insert into sys_dict_data values(24, '000000', 7, '强退', '7', 'sys_oper_type', '', 'danger', 'N', 103, 1, sysdate, null, null, '强退操作'); -insert into sys_dict_data values(25, '000000', 8, '生成代码', '8', 'sys_oper_type', '', 'warning', 'N', 103, 1, sysdate, null, null, '生成操作'); -insert into sys_dict_data values(26, '000000', 9, '清空数据', '9', 'sys_oper_type', '', 'danger', 'N', 103, 1, sysdate, null, null, '清空操作'); -insert into sys_dict_data values(27, '000000', 1, '成功', '0', 'sys_common_status', '', 'primary', 'N', 103, 1, sysdate, null, null, '正常状态'); -insert into sys_dict_data values(28, '000000', 2, '失败', '1', 'sys_common_status', '', 'danger', 'N', 103, 1, sysdate, null, null, '停用状态'); -insert into sys_dict_data values(30, '000000', 0, '密码认证', 'password', 'sys_grant_type', '', 'default', 'N', 103, 1, sysdate, null, null, '密码认证'); -insert into sys_dict_data values(31, '000000', 0, '短信认证', 'sms', 'sys_grant_type', '', 'default', 'N', 103, 1, sysdate, null, null, '短信认证'); -insert into sys_dict_data values(32, '000000', 0, '邮件认证', 'email', 'sys_grant_type', '', 'default', 'N', 103, 1, sysdate, null, null, '邮件认证'); -insert into sys_dict_data values(33, '000000', 0, '小程序认证', 'xcx', 'sys_grant_type', '', 'default', 'N', 103, 1, sysdate, null, null, '小程序认证'); -insert into sys_dict_data values(34, '000000', 0, '三方登录认证', 'social', 'sys_grant_type', '', 'default', 'N', 103, 1, sysdate, null, null, '三方登录认证'); -insert into sys_dict_data values(35, '000000', 0, 'PC', 'pc', 'sys_device_type', '', 'default', 'N', 103, 1, sysdate, null, null, 'PC'); -insert into sys_dict_data values(36, '000000', 0, '安卓', 'android', 'sys_device_type', '', 'default', 'N', 103, 1, sysdate, null, null, '安卓'); -insert into sys_dict_data values(37, '000000', 0, 'iOS', 'ios', 'sys_device_type', '', 'default', 'N', 103, 1, sysdate, null, null, 'iOS'); -insert into sys_dict_data values(38, '000000', 0, '小程序', 'xcx', 'sys_device_type', '', 'default', 'N', 103, 1, sysdate, null, null, '小程序'); +insert into sys_dict_data values(1, 1, '男', '0', 'sys_user_sex', '', '', 'Y', 103, 1, sysdate, null, null, '性别男'); +insert into sys_dict_data values(2, 2, '女', '1', 'sys_user_sex', '', '', 'N', 103, 1, sysdate, null, null, '性别女'); +insert into sys_dict_data values(3, 3, '未知', '2', 'sys_user_sex', '', '', 'N', 103, 1, sysdate, null, null, '性别未知'); +insert into sys_dict_data values(4, 1, '显示', '0', 'sys_show_hide', '', 'primary', 'Y', 103, 1, sysdate, null, null, '显示菜单'); +insert into sys_dict_data values(5, 2, '隐藏', '1', 'sys_show_hide', '', 'danger', 'N', 103, 1, sysdate, null, null, '隐藏菜单'); +insert into sys_dict_data values(6, 1, '正常', '0', 'sys_normal_disable', '', 'primary', 'Y', 103, 1, sysdate, null, null, '正常状态'); +insert into sys_dict_data values(7, 2, '停用', '1', 'sys_normal_disable', '', 'danger', 'N', 103, 1, sysdate, null, null, '停用状态'); +insert into sys_dict_data values(12, 1, '是', 'Y', 'sys_yes_no', '', 'primary', 'Y', 103, 1, sysdate, null, null, '系统默认是'); +insert into sys_dict_data values(13, 2, '否', 'N', 'sys_yes_no', '', 'danger', 'N', 103, 1, sysdate, null, null, '系统默认否'); +insert into sys_dict_data values(14, 1, '通知', '1', 'sys_notice_type', '', 'warning', 'Y', 103, 1, sysdate, null, null, '通知'); +insert into sys_dict_data values(15, 2, '公告', '2', 'sys_notice_type', '', 'success', 'N', 103, 1, sysdate, null, null, '公告'); +insert into sys_dict_data values(16, 1, '正常', '0', 'sys_notice_status', '', 'primary', 'Y', 103, 1, sysdate, null, null, '正常状态'); +insert into sys_dict_data values(17, 2, '关闭', '1', 'sys_notice_status', '', 'danger', 'N', 103, 1, sysdate, null, null, '关闭状态'); +insert into sys_dict_data values(29, 99, '其他', '0', 'sys_oper_type', '', 'info', 'N', 103, 1, sysdate, null, null, '其他操作'); +insert into sys_dict_data values(18, 1, '新增', '1', 'sys_oper_type', '', 'info', 'N', 103, 1, sysdate, null, null, '新增操作'); +insert into sys_dict_data values(19, 2, '修改', '2', 'sys_oper_type', '', 'info', 'N', 103, 1, sysdate, null, null, '修改操作'); +insert into sys_dict_data values(20, 3, '删除', '3', 'sys_oper_type', '', 'danger', 'N', 103, 1, sysdate, null, null, '删除操作'); +insert into sys_dict_data values(21, 4, '授权', '4', 'sys_oper_type', '', 'primary', 'N', 103, 1, sysdate, null, null, '授权操作'); +insert into sys_dict_data values(22, 5, '导出', '5', 'sys_oper_type', '', 'warning', 'N', 103, 1, sysdate, null, null, '导出操作'); +insert into sys_dict_data values(23, 6, '导入', '6', 'sys_oper_type', '', 'warning', 'N', 103, 1, sysdate, null, null, '导入操作'); +insert into sys_dict_data values(24, 7, '强退', '7', 'sys_oper_type', '', 'danger', 'N', 103, 1, sysdate, null, null, '强退操作'); +insert into sys_dict_data values(25, 8, '生成代码', '8', 'sys_oper_type', '', 'warning', 'N', 103, 1, sysdate, null, null, '生成操作'); +insert into sys_dict_data values(26, 9, '清空数据', '9', 'sys_oper_type', '', 'danger', 'N', 103, 1, sysdate, null, null, '清空操作'); +insert into sys_dict_data values(27, 1, '成功', '0', 'sys_common_status', '', 'primary', 'N', 103, 1, sysdate, null, null, '正常状态'); +insert into sys_dict_data values(28, 2, '失败', '1', 'sys_common_status', '', 'danger', 'N', 103, 1, sysdate, null, null, '停用状态'); +insert into sys_dict_data values(30, 0, '密码认证', 'password', 'sys_grant_type', '', 'default', 'N', 103, 1, sysdate, null, null, '密码认证'); +insert into sys_dict_data values(31, 0, '短信认证', 'sms', 'sys_grant_type', '', 'default', 'N', 103, 1, sysdate, null, null, '短信认证'); +insert into sys_dict_data values(32, 0, '邮件认证', 'email', 'sys_grant_type', '', 'default', 'N', 103, 1, sysdate, null, null, '邮件认证'); +insert into sys_dict_data values(33, 0, '小程序认证', 'xcx', 'sys_grant_type', '', 'default', 'N', 103, 1, sysdate, null, null, '小程序认证'); +insert into sys_dict_data values(34, 0, '三方登录认证', 'social', 'sys_grant_type', '', 'default', 'N', 103, 1, sysdate, null, null, '三方登录认证'); +insert into sys_dict_data values(35, 0, 'PC', 'pc', 'sys_device_type', '', 'default', 'N', 103, 1, sysdate, null, null, 'PC'); +insert into sys_dict_data values(36, 0, '安卓', 'android', 'sys_device_type', '', 'default', 'N', 103, 1, sysdate, null, null, '安卓'); +insert into sys_dict_data values(37, 0, 'iOS', 'ios', 'sys_device_type', '', 'default', 'N', 103, 1, sysdate, null, null, 'iOS'); +insert into sys_dict_data values(38, 0, '小程序', 'xcx', 'sys_device_type', '', 'default', 'N', 103, 1, sysdate, null, null, '小程序'); -- ---------------------------- @@ -937,7 +817,6 @@ insert into sys_dict_data values(38, '000000', 0, '小程序', 'xcx', -- ---------------------------- create table sys_config ( config_id number(20) not null, - tenant_id varchar2(20) default '000000', config_name varchar2(100) default '', config_key varchar2(100) default '', config_value varchar2(100) default '', @@ -953,7 +832,6 @@ alter table sys_config add constraint pk_sys_config primary key (config_id); comment on table sys_config is '参数配置表'; comment on column sys_config.config_id is '参数主键'; -comment on column sys_config.tenant_id is '租户编号'; comment on column sys_config.config_name is '参数名称'; comment on column sys_config.config_key is '参数键名'; comment on column sys_config.config_value is '参数键值'; @@ -965,11 +843,11 @@ comment on column sys_config.update_by is '更新者'; comment on column sys_config.update_time is '更新时间'; comment on column sys_config.remark is '备注'; -insert into sys_config values(1, '000000', '主框架页-默认皮肤样式名称', 'sys.index.skinName', 'skin-blue', 'Y', 103, 1, sysdate, null, null, '蓝色 skin-blue、绿色 skin-green、紫色 skin-purple、红色 skin-red、黄色 skin-yellow' ); -insert into sys_config values(2, '000000', '用户管理-账号初始密码', 'sys.user.initPassword', '123456', 'Y', 103, 1, sysdate, null, null, '初始化密码 123456' ); -insert into sys_config values(3, '000000', '主框架页-侧边栏主题', 'sys.index.sideTheme', 'theme-dark', 'Y', 103, 1, sysdate, null, null, '深色主题theme-dark,浅色主题theme-light' ); -insert into sys_config values(5, '000000', '账号自助-是否开启用户注册功能', 'sys.account.registerUser', 'false', 'Y', 103, 1, sysdate, null, null, '是否开启注册用户功能(true开启,false关闭)'); -insert into sys_config values(11, '000000', 'OSS预览列表资源开关', 'sys.oss.previewListResource', 'true', 'Y', 103, 1, sysdate, null, null, 'true:开启, false:关闭'); +insert into sys_config values(1, '主框架页-默认皮肤样式名称', 'sys.index.skinName', 'skin-blue', 'Y', 103, 1, sysdate, null, null, '蓝色 skin-blue、绿色 skin-green、紫色 skin-purple、红色 skin-red、黄色 skin-yellow' ); +insert into sys_config values(2, '用户管理-账号初始密码', 'sys.user.initPassword', '123456', 'Y', 103, 1, sysdate, null, null, '初始化密码 123456' ); +insert into sys_config values(3, '主框架页-侧边栏主题', 'sys.index.sideTheme', 'theme-dark', 'Y', 103, 1, sysdate, null, null, '深色主题theme-dark,浅色主题theme-light' ); +insert into sys_config values(5, '账号自助-是否开启用户注册功能', 'sys.account.registerUser', 'false', 'Y', 103, 1, sysdate, null, null, '是否开启注册用户功能(true开启,false关闭)'); +insert into sys_config values(11, 'OSS预览列表资源开关', 'sys.oss.previewListResource', 'true', 'Y', 103, 1, sysdate, null, null, 'true:开启, false:关闭'); -- ---------------------------- @@ -977,7 +855,6 @@ insert into sys_config values(11, '000000', 'OSS预览列表资源开关', -- ---------------------------- create table sys_logininfor ( info_id number(20) not null, - tenant_id varchar2(20) default '000000', user_name varchar2(50) default '', client_key varchar2(32) default '', device_type varchar2(32) default '', @@ -996,7 +873,6 @@ create index idx_sys_logininfor_lt on sys_logininfor (login_time); comment on table sys_logininfor is '系统访问记录'; comment on column sys_logininfor.info_id is '访问ID'; -comment on column sys_logininfor.tenant_id is '租户编号'; comment on column sys_logininfor.user_name is '登录账号'; comment on column sys_logininfor.client_key is '客户端'; comment on column sys_logininfor.device_type is '设备类型'; @@ -1014,7 +890,6 @@ comment on column sys_logininfor.login_time is '访问时间'; -- ---------------------------- create table sys_notice ( notice_id number(20) not null, - tenant_id varchar2(20) default '000000', notice_title varchar2(50) not null, notice_type char(1) not null, notice_content clob default null, @@ -1031,7 +906,6 @@ alter table sys_notice add constraint pk_sys_notice primary key (notice_id); comment on table sys_notice is '通知公告表'; comment on column sys_notice.notice_id is '公告主键'; -comment on column sys_notice.tenant_id is '租户编号'; comment on column sys_notice.notice_title is '公告标题'; comment on column sys_notice.notice_type is '公告类型(1通知 2公告)'; comment on column sys_notice.notice_content is '公告内容'; @@ -1046,8 +920,8 @@ comment on column sys_notice.remark is '备注'; -- ---------------------------- -- 初始化-公告信息表数据 -- ---------------------------- -insert into sys_notice values('1', '000000', '温馨提醒:2018-07-01 新版本发布啦', '2', '新版本内容', '0', 103, 1, sysdate, null, null, '管理员'); -insert into sys_notice values('2', '000000', '维护通知:2018-07-01 系统凌晨维护', '1', '维护内容', '0', 103, 1, sysdate, null, null, '管理员'); +insert into sys_notice values('1', '温馨提醒:2018-07-01 新版本发布啦', '2', '新版本内容', '0', 103, 1, sysdate, null, null, '管理员'); +insert into sys_notice values('2', '维护通知:2018-07-01 系统凌晨维护', '1', '维护内容', '0', 103, 1, sysdate, null, null, '管理员'); -- ---------------------------- @@ -1167,7 +1041,6 @@ comment on column gen_table_column.update_time is '更新时间'; -- ---------------------------- create table sys_oss ( oss_id number(20) not null, - tenant_id varchar2(20) default '000000', file_name varchar2(255) not null, original_name varchar2(255) not null, file_suffix varchar2(10) not null, @@ -1185,7 +1058,6 @@ alter table sys_oss add constraint pk_sys_oss primary key (oss_id); comment on table sys_oss is 'OSS对象存储表'; comment on column sys_oss.oss_id is '对象存储主键'; -comment on column sys_oss.tenant_id is '租户编码'; comment on column sys_oss.file_name is '文件名'; comment on column sys_oss.original_name is '原名'; comment on column sys_oss.file_suffix is '文件后缀名'; @@ -1204,7 +1076,6 @@ comment on column sys_oss.update_by is '更新者'; -- ---------------------------- create table sys_oss_config ( oss_config_id number(20) not null, - tenant_id varchar2(20) default '000000', config_key varchar2(20) not null, access_key varchar2(255) default '', secret_key varchar2(255) default '', @@ -1229,7 +1100,6 @@ alter table sys_oss_config add constraint pk_sys_oss_config primary key (oss_con comment on table sys_oss_config is '对象存储配置表'; comment on column sys_oss_config.oss_config_id is '主键'; -comment on column sys_oss_config.tenant_id is '租户编码'; comment on column sys_oss_config.config_key is '配置key'; comment on column sys_oss_config.access_key is 'accesskey'; comment on column sys_oss_config.secret_key is '秘钥'; @@ -1249,11 +1119,11 @@ comment on column sys_oss_config.create_time is '创建时间'; comment on column sys_oss_config.update_by is '更新者'; comment on column sys_oss_config.update_time is '更新时间'; -insert into sys_oss_config values (1, '000000', 'minio', 'ruoyi', 'ruoyi123', 'ruoyi', '', '127.0.0.1:9000', '','N', '', '1', '0', '', NULL, 103, 1, sysdate, 1, sysdate); -insert into sys_oss_config values (2, '000000', 'qiniu', 'XXXXXXXXXXXXXXX', 'XXXXXXXXXXXXXXX', 'ruoyi', '', 's3-cn-north-1.qiniucs.com', '','N', '', '1', '1', '', NULL, 103, 1, sysdate, 1, sysdate); -insert into sys_oss_config values (3, '000000', 'aliyun', 'XXXXXXXXXXXXXXX', 'XXXXXXXXXXXXXXX', 'ruoyi', '', 'oss-cn-beijing.aliyuncs.com', '','N', '', '1', '1', '', NULL, 103, 1, sysdate, 1, sysdate); -insert into sys_oss_config values (4, '000000', 'qcloud', 'XXXXXXXXXXXXXXX', 'XXXXXXXXXXXXXXX', 'ruoyi-1250000000', '', 'cos.ap-beijing.myqcloud.com', '','N', 'ap-beijing', '1', '1', '', NULL, 103, 1, sysdate, 1, sysdate); -insert into sys_oss_config values (5, '000000', 'image', 'ruoyi', 'ruoyi123', 'ruoyi', 'image', '127.0.0.1:9000', '','N', '', '1', '1', '', NULL, 103, 1, sysdate, 1, sysdate); +insert into sys_oss_config values (1, 'minio', 'ruoyi', 'ruoyi123', 'ruoyi', '', '127.0.0.1:9000', '','N', '', '1', '0', '', NULL, 103, 1, sysdate, 1, sysdate); +insert into sys_oss_config values (2, 'qiniu', 'XXXXXXXXXXXXXXX', 'XXXXXXXXXXXXXXX', 'ruoyi', '', 's3-cn-north-1.qiniucs.com', '','N', '', '1', '1', '', NULL, 103, 1, sysdate, 1, sysdate); +insert into sys_oss_config values (3, 'aliyun', 'XXXXXXXXXXXXXXX', 'XXXXXXXXXXXXXXX', 'ruoyi', '', 'oss-cn-beijing.aliyuncs.com', '','N', '', '1', '1', '', NULL, 103, 1, sysdate, 1, sysdate); +insert into sys_oss_config values (4, 'qcloud', 'XXXXXXXXXXXXXXX', 'XXXXXXXXXXXXXXX', 'ruoyi-1250000000', '', 'cos.ap-beijing.myqcloud.com', '','N', 'ap-beijing', '1', '1', '', NULL, 103, 1, sysdate, 1, sysdate); +insert into sys_oss_config values (5, 'image', 'ruoyi', 'ruoyi123', 'ruoyi', 'image', '127.0.0.1:9000', '','N', '', '1', '1', '', NULL, 103, 1, sysdate, 1, sysdate); -- ---------------------------- -- 系统授权表 @@ -1300,7 +1170,6 @@ insert into sys_client values (2, '428a8310cd442757ae699df5d894f051', 'app', 'ap create table test_demo ( id number(20) not null, - tenant_id varchar2(20) default '000000', dept_id number(20) default null, user_id number(20) default null, order_num number(10) default 0, @@ -1319,7 +1188,6 @@ alter table test_demo add constraint pk_test_demo primary key (id); comment on table test_demo is '测试单表'; comment on column test_demo.id is '主键'; -comment on column test_demo.tenant_id is '租户编号'; comment on column test_demo.dept_id is '部门id'; comment on column test_demo.user_id is '用户id'; comment on column test_demo.order_num is '排序号'; @@ -1335,7 +1203,6 @@ comment on column test_demo.del_flag is '删除标志'; create table test_tree ( id number(20) not null, - tenant_id varchar2(20) default '000000', parent_id number(20) default 0, dept_id number(20) default null, user_id number(20) default null, @@ -1353,7 +1220,6 @@ alter table test_tree add constraint pk_test_tree primary key (id); comment on table test_tree is '测试树表'; comment on column test_tree.id is '主键'; -comment on column test_tree.tenant_id is '租户编号'; comment on column test_tree.parent_id is '父id'; comment on column test_tree.dept_id is '部门id'; comment on column test_tree.user_id is '用户id'; @@ -1366,33 +1232,33 @@ comment on column test_tree.update_time is '更新时间'; comment on column test_tree.update_by is '更新人'; comment on column test_tree.del_flag is '删除标志'; -insert into test_demo values (1, '000000', 102, 4, 1, '测试数据权限', '测试', 0, 103, sysdate, 1, null, null, 0); -insert into test_demo values (2, '000000', 102, 3, 2, '子节点1', '111', 0, 103, sysdate, 1, null, null, 0); -insert into test_demo values (3, '000000', 102, 3, 3, '子节点2', '222', 0, 103, sysdate, 1, null, null, 0); -insert into test_demo values (4, '000000', 108, 4, 4, '测试数据', 'demo', 0, 103, sysdate, 1, null, null, 0); -insert into test_demo values (5, '000000', 108, 3, 13, '子节点11', '1111', 0, 103, sysdate, 1, null, null, 0); -insert into test_demo values (6, '000000', 108, 3, 12, '子节点22', '2222', 0, 103, sysdate, 1, null, null, 0); -insert into test_demo values (7, '000000', 108, 3, 11, '子节点33', '3333', 0, 103, sysdate, 1, null, null, 0); -insert into test_demo values (8, '000000', 108, 3, 10, '子节点44', '4444', 0, 103, sysdate, 1, null, null, 0); -insert into test_demo values (9, '000000', 108, 3, 9, '子节点55', '5555', 0, 103, sysdate, 1, null, null, 0); -insert into test_demo values (10, '000000', 108, 3, 8, '子节点66', '6666', 0, 103, sysdate, 1, null, null, 0); -insert into test_demo values (11, '000000', 108, 3, 7, '子节点77', '7777', 0, 103, sysdate, 1, null, null, 0); -insert into test_demo values (12, '000000', 108, 3, 6, '子节点88', '8888', 0, 103, sysdate, 1, null, null, 0); -insert into test_demo values (13, '000000', 108, 3, 5, '子节点99', '9999', 0, 103, sysdate, 1, null, null, 0); +insert into test_demo values (1, 102, 4, 1, '测试数据权限', '测试', 0, 103, sysdate, 1, null, null, 0); +insert into test_demo values (2, 102, 3, 2, '子节点1', '111', 0, 103, sysdate, 1, null, null, 0); +insert into test_demo values (3, 102, 3, 3, '子节点2', '222', 0, 103, sysdate, 1, null, null, 0); +insert into test_demo values (4, 108, 4, 4, '测试数据', 'demo', 0, 103, sysdate, 1, null, null, 0); +insert into test_demo values (5, 108, 3, 13, '子节点11', '1111', 0, 103, sysdate, 1, null, null, 0); +insert into test_demo values (6, 108, 3, 12, '子节点22', '2222', 0, 103, sysdate, 1, null, null, 0); +insert into test_demo values (7, 108, 3, 11, '子节点33', '3333', 0, 103, sysdate, 1, null, null, 0); +insert into test_demo values (8, 108, 3, 10, '子节点44', '4444', 0, 103, sysdate, 1, null, null, 0); +insert into test_demo values (9, 108, 3, 9, '子节点55', '5555', 0, 103, sysdate, 1, null, null, 0); +insert into test_demo values (10, 108, 3, 8, '子节点66', '6666', 0, 103, sysdate, 1, null, null, 0); +insert into test_demo values (11, 108, 3, 7, '子节点77', '7777', 0, 103, sysdate, 1, null, null, 0); +insert into test_demo values (12, 108, 3, 6, '子节点88', '8888', 0, 103, sysdate, 1, null, null, 0); +insert into test_demo values (13, 108, 3, 5, '子节点99', '9999', 0, 103, sysdate, 1, null, null, 0); -insert into test_tree values (1, '000000', 0, 102, 4, '测试数据权限', 0, 103, sysdate, 1, null, null, 0); -insert into test_tree values (2, '000000', 1, 102, 3, '子节点1', 0, 103, sysdate, 1, null, null, 0); -insert into test_tree values (3, '000000', 2, 102, 3, '子节点2', 0, 103, sysdate, 1, null, null, 0); -insert into test_tree values (4, '000000', 0, 108, 4, '测试树1', 0, 103, sysdate, 1, null, null, 0); -insert into test_tree values (5, '000000', 4, 108, 3, '子节点11', 0, 103, sysdate, 1, null, null, 0); -insert into test_tree values (6, '000000', 4, 108, 3, '子节点22', 0, 103, sysdate, 1, null, null, 0); -insert into test_tree values (7, '000000', 4, 108, 3, '子节点33', 0, 103, sysdate, 1, null, null, 0); -insert into test_tree values (8, '000000', 5, 108, 3, '子节点44', 0, 103, sysdate, 1, null, null, 0); -insert into test_tree values (9, '000000', 6, 108, 3, '子节点55', 0, 103, sysdate, 1, null, null, 0); -insert into test_tree values (10, '000000', 7, 108, 3, '子节点66', 0, 103, sysdate, 1, null, null, 0); -insert into test_tree values (11, '000000', 7, 108, 3, '子节点77', 0, 103, sysdate, 1, null, null, 0); -insert into test_tree values (12, '000000', 10, 108, 3, '子节点88', 0, 103, sysdate, 1, null, null, 0); -insert into test_tree values (13, '000000', 10, 108, 3, '子节点99', 0, 103, sysdate, 1, null, null, 0); +insert into test_tree values (1, 0, 102, 4, '测试数据权限', 0, 103, sysdate, 1, null, null, 0); +insert into test_tree values (2, 1, 102, 3, '子节点1', 0, 103, sysdate, 1, null, null, 0); +insert into test_tree values (3, 2, 102, 3, '子节点2', 0, 103, sysdate, 1, null, null, 0); +insert into test_tree values (4, 0, 108, 4, '测试树1', 0, 103, sysdate, 1, null, null, 0); +insert into test_tree values (5, 4, 108, 3, '子节点11', 0, 103, sysdate, 1, null, null, 0); +insert into test_tree values (6, 4, 108, 3, '子节点22', 0, 103, sysdate, 1, null, null, 0); +insert into test_tree values (7, 4, 108, 3, '子节点33', 0, 103, sysdate, 1, null, null, 0); +insert into test_tree values (8, 5, 108, 3, '子节点44', 0, 103, sysdate, 1, null, null, 0); +insert into test_tree values (9, 6, 108, 3, '子节点55', 0, 103, sysdate, 1, null, null, 0); +insert into test_tree values (10, 7, 108, 3, '子节点66', 0, 103, sysdate, 1, null, null, 0); +insert into test_tree values (11, 7, 108, 3, '子节点77', 0, 103, sysdate, 1, null, null, 0); +insert into test_tree values (12, 10, 108, 3, '子节点88', 0, 103, sysdate, 1, null, null, 0); +insert into test_tree values (13, 10, 108, 3, '子节点99', 0, 103, sysdate, 1, null, null, 0); -- ---------------------------- diff --git a/script/sql/oracle/oracle_ry_workflow.sql b/script/sql/oracle/oracle_ry_workflow.sql index 7f5ab22fa..1001578bd 100644 --- a/script/sql/oracle/oracle_ry_workflow.sql +++ b/script/sql/oracle/oracle_ry_workflow.sql @@ -345,16 +345,16 @@ COMMENT ON COLUMN flow_category.create_time IS '创建时间'; COMMENT ON COLUMN flow_category.update_by IS '更新者'; COMMENT ON COLUMN flow_category.update_time IS '更新时间'; -INSERT INTO flow_category VALUES (100, '000000', 0, '0', 'OA审批', 0, '0', 103, 1, SYSDATE, NULL, NULL); -INSERT INTO flow_category VALUES (101, '000000', 100, '0,100', '假勤管理', 0, '0', 103, 1, SYSDATE, NULL, NULL); -INSERT INTO flow_category VALUES (102, '000000', 100, '0,100', '人事管理', 1, '0', 103, 1, SYSDATE, NULL, NULL); -INSERT INTO flow_category VALUES (103, '000000', 101, '0,100,101', '请假', 0, '0', 103, 1, SYSDATE, NULL, NULL); -INSERT INTO flow_category VALUES (104, '000000', 101, '0,100,101', '出差', 1, '0', 103, 1, SYSDATE, NULL, NULL); -INSERT INTO flow_category VALUES (105, '000000', 101, '0,100,101', '加班', 2, '0', 103, 1, SYSDATE, NULL, NULL); -INSERT INTO flow_category VALUES (106, '000000', 101, '0,100,101', '换班', 3, '0', 103, 1, SYSDATE, NULL, NULL); -INSERT INTO flow_category VALUES (107, '000000', 101, '0,100,101', '外出', 4, '0', 103, 1, SYSDATE, NULL, NULL); -INSERT INTO flow_category VALUES (108, '000000', 102, '0,100,102', '转正', 1, '0', 103, 1, SYSDATE, NULL, NULL); -INSERT INTO flow_category VALUES (109, '000000', 102, '0,100,102', '离职', 2, '0', 103, 1, SYSDATE, NULL, NULL); +INSERT INTO flow_category VALUES (100, 0, '0', 'OA审批', 0, '0', 103, 1, SYSDATE, NULL, NULL); +INSERT INTO flow_category VALUES (101, 100, '0,100', '假勤管理', 0, '0', 103, 1, SYSDATE, NULL, NULL); +INSERT INTO flow_category VALUES (102, 100, '0,100', '人事管理', 1, '0', 103, 1, SYSDATE, NULL, NULL); +INSERT INTO flow_category VALUES (103, 101, '0,100,101', '请假', 0, '0', 103, 1, SYSDATE, NULL, NULL); +INSERT INTO flow_category VALUES (104, 101, '0,100,101', '出差', 1, '0', 103, 1, SYSDATE, NULL, NULL); +INSERT INTO flow_category VALUES (105, 101, '0,100,101', '加班', 2, '0', 103, 1, SYSDATE, NULL, NULL); +INSERT INTO flow_category VALUES (106, 101, '0,100,101', '换班', 3, '0', 103, 1, SYSDATE, NULL, NULL); +INSERT INTO flow_category VALUES (107, 101, '0,100,101', '外出', 4, '0', 103, 1, SYSDATE, NULL, NULL); +INSERT INTO flow_category VALUES (108, 102, '0,100,102', '转正', 1, '0', 103, 1, SYSDATE, NULL, NULL); +INSERT INTO flow_category VALUES (109, 102, '0,100,102', '离职', 2, '0', 103, 1, SYSDATE, NULL, NULL); -- ---------------------------- -- 流程spel表达式定义表 @@ -502,27 +502,27 @@ INSERT INTO sys_menu VALUES ('11641', '请假申请修改', '11638', '3', '#', ' INSERT INTO sys_menu VALUES ('11642', '请假申请删除', '11638', '4', '#', '', '', '1', '0', 'F', '0', '0', 'workflow:leave:remove', '#', 103, 1, SYSDATE, NULL, NULL, ''); INSERT INTO sys_menu VALUES ('11643', '请假申请导出', '11638', '5', '#', '', '', '1', '0', 'F', '0', '0', 'workflow:leave:export', '#', 103, 1, SYSDATE, NULL, NULL, ''); -INSERT INTO sys_dict_type VALUES (13, '000000', '业务状态', 'wf_business_status', 103, 1, SYSDATE, NULL, NULL, '业务状态列表'); -INSERT INTO sys_dict_type VALUES (14, '000000', '表单类型', 'wf_form_type', 103, 1, SYSDATE, NULL, NULL, '表单类型列表'); -INSERT INTO sys_dict_type VALUES (15, '000000', '任务状态', 'wf_task_status', 103, 1, SYSDATE, NULL, NULL, '任务状态'); -INSERT INTO sys_dict_data VALUES (39, '000000', 1, '已撤销', 'cancel', 'wf_business_status', '', 'danger', 'N', 103, 1, SYSDATE, NULL, NULL, '已撤销'); -INSERT INTO sys_dict_data VALUES (40, '000000', 2, '草稿', 'draft', 'wf_business_status', '', 'info', 'N', 103, 1, SYSDATE, NULL, NULL, '草稿'); -INSERT INTO sys_dict_data VALUES (41, '000000', 3, '待审核', 'waiting', 'wf_business_status', '', 'primary', 'N', 103, 1, SYSDATE, NULL, NULL, '待审核'); -INSERT INTO sys_dict_data VALUES (42, '000000', 4, '已完成', 'finish', 'wf_business_status', '', 'success', 'N', 103, 1, SYSDATE, NULL, NULL, '已完成'); -INSERT INTO sys_dict_data VALUES (43, '000000', 5, '已作废', 'invalid', 'wf_business_status', '', 'danger', 'N', 103, 1, SYSDATE, NULL, NULL, '已作废'); -INSERT INTO sys_dict_data VALUES (44, '000000', 6, '已退回', 'back', 'wf_business_status', '', 'danger', 'N', 103, 1, SYSDATE, NULL, NULL, '已退回'); -INSERT INTO sys_dict_data VALUES (45, '000000', 7, '已终止', 'termination', 'wf_business_status', '', 'danger', 'N', 103, 1, SYSDATE, NULL, NULL, '已终止'); -INSERT INTO sys_dict_data VALUES (46, '000000', 1, '自定义表单', 'static', 'wf_form_type', '', 'success', 'N', 103, 1, SYSDATE, NULL, NULL, '自定义表单'); -INSERT INTO sys_dict_data VALUES (47, '000000', 2, '动态表单', 'dynamic', 'wf_form_type', '', 'primary', 'N', 103, 1, SYSDATE, NULL, NULL, '动态表单'); -INSERT INTO sys_dict_data VALUES (48, '000000', 1, '撤销', 'cancel', 'wf_task_status', '', 'danger', 'N', 103, 1, SYSDATE, NULL, NULL, '撤销'); -INSERT INTO sys_dict_data VALUES (49, '000000', 2, '通过', 'pass', 'wf_task_status', '', 'success', 'N', 103, 1, SYSDATE, NULL, NULL, '通过'); -INSERT INTO sys_dict_data VALUES (50, '000000', 3, '待审核', 'waiting', 'wf_task_status', '', 'primary', 'N', 103, 1, SYSDATE, NULL, NULL, '待审核'); -INSERT INTO sys_dict_data VALUES (51, '000000', 4, '作废', 'invalid', 'wf_task_status', '', 'danger', 'N', 103, 1, SYSDATE, NULL, NULL, '作废'); -INSERT INTO sys_dict_data VALUES (52, '000000', 5, '退回', 'back', 'wf_task_status', '', 'danger', 'N', 103, 1, SYSDATE, NULL, NULL, '退回'); -INSERT INTO sys_dict_data VALUES (53, '000000', 6, '终止', 'termination', 'wf_task_status', '', 'danger', 'N', 103, 1, SYSDATE, NULL, NULL, '终止'); -INSERT INTO sys_dict_data VALUES (54, '000000', 7, '转办', 'transfer', 'wf_task_status', '', 'primary', 'N', 103, 1, SYSDATE, NULL, NULL, '转办'); -INSERT INTO sys_dict_data VALUES (55, '000000', 8, '委托', 'depute', 'wf_task_status', '', 'primary', 'N', 103, 1, SYSDATE, NULL, NULL, '委托'); -INSERT INTO sys_dict_data VALUES (56, '000000', 9, '抄送', 'copy', 'wf_task_status', '', 'primary', 'N', 103, 1, SYSDATE, NULL, NULL, '抄送'); -INSERT INTO sys_dict_data VALUES (57, '000000', 10, '加签', 'sign', 'wf_task_status', '', 'primary', 'N', 103, 1, SYSDATE, NULL, NULL, '加签'); -INSERT INTO sys_dict_data VALUES (58, '000000', 11, '减签', 'sign_off', 'wf_task_status', '', 'danger', 'N', 103, 1, SYSDATE, NULL, NULL, '减签'); -INSERT INTO sys_dict_data VALUES (59, '000000', 11, '超时', 'timeout', 'wf_task_status', '', 'danger', 'N', 103, 1, SYSDATE, NULL, NULL, '超时'); +INSERT INTO sys_dict_type VALUES (13, '业务状态', 'wf_business_status', 103, 1, SYSDATE, NULL, NULL, '业务状态列表'); +INSERT INTO sys_dict_type VALUES (14, '表单类型', 'wf_form_type', 103, 1, SYSDATE, NULL, NULL, '表单类型列表'); +INSERT INTO sys_dict_type VALUES (15, '任务状态', 'wf_task_status', 103, 1, SYSDATE, NULL, NULL, '任务状态'); +INSERT INTO sys_dict_data VALUES (39, 1, '已撤销', 'cancel', 'wf_business_status', '', 'danger', 'N', 103, 1, SYSDATE, NULL, NULL, '已撤销'); +INSERT INTO sys_dict_data VALUES (40, 2, '草稿', 'draft', 'wf_business_status', '', 'info', 'N', 103, 1, SYSDATE, NULL, NULL, '草稿'); +INSERT INTO sys_dict_data VALUES (41, 3, '待审核', 'waiting', 'wf_business_status', '', 'primary', 'N', 103, 1, SYSDATE, NULL, NULL, '待审核'); +INSERT INTO sys_dict_data VALUES (42, 4, '已完成', 'finish', 'wf_business_status', '', 'success', 'N', 103, 1, SYSDATE, NULL, NULL, '已完成'); +INSERT INTO sys_dict_data VALUES (43, 5, '已作废', 'invalid', 'wf_business_status', '', 'danger', 'N', 103, 1, SYSDATE, NULL, NULL, '已作废'); +INSERT INTO sys_dict_data VALUES (44, 6, '已退回', 'back', 'wf_business_status', '', 'danger', 'N', 103, 1, SYSDATE, NULL, NULL, '已退回'); +INSERT INTO sys_dict_data VALUES (45, 7, '已终止', 'termination', 'wf_business_status', '', 'danger', 'N', 103, 1, SYSDATE, NULL, NULL, '已终止'); +INSERT INTO sys_dict_data VALUES (46, 1, '自定义表单', 'static', 'wf_form_type', '', 'success', 'N', 103, 1, SYSDATE, NULL, NULL, '自定义表单'); +INSERT INTO sys_dict_data VALUES (47, 2, '动态表单', 'dynamic', 'wf_form_type', '', 'primary', 'N', 103, 1, SYSDATE, NULL, NULL, '动态表单'); +INSERT INTO sys_dict_data VALUES (48, 1, '撤销', 'cancel', 'wf_task_status', '', 'danger', 'N', 103, 1, SYSDATE, NULL, NULL, '撤销'); +INSERT INTO sys_dict_data VALUES (49, 2, '通过', 'pass', 'wf_task_status', '', 'success', 'N', 103, 1, SYSDATE, NULL, NULL, '通过'); +INSERT INTO sys_dict_data VALUES (50, 3, '待审核', 'waiting', 'wf_task_status', '', 'primary', 'N', 103, 1, SYSDATE, NULL, NULL, '待审核'); +INSERT INTO sys_dict_data VALUES (51, 4, '作废', 'invalid', 'wf_task_status', '', 'danger', 'N', 103, 1, SYSDATE, NULL, NULL, '作废'); +INSERT INTO sys_dict_data VALUES (52, 5, '退回', 'back', 'wf_task_status', '', 'danger', 'N', 103, 1, SYSDATE, NULL, NULL, '退回'); +INSERT INTO sys_dict_data VALUES (53, 6, '终止', 'termination', 'wf_task_status', '', 'danger', 'N', 103, 1, SYSDATE, NULL, NULL, '终止'); +INSERT INTO sys_dict_data VALUES (54, 7, '转办', 'transfer', 'wf_task_status', '', 'primary', 'N', 103, 1, SYSDATE, NULL, NULL, '转办'); +INSERT INTO sys_dict_data VALUES (55, 8, '委托', 'depute', 'wf_task_status', '', 'primary', 'N', 103, 1, SYSDATE, NULL, NULL, '委托'); +INSERT INTO sys_dict_data VALUES (56, 9, '抄送', 'copy', 'wf_task_status', '', 'primary', 'N', 103, 1, SYSDATE, NULL, NULL, '抄送'); +INSERT INTO sys_dict_data VALUES (57, 10, '加签', 'sign', 'wf_task_status', '', 'primary', 'N', 103, 1, SYSDATE, NULL, NULL, '加签'); +INSERT INTO sys_dict_data VALUES (58, 11, '减签', 'sign_off', 'wf_task_status', '', 'danger', 'N', 103, 1, SYSDATE, NULL, NULL, '减签'); +INSERT INTO sys_dict_data VALUES (59, 11, '超时', 'timeout', 'wf_task_status', '', 'danger', 'N', 103, 1, SYSDATE, NULL, NULL, '超时'); diff --git a/script/sql/postgres/postgres_ry_vue_5.X.sql b/script/sql/postgres/postgres_ry_vue_5.X.sql index bb127f9e2..6dd917cb9 100644 --- a/script/sql/postgres/postgres_ry_vue_5.X.sql +++ b/script/sql/postgres/postgres_ry_vue_5.X.sql @@ -5,7 +5,6 @@ create table sys_social ( id int8 not null, user_id int8 not null, - tenant_id varchar(20) default '000000'::varchar, auth_id varchar(255) not null, source varchar(255) not null, open_id varchar(255) default null::varchar, @@ -38,7 +37,6 @@ create table sys_social comment on table sys_social is '社会化关系表'; comment on column sys_social.id is '主键'; comment on column sys_social.user_id is '用户ID'; -comment on column sys_social.tenant_id is '租户id'; comment on column sys_social.auth_id is '平台+平台唯一id'; comment on column sys_social.source is '用户来源'; comment on column sys_social.open_id is '平台编号唯一id'; @@ -66,106 +64,12 @@ comment on column sys_social.update_by is '更新者'; comment on column sys_social.update_time is '更新时间'; comment on column sys_social.del_flag is '删除标志(0代表存在 1代表删除)'; --- ---------------------------- --- 租户表 --- ---------------------------- -create table if not exists sys_tenant -( - id int8, - tenant_id varchar(20) not null, - contact_user_name varchar(20) default null::varchar, - contact_phone varchar(20) default null::varchar, - company_name varchar(30) default null::varchar, - license_number varchar(30) default null::varchar, - address varchar(200) default null::varchar, - intro varchar(200) default null::varchar, - domain varchar(200) default null::varchar, - remark varchar(200) default null::varchar, - package_id int8, - expire_time timestamp, - account_count int4 default -1, - status char default '0'::bpchar, - del_flag char default '0'::bpchar, - create_dept int8, - create_by int8, - create_time timestamp, - update_by int8, - update_time timestamp, - constraint "pk_sys_tenant" primary key (id) -); - - -comment on table sys_tenant is '租户表'; -comment on column sys_tenant.tenant_id is '租户编号'; -comment on column sys_tenant.contact_phone is '联系电话'; -comment on column sys_tenant.company_name is '企业名称'; -comment on column sys_tenant.company_name is '联系人'; -comment on column sys_tenant.license_number is '统一社会信用代码'; -comment on column sys_tenant.address is '地址'; -comment on column sys_tenant.intro is '企业简介'; -comment on column sys_tenant.domain is '域名'; -comment on column sys_tenant.remark is '备注'; -comment on column sys_tenant.package_id is '租户套餐编号'; -comment on column sys_tenant.expire_time is '过期时间'; -comment on column sys_tenant.account_count is '用户数量(-1不限制)'; -comment on column sys_tenant.status is '租户状态(0正常 1停用)'; -comment on column sys_tenant.del_flag is '删除标志(0代表存在 1代表删除)'; -comment on column sys_tenant.create_dept is '创建部门'; -comment on column sys_tenant.create_by is '创建者'; -comment on column sys_tenant.create_time is '创建时间'; -comment on column sys_tenant.update_by is '更新者'; -comment on column sys_tenant.update_time is '更新时间'; - - --- ---------------------------- --- 初始化-租户表数据 --- ---------------------------- - -insert into sys_tenant values(1, '000000', '管理组', '15888888888', 'XXX有限公司', null, null, '多租户通用后台管理管理系统', null, null, null, null, -1, '0', '0', 103, 1, now(), null, null); - - --- ---------------------------- --- 租户套餐表 --- ---------------------------- -create table if not exists sys_tenant_package -( - package_id int8, - package_name varchar(20) default ''::varchar, - menu_ids varchar(3000) default ''::varchar, - remark varchar(200) default ''::varchar, - menu_check_strictly bool default true, - status char default '0'::bpchar, - del_flag char default '0'::bpchar, - create_dept int8, - create_by int8, - create_time timestamp, - update_by int8, - update_time timestamp, - constraint "pk_sys_tenant_package" primary key (package_id) -); - - -comment on table sys_tenant_package is '租户套餐表'; -comment on column sys_tenant_package.package_id is '租户套餐id'; -comment on column sys_tenant_package.package_name is '套餐名称'; -comment on column sys_tenant_package.menu_ids is '关联菜单id'; -comment on column sys_tenant_package.remark is '备注'; -comment on column sys_tenant_package.status is '状态(0正常 1停用)'; -comment on column sys_tenant_package.del_flag is '删除标志(0代表存在 1代表删除)'; -comment on column sys_tenant_package.create_dept is '创建部门'; -comment on column sys_tenant_package.create_by is '创建者'; -comment on column sys_tenant_package.create_time is '创建时间'; -comment on column sys_tenant_package.update_by is '更新者'; -comment on column sys_tenant_package.update_time is '更新时间'; - - -- ---------------------------- -- 1、部门表 -- ---------------------------- create table if not exists sys_dept ( dept_id int8, - tenant_id varchar(20) default '000000'::varchar, parent_id int8 default 0, ancestors varchar(500)default ''::varchar, dept_name varchar(30) default ''::varchar, @@ -186,7 +90,6 @@ create table if not exists sys_dept comment on table sys_dept is '部门表'; comment on column sys_dept.dept_id is '部门ID'; -comment on column sys_dept.tenant_id is '租户编号'; comment on column sys_dept.parent_id is '父部门ID'; comment on column sys_dept.ancestors is '祖级列表'; comment on column sys_dept.dept_name is '部门名称'; @@ -206,16 +109,16 @@ comment on column sys_dept.update_time is '更新时间'; -- ---------------------------- -- 初始化-部门表数据 -- ---------------------------- -insert into sys_dept values(100, '000000', 0, '0', 'XXX科技', null,0, null, '15888888888', 'xxx@qq.com', '0', '0', 103, 1, now(), null, null); -insert into sys_dept values(101, '000000', 100, '0,100', '深圳总公司', null,1, null, '15888888888', 'xxx@qq.com', '0', '0', 103, 1, now(), null, null); -insert into sys_dept values(102, '000000', 100, '0,100', '长沙分公司', null,2, null, '15888888888', 'xxx@qq.com', '0', '0', 103, 1, now(), null, null); -insert into sys_dept values(103, '000000', 101, '0,100,101', '研发部门', null,1, 1, '15888888888', 'xxx@qq.com', '0', '0', 103, 1, now(), null, null); -insert into sys_dept values(104, '000000', 101, '0,100,101', '市场部门', null,2, null, '15888888888', 'xxx@qq.com', '0', '0', 103, 1, now(), null, null); -insert into sys_dept values(105, '000000', 101, '0,100,101', '测试部门', null,3, null, '15888888888', 'xxx@qq.com', '0', '0', 103, 1, now(), null, null); -insert into sys_dept values(106, '000000', 101, '0,100,101', '财务部门', null,4, null, '15888888888', 'xxx@qq.com', '0', '0', 103, 1, now(), null, null); -insert into sys_dept values(107, '000000', 101, '0,100,101', '运维部门', null,5, null, '15888888888', 'xxx@qq.com', '0', '0', 103, 1, now(), null, null); -insert into sys_dept values(108, '000000', 102, '0,100,102', '市场部门', null,1, null, '15888888888', 'xxx@qq.com', '0', '0', 103, 1, now(), null, null); -insert into sys_dept values(109, '000000', 102, '0,100,102', '财务部门', null,2, null, '15888888888', 'xxx@qq.com', '0', '0', 103, 1, now(), null, null); +insert into sys_dept values(100, 0, '0', 'XXX科技', null,0, null, '15888888888', 'xxx@qq.com', '0', '0', 103, 1, now(), null, null); +insert into sys_dept values(101, 100, '0,100', '深圳总公司', null,1, null, '15888888888', 'xxx@qq.com', '0', '0', 103, 1, now(), null, null); +insert into sys_dept values(102, 100, '0,100', '长沙分公司', null,2, null, '15888888888', 'xxx@qq.com', '0', '0', 103, 1, now(), null, null); +insert into sys_dept values(103, 101, '0,100,101', '研发部门', null,1, 1, '15888888888', 'xxx@qq.com', '0', '0', 103, 1, now(), null, null); +insert into sys_dept values(104, 101, '0,100,101', '市场部门', null,2, null, '15888888888', 'xxx@qq.com', '0', '0', 103, 1, now(), null, null); +insert into sys_dept values(105, 101, '0,100,101', '测试部门', null,3, null, '15888888888', 'xxx@qq.com', '0', '0', 103, 1, now(), null, null); +insert into sys_dept values(106, 101, '0,100,101', '财务部门', null,4, null, '15888888888', 'xxx@qq.com', '0', '0', 103, 1, now(), null, null); +insert into sys_dept values(107, 101, '0,100,101', '运维部门', null,5, null, '15888888888', 'xxx@qq.com', '0', '0', 103, 1, now(), null, null); +insert into sys_dept values(108, 102, '0,100,102', '市场部门', null,1, null, '15888888888', 'xxx@qq.com', '0', '0', 103, 1, now(), null, null); +insert into sys_dept values(109, 102, '0,100,102', '财务部门', null,2, null, '15888888888', 'xxx@qq.com', '0', '0', 103, 1, now(), null, null); -- ---------------------------- -- 2、用户信息表 @@ -223,7 +126,6 @@ insert into sys_dept values(109, '000000', 102, '0,100,102', '财务部门', create table if not exists sys_user ( user_id int8, - tenant_id varchar(20) default '000000'::varchar, dept_id int8, user_name varchar(30) not null, nick_name varchar(30) not null, @@ -248,7 +150,6 @@ create table if not exists sys_user comment on table sys_user is '用户信息表'; comment on column sys_user.user_id is '用户ID'; -comment on column sys_user.tenant_id is '租户编号'; comment on column sys_user.dept_id is '部门ID'; comment on column sys_user.user_name is '用户账号'; comment on column sys_user.nick_name is '用户昵称'; @@ -273,9 +174,9 @@ comment on column sys_user.remark is '备注'; -- 初始化-用户信息表数据 -- ---------------------------- -insert into sys_user values(1, '000000', 103, 'admin', '疯狂的狮子Li', 'sys_user', 'crazyLionLi@163.com', '15888888888', '1', null, '$2a$10$7JB720yubVSZvUI0rEqK/.VqGOZTH.ulu33dHOiBE8ByOhJIrdAu2', '0', '0', '127.0.0.1', now(), 103, 1, now(), null, null, '管理员'); -insert into sys_user VALUES(3, '000000', 108, 'test', '本部门及以下 密码666666', 'sys_user', '', '', '0', null, '$2a$10$b8yUzN0C71sbz.PhNOCgJe.Tu1yWC3RNrTyjSQ8p1W0.aaUXUJ.Ne', '0', '0', '127.0.0.1', now(), 103, 1, now(), 3, now(), NULL); -insert into sys_user VALUES(4, '000000', 102, 'test1', '仅本人 密码666666', 'sys_user', '', '', '0', null, '$2a$10$b8yUzN0C71sbz.PhNOCgJe.Tu1yWC3RNrTyjSQ8p1W0.aaUXUJ.Ne', '0', '0', '127.0.0.1', now(), 103, 1, now(), 4, now(), NULL); +insert into sys_user values(1, 103, 'admin', '疯狂的狮子Li', 'sys_user', 'crazyLionLi@163.com', '15888888888', '1', null, '$2a$10$7JB720yubVSZvUI0rEqK/.VqGOZTH.ulu33dHOiBE8ByOhJIrdAu2', '0', '0', '127.0.0.1', now(), 103, 1, now(), null, null, '管理员'); +insert into sys_user VALUES(3, 108, 'test', '本部门及以下 密码666666', 'sys_user', '', '', '0', null, '$2a$10$b8yUzN0C71sbz.PhNOCgJe.Tu1yWC3RNrTyjSQ8p1W0.aaUXUJ.Ne', '0', '0', '127.0.0.1', now(), 103, 1, now(), 3, now(), NULL); +insert into sys_user VALUES(4, 102, 'test1', '仅本人 密码666666', 'sys_user', '', '', '0', null, '$2a$10$b8yUzN0C71sbz.PhNOCgJe.Tu1yWC3RNrTyjSQ8p1W0.aaUXUJ.Ne', '0', '0', '127.0.0.1', now(), 103, 1, now(), 4, now(), NULL); -- ---------------------------- -- 3、岗位信息表 @@ -283,7 +184,6 @@ insert into sys_user VALUES(4, '000000', 102, 'test1', '仅本人 密码666666', create table if not exists sys_post ( post_id int8, - tenant_id varchar(20) default '000000'::varchar, dept_id int8, post_code varchar(64) not null, post_category varchar(100) default null, @@ -301,7 +201,6 @@ create table if not exists sys_post comment on table sys_post is '岗位信息表'; comment on column sys_post.post_id is '岗位ID'; -comment on column sys_post.tenant_id is '租户编号'; comment on column sys_post.dept_id is '部门id'; comment on column sys_post.post_code is '岗位编码'; comment on column sys_post.post_category is '岗位类别编码'; @@ -318,10 +217,10 @@ comment on column sys_post.remark is '备注'; -- ---------------------------- -- 初始化-岗位信息表数据 -- ---------------------------- -insert into sys_post values(1, '000000', 103, 'ceo', null, '董事长', 1, '0', 103, 1, now(), null, null, ''); -insert into sys_post values(2, '000000', 100, 'se', null, '项目经理', 2, '0', 103, 1, now(), null, null, ''); -insert into sys_post values(3, '000000', 100, 'hr', null, '人力资源', 3, '0', 103, 1, now(), null, null, ''); -insert into sys_post values(4, '000000', 100, 'user', null, '普通员工', 4, '0', 103, 1, now(), null, null, ''); +insert into sys_post values(1, 103, 'ceo', null, '董事长', 1, '0', 103, 1, now(), null, null, ''); +insert into sys_post values(2, 100, 'se', null, '项目经理', 2, '0', 103, 1, now(), null, null, ''); +insert into sys_post values(3, 100, 'hr', null, '人力资源', 3, '0', 103, 1, now(), null, null, ''); +insert into sys_post values(4, 100, 'user', null, '普通员工', 4, '0', 103, 1, now(), null, null, ''); -- ---------------------------- -- 4、角色信息表 @@ -329,7 +228,6 @@ insert into sys_post values(4, '000000', 100, 'user', null, '普通员工', 4, create table if not exists sys_role ( role_id int8, - tenant_id varchar(20) default '000000'::varchar, role_name varchar(30) not null, role_key varchar(100) not null, role_sort int4 not null, @@ -349,7 +247,6 @@ create table if not exists sys_role comment on table sys_role is '角色信息表'; comment on column sys_role.role_id is '角色ID'; -comment on column sys_role.tenant_id is '租户编号'; comment on column sys_role.role_name is '角色名称'; comment on column sys_role.role_key is '角色权限字符串'; comment on column sys_role.role_sort is '显示顺序'; @@ -368,9 +265,9 @@ comment on column sys_role.remark is '备注'; -- ---------------------------- -- 初始化-角色信息表数据 -- ---------------------------- -insert into sys_role values('1', '000000', '超级管理员', 'superadmin', 1, '1', 't', 't', '0', '0', 103, 1, now(), null, null, '超级管理员'); -insert into sys_role values('3', '000000', '本部门及以下', 'test1', 3, '4', 't', 't', '0', '0', 103, 1, now(), NULL, NULL, ''); -insert into sys_role values('4', '000000', '仅本人', 'test2', 4, '5', 't', 't', '0', '0', 103, 1, now(), NULL, NULL, ''); +insert into sys_role values('1', '超级管理员', 'superadmin', 1, '1', 't', 't', '0', '0', 103, 1, now(), null, null, '超级管理员'); +insert into sys_role values('3', '本部门及以下', 'test1', 3, '4', 't', 't', '0', '0', 103, 1, now(), NULL, NULL, ''); +insert into sys_role values('4', '仅本人', 'test2', 4, '5', 't', 't', '0', '0', 103, 1, now(), NULL, NULL, ''); -- ---------------------------- -- 5、菜单权限表 @@ -427,7 +324,6 @@ comment on column sys_menu.remark is '备注'; -- ---------------------------- -- 一级菜单 insert into sys_menu values('1', '系统管理', '0', '1', 'system', null, '', '1', '0', 'M', '0', '0', '', 'system', 103, 1, now(), null, null, '系统管理目录'); -insert into sys_menu values('6', '租户管理', '0', '2', 'tenant', null, '', '1', '0', 'M', '0', '0', '', 'chart', 103, 1, now(), null, null, '租户管理目录'); insert into sys_menu values('2', '系统监控', '0', '3', 'monitor', null, '', '1', '0', 'M', '0', '0', '', 'monitor', 103, 1, now(), null, null, '系统监控目录'); insert into sys_menu values('3', '系统工具', '0', '4', 'tool', null, '', '1', '0', 'M', '0', '0', '', 'tool', 103, 1, now(), null, null, '系统工具目录'); insert into sys_menu values('4', 'PLUS官网', '0', '5', 'https://gitee.com/dromara/RuoYi-Vue-Plus', null, '', '0', '0', 'M', '0', '0', '', 'guide', 103, 1, now(), null, null, 'RuoYi-Vue-Plus官网地址'); @@ -445,8 +341,6 @@ insert into sys_menu values('108', '日志管理', '1', '9', 'log', insert into sys_menu values('109', '在线用户', '2', '1', 'online', 'monitor/online/index', '', '1', '0', 'C', '0', '0', 'monitor:online:list', 'online', 103, 1, now(), null, null, '在线用户菜单'); insert into sys_menu values('113', '缓存监控', '2', '5', 'cache', 'monitor/cache/index', '', '1', '0', 'C', '0', '0', 'monitor:cache:list', 'redis', 103, 1, now(), null, null, '缓存监控菜单'); insert into sys_menu values('115', '代码生成', '3', '2', 'gen', 'tool/gen/index', '', '1', '0', 'C', '0', '0', 'tool:gen:list', 'code', 103, 1, now(), null, null, '代码生成菜单'); -insert into sys_menu values('121', '租户管理', '6', '1', 'tenant', 'system/tenant/index', '', '1', '0', 'C', '0', '0', 'system:tenant:list', 'list', 103, 1, now(), null, null, '租户管理菜单'); -insert into sys_menu values('122', '租户套餐管理', '6', '2', 'tenantPackage', 'system/tenantPackage/index', '', '1', '0', 'C', '0', '0', 'system:tenantPackage:list', 'form', 103, 1, now(), null, null, '租户套餐管理菜单'); insert into sys_menu values('123', '客户端管理', '1', '11', 'client', 'system/client/index', '', '1', '0', 'C', '0', '0', 'system:client:list', 'international', 103, 1, now(), null, null, '客户端管理菜单'); insert into sys_menu values('116', '修改生成配置', '3', '2', 'gen-edit/index/:tableId', 'tool/gen/editTable', '', '1', '1', 'C', '1', '0', 'tool:gen:edit', '#', 103, 1, now(), null, null, '/tool/gen'); insert into sys_menu values('130', '分配用户', '1', '2', 'role-auth/user/:roleId', 'system/role/authUser', '', '1', '1', 'C', '1', '0', 'system:role:edit', '#', 103, 1, now(), null, null, '/system/role'); @@ -540,18 +434,6 @@ insert into sys_menu values('1620', '配置列表', '118', '5', '#', '', '', '1' insert into sys_menu values('1621', '配置添加', '118', '6', '#', '', '', '1', '0', 'F', '0', '0', 'system:ossConfig:add', '#', 103, 1, now(), null, null, ''); insert into sys_menu values('1622', '配置编辑', '118', '6', '#', '', '', '1', '0', 'F', '0', '0', 'system:ossConfig:edit', '#', 103, 1, now(), null, null, ''); insert into sys_menu values('1623', '配置删除', '118', '6', '#', '', '', '1', '0', 'F', '0', '0', 'system:ossConfig:remove', '#', 103, 1, now(), null, null, ''); --- 租户管理相关按钮 -insert into sys_menu values('1606', '租户查询', '121', '1', '#', '', '', '1', '0', 'F', '0', '0', 'system:tenant:query', '#', 103, 1, now(), null, null, ''); -insert into sys_menu values('1607', '租户新增', '121', '2', '#', '', '', '1', '0', 'F', '0', '0', 'system:tenant:add', '#', 103, 1, now(), null, null, ''); -insert into sys_menu values('1608', '租户修改', '121', '3', '#', '', '', '1', '0', 'F', '0', '0', 'system:tenant:edit', '#', 103, 1, now(), null, null, ''); -insert into sys_menu values('1609', '租户删除', '121', '4', '#', '', '', '1', '0', 'F', '0', '0', 'system:tenant:remove', '#', 103, 1, now(), null, null, ''); -insert into sys_menu values('1610', '租户导出', '121', '5', '#', '', '', '1', '0', 'F', '0', '0', 'system:tenant:export', '#', 103, 1, now(), null, null, ''); --- 租户套餐管理相关按钮 -insert into sys_menu values('1611', '租户套餐查询', '122', '1', '#', '', '', '1', '0', 'F', '0', '0', 'system:tenantPackage:query', '#', 103, 1, now(), null, null, ''); -insert into sys_menu values('1612', '租户套餐新增', '122', '2', '#', '', '', '1', '0', 'F', '0', '0', 'system:tenantPackage:add', '#', 103, 1, now(), null, null, ''); -insert into sys_menu values('1613', '租户套餐修改', '122', '3', '#', '', '', '1', '0', 'F', '0', '0', 'system:tenantPackage:edit', '#', 103, 1, now(), null, null, ''); -insert into sys_menu values('1614', '租户套餐删除', '122', '4', '#', '', '', '1', '0', 'F', '0', '0', 'system:tenantPackage:remove', '#', 103, 1, now(), null, null, ''); -insert into sys_menu values('1615', '租户套餐导出', '122', '5', '#', '', '', '1', '0', 'F', '0', '0', 'system:tenantPackage:export', '#', 103, 1, now(), null, null, ''); -- 客户端管理按钮 insert into sys_menu values('1061', '客户端管理查询', '123', '1', '#', '', '', '1', '0', 'F', '0', '0', 'system:client:query', '#', 103, 1, now(), null, null, ''); insert into sys_menu values('1062', '客户端管理新增', '123', '2', '#', '', '', '1', '0', 'F', '0', '0', 'system:client:add', '#', 103, 1, now(), null, null, ''); @@ -770,7 +652,6 @@ insert into sys_user_post values ('1', '1'); create table if not exists sys_oper_log ( oper_id int8, - tenant_id varchar(20) default '000000'::varchar, title varchar(50) default ''::varchar, business_type int4 default 0, method varchar(100) default ''::varchar, @@ -796,7 +677,6 @@ create index idx_sys_oper_log_ot ON sys_oper_log (oper_time); comment on table sys_oper_log is '操作日志记录'; comment on column sys_oper_log.oper_id is '日志主键'; -comment on column sys_oper_log.tenant_id is '租户编号'; comment on column sys_oper_log.title is '模块标题'; comment on column sys_oper_log.business_type is '业务类型(0其它 1新增 2修改 3删除)'; comment on column sys_oper_log.method is '方法名称'; @@ -820,7 +700,6 @@ comment on column sys_oper_log.cost_time is '消耗时间'; create table if not exists sys_dict_type ( dict_id int8, - tenant_id varchar(20) default '000000'::varchar, dict_name varchar(100) default ''::varchar, dict_type varchar(100) default ''::varchar, create_dept int8, @@ -836,7 +715,6 @@ create unique index sys_dict_type_index1 ON sys_dict_type (tenant_id, dict_type) comment on table sys_dict_type is '字典类型表'; comment on column sys_dict_type.dict_id is '字典主键'; -comment on column sys_dict_type.tenant_id is '租户编号'; comment on column sys_dict_type.dict_name is '字典名称'; comment on column sys_dict_type.dict_type is '字典类型'; comment on column sys_dict_type.create_dept is '创建部门'; @@ -846,16 +724,16 @@ comment on column sys_dict_type.update_by is '更新者'; comment on column sys_dict_type.update_time is '更新时间'; comment on column sys_dict_type.remark is '备注'; -insert into sys_dict_type values(1, '000000', '用户性别', 'sys_user_sex', 103, 1, now(), null, null, '用户性别列表'); -insert into sys_dict_type values(2, '000000', '菜单状态', 'sys_show_hide', 103, 1, now(), null, null, '菜单状态列表'); -insert into sys_dict_type values(3, '000000', '系统开关', 'sys_normal_disable', 103, 1, now(), null, null, '系统开关列表'); -insert into sys_dict_type values(6, '000000', '系统是否', 'sys_yes_no', 103, 1, now(), null, null, '系统是否列表'); -insert into sys_dict_type values(7, '000000', '通知类型', 'sys_notice_type', 103, 1, now(), null, null, '通知类型列表'); -insert into sys_dict_type values(8, '000000', '通知状态', 'sys_notice_status', 103, 1, now(), null, null, '通知状态列表'); -insert into sys_dict_type values(9, '000000', '操作类型', 'sys_oper_type', 103, 1, now(), null, null, '操作类型列表'); -insert into sys_dict_type values(10, '000000', '系统状态', 'sys_common_status', 103, 1, now(), null, null, '登录状态列表'); -insert into sys_dict_type values(11, '000000', '授权类型', 'sys_grant_type', 103, 1, now(), null, null, '认证授权类型'); -insert into sys_dict_type values(12, '000000', '设备类型', 'sys_device_type', 103, 1, now(), null, null, '客户端设备类型'); +insert into sys_dict_type values(1, '用户性别', 'sys_user_sex', 103, 1, now(), null, null, '用户性别列表'); +insert into sys_dict_type values(2, '菜单状态', 'sys_show_hide', 103, 1, now(), null, null, '菜单状态列表'); +insert into sys_dict_type values(3, '系统开关', 'sys_normal_disable', 103, 1, now(), null, null, '系统开关列表'); +insert into sys_dict_type values(6, '系统是否', 'sys_yes_no', 103, 1, now(), null, null, '系统是否列表'); +insert into sys_dict_type values(7, '通知类型', 'sys_notice_type', 103, 1, now(), null, null, '通知类型列表'); +insert into sys_dict_type values(8, '通知状态', 'sys_notice_status', 103, 1, now(), null, null, '通知状态列表'); +insert into sys_dict_type values(9, '操作类型', 'sys_oper_type', 103, 1, now(), null, null, '操作类型列表'); +insert into sys_dict_type values(10, '系统状态', 'sys_common_status', 103, 1, now(), null, null, '登录状态列表'); +insert into sys_dict_type values(11, '授权类型', 'sys_grant_type', 103, 1, now(), null, null, '认证授权类型'); +insert into sys_dict_type values(12, '设备类型', 'sys_device_type', 103, 1, now(), null, null, '客户端设备类型'); -- ---------------------------- -- 12、字典数据表 @@ -863,7 +741,6 @@ insert into sys_dict_type values(12, '000000', '设备类型', 'sys_device_type' create table if not exists sys_dict_data ( dict_code int8, - tenant_id varchar(20) default '000000'::varchar, dict_sort int4 default 0, dict_label varchar(100) default ''::varchar, dict_value varchar(100) default ''::varchar, @@ -882,7 +759,6 @@ create table if not exists sys_dict_data comment on table sys_dict_data is '字典数据表'; comment on column sys_dict_data.dict_code is '字典编码'; -comment on column sys_dict_type.tenant_id is '租户编号'; comment on column sys_dict_data.dict_sort is '字典排序'; comment on column sys_dict_data.dict_label is '字典标签'; comment on column sys_dict_data.dict_value is '字典键值'; @@ -897,40 +773,40 @@ comment on column sys_dict_data.update_by is '更新者'; comment on column sys_dict_data.update_time is '更新时间'; comment on column sys_dict_data.remark is '备注'; -insert into sys_dict_data values(1, '000000', 1, '男', '0', 'sys_user_sex', '', '', 'Y', 103, 1, now(), null, null, '性别男'); -insert into sys_dict_data values(2, '000000', 2, '女', '1', 'sys_user_sex', '', '', 'N', 103, 1, now(), null, null, '性别女'); -insert into sys_dict_data values(3, '000000', 3, '未知', '2', 'sys_user_sex', '', '', 'N', 103, 1, now(), null, null, '性别未知'); -insert into sys_dict_data values(4, '000000', 1, '显示', '0', 'sys_show_hide', '', 'primary', 'Y', 103, 1, now(), null, null, '显示菜单'); -insert into sys_dict_data values(5, '000000', 2, '隐藏', '1', 'sys_show_hide', '', 'danger', 'N', 103, 1, now(), null, null, '隐藏菜单'); -insert into sys_dict_data values(6, '000000', 1, '正常', '0', 'sys_normal_disable', '', 'primary', 'Y', 103, 1, now(), null, null, '正常状态'); -insert into sys_dict_data values(7, '000000', 2, '停用', '1', 'sys_normal_disable', '', 'danger', 'N', 103, 1, now(), null, null, '停用状态'); -insert into sys_dict_data values(12, '000000', 1, '是', 'Y', 'sys_yes_no', '', 'primary', 'Y', 103, 1, now(), null, null, '系统默认是'); -insert into sys_dict_data values(13, '000000', 2, '否', 'N', 'sys_yes_no', '', 'danger', 'N', 103, 1, now(), null, null, '系统默认否'); -insert into sys_dict_data values(14, '000000', 1, '通知', '1', 'sys_notice_type', '', 'warning', 'Y', 103, 1, now(), null, null, '通知'); -insert into sys_dict_data values(15, '000000', 2, '公告', '2', 'sys_notice_type', '', 'success', 'N', 103, 1, now(), null, null, '公告'); -insert into sys_dict_data values(16, '000000', 1, '正常', '0', 'sys_notice_status', '', 'primary', 'Y', 103, 1, now(), null, null, '正常状态'); -insert into sys_dict_data values(17, '000000', 2, '关闭', '1', 'sys_notice_status', '', 'danger', 'N', 103, 1, now(), null, null, '关闭状态'); -insert into sys_dict_data values(29, '000000', 99, '其他', '0', 'sys_oper_type', '', 'info', 'N', 103, 1, now(), null, null, '其他操作'); -insert into sys_dict_data values(18, '000000', 1, '新增', '1', 'sys_oper_type', '', 'info', 'N', 103, 1, now(), null, null, '新增操作'); -insert into sys_dict_data values(19, '000000', 2, '修改', '2', 'sys_oper_type', '', 'info', 'N', 103, 1, now(), null, null, '修改操作'); -insert into sys_dict_data values(20, '000000', 3, '删除', '3', 'sys_oper_type', '', 'danger', 'N', 103, 1, now(), null, null, '删除操作'); -insert into sys_dict_data values(21, '000000', 4, '授权', '4', 'sys_oper_type', '', 'primary', 'N', 103, 1, now(), null, null, '授权操作'); -insert into sys_dict_data values(22, '000000', 5, '导出', '5', 'sys_oper_type', '', 'warning', 'N', 103, 1, now(), null, null, '导出操作'); -insert into sys_dict_data values(23, '000000', 6, '导入', '6', 'sys_oper_type', '', 'warning', 'N', 103, 1, now(), null, null, '导入操作'); -insert into sys_dict_data values(24, '000000', 7, '强退', '7', 'sys_oper_type', '', 'danger', 'N', 103, 1, now(), null, null, '强退操作'); -insert into sys_dict_data values(25, '000000', 8, '生成代码', '8', 'sys_oper_type', '', 'warning', 'N', 103, 1, now(), null, null, '生成操作'); -insert into sys_dict_data values(26, '000000', 9, '清空数据', '9', 'sys_oper_type', '', 'danger', 'N', 103, 1, now(), null, null, '清空操作'); -insert into sys_dict_data values(27, '000000', 1, '成功', '0', 'sys_common_status', '', 'primary', 'N', 103, 1, now(), null, null, '正常状态'); -insert into sys_dict_data values(28, '000000', 2, '失败', '1', 'sys_common_status', '', 'danger', 'N', 103, 1, now(), null, null, '停用状态'); -insert into sys_dict_data values(30, '000000', 0, '密码认证', 'password', 'sys_grant_type', '', 'default', 'N', 103, 1, now(), null, null, '密码认证'); -insert into sys_dict_data values(31, '000000', 0, '短信认证', 'sms', 'sys_grant_type', '', 'default', 'N', 103, 1, now(), null, null, '短信认证'); -insert into sys_dict_data values(32, '000000', 0, '邮件认证', 'email', 'sys_grant_type', '', 'default', 'N', 103, 1, now(), null, null, '邮件认证'); -insert into sys_dict_data values(33, '000000', 0, '小程序认证', 'xcx', 'sys_grant_type', '', 'default', 'N', 103, 1, now(), null, null, '小程序认证'); -insert into sys_dict_data values(34, '000000', 0, '三方登录认证', 'social', 'sys_grant_type', '', 'default', 'N', 103, 1, now(), null, null, '三方登录认证'); -insert into sys_dict_data values(35, '000000', 0, 'PC', 'pc', 'sys_device_type', '', 'default', 'N', 103, 1, now(), null, null, 'PC'); -insert into sys_dict_data values(36, '000000', 0, '安卓', 'android', 'sys_device_type', '', 'default', 'N', 103, 1, now(), null, null, '安卓'); -insert into sys_dict_data values(37, '000000', 0, 'iOS', 'ios', 'sys_device_type', '', 'default', 'N', 103, 1, now(), null, null, 'iOS'); -insert into sys_dict_data values(38, '000000', 0, '小程序', 'xcx', 'sys_device_type', '', 'default', 'N', 103, 1, now(), null, null, '小程序'); +insert into sys_dict_data values(1, 1, '男', '0', 'sys_user_sex', '', '', 'Y', 103, 1, now(), null, null, '性别男'); +insert into sys_dict_data values(2, 2, '女', '1', 'sys_user_sex', '', '', 'N', 103, 1, now(), null, null, '性别女'); +insert into sys_dict_data values(3, 3, '未知', '2', 'sys_user_sex', '', '', 'N', 103, 1, now(), null, null, '性别未知'); +insert into sys_dict_data values(4, 1, '显示', '0', 'sys_show_hide', '', 'primary', 'Y', 103, 1, now(), null, null, '显示菜单'); +insert into sys_dict_data values(5, 2, '隐藏', '1', 'sys_show_hide', '', 'danger', 'N', 103, 1, now(), null, null, '隐藏菜单'); +insert into sys_dict_data values(6, 1, '正常', '0', 'sys_normal_disable', '', 'primary', 'Y', 103, 1, now(), null, null, '正常状态'); +insert into sys_dict_data values(7, 2, '停用', '1', 'sys_normal_disable', '', 'danger', 'N', 103, 1, now(), null, null, '停用状态'); +insert into sys_dict_data values(12, 1, '是', 'Y', 'sys_yes_no', '', 'primary', 'Y', 103, 1, now(), null, null, '系统默认是'); +insert into sys_dict_data values(13, 2, '否', 'N', 'sys_yes_no', '', 'danger', 'N', 103, 1, now(), null, null, '系统默认否'); +insert into sys_dict_data values(14, 1, '通知', '1', 'sys_notice_type', '', 'warning', 'Y', 103, 1, now(), null, null, '通知'); +insert into sys_dict_data values(15, 2, '公告', '2', 'sys_notice_type', '', 'success', 'N', 103, 1, now(), null, null, '公告'); +insert into sys_dict_data values(16, 1, '正常', '0', 'sys_notice_status', '', 'primary', 'Y', 103, 1, now(), null, null, '正常状态'); +insert into sys_dict_data values(17, 2, '关闭', '1', 'sys_notice_status', '', 'danger', 'N', 103, 1, now(), null, null, '关闭状态'); +insert into sys_dict_data values(29, 99, '其他', '0', 'sys_oper_type', '', 'info', 'N', 103, 1, now(), null, null, '其他操作'); +insert into sys_dict_data values(18, 1, '新增', '1', 'sys_oper_type', '', 'info', 'N', 103, 1, now(), null, null, '新增操作'); +insert into sys_dict_data values(19, 2, '修改', '2', 'sys_oper_type', '', 'info', 'N', 103, 1, now(), null, null, '修改操作'); +insert into sys_dict_data values(20, 3, '删除', '3', 'sys_oper_type', '', 'danger', 'N', 103, 1, now(), null, null, '删除操作'); +insert into sys_dict_data values(21, 4, '授权', '4', 'sys_oper_type', '', 'primary', 'N', 103, 1, now(), null, null, '授权操作'); +insert into sys_dict_data values(22, 5, '导出', '5', 'sys_oper_type', '', 'warning', 'N', 103, 1, now(), null, null, '导出操作'); +insert into sys_dict_data values(23, 6, '导入', '6', 'sys_oper_type', '', 'warning', 'N', 103, 1, now(), null, null, '导入操作'); +insert into sys_dict_data values(24, 7, '强退', '7', 'sys_oper_type', '', 'danger', 'N', 103, 1, now(), null, null, '强退操作'); +insert into sys_dict_data values(25, 8, '生成代码', '8', 'sys_oper_type', '', 'warning', 'N', 103, 1, now(), null, null, '生成操作'); +insert into sys_dict_data values(26, 9, '清空数据', '9', 'sys_oper_type', '', 'danger', 'N', 103, 1, now(), null, null, '清空操作'); +insert into sys_dict_data values(27, 1, '成功', '0', 'sys_common_status', '', 'primary', 'N', 103, 1, now(), null, null, '正常状态'); +insert into sys_dict_data values(28, 2, '失败', '1', 'sys_common_status', '', 'danger', 'N', 103, 1, now(), null, null, '停用状态'); +insert into sys_dict_data values(30, 0, '密码认证', 'password', 'sys_grant_type', '', 'default', 'N', 103, 1, now(), null, null, '密码认证'); +insert into sys_dict_data values(31, 0, '短信认证', 'sms', 'sys_grant_type', '', 'default', 'N', 103, 1, now(), null, null, '短信认证'); +insert into sys_dict_data values(32, 0, '邮件认证', 'email', 'sys_grant_type', '', 'default', 'N', 103, 1, now(), null, null, '邮件认证'); +insert into sys_dict_data values(33, 0, '小程序认证', 'xcx', 'sys_grant_type', '', 'default', 'N', 103, 1, now(), null, null, '小程序认证'); +insert into sys_dict_data values(34, 0, '三方登录认证', 'social', 'sys_grant_type', '', 'default', 'N', 103, 1, now(), null, null, '三方登录认证'); +insert into sys_dict_data values(35, 0, 'PC', 'pc', 'sys_device_type', '', 'default', 'N', 103, 1, now(), null, null, 'PC'); +insert into sys_dict_data values(36, 0, '安卓', 'android', 'sys_device_type', '', 'default', 'N', 103, 1, now(), null, null, '安卓'); +insert into sys_dict_data values(37, 0, 'iOS', 'ios', 'sys_device_type', '', 'default', 'N', 103, 1, now(), null, null, 'iOS'); +insert into sys_dict_data values(38, 0, '小程序', 'xcx', 'sys_device_type', '', 'default', 'N', 103, 1, now(), null, null, '小程序'); -- ---------------------------- @@ -939,7 +815,6 @@ insert into sys_dict_data values(38, '000000', 0, '小程序', 'xcx', ' create table if not exists sys_config ( config_id int8, - tenant_id varchar(20) default '000000'::varchar, config_name varchar(100) default ''::varchar, config_key varchar(100) default ''::varchar, config_value varchar(500) default ''::varchar, @@ -955,7 +830,6 @@ create table if not exists sys_config comment on table sys_config is '参数配置表'; comment on column sys_config.config_id is '参数主键'; -comment on column sys_config.tenant_id is '租户编号'; comment on column sys_config.config_name is '参数名称'; comment on column sys_config.config_key is '参数键名'; comment on column sys_config.config_value is '参数键值'; @@ -967,11 +841,11 @@ comment on column sys_config.update_by is '更新者'; comment on column sys_config.update_time is '更新时间'; comment on column sys_config.remark is '备注'; -insert into sys_config values(1, '000000', '主框架页-默认皮肤样式名称', 'sys.index.skinName', 'skin-blue', 'Y', 103, 1, now(), null, null, '蓝色 skin-blue、绿色 skin-green、紫色 skin-purple、红色 skin-red、黄色 skin-yellow' ); -insert into sys_config values(2, '000000', '用户管理-账号初始密码', 'sys.user.initPassword', '123456', 'Y', 103, 1, now(), null, null, '初始化密码 123456' ); -insert into sys_config values(3, '000000', '主框架页-侧边栏主题', 'sys.index.sideTheme', 'theme-dark', 'Y', 103, 1, now(), null, null, '深色主题theme-dark,浅色主题theme-light' ); -insert into sys_config values(5, '000000', '账号自助-是否开启用户注册功能', 'sys.account.registerUser', 'false', 'Y', 103, 1, now(), null, null, '是否开启注册用户功能(true开启,false关闭)'); -insert into sys_config values(11, '000000', 'OSS预览列表资源开关', 'sys.oss.previewListResource', 'true', 'Y', 103, 1, now(), null, null, 'true:开启, false:关闭'); +insert into sys_config values(1, '主框架页-默认皮肤样式名称', 'sys.index.skinName', 'skin-blue', 'Y', 103, 1, now(), null, null, '蓝色 skin-blue、绿色 skin-green、紫色 skin-purple、红色 skin-red、黄色 skin-yellow' ); +insert into sys_config values(2, '用户管理-账号初始密码', 'sys.user.initPassword', '123456', 'Y', 103, 1, now(), null, null, '初始化密码 123456' ); +insert into sys_config values(3, '主框架页-侧边栏主题', 'sys.index.sideTheme', 'theme-dark', 'Y', 103, 1, now(), null, null, '深色主题theme-dark,浅色主题theme-light' ); +insert into sys_config values(5, '账号自助-是否开启用户注册功能', 'sys.account.registerUser', 'false', 'Y', 103, 1, now(), null, null, '是否开启注册用户功能(true开启,false关闭)'); +insert into sys_config values(11, 'OSS预览列表资源开关', 'sys.oss.previewListResource', 'true', 'Y', 103, 1, now(), null, null, 'true:开启, false:关闭'); -- ---------------------------- @@ -980,7 +854,6 @@ insert into sys_config values(11, '000000', 'OSS预览列表资源开关', create table if not exists sys_logininfor ( info_id int8, - tenant_id varchar(20) default '000000'::varchar, user_name varchar(50) default ''::varchar, client_key varchar(32) default ''::varchar, device_type varchar(32) default ''::varchar, @@ -999,7 +872,6 @@ create index idx_sys_logininfor_lt ON sys_logininfor (login_time); comment on table sys_logininfor is '系统访问记录'; comment on column sys_logininfor.info_id is '访问ID'; -comment on column sys_logininfor.tenant_id is '租户编号'; comment on column sys_logininfor.user_name is '用户账号'; comment on column sys_logininfor.client_key is '客户端'; comment on column sys_logininfor.device_type is '设备类型'; @@ -1017,7 +889,6 @@ comment on column sys_logininfor.login_time is '访问时间'; create table if not exists sys_notice ( notice_id int8, - tenant_id varchar(20) default '000000'::varchar, notice_title varchar(50) not null, notice_type char not null, notice_content text, @@ -1033,7 +904,6 @@ create table if not exists sys_notice comment on table sys_notice is '通知公告表'; comment on column sys_notice.notice_id is '公告ID'; -comment on column sys_notice.tenant_id is '租户编号'; comment on column sys_notice.notice_title is '公告标题'; comment on column sys_notice.notice_type is '公告类型(1通知 2公告)'; comment on column sys_notice.notice_content is '公告内容'; @@ -1048,8 +918,8 @@ comment on column sys_notice.remark is '备注'; -- ---------------------------- -- 初始化-公告信息表数据 -- ---------------------------- -insert into sys_notice values('1', '000000', '温馨提醒:2018-07-01 新版本发布啦', '2', '新版本内容', '0', 103, 1, now(), null, null, '管理员'); -insert into sys_notice values('2', '000000', '维护通知:2018-07-01 系统凌晨维护', '1', '维护内容', '0', 103, 1, now(), null, null, '管理员'); +insert into sys_notice values('1', '温馨提醒:2018-07-01 新版本发布啦', '2', '新版本内容', '0', 103, 1, now(), null, null, '管理员'); +insert into sys_notice values('2', '维护通知:2018-07-01 系统凌晨维护', '1', '维护内容', '0', 103, 1, now(), null, null, '管理员'); -- ---------------------------- @@ -1168,7 +1038,6 @@ comment on column gen_table_column.update_time is '更新时间'; create table if not exists sys_oss ( oss_id int8, - tenant_id varchar(20) default '000000'::varchar, file_name varchar(255) default ''::varchar not null, original_name varchar(255) default ''::varchar not null, file_suffix varchar(10) default ''::varchar not null, @@ -1185,7 +1054,6 @@ create table if not exists sys_oss comment on table sys_oss is 'OSS对象存储表'; comment on column sys_oss.oss_id is '对象存储主键'; -comment on column sys_oss.tenant_id is '租户编码'; comment on column sys_oss.file_name is '文件名'; comment on column sys_oss.original_name is '原名'; comment on column sys_oss.file_suffix is '文件后缀名'; @@ -1204,7 +1072,6 @@ comment on column sys_oss.service is '服务商'; create table if not exists sys_oss_config ( oss_config_id int8, - tenant_id varchar(20) default '000000'::varchar, config_key varchar(20) default ''::varchar not null, access_key varchar(255) default ''::varchar, secret_key varchar(255) default ''::varchar, @@ -1228,7 +1095,6 @@ create table if not exists sys_oss_config comment on table sys_oss_config is '对象存储配置表'; comment on column sys_oss_config.oss_config_id is '主键'; -comment on column sys_oss_config.tenant_id is '租户编码'; comment on column sys_oss_config.config_key is '配置key'; comment on column sys_oss_config.access_key is 'accessKey'; comment on column sys_oss_config.secret_key is '秘钥'; @@ -1248,11 +1114,11 @@ comment on column sys_oss_config.update_by is '更新者'; comment on column sys_oss_config.update_time is '更新时间'; comment on column sys_oss_config.remark is '备注'; -insert into sys_oss_config values (1, '000000', 'minio', 'ruoyi', 'ruoyi123', 'ruoyi', '', '127.0.0.1:9000', '','N', '', '1', '0', '', 103, 1, now(), 1, now(), null); -insert into sys_oss_config values (2, '000000', 'qiniu', 'XXXXXXXXXXXXXXX', 'XXXXXXXXXXXXXXX', 'ruoyi', '', 's3-cn-north-1.qiniucs.com', '','N', '', '1', '1', '', 103, 1, now(), 1, now(), null); -insert into sys_oss_config values (3, '000000', 'aliyun', 'XXXXXXXXXXXXXXX', 'XXXXXXXXXXXXXXX', 'ruoyi', '', 'oss-cn-beijing.aliyuncs.com', '','N', '', '1', '1', '', 103, 1, now(), 1, now(), null); -insert into sys_oss_config values (4, '000000', 'qcloud', 'XXXXXXXXXXXXXXX', 'XXXXXXXXXXXXXXX', 'ruoyi-1240000000', '', 'cos.ap-beijing.myqcloud.com', '','N', 'ap-beijing', '1', '1', '', 103, 1, now(), 1, now(), null); -insert into sys_oss_config values (5, '000000', 'image', 'ruoyi', 'ruoyi123', 'ruoyi', 'image', '127.0.0.1:9000', '','N', '', '1', '1', '', 103, 1, now(), 1, now(), NULL); +insert into sys_oss_config values (1, 'minio', 'ruoyi', 'ruoyi123', 'ruoyi', '', '127.0.0.1:9000', '','N', '', '1', '0', '', 103, 1, now(), 1, now(), null); +insert into sys_oss_config values (2, 'qiniu', 'XXXXXXXXXXXXXXX', 'XXXXXXXXXXXXXXX', 'ruoyi', '', 's3-cn-north-1.qiniucs.com', '','N', '', '1', '1', '', 103, 1, now(), 1, now(), null); +insert into sys_oss_config values (3, 'aliyun', 'XXXXXXXXXXXXXXX', 'XXXXXXXXXXXXXXX', 'ruoyi', '', 'oss-cn-beijing.aliyuncs.com', '','N', '', '1', '1', '', 103, 1, now(), 1, now(), null); +insert into sys_oss_config values (4, 'qcloud', 'XXXXXXXXXXXXXXX', 'XXXXXXXXXXXXXXX', 'ruoyi-1240000000', '', 'cos.ap-beijing.myqcloud.com', '','N', 'ap-beijing', '1', '1', '', 103, 1, now(), 1, now(), null); +insert into sys_oss_config values (5, 'image', 'ruoyi', 'ruoyi123', 'ruoyi', 'image', '127.0.0.1:9000', '','N', '', '1', '1', '', 103, 1, now(), 1, now(), NULL); -- ---------------------------- -- 系统授权表 @@ -1299,7 +1165,6 @@ insert into sys_client values (2, '428a8310cd442757ae699df5d894f051', 'app', 'ap create table if not exists test_demo ( id int8, - tenant_id varchar(20) default '000000', dept_id int8, user_id int8, order_num int4 default 0, @@ -1316,7 +1181,6 @@ create table if not exists test_demo comment on table test_demo is '测试单表'; comment on column test_demo.id is '主键'; -comment on column test_demo.tenant_id is '租户编号'; comment on column test_demo.dept_id is '部门id'; comment on column test_demo.user_id is '用户id'; comment on column test_demo.order_num is '排序号'; @@ -1333,7 +1197,6 @@ comment on column test_demo.del_flag is '删除标志'; create table if not exists test_tree ( id int8, - tenant_id varchar(20) default '000000', parent_id int8 default 0, dept_id int8, user_id int8, @@ -1349,7 +1212,6 @@ create table if not exists test_tree comment on table test_tree is '测试树表'; comment on column test_tree.id is '主键'; -comment on column test_tree.tenant_id is '租户编号'; comment on column test_tree.parent_id is '父id'; comment on column test_tree.dept_id is '部门id'; comment on column test_tree.user_id is '用户id'; @@ -1362,33 +1224,33 @@ comment on column test_tree.update_time is '更新时间'; comment on column test_tree.update_by is '更新人'; comment on column test_tree.del_flag is '删除标志'; -INSERT INTO test_demo VALUES (1, '000000', 102, 4, 1, '测试数据权限', '测试', 0, 103, now(), 1, NULL, NULL, 0); -INSERT INTO test_demo VALUES (2, '000000', 102, 3, 2, '子节点1', '111', 0, 103, now(), 1, NULL, NULL, 0); -INSERT INTO test_demo VALUES (3, '000000', 102, 3, 3, '子节点2', '222', 0, 103, now(), 1, NULL, NULL, 0); -INSERT INTO test_demo VALUES (4, '000000', 108, 4, 4, '测试数据', 'demo', 0, 103, now(), 1, NULL, NULL, 0); -INSERT INTO test_demo VALUES (5, '000000', 108, 3, 13, '子节点11', '1111', 0, 103, now(), 1, NULL, NULL, 0); -INSERT INTO test_demo VALUES (6, '000000', 108, 3, 12, '子节点22', '2222', 0, 103, now(), 1, NULL, NULL, 0); -INSERT INTO test_demo VALUES (7, '000000', 108, 3, 11, '子节点33', '3333', 0, 103, now(), 1, NULL, NULL, 0); -INSERT INTO test_demo VALUES (8, '000000', 108, 3, 10, '子节点44', '4444', 0, 103, now(), 1, NULL, NULL, 0); -INSERT INTO test_demo VALUES (9, '000000', 108, 3, 9, '子节点55', '5555', 0, 103, now(), 1, NULL, NULL, 0); -INSERT INTO test_demo VALUES (10, '000000', 108, 3, 8, '子节点66', '6666', 0, 103, now(), 1, NULL, NULL, 0); -INSERT INTO test_demo VALUES (11, '000000', 108, 3, 7, '子节点77', '7777', 0, 103, now(), 1, NULL, NULL, 0); -INSERT INTO test_demo VALUES (12, '000000', 108, 3, 6, '子节点88', '8888', 0, 103, now(), 1, NULL, NULL, 0); -INSERT INTO test_demo VALUES (13, '000000', 108, 3, 5, '子节点99', '9999', 0, 103, now(), 1, NULL, NULL, 0); +INSERT INTO test_demo VALUES (1, 102, 4, 1, '测试数据权限', '测试', 0, 103, now(), 1, NULL, NULL, 0); +INSERT INTO test_demo VALUES (2, 102, 3, 2, '子节点1', '111', 0, 103, now(), 1, NULL, NULL, 0); +INSERT INTO test_demo VALUES (3, 102, 3, 3, '子节点2', '222', 0, 103, now(), 1, NULL, NULL, 0); +INSERT INTO test_demo VALUES (4, 108, 4, 4, '测试数据', 'demo', 0, 103, now(), 1, NULL, NULL, 0); +INSERT INTO test_demo VALUES (5, 108, 3, 13, '子节点11', '1111', 0, 103, now(), 1, NULL, NULL, 0); +INSERT INTO test_demo VALUES (6, 108, 3, 12, '子节点22', '2222', 0, 103, now(), 1, NULL, NULL, 0); +INSERT INTO test_demo VALUES (7, 108, 3, 11, '子节点33', '3333', 0, 103, now(), 1, NULL, NULL, 0); +INSERT INTO test_demo VALUES (8, 108, 3, 10, '子节点44', '4444', 0, 103, now(), 1, NULL, NULL, 0); +INSERT INTO test_demo VALUES (9, 108, 3, 9, '子节点55', '5555', 0, 103, now(), 1, NULL, NULL, 0); +INSERT INTO test_demo VALUES (10, 108, 3, 8, '子节点66', '6666', 0, 103, now(), 1, NULL, NULL, 0); +INSERT INTO test_demo VALUES (11, 108, 3, 7, '子节点77', '7777', 0, 103, now(), 1, NULL, NULL, 0); +INSERT INTO test_demo VALUES (12, 108, 3, 6, '子节点88', '8888', 0, 103, now(), 1, NULL, NULL, 0); +INSERT INTO test_demo VALUES (13, 108, 3, 5, '子节点99', '9999', 0, 103, now(), 1, NULL, NULL, 0); -INSERT INTO test_tree VALUES (1, '000000', 0, 102, 4, '测试数据权限', 0, 103, now(), 1, NULL, NULL, 0); -INSERT INTO test_tree VALUES (2, '000000', 1, 102, 3, '子节点1', 0, 103, now(), 1, NULL, NULL, 0); -INSERT INTO test_tree VALUES (3, '000000', 2, 102, 3, '子节点2', 0, 103, now(), 1, NULL, NULL, 0); -INSERT INTO test_tree VALUES (4, '000000', 0, 108, 4, '测试树1', 0, 103, now(), 1, NULL, NULL, 0); -INSERT INTO test_tree VALUES (5, '000000', 4, 108, 3, '子节点11', 0, 103, now(), 1, NULL, NULL, 0); -INSERT INTO test_tree VALUES (6, '000000', 4, 108, 3, '子节点22', 0, 103, now(), 1, NULL, NULL, 0); -INSERT INTO test_tree VALUES (7, '000000', 4, 108, 3, '子节点33', 0, 103, now(), 1, NULL, NULL, 0); -INSERT INTO test_tree VALUES (8, '000000', 5, 108, 3, '子节点44', 0, 103, now(), 1, NULL, NULL, 0); -INSERT INTO test_tree VALUES (9, '000000', 6, 108, 3, '子节点55', 0, 103, now(), 1, NULL, NULL, 0); -INSERT INTO test_tree VALUES (10, '000000', 7, 108, 3, '子节点66', 0, 103, now(), 1, NULL, NULL, 0); -INSERT INTO test_tree VALUES (11, '000000', 7, 108, 3, '子节点77', 0, 103, now(), 1, NULL, NULL, 0); -INSERT INTO test_tree VALUES (12, '000000', 10, 108, 3, '子节点88', 0, 103, now(), 1, NULL, NULL, 0); -INSERT INTO test_tree VALUES (13, '000000', 10, 108, 3, '子节点99', 0, 103, now(), 1, NULL, NULL, 0); +INSERT INTO test_tree VALUES (1, 0, 102, 4, '测试数据权限', 0, 103, now(), 1, NULL, NULL, 0); +INSERT INTO test_tree VALUES (2, 1, 102, 3, '子节点1', 0, 103, now(), 1, NULL, NULL, 0); +INSERT INTO test_tree VALUES (3, 2, 102, 3, '子节点2', 0, 103, now(), 1, NULL, NULL, 0); +INSERT INTO test_tree VALUES (4, 0, 108, 4, '测试树1', 0, 103, now(), 1, NULL, NULL, 0); +INSERT INTO test_tree VALUES (5, 4, 108, 3, '子节点11', 0, 103, now(), 1, NULL, NULL, 0); +INSERT INTO test_tree VALUES (6, 4, 108, 3, '子节点22', 0, 103, now(), 1, NULL, NULL, 0); +INSERT INTO test_tree VALUES (7, 4, 108, 3, '子节点33', 0, 103, now(), 1, NULL, NULL, 0); +INSERT INTO test_tree VALUES (8, 5, 108, 3, '子节点44', 0, 103, now(), 1, NULL, NULL, 0); +INSERT INTO test_tree VALUES (9, 6, 108, 3, '子节点55', 0, 103, now(), 1, NULL, NULL, 0); +INSERT INTO test_tree VALUES (10, 7, 108, 3, '子节点66', 0, 103, now(), 1, NULL, NULL, 0); +INSERT INTO test_tree VALUES (11, 7, 108, 3, '子节点77', 0, 103, now(), 1, NULL, NULL, 0); +INSERT INTO test_tree VALUES (12, 10, 108, 3, '子节点88', 0, 103, now(), 1, NULL, NULL, 0); +INSERT INTO test_tree VALUES (13, 10, 108, 3, '子节点99', 0, 103, now(), 1, NULL, NULL, 0); -- 字符串自动转时间 避免框架时间查询报错问题 create or replace function cast_varchar_to_timestamp(varchar) returns timestamptz as $$ diff --git a/script/sql/postgres/postgres_ry_workflow.sql b/script/sql/postgres/postgres_ry_workflow.sql index d6f30dfd2..347ae3a5b 100644 --- a/script/sql/postgres/postgres_ry_workflow.sql +++ b/script/sql/postgres/postgres_ry_workflow.sql @@ -298,7 +298,6 @@ COMMENT ON COLUMN flow_user.tenant_id IS '租户id'; CREATE TABLE flow_category ( category_id int8 NOT NULL, - tenant_id VARCHAR(20) DEFAULT '000000'::varchar, parent_id int8 DEFAULT 0, ancestors VARCHAR(500) DEFAULT ''::varchar, category_name VARCHAR(30) NOT NULL, @@ -314,7 +313,6 @@ CREATE TABLE flow_category COMMENT ON TABLE flow_category IS '流程分类'; COMMENT ON COLUMN flow_category.category_id IS '流程分类ID'; -COMMENT ON COLUMN flow_category.tenant_id IS '租户编号'; COMMENT ON COLUMN flow_category.parent_id IS '父流程分类id'; COMMENT ON COLUMN flow_category.ancestors IS '祖级列表'; COMMENT ON COLUMN flow_category.category_name IS '流程分类名称'; @@ -326,16 +324,16 @@ COMMENT ON COLUMN flow_category.create_time IS '创建时间'; COMMENT ON COLUMN flow_category.update_by IS '更新者'; COMMENT ON COLUMN flow_category.update_time IS '更新时间'; -INSERT INTO flow_category VALUES (100, '000000', 0, '0', 'OA审批', 0, '0', 103, 1, now(), NULL, NULL); -INSERT INTO flow_category VALUES (101, '000000', 100, '0,100', '假勤管理', 0, '0', 103, 1, now(), NULL, NULL); -INSERT INTO flow_category VALUES (102, '000000', 100, '0,100', '人事管理', 1, '0', 103, 1, now(), NULL, NULL); -INSERT INTO flow_category VALUES (103, '000000', 101, '0,100,101', '请假', 0, '0', 103, 1, now(), NULL, NULL); -INSERT INTO flow_category VALUES (104, '000000', 101, '0,100,101', '出差', 1, '0', 103, 1, now(), NULL, NULL); -INSERT INTO flow_category VALUES (105, '000000', 101, '0,100,101', '加班', 2, '0', 103, 1, now(), NULL, NULL); -INSERT INTO flow_category VALUES (106, '000000', 101, '0,100,101', '换班', 3, '0', 103, 1, now(), NULL, NULL); -INSERT INTO flow_category VALUES (107, '000000', 101, '0,100,101', '外出', 4, '0', 103, 1, now(), NULL, NULL); -INSERT INTO flow_category VALUES (108, '000000', 102, '0,100,102', '转正', 1, '0', 103, 1, now(), NULL, NULL); -INSERT INTO flow_category VALUES (109, '000000', 102, '0,100,102', '离职', 2, '0', 103, 1, now(), NULL, NULL); +INSERT INTO flow_category VALUES (100, 0, '0', 'OA审批', 0, '0', 103, 1, now(), NULL, NULL); +INSERT INTO flow_category VALUES (101, 100, '0,100', '假勤管理', 0, '0', 103, 1, now(), NULL, NULL); +INSERT INTO flow_category VALUES (102, 100, '0,100', '人事管理', 1, '0', 103, 1, now(), NULL, NULL); +INSERT INTO flow_category VALUES (103, 101, '0,100,101', '请假', 0, '0', 103, 1, now(), NULL, NULL); +INSERT INTO flow_category VALUES (104, 101, '0,100,101', '出差', 1, '0', 103, 1, now(), NULL, NULL); +INSERT INTO flow_category VALUES (105, 101, '0,100,101', '加班', 2, '0', 103, 1, now(), NULL, NULL); +INSERT INTO flow_category VALUES (106, 101, '0,100,101', '换班', 3, '0', 103, 1, now(), NULL, NULL); +INSERT INTO flow_category VALUES (107, 101, '0,100,101', '外出', 4, '0', 103, 1, now(), NULL, NULL); +INSERT INTO flow_category VALUES (108, 102, '0,100,102', '转正', 1, '0', 103, 1, now(), NULL, NULL); +INSERT INTO flow_category VALUES (109, 102, '0,100,102', '离职', 2, '0', 103, 1, now(), NULL, NULL); -- ---------------------------- -- 流程spel表达式定义表 @@ -380,7 +378,6 @@ INSERT INTO flow_spel VALUES (2, NULL, NULL, 'initiator', '${initiator}', '流 -- ---------------------------- CREATE TABLE flow_instance_biz_ext ( id int8, - tenant_id VARCHAR(20) DEFAULT '000000', create_dept int8, create_by int8, create_time TIMESTAMP, @@ -396,7 +393,6 @@ CREATE TABLE flow_instance_biz_ext ( COMMENT ON TABLE flow_instance_biz_ext IS '流程实例业务扩展表'; COMMENT ON COLUMN flow_instance_biz_ext.id IS '主键id'; -COMMENT ON COLUMN flow_instance_biz_ext.tenant_id IS '租户编号'; COMMENT ON COLUMN flow_instance_biz_ext.create_dept IS '创建部门'; COMMENT ON COLUMN flow_instance_biz_ext.create_by IS '创建者'; COMMENT ON COLUMN flow_instance_biz_ext.create_time IS '创建时间'; @@ -414,7 +410,6 @@ COMMENT ON COLUMN flow_instance_biz_ext.business_id IS '业务Id'; CREATE TABLE test_leave ( id int8 NOT NULL, - tenant_id VARCHAR(20) DEFAULT '000000'::varchar, apply_code VARCHAR(50) NOT NULL, leave_type VARCHAR(255) NOT NULL, start_date TIMESTAMP NOT NULL, @@ -432,7 +427,6 @@ CREATE TABLE test_leave COMMENT ON TABLE test_leave IS '请假申请表'; COMMENT ON COLUMN test_leave.id IS 'id'; -COMMENT ON COLUMN test_leave.tenant_id IS '租户编号'; COMMENT ON COLUMN test_leave.apply_code IS '申请编号'; COMMENT ON COLUMN test_leave.leave_type IS '请假类型'; COMMENT ON COLUMN test_leave.start_date IS '开始时间'; @@ -480,28 +474,28 @@ INSERT INTO sys_menu VALUES ('11641', '请假申请修改', '11638', '3', '#', ' INSERT INTO sys_menu VALUES ('11642', '请假申请删除', '11638', '4', '#', '', '', '1', '0', 'F', '0', '0', 'workflow:leave:remove', '#', 103, 1, now(), NULL, NULL, ''); INSERT INTO sys_menu VALUES ('11643', '请假申请导出', '11638', '5', '#', '', '', '1', '0', 'F', '0', '0', 'workflow:leave:export', '#', 103, 1, now(), NULL, NULL, ''); -INSERT INTO sys_dict_type VALUES (13, '000000', '业务状态', 'wf_business_status', 103, 1, now(), NULL, NULL, '业务状态列表'); -INSERT INTO sys_dict_type VALUES (14, '000000', '表单类型', 'wf_form_type', 103, 1, now(), NULL, NULL, '表单类型列表'); -INSERT INTO sys_dict_type VALUES (15, '000000', '任务状态', 'wf_task_status', 103, 1, now(), NULL, NULL, '任务状态'); -INSERT INTO sys_dict_data VALUES (39, '000000', 1, '已撤销', 'cancel', 'wf_business_status', '', 'danger', 'N', 103, 1, now(), NULL, NULL, '已撤销'); -INSERT INTO sys_dict_data VALUES (40, '000000', 2, '草稿', 'draft', 'wf_business_status', '', 'info', 'N', 103, 1, now(), NULL, NULL, '草稿'); -INSERT INTO sys_dict_data VALUES (41, '000000', 3, '待审核', 'waiting', 'wf_business_status', '', 'primary', 'N', 103, 1, now(), NULL, NULL, '待审核'); -INSERT INTO sys_dict_data VALUES (42, '000000', 4, '已完成', 'finish', 'wf_business_status', '', 'success', 'N', 103, 1, now(), NULL, NULL, '已完成'); -INSERT INTO sys_dict_data VALUES (43, '000000', 5, '已作废', 'invalid', 'wf_business_status', '', 'danger', 'N', 103, 1, now(), NULL, NULL, '已作废'); -INSERT INTO sys_dict_data VALUES (44, '000000', 6, '已退回', 'back', 'wf_business_status', '', 'danger', 'N', 103, 1, now(), NULL, NULL, '已退回'); -INSERT INTO sys_dict_data VALUES (45, '000000', 7, '已终止', 'termination', 'wf_business_status', '', 'danger', 'N', 103, 1, now(), NULL, NULL, '已终止'); -INSERT INTO sys_dict_data VALUES (46, '000000', 1, '自定义表单', 'static', 'wf_form_type', '', 'success', 'N', 103, 1, now(), NULL, NULL, '自定义表单'); -INSERT INTO sys_dict_data VALUES (47, '000000', 2, '动态表单', 'dynamic', 'wf_form_type', '', 'primary', 'N', 103, 1, now(), NULL, NULL, '动态表单'); -INSERT INTO sys_dict_data VALUES (48, '000000', 1, '撤销', 'cancel', 'wf_task_status', '', 'danger', 'N', 103, 1, now(), NULL, NULL, '撤销'); -INSERT INTO sys_dict_data VALUES (49, '000000', 2, '通过', 'pass', 'wf_task_status', '', 'success', 'N', 103, 1, now(), NULL, NULL, '通过'); -INSERT INTO sys_dict_data VALUES (50, '000000', 3, '待审核', 'waiting', 'wf_task_status', '', 'primary', 'N', 103, 1, now(), NULL, NULL, '待审核'); -INSERT INTO sys_dict_data VALUES (51, '000000', 4, '作废', 'invalid', 'wf_task_status', '', 'danger', 'N', 103, 1, now(), NULL, NULL, '作废'); -INSERT INTO sys_dict_data VALUES (52, '000000', 5, '退回', 'back', 'wf_task_status', '', 'danger', 'N', 103, 1, now(), NULL, NULL, '退回'); -INSERT INTO sys_dict_data VALUES (53, '000000', 6, '终止', 'termination', 'wf_task_status', '', 'danger', 'N', 103, 1, now(), NULL, NULL, '终止'); -INSERT INTO sys_dict_data VALUES (54, '000000', 7, '转办', 'transfer', 'wf_task_status', '', 'primary', 'N', 103, 1, now(), NULL, NULL, '转办'); -INSERT INTO sys_dict_data VALUES (55, '000000', 8, '委托', 'depute', 'wf_task_status', '', 'primary', 'N', 103, 1, now(), NULL, NULL, '委托'); -INSERT INTO sys_dict_data VALUES (56, '000000', 9, '抄送', 'copy', 'wf_task_status', '', 'primary', 'N', 103, 1, now(), NULL, NULL, '抄送'); -INSERT INTO sys_dict_data VALUES (57, '000000', 10, '加签', 'sign', 'wf_task_status', '', 'primary', 'N', 103, 1, now(), NULL, NULL, '加签'); -INSERT INTO sys_dict_data VALUES (58, '000000', 11, '减签', 'sign_off', 'wf_task_status', '', 'danger', 'N', 103, 1, now(), NULL, NULL, '减签'); -INSERT INTO sys_dict_data VALUES (59, '000000', 11, '超时', 'timeout', 'wf_task_status', '', 'danger', 'N', 103, 1, now(), NULL, NULL, '超时'); +INSERT INTO sys_dict_type VALUES (13, '业务状态', 'wf_business_status', 103, 1, now(), NULL, NULL, '业务状态列表'); +INSERT INTO sys_dict_type VALUES (14, '表单类型', 'wf_form_type', 103, 1, now(), NULL, NULL, '表单类型列表'); +INSERT INTO sys_dict_type VALUES (15, '任务状态', 'wf_task_status', 103, 1, now(), NULL, NULL, '任务状态'); +INSERT INTO sys_dict_data VALUES (39, 1, '已撤销', 'cancel', 'wf_business_status', '', 'danger', 'N', 103, 1, now(), NULL, NULL, '已撤销'); +INSERT INTO sys_dict_data VALUES (40, 2, '草稿', 'draft', 'wf_business_status', '', 'info', 'N', 103, 1, now(), NULL, NULL, '草稿'); +INSERT INTO sys_dict_data VALUES (41, 3, '待审核', 'waiting', 'wf_business_status', '', 'primary', 'N', 103, 1, now(), NULL, NULL, '待审核'); +INSERT INTO sys_dict_data VALUES (42, 4, '已完成', 'finish', 'wf_business_status', '', 'success', 'N', 103, 1, now(), NULL, NULL, '已完成'); +INSERT INTO sys_dict_data VALUES (43, 5, '已作废', 'invalid', 'wf_business_status', '', 'danger', 'N', 103, 1, now(), NULL, NULL, '已作废'); +INSERT INTO sys_dict_data VALUES (44, 6, '已退回', 'back', 'wf_business_status', '', 'danger', 'N', 103, 1, now(), NULL, NULL, '已退回'); +INSERT INTO sys_dict_data VALUES (45, 7, '已终止', 'termination', 'wf_business_status', '', 'danger', 'N', 103, 1, now(), NULL, NULL, '已终止'); +INSERT INTO sys_dict_data VALUES (46, 1, '自定义表单', 'static', 'wf_form_type', '', 'success', 'N', 103, 1, now(), NULL, NULL, '自定义表单'); +INSERT INTO sys_dict_data VALUES (47, 2, '动态表单', 'dynamic', 'wf_form_type', '', 'primary', 'N', 103, 1, now(), NULL, NULL, '动态表单'); +INSERT INTO sys_dict_data VALUES (48, 1, '撤销', 'cancel', 'wf_task_status', '', 'danger', 'N', 103, 1, now(), NULL, NULL, '撤销'); +INSERT INTO sys_dict_data VALUES (49, 2, '通过', 'pass', 'wf_task_status', '', 'success', 'N', 103, 1, now(), NULL, NULL, '通过'); +INSERT INTO sys_dict_data VALUES (50, 3, '待审核', 'waiting', 'wf_task_status', '', 'primary', 'N', 103, 1, now(), NULL, NULL, '待审核'); +INSERT INTO sys_dict_data VALUES (51, 4, '作废', 'invalid', 'wf_task_status', '', 'danger', 'N', 103, 1, now(), NULL, NULL, '作废'); +INSERT INTO sys_dict_data VALUES (52, 5, '退回', 'back', 'wf_task_status', '', 'danger', 'N', 103, 1, now(), NULL, NULL, '退回'); +INSERT INTO sys_dict_data VALUES (53, 6, '终止', 'termination', 'wf_task_status', '', 'danger', 'N', 103, 1, now(), NULL, NULL, '终止'); +INSERT INTO sys_dict_data VALUES (54, 7, '转办', 'transfer', 'wf_task_status', '', 'primary', 'N', 103, 1, now(), NULL, NULL, '转办'); +INSERT INTO sys_dict_data VALUES (55, 8, '委托', 'depute', 'wf_task_status', '', 'primary', 'N', 103, 1, now(), NULL, NULL, '委托'); +INSERT INTO sys_dict_data VALUES (56, 9, '抄送', 'copy', 'wf_task_status', '', 'primary', 'N', 103, 1, now(), NULL, NULL, '抄送'); +INSERT INTO sys_dict_data VALUES (57, 10, '加签', 'sign', 'wf_task_status', '', 'primary', 'N', 103, 1, now(), NULL, NULL, '加签'); +INSERT INTO sys_dict_data VALUES (58, 11, '减签', 'sign_off', 'wf_task_status', '', 'danger', 'N', 103, 1, now(), NULL, NULL, '减签'); +INSERT INTO sys_dict_data VALUES (59, 11, '超时', 'timeout', 'wf_task_status', '', 'danger', 'N', 103, 1, now(), NULL, NULL, '超时'); diff --git a/script/sql/ry_vue_5.X.sql b/script/sql/ry_vue_5.X.sql index 3cd642b0b..988459f58 100644 --- a/script/sql/ry_vue_5.X.sql +++ b/script/sql/ry_vue_5.X.sql @@ -5,7 +5,6 @@ create table sys_social ( id bigint not null comment '主键', user_id bigint not null comment '用户ID', - tenant_id varchar(20) default '000000' comment '租户id', auth_id varchar(255) not null comment '平台+平台唯一id', source varchar(255) not null comment '用户来源', open_id varchar(255) default null comment '平台编号唯一id', @@ -35,69 +34,11 @@ create table sys_social PRIMARY KEY (id) ) engine=innodb comment = '社会化关系表'; - --- ---------------------------- --- 租户表 --- ---------------------------- -create table sys_tenant -( - id bigint(20) not null comment 'id', - tenant_id varchar(20) not null comment '租户编号', - contact_user_name varchar(20) comment '联系人', - contact_phone varchar(20) comment '联系电话', - company_name varchar(30) comment '企业名称', - license_number varchar(30) comment '统一社会信用代码', - address varchar(200) comment '地址', - intro varchar(200) comment '企业简介', - domain varchar(200) comment '域名', - remark varchar(200) comment '备注', - package_id bigint(20) comment '租户套餐编号', - expire_time datetime comment '过期时间', - account_count int default -1 comment '用户数量(-1不限制)', - status char(1) default '0' comment '租户状态(0正常 1停用)', - del_flag char(1) default '0' comment '删除标志(0代表存在 1代表删除)', - create_dept bigint(20) comment '创建部门', - create_by bigint(20) comment '创建者', - create_time datetime comment '创建时间', - update_by bigint(20) comment '更新者', - update_time datetime comment '更新时间', - primary key (id) -) engine=innodb comment = '租户表'; - - --- ---------------------------- --- 初始化-租户表数据 --- ---------------------------- - -insert into sys_tenant values(1, '000000', '管理组', '15888888888', 'XXX有限公司', null, null, '多租户通用后台管理管理系统', null, null, null, null, -1, '0', '0', 103, 1, sysdate(), null, null); - - --- ---------------------------- --- 租户套餐表 --- ---------------------------- -create table sys_tenant_package ( - package_id bigint(20) not null comment '租户套餐id', - package_name varchar(20) comment '套餐名称', - menu_ids varchar(3000) comment '关联菜单id', - remark varchar(200) comment '备注', - menu_check_strictly tinyint(1) default 1 comment '菜单树选择项是否关联显示', - status char(1) default '0' comment '状态(0正常 1停用)', - del_flag char(1) default '0' comment '删除标志(0代表存在 1代表删除)', - create_dept bigint(20) comment '创建部门', - create_by bigint(20) comment '创建者', - create_time datetime comment '创建时间', - update_by bigint(20) comment '更新者', - update_time datetime comment '更新时间', - primary key (package_id) -) engine=innodb comment = '租户套餐表'; - - -- ---------------------------- -- 1、部门表 -- ---------------------------- create table sys_dept ( dept_id bigint(20) not null comment '部门id', - tenant_id varchar(20) default '000000' comment '租户编号', parent_id bigint(20) default 0 comment '父部门id', ancestors varchar(500) default '' comment '祖级列表', dept_name varchar(30) default '' comment '部门名称', @@ -121,16 +62,16 @@ create table sys_dept ( -- ---------------------------- -insert into sys_dept values(100, '000000', 0, '0', 'XXX科技', null,0, null, '15888888888', 'xxx@qq.com', '0', '0', 103, 1, sysdate(), null, null); -insert into sys_dept values(101, '000000', 100, '0,100', '深圳总公司', null,1, null, '15888888888', 'xxx@qq.com', '0', '0', 103, 1, sysdate(), null, null); -insert into sys_dept values(102, '000000', 100, '0,100', '长沙分公司', null,2, null, '15888888888', 'xxx@qq.com', '0', '0', 103, 1, sysdate(), null, null); -insert into sys_dept values(103, '000000', 101, '0,100,101', '研发部门', null,1, 1, '15888888888', 'xxx@qq.com', '0', '0', 103, 1, sysdate(), null, null); -insert into sys_dept values(104, '000000', 101, '0,100,101', '市场部门', null,2, null, '15888888888', 'xxx@qq.com', '0', '0', 103, 1, sysdate(), null, null); -insert into sys_dept values(105, '000000', 101, '0,100,101', '测试部门', null,3, null, '15888888888', 'xxx@qq.com', '0', '0', 103, 1, sysdate(), null, null); -insert into sys_dept values(106, '000000', 101, '0,100,101', '财务部门', null,4, null, '15888888888', 'xxx@qq.com', '0', '0', 103, 1, sysdate(), null, null); -insert into sys_dept values(107, '000000', 101, '0,100,101', '运维部门', null,5, null, '15888888888', 'xxx@qq.com', '0', '0', 103, 1, sysdate(), null, null); -insert into sys_dept values(108, '000000', 102, '0,100,102', '市场部门', null,1, null, '15888888888', 'xxx@qq.com', '0', '0', 103, 1, sysdate(), null, null); -insert into sys_dept values(109, '000000', 102, '0,100,102', '财务部门', null,2, null, '15888888888', 'xxx@qq.com', '0', '0', 103, 1, sysdate(), null, null); +insert into sys_dept values(100, 0, '0', 'XXX科技', null,0, null, '15888888888', 'xxx@qq.com', '0', '0', 103, 1, sysdate(), null, null); +insert into sys_dept values(101, 100, '0,100', '深圳总公司', null,1, null, '15888888888', 'xxx@qq.com', '0', '0', 103, 1, sysdate(), null, null); +insert into sys_dept values(102, 100, '0,100', '长沙分公司', null,2, null, '15888888888', 'xxx@qq.com', '0', '0', 103, 1, sysdate(), null, null); +insert into sys_dept values(103, 101, '0,100,101', '研发部门', null,1, 1, '15888888888', 'xxx@qq.com', '0', '0', 103, 1, sysdate(), null, null); +insert into sys_dept values(104, 101, '0,100,101', '市场部门', null,2, null, '15888888888', 'xxx@qq.com', '0', '0', 103, 1, sysdate(), null, null); +insert into sys_dept values(105, 101, '0,100,101', '测试部门', null,3, null, '15888888888', 'xxx@qq.com', '0', '0', 103, 1, sysdate(), null, null); +insert into sys_dept values(106, 101, '0,100,101', '财务部门', null,4, null, '15888888888', 'xxx@qq.com', '0', '0', 103, 1, sysdate(), null, null); +insert into sys_dept values(107, 101, '0,100,101', '运维部门', null,5, null, '15888888888', 'xxx@qq.com', '0', '0', 103, 1, sysdate(), null, null); +insert into sys_dept values(108, 102, '0,100,102', '市场部门', null,1, null, '15888888888', 'xxx@qq.com', '0', '0', 103, 1, sysdate(), null, null); +insert into sys_dept values(109, 102, '0,100,102', '财务部门', null,2, null, '15888888888', 'xxx@qq.com', '0', '0', 103, 1, sysdate(), null, null); -- ---------------------------- @@ -138,7 +79,6 @@ insert into sys_dept values(109, '000000', 102, '0,100,102', '财务部门', -- ---------------------------- create table sys_user ( user_id bigint(20) not null comment '用户ID', - tenant_id varchar(20) default '000000' comment '租户编号', dept_id bigint(20) default null comment '部门ID', user_name varchar(30) not null comment '用户账号', nick_name varchar(30) not null comment '用户昵称', @@ -164,9 +104,9 @@ create table sys_user ( -- ---------------------------- -- 初始化-用户信息表数据 -- ---------------------------- -insert into sys_user values(1, '000000', 103, 'admin', '疯狂的狮子Li', 'sys_user', 'crazyLionLi@163.com', '15888888888', '1', null, '$2a$10$7JB720yubVSZvUI0rEqK/.VqGOZTH.ulu33dHOiBE8ByOhJIrdAu2', '0', '0', '127.0.0.1', sysdate(), 103, 1, sysdate(), null, null, '管理员'); -insert into sys_user values(3, '000000', 108, 'test', '本部门及以下 密码666666', 'sys_user', '', '', '0', null, '$2a$10$b8yUzN0C71sbz.PhNOCgJe.Tu1yWC3RNrTyjSQ8p1W0.aaUXUJ.Ne', '0', '0', '127.0.0.1', sysdate(), 103, 1, sysdate(), 3, sysdate(), null); -insert into sys_user values(4, '000000', 102, 'test1', '仅本人 密码666666', 'sys_user', '', '', '0', null, '$2a$10$b8yUzN0C71sbz.PhNOCgJe.Tu1yWC3RNrTyjSQ8p1W0.aaUXUJ.Ne', '0', '0', '127.0.0.1', sysdate(), 103, 1, sysdate(), 4, sysdate(), null); +insert into sys_user values(1, 103, 'admin', '疯狂的狮子Li', 'sys_user', 'crazyLionLi@163.com', '15888888888', '1', null, '$2a$10$7JB720yubVSZvUI0rEqK/.VqGOZTH.ulu33dHOiBE8ByOhJIrdAu2', '0', '0', '127.0.0.1', sysdate(), 103, 1, sysdate(), null, null, '管理员'); +insert into sys_user values(3, 108, 'test', '本部门及以下 密码666666', 'sys_user', '', '', '0', null, '$2a$10$b8yUzN0C71sbz.PhNOCgJe.Tu1yWC3RNrTyjSQ8p1W0.aaUXUJ.Ne', '0', '0', '127.0.0.1', sysdate(), 103, 1, sysdate(), 3, sysdate(), null); +insert into sys_user values(4, 102, 'test1', '仅本人 密码666666', 'sys_user', '', '', '0', null, '$2a$10$b8yUzN0C71sbz.PhNOCgJe.Tu1yWC3RNrTyjSQ8p1W0.aaUXUJ.Ne', '0', '0', '127.0.0.1', sysdate(), 103, 1, sysdate(), 4, sysdate(), null); -- ---------------------------- -- 3、岗位信息表 @@ -174,7 +114,6 @@ insert into sys_user values(4, '000000', 102, 'test1', '仅本人 密码666666', create table sys_post ( post_id bigint(20) not null comment '岗位ID', - tenant_id varchar(20) default '000000' comment '租户编号', dept_id bigint(20) not null comment '部门id', post_code varchar(64) not null comment '岗位编码', post_category varchar(100) default null comment '岗位类别编码', @@ -193,10 +132,10 @@ create table sys_post -- ---------------------------- -- 初始化-岗位信息表数据 -- ---------------------------- -insert into sys_post values(1, '000000', 103, 'ceo', null, '董事长', 1, '0', 103, 1, sysdate(), null, null, ''); -insert into sys_post values(2, '000000', 100, 'se', null, '项目经理', 2, '0', 103, 1, sysdate(), null, null, ''); -insert into sys_post values(3, '000000', 100, 'hr', null, '人力资源', 3, '0', 103, 1, sysdate(), null, null, ''); -insert into sys_post values(4, '000000', 100, 'user', null, '普通员工', 4, '0', 103, 1, sysdate(), null, null, ''); +insert into sys_post values(1, 103, 'ceo', null, '董事长', 1, '0', 103, 1, sysdate(), null, null, ''); +insert into sys_post values(2, 100, 'se', null, '项目经理', 2, '0', 103, 1, sysdate(), null, null, ''); +insert into sys_post values(3, 100, 'hr', null, '人力资源', 3, '0', 103, 1, sysdate(), null, null, ''); +insert into sys_post values(4, 100, 'user', null, '普通员工', 4, '0', 103, 1, sysdate(), null, null, ''); -- ---------------------------- @@ -204,7 +143,6 @@ insert into sys_post values(4, '000000', 100, 'user', null, '普通员工', 4, -- ---------------------------- create table sys_role ( role_id bigint(20) not null comment '角色ID', - tenant_id varchar(20) default '000000' comment '租户编号', role_name varchar(30) not null comment '角色名称', role_key varchar(100) not null comment '角色权限字符串', role_sort int(4) not null comment '显示顺序', @@ -225,9 +163,9 @@ create table sys_role ( -- ---------------------------- -- 初始化-角色信息表数据 -- ---------------------------- -insert into sys_role values(1, '000000', '超级管理员', 'superadmin', 1, 1, 1, 1, '0', '0', 103, 1, sysdate(), null, null, '超级管理员'); -insert into sys_role values(3, '000000', '本部门及以下', 'test1', 3, 4, 1, 1, '0', '0', 103, 1, sysdate(), null, null, ''); -insert into sys_role values(4, '000000', '仅本人', 'test2', 4, 5, 1, 1, '0', '0', 103, 1, sysdate(), null, null, ''); +insert into sys_role values(1, '超级管理员', 'superadmin', 1, 1, 1, 1, '0', '0', 103, 1, sysdate(), null, null, '超级管理员'); +insert into sys_role values(3, '本部门及以下', 'test1', 3, 4, 1, 1, '0', '0', 103, 1, sysdate(), null, null, ''); +insert into sys_role values(4, '仅本人', 'test2', 4, 5, 1, 1, '0', '0', 103, 1, sysdate(), null, null, ''); -- ---------------------------- -- 5、菜单权限表 @@ -261,7 +199,6 @@ create table sys_menu ( -- ---------------------------- -- 一级菜单 insert into sys_menu values('1', '系统管理', '0', '1', 'system', null, '', 1, 0, 'M', '0', '0', '', 'system', 103, 1, sysdate(), null, null, '系统管理目录'); -insert into sys_menu values('6', '租户管理', '0', '2', 'tenant', null, '', 1, 0, 'M', '0', '0', '', 'chart', 103, 1, sysdate(), null, null, '租户管理目录'); insert into sys_menu values('2', '系统监控', '0', '3', 'monitor', null, '', 1, 0, 'M', '0', '0', '', 'monitor', 103, 1, sysdate(), null, null, '系统监控目录'); insert into sys_menu values('3', '系统工具', '0', '4', 'tool', null, '', 1, 0, 'M', '0', '0', '', 'tool', 103, 1, sysdate(), null, null, '系统工具目录'); insert into sys_menu values('4', 'PLUS官网', '0', '5', 'https://gitee.com/dromara/RuoYi-Vue-Plus', null, '', 0, 0, 'M', '0', '0', '', 'guide', 103, 1, sysdate(), null, null, 'RuoYi-Vue-Plus官网地址'); @@ -279,8 +216,6 @@ insert into sys_menu values('108', '日志管理', '1', '9', 'log', insert into sys_menu values('109', '在线用户', '2', '1', 'online', 'monitor/online/index', '', 1, 0, 'C', '0', '0', 'monitor:online:list', 'online', 103, 1, sysdate(), null, null, '在线用户菜单'); insert into sys_menu values('113', '缓存监控', '2', '5', 'cache', 'monitor/cache/index', '', 1, 0, 'C', '0', '0', 'monitor:cache:list', 'redis', 103, 1, sysdate(), null, null, '缓存监控菜单'); insert into sys_menu values('115', '代码生成', '3', '2', 'gen', 'tool/gen/index', '', 1, 0, 'C', '0', '0', 'tool:gen:list', 'code', 103, 1, sysdate(), null, null, '代码生成菜单'); -insert into sys_menu values('121', '租户管理', '6', '1', 'tenant', 'system/tenant/index', '', 1, 0, 'C', '0', '0', 'system:tenant:list', 'list', 103, 1, sysdate(), null, null, '租户管理菜单'); -insert into sys_menu values('122', '租户套餐管理', '6', '2', 'tenantPackage', 'system/tenantPackage/index', '', 1, 0, 'C', '0', '0', 'system:tenantPackage:list', 'form', 103, 1, sysdate(), null, null, '租户套餐管理菜单'); insert into sys_menu values('123', '客户端管理', '1', '11', 'client', 'system/client/index', '', 1, 0, 'C', '0', '0', 'system:client:list', 'international', 103, 1, sysdate(), null, null, '客户端管理菜单'); insert into sys_menu values('116', '修改生成配置', '3', '2', 'gen-edit/index/:tableId', 'tool/gen/editTable', '', 1, 1, 'C', '1', '0', 'tool:gen:edit', '#', 103, 1, sysdate(), null, null, '/tool/gen'); insert into sys_menu values('130', '分配用户', '1', '2', 'role-auth/user/:roleId', 'system/role/authUser', '', 1, 1, 'C', '1', '0', 'system:role:edit', '#', 103, 1, sysdate(), null, null, '/system/role'); @@ -375,18 +310,6 @@ insert into sys_menu values('1621', '配置添加', '118', '6', '#', '', '', 1, insert into sys_menu values('1622', '配置编辑', '118', '6', '#', '', '', 1, 0, 'F', '0', '0', 'system:ossConfig:edit', '#', 103, 1, sysdate(), null, null, ''); insert into sys_menu values('1623', '配置删除', '118', '6', '#', '', '', 1, 0, 'F', '0', '0', 'system:ossConfig:remove', '#', 103, 1, sysdate(), null, null, ''); --- 租户管理相关按钮 -insert into sys_menu values ('1606', '租户查询', '121', '1', '#', '', '', 1, 0, 'F', '0', '0', 'system:tenant:query', '#', 103, 1, sysdate(), null, null, ''); -insert into sys_menu values ('1607', '租户新增', '121', '2', '#', '', '', 1, 0, 'F', '0', '0', 'system:tenant:add', '#', 103, 1, sysdate(), null, null, ''); -insert into sys_menu values ('1608', '租户修改', '121', '3', '#', '', '', 1, 0, 'F', '0', '0', 'system:tenant:edit', '#', 103, 1, sysdate(), null, null, ''); -insert into sys_menu values ('1609', '租户删除', '121', '4', '#', '', '', 1, 0, 'F', '0', '0', 'system:tenant:remove', '#', 103, 1, sysdate(), null, null, ''); -insert into sys_menu values ('1610', '租户导出', '121', '5', '#', '', '', 1, 0, 'F', '0', '0', 'system:tenant:export', '#', 103, 1, sysdate(), null, null, ''); --- 租户套餐管理相关按钮 -insert into sys_menu values ('1611', '租户套餐查询', '122', '1', '#', '', '', 1, 0, 'F', '0', '0', 'system:tenantPackage:query', '#', 103, 1, sysdate(), null, null, ''); -insert into sys_menu values ('1612', '租户套餐新增', '122', '2', '#', '', '', 1, 0, 'F', '0', '0', 'system:tenantPackage:add', '#', 103, 1, sysdate(), null, null, ''); -insert into sys_menu values ('1613', '租户套餐修改', '122', '3', '#', '', '', 1, 0, 'F', '0', '0', 'system:tenantPackage:edit', '#', 103, 1, sysdate(), null, null, ''); -insert into sys_menu values ('1614', '租户套餐删除', '122', '4', '#', '', '', 1, 0, 'F', '0', '0', 'system:tenantPackage:remove', '#', 103, 1, sysdate(), null, null, ''); -insert into sys_menu values ('1615', '租户套餐导出', '122', '5', '#', '', '', 1, 0, 'F', '0', '0', 'system:tenantPackage:export', '#', 103, 1, sysdate(), null, null, ''); -- 客户端管理按钮 insert into sys_menu values('1061', '客户端管理查询', '123', '1', '#', '', '', 1, 0, 'F', '0', '0', 'system:client:query', '#', 103, 1, sysdate(), null, null, ''); insert into sys_menu values('1062', '客户端管理新增', '123', '2', '#', '', '', 1, 0, 'F', '0', '0', 'system:client:add', '#', 103, 1, sysdate(), null, null, ''); @@ -583,7 +506,6 @@ insert into sys_user_post values ('1', '1'); -- ---------------------------- create table sys_oper_log ( oper_id bigint(20) not null comment '日志主键', - tenant_id varchar(20) default '000000' comment '租户编号', title varchar(50) default '' comment '模块标题', business_type int(2) default 0 comment '业务类型(0其它 1新增 2修改 3删除)', method varchar(100) default '' comment '方法名称', @@ -626,16 +548,16 @@ create table sys_dict_type unique (tenant_id, dict_type) ) engine=innodb comment = '字典类型表'; -insert into sys_dict_type values(1, '000000', '用户性别', 'sys_user_sex', 103, 1, sysdate(), null, null, '用户性别列表'); -insert into sys_dict_type values(2, '000000', '菜单状态', 'sys_show_hide', 103, 1, sysdate(), null, null, '菜单状态列表'); -insert into sys_dict_type values(3, '000000', '系统开关', 'sys_normal_disable', 103, 1, sysdate(), null, null, '系统开关列表'); -insert into sys_dict_type values(6, '000000', '系统是否', 'sys_yes_no', 103, 1, sysdate(), null, null, '系统是否列表'); -insert into sys_dict_type values(7, '000000', '通知类型', 'sys_notice_type', 103, 1, sysdate(), null, null, '通知类型列表'); -insert into sys_dict_type values(8, '000000', '通知状态', 'sys_notice_status', 103, 1, sysdate(), null, null, '通知状态列表'); -insert into sys_dict_type values(9, '000000', '操作类型', 'sys_oper_type', 103, 1, sysdate(), null, null, '操作类型列表'); -insert into sys_dict_type values(10, '000000', '系统状态', 'sys_common_status', 103, 1, sysdate(), null, null, '登录状态列表'); -insert into sys_dict_type values(11, '000000', '授权类型', 'sys_grant_type', 103, 1, sysdate(), null, null, '认证授权类型'); -insert into sys_dict_type values(12, '000000', '设备类型', 'sys_device_type', 103, 1, sysdate(), null, null, '客户端设备类型'); +insert into sys_dict_type values(1, '用户性别', 'sys_user_sex', 103, 1, sysdate(), null, null, '用户性别列表'); +insert into sys_dict_type values(2, '菜单状态', 'sys_show_hide', 103, 1, sysdate(), null, null, '菜单状态列表'); +insert into sys_dict_type values(3, '系统开关', 'sys_normal_disable', 103, 1, sysdate(), null, null, '系统开关列表'); +insert into sys_dict_type values(6, '系统是否', 'sys_yes_no', 103, 1, sysdate(), null, null, '系统是否列表'); +insert into sys_dict_type values(7, '通知类型', 'sys_notice_type', 103, 1, sysdate(), null, null, '通知类型列表'); +insert into sys_dict_type values(8, '通知状态', 'sys_notice_status', 103, 1, sysdate(), null, null, '通知状态列表'); +insert into sys_dict_type values(9, '操作类型', 'sys_oper_type', 103, 1, sysdate(), null, null, '操作类型列表'); +insert into sys_dict_type values(10, '系统状态', 'sys_common_status', 103, 1, sysdate(), null, null, '登录状态列表'); +insert into sys_dict_type values(11, '授权类型', 'sys_grant_type', 103, 1, sysdate(), null, null, '认证授权类型'); +insert into sys_dict_type values(12, '设备类型', 'sys_device_type', 103, 1, sysdate(), null, null, '客户端设备类型'); -- ---------------------------- @@ -644,7 +566,6 @@ insert into sys_dict_type values(12, '000000', '设备类型', 'sys_device_type' create table sys_dict_data ( dict_code bigint(20) not null comment '字典编码', - tenant_id varchar(20) default '000000' comment '租户编号', dict_sort int(4) default 0 comment '字典排序', dict_label varchar(100) default '' comment '字典标签', dict_value varchar(100) default '' comment '字典键值', @@ -661,40 +582,40 @@ create table sys_dict_data primary key (dict_code) ) engine=innodb comment = '字典数据表'; -insert into sys_dict_data values(1, '000000', 1, '男', '0', 'sys_user_sex', '', '', 'Y', 103, 1, sysdate(), null, null, '性别男'); -insert into sys_dict_data values(2, '000000', 2, '女', '1', 'sys_user_sex', '', '', 'N', 103, 1, sysdate(), null, null, '性别女'); -insert into sys_dict_data values(3, '000000', 3, '未知', '2', 'sys_user_sex', '', '', 'N', 103, 1, sysdate(), null, null, '性别未知'); -insert into sys_dict_data values(4, '000000', 1, '显示', '0', 'sys_show_hide', '', 'primary', 'Y', 103, 1, sysdate(), null, null, '显示菜单'); -insert into sys_dict_data values(5, '000000', 2, '隐藏', '1', 'sys_show_hide', '', 'danger', 'N', 103, 1, sysdate(), null, null, '隐藏菜单'); -insert into sys_dict_data values(6, '000000', 1, '正常', '0', 'sys_normal_disable', '', 'primary', 'Y', 103, 1, sysdate(), null, null, '正常状态'); -insert into sys_dict_data values(7, '000000', 2, '停用', '1', 'sys_normal_disable', '', 'danger', 'N', 103, 1, sysdate(), null, null, '停用状态'); -insert into sys_dict_data values(12, '000000', 1, '是', 'Y', 'sys_yes_no', '', 'primary', 'Y', 103, 1, sysdate(), null, null, '系统默认是'); -insert into sys_dict_data values(13, '000000', 2, '否', 'N', 'sys_yes_no', '', 'danger', 'N', 103, 1, sysdate(), null, null, '系统默认否'); -insert into sys_dict_data values(14, '000000', 1, '通知', '1', 'sys_notice_type', '', 'warning', 'Y', 103, 1, sysdate(), null, null, '通知'); -insert into sys_dict_data values(15, '000000', 2, '公告', '2', 'sys_notice_type', '', 'success', 'N', 103, 1, sysdate(), null, null, '公告'); -insert into sys_dict_data values(16, '000000', 1, '正常', '0', 'sys_notice_status', '', 'primary', 'Y', 103, 1, sysdate(), null, null, '正常状态'); -insert into sys_dict_data values(17, '000000', 2, '关闭', '1', 'sys_notice_status', '', 'danger', 'N', 103, 1, sysdate(), null, null, '关闭状态'); -insert into sys_dict_data values(29, '000000', 99, '其他', '0', 'sys_oper_type', '', 'info', 'N', 103, 1, sysdate(), null, null, '其他操作'); -insert into sys_dict_data values(18, '000000', 1, '新增', '1', 'sys_oper_type', '', 'info', 'N', 103, 1, sysdate(), null, null, '新增操作'); -insert into sys_dict_data values(19, '000000', 2, '修改', '2', 'sys_oper_type', '', 'info', 'N', 103, 1, sysdate(), null, null, '修改操作'); -insert into sys_dict_data values(20, '000000', 3, '删除', '3', 'sys_oper_type', '', 'danger', 'N', 103, 1, sysdate(), null, null, '删除操作'); -insert into sys_dict_data values(21, '000000', 4, '授权', '4', 'sys_oper_type', '', 'primary', 'N', 103, 1, sysdate(), null, null, '授权操作'); -insert into sys_dict_data values(22, '000000', 5, '导出', '5', 'sys_oper_type', '', 'warning', 'N', 103, 1, sysdate(), null, null, '导出操作'); -insert into sys_dict_data values(23, '000000', 6, '导入', '6', 'sys_oper_type', '', 'warning', 'N', 103, 1, sysdate(), null, null, '导入操作'); -insert into sys_dict_data values(24, '000000', 7, '强退', '7', 'sys_oper_type', '', 'danger', 'N', 103, 1, sysdate(), null, null, '强退操作'); -insert into sys_dict_data values(25, '000000', 8, '生成代码', '8', 'sys_oper_type', '', 'warning', 'N', 103, 1, sysdate(), null, null, '生成操作'); -insert into sys_dict_data values(26, '000000', 9, '清空数据', '9', 'sys_oper_type', '', 'danger', 'N', 103, 1, sysdate(), null, null, '清空操作'); -insert into sys_dict_data values(27, '000000', 1, '成功', '0', 'sys_common_status', '', 'primary', 'N', 103, 1, sysdate(), null, null, '正常状态'); -insert into sys_dict_data values(28, '000000', 2, '失败', '1', 'sys_common_status', '', 'danger', 'N', 103, 1, sysdate(), null, null, '停用状态'); -insert into sys_dict_data values(30, '000000', 0, '密码认证', 'password', 'sys_grant_type', 'el-check-tag', 'default', 'N', 103, 1, sysdate(), null, null, '密码认证'); -insert into sys_dict_data values(31, '000000', 0, '短信认证', 'sms', 'sys_grant_type', 'el-check-tag', 'default', 'N', 103, 1, sysdate(), null, null, '短信认证'); -insert into sys_dict_data values(32, '000000', 0, '邮件认证', 'email', 'sys_grant_type', 'el-check-tag', 'default', 'N', 103, 1, sysdate(), null, null, '邮件认证'); -insert into sys_dict_data values(33, '000000', 0, '小程序认证', 'xcx', 'sys_grant_type', 'el-check-tag', 'default', 'N', 103, 1, sysdate(), null, null, '小程序认证'); -insert into sys_dict_data values(34, '000000', 0, '三方登录认证', 'social', 'sys_grant_type', 'el-check-tag', 'default', 'N', 103, 1, sysdate(), null, null, '三方登录认证'); -insert into sys_dict_data values(35, '000000', 0, 'PC', 'pc', 'sys_device_type', '', 'default', 'N', 103, 1, sysdate(), null, null, 'PC'); -insert into sys_dict_data values(36, '000000', 0, '安卓', 'android', 'sys_device_type', '', 'default', 'N', 103, 1, sysdate(), null, null, '安卓'); -insert into sys_dict_data values(37, '000000', 0, 'iOS', 'ios', 'sys_device_type', '', 'default', 'N', 103, 1, sysdate(), null, null, 'iOS'); -insert into sys_dict_data values(38, '000000', 0, '小程序', 'xcx', 'sys_device_type', '', 'default', 'N', 103, 1, sysdate(), null, null, '小程序'); +insert into sys_dict_data values(1, 1, '男', '0', 'sys_user_sex', '', '', 'Y', 103, 1, sysdate(), null, null, '性别男'); +insert into sys_dict_data values(2, 2, '女', '1', 'sys_user_sex', '', '', 'N', 103, 1, sysdate(), null, null, '性别女'); +insert into sys_dict_data values(3, 3, '未知', '2', 'sys_user_sex', '', '', 'N', 103, 1, sysdate(), null, null, '性别未知'); +insert into sys_dict_data values(4, 1, '显示', '0', 'sys_show_hide', '', 'primary', 'Y', 103, 1, sysdate(), null, null, '显示菜单'); +insert into sys_dict_data values(5, 2, '隐藏', '1', 'sys_show_hide', '', 'danger', 'N', 103, 1, sysdate(), null, null, '隐藏菜单'); +insert into sys_dict_data values(6, 1, '正常', '0', 'sys_normal_disable', '', 'primary', 'Y', 103, 1, sysdate(), null, null, '正常状态'); +insert into sys_dict_data values(7, 2, '停用', '1', 'sys_normal_disable', '', 'danger', 'N', 103, 1, sysdate(), null, null, '停用状态'); +insert into sys_dict_data values(12, 1, '是', 'Y', 'sys_yes_no', '', 'primary', 'Y', 103, 1, sysdate(), null, null, '系统默认是'); +insert into sys_dict_data values(13, 2, '否', 'N', 'sys_yes_no', '', 'danger', 'N', 103, 1, sysdate(), null, null, '系统默认否'); +insert into sys_dict_data values(14, 1, '通知', '1', 'sys_notice_type', '', 'warning', 'Y', 103, 1, sysdate(), null, null, '通知'); +insert into sys_dict_data values(15, 2, '公告', '2', 'sys_notice_type', '', 'success', 'N', 103, 1, sysdate(), null, null, '公告'); +insert into sys_dict_data values(16, 1, '正常', '0', 'sys_notice_status', '', 'primary', 'Y', 103, 1, sysdate(), null, null, '正常状态'); +insert into sys_dict_data values(17, 2, '关闭', '1', 'sys_notice_status', '', 'danger', 'N', 103, 1, sysdate(), null, null, '关闭状态'); +insert into sys_dict_data values(29, 99, '其他', '0', 'sys_oper_type', '', 'info', 'N', 103, 1, sysdate(), null, null, '其他操作'); +insert into sys_dict_data values(18, 1, '新增', '1', 'sys_oper_type', '', 'info', 'N', 103, 1, sysdate(), null, null, '新增操作'); +insert into sys_dict_data values(19, 2, '修改', '2', 'sys_oper_type', '', 'info', 'N', 103, 1, sysdate(), null, null, '修改操作'); +insert into sys_dict_data values(20, 3, '删除', '3', 'sys_oper_type', '', 'danger', 'N', 103, 1, sysdate(), null, null, '删除操作'); +insert into sys_dict_data values(21, 4, '授权', '4', 'sys_oper_type', '', 'primary', 'N', 103, 1, sysdate(), null, null, '授权操作'); +insert into sys_dict_data values(22, 5, '导出', '5', 'sys_oper_type', '', 'warning', 'N', 103, 1, sysdate(), null, null, '导出操作'); +insert into sys_dict_data values(23, 6, '导入', '6', 'sys_oper_type', '', 'warning', 'N', 103, 1, sysdate(), null, null, '导入操作'); +insert into sys_dict_data values(24, 7, '强退', '7', 'sys_oper_type', '', 'danger', 'N', 103, 1, sysdate(), null, null, '强退操作'); +insert into sys_dict_data values(25, 8, '生成代码', '8', 'sys_oper_type', '', 'warning', 'N', 103, 1, sysdate(), null, null, '生成操作'); +insert into sys_dict_data values(26, 9, '清空数据', '9', 'sys_oper_type', '', 'danger', 'N', 103, 1, sysdate(), null, null, '清空操作'); +insert into sys_dict_data values(27, 1, '成功', '0', 'sys_common_status', '', 'primary', 'N', 103, 1, sysdate(), null, null, '正常状态'); +insert into sys_dict_data values(28, 2, '失败', '1', 'sys_common_status', '', 'danger', 'N', 103, 1, sysdate(), null, null, '停用状态'); +insert into sys_dict_data values(30, 0, '密码认证', 'password', 'sys_grant_type', 'el-check-tag', 'default', 'N', 103, 1, sysdate(), null, null, '密码认证'); +insert into sys_dict_data values(31, 0, '短信认证', 'sms', 'sys_grant_type', 'el-check-tag', 'default', 'N', 103, 1, sysdate(), null, null, '短信认证'); +insert into sys_dict_data values(32, 0, '邮件认证', 'email', 'sys_grant_type', 'el-check-tag', 'default', 'N', 103, 1, sysdate(), null, null, '邮件认证'); +insert into sys_dict_data values(33, 0, '小程序认证', 'xcx', 'sys_grant_type', 'el-check-tag', 'default', 'N', 103, 1, sysdate(), null, null, '小程序认证'); +insert into sys_dict_data values(34, 0, '三方登录认证', 'social', 'sys_grant_type', 'el-check-tag', 'default', 'N', 103, 1, sysdate(), null, null, '三方登录认证'); +insert into sys_dict_data values(35, 0, 'PC', 'pc', 'sys_device_type', '', 'default', 'N', 103, 1, sysdate(), null, null, 'PC'); +insert into sys_dict_data values(36, 0, '安卓', 'android', 'sys_device_type', '', 'default', 'N', 103, 1, sysdate(), null, null, '安卓'); +insert into sys_dict_data values(37, 0, 'iOS', 'ios', 'sys_device_type', '', 'default', 'N', 103, 1, sysdate(), null, null, 'iOS'); +insert into sys_dict_data values(38, 0, '小程序', 'xcx', 'sys_device_type', '', 'default', 'N', 103, 1, sysdate(), null, null, '小程序'); -- ---------------------------- @@ -702,7 +623,6 @@ insert into sys_dict_data values(38, '000000', 0, '小程序', 'xcx', 'sy -- ---------------------------- create table sys_config ( config_id bigint(20) not null comment '参数主键', - tenant_id varchar(20) default '000000' comment '租户编号', config_name varchar(100) default '' comment '参数名称', config_key varchar(100) default '' comment '参数键名', config_value varchar(500) default '' comment '参数键值', @@ -716,11 +636,11 @@ create table sys_config ( primary key (config_id) ) engine=innodb comment = '参数配置表'; -insert into sys_config values(1, '000000', '主框架页-默认皮肤样式名称', 'sys.index.skinName', 'skin-blue', 'Y', 103, 1, sysdate(), null, null, '蓝色 skin-blue、绿色 skin-green、紫色 skin-purple、红色 skin-red、黄色 skin-yellow' ); -insert into sys_config values(2, '000000', '用户管理-账号初始密码', 'sys.user.initPassword', '123456', 'Y', 103, 1, sysdate(), null, null, '初始化密码 123456' ); -insert into sys_config values(3, '000000', '主框架页-侧边栏主题', 'sys.index.sideTheme', 'theme-dark', 'Y', 103, 1, sysdate(), null, null, '深色主题theme-dark,浅色主题theme-light' ); -insert into sys_config values(5, '000000', '账号自助-是否开启用户注册功能', 'sys.account.registerUser', 'false', 'Y', 103, 1, sysdate(), null, null, '是否开启注册用户功能(true开启,false关闭)'); -insert into sys_config values(11, '000000', 'OSS预览列表资源开关', 'sys.oss.previewListResource', 'true', 'Y', 103, 1, sysdate(), null, null, 'true:开启, false:关闭'); +insert into sys_config values(1, '主框架页-默认皮肤样式名称', 'sys.index.skinName', 'skin-blue', 'Y', 103, 1, sysdate(), null, null, '蓝色 skin-blue、绿色 skin-green、紫色 skin-purple、红色 skin-red、黄色 skin-yellow' ); +insert into sys_config values(2, '用户管理-账号初始密码', 'sys.user.initPassword', '123456', 'Y', 103, 1, sysdate(), null, null, '初始化密码 123456' ); +insert into sys_config values(3, '主框架页-侧边栏主题', 'sys.index.sideTheme', 'theme-dark', 'Y', 103, 1, sysdate(), null, null, '深色主题theme-dark,浅色主题theme-light' ); +insert into sys_config values(5, '账号自助-是否开启用户注册功能', 'sys.account.registerUser', 'false', 'Y', 103, 1, sysdate(), null, null, '是否开启注册用户功能(true开启,false关闭)'); +insert into sys_config values(11, 'OSS预览列表资源开关', 'sys.oss.previewListResource', 'true', 'Y', 103, 1, sysdate(), null, null, 'true:开启, false:关闭'); -- ---------------------------- @@ -728,7 +648,6 @@ insert into sys_config values(11, '000000', 'OSS预览列表资源开关', -- ---------------------------- create table sys_logininfor ( info_id bigint(20) not null comment '访问ID', - tenant_id varchar(20) default '000000' comment '租户编号', user_name varchar(50) default '' comment '用户账号', client_key varchar(32) default '' comment '客户端', device_type varchar(32) default '' comment '设备类型', @@ -750,7 +669,6 @@ create table sys_logininfor ( -- ---------------------------- create table sys_notice ( notice_id bigint(20) not null comment '公告ID', - tenant_id varchar(20) default '000000' comment '租户编号', notice_title varchar(50) not null comment '公告标题', notice_type char(1) not null comment '公告类型(1通知 2公告)', notice_content longblob default null comment '公告内容', @@ -767,8 +685,8 @@ create table sys_notice ( -- ---------------------------- -- 初始化-公告信息表数据 -- ---------------------------- -insert into sys_notice values('1', '000000', '温馨提醒:2018-07-01 新版本发布啦', '2', '新版本内容', '0', 103, 1, sysdate(), null, null, '管理员'); -insert into sys_notice values('2', '000000', '维护通知:2018-07-01 系统凌晨维护', '1', '维护内容', '0', 103, 1, sysdate(), null, null, '管理员'); +insert into sys_notice values('1', '温馨提醒:2018-07-01 新版本发布啦', '2', '新版本内容', '0', 103, 1, sysdate(), null, null, '管理员'); +insert into sys_notice values('2', '维护通知:2018-07-01 系统凌晨维护', '1', '维护内容', '0', 103, 1, sysdate(), null, null, '管理员'); -- ---------------------------- @@ -836,7 +754,6 @@ create table gen_table_column ( -- ---------------------------- create table sys_oss ( oss_id bigint(20) not null comment '对象存储主键', - tenant_id varchar(20) default '000000' comment '租户编号', file_name varchar(255) not null default '' comment '文件名', original_name varchar(255) not null default '' comment '原名', file_suffix varchar(10) not null default '' comment '文件后缀名', @@ -856,7 +773,6 @@ create table sys_oss ( -- ---------------------------- create table sys_oss_config ( oss_config_id bigint(20) not null comment '主键', - tenant_id varchar(20) default '000000'comment '租户编号', config_key varchar(20) not null default '' comment '配置key', access_key varchar(255) default '' comment 'accessKey', secret_key varchar(255) default '' comment '秘钥', @@ -878,11 +794,11 @@ create table sys_oss_config ( primary key (oss_config_id) ) engine=innodb comment='对象存储配置表'; -insert into sys_oss_config values (1, '000000', 'minio', 'ruoyi', 'ruoyi123', 'ruoyi', '', '127.0.0.1:9000', '','N', '', '1' ,'0', '', 103, 1, sysdate(), 1, sysdate(), null); -insert into sys_oss_config values (2, '000000', 'qiniu', 'XXXXXXXXXXXXXXX', 'XXXXXXXXXXXXXXX', 'ruoyi', '', 's3-cn-north-1.qiniucs.com', '','N', '', '1' ,'1', '', 103, 1, sysdate(), 1, sysdate(), null); -insert into sys_oss_config values (3, '000000', 'aliyun', 'XXXXXXXXXXXXXXX', 'XXXXXXXXXXXXXXX', 'ruoyi', '', 'oss-cn-beijing.aliyuncs.com', '','N', '', '1' ,'1', '', 103, 1, sysdate(), 1, sysdate(), null); -insert into sys_oss_config values (4, '000000', 'qcloud', 'XXXXXXXXXXXXXXX', 'XXXXXXXXXXXXXXX', 'ruoyi-1240000000', '', 'cos.ap-beijing.myqcloud.com', '','N', 'ap-beijing', '1' ,'1', '', 103, 1, sysdate(), 1, sysdate(), null); -insert into sys_oss_config values (5, '000000', 'image', 'ruoyi', 'ruoyi123', 'ruoyi', 'image', '127.0.0.1:9000', '','N', '', '1' ,'1', '', 103, 1, sysdate(), 1, sysdate(), null); +insert into sys_oss_config values (1, 'minio', 'ruoyi', 'ruoyi123', 'ruoyi', '', '127.0.0.1:9000', '','N', '', '1' ,'0', '', 103, 1, sysdate(), 1, sysdate(), null); +insert into sys_oss_config values (2, 'qiniu', 'XXXXXXXXXXXXXXX', 'XXXXXXXXXXXXXXX', 'ruoyi', '', 's3-cn-north-1.qiniucs.com', '','N', '', '1' ,'1', '', 103, 1, sysdate(), 1, sysdate(), null); +insert into sys_oss_config values (3, 'aliyun', 'XXXXXXXXXXXXXXX', 'XXXXXXXXXXXXXXX', 'ruoyi', '', 'oss-cn-beijing.aliyuncs.com', '','N', '', '1' ,'1', '', 103, 1, sysdate(), 1, sysdate(), null); +insert into sys_oss_config values (4, 'qcloud', 'XXXXXXXXXXXXXXX', 'XXXXXXXXXXXXXXX', 'ruoyi-1240000000', '', 'cos.ap-beijing.myqcloud.com', '','N', 'ap-beijing', '1' ,'1', '', 103, 1, sysdate(), 1, sysdate(), null); +insert into sys_oss_config values (5, 'image', 'ruoyi', 'ruoyi123', 'ruoyi', 'image', '127.0.0.1:9000', '','N', '', '1' ,'1', '', 103, 1, sysdate(), 1, sysdate(), null); -- ---------------------------- -- 系统授权表 @@ -913,7 +829,6 @@ insert into sys_client values (2, '428a8310cd442757ae699df5d894f051', 'app', 'ap CREATE TABLE test_demo ( id bigint(0) NOT NULL COMMENT '主键', - tenant_id varchar(20) NULL DEFAULT '000000' COMMENT '租户编号', dept_id bigint(0) NULL DEFAULT NULL COMMENT '部门id', user_id bigint(0) NULL DEFAULT NULL COMMENT '用户id', order_num int(0) NULL DEFAULT 0 COMMENT '排序号', @@ -932,7 +847,6 @@ CREATE TABLE test_demo CREATE TABLE test_tree ( id bigint(0) NOT NULL COMMENT '主键', - tenant_id varchar(20) NULL DEFAULT '000000' COMMENT '租户编号', parent_id bigint(0) NULL DEFAULT 0 COMMENT '父id', dept_id bigint(0) NULL DEFAULT NULL COMMENT '部门id', user_id bigint(0) NULL DEFAULT NULL COMMENT '用户id', @@ -947,30 +861,30 @@ CREATE TABLE test_tree PRIMARY KEY (id) USING BTREE ) ENGINE = InnoDB COMMENT = '测试树表'; -INSERT INTO test_demo VALUES (1, '000000', 102, 4, 1, '测试数据权限', '测试', 0, 103, sysdate(), 1, NULL, NULL, 0); -INSERT INTO test_demo VALUES (2, '000000', 102, 3, 2, '子节点1', '111', 0, 103, sysdate(), 1, NULL, NULL, 0); -INSERT INTO test_demo VALUES (3, '000000', 102, 3, 3, '子节点2', '222', 0, 103, sysdate(), 1, NULL, NULL, 0); -INSERT INTO test_demo VALUES (4, '000000', 108, 4, 4, '测试数据', 'demo', 0, 103, sysdate(), 1, NULL, NULL, 0); -INSERT INTO test_demo VALUES (5, '000000', 108, 3, 13, '子节点11', '1111', 0, 103, sysdate(), 1, NULL, NULL, 0); -INSERT INTO test_demo VALUES (6, '000000', 108, 3, 12, '子节点22', '2222', 0, 103, sysdate(), 1, NULL, NULL, 0); -INSERT INTO test_demo VALUES (7, '000000', 108, 3, 11, '子节点33', '3333', 0, 103, sysdate(), 1, NULL, NULL, 0); -INSERT INTO test_demo VALUES (8, '000000', 108, 3, 10, '子节点44', '4444', 0, 103, sysdate(), 1, NULL, NULL, 0); -INSERT INTO test_demo VALUES (9, '000000', 108, 3, 9, '子节点55', '5555', 0, 103, sysdate(), 1, NULL, NULL, 0); -INSERT INTO test_demo VALUES (10, '000000', 108, 3, 8, '子节点66', '6666', 0, 103, sysdate(), 1, NULL, NULL, 0); -INSERT INTO test_demo VALUES (11, '000000', 108, 3, 7, '子节点77', '7777', 0, 103, sysdate(), 1, NULL, NULL, 0); -INSERT INTO test_demo VALUES (12, '000000', 108, 3, 6, '子节点88', '8888', 0, 103, sysdate(), 1, NULL, NULL, 0); -INSERT INTO test_demo VALUES (13, '000000', 108, 3, 5, '子节点99', '9999', 0, 103, sysdate(), 1, NULL, NULL, 0); +INSERT INTO test_demo VALUES (1, 102, 4, 1, '测试数据权限', '测试', 0, 103, sysdate(), 1, NULL, NULL, 0); +INSERT INTO test_demo VALUES (2, 102, 3, 2, '子节点1', '111', 0, 103, sysdate(), 1, NULL, NULL, 0); +INSERT INTO test_demo VALUES (3, 102, 3, 3, '子节点2', '222', 0, 103, sysdate(), 1, NULL, NULL, 0); +INSERT INTO test_demo VALUES (4, 108, 4, 4, '测试数据', 'demo', 0, 103, sysdate(), 1, NULL, NULL, 0); +INSERT INTO test_demo VALUES (5, 108, 3, 13, '子节点11', '1111', 0, 103, sysdate(), 1, NULL, NULL, 0); +INSERT INTO test_demo VALUES (6, 108, 3, 12, '子节点22', '2222', 0, 103, sysdate(), 1, NULL, NULL, 0); +INSERT INTO test_demo VALUES (7, 108, 3, 11, '子节点33', '3333', 0, 103, sysdate(), 1, NULL, NULL, 0); +INSERT INTO test_demo VALUES (8, 108, 3, 10, '子节点44', '4444', 0, 103, sysdate(), 1, NULL, NULL, 0); +INSERT INTO test_demo VALUES (9, 108, 3, 9, '子节点55', '5555', 0, 103, sysdate(), 1, NULL, NULL, 0); +INSERT INTO test_demo VALUES (10, 108, 3, 8, '子节点66', '6666', 0, 103, sysdate(), 1, NULL, NULL, 0); +INSERT INTO test_demo VALUES (11, 108, 3, 7, '子节点77', '7777', 0, 103, sysdate(), 1, NULL, NULL, 0); +INSERT INTO test_demo VALUES (12, 108, 3, 6, '子节点88', '8888', 0, 103, sysdate(), 1, NULL, NULL, 0); +INSERT INTO test_demo VALUES (13, 108, 3, 5, '子节点99', '9999', 0, 103, sysdate(), 1, NULL, NULL, 0); -INSERT INTO test_tree VALUES (1, '000000', 0, 102, 4, '测试数据权限', 0, 103, sysdate(), 1, NULL, NULL, 0); -INSERT INTO test_tree VALUES (2, '000000', 1, 102, 3, '子节点1', 0, 103, sysdate(), 1, NULL, NULL, 0); -INSERT INTO test_tree VALUES (3, '000000', 2, 102, 3, '子节点2', 0, 103, sysdate(), 1, NULL, NULL, 0); -INSERT INTO test_tree VALUES (4, '000000', 0, 108, 4, '测试树1', 0, 103, sysdate(), 1, NULL, NULL, 0); -INSERT INTO test_tree VALUES (5, '000000', 4, 108, 3, '子节点11', 0, 103, sysdate(), 1, NULL, NULL, 0); -INSERT INTO test_tree VALUES (6, '000000', 4, 108, 3, '子节点22', 0, 103, sysdate(), 1, NULL, NULL, 0); -INSERT INTO test_tree VALUES (7, '000000', 4, 108, 3, '子节点33', 0, 103, sysdate(), 1, NULL, NULL, 0); -INSERT INTO test_tree VALUES (8, '000000', 5, 108, 3, '子节点44', 0, 103, sysdate(), 1, NULL, NULL, 0); -INSERT INTO test_tree VALUES (9, '000000', 6, 108, 3, '子节点55', 0, 103, sysdate(), 1, NULL, NULL, 0); -INSERT INTO test_tree VALUES (10, '000000', 7, 108, 3, '子节点66', 0, 103, sysdate(), 1, NULL, NULL, 0); -INSERT INTO test_tree VALUES (11, '000000', 7, 108, 3, '子节点77', 0, 103, sysdate(), 1, NULL, NULL, 0); -INSERT INTO test_tree VALUES (12, '000000', 10, 108, 3, '子节点88', 0, 103, sysdate(), 1, NULL, NULL, 0); -INSERT INTO test_tree VALUES (13, '000000', 10, 108, 3, '子节点99', 0, 103, sysdate(), 1, NULL, NULL, 0); +INSERT INTO test_tree VALUES (1, 0, 102, 4, '测试数据权限', 0, 103, sysdate(), 1, NULL, NULL, 0); +INSERT INTO test_tree VALUES (2, 1, 102, 3, '子节点1', 0, 103, sysdate(), 1, NULL, NULL, 0); +INSERT INTO test_tree VALUES (3, 2, 102, 3, '子节点2', 0, 103, sysdate(), 1, NULL, NULL, 0); +INSERT INTO test_tree VALUES (4, 0, 108, 4, '测试树1', 0, 103, sysdate(), 1, NULL, NULL, 0); +INSERT INTO test_tree VALUES (5, 4, 108, 3, '子节点11', 0, 103, sysdate(), 1, NULL, NULL, 0); +INSERT INTO test_tree VALUES (6, 4, 108, 3, '子节点22', 0, 103, sysdate(), 1, NULL, NULL, 0); +INSERT INTO test_tree VALUES (7, 4, 108, 3, '子节点33', 0, 103, sysdate(), 1, NULL, NULL, 0); +INSERT INTO test_tree VALUES (8, 5, 108, 3, '子节点44', 0, 103, sysdate(), 1, NULL, NULL, 0); +INSERT INTO test_tree VALUES (9, 6, 108, 3, '子节点55', 0, 103, sysdate(), 1, NULL, NULL, 0); +INSERT INTO test_tree VALUES (10, 7, 108, 3, '子节点66', 0, 103, sysdate(), 1, NULL, NULL, 0); +INSERT INTO test_tree VALUES (11, 7, 108, 3, '子节点77', 0, 103, sysdate(), 1, NULL, NULL, 0); +INSERT INTO test_tree VALUES (12, 10, 108, 3, '子节点88', 0, 103, sysdate(), 1, NULL, NULL, 0); +INSERT INTO test_tree VALUES (13, 10, 108, 3, '子节点99', 0, 103, sysdate(), 1, NULL, NULL, 0); diff --git a/script/sql/ry_workflow.sql b/script/sql/ry_workflow.sql index c911a5bd1..3ad4f0d36 100644 --- a/script/sql/ry_workflow.sql +++ b/script/sql/ry_workflow.sql @@ -166,7 +166,6 @@ CREATE TABLE `flow_user` create table flow_category ( category_id bigint(20) not null comment '流程分类ID', - tenant_id varchar(20) default '000000' comment '租户编号', parent_id bigint(20) default 0 comment '父流程分类id', ancestors varchar(500) default '' comment '祖级列表', category_name varchar(30) not null comment '流程分类名称', @@ -180,16 +179,16 @@ create table flow_category primary key (category_id) ) engine = innodb comment = '流程分类'; -INSERT INTO flow_category values (100, '000000', 0, '0', 'OA审批', 0, '0', 103, 1, sysdate(), null, null); -INSERT INTO flow_category values (101, '000000', 100, '0,100', '假勤管理', 0, '0', 103, 1, sysdate(), null, null); -INSERT INTO flow_category values (102, '000000', 100, '0,100', '人事管理', 1, '0', 103, 1, sysdate(), null, null); -INSERT INTO flow_category values (103, '000000', 101, '0,100,101', '请假', 0, '0', 103, 1, sysdate(), null, null); -INSERT INTO flow_category values (104, '000000', 101, '0,100,101', '出差', 1, '0', 103, 1, sysdate(), null, null); -INSERT INTO flow_category values (105, '000000', 101, '0,100,101', '加班', 2, '0', 103, 1, sysdate(), null, null); -INSERT INTO flow_category values (106, '000000', 101, '0,100,101', '换班', 3, '0', 103, 1, sysdate(), null, null); -INSERT INTO flow_category values (107, '000000', 101, '0,100,101', '外出', 4, '0', 103, 1, sysdate(), null, null); -INSERT INTO flow_category values (108, '000000', 102, '0,100,102', '转正', 1, '0', 103, 1, sysdate(), null, null); -INSERT INTO flow_category values (109, '000000', 102, '0,100,102', '离职', 2, '0', 103, 1, sysdate(), null, null); +INSERT INTO flow_category values (100, 0, '0', 'OA审批', 0, '0', 103, 1, sysdate(), null, null); +INSERT INTO flow_category values (101, 100, '0,100', '假勤管理', 0, '0', 103, 1, sysdate(), null, null); +INSERT INTO flow_category values (102, 100, '0,100', '人事管理', 1, '0', 103, 1, sysdate(), null, null); +INSERT INTO flow_category values (103, 101, '0,100,101', '请假', 0, '0', 103, 1, sysdate(), null, null); +INSERT INTO flow_category values (104, 101, '0,100,101', '出差', 1, '0', 103, 1, sysdate(), null, null); +INSERT INTO flow_category values (105, 101, '0,100,101', '加班', 2, '0', 103, 1, sysdate(), null, null); +INSERT INTO flow_category values (106, 101, '0,100,101', '换班', 3, '0', 103, 1, sysdate(), null, null); +INSERT INTO flow_category values (107, 101, '0,100,101', '外出', 4, '0', 103, 1, sysdate(), null, null); +INSERT INTO flow_category values (108, 102, '0,100,102', '转正', 1, '0', 103, 1, sysdate(), null, null); +INSERT INTO flow_category values (109, 102, '0,100,102', '离职', 2, '0', 103, 1, sysdate(), null, null); -- ---------------------------- -- 流程spel表达式定义表 @@ -221,7 +220,6 @@ INSERT INTO flow_spel VALUES (2, NULL, NULL, 'initiator', '${initiator}', '流 create table flow_instance_biz_ext ( id bigint not null comment '主键id', - tenant_id varchar(20) default '000000' null comment '租户编号', create_dept bigint null comment '创建部门', create_by bigint null comment '创建者', create_time datetime null comment '创建时间', @@ -242,7 +240,6 @@ create table flow_instance_biz_ext ( create table test_leave ( id bigint(20) not null comment 'id', - tenant_id varchar(20) default '000000' comment '租户编号', apply_code varchar(50) not null comment '申请编号', leave_type varchar(255) not null comment '请假类型', start_date datetime not null comment '开始时间', @@ -292,28 +289,28 @@ insert into sys_menu VALUES ('11641', '请假申请修改', '11638', 3, '#', '', insert into sys_menu VALUES ('11642', '请假申请删除', '11638', 4, '#', '', '', 1, 0, 'F', '0', '0', 'workflow:leave:remove', '#', 103, 1, sysdate(), NULL, NULL, ''); insert into sys_menu VALUES ('11643', '请假申请导出', '11638', 5, '#', '', '', 1, 0, 'F', '0', '0', 'workflow:leave:export', '#', 103, 1, sysdate(), NULL, NULL, ''); -INSERT INTO sys_dict_type VALUES (13, '000000', '业务状态', 'wf_business_status', 103, 1, sysdate(), NULL, NULL, '业务状态列表'); -INSERT INTO sys_dict_type VALUES (14, '000000', '表单类型', 'wf_form_type', 103, 1, sysdate(), NULL, NULL, '表单类型列表'); -INSERT INTO sys_dict_type VALUES (15, '000000', '任务状态', 'wf_task_status', 103, 1, sysdate(), NULL, NULL, '任务状态'); -INSERT INTO sys_dict_data VALUES (39, '000000', 1, '已撤销', 'cancel', 'wf_business_status', '', 'danger', 'N', 103, 1, sysdate(), NULL, NULL,'已撤销'); -INSERT INTO sys_dict_data VALUES (40, '000000', 2, '草稿', 'draft', 'wf_business_status', '', 'info', 'N', 103, 1, sysdate(), NULL, NULL, '草稿'); -INSERT INTO sys_dict_data VALUES (41, '000000', 3, '待审核', 'waiting', 'wf_business_status', '', 'primary', 'N', 103, 1, sysdate(), NULL, NULL,'待审核'); -INSERT INTO sys_dict_data VALUES (42, '000000', 4, '已完成', 'finish', 'wf_business_status', '', 'success', 'N', 103, 1, sysdate(), NULL, NULL,'已完成'); -INSERT INTO sys_dict_data VALUES (43, '000000', 5, '已作废', 'invalid', 'wf_business_status', '', 'danger', 'N', 103, 1, sysdate(), NULL, NULL,'已作废'); -INSERT INTO sys_dict_data VALUES (44, '000000', 6, '已退回', 'back', 'wf_business_status', '', 'danger', 'N', 103, 1, sysdate(), NULL, NULL,'已退回'); -INSERT INTO sys_dict_data VALUES (45, '000000', 7, '已终止', 'termination', 'wf_business_status', '', 'danger', 'N', 103, 1, sysdate(), NULL,NULL, '已终止'); -INSERT INTO sys_dict_data VALUES (46, '000000', 1, '自定义表单', 'static', 'wf_form_type', '', 'success', 'N', 103, 1, sysdate(), NULL, NULL,'自定义表单'); -INSERT INTO sys_dict_data VALUES (47, '000000', 2, '动态表单', 'dynamic', 'wf_form_type', '', 'primary', 'N', 103, 1, sysdate(), NULL, NULL,'动态表单'); -INSERT INTO sys_dict_data VALUES (48, '000000', 1, '撤销', 'cancel', 'wf_task_status', '', 'danger', 'N', 103, 1, sysdate(), NULL, NULL, '撤销'); -INSERT INTO sys_dict_data VALUES (49, '000000', 2, '通过', 'pass', 'wf_task_status', '', 'success', 'N', 103, 1, sysdate(), NULL, NULL, '通过'); -INSERT INTO sys_dict_data VALUES (50, '000000', 3, '待审核', 'waiting', 'wf_task_status', '', 'primary', 'N', 103, 1, sysdate(), NULL, NULL, '待审核'); -INSERT INTO sys_dict_data VALUES (51, '000000', 4, '作废', 'invalid', 'wf_task_status', '', 'danger', 'N', 103, 1, sysdate(), NULL, NULL, '作废'); -INSERT INTO sys_dict_data VALUES (52, '000000', 5, '退回', 'back', 'wf_task_status', '', 'danger', 'N', 103, 1, sysdate(), NULL, NULL, '退回'); -INSERT INTO sys_dict_data VALUES (53, '000000', 6, '终止', 'termination', 'wf_task_status', '', 'danger', 'N', 103, 1, sysdate(), NULL, NULL, '终止'); -INSERT INTO sys_dict_data VALUES (54, '000000', 7, '转办', 'transfer', 'wf_task_status', '', 'primary', 'N', 103, 1, sysdate(), NULL, NULL, '转办'); -INSERT INTO sys_dict_data VALUES (55, '000000', 8, '委托', 'depute', 'wf_task_status', '', 'primary', 'N', 103, 1, sysdate(), NULL, NULL, '委托'); -INSERT INTO sys_dict_data VALUES (56, '000000', 9, '抄送', 'copy', 'wf_task_status', '', 'primary', 'N', 103, 1, sysdate(), NULL, NULL, '抄送'); -INSERT INTO sys_dict_data VALUES (57, '000000', 10, '加签', 'sign', 'wf_task_status', '', 'primary', 'N', 103, 1, sysdate(), NULL, NULL, '加签'); -INSERT INTO sys_dict_data VALUES (58, '000000', 11, '减签', 'sign_off', 'wf_task_status', '', 'danger', 'N', 103, 1, sysdate(), NULL, NULL, '减签'); -INSERT INTO sys_dict_data VALUES (59, '000000', 11, '超时', 'timeout', 'wf_task_status', '', 'danger', 'N', 103, 1, sysdate(), NULL, NULL, '超时'); +INSERT INTO sys_dict_type VALUES (13, '业务状态', 'wf_business_status', 103, 1, sysdate(), NULL, NULL, '业务状态列表'); +INSERT INTO sys_dict_type VALUES (14, '表单类型', 'wf_form_type', 103, 1, sysdate(), NULL, NULL, '表单类型列表'); +INSERT INTO sys_dict_type VALUES (15, '任务状态', 'wf_task_status', 103, 1, sysdate(), NULL, NULL, '任务状态'); +INSERT INTO sys_dict_data VALUES (39, 1, '已撤销', 'cancel', 'wf_business_status', '', 'danger', 'N', 103, 1, sysdate(), NULL, NULL,'已撤销'); +INSERT INTO sys_dict_data VALUES (40, 2, '草稿', 'draft', 'wf_business_status', '', 'info', 'N', 103, 1, sysdate(), NULL, NULL, '草稿'); +INSERT INTO sys_dict_data VALUES (41, 3, '待审核', 'waiting', 'wf_business_status', '', 'primary', 'N', 103, 1, sysdate(), NULL, NULL,'待审核'); +INSERT INTO sys_dict_data VALUES (42, 4, '已完成', 'finish', 'wf_business_status', '', 'success', 'N', 103, 1, sysdate(), NULL, NULL,'已完成'); +INSERT INTO sys_dict_data VALUES (43, 5, '已作废', 'invalid', 'wf_business_status', '', 'danger', 'N', 103, 1, sysdate(), NULL, NULL,'已作废'); +INSERT INTO sys_dict_data VALUES (44, 6, '已退回', 'back', 'wf_business_status', '', 'danger', 'N', 103, 1, sysdate(), NULL, NULL,'已退回'); +INSERT INTO sys_dict_data VALUES (45, 7, '已终止', 'termination', 'wf_business_status', '', 'danger', 'N', 103, 1, sysdate(), NULL,NULL, '已终止'); +INSERT INTO sys_dict_data VALUES (46, 1, '自定义表单', 'static', 'wf_form_type', '', 'success', 'N', 103, 1, sysdate(), NULL, NULL,'自定义表单'); +INSERT INTO sys_dict_data VALUES (47, 2, '动态表单', 'dynamic', 'wf_form_type', '', 'primary', 'N', 103, 1, sysdate(), NULL, NULL,'动态表单'); +INSERT INTO sys_dict_data VALUES (48, 1, '撤销', 'cancel', 'wf_task_status', '', 'danger', 'N', 103, 1, sysdate(), NULL, NULL, '撤销'); +INSERT INTO sys_dict_data VALUES (49, 2, '通过', 'pass', 'wf_task_status', '', 'success', 'N', 103, 1, sysdate(), NULL, NULL, '通过'); +INSERT INTO sys_dict_data VALUES (50, 3, '待审核', 'waiting', 'wf_task_status', '', 'primary', 'N', 103, 1, sysdate(), NULL, NULL, '待审核'); +INSERT INTO sys_dict_data VALUES (51, 4, '作废', 'invalid', 'wf_task_status', '', 'danger', 'N', 103, 1, sysdate(), NULL, NULL, '作废'); +INSERT INTO sys_dict_data VALUES (52, 5, '退回', 'back', 'wf_task_status', '', 'danger', 'N', 103, 1, sysdate(), NULL, NULL, '退回'); +INSERT INTO sys_dict_data VALUES (53, 6, '终止', 'termination', 'wf_task_status', '', 'danger', 'N', 103, 1, sysdate(), NULL, NULL, '终止'); +INSERT INTO sys_dict_data VALUES (54, 7, '转办', 'transfer', 'wf_task_status', '', 'primary', 'N', 103, 1, sysdate(), NULL, NULL, '转办'); +INSERT INTO sys_dict_data VALUES (55, 8, '委托', 'depute', 'wf_task_status', '', 'primary', 'N', 103, 1, sysdate(), NULL, NULL, '委托'); +INSERT INTO sys_dict_data VALUES (56, 9, '抄送', 'copy', 'wf_task_status', '', 'primary', 'N', 103, 1, sysdate(), NULL, NULL, '抄送'); +INSERT INTO sys_dict_data VALUES (57, 10, '加签', 'sign', 'wf_task_status', '', 'primary', 'N', 103, 1, sysdate(), NULL, NULL, '加签'); +INSERT INTO sys_dict_data VALUES (58, 11, '减签', 'sign_off', 'wf_task_status', '', 'danger', 'N', 103, 1, sysdate(), NULL, NULL, '减签'); +INSERT INTO sys_dict_data VALUES (59, 11, '超时', 'timeout', 'wf_task_status', '', 'danger', 'N', 103, 1, sysdate(), NULL, NULL, '超时'); diff --git a/script/sql/sqlserver/sqlserver_ry_vue_5.X.sql b/script/sql/sqlserver/sqlserver_ry_vue_5.X.sql index 295cc8e36..056f909ae 100644 --- a/script/sql/sqlserver/sqlserver_ry_vue_5.X.sql +++ b/script/sql/sqlserver/sqlserver_ry_vue_5.X.sql @@ -2,7 +2,6 @@ create table sys_social ( id bigint NOT NULL, user_id bigint NOT NULL, - tenant_id nvarchar(20) DEFAULT ('000000') NULL, auth_id nvarchar(255) NOT NULL, source nvarchar(255) NOT NULL, open_id nvarchar(255) NULL, @@ -48,12 +47,6 @@ EXEC sys.sp_addextendedproperty 'TABLE', N'sys_social', 'COLUMN', N'user_id' GO -EXEC sys.sp_addextendedproperty - 'MS_Description', N'租户id' , - 'SCHEMA', N'dbo', - 'TABLE', N'sys_social', - 'COLUMN', N'tenant_id' -GO EXEC sys.sp_addextendedproperty 'MS_Description', N'平台+平台唯一id' , 'SCHEMA', N'dbo', @@ -216,258 +209,6 @@ EXEC sp_addextendedproperty 'TABLE', N'sys_social' GO -CREATE TABLE sys_tenant -( - id bigint NOT NULL, - tenant_id nvarchar(20) NOT NULL, - contact_user_name nvarchar(20) NULL, - contact_phone nvarchar(20) NULL, - company_name nvarchar(30) NULL, - license_number nvarchar(30) NULL, - address nvarchar(200) NULL, - intro nvarchar(200) NULL, - domain nvarchar(200) NULL, - remark nvarchar(200) NULL, - package_id bigint NULL, - expire_time datetime2(7) NULL, - account_count int DEFAULT ((-1)) NULL, - status nchar(1) DEFAULT ('0') NULL, - del_flag nchar(1) DEFAULT ('0') NULL, - create_dept bigint NULL, - create_by bigint NULL, - create_time datetime2(7) NULL, - update_by bigint NULL, - update_time datetime2(7) NULL, - CONSTRAINT PK__sys_tenant__B21E8F2427725F8A PRIMARY KEY CLUSTERED (id) - WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) - ON [PRIMARY] -) -ON [PRIMARY] -GO - -EXEC sys.sp_addextendedproperty - 'MS_Description', N'id' , - 'SCHEMA', N'dbo', - 'TABLE', N'sys_tenant', - 'COLUMN', N'id' -GO -EXEC sys.sp_addextendedproperty - 'MS_Description', N'租户编号' , - 'SCHEMA', N'dbo', - 'TABLE', N'sys_tenant', - 'COLUMN', N'tenant_id' -GO -EXEC sys.sp_addextendedproperty - 'MS_Description', N'联系人' , - 'SCHEMA', N'dbo', - 'TABLE', N'sys_tenant', - 'COLUMN', N'contact_user_name' -GO -EXEC sys.sp_addextendedproperty - 'MS_Description', N'联系电话' , - 'SCHEMA', N'dbo', - 'TABLE', N'sys_tenant', - 'COLUMN', N'contact_phone' -GO -EXEC sys.sp_addextendedproperty - 'MS_Description', N'企业名称' , - 'SCHEMA', N'dbo', - 'TABLE', N'sys_tenant', - 'COLUMN', N'company_name' -GO -EXEC sys.sp_addextendedproperty - 'MS_Description', N'统一社会信用代码' , - 'SCHEMA', N'dbo', - 'TABLE', N'sys_tenant', - 'COLUMN', N'license_number' -GO -EXEC sys.sp_addextendedproperty - 'MS_Description', N'地址' , - 'SCHEMA', N'dbo', - 'TABLE', N'sys_tenant', - 'COLUMN', N'address' -GO -EXEC sys.sp_addextendedproperty - 'MS_Description', N'企业简介' , - 'SCHEMA', N'dbo', - 'TABLE', N'sys_tenant', - 'COLUMN', N'intro' -GO -EXEC sys.sp_addextendedproperty - 'MS_Description', N'域名' , - 'SCHEMA', N'dbo', - 'TABLE', N'sys_tenant', - 'COLUMN', N'domain' -GO -EXEC sys.sp_addextendedproperty - 'MS_Description', N'备注' , - 'SCHEMA', N'dbo', - 'TABLE', N'sys_tenant', - 'COLUMN', N'remark' -GO -EXEC sys.sp_addextendedproperty - 'MS_Description', N'租户套餐编号' , - 'SCHEMA', N'dbo', - 'TABLE', N'sys_tenant', - 'COLUMN', N'package_id' -GO -EXEC sys.sp_addextendedproperty - 'MS_Description', N'过期时间' , - 'SCHEMA', N'dbo', - 'TABLE', N'sys_tenant', - 'COLUMN', N'expire_time' -GO -EXEC sys.sp_addextendedproperty - 'MS_Description', N'用户数量(-1不限制)' , - 'SCHEMA', N'dbo', - 'TABLE', N'sys_tenant', - 'COLUMN', N'account_count' -GO -EXEC sys.sp_addextendedproperty - 'MS_Description', N'租户状态(0正常 1停用)' , - 'SCHEMA', N'dbo', - 'TABLE', N'sys_tenant', - 'COLUMN', N'status' -GO -EXEC sys.sp_addextendedproperty - 'MS_Description', N'删除标志(0代表存在 1代表删除)' , - 'SCHEMA', N'dbo', - 'TABLE', N'sys_tenant', - 'COLUMN', N'del_flag' -GO -EXEC sys.sp_addextendedproperty - 'MS_Description', N'创建部门' , - 'SCHEMA', N'dbo', - 'TABLE', N'sys_tenant', - 'COLUMN', N'create_dept' -GO -EXEC sys.sp_addextendedproperty - 'MS_Description', N'创建者' , - 'SCHEMA', N'dbo', - 'TABLE', N'sys_tenant', - 'COLUMN', N'create_by' -GO -EXEC sys.sp_addextendedproperty - 'MS_Description', N'创建时间' , - 'SCHEMA', N'dbo', - 'TABLE', N'sys_tenant', - 'COLUMN', N'create_time' -GO -EXEC sys.sp_addextendedproperty - 'MS_Description', N'更新者' , - 'SCHEMA', N'dbo', - 'TABLE', N'sys_tenant', - 'COLUMN', N'update_by' -GO -EXEC sys.sp_addextendedproperty - 'MS_Description', N'更新时间' , - 'SCHEMA', N'dbo', - 'TABLE', N'sys_tenant', - 'COLUMN', N'update_time' -GO -EXEC sys.sp_addextendedproperty - 'MS_Description', N'租户表' , - 'SCHEMA', N'dbo', - 'TABLE', N'sys_tenant' -GO - -INSERT sys_tenant VALUES (1, N'000000', N'管理组', N'15888888888', N'XXX有限公司', NULL, NULL, N'多租户通用后台管理管理系统', NULL, NULL, NULL, NULL, -1, N'0', N'0', 103, 1, getdate(), NULL, NULL) -GO - - -CREATE TABLE sys_tenant_package -( - package_id bigint NOT NULL, - package_name nvarchar(20) NOT NULL, - menu_ids nvarchar(3000) NULL, - remark nvarchar(200) NULL, - menu_check_strictly tinyint DEFAULT ((1)) NULL, - status nchar(1) DEFAULT ('0') NULL, - del_flag nchar(1) DEFAULT ('0') NULL, - create_dept bigint NULL, - create_by bigint NULL, - create_time datetime2(7) NULL, - update_by bigint NULL, - update_time datetime2(7) NULL, - CONSTRAINT PK__sys_tenant_package__B21E8F2427725F8A PRIMARY KEY CLUSTERED (package_id) - WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) - ON [PRIMARY] -) -ON [PRIMARY] -GO - -EXEC sys.sp_addextendedproperty - 'MS_Description', N'租户套餐id' , - 'SCHEMA', N'dbo', - 'TABLE', N'sys_tenant_package', - 'COLUMN', N'package_id' -GO -EXEC sys.sp_addextendedproperty - 'MS_Description', N'套餐名称' , - 'SCHEMA', N'dbo', - 'TABLE', N'sys_tenant_package', - 'COLUMN', N'package_name' -GO -EXEC sys.sp_addextendedproperty - 'MS_Description', N'关联菜单id' , - 'SCHEMA', N'dbo', - 'TABLE', N'sys_tenant_package', - 'COLUMN', N'menu_ids' -GO -EXEC sys.sp_addextendedproperty - 'MS_Description', N'备注' , - 'SCHEMA', N'dbo', - 'TABLE', N'sys_tenant_package', - 'COLUMN', N'remark' -GO -EXEC sys.sp_addextendedproperty - 'MS_Description', N'租户状态(0正常 1停用)' , - 'SCHEMA', N'dbo', - 'TABLE', N'sys_tenant_package', - 'COLUMN', N'status' -GO -EXEC sys.sp_addextendedproperty - 'MS_Description', N'删除标志(0代表存在 1代表删除)' , - 'SCHEMA', N'dbo', - 'TABLE', N'sys_tenant_package', - 'COLUMN', N'del_flag' -GO -EXEC sys.sp_addextendedproperty - 'MS_Description', N'创建部门' , - 'SCHEMA', N'dbo', - 'TABLE', N'sys_tenant_package', - 'COLUMN', N'create_dept' -GO -EXEC sys.sp_addextendedproperty - 'MS_Description', N'创建者' , - 'SCHEMA', N'dbo', - 'TABLE', N'sys_tenant_package', - 'COLUMN', N'create_by' -GO -EXEC sys.sp_addextendedproperty - 'MS_Description', N'创建时间' , - 'SCHEMA', N'dbo', - 'TABLE', N'sys_tenant_package', - 'COLUMN', N'create_time' -GO -EXEC sys.sp_addextendedproperty - 'MS_Description', N'更新者' , - 'SCHEMA', N'dbo', - 'TABLE', N'sys_tenant_package', - 'COLUMN', N'update_by' -GO -EXEC sys.sp_addextendedproperty - 'MS_Description', N'更新时间' , - 'SCHEMA', N'dbo', - 'TABLE', N'sys_tenant_package', - 'COLUMN', N'update_time' -GO -EXEC sys.sp_addextendedproperty - 'MS_Description', N'租户套餐表' , - 'SCHEMA', N'dbo', - 'TABLE', N'sys_tenant_package' -GO - CREATE TABLE gen_table ( @@ -817,7 +558,6 @@ GO CREATE TABLE sys_config ( config_id bigint NOT NULL, - tenant_id nvarchar(20) DEFAULT '000000' NULL, config_name nvarchar(100) DEFAULT '' NULL, config_key nvarchar(100) DEFAULT '' NULL, config_value nvarchar(500) DEFAULT '' NULL, @@ -841,12 +581,6 @@ EXEC sys.sp_addextendedproperty 'TABLE', N'sys_config', 'COLUMN', N'config_id' GO -EXEC sys.sp_addextendedproperty - 'MS_Description', N'租户编号' , - 'SCHEMA', N'dbo', - 'TABLE', N'sys_config', - 'COLUMN', N'tenant_id' -GO EXEC sys.sp_addextendedproperty 'MS_Description', N'参数名称' , 'SCHEMA', N'dbo', @@ -913,21 +647,20 @@ EXEC sys.sp_addextendedproperty 'TABLE', N'sys_config' GO -INSERT sys_config VALUES (1, N'000000', N'主框架页-默认皮肤样式名称', N'sys.index.skinName', N'skin-blue', N'Y', 103, 1, getdate(), NULL, NULL, N'蓝色 skin-blue、绿色 skin-green、紫色 skin-purple、红色 skin-red、黄色 skin-yellow') +INSERT sys_config VALUES (1, N'主框架页-默认皮肤样式名称', N'sys.index.skinName', N'skin-blue', N'Y', 103, 1, getdate(), NULL, NULL, N'蓝色 skin-blue、绿色 skin-green、紫色 skin-purple、红色 skin-red、黄色 skin-yellow') GO -INSERT sys_config VALUES (2, N'000000', N'用户管理-账号初始密码', N'sys.user.initPassword', N'123456', N'Y', 103, 1, getdate(), NULL, NULL, N'初始化密码 123456') +INSERT sys_config VALUES (2, N'用户管理-账号初始密码', N'sys.user.initPassword', N'123456', N'Y', 103, 1, getdate(), NULL, NULL, N'初始化密码 123456') GO -INSERT sys_config VALUES (3, N'000000', N'主框架页-侧边栏主题', N'sys.index.sideTheme', N'theme-dark', N'Y', 103, 1, getdate(), NULL, NULL, N'深色主题theme-dark,浅色主题theme-light') +INSERT sys_config VALUES (3, N'主框架页-侧边栏主题', N'sys.index.sideTheme', N'theme-dark', N'Y', 103, 1, getdate(), NULL, NULL, N'深色主题theme-dark,浅色主题theme-light') GO -INSERT sys_config VALUES (5, N'000000', N'账号自助-是否开启用户注册功能', N'sys.account.registerUser', N'false', N'Y', 103, 1, getdate(), NULL, NULL, N'是否开启注册用户功能(true开启,false关闭)') +INSERT sys_config VALUES (5, N'账号自助-是否开启用户注册功能', N'sys.account.registerUser', N'false', N'Y', 103, 1, getdate(), NULL, NULL, N'是否开启注册用户功能(true开启,false关闭)') GO -INSERT sys_config VALUES (11, N'000000', N'OSS预览列表资源开关', N'sys.oss.previewListResource', N'true', N'Y', 103, 1, getdate(), NULL, NULL, N'true:开启, false:关闭'); +INSERT sys_config VALUES (11, N'OSS预览列表资源开关', N'sys.oss.previewListResource', N'true', N'Y', 103, 1, getdate(), NULL, NULL, N'true:开启, false:关闭'); GO CREATE TABLE sys_dept ( dept_id bigint NOT NULL, - tenant_id nvarchar(20) DEFAULT ('000000') NULL, parent_id bigint DEFAULT ((0)) NULL, ancestors nvarchar(500)DEFAULT '' NULL, dept_name nvarchar(30) NULL, @@ -956,12 +689,6 @@ EXEC sys.sp_addextendedproperty 'TABLE', N'sys_dept', 'COLUMN', N'dept_id' GO -EXEC sys.sp_addextendedproperty - 'MS_Description', N'租户编号' , - 'SCHEMA', N'dbo', - 'TABLE', N'sys_dept', - 'COLUMN', N'tenant_id' -GO EXEC sys.sp_addextendedproperty 'MS_Description', N'父部门id' , 'SCHEMA', N'dbo', @@ -1058,31 +785,30 @@ EXEC sys.sp_addextendedproperty 'TABLE', N'sys_dept' GO -INSERT sys_dept VALUES (100, N'000000', 0, N'0', N'XXX科技', NULL, 0, NULL, N'15888888888', N'xxx@qq.com', N'0', N'0', 103, 1, getdate(), NULL, NULL) +INSERT sys_dept VALUES (100, 0, N'0', N'XXX科技', NULL, 0, NULL, N'15888888888', N'xxx@qq.com', N'0', N'0', 103, 1, getdate(), NULL, NULL) GO -INSERT sys_dept VALUES (101, N'000000', 100, N'0,100', N'深圳总公司', NULL, 1, NULL, N'15888888888', N'xxx@qq.com', N'0', N'0', 103, 1, getdate(), NULL, NULL) +INSERT sys_dept VALUES (101, 100, N'0,100', N'深圳总公司', NULL, 1, NULL, N'15888888888', N'xxx@qq.com', N'0', N'0', 103, 1, getdate(), NULL, NULL) GO -INSERT sys_dept VALUES (102, N'000000', 100, N'0,100', N'长沙分公司', NULL, 2, NULL, N'15888888888', N'xxx@qq.com', N'0', N'0', 103, 1, getdate(), NULL, NULL) +INSERT sys_dept VALUES (102, 100, N'0,100', N'长沙分公司', NULL, 2, NULL, N'15888888888', N'xxx@qq.com', N'0', N'0', 103, 1, getdate(), NULL, NULL) GO -INSERT sys_dept VALUES (103, N'000000', 101, N'0,100,101', N'研发部门', NULL, 1, 1, N'15888888888', N'xxx@qq.com', N'0', N'0', 103, 1, getdate(), NULL, NULL) +INSERT sys_dept VALUES (103, 101, N'0,100,101', N'研发部门', NULL, 1, 1, N'15888888888', N'xxx@qq.com', N'0', N'0', 103, 1, getdate(), NULL, NULL) GO -INSERT sys_dept VALUES (104, N'000000', 101, N'0,100,101', N'市场部门', NULL, 2, NULL, N'15888888888', N'xxx@qq.com', N'0', N'0', 103, 1, getdate(), NULL, NULL) +INSERT sys_dept VALUES (104, 101, N'0,100,101', N'市场部门', NULL, 2, NULL, N'15888888888', N'xxx@qq.com', N'0', N'0', 103, 1, getdate(), NULL, NULL) GO -INSERT sys_dept VALUES (105, N'000000', 101, N'0,100,101', N'测试部门', NULL, 3, NULL, N'15888888888', N'xxx@qq.com', N'0', N'0', 103, 1, getdate(), NULL, NULL) +INSERT sys_dept VALUES (105, 101, N'0,100,101', N'测试部门', NULL, 3, NULL, N'15888888888', N'xxx@qq.com', N'0', N'0', 103, 1, getdate(), NULL, NULL) GO -INSERT sys_dept VALUES (106, N'000000', 101, N'0,100,101', N'财务部门', NULL, 4, NULL, N'15888888888', N'xxx@qq.com', N'0', N'0', 103, 1, getdate(), NULL, NULL) +INSERT sys_dept VALUES (106, 101, N'0,100,101', N'财务部门', NULL, 4, NULL, N'15888888888', N'xxx@qq.com', N'0', N'0', 103, 1, getdate(), NULL, NULL) GO -INSERT sys_dept VALUES (107, N'000000', 101, N'0,100,101', N'运维部门', NULL, 5, NULL, N'15888888888', N'xxx@qq.com', N'0', N'0', 103, 1, getdate(), NULL, NULL) +INSERT sys_dept VALUES (107, 101, N'0,100,101', N'运维部门', NULL, 5, NULL, N'15888888888', N'xxx@qq.com', N'0', N'0', 103, 1, getdate(), NULL, NULL) GO -INSERT sys_dept VALUES (108, N'000000', 102, N'0,100,102', N'市场部门', NULL, 1, NULL, N'15888888888', N'xxx@qq.com', N'0', N'0', 103, 1, getdate(), NULL, NULL) +INSERT sys_dept VALUES (108, 102, N'0,100,102', N'市场部门', NULL, 1, NULL, N'15888888888', N'xxx@qq.com', N'0', N'0', 103, 1, getdate(), NULL, NULL) GO -INSERT sys_dept VALUES (109, N'000000', 102, N'0,100,102', N'财务部门', NULL, 2, NULL, N'15888888888', N'xxx@qq.com', N'0', N'0', 103, 1, getdate(), NULL, NULL) +INSERT sys_dept VALUES (109, 102, N'0,100,102', N'财务部门', NULL, 2, NULL, N'15888888888', N'xxx@qq.com', N'0', N'0', 103, 1, getdate(), NULL, NULL) GO CREATE TABLE sys_dict_data ( dict_code bigint NOT NULL, - tenant_id nvarchar(20) DEFAULT ('000000') NULL, dict_sort int DEFAULT ((0)) NULL, dict_label nvarchar(100) DEFAULT '' NULL, dict_value nvarchar(100) DEFAULT '' NULL, @@ -1109,12 +835,6 @@ EXEC sys.sp_addextendedproperty 'TABLE', N'sys_dict_data', 'COLUMN', N'dict_code' GO -EXEC sys.sp_addextendedproperty - 'MS_Description', N'字典编码' , - 'SCHEMA', N'dbo', - 'TABLE', N'sys_dict_data', - 'COLUMN', N'tenant_id' -GO EXEC sys.sp_addextendedproperty 'MS_Description', N'字典排序' , 'SCHEMA', N'dbo', @@ -1199,87 +919,86 @@ EXEC sys.sp_addextendedproperty 'TABLE', N'sys_dict_data' GO -INSERT sys_dict_data VALUES (1, N'000000', 1, N'男', N'0', N'sys_user_sex', N'', N'', N'Y', 103, 1, getdate(), NULL, NULL, N'性别男') +INSERT sys_dict_data VALUES (1, 1, N'男', N'0', N'sys_user_sex', N'', N'', N'Y', 103, 1, getdate(), NULL, NULL, N'性别男') GO -INSERT sys_dict_data VALUES (2, N'000000', 2, N'女', N'1', N'sys_user_sex', N'', N'', N'N', 103, 1, getdate(), NULL, NULL, N'性别女') +INSERT sys_dict_data VALUES (2, 2, N'女', N'1', N'sys_user_sex', N'', N'', N'N', 103, 1, getdate(), NULL, NULL, N'性别女') GO -INSERT sys_dict_data VALUES (3, N'000000', 3, N'未知', N'2', N'sys_user_sex', N'', N'', N'N', 103, 1, getdate(), NULL, NULL, N'性别未知') +INSERT sys_dict_data VALUES (3, 3, N'未知', N'2', N'sys_user_sex', N'', N'', N'N', 103, 1, getdate(), NULL, NULL, N'性别未知') GO -INSERT sys_dict_data VALUES (4, N'000000', 1, N'显示', N'0', N'sys_show_hide', N'', N'primary', N'Y', 103, 1, getdate(), NULL, NULL, N'显示菜单') +INSERT sys_dict_data VALUES (4, 1, N'显示', N'0', N'sys_show_hide', N'', N'primary', N'Y', 103, 1, getdate(), NULL, NULL, N'显示菜单') GO -INSERT sys_dict_data VALUES (5, N'000000', 2, N'隐藏', N'1', N'sys_show_hide', N'', N'danger', N'N', 103, 1, getdate(), NULL, NULL, N'隐藏菜单') +INSERT sys_dict_data VALUES (5, 2, N'隐藏', N'1', N'sys_show_hide', N'', N'danger', N'N', 103, 1, getdate(), NULL, NULL, N'隐藏菜单') GO -INSERT sys_dict_data VALUES (6, N'000000', 1, N'正常', N'0', N'sys_normal_disable', N'', N'primary', N'Y', 103, 1, getdate(), NULL, NULL, N'正常状态') +INSERT sys_dict_data VALUES (6, 1, N'正常', N'0', N'sys_normal_disable', N'', N'primary', N'Y', 103, 1, getdate(), NULL, NULL, N'正常状态') GO -INSERT sys_dict_data VALUES (7, N'000000', 2, N'停用', N'1', N'sys_normal_disable', N'', N'danger', N'N', 103, 1, getdate(), NULL, NULL, N'停用状态') +INSERT sys_dict_data VALUES (7, 2, N'停用', N'1', N'sys_normal_disable', N'', N'danger', N'N', 103, 1, getdate(), NULL, NULL, N'停用状态') GO -INSERT sys_dict_data VALUES (8, N'000000', 1, N'正常', N'0', N'sys_job_status', N'', N'primary', N'Y', 103, 1, getdate(), NULL, NULL, N'正常状态') +INSERT sys_dict_data VALUES (8, 1, N'正常', N'0', N'sys_job_status', N'', N'primary', N'Y', 103, 1, getdate(), NULL, NULL, N'正常状态') GO -INSERT sys_dict_data VALUES (9, N'000000', 2, N'暂停', N'1', N'sys_job_status', N'', N'danger', N'N', 103, 1, getdate(), NULL, NULL, N'停用状态') +INSERT sys_dict_data VALUES (9, 2, N'暂停', N'1', N'sys_job_status', N'', N'danger', N'N', 103, 1, getdate(), NULL, NULL, N'停用状态') GO -INSERT sys_dict_data VALUES (10, N'000000', 1, N'默认', N'DEFAULT', N'sys_job_group', N'', N'', N'Y', 103, 1, getdate(), NULL, NULL, N'默认分组') +INSERT sys_dict_data VALUES (10, 1, N'默认', N'DEFAULT', N'sys_job_group', N'', N'', N'Y', 103, 1, getdate(), NULL, NULL, N'默认分组') GO -INSERT sys_dict_data VALUES (11, N'000000', 2, N'系统', N'SYSTEM', N'sys_job_group', N'', N'', N'N', 103, 1, getdate(), NULL, NULL, N'系统分组') +INSERT sys_dict_data VALUES (11, 2, N'系统', N'SYSTEM', N'sys_job_group', N'', N'', N'N', 103, 1, getdate(), NULL, NULL, N'系统分组') GO -INSERT sys_dict_data VALUES (12, N'000000', 1, N'是', N'Y', N'sys_yes_no', N'', N'primary', N'Y', 103, 1, getdate(), NULL, NULL, N'系统默认是') +INSERT sys_dict_data VALUES (12, 1, N'是', N'Y', N'sys_yes_no', N'', N'primary', N'Y', 103, 1, getdate(), NULL, NULL, N'系统默认是') GO -INSERT sys_dict_data VALUES (13, N'000000', 2, N'否', N'N', N'sys_yes_no', N'', N'danger', N'N', 103, 1, getdate(), NULL, NULL, N'系统默认否') +INSERT sys_dict_data VALUES (13, 2, N'否', N'N', N'sys_yes_no', N'', N'danger', N'N', 103, 1, getdate(), NULL, NULL, N'系统默认否') GO -INSERT sys_dict_data VALUES (14, N'000000', 1, N'通知', N'1', N'sys_notice_type', N'', N'warning', N'Y', 103, 1, getdate(), NULL, NULL, N'通知') +INSERT sys_dict_data VALUES (14, 1, N'通知', N'1', N'sys_notice_type', N'', N'warning', N'Y', 103, 1, getdate(), NULL, NULL, N'通知') GO -INSERT sys_dict_data VALUES (15, N'000000', 2, N'公告', N'2', N'sys_notice_type', N'', N'success', N'N', 103, 1, getdate(), NULL, NULL, N'公告') +INSERT sys_dict_data VALUES (15, 2, N'公告', N'2', N'sys_notice_type', N'', N'success', N'N', 103, 1, getdate(), NULL, NULL, N'公告') GO -INSERT sys_dict_data VALUES (16, N'000000', 1, N'正常', N'0', N'sys_notice_status', N'', N'primary', N'Y', 103, 1, getdate(), NULL, NULL, N'正常状态') +INSERT sys_dict_data VALUES (16, 1, N'正常', N'0', N'sys_notice_status', N'', N'primary', N'Y', 103, 1, getdate(), NULL, NULL, N'正常状态') GO -INSERT sys_dict_data VALUES (17, N'000000', 2, N'关闭', N'1', N'sys_notice_status', N'', N'danger', N'N', 103, 1, getdate(), NULL, NULL, N'关闭状态') +INSERT sys_dict_data VALUES (17, 2, N'关闭', N'1', N'sys_notice_status', N'', N'danger', N'N', 103, 1, getdate(), NULL, NULL, N'关闭状态') GO -INSERT sys_dict_data VALUES (29, N'000000', 99, N'其他', N'0', N'sys_oper_type', N'', N'info', N'N', 103, 1, getdate(), NULL, NULL, N'其他操作'); +INSERT sys_dict_data VALUES (29, 99, N'其他', N'0', N'sys_oper_type', N'', N'info', N'N', 103, 1, getdate(), NULL, NULL, N'其他操作'); GO -INSERT sys_dict_data VALUES (18, N'000000', 1, N'新增', N'1', N'sys_oper_type', N'', N'info', N'N', 103, 1, getdate(), NULL, NULL, N'新增操作') +INSERT sys_dict_data VALUES (18, 1, N'新增', N'1', N'sys_oper_type', N'', N'info', N'N', 103, 1, getdate(), NULL, NULL, N'新增操作') GO -INSERT sys_dict_data VALUES (19, N'000000', 2, N'修改', N'2', N'sys_oper_type', N'', N'info', N'N', 103, 1, getdate(), NULL, NULL, N'修改操作') +INSERT sys_dict_data VALUES (19, 2, N'修改', N'2', N'sys_oper_type', N'', N'info', N'N', 103, 1, getdate(), NULL, NULL, N'修改操作') GO -INSERT sys_dict_data VALUES (20, N'000000', 3, N'删除', N'3', N'sys_oper_type', N'', N'danger', N'N', 103, 1, getdate(), NULL, NULL, N'删除操作') +INSERT sys_dict_data VALUES (20, 3, N'删除', N'3', N'sys_oper_type', N'', N'danger', N'N', 103, 1, getdate(), NULL, NULL, N'删除操作') GO -INSERT sys_dict_data VALUES (21, N'000000', 4, N'授权', N'4', N'sys_oper_type', N'', N'primary', N'N', 103, 1, getdate(), NULL, NULL, N'授权操作') +INSERT sys_dict_data VALUES (21, 4, N'授权', N'4', N'sys_oper_type', N'', N'primary', N'N', 103, 1, getdate(), NULL, NULL, N'授权操作') GO -INSERT sys_dict_data VALUES (22, N'000000', 5, N'导出', N'5', N'sys_oper_type', N'', N'warning', N'N', 103, 1, getdate(), NULL, NULL, N'导出操作') +INSERT sys_dict_data VALUES (22, 5, N'导出', N'5', N'sys_oper_type', N'', N'warning', N'N', 103, 1, getdate(), NULL, NULL, N'导出操作') GO -INSERT sys_dict_data VALUES (23, N'000000', 6, N'导入', N'6', N'sys_oper_type', N'', N'warning', N'N', 103, 1, getdate(), NULL, NULL, N'导入操作') +INSERT sys_dict_data VALUES (23, 6, N'导入', N'6', N'sys_oper_type', N'', N'warning', N'N', 103, 1, getdate(), NULL, NULL, N'导入操作') GO -INSERT sys_dict_data VALUES (24, N'000000', 7, N'强退', N'7', N'sys_oper_type', N'', N'danger', N'N', 103, 1, getdate(), NULL, NULL, N'强退操作') +INSERT sys_dict_data VALUES (24, 7, N'强退', N'7', N'sys_oper_type', N'', N'danger', N'N', 103, 1, getdate(), NULL, NULL, N'强退操作') GO -INSERT sys_dict_data VALUES (25, N'000000', 8, N'生成代码', N'8', N'sys_oper_type', N'', N'warning', N'N', 103, 1, getdate(), NULL, NULL, N'生成操作') +INSERT sys_dict_data VALUES (25, 8, N'生成代码', N'8', N'sys_oper_type', N'', N'warning', N'N', 103, 1, getdate(), NULL, NULL, N'生成操作') GO -INSERT sys_dict_data VALUES (26, N'000000', 9, N'清空数据', N'9', N'sys_oper_type', N'', N'danger', N'N', 103, 1, getdate(), NULL, NULL, N'清空操作') +INSERT sys_dict_data VALUES (26, 9, N'清空数据', N'9', N'sys_oper_type', N'', N'danger', N'N', 103, 1, getdate(), NULL, NULL, N'清空操作') GO -INSERT sys_dict_data VALUES (27, N'000000', 1, N'成功', N'0', N'sys_common_status', N'', N'primary', N'N', 103, 1, getdate(), NULL, NULL, N'正常状态') +INSERT sys_dict_data VALUES (27, 1, N'成功', N'0', N'sys_common_status', N'', N'primary', N'N', 103, 1, getdate(), NULL, NULL, N'正常状态') GO -INSERT sys_dict_data VALUES (28, N'000000', 2, N'失败', N'1', N'sys_common_status', N'', N'danger', N'N', 103, 1, getdate(), NULL, NULL, N'停用状态') +INSERT sys_dict_data VALUES (28, 2, N'失败', N'1', N'sys_common_status', N'', N'danger', N'N', 103, 1, getdate(), NULL, NULL, N'停用状态') GO -INSERT sys_dict_data VALUES (30, N'000000', 0, N'密码认证', N'password', N'sys_grant_type', N'', N'default', N'N', 103, 1, getdate(), NULL, NULL, N'密码认证') +INSERT sys_dict_data VALUES (30, 0, N'密码认证', N'password', N'sys_grant_type', N'', N'default', N'N', 103, 1, getdate(), NULL, NULL, N'密码认证') GO -INSERT sys_dict_data VALUES (31, N'000000', 0, N'短信认证', N'sms', N'sys_grant_type', N'', N'default', N'N', 103, 1, getdate(), NULL, NULL, N'短信认证') +INSERT sys_dict_data VALUES (31, 0, N'短信认证', N'sms', N'sys_grant_type', N'', N'default', N'N', 103, 1, getdate(), NULL, NULL, N'短信认证') GO -INSERT sys_dict_data VALUES (32, N'000000', 0, N'邮件认证', N'email', N'sys_grant_type', N'', N'default', N'N', 103, 1, getdate(), NULL, NULL, N'邮件认证') +INSERT sys_dict_data VALUES (32, 0, N'邮件认证', N'email', N'sys_grant_type', N'', N'default', N'N', 103, 1, getdate(), NULL, NULL, N'邮件认证') GO -INSERT sys_dict_data VALUES (33, N'000000', 0, N'小程序认证', N'xcx', N'sys_grant_type', N'', N'default', N'N', 103, 1, getdate(), NULL, NULL, N'小程序认证') +INSERT sys_dict_data VALUES (33, 0, N'小程序认证', N'xcx', N'sys_grant_type', N'', N'default', N'N', 103, 1, getdate(), NULL, NULL, N'小程序认证') GO -INSERT sys_dict_data VALUES (34, N'000000', 0, N'三方登录认证', N'social', N'sys_grant_type', N'', N'default', N'N', 103, 1, getdate(), NULL, NULL, N'三方登录认证') +INSERT sys_dict_data VALUES (34, 0, N'三方登录认证', N'social', N'sys_grant_type', N'', N'default', N'N', 103, 1, getdate(), NULL, NULL, N'三方登录认证') GO -INSERT sys_dict_data VALUES (35, N'000000', 0, N'PC', N'pc', N'sys_device_type', N'', N'default', N'N', 103, 1, getdate(), NULL, NULL, N'PC') +INSERT sys_dict_data VALUES (35, 0, N'PC', N'pc', N'sys_device_type', N'', N'default', N'N', 103, 1, getdate(), NULL, NULL, N'PC') GO -INSERT sys_dict_data VALUES (36, N'000000', 0, N'安卓', N'android', N'sys_device_type', N'', N'default', N'N', 103, 1, getdate(), NULL, NULL, N'安卓') +INSERT sys_dict_data VALUES (36, 0, N'安卓', N'android', N'sys_device_type', N'', N'default', N'N', 103, 1, getdate(), NULL, NULL, N'安卓') GO -INSERT sys_dict_data VALUES (37, N'000000', 0, N'iOS', N'ios', N'sys_device_type', N'', N'default', N'N', 103, 1, getdate(), NULL, NULL, N'iOS') +INSERT sys_dict_data VALUES (37, 0, N'iOS', N'ios', N'sys_device_type', N'', N'default', N'N', 103, 1, getdate(), NULL, NULL, N'iOS') GO -INSERT sys_dict_data VALUES (38, N'000000', 0, N'小程序', N'xcx', N'sys_device_type', N'', N'default', N'N', 103, 1, getdate(), NULL, NULL, N'小程序') +INSERT sys_dict_data VALUES (38, 0, N'小程序', N'xcx', N'sys_device_type', N'', N'default', N'N', 103, 1, getdate(), NULL, NULL, N'小程序') GO CREATE TABLE sys_dict_type ( dict_id bigint NOT NULL, - tenant_id nvarchar(20) DEFAULT ('000000') NULL, dict_name nvarchar(100) DEFAULT '' NULL, dict_type nvarchar(100) DEFAULT '' NULL, create_dept bigint NULL, @@ -1304,12 +1023,6 @@ EXEC sys.sp_addextendedproperty 'TABLE', N'sys_dict_type', 'COLUMN', N'dict_id' GO -EXEC sys.sp_addextendedproperty - 'MS_Description', N'字典主键' , - 'SCHEMA', N'dbo', - 'TABLE', N'sys_dict_type', - 'COLUMN', N'tenant_id' -GO EXEC sys.sp_addextendedproperty 'MS_Description', N'字典名称' , 'SCHEMA', N'dbo', @@ -1364,35 +1077,34 @@ EXEC sys.sp_addextendedproperty 'TABLE', N'sys_dict_type' GO -INSERT sys_dict_type VALUES (1, N'000000', N'用户性别', N'sys_user_sex', 103, 1, getdate(), NULL, NULL, N'用户性别列表') +INSERT sys_dict_type VALUES (1, N'用户性别', N'sys_user_sex', 103, 1, getdate(), NULL, NULL, N'用户性别列表') GO -INSERT sys_dict_type VALUES (2, N'000000', N'菜单状态', N'sys_show_hide', 103, 1, getdate(), NULL, NULL, N'菜单状态列表') +INSERT sys_dict_type VALUES (2, N'菜单状态', N'sys_show_hide', 103, 1, getdate(), NULL, NULL, N'菜单状态列表') GO -INSERT sys_dict_type VALUES (3, N'000000', N'系统开关', N'sys_normal_disable', 103, 1, getdate(), NULL, NULL, N'系统开关列表') +INSERT sys_dict_type VALUES (3, N'系统开关', N'sys_normal_disable', 103, 1, getdate(), NULL, NULL, N'系统开关列表') GO -INSERT sys_dict_type VALUES (4, N'000000', N'任务状态', N'sys_job_status', 103, 1, getdate(), NULL, NULL, N'任务状态列表') +INSERT sys_dict_type VALUES (4, N'任务状态', N'sys_job_status', 103, 1, getdate(), NULL, NULL, N'任务状态列表') GO -INSERT sys_dict_type VALUES (5, N'000000', N'任务分组', N'sys_job_group', 103, 1, getdate(), NULL, NULL, N'任务分组列表') +INSERT sys_dict_type VALUES (5, N'任务分组', N'sys_job_group', 103, 1, getdate(), NULL, NULL, N'任务分组列表') GO -INSERT sys_dict_type VALUES (6, N'000000', N'系统是否', N'sys_yes_no', 103, 1, getdate(), NULL, NULL, N'系统是否列表') +INSERT sys_dict_type VALUES (6, N'系统是否', N'sys_yes_no', 103, 1, getdate(), NULL, NULL, N'系统是否列表') GO -INSERT sys_dict_type VALUES (7, N'000000', N'通知类型', N'sys_notice_type', 103, 1, getdate(), NULL, NULL, N'通知类型列表') +INSERT sys_dict_type VALUES (7, N'通知类型', N'sys_notice_type', 103, 1, getdate(), NULL, NULL, N'通知类型列表') GO -INSERT sys_dict_type VALUES (8, N'000000', N'通知状态', N'sys_notice_status', 103, 1, getdate(), NULL, NULL, N'通知状态列表') +INSERT sys_dict_type VALUES (8, N'通知状态', N'sys_notice_status', 103, 1, getdate(), NULL, NULL, N'通知状态列表') GO -INSERT sys_dict_type VALUES (9, N'000000', N'操作类型', N'sys_oper_type', 103, 1, getdate(), NULL, NULL, N'操作类型列表') +INSERT sys_dict_type VALUES (9, N'操作类型', N'sys_oper_type', 103, 1, getdate(), NULL, NULL, N'操作类型列表') GO -INSERT sys_dict_type VALUES (10, N'000000', N'系统状态', N'sys_common_status', 103, 1, getdate(), NULL, NULL, N'登录状态列表') +INSERT sys_dict_type VALUES (10, N'系统状态', N'sys_common_status', 103, 1, getdate(), NULL, NULL, N'登录状态列表') GO -INSERT sys_dict_type VALUES (11, N'000000', N'授权类型', N'sys_grant_type', 103, 1, getdate(), NULL, NULL, N'认证授权类型') +INSERT sys_dict_type VALUES (11, N'授权类型', N'sys_grant_type', 103, 1, getdate(), NULL, NULL, N'认证授权类型') GO -INSERT sys_dict_type VALUES (12, N'000000', N'设备类型', N'sys_device_type', 103, 1, getdate(), NULL, NULL, N'客户端设备类型') +INSERT sys_dict_type VALUES (12, N'设备类型', N'sys_device_type', 103, 1, getdate(), NULL, NULL, N'客户端设备类型') GO CREATE TABLE sys_logininfor ( info_id bigint NOT NULL, - tenant_id nvarchar(20) DEFAULT ('000000') NULL, user_name nvarchar(50) DEFAULT '' NULL, client_key nvarchar(32) DEFAULT '' NULL, device_type nvarchar(32) DEFAULT '' NULL, @@ -1421,12 +1133,6 @@ EXEC sys.sp_addextendedproperty 'TABLE', N'sys_logininfor', 'COLUMN', N'info_id' GO -EXEC sys.sp_addextendedproperty - 'MS_Description', N'租户编号' , - 'SCHEMA', N'dbo', - 'TABLE', N'sys_logininfor', - 'COLUMN', N'tenant_id' -GO EXEC sys.sp_addextendedproperty 'MS_Description', N'用户账号' , 'SCHEMA', N'dbo', @@ -1650,8 +1356,6 @@ GO INSERT sys_menu VALUES (1, N'系统管理', 0, 1, N'system', NULL, N'', 1, 0, N'M', N'0', N'0', N'', N'system', 103, 1, getdate(), NULL, NULL, N'系统管理目录') GO -INSERT sys_menu VALUES (6, N'租户管理', 0, 2, N'tenant', NULL, N'', 1, 0, N'M', N'0', N'0', N'', N'chart', 103, 1, getdate(), NULL, NULL, N'租户管理目录') -GO INSERT sys_menu VALUES (2, N'系统监控', 0, 3, N'monitor', NULL, N'', 1, 0, N'M', N'0', N'0', N'', N'monitor', 103, 1, getdate(), NULL, NULL, N'系统监控目录') GO INSERT sys_menu VALUES (3, N'系统工具', 0, 4, N'tool', NULL, N'', 1, 0, N'M', N'0', N'0', N'', N'tool', 103, 1, getdate(), NULL, NULL, N'系统工具目录') @@ -1684,10 +1388,6 @@ INSERT sys_menu VALUES (113, N'缓存监控', 2, 5, N'cache', N'monitor/cache/in GO INSERT sys_menu VALUES (115, N'代码生成', 3, 2, N'gen', N'tool/gen/index', N'', 1, 0, N'C', N'0', N'0', N'tool:gen:list', N'code', 103, 1, getdate(), NULL, NULL, N'代码生成菜单') GO -INSERT sys_menu VALUES (121, N'租户管理', 6, 1, N'tenant', N'system/tenant/index', N'', 1, 0, N'C', N'0', N'0', N'system:tenant:list', N'code', 103, 1, getdate(), NULL, NULL, N'租户管理菜单') -GO -INSERT sys_menu VALUES (122, N'租户套餐管理', 6, 2, N'tenantPackage', N'system/tenantPackage/index', N'', 1, 0, N'C', N'0', N'0', N'system:tenantPackage:list', N'code', 103, 1, getdate(), NULL, NULL, N'租户套餐管理菜单') -GO INSERT sys_menu VALUES (123, N'客户端管理', 1, 11, N'client', N'system/client/index', N'', 1, 0, N'C', N'0', N'0', N'system:client:list', N'international', 103, 1, getdate(), NULL, NULL, N'客户端管理菜单') GO INSERT sys_menu VALUES (116, N'修改生成配置', 3, 2, N'gen-edit/index/:tableId', N'tool/gen/editTable', N'', 1, 1, N'C', N'1', N'0', N'tool:gen:edit', N'#', 103, 1, getdate(), null, null, N'/tool/gen'); @@ -1838,28 +1538,6 @@ INSERT sys_menu VALUES (1622, N'配置编辑', 118, 6, N'#', N'', N'', 1, 0, N'F GO INSERT sys_menu VALUES (1623, N'配置删除', 118, 6, N'#', N'', N'', 1, 0, N'F', N'0', N'0', N'system:ossConfig:remove', N'#', 103, 1, getdate(), NULL, NULL, N''); GO --- 租户管理相关按钮 -INSERT sys_menu VALUES (1606, N'租户查询', 121, 1, N'#', N'', N'', 1, 0, N'F', N'0', N'0', N'system:tenant:query', N'#', 103, 1, getdate(), NULL, NULL, N''); -GO -INSERT sys_menu VALUES (1607, N'租户新增', 121, 2, N'#', N'', N'', 1, 0, N'F', N'0', N'0', N'system:tenant:add', N'#', 103, 1, getdate(), NULL, NULL, N''); -GO -INSERT sys_menu VALUES (1608, N'租户修改', 121, 3, N'#', N'', N'', 1, 0, N'F', N'0', N'0', N'system:tenant:edit', N'#', 103, 1, getdate(), NULL, NULL, N''); -GO -INSERT sys_menu VALUES (1609, N'租户删除', 121, 4, N'#', N'', N'', 1, 0, N'F', N'0', N'0', N'system:tenant:remove', N'#', 103, 1, getdate(), NULL, NULL, N''); -GO -INSERT sys_menu VALUES (1610, N'租户导出', 121, 5, N'#', N'', N'', 1, 0, N'F', N'0', N'0', N'system:tenant:export', N'#', 103, 1, getdate(), NULL, NULL, N''); -GO --- 租户套餐管理相关按钮 -INSERT sys_menu VALUES (1611, N'租户套餐查询', 122, 1, N'#', N'', N'', 1, 0, N'F', N'0', N'0', N'system:tenantPackage:query', N'#', 103, 1, getdate(), NULL, NULL, N''); -GO -INSERT sys_menu VALUES (1612, N'租户套餐新增', 122, 2, N'#', N'', N'', 1, 0, N'F', N'0', N'0', N'system:tenantPackage:add', N'#', 103, 1, getdate(), NULL, NULL, N''); -GO -INSERT sys_menu VALUES (1613, N'租户套餐修改', 122, 3, N'#', N'', N'', 1, 0, N'F', N'0', N'0', N'system:tenantPackage:edit', N'#', 103, 1, getdate(), NULL, NULL, N''); -GO -INSERT sys_menu VALUES (1614, N'租户套餐删除', 122, 4, N'#', N'', N'', 1, 0, N'F', N'0', N'0', N'system:tenantPackage:remove', N'#', 103, 1, getdate(), NULL, NULL, N''); -GO -INSERT sys_menu VALUES (1615, N'租户套餐导出', 122, 5, N'#', N'', N'', 1, 0, N'F', N'0', N'0', N'system:tenantPackage:export', N'#', 103, 1, getdate(), NULL, NULL, N''); -GO -- 客户端管理按钮 INSERT sys_menu VALUES (1061, N'客户端管理查询', 123, 1, N'#', N'', N'', 1, 0, N'F', N'0', N'0', N'system:client:query', N'#', 103, 1, getdate(), NULL, NULL, N''); GO @@ -1901,7 +1579,6 @@ GO CREATE TABLE sys_notice ( notice_id bigint NOT NULL, - tenant_id nvarchar(20) DEFAULT ('000000') NULL, notice_title nvarchar(50) NOT NULL, notice_type nchar(1) NOT NULL, notice_content nvarchar(max) NULL, @@ -1926,12 +1603,6 @@ EXEC sys.sp_addextendedproperty 'TABLE', N'sys_notice', 'COLUMN', N'notice_id' GO -EXEC sys.sp_addextendedproperty - 'MS_Description', N'租户编号' , - 'SCHEMA', N'dbo', - 'TABLE', N'sys_notice', - 'COLUMN', N'tenant_id' -GO EXEC sys.sp_addextendedproperty 'MS_Description', N'公告标题' , 'SCHEMA', N'dbo', @@ -1998,15 +1669,14 @@ EXEC sys.sp_addextendedproperty 'TABLE', N'sys_notice' GO -INSERT sys_notice VALUES (1, N'000000', N'温馨提醒:2018-07-01 若依新版本发布啦', N'2', N'新版本内容', N'0', 103, 1, getdate(), NULL, NULL, N'管理员') +INSERT sys_notice VALUES (1, N'温馨提醒:2018-07-01 若依新版本发布啦', N'2', N'新版本内容', N'0', 103, 1, getdate(), NULL, NULL, N'管理员') GO -INSERT sys_notice VALUES (2, N'000000', N'维护通知:2018-07-01 若依系统凌晨维护', N'1', N'维护内容', N'0', 103, 1, getdate(), NULL, NULL, N'管理员') +INSERT sys_notice VALUES (2, N'维护通知:2018-07-01 若依系统凌晨维护', N'1', N'维护内容', N'0', 103, 1, getdate(), NULL, NULL, N'管理员') GO CREATE TABLE sys_oper_log ( oper_id bigint NOT NULL, - tenant_id nvarchar(20) DEFAULT ('000000') NULL, title nvarchar(50) DEFAULT '' NULL, business_type int DEFAULT ((0)) NULL, method nvarchar(100) DEFAULT '' NULL, @@ -2043,12 +1713,6 @@ EXEC sys.sp_addextendedproperty 'TABLE', N'sys_oper_log', 'COLUMN', N'oper_id' GO -EXEC sys.sp_addextendedproperty - 'MS_Description', N'租户编号' , - 'SCHEMA', N'dbo', - 'TABLE', N'sys_oper_log', - 'COLUMN', N'tenant_id' -GO EXEC sys.sp_addextendedproperty 'MS_Description', N'模块标题' , 'SCHEMA', N'dbo', @@ -2154,7 +1818,6 @@ GO CREATE TABLE sys_post ( post_id bigint NOT NULL, - tenant_id nvarchar(20) DEFAULT ('000000') NULL, dept_id bigint NOT NULL, post_code nvarchar(64) NOT NULL, post_category nvarchar(100) NULL, @@ -2180,12 +1843,6 @@ EXEC sys.sp_addextendedproperty 'TABLE', N'sys_post', 'COLUMN', N'post_id' GO -EXEC sys.sp_addextendedproperty - 'MS_Description', N'租户编号' , - 'SCHEMA', N'dbo', - 'TABLE', N'sys_post', - 'COLUMN', N'tenant_id' -GO EXEC sys.sp_addextendedproperty 'MS_Description', N'部门id' , 'SCHEMA', N'dbo', @@ -2264,19 +1921,18 @@ EXEC sys.sp_addextendedproperty 'TABLE', N'sys_post' GO -INSERT sys_post VALUES (1, N'000000', 103, N'ceo', NULL, N'董事长', 1, N'0', 103, 1, getdate(), NULL, NULL, N'') +INSERT sys_post VALUES (1, 103, N'ceo', NULL, N'董事长', 1, N'0', 103, 1, getdate(), NULL, NULL, N'') GO -INSERT sys_post VALUES (2, N'000000', 100, N'se', NULL, N'项目经理', 2, N'0', 103, 1, getdate(), NULL, NULL, N'') +INSERT sys_post VALUES (2, 100, N'se', NULL, N'项目经理', 2, N'0', 103, 1, getdate(), NULL, NULL, N'') GO -INSERT sys_post VALUES (3, N'000000', 100, N'hr', NULL, N'人力资源', 3, N'0', 103, 1, getdate(), NULL, NULL, N'') +INSERT sys_post VALUES (3, 100, N'hr', NULL, N'人力资源', 3, N'0', 103, 1, getdate(), NULL, NULL, N'') GO -INSERT sys_post VALUES (4, N'000000', 100, N'user', NULL, N'普通员工', 4, N'0', 103, 1, getdate(), NULL, NULL, N'') +INSERT sys_post VALUES (4, 100, N'user', NULL, N'普通员工', 4, N'0', 103, 1, getdate(), NULL, NULL, N'') GO CREATE TABLE sys_role ( role_id bigint NOT NULL, - tenant_id nvarchar(20) DEFAULT ('000000') NULL, role_name nvarchar(30) NOT NULL, role_key nvarchar(100) NOT NULL, role_sort int NOT NULL, @@ -2304,12 +1960,6 @@ EXEC sys.sp_addextendedproperty 'TABLE', N'sys_role', 'COLUMN', N'role_id' GO -EXEC sys.sp_addextendedproperty - 'MS_Description', N'租户编号' , - 'SCHEMA', N'dbo', - 'TABLE', N'sys_role', - 'COLUMN', N'tenant_id' -GO EXEC sys.sp_addextendedproperty 'MS_Description', N'角色名称' , 'SCHEMA', N'dbo', @@ -2400,11 +2050,11 @@ EXEC sys.sp_addextendedproperty 'TABLE', N'sys_role' GO -INSERT sys_role VALUES (1, N'000000', N'超级管理员', N'superadmin', 1, N'1', 1, 1, N'0', N'0', 103, 1, getdate(), NULL, NULL, N'超级管理员') +INSERT sys_role VALUES (1, N'超级管理员', N'superadmin', 1, N'1', 1, 1, N'0', N'0', 103, 1, getdate(), NULL, NULL, N'超级管理员') GO -INSERT sys_role VALUES (3, N'000000', N'本部门及以下', N'test1', 3, N'4', 1, 1, N'0', N'0', 103, 1, getdate(), NULL, NULL, N''); +INSERT sys_role VALUES (3, N'本部门及以下', N'test1', 3, N'4', 1, 1, N'0', N'0', 103, 1, getdate(), NULL, NULL, N''); GO -INSERT sys_role VALUES (4, N'000000', N'仅本人', N'test2', 4, N'5', 1, 1, N'0', N'0', 103, 1, getdate(), NULL, NULL, N''); +INSERT sys_role VALUES (4, N'仅本人', N'test2', 4, N'5', 1, 1, N'0', N'0', 103, 1, getdate(), NULL, NULL, N''); GO CREATE TABLE sys_role_dept @@ -2708,7 +2358,6 @@ GO CREATE TABLE sys_user ( user_id bigint NOT NULL, - tenant_id nvarchar(20) DEFAULT ('000000') NULL, dept_id bigint NULL, user_name nvarchar(30) NOT NULL, nick_name nvarchar(30) NOT NULL, @@ -2741,12 +2390,6 @@ EXEC sys.sp_addextendedproperty 'TABLE', N'sys_user', 'COLUMN', N'user_id' GO -EXEC sys.sp_addextendedproperty - 'MS_Description', N'租户编号' , - 'SCHEMA', N'dbo', - 'TABLE', N'sys_user', - 'COLUMN', N'tenant_id' -GO EXEC sys.sp_addextendedproperty 'MS_Description', N'部门ID' , 'SCHEMA', N'dbo', @@ -2867,11 +2510,11 @@ EXEC sys.sp_addextendedproperty 'TABLE', N'sys_user' GO -INSERT sys_user VALUES (1, N'000000', 103, N'admin', N'疯狂的狮子Li', N'sys_user', N'crazyLionLi@163.com', N'15888888888', N'1', NULL, N'$2a$10$7JB720yubVSZvUI0rEqK/.VqGOZTH.ulu33dHOiBE8ByOhJIrdAu2', N'0', N'0', N'127.0.0.1', getdate(), 103, 1, getdate(), NULL, NULL, N'管理员') +INSERT sys_user VALUES (1, 103, N'admin', N'疯狂的狮子Li', N'sys_user', N'crazyLionLi@163.com', N'15888888888', N'1', NULL, N'$2a$10$7JB720yubVSZvUI0rEqK/.VqGOZTH.ulu33dHOiBE8ByOhJIrdAu2', N'0', N'0', N'127.0.0.1', getdate(), 103, 1, getdate(), NULL, NULL, N'管理员') GO -INSERT sys_user VALUES (3, N'000000', 108, N'test', N'本部门及以下 密码666666', N'sys_user', N'', N'', N'0', NULL, N'$2a$10$b8yUzN0C71sbz.PhNOCgJe.Tu1yWC3RNrTyjSQ8p1W0.aaUXUJ.Ne', N'0', N'0', N'127.0.0.1', getdate(), 103, 1, getdate(), 3, getdate(), NULL); +INSERT sys_user VALUES (3, 108, N'test', N'本部门及以下 密码666666', N'sys_user', N'', N'', N'0', NULL, N'$2a$10$b8yUzN0C71sbz.PhNOCgJe.Tu1yWC3RNrTyjSQ8p1W0.aaUXUJ.Ne', N'0', N'0', N'127.0.0.1', getdate(), 103, 1, getdate(), 3, getdate(), NULL); GO -INSERT sys_user VALUES (4, N'000000', 102, N'test1', N'仅本人 密码666666', N'sys_user', N'', N'', N'0', NULL, N'$2a$10$b8yUzN0C71sbz.PhNOCgJe.Tu1yWC3RNrTyjSQ8p1W0.aaUXUJ.Ne', N'0', N'0', N'127.0.0.1', getdate(), 103, 1, getdate(), 4, getdate(), NULL); +INSERT sys_user VALUES (4, 102, N'test1', N'仅本人 密码666666', N'sys_user', N'', N'', N'0', NULL, N'$2a$10$b8yUzN0C71sbz.PhNOCgJe.Tu1yWC3RNrTyjSQ8p1W0.aaUXUJ.Ne', N'0', N'0', N'127.0.0.1', getdate(), 103, 1, getdate(), 4, getdate(), NULL); GO CREATE TABLE sys_user_post @@ -2945,7 +2588,6 @@ GO CREATE TABLE sys_oss ( oss_id bigint NOT NULL, - tenant_id nvarchar(20) DEFAULT ('000000') NULL, file_name nvarchar(255) DEFAULT '' NOT NULL, original_name nvarchar(255) DEFAULT '' NOT NULL, file_suffix nvarchar(10) DEFAULT '' NOT NULL, @@ -2970,12 +2612,6 @@ EXEC sp_addextendedproperty 'TABLE', N'sys_oss', 'COLUMN', N'oss_id' GO -EXEC sys.sp_addextendedproperty - 'MS_Description', N'租户编号' , - 'SCHEMA', N'dbo', - 'TABLE', N'sys_oss', - 'COLUMN', N'tenant_id' -GO EXEC sp_addextendedproperty 'MS_Description', N'文件名', 'SCHEMA', N'dbo', @@ -3051,7 +2687,6 @@ GO CREATE TABLE sys_oss_config ( oss_config_id bigint NOT NULL, - tenant_id nvarchar(20) DEFAULT ('000000') NULL, config_key nvarchar(20) DEFAULT '' NOT NULL, access_key nvarchar(255) DEFAULT '' NULL, secret_key nvarchar(255) DEFAULT '' NULL, @@ -3083,12 +2718,6 @@ EXEC sp_addextendedproperty 'TABLE', N'sys_oss_config', 'COLUMN', N'oss_config_id' GO -EXEC sys.sp_addextendedproperty - 'MS_Description', N'租户编号' , - 'SCHEMA', N'dbo', - 'TABLE', N'sys_oss_config', - 'COLUMN', N'tenant_id' -GO EXEC sp_addextendedproperty 'MS_Description', N'配置key', 'SCHEMA', N'dbo', @@ -3203,15 +2832,15 @@ EXEC sp_addextendedproperty 'TABLE', N'sys_oss_config' GO -INSERT INTO sys_oss_config VALUES (N'1', N'000000', N'minio', N'ruoyi', N'ruoyi123', N'ruoyi', N'', N'127.0.0.1:9000', N'',N'N', N'', N'1', N'0', N'', 103, 1, getdate(), 1, getdate(), NULL) +INSERT INTO sys_oss_config VALUES (N'1', N'minio', N'ruoyi', N'ruoyi123', N'ruoyi', N'', N'127.0.0.1:9000', N'',N'N', N'', N'1', N'0', N'', 103, 1, getdate(), 1, getdate(), NULL) GO -INSERT INTO sys_oss_config VALUES (N'2', N'000000', N'qiniu', N'XXXXXXXXXXXXXXXX', N'XXXXXXXXXXXXXXX', N'ruoyi', N'', N's3-cn-north-1.qiniucs.com', N'',N'N', N'', N'1', N'1', N'', 103, 1, getdate(), 1, getdate(), NULL) +INSERT INTO sys_oss_config VALUES (N'2', N'qiniu', N'XXXXXXXXXXXXXXXX', N'XXXXXXXXXXXXXXX', N'ruoyi', N'', N's3-cn-north-1.qiniucs.com', N'',N'N', N'', N'1', N'1', N'', 103, 1, getdate(), 1, getdate(), NULL) GO -INSERT INTO sys_oss_config VALUES (N'3', N'000000', N'aliyun', N'XXXXXXXXXXXXXXX', N'XXXXXXXXXXXXXXX', N'ruoyi', N'', N'oss-cn-beijing.aliyuncs.com', N'',N'N', N'', N'1', N'1', N'', 103, 1, getdate(), 1, getdate(), NULL) +INSERT INTO sys_oss_config VALUES (N'3', N'aliyun', N'XXXXXXXXXXXXXXX', N'XXXXXXXXXXXXXXX', N'ruoyi', N'', N'oss-cn-beijing.aliyuncs.com', N'',N'N', N'', N'1', N'1', N'', 103, 1, getdate(), 1, getdate(), NULL) GO -INSERT INTO sys_oss_config VALUES (N'4', N'000000', N'qcloud', N'XXXXXXXXXXXXXXX', N'XXXXXXXXXXXXXXX', N'ruoyi-1250000000', N'', N'cos.ap-beijing.myqcloud.com', N'',N'N', N'ap-beijing', N'1', N'1', N'', 103, 1, getdate(), 1, getdate(), NULL) +INSERT INTO sys_oss_config VALUES (N'4', N'qcloud', N'XXXXXXXXXXXXXXX', N'XXXXXXXXXXXXXXX', N'ruoyi-1250000000', N'', N'cos.ap-beijing.myqcloud.com', N'',N'N', N'ap-beijing', N'1', N'1', N'', 103, 1, getdate(), 1, getdate(), NULL) GO -INSERT INTO sys_oss_config VALUES (N'5', N'000000', N'image', N'ruoyi', N'ruoyi123', N'ruoyi', N'image', N'127.0.0.1:9000', N'',N'N', N'', N'1', N'1', N'', 103, 1, getdate(), 1, getdate(), NULL) +INSERT INTO sys_oss_config VALUES (N'5', N'image', N'ruoyi', N'ruoyi123', N'ruoyi', N'image', N'127.0.0.1:9000', N'',N'N', N'', N'1', N'1', N'', 103, 1, getdate(), 1, getdate(), NULL) GO @@ -3343,7 +2972,6 @@ GO CREATE TABLE test_demo ( id bigint NOT NULL, - tenant_id nvarchar(20) DEFAULT ('000000') NULL, dept_id bigint NULL, user_id bigint NULL, order_num int DEFAULT ((0)) NULL, @@ -3370,13 +2998,6 @@ EXEC sp_addextendedproperty 'COLUMN', N'id' GO -EXEC sp_addextendedproperty - 'MS_Description', N'租户id', - 'SCHEMA', N'dbo', - 'TABLE', N'test_demo', - 'COLUMN', N'tenant_id' -GO - EXEC sp_addextendedproperty 'MS_Description', N'部门id', 'SCHEMA', N'dbo', @@ -3470,7 +3091,6 @@ GO CREATE TABLE test_tree ( id bigint NOT NULL, - tenant_id nvarchar(20) DEFAULT ('000000') NULL, parent_id bigint DEFAULT ((0)) NULL, dept_id bigint NULL, user_id bigint NULL, @@ -3496,13 +3116,6 @@ EXEC sp_addextendedproperty 'COLUMN', N'id' GO -EXEC sp_addextendedproperty - 'MS_Description', N'租户id', - 'SCHEMA', N'dbo', - 'TABLE', N'test_tree', - 'COLUMN', N'tenant_id' -GO - EXEC sp_addextendedproperty 'MS_Description', N'父id', 'SCHEMA', N'dbo', @@ -3586,56 +3199,56 @@ EXEC sp_addextendedproperty 'TABLE', N'test_tree' GO -INSERT test_demo VALUES (1, N'000000', 102, 4, 1, N'测试数据权限', N'测试', 0, 103, getdate(), 1, NULL, NULL, 0); +INSERT test_demo VALUES (1, 102, 4, 1, N'测试数据权限', N'测试', 0, 103, getdate(), 1, NULL, NULL, 0); GO -INSERT test_demo VALUES (2, N'000000', 102, 3, 2, N'子节点1', N'111', 0, 103, getdate(), 1, NULL, NULL, 0); +INSERT test_demo VALUES (2, 102, 3, 2, N'子节点1', N'111', 0, 103, getdate(), 1, NULL, NULL, 0); GO -INSERT test_demo VALUES (3, N'000000', 102, 3, 3, N'子节点2', N'222', 0, 103, getdate(), 1, NULL, NULL, 0); +INSERT test_demo VALUES (3, 102, 3, 3, N'子节点2', N'222', 0, 103, getdate(), 1, NULL, NULL, 0); GO -INSERT test_demo VALUES (4, N'000000', 108, 4, 4, N'测试数据', N'demo', 0, 103, getdate(), 1, NULL, NULL, 0); +INSERT test_demo VALUES (4, 108, 4, 4, N'测试数据', N'demo', 0, 103, getdate(), 1, NULL, NULL, 0); GO -INSERT test_demo VALUES (5, N'000000', 108, 3, 13, N'子节点11', N'1111', 0, 103, getdate(), 1, NULL, NULL, 0); +INSERT test_demo VALUES (5, 108, 3, 13, N'子节点11', N'1111', 0, 103, getdate(), 1, NULL, NULL, 0); GO -INSERT test_demo VALUES (6, N'000000', 108, 3, 12, N'子节点22', N'2222', 0, 103, getdate(), 1, NULL, NULL, 0); +INSERT test_demo VALUES (6, 108, 3, 12, N'子节点22', N'2222', 0, 103, getdate(), 1, NULL, NULL, 0); GO -INSERT test_demo VALUES (7, N'000000', 108, 3, 11, N'子节点33', N'3333', 0, 103, getdate(), 1, NULL, NULL, 0); +INSERT test_demo VALUES (7, 108, 3, 11, N'子节点33', N'3333', 0, 103, getdate(), 1, NULL, NULL, 0); GO -INSERT test_demo VALUES (8, N'000000', 108, 3, 10, N'子节点44', N'4444', 0, 103, getdate(), 1, NULL, NULL, 0); +INSERT test_demo VALUES (8, 108, 3, 10, N'子节点44', N'4444', 0, 103, getdate(), 1, NULL, NULL, 0); GO -INSERT test_demo VALUES (9, N'000000', 108, 3, 9, N'子节点55', N'5555', 0, 103, getdate(), 1, NULL, NULL, 0); +INSERT test_demo VALUES (9, 108, 3, 9, N'子节点55', N'5555', 0, 103, getdate(), 1, NULL, NULL, 0); GO -INSERT test_demo VALUES (10, N'000000', 108, 3, 8, N'子节点66', N'6666', 0, 103, getdate(), 1, NULL, NULL, 0); +INSERT test_demo VALUES (10, 108, 3, 8, N'子节点66', N'6666', 0, 103, getdate(), 1, NULL, NULL, 0); GO -INSERT test_demo VALUES (11, N'000000', 108, 3, 7, N'子节点77', N'7777', 0, 103, getdate(), 1, NULL, NULL, 0); +INSERT test_demo VALUES (11, 108, 3, 7, N'子节点77', N'7777', 0, 103, getdate(), 1, NULL, NULL, 0); GO -INSERT test_demo VALUES (12, N'000000', 108, 3, 6, N'子节点88', N'8888', 0, 103, getdate(), 1, NULL, NULL, 0); +INSERT test_demo VALUES (12, 108, 3, 6, N'子节点88', N'8888', 0, 103, getdate(), 1, NULL, NULL, 0); GO -INSERT test_demo VALUES (13, N'000000', 108, 3, 5, N'子节点99', N'9999', 0, 103, getdate(), 1, NULL, NULL, 0); +INSERT test_demo VALUES (13, 108, 3, 5, N'子节点99', N'9999', 0, 103, getdate(), 1, NULL, NULL, 0); GO -INSERT test_tree VALUES (1, N'000000', 0, 102, 4, N'测试数据权限', 0, 103, getdate(), 1, NULL, NULL, 0); +INSERT test_tree VALUES (1, 0, 102, 4, N'测试数据权限', 0, 103, getdate(), 1, NULL, NULL, 0); GO -INSERT test_tree VALUES (2, N'000000', 1, 102, 3, N'子节点1', 0, 103, getdate(), 1, NULL, NULL, 0); +INSERT test_tree VALUES (2, 1, 102, 3, N'子节点1', 0, 103, getdate(), 1, NULL, NULL, 0); GO -INSERT test_tree VALUES (3, N'000000', 2, 102, 3, N'子节点2', 0, 103, getdate(), 1, NULL, NULL, 0); +INSERT test_tree VALUES (3, 2, 102, 3, N'子节点2', 0, 103, getdate(), 1, NULL, NULL, 0); GO -INSERT test_tree VALUES (4, N'000000', 0, 108, 4, N'测试树1', 0, 103, getdate(), 1, NULL, NULL, 0); +INSERT test_tree VALUES (4, 0, 108, 4, N'测试树1', 0, 103, getdate(), 1, NULL, NULL, 0); GO -INSERT test_tree VALUES (5, N'000000', 4, 108, 3, N'子节点11', 0, 103, getdate(), 1, NULL, NULL, 0); +INSERT test_tree VALUES (5, 4, 108, 3, N'子节点11', 0, 103, getdate(), 1, NULL, NULL, 0); GO -INSERT test_tree VALUES (6, N'000000', 4, 108, 3, N'子节点22', 0, 103, getdate(), 1, NULL, NULL, 0); +INSERT test_tree VALUES (6, 4, 108, 3, N'子节点22', 0, 103, getdate(), 1, NULL, NULL, 0); GO -INSERT test_tree VALUES (7, N'000000', 4, 108, 3, N'子节点33', 0, 103, getdate(), 1, NULL, NULL, 0); +INSERT test_tree VALUES (7, 4, 108, 3, N'子节点33', 0, 103, getdate(), 1, NULL, NULL, 0); GO -INSERT test_tree VALUES (8, N'000000', 5, 108, 3, N'子节点44', 0, 103, getdate(), 1, NULL, NULL, 0); +INSERT test_tree VALUES (8, 5, 108, 3, N'子节点44', 0, 103, getdate(), 1, NULL, NULL, 0); GO -INSERT test_tree VALUES (9, N'000000', 6, 108, 3, N'子节点55', 0, 103, getdate(), 1, NULL, NULL, 0); +INSERT test_tree VALUES (9, 6, 108, 3, N'子节点55', 0, 103, getdate(), 1, NULL, NULL, 0); GO -INSERT test_tree VALUES (10, N'000000', 7, 108, 3, N'子节点66', 0, 103, getdate(), 1, NULL, NULL, 0); +INSERT test_tree VALUES (10, 7, 108, 3, N'子节点66', 0, 103, getdate(), 1, NULL, NULL, 0); GO -INSERT test_tree VALUES (11, N'000000', 7, 108, 3, N'子节点77', 0, 103, getdate(), 1, NULL, NULL, 0); +INSERT test_tree VALUES (11, 7, 108, 3, N'子节点77', 0, 103, getdate(), 1, NULL, NULL, 0); GO -INSERT test_tree VALUES (12, N'000000', 10, 108, 3, N'子节点88', 0, 103, getdate(), 1, NULL, NULL, 0); +INSERT test_tree VALUES (12, 10, 108, 3, N'子节点88', 0, 103, getdate(), 1, NULL, NULL, 0); GO -INSERT test_tree VALUES (13, N'000000', 10, 108, 3, N'子节点99', 0, 103, getdate(), 1, NULL, NULL, 0); +INSERT test_tree VALUES (13, 10, 108, 3, N'子节点99', 0, 103, getdate(), 1, NULL, NULL, 0); GO diff --git a/script/sql/sqlserver/sqlserver_ry_workflow.sql b/script/sql/sqlserver/sqlserver_ry_workflow.sql index 09a661fbd..97401da45 100644 --- a/script/sql/sqlserver/sqlserver_ry_workflow.sql +++ b/script/sql/sqlserver/sqlserver_ry_workflow.sql @@ -1184,25 +1184,25 @@ EXEC sp_addextendedproperty 'TABLE', N'flow_category' GO -INSERT flow_category VALUES (100, N'000000', 0, N'0', N'OA审批', 0, N'0', 103, 1, getdate(), NULL, NULL); +INSERT flow_category VALUES (100, 0, N'0', N'OA审批', 0, N'0', 103, 1, getdate(), NULL, NULL); GO -INSERT flow_category VALUES (101, N'000000', 100, N'0,100', N'假勤管理', 0, N'0', 103, 1, getdate(), NULL, NULL); +INSERT flow_category VALUES (101, 100, N'0,100', N'假勤管理', 0, N'0', 103, 1, getdate(), NULL, NULL); GO -INSERT flow_category VALUES (102, N'000000', 100, N'0,100', N'人事管理', 1, N'0', 103, 1, getdate(), NULL, NULL); +INSERT flow_category VALUES (102, 100, N'0,100', N'人事管理', 1, N'0', 103, 1, getdate(), NULL, NULL); GO -INSERT flow_category VALUES (103, N'000000', 101, N'0,100,101', N'请假', 0, N'0', 103, 1, getdate(), NULL, NULL); +INSERT flow_category VALUES (103, 101, N'0,100,101', N'请假', 0, N'0', 103, 1, getdate(), NULL, NULL); GO -INSERT flow_category VALUES (104, N'000000', 101, N'0,100,101', N'出差', 1, N'0', 103, 1, getdate(), NULL, NULL); +INSERT flow_category VALUES (104, 101, N'0,100,101', N'出差', 1, N'0', 103, 1, getdate(), NULL, NULL); GO -INSERT flow_category VALUES (105, N'000000', 101, N'0,100,101', N'加班', 2, N'0', 103, 1, getdate(), NULL, NULL); +INSERT flow_category VALUES (105, 101, N'0,100,101', N'加班', 2, N'0', 103, 1, getdate(), NULL, NULL); GO -INSERT flow_category VALUES (106, N'000000', 101, N'0,100,101', N'换班', 3, N'0', 103, 1, getdate(), NULL, NULL); +INSERT flow_category VALUES (106, 101, N'0,100,101', N'换班', 3, N'0', 103, 1, getdate(), NULL, NULL); GO -INSERT flow_category VALUES (107, N'000000', 101, N'0,100,101', N'外出', 4, N'0', 103, 1, getdate(), NULL, NULL); +INSERT flow_category VALUES (107, 101, N'0,100,101', N'外出', 4, N'0', 103, 1, getdate(), NULL, NULL); GO -INSERT flow_category VALUES (108, N'000000', 102, N'0,100,102', N'转正', 1, N'0', 103, 1, getdate(), NULL, NULL); +INSERT flow_category VALUES (108, 102, N'0,100,102', N'转正', 1, N'0', 103, 1, getdate(), NULL, NULL); GO -INSERT flow_category VALUES (109, N'000000', 102, N'0,100,102', N'离职', 2, N'0', 103, 1, getdate(), NULL, NULL); +INSERT flow_category VALUES (109, 102, N'0,100,102', N'离职', 2, N'0', 103, 1, getdate(), NULL, NULL); GO CREATE TABLE flow_spel ( @@ -1626,52 +1626,52 @@ INSERT sys_menu VALUES (11642, N'请假申请删除', 11638, 4, N'#', N'', N'', GO INSERT sys_menu VALUES (11643, N'请假申请导出', 11638, 5, N'#', N'', N'', 1, 0, N'F', N'0', N'0', N'workflow:leave:export', N'#', 103, 1, GETDATE(), NULL, NULL, N''); -INSERT sys_dict_type VALUES (13, N'000000', N'业务状态', N'wf_business_status', 103, 1, GETDATE(), NULL, NULL, N'业务状态列表'); +INSERT sys_dict_type VALUES (13, N'业务状态', N'wf_business_status', 103, 1, GETDATE(), NULL, NULL, N'业务状态列表'); GO -INSERT sys_dict_type VALUES (14, N'000000', N'表单类型', N'wf_form_type', 103, 1, GETDATE(), NULL, NULL, N'表单类型列表'); +INSERT sys_dict_type VALUES (14, N'表单类型', N'wf_form_type', 103, 1, GETDATE(), NULL, NULL, N'表单类型列表'); GO -INSERT sys_dict_type VALUES (15, N'000000', N'任务状态', N'wf_task_status', 103, 1, GETDATE(), NULL, NULL, N'任务状态'); +INSERT sys_dict_type VALUES (15, N'任务状态', N'wf_task_status', 103, 1, GETDATE(), NULL, NULL, N'任务状态'); GO -INSERT sys_dict_data VALUES (39, N'000000', 1, N'已撤销', N'cancel', N'wf_business_status', N'', N'danger', N'N', 103, 1, GETDATE(), NULL, NULL, N'已撤销'); +INSERT sys_dict_data VALUES (39, 1, N'已撤销', N'cancel', N'wf_business_status', N'', N'danger', N'N', 103, 1, GETDATE(), NULL, NULL, N'已撤销'); GO -INSERT sys_dict_data VALUES (40, N'000000', 2, N'草稿', N'draft', N'wf_business_status', N'', N'info', N'N', 103, 1, GETDATE(), NULL, NULL, N'草稿'); +INSERT sys_dict_data VALUES (40, 2, N'草稿', N'draft', N'wf_business_status', N'', N'info', N'N', 103, 1, GETDATE(), NULL, NULL, N'草稿'); GO -INSERT sys_dict_data VALUES (41, N'000000', 3, N'待审核', N'waiting', N'wf_business_status', N'', N'primary', N'N', 103, 1, GETDATE(), NULL, NULL, N'待审核'); +INSERT sys_dict_data VALUES (41, 3, N'待审核', N'waiting', N'wf_business_status', N'', N'primary', N'N', 103, 1, GETDATE(), NULL, NULL, N'待审核'); GO -INSERT sys_dict_data VALUES (42, N'000000', 4, N'已完成', N'finish', N'wf_business_status', N'', N'success', N'N', 103, 1, GETDATE(), NULL, NULL, N'已完成'); +INSERT sys_dict_data VALUES (42, 4, N'已完成', N'finish', N'wf_business_status', N'', N'success', N'N', 103, 1, GETDATE(), NULL, NULL, N'已完成'); GO -INSERT sys_dict_data VALUES (43, N'000000', 5, N'已作废', N'invalid', N'wf_business_status', N'', N'danger', N'N', 103, 1, GETDATE(), NULL, NULL, N'已作废'); +INSERT sys_dict_data VALUES (43, 5, N'已作废', N'invalid', N'wf_business_status', N'', N'danger', N'N', 103, 1, GETDATE(), NULL, NULL, N'已作废'); GO -INSERT sys_dict_data VALUES (44, N'000000', 6, N'已退回', N'back', N'wf_business_status', N'', N'danger', N'N', 103, 1, GETDATE(), NULL, NULL, N'已退回'); +INSERT sys_dict_data VALUES (44, 6, N'已退回', N'back', N'wf_business_status', N'', N'danger', N'N', 103, 1, GETDATE(), NULL, NULL, N'已退回'); GO -INSERT sys_dict_data VALUES (45, N'000000', 7, N'已终止', N'termination', N'wf_business_status', N'', N'danger', N'N', 103, 1, GETDATE(), NULL, NULL, N'已终止'); +INSERT sys_dict_data VALUES (45, 7, N'已终止', N'termination', N'wf_business_status', N'', N'danger', N'N', 103, 1, GETDATE(), NULL, NULL, N'已终止'); GO -INSERT sys_dict_data VALUES (46, N'000000', 1, N'自定义表单', N'static', N'wf_form_type', N'', N'success', N'N', 103, 1, GETDATE(), NULL, NULL, N'自定义表单'); +INSERT sys_dict_data VALUES (46, 1, N'自定义表单', N'static', N'wf_form_type', N'', N'success', N'N', 103, 1, GETDATE(), NULL, NULL, N'自定义表单'); GO -INSERT sys_dict_data VALUES (47, N'000000', 2, N'动态表单', N'dynamic', N'wf_form_type', N'', N'primary', N'N', 103, 1, GETDATE(), NULL, NULL, N'动态表单'); +INSERT sys_dict_data VALUES (47, 2, N'动态表单', N'dynamic', N'wf_form_type', N'', N'primary', N'N', 103, 1, GETDATE(), NULL, NULL, N'动态表单'); GO -INSERT sys_dict_data VALUES (48, N'000000', 1, N'撤销', N'cancel', N'wf_task_status', N'', N'danger', N'N', 103, 1, GETDATE(), NULL, NULL, N'撤销'); +INSERT sys_dict_data VALUES (48, 1, N'撤销', N'cancel', N'wf_task_status', N'', N'danger', N'N', 103, 1, GETDATE(), NULL, NULL, N'撤销'); GO -INSERT sys_dict_data VALUES (49, N'000000', 2, N'通过', N'pass', N'wf_task_status', N'', N'success', N'N', 103, 1, GETDATE(), NULL, NULL, N'通过'); +INSERT sys_dict_data VALUES (49, 2, N'通过', N'pass', N'wf_task_status', N'', N'success', N'N', 103, 1, GETDATE(), NULL, NULL, N'通过'); GO -INSERT sys_dict_data VALUES (50, N'000000', 3, N'待审核', N'waiting', N'wf_task_status', N'', N'primary', N'N', 103, 1, GETDATE(), NULL, NULL, N'待审核'); +INSERT sys_dict_data VALUES (50, 3, N'待审核', N'waiting', N'wf_task_status', N'', N'primary', N'N', 103, 1, GETDATE(), NULL, NULL, N'待审核'); GO -INSERT sys_dict_data VALUES (51, N'000000', 4, N'作废', N'invalid', N'wf_task_status', N'', N'danger', N'N', 103, 1, GETDATE(), NULL, NULL, N'作废'); +INSERT sys_dict_data VALUES (51, 4, N'作废', N'invalid', N'wf_task_status', N'', N'danger', N'N', 103, 1, GETDATE(), NULL, NULL, N'作废'); GO -INSERT sys_dict_data VALUES (52, N'000000', 5, N'退回', N'back', N'wf_task_status', N'', N'danger', N'N', 103, 1, GETDATE(), NULL, NULL, N'退回'); +INSERT sys_dict_data VALUES (52, 5, N'退回', N'back', N'wf_task_status', N'', N'danger', N'N', 103, 1, GETDATE(), NULL, NULL, N'退回'); GO -INSERT sys_dict_data VALUES (53, N'000000', 6, N'终止', N'termination', N'wf_task_status', N'', N'danger', N'N', 103, 1, GETDATE(), NULL, NULL, N'终止'); +INSERT sys_dict_data VALUES (53, 6, N'终止', N'termination', N'wf_task_status', N'', N'danger', N'N', 103, 1, GETDATE(), NULL, NULL, N'终止'); GO -INSERT sys_dict_data VALUES (54, N'000000', 7, N'转办', N'transfer', N'wf_task_status', N'', N'primary', N'N', 103, 1, GETDATE(), NULL, NULL, N'转办'); +INSERT sys_dict_data VALUES (54, 7, N'转办', N'transfer', N'wf_task_status', N'', N'primary', N'N', 103, 1, GETDATE(), NULL, NULL, N'转办'); GO -INSERT sys_dict_data VALUES (55, N'000000', 8, N'委托', N'depute', N'wf_task_status', N'', N'primary', N'N', 103, 1, GETDATE(), NULL, NULL, N'委托'); +INSERT sys_dict_data VALUES (55, 8, N'委托', N'depute', N'wf_task_status', N'', N'primary', N'N', 103, 1, GETDATE(), NULL, NULL, N'委托'); GO -INSERT sys_dict_data VALUES (56, N'000000', 9, N'抄送', N'copy', N'wf_task_status', N'', N'primary', N'N', 103, 1, GETDATE(), NULL, NULL, N'抄送'); +INSERT sys_dict_data VALUES (56, 9, N'抄送', N'copy', N'wf_task_status', N'', N'primary', N'N', 103, 1, GETDATE(), NULL, NULL, N'抄送'); GO -INSERT sys_dict_data VALUES (57, N'000000', 10, N'加签', N'sign', N'wf_task_status', N'', N'primary', N'N', 103, 1, GETDATE(), NULL, NULL, N'加签'); +INSERT sys_dict_data VALUES (57, 10, N'加签', N'sign', N'wf_task_status', N'', N'primary', N'N', 103, 1, GETDATE(), NULL, NULL, N'加签'); GO -INSERT sys_dict_data VALUES (58, N'000000', 11, N'减签', N'sign_off', N'wf_task_status', N'', N'danger', N'N', 103, 1, GETDATE(), NULL, NULL, N'减签'); +INSERT sys_dict_data VALUES (58, 11, N'减签', N'sign_off', N'wf_task_status', N'', N'danger', N'N', 103, 1, GETDATE(), NULL, NULL, N'减签'); GO -INSERT sys_dict_data VALUES (59, N'000000', 11, N'超时', N'timeout', N'wf_task_status', N'', N'danger', N'N', 103, 1, GETDATE(), NULL, NULL, N'超时'); +INSERT sys_dict_data VALUES (59, 11, N'超时', N'timeout', N'wf_task_status', N'', N'danger', N'N', 103, 1, GETDATE(), NULL, NULL, N'超时'); GO