Author SHA1 Message Date
dependabot[bot] bec9f5591e Bump mysql-connector-java from 8.0.11 to 8.0.16 in /ruoyi-api
Bumps [mysql-connector-java](https://github.com/mysql/mysql-connector-j) from 8.0.11 to 8.0.16.
- [Release notes](https://github.com/mysql/mysql-connector-j/releases)
- [Changelog](https://github.com/mysql/mysql-connector-j/blob/release/8.0/CHANGES)
- [Commits](https://github.com/mysql/mysql-connector-j/compare/8.0.11...8.0.16)

Signed-off-by: dependabot[bot] <support@github.com>
2020-07-02 00:56:19 +00:00
guchengwuyue 37c39d7b6a Update README.md 2020-06-13 17:36:57 +08:00
guchengwuyue 02ba3af532 Update README.md 2020-06-08 19:49:02 +08:00
guchengwuyue 34b84a053d Update README.md 2020-05-05 14:26:37 +08:00
guchengwuyue b1de865f6a Update README.md 2020-05-04 19:48:38 +08:00
guchengwuyue e345600d9e Update README.md 2020-05-04 19:47:12 +08:00
guchengwuyue 10630d5bfe Update README.md 2020-04-13 17:53:17 +08:00
guchengwuyue 274ad36c70 Update README.md 2020-04-13 17:50:00 +08:00
guchengwuyue ed28897508 Update README.md 2020-04-13 15:49:51 +08:00
guchengwuyue 9381f27d65 Update README.md 2019-12-15 11:35:19 +08:00
guchengwuyue 60086d17a7 Update README.md 2019-11-16 06:37:06 +08:00
guchengwuyue 40f968fbda Update README.md 2019-11-11 19:13:10 +08:00
guchengwuyue 4be0b0ac89 Update README.md 2019-11-07 22:06:58 +08:00
1028 changed files with 27119 additions and 41450 deletions

No files matched your search

-9
View File
@@ -10,15 +10,6 @@ target/
######################################################################
# IDE
*.classpath
*.project
*.iml
*.factorypath
target
.idea/
*.log
logs
### STS ###
.apt_generated
+85 -23
View File
@@ -1,42 +1,105 @@
### **供货商城升级版yshop会员电商系统:**
## yshop会员商城系统介绍
yshop会员商城系统功能:在线买单、在线充值、消费记录、会员中心、多规格sku商品管理、
分销、收藏、地址、分类、评价、积分、运费模板、、优惠券、订单管理、
买单管理、物流、短信、微信菜单、微信回复、微信图文、模板消息等等
### 技术栈
mybatisPlus、redis、lombok、mapstruct、jwt、WxJava、Druid、OSS、Vue、Vue-router、Vuex等
* 核心框架:SpringBoot2 + mybatis + jwt
* 消息中间件:Redis
* 前端手脚架:Avue-cli
* 前端框架:Vue2 + vant + Vue-router + Vuex + jquery + thymeleaf
* 持久层框架:MyBatis-plus
* 微信开发Java SDK:WxJava
* 文件管理:阿里oss、七牛云、腾讯cos、本地
* JDK版本:Java8+
* 数据库:mysql5.7
**模块划分:**
```
- yixiang-base 基础模块
- config 配置等
- coupon 优惠券
- handler mybatis handler
- mall
- order 订单
- oss 云存储
- redis 常用配置与订单过期,自动收货监听等
- system
- weixin
- yixiang-common common通用工具
- yixiang-framework 核心
- yixiang-mall 商城
- yixiang-generator 代码生成模块 支持mybatisplus
- yixiang-quartr 定时任务
- yixiang-admin 管理后台
- yixiang-app api模块 jwt+自定义注解验证
- yixiang-weixin 微信模块
```
**`功能特色** ‘
1、spu,多规格sku商品管理
<table>
<tr>
<td><img src="https://images.gitee.com/uploads/images/2020/0504/192604_7db25918_477893.png"/></td>
<td><img src="https://images.gitee.com/uploads/images/2020/0504/192638_a4adcc1b_477893.png"/></td
</tr>
</table>
2、多级商品分类管理、商品评价管理、订单管理、实时物流、运费模板、用户购物车、用户收藏、优惠券、积分、OSS(七牛、腾讯、阿里)、素材管理等
<table>
<tr>
<td><img src="https://images.gitee.com/uploads/images/2020/0504/192708_127ceda5_477893.png"/></td>
<td><img src="https://images.gitee.com/uploads/images/2020/0504/192733_5402d25d_477893.png"/></td>
</tr>
</table>
### supplier2.0已经发布:
1、移除Light Security jwt 验证更改为shaun pac4j-jwt
2、mapstruct更新1.3.1 同时修复不能编译成对象的问题
3、新的目录结构
4、同步ruoyi最新版本V4.6.1
5、喜欢的小伙伴记得star下
6、本项目全开源 请自行下载的哦
### supplier2.1即将发布:
- 新的重构版本正在开发中,喜欢的小伙伴记得star下
- 新版本移动端将使用uniapp
### **商城概况:**
-
-
-
-
### **下面是供货老版本商城概况:**
本商城系统是一套完整的商城系统,包括小程序+小程序API+后台商城管理!!
**系统基础组合来源:**
程序员就要坚持着不要重复造轮子想法,所有就在gitee里找自己合适的轮子::
程序员就要坚持着不要重复造轮子想法,所有就在码云里找自己合适的轮子::
1、若依管理后台:用它做后台管理
2、shaun pac4j-jwt:强大jwt权限框架
2、Light Security:用它主要来对接小程序API
当然他们本身已经完成了很多功能,这里不多说,大家可以直接去码云搜索即可,后面会放上他们连接。
本系统主要包括三部分:
第一:商城后台,完成完整的商城管理系统,目前已经完成,至于有bug大家可以直接issue或者进群交流(后面会打出来的(⊙o⊙)?!!),
第一:商城后台,完成完整的商城管理系统,目前基本已经完成,至于有bug大家可以直接issue或者进群交流(后面会打出来的(⊙o⊙)?!!),
功能大概包括:商品管理,商品多规格属性管理,商品分类,商品品牌,商品订单,会员信息等等。
涉及到技术: **springboot+Thymeleaf+mybatis**
@@ -84,8 +147,7 @@
mpvue 小程序运行步骤:
1、安装node环境
node 是8版本,这边开发版本是8.12.0,由于mpvue属于老牌小程序框架了,目前这边验证的只是这个node版本,
当然新的小程序UNIAPP发布之后没用此限制拉
node 是8版本
2、设置npm淘宝镜像
@@ -128,6 +190,6 @@ npm set registry https://registry.npm.taobao.org/
若依系统:[ruoyi](https://gitee.com/y_project/RuoYi)
强大jwt权限框架:[shaun](https://gitee.com/baomidou/shaun)
简单jwt权限:[Light Security](https://gitee.com/itmuch/light-security)
Binary file not shown.
+273 -290
View File
@@ -1,291 +1,274 @@
<?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>co.yixiang</groupId>
<artifactId>supplier</artifactId>
<version>2.0.0</version>
<name>supplier</name>
<url>https://www.yixiang.co</url>
<description>供货管理系统</description>
<properties>
<supplier.version>2.0.0</supplier.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.7.1</shiro.version>
<thymeleaf.extras.shiro.version>2.0.0</thymeleaf.extras.shiro.version>
<druid.version>1.2.6</druid.version>
<bitwalker.version>1.21</bitwalker.version>
<kaptcha.version>2.3.2</kaptcha.version>
<swagger.version>2.9.2</swagger.version>
<mybatis-spring-boot.version>2.1.4</mybatis-spring-boot.version>
<pagehelper.boot.version>1.3.0</pagehelper.boot.version>
<fastjson.version>1.2.76</fastjson.version>
<oshi.version>5.6.0</oshi.version>
<jna.version>5.7.0</jna.version>
<commons.io.version>2.5</commons.io.version>
<commons.fileupload.version>1.3.3</commons.fileupload.version>
<poi.version>4.1.2</poi.version>
<velocity.version>1.7</velocity.version>
</properties>
<!-- 依赖声明 -->
<dependencyManagement>
<dependencies>
<!-- SpringBoot的依赖配置-->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-dependencies</artifactId>
<version>2.2.13.RELEASE</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>com.github.penggle</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>
<!-- SpringBoot集成mybatis框架 -->
<dependency>
<groupId>org.mybatis.spring.boot</groupId>
<artifactId>mybatis-spring-boot-starter</artifactId>
<version>${mybatis-spring-boot.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>
<dependency>
<groupId>net.java.dev.jna</groupId>
<artifactId>jna</artifactId>
<version>${jna.version}</version>
</dependency>
<dependency>
<groupId>net.java.dev.jna</groupId>
<artifactId>jna-platform</artifactId>
<version>${jna.version}</version>
</dependency>
<!-- swagger2-->
<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-swagger2</artifactId>
<version>${swagger.version}</version>
<exclusions>
<exclusion>
<groupId>io.swagger</groupId>
<artifactId>swagger-annotations</artifactId>
</exclusion>
<exclusion>
<groupId>io.swagger</groupId>
<artifactId>swagger-models</artifactId>
</exclusion>
</exclusions>
</dependency>
<!-- swagger2-UI-->
<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-swagger-ui</artifactId>
<version>${swagger.version}</version>
</dependency>
<!--io常用工具类 -->
<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
<version>${commons.io.version}</version>
</dependency>
<!--文件上传工具类 -->
<dependency>
<groupId>commons-fileupload</groupId>
<artifactId>commons-fileupload</artifactId>
<version>${commons.fileupload.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</artifactId>
<version>${velocity.version}</version>
<exclusions>
<exclusion>
<groupId>commons-collections</groupId>
<artifactId>commons-collections</artifactId>
</exclusion>
</exclusions>
</dependency>
<!-- 阿里JSON解析器 -->
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>fastjson</artifactId>
<version>${fastjson.version}</version>
</dependency>
<!-- 定时任务-->
<dependency>
<groupId>co.yixiang</groupId>
<artifactId>supplier-quartz</artifactId>
<version>${supplier.version}</version>
</dependency>
<!-- 代码生成-->
<dependency>
<groupId>co.yixiang</groupId>
<artifactId>supplier-generator</artifactId>
<version>${supplier.version}</version>
</dependency>
<!-- 核心模块-->
<dependency>
<groupId>co.yixiang</groupId>
<artifactId>supplier-framework</artifactId>
<version>${supplier.version}</version>
</dependency>
<!-- 系统模块-->
<dependency>
<groupId>co.yixiang</groupId>
<artifactId>supplier-system</artifactId>
<version>${supplier.version}</version>
</dependency>
<!-- 通用工具-->
<dependency>
<groupId>co.yixiang</groupId>
<artifactId>supplier-common</artifactId>
<version>${supplier.version}</version>
</dependency>
</dependencies>
</dependencyManagement>
<modules>
<module>supplier-admin</module>
<module>supplier-framework</module>
<module>supplier-system</module>
<module>supplier-quartz</module>
<module>supplier-generator</module>
<module>supplier-common</module>
<module>supplier-api</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>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>
<?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.0.0</version>
<name>ruoyi</name>
<url>http://www.ruoyi.vip</url>
<description>若依管理系统</description>
<properties>
<ruoyi.version>4.0.0</ruoyi.version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<java.version>1.8</java.version>
<shiro.version>1.4.0</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.14</druid.version>
<bitwalker.version>1.19</bitwalker.version>
<kaptcha.version>2.3.2</kaptcha.version>
<swagger.version>2.9.2</swagger.version>
<pagehelper.boot.version>1.2.5</pagehelper.boot.version>
<fastjson.version>1.2.47</fastjson.version>
<oshi.version>3.9.1</oshi.version>
<commons.io.version>2.5</commons.io.version>
<commons.fileupload.version>1.3.3</commons.fileupload.version>
<jsoup.version>1.11.3</jsoup.version>
<poi.version>3.17</poi.version>
<velocity.version>1.7</velocity.version>
</properties>
<!-- 依赖声明 -->
<dependencyManagement>
<dependencies>
<!-- SpringBoot的依赖配置-->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-dependencies</artifactId>
<version>2.1.1.RELEASE</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>com.github.penggle</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使用Srping框架 -->
<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>
<!-- swagger2-->
<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-swagger2</artifactId>
<version>${swagger.version}</version>
<exclusions>
<exclusion>
<groupId>io.swagger</groupId>
<artifactId>swagger-annotations</artifactId>
</exclusion>
<exclusion>
<groupId>io.swagger</groupId>
<artifactId>swagger-models</artifactId>
</exclusion>
</exclusions>
</dependency>
<!-- swagger2-UI-->
<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-swagger-ui</artifactId>
<version>${swagger.version}</version>
</dependency>
<!--io常用工具类 -->
<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
<version>${commons.io.version}</version>
</dependency>
<!--文件上传工具类 -->
<dependency>
<groupId>commons-fileupload</groupId>
<artifactId>commons-fileupload</artifactId>
<version>${commons.fileupload.version}</version>
</dependency>
<!-- HTML解析器 -->
<dependency>
<groupId>org.jsoup</groupId>
<artifactId>jsoup</artifactId>
<version>${jsoup.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</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-quartz</artifactId>
<version>${ruoyi.version}</version>
</dependency>
<!-- 代码生成-->
<dependency>
<groupId>com.ruoyi</groupId>
<artifactId>ruoyi-generator</artifactId>
<version>${ruoyi.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-quartz</module>
<module>ruoyi-generator</module>
<module>ruoyi-common</module>
<module>ruoyi-api</module>
</modules>
<packaging>pom</packaging>
<dependencies>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<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>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>
+107
View File
@@ -0,0 +1,107 @@
<?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">
<parent>
<artifactId>ruoyi</artifactId>
<groupId>com.ruoyi</groupId>
<version>4.0.0</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<packaging>jar</packaging>
<artifactId>ruoyi-admin</artifactId>
<description>
web服务入口
</description>
<dependencies>
<!-- SpringBoot集成thymeleaf模板 -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-thymeleaf</artifactId>
</dependency>
<!-- spring-boot-devtools -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-devtools</artifactId>
<optional>true</optional> <!-- 表示依赖不会传递 -->
</dependency>
<!-- swagger2-->
<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-swagger2</artifactId>
</dependency>
<!--防止进入swagger页面报类型转换错误,排除2.9.2中的引用,手动增加1.5.21版本-->
<dependency>
<groupId>io.swagger</groupId>
<artifactId>swagger-annotations</artifactId>
<version>1.5.21</version>
</dependency>
<dependency>
<groupId>io.swagger</groupId>
<artifactId>swagger-models</artifactId>
<version>1.5.21</version>
</dependency>
<!-- swagger2-UI-->
<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-swagger-ui</artifactId>
</dependency>
<!-- 核心模块-->
<dependency>
<groupId>com.ruoyi</groupId>
<artifactId>ruoyi-framework</artifactId>
</dependency>
<!-- 定时任务-->
<dependency>
<groupId>com.ruoyi</groupId>
<artifactId>ruoyi-quartz</artifactId>
</dependency>
<!-- 代码生成-->
<dependency>
<groupId>com.ruoyi</groupId>
<artifactId>ruoyi-generator</artifactId>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<configuration>
<fork>true</fork> <!-- 如果没有该配置,devtools不会生效 -->
</configuration>
<executions>
<execution>
<goals>
<goal>repackage</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<version>3.0.0</version>
<configuration>
<failOnMissingWebXml>false</failOnMissingWebXml>
<warName>${artifactId}</warName>
</configuration>
</plugin>
</plugins>
<finalName>${artifactId}</finalName>
</build>
</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" +
" ''-' `'-' `-..-' ");
}
}
@@ -1,4 +1,4 @@
package co.yixiang;
package com.ruoyi;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.boot.web.servlet.support.SpringBootServletInitializer;
@@ -8,11 +8,11 @@ import org.springframework.boot.web.servlet.support.SpringBootServletInitializer
*
* @author ruoyi
*/
public class AdminServletInitializer extends SpringBootServletInitializer
public class RuoYiServletInitializer extends SpringBootServletInitializer
{
@Override
protected SpringApplicationBuilder configure(SpringApplicationBuilder application)
{
return application.sources(AdminApplication.class);
return application.sources(RuoYiApplication.class);
}
}
@@ -1,23 +1,21 @@
package co.yixiang.web.controller.common;
package com.ruoyi.web.controller.common;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.MediaType;
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 co.yixiang.common.config.RuoYiConfig;
import co.yixiang.common.config.ServerConfig;
import co.yixiang.common.constant.Constants;
import co.yixiang.common.core.domain.AjaxResult;
import co.yixiang.common.utils.StringUtils;
import co.yixiang.common.utils.file.FileUploadUtils;
import co.yixiang.common.utils.file.FileUtils;
import com.ruoyi.common.config.Global;
import com.ruoyi.common.config.ServerConfig;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.common.utils.file.FileUploadUtils;
import com.ruoyi.common.utils.file.FileUtils;
/**
* 通用请求处理
@@ -43,15 +41,17 @@ public class CommonController
{
try
{
if (!FileUtils.checkAllowDownload(fileName))
if (!FileUtils.isValidFilename(fileName))
{
throw new Exception(StringUtils.format("文件名称({})非法,不允许下载。 ", fileName));
}
String realFileName = System.currentTimeMillis() + fileName.substring(fileName.indexOf("_") + 1);
String filePath = RuoYiConfig.getDownloadPath() + fileName;
String filePath = Global.getDownloadPath() + fileName;
response.setContentType(MediaType.APPLICATION_OCTET_STREAM_VALUE);
FileUtils.setAttachmentResponseHeader(response, realFileName);
response.setCharacterEncoding("utf-8");
response.setContentType("multipart/form-data");
response.setHeader("Content-Disposition",
"attachment;fileName=" + FileUtils.setFileDownloadHeader(request, realFileName));
FileUtils.writeBytes(filePath, response.getOutputStream());
if (delete)
{
@@ -74,7 +74,7 @@ public class CommonController
try
{
// 上传文件路径
String filePath = RuoYiConfig.getUploadPath();
String filePath = Global.getUploadPath();
// 上传并返回新文件名称
String fileName = FileUploadUtils.upload(filePath, file);
String url = serverConfig.getUrl() + fileName;
@@ -88,33 +88,4 @@ public class CommonController
return AjaxResult.error(e.getMessage());
}
}
/**
* 本地资源通用下载
*/
@GetMapping("/common/download/resource")
public void resourceDownload(String resource, HttpServletRequest request, HttpServletResponse response)
throws Exception
{
try
{
if (!FileUtils.checkAllowDownload(resource))
{
throw new Exception(StringUtils.format("资源文件({})非法,不允许下载。 ", resource));
}
// 本地资源路径
String localPath = RuoYiConfig.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());
}
catch (Exception e)
{
log.error("下载文件失败", e);
}
}
}
@@ -1,4 +1,4 @@
package co.yixiang.web.controller.demo.controller;
package com.ruoyi.web.controller.demo.controller;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
@@ -0,0 +1,261 @@
package com.ruoyi.web.controller.demo.controller;
import java.util.ArrayList;
import java.util.List;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import com.ruoyi.common.core.domain.AjaxResult;
/**
* 表单相关
*
* @author ruoyi
*/
@Controller
@RequestMapping("/demo/form")
public class DemoFormController
{
private String prefix = "demo/form";
private final static List<UserFormModel> users = new ArrayList<UserFormModel>();
{
users.add(new UserFormModel(1, "1000001", "测试1", "15888888888"));
users.add(new UserFormModel(2, "1000002", "测试2", "15666666666"));
users.add(new UserFormModel(3, "1000003", "测试3", "15666666666"));
users.add(new UserFormModel(4, "1000004", "测试4", "15666666666"));
users.add(new UserFormModel(5, "1000005", "测试5", "15666666666"));
}
/**
* 按钮页
*/
@GetMapping("/button")
public String button()
{
return prefix + "/button";
}
/**
* 下拉框
*/
@GetMapping("/select")
public String select()
{
return prefix + "/select";
}
/**
* 表单校验
*/
@GetMapping("/validate")
public String validate()
{
return prefix + "/validate";
}
/**
* 功能扩展(包含文件上传)
*/
@GetMapping("/jasny")
public String jasny()
{
return prefix + "/jasny";
}
/**
* 拖动排序
*/
@GetMapping("/sortable")
public String sortable()
{
return prefix + "/sortable";
}
/**
* 选项卡 & 面板
*/
@GetMapping("/tabs_panels")
public String tabs_panels()
{
return prefix + "/tabs_panels";
}
/**
* 栅格
*/
@GetMapping("/grid")
public String grid()
{
return prefix + "/grid";
}
/**
* 表单向导
*/
@GetMapping("/wizard")
public String wizard()
{
return prefix + "/wizard";
}
/**
* 文件上传
*/
@GetMapping("/upload")
public String upload()
{
return prefix + "/upload";
}
/**
* 日期和时间页
*/
@GetMapping("/datetime")
public String datetime()
{
return prefix + "/datetime";
}
/**
* 左右互选组件
*/
@GetMapping("/duallistbox")
public String duallistbox()
{
return prefix + "/duallistbox";
}
/**
* 基本表单
*/
@GetMapping("/basic")
public String basic()
{
return prefix + "/basic";
}
/**
* 卡片列表
*/
@GetMapping("/cards")
public String cards()
{
return prefix + "/cards";
}
/**
* summernote 富文本编辑器
*/
@GetMapping("/summernote")
public String summernote()
{
return prefix + "/summernote";
}
/**
* 搜索自动补全
*/
@GetMapping("/autocomplete")
public String autocomplete()
{
return prefix + "/autocomplete";
}
/**
* 获取用户数据
*/
@GetMapping("/userModel")
@ResponseBody
public AjaxResult userModel()
{
AjaxResult ajax = new AjaxResult();
ajax.put("code", 200);
ajax.put("value", users);
return ajax;
}
/**
* 获取数据集合
*/
@GetMapping("/collection")
@ResponseBody
public AjaxResult collection()
{
String[] array = { "ruoyi 1", "ruoyi 2", "ruoyi 3", "ruoyi 4", "ruoyi 5" };
AjaxResult ajax = new AjaxResult();
ajax.put("value", array);
return ajax;
}
}
class UserFormModel
{
/** 用户ID */
private int userId;
/** 用户编号 */
private String userCode;
/** 用户姓名 */
private String userName;
/** 用户手机 */
private String userPhone;
public UserFormModel()
{
}
public UserFormModel(int userId, String userCode, String userName, String userPhone)
{
this.userId = userId;
this.userCode = userCode;
this.userName = userName;
this.userPhone = userPhone;
}
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 getUserPhone()
{
return userPhone;
}
public void setUserPhone(String userPhone)
{
this.userPhone = userPhone;
}
}
@@ -1,4 +1,4 @@
package co.yixiang.web.controller.demo.controller;
package com.ruoyi.web.controller.demo.controller;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
@@ -1,12 +1,9 @@
package co.yixiang.web.controller.demo.controller;
package com.ruoyi.web.controller.demo.controller;
import java.util.ArrayList;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import co.yixiang.web.controller.demo.domain.CustomerModel;
import co.yixiang.web.controller.demo.domain.UserOperateModel;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.GetMapping;
@@ -15,17 +12,16 @@ import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.multipart.MultipartFile;
import co.yixiang.common.core.controller.BaseController;
import co.yixiang.common.core.domain.AjaxResult;
import co.yixiang.common.core.page.PageDomain;
import co.yixiang.common.core.page.TableDataInfo;
import co.yixiang.common.core.page.TableSupport;
import co.yixiang.common.core.text.Convert;
import co.yixiang.common.exception.BusinessException;
import co.yixiang.common.utils.StringUtils;
import co.yixiang.common.utils.poi.ExcelUtil;
import co.yixiang.web.controller.demo.domain.CustomerModel;
import co.yixiang.web.controller.demo.domain.UserOperateModel;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.page.PageDomain;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.common.core.page.TableSupport;
import com.ruoyi.common.core.text.Convert;
import com.ruoyi.common.exception.BusinessException;
import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.web.controller.demo.domain.UserOperateModel;
/**
* 操作控制
@@ -107,17 +103,6 @@ public class DemoOperateController extends BaseController
}
}
}
else if (StringUtils.isNotEmpty(userModel.getUserName()))
{
userList.clear();
for (Map.Entry<Integer, UserOperateModel> entry : users.entrySet())
{
if (entry.getValue().getUserName().equals(userModel.getUserName()))
{
userList.add(entry.getValue());
}
}
}
PageDomain pageDomain = TableSupport.buildPageRequest();
if (null == pageDomain.getPageNum() || null == pageDomain.getPageSize())
{
@@ -157,17 +142,6 @@ public class DemoOperateController extends BaseController
return AjaxResult.success(users.put(userId, user));
}
/**
* 新增保存主子表信息
*/
@PostMapping("/customer/add")
@ResponseBody
public AjaxResult addSave(CustomerModel customerModel)
{
System.out.println(customerModel.toString());
return AjaxResult.success();
}
/**
* 修改用户
*/
@@ -1,4 +1,4 @@
package co.yixiang.web.controller.demo.controller;
package com.ruoyi.web.controller.demo.controller;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
@@ -1,4 +1,4 @@
package co.yixiang.web.controller.demo.controller;
package com.ruoyi.web.controller.demo.controller;
import java.util.ArrayList;
import java.util.Arrays;
@@ -6,23 +6,17 @@ import java.util.Collections;
import java.util.Date;
import java.util.List;
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.fasterxml.jackson.annotation.JsonFormat;
import co.yixiang.common.annotation.Excel;
import co.yixiang.common.annotation.Excel.ColumnType;
import co.yixiang.common.core.controller.BaseController;
import co.yixiang.common.core.domain.AjaxResult;
import co.yixiang.common.core.page.PageDomain;
import co.yixiang.common.core.page.TableDataInfo;
import co.yixiang.common.core.page.TableSupport;
import co.yixiang.common.core.text.Convert;
import co.yixiang.common.utils.DateUtils;
import co.yixiang.common.utils.StringUtils;
import co.yixiang.common.utils.poi.ExcelUtil;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.page.PageDomain;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.common.core.page.TableSupport;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.common.utils.StringUtils;
/**
* 表格相关
@@ -65,16 +59,6 @@ public class DemoTableController extends BaseController
users.add(new UserTableModel(26, "1000026", "测试26", "1", "15666666666", "ry@qq.com", 250.0, "1"));
}
private final static List<UserTableColumn> columns = new ArrayList<UserTableColumn>();
{
columns.add(new UserTableColumn("用户ID", "userId"));
columns.add(new UserTableColumn("用户编号", "userCode"));
columns.add(new UserTableColumn("用户姓名", "userName"));
columns.add(new UserTableColumn("用户手机", "userPhone"));
columns.add(new UserTableColumn("用户邮箱", "userEmail"));
columns.add(new UserTableColumn("用户状态", "status"));
}
/**
* 搜索相关
*/
@@ -111,44 +95,6 @@ public class DemoTableController extends BaseController
return prefix + "/export";
}
/**
* 表格导出选择列
*/
@GetMapping("/exportSelected")
public String exportSelected()
{
return prefix + "/exportSelected";
}
/**
* 导出数据
*/
@PostMapping("/exportData")
@ResponseBody
public AjaxResult exportSelected(UserTableModel userModel, String userIds)
{
List<UserTableModel> userList = new ArrayList<UserTableModel>(Arrays.asList(new UserTableModel[users.size()]));
Collections.copy(userList, users);
// 条件过滤
if (StringUtils.isNotEmpty(userIds))
{
userList.clear();
for (Long userId : Convert.toLongArray(userIds))
{
for (UserTableModel user : users)
{
if (user.getUserId() == userId)
{
userList.add(user);
}
}
}
}
ExcelUtil<UserTableModel> util = new ExcelUtil<UserTableModel>(UserTableModel.class);
return util.exportExcel(userList, "用户数据");
}
/**
* 翻页记住选择
*/
@@ -194,16 +140,6 @@ public class DemoTableController extends BaseController
return prefix + "/button";
}
/**
* 直接加载表格数据
*/
@GetMapping("/data")
public String data(ModelMap mmap)
{
mmap.put("users", users);
return prefix + "/data";
}
/**
* 表格冻结列
*/
@@ -231,15 +167,6 @@ public class DemoTableController extends BaseController
return prefix + "/detail";
}
/**
* 表格父子视图
*/
@GetMapping("/child")
public String child()
{
return prefix + "/child";
}
/**
* 表格图片预览
*/
@@ -259,84 +186,12 @@ public class DemoTableController extends BaseController
}
/**
* 表格行拖拽操作
* 表格拖拽操作
*/
@GetMapping("/reorderRows")
public String reorderRows()
@GetMapping("/reorder")
public String reorder()
{
return prefix + "/reorderRows";
}
/**
* 表格列拖拽操作
*/
@GetMapping("/reorderColumns")
public String reorderColumns()
{
return prefix + "/reorderColumns";
}
/**
* 表格列宽拖动
*/
@GetMapping("/resizable")
public String resizable()
{
return prefix + "/resizable";
}
/**
* 表格行内编辑操作
*/
@GetMapping("/editable")
public String editable()
{
return prefix + "/editable";
}
/**
* 主子表提交
*/
@GetMapping("/subdata")
public String subdata()
{
return prefix + "/subdata";
}
/**
* 表格自动刷新
*/
@GetMapping("/refresh")
public String refresh()
{
return prefix + "/refresh";
}
/**
* 表格打印配置
*/
@GetMapping("/print")
public String print()
{
return prefix + "/print";
}
/**
* 表格标题格式化
*/
@GetMapping("/headerStyle")
public String headerStyle()
{
return prefix + "/headerStyle";
}
/**
* 表格动态列
*/
@GetMapping("/dynamicColumns")
public String dynamicColumns()
{
return prefix + "/dynamicColumns";
return prefix + "/reorder";
}
/**
@@ -348,22 +203,6 @@ public class DemoTableController extends BaseController
return prefix + "/other";
}
/**
* 动态获取列
*/
@PostMapping("/ajaxColumns")
@ResponseBody
public AjaxResult ajaxColumns(UserTableColumn userColumn)
{
List<UserTableColumn> columnList = new ArrayList<UserTableColumn>(Arrays.asList(new UserTableColumn[columns.size()]));
Collections.copy(columnList, columns);
if (userColumn != null && "userBalance".equals(userColumn.getField()))
{
columnList.add(new UserTableColumn("用户余额", "userBalance"));
}
return AjaxResult.success(columnList);
}
/**
* 查询数据
*/
@@ -405,71 +244,27 @@ public class DemoTableController extends BaseController
}
}
class UserTableColumn
{
/** 表头 */
private String title;
/** 字段 */
private String field;
public UserTableColumn()
{
}
public UserTableColumn(String title, String field)
{
this.title = title;
this.field = field;
}
public String getTitle()
{
return title;
}
public void setTitle(String title)
{
this.title = title;
}
public String getField()
{
return field;
}
public void setField(String field)
{
this.field = field;
}
}
class UserTableModel
{
/** 用户ID */
private int userId;
/** 用户编号 */
@Excel(name = "用户编号", cellType = ColumnType.NUMERIC)
private String userCode;
/** 用户姓名 */
@Excel(name = "用户姓名")
private String userName;
/** 用户性别 */
private String userSex;
/** 用户手机 */
@Excel(name = "用户手机")
private String userPhone;
/** 用户邮箱 */
@Excel(name = "用户邮箱")
private String userEmail;
/** 用户余额 */
@Excel(name = "用户余额", cellType = ColumnType.NUMERIC)
private double userBalance;
/** 用户状态(0正常 1停用) */
@@ -1,10 +1,10 @@
package co.yixiang.web.controller.demo.domain;
package com.ruoyi.web.controller.demo.domain;
import java.util.Date;
import co.yixiang.common.annotation.Excel;
import co.yixiang.common.annotation.Excel.Type;
import co.yixiang.common.core.domain.BaseEntity;
import co.yixiang.common.utils.DateUtils;
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
{
@@ -135,13 +135,11 @@ public class UserOperateModel extends BaseEntity
this.status = status;
}
@Override
public Date getCreateTime()
{
return createTime;
}
@Override
public void setCreateTime(Date createTime)
{
this.createTime = createTime;
@@ -1,10 +1,10 @@
package co.yixiang.web.controller.monitor;
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 co.yixiang.common.core.controller.BaseController;
import com.ruoyi.common.core.controller.BaseController;
/**
* druid 监控
@@ -21,6 +21,6 @@ public class DruidController extends BaseController
@GetMapping()
public String index()
{
return redirect(prefix + "/index.html");
return redirect(prefix + "/index");
}
}
@@ -1,12 +1,12 @@
package co.yixiang.web.controller.monitor;
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 co.yixiang.common.core.controller.BaseController;
import co.yixiang.framework.web.domain.Server;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.framework.web.domain.Server;
/**
* 服务器监控
@@ -1,7 +1,6 @@
package co.yixiang.web.controller.monitor;
package com.ruoyi.web.controller.monitor;
import java.util.List;
import co.yixiang.framework.shiro.service.SysPasswordService;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
@@ -9,14 +8,14 @@ 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 co.yixiang.common.annotation.Log;
import co.yixiang.common.core.controller.BaseController;
import co.yixiang.common.core.domain.AjaxResult;
import co.yixiang.common.core.page.TableDataInfo;
import co.yixiang.common.enums.BusinessType;
import co.yixiang.common.utils.poi.ExcelUtil;
import co.yixiang.system.domain.SysLogininfor;
import co.yixiang.system.service.ISysLogininforService;
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;
/**
* 系统访问记录
@@ -32,9 +31,6 @@ public class SysLogininforController extends BaseController
@Autowired
private ISysLogininforService logininforService;
@Autowired
private SysPasswordService passwordService;
@RequiresPermissions("monitor:logininfor:view")
@GetMapping()
public String logininfor()
@@ -52,7 +48,7 @@ public class SysLogininforController extends BaseController
return getDataTable(list);
}
@Log(title = "登录日志", businessType = BusinessType.EXPORT)
@Log(title = "登陆日志", businessType = BusinessType.EXPORT)
@RequiresPermissions("monitor:logininfor:export")
@PostMapping("/export")
@ResponseBody
@@ -60,11 +56,11 @@ public class SysLogininforController extends BaseController
{
List<SysLogininfor> list = logininforService.selectLogininforList(logininfor);
ExcelUtil<SysLogininfor> util = new ExcelUtil<SysLogininfor>(SysLogininfor.class);
return util.exportExcel(list, "登录日志");
return util.exportExcel(list, "登陆日志");
}
@RequiresPermissions("monitor:logininfor:remove")
@Log(title = "登录日志", businessType = BusinessType.DELETE)
@Log(title = "登陆日志", businessType = BusinessType.DELETE)
@PostMapping("/remove")
@ResponseBody
public AjaxResult remove(String ids)
@@ -73,7 +69,7 @@ public class SysLogininforController extends BaseController
}
@RequiresPermissions("monitor:logininfor:remove")
@Log(title = "登录日志", businessType = BusinessType.CLEAN)
@Log(title = "登陆日志", businessType = BusinessType.CLEAN)
@PostMapping("/clean")
@ResponseBody
public AjaxResult clean()
@@ -81,14 +77,4 @@ public class SysLogininforController extends BaseController
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();
}
}
@@ -1,4 +1,4 @@
package co.yixiang.web.controller.monitor;
package com.ruoyi.web.controller.monitor;
import java.util.List;
import org.apache.shiro.authz.annotation.RequiresPermissions;
@@ -10,14 +10,14 @@ 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 co.yixiang.common.annotation.Log;
import co.yixiang.common.core.controller.BaseController;
import co.yixiang.common.core.domain.AjaxResult;
import co.yixiang.common.core.page.TableDataInfo;
import co.yixiang.common.enums.BusinessType;
import co.yixiang.common.utils.poi.ExcelUtil;
import co.yixiang.system.domain.SysOperLog;
import co.yixiang.system.service.ISysOperLogService;
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;
/**
* 操作日志记录
@@ -61,7 +61,6 @@ public class SysOperlogController extends BaseController
return util.exportExcel(list, "操作日志");
}
@Log(title = "操作日志", businessType = BusinessType.DELETE)
@RequiresPermissions("monitor:operlog:remove")
@PostMapping("/remove")
@ResponseBody
@@ -0,0 +1,114 @@
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.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 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.enums.OnlineStatus;
import com.ruoyi.framework.shiro.session.OnlineSession;
import com.ruoyi.framework.shiro.session.OnlineSessionDAO;
import com.ruoyi.framework.util.ShiroUtils;
import com.ruoyi.system.domain.SysUserOnline;
import com.ruoyi.system.service.ISysUserOnlineService;
/**
* 在线用户监控
*
* @author ruoyi
*/
@Controller
@RequestMapping("/monitor/online")
public class SysUserOnlineController extends BaseController
{
private String prefix = "monitor/online";
@Autowired
private ISysUserOnlineService userOnlineService;
@Autowired
private OnlineSessionDAO onlineSessionDAO;
@RequiresPermissions("monitor:online:view")
@GetMapping()
public String online()
{
return prefix + "/online";
}
@RequiresPermissions("monitor:online:list")
@PostMapping("/list")
@ResponseBody
public TableDataInfo list(SysUserOnline userOnline)
{
startPage();
List<SysUserOnline> list = userOnlineService.selectUserOnlineList(userOnline);
return getDataTable(list);
}
@RequiresPermissions("monitor:online:batchForceLogout")
@Log(title = "在线用户", businessType = BusinessType.FORCE)
@PostMapping("/batchForceLogout")
@ResponseBody
public AjaxResult batchForceLogout(@RequestParam("ids[]") String[] ids)
{
for (String sessionId : ids)
{
SysUserOnline online = userOnlineService.selectOnlineById(sessionId);
if (online == null)
{
return error("用户已下线");
}
OnlineSession onlineSession = (OnlineSession) onlineSessionDAO.readSession(online.getSessionId());
if (onlineSession == null)
{
return error("用户已下线");
}
if (sessionId.equals(ShiroUtils.getSessionId()))
{
return error("当前登陆用户无法强退");
}
onlineSession.setStatus(OnlineStatus.off_line);
onlineSessionDAO.update(onlineSession);
online.setStatus(OnlineStatus.off_line);
userOnlineService.saveOnline(online);
}
return success();
}
@RequiresPermissions("monitor:online:forceLogout")
@Log(title = "在线用户", businessType = BusinessType.FORCE)
@PostMapping("/forceLogout")
@ResponseBody
public AjaxResult forceLogout(String sessionId)
{
SysUserOnline online = userOnlineService.selectOnlineById(sessionId);
if (sessionId.equals(ShiroUtils.getSessionId()))
{
return error("当前登陆用户无法强退");
}
if (online == null)
{
return error("用户已下线");
}
OnlineSession onlineSession = (OnlineSession) onlineSessionDAO.readSession(online.getSessionId());
if (onlineSession == null)
{
return error("用户已下线");
}
onlineSession.setStatus(OnlineStatus.off_line);
onlineSessionDAO.update(onlineSession);
online.setStatus(OnlineStatus.off_line);
userOnlineService.saveOnline(online);
return success();
}
}
@@ -1,4 +1,4 @@
package co.yixiang.web.controller.shop;
package com.ruoyi.web.controller.shop;
import java.util.List;
import org.apache.shiro.authz.annotation.RequiresPermissions;
@@ -10,14 +10,14 @@ 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 co.yixiang.common.annotation.Log;
import co.yixiang.common.enums.BusinessType;
import co.yixiang.shop.domain.StoreCoupon;
import co.yixiang.shop.service.IStoreCouponService;
import co.yixiang.common.core.controller.BaseController;
import co.yixiang.common.core.domain.AjaxResult;
import co.yixiang.common.utils.poi.ExcelUtil;
import co.yixiang.common.core.page.TableDataInfo;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.shop.domain.StoreCoupon;
import com.ruoyi.shop.service.IStoreCouponService;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.common.core.page.TableDataInfo;
/**
* 优惠券主Controller
@@ -1,4 +1,4 @@
package co.yixiang.web.controller.shop;
package com.ruoyi.web.controller.shop;
import java.util.List;
import org.apache.shiro.authz.annotation.RequiresPermissions;
@@ -10,14 +10,14 @@ 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 co.yixiang.common.annotation.Log;
import co.yixiang.common.enums.BusinessType;
import co.yixiang.shop.domain.StoreGoodsAttribute;
import co.yixiang.shop.service.IStoreGoodsAttributeService;
import co.yixiang.common.core.controller.BaseController;
import co.yixiang.common.core.domain.AjaxResult;
import co.yixiang.common.utils.poi.ExcelUtil;
import co.yixiang.common.core.page.TableDataInfo;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.shop.domain.StoreGoodsAttribute;
import com.ruoyi.shop.service.IStoreGoodsAttributeService;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.common.core.page.TableDataInfo;
/**
* 商品的属性(独立)Controller
@@ -1,4 +1,4 @@
package co.yixiang.web.controller.shop;
package com.ruoyi.web.controller.shop;
import java.util.List;
import org.apache.shiro.authz.annotation.RequiresPermissions;
@@ -10,14 +10,14 @@ 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 co.yixiang.common.annotation.Log;
import co.yixiang.common.enums.BusinessType;
import co.yixiang.shop.domain.StoreGoodsBrand;
import co.yixiang.shop.service.IStoreGoodsBrandService;
import co.yixiang.common.core.controller.BaseController;
import co.yixiang.common.core.domain.AjaxResult;
import co.yixiang.common.utils.poi.ExcelUtil;
import co.yixiang.common.core.page.TableDataInfo;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.shop.domain.StoreGoodsBrand;
import com.ruoyi.shop.service.IStoreGoodsBrandService;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.common.core.page.TableDataInfo;
/**
* 产品品牌Controller
@@ -1,4 +1,4 @@
package co.yixiang.web.controller.shop;
package com.ruoyi.web.controller.shop;
import java.util.List;
import org.apache.shiro.authz.annotation.RequiresPermissions;
@@ -10,15 +10,15 @@ 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 co.yixiang.common.annotation.Log;
import co.yixiang.common.enums.BusinessType;
import co.yixiang.shop.domain.StoreGoodsCate;
import co.yixiang.shop.service.IStoreGoodsCateService;
import co.yixiang.common.core.controller.BaseController;
import co.yixiang.common.core.domain.AjaxResult;
import co.yixiang.common.utils.poi.ExcelUtil;
import co.yixiang.common.utils.StringUtils;
import co.yixiang.common.core.domain.Ztree;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.shop.domain.StoreGoodsCate;
import com.ruoyi.shop.service.IStoreGoodsCateService;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.common.core.domain.Ztree;
/**
* 商城商品分类Controller
@@ -1,4 +1,4 @@
package co.yixiang.web.controller.shop;
package com.ruoyi.web.controller.shop;
import java.text.MessageFormat;
import java.util.*;
@@ -6,25 +6,26 @@ import java.util.regex.Matcher;
import java.util.regex.Pattern;
import java.util.stream.Stream;
import co.yixiang.shop.domain.*;
import co.yixiang.shop.service.*;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import co.yixiang.common.utils.StringUtils;
import co.yixiang.shop.domain.*;
import co.yixiang.shop.service.*;
import co.yixiang.shop.vo.SpecVO;
import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.shop.domain.*;
import com.ruoyi.shop.service.*;
import com.ruoyi.shop.vo.SpecAttrVO;
import com.ruoyi.shop.vo.SpecVO;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.aspectj.weaver.AjAttribute;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.*;
import co.yixiang.common.annotation.Log;
import co.yixiang.common.enums.BusinessType;
import co.yixiang.common.core.controller.BaseController;
import co.yixiang.common.core.domain.AjaxResult;
import co.yixiang.common.utils.poi.ExcelUtil;
import co.yixiang.common.core.page.TableDataInfo;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.common.core.page.TableDataInfo;
import javax.servlet.http.HttpServletRequest;
@@ -1,4 +1,4 @@
package co.yixiang.web.controller.shop;
package com.ruoyi.web.controller.shop;
import java.util.List;
import org.apache.shiro.authz.annotation.RequiresPermissions;
@@ -10,14 +10,14 @@ 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 co.yixiang.common.annotation.Log;
import co.yixiang.common.enums.BusinessType;
import co.yixiang.shop.domain.StoreGoodsType;
import co.yixiang.shop.service.IStoreGoodsTypeService;
import co.yixiang.common.core.controller.BaseController;
import co.yixiang.common.core.domain.AjaxResult;
import co.yixiang.common.utils.poi.ExcelUtil;
import co.yixiang.common.core.page.TableDataInfo;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.shop.domain.StoreGoodsType;
import com.ruoyi.shop.service.IStoreGoodsTypeService;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.common.core.page.TableDataInfo;
/**
* 商品类型(商品模型)Controller
@@ -1,4 +1,4 @@
package co.yixiang.web.controller.shop;
package com.ruoyi.web.controller.shop;
import java.util.List;
import org.apache.shiro.authz.annotation.RequiresPermissions;
@@ -10,14 +10,14 @@ 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 co.yixiang.common.annotation.Log;
import co.yixiang.common.enums.BusinessType;
import co.yixiang.shop.domain.StoreMember;
import co.yixiang.shop.service.IStoreMemberService;
import co.yixiang.common.core.controller.BaseController;
import co.yixiang.common.core.domain.AjaxResult;
import co.yixiang.common.utils.poi.ExcelUtil;
import co.yixiang.common.core.page.TableDataInfo;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.shop.domain.StoreMember;
import com.ruoyi.shop.service.IStoreMemberService;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.common.core.page.TableDataInfo;
/**
* 商城会员信息Controller
@@ -1,25 +1,26 @@
package co.yixiang.web.controller.shop;
package com.ruoyi.web.controller.shop;
import java.util.List;
import com.ruoyi.common.enums.OrderStatus;
import com.ruoyi.common.enums.UserStatus;
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.validation.annotation.Validated;
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 co.yixiang.common.annotation.Log;
import co.yixiang.common.enums.BusinessType;
import co.yixiang.shop.domain.StoreOrder;
import co.yixiang.shop.service.IStoreOrderService;
import co.yixiang.common.core.controller.BaseController;
import co.yixiang.common.core.domain.AjaxResult;
import co.yixiang.common.utils.poi.ExcelUtil;
import co.yixiang.common.core.page.TableDataInfo;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.shop.domain.StoreOrder;
import com.ruoyi.shop.service.IStoreOrderService;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.common.core.page.TableDataInfo;
/**
* 订单主Controller
@@ -163,7 +164,7 @@ public class StoreOrderController extends BaseController
@Log(title = "订单主", businessType = BusinessType.UPDATE)
@PostMapping("/edit")
@ResponseBody
public AjaxResult editSave(@Validated StoreOrder storeOrder)
public AjaxResult editSave(StoreOrder storeOrder)
{
return toAjax(storeOrderService.updateStoreOrder(storeOrder));
}
@@ -1,4 +1,4 @@
package co.yixiang.web.controller.shop;
package com.ruoyi.web.controller.shop;
import java.util.List;
import org.apache.shiro.authz.annotation.RequiresPermissions;
@@ -10,14 +10,14 @@ 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 co.yixiang.common.annotation.Log;
import co.yixiang.common.enums.BusinessType;
import co.yixiang.shop.domain.StoreSpec;
import co.yixiang.shop.service.IStoreSpecService;
import co.yixiang.common.core.controller.BaseController;
import co.yixiang.common.core.domain.AjaxResult;
import co.yixiang.common.utils.poi.ExcelUtil;
import co.yixiang.common.core.page.TableDataInfo;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.shop.domain.StoreSpec;
import com.ruoyi.shop.service.IStoreSpecService;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.common.core.page.TableDataInfo;
/**
* 商品规格(独立)Controller
@@ -1,4 +1,4 @@
package co.yixiang.web.controller.system;
package com.ruoyi.web.controller.system;
import java.awt.image.BufferedImage;
import java.io.IOException;
@@ -14,7 +14,7 @@ import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;
import com.google.code.kaptcha.Constants;
import com.google.code.kaptcha.Producer;
import co.yixiang.common.core.controller.BaseController;
import com.ruoyi.common.core.controller.BaseController;
/**
* 图片验证码(支持算术形式)
@@ -1,8 +1,6 @@
package co.yixiang.web.controller.system;
package com.ruoyi.web.controller.system;
import java.util.List;
import co.yixiang.system.service.ISysConfigService;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
@@ -13,15 +11,16 @@ 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 co.yixiang.common.annotation.Log;
import co.yixiang.common.constant.UserConstants;
import co.yixiang.common.core.controller.BaseController;
import co.yixiang.common.core.domain.AjaxResult;
import co.yixiang.common.core.page.TableDataInfo;
import co.yixiang.common.enums.BusinessType;
import co.yixiang.common.utils.ShiroUtils;
import co.yixiang.common.utils.poi.ExcelUtil;
import co.yixiang.system.domain.SysConfig;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.constant.UserConstants;
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.framework.util.ShiroUtils;
import com.ruoyi.system.domain.SysConfig;
import com.ruoyi.system.service.ISysConfigService;
/**
* 参数配置 信息操作处理
@@ -130,21 +129,7 @@ public class SysConfigController extends BaseController
@ResponseBody
public AjaxResult remove(String ids)
{
configService.deleteConfigByIds(ids);
return success();
}
/**
* 刷新参数缓存
*/
@RequiresPermissions("system:config:remove")
@Log(title = "参数管理", businessType = BusinessType.CLEAN)
@GetMapping("/refreshCache")
@ResponseBody
public AjaxResult refreshCache()
{
configService.resetConfigCache();
return success();
return toAjax(configService.deleteConfigByIds(ids));
}
/**
@@ -1,8 +1,6 @@
package co.yixiang.web.controller.system;
package com.ruoyi.web.controller.system;
import java.util.List;
import co.yixiang.system.service.ISysDeptService;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
@@ -13,17 +11,17 @@ 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 co.yixiang.common.annotation.Log;
import co.yixiang.common.constant.UserConstants;
import co.yixiang.common.core.controller.BaseController;
import co.yixiang.common.core.domain.AjaxResult;
import co.yixiang.common.core.domain.Ztree;
import co.yixiang.common.core.domain.entity.SysDept;
import co.yixiang.common.core.domain.entity.SysRole;
import co.yixiang.common.enums.BusinessType;
import co.yixiang.common.utils.ShiroUtils;
import co.yixiang.common.utils.StringUtils;
import co.yixiang.system.service.ISysDeptService;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.constant.UserConstants;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.domain.Ztree;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.framework.util.ShiroUtils;
import com.ruoyi.system.domain.SysDept;
import com.ruoyi.system.domain.SysRole;
import com.ruoyi.system.service.ISysDeptService;
/**
* 部门信息
@@ -61,10 +59,6 @@ public class SysDeptController extends BaseController
@GetMapping("/add/{parentId}")
public String add(@PathVariable("parentId") Long parentId, ModelMap mmap)
{
if (!ShiroUtils.getSysUser().isAdmin())
{
parentId = ShiroUtils.getSysUser().getDeptId();
}
mmap.put("dept", deptService.selectDeptById(parentId));
return prefix + "/add";
}
@@ -118,11 +112,6 @@ public class SysDeptController extends BaseController
{
return error("修改部门'" + dept.getDeptName() + "'失败,上级部门不能是自己");
}
else if (StringUtils.equals(UserConstants.DEPT_DISABLE, dept.getStatus())
&& deptService.selectNormalChildrenDeptById(dept.getDeptId()) > 0)
{
return AjaxResult.error("该部门包含未停用的子部门!");
}
dept.setUpdateBy(ShiroUtils.getLoginName());
return toAjax(deptService.updateDept(dept));
}
@@ -159,16 +148,11 @@ public class SysDeptController extends BaseController
/**
* 选择部门树
*
* @param deptId 部门ID
* @param excludeId 排除ID
*/
@GetMapping(value = { "/selectDeptTree/{deptId}", "/selectDeptTree/{deptId}/{excludeId}" })
public String selectDeptTree(@PathVariable("deptId") Long deptId,
@PathVariable(value = "excludeId", required = false) String excludeId, ModelMap mmap)
@GetMapping("/selectDeptTree/{deptId}")
public String selectDeptTree(@PathVariable("deptId") Long deptId, ModelMap mmap)
{
mmap.put("dept", deptService.selectDeptById(deptId));
mmap.put("excludeId", excludeId);
return prefix + "/tree";
}
@@ -183,19 +167,6 @@ public class SysDeptController extends BaseController
return ztrees;
}
/**
* 加载部门列表树(排除下级)
*/
@GetMapping("/treeData/{excludeId}")
@ResponseBody
public List<Ztree> treeDataExcludeChild(@PathVariable(value = "excludeId", required = false) Long excludeId)
{
SysDept dept = new SysDept();
dept.setDeptId(excludeId);
List<Ztree> ztrees = deptService.selectDeptTreeExcludeChild(dept);
return ztrees;
}
/**
* 加载角色部门(数据权限)列表树
*/
@@ -1,8 +1,6 @@
package co.yixiang.web.controller.system;
package com.ruoyi.web.controller.system;
import java.util.List;
import co.yixiang.system.service.ISysDictDataService;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
@@ -13,15 +11,15 @@ 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 co.yixiang.common.annotation.Log;
import co.yixiang.common.core.controller.BaseController;
import co.yixiang.common.core.domain.AjaxResult;
import co.yixiang.common.core.domain.entity.SysDictData;
import co.yixiang.common.core.page.TableDataInfo;
import co.yixiang.common.enums.BusinessType;
import co.yixiang.common.utils.ShiroUtils;
import co.yixiang.common.utils.poi.ExcelUtil;
import co.yixiang.system.service.ISysDictDataService;
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.framework.util.ShiroUtils;
import com.ruoyi.system.domain.SysDictData;
import com.ruoyi.system.service.ISysDictDataService;
/**
* 数据字典信息
@@ -117,7 +115,6 @@ public class SysDictDataController extends BaseController
@ResponseBody
public AjaxResult remove(String ids)
{
dictDataService.deleteDictDataByIds(ids);
return success();
return toAjax(dictDataService.deleteDictDataByIds(ids));
}
}
@@ -1,8 +1,6 @@
package co.yixiang.web.controller.system;
package com.ruoyi.web.controller.system;
import java.util.List;
import co.yixiang.system.service.ISysDictTypeService;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
@@ -13,16 +11,17 @@ 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 co.yixiang.common.annotation.Log;
import co.yixiang.common.constant.UserConstants;
import co.yixiang.common.core.controller.BaseController;
import co.yixiang.common.core.domain.AjaxResult;
import co.yixiang.common.core.domain.Ztree;
import co.yixiang.common.core.domain.entity.SysDictType;
import co.yixiang.common.core.page.TableDataInfo;
import co.yixiang.common.enums.BusinessType;
import co.yixiang.common.utils.ShiroUtils;
import co.yixiang.common.utils.poi.ExcelUtil;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.constant.UserConstants;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.domain.Ztree;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.framework.util.ShiroUtils;
import com.ruoyi.system.domain.SysDictType;
import com.ruoyi.system.service.ISysDictTypeService;
/**
* 数据字典信息
@@ -126,21 +125,14 @@ public class SysDictTypeController extends BaseController
@ResponseBody
public AjaxResult remove(String ids)
{
dictTypeService.deleteDictTypeByIds(ids);
return success();
}
/**
* 刷新字典缓存
*/
@RequiresPermissions("system:dict:remove")
@Log(title = "字典类型", businessType = BusinessType.CLEAN)
@GetMapping("/refreshCache")
@ResponseBody
public AjaxResult refreshCache()
{
dictTypeService.resetDictCache();
return success();
try
{
return toAjax(dictTypeService.deleteDictTypeByIds(ids));
}
catch (Exception e)
{
return error(e.getMessage());
}
}
/**
@@ -0,0 +1,48 @@
package com.ruoyi.web.controller.system;
import java.util.List;
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 com.ruoyi.common.config.Global;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.framework.util.ShiroUtils;
import com.ruoyi.system.domain.SysMenu;
import com.ruoyi.system.domain.SysUser;
import com.ruoyi.system.service.ISysMenuService;
/**
* 首页 业务处理
*
* @author ruoyi
*/
@Controller
public class SysIndexController extends BaseController
{
@Autowired
private ISysMenuService menuService;
// 系统首页
@GetMapping("/index")
public String index(ModelMap mmap)
{
// 取身份信息
SysUser user = ShiroUtils.getSysUser();
// 根据用户id取出菜单
List<SysMenu> menus = menuService.selectMenusByUser(user);
mmap.put("menus", menus);
mmap.put("user", user);
mmap.put("copyrightYear", Global.getCopyrightYear());
mmap.put("demoEnabled", Global.isDemoEnabled());
return "index";
}
// 系统介绍
@GetMapping("/system/main")
public String main(ModelMap mmap)
{
mmap.put("version", Global.getVersion());
return "main";
}
}
@@ -1,4 +1,4 @@
package co.yixiang.web.controller.system;
package com.ruoyi.web.controller.system;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
@@ -10,10 +10,10 @@ 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 co.yixiang.common.core.controller.BaseController;
import co.yixiang.common.core.domain.AjaxResult;
import co.yixiang.common.utils.ServletUtils;
import co.yixiang.common.utils.StringUtils;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.utils.ServletUtils;
import com.ruoyi.common.utils.StringUtils;
/**
* 登录验证
@@ -1,8 +1,6 @@
package co.yixiang.web.controller.system;
package com.ruoyi.web.controller.system;
import java.util.List;
import co.yixiang.system.service.ISysMenuService;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
@@ -13,16 +11,16 @@ 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 co.yixiang.common.annotation.Log;
import co.yixiang.common.constant.UserConstants;
import co.yixiang.common.core.controller.BaseController;
import co.yixiang.common.core.domain.AjaxResult;
import co.yixiang.common.core.domain.Ztree;
import co.yixiang.common.core.domain.entity.SysMenu;
import co.yixiang.common.core.domain.entity.SysRole;
import co.yixiang.common.enums.BusinessType;
import co.yixiang.common.utils.ShiroUtils;
import co.yixiang.framework.shiro.util.AuthorizationUtils;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.constant.UserConstants;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.domain.Ztree;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.framework.util.ShiroUtils;
import com.ruoyi.system.domain.SysMenu;
import com.ruoyi.system.domain.SysRole;
import com.ruoyi.system.service.ISysMenuService;
/**
* 菜单信息
@@ -72,7 +70,7 @@ public class SysMenuController extends BaseController
{
return AjaxResult.warn("菜单已分配,不允许删除");
}
AuthorizationUtils.clearAllCachedAuthorizationInfo();
ShiroUtils.clearCachedAuthorizationInfo();
return toAjax(menuService.deleteMenuById(menuId));
}
@@ -111,7 +109,7 @@ public class SysMenuController extends BaseController
return error("新增菜单'" + menu.getMenuName() + "'失败,菜单名称已存在");
}
menu.setCreateBy(ShiroUtils.getLoginName());
AuthorizationUtils.clearAllCachedAuthorizationInfo();
ShiroUtils.clearCachedAuthorizationInfo();
return toAjax(menuService.insertMenu(menu));
}
@@ -139,7 +137,7 @@ public class SysMenuController extends BaseController
return error("修改菜单'" + menu.getMenuName() + "'失败,菜单名称已存在");
}
menu.setUpdateBy(ShiroUtils.getLoginName());
AuthorizationUtils.clearAllCachedAuthorizationInfo();
ShiroUtils.clearCachedAuthorizationInfo();
return toAjax(menuService.updateMenu(menu));
}
@@ -1,4 +1,4 @@
package co.yixiang.web.controller.system;
package com.ruoyi.web.controller.system;
import java.util.List;
import org.apache.shiro.authz.annotation.RequiresPermissions;
@@ -10,14 +10,14 @@ 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 co.yixiang.common.annotation.Log;
import co.yixiang.common.core.controller.BaseController;
import co.yixiang.common.core.domain.AjaxResult;
import co.yixiang.common.core.page.TableDataInfo;
import co.yixiang.common.enums.BusinessType;
import co.yixiang.common.utils.ShiroUtils;
import co.yixiang.system.domain.SysNotice;
import co.yixiang.system.service.ISysNoticeService;
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.framework.util.ShiroUtils;
import com.ruoyi.system.domain.SysNotice;
import com.ruoyi.system.service.ISysNoticeService;
/**
* 公告 信息操作处理
@@ -1,4 +1,4 @@
package co.yixiang.web.controller.system;
package com.ruoyi.web.controller.system;
import java.util.List;
import org.apache.shiro.authz.annotation.RequiresPermissions;
@@ -11,16 +11,16 @@ 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 co.yixiang.common.annotation.Log;
import co.yixiang.common.constant.UserConstants;
import co.yixiang.common.core.controller.BaseController;
import co.yixiang.common.core.domain.AjaxResult;
import co.yixiang.common.core.page.TableDataInfo;
import co.yixiang.common.enums.BusinessType;
import co.yixiang.common.utils.ShiroUtils;
import co.yixiang.common.utils.poi.ExcelUtil;
import co.yixiang.system.domain.SysPost;
import co.yixiang.system.service.ISysPostService;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.constant.UserConstants;
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.framework.util.ShiroUtils;
import com.ruoyi.system.domain.SysPost;
import com.ruoyi.system.service.ISysPostService;
/**
* 岗位信息操作处理
@@ -1,6 +1,5 @@
package co.yixiang.web.controller.system;
package com.ruoyi.web.controller.system;
import co.yixiang.system.service.ISysUserService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
@@ -12,18 +11,17 @@ 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 co.yixiang.common.annotation.Log;
import co.yixiang.common.config.RuoYiConfig;
import co.yixiang.common.constant.UserConstants;
import co.yixiang.common.core.controller.BaseController;
import co.yixiang.common.core.domain.AjaxResult;
import co.yixiang.common.core.domain.entity.SysUser;
import co.yixiang.common.enums.BusinessType;
import co.yixiang.common.utils.DateUtils;
import co.yixiang.common.utils.ShiroUtils;
import co.yixiang.common.utils.StringUtils;
import co.yixiang.common.utils.file.FileUploadUtils;
import co.yixiang.framework.shiro.service.SysPasswordService;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.config.Global;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.common.utils.file.FileUploadUtils;
import com.ruoyi.framework.shiro.service.SysPasswordService;
import com.ruoyi.framework.util.ShiroUtils;
import com.ruoyi.system.domain.SysUser;
import com.ruoyi.system.service.ISysUserService;
/**
* 个人信息 业务处理
@@ -83,23 +81,21 @@ public class SysProfileController extends BaseController
public AjaxResult resetPwd(String oldPassword, String newPassword)
{
SysUser user = ShiroUtils.getSysUser();
if (!passwordService.matches(user, oldPassword))
if (StringUtils.isNotEmpty(newPassword) && passwordService.matches(user, oldPassword))
{
user.setSalt(ShiroUtils.randomSalt());
user.setPassword(passwordService.encryptPassword(user.getLoginName(), newPassword, user.getSalt()));
if (userService.resetUserPwd(user) > 0)
{
ShiroUtils.setSysUser(userService.selectUserById(user.getUserId()));
return success();
}
return error();
}
else
{
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)
{
ShiroUtils.setSysUser(userService.selectUserById(user.getUserId()));
return success();
}
return error("修改密码异常,请联系管理员");
}
/**
@@ -137,16 +133,6 @@ public class SysProfileController extends BaseController
currentUser.setEmail(user.getEmail());
currentUser.setPhonenumber(user.getPhonenumber());
currentUser.setSex(user.getSex());
if (StringUtils.isNotEmpty(user.getPhonenumber())
&& UserConstants.USER_PHONE_NOT_UNIQUE.equals(userService.checkPhoneUnique(currentUser)))
{
return error("修改用户'" + currentUser.getLoginName() + "'失败,手机号码已存在");
}
else if (StringUtils.isNotEmpty(user.getEmail())
&& UserConstants.USER_EMAIL_NOT_UNIQUE.equals(userService.checkEmailUnique(currentUser)))
{
return error("修改用户'" + currentUser.getLoginName() + "'失败,邮箱账号已存在");
}
if (userService.updateUserInfo(currentUser) > 0)
{
ShiroUtils.setSysUser(userService.selectUserById(currentUser.getUserId()));
@@ -168,7 +154,7 @@ public class SysProfileController extends BaseController
{
if (!file.isEmpty())
{
String avatar = FileUploadUtils.upload(RuoYiConfig.getAvatarPath(), file);
String avatar = FileUploadUtils.upload(Global.getAvatarPath(), file);
currentUser.setAvatar(avatar);
if (userService.updateUserInfo(currentUser) > 0)
{
@@ -1,9 +1,6 @@
package co.yixiang.web.controller.system;
package com.ruoyi.web.controller.system;
import java.util.List;
import co.yixiang.system.service.ISysRoleService;
import co.yixiang.system.service.ISysUserService;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
@@ -14,18 +11,19 @@ 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 co.yixiang.common.annotation.Log;
import co.yixiang.common.constant.UserConstants;
import co.yixiang.common.core.controller.BaseController;
import co.yixiang.common.core.domain.AjaxResult;
import co.yixiang.common.core.domain.entity.SysRole;
import co.yixiang.common.core.domain.entity.SysUser;
import co.yixiang.common.core.page.TableDataInfo;
import co.yixiang.common.enums.BusinessType;
import co.yixiang.common.utils.ShiroUtils;
import co.yixiang.common.utils.poi.ExcelUtil;
import co.yixiang.framework.shiro.util.AuthorizationUtils;
import co.yixiang.system.domain.SysUserRole;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.constant.UserConstants;
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.framework.util.ShiroUtils;
import com.ruoyi.system.domain.SysRole;
import com.ruoyi.system.domain.SysUser;
import com.ruoyi.system.domain.SysUserRole;
import com.ruoyi.system.service.ISysRoleService;
import com.ruoyi.system.service.ISysUserService;
/**
* 角色信息
@@ -99,7 +97,7 @@ public class SysRoleController extends BaseController
return error("新增角色'" + role.getRoleName() + "'失败,角色权限已存在");
}
role.setCreateBy(ShiroUtils.getLoginName());
AuthorizationUtils.clearAllCachedAuthorizationInfo();
ShiroUtils.clearCachedAuthorizationInfo();
return toAjax(roleService.insertRole(role));
}
@@ -123,7 +121,6 @@ public class SysRoleController extends BaseController
@ResponseBody
public AjaxResult editSave(@Validated SysRole role)
{
roleService.checkRoleAllowed(role);
if (UserConstants.ROLE_NAME_NOT_UNIQUE.equals(roleService.checkRoleNameUnique(role)))
{
return error("修改角色'" + role.getRoleName() + "'失败,角色名称已存在");
@@ -133,7 +130,7 @@ public class SysRoleController extends BaseController
return error("修改角色'" + role.getRoleName() + "'失败,角色权限已存在");
}
role.setUpdateBy(ShiroUtils.getLoginName());
AuthorizationUtils.clearAllCachedAuthorizationInfo();
ShiroUtils.clearCachedAuthorizationInfo();
return toAjax(roleService.updateRole(role));
}
@@ -156,7 +153,6 @@ public class SysRoleController extends BaseController
@ResponseBody
public AjaxResult authDataScopeSave(SysRole role)
{
roleService.checkRoleAllowed(role);
role.setUpdateBy(ShiroUtils.getLoginName());
if (roleService.authDataScope(role) > 0)
{
@@ -172,7 +168,14 @@ public class SysRoleController extends BaseController
@ResponseBody
public AjaxResult remove(String ids)
{
return toAjax(roleService.deleteRoleByIds(ids));
try
{
return toAjax(roleService.deleteRoleByIds(ids));
}
catch (Exception e)
{
return error(e.getMessage());
}
}
/**
@@ -213,7 +216,6 @@ public class SysRoleController extends BaseController
@ResponseBody
public AjaxResult changeStatus(SysRole role)
{
roleService.checkRoleAllowed(role);
return toAjax(roleService.changeStatus(role));
}
@@ -1,10 +1,6 @@
package co.yixiang.web.controller.system;
package com.ruoyi.web.controller.system;
import java.util.List;
import java.util.stream.Collectors;
import co.yixiang.system.service.ISysRoleService;
import co.yixiang.system.service.ISysUserService;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
@@ -16,19 +12,20 @@ import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.multipart.MultipartFile;
import co.yixiang.common.annotation.Log;
import co.yixiang.common.constant.UserConstants;
import co.yixiang.common.core.controller.BaseController;
import co.yixiang.common.core.domain.AjaxResult;
import co.yixiang.common.core.domain.entity.SysRole;
import co.yixiang.common.core.domain.entity.SysUser;
import co.yixiang.common.core.page.TableDataInfo;
import co.yixiang.common.enums.BusinessType;
import co.yixiang.common.utils.ShiroUtils;
import co.yixiang.common.utils.StringUtils;
import co.yixiang.common.utils.poi.ExcelUtil;
import co.yixiang.framework.shiro.service.SysPasswordService;
import co.yixiang.system.service.ISysPostService;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.constant.UserConstants;
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.StringUtils;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.framework.shiro.service.SysPasswordService;
import com.ruoyi.framework.util.ShiroUtils;
import com.ruoyi.system.domain.SysUser;
import com.ruoyi.system.service.ISysPostService;
import com.ruoyi.system.service.ISysRoleService;
import com.ruoyi.system.service.ISysUserService;
/**
* 用户信息
@@ -109,7 +106,7 @@ public class SysUserController extends BaseController
@GetMapping("/add")
public String add(ModelMap mmap)
{
mmap.put("roles", roleService.selectRoleAll().stream().filter(r -> !r.isAdmin()).collect(Collectors.toList()));
mmap.put("roles", roleService.selectRoleAll());
mmap.put("posts", postService.selectPostAll());
return prefix + "/add";
}
@@ -127,13 +124,11 @@ public class SysUserController extends BaseController
{
return error("新增用户'" + user.getLoginName() + "'失败,登录账号已存在");
}
else if (StringUtils.isNotEmpty(user.getPhonenumber())
&& UserConstants.USER_PHONE_NOT_UNIQUE.equals(userService.checkPhoneUnique(user)))
else if (UserConstants.USER_PHONE_NOT_UNIQUE.equals(userService.checkPhoneUnique(user)))
{
return error("新增用户'" + user.getLoginName() + "'失败,手机号码已存在");
}
else if (StringUtils.isNotEmpty(user.getEmail())
&& UserConstants.USER_EMAIL_NOT_UNIQUE.equals(userService.checkEmailUnique(user)))
else if (UserConstants.USER_EMAIL_NOT_UNIQUE.equals(userService.checkEmailUnique(user)))
{
return error("新增用户'" + user.getLoginName() + "'失败,邮箱账号已存在");
}
@@ -149,9 +144,8 @@ public class SysUserController extends BaseController
@GetMapping("/edit/{userId}")
public String edit(@PathVariable("userId") Long userId, ModelMap mmap)
{
List<SysRole> roles = roleService.selectRolesByUserId(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", roleService.selectRolesByUserId(userId));
mmap.put("posts", postService.selectPostsByUserId(userId));
return prefix + "/edit";
}
@@ -165,14 +159,15 @@ public class SysUserController extends BaseController
@ResponseBody
public AjaxResult editSave(@Validated SysUser user)
{
userService.checkUserAllowed(user);
if (StringUtils.isNotEmpty(user.getPhonenumber())
&& UserConstants.USER_PHONE_NOT_UNIQUE.equals(userService.checkPhoneUnique(user)))
if (StringUtils.isNotNull(user.getUserId()) && SysUser.isAdmin(user.getUserId()))
{
return error("不允许修改超级管理员用户");
}
else if (UserConstants.USER_PHONE_NOT_UNIQUE.equals(userService.checkPhoneUnique(user)))
{
return error("修改用户'" + user.getLoginName() + "'失败,手机号码已存在");
}
else if (StringUtils.isNotEmpty(user.getEmail())
&& UserConstants.USER_EMAIL_NOT_UNIQUE.equals(userService.checkEmailUnique(user)))
else if (UserConstants.USER_EMAIL_NOT_UNIQUE.equals(userService.checkEmailUnique(user)))
{
return error("修改用户'" + user.getLoginName() + "'失败,邮箱账号已存在");
}
@@ -181,6 +176,7 @@ public class SysUserController extends BaseController
}
@RequiresPermissions("system:user:resetPwd")
@Log(title = "重置密码", businessType = BusinessType.UPDATE)
@GetMapping("/resetPwd/{userId}")
public String resetPwd(@PathVariable("userId") Long userId, ModelMap mmap)
{
@@ -194,12 +190,11 @@ public class SysUserController extends BaseController
@ResponseBody
public AjaxResult resetPwdSave(SysUser user)
{
userService.checkUserAllowed(user);
user.setSalt(ShiroUtils.randomSalt());
user.setPassword(passwordService.encryptPassword(user.getLoginName(), user.getPassword(), user.getSalt()));
if (userService.resetUserPwd(user) > 0)
{
if (ShiroUtils.getUserId().longValue() == user.getUserId().longValue())
if (ShiroUtils.getUserId() == user.getUserId())
{
ShiroUtils.setSysUser(userService.selectUserById(user.getUserId()));
}
@@ -208,40 +203,20 @@ public class SysUserController extends BaseController
return error();
}
/**
* 进入授权角色页
*/
@GetMapping("/authRole/{userId}")
public String authRole(@PathVariable("userId") Long userId, ModelMap mmap)
{
SysUser user = userService.selectUserById(userId);
// 获取用户所属的角色列表
List<SysRole> roles = roleService.selectRolesByUserId(userId);
mmap.put("user", user);
mmap.put("roles", SysUser.isAdmin(userId) ? roles : roles.stream().filter(r -> !r.isAdmin()).collect(Collectors.toList()));
return prefix + "/authRole";
}
/**
* 用户授权角色
*/
@RequiresPermissions("system:user:add")
@Log(title = "用户管理", businessType = BusinessType.GRANT)
@PostMapping("/authRole/insertAuthRole")
@ResponseBody
public AjaxResult insertAuthRole(Long userId, Long[] roleIds)
{
userService.insertUserAuth(userId, roleIds);
return success();
}
@RequiresPermissions("system:user:remove")
@Log(title = "用户管理", businessType = BusinessType.DELETE)
@PostMapping("/remove")
@ResponseBody
public AjaxResult remove(String ids)
{
return toAjax(userService.deleteUserByIds(ids));
try
{
return toAjax(userService.deleteUserByIds(ids));
}
catch (Exception e)
{
return error(e.getMessage());
}
}
/**
@@ -283,7 +258,6 @@ public class SysUserController extends BaseController
@ResponseBody
public AjaxResult changeStatus(SysUser user)
{
userService.checkUserAllowed(user);
return toAjax(userService.changeStatus(user));
}
}
@@ -1,10 +1,10 @@
package co.yixiang.web.controller.tool;
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 co.yixiang.common.core.controller.BaseController;
import com.ruoyi.common.core.controller.BaseController;
/**
* build 表单构建
@@ -1,10 +1,10 @@
package co.yixiang.web.controller.tool;
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 co.yixiang.common.core.controller.BaseController;
import com.ruoyi.common.core.controller.BaseController;
/**
* swagger 接口
@@ -1,4 +1,4 @@
package co.yixiang.web.controller.tool;
package com.ruoyi.web.controller.tool;
import java.util.ArrayList;
import java.util.LinkedHashMap;
@@ -9,15 +9,13 @@ 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 co.yixiang.common.core.controller.BaseController;
import co.yixiang.common.core.domain.AjaxResult;
import co.yixiang.common.utils.StringUtils;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
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;
@@ -62,12 +60,7 @@ public class TestController extends BaseController
}
@ApiOperation("新增用户")
@ApiImplicitParams({
@ApiImplicitParam(name = "userId", value = "用户id", dataType = "Integer"),
@ApiImplicitParam(name = "username", value = "用户名称", dataType = "String"),
@ApiImplicitParam(name = "password", value = "用户密码", dataType = "String"),
@ApiImplicitParam(name = "mobile", value = "用户手机", dataType = "String")
})
@ApiImplicitParam(name = "userEntity", value = "新增用户信息", dataType = "UserEntity")
@PostMapping("/save")
public AjaxResult save(UserEntity user)
{
@@ -79,8 +72,9 @@ public class TestController extends BaseController
}
@ApiOperation("更新用户")
@ApiImplicitParam(name = "userEntity", value = "新增用户信息", dataType = "UserEntity")
@PutMapping("/update")
public AjaxResult update(@RequestBody UserEntity user)
public AjaxResult update(UserEntity user)
{
if (StringUtils.isNull(user) || StringUtils.isNull(user.getUserId()))
{
@@ -111,7 +105,7 @@ public class TestController extends BaseController
}
}
@ApiModel(value = "UserEntity", description = "用户实体")
@ApiModel("用户实体")
class UserEntity
{
@ApiModelProperty("用户ID")
@@ -1,9 +1,8 @@
package co.yixiang.web.core.config;
package com.ruoyi.web.core.config;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import co.yixiang.common.config.RuoYiConfig;
import com.ruoyi.common.config.Global;
import io.swagger.annotations.ApiOperation;
import springfox.documentation.builders.ApiInfoBuilder;
import springfox.documentation.builders.PathSelectors;
@@ -23,10 +22,6 @@ import springfox.documentation.swagger2.annotations.EnableSwagger2;
@EnableSwagger2
public class SwaggerConfig
{
/** 是否开启swagger */
@Value("${swagger.enabled}")
private boolean enabled;
/**
* 创建API
*/
@@ -34,8 +29,6 @@ public class SwaggerConfig
public Docket createRestApi()
{
return new Docket(DocumentationType.SWAGGER_2)
// 是否启用Swagger
.enable(enabled)
// 用来创建该API的基本信息,展示在文档的页面中(自定义展示的信息)
.apiInfo(apiInfo())
// 设置哪些接口暴露给Swagger展示
@@ -43,7 +36,7 @@ public class SwaggerConfig
// 扫描所有有注解的api,用这种方式更灵活
.apis(RequestHandlerSelectors.withMethodAnnotation(ApiOperation.class))
// 扫描指定包中的swagger注解
//.apis(RequestHandlerSelectors.basePackage("co.yixiang.project.tool.swagger"))
//.apis(RequestHandlerSelectors.basePackage("com.ruoyi.project.tool.swagger"))
// 扫描所有 .apis(RequestHandlerSelectors.any())
.paths(PathSelectors.any())
.build();
@@ -61,9 +54,9 @@ public class SwaggerConfig
// 描述
.description("描述:用于管理集团旗下公司的人员信息,具体包括XXX,XXX模块...")
// 作者信息
.contact(new Contact(RuoYiConfig.getName(), null, null))
.contact(new Contact(Global.getName(), null, null))
// 版本
.version("版本号:" + RuoYiConfig.getVersion())
.version("版本号:" + Global.getVersion())
.build();
}
}
@@ -6,7 +6,7 @@ spring:
druid:
# 主库数据源
master:
url: jdbc:mysql://localhost:3306/supply_shop?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
url: jdbc:mysql://localhost:3306/ruoyi?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
username: root
password: root
# 从库数据源
@@ -43,8 +43,8 @@ spring:
allow:
url-pattern: /druid/*
# 控制台管理用户名和密码
login-username: ruoyi
login-password: 123456
login-username:
login-password:
filter:
stat:
enabled: true
@@ -1,17 +1,17 @@
# 项目相关配置
ruoyi:
# 名称
name: supplier
name: RuoYi
# 版本
version: 2.0.0
version: 4.0.0
# 版权年份
copyrightYear: 2021
copyrightYear: 2019
# 实例演示开关
demoEnabled: true
# 文件路径 示例( Windows配置D:/ruoyi/uploadPath,Linux配置 /home/ruoyi/uploadPath)
profile: D:/ruoyi/uploadPath
profile: E:/ruoyi/uploadPath
# 获取ip地址开关
addressEnabled: false
addressEnabled: true
# 开发环境配置
server:
@@ -31,7 +31,7 @@ server:
# 日志配置
logging:
level:
co.yixiang: debug
com.ruoyi: debug
org.springframework: warn
# 用户配置
@@ -73,7 +73,7 @@ spring:
# MyBatis
mybatis:
# 搜索指定包别名
typeAliasesPackage: co.yixiang.**.domain
typeAliasesPackage: com.ruoyi
# 配置mapper的扫描,找到所有的mapper.xml映射文件
mapperLocations: classpath*:mapper/**/*Mapper.xml
# 加载全局的配置文件
@@ -109,7 +109,7 @@ shiro:
# 设置Cookie的过期时间,天为单位
maxAge: 30
session:
# Session超时时间,-1代表永不过期(默认30分钟)
# Session超时时间(默认30分钟)
expireTime: 30
# 同步session到数据库的周期(默认1分钟)
dbSyncPeriod: 1
@@ -128,8 +128,3 @@ xss:
excludes: /system/notice/*
# 匹配链接
urlPatterns: /system/*,/monitor/*,/tool/*
# Swagger配置
swagger:
# 是否开启swagger
enabled: true
@@ -0,0 +1,38 @@
<?xml version="1.0" encoding="UTF-8"?>
<ehcache name="ruoyi" updateCheck="false">
<!-- 磁盘缓存位置 -->
<diskStore path="java.io.tmpdir"/>
<!-- 默认缓存 -->
<defaultCache
maxEntriesLocalHeap="1000"
eternal="false"
timeToIdleSeconds="3600"
timeToLiveSeconds="3600"
overflowToDisk="false">
</defaultCache>
<!-- 登录记录缓存 锁定10分钟 -->
<cache name="loginRecordCache"
maxEntriesLocalHeap="2000"
eternal="false"
timeToIdleSeconds="600"
timeToLiveSeconds="0"
overflowToDisk="false"
statistics="true">
</cache>
<!-- 系统活跃用户缓存 -->
<cache name="sys-userCache"
maxEntriesLocalHeap="10000"
overflowToDisk="false"
eternal="false"
diskPersistent="false"
timeToLiveSeconds="0"
timeToIdleSeconds="0"
statistics="true">
</cache>
</ehcache>
@@ -72,7 +72,7 @@
</appender>
<!-- 系统模块日志级别控制 -->
<logger name="co.yixiang" level="info" />
<logger name="com.ruoyi" level="info" />
<!-- Spring日志级别控制 -->
<logger name="org.springframework" level="warn" />
@@ -0,0 +1,15 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE configuration
PUBLIC "-//mybatis.org//DTD Config 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-config.dtd">
<configuration>
<settings>
<setting name="cacheEnabled" value="true" /> <!-- 全局映射器启用缓存 -->
<setting name="useGeneratedKeys" value="true" /> <!-- 允许 JDBC 支持自动生成主键 -->
<setting name="defaultExecutorType" value="REUSE" /> <!-- 配置默认的执行器 -->
<setting name="logImpl" value="SLF4J" /> <!-- 指定 MyBatis 所用日志的具体实现 -->
<!-- <setting name="mapUnderscoreToCamelCase" value="true"/> 驼峰式命名 -->
</settings>
</configuration>
@@ -1,11 +1,11 @@
/*!
* bootstrap-fileinput v5.1.3
* bootstrap-fileinput v5.0.4
* http://plugins.krajee.com/file-input
*
* Krajee default styling for bootstrap-fileinput.
*
* Author: Kartik Visweswaran
* Copyright: 2014 - 2020, Kartik Visweswaran, Krajee.com
* Copyright: 2014 - 2019, Kartik Visweswaran, Krajee.com
*
* Licensed under the BSD-3-Clause
* https://github.com/kartik-v/bootstrap-fileinput/blob/master/LICENSE.md
@@ -60,9 +60,10 @@
height: 16px;
}
.file-thumb-progress .progress, .file-thumb-progress .progress-bar {
.krajee-default .file-thumb-progress .progress, .krajee-default .file-thumb-progress .progress-bar {
height: 11px;
font-family: Verdana, Helvetica, sans-serif;
font-size: 0.7rem;
font-size: 9px;
}
.krajee-default .file-thumb-progress .progress, .kv-upload-progress .progress {
@@ -200,16 +201,12 @@
.file-preview-image {
font: 40px Impact, Charcoal, sans-serif;
color: #008000;
width:auto;
height:auto;
max-width:100%;
max-height:100%;
}
.krajee-default.file-preview-frame {
margin: 8px;
border: 1px solid rgba(0, 0, 0, 0.2);
box-shadow: 0 0 10px 0 rgba(0, 0, 0, 0.2);
border: 1px solid rgba(0,0,0,0.2);
box-shadow: 0 0 10px 0 rgba(0,0,0,0.2);
padding: 6px;
float: left;
text-align: center;
@@ -240,19 +237,24 @@
}
.krajee-default.file-preview-frame:not(.file-preview-error):hover {
border: 1px solid rgba(0, 0, 0, 0.3);
box-shadow: 0 0 10px 0 rgba(0, 0, 0, 0.4);
border: 1px solid rgba(0,0,0,0.3);
box-shadow: 0 0 10px 0 rgba(0,0,0,0.4);
}
.krajee-default .file-preview-text {
display: block;
color: #428bca;
border: 1px solid #ddd;
font-family: Menlo, Monaco, Consolas, "Courier New", monospace;
outline: none;
padding: 8px;
resize: none;
}
.krajee-default .file-preview-html {
border: 1px solid #ddd;
padding: 8px;
overflow: auto;
}
.krajee-default .file-other-icon {
@@ -290,6 +292,7 @@
}
.krajee-default .file-thumb-progress {
height: 11px;
top: 37px;
left: 0;
right: 0;
@@ -337,13 +340,13 @@
.file-zoom-dialog .btn-navigate {
padding: 0;
margin: -60px 0 0;
font-size: 60px;
margin: 0;
background: transparent;
text-decoration: none;
outline: none;
opacity: 0.7;
top: 50%;
top: 45%;
font-size: 4em;
color: #1c94c4;
}
@@ -399,7 +402,6 @@
.file-drop-zone {
border: 1px dashed #aaa;
min-height: 260px;
border-radius: 4px;
text-align: center;
vertical-align: middle;
@@ -422,7 +424,6 @@
.file-drop-zone-title {
color: #aaa;
font-size: 1.6em;
text-align:center;
padding: 85px 10px;
cursor: default;
}
@@ -466,8 +467,8 @@
}
.file-zoom-content {
height: 480px;
text-align: center;
min-height: 300px;
}
.file-zoom-content .file-preview-image {
@@ -531,33 +532,19 @@
padding-right: 20px;
}
.clickable .file-drop-zone-title {
cursor: pointer;
.file-sortable .file-drag-handle {
cursor: move;
opacity: 1;
}
.file-sortable .file-drag-handle:hover {
opacity: 0.7;
}
.file-sortable .file-drag-handle {
cursor: grab;
opacity: 1;
.clickable .file-drop-zone-title {
cursor: pointer;
}
.file-grabbing, .file-grabbing * {
cursor: not-allowed !important;
}
.file-grabbing .file-preview-thumbnails * {
cursor: grabbing !important;
}
.file-preview-frame.sortable-chosen {
.file-preview-initial.sortable-chosen {
background-color: #d9edf7;
border-color: #17a2b8;
box-shadow: none !important;
}
.file-preview .kv-zoom-cache {
display: none;
}
@@ -0,0 +1,12 @@
/*!
* bootstrap-fileinput v5.0.4
* http://plugins.krajee.com/file-input
*
* Krajee default styling for bootstrap-fileinput.
*
* Author: Kartik Visweswaran
* Copyright: 2014 - 2019, Kartik Visweswaran, Krajee.com
*
* Licensed under the BSD-3-Clause
* https://github.com/kartik-v/bootstrap-fileinput/blob/master/LICENSE.md
*/.btn-file input[type=file],.file-caption-icon,.file-no-browse,.file-preview .fileinput-remove,.file-zoom-dialog .btn-navigate,.file-zoom-dialog .floating-buttons,.krajee-default .file-thumb-progress{position:absolute}.file-loading input[type=file],input[type=file].file-loading{width:0;height:0}.file-no-browse{left:50%;bottom:20%;width:1px;height:1px;font-size:0;opacity:0;border:none;background:0 0;outline:0;box-shadow:none}.file-caption-icon,.file-input-ajax-new .fileinput-remove-button,.file-input-ajax-new .fileinput-upload-button,.file-input-ajax-new .no-browse .input-group-btn,.file-input-new .close,.file-input-new .file-preview,.file-input-new .fileinput-remove-button,.file-input-new .fileinput-upload-button,.file-input-new .glyphicon-file,.file-input-new .no-browse .input-group-btn,.file-zoom-dialog .modal-header:after,.file-zoom-dialog .modal-header:before,.hide-content .kv-file-content,.is-locked .fileinput-remove-button,.is-locked .fileinput-upload-button,.kv-hidden{display:none}.file-caption-icon .kv-caption-icon{line-height:inherit}.btn-file,.file-caption,.file-input,.file-loading:before,.file-preview,.file-zoom-dialog .modal-dialog,.krajee-default .file-thumbnail-footer,.krajee-default.file-preview-frame{position:relative}.file-error-message pre,.file-error-message ul,.krajee-default .file-actions,.krajee-default .file-other-error{text-align:left}.file-error-message pre,.file-error-message ul{margin:0}.krajee-default .file-drag-handle,.krajee-default .file-upload-indicator{float:left;margin-top:10px;width:16px;height:16px}.krajee-default .file-thumb-progress .progress,.krajee-default .file-thumb-progress .progress-bar{height:11px;font-family:Verdana,Helvetica,sans-serif;font-size:9px}.krajee-default .file-thumb-progress .progress,.kv-upload-progress .progress{background-color:#ccc}.krajee-default .file-caption-info,.krajee-default .file-size-info{display:block;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;width:160px;height:15px;margin:auto}.file-zoom-content>.file-object.type-flash,.file-zoom-content>.file-object.type-image,.file-zoom-content>.file-object.type-video{max-width:100%;max-height:100%;width:auto}.file-zoom-content>.file-object.type-flash,.file-zoom-content>.file-object.type-video{height:100%}.file-zoom-content>.file-object.type-default,.file-zoom-content>.file-object.type-html,.file-zoom-content>.file-object.type-pdf,.file-zoom-content>.file-object.type-text{width:100%}.file-loading:before{content:" Loading...";display:inline-block;padding-left:20px;line-height:16px;font-size:13px;font-variant:small-caps;color:#999;background:url(loading.gif) top left no-repeat}.file-object{margin:0 0 -5px;padding:0}.btn-file{overflow:hidden}.btn-file input[type=file]{top:0;left:0;min-width:100%;min-height:100%;text-align:right;opacity:0;background:none;cursor:inherit;display:block}.btn-file ::-ms-browse{font-size:10000px;width:100%;height:100%}.file-caption .file-caption-name{width:100%;margin:0;padding:0;box-shadow:none;border:none;background:0 0;outline:0}.file-caption.icon-visible .file-caption-icon{display:inline-block}.file-caption.icon-visible .file-caption-name{padding-left:15px}.file-caption-icon{left:8px}.file-error-message{color:#a94442;background-color:#f2dede;margin:5px;border:1px solid #ebccd1;border-radius:4px;padding:15px}.file-error-message pre{margin:5px 0}.file-caption-disabled{background-color:#eee;cursor:not-allowed;opacity:1}.file-preview{border-radius:5px;border:1px solid #ddd;padding:8px;width:100%;margin-bottom:5px}.file-preview .btn-xs{padding:1px 5px;font-size:12px;line-height:1.5;border-radius:3px}.file-preview .fileinput-remove{top:1px;right:1px;line-height:10px}.file-preview .clickable{cursor:pointer}.file-preview-image{font:40px Impact,Charcoal,sans-serif;color:green}.krajee-default.file-preview-frame{margin:8px;border:1px solid rgba(0,0,0,.2);box-shadow:0 0 10px 0 rgba(0,0,0,.2);padding:6px;float:left;text-align:center}.krajee-default.file-preview-frame .kv-file-content{width:213px;height:160px}.krajee-default .file-preview-other-frame{display:flex;align-items:center;justify-content:center}.krajee-default.file-preview-frame .kv-file-content.kv-pdf-rendered{width:400px}.krajee-default.file-preview-frame[data-template=audio] .kv-file-content{width:240px;height:55px}.krajee-default.file-preview-frame .file-thumbnail-footer{height:70px}.krajee-default.file-preview-frame:not(.file-preview-error):hover{border:1px solid rgba(0,0,0,.3);box-shadow:0 0 10px 0 rgba(0,0,0,.4)}.krajee-default .file-preview-text{display:block;color:#428bca;border:1px solid #ddd;font-family:Menlo,Monaco,Consolas,"Courier New",monospace;outline:0;padding:8px;resize:none}.krajee-default .file-preview-html{border:1px solid #ddd;padding:8px;overflow:auto}.krajee-default .file-other-icon{font-size:6em;line-height:1}.krajee-default .file-footer-buttons{float:right}.krajee-default .file-footer-caption{display:block;text-align:center;padding-top:4px;font-size:11px;color:#777;margin-bottom:30pLine truncated
@@ -0,0 +1,10 @@
/*!
bootstrap-fileinput v5.0.4
http://plugins.krajee.com/file-input
Author: Kartik Visweswaran
Copyright: 2014 - 2019, Kartik Visweswaran, Krajee.com
Licensed under the BSD-3-Clause
https://github.com/kartik-v/bootstrap-fileinput/blob/master/LICENSE.md
*/(function(factory){'use strict';if(typeof define==='function'&&define.amd){define(['jquery'],factory);}else{if(typeof module==='object'&&module.exports){module.exports=factory(require('jquery'));}else{factory(window.jQuery);}}}(function($){'use strict';$.fn.fileinputLocales={};$.fn.fileinputThemes={};String.prototype.setTokens=function(replacePairs){var str=this.toString(),key,re;for(key in replacePairs){if(replacePairs.hasOwnProperty(key)){re=new RegExp('\{'+key+'\}','g');str=str.replace(re,replacePairs[key]);}}return str;};var $h,FileInput;$h={FRAMES:'.kv-preview-thumb',SORT_CSS:'file-sortable',OBJECT_PARAMS:'<param name="controller" value="true" />\n'+'<param name="allowFullScreen" value="true" />\n'+'<param name="allowScriptAccess" value="always" />\n'+'<param name="autoPlay" value="false" />\n'+'<param name="autoStart" value="false" />\n'+'<param name="quality" value="high" />\n',DEFAULT_PREVIEW:'<div class="file-preview-other">\n'+'<span class="{previewFileIconClass}">{previewFileIcon}</span>\n'+'</div>',MODAL_ID:'kvFileinputModal',MODAL_EVENTS:['show','shown','hide','hidden','loaded'],logMessages:{ajaxError:'{status}: {error}. Error Details: {text}.',badDroppedFiles:'Error scanning dropped files!',badExifParser:'Error loading the piexif.js library. {details}',badInputType:'The input "type" must be set to "file" for initializing the "bootstrap-fileinput" plugin.',exifWarning:'To avoid this warning, either set "autoOrientImage" to "false" OR ensure you have loaded '+'the "piexif.js" library correctly on your page before the "fileinput.js" script.',invalidChunkSize:'Invalid upload chunk size: "{chunkSize}". Resumable uploads are disabled.',invalidThumb:'Invalid thumb frame with id: "{id}".',noResumableSupport:'The browser does not support resumable or chunk uploads.',noUploadUrl:'The "uploadUrl" is not set. Ajax uploads and resumable uploads have been disabled.',retryStatus:'Retrying upload for chunk # {chunk} for {filename}... retry # {retry}.'},objUrl:window.URL||window.webkitURL,now:function(){return new Date();},round:function(num){num=parseFloat(num);return isNaN(num)?0:Math.floor(Math.round(num));},getFileRelativePath:function(file){return String(file.relativePath||file.webkitRelativePath||$h.getFileName(file)||null);},getFileId:function(file,generateFileId){var relativePath=$h.getFileRelativePath(file);if(typeof generateFileId==='function'){return generateFileId(file);}if(!file){return null;}if(!relativePath){return null;}return(file.size+'_'+relativePath.replace(/\s/img,'_'));},getElapsed:function(seconds){var delta=seconds,out='',result={},structure={year:31536000,month:2592000,week:604800,day:86400,hour:3600,minute:60,second:1};Object.keys(structure).forEach(function(key){result[key]=Math.floor(delta/structure[key]);delta-=result[key]*structure[key];});$.each(result,function(key,value){if(value>0){out+=(out?' ':'')+value+key.substring(0,1);}});return out;},debounce:function(func,delay){var inDebounce;return function(){var args=arguments,context=this;clearTimeout(inDebounce);inDebounce=setTimeout(function(){func.apply(context,args);},delay);};},stopEvent:function(e){e.stopPropagation();e.preventDefault();},getFileName:function(file){return file?(file.fileName||file.name||''):'';},createObjectURL:function(data){if($h.objUrl&&$h.objUrl.createObjectURL&&data){return $h.objUrl.createObjectURL(data);}return'';},revokeObjectURL:function(data){if($h.objUrl&&$h.objUrl.revokeObjectURL&&data){$h.objUrl.revokeObjectURL(data);}},compare:function(input,str,exact){return input!==undefined&&(exact?input===str:input.match(str));},isIE:function(ver){var div,status;if(navigator.appName!=='Microsoft Internet Explorer'){return false;}if(ver===10){return new RegExp('msie\\s'+ver,'i').test(navigator.userAgent);}div=document.createElement('div');div.innerHTML='<!--[if IE '+ver+']> <i></i> <![endif]-->';status=div.getElementsByTagName('i').length;document.body.appendChild(div);div.parentNode.removeChild(div);return status;},canAssignFilesToInput:function(){var input=document.createElement('input');try{input.type='file';input.files=null;return true;}catch(err){return false;}},getDragDropFolders:function(items){var i,item,len=items?items.length:0,folders=0;if(len>0&&items[0].webkitGetAsEntry()){for(i=0;i<len;i++){item=items[i].webkitGetAsEntry();if(item&&item.isDirectory){folders++;}}}return folders;},initModal:function($modal){var $body=$('body');if($body.length){$modal.appendTo($body);}},isEmpty:function(value,trim){return value===undefined||value===null||value.length===0||(trim&&$.trim(value)==='');},isArray:function(a){return Array.isArray(a)||Object.prototype.toString.call(a)==='[object Array]';},ifSet:function(needle,haystack,def){def=def||'';return(haystack&&typeof haystack==='object'&&needle in haystack)?haystack[needle]:def;},cleanArray:function(arr){if(!(arr instanceof Array)){arr=[];}return arr.filter(function(e){return(e!==undefined&&e!==null);});},spliceArray:function(arr,index,reverseOrder){var i,j=0,oLine truncated
@@ -0,0 +1 @@
.fixed-table-container .bs-checkbox,.fixed-table-container .no-records-found{text-align:center}.fixed-table-body thead th .th-inner,.table td,.table th{box-sizing:border-box}.bootstrap-table .table{margin-bottom:0!important;border-bottom:1px solid #ddd;border-collapse:collapse!important;border-radius:1px}.bootstrap-table .table:not(.table-condensed),.bootstrap-table .table:not(.table-condensed)>tbody>tr>td,.bootstrap-table .table:not(.table-condensed)>tbody>tr>th,.bootstrap-table .table:not(.table-condensed)>tfoot>tr>td,.bootstrap-table .table:not(.table-condensed)>tfoot>tr>th,.bootstrap-table .table:not(.table-condensed)>thead>tr>td{padding:8px}.bootstrap-table .table.table-no-bordered>tbody>tr>td,.bootstrap-table .table.table-no-bordered>thead>tr>th{border-right:2px solid transparent}.bootstrap-table .table.table-no-bordered>tbody>tr>td:last-child{border-right:none}.fixed-table-container{position:relative;clear:both;border:1px solid #ddd;border-radius:4px;-webkit-border-radius:4px;-moz-border-radius:4px}.fixed-table-container.table-no-bordered{border:1px solid transparent}.fixed-table-footer,.fixed-table-header{overflow:hidden}.fixed-table-footer{border-top:1px solid #ddd}.fixed-table-body{overflow-x:auto;overflow-y:auto;height:100%}.fixed-table-container table{width:100%}.fixed-table-container thead th{height:0;padding:0;margin:0;border-left:1px solid #ddd}.fixed-table-container thead th:focus{outline:transparent solid 0}.fixed-table-container thead th:first-child{border-left:none;border-top-left-radius:4px;-webkit-border-top-left-radius:4px;-moz-border-radius-topleft:4px}.fixed-table-container tbody td .th-inner,.fixed-table-container thead th .th-inner{padding:8px;line-height:24px;vertical-align:top;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.fixed-table-container thead th .sortable{cursor:pointer;background-position:right;background-repeat:no-repeat;padding-right:30px}.fixed-table-container thead th .both{background-image:url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABMAAAATCAQAAADYWf5HAAAAkElEQVQoz7X QMQ5AQBCF4dWQSJxC5wwax1Cq1e7BAdxD5SL+Tq/QCM1oNiJidwox0355mXnG/DrEtIQ6azioNZQxI0ykPhTQIwhCR+BmBYtlK7kLJYwWCcJA9M4qdrZrd8pPjZWPtOqdRQy320YSV17OatFC4euts6z39GYMKRPCTKY9UnPQ6P+GtMRfGtPnBCiqhAeJPmkqAAAAAElFTkSuQmCC')}.fixed-table-container thead th .asc{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABMAAAATCAYAAAByUDbMAAAAZ0lEQVQ4y2NgGLKgquEuFxBPAGI2ahhWCsS/gDibUoO0gPgxEP8H4ttArEyuQYxAPBdqEAxPBImTY5gjEL9DM+wTENuQahAvEO9DMwiGdwAxOymGJQLxTyD+jgWDxCMZRsEoGAVoAADeemwtPcZI2wAAAABJRU5ErkJggg==)}.fixed-table-container thead th .desc{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABMAAAATCAYAAAByUDbMAAAAZUlEQVQ4y2NgGAWjYBSggaqGu5FA/BOIv2PBIPFEUgxjB+IdQPwfC94HxLykus4GiD+hGfQOiB3J8SojEE9EM2wuSJzcsFMG4ttQgx4DsRalkZENxL+AuJQaMcsGxBOAmGvopk8AVz1sLZgg0bsAAAAASUVORK5CYII=)}.fixed-table-container th.detail{width:30px}.fixed-table-container tbody td{border-left:1px solid #ddd}.fixed-table-container tbody tr:first-child td{border-top:none}.fixed-table-container tbody td:first-child{border-left:none}.fixed-table-container tbody .selected td{background-color:#f5f5f5}.fixed-table-container .bs-checkbox .th-inner{padding:8px 0}.fixed-table-container input[type=radio],.fixed-table-container input[type=checkbox]{margin:0 auto!important}.fixed-table-pagination .pagination-detail,.fixed-table-pagination div.pagination{margin-top:10px;margin-bottom:10px}.fixed-table-pagination div.pagination .pagination{margin:0}.fixed-table-pagination .pagination a{padding:6px 12px;line-height:1.428571429}.fixed-table-pagination .pagination-info{line-height:34px;margin-right:5px}.fixed-table-pagination .btn-group{position:relative;display:inline-block;vertical-align:middle}.fixed-table-pagination .dropup .dropdown-menu{margin-bottom:0}.fixed-table-pagination .page-list{display:inline-block}.fixed-table-toolbar .columns-left{margin-right:5px}.fixed-table-toolbar .columns-right{margin-left:5px}.fixed-table-toolbar .columns label{display:block;padding:3px 20px;clear:both;font-weight:400;line-height:1.428571429}.fixed-table-toolbar .bs-bars,.fixed-table-toolbar .columns,.fixed-table-toolbar .search{position:relative;margin-top:10px;margin-bottom:10px;line-height:34px}.fixed-table-pagination li.disabled a{pointer-events:none;cursor:default}.fixed-table-loading{display:none;position:absolute;top:42px;right:0;bottom:0;left:0;z-index:99;background-color:#fff;text-align:center}.fixed-table-body .card-view .title{font-weight:700;display:inline-block;min-width:30%;text-align:left!important}.table td,.table th{vertical-align:middle}.fixed-table-toolbar .dropdown-menu{text-align:left;max-height:300px;overflow:auto}.fixed-table-toolbar .btn-group>.btn-group{display:inline-block;margin-left:-1px!important}.fixed-table-toolbar .btn-group>.btn-group>.btn{border-radius:0}.fixed-table-toolbar .btn-group>.btn-group:first-child>.btn{border-top-left-radius:4px;border-bottom-left-radius:4px}.fixed-table-toolbar Line truncated
@@ -0,0 +1,7 @@
/**
* @author zhixin wen <wenzhixin2010@gmail.com>
* version: 1.11.0
* https://github.com/wenzhixin/bootstrap-table/
*/
(function(j){var k=null;var m=function(u){var s=arguments,r=true,t=1;u=u.replace(/%s/g,function(){var v=s[t++];if(typeof v==="undefined"){r=false;return""}return v});return r?u:""};var c=function(t,v,u,s){var r="";j.each(t,function(w,x){if(x[v]===s){r=x[u];return false}return true});return r};var i=function(s,t){var r=-1;j.each(s,function(u,v){if(v.field===t){r=u;return false}return true});return r};var l=function(u){var y,x,w,A=0,B=[];for(y=0;y<u[0].length;y++){A+=u[0][y].colspan||1}for(y=0;y<u.length;y++){B[y]=[];for(x=0;x<A;x++){B[y][x]=false}}for(y=0;y<u.length;y++){for(x=0;x<u[y].length;x++){var s=u[y][x],v=s.rowspan||1,t=s.colspan||1,z=j.inArray(false,B[y]);if(t===1){s.fieldIndex=z;if(typeof s.field==="undefined"){s.field=z}}for(w=0;w<v;w++){B[y+w][z]=true}for(w=0;w<t;w++){B[y][z+w]=true}}}};var a=function(){if(k===null){var t=j("<p/>").addClass("fixed-table-scroll-inner"),u=j("<div/>").addClass("fixed-table-scroll-outer"),s,r;u.append(t);j("body").append(u);s=t[0].offsetWidth;u.css("overflow","scroll");r=t[0].offsetWidth;if(s===r){r=u[0].clientWidth}u.remove();k=s-r}return k};var q=function(s,u,t,r){var v=u;if(typeof u==="string"){var w=u.split(".");if(w.length>1){v=window;j.each(w,function(x,y){v=v[y]})}else{v=window[u]}}if(typeof v==="object"){return v}if(typeof v==="function"){return v.apply(s,t)}if(!v&&typeof u==="string"&&m.apply(this,[u].concat(t))){return m.apply(this,[u].concat(t))}return r};var f=function(s,r,w){var x=Object.getOwnPropertyNames(s),u=Object.getOwnPropertyNames(r),v="";if(w){if(x.length!==u.length){return false}}for(var t=0;t<x.length;t++){v=x[t];if(j.inArray(v,u)>-1){if(s[v]!==r[v]){return false}}}return true};var p=function(r){if(typeof r==="string"){return r.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#039;").replace(/`/g,"&#x60;")}return r};var d=function(s){var r=0;s.children().each(function(){if(r<j(this).outerHeight(true)){r=j(this).outerHeight(true)}});return r};var g=function(t){for(var r in t){var s=r.split(/(?=[A-Z])/).join("-").toLowerCase();if(s!==r){t[s]=t[r];delete t[r]}}return t};var o=function(t,w,s){var u=t;if(typeof w!=="string"||t.hasOwnProperty(w)){return s?p(t[w]):t[w]}var r=w.split(".");for(var v in r){u=u&&u[r[v]]}return s?p(u):u};var b=function(){return !!(navigator.userAgent.indexOf("MSIE ")>0||!!navigator.userAgent.match(/Trident.*rv\:11\./))};var h=function(){if(!Object.keys){Object.keys=(function(){var t=Object.prototype.hasOwnProperty,u=!({toString:null}).propertyIsEnumerable("toString"),s=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],r=s.length;return function(x){if(typeof x!=="object"&&(typeof x!=="function"||x===null)){throw new TypeError("Object.keys called on non-object")}var v=[],y,w;for(y in x){if(t.call(x,y)){v.push(y)}}if(u){for(w=0;w<r;w++){if(t.call(x,s[w])){v.push(s[w])}}}return v}}())}};var e=function(s,r){this.options=r;this.$el=j(s);this.$el_=this.$el.clone();this.timeoutId_=0;this.timeoutFooter_=0;this.init()};e.DEFAULTS={classes:"table table-hover",locale:undefined,height:undefined,undefinedText:"-",sortName:undefined,sortOrder:"asc",sortStable:false,striped:false,columns:[[]],data:[],dataField:"rows",method:"get",url:undefined,ajax:undefined,cache:true,contentType:"application/json",dataType:"json",ajaxOptions:{},queryParams:function(r){return r},queryParamsType:"limit",responseHandler:function(r){return r},pagination:false,onlyInfoPagination:false,sidePagination:"client",totalRows:0,pageNumber:1,pageSize:10,pageList:[10,25,50,100],paginationHAlign:"right",paginationVAlign:"bottom",paginationDetailHAlign:"left",paginationPreText:"&lsaquo;",paginationNextText:"&rsaquo;",search:false,searchOnEnterKey:false,strictSearch:false,searchAlign:"right",selectItemName:"btSelectItem",showHeader:true,showFooter:false,showColumns:false,showSearch:false,showPageGo:false,showPaginationSwitch:false,showRefresh:false,showToggle:false,buttonsAlign:"right",smartDisplay:true,escape:false,firstLoad:true,minimumCountColumns:1,idField:undefined,uniqueId:undefined,cardView:false,detailView:false,detailFormatter:function(r,s){return""},trimOnSearch:true,clickToSelect:false,singleSelect:false,toolbar:undefined,toolbarAlign:"left",checkboxHeader:true,sortable:true,silentSort:true,maintainSelected:false,searchTimeOut:500,searchText:"",iconSize:undefined,buttonsClass:"default",iconsPrefix:"glyphicon",icons:{search:"glyphicon-search",paginationSwitchDown:"glyphicon-collapse-down icon-chevron-down",paginationSwitchUp:"glyphicon-collapse-up icon-chevron-up",refresh:"glyphicon-refresh icon-refresh",toggle:"glyphicon-list-alt icon-list-alt",columns:"glyphicon-th icon-th",detailOpen:"glyphicon-plus icon-plus",detailClose:"glyphicon-minus icon-minus"},customSearch:j.noop,customSort:j.noop,rowStyle:function(s,r){return{}},rowAttributes:function(s,r){return{}},footerStyle:function(s,r){return{}},onAll:function(s,r){return false},onClickCell:functiLine truncated
this.data[r][this.header.stateField]=t;this.updateSelected();this.trigger(t?"check":"uncheck",this.data[r],s)};e.prototype.checkBy=function(r){this.checkBy_(true,r)};e.prototype.uncheckBy=function(r){this.checkBy_(false,r)};e.prototype.checkBy_=function(s,u){if(!u.hasOwnProperty("field")||!u.hasOwnProperty("values")){return}var r=this,t=[];j.each(this.options.data,function(v,x){if(!x.hasOwnProperty(u.field)){return false}if(j.inArray(x[u.field],u.values)!==-1){var w=r.$selectItem.filter(":enabled").filter(m('[data-index="%s"]',v)).prop("checked",s);x[r.header.stateField]=s;t.push(x);r.trigger(s?"check":"uncheck",x,w)}});this.updateSelected();this.trigger(s?"check-some":"uncheck-some",t)};e.prototype.destroy=function(){this.$el.insertBefore(this.$container);j(this.options.toolbar).insertBefore(this.$el);this.$container.next().remove();this.$container.remove();this.$el.html(this.$el_.html()).css("margin-top","0").attr("class",this.$el_.attr("class")||"")};e.prototype.showLoading=function(){this.$tableLoading.show()};e.prototype.hideLoading=function(){this.$tableLoading.hide()};e.prototype.togglePagination=function(){this.options.pagination=!this.options.pagination;var r=this.$toolbar.find('button[name="paginationSwitch"] i');if(this.options.pagination){r.attr("class",this.options.iconsPrefix+" "+this.options.icons.paginationSwitchDown)}else{r.attr("class",this.options.iconsPrefix+" "+this.options.icons.paginationSwitchUp)}this.updatePagination()};e.prototype.refresh=function(r){if(r&&r.url){this.options.pageNumber=1}if(selectionIds.length>0){selectionIds=[]}this.initServer(r&&r.silent,r&&r.query,r&&r.url);this.trigger("refresh",r)};e.prototype.resetWidth=function(){if(this.options.showHeader&&this.options.height){this.fitHeader()}if(this.options.showFooter){this.fitFooter()}};e.prototype.showColumn=function(r){this.toggleColumn(i(this.columns,r),true,true)};e.prototype.hideColumn=function(r){this.toggleColumn(i(this.columns,r),false,true)};e.prototype.getHiddenColumns=function(){return j.grep(this.columns,function(r){return !r.visible})};e.prototype.getVisibleColumns=function(){return j.grep(this.columns,function(r){return r.visible})};e.prototype.toggleAllColumns=function(r){j.each(this.columns,function(t,u){this.columns[t].visible=r});this.initHeader();this.initSearch();this.initPagination();this.initBody();if(this.options.showColumns){var s=this.$toolbar.find(".keep-open input").prop("disabled",false);if(s.filter(":checked").length<=this.options.minimumCountColumns){s.filter(":checked").prop("disabled",true)}}};e.prototype.showAllColumns=function(){this.toggleAllColumns(true)};e.prototype.hideAllColumns=function(){this.toggleAllColumns(false)};e.prototype.filterBy=function(r){this.filterColumns=j.isEmptyObject(r)?{}:r;this.options.pageNumber=1;this.initSearch();this.updatePagination()};e.prototype.scrollTo=function(r){if(typeof r==="string"){r=r==="bottom"?this.$tableBody[0].scrollHeight:0}if(typeof r==="number"){this.$tableBody.scrollTop(r)}if(typeof r==="undefined"){return this.$tableBody.scrollTop()}};e.prototype.getScrollPosition=function(){return this.scrollTo()};e.prototype.selectPage=function(r){if(r>0&&r<=this.options.totalPages){this.options.pageNumber=r;this.updatePagination()}};e.prototype.prevPage=function(){if(this.options.pageNumber>1){this.options.pageNumber--;this.updatePagination()}};e.prototype.nextPage=function(){if(this.options.pageNumber<this.options.totalPages){this.options.pageNumber++;this.updatePagination()}};e.prototype.toggleView=function(){this.options.cardView=!this.options.cardView;this.initHeader();this.initBody();this.trigger("toggle",this.options.cardView)};e.prototype.refreshOptions=function(r){if(f(this.options,r,true)){return}this.options=j.extend(this.options,r);this.trigger("refresh-options",this.options);this.destroy();this.init()};e.prototype.resetSearch=function(s){var r=this.$toolbar.find(".search input");r.val(s||"");this.onSearch({currentTarget:r})};e.prototype.expandRow_=function(s,r){var t=this.$body.find(m('> tr[data-index="%s"]',r));if(t.next().is("tr.detail-view")===(s?false:true)){t.find("> td > .detail-icon").click()}};e.prototype.expandRow=function(r){this.expandRow_(true,r)};e.prototype.collapseRow=function(r){this.expandRow_(false,r)};e.prototype.expandAllRows=function(r){if(r){var w=this.$body.find(m('> tr[data-index="%s"]',0)),x=this,u=null,v=false,s=-1;if(!w.next().is("tr.detail-view")){w.find("> td > .detail-icon").click();v=true}else{if(!w.next().next().is("tr.detail-view")){w.next().find(".detail-icon").click();v=true}}if(v){try{s=setInterval(function(){u=x.$body.find("tr.detail-view").last().find(".detail-icon");if(u.length>0){u.click()}else{clearInterval(s)}},1)}catch(z){clearInterval(s)}}}else{var y=this.$body.children();for(var t=0;t<y.length;t++){this.expandRow_(true,j(y[t]).data("index"))}}};e.prototype.collapseAllRows=function(s){if(s){this.expandRow_(false,0)}else{var r=this.$body.children();for(var t=0;t<r.length;t++){this.expandRow_(falLine truncated
@@ -0,0 +1,297 @@
/**
* 基于bootstrap-table-fixed-columns修改
* 支持左右列冻结、支持固定高度
* Copyright (c) 2019 ruoyi
*/
(function ($) {
'use strict';
$.extend($.fn.bootstrapTable.defaults, {
fixedColumns: false,
fixedNumber: 1,
rightFixedColumns: false,
rightFixedNumber: 1
});
var BootstrapTable = $.fn.bootstrapTable.Constructor,
_initHeader = BootstrapTable.prototype.initHeader,
_initBody = BootstrapTable.prototype.initBody,
_resetView = BootstrapTable.prototype.resetView;
BootstrapTable.prototype.initFixedColumns = function () {
this.timeoutHeaderColumns_ = 0;
this.timeoutBodyColumns_ = 0;
if (this.options.fixedColumns) {
this.$fixedHeader = $([
'<div class="left-fixed-table-columns">',
'<table>',
'<thead></thead>',
'</table>',
'</div>'].join(''));
this.$fixedHeader.find('table').attr('class', this.$el.attr('class'));
this.$fixedHeaderColumns = this.$fixedHeader.find('thead');
this.$tableHeader.before(this.$fixedHeader);
this.$fixedBody = $([
'<div class="left-fixed-body-columns">',
'<table>',
'<tbody></tbody>',
'</table>',
'</div>'].join(''));
this.$fixedBody.find('table').attr('class', this.$el.attr('class'));
this.$fixedBodyColumns = this.$fixedBody.find('tbody');
this.$tableBody.before(this.$fixedBody);
}
if (this.options.rightFixedColumns) {
this.$rightfixedBody = $([
'<div class="right-fixed-table-columns">',
'<table>',
'<thead></thead>',
'<tbody style="background-color: #fff;"></tbody>',
'</table>',
'</div>'].join(''));
this.$rightfixedBody.find('table').attr('class', this.$el.attr('class'));
this.$rightfixedHeaderColumns = this.$rightfixedBody.find('thead');
this.$rightfixedBodyColumns = this.$rightfixedBody.find('tbody');
this.$tableBody.before(this.$rightfixedBody);
if (this.options.fixedColumns) {
$('.right-fixed-table-columns').attr('style','right:0px');
}
}
};
BootstrapTable.prototype.initHeader = function () {
_initHeader.apply(this, Array.prototype.slice.apply(arguments));
if (!this.options.fixedColumns && !this.options.rightFixedColumns){
return;
}
this.initFixedColumns();
var $ltr = this.$header.find('tr:eq(0)').clone(true),
$rtr = this.$header.find('tr:eq(0)').clone(),
$lths = $ltr.clone(true).find('th'),
$rths = $rtr.clone().find('th');
$ltr.html('');
$rtr.html('');
//右边列冻结
if (this.options.rightFixedColumns) {
for (var i = 0; i < this.options.rightFixedNumber; i++) {
$rtr.append($rths.eq($rths.length - this.options.rightFixedNumber + i).clone());
}
this.$rightfixedHeaderColumns.html('').append($rtr);
}
//左边列冻结
if (this.options.fixedColumns) {
for (var i = 0; i < this.options.fixedNumber; i++) {
$ltr.append($lths.eq(i).clone(true));
}
this.$fixedHeaderColumns.html('').append($ltr);
this.$selectAll = $ltr.find('[name="btSelectAll"]');
this.$selectAll.on('click', function () {
var checked = $(this).prop('checked');
$(".left-fixed-body-columns input[name=btSelectItem]").filter(':enabled').prop('checked', checked);
$('.fixed-table-body input[name=btSelectItem]').closest('tr').removeClass('selected');
});
}
};
BootstrapTable.prototype.initBody = function () {
_initBody.apply(this, Array.prototype.slice.apply(arguments));
if (!this.options.fixedColumns && !this.options.rightFixedColumns) {
return;
}
var that = this;
if (this.options.fixedColumns) {
this.$fixedBodyColumns.html('');
this.$body.find('> tr[data-index]').each(function () {
var $tr = $(this).clone(true),
$tds = $tr.clone(true).find('td');
$tr.html('');
for (var i = 0; i < that.options.fixedNumber; i++) {
$tr.append($tds.eq(i).clone(true));
}
that.$fixedBodyColumns.append($tr);
});
}
if (this.options.rightFixedColumns) {
this.$rightfixedBodyColumns.html('');
this.$body.find('> tr[data-index]').each(function () {
var $tr = $(this).clone(),
$tds = $tr.clone().find('td');
$tr.html('');
for (var i = 0; i < that.options.rightFixedNumber; i++) {
var indexTd = $tds.length - that.options.rightFixedNumber + i;
var oldTd = $tds.eq(indexTd);
var fixTd = oldTd.clone();
var buttons = fixTd.find('button');
//事件转移:冻结列里面的事件转移到实际按钮的事件
buttons.each(function (key, item) {
$(item).click(function () {
that.$body.find("tr[data-index=" + $tr.attr('data-index') + "] td:eq(" + indexTd + ") button:eq(" + key + ")").click();
});
});
$tr.append(fixTd);
}
that.$rightfixedBodyColumns.append($tr);
});
}
};
BootstrapTable.prototype.resetView = function () {
_resetView.apply(this, Array.prototype.slice.apply(arguments));
if (!this.options.fixedColumns && !this.options.rightFixedColumns) {
return;
}
clearTimeout(this.timeoutHeaderColumns_);
this.timeoutHeaderColumns_ = setTimeout($.proxy(this.fitHeaderColumns, this), this.$el.is(':hidden') ? 100 : 0);
clearTimeout(this.timeoutBodyColumns_);
this.timeoutBodyColumns_ = setTimeout($.proxy(this.fitBodyColumns, this), this.$el.is(':hidden') ? 100 : 0);
};
BootstrapTable.prototype.fitHeaderColumns = function () {
var that = this,
visibleFields = this.getVisibleFields(),
headerWidth = 0;
if (that.options.fixedColumns) {
this.$body.find('tr:first-child:not(.no-records-found) > *').each(function (i) {
var $this = $(this),
index = i;
if (i >= that.options.fixedNumber) {
return false;
}
if (that.options.detailView && !that.options.cardView) {
index = i - 1;
}
that.$fixedHeader.find('thead th[data-field="' + visibleFields[index] + '"]')
.find('.fht-cell').width($this.innerWidth());
headerWidth += $this.outerWidth();
});
this.$fixedHeader.width(headerWidth + 2).show();
}
if (that.options.rightFixedColumns) {
this.$body.find('tr:first-child:not(.no-records-found) > *').each(function (i) {
var $this = $(this),
index = i;
if (i >= visibleFields.length - that.options.rightFixedNumber) {
return false;
if (that.options.detailView && !that.options.cardView) {
index = i - 1;
}
that.$rightfixedBody.find('thead th[data-field="' + visibleFields[index] + '"]')
.find('.fht-cell').width($this.innerWidth() - 1);
headerWidth += $this.outerWidth();
}
});
this.$rightfixedBody.width(headerWidth - 1).show();
}
};
BootstrapTable.prototype.fitBodyColumns = function () {
var that = this,
top = -(parseInt(this.$el.css('margin-top'))),
height = this.$tableBody.height();
if (that.options.fixedColumns) {
if (!this.$body.find('> tr[data-index]').length) {
this.$fixedBody.hide();
return;
}
if (!this.options.height) {
top = this.$fixedHeader.height()- 1;
height = height - top;
}
this.$fixedBody.css({
width: this.$fixedHeader.width(),
height: height,
top: top + 1
}).show();
this.$body.find('> tr').each(function (i) {
that.$fixedBody.find('tr:eq(' + i + ')').height($(this).height() - 0.5);
var thattds = this;
that.$fixedBody.find('tr:eq(' + i + ')').find('td').each(function (j) {
$(this).width($($(thattds).find('td')[j]).width() + 1);
});
});
$.btTable.on("check.bs.table uncheck.bs.table", function (e, rows, $element) {
var index= $element.data('index');
$(this).find('.bs-checkbox').find('input[data-index="' + index + '"]').prop("checked", true);
var selectFixedItem = $('.left-fixed-body-columns input[name=btSelectItem]');
var checkAll = selectFixedItem.filter(':enabled').length &&
selectFixedItem.filter(':enabled').length ===
selectFixedItem.filter(':enabled').filter(':checked').length;
$(".left-fixed-table-columns input[name=btSelectAll]").prop('checked', checkAll);
$('.fixed-table-body input[name=btSelectItem]').closest('tr').removeClass('selected');
});
//// events
this.$tableBody.on('scroll', function () {
that.$fixedBody.find('table').css('top', -$(this).scrollTop());
});
this.$body.find('> tr[data-index]').off('hover').hover(function () {
var index = $(this).data('index');
that.$fixedBody.find('tr[data-index="' + index + '"]').addClass('hover');
}, function () {
var index = $(this).data('index');
that.$fixedBody.find('tr[data-index="' + index + '"]').removeClass('hover');
});
this.$fixedBody.find('tr[data-index]').off('hover').hover(function () {
var index = $(this).data('index');
that.$body.find('tr[data-index="' + index + '"]').addClass('hover');
}, function () {
var index = $(this).data('index');
that.$body.find('> tr[data-index="' + index + '"]').removeClass('hover');
});
}
if (that.options.rightFixedColumns) {
if (!this.$body.find('> tr[data-index]').length) {
this.$rightfixedBody.hide();
return;
}
this.$body.find('> tr').each(function (i) {
that.$rightfixedBody.find('tbody tr:eq(' + i + ')').height($(this).height());
});
//// events
this.$tableBody.on('scroll', function () {
that.$rightfixedBody.find('table').css('top', -$(this).scrollTop());
});
this.$body.find('> tr[data-index]').off('hover').hover(function () {
var index = $(this).data('index');
that.$rightfixedBody.find('tr[data-index="' + index + '"]').addClass('hover');
}, function () {
var index = $(this).data('index');
that.$rightfixedBody.find('tr[data-index="' + index + '"]').removeClass('hover');
});
this.$rightfixedBody.find('tr[data-index]').off('hover').hover(function () {
var index = $(this).data('index');
that.$body.find('tr[data-index="' + index + '"]').addClass('hover');
}, function () {
var index = $(this).data('index');
that.$body.find('> tr[data-index="' + index + '"]').removeClass('hover');
});
}
};
})(jQuery);
@@ -0,0 +1,146 @@
/**
* @author zhixin wen <wenzhixin2010@gmail.com>
* extensions: https://github.com/vitalets/x-editable
*/
(function($) {
'use strict';
$.extend($.fn.bootstrapTable.defaults, {
editable: true,
onEditableInit: function() {
return false;
},
onEditableSave: function(field, row, oldValue, $el) {
return false;
},
onEditableShown: function(field, row, $el, editable) {
return false;
},
onEditableHidden: function(field, row, $el, reason) {
return false;
}
});
$.extend($.fn.bootstrapTable.Constructor.EVENTS, {
'editable-init.bs.table': 'onEditableInit',
'editable-save.bs.table': 'onEditableSave',
'editable-shown.bs.table': 'onEditableShown',
'editable-hidden.bs.table': 'onEditableHidden'
});
var BootstrapTable = $.fn.bootstrapTable.Constructor,
_initTable = BootstrapTable.prototype.initTable,
_initBody = BootstrapTable.prototype.initBody;
BootstrapTable.prototype.initTable = function() {
var that = this;
_initTable.apply(this, Array.prototype.slice.apply(arguments));
if (!this.options.editable) {
return;
}
$.each(this.columns, function(i, column) {
if (!column.editable) {
return;
}
var editableOptions = {},
editableDataMarkup = [],
editableDataPrefix = 'editable-';
var processDataOptions = function(key, value) {
// Replace camel case with dashes.
var dashKey = key.replace(/([A-Z])/g, function($1) {
return "-" + $1.toLowerCase();
});
if (dashKey.slice(0, editableDataPrefix.length) == editableDataPrefix) {
var dataKey = dashKey.replace(editableDataPrefix, 'data-');
editableOptions[dataKey] = value;
}
};
$.each(that.options, processDataOptions);
column.formatter = column.formatter || function(value, row, index) {
return value;
};
column._formatter = column._formatter ? column._formatter : column.formatter;
column.formatter = function(value, row, index) {
var result = column._formatter ? column._formatter(value, row, index) : value;
$.each(column, processDataOptions);
$.each(editableOptions, function(key, value) {
editableDataMarkup.push(' ' + key + '="' + value + '"');
});
var _dont_edit_formatter = false;
if (column.editable.hasOwnProperty('noeditFormatter')) {
_dont_edit_formatter = column.editable.noeditFormatter(value, row, index);
}
if (_dont_edit_formatter === false) {
return ['<a href="javascript:void(0)"',
' data-name="' + column.field + '"',
' data-pk="' + row[that.options.idField] + '"',
' data-value="' + result + '"',
editableDataMarkup.join(''),
'>' + '</a>'
].join('');
} else {
return _dont_edit_formatter;
}
};
});
};
BootstrapTable.prototype.initBody = function() {
var that = this;
_initBody.apply(this, Array.prototype.slice.apply(arguments));
if (!this.options.editable) {
return;
}
$.each(this.columns, function(i, column) {
if (!column.editable) {
return;
}
that.$body.find('a[data-name="' + column.field + '"]').editable(column.editable)
.off('save').on('save', function(e, params) {
var data = that.getData(),
index = $(this).parents('tr[data-index]').data('index'),
row = data[index],
oldValue = row[column.field];
$(this).data('value', params.submitValue);
row[column.field] = params.submitValue;
that.trigger('editable-save', column.field, row, oldValue, $(this));
that.resetFooter();
});
that.$body.find('a[data-name="' + column.field + '"]').editable(column.editable)
.off('shown').on('shown', function(e, editable) {
var data = that.getData(),
index = $(this).parents('tr[data-index]').data('index'),
row = data[index];
that.trigger('editable-shown', column.field, row, $(this), editable);
});
that.$body.find('a[data-name="' + column.field + '"]').editable(column.editable)
.off('hidden').on('hidden', function(e, reason) {
var data = that.getData(),
index = $(this).parents('tr[data-index]').data('index'),
row = data[index];
that.trigger('editable-hidden', column.field, row, $(this), reason);
});
});
this.trigger('editable-init');
};
})(jQuery);
@@ -0,0 +1,119 @@
/**
* @author zhixin wen <wenzhixin2010@gmail.com>
* extensions: https://github.com/kayalshri/tableExport.jquery.plugin
*/
(function ($) {
'use strict';
var sprintf = $.fn.bootstrapTable.utils.sprintf;
var TYPE_NAME = {
csv: 'CSV',
txt: 'TXT',
doc: 'Word',
excel: 'Excel'
};
$.extend($.fn.bootstrapTable.defaults, {
showExport: false,
exportDataType: 'all', // basic, all, selected
exportTypes: ['csv', 'txt', 'doc', 'excel'],
exportOptions: {
ignoreColumn: [0] //忽略列索引
}
});
$.extend($.fn.bootstrapTable.defaults.icons, {
export: 'glyphicon glyphicon-save'
});
$.extend($.fn.bootstrapTable.locales, {
formatExport: function () {
return 'Export data';
}
});
$.extend($.fn.bootstrapTable.defaults, $.fn.bootstrapTable.locales);
var BootstrapTable = $.fn.bootstrapTable.Constructor,
_initToolbar = BootstrapTable.prototype.initToolbar;
BootstrapTable.prototype.initToolbar = function () {
this.showToolbar = this.options.showExport;
_initToolbar.apply(this, Array.prototype.slice.apply(arguments));
if (this.options.showExport) {
var that = this,
$btnGroup = this.$toolbar.find('>.btn-group'),
$export = $btnGroup.find('div.export');
if (!$export.length) {
$export = $([
'<div class="export btn-group">',
'<button class="btn' +
sprintf(' btn-%s', this.options.buttonsClass) +
sprintf(' btn-%s', this.options.iconSize) +
' dropdown-toggle" ' +
'title="' + this.options.formatExport() + '" ' +
'data-toggle="dropdown" type="button">',
sprintf('<i class="%s %s"></i> ', this.options.iconsPrefix, this.options.icons.export),
'<span class="caret"></span>',
'</button>',
'<ul class="dropdown-menu" role="menu">',
'</ul>',
'</div>'].join('')).appendTo($btnGroup);
var $menu = $export.find('.dropdown-menu'),
exportTypes = this.options.exportTypes;
if (typeof this.options.exportTypes === 'string') {
var types = this.options.exportTypes.slice(1, -1).replace(/ /g, '').split(',');
exportTypes = [];
$.each(types, function (i, value) {
exportTypes.push(value.slice(1, -1));
});
}
$.each(exportTypes, function (i, type) {
if (TYPE_NAME.hasOwnProperty(type)) {
$menu.append(['<li data-type="' + type + '">',
'<a href="javascript:void(0)">',
TYPE_NAME[type],
'</a>',
'</li>'].join(''));
}
});
$menu.find('li').click(function () {
var type = $(this).data('type'),
doExport = function () {
that.$el.tableExport($.extend({}, that.options.exportOptions, {
type: type,
escape: false
}));
};
if (that.options.exportDataType === 'all' && that.options.pagination) {
that.$el.one(that.options.sidePagination === 'server' ? 'post-body.bs.table' : 'page-change.bs.table', function () {
doExport();
that.togglePagination();
});
that.togglePagination();
} else if (that.options.exportDataType === 'selected') {
//修改sidePagination属性为server无法导出选中数据
var trs = that.$body.children();
for (var i = 0; i < trs.length; i++) {
var $this = $(trs[i]);
if(!$this.find(sprintf('[name="%s"]',that.options.selectItemName)).prop('checked')){
$this['hide']();
}}
doExport();
that.getRowsHidden(true);
} else {
doExport();
}
});
}
}
};
})(jQuery);
@@ -0,0 +1,92 @@
/**
* 基于bootstrap-table-mobile修改
* 修正部分iPhone手机不显示卡片视图
* Copyright (c) 2019 ruoyi
*/
!function ($) {
'use strict';
var resetView = function (that) {
if (that.options.height || that.options.showFooter) {
setTimeout(that.resetView(), 1);
}
};
// 判断是否 iphone
var isIPhone = function () {
var browserName = navigator.userAgent.toLowerCase();
return /(iPhone|iPad|iPod|iOS)/i.test(browserName);
};
var changeView = function (that, width, height) {
if (that.options.minHeight) {
if (checkValuesLessEqual(width, that.options.minWidth) && checkValuesLessEqual(height, that.options.minHeight)) {
conditionCardView(that);
} else if (checkValuesGreater(width, that.options.minWidth) && checkValuesGreater(height, that.options.minHeight)) {
conditionFullView(that);
}
} else {
if (checkValuesLessEqual(width, that.options.minWidth) || isIPhone()) {
conditionCardView(that);
} else if (checkValuesGreater(width, that.options.minWidth)) {
conditionFullView(that);
}
}
resetView(that);
};
var checkValuesLessEqual = function (currentValue, targetValue) {
return currentValue <= targetValue;
};
var checkValuesGreater = function (currentValue, targetValue) {
return currentValue > targetValue;
};
var conditionCardView = function (that) {
changeTableView(that, false);
};
var conditionFullView = function (that) {
changeTableView(that, true);
};
var changeTableView = function (that, cardViewState) {
that.options.cardView = cardViewState;
that.toggleView();
};
$.extend($.fn.bootstrapTable.defaults, {
mobileResponsive: false,
minWidth: 562,
minHeight: undefined,
checkOnInit: true,
toggled: false
});
var BootstrapTable = $.fn.bootstrapTable.Constructor,
_init = BootstrapTable.prototype.init;
BootstrapTable.prototype.init = function () {
_init.apply(this, Array.prototype.slice.apply(arguments));
if (!this.options.mobileResponsive) {
return;
}
if (!this.options.minWidth) {
return;
}
var that = this;
$(window).resize(function () {
changeView(that, $(this).width(), $(this).height())
});
if (this.options.checkOnInit) {
changeView(this, $(window).width(), $(window).height());
}
};
}(jQuery);
@@ -0,0 +1,42 @@
(function ($) {
'use strict';
$.fn.bootstrapTable.locales['zh-CN'] = {
formatLoadingMessage: function () {
return '正在努力地加载数据中,请稍候……';
},
formatRecordsPerPage: function (pageNumber) {
return pageNumber + ' 条记录每页';
},
formatShowingRows: function (pageFrom, pageTo, totalRows) {
return '第 ' + pageFrom + ' 到 ' + pageTo + ' 条,共 ' + totalRows + ' 条记录。';
},
formatSearch: function () {
return '搜索';
},
formatNoMatches: function () {
return '没有找到匹配的记录';
},
formatPaginationSwitch: function () {
return '隐藏/显示分页';
},
formatRefresh: function () {
return '刷新';
},
formatToggle: function () {
return '切换';
},
formatColumns: function () {
return '列';
},
formatExport: function () {
return '导出数据';
},
formatClearFilters: function () {
return '清空过滤';
}
};
$.extend($.fn.bootstrapTable.defaults, $.fn.bootstrapTable.locales['zh-CN']);
})(jQuery);
@@ -0,0 +1 @@
(function($){$.fn.bootstrapTable.locales["zh-CN"]={formatLoadingMessage:function(){return"正在努力地加载数据中,请稍候……"},formatRecordsPerPage:function(pageNumber){return pageNumber+" 条记录每页"},formatShowingRows:function(pageFrom,pageTo,totalRows){return"第 "+pageFrom+" 到 "+pageTo+" 条,共 "+totalRows+" 条记录。"},formatSearch:function(){return"搜索"},formatNoMatches:function(){return"没有找到匹配的记录"},formatPaginationSwitch:function(){return"隐藏/显示分页"},formatRefresh:function(){return"刷新"},formatToggle:function(){return"切换"},formatColumns:function(){return"列"},formatExport:function(){return"导出数据"},formatClearFilters:function(){return"清空过滤"}};$.extend($.fn.bootstrapTable.defaults,$.fn.bootstrapTable.locales["zh-CN"])})(jQuery);
@@ -23,7 +23,7 @@
top: 0;
width: 200px;
border: 1px #ddd solid;
height: 450px;
height: 440px;
padding: 4px;
box-shadow: 0px 0px 12px #ddd;
text-align: center;
Loaded 100 of 1028 files, more files were not shown because too many files have changed in this diff. Show more