支持PostgreSQL数据库

This commit is contained in:
dataprince 2023-12-20 19:44:47 +08:00
parent f546a47c61
commit 9f28779390
32 changed files with 3742 additions and 2116 deletions

View File

@ -159,7 +159,7 @@ management:
--- # 监控中心客户端配置 --- # 监控中心客户端配置
spring.boot.admin.client: spring.boot.admin.client:
# 增加客户端开关 # 增加客户端开关
enabled: false enabled: true
url: http://localhost:9090/admin url: http://localhost:9090/admin
instance: instance:
service-host-type: IP service-host-type: IP
@ -170,7 +170,7 @@ spring.boot.admin.client:
powerjob: powerjob:
worker: worker:
# 如何开启调度中心请查看文档教程 # 如何开启调度中心请查看文档教程
enabled: false enabled: true
# 需要先在 powerjob 登录页执行应用注册后才能使用 # 需要先在 powerjob 登录页执行应用注册后才能使用
app-name: ruoyi-worker app-name: ruoyi-worker
# 28080 端口 随着主应用端口飘逸 避免集群冲突 # 28080 端口 随着主应用端口飘逸 避免集群冲突

View File

@ -32,14 +32,14 @@ public class GenConstants
public static final String PARENT_MENU_NAME = "parentMenuName"; public static final String PARENT_MENU_NAME = "parentMenuName";
/** 数据库字符串类型 */ /** 数据库字符串类型 */
public static final String[] COLUMNTYPE_STR = { "char", "varchar", "nvarchar", "varchar2" }; public static final String[] COLUMNTYPE_STR = { "char", "varchar", "nvarchar", "varchar2","character","character varying" };
/** 数据库文本类型 */ /** 数据库文本类型 */
public static final String[] COLUMNTYPE_TEXT = { "tinytext", "text", "mediumtext", "longtext", "binary", "varbinary", "blob", public static final String[] COLUMNTYPE_TEXT = { "tinytext", "text", "mediumtext", "longtext", "binary", "varbinary", "blob",
"ntext", "image", "bytea" }; "ntext", "image", "bytea" };
/** 数据库时间类型 */ /** 数据库时间类型 */
public static final String[] COLUMNTYPE_TIME = { "datetime", "time", "date", "timestamp", "year", "interval", public static final String[] COLUMNTYPE_TIME = { "datetime", "time", "date", "timestamp","timestamp without time zone","year", "interval",
"smalldatetime", "datetime2", "datetimeoffset" }; "smalldatetime", "datetime2", "datetimeoffset" };
/** 数据库数字类型 */ /** 数据库数字类型 */

View File

@ -0,0 +1,23 @@
package com.ruoyi.common.orm.helper;
import com.mybatisflex.core.FlexGlobalConfig;
import com.mybatisflex.core.dialect.DbType;
import lombok.AccessLevel;
import lombok.NoArgsConstructor;
/**
* 数据库助手判断数据库类型
*
* @author dataprince数据小王子
*/
@NoArgsConstructor(access = AccessLevel.PRIVATE)
public class DataBaseHelper {
public static boolean isMySql() {
return DbType.MYSQL == FlexGlobalConfig.getDefaultConfig().getDbType();
}
public static boolean isPostgreSql() {
return DbType.POSTGRE_SQL == FlexGlobalConfig.getDefaultConfig().getDbType();
}
}

View File

@ -1,9 +1,9 @@
package com.ruoyi.mf.controller; package com.ruoyi.mf.controller;
import java.util.List; import java.util.List;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
import jakarta.servlet.http.HttpServletResponse; import jakarta.servlet.http.HttpServletResponse;
import jakarta.validation.constraints.*;
import cn.dev33.satoken.annotation.SaCheckPermission; import cn.dev33.satoken.annotation.SaCheckPermission;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import org.springframework.validation.annotation.Validated; import org.springframework.validation.annotation.Validated;

View File

@ -1,9 +1,9 @@
package com.ruoyi.mf.controller; package com.ruoyi.mf.controller;
import java.util.List; import java.util.List;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
import jakarta.servlet.http.HttpServletResponse; import jakarta.servlet.http.HttpServletResponse;
import jakarta.validation.constraints.*;
import cn.dev33.satoken.annotation.SaCheckPermission; import cn.dev33.satoken.annotation.SaCheckPermission;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import org.springframework.validation.annotation.Validated; import org.springframework.validation.annotation.Validated;

View File

@ -102,9 +102,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</delete> </delete>
<insert id="batchDemoGoods"> <insert id="batchDemoGoods">
insert into demo_goods( goods_id, customer_id, name, weight, price, date, type) values insert into demo_goods( customer_id, name, weight, price, date, type) values
<foreach item="item" index="index" collection="list" separator=","> <foreach item="item" index="index" collection="list" separator=",">
( #{item.goodsId}, #{item.customerId}, #{item.name}, #{item.weight}, #{item.price}, #{item.date}, #{item.type}) ( #{item.customerId}, #{item.name}, #{item.weight}, #{item.price}, #{item.date}, #{item.type})
</foreach> </foreach>
</insert> </insert>
</mapper> </mapper>

View File

@ -7,6 +7,8 @@ import java.util.stream.Collectors;
import java.util.zip.ZipEntry; import java.util.zip.ZipEntry;
import java.util.zip.ZipOutputStream; import java.util.zip.ZipOutputStream;
import com.mybatisflex.core.FlexGlobalConfig;
import com.mybatisflex.core.dialect.DbType;
import com.mybatisflex.core.paginate.Page; import com.mybatisflex.core.paginate.Page;
import com.mybatisflex.core.query.QueryMethods; import com.mybatisflex.core.query.QueryMethods;
import com.mybatisflex.core.query.QueryWrapper; import com.mybatisflex.core.query.QueryWrapper;
@ -205,7 +207,6 @@ public class GenTableServiceImpl extends BaseServiceImpl<GenTableMapper, GenTabl
{ {
String tableName = table.getTableName(); String tableName = table.getTableName();
GenUtils.initTable(table); GenUtils.initTable(table);
//int row = genTableMapper.insertGenTable(table);
boolean saved = this.save(table); boolean saved = this.save(table);
if (saved) if (saved)
{ {

View File

@ -8,6 +8,7 @@ import java.util.Set;
import cn.hutool.core.collection.CollUtil; import cn.hutool.core.collection.CollUtil;
import com.mybatisflex.core.datasource.FlexDataSource; import com.mybatisflex.core.datasource.FlexDataSource;
import com.mybatisflex.core.dialect.DbTypeUtil; import com.mybatisflex.core.dialect.DbTypeUtil;
import com.ruoyi.common.orm.helper.DataBaseHelper;
import org.apache.velocity.VelocityContext; import org.apache.velocity.VelocityContext;
import com.alibaba.fastjson2.JSON; import com.alibaba.fastjson2.JSON;
import com.alibaba.fastjson2.JSONObject; import com.alibaba.fastjson2.JSONObject;
@ -145,8 +146,11 @@ public class VelocityUtils
templates.add("vm/java/serviceImpl.java.vm"); templates.add("vm/java/serviceImpl.java.vm");
templates.add("vm/java/controller.java.vm"); templates.add("vm/java/controller.java.vm");
templates.add("vm/xml/mapper.xml.vm"); templates.add("vm/xml/mapper.xml.vm");
if (DataBaseHelper.isPostgreSql()) {
templates.add("vm/sql/sql.vm"); templates.add("vm/sql/postgresql/sql.vm");
} else {
templates.add("vm/sql/mysql/sql.vm");
}
templates.add("vm/js/api.js.vm"); templates.add("vm/js/api.js.vm");
if (GenConstants.TPL_CRUD.equals(tplCategory)) if (GenConstants.TPL_CRUD.equals(tplCategory))
{ {
@ -199,7 +203,8 @@ public class VelocityUtils
case "vm/java/controller.java.vm" -> fileName = StringUtils.format("{}/controller/{}Controller.java", javaPath, className); case "vm/java/controller.java.vm" -> fileName = StringUtils.format("{}/controller/{}Controller.java", javaPath, className);
case "vm/xml/mapper.xml.vm" -> fileName = StringUtils.format("{}/{}Mapper.xml", mybatisPath, className); case "vm/xml/mapper.xml.vm" -> fileName = StringUtils.format("{}/{}Mapper.xml", mybatisPath, className);
case "vm/xml/sub-mapper.xml.vm" -> fileName = StringUtils.format("{}/{}Mapper.xml", mybatisPath, genTable.getSubTable().getClassName()); case "vm/xml/sub-mapper.xml.vm" -> fileName = StringUtils.format("{}/{}Mapper.xml", mybatisPath, genTable.getSubTable().getClassName());
case "vm/sql/sql.vm" -> fileName = businessName + "Menu.sql"; case "vm/sql/postgresql/sql.vm" -> fileName = businessName + "Menu(postgresql).sql";
case "vm/sql/mysql/sql.vm" -> fileName = businessName + "Menu(mysql).sql";
case "vm/js/api.js.vm" -> fileName = StringUtils.format("{}/api/{}/{}.js", vuePath, moduleName, businessName); case "vm/js/api.js.vm" -> fileName = StringUtils.format("{}/api/{}/{}.js", vuePath, moduleName, businessName);
case "vm/vue/index.vue.vm" -> fileName = StringUtils.format("{}/views/{}/{}/index.vue", vuePath, moduleName, businessName); case "vm/vue/index.vue.vm" -> fileName = StringUtils.format("{}/views/{}/{}/index.vue", vuePath, moduleName, businessName);
case "vm/vue/index-tree.vue.vm" -> fileName = StringUtils.format("{}/views/{}/{}/index.vue", vuePath, moduleName, businessName); case "vm/vue/index-tree.vue.vm" -> fileName = StringUtils.format("{}/views/{}/{}/index.vue", vuePath, moduleName, businessName);

View File

@ -34,9 +34,52 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</sql> </sql>
<select id="selectDbTableColumnsByName" parameterType="String" resultMap="GenTableColumnResult"> <select id="selectDbTableColumnsByName" parameterType="String" resultMap="GenTableColumnResult">
select column_name, (case when (is_nullable = 'no' <![CDATA[ && ]]> column_key != 'PRI') then '1' else '0' end) as is_required, (case when column_key = 'PRI' then '1' else '0' end) as is_pk, ordinal_position as sort, column_comment, (case when extra = 'auto_increment' then '1' else '0' end) as is_increment, column_type <if test="@com.ruoyi.common.orm.helper.DataBaseHelper@isMySql()">
from information_schema.columns where table_schema = (select database()) and table_name = (#{tableName}) select column_name,
order by ordinal_position (case when (is_nullable = 'no' <![CDATA[ && ]]> column_key != 'PRI') then '1' else '0' end) as is_required,
(case when column_key = 'PRI' then '1' else '0' end) as is_pk,
ordinal_position as sort,
column_comment,
(case when extra = 'auto_increment' then '1' else '0' end) as is_increment,
column_type
from information_schema.columns where table_schema = (select database()) and table_name = (#{tableName})
order by ordinal_position
</if>
<if test="@com.ruoyi.common.orm.helper.DataBaseHelper@isPostgreSql()">
SELECT column_name, is_required, is_pk, sort, column_comment, is_increment, column_type
FROM (
SELECT c.relname AS table_name,
a.attname AS column_name,
d.description AS column_comment,
CASE WHEN a.attnotnull AND con.conname IS NULL THEN 1 ELSE 0
END AS is_required,
CASE WHEN con.conname IS NOT NULL THEN 1 ELSE 0
END AS is_pk,
a.attnum AS sort,
CASE WHEN "position"(pg_get_expr(ad.adbin, ad.adrelid),
((c.relname::text || '_'::text) || a.attname::text) || '_seq'::text) > 0 THEN 1 ELSE 0
END AS is_increment,
btrim(
CASE WHEN t.typelem <![CDATA[ <> ]]> 0::oid AND t.typlen = '-1'::integer THEN 'ARRAY'::text ELSE
CASE WHEN t.typtype = 'd'::"char" THEN format_type(t.typbasetype, NULL::integer)
ELSE format_type(a.atttypid, NULL::integer) END
END, '"'::text
) AS column_type
FROM pg_attribute a
JOIN (pg_class c JOIN pg_namespace n ON c.relnamespace = n.oid) ON a.attrelid = c.oid
LEFT JOIN pg_description d ON d.objoid = c.oid AND a.attnum = d.objsubid
LEFT JOIN pg_constraint con ON con.conrelid = c.oid AND (a.attnum = ANY (con.conkey))
LEFT JOIN pg_attrdef ad ON a.attrelid = ad.adrelid AND a.attnum = ad.adnum
LEFT JOIN pg_type t ON a.atttypid = t.oid
WHERE (c.relkind = ANY (ARRAY ['r'::"char", 'p'::"char"]))
AND a.attnum > 0
AND n.nspname = 'public'::name
ORDER BY c.relname, a.attnum
) temp
WHERE table_name = (#{tableName})
AND column_type <![CDATA[ <> ]]> '-'
</if>
</select> </select>
<delete id="deleteGenTableColumnByIds" parameterType="Long"> <delete id="deleteGenTableColumnByIds" parameterType="Long">

View File

@ -58,32 +58,76 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</sql> </sql>
<select id="selectDbTableList" parameterType="GenTable" resultMap="GenTableResult"> <select id="selectDbTableList" parameterType="GenTable" resultMap="GenTableResult">
select table_name, table_comment, create_time, update_time from information_schema.tables <if test="@com.ruoyi.common.orm.helper.DataBaseHelper@isMySql()">
where table_schema = (select database()) select table_name, table_comment, create_time, update_time
AND table_name NOT LIKE 'pj_%' AND table_name NOT LIKE 'gen_%' from information_schema.tables
AND table_name NOT IN (select table_name from gen_table) where table_schema = (select database())
<if test="tableName != null and tableName != ''"> AND table_name NOT LIKE 'pj_%' AND table_name NOT LIKE 'gen_%'
AND lower(table_name) like lower(concat('%', #{tableName}, '%')) AND table_name NOT IN (select table_name from gen_table)
</if> <if test="tableName != null and tableName != ''">
<if test="tableComment != null and tableComment != ''"> AND lower(table_name) like lower(concat('%', #{tableName}, '%'))
AND lower(table_comment) like lower(concat('%', #{tableComment}, '%')) </if>
</if> <if test="tableComment != null and tableComment != ''">
<if test="params.beginTime != null and params.beginTime != ''"><!-- 开始时间检索 --> AND lower(table_comment) like lower(concat('%', #{tableComment}, '%'))
AND date_format(create_time,'%y%m%d') &gt;= date_format(#{params.beginTime},'%y%m%d') </if>
</if> order by create_time desc
<if test="params.endTime != null and params.endTime != ''"><!-- 结束时间检索 --> </if>
AND date_format(create_time,'%y%m%d') &lt;= date_format(#{params.endTime},'%y%m%d') <if test="@com.ruoyi.common.orm.helper.DataBaseHelper@isPostgreSql()">
</if> select table_name, table_comment, create_time, update_time
order by create_time desc from (
SELECT c.relname AS table_name,
obj_description(c.oid) AS table_comment,
CURRENT_TIMESTAMP AS create_time,
CURRENT_TIMESTAMP AS update_time
FROM pg_class c
LEFT JOIN pg_namespace n ON n.oid = c.relnamespace
WHERE (c.relkind = ANY (ARRAY ['r'::"char", 'p'::"char"]))
AND c.relname != 'spatial_%'::text
AND n.nspname = 'public'::name
AND n.nspname <![CDATA[ <> ]]> ''::name
) list_table
where table_name NOT LIKE 'pj_%' AND table_name NOT LIKE 'gen_%'
AND table_name NOT IN (select table_name from gen_table)
<if test="tableName != null and tableName != ''">
AND lower(table_name) like lower(concat('%', #{tableName}, '%'))
</if>
<if test="tableComment != null and tableComment != ''">
AND lower(table_comment) like lower(concat('%', #{tableComment}, '%'))
</if>
order by create_time desc
</if>
</select> </select>
<select id="selectDbTableListByNames" resultMap="GenTableResult"> <select id="selectDbTableListByNames" resultMap="GenTableResult">
select table_name, table_comment, create_time, update_time from information_schema.tables <if test="@com.ruoyi.common.orm.helper.DataBaseHelper@isMySql()">
where table_name NOT LIKE 'pj_%' and table_name NOT LIKE 'gen_%' and table_schema = (select database()) select table_name, table_comment, create_time, update_time from information_schema.tables
and table_name in where table_name NOT LIKE 'pj_%' and table_name NOT LIKE 'gen_%' and table_schema = (select database())
<foreach collection="array" item="name" open="(" separator="," close=")"> and table_name in
#{name} <foreach collection="array" item="name" open="(" separator="," close=")">
</foreach> #{name}
</foreach>
</if>
<if test="@com.ruoyi.common.orm.helper.DataBaseHelper@isPostgreSql()">
select table_name, table_comment, create_time, update_time
from (
SELECT c.relname AS table_name,
obj_description(c.oid) AS table_comment,
CURRENT_TIMESTAMP AS create_time,
CURRENT_TIMESTAMP AS update_time
FROM pg_class c
LEFT JOIN pg_namespace n ON n.oid = c.relnamespace
WHERE (c.relkind = ANY (ARRAY ['r'::"char", 'p'::"char"]))
AND c.relname != 'spatial_%'::text
AND n.nspname = 'public'::name
AND n.nspname <![CDATA[ <> ]]> ''::name
) list_table
where table_name NOT LIKE 'pj_%' and table_name NOT LIKE 'gen_%'
and table_name in
<foreach collection="array" item="name" open="(" separator="," close=")">
#{name}
</foreach>
</if>
</select> </select>
<select id="selectTableByName" parameterType="String" resultMap="GenTableResult"> <select id="selectTableByName" parameterType="String" resultMap="GenTableResult">

View File

@ -1,6 +1,6 @@
-- 菜单 SQL -- 菜单 SQL
insert into sys_menu (menu_id, menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark) insert into sys_menu (menu_id, menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark)
values(${table.menuIds[0]}, '${functionName}', '${parentMenuId}', '1', '${businessName}', '${moduleName}/${businessName}/index', 1, 0, 'C', '0', '0', '${permissionPrefix}:list', '#', 1, sysdate(), 1, null, '${functionName}菜单'); values(${table.menuIds[0]}, '${functionName}', ${parentMenuId}, '1', '${businessName}', '${moduleName}/${businessName}/index', 1, 0, 'C', '0', '0', '${permissionPrefix}:list', '#', 1, sysdate(), 1, null, '${functionName}菜单');
-- 按钮 SQL -- 按钮 SQL
insert into sys_menu (menu_id, menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark) insert into sys_menu (menu_id, menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark)

View File

@ -0,0 +1,19 @@
-- 菜单 SQL
insert into sys_menu (menu_id, menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark)
values(${table.menuIds[0]}, '${functionName}', ${parentMenuId}, '1', '${businessName}', '${moduleName}/${businessName}/index', 1, 0, 'C', '0', '0', '${permissionPrefix}:list', '#', 1, now(), 1, null, '${functionName}菜单');
-- 按钮 SQL
insert into sys_menu (menu_id, menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark)
values(${table.menuIds[1]}, '${functionName}查询', ${table.menuIds[0]}, '1', '#', '', 1, 0, 'F', '0', '0', '${permissionPrefix}:query', '#', 1, now(), 1, null, '');
insert into sys_menu (menu_id, menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark)
values(${table.menuIds[2]}, '${functionName}新增', ${table.menuIds[0]}, '2', '#', '', 1, 0, 'F', '0', '0', '${permissionPrefix}:add', '#', 1, now(), 1, null, '');
insert into sys_menu (menu_id, menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark)
values(${table.menuIds[3]}, '${functionName}修改', ${table.menuIds[0]}, '3', '#', '', 1, 0, 'F', '0', '0', '${permissionPrefix}:edit', '#', 1, now(), 1, null, '');
insert into sys_menu (menu_id, menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark)
values(${table.menuIds[4]}, '${functionName}删除', ${table.menuIds[0]}, '4', '#', '', 1, 0, 'F', '0', '0', '${permissionPrefix}:remove', '#', 1, now(), 1, null, '');
insert into sys_menu (menu_id, menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark)
values(${table.menuIds[5]}, '${functionName}导出', ${table.menuIds[0]}, '5', '#', '', 1, 0, 'F', '0', '0', '${permissionPrefix}:export', '#', 1, now(), 1, null, '');

View File

@ -10,8 +10,7 @@ import com.mybatisflex.spring.service.impl.ServiceImpl;
/** /**
* 系统授权表 服务层实现 * 系统授权表 服务层实现
* *
* @author mybatis-flex-helper automatic generation * @author dataprince数据小王子
* @since 1.0
*/ */
@Service @Service
public class SysClientServiceImpl extends ServiceImpl<SysClientMapper, SysClient> implements ISysClientService { public class SysClientServiceImpl extends ServiceImpl<SysClientMapper, SysClient> implements ISysClientService {

View File

@ -11,7 +11,6 @@ import com.ruoyi.system.domain.vo.SysRoleVo;
import com.ruoyi.system.mapper.SysRoleMapper; import com.ruoyi.system.mapper.SysRoleMapper;
import com.ruoyi.system.mapper.SysUserMapper; import com.ruoyi.system.mapper.SysUserMapper;
import com.ruoyi.system.service.ISysDataScopeService; import com.ruoyi.system.service.ISysDataScopeService;
import com.ruoyi.system.service.ISysRoleService;
import jakarta.annotation.Resource; import jakarta.annotation.Resource;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;

View File

@ -26,7 +26,6 @@ import lombok.RequiredArgsConstructor;
import org.springframework.cache.annotation.CacheEvict; import org.springframework.cache.annotation.CacheEvict;
import org.springframework.cache.annotation.Cacheable; import org.springframework.cache.annotation.Cacheable;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import com.ruoyi.common.core.annotation.DataScope;
import com.ruoyi.common.core.constant.UserConstants; import com.ruoyi.common.core.constant.UserConstants;
import com.ruoyi.common.core.core.text.Convert; import com.ruoyi.common.core.core.text.Convert;
import com.ruoyi.common.core.exception.ServiceException; import com.ruoyi.common.core.exception.ServiceException;
@ -44,6 +43,7 @@ import static com.ruoyi.system.domain.table.SysRoleDeptTableDef.SYS_ROLE_DEPT;
* 部门管理 服务实现 * 部门管理 服务实现
* *
* @author ruoyi * @author ruoyi
* @author dataprince数据小王子
*/ */
@RequiredArgsConstructor @RequiredArgsConstructor
@Service @Service

View File

@ -8,8 +8,6 @@ import com.mybatisflex.core.query.QueryMethods;
import com.mybatisflex.core.query.QueryWrapper; import com.mybatisflex.core.query.QueryWrapper;
import com.mybatisflex.core.update.UpdateChain; import com.mybatisflex.core.update.UpdateChain;
import com.ruoyi.common.core.constant.CacheNames; import com.ruoyi.common.core.constant.CacheNames;
import com.ruoyi.common.core.core.page.PageDomain;
import com.ruoyi.common.core.core.page.TableSupport;
import com.ruoyi.common.core.utils.MapstructUtils; import com.ruoyi.common.core.utils.MapstructUtils;
import com.ruoyi.common.core.utils.StringUtils; import com.ruoyi.common.core.utils.StringUtils;
import com.ruoyi.common.orm.core.page.PageQuery; import com.ruoyi.common.orm.core.page.PageQuery;
@ -34,6 +32,7 @@ import static com.ruoyi.system.domain.table.SysDictDataTableDef.SYS_DICT_DATA;
* 字典 业务层处理 * 字典 业务层处理
* *
* @author ruoyi * @author ruoyi
* @author dataprince数据小王子
*/ */
@RequiredArgsConstructor @RequiredArgsConstructor
@Service @Service

View File

@ -12,8 +12,6 @@ import com.mybatisflex.core.paginate.Page;
import com.mybatisflex.core.query.QueryWrapper; import com.mybatisflex.core.query.QueryWrapper;
import com.ruoyi.common.core.constant.CacheConstants; import com.ruoyi.common.core.constant.CacheConstants;
import com.ruoyi.common.core.constant.CacheNames; import com.ruoyi.common.core.constant.CacheNames;
import com.ruoyi.common.core.core.page.PageDomain;
import com.ruoyi.common.core.core.page.TableSupport;
import com.ruoyi.common.core.service.DictService; import com.ruoyi.common.core.service.DictService;
import com.ruoyi.common.core.utils.MapstructUtils; import com.ruoyi.common.core.utils.MapstructUtils;
import com.ruoyi.common.core.utils.SpringUtils; import com.ruoyi.common.core.utils.SpringUtils;
@ -44,6 +42,7 @@ import static com.ruoyi.system.domain.table.SysDictTypeTableDef.SYS_DICT_TYPE;
* 字典 业务层处理 * 字典 业务层处理
* *
* @author ruoyi * @author ruoyi
* @author dataprince数据小王子
*/ */
@Service @Service
public class SysDictTypeServiceImpl extends BaseServiceImpl<SysDictTypeMapper, SysDictType> implements ISysDictTypeService, DictService public class SysDictTypeServiceImpl extends BaseServiceImpl<SysDictTypeMapper, SysDictType> implements ISysDictTypeService, DictService

View File

@ -39,6 +39,7 @@ import static com.ruoyi.system.domain.table.SysLogininforTableDef.SYS_LOGININFOR
* 系统访问日志情况信息 服务层处理 * 系统访问日志情况信息 服务层处理
* *
* @author ruoyi * @author ruoyi
* @author dataprince数据小王子
*/ */
@RequiredArgsConstructor @RequiredArgsConstructor
@Slf4j @Slf4j

View File

@ -44,6 +44,7 @@ import static com.ruoyi.system.domain.table.SysUserTableDef.SYS_USER;
* 菜单 业务层处理 * 菜单 业务层处理
* *
* @author ruoyi * @author ruoyi
* @author dataprince数据小王子
*/ */
@Service @Service
public class SysMenuServiceImpl extends BaseServiceImpl<SysMenuMapper,SysMenu> implements ISysMenuService { public class SysMenuServiceImpl extends BaseServiceImpl<SysMenuMapper,SysMenu> implements ISysMenuService {

View File

@ -25,7 +25,8 @@ import static com.ruoyi.system.domain.table.SysNoticeTableDef.SYS_NOTICE;
/** /**
* 公告 服务层实现 * 公告 服务层实现
* *
* @author 数据小王子 * @author ruoyi
* @author dataprince数据小王子
*/ */
@Service @Service
public class SysNoticeServiceImpl extends BaseServiceImpl<SysNoticeMapper, SysNotice> implements ISysNoticeService { public class SysNoticeServiceImpl extends BaseServiceImpl<SysNoticeMapper, SysNotice> implements ISysNoticeService {

View File

@ -31,6 +31,7 @@ import static com.ruoyi.system.domain.table.SysOperLogTableDef.SYS_OPER_LOG;
* 操作日志 服务层处理 * 操作日志 服务层处理
* *
* @author ruoyi * @author ruoyi
* @author dataprince数据小王子
*/ */
@Service @Service
public class SysOperLogServiceImpl extends BaseServiceImpl<SysOperLogMapper, SysOperLog> implements ISysOperLogService public class SysOperLogServiceImpl extends BaseServiceImpl<SysOperLogMapper, SysOperLog> implements ISysOperLogService

View File

@ -15,6 +15,7 @@ import java.util.Set;
* 用户权限处理 * 用户权限处理
* *
* @author ruoyi * @author ruoyi
* @author dataprince数据小王子
*/ */
@RequiredArgsConstructor @RequiredArgsConstructor
@Service @Service

View File

@ -5,10 +5,7 @@ import java.util.List;
import com.mybatisflex.core.paginate.Page; import com.mybatisflex.core.paginate.Page;
import com.mybatisflex.core.query.QueryWrapper; import com.mybatisflex.core.query.QueryWrapper;
import com.ruoyi.common.core.core.page.PageDomain;
import com.ruoyi.common.core.core.page.TableSupport;
import com.ruoyi.common.core.utils.MapstructUtils; import com.ruoyi.common.core.utils.MapstructUtils;
import com.ruoyi.common.core.utils.sql.SqlUtil;
import com.ruoyi.common.orm.core.page.PageQuery; import com.ruoyi.common.orm.core.page.PageQuery;
import com.ruoyi.common.orm.core.page.TableDataInfo; import com.ruoyi.common.orm.core.page.TableDataInfo;
import com.ruoyi.common.orm.core.service.impl.BaseServiceImpl; import com.ruoyi.common.orm.core.service.impl.BaseServiceImpl;
@ -22,7 +19,6 @@ import com.ruoyi.common.core.exception.ServiceException;
import com.ruoyi.common.core.utils.StringUtils; import com.ruoyi.common.core.utils.StringUtils;
import com.ruoyi.system.domain.SysPost; import com.ruoyi.system.domain.SysPost;
import com.ruoyi.system.mapper.SysPostMapper; import com.ruoyi.system.mapper.SysPostMapper;
import com.ruoyi.system.mapper.SysUserPostMapper;
import com.ruoyi.system.service.ISysPostService; import com.ruoyi.system.service.ISysPostService;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
@ -34,6 +30,7 @@ import static com.ruoyi.system.domain.table.SysUserTableDef.SYS_USER;
* 岗位信息 服务层处理 * 岗位信息 服务层处理
* *
* @author ruoyi * @author ruoyi
* @author dataprince数据小王子
*/ */
@Service @Service
public class SysPostServiceImpl extends BaseServiceImpl<SysPostMapper, SysPost> implements ISysPostService public class SysPostServiceImpl extends BaseServiceImpl<SysPostMapper, SysPost> implements ISysPostService

View File

@ -16,6 +16,7 @@ import static com.ruoyi.system.domain.table.SysRoleMenuTableDef.SYS_ROLE_MENU;
/** /**
* SysRoleMenu服务实现类 * SysRoleMenu服务实现类
* *
* @author ruoyi
* @author dataprince数据小王子 * @author dataprince数据小王子
*/ */
@Service @Service

View File

@ -26,14 +26,12 @@ import com.ruoyi.system.service.*;
import jakarta.annotation.Resource; import jakarta.annotation.Resource;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import com.ruoyi.common.core.annotation.DataScope;
import com.ruoyi.common.core.constant.UserConstants; import com.ruoyi.common.core.constant.UserConstants;
import com.ruoyi.common.core.exception.ServiceException; import com.ruoyi.common.core.exception.ServiceException;
import com.ruoyi.common.core.utils.StringUtils; import com.ruoyi.common.core.utils.StringUtils;
import com.ruoyi.common.core.utils.SpringUtils; import com.ruoyi.common.core.utils.SpringUtils;
import static com.ruoyi.system.domain.table.SysDeptTableDef.SYS_DEPT; import static com.ruoyi.system.domain.table.SysDeptTableDef.SYS_DEPT;
import static com.ruoyi.system.domain.table.SysRoleMenuTableDef.SYS_ROLE_MENU;
import static com.ruoyi.system.domain.table.SysRoleTableDef.SYS_ROLE; import static com.ruoyi.system.domain.table.SysRoleTableDef.SYS_ROLE;
import static com.ruoyi.system.domain.table.SysUserRoleTableDef.SYS_USER_ROLE; import static com.ruoyi.system.domain.table.SysUserRoleTableDef.SYS_USER_ROLE;
import static com.ruoyi.system.domain.table.SysUserTableDef.SYS_USER; import static com.ruoyi.system.domain.table.SysUserTableDef.SYS_USER;
@ -42,6 +40,7 @@ import static com.ruoyi.system.domain.table.SysUserTableDef.SYS_USER;
* 角色 业务层处理 * 角色 业务层处理
* *
* @author ruoyi * @author ruoyi
* @author dataprince数据小王子
*/ */
@Service @Service
public class SysRoleServiceImpl extends BaseServiceImpl<SysRoleMapper, SysRole> implements ISysRoleService { public class SysRoleServiceImpl extends BaseServiceImpl<SysRoleMapper, SysRole> implements ISysRoleService {

View File

@ -16,6 +16,7 @@ import static com.ruoyi.system.domain.table.SysUserPostTableDef.SYS_USER_POST;
/** /**
* ruoyi-flex * ruoyi-flex
* *
* @author ruoyi
* @author dataprince数据小王子 * @author dataprince数据小王子
*/ */
@Service @Service

View File

@ -18,6 +18,7 @@ import static com.ruoyi.system.domain.table.SysUserRoleTableDef.SYS_USER_ROLE;
/** /**
* SysUserRoleService实现类 * SysUserRoleService实现类
* *
* @author ruoyi
* @author dataprince数据小王子 * @author dataprince数据小王子
*/ */
@Service @Service

View File

@ -50,6 +50,7 @@ import static com.ruoyi.system.domain.table.SysUserTableDef.SYS_USER;
* 用户 业务层处理 * 用户 业务层处理
* *
* @author ruoyi * @author ruoyi
* @author dataprince数据小王子
*/ */
@Service @Service
public class SysUserServiceImpl extends BaseServiceImpl<SysUserMapper, SysUser> implements ISysUserService, UserService { public class SysUserServiceImpl extends BaseServiceImpl<SysUserMapper, SysUser> implements ISysUserService, UserService {

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -1,3 +1,4 @@
--V4.1.8V4.2.0
-- sys_menu菜单表结构修改、去掉主键自增 -- sys_menu菜单表结构修改、去掉主键自增
ALTER TABLE `sys_menu` ALTER TABLE `sys_menu`
CHANGE COLUMN `menu_id` `menu_id` BIGINT(19) NOT NULL COMMENT '菜单ID' FIRST, CHANGE COLUMN `menu_id` `menu_id` BIGINT(19) NOT NULL COMMENT '菜单ID' FIRST,

File diff suppressed because it is too large Load Diff