浏览代码

采用枚举类型

RuoYi 6 年之前
父节点
当前提交
9631720a38
共有 37 个文件被更改,包括 275 次插入233 次删除
  1. 3 3
      sql/ry_20180818.sql
  2. 6 7
      src/main/java/com/ruoyi/framework/aspectj/DsAspect.java
  3. 6 6
      src/main/java/com/ruoyi/framework/aspectj/LogAspect.java
  4. 4 3
      src/main/java/com/ruoyi/framework/aspectj/lang/annotation/Ds.java
  5. 5 4
      src/main/java/com/ruoyi/framework/aspectj/lang/annotation/Log.java
  6. 0 19
      src/main/java/com/ruoyi/framework/aspectj/lang/constant/BusinessStatus.java
  7. 0 29
      src/main/java/com/ruoyi/framework/aspectj/lang/constant/BusinessType.java
  8. 0 16
      src/main/java/com/ruoyi/framework/aspectj/lang/constant/DataSourceName.java
  9. 0 22
      src/main/java/com/ruoyi/framework/aspectj/lang/constant/OperatorType.java
  10. 20 0
      src/main/java/com/ruoyi/framework/aspectj/lang/enums/BusinessStatus.java
  11. 55 0
      src/main/java/com/ruoyi/framework/aspectj/lang/enums/BusinessType.java
  12. 19 0
      src/main/java/com/ruoyi/framework/aspectj/lang/enums/DataSourceType.java
  13. 26 0
      src/main/java/com/ruoyi/framework/aspectj/lang/enums/OperatorType.java
  14. 4 4
      src/main/java/com/ruoyi/framework/config/DruidConfig.java
  15. 1 1
      src/main/java/com/ruoyi/framework/datasource/DynamicDataSource.java
  16. 13 9
      src/main/java/com/ruoyi/framework/datasource/DynamicDataSourceContextHolder.java
  17. 7 7
      src/main/java/com/ruoyi/project/monitor/job/controller/JobController.java
  18. 3 3
      src/main/java/com/ruoyi/project/monitor/job/controller/JobLogController.java
  19. 3 3
      src/main/java/com/ruoyi/project/monitor/logininfor/controller/LogininforController.java
  20. 3 3
      src/main/java/com/ruoyi/project/monitor/online/controller/UserOnlineController.java
  21. 2 2
      src/main/java/com/ruoyi/project/monitor/operlog/controller/OperlogController.java
  22. 21 21
      src/main/java/com/ruoyi/project/monitor/operlog/domain/OperLog.java
  23. 5 5
      src/main/java/com/ruoyi/project/system/config/controller/ConfigController.java
  24. 4 4
      src/main/java/com/ruoyi/project/system/dept/controller/DeptController.java
  25. 5 5
      src/main/java/com/ruoyi/project/system/dict/controller/DictDataController.java
  26. 5 5
      src/main/java/com/ruoyi/project/system/dict/controller/DictTypeController.java
  27. 4 4
      src/main/java/com/ruoyi/project/system/menu/controller/MenuController.java
  28. 4 4
      src/main/java/com/ruoyi/project/system/notice/controller/NoticeController.java
  29. 5 5
      src/main/java/com/ruoyi/project/system/post/controller/PostController.java
  30. 5 5
      src/main/java/com/ruoyi/project/system/role/controller/RoleController.java
  31. 4 4
      src/main/java/com/ruoyi/project/system/user/controller/ProfileController.java
  32. 7 7
      src/main/java/com/ruoyi/project/system/user/controller/UserController.java
  33. 3 3
      src/main/java/com/ruoyi/project/tool/gen/controller/GenController.java
  34. 10 7
      src/main/resources/application-druid.yml
  35. 8 8
      src/main/resources/mybatis/monitor/OperLogMapper.xml
  36. 3 3
      src/main/resources/templates/monitor/operlog/detail.html
  37. 2 2
      src/main/resources/templates/monitor/operlog/operlog.html

+ 3 - 3
sql/ry_20180808.sql → sql/ry_20180818.sql

@@ -374,16 +374,16 @@ drop table if exists sys_oper_log;
 create table sys_oper_log (
   oper_id 			int(11) 		not null auto_increment    comment '日志主键',
   title             varchar(50)     default ''                 comment '模块标题',
-  action            varchar(100)    default ''                 comment '功能请求',
+  business_type     int(2)          default 0                  comment '业务类型(0其它 1新增 2修改 3删除)',
   method            varchar(100)    default ''                 comment '方法名称',
-  channel           varchar(20)     default ''                 comment '来源渠道(manage后台用户 mobile手机端用户 other其它)',
+  operator_type     int(1)          default 0                  comment '操作类别(0其它 1后台用户 2手机端用户)',
   oper_name 	    varchar(50)     default '' 		 	 	   comment '操作人员',
   dept_name 		varchar(50)     default '' 		 	 	   comment '部门名称',
   oper_url 		    varchar(255) 	default '' 				   comment '请求URL',
   oper_ip 			varchar(30) 	default '' 				   comment '主机地址',
   oper_location     varchar(255)    default ''                 comment '操作地点',
   oper_param 		varchar(255) 	default '' 				   comment '请求参数',
-  status 			char(1) 		default '0'				   comment '操作状态(0正常 1异常)',
+  status 			int(1) 		    default 0				   comment '操作状态(0正常 1异常)',
   error_msg 		varchar(2000) 	default '' 				   comment '错误消息',
   oper_time 		datetime                                   comment '操作时间',
   primary key (oper_id)

+ 6 - 7
src/main/java/com/ruoyi/framework/aspectj/DsAspect.java

@@ -39,13 +39,11 @@ public class DsAspect
 
         Method method = signature.getMethod();
 
-        if (method.isAnnotationPresent(Ds.class))
+        Ds dataSource = method.getAnnotation(Ds.class);
+
+        if (StringUtils.isNotNull(dataSource))
         {
-            Ds dataSource = method.getAnnotation(Ds.class);
-            if (StringUtils.isNotNull(dataSource) && StringUtils.isNotEmpty(dataSource.name()))
-            {
-                DynamicDataSourceContextHolder.setDB(dataSource.name());
-            }
+            DynamicDataSourceContextHolder.setDateSoureType(dataSource.value().name());
         }
 
         try
@@ -54,7 +52,8 @@ public class DsAspect
         }
         finally
         {
-            DynamicDataSourceContextHolder.clearDB();
+            // 销毁数据源 在执行方法之后
+            DynamicDataSourceContextHolder.clearDateSoureType();
         }
     }
 }

+ 6 - 6
src/main/java/com/ruoyi/framework/aspectj/LogAspect.java

@@ -19,7 +19,7 @@ import com.ruoyi.common.utils.ServletUtils;
 import com.ruoyi.common.utils.StringUtils;
 import com.ruoyi.common.utils.security.ShiroUtils;
 import com.ruoyi.framework.aspectj.lang.annotation.Log;
-import com.ruoyi.framework.aspectj.lang.constant.BusinessStatus;
+import com.ruoyi.framework.aspectj.lang.enums.BusinessStatus;
 import com.ruoyi.framework.manager.AsyncManager;
 import com.ruoyi.framework.manager.factory.AsyncFactory;
 import com.ruoyi.project.monitor.operlog.domain.OperLog;
@@ -83,7 +83,7 @@ public class LogAspect
 
             // *========数据库日志=========*//
             OperLog operLog = new OperLog();
-            operLog.setStatus(BusinessStatus.SUCCESS);
+            operLog.setStatus(BusinessStatus.SUCCESS.ordinal());
             // 请求的地址
             String ip = ShiroUtils.getIp();
             operLog.setOperIp(ip);
@@ -101,7 +101,7 @@ public class LogAspect
 
             if (e != null)
             {
-                operLog.setStatus(BusinessStatus.FAIL);
+                operLog.setStatus(BusinessStatus.FAIL.ordinal());
                 operLog.setErrorMsg(StringUtils.substring(e.getMessage(), 0, 2000));
             }
             // 设置方法名称
@@ -132,11 +132,11 @@ public class LogAspect
     public void getControllerMethodDescription(Log log, OperLog operLog) throws Exception
     {
         // 设置action动作
-        operLog.setAction(log.action());
+        operLog.setBusinessType(log.businessType().ordinal());
         // 设置标题
         operLog.setTitle(log.title());
-        // 设置channel
-        operLog.setChannel(log.channel());
+        // 设置操作人类别
+        operLog.setOperatorType(log.operatorType().ordinal());
         // 是否需要保存request,参数和值
         if (log.isSaveRequestData())
         {

+ 4 - 3
src/main/java/com/ruoyi/framework/aspectj/lang/annotation/Ds.java

@@ -4,7 +4,8 @@ import java.lang.annotation.ElementType;
 import java.lang.annotation.Retention;
 import java.lang.annotation.RetentionPolicy;
 import java.lang.annotation.Target;
-import com.ruoyi.framework.aspectj.lang.constant.DataSourceName;
+
+import com.ruoyi.framework.aspectj.lang.enums.DataSourceType;
 
 /**
  * 自定义多数据源切换注解
@@ -16,7 +17,7 @@ import com.ruoyi.framework.aspectj.lang.constant.DataSourceName;
 public @interface Ds
 {
     /**
-     * 切换数据源
+     * 切换数据源名称
      */
-    String name() default DataSourceName.MASTER;
+    public DataSourceType value() default DataSourceType.MASTER;
 }

+ 5 - 4
src/main/java/com/ruoyi/framework/aspectj/lang/annotation/Log.java

@@ -5,7 +5,8 @@ import java.lang.annotation.ElementType;
 import java.lang.annotation.Retention;
 import java.lang.annotation.RetentionPolicy;
 import java.lang.annotation.Target;
-import com.ruoyi.framework.aspectj.lang.constant.OperatorType;
+import com.ruoyi.framework.aspectj.lang.enums.BusinessType;
+import com.ruoyi.framework.aspectj.lang.enums.OperatorType;
 
 /**
  * 自定义操作日志记录注解
@@ -22,10 +23,10 @@ public @interface Log
     String title() default "";
 
     /** 功能 */
-    String action() default "";
+    BusinessType businessType() default BusinessType.OTHER;
 
-    /** 渠道 */
-    String channel() default OperatorType.MANAGE;
+    /** 操作人类别 */
+    OperatorType operatorType() default OperatorType.MANAGE;
 
     /** 是否保存请求的参数 */
     boolean isSaveRequestData() default true;

+ 0 - 19
src/main/java/com/ruoyi/framework/aspectj/lang/constant/BusinessStatus.java

@@ -1,19 +0,0 @@
-package com.ruoyi.framework.aspectj.lang.constant;
-
-/**
- * 操作状态
- * 
- * @author ruoyi
- *
- */
-public class BusinessStatus
-{
-    /** 其它 */
-    public static final String OTHER = "-1";
-
-    /** 成功 */
-    public static final String SUCCESS = "0";
-
-    /** 失败 */
-    public static final String FAIL = "1";
-}

+ 0 - 29
src/main/java/com/ruoyi/framework/aspectj/lang/constant/BusinessType.java

@@ -1,29 +0,0 @@
-package com.ruoyi.framework.aspectj.lang.constant;
-
-/**
- * 业务操作类型
- * 
- * @author ruoyi
- *
- */
-public class BusinessType
-{
-    /** 其它 */
-    public static final String OTHER = "0";
-    /** 新增 */
-    public static final String INSERT = "1";
-    /** 修改 */
-    public static final String UPDATE = "2";
-    /** 删除 */
-    public static final String DELETE = "3";
-    /** 授权 */
-    public static final String GRANT = "4";
-    /** 导出 */
-    public static final String EXPORT = "5";
-    /** 导入 */
-    public static final String IMPORT = "6";
-    /** 强退 */
-    public static final String FORCE = "7";
-    /** 生成代码 */
-    public static final String GENCODE = "8";
-}

+ 0 - 16
src/main/java/com/ruoyi/framework/aspectj/lang/constant/DataSourceName.java

@@ -1,16 +0,0 @@
-package com.ruoyi.framework.aspectj.lang.constant;
-
-/**
- * 多数据源别名
- * 
- * @author ruoyi
- *
- */
-public class DataSourceName
-{
-    /** 主库 */
-    public static final String MASTER = "master";
-
-    /** 从库 */
-    public static final String SLAVE = "slave";
-}

+ 0 - 22
src/main/java/com/ruoyi/framework/aspectj/lang/constant/OperatorType.java

@@ -1,22 +0,0 @@
-package com.ruoyi.framework.aspectj.lang.constant;
-
-/**
- * 操作人类别
- * 
- * @author ruoyi
- *
- */
-public class OperatorType
-{
-    /** 其它 */
-    public static final String OTHER = "0";
-
-    /** 后台用户 */
-    public static final String MANAGE = "1";
-
-    /** 渠道用户 */
-    public static final String CHANNEL = "2";
-
-    /** 手机端用户 */
-    public static final String MOBILE = "3";
-}

+ 20 - 0
src/main/java/com/ruoyi/framework/aspectj/lang/enums/BusinessStatus.java

@@ -0,0 +1,20 @@
+package com.ruoyi.framework.aspectj.lang.enums;
+
+/**
+ * 操作状态
+ * 
+ * @author ruoyi
+ *
+ */
+public enum BusinessStatus
+{
+    /**
+     * 成功
+     */
+    SUCCESS,
+
+    /**
+     * 失败
+     */
+    FAIL,
+}

+ 55 - 0
src/main/java/com/ruoyi/framework/aspectj/lang/enums/BusinessType.java

@@ -0,0 +1,55 @@
+package com.ruoyi.framework.aspectj.lang.enums;
+
+/**
+ * 业务操作类型
+ * 
+ * @author ruoyi
+ *
+ */
+public enum BusinessType
+{
+    /**
+     * 其它
+     */
+    OTHER,
+
+    /**
+     * 新增
+     */
+    INSERT,
+
+    /**
+     * 修改
+     */
+    UPDATE,
+
+    /**
+     * 删除
+     */
+    DELETE,
+
+    /**
+     * 授权
+     */
+    GRANT,
+
+    /**
+     * 导出
+     */
+    EXPORT,
+
+    /**
+     * 导入
+     */
+    IMPORT,
+
+    /**
+     * 强退
+     */
+    FORCE,
+
+    /**
+     * 生成代码
+     */
+    GENCODE,
+}

+ 19 - 0
src/main/java/com/ruoyi/framework/aspectj/lang/enums/DataSourceType.java

@@ -0,0 +1,19 @@
+package com.ruoyi.framework.aspectj.lang.enums;
+
+/**
+ * 数据源
+ * 
+ * @author ruoyi
+ */
+public enum DataSourceType
+{
+    /**
+     * 主库
+     */
+    MASTER,
+
+    /**
+     * 从库
+     */
+    SLAVE
+}

+ 26 - 0
src/main/java/com/ruoyi/framework/aspectj/lang/enums/OperatorType.java

@@ -0,0 +1,26 @@
+package com.ruoyi.framework.aspectj.lang.enums;
+
+/**
+ * 操作人类别
+ * 
+ * @author ruoyi
+ *
+ */
+public enum OperatorType
+{
+    /**
+     * 其它
+     */
+    OTHER,
+
+    /**
+     * 后台用户
+     */
+
+    MANAGE,
+
+    /**
+     * 手机端用户
+     */
+    MOBILE
+}

+ 4 - 4
src/main/java/com/ruoyi/framework/config/DruidConfig.java

@@ -9,7 +9,7 @@ import org.springframework.context.annotation.Bean;
 import org.springframework.context.annotation.Configuration;
 import org.springframework.context.annotation.Primary;
 import com.alibaba.druid.spring.boot.autoconfigure.DruidDataSourceBuilder;
-import com.ruoyi.framework.aspectj.lang.constant.DataSourceName;
+import com.ruoyi.framework.aspectj.lang.enums.DataSourceType;
 import com.ruoyi.framework.datasource.DynamicDataSource;
 
 /**
@@ -29,7 +29,7 @@ public class DruidConfig
 
     @Bean
     @ConfigurationProperties("spring.datasource.druid.slave")
-    @ConditionalOnProperty(prefix = "spring.datasource.druid.slave", name = "open", havingValue = "true")
+    @ConditionalOnProperty(prefix = "spring.datasource.druid.slave", name = "enabled", havingValue = "true")
     public DataSource slaveDataSource()
     {
         return DruidDataSourceBuilder.create().build();
@@ -40,8 +40,8 @@ public class DruidConfig
     public DynamicDataSource dataSource(DataSource masterDataSource, DataSource slaveDataSource)
     {
         Map<Object, Object> targetDataSources = new HashMap<>();
-        targetDataSources.put(DataSourceName.MASTER, masterDataSource);
-        targetDataSources.put(DataSourceName.SLAVE, slaveDataSource);
+        targetDataSources.put(DataSourceType.MASTER.name(), masterDataSource);
+        targetDataSources.put(DataSourceType.SLAVE.name(), slaveDataSource);
         return new DynamicDataSource(masterDataSource, targetDataSources);
     }
 }

+ 1 - 1
src/main/java/com/ruoyi/framework/datasource/DynamicDataSource.java

@@ -21,7 +21,7 @@ public class DynamicDataSource extends AbstractRoutingDataSource
     @Override
     protected Object determineCurrentLookupKey()
     {
-        return DynamicDataSourceContextHolder.getDB();
+        return DynamicDataSourceContextHolder.getDateSoureType();
     }
 
 }

+ 13 - 9
src/main/java/com/ruoyi/framework/datasource/DynamicDataSourceContextHolder.java

@@ -4,7 +4,7 @@ import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
 /**
- * 当前线程数据源
+ * 数据源切换处理
  * 
  * @author ruoyi
  */
@@ -12,29 +12,33 @@ public class DynamicDataSourceContextHolder
 {
     public static final Logger log = LoggerFactory.getLogger(DynamicDataSourceContextHolder.class);
 
+    /**
+     * 使用ThreadLocal维护变量,ThreadLocal为每个使用该变量的线程提供独立的变量副本,
+     *  所以每一个线程都可以独立地改变自己的副本,而不会影响其它线程所对应的副本。
+     */
     private static final ThreadLocal<String> CONTEXT_HOLDER = new ThreadLocal<>();
 
     /**
-     * 设置数据源名
+     * 设置数据源的变量
      */
-    public static void setDB(String dbType)
+    public static void setDateSoureType(String dsType)
     {
-        log.info("切换到{}数据源", dbType);
-        CONTEXT_HOLDER.set(dbType);
+        log.info("切换到{}数据源", dsType);
+        CONTEXT_HOLDER.set(dsType);
     }
 
     /**
-     * 获取数据源名
+     * 获得数据源的变量
      */
-    public static String getDB()
+    public static String getDateSoureType()
     {
         return CONTEXT_HOLDER.get();
     }
 
     /**
-     * 清理数据源名
+     * 清空数据源变量
      */
-    public static void clearDB()
+    public static void clearDateSoureType()
     {
         CONTEXT_HOLDER.remove();
     }

+ 7 - 7
src/main/java/com/ruoyi/project/monitor/job/controller/JobController.java

@@ -12,7 +12,7 @@ import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.ResponseBody;
 import com.ruoyi.common.utils.poi.ExcelUtil;
 import com.ruoyi.framework.aspectj.lang.annotation.Log;
-import com.ruoyi.framework.aspectj.lang.constant.BusinessType;
+import com.ruoyi.framework.aspectj.lang.enums.BusinessType;
 import com.ruoyi.framework.web.controller.BaseController;
 import com.ruoyi.framework.web.domain.AjaxResult;
 import com.ruoyi.framework.web.page.TableDataInfo;
@@ -50,7 +50,7 @@ public class JobController extends BaseController
         return getDataTable(list);
     }
 
-    @Log(title = "定时任务", action = BusinessType.EXPORT)
+    @Log(title = "定时任务", businessType = BusinessType.EXPORT)
     @RequiresPermissions("monitor:job:export")
     @PostMapping("/export")
     @ResponseBody
@@ -68,7 +68,7 @@ public class JobController extends BaseController
         }
     }
 
-    @Log(title = "定时任务", action = BusinessType.DELETE)
+    @Log(title = "定时任务", businessType = BusinessType.DELETE)
     @RequiresPermissions("monitor:job:remove")
     @PostMapping("/remove")
     @ResponseBody
@@ -89,7 +89,7 @@ public class JobController extends BaseController
     /**
      * 任务调度状态修改
      */
-    @Log(title = "定时任务", action = BusinessType.UPDATE)
+    @Log(title = "定时任务", businessType = BusinessType.UPDATE)
     @RequiresPermissions("monitor:job:changeStatus")
     @PostMapping("/changeStatus")
     @ResponseBody
@@ -101,7 +101,7 @@ public class JobController extends BaseController
     /**
      * 任务调度立即执行一次
      */
-    @Log(title = "定时任务", action = BusinessType.UPDATE)
+    @Log(title = "定时任务", businessType = BusinessType.UPDATE)
     @RequiresPermissions("monitor:job:changeStatus")
     @PostMapping("/run")
     @ResponseBody
@@ -122,7 +122,7 @@ public class JobController extends BaseController
     /**
      * 新增保存调度
      */
-    @Log(title = "定时任务", action = BusinessType.INSERT)
+    @Log(title = "定时任务", businessType = BusinessType.INSERT)
     @RequiresPermissions("monitor:job:add")
     @PostMapping("/add")
     @ResponseBody
@@ -144,7 +144,7 @@ public class JobController extends BaseController
     /**
      * 修改保存调度
      */
-    @Log(title = "定时任务", action = BusinessType.UPDATE)
+    @Log(title = "定时任务", businessType = BusinessType.UPDATE)
     @RequiresPermissions("monitor:job:edit")
     @PostMapping("/edit")
     @ResponseBody

+ 3 - 3
src/main/java/com/ruoyi/project/monitor/job/controller/JobLogController.java

@@ -10,7 +10,7 @@ import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.ResponseBody;
 import com.ruoyi.common.utils.poi.ExcelUtil;
 import com.ruoyi.framework.aspectj.lang.annotation.Log;
-import com.ruoyi.framework.aspectj.lang.constant.BusinessType;
+import com.ruoyi.framework.aspectj.lang.enums.BusinessType;
 import com.ruoyi.framework.web.controller.BaseController;
 import com.ruoyi.framework.web.domain.AjaxResult;
 import com.ruoyi.framework.web.page.TableDataInfo;
@@ -48,7 +48,7 @@ public class JobLogController extends BaseController
         return getDataTable(list);
     }
 
-    @Log(title = "调度日志", action = BusinessType.EXPORT)
+    @Log(title = "调度日志", businessType = BusinessType.EXPORT)
     @RequiresPermissions("monitor:job:export")
     @PostMapping("/export")
     @ResponseBody
@@ -66,7 +66,7 @@ public class JobLogController extends BaseController
         }
     }
 
-    @Log(title = "调度日志", action = BusinessType.DELETE)
+    @Log(title = "调度日志", businessType = BusinessType.DELETE)
     @RequiresPermissions("monitor:job:remove")
     @PostMapping("/remove")
     @ResponseBody

+ 3 - 3
src/main/java/com/ruoyi/project/monitor/logininfor/controller/LogininforController.java

@@ -10,7 +10,7 @@ import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.ResponseBody;
 import com.ruoyi.common.utils.poi.ExcelUtil;
 import com.ruoyi.framework.aspectj.lang.annotation.Log;
-import com.ruoyi.framework.aspectj.lang.constant.BusinessType;
+import com.ruoyi.framework.aspectj.lang.enums.BusinessType;
 import com.ruoyi.framework.web.controller.BaseController;
 import com.ruoyi.framework.web.domain.AjaxResult;
 import com.ruoyi.framework.web.page.TableDataInfo;
@@ -48,7 +48,7 @@ public class LogininforController extends BaseController
         return getDataTable(list);
     }
 
-    @Log(title = "登陆日志", action = BusinessType.EXPORT)
+    @Log(title = "登陆日志", businessType = BusinessType.EXPORT)
     @RequiresPermissions("monitor:logininfor:export")
     @PostMapping("/export")
     @ResponseBody
@@ -67,7 +67,7 @@ public class LogininforController extends BaseController
     }
 
     @RequiresPermissions("monitor:logininfor:remove")
-    @Log(title = "登陆日志", action = BusinessType.DELETE)
+    @Log(title = "登陆日志", businessType = BusinessType.DELETE)
     @PostMapping("/remove")
     @ResponseBody
     public AjaxResult remove(String ids)

+ 3 - 3
src/main/java/com/ruoyi/project/monitor/online/controller/UserOnlineController.java

@@ -11,7 +11,7 @@ import org.springframework.web.bind.annotation.RequestParam;
 import org.springframework.web.bind.annotation.ResponseBody;
 import com.ruoyi.common.utils.security.ShiroUtils;
 import com.ruoyi.framework.aspectj.lang.annotation.Log;
-import com.ruoyi.framework.aspectj.lang.constant.BusinessType;
+import com.ruoyi.framework.aspectj.lang.enums.BusinessType;
 import com.ruoyi.framework.shiro.session.OnlineSessionDAO;
 import com.ruoyi.framework.web.controller.BaseController;
 import com.ruoyi.framework.web.domain.AjaxResult;
@@ -55,7 +55,7 @@ public class UserOnlineController extends BaseController
     }
 
     @RequiresPermissions("monitor:online:batchForceLogout")
-    @Log(title = "在线用户", action = BusinessType.FORCE)
+    @Log(title = "在线用户", businessType = BusinessType.FORCE)
     @PostMapping("/batchForceLogout")
     @ResponseBody
     public AjaxResult batchForceLogout(@RequestParam("ids[]") String[] ids)
@@ -84,7 +84,7 @@ public class UserOnlineController extends BaseController
     }
 
     @RequiresPermissions("monitor:online:forceLogout")
-    @Log(title = "在线用户", action = BusinessType.FORCE)
+    @Log(title = "在线用户", businessType = BusinessType.FORCE)
     @PostMapping("/forceLogout")
     @ResponseBody
     public AjaxResult forceLogout(String sessionId)

+ 2 - 2
src/main/java/com/ruoyi/project/monitor/operlog/controller/OperlogController.java

@@ -12,7 +12,7 @@ import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.ResponseBody;
 import com.ruoyi.common.utils.poi.ExcelUtil;
 import com.ruoyi.framework.aspectj.lang.annotation.Log;
-import com.ruoyi.framework.aspectj.lang.constant.BusinessType;
+import com.ruoyi.framework.aspectj.lang.enums.BusinessType;
 import com.ruoyi.framework.web.controller.BaseController;
 import com.ruoyi.framework.web.domain.AjaxResult;
 import com.ruoyi.framework.web.page.TableDataInfo;
@@ -50,7 +50,7 @@ public class OperlogController extends BaseController
         return getDataTable(list);
     }
 
-    @Log(title = "操作日志", action = BusinessType.EXPORT)
+    @Log(title = "操作日志", businessType = BusinessType.EXPORT)
     @RequiresPermissions("monitor:operlog:export")
     @PostMapping("/export")
     @ResponseBody

+ 21 - 21
src/main/java/com/ruoyi/project/monitor/operlog/domain/OperLog.java

@@ -21,17 +21,17 @@ public class OperLog extends BaseEntity
     @Excel(name = "操作模块")
     private String title;
 
-    /** 操作类型 */
-    @Excel(name = "操作类型")
-    private String action;
+    /** 操作业务类型 */
+    @Excel(name = "业务类型")
+    private Integer businessType;
 
     /** 请求方法 */
     @Excel(name = "请求方法")
     private String method;
 
-    /** 来源渠道 */
-    @Excel(name = "来源渠道")
-    private String channel;
+    /** 操作人类别 */
+    @Excel(name = "操作类别")
+    private Integer operatorType;
 
     /** 操作人员 */
     @Excel(name = "操作人员")
@@ -59,7 +59,7 @@ public class OperLog extends BaseEntity
 
     /** 状态0正常 1异常 */
     @Excel(name = "状态")
-    private String status;
+    private Integer status;
 
     /** 错误消息 */
     @Excel(name = "错误消息")
@@ -89,14 +89,14 @@ public class OperLog extends BaseEntity
         this.title = title;
     }
 
-    public String getAction()
+    public Integer getBusinessType()
     {
-        return action;
+        return businessType;
     }
 
-    public void setAction(String action)
+    public void setBusinessType(Integer businessType)
     {
-        this.action = action;
+        this.businessType = businessType;
     }
 
     public String getMethod()
@@ -109,14 +109,14 @@ public class OperLog extends BaseEntity
         this.method = method;
     }
 
-    public String getChannel()
+    public Integer getOperatorType()
     {
-        return channel;
+        return operatorType;
     }
 
-    public void setChannel(String channel)
+    public void setOperatorType(Integer operatorType)
     {
-        this.channel = channel;
+        this.operatorType = operatorType;
     }
 
     public String getOperName()
@@ -179,12 +179,12 @@ public class OperLog extends BaseEntity
         this.operParam = operParam;
     }
 
-    public String getStatus()
+    public Integer getStatus()
     {
         return status;
     }
 
-    public void setStatus(String status)
+    public void setStatus(Integer status)
     {
         this.status = status;
     }
@@ -212,10 +212,10 @@ public class OperLog extends BaseEntity
     @Override
     public String toString()
     {
-        return "OperLog [operId=" + operId + ", title=" + title + ", action=" + action + ", method=" + method
-                + ", channel=" + channel + ", operName=" + operName + ", deptName=" + deptName + ", operUrl=" + operUrl
-                + ", operIp=" + operIp + ", operLocation=" + operLocation + ", operParam=" + operParam + ", status="
-                + status + ", errorMsg=" + errorMsg + ", operTime=" + operTime + "]";
+        return "OperLog [operId=" + operId + ", title=" + title + ", businessType=" + businessType + ", method="
+                + method + ", operatorType=" + operatorType + ", operName=" + operName + ", deptName=" + deptName
+                + ", operUrl=" + operUrl + ", operIp=" + operIp + ", operLocation=" + operLocation + ", operParam="
+                + operParam + ", status=" + status + ", errorMsg=" + errorMsg + ", operTime=" + operTime + "]";
     }
 
 }

+ 5 - 5
src/main/java/com/ruoyi/project/system/config/controller/ConfigController.java

@@ -13,7 +13,7 @@ import org.springframework.web.bind.annotation.ResponseBody;
 import com.ruoyi.common.utils.StringUtils;
 import com.ruoyi.common.utils.poi.ExcelUtil;
 import com.ruoyi.framework.aspectj.lang.annotation.Log;
-import com.ruoyi.framework.aspectj.lang.constant.BusinessType;
+import com.ruoyi.framework.aspectj.lang.enums.BusinessType;
 import com.ruoyi.framework.web.controller.BaseController;
 import com.ruoyi.framework.web.domain.AjaxResult;
 import com.ruoyi.framework.web.page.TableDataInfo;
@@ -54,7 +54,7 @@ public class ConfigController extends BaseController
         return getDataTable(list);
     }
 
-    @Log(title = "参数管理", action = BusinessType.EXPORT)
+    @Log(title = "参数管理", businessType = BusinessType.EXPORT)
     @RequiresPermissions("system:config:export")
     @PostMapping("/export")
     @ResponseBody
@@ -85,7 +85,7 @@ public class ConfigController extends BaseController
      * 新增保存参数配置
      */
     @RequiresPermissions("system:config:add")
-    @Log(title = "参数管理", action = BusinessType.INSERT)
+    @Log(title = "参数管理", businessType = BusinessType.INSERT)
     @PostMapping("/add")
     @ResponseBody
     public AjaxResult addSave(Config config)
@@ -107,7 +107,7 @@ public class ConfigController extends BaseController
      * 修改保存参数配置
      */
     @RequiresPermissions("system:config:edit")
-    @Log(title = "参数管理", action = BusinessType.UPDATE)
+    @Log(title = "参数管理", businessType = BusinessType.UPDATE)
     @PostMapping("/edit")
     @ResponseBody
     public AjaxResult editSave(Config config)
@@ -119,7 +119,7 @@ public class ConfigController extends BaseController
      * 删除参数配置
      */
     @RequiresPermissions("system:config:remove")
-    @Log(title = "参数管理", action = BusinessType.DELETE)
+    @Log(title = "参数管理", businessType = BusinessType.DELETE)
     @PostMapping("/remove")
     @ResponseBody
     public AjaxResult remove(String ids)

+ 4 - 4
src/main/java/com/ruoyi/project/system/dept/controller/DeptController.java

@@ -13,7 +13,7 @@ import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.ResponseBody;
 import com.ruoyi.common.utils.StringUtils;
 import com.ruoyi.framework.aspectj.lang.annotation.Log;
-import com.ruoyi.framework.aspectj.lang.constant.BusinessType;
+import com.ruoyi.framework.aspectj.lang.enums.BusinessType;
 import com.ruoyi.framework.web.controller.BaseController;
 import com.ruoyi.framework.web.domain.AjaxResult;
 import com.ruoyi.project.system.dept.domain.Dept;
@@ -62,7 +62,7 @@ public class DeptController extends BaseController
     /**
      * 新增保存部门
      */
-    @Log(title = "部门管理", action = BusinessType.INSERT)
+    @Log(title = "部门管理", businessType = BusinessType.INSERT)
     @RequiresPermissions("system:dept:add")
     @PostMapping("/add")
     @ResponseBody
@@ -84,7 +84,7 @@ public class DeptController extends BaseController
     /**
      * 保存
      */
-    @Log(title = "部门管理", action = BusinessType.UPDATE)
+    @Log(title = "部门管理", businessType = BusinessType.UPDATE)
     @RequiresPermissions("system:dept:edit")
     @PostMapping("/edit")
     @ResponseBody
@@ -96,7 +96,7 @@ public class DeptController extends BaseController
     /**
      * 删除
      */
-    @Log(title = "部门管理", action = BusinessType.DELETE)
+    @Log(title = "部门管理", businessType = BusinessType.DELETE)
     @RequiresPermissions("system:dept:remove")
     @PostMapping("/remove/{deptId}")
     @ResponseBody

+ 5 - 5
src/main/java/com/ruoyi/project/system/dict/controller/DictDataController.java

@@ -12,7 +12,7 @@ import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.ResponseBody;
 import com.ruoyi.common.utils.poi.ExcelUtil;
 import com.ruoyi.framework.aspectj.lang.annotation.Log;
-import com.ruoyi.framework.aspectj.lang.constant.BusinessType;
+import com.ruoyi.framework.aspectj.lang.enums.BusinessType;
 import com.ruoyi.framework.web.controller.BaseController;
 import com.ruoyi.framework.web.domain.AjaxResult;
 import com.ruoyi.framework.web.page.TableDataInfo;
@@ -50,7 +50,7 @@ public class DictDataController extends BaseController
         return getDataTable(list);
     }
 
-    @Log(title = "字典数据", action = BusinessType.EXPORT)
+    @Log(title = "字典数据", businessType = BusinessType.EXPORT)
     @RequiresPermissions("system:dict:export")
     @PostMapping("/export")
     @ResponseBody
@@ -81,7 +81,7 @@ public class DictDataController extends BaseController
     /**
      * 新增保存字典类型
      */
-    @Log(title = "字典数据", action = BusinessType.INSERT)
+    @Log(title = "字典数据", businessType = BusinessType.INSERT)
     @RequiresPermissions("system:dict:add")
     @PostMapping("/add")
     @ResponseBody
@@ -103,7 +103,7 @@ public class DictDataController extends BaseController
     /**
      * 修改保存字典类型
      */
-    @Log(title = "字典数据", action = BusinessType.UPDATE)
+    @Log(title = "字典数据", businessType = BusinessType.UPDATE)
     @RequiresPermissions("system:dict:edit")
     @PostMapping("/edit")
     @ResponseBody
@@ -112,7 +112,7 @@ public class DictDataController extends BaseController
         return toAjax(dictDataService.updateDictData(dict));
     }
 
-    @Log(title = "字典数据", action = BusinessType.DELETE)
+    @Log(title = "字典数据", businessType = BusinessType.DELETE)
     @RequiresPermissions("system:dict:remove")
     @PostMapping("/remove")
     @ResponseBody

+ 5 - 5
src/main/java/com/ruoyi/project/system/dict/controller/DictTypeController.java

@@ -13,7 +13,7 @@ import org.springframework.web.bind.annotation.ResponseBody;
 import com.ruoyi.common.utils.StringUtils;
 import com.ruoyi.common.utils.poi.ExcelUtil;
 import com.ruoyi.framework.aspectj.lang.annotation.Log;
-import com.ruoyi.framework.aspectj.lang.constant.BusinessType;
+import com.ruoyi.framework.aspectj.lang.enums.BusinessType;
 import com.ruoyi.framework.web.controller.BaseController;
 import com.ruoyi.framework.web.domain.AjaxResult;
 import com.ruoyi.framework.web.page.TableDataInfo;
@@ -51,7 +51,7 @@ public class DictTypeController extends BaseController
         return getDataTable(list);
     }
 
-    @Log(title = "字典类型", action = BusinessType.EXPORT)
+    @Log(title = "字典类型", businessType = BusinessType.EXPORT)
     @RequiresPermissions("system:dict:export")
     @PostMapping("/export")
     @ResponseBody
@@ -81,7 +81,7 @@ public class DictTypeController extends BaseController
     /**
      * 新增保存字典类型
      */
-    @Log(title = "字典类型", action = BusinessType.INSERT)
+    @Log(title = "字典类型", businessType = BusinessType.INSERT)
     @RequiresPermissions("system:dict:add")
     @PostMapping("/add")
     @ResponseBody
@@ -103,7 +103,7 @@ public class DictTypeController extends BaseController
     /**
      * 修改保存字典类型
      */
-    @Log(title = "字典类型", action = BusinessType.UPDATE)
+    @Log(title = "字典类型", businessType = BusinessType.UPDATE)
     @RequiresPermissions("system:dict:edit")
     @PostMapping("/edit")
     @ResponseBody
@@ -112,7 +112,7 @@ public class DictTypeController extends BaseController
         return toAjax(dictTypeService.updateDictType(dict));
     }
 
-    @Log(title = "字典类型", action = BusinessType.DELETE)
+    @Log(title = "字典类型", businessType = BusinessType.DELETE)
     @RequiresPermissions("system:dict:remove")
     @PostMapping("/remove")
     @ResponseBody

+ 4 - 4
src/main/java/com/ruoyi/project/system/menu/controller/MenuController.java

@@ -13,7 +13,7 @@ import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.ResponseBody;
 import com.ruoyi.common.utils.StringUtils;
 import com.ruoyi.framework.aspectj.lang.annotation.Log;
-import com.ruoyi.framework.aspectj.lang.constant.BusinessType;
+import com.ruoyi.framework.aspectj.lang.enums.BusinessType;
 import com.ruoyi.framework.web.controller.BaseController;
 import com.ruoyi.framework.web.domain.AjaxResult;
 import com.ruoyi.project.system.menu.domain.Menu;
@@ -54,7 +54,7 @@ public class MenuController extends BaseController
     /**
      * 删除菜单
      */
-    @Log(title = "菜单管理", action = BusinessType.DELETE)
+    @Log(title = "菜单管理", businessType = BusinessType.DELETE)
     @RequiresPermissions("system:menu:remove")
     @PostMapping("/remove/{menuId}")
     @ResponseBody
@@ -95,7 +95,7 @@ public class MenuController extends BaseController
     /**
      * 新增保存菜单
      */
-    @Log(title = "菜单管理", action = BusinessType.INSERT)
+    @Log(title = "菜单管理", businessType = BusinessType.INSERT)
     @RequiresPermissions("system:menu:add")
     @PostMapping("/add")
     @ResponseBody
@@ -117,7 +117,7 @@ public class MenuController extends BaseController
     /**
      * 修改保存菜单
      */
-    @Log(title = "菜单管理", action = BusinessType.UPDATE)
+    @Log(title = "菜单管理", businessType = BusinessType.UPDATE)
     @RequiresPermissions("system:menu:edit")
     @PostMapping("/edit")
     @ResponseBody

+ 4 - 4
src/main/java/com/ruoyi/project/system/notice/controller/NoticeController.java

@@ -11,7 +11,7 @@ import org.springframework.web.bind.annotation.PostMapping;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.ResponseBody;
 import com.ruoyi.framework.aspectj.lang.annotation.Log;
-import com.ruoyi.framework.aspectj.lang.constant.BusinessType;
+import com.ruoyi.framework.aspectj.lang.enums.BusinessType;
 import com.ruoyi.framework.web.controller.BaseController;
 import com.ruoyi.framework.web.domain.AjaxResult;
 import com.ruoyi.framework.web.page.TableDataInfo;
@@ -65,7 +65,7 @@ public class NoticeController extends BaseController
      * 新增保存公告
      */
     @RequiresPermissions("system:notice:add")
-    @Log(title = "通知公告", action = BusinessType.INSERT)
+    @Log(title = "通知公告", businessType = BusinessType.INSERT)
     @PostMapping("/add")
     @ResponseBody
     public AjaxResult addSave(Notice notice)
@@ -87,7 +87,7 @@ public class NoticeController extends BaseController
      * 修改保存公告
      */
     @RequiresPermissions("system:notice:edit")
-    @Log(title = "通知公告", action = BusinessType.UPDATE)
+    @Log(title = "通知公告", businessType = BusinessType.UPDATE)
     @PostMapping("/edit")
     @ResponseBody
     public AjaxResult editSave(Notice notice)
@@ -99,7 +99,7 @@ public class NoticeController extends BaseController
      * 删除公告
      */
     @RequiresPermissions("system:notice:remove")
-    @Log(title = "通知公告", action = BusinessType.DELETE)
+    @Log(title = "通知公告", businessType = BusinessType.DELETE)
     @PostMapping("/remove")
     @ResponseBody
     public AjaxResult remove(String ids)

+ 5 - 5
src/main/java/com/ruoyi/project/system/post/controller/PostController.java

@@ -13,7 +13,7 @@ import org.springframework.web.bind.annotation.ResponseBody;
 import com.ruoyi.common.utils.StringUtils;
 import com.ruoyi.common.utils.poi.ExcelUtil;
 import com.ruoyi.framework.aspectj.lang.annotation.Log;
-import com.ruoyi.framework.aspectj.lang.constant.BusinessType;
+import com.ruoyi.framework.aspectj.lang.enums.BusinessType;
 import com.ruoyi.framework.web.controller.BaseController;
 import com.ruoyi.framework.web.domain.AjaxResult;
 import com.ruoyi.framework.web.page.TableDataInfo;
@@ -51,7 +51,7 @@ public class PostController extends BaseController
         return getDataTable(list);
     }
 
-    @Log(title = "岗位管理", action = BusinessType.EXPORT)
+    @Log(title = "岗位管理", businessType = BusinessType.EXPORT)
     @RequiresPermissions("system:post:export")
     @PostMapping("/export")
     @ResponseBody
@@ -70,7 +70,7 @@ public class PostController extends BaseController
     }
 
     @RequiresPermissions("system:post:remove")
-    @Log(title = "岗位管理", action = BusinessType.DELETE)
+    @Log(title = "岗位管理", businessType = BusinessType.DELETE)
     @PostMapping("/remove")
     @ResponseBody
     public AjaxResult remove(String ids)
@@ -98,7 +98,7 @@ public class PostController extends BaseController
      * 新增保存岗位
      */
     @RequiresPermissions("system:post:add")
-    @Log(title = "岗位管理", action = BusinessType.INSERT)
+    @Log(title = "岗位管理", businessType = BusinessType.INSERT)
     @PostMapping("/add")
     @ResponseBody
     public AjaxResult addSave(Post post)
@@ -120,7 +120,7 @@ public class PostController extends BaseController
      * 修改保存岗位
      */
     @RequiresPermissions("system:post:edit")
-    @Log(title = "岗位管理", action = BusinessType.UPDATE)
+    @Log(title = "岗位管理", businessType = BusinessType.UPDATE)
     @PostMapping("/edit")
     @ResponseBody
     public AjaxResult editSave(Post post)

+ 5 - 5
src/main/java/com/ruoyi/project/system/role/controller/RoleController.java

@@ -14,7 +14,7 @@ import org.springframework.web.bind.annotation.ResponseBody;
 import com.ruoyi.common.utils.StringUtils;
 import com.ruoyi.common.utils.poi.ExcelUtil;
 import com.ruoyi.framework.aspectj.lang.annotation.Log;
-import com.ruoyi.framework.aspectj.lang.constant.BusinessType;
+import com.ruoyi.framework.aspectj.lang.enums.BusinessType;
 import com.ruoyi.framework.web.controller.BaseController;
 import com.ruoyi.framework.web.domain.AjaxResult;
 import com.ruoyi.framework.web.page.TableDataInfo;
@@ -53,7 +53,7 @@ public class RoleController extends BaseController
         return getDataTable(list);
     }
 
-    @Log(title = "角色管理", action = BusinessType.EXPORT)
+    @Log(title = "角色管理", businessType = BusinessType.EXPORT)
     @RequiresPermissions("system:role:export")
     @PostMapping("/export")
     @ResponseBody
@@ -84,7 +84,7 @@ public class RoleController extends BaseController
      * 新增保存角色
      */
     @RequiresPermissions("system:role:add")
-    @Log(title = "角色管理", action = BusinessType.INSERT)
+    @Log(title = "角色管理", businessType = BusinessType.INSERT)
     @PostMapping("/add")
     @Transactional(rollbackFor = Exception.class)
     @ResponseBody
@@ -108,7 +108,7 @@ public class RoleController extends BaseController
      * 修改保存角色
      */
     @RequiresPermissions("system:role:edit")
-    @Log(title = "角色管理", action = BusinessType.UPDATE)
+    @Log(title = "角色管理", businessType = BusinessType.UPDATE)
     @PostMapping("/edit")
     @Transactional(rollbackFor = Exception.class)
     @ResponseBody
@@ -118,7 +118,7 @@ public class RoleController extends BaseController
     }
 
     @RequiresPermissions("system:role:remove")
-    @Log(title = "角色管理", action = BusinessType.DELETE)
+    @Log(title = "角色管理", businessType = BusinessType.DELETE)
     @PostMapping("/remove")
     @ResponseBody
     public AjaxResult remove(String ids)

+ 4 - 4
src/main/java/com/ruoyi/project/system/user/controller/ProfileController.java

@@ -15,7 +15,7 @@ import org.springframework.web.bind.annotation.ResponseBody;
 import org.springframework.web.multipart.MultipartFile;
 import com.ruoyi.common.utils.file.FileUploadUtils;
 import com.ruoyi.framework.aspectj.lang.annotation.Log;
-import com.ruoyi.framework.aspectj.lang.constant.BusinessType;
+import com.ruoyi.framework.aspectj.lang.enums.BusinessType;
 import com.ruoyi.framework.web.controller.BaseController;
 import com.ruoyi.framework.web.domain.AjaxResult;
 import com.ruoyi.framework.web.service.DictService;
@@ -75,7 +75,7 @@ public class ProfileController extends BaseController
         return prefix + "/resetPwd";
     }
 
-    @Log(title = "重置密码", action = BusinessType.UPDATE)
+    @Log(title = "重置密码", businessType = BusinessType.UPDATE)
     @PostMapping("/resetPwd")
     @ResponseBody
     public AjaxResult resetPwd(User user)
@@ -112,7 +112,7 @@ public class ProfileController extends BaseController
     /**
      * 修改用户
      */
-    @Log(title = "个人信息", action = BusinessType.UPDATE)
+    @Log(title = "个人信息", businessType = BusinessType.UPDATE)
     @PostMapping("/update")
     @ResponseBody
     public AjaxResult update(User user)
@@ -128,7 +128,7 @@ public class ProfileController extends BaseController
     /**
      * 保存头像
      */
-    @Log(title = "个人信息", action = BusinessType.UPDATE)
+    @Log(title = "个人信息", businessType = BusinessType.UPDATE)
     @PostMapping("/updateAvatar")
     @ResponseBody
     public AjaxResult updateAvatar(User user, @RequestParam("avatarfile") MultipartFile file)

+ 7 - 7
src/main/java/com/ruoyi/project/system/user/controller/UserController.java

@@ -14,7 +14,7 @@ import org.springframework.web.bind.annotation.ResponseBody;
 import com.ruoyi.common.utils.StringUtils;
 import com.ruoyi.common.utils.poi.ExcelUtil;
 import com.ruoyi.framework.aspectj.lang.annotation.Log;
-import com.ruoyi.framework.aspectj.lang.constant.BusinessType;
+import com.ruoyi.framework.aspectj.lang.enums.BusinessType;
 import com.ruoyi.framework.web.controller.BaseController;
 import com.ruoyi.framework.web.domain.AjaxResult;
 import com.ruoyi.framework.web.page.TableDataInfo;
@@ -60,7 +60,7 @@ public class UserController extends BaseController
         return getDataTable(list);
     }
 
-    @Log(title = "用户管理", action = BusinessType.EXPORT)
+    @Log(title = "用户管理", businessType = BusinessType.EXPORT)
     @RequiresPermissions("system:user:export")
     @PostMapping("/export")
     @ResponseBody
@@ -93,7 +93,7 @@ public class UserController extends BaseController
      * 新增保存用户
      */
     @RequiresPermissions("system:user:add")
-    @Log(title = "用户管理", action = BusinessType.INSERT)
+    @Log(title = "用户管理", businessType = BusinessType.INSERT)
     @PostMapping("/add")
     @Transactional(rollbackFor = Exception.class)
     @ResponseBody
@@ -122,7 +122,7 @@ public class UserController extends BaseController
      * 修改保存用户
      */
     @RequiresPermissions("system:user:edit")
-    @Log(title = "用户管理", action = BusinessType.UPDATE)
+    @Log(title = "用户管理", businessType = BusinessType.UPDATE)
     @PostMapping("/edit")
     @Transactional(rollbackFor = Exception.class)
     @ResponseBody
@@ -136,7 +136,7 @@ public class UserController extends BaseController
     }
 
     @RequiresPermissions("system:user:resetPwd")
-    @Log(title = "重置密码", action = BusinessType.UPDATE)
+    @Log(title = "重置密码", businessType = BusinessType.UPDATE)
     @GetMapping("/resetPwd/{userId}")
     public String resetPwd(@PathVariable("userId") Long userId, ModelMap mmap)
     {
@@ -145,7 +145,7 @@ public class UserController extends BaseController
     }
 
     @RequiresPermissions("system:user:resetPwd")
-    @Log(title = "重置密码", action = BusinessType.UPDATE)
+    @Log(title = "重置密码", businessType = BusinessType.UPDATE)
     @PostMapping("/resetPwd")
     @ResponseBody
     public AjaxResult resetPwd(User user)
@@ -154,7 +154,7 @@ public class UserController extends BaseController
     }
 
     @RequiresPermissions("system:user:remove")
-    @Log(title = "用户管理", action = BusinessType.DELETE)
+    @Log(title = "用户管理", businessType = BusinessType.DELETE)
     @PostMapping("/remove")
     @ResponseBody
     public AjaxResult remove(String ids)

+ 3 - 3
src/main/java/com/ruoyi/project/tool/gen/controller/GenController.java

@@ -14,7 +14,7 @@ import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.ResponseBody;
 import com.ruoyi.common.support.Convert;
 import com.ruoyi.framework.aspectj.lang.annotation.Log;
-import com.ruoyi.framework.aspectj.lang.constant.BusinessType;
+import com.ruoyi.framework.aspectj.lang.enums.BusinessType;
 import com.ruoyi.framework.web.controller.BaseController;
 import com.ruoyi.framework.web.page.TableDataInfo;
 import com.ruoyi.project.tool.gen.domain.TableInfo;
@@ -55,7 +55,7 @@ public class GenController extends BaseController
      * 生成代码
      */
     @RequiresPermissions("tool:gen:code")
-    @Log(title = "代码生成", action = BusinessType.GENCODE)
+    @Log(title = "代码生成", businessType = BusinessType.GENCODE)
     @GetMapping("/genCode/{tableName}")
     public void genCode(HttpServletResponse response, @PathVariable("tableName") String tableName) throws IOException
     {
@@ -72,7 +72,7 @@ public class GenController extends BaseController
      * 批量生成代码
      */
     @RequiresPermissions("tool:gen:code")
-    @Log(title = "代码生成", action = BusinessType.GENCODE)
+    @Log(title = "代码生成", businessType = BusinessType.GENCODE)
     @GetMapping("/batchGenCode")
     @ResponseBody
     public void batchGenCode(HttpServletResponse response, String tables) throws IOException

+ 10 - 7
src/main/resources/application-druid.yml

@@ -1,18 +1,21 @@
-#数据源配置
+# 数据源配置
 spring:
     datasource:
         type: com.alibaba.druid.pool.DruidDataSource
         driverClassName: com.mysql.jdbc.Driver
         druid:
-            master: #主库
+            # 主库数据源
+            master:
                 url: jdbc:mysql://localhost:3306/ry?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true
                 username: root
                 password: password
-            #slave:  #从库
-            #    open: true
-            #    url: jdbc:mysql://localhost:3306/ry?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true
-            #    username: root
-            #    password: password
+            # 从库数据源
+            slave:
+                # 从数据源开关/默认关闭
+                enabled: false
+                url: 
+                username: 
+                password: 
             # 初始连接数
             initial-size: 10
             # 最大连接池数量

+ 8 - 8
src/main/resources/mybatis/monitor/OperLogMapper.xml

@@ -7,10 +7,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 	<resultMap type="OperLog" id="OperLogResult">
 		<id     property="operId"         column="oper_id"       />
 		<result property="title"          column="title"         />
-		<result property="action"         column="action"        />
+		<result property="businessType"   column="business_type" />
 		<result property="method"         column="method"        />
-		<result property="channel"        column="channel"       />
-		<result property="operName"       column="oper_name"    />
+		<result property="operatorType"   column="operator_type" />
+		<result property="operName"       column="oper_name"     />
 		<result property="deptName"       column="dept_name"     />
 		<result property="operUrl"        column="oper_url"      />
 		<result property="operIp"         column="oper_ip"       />
@@ -23,14 +23,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 
 	<sql id="selectOperLogVo">
         select 
-        	oper_id, title, action, method, channel, oper_name, dept_name, oper_url, oper_ip,oper_location,oper_param,status,error_msg,oper_time
+        	oper_id, title, business_type, method, operator_type, oper_name, dept_name, oper_url, oper_ip,oper_location,oper_param,status,error_msg,oper_time
         from 
           	sys_oper_log
     </sql>
     
 	<insert id="insertOperlog" parameterType="OperLog">
-		insert into sys_oper_log(title, action, method, channel, oper_name, dept_name, oper_url, oper_ip, oper_location, oper_param, status, error_msg, oper_time)
-        values (#{title}, #{action}, #{method}, #{channel}, #{operName}, #{deptName}, #{operUrl}, #{operIp}, #{operLocation}, #{operParam}, #{status}, #{errorMsg}, sysdate())
+		insert into sys_oper_log(title, business_type, method, operator_type, oper_name, dept_name, oper_url, oper_ip, oper_location, oper_param, status, error_msg, oper_time)
+        values (#{title}, #{businessType}, #{method}, #{operatorType}, #{operName}, #{deptName}, #{operUrl}, #{operIp}, #{operLocation}, #{operParam}, #{status}, #{errorMsg}, sysdate())
 	</insert>
 	
 	<select id="selectOperLogList" parameterType="OperLog" resultMap="OperLogResult">
@@ -39,8 +39,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 			<if test="title != null and title != ''">
 				AND title like concat('%', #{title}, '%')
 			</if>
-			<if test="action != null and action != ''">
-				AND action = #{action}
+			<if test="businessType != null">
+				AND business_type = #{businessType}
 			</if>
 			<if test="operName != null and operName != ''">
 				AND oper_name like concat('%', #{operName}, '%')

+ 3 - 3
src/main/resources/templates/monitor/operlog/detail.html

@@ -8,7 +8,7 @@
 	<form class="form-horizontal m-t" id="signupForm">
 		<div class="form-group">
 			<label class="col-sm-2 control-label">操作模块:</label>
-			<div class="form-control-static" th:text="${operLog.title} + ' / ' + ${@dict.getLabel('sys_oper_type',operLog.action)}">
+			<div class="form-control-static" th:text="${operLog.title} + ' / ' + ${@dict.getLabel('sys_oper_type',operLog.businessType)}">
 			</div>
 		</div>
 		<div class="form-group">
@@ -33,10 +33,10 @@
 		</div>
 		<div class="form-group">
 			<label class="col-sm-2 control-label">状态:</label>
-			<div class="form-control-static" th:class="${operLog.status == '0' ? 'label label-primary' : 'label label-danger'}" th:text="${operLog.status == '0' ? '正常' : '异常'}">
+			<div class="form-control-static" th:class="${operLog.status == 0 ? 'label label-primary' : 'label label-danger'}" th:text="${operLog.status == 0 ? '正常' : '异常'}">
 			</div>
 		</div>
-		<div class="form-group" th:style="'display:' + ${operLog.status == '0' ? 'none' : 'block'}">
+		<div class="form-group" th:style="'display:' + ${operLog.status == 0 ? 'none' : 'block'}">
 			<label class="col-sm-2 control-label">异常信息:</label>
 			<div class="form-control-static" th:text="${operLog.errorMsg}">
 			</div>

+ 2 - 2
src/main/resources/templates/monitor/operlog/operlog.html

@@ -18,7 +18,7 @@
 								<label>操作人员: </label><input type="text" name="operName"/>
 							</li>
 							<li>
-								<label>操作类型: </label><select name="action" th:with="type=${@dict.getType('sys_oper_type')}">
+								<label>操作类型: </label><select name="businessType" th:with="type=${@dict.getType('sys_oper_type')}">
 									<option value="">所有</option>
 									<option th:each="e : ${type}" th:text="${e['dictLabel']}" th:value="${e['dictValue']}"></option>
 								</select>
@@ -77,7 +77,7 @@
 		            title: '系统模块'
 		        },
 		        {
-		            field: 'action',
+		            field: 'businessType',
 		            title: '操作类型',
 		            align: 'center',
 		            formatter: function(value, row, index) {