mirror of
				https://github.com/dromara/RuoYi-Vue-Plus.git
				synced 2025-11-04 08:13:44 +08:00 
			
		
		
		
	
							
								
								
									
										46
									
								
								README.md
									
									
									
									
									
								
							
							
						
						
									
										46
									
								
								README.md
									
									
									
									
									
								
							@@ -1,26 +1,3 @@
 | 
			
		||||
## 重点注意事项
 | 
			
		||||
 | 
			
		||||
若依文档对事务注解的描述 [关于事务](https://doc.ruoyi.vip/ruoyi/document/htsc.html#%E4%BA%8B%E5%8A%A1%E7%AE%A1%E7%90%86)  以下对多数据源事务做补充:
 | 
			
		||||
* 同一个事务下是无法切换数据源的
 | 
			
		||||
* 禁止 父方法使用 @Transactional 创建事务 子方法使用 @DataSource 切换数据源
 | 
			
		||||
* 正确用法: 子方法单独创建事务 或 父方法使用 @Transactional(propagation = Propagation.REQUIRES_NEW) 为所有子方法创建新事务
 | 
			
		||||
 | 
			
		||||
关于如何使用Tomcat
 | 
			
		||||
* 查看ruoyi-framework模块的pom.xml文件,根据注释更改依赖
 | 
			
		||||
* 查看ruoyi-admin模块中的application.yml文件,根据注释更改配置
 | 
			
		||||
 | 
			
		||||
关于如何创建新模块
 | 
			
		||||
* 参考ruoyi-demo模块
 | 
			
		||||
* 需要改动: 父pom 与 admin模块pom
 | 
			
		||||
 | 
			
		||||
关于树表生成
 | 
			
		||||
* 直接在mysql表中 添加 parentId orderNum 等字段(根据需要参考 TreeEntity类)
 | 
			
		||||
* 代码生成选择树表生成即可
 | 
			
		||||
 | 
			
		||||
关于数据权限
 | 
			
		||||
* @DataScope 注解代码生成仅支持在 Controller list 方法使用
 | 
			
		||||
* 其余方法如要使用 需参考 list 方法实现在 LambdaQueryWrapper 注入数据权限生成的 SQL 语句
 | 
			
		||||
 | 
			
		||||
## 修改RuoYi功能
 | 
			
		||||
 | 
			
		||||
* ORM框架 使用 Mybatis-Plus 简化CRUD (目前支持单表生成与树表 不支持主子表)
 | 
			
		||||
@@ -30,6 +7,7 @@
 | 
			
		||||
* 代码生成模板 改为适配 Mybatis-Plus 的代码
 | 
			
		||||
* 代码生成模板 拆分出Vo,QueryBo,AddBo,EditBo等领域对象
 | 
			
		||||
* 项目修改为 maven多环境配置
 | 
			
		||||
* 项目配置修改为 application.yml 统一管理
 | 
			
		||||
* swagger 修改为 knife4j
 | 
			
		||||
* 集成 Hutool 5.X 并重写RuoYi部分功能
 | 
			
		||||
* 集成 Feign 接口化管理 Http 请求(如三方请求 支付,短信,推送等)
 | 
			
		||||
@@ -54,6 +32,28 @@
 | 
			
		||||
* 提供了单应用版本[RuoYi-Vue-fast](https://github.com/yangzongzhuan/RuoYi-Vue-fast),Oracle版本[RuoYi-Vue-Oracle](https://github.com/yangzongzhuan/RuoYi-Vue-Oracle),保持同步更新。
 | 
			
		||||
* 不分离版本,请移步[RuoYi](https://gitee.com/y_project/RuoYi),微服务版本,请移步[RuoYi-Cloud](https://gitee.com/y_project/RuoYi-Cloud)
 | 
			
		||||
 | 
			
		||||
## 重点注意事项
 | 
			
		||||
 | 
			
		||||
若依文档对事务注解的描述 [关于事务](https://doc.ruoyi.vip/ruoyi/document/htsc.html#%E4%BA%8B%E5%8A%A1%E7%AE%A1%E7%90%86)  以下对多数据源事务做补充:
 | 
			
		||||
* 同一个事务下是无法切换数据源的
 | 
			
		||||
* 禁止 父方法使用 @Transactional 创建事务 子方法使用 @DataSource 切换数据源
 | 
			
		||||
* 正确用法: 子方法单独创建事务 或 父方法使用 @Transactional(propagation = Propagation.REQUIRES_NEW) 为所有子方法创建新事务
 | 
			
		||||
 | 
			
		||||
关于如何使用Tomcat
 | 
			
		||||
* 查看ruoyi-framework模块的pom.xml文件,根据注释更改依赖
 | 
			
		||||
* 查看ruoyi-admin模块中的application.yml文件,根据注释更改配置
 | 
			
		||||
 | 
			
		||||
关于如何创建新模块
 | 
			
		||||
* 参考ruoyi-demo模块
 | 
			
		||||
* 需要改动: 父pom 与 admin模块pom
 | 
			
		||||
 | 
			
		||||
关于树表生成
 | 
			
		||||
* 直接在mysql表中 添加 parentId orderNum 等字段(根据需要参考 TreeEntity类)
 | 
			
		||||
* 代码生成选择树表生成即可
 | 
			
		||||
 | 
			
		||||
关于vue与boot整合部署  
 | 
			
		||||
* [前端静态资源如何整合到后端访问](https://doc.ruoyi.vip/ruoyi-vue/other/faq.html#前端静态资源如何整合到后端访问)
 | 
			
		||||
 | 
			
		||||
## 内置功能
 | 
			
		||||
 | 
			
		||||
1.  用户管理:用户是系统操作者,该功能主要完成系统用户配置。
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										2
									
								
								pom.xml
									
									
									
									
									
								
							
							
						
						
									
										2
									
								
								pom.xml
									
									
									
									
									
								
							@@ -13,7 +13,7 @@
 | 
			
		||||
    <description>RuoYi-Vue-Plus后台管理系统</description>
 | 
			
		||||
    
 | 
			
		||||
    <properties>
 | 
			
		||||
        <ruoyi-vue-plus.version>1.0.1</ruoyi-vue-plus.version>
 | 
			
		||||
        <ruoyi-vue-plus.version>1.0.2</ruoyi-vue-plus.version>
 | 
			
		||||
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
 | 
			
		||||
        <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
 | 
			
		||||
        <java.version>1.8</java.version>
 | 
			
		||||
 
 | 
			
		||||
@@ -79,6 +79,10 @@ spring:
 | 
			
		||||
    restart:
 | 
			
		||||
      # 热部署开关
 | 
			
		||||
      enabled: true
 | 
			
		||||
  # 与vue整合部署使用
 | 
			
		||||
  thymeleaf:
 | 
			
		||||
    # 将系统模板放置到最前面 否则会与 springboot-admin 页面冲突
 | 
			
		||||
    template-resolver-order: 1
 | 
			
		||||
  application:
 | 
			
		||||
    name: ruoyi-vue-plus
 | 
			
		||||
  boot:
 | 
			
		||||
 
 | 
			
		||||
@@ -1,15 +1,25 @@
 | 
			
		||||
package com.ruoyi.framework.config;
 | 
			
		||||
 | 
			
		||||
import de.codecentric.boot.admin.server.config.EnableAdminServer;
 | 
			
		||||
import org.springframework.beans.factory.ObjectProvider;
 | 
			
		||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
 | 
			
		||||
import org.springframework.boot.autoconfigure.task.TaskExecutionAutoConfiguration;
 | 
			
		||||
import org.springframework.boot.autoconfigure.thymeleaf.ThymeleafProperties;
 | 
			
		||||
import org.springframework.boot.task.TaskExecutorBuilder;
 | 
			
		||||
import org.springframework.context.annotation.Bean;
 | 
			
		||||
import org.springframework.context.annotation.Configuration;
 | 
			
		||||
import org.springframework.context.annotation.Lazy;
 | 
			
		||||
import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor;
 | 
			
		||||
import org.thymeleaf.dialect.IDialect;
 | 
			
		||||
import org.thymeleaf.spring5.ISpringTemplateEngine;
 | 
			
		||||
import org.thymeleaf.spring5.SpringTemplateEngine;
 | 
			
		||||
import org.thymeleaf.templateresolver.ITemplateResolver;
 | 
			
		||||
 | 
			
		||||
import java.util.Comparator;
 | 
			
		||||
import java.util.LinkedHashSet;
 | 
			
		||||
import java.util.Set;
 | 
			
		||||
import java.util.concurrent.Executor;
 | 
			
		||||
import java.util.stream.Collectors;
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * springboot-admin server配置类
 | 
			
		||||
@@ -26,4 +36,28 @@ public class AdminServerConfig {
 | 
			
		||||
    public ThreadPoolTaskExecutor applicationTaskExecutor(TaskExecutorBuilder builder) {
 | 
			
		||||
        return builder.build();
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 解决 admin 与 项目 页面的交叉引用 将 admin 的路由放到最后
 | 
			
		||||
     * @param properties
 | 
			
		||||
     * @param templateResolvers
 | 
			
		||||
     * @param dialects
 | 
			
		||||
     * @return
 | 
			
		||||
     */
 | 
			
		||||
    @Bean
 | 
			
		||||
    @ConditionalOnMissingBean(ISpringTemplateEngine.class)
 | 
			
		||||
    SpringTemplateEngine templateEngine(ThymeleafProperties properties,
 | 
			
		||||
                                        ObjectProvider<ITemplateResolver> templateResolvers, ObjectProvider<IDialect> dialects) {
 | 
			
		||||
        SpringTemplateEngine engine = new SpringTemplateEngine();
 | 
			
		||||
        engine.setEnableSpringELCompiler(properties.isEnableSpringElCompiler());
 | 
			
		||||
        engine.setRenderHiddenMarkersBeforeCheckboxes(properties.isRenderHiddenMarkersBeforeCheckboxes());
 | 
			
		||||
        templateResolvers.orderedStream().forEach(engine::addTemplateResolver);
 | 
			
		||||
        dialects.orderedStream().forEach(engine::addDialect);
 | 
			
		||||
        Set<ITemplateResolver> templateResolvers1 = engine.getTemplateResolvers();
 | 
			
		||||
        templateResolvers1 = templateResolvers1.stream()
 | 
			
		||||
                .sorted(Comparator.comparing(ITemplateResolver::getOrder))
 | 
			
		||||
                .collect(Collectors.toCollection(LinkedHashSet::new));
 | 
			
		||||
        engine.setTemplateResolvers(templateResolvers1);
 | 
			
		||||
        return engine;
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
@@ -1,6 +1,6 @@
 | 
			
		||||
{
 | 
			
		||||
  "name": "ruoyi-vue-plus",
 | 
			
		||||
  "version": "1.0.1",
 | 
			
		||||
  "version": "1.0.2",
 | 
			
		||||
  "description": "RuoYi-Vue-Plus后台管理系统",
 | 
			
		||||
  "author": "LionLi",
 | 
			
		||||
  "license": "MIT",
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user