Commit d48a236d4c74663203d9bd9ff2056f7d7a2aeb0f

Authored by 芋道源码
Committed by Gitee
2 parents e63ae8e1 feba904f

!720 1. 完善达梦的兼容性;2. 增加域名解析租户编号

Merge pull request !720 from 芋道源码/feature/dameng
Showing 20 changed files with 112 additions and 115 deletions
sql/dm/ruoyi-vue-pro-dm8.sql
... ... @@ -3941,7 +3941,7 @@ CREATE TABLE "RUOYI_VUE_PRO"."SYSTEM_TENANT"
3941 3941 "CONTACT_MOBILE" VARCHAR(500) NULL,
3942 3942 "STATUS" TINYINT DEFAULT 0
3943 3943 NOT NULL,
3944   - "DOMAIN" VARCHAR(256) DEFAULT ''
  3944 + "WEBSITE" VARCHAR(256) DEFAULT ''
3945 3945 NULL,
3946 3946 "PACKAGE_ID" BIGINT NOT NULL,
3947 3947 "EXPIRE_TIME" TIMESTAMP(0) NOT NULL,
... ... @@ -4943,9 +4943,9 @@ SET IDENTITY_INSERT "RUOYI_VUE_PRO"."SYSTEM_SOCIAL_USER" OFF;
4943 4943 SET IDENTITY_INSERT "RUOYI_VUE_PRO"."SYSTEM_SOCIAL_USER_BIND" ON;
4944 4944 SET IDENTITY_INSERT "RUOYI_VUE_PRO"."SYSTEM_SOCIAL_USER_BIND" OFF;
4945 4945 SET IDENTITY_INSERT "RUOYI_VUE_PRO"."SYSTEM_TENANT" ON;
4946   -INSERT INTO "RUOYI_VUE_PRO"."SYSTEM_TENANT"("ID","NAME","CONTACT_USER_ID","CONTACT_NAME","CONTACT_MOBILE","STATUS","DOMAIN","PACKAGE_ID","EXPIRE_TIME","ACCOUNT_COUNT","CREATOR","CREATE_TIME","UPDATER","UPDATE_TIME","DELETED") VALUES(1,'芋道源码',null,'芋艿','17321315478',0,'https://www.iocoder.cn',0,'2099-02-19 17:14:16',9999,'1','2021-01-05 17:03:47','1','2022-02-23 12:15:11',0);
4947   -INSERT INTO "RUOYI_VUE_PRO"."SYSTEM_TENANT"("ID","NAME","CONTACT_USER_ID","CONTACT_NAME","CONTACT_MOBILE","STATUS","DOMAIN","PACKAGE_ID","EXPIRE_TIME","ACCOUNT_COUNT","CREATOR","CREATE_TIME","UPDATER","UPDATE_TIME","DELETED") VALUES(121,'小租户',110,'小王2','15601691300',0,'http://www.iocoder.cn',111,'2024-03-11 00:00:00',20,'1','2022-02-22 00:56:14','1','2022-05-17 10:03:59',0);
4948   -INSERT INTO "RUOYI_VUE_PRO"."SYSTEM_TENANT"("ID","NAME","CONTACT_USER_ID","CONTACT_NAME","CONTACT_MOBILE","STATUS","DOMAIN","PACKAGE_ID","EXPIRE_TIME","ACCOUNT_COUNT","CREATOR","CREATE_TIME","UPDATER","UPDATE_TIME","DELETED") VALUES(122,'测试租户',113,'芋道','15601691300',0,'https://www.iocoder.cn',111,'2022-04-30 00:00:00',50,'1','2022-03-07 21:37:58','1','2022-03-07 21:37:58',0);
  4946 +INSERT INTO "RUOYI_VUE_PRO"."SYSTEM_TENANT"("ID","NAME","CONTACT_USER_ID","CONTACT_NAME","CONTACT_MOBILE","STATUS","WEBSITE","PACKAGE_ID","EXPIRE_TIME","ACCOUNT_COUNT","CREATOR","CREATE_TIME","UPDATER","UPDATE_TIME","DELETED") VALUES(1,'芋道源码',null,'芋艿','17321315478',0,'https://www.iocoder.cn',0,'2099-02-19 17:14:16',9999,'1','2021-01-05 17:03:47','1','2022-02-23 12:15:11',0);
  4947 +INSERT INTO "RUOYI_VUE_PRO"."SYSTEM_TENANT"("ID","NAME","CONTACT_USER_ID","CONTACT_NAME","CONTACT_MOBILE","STATUS","WEBSITE","PACKAGE_ID","EXPIRE_TIME","ACCOUNT_COUNT","CREATOR","CREATE_TIME","UPDATER","UPDATE_TIME","DELETED") VALUES(121,'小租户',110,'小王2','15601691300',0,'http://www.iocoder.cn',111,'2024-03-11 00:00:00',20,'1','2022-02-22 00:56:14','1','2022-05-17 10:03:59',0);
  4948 +INSERT INTO "RUOYI_VUE_PRO"."SYSTEM_TENANT"("ID","NAME","CONTACT_USER_ID","CONTACT_NAME","CONTACT_MOBILE","STATUS","WEBSITE","PACKAGE_ID","EXPIRE_TIME","ACCOUNT_COUNT","CREATOR","CREATE_TIME","UPDATER","UPDATE_TIME","DELETED") VALUES(122,'测试租户',113,'芋道','15601691300',0,'https://www.iocoder.cn',111,'2022-04-30 00:00:00',50,'1','2022-03-07 21:37:58','1','2022-03-07 21:37:58',0);
4949 4949  
4950 4950 SET IDENTITY_INSERT "RUOYI_VUE_PRO"."SYSTEM_TENANT" OFF;
4951 4951 SET IDENTITY_INSERT "RUOYI_VUE_PRO"."SYSTEM_TENANT_PACKAGE" ON;
... ... @@ -5674,7 +5674,7 @@ COMMENT ON COLUMN "RUOYI_VUE_PRO"."SYSTEM_TENANT"."CONTACT_MOBILE" IS '联系手
5674 5674  
5675 5675 COMMENT ON COLUMN "RUOYI_VUE_PRO"."SYSTEM_TENANT"."STATUS" IS '租户状态(0正常 1停用)';
5676 5676  
5677   -COMMENT ON COLUMN "RUOYI_VUE_PRO"."SYSTEM_TENANT"."DOMAIN" IS '绑定域名';
  5677 +COMMENT ON COLUMN "RUOYI_VUE_PRO"."SYSTEM_TENANT"."WEBSITE" IS '绑定域名';
5678 5678  
5679 5679 COMMENT ON COLUMN "RUOYI_VUE_PRO"."SYSTEM_TENANT"."PACKAGE_ID" IS '租户套餐编号';
5680 5680  
... ...
sql/mysql/mall.sql
1   -INSERT INTO system_menu (name, permission, type, sort, parent_id, path, icon, component, component_name)
2   -VALUES ('核销订单', '', 2, 2, 2166, 'pick-up-order', 'ep:list', 'mall/trade/delivery/pickUpOrder/index', 'PickUpOrder');
3   -
4   -CREATE TABLE promotion_diy_template
5   -(
6   - id bigint AUTO_INCREMENT COMMENT '装修模板编号'
7   - PRIMARY KEY,
8   - name varchar(100) NOT NULL COMMENT '模板名称',
9   - used bit DEFAULT b'0' NOT NULL COMMENT '是否使用',
10   - used_time datetime NULL COMMENT '使用时间',
11   - remark varchar(255) NULL COMMENT '备注',
12   - preview_image_urls varchar(2000) NULL COMMENT '预览图,多个逗号分隔',
13   - property text NULL COMMENT '页面属性,JSON 格式',
14   - creator varchar(64) DEFAULT '' NULL COMMENT '创建者',
15   - create_time datetime DEFAULT CURRENT_TIMESTAMP NOT NULL COMMENT '创建时间',
16   - updater varchar(64) DEFAULT '' NULL COMMENT '更新者',
17   - update_time datetime DEFAULT CURRENT_TIMESTAMP NOT NULL ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
18   - deleted bit DEFAULT b'0' NOT NULL COMMENT '是否删除',
19   - tenant_id bigint DEFAULT 0 NOT NULL COMMENT '租户编号'
20   -)
21   - COMMENT '装修模板';
22   -
23   -CREATE TABLE promotion_diy_page
24   -(
25   - id bigint AUTO_INCREMENT COMMENT '装修页面编号'
26   - PRIMARY KEY,
27   - template_id bigint NULL COMMENT '装修模板编号',
28   - name varchar(100) NOT NULL COMMENT '页面名称',
29   - remark varchar(255) NULL COMMENT '备注',
30   - preview_image_urls varchar(2000) NULL COMMENT '预览图,多个逗号分隔',
31   - property text NULL COMMENT '页面属性,JSON 格式',
32   - creator varchar(64) DEFAULT '' NULL COMMENT '创建者',
33   - create_time datetime DEFAULT CURRENT_TIMESTAMP NOT NULL COMMENT '创建时间',
34   - updater varchar(64) DEFAULT '' NULL COMMENT '更新者',
35   - update_time datetime DEFAULT CURRENT_TIMESTAMP NOT NULL ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
36   - deleted bit DEFAULT b'0' NOT NULL COMMENT '是否删除',
37   - tenant_id bigint DEFAULT 0 NOT NULL COMMENT '租户编号'
38   -)
39   - COMMENT '装修页面';
40   -
41   -CREATE INDEX idx_template_id ON promotion_diy_page (template_id);
42   -
43   --- 装修,上级菜单:营销中心
44   -INSERT INTO system_menu(name, permission, type, sort, parent_id, path, icon, component, status, component_name)
45   -VALUES ('商城装修', '', 2, 20, 2030, 'diy-template', 'fa6-solid:brush', 'mall/promotion/diy/template/index', 0, 'DiyTemplate');
46   -SELECT @diyParentId := LAST_INSERT_ID();
47   -
48   --- 装修模板
49   -INSERT INTO system_menu(name, permission, type, sort, parent_id, path, icon, component, status, component_name)
50   -VALUES ('装修模板', '', 2, 1, @diyParentId, 'diy-template', 'fa6-solid:brush', 'mall/promotion/diy/template/index', 0, 'DiyTemplate');
51   -SELECT @parentId := LAST_INSERT_ID();
52   -INSERT INTO system_menu(name, permission, type, sort, parent_id, path, icon, component, status)
53   -VALUES ('装修模板查询', 'promotion:diy-template:query', 3, 1, @parentId, '', '', '', 0);
54   -INSERT INTO system_menu(name, permission, type, sort, parent_id, path, icon, component, status)
55   -VALUES ('装修模板创建', 'promotion:diy-template:create', 3, 2, @parentId, '', '', '', 0);
56   -INSERT INTO system_menu(name, permission, type, sort, parent_id, path, icon, component, status)
57   -VALUES ('装修模板更新', 'promotion:diy-template:update', 3, 3, @parentId, '', '', '', 0);
58   -INSERT INTO system_menu(name, permission, type, sort, parent_id, path, icon, component, status)
59   -VALUES ('装修模板删除', 'promotion:diy-template:delete', 3, 4, @parentId, '', '', '', 0);
60   -INSERT INTO system_menu(name, permission, type, sort, parent_id, path, icon, component, status)
61   -VALUES ('装修模板使用', 'promotion:diy-template:use', 3, 5, @parentId, '', '', '', 0);
62   -
63   --- 装修页面
64   -INSERT INTO system_menu(name, permission, type, sort, parent_id, path, icon, component, status, component_name)
65   -VALUES ('装修页面', '', 2, 2, @diyParentId, 'diy-page', 'foundation:page-edit', 'mall/promotion/diy/page/index', 0, 'DiyPage');
66   -SELECT @parentId := LAST_INSERT_ID();
67   -INSERT INTO system_menu(name, permission, type, sort, parent_id, path, icon, component, status)
68   -VALUES ('装修页面查询', 'promotion:diy-page:query', 3, 1, @parentId, '', '', '', 0);
69   -INSERT INTO system_menu(name, permission, type, sort, parent_id, path, icon, component, status)
70   -VALUES ('装修页面创建', 'promotion:diy-page:create', 3, 2, @parentId, '', '', '', 0);
71   -INSERT INTO system_menu(name, permission, type, sort, parent_id, path, icon, component, status)
72   -VALUES ('装修页面更新', 'promotion:diy-page:update', 3, 3, @parentId, '', '', '', 0);
73   -INSERT INTO system_menu(name, permission, type, sort, parent_id, path, icon, component, status)
74   -VALUES ('装修页面删除', 'promotion:diy-page:delete', 3, 4, @parentId, '', '', '', 0);;
75 0 \ No newline at end of file
sql/mysql/pay_wallet.sql
... ... @@ -60,8 +60,8 @@ CREATE TABLE `pay_demo_transfer` (
60 60 ) ENGINE = InnoDB COMMENT = '示例业务转账订单';
61 61  
62 62  
63   -ALTER TABLE `pay_channel`
64   - MODIFY COLUMN `config` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '支付渠道配置' AFTER `app_id`;
  63 +-- ALTER TABLE `pay_channel`
  64 +-- MODIFY COLUMN `config` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '支付渠道配置' AFTER `app_id`;
65 65  
66 66 -- ----------------------------
67 67 -- 充值套餐表
... ... @@ -245,4 +245,4 @@ INSERT INTO system_menu(
245 245 VALUES (
246 246 '转账订单', '', 2, 3, 1117,
247 247 'transfer', 'ep:credit-card', 'pay/transfer/index', 0, 'PayTransfer'
248   - );
249 248 \ No newline at end of file
  249 + );
... ...
sql/mysql/ruoyi-vue-pro.sql
... ... @@ -3787,7 +3787,7 @@ CREATE TABLE `system_tenant` (
3787 3787 `contact_name` varchar(30) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '联系人',
3788 3788 `contact_mobile` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '联系手机',
3789 3789 `status` tinyint NOT NULL DEFAULT 0 COMMENT '租户状态(0正常 1停用)',
3790   - `domain` varchar(256) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '绑定域名',
  3790 + `website` varchar(256) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '绑定域名',
3791 3791 `package_id` bigint NOT NULL COMMENT '租户套餐编号',
3792 3792 `expire_time` datetime NOT NULL COMMENT '过期时间',
3793 3793 `account_count` int NOT NULL COMMENT '账号数量',
... ... @@ -3803,9 +3803,9 @@ CREATE TABLE `system_tenant` (
3803 3803 -- Records of system_tenant
3804 3804 -- ----------------------------
3805 3805 BEGIN;
3806   -INSERT INTO `system_tenant` (`id`, `name`, `contact_user_id`, `contact_name`, `contact_mobile`, `status`, `domain`, `package_id`, `expire_time`, `account_count`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (1, '芋道源码', NULL, '芋艿', '17321315478', 0, 'https://www.iocoder.cn', 0, '2099-02-19 17:14:16', 9999, '1', '2021-01-05 17:03:47', '1', '2022-02-23 12:15:11', b'0');
3807   -INSERT INTO `system_tenant` (`id`, `name`, `contact_user_id`, `contact_name`, `contact_mobile`, `status`, `domain`, `package_id`, `expire_time`, `account_count`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (121, '小租户', 110, '小王2', '15601691300', 0, 'http://www.iocoder.cn', 111, '2024-03-11 00:00:00', 20, '1', '2022-02-22 00:56:14', '1', '2023-09-16 16:59:42', b'0');
3808   -INSERT INTO `system_tenant` (`id`, `name`, `contact_user_id`, `contact_name`, `contact_mobile`, `status`, `domain`, `package_id`, `expire_time`, `account_count`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (122, '测试租户', 113, '芋道', '15601691300', 0, 'https://www.iocoder.cn', 111, '2022-04-30 00:00:00', 50, '1', '2022-03-07 21:37:58', '1', '2023-09-16 16:59:27', b'0');
  3806 +INSERT INTO `system_tenant` (`id`, `name`, `contact_user_id`, `contact_name`, `contact_mobile`, `status`, `website`, `package_id`, `expire_time`, `account_count`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (1, '芋道源码', NULL, '芋艿', '17321315478', 0, 'https://www.iocoder.cn', 0, '2099-02-19 17:14:16', 9999, '1', '2021-01-05 17:03:47', '1', '2022-02-23 12:15:11', b'0');
  3807 +INSERT INTO `system_tenant` (`id`, `name`, `contact_user_id`, `contact_name`, `contact_mobile`, `status`, `website`, `package_id`, `expire_time`, `account_count`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (121, '小租户', 110, '小王2', '15601691300', 0, 'http://www.iocoder.cn', 111, '2024-03-11 00:00:00', 20, '1', '2022-02-22 00:56:14', '1', '2023-09-16 16:59:42', b'0');
  3808 +INSERT INTO `system_tenant` (`id`, `name`, `contact_user_id`, `contact_name`, `contact_mobile`, `status`, `website`, `package_id`, `expire_time`, `account_count`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (122, '测试租户', 113, '芋道', '15601691300', 0, 'https://www.iocoder.cn', 111, '2022-04-30 00:00:00', 50, '1', '2022-03-07 21:37:58', '1', '2023-09-16 16:59:27', b'0');
3809 3809 COMMIT;
3810 3810  
3811 3811 -- ----------------------------
... ...
sql/oracle/ruoyi-vue-pro.sql
... ... @@ -4178,7 +4178,7 @@ CREATE TABLE "SYSTEM_TENANT" (
4178 4178 "CONTACT_NAME" NVARCHAR2(30),
4179 4179 "CONTACT_MOBILE" NVARCHAR2(500),
4180 4180 "STATUS" NUMBER(4,0) NOT NULL,
4181   - "DOMAIN" NVARCHAR2(256),
  4181 + "WEBSITE" NVARCHAR2(256),
4182 4182 "PACKAGE_ID" NUMBER(20,0) NOT NULL,
4183 4183 "EXPIRE_TIME" DATE NOT NULL,
4184 4184 "ACCOUNT_COUNT" NUMBER(11,0) NOT NULL,
... ... @@ -4211,7 +4211,7 @@ COMMENT ON COLUMN "SYSTEM_TENANT"."CONTACT_USER_ID" IS '联系人的用户编号
4211 4211 COMMENT ON COLUMN "SYSTEM_TENANT"."CONTACT_NAME" IS '联系人';
4212 4212 COMMENT ON COLUMN "SYSTEM_TENANT"."CONTACT_MOBILE" IS '联系手机';
4213 4213 COMMENT ON COLUMN "SYSTEM_TENANT"."STATUS" IS '租户状态(0正常 1停用)';
4214   -COMMENT ON COLUMN "SYSTEM_TENANT"."DOMAIN" IS '绑定域名';
  4214 +COMMENT ON COLUMN "SYSTEM_TENANT"."WEBSITE" IS '绑定域名';
4215 4215 COMMENT ON COLUMN "SYSTEM_TENANT"."PACKAGE_ID" IS '租户套餐编号';
4216 4216 COMMENT ON COLUMN "SYSTEM_TENANT"."EXPIRE_TIME" IS '过期时间';
4217 4217 COMMENT ON COLUMN "SYSTEM_TENANT"."ACCOUNT_COUNT" IS '账号数量';
... ... @@ -4225,9 +4225,9 @@ COMMENT ON TABLE "SYSTEM_TENANT" IS '租户表';
4225 4225 -- ----------------------------
4226 4226 -- Records of SYSTEM_TENANT
4227 4227 -- ----------------------------
4228   -INSERT INTO "SYSTEM_TENANT" ("ID", "NAME", "CONTACT_USER_ID", "CONTACT_NAME", "CONTACT_MOBILE", "STATUS", "DOMAIN", "PACKAGE_ID", "EXPIRE_TIME", "ACCOUNT_COUNT", "CREATOR", "CREATE_TIME", "UPDATER", "UPDATE_TIME", "DELETED") VALUES ('1', '芋道源码', NULL, '芋艿', '17321315478', '0', 'https://www.iocoder.cn', '0', TO_DATE('2099-02-19 17:14:16', 'SYYYY-MM-DD HH24:MI:SS'), '9999', '1', TO_DATE('2021-01-05 17:03:47', 'SYYYY-MM-DD HH24:MI:SS'), '1', TO_DATE('2022-02-23 12:15:11', 'SYYYY-MM-DD HH24:MI:SS'), '0');
4229   -INSERT INTO "SYSTEM_TENANT" ("ID", "NAME", "CONTACT_USER_ID", "CONTACT_NAME", "CONTACT_MOBILE", "STATUS", "DOMAIN", "PACKAGE_ID", "EXPIRE_TIME", "ACCOUNT_COUNT", "CREATOR", "CREATE_TIME", "UPDATER", "UPDATE_TIME", "DELETED") VALUES ('121', '小租户', '110', '小王2', '15601691300', '0', 'http://www.iocoder.cn', '111', TO_DATE('2024-03-11 00:00:00', 'SYYYY-MM-DD HH24:MI:SS'), '20', '1', TO_DATE('2022-02-22 00:56:14', 'SYYYY-MM-DD HH24:MI:SS'), '1', TO_DATE('2022-03-19 18:37:20', 'SYYYY-MM-DD HH24:MI:SS'), '0');
4230   -INSERT INTO "SYSTEM_TENANT" ("ID", "NAME", "CONTACT_USER_ID", "CONTACT_NAME", "CONTACT_MOBILE", "STATUS", "DOMAIN", "PACKAGE_ID", "EXPIRE_TIME", "ACCOUNT_COUNT", "CREATOR", "CREATE_TIME", "UPDATER", "UPDATE_TIME", "DELETED") VALUES ('122', '测试租户', '113', '芋道', '15601691300', '0', 'https://www.iocoder.cn', '111', TO_DATE('2022-04-30 00:00:00', 'SYYYY-MM-DD HH24:MI:SS'), '50', '1', TO_DATE('2022-03-07 21:37:58', 'SYYYY-MM-DD HH24:MI:SS'), '1', TO_DATE('2022-03-07 21:37:58', 'SYYYY-MM-DD HH24:MI:SS'), '0');
  4228 +INSERT INTO "SYSTEM_TENANT" ("ID", "NAME", "CONTACT_USER_ID", "CONTACT_NAME", "CONTACT_MOBILE", "STATUS", "WEBSITE", "PACKAGE_ID", "EXPIRE_TIME", "ACCOUNT_COUNT", "CREATOR", "CREATE_TIME", "UPDATER", "UPDATE_TIME", "DELETED") VALUES ('1', '芋道源码', NULL, '芋艿', '17321315478', '0', 'https://www.iocoder.cn', '0', TO_DATE('2099-02-19 17:14:16', 'SYYYY-MM-DD HH24:MI:SS'), '9999', '1', TO_DATE('2021-01-05 17:03:47', 'SYYYY-MM-DD HH24:MI:SS'), '1', TO_DATE('2022-02-23 12:15:11', 'SYYYY-MM-DD HH24:MI:SS'), '0');
  4229 +INSERT INTO "SYSTEM_TENANT" ("ID", "NAME", "CONTACT_USER_ID", "CONTACT_NAME", "CONTACT_MOBILE", "STATUS", "WEBSITE", "PACKAGE_ID", "EXPIRE_TIME", "ACCOUNT_COUNT", "CREATOR", "CREATE_TIME", "UPDATER", "UPDATE_TIME", "DELETED") VALUES ('121', '小租户', '110', '小王2', '15601691300', '0', 'http://www.iocoder.cn', '111', TO_DATE('2024-03-11 00:00:00', 'SYYYY-MM-DD HH24:MI:SS'), '20', '1', TO_DATE('2022-02-22 00:56:14', 'SYYYY-MM-DD HH24:MI:SS'), '1', TO_DATE('2022-03-19 18:37:20', 'SYYYY-MM-DD HH24:MI:SS'), '0');
  4230 +INSERT INTO "SYSTEM_TENANT" ("ID", "NAME", "CONTACT_USER_ID", "CONTACT_NAME", "CONTACT_MOBILE", "STATUS", "WEBSITE", "PACKAGE_ID", "EXPIRE_TIME", "ACCOUNT_COUNT", "CREATOR", "CREATE_TIME", "UPDATER", "UPDATE_TIME", "DELETED") VALUES ('122', '测试租户', '113', '芋道', '15601691300', '0', 'https://www.iocoder.cn', '111', TO_DATE('2022-04-30 00:00:00', 'SYYYY-MM-DD HH24:MI:SS'), '50', '1', TO_DATE('2022-03-07 21:37:58', 'SYYYY-MM-DD HH24:MI:SS'), '1', TO_DATE('2022-03-07 21:37:58', 'SYYYY-MM-DD HH24:MI:SS'), '0');
4231 4231 COMMIT;
4232 4232 COMMIT;
4233 4233  
... ...
sql/postgresql/ruoyi-vue-pro.sql
... ... @@ -6779,7 +6779,7 @@ CREATE TABLE "system_tenant"
6779 6779 "contact_name" varchar(30) COLLATE "pg_catalog"."default" NOT NULL,
6780 6780 "contact_mobile" varchar(500) COLLATE "pg_catalog"."default",
6781 6781 "status" int2 NOT NULL,
6782   - "domain" varchar(256) COLLATE "pg_catalog"."default",
  6782 + "website" varchar(256) COLLATE "pg_catalog"."default",
6783 6783 "package_id" int8 NOT NULL,
6784 6784 "expire_time" timestamp(6) NOT NULL,
6785 6785 "account_count" int4 NOT NULL,
... ... @@ -6803,7 +6803,7 @@ ON COLUMN "system_tenant"."contact_mobile" IS '联系手机';
6803 6803 COMMENT
6804 6804 ON COLUMN "system_tenant"."status" IS '租户状态(0正常 1停用)';
6805 6805 COMMENT
6806   -ON COLUMN "system_tenant"."domain" IS '绑定域名';
  6806 +ON COLUMN "system_tenant"."website" IS '绑定域名';
6807 6807 COMMENT
6808 6808 ON COLUMN "system_tenant"."package_id" IS '租户套餐编号';
6809 6809 COMMENT
... ... @@ -6827,17 +6827,17 @@ ON TABLE "system_tenant" IS '租户表';
6827 6827 -- Records of system_tenant
6828 6828 -- ----------------------------
6829 6829 BEGIN;
6830   -INSERT INTO "system_tenant" ("id", "name", "contact_user_id", "contact_name", "contact_mobile", "status", "domain",
  6830 +INSERT INTO "system_tenant" ("id", "name", "contact_user_id", "contact_name", "contact_mobile", "status", "website",
6831 6831 "package_id", "expire_time", "account_count", "creator", "create_time", "updater",
6832 6832 "update_time", "deleted")
6833 6833 VALUES (1, '芋道源码', NULL, '芋艿', '17321315478', 0, 'https://www.iocoder.cn', 0, '2099-02-19 17:14:16', 9999, '1',
6834 6834 '2021-01-05 17:03:47', '1', '2022-02-23 12:15:11', 0);
6835   -INSERT INTO "system_tenant" ("id", "name", "contact_user_id", "contact_name", "contact_mobile", "status", "domain",
  6835 +INSERT INTO "system_tenant" ("id", "name", "contact_user_id", "contact_name", "contact_mobile", "status", "website",
6836 6836 "package_id", "expire_time", "account_count", "creator", "create_time", "updater",
6837 6837 "update_time", "deleted")
6838 6838 VALUES (121, '小租户', 110, '小王2', '15601691300', 0, 'http://www.iocoder.cn', 111, '2024-03-11 00:00:00', 20, '1',
6839 6839 '2022-02-22 00:56:14', '1', '2022-03-19 18:37:20', 0);
6840   -INSERT INTO "system_tenant" ("id", "name", "contact_user_id", "contact_name", "contact_mobile", "status", "domain",
  6840 +INSERT INTO "system_tenant" ("id", "name", "contact_user_id", "contact_name", "contact_mobile", "status", "website",
6841 6841 "package_id", "expire_time", "account_count", "creator", "create_time", "updater",
6842 6842 "update_time", "deleted")
6843 6843 VALUES (122, '测试租户', 113, '芋道', '15601691300', 0, 'https://www.iocoder.cn', 111, '2022-04-30 00:00:00', 50, '1',
... ...
sql/sqlserver/ruoyi-vue-pro.sql
... ... @@ -10595,7 +10595,7 @@ CREATE TABLE [dbo].[system_tenant] (
10595 10595 [contact_name] nvarchar(30) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
10596 10596 [contact_mobile] nvarchar(500) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
10597 10597 [status] tinyint NOT NULL,
10598   - [domain] nvarchar(256) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
  10598 + [website] nvarchar(256) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
10599 10599 [package_id] bigint NOT NULL,
10600 10600 [expire_time] datetime2(7) NOT NULL,
10601 10601 [account_count] int NOT NULL,
... ... @@ -10656,7 +10656,7 @@ EXEC sp_addextendedproperty
10656 10656 'MS_Description', N'绑定域名',
10657 10657 'SCHEMA', N'dbo',
10658 10658 'TABLE', N'system_tenant',
10659   -'COLUMN', N'domain'
  10659 +'COLUMN', N'website'
10660 10660 GO
10661 10661  
10662 10662 EXEC sp_addextendedproperty
... ... @@ -10731,13 +10731,13 @@ GO
10731 10731 SET IDENTITY_INSERT [dbo].[system_tenant] ON
10732 10732 GO
10733 10733  
10734   -INSERT INTO [dbo].[system_tenant] ([id], [name], [contact_user_id], [contact_name], [contact_mobile], [status], [domain], [package_id], [expire_time], [account_count], [creator], [create_time], [updater], [update_time], [deleted]) VALUES (N'1', N'芋道源码', NULL, N'芋艿', N'17321315478', N'0', N'https://www.iocoder.cn', N'0', N'2099-02-19 17:14:16.0000000', N'9999', N'1', N'2021-01-05 17:03:47.0000000', N'1', N'2022-02-23 12:15:11.0000000', N'0')
  10734 +INSERT INTO [dbo].[system_tenant] ([id], [name], [contact_user_id], [contact_name], [contact_mobile], [status], [website], [package_id], [expire_time], [account_count], [creator], [create_time], [updater], [update_time], [deleted]) VALUES (N'1', N'芋道源码', NULL, N'芋艿', N'17321315478', N'0', N'https://www.iocoder.cn', N'0', N'2099-02-19 17:14:16.0000000', N'9999', N'1', N'2021-01-05 17:03:47.0000000', N'1', N'2022-02-23 12:15:11.0000000', N'0')
10735 10735 GO
10736 10736  
10737   -INSERT INTO [dbo].[system_tenant] ([id], [name], [contact_user_id], [contact_name], [contact_mobile], [status], [domain], [package_id], [expire_time], [account_count], [creator], [create_time], [updater], [update_time], [deleted]) VALUES (N'121', N'小租户', N'110', N'小王2', N'15601691300', N'0', N'http://www.iocoder.cn', N'111', N'2024-03-11 00:00:00.0000000', N'20', N'1', N'2022-02-22 00:56:14.0000000', N'1', N'2022-03-19 18:37:20.0000000', N'0')
  10737 +INSERT INTO [dbo].[system_tenant] ([id], [name], [contact_user_id], [contact_name], [contact_mobile], [status], [website], [package_id], [expire_time], [account_count], [creator], [create_time], [updater], [update_time], [deleted]) VALUES (N'121', N'小租户', N'110', N'小王2', N'15601691300', N'0', N'http://www.iocoder.cn', N'111', N'2024-03-11 00:00:00.0000000', N'20', N'1', N'2022-02-22 00:56:14.0000000', N'1', N'2022-03-19 18:37:20.0000000', N'0')
10738 10738 GO
10739 10739  
10740   -INSERT INTO [dbo].[system_tenant] ([id], [name], [contact_user_id], [contact_name], [contact_mobile], [status], [domain], [package_id], [expire_time], [account_count], [creator], [create_time], [updater], [update_time], [deleted]) VALUES (N'122', N'测试租户', N'113', N'芋道', N'15601691300', N'0', N'https://www.iocoder.cn', N'111', N'2022-04-30 00:00:00.0000000', N'50', N'1', N'2022-03-07 21:37:58.0000000', N'1', N'2022-03-07 21:37:58.0000000', N'0')
  10740 +INSERT INTO [dbo].[system_tenant] ([id], [name], [contact_user_id], [contact_name], [contact_mobile], [status], [website], [package_id], [expire_time], [account_count], [creator], [create_time], [updater], [update_time], [deleted]) VALUES (N'122', N'测试租户', N'113', N'芋道', N'15601691300', N'0', N'https://www.iocoder.cn', N'111', N'2022-04-30 00:00:00.0000000', N'50', N'1', N'2022-03-07 21:37:58.0000000', N'1', N'2022-03-07 21:37:58.0000000', N'0')
10741 10741 GO
10742 10742  
10743 10743 SET IDENTITY_INSERT [dbo].[system_tenant] OFF
... ...
yudao-framework/yudao-spring-boot-starter-mybatis/pom.xml
... ... @@ -49,6 +49,7 @@
49 49 <groupId>com.dameng</groupId>
50 50 <artifactId>DmJdbcDriver18</artifactId>
51 51 </dependency>
  52 +
52 53 <dependency>
53 54 <groupId>com.alibaba</groupId>
54 55 <artifactId>druid-spring-boot-starter</artifactId>
... ...
yudao-module-system/yudao-module-system-api/src/main/java/cn/iocoder/yudao/module/system/enums/ErrorCodeConstants.java
... ... @@ -104,6 +104,7 @@ public interface ErrorCodeConstants {
104 104 ErrorCode TENANT_EXPIRE = new ErrorCode(1_002_015_002, "名字为【{}】的租户已过期");
105 105 ErrorCode TENANT_CAN_NOT_UPDATE_SYSTEM = new ErrorCode(1_002_015_003, "系统租户不能进行修改、删除等操作!");
106 106 ErrorCode TENANT_NAME_DUPLICATE = new ErrorCode(1_002_015_004, "名字为【{}】的租户已存在");
  107 + ErrorCode TENANT_WEBSITE_DUPLICATE = new ErrorCode(1_002_015_005, "域名为【{}】的租户已存在");
107 108  
108 109 // ========== 租户套餐 1-002-016-000 ==========
109 110 ErrorCode TENANT_PACKAGE_NOT_EXISTS = new ErrorCode(1_002_016_000, "租户套餐不存在");
... ...
yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/tenant/TenantController.java
... ... @@ -37,8 +37,17 @@ public class TenantController {
37 37 @Operation(summary = "使用租户名,获得租户编号", description = "登录界面,根据用户的租户名,获得租户编号")
38 38 @Parameter(name = "name", description = "租户名", required = true, example = "1024")
39 39 public CommonResult<Long> getTenantIdByName(@RequestParam("name") String name) {
40   - TenantDO tenantDO = tenantService.getTenantByName(name);
41   - return success(tenantDO != null ? tenantDO.getId() : null);
  40 + TenantDO tenant = tenantService.getTenantByName(name);
  41 + return success(tenant != null ? tenant.getId() : null);
  42 + }
  43 +
  44 + @GetMapping("/get-by-website")
  45 + @PermitAll
  46 + @Operation(summary = "使用域名,获得租户信息", description = "登录界面,根据用户的域名,获得租户信息")
  47 + @Parameter(name = "website", description = "域名", required = true, example = "www.iocoder.cn")
  48 + public CommonResult<TenantSimpleRespVO> getTenantByWebsite(@RequestParam("website") String website) {
  49 + TenantDO tenant = tenantService.getTenantByWebsite(website);
  50 + return success(TenantConvert.INSTANCE.convert03(tenant));
42 51 }
43 52  
44 53 @PostMapping("/create")
... ... @@ -94,5 +103,4 @@ public class TenantController {
94 103 ExcelUtils.write(response, "租户.xls", "数据", TenantExcelVO.class, datas);
95 104 }
96 105  
97   -
98 106 }
... ...
yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/tenant/vo/tenant/TenantBaseVO.java
... ... @@ -29,7 +29,7 @@ public class TenantBaseVO {
29 29 private Integer status;
30 30  
31 31 @Schema(description = "绑定域名", example = "https://www.iocoder.cn")
32   - private String domain;
  32 + private String website;
33 33  
34 34 @Schema(description = "租户套餐编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "1024")
35 35 @NotNull(message = "租户套餐编号不能为空")
... ...
yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/tenant/vo/tenant/TenantSimpleRespVO.java 0 → 100755
  1 +package cn.iocoder.yudao.module.system.controller.admin.tenant.vo.tenant;
  2 +
  3 +import io.swagger.v3.oas.annotations.media.Schema;
  4 +import lombok.Data;
  5 +import lombok.EqualsAndHashCode;
  6 +import lombok.ToString;
  7 +
  8 +@Schema(description = "管理后台 - 租户精简 Response VO")
  9 +@Data
  10 +@EqualsAndHashCode(callSuper = true)
  11 +@ToString(callSuper = true)
  12 +public class TenantSimpleRespVO extends TenantBaseVO {
  13 +
  14 + @Schema(description = "租户编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "1024")
  15 + private Long id;
  16 +
  17 + @Schema(description = "租户名", requiredMode = Schema.RequiredMode.REQUIRED, example = "芋道")
  18 + private String name;
  19 +
  20 +}
... ...
yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/convert/tenant/TenantConvert.java
1 1 package cn.iocoder.yudao.module.system.convert.tenant;
2 2  
3 3 import cn.iocoder.yudao.framework.common.pojo.PageResult;
4   -import cn.iocoder.yudao.module.system.controller.admin.tenant.vo.tenant.TenantCreateReqVO;
5   -import cn.iocoder.yudao.module.system.controller.admin.tenant.vo.tenant.TenantExcelVO;
6   -import cn.iocoder.yudao.module.system.controller.admin.tenant.vo.tenant.TenantRespVO;
7   -import cn.iocoder.yudao.module.system.controller.admin.tenant.vo.tenant.TenantUpdateReqVO;
  4 +import cn.iocoder.yudao.module.system.controller.admin.tenant.vo.tenant.*;
8 5 import cn.iocoder.yudao.module.system.controller.admin.user.vo.user.UserCreateReqVO;
9 6 import cn.iocoder.yudao.module.system.dal.dataobject.tenant.TenantDO;
10 7 import org.mapstruct.Mapper;
... ... @@ -28,6 +25,8 @@ public interface TenantConvert {
28 25  
29 26 TenantRespVO convert(TenantDO bean);
30 27  
  28 + TenantSimpleRespVO convert03(TenantDO bean);
  29 +
31 30 List<TenantRespVO> convertList(List<TenantDO> list);
32 31  
33 32 PageResult<TenantRespVO> convertPage(PageResult<TenantDO> page);
... ...
yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/dal/dataobject/tenant/TenantDO.java
... ... @@ -59,10 +59,8 @@ public class TenantDO extends BaseDO {
59 59 private Integer status;
60 60 /**
61 61 * 绑定域名
62   - *
63   - * TODO 芋艿:目前是预留字段,未来会支持根据域名,自动查询到对应的租户。等等
64 62 */
65   - private String domain;
  63 + private String website;
66 64 /**
67 65 * 租户套餐编号
68 66 *
... ...
yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/dal/mysql/tenant/TenantMapper.java
... ... @@ -42,6 +42,10 @@ public interface TenantMapper extends BaseMapperX&lt;TenantDO&gt; {
42 42 return selectOne(TenantDO::getName, name);
43 43 }
44 44  
  45 + default TenantDO selectByWebsite(String website) {
  46 + return selectOne(TenantDO::getWebsite, website);
  47 + }
  48 +
45 49 default Long selectCountByPackageId(Long packageId) {
46 50 return selectCount(TenantDO::getPackageId, packageId);
47 51 }
... ...
yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/tenant/TenantService.java
... ... @@ -78,12 +78,20 @@ public interface TenantService {
78 78 /**
79 79 * 获得名字对应的租户
80 80 *
81   - * @param name 组户名
  81 + * @param name 租户名
82 82 * @return 租户
83 83 */
84 84 TenantDO getTenantByName(String name);
85 85  
86 86 /**
  87 + * 获得域名对应的租户
  88 + *
  89 + * @param website 域名
  90 + * @return 租户
  91 + */
  92 + TenantDO getTenantByWebsite(String website);
  93 +
  94 + /**
87 95 * 获得使用指定套餐的租户数量
88 96 *
89 97 * @param packageId 租户套餐编号
... ... @@ -128,4 +136,5 @@ public interface TenantService {
128 136 * @param id 租户编号
129 137 */
130 138 void validTenant(Long id);
  139 +
131 140 }
... ...
yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/tenant/TenantServiceImpl.java
... ... @@ -3,6 +3,7 @@ package cn.iocoder.yudao.module.system.service.tenant;
3 3 import cn.hutool.core.collection.CollUtil;
4 4 import cn.hutool.core.lang.Assert;
5 5 import cn.hutool.core.util.ObjectUtil;
  6 +import cn.hutool.core.util.StrUtil;
6 7 import cn.iocoder.yudao.framework.common.enums.CommonStatusEnum;
7 8 import cn.iocoder.yudao.framework.common.pojo.PageResult;
8 9 import cn.iocoder.yudao.framework.common.util.collection.CollectionUtils;
... ... @@ -99,6 +100,8 @@ public class TenantServiceImpl implements TenantService {
99 100 public Long createTenant(TenantCreateReqVO createReqVO) {
100 101 // 校验租户名称是否重复
101 102 validTenantNameDuplicate(createReqVO.getName(), null);
  103 + // 校验租户域名是否重复
  104 + validTenantWebsiteDuplicate(createReqVO.getWebsite(), null);
102 105 // 校验套餐被禁用
103 106 TenantPackageDO tenantPackage = tenantPackageService.validTenantPackage(createReqVO.getPackageId());
104 107  
... ... @@ -143,6 +146,8 @@ public class TenantServiceImpl implements TenantService {
143 146 TenantDO tenant = validateUpdateTenant(updateReqVO.getId());
144 147 // 校验租户名称是否重复
145 148 validTenantNameDuplicate(updateReqVO.getName(), updateReqVO.getId());
  149 + // 校验租户域名是否重复
  150 + validTenantWebsiteDuplicate(updateReqVO.getWebsite(), updateReqVO.getId());
146 151 // 校验套餐被禁用
147 152 TenantPackageDO tenantPackage = tenantPackageService.validTenantPackage(updateReqVO.getPackageId());
148 153  
... ... @@ -169,6 +174,23 @@ public class TenantServiceImpl implements TenantService {
169 174 }
170 175 }
171 176  
  177 + private void validTenantWebsiteDuplicate(String website, Long id) {
  178 + if (StrUtil.isEmpty(website)) {
  179 + return;
  180 + }
  181 + TenantDO tenant = tenantMapper.selectByWebsite(website);
  182 + if (tenant == null) {
  183 + return;
  184 + }
  185 + // 如果 id 为空,说明不用比较是否为相同名字的租户
  186 + if (id == null) {
  187 + throw exception(TENANT_WEBSITE_DUPLICATE, website);
  188 + }
  189 + if (!tenant.getId().equals(id)) {
  190 + throw exception(TENANT_WEBSITE_DUPLICATE, website);
  191 + }
  192 + }
  193 +
172 194 @Override
173 195 @DSTransactional
174 196 public void updateTenantRoleMenu(Long tenantId, Set<Long> menuIds) {
... ... @@ -235,6 +257,11 @@ public class TenantServiceImpl implements TenantService {
235 257 }
236 258  
237 259 @Override
  260 + public TenantDO getTenantByWebsite(String website) {
  261 + return tenantMapper.selectByWebsite(website);
  262 + }
  263 +
  264 + @Override
238 265 public Long getTenantCountByPackageId(Long packageId) {
239 266 return tenantMapper.selectCountByPackageId(packageId);
240 267 }
... ...
yudao-module-system/yudao-module-system-biz/src/test/java/cn/iocoder/yudao/module/system/service/tenant/TenantServiceImplTest.java
... ... @@ -157,7 +157,7 @@ public class TenantServiceImplTest extends BaseDbUnitTest {
157 157 o.setContactMobile("15601691300");
158 158 o.setPackageId(100L);
159 159 o.setStatus(randomCommonStatus());
160   - o.setDomain("https://www.iocoder.cn");
  160 + o.setWebsite("https://www.iocoder.cn");
161 161 o.setUsername("yunai");
162 162 o.setPassword("yuanma");
163 163 });
... ... @@ -185,7 +185,7 @@ public class TenantServiceImplTest extends BaseDbUnitTest {
185 185 TenantUpdateReqVO reqVO = randomPojo(TenantUpdateReqVO.class, o -> {
186 186 o.setId(dbTenant.getId()); // 设置更新的 ID
187 187 o.setStatus(randomCommonStatus());
188   - o.setDomain(randomString());
  188 + o.setWebsite(randomString());
189 189 });
190 190  
191 191 // mock 套餐
... ...
yudao-server/src/main/resources/application-local.yaml
... ... @@ -54,10 +54,13 @@ spring:
54 54 # url: jdbc:postgresql://127.0.0.1:5432/${spring.datasource.dynamic.datasource.master.name} # PostgreSQL 连接的示例
55 55 # url: jdbc:oracle:thin:@127.0.0.1:1521:xe # Oracle 连接的示例
56 56 # url: jdbc:sqlserver://127.0.0.1:1433;DatabaseName=${spring.datasource.dynamic.datasource.master.name} # SQLServer 连接的示例
  57 +# url: jdbc:dm://10.211.55.4:5236?schema=RUOYI_VUE_PRO # DM 连接的示例
57 58 username: root
58 59 password: 123456
59 60 # username: sa
60 61 # password: JSm:g(*%lU4ZAkz06cd52KqT3)i1?H7W
  62 +# username: SYSDBA # DM 连接的示例
  63 +# password: SYSDBA # DM 连接的示例
61 64 slave: # 模拟从库,可根据自己需要修改
62 65 name: ruoyi-vue-pro
63 66 lazy: true # 开启懒加载,保证启动速度
... ...
yudao-server/src/main/resources/application.yaml
... ... @@ -175,6 +175,7 @@ yudao:
175 175 enable: true
176 176 ignore-urls:
177 177 - /admin-api/system/tenant/get-id-by-name # 基于名字获取租户,不许带租户编号
  178 + - /admin-api/system/tenant/get-by-website # 基于域名获取租户,不许带租户编号
178 179 - /admin-api/system/captcha/get # 获取图片验证码,和租户无关
179 180 - /admin-api/system/captcha/check # 校验图片验证码,和租户无关
180 181 - /admin-api/infra/file/*/get/** # 获取图片,和租户无关
... ...