Compare commits
6 Commits
Author | SHA1 | Date |
---|---|---|
pqmxt2anv | 3162d9108d | 1 week ago |
pqmxt2anv | 46d8f1ab8f | 1 week ago |
pqmxt2anv | 24df0808a0 | 1 week ago |
pqmxt2anv | 929924427b | 1 week ago |
sunmingqi | 877fb526e2 | 1 week ago |
sunmingqi | 62a834a419 | 1 week ago |
After Width: | Height: | Size: 87 KiB |
After Width: | Height: | Size: 74 KiB |
After Width: | Height: | Size: 70 KiB |
After Width: | Height: | Size: 34 KiB |
After Width: | Height: | Size: 36 KiB |
After Width: | Height: | Size: 82 KiB |
After Width: | Height: | Size: 33 KiB |
After Width: | Height: | Size: 96 KiB |
After Width: | Height: | Size: 34 KiB |
After Width: | Height: | Size: 31 KiB |
After Width: | Height: | Size: 75 KiB |
After Width: | Height: | Size: 75 KiB |
After Width: | Height: | Size: 55 KiB |
After Width: | Height: | Size: 36 KiB |
After Width: | Height: | Size: 95 KiB |
After Width: | Height: | Size: 12 KiB |
After Width: | Height: | Size: 52 KiB |
After Width: | Height: | Size: 19 KiB |
After Width: | Height: | Size: 39 KiB |
After Width: | Height: | Size: 49 KiB |
After Width: | Height: | Size: 19 KiB |
After Width: | Height: | Size: 50 KiB |
After Width: | Height: | Size: 114 KiB |
After Width: | Height: | Size: 51 KiB |
After Width: | Height: | Size: 45 KiB |
After Width: | Height: | Size: 45 KiB |
After Width: | Height: | Size: 16 KiB |
After Width: | Height: | Size: 55 KiB |
After Width: | Height: | Size: 22 KiB |
After Width: | Height: | Size: 66 KiB |
After Width: | Height: | Size: 247 KiB |
After Width: | Height: | Size: 57 KiB |
After Width: | Height: | Size: 46 KiB |
After Width: | Height: | Size: 61 KiB |
After Width: | Height: | Size: 41 KiB |
After Width: | Height: | Size: 108 KiB |
After Width: | Height: | Size: 69 KiB |
After Width: | Height: | Size: 100 KiB |
After Width: | Height: | Size: 14 KiB |
After Width: | Height: | Size: 45 KiB |
After Width: | Height: | Size: 22 KiB |
After Width: | Height: | Size: 56 KiB |
After Width: | Height: | Size: 42 KiB |
After Width: | Height: | Size: 917 KiB |
@ -0,0 +1,46 @@
|
||||
######################################################################
|
||||
# Build Tools
|
||||
|
||||
.gradle
|
||||
/build/
|
||||
!gradle/wrapper/gradle-wrapper.jar
|
||||
|
||||
target/
|
||||
!.mvn/wrapper/maven-wrapper.jar
|
||||
|
||||
######################################################################
|
||||
# IDE
|
||||
|
||||
### STS ###
|
||||
.apt_generated
|
||||
.classpath
|
||||
.factorypath
|
||||
.project
|
||||
.settings
|
||||
.springBeans
|
||||
|
||||
### IntelliJ IDEA ###
|
||||
.idea
|
||||
*.iws
|
||||
*.iml
|
||||
*.ipr
|
||||
|
||||
### JRebel ###
|
||||
rebel.xml
|
||||
### NetBeans ###
|
||||
nbproject/private/
|
||||
build/*
|
||||
nbbuild/
|
||||
dist/
|
||||
nbdist/
|
||||
.nb-gradle/
|
||||
|
||||
######################################################################
|
||||
# Others
|
||||
*.log
|
||||
*.xml.versionsBackup
|
||||
*.swp
|
||||
|
||||
!*/build/*.java
|
||||
!*/build/*.html
|
||||
!*/build/*.xml
|
@ -0,0 +1,20 @@
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2018 RuoYi
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
||||
this software and associated documentation files (the "Software"), to deal in
|
||||
the Software without restriction, including without limitation the rights to
|
||||
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
|
||||
the Software, and to permit persons to whom the Software is furnished to do so,
|
||||
subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
|
||||
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
|
||||
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
|
||||
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
||||
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
@ -0,0 +1,12 @@
|
||||
@echo off
|
||||
echo.
|
||||
echo [信息] 清理工程target生成路径。
|
||||
echo.
|
||||
|
||||
%~d0
|
||||
cd %~dp0
|
||||
|
||||
cd ..
|
||||
call mvn clean
|
||||
|
||||
pause
|
@ -0,0 +1,14 @@
|
||||
@echo off
|
||||
echo.
|
||||
echo [信息] 使用Jar命令运行Web工程。
|
||||
echo.
|
||||
|
||||
cd %~dp0
|
||||
cd ../ruoyi-admin/target
|
||||
|
||||
set JAVA_OPTS=-Xms256m -Xmx1024m -XX:MetaspaceSize=128m -XX:MaxMetaspaceSize=512m
|
||||
|
||||
java -jar %JAVA_OPTS% ruoyi-admin.jar
|
||||
|
||||
cd bin
|
||||
pause
|
@ -0,0 +1 @@
|
||||
Subproject commit 470c5396c3f62a7f172d84183cd2e9ceb7ff7967
|
@ -0,0 +1,239 @@
|
||||
<?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"
|
||||
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>
|
||||
|
||||
<groupId>com.ruoyi</groupId>
|
||||
<artifactId>ruoyi</artifactId>
|
||||
<version>4.7.9</version>
|
||||
|
||||
<name>ruoyi</name>
|
||||
<url>http://www.ruoyi.vip</url>
|
||||
<description>若依管理系统</description>
|
||||
|
||||
<properties>
|
||||
<ruoyi.version>4.7.9</ruoyi.version>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
|
||||
<java.version>1.8</java.version>
|
||||
<maven-jar-plugin.version>3.1.1</maven-jar-plugin.version>
|
||||
<shiro.version>1.13.0</shiro.version>
|
||||
<spring-framework.version>5.3.33</spring-framework.version>
|
||||
<thymeleaf.extras.shiro.version>2.1.0</thymeleaf.extras.shiro.version>
|
||||
<druid.version>1.2.23</druid.version>
|
||||
<bitwalker.version>1.21</bitwalker.version>
|
||||
<kaptcha.version>2.3.3</kaptcha.version>
|
||||
<swagger.version>3.0.0</swagger.version>
|
||||
<pagehelper.boot.version>1.4.7</pagehelper.boot.version>
|
||||
<fastjson.version>1.2.83</fastjson.version>
|
||||
<oshi.version>6.6.5</oshi.version>
|
||||
<commons.io.version>2.16.1</commons.io.version>
|
||||
<poi.version>4.1.2</poi.version>
|
||||
<velocity.version>2.3</velocity.version>
|
||||
</properties>
|
||||
|
||||
<!-- 依赖声明 -->
|
||||
<dependencyManagement>
|
||||
<dependencies>
|
||||
|
||||
<!-- SpringFramework的依赖配置-->
|
||||
<dependency>
|
||||
<groupId>org.springframework</groupId>
|
||||
<artifactId>spring-framework-bom</artifactId>
|
||||
<version>${spring-framework.version}</version>
|
||||
<type>pom</type>
|
||||
<scope>import</scope>
|
||||
</dependency>
|
||||
|
||||
<!-- SpringBoot的依赖配置-->
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-dependencies</artifactId>
|
||||
<version>2.5.15</version>
|
||||
<type>pom</type>
|
||||
<scope>import</scope>
|
||||
</dependency>
|
||||
|
||||
<!-- 阿里数据库连接池 -->
|
||||
<dependency>
|
||||
<groupId>com.alibaba</groupId>
|
||||
<artifactId>druid-spring-boot-starter</artifactId>
|
||||
<version>${druid.version}</version>
|
||||
</dependency>
|
||||
|
||||
<!-- 验证码 -->
|
||||
<dependency>
|
||||
<groupId>pro.fessional</groupId>
|
||||
<artifactId>kaptcha</artifactId>
|
||||
<version>${kaptcha.version}</version>
|
||||
</dependency>
|
||||
|
||||
<!-- Shiro核心框架 -->
|
||||
<dependency>
|
||||
<groupId>org.apache.shiro</groupId>
|
||||
<artifactId>shiro-core</artifactId>
|
||||
<version>${shiro.version}</version>
|
||||
</dependency>
|
||||
|
||||
<!-- Shiro使用Spring框架 -->
|
||||
<dependency>
|
||||
<groupId>org.apache.shiro</groupId>
|
||||
<artifactId>shiro-spring</artifactId>
|
||||
<version>${shiro.version}</version>
|
||||
</dependency>
|
||||
|
||||
<!-- Shiro使用EhCache缓存框架 -->
|
||||
<dependency>
|
||||
<groupId>org.apache.shiro</groupId>
|
||||
<artifactId>shiro-ehcache</artifactId>
|
||||
<version>${shiro.version}</version>
|
||||
</dependency>
|
||||
|
||||
<!-- thymeleaf模板引擎和shiro框架的整合 -->
|
||||
<dependency>
|
||||
<groupId>com.github.theborakompanioni</groupId>
|
||||
<artifactId>thymeleaf-extras-shiro</artifactId>
|
||||
<version>${thymeleaf.extras.shiro.version}</version>
|
||||
</dependency>
|
||||
|
||||
<!-- 解析客户端操作系统、浏览器等 -->
|
||||
<dependency>
|
||||
<groupId>eu.bitwalker</groupId>
|
||||
<artifactId>UserAgentUtils</artifactId>
|
||||
<version>${bitwalker.version}</version>
|
||||
</dependency>
|
||||
|
||||
<!-- pagehelper 分页插件 -->
|
||||
<dependency>
|
||||
<groupId>com.github.pagehelper</groupId>
|
||||
<artifactId>pagehelper-spring-boot-starter</artifactId>
|
||||
<version>${pagehelper.boot.version}</version>
|
||||
</dependency>
|
||||
|
||||
<!-- 获取系统信息 -->
|
||||
<dependency>
|
||||
<groupId>com.github.oshi</groupId>
|
||||
<artifactId>oshi-core</artifactId>
|
||||
<version>${oshi.version}</version>
|
||||
</dependency>
|
||||
|
||||
<!-- Swagger3依赖 -->
|
||||
<dependency>
|
||||
<groupId>io.springfox</groupId>
|
||||
<artifactId>springfox-boot-starter</artifactId>
|
||||
<version>${swagger.version}</version>
|
||||
<exclusions>
|
||||
<exclusion>
|
||||
<groupId>io.swagger</groupId>
|
||||
<artifactId>swagger-models</artifactId>
|
||||
</exclusion>
|
||||
</exclusions>
|
||||
</dependency>
|
||||
|
||||
<!-- io常用工具类 -->
|
||||
<dependency>
|
||||
<groupId>commons-io</groupId>
|
||||
<artifactId>commons-io</artifactId>
|
||||
<version>${commons.io.version}</version>
|
||||
</dependency>
|
||||
|
||||
<!-- excel工具 -->
|
||||
<dependency>
|
||||
<groupId>org.apache.poi</groupId>
|
||||
<artifactId>poi-ooxml</artifactId>
|
||||
<version>${poi.version}</version>
|
||||
</dependency>
|
||||
|
||||
<!-- velocity代码生成使用模板 -->
|
||||
<dependency>
|
||||
<groupId>org.apache.velocity</groupId>
|
||||
<artifactId>velocity-engine-core</artifactId>
|
||||
<version>${velocity.version}</version>
|
||||
</dependency>
|
||||
|
||||
<!-- 阿里JSON解析器 -->
|
||||
<dependency>
|
||||
<groupId>com.alibaba</groupId>
|
||||
<artifactId>fastjson</artifactId>
|
||||
<version>${fastjson.version}</version>
|
||||
</dependency>
|
||||
|
||||
|
||||
<!-- 核心模块-->
|
||||
<dependency>
|
||||
<groupId>com.ruoyi</groupId>
|
||||
<artifactId>ruoyi-framework</artifactId>
|
||||
<version>${ruoyi.version}</version>
|
||||
</dependency>
|
||||
|
||||
<!-- 系统模块-->
|
||||
<dependency>
|
||||
<groupId>com.ruoyi</groupId>
|
||||
<artifactId>ruoyi-system</artifactId>
|
||||
<version>${ruoyi.version}</version>
|
||||
</dependency>
|
||||
|
||||
<!-- 通用工具-->
|
||||
<dependency>
|
||||
<groupId>com.ruoyi</groupId>
|
||||
<artifactId>ruoyi-common</artifactId>
|
||||
<version>${ruoyi.version}</version>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
</dependencyManagement>
|
||||
|
||||
<modules>
|
||||
<module>ruoyi-admin</module>
|
||||
<module>ruoyi-framework</module>
|
||||
<module>ruoyi-system</module>
|
||||
<module>ruoyi-common</module>
|
||||
</modules>
|
||||
<packaging>pom</packaging>
|
||||
|
||||
|
||||
<dependencies>
|
||||
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-compiler-plugin</artifactId>
|
||||
<version>3.1</version>
|
||||
<configuration>
|
||||
<source>${java.version}</source>
|
||||
<target>${java.version}</target>
|
||||
<encoding>${project.build.sourceEncoding}</encoding>
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
|
||||
<repositories>
|
||||
<repository>
|
||||
<id>public</id>
|
||||
<name>aliyun nexus</name>
|
||||
<url>https://maven.aliyun.com/repository/public</url>
|
||||
<releases>
|
||||
<enabled>true</enabled>
|
||||
</releases>
|
||||
</repository>
|
||||
</repositories>
|
||||
|
||||
<pluginRepositories>
|
||||
<pluginRepository>
|
||||
<id>public</id>
|
||||
<name>aliyun nexus</name>
|
||||
<url>https://maven.aliyun.com/repository/public</url>
|
||||
<releases>
|
||||
<enabled>true</enabled>
|
||||
</releases>
|
||||
<snapshots>
|
||||
<enabled>false</enabled>
|
||||
</snapshots>
|
||||
</pluginRepository>
|
||||
</pluginRepositories>
|
||||
|
||||
</project>
|
@ -0,0 +1,30 @@
|
||||
package com.ruoyi;
|
||||
|
||||
import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
|
||||
|
||||
/**
|
||||
* 启动程序
|
||||
*
|
||||
* @author ruoyi
|
||||
*/
|
||||
@SpringBootApplication(exclude = { DataSourceAutoConfiguration.class })
|
||||
public class RuoYiApplication
|
||||
{
|
||||
public static void main(String[] args)
|
||||
{
|
||||
// System.setProperty("spring.devtools.restart.enabled", "false");
|
||||
SpringApplication.run(RuoYiApplication.class, args);
|
||||
System.out.println("(♥◠‿◠)ノ゙ 若依启动成功 ლ(´ڡ`ლ)゙ \n" +
|
||||
" .-------. ____ __ \n" +
|
||||
" | _ _ \\ \\ \\ / / \n" +
|
||||
" | ( ' ) | \\ _. / ' \n" +
|
||||
" |(_ o _) / _( )_ .' \n" +
|
||||
" | (_,_).' __ ___(_ o _)' \n" +
|
||||
" | |\\ \\ | || |(_,_)' \n" +
|
||||
" | | \\ `' /| `-' / \n" +
|
||||
" | | \\ / \\ / \n" +
|
||||
" ''-' `'-' `-..-' ");
|
||||
}
|
||||
}
|
@ -0,0 +1,18 @@
|
||||
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);
|
||||
}
|
||||
}
|
@ -0,0 +1,98 @@
|
||||
package com.ruoyi.web.controller.demo.controller;
|
||||
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
|
||||
/**
|
||||
* 模态窗口
|
||||
*
|
||||
* @author ruoyi
|
||||
*/
|
||||
@Controller
|
||||
@RequestMapping("/demo/modal")
|
||||
public class DemoDialogController
|
||||
{
|
||||
private String prefix = "demo/modal";
|
||||
|
||||
/**
|
||||
* 模态窗口
|
||||
*/
|
||||
@GetMapping("/dialog")
|
||||
public String dialog()
|
||||
{
|
||||
return prefix + "/dialog";
|
||||
}
|
||||
|
||||
/**
|
||||
* 弹层组件
|
||||
*/
|
||||
@GetMapping("/layer")
|
||||
public String layer()
|
||||
{
|
||||
return prefix + "/layer";
|
||||
}
|
||||
|
||||
/**
|
||||
* 表单
|
||||
*/
|
||||
@GetMapping("/form")
|
||||
public String form()
|
||||
{
|
||||
return prefix + "/form";
|
||||
}
|
||||
|
||||
/**
|
||||
* 表格
|
||||
*/
|
||||
@GetMapping("/table")
|
||||
public String table()
|
||||
{
|
||||
return prefix + "/table";
|
||||
}
|
||||
|
||||
/**
|
||||
* 表格check
|
||||
*/
|
||||
@GetMapping("/check")
|
||||
public String check()
|
||||
{
|
||||
return prefix + "/table/check";
|
||||
}
|
||||
|
||||
/**
|
||||
* 表格radio
|
||||
*/
|
||||
@GetMapping("/radio")
|
||||
public String radio()
|
||||
{
|
||||
return prefix + "/table/radio";
|
||||
}
|
||||
|
||||
/**
|
||||
* 表格回传父窗体
|
||||
*/
|
||||
@GetMapping("/parent")
|
||||
public String parent()
|
||||
{
|
||||
return prefix + "/table/parent";
|
||||
}
|
||||
|
||||
/**
|
||||
* 多层窗口frame1
|
||||
*/
|
||||
@GetMapping("/frame1")
|
||||
public String frame1()
|
||||
{
|
||||
return prefix + "/table/frame1";
|
||||
}
|
||||
|
||||
/**
|
||||
* 多层窗口frame2
|
||||
*/
|
||||
@GetMapping("/frame2")
|
||||
public String frame2()
|
||||
{
|
||||
return prefix + "/table/frame2";
|
||||
}
|
||||
}
|
@ -0,0 +1,35 @@
|
||||
package com.ruoyi.web.controller.demo.controller;
|
||||
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
|
||||
/**
|
||||
* 图标相关
|
||||
*
|
||||
* @author ruoyi
|
||||
*/
|
||||
@Controller
|
||||
@RequestMapping("/demo/icon")
|
||||
public class DemoIconController
|
||||
{
|
||||
private String prefix = "demo/icon";
|
||||
|
||||
/**
|
||||
* FontAwesome图标
|
||||
*/
|
||||
@GetMapping("/fontawesome")
|
||||
public String fontAwesome()
|
||||
{
|
||||
return prefix + "/fontawesome";
|
||||
}
|
||||
|
||||
/**
|
||||
* Glyphicons图标
|
||||
*/
|
||||
@GetMapping("/glyphicons")
|
||||
public String glyphicons()
|
||||
{
|
||||
return prefix + "/glyphicons";
|
||||
}
|
||||
}
|
@ -0,0 +1,53 @@
|
||||
package com.ruoyi.web.controller.demo.controller;
|
||||
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
|
||||
/**
|
||||
* 报表
|
||||
*
|
||||
* @author ruoyi
|
||||
*/
|
||||
@Controller
|
||||
@RequestMapping("/demo/report")
|
||||
public class DemoReportController
|
||||
{
|
||||
private String prefix = "demo/report";
|
||||
|
||||
/**
|
||||
* 百度ECharts
|
||||
*/
|
||||
@GetMapping("/echarts")
|
||||
public String echarts()
|
||||
{
|
||||
return prefix + "/echarts";
|
||||
}
|
||||
|
||||
/**
|
||||
* 图表插件
|
||||
*/
|
||||
@GetMapping("/peity")
|
||||
public String peity()
|
||||
{
|
||||
return prefix + "/peity";
|
||||
}
|
||||
|
||||
/**
|
||||
* 线状图插件
|
||||
*/
|
||||
@GetMapping("/sparkline")
|
||||
public String sparkline()
|
||||
{
|
||||
return prefix + "/sparkline";
|
||||
}
|
||||
|
||||
/**
|
||||
* 图表组合
|
||||
*/
|
||||
@GetMapping("/metrics")
|
||||
public String metrics()
|
||||
{
|
||||
return prefix + "/metrics";
|
||||
}
|
||||
}
|
@ -0,0 +1,116 @@
|
||||
package com.ruoyi.web.controller.demo.domain;
|
||||
|
||||
import java.util.List;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
|
||||
/**
|
||||
* 客户测试信息
|
||||
*
|
||||
* @author ruoyi
|
||||
*/
|
||||
public class CustomerModel
|
||||
{
|
||||
/**
|
||||
* 客户姓名
|
||||
*/
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 客户手机
|
||||
*/
|
||||
private String phonenumber;
|
||||
|
||||
/**
|
||||
* 客户性别
|
||||
*/
|
||||
private String sex;
|
||||
|
||||
/**
|
||||
* 客户生日
|
||||
*/
|
||||
private String birthday;
|
||||
|
||||
/**
|
||||
* 客户描述
|
||||
*/
|
||||
private String remark;
|
||||
|
||||
/**
|
||||
* 商品信息
|
||||
*/
|
||||
private List<GoodsModel> goods;
|
||||
|
||||
public String getName()
|
||||
{
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setName(String name)
|
||||
{
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public String getPhonenumber()
|
||||
{
|
||||
return phonenumber;
|
||||
}
|
||||
|
||||
public void setPhonenumber(String phonenumber)
|
||||
{
|
||||
this.phonenumber = phonenumber;
|
||||
}
|
||||
|
||||
|
||||
public String getSex()
|
||||
{
|
||||
return sex;
|
||||
}
|
||||
|
||||
public void setSex(String sex)
|
||||
{
|
||||
this.sex = sex;
|
||||
}
|
||||
|
||||
public String getBirthday()
|
||||
{
|
||||
return birthday;
|
||||
}
|
||||
|
||||
public void setBirthday(String birthday)
|
||||
{
|
||||
this.birthday = birthday;
|
||||
}
|
||||
|
||||
public String getRemark()
|
||||
{
|
||||
return remark;
|
||||
}
|
||||
|
||||
public void setRemark(String remark)
|
||||
{
|
||||
this.remark = remark;
|
||||
}
|
||||
|
||||
public List<GoodsModel> getGoods()
|
||||
{
|
||||
return goods;
|
||||
}
|
||||
|
||||
public void setGoods(List<GoodsModel> goods)
|
||||
{
|
||||
this.goods = goods;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("name", getName())
|
||||
.append("phonenumber", getPhonenumber())
|
||||
.append("sex", getSex())
|
||||
.append("birthday", getBirthday())
|
||||
.append("goods", getGoods())
|
||||
.append("remark", getRemark())
|
||||
.toString();
|
||||
}
|
||||
}
|
@ -0,0 +1,99 @@
|
||||
package com.ruoyi.web.controller.demo.domain;
|
||||
|
||||
import java.util.Date;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
|
||||
/**
|
||||
* 商品测试信息
|
||||
*
|
||||
* @author ruoyi
|
||||
*/
|
||||
public class GoodsModel
|
||||
{
|
||||
/**
|
||||
* 商品名称
|
||||
*/
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 商品重量
|
||||
*/
|
||||
private Integer weight;
|
||||
|
||||
/**
|
||||
* 商品价格
|
||||
*/
|
||||
private Double price;
|
||||
|
||||
/**
|
||||
* 商品日期
|
||||
*/
|
||||
private Date date;
|
||||
|
||||
/**
|
||||
* 商品种类
|
||||
*/
|
||||
private String type;
|
||||
|
||||
public String getName()
|
||||
{
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setName(String name)
|
||||
{
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public Integer getWeight()
|
||||
{
|
||||
return weight;
|
||||
}
|
||||
|
||||
public void setWeight(Integer weight)
|
||||
{
|
||||
this.weight = weight;
|
||||
}
|
||||
|
||||
public Double getPrice()
|
||||
{
|
||||
return price;
|
||||
}
|
||||
|
||||
public void setPrice(Double price)
|
||||
{
|
||||
this.price = price;
|
||||
}
|
||||
|
||||
public Date getDate()
|
||||
{
|
||||
return date;
|
||||
}
|
||||
|
||||
public void setDate(Date date)
|
||||
{
|
||||
this.date = date;
|
||||
}
|
||||
|
||||
public String getType()
|
||||
{
|
||||
return type;
|
||||
}
|
||||
|
||||
public void setType(String type)
|
||||
{
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("name", getName())
|
||||
.append("weight", getWeight())
|
||||
.append("price", getPrice())
|
||||
.append("date", getDate())
|
||||
.append("type", getType())
|
||||
.toString();
|
||||
}
|
||||
}
|
@ -0,0 +1,149 @@
|
||||
package com.ruoyi.web.controller.demo.domain;
|
||||
|
||||
import java.util.Date;
|
||||
import com.ruoyi.common.annotation.Excel;
|
||||
import com.ruoyi.common.annotation.Excel.Type;
|
||||
import com.ruoyi.common.core.domain.BaseEntity;
|
||||
import com.ruoyi.common.utils.DateUtils;
|
||||
|
||||
public class UserOperateModel extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
private int userId;
|
||||
|
||||
@Excel(name = "用户编号")
|
||||
private String userCode;
|
||||
|
||||
@Excel(name = "用户姓名")
|
||||
private String userName;
|
||||
|
||||
@Excel(name = "用户性别", readConverterExp = "0=男,1=女,2=未知")
|
||||
private String userSex;
|
||||
|
||||
@Excel(name = "用户手机")
|
||||
private String userPhone;
|
||||
|
||||
@Excel(name = "用户邮箱")
|
||||
private String userEmail;
|
||||
|
||||
@Excel(name = "用户余额")
|
||||
private double userBalance;
|
||||
|
||||
@Excel(name = "用户状态", readConverterExp = "0=正常,1=停用")
|
||||
private String status;
|
||||
|
||||
@Excel(name = "创建时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss", type = Type.EXPORT)
|
||||
private Date createTime;
|
||||
|
||||
public UserOperateModel()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public UserOperateModel(int userId, String userCode, String userName, String userSex, String userPhone,
|
||||
String userEmail, double userBalance, String status)
|
||||
{
|
||||
this.userId = userId;
|
||||
this.userCode = userCode;
|
||||
this.userName = userName;
|
||||
this.userSex = userSex;
|
||||
this.userPhone = userPhone;
|
||||
this.userEmail = userEmail;
|
||||
this.userBalance = userBalance;
|
||||
this.status = status;
|
||||
this.createTime = DateUtils.getNowDate();
|
||||
}
|
||||
|
||||
public int getUserId()
|
||||
{
|
||||
return userId;
|
||||
}
|
||||
|
||||
public void setUserId(int userId)
|
||||
{
|
||||
this.userId = userId;
|
||||
}
|
||||
|
||||
public String getUserCode()
|
||||
{
|
||||
return userCode;
|
||||
}
|
||||
|
||||
public void setUserCode(String userCode)
|
||||
{
|
||||
this.userCode = userCode;
|
||||
}
|
||||
|
||||
public String getUserName()
|
||||
{
|
||||
return userName;
|
||||
}
|
||||
|
||||
public void setUserName(String userName)
|
||||
{
|
||||
this.userName = userName;
|
||||
}
|
||||
|
||||
public String getUserSex()
|
||||
{
|
||||
return userSex;
|
||||
}
|
||||
|
||||
public void setUserSex(String userSex)
|
||||
{
|
||||
this.userSex = userSex;
|
||||
}
|
||||
|
||||
public String getUserPhone()
|
||||
{
|
||||
return userPhone;
|
||||
}
|
||||
|
||||
public void setUserPhone(String userPhone)
|
||||
{
|
||||
this.userPhone = userPhone;
|
||||
}
|
||||
|
||||
public String getUserEmail()
|
||||
{
|
||||
return userEmail;
|
||||
}
|
||||
|
||||
public void setUserEmail(String userEmail)
|
||||
{
|
||||
this.userEmail = userEmail;
|
||||
}
|
||||
|
||||
public double getUserBalance()
|
||||
{
|
||||
return userBalance;
|
||||
}
|
||||
|
||||
public void setUserBalance(double userBalance)
|
||||
{
|
||||
this.userBalance = userBalance;
|
||||
}
|
||||
|
||||
public String getStatus()
|
||||
{
|
||||
return status;
|
||||
}
|
||||
|
||||
public void setStatus(String status)
|
||||
{
|
||||
this.status = status;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Date getCreateTime()
|
||||
{
|
||||
return createTime;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setCreateTime(Date createTime)
|
||||
{
|
||||
this.createTime = createTime;
|
||||
}
|
||||
}
|
@ -0,0 +1,90 @@
|
||||
package com.ruoyi.web.controller.monitor;
|
||||
|
||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.ui.ModelMap;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.ResponseBody;
|
||||
import com.ruoyi.common.core.controller.BaseController;
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.framework.web.service.CacheService;
|
||||
|
||||
/**
|
||||
* 缓存监控
|
||||
*
|
||||
* @author ruoyi
|
||||
*/
|
||||
@Controller
|
||||
@RequestMapping("/monitor/cache")
|
||||
public class CacheController extends BaseController
|
||||
{
|
||||
private String prefix = "monitor/cache";
|
||||
|
||||
@Autowired
|
||||
private CacheService cacheService;
|
||||
|
||||
@RequiresPermissions("monitor:cache:view")
|
||||
@GetMapping()
|
||||
public String cache(ModelMap mmap)
|
||||
{
|
||||
mmap.put("cacheNames", cacheService.getCacheNames());
|
||||
return prefix + "/cache";
|
||||
}
|
||||
|
||||
@RequiresPermissions("monitor:cache:view")
|
||||
@PostMapping("/getNames")
|
||||
public String getCacheNames(String fragment, ModelMap mmap)
|
||||
{
|
||||
mmap.put("cacheNames", cacheService.getCacheNames());
|
||||
return prefix + "/cache::" + fragment;
|
||||
}
|
||||
|
||||
@RequiresPermissions("monitor:cache:view")
|
||||
@PostMapping("/getKeys")
|
||||
public String getCacheKeys(String fragment, String cacheName, ModelMap mmap)
|
||||
{
|
||||
mmap.put("cacheName", cacheName);
|
||||
mmap.put("cacheKeys", cacheService.getCacheKeys(cacheName));
|
||||
return prefix + "/cache::" + fragment;
|
||||
}
|
||||
|
||||
@RequiresPermissions("monitor:cache:view")
|
||||
@PostMapping("/getValue")
|
||||
public String getCacheValue(String fragment, String cacheName, String cacheKey, ModelMap mmap)
|
||||
{
|
||||
mmap.put("cacheName", cacheName);
|
||||
mmap.put("cacheKey", cacheKey);
|
||||
mmap.put("cacheValue", cacheService.getCacheValue(cacheName, cacheKey));
|
||||
return prefix + "/cache::" + fragment;
|
||||
}
|
||||
|
||||
@RequiresPermissions("monitor:cache:view")
|
||||
@PostMapping("/clearCacheName")
|
||||
@ResponseBody
|
||||
public AjaxResult clearCacheName(String cacheName, ModelMap mmap)
|
||||
{
|
||||
cacheService.clearCacheName(cacheName);
|
||||
return AjaxResult.success();
|
||||
}
|
||||
|
||||
@RequiresPermissions("monitor:cache:view")
|
||||
@PostMapping("/clearCacheKey")
|
||||
@ResponseBody
|
||||
public AjaxResult clearCacheKey(String cacheName, String cacheKey, ModelMap mmap)
|
||||
{
|
||||
cacheService.clearCacheKey(cacheName, cacheKey);
|
||||
return AjaxResult.success();
|
||||
}
|
||||
|
||||
@RequiresPermissions("monitor:cache:view")
|
||||
@GetMapping("/clearAll")
|
||||
@ResponseBody
|
||||
public AjaxResult clearAll(ModelMap mmap)
|
||||
{
|
||||
cacheService.clearAll();
|
||||
return AjaxResult.success();
|
||||
}
|
||||
}
|
@ -0,0 +1,26 @@
|
||||
package com.ruoyi.web.controller.monitor;
|
||||
|
||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import com.ruoyi.common.core.controller.BaseController;
|
||||
|
||||
/**
|
||||
* druid 监控
|
||||
*
|
||||
* @author ruoyi
|
||||
*/
|
||||
@Controller
|
||||
@RequestMapping("/monitor/data")
|
||||
public class DruidController extends BaseController
|
||||
{
|
||||
private String prefix = "/druid";
|
||||
|
||||
@RequiresPermissions("monitor:data:view")
|
||||
@GetMapping()
|
||||
public String index()
|
||||
{
|
||||
return redirect(prefix + "/index.html");
|
||||
}
|
||||
}
|
@ -0,0 +1,31 @@
|
||||
package com.ruoyi.web.controller.monitor;
|
||||
|
||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.ui.ModelMap;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import com.ruoyi.common.core.controller.BaseController;
|
||||
import com.ruoyi.framework.web.domain.Server;
|
||||
|
||||
/**
|
||||
* 服务器监控
|
||||
*
|
||||
* @author ruoyi
|
||||
*/
|
||||
@Controller
|
||||
@RequestMapping("/monitor/server")
|
||||
public class ServerController extends BaseController
|
||||
{
|
||||
private String prefix = "monitor/server";
|
||||
|
||||
@RequiresPermissions("monitor:server:view")
|
||||
@GetMapping()
|
||||
public String server(ModelMap mmap) throws Exception
|
||||
{
|
||||
Server server = new Server();
|
||||
server.copyTo();
|
||||
mmap.put("server", server);
|
||||
return prefix + "/server";
|
||||
}
|
||||
}
|
@ -0,0 +1,94 @@
|
||||
package com.ruoyi.web.controller.monitor;
|
||||
|
||||
import java.util.List;
|
||||
import com.ruoyi.framework.shiro.service.SysPasswordService;
|
||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.ResponseBody;
|
||||
import com.ruoyi.common.annotation.Log;
|
||||
import com.ruoyi.common.core.controller.BaseController;
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.common.core.page.TableDataInfo;
|
||||
import com.ruoyi.common.enums.BusinessType;
|
||||
import com.ruoyi.common.utils.poi.ExcelUtil;
|
||||
import com.ruoyi.system.domain.SysLogininfor;
|
||||
import com.ruoyi.system.service.ISysLogininforService;
|
||||
|
||||
/**
|
||||
* 系统访问记录
|
||||
*
|
||||
* @author ruoyi
|
||||
*/
|
||||
@Controller
|
||||
@RequestMapping("/monitor/logininfor")
|
||||
public class SysLogininforController extends BaseController
|
||||
{
|
||||
private String prefix = "monitor/logininfor";
|
||||
|
||||
@Autowired
|
||||
private ISysLogininforService logininforService;
|
||||
|
||||
@Autowired
|
||||
private SysPasswordService passwordService;
|
||||
|
||||
@RequiresPermissions("monitor:logininfor:view")
|
||||
@GetMapping()
|
||||
public String logininfor()
|
||||
{
|
||||
return prefix + "/logininfor";
|
||||
}
|
||||
|
||||
@RequiresPermissions("monitor:logininfor:list")
|
||||
@PostMapping("/list")
|
||||
@ResponseBody
|
||||
public TableDataInfo list(SysLogininfor logininfor)
|
||||
{
|
||||
startPage();
|
||||
List<SysLogininfor> list = logininforService.selectLogininforList(logininfor);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
@Log(title = "登录日志", businessType = BusinessType.EXPORT)
|
||||
@RequiresPermissions("monitor:logininfor:export")
|
||||
@PostMapping("/export")
|
||||
@ResponseBody
|
||||
public AjaxResult export(SysLogininfor logininfor)
|
||||
{
|
||||
List<SysLogininfor> list = logininforService.selectLogininforList(logininfor);
|
||||
ExcelUtil<SysLogininfor> util = new ExcelUtil<SysLogininfor>(SysLogininfor.class);
|
||||
return util.exportExcel(list, "登录日志");
|
||||
}
|
||||
|
||||
@RequiresPermissions("monitor:logininfor:remove")
|
||||
@Log(title = "登录日志", businessType = BusinessType.DELETE)
|
||||
@PostMapping("/remove")
|
||||
@ResponseBody
|
||||
public AjaxResult remove(String ids)
|
||||
{
|
||||
return toAjax(logininforService.deleteLogininforByIds(ids));
|
||||
}
|
||||
|
||||
@RequiresPermissions("monitor:logininfor:remove")
|
||||
@Log(title = "登录日志", businessType = BusinessType.CLEAN)
|
||||
@PostMapping("/clean")
|
||||
@ResponseBody
|
||||
public AjaxResult clean()
|
||||
{
|
||||
logininforService.cleanLogininfor();
|
||||
return success();
|
||||
}
|
||||
|
||||
@RequiresPermissions("monitor:logininfor:unlock")
|
||||
@Log(title = "账户解锁", businessType = BusinessType.OTHER)
|
||||
@PostMapping("/unlock")
|
||||
@ResponseBody
|
||||
public AjaxResult unlock(String loginName)
|
||||
{
|
||||
passwordService.clearLoginRecordCache(loginName);
|
||||
return success();
|
||||
}
|
||||
}
|
@ -0,0 +1,90 @@
|
||||
package com.ruoyi.web.controller.monitor;
|
||||
|
||||
import java.util.List;
|
||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.ui.ModelMap;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.ResponseBody;
|
||||
import com.ruoyi.common.annotation.Log;
|
||||
import com.ruoyi.common.core.controller.BaseController;
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.common.core.page.TableDataInfo;
|
||||
import com.ruoyi.common.enums.BusinessType;
|
||||
import com.ruoyi.common.utils.poi.ExcelUtil;
|
||||
import com.ruoyi.system.domain.SysOperLog;
|
||||
import com.ruoyi.system.service.ISysOperLogService;
|
||||
|
||||
/**
|
||||
* 操作日志记录
|
||||
*
|
||||
* @author ruoyi
|
||||
*/
|
||||
@Controller
|
||||
@RequestMapping("/monitor/operlog")
|
||||
public class SysOperlogController extends BaseController
|
||||
{
|
||||
private String prefix = "monitor/operlog";
|
||||
|
||||
@Autowired
|
||||
private ISysOperLogService operLogService;
|
||||
|
||||
@RequiresPermissions("monitor:operlog:view")
|
||||
@GetMapping()
|
||||
public String operlog()
|
||||
{
|
||||
return prefix + "/operlog";
|
||||
}
|
||||
|
||||
@RequiresPermissions("monitor:operlog:list")
|
||||
@PostMapping("/list")
|
||||
@ResponseBody
|
||||
public TableDataInfo list(SysOperLog operLog)
|
||||
{
|
||||
startPage();
|
||||
List<SysOperLog> list = operLogService.selectOperLogList(operLog);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
@Log(title = "操作日志", businessType = BusinessType.EXPORT)
|
||||
@RequiresPermissions("monitor:operlog:export")
|
||||
@PostMapping("/export")
|
||||
@ResponseBody
|
||||
public AjaxResult export(SysOperLog operLog)
|
||||
{
|
||||
List<SysOperLog> list = operLogService.selectOperLogList(operLog);
|
||||
ExcelUtil<SysOperLog> util = new ExcelUtil<SysOperLog>(SysOperLog.class);
|
||||
return util.exportExcel(list, "操作日志");
|
||||
}
|
||||
|
||||
@Log(title = "操作日志", businessType = BusinessType.DELETE)
|
||||
@RequiresPermissions("monitor:operlog:remove")
|
||||
@PostMapping("/remove")
|
||||
@ResponseBody
|
||||
public AjaxResult remove(String ids)
|
||||
{
|
||||
return toAjax(operLogService.deleteOperLogByIds(ids));
|
||||
}
|
||||
|
||||
@RequiresPermissions("monitor:operlog:detail")
|
||||
@GetMapping("/detail/{operId}")
|
||||
public String detail(@PathVariable("operId") Long operId, ModelMap mmap)
|
||||
{
|
||||
mmap.put("operLog", operLogService.selectOperLogById(operId));
|
||||
return prefix + "/detail";
|
||||
}
|
||||
|
||||
@Log(title = "操作日志", businessType = BusinessType.CLEAN)
|
||||
@RequiresPermissions("monitor:operlog:remove")
|
||||
@PostMapping("/clean")
|
||||
@ResponseBody
|
||||
public AjaxResult clean()
|
||||
{
|
||||
operLogService.cleanOperLog();
|
||||
return success();
|
||||
}
|
||||
}
|
@ -0,0 +1,76 @@
|
||||
package com.ruoyi.web.controller.system;
|
||||
|
||||
import com.ruoyi.common.config.RuoYiConfig;
|
||||
import com.ruoyi.common.constant.ShiroConstants;
|
||||
import com.ruoyi.common.core.controller.BaseController;
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.common.core.domain.entity.SysUser;
|
||||
import com.ruoyi.common.utils.CookieUtils;
|
||||
import com.ruoyi.common.utils.ServletUtils;
|
||||
import com.ruoyi.common.utils.StringUtils;
|
||||
import com.ruoyi.framework.shiro.service.SysPasswordService;
|
||||
import com.ruoyi.system.domain.SysAccount;
|
||||
import com.ruoyi.system.service.ISysAccountService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.ui.ModelMap;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* 首页 业务处理
|
||||
*
|
||||
* @author ruoyi
|
||||
*/
|
||||
@Controller
|
||||
public class SysAccountController extends BaseController
|
||||
{
|
||||
|
||||
@Autowired
|
||||
private ISysAccountService accountService;
|
||||
|
||||
// 账户管理
|
||||
@GetMapping("/account")
|
||||
public String account()
|
||||
{
|
||||
return "ky/account";
|
||||
}
|
||||
|
||||
// 查询账户信息
|
||||
@PostMapping("/account/getList")
|
||||
@ResponseBody
|
||||
public AjaxResult getList(SysAccount account)
|
||||
{
|
||||
account.setUserId(getUserId());
|
||||
return AjaxResult.success(accountService.selectSysAccounts(account));
|
||||
}
|
||||
|
||||
// 新增账户
|
||||
@PostMapping("/account/insert")
|
||||
@ResponseBody
|
||||
public AjaxResult insert(SysAccount account)
|
||||
{
|
||||
account.setUserId(getUserId());
|
||||
return toAjax(accountService.insertSysAccount(account));
|
||||
}
|
||||
|
||||
// 修改账户
|
||||
@PostMapping("/account/update")
|
||||
@ResponseBody
|
||||
public AjaxResult update(SysAccount account)
|
||||
{
|
||||
return toAjax(accountService.updateSysAccount(account));
|
||||
}
|
||||
|
||||
// 删除账户
|
||||
@PostMapping("/account/delete")
|
||||
@ResponseBody
|
||||
public AjaxResult delete(String ids)
|
||||
{
|
||||
return toAjax(accountService.deleteSysAccount(Arrays.stream(ids.split(",")).map(Long::parseLong).collect(Collectors.toList())));
|
||||
}
|
||||
}
|
@ -0,0 +1,160 @@
|
||||
package com.ruoyi.web.controller.system;
|
||||
|
||||
import com.ruoyi.common.core.controller.BaseController;
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.common.utils.StringUtils;
|
||||
import com.ruoyi.common.utils.poi.ExcelUtil;
|
||||
import com.ruoyi.system.domain.SysBalanceLog;
|
||||
import com.ruoyi.system.domain.SysPayYz;
|
||||
import com.ruoyi.system.service.ISysBalanceLogService;
|
||||
import org.apache.commons.io.FileUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.core.io.ClassPathResource;
|
||||
import org.springframework.core.io.Resource;
|
||||
import org.springframework.core.io.ResourceLoader;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.util.StreamUtils;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.ResponseBody;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.io.*;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* 首页 业务处理
|
||||
*
|
||||
* @author ruoyi
|
||||
*/
|
||||
@Controller
|
||||
public class SysBalanceLogController extends BaseController
|
||||
{
|
||||
|
||||
@Autowired
|
||||
private ISysBalanceLogService balanceLogService;
|
||||
|
||||
@Autowired
|
||||
private ResourceLoader resourceLoader;
|
||||
|
||||
// 支出管理
|
||||
@GetMapping("/zhichu")
|
||||
public String zhichu()
|
||||
{
|
||||
return "ky/zhichu";
|
||||
}
|
||||
|
||||
// 收入管理
|
||||
@GetMapping("/income")
|
||||
public String income()
|
||||
{
|
||||
return "ky/income";
|
||||
}
|
||||
|
||||
// 查询支出预算
|
||||
@PostMapping("/zhichu/getYsInfo")
|
||||
@ResponseBody
|
||||
public SysPayYz getYsInfo()
|
||||
{
|
||||
return balanceLogService.selectPayYz(getUserId());
|
||||
}
|
||||
|
||||
// 编辑支出预算
|
||||
@PostMapping("/zhichu/updateYsInfo")
|
||||
@ResponseBody
|
||||
public AjaxResult updateYsInfo(SysPayYz payYz)
|
||||
{
|
||||
payYz.setUserId(getUserId());
|
||||
return toAjax(balanceLogService.updateYsInfo(payYz));
|
||||
}
|
||||
|
||||
// 查询收支记录
|
||||
@PostMapping("/balance/getList")
|
||||
@ResponseBody
|
||||
public List<SysBalanceLog> getList(SysBalanceLog balanceLog)
|
||||
{
|
||||
balanceLog.setUserId(getUserId());
|
||||
// PageHelper.startPage(balanceLog.getPage(), balanceLog.getPageSize());
|
||||
return balanceLogService.selectSysBalanceLog(balanceLog);
|
||||
}
|
||||
|
||||
// 新增账户
|
||||
@PostMapping("/balance/insert")
|
||||
@ResponseBody
|
||||
public AjaxResult insert(SysBalanceLog balanceLog)
|
||||
{
|
||||
balanceLog.setUserId(getUserId());
|
||||
return toAjax(balanceLogService.insertSysBalanceLog(balanceLog));
|
||||
}
|
||||
|
||||
// 修改账户
|
||||
@PostMapping("/balance/update")
|
||||
@ResponseBody
|
||||
public AjaxResult update(SysBalanceLog balanceLog)
|
||||
{
|
||||
balanceLog.setUserId(getUserId());
|
||||
return toAjax(balanceLogService.updateSysBalanceLog(balanceLog));
|
||||
}
|
||||
|
||||
// 删除账户
|
||||
@PostMapping("/balance/delete")
|
||||
@ResponseBody
|
||||
public AjaxResult delete(String ids)
|
||||
{
|
||||
|
||||
return toAjax(balanceLogService.deleteSysBalanceLog(Arrays.stream(ids.split(",")).map(Long::parseLong).collect(Collectors.toList())));
|
||||
}
|
||||
|
||||
/**
|
||||
* 文件下载 isOnline默认为false
|
||||
*/
|
||||
@GetMapping("/balance/download")
|
||||
public void download(HttpServletResponse response) throws IOException {
|
||||
InputStream is = null;
|
||||
OutputStream os = null;
|
||||
try {
|
||||
is = SysBalanceLogController.class.getClassLoader().getResourceAsStream("income.xlsx");
|
||||
os = response.getOutputStream();
|
||||
byte[] bytes = StreamUtils.copyToByteArray(is);
|
||||
response.reset();
|
||||
//下面这两行是为了解决跨域,如果没有跨域这两行可以删除
|
||||
response.addHeader("Access-Control-Allow-Origin", "*");
|
||||
response.addHeader("Access-Control-Allow-Methods", "GET, POST, PUT, DELETE");
|
||||
response.setContentType("application/octet-stream;charset=utf-8");
|
||||
response.addHeader("Content-Disposition", "attachment;filename=income.xlsx");
|
||||
response.addHeader("Content-Length", "" + bytes.length);
|
||||
os.write(bytes);
|
||||
os.flush();
|
||||
}catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}finally {
|
||||
try {
|
||||
if(os != null) {
|
||||
os.close();
|
||||
}
|
||||
if (is != null) {
|
||||
is.close();
|
||||
}
|
||||
}catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@PostMapping("/balance/importData")
|
||||
@ResponseBody
|
||||
public AjaxResult importData(MultipartFile file_data) throws Exception
|
||||
{
|
||||
ExcelUtil<SysBalanceLog> util = new ExcelUtil<>(SysBalanceLog.class);
|
||||
List<SysBalanceLog> balanceLogs = util.importExcel(file_data.getInputStream());
|
||||
String message = balanceLogService.importBalanceLog(balanceLogs, getUserId());
|
||||
if (StringUtils.isNotEmpty(message)) {
|
||||
return AjaxResult.error(message);
|
||||
}
|
||||
return AjaxResult.success();
|
||||
}
|
||||
}
|
@ -0,0 +1,91 @@
|
||||
package com.ruoyi.web.controller.system;
|
||||
|
||||
import com.ruoyi.common.core.controller.BaseController;
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.common.utils.StringUtils;
|
||||
import com.ruoyi.common.utils.poi.ExcelUtil;
|
||||
import com.ruoyi.system.domain.SysAccount;
|
||||
import com.ruoyi.system.domain.SysBalanceLog;
|
||||
import com.ruoyi.system.service.ISysAccountService;
|
||||
import com.ruoyi.system.service.ISysBalanceLogService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.ResponseBody;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* 首页 业务处理
|
||||
*
|
||||
* @author ruoyi
|
||||
*/
|
||||
@Controller
|
||||
public class SysDatasisController extends BaseController
|
||||
{
|
||||
|
||||
@Autowired
|
||||
private ISysBalanceLogService balanceLogService;
|
||||
|
||||
// 数据分析
|
||||
@GetMapping("/datasis")
|
||||
public String datasis()
|
||||
{
|
||||
return "ky/datasis";
|
||||
}
|
||||
|
||||
|
||||
@PostMapping("/datasis/getSz")
|
||||
@ResponseBody
|
||||
public List<SysBalanceLog> getSz()
|
||||
{
|
||||
return balanceLogService.selectSZ(getUserId());
|
||||
}
|
||||
|
||||
@PostMapping("/datasis/getSr")
|
||||
@ResponseBody
|
||||
public List<SysBalanceLog> getSr()
|
||||
{
|
||||
return balanceLogService.selectSr(getUserId());
|
||||
}
|
||||
@PostMapping("/datasis/getZc")
|
||||
@ResponseBody
|
||||
public List<SysBalanceLog> getZc()
|
||||
{
|
||||
return balanceLogService.selectZc(getUserId());
|
||||
}
|
||||
|
||||
@PostMapping("/datasis/getYs")
|
||||
@ResponseBody
|
||||
public BigDecimal getYs()
|
||||
{
|
||||
return balanceLogService.getYs(getUserId());
|
||||
}
|
||||
|
||||
@PostMapping("/datasis/insertYs")
|
||||
@ResponseBody
|
||||
public AjaxResult insertYs(BigDecimal price)
|
||||
{
|
||||
balanceLogService.insertYs(getUserId(), price);
|
||||
return AjaxResult.success();
|
||||
}
|
||||
|
||||
@PostMapping("/datasis/getCurYs")
|
||||
@ResponseBody
|
||||
public String getCurYs()
|
||||
{
|
||||
return balanceLogService.getCurYs(getUserId());
|
||||
}
|
||||
|
||||
@PostMapping("/datasis/getSrAndZc")
|
||||
@ResponseBody
|
||||
public List<SysBalanceLog> getSrAndZc()
|
||||
{
|
||||
return balanceLogService.selectSrAndZc(getUserId());
|
||||
}
|
||||
}
|
@ -0,0 +1,104 @@
|
||||
package com.ruoyi.web.controller.system;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import javax.servlet.http.Cookie;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import com.ruoyi.system.domain.SysIndex;
|
||||
import com.ruoyi.system.mapper.SysBalanceLogMapper;
|
||||
import com.ruoyi.system.service.ISysBalanceLogService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.ui.ModelMap;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.ResponseBody;
|
||||
import com.ruoyi.common.config.RuoYiConfig;
|
||||
import com.ruoyi.common.constant.ShiroConstants;
|
||||
import com.ruoyi.common.core.controller.BaseController;
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.common.core.domain.entity.SysUser;
|
||||
import com.ruoyi.common.core.text.Convert;
|
||||
import com.ruoyi.common.utils.CookieUtils;
|
||||
import com.ruoyi.common.utils.DateUtils;
|
||||
import com.ruoyi.common.utils.ServletUtils;
|
||||
import com.ruoyi.common.utils.StringUtils;
|
||||
import com.ruoyi.framework.shiro.service.SysPasswordService;
|
||||
|
||||
/**
|
||||
* 首页 业务处理
|
||||
*
|
||||
* @author ruoyi
|
||||
*/
|
||||
@Controller
|
||||
public class SysIndexController extends BaseController
|
||||
{
|
||||
|
||||
@Autowired
|
||||
private SysPasswordService passwordService;
|
||||
@Autowired
|
||||
private ISysBalanceLogService balanceLogService;
|
||||
|
||||
// 系统首页
|
||||
@GetMapping("/index")
|
||||
public String index(ModelMap mmap)
|
||||
{
|
||||
// 取身份信息
|
||||
SysUser user = getSysUser();
|
||||
SysIndex index = balanceLogService.selectIndexInfo(user.getUserId());
|
||||
mmap.put("user", user);
|
||||
mmap.put("info", index);
|
||||
return "ky/index";
|
||||
}
|
||||
|
||||
// 锁定屏幕
|
||||
@GetMapping("/lockscreen")
|
||||
public String lockscreen(ModelMap mmap)
|
||||
{
|
||||
mmap.put("user", getSysUser());
|
||||
ServletUtils.getSession().setAttribute(ShiroConstants.LOCK_SCREEN, true);
|
||||
return "lock";
|
||||
}
|
||||
|
||||
// 解锁屏幕
|
||||
@PostMapping("/unlockscreen")
|
||||
@ResponseBody
|
||||
public AjaxResult unlockscreen(String password)
|
||||
{
|
||||
SysUser user = getSysUser();
|
||||
if (StringUtils.isNull(user))
|
||||
{
|
||||
return AjaxResult.error("服务器超时,请重新登录");
|
||||
}
|
||||
if (passwordService.matches(user, password))
|
||||
{
|
||||
ServletUtils.getSession().removeAttribute(ShiroConstants.LOCK_SCREEN);
|
||||
return AjaxResult.success();
|
||||
}
|
||||
return AjaxResult.error("密码不正确,请重新输入。");
|
||||
}
|
||||
|
||||
// 切换主题
|
||||
@GetMapping("/system/switchSkin")
|
||||
public String switchSkin()
|
||||
{
|
||||
return "skin";
|
||||
}
|
||||
|
||||
// 切换菜单
|
||||
@GetMapping("/system/menuStyle/{style}")
|
||||
public void menuStyle(@PathVariable String style, HttpServletResponse response)
|
||||
{
|
||||
CookieUtils.setCookie(response, "nav-style", style);
|
||||
}
|
||||
|
||||
// 系统介绍
|
||||
@GetMapping("/system/main")
|
||||
public String main(ModelMap mmap)
|
||||
{
|
||||
mmap.put("version", RuoYiConfig.getVersion());
|
||||
return "main";
|
||||
}
|
||||
}
|
@ -0,0 +1,76 @@
|
||||
package com.ruoyi.web.controller.system;
|
||||
|
||||
import com.ruoyi.common.core.controller.BaseController;
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.system.domain.SysAccount;
|
||||
import com.ruoyi.system.domain.SysJk;
|
||||
import com.ruoyi.system.service.ISysAccountService;
|
||||
import com.ruoyi.system.service.ISysJkService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.ResponseBody;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 首页 业务处理
|
||||
*
|
||||
* @author ruoyi
|
||||
*/
|
||||
@Controller
|
||||
public class SysJkController extends BaseController
|
||||
{
|
||||
|
||||
@Autowired
|
||||
private ISysJkService jkService;
|
||||
|
||||
// 账户管理
|
||||
@GetMapping("/jiance")
|
||||
public String account()
|
||||
{
|
||||
return "ky/jiance";
|
||||
}
|
||||
|
||||
// 查询通知信息
|
||||
@PostMapping("/jiance/getList")
|
||||
@ResponseBody
|
||||
public AjaxResult getList()
|
||||
{
|
||||
return AjaxResult.success(jkService.selectSysJkNotice(getUserId()));
|
||||
}
|
||||
|
||||
// 查询监控配置
|
||||
@PostMapping("/jiance/getJkList")
|
||||
@ResponseBody
|
||||
public AjaxResult getJkList()
|
||||
{
|
||||
return AjaxResult.success(jkService.selectSysJks(getUserId()));
|
||||
}
|
||||
|
||||
// 新增监控信息
|
||||
@PostMapping("/jiance/insert")
|
||||
@ResponseBody
|
||||
public AjaxResult insert(SysJk jk)
|
||||
{
|
||||
jk.setUserId(getUserId());
|
||||
return toAjax(jkService.insertSysJk(jk));
|
||||
}
|
||||
|
||||
// 修改监控信息
|
||||
@PostMapping("/jiance/update")
|
||||
@ResponseBody
|
||||
public AjaxResult update(SysJk jk)
|
||||
{
|
||||
return toAjax(jkService.updateSysJk(jk));
|
||||
}
|
||||
|
||||
// 删除账户
|
||||
@PostMapping("/jiance/delete")
|
||||
@ResponseBody
|
||||
public AjaxResult delete(Long id)
|
||||
{
|
||||
return toAjax(jkService.deleteSysJk(id));
|
||||
}
|
||||
}
|
@ -0,0 +1,170 @@
|
||||
package com.ruoyi.web.controller.system;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.ui.ModelMap;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.ResponseBody;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
import com.ruoyi.common.annotation.Log;
|
||||
import com.ruoyi.common.config.RuoYiConfig;
|
||||
import com.ruoyi.common.core.controller.BaseController;
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.common.core.domain.entity.SysUser;
|
||||
import com.ruoyi.common.enums.BusinessType;
|
||||
import com.ruoyi.common.utils.DateUtils;
|
||||
import com.ruoyi.common.utils.ShiroUtils;
|
||||
import com.ruoyi.common.utils.StringUtils;
|
||||
import com.ruoyi.common.utils.file.FileUploadUtils;
|
||||
import com.ruoyi.common.utils.file.MimeTypeUtils;
|
||||
import com.ruoyi.framework.shiro.service.SysPasswordService;
|
||||
import com.ruoyi.system.service.ISysUserService;
|
||||
|
||||
/**
|
||||
* 个人信息 业务处理
|
||||
*
|
||||
* @author ruoyi
|
||||
*/
|
||||
@Controller
|
||||
@RequestMapping("/system/user/profile")
|
||||
public class SysProfileController extends BaseController
|
||||
{
|
||||
private static final Logger log = LoggerFactory.getLogger(SysProfileController.class);
|
||||
|
||||
private String prefix = "system/user/profile";
|
||||
|
||||
@Autowired
|
||||
private ISysUserService userService;
|
||||
|
||||
@Autowired
|
||||
private SysPasswordService passwordService;
|
||||
|
||||
/**
|
||||
* 个人信息
|
||||
*/
|
||||
@GetMapping()
|
||||
public String profile(ModelMap mmap)
|
||||
{
|
||||
SysUser user = getSysUser();
|
||||
mmap.put("user", user);
|
||||
return prefix + "/profile";
|
||||
}
|
||||
|
||||
@GetMapping("/checkPassword")
|
||||
@ResponseBody
|
||||
public boolean checkPassword(String password)
|
||||
{
|
||||
SysUser user = getSysUser();
|
||||
return passwordService.matches(user, password);
|
||||
}
|
||||
|
||||
@GetMapping("/resetPwd")
|
||||
public String resetPwd(ModelMap mmap)
|
||||
{
|
||||
SysUser user = getSysUser();
|
||||
mmap.put("user", userService.selectUserById(user.getUserId()));
|
||||
return prefix + "/resetPwd";
|
||||
}
|
||||
|
||||
@Log(title = "重置密码", businessType = BusinessType.UPDATE)
|
||||
@PostMapping("/resetPwd")
|
||||
@ResponseBody
|
||||
public AjaxResult resetPwd(String oldPassword, String newPassword)
|
||||
{
|
||||
SysUser user = getSysUser();
|
||||
if (!passwordService.matches(user, oldPassword))
|
||||
{
|
||||
return error("修改密码失败,旧密码错误");
|
||||
}
|
||||
if (passwordService.matches(user, newPassword))
|
||||
{
|
||||
return error("新密码不能与旧密码相同");
|
||||
}
|
||||
user.setSalt(ShiroUtils.randomSalt());
|
||||
user.setPassword(passwordService.encryptPassword(user.getLoginName(), newPassword, user.getSalt()));
|
||||
user.setPwdUpdateDate(DateUtils.getNowDate());
|
||||
if (userService.resetUserPwd(user) > 0)
|
||||
{
|
||||
setSysUser(userService.selectUserById(user.getUserId()));
|
||||
return success();
|
||||
}
|
||||
return error("修改密码异常,请联系管理员");
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改用户
|
||||
*/
|
||||
@GetMapping("/edit")
|
||||
public String edit(ModelMap mmap)
|
||||
{
|
||||
SysUser user = getSysUser();
|
||||
mmap.put("user", userService.selectUserById(user.getUserId()));
|
||||
return prefix + "/edit";
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改头像
|
||||
*/
|
||||
@GetMapping("/avatar")
|
||||
public String avatar(ModelMap mmap)
|
||||
{
|
||||
SysUser user = getSysUser();
|
||||
mmap.put("user", userService.selectUserById(user.getUserId()));
|
||||
return prefix + "/avatar";
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改用户
|
||||
*/
|
||||
@Log(title = "个人信息", businessType = BusinessType.UPDATE)
|
||||
@PostMapping("/update")
|
||||
@ResponseBody
|
||||
public AjaxResult update(SysUser user)
|
||||
{
|
||||
SysUser currentUser = getSysUser();
|
||||
currentUser.setEmail(user.getEmail());
|
||||
if (StringUtils.isNotEmpty(user.getEmail()) && !userService.checkEmailUnique(currentUser))
|
||||
{
|
||||
return error("修改用户'" + currentUser.getLoginName() + "'失败,邮箱账号已存在");
|
||||
}
|
||||
if (userService.updateUserInfo(currentUser) > 0)
|
||||
{
|
||||
setSysUser(userService.selectUserById(currentUser.getUserId()));
|
||||
return success();
|
||||
}
|
||||
return error();
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存头像
|
||||
*/
|
||||
@Log(title = "个人信息", businessType = BusinessType.UPDATE)
|
||||
@PostMapping("/updateAvatar")
|
||||
@ResponseBody
|
||||
public AjaxResult updateAvatar(@RequestParam("avatarfile") MultipartFile file)
|
||||
{
|
||||
SysUser currentUser = getSysUser();
|
||||
try
|
||||
{
|
||||
if (!file.isEmpty())
|
||||
{
|
||||
if (userService.updateUserInfo(currentUser) > 0)
|
||||
{
|
||||
setSysUser(userService.selectUserById(currentUser.getUserId()));
|
||||
return success();
|
||||
}
|
||||
}
|
||||
return error();
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
log.error("修改头像失败!", e);
|
||||
return error(e.getMessage());
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,38 @@
|
||||
package com.ruoyi.web.controller.system;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.ResponseBody;
|
||||
import com.ruoyi.common.core.controller.BaseController;
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.common.core.domain.entity.SysUser;
|
||||
import com.ruoyi.common.utils.StringUtils;
|
||||
import com.ruoyi.framework.shiro.service.SysRegisterService;
|
||||
|
||||
/**
|
||||
* 注册验证
|
||||
*
|
||||
* @author ruoyi
|
||||
*/
|
||||
@Controller
|
||||
public class SysRegisterController extends BaseController
|
||||
{
|
||||
@Autowired
|
||||
private SysRegisterService registerService;
|
||||
|
||||
@GetMapping("/register")
|
||||
public String register()
|
||||
{
|
||||
return "ky/register";
|
||||
}
|
||||
|
||||
@PostMapping("/register")
|
||||
@ResponseBody
|
||||
public AjaxResult ajaxRegister(SysUser user)
|
||||
{
|
||||
String msg = registerService.register(user);
|
||||
return StringUtils.isEmpty(msg) ? success() : error(msg);
|
||||
}
|
||||
}
|
@ -0,0 +1,26 @@
|
||||
package com.ruoyi.web.controller.tool;
|
||||
|
||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import com.ruoyi.common.core.controller.BaseController;
|
||||
|
||||
/**
|
||||
* build 表单构建
|
||||
*
|
||||
* @author ruoyi
|
||||
*/
|
||||
@Controller
|
||||
@RequestMapping("/tool/build")
|
||||
public class BuildController extends BaseController
|
||||
{
|
||||
private String prefix = "tool/build";
|
||||
|
||||
@RequiresPermissions("tool:build:view")
|
||||
@GetMapping()
|
||||
public String build()
|
||||
{
|
||||
return prefix + "/build";
|
||||
}
|
||||
}
|
@ -0,0 +1,24 @@
|
||||
package com.ruoyi.web.controller.tool;
|
||||
|
||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import com.ruoyi.common.core.controller.BaseController;
|
||||
|
||||
/**
|
||||
* swagger 接口
|
||||
*
|
||||
* @author ruoyi
|
||||
*/
|
||||
@Controller
|
||||
@RequestMapping("/tool/swagger")
|
||||
public class SwaggerController extends BaseController
|
||||
{
|
||||
@RequiresPermissions("tool:swagger:view")
|
||||
@GetMapping()
|
||||
public String index()
|
||||
{
|
||||
return redirect("/swagger-ui/index.html");
|
||||
}
|
||||
}
|
@ -0,0 +1,183 @@
|
||||
package com.ruoyi.web.controller.tool;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.PutMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import com.ruoyi.common.core.controller.BaseController;
|
||||
import com.ruoyi.common.core.domain.R;
|
||||
import com.ruoyi.common.utils.StringUtils;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiImplicitParam;
|
||||
import io.swagger.annotations.ApiImplicitParams;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
|
||||
/**
|
||||
* swagger 用户测试方法
|
||||
*
|
||||
* @author ruoyi
|
||||
*/
|
||||
@Api("用户信息管理")
|
||||
@RestController
|
||||
@RequestMapping("/test/user")
|
||||
public class TestController extends BaseController
|
||||
{
|
||||
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"));
|
||||
}
|
||||
|
||||
@ApiOperation("获取用户列表")
|
||||
@GetMapping("/list")
|
||||
public R<List<UserEntity>> userList()
|
||||
{
|
||||
List<UserEntity> userList = new ArrayList<UserEntity>(users.values());
|
||||
return R.ok(userList);
|
||||
}
|
||||
|
||||
@ApiOperation("获取用户详细")
|
||||
@ApiImplicitParam(name = "userId", value = "用户ID", required = true, dataType = "int", paramType = "path", dataTypeClass = Integer.class)
|
||||
@GetMapping("/{userId}")
|
||||
public R<UserEntity> getUser(@PathVariable Integer userId)
|
||||
{
|
||||
if (!users.isEmpty() && users.containsKey(userId))
|
||||
{
|
||||
return R.ok(users.get(userId));
|
||||
}
|
||||
else
|
||||
{
|
||||
return R.fail("用户不存在");
|
||||
}
|
||||
}
|
||||
|
||||
@ApiOperation("新增用户")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "userId", value = "用户id", dataType = "Integer", dataTypeClass = Integer.class),
|
||||
@ApiImplicitParam(name = "username", value = "用户名称", dataType = "String", dataTypeClass = String.class),
|
||||
@ApiImplicitParam(name = "password", value = "用户密码", dataType = "String", dataTypeClass = String.class),
|
||||
@ApiImplicitParam(name = "mobile", value = "用户手机", dataType = "String", dataTypeClass = String.class)
|
||||
})
|
||||
@PostMapping("/save")
|
||||
public R<String> save(UserEntity user)
|
||||
{
|
||||
if (StringUtils.isNull(user) || StringUtils.isNull(user.getUserId()))
|
||||
{
|
||||
return R.fail("用户ID不能为空");
|
||||
}
|
||||
users.put(user.getUserId(), user);
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
@ApiOperation("更新用户")
|
||||
@PutMapping("/update")
|
||||
public R<String> update(@RequestBody UserEntity user)
|
||||
{
|
||||
if (StringUtils.isNull(user) || StringUtils.isNull(user.getUserId()))
|
||||
{
|
||||
return R.fail("用户ID不能为空");
|
||||
}
|
||||
if (users.isEmpty() || !users.containsKey(user.getUserId()))
|
||||
{
|
||||
return R.fail("用户不存在");
|
||||
}
|
||||
users.remove(user.getUserId());
|
||||
users.put(user.getUserId(), user);
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
@ApiOperation("删除用户信息")
|
||||
@ApiImplicitParam(name = "userId", value = "用户ID", required = true, dataType = "int", paramType = "path", dataTypeClass = Integer.class)
|
||||
@DeleteMapping("/{userId}")
|
||||
public R<String> delete(@PathVariable Integer userId)
|
||||
{
|
||||
if (!users.isEmpty() && users.containsKey(userId))
|
||||
{
|
||||
users.remove(userId);
|
||||
return R.ok();
|
||||
}
|
||||
else
|
||||
{
|
||||
return R.fail("用户不存在");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ApiModel(value = "UserEntity", description = "用户实体")
|
||||
class UserEntity
|
||||
{
|
||||
@ApiModelProperty("用户ID")
|
||||
private Integer userId;
|
||||
|
||||
@ApiModelProperty("用户名称")
|
||||
private String username;
|
||||
|
||||
@ApiModelProperty("用户密码")
|
||||
private String password;
|
||||
|
||||
@ApiModelProperty("用户手机")
|
||||
private String mobile;
|
||||
|
||||
public UserEntity()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public UserEntity(Integer userId, String username, String password, String mobile)
|
||||
{
|
||||
this.userId = userId;
|
||||
this.username = username;
|
||||
this.password = password;
|
||||
this.mobile = mobile;
|
||||
}
|
||||
|
||||
public Integer getUserId()
|
||||
{
|
||||
return userId;
|
||||
}
|
||||
|
||||
public void setUserId(Integer userId)
|
||||
{
|
||||
this.userId = userId;
|
||||
}
|
||||
|
||||
public String getUsername()
|
||||
{
|
||||
return username;
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
||||
}
|
@ -0,0 +1,61 @@
|
||||
# 数据源配置
|
||||
spring:
|
||||
datasource:
|
||||
type: com.alibaba.druid.pool.DruidDataSource
|
||||
driverClassName: com.mysql.cj.jdbc.Driver
|
||||
druid:
|
||||
# 主库数据源
|
||||
master:
|
||||
url: jdbc:mysql://rm-m5e3u8r97i93wh3r5lo.mysql.rds.aliyuncs.com:3306/cwbs?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
|
||||
username: root
|
||||
password: Yyy990602
|
||||
# 从库数据源
|
||||
slave:
|
||||
# 从数据源开关/默认关闭
|
||||
enabled: false
|
||||
url:
|
||||
username:
|
||||
password:
|
||||
# 初始连接数
|
||||
initialSize: 5
|
||||
# 最小连接池数量
|
||||
minIdle: 10
|
||||
# 最大连接池数量
|
||||
maxActive: 20
|
||||
# 配置获取连接等待超时的时间
|
||||
maxWait: 60000
|
||||
# 配置连接超时时间
|
||||
connectTimeout: 30000
|
||||
# 配置网络超时时间
|
||||
socketTimeout: 60000
|
||||
# 配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位是毫秒
|
||||
timeBetweenEvictionRunsMillis: 60000
|
||||
# 配置一个连接在池中最小生存的时间,单位是毫秒
|
||||
minEvictableIdleTimeMillis: 300000
|
||||
# 配置一个连接在池中最大生存的时间,单位是毫秒
|
||||
maxEvictableIdleTimeMillis: 900000
|
||||
# 配置检测连接是否有效
|
||||
validationQuery: SELECT 1 FROM DUAL
|
||||
testWhileIdle: true
|
||||
testOnBorrow: false
|
||||
testOnReturn: false
|
||||
webStatFilter:
|
||||
enabled: true
|
||||
statViewServlet:
|
||||
enabled: true
|
||||
# 设置白名单,不填则允许所有访问
|
||||
allow:
|
||||
url-pattern: /druid/*
|
||||
# 控制台管理用户名和密码
|
||||
login-username: ruoyi
|
||||
login-password: 123456
|
||||
filter:
|
||||
stat:
|
||||
enabled: true
|
||||
# 慢SQL记录
|
||||
log-slow-sql: true
|
||||
slow-sql-millis: 1000
|
||||
merge-sql: true
|
||||
wall:
|
||||
config:
|
||||
multi-statement-allow: true
|