Pre Merge pull request !147 from Quieter/master
This commit is contained in:
commit
36802706d2
548
pom.xml
548
pom.xml
|
|
@ -1,263 +1,287 @@
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
|
||||||
<groupId>com.ruoyi</groupId>
|
<groupId>com.ruoyi</groupId>
|
||||||
<artifactId>ruoyi</artifactId>
|
<artifactId>ruoyi</artifactId>
|
||||||
<version>4.4.0</version>
|
<version>4.4.0</version>
|
||||||
|
|
||||||
<name>ruoyi</name>
|
<name>ruoyi</name>
|
||||||
<url>http://www.ruoyi.vip</url>
|
<url>http://www.ruoyi.vip</url>
|
||||||
<description>若依管理系统</description>
|
<description>若依管理系统</description>
|
||||||
|
|
||||||
<properties>
|
<properties>
|
||||||
<ruoyi.version>4.4.0</ruoyi.version>
|
<ruoyi.version>4.4.0</ruoyi.version>
|
||||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||||
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
|
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
|
||||||
<java.version>1.8</java.version>
|
<java.version>1.8</java.version>
|
||||||
<shiro.version>1.6.0</shiro.version>
|
<shiro.version>1.6.0</shiro.version>
|
||||||
<thymeleaf.extras.shiro.version>2.0.0</thymeleaf.extras.shiro.version>
|
<thymeleaf.extras.shiro.version>2.0.0</thymeleaf.extras.shiro.version>
|
||||||
<mybatis.boot.version>1.3.2</mybatis.boot.version>
|
<druid.version>1.1.22</druid.version>
|
||||||
<druid.version>1.1.22</druid.version>
|
<bitwalker.version>1.19</bitwalker.version>
|
||||||
<bitwalker.version>1.19</bitwalker.version>
|
<kaptcha.version>2.3.2</kaptcha.version>
|
||||||
<kaptcha.version>2.3.2</kaptcha.version>
|
<swagger.version>2.9.2</swagger.version>
|
||||||
<swagger.version>2.9.2</swagger.version>
|
<pagehelper.boot.version>1.2.5</pagehelper.boot.version>
|
||||||
<pagehelper.boot.version>1.2.5</pagehelper.boot.version>
|
<fastjson.version>1.2.73</fastjson.version>
|
||||||
<fastjson.version>1.2.73</fastjson.version>
|
<oshi.version>3.9.1</oshi.version>
|
||||||
<oshi.version>3.9.1</oshi.version>
|
<commons.io.version>2.5</commons.io.version>
|
||||||
<commons.io.version>2.5</commons.io.version>
|
<commons.fileupload.version>1.3.3</commons.fileupload.version>
|
||||||
<commons.fileupload.version>1.3.3</commons.fileupload.version>
|
<poi.version>3.17</poi.version>
|
||||||
<poi.version>3.17</poi.version>
|
<velocity.version>1.7</velocity.version>
|
||||||
<velocity.version>1.7</velocity.version>
|
<querydsl.version>4.2.1</querydsl.version>
|
||||||
</properties>
|
</properties>
|
||||||
|
|
||||||
<!-- 依赖声明 -->
|
<!-- 依赖声明 -->
|
||||||
<dependencyManagement>
|
<dependencyManagement>
|
||||||
<dependencies>
|
<dependencies>
|
||||||
|
|
||||||
<!-- SpringBoot的依赖配置-->
|
<!-- SpringBoot的依赖配置-->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.springframework.boot</groupId>
|
<groupId>org.springframework.boot</groupId>
|
||||||
<artifactId>spring-boot-dependencies</artifactId>
|
<artifactId>spring-boot-dependencies</artifactId>
|
||||||
<version>2.1.1.RELEASE</version>
|
<version>2.1.1.RELEASE</version>
|
||||||
<type>pom</type>
|
<type>pom</type>
|
||||||
<scope>import</scope>
|
<scope>import</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<!--阿里数据库连接池 -->
|
<!--阿里数据库连接池 -->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.alibaba</groupId>
|
<groupId>com.alibaba</groupId>
|
||||||
<artifactId>druid-spring-boot-starter</artifactId>
|
<artifactId>druid-spring-boot-starter</artifactId>
|
||||||
<version>${druid.version}</version>
|
<version>${druid.version}</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<!--验证码 -->
|
<!--验证码 -->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.github.penggle</groupId>
|
<groupId>com.github.penggle</groupId>
|
||||||
<artifactId>kaptcha</artifactId>
|
<artifactId>kaptcha</artifactId>
|
||||||
<version>${kaptcha.version}</version>
|
<version>${kaptcha.version}</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<!--Shiro核心框架 -->
|
<!--Shiro核心框架 -->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.apache.shiro</groupId>
|
<groupId>org.apache.shiro</groupId>
|
||||||
<artifactId>shiro-core</artifactId>
|
<artifactId>shiro-core</artifactId>
|
||||||
<version>${shiro.version}</version>
|
<version>${shiro.version}</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<!-- Shiro使用Srping框架 -->
|
<!-- Shiro使用Srping框架 -->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.apache.shiro</groupId>
|
<groupId>org.apache.shiro</groupId>
|
||||||
<artifactId>shiro-spring</artifactId>
|
<artifactId>shiro-spring</artifactId>
|
||||||
<version>${shiro.version}</version>
|
<version>${shiro.version}</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<!-- Shiro使用EhCache缓存框架 -->
|
<!-- Shiro使用EhCache缓存框架 -->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.apache.shiro</groupId>
|
<groupId>org.apache.shiro</groupId>
|
||||||
<artifactId>shiro-ehcache</artifactId>
|
<artifactId>shiro-ehcache</artifactId>
|
||||||
<version>${shiro.version}</version>
|
<version>${shiro.version}</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<!-- thymeleaf模板引擎和shiro框架的整合 -->
|
<!-- thymeleaf模板引擎和shiro框架的整合 -->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.github.theborakompanioni</groupId>
|
<groupId>com.github.theborakompanioni</groupId>
|
||||||
<artifactId>thymeleaf-extras-shiro</artifactId>
|
<artifactId>thymeleaf-extras-shiro</artifactId>
|
||||||
<version>${thymeleaf.extras.shiro.version}</version>
|
<version>${thymeleaf.extras.shiro.version}</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<!-- 解析客户端操作系统、浏览器等 -->
|
<!-- 解析客户端操作系统、浏览器等 -->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>eu.bitwalker</groupId>
|
<groupId>eu.bitwalker</groupId>
|
||||||
<artifactId>UserAgentUtils</artifactId>
|
<artifactId>UserAgentUtils</artifactId>
|
||||||
<version>${bitwalker.version}</version>
|
<version>${bitwalker.version}</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<!-- pagehelper 分页插件 -->
|
<!-- pagehelper 分页插件 -->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.github.pagehelper</groupId>
|
<groupId>com.github.pagehelper</groupId>
|
||||||
<artifactId>pagehelper-spring-boot-starter</artifactId>
|
<artifactId>pagehelper-spring-boot-starter</artifactId>
|
||||||
<version>${pagehelper.boot.version}</version>
|
<version>${pagehelper.boot.version}</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<!-- 获取系统信息 -->
|
<!-- 获取系统信息 -->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.github.oshi</groupId>
|
<groupId>com.github.oshi</groupId>
|
||||||
<artifactId>oshi-core</artifactId>
|
<artifactId>oshi-core</artifactId>
|
||||||
<version>${oshi.version}</version>
|
<version>${oshi.version}</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<!-- swagger2-->
|
<!-- swagger2-->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>io.springfox</groupId>
|
<groupId>io.springfox</groupId>
|
||||||
<artifactId>springfox-swagger2</artifactId>
|
<artifactId>springfox-swagger2</artifactId>
|
||||||
<version>${swagger.version}</version>
|
<version>${swagger.version}</version>
|
||||||
<exclusions>
|
<exclusions>
|
||||||
<exclusion>
|
<exclusion>
|
||||||
<groupId>io.swagger</groupId>
|
<groupId>io.swagger</groupId>
|
||||||
<artifactId>swagger-annotations</artifactId>
|
<artifactId>swagger-annotations</artifactId>
|
||||||
</exclusion>
|
</exclusion>
|
||||||
<exclusion>
|
<exclusion>
|
||||||
<groupId>io.swagger</groupId>
|
<groupId>io.swagger</groupId>
|
||||||
<artifactId>swagger-models</artifactId>
|
<artifactId>swagger-models</artifactId>
|
||||||
</exclusion>
|
</exclusion>
|
||||||
</exclusions>
|
</exclusions>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<!-- swagger2-UI-->
|
<!-- swagger2-UI-->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>io.springfox</groupId>
|
<groupId>io.springfox</groupId>
|
||||||
<artifactId>springfox-swagger-ui</artifactId>
|
<artifactId>springfox-swagger-ui</artifactId>
|
||||||
<version>${swagger.version}</version>
|
<version>${swagger.version}</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<!--io常用工具类 -->
|
<!--io常用工具类 -->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>commons-io</groupId>
|
<groupId>commons-io</groupId>
|
||||||
<artifactId>commons-io</artifactId>
|
<artifactId>commons-io</artifactId>
|
||||||
<version>${commons.io.version}</version>
|
<version>${commons.io.version}</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<!--文件上传工具类 -->
|
<!--文件上传工具类 -->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>commons-fileupload</groupId>
|
<groupId>commons-fileupload</groupId>
|
||||||
<artifactId>commons-fileupload</artifactId>
|
<artifactId>commons-fileupload</artifactId>
|
||||||
<version>${commons.fileupload.version}</version>
|
<version>${commons.fileupload.version}</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<!-- excel工具 -->
|
<!-- excel工具 -->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.apache.poi</groupId>
|
<groupId>org.apache.poi</groupId>
|
||||||
<artifactId>poi-ooxml</artifactId>
|
<artifactId>poi-ooxml</artifactId>
|
||||||
<version>${poi.version}</version>
|
<version>${poi.version}</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<!--velocity代码生成使用模板 -->
|
<!--velocity代码生成使用模板 -->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.apache.velocity</groupId>
|
<groupId>org.apache.velocity</groupId>
|
||||||
<artifactId>velocity</artifactId>
|
<artifactId>velocity</artifactId>
|
||||||
<version>${velocity.version}</version>
|
<version>${velocity.version}</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<!-- 阿里JSON解析器 -->
|
<!-- 阿里JSON解析器 -->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.alibaba</groupId>
|
<groupId>com.alibaba</groupId>
|
||||||
<artifactId>fastjson</artifactId>
|
<artifactId>fastjson</artifactId>
|
||||||
<version>${fastjson.version}</version>
|
<version>${fastjson.version}</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<!-- 定时任务-->
|
<!-- 定时任务-->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.ruoyi</groupId>
|
<groupId>com.ruoyi</groupId>
|
||||||
<artifactId>ruoyi-quartz</artifactId>
|
<artifactId>ruoyi-quartz</artifactId>
|
||||||
<version>${ruoyi.version}</version>
|
<version>${ruoyi.version}</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<!-- 代码生成-->
|
<!-- 代码生成-->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.ruoyi</groupId>
|
<groupId>com.ruoyi</groupId>
|
||||||
<artifactId>ruoyi-generator</artifactId>
|
<artifactId>ruoyi-generator</artifactId>
|
||||||
<version>${ruoyi.version}</version>
|
<version>${ruoyi.version}</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<!-- 核心模块-->
|
<!-- 核心模块-->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.ruoyi</groupId>
|
<groupId>com.ruoyi</groupId>
|
||||||
<artifactId>ruoyi-framework</artifactId>
|
<artifactId>ruoyi-framework</artifactId>
|
||||||
<version>${ruoyi.version}</version>
|
<version>${ruoyi.version}</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<!-- 系统模块-->
|
<!-- 系统模块-->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.ruoyi</groupId>
|
<groupId>com.ruoyi</groupId>
|
||||||
<artifactId>ruoyi-system</artifactId>
|
<artifactId>ruoyi-system</artifactId>
|
||||||
<version>${ruoyi.version}</version>
|
<version>${ruoyi.version}</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<!-- 通用工具-->
|
<!-- 通用工具-->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.ruoyi</groupId>
|
<groupId>com.ruoyi</groupId>
|
||||||
<artifactId>ruoyi-common</artifactId>
|
<artifactId>ruoyi-common</artifactId>
|
||||||
<version>${ruoyi.version}</version>
|
<version>${ruoyi.version}</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
</dependencies>
|
<dependency>
|
||||||
</dependencyManagement>
|
<groupId>com.querydsl</groupId>
|
||||||
|
<artifactId>querydsl-jpa</artifactId>
|
||||||
<modules>
|
<version>${querydsl.version}</version>
|
||||||
<module>ruoyi-admin</module>
|
</dependency>
|
||||||
<module>ruoyi-framework</module>
|
|
||||||
<module>ruoyi-system</module>
|
</dependencies>
|
||||||
<module>ruoyi-quartz</module>
|
</dependencyManagement>
|
||||||
<module>ruoyi-generator</module>
|
|
||||||
<module>ruoyi-common</module>
|
<modules>
|
||||||
</modules>
|
<module>ruoyi-admin</module>
|
||||||
<packaging>pom</packaging>
|
<module>ruoyi-framework</module>
|
||||||
|
<module>ruoyi-system</module>
|
||||||
|
<module>ruoyi-quartz</module>
|
||||||
<dependencies>
|
<module>ruoyi-generator</module>
|
||||||
|
<module>ruoyi-common</module>
|
||||||
</dependencies>
|
</modules>
|
||||||
|
<packaging>pom</packaging>
|
||||||
<build>
|
|
||||||
<plugins>
|
<build>
|
||||||
<plugin>
|
<plugins>
|
||||||
<groupId>org.apache.maven.plugins</groupId>
|
<plugin>
|
||||||
<artifactId>maven-compiler-plugin</artifactId>
|
<groupId>com.mysema.maven</groupId>
|
||||||
<version>3.1</version>
|
<artifactId>apt-maven-plugin</artifactId>
|
||||||
<configuration>
|
<version>1.1.3</version>
|
||||||
<source>${java.version}</source>
|
<executions>
|
||||||
<target>${java.version}</target>
|
<execution>
|
||||||
<encoding>${project.build.sourceEncoding}</encoding>
|
<goals>
|
||||||
</configuration>
|
<goal>process</goal>
|
||||||
</plugin>
|
</goals>
|
||||||
</plugins>
|
<configuration>
|
||||||
</build>
|
<outputDirectory>target/generated-sources/java</outputDirectory>
|
||||||
|
<processor>com.querydsl.apt.jpa.JPAAnnotationProcessor</processor>
|
||||||
<repositories>
|
</configuration>
|
||||||
<repository>
|
</execution>
|
||||||
<id>public</id>
|
</executions>
|
||||||
<name>aliyun nexus</name>
|
<dependencies>
|
||||||
<url>http://maven.aliyun.com/nexus/content/groups/public/</url>
|
<dependency>
|
||||||
<releases>
|
<groupId>com.querydsl</groupId>
|
||||||
<enabled>true</enabled>
|
<artifactId>querydsl-apt</artifactId>
|
||||||
</releases>
|
<version>${querydsl.version}</version>
|
||||||
</repository>
|
</dependency>
|
||||||
</repositories>
|
</dependencies>
|
||||||
|
</plugin>
|
||||||
<pluginRepositories>
|
<plugin>
|
||||||
<pluginRepository>
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
<id>public</id>
|
<artifactId>maven-compiler-plugin</artifactId>
|
||||||
<name>aliyun nexus</name>
|
<version>3.1</version>
|
||||||
<url>http://maven.aliyun.com/nexus/content/groups/public/</url>
|
<configuration>
|
||||||
<releases>
|
<source>${java.version}</source>
|
||||||
<enabled>true</enabled>
|
<target>${java.version}</target>
|
||||||
</releases>
|
<encoding>${project.build.sourceEncoding}</encoding>
|
||||||
<snapshots>
|
</configuration>
|
||||||
<enabled>false</enabled>
|
</plugin>
|
||||||
</snapshots>
|
</plugins>
|
||||||
</pluginRepository>
|
</build>
|
||||||
</pluginRepositories>
|
|
||||||
|
<repositories>
|
||||||
|
<repository>
|
||||||
|
<id>public</id>
|
||||||
|
<name>aliyun nexus</name>
|
||||||
|
<url>http://maven.aliyun.com/nexus/content/groups/public/</url>
|
||||||
|
<releases>
|
||||||
|
<enabled>true</enabled>
|
||||||
|
</releases>
|
||||||
|
</repository>
|
||||||
|
</repositories>
|
||||||
|
|
||||||
|
<pluginRepositories>
|
||||||
|
<pluginRepository>
|
||||||
|
<id>public</id>
|
||||||
|
<name>aliyun nexus</name>
|
||||||
|
<url>http://maven.aliyun.com/nexus/content/groups/public/</url>
|
||||||
|
<releases>
|
||||||
|
<enabled>true</enabled>
|
||||||
|
</releases>
|
||||||
|
<snapshots>
|
||||||
|
<enabled>false</enabled>
|
||||||
|
</snapshots>
|
||||||
|
</pluginRepository>
|
||||||
|
</pluginRepositories>
|
||||||
|
|
||||||
</project>
|
</project>
|
||||||
|
|
@ -79,6 +79,17 @@
|
||||||
<artifactId>ruoyi-generator</artifactId>
|
<artifactId>ruoyi-generator</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.flywaydb</groupId>
|
||||||
|
<artifactId>flyway-core</artifactId>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!-- https://mvnrepository.com/artifact/com.fasterxml.jackson.datatype/jackson-datatype-hibernate5 -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.fasterxml.jackson.datatype</groupId>
|
||||||
|
<artifactId>jackson-datatype-hibernate5</artifactId>
|
||||||
|
<version>2.10.1</version>
|
||||||
|
</dependency>
|
||||||
</dependencies>
|
</dependencies>
|
||||||
|
|
||||||
<build>
|
<build>
|
||||||
|
|
|
||||||
|
|
@ -1,30 +1,46 @@
|
||||||
package com.ruoyi;
|
package com.ruoyi;
|
||||||
|
|
||||||
import org.springframework.boot.SpringApplication;
|
import org.springframework.boot.CommandLineRunner;
|
||||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
import org.springframework.boot.SpringApplication;
|
||||||
import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
|
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||||
|
import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
|
||||||
/**
|
import org.springframework.boot.builder.SpringApplicationBuilder;
|
||||||
* 启动程序
|
import org.springframework.boot.web.servlet.support.SpringBootServletInitializer;
|
||||||
*
|
import org.springframework.context.annotation.Bean;
|
||||||
* @author ruoyi
|
|
||||||
*/
|
/**
|
||||||
@SpringBootApplication(exclude = { DataSourceAutoConfiguration.class })
|
* 启动程序
|
||||||
public class RuoYiApplication
|
*
|
||||||
{
|
* @author ruoyi
|
||||||
public static void main(String[] args)
|
*/
|
||||||
{
|
@SpringBootApplication(exclude = {DataSourceAutoConfiguration.class})
|
||||||
// System.setProperty("spring.devtools.restart.enabled", "false");
|
public class RuoYiApplication extends SpringBootServletInitializer {
|
||||||
SpringApplication.run(RuoYiApplication.class, args);
|
public static void main(String[] args) {
|
||||||
System.out.println("(♥◠‿◠)ノ゙ 若依启动成功 ლ(´ڡ`ლ)゙ \n" +
|
// System.setProperty("spring.devtools.restart.enabled", "false");
|
||||||
" .-------. ____ __ \n" +
|
SpringApplication.run(RuoYiApplication.class, args);
|
||||||
" | _ _ \\ \\ \\ / / \n" +
|
}
|
||||||
" | ( ' ) | \\ _. / ' \n" +
|
|
||||||
" |(_ o _) / _( )_ .' \n" +
|
@Override
|
||||||
" | (_,_).' __ ___(_ o _)' \n" +
|
protected SpringApplicationBuilder configure(SpringApplicationBuilder builder) {
|
||||||
" | |\\ \\ | || |(_,_)' \n" +
|
return builder.sources(RuoYiApplication.class);
|
||||||
" | | \\ `' /| `-' / \n" +
|
}
|
||||||
" | | \\ / \\ / \n" +
|
|
||||||
" ''-' `'-' `-..-' ");
|
@Bean
|
||||||
}
|
public CommandLineRunner startupCommandLineRunner() {
|
||||||
|
return new CommandLineRunner() {
|
||||||
|
@Override
|
||||||
|
public void run(String... args) throws Exception {
|
||||||
|
System.out.println("(♥◠‿◠)ノ゙ 若依启动成功 ლ(´ڡ`ლ)゙ \n" +
|
||||||
|
" .-------. ____ __ \n" +
|
||||||
|
" | _ _ \\ \\ \\ / / \n" +
|
||||||
|
" | ( ' ) | \\ _. / ' \n" +
|
||||||
|
" |(_ o _) / _( )_ .' \n" +
|
||||||
|
" | (_,_).' __ ___(_ o _)' \n" +
|
||||||
|
" | |\\ \\ | || |(_,_)' \n" +
|
||||||
|
" | | \\ `' /| `-' / \n" +
|
||||||
|
" | | \\ / \\ / \n" +
|
||||||
|
" ''-' `'-' `-..-' ");
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -1,18 +0,0 @@
|
||||||
package com.ruoyi;
|
|
||||||
|
|
||||||
import org.springframework.boot.builder.SpringApplicationBuilder;
|
|
||||||
import org.springframework.boot.web.servlet.support.SpringBootServletInitializer;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* web容器中进行部署
|
|
||||||
*
|
|
||||||
* @author ruoyi
|
|
||||||
*/
|
|
||||||
public class RuoYiServletInitializer extends SpringBootServletInitializer
|
|
||||||
{
|
|
||||||
@Override
|
|
||||||
protected SpringApplicationBuilder configure(SpringApplicationBuilder application)
|
|
||||||
{
|
|
||||||
return application.sources(RuoYiApplication.class);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
@ -1,112 +1,101 @@
|
||||||
package com.ruoyi.web.controller.common;
|
package com.ruoyi.web.controller.common;
|
||||||
|
|
||||||
import javax.servlet.http.HttpServletRequest;
|
import javax.servlet.http.HttpServletRequest;
|
||||||
import javax.servlet.http.HttpServletResponse;
|
import javax.servlet.http.HttpServletResponse;
|
||||||
import org.slf4j.Logger;
|
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.Logger;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.slf4j.LoggerFactory;
|
||||||
import org.springframework.http.MediaType;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Controller;
|
import org.springframework.http.MediaType;
|
||||||
import org.springframework.web.bind.annotation.GetMapping;
|
import org.springframework.stereotype.Controller;
|
||||||
import org.springframework.web.bind.annotation.PostMapping;
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
import org.springframework.web.bind.annotation.ResponseBody;
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
import org.springframework.web.multipart.MultipartFile;
|
import org.springframework.web.bind.annotation.ResponseBody;
|
||||||
import com.ruoyi.common.config.Global;
|
import org.springframework.web.multipart.MultipartFile;
|
||||||
import com.ruoyi.common.config.ServerConfig;
|
import com.ruoyi.common.config.Global;
|
||||||
import com.ruoyi.common.constant.Constants;
|
import com.ruoyi.common.config.ServerConfig;
|
||||||
import com.ruoyi.common.core.domain.AjaxResult;
|
import com.ruoyi.common.constant.Constants;
|
||||||
import com.ruoyi.common.utils.StringUtils;
|
import com.ruoyi.common.core.domain.AjaxResult;
|
||||||
import com.ruoyi.common.utils.file.FileUploadUtils;
|
import com.ruoyi.common.utils.StringUtils;
|
||||||
import com.ruoyi.common.utils.file.FileUtils;
|
import com.ruoyi.common.utils.file.FileUploadUtils;
|
||||||
|
import com.ruoyi.common.utils.file.FileUtils;
|
||||||
/**
|
|
||||||
* 通用请求处理
|
/**
|
||||||
*
|
* 通用请求处理
|
||||||
* @author ruoyi
|
*
|
||||||
*/
|
* @author ruoyi
|
||||||
@Controller
|
*/
|
||||||
public class CommonController
|
@Controller
|
||||||
{
|
public class CommonController {
|
||||||
private static final Logger log = LoggerFactory.getLogger(CommonController.class);
|
private static final Logger log = LoggerFactory.getLogger(CommonController.class);
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private ServerConfig serverConfig;
|
private ServerConfig serverConfig;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 通用下载请求
|
* 通用下载请求
|
||||||
*
|
*
|
||||||
* @param fileName 文件名称
|
* @param fileName 文件名称
|
||||||
* @param delete 是否删除
|
* @param delete 是否删除
|
||||||
*/
|
*/
|
||||||
@GetMapping("common/download")
|
@GetMapping("common/download")
|
||||||
public void fileDownload(String fileName, Boolean delete, HttpServletResponse response, HttpServletRequest request)
|
public void fileDownload(String fileName, Boolean delete, HttpServletResponse response, HttpServletRequest request) {
|
||||||
{
|
try {
|
||||||
try
|
if (!FileUtils.isValidFilename(fileName)) {
|
||||||
{
|
throw new Exception(StringUtils.format("文件名称({})非法,不允许下载。 ", fileName));
|
||||||
if (!FileUtils.isValidFilename(fileName))
|
}
|
||||||
{
|
String realFileName = System.currentTimeMillis() + fileName.substring(fileName.indexOf("_") + 1);
|
||||||
throw new Exception(StringUtils.format("文件名称({})非法,不允许下载。 ", fileName));
|
String filePath = Global.getDownloadPath() + fileName;
|
||||||
}
|
|
||||||
String realFileName = System.currentTimeMillis() + fileName.substring(fileName.indexOf("_") + 1);
|
response.setContentType(MediaType.APPLICATION_OCTET_STREAM_VALUE);
|
||||||
String filePath = Global.getDownloadPath() + fileName;
|
FileUtils.setAttachmentResponseHeader(response, realFileName);
|
||||||
|
|
||||||
response.setContentType(MediaType.APPLICATION_OCTET_STREAM_VALUE);
|
FileUtils.writeBytes(filePath, response.getOutputStream());
|
||||||
FileUtils.setAttachmentResponseHeader(response, realFileName);
|
if (delete) {
|
||||||
|
FileUtils.deleteFile(filePath);
|
||||||
FileUtils.writeBytes(filePath, response.getOutputStream());
|
}
|
||||||
if (delete)
|
} catch (Exception e) {
|
||||||
{
|
log.error("下载文件失败", e);
|
||||||
FileUtils.deleteFile(filePath);
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
catch (Exception e)
|
/**
|
||||||
{
|
* 通用上传请求
|
||||||
log.error("下载文件失败", e);
|
*/
|
||||||
}
|
@PostMapping("/common/upload")
|
||||||
}
|
@ResponseBody
|
||||||
|
public AjaxResult uploadFile(MultipartFile file) throws Exception {
|
||||||
/**
|
try {
|
||||||
* 通用上传请求
|
// 上传文件路径
|
||||||
*/
|
String filePath = Global.getUploadPath();
|
||||||
@PostMapping("/common/upload")
|
// 上传并返回新文件名称
|
||||||
@ResponseBody
|
String fileName = FileUploadUtils.upload(filePath, file);
|
||||||
public AjaxResult uploadFile(MultipartFile file) throws Exception
|
String url = serverConfig.getUrl() + fileName;
|
||||||
{
|
AjaxResult ajax = AjaxResult.success();
|
||||||
try
|
ajax.put("fileName", fileName);
|
||||||
{
|
ajax.put("url", url);
|
||||||
// 上传文件路径
|
return ajax;
|
||||||
String filePath = Global.getUploadPath();
|
} catch (Exception e) {
|
||||||
// 上传并返回新文件名称
|
return AjaxResult.error(e.getMessage());
|
||||||
String fileName = FileUploadUtils.upload(filePath, file);
|
}
|
||||||
String url = serverConfig.getUrl() + fileName;
|
}
|
||||||
AjaxResult ajax = AjaxResult.success();
|
|
||||||
ajax.put("fileName", fileName);
|
/**
|
||||||
ajax.put("url", url);
|
* 本地资源通用下载
|
||||||
return ajax;
|
*/
|
||||||
}
|
@GetMapping("/common/download/resource")
|
||||||
catch (Exception e)
|
public void resourceDownload(String resource, HttpServletRequest request, HttpServletResponse response)
|
||||||
{
|
throws Exception {
|
||||||
return AjaxResult.error(e.getMessage());
|
// 本地资源路径
|
||||||
}
|
String localPath = Global.getProfile();
|
||||||
}
|
// 数据库资源地址
|
||||||
|
String downloadPath = localPath + StringUtils.substringAfter(resource, Constants.RESOURCE_PREFIX);
|
||||||
/**
|
// 下载名称
|
||||||
* 本地资源通用下载
|
String downloadName = StringUtils.substringAfterLast(downloadPath, "/");
|
||||||
*/
|
|
||||||
@GetMapping("/common/download/resource")
|
response.setContentType(MediaType.APPLICATION_OCTET_STREAM_VALUE);
|
||||||
public void resourceDownload(String resource, HttpServletRequest request, HttpServletResponse response)
|
FileUtils.setAttachmentResponseHeader(response, downloadName);
|
||||||
throws Exception
|
|
||||||
{
|
FileUtils.writeBytes(downloadPath, response.getOutputStream());
|
||||||
// 本地资源路径
|
}
|
||||||
String localPath = Global.getProfile();
|
}
|
||||||
// 数据库资源地址
|
|
||||||
String downloadPath = localPath + StringUtils.substringAfter(resource, Constants.RESOURCE_PREFIX);
|
|
||||||
// 下载名称
|
|
||||||
String downloadName = StringUtils.substringAfterLast(downloadPath, "/");
|
|
||||||
|
|
||||||
response.setContentType(MediaType.APPLICATION_OCTET_STREAM_VALUE);
|
|
||||||
FileUtils.setAttachmentResponseHeader(response, downloadName);
|
|
||||||
|
|
||||||
FileUtils.writeBytes(downloadPath, response.getOutputStream());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
|
||||||
|
|
@ -1,80 +1,72 @@
|
||||||
package com.ruoyi.web.controller.demo.controller;
|
package com.ruoyi.web.controller.demo.controller;
|
||||||
|
|
||||||
import org.springframework.stereotype.Controller;
|
import org.springframework.stereotype.Controller;
|
||||||
import org.springframework.web.bind.annotation.GetMapping;
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 模态窗口
|
* 模态窗口
|
||||||
*
|
*
|
||||||
* @author ruoyi
|
* @author ruoyi
|
||||||
*/
|
*/
|
||||||
@Controller
|
@Controller
|
||||||
@RequestMapping("/demo/modal")
|
@RequestMapping("/demo/modal")
|
||||||
public class DemoDialogController
|
public class DemoDialogController {
|
||||||
{
|
private String prefix = "demo/modal";
|
||||||
private String prefix = "demo/modal";
|
|
||||||
|
/**
|
||||||
/**
|
* 模态窗口
|
||||||
* 模态窗口
|
*/
|
||||||
*/
|
@GetMapping("/dialog")
|
||||||
@GetMapping("/dialog")
|
public String dialog() {
|
||||||
public String dialog()
|
return prefix + "/dialog";
|
||||||
{
|
}
|
||||||
return prefix + "/dialog";
|
|
||||||
}
|
/**
|
||||||
|
* 弹层组件
|
||||||
/**
|
*/
|
||||||
* 弹层组件
|
@GetMapping("/layer")
|
||||||
*/
|
public String layer() {
|
||||||
@GetMapping("/layer")
|
return prefix + "/layer";
|
||||||
public String layer()
|
}
|
||||||
{
|
|
||||||
return prefix + "/layer";
|
/**
|
||||||
}
|
* 表单
|
||||||
|
*/
|
||||||
/**
|
@GetMapping("/form")
|
||||||
* 表单
|
public String form() {
|
||||||
*/
|
return prefix + "/form";
|
||||||
@GetMapping("/form")
|
}
|
||||||
public String form()
|
|
||||||
{
|
/**
|
||||||
return prefix + "/form";
|
* 表格
|
||||||
}
|
*/
|
||||||
|
@GetMapping("/table")
|
||||||
/**
|
public String table() {
|
||||||
* 表格
|
return prefix + "/table";
|
||||||
*/
|
}
|
||||||
@GetMapping("/table")
|
|
||||||
public String table()
|
/**
|
||||||
{
|
* 表格check
|
||||||
return prefix + "/table";
|
*/
|
||||||
}
|
@GetMapping("/check")
|
||||||
|
public String check() {
|
||||||
/**
|
return prefix + "/table/check";
|
||||||
* 表格check
|
}
|
||||||
*/
|
|
||||||
@GetMapping("/check")
|
/**
|
||||||
public String check()
|
* 表格radio
|
||||||
{
|
*/
|
||||||
return prefix + "/table/check";
|
@GetMapping("/radio")
|
||||||
}
|
public String radio() {
|
||||||
|
return prefix + "/table/radio";
|
||||||
/**
|
}
|
||||||
* 表格radio
|
|
||||||
*/
|
/**
|
||||||
@GetMapping("/radio")
|
* 表格回传父窗体
|
||||||
public String radio()
|
*/
|
||||||
{
|
@GetMapping("/parent")
|
||||||
return prefix + "/table/radio";
|
public String parent() {
|
||||||
}
|
return prefix + "/table/parent";
|
||||||
|
}
|
||||||
/**
|
}
|
||||||
* 表格回传父窗体
|
|
||||||
*/
|
|
||||||
@GetMapping("/parent")
|
|
||||||
public String parent()
|
|
||||||
{
|
|
||||||
return prefix + "/table/parent";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
|
||||||
File diff suppressed because one or more lines are too long
|
|
@ -1,35 +1,32 @@
|
||||||
package com.ruoyi.web.controller.demo.controller;
|
package com.ruoyi.web.controller.demo.controller;
|
||||||
|
|
||||||
import org.springframework.stereotype.Controller;
|
import org.springframework.stereotype.Controller;
|
||||||
import org.springframework.web.bind.annotation.GetMapping;
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 图标相关
|
* 图标相关
|
||||||
*
|
*
|
||||||
* @author ruoyi
|
* @author ruoyi
|
||||||
*/
|
*/
|
||||||
@Controller
|
@Controller
|
||||||
@RequestMapping("/demo/icon")
|
@RequestMapping("/demo/icon")
|
||||||
public class DemoIconController
|
public class DemoIconController {
|
||||||
{
|
private String prefix = "demo/icon";
|
||||||
private String prefix = "demo/icon";
|
|
||||||
|
/**
|
||||||
/**
|
* FontAwesome图标
|
||||||
* FontAwesome图标
|
*/
|
||||||
*/
|
@GetMapping("/fontawesome")
|
||||||
@GetMapping("/fontawesome")
|
public String fontAwesome() {
|
||||||
public String fontAwesome()
|
return prefix + "/fontawesome";
|
||||||
{
|
}
|
||||||
return prefix + "/fontawesome";
|
|
||||||
}
|
/**
|
||||||
|
* Glyphicons图标
|
||||||
/**
|
*/
|
||||||
* Glyphicons图标
|
@GetMapping("/glyphicons")
|
||||||
*/
|
public String glyphicons() {
|
||||||
@GetMapping("/glyphicons")
|
return prefix + "/glyphicons";
|
||||||
public String glyphicons()
|
}
|
||||||
{
|
}
|
||||||
return prefix + "/glyphicons";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
|
||||||
|
|
@ -1,326 +1,326 @@
|
||||||
package com.ruoyi.web.controller.demo.controller;
|
package com.ruoyi.web.controller.demo.controller;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.LinkedHashMap;
|
import java.util.LinkedHashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import org.springframework.stereotype.Controller;
|
import org.springframework.stereotype.Controller;
|
||||||
import org.springframework.ui.ModelMap;
|
import org.springframework.ui.ModelMap;
|
||||||
import org.springframework.web.bind.annotation.GetMapping;
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
import org.springframework.web.bind.annotation.PathVariable;
|
import org.springframework.web.bind.annotation.PathVariable;
|
||||||
import org.springframework.web.bind.annotation.PostMapping;
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
import org.springframework.web.bind.annotation.ResponseBody;
|
import org.springframework.web.bind.annotation.ResponseBody;
|
||||||
import org.springframework.web.multipart.MultipartFile;
|
import org.springframework.web.multipart.MultipartFile;
|
||||||
import com.ruoyi.common.core.controller.BaseController;
|
import com.ruoyi.common.core.controller.BaseController;
|
||||||
import com.ruoyi.common.core.domain.AjaxResult;
|
import com.ruoyi.common.core.domain.AjaxResult;
|
||||||
import com.ruoyi.common.core.page.PageDomain;
|
import com.ruoyi.common.core.page.PageDomain;
|
||||||
import com.ruoyi.common.core.page.TableDataInfo;
|
import com.ruoyi.common.core.page.TableDataInfo;
|
||||||
import com.ruoyi.common.core.page.TableSupport;
|
import com.ruoyi.common.core.page.TableSupport;
|
||||||
import com.ruoyi.common.core.text.Convert;
|
import com.ruoyi.common.core.text.Convert;
|
||||||
import com.ruoyi.common.exception.BusinessException;
|
import com.ruoyi.common.exception.BusinessException;
|
||||||
import com.ruoyi.common.utils.StringUtils;
|
import com.ruoyi.common.utils.StringUtils;
|
||||||
import com.ruoyi.common.utils.poi.ExcelUtil;
|
import com.ruoyi.common.utils.poi.ExcelUtil;
|
||||||
import com.ruoyi.web.controller.demo.domain.CustomerModel;
|
import com.ruoyi.web.controller.demo.domain.CustomerModel;
|
||||||
import com.ruoyi.web.controller.demo.domain.UserOperateModel;
|
import com.ruoyi.web.controller.demo.domain.UserOperateModel;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 操作控制
|
* 操作控制
|
||||||
*
|
*
|
||||||
* @author ruoyi
|
* @author ruoyi
|
||||||
*/
|
*/
|
||||||
@Controller
|
@Controller
|
||||||
@RequestMapping("/demo/operate")
|
@RequestMapping("/demo/operate")
|
||||||
public class DemoOperateController extends BaseController
|
public class DemoOperateController extends BaseController
|
||||||
{
|
{
|
||||||
private String prefix = "demo/operate";
|
private String prefix = "demo/operate";
|
||||||
|
|
||||||
private final static Map<Integer, UserOperateModel> users = new LinkedHashMap<Integer, UserOperateModel>();
|
private final static Map<Integer, UserOperateModel> users = new LinkedHashMap<Integer, UserOperateModel>();
|
||||||
{
|
{
|
||||||
users.put(1, new UserOperateModel(1, "1000001", "测试1", "0", "15888888888", "ry@qq.com", 150.0, "0"));
|
users.put(1, new UserOperateModel(1, "1000001", "测试1", "0", "15888888888", "ry@qq.com", 150.0, "0"));
|
||||||
users.put(2, new UserOperateModel(2, "1000002", "测试2", "1", "15666666666", "ry@qq.com", 180.0, "1"));
|
users.put(2, new UserOperateModel(2, "1000002", "测试2", "1", "15666666666", "ry@qq.com", 180.0, "1"));
|
||||||
users.put(3, new UserOperateModel(3, "1000003", "测试3", "0", "15666666666", "ry@qq.com", 110.0, "1"));
|
users.put(3, new UserOperateModel(3, "1000003", "测试3", "0", "15666666666", "ry@qq.com", 110.0, "1"));
|
||||||
users.put(4, new UserOperateModel(4, "1000004", "测试4", "1", "15666666666", "ry@qq.com", 220.0, "1"));
|
users.put(4, new UserOperateModel(4, "1000004", "测试4", "1", "15666666666", "ry@qq.com", 220.0, "1"));
|
||||||
users.put(5, new UserOperateModel(5, "1000005", "测试5", "0", "15666666666", "ry@qq.com", 140.0, "1"));
|
users.put(5, new UserOperateModel(5, "1000005", "测试5", "0", "15666666666", "ry@qq.com", 140.0, "1"));
|
||||||
users.put(6, new UserOperateModel(6, "1000006", "测试6", "1", "15666666666", "ry@qq.com", 330.0, "1"));
|
users.put(6, new UserOperateModel(6, "1000006", "测试6", "1", "15666666666", "ry@qq.com", 330.0, "1"));
|
||||||
users.put(7, new UserOperateModel(7, "1000007", "测试7", "0", "15666666666", "ry@qq.com", 160.0, "1"));
|
users.put(7, new UserOperateModel(7, "1000007", "测试7", "0", "15666666666", "ry@qq.com", 160.0, "1"));
|
||||||
users.put(8, new UserOperateModel(8, "1000008", "测试8", "1", "15666666666", "ry@qq.com", 170.0, "1"));
|
users.put(8, new UserOperateModel(8, "1000008", "测试8", "1", "15666666666", "ry@qq.com", 170.0, "1"));
|
||||||
users.put(9, new UserOperateModel(9, "1000009", "测试9", "0", "15666666666", "ry@qq.com", 180.0, "1"));
|
users.put(9, new UserOperateModel(9, "1000009", "测试9", "0", "15666666666", "ry@qq.com", 180.0, "1"));
|
||||||
users.put(10, new UserOperateModel(10, "1000010", "测试10", "0", "15666666666", "ry@qq.com", 210.0, "1"));
|
users.put(10, new UserOperateModel(10, "1000010", "测试10", "0", "15666666666", "ry@qq.com", 210.0, "1"));
|
||||||
users.put(11, new UserOperateModel(11, "1000011", "测试11", "1", "15666666666", "ry@qq.com", 110.0, "1"));
|
users.put(11, new UserOperateModel(11, "1000011", "测试11", "1", "15666666666", "ry@qq.com", 110.0, "1"));
|
||||||
users.put(12, new UserOperateModel(12, "1000012", "测试12", "0", "15666666666", "ry@qq.com", 120.0, "1"));
|
users.put(12, new UserOperateModel(12, "1000012", "测试12", "0", "15666666666", "ry@qq.com", 120.0, "1"));
|
||||||
users.put(13, new UserOperateModel(13, "1000013", "测试13", "1", "15666666666", "ry@qq.com", 380.0, "1"));
|
users.put(13, new UserOperateModel(13, "1000013", "测试13", "1", "15666666666", "ry@qq.com", 380.0, "1"));
|
||||||
users.put(14, new UserOperateModel(14, "1000014", "测试14", "0", "15666666666", "ry@qq.com", 280.0, "1"));
|
users.put(14, new UserOperateModel(14, "1000014", "测试14", "0", "15666666666", "ry@qq.com", 280.0, "1"));
|
||||||
users.put(15, new UserOperateModel(15, "1000015", "测试15", "0", "15666666666", "ry@qq.com", 570.0, "1"));
|
users.put(15, new UserOperateModel(15, "1000015", "测试15", "0", "15666666666", "ry@qq.com", 570.0, "1"));
|
||||||
users.put(16, new UserOperateModel(16, "1000016", "测试16", "1", "15666666666", "ry@qq.com", 260.0, "1"));
|
users.put(16, new UserOperateModel(16, "1000016", "测试16", "1", "15666666666", "ry@qq.com", 260.0, "1"));
|
||||||
users.put(17, new UserOperateModel(17, "1000017", "测试17", "1", "15666666666", "ry@qq.com", 210.0, "1"));
|
users.put(17, new UserOperateModel(17, "1000017", "测试17", "1", "15666666666", "ry@qq.com", 210.0, "1"));
|
||||||
users.put(18, new UserOperateModel(18, "1000018", "测试18", "1", "15666666666", "ry@qq.com", 340.0, "1"));
|
users.put(18, new UserOperateModel(18, "1000018", "测试18", "1", "15666666666", "ry@qq.com", 340.0, "1"));
|
||||||
users.put(19, new UserOperateModel(19, "1000019", "测试19", "1", "15666666666", "ry@qq.com", 160.0, "1"));
|
users.put(19, new UserOperateModel(19, "1000019", "测试19", "1", "15666666666", "ry@qq.com", 160.0, "1"));
|
||||||
users.put(20, new UserOperateModel(20, "1000020", "测试20", "1", "15666666666", "ry@qq.com", 220.0, "1"));
|
users.put(20, new UserOperateModel(20, "1000020", "测试20", "1", "15666666666", "ry@qq.com", 220.0, "1"));
|
||||||
users.put(21, new UserOperateModel(21, "1000021", "测试21", "1", "15666666666", "ry@qq.com", 120.0, "1"));
|
users.put(21, new UserOperateModel(21, "1000021", "测试21", "1", "15666666666", "ry@qq.com", 120.0, "1"));
|
||||||
users.put(22, new UserOperateModel(22, "1000022", "测试22", "1", "15666666666", "ry@qq.com", 130.0, "1"));
|
users.put(22, new UserOperateModel(22, "1000022", "测试22", "1", "15666666666", "ry@qq.com", 130.0, "1"));
|
||||||
users.put(23, new UserOperateModel(23, "1000023", "测试23", "1", "15666666666", "ry@qq.com", 490.0, "1"));
|
users.put(23, new UserOperateModel(23, "1000023", "测试23", "1", "15666666666", "ry@qq.com", 490.0, "1"));
|
||||||
users.put(24, new UserOperateModel(24, "1000024", "测试24", "1", "15666666666", "ry@qq.com", 570.0, "1"));
|
users.put(24, new UserOperateModel(24, "1000024", "测试24", "1", "15666666666", "ry@qq.com", 570.0, "1"));
|
||||||
users.put(25, new UserOperateModel(25, "1000025", "测试25", "1", "15666666666", "ry@qq.com", 250.0, "1"));
|
users.put(25, new UserOperateModel(25, "1000025", "测试25", "1", "15666666666", "ry@qq.com", 250.0, "1"));
|
||||||
users.put(26, new UserOperateModel(26, "1000026", "测试26", "1", "15666666666", "ry@qq.com", 250.0, "1"));
|
users.put(26, new UserOperateModel(26, "1000026", "测试26", "1", "15666666666", "ry@qq.com", 250.0, "1"));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 表格
|
* 表格
|
||||||
*/
|
*/
|
||||||
@GetMapping("/table")
|
@GetMapping("/table")
|
||||||
public String table()
|
public String table()
|
||||||
{
|
{
|
||||||
return prefix + "/table";
|
return prefix + "/table";
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 其他
|
* 其他
|
||||||
*/
|
*/
|
||||||
@GetMapping("/other")
|
@GetMapping("/other")
|
||||||
public String other()
|
public String other()
|
||||||
{
|
{
|
||||||
return prefix + "/other";
|
return prefix + "/other";
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询数据
|
* 查询数据
|
||||||
*/
|
*/
|
||||||
@PostMapping("/list")
|
@PostMapping("/list")
|
||||||
@ResponseBody
|
@ResponseBody
|
||||||
public TableDataInfo list(UserOperateModel userModel)
|
public TableDataInfo list(UserOperateModel userModel)
|
||||||
{
|
{
|
||||||
TableDataInfo rspData = new TableDataInfo();
|
TableDataInfo rspData = new TableDataInfo();
|
||||||
List<UserOperateModel> userList = new ArrayList<UserOperateModel>(users.values());
|
List<UserOperateModel> userList = new ArrayList<UserOperateModel>(users.values());
|
||||||
// 查询条件过滤
|
// 查询条件过滤
|
||||||
if (StringUtils.isNotEmpty(userModel.getSearchValue()))
|
if (StringUtils.isNotEmpty(userModel.getSearchValue()))
|
||||||
{
|
{
|
||||||
userList.clear();
|
userList.clear();
|
||||||
for (Map.Entry<Integer, UserOperateModel> entry : users.entrySet())
|
for (Map.Entry<Integer, UserOperateModel> entry : users.entrySet())
|
||||||
{
|
{
|
||||||
if (entry.getValue().getUserName().equals(userModel.getSearchValue()))
|
if (entry.getValue().getUserName().equals(userModel.getSearchValue()))
|
||||||
{
|
{
|
||||||
userList.add(entry.getValue());
|
userList.add(entry.getValue());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (StringUtils.isNotEmpty(userModel.getUserName()))
|
else if (StringUtils.isNotEmpty(userModel.getUserName()))
|
||||||
{
|
{
|
||||||
userList.clear();
|
userList.clear();
|
||||||
for (Map.Entry<Integer, UserOperateModel> entry : users.entrySet())
|
for (Map.Entry<Integer, UserOperateModel> entry : users.entrySet())
|
||||||
{
|
{
|
||||||
if (entry.getValue().getUserName().equals(userModel.getUserName()))
|
if (entry.getValue().getUserName().equals(userModel.getUserName()))
|
||||||
{
|
{
|
||||||
userList.add(entry.getValue());
|
userList.add(entry.getValue());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
PageDomain pageDomain = TableSupport.buildPageRequest();
|
PageDomain pageDomain = TableSupport.buildPageRequest();
|
||||||
if (null == pageDomain.getPageNum() || null == pageDomain.getPageSize())
|
if (null == pageDomain.getPageNum() || null == pageDomain.getPageSize())
|
||||||
{
|
{
|
||||||
rspData.setRows(userList);
|
rspData.setRows(userList);
|
||||||
rspData.setTotal(userList.size());
|
rspData.setTotal(userList.size());
|
||||||
return rspData;
|
return rspData;
|
||||||
}
|
}
|
||||||
Integer pageNum = (pageDomain.getPageNum() - 1) * 10;
|
Integer pageNum = (pageDomain.getPageNum() - 1) * 10;
|
||||||
Integer pageSize = pageDomain.getPageNum() * 10;
|
Integer pageSize = pageDomain.getPageNum() * 10;
|
||||||
if (pageSize > userList.size())
|
if (pageSize > userList.size())
|
||||||
{
|
{
|
||||||
pageSize = userList.size();
|
pageSize = userList.size();
|
||||||
}
|
}
|
||||||
rspData.setRows(userList.subList(pageNum, pageSize));
|
rspData.setRows(userList.subList(pageNum, pageSize));
|
||||||
rspData.setTotal(userList.size());
|
rspData.setTotal(userList.size());
|
||||||
return rspData;
|
return rspData;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 新增用户
|
* 新增用户
|
||||||
*/
|
*/
|
||||||
@GetMapping("/add")
|
@GetMapping("/add")
|
||||||
public String add(ModelMap mmap)
|
public String add(ModelMap mmap)
|
||||||
{
|
{
|
||||||
return prefix + "/add";
|
return prefix + "/add";
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 新增保存用户
|
* 新增保存用户
|
||||||
*/
|
*/
|
||||||
@PostMapping("/add")
|
@PostMapping("/add")
|
||||||
@ResponseBody
|
@ResponseBody
|
||||||
public AjaxResult addSave(UserOperateModel user)
|
public AjaxResult addSave(UserOperateModel user)
|
||||||
{
|
{
|
||||||
Integer userId = users.size() + 1;
|
Integer userId = users.size() + 1;
|
||||||
user.setUserId(userId);
|
user.setUserId(userId);
|
||||||
return AjaxResult.success(users.put(userId, user));
|
return AjaxResult.success(users.put(userId, user));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 新增保存主子表信息
|
* 新增保存主子表信息
|
||||||
*/
|
*/
|
||||||
@PostMapping("/customer/add")
|
@PostMapping("/customer/add")
|
||||||
@ResponseBody
|
@ResponseBody
|
||||||
public AjaxResult addSave(CustomerModel customerModel)
|
public AjaxResult addSave(CustomerModel customerModel)
|
||||||
{
|
{
|
||||||
System.out.println(customerModel.toString());
|
System.out.println(customerModel.toString());
|
||||||
return AjaxResult.success();
|
return AjaxResult.success();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 修改用户
|
* 修改用户
|
||||||
*/
|
*/
|
||||||
@GetMapping("/edit/{userId}")
|
@GetMapping("/edit/{userId}")
|
||||||
public String edit(@PathVariable("userId") Integer userId, ModelMap mmap)
|
public String edit(@PathVariable("userId") Integer userId, ModelMap mmap)
|
||||||
{
|
{
|
||||||
mmap.put("user", users.get(userId));
|
mmap.put("user", users.get(userId));
|
||||||
return prefix + "/edit";
|
return prefix + "/edit";
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 修改保存用户
|
* 修改保存用户
|
||||||
*/
|
*/
|
||||||
@PostMapping("/edit")
|
@PostMapping("/edit")
|
||||||
@ResponseBody
|
@ResponseBody
|
||||||
public AjaxResult editSave(UserOperateModel user)
|
public AjaxResult editSave(UserOperateModel user)
|
||||||
{
|
{
|
||||||
return AjaxResult.success(users.put(user.getUserId(), user));
|
return AjaxResult.success(users.put(user.getUserId(), user));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 导出
|
* 导出
|
||||||
*/
|
*/
|
||||||
@PostMapping("/export")
|
@PostMapping("/export")
|
||||||
@ResponseBody
|
@ResponseBody
|
||||||
public AjaxResult export(UserOperateModel user)
|
public AjaxResult export(UserOperateModel user)
|
||||||
{
|
{
|
||||||
List<UserOperateModel> list = new ArrayList<UserOperateModel>(users.values());
|
List<UserOperateModel> list = new ArrayList<UserOperateModel>(users.values());
|
||||||
ExcelUtil<UserOperateModel> util = new ExcelUtil<UserOperateModel>(UserOperateModel.class);
|
ExcelUtil<UserOperateModel> util = new ExcelUtil<UserOperateModel>(UserOperateModel.class);
|
||||||
return util.exportExcel(list, "用户数据");
|
return util.exportExcel(list, "用户数据");
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 下载模板
|
* 下载模板
|
||||||
*/
|
*/
|
||||||
@GetMapping("/importTemplate")
|
@GetMapping("/importTemplate")
|
||||||
@ResponseBody
|
@ResponseBody
|
||||||
public AjaxResult importTemplate()
|
public AjaxResult importTemplate()
|
||||||
{
|
{
|
||||||
ExcelUtil<UserOperateModel> util = new ExcelUtil<UserOperateModel>(UserOperateModel.class);
|
ExcelUtil<UserOperateModel> util = new ExcelUtil<UserOperateModel>(UserOperateModel.class);
|
||||||
return util.importTemplateExcel("用户数据");
|
return util.importTemplateExcel("用户数据");
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 导入数据
|
* 导入数据
|
||||||
*/
|
*/
|
||||||
@PostMapping("/importData")
|
@PostMapping("/importData")
|
||||||
@ResponseBody
|
@ResponseBody
|
||||||
public AjaxResult importData(MultipartFile file, boolean updateSupport) throws Exception
|
public AjaxResult importData(MultipartFile file, boolean updateSupport) throws Exception
|
||||||
{
|
{
|
||||||
ExcelUtil<UserOperateModel> util = new ExcelUtil<UserOperateModel>(UserOperateModel.class);
|
ExcelUtil<UserOperateModel> util = new ExcelUtil<UserOperateModel>(UserOperateModel.class);
|
||||||
List<UserOperateModel> userList = util.importExcel(file.getInputStream());
|
List<UserOperateModel> userList = util.importExcel(file.getInputStream());
|
||||||
String message = importUser(userList, updateSupport);
|
String message = importUser(userList, updateSupport);
|
||||||
return AjaxResult.success(message);
|
return AjaxResult.success(message);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 删除用户
|
* 删除用户
|
||||||
*/
|
*/
|
||||||
@PostMapping("/remove")
|
@PostMapping("/remove")
|
||||||
@ResponseBody
|
@ResponseBody
|
||||||
public AjaxResult remove(String ids)
|
public AjaxResult remove(String ids)
|
||||||
{
|
{
|
||||||
Integer[] userIds = Convert.toIntArray(ids);
|
Integer[] userIds = Convert.toIntArray(ids);
|
||||||
for (Integer userId : userIds)
|
for (Integer userId : userIds)
|
||||||
{
|
{
|
||||||
users.remove(userId);
|
users.remove(userId);
|
||||||
}
|
}
|
||||||
return AjaxResult.success();
|
return AjaxResult.success();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查看详细
|
* 查看详细
|
||||||
*/
|
*/
|
||||||
@GetMapping("/detail/{userId}")
|
@GetMapping("/detail/{userId}")
|
||||||
public String detail(@PathVariable("userId") Integer userId, ModelMap mmap)
|
public String detail(@PathVariable("userId") Integer userId, ModelMap mmap)
|
||||||
{
|
{
|
||||||
mmap.put("user", users.get(userId));
|
mmap.put("user", users.get(userId));
|
||||||
return prefix + "/detail";
|
return prefix + "/detail";
|
||||||
}
|
}
|
||||||
|
|
||||||
@PostMapping("/clean")
|
@PostMapping("/clean")
|
||||||
@ResponseBody
|
@ResponseBody
|
||||||
public AjaxResult clean()
|
public AjaxResult clean()
|
||||||
{
|
{
|
||||||
users.clear();
|
users.clear();
|
||||||
return success();
|
return success();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 导入用户数据
|
* 导入用户数据
|
||||||
*
|
*
|
||||||
* @param userList 用户数据列表
|
* @param userList 用户数据列表
|
||||||
* @param isUpdateSupport 是否更新支持,如果已存在,则进行更新数据
|
* @param isUpdateSupport 是否更新支持,如果已存在,则进行更新数据
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
public String importUser(List<UserOperateModel> userList, Boolean isUpdateSupport)
|
public String importUser(List<UserOperateModel> userList, Boolean isUpdateSupport)
|
||||||
{
|
{
|
||||||
if (StringUtils.isNull(userList) || userList.size() == 0)
|
if (StringUtils.isNull(userList) || userList.size() == 0)
|
||||||
{
|
{
|
||||||
throw new BusinessException("导入用户数据不能为空!");
|
throw new BusinessException("导入用户数据不能为空!");
|
||||||
}
|
}
|
||||||
int successNum = 0;
|
int successNum = 0;
|
||||||
int failureNum = 0;
|
int failureNum = 0;
|
||||||
StringBuilder successMsg = new StringBuilder();
|
StringBuilder successMsg = new StringBuilder();
|
||||||
StringBuilder failureMsg = new StringBuilder();
|
StringBuilder failureMsg = new StringBuilder();
|
||||||
for (UserOperateModel user : userList)
|
for (UserOperateModel user : userList)
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
// 验证是否存在这个用户
|
// 验证是否存在这个用户
|
||||||
boolean userFlag = false;
|
boolean userFlag = false;
|
||||||
for (Map.Entry<Integer, UserOperateModel> entry : users.entrySet())
|
for (Map.Entry<Integer, UserOperateModel> entry : users.entrySet())
|
||||||
{
|
{
|
||||||
if (entry.getValue().getUserName().equals(user.getUserName()))
|
if (entry.getValue().getUserName().equals(user.getUserName()))
|
||||||
{
|
{
|
||||||
userFlag = true;
|
userFlag = true;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!userFlag)
|
if (!userFlag)
|
||||||
{
|
{
|
||||||
Integer userId = users.size() + 1;
|
Integer userId = users.size() + 1;
|
||||||
user.setUserId(userId);
|
user.setUserId(userId);
|
||||||
users.put(userId, user);
|
users.put(userId, user);
|
||||||
successNum++;
|
successNum++;
|
||||||
successMsg.append("<br/>" + successNum + "、用户 " + user.getUserName() + " 导入成功");
|
successMsg.append("<br/>" + successNum + "、用户 " + user.getUserName() + " 导入成功");
|
||||||
}
|
}
|
||||||
else if (isUpdateSupport)
|
else if (isUpdateSupport)
|
||||||
{
|
{
|
||||||
users.put(user.getUserId(), user);
|
users.put(user.getUserId(), user);
|
||||||
successNum++;
|
successNum++;
|
||||||
successMsg.append("<br/>" + successNum + "、用户 " + user.getUserName() + " 更新成功");
|
successMsg.append("<br/>" + successNum + "、用户 " + user.getUserName() + " 更新成功");
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
failureNum++;
|
failureNum++;
|
||||||
failureMsg.append("<br/>" + failureNum + "、用户 " + user.getUserName() + " 已存在");
|
failureMsg.append("<br/>" + failureNum + "、用户 " + user.getUserName() + " 已存在");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
{
|
{
|
||||||
failureNum++;
|
failureNum++;
|
||||||
String msg = "<br/>" + failureNum + "、账号 " + user.getUserName() + " 导入失败:";
|
String msg = "<br/>" + failureNum + "、账号 " + user.getUserName() + " 导入失败:";
|
||||||
failureMsg.append(msg + e.getMessage());
|
failureMsg.append(msg + e.getMessage());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (failureNum > 0)
|
if (failureNum > 0)
|
||||||
{
|
{
|
||||||
failureMsg.insert(0, "很抱歉,导入失败!共 " + failureNum + " 条数据格式不正确,错误如下:");
|
failureMsg.insert(0, "很抱歉,导入失败!共 " + failureNum + " 条数据格式不正确,错误如下:");
|
||||||
throw new BusinessException(failureMsg.toString());
|
throw new BusinessException(failureMsg.toString());
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
successMsg.insert(0, "恭喜您,数据已全部导入成功!共 " + successNum + " 条,数据如下:");
|
successMsg.insert(0, "恭喜您,数据已全部导入成功!共 " + successNum + " 条,数据如下:");
|
||||||
}
|
}
|
||||||
return successMsg.toString();
|
return successMsg.toString();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,53 +1,48 @@
|
||||||
package com.ruoyi.web.controller.demo.controller;
|
package com.ruoyi.web.controller.demo.controller;
|
||||||
|
|
||||||
import org.springframework.stereotype.Controller;
|
import org.springframework.stereotype.Controller;
|
||||||
import org.springframework.web.bind.annotation.GetMapping;
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 报表
|
* 报表
|
||||||
*
|
*
|
||||||
* @author ruoyi
|
* @author ruoyi
|
||||||
*/
|
*/
|
||||||
@Controller
|
@Controller
|
||||||
@RequestMapping("/demo/report")
|
@RequestMapping("/demo/report")
|
||||||
public class DemoReportController
|
public class DemoReportController {
|
||||||
{
|
private String prefix = "demo/report";
|
||||||
private String prefix = "demo/report";
|
|
||||||
|
/**
|
||||||
/**
|
* 百度ECharts
|
||||||
* 百度ECharts
|
*/
|
||||||
*/
|
@GetMapping("/echarts")
|
||||||
@GetMapping("/echarts")
|
public String echarts() {
|
||||||
public String echarts()
|
return prefix + "/echarts";
|
||||||
{
|
}
|
||||||
return prefix + "/echarts";
|
|
||||||
}
|
/**
|
||||||
|
* 图表插件
|
||||||
/**
|
*/
|
||||||
* 图表插件
|
@GetMapping("/peity")
|
||||||
*/
|
public String peity() {
|
||||||
@GetMapping("/peity")
|
return prefix + "/peity";
|
||||||
public String peity()
|
}
|
||||||
{
|
|
||||||
return prefix + "/peity";
|
/**
|
||||||
}
|
* 线状图插件
|
||||||
|
*/
|
||||||
/**
|
@GetMapping("/sparkline")
|
||||||
* 线状图插件
|
public String sparkline() {
|
||||||
*/
|
return prefix + "/sparkline";
|
||||||
@GetMapping("/sparkline")
|
}
|
||||||
public String sparkline()
|
|
||||||
{
|
/**
|
||||||
return prefix + "/sparkline";
|
* 图表组合
|
||||||
}
|
*/
|
||||||
|
@GetMapping("/metrics")
|
||||||
/**
|
public String metrics() {
|
||||||
* 图表组合
|
return prefix + "/metrics";
|
||||||
*/
|
}
|
||||||
@GetMapping("/metrics")
|
}
|
||||||
public String metrics()
|
|
||||||
{
|
|
||||||
return prefix + "/metrics";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
|
||||||
|
|
@ -1,450 +1,450 @@
|
||||||
package com.ruoyi.web.controller.demo.controller;
|
package com.ruoyi.web.controller.demo.controller;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import org.springframework.stereotype.Controller;
|
import org.springframework.stereotype.Controller;
|
||||||
import org.springframework.ui.ModelMap;
|
import org.springframework.ui.ModelMap;
|
||||||
import org.springframework.web.bind.annotation.GetMapping;
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
import org.springframework.web.bind.annotation.PostMapping;
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
import org.springframework.web.bind.annotation.ResponseBody;
|
import org.springframework.web.bind.annotation.ResponseBody;
|
||||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
import com.ruoyi.common.core.controller.BaseController;
|
import com.ruoyi.common.core.controller.BaseController;
|
||||||
import com.ruoyi.common.core.page.PageDomain;
|
import com.ruoyi.common.core.page.PageDomain;
|
||||||
import com.ruoyi.common.core.page.TableDataInfo;
|
import com.ruoyi.common.core.page.TableDataInfo;
|
||||||
import com.ruoyi.common.core.page.TableSupport;
|
import com.ruoyi.common.core.page.TableSupport;
|
||||||
import com.ruoyi.common.utils.DateUtils;
|
import com.ruoyi.common.utils.DateUtils;
|
||||||
import com.ruoyi.common.utils.StringUtils;
|
import com.ruoyi.common.utils.StringUtils;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 表格相关
|
* 表格相关
|
||||||
*
|
*
|
||||||
* @author ruoyi
|
* @author ruoyi
|
||||||
*/
|
*/
|
||||||
@Controller
|
@Controller
|
||||||
@RequestMapping("/demo/table")
|
@RequestMapping("/demo/table")
|
||||||
public class DemoTableController extends BaseController
|
public class DemoTableController extends BaseController
|
||||||
{
|
{
|
||||||
private String prefix = "demo/table";
|
private String prefix = "demo/table";
|
||||||
|
|
||||||
private final static List<UserTableModel> users = new ArrayList<UserTableModel>();
|
private final static List<UserTableModel> users = new ArrayList<UserTableModel>();
|
||||||
{
|
{
|
||||||
users.add(new UserTableModel(1, "1000001", "测试1", "0", "15888888888", "ry@qq.com", 150.0, "0"));
|
users.add(new UserTableModel(1, "1000001", "测试1", "0", "15888888888", "ry@qq.com", 150.0, "0"));
|
||||||
users.add(new UserTableModel(2, "1000002", "测试2", "1", "15666666666", "ry@qq.com", 180.0, "1"));
|
users.add(new UserTableModel(2, "1000002", "测试2", "1", "15666666666", "ry@qq.com", 180.0, "1"));
|
||||||
users.add(new UserTableModel(3, "1000003", "测试3", "0", "15666666666", "ry@qq.com", 110.0, "1"));
|
users.add(new UserTableModel(3, "1000003", "测试3", "0", "15666666666", "ry@qq.com", 110.0, "1"));
|
||||||
users.add(new UserTableModel(4, "1000004", "测试4", "1", "15666666666", "ry@qq.com", 220.0, "1"));
|
users.add(new UserTableModel(4, "1000004", "测试4", "1", "15666666666", "ry@qq.com", 220.0, "1"));
|
||||||
users.add(new UserTableModel(5, "1000005", "测试5", "0", "15666666666", "ry@qq.com", 140.0, "1"));
|
users.add(new UserTableModel(5, "1000005", "测试5", "0", "15666666666", "ry@qq.com", 140.0, "1"));
|
||||||
users.add(new UserTableModel(6, "1000006", "测试6", "1", "15666666666", "ry@qq.com", 330.0, "1"));
|
users.add(new UserTableModel(6, "1000006", "测试6", "1", "15666666666", "ry@qq.com", 330.0, "1"));
|
||||||
users.add(new UserTableModel(7, "1000007", "测试7", "0", "15666666666", "ry@qq.com", 160.0, "1"));
|
users.add(new UserTableModel(7, "1000007", "测试7", "0", "15666666666", "ry@qq.com", 160.0, "1"));
|
||||||
users.add(new UserTableModel(8, "1000008", "测试8", "1", "15666666666", "ry@qq.com", 170.0, "1"));
|
users.add(new UserTableModel(8, "1000008", "测试8", "1", "15666666666", "ry@qq.com", 170.0, "1"));
|
||||||
users.add(new UserTableModel(9, "1000009", "测试9", "0", "15666666666", "ry@qq.com", 180.0, "1"));
|
users.add(new UserTableModel(9, "1000009", "测试9", "0", "15666666666", "ry@qq.com", 180.0, "1"));
|
||||||
users.add(new UserTableModel(10, "1000010", "测试10", "0", "15666666666", "ry@qq.com", 210.0, "1"));
|
users.add(new UserTableModel(10, "1000010", "测试10", "0", "15666666666", "ry@qq.com", 210.0, "1"));
|
||||||
users.add(new UserTableModel(11, "1000011", "测试11", "1", "15666666666", "ry@qq.com", 110.0, "1"));
|
users.add(new UserTableModel(11, "1000011", "测试11", "1", "15666666666", "ry@qq.com", 110.0, "1"));
|
||||||
users.add(new UserTableModel(12, "1000012", "测试12", "0", "15666666666", "ry@qq.com", 120.0, "1"));
|
users.add(new UserTableModel(12, "1000012", "测试12", "0", "15666666666", "ry@qq.com", 120.0, "1"));
|
||||||
users.add(new UserTableModel(13, "1000013", "测试13", "1", "15666666666", "ry@qq.com", 380.0, "1"));
|
users.add(new UserTableModel(13, "1000013", "测试13", "1", "15666666666", "ry@qq.com", 380.0, "1"));
|
||||||
users.add(new UserTableModel(14, "1000014", "测试14", "0", "15666666666", "ry@qq.com", 280.0, "1"));
|
users.add(new UserTableModel(14, "1000014", "测试14", "0", "15666666666", "ry@qq.com", 280.0, "1"));
|
||||||
users.add(new UserTableModel(15, "1000015", "测试15", "0", "15666666666", "ry@qq.com", 570.0, "1"));
|
users.add(new UserTableModel(15, "1000015", "测试15", "0", "15666666666", "ry@qq.com", 570.0, "1"));
|
||||||
users.add(new UserTableModel(16, "1000016", "测试16", "1", "15666666666", "ry@qq.com", 260.0, "1"));
|
users.add(new UserTableModel(16, "1000016", "测试16", "1", "15666666666", "ry@qq.com", 260.0, "1"));
|
||||||
users.add(new UserTableModel(17, "1000017", "测试17", "1", "15666666666", "ry@qq.com", 210.0, "1"));
|
users.add(new UserTableModel(17, "1000017", "测试17", "1", "15666666666", "ry@qq.com", 210.0, "1"));
|
||||||
users.add(new UserTableModel(18, "1000018", "测试18", "1", "15666666666", "ry@qq.com", 340.0, "1"));
|
users.add(new UserTableModel(18, "1000018", "测试18", "1", "15666666666", "ry@qq.com", 340.0, "1"));
|
||||||
users.add(new UserTableModel(19, "1000019", "测试19", "1", "15666666666", "ry@qq.com", 160.0, "1"));
|
users.add(new UserTableModel(19, "1000019", "测试19", "1", "15666666666", "ry@qq.com", 160.0, "1"));
|
||||||
users.add(new UserTableModel(20, "1000020", "测试20", "1", "15666666666", "ry@qq.com", 220.0, "1"));
|
users.add(new UserTableModel(20, "1000020", "测试20", "1", "15666666666", "ry@qq.com", 220.0, "1"));
|
||||||
users.add(new UserTableModel(21, "1000021", "测试21", "1", "15666666666", "ry@qq.com", 120.0, "1"));
|
users.add(new UserTableModel(21, "1000021", "测试21", "1", "15666666666", "ry@qq.com", 120.0, "1"));
|
||||||
users.add(new UserTableModel(22, "1000022", "测试22", "1", "15666666666", "ry@qq.com", 130.0, "1"));
|
users.add(new UserTableModel(22, "1000022", "测试22", "1", "15666666666", "ry@qq.com", 130.0, "1"));
|
||||||
users.add(new UserTableModel(23, "1000023", "测试23", "1", "15666666666", "ry@qq.com", 490.0, "1"));
|
users.add(new UserTableModel(23, "1000023", "测试23", "1", "15666666666", "ry@qq.com", 490.0, "1"));
|
||||||
users.add(new UserTableModel(24, "1000024", "测试24", "1", "15666666666", "ry@qq.com", 570.0, "1"));
|
users.add(new UserTableModel(24, "1000024", "测试24", "1", "15666666666", "ry@qq.com", 570.0, "1"));
|
||||||
users.add(new UserTableModel(25, "1000025", "测试25", "1", "15666666666", "ry@qq.com", 250.0, "1"));
|
users.add(new UserTableModel(25, "1000025", "测试25", "1", "15666666666", "ry@qq.com", 250.0, "1"));
|
||||||
users.add(new UserTableModel(26, "1000026", "测试26", "1", "15666666666", "ry@qq.com", 250.0, "1"));
|
users.add(new UserTableModel(26, "1000026", "测试26", "1", "15666666666", "ry@qq.com", 250.0, "1"));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 搜索相关
|
* 搜索相关
|
||||||
*/
|
*/
|
||||||
@GetMapping("/search")
|
@GetMapping("/search")
|
||||||
public String search()
|
public String search()
|
||||||
{
|
{
|
||||||
return prefix + "/search";
|
return prefix + "/search";
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 数据汇总
|
* 数据汇总
|
||||||
*/
|
*/
|
||||||
@GetMapping("/footer")
|
@GetMapping("/footer")
|
||||||
public String footer()
|
public String footer()
|
||||||
{
|
{
|
||||||
return prefix + "/footer";
|
return prefix + "/footer";
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 组合表头
|
* 组合表头
|
||||||
*/
|
*/
|
||||||
@GetMapping("/groupHeader")
|
@GetMapping("/groupHeader")
|
||||||
public String groupHeader()
|
public String groupHeader()
|
||||||
{
|
{
|
||||||
return prefix + "/groupHeader";
|
return prefix + "/groupHeader";
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 表格导出
|
* 表格导出
|
||||||
*/
|
*/
|
||||||
@GetMapping("/export")
|
@GetMapping("/export")
|
||||||
public String export()
|
public String export()
|
||||||
{
|
{
|
||||||
return prefix + "/export";
|
return prefix + "/export";
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 翻页记住选择
|
* 翻页记住选择
|
||||||
*/
|
*/
|
||||||
@GetMapping("/remember")
|
@GetMapping("/remember")
|
||||||
public String remember()
|
public String remember()
|
||||||
{
|
{
|
||||||
return prefix + "/remember";
|
return prefix + "/remember";
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 跳转至指定页
|
* 跳转至指定页
|
||||||
*/
|
*/
|
||||||
@GetMapping("/pageGo")
|
@GetMapping("/pageGo")
|
||||||
public String pageGo()
|
public String pageGo()
|
||||||
{
|
{
|
||||||
return prefix + "/pageGo";
|
return prefix + "/pageGo";
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 自定义查询参数
|
* 自定义查询参数
|
||||||
*/
|
*/
|
||||||
@GetMapping("/params")
|
@GetMapping("/params")
|
||||||
public String params()
|
public String params()
|
||||||
{
|
{
|
||||||
return prefix + "/params";
|
return prefix + "/params";
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 多表格
|
* 多表格
|
||||||
*/
|
*/
|
||||||
@GetMapping("/multi")
|
@GetMapping("/multi")
|
||||||
public String multi()
|
public String multi()
|
||||||
{
|
{
|
||||||
return prefix + "/multi";
|
return prefix + "/multi";
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 点击按钮加载表格
|
* 点击按钮加载表格
|
||||||
*/
|
*/
|
||||||
@GetMapping("/button")
|
@GetMapping("/button")
|
||||||
public String button()
|
public String button()
|
||||||
{
|
{
|
||||||
return prefix + "/button";
|
return prefix + "/button";
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 直接加载表格数据
|
* 直接加载表格数据
|
||||||
*/
|
*/
|
||||||
@GetMapping("/data")
|
@GetMapping("/data")
|
||||||
public String data(ModelMap mmap)
|
public String data(ModelMap mmap)
|
||||||
{
|
{
|
||||||
mmap.put("users", users);
|
mmap.put("users", users);
|
||||||
return prefix + "/data";
|
return prefix + "/data";
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 表格冻结列
|
* 表格冻结列
|
||||||
*/
|
*/
|
||||||
@GetMapping("/fixedColumns")
|
@GetMapping("/fixedColumns")
|
||||||
public String fixedColumns()
|
public String fixedColumns()
|
||||||
{
|
{
|
||||||
return prefix + "/fixedColumns";
|
return prefix + "/fixedColumns";
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 自定义触发事件
|
* 自定义触发事件
|
||||||
*/
|
*/
|
||||||
@GetMapping("/event")
|
@GetMapping("/event")
|
||||||
public String event()
|
public String event()
|
||||||
{
|
{
|
||||||
return prefix + "/event";
|
return prefix + "/event";
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 表格细节视图
|
* 表格细节视图
|
||||||
*/
|
*/
|
||||||
@GetMapping("/detail")
|
@GetMapping("/detail")
|
||||||
public String detail()
|
public String detail()
|
||||||
{
|
{
|
||||||
return prefix + "/detail";
|
return prefix + "/detail";
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 表格父子视图
|
* 表格父子视图
|
||||||
*/
|
*/
|
||||||
@GetMapping("/child")
|
@GetMapping("/child")
|
||||||
public String child()
|
public String child()
|
||||||
{
|
{
|
||||||
return prefix + "/child";
|
return prefix + "/child";
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 表格图片预览
|
* 表格图片预览
|
||||||
*/
|
*/
|
||||||
@GetMapping("/image")
|
@GetMapping("/image")
|
||||||
public String image()
|
public String image()
|
||||||
{
|
{
|
||||||
return prefix + "/image";
|
return prefix + "/image";
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 动态增删改查
|
* 动态增删改查
|
||||||
*/
|
*/
|
||||||
@GetMapping("/curd")
|
@GetMapping("/curd")
|
||||||
public String curd()
|
public String curd()
|
||||||
{
|
{
|
||||||
return prefix + "/curd";
|
return prefix + "/curd";
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 表格拖拽操作
|
* 表格拖拽操作
|
||||||
*/
|
*/
|
||||||
@GetMapping("/reorder")
|
@GetMapping("/reorder")
|
||||||
public String reorder()
|
public String reorder()
|
||||||
{
|
{
|
||||||
return prefix + "/reorder";
|
return prefix + "/reorder";
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 表格行内编辑操作
|
* 表格行内编辑操作
|
||||||
*/
|
*/
|
||||||
@GetMapping("/editable")
|
@GetMapping("/editable")
|
||||||
public String editable()
|
public String editable()
|
||||||
{
|
{
|
||||||
return prefix + "/editable";
|
return prefix + "/editable";
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 主子表提交
|
* 主子表提交
|
||||||
*/
|
*/
|
||||||
@GetMapping("/subdata")
|
@GetMapping("/subdata")
|
||||||
public String subdata()
|
public String subdata()
|
||||||
{
|
{
|
||||||
return prefix + "/subdata";
|
return prefix + "/subdata";
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 表格自动刷新
|
* 表格自动刷新
|
||||||
*/
|
*/
|
||||||
@GetMapping("/refresh")
|
@GetMapping("/refresh")
|
||||||
public String refresh()
|
public String refresh()
|
||||||
{
|
{
|
||||||
return prefix + "/refresh";
|
return prefix + "/refresh";
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 表格打印配置
|
* 表格打印配置
|
||||||
*/
|
*/
|
||||||
@GetMapping("/print")
|
@GetMapping("/print")
|
||||||
public String print()
|
public String print()
|
||||||
{
|
{
|
||||||
return prefix + "/print";
|
return prefix + "/print";
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 表格标题格式化
|
* 表格标题格式化
|
||||||
*/
|
*/
|
||||||
@GetMapping("/headerStyle")
|
@GetMapping("/headerStyle")
|
||||||
public String headerStyle()
|
public String headerStyle()
|
||||||
{
|
{
|
||||||
return prefix + "/headerStyle";
|
return prefix + "/headerStyle";
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 表格其他操作
|
* 表格其他操作
|
||||||
*/
|
*/
|
||||||
@GetMapping("/other")
|
@GetMapping("/other")
|
||||||
public String other()
|
public String other()
|
||||||
{
|
{
|
||||||
return prefix + "/other";
|
return prefix + "/other";
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询数据
|
* 查询数据
|
||||||
*/
|
*/
|
||||||
@PostMapping("/list")
|
@PostMapping("/list")
|
||||||
@ResponseBody
|
@ResponseBody
|
||||||
public TableDataInfo list(UserTableModel userModel)
|
public TableDataInfo list(UserTableModel userModel)
|
||||||
{
|
{
|
||||||
TableDataInfo rspData = new TableDataInfo();
|
TableDataInfo rspData = new TableDataInfo();
|
||||||
List<UserTableModel> userList = new ArrayList<UserTableModel>(Arrays.asList(new UserTableModel[users.size()]));
|
List<UserTableModel> userList = new ArrayList<UserTableModel>(Arrays.asList(new UserTableModel[users.size()]));
|
||||||
Collections.copy(userList, users);
|
Collections.copy(userList, users);
|
||||||
// 查询条件过滤
|
// 查询条件过滤
|
||||||
if (StringUtils.isNotEmpty(userModel.getUserName()))
|
if (StringUtils.isNotEmpty(userModel.getUserName()))
|
||||||
{
|
{
|
||||||
userList.clear();
|
userList.clear();
|
||||||
for (UserTableModel user : users)
|
for (UserTableModel user : users)
|
||||||
{
|
{
|
||||||
if (user.getUserName().equals(userModel.getUserName()))
|
if (user.getUserName().equals(userModel.getUserName()))
|
||||||
{
|
{
|
||||||
userList.add(user);
|
userList.add(user);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
PageDomain pageDomain = TableSupport.buildPageRequest();
|
PageDomain pageDomain = TableSupport.buildPageRequest();
|
||||||
if (null == pageDomain.getPageNum() || null == pageDomain.getPageSize())
|
if (null == pageDomain.getPageNum() || null == pageDomain.getPageSize())
|
||||||
{
|
{
|
||||||
rspData.setRows(userList);
|
rspData.setRows(userList);
|
||||||
rspData.setTotal(userList.size());
|
rspData.setTotal(userList.size());
|
||||||
return rspData;
|
return rspData;
|
||||||
}
|
}
|
||||||
Integer pageNum = (pageDomain.getPageNum() - 1) * 10;
|
Integer pageNum = (pageDomain.getPageNum() - 1) * 10;
|
||||||
Integer pageSize = pageDomain.getPageNum() * 10;
|
Integer pageSize = pageDomain.getPageNum() * 10;
|
||||||
if (pageSize > userList.size())
|
if (pageSize > userList.size())
|
||||||
{
|
{
|
||||||
pageSize = userList.size();
|
pageSize = userList.size();
|
||||||
}
|
}
|
||||||
rspData.setRows(userList.subList(pageNum, pageSize));
|
rspData.setRows(userList.subList(pageNum, pageSize));
|
||||||
rspData.setTotal(userList.size());
|
rspData.setTotal(userList.size());
|
||||||
return rspData;
|
return rspData;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
class UserTableModel
|
class UserTableModel
|
||||||
{
|
{
|
||||||
/** 用户ID */
|
/** 用户ID */
|
||||||
private int userId;
|
private int userId;
|
||||||
|
|
||||||
/** 用户编号 */
|
/** 用户编号 */
|
||||||
private String userCode;
|
private String userCode;
|
||||||
|
|
||||||
/** 用户姓名 */
|
/** 用户姓名 */
|
||||||
private String userName;
|
private String userName;
|
||||||
|
|
||||||
/** 用户性别 */
|
/** 用户性别 */
|
||||||
private String userSex;
|
private String userSex;
|
||||||
|
|
||||||
/** 用户手机 */
|
/** 用户手机 */
|
||||||
private String userPhone;
|
private String userPhone;
|
||||||
|
|
||||||
/** 用户邮箱 */
|
/** 用户邮箱 */
|
||||||
private String userEmail;
|
private String userEmail;
|
||||||
|
|
||||||
/** 用户余额 */
|
/** 用户余额 */
|
||||||
private double userBalance;
|
private double userBalance;
|
||||||
|
|
||||||
/** 用户状态(0正常 1停用) */
|
/** 用户状态(0正常 1停用) */
|
||||||
private String status;
|
private String status;
|
||||||
|
|
||||||
/** 创建时间 */
|
/** 创建时间 */
|
||||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
private Date createTime;
|
private Date createTime;
|
||||||
|
|
||||||
public UserTableModel()
|
public UserTableModel()
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public UserTableModel(int userId, String userCode, String userName, String userSex, String userPhone,
|
public UserTableModel(int userId, String userCode, String userName, String userSex, String userPhone,
|
||||||
String userEmail, double userBalance, String status)
|
String userEmail, double userBalance, String status)
|
||||||
{
|
{
|
||||||
this.userId = userId;
|
this.userId = userId;
|
||||||
this.userCode = userCode;
|
this.userCode = userCode;
|
||||||
this.userName = userName;
|
this.userName = userName;
|
||||||
this.userSex = userSex;
|
this.userSex = userSex;
|
||||||
this.userPhone = userPhone;
|
this.userPhone = userPhone;
|
||||||
this.userEmail = userEmail;
|
this.userEmail = userEmail;
|
||||||
this.userBalance = userBalance;
|
this.userBalance = userBalance;
|
||||||
this.status = status;
|
this.status = status;
|
||||||
this.createTime = DateUtils.getNowDate();
|
this.createTime = DateUtils.getNowDate();
|
||||||
}
|
}
|
||||||
|
|
||||||
public int getUserId()
|
public int getUserId()
|
||||||
{
|
{
|
||||||
return userId;
|
return userId;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setUserId(int userId)
|
public void setUserId(int userId)
|
||||||
{
|
{
|
||||||
this.userId = userId;
|
this.userId = userId;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getUserCode()
|
public String getUserCode()
|
||||||
{
|
{
|
||||||
return userCode;
|
return userCode;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setUserCode(String userCode)
|
public void setUserCode(String userCode)
|
||||||
{
|
{
|
||||||
this.userCode = userCode;
|
this.userCode = userCode;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getUserName()
|
public String getUserName()
|
||||||
{
|
{
|
||||||
return userName;
|
return userName;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setUserName(String userName)
|
public void setUserName(String userName)
|
||||||
{
|
{
|
||||||
this.userName = userName;
|
this.userName = userName;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getUserSex()
|
public String getUserSex()
|
||||||
{
|
{
|
||||||
return userSex;
|
return userSex;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setUserSex(String userSex)
|
public void setUserSex(String userSex)
|
||||||
{
|
{
|
||||||
this.userSex = userSex;
|
this.userSex = userSex;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getUserPhone()
|
public String getUserPhone()
|
||||||
{
|
{
|
||||||
return userPhone;
|
return userPhone;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setUserPhone(String userPhone)
|
public void setUserPhone(String userPhone)
|
||||||
{
|
{
|
||||||
this.userPhone = userPhone;
|
this.userPhone = userPhone;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getUserEmail()
|
public String getUserEmail()
|
||||||
{
|
{
|
||||||
return userEmail;
|
return userEmail;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setUserEmail(String userEmail)
|
public void setUserEmail(String userEmail)
|
||||||
{
|
{
|
||||||
this.userEmail = userEmail;
|
this.userEmail = userEmail;
|
||||||
}
|
}
|
||||||
|
|
||||||
public double getUserBalance()
|
public double getUserBalance()
|
||||||
{
|
{
|
||||||
return userBalance;
|
return userBalance;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setUserBalance(double userBalance)
|
public void setUserBalance(double userBalance)
|
||||||
{
|
{
|
||||||
this.userBalance = userBalance;
|
this.userBalance = userBalance;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getStatus()
|
public String getStatus()
|
||||||
{
|
{
|
||||||
return status;
|
return status;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setStatus(String status)
|
public void setStatus(String status)
|
||||||
{
|
{
|
||||||
this.status = status;
|
this.status = status;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Date getCreateTime()
|
public Date getCreateTime()
|
||||||
{
|
{
|
||||||
return createTime;
|
return createTime;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setCreateTime(Date createTime)
|
public void setCreateTime(Date createTime)
|
||||||
{
|
{
|
||||||
this.createTime = createTime;
|
this.createTime = createTime;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,149 +1,149 @@
|
||||||
package com.ruoyi.web.controller.demo.domain;
|
package com.ruoyi.web.controller.demo.domain;
|
||||||
|
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import com.ruoyi.common.annotation.Excel;
|
import com.ruoyi.common.annotation.Excel;
|
||||||
import com.ruoyi.common.annotation.Excel.Type;
|
import com.ruoyi.common.annotation.Excel.Type;
|
||||||
import com.ruoyi.common.core.domain.BaseEntity;
|
import com.ruoyi.common.core.domain.BaseEntity;
|
||||||
import com.ruoyi.common.utils.DateUtils;
|
import com.ruoyi.common.utils.DateUtils;
|
||||||
|
|
||||||
public class UserOperateModel extends BaseEntity
|
public class UserOperateModel extends BaseEntity
|
||||||
{
|
{
|
||||||
private static final long serialVersionUID = 1L;
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
private int userId;
|
private int userId;
|
||||||
|
|
||||||
@Excel(name = "用户编号")
|
@Excel(name = "用户编号")
|
||||||
private String userCode;
|
private String userCode;
|
||||||
|
|
||||||
@Excel(name = "用户姓名")
|
@Excel(name = "用户姓名")
|
||||||
private String userName;
|
private String userName;
|
||||||
|
|
||||||
@Excel(name = "用户性别", readConverterExp = "0=男,1=女,2=未知")
|
@Excel(name = "用户性别", readConverterExp = "0=男,1=女,2=未知")
|
||||||
private String userSex;
|
private String userSex;
|
||||||
|
|
||||||
@Excel(name = "用户手机")
|
@Excel(name = "用户手机")
|
||||||
private String userPhone;
|
private String userPhone;
|
||||||
|
|
||||||
@Excel(name = "用户邮箱")
|
@Excel(name = "用户邮箱")
|
||||||
private String userEmail;
|
private String userEmail;
|
||||||
|
|
||||||
@Excel(name = "用户余额")
|
@Excel(name = "用户余额")
|
||||||
private double userBalance;
|
private double userBalance;
|
||||||
|
|
||||||
@Excel(name = "用户状态", readConverterExp = "0=正常,1=停用")
|
@Excel(name = "用户状态", readConverterExp = "0=正常,1=停用")
|
||||||
private String status;
|
private String status;
|
||||||
|
|
||||||
@Excel(name = "创建时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss", type = Type.EXPORT)
|
@Excel(name = "创建时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss", type = Type.EXPORT)
|
||||||
private Date createTime;
|
private Date createTime;
|
||||||
|
|
||||||
public UserOperateModel()
|
public UserOperateModel()
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public UserOperateModel(int userId, String userCode, String userName, String userSex, String userPhone,
|
public UserOperateModel(int userId, String userCode, String userName, String userSex, String userPhone,
|
||||||
String userEmail, double userBalance, String status)
|
String userEmail, double userBalance, String status)
|
||||||
{
|
{
|
||||||
this.userId = userId;
|
this.userId = userId;
|
||||||
this.userCode = userCode;
|
this.userCode = userCode;
|
||||||
this.userName = userName;
|
this.userName = userName;
|
||||||
this.userSex = userSex;
|
this.userSex = userSex;
|
||||||
this.userPhone = userPhone;
|
this.userPhone = userPhone;
|
||||||
this.userEmail = userEmail;
|
this.userEmail = userEmail;
|
||||||
this.userBalance = userBalance;
|
this.userBalance = userBalance;
|
||||||
this.status = status;
|
this.status = status;
|
||||||
this.createTime = DateUtils.getNowDate();
|
this.createTime = DateUtils.getNowDate();
|
||||||
}
|
}
|
||||||
|
|
||||||
public int getUserId()
|
public int getUserId()
|
||||||
{
|
{
|
||||||
return userId;
|
return userId;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setUserId(int userId)
|
public void setUserId(int userId)
|
||||||
{
|
{
|
||||||
this.userId = userId;
|
this.userId = userId;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getUserCode()
|
public String getUserCode()
|
||||||
{
|
{
|
||||||
return userCode;
|
return userCode;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setUserCode(String userCode)
|
public void setUserCode(String userCode)
|
||||||
{
|
{
|
||||||
this.userCode = userCode;
|
this.userCode = userCode;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getUserName()
|
public String getUserName()
|
||||||
{
|
{
|
||||||
return userName;
|
return userName;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setUserName(String userName)
|
public void setUserName(String userName)
|
||||||
{
|
{
|
||||||
this.userName = userName;
|
this.userName = userName;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getUserSex()
|
public String getUserSex()
|
||||||
{
|
{
|
||||||
return userSex;
|
return userSex;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setUserSex(String userSex)
|
public void setUserSex(String userSex)
|
||||||
{
|
{
|
||||||
this.userSex = userSex;
|
this.userSex = userSex;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getUserPhone()
|
public String getUserPhone()
|
||||||
{
|
{
|
||||||
return userPhone;
|
return userPhone;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setUserPhone(String userPhone)
|
public void setUserPhone(String userPhone)
|
||||||
{
|
{
|
||||||
this.userPhone = userPhone;
|
this.userPhone = userPhone;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getUserEmail()
|
public String getUserEmail()
|
||||||
{
|
{
|
||||||
return userEmail;
|
return userEmail;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setUserEmail(String userEmail)
|
public void setUserEmail(String userEmail)
|
||||||
{
|
{
|
||||||
this.userEmail = userEmail;
|
this.userEmail = userEmail;
|
||||||
}
|
}
|
||||||
|
|
||||||
public double getUserBalance()
|
public double getUserBalance()
|
||||||
{
|
{
|
||||||
return userBalance;
|
return userBalance;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setUserBalance(double userBalance)
|
public void setUserBalance(double userBalance)
|
||||||
{
|
{
|
||||||
this.userBalance = userBalance;
|
this.userBalance = userBalance;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getStatus()
|
public String getStatus()
|
||||||
{
|
{
|
||||||
return status;
|
return status;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setStatus(String status)
|
public void setStatus(String status)
|
||||||
{
|
{
|
||||||
this.status = status;
|
this.status = status;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Date getCreateTime()
|
public Date getCreateTime()
|
||||||
{
|
{
|
||||||
return createTime;
|
return createTime;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void setCreateTime(Date createTime)
|
public void setCreateTime(Date createTime)
|
||||||
{
|
{
|
||||||
this.createTime = createTime;
|
this.createTime = createTime;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -1,26 +1,24 @@
|
||||||
package com.ruoyi.web.controller.monitor;
|
package com.ruoyi.web.controller.monitor;
|
||||||
|
|
||||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||||
import org.springframework.stereotype.Controller;
|
import org.springframework.stereotype.Controller;
|
||||||
import org.springframework.web.bind.annotation.GetMapping;
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
import com.ruoyi.common.core.controller.BaseController;
|
import com.ruoyi.common.core.controller.BaseController;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* druid 监控
|
* druid 监控
|
||||||
*
|
*
|
||||||
* @author ruoyi
|
* @author ruoyi
|
||||||
*/
|
*/
|
||||||
@Controller
|
@Controller
|
||||||
@RequestMapping("/monitor/data")
|
@RequestMapping("/monitor/data")
|
||||||
public class DruidController extends BaseController
|
public class DruidController extends BaseController {
|
||||||
{
|
private String prefix = "/druid";
|
||||||
private String prefix = "/druid";
|
|
||||||
|
@RequiresPermissions("monitor:data:view")
|
||||||
@RequiresPermissions("monitor:data:view")
|
@GetMapping()
|
||||||
@GetMapping()
|
public String index() {
|
||||||
public String index()
|
return redirect(prefix + "/index");
|
||||||
{
|
}
|
||||||
return redirect(prefix + "/index");
|
}
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
|
||||||
|
|
@ -1,31 +1,29 @@
|
||||||
package com.ruoyi.web.controller.monitor;
|
package com.ruoyi.web.controller.monitor;
|
||||||
|
|
||||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||||
import org.springframework.stereotype.Controller;
|
import org.springframework.stereotype.Controller;
|
||||||
import org.springframework.ui.ModelMap;
|
import org.springframework.ui.ModelMap;
|
||||||
import org.springframework.web.bind.annotation.GetMapping;
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
import com.ruoyi.common.core.controller.BaseController;
|
import com.ruoyi.common.core.controller.BaseController;
|
||||||
import com.ruoyi.framework.web.domain.Server;
|
import com.ruoyi.framework.web.domain.Server;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 服务器监控
|
* 服务器监控
|
||||||
*
|
*
|
||||||
* @author ruoyi
|
* @author ruoyi
|
||||||
*/
|
*/
|
||||||
@Controller
|
@Controller
|
||||||
@RequestMapping("/monitor/server")
|
@RequestMapping("/monitor/server")
|
||||||
public class ServerController extends BaseController
|
public class ServerController extends BaseController {
|
||||||
{
|
private String prefix = "monitor/server";
|
||||||
private String prefix = "monitor/server";
|
|
||||||
|
@RequiresPermissions("monitor:server:view")
|
||||||
@RequiresPermissions("monitor:server:view")
|
@GetMapping()
|
||||||
@GetMapping()
|
public String server(ModelMap mmap) throws Exception {
|
||||||
public String server(ModelMap mmap) throws Exception
|
Server server = new Server();
|
||||||
{
|
server.copyTo();
|
||||||
Server server = new Server();
|
mmap.put("server", server);
|
||||||
server.copyTo();
|
return prefix + "/server";
|
||||||
mmap.put("server", server);
|
}
|
||||||
return prefix + "/server";
|
}
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
|
||||||
|
|
@ -1,94 +1,87 @@
|
||||||
package com.ruoyi.web.controller.monitor;
|
package com.ruoyi.web.controller.monitor;
|
||||||
|
|
||||||
import java.util.List;
|
import com.ruoyi.common.annotation.Log;
|
||||||
import com.ruoyi.framework.shiro.service.SysPasswordService;
|
import com.ruoyi.common.core.controller.BaseController;
|
||||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
import com.ruoyi.common.core.domain.AjaxResult;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import com.ruoyi.common.core.page.TableDataInfo;
|
||||||
import org.springframework.stereotype.Controller;
|
import com.ruoyi.common.enums.BusinessType;
|
||||||
import org.springframework.web.bind.annotation.GetMapping;
|
import com.ruoyi.common.utils.poi.ExcelUtil;
|
||||||
import org.springframework.web.bind.annotation.PostMapping;
|
import com.ruoyi.framework.shiro.service.SysPasswordService;
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
import com.ruoyi.system.domain.SysLogininfor;
|
||||||
import org.springframework.web.bind.annotation.ResponseBody;
|
import com.ruoyi.system.service.ISysLogininforService;
|
||||||
import com.ruoyi.common.annotation.Log;
|
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||||
import com.ruoyi.common.core.controller.BaseController;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import com.ruoyi.common.core.domain.AjaxResult;
|
import org.springframework.data.domain.Pageable;
|
||||||
import com.ruoyi.common.core.page.TableDataInfo;
|
import org.springframework.stereotype.Controller;
|
||||||
import com.ruoyi.common.enums.BusinessType;
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
import com.ruoyi.common.utils.poi.ExcelUtil;
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
import com.ruoyi.system.domain.SysLogininfor;
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
import com.ruoyi.system.service.ISysLogininforService;
|
import org.springframework.web.bind.annotation.ResponseBody;
|
||||||
|
|
||||||
/**
|
import java.util.List;
|
||||||
* 系统访问记录
|
|
||||||
*
|
/**
|
||||||
* @author ruoyi
|
* 系统访问记录
|
||||||
*/
|
*
|
||||||
@Controller
|
* @author ruoyi
|
||||||
@RequestMapping("/monitor/logininfor")
|
*/
|
||||||
public class SysLogininforController extends BaseController
|
@Controller
|
||||||
{
|
@RequestMapping("/monitor/logininfor")
|
||||||
private String prefix = "monitor/logininfor";
|
public class SysLogininforController extends BaseController {
|
||||||
|
private String prefix = "monitor/logininfor";
|
||||||
@Autowired
|
|
||||||
private ISysLogininforService logininforService;
|
@Autowired
|
||||||
|
private ISysLogininforService logininforService;
|
||||||
@Autowired
|
|
||||||
private SysPasswordService passwordService;
|
@Autowired
|
||||||
|
private SysPasswordService passwordService;
|
||||||
@RequiresPermissions("monitor:logininfor:view")
|
|
||||||
@GetMapping()
|
@RequiresPermissions("monitor:logininfor:view")
|
||||||
public String logininfor()
|
@GetMapping()
|
||||||
{
|
public String logininfor() {
|
||||||
return prefix + "/logininfor";
|
return prefix + "/logininfor";
|
||||||
}
|
}
|
||||||
|
|
||||||
@RequiresPermissions("monitor:logininfor:list")
|
@RequiresPermissions("monitor:logininfor:list")
|
||||||
@PostMapping("/list")
|
@PostMapping("/list")
|
||||||
@ResponseBody
|
@ResponseBody
|
||||||
public TableDataInfo list(SysLogininfor logininfor)
|
public TableDataInfo list(SysLogininfor logininfor) {
|
||||||
{
|
return getDataTable(logininforService.selectLogininforList(logininfor, getPageRequest()));
|
||||||
startPage();
|
}
|
||||||
List<SysLogininfor> list = logininforService.selectLogininforList(logininfor);
|
|
||||||
return getDataTable(list);
|
@Log(title = "登陆日志", businessType = BusinessType.EXPORT)
|
||||||
}
|
@RequiresPermissions("monitor:logininfor:export")
|
||||||
|
@PostMapping("/export")
|
||||||
@Log(title = "登陆日志", businessType = BusinessType.EXPORT)
|
@ResponseBody
|
||||||
@RequiresPermissions("monitor:logininfor:export")
|
public AjaxResult export(SysLogininfor logininfor) {
|
||||||
@PostMapping("/export")
|
List<SysLogininfor> list = logininforService.selectLogininforList(logininfor, Pageable.unpaged()).getContent();
|
||||||
@ResponseBody
|
ExcelUtil<SysLogininfor> util = new ExcelUtil<SysLogininfor>(SysLogininfor.class);
|
||||||
public AjaxResult export(SysLogininfor logininfor)
|
return util.exportExcel(list, "登陆日志");
|
||||||
{
|
}
|
||||||
List<SysLogininfor> list = logininforService.selectLogininforList(logininfor);
|
|
||||||
ExcelUtil<SysLogininfor> util = new ExcelUtil<SysLogininfor>(SysLogininfor.class);
|
@RequiresPermissions("monitor:logininfor:remove")
|
||||||
return util.exportExcel(list, "登陆日志");
|
@Log(title = "登陆日志", businessType = BusinessType.DELETE)
|
||||||
}
|
@PostMapping("/remove")
|
||||||
|
@ResponseBody
|
||||||
@RequiresPermissions("monitor:logininfor:remove")
|
public AjaxResult remove(String ids) {
|
||||||
@Log(title = "登陆日志", businessType = BusinessType.DELETE)
|
return toAjax(logininforService.deleteLogininforByIds(ids));
|
||||||
@PostMapping("/remove")
|
}
|
||||||
@ResponseBody
|
|
||||||
public AjaxResult remove(String ids)
|
@RequiresPermissions("monitor:logininfor:remove")
|
||||||
{
|
@Log(title = "登陆日志", businessType = BusinessType.CLEAN)
|
||||||
return toAjax(logininforService.deleteLogininforByIds(ids));
|
@PostMapping("/clean")
|
||||||
}
|
@ResponseBody
|
||||||
|
public AjaxResult clean() {
|
||||||
@RequiresPermissions("monitor:logininfor:remove")
|
logininforService.cleanLogininfor();
|
||||||
@Log(title = "登陆日志", businessType = BusinessType.CLEAN)
|
return success();
|
||||||
@PostMapping("/clean")
|
}
|
||||||
@ResponseBody
|
|
||||||
public AjaxResult clean()
|
@RequiresPermissions("monitor:logininfor:unlock")
|
||||||
{
|
@Log(title = "账户解锁", businessType = BusinessType.OTHER)
|
||||||
logininforService.cleanLogininfor();
|
@PostMapping("/unlock")
|
||||||
return success();
|
@ResponseBody
|
||||||
}
|
public AjaxResult unlock(String loginName) {
|
||||||
|
passwordService.unlock(loginName);
|
||||||
@RequiresPermissions("monitor:logininfor:unlock")
|
return success();
|
||||||
@Log(title = "账户解锁", businessType = BusinessType.OTHER)
|
}
|
||||||
@PostMapping("/unlock")
|
}
|
||||||
@ResponseBody
|
|
||||||
public AjaxResult unlock(String loginName)
|
|
||||||
{
|
|
||||||
passwordService.unlock(loginName);
|
|
||||||
return success();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
|
||||||
|
|
@ -1,89 +1,78 @@
|
||||||
package com.ruoyi.web.controller.monitor;
|
package com.ruoyi.web.controller.monitor;
|
||||||
|
|
||||||
import java.util.List;
|
import com.ruoyi.common.annotation.Log;
|
||||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
import com.ruoyi.common.core.controller.BaseController;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import com.ruoyi.common.core.domain.AjaxResult;
|
||||||
import org.springframework.stereotype.Controller;
|
import com.ruoyi.common.core.page.TableDataInfo;
|
||||||
import org.springframework.ui.ModelMap;
|
import com.ruoyi.common.enums.BusinessType;
|
||||||
import org.springframework.web.bind.annotation.GetMapping;
|
import com.ruoyi.common.utils.poi.ExcelUtil;
|
||||||
import org.springframework.web.bind.annotation.PathVariable;
|
import com.ruoyi.system.domain.SysOperLog;
|
||||||
import org.springframework.web.bind.annotation.PostMapping;
|
import com.ruoyi.system.service.ISysOperLogService;
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||||
import org.springframework.web.bind.annotation.ResponseBody;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import com.ruoyi.common.annotation.Log;
|
import org.springframework.data.domain.Pageable;
|
||||||
import com.ruoyi.common.core.controller.BaseController;
|
import org.springframework.stereotype.Controller;
|
||||||
import com.ruoyi.common.core.domain.AjaxResult;
|
import org.springframework.ui.ModelMap;
|
||||||
import com.ruoyi.common.core.page.TableDataInfo;
|
import org.springframework.web.bind.annotation.*;
|
||||||
import com.ruoyi.common.enums.BusinessType;
|
|
||||||
import com.ruoyi.common.utils.poi.ExcelUtil;
|
import java.util.List;
|
||||||
import com.ruoyi.system.domain.SysOperLog;
|
|
||||||
import com.ruoyi.system.service.ISysOperLogService;
|
/**
|
||||||
|
* 操作日志记录
|
||||||
/**
|
*
|
||||||
* 操作日志记录
|
* @author ruoyi
|
||||||
*
|
*/
|
||||||
* @author ruoyi
|
@Controller
|
||||||
*/
|
@RequestMapping("/monitor/operlog")
|
||||||
@Controller
|
public class SysOperlogController extends BaseController {
|
||||||
@RequestMapping("/monitor/operlog")
|
private String prefix = "monitor/operlog";
|
||||||
public class SysOperlogController extends BaseController
|
|
||||||
{
|
@Autowired
|
||||||
private String prefix = "monitor/operlog";
|
private ISysOperLogService operLogService;
|
||||||
|
|
||||||
@Autowired
|
@RequiresPermissions("monitor:operlog:view")
|
||||||
private ISysOperLogService operLogService;
|
@GetMapping()
|
||||||
|
public String operlog() {
|
||||||
@RequiresPermissions("monitor:operlog:view")
|
return prefix + "/operlog";
|
||||||
@GetMapping()
|
}
|
||||||
public String operlog()
|
|
||||||
{
|
@RequiresPermissions("monitor:operlog:list")
|
||||||
return prefix + "/operlog";
|
@PostMapping("/list")
|
||||||
}
|
@ResponseBody
|
||||||
|
public TableDataInfo list(SysOperLog operLog) {
|
||||||
@RequiresPermissions("monitor:operlog:list")
|
return getDataTable(operLogService.selectOperLogList(operLog, getPageRequest()));
|
||||||
@PostMapping("/list")
|
}
|
||||||
@ResponseBody
|
|
||||||
public TableDataInfo list(SysOperLog operLog)
|
@Log(title = "操作日志", businessType = BusinessType.EXPORT)
|
||||||
{
|
@RequiresPermissions("monitor:operlog:export")
|
||||||
startPage();
|
@PostMapping("/export")
|
||||||
List<SysOperLog> list = operLogService.selectOperLogList(operLog);
|
@ResponseBody
|
||||||
return getDataTable(list);
|
public AjaxResult export(SysOperLog operLog) {
|
||||||
}
|
List<SysOperLog> list = operLogService.selectOperLogList(operLog, Pageable.unpaged()).getContent();
|
||||||
|
ExcelUtil<SysOperLog> util = new ExcelUtil<SysOperLog>(SysOperLog.class);
|
||||||
@Log(title = "操作日志", businessType = BusinessType.EXPORT)
|
return util.exportExcel(list, "操作日志");
|
||||||
@RequiresPermissions("monitor:operlog:export")
|
}
|
||||||
@PostMapping("/export")
|
|
||||||
@ResponseBody
|
@RequiresPermissions("monitor:operlog:remove")
|
||||||
public AjaxResult export(SysOperLog operLog)
|
@PostMapping("/remove")
|
||||||
{
|
@ResponseBody
|
||||||
List<SysOperLog> list = operLogService.selectOperLogList(operLog);
|
public AjaxResult remove(String ids) {
|
||||||
ExcelUtil<SysOperLog> util = new ExcelUtil<SysOperLog>(SysOperLog.class);
|
return toAjax(operLogService.deleteOperLogByIds(ids));
|
||||||
return util.exportExcel(list, "操作日志");
|
}
|
||||||
}
|
|
||||||
|
@RequiresPermissions("monitor:operlog:detail")
|
||||||
@RequiresPermissions("monitor:operlog:remove")
|
@GetMapping("/detail/{operId}")
|
||||||
@PostMapping("/remove")
|
public String detail(@PathVariable("operId") Long operId, ModelMap mmap) {
|
||||||
@ResponseBody
|
mmap.put("operLog", operLogService.selectOperLogById(operId));
|
||||||
public AjaxResult remove(String ids)
|
return prefix + "/detail";
|
||||||
{
|
}
|
||||||
return toAjax(operLogService.deleteOperLogByIds(ids));
|
|
||||||
}
|
@Log(title = "操作日志", businessType = BusinessType.CLEAN)
|
||||||
|
@RequiresPermissions("monitor:operlog:remove")
|
||||||
@RequiresPermissions("monitor:operlog:detail")
|
@PostMapping("/clean")
|
||||||
@GetMapping("/detail/{operId}")
|
@ResponseBody
|
||||||
public String detail(@PathVariable("operId") Long operId, ModelMap mmap)
|
public AjaxResult clean() {
|
||||||
{
|
operLogService.cleanOperLog();
|
||||||
mmap.put("operLog", operLogService.selectOperLogById(operId));
|
return success();
|
||||||
return prefix + "/detail";
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Log(title = "操作日志", businessType = BusinessType.CLEAN)
|
|
||||||
@RequiresPermissions("monitor:operlog:remove")
|
|
||||||
@PostMapping("/clean")
|
|
||||||
@ResponseBody
|
|
||||||
public AjaxResult clean()
|
|
||||||
{
|
|
||||||
operLogService.cleanOperLog();
|
|
||||||
return success();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
|
||||||
|
|
@ -1,88 +1,85 @@
|
||||||
package com.ruoyi.web.controller.monitor;
|
package com.ruoyi.web.controller.monitor;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import org.apache.shiro.authz.annotation.Logical;
|
import org.apache.shiro.authz.annotation.Logical;
|
||||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Controller;
|
import org.springframework.stereotype.Controller;
|
||||||
import org.springframework.web.bind.annotation.GetMapping;
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
import org.springframework.web.bind.annotation.PostMapping;
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
import org.springframework.web.bind.annotation.ResponseBody;
|
import org.springframework.web.bind.annotation.ResponseBody;
|
||||||
import com.ruoyi.common.annotation.Log;
|
import com.ruoyi.common.annotation.Log;
|
||||||
import com.ruoyi.common.core.controller.BaseController;
|
import com.ruoyi.common.core.controller.BaseController;
|
||||||
import com.ruoyi.common.core.domain.AjaxResult;
|
import com.ruoyi.common.core.domain.AjaxResult;
|
||||||
import com.ruoyi.common.core.page.TableDataInfo;
|
import com.ruoyi.common.core.page.TableDataInfo;
|
||||||
import com.ruoyi.common.core.text.Convert;
|
import com.ruoyi.common.core.text.Convert;
|
||||||
import com.ruoyi.common.enums.BusinessType;
|
import com.ruoyi.common.enums.BusinessType;
|
||||||
import com.ruoyi.common.enums.OnlineStatus;
|
import com.ruoyi.common.enums.OnlineStatus;
|
||||||
import com.ruoyi.framework.shiro.session.OnlineSession;
|
import com.ruoyi.framework.shiro.session.OnlineSession;
|
||||||
import com.ruoyi.framework.shiro.session.OnlineSessionDAO;
|
import com.ruoyi.framework.shiro.session.OnlineSessionDAO;
|
||||||
import com.ruoyi.framework.util.ShiroUtils;
|
import com.ruoyi.framework.util.ShiroUtils;
|
||||||
import com.ruoyi.system.domain.SysUserOnline;
|
import com.ruoyi.system.domain.SysUserOnline;
|
||||||
import com.ruoyi.system.service.ISysUserOnlineService;
|
import com.ruoyi.system.service.ISysUserOnlineService;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 在线用户监控
|
* 在线用户监控
|
||||||
*
|
*
|
||||||
* @author ruoyi
|
* @author ruoyi
|
||||||
*/
|
*/
|
||||||
@Controller
|
@Controller
|
||||||
@RequestMapping("/monitor/online")
|
@RequestMapping("/monitor/online")
|
||||||
public class SysUserOnlineController extends BaseController
|
public class SysUserOnlineController extends BaseController
|
||||||
{
|
{
|
||||||
private String prefix = "monitor/online";
|
private String prefix = "monitor/online";
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private ISysUserOnlineService userOnlineService;
|
private ISysUserOnlineService userOnlineService;
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private OnlineSessionDAO onlineSessionDAO;
|
private OnlineSessionDAO onlineSessionDAO;
|
||||||
|
|
||||||
@RequiresPermissions("monitor:online:view")
|
@RequiresPermissions("monitor:online:view")
|
||||||
@GetMapping()
|
@GetMapping()
|
||||||
public String online()
|
public String online()
|
||||||
{
|
{
|
||||||
return prefix + "/online";
|
return prefix + "/online";
|
||||||
}
|
}
|
||||||
|
|
||||||
@RequiresPermissions("monitor:online:list")
|
@RequiresPermissions("monitor:online:list")
|
||||||
@PostMapping("/list")
|
@PostMapping("/list")
|
||||||
@ResponseBody
|
@ResponseBody
|
||||||
public TableDataInfo list(SysUserOnline userOnline)
|
public TableDataInfo list(SysUserOnline userOnline) {
|
||||||
{
|
return getDataTable(userOnlineService.selectUserOnlineList(userOnline, getPageRequest()));
|
||||||
startPage();
|
}
|
||||||
List<SysUserOnline> list = userOnlineService.selectUserOnlineList(userOnline);
|
|
||||||
return getDataTable(list);
|
@RequiresPermissions(value = { "monitor:online:batchForceLogout", "monitor:online:forceLogout" }, logical = Logical.OR)
|
||||||
}
|
@Log(title = "在线用户", businessType = BusinessType.FORCE)
|
||||||
|
@PostMapping("/batchForceLogout")
|
||||||
@RequiresPermissions(value = { "monitor:online:batchForceLogout", "monitor:online:forceLogout" }, logical = Logical.OR)
|
@ResponseBody
|
||||||
@Log(title = "在线用户", businessType = BusinessType.FORCE)
|
public AjaxResult batchForceLogout(String ids)
|
||||||
@PostMapping("/batchForceLogout")
|
{
|
||||||
@ResponseBody
|
for (String sessionId : Convert.toStrArray(ids))
|
||||||
public AjaxResult batchForceLogout(String ids)
|
{
|
||||||
{
|
SysUserOnline online = userOnlineService.selectOnlineById(sessionId);
|
||||||
for (String sessionId : Convert.toStrArray(ids))
|
if (online == null)
|
||||||
{
|
{
|
||||||
SysUserOnline online = userOnlineService.selectOnlineById(sessionId);
|
return error("用户已下线");
|
||||||
if (online == null)
|
}
|
||||||
{
|
OnlineSession onlineSession = (OnlineSession) onlineSessionDAO.readSession(online.getSessionId());
|
||||||
return error("用户已下线");
|
if (onlineSession == null)
|
||||||
}
|
{
|
||||||
OnlineSession onlineSession = (OnlineSession) onlineSessionDAO.readSession(online.getSessionId());
|
return error("用户已下线");
|
||||||
if (onlineSession == null)
|
}
|
||||||
{
|
if (sessionId.equals(ShiroUtils.getSessionId()))
|
||||||
return error("用户已下线");
|
{
|
||||||
}
|
return error("当前登陆用户无法强退");
|
||||||
if (sessionId.equals(ShiroUtils.getSessionId()))
|
}
|
||||||
{
|
onlineSessionDAO.delete(onlineSession);
|
||||||
return error("当前登陆用户无法强退");
|
online.setStatus(OnlineStatus.off_line);
|
||||||
}
|
userOnlineService.saveOnline(online);
|
||||||
onlineSessionDAO.delete(onlineSession);
|
userOnlineService.removeUserCache(online.getLoginName(), sessionId);
|
||||||
online.setStatus(OnlineStatus.off_line);
|
}
|
||||||
userOnlineService.saveOnline(online);
|
return success();
|
||||||
userOnlineService.removeUserCache(online.getLoginName(), sessionId);
|
}
|
||||||
}
|
}
|
||||||
return success();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
|
||||||
|
|
@ -1,92 +1,79 @@
|
||||||
package com.ruoyi.web.controller.system;
|
package com.ruoyi.web.controller.system;
|
||||||
|
|
||||||
import java.awt.image.BufferedImage;
|
import java.awt.image.BufferedImage;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
import javax.imageio.ImageIO;
|
import javax.imageio.ImageIO;
|
||||||
import javax.servlet.ServletOutputStream;
|
import javax.servlet.ServletOutputStream;
|
||||||
import javax.servlet.http.HttpServletRequest;
|
import javax.servlet.http.HttpServletRequest;
|
||||||
import javax.servlet.http.HttpServletResponse;
|
import javax.servlet.http.HttpServletResponse;
|
||||||
import javax.servlet.http.HttpSession;
|
import javax.servlet.http.HttpSession;
|
||||||
import org.springframework.stereotype.Controller;
|
|
||||||
import org.springframework.web.bind.annotation.GetMapping;
|
import org.springframework.stereotype.Controller;
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
import org.springframework.web.servlet.ModelAndView;
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
import com.google.code.kaptcha.Constants;
|
import org.springframework.web.servlet.ModelAndView;
|
||||||
import com.google.code.kaptcha.Producer;
|
import com.google.code.kaptcha.Constants;
|
||||||
import com.ruoyi.common.core.controller.BaseController;
|
import com.google.code.kaptcha.Producer;
|
||||||
|
import com.ruoyi.common.core.controller.BaseController;
|
||||||
/**
|
|
||||||
* 图片验证码(支持算术形式)
|
/**
|
||||||
*
|
* 图片验证码(支持算术形式)
|
||||||
* @author ruoyi
|
*
|
||||||
*/
|
* @author ruoyi
|
||||||
@Controller
|
*/
|
||||||
@RequestMapping("/captcha")
|
@Controller
|
||||||
public class SysCaptchaController extends BaseController
|
@RequestMapping("/captcha")
|
||||||
{
|
public class SysCaptchaController extends BaseController {
|
||||||
@Resource(name = "captchaProducer")
|
@Resource(name = "captchaProducer")
|
||||||
private Producer captchaProducer;
|
private Producer captchaProducer;
|
||||||
|
|
||||||
@Resource(name = "captchaProducerMath")
|
@Resource(name = "captchaProducerMath")
|
||||||
private Producer captchaProducerMath;
|
private Producer captchaProducerMath;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 验证码生成
|
* 验证码生成
|
||||||
*/
|
*/
|
||||||
@GetMapping(value = "/captchaImage")
|
@GetMapping(value = "/captchaImage")
|
||||||
public ModelAndView getKaptchaImage(HttpServletRequest request, HttpServletResponse response)
|
public ModelAndView getKaptchaImage(HttpServletRequest request, HttpServletResponse response) {
|
||||||
{
|
ServletOutputStream out = null;
|
||||||
ServletOutputStream out = null;
|
try {
|
||||||
try
|
HttpSession session = request.getSession();
|
||||||
{
|
response.setDateHeader("Expires", 0);
|
||||||
HttpSession session = request.getSession();
|
response.setHeader("Cache-Control", "no-store, no-cache, must-revalidate");
|
||||||
response.setDateHeader("Expires", 0);
|
response.addHeader("Cache-Control", "post-check=0, pre-check=0");
|
||||||
response.setHeader("Cache-Control", "no-store, no-cache, must-revalidate");
|
response.setHeader("Pragma", "no-cache");
|
||||||
response.addHeader("Cache-Control", "post-check=0, pre-check=0");
|
response.setContentType("image/jpeg");
|
||||||
response.setHeader("Pragma", "no-cache");
|
|
||||||
response.setContentType("image/jpeg");
|
String type = request.getParameter("type");
|
||||||
|
String capStr = null;
|
||||||
String type = request.getParameter("type");
|
String code = null;
|
||||||
String capStr = null;
|
BufferedImage bi = null;
|
||||||
String code = null;
|
if ("math".equals(type)) {
|
||||||
BufferedImage bi = null;
|
String capText = captchaProducerMath.createText();
|
||||||
if ("math".equals(type))
|
capStr = capText.substring(0, capText.lastIndexOf("@"));
|
||||||
{
|
code = capText.substring(capText.lastIndexOf("@") + 1);
|
||||||
String capText = captchaProducerMath.createText();
|
bi = captchaProducerMath.createImage(capStr);
|
||||||
capStr = capText.substring(0, capText.lastIndexOf("@"));
|
} else if ("char".equals(type)) {
|
||||||
code = capText.substring(capText.lastIndexOf("@") + 1);
|
capStr = code = captchaProducer.createText();
|
||||||
bi = captchaProducerMath.createImage(capStr);
|
bi = captchaProducer.createImage(capStr);
|
||||||
}
|
}
|
||||||
else if ("char".equals(type))
|
session.setAttribute(Constants.KAPTCHA_SESSION_KEY, code);
|
||||||
{
|
out = response.getOutputStream();
|
||||||
capStr = code = captchaProducer.createText();
|
ImageIO.write(bi, "jpg", out);
|
||||||
bi = captchaProducer.createImage(capStr);
|
out.flush();
|
||||||
}
|
|
||||||
session.setAttribute(Constants.KAPTCHA_SESSION_KEY, code);
|
} catch (Exception e) {
|
||||||
out = response.getOutputStream();
|
e.printStackTrace();
|
||||||
ImageIO.write(bi, "jpg", out);
|
} finally {
|
||||||
out.flush();
|
try {
|
||||||
|
if (out != null) {
|
||||||
}
|
out.close();
|
||||||
catch (Exception e)
|
}
|
||||||
{
|
} catch (IOException e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
finally
|
}
|
||||||
{
|
return null;
|
||||||
try
|
}
|
||||||
{
|
|
||||||
if (out != null)
|
|
||||||
{
|
|
||||||
out.close();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
catch (IOException e)
|
|
||||||
{
|
|
||||||
e.printStackTrace();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
@ -1,157 +1,157 @@
|
||||||
package com.ruoyi.web.controller.system;
|
package com.ruoyi.web.controller.system;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Controller;
|
import org.springframework.stereotype.Controller;
|
||||||
import org.springframework.ui.ModelMap;
|
import org.springframework.ui.ModelMap;
|
||||||
import org.springframework.validation.annotation.Validated;
|
import org.springframework.validation.annotation.Validated;
|
||||||
import org.springframework.web.bind.annotation.GetMapping;
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
import org.springframework.web.bind.annotation.PathVariable;
|
import org.springframework.web.bind.annotation.PathVariable;
|
||||||
import org.springframework.web.bind.annotation.PostMapping;
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
import org.springframework.web.bind.annotation.ResponseBody;
|
import org.springframework.web.bind.annotation.ResponseBody;
|
||||||
import com.ruoyi.common.annotation.Log;
|
import com.ruoyi.common.annotation.Log;
|
||||||
import com.ruoyi.common.constant.UserConstants;
|
import com.ruoyi.common.constant.UserConstants;
|
||||||
import com.ruoyi.common.core.controller.BaseController;
|
import com.ruoyi.common.core.controller.BaseController;
|
||||||
import com.ruoyi.common.core.domain.AjaxResult;
|
import com.ruoyi.common.core.domain.AjaxResult;
|
||||||
import com.ruoyi.common.core.page.TableDataInfo;
|
import com.ruoyi.common.core.page.TableDataInfo;
|
||||||
import com.ruoyi.common.enums.BusinessType;
|
import com.ruoyi.common.enums.BusinessType;
|
||||||
import com.ruoyi.common.utils.poi.ExcelUtil;
|
import com.ruoyi.common.utils.poi.ExcelUtil;
|
||||||
import com.ruoyi.framework.util.ShiroUtils;
|
import com.ruoyi.framework.util.ShiroUtils;
|
||||||
import com.ruoyi.system.domain.SysConfig;
|
import com.ruoyi.system.domain.SysConfig;
|
||||||
import com.ruoyi.system.service.ISysConfigService;
|
import com.ruoyi.system.service.ISysConfigService;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 参数配置 信息操作处理
|
* 参数配置 信息操作处理
|
||||||
*
|
*
|
||||||
* @author ruoyi
|
* @author ruoyi
|
||||||
*/
|
*/
|
||||||
@Controller
|
@Controller
|
||||||
@RequestMapping("/system/config")
|
@RequestMapping("/system/config")
|
||||||
public class SysConfigController extends BaseController
|
public class SysConfigController extends BaseController
|
||||||
{
|
{
|
||||||
private String prefix = "system/config";
|
private String prefix = "system/config";
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private ISysConfigService configService;
|
private ISysConfigService configService;
|
||||||
|
|
||||||
@RequiresPermissions("system:config:view")
|
@RequiresPermissions("system:config:view")
|
||||||
@GetMapping()
|
@GetMapping()
|
||||||
public String config()
|
public String config()
|
||||||
{
|
{
|
||||||
return prefix + "/config";
|
return prefix + "/config";
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询参数配置列表
|
* 查询参数配置列表
|
||||||
*/
|
*/
|
||||||
@RequiresPermissions("system:config:list")
|
@RequiresPermissions("system:config:list")
|
||||||
@PostMapping("/list")
|
@PostMapping("/list")
|
||||||
@ResponseBody
|
@ResponseBody
|
||||||
public TableDataInfo list(SysConfig config)
|
public TableDataInfo list(SysConfig config)
|
||||||
{
|
{
|
||||||
startPage();
|
startPage();
|
||||||
List<SysConfig> list = configService.selectConfigList(config);
|
List<SysConfig> list = configService.selectConfigList(config);
|
||||||
return getDataTable(list);
|
return getDataTable(list);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Log(title = "参数管理", businessType = BusinessType.EXPORT)
|
@Log(title = "参数管理", businessType = BusinessType.EXPORT)
|
||||||
@RequiresPermissions("system:config:export")
|
@RequiresPermissions("system:config:export")
|
||||||
@PostMapping("/export")
|
@PostMapping("/export")
|
||||||
@ResponseBody
|
@ResponseBody
|
||||||
public AjaxResult export(SysConfig config)
|
public AjaxResult export(SysConfig config)
|
||||||
{
|
{
|
||||||
List<SysConfig> list = configService.selectConfigList(config);
|
List<SysConfig> list = configService.selectConfigList(config);
|
||||||
ExcelUtil<SysConfig> util = new ExcelUtil<SysConfig>(SysConfig.class);
|
ExcelUtil<SysConfig> util = new ExcelUtil<SysConfig>(SysConfig.class);
|
||||||
return util.exportExcel(list, "参数数据");
|
return util.exportExcel(list, "参数数据");
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 新增参数配置
|
* 新增参数配置
|
||||||
*/
|
*/
|
||||||
@GetMapping("/add")
|
@GetMapping("/add")
|
||||||
public String add()
|
public String add()
|
||||||
{
|
{
|
||||||
return prefix + "/add";
|
return prefix + "/add";
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 新增保存参数配置
|
* 新增保存参数配置
|
||||||
*/
|
*/
|
||||||
@RequiresPermissions("system:config:add")
|
@RequiresPermissions("system:config:add")
|
||||||
@Log(title = "参数管理", businessType = BusinessType.INSERT)
|
@Log(title = "参数管理", businessType = BusinessType.INSERT)
|
||||||
@PostMapping("/add")
|
@PostMapping("/add")
|
||||||
@ResponseBody
|
@ResponseBody
|
||||||
public AjaxResult addSave(@Validated SysConfig config)
|
public AjaxResult addSave(@Validated SysConfig config)
|
||||||
{
|
{
|
||||||
if (UserConstants.CONFIG_KEY_NOT_UNIQUE.equals(configService.checkConfigKeyUnique(config)))
|
if (UserConstants.CONFIG_KEY_NOT_UNIQUE.equals(configService.checkConfigKeyUnique(config)))
|
||||||
{
|
{
|
||||||
return error("新增参数'" + config.getConfigName() + "'失败,参数键名已存在");
|
return error("新增参数'" + config.getConfigName() + "'失败,参数键名已存在");
|
||||||
}
|
}
|
||||||
config.setCreateBy(ShiroUtils.getLoginName());
|
config.setCreateBy(ShiroUtils.getLoginName());
|
||||||
return toAjax(configService.insertConfig(config));
|
return toAjax(configService.insertConfig(config));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 修改参数配置
|
* 修改参数配置
|
||||||
*/
|
*/
|
||||||
@GetMapping("/edit/{configId}")
|
@GetMapping("/edit/{configId}")
|
||||||
public String edit(@PathVariable("configId") Long configId, ModelMap mmap)
|
public String edit(@PathVariable("configId") Long configId, ModelMap mmap)
|
||||||
{
|
{
|
||||||
mmap.put("config", configService.selectConfigById(configId));
|
mmap.put("config", configService.selectConfigById(configId));
|
||||||
return prefix + "/edit";
|
return prefix + "/edit";
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 修改保存参数配置
|
* 修改保存参数配置
|
||||||
*/
|
*/
|
||||||
@RequiresPermissions("system:config:edit")
|
@RequiresPermissions("system:config:edit")
|
||||||
@Log(title = "参数管理", businessType = BusinessType.UPDATE)
|
@Log(title = "参数管理", businessType = BusinessType.UPDATE)
|
||||||
@PostMapping("/edit")
|
@PostMapping("/edit")
|
||||||
@ResponseBody
|
@ResponseBody
|
||||||
public AjaxResult editSave(@Validated SysConfig config)
|
public AjaxResult editSave(@Validated SysConfig config)
|
||||||
{
|
{
|
||||||
if (UserConstants.CONFIG_KEY_NOT_UNIQUE.equals(configService.checkConfigKeyUnique(config)))
|
if (UserConstants.CONFIG_KEY_NOT_UNIQUE.equals(configService.checkConfigKeyUnique(config)))
|
||||||
{
|
{
|
||||||
return error("修改参数'" + config.getConfigName() + "'失败,参数键名已存在");
|
return error("修改参数'" + config.getConfigName() + "'失败,参数键名已存在");
|
||||||
}
|
}
|
||||||
config.setUpdateBy(ShiroUtils.getLoginName());
|
config.setUpdateBy(ShiroUtils.getLoginName());
|
||||||
return toAjax(configService.updateConfig(config));
|
return toAjax(configService.updateConfig(config));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 删除参数配置
|
* 删除参数配置
|
||||||
*/
|
*/
|
||||||
@RequiresPermissions("system:config:remove")
|
@RequiresPermissions("system:config:remove")
|
||||||
@Log(title = "参数管理", businessType = BusinessType.DELETE)
|
@Log(title = "参数管理", businessType = BusinessType.DELETE)
|
||||||
@PostMapping("/remove")
|
@PostMapping("/remove")
|
||||||
@ResponseBody
|
@ResponseBody
|
||||||
public AjaxResult remove(String ids)
|
public AjaxResult remove(String ids)
|
||||||
{
|
{
|
||||||
return toAjax(configService.deleteConfigByIds(ids));
|
return toAjax(configService.deleteConfigByIds(ids));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 清空缓存
|
* 清空缓存
|
||||||
*/
|
*/
|
||||||
@RequiresPermissions("system:config:remove")
|
@RequiresPermissions("system:config:remove")
|
||||||
@Log(title = "参数管理", businessType = BusinessType.CLEAN)
|
@Log(title = "参数管理", businessType = BusinessType.CLEAN)
|
||||||
@GetMapping("/clearCache")
|
@GetMapping("/clearCache")
|
||||||
@ResponseBody
|
@ResponseBody
|
||||||
public AjaxResult clearCache()
|
public AjaxResult clearCache()
|
||||||
{
|
{
|
||||||
configService.clearCache();
|
configService.clearCache();
|
||||||
return success();
|
return success();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 校验参数键名
|
* 校验参数键名
|
||||||
*/
|
*/
|
||||||
@PostMapping("/checkConfigKeyUnique")
|
@PostMapping("/checkConfigKeyUnique")
|
||||||
@ResponseBody
|
@ResponseBody
|
||||||
public String checkConfigKeyUnique(SysConfig config)
|
public String checkConfigKeyUnique(SysConfig config)
|
||||||
{
|
{
|
||||||
return configService.checkConfigKeyUnique(config);
|
return configService.checkConfigKeyUnique(config);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,203 +1,203 @@
|
||||||
package com.ruoyi.web.controller.system;
|
package com.ruoyi.web.controller.system;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Controller;
|
import org.springframework.stereotype.Controller;
|
||||||
import org.springframework.ui.ModelMap;
|
import org.springframework.ui.ModelMap;
|
||||||
import org.springframework.validation.annotation.Validated;
|
import org.springframework.validation.annotation.Validated;
|
||||||
import org.springframework.web.bind.annotation.GetMapping;
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
import org.springframework.web.bind.annotation.PathVariable;
|
import org.springframework.web.bind.annotation.PathVariable;
|
||||||
import org.springframework.web.bind.annotation.PostMapping;
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
import org.springframework.web.bind.annotation.ResponseBody;
|
import org.springframework.web.bind.annotation.ResponseBody;
|
||||||
import com.ruoyi.common.annotation.Log;
|
import com.ruoyi.common.annotation.Log;
|
||||||
import com.ruoyi.common.constant.UserConstants;
|
import com.ruoyi.common.constant.UserConstants;
|
||||||
import com.ruoyi.common.core.controller.BaseController;
|
import com.ruoyi.common.core.controller.BaseController;
|
||||||
import com.ruoyi.common.core.domain.AjaxResult;
|
import com.ruoyi.common.core.domain.AjaxResult;
|
||||||
import com.ruoyi.common.core.domain.Ztree;
|
import com.ruoyi.common.core.domain.Ztree;
|
||||||
import com.ruoyi.common.enums.BusinessType;
|
import com.ruoyi.common.enums.BusinessType;
|
||||||
import com.ruoyi.common.utils.StringUtils;
|
import com.ruoyi.common.utils.StringUtils;
|
||||||
import com.ruoyi.framework.util.ShiroUtils;
|
import com.ruoyi.framework.util.ShiroUtils;
|
||||||
import com.ruoyi.system.domain.SysDept;
|
import com.ruoyi.system.domain.SysDept;
|
||||||
import com.ruoyi.system.domain.SysRole;
|
import com.ruoyi.system.domain.SysRole;
|
||||||
import com.ruoyi.system.service.ISysDeptService;
|
import com.ruoyi.system.service.ISysDeptService;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 部门信息
|
* 部门信息
|
||||||
*
|
*
|
||||||
* @author ruoyi
|
* @author ruoyi
|
||||||
*/
|
*/
|
||||||
@Controller
|
@Controller
|
||||||
@RequestMapping("/system/dept")
|
@RequestMapping("/system/dept")
|
||||||
public class SysDeptController extends BaseController
|
public class SysDeptController extends BaseController
|
||||||
{
|
{
|
||||||
private String prefix = "system/dept";
|
private String prefix = "system/dept";
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private ISysDeptService deptService;
|
private ISysDeptService deptService;
|
||||||
|
|
||||||
@RequiresPermissions("system:dept:view")
|
@RequiresPermissions("system:dept:view")
|
||||||
@GetMapping()
|
@GetMapping()
|
||||||
public String dept()
|
public String dept()
|
||||||
{
|
{
|
||||||
return prefix + "/dept";
|
return prefix + "/dept";
|
||||||
}
|
}
|
||||||
|
|
||||||
@RequiresPermissions("system:dept:list")
|
@RequiresPermissions("system:dept:list")
|
||||||
@PostMapping("/list")
|
@PostMapping("/list")
|
||||||
@ResponseBody
|
@ResponseBody
|
||||||
public List<SysDept> list(SysDept dept)
|
public List<SysDept> list(SysDept dept)
|
||||||
{
|
{
|
||||||
List<SysDept> deptList = deptService.selectDeptList(dept);
|
List<SysDept> deptList = deptService.selectDeptList(dept);
|
||||||
return deptList;
|
return deptList;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 新增部门
|
* 新增部门
|
||||||
*/
|
*/
|
||||||
@GetMapping("/add/{parentId}")
|
@GetMapping("/add/{parentId}")
|
||||||
public String add(@PathVariable("parentId") Long parentId, ModelMap mmap)
|
public String add(@PathVariable("parentId") Long parentId, ModelMap mmap)
|
||||||
{
|
{
|
||||||
mmap.put("dept", deptService.selectDeptById(parentId));
|
mmap.put("dept", deptService.selectDeptById(parentId));
|
||||||
return prefix + "/add";
|
return prefix + "/add";
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 新增保存部门
|
* 新增保存部门
|
||||||
*/
|
*/
|
||||||
@Log(title = "部门管理", businessType = BusinessType.INSERT)
|
@Log(title = "部门管理", businessType = BusinessType.INSERT)
|
||||||
@RequiresPermissions("system:dept:add")
|
@RequiresPermissions("system:dept:add")
|
||||||
@PostMapping("/add")
|
@PostMapping("/add")
|
||||||
@ResponseBody
|
@ResponseBody
|
||||||
public AjaxResult addSave(@Validated SysDept dept)
|
public AjaxResult addSave(@Validated SysDept dept)
|
||||||
{
|
{
|
||||||
if (UserConstants.DEPT_NAME_NOT_UNIQUE.equals(deptService.checkDeptNameUnique(dept)))
|
if (UserConstants.DEPT_NAME_NOT_UNIQUE.equals(deptService.checkDeptNameUnique(dept)))
|
||||||
{
|
{
|
||||||
return error("新增部门'" + dept.getDeptName() + "'失败,部门名称已存在");
|
return error("新增部门'" + dept.getDeptName() + "'失败,部门名称已存在");
|
||||||
}
|
}
|
||||||
dept.setCreateBy(ShiroUtils.getLoginName());
|
dept.setCreateBy(ShiroUtils.getLoginName());
|
||||||
return toAjax(deptService.insertDept(dept));
|
return toAjax(deptService.insertDept(dept));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 修改
|
* 修改
|
||||||
*/
|
*/
|
||||||
@GetMapping("/edit/{deptId}")
|
@GetMapping("/edit/{deptId}")
|
||||||
public String edit(@PathVariable("deptId") Long deptId, ModelMap mmap)
|
public String edit(@PathVariable("deptId") Long deptId, ModelMap mmap)
|
||||||
{
|
{
|
||||||
SysDept dept = deptService.selectDeptById(deptId);
|
SysDept dept = deptService.selectDeptById(deptId);
|
||||||
if (StringUtils.isNotNull(dept) && 100L == deptId)
|
if (StringUtils.isNotNull(dept) && 100L == deptId)
|
||||||
{
|
{
|
||||||
dept.setParentName("无");
|
dept.setParentName("无");
|
||||||
}
|
}
|
||||||
mmap.put("dept", dept);
|
mmap.put("dept", dept);
|
||||||
return prefix + "/edit";
|
return prefix + "/edit";
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 保存
|
* 保存
|
||||||
*/
|
*/
|
||||||
@Log(title = "部门管理", businessType = BusinessType.UPDATE)
|
@Log(title = "部门管理", businessType = BusinessType.UPDATE)
|
||||||
@RequiresPermissions("system:dept:edit")
|
@RequiresPermissions("system:dept:edit")
|
||||||
@PostMapping("/edit")
|
@PostMapping("/edit")
|
||||||
@ResponseBody
|
@ResponseBody
|
||||||
public AjaxResult editSave(@Validated SysDept dept)
|
public AjaxResult editSave(@Validated SysDept dept)
|
||||||
{
|
{
|
||||||
if (UserConstants.DEPT_NAME_NOT_UNIQUE.equals(deptService.checkDeptNameUnique(dept)))
|
if (UserConstants.DEPT_NAME_NOT_UNIQUE.equals(deptService.checkDeptNameUnique(dept)))
|
||||||
{
|
{
|
||||||
return error("修改部门'" + dept.getDeptName() + "'失败,部门名称已存在");
|
return error("修改部门'" + dept.getDeptName() + "'失败,部门名称已存在");
|
||||||
}
|
}
|
||||||
else if (dept.getParentId().equals(dept.getDeptId()))
|
else if (dept.getParentId().equals(dept.getDeptId()))
|
||||||
{
|
{
|
||||||
return error("修改部门'" + dept.getDeptName() + "'失败,上级部门不能是自己");
|
return error("修改部门'" + dept.getDeptName() + "'失败,上级部门不能是自己");
|
||||||
}
|
}
|
||||||
else if (StringUtils.equals(UserConstants.DEPT_DISABLE, dept.getStatus())
|
else if (StringUtils.equals(UserConstants.DEPT_DISABLE, dept.getStatus())
|
||||||
&& deptService.selectNormalChildrenDeptById(dept.getDeptId()) > 0)
|
&& deptService.selectNormalChildrenDeptById(dept.getDeptId()) > 0)
|
||||||
{
|
{
|
||||||
return AjaxResult.error("该部门包含未停用的子部门!");
|
return AjaxResult.error("该部门包含未停用的子部门!");
|
||||||
}
|
}
|
||||||
dept.setUpdateBy(ShiroUtils.getLoginName());
|
dept.setUpdateBy(ShiroUtils.getLoginName());
|
||||||
return toAjax(deptService.updateDept(dept));
|
return toAjax(deptService.updateDept(dept));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 删除
|
* 删除
|
||||||
*/
|
*/
|
||||||
@Log(title = "部门管理", businessType = BusinessType.DELETE)
|
@Log(title = "部门管理", businessType = BusinessType.DELETE)
|
||||||
@RequiresPermissions("system:dept:remove")
|
@RequiresPermissions("system:dept:remove")
|
||||||
@GetMapping("/remove/{deptId}")
|
@GetMapping("/remove/{deptId}")
|
||||||
@ResponseBody
|
@ResponseBody
|
||||||
public AjaxResult remove(@PathVariable("deptId") Long deptId)
|
public AjaxResult remove(@PathVariable("deptId") Long deptId)
|
||||||
{
|
{
|
||||||
if (deptService.selectDeptCount(deptId) > 0)
|
if (deptService.selectDeptCount(deptId) > 0)
|
||||||
{
|
{
|
||||||
return AjaxResult.warn("存在下级部门,不允许删除");
|
return AjaxResult.warn("存在下级部门,不允许删除");
|
||||||
}
|
}
|
||||||
if (deptService.checkDeptExistUser(deptId))
|
if (deptService.checkDeptExistUser(deptId))
|
||||||
{
|
{
|
||||||
return AjaxResult.warn("部门存在用户,不允许删除");
|
return AjaxResult.warn("部门存在用户,不允许删除");
|
||||||
}
|
}
|
||||||
return toAjax(deptService.deleteDeptById(deptId));
|
return toAjax(deptService.deleteDeptById(deptId));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 校验部门名称
|
* 校验部门名称
|
||||||
*/
|
*/
|
||||||
@PostMapping("/checkDeptNameUnique")
|
@PostMapping("/checkDeptNameUnique")
|
||||||
@ResponseBody
|
@ResponseBody
|
||||||
public String checkDeptNameUnique(SysDept dept)
|
public String checkDeptNameUnique(SysDept dept)
|
||||||
{
|
{
|
||||||
return deptService.checkDeptNameUnique(dept);
|
return deptService.checkDeptNameUnique(dept);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 选择部门树
|
* 选择部门树
|
||||||
*
|
*
|
||||||
* @param deptId 部门ID
|
* @param deptId 部门ID
|
||||||
* @param excludeId 排除ID
|
* @param excludeId 排除ID
|
||||||
*/
|
*/
|
||||||
@GetMapping(value = { "/selectDeptTree/{deptId}", "/selectDeptTree/{deptId}/{excludeId}" })
|
@GetMapping(value = { "/selectDeptTree/{deptId}", "/selectDeptTree/{deptId}/{excludeId}" })
|
||||||
public String selectDeptTree(@PathVariable("deptId") Long deptId,
|
public String selectDeptTree(@PathVariable("deptId") Long deptId,
|
||||||
@PathVariable(value = "excludeId", required = false) String excludeId, ModelMap mmap)
|
@PathVariable(value = "excludeId", required = false) String excludeId, ModelMap mmap)
|
||||||
{
|
{
|
||||||
mmap.put("dept", deptService.selectDeptById(deptId));
|
mmap.put("dept", deptService.selectDeptById(deptId));
|
||||||
mmap.put("excludeId", excludeId);
|
mmap.put("excludeId", excludeId);
|
||||||
return prefix + "/tree";
|
return prefix + "/tree";
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 加载部门列表树
|
* 加载部门列表树
|
||||||
*/
|
*/
|
||||||
@GetMapping("/treeData")
|
@GetMapping("/treeData")
|
||||||
@ResponseBody
|
@ResponseBody
|
||||||
public List<Ztree> treeData()
|
public List<Ztree> treeData()
|
||||||
{
|
{
|
||||||
List<Ztree> ztrees = deptService.selectDeptTree(new SysDept());
|
List<Ztree> ztrees = deptService.selectDeptTree(new SysDept());
|
||||||
return ztrees;
|
return ztrees;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 加载部门列表树(排除下级)
|
* 加载部门列表树(排除下级)
|
||||||
*/
|
*/
|
||||||
@GetMapping("/treeData/{excludeId}")
|
@GetMapping("/treeData/{excludeId}")
|
||||||
@ResponseBody
|
@ResponseBody
|
||||||
public List<Ztree> treeDataExcludeChild(@PathVariable(value = "excludeId", required = false) Long excludeId)
|
public List<Ztree> treeDataExcludeChild(@PathVariable(value = "excludeId", required = false) Long excludeId)
|
||||||
{
|
{
|
||||||
SysDept dept = new SysDept();
|
SysDept dept = new SysDept();
|
||||||
dept.setDeptId(excludeId);
|
dept.setDeptId(excludeId);
|
||||||
List<Ztree> ztrees = deptService.selectDeptTreeExcludeChild(dept);
|
List<Ztree> ztrees = deptService.selectDeptTreeExcludeChild(dept);
|
||||||
return ztrees;
|
return ztrees;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 加载角色部门(数据权限)列表树
|
* 加载角色部门(数据权限)列表树
|
||||||
*/
|
*/
|
||||||
@GetMapping("/roleDeptTreeData")
|
@GetMapping("/roleDeptTreeData")
|
||||||
@ResponseBody
|
@ResponseBody
|
||||||
public List<Ztree> deptTreeData(SysRole role)
|
public List<Ztree> deptTreeData(SysRole role)
|
||||||
{
|
{
|
||||||
List<Ztree> ztrees = deptService.roleDeptTreeData(role);
|
List<Ztree> ztrees = deptService.roleDeptTreeData(role);
|
||||||
return ztrees;
|
return ztrees;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,120 +1,107 @@
|
||||||
package com.ruoyi.web.controller.system;
|
package com.ruoyi.web.controller.system;
|
||||||
|
|
||||||
import java.util.List;
|
import com.ruoyi.common.annotation.Log;
|
||||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
import com.ruoyi.common.core.controller.BaseController;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import com.ruoyi.common.core.domain.AjaxResult;
|
||||||
import org.springframework.stereotype.Controller;
|
import com.ruoyi.common.core.page.TableDataInfo;
|
||||||
import org.springframework.ui.ModelMap;
|
import com.ruoyi.common.enums.BusinessType;
|
||||||
import org.springframework.validation.annotation.Validated;
|
import com.ruoyi.common.utils.poi.ExcelUtil;
|
||||||
import org.springframework.web.bind.annotation.GetMapping;
|
import com.ruoyi.framework.util.ShiroUtils;
|
||||||
import org.springframework.web.bind.annotation.PathVariable;
|
import com.ruoyi.system.domain.SysDictData;
|
||||||
import org.springframework.web.bind.annotation.PostMapping;
|
import com.ruoyi.system.service.ISysDictDataService;
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||||
import org.springframework.web.bind.annotation.ResponseBody;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import com.ruoyi.common.annotation.Log;
|
import org.springframework.data.domain.Pageable;
|
||||||
import com.ruoyi.common.core.controller.BaseController;
|
import org.springframework.stereotype.Controller;
|
||||||
import com.ruoyi.common.core.domain.AjaxResult;
|
import org.springframework.ui.ModelMap;
|
||||||
import com.ruoyi.common.core.page.TableDataInfo;
|
import org.springframework.validation.annotation.Validated;
|
||||||
import com.ruoyi.common.enums.BusinessType;
|
import org.springframework.web.bind.annotation.*;
|
||||||
import com.ruoyi.common.utils.poi.ExcelUtil;
|
|
||||||
import com.ruoyi.framework.util.ShiroUtils;
|
import java.util.List;
|
||||||
import com.ruoyi.system.domain.SysDictData;
|
|
||||||
import com.ruoyi.system.service.ISysDictDataService;
|
/**
|
||||||
|
* 数据字典信息
|
||||||
/**
|
*
|
||||||
* 数据字典信息
|
* @author ruoyi
|
||||||
*
|
*/
|
||||||
* @author ruoyi
|
@Controller
|
||||||
*/
|
@RequestMapping("/system/dict/data")
|
||||||
@Controller
|
public class SysDictDataController extends BaseController {
|
||||||
@RequestMapping("/system/dict/data")
|
private String prefix = "system/dict/data";
|
||||||
public class SysDictDataController extends BaseController
|
|
||||||
{
|
@Autowired
|
||||||
private String prefix = "system/dict/data";
|
private ISysDictDataService dictDataService;
|
||||||
|
|
||||||
@Autowired
|
@RequiresPermissions("system:dict:view")
|
||||||
private ISysDictDataService dictDataService;
|
@GetMapping()
|
||||||
|
public String dictData() {
|
||||||
@RequiresPermissions("system:dict:view")
|
return prefix + "/data";
|
||||||
@GetMapping()
|
}
|
||||||
public String dictData()
|
|
||||||
{
|
@PostMapping("/list")
|
||||||
return prefix + "/data";
|
@RequiresPermissions("system:dict:list")
|
||||||
}
|
@ResponseBody
|
||||||
|
public TableDataInfo list(SysDictData dictData) {
|
||||||
@PostMapping("/list")
|
return getDataTable(dictDataService.selectDictDataList(dictData, getPageRequest()));
|
||||||
@RequiresPermissions("system:dict:list")
|
}
|
||||||
@ResponseBody
|
|
||||||
public TableDataInfo list(SysDictData dictData)
|
@Log(title = "字典数据", businessType = BusinessType.EXPORT)
|
||||||
{
|
@RequiresPermissions("system:dict:export")
|
||||||
startPage();
|
@PostMapping("/export")
|
||||||
List<SysDictData> list = dictDataService.selectDictDataList(dictData);
|
@ResponseBody
|
||||||
return getDataTable(list);
|
public AjaxResult export(SysDictData dictData) {
|
||||||
}
|
List<SysDictData> list = dictDataService.selectDictDataList(dictData, Pageable.unpaged()).getContent();
|
||||||
|
ExcelUtil<SysDictData> util = new ExcelUtil<SysDictData>(SysDictData.class);
|
||||||
@Log(title = "字典数据", businessType = BusinessType.EXPORT)
|
return util.exportExcel(list, "字典数据");
|
||||||
@RequiresPermissions("system:dict:export")
|
}
|
||||||
@PostMapping("/export")
|
|
||||||
@ResponseBody
|
/**
|
||||||
public AjaxResult export(SysDictData dictData)
|
* 新增字典类型
|
||||||
{
|
*/
|
||||||
List<SysDictData> list = dictDataService.selectDictDataList(dictData);
|
@GetMapping("/add/{dictType}")
|
||||||
ExcelUtil<SysDictData> util = new ExcelUtil<SysDictData>(SysDictData.class);
|
public String add(@PathVariable("dictType") String dictType, ModelMap mmap) {
|
||||||
return util.exportExcel(list, "字典数据");
|
mmap.put("dictType", dictType);
|
||||||
}
|
return prefix + "/add";
|
||||||
|
}
|
||||||
/**
|
|
||||||
* 新增字典类型
|
/**
|
||||||
*/
|
* 新增保存字典类型
|
||||||
@GetMapping("/add/{dictType}")
|
*/
|
||||||
public String add(@PathVariable("dictType") String dictType, ModelMap mmap)
|
@Log(title = "字典数据", businessType = BusinessType.INSERT)
|
||||||
{
|
@RequiresPermissions("system:dict:add")
|
||||||
mmap.put("dictType", dictType);
|
@PostMapping("/add")
|
||||||
return prefix + "/add";
|
@ResponseBody
|
||||||
}
|
public AjaxResult addSave(@Validated SysDictData dict) {
|
||||||
|
dict.setCreateBy(ShiroUtils.getLoginName());
|
||||||
/**
|
return toAjax(dictDataService.insertDictData(dict));
|
||||||
* 新增保存字典类型
|
}
|
||||||
*/
|
|
||||||
@Log(title = "字典数据", businessType = BusinessType.INSERT)
|
/**
|
||||||
@RequiresPermissions("system:dict:add")
|
* 修改字典类型
|
||||||
@PostMapping("/add")
|
*/
|
||||||
@ResponseBody
|
@GetMapping("/edit/{dictCode}")
|
||||||
public AjaxResult addSave(@Validated SysDictData dict)
|
public String edit(@PathVariable("dictCode") Long dictCode, ModelMap mmap) {
|
||||||
{
|
mmap.put("dict", dictDataService.selectDictDataById(dictCode));
|
||||||
dict.setCreateBy(ShiroUtils.getLoginName());
|
return prefix + "/edit";
|
||||||
return toAjax(dictDataService.insertDictData(dict));
|
}
|
||||||
}
|
|
||||||
|
/**
|
||||||
/**
|
* 修改保存字典类型
|
||||||
* 修改字典类型
|
*/
|
||||||
*/
|
@Log(title = "字典数据", businessType = BusinessType.UPDATE)
|
||||||
@GetMapping("/edit/{dictCode}")
|
@RequiresPermissions("system:dict:edit")
|
||||||
public String edit(@PathVariable("dictCode") Long dictCode, ModelMap mmap)
|
@PostMapping("/edit")
|
||||||
{
|
@ResponseBody
|
||||||
mmap.put("dict", dictDataService.selectDictDataById(dictCode));
|
public AjaxResult editSave(@Validated SysDictData dict) {
|
||||||
return prefix + "/edit";
|
dict.setUpdateBy(ShiroUtils.getLoginName());
|
||||||
}
|
return toAjax(dictDataService.updateDictData(dict));
|
||||||
|
}
|
||||||
/**
|
|
||||||
* 修改保存字典类型
|
@Log(title = "字典数据", businessType = BusinessType.DELETE)
|
||||||
*/
|
@RequiresPermissions("system:dict:remove")
|
||||||
@Log(title = "字典数据", businessType = BusinessType.UPDATE)
|
@PostMapping("/remove")
|
||||||
@RequiresPermissions("system:dict:edit")
|
@ResponseBody
|
||||||
@PostMapping("/edit")
|
public AjaxResult remove(String ids) {
|
||||||
@ResponseBody
|
return toAjax(dictDataService.deleteDictDataByIds(ids));
|
||||||
public AjaxResult editSave(@Validated SysDictData dict)
|
}
|
||||||
{
|
}
|
||||||
dict.setUpdateBy(ShiroUtils.getLoginName());
|
|
||||||
return toAjax(dictDataService.updateDictData(dict));
|
|
||||||
}
|
|
||||||
|
|
||||||
@Log(title = "字典数据", businessType = BusinessType.DELETE)
|
|
||||||
@RequiresPermissions("system:dict:remove")
|
|
||||||
@PostMapping("/remove")
|
|
||||||
@ResponseBody
|
|
||||||
public AjaxResult remove(String ids)
|
|
||||||
{
|
|
||||||
return toAjax(dictDataService.deleteDictDataByIds(ids));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
|
||||||
|
|
@ -1,188 +1,188 @@
|
||||||
package com.ruoyi.web.controller.system;
|
package com.ruoyi.web.controller.system;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Controller;
|
import org.springframework.stereotype.Controller;
|
||||||
import org.springframework.ui.ModelMap;
|
import org.springframework.ui.ModelMap;
|
||||||
import org.springframework.validation.annotation.Validated;
|
import org.springframework.validation.annotation.Validated;
|
||||||
import org.springframework.web.bind.annotation.GetMapping;
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
import org.springframework.web.bind.annotation.PathVariable;
|
import org.springframework.web.bind.annotation.PathVariable;
|
||||||
import org.springframework.web.bind.annotation.PostMapping;
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
import org.springframework.web.bind.annotation.ResponseBody;
|
import org.springframework.web.bind.annotation.ResponseBody;
|
||||||
import com.ruoyi.common.annotation.Log;
|
import com.ruoyi.common.annotation.Log;
|
||||||
import com.ruoyi.common.constant.UserConstants;
|
import com.ruoyi.common.constant.UserConstants;
|
||||||
import com.ruoyi.common.core.controller.BaseController;
|
import com.ruoyi.common.core.controller.BaseController;
|
||||||
import com.ruoyi.common.core.domain.AjaxResult;
|
import com.ruoyi.common.core.domain.AjaxResult;
|
||||||
import com.ruoyi.common.core.domain.Ztree;
|
import com.ruoyi.common.core.domain.Ztree;
|
||||||
import com.ruoyi.common.core.page.TableDataInfo;
|
import com.ruoyi.common.core.page.TableDataInfo;
|
||||||
import com.ruoyi.common.enums.BusinessType;
|
import com.ruoyi.common.enums.BusinessType;
|
||||||
import com.ruoyi.common.utils.poi.ExcelUtil;
|
import com.ruoyi.common.utils.poi.ExcelUtil;
|
||||||
import com.ruoyi.framework.util.ShiroUtils;
|
import com.ruoyi.framework.util.ShiroUtils;
|
||||||
import com.ruoyi.system.domain.SysDictType;
|
import com.ruoyi.system.domain.SysDictType;
|
||||||
import com.ruoyi.system.service.ISysDictTypeService;
|
import com.ruoyi.system.service.ISysDictTypeService;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 数据字典信息
|
* 数据字典信息
|
||||||
*
|
*
|
||||||
* @author ruoyi
|
* @author ruoyi
|
||||||
*/
|
*/
|
||||||
@Controller
|
@Controller
|
||||||
@RequestMapping("/system/dict")
|
@RequestMapping("/system/dict")
|
||||||
public class SysDictTypeController extends BaseController
|
public class SysDictTypeController extends BaseController
|
||||||
{
|
{
|
||||||
private String prefix = "system/dict/type";
|
private String prefix = "system/dict/type";
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private ISysDictTypeService dictTypeService;
|
private ISysDictTypeService dictTypeService;
|
||||||
|
|
||||||
@RequiresPermissions("system:dict:view")
|
@RequiresPermissions("system:dict:view")
|
||||||
@GetMapping()
|
@GetMapping()
|
||||||
public String dictType()
|
public String dictType()
|
||||||
{
|
{
|
||||||
return prefix + "/type";
|
return prefix + "/type";
|
||||||
}
|
}
|
||||||
|
|
||||||
@PostMapping("/list")
|
@PostMapping("/list")
|
||||||
@RequiresPermissions("system:dict:list")
|
@RequiresPermissions("system:dict:list")
|
||||||
@ResponseBody
|
@ResponseBody
|
||||||
public TableDataInfo list(SysDictType dictType)
|
public TableDataInfo list(SysDictType dictType)
|
||||||
{
|
{
|
||||||
startPage();
|
startPage();
|
||||||
List<SysDictType> list = dictTypeService.selectDictTypeList(dictType);
|
List<SysDictType> list = dictTypeService.selectDictTypeList(dictType);
|
||||||
return getDataTable(list);
|
return getDataTable(list);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Log(title = "字典类型", businessType = BusinessType.EXPORT)
|
@Log(title = "字典类型", businessType = BusinessType.EXPORT)
|
||||||
@RequiresPermissions("system:dict:export")
|
@RequiresPermissions("system:dict:export")
|
||||||
@PostMapping("/export")
|
@PostMapping("/export")
|
||||||
@ResponseBody
|
@ResponseBody
|
||||||
public AjaxResult export(SysDictType dictType)
|
public AjaxResult export(SysDictType dictType)
|
||||||
{
|
{
|
||||||
|
|
||||||
List<SysDictType> list = dictTypeService.selectDictTypeList(dictType);
|
List<SysDictType> list = dictTypeService.selectDictTypeList(dictType);
|
||||||
ExcelUtil<SysDictType> util = new ExcelUtil<SysDictType>(SysDictType.class);
|
ExcelUtil<SysDictType> util = new ExcelUtil<SysDictType>(SysDictType.class);
|
||||||
return util.exportExcel(list, "字典类型");
|
return util.exportExcel(list, "字典类型");
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 新增字典类型
|
* 新增字典类型
|
||||||
*/
|
*/
|
||||||
@GetMapping("/add")
|
@GetMapping("/add")
|
||||||
public String add()
|
public String add()
|
||||||
{
|
{
|
||||||
return prefix + "/add";
|
return prefix + "/add";
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 新增保存字典类型
|
* 新增保存字典类型
|
||||||
*/
|
*/
|
||||||
@Log(title = "字典类型", businessType = BusinessType.INSERT)
|
@Log(title = "字典类型", businessType = BusinessType.INSERT)
|
||||||
@RequiresPermissions("system:dict:add")
|
@RequiresPermissions("system:dict:add")
|
||||||
@PostMapping("/add")
|
@PostMapping("/add")
|
||||||
@ResponseBody
|
@ResponseBody
|
||||||
public AjaxResult addSave(@Validated SysDictType dict)
|
public AjaxResult addSave(@Validated SysDictType dict)
|
||||||
{
|
{
|
||||||
if (UserConstants.DICT_TYPE_NOT_UNIQUE.equals(dictTypeService.checkDictTypeUnique(dict)))
|
if (UserConstants.DICT_TYPE_NOT_UNIQUE.equals(dictTypeService.checkDictTypeUnique(dict)))
|
||||||
{
|
{
|
||||||
return error("新增字典'" + dict.getDictName() + "'失败,字典类型已存在");
|
return error("新增字典'" + dict.getDictName() + "'失败,字典类型已存在");
|
||||||
}
|
}
|
||||||
dict.setCreateBy(ShiroUtils.getLoginName());
|
dict.setCreateBy(ShiroUtils.getLoginName());
|
||||||
return toAjax(dictTypeService.insertDictType(dict));
|
return toAjax(dictTypeService.insertDictType(dict));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 修改字典类型
|
* 修改字典类型
|
||||||
*/
|
*/
|
||||||
@GetMapping("/edit/{dictId}")
|
@GetMapping("/edit/{dictId}")
|
||||||
public String edit(@PathVariable("dictId") Long dictId, ModelMap mmap)
|
public String edit(@PathVariable("dictId") Long dictId, ModelMap mmap)
|
||||||
{
|
{
|
||||||
mmap.put("dict", dictTypeService.selectDictTypeById(dictId));
|
mmap.put("dict", dictTypeService.selectDictTypeById(dictId));
|
||||||
return prefix + "/edit";
|
return prefix + "/edit";
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 修改保存字典类型
|
* 修改保存字典类型
|
||||||
*/
|
*/
|
||||||
@Log(title = "字典类型", businessType = BusinessType.UPDATE)
|
@Log(title = "字典类型", businessType = BusinessType.UPDATE)
|
||||||
@RequiresPermissions("system:dict:edit")
|
@RequiresPermissions("system:dict:edit")
|
||||||
@PostMapping("/edit")
|
@PostMapping("/edit")
|
||||||
@ResponseBody
|
@ResponseBody
|
||||||
public AjaxResult editSave(@Validated SysDictType dict)
|
public AjaxResult editSave(@Validated SysDictType dict)
|
||||||
{
|
{
|
||||||
if (UserConstants.DICT_TYPE_NOT_UNIQUE.equals(dictTypeService.checkDictTypeUnique(dict)))
|
if (UserConstants.DICT_TYPE_NOT_UNIQUE.equals(dictTypeService.checkDictTypeUnique(dict)))
|
||||||
{
|
{
|
||||||
return error("修改字典'" + dict.getDictName() + "'失败,字典类型已存在");
|
return error("修改字典'" + dict.getDictName() + "'失败,字典类型已存在");
|
||||||
}
|
}
|
||||||
dict.setUpdateBy(ShiroUtils.getLoginName());
|
dict.setUpdateBy(ShiroUtils.getLoginName());
|
||||||
return toAjax(dictTypeService.updateDictType(dict));
|
return toAjax(dictTypeService.updateDictType(dict));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Log(title = "字典类型", businessType = BusinessType.DELETE)
|
@Log(title = "字典类型", businessType = BusinessType.DELETE)
|
||||||
@RequiresPermissions("system:dict:remove")
|
@RequiresPermissions("system:dict:remove")
|
||||||
@PostMapping("/remove")
|
@PostMapping("/remove")
|
||||||
@ResponseBody
|
@ResponseBody
|
||||||
public AjaxResult remove(String ids)
|
public AjaxResult remove(String ids)
|
||||||
{
|
{
|
||||||
return toAjax(dictTypeService.deleteDictTypeByIds(ids));
|
return toAjax(dictTypeService.deleteDictTypeByIds(ids));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 清空缓存
|
* 清空缓存
|
||||||
*/
|
*/
|
||||||
@RequiresPermissions("system:dict:remove")
|
@RequiresPermissions("system:dict:remove")
|
||||||
@Log(title = "字典类型", businessType = BusinessType.CLEAN)
|
@Log(title = "字典类型", businessType = BusinessType.CLEAN)
|
||||||
@GetMapping("/clearCache")
|
@GetMapping("/clearCache")
|
||||||
@ResponseBody
|
@ResponseBody
|
||||||
public AjaxResult clearCache()
|
public AjaxResult clearCache()
|
||||||
{
|
{
|
||||||
dictTypeService.clearCache();
|
dictTypeService.clearCache();
|
||||||
return success();
|
return success();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询字典详细
|
* 查询字典详细
|
||||||
*/
|
*/
|
||||||
@RequiresPermissions("system:dict:list")
|
@RequiresPermissions("system:dict:list")
|
||||||
@GetMapping("/detail/{dictId}")
|
@GetMapping("/detail/{dictId}")
|
||||||
public String detail(@PathVariable("dictId") Long dictId, ModelMap mmap)
|
public String detail(@PathVariable("dictId") Long dictId, ModelMap mmap)
|
||||||
{
|
{
|
||||||
mmap.put("dict", dictTypeService.selectDictTypeById(dictId));
|
mmap.put("dict", dictTypeService.selectDictTypeById(dictId));
|
||||||
mmap.put("dictList", dictTypeService.selectDictTypeAll());
|
mmap.put("dictList", dictTypeService.selectDictTypeAll());
|
||||||
return "system/dict/data/data";
|
return "system/dict/data/data";
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 校验字典类型
|
* 校验字典类型
|
||||||
*/
|
*/
|
||||||
@PostMapping("/checkDictTypeUnique")
|
@PostMapping("/checkDictTypeUnique")
|
||||||
@ResponseBody
|
@ResponseBody
|
||||||
public String checkDictTypeUnique(SysDictType dictType)
|
public String checkDictTypeUnique(SysDictType dictType)
|
||||||
{
|
{
|
||||||
return dictTypeService.checkDictTypeUnique(dictType);
|
return dictTypeService.checkDictTypeUnique(dictType);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 选择字典树
|
* 选择字典树
|
||||||
*/
|
*/
|
||||||
@GetMapping("/selectDictTree/{columnId}/{dictType}")
|
@GetMapping("/selectDictTree/{columnId}/{dictType}")
|
||||||
public String selectDeptTree(@PathVariable("columnId") Long columnId, @PathVariable("dictType") String dictType,
|
public String selectDeptTree(@PathVariable("columnId") Long columnId, @PathVariable("dictType") String dictType,
|
||||||
ModelMap mmap)
|
ModelMap mmap)
|
||||||
{
|
{
|
||||||
mmap.put("columnId", columnId);
|
mmap.put("columnId", columnId);
|
||||||
mmap.put("dict", dictTypeService.selectDictTypeByType(dictType));
|
mmap.put("dict", dictTypeService.selectDictTypeByType(dictType));
|
||||||
return prefix + "/tree";
|
return prefix + "/tree";
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 加载字典列表树
|
* 加载字典列表树
|
||||||
*/
|
*/
|
||||||
@GetMapping("/treeData")
|
@GetMapping("/treeData")
|
||||||
@ResponseBody
|
@ResponseBody
|
||||||
public List<Ztree> treeData()
|
public List<Ztree> treeData()
|
||||||
{
|
{
|
||||||
List<Ztree> ztrees = dictTypeService.selectDictTree(new SysDictType());
|
List<Ztree> ztrees = dictTypeService.selectDictTree(new SysDictType());
|
||||||
return ztrees;
|
return ztrees;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,93 +1,93 @@
|
||||||
package com.ruoyi.web.controller.system;
|
package com.ruoyi.web.controller.system;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import javax.servlet.http.Cookie;
|
import javax.servlet.http.Cookie;
|
||||||
import javax.servlet.http.HttpServletResponse;
|
import javax.servlet.http.HttpServletResponse;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Controller;
|
import org.springframework.stereotype.Controller;
|
||||||
import org.springframework.ui.ModelMap;
|
import org.springframework.ui.ModelMap;
|
||||||
import org.springframework.web.bind.annotation.GetMapping;
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
import org.springframework.web.bind.annotation.PathVariable;
|
import org.springframework.web.bind.annotation.PathVariable;
|
||||||
import com.ruoyi.common.config.Global;
|
import com.ruoyi.common.config.Global;
|
||||||
import com.ruoyi.common.core.controller.BaseController;
|
import com.ruoyi.common.core.controller.BaseController;
|
||||||
import com.ruoyi.common.utils.CookieUtils;
|
import com.ruoyi.common.utils.CookieUtils;
|
||||||
import com.ruoyi.common.utils.ServletUtils;
|
import com.ruoyi.common.utils.ServletUtils;
|
||||||
import com.ruoyi.common.utils.StringUtils;
|
import com.ruoyi.common.utils.StringUtils;
|
||||||
import com.ruoyi.framework.util.ShiroUtils;
|
import com.ruoyi.framework.util.ShiroUtils;
|
||||||
import com.ruoyi.system.domain.SysMenu;
|
import com.ruoyi.system.domain.SysMenu;
|
||||||
import com.ruoyi.system.domain.SysUser;
|
import com.ruoyi.system.domain.SysUser;
|
||||||
import com.ruoyi.system.service.ISysConfigService;
|
import com.ruoyi.system.service.ISysConfigService;
|
||||||
import com.ruoyi.system.service.ISysMenuService;
|
import com.ruoyi.system.service.ISysMenuService;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 首页 业务处理
|
* 首页 业务处理
|
||||||
*
|
*
|
||||||
* @author ruoyi
|
* @author ruoyi
|
||||||
*/
|
*/
|
||||||
@Controller
|
@Controller
|
||||||
public class SysIndexController extends BaseController
|
public class SysIndexController extends BaseController
|
||||||
{
|
{
|
||||||
@Autowired
|
@Autowired
|
||||||
private ISysMenuService menuService;
|
private ISysMenuService menuService;
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private ISysConfigService configService;
|
private ISysConfigService configService;
|
||||||
|
|
||||||
// 系统首页
|
// 系统首页
|
||||||
@GetMapping("/index")
|
@GetMapping("/index")
|
||||||
public String index(ModelMap mmap)
|
public String index(ModelMap mmap)
|
||||||
{
|
{
|
||||||
// 取身份信息
|
// 取身份信息
|
||||||
SysUser user = ShiroUtils.getSysUser();
|
SysUser user = ShiroUtils.getSysUser();
|
||||||
// 根据用户id取出菜单
|
// 根据用户id取出菜单
|
||||||
List<SysMenu> menus = menuService.selectMenusByUser(user);
|
List<SysMenu> menus = menuService.selectMenusByUser(user);
|
||||||
mmap.put("menus", menus);
|
mmap.put("menus", menus);
|
||||||
mmap.put("user", user);
|
mmap.put("user", user);
|
||||||
mmap.put("sideTheme", configService.selectConfigByKey("sys.index.sideTheme"));
|
mmap.put("sideTheme", configService.selectConfigByKey("sys.index.sideTheme"));
|
||||||
mmap.put("skinName", configService.selectConfigByKey("sys.index.skinName"));
|
mmap.put("skinName", configService.selectConfigByKey("sys.index.skinName"));
|
||||||
mmap.put("ignoreFooter", configService.selectConfigByKey("sys.index.ignoreFooter"));
|
mmap.put("ignoreFooter", configService.selectConfigByKey("sys.index.ignoreFooter"));
|
||||||
mmap.put("copyrightYear", Global.getCopyrightYear());
|
mmap.put("copyrightYear", Global.getCopyrightYear());
|
||||||
mmap.put("demoEnabled", Global.isDemoEnabled());
|
mmap.put("demoEnabled", Global.isDemoEnabled());
|
||||||
|
|
||||||
// 菜单导航显示风格
|
// 菜单导航显示风格
|
||||||
String menuStyle = configService.selectConfigByKey("sys.index.menuStyle");
|
String menuStyle = configService.selectConfigByKey("sys.index.menuStyle");
|
||||||
// 移动端,默认使左侧导航菜单,否则取默认配置
|
// 移动端,默认使左侧导航菜单,否则取默认配置
|
||||||
String indexStyle = ServletUtils.checkAgentIsMobile(ServletUtils.getRequest().getHeader("User-Agent")) ? "index" : menuStyle;
|
String indexStyle = ServletUtils.checkAgentIsMobile(ServletUtils.getRequest().getHeader("User-Agent")) ? "index" : menuStyle;
|
||||||
|
|
||||||
// 优先Cookie配置导航菜单
|
// 优先Cookie配置导航菜单
|
||||||
Cookie[] cookies = ServletUtils.getRequest().getCookies();
|
Cookie[] cookies = ServletUtils.getRequest().getCookies();
|
||||||
for (Cookie cookie : cookies)
|
for (Cookie cookie : cookies)
|
||||||
{
|
{
|
||||||
if (StringUtils.isNotEmpty(cookie.getName()) && "nav-style".equalsIgnoreCase(cookie.getName()))
|
if (StringUtils.isNotEmpty(cookie.getName()) && "nav-style".equalsIgnoreCase(cookie.getName()))
|
||||||
{
|
{
|
||||||
indexStyle = cookie.getValue();
|
indexStyle = cookie.getValue();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
String webIndex = "topnav".equalsIgnoreCase(indexStyle) ? "index-topnav" : "index";
|
String webIndex = "topnav".equalsIgnoreCase(indexStyle) ? "index-topnav" : "index";
|
||||||
return webIndex;
|
return webIndex;
|
||||||
}
|
}
|
||||||
|
|
||||||
// 切换主题
|
// 切换主题
|
||||||
@GetMapping("/system/switchSkin")
|
@GetMapping("/system/switchSkin")
|
||||||
public String switchSkin()
|
public String switchSkin()
|
||||||
{
|
{
|
||||||
return "skin";
|
return "skin";
|
||||||
}
|
}
|
||||||
|
|
||||||
// 切换菜单
|
// 切换菜单
|
||||||
@GetMapping("/system/menuStyle/{style}")
|
@GetMapping("/system/menuStyle/{style}")
|
||||||
public void menuStyle(@PathVariable String style, HttpServletResponse response)
|
public void menuStyle(@PathVariable String style, HttpServletResponse response)
|
||||||
{
|
{
|
||||||
CookieUtils.setCookie(response, "nav-style", style);
|
CookieUtils.setCookie(response, "nav-style", style);
|
||||||
}
|
}
|
||||||
|
|
||||||
// 系统介绍
|
// 系统介绍
|
||||||
@GetMapping("/system/main")
|
@GetMapping("/system/main")
|
||||||
public String main(ModelMap mmap)
|
public String main(ModelMap mmap)
|
||||||
{
|
{
|
||||||
mmap.put("version", Global.getVersion());
|
mmap.put("version", Global.getVersion());
|
||||||
return "main";
|
return "main";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -2,6 +2,7 @@ package com.ruoyi.web.controller.system;
|
||||||
|
|
||||||
import javax.servlet.http.HttpServletRequest;
|
import javax.servlet.http.HttpServletRequest;
|
||||||
import javax.servlet.http.HttpServletResponse;
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
|
||||||
import org.apache.shiro.SecurityUtils;
|
import org.apache.shiro.SecurityUtils;
|
||||||
import org.apache.shiro.authc.AuthenticationException;
|
import org.apache.shiro.authc.AuthenticationException;
|
||||||
import org.apache.shiro.authc.UsernamePasswordToken;
|
import org.apache.shiro.authc.UsernamePasswordToken;
|
||||||
|
|
@ -17,18 +18,15 @@ import com.ruoyi.common.utils.StringUtils;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 登录验证
|
* 登录验证
|
||||||
*
|
*
|
||||||
* @author ruoyi
|
* @author ruoyi
|
||||||
*/
|
*/
|
||||||
@Controller
|
@Controller
|
||||||
public class SysLoginController extends BaseController
|
public class SysLoginController extends BaseController {
|
||||||
{
|
|
||||||
@GetMapping("/login")
|
@GetMapping("/login")
|
||||||
public String login(HttpServletRequest request, HttpServletResponse response)
|
public String login(HttpServletRequest request, HttpServletResponse response) {
|
||||||
{
|
|
||||||
// 如果是Ajax请求,返回Json字符串。
|
// 如果是Ajax请求,返回Json字符串。
|
||||||
if (ServletUtils.isAjaxRequest(request))
|
if (ServletUtils.isAjaxRequest(request)) {
|
||||||
{
|
|
||||||
return ServletUtils.renderString(response, "{\"code\":\"1\",\"msg\":\"未登录或登录超时。请重新登录\"}");
|
return ServletUtils.renderString(response, "{\"code\":\"1\",\"msg\":\"未登录或登录超时。请重新登录\"}");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -37,20 +35,15 @@ public class SysLoginController extends BaseController
|
||||||
|
|
||||||
@PostMapping("/login")
|
@PostMapping("/login")
|
||||||
@ResponseBody
|
@ResponseBody
|
||||||
public AjaxResult ajaxLogin(String username, String password, Boolean rememberMe)
|
public AjaxResult ajaxLogin(String username, String password, Boolean rememberMe) {
|
||||||
{
|
|
||||||
UsernamePasswordToken token = new UsernamePasswordToken(username, password, rememberMe);
|
UsernamePasswordToken token = new UsernamePasswordToken(username, password, rememberMe);
|
||||||
Subject subject = SecurityUtils.getSubject();
|
Subject subject = SecurityUtils.getSubject();
|
||||||
try
|
try {
|
||||||
{
|
|
||||||
subject.login(token);
|
subject.login(token);
|
||||||
return success();
|
return success();
|
||||||
}
|
} catch (AuthenticationException e) {
|
||||||
catch (AuthenticationException e)
|
|
||||||
{
|
|
||||||
String msg = "用户或密码错误";
|
String msg = "用户或密码错误";
|
||||||
if (StringUtils.isNotEmpty(e.getMessage()))
|
if (StringUtils.isNotEmpty(e.getMessage())) {
|
||||||
{
|
|
||||||
msg = e.getMessage();
|
msg = e.getMessage();
|
||||||
}
|
}
|
||||||
return error(msg);
|
return error(msg);
|
||||||
|
|
@ -58,8 +51,7 @@ public class SysLoginController extends BaseController
|
||||||
}
|
}
|
||||||
|
|
||||||
@GetMapping("/unauth")
|
@GetMapping("/unauth")
|
||||||
public String unauth()
|
public String unauth() {
|
||||||
{
|
|
||||||
return "error/unauth";
|
return "error/unauth";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,196 +1,179 @@
|
||||||
package com.ruoyi.web.controller.system;
|
package com.ruoyi.web.controller.system;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||||
import org.springframework.stereotype.Controller;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.ui.ModelMap;
|
import org.springframework.stereotype.Controller;
|
||||||
import org.springframework.validation.annotation.Validated;
|
import org.springframework.ui.ModelMap;
|
||||||
import org.springframework.web.bind.annotation.GetMapping;
|
import org.springframework.validation.annotation.Validated;
|
||||||
import org.springframework.web.bind.annotation.PathVariable;
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
import org.springframework.web.bind.annotation.PostMapping;
|
import org.springframework.web.bind.annotation.PathVariable;
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
import org.springframework.web.bind.annotation.ResponseBody;
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
import com.ruoyi.common.annotation.Log;
|
import org.springframework.web.bind.annotation.ResponseBody;
|
||||||
import com.ruoyi.common.constant.UserConstants;
|
import com.ruoyi.common.annotation.Log;
|
||||||
import com.ruoyi.common.core.controller.BaseController;
|
import com.ruoyi.common.constant.UserConstants;
|
||||||
import com.ruoyi.common.core.domain.AjaxResult;
|
import com.ruoyi.common.core.controller.BaseController;
|
||||||
import com.ruoyi.common.core.domain.Ztree;
|
import com.ruoyi.common.core.domain.AjaxResult;
|
||||||
import com.ruoyi.common.enums.BusinessType;
|
import com.ruoyi.common.core.domain.Ztree;
|
||||||
import com.ruoyi.framework.util.ShiroUtils;
|
import com.ruoyi.common.enums.BusinessType;
|
||||||
import com.ruoyi.system.domain.SysMenu;
|
import com.ruoyi.framework.util.ShiroUtils;
|
||||||
import com.ruoyi.system.domain.SysRole;
|
import com.ruoyi.system.domain.SysMenu;
|
||||||
import com.ruoyi.system.service.ISysMenuService;
|
import com.ruoyi.system.domain.SysRole;
|
||||||
|
import com.ruoyi.system.service.ISysMenuService;
|
||||||
/**
|
|
||||||
* 菜单信息
|
/**
|
||||||
*
|
* 菜单信息
|
||||||
* @author ruoyi
|
*
|
||||||
*/
|
* @author ruoyi
|
||||||
@Controller
|
*/
|
||||||
@RequestMapping("/system/menu")
|
@Controller
|
||||||
public class SysMenuController extends BaseController
|
@RequestMapping("/system/menu")
|
||||||
{
|
public class SysMenuController extends BaseController {
|
||||||
private String prefix = "system/menu";
|
private String prefix = "system/menu";
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private ISysMenuService menuService;
|
private ISysMenuService menuService;
|
||||||
|
|
||||||
@RequiresPermissions("system:menu:view")
|
@RequiresPermissions("system:menu:view")
|
||||||
@GetMapping()
|
@GetMapping()
|
||||||
public String menu()
|
public String menu() {
|
||||||
{
|
return prefix + "/menu";
|
||||||
return prefix + "/menu";
|
}
|
||||||
}
|
|
||||||
|
@RequiresPermissions("system:menu:list")
|
||||||
@RequiresPermissions("system:menu:list")
|
@PostMapping("/list")
|
||||||
@PostMapping("/list")
|
@ResponseBody
|
||||||
@ResponseBody
|
public List<SysMenu> list(SysMenu menu) {
|
||||||
public List<SysMenu> list(SysMenu menu)
|
Long userId = ShiroUtils.getUserId();
|
||||||
{
|
List<SysMenu> menuList = menuService.selectMenuList(menu, userId);
|
||||||
Long userId = ShiroUtils.getUserId();
|
return menuList;
|
||||||
List<SysMenu> menuList = menuService.selectMenuList(menu, userId);
|
}
|
||||||
return menuList;
|
|
||||||
}
|
/**
|
||||||
|
* 删除菜单
|
||||||
/**
|
*/
|
||||||
* 删除菜单
|
@Log(title = "菜单管理", businessType = BusinessType.DELETE)
|
||||||
*/
|
@RequiresPermissions("system:menu:remove")
|
||||||
@Log(title = "菜单管理", businessType = BusinessType.DELETE)
|
@GetMapping("/remove/{menuId}")
|
||||||
@RequiresPermissions("system:menu:remove")
|
@ResponseBody
|
||||||
@GetMapping("/remove/{menuId}")
|
public AjaxResult remove(@PathVariable("menuId") Long menuId) {
|
||||||
@ResponseBody
|
if (menuService.selectCountMenuByParentId(menuId) > 0) {
|
||||||
public AjaxResult remove(@PathVariable("menuId") Long menuId)
|
return AjaxResult.warn("存在子菜单,不允许删除");
|
||||||
{
|
}
|
||||||
if (menuService.selectCountMenuByParentId(menuId) > 0)
|
if (menuService.selectCountRoleMenuByMenuId(menuId) > 0) {
|
||||||
{
|
return AjaxResult.warn("菜单已分配,不允许删除");
|
||||||
return AjaxResult.warn("存在子菜单,不允许删除");
|
}
|
||||||
}
|
ShiroUtils.clearCachedAuthorizationInfo();
|
||||||
if (menuService.selectCountRoleMenuByMenuId(menuId) > 0)
|
return toAjax(menuService.deleteMenuById(menuId));
|
||||||
{
|
}
|
||||||
return AjaxResult.warn("菜单已分配,不允许删除");
|
|
||||||
}
|
/**
|
||||||
ShiroUtils.clearCachedAuthorizationInfo();
|
* 新增
|
||||||
return toAjax(menuService.deleteMenuById(menuId));
|
*/
|
||||||
}
|
@GetMapping("/add/{parentId}")
|
||||||
|
public String add(@PathVariable("parentId") Long parentId, ModelMap mmap) {
|
||||||
/**
|
SysMenu menu = null;
|
||||||
* 新增
|
if (0L != parentId) {
|
||||||
*/
|
menu = menuService.selectMenuById(parentId);
|
||||||
@GetMapping("/add/{parentId}")
|
} else {
|
||||||
public String add(@PathVariable("parentId") Long parentId, ModelMap mmap)
|
menu = new SysMenu();
|
||||||
{
|
menu.setMenuId(0L);
|
||||||
SysMenu menu = null;
|
menu.setMenuName("主目录");
|
||||||
if (0L != parentId)
|
}
|
||||||
{
|
mmap.put("menu", menu);
|
||||||
menu = menuService.selectMenuById(parentId);
|
return prefix + "/add";
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
/**
|
||||||
menu = new SysMenu();
|
* 新增保存菜单
|
||||||
menu.setMenuId(0L);
|
*/
|
||||||
menu.setMenuName("主目录");
|
@Log(title = "菜单管理", businessType = BusinessType.INSERT)
|
||||||
}
|
@RequiresPermissions("system:menu:add")
|
||||||
mmap.put("menu", menu);
|
@PostMapping("/add")
|
||||||
return prefix + "/add";
|
@ResponseBody
|
||||||
}
|
public AjaxResult addSave(@Validated SysMenu menu) {
|
||||||
|
if (UserConstants.MENU_NAME_NOT_UNIQUE.equals(menuService.checkMenuNameUnique(menu))) {
|
||||||
/**
|
return error("新增菜单'" + menu.getMenuName() + "'失败,菜单名称已存在");
|
||||||
* 新增保存菜单
|
}
|
||||||
*/
|
menu.setCreateBy(ShiroUtils.getLoginName());
|
||||||
@Log(title = "菜单管理", businessType = BusinessType.INSERT)
|
ShiroUtils.clearCachedAuthorizationInfo();
|
||||||
@RequiresPermissions("system:menu:add")
|
menuService.insertMenu(menu);
|
||||||
@PostMapping("/add")
|
return success();
|
||||||
@ResponseBody
|
}
|
||||||
public AjaxResult addSave(@Validated SysMenu menu)
|
|
||||||
{
|
/**
|
||||||
if (UserConstants.MENU_NAME_NOT_UNIQUE.equals(menuService.checkMenuNameUnique(menu)))
|
* 修改菜单
|
||||||
{
|
*/
|
||||||
return error("新增菜单'" + menu.getMenuName() + "'失败,菜单名称已存在");
|
@GetMapping("/edit/{menuId}")
|
||||||
}
|
public String edit(@PathVariable("menuId") Long menuId, ModelMap mmap) {
|
||||||
menu.setCreateBy(ShiroUtils.getLoginName());
|
mmap.put("menu", menuService.selectMenuById(menuId));
|
||||||
ShiroUtils.clearCachedAuthorizationInfo();
|
return prefix + "/edit";
|
||||||
return toAjax(menuService.insertMenu(menu));
|
}
|
||||||
}
|
|
||||||
|
/**
|
||||||
/**
|
* 修改保存菜单
|
||||||
* 修改菜单
|
*/
|
||||||
*/
|
@Log(title = "菜单管理", businessType = BusinessType.UPDATE)
|
||||||
@GetMapping("/edit/{menuId}")
|
@RequiresPermissions("system:menu:edit")
|
||||||
public String edit(@PathVariable("menuId") Long menuId, ModelMap mmap)
|
@PostMapping("/edit")
|
||||||
{
|
@ResponseBody
|
||||||
mmap.put("menu", menuService.selectMenuById(menuId));
|
public AjaxResult editSave(@Validated SysMenu menu) {
|
||||||
return prefix + "/edit";
|
if (UserConstants.MENU_NAME_NOT_UNIQUE.equals(menuService.checkMenuNameUnique(menu))) {
|
||||||
}
|
return error("修改菜单'" + menu.getMenuName() + "'失败,菜单名称已存在");
|
||||||
|
}
|
||||||
/**
|
menu.setUpdateBy(ShiroUtils.getLoginName());
|
||||||
* 修改保存菜单
|
ShiroUtils.clearCachedAuthorizationInfo();
|
||||||
*/
|
menuService.updateMenu(menu);
|
||||||
@Log(title = "菜单管理", businessType = BusinessType.UPDATE)
|
return success();
|
||||||
@RequiresPermissions("system:menu:edit")
|
}
|
||||||
@PostMapping("/edit")
|
|
||||||
@ResponseBody
|
/**
|
||||||
public AjaxResult editSave(@Validated SysMenu menu)
|
* 选择菜单图标
|
||||||
{
|
*/
|
||||||
if (UserConstants.MENU_NAME_NOT_UNIQUE.equals(menuService.checkMenuNameUnique(menu)))
|
@GetMapping("/icon")
|
||||||
{
|
public String icon() {
|
||||||
return error("修改菜单'" + menu.getMenuName() + "'失败,菜单名称已存在");
|
return prefix + "/icon";
|
||||||
}
|
}
|
||||||
menu.setUpdateBy(ShiroUtils.getLoginName());
|
|
||||||
ShiroUtils.clearCachedAuthorizationInfo();
|
/**
|
||||||
return toAjax(menuService.updateMenu(menu));
|
* 校验菜单名称
|
||||||
}
|
*/
|
||||||
|
@PostMapping("/checkMenuNameUnique")
|
||||||
/**
|
@ResponseBody
|
||||||
* 选择菜单图标
|
public String checkMenuNameUnique(SysMenu menu) {
|
||||||
*/
|
return menuService.checkMenuNameUnique(menu);
|
||||||
@GetMapping("/icon")
|
}
|
||||||
public String icon()
|
|
||||||
{
|
/**
|
||||||
return prefix + "/icon";
|
* 加载角色菜单列表树
|
||||||
}
|
*/
|
||||||
|
@GetMapping("/roleMenuTreeData")
|
||||||
/**
|
@ResponseBody
|
||||||
* 校验菜单名称
|
public List<Ztree> roleMenuTreeData(SysRole role) {
|
||||||
*/
|
Long userId = ShiroUtils.getUserId();
|
||||||
@PostMapping("/checkMenuNameUnique")
|
List<Ztree> ztrees = menuService.roleMenuTreeData(role, userId);
|
||||||
@ResponseBody
|
return ztrees;
|
||||||
public String checkMenuNameUnique(SysMenu menu)
|
}
|
||||||
{
|
|
||||||
return menuService.checkMenuNameUnique(menu);
|
/**
|
||||||
}
|
* 加载所有菜单列表树
|
||||||
|
*/
|
||||||
/**
|
@GetMapping("/menuTreeData")
|
||||||
* 加载角色菜单列表树
|
@ResponseBody
|
||||||
*/
|
public List<Ztree> menuTreeData() {
|
||||||
@GetMapping("/roleMenuTreeData")
|
Long userId = ShiroUtils.getUserId();
|
||||||
@ResponseBody
|
List<Ztree> ztrees = menuService.menuTreeData(userId);
|
||||||
public List<Ztree> roleMenuTreeData(SysRole role)
|
return ztrees;
|
||||||
{
|
}
|
||||||
Long userId = ShiroUtils.getUserId();
|
|
||||||
List<Ztree> ztrees = menuService.roleMenuTreeData(role, userId);
|
/**
|
||||||
return ztrees;
|
* 选择菜单树
|
||||||
}
|
*/
|
||||||
|
@GetMapping("/selectMenuTree/{menuId}")
|
||||||
/**
|
public String selectMenuTree(@PathVariable("menuId") Long menuId, ModelMap mmap) {
|
||||||
* 加载所有菜单列表树
|
mmap.put("menu", menuService.selectMenuById(menuId));
|
||||||
*/
|
return prefix + "/tree";
|
||||||
@GetMapping("/menuTreeData")
|
}
|
||||||
@ResponseBody
|
|
||||||
public List<Ztree> menuTreeData()
|
|
||||||
{
|
|
||||||
Long userId = ShiroUtils.getUserId();
|
|
||||||
List<Ztree> ztrees = menuService.menuTreeData(userId);
|
|
||||||
return ztrees;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 选择菜单树
|
|
||||||
*/
|
|
||||||
@GetMapping("/selectMenuTree/{menuId}")
|
|
||||||
public String selectMenuTree(@PathVariable("menuId") Long menuId, ModelMap mmap)
|
|
||||||
{
|
|
||||||
mmap.put("menu", menuService.selectMenuById(menuId));
|
|
||||||
return prefix + "/tree";
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
@ -1,112 +1,103 @@
|
||||||
package com.ruoyi.web.controller.system;
|
package com.ruoyi.web.controller.system;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||||
import org.springframework.stereotype.Controller;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.ui.ModelMap;
|
import org.springframework.stereotype.Controller;
|
||||||
import org.springframework.web.bind.annotation.GetMapping;
|
import org.springframework.ui.ModelMap;
|
||||||
import org.springframework.web.bind.annotation.PathVariable;
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
import org.springframework.web.bind.annotation.PostMapping;
|
import org.springframework.web.bind.annotation.PathVariable;
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
import org.springframework.web.bind.annotation.ResponseBody;
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
import com.ruoyi.common.annotation.Log;
|
import org.springframework.web.bind.annotation.ResponseBody;
|
||||||
import com.ruoyi.common.core.controller.BaseController;
|
import com.ruoyi.common.annotation.Log;
|
||||||
import com.ruoyi.common.core.domain.AjaxResult;
|
import com.ruoyi.common.core.controller.BaseController;
|
||||||
import com.ruoyi.common.core.page.TableDataInfo;
|
import com.ruoyi.common.core.domain.AjaxResult;
|
||||||
import com.ruoyi.common.enums.BusinessType;
|
import com.ruoyi.common.core.page.TableDataInfo;
|
||||||
import com.ruoyi.framework.util.ShiroUtils;
|
import com.ruoyi.common.enums.BusinessType;
|
||||||
import com.ruoyi.system.domain.SysNotice;
|
import com.ruoyi.framework.util.ShiroUtils;
|
||||||
import com.ruoyi.system.service.ISysNoticeService;
|
import com.ruoyi.system.domain.SysNotice;
|
||||||
|
import com.ruoyi.system.service.ISysNoticeService;
|
||||||
/**
|
|
||||||
* 公告 信息操作处理
|
/**
|
||||||
*
|
* 公告 信息操作处理
|
||||||
* @author ruoyi
|
*
|
||||||
*/
|
* @author ruoyi
|
||||||
@Controller
|
*/
|
||||||
@RequestMapping("/system/notice")
|
@Controller
|
||||||
public class SysNoticeController extends BaseController
|
@RequestMapping("/system/notice")
|
||||||
{
|
public class SysNoticeController extends BaseController {
|
||||||
private String prefix = "system/notice";
|
private String prefix = "system/notice";
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private ISysNoticeService noticeService;
|
private ISysNoticeService noticeService;
|
||||||
|
|
||||||
@RequiresPermissions("system:notice:view")
|
@RequiresPermissions("system:notice:view")
|
||||||
@GetMapping()
|
@GetMapping()
|
||||||
public String notice()
|
public String notice() {
|
||||||
{
|
return prefix + "/notice";
|
||||||
return prefix + "/notice";
|
}
|
||||||
}
|
|
||||||
|
/**
|
||||||
/**
|
* 查询公告列表
|
||||||
* 查询公告列表
|
*/
|
||||||
*/
|
@RequiresPermissions("system:notice:list")
|
||||||
@RequiresPermissions("system:notice:list")
|
@PostMapping("/list")
|
||||||
@PostMapping("/list")
|
@ResponseBody
|
||||||
@ResponseBody
|
public TableDataInfo list(SysNotice notice) {
|
||||||
public TableDataInfo list(SysNotice notice)
|
return getDataTable(noticeService.selectNoticeList(notice, getPageRequest()));
|
||||||
{
|
}
|
||||||
startPage();
|
|
||||||
List<SysNotice> list = noticeService.selectNoticeList(notice);
|
/**
|
||||||
return getDataTable(list);
|
* 新增公告
|
||||||
}
|
*/
|
||||||
|
@GetMapping("/add")
|
||||||
/**
|
public String add() {
|
||||||
* 新增公告
|
return prefix + "/add";
|
||||||
*/
|
}
|
||||||
@GetMapping("/add")
|
|
||||||
public String add()
|
/**
|
||||||
{
|
* 新增保存公告
|
||||||
return prefix + "/add";
|
*/
|
||||||
}
|
@RequiresPermissions("system:notice:add")
|
||||||
|
@Log(title = "通知公告", businessType = BusinessType.INSERT)
|
||||||
/**
|
@PostMapping("/add")
|
||||||
* 新增保存公告
|
@ResponseBody
|
||||||
*/
|
public AjaxResult addSave(SysNotice notice) {
|
||||||
@RequiresPermissions("system:notice:add")
|
notice.setCreateBy(ShiroUtils.getLoginName());
|
||||||
@Log(title = "通知公告", businessType = BusinessType.INSERT)
|
return toAjax(noticeService.insertNotice(notice));
|
||||||
@PostMapping("/add")
|
}
|
||||||
@ResponseBody
|
|
||||||
public AjaxResult addSave(SysNotice notice)
|
/**
|
||||||
{
|
* 修改公告
|
||||||
notice.setCreateBy(ShiroUtils.getLoginName());
|
*/
|
||||||
return toAjax(noticeService.insertNotice(notice));
|
@GetMapping("/edit/{noticeId}")
|
||||||
}
|
public String edit(@PathVariable("noticeId") Long noticeId, ModelMap mmap) {
|
||||||
|
mmap.put("notice", noticeService.selectNoticeById(noticeId));
|
||||||
/**
|
return prefix + "/edit";
|
||||||
* 修改公告
|
}
|
||||||
*/
|
|
||||||
@GetMapping("/edit/{noticeId}")
|
/**
|
||||||
public String edit(@PathVariable("noticeId") Long noticeId, ModelMap mmap)
|
* 修改保存公告
|
||||||
{
|
*/
|
||||||
mmap.put("notice", noticeService.selectNoticeById(noticeId));
|
@RequiresPermissions("system:notice:edit")
|
||||||
return prefix + "/edit";
|
@Log(title = "通知公告", businessType = BusinessType.UPDATE)
|
||||||
}
|
@PostMapping("/edit")
|
||||||
|
@ResponseBody
|
||||||
/**
|
public AjaxResult editSave(SysNotice notice) {
|
||||||
* 修改保存公告
|
notice.setUpdateBy(ShiroUtils.getLoginName());
|
||||||
*/
|
return toAjax(noticeService.updateNotice(notice));
|
||||||
@RequiresPermissions("system:notice:edit")
|
}
|
||||||
@Log(title = "通知公告", businessType = BusinessType.UPDATE)
|
|
||||||
@PostMapping("/edit")
|
/**
|
||||||
@ResponseBody
|
* 删除公告
|
||||||
public AjaxResult editSave(SysNotice notice)
|
*/
|
||||||
{
|
@RequiresPermissions("system:notice:remove")
|
||||||
notice.setUpdateBy(ShiroUtils.getLoginName());
|
@Log(title = "通知公告", businessType = BusinessType.DELETE)
|
||||||
return toAjax(noticeService.updateNotice(notice));
|
@PostMapping("/remove")
|
||||||
}
|
@ResponseBody
|
||||||
|
public AjaxResult remove(String ids) {
|
||||||
/**
|
return toAjax(noticeService.deleteNoticeByIds(ids));
|
||||||
* 删除公告
|
}
|
||||||
*/
|
}
|
||||||
@RequiresPermissions("system:notice:remove")
|
|
||||||
@Log(title = "通知公告", businessType = BusinessType.DELETE)
|
|
||||||
@PostMapping("/remove")
|
|
||||||
@ResponseBody
|
|
||||||
public AjaxResult remove(String ids)
|
|
||||||
{
|
|
||||||
return toAjax(noticeService.deleteNoticeByIds(ids));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
|
||||||
|
|
@ -1,163 +1,138 @@
|
||||||
package com.ruoyi.web.controller.system;
|
package com.ruoyi.web.controller.system;
|
||||||
|
|
||||||
import java.util.List;
|
import com.ruoyi.common.annotation.Log;
|
||||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
import com.ruoyi.common.constant.UserConstants;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import com.ruoyi.common.core.controller.BaseController;
|
||||||
import org.springframework.stereotype.Controller;
|
import com.ruoyi.common.core.domain.AjaxResult;
|
||||||
import org.springframework.ui.ModelMap;
|
import com.ruoyi.common.core.page.TableDataInfo;
|
||||||
import org.springframework.validation.annotation.Validated;
|
import com.ruoyi.common.enums.BusinessType;
|
||||||
import org.springframework.web.bind.annotation.GetMapping;
|
import com.ruoyi.common.utils.poi.ExcelUtil;
|
||||||
import org.springframework.web.bind.annotation.PathVariable;
|
import com.ruoyi.framework.util.ShiroUtils;
|
||||||
import org.springframework.web.bind.annotation.PostMapping;
|
import com.ruoyi.system.domain.SysPost;
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
import com.ruoyi.system.service.ISysPostService;
|
||||||
import org.springframework.web.bind.annotation.ResponseBody;
|
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||||
import com.ruoyi.common.annotation.Log;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import com.ruoyi.common.constant.UserConstants;
|
import org.springframework.data.domain.Page;
|
||||||
import com.ruoyi.common.core.controller.BaseController;
|
import org.springframework.data.domain.Pageable;
|
||||||
import com.ruoyi.common.core.domain.AjaxResult;
|
import org.springframework.stereotype.Controller;
|
||||||
import com.ruoyi.common.core.page.TableDataInfo;
|
import org.springframework.ui.ModelMap;
|
||||||
import com.ruoyi.common.enums.BusinessType;
|
import org.springframework.validation.annotation.Validated;
|
||||||
import com.ruoyi.common.utils.poi.ExcelUtil;
|
import org.springframework.web.bind.annotation.*;
|
||||||
import com.ruoyi.framework.util.ShiroUtils;
|
|
||||||
import com.ruoyi.system.domain.SysPost;
|
/**
|
||||||
import com.ruoyi.system.service.ISysPostService;
|
* 岗位信息操作处理
|
||||||
|
*
|
||||||
/**
|
* @author ruoyi
|
||||||
* 岗位信息操作处理
|
*/
|
||||||
*
|
@Controller
|
||||||
* @author ruoyi
|
@RequestMapping("/system/post")
|
||||||
*/
|
public class SysPostController extends BaseController {
|
||||||
@Controller
|
private String prefix = "system/post";
|
||||||
@RequestMapping("/system/post")
|
|
||||||
public class SysPostController extends BaseController
|
@Autowired
|
||||||
{
|
private ISysPostService postService;
|
||||||
private String prefix = "system/post";
|
|
||||||
|
@RequiresPermissions("system:post:view")
|
||||||
@Autowired
|
@GetMapping()
|
||||||
private ISysPostService postService;
|
public String operlog() {
|
||||||
|
return prefix + "/post";
|
||||||
@RequiresPermissions("system:post:view")
|
}
|
||||||
@GetMapping()
|
|
||||||
public String operlog()
|
@RequiresPermissions("system:post:list")
|
||||||
{
|
@PostMapping("/list")
|
||||||
return prefix + "/post";
|
@ResponseBody
|
||||||
}
|
public TableDataInfo list(SysPost post) {
|
||||||
|
return getDataTable(postService.selectPostList(post, getPageRequest()));
|
||||||
@RequiresPermissions("system:post:list")
|
}
|
||||||
@PostMapping("/list")
|
|
||||||
@ResponseBody
|
@Log(title = "岗位管理", businessType = BusinessType.EXPORT)
|
||||||
public TableDataInfo list(SysPost post)
|
@RequiresPermissions("system:post:export")
|
||||||
{
|
@PostMapping("/export")
|
||||||
startPage();
|
@ResponseBody
|
||||||
List<SysPost> list = postService.selectPostList(post);
|
public AjaxResult export(SysPost post) {
|
||||||
return getDataTable(list);
|
Page<SysPost> list = postService.selectPostList(post, Pageable.unpaged());
|
||||||
}
|
ExcelUtil<SysPost> util = new ExcelUtil<SysPost>(SysPost.class);
|
||||||
|
return util.exportExcel(list.getContent(), "岗位数据");
|
||||||
@Log(title = "岗位管理", businessType = BusinessType.EXPORT)
|
}
|
||||||
@RequiresPermissions("system:post:export")
|
|
||||||
@PostMapping("/export")
|
@RequiresPermissions("system:post:remove")
|
||||||
@ResponseBody
|
@Log(title = "岗位管理", businessType = BusinessType.DELETE)
|
||||||
public AjaxResult export(SysPost post)
|
@PostMapping("/remove")
|
||||||
{
|
@ResponseBody
|
||||||
List<SysPost> list = postService.selectPostList(post);
|
public AjaxResult remove(String ids) {
|
||||||
ExcelUtil<SysPost> util = new ExcelUtil<SysPost>(SysPost.class);
|
try {
|
||||||
return util.exportExcel(list, "岗位数据");
|
return toAjax(postService.deletePostByIds(ids));
|
||||||
}
|
} catch (Exception e) {
|
||||||
|
return error(e.getMessage());
|
||||||
@RequiresPermissions("system:post:remove")
|
}
|
||||||
@Log(title = "岗位管理", businessType = BusinessType.DELETE)
|
}
|
||||||
@PostMapping("/remove")
|
|
||||||
@ResponseBody
|
/**
|
||||||
public AjaxResult remove(String ids)
|
* 新增岗位
|
||||||
{
|
*/
|
||||||
try
|
@GetMapping("/add")
|
||||||
{
|
public String add() {
|
||||||
return toAjax(postService.deletePostByIds(ids));
|
return prefix + "/add";
|
||||||
}
|
}
|
||||||
catch (Exception e)
|
|
||||||
{
|
/**
|
||||||
return error(e.getMessage());
|
* 新增保存岗位
|
||||||
}
|
*/
|
||||||
}
|
@RequiresPermissions("system:post:add")
|
||||||
|
@Log(title = "岗位管理", businessType = BusinessType.INSERT)
|
||||||
/**
|
@PostMapping("/add")
|
||||||
* 新增岗位
|
@ResponseBody
|
||||||
*/
|
public AjaxResult addSave(@Validated SysPost post) {
|
||||||
@GetMapping("/add")
|
if (UserConstants.POST_NAME_NOT_UNIQUE.equals(postService.checkPostNameUnique(post))) {
|
||||||
public String add()
|
return error("新增岗位'" + post.getPostName() + "'失败,岗位名称已存在");
|
||||||
{
|
} else if (UserConstants.POST_CODE_NOT_UNIQUE.equals(postService.checkPostCodeUnique(post))) {
|
||||||
return prefix + "/add";
|
return error("新增岗位'" + post.getPostName() + "'失败,岗位编码已存在");
|
||||||
}
|
}
|
||||||
|
post.setCreateBy(ShiroUtils.getLoginName());
|
||||||
/**
|
return success(postService.insertPost(post));
|
||||||
* 新增保存岗位
|
}
|
||||||
*/
|
|
||||||
@RequiresPermissions("system:post:add")
|
/**
|
||||||
@Log(title = "岗位管理", businessType = BusinessType.INSERT)
|
* 修改岗位
|
||||||
@PostMapping("/add")
|
*/
|
||||||
@ResponseBody
|
@GetMapping("/edit/{postId}")
|
||||||
public AjaxResult addSave(@Validated SysPost post)
|
public String edit(@PathVariable("postId") Long postId, ModelMap mmap) {
|
||||||
{
|
mmap.put("post", postService.selectPostById(postId));
|
||||||
if (UserConstants.POST_NAME_NOT_UNIQUE.equals(postService.checkPostNameUnique(post)))
|
return prefix + "/edit";
|
||||||
{
|
}
|
||||||
return error("新增岗位'" + post.getPostName() + "'失败,岗位名称已存在");
|
|
||||||
}
|
/**
|
||||||
else if (UserConstants.POST_CODE_NOT_UNIQUE.equals(postService.checkPostCodeUnique(post)))
|
* 修改保存岗位
|
||||||
{
|
*/
|
||||||
return error("新增岗位'" + post.getPostName() + "'失败,岗位编码已存在");
|
@RequiresPermissions("system:post:edit")
|
||||||
}
|
@Log(title = "岗位管理", businessType = BusinessType.UPDATE)
|
||||||
post.setCreateBy(ShiroUtils.getLoginName());
|
@PostMapping("/edit")
|
||||||
return toAjax(postService.insertPost(post));
|
@ResponseBody
|
||||||
}
|
public AjaxResult editSave(@Validated SysPost post) {
|
||||||
|
if (UserConstants.POST_NAME_NOT_UNIQUE.equals(postService.checkPostNameUnique(post))) {
|
||||||
/**
|
return error("修改岗位'" + post.getPostName() + "'失败,岗位名称已存在");
|
||||||
* 修改岗位
|
} else if (UserConstants.POST_CODE_NOT_UNIQUE.equals(postService.checkPostCodeUnique(post))) {
|
||||||
*/
|
return error("修改岗位'" + post.getPostName() + "'失败,岗位编码已存在");
|
||||||
@GetMapping("/edit/{postId}")
|
}
|
||||||
public String edit(@PathVariable("postId") Long postId, ModelMap mmap)
|
post.setUpdateBy(ShiroUtils.getLoginName());
|
||||||
{
|
return success(postService.updatePost(post));
|
||||||
mmap.put("post", postService.selectPostById(postId));
|
}
|
||||||
return prefix + "/edit";
|
|
||||||
}
|
/**
|
||||||
|
* 校验岗位名称
|
||||||
/**
|
*/
|
||||||
* 修改保存岗位
|
@PostMapping("/checkPostNameUnique")
|
||||||
*/
|
@ResponseBody
|
||||||
@RequiresPermissions("system:post:edit")
|
public String checkPostNameUnique(SysPost post) {
|
||||||
@Log(title = "岗位管理", businessType = BusinessType.UPDATE)
|
return postService.checkPostNameUnique(post);
|
||||||
@PostMapping("/edit")
|
}
|
||||||
@ResponseBody
|
|
||||||
public AjaxResult editSave(@Validated SysPost post)
|
/**
|
||||||
{
|
* 校验岗位编码
|
||||||
if (UserConstants.POST_NAME_NOT_UNIQUE.equals(postService.checkPostNameUnique(post)))
|
*/
|
||||||
{
|
@PostMapping("/checkPostCodeUnique")
|
||||||
return error("修改岗位'" + post.getPostName() + "'失败,岗位名称已存在");
|
@ResponseBody
|
||||||
}
|
public String checkPostCodeUnique(SysPost post) {
|
||||||
else if (UserConstants.POST_CODE_NOT_UNIQUE.equals(postService.checkPostCodeUnique(post)))
|
return postService.checkPostCodeUnique(post);
|
||||||
{
|
}
|
||||||
return error("修改岗位'" + post.getPostName() + "'失败,岗位编码已存在");
|
}
|
||||||
}
|
|
||||||
post.setUpdateBy(ShiroUtils.getLoginName());
|
|
||||||
return toAjax(postService.updatePost(post));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 校验岗位名称
|
|
||||||
*/
|
|
||||||
@PostMapping("/checkPostNameUnique")
|
|
||||||
@ResponseBody
|
|
||||||
public String checkPostNameUnique(SysPost post)
|
|
||||||
{
|
|
||||||
return postService.checkPostNameUnique(post);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 校验岗位编码
|
|
||||||
*/
|
|
||||||
@PostMapping("/checkPostCodeUnique")
|
|
||||||
@ResponseBody
|
|
||||||
public String checkPostCodeUnique(SysPost post)
|
|
||||||
{
|
|
||||||
return postService.checkPostCodeUnique(post);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
|
||||||
|
|
@ -1,173 +1,155 @@
|
||||||
package com.ruoyi.web.controller.system;
|
package com.ruoyi.web.controller.system;
|
||||||
|
|
||||||
import org.slf4j.Logger;
|
import com.ruoyi.common.annotation.Log;
|
||||||
import org.slf4j.LoggerFactory;
|
import com.ruoyi.common.config.Global;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import com.ruoyi.common.core.controller.BaseController;
|
||||||
import org.springframework.stereotype.Controller;
|
import com.ruoyi.common.core.domain.AjaxResult;
|
||||||
import org.springframework.ui.ModelMap;
|
import com.ruoyi.common.enums.BusinessType;
|
||||||
import org.springframework.web.bind.annotation.GetMapping;
|
import com.ruoyi.common.utils.StringUtils;
|
||||||
import org.springframework.web.bind.annotation.PostMapping;
|
import com.ruoyi.common.utils.file.FileUploadUtils;
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
import com.ruoyi.framework.shiro.service.SysPasswordService;
|
||||||
import org.springframework.web.bind.annotation.RequestParam;
|
import com.ruoyi.framework.util.ShiroUtils;
|
||||||
import org.springframework.web.bind.annotation.ResponseBody;
|
import com.ruoyi.system.domain.SysPost;
|
||||||
import org.springframework.web.multipart.MultipartFile;
|
import com.ruoyi.system.domain.SysUser;
|
||||||
import com.ruoyi.common.annotation.Log;
|
import com.ruoyi.system.service.ISysUserService;
|
||||||
import com.ruoyi.common.config.Global;
|
import org.slf4j.Logger;
|
||||||
import com.ruoyi.common.core.controller.BaseController;
|
import org.slf4j.LoggerFactory;
|
||||||
import com.ruoyi.common.core.domain.AjaxResult;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import com.ruoyi.common.enums.BusinessType;
|
import org.springframework.stereotype.Controller;
|
||||||
import com.ruoyi.common.utils.StringUtils;
|
import org.springframework.ui.ModelMap;
|
||||||
import com.ruoyi.common.utils.file.FileUploadUtils;
|
import org.springframework.web.bind.annotation.*;
|
||||||
import com.ruoyi.framework.shiro.service.SysPasswordService;
|
import org.springframework.web.multipart.MultipartFile;
|
||||||
import com.ruoyi.framework.util.ShiroUtils;
|
|
||||||
import com.ruoyi.system.domain.SysUser;
|
/**
|
||||||
import com.ruoyi.system.service.ISysUserService;
|
* 个人信息 业务处理
|
||||||
|
*
|
||||||
/**
|
* @author ruoyi
|
||||||
* 个人信息 业务处理
|
*/
|
||||||
*
|
@Controller
|
||||||
* @author ruoyi
|
@RequestMapping("/system/user/profile")
|
||||||
*/
|
public class SysProfileController extends BaseController {
|
||||||
@Controller
|
private static final Logger log = LoggerFactory.getLogger(SysProfileController.class);
|
||||||
@RequestMapping("/system/user/profile")
|
|
||||||
public class SysProfileController extends BaseController
|
private String prefix = "system/user/profile";
|
||||||
{
|
|
||||||
private static final Logger log = LoggerFactory.getLogger(SysProfileController.class);
|
@Autowired
|
||||||
|
private ISysUserService userService;
|
||||||
private String prefix = "system/user/profile";
|
|
||||||
|
@Autowired
|
||||||
@Autowired
|
private SysPasswordService passwordService;
|
||||||
private ISysUserService userService;
|
|
||||||
|
/**
|
||||||
@Autowired
|
* 个人信息
|
||||||
private SysPasswordService passwordService;
|
*/
|
||||||
|
@GetMapping()
|
||||||
/**
|
public String profile(ModelMap mmap) {
|
||||||
* 个人信息
|
SysUser user = userService.selectUserWithRolesAndPostsById(ShiroUtils.getUserId());
|
||||||
*/
|
mmap.put("user", user);
|
||||||
@GetMapping()
|
mmap.put("postGroup", concat(user));
|
||||||
public String profile(ModelMap mmap)
|
return prefix + "/profile";
|
||||||
{
|
}
|
||||||
SysUser user = ShiroUtils.getSysUser();
|
|
||||||
mmap.put("user", user);
|
private String concat(SysUser user){
|
||||||
mmap.put("roleGroup", userService.selectUserRoleGroup(user.getUserId()));
|
StringBuffer idsStr = new StringBuffer();
|
||||||
mmap.put("postGroup", userService.selectUserPostGroup(user.getUserId()));
|
for (SysPost post : user.getPosts()) {
|
||||||
return prefix + "/profile";
|
idsStr.append(post.getPostName()).append(",");
|
||||||
}
|
}
|
||||||
|
if (StringUtils.isNotEmpty(idsStr.toString())) {
|
||||||
@GetMapping("/checkPassword")
|
return idsStr.substring(0, idsStr.length() - 1);
|
||||||
@ResponseBody
|
}
|
||||||
public boolean checkPassword(String password)
|
return idsStr.toString();
|
||||||
{
|
}
|
||||||
SysUser user = ShiroUtils.getSysUser();
|
|
||||||
if (passwordService.matches(user, password))
|
@GetMapping("/checkPassword")
|
||||||
{
|
@ResponseBody
|
||||||
return true;
|
public boolean checkPassword(String password) {
|
||||||
}
|
SysUser user = ShiroUtils.getSysUser();
|
||||||
return false;
|
if (passwordService.matches(user, password)) {
|
||||||
}
|
return true;
|
||||||
|
}
|
||||||
@GetMapping("/resetPwd")
|
return false;
|
||||||
public String resetPwd(ModelMap mmap)
|
}
|
||||||
{
|
|
||||||
SysUser user = ShiroUtils.getSysUser();
|
@GetMapping("/resetPwd")
|
||||||
mmap.put("user", userService.selectUserById(user.getUserId()));
|
public String resetPwd(ModelMap mmap) {
|
||||||
return prefix + "/resetPwd";
|
SysUser user = ShiroUtils.getSysUser();
|
||||||
}
|
mmap.put("user", userService.selectUserById(user.getUserId()));
|
||||||
|
return prefix + "/resetPwd";
|
||||||
@Log(title = "重置密码", businessType = BusinessType.UPDATE)
|
}
|
||||||
@PostMapping("/resetPwd")
|
|
||||||
@ResponseBody
|
@Log(title = "重置密码", businessType = BusinessType.UPDATE)
|
||||||
public AjaxResult resetPwd(String oldPassword, String newPassword)
|
@PostMapping("/resetPwd")
|
||||||
{
|
@ResponseBody
|
||||||
SysUser user = ShiroUtils.getSysUser();
|
public AjaxResult resetPwd(String oldPassword, String newPassword) {
|
||||||
if (StringUtils.isNotEmpty(newPassword) && passwordService.matches(user, oldPassword))
|
SysUser user = ShiroUtils.getSysUser();
|
||||||
{
|
if (StringUtils.isNotEmpty(newPassword) && passwordService.matches(user, oldPassword)) {
|
||||||
user.setSalt(ShiroUtils.randomSalt());
|
user.setSalt(ShiroUtils.randomSalt());
|
||||||
user.setPassword(passwordService.encryptPassword(user.getLoginName(), newPassword, user.getSalt()));
|
user.setPassword(passwordService.encryptPassword(user.getLoginName(), newPassword, user.getSalt()));
|
||||||
if (userService.resetUserPwd(user) > 0)
|
user = userService.resetUserPwd(user);
|
||||||
{
|
ShiroUtils.setSysUser(user);
|
||||||
ShiroUtils.setSysUser(userService.selectUserById(user.getUserId()));
|
return success();
|
||||||
return success();
|
} else {
|
||||||
}
|
return error("修改密码失败,旧密码错误");
|
||||||
return error();
|
}
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
/**
|
||||||
return error("修改密码失败,旧密码错误");
|
* 修改用户
|
||||||
}
|
*/
|
||||||
}
|
@GetMapping("/edit")
|
||||||
|
public String edit(ModelMap mmap) {
|
||||||
/**
|
SysUser user = ShiroUtils.getSysUser();
|
||||||
* 修改用户
|
mmap.put("user", userService.selectUserById(user.getUserId()));
|
||||||
*/
|
return prefix + "/edit";
|
||||||
@GetMapping("/edit")
|
}
|
||||||
public String edit(ModelMap mmap)
|
|
||||||
{
|
/**
|
||||||
SysUser user = ShiroUtils.getSysUser();
|
* 修改头像
|
||||||
mmap.put("user", userService.selectUserById(user.getUserId()));
|
*/
|
||||||
return prefix + "/edit";
|
@GetMapping("/avatar")
|
||||||
}
|
public String avatar(ModelMap mmap) {
|
||||||
|
SysUser user = ShiroUtils.getSysUser();
|
||||||
/**
|
mmap.put("user", userService.selectUserById(user.getUserId()));
|
||||||
* 修改头像
|
return prefix + "/avatar";
|
||||||
*/
|
}
|
||||||
@GetMapping("/avatar")
|
|
||||||
public String avatar(ModelMap mmap)
|
/**
|
||||||
{
|
* 修改用户
|
||||||
SysUser user = ShiroUtils.getSysUser();
|
*/
|
||||||
mmap.put("user", userService.selectUserById(user.getUserId()));
|
@Log(title = "个人信息", businessType = BusinessType.UPDATE)
|
||||||
return prefix + "/avatar";
|
@PostMapping("/update")
|
||||||
}
|
@ResponseBody
|
||||||
|
public AjaxResult update(SysUser user) {
|
||||||
/**
|
SysUser currentUser = ShiroUtils.getSysUser();
|
||||||
* 修改用户
|
currentUser.setUserName(user.getUserName());
|
||||||
*/
|
currentUser.setEmail(user.getEmail());
|
||||||
@Log(title = "个人信息", businessType = BusinessType.UPDATE)
|
currentUser.setPhonenumber(user.getPhonenumber());
|
||||||
@PostMapping("/update")
|
currentUser.setSex(user.getSex());
|
||||||
@ResponseBody
|
userService.updateUserInfo(currentUser);
|
||||||
public AjaxResult update(SysUser user)
|
ShiroUtils.setSysUser(currentUser);
|
||||||
{
|
return success();
|
||||||
SysUser currentUser = ShiroUtils.getSysUser();
|
}
|
||||||
currentUser.setUserName(user.getUserName());
|
|
||||||
currentUser.setEmail(user.getEmail());
|
/**
|
||||||
currentUser.setPhonenumber(user.getPhonenumber());
|
* 保存头像
|
||||||
currentUser.setSex(user.getSex());
|
*/
|
||||||
if (userService.updateUserInfo(currentUser) > 0)
|
@Log(title = "个人信息", businessType = BusinessType.UPDATE)
|
||||||
{
|
@PostMapping("/updateAvatar")
|
||||||
ShiroUtils.setSysUser(userService.selectUserById(currentUser.getUserId()));
|
@ResponseBody
|
||||||
return success();
|
public AjaxResult updateAvatar(@RequestParam("avatarfile") MultipartFile file) {
|
||||||
}
|
SysUser currentUser = ShiroUtils.getSysUser();
|
||||||
return error();
|
try {
|
||||||
}
|
if (!file.isEmpty()) {
|
||||||
|
String avatar = FileUploadUtils.upload(Global.getAvatarPath(), file);
|
||||||
/**
|
currentUser.setAvatar(avatar);
|
||||||
* 保存头像
|
userService.updateUserInfo(currentUser);
|
||||||
*/
|
ShiroUtils.setSysUser(currentUser);
|
||||||
@Log(title = "个人信息", businessType = BusinessType.UPDATE)
|
return success();
|
||||||
@PostMapping("/updateAvatar")
|
}
|
||||||
@ResponseBody
|
return error();
|
||||||
public AjaxResult updateAvatar(@RequestParam("avatarfile") MultipartFile file)
|
} catch (Exception e) {
|
||||||
{
|
log.error("修改头像失败!", e);
|
||||||
SysUser currentUser = ShiroUtils.getSysUser();
|
return error(e.getMessage());
|
||||||
try
|
}
|
||||||
{
|
}
|
||||||
if (!file.isEmpty())
|
}
|
||||||
{
|
|
||||||
String avatar = FileUploadUtils.upload(Global.getAvatarPath(), file);
|
|
||||||
currentUser.setAvatar(avatar);
|
|
||||||
if (userService.updateUserInfo(currentUser) > 0)
|
|
||||||
{
|
|
||||||
ShiroUtils.setSysUser(userService.selectUserById(currentUser.getUserId()));
|
|
||||||
return success();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return error();
|
|
||||||
}
|
|
||||||
catch (Exception e)
|
|
||||||
{
|
|
||||||
log.error("修改头像失败!", e);
|
|
||||||
return error(e.getMessage());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
|
||||||
|
|
@ -1,304 +1,266 @@
|
||||||
package com.ruoyi.web.controller.system;
|
package com.ruoyi.web.controller.system;
|
||||||
|
|
||||||
import java.util.List;
|
import com.ruoyi.common.annotation.Log;
|
||||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
import com.ruoyi.common.constant.UserConstants;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import com.ruoyi.common.core.domain.AjaxResult;
|
||||||
import org.springframework.stereotype.Controller;
|
import com.ruoyi.common.core.page.TableDataInfo;
|
||||||
import org.springframework.ui.ModelMap;
|
import com.ruoyi.common.enums.BusinessType;
|
||||||
import org.springframework.validation.annotation.Validated;
|
import com.ruoyi.common.utils.poi.ExcelUtil;
|
||||||
import org.springframework.web.bind.annotation.GetMapping;
|
import com.ruoyi.framework.util.ShiroUtils;
|
||||||
import org.springframework.web.bind.annotation.PathVariable;
|
import com.ruoyi.system.domain.SysRole;
|
||||||
import org.springframework.web.bind.annotation.PostMapping;
|
import com.ruoyi.system.domain.SysUser;
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
import com.ruoyi.system.domain.SysUserRole;
|
||||||
import org.springframework.web.bind.annotation.ResponseBody;
|
import com.ruoyi.system.service.ISysRoleService;
|
||||||
import com.ruoyi.common.annotation.Log;
|
import com.ruoyi.system.service.ISysUserService;
|
||||||
import com.ruoyi.common.constant.UserConstants;
|
import com.ruoyi.web.controller.system.base.WebController;
|
||||||
import com.ruoyi.common.core.controller.BaseController;
|
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||||
import com.ruoyi.common.core.domain.AjaxResult;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import com.ruoyi.common.core.page.TableDataInfo;
|
import org.springframework.data.domain.Pageable;
|
||||||
import com.ruoyi.common.enums.BusinessType;
|
import org.springframework.stereotype.Controller;
|
||||||
import com.ruoyi.common.utils.poi.ExcelUtil;
|
import org.springframework.ui.ModelMap;
|
||||||
import com.ruoyi.framework.util.ShiroUtils;
|
import org.springframework.validation.annotation.Validated;
|
||||||
import com.ruoyi.system.domain.SysRole;
|
import org.springframework.web.bind.annotation.*;
|
||||||
import com.ruoyi.system.domain.SysUser;
|
|
||||||
import com.ruoyi.system.domain.SysUserRole;
|
import java.util.List;
|
||||||
import com.ruoyi.system.service.ISysRoleService;
|
|
||||||
import com.ruoyi.system.service.ISysUserService;
|
/**
|
||||||
|
* 角色信息
|
||||||
/**
|
*
|
||||||
* 角色信息
|
* @author ruoyi
|
||||||
*
|
*/
|
||||||
* @author ruoyi
|
@Controller
|
||||||
*/
|
@RequestMapping("/system/role")
|
||||||
@Controller
|
public class SysRoleController extends WebController {
|
||||||
@RequestMapping("/system/role")
|
private String prefix = "system/role";
|
||||||
public class SysRoleController extends BaseController
|
|
||||||
{
|
@Autowired
|
||||||
private String prefix = "system/role";
|
private ISysRoleService roleService;
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private ISysRoleService roleService;
|
private ISysUserService userService;
|
||||||
|
|
||||||
@Autowired
|
@RequiresPermissions("system:role:view")
|
||||||
private ISysUserService userService;
|
@GetMapping()
|
||||||
|
public String role() {
|
||||||
@RequiresPermissions("system:role:view")
|
return prefix + "/role";
|
||||||
@GetMapping()
|
}
|
||||||
public String role()
|
|
||||||
{
|
@RequiresPermissions("system:role:list")
|
||||||
return prefix + "/role";
|
@PostMapping("/list")
|
||||||
}
|
@ResponseBody
|
||||||
|
public TableDataInfo list(SysRole role) {
|
||||||
@RequiresPermissions("system:role:list")
|
return getDataTable(roleService.selectRoleList(role, getPageRequest(), getUser()));
|
||||||
@PostMapping("/list")
|
}
|
||||||
@ResponseBody
|
|
||||||
public TableDataInfo list(SysRole role)
|
@Log(title = "角色管理", businessType = BusinessType.EXPORT)
|
||||||
{
|
@RequiresPermissions("system:role:export")
|
||||||
startPage();
|
@PostMapping("/export")
|
||||||
List<SysRole> list = roleService.selectRoleList(role);
|
@ResponseBody
|
||||||
return getDataTable(list);
|
public AjaxResult export(SysRole role) {
|
||||||
}
|
List<SysRole> list = roleService.selectRoleList(role, Pageable.unpaged(), getUser()).getContent();
|
||||||
|
ExcelUtil<SysRole> util = new ExcelUtil<SysRole>(SysRole.class);
|
||||||
@Log(title = "角色管理", businessType = BusinessType.EXPORT)
|
return util.exportExcel(list, "角色数据");
|
||||||
@RequiresPermissions("system:role:export")
|
}
|
||||||
@PostMapping("/export")
|
|
||||||
@ResponseBody
|
/**
|
||||||
public AjaxResult export(SysRole role)
|
* 新增角色
|
||||||
{
|
*/
|
||||||
List<SysRole> list = roleService.selectRoleList(role);
|
@GetMapping("/add")
|
||||||
ExcelUtil<SysRole> util = new ExcelUtil<SysRole>(SysRole.class);
|
public String add() {
|
||||||
return util.exportExcel(list, "角色数据");
|
return prefix + "/add";
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 新增角色
|
* 新增保存角色
|
||||||
*/
|
*/
|
||||||
@GetMapping("/add")
|
@RequiresPermissions("system:role:add")
|
||||||
public String add()
|
@Log(title = "角色管理", businessType = BusinessType.INSERT)
|
||||||
{
|
@PostMapping("/add")
|
||||||
return prefix + "/add";
|
@ResponseBody
|
||||||
}
|
public AjaxResult addSave(@Validated SysRole role) {
|
||||||
|
if (UserConstants.ROLE_NAME_NOT_UNIQUE.equals(roleService.checkRoleNameUnique(role))) {
|
||||||
/**
|
return error("新增角色'" + role.getRoleName() + "'失败,角色名称已存在");
|
||||||
* 新增保存角色
|
} else if (UserConstants.ROLE_KEY_NOT_UNIQUE.equals(roleService.checkRoleKeyUnique(role))) {
|
||||||
*/
|
return error("新增角色'" + role.getRoleName() + "'失败,角色权限已存在");
|
||||||
@RequiresPermissions("system:role:add")
|
}
|
||||||
@Log(title = "角色管理", businessType = BusinessType.INSERT)
|
role.setCreateBy(ShiroUtils.getLoginName());
|
||||||
@PostMapping("/add")
|
ShiroUtils.clearCachedAuthorizationInfo();
|
||||||
@ResponseBody
|
roleService.insertRole(role);
|
||||||
public AjaxResult addSave(@Validated SysRole role)
|
return success();
|
||||||
{
|
|
||||||
if (UserConstants.ROLE_NAME_NOT_UNIQUE.equals(roleService.checkRoleNameUnique(role)))
|
}
|
||||||
{
|
|
||||||
return error("新增角色'" + role.getRoleName() + "'失败,角色名称已存在");
|
/**
|
||||||
}
|
* 修改角色
|
||||||
else if (UserConstants.ROLE_KEY_NOT_UNIQUE.equals(roleService.checkRoleKeyUnique(role)))
|
*/
|
||||||
{
|
@GetMapping("/edit/{roleId}")
|
||||||
return error("新增角色'" + role.getRoleName() + "'失败,角色权限已存在");
|
public String edit(@PathVariable("roleId") Long roleId, ModelMap mmap) {
|
||||||
}
|
mmap.put("role", roleService.selectRoleById(roleId));
|
||||||
role.setCreateBy(ShiroUtils.getLoginName());
|
return prefix + "/edit";
|
||||||
ShiroUtils.clearCachedAuthorizationInfo();
|
}
|
||||||
return toAjax(roleService.insertRole(role));
|
|
||||||
|
/**
|
||||||
}
|
* 修改保存角色
|
||||||
|
*/
|
||||||
/**
|
@RequiresPermissions("system:role:edit")
|
||||||
* 修改角色
|
@Log(title = "角色管理", businessType = BusinessType.UPDATE)
|
||||||
*/
|
@PostMapping("/edit")
|
||||||
@GetMapping("/edit/{roleId}")
|
@ResponseBody
|
||||||
public String edit(@PathVariable("roleId") Long roleId, ModelMap mmap)
|
public AjaxResult editSave(@Validated SysRole role) {
|
||||||
{
|
roleService.checkRoleAllowed(role);
|
||||||
mmap.put("role", roleService.selectRoleById(roleId));
|
if (UserConstants.ROLE_NAME_NOT_UNIQUE.equals(roleService.checkRoleNameUnique(role))) {
|
||||||
return prefix + "/edit";
|
return error("修改角色'" + role.getRoleName() + "'失败,角色名称已存在");
|
||||||
}
|
} else if (UserConstants.ROLE_KEY_NOT_UNIQUE.equals(roleService.checkRoleKeyUnique(role))) {
|
||||||
|
return error("修改角色'" + role.getRoleName() + "'失败,角色权限已存在");
|
||||||
/**
|
}
|
||||||
* 修改保存角色
|
role.setUpdateBy(ShiroUtils.getLoginName());
|
||||||
*/
|
ShiroUtils.clearCachedAuthorizationInfo();
|
||||||
@RequiresPermissions("system:role:edit")
|
roleService.updateRole(role);
|
||||||
@Log(title = "角色管理", businessType = BusinessType.UPDATE)
|
return success();
|
||||||
@PostMapping("/edit")
|
}
|
||||||
@ResponseBody
|
|
||||||
public AjaxResult editSave(@Validated SysRole role)
|
/**
|
||||||
{
|
* 角色分配数据权限
|
||||||
roleService.checkRoleAllowed(role);
|
*/
|
||||||
if (UserConstants.ROLE_NAME_NOT_UNIQUE.equals(roleService.checkRoleNameUnique(role)))
|
@GetMapping("/authDataScope/{roleId}")
|
||||||
{
|
public String authDataScope(@PathVariable("roleId") Long roleId, ModelMap mmap) {
|
||||||
return error("修改角色'" + role.getRoleName() + "'失败,角色名称已存在");
|
mmap.put("role", roleService.selectRoleById(roleId));
|
||||||
}
|
return prefix + "/dataScope";
|
||||||
else if (UserConstants.ROLE_KEY_NOT_UNIQUE.equals(roleService.checkRoleKeyUnique(role)))
|
}
|
||||||
{
|
|
||||||
return error("修改角色'" + role.getRoleName() + "'失败,角色权限已存在");
|
/**
|
||||||
}
|
* 保存角色分配数据权限
|
||||||
role.setUpdateBy(ShiroUtils.getLoginName());
|
*/
|
||||||
ShiroUtils.clearCachedAuthorizationInfo();
|
@RequiresPermissions("system:role:edit")
|
||||||
return toAjax(roleService.updateRole(role));
|
@Log(title = "角色管理", businessType = BusinessType.UPDATE)
|
||||||
}
|
@PostMapping("/authDataScope")
|
||||||
|
@ResponseBody
|
||||||
/**
|
public AjaxResult authDataScopeSave(SysRole role) {
|
||||||
* 角色分配数据权限
|
roleService.checkRoleAllowed(role);
|
||||||
*/
|
role.setUpdateBy(ShiroUtils.getLoginName());
|
||||||
@GetMapping("/authDataScope/{roleId}")
|
if (roleService.authDataScope(role) > 0) {
|
||||||
public String authDataScope(@PathVariable("roleId") Long roleId, ModelMap mmap)
|
ShiroUtils.setSysUser(userService.selectUserById(ShiroUtils.getSysUser().getUserId()));
|
||||||
{
|
return success();
|
||||||
mmap.put("role", roleService.selectRoleById(roleId));
|
}
|
||||||
return prefix + "/dataScope";
|
return error();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
@RequiresPermissions("system:role:remove")
|
||||||
* 保存角色分配数据权限
|
@Log(title = "角色管理", businessType = BusinessType.DELETE)
|
||||||
*/
|
@PostMapping("/remove")
|
||||||
@RequiresPermissions("system:role:edit")
|
@ResponseBody
|
||||||
@Log(title = "角色管理", businessType = BusinessType.UPDATE)
|
public AjaxResult remove(String ids) {
|
||||||
@PostMapping("/authDataScope")
|
try {
|
||||||
@ResponseBody
|
return toAjax(roleService.deleteRoleByIds(ids));
|
||||||
public AjaxResult authDataScopeSave(SysRole role)
|
} catch (Exception e) {
|
||||||
{
|
return error(e.getMessage());
|
||||||
roleService.checkRoleAllowed(role);
|
}
|
||||||
role.setUpdateBy(ShiroUtils.getLoginName());
|
}
|
||||||
if (roleService.authDataScope(role) > 0)
|
|
||||||
{
|
/**
|
||||||
ShiroUtils.setSysUser(userService.selectUserById(ShiroUtils.getSysUser().getUserId()));
|
* 校验角色名称
|
||||||
return success();
|
*/
|
||||||
}
|
@PostMapping("/checkRoleNameUnique")
|
||||||
return error();
|
@ResponseBody
|
||||||
}
|
public String checkRoleNameUnique(SysRole role) {
|
||||||
|
return roleService.checkRoleNameUnique(role);
|
||||||
@RequiresPermissions("system:role:remove")
|
}
|
||||||
@Log(title = "角色管理", businessType = BusinessType.DELETE)
|
|
||||||
@PostMapping("/remove")
|
/**
|
||||||
@ResponseBody
|
* 校验角色权限
|
||||||
public AjaxResult remove(String ids)
|
*/
|
||||||
{
|
@PostMapping("/checkRoleKeyUnique")
|
||||||
try
|
@ResponseBody
|
||||||
{
|
public String checkRoleKeyUnique(SysRole role) {
|
||||||
return toAjax(roleService.deleteRoleByIds(ids));
|
return roleService.checkRoleKeyUnique(role);
|
||||||
}
|
}
|
||||||
catch (Exception e)
|
|
||||||
{
|
/**
|
||||||
return error(e.getMessage());
|
* 选择菜单树
|
||||||
}
|
*/
|
||||||
}
|
@GetMapping("/selectMenuTree")
|
||||||
|
public String selectMenuTree() {
|
||||||
/**
|
return prefix + "/tree";
|
||||||
* 校验角色名称
|
}
|
||||||
*/
|
|
||||||
@PostMapping("/checkRoleNameUnique")
|
/**
|
||||||
@ResponseBody
|
* 角色状态修改
|
||||||
public String checkRoleNameUnique(SysRole role)
|
*/
|
||||||
{
|
@Log(title = "角色管理", businessType = BusinessType.UPDATE)
|
||||||
return roleService.checkRoleNameUnique(role);
|
@RequiresPermissions("system:role:edit")
|
||||||
}
|
@PostMapping("/changeStatus")
|
||||||
|
@ResponseBody
|
||||||
/**
|
public AjaxResult changeStatus(SysRole role) {
|
||||||
* 校验角色权限
|
roleService.checkRoleAllowed(role);
|
||||||
*/
|
return toAjax(roleService.changeStatus(role));
|
||||||
@PostMapping("/checkRoleKeyUnique")
|
}
|
||||||
@ResponseBody
|
|
||||||
public String checkRoleKeyUnique(SysRole role)
|
/**
|
||||||
{
|
* 分配用户
|
||||||
return roleService.checkRoleKeyUnique(role);
|
*/
|
||||||
}
|
@RequiresPermissions("system:role:edit")
|
||||||
|
@GetMapping("/authUser/{roleId}")
|
||||||
/**
|
public String authUser(@PathVariable("roleId") Long roleId, ModelMap mmap) {
|
||||||
* 选择菜单树
|
mmap.put("role", roleService.selectRoleById(roleId));
|
||||||
*/
|
return prefix + "/authUser";
|
||||||
@GetMapping("/selectMenuTree")
|
}
|
||||||
public String selectMenuTree()
|
|
||||||
{
|
/**
|
||||||
return prefix + "/tree";
|
* 查询已分配用户角色列表
|
||||||
}
|
*/
|
||||||
|
@RequiresPermissions("system:role:list")
|
||||||
/**
|
@PostMapping("/authUser/allocatedList")
|
||||||
* 角色状态修改
|
@ResponseBody
|
||||||
*/
|
public TableDataInfo allocatedList(SysUser user) {
|
||||||
@Log(title = "角色管理", businessType = BusinessType.UPDATE)
|
return getDataTable(userService.selectAllocatedList(user, getPageRequest()));
|
||||||
@RequiresPermissions("system:role:edit")
|
}
|
||||||
@PostMapping("/changeStatus")
|
|
||||||
@ResponseBody
|
/**
|
||||||
public AjaxResult changeStatus(SysRole role)
|
* 取消授权
|
||||||
{
|
*/
|
||||||
roleService.checkRoleAllowed(role);
|
@Log(title = "角色管理", businessType = BusinessType.GRANT)
|
||||||
return toAjax(roleService.changeStatus(role));
|
@PostMapping("/authUser/cancel")
|
||||||
}
|
@ResponseBody
|
||||||
|
public AjaxResult cancelAuthUser(SysUserRole userRole) {
|
||||||
/**
|
return toAjax(roleService.deleteAuthUser(userRole));
|
||||||
* 分配用户
|
}
|
||||||
*/
|
|
||||||
@RequiresPermissions("system:role:edit")
|
/**
|
||||||
@GetMapping("/authUser/{roleId}")
|
* 批量取消授权
|
||||||
public String authUser(@PathVariable("roleId") Long roleId, ModelMap mmap)
|
*/
|
||||||
{
|
@Log(title = "角色管理", businessType = BusinessType.GRANT)
|
||||||
mmap.put("role", roleService.selectRoleById(roleId));
|
@PostMapping("/authUser/cancelAll")
|
||||||
return prefix + "/authUser";
|
@ResponseBody
|
||||||
}
|
public AjaxResult cancelAuthUserAll(Long roleId, String userIds) {
|
||||||
|
return toAjax(roleService.deleteAuthUsers(roleId, userIds));
|
||||||
/**
|
}
|
||||||
* 查询已分配用户角色列表
|
|
||||||
*/
|
/**
|
||||||
@RequiresPermissions("system:role:list")
|
* 选择用户
|
||||||
@PostMapping("/authUser/allocatedList")
|
*/
|
||||||
@ResponseBody
|
@GetMapping("/authUser/selectUser/{roleId}")
|
||||||
public TableDataInfo allocatedList(SysUser user)
|
public String selectUser(@PathVariable("roleId") Long roleId, ModelMap mmap) {
|
||||||
{
|
mmap.put("role", roleService.selectRoleById(roleId));
|
||||||
startPage();
|
return prefix + "/selectUser";
|
||||||
List<SysUser> list = userService.selectAllocatedList(user);
|
}
|
||||||
return getDataTable(list);
|
|
||||||
}
|
/**
|
||||||
|
* 查询未分配用户角色列表
|
||||||
/**
|
*/
|
||||||
* 取消授权
|
@RequiresPermissions("system:role:list")
|
||||||
*/
|
@PostMapping("/authUser/unallocatedList")
|
||||||
@Log(title = "角色管理", businessType = BusinessType.GRANT)
|
@ResponseBody
|
||||||
@PostMapping("/authUser/cancel")
|
public TableDataInfo unallocatedList(SysUser user) {
|
||||||
@ResponseBody
|
return getDataTable(userService.selectUnallocatedList(user, getPageRequest()));
|
||||||
public AjaxResult cancelAuthUser(SysUserRole userRole)
|
}
|
||||||
{
|
|
||||||
return toAjax(roleService.deleteAuthUser(userRole));
|
/**
|
||||||
}
|
* 批量选择用户授权
|
||||||
|
*/
|
||||||
/**
|
@Log(title = "角色管理", businessType = BusinessType.GRANT)
|
||||||
* 批量取消授权
|
@PostMapping("/authUser/selectAll")
|
||||||
*/
|
@ResponseBody
|
||||||
@Log(title = "角色管理", businessType = BusinessType.GRANT)
|
public AjaxResult selectAuthUserAll(Long roleId, String userIds) {
|
||||||
@PostMapping("/authUser/cancelAll")
|
return toAjax(roleService.insertAuthUsers(roleId, userIds));
|
||||||
@ResponseBody
|
}
|
||||||
public AjaxResult cancelAuthUserAll(Long roleId, String userIds)
|
|
||||||
{
|
|
||||||
return toAjax(roleService.deleteAuthUsers(roleId, userIds));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 选择用户
|
|
||||||
*/
|
|
||||||
@GetMapping("/authUser/selectUser/{roleId}")
|
|
||||||
public String selectUser(@PathVariable("roleId") Long roleId, ModelMap mmap)
|
|
||||||
{
|
|
||||||
mmap.put("role", roleService.selectRoleById(roleId));
|
|
||||||
return prefix + "/selectUser";
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 查询未分配用户角色列表
|
|
||||||
*/
|
|
||||||
@RequiresPermissions("system:role:list")
|
|
||||||
@PostMapping("/authUser/unallocatedList")
|
|
||||||
@ResponseBody
|
|
||||||
public TableDataInfo unallocatedList(SysUser user)
|
|
||||||
{
|
|
||||||
startPage();
|
|
||||||
List<SysUser> list = userService.selectUnallocatedList(user);
|
|
||||||
return getDataTable(list);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 批量选择用户授权
|
|
||||||
*/
|
|
||||||
@Log(title = "角色管理", businessType = BusinessType.GRANT)
|
|
||||||
@PostMapping("/authUser/selectAll")
|
|
||||||
@ResponseBody
|
|
||||||
public AjaxResult selectAuthUserAll(Long roleId, String userIds)
|
|
||||||
{
|
|
||||||
return toAjax(roleService.insertAuthUsers(roleId, userIds));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
@ -1,290 +1,290 @@
|
||||||
package com.ruoyi.web.controller.system;
|
package com.ruoyi.web.controller.system;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Controller;
|
import org.springframework.stereotype.Controller;
|
||||||
import org.springframework.ui.ModelMap;
|
import org.springframework.ui.ModelMap;
|
||||||
import org.springframework.validation.annotation.Validated;
|
import org.springframework.validation.annotation.Validated;
|
||||||
import org.springframework.web.bind.annotation.GetMapping;
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
import org.springframework.web.bind.annotation.PathVariable;
|
import org.springframework.web.bind.annotation.PathVariable;
|
||||||
import org.springframework.web.bind.annotation.PostMapping;
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
import org.springframework.web.bind.annotation.ResponseBody;
|
import org.springframework.web.bind.annotation.ResponseBody;
|
||||||
import org.springframework.web.multipart.MultipartFile;
|
import org.springframework.web.multipart.MultipartFile;
|
||||||
import com.ruoyi.common.annotation.Log;
|
import com.ruoyi.common.annotation.Log;
|
||||||
import com.ruoyi.common.constant.UserConstants;
|
import com.ruoyi.common.constant.UserConstants;
|
||||||
import com.ruoyi.common.core.controller.BaseController;
|
import com.ruoyi.common.core.controller.BaseController;
|
||||||
import com.ruoyi.common.core.domain.AjaxResult;
|
import com.ruoyi.common.core.domain.AjaxResult;
|
||||||
import com.ruoyi.common.core.page.TableDataInfo;
|
import com.ruoyi.common.core.page.TableDataInfo;
|
||||||
import com.ruoyi.common.enums.BusinessType;
|
import com.ruoyi.common.enums.BusinessType;
|
||||||
import com.ruoyi.common.utils.poi.ExcelUtil;
|
import com.ruoyi.common.utils.poi.ExcelUtil;
|
||||||
import com.ruoyi.framework.shiro.service.SysPasswordService;
|
import com.ruoyi.framework.shiro.service.SysPasswordService;
|
||||||
import com.ruoyi.framework.util.ShiroUtils;
|
import com.ruoyi.framework.util.ShiroUtils;
|
||||||
import com.ruoyi.system.domain.SysRole;
|
import com.ruoyi.system.domain.SysRole;
|
||||||
import com.ruoyi.system.domain.SysUser;
|
import com.ruoyi.system.domain.SysUser;
|
||||||
import com.ruoyi.system.service.ISysPostService;
|
import com.ruoyi.system.service.ISysPostService;
|
||||||
import com.ruoyi.system.service.ISysRoleService;
|
import com.ruoyi.system.service.ISysRoleService;
|
||||||
import com.ruoyi.system.service.ISysUserService;
|
import com.ruoyi.system.service.ISysUserService;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 用户信息
|
* 用户信息
|
||||||
*
|
*
|
||||||
* @author ruoyi
|
* @author ruoyi
|
||||||
*/
|
*/
|
||||||
@Controller
|
@Controller
|
||||||
@RequestMapping("/system/user")
|
@RequestMapping("/system/user")
|
||||||
public class SysUserController extends BaseController
|
public class SysUserController extends BaseController
|
||||||
{
|
{
|
||||||
private String prefix = "system/user";
|
private String prefix = "system/user";
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private ISysUserService userService;
|
private ISysUserService userService;
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private ISysRoleService roleService;
|
private ISysRoleService roleService;
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private ISysPostService postService;
|
private ISysPostService postService;
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private SysPasswordService passwordService;
|
private SysPasswordService passwordService;
|
||||||
|
|
||||||
@RequiresPermissions("system:user:view")
|
@RequiresPermissions("system:user:view")
|
||||||
@GetMapping()
|
@GetMapping()
|
||||||
public String user()
|
public String user()
|
||||||
{
|
{
|
||||||
return prefix + "/user";
|
return prefix + "/user";
|
||||||
}
|
}
|
||||||
|
|
||||||
@RequiresPermissions("system:user:list")
|
@RequiresPermissions("system:user:list")
|
||||||
@PostMapping("/list")
|
@PostMapping("/list")
|
||||||
@ResponseBody
|
@ResponseBody
|
||||||
public TableDataInfo list(SysUser user)
|
public TableDataInfo list(SysUser user)
|
||||||
{
|
{
|
||||||
startPage();
|
startPage();
|
||||||
List<SysUser> list = userService.selectUserList(user);
|
List<SysUser> list = userService.selectUserList(user);
|
||||||
return getDataTable(list);
|
return getDataTable(list);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Log(title = "用户管理", businessType = BusinessType.EXPORT)
|
@Log(title = "用户管理", businessType = BusinessType.EXPORT)
|
||||||
@RequiresPermissions("system:user:export")
|
@RequiresPermissions("system:user:export")
|
||||||
@PostMapping("/export")
|
@PostMapping("/export")
|
||||||
@ResponseBody
|
@ResponseBody
|
||||||
public AjaxResult export(SysUser user)
|
public AjaxResult export(SysUser user)
|
||||||
{
|
{
|
||||||
List<SysUser> list = userService.selectUserList(user);
|
List<SysUser> list = userService.selectUserList(user);
|
||||||
ExcelUtil<SysUser> util = new ExcelUtil<SysUser>(SysUser.class);
|
ExcelUtil<SysUser> util = new ExcelUtil<SysUser>(SysUser.class);
|
||||||
return util.exportExcel(list, "用户数据");
|
return util.exportExcel(list, "用户数据");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Log(title = "用户管理", businessType = BusinessType.IMPORT)
|
@Log(title = "用户管理", businessType = BusinessType.IMPORT)
|
||||||
@RequiresPermissions("system:user:import")
|
@RequiresPermissions("system:user:import")
|
||||||
@PostMapping("/importData")
|
@PostMapping("/importData")
|
||||||
@ResponseBody
|
@ResponseBody
|
||||||
public AjaxResult importData(MultipartFile file, boolean updateSupport) throws Exception
|
public AjaxResult importData(MultipartFile file, boolean updateSupport) throws Exception
|
||||||
{
|
{
|
||||||
ExcelUtil<SysUser> util = new ExcelUtil<SysUser>(SysUser.class);
|
ExcelUtil<SysUser> util = new ExcelUtil<SysUser>(SysUser.class);
|
||||||
List<SysUser> userList = util.importExcel(file.getInputStream());
|
List<SysUser> userList = util.importExcel(file.getInputStream());
|
||||||
String operName = ShiroUtils.getSysUser().getLoginName();
|
String operName = ShiroUtils.getSysUser().getLoginName();
|
||||||
String message = userService.importUser(userList, updateSupport, operName);
|
String message = userService.importUser(userList, updateSupport, operName);
|
||||||
return AjaxResult.success(message);
|
return AjaxResult.success(message);
|
||||||
}
|
}
|
||||||
|
|
||||||
@RequiresPermissions("system:user:view")
|
@RequiresPermissions("system:user:view")
|
||||||
@GetMapping("/importTemplate")
|
@GetMapping("/importTemplate")
|
||||||
@ResponseBody
|
@ResponseBody
|
||||||
public AjaxResult importTemplate()
|
public AjaxResult importTemplate()
|
||||||
{
|
{
|
||||||
ExcelUtil<SysUser> util = new ExcelUtil<SysUser>(SysUser.class);
|
ExcelUtil<SysUser> util = new ExcelUtil<SysUser>(SysUser.class);
|
||||||
return util.importTemplateExcel("用户数据");
|
return util.importTemplateExcel("用户数据");
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 新增用户
|
* 新增用户
|
||||||
*/
|
*/
|
||||||
@GetMapping("/add")
|
@GetMapping("/add")
|
||||||
public String add(ModelMap mmap)
|
public String add(ModelMap mmap)
|
||||||
{
|
{
|
||||||
mmap.put("roles", roleService.selectRoleAll().stream().filter(r -> !r.isAdmin()).collect(Collectors.toList()));
|
mmap.put("roles", roleService.selectRoleAll().stream().filter(r -> !r.isAdmin()).collect(Collectors.toList()));
|
||||||
mmap.put("posts", postService.selectPostAll());
|
mmap.put("posts", postService.selectPostAll());
|
||||||
return prefix + "/add";
|
return prefix + "/add";
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 新增保存用户
|
* 新增保存用户
|
||||||
*/
|
*/
|
||||||
@RequiresPermissions("system:user:add")
|
@RequiresPermissions("system:user:add")
|
||||||
@Log(title = "用户管理", businessType = BusinessType.INSERT)
|
@Log(title = "用户管理", businessType = BusinessType.INSERT)
|
||||||
@PostMapping("/add")
|
@PostMapping("/add")
|
||||||
@ResponseBody
|
@ResponseBody
|
||||||
public AjaxResult addSave(@Validated SysUser user)
|
public AjaxResult addSave(@Validated SysUser user)
|
||||||
{
|
{
|
||||||
if (UserConstants.USER_NAME_NOT_UNIQUE.equals(userService.checkLoginNameUnique(user.getLoginName())))
|
if (UserConstants.USER_NAME_NOT_UNIQUE.equals(userService.checkLoginNameUnique(user.getLoginName())))
|
||||||
{
|
{
|
||||||
return error("新增用户'" + user.getLoginName() + "'失败,登录账号已存在");
|
return error("新增用户'" + user.getLoginName() + "'失败,登录账号已存在");
|
||||||
}
|
}
|
||||||
else if (UserConstants.USER_PHONE_NOT_UNIQUE.equals(userService.checkPhoneUnique(user)))
|
else if (UserConstants.USER_PHONE_NOT_UNIQUE.equals(userService.checkPhoneUnique(user)))
|
||||||
{
|
{
|
||||||
return error("新增用户'" + user.getLoginName() + "'失败,手机号码已存在");
|
return error("新增用户'" + user.getLoginName() + "'失败,手机号码已存在");
|
||||||
}
|
}
|
||||||
else if (UserConstants.USER_EMAIL_NOT_UNIQUE.equals(userService.checkEmailUnique(user)))
|
else if (UserConstants.USER_EMAIL_NOT_UNIQUE.equals(userService.checkEmailUnique(user)))
|
||||||
{
|
{
|
||||||
return error("新增用户'" + user.getLoginName() + "'失败,邮箱账号已存在");
|
return error("新增用户'" + user.getLoginName() + "'失败,邮箱账号已存在");
|
||||||
}
|
}
|
||||||
user.setSalt(ShiroUtils.randomSalt());
|
user.setSalt(ShiroUtils.randomSalt());
|
||||||
user.setPassword(passwordService.encryptPassword(user.getLoginName(), user.getPassword(), user.getSalt()));
|
user.setPassword(passwordService.encryptPassword(user.getLoginName(), user.getPassword(), user.getSalt()));
|
||||||
user.setCreateBy(ShiroUtils.getLoginName());
|
user.setCreateBy(ShiroUtils.getLoginName());
|
||||||
return toAjax(userService.insertUser(user));
|
return toAjax(userService.insertUser(user));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 修改用户
|
* 修改用户
|
||||||
*/
|
*/
|
||||||
@GetMapping("/edit/{userId}")
|
@GetMapping("/edit/{userId}")
|
||||||
public String edit(@PathVariable("userId") Long userId, ModelMap mmap)
|
public String edit(@PathVariable("userId") Long userId, ModelMap mmap)
|
||||||
{
|
{
|
||||||
List<SysRole> roles = roleService.selectRolesByUserId(userId);
|
List<SysRole> roles = roleService.selectRolesByUserId(userId);
|
||||||
mmap.put("user", userService.selectUserById(userId));
|
mmap.put("user", userService.selectUserById(userId));
|
||||||
mmap.put("roles", SysUser.isAdmin(userId) ? roles : roles.stream().filter(r -> !r.isAdmin()).collect(Collectors.toList()));
|
mmap.put("roles", SysUser.isAdmin(userId) ? roles : roles.stream().filter(r -> !r.isAdmin()).collect(Collectors.toList()));
|
||||||
mmap.put("posts", postService.selectPostsByUserId(userId));
|
mmap.put("posts", postService.selectPostsByUserId(userId));
|
||||||
return prefix + "/edit";
|
return prefix + "/edit";
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 修改保存用户
|
* 修改保存用户
|
||||||
*/
|
*/
|
||||||
@RequiresPermissions("system:user:edit")
|
@RequiresPermissions("system:user:edit")
|
||||||
@Log(title = "用户管理", businessType = BusinessType.UPDATE)
|
@Log(title = "用户管理", businessType = BusinessType.UPDATE)
|
||||||
@PostMapping("/edit")
|
@PostMapping("/edit")
|
||||||
@ResponseBody
|
@ResponseBody
|
||||||
public AjaxResult editSave(@Validated SysUser user)
|
public AjaxResult editSave(@Validated SysUser user)
|
||||||
{
|
{
|
||||||
userService.checkUserAllowed(user);
|
userService.checkUserAllowed(user);
|
||||||
if (UserConstants.USER_PHONE_NOT_UNIQUE.equals(userService.checkPhoneUnique(user)))
|
if (UserConstants.USER_PHONE_NOT_UNIQUE.equals(userService.checkPhoneUnique(user)))
|
||||||
{
|
{
|
||||||
return error("修改用户'" + user.getLoginName() + "'失败,手机号码已存在");
|
return error("修改用户'" + user.getLoginName() + "'失败,手机号码已存在");
|
||||||
}
|
}
|
||||||
else if (UserConstants.USER_EMAIL_NOT_UNIQUE.equals(userService.checkEmailUnique(user)))
|
else if (UserConstants.USER_EMAIL_NOT_UNIQUE.equals(userService.checkEmailUnique(user)))
|
||||||
{
|
{
|
||||||
return error("修改用户'" + user.getLoginName() + "'失败,邮箱账号已存在");
|
return error("修改用户'" + user.getLoginName() + "'失败,邮箱账号已存在");
|
||||||
}
|
}
|
||||||
user.setUpdateBy(ShiroUtils.getLoginName());
|
user.setUpdateBy(ShiroUtils.getLoginName());
|
||||||
return toAjax(userService.updateUser(user));
|
return toAjax(userService.updateUser(user));
|
||||||
}
|
}
|
||||||
|
|
||||||
@RequiresPermissions("system:user:resetPwd")
|
@RequiresPermissions("system:user:resetPwd")
|
||||||
@GetMapping("/resetPwd/{userId}")
|
@GetMapping("/resetPwd/{userId}")
|
||||||
public String resetPwd(@PathVariable("userId") Long userId, ModelMap mmap)
|
public String resetPwd(@PathVariable("userId") Long userId, ModelMap mmap)
|
||||||
{
|
{
|
||||||
mmap.put("user", userService.selectUserById(userId));
|
mmap.put("user", userService.selectUserById(userId));
|
||||||
return prefix + "/resetPwd";
|
return prefix + "/resetPwd";
|
||||||
}
|
}
|
||||||
|
|
||||||
@RequiresPermissions("system:user:resetPwd")
|
@RequiresPermissions("system:user:resetPwd")
|
||||||
@Log(title = "重置密码", businessType = BusinessType.UPDATE)
|
@Log(title = "重置密码", businessType = BusinessType.UPDATE)
|
||||||
@PostMapping("/resetPwd")
|
@PostMapping("/resetPwd")
|
||||||
@ResponseBody
|
@ResponseBody
|
||||||
public AjaxResult resetPwdSave(SysUser user)
|
public AjaxResult resetPwdSave(SysUser user)
|
||||||
{
|
{
|
||||||
userService.checkUserAllowed(user);
|
userService.checkUserAllowed(user);
|
||||||
user.setSalt(ShiroUtils.randomSalt());
|
user.setSalt(ShiroUtils.randomSalt());
|
||||||
user.setPassword(passwordService.encryptPassword(user.getLoginName(), user.getPassword(), user.getSalt()));
|
user.setPassword(passwordService.encryptPassword(user.getLoginName(), user.getPassword(), user.getSalt()));
|
||||||
if (userService.resetUserPwd(user) > 0)
|
if (userService.resetUserPwd(user) > 0)
|
||||||
{
|
{
|
||||||
if (ShiroUtils.getUserId().longValue() == user.getUserId().longValue())
|
if (ShiroUtils.getUserId().longValue() == user.getUserId().longValue())
|
||||||
{
|
{
|
||||||
ShiroUtils.setSysUser(userService.selectUserById(user.getUserId()));
|
ShiroUtils.setSysUser(userService.selectUserById(user.getUserId()));
|
||||||
}
|
}
|
||||||
return success();
|
return success();
|
||||||
}
|
}
|
||||||
return error();
|
return error();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 进入授权角色页
|
* 进入授权角色页
|
||||||
*/
|
*/
|
||||||
@GetMapping("/authRole/{userId}")
|
@GetMapping("/authRole/{userId}")
|
||||||
public String authRole(@PathVariable("userId") Long userId, ModelMap mmap)
|
public String authRole(@PathVariable("userId") Long userId, ModelMap mmap)
|
||||||
{
|
{
|
||||||
SysUser user = userService.selectUserById(userId);
|
SysUser user = userService.selectUserById(userId);
|
||||||
// 获取用户所属的角色列表
|
// 获取用户所属的角色列表
|
||||||
List<SysRole> roles = roleService.selectRolesByUserId(userId);
|
List<SysRole> roles = roleService.selectRolesByUserId(userId);
|
||||||
mmap.put("user", user);
|
mmap.put("user", user);
|
||||||
mmap.put("roles", SysUser.isAdmin(userId) ? roles : roles.stream().filter(r -> !r.isAdmin()).collect(Collectors.toList()));
|
mmap.put("roles", SysUser.isAdmin(userId) ? roles : roles.stream().filter(r -> !r.isAdmin()).collect(Collectors.toList()));
|
||||||
return prefix + "/authRole";
|
return prefix + "/authRole";
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 用户授权角色
|
* 用户授权角色
|
||||||
*/
|
*/
|
||||||
@RequiresPermissions("system:user:add")
|
@RequiresPermissions("system:user:add")
|
||||||
@Log(title = "用户管理", businessType = BusinessType.GRANT)
|
@Log(title = "用户管理", businessType = BusinessType.GRANT)
|
||||||
@PostMapping("/authRole/insertAuthRole")
|
@PostMapping("/authRole/insertAuthRole")
|
||||||
@ResponseBody
|
@ResponseBody
|
||||||
public AjaxResult insertAuthRole(Long userId, Long[] roleIds)
|
public AjaxResult insertAuthRole(Long userId, Long[] roleIds)
|
||||||
{
|
{
|
||||||
userService.insertUserAuth(userId, roleIds);
|
userService.insertUserAuth(userId, roleIds);
|
||||||
return success();
|
return success();
|
||||||
}
|
}
|
||||||
|
|
||||||
@RequiresPermissions("system:user:remove")
|
@RequiresPermissions("system:user:remove")
|
||||||
@Log(title = "用户管理", businessType = BusinessType.DELETE)
|
@Log(title = "用户管理", businessType = BusinessType.DELETE)
|
||||||
@PostMapping("/remove")
|
@PostMapping("/remove")
|
||||||
@ResponseBody
|
@ResponseBody
|
||||||
public AjaxResult remove(String ids)
|
public AjaxResult remove(String ids)
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
return toAjax(userService.deleteUserByIds(ids));
|
return toAjax(userService.deleteUserByIds(ids));
|
||||||
}
|
}
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
{
|
{
|
||||||
return error(e.getMessage());
|
return error(e.getMessage());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 校验用户名
|
* 校验用户名
|
||||||
*/
|
*/
|
||||||
@PostMapping("/checkLoginNameUnique")
|
@PostMapping("/checkLoginNameUnique")
|
||||||
@ResponseBody
|
@ResponseBody
|
||||||
public String checkLoginNameUnique(SysUser user)
|
public String checkLoginNameUnique(SysUser user)
|
||||||
{
|
{
|
||||||
return userService.checkLoginNameUnique(user.getLoginName());
|
return userService.checkLoginNameUnique(user.getLoginName());
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 校验手机号码
|
* 校验手机号码
|
||||||
*/
|
*/
|
||||||
@PostMapping("/checkPhoneUnique")
|
@PostMapping("/checkPhoneUnique")
|
||||||
@ResponseBody
|
@ResponseBody
|
||||||
public String checkPhoneUnique(SysUser user)
|
public String checkPhoneUnique(SysUser user)
|
||||||
{
|
{
|
||||||
return userService.checkPhoneUnique(user);
|
return userService.checkPhoneUnique(user);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 校验email邮箱
|
* 校验email邮箱
|
||||||
*/
|
*/
|
||||||
@PostMapping("/checkEmailUnique")
|
@PostMapping("/checkEmailUnique")
|
||||||
@ResponseBody
|
@ResponseBody
|
||||||
public String checkEmailUnique(SysUser user)
|
public String checkEmailUnique(SysUser user)
|
||||||
{
|
{
|
||||||
return userService.checkEmailUnique(user);
|
return userService.checkEmailUnique(user);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 用户状态修改
|
* 用户状态修改
|
||||||
*/
|
*/
|
||||||
@Log(title = "用户管理", businessType = BusinessType.UPDATE)
|
@Log(title = "用户管理", businessType = BusinessType.UPDATE)
|
||||||
@RequiresPermissions("system:user:edit")
|
@RequiresPermissions("system:user:edit")
|
||||||
@PostMapping("/changeStatus")
|
@PostMapping("/changeStatus")
|
||||||
@ResponseBody
|
@ResponseBody
|
||||||
public AjaxResult changeStatus(SysUser user)
|
public AjaxResult changeStatus(SysUser user)
|
||||||
{
|
{
|
||||||
userService.checkUserAllowed(user);
|
userService.checkUserAllowed(user);
|
||||||
return toAjax(userService.changeStatus(user));
|
return toAjax(userService.changeStatus(user));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -0,0 +1,12 @@
|
||||||
|
package com.ruoyi.web.controller.system.base;
|
||||||
|
|
||||||
|
import com.ruoyi.common.core.controller.BaseController;
|
||||||
|
import com.ruoyi.framework.util.ShiroUtils;
|
||||||
|
import com.ruoyi.system.domain.SysUser;
|
||||||
|
|
||||||
|
public class WebController extends BaseController {
|
||||||
|
|
||||||
|
protected SysUser getUser(){
|
||||||
|
return ShiroUtils.getSysUser();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -1,26 +1,24 @@
|
||||||
package com.ruoyi.web.controller.tool;
|
package com.ruoyi.web.controller.tool;
|
||||||
|
|
||||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||||
import org.springframework.stereotype.Controller;
|
import org.springframework.stereotype.Controller;
|
||||||
import org.springframework.web.bind.annotation.GetMapping;
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
import com.ruoyi.common.core.controller.BaseController;
|
import com.ruoyi.common.core.controller.BaseController;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* build 表单构建
|
* build 表单构建
|
||||||
*
|
*
|
||||||
* @author ruoyi
|
* @author ruoyi
|
||||||
*/
|
*/
|
||||||
@Controller
|
@Controller
|
||||||
@RequestMapping("/tool/build")
|
@RequestMapping("/tool/build")
|
||||||
public class BuildController extends BaseController
|
public class BuildController extends BaseController {
|
||||||
{
|
private String prefix = "tool/build";
|
||||||
private String prefix = "tool/build";
|
|
||||||
|
@RequiresPermissions("tool:build:view")
|
||||||
@RequiresPermissions("tool:build:view")
|
@GetMapping()
|
||||||
@GetMapping()
|
public String build() {
|
||||||
public String build()
|
return prefix + "/build";
|
||||||
{
|
}
|
||||||
return prefix + "/build";
|
}
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
|
||||||
|
|
@ -1,24 +1,22 @@
|
||||||
package com.ruoyi.web.controller.tool;
|
package com.ruoyi.web.controller.tool;
|
||||||
|
|
||||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||||
import org.springframework.stereotype.Controller;
|
import org.springframework.stereotype.Controller;
|
||||||
import org.springframework.web.bind.annotation.GetMapping;
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
import com.ruoyi.common.core.controller.BaseController;
|
import com.ruoyi.common.core.controller.BaseController;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* swagger 接口
|
* swagger 接口
|
||||||
*
|
*
|
||||||
* @author ruoyi
|
* @author ruoyi
|
||||||
*/
|
*/
|
||||||
@Controller
|
@Controller
|
||||||
@RequestMapping("/tool/swagger")
|
@RequestMapping("/tool/swagger")
|
||||||
public class SwaggerController extends BaseController
|
public class SwaggerController extends BaseController {
|
||||||
{
|
@RequiresPermissions("tool:swagger:view")
|
||||||
@RequiresPermissions("tool:swagger:view")
|
@GetMapping()
|
||||||
@GetMapping()
|
public String index() {
|
||||||
public String index()
|
return redirect("/swagger-ui.html");
|
||||||
{
|
}
|
||||||
return redirect("/swagger-ui.html");
|
}
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
|
||||||
|
|
@ -1,175 +1,151 @@
|
||||||
package com.ruoyi.web.controller.tool;
|
package com.ruoyi.web.controller.tool;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.LinkedHashMap;
|
import java.util.LinkedHashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
|
||||||
import org.springframework.web.bind.annotation.GetMapping;
|
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||||
import org.springframework.web.bind.annotation.PathVariable;
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
import org.springframework.web.bind.annotation.PostMapping;
|
import org.springframework.web.bind.annotation.PathVariable;
|
||||||
import org.springframework.web.bind.annotation.PutMapping;
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
import org.springframework.web.bind.annotation.PutMapping;
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
import com.ruoyi.common.core.controller.BaseController;
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
import com.ruoyi.common.core.domain.AjaxResult;
|
import com.ruoyi.common.core.controller.BaseController;
|
||||||
import com.ruoyi.common.utils.StringUtils;
|
import com.ruoyi.common.core.domain.AjaxResult;
|
||||||
import io.swagger.annotations.Api;
|
import com.ruoyi.common.utils.StringUtils;
|
||||||
import io.swagger.annotations.ApiImplicitParam;
|
import io.swagger.annotations.Api;
|
||||||
import io.swagger.annotations.ApiModel;
|
import io.swagger.annotations.ApiImplicitParam;
|
||||||
import io.swagger.annotations.ApiModelProperty;
|
import io.swagger.annotations.ApiModel;
|
||||||
import io.swagger.annotations.ApiOperation;
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import io.swagger.annotations.ApiOperation;
|
||||||
/**
|
|
||||||
* swagger 用户测试方法
|
/**
|
||||||
*
|
* swagger 用户测试方法
|
||||||
* @author ruoyi
|
*
|
||||||
*/
|
* @author ruoyi
|
||||||
@Api("用户信息管理")
|
*/
|
||||||
@RestController
|
@Api("用户信息管理")
|
||||||
@RequestMapping("/test/user")
|
@RestController
|
||||||
public class TestController extends BaseController
|
@RequestMapping("/test/user")
|
||||||
{
|
public class TestController extends BaseController {
|
||||||
private final static Map<Integer, UserEntity> users = new LinkedHashMap<Integer, UserEntity>();
|
private final static Map<Integer, UserEntity> users = new LinkedHashMap<Integer, UserEntity>();
|
||||||
{
|
|
||||||
users.put(1, new UserEntity(1, "admin", "admin123", "15888888888"));
|
{
|
||||||
users.put(2, new UserEntity(2, "ry", "admin123", "15666666666"));
|
users.put(1, new UserEntity(1, "admin", "admin123", "15888888888"));
|
||||||
}
|
users.put(2, new UserEntity(2, "ry", "admin123", "15666666666"));
|
||||||
|
}
|
||||||
@ApiOperation("获取用户列表")
|
|
||||||
@GetMapping("/list")
|
@ApiOperation("获取用户列表")
|
||||||
public AjaxResult userList()
|
@GetMapping("/list")
|
||||||
{
|
public AjaxResult userList() {
|
||||||
List<UserEntity> userList = new ArrayList<UserEntity>(users.values());
|
List<UserEntity> userList = new ArrayList<UserEntity>(users.values());
|
||||||
return AjaxResult.success(userList);
|
return AjaxResult.success(userList);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiOperation("获取用户详细")
|
@ApiOperation("获取用户详细")
|
||||||
@ApiImplicitParam(name = "userId", value = "用户ID", required = true, dataType = "int", paramType = "path")
|
@ApiImplicitParam(name = "userId", value = "用户ID", required = true, dataType = "int", paramType = "path")
|
||||||
@GetMapping("/{userId}")
|
@GetMapping("/{userId}")
|
||||||
public AjaxResult getUser(@PathVariable Integer userId)
|
public AjaxResult getUser(@PathVariable Integer userId) {
|
||||||
{
|
if (!users.isEmpty() && users.containsKey(userId)) {
|
||||||
if (!users.isEmpty() && users.containsKey(userId))
|
return AjaxResult.success(users.get(userId));
|
||||||
{
|
} else {
|
||||||
return AjaxResult.success(users.get(userId));
|
return error("用户不存在");
|
||||||
}
|
}
|
||||||
else
|
}
|
||||||
{
|
|
||||||
return error("用户不存在");
|
@ApiOperation("新增用户")
|
||||||
}
|
@ApiImplicitParam(name = "userEntity", value = "新增用户信息", dataType = "UserEntity")
|
||||||
}
|
@PostMapping("/save")
|
||||||
|
public AjaxResult save(UserEntity user) {
|
||||||
@ApiOperation("新增用户")
|
if (StringUtils.isNull(user) || StringUtils.isNull(user.getUserId())) {
|
||||||
@ApiImplicitParam(name = "userEntity", value = "新增用户信息", dataType = "UserEntity")
|
return error("用户ID不能为空");
|
||||||
@PostMapping("/save")
|
}
|
||||||
public AjaxResult save(UserEntity user)
|
return AjaxResult.success(users.put(user.getUserId(), user));
|
||||||
{
|
}
|
||||||
if (StringUtils.isNull(user) || StringUtils.isNull(user.getUserId()))
|
|
||||||
{
|
@ApiOperation("更新用户")
|
||||||
return error("用户ID不能为空");
|
@ApiImplicitParam(name = "userEntity", value = "新增用户信息", dataType = "UserEntity")
|
||||||
}
|
@PutMapping("/update")
|
||||||
return AjaxResult.success(users.put(user.getUserId(), user));
|
public AjaxResult update(UserEntity user) {
|
||||||
}
|
if (StringUtils.isNull(user) || StringUtils.isNull(user.getUserId())) {
|
||||||
|
return error("用户ID不能为空");
|
||||||
@ApiOperation("更新用户")
|
}
|
||||||
@ApiImplicitParam(name = "userEntity", value = "新增用户信息", dataType = "UserEntity")
|
if (users.isEmpty() || !users.containsKey(user.getUserId())) {
|
||||||
@PutMapping("/update")
|
return error("用户不存在");
|
||||||
public AjaxResult update(UserEntity user)
|
}
|
||||||
{
|
users.remove(user.getUserId());
|
||||||
if (StringUtils.isNull(user) || StringUtils.isNull(user.getUserId()))
|
return AjaxResult.success(users.put(user.getUserId(), user));
|
||||||
{
|
}
|
||||||
return error("用户ID不能为空");
|
|
||||||
}
|
@ApiOperation("删除用户信息")
|
||||||
if (users.isEmpty() || !users.containsKey(user.getUserId()))
|
@ApiImplicitParam(name = "userId", value = "用户ID", required = true, dataType = "int", paramType = "path")
|
||||||
{
|
@DeleteMapping("/{userId}")
|
||||||
return error("用户不存在");
|
public AjaxResult delete(@PathVariable Integer userId) {
|
||||||
}
|
if (!users.isEmpty() && users.containsKey(userId)) {
|
||||||
users.remove(user.getUserId());
|
users.remove(userId);
|
||||||
return AjaxResult.success(users.put(user.getUserId(), user));
|
return success();
|
||||||
}
|
} else {
|
||||||
|
return error("用户不存在");
|
||||||
@ApiOperation("删除用户信息")
|
}
|
||||||
@ApiImplicitParam(name = "userId", value = "用户ID", required = true, dataType = "int", paramType = "path")
|
}
|
||||||
@DeleteMapping("/{userId}")
|
}
|
||||||
public AjaxResult delete(@PathVariable Integer userId)
|
|
||||||
{
|
@ApiModel("用户实体")
|
||||||
if (!users.isEmpty() && users.containsKey(userId))
|
class UserEntity {
|
||||||
{
|
@ApiModelProperty("用户ID")
|
||||||
users.remove(userId);
|
private Integer userId;
|
||||||
return success();
|
|
||||||
}
|
@ApiModelProperty("用户名称")
|
||||||
else
|
private String username;
|
||||||
{
|
|
||||||
return error("用户不存在");
|
@ApiModelProperty("用户密码")
|
||||||
}
|
private String password;
|
||||||
}
|
|
||||||
}
|
@ApiModelProperty("用户手机")
|
||||||
|
private String mobile;
|
||||||
@ApiModel("用户实体")
|
|
||||||
class UserEntity
|
public UserEntity() {
|
||||||
{
|
|
||||||
@ApiModelProperty("用户ID")
|
}
|
||||||
private Integer userId;
|
|
||||||
|
public UserEntity(Integer userId, String username, String password, String mobile) {
|
||||||
@ApiModelProperty("用户名称")
|
this.userId = userId;
|
||||||
private String username;
|
this.username = username;
|
||||||
|
this.password = password;
|
||||||
@ApiModelProperty("用户密码")
|
this.mobile = mobile;
|
||||||
private String password;
|
}
|
||||||
|
|
||||||
@ApiModelProperty("用户手机")
|
public Integer getUserId() {
|
||||||
private String mobile;
|
return userId;
|
||||||
|
}
|
||||||
public UserEntity()
|
|
||||||
{
|
public void setUserId(Integer userId) {
|
||||||
|
this.userId = userId;
|
||||||
}
|
}
|
||||||
|
|
||||||
public UserEntity(Integer userId, String username, String password, String mobile)
|
public String getUsername() {
|
||||||
{
|
return username;
|
||||||
this.userId = userId;
|
}
|
||||||
this.username = username;
|
|
||||||
this.password = password;
|
public void setUsername(String username) {
|
||||||
this.mobile = mobile;
|
this.username = username;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Integer getUserId()
|
public String getPassword() {
|
||||||
{
|
return password;
|
||||||
return userId;
|
}
|
||||||
}
|
|
||||||
|
public void setPassword(String password) {
|
||||||
public void setUserId(Integer userId)
|
this.password = password;
|
||||||
{
|
}
|
||||||
this.userId = userId;
|
|
||||||
}
|
public String getMobile() {
|
||||||
|
return mobile;
|
||||||
public String getUsername()
|
}
|
||||||
{
|
|
||||||
return username;
|
public void setMobile(String mobile) {
|
||||||
}
|
this.mobile = mobile;
|
||||||
|
}
|
||||||
public void setUsername(String username)
|
}
|
||||||
{
|
|
||||||
this.username = username;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getPassword()
|
|
||||||
{
|
|
||||||
return password;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setPassword(String password)
|
|
||||||
{
|
|
||||||
this.password = password;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getMobile()
|
|
||||||
{
|
|
||||||
return mobile;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setMobile(String mobile)
|
|
||||||
{
|
|
||||||
this.mobile = mobile;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
|
||||||
|
|
@ -1,69 +1,69 @@
|
||||||
package com.ruoyi.web.core.config;
|
package com.ruoyi.web.core.config;
|
||||||
|
|
||||||
import org.springframework.beans.factory.annotation.Value;
|
import org.springframework.beans.factory.annotation.Value;
|
||||||
import org.springframework.context.annotation.Bean;
|
import org.springframework.context.annotation.Bean;
|
||||||
import org.springframework.context.annotation.Configuration;
|
import org.springframework.context.annotation.Configuration;
|
||||||
import com.ruoyi.common.config.Global;
|
import com.ruoyi.common.config.Global;
|
||||||
import io.swagger.annotations.ApiOperation;
|
import io.swagger.annotations.ApiOperation;
|
||||||
import springfox.documentation.builders.ApiInfoBuilder;
|
import springfox.documentation.builders.ApiInfoBuilder;
|
||||||
import springfox.documentation.builders.PathSelectors;
|
import springfox.documentation.builders.PathSelectors;
|
||||||
import springfox.documentation.builders.RequestHandlerSelectors;
|
import springfox.documentation.builders.RequestHandlerSelectors;
|
||||||
import springfox.documentation.service.ApiInfo;
|
import springfox.documentation.service.ApiInfo;
|
||||||
import springfox.documentation.service.Contact;
|
import springfox.documentation.service.Contact;
|
||||||
import springfox.documentation.spi.DocumentationType;
|
import springfox.documentation.spi.DocumentationType;
|
||||||
import springfox.documentation.spring.web.plugins.Docket;
|
import springfox.documentation.spring.web.plugins.Docket;
|
||||||
import springfox.documentation.swagger2.annotations.EnableSwagger2;
|
import springfox.documentation.swagger2.annotations.EnableSwagger2;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Swagger2的接口配置
|
* Swagger2的接口配置
|
||||||
*
|
*
|
||||||
* @author ruoyi
|
* @author ruoyi
|
||||||
*/
|
*/
|
||||||
@Configuration
|
@Configuration
|
||||||
@EnableSwagger2
|
@EnableSwagger2
|
||||||
public class SwaggerConfig
|
public class SwaggerConfig
|
||||||
{
|
{
|
||||||
/** 是否开启swagger */
|
/** 是否开启swagger */
|
||||||
@Value("${swagger.enabled}")
|
@Value("${swagger.enabled}")
|
||||||
private boolean enabled;
|
private boolean enabled;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 创建API
|
* 创建API
|
||||||
*/
|
*/
|
||||||
@Bean
|
@Bean
|
||||||
public Docket createRestApi()
|
public Docket createRestApi()
|
||||||
{
|
{
|
||||||
return new Docket(DocumentationType.SWAGGER_2)
|
return new Docket(DocumentationType.SWAGGER_2)
|
||||||
// 是否启用Swagger
|
// 是否启用Swagger
|
||||||
.enable(enabled)
|
.enable(enabled)
|
||||||
// 用来创建该API的基本信息,展示在文档的页面中(自定义展示的信息)
|
// 用来创建该API的基本信息,展示在文档的页面中(自定义展示的信息)
|
||||||
.apiInfo(apiInfo())
|
.apiInfo(apiInfo())
|
||||||
// 设置哪些接口暴露给Swagger展示
|
// 设置哪些接口暴露给Swagger展示
|
||||||
.select()
|
.select()
|
||||||
// 扫描所有有注解的api,用这种方式更灵活
|
// 扫描所有有注解的api,用这种方式更灵活
|
||||||
.apis(RequestHandlerSelectors.withMethodAnnotation(ApiOperation.class))
|
.apis(RequestHandlerSelectors.withMethodAnnotation(ApiOperation.class))
|
||||||
// 扫描指定包中的swagger注解
|
// 扫描指定包中的swagger注解
|
||||||
//.apis(RequestHandlerSelectors.basePackage("com.ruoyi.project.tool.swagger"))
|
//.apis(RequestHandlerSelectors.basePackage("com.ruoyi.project.tool.swagger"))
|
||||||
// 扫描所有 .apis(RequestHandlerSelectors.any())
|
// 扫描所有 .apis(RequestHandlerSelectors.any())
|
||||||
.paths(PathSelectors.any())
|
.paths(PathSelectors.any())
|
||||||
.build();
|
.build();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 添加摘要信息
|
* 添加摘要信息
|
||||||
*/
|
*/
|
||||||
private ApiInfo apiInfo()
|
private ApiInfo apiInfo()
|
||||||
{
|
{
|
||||||
// 用ApiInfoBuilder进行定制
|
// 用ApiInfoBuilder进行定制
|
||||||
return new ApiInfoBuilder()
|
return new ApiInfoBuilder()
|
||||||
// 设置标题
|
// 设置标题
|
||||||
.title("标题:若依管理系统_接口文档")
|
.title("标题:若依管理系统_接口文档")
|
||||||
// 描述
|
// 描述
|
||||||
.description("描述:用于管理集团旗下公司的人员信息,具体包括XXX,XXX模块...")
|
.description("描述:用于管理集团旗下公司的人员信息,具体包括XXX,XXX模块...")
|
||||||
// 作者信息
|
// 作者信息
|
||||||
.contact(new Contact(Global.getName(), null, null))
|
.contact(new Contact(Global.getName(), null, null))
|
||||||
// 版本
|
// 版本
|
||||||
.version("版本号:" + Global.getVersion())
|
.version("版本号:" + Global.getVersion())
|
||||||
.build();
|
.build();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,37 @@
|
||||||
|
package com.ruoyi.web.core.config;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||||
|
import com.fasterxml.jackson.databind.SerializationFeature;
|
||||||
|
import com.fasterxml.jackson.datatype.hibernate5.Hibernate5Module;
|
||||||
|
import org.springframework.context.annotation.Configuration;
|
||||||
|
import org.springframework.http.converter.HttpMessageConverter;
|
||||||
|
import org.springframework.http.converter.json.MappingJackson2HttpMessageConverter;
|
||||||
|
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@Configuration
|
||||||
|
public class WebmvcConfig implements WebMvcConfigurer {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void extendMessageConverters(List<HttpMessageConverter<?>> converters) {
|
||||||
|
for ( HttpMessageConverter<?> converter : converters ) {
|
||||||
|
if ( converter instanceof MappingJackson2HttpMessageConverter) {
|
||||||
|
MappingJackson2HttpMessageConverter jacksonConverter = (MappingJackson2HttpMessageConverter) converter;
|
||||||
|
ObjectMapper objectMapper = jacksonConverter.getObjectMapper();
|
||||||
|
|
||||||
|
//--- register hibernateModule in MappingJackson2HttpMessageConverter.objectMapper
|
||||||
|
Hibernate5Module hibernate5Module = new Hibernate5Module();
|
||||||
|
hibernate5Module.disable(Hibernate5Module.Feature.FORCE_LAZY_LOADING);
|
||||||
|
hibernate5Module.enable(Hibernate5Module.Feature.WRITE_MISSING_ENTITIES_AS_NULL);
|
||||||
|
hibernate5Module.disable(Hibernate5Module.Feature.USE_TRANSIENT_ANNOTATION);
|
||||||
|
objectMapper.registerModule(hibernate5Module);
|
||||||
|
|
||||||
|
//--- other configurations
|
||||||
|
jacksonConverter.setPrettyPrint( true );
|
||||||
|
objectMapper.disable(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS);
|
||||||
|
objectMapper.enable(SerializationFeature.INDENT_OUTPUT);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -1,57 +1,80 @@
|
||||||
# 数据源配置
|
#flyway会自动建立该数据库
|
||||||
spring:
|
db:
|
||||||
datasource:
|
# mysql, oracle, sqlserver
|
||||||
type: com.alibaba.druid.pool.DruidDataSource
|
type: mysql
|
||||||
driverClassName: com.mysql.cj.jdbc.Driver
|
name: framework
|
||||||
druid:
|
username: root
|
||||||
# 主库数据源
|
password: root
|
||||||
master:
|
# 数据源配置
|
||||||
url: jdbc:mysql://localhost:3306/ry?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
|
spring:
|
||||||
username: root
|
datasource:
|
||||||
password: password
|
type: com.alibaba.druid.pool.DruidDataSource
|
||||||
# 从库数据源
|
driverClassName: com.mysql.cj.jdbc.Driver
|
||||||
slave:
|
druid:
|
||||||
# 从数据源开关/默认关闭
|
# 主库数据源
|
||||||
enabled: false
|
master:
|
||||||
url:
|
url: jdbc:mysql://localhost:3306/${db.name}?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
|
||||||
username:
|
username: ${db.username}
|
||||||
password:
|
password: ${db.password}
|
||||||
# 初始连接数
|
# 从库数据源
|
||||||
initialSize: 5
|
slave:
|
||||||
# 最小连接池数量
|
# 从数据源开关/默认关闭
|
||||||
minIdle: 10
|
enabled: false
|
||||||
# 最大连接池数量
|
url:
|
||||||
maxActive: 20
|
username:
|
||||||
# 配置获取连接等待超时的时间
|
password:
|
||||||
maxWait: 60000
|
# 初始连接数
|
||||||
# 配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位是毫秒
|
initialSize: 5
|
||||||
timeBetweenEvictionRunsMillis: 60000
|
# 最小连接池数量
|
||||||
# 配置一个连接在池中最小生存的时间,单位是毫秒
|
minIdle: 10
|
||||||
minEvictableIdleTimeMillis: 300000
|
# 最大连接池数量
|
||||||
# 配置一个连接在池中最大生存的时间,单位是毫秒
|
maxActive: 20
|
||||||
maxEvictableIdleTimeMillis: 900000
|
# 配置获取连接等待超时的时间
|
||||||
# 配置检测连接是否有效
|
maxWait: 60000
|
||||||
validationQuery: SELECT 1 FROM DUAL
|
# 配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位是毫秒
|
||||||
testWhileIdle: true
|
timeBetweenEvictionRunsMillis: 60000
|
||||||
testOnBorrow: false
|
# 配置一个连接在池中最小生存的时间,单位是毫秒
|
||||||
testOnReturn: false
|
minEvictableIdleTimeMillis: 300000
|
||||||
webStatFilter:
|
# 配置一个连接在池中最大生存的时间,单位是毫秒
|
||||||
enabled: true
|
maxEvictableIdleTimeMillis: 900000
|
||||||
statViewServlet:
|
# 配置检测连接是否有效
|
||||||
enabled: true
|
validationQuery: SELECT 1 FROM DUAL
|
||||||
# 设置白名单,不填则允许所有访问
|
testWhileIdle: true
|
||||||
allow:
|
testOnBorrow: false
|
||||||
url-pattern: /druid/*
|
testOnReturn: false
|
||||||
# 控制台管理用户名和密码
|
webStatFilter:
|
||||||
login-username:
|
enabled: true
|
||||||
login-password:
|
statViewServlet:
|
||||||
filter:
|
enabled: true
|
||||||
stat:
|
# 设置白名单,不填则允许所有访问
|
||||||
enabled: true
|
allow:
|
||||||
# 慢SQL记录
|
url-pattern: /druid/*
|
||||||
log-slow-sql: true
|
# 控制台管理用户名和密码
|
||||||
slow-sql-millis: 1000
|
login-username:
|
||||||
merge-sql: true
|
login-password:
|
||||||
wall:
|
filter:
|
||||||
config:
|
stat:
|
||||||
multi-statement-allow: true
|
enabled: true
|
||||||
|
# 慢SQL记录
|
||||||
|
log-slow-sql: true
|
||||||
|
slow-sql-millis: 1000
|
||||||
|
merge-sql: true
|
||||||
|
wall:
|
||||||
|
config:
|
||||||
|
multi-statement-allow: true
|
||||||
|
|
||||||
|
flyway:
|
||||||
|
enabled: true
|
||||||
|
url: jdbc:mysql://localhost:3306/mysql?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
|
||||||
|
user: ${db.username}
|
||||||
|
password: ${db.password}
|
||||||
|
#目标数据库已经存在,不自动升级
|
||||||
|
baseline-on-migrate: false
|
||||||
|
encoding: utf-8
|
||||||
|
clean-on-validation-error: false
|
||||||
|
clean-disabled: true
|
||||||
|
#数据库自动迁移的位置
|
||||||
|
locations: classpath:db/migration/${db.type}
|
||||||
|
# 需要管理的数据库
|
||||||
|
schemas: ${db.name}
|
||||||
|
sql-migration-prefix: v
|
||||||
|
|
@ -1,137 +1,153 @@
|
||||||
# 项目相关配置
|
# 项目相关配置
|
||||||
ruoyi:
|
ruoyi:
|
||||||
# 名称
|
# 名称
|
||||||
name: RuoYi
|
name: RuoYi
|
||||||
# 版本
|
# 版本
|
||||||
version: 4.4.0
|
version: 4.4.0
|
||||||
# 版权年份
|
# 版权年份
|
||||||
copyrightYear: 2019
|
copyrightYear: 2019
|
||||||
# 实例演示开关
|
# 实例演示开关
|
||||||
demoEnabled: true
|
demoEnabled: true
|
||||||
# 文件路径 示例( Windows配置D:/ruoyi/uploadPath,Linux配置 /home/ruoyi/uploadPath)
|
# 文件路径 示例( Windows配置D:/ruoyi/uploadPath,Linux配置 /home/ruoyi/uploadPath)
|
||||||
profile: D:/ruoyi/uploadPath
|
profile: D:/ruoyi/uploadPath
|
||||||
# 获取ip地址开关
|
# 获取ip地址开关
|
||||||
addressEnabled: false
|
addressEnabled: false
|
||||||
|
|
||||||
# 开发环境配置
|
# 开发环境配置
|
||||||
server:
|
server:
|
||||||
# 服务器的HTTP端口,默认为80
|
# 服务器的HTTP端口,默认为80
|
||||||
port: 80
|
port: 80
|
||||||
servlet:
|
servlet:
|
||||||
# 应用的访问路径
|
# 应用的访问路径
|
||||||
context-path: /
|
context-path: /
|
||||||
tomcat:
|
tomcat:
|
||||||
# tomcat的URI编码
|
# tomcat的URI编码
|
||||||
uri-encoding: UTF-8
|
uri-encoding: UTF-8
|
||||||
# tomcat最大线程数,默认为200
|
# tomcat最大线程数,默认为200
|
||||||
max-threads: 800
|
max-threads: 800
|
||||||
# Tomcat启动初始化的线程数,默认值25
|
# Tomcat启动初始化的线程数,默认值25
|
||||||
min-spare-threads: 30
|
min-spare-threads: 30
|
||||||
|
|
||||||
# 日志配置
|
# 日志配置
|
||||||
logging:
|
logging:
|
||||||
level:
|
level:
|
||||||
com.ruoyi: debug
|
root: warn
|
||||||
org.springframework: warn
|
com.ruoyi: debug
|
||||||
|
com.ruoyi.quartz.mapper: warn
|
||||||
# 用户配置
|
com.ruoyi.system.mapper: warn
|
||||||
user:
|
|
||||||
password:
|
# 用户配置
|
||||||
# 密码错误{maxRetryCount}次锁定10分钟
|
user:
|
||||||
maxRetryCount: 5
|
password:
|
||||||
|
# 密码错误{maxRetryCount}次锁定10分钟
|
||||||
# Spring配置
|
maxRetryCount: 5
|
||||||
spring:
|
|
||||||
# 模板引擎
|
# Spring配置
|
||||||
thymeleaf:
|
spring:
|
||||||
mode: HTML
|
# 模板引擎
|
||||||
encoding: utf-8
|
thymeleaf:
|
||||||
# 禁用缓存
|
mode: HTML
|
||||||
cache: false
|
encoding: utf-8
|
||||||
# 资源信息
|
# 禁用缓存
|
||||||
messages:
|
cache: false
|
||||||
# 国际化资源文件路径
|
# 资源信息
|
||||||
basename: static/i18n/messages
|
messages:
|
||||||
jackson:
|
# 国际化资源文件路径
|
||||||
time-zone: GMT+8
|
basename: static/i18n/messages
|
||||||
date-format: yyyy-MM-dd HH:mm:ss
|
jackson:
|
||||||
profiles:
|
time-zone: GMT+8
|
||||||
active: druid
|
date-format: yyyy-MM-dd HH:mm:ss
|
||||||
# 文件上传
|
profiles:
|
||||||
servlet:
|
active: druid
|
||||||
multipart:
|
# 文件上传
|
||||||
# 单个文件大小
|
servlet:
|
||||||
max-file-size: 10MB
|
multipart:
|
||||||
# 设置总上传的文件大小
|
# 单个文件大小
|
||||||
max-request-size: 20MB
|
max-file-size: 10MB
|
||||||
# 服务模块
|
# 设置总上传的文件大小
|
||||||
devtools:
|
max-request-size: 20MB
|
||||||
restart:
|
# 服务模块
|
||||||
# 热部署开关
|
devtools:
|
||||||
enabled: true
|
restart:
|
||||||
|
# 热部署开关
|
||||||
# MyBatis
|
enabled: false
|
||||||
mybatis:
|
jpa:
|
||||||
# 搜索指定包别名
|
hibernate:
|
||||||
typeAliasesPackage: com.ruoyi.**.domain
|
ddl-auto: update
|
||||||
# 配置mapper的扫描,找到所有的mapper.xml映射文件
|
use-new-id-generator-mappings: true
|
||||||
mapperLocations: classpath*:mapper/**/*Mapper.xml
|
show-sql: true
|
||||||
# 加载全局的配置文件
|
database-platform: org.hibernate.dialect.MySQL55Dialect
|
||||||
configLocation: classpath:mybatis/mybatis-config.xml
|
open-in-view: false
|
||||||
|
properties:
|
||||||
# PageHelper分页插件
|
hibernate:
|
||||||
pagehelper:
|
format_sql: false
|
||||||
helperDialect: mysql
|
cache:
|
||||||
reasonable: true
|
type: jcache
|
||||||
supportMethodsArguments: true
|
jcache:
|
||||||
params: count=countSql
|
provider: org.ehcache.jsr107.EhcacheCachingProvider
|
||||||
|
|
||||||
# Shiro
|
# MyBatis
|
||||||
shiro:
|
mybatis:
|
||||||
user:
|
# 搜索指定包别名
|
||||||
# 登录地址
|
typeAliasesPackage: com.ruoyi.**.domain
|
||||||
loginUrl: /login
|
# 配置mapper的扫描,找到所有的mapper.xml映射文件
|
||||||
# 权限认证失败地址
|
mapperLocations: classpath*:mapper/**/*Mapper.xml
|
||||||
unauthorizedUrl: /unauth
|
# 加载全局的配置文件
|
||||||
# 首页地址
|
configLocation: classpath:mybatis/mybatis-config.xml
|
||||||
indexUrl: /index
|
|
||||||
# 验证码开关
|
# PageHelper分页插件
|
||||||
captchaEnabled: true
|
pagehelper:
|
||||||
# 验证码类型 math 数组计算 char 字符
|
helperDialect: mysql
|
||||||
captchaType: math
|
reasonable: true
|
||||||
cookie:
|
supportMethodsArguments: true
|
||||||
# 设置Cookie的域名 默认空,即当前访问的域名
|
params: count=countSql
|
||||||
domain:
|
|
||||||
# 设置cookie的有效访问路径
|
# Shiro
|
||||||
path: /
|
shiro:
|
||||||
# 设置HttpOnly属性
|
user:
|
||||||
httpOnly: true
|
# 登录地址
|
||||||
# 设置Cookie的过期时间,天为单位
|
loginUrl: /login
|
||||||
maxAge: 30
|
# 权限认证失败地址
|
||||||
# 设置密钥,务必保持唯一性(生成方式,直接拷贝到main运行即可)KeyGenerator keygen = KeyGenerator.getInstance("AES"); SecretKey deskey = keygen.generateKey(); System.out.println(Base64.encodeToString(deskey.getEncoded()));
|
unauthorizedUrl: /unauth
|
||||||
cipherKey: zSyK5Kp6PZAAjlT+eeNMlg==
|
# 首页地址
|
||||||
session:
|
indexUrl: /index
|
||||||
# Session超时时间,-1代表永不过期(默认30分钟)
|
# 验证码开关
|
||||||
expireTime: 30
|
captchaEnabled: true
|
||||||
# 同步session到数据库的周期(默认1分钟)
|
# 验证码类型 math 数组计算 char 字符
|
||||||
dbSyncPeriod: 1
|
captchaType: math
|
||||||
# 相隔多久检查一次session的有效性,默认就是10分钟
|
cookie:
|
||||||
validationInterval: 10
|
# 设置Cookie的域名 默认空,即当前访问的域名
|
||||||
# 同一个用户最大会话数,比如2的意思是同一个账号允许最多同时两个人登录(默认-1不限制)
|
domain:
|
||||||
maxSession: -1
|
# 设置cookie的有效访问路径
|
||||||
# 踢出之前登录的/之后登录的用户,默认踢出之前登录的用户
|
path: /
|
||||||
kickoutAfter: false
|
# 设置HttpOnly属性
|
||||||
|
httpOnly: true
|
||||||
# 防止XSS攻击
|
# 设置Cookie的过期时间,天为单位
|
||||||
xss:
|
maxAge: 30
|
||||||
# 过滤开关
|
# 设置密钥,务必保持唯一性(生成方式,直接拷贝到main运行即可)KeyGenerator keygen = KeyGenerator.getInstance("AES"); SecretKey deskey = keygen.generateKey(); System.out.println(Base64.encodeToString(deskey.getEncoded()));
|
||||||
enabled: true
|
cipherKey: zSyK5Kp6PZAAjlT+eeNMlg==
|
||||||
# 排除链接(多个用逗号分隔)
|
session:
|
||||||
excludes: /system/notice/*
|
# Session超时时间,-1代表永不过期(默认30分钟)
|
||||||
# 匹配链接
|
expireTime: 30
|
||||||
urlPatterns: /system/*,/monitor/*,/tool/*
|
# 同步session到数据库的周期(默认1分钟)
|
||||||
|
dbSyncPeriod: 1
|
||||||
# Swagger配置
|
# 相隔多久检查一次session的有效性,默认就是10分钟
|
||||||
swagger:
|
validationInterval: 10
|
||||||
# 是否开启swagger
|
# 同一个用户最大会话数,比如2的意思是同一个账号允许最多同时两个人登录(默认-1不限制)
|
||||||
enabled: true
|
maxSession: -1
|
||||||
|
# 踢出之前登录的/之后登录的用户,默认踢出之前登录的用户
|
||||||
|
kickoutAfter: false
|
||||||
|
|
||||||
|
# 防止XSS攻击
|
||||||
|
xss:
|
||||||
|
# 过滤开关
|
||||||
|
enabled: true
|
||||||
|
# 排除链接(多个用逗号分隔)
|
||||||
|
excludes: /system/notice/*
|
||||||
|
# 匹配链接
|
||||||
|
urlPatterns: /system/*,/monitor/*,/tool/*
|
||||||
|
|
||||||
|
# Swagger配置
|
||||||
|
swagger:
|
||||||
|
# 是否开启swagger
|
||||||
|
enabled: true
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,706 @@
|
||||||
|
-- ----------------------------
|
||||||
|
-- 1、部门表
|
||||||
|
-- ----------------------------
|
||||||
|
drop table if exists sys_dept;
|
||||||
|
create table sys_dept (
|
||||||
|
dept_id bigint(20) not null auto_increment comment '部门id',
|
||||||
|
parent_id bigint(20) default 0 comment '父部门id',
|
||||||
|
ancestors varchar(50) default '' comment '祖级列表',
|
||||||
|
dept_name varchar(30) default '' comment '部门名称',
|
||||||
|
order_num int(4) default 0 comment '显示顺序',
|
||||||
|
leader varchar(20) default null comment '负责人',
|
||||||
|
phone varchar(11) default null comment '联系电话',
|
||||||
|
email varchar(50) default null comment '邮箱',
|
||||||
|
status char(1) default '0' comment '部门状态(0正常 1停用)',
|
||||||
|
del_flag char(1) default '0' comment '删除标志(0代表存在 2代表删除)',
|
||||||
|
create_by varchar(64) default '' comment '创建者',
|
||||||
|
create_time datetime comment '创建时间',
|
||||||
|
update_by varchar(64) default '' comment '更新者',
|
||||||
|
update_time datetime comment '更新时间',
|
||||||
|
primary key (dept_id)
|
||||||
|
) engine=innodb auto_increment=200 comment = '部门表';
|
||||||
|
|
||||||
|
-- ----------------------------
|
||||||
|
-- 初始化-部门表数据
|
||||||
|
-- ----------------------------
|
||||||
|
insert into sys_dept values(100, 0, '0', '若依科技', 0, '若依', '15888888888', 'ry@qq.com', '0', '0', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00');
|
||||||
|
insert into sys_dept values(101, 100, '0,100', '深圳总公司', 1, '若依', '15888888888', 'ry@qq.com', '0', '0', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00');
|
||||||
|
insert into sys_dept values(102, 100, '0,100', '长沙分公司', 2, '若依', '15888888888', 'ry@qq.com', '0', '0', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00');
|
||||||
|
insert into sys_dept values(103, 101, '0,100,101', '研发部门', 1, '若依', '15888888888', 'ry@qq.com', '0', '0', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00');
|
||||||
|
insert into sys_dept values(104, 101, '0,100,101', '市场部门', 2, '若依', '15888888888', 'ry@qq.com', '0', '0', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00');
|
||||||
|
insert into sys_dept values(105, 101, '0,100,101', '测试部门', 3, '若依', '15888888888', 'ry@qq.com', '0', '0', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00');
|
||||||
|
insert into sys_dept values(106, 101, '0,100,101', '财务部门', 4, '若依', '15888888888', 'ry@qq.com', '0', '0', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00');
|
||||||
|
insert into sys_dept values(107, 101, '0,100,101', '运维部门', 5, '若依', '15888888888', 'ry@qq.com', '0', '0', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00');
|
||||||
|
insert into sys_dept values(108, 102, '0,100,102', '市场部门', 1, '若依', '15888888888', 'ry@qq.com', '0', '0', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00');
|
||||||
|
insert into sys_dept values(109, 102, '0,100,102', '财务部门', 2, '若依', '15888888888', 'ry@qq.com', '0', '0', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00');
|
||||||
|
|
||||||
|
|
||||||
|
-- ----------------------------
|
||||||
|
-- 2、用户信息表
|
||||||
|
-- ----------------------------
|
||||||
|
drop table if exists sys_user;
|
||||||
|
create table sys_user (
|
||||||
|
user_id bigint(20) not null auto_increment comment '用户ID',
|
||||||
|
dept_id bigint(20) default null comment '部门ID',
|
||||||
|
login_name varchar(30) not null comment '登录账号',
|
||||||
|
user_name varchar(30) default '' comment '用户昵称',
|
||||||
|
user_type varchar(2) default '00' comment '用户类型(00系统用户 01注册用户)',
|
||||||
|
email varchar(50) default '' comment '用户邮箱',
|
||||||
|
phonenumber varchar(11) default '' comment '手机号码',
|
||||||
|
sex char(1) default '0' comment '用户性别(0男 1女 2未知)',
|
||||||
|
avatar varchar(100) default '' comment '头像路径',
|
||||||
|
password varchar(50) default '' comment '密码',
|
||||||
|
salt varchar(20) default '' comment '盐加密',
|
||||||
|
status char(1) default '0' comment '帐号状态(0正常 1停用)',
|
||||||
|
del_flag char(1) default '0' comment '删除标志(0代表存在 2代表删除)',
|
||||||
|
login_ip varchar(50) default '' comment '最后登陆IP',
|
||||||
|
login_date datetime comment '最后登陆时间',
|
||||||
|
create_by varchar(64) default '' comment '创建者',
|
||||||
|
create_time datetime comment '创建时间',
|
||||||
|
update_by varchar(64) default '' comment '更新者',
|
||||||
|
update_time datetime comment '更新时间',
|
||||||
|
remark varchar(500) default null comment '备注',
|
||||||
|
primary key (user_id)
|
||||||
|
) engine=innodb auto_increment=100 comment = '用户信息表';
|
||||||
|
|
||||||
|
-- ----------------------------
|
||||||
|
-- 初始化-用户信息表数据
|
||||||
|
-- ----------------------------
|
||||||
|
insert into sys_user values(1, 103, 'admin', '若依', '00', 'ry@163.com', '15888888888', '1', '', '29c67a30398638269fe600f73a054934', '111111', '0', '0', '127.0.0.1', '2018-03-16 11-33-00', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '管理员');
|
||||||
|
insert into sys_user values(2, 105, 'ry', '若依', '00', 'ry@qq.com', '15666666666', '1', '', '8e6d98b90472783cc73c17047ddccf36', '222222', '0', '0', '127.0.0.1', '2018-03-16 11-33-00', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '测试员');
|
||||||
|
|
||||||
|
|
||||||
|
-- ----------------------------
|
||||||
|
-- 3、岗位信息表
|
||||||
|
-- ----------------------------
|
||||||
|
drop table if exists sys_post;
|
||||||
|
create table sys_post
|
||||||
|
(
|
||||||
|
post_id bigint(20) not null auto_increment comment '岗位ID',
|
||||||
|
post_code varchar(64) not null comment '岗位编码',
|
||||||
|
post_name varchar(50) not null comment '岗位名称',
|
||||||
|
post_sort int(4) not null comment '显示顺序',
|
||||||
|
status char(1) not null comment '状态(0正常 1停用)',
|
||||||
|
create_by varchar(64) default '' comment '创建者',
|
||||||
|
create_time datetime comment '创建时间',
|
||||||
|
update_by varchar(64) default '' comment '更新者',
|
||||||
|
update_time datetime comment '更新时间',
|
||||||
|
remark varchar(500) default null comment '备注',
|
||||||
|
primary key (post_id)
|
||||||
|
) engine=innodb comment = '岗位信息表';
|
||||||
|
|
||||||
|
-- ----------------------------
|
||||||
|
-- 初始化-岗位信息表数据
|
||||||
|
-- ----------------------------
|
||||||
|
insert into sys_post values(1, 'ceo', '董事长', 1, '0', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '');
|
||||||
|
insert into sys_post values(2, 'se', '项目经理', 2, '0', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '');
|
||||||
|
insert into sys_post values(3, 'hr', '人力资源', 3, '0', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '');
|
||||||
|
insert into sys_post values(4, 'user', '普通员工', 4, '0', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '');
|
||||||
|
|
||||||
|
|
||||||
|
-- ----------------------------
|
||||||
|
-- 4、角色信息表
|
||||||
|
-- ----------------------------
|
||||||
|
drop table if exists sys_role;
|
||||||
|
create table sys_role (
|
||||||
|
role_id bigint(20) not null auto_increment comment '角色ID',
|
||||||
|
role_name varchar(30) not null comment '角色名称',
|
||||||
|
role_key varchar(100) not null comment '角色权限字符串',
|
||||||
|
role_sort int(4) not null comment '显示顺序',
|
||||||
|
data_scope char(1) default '1' comment '数据范围(1:全部数据权限 2:自定数据权限 3:本部门数据权限 4:本部门及以下数据权限)',
|
||||||
|
status char(1) not null comment '角色状态(0正常 1停用)',
|
||||||
|
del_flag char(1) default '0' comment '删除标志(0代表存在 2代表删除)',
|
||||||
|
create_by varchar(64) default '' comment '创建者',
|
||||||
|
create_time datetime comment '创建时间',
|
||||||
|
update_by varchar(64) default '' comment '更新者',
|
||||||
|
update_time datetime comment '更新时间',
|
||||||
|
remark varchar(500) default null comment '备注',
|
||||||
|
primary key (role_id)
|
||||||
|
) engine=innodb auto_increment=100 comment = '角色信息表';
|
||||||
|
|
||||||
|
-- ----------------------------
|
||||||
|
-- 初始化-角色信息表数据
|
||||||
|
-- ----------------------------
|
||||||
|
insert into sys_role values('1', '超级管理员', 'admin', 1, 1, '0', '0', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '超级管理员');
|
||||||
|
insert into sys_role values('2', '普通角色', 'common', 2, 2, '0', '0', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '普通角色');
|
||||||
|
|
||||||
|
|
||||||
|
-- ----------------------------
|
||||||
|
-- 5、菜单权限表
|
||||||
|
-- ----------------------------
|
||||||
|
drop table if exists sys_menu;
|
||||||
|
create table sys_menu (
|
||||||
|
menu_id bigint(20) not null auto_increment comment '菜单ID',
|
||||||
|
menu_name varchar(50) not null comment '菜单名称',
|
||||||
|
parent_id bigint(20) default 0 comment '父菜单ID',
|
||||||
|
order_num int(4) default 0 comment '显示顺序',
|
||||||
|
url varchar(200) default '#' comment '请求地址',
|
||||||
|
target varchar(20) default '' comment '打开方式(menuItem页签 menuBlank新窗口)',
|
||||||
|
menu_type char(1) default '' comment '菜单类型(M目录 C菜单 F按钮)',
|
||||||
|
visible char(1) default 0 comment '菜单状态(0显示 1隐藏)',
|
||||||
|
perms varchar(100) default null comment '权限标识',
|
||||||
|
icon varchar(100) default '#' comment '菜单图标',
|
||||||
|
create_by varchar(64) default '' comment '创建者',
|
||||||
|
create_time datetime comment '创建时间',
|
||||||
|
update_by varchar(64) default '' comment '更新者',
|
||||||
|
update_time datetime comment '更新时间',
|
||||||
|
remark varchar(500) default '' comment '备注',
|
||||||
|
primary key (menu_id)
|
||||||
|
) engine=innodb auto_increment=2000 comment = '菜单权限表';
|
||||||
|
|
||||||
|
-- ----------------------------
|
||||||
|
-- 初始化-菜单信息表数据
|
||||||
|
-- ----------------------------
|
||||||
|
-- 一级菜单
|
||||||
|
insert into sys_menu values('1', '系统管理', '0', '1', '#', '', 'M', '0', '', 'fa fa-gear', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '系统管理目录');
|
||||||
|
insert into sys_menu values('2', '系统监控', '0', '2', '#', '', 'M', '0', '', 'fa fa-video-camera', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '系统监控目录');
|
||||||
|
insert into sys_menu values('3', '系统工具', '0', '3', '#', '', 'M', '0', '', 'fa fa-bars', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '系统工具目录');
|
||||||
|
insert into sys_menu values('4', '若依官网', '0', '4', 'http://ruoyi.vip', 'menuBlank', 'C', '0', '', 'fa fa-location-arrow', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '若依官网地址');
|
||||||
|
-- 二级菜单
|
||||||
|
insert into sys_menu values('100', '用户管理', '1', '1', '/system/user', '', 'C', '0', 'system:user:view', 'fa fa-user-o', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '用户管理菜单');
|
||||||
|
insert into sys_menu values('101', '角色管理', '1', '2', '/system/role', '', 'C', '0', 'system:role:view', 'fa fa-user-secret', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '角色管理菜单');
|
||||||
|
insert into sys_menu values('102', '菜单管理', '1', '3', '/system/menu', '', 'C', '0', 'system:menu:view', 'fa fa-th-list', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '菜单管理菜单');
|
||||||
|
insert into sys_menu values('103', '部门管理', '1', '4', '/system/dept', '', 'C', '0', 'system:dept:view', 'fa fa-outdent', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '部门管理菜单');
|
||||||
|
insert into sys_menu values('104', '岗位管理', '1', '5', '/system/post', '', 'C', '0', 'system:post:view', 'fa fa-address-card-o', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '岗位管理菜单');
|
||||||
|
insert into sys_menu values('105', '字典管理', '1', '6', '/system/dict', '', 'C', '0', 'system:dict:view', 'fa fa-bookmark-o', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '字典管理菜单');
|
||||||
|
insert into sys_menu values('106', '参数设置', '1', '7', '/system/config', '', 'C', '0', 'system:config:view', 'fa fa-sun-o', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '参数设置菜单');
|
||||||
|
insert into sys_menu values('107', '通知公告', '1', '8', '/system/notice', '', 'C', '0', 'system:notice:view', 'fa fa-bullhorn', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '通知公告菜单');
|
||||||
|
insert into sys_menu values('108', '日志管理', '1', '9', '#', '', 'M', '0', '', 'fa fa-pencil-square-o', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '日志管理菜单');
|
||||||
|
insert into sys_menu values('109', '在线用户', '2', '1', '/monitor/online', '', 'C', '0', 'monitor:online:view', 'fa fa-user-circle', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '在线用户菜单');
|
||||||
|
insert into sys_menu values('110', '定时任务', '2', '2', '/monitor/job', '', 'C', '0', 'monitor:job:view', 'fa fa-tasks', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '定时任务菜单');
|
||||||
|
insert into sys_menu values('111', '数据监控', '2', '3', '/monitor/data', '', 'C', '0', 'monitor:data:view', 'fa fa-bug', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '数据监控菜单');
|
||||||
|
insert into sys_menu values('112', '服务监控', '2', '3', '/monitor/server', '', 'C', '0', 'monitor:server:view', 'fa fa-server', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '服务监控菜单');
|
||||||
|
insert into sys_menu values('113', '表单构建', '3', '1', '/tool/build', '', 'C', '0', 'tool:build:view', 'fa fa-wpforms', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '表单构建菜单');
|
||||||
|
insert into sys_menu values('114', '代码生成', '3', '2', '/tool/gen', '', 'C', '0', 'tool:gen:view', 'fa fa-code', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '代码生成菜单');
|
||||||
|
insert into sys_menu values('115', '系统接口', '3', '3', '/tool/swagger', '', 'C', '0', 'tool:swagger:view', 'fa fa-gg', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '系统接口菜单');
|
||||||
|
-- 三级菜单
|
||||||
|
insert into sys_menu values('500', '操作日志', '108', '1', '/monitor/operlog', '', 'C', '0', 'monitor:operlog:view', 'fa fa-address-book', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '操作日志菜单');
|
||||||
|
insert into sys_menu values('501', '登录日志', '108', '2', '/monitor/logininfor', '', 'C', '0', 'monitor:logininfor:view', 'fa fa-file-image-o', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '登录日志菜单');
|
||||||
|
-- 用户管理按钮
|
||||||
|
insert into sys_menu values('1000', '用户查询', '100', '1', '#', '', 'F', '0', 'system:user:list', '#', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '');
|
||||||
|
insert into sys_menu values('1001', '用户新增', '100', '2', '#', '', 'F', '0', 'system:user:add', '#', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '');
|
||||||
|
insert into sys_menu values('1002', '用户修改', '100', '3', '#', '', 'F', '0', 'system:user:edit', '#', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '');
|
||||||
|
insert into sys_menu values('1003', '用户删除', '100', '4', '#', '', 'F', '0', 'system:user:remove', '#', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '');
|
||||||
|
insert into sys_menu values('1004', '用户导出', '100', '5', '#', '', 'F', '0', 'system:user:export', '#', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '');
|
||||||
|
insert into sys_menu values('1005', '用户导入', '100', '6', '#', '', 'F', '0', 'system:user:import', '#', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '');
|
||||||
|
insert into sys_menu values('1006', '重置密码', '100', '7', '#', '', 'F', '0', 'system:user:resetPwd', '#', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '');
|
||||||
|
-- 角色管理按钮
|
||||||
|
insert into sys_menu values('1007', '角色查询', '101', '1', '#', '', 'F', '0', 'system:role:list', '#', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '');
|
||||||
|
insert into sys_menu values('1008', '角色新增', '101', '2', '#', '', 'F', '0', 'system:role:add', '#', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '');
|
||||||
|
insert into sys_menu values('1009', '角色修改', '101', '3', '#', '', 'F', '0', 'system:role:edit', '#', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '');
|
||||||
|
insert into sys_menu values('1010', '角色删除', '101', '4', '#', '', 'F', '0', 'system:role:remove', '#', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '');
|
||||||
|
insert into sys_menu values('1011', '角色导出', '101', '5', '#', '', 'F', '0', 'system:role:export', '#', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '');
|
||||||
|
-- 菜单管理按钮
|
||||||
|
insert into sys_menu values('1012', '菜单查询', '102', '1', '#', '', 'F', '0', 'system:menu:list', '#', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '');
|
||||||
|
insert into sys_menu values('1013', '菜单新增', '102', '2', '#', '', 'F', '0', 'system:menu:add', '#', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '');
|
||||||
|
insert into sys_menu values('1014', '菜单修改', '102', '3', '#', '', 'F', '0', 'system:menu:edit', '#', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '');
|
||||||
|
insert into sys_menu values('1015', '菜单删除', '102', '4', '#', '', 'F', '0', 'system:menu:remove', '#', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '');
|
||||||
|
-- 部门管理按钮
|
||||||
|
insert into sys_menu values('1016', '部门查询', '103', '1', '#', '', 'F', '0', 'system:dept:list', '#', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '');
|
||||||
|
insert into sys_menu values('1017', '部门新增', '103', '2', '#', '', 'F', '0', 'system:dept:add', '#', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '');
|
||||||
|
insert into sys_menu values('1018', '部门修改', '103', '3', '#', '', 'F', '0', 'system:dept:edit', '#', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '');
|
||||||
|
insert into sys_menu values('1019', '部门删除', '103', '4', '#', '', 'F', '0', 'system:dept:remove', '#', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '');
|
||||||
|
-- 岗位管理按钮
|
||||||
|
insert into sys_menu values('1020', '岗位查询', '104', '1', '#', '', 'F', '0', 'system:post:list', '#', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '');
|
||||||
|
insert into sys_menu values('1021', '岗位新增', '104', '2', '#', '', 'F', '0', 'system:post:add', '#', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '');
|
||||||
|
insert into sys_menu values('1022', '岗位修改', '104', '3', '#', '', 'F', '0', 'system:post:edit', '#', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '');
|
||||||
|
insert into sys_menu values('1023', '岗位删除', '104', '4', '#', '', 'F', '0', 'system:post:remove', '#', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '');
|
||||||
|
insert into sys_menu values('1024', '岗位导出', '104', '5', '#', '', 'F', '0', 'system:post:export', '#', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '');
|
||||||
|
-- 字典管理按钮
|
||||||
|
insert into sys_menu values('1025', '字典查询', '105', '1', '#', '', 'F', '0', 'system:dict:list', '#', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '');
|
||||||
|
insert into sys_menu values('1026', '字典新增', '105', '2', '#', '', 'F', '0', 'system:dict:add', '#', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '');
|
||||||
|
insert into sys_menu values('1027', '字典修改', '105', '3', '#', '', 'F', '0', 'system:dict:edit', '#', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '');
|
||||||
|
insert into sys_menu values('1028', '字典删除', '105', '4', '#', '', 'F', '0', 'system:dict:remove', '#', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '');
|
||||||
|
insert into sys_menu values('1029', '字典导出', '105', '5', '#', '', 'F', '0', 'system:dict:export', '#', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '');
|
||||||
|
-- 参数设置按钮
|
||||||
|
insert into sys_menu values('1030', '参数查询', '106', '1', '#', '', 'F', '0', 'system:config:list', '#', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '');
|
||||||
|
insert into sys_menu values('1031', '参数新增', '106', '2', '#', '', 'F', '0', 'system:config:add', '#', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '');
|
||||||
|
insert into sys_menu values('1032', '参数修改', '106', '3', '#', '', 'F', '0', 'system:config:edit', '#', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '');
|
||||||
|
insert into sys_menu values('1033', '参数删除', '106', '4', '#', '', 'F', '0', 'system:config:remove', '#', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '');
|
||||||
|
insert into sys_menu values('1034', '参数导出', '106', '5', '#', '', 'F', '0', 'system:config:export', '#', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '');
|
||||||
|
-- 通知公告按钮
|
||||||
|
insert into sys_menu values('1035', '公告查询', '107', '1', '#', '', 'F', '0', 'system:notice:list', '#', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '');
|
||||||
|
insert into sys_menu values('1036', '公告新增', '107', '2', '#', '', 'F', '0', 'system:notice:add', '#', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '');
|
||||||
|
insert into sys_menu values('1037', '公告修改', '107', '3', '#', '', 'F', '0', 'system:notice:edit', '#', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '');
|
||||||
|
insert into sys_menu values('1038', '公告删除', '107', '4', '#', '', 'F', '0', 'system:notice:remove', '#', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '');
|
||||||
|
-- 操作日志按钮
|
||||||
|
insert into sys_menu values('1039', '操作查询', '500', '1', '#', '', 'F', '0', 'monitor:operlog:list', '#', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '');
|
||||||
|
insert into sys_menu values('1040', '操作删除', '500', '2', '#', '', 'F', '0', 'monitor:operlog:remove', '#', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '');
|
||||||
|
insert into sys_menu values('1041', '详细信息', '500', '3', '#', '', 'F', '0', 'monitor:operlog:detail', '#', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '');
|
||||||
|
insert into sys_menu values('1042', '日志导出', '500', '4', '#', '', 'F', '0', 'monitor:operlog:export', '#', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '');
|
||||||
|
-- 登录日志按钮
|
||||||
|
insert into sys_menu values('1043', '登录查询', '501', '1', '#', '', 'F', '0', 'monitor:logininfor:list', '#', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '');
|
||||||
|
insert into sys_menu values('1044', '登录删除', '501', '2', '#', '', 'F', '0', 'monitor:logininfor:remove', '#', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '');
|
||||||
|
insert into sys_menu values('1045', '日志导出', '501', '3', '#', '', 'F', '0', 'monitor:logininfor:export', '#', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '');
|
||||||
|
insert into sys_menu values('1046', '账户解锁', '501', '4', '#', '', 'F', '0', 'monitor:logininfor:unlock', '#', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '');
|
||||||
|
-- 在线用户按钮
|
||||||
|
insert into sys_menu values('1047', '在线查询', '109', '1', '#', '', 'F', '0', 'monitor:online:list', '#', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '');
|
||||||
|
insert into sys_menu values('1048', '批量强退', '109', '2', '#', '', 'F', '0', 'monitor:online:batchForceLogout', '#', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '');
|
||||||
|
insert into sys_menu values('1049', '单条强退', '109', '3', '#', '', 'F', '0', 'monitor:online:forceLogout', '#', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '');
|
||||||
|
-- 定时任务按钮
|
||||||
|
insert into sys_menu values('1050', '任务查询', '110', '1', '#', '', 'F', '0', 'monitor:job:list', '#', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '');
|
||||||
|
insert into sys_menu values('1051', '任务新增', '110', '2', '#', '', 'F', '0', 'monitor:job:add', '#', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '');
|
||||||
|
insert into sys_menu values('1052', '任务修改', '110', '3', '#', '', 'F', '0', 'monitor:job:edit', '#', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '');
|
||||||
|
insert into sys_menu values('1053', '任务删除', '110', '4', '#', '', 'F', '0', 'monitor:job:remove', '#', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '');
|
||||||
|
insert into sys_menu values('1054', '状态修改', '110', '5', '#', '', 'F', '0', 'monitor:job:changeStatus', '#', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '');
|
||||||
|
insert into sys_menu values('1055', '任务详细', '110', '6', '#', '', 'F', '0', 'monitor:job:detail', '#', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '');
|
||||||
|
insert into sys_menu values('1056', '任务导出', '110', '7', '#', '', 'F', '0', 'monitor:job:export', '#', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '');
|
||||||
|
-- 代码生成按钮
|
||||||
|
insert into sys_menu values('1057', '生成查询', '114', '1', '#', '', 'F', '0', 'tool:gen:list', '#', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '');
|
||||||
|
insert into sys_menu values('1058', '生成修改', '114', '2', '#', '', 'F', '0', 'tool:gen:edit', '#', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '');
|
||||||
|
insert into sys_menu values('1059', '生成删除', '114', '3', '#', '', 'F', '0', 'tool:gen:remove', '#', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '');
|
||||||
|
insert into sys_menu values('1060', '预览代码', '114', '4', '#', '', 'F', '0', 'tool:gen:preview', '#', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '');
|
||||||
|
insert into sys_menu values('1061', '生成代码', '114', '5', '#', '', 'F', '0', 'tool:gen:code', '#', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '');
|
||||||
|
|
||||||
|
|
||||||
|
-- ----------------------------
|
||||||
|
-- 6、用户和角色关联表 用户N-1角色
|
||||||
|
-- ----------------------------
|
||||||
|
drop table if exists sys_user_role;
|
||||||
|
create table sys_user_role (
|
||||||
|
user_id bigint(20) not null comment '用户ID',
|
||||||
|
role_id bigint(20) not null comment '角色ID',
|
||||||
|
primary key(user_id, role_id)
|
||||||
|
) engine=innodb comment = '用户和角色关联表';
|
||||||
|
|
||||||
|
-- ----------------------------
|
||||||
|
-- 初始化-用户和角色关联表数据
|
||||||
|
-- ----------------------------
|
||||||
|
insert into sys_user_role values ('1', '1');
|
||||||
|
insert into sys_user_role values ('2', '2');
|
||||||
|
|
||||||
|
|
||||||
|
-- ----------------------------
|
||||||
|
-- 7、角色和菜单关联表 角色1-N菜单
|
||||||
|
-- ----------------------------
|
||||||
|
drop table if exists sys_role_menu;
|
||||||
|
create table sys_role_menu (
|
||||||
|
role_id bigint(20) not null comment '角色ID',
|
||||||
|
menu_id bigint(20) not null comment '菜单ID',
|
||||||
|
primary key(role_id, menu_id)
|
||||||
|
) engine=innodb comment = '角色和菜单关联表';
|
||||||
|
|
||||||
|
-- ----------------------------
|
||||||
|
-- 初始化-角色和菜单关联表数据
|
||||||
|
-- ----------------------------
|
||||||
|
insert into sys_role_menu values ('2', '1');
|
||||||
|
insert into sys_role_menu values ('2', '2');
|
||||||
|
insert into sys_role_menu values ('2', '3');
|
||||||
|
insert into sys_role_menu values ('2', '4');
|
||||||
|
insert into sys_role_menu values ('2', '100');
|
||||||
|
insert into sys_role_menu values ('2', '101');
|
||||||
|
insert into sys_role_menu values ('2', '102');
|
||||||
|
insert into sys_role_menu values ('2', '103');
|
||||||
|
insert into sys_role_menu values ('2', '104');
|
||||||
|
insert into sys_role_menu values ('2', '105');
|
||||||
|
insert into sys_role_menu values ('2', '106');
|
||||||
|
insert into sys_role_menu values ('2', '107');
|
||||||
|
insert into sys_role_menu values ('2', '108');
|
||||||
|
insert into sys_role_menu values ('2', '109');
|
||||||
|
insert into sys_role_menu values ('2', '110');
|
||||||
|
insert into sys_role_menu values ('2', '111');
|
||||||
|
insert into sys_role_menu values ('2', '112');
|
||||||
|
insert into sys_role_menu values ('2', '113');
|
||||||
|
insert into sys_role_menu values ('2', '114');
|
||||||
|
insert into sys_role_menu values ('2', '115');
|
||||||
|
insert into sys_role_menu values ('2', '500');
|
||||||
|
insert into sys_role_menu values ('2', '501');
|
||||||
|
insert into sys_role_menu values ('2', '1000');
|
||||||
|
insert into sys_role_menu values ('2', '1001');
|
||||||
|
insert into sys_role_menu values ('2', '1002');
|
||||||
|
insert into sys_role_menu values ('2', '1003');
|
||||||
|
insert into sys_role_menu values ('2', '1004');
|
||||||
|
insert into sys_role_menu values ('2', '1005');
|
||||||
|
insert into sys_role_menu values ('2', '1006');
|
||||||
|
insert into sys_role_menu values ('2', '1007');
|
||||||
|
insert into sys_role_menu values ('2', '1008');
|
||||||
|
insert into sys_role_menu values ('2', '1009');
|
||||||
|
insert into sys_role_menu values ('2', '1010');
|
||||||
|
insert into sys_role_menu values ('2', '1011');
|
||||||
|
insert into sys_role_menu values ('2', '1012');
|
||||||
|
insert into sys_role_menu values ('2', '1013');
|
||||||
|
insert into sys_role_menu values ('2', '1014');
|
||||||
|
insert into sys_role_menu values ('2', '1015');
|
||||||
|
insert into sys_role_menu values ('2', '1016');
|
||||||
|
insert into sys_role_menu values ('2', '1017');
|
||||||
|
insert into sys_role_menu values ('2', '1018');
|
||||||
|
insert into sys_role_menu values ('2', '1019');
|
||||||
|
insert into sys_role_menu values ('2', '1020');
|
||||||
|
insert into sys_role_menu values ('2', '1021');
|
||||||
|
insert into sys_role_menu values ('2', '1022');
|
||||||
|
insert into sys_role_menu values ('2', '1023');
|
||||||
|
insert into sys_role_menu values ('2', '1024');
|
||||||
|
insert into sys_role_menu values ('2', '1025');
|
||||||
|
insert into sys_role_menu values ('2', '1026');
|
||||||
|
insert into sys_role_menu values ('2', '1027');
|
||||||
|
insert into sys_role_menu values ('2', '1028');
|
||||||
|
insert into sys_role_menu values ('2', '1029');
|
||||||
|
insert into sys_role_menu values ('2', '1030');
|
||||||
|
insert into sys_role_menu values ('2', '1031');
|
||||||
|
insert into sys_role_menu values ('2', '1032');
|
||||||
|
insert into sys_role_menu values ('2', '1033');
|
||||||
|
insert into sys_role_menu values ('2', '1034');
|
||||||
|
insert into sys_role_menu values ('2', '1035');
|
||||||
|
insert into sys_role_menu values ('2', '1036');
|
||||||
|
insert into sys_role_menu values ('2', '1037');
|
||||||
|
insert into sys_role_menu values ('2', '1038');
|
||||||
|
insert into sys_role_menu values ('2', '1039');
|
||||||
|
insert into sys_role_menu values ('2', '1040');
|
||||||
|
insert into sys_role_menu values ('2', '1041');
|
||||||
|
insert into sys_role_menu values ('2', '1042');
|
||||||
|
insert into sys_role_menu values ('2', '1043');
|
||||||
|
insert into sys_role_menu values ('2', '1044');
|
||||||
|
insert into sys_role_menu values ('2', '1045');
|
||||||
|
insert into sys_role_menu values ('2', '1046');
|
||||||
|
insert into sys_role_menu values ('2', '1047');
|
||||||
|
insert into sys_role_menu values ('2', '1048');
|
||||||
|
insert into sys_role_menu values ('2', '1049');
|
||||||
|
insert into sys_role_menu values ('2', '1050');
|
||||||
|
insert into sys_role_menu values ('2', '1051');
|
||||||
|
insert into sys_role_menu values ('2', '1052');
|
||||||
|
insert into sys_role_menu values ('2', '1053');
|
||||||
|
insert into sys_role_menu values ('2', '1054');
|
||||||
|
insert into sys_role_menu values ('2', '1055');
|
||||||
|
insert into sys_role_menu values ('2', '1056');
|
||||||
|
insert into sys_role_menu values ('2', '1057');
|
||||||
|
insert into sys_role_menu values ('2', '1058');
|
||||||
|
insert into sys_role_menu values ('2', '1059');
|
||||||
|
insert into sys_role_menu values ('2', '1060');
|
||||||
|
insert into sys_role_menu values ('2', '1061');
|
||||||
|
|
||||||
|
-- ----------------------------
|
||||||
|
-- 8、角色和部门关联表 角色1-N部门
|
||||||
|
-- ----------------------------
|
||||||
|
drop table if exists sys_role_dept;
|
||||||
|
create table sys_role_dept (
|
||||||
|
role_id bigint(20) not null comment '角色ID',
|
||||||
|
dept_id bigint(20) not null comment '部门ID',
|
||||||
|
primary key(role_id, dept_id)
|
||||||
|
) engine=innodb comment = '角色和部门关联表';
|
||||||
|
|
||||||
|
-- ----------------------------
|
||||||
|
-- 初始化-角色和部门关联表数据
|
||||||
|
-- ----------------------------
|
||||||
|
insert into sys_role_dept values ('2', '100');
|
||||||
|
insert into sys_role_dept values ('2', '101');
|
||||||
|
insert into sys_role_dept values ('2', '105');
|
||||||
|
|
||||||
|
-- ----------------------------
|
||||||
|
-- 9、用户与岗位关联表 用户1-N岗位
|
||||||
|
-- ----------------------------
|
||||||
|
drop table if exists sys_user_post;
|
||||||
|
create table sys_user_post
|
||||||
|
(
|
||||||
|
user_id bigint(20) not null comment '用户ID',
|
||||||
|
post_id bigint(20) not null comment '岗位ID',
|
||||||
|
primary key (user_id, post_id)
|
||||||
|
) engine=innodb comment = '用户与岗位关联表';
|
||||||
|
|
||||||
|
-- ----------------------------
|
||||||
|
-- 初始化-用户与岗位关联表数据
|
||||||
|
-- ----------------------------
|
||||||
|
insert into sys_user_post values ('1', '1');
|
||||||
|
insert into sys_user_post values ('2', '2');
|
||||||
|
|
||||||
|
|
||||||
|
-- ----------------------------
|
||||||
|
-- 10、操作日志记录
|
||||||
|
-- ----------------------------
|
||||||
|
drop table if exists sys_oper_log;
|
||||||
|
create table sys_oper_log (
|
||||||
|
oper_id bigint(20) not null auto_increment comment '日志主键',
|
||||||
|
title varchar(50) default '' comment '模块标题',
|
||||||
|
business_type int(2) default 0 comment '业务类型(0其它 1新增 2修改 3删除)',
|
||||||
|
method varchar(100) default '' comment '方法名称',
|
||||||
|
request_method varchar(10) default '' comment '请求方式',
|
||||||
|
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(50) default '' comment '主机地址',
|
||||||
|
oper_location varchar(255) default '' comment '操作地点',
|
||||||
|
oper_param varchar(2000) default '' comment '请求参数',
|
||||||
|
json_result varchar(2000) default '' comment '返回参数',
|
||||||
|
status int(1) default 0 comment '操作状态(0正常 1异常)',
|
||||||
|
error_msg varchar(2000) default '' comment '错误消息',
|
||||||
|
oper_time datetime comment '操作时间',
|
||||||
|
primary key (oper_id)
|
||||||
|
) engine=innodb auto_increment=100 comment = '操作日志记录';
|
||||||
|
|
||||||
|
|
||||||
|
-- ----------------------------
|
||||||
|
-- 11、字典类型表
|
||||||
|
-- ----------------------------
|
||||||
|
drop table if exists sys_dict_type;
|
||||||
|
create table sys_dict_type
|
||||||
|
(
|
||||||
|
dict_id bigint(20) not null auto_increment comment '字典主键',
|
||||||
|
dict_name varchar(100) default '' comment '字典名称',
|
||||||
|
dict_type varchar(100) default '' comment '字典类型',
|
||||||
|
status char(1) default '0' comment '状态(0正常 1停用)',
|
||||||
|
create_by varchar(64) default '' comment '创建者',
|
||||||
|
create_time datetime comment '创建时间',
|
||||||
|
update_by varchar(64) default '' comment '更新者',
|
||||||
|
update_time datetime comment '更新时间',
|
||||||
|
remark varchar(500) default null comment '备注',
|
||||||
|
primary key (dict_id),
|
||||||
|
unique (dict_type)
|
||||||
|
) engine=innodb auto_increment=100 comment = '字典类型表';
|
||||||
|
|
||||||
|
insert into sys_dict_type values(1, '用户性别', 'sys_user_sex', '0', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '用户性别列表');
|
||||||
|
insert into sys_dict_type values(2, '菜单状态', 'sys_show_hide', '0', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '菜单状态列表');
|
||||||
|
insert into sys_dict_type values(3, '系统开关', 'sys_normal_disable', '0', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '系统开关列表');
|
||||||
|
insert into sys_dict_type values(4, '任务状态', 'sys_job_status', '0', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '任务状态列表');
|
||||||
|
insert into sys_dict_type values(5, '任务分组', 'sys_job_group', '0', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '任务分组列表');
|
||||||
|
insert into sys_dict_type values(6, '系统是否', 'sys_yes_no', '0', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '系统是否列表');
|
||||||
|
insert into sys_dict_type values(7, '通知类型', 'sys_notice_type', '0', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '通知类型列表');
|
||||||
|
insert into sys_dict_type values(8, '通知状态', 'sys_notice_status', '0', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '通知状态列表');
|
||||||
|
insert into sys_dict_type values(9, '操作类型', 'sys_oper_type', '0', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '操作类型列表');
|
||||||
|
insert into sys_dict_type values(10, '系统状态', 'sys_common_status', '0', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '登录状态列表');
|
||||||
|
|
||||||
|
|
||||||
|
-- ----------------------------
|
||||||
|
-- 12、字典数据表
|
||||||
|
-- ----------------------------
|
||||||
|
drop table if exists sys_dict_data;
|
||||||
|
create table sys_dict_data
|
||||||
|
(
|
||||||
|
dict_code bigint(20) not null auto_increment comment '字典编码',
|
||||||
|
dict_sort int(4) default 0 comment '字典排序',
|
||||||
|
dict_label varchar(100) default '' comment '字典标签',
|
||||||
|
dict_value varchar(100) default '' comment '字典键值',
|
||||||
|
dict_type varchar(100) default '' comment '字典类型',
|
||||||
|
css_class varchar(100) default null comment '样式属性(其他样式扩展)',
|
||||||
|
list_class varchar(100) default null comment '表格回显样式',
|
||||||
|
is_default char(1) default 'N' comment '是否默认(Y是 N否)',
|
||||||
|
status char(1) default '0' comment '状态(0正常 1停用)',
|
||||||
|
create_by varchar(64) default '' comment '创建者',
|
||||||
|
create_time datetime comment '创建时间',
|
||||||
|
update_by varchar(64) default '' comment '更新者',
|
||||||
|
update_time datetime comment '更新时间',
|
||||||
|
remark varchar(500) default null comment '备注',
|
||||||
|
primary key (dict_code)
|
||||||
|
) engine=innodb auto_increment=100 comment = '字典数据表';
|
||||||
|
|
||||||
|
insert into sys_dict_data values(1, 1, '男', '0', 'sys_user_sex', '', '', 'Y', '0', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '性别男');
|
||||||
|
insert into sys_dict_data values(2, 2, '女', '1', 'sys_user_sex', '', '', 'N', '0', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '性别女');
|
||||||
|
insert into sys_dict_data values(3, 3, '未知', '2', 'sys_user_sex', '', '', 'N', '0', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '性别未知');
|
||||||
|
insert into sys_dict_data values(4, 1, '显示', '0', 'sys_show_hide', '', 'primary', 'Y', '0', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '显示菜单');
|
||||||
|
insert into sys_dict_data values(5, 2, '隐藏', '1', 'sys_show_hide', '', 'danger', 'N', '0', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '隐藏菜单');
|
||||||
|
insert into sys_dict_data values(6, 1, '正常', '0', 'sys_normal_disable', '', 'primary', 'Y', '0', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '正常状态');
|
||||||
|
insert into sys_dict_data values(7, 2, '停用', '1', 'sys_normal_disable', '', 'danger', 'N', '0', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '停用状态');
|
||||||
|
insert into sys_dict_data values(8, 1, '正常', '0', 'sys_job_status', '', 'primary', 'Y', '0', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '正常状态');
|
||||||
|
insert into sys_dict_data values(9, 2, '暂停', '1', 'sys_job_status', '', 'danger', 'N', '0', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '停用状态');
|
||||||
|
insert into sys_dict_data values(10, 1, '默认', 'DEFAULT', 'sys_job_group', '', '', 'Y', '0', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '默认分组');
|
||||||
|
insert into sys_dict_data values(11, 2, '系统', 'SYSTEM', 'sys_job_group', '', '', 'N', '0', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '系统分组');
|
||||||
|
insert into sys_dict_data values(12, 1, '是', 'Y', 'sys_yes_no', '', 'primary', 'Y', '0', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '系统默认是');
|
||||||
|
insert into sys_dict_data values(13, 2, '否', 'N', 'sys_yes_no', '', 'danger', 'N', '0', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '系统默认否');
|
||||||
|
insert into sys_dict_data values(14, 1, '通知', '1', 'sys_notice_type', '', 'warning', 'Y', '0', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '通知');
|
||||||
|
insert into sys_dict_data values(15, 2, '公告', '2', 'sys_notice_type', '', 'success', 'N', '0', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '公告');
|
||||||
|
insert into sys_dict_data values(16, 1, '正常', '0', 'sys_notice_status', '', 'primary', 'Y', '0', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '正常状态');
|
||||||
|
insert into sys_dict_data values(17, 2, '关闭', '1', 'sys_notice_status', '', 'danger', 'N', '0', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '关闭状态');
|
||||||
|
insert into sys_dict_data values(18, 99, '其他', '0', 'sys_oper_type', '', 'info', 'N', '0', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '其他操作');
|
||||||
|
insert into sys_dict_data values(19, 1, '新增', '1', 'sys_oper_type', '', 'info', 'N', '0', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '新增操作');
|
||||||
|
insert into sys_dict_data values(20, 2, '修改', '2', 'sys_oper_type', '', 'info', 'N', '0', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '修改操作');
|
||||||
|
insert into sys_dict_data values(21, 3, '删除', '3', 'sys_oper_type', '', 'danger', 'N', '0', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '删除操作');
|
||||||
|
insert into sys_dict_data values(22, 4, '授权', '4', 'sys_oper_type', '', 'primary', 'N', '0', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '授权操作');
|
||||||
|
insert into sys_dict_data values(23, 5, '导出', '5', 'sys_oper_type', '', 'warning', 'N', '0', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '导出操作');
|
||||||
|
insert into sys_dict_data values(24, 6, '导入', '6', 'sys_oper_type', '', 'warning', 'N', '0', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '导入操作');
|
||||||
|
insert into sys_dict_data values(25, 7, '强退', '7', 'sys_oper_type', '', 'danger', 'N', '0', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '强退操作');
|
||||||
|
insert into sys_dict_data values(26, 8, '生成代码', '8', 'sys_oper_type', '', 'warning', 'N', '0', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '生成操作');
|
||||||
|
insert into sys_dict_data values(27, 9, '清空数据', '9', 'sys_oper_type', '', 'danger', 'N', '0', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '清空操作');
|
||||||
|
insert into sys_dict_data values(28, 1, '成功', '0', 'sys_common_status', '', 'primary', 'N', '0', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '正常状态');
|
||||||
|
insert into sys_dict_data values(29, 2, '失败', '1', 'sys_common_status', '', 'danger', 'N', '0', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '停用状态');
|
||||||
|
|
||||||
|
|
||||||
|
-- ----------------------------
|
||||||
|
-- 13、参数配置表
|
||||||
|
-- ----------------------------
|
||||||
|
drop table if exists sys_config;
|
||||||
|
create table sys_config (
|
||||||
|
config_id int(5) not null auto_increment comment '参数主键',
|
||||||
|
config_name varchar(100) default '' comment '参数名称',
|
||||||
|
config_key varchar(100) default '' comment '参数键名',
|
||||||
|
config_value varchar(500) default '' comment '参数键值',
|
||||||
|
config_type char(1) default 'N' comment '系统内置(Y是 N否)',
|
||||||
|
create_by varchar(64) default '' comment '创建者',
|
||||||
|
create_time datetime comment '创建时间',
|
||||||
|
update_by varchar(64) default '' comment '更新者',
|
||||||
|
update_time datetime comment '更新时间',
|
||||||
|
remark varchar(500) default null comment '备注',
|
||||||
|
primary key (config_id)
|
||||||
|
) engine=innodb auto_increment=100 comment = '参数配置表';
|
||||||
|
|
||||||
|
insert into sys_config values(1, '主框架页-默认皮肤样式名称', 'sys.index.skinName', 'skin-blue', 'Y', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '蓝色 skin-blue、绿色 skin-green、紫色 skin-purple、红色 skin-red、黄色 skin-yellow');
|
||||||
|
insert into sys_config values(2, '用户管理-账号初始密码', 'sys.user.initPassword', '123456', 'Y', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '初始化密码 123456');
|
||||||
|
insert into sys_config values(3, '主框架页-侧边栏主题', 'sys.index.sideTheme', 'theme-dark', 'Y', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '深黑主题theme-dark,浅色主题theme-light,深蓝主题theme-blue');
|
||||||
|
insert into sys_config values(4, '账号自助-是否开启用户注册功能', 'sys.account.registerUser', 'false', 'Y', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '是否开启注册用户功能(true开启,false关闭)');
|
||||||
|
insert into sys_config values(5, '用户管理-密码字符范围', 'sys.account.chrtype', '0', 'Y', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '默认任意字符范围,0任意(密码可以输入任意字符),1数字(密码只能为0-9数字),2英文字母(密码只能为a-z和A-Z字母),3字母和数字(密码必须包含字母,数字),4字母数组和特殊字符(密码必须包含字母,数字,特殊字符-_)');
|
||||||
|
insert into sys_config values(6, '主框架页-菜单导航显示风格', 'sys.index.menuStyle', 'default', 'Y', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '菜单导航显示风格(default为左侧导航菜单,topnav为顶部导航菜单)');
|
||||||
|
insert into sys_config values(7, '主框架页-是否开启页脚', 'sys.index.ignoreFooter', 'true', 'Y', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '是否开启底部页脚显示(true显示,false隐藏)');
|
||||||
|
|
||||||
|
|
||||||
|
-- ----------------------------
|
||||||
|
-- 14、系统访问记录
|
||||||
|
-- ----------------------------
|
||||||
|
drop table if exists sys_logininfor;
|
||||||
|
create table sys_logininfor (
|
||||||
|
info_id bigint(20) not null auto_increment comment '访问ID',
|
||||||
|
login_name varchar(50) default '' comment '登录账号',
|
||||||
|
ipaddr varchar(50) default '' comment '登录IP地址',
|
||||||
|
login_location varchar(255) default '' comment '登录地点',
|
||||||
|
browser varchar(50) default '' comment '浏览器类型',
|
||||||
|
os varchar(50) default '' comment '操作系统',
|
||||||
|
status char(1) default '0' comment '登录状态(0成功 1失败)',
|
||||||
|
msg varchar(255) default '' comment '提示消息',
|
||||||
|
login_time datetime comment '访问时间',
|
||||||
|
primary key (info_id)
|
||||||
|
) engine=innodb auto_increment=100 comment = '系统访问记录';
|
||||||
|
|
||||||
|
|
||||||
|
-- ----------------------------
|
||||||
|
-- 15、在线用户记录
|
||||||
|
-- ----------------------------
|
||||||
|
drop table if exists sys_user_online;
|
||||||
|
create table sys_user_online (
|
||||||
|
sessionId varchar(50) default '' comment '用户会话id',
|
||||||
|
login_name varchar(50) default '' comment '登录账号',
|
||||||
|
dept_name varchar(50) default '' comment '部门名称',
|
||||||
|
ipaddr varchar(50) default '' comment '登录IP地址',
|
||||||
|
login_location varchar(255) default '' comment '登录地点',
|
||||||
|
browser varchar(50) default '' comment '浏览器类型',
|
||||||
|
os varchar(50) default '' comment '操作系统',
|
||||||
|
status varchar(10) default '' comment '在线状态on_line在线off_line离线',
|
||||||
|
start_timestamp datetime comment 'session创建时间',
|
||||||
|
last_access_time datetime comment 'session最后访问时间',
|
||||||
|
expire_time int(5) default 0 comment '超时时间,单位为分钟',
|
||||||
|
primary key (sessionId)
|
||||||
|
) engine=innodb comment = '在线用户记录';
|
||||||
|
|
||||||
|
|
||||||
|
-- ----------------------------
|
||||||
|
-- 16、定时任务调度表
|
||||||
|
-- ----------------------------
|
||||||
|
drop table if exists sys_job;
|
||||||
|
create table sys_job (
|
||||||
|
job_id bigint(20) not null auto_increment comment '任务ID',
|
||||||
|
job_name varchar(64) default '' comment '任务名称',
|
||||||
|
job_group varchar(64) default 'DEFAULT' comment '任务组名',
|
||||||
|
invoke_target varchar(500) not null comment '调用目标字符串',
|
||||||
|
cron_expression varchar(255) default '' comment 'cron执行表达式',
|
||||||
|
misfire_policy varchar(20) default '3' comment '计划执行错误策略(1立即执行 2执行一次 3放弃执行)',
|
||||||
|
concurrent char(1) default '1' comment '是否并发执行(0允许 1禁止)',
|
||||||
|
status char(1) default '0' comment '状态(0正常 1暂停)',
|
||||||
|
create_by varchar(64) default '' comment '创建者',
|
||||||
|
create_time datetime comment '创建时间',
|
||||||
|
update_by varchar(64) default '' comment '更新者',
|
||||||
|
update_time datetime comment '更新时间',
|
||||||
|
remark varchar(500) default '' comment '备注信息',
|
||||||
|
primary key (job_id, job_name, job_group)
|
||||||
|
) engine=innodb auto_increment=100 comment = '定时任务调度表';
|
||||||
|
|
||||||
|
insert into sys_job values(1, '系统默认(无参)', 'DEFAULT', 'ryTask.ryNoParams', '0/10 * * * * ?', '3', '1', '1', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '');
|
||||||
|
insert into sys_job values(2, '系统默认(有参)', 'DEFAULT', 'ryTask.ryParams(\'ry\')', '0/15 * * * * ?', '3', '1', '1', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '');
|
||||||
|
insert into sys_job values(3, '系统默认(多参)', 'DEFAULT', 'ryTask.ryMultipleParams(\'ry\', true, 2000L, 316.50D, 100)', '0/20 * * * * ?', '3', '1', '1', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '');
|
||||||
|
|
||||||
|
|
||||||
|
-- ----------------------------
|
||||||
|
-- 17、定时任务调度日志表
|
||||||
|
-- ----------------------------
|
||||||
|
drop table if exists sys_job_log;
|
||||||
|
create table sys_job_log (
|
||||||
|
job_log_id bigint(20) not null auto_increment comment '任务日志ID',
|
||||||
|
job_name varchar(64) not null comment '任务名称',
|
||||||
|
job_group varchar(64) not null comment '任务组名',
|
||||||
|
invoke_target varchar(500) not null comment '调用目标字符串',
|
||||||
|
job_message varchar(500) comment '日志信息',
|
||||||
|
status char(1) default '0' comment '执行状态(0正常 1失败)',
|
||||||
|
exception_info varchar(2000) default '' comment '异常信息',
|
||||||
|
create_time datetime comment '创建时间',
|
||||||
|
primary key (job_log_id)
|
||||||
|
) engine=innodb comment = '定时任务调度日志表';
|
||||||
|
|
||||||
|
|
||||||
|
-- ----------------------------
|
||||||
|
-- 18、通知公告表
|
||||||
|
-- ----------------------------
|
||||||
|
drop table if exists sys_notice;
|
||||||
|
create table sys_notice (
|
||||||
|
notice_id int(4) not null auto_increment comment '公告ID',
|
||||||
|
notice_title varchar(50) not null comment '公告标题',
|
||||||
|
notice_type char(1) not null comment '公告类型(1通知 2公告)',
|
||||||
|
notice_content varchar(2000) default null comment '公告内容',
|
||||||
|
status char(1) default '0' comment '公告状态(0正常 1关闭)',
|
||||||
|
create_by varchar(64) default '' comment '创建者',
|
||||||
|
create_time datetime comment '创建时间',
|
||||||
|
update_by varchar(64) default '' comment '更新者',
|
||||||
|
update_time datetime comment '更新时间',
|
||||||
|
remark varchar(255) default null comment '备注',
|
||||||
|
primary key (notice_id)
|
||||||
|
) engine=innodb auto_increment=10 comment = '通知公告表';
|
||||||
|
|
||||||
|
-- ----------------------------
|
||||||
|
-- 初始化-公告信息表数据
|
||||||
|
-- ----------------------------
|
||||||
|
insert into sys_notice values('1', '温馨提醒:2018-07-01 若依新版本发布啦', '2', '新版本内容', '0', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '管理员');
|
||||||
|
insert into sys_notice values('2', '维护通知:2018-07-01 若依系统凌晨维护', '1', '维护内容', '0', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '管理员');
|
||||||
|
|
||||||
|
|
||||||
|
-- ----------------------------
|
||||||
|
-- 19、代码生成业务表
|
||||||
|
-- ----------------------------
|
||||||
|
drop table if exists gen_table;
|
||||||
|
create table gen_table (
|
||||||
|
table_id bigint(20) not null auto_increment comment '编号',
|
||||||
|
table_name varchar(200) default '' comment '表名称',
|
||||||
|
table_comment varchar(500) default '' comment '表描述',
|
||||||
|
sub_table_name varchar(64) default null comment '关联子表的表名',
|
||||||
|
sub_table_fk_name varchar(64) default null comment '子表关联的外键名',
|
||||||
|
class_name varchar(100) default '' comment '实体类名称',
|
||||||
|
tpl_category varchar(200) default 'crud' comment '使用的模板(crud单表操作 tree树表操作 sub主子表操作)',
|
||||||
|
package_name varchar(100) comment '生成包路径',
|
||||||
|
module_name varchar(30) comment '生成模块名',
|
||||||
|
business_name varchar(30) comment '生成业务名',
|
||||||
|
function_name varchar(50) comment '生成功能名',
|
||||||
|
function_author varchar(50) comment '生成功能作者',
|
||||||
|
gen_type char(1) default '0' comment '生成代码方式(0zip压缩包 1自定义路径)',
|
||||||
|
gen_path varchar(200) default '/' comment '生成路径(不填默认项目路径)',
|
||||||
|
options varchar(1000) comment '其它生成选项',
|
||||||
|
create_by varchar(64) default '' comment '创建者',
|
||||||
|
create_time datetime comment '创建时间',
|
||||||
|
update_by varchar(64) default '' comment '更新者',
|
||||||
|
update_time datetime comment '更新时间',
|
||||||
|
remark varchar(500) default null comment '备注',
|
||||||
|
primary key (table_id)
|
||||||
|
) engine=innodb auto_increment=1 comment = '代码生成业务表';
|
||||||
|
|
||||||
|
|
||||||
|
-- ----------------------------
|
||||||
|
-- 20、代码生成业务表字段
|
||||||
|
-- ----------------------------
|
||||||
|
drop table if exists gen_table_column;
|
||||||
|
create table gen_table_column (
|
||||||
|
column_id bigint(20) not null auto_increment comment '编号',
|
||||||
|
table_id varchar(64) comment '归属表编号',
|
||||||
|
column_name varchar(200) comment '列名称',
|
||||||
|
column_comment varchar(500) comment '列描述',
|
||||||
|
column_type varchar(100) comment '列类型',
|
||||||
|
java_type varchar(500) comment 'JAVA类型',
|
||||||
|
java_field varchar(200) comment 'JAVA字段名',
|
||||||
|
is_pk char(1) comment '是否主键(1是)',
|
||||||
|
is_increment char(1) comment '是否自增(1是)',
|
||||||
|
is_required char(1) comment '是否必填(1是)',
|
||||||
|
is_insert char(1) comment '是否为插入字段(1是)',
|
||||||
|
is_edit char(1) comment '是否编辑字段(1是)',
|
||||||
|
is_list char(1) comment '是否列表字段(1是)',
|
||||||
|
is_query char(1) comment '是否查询字段(1是)',
|
||||||
|
query_type varchar(200) default 'EQ' comment '查询方式(等于、不等于、大于、小于、范围)',
|
||||||
|
html_type varchar(200) comment '显示类型(文本框、文本域、下拉框、复选框、单选框、日期控件)',
|
||||||
|
dict_type varchar(200) default '' comment '字典类型',
|
||||||
|
sort int comment '排序',
|
||||||
|
create_by varchar(64) default '' comment '创建者',
|
||||||
|
create_time datetime comment '创建时间',
|
||||||
|
update_by varchar(64) default '' comment '更新者',
|
||||||
|
update_time datetime comment '更新时间',
|
||||||
|
primary key (column_id)
|
||||||
|
) engine=innodb auto_increment=1 comment = '代码生成业务表字段';
|
||||||
|
|
@ -1,170 +1,170 @@
|
||||||
-- ----------------------------
|
-- ----------------------------
|
||||||
-- 1、存储每一个已配置的 jobDetail 的详细信息
|
-- 1、存储每一个已配置的 jobDetail 的详细信息
|
||||||
-- ----------------------------
|
-- ----------------------------
|
||||||
drop table if exists QRTZ_JOB_DETAILS;
|
drop table if exists QRTZ_JOB_DETAILS;
|
||||||
create table QRTZ_JOB_DETAILS (
|
create table QRTZ_JOB_DETAILS (
|
||||||
sched_name varchar(120) not null,
|
sched_name varchar(120) not null,
|
||||||
job_name varchar(200) not null,
|
job_name varchar(200) not null,
|
||||||
job_group varchar(200) not null,
|
job_group varchar(200) not null,
|
||||||
description varchar(250) null,
|
description varchar(250) null,
|
||||||
job_class_name varchar(250) not null,
|
job_class_name varchar(250) not null,
|
||||||
is_durable varchar(1) not null,
|
is_durable varchar(1) not null,
|
||||||
is_nonconcurrent varchar(1) not null,
|
is_nonconcurrent varchar(1) not null,
|
||||||
is_update_data varchar(1) not null,
|
is_update_data varchar(1) not null,
|
||||||
requests_recovery varchar(1) not null,
|
requests_recovery varchar(1) not null,
|
||||||
job_data blob null,
|
job_data blob null,
|
||||||
primary key (sched_name,job_name,job_group)
|
primary key (sched_name,job_name,job_group)
|
||||||
) engine=innodb;
|
) engine=innodb;
|
||||||
|
|
||||||
-- ----------------------------
|
-- ----------------------------
|
||||||
-- 2、 存储已配置的 Trigger 的信息
|
-- 2、 存储已配置的 Trigger 的信息
|
||||||
-- ----------------------------
|
-- ----------------------------
|
||||||
drop table if exists QRTZ_TRIGGERS;
|
drop table if exists QRTZ_TRIGGERS;
|
||||||
create table QRTZ_TRIGGERS (
|
create table QRTZ_TRIGGERS (
|
||||||
sched_name varchar(120) not null,
|
sched_name varchar(120) not null,
|
||||||
trigger_name varchar(200) not null,
|
trigger_name varchar(200) not null,
|
||||||
trigger_group varchar(200) not null,
|
trigger_group varchar(200) not null,
|
||||||
job_name varchar(200) not null,
|
job_name varchar(200) not null,
|
||||||
job_group varchar(200) not null,
|
job_group varchar(200) not null,
|
||||||
description varchar(250) null,
|
description varchar(250) null,
|
||||||
next_fire_time bigint(13) null,
|
next_fire_time bigint(13) null,
|
||||||
prev_fire_time bigint(13) null,
|
prev_fire_time bigint(13) null,
|
||||||
priority integer null,
|
priority integer null,
|
||||||
trigger_state varchar(16) not null,
|
trigger_state varchar(16) not null,
|
||||||
trigger_type varchar(8) not null,
|
trigger_type varchar(8) not null,
|
||||||
start_time bigint(13) not null,
|
start_time bigint(13) not null,
|
||||||
end_time bigint(13) null,
|
end_time bigint(13) null,
|
||||||
calendar_name varchar(200) null,
|
calendar_name varchar(200) null,
|
||||||
misfire_instr smallint(2) null,
|
misfire_instr smallint(2) null,
|
||||||
job_data blob null,
|
job_data blob null,
|
||||||
primary key (sched_name,trigger_name,trigger_group),
|
primary key (sched_name,trigger_name,trigger_group),
|
||||||
foreign key (sched_name,job_name,job_group) references QRTZ_JOB_DETAILS(sched_name,job_name,job_group)
|
foreign key (sched_name,job_name,job_group) references QRTZ_JOB_DETAILS(sched_name,job_name,job_group)
|
||||||
) engine=innodb;
|
) engine=innodb;
|
||||||
|
|
||||||
-- ----------------------------
|
-- ----------------------------
|
||||||
-- 3、 存储简单的 Trigger,包括重复次数,间隔,以及已触发的次数
|
-- 3、 存储简单的 Trigger,包括重复次数,间隔,以及已触发的次数
|
||||||
-- ----------------------------
|
-- ----------------------------
|
||||||
drop table if exists QRTZ_SIMPLE_TRIGGERS;
|
drop table if exists QRTZ_SIMPLE_TRIGGERS;
|
||||||
create table QRTZ_SIMPLE_TRIGGERS (
|
create table QRTZ_SIMPLE_TRIGGERS (
|
||||||
sched_name varchar(120) not null,
|
sched_name varchar(120) not null,
|
||||||
trigger_name varchar(200) not null,
|
trigger_name varchar(200) not null,
|
||||||
trigger_group varchar(200) not null,
|
trigger_group varchar(200) not null,
|
||||||
repeat_count bigint(7) not null,
|
repeat_count bigint(7) not null,
|
||||||
repeat_interval bigint(12) not null,
|
repeat_interval bigint(12) not null,
|
||||||
times_triggered bigint(10) not null,
|
times_triggered bigint(10) not null,
|
||||||
primary key (sched_name,trigger_name,trigger_group),
|
primary key (sched_name,trigger_name,trigger_group),
|
||||||
foreign key (sched_name,trigger_name,trigger_group) references QRTZ_TRIGGERS(sched_name,trigger_name,trigger_group)
|
foreign key (sched_name,trigger_name,trigger_group) references QRTZ_TRIGGERS(sched_name,trigger_name,trigger_group)
|
||||||
) engine=innodb;
|
) engine=innodb;
|
||||||
|
|
||||||
-- ----------------------------
|
-- ----------------------------
|
||||||
-- 4、 存储 Cron Trigger,包括 Cron 表达式和时区信息
|
-- 4、 存储 Cron Trigger,包括 Cron 表达式和时区信息
|
||||||
-- ----------------------------
|
-- ----------------------------
|
||||||
drop table if exists QRTZ_CRON_TRIGGERS;
|
drop table if exists QRTZ_CRON_TRIGGERS;
|
||||||
create table QRTZ_CRON_TRIGGERS (
|
create table QRTZ_CRON_TRIGGERS (
|
||||||
sched_name varchar(120) not null,
|
sched_name varchar(120) not null,
|
||||||
trigger_name varchar(200) not null,
|
trigger_name varchar(200) not null,
|
||||||
trigger_group varchar(200) not null,
|
trigger_group varchar(200) not null,
|
||||||
cron_expression varchar(200) not null,
|
cron_expression varchar(200) not null,
|
||||||
time_zone_id varchar(80),
|
time_zone_id varchar(80),
|
||||||
primary key (sched_name,trigger_name,trigger_group),
|
primary key (sched_name,trigger_name,trigger_group),
|
||||||
foreign key (sched_name,trigger_name,trigger_group) references QRTZ_TRIGGERS(sched_name,trigger_name,trigger_group)
|
foreign key (sched_name,trigger_name,trigger_group) references QRTZ_TRIGGERS(sched_name,trigger_name,trigger_group)
|
||||||
) engine=innodb;
|
) engine=innodb;
|
||||||
|
|
||||||
-- ----------------------------
|
-- ----------------------------
|
||||||
-- 5、 Trigger 作为 Blob 类型存储(用于 Quartz 用户用 JDBC 创建他们自己定制的 Trigger 类型,JobStore 并不知道如何存储实例的时候)
|
-- 5、 Trigger 作为 Blob 类型存储(用于 Quartz 用户用 JDBC 创建他们自己定制的 Trigger 类型,JobStore 并不知道如何存储实例的时候)
|
||||||
-- ----------------------------
|
-- ----------------------------
|
||||||
drop table if exists QRTZ_BLOB_TRIGGERS;
|
drop table if exists QRTZ_BLOB_TRIGGERS;
|
||||||
create table QRTZ_BLOB_TRIGGERS (
|
create table QRTZ_BLOB_TRIGGERS (
|
||||||
sched_name varchar(120) not null,
|
sched_name varchar(120) not null,
|
||||||
trigger_name varchar(200) not null,
|
trigger_name varchar(200) not null,
|
||||||
trigger_group varchar(200) not null,
|
trigger_group varchar(200) not null,
|
||||||
blob_data blob null,
|
blob_data blob null,
|
||||||
primary key (sched_name,trigger_name,trigger_group),
|
primary key (sched_name,trigger_name,trigger_group),
|
||||||
foreign key (sched_name,trigger_name,trigger_group) references QRTZ_TRIGGERS(sched_name,trigger_name,trigger_group)
|
foreign key (sched_name,trigger_name,trigger_group) references QRTZ_TRIGGERS(sched_name,trigger_name,trigger_group)
|
||||||
) engine=innodb;
|
) engine=innodb;
|
||||||
|
|
||||||
-- ----------------------------
|
-- ----------------------------
|
||||||
-- 6、 以 Blob 类型存储存放日历信息, quartz可配置一个日历来指定一个时间范围
|
-- 6、 以 Blob 类型存储存放日历信息, quartz可配置一个日历来指定一个时间范围
|
||||||
-- ----------------------------
|
-- ----------------------------
|
||||||
drop table if exists QRTZ_CALENDARS;
|
drop table if exists QRTZ_CALENDARS;
|
||||||
create table QRTZ_CALENDARS (
|
create table QRTZ_CALENDARS (
|
||||||
sched_name varchar(120) not null,
|
sched_name varchar(120) not null,
|
||||||
calendar_name varchar(200) not null,
|
calendar_name varchar(200) not null,
|
||||||
calendar blob not null,
|
calendar blob not null,
|
||||||
primary key (sched_name,calendar_name)
|
primary key (sched_name,calendar_name)
|
||||||
) engine=innodb;
|
) engine=innodb;
|
||||||
|
|
||||||
-- ----------------------------
|
-- ----------------------------
|
||||||
-- 7、 存储已暂停的 Trigger 组的信息
|
-- 7、 存储已暂停的 Trigger 组的信息
|
||||||
-- ----------------------------
|
-- ----------------------------
|
||||||
drop table if exists QRTZ_PAUSED_TRIGGER_GRPS;
|
drop table if exists QRTZ_PAUSED_TRIGGER_GRPS;
|
||||||
create table QRTZ_PAUSED_TRIGGER_GRPS (
|
create table QRTZ_PAUSED_TRIGGER_GRPS (
|
||||||
sched_name varchar(120) not null,
|
sched_name varchar(120) not null,
|
||||||
trigger_group varchar(200) not null,
|
trigger_group varchar(200) not null,
|
||||||
primary key (sched_name,trigger_group)
|
primary key (sched_name,trigger_group)
|
||||||
) engine=innodb;
|
) engine=innodb;
|
||||||
|
|
||||||
-- ----------------------------
|
-- ----------------------------
|
||||||
-- 8、 存储与已触发的 Trigger 相关的状态信息,以及相联 Job 的执行信息
|
-- 8、 存储与已触发的 Trigger 相关的状态信息,以及相联 Job 的执行信息
|
||||||
-- ----------------------------
|
-- ----------------------------
|
||||||
drop table if exists QRTZ_FIRED_TRIGGERS;
|
drop table if exists QRTZ_FIRED_TRIGGERS;
|
||||||
create table QRTZ_FIRED_TRIGGERS (
|
create table QRTZ_FIRED_TRIGGERS (
|
||||||
sched_name varchar(120) not null,
|
sched_name varchar(120) not null,
|
||||||
entry_id varchar(95) not null,
|
entry_id varchar(95) not null,
|
||||||
trigger_name varchar(200) not null,
|
trigger_name varchar(200) not null,
|
||||||
trigger_group varchar(200) not null,
|
trigger_group varchar(200) not null,
|
||||||
instance_name varchar(200) not null,
|
instance_name varchar(200) not null,
|
||||||
fired_time bigint(13) not null,
|
fired_time bigint(13) not null,
|
||||||
sched_time bigint(13) not null,
|
sched_time bigint(13) not null,
|
||||||
priority integer not null,
|
priority integer not null,
|
||||||
state varchar(16) not null,
|
state varchar(16) not null,
|
||||||
job_name varchar(200) null,
|
job_name varchar(200) null,
|
||||||
job_group varchar(200) null,
|
job_group varchar(200) null,
|
||||||
is_nonconcurrent varchar(1) null,
|
is_nonconcurrent varchar(1) null,
|
||||||
requests_recovery varchar(1) null,
|
requests_recovery varchar(1) null,
|
||||||
primary key (sched_name,entry_id)
|
primary key (sched_name,entry_id)
|
||||||
) engine=innodb;
|
) engine=innodb;
|
||||||
|
|
||||||
-- ----------------------------
|
-- ----------------------------
|
||||||
-- 9、 存储少量的有关 Scheduler 的状态信息,假如是用于集群中,可以看到其他的 Scheduler 实例
|
-- 9、 存储少量的有关 Scheduler 的状态信息,假如是用于集群中,可以看到其他的 Scheduler 实例
|
||||||
-- ----------------------------
|
-- ----------------------------
|
||||||
drop table if exists QRTZ_SCHEDULER_STATE;
|
drop table if exists QRTZ_SCHEDULER_STATE;
|
||||||
create table QRTZ_SCHEDULER_STATE (
|
create table QRTZ_SCHEDULER_STATE (
|
||||||
sched_name varchar(120) not null,
|
sched_name varchar(120) not null,
|
||||||
instance_name varchar(200) not null,
|
instance_name varchar(200) not null,
|
||||||
last_checkin_time bigint(13) not null,
|
last_checkin_time bigint(13) not null,
|
||||||
checkin_interval bigint(13) not null,
|
checkin_interval bigint(13) not null,
|
||||||
primary key (sched_name,instance_name)
|
primary key (sched_name,instance_name)
|
||||||
) engine=innodb;
|
) engine=innodb;
|
||||||
|
|
||||||
-- ----------------------------
|
-- ----------------------------
|
||||||
-- 10、 存储程序的悲观锁的信息(假如使用了悲观锁)
|
-- 10、 存储程序的悲观锁的信息(假如使用了悲观锁)
|
||||||
-- ----------------------------
|
-- ----------------------------
|
||||||
drop table if exists QRTZ_LOCKS;
|
drop table if exists QRTZ_LOCKS;
|
||||||
create table QRTZ_LOCKS (
|
create table QRTZ_LOCKS (
|
||||||
sched_name varchar(120) not null,
|
sched_name varchar(120) not null,
|
||||||
lock_name varchar(40) not null,
|
lock_name varchar(40) not null,
|
||||||
primary key (sched_name,lock_name)
|
primary key (sched_name,lock_name)
|
||||||
) engine=innodb;
|
) engine=innodb;
|
||||||
|
|
||||||
drop table if exists QRTZ_SIMPROP_TRIGGERS;
|
drop table if exists QRTZ_SIMPROP_TRIGGERS;
|
||||||
create table QRTZ_SIMPROP_TRIGGERS (
|
create table QRTZ_SIMPROP_TRIGGERS (
|
||||||
sched_name varchar(120) not null,
|
sched_name varchar(120) not null,
|
||||||
trigger_name varchar(200) not null,
|
trigger_name varchar(200) not null,
|
||||||
trigger_group varchar(200) not null,
|
trigger_group varchar(200) not null,
|
||||||
str_prop_1 varchar(512) null,
|
str_prop_1 varchar(512) null,
|
||||||
str_prop_2 varchar(512) null,
|
str_prop_2 varchar(512) null,
|
||||||
str_prop_3 varchar(512) null,
|
str_prop_3 varchar(512) null,
|
||||||
int_prop_1 int null,
|
int_prop_1 int null,
|
||||||
int_prop_2 int null,
|
int_prop_2 int null,
|
||||||
long_prop_1 bigint null,
|
long_prop_1 bigint null,
|
||||||
long_prop_2 bigint null,
|
long_prop_2 bigint null,
|
||||||
dec_prop_1 numeric(13,4) null,
|
dec_prop_1 numeric(13,4) null,
|
||||||
dec_prop_2 numeric(13,4) null,
|
dec_prop_2 numeric(13,4) null,
|
||||||
bool_prop_1 varchar(1) null,
|
bool_prop_1 varchar(1) null,
|
||||||
bool_prop_2 varchar(1) null,
|
bool_prop_2 varchar(1) null,
|
||||||
primary key (sched_name,trigger_name,trigger_group),
|
primary key (sched_name,trigger_name,trigger_group),
|
||||||
foreign key (sched_name,trigger_name,trigger_group) references QRTZ_TRIGGERS(sched_name,trigger_name,trigger_group)
|
foreign key (sched_name,trigger_name,trigger_group) references QRTZ_TRIGGERS(sched_name,trigger_name,trigger_group)
|
||||||
) engine=innodb;
|
) engine=innodb;
|
||||||
|
|
||||||
commit;
|
commit;
|
||||||
|
|
@ -0,0 +1 @@
|
||||||
|
UPDATE sys_menu SET parent_id = NULL WHERE parent_id = 0;
|
||||||
|
|
@ -0,0 +1,5 @@
|
||||||
|
hibernate.cache.use_second_level_cache=true
|
||||||
|
hibernate.cache.region.factory_class=com.ruoyi.framework.ehcache.MyJCacheRegionFactory
|
||||||
|
hibernate.cache.use_query_cache=true
|
||||||
|
hibernate.generate_statistics=true
|
||||||
|
hibernate.javax.cache.uri=hibernate_2level_ehcache.xml
|
||||||
|
|
@ -0,0 +1,23 @@
|
||||||
|
<config xmlns="http://www.ehcache.org/v3"
|
||||||
|
xmlns:jsr107="http://www.ehcache.org/v3/jsr107">
|
||||||
|
|
||||||
|
<service>
|
||||||
|
<jsr107:defaults enable-management="true" enable-statistics="false"/>
|
||||||
|
</service>
|
||||||
|
|
||||||
|
<!--指定缓存目录-->
|
||||||
|
<persistence directory="${java.io.tmpdir}/hibernate-ehcache"/>
|
||||||
|
|
||||||
|
<!--缓存模板-->
|
||||||
|
<cache-template name="default">
|
||||||
|
<expiry>
|
||||||
|
<tti>600</tti>
|
||||||
|
</expiry>
|
||||||
|
<resources>
|
||||||
|
<heap>500</heap>
|
||||||
|
</resources>
|
||||||
|
</cache-template>
|
||||||
|
|
||||||
|
<cache alias="com.ruoyi.system.domain.SysDept" uses-template="default"/>
|
||||||
|
|
||||||
|
</config>
|
||||||
File diff suppressed because it is too large
Load Diff
|
|
@ -1,336 +1,336 @@
|
||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html lang="zh" xmlns:th="http://www.thymeleaf.org">
|
<html lang="zh" xmlns:th="http://www.thymeleaf.org">
|
||||||
<head>
|
<head>
|
||||||
<meta charset="utf-8">
|
<meta charset="utf-8">
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
<meta name="renderer" content="webkit">
|
<meta name="renderer" content="webkit">
|
||||||
<title>若依系统首页</title>
|
<title>若依系统首页</title>
|
||||||
<!-- 避免IE使用兼容模式 -->
|
<!-- 避免IE使用兼容模式 -->
|
||||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||||
<link th:href="@{favicon.ico}" rel="shortcut icon"/>
|
<link th:href="@{favicon.ico}" rel="shortcut icon"/>
|
||||||
<link th:href="@{/css/bootstrap.min.css}" rel="stylesheet"/>
|
<link th:href="@{/css/bootstrap.min.css}" rel="stylesheet"/>
|
||||||
<link th:href="@{/css/jquery.contextMenu.min.css}" rel="stylesheet"/>
|
<link th:href="@{/css/jquery.contextMenu.min.css}" rel="stylesheet"/>
|
||||||
<link th:href="@{/css/font-awesome.min.css}" rel="stylesheet"/>
|
<link th:href="@{/css/font-awesome.min.css}" rel="stylesheet"/>
|
||||||
<link th:href="@{/css/animate.css}" rel="stylesheet"/>
|
<link th:href="@{/css/animate.css}" rel="stylesheet"/>
|
||||||
<link th:href="@{/css/style.css}" rel="stylesheet"/>
|
<link th:href="@{/css/style.css}" rel="stylesheet"/>
|
||||||
<link th:href="@{/css/skins.css}" rel="stylesheet"/>
|
<link th:href="@{/css/skins.css}" rel="stylesheet"/>
|
||||||
<link th:href="@{/ruoyi/css/ry-ui.css?v=4.4.0}" rel="stylesheet"/>
|
<link th:href="@{/ruoyi/css/ry-ui.css?v=4.4.0}" rel="stylesheet"/>
|
||||||
</head>
|
</head>
|
||||||
<body class="fixed-sidebar full-height-layout gray-bg" style="overflow: hidden">
|
<body class="fixed-sidebar full-height-layout gray-bg" style="overflow: hidden">
|
||||||
<div id="wrapper">
|
<div id="wrapper">
|
||||||
|
|
||||||
<!--左侧导航开始-->
|
<!--左侧导航开始-->
|
||||||
<nav class="navbar-default navbar-static-side" role="navigation">
|
<nav class="navbar-default navbar-static-side" role="navigation">
|
||||||
<div class="nav-close">
|
<div class="nav-close">
|
||||||
<i class="fa fa-times-circle"></i>
|
<i class="fa fa-times-circle"></i>
|
||||||
</div>
|
</div>
|
||||||
<a th:href="@{/index}">
|
<a th:href="@{/index}">
|
||||||
<li class="logo hidden-xs">
|
<li class="logo hidden-xs">
|
||||||
<span class="logo-lg">RuoYi</span>
|
<span class="logo-lg">RuoYi</span>
|
||||||
</li>
|
</li>
|
||||||
</a>
|
</a>
|
||||||
<div class="sidebar-collapse">
|
<div class="sidebar-collapse">
|
||||||
<ul class="nav" id="side-menu">
|
<ul class="nav" id="side-menu">
|
||||||
<li>
|
<li>
|
||||||
<div class="user-panel">
|
<div class="user-panel">
|
||||||
<a class="menuItem noactive" title="个人中心" th:href="@{/system/user/profile}">
|
<a class="menuItem noactive" title="个人中心" th:href="@{/system/user/profile}">
|
||||||
<div class="hide" th:text="个人中心"></div>
|
<div class="hide" th:text="个人中心"></div>
|
||||||
<div class="pull-left image">
|
<div class="pull-left image">
|
||||||
<img th:src="(${#strings.isEmpty(user.avatar)}) ? @{/img/profile.jpg} : @{${user.avatar}}" th:onerror="this.src='img/profile.jpg'" class="img-circle" alt="User Image">
|
<img th:src="(${#strings.isEmpty(user.avatar)}) ? @{/img/profile.jpg} : @{${user.avatar}}" th:onerror="this.src='img/profile.jpg'" class="img-circle" alt="User Image">
|
||||||
</div>
|
</div>
|
||||||
</a>
|
</a>
|
||||||
<div class="pull-left info">
|
<div class="pull-left info">
|
||||||
<p>[[${user.loginName}]]</p>
|
<p>[[${user.loginName}]]</p>
|
||||||
<a href="#"><i class="fa fa-circle text-success"></i> 在线</a>
|
<a href="#"><i class="fa fa-circle text-success"></i> 在线</a>
|
||||||
<a th:href="@{logout}" style="padding-left:5px;"><i class="fa fa-sign-out text-danger"></i> 注销</a>
|
<a th:href="@{logout}" style="padding-left:5px;"><i class="fa fa-sign-out text-danger"></i> 注销</a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
<a class="menuItem" th:href="@{/system/main}"><i class="fa fa-home"></i> <span class="nav-label">首页</span> </a>
|
<a class="menuItem" th:href="@{/system/main}"><i class="fa fa-home"></i> <span class="nav-label">首页</span> </a>
|
||||||
</li>
|
</li>
|
||||||
<li th:each="menu : ${menus}">
|
<li th:each="menu : ${menus}">
|
||||||
<a th:class="@{${!#strings.isEmpty(menu.url) && menu.url != '#'} ? ${menu.target}}" th:href="@{${#strings.isEmpty(menu.url)} ? |#| : ${menu.url}}">
|
<a th:class="@{${!#strings.isEmpty(menu.url) && menu.url != '#'} ? ${menu.target}}" th:href="@{${#strings.isEmpty(menu.url)} ? |#| : ${menu.url}}">
|
||||||
<i class="fa fa-bar-chart-o" th:class="${menu.icon}"></i>
|
<i class="fa fa-bar-chart-o" th:class="${menu.icon}"></i>
|
||||||
<span class="nav-label" th:text="${menu.menuName}">一级菜单</span>
|
<span class="nav-label" th:text="${menu.menuName}">一级菜单</span>
|
||||||
<span th:class="${#strings.isEmpty(menu.url) || menu.url == '#'} ? |fa arrow|"></span>
|
<span th:class="${#strings.isEmpty(menu.url) || menu.url == '#'} ? |fa arrow|"></span>
|
||||||
</a>
|
</a>
|
||||||
<ul class="nav nav-second-level collapse">
|
<ul class="nav nav-second-level collapse">
|
||||||
<li th:each="cmenu : ${menu.children}">
|
<li th:each="cmenu : ${menu.children}">
|
||||||
<a th:if="${#lists.isEmpty(cmenu.children)}" th:class="${#strings.isEmpty(cmenu.target)} ? |menuItem| : ${cmenu.target}" th:utext="${cmenu.menuName}" th:href="@{${cmenu.url}}">二级菜单</a>
|
<a th:if="${#lists.isEmpty(cmenu.children)}" th:class="${#strings.isEmpty(cmenu.target)} ? |menuItem| : ${cmenu.target}" th:utext="${cmenu.menuName}" th:href="@{${cmenu.url}}">二级菜单</a>
|
||||||
<a th:if="${not #lists.isEmpty(cmenu.children)}" href="#">[[${cmenu.menuName}]]<span class="fa arrow"></span></a>
|
<a th:if="${not #lists.isEmpty(cmenu.children)}" href="#">[[${cmenu.menuName}]]<span class="fa arrow"></span></a>
|
||||||
<ul th:if="${not #lists.isEmpty(cmenu.children)}" class="nav nav-third-level">
|
<ul th:if="${not #lists.isEmpty(cmenu.children)}" class="nav nav-third-level">
|
||||||
<li th:each="emenu : ${cmenu.children}">
|
<li th:each="emenu : ${cmenu.children}">
|
||||||
<a th:if="${#lists.isEmpty(emenu.children)}" th:class="${#strings.isEmpty(emenu.target)} ? |menuItem| : ${emenu.target}" th:text="${emenu.menuName}" th:href="@{${emenu.url}}">三级菜单</a>
|
<a th:if="${#lists.isEmpty(emenu.children)}" th:class="${#strings.isEmpty(emenu.target)} ? |menuItem| : ${emenu.target}" th:text="${emenu.menuName}" th:href="@{${emenu.url}}">三级菜单</a>
|
||||||
<a th:if="${not #lists.isEmpty(emenu.children)}" href="#">[[${emenu.menuName}]]<span class="fa arrow"></span></a>
|
<a th:if="${not #lists.isEmpty(emenu.children)}" href="#">[[${emenu.menuName}]]<span class="fa arrow"></span></a>
|
||||||
<ul th:if="${not #lists.isEmpty(emenu.children)}" class="nav nav-four-level">
|
<ul th:if="${not #lists.isEmpty(emenu.children)}" class="nav nav-four-level">
|
||||||
<li th:each="fmenu : ${emenu.children}"><a th:if="${#lists.isEmpty(fmenu.children)}" th:class="${#strings.isEmpty(fmenu.target)} ? |menuItem| : ${fmenu.target}" th:text="${fmenu.menuName}" th:href="@{${fmenu.url}}">四级菜单</a></li>
|
<li th:each="fmenu : ${emenu.children}"><a th:if="${#lists.isEmpty(fmenu.children)}" th:class="${#strings.isEmpty(fmenu.target)} ? |menuItem| : ${fmenu.target}" th:text="${fmenu.menuName}" th:href="@{${fmenu.url}}">四级菜单</a></li>
|
||||||
</ul>
|
</ul>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
</li>
|
</li>
|
||||||
<li th:if="${demoEnabled}">
|
<li th:if="${demoEnabled}">
|
||||||
<a href="#"><i class="fa fa-desktop"></i><span class="nav-label">实例演示</span><span class="fa arrow"></span></a>
|
<a href="#"><i class="fa fa-desktop"></i><span class="nav-label">实例演示</span><span class="fa arrow"></span></a>
|
||||||
<ul class="nav nav-second-level collapse">
|
<ul class="nav nav-second-level collapse">
|
||||||
<li> <a>表单<span class="fa arrow"></span></a>
|
<li> <a>表单<span class="fa arrow"></span></a>
|
||||||
<ul class="nav nav-third-level">
|
<ul class="nav nav-third-level">
|
||||||
<li><a class="menuItem" th:href="@{/demo/form/button}">按钮</a></li>
|
<li><a class="menuItem" th:href="@{/demo/form/button}">按钮</a></li>
|
||||||
<li><a class="menuItem" th:href="@{/demo/form/grid}">栅格</a></li>
|
<li><a class="menuItem" th:href="@{/demo/form/grid}">栅格</a></li>
|
||||||
<li><a class="menuItem" th:href="@{/demo/form/select}">下拉框</a></li>
|
<li><a class="menuItem" th:href="@{/demo/form/select}">下拉框</a></li>
|
||||||
<li><a class="menuItem" th:href="@{/demo/form/timeline}">时间轴</a></li>
|
<li><a class="menuItem" th:href="@{/demo/form/timeline}">时间轴</a></li>
|
||||||
<li><a class="menuItem" th:href="@{/demo/form/basic}">基本表单</a></li>
|
<li><a class="menuItem" th:href="@{/demo/form/basic}">基本表单</a></li>
|
||||||
<li><a class="menuItem" th:href="@{/demo/form/cards}">卡片列表</a></li>
|
<li><a class="menuItem" th:href="@{/demo/form/cards}">卡片列表</a></li>
|
||||||
<li><a class="menuItem" th:href="@{/demo/form/jasny}">功能扩展</a></li>
|
<li><a class="menuItem" th:href="@{/demo/form/jasny}">功能扩展</a></li>
|
||||||
<li><a class="menuItem" th:href="@{/demo/form/sortable}">拖动排序</a></li>
|
<li><a class="menuItem" th:href="@{/demo/form/sortable}">拖动排序</a></li>
|
||||||
<li><a class="menuItem" th:href="@{/demo/form/tabs_panels}">选项卡 & 面板</a></li>
|
<li><a class="menuItem" th:href="@{/demo/form/tabs_panels}">选项卡 & 面板</a></li>
|
||||||
<li><a class="menuItem" th:href="@{/demo/form/validate}">表单校验</a></li>
|
<li><a class="menuItem" th:href="@{/demo/form/validate}">表单校验</a></li>
|
||||||
<li><a class="menuItem" th:href="@{/demo/form/wizard}">表单向导</a></li>
|
<li><a class="menuItem" th:href="@{/demo/form/wizard}">表单向导</a></li>
|
||||||
<li><a class="menuItem" th:href="@{/demo/form/upload}">文件上传</a></li>
|
<li><a class="menuItem" th:href="@{/demo/form/upload}">文件上传</a></li>
|
||||||
<li><a class="menuItem" th:href="@{/demo/form/datetime}">日期和时间</a></li>
|
<li><a class="menuItem" th:href="@{/demo/form/datetime}">日期和时间</a></li>
|
||||||
<li><a class="menuItem" th:href="@{/demo/form/summernote}">富文本编辑器</a></li>
|
<li><a class="menuItem" th:href="@{/demo/form/summernote}">富文本编辑器</a></li>
|
||||||
<li><a class="menuItem" th:href="@{/demo/form/duallistbox}">左右互选组件</a></li>
|
<li><a class="menuItem" th:href="@{/demo/form/duallistbox}">左右互选组件</a></li>
|
||||||
<li><a class="menuItem" th:href="@{/demo/form/autocomplete}">搜索自动补全</a></li>
|
<li><a class="menuItem" th:href="@{/demo/form/autocomplete}">搜索自动补全</a></li>
|
||||||
<li><a class="menuItem" th:href="@{/demo/form/cxselect}">多级联动下拉</a></li>
|
<li><a class="menuItem" th:href="@{/demo/form/cxselect}">多级联动下拉</a></li>
|
||||||
<li><a class="menuItem" th:href="@{/demo/form/localrefresh}">Ajax局部刷新</a></li>
|
<li><a class="menuItem" th:href="@{/demo/form/localrefresh}">Ajax局部刷新</a></li>
|
||||||
</ul>
|
</ul>
|
||||||
</li>
|
</li>
|
||||||
<li> <a>表格<span class="fa arrow"></span></a>
|
<li> <a>表格<span class="fa arrow"></span></a>
|
||||||
<ul class="nav nav-third-level">
|
<ul class="nav nav-third-level">
|
||||||
<li><a class="menuItem" th:href="@{/demo/table/search}">查询条件</a></li>
|
<li><a class="menuItem" th:href="@{/demo/table/search}">查询条件</a></li>
|
||||||
<li><a class="menuItem" th:href="@{/demo/table/footer}">数据汇总</a></li>
|
<li><a class="menuItem" th:href="@{/demo/table/footer}">数据汇总</a></li>
|
||||||
<li><a class="menuItem" th:href="@{/demo/table/groupHeader}">组合表头</a></li>
|
<li><a class="menuItem" th:href="@{/demo/table/groupHeader}">组合表头</a></li>
|
||||||
<li><a class="menuItem" th:href="@{/demo/table/export}">表格导出</a></li>
|
<li><a class="menuItem" th:href="@{/demo/table/export}">表格导出</a></li>
|
||||||
<li><a class="menuItem" th:href="@{/demo/table/remember}">翻页记住选择</a></li>
|
<li><a class="menuItem" th:href="@{/demo/table/remember}">翻页记住选择</a></li>
|
||||||
<li><a class="menuItem" th:href="@{/demo/table/pageGo}">跳转至指定页</a></li>
|
<li><a class="menuItem" th:href="@{/demo/table/pageGo}">跳转至指定页</a></li>
|
||||||
<li><a class="menuItem" th:href="@{/demo/table/params}">自定义查询参数</a></li>
|
<li><a class="menuItem" th:href="@{/demo/table/params}">自定义查询参数</a></li>
|
||||||
<li><a class="menuItem" th:href="@{/demo/table/multi}">初始多表格</a></li>
|
<li><a class="menuItem" th:href="@{/demo/table/multi}">初始多表格</a></li>
|
||||||
<li><a class="menuItem" th:href="@{/demo/table/button}">点击按钮加载表格</a></li>
|
<li><a class="menuItem" th:href="@{/demo/table/button}">点击按钮加载表格</a></li>
|
||||||
<li><a class="menuItem" th:href="@{/demo/table/data}">直接加载表格数据</a></li>
|
<li><a class="menuItem" th:href="@{/demo/table/data}">直接加载表格数据</a></li>
|
||||||
<li><a class="menuItem" th:href="@{/demo/table/fixedColumns}">表格冻结列</a></li>
|
<li><a class="menuItem" th:href="@{/demo/table/fixedColumns}">表格冻结列</a></li>
|
||||||
<li><a class="menuItem" th:href="@{/demo/table/event}">自定义触发事件</a></li>
|
<li><a class="menuItem" th:href="@{/demo/table/event}">自定义触发事件</a></li>
|
||||||
<li><a class="menuItem" th:href="@{/demo/table/headerStyle}">表格标题格式化</a></li>
|
<li><a class="menuItem" th:href="@{/demo/table/headerStyle}">表格标题格式化</a></li>
|
||||||
<li><a class="menuItem" th:href="@{/demo/table/detail}">表格细节视图</a></li>
|
<li><a class="menuItem" th:href="@{/demo/table/detail}">表格细节视图</a></li>
|
||||||
<li><a class="menuItem" th:href="@{/demo/table/child}">表格父子视图</a></li>
|
<li><a class="menuItem" th:href="@{/demo/table/child}">表格父子视图</a></li>
|
||||||
<li><a class="menuItem" th:href="@{/demo/table/image}">表格图片预览</a></li>
|
<li><a class="menuItem" th:href="@{/demo/table/image}">表格图片预览</a></li>
|
||||||
<li><a class="menuItem" th:href="@{/demo/table/curd}">动态增删改查</a></li>
|
<li><a class="menuItem" th:href="@{/demo/table/curd}">动态增删改查</a></li>
|
||||||
<li><a class="menuItem" th:href="@{/demo/table/reorder}">表格拖拽操作</a></li>
|
<li><a class="menuItem" th:href="@{/demo/table/reorder}">表格拖拽操作</a></li>
|
||||||
<li><a class="menuItem" th:href="@{/demo/table/editable}">表格行内编辑</a></li>
|
<li><a class="menuItem" th:href="@{/demo/table/editable}">表格行内编辑</a></li>
|
||||||
<li><a class="menuItem" th:href="@{/demo/table/subdata}">主子表提交</a></li>
|
<li><a class="menuItem" th:href="@{/demo/table/subdata}">主子表提交</a></li>
|
||||||
<li><a class="menuItem" th:href="@{/demo/table/refresh}">表格自动刷新</a></li>
|
<li><a class="menuItem" th:href="@{/demo/table/refresh}">表格自动刷新</a></li>
|
||||||
<li><a class="menuItem" th:href="@{/demo/table/print}">表格打印配置</a></li>
|
<li><a class="menuItem" th:href="@{/demo/table/print}">表格打印配置</a></li>
|
||||||
<li><a class="menuItem" th:href="@{/demo/table/other}">表格其他操作</a></li>
|
<li><a class="menuItem" th:href="@{/demo/table/other}">表格其他操作</a></li>
|
||||||
</ul>
|
</ul>
|
||||||
</li>
|
</li>
|
||||||
<li> <a>弹框<span class="fa arrow"></span></a>
|
<li> <a>弹框<span class="fa arrow"></span></a>
|
||||||
<ul class="nav nav-third-level">
|
<ul class="nav nav-third-level">
|
||||||
<li><a class="menuItem" th:href="@{/demo/modal/dialog}">模态窗口</a></li>
|
<li><a class="menuItem" th:href="@{/demo/modal/dialog}">模态窗口</a></li>
|
||||||
<li><a class="menuItem" th:href="@{/demo/modal/layer}">弹层组件</a></li>
|
<li><a class="menuItem" th:href="@{/demo/modal/layer}">弹层组件</a></li>
|
||||||
<li><a class="menuItem" th:href="@{/demo/modal/table}">弹层表格</a></li>
|
<li><a class="menuItem" th:href="@{/demo/modal/table}">弹层表格</a></li>
|
||||||
</ul>
|
</ul>
|
||||||
</li>
|
</li>
|
||||||
<li> <a>操作<span class="fa arrow"></span></a>
|
<li> <a>操作<span class="fa arrow"></span></a>
|
||||||
<ul class="nav nav-third-level">
|
<ul class="nav nav-third-level">
|
||||||
<li><a class="menuItem" th:href="@{/demo/operate/table}">表格</a></li>
|
<li><a class="menuItem" th:href="@{/demo/operate/table}">表格</a></li>
|
||||||
<li><a class="menuItem" th:href="@{/demo/operate/other}">其他</a></li>
|
<li><a class="menuItem" th:href="@{/demo/operate/other}">其他</a></li>
|
||||||
</ul>
|
</ul>
|
||||||
</li>
|
</li>
|
||||||
<li> <a>报表<span class="fa arrow"></span></a>
|
<li> <a>报表<span class="fa arrow"></span></a>
|
||||||
<ul class="nav nav-third-level">
|
<ul class="nav nav-third-level">
|
||||||
<li><a class="menuItem" th:href="@{/demo/report/echarts}">百度ECharts</a></li>
|
<li><a class="menuItem" th:href="@{/demo/report/echarts}">百度ECharts</a></li>
|
||||||
<li><a class="menuItem" th:href="@{/demo/report/peity}">peity</a></li>
|
<li><a class="menuItem" th:href="@{/demo/report/peity}">peity</a></li>
|
||||||
<li><a class="menuItem" th:href="@{/demo/report/sparkline}">sparkline</a></li>
|
<li><a class="menuItem" th:href="@{/demo/report/sparkline}">sparkline</a></li>
|
||||||
<li><a class="menuItem" th:href="@{/demo/report/metrics}">图表组合</a></li>
|
<li><a class="menuItem" th:href="@{/demo/report/metrics}">图表组合</a></li>
|
||||||
</ul>
|
</ul>
|
||||||
</li>
|
</li>
|
||||||
<li> <a>图标<span class="fa arrow"></span></a>
|
<li> <a>图标<span class="fa arrow"></span></a>
|
||||||
<ul class="nav nav-third-level">
|
<ul class="nav nav-third-level">
|
||||||
<li><a class="menuItem" th:href="@{/demo/icon/fontawesome}">Font Awesome</a></li>
|
<li><a class="menuItem" th:href="@{/demo/icon/fontawesome}">Font Awesome</a></li>
|
||||||
<li><a class="menuItem" th:href="@{/demo/icon/glyphicons}">Glyphicons</a></li>
|
<li><a class="menuItem" th:href="@{/demo/icon/glyphicons}">Glyphicons</a></li>
|
||||||
</ul>
|
</ul>
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
<a href="#"><i class="fa fa-sitemap"></i>四层菜单<span class="fa arrow"></span></a>
|
<a href="#"><i class="fa fa-sitemap"></i>四层菜单<span class="fa arrow"></span></a>
|
||||||
<ul class="nav nav-third-level collapse">
|
<ul class="nav nav-third-level collapse">
|
||||||
<li>
|
<li>
|
||||||
<a href="#" id="damian">三级菜单1<span class="fa arrow"></span></a>
|
<a href="#" id="damian">三级菜单1<span class="fa arrow"></span></a>
|
||||||
<ul class="nav nav-third-level">
|
<ul class="nav nav-third-level">
|
||||||
<li>
|
<li>
|
||||||
<a href="#">四级菜单1</a>
|
<a href="#">四级菜单1</a>
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
<a href="#">四级菜单2</a>
|
<a href="#">四级菜单2</a>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
</li>
|
</li>
|
||||||
<li><a href="#">三级菜单2</a></li>
|
<li><a href="#">三级菜单2</a></li>
|
||||||
</ul>
|
</ul>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
</nav>
|
</nav>
|
||||||
<!--左侧导航结束-->
|
<!--左侧导航结束-->
|
||||||
|
|
||||||
<!--右侧部分开始-->
|
<!--右侧部分开始-->
|
||||||
<div id="page-wrapper" class="gray-bg dashbard-1">
|
<div id="page-wrapper" class="gray-bg dashbard-1">
|
||||||
<div class="row border-bottom">
|
<div class="row border-bottom">
|
||||||
<nav class="navbar navbar-static-top" role="navigation" style="margin-bottom: 0">
|
<nav class="navbar navbar-static-top" role="navigation" style="margin-bottom: 0">
|
||||||
<div class="navbar-header">
|
<div class="navbar-header">
|
||||||
<a class="navbar-minimalize minimalize-styl-2" style="color:#FFF;" href="#" title="收起菜单">
|
<a class="navbar-minimalize minimalize-styl-2" style="color:#FFF;" href="#" title="收起菜单">
|
||||||
<i class="fa fa-bars"></i>
|
<i class="fa fa-bars"></i>
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
<ul class="nav navbar-top-links navbar-right welcome-message">
|
<ul class="nav navbar-top-links navbar-right welcome-message">
|
||||||
<li><a title="视频教程" href="http://doc.ruoyi.vip/ruoyi/document/spjc.html" target="_blank"><i class="fa fa-video-camera"></i> 视频教程</a></li>
|
<li><a title="视频教程" href="http://doc.ruoyi.vip/ruoyi/document/spjc.html" target="_blank"><i class="fa fa-video-camera"></i> 视频教程</a></li>
|
||||||
<li><a title="开发文档" href="http://doc.ruoyi.vip" target="_blank"><i class="fa fa-question-circle"></i> 开发文档</a></li>
|
<li><a title="开发文档" href="http://doc.ruoyi.vip" target="_blank"><i class="fa fa-question-circle"></i> 开发文档</a></li>
|
||||||
<li><a title="全屏显示" href="javascript:void(0)" id="fullScreen"><i class="fa fa-arrows-alt"></i> 全屏显示</a></li>
|
<li><a title="全屏显示" href="javascript:void(0)" id="fullScreen"><i class="fa fa-arrows-alt"></i> 全屏显示</a></li>
|
||||||
<li class="dropdown user-menu">
|
<li class="dropdown user-menu">
|
||||||
<a href="javascript:void(0)" class="dropdown-toggle" data-hover="dropdown">
|
<a href="javascript:void(0)" class="dropdown-toggle" data-hover="dropdown">
|
||||||
<img th:src="(${#strings.isEmpty(user.avatar)}) ? @{/img/profile.jpg} : @{${user.avatar}}" th:onerror="this.src='img/profile.jpg'" class="user-image">
|
<img th:src="(${#strings.isEmpty(user.avatar)}) ? @{/img/profile.jpg} : @{${user.avatar}}" th:onerror="this.src='img/profile.jpg'" class="user-image">
|
||||||
<span class="hidden-xs">[[${#strings.defaultString(user.userName, '-')}]]</span>
|
<span class="hidden-xs">[[${#strings.defaultString(user.userName, '-')}]]</span>
|
||||||
</a>
|
</a>
|
||||||
<ul class="dropdown-menu">
|
<ul class="dropdown-menu">
|
||||||
<li class="mt5">
|
<li class="mt5">
|
||||||
<a th:href="@{/system/user/profile}" class="menuItem">
|
<a th:href="@{/system/user/profile}" class="menuItem">
|
||||||
<i class="fa fa-user"></i> 个人中心</a>
|
<i class="fa fa-user"></i> 个人中心</a>
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
<a onclick="resetPwd()">
|
<a onclick="resetPwd()">
|
||||||
<i class="fa fa-key"></i> 修改密码</a>
|
<i class="fa fa-key"></i> 修改密码</a>
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
<a onclick="switchSkin()">
|
<a onclick="switchSkin()">
|
||||||
<i class="fa fa-dashboard"></i> 切换主题</a>
|
<i class="fa fa-dashboard"></i> 切换主题</a>
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
<a onclick="toggleMenu()">
|
<a onclick="toggleMenu()">
|
||||||
<i class="fa fa-toggle-off"></i> 横向菜单</a>
|
<i class="fa fa-toggle-off"></i> 横向菜单</a>
|
||||||
</li>
|
</li>
|
||||||
<li class="divider"></li>
|
<li class="divider"></li>
|
||||||
<li>
|
<li>
|
||||||
<a th:href="@{logout}">
|
<a th:href="@{logout}">
|
||||||
<i class="fa fa-sign-out"></i> 退出登录</a>
|
<i class="fa fa-sign-out"></i> 退出登录</a>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
</nav>
|
</nav>
|
||||||
</div>
|
</div>
|
||||||
<div class="row content-tabs">
|
<div class="row content-tabs">
|
||||||
<button class="roll-nav roll-left tabLeft">
|
<button class="roll-nav roll-left tabLeft">
|
||||||
<i class="fa fa-backward"></i>
|
<i class="fa fa-backward"></i>
|
||||||
</button>
|
</button>
|
||||||
<nav class="page-tabs menuTabs">
|
<nav class="page-tabs menuTabs">
|
||||||
<div class="page-tabs-content">
|
<div class="page-tabs-content">
|
||||||
<a href="javascript:;" class="active menuTab" th:data-id="@{/system/main}">首页</a>
|
<a href="javascript:;" class="active menuTab" th:data-id="@{/system/main}">首页</a>
|
||||||
</div>
|
</div>
|
||||||
</nav>
|
</nav>
|
||||||
<button class="roll-nav roll-right tabRight">
|
<button class="roll-nav roll-right tabRight">
|
||||||
<i class="fa fa-forward"></i>
|
<i class="fa fa-forward"></i>
|
||||||
</button>
|
</button>
|
||||||
<a href="javascript:void(0);" class="roll-nav roll-right tabReload"><i class="fa fa-refresh"></i> 刷新</a>
|
<a href="javascript:void(0);" class="roll-nav roll-right tabReload"><i class="fa fa-refresh"></i> 刷新</a>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<a id="ax_close_max" class="ax_close_max" href="#" title="关闭全屏"> <i class="fa fa-times-circle-o"></i> </a>
|
<a id="ax_close_max" class="ax_close_max" href="#" title="关闭全屏"> <i class="fa fa-times-circle-o"></i> </a>
|
||||||
|
|
||||||
<div class="row mainContent" id="content-main" th:style="${!ignoreFooter} ? |height: calc(100% - 91px)|">
|
<div class="row mainContent" id="content-main" th:style="${!ignoreFooter} ? |height: calc(100% - 91px)|">
|
||||||
<iframe class="RuoYi_iframe" name="iframe0" width="100%" height="100%" th:data-id="@{/system/main}"
|
<iframe class="RuoYi_iframe" name="iframe0" width="100%" height="100%" th:data-id="@{/system/main}"
|
||||||
th:src="@{/system/main}" frameborder="0" seamless></iframe>
|
th:src="@{/system/main}" frameborder="0" seamless></iframe>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div th:if="${ignoreFooter}" class="footer">
|
<div th:if="${ignoreFooter}" class="footer">
|
||||||
<div class="pull-right">© [[${copyrightYear}]] RuoYi Copyright </div>
|
<div class="pull-right">© [[${copyrightYear}]] RuoYi Copyright </div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<!--右侧部分结束-->
|
<!--右侧部分结束-->
|
||||||
</div>
|
</div>
|
||||||
<!-- 全局js -->
|
<!-- 全局js -->
|
||||||
<script th:src="@{/js/jquery.min.js}"></script>
|
<script th:src="@{/js/jquery.min.js}"></script>
|
||||||
<script th:src="@{/js/bootstrap.min.js}"></script>
|
<script th:src="@{/js/bootstrap.min.js}"></script>
|
||||||
<script th:src="@{/js/plugins/metisMenu/jquery.metisMenu.js}"></script>
|
<script th:src="@{/js/plugins/metisMenu/jquery.metisMenu.js}"></script>
|
||||||
<script th:src="@{/js/plugins/slimscroll/jquery.slimscroll.min.js}"></script>
|
<script th:src="@{/js/plugins/slimscroll/jquery.slimscroll.min.js}"></script>
|
||||||
<script th:src="@{/js/jquery.contextMenu.min.js}"></script>
|
<script th:src="@{/js/jquery.contextMenu.min.js}"></script>
|
||||||
<script th:src="@{/ajax/libs/blockUI/jquery.blockUI.js}"></script>
|
<script th:src="@{/ajax/libs/blockUI/jquery.blockUI.js}"></script>
|
||||||
<script th:src="@{/ajax/libs/layer/layer.min.js}"></script>
|
<script th:src="@{/ajax/libs/layer/layer.min.js}"></script>
|
||||||
<script th:src="@{/ruoyi/js/ry-ui.js?v=4.4.0}"></script>
|
<script th:src="@{/ruoyi/js/ry-ui.js?v=4.4.0}"></script>
|
||||||
<script th:src="@{/ruoyi/js/common.js?v=4.4.0}"></script>
|
<script th:src="@{/ruoyi/js/common.js?v=4.4.0}"></script>
|
||||||
<script th:src="@{/ruoyi/index.js}"></script>
|
<script th:src="@{/ruoyi/index.js}"></script>
|
||||||
<script th:src="@{/ajax/libs/fullscreen/jquery.fullscreen.js}"></script>
|
<script th:src="@{/ajax/libs/fullscreen/jquery.fullscreen.js}"></script>
|
||||||
<script th:inline="javascript">
|
<script th:inline="javascript">
|
||||||
var ctx = [[@{/}]];
|
var ctx = [[@{/}]];
|
||||||
// 皮肤缓存
|
// 皮肤缓存
|
||||||
var skin = storage.get("skin");
|
var skin = storage.get("skin");
|
||||||
// history(表示去掉地址的#)否则地址以"#"形式展示
|
// history(表示去掉地址的#)否则地址以"#"形式展示
|
||||||
var mode = "history";
|
var mode = "history";
|
||||||
// 历史访问路径缓存
|
// 历史访问路径缓存
|
||||||
var historyPath = storage.get("historyPath");
|
var historyPath = storage.get("historyPath");
|
||||||
// 是否页签与菜单联动
|
// 是否页签与菜单联动
|
||||||
var isLinkage = true;
|
var isLinkage = true;
|
||||||
|
|
||||||
// 本地主题优先,未设置取系统配置
|
// 本地主题优先,未设置取系统配置
|
||||||
if($.common.isNotEmpty(skin)){
|
if($.common.isNotEmpty(skin)){
|
||||||
$("body").addClass(skin.split('|')[0]);
|
$("body").addClass(skin.split('|')[0]);
|
||||||
$("body").addClass(skin.split('|')[1]);
|
$("body").addClass(skin.split('|')[1]);
|
||||||
} else {
|
} else {
|
||||||
$("body").addClass([[${sideTheme}]]);
|
$("body").addClass([[${sideTheme}]]);
|
||||||
$("body").addClass([[${skinName}]]);
|
$("body").addClass([[${skinName}]]);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* 用户管理-重置密码 */
|
/* 用户管理-重置密码 */
|
||||||
function resetPwd() {
|
function resetPwd() {
|
||||||
var url = ctx + 'system/user/profile/resetPwd';
|
var url = ctx + 'system/user/profile/resetPwd';
|
||||||
$.modal.open("重置密码", url, '770', '380');
|
$.modal.open("重置密码", url, '770', '380');
|
||||||
}
|
}
|
||||||
|
|
||||||
/* 切换主题 */
|
/* 切换主题 */
|
||||||
function switchSkin() {
|
function switchSkin() {
|
||||||
layer.open({
|
layer.open({
|
||||||
type : 2,
|
type : 2,
|
||||||
shadeClose : true,
|
shadeClose : true,
|
||||||
title : "切换主题",
|
title : "切换主题",
|
||||||
area : ["530px", "386px"],
|
area : ["530px", "386px"],
|
||||||
content : [ctx + "system/switchSkin", 'no']
|
content : [ctx + "system/switchSkin", 'no']
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
/* 切换菜单 */
|
/* 切换菜单 */
|
||||||
function toggleMenu() {
|
function toggleMenu() {
|
||||||
$.modal.confirm("确认要切换成横向菜单吗?", function() {
|
$.modal.confirm("确认要切换成横向菜单吗?", function() {
|
||||||
$.get(ctx + 'system/menuStyle/topnav', function(result) {
|
$.get(ctx + 'system/menuStyle/topnav', function(result) {
|
||||||
window.location.reload();
|
window.location.reload();
|
||||||
});
|
});
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 刷新时访问路径页签 */
|
/** 刷新时访问路径页签 */
|
||||||
function applyPath(url) {
|
function applyPath(url) {
|
||||||
$('a[href$="' + decodeURI(url) + '"]').click();
|
$('a[href$="' + decodeURI(url) + '"]').click();
|
||||||
if (!$('a[href$="' + url + '"]').hasClass("noactive")) {
|
if (!$('a[href$="' + url + '"]').hasClass("noactive")) {
|
||||||
$('a[href$="' + url + '"]').parent("li").addClass("selected").parents("li").addClass("active").end().parents("ul").addClass("in");
|
$('a[href$="' + url + '"]').parent("li").addClass("selected").parents("li").addClass("active").end().parents("ul").addClass("in");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$(function() {
|
$(function() {
|
||||||
if($.common.equals("history", mode) && window.performance.navigation.type == 1) {
|
if($.common.equals("history", mode) && window.performance.navigation.type == 1) {
|
||||||
var url = storage.get('publicPath');
|
var url = storage.get('publicPath');
|
||||||
if ($.common.isNotEmpty(url)) {
|
if ($.common.isNotEmpty(url)) {
|
||||||
applyPath(url);
|
applyPath(url);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
var hash = location.hash;
|
var hash = location.hash;
|
||||||
if ($.common.isNotEmpty(hash)) {
|
if ($.common.isNotEmpty(hash)) {
|
||||||
var url = hash.substring(1, hash.length);
|
var url = hash.substring(1, hash.length);
|
||||||
applyPath(url);
|
applyPath(url);
|
||||||
} else {
|
} else {
|
||||||
if($.common.equals("history", mode)) {
|
if($.common.equals("history", mode)) {
|
||||||
storage.set('publicPath', "");
|
storage.set('publicPath', "");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|
|
||||||
|
|
@ -1,128 +1,128 @@
|
||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
|
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
|
||||||
<head>
|
<head>
|
||||||
<th:block th:include="include :: header('新增部门')" />
|
<th:block th:include="include :: header('新增部门')" />
|
||||||
</head>
|
</head>
|
||||||
<body class="white-bg">
|
<body class="white-bg">
|
||||||
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
|
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
|
||||||
<form class="form-horizontal m" id="form-dept-add">
|
<form class="form-horizontal m" id="form-dept-add">
|
||||||
<input id="treeId" name="parentId" type="hidden" th:value="${dept.deptId}" />
|
<input id="treeId" name="parent" type="hidden" th:value="${dept.deptId}" />
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label class="col-sm-3 control-label">上级部门:</label>
|
<label class="col-sm-3 control-label">上级部门:</label>
|
||||||
<div class="col-sm-8">
|
<div class="col-sm-8">
|
||||||
<div class="input-group">
|
<div class="input-group">
|
||||||
<input class="form-control" type="text" onclick="selectDeptTree()" id="treeName" readonly="true" th:value="${dept.deptName}">
|
<input class="form-control" type="text" onclick="selectDeptTree()" id="treeName" readonly="true" th:value="${dept.deptName}">
|
||||||
<span class="input-group-addon"><i class="fa fa-search"></i></span>
|
<span class="input-group-addon"><i class="fa fa-search"></i></span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label class="col-sm-3 control-label is-required">部门名称:</label>
|
<label class="col-sm-3 control-label is-required">部门名称:</label>
|
||||||
<div class="col-sm-8">
|
<div class="col-sm-8">
|
||||||
<input class="form-control" type="text" name="deptName" id="deptName" required>
|
<input class="form-control" type="text" name="deptName" id="deptName" required>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label class="col-sm-3 control-label is-required">显示排序:</label>
|
<label class="col-sm-3 control-label is-required">显示排序:</label>
|
||||||
<div class="col-sm-8">
|
<div class="col-sm-8">
|
||||||
<input class="form-control" type="text" name="orderNum" required>
|
<input class="form-control" type="text" name="orderNum" required>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label class="col-sm-3 control-label">负责人:</label>
|
<label class="col-sm-3 control-label">负责人:</label>
|
||||||
<div class="col-sm-8">
|
<div class="col-sm-8">
|
||||||
<input class="form-control" type="text" name="leader">
|
<input class="form-control" type="text" name="leader">
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label class="col-sm-3 control-label">联系电话:</label>
|
<label class="col-sm-3 control-label">联系电话:</label>
|
||||||
<div class="col-sm-8">
|
<div class="col-sm-8">
|
||||||
<input class="form-control" type="text" name="phone">
|
<input class="form-control" type="text" name="phone">
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label class="col-sm-3 control-label">邮箱:</label>
|
<label class="col-sm-3 control-label">邮箱:</label>
|
||||||
<div class="col-sm-8">
|
<div class="col-sm-8">
|
||||||
<input class="form-control" type="text" name="email">
|
<input class="form-control" type="text" name="email">
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label class="col-sm-3 control-label">部门状态:</label>
|
<label class="col-sm-3 control-label">部门状态:</label>
|
||||||
<div class="col-sm-8">
|
<div class="col-sm-8">
|
||||||
<div class="radio-box" th:each="dict : ${@dict.getType('sys_normal_disable')}">
|
<div class="radio-box" th:each="dict : ${@dict.getType('sys_normal_disable')}">
|
||||||
<input type="radio" th:id="${dict.dictCode}" name="status" th:value="${dict.dictValue}" th:checked="${dict.default}">
|
<input type="radio" th:id="${dict.dictCode}" name="status" th:value="${dict.dictValue}" th:checked="${dict.default}">
|
||||||
<label th:for="${dict.dictCode}" th:text="${dict.dictLabel}"></label>
|
<label th:for="${dict.dictCode}" th:text="${dict.dictLabel}"></label>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
<th:block th:include="include :: footer" />
|
<th:block th:include="include :: footer" />
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
var prefix = ctx + "system/dept";
|
var prefix = ctx + "system/dept";
|
||||||
|
|
||||||
$("#form-dept-add").validate({
|
$("#form-dept-add").validate({
|
||||||
onkeyup: false,
|
onkeyup: false,
|
||||||
rules:{
|
rules:{
|
||||||
deptName:{
|
deptName:{
|
||||||
remote: {
|
remote: {
|
||||||
url: prefix + "/checkDeptNameUnique",
|
url: prefix + "/checkDeptNameUnique",
|
||||||
type: "post",
|
type: "post",
|
||||||
dataType: "json",
|
dataType: "json",
|
||||||
data: {
|
data: {
|
||||||
"parentId": function() {
|
"parentId": function() {
|
||||||
return $("input[name='parentId']").val();
|
return $("input[name='parentId']").val();
|
||||||
},
|
},
|
||||||
"deptName" : function() {
|
"deptName" : function() {
|
||||||
return $.common.trim($("#deptName").val());
|
return $.common.trim($("#deptName").val());
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
dataFilter: function(data, type) {
|
dataFilter: function(data, type) {
|
||||||
return $.validate.unique(data);
|
return $.validate.unique(data);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
orderNum:{
|
orderNum:{
|
||||||
digits:true
|
digits:true
|
||||||
},
|
},
|
||||||
email:{
|
email:{
|
||||||
email:true,
|
email:true,
|
||||||
},
|
},
|
||||||
phone:{
|
phone:{
|
||||||
isPhone:true,
|
isPhone:true,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
messages: {
|
messages: {
|
||||||
"deptName": {
|
"deptName": {
|
||||||
remote: "部门已经存在"
|
remote: "部门已经存在"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
focusCleanup: true
|
focusCleanup: true
|
||||||
});
|
});
|
||||||
|
|
||||||
function submitHandler() {
|
function submitHandler() {
|
||||||
if ($.validate.form()) {
|
if ($.validate.form()) {
|
||||||
$.operate.save(prefix + "/add", $('#form-dept-add').serialize());
|
$.operate.save(prefix + "/add", $('#form-dept-add').serialize());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*部门管理-新增-选择父部门树*/
|
/*部门管理-新增-选择父部门树*/
|
||||||
function selectDeptTree() {
|
function selectDeptTree() {
|
||||||
var options = {
|
var options = {
|
||||||
title: '部门选择',
|
title: '部门选择',
|
||||||
width: "380",
|
width: "380",
|
||||||
url: prefix + "/selectDeptTree/" + $("#treeId").val(),
|
url: prefix + "/selectDeptTree/" + $("#treeId").val(),
|
||||||
callBack: doSubmit
|
callBack: doSubmit
|
||||||
};
|
};
|
||||||
$.modal.openOptions(options);
|
$.modal.openOptions(options);
|
||||||
}
|
}
|
||||||
|
|
||||||
function doSubmit(index, layero){
|
function doSubmit(index, layero){
|
||||||
var body = layer.getChildFrame('body', index);
|
var body = layer.getChildFrame('body', index);
|
||||||
$("#treeId").val(body.find('#treeId').val());
|
$("#treeId").val(body.find('#treeId').val());
|
||||||
$("#treeName").val(body.find('#treeName').val());
|
$("#treeName").val(body.find('#treeName').val());
|
||||||
layer.close(index);
|
layer.close(index);
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|
|
||||||
|
|
@ -1,112 +1,112 @@
|
||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
|
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
|
||||||
<head>
|
<head>
|
||||||
<th:block th:include="include :: header('部门列表')" />
|
<th:block th:include="include :: header('部门列表')" />
|
||||||
</head>
|
</head>
|
||||||
<body class="gray-bg">
|
<body class="gray-bg">
|
||||||
<div class="container-div">
|
<div class="container-div">
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-sm-12 search-collapse">
|
<div class="col-sm-12 search-collapse">
|
||||||
<form id="dept-form">
|
<form id="dept-form">
|
||||||
<div class="select-list">
|
<div class="select-list">
|
||||||
<ul>
|
<ul>
|
||||||
<li>
|
<li>
|
||||||
部门名称:<input type="text" name="deptName"/>
|
部门名称:<input type="text" name="deptName"/>
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
部门状态:<select name="status" th:with="type=${@dict.getType('sys_normal_disable')}">
|
部门状态:<select name="status" th:with="type=${@dict.getType('sys_normal_disable')}">
|
||||||
<option value="">所有</option>
|
<option value="">所有</option>
|
||||||
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
|
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
|
||||||
</select>
|
</select>
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
<a class="btn btn-primary btn-rounded btn-sm" onclick="$.treeTable.search()"><i class="fa fa-search"></i> 搜索</a>
|
<a class="btn btn-primary btn-rounded btn-sm" onclick="$.treeTable.search()"><i class="fa fa-search"></i> 搜索</a>
|
||||||
<a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i> 重置</a>
|
<a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i> 重置</a>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="btn-group-sm" id="toolbar" role="group">
|
<div class="btn-group-sm" id="toolbar" role="group">
|
||||||
<a class="btn btn-success" onclick="$.operate.add(100)" shiro:hasPermission="system:dept:add">
|
<a class="btn btn-success" onclick="$.operate.add(1)" shiro:hasPermission="system:dept:add">
|
||||||
<i class="fa fa-plus"></i> 新增
|
<i class="fa fa-plus"></i> 新增
|
||||||
</a>
|
</a>
|
||||||
<a class="btn btn-primary" onclick="$.operate.edit()" shiro:hasPermission="system:dept:edit">
|
<a class="btn btn-primary" onclick="$.operate.edit()" shiro:hasPermission="system:dept:edit">
|
||||||
<i class="fa fa-edit"></i> 修改
|
<i class="fa fa-edit"></i> 修改
|
||||||
</a>
|
</a>
|
||||||
<a class="btn btn-info" id="expandAllBtn">
|
<a class="btn btn-info" id="expandAllBtn">
|
||||||
<i class="fa fa-exchange"></i> 展开/折叠
|
<i class="fa fa-exchange"></i> 展开/折叠
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-sm-12 select-table table-striped">
|
<div class="col-sm-12 select-table table-striped">
|
||||||
<table id="bootstrap-tree-table"></table>
|
<table id="bootstrap-tree-table"></table>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<th:block th:include="include :: footer" />
|
<th:block th:include="include :: footer" />
|
||||||
<script th:inline="javascript">
|
<script th:inline="javascript">
|
||||||
var addFlag = [[${@permission.hasPermi('system:dept:add')}]];
|
var addFlag = [[${@permission.hasPermi('system:dept:add')}]];
|
||||||
var editFlag = [[${@permission.hasPermi('system:dept:edit')}]];
|
var editFlag = [[${@permission.hasPermi('system:dept:edit')}]];
|
||||||
var removeFlag = [[${@permission.hasPermi('system:dept:remove')}]];
|
var removeFlag = [[${@permission.hasPermi('system:dept:remove')}]];
|
||||||
var datas = [[${@dict.getType('sys_normal_disable')}]];
|
var datas = [[${@dict.getType('sys_normal_disable')}]];
|
||||||
var prefix = ctx + "system/dept"
|
var prefix = ctx + "system/dept";
|
||||||
|
$(function() {
|
||||||
$(function() {
|
var options = {
|
||||||
var options = {
|
code: "deptId",
|
||||||
code: "deptId",
|
parentCode: "parentId",
|
||||||
parentCode: "parentId",
|
uniqueId: "deptId",
|
||||||
uniqueId: "deptId",
|
rootIdValue: null,
|
||||||
url: prefix + "/list",
|
url: prefix + "/list",
|
||||||
createUrl: prefix + "/add/{id}",
|
createUrl: prefix + "/add/{id}",
|
||||||
updateUrl: prefix + "/edit/{id}",
|
updateUrl: prefix + "/edit/{id}",
|
||||||
removeUrl: prefix + "/remove/{id}",
|
removeUrl: prefix + "/remove/{id}",
|
||||||
modalName: "部门",
|
modalName: "部门",
|
||||||
columns: [{
|
columns: [{
|
||||||
field: 'selectItem',
|
field: 'selectItem',
|
||||||
radio: true
|
radio: true
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
field: 'deptName',
|
field: 'deptName',
|
||||||
title: '部门名称',
|
title: '部门名称',
|
||||||
align: "left"
|
align: "left"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
field: 'orderNum',
|
field: 'orderNum',
|
||||||
title: '排序',
|
title: '排序',
|
||||||
align: "left"
|
align: "left"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
field: 'status',
|
field: 'status',
|
||||||
title: '状态',
|
title: '状态',
|
||||||
align: "left",
|
align: "left",
|
||||||
formatter: function(value, item, index) {
|
formatter: function(value, item, index) {
|
||||||
return $.table.selectDictLabel(datas, item.status);
|
return $.table.selectDictLabel(datas, item.status);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
field: 'createTime',
|
field: 'createTime',
|
||||||
title: '创建时间',
|
title: '创建时间',
|
||||||
align: "left"
|
align: "left"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '操作',
|
title: '操作',
|
||||||
align: 'left',
|
align: 'left',
|
||||||
formatter: function(value, row, index) {
|
formatter: function(value, row, index) {
|
||||||
if (row.parentId != 0) {
|
if (row.parentId != 0) {
|
||||||
var actions = [];
|
var actions = [];
|
||||||
actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="$.operate.edit(\'' + row.deptId + '\')"><i class="fa fa-edit"></i>编辑</a> ');
|
actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="$.operate.edit(\'' + row.deptId + '\')"><i class="fa fa-edit"></i>编辑</a> ');
|
||||||
actions.push('<a class="btn btn-info btn-xs ' + addFlag + '" href="javascript:void(0)" onclick="$.operate.add(\'' + row.deptId + '\')"><i class="fa fa-plus"></i>新增</a> ');
|
actions.push('<a class="btn btn-info btn-xs ' + addFlag + '" href="javascript:void(0)" onclick="$.operate.add(\'' + row.deptId + '\')"><i class="fa fa-plus"></i>新增</a> ');
|
||||||
actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="javascript:void(0)" onclick="$.operate.remove(\'' + row.deptId + '\')"><i class="fa fa-trash"></i>删除</a>');
|
actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="javascript:void(0)" onclick="$.operate.remove(\'' + row.deptId + '\')"><i class="fa fa-trash"></i>删除</a>');
|
||||||
return actions.join('');
|
return actions.join('');
|
||||||
} else {
|
} else {
|
||||||
return "";
|
return "";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}]
|
}]
|
||||||
};
|
};
|
||||||
$.treeTable.init(options);
|
$.treeTable.init(options);
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|
@ -1,141 +1,141 @@
|
||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
|
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
|
||||||
<head>
|
<head>
|
||||||
<th:block th:include="include :: header('修改部门')" />
|
<th:block th:include="include :: header('修改部门')" />
|
||||||
</head>
|
</head>
|
||||||
<body class="white-bg">
|
<body class="white-bg">
|
||||||
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
|
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
|
||||||
<form class="form-horizontal m" id="form-dept-edit" th:object="${dept}">
|
<form class="form-horizontal m" id="form-dept-edit" th:object="${dept}">
|
||||||
<input name="deptId" type="hidden" th:field="*{deptId}" />
|
<input name="deptId" type="hidden" th:field="*{deptId}" />
|
||||||
<input id="treeId" name="parentId" type="hidden" th:field="*{parentId}" />
|
<input id="treeId" name="parent" type="hidden" th:field="*{parent.deptId}" />
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label class="col-sm-3 control-label">上级部门:</label>
|
<label class="col-sm-3 control-label">上级部门:</label>
|
||||||
<div class="col-sm-8">
|
<div class="col-sm-8">
|
||||||
<div class="input-group">
|
<div class="input-group">
|
||||||
<input class="form-control" type="text" id="treeName" onclick="selectDeptTree()" readonly="true" th:field="*{parentName}">
|
<input class="form-control" type="text" id="treeName" onclick="selectDeptTree()" readonly="true" th:field="*{parent.deptName}">
|
||||||
<span class="input-group-addon"><i class="fa fa-search"></i></span>
|
<span class="input-group-addon"><i class="fa fa-search"></i></span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label class="col-sm-3 control-label is-required">部门名称:</label>
|
<label class="col-sm-3 control-label is-required">部门名称:</label>
|
||||||
<div class="col-sm-8">
|
<div class="col-sm-8">
|
||||||
<input class="form-control" type="text" name="deptName" th:field="*{deptName}" id="deptName" required>
|
<input class="form-control" type="text" name="deptName" th:field="*{deptName}" id="deptName" required>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label class="col-sm-3 control-label is-required">显示排序:</label>
|
<label class="col-sm-3 control-label is-required">显示排序:</label>
|
||||||
<div class="col-sm-8">
|
<div class="col-sm-8">
|
||||||
<input class="form-control" type="text" name="orderNum" th:field="*{orderNum}" required>
|
<input class="form-control" type="text" name="orderNum" th:field="*{orderNum}" required>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label class="col-sm-3 control-label">负责人:</label>
|
<label class="col-sm-3 control-label">负责人:</label>
|
||||||
<div class="col-sm-8">
|
<div class="col-sm-8">
|
||||||
<input class="form-control" type="text" name="leader" th:field="*{leader}">
|
<input class="form-control" type="text" name="leader" th:field="*{leader}">
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label class="col-sm-3 control-label">联系电话:</label>
|
<label class="col-sm-3 control-label">联系电话:</label>
|
||||||
<div class="col-sm-8">
|
<div class="col-sm-8">
|
||||||
<input class="form-control" type="text" name="phone" th:field="*{phone}">
|
<input class="form-control" type="text" name="phone" th:field="*{phone}">
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label class="col-sm-3 control-label">邮箱:</label>
|
<label class="col-sm-3 control-label">邮箱:</label>
|
||||||
<div class="col-sm-8">
|
<div class="col-sm-8">
|
||||||
<input class="form-control" type="text" name="email" th:field="*{email}">
|
<input class="form-control" type="text" name="email" th:field="*{email}">
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label class="col-sm-3 control-label">部门状态:</label>
|
<label class="col-sm-3 control-label">部门状态:</label>
|
||||||
<div class="col-sm-8">
|
<div class="col-sm-8">
|
||||||
<div class="radio-box" th:each="dict : ${@dict.getType('sys_normal_disable')}">
|
<div class="radio-box" th:each="dict : ${@dict.getType('sys_normal_disable')}">
|
||||||
<input type="radio" th:id="${dict.dictCode}" name="status" th:value="${dict.dictValue}" th:field="*{status}">
|
<input type="radio" th:id="${dict.dictCode}" name="status" th:value="${dict.dictValue}" th:field="*{status}">
|
||||||
<label th:for="${dict.dictCode}" th:text="${dict.dictLabel}"></label>
|
<label th:for="${dict.dictCode}" th:text="${dict.dictLabel}"></label>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
<th:block th:include="include :: footer" />
|
<th:block th:include="include :: footer" />
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
var prefix = ctx + "system/dept";
|
var prefix = ctx + "system/dept";
|
||||||
|
|
||||||
$("#form-dept-edit").validate({
|
$("#form-dept-edit").validate({
|
||||||
onkeyup: false,
|
onkeyup: false,
|
||||||
rules:{
|
rules:{
|
||||||
deptName:{
|
deptName:{
|
||||||
remote: {
|
remote: {
|
||||||
url: prefix + "/checkDeptNameUnique",
|
url: prefix + "/checkDeptNameUnique",
|
||||||
type: "post",
|
type: "post",
|
||||||
dataType: "json",
|
dataType: "json",
|
||||||
data: {
|
data: {
|
||||||
"deptId": function() {
|
"deptId": function() {
|
||||||
return $("#deptId").val();
|
return $("#deptId").val();
|
||||||
},
|
},
|
||||||
"parentId": function() {
|
"parentId": function() {
|
||||||
return $("input[name='parentId']").val();
|
return $("input[name='parentId']").val();
|
||||||
},
|
},
|
||||||
"deptName": function() {
|
"deptName": function() {
|
||||||
return $.common.trim($("#deptName").val());
|
return $.common.trim($("#deptName").val());
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
dataFilter: function(data, type) {
|
dataFilter: function(data, type) {
|
||||||
return $.validate.unique(data);
|
return $.validate.unique(data);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
orderNum:{
|
orderNum:{
|
||||||
digits:true
|
digits:true
|
||||||
},
|
},
|
||||||
email:{
|
email:{
|
||||||
email:true,
|
email:true,
|
||||||
},
|
},
|
||||||
phone:{
|
phone:{
|
||||||
isPhone:true,
|
isPhone:true,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
messages: {
|
messages: {
|
||||||
"deptName": {
|
"deptName": {
|
||||||
remote: "部门已经存在"
|
remote: "部门已经存在"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
focusCleanup: true
|
focusCleanup: true
|
||||||
});
|
});
|
||||||
|
|
||||||
function submitHandler() {
|
function submitHandler() {
|
||||||
if ($.validate.form()) {
|
if ($.validate.form()) {
|
||||||
$.operate.save(prefix + "/edit", $('#form-dept-edit').serialize());
|
$.operate.save(prefix + "/edit", $('#form-dept-edit').serialize());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*部门管理-修改-选择部门树*/
|
/*部门管理-修改-选择部门树*/
|
||||||
function selectDeptTree() {
|
function selectDeptTree() {
|
||||||
var deptId = $("#treeId").val();
|
var deptId = $("#treeId").val();
|
||||||
var excludeId = $("input[name='deptId']").val();
|
var excludeId = $("input[name='deptId']").val();
|
||||||
if(deptId > 0) {
|
if(deptId > 0) {
|
||||||
var options = {
|
var options = {
|
||||||
title: '部门选择',
|
title: '部门选择',
|
||||||
width: "380",
|
width: "380",
|
||||||
url: prefix + "/selectDeptTree/" + $("#treeId").val() + "/" + excludeId,
|
url: prefix + "/selectDeptTree/" + $("#treeId").val() + "/" + excludeId,
|
||||||
callBack: doSubmit
|
callBack: doSubmit
|
||||||
};
|
};
|
||||||
$.modal.openOptions(options);
|
$.modal.openOptions(options);
|
||||||
} else {
|
} else {
|
||||||
$.modal.alertError("父部门不能选择");
|
$.modal.alertError("父部门不能选择");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function doSubmit(index, layero){
|
function doSubmit(index, layero){
|
||||||
var tree = layero.find("iframe")[0].contentWindow.$._tree;
|
var tree = layero.find("iframe")[0].contentWindow.$._tree;
|
||||||
if ($.tree.notAllowLastLevel(tree)) {
|
if ($.tree.notAllowLastLevel(tree)) {
|
||||||
var body = layer.getChildFrame('body', index);
|
var body = layer.getChildFrame('body', index);
|
||||||
$("#treeId").val(body.find('#treeId').val());
|
$("#treeId").val(body.find('#treeId').val());
|
||||||
$("#treeName").val(body.find('#treeName').val());
|
$("#treeName").val(body.find('#treeName').val());
|
||||||
layer.close(index);
|
layer.close(index);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|
|
||||||
|
|
@ -1,159 +1,159 @@
|
||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
|
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
|
||||||
<head>
|
<head>
|
||||||
<th:block th:include="include :: header('修改角色')" />
|
<th:block th:include="include :: header('修改角色')" />
|
||||||
<th:block th:include="include :: ztree-css" />
|
<th:block th:include="include :: ztree-css" />
|
||||||
</head>
|
</head>
|
||||||
<body class="white-bg">
|
<body class="white-bg">
|
||||||
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
|
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
|
||||||
<form class="form-horizontal m" id="form-role-edit" th:object="${role}">
|
<form class="form-horizontal m" id="form-role-edit" th:object="${role}">
|
||||||
<input id="roleId" name="roleId" type="hidden" th:field="*{roleId}"/>
|
<input id="roleId" name="roleId" type="hidden" th:field="*{roleId}"/>
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label class="col-sm-3 control-label is-required">角色名称:</label>
|
<label class="col-sm-3 control-label is-required">角色名称:</label>
|
||||||
<div class="col-sm-8">
|
<div class="col-sm-8">
|
||||||
<input class="form-control" type="text" name="roleName" id="roleName" th:field="*{roleName}" required>
|
<input class="form-control" type="text" name="roleName" id="roleName" th:field="*{roleName}" required>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label class="col-sm-3 control-label is-required">权限字符:</label>
|
<label class="col-sm-3 control-label is-required">权限字符:</label>
|
||||||
<div class="col-sm-8">
|
<div class="col-sm-8">
|
||||||
<input class="form-control" type="text" name="roleKey" id="roleKey" th:field="*{roleKey}" required>
|
<input class="form-control" type="text" name="roleKey" id="roleKey" th:field="*{roleKey}" required>
|
||||||
<span class="help-block m-b-none"><i class="fa fa-info-circle"></i> 控制器中定义的权限字符,如:@RequiresRoles("")</span>
|
<span class="help-block m-b-none"><i class="fa fa-info-circle"></i> 控制器中定义的权限字符,如:@RequiresRoles("")</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label class="col-sm-3 control-label is-required">显示顺序:</label>
|
<label class="col-sm-3 control-label is-required">显示顺序:</label>
|
||||||
<div class="col-sm-8">
|
<div class="col-sm-8">
|
||||||
<input class="form-control" type="text" name="roleSort" id="roleSort" th:field="*{roleSort}" required>
|
<input class="form-control" type="text" name="roleSort" id="roleSort" th:field="*{roleSort}" required>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label class="col-sm-3 control-label">状态:</label>
|
<label class="col-sm-3 control-label">状态:</label>
|
||||||
<div class="col-sm-8">
|
<div class="col-sm-8">
|
||||||
<label class="toggle-switch switch-solid">
|
<label class="toggle-switch switch-solid">
|
||||||
<input type="checkbox" id="status" th:checked="${role.status == '0' ? true : false}">
|
<input type="checkbox" id="status" th:checked="${role.status == '0' ? true : false}">
|
||||||
<span></span>
|
<span></span>
|
||||||
</label>
|
</label>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label class="col-sm-3 control-label">备注:</label>
|
<label class="col-sm-3 control-label">备注:</label>
|
||||||
<div class="col-sm-8">
|
<div class="col-sm-8">
|
||||||
<input id="remark" name="remark" class="form-control" type="text" th:field="*{remark}">
|
<input id="remark" name="remark" class="form-control" type="text" th:field="*{remark}">
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label class="col-sm-3 control-label">菜单权限</label>
|
<label class="col-sm-3 control-label">菜单权限</label>
|
||||||
<div class="col-sm-8">
|
<div class="col-sm-8">
|
||||||
<div id="menuTrees" class="ztree"></div>
|
<div id="menuTrees" class="ztree"></div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
<th:block th:include="include :: footer" />
|
<th:block th:include="include :: footer" />
|
||||||
<th:block th:include="include :: ztree-js" />
|
<th:block th:include="include :: ztree-js" />
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
$(function() {
|
$(function() {
|
||||||
var url = ctx + "system/menu/roleMenuTreeData?roleId=" + $("#roleId").val();
|
var url = ctx + "system/menu/roleMenuTreeData?roleId=" + $("#roleId").val();
|
||||||
var options = {
|
var options = {
|
||||||
id: "menuTrees",
|
id: "menuTrees",
|
||||||
url: url,
|
url: url,
|
||||||
check: { enable: true },
|
check: { enable: true },
|
||||||
expandLevel: 0
|
expandLevel: 0
|
||||||
};
|
};
|
||||||
$.tree.init(options);
|
$.tree.init(options);
|
||||||
});
|
});
|
||||||
|
|
||||||
$("#form-role-edit").validate({
|
$("#form-role-edit").validate({
|
||||||
onkeyup: false,
|
onkeyup: false,
|
||||||
rules:{
|
rules:{
|
||||||
roleName:{
|
roleName:{
|
||||||
remote: {
|
remote: {
|
||||||
url: ctx + "system/role/checkRoleNameUnique",
|
url: ctx + "system/role/checkRoleNameUnique",
|
||||||
type: "post",
|
type: "post",
|
||||||
dataType: "json",
|
dataType: "json",
|
||||||
data: {
|
data: {
|
||||||
"roleId": function() {
|
"roleId": function() {
|
||||||
return $("#roleId").val();
|
return $("#roleId").val();
|
||||||
},
|
},
|
||||||
"roleName": function() {
|
"roleName": function() {
|
||||||
return $.common.trim($("#roleName").val());
|
return $.common.trim($("#roleName").val());
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
dataFilter: function(data, type) {
|
dataFilter: function(data, type) {
|
||||||
return $.validate.unique(data);
|
return $.validate.unique(data);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
roleKey:{
|
roleKey:{
|
||||||
remote: {
|
remote: {
|
||||||
url: ctx + "system/role/checkRoleKeyUnique",
|
url: ctx + "system/role/checkRoleKeyUnique",
|
||||||
type: "post",
|
type: "post",
|
||||||
dataType: "json",
|
dataType: "json",
|
||||||
data: {
|
data: {
|
||||||
"roleId": function() {
|
"roleId": function() {
|
||||||
return $("#roleId").val();
|
return $("#roleId").val();
|
||||||
},
|
},
|
||||||
"roleKey": function() {
|
"roleKey": function() {
|
||||||
return $.common.trim($("#roleKey").val());
|
return $.common.trim($("#roleKey").val());
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
dataFilter: function(data, type) {
|
dataFilter: function(data, type) {
|
||||||
return $.validate.unique(data);
|
return $.validate.unique(data);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
roleSort:{
|
roleSort:{
|
||||||
digits:true
|
digits:true
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
messages: {
|
messages: {
|
||||||
"roleName": {
|
"roleName": {
|
||||||
remote: "角色名称已经存在"
|
remote: "角色名称已经存在"
|
||||||
},
|
},
|
||||||
"roleKey": {
|
"roleKey": {
|
||||||
remote: "角色权限已经存在"
|
remote: "角色权限已经存在"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
focusCleanup: true
|
focusCleanup: true
|
||||||
});
|
});
|
||||||
|
|
||||||
function edit() {
|
function edit() {
|
||||||
var roleId = $("input[name='roleId']").val();
|
var roleId = $("input[name='roleId']").val();
|
||||||
var roleName = $("input[name='roleName']").val();
|
var roleName = $("input[name='roleName']").val();
|
||||||
var roleKey = $("input[name='roleKey']").val();
|
var roleKey = $("input[name='roleKey']").val();
|
||||||
var roleSort = $("input[name='roleSort']").val();
|
var roleSort = $("input[name='roleSort']").val();
|
||||||
var status = $("input[id='status']").is(':checked') == true ? 0 : 1;
|
var status = $("input[id='status']").is(':checked') == true ? 0 : 1;
|
||||||
var remark = $("input[name='remark']").val();
|
var remark = $("input[name='remark']").val();
|
||||||
var menuIds = $.tree.getCheckedNodes();
|
var menuIds = $.tree.getCheckedNodes();
|
||||||
$.ajax({
|
$.ajax({
|
||||||
cache : true,
|
cache : true,
|
||||||
type : "POST",
|
type : "POST",
|
||||||
url : ctx + "system/role/edit",
|
url : ctx + "system/role/edit",
|
||||||
data : {
|
data : {
|
||||||
"roleId": roleId,
|
"roleId": roleId,
|
||||||
"roleName": roleName,
|
"roleName": roleName,
|
||||||
"roleKey": roleKey,
|
"roleKey": roleKey,
|
||||||
"roleSort": roleSort,
|
"roleSort": roleSort,
|
||||||
"status": status,
|
"status": status,
|
||||||
"remark": remark,
|
"remark": remark,
|
||||||
"menuIds": menuIds
|
"menus": menuIds
|
||||||
},
|
},
|
||||||
async : false,
|
async : false,
|
||||||
error : function(request) {
|
error : function(request) {
|
||||||
$.modal.alertError("系统错误");
|
$.modal.alertError("系统错误");
|
||||||
},
|
},
|
||||||
success : function(data) {
|
success : function(data) {
|
||||||
$.operate.successCallback(data);
|
$.operate.successCallback(data);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function submitHandler() {
|
function submitHandler() {
|
||||||
if ($.validate.form()) {
|
if ($.validate.form()) {
|
||||||
edit();
|
edit();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|
|
||||||
|
|
@ -1,120 +1,120 @@
|
||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
|
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
|
||||||
<head>
|
<head>
|
||||||
<th:block th:include="include :: header('分配角色选择用户')" />
|
<th:block th:include="include :: header('分配角色选择用户')" />
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
<body class="gray-bg">
|
<body class="gray-bg">
|
||||||
<div class="container-div">
|
<div class="container-div">
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-sm-12 search-collapse">
|
<div class="col-sm-12 search-collapse">
|
||||||
<form id="role-form">
|
<form id="role-form">
|
||||||
<input type="hidden" id="roleId" name="roleId" th:value="${role.roleId}">
|
<input type="hidden" id="roleId" name="roleId" th:value="${role.roleId}">
|
||||||
<div class="select-list">
|
<div class="select-list">
|
||||||
<ul>
|
<ul>
|
||||||
<li>
|
<li>
|
||||||
登录名称:<input type="text" name="loginName"/>
|
登录名称:<input type="text" name="loginName"/>
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
手机号码:<input type="text" name="phonenumber"/>
|
手机号码:<input type="text" name="phonenumber"/>
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
<a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i> 搜索</a>
|
<a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i> 搜索</a>
|
||||||
<a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i> 重置</a>
|
<a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i> 重置</a>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="col-sm-12 select-table table-striped">
|
<div class="col-sm-12 select-table table-striped">
|
||||||
<table id="bootstrap-table"></table>
|
<table id="bootstrap-table"></table>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<th:block th:include="include :: footer" />
|
<th:block th:include="include :: footer" />
|
||||||
<script th:inline="javascript">
|
<script th:inline="javascript">
|
||||||
var datas = [[${@dict.getType('sys_normal_disable')}]];
|
var datas = [[${@dict.getType('sys_normal_disable')}]];
|
||||||
var prefix = ctx + "system/role/authUser";
|
var prefix = ctx + "system/role/authUser";
|
||||||
|
|
||||||
$(function() {
|
$(function() {
|
||||||
var options = {
|
var options = {
|
||||||
url: prefix + "/unallocatedList",
|
url: prefix + "/unallocatedList",
|
||||||
createUrl: prefix + "/add",
|
createUrl: prefix + "/add",
|
||||||
updateUrl: prefix + "/edit/{id}",
|
updateUrl: prefix + "/edit/{id}",
|
||||||
removeUrl: prefix + "/remove",
|
removeUrl: prefix + "/remove",
|
||||||
exportUrl: prefix + "/export",
|
exportUrl: prefix + "/export",
|
||||||
importUrl: prefix + "/importData",
|
importUrl: prefix + "/importData",
|
||||||
importTemplateUrl: prefix + "/importTemplate",
|
importTemplateUrl: prefix + "/importTemplate",
|
||||||
queryParams: queryParams,
|
queryParams: queryParams,
|
||||||
sortName: "createTime",
|
sortName: "createTime",
|
||||||
sortOrder: "desc",
|
sortOrder: "desc",
|
||||||
modalName: "用户",
|
modalName: "用户",
|
||||||
showSearch: false,
|
showSearch: false,
|
||||||
showRefresh: false,
|
showRefresh: false,
|
||||||
showToggle: false,
|
showToggle: false,
|
||||||
showColumns: false,
|
showColumns: false,
|
||||||
clickToSelect: true,
|
clickToSelect: true,
|
||||||
rememberSelected: true,
|
rememberSelected: true,
|
||||||
columns: [{
|
columns: [{
|
||||||
field: 'state',
|
field: 'state',
|
||||||
checkbox: true
|
checkbox: true
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
field: 'userId',
|
field: 'userId',
|
||||||
title: '用户ID',
|
title: '用户ID',
|
||||||
visible: false
|
visible: false
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
field: 'loginName',
|
field: 'loginName',
|
||||||
title: '登录名称',
|
title: '登录名称',
|
||||||
sortable: true
|
sortable: true
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
field: 'userName',
|
field: 'userName',
|
||||||
title: '用户名称'
|
title: '用户名称'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
field: 'email',
|
field: 'email',
|
||||||
title: '邮箱'
|
title: '邮箱'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
field: 'phonenumber',
|
field: 'phonenumber',
|
||||||
title: '手机'
|
title: '手机'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
field: 'status',
|
field: 'status',
|
||||||
title: '用户状态',
|
title: '用户状态',
|
||||||
align: 'center',
|
align: 'center',
|
||||||
formatter: function (value, row, index) {
|
formatter: function (value, row, index) {
|
||||||
return $.table.selectDictLabel(datas, value);
|
return $.table.selectDictLabel(datas, value);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
field: 'createTime',
|
field: 'createTime',
|
||||||
title: '创建时间',
|
title: '创建时间',
|
||||||
sortable: true
|
sortable: true
|
||||||
}]
|
}]
|
||||||
};
|
};
|
||||||
$.table.init(options);
|
$.table.init(options);
|
||||||
});
|
});
|
||||||
|
|
||||||
function queryParams(params) {
|
function queryParams(params) {
|
||||||
var search = $.table.queryParams(params);
|
var search = $.table.queryParams(params);
|
||||||
search.roleId = $("#roleId").val();
|
search.roles = $("#roleId").val();
|
||||||
return search;
|
return search;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* 添加用户-选择用户-提交 */
|
/* 添加用户-选择用户-提交 */
|
||||||
function submitHandler() {
|
function submitHandler() {
|
||||||
var rows = $.table.selectFirstColumns();
|
var rows = $.table.selectFirstColumns();
|
||||||
if (rows.length == 0) {
|
if (rows.length == 0) {
|
||||||
$.modal.alertWarning("请至少选择一条记录");
|
$.modal.alertWarning("请至少选择一条记录");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
var data = { "roleId": $("#roleId").val(), "userIds": rows.join() };
|
var data = { "roleId": $("#roleId").val(), "userIds": rows.join() };
|
||||||
$.operate.save(prefix + "/selectAll", data);
|
$.operate.save(prefix + "/selectAll", data);
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|
@ -1,270 +1,270 @@
|
||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
|
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
|
||||||
<head>
|
<head>
|
||||||
<th:block th:include="include :: header('新增用户')" />
|
<th:block th:include="include :: header('新增用户')" />
|
||||||
<th:block th:include="include :: select2-css" />
|
<th:block th:include="include :: select2-css" />
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<div class="main-content">
|
<div class="main-content">
|
||||||
<form id="form-user-add" class="form-horizontal">
|
<form id="form-user-add" class="form-horizontal">
|
||||||
<input name="deptId" type="hidden" id="treeId"/>
|
<input name="deptId" type="hidden" id="treeId"/>
|
||||||
<h4 class="form-header h4">基本信息</h4>
|
<h4 class="form-header h4">基本信息</h4>
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-sm-6">
|
<div class="col-sm-6">
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label class="col-sm-4 control-label is-required">用户名称:</label>
|
<label class="col-sm-4 control-label is-required">用户名称:</label>
|
||||||
<div class="col-sm-8">
|
<div class="col-sm-8">
|
||||||
<input name="userName" placeholder="请输入用户名称" class="form-control" type="text" maxlength="30" required>
|
<input name="userName" placeholder="请输入用户名称" class="form-control" type="text" maxlength="30" required>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-sm-6">
|
<div class="col-sm-6">
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label class="col-sm-4 control-label is-required">归属部门:</label>
|
<label class="col-sm-4 control-label is-required">归属部门:</label>
|
||||||
<div class="col-sm-8">
|
<div class="col-sm-8">
|
||||||
<div class="input-group">
|
<div class="input-group">
|
||||||
<input name="deptName" onclick="selectDeptTree()" id="treeName" type="text" placeholder="请选择归属部门" class="form-control" required>
|
<input name="deptName" onclick="selectDeptTree()" id="treeName" type="text" placeholder="请选择归属部门" class="form-control" required>
|
||||||
<span class="input-group-addon"><i class="fa fa-search"></i></span>
|
<span class="input-group-addon"><i class="fa fa-search"></i></span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-sm-6">
|
<div class="col-sm-6">
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label class="col-sm-4 control-label is-required">手机号码:</label>
|
<label class="col-sm-4 control-label is-required">手机号码:</label>
|
||||||
<div class="col-sm-8">
|
<div class="col-sm-8">
|
||||||
<div class="input-group">
|
<div class="input-group">
|
||||||
<input id="phonenumber" name="phonenumber" placeholder="请输入手机号码" class="form-control" type="text" maxlength="11" required>
|
<input id="phonenumber" name="phonenumber" placeholder="请输入手机号码" class="form-control" type="text" maxlength="11" required>
|
||||||
<span class="input-group-addon"><i class="fa fa-mobile"></i></span>
|
<span class="input-group-addon"><i class="fa fa-mobile"></i></span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-sm-6">
|
<div class="col-sm-6">
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label class="col-sm-4 control-label is-required">邮箱:</label>
|
<label class="col-sm-4 control-label is-required">邮箱:</label>
|
||||||
<div class="col-sm-8">
|
<div class="col-sm-8">
|
||||||
<div class="input-group">
|
<div class="input-group">
|
||||||
<input id="email" name="email" class="form-control email" type="text" maxlength="50" placeholder="请输入邮箱" required>
|
<input id="email" name="email" class="form-control email" type="text" maxlength="50" placeholder="请输入邮箱" required>
|
||||||
<span class="input-group-addon"><i class="fa fa-envelope"></i></span>
|
<span class="input-group-addon"><i class="fa fa-envelope"></i></span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-sm-6">
|
<div class="col-sm-6">
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label class="col-sm-4 control-label is-required">登录账号:</label>
|
<label class="col-sm-4 control-label is-required">登录账号:</label>
|
||||||
<div class="col-sm-8">
|
<div class="col-sm-8">
|
||||||
<input id="loginName" name="loginName" placeholder="请输入登录账号" class="form-control" type="text" maxlength="30" required>
|
<input id="loginName" name="loginName" placeholder="请输入登录账号" class="form-control" type="text" maxlength="30" required>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-sm-6">
|
<div class="col-sm-6">
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label class="col-sm-4 control-label is-required">登录密码:</label>
|
<label class="col-sm-4 control-label is-required">登录密码:</label>
|
||||||
<div class="col-sm-8">
|
<div class="col-sm-8">
|
||||||
<div class="input-group">
|
<div class="input-group">
|
||||||
<input id="password" name="password" placeholder="请输入登录密码" class="form-control" type="password" th:value="${@config.getKey('sys.user.initPassword')}" required>
|
<input id="password" name="password" placeholder="请输入登录密码" class="form-control" type="password" th:value="${@config.getKey('sys.user.initPassword')}" required>
|
||||||
<span class="input-group-addon" title="登录密码,鼠标按下显示密码"
|
<span class="input-group-addon" title="登录密码,鼠标按下显示密码"
|
||||||
onmousedown="$('#password').attr('type','text')"
|
onmousedown="$('#password').attr('type','text')"
|
||||||
onmouseup="$('#password').attr('type','password')"><i class="fa fa-key"></i></span>
|
onmouseup="$('#password').attr('type','password')"><i class="fa fa-key"></i></span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-sm-6">
|
<div class="col-sm-6">
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label class="col-sm-4 control-label">用户性别:</label>
|
<label class="col-sm-4 control-label">用户性别:</label>
|
||||||
<div class="col-sm-8">
|
<div class="col-sm-8">
|
||||||
<select name="sex" class="form-control m-b" th:with="type=${@dict.getType('sys_user_sex')}">
|
<select name="sex" class="form-control m-b" th:with="type=${@dict.getType('sys_user_sex')}">
|
||||||
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
|
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-sm-6">
|
<div class="col-sm-6">
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label class="col-sm-4 control-label">用户状态:</label>
|
<label class="col-sm-4 control-label">用户状态:</label>
|
||||||
<div class="col-sm-8">
|
<div class="col-sm-8">
|
||||||
<label class="toggle-switch switch-solid">
|
<label class="toggle-switch switch-solid">
|
||||||
<input type="checkbox" id="status" checked>
|
<input type="checkbox" id="status" checked>
|
||||||
<span></span>
|
<span></span>
|
||||||
</label>
|
</label>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-sm-12">
|
<div class="col-sm-12">
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label class="col-xs-2 control-label">岗位:</label>
|
<label class="col-xs-2 control-label">岗位:</label>
|
||||||
<div class="col-xs-4">
|
<div class="col-xs-4">
|
||||||
<select id="post" class="form-control select2-multiple" multiple>
|
<select id="post" class="form-control select2-multiple" multiple>
|
||||||
<option th:each="post:${posts}" th:value="${post.postId}" th:text="${post.postName}" th:disabled="${post.status == '1'}"></option>
|
<option th:each="post:${posts}" th:value="${post.postId}" th:text="${post.postName}" th:disabled="${post.status == '1'}"></option>
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-sm-12">
|
<div class="col-sm-12">
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label class="col-xs-2 control-label">角色:</label>
|
<label class="col-xs-2 control-label">角色:</label>
|
||||||
<div class="col-xs-10">
|
<div class="col-xs-10">
|
||||||
<label th:each="role:${roles}" class="check-box">
|
<label th:each="role:${roles}" class="check-box">
|
||||||
<input name="role" type="checkbox" th:value="${role.roleId}" th:text="${role.roleName}" th:disabled="${role.status == '1'}">
|
<input name="role" type="checkbox" th:value="${role.roleId}" th:text="${role.roleName}" th:disabled="${role.status == '1'}">
|
||||||
</label>
|
</label>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<h4 class="form-header h4">其他信息</h4>
|
<h4 class="form-header h4">其他信息</h4>
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-sm-12">
|
<div class="col-sm-12">
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label class="col-xs-2 control-label">备注:</label>
|
<label class="col-xs-2 control-label">备注:</label>
|
||||||
<div class="col-xs-10">
|
<div class="col-xs-10">
|
||||||
<textarea name="remark" maxlength="500" class="form-control" rows="3"></textarea>
|
<textarea name="remark" maxlength="500" class="form-control" rows="3"></textarea>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-sm-offset-5 col-sm-10">
|
<div class="col-sm-offset-5 col-sm-10">
|
||||||
<button type="button" class="btn btn-sm btn-primary" onclick="submitHandler()"><i class="fa fa-check"></i>保 存</button>
|
<button type="button" class="btn btn-sm btn-primary" onclick="submitHandler()"><i class="fa fa-check"></i>保 存</button>
|
||||||
<button type="button" class="btn btn-sm btn-danger" onclick="closeItem()"><i class="fa fa-reply-all"></i>关 闭 </button>
|
<button type="button" class="btn btn-sm btn-danger" onclick="closeItem()"><i class="fa fa-reply-all"></i>关 闭 </button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<th:block th:include="include :: footer" />
|
<th:block th:include="include :: footer" />
|
||||||
<th:block th:include="include :: select2-js" />
|
<th:block th:include="include :: select2-js" />
|
||||||
<script>
|
<script>
|
||||||
var prefix = ctx + "system/user";
|
var prefix = ctx + "system/user";
|
||||||
|
|
||||||
$("#form-user-add").validate({
|
$("#form-user-add").validate({
|
||||||
onkeyup: false,
|
onkeyup: false,
|
||||||
rules:{
|
rules:{
|
||||||
loginName:{
|
loginName:{
|
||||||
minlength: 2,
|
minlength: 2,
|
||||||
maxlength: 20,
|
maxlength: 20,
|
||||||
remote: {
|
remote: {
|
||||||
url: prefix + "/checkLoginNameUnique",
|
url: prefix + "/checkLoginNameUnique",
|
||||||
type: "post",
|
type: "post",
|
||||||
dataType: "json",
|
dataType: "json",
|
||||||
data: {
|
data: {
|
||||||
"loginName": function() {
|
"loginName": function() {
|
||||||
return $.common.trim($("#loginName").val());
|
return $.common.trim($("#loginName").val());
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
dataFilter: function(data, type) {
|
dataFilter: function(data, type) {
|
||||||
return $.validate.unique(data);
|
return $.validate.unique(data);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
password:{
|
password:{
|
||||||
minlength: 5,
|
minlength: 5,
|
||||||
maxlength: 20
|
maxlength: 20
|
||||||
},
|
},
|
||||||
email:{
|
email:{
|
||||||
email:true,
|
email:true,
|
||||||
remote: {
|
remote: {
|
||||||
url: prefix + "/checkEmailUnique",
|
url: prefix + "/checkEmailUnique",
|
||||||
type: "post",
|
type: "post",
|
||||||
dataType: "json",
|
dataType: "json",
|
||||||
data: {
|
data: {
|
||||||
"email": function () {
|
"email": function () {
|
||||||
return $.common.trim($("#email").val());
|
return $.common.trim($("#email").val());
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
dataFilter: function (data, type) {
|
dataFilter: function (data, type) {
|
||||||
return $.validate.unique(data);
|
return $.validate.unique(data);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
phonenumber:{
|
phonenumber:{
|
||||||
isPhone:true,
|
isPhone:true,
|
||||||
remote: {
|
remote: {
|
||||||
url: prefix + "/checkPhoneUnique",
|
url: prefix + "/checkPhoneUnique",
|
||||||
type: "post",
|
type: "post",
|
||||||
dataType: "json",
|
dataType: "json",
|
||||||
data: {
|
data: {
|
||||||
"phonenumber": function () {
|
"phonenumber": function () {
|
||||||
return $.common.trim($("#phonenumber").val());
|
return $.common.trim($("#phonenumber").val());
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
dataFilter: function (data, type) {
|
dataFilter: function (data, type) {
|
||||||
return $.validate.unique(data);
|
return $.validate.unique(data);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
messages: {
|
messages: {
|
||||||
"loginName": {
|
"loginName": {
|
||||||
remote: "用户已经存在"
|
remote: "用户已经存在"
|
||||||
},
|
},
|
||||||
"email": {
|
"email": {
|
||||||
remote: "Email已经存在"
|
remote: "Email已经存在"
|
||||||
},
|
},
|
||||||
"phonenumber":{
|
"phonenumber":{
|
||||||
remote: "手机号码已经存在"
|
remote: "手机号码已经存在"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
focusCleanup: true
|
focusCleanup: true
|
||||||
});
|
});
|
||||||
|
|
||||||
function submitHandler() {
|
function submitHandler() {
|
||||||
var chrtype = [[${#strings.defaultString(@config.getKey('sys.account.chrtype'), 0)}]];
|
var chrtype = [[${#strings.defaultString(@config.getKey('sys.account.chrtype'), 0)}]];
|
||||||
var password = $("#password").val();
|
var password = $("#password").val();
|
||||||
if ($.validate.form() && checkpwd(chrtype, password)) {
|
if ($.validate.form() && checkpwd(chrtype, password)) {
|
||||||
var data = $("#form-user-add").serializeArray();
|
var data = $("#form-user-add").serializeArray();
|
||||||
var status = $("input[id='status']").is(':checked') == true ? 0 : 1;
|
var status = $("input[id='status']").is(':checked') == true ? 0 : 1;
|
||||||
var roleIds = $.form.selectCheckeds("role");
|
var roleIds = $.form.selectCheckeds("role");
|
||||||
var postIds = $.form.selectSelects("post");
|
var postIds = $.form.selectSelects("post");
|
||||||
data.push({"name": "status", "value": status});
|
data.push({"name": "status", "value": status});
|
||||||
data.push({"name": "roleIds", "value": roleIds});
|
data.push({"name": "roleIds", "value": roleIds});
|
||||||
data.push({"name": "postIds", "value": postIds});
|
data.push({"name": "postIds", "value": postIds});
|
||||||
$.operate.saveTab(prefix + "/add", data);
|
$.operate.saveTab(prefix + "/add", data);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* 用户管理-新增-选择部门树 */
|
/* 用户管理-新增-选择部门树 */
|
||||||
function selectDeptTree() {
|
function selectDeptTree() {
|
||||||
var treeId = $("#treeId").val();
|
var treeId = $("#treeId").val();
|
||||||
var deptId = $.common.isEmpty(treeId) ? "100" : $("#treeId").val();
|
var deptId = $.common.isEmpty(treeId) ? "100" : $("#treeId").val();
|
||||||
var url = ctx + "system/dept/selectDeptTree/" + deptId;
|
var url = ctx + "system/dept/selectDeptTree/" + deptId;
|
||||||
var options = {
|
var options = {
|
||||||
title: '选择部门',
|
title: '选择部门',
|
||||||
width: "380",
|
width: "380",
|
||||||
url: url,
|
url: url,
|
||||||
callBack: doSubmit
|
callBack: doSubmit
|
||||||
};
|
};
|
||||||
$.modal.openOptions(options);
|
$.modal.openOptions(options);
|
||||||
}
|
}
|
||||||
|
|
||||||
function doSubmit(index, layero){
|
function doSubmit(index, layero){
|
||||||
var tree = layero.find("iframe")[0].contentWindow.$._tree;
|
var tree = layero.find("iframe")[0].contentWindow.$._tree;
|
||||||
if ($.tree.notAllowParents(tree)) {
|
if ($.tree.notAllowParents(tree)) {
|
||||||
var body = layer.getChildFrame('body', index);
|
var body = layer.getChildFrame('body', index);
|
||||||
$("#treeId").val(body.find('#treeId').val());
|
$("#treeId").val(body.find('#treeId').val());
|
||||||
$("#treeName").val(body.find('#treeName').val());
|
$("#treeName").val(body.find('#treeName').val());
|
||||||
layer.close(index);
|
layer.close(index);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$(function() {
|
$(function() {
|
||||||
$('#post').select2({
|
$('#post').select2({
|
||||||
placeholder: "请选择岗位",
|
placeholder: "请选择岗位",
|
||||||
allowClear: true
|
allowClear: true
|
||||||
});
|
});
|
||||||
})
|
})
|
||||||
</script>
|
</script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|
@ -1,234 +1,234 @@
|
||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
|
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
|
||||||
<head>
|
<head>
|
||||||
<th:block th:include="include :: header('修改用户')" />
|
<th:block th:include="include :: header('修改用户')" />
|
||||||
<th:block th:include="include :: select2-css" />
|
<th:block th:include="include :: select2-css" />
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<div class="main-content">
|
<div class="main-content">
|
||||||
<form class="form-horizontal" id="form-user-edit" th:object="${user}">
|
<form class="form-horizontal" id="form-user-edit" th:object="${user}">
|
||||||
<input name="userId" type="hidden" th:field="*{userId}" />
|
<input name="userId" type="hidden" th:field="*{userId}" />
|
||||||
<input name="deptId" type="hidden" th:field="*{deptId}" id="treeId"/>
|
<input name="dept.deptId" type="hidden" th:field="*{dept.deptId}" id="treeId"/>
|
||||||
<h4 class="form-header h4">基本信息</h4>
|
<h4 class="form-header h4">基本信息</h4>
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-sm-6">
|
<div class="col-sm-6">
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label class="col-sm-4 control-label is-required">用户名称:</label>
|
<label class="col-sm-4 control-label is-required">用户名称:</label>
|
||||||
<div class="col-sm-8">
|
<div class="col-sm-8">
|
||||||
<input name="userName" placeholder="请输入用户名称" class="form-control" type="text" maxlength="30" th:field="*{userName}" required>
|
<input name="userName" placeholder="请输入用户名称" class="form-control" type="text" maxlength="30" th:field="*{userName}" required>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-sm-6">
|
<div class="col-sm-6">
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label class="col-sm-4 control-label is-required">归属部门:</label>
|
<label class="col-sm-4 control-label is-required">归属部门:</label>
|
||||||
<div class="col-sm-8">
|
<div class="col-sm-8">
|
||||||
<div class="input-group">
|
<div class="input-group">
|
||||||
<input class="form-control" type="text" name="deptName" onclick="selectDeptTree()" id="treeName" th:field="*{dept.deptName}" required>
|
<input class="form-control" type="text" name="deptName" onclick="selectDeptTree()" id="treeName" th:field="*{dept.deptName}" required>
|
||||||
<span class="input-group-addon"><i class="fa fa-search"></i></span>
|
<span class="input-group-addon"><i class="fa fa-search"></i></span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-sm-6">
|
<div class="col-sm-6">
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label class="col-sm-4 control-label is-required">手机号码:</label>
|
<label class="col-sm-4 control-label is-required">手机号码:</label>
|
||||||
<div class="col-sm-8">
|
<div class="col-sm-8">
|
||||||
<div class="input-group">
|
<div class="input-group">
|
||||||
<input name="phonenumber" placeholder="请输入手机号码" class="form-control" type="text" maxlength="11" th:field="*{phonenumber}" required>
|
<input name="phonenumber" placeholder="请输入手机号码" class="form-control" type="text" maxlength="11" th:field="*{phonenumber}" required>
|
||||||
<span class="input-group-addon"><i class="fa fa-mobile"></i></span>
|
<span class="input-group-addon"><i class="fa fa-mobile"></i></span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-sm-6">
|
<div class="col-sm-6">
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label class="col-sm-4 control-label is-required">邮箱:</label>
|
<label class="col-sm-4 control-label is-required">邮箱:</label>
|
||||||
<div class="col-sm-8">
|
<div class="col-sm-8">
|
||||||
<div class="input-group">
|
<div class="input-group">
|
||||||
<input name="email" class="form-control email" type="text" maxlength="50" placeholder="请输入邮箱" th:field="*{email}" required>
|
<input name="email" class="form-control email" type="text" maxlength="50" placeholder="请输入邮箱" th:field="*{email}" required>
|
||||||
<span class="input-group-addon"><i class="fa fa-envelope"></i></span>
|
<span class="input-group-addon"><i class="fa fa-envelope"></i></span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-sm-6">
|
<div class="col-sm-6">
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label class="col-sm-4 control-label is-required">登录账号:</label>
|
<label class="col-sm-4 control-label"><span style="color: red; ">*</span>登录账号:</label>
|
||||||
<div class="col-sm-8">
|
<div class="col-sm-8">
|
||||||
<input class="form-control" type="text" readonly="true" th:field="*{loginName}"/>
|
<input class="form-control" type="text" readonly="true" th:field="*{loginName}"/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-sm-6">
|
<div class="col-sm-6">
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label class="col-sm-4 control-label">用户状态:</label>
|
<label class="col-sm-4 control-label">用户状态:</label>
|
||||||
<div class="col-sm-8">
|
<div class="col-sm-8">
|
||||||
<label class="toggle-switch switch-solid">
|
<label class="toggle-switch switch-solid">
|
||||||
<input type="checkbox" id="status" th:checked="${user.status == '0' ? true : false}">
|
<input type="checkbox" id="status" th:checked="${user.status == '0' ? true : false}">
|
||||||
<span></span>
|
<span></span>
|
||||||
</label>
|
</label>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-sm-6">
|
<div class="col-sm-6">
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label class="col-sm-4 control-label">岗位:</label>
|
<label class="col-sm-4 control-label">岗位:</label>
|
||||||
<div class="col-sm-8">
|
<div class="col-sm-8">
|
||||||
<select id="post" class="form-control select2-multiple" multiple>
|
<select id="post" class="form-control select2-multiple" multiple>
|
||||||
<option th:each="post:${posts}" th:value="${post.postId}" th:text="${post.postName}" th:selected="${post.flag}" th:disabled="${post.status == '1'}"></option>
|
<option th:each="post:${posts}" th:value="${post.postId}" th:text="${post.postName}" th:selected="${post.flag}" th:disabled="${post.status == '1'}" th:field="*{posts}"></option>
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-sm-6">
|
<div class="col-sm-6">
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label class="col-sm-4 control-label">用户性别:</label>
|
<label class="col-sm-4 control-label">用户性别:</label>
|
||||||
<div class="col-sm-8">
|
<div class="col-sm-8">
|
||||||
<select name="sex" class="form-control m-b" th:with="type=${@dict.getType('sys_user_sex')}">
|
<select name="sex" class="form-control m-b" th:with="type=${@dict.getType('sys_user_sex')}">
|
||||||
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:field="*{sex}"></option>
|
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:field="*{sex}"></option>
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-sm-12">
|
<div class="col-sm-12">
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label class="col-xs-2 control-label">角色:</label>
|
<label class="col-xs-2 control-label">角色:</label>
|
||||||
<div class="col-xs-10">
|
<div class="col-xs-10">
|
||||||
<label th:each="role:${roles}" class="check-box">
|
<label th:each="role:${roles}" class="check-box">
|
||||||
<input name="role" type="checkbox" th:value="${role.roleId}" th:text="${role.roleName}" th:checked="${role.flag}" th:disabled="${role.status == '1'}">
|
<input name="role" type="checkbox" th:value="${role.roleId}" th:text="${role.roleName}" th:checked="${role.flag}" th:disabled="${role.status == '1'}" th:field="*{roles}">
|
||||||
</label>
|
</label>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<h4 class="form-header h4">其他信息</h4>
|
<h4 class="form-header h4">其他信息</h4>
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-sm-12">
|
<div class="col-sm-12">
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label class="col-xs-2 control-label">备注:</label>
|
<label class="col-xs-2 control-label">备注:</label>
|
||||||
<div class="col-xs-10">
|
<div class="col-xs-10">
|
||||||
<textarea name="remark" maxlength="500" class="form-control" rows="3">[[*{remark}]]</textarea>
|
<textarea name="remark" maxlength="500" class="form-control" rows="3">[[*{remark}]]</textarea>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-sm-offset-5 col-sm-10">
|
<div class="col-sm-offset-5 col-sm-10">
|
||||||
<button type="button" class="btn btn-sm btn-primary" onclick="submitHandler()"><i class="fa fa-check"></i>保 存</button>
|
<button type="button" class="btn btn-sm btn-primary" onclick="submitHandler()"><i class="fa fa-check"></i>保 存</button>
|
||||||
<button type="button" class="btn btn-sm btn-danger" onclick="closeItem()"><i class="fa fa-reply-all"></i>关 闭 </button>
|
<button type="button" class="btn btn-sm btn-danger" onclick="closeItem()"><i class="fa fa-reply-all"></i>关 闭 </button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<th:block th:include="include :: footer" />
|
<th:block th:include="include :: footer" />
|
||||||
<th:block th:include="include :: select2-js" />
|
<th:block th:include="include :: select2-js" />
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
var prefix = ctx + "system/user";
|
var prefix = ctx + "system/user";
|
||||||
|
|
||||||
$("#form-user-edit").validate({
|
$("#form-user-edit").validate({
|
||||||
onkeyup: false,
|
onkeyup: false,
|
||||||
rules:{
|
rules:{
|
||||||
email:{
|
email:{
|
||||||
email:true,
|
email:true,
|
||||||
remote: {
|
remote: {
|
||||||
url: prefix + "/checkEmailUnique",
|
url: prefix + "/checkEmailUnique",
|
||||||
type: "post",
|
type: "post",
|
||||||
dataType: "json",
|
dataType: "json",
|
||||||
data: {
|
data: {
|
||||||
"userId": function() {
|
"userId": function() {
|
||||||
return $("#userId").val();
|
return $("#userId").val();
|
||||||
},
|
},
|
||||||
"email": function() {
|
"email": function() {
|
||||||
return $.common.trim($("#email").val());
|
return $.common.trim($("#email").val());
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
dataFilter: function (data, type) {
|
dataFilter: function (data, type) {
|
||||||
return $.validate.unique(data);
|
return $.validate.unique(data);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
phonenumber:{
|
phonenumber:{
|
||||||
isPhone:true,
|
isPhone:true,
|
||||||
remote: {
|
remote: {
|
||||||
url: prefix + "/checkPhoneUnique",
|
url: prefix + "/checkPhoneUnique",
|
||||||
type: "post",
|
type: "post",
|
||||||
dataType: "json",
|
dataType: "json",
|
||||||
data: {
|
data: {
|
||||||
"userId": function() {
|
"userId": function() {
|
||||||
return $("#userId").val();
|
return $("#userId").val();
|
||||||
},
|
},
|
||||||
"phonenumber": function() {
|
"phonenumber": function() {
|
||||||
return $.common.trim($("#phonenumber").val());
|
return $.common.trim($("#phonenumber").val());
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
dataFilter: function (data, type) {
|
dataFilter: function (data, type) {
|
||||||
return $.validate.unique(data);
|
return $.validate.unique(data);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
messages: {
|
messages: {
|
||||||
"email": {
|
"email": {
|
||||||
remote: "Email已经存在"
|
remote: "Email已经存在"
|
||||||
},
|
},
|
||||||
"phonenumber":{
|
"phonenumber":{
|
||||||
remote: "手机号码已经存在"
|
remote: "手机号码已经存在"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
focusCleanup: true
|
focusCleanup: true
|
||||||
});
|
});
|
||||||
|
|
||||||
function submitHandler() {
|
function submitHandler() {
|
||||||
if ($.validate.form()) {
|
if ($.validate.form()) {
|
||||||
var data = $("#form-user-edit").serializeArray();
|
var data = $("#form-user-edit").serializeArray();
|
||||||
var status = $("input[id='status']").is(':checked') == true ? 0 : 1;
|
var status = $("input[id='status']").is(':checked') == true ? 0 : 1;
|
||||||
var roleIds = $.form.selectCheckeds("role");
|
var roleIds = $.form.selectCheckeds("role");
|
||||||
var postIds = $.form.selectSelects("post");
|
var postIds = $.form.selectSelects("post");
|
||||||
data.push({"name": "status", "value": status});
|
data.push({"name": "status", "value": status});
|
||||||
data.push({"name": "roleIds", "value": roleIds});
|
data.push({"name": "roles", "value": roleIds});
|
||||||
data.push({"name": "postIds", "value": postIds});
|
data.push({"name": "posts", "value": postIds});
|
||||||
$.operate.saveTab(prefix + "/edit", data);
|
$.operate.saveTab(prefix + "/edit", data);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* 用户管理-修改-选择部门树 */
|
/* 用户管理-修改-选择部门树 */
|
||||||
function selectDeptTree() {
|
function selectDeptTree() {
|
||||||
var deptId = $.common.isEmpty($("#treeId").val()) ? "100" : $("#treeId").val();
|
var deptId = $.common.isEmpty($("#treeId").val()) ? "100" : $("#treeId").val();
|
||||||
var url = ctx + "system/dept/selectDeptTree/" + deptId;
|
var url = ctx + "system/dept/selectDeptTree/" + deptId;
|
||||||
var options = {
|
var options = {
|
||||||
title: '选择部门',
|
title: '选择部门',
|
||||||
width: "380",
|
width: "380",
|
||||||
url: url,
|
url: url,
|
||||||
callBack: doSubmit
|
callBack: doSubmit
|
||||||
};
|
};
|
||||||
$.modal.openOptions(options);
|
$.modal.openOptions(options);
|
||||||
}
|
}
|
||||||
|
|
||||||
function doSubmit(index, layero){
|
function doSubmit(index, layero){
|
||||||
var tree = layero.find("iframe")[0].contentWindow.$._tree;
|
var tree = layero.find("iframe")[0].contentWindow.$._tree;
|
||||||
if ($.tree.notAllowParents(tree)) {
|
if ($.tree.notAllowParents(tree)) {
|
||||||
var body = layer.getChildFrame('body', index);
|
var body = layer.getChildFrame('body', index);
|
||||||
$("#treeId").val(body.find('#treeId').val());
|
$("#treeId").val(body.find('#treeId').val());
|
||||||
$("#treeName").val(body.find('#treeName').val());
|
$("#treeName").val(body.find('#treeName').val());
|
||||||
layer.close(index);
|
layer.close(index);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$(function() {
|
$(function() {
|
||||||
$('#post').select2({
|
$('#post').select2({
|
||||||
placeholder: "请选择岗位",
|
placeholder: "请选择岗位",
|
||||||
allowClear: true
|
allowClear: true
|
||||||
});
|
});
|
||||||
})
|
})
|
||||||
</script>
|
</script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|
@ -1,106 +1,123 @@
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||||
<parent>
|
<parent>
|
||||||
<artifactId>ruoyi</artifactId>
|
<artifactId>ruoyi</artifactId>
|
||||||
<groupId>com.ruoyi</groupId>
|
<groupId>com.ruoyi</groupId>
|
||||||
<version>4.4.0</version>
|
<version>4.4.0</version>
|
||||||
</parent>
|
</parent>
|
||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
|
||||||
<artifactId>ruoyi-common</artifactId>
|
<artifactId>ruoyi-common</artifactId>
|
||||||
|
|
||||||
<description>
|
<description>
|
||||||
common通用工具
|
common通用工具
|
||||||
</description>
|
</description>
|
||||||
|
|
||||||
<dependencies>
|
<dependencies>
|
||||||
|
|
||||||
<!-- Spring框架基本的核心工具 -->
|
<!-- Spring框架基本的核心工具 -->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.springframework</groupId>
|
<groupId>org.springframework</groupId>
|
||||||
<artifactId>spring-context-support</artifactId>
|
<artifactId>spring-context-support</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<!-- SpringWeb模块 -->
|
<!-- SpringWeb模块 -->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.springframework</groupId>
|
<groupId>org.springframework</groupId>
|
||||||
<artifactId>spring-web</artifactId>
|
<artifactId>spring-web</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<!--Shiro核心框架 -->
|
<!--Shiro核心框架 -->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.apache.shiro</groupId>
|
<groupId>org.apache.shiro</groupId>
|
||||||
<artifactId>shiro-core</artifactId>
|
<artifactId>shiro-core</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<!-- Shiro使用EhCache缓存框架 -->
|
<!-- Shiro使用EhCache缓存框架 -->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.apache.shiro</groupId>
|
<groupId>org.apache.shiro</groupId>
|
||||||
<artifactId>shiro-ehcache</artifactId>
|
<artifactId>shiro-ehcache</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<!-- pagehelper 分页插件 -->
|
<!-- pagehelper 分页插件 -->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.github.pagehelper</groupId>
|
<groupId>com.github.pagehelper</groupId>
|
||||||
<artifactId>pagehelper-spring-boot-starter</artifactId>
|
<artifactId>pagehelper-spring-boot-starter</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<!-- 自定义验证注解 -->
|
<!-- 自定义验证注解 -->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>javax.validation</groupId>
|
<groupId>javax.validation</groupId>
|
||||||
<artifactId>validation-api</artifactId>
|
<artifactId>validation-api</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<!--常用工具类 -->
|
<!--常用工具类 -->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.apache.commons</groupId>
|
<groupId>org.apache.commons</groupId>
|
||||||
<artifactId>commons-lang3</artifactId>
|
<artifactId>commons-lang3</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<!-- JSON工具类 -->
|
<!-- JSON工具类 -->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.fasterxml.jackson.core</groupId>
|
<groupId>com.fasterxml.jackson.core</groupId>
|
||||||
<artifactId>jackson-databind</artifactId>
|
<artifactId>jackson-databind</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<!-- 阿里JSON解析器 -->
|
<!-- 阿里JSON解析器 -->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.alibaba</groupId>
|
<groupId>com.alibaba</groupId>
|
||||||
<artifactId>fastjson</artifactId>
|
<artifactId>fastjson</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<!-- io常用工具类 -->
|
<!-- io常用工具类 -->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>commons-io</groupId>
|
<groupId>commons-io</groupId>
|
||||||
<artifactId>commons-io</artifactId>
|
<artifactId>commons-io</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<!-- 文件上传工具类 -->
|
<!-- 文件上传工具类 -->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>commons-fileupload</groupId>
|
<groupId>commons-fileupload</groupId>
|
||||||
<artifactId>commons-fileupload</artifactId>
|
<artifactId>commons-fileupload</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<!-- excel工具 -->
|
<!-- excel工具 -->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.apache.poi</groupId>
|
<groupId>org.apache.poi</groupId>
|
||||||
<artifactId>poi-ooxml</artifactId>
|
<artifactId>poi-ooxml</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<!-- yml解析器 -->
|
<!-- yml解析器 -->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.yaml</groupId>
|
<groupId>org.yaml</groupId>
|
||||||
<artifactId>snakeyaml</artifactId>
|
<artifactId>snakeyaml</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<!-- servlet包 -->
|
<!-- servlet包 -->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>javax.servlet</groupId>
|
<groupId>javax.servlet</groupId>
|
||||||
<artifactId>javax.servlet-api</artifactId>
|
<artifactId>javax.servlet-api</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
</dependencies>
|
<!-- spring.data.jpa -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.springframework.boot</groupId>
|
||||||
|
<artifactId>spring-boot-starter-data-jpa</artifactId>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!-- https://mvnrepository.com/artifact/org.projectlombok/lombok -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.projectlombok</groupId>
|
||||||
|
<artifactId>lombok</artifactId>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.querydsl</groupId>
|
||||||
|
<artifactId>querydsl-jpa</artifactId>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
</dependencies>
|
||||||
|
|
||||||
</project>
|
</project>
|
||||||
|
|
@ -1,28 +1,23 @@
|
||||||
package com.ruoyi.common.annotation;
|
package com.ruoyi.common.annotation;
|
||||||
|
|
||||||
import java.lang.annotation.Documented;
|
import java.lang.annotation.Documented;
|
||||||
import java.lang.annotation.ElementType;
|
import java.lang.annotation.ElementType;
|
||||||
import java.lang.annotation.Retention;
|
import java.lang.annotation.Retention;
|
||||||
import java.lang.annotation.RetentionPolicy;
|
import java.lang.annotation.RetentionPolicy;
|
||||||
import java.lang.annotation.Target;
|
import java.lang.annotation.Target;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 数据权限过滤注解
|
* 数据权限过滤注解
|
||||||
*
|
*
|
||||||
* @author ruoyi
|
* @author ruoyi
|
||||||
*/
|
*/
|
||||||
@Target(ElementType.METHOD)
|
@Target(ElementType.TYPE)
|
||||||
@Retention(RetentionPolicy.RUNTIME)
|
@Retention(RetentionPolicy.RUNTIME)
|
||||||
@Documented
|
@Documented
|
||||||
public @interface DataScope
|
public @interface DataScope {
|
||||||
{
|
/**
|
||||||
/**
|
* 业务表的所属用户的字段名称:过滤仅本人的数据权限,
|
||||||
* 部门表的别名
|
* 该字段的类型为:{@link com.ruoyi.system.domain.SysUser}
|
||||||
*/
|
*/
|
||||||
public String deptAlias() default "";
|
String userFieldName() default "";
|
||||||
|
}
|
||||||
/**
|
|
||||||
* 用户表的别名
|
|
||||||
*/
|
|
||||||
public String userAlias() default "";
|
|
||||||
}
|
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,25 @@
|
||||||
|
package com.ruoyi.common.annotation;
|
||||||
|
|
||||||
|
public enum DataScopes implements Comparable<DataScopes>{
|
||||||
|
/**
|
||||||
|
* 全部数据权限
|
||||||
|
*/
|
||||||
|
DATA_SCOPE_ALL,
|
||||||
|
/**
|
||||||
|
* 自定数据权限
|
||||||
|
*/
|
||||||
|
DATA_SCOPE_CUSTOM,
|
||||||
|
/**
|
||||||
|
* 部门数据权限
|
||||||
|
*/
|
||||||
|
DATA_SCOPE_DEPT,
|
||||||
|
/**
|
||||||
|
* 部门及以下数据权限
|
||||||
|
*/
|
||||||
|
DATA_SCOPE_DEPT_AND_CHILD,
|
||||||
|
/**
|
||||||
|
* 仅本人数据权限
|
||||||
|
*/
|
||||||
|
DATA_SCOPE_SELF,
|
||||||
|
;
|
||||||
|
}
|
||||||
|
|
@ -1,28 +1,26 @@
|
||||||
package com.ruoyi.common.annotation;
|
package com.ruoyi.common.annotation;
|
||||||
|
|
||||||
import java.lang.annotation.Documented;
|
import java.lang.annotation.Documented;
|
||||||
import java.lang.annotation.ElementType;
|
import java.lang.annotation.ElementType;
|
||||||
import java.lang.annotation.Inherited;
|
import java.lang.annotation.Inherited;
|
||||||
import java.lang.annotation.Retention;
|
import java.lang.annotation.Retention;
|
||||||
import java.lang.annotation.RetentionPolicy;
|
import java.lang.annotation.RetentionPolicy;
|
||||||
import java.lang.annotation.Target;
|
import java.lang.annotation.Target;
|
||||||
import com.ruoyi.common.enums.DataSourceType;
|
|
||||||
|
import com.ruoyi.common.enums.DataSourceType;
|
||||||
/**
|
|
||||||
* 自定义多数据源切换注解
|
/**
|
||||||
*
|
* 自定义多数据源切换注解
|
||||||
* 优先级:先方法,后类,如果方法覆盖了类上的数据源类型,以方法的为准,否则以类上的为准
|
*
|
||||||
*
|
* @author ruoyi
|
||||||
* @author ruoyi
|
*/
|
||||||
*/
|
@Target({ElementType.METHOD, ElementType.TYPE})
|
||||||
@Target({ ElementType.METHOD, ElementType.TYPE })
|
@Retention(RetentionPolicy.RUNTIME)
|
||||||
@Retention(RetentionPolicy.RUNTIME)
|
@Documented
|
||||||
@Documented
|
@Inherited
|
||||||
@Inherited
|
public @interface DataSource {
|
||||||
public @interface DataSource
|
/**
|
||||||
{
|
* 切换数据源名称
|
||||||
/**
|
*/
|
||||||
* 切换数据源名称
|
public DataSourceType value() default DataSourceType.MASTER;
|
||||||
*/
|
}
|
||||||
public DataSourceType value() default DataSourceType.MASTER;
|
|
||||||
}
|
|
||||||
|
|
|
||||||
|
|
@ -1,144 +1,144 @@
|
||||||
package com.ruoyi.common.annotation;
|
package com.ruoyi.common.annotation;
|
||||||
|
|
||||||
import java.lang.annotation.ElementType;
|
import java.lang.annotation.ElementType;
|
||||||
import java.lang.annotation.Retention;
|
import java.lang.annotation.Retention;
|
||||||
import java.lang.annotation.RetentionPolicy;
|
import java.lang.annotation.RetentionPolicy;
|
||||||
import java.lang.annotation.Target;
|
import java.lang.annotation.Target;
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 自定义导出Excel数据注解
|
* 自定义导出Excel数据注解
|
||||||
*
|
*
|
||||||
* @author ruoyi
|
* @author ruoyi
|
||||||
*/
|
*/
|
||||||
@Retention(RetentionPolicy.RUNTIME)
|
@Retention(RetentionPolicy.RUNTIME)
|
||||||
@Target(ElementType.FIELD)
|
@Target(ElementType.FIELD)
|
||||||
public @interface Excel
|
public @interface Excel
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* 导出时在excel中排序
|
* 导出时在excel中排序
|
||||||
*/
|
*/
|
||||||
public int sort() default Integer.MAX_VALUE;
|
public int sort() default Integer.MAX_VALUE;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 导出到Excel中的名字.
|
* 导出到Excel中的名字.
|
||||||
*/
|
*/
|
||||||
public String name() default "";
|
public String name() default "";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 日期格式, 如: yyyy-MM-dd
|
* 日期格式, 如: yyyy-MM-dd
|
||||||
*/
|
*/
|
||||||
public String dateFormat() default "";
|
public String dateFormat() default "";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 如果是字典类型,请设置字典的type值 (如: sys_user_sex)
|
* 如果是字典类型,请设置字典的type值 (如: sys_user_sex)
|
||||||
*/
|
*/
|
||||||
public String dictType() default "";
|
public String dictType() default "";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 读取内容转表达式 (如: 0=男,1=女,2=未知)
|
* 读取内容转表达式 (如: 0=男,1=女,2=未知)
|
||||||
*/
|
*/
|
||||||
public String readConverterExp() default "";
|
public String readConverterExp() default "";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 分隔符,读取字符串组内容
|
* 分隔符,读取字符串组内容
|
||||||
*/
|
*/
|
||||||
public String separator() default ",";
|
public String separator() default ",";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* BigDecimal 精度 默认:-1(默认不开启BigDecimal格式化)
|
* BigDecimal 精度 默认:-1(默认不开启BigDecimal格式化)
|
||||||
*/
|
*/
|
||||||
public int scale() default -1;
|
public int scale() default -1;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* BigDecimal 舍入规则 默认:BigDecimal.ROUND_HALF_EVEN
|
* BigDecimal 舍入规则 默认:BigDecimal.ROUND_HALF_EVEN
|
||||||
*/
|
*/
|
||||||
public int roundingMode() default BigDecimal.ROUND_HALF_EVEN;
|
public int roundingMode() default BigDecimal.ROUND_HALF_EVEN;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 导出类型(0数字 1字符串)
|
* 导出类型(0数字 1字符串)
|
||||||
*/
|
*/
|
||||||
public ColumnType cellType() default ColumnType.STRING;
|
public ColumnType cellType() default ColumnType.STRING;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 导出时在excel中每个列的高度 单位为字符
|
* 导出时在excel中每个列的高度 单位为字符
|
||||||
*/
|
*/
|
||||||
public double height() default 14;
|
public double height() default 14;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 导出时在excel中每个列的宽 单位为字符
|
* 导出时在excel中每个列的宽 单位为字符
|
||||||
*/
|
*/
|
||||||
public double width() default 16;
|
public double width() default 16;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 文字后缀,如% 90 变成90%
|
* 文字后缀,如% 90 变成90%
|
||||||
*/
|
*/
|
||||||
public String suffix() default "";
|
public String suffix() default "";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 当值为空时,字段的默认值
|
* 当值为空时,字段的默认值
|
||||||
*/
|
*/
|
||||||
public String defaultValue() default "";
|
public String defaultValue() default "";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 提示信息
|
* 提示信息
|
||||||
*/
|
*/
|
||||||
public String prompt() default "";
|
public String prompt() default "";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 设置只能选择不能输入的列内容.
|
* 设置只能选择不能输入的列内容.
|
||||||
*/
|
*/
|
||||||
public String[] combo() default {};
|
public String[] combo() default {};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 是否导出数据,应对需求:有时我们需要导出一份模板,这是标题需要但内容需要用户手工填写.
|
* 是否导出数据,应对需求:有时我们需要导出一份模板,这是标题需要但内容需要用户手工填写.
|
||||||
*/
|
*/
|
||||||
public boolean isExport() default true;
|
public boolean isExport() default true;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 另一个类中的属性名称,支持多级获取,以小数点隔开
|
* 另一个类中的属性名称,支持多级获取,以小数点隔开
|
||||||
*/
|
*/
|
||||||
public String targetAttr() default "";
|
public String targetAttr() default "";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 是否自动统计数据,在最后追加一行统计数据总和
|
* 是否自动统计数据,在最后追加一行统计数据总和
|
||||||
*/
|
*/
|
||||||
public boolean isStatistics() default false;
|
public boolean isStatistics() default false;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 字段类型(0:导出导入;1:仅导出;2:仅导入)
|
* 字段类型(0:导出导入;1:仅导出;2:仅导入)
|
||||||
*/
|
*/
|
||||||
Type type() default Type.ALL;
|
Type type() default Type.ALL;
|
||||||
|
|
||||||
public enum Type
|
public enum Type
|
||||||
{
|
{
|
||||||
ALL(0), EXPORT(1), IMPORT(2);
|
ALL(0), EXPORT(1), IMPORT(2);
|
||||||
private final int value;
|
private final int value;
|
||||||
|
|
||||||
Type(int value)
|
Type(int value)
|
||||||
{
|
{
|
||||||
this.value = value;
|
this.value = value;
|
||||||
}
|
}
|
||||||
|
|
||||||
public int value()
|
public int value()
|
||||||
{
|
{
|
||||||
return this.value;
|
return this.value;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public enum ColumnType
|
public enum ColumnType
|
||||||
{
|
{
|
||||||
NUMERIC(0), STRING(1);
|
NUMERIC(0), STRING(1);
|
||||||
private final int value;
|
private final int value;
|
||||||
|
|
||||||
ColumnType(int value)
|
ColumnType(int value)
|
||||||
{
|
{
|
||||||
this.value = value;
|
this.value = value;
|
||||||
}
|
}
|
||||||
|
|
||||||
public int value()
|
public int value()
|
||||||
{
|
{
|
||||||
return this.value;
|
return this.value;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -7,12 +7,11 @@ import java.lang.annotation.Target;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Excel注解集
|
* Excel注解集
|
||||||
*
|
*
|
||||||
* @author ruoyi
|
* @author ruoyi
|
||||||
*/
|
*/
|
||||||
@Target(ElementType.FIELD)
|
@Target(ElementType.FIELD)
|
||||||
@Retention(RetentionPolicy.RUNTIME)
|
@Retention(RetentionPolicy.RUNTIME)
|
||||||
public @interface Excels
|
public @interface Excels {
|
||||||
{
|
|
||||||
Excel[] value();
|
Excel[] value();
|
||||||
}
|
}
|
||||||
|
|
@ -1,40 +1,40 @@
|
||||||
package com.ruoyi.common.annotation;
|
package com.ruoyi.common.annotation;
|
||||||
|
|
||||||
import java.lang.annotation.Documented;
|
import java.lang.annotation.Documented;
|
||||||
import java.lang.annotation.ElementType;
|
import java.lang.annotation.ElementType;
|
||||||
import java.lang.annotation.Retention;
|
import java.lang.annotation.Retention;
|
||||||
import java.lang.annotation.RetentionPolicy;
|
import java.lang.annotation.RetentionPolicy;
|
||||||
import java.lang.annotation.Target;
|
import java.lang.annotation.Target;
|
||||||
import com.ruoyi.common.enums.BusinessType;
|
|
||||||
import com.ruoyi.common.enums.OperatorType;
|
import com.ruoyi.common.enums.BusinessType;
|
||||||
|
import com.ruoyi.common.enums.OperatorType;
|
||||||
/**
|
|
||||||
* 自定义操作日志记录注解
|
/**
|
||||||
*
|
* 自定义操作日志记录注解
|
||||||
* @author ruoyi
|
*
|
||||||
*/
|
* @author ruoyi
|
||||||
@Target({ ElementType.PARAMETER, ElementType.METHOD })
|
*/
|
||||||
@Retention(RetentionPolicy.RUNTIME)
|
@Target({ElementType.PARAMETER, ElementType.METHOD})
|
||||||
@Documented
|
@Retention(RetentionPolicy.RUNTIME)
|
||||||
public @interface Log
|
@Documented
|
||||||
{
|
public @interface Log {
|
||||||
/**
|
/**
|
||||||
* 模块
|
* 模块
|
||||||
*/
|
*/
|
||||||
public String title() default "";
|
public String title() default "";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 功能
|
* 功能
|
||||||
*/
|
*/
|
||||||
public BusinessType businessType() default BusinessType.OTHER;
|
public BusinessType businessType() default BusinessType.OTHER;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 操作人类别
|
* 操作人类别
|
||||||
*/
|
*/
|
||||||
public OperatorType operatorType() default OperatorType.MANAGE;
|
public OperatorType operatorType() default OperatorType.MANAGE;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 是否保存请求的参数
|
* 是否保存请求的参数
|
||||||
*/
|
*/
|
||||||
public boolean isSaveRequestData() default true;
|
public boolean isSaveRequestData() default true;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -8,14 +8,12 @@ import java.lang.annotation.Target;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 自定义注解防止表单重复提交
|
* 自定义注解防止表单重复提交
|
||||||
*
|
|
||||||
* @author ruoyi
|
|
||||||
*
|
*
|
||||||
|
* @author ruoyi
|
||||||
*/
|
*/
|
||||||
@Target(ElementType.METHOD)
|
@Target(ElementType.METHOD)
|
||||||
@Retention(RetentionPolicy.RUNTIME)
|
@Retention(RetentionPolicy.RUNTIME)
|
||||||
@Documented
|
@Documented
|
||||||
public @interface RepeatSubmit
|
public @interface RepeatSubmit {
|
||||||
{
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
@ -0,0 +1,15 @@
|
||||||
|
package com.ruoyi.common.base;
|
||||||
|
|
||||||
|
import org.springframework.data.jpa.repository.JpaRepository;
|
||||||
|
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
|
||||||
|
import org.springframework.data.querydsl.QuerydslPredicateExecutor;
|
||||||
|
import org.springframework.data.repository.NoRepositoryBean;
|
||||||
|
|
||||||
|
import javax.persistence.criteria.CriteriaBuilder;
|
||||||
|
import javax.persistence.criteria.Predicate;
|
||||||
|
|
||||||
|
@NoRepositoryBean
|
||||||
|
public interface BaseRepository<T, ID> extends JpaRepository<T, ID>,
|
||||||
|
JpaSpecificationExecutor<T>,
|
||||||
|
QuerydslPredicateExecutor<T> {
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,35 @@
|
||||||
|
package com.ruoyi.common.base;
|
||||||
|
|
||||||
|
import com.querydsl.core.types.dsl.*;
|
||||||
|
import com.ruoyi.common.utils.querydsl.ExpressionUtils;
|
||||||
|
|
||||||
|
public class BaseService {
|
||||||
|
|
||||||
|
protected BooleanExpression buildLike(StringPath path, String value){
|
||||||
|
return ExpressionUtils.buildLike(path, value);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected <T extends Comparable<T>> BooleanExpression buildEqual(ComparableExpressionBase<T> path, T value){
|
||||||
|
return ExpressionUtils.buildEqual(path, value);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected <T extends Number & Comparable<T>> BooleanExpression buildEqual(NumberPath<T> path, T value){
|
||||||
|
return ExpressionUtils.buildEqual(path, value);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected <T extends Comparable<T>> BooleanExpression buildGreaterThanOrEqualTo(ComparableExpression<T> path, T value){
|
||||||
|
return ExpressionUtils.buildGreaterThanOrEqualTo(path, value);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected <T extends Comparable<T>> BooleanExpression buildLessThanOrEqualTo(ComparableExpression<T> path, T value){
|
||||||
|
return ExpressionUtils.buildLessThanOrEqualTo(path, value);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected BooleanExpression notLike(StringPath path, String value){
|
||||||
|
return ExpressionUtils.notLike(path, value);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected BooleanExpression notStartWith(StringPath path, String value){
|
||||||
|
return ExpressionUtils.notStartWith(path, value);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -1,116 +1,112 @@
|
||||||
package com.ruoyi.common.config;
|
package com.ruoyi.common.config;
|
||||||
|
|
||||||
import org.springframework.boot.context.properties.ConfigurationProperties;
|
import org.springframework.boot.context.properties.ConfigurationProperties;
|
||||||
import org.springframework.stereotype.Component;
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 全局配置类
|
* 全局配置类
|
||||||
*
|
*
|
||||||
* @author ruoyi
|
* @author ruoyi
|
||||||
*/
|
*/
|
||||||
@Component
|
@Component
|
||||||
@ConfigurationProperties(prefix = "ruoyi")
|
@ConfigurationProperties(prefix = "ruoyi")
|
||||||
public class Global
|
public class Global {
|
||||||
{
|
/**
|
||||||
/** 项目名称 */
|
* 项目名称
|
||||||
private static String name;
|
*/
|
||||||
|
private static String name;
|
||||||
/** 版本 */
|
|
||||||
private static String version;
|
/**
|
||||||
|
* 版本
|
||||||
/** 版权年份 */
|
*/
|
||||||
private static String copyrightYear;
|
private static String version;
|
||||||
|
|
||||||
/** 实例演示开关 */
|
/**
|
||||||
private static boolean demoEnabled;
|
* 版权年份
|
||||||
|
*/
|
||||||
/** 上传路径 */
|
private static String copyrightYear;
|
||||||
private static String profile;
|
|
||||||
|
/**
|
||||||
/** 获取地址开关 */
|
* 实例演示开关
|
||||||
private static boolean addressEnabled;
|
*/
|
||||||
|
private static boolean demoEnabled;
|
||||||
public static String getName()
|
|
||||||
{
|
/**
|
||||||
return name;
|
* 上传路径
|
||||||
}
|
*/
|
||||||
|
private static String profile;
|
||||||
public void setName(String name)
|
|
||||||
{
|
/**
|
||||||
Global.name = name;
|
* 获取地址开关
|
||||||
}
|
*/
|
||||||
|
private static boolean addressEnabled;
|
||||||
public static String getVersion()
|
|
||||||
{
|
public static String getName() {
|
||||||
return version;
|
return name;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setVersion(String version)
|
public void setName(String name) {
|
||||||
{
|
Global.name = name;
|
||||||
Global.version = version;
|
}
|
||||||
}
|
|
||||||
|
public static String getVersion() {
|
||||||
public static String getCopyrightYear()
|
return version;
|
||||||
{
|
}
|
||||||
return copyrightYear;
|
|
||||||
}
|
public void setVersion(String version) {
|
||||||
|
Global.version = version;
|
||||||
public void setCopyrightYear(String copyrightYear)
|
}
|
||||||
{
|
|
||||||
Global.copyrightYear = copyrightYear;
|
public static String getCopyrightYear() {
|
||||||
}
|
return copyrightYear;
|
||||||
|
}
|
||||||
public static boolean isDemoEnabled()
|
|
||||||
{
|
public void setCopyrightYear(String copyrightYear) {
|
||||||
return demoEnabled;
|
Global.copyrightYear = copyrightYear;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setDemoEnabled(boolean demoEnabled)
|
public static boolean isDemoEnabled() {
|
||||||
{
|
return demoEnabled;
|
||||||
Global.demoEnabled = demoEnabled;
|
}
|
||||||
}
|
|
||||||
|
public void setDemoEnabled(boolean demoEnabled) {
|
||||||
public static String getProfile()
|
Global.demoEnabled = demoEnabled;
|
||||||
{
|
}
|
||||||
return profile;
|
|
||||||
}
|
public static String getProfile() {
|
||||||
|
return profile;
|
||||||
public void setProfile(String profile)
|
}
|
||||||
{
|
|
||||||
Global.profile = profile;
|
public void setProfile(String profile) {
|
||||||
}
|
Global.profile = profile;
|
||||||
|
}
|
||||||
public static boolean isAddressEnabled()
|
|
||||||
{
|
public static boolean isAddressEnabled() {
|
||||||
return addressEnabled;
|
return addressEnabled;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setAddressEnabled(boolean addressEnabled)
|
public void setAddressEnabled(boolean addressEnabled) {
|
||||||
{
|
Global.addressEnabled = addressEnabled;
|
||||||
Global.addressEnabled = addressEnabled;
|
}
|
||||||
}
|
|
||||||
|
/**
|
||||||
/**
|
* 获取头像上传路径
|
||||||
* 获取头像上传路径
|
*/
|
||||||
*/
|
public static String getAvatarPath() {
|
||||||
public static String getAvatarPath()
|
return getProfile() + "/avatar";
|
||||||
{
|
}
|
||||||
return getProfile() + "/avatar";
|
|
||||||
}
|
/**
|
||||||
|
* 获取下载路径
|
||||||
/**
|
*/
|
||||||
* 获取下载路径
|
public static String getDownloadPath() {
|
||||||
*/
|
return getProfile() + "/download/";
|
||||||
public static String getDownloadPath()
|
}
|
||||||
{
|
|
||||||
return getProfile() + "/download/";
|
/**
|
||||||
}
|
* 获取上传路径
|
||||||
|
*/
|
||||||
/**
|
public static String getUploadPath() {
|
||||||
* 获取上传路径
|
return getProfile() + "/upload";
|
||||||
*/
|
}
|
||||||
public static String getUploadPath()
|
}
|
||||||
{
|
|
||||||
return getProfile() + "/upload";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
|
||||||
|
|
@ -1,33 +1,30 @@
|
||||||
package com.ruoyi.common.config;
|
package com.ruoyi.common.config;
|
||||||
|
|
||||||
import javax.servlet.http.HttpServletRequest;
|
import javax.servlet.http.HttpServletRequest;
|
||||||
import org.springframework.stereotype.Component;
|
|
||||||
import com.ruoyi.common.utils.ServletUtils;
|
import org.springframework.stereotype.Component;
|
||||||
|
import com.ruoyi.common.utils.ServletUtils;
|
||||||
/**
|
|
||||||
* 服务相关配置
|
/**
|
||||||
*
|
* 服务相关配置
|
||||||
* @author ruoyi
|
*
|
||||||
*
|
* @author ruoyi
|
||||||
*/
|
*/
|
||||||
@Component
|
@Component
|
||||||
public class ServerConfig
|
public class ServerConfig {
|
||||||
{
|
/**
|
||||||
/**
|
* 获取完整的请求路径,包括:域名,端口,上下文访问路径
|
||||||
* 获取完整的请求路径,包括:域名,端口,上下文访问路径
|
*
|
||||||
*
|
* @return 服务地址
|
||||||
* @return 服务地址
|
*/
|
||||||
*/
|
public String getUrl() {
|
||||||
public String getUrl()
|
HttpServletRequest request = ServletUtils.getRequest();
|
||||||
{
|
return getDomain(request);
|
||||||
HttpServletRequest request = ServletUtils.getRequest();
|
}
|
||||||
return getDomain(request);
|
|
||||||
}
|
public static String getDomain(HttpServletRequest request) {
|
||||||
|
StringBuffer url = request.getRequestURL();
|
||||||
public static String getDomain(HttpServletRequest request)
|
String contextPath = request.getServletContext().getContextPath();
|
||||||
{
|
return url.delete(url.length() - request.getRequestURI().length(), url.length()).append(contextPath).toString();
|
||||||
StringBuffer url = request.getRequestURL();
|
}
|
||||||
String contextPath = request.getServletContext().getContextPath();
|
}
|
||||||
return url.delete(url.length() - request.getRequestURI().length(), url.length()).append(contextPath).toString();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
|
||||||
|
|
@ -1,45 +1,41 @@
|
||||||
package com.ruoyi.common.config.datasource;
|
package com.ruoyi.common.config.datasource;
|
||||||
|
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 数据源切换处理
|
* 数据源切换处理
|
||||||
*
|
*
|
||||||
* @author ruoyi
|
* @author ruoyi
|
||||||
*/
|
*/
|
||||||
public class DynamicDataSourceContextHolder
|
public class DynamicDataSourceContextHolder {
|
||||||
{
|
public static final Logger log = LoggerFactory.getLogger(DynamicDataSourceContextHolder.class);
|
||||||
public static final Logger log = LoggerFactory.getLogger(DynamicDataSourceContextHolder.class);
|
|
||||||
|
/**
|
||||||
/**
|
* 使用ThreadLocal维护变量,ThreadLocal为每个使用该变量的线程提供独立的变量副本,
|
||||||
* 使用ThreadLocal维护变量,ThreadLocal为每个使用该变量的线程提供独立的变量副本,
|
* 所以每一个线程都可以独立地改变自己的副本,而不会影响其它线程所对应的副本。
|
||||||
* 所以每一个线程都可以独立地改变自己的副本,而不会影响其它线程所对应的副本。
|
*/
|
||||||
*/
|
private static final ThreadLocal<String> CONTEXT_HOLDER = new ThreadLocal<>();
|
||||||
private static final ThreadLocal<String> CONTEXT_HOLDER = new ThreadLocal<>();
|
|
||||||
|
/**
|
||||||
/**
|
* 设置数据源的变量
|
||||||
* 设置数据源的变量
|
*/
|
||||||
*/
|
public static void setDataSourceType(String dsType) {
|
||||||
public static void setDataSourceType(String dsType)
|
log.info("切换到{}数据源", dsType);
|
||||||
{
|
CONTEXT_HOLDER.set(dsType);
|
||||||
log.info("切换到{}数据源", dsType);
|
}
|
||||||
CONTEXT_HOLDER.set(dsType);
|
|
||||||
}
|
/**
|
||||||
|
* 获得数据源的变量
|
||||||
/**
|
*/
|
||||||
* 获得数据源的变量
|
public static String getDataSourceType() {
|
||||||
*/
|
return CONTEXT_HOLDER.get();
|
||||||
public static String getDataSourceType()
|
}
|
||||||
{
|
|
||||||
return CONTEXT_HOLDER.get();
|
/**
|
||||||
}
|
* 清空数据源变量
|
||||||
|
*/
|
||||||
/**
|
public static void clearDataSourceType() {
|
||||||
* 清空数据源变量
|
CONTEXT_HOLDER.remove();
|
||||||
*/
|
}
|
||||||
public static void clearDataSourceType()
|
}
|
||||||
{
|
|
||||||
CONTEXT_HOLDER.remove();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
|
||||||
|
|
@ -1,62 +1,58 @@
|
||||||
package com.ruoyi.common.config.thread;
|
package com.ruoyi.common.config.thread;
|
||||||
|
|
||||||
import java.util.concurrent.ScheduledExecutorService;
|
import java.util.concurrent.ScheduledExecutorService;
|
||||||
import java.util.concurrent.ScheduledThreadPoolExecutor;
|
import java.util.concurrent.ScheduledThreadPoolExecutor;
|
||||||
import java.util.concurrent.ThreadPoolExecutor;
|
import java.util.concurrent.ThreadPoolExecutor;
|
||||||
import org.apache.commons.lang3.concurrent.BasicThreadFactory;
|
|
||||||
import org.springframework.context.annotation.Bean;
|
import org.apache.commons.lang3.concurrent.BasicThreadFactory;
|
||||||
import org.springframework.context.annotation.Configuration;
|
import org.springframework.context.annotation.Bean;
|
||||||
import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor;
|
import org.springframework.context.annotation.Configuration;
|
||||||
import com.ruoyi.common.utils.Threads;
|
import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor;
|
||||||
|
import com.ruoyi.common.utils.Threads;
|
||||||
/**
|
|
||||||
* 线程池配置
|
/**
|
||||||
*
|
* 线程池配置
|
||||||
* @author ruoyi
|
*
|
||||||
**/
|
* @author ruoyi
|
||||||
@Configuration
|
**/
|
||||||
public class ThreadPoolConfig
|
@Configuration
|
||||||
{
|
public class ThreadPoolConfig {
|
||||||
// 核心线程池大小
|
// 核心线程池大小
|
||||||
private int corePoolSize = 50;
|
private int corePoolSize = 50;
|
||||||
|
|
||||||
// 最大可创建的线程数
|
// 最大可创建的线程数
|
||||||
private int maxPoolSize = 200;
|
private int maxPoolSize = 200;
|
||||||
|
|
||||||
// 队列最大长度
|
// 队列最大长度
|
||||||
private int queueCapacity = 1000;
|
private int queueCapacity = 1000;
|
||||||
|
|
||||||
// 线程池维护线程所允许的空闲时间
|
// 线程池维护线程所允许的空闲时间
|
||||||
private int keepAliveSeconds = 300;
|
private int keepAliveSeconds = 300;
|
||||||
|
|
||||||
@Bean(name = "threadPoolTaskExecutor")
|
@Bean(name = "threadPoolTaskExecutor")
|
||||||
public ThreadPoolTaskExecutor threadPoolTaskExecutor()
|
public ThreadPoolTaskExecutor threadPoolTaskExecutor() {
|
||||||
{
|
ThreadPoolTaskExecutor executor = new ThreadPoolTaskExecutor();
|
||||||
ThreadPoolTaskExecutor executor = new ThreadPoolTaskExecutor();
|
executor.setMaxPoolSize(maxPoolSize);
|
||||||
executor.setMaxPoolSize(maxPoolSize);
|
executor.setCorePoolSize(corePoolSize);
|
||||||
executor.setCorePoolSize(corePoolSize);
|
executor.setQueueCapacity(queueCapacity);
|
||||||
executor.setQueueCapacity(queueCapacity);
|
executor.setKeepAliveSeconds(keepAliveSeconds);
|
||||||
executor.setKeepAliveSeconds(keepAliveSeconds);
|
// 线程池对拒绝任务(无线程可用)的处理策略
|
||||||
// 线程池对拒绝任务(无线程可用)的处理策略
|
executor.setRejectedExecutionHandler(new ThreadPoolExecutor.CallerRunsPolicy());
|
||||||
executor.setRejectedExecutionHandler(new ThreadPoolExecutor.CallerRunsPolicy());
|
return executor;
|
||||||
return executor;
|
}
|
||||||
}
|
|
||||||
|
/**
|
||||||
/**
|
* 执行周期性或定时任务
|
||||||
* 执行周期性或定时任务
|
*/
|
||||||
*/
|
@Bean(name = "scheduledExecutorService")
|
||||||
@Bean(name = "scheduledExecutorService")
|
protected ScheduledExecutorService scheduledExecutorService() {
|
||||||
protected ScheduledExecutorService scheduledExecutorService()
|
return new ScheduledThreadPoolExecutor(corePoolSize,
|
||||||
{
|
new BasicThreadFactory.Builder().namingPattern("schedule-pool-%d").daemon(true).build()) {
|
||||||
return new ScheduledThreadPoolExecutor(corePoolSize,
|
@Override
|
||||||
new BasicThreadFactory.Builder().namingPattern("schedule-pool-%d").daemon(true).build())
|
protected void afterExecute(Runnable r, Throwable t) {
|
||||||
{
|
super.afterExecute(r, t);
|
||||||
@Override
|
Threads.printException(r, t);
|
||||||
protected void afterExecute(Runnable r, Throwable t)
|
}
|
||||||
{
|
};
|
||||||
super.afterExecute(r, t);
|
}
|
||||||
Threads.printException(r, t);
|
}
|
||||||
}
|
|
||||||
};
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
|
||||||
|
|
@ -1,94 +1,98 @@
|
||||||
package com.ruoyi.common.constant;
|
package com.ruoyi.common.constant;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 通用常量信息
|
* 通用常量信息
|
||||||
*
|
*
|
||||||
* @author ruoyi
|
* @author ruoyi
|
||||||
*/
|
*/
|
||||||
public class Constants
|
public class Constants {
|
||||||
{
|
/**
|
||||||
/**
|
* UTF-8 字符集
|
||||||
* UTF-8 字符集
|
*/
|
||||||
*/
|
public static final String UTF8 = "UTF-8";
|
||||||
public static final String UTF8 = "UTF-8";
|
|
||||||
|
/**
|
||||||
/**
|
* GBK 字符集
|
||||||
* GBK 字符集
|
*/
|
||||||
*/
|
public static final String GBK = "GBK";
|
||||||
public static final String GBK = "GBK";
|
|
||||||
|
/**
|
||||||
/**
|
* 通用成功标识
|
||||||
* 通用成功标识
|
*/
|
||||||
*/
|
public static final String SUCCESS = "0";
|
||||||
public static final String SUCCESS = "0";
|
|
||||||
|
/**
|
||||||
/**
|
* 通用失败标识
|
||||||
* 通用失败标识
|
*/
|
||||||
*/
|
public static final String FAIL = "1";
|
||||||
public static final String FAIL = "1";
|
|
||||||
|
/**
|
||||||
/**
|
* 登录成功
|
||||||
* 登录成功
|
*/
|
||||||
*/
|
public static final String LOGIN_SUCCESS = "Success";
|
||||||
public static final String LOGIN_SUCCESS = "Success";
|
|
||||||
|
/**
|
||||||
/**
|
* 注销
|
||||||
* 注销
|
*/
|
||||||
*/
|
public static final String LOGOUT = "Logout";
|
||||||
public static final String LOGOUT = "Logout";
|
|
||||||
|
/**
|
||||||
/**
|
* 注册
|
||||||
* 注册
|
*/
|
||||||
*/
|
public static final String REGISTER = "Register";
|
||||||
public static final String REGISTER = "Register";
|
|
||||||
|
/**
|
||||||
/**
|
* 登录失败
|
||||||
* 登录失败
|
*/
|
||||||
*/
|
public static final String LOGIN_FAIL = "Error";
|
||||||
public static final String LOGIN_FAIL = "Error";
|
|
||||||
|
/**
|
||||||
/**
|
* 自动去除表前缀
|
||||||
* 当前记录起始索引
|
*/
|
||||||
*/
|
public static final String AUTO_REOMVE_PRE = "true";
|
||||||
public static final String PAGE_NUM = "pageNum";
|
|
||||||
|
/**
|
||||||
/**
|
* 当前记录起始索引
|
||||||
* 每页显示记录数
|
*/
|
||||||
*/
|
public static final String PAGE_NUM = "pageNum";
|
||||||
public static final String PAGE_SIZE = "pageSize";
|
|
||||||
|
/**
|
||||||
/**
|
* 每页显示记录数
|
||||||
* 排序列
|
*/
|
||||||
*/
|
public static final String PAGE_SIZE = "pageSize";
|
||||||
public static final String ORDER_BY_COLUMN = "orderByColumn";
|
|
||||||
|
/**
|
||||||
/**
|
* 排序列
|
||||||
* 排序的方向 "desc" 或者 "asc".
|
*/
|
||||||
*/
|
public static final String ORDER_BY_COLUMN = "orderByColumn";
|
||||||
public static final String IS_ASC = "isAsc";
|
|
||||||
|
/**
|
||||||
/**
|
* 排序的方向 "desc" 或者 "asc".
|
||||||
* 参数管理 cache name
|
*/
|
||||||
*/
|
public static final String IS_ASC = "isAsc";
|
||||||
public static final String SYS_CONFIG_CACHE = "sys-config";
|
|
||||||
|
/**
|
||||||
/**
|
* 参数管理 cache name
|
||||||
* 参数管理 cache key
|
*/
|
||||||
*/
|
public static final String SYS_CONFIG_CACHE = "sys-config";
|
||||||
public static final String SYS_CONFIG_KEY = "sys_config:";
|
|
||||||
|
/**
|
||||||
/**
|
* 参数管理 cache key
|
||||||
* 字典管理 cache name
|
*/
|
||||||
*/
|
public static final String SYS_CONFIG_KEY = "sys_config:";
|
||||||
public static final String SYS_DICT_CACHE = "sys-dict";
|
|
||||||
|
/**
|
||||||
/**
|
* 字典管理 cache name
|
||||||
* 字典管理 cache key
|
*/
|
||||||
*/
|
public static final String SYS_DICT_CACHE = "sys-dict";
|
||||||
public static final String SYS_DICT_KEY = "sys_dict:";
|
|
||||||
|
/**
|
||||||
/**
|
* 字典管理 cache key
|
||||||
* 资源映射路径 前缀
|
*/
|
||||||
*/
|
public static final String SYS_DICT_KEY = "sys_dict:";
|
||||||
public static final String RESOURCE_PREFIX = "/profile";
|
|
||||||
}
|
/**
|
||||||
|
* 资源映射路径 前缀
|
||||||
|
*/
|
||||||
|
public static final String RESOURCE_PREFIX = "/profile";
|
||||||
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,109 +1,109 @@
|
||||||
package com.ruoyi.common.constant;
|
package com.ruoyi.common.constant;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 代码生成通用常量
|
* 代码生成通用常量
|
||||||
*
|
*
|
||||||
* @author ruoyi
|
* @author ruoyi
|
||||||
*/
|
*/
|
||||||
public class GenConstants
|
public class GenConstants
|
||||||
{
|
{
|
||||||
/** 单表(增删改查) */
|
/** 单表(增删改查) */
|
||||||
public static final String TPL_CRUD = "crud";
|
public static final String TPL_CRUD = "crud";
|
||||||
|
|
||||||
/** 树表(增删改查) */
|
/** 树表(增删改查) */
|
||||||
public static final String TPL_TREE = "tree";
|
public static final String TPL_TREE = "tree";
|
||||||
|
|
||||||
/** 主子表(增删改查) */
|
/** 主子表(增删改查) */
|
||||||
public static final String TPL_SUB = "sub";
|
public static final String TPL_SUB = "sub";
|
||||||
|
|
||||||
/** 树编码字段 */
|
/** 树编码字段 */
|
||||||
public static final String TREE_CODE = "treeCode";
|
public static final String TREE_CODE = "treeCode";
|
||||||
|
|
||||||
/** 树父编码字段 */
|
/** 树父编码字段 */
|
||||||
public static final String TREE_PARENT_CODE = "treeParentCode";
|
public static final String TREE_PARENT_CODE = "treeParentCode";
|
||||||
|
|
||||||
/** 树名称字段 */
|
/** 树名称字段 */
|
||||||
public static final String TREE_NAME = "treeName";
|
public static final String TREE_NAME = "treeName";
|
||||||
|
|
||||||
/** 上级菜单ID字段 */
|
/** 上级菜单ID字段 */
|
||||||
public static final String PARENT_MENU_ID = "parentMenuId";
|
public static final String PARENT_MENU_ID = "parentMenuId";
|
||||||
|
|
||||||
/** 上级菜单名称字段 */
|
/** 上级菜单名称字段 */
|
||||||
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", "tinytext", "text",
|
public static final String[] COLUMNTYPE_STR = { "char", "varchar", "nvarchar", "varchar2", "tinytext", "text",
|
||||||
"mediumtext", "longtext" };
|
"mediumtext", "longtext" };
|
||||||
|
|
||||||
/** 数据库时间类型 */
|
/** 数据库时间类型 */
|
||||||
public static final String[] COLUMNTYPE_TIME = { "datetime", "time", "date", "timestamp" };
|
public static final String[] COLUMNTYPE_TIME = { "datetime", "time", "date", "timestamp" };
|
||||||
|
|
||||||
/** 数据库数字类型 */
|
/** 数据库数字类型 */
|
||||||
public static final String[] COLUMNTYPE_NUMBER = { "tinyint", "smallint", "mediumint", "int", "number", "integer",
|
public static final String[] COLUMNTYPE_NUMBER = { "tinyint", "smallint", "mediumint", "int", "number", "integer",
|
||||||
"bigint", "float", "float", "double", "decimal" };
|
"bigint", "float", "float", "double", "decimal" };
|
||||||
|
|
||||||
/** 页面不需要编辑字段 */
|
/** 页面不需要编辑字段 */
|
||||||
public static final String[] COLUMNNAME_NOT_EDIT = { "id", "create_by", "create_time", "del_flag" };
|
public static final String[] COLUMNNAME_NOT_EDIT = { "id", "create_by", "create_time", "del_flag" };
|
||||||
|
|
||||||
/** 页面不需要显示的列表字段 */
|
/** 页面不需要显示的列表字段 */
|
||||||
public static final String[] COLUMNNAME_NOT_LIST = { "id", "create_by", "create_time", "del_flag", "update_by",
|
public static final String[] COLUMNNAME_NOT_LIST = { "id", "create_by", "create_time", "del_flag", "update_by",
|
||||||
"update_time" };
|
"update_time" };
|
||||||
|
|
||||||
/** 页面不需要查询字段 */
|
/** 页面不需要查询字段 */
|
||||||
public static final String[] COLUMNNAME_NOT_QUERY = { "id", "create_by", "create_time", "del_flag", "update_by",
|
public static final String[] COLUMNNAME_NOT_QUERY = { "id", "create_by", "create_time", "del_flag", "update_by",
|
||||||
"update_time", "remark" };
|
"update_time", "remark" };
|
||||||
|
|
||||||
/** Entity基类字段 */
|
/** Entity基类字段 */
|
||||||
public static final String[] BASE_ENTITY = { "createBy", "createTime", "updateBy", "updateTime", "remark" };
|
public static final String[] BASE_ENTITY = { "createBy", "createTime", "updateBy", "updateTime", "remark" };
|
||||||
|
|
||||||
/** Tree基类字段 */
|
/** Tree基类字段 */
|
||||||
public static final String[] TREE_ENTITY = { "parentName", "parentId", "orderNum", "ancestors" };
|
public static final String[] TREE_ENTITY = { "parentName", "parentId", "orderNum", "ancestors" };
|
||||||
|
|
||||||
/** 文本框 */
|
/** 文本框 */
|
||||||
public static final String HTML_INPUT = "input";
|
public static final String HTML_INPUT = "input";
|
||||||
|
|
||||||
/** 文本域 */
|
/** 文本域 */
|
||||||
public static final String HTML_TEXTAREA = "textarea";
|
public static final String HTML_TEXTAREA = "textarea";
|
||||||
|
|
||||||
/** 下拉框 */
|
/** 下拉框 */
|
||||||
public static final String HTML_SELECT = "select";
|
public static final String HTML_SELECT = "select";
|
||||||
|
|
||||||
/** 单选框 */
|
/** 单选框 */
|
||||||
public static final String HTML_RADIO = "radio";
|
public static final String HTML_RADIO = "radio";
|
||||||
|
|
||||||
/** 复选框 */
|
/** 复选框 */
|
||||||
public static final String HTML_CHECKBOX = "checkbox";
|
public static final String HTML_CHECKBOX = "checkbox";
|
||||||
|
|
||||||
/** 日期控件 */
|
/** 日期控件 */
|
||||||
public static final String HTML_DATETIME = "datetime";
|
public static final String HTML_DATETIME = "datetime";
|
||||||
|
|
||||||
/** 上传控件 */
|
/** 上传控件 */
|
||||||
public static final String HTML_UPLOAD = "upload";
|
public static final String HTML_UPLOAD = "upload";
|
||||||
|
|
||||||
/** 富文本控件 */
|
/** 富文本控件 */
|
||||||
public static final String HTML_SUMMERNOTE = "summernote";
|
public static final String HTML_SUMMERNOTE = "summernote";
|
||||||
|
|
||||||
/** 字符串类型 */
|
/** 字符串类型 */
|
||||||
public static final String TYPE_STRING = "String";
|
public static final String TYPE_STRING = "String";
|
||||||
|
|
||||||
/** 整型 */
|
/** 整型 */
|
||||||
public static final String TYPE_INTEGER = "Integer";
|
public static final String TYPE_INTEGER = "Integer";
|
||||||
|
|
||||||
/** 长整型 */
|
/** 长整型 */
|
||||||
public static final String TYPE_LONG = "Long";
|
public static final String TYPE_LONG = "Long";
|
||||||
|
|
||||||
/** 浮点型 */
|
/** 浮点型 */
|
||||||
public static final String TYPE_DOUBLE = "Double";
|
public static final String TYPE_DOUBLE = "Double";
|
||||||
|
|
||||||
/** 高精度计算类型 */
|
/** 高精度计算类型 */
|
||||||
public static final String TYPE_BIGDECIMAL = "BigDecimal";
|
public static final String TYPE_BIGDECIMAL = "BigDecimal";
|
||||||
|
|
||||||
/** 时间类型 */
|
/** 时间类型 */
|
||||||
public static final String TYPE_DATE = "Date";
|
public static final String TYPE_DATE = "Date";
|
||||||
|
|
||||||
/** 模糊查询 */
|
/** 模糊查询 */
|
||||||
public static final String QUERY_LIKE = "LIKE";
|
public static final String QUERY_LIKE = "LIKE";
|
||||||
|
|
||||||
/** 需要 */
|
/** 需要 */
|
||||||
public static final String REQUIRE = "1";
|
public static final String REQUIRE = "1";
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,27 +1,38 @@
|
||||||
package com.ruoyi.common.constant;
|
package com.ruoyi.common.constant;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 权限通用常量
|
* 权限通用常量
|
||||||
*
|
*
|
||||||
* @author ruoyi
|
* @author ruoyi
|
||||||
*/
|
*/
|
||||||
public class PermissionConstants
|
public class PermissionConstants {
|
||||||
{
|
/**
|
||||||
/** 新增权限 */
|
* 新增权限
|
||||||
public static final String ADD_PERMISSION = "add";
|
*/
|
||||||
|
public static final String ADD_PERMISSION = "add";
|
||||||
/** 修改权限 */
|
|
||||||
public static final String EDIT_PERMISSION = "edit";
|
/**
|
||||||
|
* 修改权限
|
||||||
/** 删除权限 */
|
*/
|
||||||
public static final String REMOVE_PERMISSION = "remove";
|
public static final String EDIT_PERMISSION = "edit";
|
||||||
|
|
||||||
/** 导出权限 */
|
/**
|
||||||
public static final String EXPORT_PERMISSION = "export";
|
* 删除权限
|
||||||
|
*/
|
||||||
/** 显示权限 */
|
public static final String REMOVE_PERMISSION = "remove";
|
||||||
public static final String VIEW_PERMISSION = "view";
|
|
||||||
|
/**
|
||||||
/** 查询权限 */
|
* 导出权限
|
||||||
public static final String LIST_PERMISSION = "list";
|
*/
|
||||||
}
|
public static final String EXPORT_PERMISSION = "export";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 显示权限
|
||||||
|
*/
|
||||||
|
public static final String VIEW_PERMISSION = "view";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询权限
|
||||||
|
*/
|
||||||
|
public static final String LIST_PERMISSION = "list";
|
||||||
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,50 +1,50 @@
|
||||||
package com.ruoyi.common.constant;
|
package com.ruoyi.common.constant;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 任务调度通用常量
|
* 任务调度通用常量
|
||||||
*
|
*
|
||||||
* @author ruoyi
|
* @author ruoyi
|
||||||
*/
|
*/
|
||||||
public class ScheduleConstants
|
public class ScheduleConstants
|
||||||
{
|
{
|
||||||
public static final String TASK_CLASS_NAME = "TASK_CLASS_NAME";
|
public static final String TASK_CLASS_NAME = "TASK_CLASS_NAME";
|
||||||
|
|
||||||
/** 执行目标key */
|
/** 执行目标key */
|
||||||
public static final String TASK_PROPERTIES = "TASK_PROPERTIES";
|
public static final String TASK_PROPERTIES = "TASK_PROPERTIES";
|
||||||
|
|
||||||
/** 默认 */
|
/** 默认 */
|
||||||
public static final String MISFIRE_DEFAULT = "0";
|
public static final String MISFIRE_DEFAULT = "0";
|
||||||
|
|
||||||
/** 立即触发执行 */
|
/** 立即触发执行 */
|
||||||
public static final String MISFIRE_IGNORE_MISFIRES = "1";
|
public static final String MISFIRE_IGNORE_MISFIRES = "1";
|
||||||
|
|
||||||
/** 触发一次执行 */
|
/** 触发一次执行 */
|
||||||
public static final String MISFIRE_FIRE_AND_PROCEED = "2";
|
public static final String MISFIRE_FIRE_AND_PROCEED = "2";
|
||||||
|
|
||||||
/** 不触发立即执行 */
|
/** 不触发立即执行 */
|
||||||
public static final String MISFIRE_DO_NOTHING = "3";
|
public static final String MISFIRE_DO_NOTHING = "3";
|
||||||
|
|
||||||
public enum Status
|
public enum Status
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* 正常
|
* 正常
|
||||||
*/
|
*/
|
||||||
NORMAL("0"),
|
NORMAL("0"),
|
||||||
/**
|
/**
|
||||||
* 暂停
|
* 暂停
|
||||||
*/
|
*/
|
||||||
PAUSE("1");
|
PAUSE("1");
|
||||||
|
|
||||||
private String value;
|
private String value;
|
||||||
|
|
||||||
private Status(String value)
|
private Status(String value)
|
||||||
{
|
{
|
||||||
this.value = value;
|
this.value = value;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getValue()
|
public String getValue()
|
||||||
{
|
{
|
||||||
return value;
|
return value;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,74 +1,74 @@
|
||||||
package com.ruoyi.common.constant;
|
package com.ruoyi.common.constant;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Shiro通用常量
|
* Shiro通用常量
|
||||||
*
|
*
|
||||||
* @author ruoyi
|
* @author ruoyi
|
||||||
*/
|
*/
|
||||||
public class ShiroConstants
|
public class ShiroConstants
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* 当前登录的用户
|
* 当前登录的用户
|
||||||
*/
|
*/
|
||||||
public static final String CURRENT_USER = "currentUser";
|
public static final String CURRENT_USER = "currentUser";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 用户名
|
* 用户名
|
||||||
*/
|
*/
|
||||||
public static final String CURRENT_USERNAME = "username";
|
public static final String CURRENT_USERNAME = "username";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 消息key
|
* 消息key
|
||||||
*/
|
*/
|
||||||
public static final String MESSAGE = "message";
|
public static final String MESSAGE = "message";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 错误key
|
* 错误key
|
||||||
*/
|
*/
|
||||||
public static final String ERROR = "errorMsg";
|
public static final String ERROR = "errorMsg";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 编码格式
|
* 编码格式
|
||||||
*/
|
*/
|
||||||
public static final String ENCODING = "UTF-8";
|
public static final String ENCODING = "UTF-8";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 当前在线会话
|
* 当前在线会话
|
||||||
*/
|
*/
|
||||||
public static final String ONLINE_SESSION = "online_session";
|
public static final String ONLINE_SESSION = "online_session";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 验证码key
|
* 验证码key
|
||||||
*/
|
*/
|
||||||
public static final String CURRENT_CAPTCHA = "captcha";
|
public static final String CURRENT_CAPTCHA = "captcha";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 验证码开关
|
* 验证码开关
|
||||||
*/
|
*/
|
||||||
public static final String CURRENT_ENABLED = "captchaEnabled";
|
public static final String CURRENT_ENABLED = "captchaEnabled";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 验证码类型
|
* 验证码类型
|
||||||
*/
|
*/
|
||||||
public static final String CURRENT_TYPE = "captchaType";
|
public static final String CURRENT_TYPE = "captchaType";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 验证码
|
* 验证码
|
||||||
*/
|
*/
|
||||||
public static final String CURRENT_VALIDATECODE = "validateCode";
|
public static final String CURRENT_VALIDATECODE = "validateCode";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 验证码错误
|
* 验证码错误
|
||||||
*/
|
*/
|
||||||
public static final String CAPTCHA_ERROR = "captchaError";
|
public static final String CAPTCHA_ERROR = "captchaError";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 登录记录缓存
|
* 登录记录缓存
|
||||||
*/
|
*/
|
||||||
public static final String LOGINRECORDCACHE = "loginRecordCache";
|
public static final String LOGINRECORDCACHE = "loginRecordCache";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 系统活跃用户缓存
|
* 系统活跃用户缓存
|
||||||
*/
|
*/
|
||||||
public static final String SYS_USERCACHE = "sys-userCache";
|
public static final String SYS_USERCACHE = "sys-userCache";
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,110 +1,110 @@
|
||||||
package com.ruoyi.common.constant;
|
package com.ruoyi.common.constant;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 用户常量信息
|
* 用户常量信息
|
||||||
*
|
*
|
||||||
* @author ruoyi
|
* @author ruoyi
|
||||||
*/
|
*/
|
||||||
public class UserConstants
|
public class UserConstants
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* 平台内系统用户的唯一标志
|
* 平台内系统用户的唯一标志
|
||||||
*/
|
*/
|
||||||
public static final String SYS_USER = "SYS_USER";
|
public static final String SYS_USER = "SYS_USER";
|
||||||
|
|
||||||
/** 正常状态 */
|
/** 正常状态 */
|
||||||
public static final String NORMAL = "0";
|
public static final String NORMAL = "0";
|
||||||
|
|
||||||
/** 异常状态 */
|
/** 异常状态 */
|
||||||
public static final String EXCEPTION = "1";
|
public static final String EXCEPTION = "1";
|
||||||
|
|
||||||
/** 用户封禁状态 */
|
/** 用户封禁状态 */
|
||||||
public static final String USER_DISABLE = "1";
|
public static final String USER_DISABLE = "1";
|
||||||
|
|
||||||
/** 角色封禁状态 */
|
/** 角色封禁状态 */
|
||||||
public static final String ROLE_DISABLE = "1";
|
public static final String ROLE_DISABLE = "1";
|
||||||
|
|
||||||
/** 部门正常状态 */
|
/** 部门正常状态 */
|
||||||
public static final String DEPT_NORMAL = "0";
|
public static final String DEPT_NORMAL = "0";
|
||||||
|
|
||||||
/** 部门停用状态 */
|
/** 部门停用状态 */
|
||||||
public static final String DEPT_DISABLE = "1";
|
public static final String DEPT_DISABLE = "1";
|
||||||
|
|
||||||
/** 字典正常状态 */
|
/** 字典正常状态 */
|
||||||
public static final String DICT_NORMAL = "0";
|
public static final String DICT_NORMAL = "0";
|
||||||
|
|
||||||
/** 是否为系统默认(是) */
|
/** 是否为系统默认(是) */
|
||||||
public static final String YES = "Y";
|
public static final String YES = "Y";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 用户名长度限制
|
* 用户名长度限制
|
||||||
*/
|
*/
|
||||||
public static final int USERNAME_MIN_LENGTH = 2;
|
public static final int USERNAME_MIN_LENGTH = 2;
|
||||||
public static final int USERNAME_MAX_LENGTH = 20;
|
public static final int USERNAME_MAX_LENGTH = 20;
|
||||||
|
|
||||||
/** 登录名称是否唯一的返回结果码 */
|
/** 登录名称是否唯一的返回结果码 */
|
||||||
public final static String USER_NAME_UNIQUE = "0";
|
public final static String USER_NAME_UNIQUE = "0";
|
||||||
public final static String USER_NAME_NOT_UNIQUE = "1";
|
public final static String USER_NAME_NOT_UNIQUE = "1";
|
||||||
|
|
||||||
/** 手机号码是否唯一的返回结果 */
|
/** 手机号码是否唯一的返回结果 */
|
||||||
public final static String USER_PHONE_UNIQUE = "0";
|
public final static String USER_PHONE_UNIQUE = "0";
|
||||||
public final static String USER_PHONE_NOT_UNIQUE = "1";
|
public final static String USER_PHONE_NOT_UNIQUE = "1";
|
||||||
|
|
||||||
/** e-mail 是否唯一的返回结果 */
|
/** e-mail 是否唯一的返回结果 */
|
||||||
public final static String USER_EMAIL_UNIQUE = "0";
|
public final static String USER_EMAIL_UNIQUE = "0";
|
||||||
public final static String USER_EMAIL_NOT_UNIQUE = "1";
|
public final static String USER_EMAIL_NOT_UNIQUE = "1";
|
||||||
|
|
||||||
/** 部门名称是否唯一的返回结果码 */
|
/** 部门名称是否唯一的返回结果码 */
|
||||||
public final static String DEPT_NAME_UNIQUE = "0";
|
public final static String DEPT_NAME_UNIQUE = "0";
|
||||||
public final static String DEPT_NAME_NOT_UNIQUE = "1";
|
public final static String DEPT_NAME_NOT_UNIQUE = "1";
|
||||||
|
|
||||||
/** 角色名称是否唯一的返回结果码 */
|
/** 角色名称是否唯一的返回结果码 */
|
||||||
public final static String ROLE_NAME_UNIQUE = "0";
|
public final static String ROLE_NAME_UNIQUE = "0";
|
||||||
public final static String ROLE_NAME_NOT_UNIQUE = "1";
|
public final static String ROLE_NAME_NOT_UNIQUE = "1";
|
||||||
|
|
||||||
/** 岗位名称是否唯一的返回结果码 */
|
/** 岗位名称是否唯一的返回结果码 */
|
||||||
public final static String POST_NAME_UNIQUE = "0";
|
public final static String POST_NAME_UNIQUE = "0";
|
||||||
public final static String POST_NAME_NOT_UNIQUE = "1";
|
public final static String POST_NAME_NOT_UNIQUE = "1";
|
||||||
|
|
||||||
/** 角色权限是否唯一的返回结果码 */
|
/** 角色权限是否唯一的返回结果码 */
|
||||||
public final static String ROLE_KEY_UNIQUE = "0";
|
public final static String ROLE_KEY_UNIQUE = "0";
|
||||||
public final static String ROLE_KEY_NOT_UNIQUE = "1";
|
public final static String ROLE_KEY_NOT_UNIQUE = "1";
|
||||||
|
|
||||||
/** 岗位编码是否唯一的返回结果码 */
|
/** 岗位编码是否唯一的返回结果码 */
|
||||||
public final static String POST_CODE_UNIQUE = "0";
|
public final static String POST_CODE_UNIQUE = "0";
|
||||||
public final static String POST_CODE_NOT_UNIQUE = "1";
|
public final static String POST_CODE_NOT_UNIQUE = "1";
|
||||||
|
|
||||||
/** 菜单名称是否唯一的返回结果码 */
|
/** 菜单名称是否唯一的返回结果码 */
|
||||||
public final static String MENU_NAME_UNIQUE = "0";
|
public final static String MENU_NAME_UNIQUE = "0";
|
||||||
public final static String MENU_NAME_NOT_UNIQUE = "1";
|
public final static String MENU_NAME_NOT_UNIQUE = "1";
|
||||||
|
|
||||||
/** 字典类型是否唯一的返回结果码 */
|
/** 字典类型是否唯一的返回结果码 */
|
||||||
public final static String DICT_TYPE_UNIQUE = "0";
|
public final static String DICT_TYPE_UNIQUE = "0";
|
||||||
public final static String DICT_TYPE_NOT_UNIQUE = "1";
|
public final static String DICT_TYPE_NOT_UNIQUE = "1";
|
||||||
|
|
||||||
/** 参数键名是否唯一的返回结果码 */
|
/** 参数键名是否唯一的返回结果码 */
|
||||||
public final static String CONFIG_KEY_UNIQUE = "0";
|
public final static String CONFIG_KEY_UNIQUE = "0";
|
||||||
public final static String CONFIG_KEY_NOT_UNIQUE = "1";
|
public final static String CONFIG_KEY_NOT_UNIQUE = "1";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 密码长度限制
|
* 密码长度限制
|
||||||
*/
|
*/
|
||||||
public static final int PASSWORD_MIN_LENGTH = 5;
|
public static final int PASSWORD_MIN_LENGTH = 5;
|
||||||
public static final int PASSWORD_MAX_LENGTH = 20;
|
public static final int PASSWORD_MAX_LENGTH = 20;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 用户类型
|
* 用户类型
|
||||||
*/
|
*/
|
||||||
public static final String SYSTEM_USER_TYPE = "00";
|
public static final String SYSTEM_USER_TYPE = "00";
|
||||||
public static final String REGISTER_USER_TYPE = "01";
|
public static final String REGISTER_USER_TYPE = "01";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 手机号码格式限制
|
* 手机号码格式限制
|
||||||
*/
|
*/
|
||||||
public static final String MOBILE_PHONE_NUMBER_PATTERN = "^0{0,1}(13[0-9]|15[0-9]|14[0-9]|18[0-9])[0-9]{8}$";
|
public static final String MOBILE_PHONE_NUMBER_PATTERN = "^0{0,1}(13[0-9]|15[0-9]|14[0-9]|18[0-9])[0-9]{8}$";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 邮箱格式限制
|
* 邮箱格式限制
|
||||||
*/
|
*/
|
||||||
public static final String EMAIL_PATTERN = "^((([a-z]|\\d|[!#\\$%&'\\*\\+\\-\\/=\\?\\^_`{\\|}~]|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])+(\\.([a-z]|\\d|[!#\\$%&'\\*\\+\\-\\/=\\?\\^_`{\\|}~]|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])+)*)|((\\x22)((((\\x20|\\x09)*(\\x0d\\x0a))?(\\x20|\\x09)+)?(([\\x01-\\x08\\x0b\\x0c\\x0e-\\x1f\\x7f]|\\x21|[\\x23-\\x5b]|[\\x5d-\\x7e]|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])|(\\\\([\\x01-\\x09\\x0b\\x0c\\x0d-\\x7f]|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF]))))*(((\\x20|\\x09)*(\\x0d\\x0a))?(\\x20|\\x09)+)?(\\x22)))@((([a-z]|\\d|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])|(([a-z]|\\d|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])([a-z]|\\d|-|\\.|_|~|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])*([a-z]|\\d|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])))\\.)+(([a-z]|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])|(([a-z]|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])([a-z]|\\d|-|\\.|_|~|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])*([a-z]|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])))\\.?";
|
public static final String EMAIL_PATTERN = "^((([a-z]|\\d|[!#\\$%&'\\*\\+\\-\\/=\\?\\^_`{\\|}~]|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])+(\\.([a-z]|\\d|[!#\\$%&'\\*\\+\\-\\/=\\?\\^_`{\\|}~]|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])+)*)|((\\x22)((((\\x20|\\x09)*(\\x0d\\x0a))?(\\x20|\\x09)+)?(([\\x01-\\x08\\x0b\\x0c\\x0e-\\x1f\\x7f]|\\x21|[\\x23-\\x5b]|[\\x5d-\\x7e]|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])|(\\\\([\\x01-\\x09\\x0b\\x0c\\x0d-\\x7f]|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF]))))*(((\\x20|\\x09)*(\\x0d\\x0a))?(\\x20|\\x09)+)?(\\x22)))@((([a-z]|\\d|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])|(([a-z]|\\d|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])([a-z]|\\d|-|\\.|_|~|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])*([a-z]|\\d|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])))\\.)+(([a-z]|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])|(([a-z]|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])([a-z]|\\d|-|\\.|_|~|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])*([a-z]|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])))\\.?";
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,185 +1,175 @@
|
||||||
package com.ruoyi.common.core.controller;
|
package com.ruoyi.common.core.controller;
|
||||||
|
|
||||||
import java.beans.PropertyEditorSupport;
|
import com.ruoyi.common.core.domain.AjaxResult;
|
||||||
import java.util.Date;
|
import com.ruoyi.common.core.domain.AjaxResult.Type;
|
||||||
import java.util.List;
|
import com.ruoyi.common.core.page.PageDomain;
|
||||||
import javax.servlet.http.HttpServletRequest;
|
import com.ruoyi.common.core.page.TableDataInfo;
|
||||||
import javax.servlet.http.HttpServletResponse;
|
import com.ruoyi.common.core.page.TableSupport;
|
||||||
import javax.servlet.http.HttpSession;
|
import com.ruoyi.common.utils.DateUtils;
|
||||||
import org.slf4j.Logger;
|
import com.ruoyi.common.utils.ServletUtils;
|
||||||
import org.slf4j.LoggerFactory;
|
import com.ruoyi.common.utils.StringUtils;
|
||||||
import org.springframework.web.bind.WebDataBinder;
|
import com.ruoyi.common.utils.sql.SqlUtil;
|
||||||
import org.springframework.web.bind.annotation.InitBinder;
|
import org.slf4j.Logger;
|
||||||
import com.github.pagehelper.PageHelper;
|
import org.slf4j.LoggerFactory;
|
||||||
import com.github.pagehelper.PageInfo;
|
import org.springframework.data.domain.PageRequest;
|
||||||
import com.ruoyi.common.core.domain.AjaxResult;
|
import org.springframework.data.domain.Pageable;
|
||||||
import com.ruoyi.common.core.domain.AjaxResult.Type;
|
import org.springframework.data.domain.Sort;
|
||||||
import com.ruoyi.common.core.page.PageDomain;
|
import org.springframework.web.bind.WebDataBinder;
|
||||||
import com.ruoyi.common.core.page.TableDataInfo;
|
import org.springframework.web.bind.annotation.InitBinder;
|
||||||
import com.ruoyi.common.core.page.TableSupport;
|
|
||||||
import com.ruoyi.common.utils.DateUtils;
|
import javax.servlet.http.HttpServletRequest;
|
||||||
import com.ruoyi.common.utils.ServletUtils;
|
import javax.servlet.http.HttpServletResponse;
|
||||||
import com.ruoyi.common.utils.StringUtils;
|
import javax.servlet.http.HttpSession;
|
||||||
import com.ruoyi.common.utils.sql.SqlUtil;
|
import java.beans.PropertyEditorSupport;
|
||||||
|
import java.util.Date;
|
||||||
/**
|
import java.util.List;
|
||||||
* web层通用数据处理
|
|
||||||
*
|
/**
|
||||||
* @author ruoyi
|
* web层通用数据处理
|
||||||
*/
|
*
|
||||||
public class BaseController
|
* @author ruoyi
|
||||||
{
|
*/
|
||||||
protected final Logger logger = LoggerFactory.getLogger(BaseController.class);
|
public class BaseController {
|
||||||
|
protected final Logger logger = LoggerFactory.getLogger(BaseController.class);
|
||||||
/**
|
|
||||||
* 将前台传递过来的日期格式的字符串,自动转化为Date类型
|
/**
|
||||||
*/
|
* 将前台传递过来的日期格式的字符串,自动转化为Date类型
|
||||||
@InitBinder
|
*/
|
||||||
public void initBinder(WebDataBinder binder)
|
@InitBinder
|
||||||
{
|
public void initBinder(WebDataBinder binder) {
|
||||||
// Date 类型转换
|
// Date 类型转换
|
||||||
binder.registerCustomEditor(Date.class, new PropertyEditorSupport()
|
binder.registerCustomEditor(Date.class, new PropertyEditorSupport() {
|
||||||
{
|
@Override
|
||||||
@Override
|
public void setAsText(String text) {
|
||||||
public void setAsText(String text)
|
setValue(DateUtils.parseDate(text));
|
||||||
{
|
}
|
||||||
setValue(DateUtils.parseDate(text));
|
});
|
||||||
}
|
}
|
||||||
});
|
|
||||||
}
|
/**
|
||||||
|
* 获取request
|
||||||
/**
|
*/
|
||||||
* 设置请求分页数据
|
public HttpServletRequest getRequest() {
|
||||||
*/
|
return ServletUtils.getRequest();
|
||||||
protected void startPage()
|
}
|
||||||
{
|
|
||||||
PageDomain pageDomain = TableSupport.buildPageRequest();
|
/**
|
||||||
Integer pageNum = pageDomain.getPageNum();
|
* 获取response
|
||||||
Integer pageSize = pageDomain.getPageSize();
|
*/
|
||||||
if (StringUtils.isNotNull(pageNum) && StringUtils.isNotNull(pageSize))
|
public HttpServletResponse getResponse() {
|
||||||
{
|
return ServletUtils.getResponse();
|
||||||
String orderBy = SqlUtil.escapeOrderBySql(pageDomain.getOrderBy());
|
}
|
||||||
PageHelper.startPage(pageNum, pageSize, orderBy);
|
|
||||||
}
|
/**
|
||||||
}
|
* 获取session
|
||||||
|
*/
|
||||||
/**
|
public HttpSession getSession() {
|
||||||
* 设置请求排序数据
|
return getRequest().getSession();
|
||||||
*/
|
}
|
||||||
protected void startOrderBy()
|
|
||||||
{
|
/**
|
||||||
PageDomain pageDomain = TableSupport.buildPageRequest();
|
* 设置请求分页数据
|
||||||
if (StringUtils.isNotEmpty(pageDomain.getOrderBy()))
|
*/
|
||||||
{
|
protected Pageable getPageRequest() {
|
||||||
String orderBy = SqlUtil.escapeOrderBySql(pageDomain.getOrderBy());
|
PageDomain pageDomain = TableSupport.buildPageRequest();
|
||||||
PageHelper.orderBy(orderBy);
|
Integer pageNum = pageDomain.getPageNum();
|
||||||
}
|
Integer pageSize = pageDomain.getPageSize();
|
||||||
}
|
if (StringUtils.isNotNull(pageNum) && StringUtils.isNotNull(pageSize)) {
|
||||||
|
String attribute = pageDomain.getOrderByColumn();
|
||||||
/**
|
if(StringUtils.isNotEmpty(attribute)){
|
||||||
* 获取request
|
Sort.Order order = null;
|
||||||
*/
|
if("desc".equals(pageDomain.getIsAsc())){
|
||||||
public HttpServletRequest getRequest()
|
order = Sort.Order.desc(attribute);
|
||||||
{
|
}else{
|
||||||
return ServletUtils.getRequest();
|
order = Sort.Order.asc(attribute);
|
||||||
}
|
}
|
||||||
|
return PageRequest.of(pageNum-1, pageSize, Sort.by(order));
|
||||||
/**
|
}else{
|
||||||
* 获取response
|
return PageRequest.of(pageNum-1, pageSize);
|
||||||
*/
|
}
|
||||||
public HttpServletResponse getResponse()
|
}else{
|
||||||
{
|
return PageRequest.of(0,10);
|
||||||
return ServletUtils.getResponse();
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取session
|
* 响应请求分页数据
|
||||||
*/
|
*/
|
||||||
public HttpSession getSession()
|
@SuppressWarnings({"rawtypes", "unchecked"})
|
||||||
{
|
protected TableDataInfo getDataTable(org.springframework.data.domain.Page<?> page) {
|
||||||
return getRequest().getSession();
|
TableDataInfo rspData = new TableDataInfo();
|
||||||
}
|
rspData.setCode(0);
|
||||||
|
rspData.setRows(page.getContent());
|
||||||
/**
|
rspData.setTotal(page.getTotalElements());
|
||||||
* 响应请求分页数据
|
return rspData;
|
||||||
*/
|
}
|
||||||
@SuppressWarnings({ "rawtypes", "unchecked" })
|
|
||||||
protected TableDataInfo getDataTable(List<?> list)
|
/**
|
||||||
{
|
* 响应返回结果
|
||||||
TableDataInfo rspData = new TableDataInfo();
|
*
|
||||||
rspData.setCode(0);
|
* @param rows 影响行数
|
||||||
rspData.setRows(list);
|
* @return 操作结果
|
||||||
rspData.setTotal(new PageInfo(list).getTotal());
|
*/
|
||||||
return rspData;
|
protected AjaxResult toAjax(int rows) {
|
||||||
}
|
return rows > 0 ? success() : error();
|
||||||
|
}
|
||||||
/**
|
|
||||||
* 响应返回结果
|
/**
|
||||||
*
|
* 响应返回结果
|
||||||
* @param rows 影响行数
|
*
|
||||||
* @return 操作结果
|
* @param result 结果
|
||||||
*/
|
* @return 操作结果
|
||||||
protected AjaxResult toAjax(int rows)
|
*/
|
||||||
{
|
protected AjaxResult toAjax(boolean result) {
|
||||||
return rows > 0 ? success() : error();
|
return result ? success() : error();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 响应返回结果
|
* 返回成功
|
||||||
*
|
*/
|
||||||
* @param result 结果
|
public AjaxResult success() {
|
||||||
* @return 操作结果
|
return AjaxResult.success();
|
||||||
*/
|
}
|
||||||
protected AjaxResult toAjax(boolean result)
|
|
||||||
{
|
public <T> AjaxResult success(T data) {
|
||||||
return result ? success() : error();
|
AjaxResult result = AjaxResult.success();
|
||||||
}
|
result.put("data", data);
|
||||||
|
return result;
|
||||||
/**
|
}
|
||||||
* 返回成功
|
|
||||||
*/
|
/**
|
||||||
public AjaxResult success()
|
* 返回失败消息
|
||||||
{
|
*/
|
||||||
return AjaxResult.success();
|
public AjaxResult error() {
|
||||||
}
|
return AjaxResult.error();
|
||||||
|
}
|
||||||
/**
|
|
||||||
* 返回失败消息
|
/**
|
||||||
*/
|
* 返回成功消息
|
||||||
public AjaxResult error()
|
*/
|
||||||
{
|
public AjaxResult success(String message) {
|
||||||
return AjaxResult.error();
|
return AjaxResult.success(message);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 返回成功消息
|
* 返回失败消息
|
||||||
*/
|
*/
|
||||||
public AjaxResult success(String message)
|
public AjaxResult error(String message) {
|
||||||
{
|
return AjaxResult.error(message);
|
||||||
return AjaxResult.success(message);
|
}
|
||||||
}
|
|
||||||
|
/**
|
||||||
/**
|
* 返回错误码消息
|
||||||
* 返回失败消息
|
*/
|
||||||
*/
|
public AjaxResult error(Type type, String message) {
|
||||||
public AjaxResult error(String message)
|
return new AjaxResult(type, message);
|
||||||
{
|
}
|
||||||
return AjaxResult.error(message);
|
|
||||||
}
|
/**
|
||||||
|
* 页面跳转
|
||||||
/**
|
*/
|
||||||
* 返回错误码消息
|
public String redirect(String url) {
|
||||||
*/
|
return StringUtils.format("redirect:{}", url);
|
||||||
public AjaxResult error(Type type, String message)
|
}
|
||||||
{
|
|
||||||
return new AjaxResult(type, message);
|
}
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 页面跳转
|
|
||||||
*/
|
|
||||||
public String redirect(String url)
|
|
||||||
{
|
|
||||||
return StringUtils.format("redirect:{}", url);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
|
||||||
|
|
@ -1,182 +1,178 @@
|
||||||
package com.ruoyi.common.core.domain;
|
package com.ruoyi.common.core.domain;
|
||||||
|
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import com.ruoyi.common.utils.StringUtils;
|
|
||||||
|
import com.ruoyi.common.utils.StringUtils;
|
||||||
/**
|
|
||||||
* 操作消息提醒
|
/**
|
||||||
*
|
* 操作消息提醒
|
||||||
* @author ruoyi
|
*
|
||||||
*/
|
* @author ruoyi
|
||||||
public class AjaxResult extends HashMap<String, Object>
|
*/
|
||||||
{
|
public class AjaxResult extends HashMap<String, Object> {
|
||||||
private static final long serialVersionUID = 1L;
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
/** 状态码 */
|
/**
|
||||||
public static final String CODE_TAG = "code";
|
* 状态码
|
||||||
|
*/
|
||||||
/** 返回内容 */
|
public static final String CODE_TAG = "code";
|
||||||
public static final String MSG_TAG = "msg";
|
|
||||||
|
/**
|
||||||
/** 数据对象 */
|
* 返回内容
|
||||||
public static final String DATA_TAG = "data";
|
*/
|
||||||
|
public static final String MSG_TAG = "msg";
|
||||||
/**
|
|
||||||
* 状态类型
|
/**
|
||||||
*/
|
* 数据对象
|
||||||
public enum Type
|
*/
|
||||||
{
|
public static final String DATA_TAG = "data";
|
||||||
/** 成功 */
|
|
||||||
SUCCESS(0),
|
/**
|
||||||
/** 警告 */
|
* 状态类型
|
||||||
WARN(301),
|
*/
|
||||||
/** 错误 */
|
public enum Type {
|
||||||
ERROR(500);
|
/**
|
||||||
private final int value;
|
* 成功
|
||||||
|
*/
|
||||||
Type(int value)
|
SUCCESS(0),
|
||||||
{
|
/**
|
||||||
this.value = value;
|
* 警告
|
||||||
}
|
*/
|
||||||
|
WARN(301),
|
||||||
public int value()
|
/**
|
||||||
{
|
* 错误
|
||||||
return this.value;
|
*/
|
||||||
}
|
ERROR(500);
|
||||||
}
|
private final int value;
|
||||||
|
|
||||||
/**
|
Type(int value) {
|
||||||
* 初始化一个新创建的 AjaxResult 对象,使其表示一个空消息。
|
this.value = value;
|
||||||
*/
|
}
|
||||||
public AjaxResult()
|
|
||||||
{
|
public int value() {
|
||||||
}
|
return this.value;
|
||||||
|
}
|
||||||
/**
|
}
|
||||||
* 初始化一个新创建的 AjaxResult 对象
|
|
||||||
*
|
/**
|
||||||
* @param type 状态类型
|
* 初始化一个新创建的 AjaxResult 对象,使其表示一个空消息。
|
||||||
* @param msg 返回内容
|
*/
|
||||||
*/
|
public AjaxResult() {
|
||||||
public AjaxResult(Type type, String msg)
|
}
|
||||||
{
|
|
||||||
super.put(CODE_TAG, type.value);
|
/**
|
||||||
super.put(MSG_TAG, msg);
|
* 初始化一个新创建的 AjaxResult 对象
|
||||||
}
|
*
|
||||||
|
* @param type 状态类型
|
||||||
/**
|
* @param msg 返回内容
|
||||||
* 初始化一个新创建的 AjaxResult 对象
|
*/
|
||||||
*
|
public AjaxResult(Type type, String msg) {
|
||||||
* @param type 状态类型
|
super.put(CODE_TAG, type.value);
|
||||||
* @param msg 返回内容
|
super.put(MSG_TAG, msg);
|
||||||
* @param data 数据对象
|
}
|
||||||
*/
|
|
||||||
public AjaxResult(Type type, String msg, Object data)
|
/**
|
||||||
{
|
* 初始化一个新创建的 AjaxResult 对象
|
||||||
super.put(CODE_TAG, type.value);
|
*
|
||||||
super.put(MSG_TAG, msg);
|
* @param type 状态类型
|
||||||
if (StringUtils.isNotNull(data))
|
* @param msg 返回内容
|
||||||
{
|
* @param data 数据对象
|
||||||
super.put(DATA_TAG, data);
|
*/
|
||||||
}
|
public AjaxResult(Type type, String msg, Object data) {
|
||||||
}
|
super.put(CODE_TAG, type.value);
|
||||||
|
super.put(MSG_TAG, msg);
|
||||||
/**
|
if (StringUtils.isNotNull(data)) {
|
||||||
* 返回成功消息
|
super.put(DATA_TAG, data);
|
||||||
*
|
}
|
||||||
* @return 成功消息
|
}
|
||||||
*/
|
|
||||||
public static AjaxResult success()
|
/**
|
||||||
{
|
* 返回成功消息
|
||||||
return AjaxResult.success("操作成功");
|
*
|
||||||
}
|
* @return 成功消息
|
||||||
|
*/
|
||||||
/**
|
public static AjaxResult success() {
|
||||||
* 返回成功数据
|
return AjaxResult.success("操作成功");
|
||||||
*
|
}
|
||||||
* @return 成功消息
|
|
||||||
*/
|
/**
|
||||||
public static AjaxResult success(Object data)
|
* 返回成功数据
|
||||||
{
|
*
|
||||||
return AjaxResult.success("操作成功", data);
|
* @return 成功消息
|
||||||
}
|
*/
|
||||||
|
public static AjaxResult success(Object data) {
|
||||||
/**
|
return AjaxResult.success("操作成功", data);
|
||||||
* 返回成功消息
|
}
|
||||||
*
|
|
||||||
* @param msg 返回内容
|
/**
|
||||||
* @return 成功消息
|
* 返回成功消息
|
||||||
*/
|
*
|
||||||
public static AjaxResult success(String msg)
|
* @param msg 返回内容
|
||||||
{
|
* @return 成功消息
|
||||||
return AjaxResult.success(msg, null);
|
*/
|
||||||
}
|
public static AjaxResult success(String msg) {
|
||||||
|
return AjaxResult.success(msg, null);
|
||||||
/**
|
}
|
||||||
* 返回成功消息
|
|
||||||
*
|
/**
|
||||||
* @param msg 返回内容
|
* 返回成功消息
|
||||||
* @param data 数据对象
|
*
|
||||||
* @return 成功消息
|
* @param msg 返回内容
|
||||||
*/
|
* @param data 数据对象
|
||||||
public static AjaxResult success(String msg, Object data)
|
* @return 成功消息
|
||||||
{
|
*/
|
||||||
return new AjaxResult(Type.SUCCESS, msg, data);
|
public static AjaxResult success(String msg, Object data) {
|
||||||
}
|
return new AjaxResult(Type.SUCCESS, msg, data);
|
||||||
|
}
|
||||||
/**
|
|
||||||
* 返回警告消息
|
/**
|
||||||
*
|
* 返回警告消息
|
||||||
* @param msg 返回内容
|
*
|
||||||
* @return 警告消息
|
* @param msg 返回内容
|
||||||
*/
|
* @return 警告消息
|
||||||
public static AjaxResult warn(String msg)
|
*/
|
||||||
{
|
public static AjaxResult warn(String msg) {
|
||||||
return AjaxResult.warn(msg, null);
|
return AjaxResult.warn(msg, null);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 返回警告消息
|
* 返回警告消息
|
||||||
*
|
*
|
||||||
* @param msg 返回内容
|
* @param msg 返回内容
|
||||||
* @param data 数据对象
|
* @param data 数据对象
|
||||||
* @return 警告消息
|
* @return 警告消息
|
||||||
*/
|
*/
|
||||||
public static AjaxResult warn(String msg, Object data)
|
public static AjaxResult warn(String msg, Object data) {
|
||||||
{
|
return new AjaxResult(Type.WARN, msg, data);
|
||||||
return new AjaxResult(Type.WARN, msg, data);
|
}
|
||||||
}
|
|
||||||
|
/**
|
||||||
/**
|
* 返回错误消息
|
||||||
* 返回错误消息
|
*
|
||||||
*
|
* @return
|
||||||
* @return
|
*/
|
||||||
*/
|
public static AjaxResult error() {
|
||||||
public static AjaxResult error()
|
return AjaxResult.error("操作失败");
|
||||||
{
|
}
|
||||||
return AjaxResult.error("操作失败");
|
|
||||||
}
|
/**
|
||||||
|
* 返回错误消息
|
||||||
/**
|
*
|
||||||
* 返回错误消息
|
* @param msg 返回内容
|
||||||
*
|
* @return 警告消息
|
||||||
* @param msg 返回内容
|
*/
|
||||||
* @return 警告消息
|
public static AjaxResult error(String msg) {
|
||||||
*/
|
return AjaxResult.error(msg, null);
|
||||||
public static AjaxResult error(String msg)
|
}
|
||||||
{
|
|
||||||
return AjaxResult.error(msg, null);
|
/**
|
||||||
}
|
* 返回错误消息
|
||||||
|
*
|
||||||
/**
|
* @param msg 返回内容
|
||||||
* 返回错误消息
|
* @param data 数据对象
|
||||||
*
|
* @return 警告消息
|
||||||
* @param msg 返回内容
|
*/
|
||||||
* @param data 数据对象
|
public static AjaxResult error(String msg, Object data) {
|
||||||
* @return 警告消息
|
return new AjaxResult(Type.ERROR, msg, data);
|
||||||
*/
|
}
|
||||||
public static AjaxResult error(String msg, Object data)
|
}
|
||||||
{
|
|
||||||
return new AjaxResult(Type.ERROR, msg, data);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,123 @@
|
||||||
|
package com.ruoyi.common.core.domain;
|
||||||
|
|
||||||
|
import com.ruoyi.common.core.domain.enums.ActiveState;
|
||||||
|
import com.ruoyi.common.core.domain.enums.DeleteState;
|
||||||
|
import org.springframework.data.annotation.CreatedBy;
|
||||||
|
import org.springframework.data.annotation.CreatedDate;
|
||||||
|
import org.springframework.data.annotation.LastModifiedBy;
|
||||||
|
import org.springframework.data.annotation.LastModifiedDate;
|
||||||
|
import org.springframework.data.jpa.domain.support.AuditingEntityListener;
|
||||||
|
|
||||||
|
import javax.persistence.*;
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
@MappedSuperclass
|
||||||
|
@EntityListeners(AuditingEntityListener.class)
|
||||||
|
public class BaseDatabaseEntity implements Serializable {
|
||||||
|
|
||||||
|
@Id
|
||||||
|
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
@CreatedDate
|
||||||
|
@Column(updatable = false)
|
||||||
|
private Date createDate;
|
||||||
|
|
||||||
|
@CreatedBy
|
||||||
|
@Column(updatable = false)
|
||||||
|
private Long createBy;
|
||||||
|
|
||||||
|
@LastModifiedDate
|
||||||
|
private Date updateDate;
|
||||||
|
|
||||||
|
@LastModifiedBy
|
||||||
|
private Long updateBy;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除状态
|
||||||
|
*/
|
||||||
|
private DeleteState deleteState = DeleteState.NOT_DELETED;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 启用状态
|
||||||
|
*/
|
||||||
|
private ActiveState activeState = ActiveState.enabled;
|
||||||
|
|
||||||
|
@Version
|
||||||
|
private Integer version;
|
||||||
|
|
||||||
|
private String remark;
|
||||||
|
|
||||||
|
public Long getId() {
|
||||||
|
return id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setId(Long id) {
|
||||||
|
this.id = id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Date getCreateDate() {
|
||||||
|
return createDate;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCreateDate(Date createDate) {
|
||||||
|
this.createDate = createDate;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Long getCreateBy() {
|
||||||
|
return createBy;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCreateBy(Long createBy) {
|
||||||
|
this.createBy = createBy;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Date getUpdateDate() {
|
||||||
|
return updateDate;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setUpdateDate(Date updateDate) {
|
||||||
|
this.updateDate = updateDate;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Long getUpdateBy() {
|
||||||
|
return updateBy;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setUpdateBy(Long updateBy) {
|
||||||
|
this.updateBy = updateBy;
|
||||||
|
}
|
||||||
|
|
||||||
|
public DeleteState getDeleteState() {
|
||||||
|
return deleteState;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setDeleteState(DeleteState deleteState) {
|
||||||
|
this.deleteState = deleteState;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Integer getVersion() {
|
||||||
|
return version;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setVersion(Integer version) {
|
||||||
|
this.version = version;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getRemark() {
|
||||||
|
return remark;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setRemark(String remark) {
|
||||||
|
this.remark = remark;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ActiveState getActiveState() {
|
||||||
|
return activeState;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setActiveState(ActiveState activeState) {
|
||||||
|
this.activeState = activeState;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -1,114 +1,162 @@
|
||||||
package com.ruoyi.common.core.domain;
|
package com.ruoyi.common.core.domain;
|
||||||
|
|
||||||
import java.io.Serializable;
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
import java.util.Date;
|
import org.hibernate.annotations.DynamicUpdate;
|
||||||
import java.util.HashMap;
|
import org.hibernate.annotations.SelectBeforeUpdate;
|
||||||
import java.util.Map;
|
import org.springframework.data.annotation.CreatedBy;
|
||||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
import org.springframework.data.annotation.CreatedDate;
|
||||||
|
import org.springframework.data.annotation.LastModifiedBy;
|
||||||
/**
|
import org.springframework.data.annotation.LastModifiedDate;
|
||||||
* Entity基类
|
import org.springframework.data.jpa.domain.support.AuditingEntityListener;
|
||||||
*
|
|
||||||
* @author ruoyi
|
import javax.persistence.Column;
|
||||||
*/
|
import javax.persistence.EntityListeners;
|
||||||
public class BaseEntity implements Serializable
|
import javax.persistence.MappedSuperclass;
|
||||||
{
|
import javax.persistence.Transient;
|
||||||
private static final long serialVersionUID = 1L;
|
import java.io.Serializable;
|
||||||
|
import java.util.Date;
|
||||||
/** 搜索值 */
|
import java.util.HashMap;
|
||||||
private String searchValue;
|
import java.util.Map;
|
||||||
|
|
||||||
/** 创建者 */
|
/**
|
||||||
private String createBy;
|
* Entity基类
|
||||||
|
*
|
||||||
/** 创建时间 */
|
* @author ruoyi
|
||||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
*/
|
||||||
private Date createTime;
|
@MappedSuperclass
|
||||||
|
@EntityListeners(AuditingEntityListener.class)
|
||||||
/** 更新者 */
|
@SelectBeforeUpdate
|
||||||
private String updateBy;
|
@DynamicUpdate
|
||||||
|
public class BaseEntity implements Serializable {
|
||||||
/** 更新时间 */
|
|
||||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
public static final String NOT_DELETED = "0";
|
||||||
private Date updateTime;
|
public static final String DELETED = "1";
|
||||||
|
|
||||||
/** 备注 */
|
private static final long serialVersionUID = 1L;
|
||||||
private String remark;
|
|
||||||
|
/**
|
||||||
/** 请求参数 */
|
* 搜索值
|
||||||
private Map<String, Object> params;
|
*/
|
||||||
|
@Transient
|
||||||
public String getSearchValue()
|
private String searchValue;
|
||||||
{
|
|
||||||
return searchValue;
|
/**
|
||||||
}
|
* 创建者
|
||||||
|
*/
|
||||||
public void setSearchValue(String searchValue)
|
@CreatedBy
|
||||||
{
|
@Column(updatable = false)
|
||||||
this.searchValue = searchValue;
|
private String createBy;
|
||||||
}
|
|
||||||
|
/**
|
||||||
public String getCreateBy()
|
* 创建时间
|
||||||
{
|
*/
|
||||||
return createBy;
|
@CreatedDate
|
||||||
}
|
@Column(updatable = false)
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
public void setCreateBy(String createBy)
|
private Date createTime;
|
||||||
{
|
|
||||||
this.createBy = createBy;
|
/**
|
||||||
}
|
* 更新者
|
||||||
|
*/
|
||||||
public Date getCreateTime()
|
@LastModifiedBy
|
||||||
{
|
private String updateBy;
|
||||||
return createTime;
|
|
||||||
}
|
/**
|
||||||
|
* 更新时间
|
||||||
public void setCreateTime(Date createTime)
|
*/
|
||||||
{
|
@LastModifiedDate
|
||||||
this.createTime = createTime;
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
}
|
private Date updateTime;
|
||||||
|
|
||||||
public String getUpdateBy()
|
/**
|
||||||
{
|
* 备注
|
||||||
return updateBy;
|
*/
|
||||||
}
|
private String remark;
|
||||||
|
|
||||||
public void setUpdateBy(String updateBy)
|
/**
|
||||||
{
|
* 请求参数
|
||||||
this.updateBy = updateBy;
|
*/
|
||||||
}
|
@Transient
|
||||||
|
private Map<String, Object> params;
|
||||||
public Date getUpdateTime()
|
|
||||||
{
|
@Transient
|
||||||
return updateTime;
|
private Date startTime;
|
||||||
}
|
|
||||||
|
@Transient
|
||||||
public void setUpdateTime(Date updateTime)
|
private Date endTime;
|
||||||
{
|
|
||||||
this.updateTime = updateTime;
|
public String getSearchValue() {
|
||||||
}
|
return searchValue;
|
||||||
|
}
|
||||||
public String getRemark()
|
|
||||||
{
|
public void setSearchValue(String searchValue) {
|
||||||
return remark;
|
this.searchValue = searchValue;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setRemark(String remark)
|
public String getCreateBy() {
|
||||||
{
|
return createBy;
|
||||||
this.remark = remark;
|
}
|
||||||
}
|
|
||||||
|
public void setCreateBy(String createBy) {
|
||||||
public Map<String, Object> getParams()
|
this.createBy = createBy;
|
||||||
{
|
}
|
||||||
if (params == null)
|
|
||||||
{
|
public Date getCreateTime() {
|
||||||
params = new HashMap<>();
|
return createTime;
|
||||||
}
|
}
|
||||||
return params;
|
|
||||||
}
|
public void setCreateTime(Date createTime) {
|
||||||
|
this.createTime = createTime;
|
||||||
public void setParams(Map<String, Object> params)
|
}
|
||||||
{
|
|
||||||
this.params = params;
|
public String getUpdateBy() {
|
||||||
}
|
return updateBy;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void setUpdateBy(String updateBy) {
|
||||||
|
this.updateBy = updateBy;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Date getUpdateTime() {
|
||||||
|
return updateTime;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setUpdateTime(Date updateTime) {
|
||||||
|
this.updateTime = updateTime;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getRemark() {
|
||||||
|
return remark;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setRemark(String remark) {
|
||||||
|
this.remark = remark;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Map<String, Object> getParams() {
|
||||||
|
if (params == null) {
|
||||||
|
params = new HashMap<>();
|
||||||
|
}
|
||||||
|
return params;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setParams(Map<String, Object> params) {
|
||||||
|
this.params = params;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Date getStartTime() {
|
||||||
|
return startTime;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setStartTime(Date startTime) {
|
||||||
|
this.startTime = startTime;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Date getEndTime() {
|
||||||
|
return endTime;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setEndTime(Date endTime) {
|
||||||
|
this.endTime = endTime;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,63 +1,62 @@
|
||||||
package com.ruoyi.common.core.domain;
|
package com.ruoyi.common.core.domain;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Tree基类
|
* Tree基类
|
||||||
*
|
*
|
||||||
* @author ruoyi
|
* @author ruoyi
|
||||||
*/
|
*/
|
||||||
public class TreeEntity extends BaseEntity
|
public class TreeEntity extends BaseEntity {
|
||||||
{
|
private static final long serialVersionUID = 1L;
|
||||||
private static final long serialVersionUID = 1L;
|
|
||||||
|
/**
|
||||||
/** 父菜单名称 */
|
* 父菜单名称
|
||||||
private String parentName;
|
*/
|
||||||
|
private String parentName;
|
||||||
/** 父菜单ID */
|
|
||||||
private Long parentId;
|
/**
|
||||||
|
* 父菜单ID
|
||||||
/** 显示顺序 */
|
*/
|
||||||
private Integer orderNum;
|
private Long parentId;
|
||||||
|
|
||||||
/** 祖级列表 */
|
/**
|
||||||
private String ancestors;
|
* 显示顺序
|
||||||
|
*/
|
||||||
public String getParentName()
|
private Integer orderNum;
|
||||||
{
|
|
||||||
return parentName;
|
/**
|
||||||
}
|
* 祖级列表
|
||||||
|
*/
|
||||||
public void setParentName(String parentName)
|
private String ancestors;
|
||||||
{
|
|
||||||
this.parentName = parentName;
|
public String getParentName() {
|
||||||
}
|
return parentName;
|
||||||
|
}
|
||||||
public Long getParentId()
|
|
||||||
{
|
public void setParentName(String parentName) {
|
||||||
return parentId;
|
this.parentName = parentName;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setParentId(Long parentId)
|
public Long getParentId() {
|
||||||
{
|
return parentId;
|
||||||
this.parentId = parentId;
|
}
|
||||||
}
|
|
||||||
|
public void setParentId(Long parentId) {
|
||||||
public Integer getOrderNum()
|
this.parentId = parentId;
|
||||||
{
|
}
|
||||||
return orderNum;
|
|
||||||
}
|
public Integer getOrderNum() {
|
||||||
|
return orderNum;
|
||||||
public void setOrderNum(Integer orderNum)
|
}
|
||||||
{
|
|
||||||
this.orderNum = orderNum;
|
public void setOrderNum(Integer orderNum) {
|
||||||
}
|
this.orderNum = orderNum;
|
||||||
|
}
|
||||||
public String getAncestors()
|
|
||||||
{
|
public String getAncestors() {
|
||||||
return ancestors;
|
return ancestors;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setAncestors(String ancestors)
|
public void setAncestors(String ancestors) {
|
||||||
{
|
this.ancestors = ancestors;
|
||||||
this.ancestors = ancestors;
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
@ -1,104 +1,103 @@
|
||||||
package com.ruoyi.common.core.domain;
|
package com.ruoyi.common.core.domain;
|
||||||
|
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Ztree树结构实体类
|
* Ztree树结构实体类
|
||||||
*
|
*
|
||||||
* @author ruoyi
|
* @author ruoyi
|
||||||
*/
|
*/
|
||||||
public class Ztree implements Serializable
|
public class Ztree implements Serializable {
|
||||||
{
|
private static final long serialVersionUID = 1L;
|
||||||
private static final long serialVersionUID = 1L;
|
|
||||||
|
/**
|
||||||
/** 节点ID */
|
* 节点ID
|
||||||
private Long id;
|
*/
|
||||||
|
private Long id;
|
||||||
/** 节点父ID */
|
|
||||||
private Long pId;
|
/**
|
||||||
|
* 节点父ID
|
||||||
/** 节点名称 */
|
*/
|
||||||
private String name;
|
private Long pId;
|
||||||
|
|
||||||
/** 节点标题 */
|
/**
|
||||||
private String title;
|
* 节点名称
|
||||||
|
*/
|
||||||
/** 是否勾选 */
|
private String name;
|
||||||
private boolean checked = false;
|
|
||||||
|
/**
|
||||||
/** 是否展开 */
|
* 节点标题
|
||||||
private boolean open = false;
|
*/
|
||||||
|
private String title;
|
||||||
/** 是否能勾选 */
|
|
||||||
private boolean nocheck = false;
|
/**
|
||||||
|
* 是否勾选
|
||||||
public Long getId()
|
*/
|
||||||
{
|
private boolean checked = false;
|
||||||
return id;
|
|
||||||
}
|
/**
|
||||||
|
* 是否展开
|
||||||
public void setId(Long id)
|
*/
|
||||||
{
|
private boolean open = false;
|
||||||
this.id = id;
|
|
||||||
}
|
/**
|
||||||
|
* 是否能勾选
|
||||||
public Long getpId()
|
*/
|
||||||
{
|
private boolean nocheck = false;
|
||||||
return pId;
|
|
||||||
}
|
public Long getId() {
|
||||||
|
return id;
|
||||||
public void setpId(Long pId)
|
}
|
||||||
{
|
|
||||||
this.pId = pId;
|
public void setId(Long id) {
|
||||||
}
|
this.id = id;
|
||||||
|
}
|
||||||
public String getName()
|
|
||||||
{
|
public Long getpId() {
|
||||||
return name;
|
return pId;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setName(String name)
|
public void setpId(Long pId) {
|
||||||
{
|
this.pId = pId;
|
||||||
this.name = name;
|
}
|
||||||
}
|
|
||||||
|
public String getName() {
|
||||||
public String getTitle()
|
return name;
|
||||||
{
|
}
|
||||||
return title;
|
|
||||||
}
|
public void setName(String name) {
|
||||||
|
this.name = name;
|
||||||
public void setTitle(String title)
|
}
|
||||||
{
|
|
||||||
this.title = title;
|
public String getTitle() {
|
||||||
}
|
return title;
|
||||||
|
}
|
||||||
public boolean isChecked()
|
|
||||||
{
|
public void setTitle(String title) {
|
||||||
return checked;
|
this.title = title;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setChecked(boolean checked)
|
public boolean isChecked() {
|
||||||
{
|
return checked;
|
||||||
this.checked = checked;
|
}
|
||||||
}
|
|
||||||
|
public void setChecked(boolean checked) {
|
||||||
public boolean isOpen()
|
this.checked = checked;
|
||||||
{
|
}
|
||||||
return open;
|
|
||||||
}
|
public boolean isOpen() {
|
||||||
|
return open;
|
||||||
public void setOpen(boolean open)
|
}
|
||||||
{
|
|
||||||
this.open = open;
|
public void setOpen(boolean open) {
|
||||||
}
|
this.open = open;
|
||||||
|
}
|
||||||
public boolean isNocheck()
|
|
||||||
{
|
public boolean isNocheck() {
|
||||||
return nocheck;
|
return nocheck;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setNocheck(boolean nocheck)
|
public void setNocheck(boolean nocheck) {
|
||||||
{
|
this.nocheck = nocheck;
|
||||||
this.nocheck = nocheck;
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,54 @@
|
||||||
|
package com.ruoyi.common.core.domain.enums;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
|
|
||||||
|
import java.util.Arrays;
|
||||||
|
|
||||||
|
@JsonFormat(shape = JsonFormat.Shape.OBJECT)
|
||||||
|
public enum ActiveState implements BaseEnum{
|
||||||
|
|
||||||
|
enabled(1,"活跃"),
|
||||||
|
disabled(2,"不活跃"),
|
||||||
|
;
|
||||||
|
|
||||||
|
private Integer state;
|
||||||
|
private String desc;
|
||||||
|
|
||||||
|
ActiveState(Integer state, String desc) {
|
||||||
|
this.state = state;
|
||||||
|
this.desc = desc;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Integer getState() {
|
||||||
|
return state;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setState(Integer state) {
|
||||||
|
this.state = state;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getDesc() {
|
||||||
|
return desc;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setDesc(String desc) {
|
||||||
|
this.desc = desc;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String en() {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String zh() {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static ActiveState of(Integer value){
|
||||||
|
return Arrays.stream(ActiveState.values())
|
||||||
|
.filter(activeState -> activeState.getState().equals(value))
|
||||||
|
.findFirst()
|
||||||
|
.orElseThrow(IllegalArgumentException::new);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,16 @@
|
||||||
|
package com.ruoyi.common.core.domain.enums;
|
||||||
|
|
||||||
|
public interface BaseEnum {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 英文显示
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
String en();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 汉语显示
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
String zh();
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,62 @@
|
||||||
|
package com.ruoyi.common.core.domain.enums;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
|
|
||||||
|
import java.util.Arrays;
|
||||||
|
|
||||||
|
@JsonFormat(shape = JsonFormat.Shape.OBJECT)
|
||||||
|
public enum DeleteState implements BaseEnum {
|
||||||
|
NOT_DELETED(0, "未删除","Not Deleted"),
|
||||||
|
DELETED(1, "已删除", "Deleted"),
|
||||||
|
;
|
||||||
|
private Integer state;
|
||||||
|
private String desc;
|
||||||
|
private String en;
|
||||||
|
|
||||||
|
public Integer getState() {
|
||||||
|
return state;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setState(Integer state) {
|
||||||
|
this.state = state;
|
||||||
|
}
|
||||||
|
|
||||||
|
DeleteState(Integer state, String desc, String en) {
|
||||||
|
this.state = state;
|
||||||
|
this.desc = desc;
|
||||||
|
this.en = en;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getDesc() {
|
||||||
|
return desc;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setDesc(String desc) {
|
||||||
|
this.desc = desc;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static DeleteState of(Integer state){
|
||||||
|
return Arrays.stream(DeleteState.values())
|
||||||
|
.filter(deleteState -> deleteState.getState().equals(state))
|
||||||
|
.findFirst()
|
||||||
|
.orElseThrow(IllegalArgumentException::new);
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getEn() {
|
||||||
|
return en;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setEn(String en) {
|
||||||
|
this.en = en;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String en() {
|
||||||
|
return en;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String zh() {
|
||||||
|
return desc;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,19 @@
|
||||||
|
package com.ruoyi.common.core.domain.enums.converter;
|
||||||
|
|
||||||
|
import com.ruoyi.common.core.domain.enums.ActiveState;
|
||||||
|
|
||||||
|
import javax.persistence.AttributeConverter;
|
||||||
|
import javax.persistence.Converter;
|
||||||
|
|
||||||
|
@Converter(autoApply = true)
|
||||||
|
public class ActiveStateConverter implements AttributeConverter<ActiveState, Integer> {
|
||||||
|
@Override
|
||||||
|
public Integer convertToDatabaseColumn(ActiveState activeState) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public ActiveState convertToEntityAttribute(Integer integer) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,19 @@
|
||||||
|
package com.ruoyi.common.core.domain.enums.converter;
|
||||||
|
|
||||||
|
import com.ruoyi.common.core.domain.enums.DeleteState;
|
||||||
|
|
||||||
|
import javax.persistence.AttributeConverter;
|
||||||
|
import javax.persistence.Converter;
|
||||||
|
|
||||||
|
@Converter(autoApply = true)
|
||||||
|
public class DeleteStateConverter implements AttributeConverter<DeleteState, Integer> {
|
||||||
|
@Override
|
||||||
|
public Integer convertToDatabaseColumn(DeleteState attribute) {
|
||||||
|
return null == attribute ? null : attribute.getState();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public DeleteState convertToEntityAttribute(Integer dbData) {
|
||||||
|
return DeleteState.of(dbData);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,18 @@
|
||||||
|
package com.ruoyi.common.core.domain.enums.propertyeditor;
|
||||||
|
|
||||||
|
import com.ruoyi.common.core.domain.enums.ActiveState;
|
||||||
|
|
||||||
|
import java.beans.PropertyEditorSupport;
|
||||||
|
|
||||||
|
public class ActiveStatePropertyEditor extends PropertyEditorSupport {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void setAsText(String text) throws IllegalArgumentException {
|
||||||
|
try{
|
||||||
|
Integer enumValue = Integer.parseInt(text);
|
||||||
|
setValue(ActiveState.of(enumValue));
|
||||||
|
}catch (NumberFormatException e){
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,18 @@
|
||||||
|
package com.ruoyi.common.core.domain.enums.propertyeditor;
|
||||||
|
|
||||||
|
import com.ruoyi.common.core.domain.enums.DeleteState;
|
||||||
|
|
||||||
|
import java.beans.PropertyEditorSupport;
|
||||||
|
|
||||||
|
public class DeleteStatePropertyEditor extends PropertyEditorSupport {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void setAsText(String text) throws IllegalArgumentException {
|
||||||
|
try{
|
||||||
|
Integer enumValue = Integer.parseInt(text);
|
||||||
|
setValue(DeleteState.of(enumValue));
|
||||||
|
}catch (NumberFormatException e){
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -1,72 +1,72 @@
|
||||||
package com.ruoyi.common.core.page;
|
package com.ruoyi.common.core.page;
|
||||||
|
|
||||||
import com.ruoyi.common.utils.StringUtils;
|
import com.ruoyi.common.utils.StringUtils;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 分页数据
|
* 分页数据
|
||||||
*
|
*
|
||||||
* @author ruoyi
|
* @author ruoyi
|
||||||
*/
|
*/
|
||||||
public class PageDomain
|
public class PageDomain
|
||||||
{
|
{
|
||||||
/** 当前记录起始索引 */
|
/** 当前记录起始索引 */
|
||||||
private Integer pageNum;
|
private Integer pageNum;
|
||||||
|
|
||||||
/** 每页显示记录数 */
|
/** 每页显示记录数 */
|
||||||
private Integer pageSize;
|
private Integer pageSize;
|
||||||
|
|
||||||
/** 排序列 */
|
/** 排序列 */
|
||||||
private String orderByColumn;
|
private String orderByColumn;
|
||||||
|
|
||||||
/** 排序的方向desc或者asc */
|
/** 排序的方向desc或者asc */
|
||||||
private String isAsc = "asc";
|
private String isAsc = "asc";
|
||||||
|
|
||||||
public String getOrderBy()
|
public String getOrderBy()
|
||||||
{
|
{
|
||||||
if (StringUtils.isEmpty(orderByColumn))
|
if (StringUtils.isEmpty(orderByColumn))
|
||||||
{
|
{
|
||||||
return "";
|
return "";
|
||||||
}
|
}
|
||||||
return StringUtils.toUnderScoreCase(orderByColumn) + " " + isAsc;
|
return StringUtils.toUnderScoreCase(orderByColumn) + " " + isAsc;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Integer getPageNum()
|
public Integer getPageNum()
|
||||||
{
|
{
|
||||||
return pageNum;
|
return pageNum;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setPageNum(Integer pageNum)
|
public void setPageNum(Integer pageNum)
|
||||||
{
|
{
|
||||||
this.pageNum = pageNum;
|
this.pageNum = pageNum;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Integer getPageSize()
|
public Integer getPageSize()
|
||||||
{
|
{
|
||||||
return pageSize;
|
return pageSize;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setPageSize(Integer pageSize)
|
public void setPageSize(Integer pageSize)
|
||||||
{
|
{
|
||||||
this.pageSize = pageSize;
|
this.pageSize = pageSize;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getOrderByColumn()
|
public String getOrderByColumn()
|
||||||
{
|
{
|
||||||
return orderByColumn;
|
return orderByColumn;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setOrderByColumn(String orderByColumn)
|
public void setOrderByColumn(String orderByColumn)
|
||||||
{
|
{
|
||||||
this.orderByColumn = orderByColumn;
|
this.orderByColumn = orderByColumn;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getIsAsc()
|
public String getIsAsc()
|
||||||
{
|
{
|
||||||
return isAsc;
|
return isAsc;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setIsAsc(String isAsc)
|
public void setIsAsc(String isAsc)
|
||||||
{
|
{
|
||||||
this.isAsc = isAsc;
|
this.isAsc = isAsc;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,85 +1,85 @@
|
||||||
package com.ruoyi.common.core.page;
|
package com.ruoyi.common.core.page;
|
||||||
|
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 表格分页数据对象
|
* 表格分页数据对象
|
||||||
*
|
*
|
||||||
* @author ruoyi
|
* @author ruoyi
|
||||||
*/
|
*/
|
||||||
public class TableDataInfo implements Serializable
|
public class TableDataInfo implements Serializable
|
||||||
{
|
{
|
||||||
private static final long serialVersionUID = 1L;
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
/** 总记录数 */
|
/** 总记录数 */
|
||||||
private long total;
|
private long total;
|
||||||
|
|
||||||
/** 列表数据 */
|
/** 列表数据 */
|
||||||
private List<?> rows;
|
private List<?> rows;
|
||||||
|
|
||||||
/** 消息状态码 */
|
/** 消息状态码 */
|
||||||
private int code;
|
private int code;
|
||||||
|
|
||||||
/** 消息内容 */
|
/** 消息内容 */
|
||||||
private String msg;
|
private String msg;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 表格数据对象
|
* 表格数据对象
|
||||||
*/
|
*/
|
||||||
public TableDataInfo()
|
public TableDataInfo()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 分页
|
* 分页
|
||||||
*
|
*
|
||||||
* @param list 列表数据
|
* @param list 列表数据
|
||||||
* @param total 总记录数
|
* @param total 总记录数
|
||||||
*/
|
*/
|
||||||
public TableDataInfo(List<?> list, int total)
|
public TableDataInfo(List<?> list, int total)
|
||||||
{
|
{
|
||||||
this.rows = list;
|
this.rows = list;
|
||||||
this.total = total;
|
this.total = total;
|
||||||
}
|
}
|
||||||
|
|
||||||
public long getTotal()
|
public long getTotal()
|
||||||
{
|
{
|
||||||
return total;
|
return total;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setTotal(long total)
|
public void setTotal(long total)
|
||||||
{
|
{
|
||||||
this.total = total;
|
this.total = total;
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<?> getRows()
|
public List<?> getRows()
|
||||||
{
|
{
|
||||||
return rows;
|
return rows;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setRows(List<?> rows)
|
public void setRows(List<?> rows)
|
||||||
{
|
{
|
||||||
this.rows = rows;
|
this.rows = rows;
|
||||||
}
|
}
|
||||||
|
|
||||||
public int getCode()
|
public int getCode()
|
||||||
{
|
{
|
||||||
return code;
|
return code;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setCode(int code)
|
public void setCode(int code)
|
||||||
{
|
{
|
||||||
this.code = code;
|
this.code = code;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getMsg()
|
public String getMsg()
|
||||||
{
|
{
|
||||||
return msg;
|
return msg;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setMsg(String msg)
|
public void setMsg(String msg)
|
||||||
{
|
{
|
||||||
this.msg = msg;
|
this.msg = msg;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -1,30 +1,27 @@
|
||||||
package com.ruoyi.common.core.page;
|
package com.ruoyi.common.core.page;
|
||||||
|
|
||||||
import com.ruoyi.common.constant.Constants;
|
import com.ruoyi.common.constant.Constants;
|
||||||
import com.ruoyi.common.utils.ServletUtils;
|
import com.ruoyi.common.utils.ServletUtils;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 表格数据处理
|
* 表格数据处理
|
||||||
*
|
*
|
||||||
* @author ruoyi
|
* @author ruoyi
|
||||||
*/
|
*/
|
||||||
public class TableSupport
|
public class TableSupport {
|
||||||
{
|
/**
|
||||||
/**
|
* 封装分页对象
|
||||||
* 封装分页对象
|
*/
|
||||||
*/
|
public static PageDomain getPageDomain() {
|
||||||
public static PageDomain getPageDomain()
|
PageDomain pageDomain = new PageDomain();
|
||||||
{
|
pageDomain.setPageNum(ServletUtils.getParameterToInt(Constants.PAGE_NUM));
|
||||||
PageDomain pageDomain = new PageDomain();
|
pageDomain.setPageSize(ServletUtils.getParameterToInt(Constants.PAGE_SIZE));
|
||||||
pageDomain.setPageNum(ServletUtils.getParameterToInt(Constants.PAGE_NUM));
|
pageDomain.setOrderByColumn(ServletUtils.getParameter(Constants.ORDER_BY_COLUMN));
|
||||||
pageDomain.setPageSize(ServletUtils.getParameterToInt(Constants.PAGE_SIZE));
|
pageDomain.setIsAsc(ServletUtils.getParameter(Constants.IS_ASC));
|
||||||
pageDomain.setOrderByColumn(ServletUtils.getParameter(Constants.ORDER_BY_COLUMN));
|
return pageDomain;
|
||||||
pageDomain.setIsAsc(ServletUtils.getParameter(Constants.IS_ASC));
|
}
|
||||||
return pageDomain;
|
|
||||||
}
|
public static PageDomain buildPageRequest() {
|
||||||
|
return getPageDomain();
|
||||||
public static PageDomain buildPageRequest()
|
}
|
||||||
{
|
}
|
||||||
return getPageDomain();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
|
||||||
|
|
@ -1,86 +1,91 @@
|
||||||
package com.ruoyi.common.core.text;
|
package com.ruoyi.common.core.text;
|
||||||
|
|
||||||
import java.nio.charset.Charset;
|
import java.nio.charset.Charset;
|
||||||
import java.nio.charset.StandardCharsets;
|
import java.nio.charset.StandardCharsets;
|
||||||
import com.ruoyi.common.utils.StringUtils;
|
|
||||||
|
import com.ruoyi.common.utils.StringUtils;
|
||||||
/**
|
|
||||||
* 字符集工具类
|
/**
|
||||||
*
|
* 字符集工具类
|
||||||
* @author ruoyi
|
*
|
||||||
*/
|
* @author ruoyi
|
||||||
public class CharsetKit
|
*/
|
||||||
{
|
public class CharsetKit {
|
||||||
/** ISO-8859-1 */
|
/**
|
||||||
public static final String ISO_8859_1 = "ISO-8859-1";
|
* ISO-8859-1
|
||||||
/** UTF-8 */
|
*/
|
||||||
public static final String UTF_8 = "UTF-8";
|
public static final String ISO_8859_1 = "ISO-8859-1";
|
||||||
/** GBK */
|
/**
|
||||||
public static final String GBK = "GBK";
|
* UTF-8
|
||||||
|
*/
|
||||||
/** ISO-8859-1 */
|
public static final String UTF_8 = "UTF-8";
|
||||||
public static final Charset CHARSET_ISO_8859_1 = Charset.forName(ISO_8859_1);
|
/**
|
||||||
/** UTF-8 */
|
* GBK
|
||||||
public static final Charset CHARSET_UTF_8 = Charset.forName(UTF_8);
|
*/
|
||||||
/** GBK */
|
public static final String GBK = "GBK";
|
||||||
public static final Charset CHARSET_GBK = Charset.forName(GBK);
|
|
||||||
|
/**
|
||||||
/**
|
* ISO-8859-1
|
||||||
* 转换为Charset对象
|
*/
|
||||||
*
|
public static final Charset CHARSET_ISO_8859_1 = Charset.forName(ISO_8859_1);
|
||||||
* @param charset 字符集,为空则返回默认字符集
|
/**
|
||||||
* @return Charset
|
* UTF-8
|
||||||
*/
|
*/
|
||||||
public static Charset charset(String charset)
|
public static final Charset CHARSET_UTF_8 = Charset.forName(UTF_8);
|
||||||
{
|
/**
|
||||||
return StringUtils.isEmpty(charset) ? Charset.defaultCharset() : Charset.forName(charset);
|
* GBK
|
||||||
}
|
*/
|
||||||
|
public static final Charset CHARSET_GBK = Charset.forName(GBK);
|
||||||
/**
|
|
||||||
* 转换字符串的字符集编码
|
/**
|
||||||
*
|
* 转换为Charset对象
|
||||||
* @param source 字符串
|
*
|
||||||
* @param srcCharset 源字符集,默认ISO-8859-1
|
* @param charset 字符集,为空则返回默认字符集
|
||||||
* @param destCharset 目标字符集,默认UTF-8
|
* @return Charset
|
||||||
* @return 转换后的字符集
|
*/
|
||||||
*/
|
public static Charset charset(String charset) {
|
||||||
public static String convert(String source, String srcCharset, String destCharset)
|
return StringUtils.isEmpty(charset) ? Charset.defaultCharset() : Charset.forName(charset);
|
||||||
{
|
}
|
||||||
return convert(source, Charset.forName(srcCharset), Charset.forName(destCharset));
|
|
||||||
}
|
/**
|
||||||
|
* 转换字符串的字符集编码
|
||||||
/**
|
*
|
||||||
* 转换字符串的字符集编码
|
* @param source 字符串
|
||||||
*
|
* @param srcCharset 源字符集,默认ISO-8859-1
|
||||||
* @param source 字符串
|
* @param destCharset 目标字符集,默认UTF-8
|
||||||
* @param srcCharset 源字符集,默认ISO-8859-1
|
* @return 转换后的字符集
|
||||||
* @param destCharset 目标字符集,默认UTF-8
|
*/
|
||||||
* @return 转换后的字符集
|
public static String convert(String source, String srcCharset, String destCharset) {
|
||||||
*/
|
return convert(source, Charset.forName(srcCharset), Charset.forName(destCharset));
|
||||||
public static String convert(String source, Charset srcCharset, Charset destCharset)
|
}
|
||||||
{
|
|
||||||
if (null == srcCharset)
|
/**
|
||||||
{
|
* 转换字符串的字符集编码
|
||||||
srcCharset = StandardCharsets.ISO_8859_1;
|
*
|
||||||
}
|
* @param source 字符串
|
||||||
|
* @param srcCharset 源字符集,默认ISO-8859-1
|
||||||
if (null == destCharset)
|
* @param destCharset 目标字符集,默认UTF-8
|
||||||
{
|
* @return 转换后的字符集
|
||||||
srcCharset = StandardCharsets.UTF_8;
|
*/
|
||||||
}
|
public static String convert(String source, Charset srcCharset, Charset destCharset) {
|
||||||
|
if (null == srcCharset) {
|
||||||
if (StringUtils.isEmpty(source) || srcCharset.equals(destCharset))
|
srcCharset = StandardCharsets.ISO_8859_1;
|
||||||
{
|
}
|
||||||
return source;
|
|
||||||
}
|
if (null == destCharset) {
|
||||||
return new String(source.getBytes(srcCharset), destCharset);
|
srcCharset = StandardCharsets.UTF_8;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
if (StringUtils.isEmpty(source) || srcCharset.equals(destCharset)) {
|
||||||
* @return 系统字符集编码
|
return source;
|
||||||
*/
|
}
|
||||||
public static String systemCharset()
|
return new String(source.getBytes(srcCharset), destCharset);
|
||||||
{
|
}
|
||||||
return Charset.defaultCharset().name();
|
|
||||||
}
|
/**
|
||||||
}
|
* @return 系统字符集编码
|
||||||
|
*/
|
||||||
|
public static String systemCharset() {
|
||||||
|
return Charset.defaultCharset().name();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
||||||
File diff suppressed because it is too large
Load Diff
|
|
@ -1,92 +1,76 @@
|
||||||
package com.ruoyi.common.core.text;
|
package com.ruoyi.common.core.text;
|
||||||
|
|
||||||
import com.ruoyi.common.utils.StringUtils;
|
import com.ruoyi.common.utils.StringUtils;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 字符串格式化
|
* 字符串格式化
|
||||||
*
|
*
|
||||||
* @author ruoyi
|
* @author ruoyi
|
||||||
*/
|
*/
|
||||||
public class StrFormatter
|
public class StrFormatter {
|
||||||
{
|
public static final String EMPTY_JSON = "{}";
|
||||||
public static final String EMPTY_JSON = "{}";
|
public static final char C_BACKSLASH = '\\';
|
||||||
public static final char C_BACKSLASH = '\\';
|
public static final char C_DELIM_START = '{';
|
||||||
public static final char C_DELIM_START = '{';
|
public static final char C_DELIM_END = '}';
|
||||||
public static final char C_DELIM_END = '}';
|
|
||||||
|
/**
|
||||||
/**
|
* 格式化字符串<br>
|
||||||
* 格式化字符串<br>
|
* 此方法只是简单将占位符 {} 按照顺序替换为参数<br>
|
||||||
* 此方法只是简单将占位符 {} 按照顺序替换为参数<br>
|
* 如果想输出 {} 使用 \\转义 { 即可,如果想输出 {} 之前的 \ 使用双转义符 \\\\ 即可<br>
|
||||||
* 如果想输出 {} 使用 \\转义 { 即可,如果想输出 {} 之前的 \ 使用双转义符 \\\\ 即可<br>
|
* 例:<br>
|
||||||
* 例:<br>
|
* 通常使用:format("this is {} for {}", "a", "b") -> this is a for b<br>
|
||||||
* 通常使用:format("this is {} for {}", "a", "b") -> this is a for b<br>
|
* 转义{}: format("this is \\{} for {}", "a", "b") -> this is \{} for a<br>
|
||||||
* 转义{}: format("this is \\{} for {}", "a", "b") -> this is \{} for a<br>
|
* 转义\: format("this is \\\\{} for {}", "a", "b") -> this is \a for b<br>
|
||||||
* 转义\: format("this is \\\\{} for {}", "a", "b") -> this is \a for b<br>
|
*
|
||||||
*
|
* @param strPattern 字符串模板
|
||||||
* @param strPattern 字符串模板
|
* @param argArray 参数列表
|
||||||
* @param argArray 参数列表
|
* @return 结果
|
||||||
* @return 结果
|
*/
|
||||||
*/
|
public static String format(final String strPattern, final Object... argArray) {
|
||||||
public static String format(final String strPattern, final Object... argArray)
|
if (StringUtils.isEmpty(strPattern) || StringUtils.isEmpty(argArray)) {
|
||||||
{
|
return strPattern;
|
||||||
if (StringUtils.isEmpty(strPattern) || StringUtils.isEmpty(argArray))
|
}
|
||||||
{
|
final int strPatternLength = strPattern.length();
|
||||||
return strPattern;
|
|
||||||
}
|
// 初始化定义好的长度以获得更好的性能
|
||||||
final int strPatternLength = strPattern.length();
|
StringBuilder sbuf = new StringBuilder(strPatternLength + 50);
|
||||||
|
|
||||||
// 初始化定义好的长度以获得更好的性能
|
int handledPosition = 0;
|
||||||
StringBuilder sbuf = new StringBuilder(strPatternLength + 50);
|
int delimIndex;// 占位符所在位置
|
||||||
|
for (int argIndex = 0; argIndex < argArray.length; argIndex++) {
|
||||||
int handledPosition = 0;
|
delimIndex = strPattern.indexOf(EMPTY_JSON, handledPosition);
|
||||||
int delimIndex;// 占位符所在位置
|
if (delimIndex == -1) {
|
||||||
for (int argIndex = 0; argIndex < argArray.length; argIndex++)
|
if (handledPosition == 0) {
|
||||||
{
|
return strPattern;
|
||||||
delimIndex = strPattern.indexOf(EMPTY_JSON, handledPosition);
|
} else { // 字符串模板剩余部分不再包含占位符,加入剩余部分后返回结果
|
||||||
if (delimIndex == -1)
|
sbuf.append(strPattern, handledPosition, strPatternLength);
|
||||||
{
|
return sbuf.toString();
|
||||||
if (handledPosition == 0)
|
}
|
||||||
{
|
} else {
|
||||||
return strPattern;
|
if (delimIndex > 0 && strPattern.charAt(delimIndex - 1) == C_BACKSLASH) {
|
||||||
}
|
if (delimIndex > 1 && strPattern.charAt(delimIndex - 2) == C_BACKSLASH) {
|
||||||
else
|
// 转义符之前还有一个转义符,占位符依旧有效
|
||||||
{ // 字符串模板剩余部分不再包含占位符,加入剩余部分后返回结果
|
sbuf.append(strPattern, handledPosition, delimIndex - 1);
|
||||||
sbuf.append(strPattern, handledPosition, strPatternLength);
|
sbuf.append(Convert.utf8Str(argArray[argIndex]));
|
||||||
return sbuf.toString();
|
handledPosition = delimIndex + 2;
|
||||||
}
|
} else {
|
||||||
}
|
// 占位符被转义
|
||||||
else
|
argIndex--;
|
||||||
{
|
sbuf.append(strPattern, handledPosition, delimIndex - 1);
|
||||||
if (delimIndex > 0 && strPattern.charAt(delimIndex - 1) == C_BACKSLASH)
|
sbuf.append(C_DELIM_START);
|
||||||
{
|
handledPosition = delimIndex + 1;
|
||||||
if (delimIndex > 1 && strPattern.charAt(delimIndex - 2) == C_BACKSLASH)
|
}
|
||||||
{
|
} else {
|
||||||
// 转义符之前还有一个转义符,占位符依旧有效
|
// 正常占位符
|
||||||
sbuf.append(strPattern, handledPosition, delimIndex - 1);
|
sbuf.append(strPattern, handledPosition, delimIndex);
|
||||||
sbuf.append(Convert.utf8Str(argArray[argIndex]));
|
sbuf.append(Convert.utf8Str(argArray[argIndex]));
|
||||||
handledPosition = delimIndex + 2;
|
handledPosition = delimIndex + 2;
|
||||||
}
|
}
|
||||||
else
|
}
|
||||||
{
|
}
|
||||||
// 占位符被转义
|
// 加入最后一个占位符后所有的字符
|
||||||
argIndex--;
|
sbuf.append(strPattern, handledPosition, strPattern.length());
|
||||||
sbuf.append(strPattern, handledPosition, delimIndex - 1);
|
|
||||||
sbuf.append(C_DELIM_START);
|
return sbuf.toString();
|
||||||
handledPosition = delimIndex + 1;
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
// 正常占位符
|
|
||||||
sbuf.append(strPattern, handledPosition, delimIndex);
|
|
||||||
sbuf.append(Convert.utf8Str(argArray[argIndex]));
|
|
||||||
handledPosition = delimIndex + 2;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
// 加入最后一个占位符后所有的字符
|
|
||||||
sbuf.append(strPattern, handledPosition, strPattern.length());
|
|
||||||
|
|
||||||
return sbuf.toString();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
|
||||||
|
|
@ -1,19 +1,18 @@
|
||||||
package com.ruoyi.common.enums;
|
package com.ruoyi.common.enums;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 操作状态
|
* 操作状态
|
||||||
*
|
*
|
||||||
* @author ruoyi
|
* @author ruoyi
|
||||||
*/
|
*/
|
||||||
public enum BusinessStatus
|
public enum BusinessStatus {
|
||||||
{
|
/**
|
||||||
/**
|
* 成功
|
||||||
* 成功
|
*/
|
||||||
*/
|
SUCCESS,
|
||||||
SUCCESS,
|
|
||||||
|
/**
|
||||||
/**
|
* 失败
|
||||||
* 失败
|
*/
|
||||||
*/
|
FAIL,
|
||||||
FAIL,
|
}
|
||||||
}
|
|
||||||
|
|
|
||||||
|
|
@ -1,59 +1,58 @@
|
||||||
package com.ruoyi.common.enums;
|
package com.ruoyi.common.enums;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 业务操作类型
|
* 业务操作类型
|
||||||
*
|
*
|
||||||
* @author ruoyi
|
* @author ruoyi
|
||||||
*/
|
*/
|
||||||
public enum BusinessType
|
public enum BusinessType {
|
||||||
{
|
/**
|
||||||
/**
|
* 其它
|
||||||
* 其它
|
*/
|
||||||
*/
|
OTHER,
|
||||||
OTHER,
|
|
||||||
|
/**
|
||||||
/**
|
* 新增
|
||||||
* 新增
|
*/
|
||||||
*/
|
INSERT,
|
||||||
INSERT,
|
|
||||||
|
/**
|
||||||
/**
|
* 修改
|
||||||
* 修改
|
*/
|
||||||
*/
|
UPDATE,
|
||||||
UPDATE,
|
|
||||||
|
/**
|
||||||
/**
|
* 删除
|
||||||
* 删除
|
*/
|
||||||
*/
|
DELETE,
|
||||||
DELETE,
|
|
||||||
|
/**
|
||||||
/**
|
* 授权
|
||||||
* 授权
|
*/
|
||||||
*/
|
GRANT,
|
||||||
GRANT,
|
|
||||||
|
/**
|
||||||
/**
|
* 导出
|
||||||
* 导出
|
*/
|
||||||
*/
|
EXPORT,
|
||||||
EXPORT,
|
|
||||||
|
/**
|
||||||
/**
|
* 导入
|
||||||
* 导入
|
*/
|
||||||
*/
|
IMPORT,
|
||||||
IMPORT,
|
|
||||||
|
/**
|
||||||
/**
|
* 强退
|
||||||
* 强退
|
*/
|
||||||
*/
|
FORCE,
|
||||||
FORCE,
|
|
||||||
|
/**
|
||||||
/**
|
* 生成代码
|
||||||
* 生成代码
|
*/
|
||||||
*/
|
GENCODE,
|
||||||
GENCODE,
|
|
||||||
|
/**
|
||||||
/**
|
* 清空
|
||||||
* 清空
|
*/
|
||||||
*/
|
CLEAN,
|
||||||
CLEAN,
|
}
|
||||||
}
|
|
||||||
|
|
|
||||||
|
|
@ -1,19 +1,18 @@
|
||||||
package com.ruoyi.common.enums;
|
package com.ruoyi.common.enums;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 数据源
|
* 数据源
|
||||||
*
|
*
|
||||||
* @author ruoyi
|
* @author ruoyi
|
||||||
*/
|
*/
|
||||||
public enum DataSourceType
|
public enum DataSourceType {
|
||||||
{
|
/**
|
||||||
/**
|
* 主库
|
||||||
* 主库
|
*/
|
||||||
*/
|
MASTER,
|
||||||
MASTER,
|
|
||||||
|
/**
|
||||||
/**
|
* 从库
|
||||||
* 从库
|
*/
|
||||||
*/
|
SLAVE
|
||||||
SLAVE
|
}
|
||||||
}
|
|
||||||
|
|
|
||||||
|
|
@ -1,24 +1,23 @@
|
||||||
package com.ruoyi.common.enums;
|
package com.ruoyi.common.enums;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 用户会话
|
* 用户会话
|
||||||
*
|
*
|
||||||
* @author ruoyi
|
* @author ruoyi
|
||||||
*/
|
*/
|
||||||
public enum OnlineStatus
|
public enum OnlineStatus {
|
||||||
{
|
/**
|
||||||
/** 用户状态 */
|
* 用户状态
|
||||||
on_line("在线"), off_line("离线");
|
*/
|
||||||
|
on_line("在线"), off_line("离线");
|
||||||
private final String info;
|
|
||||||
|
private final String info;
|
||||||
private OnlineStatus(String info)
|
|
||||||
{
|
private OnlineStatus(String info) {
|
||||||
this.info = info;
|
this.info = info;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getInfo()
|
public String getInfo() {
|
||||||
{
|
return info;
|
||||||
return info;
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
|
||||||
|
|
@ -1,24 +1,23 @@
|
||||||
package com.ruoyi.common.enums;
|
package com.ruoyi.common.enums;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 操作人类别
|
* 操作人类别
|
||||||
*
|
*
|
||||||
* @author ruoyi
|
* @author ruoyi
|
||||||
*/
|
*/
|
||||||
public enum OperatorType
|
public enum OperatorType {
|
||||||
{
|
/**
|
||||||
/**
|
* 其它
|
||||||
* 其它
|
*/
|
||||||
*/
|
OTHER,
|
||||||
OTHER,
|
|
||||||
|
/**
|
||||||
/**
|
* 后台用户
|
||||||
* 后台用户
|
*/
|
||||||
*/
|
MANAGE,
|
||||||
MANAGE,
|
|
||||||
|
/**
|
||||||
/**
|
* 手机端用户
|
||||||
* 手机端用户
|
*/
|
||||||
*/
|
MOBILE
|
||||||
MOBILE
|
}
|
||||||
}
|
|
||||||
|
|
|
||||||
|
|
@ -1,30 +1,26 @@
|
||||||
package com.ruoyi.common.enums;
|
package com.ruoyi.common.enums;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 用户状态
|
* 用户状态
|
||||||
*
|
*
|
||||||
* @author ruoyi
|
* @author ruoyi
|
||||||
*/
|
*/
|
||||||
public enum UserStatus
|
public enum UserStatus {
|
||||||
{
|
OK("0", "正常"), DISABLE("1", "停用"), DELETED("2", "删除");
|
||||||
OK("0", "正常"), DISABLE("1", "停用"), DELETED("2", "删除");
|
|
||||||
|
private final String code;
|
||||||
private final String code;
|
private final String info;
|
||||||
private final String info;
|
|
||||||
|
UserStatus(String code, String info) {
|
||||||
UserStatus(String code, String info)
|
this.code = code;
|
||||||
{
|
this.info = info;
|
||||||
this.code = code;
|
}
|
||||||
this.info = info;
|
|
||||||
}
|
public String getCode() {
|
||||||
|
return code;
|
||||||
public String getCode()
|
}
|
||||||
{
|
|
||||||
return code;
|
public String getInfo() {
|
||||||
}
|
return info;
|
||||||
|
}
|
||||||
public String getInfo()
|
}
|
||||||
{
|
|
||||||
return info;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,19 @@
|
||||||
|
package com.ruoyi.common.enums.converter;
|
||||||
|
|
||||||
|
import com.ruoyi.common.enums.OnlineStatus;
|
||||||
|
|
||||||
|
import javax.persistence.AttributeConverter;
|
||||||
|
import javax.persistence.Converter;
|
||||||
|
|
||||||
|
@Converter(autoApply = true)
|
||||||
|
public class OnlineStatusConverter implements AttributeConverter<OnlineStatus, String> {
|
||||||
|
@Override
|
||||||
|
public String convertToDatabaseColumn(OnlineStatus attribute) {
|
||||||
|
return attribute == null ? null : attribute.name();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public OnlineStatus convertToEntityAttribute(String dbData) {
|
||||||
|
return OnlineStatus.valueOf(dbData);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -2,29 +2,25 @@ package com.ruoyi.common.exception;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 业务异常
|
* 业务异常
|
||||||
*
|
*
|
||||||
* @author ruoyi
|
* @author ruoyi
|
||||||
*/
|
*/
|
||||||
public class BusinessException extends RuntimeException
|
public class BusinessException extends RuntimeException {
|
||||||
{
|
|
||||||
private static final long serialVersionUID = 1L;
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
protected final String message;
|
protected final String message;
|
||||||
|
|
||||||
public BusinessException(String message)
|
public BusinessException(String message) {
|
||||||
{
|
|
||||||
this.message = message;
|
this.message = message;
|
||||||
}
|
}
|
||||||
|
|
||||||
public BusinessException(String message, Throwable e)
|
public BusinessException(String message, Throwable e) {
|
||||||
{
|
|
||||||
super(message, e);
|
super(message, e);
|
||||||
this.message = message;
|
this.message = message;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getMessage()
|
public String getMessage() {
|
||||||
{
|
|
||||||
return message;
|
return message;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,15 +1,13 @@
|
||||||
package com.ruoyi.common.exception;
|
package com.ruoyi.common.exception;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 演示模式异常
|
* 演示模式异常
|
||||||
*
|
*
|
||||||
* @author ruoyi
|
* @author ruoyi
|
||||||
*/
|
*/
|
||||||
public class DemoModeException extends RuntimeException
|
public class DemoModeException extends RuntimeException {
|
||||||
{
|
private static final long serialVersionUID = 1L;
|
||||||
private static final long serialVersionUID = 1L;
|
|
||||||
|
public DemoModeException() {
|
||||||
public DemoModeException()
|
}
|
||||||
{
|
}
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue