This commit is contained in:
commit
157524223b
|
@ -0,0 +1,38 @@
|
|||
*.class
|
||||
|
||||
# maven ignore
|
||||
target/
|
||||
*.jar
|
||||
*.war
|
||||
*.zip
|
||||
*.tar
|
||||
*.tar.gz
|
||||
|
||||
# eclipse ignore
|
||||
.externalToolBuilders
|
||||
.springBeans
|
||||
|
||||
# idea ignore
|
||||
.idea/
|
||||
*.ipr
|
||||
*.iml
|
||||
*.iws
|
||||
|
||||
# temp ignore
|
||||
*.log
|
||||
*.cache
|
||||
*.diff
|
||||
*.patch
|
||||
*.tmp
|
||||
|
||||
# system ignore
|
||||
.DS_Store
|
||||
Thumbs.db
|
||||
|
||||
# custom lib
|
||||
!custom_lib/*
|
||||
/bin
|
||||
|
||||
# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
|
||||
hs_err_pid*
|
||||
/.factorypath
|
|
@ -0,0 +1,20 @@
|
|||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2018 RuoYi
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
||||
this software and associated documentation files (the "Software"), to deal in
|
||||
the Software without restriction, including without limitation the rights to
|
||||
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
|
||||
the Software, and to permit persons to whom the Software is furnished to do so,
|
||||
subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
|
||||
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
|
||||
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
|
||||
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
||||
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
@ -0,0 +1,31 @@
|
|||
## 内置功能
|
||||
|
||||
1. 用户管理:用户是系统操作者,该功能主要完成系统用户配置。
|
||||
2. 部门管理:配置系统组织机构(公司、部门、小组),树结构展现支持数据权限。
|
||||
3. 岗位管理:配置系统用户所属担任职务。
|
||||
4. 菜单管理:配置系统菜单,操作权限,按钮权限标识等。
|
||||
5. 角色管理:角色菜单权限分配、设置角色按机构进行数据范围权限划分。
|
||||
6. 字典管理:对系统中经常使用的一些较为固定的数据进行维护。
|
||||
7. 参数管理:对系统动态配置常用参数。
|
||||
8. 通知公告:系统通知公告信息发布维护。
|
||||
9. 操作日志:系统正常操作日志记录和查询;系统异常信息日志记录和查询。
|
||||
10. 登录日志:系统登录日志记录查询包含登录异常。
|
||||
11. 在线用户:当前系统中活跃用户状态监控。
|
||||
12. 定时任务:在线(添加、修改、删除)任务调度包含执行结果日志。
|
||||
13. 代码生成:前后端代码的生成(java、html、xml、sql)支持CRUD下载 。
|
||||
14. 系统接口:根据业务代码自动生成相关的api接口文档。
|
||||
15. 服务监控:监视当前系统CPU、内存、磁盘、堆栈等相关信息。
|
||||
16. 缓存监控:对系统的缓存信息查询,命令统计等。
|
||||
17. 在线构建器:拖动表单元素生成相应的HTML代码。
|
||||
18. 连接池监视:监视当前系统数据库连接池状态,可进行分析SQL找出系统性能瓶颈。
|
||||
|
||||
## 集成新增功能
|
||||
1. 集成druid实现数据库密码加密功能
|
||||
2. 集成mybatis-plus实现mybatis增强
|
||||
3. 集成knife4j实现swagger文档增强 访问地址http://ip:port/doc.html
|
||||
4. 集成easyexcel实现excel表格增强
|
||||
6. 加入license
|
||||
开发时停用此功能的方法:LicenseCheckListener类注释掉@Component注解,LicenseAspectConfig类注释掉@Configuration注解
|
||||
7. 区分部署多个项目的Redis缓存
|
||||
|
||||
|
Binary file not shown.
|
@ -0,0 +1,167 @@
|
|||
# license
|
||||
|
||||
|
||||
|
||||
|
||||
### **license授权机制的原理**
|
||||
|
||||
(1)生成密钥对,包含私钥和公钥。(2)授权者保留私钥,使用私钥对授权信息诸如使用截止日期,mac 地址等内容生成 license 签名证书。(3)公钥给使用者,放在代码中使用,用于验证 license 签名证书是否符合使用条件。
|
||||
|
||||
#### 使用KeyTool生成密匙库:
|
||||
|
||||
1. 生成私钥库文件 使用jdk keytool工具 工具路径C:\Program Files\Java\jdk1.8.0_131\bin cmd使用管理员身份运行
|
||||
|
||||
```shell
|
||||
keytool -genkeypair -keysize 1024 -validity 36500 -alias WMSKEY -keystore privateKeys.keystore -storepass 21#nS@NjJK20 -keypass WMS-21#nS@NjJK20 -dname "CN=ZF, OU=FBE, O=IT, L=NJ, ST=JS, C=CN"
|
||||
```
|
||||
|
||||
|
||||
> **参数说明:**
|
||||
>
|
||||
> 示例 keytool -genkeypair -keysize 1024 -validity 36500 -alias 私钥别称(WMSKEY) -keystore privateKeys.keystore -storepass 指定私钥库的密码(21#nS@NjJK20) -keypass 密钥密码(WMS-21#nS@NjJK20) -dname "CN=ZF, OU=FBE, O=IT, L=NJ, ST=JS, C=CN"
|
||||
> - keysize 密钥长度
|
||||
> - validity 私钥的有效期(单位:天)
|
||||
> - alias 私钥别称 WMSKEY
|
||||
> - keystore 指定私钥库文件的名称 (生成在当前目录)
|
||||
> - storepass 指定私钥库的密码 (keystore 文件存储密码 21#nS@NjJK20
|
||||
> - keypass 指定别名条目的密码 (私钥加解密密码) WMS-21#nS@NjJK20
|
||||
> - dname 证书个人信息
|
||||
> - CN 为你的姓名
|
||||
> - OU 为你的组织单位名称
|
||||
> - O 为你的组织名称
|
||||
> - L 为你所在的城市名称
|
||||
> - ST 为你所在的省份名称
|
||||
> - C 为你的国家名称
|
||||
|
||||
|
||||
|
||||
2. 生成证书文件
|
||||
|
||||
```shell
|
||||
keytool -exportcert -alias WMSKEY -keystore privateKeys.keystore -storepass 21#nS@NjJK20 -file certfile.cer
|
||||
```
|
||||
|
||||
> **参数说明:**
|
||||
> - 示例 keytool -exportcert -alias 私钥别称(WMSKEY) -keystore privateKeys.keystore -storepass 私钥库的密码(21#nS@NjJK20) -file certfile.cer
|
||||
> - alias 私钥别称 WMSKEY
|
||||
> - keystore 指定私钥库文件的名称 (如果没有带路径,在当前目录查找)
|
||||
> - storepass 指定私钥库的密码 21#nS@NjJK20
|
||||
> - file 导出证书文件名称
|
||||
|
||||
3. 生成公钥库
|
||||
|
||||
```shell
|
||||
keytool -import -alias PUBLICKEY -file certfile.cer -keystore publicCerts.keystore -storepass 21#nS@NjJK20
|
||||
```
|
||||
|
||||
> **参数说明:**
|
||||
> - keytool -import -alias 公钥别称配置文件配置(PUBLICKEY) -file certfile.cer -keystore publicCerts.keystore -storepass 访问公钥库的密码(21#nS@NjJK20)
|
||||
> - alias 公钥别称 PUBLICKEY
|
||||
> - file 证书文件名称
|
||||
> - keystore 公钥文件名称
|
||||
> - storepass 指定私钥库的密码 21#nS@NjJK20
|
||||
|
||||
看到以下三个文件:
|
||||
|
||||
- privateKeys.keystore(私钥)提供给生成证书使用
|
||||
- publicCerts.keystore(公钥)提供给证书认证使用
|
||||
- certfile.cer后续步骤用不到,可以删除。
|
||||
|
||||
|
||||
|
||||
|
||||
#### License证书:
|
||||
|
||||
根据客户服务器硬件信息(MAC地址、IP地址、CPU序列号、主板序列号)生成授权证书,同时可以给授权证书设置生效时间与失效时间。
|
||||
|
||||
整个授权过程分为三步:
|
||||
|
||||
1. 获取客户端服务器信息(license-server-info服务)
|
||||
|
||||
> 将license-server-info服务部署到客户服务器上
|
||||
>
|
||||
> 请求接口`/license/getServerInfo`
|
||||
>
|
||||
> 得到硬件信息:
|
||||
>
|
||||
> ```json
|
||||
> {
|
||||
> "ipAddress": [ //授权的ip列表
|
||||
> "172.17.0.8"
|
||||
> ],
|
||||
> "macAddress": [ //授权的mac地址列表
|
||||
> "52-54-00-74-0B-D9"
|
||||
> ],
|
||||
> "cpuSerial": "55 06 05 00 FF FB 8B 0F", //cpu序列号
|
||||
> "mainBoardSerial": "afb14aac-eccb-4a37-9c31-e7951ce73e0d"//主板序列号
|
||||
> }
|
||||
> ```
|
||||
|
||||
2. 生成授权证书(license-creator服务)
|
||||
|
||||
> 我们自己部署生成证书的服务(license-creator)
|
||||
>
|
||||
> 请求接口`/license/generateLicense`
|
||||
>
|
||||
> 入参传入授权信息:
|
||||
>
|
||||
> ```json
|
||||
> {
|
||||
>
|
||||
> "expiryTime":"2023-01-05 00:00:00", //失效时间
|
||||
> "issuedTime":"2021-01-01 00:00:00", //生效时间
|
||||
> "keyPass":"WMS", //密钥的密码
|
||||
> "privateAlias":"WMSKEY",
|
||||
> "licensePath":"/Users/zf/Documents/license/license.lic", //证书生成地址
|
||||
> "privateKeysStorePath":"/Users/zf/Documents/license/privateKeys.keystore",// 密钥文件地址
|
||||
> "storePass":"21#nS@NjJK20", //访问公钥库的密码
|
||||
> "subject":"wms-license",
|
||||
> "licenseCheckModel":{ //授权验证信息
|
||||
> "cpuSerial":"47A8E193-23D4-5B93-92AB-4A96FBC0346F",//cpu序列号
|
||||
> "ipAddress":[ //ip
|
||||
> "192.168.174.107"
|
||||
> ],
|
||||
> "macAddress":[ //mac地址
|
||||
> "F8-FF-C2-6A-3E-73"
|
||||
> ],
|
||||
> "mainBoardSerial":"C02C31HZMD6P"//主板序列号
|
||||
> }
|
||||
> }
|
||||
> ```
|
||||
>
|
||||
> 会生成一个`license.lic`授权文件到执行目录
|
||||
|
||||
3. 授权验证(license-verify-starter)
|
||||
|
||||
> 需要添加授权功能的服务需要依赖`license-verify-starter`
|
||||
>
|
||||
> 配置证书信息
|
||||
>
|
||||
> ```properties
|
||||
> license.subject: wms-license
|
||||
> license.publicAlias: PUBLICKEY
|
||||
> license.storePass: 9527WMS
|
||||
> license.licensePath: /Users/zf/Documents/license/license.lic
|
||||
> license.publicKeysStorePath: /Users/zf/Documents/license/publicCerts.keystore
|
||||
> ```
|
||||
>
|
||||
> 项目启动的时候,会去验证授权证书的有效性,是否在有效期内,硬件信息是否匹配,如果授权证书无效,项目启动失败。
|
||||
>
|
||||
> 另外可以在一些核心接口,比如登陆接口,添加`@License`注解,请求该接口的时候,也会去验证授权证书的有效性,比如验证证书是否到期,如果失效,该接口将会拒绝访问。
|
||||
> 加入license
|
||||
> 开发时停用此功能的方法:LicenseCheckListener类注释掉@Component注解,LicenseAspectConfig类注释掉@Configuration注解
|
||||
> @PostMapping("/login") SysLoginController 接口加上@License 注解
|
||||
|
||||
|
||||
# license 证书生成程序
|
||||
|
||||
使用说明
|
||||
* 执行jar包 java -jar generate-license.jar 证书subject 密钥别称 密钥密码 访问公钥库的密码 证书生成路径与文件名 私钥库访问地址 证书失效时间证书生效时间 用户类型 用户数量 描述信息
|
||||
* java -jar generate-license.jar wms-license WMSKEY WMS-21#nS@NjJK20 21#nS@NjJK20 D://wms//license//license.lic D://wms//license//privateKeys.keystore 2023-12-31 user 1 wms系统license
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
Binary file not shown.
Binary file not shown.
|
@ -0,0 +1,103 @@
|
|||
若依系统开发环境搭建手册
|
||||
1. 准备工作
|
||||
1.1 前置环境准备 -- -- 安装Maven
|
||||
若依基于Maven管理项目的构建,需要先安装好相应的版本。
|
||||
1.2 开发工具
|
||||
若依系统采用Eclipse作为开发工具。但不局限于Eclipse。此处仅介绍在Eclipse搭建开发环境所需的操作。
|
||||
2. 开发环境搭建
|
||||
2.1 开发工具的配置
|
||||
2.1.1 配置Maven
|
||||
进入Window->Preferences->Maven->Installations页面,设置已经安装好的Maven
|
||||
|
||||
2.1.2 配置Maven仓库路径
|
||||
进入Window->Preferences->Maven->User Settings页面,配置仓库路径
|
||||
|
||||
2.1.4 关闭校验
|
||||
进入Window->Preferences->Validation页面,勾选"Suspend all validators",关闭校验
|
||||
|
||||
2.2 导入工程
|
||||
通过Eclipse导入工程,步骤如下:
|
||||
(1)点击左侧项目区域 -- >Import...
|
||||
|
||||
(2)选择RuoYi
|
||||
|
||||
(3)点击Finish
|
||||
|
||||
(4)RuoYi的代码就被导出到Eclipse中了,此时可以在工程视图中看到。
|
||||
|
||||
3. 运行若依系统
|
||||
3.1 必要的配置
|
||||
3.1.1 修改数据库连接
|
||||
编辑src/main/ resources目录下的application-druid.yml 文件,修改数据库地址账号信息。
|
||||
执行sql/ ry_20180423.sql,quartz.sql 两个文件 日期随版本变化
|
||||
3.1.2 开发环境配置
|
||||
编辑src/main/ resources目录下的application.yml 文件,
|
||||
默认端口为80
|
||||
|
||||
3.1.3 代码生成配置
|
||||
编辑src/main/ resources目录下的application.yml 文件,
|
||||
|
||||
默认为module,根据实际情况修改即可。生成的表要有注释
|
||||
|
||||
注:如对模板有特殊需求,可自行修改。编辑src/main/ resources/templates/vm目录下
|
||||
|
||||
|
||||
3.1.4 日志配置
|
||||
编辑src/main/ resources目录下的logback.yml 文件
|
||||
<property name="log.path" value="/home/ruoyi/logs" />
|
||||
改为自己需要的路径
|
||||
|
||||
3.2 启动及验证(后台)
|
||||
启动RuoYiApplication.java 出现如下图表示启动成功
|
||||
|
||||
打开浏览器,输入:http://localhost:8080/captchaImage
|
||||
若能正确显示返回信息,搭建后台成功。
|
||||
|
||||
3.3 启动及验证(前台)
|
||||
# 进入项目目录
|
||||
cd ruoyi-ui
|
||||
|
||||
npm install --registry=https://registry.npm.taobao.org
|
||||
|
||||
npm run dev
|
||||
|
||||
打开浏览器,输入:http://localhost:80 (默认账户 admin/admin123)
|
||||
若能正确展示登录页面,并能成功登录,菜单及页面展示正常,则表明环境搭建成功
|
||||
注意:执行npm命令需要配置node环境
|
||||
4. 部署若依系统
|
||||
4.1 war部署方式
|
||||
4.1.1 修改pom.xml文件。将jar修改为war
|
||||
|
||||
如果是分模块需要修改ruoyi-admin
|
||||
|
||||
|
||||
4.1.2 在spring-boot-starter依赖中移除tomcat模块
|
||||
|
||||
<exclusions>
|
||||
<exclusion>
|
||||
<artifactId>spring-boot-starter-tomcat</artifactId>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
</exclusion>
|
||||
</exclusions>
|
||||
|
||||
4.1.3 部署到tomcat的webapps目录下面
|
||||
默认为RuoYi.war
|
||||
|
||||
4.1.4 启动及验证
|
||||
运行startup.bat 出现如下图即部署成功
|
||||
|
||||
4.2 Jar方式部署
|
||||
执行命令:java - jar RuoYi.jar
|
||||
脚本执行:ry.sh start 启动stop 停止
|
||||
|
||||
4.2 前端部署
|
||||
# 打包正式环境
|
||||
npm run build:prod
|
||||
|
||||
# 打包预发布环境
|
||||
npm run build:stage
|
||||
|
||||
构建打包成功之后,会在根目录生成 dist 文件夹,里面就是构建打包好的文件,通常是 ***.js 、***.css、index.html 等静态文件。发布到你的 nginx 或者静态服务器即可,其中的 index.html 是后台服务的入口页面。
|
||||
|
||||
演示地址:ruoyi.vip
|
||||
文档地址:doc.ruoyi.vip
|
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,300 @@
|
|||
<?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.wms</groupId>
|
||||
<artifactId>Wms</artifactId>
|
||||
<version>1.0.0</version>
|
||||
|
||||
<name>wms</name>
|
||||
<url>http://www.ruoyi.vip</url>
|
||||
<description>Wms管理系统</description>
|
||||
|
||||
<properties>
|
||||
<wms.version>1.0.0</wms.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>
|
||||
<druid.version>1.2.16</druid.version>
|
||||
<bitwalker.version>1.21</bitwalker.version>
|
||||
<swagger.version>3.0.0</swagger.version>
|
||||
<kaptcha.version>2.3.3</kaptcha.version>
|
||||
<pagehelper.boot.version>1.4.6</pagehelper.boot.version>
|
||||
<fastjson.version>2.0.25</fastjson.version>
|
||||
<oshi.version>6.4.0</oshi.version>
|
||||
<commons.io.version>2.11.0</commons.io.version>
|
||||
<commons.collections.version>3.2.2</commons.collections.version>
|
||||
<poi.version>4.1.2</poi.version>
|
||||
<velocity.version>2.3</velocity.version>
|
||||
<jwt.version>0.9.1</jwt.version>
|
||||
</properties>
|
||||
|
||||
<!-- 依赖声明 -->
|
||||
<dependencyManagement>
|
||||
<dependencies>
|
||||
|
||||
<!-- SpringBoot的依赖配置-->
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-dependencies</artifactId>
|
||||
<version>2.5.14</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>eu.bitwalker</groupId>
|
||||
<artifactId>UserAgentUtils</artifactId>
|
||||
<version>${bitwalker.version}</version>
|
||||
</dependency>
|
||||
|
||||
<!-- pagehelper 分页插件 -->
|
||||
<dependency>
|
||||
<groupId>com.github.pagehelper</groupId>
|
||||
<artifactId>pagehelper-spring-boot-starter</artifactId>
|
||||
<version>${pagehelper.boot.version}</version>
|
||||
</dependency>
|
||||
|
||||
<!-- 获取系统信息 -->
|
||||
<dependency>
|
||||
<groupId>com.github.oshi</groupId>
|
||||
<artifactId>oshi-core</artifactId>
|
||||
<version>${oshi.version}</version>
|
||||
</dependency>
|
||||
|
||||
<!-- Swagger3依赖 -->
|
||||
<dependency>
|
||||
<groupId>io.springfox</groupId>
|
||||
<artifactId>springfox-boot-starter</artifactId>
|
||||
<version>${swagger.version}</version>
|
||||
<exclusions>
|
||||
<exclusion>
|
||||
<groupId>io.swagger</groupId>
|
||||
<artifactId>swagger-models</artifactId>
|
||||
</exclusion>
|
||||
</exclusions>
|
||||
</dependency>
|
||||
|
||||
<!-- io常用工具类 -->
|
||||
<dependency>
|
||||
<groupId>commons-io</groupId>
|
||||
<artifactId>commons-io</artifactId>
|
||||
<version>${commons.io.version}</version>
|
||||
</dependency>
|
||||
|
||||
<!-- excel工具 -->
|
||||
<dependency>
|
||||
<groupId>org.apache.poi</groupId>
|
||||
<artifactId>poi-ooxml</artifactId>
|
||||
<version>${poi.version}</version>
|
||||
</dependency>
|
||||
|
||||
<!-- velocity代码生成使用模板 -->
|
||||
<dependency>
|
||||
<groupId>org.apache.velocity</groupId>
|
||||
<artifactId>velocity-engine-core</artifactId>
|
||||
<version>${velocity.version}</version>
|
||||
</dependency>
|
||||
|
||||
<!-- collections工具类 -->
|
||||
<dependency>
|
||||
<groupId>commons-collections</groupId>
|
||||
<artifactId>commons-collections</artifactId>
|
||||
<version>${commons.collections.version}</version>
|
||||
</dependency>
|
||||
|
||||
<!-- 阿里JSON解析器 -->
|
||||
<dependency>
|
||||
<groupId>com.alibaba.fastjson2</groupId>
|
||||
<artifactId>fastjson2</artifactId>
|
||||
<version>${fastjson.version}</version>
|
||||
</dependency>
|
||||
|
||||
<!-- Token生成与解析-->
|
||||
<dependency>
|
||||
<groupId>io.jsonwebtoken</groupId>
|
||||
<artifactId>jjwt</artifactId>
|
||||
<version>${jwt.version}</version>
|
||||
</dependency>
|
||||
|
||||
<!-- 验证码 -->
|
||||
<dependency>
|
||||
<groupId>pro.fessional</groupId>
|
||||
<artifactId>kaptcha</artifactId>
|
||||
<version>${kaptcha.version}</version>
|
||||
</dependency>
|
||||
|
||||
|
||||
|
||||
<!-- 定时任务-->
|
||||
<dependency>
|
||||
<groupId>com.wms</groupId>
|
||||
<artifactId>wms-quartz</artifactId>
|
||||
<version>${wms.version}</version>
|
||||
</dependency>
|
||||
|
||||
<!-- 代码生成-->
|
||||
<dependency>
|
||||
<groupId>com.wms</groupId>
|
||||
<artifactId>wms-generator</artifactId>
|
||||
<version>${wms.version}</version>
|
||||
</dependency>
|
||||
|
||||
<!-- 核心模块-->
|
||||
<dependency>
|
||||
<groupId>com.wms</groupId>
|
||||
<artifactId>wms-framework</artifactId>
|
||||
<version>${wms.version}</version>
|
||||
</dependency>
|
||||
|
||||
<!-- 系统模块-->
|
||||
<dependency>
|
||||
<groupId>com.wms</groupId>
|
||||
<artifactId>wms-system</artifactId>
|
||||
<version>${wms.version}</version>
|
||||
</dependency>
|
||||
|
||||
<!-- 通用工具-->
|
||||
<dependency>
|
||||
<groupId>com.wms</groupId>
|
||||
<artifactId>wms-common</artifactId>
|
||||
<version>${wms.version}</version>
|
||||
</dependency>
|
||||
|
||||
<!-- 数据库备份模块-->
|
||||
<dependency>
|
||||
<groupId>com.wms</groupId>
|
||||
<artifactId>wms-db-backup</artifactId>
|
||||
<version>${wms.version}</version>
|
||||
</dependency>
|
||||
|
||||
<!-- 告警模块-->
|
||||
<dependency>
|
||||
<groupId>com.wms</groupId>
|
||||
<artifactId>wms-alarm</artifactId>
|
||||
<version>${wms.version}</version>
|
||||
</dependency>
|
||||
|
||||
<!-- 授权模块-->
|
||||
<dependency>
|
||||
<groupId>com.wms</groupId>
|
||||
<artifactId>wms-license</artifactId>
|
||||
<version>${wms.version}</version>
|
||||
</dependency>
|
||||
|
||||
<!-- 基础模块-->
|
||||
<dependency>
|
||||
<groupId>com.wms</groupId>
|
||||
<artifactId>wms-basic</artifactId>
|
||||
<version>${wms.version}</version>
|
||||
</dependency>
|
||||
|
||||
<!-- netty模块-->
|
||||
<dependency>
|
||||
<groupId>com.wms</groupId>
|
||||
<artifactId>wms-message</artifactId>
|
||||
<version>${wms.version}</version>
|
||||
</dependency>
|
||||
|
||||
<!-- pda模块-->
|
||||
<dependency>
|
||||
<groupId>com.wms</groupId>
|
||||
<artifactId>wms-pda</artifactId>
|
||||
<version>${wms.version}</version>
|
||||
</dependency>
|
||||
|
||||
<!-- 推荐模块-->
|
||||
<dependency>
|
||||
<groupId>com.wms</groupId>
|
||||
<artifactId>wms-recommend</artifactId>
|
||||
<version>${wms.version}</version>
|
||||
</dependency>
|
||||
|
||||
<!-- 第三方模块-->
|
||||
<dependency>
|
||||
<groupId>com.wms</groupId>
|
||||
<artifactId>wms-third-party</artifactId>
|
||||
<version>${wms.version}</version>
|
||||
</dependency>
|
||||
|
||||
<!-- 大屏与统计-->
|
||||
<dependency>
|
||||
<groupId>com.wms</groupId>
|
||||
<artifactId>wms-bg-statistics</artifactId>
|
||||
<version>${wms.version}</version>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
</dependencyManagement>
|
||||
|
||||
<modules>
|
||||
<module>wms-admin</module>
|
||||
<module>wms-framework</module>
|
||||
<module>wms-system</module>
|
||||
<module>wms-quartz</module>
|
||||
<module>wms-generator</module>
|
||||
<module>wms-common</module>
|
||||
<module>wms-basic</module>
|
||||
<module>wms-db-backup</module>
|
||||
<module>wms-alarm</module>
|
||||
<module>wms-license</module>
|
||||
<module>wms-message</module>
|
||||
<module>wms-pda</module>
|
||||
<module>wms-bg-statistics</module>
|
||||
<module>wms-recommend</module>
|
||||
<module>wms-third-party</module>
|
||||
</modules>
|
||||
<packaging>pom</packaging>
|
||||
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-compiler-plugin</artifactId>
|
||||
<version>3.1</version>
|
||||
<configuration>
|
||||
<source>${java.version}</source>
|
||||
<target>${java.version}</target>
|
||||
<encoding>${project.build.sourceEncoding}</encoding>
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
|
||||
<repositories>
|
||||
<repository>
|
||||
<id>public</id>
|
||||
<name>aliyun nexus</name>
|
||||
<url>https://maven.aliyun.com/repository/public</url>
|
||||
<releases>
|
||||
<enabled>true</enabled>
|
||||
</releases>
|
||||
</repository>
|
||||
</repositories>
|
||||
|
||||
<pluginRepositories>
|
||||
<pluginRepository>
|
||||
<id>public</id>
|
||||
<name>aliyun nexus</name>
|
||||
<url>https://maven.aliyun.com/repository/public</url>
|
||||
<releases>
|
||||
<enabled>true</enabled>
|
||||
</releases>
|
||||
<snapshots>
|
||||
<enabled>false</enabled>
|
||||
</snapshots>
|
||||
</pluginRepository>
|
||||
</pluginRepositories>
|
||||
|
||||
</project>
|
|
@ -0,0 +1,174 @@
|
|||
DROP TABLE IF EXISTS QRTZ_FIRED_TRIGGERS;
|
||||
DROP TABLE IF EXISTS QRTZ_PAUSED_TRIGGER_GRPS;
|
||||
DROP TABLE IF EXISTS QRTZ_SCHEDULER_STATE;
|
||||
DROP TABLE IF EXISTS QRTZ_LOCKS;
|
||||
DROP TABLE IF EXISTS QRTZ_SIMPLE_TRIGGERS;
|
||||
DROP TABLE IF EXISTS QRTZ_SIMPROP_TRIGGERS;
|
||||
DROP TABLE IF EXISTS QRTZ_CRON_TRIGGERS;
|
||||
DROP TABLE IF EXISTS QRTZ_BLOB_TRIGGERS;
|
||||
DROP TABLE IF EXISTS QRTZ_TRIGGERS;
|
||||
DROP TABLE IF EXISTS QRTZ_JOB_DETAILS;
|
||||
DROP TABLE IF EXISTS QRTZ_CALENDARS;
|
||||
|
||||
-- ----------------------------
|
||||
-- 1、存储每一个已配置的 jobDetail 的详细信息
|
||||
-- ----------------------------
|
||||
create table QRTZ_JOB_DETAILS (
|
||||
sched_name varchar(120) not null comment '调度名称',
|
||||
job_name varchar(200) not null comment '任务名称',
|
||||
job_group varchar(200) not null comment '任务组名',
|
||||
description varchar(250) null comment '相关介绍',
|
||||
job_class_name varchar(250) not null comment '执行任务类名称',
|
||||
is_durable varchar(1) not null comment '是否持久化',
|
||||
is_nonconcurrent varchar(1) not null comment '是否并发',
|
||||
is_update_data varchar(1) not null comment '是否更新数据',
|
||||
requests_recovery varchar(1) not null comment '是否接受恢复执行',
|
||||
job_data blob null comment '存放持久化job对象',
|
||||
primary key (sched_name, job_name, job_group)
|
||||
) engine=innodb comment = '任务详细信息表';
|
||||
|
||||
-- ----------------------------
|
||||
-- 2、 存储已配置的 Trigger 的信息
|
||||
-- ----------------------------
|
||||
create table QRTZ_TRIGGERS (
|
||||
sched_name varchar(120) not null comment '调度名称',
|
||||
trigger_name varchar(200) not null comment '触发器的名字',
|
||||
trigger_group varchar(200) not null comment '触发器所属组的名字',
|
||||
job_name varchar(200) not null comment 'qrtz_job_details表job_name的外键',
|
||||
job_group varchar(200) not null comment 'qrtz_job_details表job_group的外键',
|
||||
description varchar(250) null comment '相关介绍',
|
||||
next_fire_time bigint(13) null comment '上一次触发时间(毫秒)',
|
||||
prev_fire_time bigint(13) null comment '下一次触发时间(默认为-1表示不触发)',
|
||||
priority integer null comment '优先级',
|
||||
trigger_state varchar(16) not null comment '触发器状态',
|
||||
trigger_type varchar(8) not null comment '触发器的类型',
|
||||
start_time bigint(13) not null comment '开始时间',
|
||||
end_time bigint(13) null comment '结束时间',
|
||||
calendar_name varchar(200) null comment '日程表名称',
|
||||
misfire_instr smallint(2) null comment '补偿执行的策略',
|
||||
job_data blob null comment '存放持久化job对象',
|
||||
primary key (sched_name, trigger_name, trigger_group),
|
||||
foreign key (sched_name, job_name, job_group) references QRTZ_JOB_DETAILS(sched_name, job_name, job_group)
|
||||
) engine=innodb comment = '触发器详细信息表';
|
||||
|
||||
-- ----------------------------
|
||||
-- 3、 存储简单的 Trigger,包括重复次数,间隔,以及已触发的次数
|
||||
-- ----------------------------
|
||||
create table QRTZ_SIMPLE_TRIGGERS (
|
||||
sched_name varchar(120) not null comment '调度名称',
|
||||
trigger_name varchar(200) not null comment 'qrtz_triggers表trigger_name的外键',
|
||||
trigger_group varchar(200) not null comment 'qrtz_triggers表trigger_group的外键',
|
||||
repeat_count bigint(7) not null comment '重复的次数统计',
|
||||
repeat_interval bigint(12) not null comment '重复的间隔时间',
|
||||
times_triggered bigint(10) not null comment '已经触发的次数',
|
||||
primary key (sched_name, trigger_name, trigger_group),
|
||||
foreign key (sched_name, trigger_name, trigger_group) references QRTZ_TRIGGERS(sched_name, trigger_name, trigger_group)
|
||||
) engine=innodb comment = '简单触发器的信息表';
|
||||
|
||||
-- ----------------------------
|
||||
-- 4、 存储 Cron Trigger,包括 Cron 表达式和时区信息
|
||||
-- ----------------------------
|
||||
create table QRTZ_CRON_TRIGGERS (
|
||||
sched_name varchar(120) not null comment '调度名称',
|
||||
trigger_name varchar(200) not null comment 'qrtz_triggers表trigger_name的外键',
|
||||
trigger_group varchar(200) not null comment 'qrtz_triggers表trigger_group的外键',
|
||||
cron_expression varchar(200) not null comment 'cron表达式',
|
||||
time_zone_id varchar(80) comment '时区',
|
||||
primary key (sched_name, trigger_name, trigger_group),
|
||||
foreign key (sched_name, trigger_name, trigger_group) references QRTZ_TRIGGERS(sched_name, trigger_name, trigger_group)
|
||||
) engine=innodb comment = 'Cron类型的触发器表';
|
||||
|
||||
-- ----------------------------
|
||||
-- 5、 Trigger 作为 Blob 类型存储(用于 Quartz 用户用 JDBC 创建他们自己定制的 Trigger 类型,JobStore 并不知道如何存储实例的时候)
|
||||
-- ----------------------------
|
||||
create table QRTZ_BLOB_TRIGGERS (
|
||||
sched_name varchar(120) not null comment '调度名称',
|
||||
trigger_name varchar(200) not null comment 'qrtz_triggers表trigger_name的外键',
|
||||
trigger_group varchar(200) not null comment 'qrtz_triggers表trigger_group的外键',
|
||||
blob_data blob null comment '存放持久化Trigger对象',
|
||||
primary key (sched_name, trigger_name, trigger_group),
|
||||
foreign key (sched_name, trigger_name, trigger_group) references QRTZ_TRIGGERS(sched_name, trigger_name, trigger_group)
|
||||
) engine=innodb comment = 'Blob类型的触发器表';
|
||||
|
||||
-- ----------------------------
|
||||
-- 6、 以 Blob 类型存储存放日历信息, quartz可配置一个日历来指定一个时间范围
|
||||
-- ----------------------------
|
||||
create table QRTZ_CALENDARS (
|
||||
sched_name varchar(120) not null comment '调度名称',
|
||||
calendar_name varchar(200) not null comment '日历名称',
|
||||
calendar blob not null comment '存放持久化calendar对象',
|
||||
primary key (sched_name, calendar_name)
|
||||
) engine=innodb comment = '日历信息表';
|
||||
|
||||
-- ----------------------------
|
||||
-- 7、 存储已暂停的 Trigger 组的信息
|
||||
-- ----------------------------
|
||||
create table QRTZ_PAUSED_TRIGGER_GRPS (
|
||||
sched_name varchar(120) not null comment '调度名称',
|
||||
trigger_group varchar(200) not null comment 'qrtz_triggers表trigger_group的外键',
|
||||
primary key (sched_name, trigger_group)
|
||||
) engine=innodb comment = '暂停的触发器表';
|
||||
|
||||
-- ----------------------------
|
||||
-- 8、 存储与已触发的 Trigger 相关的状态信息,以及相联 Job 的执行信息
|
||||
-- ----------------------------
|
||||
create table QRTZ_FIRED_TRIGGERS (
|
||||
sched_name varchar(120) not null comment '调度名称',
|
||||
entry_id varchar(95) not null comment '调度器实例id',
|
||||
trigger_name varchar(200) not null comment 'qrtz_triggers表trigger_name的外键',
|
||||
trigger_group varchar(200) not null comment 'qrtz_triggers表trigger_group的外键',
|
||||
instance_name varchar(200) not null comment '调度器实例名',
|
||||
fired_time bigint(13) not null comment '触发的时间',
|
||||
sched_time bigint(13) not null comment '定时器制定的时间',
|
||||
priority integer not null comment '优先级',
|
||||
state varchar(16) not null comment '状态',
|
||||
job_name varchar(200) null comment '任务名称',
|
||||
job_group varchar(200) null comment '任务组名',
|
||||
is_nonconcurrent varchar(1) null comment '是否并发',
|
||||
requests_recovery varchar(1) null comment '是否接受恢复执行',
|
||||
primary key (sched_name, entry_id)
|
||||
) engine=innodb comment = '已触发的触发器表';
|
||||
|
||||
-- ----------------------------
|
||||
-- 9、 存储少量的有关 Scheduler 的状态信息,假如是用于集群中,可以看到其他的 Scheduler 实例
|
||||
-- ----------------------------
|
||||
create table QRTZ_SCHEDULER_STATE (
|
||||
sched_name varchar(120) not null comment '调度名称',
|
||||
instance_name varchar(200) not null comment '实例名称',
|
||||
last_checkin_time bigint(13) not null comment '上次检查时间',
|
||||
checkin_interval bigint(13) not null comment '检查间隔时间',
|
||||
primary key (sched_name, instance_name)
|
||||
) engine=innodb comment = '调度器状态表';
|
||||
|
||||
-- ----------------------------
|
||||
-- 10、 存储程序的悲观锁的信息(假如使用了悲观锁)
|
||||
-- ----------------------------
|
||||
create table QRTZ_LOCKS (
|
||||
sched_name varchar(120) not null comment '调度名称',
|
||||
lock_name varchar(40) not null comment '悲观锁名称',
|
||||
primary key (sched_name, lock_name)
|
||||
) engine=innodb comment = '存储的悲观锁信息表';
|
||||
|
||||
-- ----------------------------
|
||||
-- 11、 Quartz集群实现同步机制的行锁表
|
||||
-- ----------------------------
|
||||
create table QRTZ_SIMPROP_TRIGGERS (
|
||||
sched_name varchar(120) not null comment '调度名称',
|
||||
trigger_name varchar(200) not null comment 'qrtz_triggers表trigger_name的外键',
|
||||
trigger_group varchar(200) not null comment 'qrtz_triggers表trigger_group的外键',
|
||||
str_prop_1 varchar(512) null comment 'String类型的trigger的第一个参数',
|
||||
str_prop_2 varchar(512) null comment 'String类型的trigger的第二个参数',
|
||||
str_prop_3 varchar(512) null comment 'String类型的trigger的第三个参数',
|
||||
int_prop_1 int null comment 'int类型的trigger的第一个参数',
|
||||
int_prop_2 int null comment 'int类型的trigger的第二个参数',
|
||||
long_prop_1 bigint null comment 'long类型的trigger的第一个参数',
|
||||
long_prop_2 bigint null comment 'long类型的trigger的第二个参数',
|
||||
dec_prop_1 numeric(13,4) null comment 'decimal类型的trigger的第一个参数',
|
||||
dec_prop_2 numeric(13,4) null comment 'decimal类型的trigger的第二个参数',
|
||||
bool_prop_1 varchar(1) null comment 'Boolean类型的trigger的第一个参数',
|
||||
bool_prop_2 varchar(1) null comment 'Boolean类型的trigger的第二个参数',
|
||||
primary key (sched_name, trigger_name, trigger_group),
|
||||
foreign key (sched_name, trigger_name, trigger_group) references QRTZ_TRIGGERS(sched_name, trigger_name, trigger_group)
|
||||
) engine=innodb comment = '同步机制的行锁表';
|
||||
|
||||
commit;
|
|
@ -0,0 +1,699 @@
|
|||
-- ----------------------------
|
||||
-- 1、部门表
|
||||
-- ----------------------------
|
||||
drop table if exists sys_dept;
|
||||
create table sys_dept (
|
||||
dept_id bigint(20) not null auto_increment comment '部门id',
|
||||
parent_id bigint(20) default 0 comment '父部门id',
|
||||
ancestors varchar(50) default '' comment '祖级列表',
|
||||
dept_name varchar(30) default '' comment '部门名称',
|
||||
order_num int(4) default 0 comment '显示顺序',
|
||||
leader varchar(20) default null comment '负责人',
|
||||
phone varchar(11) default null comment '联系电话',
|
||||
email varchar(50) default null comment '邮箱',
|
||||
status char(1) default '0' comment '部门状态(0正常 1停用)',
|
||||
del_flag char(1) default '0' comment '删除标志(0代表存在 2代表删除)',
|
||||
create_by varchar(64) default '' comment '创建者',
|
||||
create_time datetime comment '创建时间',
|
||||
update_by varchar(64) default '' comment '更新者',
|
||||
update_time datetime comment '更新时间',
|
||||
primary key (dept_id)
|
||||
) engine=innodb auto_increment=200 comment = '部门表';
|
||||
|
||||
-- ----------------------------
|
||||
-- 初始化-部门表数据
|
||||
-- ----------------------------
|
||||
insert into sys_dept values(100, 0, '0', '若依科技', 0, '若依', '15888888888', 'ry@qq.com', '0', '0', 'admin', sysdate(), '', null);
|
||||
insert into sys_dept values(101, 100, '0,100', '深圳总公司', 1, '若依', '15888888888', 'ry@qq.com', '0', '0', 'admin', sysdate(), '', null);
|
||||
insert into sys_dept values(102, 100, '0,100', '长沙分公司', 2, '若依', '15888888888', 'ry@qq.com', '0', '0', 'admin', sysdate(), '', null);
|
||||
insert into sys_dept values(103, 101, '0,100,101', '研发部门', 1, '若依', '15888888888', 'ry@qq.com', '0', '0', 'admin', sysdate(), '', null);
|
||||
insert into sys_dept values(104, 101, '0,100,101', '市场部门', 2, '若依', '15888888888', 'ry@qq.com', '0', '0', 'admin', sysdate(), '', null);
|
||||
insert into sys_dept values(105, 101, '0,100,101', '测试部门', 3, '若依', '15888888888', 'ry@qq.com', '0', '0', 'admin', sysdate(), '', null);
|
||||
insert into sys_dept values(106, 101, '0,100,101', '财务部门', 4, '若依', '15888888888', 'ry@qq.com', '0', '0', 'admin', sysdate(), '', null);
|
||||
insert into sys_dept values(107, 101, '0,100,101', '运维部门', 5, '若依', '15888888888', 'ry@qq.com', '0', '0', 'admin', sysdate(), '', null);
|
||||
insert into sys_dept values(108, 102, '0,100,102', '市场部门', 1, '若依', '15888888888', 'ry@qq.com', '0', '0', 'admin', sysdate(), '', null);
|
||||
insert into sys_dept values(109, 102, '0,100,102', '财务部门', 2, '若依', '15888888888', 'ry@qq.com', '0', '0', 'admin', sysdate(), '', null);
|
||||
|
||||
|
||||
-- ----------------------------
|
||||
-- 2、用户信息表
|
||||
-- ----------------------------
|
||||
drop table if exists sys_user;
|
||||
create table sys_user (
|
||||
user_id bigint(20) not null auto_increment comment '用户ID',
|
||||
dept_id bigint(20) default null comment '部门ID',
|
||||
user_name varchar(30) not null comment '用户账号',
|
||||
nick_name varchar(30) not null comment '用户昵称',
|
||||
user_type varchar(2) default '00' comment '用户类型(00系统用户)',
|
||||
email varchar(50) default '' comment '用户邮箱',
|
||||
phonenumber varchar(11) default '' comment '手机号码',
|
||||
sex char(1) default '0' comment '用户性别(0男 1女 2未知)',
|
||||
avatar varchar(100) default '' comment '头像地址',
|
||||
password varchar(100) default '' comment '密码',
|
||||
status char(1) default '0' comment '帐号状态(0正常 1停用)',
|
||||
del_flag char(1) default '0' comment '删除标志(0代表存在 2代表删除)',
|
||||
login_ip varchar(128) default '' comment '最后登录IP',
|
||||
login_date datetime comment '最后登录时间',
|
||||
create_by varchar(64) default '' comment '创建者',
|
||||
create_time datetime comment '创建时间',
|
||||
update_by varchar(64) default '' comment '更新者',
|
||||
update_time datetime comment '更新时间',
|
||||
remark varchar(500) default null comment '备注',
|
||||
primary key (user_id)
|
||||
) engine=innodb auto_increment=100 comment = '用户信息表';
|
||||
|
||||
-- ----------------------------
|
||||
-- 初始化-用户信息表数据
|
||||
-- ----------------------------
|
||||
insert into sys_user values(1, 103, 'admin', '若依', '00', 'ry@163.com', '15888888888', '1', '', '$2a$10$7JB720yubVSZvUI0rEqK/.VqGOZTH.ulu33dHOiBE8ByOhJIrdAu2', '0', '0', '127.0.0.1', sysdate(), 'admin', sysdate(), '', null, '管理员');
|
||||
insert into sys_user values(2, 105, 'ry', '若依', '00', 'ry@qq.com', '15666666666', '1', '', '$2a$10$7JB720yubVSZvUI0rEqK/.VqGOZTH.ulu33dHOiBE8ByOhJIrdAu2', '0', '0', '127.0.0.1', sysdate(), 'admin', sysdate(), '', null, '测试员');
|
||||
|
||||
|
||||
-- ----------------------------
|
||||
-- 3、岗位信息表
|
||||
-- ----------------------------
|
||||
drop table if exists sys_post;
|
||||
create table sys_post
|
||||
(
|
||||
post_id bigint(20) not null auto_increment comment '岗位ID',
|
||||
post_code varchar(64) not null comment '岗位编码',
|
||||
post_name varchar(50) not null comment '岗位名称',
|
||||
post_sort int(4) not null comment '显示顺序',
|
||||
status char(1) not null comment '状态(0正常 1停用)',
|
||||
create_by varchar(64) default '' comment '创建者',
|
||||
create_time datetime comment '创建时间',
|
||||
update_by varchar(64) default '' comment '更新者',
|
||||
update_time datetime comment '更新时间',
|
||||
remark varchar(500) default null comment '备注',
|
||||
primary key (post_id)
|
||||
) engine=innodb comment = '岗位信息表';
|
||||
|
||||
-- ----------------------------
|
||||
-- 初始化-岗位信息表数据
|
||||
-- ----------------------------
|
||||
insert into sys_post values(1, 'ceo', '董事长', 1, '0', 'admin', sysdate(), '', null, '');
|
||||
insert into sys_post values(2, 'se', '项目经理', 2, '0', 'admin', sysdate(), '', null, '');
|
||||
insert into sys_post values(3, 'hr', '人力资源', 3, '0', 'admin', sysdate(), '', null, '');
|
||||
insert into sys_post values(4, 'user', '普通员工', 4, '0', 'admin', sysdate(), '', null, '');
|
||||
|
||||
|
||||
-- ----------------------------
|
||||
-- 4、角色信息表
|
||||
-- ----------------------------
|
||||
drop table if exists sys_role;
|
||||
create table sys_role (
|
||||
role_id bigint(20) not null auto_increment comment '角色ID',
|
||||
role_name varchar(30) not null comment '角色名称',
|
||||
role_key varchar(100) not null comment '角色权限字符串',
|
||||
role_sort int(4) not null comment '显示顺序',
|
||||
data_scope char(1) default '1' comment '数据范围(1:全部数据权限 2:自定数据权限 3:本部门数据权限 4:本部门及以下数据权限)',
|
||||
menu_check_strictly tinyint(1) default 1 comment '菜单树选择项是否关联显示',
|
||||
dept_check_strictly tinyint(1) default 1 comment '部门树选择项是否关联显示',
|
||||
status char(1) not null comment '角色状态(0正常 1停用)',
|
||||
del_flag char(1) default '0' comment '删除标志(0代表存在 2代表删除)',
|
||||
create_by varchar(64) default '' comment '创建者',
|
||||
create_time datetime comment '创建时间',
|
||||
update_by varchar(64) default '' comment '更新者',
|
||||
update_time datetime comment '更新时间',
|
||||
remark varchar(500) default null comment '备注',
|
||||
primary key (role_id)
|
||||
) engine=innodb auto_increment=100 comment = '角色信息表';
|
||||
|
||||
-- ----------------------------
|
||||
-- 初始化-角色信息表数据
|
||||
-- ----------------------------
|
||||
insert into sys_role values('1', '超级管理员', 'admin', 1, 1, 1, 1, '0', '0', 'admin', sysdate(), '', null, '超级管理员');
|
||||
insert into sys_role values('2', '普通角色', 'common', 2, 2, 1, 1, '0', '0', 'admin', sysdate(), '', null, '普通角色');
|
||||
|
||||
|
||||
-- ----------------------------
|
||||
-- 5、菜单权限表
|
||||
-- ----------------------------
|
||||
drop table if exists sys_menu;
|
||||
create table sys_menu (
|
||||
menu_id bigint(20) not null auto_increment comment '菜单ID',
|
||||
menu_name varchar(50) not null comment '菜单名称',
|
||||
parent_id bigint(20) default 0 comment '父菜单ID',
|
||||
order_num int(4) default 0 comment '显示顺序',
|
||||
path varchar(200) default '' comment '路由地址',
|
||||
component varchar(255) default null comment '组件路径',
|
||||
query varchar(255) default null comment '路由参数',
|
||||
is_frame int(1) default 1 comment '是否为外链(0是 1否)',
|
||||
is_cache int(1) default 0 comment '是否缓存(0缓存 1不缓存)',
|
||||
menu_type char(1) default '' comment '菜单类型(M目录 C菜单 F按钮)',
|
||||
visible char(1) default 0 comment '菜单状态(0显示 1隐藏)',
|
||||
status char(1) default 0 comment '菜单状态(0正常 1停用)',
|
||||
perms varchar(100) default null comment '权限标识',
|
||||
icon varchar(100) default '#' comment '菜单图标',
|
||||
create_by varchar(64) default '' comment '创建者',
|
||||
create_time datetime comment '创建时间',
|
||||
update_by varchar(64) default '' comment '更新者',
|
||||
update_time datetime comment '更新时间',
|
||||
remark varchar(500) default '' comment '备注',
|
||||
primary key (menu_id)
|
||||
) engine=innodb auto_increment=2000 comment = '菜单权限表';
|
||||
|
||||
-- ----------------------------
|
||||
-- 初始化-菜单信息表数据
|
||||
-- ----------------------------
|
||||
-- 一级菜单
|
||||
insert into sys_menu values('1', '系统管理', '0', '1', 'system', null, '', 1, 0, 'M', '0', '0', '', 'system', 'admin', sysdate(), '', null, '系统管理目录');
|
||||
insert into sys_menu values('2', '系统监控', '0', '2', 'monitor', null, '', 1, 0, 'M', '0', '0', '', 'monitor', 'admin', sysdate(), '', null, '系统监控目录');
|
||||
insert into sys_menu values('3', '系统工具', '0', '3', 'tool', null, '', 1, 0, 'M', '0', '0', '', 'tool', 'admin', sysdate(), '', null, '系统工具目录');
|
||||
insert into sys_menu values('4', '若依官网', '0', '4', 'http://ruoyi.vip', null, '', 0, 0, 'M', '0', '0', '', 'guide', 'admin', sysdate(), '', null, '若依官网地址');
|
||||
-- 二级菜单
|
||||
insert into sys_menu values('100', '用户管理', '1', '1', 'user', 'system/user/index', '', 1, 0, 'C', '0', '0', 'system:user:list', 'user', 'admin', sysdate(), '', null, '用户管理菜单');
|
||||
insert into sys_menu values('101', '角色管理', '1', '2', 'role', 'system/role/index', '', 1, 0, 'C', '0', '0', 'system:role:list', 'peoples', 'admin', sysdate(), '', null, '角色管理菜单');
|
||||
insert into sys_menu values('102', '菜单管理', '1', '3', 'menu', 'system/menu/index', '', 1, 0, 'C', '0', '0', 'system:menu:list', 'tree-table', 'admin', sysdate(), '', null, '菜单管理菜单');
|
||||
insert into sys_menu values('103', '部门管理', '1', '4', 'dept', 'system/dept/index', '', 1, 0, 'C', '0', '0', 'system:dept:list', 'tree', 'admin', sysdate(), '', null, '部门管理菜单');
|
||||
insert into sys_menu values('104', '岗位管理', '1', '5', 'post', 'system/post/index', '', 1, 0, 'C', '0', '0', 'system:post:list', 'post', 'admin', sysdate(), '', null, '岗位管理菜单');
|
||||
insert into sys_menu values('105', '字典管理', '1', '6', 'dict', 'system/dict/index', '', 1, 0, 'C', '0', '0', 'system:dict:list', 'dict', 'admin', sysdate(), '', null, '字典管理菜单');
|
||||
insert into sys_menu values('106', '参数设置', '1', '7', 'config', 'system/config/index', '', 1, 0, 'C', '0', '0', 'system:config:list', 'edit', 'admin', sysdate(), '', null, '参数设置菜单');
|
||||
insert into sys_menu values('107', '通知公告', '1', '8', 'notice', 'system/notice/index', '', 1, 0, 'C', '0', '0', 'system:notice:list', 'message', 'admin', sysdate(), '', null, '通知公告菜单');
|
||||
insert into sys_menu values('108', '日志管理', '1', '9', 'log', '', '', 1, 0, 'M', '0', '0', '', 'log', 'admin', sysdate(), '', null, '日志管理菜单');
|
||||
insert into sys_menu values('109', '在线用户', '2', '1', 'online', 'monitor/online/index', '', 1, 0, 'C', '0', '0', 'monitor:online:list', 'online', 'admin', sysdate(), '', null, '在线用户菜单');
|
||||
insert into sys_menu values('110', '定时任务', '2', '2', 'job', 'monitor/job/index', '', 1, 0, 'C', '0', '0', 'monitor:job:list', 'job', 'admin', sysdate(), '', null, '定时任务菜单');
|
||||
insert into sys_menu values('111', '数据监控', '2', '3', 'druid', 'monitor/druid/index', '', 1, 0, 'C', '0', '0', 'monitor:druid:list', 'druid', 'admin', sysdate(), '', null, '数据监控菜单');
|
||||
insert into sys_menu values('112', '服务监控', '2', '4', 'server', 'monitor/server/index', '', 1, 0, 'C', '0', '0', 'monitor:server:list', 'server', 'admin', sysdate(), '', null, '服务监控菜单');
|
||||
insert into sys_menu values('113', '缓存监控', '2', '5', 'cache', 'monitor/cache/index', '', 1, 0, 'C', '0', '0', 'monitor:cache:list', 'redis', 'admin', sysdate(), '', null, '缓存监控菜单');
|
||||
insert into sys_menu values('114', '缓存列表', '2', '6', 'cacheList', 'monitor/cache/list', '', 1, 0, 'C', '0', '0', 'monitor:cache:list', 'redis-list', 'admin', sysdate(), '', null, '缓存列表菜单');
|
||||
insert into sys_menu values('115', '表单构建', '3', '1', 'build', 'tool/build/index', '', 1, 0, 'C', '0', '0', 'tool:build:list', 'build', 'admin', sysdate(), '', null, '表单构建菜单');
|
||||
insert into sys_menu values('116', '代码生成', '3', '2', 'gen', 'tool/gen/index', '', 1, 0, 'C', '0', '0', 'tool:gen:list', 'code', 'admin', sysdate(), '', null, '代码生成菜单');
|
||||
insert into sys_menu values('117', '系统接口', '3', '3', 'swagger', 'tool/swagger/index', '', 1, 0, 'C', '0', '0', 'tool:swagger:list', 'swagger', 'admin', sysdate(), '', null, '系统接口菜单');
|
||||
-- 三级菜单
|
||||
insert into sys_menu values('500', '操作日志', '108', '1', 'operlog', 'monitor/operlog/index', '', 1, 0, 'C', '0', '0', 'monitor:operlog:list', 'form', 'admin', sysdate(), '', null, '操作日志菜单');
|
||||
insert into sys_menu values('501', '登录日志', '108', '2', 'logininfor', 'monitor/logininfor/index', '', 1, 0, 'C', '0', '0', 'monitor:logininfor:list', 'logininfor', 'admin', sysdate(), '', null, '登录日志菜单');
|
||||
-- 用户管理按钮
|
||||
insert into sys_menu values('1000', '用户查询', '100', '1', '', '', '', 1, 0, 'F', '0', '0', 'system:user:query', '#', 'admin', sysdate(), '', null, '');
|
||||
insert into sys_menu values('1001', '用户新增', '100', '2', '', '', '', 1, 0, 'F', '0', '0', 'system:user:add', '#', 'admin', sysdate(), '', null, '');
|
||||
insert into sys_menu values('1002', '用户修改', '100', '3', '', '', '', 1, 0, 'F', '0', '0', 'system:user:edit', '#', 'admin', sysdate(), '', null, '');
|
||||
insert into sys_menu values('1003', '用户删除', '100', '4', '', '', '', 1, 0, 'F', '0', '0', 'system:user:remove', '#', 'admin', sysdate(), '', null, '');
|
||||
insert into sys_menu values('1004', '用户导出', '100', '5', '', '', '', 1, 0, 'F', '0', '0', 'system:user:export', '#', 'admin', sysdate(), '', null, '');
|
||||
insert into sys_menu values('1005', '用户导入', '100', '6', '', '', '', 1, 0, 'F', '0', '0', 'system:user:import', '#', 'admin', sysdate(), '', null, '');
|
||||
insert into sys_menu values('1006', '重置密码', '100', '7', '', '', '', 1, 0, 'F', '0', '0', 'system:user:resetPwd', '#', 'admin', sysdate(), '', null, '');
|
||||
-- 角色管理按钮
|
||||
insert into sys_menu values('1007', '角色查询', '101', '1', '', '', '', 1, 0, 'F', '0', '0', 'system:role:query', '#', 'admin', sysdate(), '', null, '');
|
||||
insert into sys_menu values('1008', '角色新增', '101', '2', '', '', '', 1, 0, 'F', '0', '0', 'system:role:add', '#', 'admin', sysdate(), '', null, '');
|
||||
insert into sys_menu values('1009', '角色修改', '101', '3', '', '', '', 1, 0, 'F', '0', '0', 'system:role:edit', '#', 'admin', sysdate(), '', null, '');
|
||||
insert into sys_menu values('1010', '角色删除', '101', '4', '', '', '', 1, 0, 'F', '0', '0', 'system:role:remove', '#', 'admin', sysdate(), '', null, '');
|
||||
insert into sys_menu values('1011', '角色导出', '101', '5', '', '', '', 1, 0, 'F', '0', '0', 'system:role:export', '#', 'admin', sysdate(), '', null, '');
|
||||
-- 菜单管理按钮
|
||||
insert into sys_menu values('1012', '菜单查询', '102', '1', '', '', '', 1, 0, 'F', '0', '0', 'system:menu:query', '#', 'admin', sysdate(), '', null, '');
|
||||
insert into sys_menu values('1013', '菜单新增', '102', '2', '', '', '', 1, 0, 'F', '0', '0', 'system:menu:add', '#', 'admin', sysdate(), '', null, '');
|
||||
insert into sys_menu values('1014', '菜单修改', '102', '3', '', '', '', 1, 0, 'F', '0', '0', 'system:menu:edit', '#', 'admin', sysdate(), '', null, '');
|
||||
insert into sys_menu values('1015', '菜单删除', '102', '4', '', '', '', 1, 0, 'F', '0', '0', 'system:menu:remove', '#', 'admin', sysdate(), '', null, '');
|
||||
-- 部门管理按钮
|
||||
insert into sys_menu values('1016', '部门查询', '103', '1', '', '', '', 1, 0, 'F', '0', '0', 'system:dept:query', '#', 'admin', sysdate(), '', null, '');
|
||||
insert into sys_menu values('1017', '部门新增', '103', '2', '', '', '', 1, 0, 'F', '0', '0', 'system:dept:add', '#', 'admin', sysdate(), '', null, '');
|
||||
insert into sys_menu values('1018', '部门修改', '103', '3', '', '', '', 1, 0, 'F', '0', '0', 'system:dept:edit', '#', 'admin', sysdate(), '', null, '');
|
||||
insert into sys_menu values('1019', '部门删除', '103', '4', '', '', '', 1, 0, 'F', '0', '0', 'system:dept:remove', '#', 'admin', sysdate(), '', null, '');
|
||||
-- 岗位管理按钮
|
||||
insert into sys_menu values('1020', '岗位查询', '104', '1', '', '', '', 1, 0, 'F', '0', '0', 'system:post:query', '#', 'admin', sysdate(), '', null, '');
|
||||
insert into sys_menu values('1021', '岗位新增', '104', '2', '', '', '', 1, 0, 'F', '0', '0', 'system:post:add', '#', 'admin', sysdate(), '', null, '');
|
||||
insert into sys_menu values('1022', '岗位修改', '104', '3', '', '', '', 1, 0, 'F', '0', '0', 'system:post:edit', '#', 'admin', sysdate(), '', null, '');
|
||||
insert into sys_menu values('1023', '岗位删除', '104', '4', '', '', '', 1, 0, 'F', '0', '0', 'system:post:remove', '#', 'admin', sysdate(), '', null, '');
|
||||
insert into sys_menu values('1024', '岗位导出', '104', '5', '', '', '', 1, 0, 'F', '0', '0', 'system:post:export', '#', 'admin', sysdate(), '', null, '');
|
||||
-- 字典管理按钮
|
||||
insert into sys_menu values('1025', '字典查询', '105', '1', '#', '', '', 1, 0, 'F', '0', '0', 'system:dict:query', '#', 'admin', sysdate(), '', null, '');
|
||||
insert into sys_menu values('1026', '字典新增', '105', '2', '#', '', '', 1, 0, 'F', '0', '0', 'system:dict:add', '#', 'admin', sysdate(), '', null, '');
|
||||
insert into sys_menu values('1027', '字典修改', '105', '3', '#', '', '', 1, 0, 'F', '0', '0', 'system:dict:edit', '#', 'admin', sysdate(), '', null, '');
|
||||
insert into sys_menu values('1028', '字典删除', '105', '4', '#', '', '', 1, 0, 'F', '0', '0', 'system:dict:remove', '#', 'admin', sysdate(), '', null, '');
|
||||
insert into sys_menu values('1029', '字典导出', '105', '5', '#', '', '', 1, 0, 'F', '0', '0', 'system:dict:export', '#', 'admin', sysdate(), '', null, '');
|
||||
-- 参数设置按钮
|
||||
insert into sys_menu values('1030', '参数查询', '106', '1', '#', '', '', 1, 0, 'F', '0', '0', 'system:config:query', '#', 'admin', sysdate(), '', null, '');
|
||||
insert into sys_menu values('1031', '参数新增', '106', '2', '#', '', '', 1, 0, 'F', '0', '0', 'system:config:add', '#', 'admin', sysdate(), '', null, '');
|
||||
insert into sys_menu values('1032', '参数修改', '106', '3', '#', '', '', 1, 0, 'F', '0', '0', 'system:config:edit', '#', 'admin', sysdate(), '', null, '');
|
||||
insert into sys_menu values('1033', '参数删除', '106', '4', '#', '', '', 1, 0, 'F', '0', '0', 'system:config:remove', '#', 'admin', sysdate(), '', null, '');
|
||||
insert into sys_menu values('1034', '参数导出', '106', '5', '#', '', '', 1, 0, 'F', '0', '0', 'system:config:export', '#', 'admin', sysdate(), '', null, '');
|
||||
-- 通知公告按钮
|
||||
insert into sys_menu values('1035', '公告查询', '107', '1', '#', '', '', 1, 0, 'F', '0', '0', 'system:notice:query', '#', 'admin', sysdate(), '', null, '');
|
||||
insert into sys_menu values('1036', '公告新增', '107', '2', '#', '', '', 1, 0, 'F', '0', '0', 'system:notice:add', '#', 'admin', sysdate(), '', null, '');
|
||||
insert into sys_menu values('1037', '公告修改', '107', '3', '#', '', '', 1, 0, 'F', '0', '0', 'system:notice:edit', '#', 'admin', sysdate(), '', null, '');
|
||||
insert into sys_menu values('1038', '公告删除', '107', '4', '#', '', '', 1, 0, 'F', '0', '0', 'system:notice:remove', '#', 'admin', sysdate(), '', null, '');
|
||||
-- 操作日志按钮
|
||||
insert into sys_menu values('1039', '操作查询', '500', '1', '#', '', '', 1, 0, 'F', '0', '0', 'monitor:operlog:query', '#', 'admin', sysdate(), '', null, '');
|
||||
insert into sys_menu values('1040', '操作删除', '500', '2', '#', '', '', 1, 0, 'F', '0', '0', 'monitor:operlog:remove', '#', 'admin', sysdate(), '', null, '');
|
||||
insert into sys_menu values('1041', '日志导出', '500', '3', '#', '', '', 1, 0, 'F', '0', '0', 'monitor:operlog:export', '#', 'admin', sysdate(), '', null, '');
|
||||
-- 登录日志按钮
|
||||
insert into sys_menu values('1042', '登录查询', '501', '1', '#', '', '', 1, 0, 'F', '0', '0', 'monitor:logininfor:query', '#', 'admin', sysdate(), '', null, '');
|
||||
insert into sys_menu values('1043', '登录删除', '501', '2', '#', '', '', 1, 0, 'F', '0', '0', 'monitor:logininfor:remove', '#', 'admin', sysdate(), '', null, '');
|
||||
insert into sys_menu values('1044', '日志导出', '501', '3', '#', '', '', 1, 0, 'F', '0', '0', 'monitor:logininfor:export', '#', 'admin', sysdate(), '', null, '');
|
||||
insert into sys_menu values('1045', '账户解锁', '501', '4', '#', '', '', 1, 0, 'F', '0', '0', 'monitor:logininfor:unlock', '#', 'admin', sysdate(), '', null, '');
|
||||
-- 在线用户按钮
|
||||
insert into sys_menu values('1046', '在线查询', '109', '1', '#', '', '', 1, 0, 'F', '0', '0', 'monitor:online:query', '#', 'admin', sysdate(), '', null, '');
|
||||
insert into sys_menu values('1047', '批量强退', '109', '2', '#', '', '', 1, 0, 'F', '0', '0', 'monitor:online:batchLogout', '#', 'admin', sysdate(), '', null, '');
|
||||
insert into sys_menu values('1048', '单条强退', '109', '3', '#', '', '', 1, 0, 'F', '0', '0', 'monitor:online:forceLogout', '#', 'admin', sysdate(), '', null, '');
|
||||
-- 定时任务按钮
|
||||
insert into sys_menu values('1049', '任务查询', '110', '1', '#', '', '', 1, 0, 'F', '0', '0', 'monitor:job:query', '#', 'admin', sysdate(), '', null, '');
|
||||
insert into sys_menu values('1050', '任务新增', '110', '2', '#', '', '', 1, 0, 'F', '0', '0', 'monitor:job:add', '#', 'admin', sysdate(), '', null, '');
|
||||
insert into sys_menu values('1051', '任务修改', '110', '3', '#', '', '', 1, 0, 'F', '0', '0', 'monitor:job:edit', '#', 'admin', sysdate(), '', null, '');
|
||||
insert into sys_menu values('1052', '任务删除', '110', '4', '#', '', '', 1, 0, 'F', '0', '0', 'monitor:job:remove', '#', 'admin', sysdate(), '', null, '');
|
||||
insert into sys_menu values('1053', '状态修改', '110', '5', '#', '', '', 1, 0, 'F', '0', '0', 'monitor:job:changeStatus', '#', 'admin', sysdate(), '', null, '');
|
||||
insert into sys_menu values('1054', '任务导出', '110', '6', '#', '', '', 1, 0, 'F', '0', '0', 'monitor:job:export', '#', 'admin', sysdate(), '', null, '');
|
||||
-- 代码生成按钮
|
||||
insert into sys_menu values('1055', '生成查询', '116', '1', '#', '', '', 1, 0, 'F', '0', '0', 'tool:gen:query', '#', 'admin', sysdate(), '', null, '');
|
||||
insert into sys_menu values('1056', '生成修改', '116', '2', '#', '', '', 1, 0, 'F', '0', '0', 'tool:gen:edit', '#', 'admin', sysdate(), '', null, '');
|
||||
insert into sys_menu values('1057', '生成删除', '116', '3', '#', '', '', 1, 0, 'F', '0', '0', 'tool:gen:remove', '#', 'admin', sysdate(), '', null, '');
|
||||
insert into sys_menu values('1058', '导入代码', '116', '4', '#', '', '', 1, 0, 'F', '0', '0', 'tool:gen:import', '#', 'admin', sysdate(), '', null, '');
|
||||
insert into sys_menu values('1059', '预览代码', '116', '5', '#', '', '', 1, 0, 'F', '0', '0', 'tool:gen:preview', '#', 'admin', sysdate(), '', null, '');
|
||||
insert into sys_menu values('1060', '生成代码', '116', '6', '#', '', '', 1, 0, 'F', '0', '0', 'tool:gen:code', '#', 'admin', sysdate(), '', null, '');
|
||||
|
||||
|
||||
-- ----------------------------
|
||||
-- 6、用户和角色关联表 用户N-1角色
|
||||
-- ----------------------------
|
||||
drop table if exists sys_user_role;
|
||||
create table sys_user_role (
|
||||
user_id bigint(20) not null comment '用户ID',
|
||||
role_id bigint(20) not null comment '角色ID',
|
||||
primary key(user_id, role_id)
|
||||
) engine=innodb comment = '用户和角色关联表';
|
||||
|
||||
-- ----------------------------
|
||||
-- 初始化-用户和角色关联表数据
|
||||
-- ----------------------------
|
||||
insert into sys_user_role values ('1', '1');
|
||||
insert into sys_user_role values ('2', '2');
|
||||
|
||||
|
||||
-- ----------------------------
|
||||
-- 7、角色和菜单关联表 角色1-N菜单
|
||||
-- ----------------------------
|
||||
drop table if exists sys_role_menu;
|
||||
create table sys_role_menu (
|
||||
role_id bigint(20) not null comment '角色ID',
|
||||
menu_id bigint(20) not null comment '菜单ID',
|
||||
primary key(role_id, menu_id)
|
||||
) engine=innodb comment = '角色和菜单关联表';
|
||||
|
||||
-- ----------------------------
|
||||
-- 初始化-角色和菜单关联表数据
|
||||
-- ----------------------------
|
||||
insert into sys_role_menu values ('2', '1');
|
||||
insert into sys_role_menu values ('2', '2');
|
||||
insert into sys_role_menu values ('2', '3');
|
||||
insert into sys_role_menu values ('2', '4');
|
||||
insert into sys_role_menu values ('2', '100');
|
||||
insert into sys_role_menu values ('2', '101');
|
||||
insert into sys_role_menu values ('2', '102');
|
||||
insert into sys_role_menu values ('2', '103');
|
||||
insert into sys_role_menu values ('2', '104');
|
||||
insert into sys_role_menu values ('2', '105');
|
||||
insert into sys_role_menu values ('2', '106');
|
||||
insert into sys_role_menu values ('2', '107');
|
||||
insert into sys_role_menu values ('2', '108');
|
||||
insert into sys_role_menu values ('2', '109');
|
||||
insert into sys_role_menu values ('2', '110');
|
||||
insert into sys_role_menu values ('2', '111');
|
||||
insert into sys_role_menu values ('2', '112');
|
||||
insert into sys_role_menu values ('2', '113');
|
||||
insert into sys_role_menu values ('2', '114');
|
||||
insert into sys_role_menu values ('2', '115');
|
||||
insert into sys_role_menu values ('2', '116');
|
||||
insert into sys_role_menu values ('2', '117');
|
||||
insert into sys_role_menu values ('2', '500');
|
||||
insert into sys_role_menu values ('2', '501');
|
||||
insert into sys_role_menu values ('2', '1000');
|
||||
insert into sys_role_menu values ('2', '1001');
|
||||
insert into sys_role_menu values ('2', '1002');
|
||||
insert into sys_role_menu values ('2', '1003');
|
||||
insert into sys_role_menu values ('2', '1004');
|
||||
insert into sys_role_menu values ('2', '1005');
|
||||
insert into sys_role_menu values ('2', '1006');
|
||||
insert into sys_role_menu values ('2', '1007');
|
||||
insert into sys_role_menu values ('2', '1008');
|
||||
insert into sys_role_menu values ('2', '1009');
|
||||
insert into sys_role_menu values ('2', '1010');
|
||||
insert into sys_role_menu values ('2', '1011');
|
||||
insert into sys_role_menu values ('2', '1012');
|
||||
insert into sys_role_menu values ('2', '1013');
|
||||
insert into sys_role_menu values ('2', '1014');
|
||||
insert into sys_role_menu values ('2', '1015');
|
||||
insert into sys_role_menu values ('2', '1016');
|
||||
insert into sys_role_menu values ('2', '1017');
|
||||
insert into sys_role_menu values ('2', '1018');
|
||||
insert into sys_role_menu values ('2', '1019');
|
||||
insert into sys_role_menu values ('2', '1020');
|
||||
insert into sys_role_menu values ('2', '1021');
|
||||
insert into sys_role_menu values ('2', '1022');
|
||||
insert into sys_role_menu values ('2', '1023');
|
||||
insert into sys_role_menu values ('2', '1024');
|
||||
insert into sys_role_menu values ('2', '1025');
|
||||
insert into sys_role_menu values ('2', '1026');
|
||||
insert into sys_role_menu values ('2', '1027');
|
||||
insert into sys_role_menu values ('2', '1028');
|
||||
insert into sys_role_menu values ('2', '1029');
|
||||
insert into sys_role_menu values ('2', '1030');
|
||||
insert into sys_role_menu values ('2', '1031');
|
||||
insert into sys_role_menu values ('2', '1032');
|
||||
insert into sys_role_menu values ('2', '1033');
|
||||
insert into sys_role_menu values ('2', '1034');
|
||||
insert into sys_role_menu values ('2', '1035');
|
||||
insert into sys_role_menu values ('2', '1036');
|
||||
insert into sys_role_menu values ('2', '1037');
|
||||
insert into sys_role_menu values ('2', '1038');
|
||||
insert into sys_role_menu values ('2', '1039');
|
||||
insert into sys_role_menu values ('2', '1040');
|
||||
insert into sys_role_menu values ('2', '1041');
|
||||
insert into sys_role_menu values ('2', '1042');
|
||||
insert into sys_role_menu values ('2', '1043');
|
||||
insert into sys_role_menu values ('2', '1044');
|
||||
insert into sys_role_menu values ('2', '1045');
|
||||
insert into sys_role_menu values ('2', '1046');
|
||||
insert into sys_role_menu values ('2', '1047');
|
||||
insert into sys_role_menu values ('2', '1048');
|
||||
insert into sys_role_menu values ('2', '1049');
|
||||
insert into sys_role_menu values ('2', '1050');
|
||||
insert into sys_role_menu values ('2', '1051');
|
||||
insert into sys_role_menu values ('2', '1052');
|
||||
insert into sys_role_menu values ('2', '1053');
|
||||
insert into sys_role_menu values ('2', '1054');
|
||||
insert into sys_role_menu values ('2', '1055');
|
||||
insert into sys_role_menu values ('2', '1056');
|
||||
insert into sys_role_menu values ('2', '1057');
|
||||
insert into sys_role_menu values ('2', '1058');
|
||||
insert into sys_role_menu values ('2', '1059');
|
||||
insert into sys_role_menu values ('2', '1060');
|
||||
|
||||
-- ----------------------------
|
||||
-- 8、角色和部门关联表 角色1-N部门
|
||||
-- ----------------------------
|
||||
drop table if exists sys_role_dept;
|
||||
create table sys_role_dept (
|
||||
role_id bigint(20) not null comment '角色ID',
|
||||
dept_id bigint(20) not null comment '部门ID',
|
||||
primary key(role_id, dept_id)
|
||||
) engine=innodb comment = '角色和部门关联表';
|
||||
|
||||
-- ----------------------------
|
||||
-- 初始化-角色和部门关联表数据
|
||||
-- ----------------------------
|
||||
insert into sys_role_dept values ('2', '100');
|
||||
insert into sys_role_dept values ('2', '101');
|
||||
insert into sys_role_dept values ('2', '105');
|
||||
|
||||
|
||||
-- ----------------------------
|
||||
-- 9、用户与岗位关联表 用户1-N岗位
|
||||
-- ----------------------------
|
||||
drop table if exists sys_user_post;
|
||||
create table sys_user_post
|
||||
(
|
||||
user_id bigint(20) not null comment '用户ID',
|
||||
post_id bigint(20) not null comment '岗位ID',
|
||||
primary key (user_id, post_id)
|
||||
) engine=innodb comment = '用户与岗位关联表';
|
||||
|
||||
-- ----------------------------
|
||||
-- 初始化-用户与岗位关联表数据
|
||||
-- ----------------------------
|
||||
insert into sys_user_post values ('1', '1');
|
||||
insert into sys_user_post values ('2', '2');
|
||||
|
||||
|
||||
-- ----------------------------
|
||||
-- 10、操作日志记录
|
||||
-- ----------------------------
|
||||
drop table if exists sys_oper_log;
|
||||
create table sys_oper_log (
|
||||
oper_id bigint(20) not null auto_increment comment '日志主键',
|
||||
title varchar(50) default '' comment '模块标题',
|
||||
business_type int(2) default 0 comment '业务类型(0其它 1新增 2修改 3删除)',
|
||||
method varchar(100) default '' comment '方法名称',
|
||||
request_method varchar(10) default '' comment '请求方式',
|
||||
operator_type int(1) default 0 comment '操作类别(0其它 1后台用户 2手机端用户)',
|
||||
oper_name varchar(50) default '' comment '操作人员',
|
||||
dept_name varchar(50) default '' comment '部门名称',
|
||||
oper_url varchar(255) default '' comment '请求URL',
|
||||
oper_ip varchar(128) default '' comment '主机地址',
|
||||
oper_location varchar(255) default '' comment '操作地点',
|
||||
oper_param varchar(2000) default '' comment '请求参数',
|
||||
json_result varchar(2000) default '' comment '返回参数',
|
||||
status int(1) default 0 comment '操作状态(0正常 1异常)',
|
||||
error_msg varchar(2000) default '' comment '错误消息',
|
||||
oper_time datetime comment '操作时间',
|
||||
cost_time bigint(20) default 0 comment '消耗时间',
|
||||
primary key (oper_id),
|
||||
key idx_sys_oper_log_bt (business_type),
|
||||
key idx_sys_oper_log_s (status),
|
||||
key idx_sys_oper_log_ot (oper_time)
|
||||
) engine=innodb auto_increment=100 comment = '操作日志记录';
|
||||
|
||||
|
||||
-- ----------------------------
|
||||
-- 11、字典类型表
|
||||
-- ----------------------------
|
||||
drop table if exists sys_dict_type;
|
||||
create table sys_dict_type
|
||||
(
|
||||
dict_id bigint(20) not null auto_increment comment '字典主键',
|
||||
dict_name varchar(100) default '' comment '字典名称',
|
||||
dict_type varchar(100) default '' comment '字典类型',
|
||||
status char(1) default '0' comment '状态(0正常 1停用)',
|
||||
create_by varchar(64) default '' comment '创建者',
|
||||
create_time datetime comment '创建时间',
|
||||
update_by varchar(64) default '' comment '更新者',
|
||||
update_time datetime comment '更新时间',
|
||||
remark varchar(500) default null comment '备注',
|
||||
primary key (dict_id),
|
||||
unique (dict_type)
|
||||
) engine=innodb auto_increment=100 comment = '字典类型表';
|
||||
|
||||
insert into sys_dict_type values(1, '用户性别', 'sys_user_sex', '0', 'admin', sysdate(), '', null, '用户性别列表');
|
||||
insert into sys_dict_type values(2, '菜单状态', 'sys_show_hide', '0', 'admin', sysdate(), '', null, '菜单状态列表');
|
||||
insert into sys_dict_type values(3, '系统开关', 'sys_normal_disable', '0', 'admin', sysdate(), '', null, '系统开关列表');
|
||||
insert into sys_dict_type values(4, '任务状态', 'sys_job_status', '0', 'admin', sysdate(), '', null, '任务状态列表');
|
||||
insert into sys_dict_type values(5, '任务分组', 'sys_job_group', '0', 'admin', sysdate(), '', null, '任务分组列表');
|
||||
insert into sys_dict_type values(6, '系统是否', 'sys_yes_no', '0', 'admin', sysdate(), '', null, '系统是否列表');
|
||||
insert into sys_dict_type values(7, '通知类型', 'sys_notice_type', '0', 'admin', sysdate(), '', null, '通知类型列表');
|
||||
insert into sys_dict_type values(8, '通知状态', 'sys_notice_status', '0', 'admin', sysdate(), '', null, '通知状态列表');
|
||||
insert into sys_dict_type values(9, '操作类型', 'sys_oper_type', '0', 'admin', sysdate(), '', null, '操作类型列表');
|
||||
insert into sys_dict_type values(10, '系统状态', 'sys_common_status', '0', 'admin', sysdate(), '', null, '登录状态列表');
|
||||
|
||||
|
||||
-- ----------------------------
|
||||
-- 12、字典数据表
|
||||
-- ----------------------------
|
||||
drop table if exists sys_dict_data;
|
||||
create table sys_dict_data
|
||||
(
|
||||
dict_code bigint(20) not null auto_increment comment '字典编码',
|
||||
dict_sort int(4) default 0 comment '字典排序',
|
||||
dict_label varchar(100) default '' comment '字典标签',
|
||||
dict_value varchar(100) default '' comment '字典键值',
|
||||
dict_type varchar(100) default '' comment '字典类型',
|
||||
css_class varchar(100) default null comment '样式属性(其他样式扩展)',
|
||||
list_class varchar(100) default null comment '表格回显样式',
|
||||
is_default char(1) default 'N' comment '是否默认(Y是 N否)',
|
||||
status char(1) default '0' comment '状态(0正常 1停用)',
|
||||
create_by varchar(64) default '' comment '创建者',
|
||||
create_time datetime comment '创建时间',
|
||||
update_by varchar(64) default '' comment '更新者',
|
||||
update_time datetime comment '更新时间',
|
||||
remark varchar(500) default null comment '备注',
|
||||
primary key (dict_code)
|
||||
) engine=innodb auto_increment=100 comment = '字典数据表';
|
||||
|
||||
insert into sys_dict_data values(1, 1, '男', '0', 'sys_user_sex', '', '', 'Y', '0', 'admin', sysdate(), '', null, '性别男');
|
||||
insert into sys_dict_data values(2, 2, '女', '1', 'sys_user_sex', '', '', 'N', '0', 'admin', sysdate(), '', null, '性别女');
|
||||
insert into sys_dict_data values(3, 3, '未知', '2', 'sys_user_sex', '', '', 'N', '0', 'admin', sysdate(), '', null, '性别未知');
|
||||
insert into sys_dict_data values(4, 1, '显示', '0', 'sys_show_hide', '', 'primary', 'Y', '0', 'admin', sysdate(), '', null, '显示菜单');
|
||||
insert into sys_dict_data values(5, 2, '隐藏', '1', 'sys_show_hide', '', 'danger', 'N', '0', 'admin', sysdate(), '', null, '隐藏菜单');
|
||||
insert into sys_dict_data values(6, 1, '正常', '0', 'sys_normal_disable', '', 'primary', 'Y', '0', 'admin', sysdate(), '', null, '正常状态');
|
||||
insert into sys_dict_data values(7, 2, '停用', '1', 'sys_normal_disable', '', 'danger', 'N', '0', 'admin', sysdate(), '', null, '停用状态');
|
||||
insert into sys_dict_data values(8, 1, '正常', '0', 'sys_job_status', '', 'primary', 'Y', '0', 'admin', sysdate(), '', null, '正常状态');
|
||||
insert into sys_dict_data values(9, 2, '暂停', '1', 'sys_job_status', '', 'danger', 'N', '0', 'admin', sysdate(), '', null, '停用状态');
|
||||
insert into sys_dict_data values(10, 1, '默认', 'DEFAULT', 'sys_job_group', '', '', 'Y', '0', 'admin', sysdate(), '', null, '默认分组');
|
||||
insert into sys_dict_data values(11, 2, '系统', 'SYSTEM', 'sys_job_group', '', '', 'N', '0', 'admin', sysdate(), '', null, '系统分组');
|
||||
insert into sys_dict_data values(12, 1, '是', 'Y', 'sys_yes_no', '', 'primary', 'Y', '0', 'admin', sysdate(), '', null, '系统默认是');
|
||||
insert into sys_dict_data values(13, 2, '否', 'N', 'sys_yes_no', '', 'danger', 'N', '0', 'admin', sysdate(), '', null, '系统默认否');
|
||||
insert into sys_dict_data values(14, 1, '通知', '1', 'sys_notice_type', '', 'warning', 'Y', '0', 'admin', sysdate(), '', null, '通知');
|
||||
insert into sys_dict_data values(15, 2, '公告', '2', 'sys_notice_type', '', 'success', 'N', '0', 'admin', sysdate(), '', null, '公告');
|
||||
insert into sys_dict_data values(16, 1, '正常', '0', 'sys_notice_status', '', 'primary', 'Y', '0', 'admin', sysdate(), '', null, '正常状态');
|
||||
insert into sys_dict_data values(17, 2, '关闭', '1', 'sys_notice_status', '', 'danger', 'N', '0', 'admin', sysdate(), '', null, '关闭状态');
|
||||
insert into sys_dict_data values(18, 99, '其他', '0', 'sys_oper_type', '', 'info', 'N', '0', 'admin', sysdate(), '', null, '其他操作');
|
||||
insert into sys_dict_data values(19, 1, '新增', '1', 'sys_oper_type', '', 'info', 'N', '0', 'admin', sysdate(), '', null, '新增操作');
|
||||
insert into sys_dict_data values(20, 2, '修改', '2', 'sys_oper_type', '', 'info', 'N', '0', 'admin', sysdate(), '', null, '修改操作');
|
||||
insert into sys_dict_data values(21, 3, '删除', '3', 'sys_oper_type', '', 'danger', 'N', '0', 'admin', sysdate(), '', null, '删除操作');
|
||||
insert into sys_dict_data values(22, 4, '授权', '4', 'sys_oper_type', '', 'primary', 'N', '0', 'admin', sysdate(), '', null, '授权操作');
|
||||
insert into sys_dict_data values(23, 5, '导出', '5', 'sys_oper_type', '', 'warning', 'N', '0', 'admin', sysdate(), '', null, '导出操作');
|
||||
insert into sys_dict_data values(24, 6, '导入', '6', 'sys_oper_type', '', 'warning', 'N', '0', 'admin', sysdate(), '', null, '导入操作');
|
||||
insert into sys_dict_data values(25, 7, '强退', '7', 'sys_oper_type', '', 'danger', 'N', '0', 'admin', sysdate(), '', null, '强退操作');
|
||||
insert into sys_dict_data values(26, 8, '生成代码', '8', 'sys_oper_type', '', 'warning', 'N', '0', 'admin', sysdate(), '', null, '生成操作');
|
||||
insert into sys_dict_data values(27, 9, '清空数据', '9', 'sys_oper_type', '', 'danger', 'N', '0', 'admin', sysdate(), '', null, '清空操作');
|
||||
insert into sys_dict_data values(28, 1, '成功', '0', 'sys_common_status', '', 'primary', 'N', '0', 'admin', sysdate(), '', null, '正常状态');
|
||||
insert into sys_dict_data values(29, 2, '失败', '1', 'sys_common_status', '', 'danger', 'N', '0', 'admin', sysdate(), '', null, '停用状态');
|
||||
|
||||
|
||||
-- ----------------------------
|
||||
-- 13、参数配置表
|
||||
-- ----------------------------
|
||||
drop table if exists sys_config;
|
||||
create table sys_config (
|
||||
config_id int(5) not null auto_increment comment '参数主键',
|
||||
config_name varchar(100) default '' comment '参数名称',
|
||||
config_key varchar(100) default '' comment '参数键名',
|
||||
config_value varchar(500) default '' comment '参数键值',
|
||||
config_type char(1) default 'N' comment '系统内置(Y是 N否)',
|
||||
create_by varchar(64) default '' comment '创建者',
|
||||
create_time datetime comment '创建时间',
|
||||
update_by varchar(64) default '' comment '更新者',
|
||||
update_time datetime comment '更新时间',
|
||||
remark varchar(500) default null comment '备注',
|
||||
primary key (config_id)
|
||||
) engine=innodb auto_increment=100 comment = '参数配置表';
|
||||
|
||||
insert into sys_config values(1, '主框架页-默认皮肤样式名称', 'sys.index.skinName', 'skin-blue', 'Y', 'admin', sysdate(), '', null, '蓝色 skin-blue、绿色 skin-green、紫色 skin-purple、红色 skin-red、黄色 skin-yellow' );
|
||||
insert into sys_config values(2, '用户管理-账号初始密码', 'sys.user.initPassword', '123456', 'Y', 'admin', sysdate(), '', null, '初始化密码 123456' );
|
||||
insert into sys_config values(3, '主框架页-侧边栏主题', 'sys.index.sideTheme', 'theme-dark', 'Y', 'admin', sysdate(), '', null, '深色主题theme-dark,浅色主题theme-light' );
|
||||
insert into sys_config values(4, '账号自助-验证码开关', 'sys.account.captchaEnabled', 'true', 'Y', 'admin', sysdate(), '', null, '是否开启验证码功能(true开启,false关闭)');
|
||||
insert into sys_config values(5, '账号自助-是否开启用户注册功能', 'sys.account.registerUser', 'false', 'Y', 'admin', sysdate(), '', null, '是否开启注册用户功能(true开启,false关闭)');
|
||||
insert into sys_config values(6, '用户登录-黑名单列表', 'sys.login.blackIPList', '', 'Y', 'admin', sysdate(), '', null, '设置登录IP黑名单限制,多个匹配项以;分隔,支持匹配(*通配、网段)');
|
||||
|
||||
|
||||
-- ----------------------------
|
||||
-- 14、系统访问记录
|
||||
-- ----------------------------
|
||||
drop table if exists sys_logininfor;
|
||||
create table sys_logininfor (
|
||||
info_id bigint(20) not null auto_increment comment '访问ID',
|
||||
user_name varchar(50) default '' comment '用户账号',
|
||||
ipaddr varchar(128) default '' comment '登录IP地址',
|
||||
login_location varchar(255) default '' comment '登录地点',
|
||||
browser varchar(50) default '' comment '浏览器类型',
|
||||
os varchar(50) default '' comment '操作系统',
|
||||
status char(1) default '0' comment '登录状态(0成功 1失败)',
|
||||
msg varchar(255) default '' comment '提示消息',
|
||||
login_time datetime comment '访问时间',
|
||||
primary key (info_id),
|
||||
key idx_sys_logininfor_s (status),
|
||||
key idx_sys_logininfor_lt (login_time)
|
||||
) engine=innodb auto_increment=100 comment = '系统访问记录';
|
||||
|
||||
|
||||
-- ----------------------------
|
||||
-- 15、定时任务调度表
|
||||
-- ----------------------------
|
||||
drop table if exists sys_job;
|
||||
create table sys_job (
|
||||
job_id bigint(20) not null auto_increment comment '任务ID',
|
||||
job_name varchar(64) default '' comment '任务名称',
|
||||
job_group varchar(64) default 'DEFAULT' comment '任务组名',
|
||||
invoke_target varchar(500) not null comment '调用目标字符串',
|
||||
cron_expression varchar(255) default '' comment 'cron执行表达式',
|
||||
misfire_policy varchar(20) default '3' comment '计划执行错误策略(1立即执行 2执行一次 3放弃执行)',
|
||||
concurrent char(1) default '1' comment '是否并发执行(0允许 1禁止)',
|
||||
status char(1) default '0' comment '状态(0正常 1暂停)',
|
||||
create_by varchar(64) default '' comment '创建者',
|
||||
create_time datetime comment '创建时间',
|
||||
update_by varchar(64) default '' comment '更新者',
|
||||
update_time datetime comment '更新时间',
|
||||
remark varchar(500) default '' comment '备注信息',
|
||||
primary key (job_id, job_name, job_group)
|
||||
) engine=innodb auto_increment=100 comment = '定时任务调度表';
|
||||
|
||||
insert into sys_job values(1, '系统默认(无参)', 'DEFAULT', 'ryTask.ryNoParams', '0/10 * * * * ?', '3', '1', '1', 'admin', sysdate(), '', null, '');
|
||||
insert into sys_job values(2, '系统默认(有参)', 'DEFAULT', 'ryTask.ryParams(\'ry\')', '0/15 * * * * ?', '3', '1', '1', 'admin', sysdate(), '', null, '');
|
||||
insert into sys_job values(3, '系统默认(多参)', 'DEFAULT', 'ryTask.ryMultipleParams(\'ry\', true, 2000L, 316.50D, 100)', '0/20 * * * * ?', '3', '1', '1', 'admin', sysdate(), '', null, '');
|
||||
|
||||
|
||||
-- ----------------------------
|
||||
-- 16、定时任务调度日志表
|
||||
-- ----------------------------
|
||||
drop table if exists sys_job_log;
|
||||
create table sys_job_log (
|
||||
job_log_id bigint(20) not null auto_increment comment '任务日志ID',
|
||||
job_name varchar(64) not null comment '任务名称',
|
||||
job_group varchar(64) not null comment '任务组名',
|
||||
invoke_target varchar(500) not null comment '调用目标字符串',
|
||||
job_message varchar(500) comment '日志信息',
|
||||
status char(1) default '0' comment '执行状态(0正常 1失败)',
|
||||
exception_info varchar(2000) default '' comment '异常信息',
|
||||
create_time datetime comment '创建时间',
|
||||
primary key (job_log_id)
|
||||
) engine=innodb comment = '定时任务调度日志表';
|
||||
|
||||
|
||||
-- ----------------------------
|
||||
-- 17、通知公告表
|
||||
-- ----------------------------
|
||||
drop table if exists sys_notice;
|
||||
create table sys_notice (
|
||||
notice_id int(4) not null auto_increment comment '公告ID',
|
||||
notice_title varchar(50) not null comment '公告标题',
|
||||
notice_type char(1) not null comment '公告类型(1通知 2公告)',
|
||||
notice_content longblob default null comment '公告内容',
|
||||
status char(1) default '0' comment '公告状态(0正常 1关闭)',
|
||||
create_by varchar(64) default '' comment '创建者',
|
||||
create_time datetime comment '创建时间',
|
||||
update_by varchar(64) default '' comment '更新者',
|
||||
update_time datetime comment '更新时间',
|
||||
remark varchar(255) default null comment '备注',
|
||||
primary key (notice_id)
|
||||
) engine=innodb auto_increment=10 comment = '通知公告表';
|
||||
|
||||
-- ----------------------------
|
||||
-- 初始化-公告信息表数据
|
||||
-- ----------------------------
|
||||
insert into sys_notice values('1', '温馨提醒:2018-07-01 若依新版本发布啦', '2', '新版本内容', '0', 'admin', sysdate(), '', null, '管理员');
|
||||
insert into sys_notice values('2', '维护通知:2018-07-01 若依系统凌晨维护', '1', '维护内容', '0', 'admin', sysdate(), '', null, '管理员');
|
||||
|
||||
|
||||
-- ----------------------------
|
||||
-- 18、代码生成业务表
|
||||
-- ----------------------------
|
||||
drop table if exists gen_table;
|
||||
create table gen_table (
|
||||
table_id bigint(20) not null auto_increment comment '编号',
|
||||
table_name varchar(200) default '' comment '表名称',
|
||||
table_comment varchar(500) default '' comment '表描述',
|
||||
sub_table_name varchar(64) default null comment '关联子表的表名',
|
||||
sub_table_fk_name varchar(64) default null comment '子表关联的外键名',
|
||||
class_name varchar(100) default '' comment '实体类名称',
|
||||
tpl_category varchar(200) default 'crud' comment '使用的模板(crud单表操作 tree树表操作)',
|
||||
package_name varchar(100) comment '生成包路径',
|
||||
module_name varchar(30) comment '生成模块名',
|
||||
business_name varchar(30) comment '生成业务名',
|
||||
function_name varchar(50) comment '生成功能名',
|
||||
function_author varchar(50) comment '生成功能作者',
|
||||
gen_type char(1) default '0' comment '生成代码方式(0zip压缩包 1自定义路径)',
|
||||
gen_path varchar(200) default '/' comment '生成路径(不填默认项目路径)',
|
||||
options varchar(1000) comment '其它生成选项',
|
||||
create_by varchar(64) default '' comment '创建者',
|
||||
create_time datetime comment '创建时间',
|
||||
update_by varchar(64) default '' comment '更新者',
|
||||
update_time datetime comment '更新时间',
|
||||
remark varchar(500) default null comment '备注',
|
||||
primary key (table_id)
|
||||
) engine=innodb auto_increment=1 comment = '代码生成业务表';
|
||||
|
||||
|
||||
-- ----------------------------
|
||||
-- 19、代码生成业务表字段
|
||||
-- ----------------------------
|
||||
drop table if exists gen_table_column;
|
||||
create table gen_table_column (
|
||||
column_id bigint(20) not null auto_increment comment '编号',
|
||||
table_id varchar(64) comment '归属表编号',
|
||||
column_name varchar(200) comment '列名称',
|
||||
column_comment varchar(500) comment '列描述',
|
||||
column_type varchar(100) comment '列类型',
|
||||
java_type varchar(500) comment 'JAVA类型',
|
||||
java_field varchar(200) comment 'JAVA字段名',
|
||||
is_pk char(1) comment '是否主键(1是)',
|
||||
is_increment char(1) comment '是否自增(1是)',
|
||||
is_required char(1) comment '是否必填(1是)',
|
||||
is_insert char(1) comment '是否为插入字段(1是)',
|
||||
is_edit char(1) comment '是否编辑字段(1是)',
|
||||
is_list char(1) comment '是否列表字段(1是)',
|
||||
is_query char(1) comment '是否查询字段(1是)',
|
||||
query_type varchar(200) default 'EQ' comment '查询方式(等于、不等于、大于、小于、范围)',
|
||||
html_type varchar(200) comment '显示类型(文本框、文本域、下拉框、复选框、单选框、日期控件)',
|
||||
dict_type varchar(200) default '' comment '字典类型',
|
||||
sort int comment '排序',
|
||||
create_by varchar(64) default '' comment '创建者',
|
||||
create_time datetime comment '创建时间',
|
||||
update_by varchar(64) default '' comment '更新者',
|
||||
update_time datetime comment '更新时间',
|
||||
primary key (column_id)
|
||||
) engine=innodb auto_increment=1 comment = '代码生成业务表字段';
|
|
@ -0,0 +1,173 @@
|
|||
<?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>Wms</artifactId>
|
||||
<groupId>com.wms</groupId>
|
||||
<version>1.0.0</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<packaging>jar</packaging>
|
||||
<artifactId>wms-chongqingkafu</artifactId>
|
||||
|
||||
<description>
|
||||
web服务入口
|
||||
</description>
|
||||
|
||||
<dependencies>
|
||||
|
||||
<!-- spring-boot-devtools -->
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-devtools</artifactId>
|
||||
<optional>true</optional> <!-- 表示依赖不会传递 -->
|
||||
</dependency>
|
||||
|
||||
<!-- swagger3-->
|
||||
<dependency>
|
||||
<groupId>io.springfox</groupId>
|
||||
<artifactId>springfox-boot-starter</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!--Spring Boot 测试-->
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-test</artifactId>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>junit</groupId>
|
||||
<artifactId>junit</artifactId>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
|
||||
<!-- 防止进入swagger页面报类型转换错误,排除3.0.0中的引用,手动增加1.6.2版本 -->
|
||||
<dependency>
|
||||
<groupId>io.swagger</groupId>
|
||||
<artifactId>swagger-models</artifactId>
|
||||
<version>1.6.2</version>
|
||||
</dependency>
|
||||
|
||||
<!-- Mysql驱动包 -->
|
||||
<dependency>
|
||||
<groupId>mysql</groupId>
|
||||
<artifactId>mysql-connector-java</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- 基础模块-->
|
||||
<dependency>
|
||||
<groupId>com.wms</groupId>
|
||||
<artifactId>wms-basic</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- 公共模块-->
|
||||
<dependency>
|
||||
<groupId>com.wms</groupId>
|
||||
<artifactId>wms-common</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- 核心模块-->
|
||||
<dependency>
|
||||
<groupId>com.wms</groupId>
|
||||
<artifactId>wms-framework</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- 定时任务-->
|
||||
<dependency>
|
||||
<groupId>com.wms</groupId>
|
||||
<artifactId>wms-quartz</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- 代码生成-->
|
||||
<dependency>
|
||||
<groupId>com.wms</groupId>
|
||||
<artifactId>wms-generator</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- 数据库备份-->
|
||||
<dependency>
|
||||
<groupId>com.wms</groupId>
|
||||
<artifactId>wms-db-backup</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- 告警模块-->
|
||||
<dependency>
|
||||
<groupId>com.wms</groupId>
|
||||
<artifactId>wms-alarm</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- 授权模块-->
|
||||
<dependency>
|
||||
<groupId>com.wms</groupId>
|
||||
<artifactId>wms-license</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- netty模块-->
|
||||
<dependency>
|
||||
<groupId>com.wms</groupId>
|
||||
<artifactId>wms-message</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- pda模块-->
|
||||
<dependency>
|
||||
<groupId>com.wms</groupId>
|
||||
<artifactId>wms-pda</artifactId>
|
||||
</dependency>
|
||||
<!-- 推荐模块-->
|
||||
<dependency>
|
||||
<groupId>com.wms</groupId>
|
||||
<artifactId>wms-recommend</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- 大屏与统计-->
|
||||
<dependency>
|
||||
<groupId>com.wms</groupId>
|
||||
<artifactId>wms-bg-statistics</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- knife4j -->
|
||||
<dependency>
|
||||
<groupId>com.github.xiaoymin</groupId>
|
||||
<artifactId>knife4j-spring-boot-starter</artifactId>
|
||||
<version>3.0.3</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework</groupId>
|
||||
<artifactId>spring-web</artifactId>
|
||||
</dependency>
|
||||
|
||||
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-maven-plugin</artifactId>
|
||||
<version>2.1.1.RELEASE</version>
|
||||
<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.1.0</version>
|
||||
<configuration>
|
||||
<failOnMissingWebXml>false</failOnMissingWebXml>
|
||||
<warName>${project.artifactId}</warName>
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
<finalName>${project.artifactId}</finalName>
|
||||
</build>
|
||||
|
||||
</project>
|
|
@ -0,0 +1,35 @@
|
|||
package com.wms;
|
||||
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
|
||||
import org.springframework.context.ConfigurableApplicationContext;
|
||||
import org.springframework.core.env.Environment;
|
||||
|
||||
import java.net.InetAddress;
|
||||
import java.net.UnknownHostException;
|
||||
|
||||
/**
|
||||
* 启动程序
|
||||
*
|
||||
* @author wms
|
||||
*/
|
||||
@Slf4j
|
||||
@SpringBootApplication(exclude = {DataSourceAutoConfiguration.class})
|
||||
public class WmsApplication {
|
||||
public static void main(String[] args) throws UnknownHostException {
|
||||
// System.setProperty("spring.devtools.restart.enabled", "false");
|
||||
ConfigurableApplicationContext application = SpringApplication.run(WmsApplication.class, args);
|
||||
System.out.println("=====================wms启动成功=====================");
|
||||
Environment env = application.getEnvironment();
|
||||
String host = InetAddress.getLocalHost().getHostAddress();
|
||||
String port = env.getProperty("server.port");
|
||||
log.info("\n----------------------------------------------------------\n\t" +
|
||||
"Application Declare is running! Access URLs:\n\t" +
|
||||
"Local: \t\t\thttp://localhost:" + port + "\n\t" +
|
||||
"External: \t\thttp://" + host + ":" + port + "\n\t" +
|
||||
"Swagger-UI: \thttp://" + host + ":" + port + "/doc.html\n" +
|
||||
"----------------------------------------------------------");
|
||||
}
|
||||
}
|
|
@ -0,0 +1,16 @@
|
|||
package com.wms;
|
||||
|
||||
import org.springframework.boot.builder.SpringApplicationBuilder;
|
||||
import org.springframework.boot.web.servlet.support.SpringBootServletInitializer;
|
||||
|
||||
/**
|
||||
* web容器中进行部署
|
||||
*
|
||||
* @author wms
|
||||
*/
|
||||
public class WmsServletInitializer extends SpringBootServletInitializer {
|
||||
@Override
|
||||
protected SpringApplicationBuilder configure(SpringApplicationBuilder application) {
|
||||
return application.sources(WmsApplication.class);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,56 @@
|
|||
package com.wms.api.alarm.controller;
|
||||
|
||||
import com.wms.alarm.domain.dto.DirectReportAlarmDto;
|
||||
import com.wms.alarm.domain.dto.ReportAlarmConfigCodeAndValueDto;
|
||||
import com.wms.alarm.service.ITbAlarmRealtimeService;
|
||||
import com.wms.common.annotation.Anonymous;
|
||||
import com.wms.common.core.controller.BaseController;
|
||||
import com.wms.common.core.domain.AjaxResult;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import javax.validation.Valid;
|
||||
|
||||
/**
|
||||
* @author 中xue
|
||||
* @version 1.0
|
||||
* @date 2023/5/31 10:52
|
||||
*/
|
||||
@Api(tags = "告警接口管理")
|
||||
@RestController
|
||||
@RequestMapping("/api/alarm")
|
||||
@Validated
|
||||
@RequiredArgsConstructor(onConstructor_ = @Autowired)
|
||||
public class AlarmApiController extends BaseController {
|
||||
|
||||
private final ITbAlarmRealtimeService alarmRealtimeService;
|
||||
|
||||
/**
|
||||
* 直接上报告警信息
|
||||
*/
|
||||
@Anonymous
|
||||
@ApiOperation("直接上报告警信息接口")
|
||||
@PostMapping("/directReportAlarm")
|
||||
public AjaxResult directReportAlarm(@RequestBody @Valid DirectReportAlarmDto dto) {
|
||||
return alarmRealtimeService.directReportAlarm(dto);
|
||||
}
|
||||
|
||||
/**
|
||||
* 上报告警码和告警值
|
||||
*/
|
||||
@Anonymous
|
||||
@ApiOperation("上报告警码和告警值")
|
||||
@PostMapping("/reportAlarmConfigCodeAndValue")
|
||||
public AjaxResult reportAlarmConfigCodeAndValue(@RequestBody @Valid ReportAlarmConfigCodeAndValueDto dto) {
|
||||
return alarmRealtimeService.reportAlarmConfigCodeAndValue(dto);
|
||||
}
|
||||
|
||||
|
||||
}
|
|
@ -0,0 +1,147 @@
|
|||
package com.wms.api.test.controller;
|
||||
|
||||
import com.jacob.activeX.ActiveXComponent;
|
||||
import com.jacob.com.ComThread;
|
||||
import com.jacob.com.Dispatch;
|
||||
import com.wms.common.annotation.Anonymous;
|
||||
import com.wms.common.core.controller.BaseController;
|
||||
import com.wms.common.core.domain.AjaxResult;
|
||||
import com.wms.mes.domain.vo.ProductsLinePrintVo;
|
||||
import com.wms.mes.service.impl.MesServiceImpl;
|
||||
import com.wms.pda.service.impl.ZplTcpPrinter;
|
||||
import com.wms.system.service.ISysConfigService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
/**
|
||||
* @author qzx
|
||||
* @Classname PrintTestController
|
||||
* @Description 标签打印测试
|
||||
* @Date 2024/6/4 10:39
|
||||
*/
|
||||
@Api(value = "wms测试标签打印控制器", tags = {"wms测试标签打印管理"})
|
||||
@Anonymous
|
||||
@RestController
|
||||
@RequestMapping("/wms/printTest")
|
||||
@RequiredArgsConstructor(onConstructor_ = @Autowired)
|
||||
public class PrintTestController extends BaseController {
|
||||
private final ISysConfigService configService;
|
||||
private final MesServiceImpl mesService;
|
||||
|
||||
@Anonymous
|
||||
@ApiOperation(value = "测试料箱标签打印", notes = "测试料箱标签打印")
|
||||
@GetMapping("/containerPrintTest")
|
||||
public AjaxResult containerPrintTest() {
|
||||
String ip = configService.selectConfigByKey("zebra.printer.ip");
|
||||
ZplTcpPrinter zplTcpPrinter = new ZplTcpPrinter();
|
||||
zplTcpPrinter.zplLabelPrint(ip, "A000000001");
|
||||
return AjaxResult.success("测试料箱标签打印测试成功");
|
||||
}
|
||||
|
||||
@Anonymous
|
||||
@ApiOperation(value = "测试成品下线标签打印", notes = "测试成品下线标签打印")
|
||||
@GetMapping("/productsLinePrintTest")
|
||||
public AjaxResult productsLinePrintTest() {
|
||||
final ProductsLinePrintVo vo = ProductsLinePrintVo.builder()
|
||||
.proOrderNo("12345678")
|
||||
.utensilCode("12345678")
|
||||
.partCode("78110100010ND")
|
||||
.customPartCode("123424")
|
||||
.articleName("防爆阀_D60_单向阀")
|
||||
.spec("spec")
|
||||
.invQty("300")
|
||||
.produceBatch("1231345").build();
|
||||
//要运行COM组件,需要先添加jacob包
|
||||
ComThread.InitSTA();
|
||||
//加载Bartender进程,需要先安装Bartender,我安装的是BT2022版本。
|
||||
ActiveXComponent btApp = new ActiveXComponent("BarTender.Application");
|
||||
//加载Bartender模板控件
|
||||
Dispatch btFormats = btApp.getProperty("Formats").toDispatch();
|
||||
//调用模板,bo.getTemplatePath()方法(获取模版路径)你自己定义
|
||||
Dispatch btFormat = Dispatch.call(btFormats, "Open", "D:\\WMS\\labelPrintModule\\productsLine.btw", false, "").toDispatch();
|
||||
//传递参数,参数名称要和Bartender中设置的名称一样,不然会失败,bo是打印对象
|
||||
Dispatch.call(btFormat, "SetNamedSubStringValue", "a", "12345678");
|
||||
Dispatch.call(btFormat, "SetNamedSubStringValue", "b", "12345678");
|
||||
Dispatch.call(btFormat, "SetNamedSubStringValue", "c", "78110100010ND");
|
||||
Dispatch.call(btFormat, "SetNamedSubStringValue", "d", "123424");
|
||||
Dispatch.call(btFormat, "SetNamedSubStringValue", "e", "防爆阀_D60_单向阀");
|
||||
Dispatch.call(btFormat, "SetNamedSubStringValue", "f", "spec");
|
||||
Dispatch.call(btFormat, "SetNamedSubStringValue", "g", "300");
|
||||
Dispatch.call(btFormat, "SetNamedSubStringValue", "h", "1231345");
|
||||
//设置打印份数,默认是1份可以不设置
|
||||
Dispatch printSetup = Dispatch.get(btFormat, "PrintSetup").toDispatch();
|
||||
Dispatch.put(printSetup, "IdenticalCopiesOfLabel", 1);
|
||||
// 打印,Bartender会自动选择模板中设置的打印机打印
|
||||
Dispatch.call(btFormat, "PrintOut", false, false);
|
||||
//打印完成,关闭模板控件
|
||||
Dispatch.call(btFormat, "Close", 0);
|
||||
//关闭Bartender进程
|
||||
Dispatch.call(btApp, "Quit", 0);
|
||||
return AjaxResult.success("成品下线标签打印测试成功");
|
||||
}
|
||||
|
||||
@Anonymous
|
||||
@ApiOperation(value = "测试退料标签打印", notes = "测试退料标签打印")
|
||||
@GetMapping("/strippingPrintTest")
|
||||
public AjaxResult strippingPrintTest() {
|
||||
//要运行COM组件,需要先添加jacob包
|
||||
ComThread.InitSTA();
|
||||
//加载Bartender进程,需要先安装Bartender,我安装的是BT2022版本。
|
||||
ActiveXComponent btApp = new ActiveXComponent("BarTender.Application");
|
||||
//加载Bartender模板控件
|
||||
Dispatch btFormats = btApp.getProperty("Formats").toDispatch();
|
||||
//调用模板,bo.getTemplatePath()方法(获取模版路径)你自己定义
|
||||
Dispatch btFormat = Dispatch.call(btFormats, "Open", "D:\\WMS\\labelPrintModule\\strippingPrint.btw", false, "").toDispatch();
|
||||
//传递参数,参数名称要和Bartender中设置的名称一样,不然会失败,bo是打印对象
|
||||
Dispatch.call(btFormat, "SetNamedSubStringValue", "a", "1234124");
|
||||
Dispatch.call(btFormat, "SetNamedSubStringValue", "b", "防爆阀_D60_单向阀");
|
||||
Dispatch.call(btFormat, "SetNamedSubStringValue", "c", "1234124");
|
||||
Dispatch.call(btFormat, "SetNamedSubStringValue", "d", "001");
|
||||
Dispatch.call(btFormat, "SetNamedSubStringValue", "e", "150");
|
||||
Dispatch.call(btFormat, "SetNamedSubStringValue", "f", "204021898902600034240524A0010500");
|
||||
//设置打印份数,默认是1份可以不设置
|
||||
Dispatch printSetup = Dispatch.get(btFormat, "PrintSetup").toDispatch();
|
||||
Dispatch.put(printSetup, "IdenticalCopiesOfLabel", 1);
|
||||
// 打印,Bartender会自动选择模板中设置的打印机打印
|
||||
Dispatch.call(btFormat, "PrintOut", false, false);
|
||||
//打印完成,关闭模板控件
|
||||
Dispatch.call(btFormat, "Close", 0);
|
||||
//关闭Bartender进程
|
||||
Dispatch.call(btApp, "Quit", 0);
|
||||
return AjaxResult.success("测试退料标签打印成功");
|
||||
}
|
||||
|
||||
public static void main(String[] args) {
|
||||
//要运行COM组件,需要先添加jacob包
|
||||
ComThread.InitSTA();
|
||||
//加载Bartender进程,需要先安装Bartender,我安装的是BT2022版本。
|
||||
ActiveXComponent btApp = new ActiveXComponent("BarTender.Application");
|
||||
//加载Bartender模板控件
|
||||
Dispatch btFormats = btApp.getProperty("Formats").toDispatch();
|
||||
//调用模板,bo.getTemplatePath()方法(获取模版路径)你自己定义
|
||||
Dispatch btFormat = Dispatch.call(btFormats, "Open", "D:\\a\\strippingPrint.btw", false, "").toDispatch();
|
||||
//传递参数,参数名称要和Bartender中设置的名称一样,不然会失败,bo是打印对象
|
||||
Dispatch.call(btFormat, "SetNamedSubStringValue", "qa", "204021898902600034240524A0010500");
|
||||
Dispatch.call(btFormat, "SetNamedSubStringValue", "a", "1234124");
|
||||
Dispatch.call(btFormat, "SetNamedSubStringValue", "b", "防爆阀_D60_单向阀");
|
||||
Dispatch.call(btFormat, "SetNamedSubStringValue", "c", "1234124");
|
||||
Dispatch.call(btFormat, "SetNamedSubStringValue", "d", "001");
|
||||
Dispatch.call(btFormat, "SetNamedSubStringValue", "e", "150");
|
||||
//设置打印份数,默认是1份可以不设置
|
||||
Dispatch printSetup = Dispatch.get(btFormat, "PrintSetup").toDispatch();
|
||||
Dispatch.put(printSetup, "IdenticalCopiesOfLabel", 1);
|
||||
// 打印,Bartender会自动选择模板中设置的打印机打印
|
||||
Dispatch.call(btFormat, "PrintOut", false, false);
|
||||
//打印完成,关闭模板控件
|
||||
Dispatch.call(btFormat, "Close", 0);
|
||||
//关闭Bartender进程
|
||||
Dispatch.call(btApp, "Quit", 0);
|
||||
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,38 @@
|
|||
package com.wms.api.test.controller;
|
||||
|
||||
|
||||
import com.wms.common.annotation.Anonymous;
|
||||
import com.wms.common.annotation.RequireBasicAuth;
|
||||
import com.wms.common.core.domain.AjaxResult;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
/**
|
||||
* @author qzx
|
||||
*/
|
||||
@Api(tags = {"token"})
|
||||
@RestController
|
||||
@RequestMapping("/wms/testController")
|
||||
public class TestBasicController {
|
||||
|
||||
|
||||
///测试basic认证接口模式
|
||||
@ApiOperation(value = "测试Basic", notes = "测试Basic")
|
||||
@PostMapping("/testBasic")
|
||||
@RequireBasicAuth
|
||||
public AjaxResult testBasic() {
|
||||
return AjaxResult.success("Basic测试成功");
|
||||
}
|
||||
|
||||
|
||||
//测试@Anonymous注解 实现跳过鉴权访问接口
|
||||
@ApiOperation(value = "测试Anonymous", notes = "测试Anonymous")
|
||||
@PostMapping("/anonymous")
|
||||
@Anonymous
|
||||
public AjaxResult anonymous() {
|
||||
return AjaxResult.success("Anonymous测试成功");
|
||||
}
|
||||
}
|
|
@ -0,0 +1,87 @@
|
|||
package com.wms.web.controller.common;
|
||||
|
||||
import com.google.code.kaptcha.Producer;
|
||||
import com.wms.common.config.WmsConfig;
|
||||
import com.wms.common.constant.CacheConstants;
|
||||
import com.wms.common.constant.Constants;
|
||||
import com.wms.common.core.domain.AjaxResult;
|
||||
import com.wms.common.core.redis.RedisCache;
|
||||
import com.wms.common.utils.sign.Base64;
|
||||
import com.wms.common.utils.uuid.IdUtils;
|
||||
import com.wms.system.service.ISysConfigService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.util.FastByteArrayOutputStream;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.imageio.ImageIO;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.awt.image.BufferedImage;
|
||||
import java.io.IOException;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
/**
|
||||
* 验证码操作处理
|
||||
*
|
||||
* @author wms
|
||||
*/
|
||||
@RestController
|
||||
public class CaptchaController {
|
||||
@Resource(name = "captchaProducer")
|
||||
private Producer captchaProducer;
|
||||
|
||||
@Resource(name = "captchaProducerMath")
|
||||
private Producer captchaProducerMath;
|
||||
|
||||
@Autowired
|
||||
private RedisCache redisCache;
|
||||
|
||||
@Autowired
|
||||
private ISysConfigService configService;
|
||||
|
||||
/**
|
||||
* 生成验证码
|
||||
*/
|
||||
@GetMapping("/captchaImage")
|
||||
public AjaxResult getCode(HttpServletResponse response) throws IOException {
|
||||
AjaxResult ajax = AjaxResult.success();
|
||||
boolean captchaEnabled = configService.selectCaptchaEnabled();
|
||||
ajax.put("captchaEnabled", captchaEnabled);
|
||||
if (!captchaEnabled) {
|
||||
return ajax;
|
||||
}
|
||||
|
||||
// 保存验证码信息
|
||||
String uuid = IdUtils.simpleUUID();
|
||||
String verifyKey = CacheConstants.CAPTCHA_CODE_KEY + uuid;
|
||||
|
||||
String capStr = null, code = null;
|
||||
BufferedImage image = null;
|
||||
|
||||
// 生成验证码
|
||||
String captchaType = WmsConfig.getCaptchaType();
|
||||
if ("math".equals(captchaType)) {
|
||||
String capText = captchaProducerMath.createText();
|
||||
capStr = capText.substring(0, capText.lastIndexOf("@"));
|
||||
code = capText.substring(capText.lastIndexOf("@") + 1);
|
||||
image = captchaProducerMath.createImage(capStr);
|
||||
} else if ("char".equals(captchaType)) {
|
||||
capStr = code = captchaProducer.createText();
|
||||
image = captchaProducer.createImage(capStr);
|
||||
}
|
||||
|
||||
redisCache.setCacheObject(verifyKey, code, Constants.CAPTCHA_EXPIRATION, TimeUnit.MINUTES);
|
||||
// 转换流信息写出
|
||||
FastByteArrayOutputStream os = new FastByteArrayOutputStream();
|
||||
try {
|
||||
ImageIO.write(image, "jpg", os);
|
||||
} catch (IOException e) {
|
||||
return AjaxResult.error(e.getMessage());
|
||||
}
|
||||
|
||||
ajax.put("uuid", uuid);
|
||||
ajax.put("img", Base64.encode(os.toByteArray()));
|
||||
return ajax;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,143 @@
|
|||
package com.wms.web.controller.common;
|
||||
|
||||
import com.wms.common.config.WmsConfig;
|
||||
import com.wms.common.constant.Constants;
|
||||
import com.wms.common.core.domain.AjaxResult;
|
||||
import com.wms.common.utils.StringUtils;
|
||||
import com.wms.common.utils.file.FileUploadUtils;
|
||||
import com.wms.common.utils.file.FileUtils;
|
||||
import com.wms.framework.config.ServerConfig;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.http.MediaType;
|
||||
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.RestController;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 通用请求处理
|
||||
*
|
||||
* @author wms
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/common")
|
||||
public class CommonController {
|
||||
private static final Logger log = LoggerFactory.getLogger(CommonController.class);
|
||||
|
||||
@Autowired
|
||||
private ServerConfig serverConfig;
|
||||
|
||||
private static final String FILE_DELIMETER = ",";
|
||||
|
||||
/**
|
||||
* 通用下载请求
|
||||
*
|
||||
* @param fileName 文件名称
|
||||
* @param delete 是否删除
|
||||
*/
|
||||
@GetMapping("/download")
|
||||
public void fileDownload(String fileName, Boolean delete, HttpServletResponse response, HttpServletRequest request) {
|
||||
try {
|
||||
if (!FileUtils.checkAllowDownload(fileName)) {
|
||||
throw new Exception(StringUtils.format("文件名称({})非法,不允许下载。 ", fileName));
|
||||
}
|
||||
String realFileName = System.currentTimeMillis() + fileName.substring(fileName.indexOf("_") + 1);
|
||||
String filePath = WmsConfig.getDownloadPath() + fileName;
|
||||
|
||||
response.setContentType(MediaType.APPLICATION_OCTET_STREAM_VALUE);
|
||||
FileUtils.setAttachmentResponseHeader(response, realFileName);
|
||||
FileUtils.writeBytes(filePath, response.getOutputStream());
|
||||
if (delete) {
|
||||
FileUtils.deleteFile(filePath);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
log.error("下载文件失败", e);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 通用上传请求(单个)
|
||||
*/
|
||||
@PostMapping("/upload")
|
||||
public AjaxResult uploadFile(MultipartFile file) throws Exception {
|
||||
try {
|
||||
// 上传文件路径
|
||||
String filePath = WmsConfig.getUploadPath();
|
||||
// 上传并返回新文件名称
|
||||
String fileName = FileUploadUtils.upload(filePath, file);
|
||||
String url = serverConfig.getUrl() + fileName;
|
||||
AjaxResult ajax = AjaxResult.success();
|
||||
ajax.put("url", url);
|
||||
ajax.put("fileName", fileName);
|
||||
ajax.put("newFileName", FileUtils.getName(fileName));
|
||||
ajax.put("originalFilename", file.getOriginalFilename());
|
||||
return ajax;
|
||||
} catch (Exception e) {
|
||||
return AjaxResult.error(e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 通用上传请求(多个)
|
||||
*/
|
||||
@PostMapping("/uploads")
|
||||
public AjaxResult uploadFiles(List<MultipartFile> files) throws Exception {
|
||||
try {
|
||||
// 上传文件路径
|
||||
String filePath = WmsConfig.getUploadPath();
|
||||
List<String> urls = new ArrayList<String>();
|
||||
List<String> fileNames = new ArrayList<String>();
|
||||
List<String> newFileNames = new ArrayList<String>();
|
||||
List<String> originalFilenames = new ArrayList<String>();
|
||||
for (MultipartFile file : files) {
|
||||
// 上传并返回新文件名称
|
||||
String fileName = FileUploadUtils.upload(filePath, file);
|
||||
String url = serverConfig.getUrl() + fileName;
|
||||
urls.add(url);
|
||||
fileNames.add(fileName);
|
||||
newFileNames.add(FileUtils.getName(fileName));
|
||||
originalFilenames.add(file.getOriginalFilename());
|
||||
}
|
||||
AjaxResult ajax = AjaxResult.success();
|
||||
ajax.put("urls", StringUtils.join(urls, FILE_DELIMETER));
|
||||
ajax.put("fileNames", StringUtils.join(fileNames, FILE_DELIMETER));
|
||||
ajax.put("newFileNames", StringUtils.join(newFileNames, FILE_DELIMETER));
|
||||
ajax.put("originalFilenames", StringUtils.join(originalFilenames, FILE_DELIMETER));
|
||||
return ajax;
|
||||
} catch (Exception e) {
|
||||
return AjaxResult.error(e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 本地资源通用下载
|
||||
*/
|
||||
@GetMapping("/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 = WmsConfig.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);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,108 @@
|
|||
package com.wms.web.controller.monitor;
|
||||
|
||||
import com.wms.common.config.WmsConfig;
|
||||
import com.wms.common.constant.CacheConstants;
|
||||
import com.wms.common.core.domain.AjaxResult;
|
||||
import com.wms.common.utils.StringUtils;
|
||||
import com.wms.system.domain.SysCache;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.data.redis.core.RedisCallback;
|
||||
import org.springframework.data.redis.core.RedisTemplate;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
/**
|
||||
* 缓存监控
|
||||
*
|
||||
* @author wms
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/monitor/cache")
|
||||
public class CacheController {
|
||||
@Autowired
|
||||
private WmsConfig wmsConfig;
|
||||
|
||||
@Autowired
|
||||
private RedisTemplate<String, String> redisTemplate;
|
||||
private final static List<SysCache> caches = new ArrayList<SysCache>();
|
||||
|
||||
{
|
||||
caches.add(new SysCache(CacheConstants.LOGIN_TOKEN_KEY, "用户信息"));
|
||||
caches.add(new SysCache(CacheConstants.SYS_CONFIG_KEY, "配置信息"));
|
||||
caches.add(new SysCache(CacheConstants.SYS_DICT_KEY, "数据字典"));
|
||||
caches.add(new SysCache(CacheConstants.CAPTCHA_CODE_KEY, "验证码"));
|
||||
caches.add(new SysCache(CacheConstants.REPEAT_SUBMIT_KEY, "防重提交"));
|
||||
caches.add(new SysCache(CacheConstants.RATE_LIMIT_KEY, "限流处理"));
|
||||
caches.add(new SysCache(CacheConstants.PWD_ERR_CNT_KEY, "密码错误次数"));
|
||||
caches.add(new SysCache(CacheConstants.ERP_TOKEN_KEY, "ERPToken"));
|
||||
}
|
||||
|
||||
@PreAuthorize("@ss.hasPermi('monitor:cache:list')")
|
||||
@GetMapping()
|
||||
public AjaxResult getInfo() throws Exception {
|
||||
Properties info = (Properties) redisTemplate.execute((RedisCallback<Object>) connection -> connection.info());
|
||||
Properties commandStats = (Properties) redisTemplate.execute((RedisCallback<Object>) connection -> connection.info("commandstats"));
|
||||
Object dbSize = redisTemplate.execute((RedisCallback<Object>) connection -> connection.dbSize());
|
||||
|
||||
Map<String, Object> result = new HashMap<>(3);
|
||||
result.put("info", info);
|
||||
result.put("dbSize", dbSize);
|
||||
|
||||
List<Map<String, String>> pieList = new ArrayList<>();
|
||||
commandStats.stringPropertyNames().forEach(key -> {
|
||||
Map<String, String> data = new HashMap<>(2);
|
||||
String property = commandStats.getProperty(key);
|
||||
data.put("name", StringUtils.removeStart(key, "cmdstat_"));
|
||||
data.put("value", StringUtils.substringBetween(property, "calls=", ",usec"));
|
||||
pieList.add(data);
|
||||
});
|
||||
result.put("commandStats", pieList);
|
||||
return AjaxResult.success(result);
|
||||
}
|
||||
|
||||
@PreAuthorize("@ss.hasPermi('monitor:cache:list')")
|
||||
@GetMapping("/getNames")
|
||||
public AjaxResult cache() {
|
||||
return AjaxResult.success(caches);
|
||||
}
|
||||
|
||||
@PreAuthorize("@ss.hasPermi('monitor:cache:list')")
|
||||
@GetMapping("/getKeys/{cacheName}")
|
||||
public AjaxResult getCacheKeys(@PathVariable String cacheName) {
|
||||
Set<String> cacheKeys = redisTemplate.keys(wmsConfig.getName() + ":" + cacheName + "*");
|
||||
return AjaxResult.success(cacheKeys);
|
||||
}
|
||||
|
||||
@PreAuthorize("@ss.hasPermi('monitor:cache:list')")
|
||||
@GetMapping("/getValue/{cacheName}/{cacheKey}")
|
||||
public AjaxResult getCacheValue(@PathVariable String cacheName, @PathVariable String cacheKey) {
|
||||
String cacheValue = redisTemplate.opsForValue().get(cacheKey);
|
||||
SysCache sysCache = new SysCache(cacheName, cacheKey, cacheValue);
|
||||
return AjaxResult.success(sysCache);
|
||||
}
|
||||
|
||||
@PreAuthorize("@ss.hasPermi('monitor:cache:list')")
|
||||
@DeleteMapping("/clearCacheName/{cacheName}")
|
||||
public AjaxResult clearCacheName(@PathVariable String cacheName) {
|
||||
Collection<String> cacheKeys = redisTemplate.keys(wmsConfig.getName() + ":" + cacheName + "*");
|
||||
redisTemplate.delete(cacheKeys);
|
||||
return AjaxResult.success();
|
||||
}
|
||||
|
||||
@PreAuthorize("@ss.hasPermi('monitor:cache:list')")
|
||||
@DeleteMapping("/clearCacheKey/{cacheKey}")
|
||||
public AjaxResult clearCacheKey(@PathVariable String cacheKey) {
|
||||
redisTemplate.delete(cacheKey);
|
||||
return AjaxResult.success();
|
||||
}
|
||||
|
||||
@PreAuthorize("@ss.hasPermi('monitor:cache:list')")
|
||||
@DeleteMapping("/clearCacheAll")
|
||||
public AjaxResult clearCacheAll() {
|
||||
Collection<String> cacheKeys = redisTemplate.keys("*");
|
||||
redisTemplate.delete(cacheKeys);
|
||||
return AjaxResult.success();
|
||||
}
|
||||
}
|
|
@ -0,0 +1,25 @@
|
|||
package com.wms.web.controller.monitor;
|
||||
|
||||
import com.wms.common.core.domain.AjaxResult;
|
||||
import com.wms.framework.web.domain.Server;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
/**
|
||||
* 服务器监控
|
||||
*
|
||||
* @author wms
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/monitor/server")
|
||||
public class ServerController {
|
||||
@PreAuthorize("@ss.hasPermi('monitor:server:list')")
|
||||
@GetMapping()
|
||||
public AjaxResult getInfo() throws Exception {
|
||||
Server server = new Server();
|
||||
server.copyTo();
|
||||
return AjaxResult.success(server);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,72 @@
|
|||
package com.wms.web.controller.monitor;
|
||||
|
||||
import com.wms.common.annotation.Log;
|
||||
import com.wms.common.core.controller.BaseController;
|
||||
import com.wms.common.core.domain.AjaxResult;
|
||||
import com.wms.common.core.page.TableDataInfo;
|
||||
import com.wms.common.enums.BusinessType;
|
||||
import com.wms.common.utils.poi.ExcelUtil;
|
||||
import com.wms.framework.web.service.SysPasswordService;
|
||||
import com.wms.system.domain.SysLogininfor;
|
||||
import com.wms.system.service.ISysLogininforService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 系统访问记录
|
||||
*
|
||||
* @author wms
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/monitor/logininfor")
|
||||
public class SysLogininforController extends BaseController {
|
||||
@Autowired
|
||||
private ISysLogininforService logininforService;
|
||||
|
||||
@Autowired
|
||||
private SysPasswordService passwordService;
|
||||
|
||||
@PreAuthorize("@ss.hasPermi('monitor:logininfor:list')")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(SysLogininfor logininfor) {
|
||||
startPage();
|
||||
List<SysLogininfor> list = logininforService.selectLogininforList(logininfor);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
@Log(title = "登录日志", businessType = BusinessType.EXPORT)
|
||||
@PreAuthorize("@ss.hasPermi('monitor:logininfor:export')")
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, SysLogininfor logininfor) {
|
||||
List<SysLogininfor> list = logininforService.selectLogininforList(logininfor);
|
||||
ExcelUtil<SysLogininfor> util = new ExcelUtil<SysLogininfor>(SysLogininfor.class);
|
||||
util.exportExcel(response, list, "登录日志");
|
||||
}
|
||||
|
||||
@PreAuthorize("@ss.hasPermi('monitor:logininfor:remove')")
|
||||
@Log(title = "登录日志", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{infoIds}")
|
||||
public AjaxResult remove(@PathVariable Long[] infoIds) {
|
||||
return toAjax(logininforService.deleteLogininforByIds(infoIds));
|
||||
}
|
||||
|
||||
@PreAuthorize("@ss.hasPermi('monitor:logininfor:remove')")
|
||||
@Log(title = "登录日志", businessType = BusinessType.CLEAN)
|
||||
@DeleteMapping("/clean")
|
||||
public AjaxResult clean() {
|
||||
logininforService.cleanLogininfor();
|
||||
return success();
|
||||
}
|
||||
|
||||
@PreAuthorize("@ss.hasPermi('monitor:logininfor:unlock')")
|
||||
@Log(title = "账户解锁", businessType = BusinessType.OTHER)
|
||||
@GetMapping("/unlock/{userName}")
|
||||
public AjaxResult unlock(@PathVariable("userName") String userName) {
|
||||
passwordService.clearLoginRecordCache(userName);
|
||||
return success();
|
||||
}
|
||||
}
|
|
@ -0,0 +1,60 @@
|
|||
package com.wms.web.controller.monitor;
|
||||
|
||||
import com.wms.common.annotation.Log;
|
||||
import com.wms.common.core.controller.BaseController;
|
||||
import com.wms.common.core.domain.AjaxResult;
|
||||
import com.wms.common.core.page.TableDataInfo;
|
||||
import com.wms.common.enums.BusinessType;
|
||||
import com.wms.common.utils.poi.ExcelUtil;
|
||||
import com.wms.system.domain.SysOperLog;
|
||||
import com.wms.system.service.ISysOperLogService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 操作日志记录
|
||||
*
|
||||
* @author wms
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/monitor/operlog")
|
||||
public class SysOperlogController extends BaseController {
|
||||
@Autowired
|
||||
private ISysOperLogService operLogService;
|
||||
|
||||
@PreAuthorize("@ss.hasPermi('monitor:operlog:list')")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(SysOperLog operLog) {
|
||||
startPage();
|
||||
List<SysOperLog> list = operLogService.selectOperLogList(operLog);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
@Log(title = "操作日志", businessType = BusinessType.EXPORT)
|
||||
@PreAuthorize("@ss.hasPermi('monitor:operlog:export')")
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, SysOperLog operLog) {
|
||||
List<SysOperLog> list = operLogService.selectOperLogList(operLog);
|
||||
ExcelUtil<SysOperLog> util = new ExcelUtil<SysOperLog>(SysOperLog.class);
|
||||
util.exportExcel(response, list, "操作日志");
|
||||
}
|
||||
|
||||
@Log(title = "操作日志", businessType = BusinessType.DELETE)
|
||||
@PreAuthorize("@ss.hasPermi('monitor:operlog:remove')")
|
||||
@DeleteMapping("/{operIds}")
|
||||
public AjaxResult remove(@PathVariable Long[] operIds) {
|
||||
return toAjax(operLogService.deleteOperLogByIds(operIds));
|
||||
}
|
||||
|
||||
@Log(title = "操作日志", businessType = BusinessType.CLEAN)
|
||||
@PreAuthorize("@ss.hasPermi('monitor:operlog:remove')")
|
||||
@DeleteMapping("/clean")
|
||||
public AjaxResult clean() {
|
||||
operLogService.cleanOperLog();
|
||||
return success();
|
||||
}
|
||||
}
|
|
@ -0,0 +1,69 @@
|
|||
package com.wms.web.controller.monitor;
|
||||
|
||||
import com.wms.common.annotation.Log;
|
||||
import com.wms.common.constant.CacheConstants;
|
||||
import com.wms.common.core.controller.BaseController;
|
||||
import com.wms.common.core.domain.AjaxResult;
|
||||
import com.wms.common.core.domain.model.LoginUser;
|
||||
import com.wms.common.core.page.TableDataInfo;
|
||||
import com.wms.common.core.redis.RedisCache;
|
||||
import com.wms.common.enums.BusinessType;
|
||||
import com.wms.common.utils.StringUtils;
|
||||
import com.wms.system.domain.SysUserOnline;
|
||||
import com.wms.system.service.ISysUserOnlineService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 在线用户监控
|
||||
*
|
||||
* @author wms
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/monitor/online")
|
||||
public class SysUserOnlineController extends BaseController {
|
||||
@Autowired
|
||||
private ISysUserOnlineService userOnlineService;
|
||||
|
||||
@Autowired
|
||||
private RedisCache redisCache;
|
||||
|
||||
@PreAuthorize("@ss.hasPermi('monitor:online:list')")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(String ipaddr, String userName) {
|
||||
Collection<String> keys = redisCache.keys(CacheConstants.LOGIN_TOKEN_KEY + "*");
|
||||
List<SysUserOnline> userOnlineList = new ArrayList<SysUserOnline>();
|
||||
for (String key : keys) {
|
||||
LoginUser user = redisCache.getCacheObject(key);
|
||||
if (StringUtils.isNotEmpty(ipaddr) && StringUtils.isNotEmpty(userName)) {
|
||||
userOnlineList.add(userOnlineService.selectOnlineByInfo(ipaddr, userName, user));
|
||||
} else if (StringUtils.isNotEmpty(ipaddr)) {
|
||||
userOnlineList.add(userOnlineService.selectOnlineByIpaddr(ipaddr, user));
|
||||
} else if (StringUtils.isNotEmpty(userName) && StringUtils.isNotNull(user.getUser())) {
|
||||
userOnlineList.add(userOnlineService.selectOnlineByUserName(userName, user));
|
||||
} else {
|
||||
userOnlineList.add(userOnlineService.loginUserToUserOnline(user));
|
||||
}
|
||||
}
|
||||
Collections.reverse(userOnlineList);
|
||||
userOnlineList.removeAll(Collections.singleton(null));
|
||||
return getDataTable(userOnlineList);
|
||||
}
|
||||
|
||||
/**
|
||||
* 强退用户
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('monitor:online:forceLogout')")
|
||||
@Log(title = "在线用户", businessType = BusinessType.FORCE)
|
||||
@DeleteMapping("/{tokenId}")
|
||||
public AjaxResult forceLogout(@PathVariable String tokenId) {
|
||||
redisCache.deleteObject(CacheConstants.LOGIN_TOKEN_KEY + tokenId);
|
||||
return success();
|
||||
}
|
||||
}
|
|
@ -0,0 +1,116 @@
|
|||
package com.wms.web.controller.system;
|
||||
|
||||
import com.wms.common.annotation.Log;
|
||||
import com.wms.common.core.controller.BaseController;
|
||||
import com.wms.common.core.domain.AjaxResult;
|
||||
import com.wms.common.core.page.TableDataInfo;
|
||||
import com.wms.common.enums.BusinessType;
|
||||
import com.wms.common.utils.poi.ExcelUtil;
|
||||
import com.wms.system.domain.SysConfig;
|
||||
import com.wms.system.service.ISysConfigService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 参数配置 信息操作处理
|
||||
*
|
||||
* @author wms
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/system/config")
|
||||
public class SysConfigController extends BaseController {
|
||||
@Autowired
|
||||
private ISysConfigService configService;
|
||||
|
||||
/**
|
||||
* 获取参数配置列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:config:list')")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(SysConfig config) {
|
||||
startPage();
|
||||
List<SysConfig> list = configService.selectConfigList(config);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
@Log(title = "参数管理", businessType = BusinessType.EXPORT)
|
||||
@PreAuthorize("@ss.hasPermi('system:config:export')")
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, SysConfig config) {
|
||||
List<SysConfig> list = configService.selectConfigList(config);
|
||||
ExcelUtil<SysConfig> util = new ExcelUtil<SysConfig>(SysConfig.class);
|
||||
util.exportExcel(response, list, "参数数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据参数编号获取详细信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:config:query')")
|
||||
@GetMapping(value = "/{configId}")
|
||||
public AjaxResult getInfo(@PathVariable Long configId) {
|
||||
return success(configService.selectConfigById(configId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据参数键名查询参数值
|
||||
*/
|
||||
@GetMapping(value = "/configKey/{configKey}")
|
||||
public AjaxResult getConfigKey(@PathVariable String configKey) {
|
||||
return success(configService.selectConfigByKey(configKey));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增参数配置
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:config:add')")
|
||||
@Log(title = "参数管理", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@Validated @RequestBody SysConfig config) {
|
||||
if (!configService.checkConfigKeyUnique(config)) {
|
||||
return error("新增参数'" + config.getConfigName() + "'失败,参数键名已存在");
|
||||
}
|
||||
config.setCreateBy(getUsername());
|
||||
return toAjax(configService.insertConfig(config));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改参数配置
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:config:edit')")
|
||||
@Log(title = "参数管理", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@Validated @RequestBody SysConfig config) {
|
||||
if (!configService.checkConfigKeyUnique(config)) {
|
||||
return error("修改参数'" + config.getConfigName() + "'失败,参数键名已存在");
|
||||
}
|
||||
config.setUpdateBy(getUsername());
|
||||
return toAjax(configService.updateConfig(config));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除参数配置
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:config:remove')")
|
||||
@Log(title = "参数管理", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{configIds}")
|
||||
public AjaxResult remove(@PathVariable Long[] configIds) {
|
||||
configService.deleteConfigByIds(configIds);
|
||||
return success();
|
||||
}
|
||||
|
||||
/**
|
||||
* 刷新参数缓存
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:config:remove')")
|
||||
@Log(title = "参数管理", businessType = BusinessType.CLEAN)
|
||||
@DeleteMapping("/refreshCache")
|
||||
public AjaxResult refreshCache() {
|
||||
configService.resetConfigCache();
|
||||
return success();
|
||||
}
|
||||
}
|
|
@ -0,0 +1,111 @@
|
|||
package com.wms.web.controller.system;
|
||||
|
||||
import com.wms.common.annotation.Log;
|
||||
import com.wms.common.constant.UserConstants;
|
||||
import com.wms.common.core.controller.BaseController;
|
||||
import com.wms.common.core.domain.AjaxResult;
|
||||
import com.wms.common.core.domain.entity.SysDept;
|
||||
import com.wms.common.enums.BusinessType;
|
||||
import com.wms.common.utils.StringUtils;
|
||||
import com.wms.system.service.ISysDeptService;
|
||||
import org.apache.commons.lang3.ArrayUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 部门信息
|
||||
*
|
||||
* @author wms
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/system/dept")
|
||||
public class SysDeptController extends BaseController {
|
||||
@Autowired
|
||||
private ISysDeptService deptService;
|
||||
|
||||
/**
|
||||
* 获取部门列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:dept:list')")
|
||||
@GetMapping("/list")
|
||||
public AjaxResult list(SysDept dept) {
|
||||
List<SysDept> depts = deptService.selectDeptList(dept);
|
||||
return success(depts);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询部门列表(排除节点)
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:dept:list')")
|
||||
@GetMapping("/list/exclude/{deptId}")
|
||||
public AjaxResult excludeChild(@PathVariable(value = "deptId", required = false) Long deptId) {
|
||||
List<SysDept> depts = deptService.selectDeptList(new SysDept());
|
||||
depts.removeIf(d -> d.getDeptId().intValue() == deptId || ArrayUtils.contains(StringUtils.split(d.getAncestors(), ","), deptId + ""));
|
||||
return success(depts);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据部门编号获取详细信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:dept:query')")
|
||||
@GetMapping(value = "/{deptId}")
|
||||
public AjaxResult getInfo(@PathVariable Long deptId) {
|
||||
deptService.checkDeptDataScope(deptId);
|
||||
return success(deptService.selectDeptById(deptId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增部门
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:dept:add')")
|
||||
@Log(title = "部门管理", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@Validated @RequestBody SysDept dept) {
|
||||
if (!deptService.checkDeptNameUnique(dept)) {
|
||||
return error("新增部门'" + dept.getDeptName() + "'失败,部门名称已存在");
|
||||
}
|
||||
dept.setCreateBy(getUsername());
|
||||
return toAjax(deptService.insertDept(dept));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改部门
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:dept:edit')")
|
||||
@Log(title = "部门管理", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@Validated @RequestBody SysDept dept) {
|
||||
Long deptId = dept.getDeptId();
|
||||
deptService.checkDeptDataScope(deptId);
|
||||
if (!deptService.checkDeptNameUnique(dept)) {
|
||||
return error("修改部门'" + dept.getDeptName() + "'失败,部门名称已存在");
|
||||
} else if (dept.getParentId().equals(deptId)) {
|
||||
return error("修改部门'" + dept.getDeptName() + "'失败,上级部门不能是自己");
|
||||
} else if (StringUtils.equals(UserConstants.DEPT_DISABLE, dept.getStatus()) && deptService.selectNormalChildrenDeptById(deptId) > 0) {
|
||||
return error("该部门包含未停用的子部门!");
|
||||
}
|
||||
dept.setUpdateBy(getUsername());
|
||||
return toAjax(deptService.updateDept(dept));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除部门
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:dept:remove')")
|
||||
@Log(title = "部门管理", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{deptId}")
|
||||
public AjaxResult remove(@PathVariable Long deptId) {
|
||||
if (deptService.hasChildByDeptId(deptId)) {
|
||||
return warn("存在下级部门,不允许删除");
|
||||
}
|
||||
if (deptService.checkDeptExistUser(deptId)) {
|
||||
return warn("部门存在用户,不允许删除");
|
||||
}
|
||||
deptService.checkDeptDataScope(deptId);
|
||||
return toAjax(deptService.deleteDeptById(deptId));
|
||||
}
|
||||
}
|
|
@ -0,0 +1,106 @@
|
|||
package com.wms.web.controller.system;
|
||||
|
||||
import com.wms.common.annotation.Log;
|
||||
import com.wms.common.core.controller.BaseController;
|
||||
import com.wms.common.core.domain.AjaxResult;
|
||||
import com.wms.common.core.domain.entity.SysDictData;
|
||||
import com.wms.common.core.page.TableDataInfo;
|
||||
import com.wms.common.enums.BusinessType;
|
||||
import com.wms.common.utils.StringUtils;
|
||||
import com.wms.common.utils.poi.ExcelUtil;
|
||||
import com.wms.system.service.ISysDictDataService;
|
||||
import com.wms.system.service.ISysDictTypeService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 数据字典信息
|
||||
*
|
||||
* @author wms
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/system/dict/data")
|
||||
public class SysDictDataController extends BaseController {
|
||||
@Autowired
|
||||
private ISysDictDataService dictDataService;
|
||||
|
||||
@Autowired
|
||||
private ISysDictTypeService dictTypeService;
|
||||
|
||||
@PreAuthorize("@ss.hasPermi('system:dict:list')")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(SysDictData dictData) {
|
||||
startPage();
|
||||
List<SysDictData> list = dictDataService.selectDictDataList(dictData);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
@Log(title = "字典数据", businessType = BusinessType.EXPORT)
|
||||
@PreAuthorize("@ss.hasPermi('system:dict:export')")
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, SysDictData dictData) {
|
||||
List<SysDictData> list = dictDataService.selectDictDataList(dictData);
|
||||
ExcelUtil<SysDictData> util = new ExcelUtil<SysDictData>(SysDictData.class);
|
||||
util.exportExcel(response, list, "字典数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询字典数据详细
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:dict:query')")
|
||||
@GetMapping(value = "/{dictCode}")
|
||||
public AjaxResult getInfo(@PathVariable Long dictCode) {
|
||||
return success(dictDataService.selectDictDataById(dictCode));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据字典类型查询字典数据信息
|
||||
*/
|
||||
@GetMapping(value = "/type/{dictType}")
|
||||
public AjaxResult dictType(@PathVariable String dictType) {
|
||||
List<SysDictData> data = dictTypeService.selectDictDataByType(dictType);
|
||||
if (StringUtils.isNull(data)) {
|
||||
data = new ArrayList<SysDictData>();
|
||||
}
|
||||
return success(data);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增字典类型
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:dict:add')")
|
||||
@Log(title = "字典数据", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@Validated @RequestBody SysDictData dict) {
|
||||
dict.setCreateBy(getUsername());
|
||||
return toAjax(dictDataService.insertDictData(dict));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改保存字典类型
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:dict:edit')")
|
||||
@Log(title = "字典数据", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@Validated @RequestBody SysDictData dict) {
|
||||
dict.setUpdateBy(getUsername());
|
||||
return toAjax(dictDataService.updateDictData(dict));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除字典类型
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:dict:remove')")
|
||||
@Log(title = "字典类型", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{dictCodes}")
|
||||
public AjaxResult remove(@PathVariable Long[] dictCodes) {
|
||||
dictDataService.deleteDictDataByIds(dictCodes);
|
||||
return success();
|
||||
}
|
||||
}
|
|
@ -0,0 +1,114 @@
|
|||
package com.wms.web.controller.system;
|
||||
|
||||
import com.wms.common.annotation.Log;
|
||||
import com.wms.common.core.controller.BaseController;
|
||||
import com.wms.common.core.domain.AjaxResult;
|
||||
import com.wms.common.core.domain.entity.SysDictType;
|
||||
import com.wms.common.core.page.TableDataInfo;
|
||||
import com.wms.common.enums.BusinessType;
|
||||
import com.wms.common.utils.poi.ExcelUtil;
|
||||
import com.wms.system.service.ISysDictTypeService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 数据字典信息
|
||||
*
|
||||
* @author wms
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/system/dict/type")
|
||||
public class SysDictTypeController extends BaseController {
|
||||
@Autowired
|
||||
private ISysDictTypeService dictTypeService;
|
||||
|
||||
@PreAuthorize("@ss.hasPermi('system:dict:list')")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(SysDictType dictType) {
|
||||
startPage();
|
||||
List<SysDictType> list = dictTypeService.selectDictTypeList(dictType);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
@Log(title = "字典类型", businessType = BusinessType.EXPORT)
|
||||
@PreAuthorize("@ss.hasPermi('system:dict:export')")
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, SysDictType dictType) {
|
||||
List<SysDictType> list = dictTypeService.selectDictTypeList(dictType);
|
||||
ExcelUtil<SysDictType> util = new ExcelUtil<SysDictType>(SysDictType.class);
|
||||
util.exportExcel(response, list, "字典类型");
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询字典类型详细
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:dict:query')")
|
||||
@GetMapping(value = "/{dictId}")
|
||||
public AjaxResult getInfo(@PathVariable Long dictId) {
|
||||
return success(dictTypeService.selectDictTypeById(dictId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增字典类型
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:dict:add')")
|
||||
@Log(title = "字典类型", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@Validated @RequestBody SysDictType dict) {
|
||||
if (!dictTypeService.checkDictTypeUnique(dict)) {
|
||||
return error("新增字典'" + dict.getDictName() + "'失败,字典类型已存在");
|
||||
}
|
||||
dict.setCreateBy(getUsername());
|
||||
return toAjax(dictTypeService.insertDictType(dict));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改字典类型
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:dict:edit')")
|
||||
@Log(title = "字典类型", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@Validated @RequestBody SysDictType dict) {
|
||||
if (!dictTypeService.checkDictTypeUnique(dict)) {
|
||||
return error("修改字典'" + dict.getDictName() + "'失败,字典类型已存在");
|
||||
}
|
||||
dict.setUpdateBy(getUsername());
|
||||
return toAjax(dictTypeService.updateDictType(dict));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除字典类型
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:dict:remove')")
|
||||
@Log(title = "字典类型", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{dictIds}")
|
||||
public AjaxResult remove(@PathVariable Long[] dictIds) {
|
||||
dictTypeService.deleteDictTypeByIds(dictIds);
|
||||
return success();
|
||||
}
|
||||
|
||||
/**
|
||||
* 刷新字典缓存
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:dict:remove')")
|
||||
@Log(title = "字典类型", businessType = BusinessType.CLEAN)
|
||||
@DeleteMapping("/refreshCache")
|
||||
public AjaxResult refreshCache() {
|
||||
dictTypeService.resetDictCache();
|
||||
return success();
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取字典选择框列表
|
||||
*/
|
||||
@GetMapping("/optionselect")
|
||||
public AjaxResult optionselect() {
|
||||
List<SysDictType> dictTypes = dictTypeService.selectDictTypeAll();
|
||||
return success(dictTypes);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,29 @@
|
|||
package com.wms.web.controller.system;
|
||||
|
||||
import com.wms.common.config.WmsConfig;
|
||||
import com.wms.common.utils.StringUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
/**
|
||||
* 首页
|
||||
*
|
||||
* @author wms
|
||||
*/
|
||||
@RestController
|
||||
public class SysIndexController {
|
||||
/**
|
||||
* 系统基础配置
|
||||
*/
|
||||
@Autowired
|
||||
private WmsConfig wmsConfig;
|
||||
|
||||
/**
|
||||
* 访问首页,提示语
|
||||
*/
|
||||
@RequestMapping("/")
|
||||
public String index() {
|
||||
return StringUtils.format("欢迎使用{}后台管理框架,当前版本:v{},请通过前端地址访问。", wmsConfig.getName(), wmsConfig.getVersion());
|
||||
}
|
||||
}
|
|
@ -0,0 +1,87 @@
|
|||
package com.wms.web.controller.system;
|
||||
|
||||
import com.wms.common.constant.Constants;
|
||||
import com.wms.common.core.domain.AjaxResult;
|
||||
import com.wms.common.core.domain.entity.SysMenu;
|
||||
import com.wms.common.core.domain.entity.SysUser;
|
||||
import com.wms.common.core.domain.model.LoginBody;
|
||||
import com.wms.common.utils.SecurityUtils;
|
||||
import com.wms.common.utils.sign.RsaUtils;
|
||||
import com.wms.framework.web.service.SysLoginService;
|
||||
import com.wms.framework.web.service.SysPermissionService;
|
||||
import com.wms.system.service.ISysMenuService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
/**
|
||||
* 登录验证
|
||||
*
|
||||
* @author wms
|
||||
*/
|
||||
@RestController
|
||||
public class SysLoginController {
|
||||
@Autowired
|
||||
private SysLoginService loginService;
|
||||
|
||||
@Autowired
|
||||
private ISysMenuService menuService;
|
||||
|
||||
@Autowired
|
||||
private SysPermissionService permissionService;
|
||||
|
||||
/**
|
||||
* 登录方法
|
||||
*
|
||||
* @param loginBody 登录信息
|
||||
* @return 结果
|
||||
*/
|
||||
@PostMapping("/login")
|
||||
public AjaxResult login(@RequestBody LoginBody loginBody) throws Exception {
|
||||
AjaxResult ajax = AjaxResult.success();
|
||||
// 生成令牌
|
||||
String token = loginService.login(loginBody.getUsername(),
|
||||
RsaUtils.decryptByPrivateKey(loginBody.getPassword()), loginBody.getCode(), loginBody.getUuid());
|
||||
|
||||
// String token = loginService.login(loginBody.getUsername(), loginBody.getPassword(), loginBody.getCode(),
|
||||
// loginBody.getUuid());
|
||||
ajax.put(Constants.TOKEN, token);
|
||||
return ajax;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取用户信息
|
||||
*
|
||||
* @return 用户信息
|
||||
*/
|
||||
@GetMapping("getInfo")
|
||||
public AjaxResult getInfo() {
|
||||
SysUser user = SecurityUtils.getLoginUser().getUser();
|
||||
// 角色集合
|
||||
Set<String> roles = permissionService.getRolePermission(user);
|
||||
// 权限集合
|
||||
Set<String> permissions = permissionService.getMenuPermission(user);
|
||||
AjaxResult ajax = AjaxResult.success();
|
||||
ajax.put("user", user);
|
||||
ajax.put("roles", roles);
|
||||
ajax.put("permissions", permissions);
|
||||
return ajax;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取路由信息
|
||||
*
|
||||
* @return 路由信息
|
||||
*/
|
||||
@GetMapping("getRouters")
|
||||
public AjaxResult getRouters() {
|
||||
Long userId = SecurityUtils.getUserId();
|
||||
List<SysMenu> menus = menuService.selectMenuTreeByUserId(userId);
|
||||
return AjaxResult.success(menuService.buildMenus(menus));
|
||||
}
|
||||
}
|
|
@ -0,0 +1,118 @@
|
|||
package com.wms.web.controller.system;
|
||||
|
||||
import com.wms.common.annotation.Log;
|
||||
import com.wms.common.constant.UserConstants;
|
||||
import com.wms.common.core.controller.BaseController;
|
||||
import com.wms.common.core.domain.AjaxResult;
|
||||
import com.wms.common.core.domain.entity.SysMenu;
|
||||
import com.wms.common.enums.BusinessType;
|
||||
import com.wms.common.utils.StringUtils;
|
||||
import com.wms.system.service.ISysMenuService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 菜单信息
|
||||
*
|
||||
* @author wms
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/system/menu")
|
||||
public class SysMenuController extends BaseController {
|
||||
@Autowired
|
||||
private ISysMenuService menuService;
|
||||
|
||||
/**
|
||||
* 获取菜单列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:menu:list')")
|
||||
@GetMapping("/list")
|
||||
public AjaxResult list(SysMenu menu) {
|
||||
List<SysMenu> menus = menuService.selectMenuList(menu, getUserId());
|
||||
return success(menus);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据菜单编号获取详细信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:menu:query')")
|
||||
@GetMapping(value = "/{menuId}")
|
||||
public AjaxResult getInfo(@PathVariable Long menuId) {
|
||||
return success(menuService.selectMenuById(menuId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取菜单下拉树列表
|
||||
*/
|
||||
@GetMapping("/treeselect")
|
||||
public AjaxResult treeselect(SysMenu menu) {
|
||||
List<SysMenu> menus = menuService.selectMenuList(menu, getUserId());
|
||||
return success(menuService.buildMenuTreeSelect(menus));
|
||||
}
|
||||
|
||||
/**
|
||||
* 加载对应角色菜单列表树
|
||||
*/
|
||||
@GetMapping(value = "/roleMenuTreeselect/{roleId}")
|
||||
public AjaxResult roleMenuTreeselect(@PathVariable("roleId") Long roleId) {
|
||||
List<SysMenu> menus = menuService.selectMenuList(getUserId());
|
||||
AjaxResult ajax = AjaxResult.success();
|
||||
ajax.put("checkedKeys", menuService.selectMenuListByRoleId(roleId));
|
||||
ajax.put("menus", menuService.buildMenuTreeSelect(menus));
|
||||
return ajax;
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增菜单
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:menu:add')")
|
||||
@Log(title = "菜单管理", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@Validated @RequestBody SysMenu menu) {
|
||||
if (!menuService.checkMenuNameUnique(menu)) {
|
||||
return error("新增菜单'" + menu.getMenuName() + "'失败,菜单名称已存在");
|
||||
} else if (UserConstants.YES_FRAME.equals(menu.getIsFrame()) && !StringUtils.ishttp(menu.getPath())) {
|
||||
return error("新增菜单'" + menu.getMenuName() + "'失败,地址必须以http(s)://开头");
|
||||
}
|
||||
menu.setCreateBy(getUsername());
|
||||
return toAjax(menuService.insertMenu(menu));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改菜单
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:menu:edit')")
|
||||
@Log(title = "菜单管理", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@Validated @RequestBody SysMenu menu) {
|
||||
if (!menuService.checkMenuNameUnique(menu)) {
|
||||
return error("修改菜单'" + menu.getMenuName() + "'失败,菜单名称已存在");
|
||||
} else if (UserConstants.YES_FRAME.equals(menu.getIsFrame()) && !StringUtils.ishttp(menu.getPath())) {
|
||||
return error("修改菜单'" + menu.getMenuName() + "'失败,地址必须以http(s)://开头");
|
||||
} else if (menu.getMenuId().equals(menu.getParentId())) {
|
||||
return error("修改菜单'" + menu.getMenuName() + "'失败,上级菜单不能选择自己");
|
||||
}
|
||||
menu.setUpdateBy(getUsername());
|
||||
return toAjax(menuService.updateMenu(menu));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除菜单
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:menu:remove')")
|
||||
@Log(title = "菜单管理", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{menuId}")
|
||||
public AjaxResult remove(@PathVariable("menuId") Long menuId) {
|
||||
if (menuService.hasChildByMenuId(menuId)) {
|
||||
return warn("存在子菜单,不允许删除");
|
||||
}
|
||||
if (menuService.checkMenuExistRole(menuId)) {
|
||||
return warn("菜单已分配,不允许删除");
|
||||
}
|
||||
return toAjax(menuService.deleteMenuById(menuId));
|
||||
}
|
||||
}
|
|
@ -0,0 +1,79 @@
|
|||
package com.wms.web.controller.system;
|
||||
|
||||
import com.wms.common.annotation.Log;
|
||||
import com.wms.common.core.controller.BaseController;
|
||||
import com.wms.common.core.domain.AjaxResult;
|
||||
import com.wms.common.core.page.TableDataInfo;
|
||||
import com.wms.common.enums.BusinessType;
|
||||
import com.wms.system.domain.SysNotice;
|
||||
import com.wms.system.service.ISysNoticeService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 公告 信息操作处理
|
||||
*
|
||||
* @author wms
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/system/notice")
|
||||
public class SysNoticeController extends BaseController {
|
||||
@Autowired
|
||||
private ISysNoticeService noticeService;
|
||||
|
||||
/**
|
||||
* 获取通知公告列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:notice:list')")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(SysNotice notice) {
|
||||
startPage();
|
||||
List<SysNotice> list = noticeService.selectNoticeList(notice);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据通知公告编号获取详细信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:notice:query')")
|
||||
@GetMapping(value = "/{noticeId}")
|
||||
public AjaxResult getInfo(@PathVariable Long noticeId) {
|
||||
return success(noticeService.selectNoticeById(noticeId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增通知公告
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:notice:add')")
|
||||
@Log(title = "通知公告", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@Validated @RequestBody SysNotice notice) {
|
||||
notice.setCreateBy(getUsername());
|
||||
return toAjax(noticeService.insertNotice(notice));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改通知公告
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:notice:edit')")
|
||||
@Log(title = "通知公告", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@Validated @RequestBody SysNotice notice) {
|
||||
notice.setUpdateBy(getUsername());
|
||||
return toAjax(noticeService.updateNotice(notice));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除通知公告
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:notice:remove')")
|
||||
@Log(title = "通知公告", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{noticeIds}")
|
||||
public AjaxResult remove(@PathVariable Long[] noticeIds) {
|
||||
return toAjax(noticeService.deleteNoticeByIds(noticeIds));
|
||||
}
|
||||
}
|
|
@ -0,0 +1,109 @@
|
|||
package com.wms.web.controller.system;
|
||||
|
||||
import com.wms.common.annotation.Log;
|
||||
import com.wms.common.core.controller.BaseController;
|
||||
import com.wms.common.core.domain.AjaxResult;
|
||||
import com.wms.common.core.page.TableDataInfo;
|
||||
import com.wms.common.enums.BusinessType;
|
||||
import com.wms.common.utils.poi.ExcelUtil;
|
||||
import com.wms.system.domain.SysPost;
|
||||
import com.wms.system.service.ISysPostService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 岗位信息操作处理
|
||||
*
|
||||
* @author wms
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/system/post")
|
||||
public class SysPostController extends BaseController {
|
||||
@Autowired
|
||||
private ISysPostService postService;
|
||||
|
||||
/**
|
||||
* 获取岗位列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:post:list')")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(SysPost post) {
|
||||
startPage();
|
||||
List<SysPost> list = postService.selectPostList(post);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
@Log(title = "岗位管理", businessType = BusinessType.EXPORT)
|
||||
@PreAuthorize("@ss.hasPermi('system:post:export')")
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, SysPost post) {
|
||||
List<SysPost> list = postService.selectPostList(post);
|
||||
ExcelUtil<SysPost> util = new ExcelUtil<SysPost>(SysPost.class);
|
||||
util.exportExcel(response, list, "岗位数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据岗位编号获取详细信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:post:query')")
|
||||
@GetMapping(value = "/{postId}")
|
||||
public AjaxResult getInfo(@PathVariable Long postId) {
|
||||
return success(postService.selectPostById(postId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增岗位
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:post:add')")
|
||||
@Log(title = "岗位管理", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@Validated @RequestBody SysPost post) {
|
||||
if (!postService.checkPostNameUnique(post)) {
|
||||
return error("新增岗位'" + post.getPostName() + "'失败,岗位名称已存在");
|
||||
} else if (!postService.checkPostCodeUnique(post)) {
|
||||
return error("新增岗位'" + post.getPostName() + "'失败,岗位编码已存在");
|
||||
}
|
||||
post.setCreateBy(getUsername());
|
||||
return toAjax(postService.insertPost(post));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改岗位
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:post:edit')")
|
||||
@Log(title = "岗位管理", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@Validated @RequestBody SysPost post) {
|
||||
if (!postService.checkPostNameUnique(post)) {
|
||||
return error("修改岗位'" + post.getPostName() + "'失败,岗位名称已存在");
|
||||
} else if (!postService.checkPostCodeUnique(post)) {
|
||||
return error("修改岗位'" + post.getPostName() + "'失败,岗位编码已存在");
|
||||
}
|
||||
post.setUpdateBy(getUsername());
|
||||
return toAjax(postService.updatePost(post));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除岗位
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:post:remove')")
|
||||
@Log(title = "岗位管理", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{postIds}")
|
||||
public AjaxResult remove(@PathVariable Long[] postIds) {
|
||||
return toAjax(postService.deletePostByIds(postIds));
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取岗位选择框列表
|
||||
*/
|
||||
@GetMapping("/optionselect")
|
||||
public AjaxResult optionselect() {
|
||||
List<SysPost> posts = postService.selectPostAll();
|
||||
return success(posts);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,122 @@
|
|||
package com.wms.web.controller.system;
|
||||
|
||||
import com.wms.common.annotation.Log;
|
||||
import com.wms.common.config.WmsConfig;
|
||||
import com.wms.common.core.controller.BaseController;
|
||||
import com.wms.common.core.domain.AjaxResult;
|
||||
import com.wms.common.core.domain.entity.SysUser;
|
||||
import com.wms.common.core.domain.model.LoginUser;
|
||||
import com.wms.common.enums.BusinessType;
|
||||
import com.wms.common.utils.SecurityUtils;
|
||||
import com.wms.common.utils.StringUtils;
|
||||
import com.wms.common.utils.file.FileUploadUtils;
|
||||
import com.wms.common.utils.file.MimeTypeUtils;
|
||||
import com.wms.framework.web.service.TokenService;
|
||||
import com.wms.system.service.ISysUserService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
/**
|
||||
* 个人信息 业务处理
|
||||
*
|
||||
* @author wms
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/system/user/profile")
|
||||
public class SysProfileController extends BaseController {
|
||||
@Autowired
|
||||
private ISysUserService userService;
|
||||
|
||||
@Autowired
|
||||
private TokenService tokenService;
|
||||
|
||||
/**
|
||||
* 个人信息
|
||||
*/
|
||||
@GetMapping
|
||||
public AjaxResult profile() {
|
||||
LoginUser loginUser = getLoginUser();
|
||||
SysUser user = loginUser.getUser();
|
||||
AjaxResult ajax = AjaxResult.success(user);
|
||||
ajax.put("roleGroup", userService.selectUserRoleGroup(loginUser.getUsername()));
|
||||
ajax.put("postGroup", userService.selectUserPostGroup(loginUser.getUsername()));
|
||||
return ajax;
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改用户
|
||||
*/
|
||||
@Log(title = "个人信息", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult updateProfile(@RequestBody SysUser user) {
|
||||
LoginUser loginUser = getLoginUser();
|
||||
SysUser sysUser = loginUser.getUser();
|
||||
user.setUserName(sysUser.getUserName());
|
||||
if (StringUtils.isNotEmpty(user.getPhonenumber()) && !userService.checkPhoneUnique(user)) {
|
||||
return error("修改用户'" + user.getUserName() + "'失败,手机号码已存在");
|
||||
}
|
||||
if (StringUtils.isNotEmpty(user.getEmail()) && !userService.checkEmailUnique(user)) {
|
||||
return error("修改用户'" + user.getUserName() + "'失败,邮箱账号已存在");
|
||||
}
|
||||
user.setUserId(sysUser.getUserId());
|
||||
user.setPassword(null);
|
||||
user.setAvatar(null);
|
||||
user.setDeptId(null);
|
||||
if (userService.updateUserProfile(user) > 0) {
|
||||
// 更新缓存用户信息
|
||||
sysUser.setNickName(user.getNickName());
|
||||
sysUser.setPhonenumber(user.getPhonenumber());
|
||||
sysUser.setEmail(user.getEmail());
|
||||
sysUser.setSex(user.getSex());
|
||||
tokenService.setLoginUser(loginUser);
|
||||
return success();
|
||||
}
|
||||
return error("修改个人信息异常,请联系管理员");
|
||||
}
|
||||
|
||||
/**
|
||||
* 重置密码
|
||||
*/
|
||||
@Log(title = "个人信息", businessType = BusinessType.UPDATE)
|
||||
@PutMapping("/updatePwd")
|
||||
public AjaxResult updatePwd(String oldPassword, String newPassword) {
|
||||
LoginUser loginUser = getLoginUser();
|
||||
String userName = loginUser.getUsername();
|
||||
String password = loginUser.getPassword();
|
||||
if (!SecurityUtils.matchesPassword(oldPassword, password)) {
|
||||
return error("修改密码失败,旧密码错误");
|
||||
}
|
||||
if (SecurityUtils.matchesPassword(newPassword, password)) {
|
||||
return error("新密码不能与旧密码相同");
|
||||
}
|
||||
if (userService.resetUserPwd(userName, SecurityUtils.encryptPassword(newPassword)) > 0) {
|
||||
// 更新缓存用户密码
|
||||
loginUser.getUser().setPassword(SecurityUtils.encryptPassword(newPassword));
|
||||
tokenService.setLoginUser(loginUser);
|
||||
return success();
|
||||
}
|
||||
return error("修改密码异常,请联系管理员");
|
||||
}
|
||||
|
||||
/**
|
||||
* 头像上传
|
||||
*/
|
||||
@Log(title = "用户头像", businessType = BusinessType.UPDATE)
|
||||
@PostMapping("/avatar")
|
||||
public AjaxResult avatar(@RequestParam("avatarfile") MultipartFile file) throws Exception {
|
||||
if (!file.isEmpty()) {
|
||||
LoginUser loginUser = getLoginUser();
|
||||
String avatar = FileUploadUtils.upload(WmsConfig.getAvatarPath(), file, MimeTypeUtils.IMAGE_EXTENSION);
|
||||
if (userService.updateUserAvatar(loginUser.getUsername(), avatar)) {
|
||||
AjaxResult ajax = AjaxResult.success();
|
||||
ajax.put("imgUrl", avatar);
|
||||
// 更新缓存用户头像
|
||||
loginUser.getUser().setAvatar(avatar);
|
||||
tokenService.setLoginUser(loginUser);
|
||||
return ajax;
|
||||
}
|
||||
}
|
||||
return error("上传图片异常,请联系管理员");
|
||||
}
|
||||
}
|
|
@ -0,0 +1,35 @@
|
|||
package com.wms.web.controller.system;
|
||||
|
||||
import com.wms.common.core.controller.BaseController;
|
||||
import com.wms.common.core.domain.AjaxResult;
|
||||
import com.wms.common.core.domain.model.RegisterBody;
|
||||
import com.wms.common.utils.StringUtils;
|
||||
import com.wms.framework.web.service.SysRegisterService;
|
||||
import com.wms.system.service.ISysConfigService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
/**
|
||||
* 注册验证
|
||||
*
|
||||
* @author wms
|
||||
*/
|
||||
@RestController
|
||||
public class SysRegisterController extends BaseController {
|
||||
@Autowired
|
||||
private SysRegisterService registerService;
|
||||
|
||||
@Autowired
|
||||
private ISysConfigService configService;
|
||||
|
||||
@PostMapping("/register")
|
||||
public AjaxResult register(@RequestBody RegisterBody user) {
|
||||
if (!("true".equals(configService.selectConfigByKey("sys.account.registerUser")))) {
|
||||
return error("当前系统没有开启注册功能!");
|
||||
}
|
||||
String msg = registerService.register(user);
|
||||
return StringUtils.isEmpty(msg) ? success() : error(msg);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,232 @@
|
|||
package com.wms.web.controller.system;
|
||||
|
||||
import com.wms.common.annotation.Log;
|
||||
import com.wms.common.core.controller.BaseController;
|
||||
import com.wms.common.core.domain.AjaxResult;
|
||||
import com.wms.common.core.domain.entity.SysDept;
|
||||
import com.wms.common.core.domain.entity.SysRole;
|
||||
import com.wms.common.core.domain.entity.SysUser;
|
||||
import com.wms.common.core.domain.model.LoginUser;
|
||||
import com.wms.common.core.page.TableDataInfo;
|
||||
import com.wms.common.enums.BusinessType;
|
||||
import com.wms.common.utils.StringUtils;
|
||||
import com.wms.common.utils.poi.ExcelUtil;
|
||||
import com.wms.framework.web.service.SysPermissionService;
|
||||
import com.wms.framework.web.service.TokenService;
|
||||
import com.wms.system.domain.SysUserRole;
|
||||
import com.wms.system.service.ISysDeptService;
|
||||
import com.wms.system.service.ISysRoleService;
|
||||
import com.wms.system.service.ISysUserService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 角色信息
|
||||
*
|
||||
* @author wms
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/system/role")
|
||||
public class SysRoleController extends BaseController {
|
||||
@Autowired
|
||||
private ISysRoleService roleService;
|
||||
|
||||
@Autowired
|
||||
private TokenService tokenService;
|
||||
|
||||
@Autowired
|
||||
private SysPermissionService permissionService;
|
||||
|
||||
@Autowired
|
||||
private ISysUserService userService;
|
||||
|
||||
@Autowired
|
||||
private ISysDeptService deptService;
|
||||
|
||||
@PreAuthorize("@ss.hasPermi('system:role:list')")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(SysRole role) {
|
||||
startPage();
|
||||
List<SysRole> list = roleService.selectRoleList(role);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
@Log(title = "角色管理", businessType = BusinessType.EXPORT)
|
||||
@PreAuthorize("@ss.hasPermi('system:role:export')")
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, SysRole role) {
|
||||
List<SysRole> list = roleService.selectRoleList(role);
|
||||
ExcelUtil<SysRole> util = new ExcelUtil<SysRole>(SysRole.class);
|
||||
util.exportExcel(response, list, "角色数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据角色编号获取详细信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:role:query')")
|
||||
@GetMapping(value = "/{roleId}")
|
||||
public AjaxResult getInfo(@PathVariable Long roleId) {
|
||||
roleService.checkRoleDataScope(roleId);
|
||||
return success(roleService.selectRoleById(roleId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增角色
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:role:add')")
|
||||
@Log(title = "角色管理", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@Validated @RequestBody SysRole role) {
|
||||
if (!roleService.checkRoleNameUnique(role)) {
|
||||
return error("新增角色'" + role.getRoleName() + "'失败,角色名称已存在");
|
||||
} else if (!roleService.checkRoleKeyUnique(role)) {
|
||||
return error("新增角色'" + role.getRoleName() + "'失败,角色权限已存在");
|
||||
}
|
||||
role.setCreateBy(getUsername());
|
||||
return toAjax(roleService.insertRole(role));
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改保存角色
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:role:edit')")
|
||||
@Log(title = "角色管理", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@Validated @RequestBody SysRole role) {
|
||||
roleService.checkRoleAllowed(role);
|
||||
roleService.checkRoleDataScope(role.getRoleId());
|
||||
if (!roleService.checkRoleNameUnique(role)) {
|
||||
return error("修改角色'" + role.getRoleName() + "'失败,角色名称已存在");
|
||||
} else if (!roleService.checkRoleKeyUnique(role)) {
|
||||
return error("修改角色'" + role.getRoleName() + "'失败,角色权限已存在");
|
||||
}
|
||||
role.setUpdateBy(getUsername());
|
||||
|
||||
if (roleService.updateRole(role) > 0) {
|
||||
// 更新缓存用户权限
|
||||
LoginUser loginUser = getLoginUser();
|
||||
if (StringUtils.isNotNull(loginUser.getUser()) && !loginUser.getUser().isAdmin()) {
|
||||
loginUser.setPermissions(permissionService.getMenuPermission(loginUser.getUser()));
|
||||
loginUser.setUser(userService.selectUserByUserName(loginUser.getUser().getUserName()));
|
||||
tokenService.setLoginUser(loginUser);
|
||||
}
|
||||
return success();
|
||||
}
|
||||
return error("修改角色'" + role.getRoleName() + "'失败,请联系管理员");
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改保存数据权限
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:role:edit')")
|
||||
@Log(title = "角色管理", businessType = BusinessType.UPDATE)
|
||||
@PutMapping("/dataScope")
|
||||
public AjaxResult dataScope(@RequestBody SysRole role) {
|
||||
roleService.checkRoleAllowed(role);
|
||||
roleService.checkRoleDataScope(role.getRoleId());
|
||||
return toAjax(roleService.authDataScope(role));
|
||||
}
|
||||
|
||||
/**
|
||||
* 状态修改
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:role:edit')")
|
||||
@Log(title = "角色管理", businessType = BusinessType.UPDATE)
|
||||
@PutMapping("/changeStatus")
|
||||
public AjaxResult changeStatus(@RequestBody SysRole role) {
|
||||
roleService.checkRoleAllowed(role);
|
||||
roleService.checkRoleDataScope(role.getRoleId());
|
||||
role.setUpdateBy(getUsername());
|
||||
return toAjax(roleService.updateRoleStatus(role));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除角色
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:role:remove')")
|
||||
@Log(title = "角色管理", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{roleIds}")
|
||||
public AjaxResult remove(@PathVariable Long[] roleIds) {
|
||||
return toAjax(roleService.deleteRoleByIds(roleIds));
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取角色选择框列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:role:query')")
|
||||
@GetMapping("/optionselect")
|
||||
public AjaxResult optionselect() {
|
||||
return success(roleService.selectRoleAll());
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询已分配用户角色列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:role:list')")
|
||||
@GetMapping("/authUser/allocatedList")
|
||||
public TableDataInfo allocatedList(SysUser user) {
|
||||
startPage();
|
||||
List<SysUser> list = userService.selectAllocatedList(user);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询未分配用户角色列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:role:list')")
|
||||
@GetMapping("/authUser/unallocatedList")
|
||||
public TableDataInfo unallocatedList(SysUser user) {
|
||||
startPage();
|
||||
List<SysUser> list = userService.selectUnallocatedList(user);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 取消授权用户
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:role:edit')")
|
||||
@Log(title = "角色管理", businessType = BusinessType.GRANT)
|
||||
@PutMapping("/authUser/cancel")
|
||||
public AjaxResult cancelAuthUser(@RequestBody SysUserRole userRole) {
|
||||
return toAjax(roleService.deleteAuthUser(userRole));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量取消授权用户
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:role:edit')")
|
||||
@Log(title = "角色管理", businessType = BusinessType.GRANT)
|
||||
@PutMapping("/authUser/cancelAll")
|
||||
public AjaxResult cancelAuthUserAll(Long roleId, Long[] userIds) {
|
||||
return toAjax(roleService.deleteAuthUsers(roleId, userIds));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量选择用户授权
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:role:edit')")
|
||||
@Log(title = "角色管理", businessType = BusinessType.GRANT)
|
||||
@PutMapping("/authUser/selectAll")
|
||||
public AjaxResult selectAuthUserAll(Long roleId, Long[] userIds) {
|
||||
roleService.checkRoleDataScope(roleId);
|
||||
return toAjax(roleService.insertAuthUsers(roleId, userIds));
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取对应角色部门树列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:role:query')")
|
||||
@GetMapping(value = "/deptTree/{roleId}")
|
||||
public AjaxResult deptTree(@PathVariable("roleId") Long roleId) {
|
||||
AjaxResult ajax = AjaxResult.success();
|
||||
ajax.put("checkedKeys", deptService.selectDeptListByRoleId(roleId));
|
||||
ajax.put("depts", deptService.selectDeptTreeList(new SysDept()));
|
||||
return ajax;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,219 @@
|
|||
package com.wms.web.controller.system;
|
||||
|
||||
import com.wms.common.annotation.Log;
|
||||
import com.wms.common.core.controller.BaseController;
|
||||
import com.wms.common.core.domain.AjaxResult;
|
||||
import com.wms.common.core.domain.entity.SysDept;
|
||||
import com.wms.common.core.domain.entity.SysRole;
|
||||
import com.wms.common.core.domain.entity.SysUser;
|
||||
import com.wms.common.core.page.TableDataInfo;
|
||||
import com.wms.common.enums.BusinessType;
|
||||
import com.wms.common.utils.SecurityUtils;
|
||||
import com.wms.common.utils.StringUtils;
|
||||
import com.wms.common.utils.poi.ExcelUtil;
|
||||
import com.wms.system.service.ISysDeptService;
|
||||
import com.wms.system.service.ISysPostService;
|
||||
import com.wms.system.service.ISysRoleService;
|
||||
import com.wms.system.service.ISysUserService;
|
||||
import org.apache.commons.lang3.ArrayUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* 用户信息
|
||||
*
|
||||
* @author wms
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/system/user")
|
||||
public class SysUserController extends BaseController {
|
||||
@Autowired
|
||||
private ISysUserService userService;
|
||||
|
||||
@Autowired
|
||||
private ISysRoleService roleService;
|
||||
|
||||
@Autowired
|
||||
private ISysDeptService deptService;
|
||||
|
||||
@Autowired
|
||||
private ISysPostService postService;
|
||||
|
||||
/**
|
||||
* 获取用户列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:user:list')")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(SysUser user) {
|
||||
startPage();
|
||||
List<SysUser> list = userService.selectUserList(user);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
@Log(title = "用户管理", businessType = BusinessType.EXPORT)
|
||||
@PreAuthorize("@ss.hasPermi('system:user:export')")
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, SysUser user) {
|
||||
List<SysUser> list = userService.selectUserList(user);
|
||||
ExcelUtil<SysUser> util = new ExcelUtil<SysUser>(SysUser.class);
|
||||
util.exportExcel(response, list, "用户数据");
|
||||
}
|
||||
|
||||
@Log(title = "用户管理", businessType = BusinessType.IMPORT)
|
||||
@PreAuthorize("@ss.hasPermi('system:user:import')")
|
||||
@PostMapping("/importData")
|
||||
public AjaxResult importData(MultipartFile file, boolean updateSupport) throws Exception {
|
||||
ExcelUtil<SysUser> util = new ExcelUtil<SysUser>(SysUser.class);
|
||||
List<SysUser> userList = util.importExcel(file.getInputStream());
|
||||
String operName = getUsername();
|
||||
String message = userService.importUser(userList, updateSupport, operName);
|
||||
return success(message);
|
||||
}
|
||||
|
||||
@PostMapping("/importTemplate")
|
||||
public void importTemplate(HttpServletResponse response) {
|
||||
ExcelUtil<SysUser> util = new ExcelUtil<SysUser>(SysUser.class);
|
||||
util.importTemplateExcel(response, "用户数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据用户编号获取详细信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:user:query')")
|
||||
@GetMapping(value = {"/", "/{userId}"})
|
||||
public AjaxResult getInfo(@PathVariable(value = "userId", required = false) Long userId) {
|
||||
userService.checkUserDataScope(userId);
|
||||
AjaxResult ajax = AjaxResult.success();
|
||||
List<SysRole> roles = roleService.selectRoleAll();
|
||||
ajax.put("roles", SysUser.isAdmin(userId) ? roles : roles.stream().filter(r -> !r.isAdmin()).collect(Collectors.toList()));
|
||||
ajax.put("posts", postService.selectPostAll());
|
||||
if (StringUtils.isNotNull(userId)) {
|
||||
SysUser sysUser = userService.selectUserById(userId);
|
||||
ajax.put(AjaxResult.DATA_TAG, sysUser);
|
||||
ajax.put("postIds", postService.selectPostListByUserId(userId));
|
||||
ajax.put("roleIds", sysUser.getRoles().stream().map(SysRole::getRoleId).collect(Collectors.toList()));
|
||||
}
|
||||
return ajax;
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增用户
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:user:add')")
|
||||
@Log(title = "用户管理", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@Validated @RequestBody SysUser user) {
|
||||
if (!userService.checkUserNameUnique(user)) {
|
||||
return error("新增用户'" + user.getUserName() + "'失败,登录账号已存在");
|
||||
} else if (StringUtils.isNotEmpty(user.getPhonenumber()) && !userService.checkPhoneUnique(user)) {
|
||||
return error("新增用户'" + user.getUserName() + "'失败,手机号码已存在");
|
||||
} else if (StringUtils.isNotEmpty(user.getEmail()) && !userService.checkEmailUnique(user)) {
|
||||
return error("新增用户'" + user.getUserName() + "'失败,邮箱账号已存在");
|
||||
}
|
||||
user.setCreateBy(getUsername());
|
||||
user.setPassword(SecurityUtils.encryptPassword(user.getPassword()));
|
||||
return toAjax(userService.insertUser(user));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改用户
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:user:edit')")
|
||||
@Log(title = "用户管理", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@Validated @RequestBody SysUser user) {
|
||||
userService.checkUserAllowed(user);
|
||||
userService.checkUserDataScope(user.getUserId());
|
||||
if (!userService.checkUserNameUnique(user)) {
|
||||
return error("修改用户'" + user.getUserName() + "'失败,登录账号已存在");
|
||||
} else if (StringUtils.isNotEmpty(user.getPhonenumber()) && !userService.checkPhoneUnique(user)) {
|
||||
return error("修改用户'" + user.getUserName() + "'失败,手机号码已存在");
|
||||
} else if (StringUtils.isNotEmpty(user.getEmail()) && !userService.checkEmailUnique(user)) {
|
||||
return error("修改用户'" + user.getUserName() + "'失败,邮箱账号已存在");
|
||||
}
|
||||
user.setUpdateBy(getUsername());
|
||||
return toAjax(userService.updateUser(user));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除用户
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:user:remove')")
|
||||
@Log(title = "用户管理", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{userIds}")
|
||||
public AjaxResult remove(@PathVariable Long[] userIds) {
|
||||
if (ArrayUtils.contains(userIds, getUserId())) {
|
||||
return error("当前用户不能删除");
|
||||
}
|
||||
return toAjax(userService.deleteUserByIds(userIds));
|
||||
}
|
||||
|
||||
/**
|
||||
* 重置密码
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:user:resetPwd')")
|
||||
@Log(title = "用户管理", businessType = BusinessType.UPDATE)
|
||||
@PutMapping("/resetPwd")
|
||||
public AjaxResult resetPwd(@RequestBody SysUser user) {
|
||||
userService.checkUserAllowed(user);
|
||||
userService.checkUserDataScope(user.getUserId());
|
||||
user.setPassword(SecurityUtils.encryptPassword(user.getPassword()));
|
||||
user.setUpdateBy(getUsername());
|
||||
return toAjax(userService.resetPwd(user));
|
||||
}
|
||||
|
||||
/**
|
||||
* 状态修改
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:user:edit')")
|
||||
@Log(title = "用户管理", businessType = BusinessType.UPDATE)
|
||||
@PutMapping("/changeStatus")
|
||||
public AjaxResult changeStatus(@RequestBody SysUser user) {
|
||||
userService.checkUserAllowed(user);
|
||||
userService.checkUserDataScope(user.getUserId());
|
||||
user.setUpdateBy(getUsername());
|
||||
return toAjax(userService.updateUserStatus(user));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据用户编号获取授权角色
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:user:query')")
|
||||
@GetMapping("/authRole/{userId}")
|
||||
public AjaxResult authRole(@PathVariable("userId") Long userId) {
|
||||
AjaxResult ajax = AjaxResult.success();
|
||||
SysUser user = userService.selectUserById(userId);
|
||||
List<SysRole> roles = roleService.selectRolesByUserId(userId);
|
||||
ajax.put("user", user);
|
||||
ajax.put("roles", SysUser.isAdmin(userId) ? roles : roles.stream().filter(r -> !r.isAdmin()).collect(Collectors.toList()));
|
||||
return ajax;
|
||||
}
|
||||
|
||||
/**
|
||||
* 用户授权角色
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:user:edit')")
|
||||
@Log(title = "用户管理", businessType = BusinessType.GRANT)
|
||||
@PutMapping("/authRole")
|
||||
public AjaxResult insertAuthRole(Long userId, Long[] roleIds) {
|
||||
userService.checkUserDataScope(userId);
|
||||
userService.insertUserAuth(userId, roleIds);
|
||||
return success();
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取部门树列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:user:list')")
|
||||
@GetMapping("/deptTree")
|
||||
public AjaxResult deptTree(SysDept dept) {
|
||||
return success(deptService.selectDeptTreeList(dept));
|
||||
}
|
||||
}
|
|
@ -0,0 +1,50 @@
|
|||
package com.wms.web.controller.tool;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.wms.alarm.domain.TbAlarmSource;
|
||||
import com.wms.alarm.service.ITbAlarmSourceService;
|
||||
import com.wms.common.core.controller.BaseController;
|
||||
import com.wms.common.core.domain.AjaxResult;
|
||||
import com.wms.web.controller.tool.vo.SelectVo;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 所有下拉选Controller
|
||||
*
|
||||
* @author 中xue
|
||||
* @version 1.0
|
||||
* @date 2023/6/13 18:12
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/allSelect")
|
||||
@Api(value = "WMS下拉选控制器", tags = {"WMS下拉选控制器"})
|
||||
@RequiredArgsConstructor(onConstructor_ = @Autowired)
|
||||
public class AllSelectController extends BaseController {
|
||||
private final ITbAlarmSourceService tbAlarmSourceService;
|
||||
|
||||
//=================================================================告警模块=================================================================
|
||||
@ApiOperation("获取告警源下拉选")
|
||||
@GetMapping(value = "/getAlarmSourceSelect")
|
||||
public AjaxResult getAlarmSourceSelect() {
|
||||
QueryWrapper<TbAlarmSource> tbAlarmSourceQueryWrapper = new QueryWrapper<>(new TbAlarmSource());
|
||||
tbAlarmSourceQueryWrapper.orderByDesc("create_time");
|
||||
List<TbAlarmSource> list = tbAlarmSourceService.list(tbAlarmSourceQueryWrapper);
|
||||
List<SelectVo> selectVoList = new ArrayList<>();
|
||||
for (TbAlarmSource tbAlarmSource : list) {
|
||||
SelectVo selectVo = SelectVo.builder().label(tbAlarmSource.getAlarmSourceName()).value(tbAlarmSource.getAlarmSourceCode()).build();
|
||||
selectVoList.add(selectVo);
|
||||
}
|
||||
return AjaxResult.success("获取下拉选成功", selectVoList);
|
||||
}
|
||||
|
||||
|
||||
}
|
|
@ -0,0 +1,147 @@
|
|||
package com.wms.web.controller.tool;
|
||||
|
||||
import com.wms.common.core.controller.BaseController;
|
||||
import com.wms.common.core.domain.R;
|
||||
import com.wms.common.utils.StringUtils;
|
||||
import io.swagger.annotations.*;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* swagger 用户测试方法
|
||||
*
|
||||
* @author wms
|
||||
*/
|
||||
@Api(tags = "用户信息管理")
|
||||
@RestController
|
||||
@RequestMapping("/test/user")
|
||||
public class TestController extends BaseController {
|
||||
private final static Map<Integer, UserEntity> users = new LinkedHashMap<Integer, UserEntity>();
|
||||
|
||||
{
|
||||
users.put(1, new UserEntity(1, "admin", "admin123", "15888888888"));
|
||||
users.put(2, new UserEntity(2, "ry", "admin123", "15666666666"));
|
||||
}
|
||||
|
||||
@ApiOperation("获取用户列表")
|
||||
@GetMapping("/list")
|
||||
public R<List<UserEntity>> userList() {
|
||||
List<UserEntity> userList = new ArrayList<UserEntity>(users.values());
|
||||
return R.ok(userList);
|
||||
}
|
||||
|
||||
@ApiOperation("获取用户详细")
|
||||
@ApiImplicitParam(name = "userId", value = "用户ID", required = true, dataType = "int", paramType = "path", dataTypeClass = Integer.class)
|
||||
@GetMapping("/{userId}")
|
||||
public R<UserEntity> getUser(@PathVariable Integer userId) {
|
||||
if (!users.isEmpty() && users.containsKey(userId)) {
|
||||
return R.ok(users.get(userId));
|
||||
} else {
|
||||
return R.fail("用户不存在");
|
||||
}
|
||||
}
|
||||
|
||||
@ApiOperation("新增用户")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "userId", value = "用户id", dataType = "Integer", dataTypeClass = Integer.class),
|
||||
@ApiImplicitParam(name = "username", value = "用户名称", dataType = "String", dataTypeClass = String.class),
|
||||
@ApiImplicitParam(name = "password", value = "用户密码", dataType = "String", dataTypeClass = String.class),
|
||||
@ApiImplicitParam(name = "mobile", value = "用户手机", dataType = "String", dataTypeClass = String.class)
|
||||
})
|
||||
@PostMapping("/save")
|
||||
public R<String> save(UserEntity user) {
|
||||
if (StringUtils.isNull(user) || StringUtils.isNull(user.getUserId())) {
|
||||
return R.fail("用户ID不能为空");
|
||||
}
|
||||
users.put(user.getUserId(), user);
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
@ApiOperation("更新用户")
|
||||
@PutMapping("/update")
|
||||
public R<String> update(@RequestBody UserEntity user) {
|
||||
if (StringUtils.isNull(user) || StringUtils.isNull(user.getUserId())) {
|
||||
return R.fail("用户ID不能为空");
|
||||
}
|
||||
if (users.isEmpty() || !users.containsKey(user.getUserId())) {
|
||||
return R.fail("用户不存在");
|
||||
}
|
||||
users.remove(user.getUserId());
|
||||
users.put(user.getUserId(), user);
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
@ApiOperation("删除用户信息")
|
||||
@ApiImplicitParam(name = "userId", value = "用户ID", required = true, dataType = "int", paramType = "path", dataTypeClass = Integer.class)
|
||||
@DeleteMapping("/{userId}")
|
||||
public R<String> delete(@PathVariable Integer userId) {
|
||||
if (!users.isEmpty() && users.containsKey(userId)) {
|
||||
users.remove(userId);
|
||||
return R.ok();
|
||||
} else {
|
||||
return R.fail("用户不存在");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ApiModel(value = "UserEntity", description = "用户实体")
|
||||
class UserEntity {
|
||||
@ApiModelProperty(value = "用户ID", position = 0)
|
||||
private Integer userId;
|
||||
|
||||
@ApiModelProperty(value = "用户名称", required = true, position =1)
|
||||
private String username;
|
||||
|
||||
@ApiModelProperty("用户密码")
|
||||
private String password;
|
||||
|
||||
@ApiModelProperty("用户手机")
|
||||
private String mobile;
|
||||
|
||||
public UserEntity() {
|
||||
|
||||
}
|
||||
|
||||
public UserEntity(Integer userId, String username, String password, String mobile) {
|
||||
this.userId = userId;
|
||||
this.username = username;
|
||||
this.password = password;
|
||||
this.mobile = mobile;
|
||||
}
|
||||
|
||||
public Integer getUserId() {
|
||||
return userId;
|
||||
}
|
||||
|
||||
public void setUserId(Integer userId) {
|
||||
this.userId = userId;
|
||||
}
|
||||
|
||||
public String getUsername() {
|
||||
return username;
|
||||
}
|
||||
|
||||
public void setUsername(String username) {
|
||||
this.username = username;
|
||||
}
|
||||
|
||||
public String getPassword() {
|
||||
return password;
|
||||
}
|
||||
|
||||
public void setPassword(String password) {
|
||||
this.password = password;
|
||||
}
|
||||
|
||||
public String getMobile() {
|
||||
return mobile;
|
||||
}
|
||||
|
||||
public void setMobile(String mobile) {
|
||||
this.mobile = mobile;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,27 @@
|
|||
package com.wms.web.controller.tool.vo;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author 中xue
|
||||
* @version 1.0
|
||||
* @date 2023/6/14 11:00
|
||||
*/
|
||||
@Data
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class CascadeSelectVo {
|
||||
//下拉选名称
|
||||
private String label;
|
||||
//下拉选值
|
||||
private String value;
|
||||
//下级下拉选
|
||||
private List<CascadeSelectVo> children;
|
||||
}
|
||||
|
|
@ -0,0 +1,18 @@
|
|||
package com.wms.web.controller.tool.vo;
|
||||
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @author 中xue
|
||||
* @version 1.0
|
||||
* @date 2023/6/13 18:17
|
||||
*/
|
||||
@Data
|
||||
@Builder
|
||||
public class SelectVo {
|
||||
//下拉选名称
|
||||
private String label;
|
||||
//下拉选值
|
||||
private String value;
|
||||
}
|
|
@ -0,0 +1,122 @@
|
|||
package com.wms.web.core.config;
|
||||
|
||||
import com.wms.common.config.WmsConfig;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import io.swagger.models.auth.In;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import springfox.documentation.builders.ApiInfoBuilder;
|
||||
import springfox.documentation.builders.PathSelectors;
|
||||
import springfox.documentation.builders.RequestHandlerSelectors;
|
||||
import springfox.documentation.service.*;
|
||||
import springfox.documentation.spi.DocumentationType;
|
||||
import springfox.documentation.spi.service.contexts.SecurityContext;
|
||||
import springfox.documentation.spring.web.plugins.Docket;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Swagger2的接口配置
|
||||
*
|
||||
* @author wms
|
||||
*/
|
||||
@Configuration
|
||||
public class SwaggerConfig {
|
||||
/**
|
||||
* 系统基础配置
|
||||
*/
|
||||
@Autowired
|
||||
private WmsConfig wmsConfig;
|
||||
|
||||
/**
|
||||
* 是否开启swagger
|
||||
*/
|
||||
@Value("${swagger.enabled}")
|
||||
private boolean enabled;
|
||||
|
||||
/**
|
||||
* 设置请求的统一前缀
|
||||
*/
|
||||
@Value("${swagger.pathMapping}")
|
||||
private String pathMapping;
|
||||
|
||||
/**
|
||||
* 创建API
|
||||
*/
|
||||
@Bean
|
||||
public Docket createRestApi() {
|
||||
return new Docket(DocumentationType.OAS_30)
|
||||
// 是否启用Swagger
|
||||
.enable(enabled)
|
||||
// 用来创建该API的基本信息,展示在文档的页面中(自定义展示的信息)
|
||||
.apiInfo(apiInfo())
|
||||
// 设置哪些接口暴露给Swagger展示
|
||||
.select()
|
||||
// 扫描所有有注解的api,用这种方式更灵活
|
||||
.apis(RequestHandlerSelectors.withMethodAnnotation(ApiOperation.class))
|
||||
// 扫描指定包中的swagger注解
|
||||
// .apis(RequestHandlerSelectors.basePackage("com.wms.project.tool.swagger"))
|
||||
// 扫描所有 .apis(RequestHandlerSelectors.any())
|
||||
.paths(PathSelectors.any())
|
||||
.build()
|
||||
/* 设置安全模式,swagger可以设置访问token */
|
||||
.securitySchemes(securitySchemes())
|
||||
.securityContexts(securityContexts())
|
||||
.host("localhost:5050")
|
||||
.pathMapping(pathMapping);
|
||||
}
|
||||
|
||||
/**
|
||||
* 安全模式,这里指定token通过Authorization头请求头传递
|
||||
*/
|
||||
private List<SecurityScheme> securitySchemes() {
|
||||
List<SecurityScheme> apiKeyList = new ArrayList<SecurityScheme>();
|
||||
apiKeyList.add(new ApiKey("Authorization", "Authorization", In.HEADER.toValue()));
|
||||
return apiKeyList;
|
||||
}
|
||||
|
||||
/**
|
||||
* 安全上下文
|
||||
*/
|
||||
private List<SecurityContext> securityContexts() {
|
||||
List<SecurityContext> securityContexts = new ArrayList<>();
|
||||
securityContexts.add(
|
||||
SecurityContext.builder()
|
||||
.securityReferences(defaultAuth())
|
||||
.operationSelector(o -> o.requestMappingPattern().matches("/.*"))
|
||||
.build());
|
||||
return securityContexts;
|
||||
}
|
||||
|
||||
/**
|
||||
* 默认的安全上引用
|
||||
*/
|
||||
private List<SecurityReference> defaultAuth() {
|
||||
AuthorizationScope authorizationScope = new AuthorizationScope("global", "accessEverything");
|
||||
AuthorizationScope[] authorizationScopes = new AuthorizationScope[1];
|
||||
authorizationScopes[0] = authorizationScope;
|
||||
List<SecurityReference> securityReferences = new ArrayList<>();
|
||||
securityReferences.add(new SecurityReference("Authorization", authorizationScopes));
|
||||
return securityReferences;
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加摘要信息
|
||||
*/
|
||||
private ApiInfo apiInfo() {
|
||||
// 用ApiInfoBuilder进行定制
|
||||
return new ApiInfoBuilder()
|
||||
// 设置标题
|
||||
.title("标题:Wms管理系统_接口文档")
|
||||
// 描述
|
||||
.description("描述:用于管理集团旗下公司的人员信息,具体包括XXX,XXX模块...")
|
||||
// 作者信息
|
||||
.contact(new Contact(wmsConfig.getName(), null, null))
|
||||
// 版本
|
||||
.version("版本号:" + wmsConfig.getVersion())
|
||||
.build();
|
||||
}
|
||||
}
|
|
@ -0,0 +1 @@
|
|||
restart.include.json=/com.alibaba.fastjson.*.jar
|
|
@ -0,0 +1,151 @@
|
|||
# 数据源配置
|
||||
spring:
|
||||
datasource:
|
||||
type: com.alibaba.druid.pool.DruidDataSource
|
||||
driverClassName: com.mysql.cj.jdbc.Driver
|
||||
druid:
|
||||
# 主库数据源
|
||||
master:
|
||||
url: jdbc:mysql://localhost:3306/wms_chongqing_kafu?autoReconnect=true&useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
|
||||
username: root
|
||||
password: root
|
||||
# 从库数据源
|
||||
slave:
|
||||
# 从数据源开关/默认关闭
|
||||
enabled: false
|
||||
url:
|
||||
username:
|
||||
password:
|
||||
# 初始连接数
|
||||
initialSize: 5
|
||||
# 最小连接池数量
|
||||
minIdle: 10
|
||||
# 最大连接池数量
|
||||
maxActive: 20
|
||||
# 配置获取连接等待超时的时间
|
||||
maxWait: 60000
|
||||
# 配置连接超时时间
|
||||
connectTimeout: 30000
|
||||
# 配置网络超时时间
|
||||
socketTimeout: 60000
|
||||
# 配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位是毫秒
|
||||
timeBetweenEvictionRunsMillis: 60000
|
||||
# 配置一个连接在池中最小生存的时间,单位是毫秒
|
||||
minEvictableIdleTimeMillis: 300000
|
||||
# 配置一个连接在池中最大生存的时间,单位是毫秒
|
||||
maxEvictableIdleTimeMillis: 900000
|
||||
# 配置检测连接是否有效
|
||||
validationQuery: SELECT 1 FROM DUAL
|
||||
testWhileIdle: true
|
||||
testOnBorrow: false
|
||||
testOnReturn: false
|
||||
webStatFilter:
|
||||
enabled: true
|
||||
statViewServlet:
|
||||
enabled: true
|
||||
# 设置白名单,不填则允许所有访问
|
||||
allow:
|
||||
url-pattern: /druid/*
|
||||
# 控制台管理用户名和密码
|
||||
login-username: wms
|
||||
login-password: 123456
|
||||
filter:
|
||||
stat:
|
||||
enabled: true
|
||||
# 慢SQL记录
|
||||
log-slow-sql: true
|
||||
slow-sql-millis: 1000
|
||||
merge-sql: true
|
||||
wall:
|
||||
config:
|
||||
multi-statement-allow: true
|
||||
# redis 配置
|
||||
redis:
|
||||
# 地址
|
||||
host: localhost
|
||||
# 端口,默认为6379
|
||||
port: 6379
|
||||
# 数据库索引
|
||||
database: 0
|
||||
# 密码
|
||||
password:
|
||||
# 连接超时时间
|
||||
timeout: 10s
|
||||
lettuce:
|
||||
pool:
|
||||
# 连接池中的最小空闲连接
|
||||
min-idle: 0
|
||||
# 连接池中的最大空闲连接
|
||||
max-idle: 8
|
||||
# 连接池的最大数据库连接数
|
||||
max-active: 8
|
||||
# #连接池最大阻塞等待时间(使用负值表示没有限制)
|
||||
max-wait: -1ms
|
||||
|
||||
# 数据库备份模块配
|
||||
backup:
|
||||
# sql文件存放路径 示例( Windows配置D:\wms\uploadPath\backup\sql,Linux配置 /home/wms/uploadPath/backup/sql)
|
||||
sqlFilePath: D:\wms\uploadPath\backup\sql
|
||||
# minio 保存地址
|
||||
|
||||
|
||||
|
||||
# Minio文件存储配置信息
|
||||
minio:
|
||||
endpoint: http://127.0.0.1:9000
|
||||
accesskey: admin
|
||||
secretKey: 12345678
|
||||
|
||||
|
||||
|
||||
wcs:
|
||||
httpUrl: http://localhost:8080/SetUp_Task
|
||||
carHttpUrl: http://localhost:8080/AGVInfo
|
||||
|
||||
|
||||
|
||||
tcp:
|
||||
clientName: wmsBasic
|
||||
|
||||
server_A:
|
||||
serverName: Tape TCP
|
||||
host: localhost
|
||||
port: 50904
|
||||
# 与服务端断开连接后,间隔多少秒尝试重新连接 单位秒
|
||||
reconnectTime: 10
|
||||
# 是否开启true开启 false不开启
|
||||
start: false
|
||||
server_B:
|
||||
serverName: Other TCP
|
||||
host: localhost
|
||||
port: 50905
|
||||
# 与服务端断开连接后,间隔多少秒尝试重新连接 单位秒
|
||||
reconnectTime: 5
|
||||
# 是否开启true开启 false不开启
|
||||
start: false
|
||||
|
||||
# TCP/Netty服务端端配置信息
|
||||
netty:
|
||||
clientName: wmsBasic
|
||||
server_tape:
|
||||
serverName: Tape TCP
|
||||
host: localhost
|
||||
port: 50904
|
||||
# 与服务端断开连接后,间隔多少秒尝试重新连接 单位秒
|
||||
reconnectTime: 10
|
||||
# 是否连接服务端true连接 false不连接
|
||||
connection: false
|
||||
|
||||
|
||||
## MQTT##
|
||||
mqtt:
|
||||
username: # 用户名
|
||||
password: # 密码
|
||||
hostUrl: tcp://localhost:1883 # tcp://ip:端口
|
||||
# clientId: mqttx_fdb83555 # 客户端id,线下
|
||||
clientId: mqttx_fdb83518 # 客户端id,线上
|
||||
# 订阅主题
|
||||
defaultTopic: PatrolRobot_OrbitalRobot_CurStatus/#,PatrolRobot_OrbitalRobot_GasCurStatus/#
|
||||
timeout: 100 # 超时时间 (单位:秒)
|
||||
keepalive: 60 # 心跳 (单位:秒)
|
||||
enabled: false # 是否使用mqtt功能
|
|
@ -0,0 +1,154 @@
|
|||
# 数据源配置
|
||||
spring:
|
||||
datasource:
|
||||
type: com.alibaba.druid.pool.DruidDataSource
|
||||
driverClassName: com.mysql.cj.jdbc.Driver
|
||||
druid:
|
||||
# 主库数据源
|
||||
master:
|
||||
url: jdbc:mysql://localhost:3306/kafu_druid?autoReconnect=true&useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
|
||||
username: root
|
||||
password: qzx_root
|
||||
# 从库数据源
|
||||
slave:
|
||||
# 从数据源开关/默认关闭
|
||||
enabled: false
|
||||
url:
|
||||
username:
|
||||
password:
|
||||
# 初始连接数
|
||||
initialSize: 5
|
||||
# 最小连接池数量
|
||||
minIdle: 10
|
||||
# 最大连接池数量
|
||||
maxActive: 20
|
||||
# 配置获取连接等待超时的时间
|
||||
maxWait: 60000
|
||||
# 配置连接超时时间
|
||||
connectTimeout: 30000
|
||||
# 配置网络超时时间
|
||||
socketTimeout: 60000
|
||||
# 配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位是毫秒
|
||||
timeBetweenEvictionRunsMillis: 60000
|
||||
# 配置一个连接在池中最小生存的时间,单位是毫秒
|
||||
minEvictableIdleTimeMillis: 300000
|
||||
# 配置一个连接在池中最大生存的时间,单位是毫秒
|
||||
maxEvictableIdleTimeMillis: 900000
|
||||
# 配置检测连接是否有效
|
||||
validationQuery: SELECT 1 FROM DUAL
|
||||
testWhileIdle: true
|
||||
testOnBorrow: false
|
||||
testOnReturn: false
|
||||
webStatFilter:
|
||||
enabled: true
|
||||
statViewServlet:
|
||||
enabled: true
|
||||
# 设置白名单,不填则允许所有访问
|
||||
allow:
|
||||
url-pattern: /druid/*
|
||||
# 控制台管理用户名和密码
|
||||
login-username: wms
|
||||
login-password: wms123456
|
||||
filter:
|
||||
stat:
|
||||
enabled: true
|
||||
# 慢SQL记录
|
||||
log-slow-sql: true
|
||||
slow-sql-millis: 1000
|
||||
merge-sql: true
|
||||
wall:
|
||||
config:
|
||||
multi-statement-allow: true
|
||||
# redis 配置
|
||||
redis:
|
||||
# 地址
|
||||
host: localhost
|
||||
# 端口,默认为6379
|
||||
port: 6379
|
||||
# 数据库索引
|
||||
database: 0
|
||||
# 密码
|
||||
password:
|
||||
# 连接超时时间
|
||||
timeout: 10s
|
||||
lettuce:
|
||||
pool:
|
||||
# 连接池中的最小空闲连接
|
||||
min-idle: 0
|
||||
# 连接池中的最大空闲连接
|
||||
max-idle: 8
|
||||
# 连接池的最大数据库连接数
|
||||
max-active: 8
|
||||
# #连接池最大阻塞等待时间(使用负值表示没有限制)
|
||||
max-wait: -1ms
|
||||
|
||||
|
||||
# 数据库备份模块配
|
||||
backup:
|
||||
# sql文件存放路径 示例( Windows配置D:\wms\uploadPath\backup\sql,Linux配置 /home/wms/uploadPath/backup/sql)
|
||||
sqlFilePath: D:\wms\uploadPath\backup\sql
|
||||
# minio 保存地址
|
||||
|
||||
# Minio文件存储配置信息
|
||||
minio:
|
||||
endpoint: http://127.0.0.1:9000
|
||||
accesskey: admin
|
||||
secretKey: 12345678
|
||||
|
||||
|
||||
|
||||
wcs:
|
||||
httpUrl: http://localhost:8080/SetUp_Task
|
||||
carHttpUrl: http://localhost:8080/AGVInfo
|
||||
|
||||
|
||||
|
||||
|
||||
tcp:
|
||||
clientName: wmsBasic
|
||||
|
||||
server_A:
|
||||
serverName: Tape TCP
|
||||
host: localhost
|
||||
port: 50904
|
||||
# 与服务端断开连接后,间隔多少秒尝试重新连接 单位秒
|
||||
reconnectTime: 10
|
||||
# 是否开启true开启 false不开启
|
||||
start: false
|
||||
server_B:
|
||||
serverName: Other TCP
|
||||
host: localhost
|
||||
port: 50905
|
||||
# 与服务端断开连接后,间隔多少秒尝试重新连接 单位秒
|
||||
reconnectTime: 5
|
||||
# 是否开启true开启 false不开启
|
||||
start: false
|
||||
|
||||
# TCP/Netty服务端端配置信息
|
||||
netty:
|
||||
clientName: wmsBasic
|
||||
server_tape:
|
||||
serverName: Tape TCP
|
||||
host: localhost
|
||||
port: 50904
|
||||
# 与服务端断开连接后,间隔多少秒尝试重新连接 单位秒
|
||||
reconnectTime: 10
|
||||
# 是否连接服务端true连接 false不连接
|
||||
connection: false
|
||||
|
||||
|
||||
## MQTT##
|
||||
mqtt:
|
||||
username: # 用户名
|
||||
password: # 密码
|
||||
hostUrl: tcp://localhost:1883 # tcp://ip:端口
|
||||
# clientId: mqttx_fdb83555 # 客户端id,线下
|
||||
clientId: mqttx_fdb83518 # 客户端id,线上
|
||||
# 订阅主题
|
||||
defaultTopic: PatrolRobot_OrbitalRobot_CurStatus/#,PatrolRobot_OrbitalRobot_GasCurStatus/#
|
||||
timeout: 100 # 超时时间 (单位:秒)
|
||||
keepalive: 60 # 心跳 (单位:秒)
|
||||
enabled: false # 是否使用mqtt功能
|
||||
|
||||
|
||||
|
|
@ -0,0 +1,125 @@
|
|||
# 项目相关配置
|
||||
wms:
|
||||
# 名称
|
||||
name: Wms-KaFu
|
||||
# 版本
|
||||
version: 1.0.0
|
||||
# 版权年份
|
||||
copyrightYear: 2024
|
||||
# 实例演示开关
|
||||
demoEnabled: true
|
||||
# 文件路径 示例( Windows配置D:/wms/uploadPath,Linux配置 /home/wms/uploadPath)
|
||||
profile: D:/wms/uploadPath
|
||||
# 获取ip地址开关
|
||||
addressEnabled: false
|
||||
# 验证码类型 math 数组计算 char 字符验证
|
||||
captchaType: math
|
||||
|
||||
# 开发环境配置
|
||||
server:
|
||||
# 服务器的HTTP端口,默认为5050
|
||||
# port: 5050
|
||||
port: 5050
|
||||
servlet:
|
||||
# 应用的访问路径
|
||||
context-path: /
|
||||
tomcat:
|
||||
# tomcat的URI编码
|
||||
uri-encoding: UTF-8
|
||||
# 连接数满后的排队数,默认为100
|
||||
accept-count: 1000
|
||||
threads:
|
||||
# tomcat最大线程数,默认为200
|
||||
max: 800
|
||||
# Tomcat启动初始化的线程数,默认值10
|
||||
min-spare: 100
|
||||
|
||||
# 日志配置
|
||||
logging:
|
||||
level:
|
||||
com.wms: debug
|
||||
org.springframework: warn
|
||||
|
||||
# 用户配置
|
||||
user:
|
||||
password:
|
||||
# 密码最大错误次数
|
||||
maxRetryCount: 5
|
||||
# 密码锁定时间(默认10分钟)
|
||||
lockTime: 10
|
||||
|
||||
# Spring配置
|
||||
spring:
|
||||
# 资源信息
|
||||
messages:
|
||||
# 国际化资源文件路径
|
||||
basename: i18n/messages
|
||||
profiles:
|
||||
active: druid
|
||||
# 文件上传
|
||||
servlet:
|
||||
multipart:
|
||||
# 单个文件大小
|
||||
max-file-size: 10MB
|
||||
# 设置总上传的文件大小
|
||||
max-request-size: 20MB
|
||||
# 服务模块
|
||||
devtools:
|
||||
restart:
|
||||
# 热部署开关
|
||||
enabled: true
|
||||
|
||||
# token配置
|
||||
token:
|
||||
# 令牌自定义标识
|
||||
header: Authorization
|
||||
# 令牌密钥
|
||||
secret: abcdefghijklmnopqrstuvwxyz
|
||||
# 令牌有效期(默认30分钟)
|
||||
expireTime: 600
|
||||
# 是否允许账户多终端同时登录(true允许 false不允许)
|
||||
soloLogin: true
|
||||
|
||||
# MyBatis Plus配置
|
||||
mybatis-plus:
|
||||
# 搜索指定包别名
|
||||
typeAliasesPackage: com.wms.**.domain
|
||||
# 配置mapper的扫描,找到所有的mapper.xml映射文件
|
||||
mapperLocations: classpath*:mapper/**/*Mapper.xml
|
||||
|
||||
# PageHelper分页插件
|
||||
pagehelper:
|
||||
helperDialect: mysql
|
||||
supportMethodsArguments: true
|
||||
params: count=countSql
|
||||
|
||||
# Swagger配置
|
||||
swagger:
|
||||
# 是否开启swagger
|
||||
enabled: true
|
||||
# 请求前缀
|
||||
pathMapping: /dev-api
|
||||
|
||||
# 防止XSS攻击
|
||||
xss:
|
||||
# 过滤开关
|
||||
enabled: true
|
||||
# 排除链接(多个用逗号分隔)
|
||||
excludes: /system/notice
|
||||
# 匹配链接
|
||||
urlPatterns: /system/*,/monitor/*,/tool/*
|
||||
|
||||
# license
|
||||
license:
|
||||
# 证书subject
|
||||
subject: wms-license
|
||||
# 公钥别称
|
||||
publicAlias: PUBLICKEY
|
||||
# 访问公钥库的密码
|
||||
storePass: 21#nS@NjJK20
|
||||
# 证书生成路径
|
||||
licensePath: /Users/zf/Documents/license/license.lic
|
||||
# 密钥库存储路径
|
||||
publicKeysStorePath: /Users/zf/Documents/license/publicCerts.keystore
|
||||
|
||||
|
|
@ -0,0 +1,5 @@
|
|||
Application Version: ${wms.version}
|
||||
Spring Boot Version: ${spring-boot.version}
|
||||
////////////////////////////////////////////////////////////////////
|
||||
// wms后台管理系统 //
|
||||
////////////////////////////////////////////////////////////////////
|
|
@ -0,0 +1,134 @@
|
|||
##\u9ED8\u8BA4\u6D88\u606F\u914D\u7F6E\u6587\u4EF6
|
||||
#\u9519\u8BEF\u6D88\u606F
|
||||
not.null=* \u5FC5\u987B\u586B\u5199
|
||||
user.jcaptcha.error=\u9A8C\u8BC1\u7801\u9519\u8BEF
|
||||
user.jcaptcha.expire=\u9A8C\u8BC1\u7801\u5DF2\u5931\u6548
|
||||
user.not.exists=\u7528\u6237\u4E0D\u5B58\u5728/\u5BC6\u7801\u9519\u8BEF
|
||||
user.password.not.match=\u7528\u6237\u4E0D\u5B58\u5728/\u5BC6\u7801\u9519\u8BEF
|
||||
user.password.retry.limit.count=\u5BC6\u7801\u8F93\u5165\u9519\u8BEF{0}\u6B21
|
||||
user.password.retry.limit.exceed=\u5BC6\u7801\u8F93\u5165\u9519\u8BEF{0}\u6B21\uFF0C\u5E10\u6237\u9501\u5B9A{1}\u5206\u949F
|
||||
user.password.delete=\u5BF9\u4E0D\u8D77\uFF0C\u60A8\u7684\u8D26\u53F7\u5DF2\u88AB\u5220\u9664
|
||||
user.blocked=\u7528\u6237\u5DF2\u5C01\u7981\uFF0C\u8BF7\u8054\u7CFB\u7BA1\u7406\u5458
|
||||
role.blocked=\u89D2\u8272\u5DF2\u5C01\u7981\uFF0C\u8BF7\u8054\u7CFB\u7BA1\u7406\u5458
|
||||
login.blocked=\u5F88\u9057\u61BE\uFF0C\u8BBF\u95EEIP\u5DF2\u88AB\u5217\u5165\u7CFB\u7EDF\u9ED1\u540D\u5355
|
||||
user.logout.success=\u9000\u51FA\u6210\u529F
|
||||
|
||||
length.not.valid=\u957F\u5EA6\u5FC5\u987B\u5728{min}\u5230{max}\u4E2A\u5B57\u7B26\u4E4B\u95F4
|
||||
|
||||
user.username.not.valid=* 2\u523020\u4E2A\u6C49\u5B57\u3001\u5B57\u6BCD\u3001\u6570\u5B57\u6216\u4E0B\u5212\u7EBF\u7EC4\u6210\uFF0C\u4E14\u5FC5\u987B\u4EE5\u975E\u6570\u5B57\u5F00\u5934
|
||||
user.password.not.valid=* 5-50\u4E2A\u5B57\u7B26
|
||||
|
||||
user.email.not.valid=\u90AE\u7BB1\u683C\u5F0F\u9519\u8BEF
|
||||
user.mobile.phone.number.not.valid=\u624B\u673A\u53F7\u683C\u5F0F\u9519\u8BEF
|
||||
user.login.success=\u767B\u5F55\u6210\u529F
|
||||
user.register.success=\u6CE8\u518C\u6210\u529F
|
||||
user.notfound=\u8BF7\u91CD\u65B0\u767B\u5F55
|
||||
user.forcelogout=\u7BA1\u7406\u5458\u5F3A\u5236\u9000\u51FA\uFF0C\u8BF7\u91CD\u65B0\u767B\u5F55
|
||||
user.unknown.error=\u672A\u77E5\u9519\u8BEF\uFF0C\u8BF7\u91CD\u65B0\u767B\u5F55
|
||||
|
||||
##\u6587\u4EF6\u4E0A\u4F20\u6D88\u606F
|
||||
upload.exceed.maxSize=\u4E0A\u4F20\u7684\u6587\u4EF6\u5927\u5C0F\u8D85\u51FA\u9650\u5236\u7684\u6587\u4EF6\u5927\u5C0F\uFF01<br/>\u5141\u8BB8\u7684\u6587\u4EF6\u6700\u5927\u5927\u5C0F\u662F\uFF1A{0}MB\uFF01
|
||||
upload.filename.exceed.length=\u4E0A\u4F20\u7684\u6587\u4EF6\u540D\u6700\u957F{0}\u4E2A\u5B57\u7B26
|
||||
|
||||
##\u6743\u9650
|
||||
no.permission=\u60A8\u6CA1\u6709\u6570\u636E\u7684\u6743\u9650\uFF0C\u8BF7\u8054\u7CFB\u7BA1\u7406\u5458\u6DFB\u52A0\u6743\u9650 [{0}]
|
||||
no.create.permission=\u60A8\u6CA1\u6709\u521B\u5EFA\u6570\u636E\u7684\u6743\u9650\uFF0C\u8BF7\u8054\u7CFB\u7BA1\u7406\u5458\u6DFB\u52A0\u6743\u9650 [{0}]
|
||||
no.update.permission=\u60A8\u6CA1\u6709\u4FEE\u6539\u6570\u636E\u7684\u6743\u9650\uFF0C\u8BF7\u8054\u7CFB\u7BA1\u7406\u5458\u6DFB\u52A0\u6743\u9650 [{0}]
|
||||
no.delete.permission=\u60A8\u6CA1\u6709\u5220\u9664\u6570\u636E\u7684\u6743\u9650\uFF0C\u8BF7\u8054\u7CFB\u7BA1\u7406\u5458\u6DFB\u52A0\u6743\u9650 [{0}]
|
||||
no.export.permission=\u60A8\u6CA1\u6709\u5BFC\u51FA\u6570\u636E\u7684\u6743\u9650\uFF0C\u8BF7\u8054\u7CFB\u7BA1\u7406\u5458\u6DFB\u52A0\u6743\u9650 [{0}]
|
||||
no.view.permission=\u60A8\u6CA1\u6709\u67E5\u770B\u6570\u636E\u7684\u6743\u9650\uFF0C\u8BF7\u8054\u7CFB\u7BA1\u7406\u5458\u6DFB\u52A0\u6743\u9650 [{0}]
|
||||
|
||||
##\u7CFB\u7EDF\u516C\u7528message
|
||||
sys.deliver.param.error=\u53C2\u6570\u4F20\u9012\u6709\u8BEF
|
||||
|
||||
##TableDataInfo
|
||||
table.data.info.msg=\u67E5\u8BE2\u6210\u529F
|
||||
table.data.error.msg=\u67E5\u8BE2\u5931\u8D25
|
||||
|
||||
operations.success=\u64CD\u4F5C\u6210\u529F
|
||||
operations.error=\u64CD\u4F5C\u5931\u8D25
|
||||
|
||||
##==================================================\u57FA\u7840\u6863\u6848==================================================
|
||||
sequence.success=\u4E1A\u52A1\u53F7\u83B7\u53D6\u6210\u529F
|
||||
sequence.error=\u4E1A\u52A1\u53F7\u83B7\u53D6\u5931\u8D25
|
||||
|
||||
basic.warehouse.primaryKeyConflict=\u4ED3\u5E93\u7F16\u7801\u5DF2\u5B58\u5728,\u8BF7\u68C0\u67E5!
|
||||
basic.warehouse.isNotAllowedToDelete=\u4ED3\u5E93\u5B58\u5728\u5E93\u533A\u6863\u6848,\u4E0D\u5141\u8BB8\u5220\u9664\u64CD\u4F5C!
|
||||
|
||||
basic.wareArea.primaryKeyConflict=\u5E93\u533A\u7F16\u7801\u5DF2\u5B58\u5728,\u8BF7\u68C0\u67E5!
|
||||
basic.storage.isNotAllowedToDelete=\u5E93\u533A\u5B58\u5728\u5E93\u4F4D\u6863\u6848,\u4E0D\u5141\u8BB8\u5220\u9664\u64CD\u4F5C!
|
||||
|
||||
basic.container.primaryKeyConflict=\u6258\u76D8\u7F16\u7801\u5DF2\u5B58\u5728,\u8BF7\u68C0\u67E5!
|
||||
|
||||
basic.article.primaryKeyConflict=\u7269\u6599\u7F16\u7801\u5DF2\u5B58\u5728,\u8BF7\u68C0\u67E5!
|
||||
|
||||
basic.storageBin.primaryKeyConflict=\u5E93\u4F4D\u7F16\u7801\u5DF2\u5B58\u5728,\u8BF7\u68C0\u67E5!
|
||||
basic.storageBin.ObjectIsNull=\u672A\u67E5\u8BE2\u5230\u5E93\u4F4D\u4FE1\u606F,\u8BF7\u68C0\u67E5!
|
||||
basic.storageBin.inUsing.no=\u5F53\u524D\u5E93\u4F4D\u672A\u542F\u7528,\u8BF7\u68C0\u67E5!
|
||||
basic.storageBin.inUsing.yes=\u5F53\u524D\u5E93\u4F4D\u5DF2\u542F\u7528,\u8BF7\u68C0\u67E5!
|
||||
basic.storageBin.storageStatus.nonFree=\u5F53\u524D\u5E93\u4F4D\u975E\u7A7A\u5E93\u4F4D,\u8BF7\u68C0\u67E5!
|
||||
basic.storageBin.storageStatus.nonInStorage=\u5F53\u524D\u5E93\u4F4D\u975E\u50A8\u7269\u4E2D,\u8BF7\u68C0\u67E5!
|
||||
basic.storageBin.storageStatus.nonEmptyContainer=\u5F53\u524D\u5E93\u4F4D\u975E\u5BB9\u5668\u5E93\u4F4D,\u8BF7\u68C0\u67E5!
|
||||
basic.storageBin.lock.no=\u5F53\u524D\u5E93\u4F4D\u672A\u9501\u5B9A,\u8BF7\u68C0\u67E5!
|
||||
basic.storageBin.lock.yes=\u5F53\u524D\u5E93\u4F4D\u5DF2\u9501\u5B9A,\u8BF7\u68C0\u67E5!
|
||||
basic.storageBin.storageType.nonStorage=\u5F53\u524D\u5E93\u4F4D\u975E\u5B58\u50A8\u5E93\u4F4D,\u8BF7\u68C0\u67E5!
|
||||
basic.storageBin.storageType.nonJob=\u5F53\u524D\u5E93\u4F4D\u975E\u4F5C\u4E1A\u5E93\u4F4D,\u8BF7\u68C0\u67E5!
|
||||
basic.storageBin.storageType.nonShelves=\u5F53\u524D\u5E93\u4F4D\u975E\u4E0A\u67B6\u5E93\u4F4D,\u8BF7\u68C0\u67E5!
|
||||
basic.storageBin.storageType.nonTakenOffShelves=\u5F53\u524D\u5E93\u4F4D\u975E\u4E0B\u67B6\u5E93\u4F4D,\u8BF7\u68C0\u67E5!
|
||||
basic.storageBin.storageType.nonEmptyInteraction=\u5F53\u524D\u5E93\u4F4D\u975E\u7A7A\u8F66\u4EA4\u4E92\u5E93\u4F4D,\u8BF7\u68C0\u67E5!
|
||||
basic.storageBin.storageType.nonArticleInteraction=\u5F53\u524D\u5E93\u4F4D\u975E\u8D27\u7269\u4EA4\u4E92\u5E93\u4F4D,\u8BF7\u68C0\u67E5!
|
||||
basic.storageBin.choose.mistake=\u5E93\u4F4D\u9009\u62E9\u9519\u8BEF,\u8BF7\u68C0\u67E5!
|
||||
|
||||
basic.storageBin.container.dontMatch=\u5E93\u4F4D\u548C\u6258\u76D8\u4E0D\u5339\u914D,\u8BF7\u68C0\u67E5!
|
||||
|
||||
basic.storageBin.areaType.nonStorage=\u5F53\u524D\u5E93\u4F4D\u975E\u5B58\u50A8\u5E93\u533A\u5E93\u4F4D,\u8BF7\u68C0\u67E5!
|
||||
basic.storageBin.areaType.nonJob=\u5F53\u524D\u5E93\u4F4D\u975E\u4F5C\u4E1A\u533A\u5E93\u4F4D,\u8BF7\u68C0\u67E5!
|
||||
basic.storageBin.areaType.nonCache=\u5F53\u524D\u5E93\u4F4D\u975E\u7F13\u5B58\u533A\u5E93\u4F4D,\u8BF7\u68C0\u67E5!
|
||||
basic.storageBin.areaType.nonUnqualified=\u5F53\u524D\u5E93\u4F4D\u975E\u4E0D\u5408\u683C\u54C1\u533A\u5E93\u4F4D,\u8BF7\u68C0\u67E5!
|
||||
basic.storageBin.areaType.nonConnection=\u5F53\u524D\u5E93\u4F4D\u975E\u63A5\u9A73\u533A\u5E93\u4F4D,\u8BF7\u68C0\u67E5!
|
||||
|
||||
basic.storageBin.wareType.nonYL=\u5F53\u524D\u5E93\u4F4D\u975E\u539F\u6599\u5E93\u5E93\u4F4D,\u8BF7\u68C0\u67E5!
|
||||
basic.storageBin.wareType.nonCP=\u5F53\u524D\u5E93\u4F4D\u975E\u6210\u54C1\u5E93\u5E93\u4F4D,\u8BF7\u68C0\u67E5!
|
||||
basic.storageBin.wareType.nonJT=\u5F53\u524D\u5E93\u4F4D\u975E\u673A\u53F0\u5E93\u5E93\u4F4D,\u8BF7\u68C0\u67E5!
|
||||
basic.storageBin.wareType.nonWG=\u5F53\u524D\u5E93\u4F4D\u975E\u5B8C\u5DE5\u5E93\u5E93\u4F4D,\u8BF7\u68C0\u67E5!
|
||||
basic.storageBin.wareType.nonFC=\u5F53\u524D\u5E93\u4F4D\u975E\u5C01\u5B58\u5E93\u5E93\u4F4D,\u8BF7\u68C0\u67E5!
|
||||
|
||||
basic.storageBin.isNull=\u672A\u67E5\u8BE2\u5230\u53EF\u7528\u5E93\u4F4D,\u8BF7\u68C0\u67E5!
|
||||
basic.storageBin.to.isNull=\u672A\u67E5\u8BE2\u5230\u6765\u6E90\u5E93\u4F4D,\u8BF7\u68C0\u67E5!
|
||||
|
||||
basic.storageBin.recommend.non=\u5F53\u524D\u65E0\u7B26\u5408\u8981\u6C42\u7684\u63A8\u8350\u5E93\u4F4D,\u8BF7\u68C0\u67E5!
|
||||
basic.empty.shaft.non=\u5F53\u524D\u6CA1\u6709\u53EF\u7528\u7A7A\u8F74!
|
||||
|
||||
basic.article.ObjectIsNull=\u672A\u67E5\u8BE2\u5230\u7269\u6599\u4FE1\u606F,\u8BF7\u68C0\u67E5!
|
||||
|
||||
basic.billInfo.ObjectIsNull=\u672A\u67E5\u8BE2\u5230\u5165\u6570\u7968\u4FE1\u606F,\u8BF7\u68C0\u67E5!
|
||||
basic.billInfo.container.isBinding=\u5F53\u524D\u5165\u6570\u7968\u5DF2\u7ED1\u5B9A\u6258\u76D8,\u8BF7\u68C0\u67E5!
|
||||
basic.billInfo.container.dontMatch=\u5F53\u524D\u626B\u7801\u6258\u76D8\u975E\u7ED1\u5B9A\u6258\u76D8,\u8BF7\u68C0\u67E5!
|
||||
basic.billInfo.billId.non=\u5165\u6570\u7968\u5FC5\u586B,\u8BF7\u68C0\u67E5!
|
||||
|
||||
|
||||
basic.stock.ObjectIsNull=\u672A\u67E5\u8BE2\u5230\u5E93\u5B58\u4FE1\u606F,\u8BF7\u68C0\u67E5!
|
||||
basic.stock.checkStatus.nonUnqualified=\u5F53\u524D\u5E93\u5B58\u8D28\u68C0\u72B6\u6001\u975E\u4E0D\u5408\u683C\u72B6\u6001,\u8BF7\u68C0\u67E5!
|
||||
basic.stock.stockStatus.abnormal=\u5F53\u524D\u5E93\u5B58\u72B6\u6001\u975E\u6B63\u5E38\u72B6\u6001,\u8BF7\u68C0\u67E5!
|
||||
basic.stock.available.ObjectIsNull=\u672A\u67E5\u8BE2\u53EF\u7528\u5E93\u5B58\u4FE1\u606F,\u8BF7\u68C0\u67E5!
|
||||
basic.stock.checkStatus.unqualified=\u5F53\u524D\u5E93\u5B58\u672A\u8D28\u68C0\u5408\u683C,\u4E0D\u53EF\u91CD\u65B0\u5165\u5E93,\u8BF7\u68C0\u67E5!
|
||||
|
||||
|
||||
basic.material.IsNull=\u672A\u67E5\u8BE2\u5230\u7269\u6599\u7248\u9762,\u8BF7\u68C0\u67E5!
|
||||
|
||||
|
||||
##==================================================WCS\u6A21\u5757==================================================
|
||||
wcs.error.message.00001="AGV\u4EFB\u52A1\u53F7\u5DF2\u5B58\u5728,\u8BF7\u68C0\u67E5!"
|
||||
wcs.error.message.00002="AGV\u4EFB\u52A1\u63D2\u5165\u5931\u8D25,\u8BF7\u68C0\u67E5!"
|
||||
|
||||
##==================================================\u544A\u8B66\u6A21\u5757==================================================
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
@ -0,0 +1,82 @@
|
|||
##English message configuration file
|
||||
#Error message
|
||||
not.null=* Required field
|
||||
user.jcaptcha.error=Captcha error
|
||||
user.jcaptcha.expire=The verification code has expired
|
||||
user.not.exists=User does not exist/password is wrong
|
||||
user.password.not.match=User does not exist/password is wrong
|
||||
user.password.retry.limit.count=The password was entered incorrectly {0} times
|
||||
user.password.retry.limit.exceed=The password was entered incorrectly {0} times, and the account was locked out for {1} minutes
|
||||
user.password.delete=Sorry, your account has been deleted
|
||||
user.blocked=The user has been banned, contact the administrator
|
||||
role.blocked=The role has been banned, contact your administrator
|
||||
login.blocked=Unfortunately, access IPs have been blacklisted in the system
|
||||
user.logout.success=Exit successful
|
||||
length.not.valid=The length must be between {min} and {max} characters
|
||||
user.username.not.valid=* Consists of 2 to 20 kanji, letters, numbers, or underscores, and must start with a non-number
|
||||
user.password.not.valid=* 5-50 characters
|
||||
user.email.not.valid=The mailbox format is incorrect
|
||||
user.mobile.phone.number.not.valid=The phone number is in the wrong format
|
||||
user.login.success=Login successful
|
||||
user.register.success=Registration successful
|
||||
user.notfound=Please log in again
|
||||
user.forcelogout=The administrator forces you to log out, please log in again
|
||||
user.unknown.error=Unknown error, please log in again
|
||||
##File upload message
|
||||
upload.exceed.maxSize=The uploaded file size exceeds the file size limit! <br/>The maximum allowed file size is: {0}MB!
|
||||
upload.filename.exceed.length=The maximum file name for the upload is {0} characters
|
||||
##Permissions
|
||||
no.permission=You do not have permission for the data, contact your administrator to add the permission [{0}]
|
||||
no.create.permission=You do not have permission to create data, contact your administrator to add permissions [{0}]
|
||||
no.update.permission=You do not have permission to modify data, contact your administrator to add permissions [{0}]
|
||||
no.delete.permission=You do not have permission to delete data, contact your administrator to add permission [{0}]
|
||||
no.export.permission=You do not have permission to export data, contact your administrator to add permissions [{0}]
|
||||
no.view.permission=You do not have permission to view data, contact your administrator to add permissions [{0}]
|
||||
|
||||
##==================================================Basic archives==================================================
|
||||
basic.warehouse.primaryKeyConflict=The repository code already exists, please check!
|
||||
basic.warehouse.isNotAllowedToDelete=The warehouse has a library area file, and the deletion operation is not allowed!
|
||||
basic.wareArea.primaryKeyConflict=The library code already exists, please check!
|
||||
basic.storage.isNotAllowedToDelete=There are bin location files in the library area, and deletion operations are not allowed!
|
||||
basic.container.primaryKeyConflict=The trolley code already exists, please check!
|
||||
basic.article.primaryKeyConflict=The material code already exists, please check!
|
||||
basic.storageBin.primaryKeyConflict=Location code already exists, please check!
|
||||
basic.storageBin.ObjectIsNull=No location information queried, please check!
|
||||
basic.storageBin.inUsing.no=The current location is not enabled, please check!
|
||||
basic.storageBin.inUsing.yes=The current location is enabled, please check!
|
||||
basic.storageBin.storageStatus.nonFree=The current location is not empty, please check!
|
||||
basic.storageBin.storageStatus.nonInStorage=The current storage location is not in storage, please check!
|
||||
basic.storageBin.storageStatus.nonEmptyContainer=The current storage space is not an empty garage space, please check!
|
||||
basic.storageBin.lock.no=The current location is not locked, please check!
|
||||
basic.storageBin.lock.yes=The current location is locked, please check!
|
||||
basic.storageBin.storageType.nonStorage=The current location is not a repository location, please check!
|
||||
basic.storageBin.storageType.nonJob=The current location is not a job location, please check!
|
||||
basic.storageBin.storageType.nonEmptyInteraction=The current location is not an empty vehicle interactive location, please check!
|
||||
basic.storageBin.storageType.nonArticleInteraction=The current location is not a cargo interactive location, please check!
|
||||
basic.storageBin.choose.mistake=The location is selected incorrectly, please check!
|
||||
basic.storageBin.container.dontMatch=The location and trolley do not match, please check!
|
||||
basic.storageBin.areaType.nonStorage=The current location is not the repository location, please check!
|
||||
basic.storageBin.areaType.nonJob=The current location is not a manual interactive area location, please check!
|
||||
basic.storageBin.areaType.nonRejects=The current storage location is not a defective product area, please check!
|
||||
basic.storageBin.areaType.nonMachine=The current storage location is not the storage location of the machine area, please check!
|
||||
basic.storageBin.isNull=No available locations were queried, please check!
|
||||
basic.storageBin.to.isNull=The source location was not queried, please check!
|
||||
basic.storageBin.recommend.non=There are currently no recommended locations that meet the requirements, please check!
|
||||
basic.empty.shaft.non=There are currently no empty axes available!
|
||||
basic.article.ObjectIsNull=No material information queried, please check!
|
||||
basic.billInfo.ObjectIsNull=No inquiry can be found about the deposit vote, please check!
|
||||
basic.billInfo.container.isBinding=The current deposit ticket has been bound to the trolley, please check!
|
||||
basic.billInfo.container.dontMatch=The current code scanning trolley is not bound trolley, please check!
|
||||
basic.billInfo.billId.non=Deposit tickets are required, please check!
|
||||
basic.stock.ObjectIsNull=No inventory information found, please check!
|
||||
basic.stock.checkStatus.nonUnqualified=The current inventory quality inspection status is not unqualified, please check!
|
||||
basic.stock.stockStatus.abnormal=The current stock status is not normal, please check!
|
||||
basic.stock.available.ObjectIsNull=No available inventory information queried, please check!
|
||||
basic.stock.checkStatus.unqualified=The current inventory is not qualified for quality inspection and cannot be restocked, please check!
|
||||
basic.material.IsNull=No material layout queried, please check!
|
||||
|
||||
##==================================================alarm module==================================================
|
||||
|
||||
|
||||
|
||||
|
|
@ -0,0 +1,124 @@
|
|||
##\u9ED8\u8BA4\u6D88\u606F\u914D\u7F6E\u6587\u4EF6
|
||||
#\u9519\u8BEF\u6D88\u606F
|
||||
not.null=* \u5FC5\u987B\u586B\u5199
|
||||
user.jcaptcha.error=\u9A8C\u8BC1\u7801\u9519\u8BEF
|
||||
user.jcaptcha.expire=\u9A8C\u8BC1\u7801\u5DF2\u5931\u6548
|
||||
user.not.exists=\u7528\u6237\u4E0D\u5B58\u5728/\u5BC6\u7801\u9519\u8BEF
|
||||
user.password.not.match=\u7528\u6237\u4E0D\u5B58\u5728/\u5BC6\u7801\u9519\u8BEF
|
||||
user.password.retry.limit.count=\u5BC6\u7801\u8F93\u5165\u9519\u8BEF{0}\u6B21
|
||||
user.password.retry.limit.exceed=\u5BC6\u7801\u8F93\u5165\u9519\u8BEF{0}\u6B21\uFF0C\u5E10\u6237\u9501\u5B9A{1}\u5206\u949F
|
||||
user.password.delete=\u5BF9\u4E0D\u8D77\uFF0C\u60A8\u7684\u8D26\u53F7\u5DF2\u88AB\u5220\u9664
|
||||
user.blocked=\u7528\u6237\u5DF2\u5C01\u7981\uFF0C\u8BF7\u8054\u7CFB\u7BA1\u7406\u5458
|
||||
role.blocked=\u89D2\u8272\u5DF2\u5C01\u7981\uFF0C\u8BF7\u8054\u7CFB\u7BA1\u7406\u5458
|
||||
login.blocked=\u5F88\u9057\u61BE\uFF0C\u8BBF\u95EEIP\u5DF2\u88AB\u5217\u5165\u7CFB\u7EDF\u9ED1\u540D\u5355
|
||||
user.logout.success=\u9000\u51FA\u6210\u529F
|
||||
|
||||
length.not.valid=\u957F\u5EA6\u5FC5\u987B\u5728{min}\u5230{max}\u4E2A\u5B57\u7B26\u4E4B\u95F4
|
||||
|
||||
user.username.not.valid=* 2\u523020\u4E2A\u6C49\u5B57\u3001\u5B57\u6BCD\u3001\u6570\u5B57\u6216\u4E0B\u5212\u7EBF\u7EC4\u6210\uFF0C\u4E14\u5FC5\u987B\u4EE5\u975E\u6570\u5B57\u5F00\u5934
|
||||
user.password.not.valid=* 5-50\u4E2A\u5B57\u7B26
|
||||
|
||||
user.email.not.valid=\u90AE\u7BB1\u683C\u5F0F\u9519\u8BEF
|
||||
user.mobile.phone.number.not.valid=\u624B\u673A\u53F7\u683C\u5F0F\u9519\u8BEF
|
||||
user.login.success=\u767B\u5F55\u6210\u529F
|
||||
user.register.success=\u6CE8\u518C\u6210\u529F
|
||||
user.notfound=\u8BF7\u91CD\u65B0\u767B\u5F55
|
||||
user.forcelogout=\u7BA1\u7406\u5458\u5F3A\u5236\u9000\u51FA\uFF0C\u8BF7\u91CD\u65B0\u767B\u5F55
|
||||
user.unknown.error=\u672A\u77E5\u9519\u8BEF\uFF0C\u8BF7\u91CD\u65B0\u767B\u5F55
|
||||
|
||||
##\u6587\u4EF6\u4E0A\u4F20\u6D88\u606F
|
||||
upload.exceed.maxSize=\u4E0A\u4F20\u7684\u6587\u4EF6\u5927\u5C0F\u8D85\u51FA\u9650\u5236\u7684\u6587\u4EF6\u5927\u5C0F\uFF01<br/>\u5141\u8BB8\u7684\u6587\u4EF6\u6700\u5927\u5927\u5C0F\u662F\uFF1A{0}MB\uFF01
|
||||
upload.filename.exceed.length=\u4E0A\u4F20\u7684\u6587\u4EF6\u540D\u6700\u957F{0}\u4E2A\u5B57\u7B26
|
||||
|
||||
##\u6743\u9650
|
||||
no.permission=\u60A8\u6CA1\u6709\u6570\u636E\u7684\u6743\u9650\uFF0C\u8BF7\u8054\u7CFB\u7BA1\u7406\u5458\u6DFB\u52A0\u6743\u9650 [{0}]
|
||||
no.create.permission=\u60A8\u6CA1\u6709\u521B\u5EFA\u6570\u636E\u7684\u6743\u9650\uFF0C\u8BF7\u8054\u7CFB\u7BA1\u7406\u5458\u6DFB\u52A0\u6743\u9650 [{0}]
|
||||
no.update.permission=\u60A8\u6CA1\u6709\u4FEE\u6539\u6570\u636E\u7684\u6743\u9650\uFF0C\u8BF7\u8054\u7CFB\u7BA1\u7406\u5458\u6DFB\u52A0\u6743\u9650 [{0}]
|
||||
no.delete.permission=\u60A8\u6CA1\u6709\u5220\u9664\u6570\u636E\u7684\u6743\u9650\uFF0C\u8BF7\u8054\u7CFB\u7BA1\u7406\u5458\u6DFB\u52A0\u6743\u9650 [{0}]
|
||||
no.export.permission=\u60A8\u6CA1\u6709\u5BFC\u51FA\u6570\u636E\u7684\u6743\u9650\uFF0C\u8BF7\u8054\u7CFB\u7BA1\u7406\u5458\u6DFB\u52A0\u6743\u9650 [{0}]
|
||||
no.view.permission=\u60A8\u6CA1\u6709\u67E5\u770B\u6570\u636E\u7684\u6743\u9650\uFF0C\u8BF7\u8054\u7CFB\u7BA1\u7406\u5458\u6DFB\u52A0\u6743\u9650 [{0}]
|
||||
|
||||
##\u7CFB\u7EDF\u516C\u7528message
|
||||
sys.deliver.param.error=\u53C2\u6570\u4F20\u9012\u6709\u8BEF
|
||||
|
||||
##TableDataInfo
|
||||
table.data.info.msg=\u67E5\u8BE2\u6210\u529F
|
||||
table.data.error.msg=\u67E5\u8BE2\u5931\u8D25
|
||||
|
||||
operations.success=\u64CD\u4F5C\u6210\u529F
|
||||
operations.error=\u64CD\u4F5C\u5931\u8D25
|
||||
|
||||
##==================================================\u57FA\u7840\u6863\u6848==================================================
|
||||
sequence.success=\u4E1A\u52A1\u53F7\u83B7\u53D6\u6210\u529F
|
||||
sequence.error=\u4E1A\u52A1\u53F7\u83B7\u53D6\u5931\u8D25
|
||||
|
||||
basic.warehouse.primaryKeyConflict=\u4ED3\u5E93\u7F16\u7801\u5DF2\u5B58\u5728,\u8BF7\u68C0\u67E5!
|
||||
basic.warehouse.isNotAllowedToDelete=\u4ED3\u5E93\u5B58\u5728\u5E93\u533A\u6863\u6848,\u4E0D\u5141\u8BB8\u5220\u9664\u64CD\u4F5C!
|
||||
|
||||
basic.wareArea.primaryKeyConflict=\u5E93\u533A\u7F16\u7801\u5DF2\u5B58\u5728,\u8BF7\u68C0\u67E5!
|
||||
basic.storage.isNotAllowedToDelete=\u5E93\u533A\u5B58\u5728\u5E93\u4F4D\u6863\u6848,\u4E0D\u5141\u8BB8\u5220\u9664\u64CD\u4F5C!
|
||||
|
||||
basic.container.primaryKeyConflict=\u5bb9\u5668\u7f16\u7801\u5df2\u5b58\u5728\uff0c\u8bf7\u68c0\u67e5\uff01
|
||||
|
||||
basic.article.primaryKeyConflict=\u7269\u6599\u7F16\u7801\u5DF2\u5B58\u5728,\u8BF7\u68C0\u67E5!
|
||||
|
||||
basic.storageBin.primaryKeyConflict=\u5E93\u4F4D\u7F16\u7801\u5DF2\u5B58\u5728,\u8BF7\u68C0\u67E5!
|
||||
basic.storageBin.ObjectIsNull=\u672A\u67E5\u8BE2\u5230\u5E93\u4F4D\u4FE1\u606F,\u8BF7\u68C0\u67E5!
|
||||
basic.storageBin.inUsing.no=\u5F53\u524D\u5E93\u4F4D\u672A\u542F\u7528,\u8BF7\u68C0\u67E5!
|
||||
basic.storageBin.inUsing.yes=\u5F53\u524D\u5E93\u4F4D\u5DF2\u542F\u7528,\u8BF7\u68C0\u67E5!
|
||||
basic.storageBin.storageStatus.nonFree=\u5F53\u524D\u5E93\u4F4D\u975E\u7A7A\u5E93\u4F4D,\u8BF7\u68C0\u67E5!
|
||||
basic.storageBin.storageStatus.nonInStorage=\u5F53\u524D\u5E93\u4F4D\u975E\u50A8\u7269\u4E2D,\u8BF7\u68C0\u67E5!
|
||||
basic.storageBin.storageStatus.nonEmptyContainer=\u5F53\u524D\u5E93\u4F4D\u975E\u7A7A\u8F66\u5E93\u4F4D,\u8BF7\u68C0\u67E5!
|
||||
basic.storageBin.lock.no=\u5F53\u524D\u5E93\u4F4D\u672A\u9501\u5B9A,\u8BF7\u68C0\u67E5!
|
||||
basic.storageBin.lock.yes=\u5F53\u524D\u5E93\u4F4D\u5DF2\u9501\u5B9A,\u8BF7\u68C0\u67E5!
|
||||
basic.storageBin.storageType.nonStorage=\u5F53\u524D\u5E93\u4F4D\u975E\u5B58\u50A8\u5E93\u4F4D,\u8BF7\u68C0\u67E5!
|
||||
basic.storageBin.storageType.nonJob=\u5F53\u524D\u5E93\u4F4D\u975E\u4F5C\u4E1A\u5E93\u4F4D,\u8BF7\u68C0\u67E5!
|
||||
basic.storageBin.storageType.nonEmptyInteraction=\u5F53\u524D\u5E93\u4F4D\u975E\u7A7A\u8F66\u4EA4\u4E92\u5E93\u4F4D,\u8BF7\u68C0\u67E5!
|
||||
basic.storageBin.storageType.nonArticleInteraction=\u5F53\u524D\u5E93\u4F4D\u975E\u8D27\u7269\u4EA4\u4E92\u5E93\u4F4D,\u8BF7\u68C0\u67E5!
|
||||
basic.storageBin.choose.mistake=\u5E93\u4F4D\u9009\u62E9\u9519\u8BEF,\u8BF7\u68C0\u67E5!
|
||||
|
||||
basic.storageBin.container.dontMatch=\u5E93\u4F4D\u548C\u6258\u76D8\u4E0D\u5339\u914D,\u8BF7\u68C0\u67E5!
|
||||
|
||||
basic.storageBin.areaType.nonStorage=\u5F53\u524D\u5E93\u4F4D\u975E\u5B58\u50A8\u5E93\u533A\u5E93\u4F4D,\u8BF7\u68C0\u67E5!
|
||||
basic.storageBin.areaType.nonJob=\u5F53\u524D\u5E93\u4F4D\u975E\u4EBA\u5DE5\u4EA4\u4E92\u533A\u5E93\u4F4D,\u8BF7\u68C0\u67E5!
|
||||
basic.storageBin.areaType.nonRejects=\u5F53\u524D\u5E93\u4F4D\u975E\u4E0D\u826F\u54C1\u533A\u5E93\u4F4D,\u8BF7\u68C0\u67E5!
|
||||
basic.storageBin.areaType.nonMachine=\u5F53\u524D\u5E93\u4F4D\u975E\u673A\u53F0\u533A\u5E93\u4F4D,\u8BF7\u68C0\u67E5!
|
||||
basic.storageBin.isNull=\u672A\u67E5\u8BE2\u5230\u53EF\u7528\u5E93\u4F4D,\u8BF7\u68C0\u67E5!
|
||||
basic.storageBin.to.isNull=\u672A\u67E5\u8BE2\u5230\u6765\u6E90\u5E93\u4F4D,\u8BF7\u68C0\u67E5!
|
||||
|
||||
basic.storageBin.recommend.non=\u5F53\u524D\u65E0\u7B26\u5408\u8981\u6C42\u7684\u63A8\u8350\u5E93\u4F4D,\u8BF7\u68C0\u67E5!
|
||||
basic.empty.shaft.non=\u5F53\u524D\u6CA1\u6709\u53EF\u7528\u7A7A\u8F74!
|
||||
|
||||
basic.article.ObjectIsNull=\u672A\u67E5\u8BE2\u5230\u7269\u6599\u4FE1\u606F,\u8BF7\u68C0\u67E5!
|
||||
|
||||
basic.billInfo.ObjectIsNull=\u672A\u67E5\u8BE2\u5230\u5165\u6570\u7968\u4FE1\u606F,\u8BF7\u68C0\u67E5!
|
||||
basic.billInfo.container.isBinding=\u5F53\u524D\u5165\u6570\u7968\u5DF2\u7ED1\u5B9A\u6258\u76D8,\u8BF7\u68C0\u67E5!
|
||||
basic.billInfo.container.dontMatch=\u5F53\u524D\u626B\u7801\u6258\u76D8\u975E\u7ED1\u5B9A\u6258\u76D8,\u8BF7\u68C0\u67E5!
|
||||
basic.billInfo.billId.non=\u5165\u6570\u7968\u5FC5\u586B,\u8BF7\u68C0\u67E5!
|
||||
|
||||
|
||||
basic.stock.ObjectIsNull=\u672A\u67E5\u8BE2\u5230\u5E93\u5B58\u4FE1\u606F,\u8BF7\u68C0\u67E5!
|
||||
basic.stock.checkStatus.nonUnqualified=\u5F53\u524D\u5E93\u5B58\u8D28\u68C0\u72B6\u6001\u975E\u4E0D\u5408\u683C\u72B6\u6001,\u8BF7\u68C0\u67E5!
|
||||
basic.stock.stockStatus.abnormal=\u5F53\u524D\u5E93\u5B58\u72B6\u6001\u975E\u6B63\u5E38\u72B6\u6001,\u8BF7\u68C0\u67E5!
|
||||
basic.stock.available.ObjectIsNull=\u672A\u67E5\u8BE2\u53EF\u7528\u5E93\u5B58\u4FE1\u606F,\u8BF7\u68C0\u67E5!
|
||||
basic.stock.checkStatus.unqualified=\u5F53\u524D\u5E93\u5B58\u672A\u8D28\u68C0\u5408\u683C,\u4E0D\u53EF\u91CD\u65B0\u5165\u5E93,\u8BF7\u68C0\u67E5!
|
||||
|
||||
|
||||
basic.material.IsNull=\u672A\u67E5\u8BE2\u5230\u7269\u6599\u7248\u9762,\u8BF7\u68C0\u67E5!
|
||||
|
||||
|
||||
##==================================================WCS\u6A21\u5757==================================================
|
||||
wcs.error.message.00001="AGV\u4EFB\u52A1\u53F7\u5DF2\u5B58\u5728,\u8BF7\u68C0\u67E5!"
|
||||
wcs.error.message.00002="AGV\u4EFB\u52A1\u63D2\u5165\u5931\u8D25,\u8BF7\u68C0\u67E5!"
|
||||
|
||||
##==================================================\u544A\u8B66\u6A21\u5757==================================================
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
@ -0,0 +1,94 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<configuration>
|
||||
<!-- 日志存放路径 -->
|
||||
<!-- <property name="log.path" value="/home/wms/logs" />-->
|
||||
<property name="log.path" value="D:/wms/logs" />
|
||||
<!-- 日志输出格式 -->
|
||||
<property name="log.pattern" value="%d{HH:mm:ss.SSS} [%thread] %-5level %logger{20} - [%method,%line] - %msg%n" />
|
||||
|
||||
<!-- 控制台输出 -->
|
||||
<appender name="console" class="ch.qos.logback.core.ConsoleAppender">
|
||||
<encoder>
|
||||
<pattern>${log.pattern}</pattern>
|
||||
</encoder>
|
||||
</appender>
|
||||
|
||||
<!-- 系统日志输出 -->
|
||||
<appender name="file_info" class="ch.qos.logback.core.rolling.RollingFileAppender">
|
||||
<file>${log.path}/sys-info.log</file>
|
||||
<!-- 循环政策:基于时间创建日志文件 -->
|
||||
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
|
||||
<!-- 日志文件名格式 -->
|
||||
<fileNamePattern>${log.path}/sys-info.%d{yyyy-MM-dd.HH}.log</fileNamePattern>
|
||||
<!-- 如果当前是按小时保存,则保存240小时(=10天)内的日志 -->
|
||||
<maxHistory>240</maxHistory>
|
||||
</rollingPolicy>
|
||||
<encoder>
|
||||
<pattern>${log.pattern}</pattern>
|
||||
</encoder>
|
||||
<filter class="ch.qos.logback.classic.filter.LevelFilter">
|
||||
<!-- 过滤的级别 -->
|
||||
<level>INFO</level>
|
||||
<!-- 匹配时的操作:接收(记录) -->
|
||||
<onMatch>ACCEPT</onMatch>
|
||||
<!-- 不匹配时的操作:拒绝(不记录) -->
|
||||
<onMismatch>DENY</onMismatch>
|
||||
</filter>
|
||||
</appender>
|
||||
|
||||
<appender name="file_error" class="ch.qos.logback.core.rolling.RollingFileAppender">
|
||||
<file>${log.path}/sys-error.log</file>
|
||||
<!-- 循环政策:基于时间创建日志文件 -->
|
||||
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
|
||||
<!-- 日志文件名格式 -->
|
||||
<fileNamePattern>${log.path}/sys-error.%d{yyyy-MM-dd.HH}.log</fileNamePattern>
|
||||
<!-- 如果当前是按小时保存,则保存240小时(=10天)内的日志 -->
|
||||
<maxHistory>240</maxHistory>
|
||||
</rollingPolicy>
|
||||
<encoder>
|
||||
<pattern>${log.pattern}</pattern>
|
||||
</encoder>
|
||||
<filter class="ch.qos.logback.classic.filter.LevelFilter">
|
||||
<!-- 过滤的级别 -->
|
||||
<level>ERROR</level>
|
||||
<!-- 匹配时的操作:接收(记录) -->
|
||||
<onMatch>ACCEPT</onMatch>
|
||||
<!-- 不匹配时的操作:拒绝(不记录) -->
|
||||
<onMismatch>DENY</onMismatch>
|
||||
</filter>
|
||||
</appender>
|
||||
|
||||
<!-- 用户访问日志输出 -->
|
||||
<appender name="sys-user" class="ch.qos.logback.core.rolling.RollingFileAppender">
|
||||
<file>${log.path}/sys-user.log</file>
|
||||
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
|
||||
<!-- 按天回滚 daily -->
|
||||
<fileNamePattern>${log.path}/sys-user.%d{yyyy-MM-dd.HH}.log</fileNamePattern>
|
||||
<!-- 如果当前是按小时保存,则保存240小时(=10天)内的日志 -->
|
||||
<maxHistory>240</maxHistory>
|
||||
</rollingPolicy>
|
||||
<encoder>
|
||||
<pattern>${log.pattern}</pattern>
|
||||
</encoder>
|
||||
</appender>
|
||||
|
||||
<!-- 系统模块日志级别控制 -->
|
||||
<logger name="com.wms" level="info" />
|
||||
<!-- Spring日志级别控制 -->
|
||||
<logger name="org.springframework" level="warn" />
|
||||
|
||||
<root level="info">
|
||||
<appender-ref ref="console" />
|
||||
</root>
|
||||
|
||||
<!--系统操作日志-->
|
||||
<root level="info">
|
||||
<appender-ref ref="file_info" />
|
||||
<appender-ref ref="file_error" />
|
||||
</root>
|
||||
|
||||
<!--系统用户操作日志-->
|
||||
<logger name="sys-user" level="info">
|
||||
<appender-ref ref="sys-user"/>
|
||||
</logger>
|
||||
</configuration>
|
|
@ -0,0 +1,20 @@
|
|||
<?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"/>
|
||||
<!-- 允许JDBC 支持自动生成主键 -->
|
||||
<setting name="useGeneratedKeys" value="true"/>
|
||||
<!-- 配置默认的执行器.SIMPLE就是普通执行器;REUSE执行器会重用预处理语句(prepared statements);BATCH执行器将重用语句并执行批量更新 -->
|
||||
<setting name="defaultExecutorType" value="SIMPLE"/>
|
||||
<!-- 指定 MyBatis 所用日志的具体实现 -->
|
||||
<setting name="logImpl" value="SLF4J"/>
|
||||
<!-- 使用驼峰命名法转换字段 -->
|
||||
<!-- <setting name="mapUnderscoreToCamelCase" value="true"/> -->
|
||||
</settings>
|
||||
|
||||
</configuration>
|
Binary file not shown.
|
@ -0,0 +1,48 @@
|
|||
package com.wms.alarm;
|
||||
|
||||
import com.wms.WmsApplication;
|
||||
import com.wms.alarm.domain.dto.DirectReportAlarmDto;
|
||||
import com.wms.alarm.service.ITbAlarmRealtimeService;
|
||||
import com.wms.common.utils.DateUtils;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.springframework.boot.test.context.SpringBootTest;
|
||||
import org.springframework.test.context.junit4.SpringRunner;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* @author qzx
|
||||
* @Classname AlarmRealtimeServiceTest
|
||||
* @Description 实时告警上报接口 测试类
|
||||
* @Date 2024/3/20 14:40
|
||||
*/
|
||||
@SpringBootTest(classes = WmsApplication.class)
|
||||
@RunWith(SpringRunner.class)
|
||||
public class AlarmRealtimeServiceTest {
|
||||
@Resource
|
||||
private ITbAlarmRealtimeService alarmRealtimeService;
|
||||
|
||||
/**
|
||||
* 直接上报的告警
|
||||
*
|
||||
*/
|
||||
@Test
|
||||
public void directReportAlarmTest() {
|
||||
alarmRealtimeService.directReportAlarm(DirectReportAlarmDto.builder()
|
||||
.alarmValue(new BigDecimal("100"))
|
||||
.alarmTime(DateUtils.getNowDate())
|
||||
.alarmWords("alarmWords")
|
||||
.alarmLevel("alarmLevel")
|
||||
.alarmLevelName("alarmLevelName")
|
||||
.alarmSourceCode("alarmSourceCode")
|
||||
.alarmSourceName("alarmSourceName")
|
||||
.alarmTypeCode("alarmTypeCode2")
|
||||
.alarmTypeName("alarmTypeName")
|
||||
.alarmConfigCode("alarmConfigCode")
|
||||
.alarmConfigName("alarmConfigName")
|
||||
.isShowBigScreen("Y").build());
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,42 @@
|
|||
package com.wms.recommend;
|
||||
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
|
||||
import com.wms.WmsApplication;
|
||||
import com.wms.basic.domain.TbStorageBin;
|
||||
import com.wms.basic.domain.TbWarehouseStock;
|
||||
import com.wms.basic.mapper.TbStorageBinMapper;
|
||||
import com.wms.common.enums.basic.EnumLock;
|
||||
import com.wms.recommend.service.RecommendService;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.springframework.boot.test.context.SpringBootTest;
|
||||
import org.springframework.test.context.junit4.SpringRunner;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
@SpringBootTest(classes = WmsApplication.class)
|
||||
@RunWith(SpringRunner.class)
|
||||
public class RecommendServiceTest {
|
||||
@Resource
|
||||
private RecommendService recommendService;
|
||||
@Resource
|
||||
private TbStorageBinMapper storageBinMapper;
|
||||
|
||||
|
||||
@Test
|
||||
public void testDemo() {
|
||||
int num = 5;
|
||||
for (int i = 0; i < num; i++) {
|
||||
final TbWarehouseStock tbStorageBin = recommendService.recommendStorageBinByArticleId("策略编码", "物料编码");
|
||||
System.out.println("==============================推荐的库位号:" + tbStorageBin.getStorageBinId());
|
||||
//推荐完锁定库位
|
||||
storageBinMapper.update(new TbStorageBin(), new UpdateWrapper<TbStorageBin>()
|
||||
.eq("storage_bin_id", tbStorageBin.getStorageBinId())
|
||||
.set("manual_locked", EnumLock.YES.getCode()));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
|
@ -0,0 +1,33 @@
|
|||
<?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>Wms</artifactId>
|
||||
<groupId>com.wms</groupId>
|
||||
<version>1.0.0</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<artifactId>wms-alarm</artifactId>
|
||||
|
||||
<description>
|
||||
alarm告警模块
|
||||
</description>
|
||||
|
||||
<properties>
|
||||
<maven.compiler.source>8</maven.compiler.source>
|
||||
<maven.compiler.target>8</maven.compiler.target>
|
||||
</properties>
|
||||
|
||||
<dependencies>
|
||||
|
||||
<!-- 通用工具-->
|
||||
<dependency>
|
||||
<groupId>com.wms</groupId>
|
||||
<artifactId>wms-common</artifactId>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
|
||||
</project>
|
|
@ -0,0 +1,143 @@
|
|||
package com.wms.alarm.controller;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
import com.wms.alarm.domain.TbAlarmSource;
|
||||
import com.wms.alarm.service.ITbAlarmSourceService;
|
||||
import com.wms.common.annotation.Log;
|
||||
import com.wms.common.core.controller.BaseController;
|
||||
import com.wms.common.core.domain.AjaxResult;
|
||||
import com.wms.common.enums.BusinessType;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import io.swagger.annotations.ApiParam;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.PutMapping;
|
||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.wms.alarm.domain.TbAlarmCode;
|
||||
import com.wms.alarm.service.ITbAlarmCodeService;
|
||||
import com.wms.common.utils.poi.ExcelUtil;
|
||||
import com.wms.common.core.page.TableDataInfo;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
/**
|
||||
* 告警码配置Controller
|
||||
*
|
||||
* @author wms
|
||||
* @date 2023-10-10
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/alarm/alarmCode")
|
||||
@Api(value = "告警码配置控制器", tags = {"告警码配置管理"})
|
||||
@RequiredArgsConstructor(onConstructor_ = @Autowired)
|
||||
public class TbAlarmCodeController extends BaseController {
|
||||
|
||||
private final ITbAlarmCodeService tbAlarmCodeService;
|
||||
private final ITbAlarmSourceService tbAlarmSourceService;
|
||||
|
||||
|
||||
/**
|
||||
* 查询告警码配置列表
|
||||
*/
|
||||
@ApiOperation("查询告警码配置列表")
|
||||
@PreAuthorize("@ss.hasPermi('alarm:alarmCode:list')")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(TbAlarmCode tbAlarmCode) {
|
||||
startPage();
|
||||
List<TbAlarmCode> list = tbAlarmCodeService.list(new QueryWrapper<TbAlarmCode>(tbAlarmCode));
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出告警码配置列表
|
||||
*/
|
||||
@ApiOperation("导出告警码配置列表")
|
||||
@PreAuthorize("@ss.hasPermi('alarm:alarmCode:export')")
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, TbAlarmCode tbAlarmCode) {
|
||||
List<TbAlarmCode> list = tbAlarmCodeService.list(new QueryWrapper<TbAlarmCode>(tbAlarmCode));
|
||||
ExcelUtil<TbAlarmCode> util = new ExcelUtil<TbAlarmCode>(TbAlarmCode.class);
|
||||
util.exportExcel(response, list, "告警码配置数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取告警码配置详细信息
|
||||
*/
|
||||
@ApiOperation("获取告警码配置详细信息")
|
||||
@PreAuthorize("@ss.hasPermi('alarm:alarmCode:query')")
|
||||
@GetMapping(value = "/{alarmCode}")
|
||||
public AjaxResult getInfo(@ApiParam(value = "主键", required = true) @PathVariable("alarmCode") String alarmCode) {
|
||||
return AjaxResult.success(tbAlarmCodeService.getById(alarmCode));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增告警码配置
|
||||
*/
|
||||
@ApiOperation("新增告警码配置")
|
||||
@PreAuthorize("@ss.hasPermi('alarm:alarmCode:add')")
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody TbAlarmCode tbAlarmCode) {
|
||||
return toAjax(tbAlarmCodeService.save(tbAlarmCode));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改告警码配置
|
||||
*/
|
||||
@ApiOperation("修改告警码配置")
|
||||
@PreAuthorize("@ss.hasPermi('alarm:alarmCode:edit')")
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody TbAlarmCode tbAlarmCode) {
|
||||
return toAjax(tbAlarmCodeService.updateById(tbAlarmCode));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除告警码配置
|
||||
*/
|
||||
@ApiOperation("删除告警码配置")
|
||||
@PreAuthorize("@ss.hasPermi('alarm:alarmCode:remove')")
|
||||
@DeleteMapping("/{alarmCodes}")
|
||||
public AjaxResult remove(@ApiParam(value = "主键数组", required = true) @PathVariable String[] alarmCodes) {
|
||||
return toAjax(tbAlarmCodeService.removeByIds(Arrays.asList(alarmCodes)));
|
||||
}
|
||||
|
||||
@PostMapping("/listAlarmCodeByAlarmSourceCode")
|
||||
public AjaxResult listAlarmCodeByAlarmSourceCode(@RequestBody TbAlarmSource alarmSource) {
|
||||
AjaxResult ajax = AjaxResult.success();
|
||||
TbAlarmSource tbAlarmSource = tbAlarmSourceService.getOne(new QueryWrapper<TbAlarmSource>().eq("alarm_source_code",alarmSource.getAlarmSourceCode()));
|
||||
//根据userId和productModel 获取拥有的操作模块许可
|
||||
TbAlarmCode tbAlarmCode = new TbAlarmCode();
|
||||
tbAlarmCode.setAlarmSourceCode(alarmSource.getAlarmSourceCode());
|
||||
startPage();
|
||||
List<TbAlarmCode> list = tbAlarmCodeService.list(new QueryWrapper<TbAlarmCode>(tbAlarmCode));
|
||||
final TableDataInfo dataTable = getDataTable(list);
|
||||
ajax.put("alarmSource", tbAlarmSource);
|
||||
ajax.put("dataTable", dataTable);
|
||||
return ajax;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@ApiOperation("告警源+告警码 级联下拉选")
|
||||
@GetMapping("getAlarmCodeCascaderSelect")
|
||||
public AjaxResult getAlarmCodeCascaderSelect() {
|
||||
return tbAlarmCodeService.getAlarmCodeCascaderSelect();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
|
@ -0,0 +1,116 @@
|
|||
package com.wms.alarm.controller;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.wms.alarm.domain.TbAlarmHistory;
|
||||
import com.wms.alarm.domain.param.EliminateAlarmParam;
|
||||
import com.wms.alarm.service.ITbAlarmHistoryService;
|
||||
import com.wms.common.annotation.Log;
|
||||
import com.wms.common.core.controller.BaseController;
|
||||
import com.wms.common.core.domain.AjaxResult;
|
||||
import com.wms.common.core.page.TableDataInfo;
|
||||
import com.wms.common.enums.BusinessType;
|
||||
import com.wms.common.enums.alarm.EnumIsDisarmType;
|
||||
import com.wms.common.utils.DateUtils;
|
||||
import com.wms.common.utils.poi.ExcelUtil;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import io.swagger.annotations.ApiParam;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 告警历史Controller
|
||||
*
|
||||
* @author wms
|
||||
* @date 2023-06-06
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/alarm/alarmHistory")
|
||||
@Api(value = "告警历史控制器", tags = {"告警历史管理"})
|
||||
@RequiredArgsConstructor(onConstructor_ = @Autowired)
|
||||
public class TbAlarmHistoryController extends BaseController {
|
||||
|
||||
private final ITbAlarmHistoryService tbAlarmHistoryService;
|
||||
|
||||
/**
|
||||
* 查询告警历史列表
|
||||
*/
|
||||
@ApiOperation("查询告警历史列表")
|
||||
@PreAuthorize("@ss.hasPermi('alarm:alarmHistory:list')")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(TbAlarmHistory tbAlarmHistory) {
|
||||
startPage();
|
||||
List<TbAlarmHistory> list = tbAlarmHistoryService.list(new QueryWrapper<TbAlarmHistory>(tbAlarmHistory));
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出告警历史列表
|
||||
*/
|
||||
@ApiOperation("导出告警历史列表")
|
||||
@PreAuthorize("@ss.hasPermi('alarm:alarmHistory:export')")
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, TbAlarmHistory tbAlarmHistory) {
|
||||
List<TbAlarmHistory> list = tbAlarmHistoryService.list(new QueryWrapper<TbAlarmHistory>(tbAlarmHistory));
|
||||
ExcelUtil<TbAlarmHistory> util = new ExcelUtil<TbAlarmHistory>(TbAlarmHistory.class);
|
||||
util.exportExcel(response, list, "告警历史数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取告警历史详细信息
|
||||
*/
|
||||
@ApiOperation("获取告警历史详细信息")
|
||||
@PreAuthorize("@ss.hasPermi('alarm:alarmHistory:query')")
|
||||
@GetMapping(value = "/{id}")
|
||||
public AjaxResult getInfo(@ApiParam(value = "主键", required = true) @PathVariable("id") String id) {
|
||||
return AjaxResult.success(tbAlarmHistoryService.getById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增告警历史
|
||||
*/
|
||||
@ApiOperation("新增告警历史")
|
||||
@PreAuthorize("@ss.hasPermi('alarm:alarmHistory:add')")
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody TbAlarmHistory tbAlarmHistory) {
|
||||
tbAlarmHistory.setCreateTime(DateUtils.getNowDate());
|
||||
return toAjax(tbAlarmHistoryService.save(tbAlarmHistory));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改告警历史
|
||||
*/
|
||||
@ApiOperation("修改告警历史")
|
||||
@PreAuthorize("@ss.hasPermi('alarm:alarmHistory:edit')")
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody TbAlarmHistory tbAlarmHistory) {
|
||||
tbAlarmHistory.setUpdateTime(DateUtils.getNowDate());
|
||||
return toAjax(tbAlarmHistoryService.updateById(tbAlarmHistory));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除告警历史
|
||||
*/
|
||||
@ApiOperation("删除告警历史")
|
||||
@PreAuthorize("@ss.hasPermi('alarm:alarmHistory:remove')")
|
||||
@DeleteMapping("/{ids}")
|
||||
public AjaxResult remove(@ApiParam(value = "主键数组", required = true) @PathVariable String[] ids) {
|
||||
return toAjax(tbAlarmHistoryService.removeByIds(Arrays.asList(ids)));
|
||||
}
|
||||
|
||||
/**
|
||||
* 告警消除
|
||||
*/
|
||||
@ApiOperation("告警消除")
|
||||
@PostMapping("eliminateAlarm")
|
||||
public AjaxResult eliminateAlarm(@RequestBody EliminateAlarmParam param) {
|
||||
return tbAlarmHistoryService.eliminateAlarm(EnumIsDisarmType.TWO.getCode(),param);
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,104 @@
|
|||
package com.wms.alarm.controller;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.wms.alarm.domain.TbAlarmRealtime;
|
||||
import com.wms.alarm.service.ITbAlarmRealtimeService;
|
||||
import com.wms.common.annotation.Log;
|
||||
import com.wms.common.core.controller.BaseController;
|
||||
import com.wms.common.core.domain.AjaxResult;
|
||||
import com.wms.common.core.page.TableDataInfo;
|
||||
import com.wms.common.enums.BusinessType;
|
||||
import com.wms.common.utils.DateUtils;
|
||||
import com.wms.common.utils.poi.ExcelUtil;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import io.swagger.annotations.ApiParam;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 实时告警Controller
|
||||
*
|
||||
* @author wms
|
||||
* @date 2023-06-06
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/alarm/alarmRealtime")
|
||||
@Api(value = "实时告警控制器", tags = {"实时告警管理"})
|
||||
@RequiredArgsConstructor(onConstructor_ = @Autowired)
|
||||
public class TbAlarmRealtimeController extends BaseController {
|
||||
|
||||
private final ITbAlarmRealtimeService tbAlarmRealtimeService;
|
||||
|
||||
/**
|
||||
* 查询实时告警列表
|
||||
*/
|
||||
@ApiOperation("查询实时告警列表")
|
||||
@PreAuthorize("@ss.hasPermi('alarm:alarmRealtime:list')")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(TbAlarmRealtime tbAlarmRealtime) {
|
||||
startPage();
|
||||
List<TbAlarmRealtime> list = tbAlarmRealtimeService.list(new QueryWrapper<TbAlarmRealtime>(tbAlarmRealtime));
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出实时告警列表
|
||||
*/
|
||||
@ApiOperation("导出实时告警列表")
|
||||
@PreAuthorize("@ss.hasPermi('alarm:alarmRealtime:export')")
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, TbAlarmRealtime tbAlarmRealtime) {
|
||||
List<TbAlarmRealtime> list = tbAlarmRealtimeService.list(new QueryWrapper<TbAlarmRealtime>(tbAlarmRealtime));
|
||||
ExcelUtil<TbAlarmRealtime> util = new ExcelUtil<TbAlarmRealtime>(TbAlarmRealtime.class);
|
||||
util.exportExcel(response, list, "实时告警数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取实时告警详细信息
|
||||
*/
|
||||
@ApiOperation("获取实时告警详细信息")
|
||||
@PreAuthorize("@ss.hasPermi('alarm:alarmRealtime:query')")
|
||||
@GetMapping(value = "/{id}")
|
||||
public AjaxResult getInfo(@ApiParam(value = "主键", required = true) @PathVariable("id") String id) {
|
||||
return AjaxResult.success(tbAlarmRealtimeService.getById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增实时告警
|
||||
*/
|
||||
@ApiOperation("新增实时告警")
|
||||
@PreAuthorize("@ss.hasPermi('alarm:alarmRealtime:add')")
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody TbAlarmRealtime tbAlarmRealtime) {
|
||||
tbAlarmRealtime.setCreateTime(DateUtils.getNowDate());
|
||||
return toAjax(tbAlarmRealtimeService.save(tbAlarmRealtime));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改实时告警
|
||||
*/
|
||||
@ApiOperation("修改实时告警")
|
||||
@PreAuthorize("@ss.hasPermi('alarm:alarmRealtime:edit')")
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody TbAlarmRealtime tbAlarmRealtime) {
|
||||
tbAlarmRealtime.setUpdateTime(DateUtils.getNowDate());
|
||||
return toAjax(tbAlarmRealtimeService.updateById(tbAlarmRealtime));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除实时告警
|
||||
*/
|
||||
@ApiOperation("删除实时告警")
|
||||
@PreAuthorize("@ss.hasPermi('alarm:alarmRealtime:remove')")
|
||||
@DeleteMapping("/{ids}")
|
||||
public AjaxResult remove(@ApiParam(value = "主键数组", required = true) @PathVariable String[] ids) {
|
||||
return toAjax(tbAlarmRealtimeService.removeByIds(Arrays.asList(ids)));
|
||||
}
|
||||
}
|
|
@ -0,0 +1,117 @@
|
|||
package com.wms.alarm.controller;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.wms.alarm.domain.TbAlarmSource;
|
||||
import com.wms.alarm.service.ITbAlarmSourceService;
|
||||
import com.wms.common.annotation.Log;
|
||||
import com.wms.common.core.controller.BaseController;
|
||||
import com.wms.common.core.domain.AjaxResult;
|
||||
import com.wms.common.core.page.TableDataInfo;
|
||||
import com.wms.common.enums.BusinessType;
|
||||
import com.wms.common.utils.DateUtils;
|
||||
import com.wms.common.utils.poi.ExcelUtil;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import io.swagger.annotations.ApiParam;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 告警源Controller
|
||||
*
|
||||
* @author wms
|
||||
* @date 2023-06-06
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/alarm/alarmSource")
|
||||
@Api(value = "告警源控制器", tags = {"告警源管理"})
|
||||
@RequiredArgsConstructor(onConstructor_ = @Autowired)
|
||||
public class TbAlarmSourceController extends BaseController {
|
||||
|
||||
private final ITbAlarmSourceService tbAlarmSourceService;
|
||||
|
||||
/**
|
||||
* 查询告警源列表
|
||||
*/
|
||||
@ApiOperation("查询告警源列表")
|
||||
@PreAuthorize("@ss.hasPermi('alarm:alarmSource:list')")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(TbAlarmSource tbAlarmSource) {
|
||||
startPage();
|
||||
QueryWrapper<TbAlarmSource> tbAlarmSourceQueryWrapper = new QueryWrapper<>(tbAlarmSource);
|
||||
tbAlarmSourceQueryWrapper.orderByDesc("create_time");
|
||||
List<TbAlarmSource> list = tbAlarmSourceService.list(tbAlarmSourceQueryWrapper);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出告警源列表
|
||||
*/
|
||||
@ApiOperation("导出告警源列表")
|
||||
@PreAuthorize("@ss.hasPermi('alarm:alarmSource:export')")
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, TbAlarmSource tbAlarmSource) {
|
||||
List<TbAlarmSource> list = tbAlarmSourceService.list(new QueryWrapper<TbAlarmSource>(tbAlarmSource));
|
||||
ExcelUtil<TbAlarmSource> util = new ExcelUtil<TbAlarmSource>(TbAlarmSource.class);
|
||||
util.exportExcel(response, list, "告警源数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取告警源详细信息
|
||||
*/
|
||||
@ApiOperation("获取告警源详细信息")
|
||||
@PreAuthorize("@ss.hasPermi('alarm:alarmSource:query')")
|
||||
@GetMapping(value = "getInfo/{alarmSourceCode}")
|
||||
public AjaxResult getInfo(@ApiParam(value = "主键", required = true) @PathVariable("alarmSourceCode") String alarmSourceCode) {
|
||||
return AjaxResult.success(tbAlarmSourceService.getById(alarmSourceCode));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增告警源
|
||||
*/
|
||||
@ApiOperation("新增告警源")
|
||||
@PreAuthorize("@ss.hasPermi('alarm:alarmSource:add')")
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody TbAlarmSource tbAlarmSource) {
|
||||
tbAlarmSource.setCreateTime(DateUtils.getNowDate());
|
||||
return toAjax(tbAlarmSourceService.save(tbAlarmSource));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改告警源
|
||||
*/
|
||||
@ApiOperation("修改告警源")
|
||||
@PreAuthorize("@ss.hasPermi('alarm:alarmSource:edit')")
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody TbAlarmSource tbAlarmSource) {
|
||||
tbAlarmSource.setUpdateTime(DateUtils.getNowDate());
|
||||
return toAjax(tbAlarmSourceService.updateById(tbAlarmSource));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除告警源
|
||||
*/
|
||||
@ApiOperation("删除告警源")
|
||||
@PreAuthorize("@ss.hasPermi('alarm:alarmSource:remove')")
|
||||
@DeleteMapping("/{alarmSourceCodes}")
|
||||
public AjaxResult remove(@ApiParam(value = "主键数组", required = true) @PathVariable String[] alarmSourceCodes) {
|
||||
return toAjax(tbAlarmSourceService.removeByIds(Arrays.asList(alarmSourceCodes)));
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@ApiOperation("告警源 下拉选")
|
||||
@GetMapping("getAlarmSourceSelect")
|
||||
public AjaxResult getAlarmSourceSelect() {
|
||||
final List<TbAlarmSource> list = tbAlarmSourceService.list(new LambdaQueryWrapper<TbAlarmSource>().orderByDesc(TbAlarmSource::getCreateTime));
|
||||
return AjaxResult.success(list);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,139 @@
|
|||
package com.wms.alarm.controller;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.wms.alarm.domain.TbAlarmStockConfig;
|
||||
import com.wms.alarm.domain.param.ArticleStockAlarmConfig;
|
||||
import com.wms.alarm.domain.vo.TbAlarmStockConfigVo;
|
||||
import com.wms.alarm.service.ITbAlarmStockConfigService;
|
||||
import com.wms.common.annotation.Log;
|
||||
import com.wms.common.core.controller.BaseController;
|
||||
import com.wms.common.core.domain.AjaxResult;
|
||||
import com.wms.common.core.page.TableDataInfo;
|
||||
import com.wms.common.enums.BusinessType;
|
||||
import com.wms.common.enums.alarm.alarmStock.EnumAlarmStockType;
|
||||
import com.wms.common.utils.poi.ExcelUtil;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import io.swagger.annotations.ApiParam;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 库存告警配置Controller
|
||||
*
|
||||
* @author wms
|
||||
* @date 2024-05-14
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/alarm/alarmStockConfig")
|
||||
@Api(value = "库存告警配置控制器", tags = {"库存告警配置管理"})
|
||||
@RequiredArgsConstructor(onConstructor_ = @Autowired)
|
||||
public class TbAlarmStockConfigController extends BaseController {
|
||||
|
||||
private final ITbAlarmStockConfigService tbAlarmStockConfigService;
|
||||
|
||||
/**
|
||||
* 查询库存告警配置列表
|
||||
*/
|
||||
@ApiOperation("查询库存告警配置列表")
|
||||
@PreAuthorize("@ss.hasPermi('alarm:alarmStockConfig:list')")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(TbAlarmStockConfig tbAlarmStockConfig) {
|
||||
startPage();
|
||||
List<TbAlarmStockConfig> list = tbAlarmStockConfigService.list(new QueryWrapper<TbAlarmStockConfig>(tbAlarmStockConfig));
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出库存告警配置列表
|
||||
*/
|
||||
@ApiOperation("导出库存告警配置列表")
|
||||
@PreAuthorize("@ss.hasPermi('alarm:alarmStockConfig:export')")
|
||||
@Log(title = "库存告警配置", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, TbAlarmStockConfig tbAlarmStockConfig) {
|
||||
List<TbAlarmStockConfig> list = tbAlarmStockConfigService.list(new QueryWrapper<TbAlarmStockConfig>(tbAlarmStockConfig));
|
||||
ExcelUtil<TbAlarmStockConfig> util = new ExcelUtil<TbAlarmStockConfig>(TbAlarmStockConfig.class);
|
||||
util.exportExcel(response, list, "库存告警配置数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取库存告警配置详细信息
|
||||
*/
|
||||
@ApiOperation("获取库存告警配置详细信息")
|
||||
@PreAuthorize("@ss.hasPermi('alarm:alarmStockConfig:query')")
|
||||
@GetMapping(value = "/{id}")
|
||||
public AjaxResult getInfo(@ApiParam(value = "主键", required = true) @PathVariable("id") Long id) {
|
||||
return AjaxResult.success(tbAlarmStockConfigService.getById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增库存告警配置
|
||||
*/
|
||||
@ApiOperation("新增库存告警配置")
|
||||
@PreAuthorize("@ss.hasPermi('alarm:alarmStockConfig:add')")
|
||||
@Log(title = "库存告警配置", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody TbAlarmStockConfig tbAlarmStockConfig) {
|
||||
return toAjax(tbAlarmStockConfigService.save(tbAlarmStockConfig));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改库存告警配置
|
||||
*/
|
||||
@ApiOperation("修改库存告警配置")
|
||||
@PreAuthorize("@ss.hasPermi('alarm:alarmStockConfig:edit')")
|
||||
@Log(title = "库存告警配置", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody TbAlarmStockConfig tbAlarmStockConfig) {
|
||||
return toAjax(tbAlarmStockConfigService.updateById(tbAlarmStockConfig));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除库存告警配置
|
||||
*/
|
||||
@ApiOperation("删除库存告警配置")
|
||||
@PreAuthorize("@ss.hasPermi('alarm:alarmStockConfig:remove')")
|
||||
@Log(title = "库存告警配置", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
public AjaxResult remove(@ApiParam(value = "主键数组", required = true) @PathVariable Long[] ids) {
|
||||
return toAjax(tbAlarmStockConfigService.removeByIds(Arrays.asList(ids)));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 获取库存告警配置
|
||||
*/
|
||||
@ApiOperation("获取库高库存告警配置")
|
||||
@GetMapping("/getArticleStockAlarmConfigByArticleIdAndStockAlarmType/{articleId}/{alarmStockType}")
|
||||
public AjaxResult getArticleHighStockAlarmConfig(@PathVariable("articleId") String articleId,@PathVariable("alarmStockType") String alarmStockType) {
|
||||
final TbAlarmStockConfigVo vo = tbAlarmStockConfigService.getOneByArticleIdAndStockAlarmType(articleId, alarmStockType);
|
||||
return AjaxResult.success(vo);
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置(新增)库存告警
|
||||
*/
|
||||
@ApiOperation("设置低库存库存告警")
|
||||
@PostMapping("/setStockAlarmConfig")
|
||||
public AjaxResult setStockAlarmConfig(@RequestBody ArticleStockAlarmConfig alarmConfig) {
|
||||
return tbAlarmStockConfigService.insertStockAlarmConfig(alarmConfig);
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置(修改)库存告警
|
||||
*/
|
||||
@ApiOperation("设置低库存库存告警")
|
||||
@PutMapping("/updateStockAlarmConfig")
|
||||
public AjaxResult updateStockAlarmConfig(@RequestBody ArticleStockAlarmConfig alarmConfig) {
|
||||
return tbAlarmStockConfigService.updateStockAlarmConfig(alarmConfig);
|
||||
}
|
||||
|
||||
|
||||
}
|
|
@ -0,0 +1,54 @@
|
|||
package com.wms.alarm.domain;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.wms.common.annotation.Excel;
|
||||
import com.wms.common.core.domain.BaseEntityPlus;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* @author qzx
|
||||
* @Classname TbArticleVo
|
||||
* @Description 商品档案对象 tb_basic_article
|
||||
* @Date 2024/7/17 17:31
|
||||
*/
|
||||
@Data
|
||||
@Builder
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@Accessors(chain = true)
|
||||
@TableName("tb_basic_article")
|
||||
@ApiModel(value = "TbAlarmArticleVo", description = "商品档案实体")
|
||||
public class TbAlarmArticleVo extends BaseEntityPlus implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 物料编码 */
|
||||
@ApiModelProperty("物料编码")
|
||||
@TableId(value = "article_id")
|
||||
private String articleId;
|
||||
|
||||
/** 物料名称 */
|
||||
@ApiModelProperty("物料名称")
|
||||
@Excel(name = "物料名称")
|
||||
private String articleName;
|
||||
|
||||
/** 品牌 */
|
||||
@ApiModelProperty("品牌")
|
||||
@Excel(name = "品牌")
|
||||
private String articleBrand;
|
||||
|
||||
/** 备注 */
|
||||
@ApiModelProperty("备注")
|
||||
@Excel(name = "备注")
|
||||
private String remark;
|
||||
|
||||
}
|
|
@ -0,0 +1,73 @@
|
|||
package com.wms.alarm.domain;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import com.wms.common.core.domain.BaseEntityPlus;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.experimental.Accessors;
|
||||
import com.wms.common.annotation.Excel;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* 告警码配置对象 tb_alarm_code
|
||||
*
|
||||
* @author wms
|
||||
* @date 2023-10-10
|
||||
*/
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@Builder
|
||||
@Accessors(chain = true)
|
||||
@TableName("tb_alarm_code")
|
||||
@ApiModel(value = "TbAlarmCode", description = "告警码配置实体")
|
||||
public class TbAlarmCode extends BaseEntityPlus implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 告警码 */
|
||||
@ApiModelProperty("告警码")
|
||||
@TableId(value = "alarm_code")
|
||||
private String alarmCode;
|
||||
|
||||
/** 告警源 */
|
||||
@ApiModelProperty("告警源")
|
||||
private String alarmSourceCode;
|
||||
|
||||
/** 告警码名称 */
|
||||
@ApiModelProperty("告警码名称")
|
||||
@Excel(name = "告警码名称")
|
||||
private String alarmName;
|
||||
|
||||
/** 状态(0正常 1停用) */
|
||||
@ApiModelProperty("状态(0正常 1停用)")
|
||||
@Excel(name = "状态", readConverterExp = "0=正常,1=停用")
|
||||
private String status;
|
||||
|
||||
/** 告警等级 */
|
||||
@ApiModelProperty("告警等级")
|
||||
@Excel(name = "告警等级")
|
||||
private String alarmCodeLevel;
|
||||
|
||||
/** 告警语 */
|
||||
@ApiModelProperty("告警语")
|
||||
@Excel(name = "告警语")
|
||||
private String alarmWords;
|
||||
|
||||
/** 是否显示在大屏上 Y:是 N:否 */
|
||||
@ApiModelProperty("是否显示在大屏上 Y:是 N:否")
|
||||
@Excel(name = "是否显示在大屏上 Y:是 N:否")
|
||||
private String isShowBigScreen;
|
||||
|
||||
/** 自动消除 Y:是 N:否*/
|
||||
@ApiModelProperty("自动消除")
|
||||
@Excel(name = "自动消除")
|
||||
private String isAutoDismissAlarms;
|
||||
|
||||
|
||||
|
||||
}
|
|
@ -0,0 +1,201 @@
|
|||
package com.wms.alarm.domain;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.wms.common.annotation.Excel;
|
||||
import com.wms.common.core.domain.BaseEntityPlus;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 告警历史对象 tb_alarm_history
|
||||
*
|
||||
* @author wms
|
||||
* @date 2023-06-06
|
||||
*/
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@Builder
|
||||
@Accessors(chain = true)
|
||||
@TableName("tb_alarm_history")
|
||||
@ApiModel(value = "TbAlarmHistory", description = "告警历史实体")
|
||||
public class TbAlarmHistory extends BaseEntityPlus implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 告警流水号(uuid)
|
||||
*/
|
||||
@ApiModelProperty("告警流水号(uuid)")
|
||||
@TableId
|
||||
private String id;
|
||||
|
||||
/**
|
||||
* 告警值
|
||||
*/
|
||||
@ApiModelProperty("告警值")
|
||||
@Excel(name = "告警值")
|
||||
private BigDecimal alarmValue;
|
||||
|
||||
/**
|
||||
* 告警语
|
||||
*/
|
||||
@ApiModelProperty("告警语")
|
||||
@Excel(name = "告警语")
|
||||
private String alarmWords;
|
||||
|
||||
/**
|
||||
* 告警时间
|
||||
*/
|
||||
@ApiModelProperty("告警时间")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@Excel(name = "告警时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date alarmTime;
|
||||
|
||||
/**
|
||||
* 告警等级
|
||||
*/
|
||||
@ApiModelProperty("告警等级")
|
||||
@Excel(name = "告警等级")
|
||||
private String alarmLevel;
|
||||
|
||||
/**
|
||||
* 告警等级名称
|
||||
*/
|
||||
@ApiModelProperty("告警等级名称")
|
||||
@Excel(name = "告警等级名称")
|
||||
private String alarmLevelName;
|
||||
|
||||
/**
|
||||
* 告警数据来源 0:本系统,1:其它系统
|
||||
*/
|
||||
@ApiModelProperty("告警数据来源 0:本系统,1:其它系统")
|
||||
@Excel(name = "告警数据来源 0:本系统,1:其它系统")
|
||||
private String alarmDataSources;
|
||||
|
||||
/**
|
||||
* 告警源编码
|
||||
*/
|
||||
@ApiModelProperty("告警源编码")
|
||||
@Excel(name = "告警源编码")
|
||||
private String alarmSourceCode;
|
||||
|
||||
/**
|
||||
* 告警源名称
|
||||
*/
|
||||
@ApiModelProperty("告警源名称")
|
||||
@Excel(name = "告警源名称")
|
||||
private String alarmSourceName;
|
||||
|
||||
/**
|
||||
* 告警类型名称
|
||||
*/
|
||||
@ApiModelProperty("告警类型名称")
|
||||
@Excel(name = "告警类型名称")
|
||||
private String alarmTypeName;
|
||||
|
||||
/**
|
||||
* 告警类型编码
|
||||
*/
|
||||
@ApiModelProperty("告警类型编码")
|
||||
@Excel(name = "告警类型编码")
|
||||
private String alarmTypeCode;
|
||||
|
||||
/**
|
||||
* 告警数据编码
|
||||
*/
|
||||
@ApiModelProperty("告警数据编码")
|
||||
@Excel(name = "告警数据编码")
|
||||
private String alarmConfigCode;
|
||||
|
||||
/**
|
||||
* 告警数据名称
|
||||
*/
|
||||
@ApiModelProperty("告警数据名称")
|
||||
@Excel(name = "告警数据名称")
|
||||
private String alarmConfigName;
|
||||
|
||||
/**
|
||||
* 是否显示在大屏上 Y:是 N:否
|
||||
*/
|
||||
@ApiModelProperty("是否显示在大屏上 Y:是 N:否")
|
||||
@Excel(name = "是否显示在大屏上 Y:是 N:否")
|
||||
private String isShowBigScreen;
|
||||
|
||||
|
||||
/**
|
||||
* 消除类型 1:自动消除,2:人工消除
|
||||
*/
|
||||
@ApiModelProperty("消除类型 1:自动消除,2:人工消除")
|
||||
@Excel(name = "消除类型 1:自动消除,2:人工消除")
|
||||
private String isDisarmType;
|
||||
|
||||
/**
|
||||
* 消除告警人员
|
||||
*/
|
||||
@ApiModelProperty("消除告警人员")
|
||||
@Excel(name = "消除告警人员")
|
||||
private String disarmAlarmBy;
|
||||
|
||||
/**
|
||||
* 消除告警原因
|
||||
*/
|
||||
@ApiModelProperty("消除告警原因")
|
||||
@Excel(name = "消除告警原因")
|
||||
private String disarmAlarmReason;
|
||||
|
||||
/**
|
||||
* 消除告警时间
|
||||
*/
|
||||
@ApiModelProperty("消除告警时间")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@Excel(name = "消除告警时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date disarmAlarmTime;
|
||||
|
||||
/**
|
||||
* 是否处理告警 Y:是 N:否
|
||||
*/
|
||||
@ApiModelProperty("是否处理告警 Y:是 N:否")
|
||||
@Excel(name = "是否处理告警 Y:是 N:否")
|
||||
private String isHandleAlarm;
|
||||
|
||||
/**
|
||||
* 处理告警人员
|
||||
*/
|
||||
@ApiModelProperty("处理告警人员")
|
||||
@Excel(name = "处理告警人员")
|
||||
private String handleAlarmBy;
|
||||
|
||||
/**
|
||||
* 处理告警过程
|
||||
*/
|
||||
@ApiModelProperty("处理告警过程")
|
||||
@Excel(name = "处理告警过程")
|
||||
private String handleAlarmProcess;
|
||||
|
||||
/**
|
||||
* 处理告警结果
|
||||
*/
|
||||
@ApiModelProperty("处理告警结果")
|
||||
@Excel(name = "处理告警结果")
|
||||
private String handleAlarmResult;
|
||||
|
||||
/**
|
||||
* 处理告警时间
|
||||
*/
|
||||
@ApiModelProperty("处理告警时间")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@Excel(name = "处理告警时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date handleAlarmTime;
|
||||
|
||||
}
|
|
@ -0,0 +1,142 @@
|
|||
package com.wms.alarm.domain;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.wms.common.annotation.Excel;
|
||||
import com.wms.common.core.domain.BaseEntityPlus;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 实时告警对象 tb_alarm_realtime
|
||||
*
|
||||
* @author wms
|
||||
* @date 2023-06-06
|
||||
*/
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@Builder
|
||||
@Accessors(chain = true)
|
||||
@TableName("tb_alarm_realtime")
|
||||
@ApiModel(value = "TbAlarmRealtime", description = "实时告警实体")
|
||||
public class TbAlarmRealtime extends BaseEntityPlus implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 告警流水号(uuid)
|
||||
*/
|
||||
@ApiModelProperty("告警流水号(uuid)")
|
||||
@TableId
|
||||
private String id;
|
||||
|
||||
/**
|
||||
* 告警值
|
||||
*/
|
||||
@ApiModelProperty("告警值")
|
||||
@Excel(name = "告警值")
|
||||
private BigDecimal alarmValue;
|
||||
|
||||
/**
|
||||
* 告警语
|
||||
*/
|
||||
@ApiModelProperty("告警语")
|
||||
@Excel(name = "告警语")
|
||||
private String alarmWords;
|
||||
|
||||
/**
|
||||
* 告警时间
|
||||
*/
|
||||
@ApiModelProperty("告警时间")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@Excel(name = "告警时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date alarmTime;
|
||||
|
||||
/**
|
||||
* 告警等级
|
||||
*/
|
||||
@ApiModelProperty("告警等级")
|
||||
@Excel(name = "告警等级")
|
||||
private String alarmLevel;
|
||||
|
||||
/**
|
||||
* 告警等级名称
|
||||
*/
|
||||
@ApiModelProperty("告警等级名称")
|
||||
@Excel(name = "告警等级名称")
|
||||
private String alarmLevelName;
|
||||
|
||||
/**
|
||||
* 告警数据类型 0:接口无规则上报, 1:接口规则上报
|
||||
*/
|
||||
@ApiModelProperty("告警数据类型 0:接口无规则上报, 1:接口规则上报")
|
||||
@Excel(name = "告警数据类型 0:接口无规则上报, 1:接口规则上报")
|
||||
private String alarmDataType;
|
||||
|
||||
/**
|
||||
* 告警数据来源 0:本系统,1:其它系统
|
||||
*/
|
||||
@ApiModelProperty("告警数据来源 0:本系统,1:其它系统")
|
||||
@Excel(name = "告警数据来源 0:本系统,1:其它系统")
|
||||
private String alarmDataSources;
|
||||
|
||||
/**
|
||||
* 告警源编码
|
||||
*/
|
||||
@ApiModelProperty("告警源编码")
|
||||
@Excel(name = "告警源编码")
|
||||
private String alarmSourceCode;
|
||||
|
||||
/**
|
||||
* 告警源名称
|
||||
*/
|
||||
@ApiModelProperty("告警源名称")
|
||||
@Excel(name = "告警源名称")
|
||||
private String alarmSourceName;
|
||||
|
||||
/**
|
||||
* 告警类型编码
|
||||
*/
|
||||
@ApiModelProperty("告警类型编码")
|
||||
@Excel(name = "告警类型编码")
|
||||
private String alarmTypeCode;
|
||||
|
||||
/**
|
||||
* 告警类型名称
|
||||
*/
|
||||
@ApiModelProperty("告警类型名称")
|
||||
@Excel(name = "告警类型名称")
|
||||
private String alarmTypeName;
|
||||
|
||||
/**
|
||||
* 告警码
|
||||
*/
|
||||
@ApiModelProperty("告警码")
|
||||
@Excel(name = "告警码")
|
||||
private String alarmConfigCode;
|
||||
|
||||
/**
|
||||
* 告警码名称
|
||||
*/
|
||||
@ApiModelProperty("告警码名称")
|
||||
@Excel(name = "告警码名称")
|
||||
private String alarmConfigName;
|
||||
|
||||
/**
|
||||
* 是否显示在大屏上 Y:是 N:否
|
||||
*/
|
||||
@ApiModelProperty("是否显示在大屏上 Y:是 N:否")
|
||||
@Excel(name = "是否显示在大屏上 Y:是 N:否")
|
||||
private String isShowBigScreen;
|
||||
|
||||
}
|
|
@ -0,0 +1,57 @@
|
|||
package com.wms.alarm.domain;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.wms.common.annotation.Excel;
|
||||
import com.wms.common.core.domain.BaseEntityPlus;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* 告警源对象 tb_alarm_source
|
||||
*
|
||||
* @author wms
|
||||
* @date 2023-06-06
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@Accessors(chain = true)
|
||||
@TableName("tb_alarm_source")
|
||||
@ApiModel(value = "TbAlarmSource", description = "告警源实体")
|
||||
public class TbAlarmSource extends BaseEntityPlus implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 告警源编码
|
||||
*/
|
||||
@ApiModelProperty("告警源编码")
|
||||
@TableId
|
||||
private String alarmSourceCode;
|
||||
|
||||
/**
|
||||
* 告警源名称
|
||||
*/
|
||||
@ApiModelProperty("告警源名称")
|
||||
@Excel(name = "告警源名称")
|
||||
private String alarmSourceName;
|
||||
|
||||
/**
|
||||
* 状态(0正常 1停用)
|
||||
*/
|
||||
@ApiModelProperty("状态(0正常 1停用)")
|
||||
@Excel(name = "状态", readConverterExp = "0=正常,1=停用")
|
||||
private String status;
|
||||
|
||||
/** 备注 */
|
||||
@ApiModelProperty("备注")
|
||||
@Excel(name = "备注")
|
||||
private String remark;
|
||||
|
||||
}
|
|
@ -0,0 +1,78 @@
|
|||
package com.wms.alarm.domain;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.wms.common.annotation.Excel;
|
||||
import com.wms.common.core.domain.BaseEntityPlus;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.experimental.Accessors;
|
||||
import lombok.experimental.SuperBuilder;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* 库存告警配置对象 tb_alarm_stock_config
|
||||
*
|
||||
* @author wms
|
||||
* @date 2024-05-14
|
||||
*/
|
||||
@Data
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@Accessors(chain = true)
|
||||
@TableName("tb_alarm_stock_config")
|
||||
@ApiModel(value = "TbAlarmStockConfig", description = "库存告警配置实体")
|
||||
public class TbAlarmStockConfig extends BaseEntityPlus implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 主键id
|
||||
*/
|
||||
@ApiModelProperty("主键id")
|
||||
@TableId(value = "id", type = IdType.INPUT)
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 告警码
|
||||
*/
|
||||
@ApiModelProperty("告警码")
|
||||
@Excel(name = "告警码")
|
||||
private String alarmCode;
|
||||
|
||||
/**
|
||||
* 物料编号
|
||||
*/
|
||||
@ApiModelProperty("物料编号")
|
||||
@Excel(name = "物料编号")
|
||||
private String articleId;
|
||||
|
||||
/**
|
||||
* 库存告警类型 10:低库存告警 20:高库存告警
|
||||
*/
|
||||
@ApiModelProperty("库存告警类型 10:低库存告警 20:高库存告警")
|
||||
@Excel(name = "库存告警类型 10:低库存告警 20:高库存告警")
|
||||
private String stockAlarmType;
|
||||
|
||||
/**
|
||||
* 告警值
|
||||
*/
|
||||
@ApiModelProperty("告警值")
|
||||
@Excel(name = "告警值")
|
||||
private BigDecimal alarmValue;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
@ApiModelProperty("备注")
|
||||
@Excel(name = "备注")
|
||||
private String remark;
|
||||
|
||||
}
|
|
@ -0,0 +1,68 @@
|
|||
package com.wms.alarm.domain.dto;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import javax.validation.constraints.NotNull;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* @author 中xue
|
||||
* @version 1.0
|
||||
* @date 2023/5/31 11:14
|
||||
* 直接上报告警接口
|
||||
*/
|
||||
@Data
|
||||
@Builder
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@ApiModel(value = "DirectReportAlarmDto", description = "上报告警实体")
|
||||
public class DirectReportAlarmDto {
|
||||
@ApiModelProperty(value = "告警值", required = true)
|
||||
@NotNull(message = "alarmValue.NotNull")
|
||||
private BigDecimal alarmValue;
|
||||
|
||||
@ApiModelProperty(value = "告警时间", required = true)
|
||||
@NotNull(message = "alarmTime.NotNull")
|
||||
private Date alarmTime;
|
||||
|
||||
@ApiModelProperty(value = "告警语")
|
||||
@NotNull(message = "alarmWords.NotNull")
|
||||
private String alarmWords;
|
||||
|
||||
@ApiModelProperty(value = "告警等级")
|
||||
private String alarmLevel;
|
||||
|
||||
@ApiModelProperty(value = "告警等级名称")
|
||||
private String alarmLevelName;
|
||||
|
||||
@ApiModelProperty(value = "告警源编码")
|
||||
private String alarmSourceCode;
|
||||
|
||||
@ApiModelProperty(value = "告警源名称")
|
||||
private String alarmSourceName;
|
||||
|
||||
@ApiModelProperty(value = "告警类型编码")
|
||||
private String alarmTypeCode;
|
||||
|
||||
@ApiModelProperty(value = "告警类型名称")
|
||||
private String alarmTypeName;
|
||||
|
||||
@ApiModelProperty(value = "告警码")
|
||||
@NotNull(message = "alarmConfigCode.NotNull")
|
||||
private String alarmConfigCode;
|
||||
|
||||
@ApiModelProperty(value = "告警码名称")
|
||||
private String alarmConfigName;
|
||||
|
||||
@ApiModelProperty(value = "是否显示在大屏上 Y:是 N:否")
|
||||
private String isShowBigScreen;
|
||||
|
||||
@ApiModelProperty("告警数据来源 0:本系统,1:其它系统")
|
||||
private String alarmDataSources;
|
||||
}
|
|
@ -0,0 +1,42 @@
|
|||
package com.wms.alarm.domain.dto;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import javax.validation.constraints.NotBlank;
|
||||
import javax.validation.constraints.NotNull;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* @author 中xue
|
||||
* @version 1.0
|
||||
* @date 2023/5/31 18:01
|
||||
*/
|
||||
@Data
|
||||
@Builder
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@ApiModel(value = "ReportAlarmConfigCodeAndValueDto", description = "上报告警码和告警值实体")
|
||||
public class ReportAlarmConfigCodeAndValueDto {
|
||||
@ApiModelProperty(value = "告警值", required = true)
|
||||
@NotNull(message = "alarmValue.NotNull")
|
||||
private BigDecimal alarmValue;
|
||||
|
||||
@ApiModelProperty(value = "告警时间", required = true)
|
||||
@NotNull(message = "alarmTime.NotNull")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date alarmTime;
|
||||
|
||||
@ApiModelProperty(value = "告警码", required = true)
|
||||
@NotBlank(message = "alarmConfigCode.NotNull")
|
||||
private String alarmConfigCode;
|
||||
|
||||
@ApiModelProperty(value = "是否显示在大屏上 Y:是 N:否")
|
||||
private String isShowBigScreen;
|
||||
}
|
|
@ -0,0 +1,82 @@
|
|||
package com.wms.alarm.domain.param;
|
||||
|
||||
import com.wms.common.annotation.Excel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* @author qzx
|
||||
* @Classname ArticleHighStockAlarmConfig
|
||||
* @Description 高库存告警配置
|
||||
* @Date 2024/5/13 17:32
|
||||
*/
|
||||
@Data
|
||||
@Builder
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@Accessors(chain = true)
|
||||
public class ArticleHighStockAlarmConfig {
|
||||
/**
|
||||
* 物料编号
|
||||
*/
|
||||
@ApiModelProperty("告警码")
|
||||
private String articleId;
|
||||
/**
|
||||
* 高库存告警值
|
||||
*/
|
||||
@ApiModelProperty("高库存告警值")
|
||||
private BigDecimal highStockNum;
|
||||
|
||||
/**
|
||||
* 是否开启高库存告警
|
||||
*/
|
||||
@ApiModelProperty("是否开启高库存告警")
|
||||
private String isHighOpen;
|
||||
/**
|
||||
* 告警码
|
||||
*/
|
||||
@ApiModelProperty("告警码")
|
||||
private String alarmCode;
|
||||
/**
|
||||
* 告警源
|
||||
*/
|
||||
@ApiModelProperty("告警源")
|
||||
private String alarmSourceCode;
|
||||
/**
|
||||
* 告警码名称
|
||||
*/
|
||||
@ApiModelProperty("告警码名称")
|
||||
@Excel(name = "告警码名称")
|
||||
private String alarmName;
|
||||
/**
|
||||
* 状态(0正常 1停用)
|
||||
*/
|
||||
@ApiModelProperty("状态(0正常 1停用)")
|
||||
private String status;
|
||||
/**
|
||||
* 告警等级
|
||||
*/
|
||||
@ApiModelProperty("告警等级")
|
||||
private String alarmCodeLevel;
|
||||
/**
|
||||
* 告警语
|
||||
*/
|
||||
@ApiModelProperty("告警语")
|
||||
private String alarmWords;
|
||||
/**
|
||||
* 是否显示在大屏上 Y:是 N:否
|
||||
*/
|
||||
@ApiModelProperty("是否显示在大屏上 Y:是 N:否")
|
||||
private String isShowBigScreen;
|
||||
/**
|
||||
* 自动消除 Y:是 N:否
|
||||
*/
|
||||
@ApiModelProperty("自动消除")
|
||||
private String isAutoDismissAlarms;
|
||||
}
|
|
@ -0,0 +1,86 @@
|
|||
package com.wms.alarm.domain.param;
|
||||
|
||||
import com.wms.common.annotation.Excel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* @author qzx
|
||||
* @Classname ArticleAlarmConfig
|
||||
* @Description 库存告警配置
|
||||
* @Date 2024/4/17 11:37
|
||||
*/
|
||||
@Data
|
||||
@Builder
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@Accessors(chain = true)
|
||||
public class ArticleStockAlarmConfig {
|
||||
/**
|
||||
* 物料编号
|
||||
*/
|
||||
@ApiModelProperty("物料编号")
|
||||
private String articleId;
|
||||
/**
|
||||
* 库存告警类型 10:低库存告警 20:高库存告警
|
||||
*/
|
||||
@ApiModelProperty("库存告警类型 10:低库存告警 20:高库存告警")
|
||||
private String stockAlarmType;
|
||||
/**
|
||||
* 库存告警值
|
||||
*/
|
||||
@ApiModelProperty("库存告警值")
|
||||
private BigDecimal alarmValue;
|
||||
/**
|
||||
* 告警源
|
||||
*/
|
||||
@ApiModelProperty("告警源")
|
||||
private String alarmSourceCode;
|
||||
/**
|
||||
* 告警码
|
||||
*/
|
||||
@ApiModelProperty("告警码")
|
||||
private String alarmCode;
|
||||
/**
|
||||
* 告警码名称
|
||||
*/
|
||||
@ApiModelProperty("告警码名称")
|
||||
@Excel(name = "告警码名称")
|
||||
private String alarmName;
|
||||
/**
|
||||
* 状态(0正常 1停用)
|
||||
*/
|
||||
@ApiModelProperty("状态(0正常 1停用)")
|
||||
private String status;
|
||||
/**
|
||||
* 告警等级
|
||||
*/
|
||||
@ApiModelProperty("告警等级")
|
||||
private String alarmCodeLevel;
|
||||
/**
|
||||
* 告警语
|
||||
*/
|
||||
@ApiModelProperty("告警语")
|
||||
private String alarmWords;
|
||||
/**
|
||||
* 是否显示在大屏上 Y:是 N:否
|
||||
*/
|
||||
@ApiModelProperty("是否显示在大屏上 Y:是 N:否")
|
||||
private String isShowBigScreen;
|
||||
/**
|
||||
* 自动消除 Y:是 N:否
|
||||
*/
|
||||
@ApiModelProperty("自动消除")
|
||||
private String isAutoDismissAlarms;
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
@ApiModelProperty("备注")
|
||||
private String remark;
|
||||
}
|
|
@ -0,0 +1,46 @@
|
|||
package com.wms.alarm.domain.param;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.wms.common.annotation.Excel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* @author qzx
|
||||
* @Classname EliminateAlarmParam
|
||||
* @Description 消除告警对象
|
||||
* @Date 2024/3/21 14:30
|
||||
*/
|
||||
@Data
|
||||
@Builder
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class EliminateAlarmParam {
|
||||
@ApiModelProperty("实时告警ID")
|
||||
private String id;
|
||||
@ApiModelProperty("是否消除告警 Y:是 N:否")
|
||||
private String isDisarmAlarm;
|
||||
@ApiModelProperty("消除告警人员")
|
||||
private String disarmAlarmBy;
|
||||
@ApiModelProperty("消除告警原因")
|
||||
private String disarmAlarmReason;
|
||||
@ApiModelProperty("是否处理告警 Y:是 N:否")
|
||||
@Excel(name = " Y:是 N:否")
|
||||
private String isHandleAlarm;
|
||||
@ApiModelProperty("处理告警人员")
|
||||
private String handleAlarmBy;
|
||||
@ApiModelProperty("处理告警过程")
|
||||
private String handleAlarmProcess;
|
||||
@ApiModelProperty("处理告警结果")
|
||||
private String handleAlarmResult;
|
||||
@ApiModelProperty("处理告警时间")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date handleAlarmTime;
|
||||
}
|
|
@ -0,0 +1,127 @@
|
|||
package com.wms.alarm.domain.vo;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.FieldFill;
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.wms.alarm.domain.TbAlarmStockConfig;
|
||||
import com.wms.common.annotation.Excel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.experimental.Accessors;
|
||||
import lombok.experimental.SuperBuilder;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* @author qzx
|
||||
* @Classname TbAlarmStockConfigVo
|
||||
* @Description 库存告警+物料信息+告警配置
|
||||
* @Date 2024/5/14 15:19
|
||||
*/
|
||||
@Data
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@Accessors(chain = true)
|
||||
public class TbAlarmStockConfigVo{
|
||||
/**
|
||||
* 主键id
|
||||
*/
|
||||
@ApiModelProperty("主键id")
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 告警码
|
||||
*/
|
||||
@ApiModelProperty("告警码")
|
||||
private String alarmCode;
|
||||
|
||||
/**
|
||||
* 物料编号
|
||||
*/
|
||||
@ApiModelProperty("物料编号")
|
||||
private String articleId;
|
||||
|
||||
/**
|
||||
* 库存告警类型 10:低库存告警 20:高库存告警
|
||||
*/
|
||||
@ApiModelProperty("库存告警类型 10:低库存告警 20:高库存告警")
|
||||
private String stockAlarmType;
|
||||
|
||||
/**
|
||||
* 告警值
|
||||
*/
|
||||
@ApiModelProperty("告警值")
|
||||
private BigDecimal alarmValue;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
@ApiModelProperty("备注")
|
||||
private String remark;
|
||||
|
||||
|
||||
/** 物料名称 */
|
||||
@ApiModelProperty("物料名称")
|
||||
private String articleName;
|
||||
|
||||
/** 告警源 */
|
||||
@ApiModelProperty("告警源")
|
||||
private String alarmSourceCode;
|
||||
|
||||
/** 告警码名称 */
|
||||
@ApiModelProperty("告警码名称")
|
||||
private String alarmName;
|
||||
|
||||
/** 状态(0正常 1停用) */
|
||||
@ApiModelProperty("状态(0正常 1停用)")
|
||||
private String status;
|
||||
|
||||
/** 告警等级 */
|
||||
@ApiModelProperty("告警等级")
|
||||
private String alarmCodeLevel;
|
||||
|
||||
/** 告警语 */
|
||||
@ApiModelProperty("告警语")
|
||||
private String alarmWords;
|
||||
|
||||
/** 是否显示在大屏上 Y:是 N:否 */
|
||||
@ApiModelProperty("是否显示在大屏上 Y:是 N:否")
|
||||
private String isShowBigScreen;
|
||||
|
||||
/** 自动消除 Y:是 N:否*/
|
||||
@ApiModelProperty("自动消除")
|
||||
private String isAutoDismissAlarms;
|
||||
|
||||
/**
|
||||
* 创建者
|
||||
*/
|
||||
@ApiModelProperty("创建者")
|
||||
private String createBy;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@ApiModelProperty("创建时间")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date createTime;
|
||||
|
||||
/**
|
||||
* 更新者
|
||||
*/
|
||||
@ApiModelProperty("更新者")
|
||||
private String updateBy;
|
||||
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
@ApiModelProperty("更新时间")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date updateTime;
|
||||
}
|
|
@ -0,0 +1,14 @@
|
|||
package com.wms.alarm.mapper;
|
||||
|
||||
import com.github.yulichang.base.MPJBaseMapper;
|
||||
import com.wms.alarm.domain.TbAlarmArticleVo;
|
||||
import com.wms.alarm.domain.TbAlarmCode;
|
||||
|
||||
/**
|
||||
* @author qzx
|
||||
* @Classname TbAlarmArticleVoMapper
|
||||
* @Description TODO
|
||||
* @Date 2024/7/30 16:21
|
||||
*/
|
||||
public interface TbAlarmArticleVoMapper extends MPJBaseMapper<TbAlarmArticleVo> {
|
||||
}
|
|
@ -0,0 +1,16 @@
|
|||
package com.wms.alarm.mapper;
|
||||
|
||||
import com.github.yulichang.base.MPJBaseMapper;
|
||||
import com.wms.alarm.domain.TbAlarmCode;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
* 告警码配置Mapper接口
|
||||
*
|
||||
* @author wms
|
||||
* @date 2023-10-10
|
||||
*/
|
||||
@Mapper
|
||||
public interface TbAlarmCodeMapper extends MPJBaseMapper<TbAlarmCode> {
|
||||
|
||||
}
|
|
@ -0,0 +1,16 @@
|
|||
package com.wms.alarm.mapper;
|
||||
|
||||
import com.github.yulichang.base.MPJBaseMapper;
|
||||
import com.wms.alarm.domain.TbAlarmHistory;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
* 告警历史Mapper接口
|
||||
*
|
||||
* @author wms
|
||||
* @date 2023-06-06
|
||||
*/
|
||||
@Mapper
|
||||
public interface TbAlarmHistoryMapper extends MPJBaseMapper<TbAlarmHistory> {
|
||||
|
||||
}
|
|
@ -0,0 +1,20 @@
|
|||
package com.wms.alarm.mapper;
|
||||
|
||||
import com.github.yulichang.base.MPJBaseMapper;
|
||||
import com.wms.alarm.domain.TbAlarmRealtime;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Select;
|
||||
|
||||
/**
|
||||
* 实时告警Mapper接口
|
||||
*
|
||||
* @author wms
|
||||
* @date 2023-06-06
|
||||
*/
|
||||
@Mapper
|
||||
public interface TbAlarmRealtimeMapper extends MPJBaseMapper<TbAlarmRealtime> {
|
||||
|
||||
@Select("SELECT * FROM tb_alarm_realtime WHERE alarm_type_code = #{alarmTypeCode}")
|
||||
TbAlarmRealtime getByAlarmTypeCode(String alarmTypeCode);
|
||||
|
||||
}
|
|
@ -0,0 +1,17 @@
|
|||
package com.wms.alarm.mapper;
|
||||
|
||||
import com.github.yulichang.base.MPJBaseMapper;
|
||||
import com.wms.alarm.domain.TbAlarmSource;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
* 告警源Mapper接口
|
||||
*
|
||||
* @author wms
|
||||
* @date 2023-06-06
|
||||
*/
|
||||
@Mapper
|
||||
public interface TbAlarmSourceMapper extends MPJBaseMapper<TbAlarmSource> {
|
||||
|
||||
}
|
|
@ -0,0 +1,17 @@
|
|||
package com.wms.alarm.mapper;
|
||||
|
||||
import com.github.yulichang.base.MPJBaseMapper;
|
||||
import com.wms.alarm.domain.TbAlarmStockConfig;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
* 库存告警配置Mapper接口
|
||||
*
|
||||
* @author wms
|
||||
* @date 2024-05-14
|
||||
*/
|
||||
@Mapper
|
||||
public interface TbAlarmStockConfigMapper extends MPJBaseMapper<TbAlarmStockConfig> {
|
||||
|
||||
}
|
|
@ -0,0 +1,16 @@
|
|||
package com.wms.alarm.service;
|
||||
|
||||
import com.wms.alarm.domain.TbAlarmCode;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.wms.common.core.domain.AjaxResult;
|
||||
|
||||
/**
|
||||
* 告警码配置Service接口
|
||||
*
|
||||
* @author wms
|
||||
* @date 2023-10-10
|
||||
*/
|
||||
public interface ITbAlarmCodeService extends IService<TbAlarmCode> {
|
||||
|
||||
AjaxResult getAlarmCodeCascaderSelect();
|
||||
}
|
|
@ -0,0 +1,23 @@
|
|||
package com.wms.alarm.service;
|
||||
|
||||
import com.wms.alarm.domain.TbAlarmHistory;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.wms.alarm.domain.param.EliminateAlarmParam;
|
||||
import com.wms.common.core.domain.AjaxResult;
|
||||
|
||||
/**
|
||||
* 告警历史Service接口
|
||||
*
|
||||
* @author wms
|
||||
* @date 2023-06-06
|
||||
*/
|
||||
public interface ITbAlarmHistoryService extends IService<TbAlarmHistory> {
|
||||
|
||||
/**
|
||||
* 告警消除
|
||||
* @param enumIsDisarmType 消除类型 1:自动消除,2:人工消除
|
||||
* @param param 消除告警对象
|
||||
* @return AjaxResult
|
||||
*/
|
||||
AjaxResult eliminateAlarm(String enumIsDisarmType, EliminateAlarmParam param);
|
||||
}
|
|
@ -0,0 +1,25 @@
|
|||
package com.wms.alarm.service;
|
||||
|
||||
import com.wms.alarm.domain.TbAlarmRealtime;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.wms.alarm.domain.dto.DirectReportAlarmDto;
|
||||
import com.wms.alarm.domain.dto.ReportAlarmConfigCodeAndValueDto;
|
||||
import com.wms.common.core.domain.AjaxResult;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* 实时告警Service接口
|
||||
*
|
||||
* @author wms
|
||||
* @date 2023-06-06
|
||||
*/
|
||||
public interface ITbAlarmRealtimeService extends IService<TbAlarmRealtime> {
|
||||
|
||||
AjaxResult directReportAlarm(DirectReportAlarmDto dto);
|
||||
|
||||
AjaxResult reportAlarmConfigCodeAndValue(ReportAlarmConfigCodeAndValueDto dto);
|
||||
|
||||
void wmsReportAlarm(String alarmCode, BigDecimal alarmValue);
|
||||
void wmsEliminateAlarms(String alarmCode);
|
||||
}
|
|
@ -0,0 +1,14 @@
|
|||
package com.wms.alarm.service;
|
||||
|
||||
import com.wms.alarm.domain.TbAlarmSource;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
|
||||
/**
|
||||
* 告警源Service接口
|
||||
*
|
||||
* @author wms
|
||||
* @date 2023-06-06
|
||||
*/
|
||||
public interface ITbAlarmSourceService extends IService<TbAlarmSource> {
|
||||
|
||||
}
|
|
@ -0,0 +1,26 @@
|
|||
package com.wms.alarm.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.wms.alarm.domain.TbAlarmStockConfig;
|
||||
import com.wms.alarm.domain.param.ArticleStockAlarmConfig;
|
||||
import com.wms.alarm.domain.vo.TbAlarmStockConfigVo;
|
||||
import com.wms.common.core.domain.AjaxResult;
|
||||
|
||||
/**
|
||||
* 库存告警配置Service接口
|
||||
*
|
||||
* @author wms
|
||||
* @date 2024-05-14
|
||||
*/
|
||||
public interface ITbAlarmStockConfigService extends IService<TbAlarmStockConfig> {
|
||||
//根据告警码获取详情
|
||||
TbAlarmStockConfigVo getOneByAlarmCode(String alarmCode);
|
||||
//根据物料编码和库存告警类型获取详情
|
||||
TbAlarmStockConfigVo getOneByArticleIdAndStockAlarmType(String articleId,String stockAlarmType);
|
||||
//根据ID获取详情
|
||||
TbAlarmStockConfigVo getOneById(Integer id);
|
||||
//设置(新增)库存告警
|
||||
AjaxResult insertStockAlarmConfig(ArticleStockAlarmConfig alarmConfig);
|
||||
//设置(修改)库存告警
|
||||
AjaxResult updateStockAlarmConfig(ArticleStockAlarmConfig alarmConfig);
|
||||
}
|
|
@ -0,0 +1,47 @@
|
|||
package com.wms.alarm.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.wms.alarm.domain.TbAlarmCode;
|
||||
import com.wms.alarm.domain.TbAlarmSource;
|
||||
import com.wms.alarm.mapper.TbAlarmCodeMapper;
|
||||
import com.wms.alarm.service.ITbAlarmCodeService;
|
||||
import com.wms.alarm.service.ITbAlarmSourceService;
|
||||
import com.wms.common.core.domain.AjaxResult;
|
||||
import com.wms.common.core.domain.select.CascadeSelectVo;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import static java.util.stream.Collectors.toList;
|
||||
|
||||
/**
|
||||
* 告警码配置Service业务层处理
|
||||
*
|
||||
* @author wms
|
||||
* @date 2023-10-10
|
||||
*/
|
||||
@Service
|
||||
public class TbAlarmCodeServiceImpl extends ServiceImpl<TbAlarmCodeMapper, TbAlarmCode> implements ITbAlarmCodeService {
|
||||
|
||||
@Resource
|
||||
private ITbAlarmSourceService alarmSourceService;
|
||||
|
||||
@Override
|
||||
public AjaxResult getAlarmCodeCascaderSelect() {
|
||||
List<CascadeSelectVo> result = new ArrayList<>();
|
||||
//获取所有告警源
|
||||
final List<TbAlarmSource> sources = alarmSourceService.list();
|
||||
final List<TbAlarmCode> alarmCodes = this.list();
|
||||
for (TbAlarmSource source : sources) {
|
||||
final List<TbAlarmCode> collect = alarmCodes.stream().filter(item -> item.getAlarmSourceCode().equals(source.getAlarmSourceCode())).collect(toList());
|
||||
List<CascadeSelectVo> children = new ArrayList<>();
|
||||
for (TbAlarmCode code : collect) {
|
||||
children.add(CascadeSelectVo.builder().value(code.getAlarmCode()).label(code.getAlarmCode() + "——" + code.getAlarmName()).build());
|
||||
}
|
||||
result.add(CascadeSelectVo.builder().value(source.getAlarmSourceCode()).label(source.getAlarmSourceName()).children(children).build());
|
||||
}
|
||||
return AjaxResult.success(result);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,73 @@
|
|||
package com.wms.alarm.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.wms.alarm.domain.TbAlarmHistory;
|
||||
import com.wms.alarm.domain.TbAlarmRealtime;
|
||||
import com.wms.alarm.domain.param.EliminateAlarmParam;
|
||||
import com.wms.alarm.mapper.TbAlarmHistoryMapper;
|
||||
import com.wms.alarm.service.ITbAlarmHistoryService;
|
||||
import com.wms.alarm.service.ITbAlarmRealtimeService;
|
||||
import com.wms.common.core.domain.AjaxResult;
|
||||
import com.wms.common.enums.alarm.EnumIsDisarmType;
|
||||
import com.wms.common.utils.DateUtils;
|
||||
import com.wms.common.utils.uuid.IdUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
/**
|
||||
* 告警历史Service业务层处理
|
||||
*
|
||||
* @author wms
|
||||
* @date 2023-06-06
|
||||
*/
|
||||
@Service
|
||||
@Transactional
|
||||
public class TbAlarmHistoryServiceImpl extends ServiceImpl<TbAlarmHistoryMapper, TbAlarmHistory> implements ITbAlarmHistoryService {
|
||||
@Resource
|
||||
private ITbAlarmRealtimeService realtimeService;
|
||||
|
||||
/**
|
||||
* 告警消除
|
||||
* @param enumIsDisarmType 消除类型 1:自动消除,2:人工消除
|
||||
* @param param 消除告警对象
|
||||
* @return AjaxResult
|
||||
*/
|
||||
@Override
|
||||
public AjaxResult eliminateAlarm(String enumIsDisarmType, EliminateAlarmParam param) {
|
||||
//获取 实时告警
|
||||
final TbAlarmRealtime byId = realtimeService.getById(param.getId());
|
||||
final TbAlarmHistory build = TbAlarmHistory.builder()
|
||||
.id(IdUtils.fastSimpleUUID())
|
||||
.alarmValue(byId.getAlarmValue())
|
||||
.alarmWords(byId.getAlarmWords())
|
||||
.alarmTime(byId.getAlarmTime())
|
||||
.alarmLevel(byId.getAlarmLevel())
|
||||
.alarmLevelName(byId.getAlarmLevelName())
|
||||
.alarmDataSources(byId.getAlarmDataSources())
|
||||
.alarmSourceCode(byId.getAlarmSourceCode())
|
||||
.alarmSourceName(byId.getAlarmSourceName())
|
||||
.alarmTypeName(byId.getAlarmTypeName())
|
||||
.alarmTypeCode(byId.getAlarmTypeCode())
|
||||
.alarmConfigCode(byId.getAlarmConfigCode())
|
||||
.alarmConfigName(byId.getAlarmConfigName())
|
||||
.isShowBigScreen(byId.getIsShowBigScreen())
|
||||
.isDisarmType(enumIsDisarmType)
|
||||
.disarmAlarmBy(param.getDisarmAlarmBy())
|
||||
.disarmAlarmReason(param.getDisarmAlarmReason())
|
||||
.disarmAlarmTime(DateUtils.getNowDate())
|
||||
.isHandleAlarm(param.getIsHandleAlarm())
|
||||
.handleAlarmBy(param.getHandleAlarmBy())
|
||||
.handleAlarmProcess(param.getHandleAlarmProcess())
|
||||
.handleAlarmResult(param.getHandleAlarmResult())
|
||||
.handleAlarmTime(param.getHandleAlarmTime())
|
||||
.build();
|
||||
build.setCreateTime(DateUtils.getNowDate());
|
||||
//添加告警历史
|
||||
this.save(build);
|
||||
//删除实时告警
|
||||
realtimeService.removeById(param.getId());
|
||||
return AjaxResult.success("消除告警成功");
|
||||
}
|
||||
}
|
|
@ -0,0 +1,182 @@
|
|||
package com.wms.alarm.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.wms.alarm.domain.TbAlarmCode;
|
||||
import com.wms.alarm.domain.TbAlarmHistory;
|
||||
import com.wms.alarm.domain.TbAlarmRealtime;
|
||||
import com.wms.alarm.domain.TbAlarmSource;
|
||||
import com.wms.alarm.domain.dto.DirectReportAlarmDto;
|
||||
import com.wms.alarm.domain.dto.ReportAlarmConfigCodeAndValueDto;
|
||||
import com.wms.alarm.mapper.TbAlarmCodeMapper;
|
||||
import com.wms.alarm.mapper.TbAlarmHistoryMapper;
|
||||
import com.wms.alarm.mapper.TbAlarmRealtimeMapper;
|
||||
import com.wms.alarm.mapper.TbAlarmSourceMapper;
|
||||
import com.wms.alarm.service.ITbAlarmRealtimeService;
|
||||
import com.wms.common.core.domain.AjaxResult;
|
||||
import com.wms.common.enums.alarm.EnumIsDisarmType;
|
||||
import com.wms.common.utils.DateUtils;
|
||||
import com.wms.common.utils.uuid.IdUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* 实时告警Service业务层处理
|
||||
*
|
||||
* @author wms
|
||||
* @date 2023-06-06
|
||||
*/
|
||||
@Service
|
||||
public class TbAlarmRealtimeServiceImpl extends ServiceImpl<TbAlarmRealtimeMapper, TbAlarmRealtime> implements ITbAlarmRealtimeService {
|
||||
@Resource
|
||||
private TbAlarmRealtimeMapper alarmRealtimeMapper;
|
||||
@Resource
|
||||
private TbAlarmHistoryMapper alarmHistoryMapper;
|
||||
@Resource
|
||||
private TbAlarmCodeMapper alarmCodeMapper;
|
||||
@Resource
|
||||
private TbAlarmSourceMapper alarmSourceMapper;
|
||||
|
||||
/**
|
||||
* 告警上报 第三方 上报 手动上报
|
||||
* @param dto
|
||||
*/
|
||||
@Override
|
||||
@Transactional
|
||||
public AjaxResult directReportAlarm(DirectReportAlarmDto dto) {
|
||||
TbAlarmRealtime alarmRealtime = TbAlarmRealtime.builder()
|
||||
.id(IdUtils.fastSimpleUUID())
|
||||
.alarmValue(dto.getAlarmValue())
|
||||
.alarmWords(dto.getAlarmWords())
|
||||
.alarmTime(dto.getAlarmTime())
|
||||
.alarmLevel(dto.getAlarmLevel())
|
||||
.alarmLevelName(dto.getAlarmLevelName())
|
||||
.alarmSourceCode(dto.getAlarmSourceCode())
|
||||
.alarmSourceName(dto.getAlarmSourceName())
|
||||
.alarmTypeCode(dto.getAlarmTypeCode())
|
||||
.alarmTypeName(dto.getAlarmTypeName())
|
||||
.alarmConfigCode(dto.getAlarmConfigCode())
|
||||
.alarmConfigName(dto.getAlarmConfigName())
|
||||
//默认不显示再大屏上
|
||||
.isShowBigScreen(dto.getIsShowBigScreen() == null ? "N" : dto.getIsShowBigScreen())
|
||||
//告警数据来源 0:本系统,1:其它系统
|
||||
.alarmDataSources(dto.getAlarmDataSources() == null ? "1" : dto.getAlarmDataSources())
|
||||
.build();
|
||||
alarmRealtime.setCreateTime(DateUtils.getNowDate());
|
||||
//根据告警类型编码 自动消除上一个告警
|
||||
// TbAlarmRealtime history = alarmRealtimeMapper.getByAlarmTypeCode(dto.getAlarmConfigCode());
|
||||
TbAlarmRealtime history = alarmRealtimeMapper.selectOne(new LambdaQueryWrapper<TbAlarmRealtime>().eq(TbAlarmRealtime::getAlarmConfigCode,dto.getAlarmConfigCode()));
|
||||
if (null != history) {
|
||||
TbAlarmHistory tbAlarmHistory = TbAlarmHistory.builder()
|
||||
.id(IdUtils.fastSimpleUUID())
|
||||
.alarmValue(history.getAlarmValue())
|
||||
.alarmWords(history.getAlarmWords())
|
||||
.alarmTime(history.getAlarmTime())
|
||||
.alarmLevel(history.getAlarmLevel())
|
||||
.alarmLevelName(history.getAlarmLevelName())
|
||||
.alarmDataSources(history.getAlarmDataSources())
|
||||
.alarmSourceCode(history.getAlarmSourceCode())
|
||||
.alarmSourceName(history.getAlarmSourceName())
|
||||
.alarmTypeName(history.getAlarmTypeName())
|
||||
.alarmTypeCode(history.getAlarmTypeCode())
|
||||
.alarmConfigCode(history.getAlarmConfigCode())
|
||||
.alarmConfigName(history.getAlarmConfigName())
|
||||
.isShowBigScreen(history.getIsShowBigScreen())
|
||||
.isDisarmType(EnumIsDisarmType.ONE.getCode())
|
||||
.disarmAlarmBy("SYSTEM")
|
||||
.disarmAlarmReason("系统自动消除")
|
||||
.disarmAlarmTime(DateUtils.getNowDate())
|
||||
.build();
|
||||
alarmHistoryMapper.insert(tbAlarmHistory);
|
||||
this.baseMapper.deleteById(history.getId());
|
||||
}
|
||||
this.baseMapper.insert(alarmRealtime);
|
||||
return AjaxResult.success("上报告警成功");
|
||||
}
|
||||
|
||||
@Override
|
||||
public AjaxResult reportAlarmConfigCodeAndValue(ReportAlarmConfigCodeAndValueDto dto) {
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* wms 告警上报
|
||||
*
|
||||
* @param alarmCode 告警码
|
||||
* @param alarmValue 告警值
|
||||
*/
|
||||
@Override
|
||||
@Transactional
|
||||
public void wmsReportAlarm(String alarmCode, BigDecimal alarmValue) {
|
||||
//根据告警码获取详情和告警源
|
||||
final TbAlarmCode tbAlarmCode = alarmCodeMapper.selectById(alarmCode);
|
||||
final TbAlarmSource tbAlarmSource = alarmSourceMapper.selectById(tbAlarmCode.getAlarmSourceCode());
|
||||
TbAlarmRealtime alarmRealtime = TbAlarmRealtime.builder()
|
||||
.id(IdUtils.fastSimpleUUID())
|
||||
.alarmValue(alarmValue)
|
||||
.alarmWords(tbAlarmCode.getAlarmWords())
|
||||
.alarmTime(DateUtils.getNowDate())
|
||||
.alarmLevel(tbAlarmCode.getAlarmCodeLevel())
|
||||
.alarmLevelName("")
|
||||
.alarmSourceCode(tbAlarmSource.getAlarmSourceCode())
|
||||
.alarmSourceName(tbAlarmSource.getAlarmSourceName())
|
||||
.alarmTypeCode(tbAlarmSource.getAlarmSourceCode())
|
||||
.alarmConfigCode(tbAlarmCode.getAlarmCode())
|
||||
.alarmConfigName(tbAlarmCode.getAlarmName())
|
||||
//默认显示再大屏上
|
||||
.isShowBigScreen(tbAlarmCode.getIsShowBigScreen())
|
||||
//告警数据来源 0:内部规则生产,1:外部直接提供
|
||||
.alarmDataSources("0")
|
||||
.build();
|
||||
alarmRealtime.setCreateTime(DateUtils.getNowDate());
|
||||
this.baseMapper.insert(alarmRealtime);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* wms wms告警消除
|
||||
*
|
||||
* @param alarmCode 告警码
|
||||
*/
|
||||
@Override
|
||||
@Transactional
|
||||
public void wmsEliminateAlarms(String alarmCode) {
|
||||
//根据告警类型编码 自动消除上一个告警
|
||||
// TbAlarmRealtime history = alarmRealtimeMapper.selectOne(new LambdaQueryWrapper<TbAlarmRealtime>().eq(TbAlarmRealtime::getAlarmConfigCode, alarmCode));
|
||||
TbAlarmRealtime history = alarmRealtimeMapper.selectOne(new LambdaQueryWrapper<TbAlarmRealtime>()
|
||||
.eq(TbAlarmRealtime::getAlarmConfigCode, alarmCode)
|
||||
.orderByDesc(TbAlarmRealtime::getCreateTime)
|
||||
.last("limit 1")
|
||||
);
|
||||
if (null != history) {
|
||||
TbAlarmHistory tbAlarmHistory = TbAlarmHistory.builder()
|
||||
.id(IdUtils.fastSimpleUUID())
|
||||
.alarmValue(history.getAlarmValue())
|
||||
.alarmWords(history.getAlarmWords())
|
||||
.alarmTime(history.getAlarmTime())
|
||||
.alarmLevel(history.getAlarmLevel())
|
||||
.alarmLevelName(history.getAlarmLevelName())
|
||||
.alarmDataSources(history.getAlarmDataSources())
|
||||
.alarmSourceCode(history.getAlarmSourceCode())
|
||||
.alarmSourceName(history.getAlarmSourceName())
|
||||
.alarmTypeName(history.getAlarmTypeName())
|
||||
.alarmTypeCode(history.getAlarmTypeCode())
|
||||
.alarmConfigCode(history.getAlarmConfigCode())
|
||||
.alarmConfigName(history.getAlarmConfigName())
|
||||
.isShowBigScreen(history.getIsShowBigScreen())
|
||||
.isDisarmType(EnumIsDisarmType.ONE.getCode())
|
||||
.disarmAlarmBy("WMS")
|
||||
.disarmAlarmReason("系统自动消除")
|
||||
.disarmAlarmTime(DateUtils.getNowDate())
|
||||
.build();
|
||||
alarmHistoryMapper.insert(tbAlarmHistory);
|
||||
this.baseMapper.delete(Wrappers.<TbAlarmRealtime>lambdaQuery().eq(TbAlarmRealtime::getAlarmConfigCode, alarmCode));
|
||||
// this.baseMapper.deleteById(history.getId());
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,18 @@
|
|||
package com.wms.alarm.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.wms.alarm.domain.TbAlarmSource;
|
||||
import com.wms.alarm.mapper.TbAlarmSourceMapper;
|
||||
import com.wms.alarm.service.ITbAlarmSourceService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* 告警源Service业务层处理
|
||||
*
|
||||
* @author wms
|
||||
* @date 2023-06-06
|
||||
*/
|
||||
@Service
|
||||
public class TbAlarmSourceServiceImpl extends ServiceImpl<TbAlarmSourceMapper, TbAlarmSource> implements ITbAlarmSourceService {
|
||||
|
||||
}
|
|
@ -0,0 +1,132 @@
|
|||
package com.wms.alarm.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.github.yulichang.wrapper.MPJLambdaWrapper;
|
||||
import com.wms.alarm.domain.TbAlarmCode;
|
||||
import com.wms.alarm.domain.TbAlarmStockConfig;
|
||||
import com.wms.alarm.domain.param.ArticleStockAlarmConfig;
|
||||
import com.wms.alarm.domain.TbAlarmArticleVo;
|
||||
import com.wms.alarm.domain.vo.TbAlarmStockConfigVo;
|
||||
import com.wms.alarm.mapper.TbAlarmCodeMapper;
|
||||
import com.wms.alarm.mapper.TbAlarmStockConfigMapper;
|
||||
import com.wms.alarm.service.ITbAlarmStockConfigService;
|
||||
import com.wms.common.core.domain.AjaxResult;
|
||||
import com.wms.common.utils.StringUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
/**
|
||||
* 库存告警配置Service业务层处理
|
||||
*
|
||||
* @author wms
|
||||
* @date 2024-05-14
|
||||
*/
|
||||
@Service
|
||||
public class TbAlarmStockConfigServiceImpl extends ServiceImpl<TbAlarmStockConfigMapper, TbAlarmStockConfig> implements ITbAlarmStockConfigService {
|
||||
@Resource
|
||||
private TbAlarmCodeMapper alarmCodeMapper;
|
||||
@Resource
|
||||
private TbAlarmStockConfigMapper alarmStockConfigMapper;
|
||||
|
||||
/**
|
||||
* @param alarmCode 告警码
|
||||
* 根据告警码获取详情
|
||||
*/
|
||||
@Override
|
||||
public TbAlarmStockConfigVo getOneByAlarmCode(String alarmCode) {
|
||||
// 构建查询条件和联表信息
|
||||
MPJLambdaWrapper<TbAlarmStockConfig> lambdaWrapper = new MPJLambdaWrapper<TbAlarmStockConfig>()
|
||||
.selectAll(TbAlarmStockConfig.class)
|
||||
.selectAll(TbAlarmCode.class)
|
||||
.selectAs(TbAlarmArticleVo::getArticleName, TbAlarmStockConfigVo::getArticleName)
|
||||
.leftJoin(TbAlarmArticleVo.class, TbAlarmArticleVo::getArticleId, TbAlarmStockConfig::getArticleId)
|
||||
.leftJoin(TbAlarmCode.class, TbAlarmCode::getAlarmCode, TbAlarmStockConfig::getAlarmCode)
|
||||
.eq(TbAlarmStockConfig::getAlarmCode, alarmCode);
|
||||
return this.baseMapper.selectJoinOne(TbAlarmStockConfigVo.class, lambdaWrapper);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param articleId 物料ID
|
||||
* @param stockAlarmType 库存告警类型
|
||||
* 根据物料ID和库存告警类型获取详情
|
||||
*/
|
||||
@Override
|
||||
public TbAlarmStockConfigVo getOneByArticleIdAndStockAlarmType(String articleId, String stockAlarmType) {
|
||||
// 构建查询条件和联表信息
|
||||
MPJLambdaWrapper<TbAlarmStockConfig> lambdaWrapper = new MPJLambdaWrapper<TbAlarmStockConfig>()
|
||||
.selectAll(TbAlarmStockConfig.class)
|
||||
.selectAll(TbAlarmCode.class)
|
||||
.selectAs(TbAlarmArticleVo::getArticleName, TbAlarmStockConfigVo::getArticleName)
|
||||
.leftJoin(TbAlarmArticleVo.class, TbAlarmArticleVo::getArticleId, TbAlarmStockConfig::getArticleId)
|
||||
.leftJoin(TbAlarmCode.class, TbAlarmCode::getAlarmCode, TbAlarmStockConfig::getAlarmCode)
|
||||
.eq(TbAlarmStockConfig::getArticleId, articleId)
|
||||
.eq(TbAlarmStockConfig::getStockAlarmType, stockAlarmType);
|
||||
return this.baseMapper.selectJoinOne(TbAlarmStockConfigVo.class, lambdaWrapper);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param id 主键ID
|
||||
* 根据id获取详情
|
||||
*/
|
||||
@Override
|
||||
public TbAlarmStockConfigVo getOneById(Integer id) {
|
||||
// 构建查询条件和联表信息
|
||||
MPJLambdaWrapper<TbAlarmStockConfig> lambdaWrapper = new MPJLambdaWrapper<TbAlarmStockConfig>()
|
||||
.selectAll(TbAlarmStockConfig.class)
|
||||
.selectAll(TbAlarmCode.class)
|
||||
.selectAs(TbAlarmArticleVo::getArticleName, TbAlarmStockConfigVo::getArticleName)
|
||||
.leftJoin(TbAlarmArticleVo.class, TbAlarmArticleVo::getArticleId, TbAlarmStockConfig::getArticleId)
|
||||
.leftJoin(TbAlarmCode.class, TbAlarmCode::getAlarmCode, TbAlarmStockConfig::getAlarmCode)
|
||||
.eq(TbAlarmStockConfig::getId, id);
|
||||
return this.baseMapper.selectJoinOne(TbAlarmStockConfigVo.class, lambdaWrapper);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param alarmConfig alarmConfig
|
||||
* 新增库存告警配置
|
||||
*/
|
||||
@Override
|
||||
public AjaxResult insertStockAlarmConfig(ArticleStockAlarmConfig alarmConfig) {
|
||||
//判断告警码是否重复
|
||||
final Integer integer = alarmCodeMapper.selectCount(new LambdaQueryWrapper<TbAlarmCode>().eq(TbAlarmCode::getAlarmCode, alarmConfig.getAlarmCode()));
|
||||
if (integer != 0) {
|
||||
return AjaxResult.error("告警码重复");
|
||||
}
|
||||
final TbAlarmCode alarmCode = TbAlarmCode.builder().alarmCode(alarmConfig.getAlarmCode()).alarmSourceCode(alarmConfig.getAlarmSourceCode()).alarmName(alarmConfig.getAlarmName()).status(alarmConfig.getStatus()).alarmCodeLevel(alarmConfig.getAlarmCodeLevel()).alarmWords(alarmConfig.getAlarmWords()).isShowBigScreen(alarmConfig.getIsShowBigScreen()).isAutoDismissAlarms(alarmConfig.getIsAutoDismissAlarms()).build();
|
||||
alarmCodeMapper.insert(alarmCode);
|
||||
final TbAlarmStockConfig alarmStockConfig = TbAlarmStockConfig.builder().alarmCode(alarmConfig.getAlarmCode()).articleId(alarmConfig.getArticleId())
|
||||
.stockAlarmType(alarmConfig.getStockAlarmType()).alarmValue(alarmConfig.getAlarmValue()).remark(alarmConfig.getRemark()).build();
|
||||
this.baseMapper.insert(alarmStockConfig);
|
||||
return AjaxResult.success("设置成功");
|
||||
}
|
||||
|
||||
/**
|
||||
* @param alarmConfig alarmConfig
|
||||
* 修改库存告警配置
|
||||
* 修改库存配置 告警值
|
||||
* 修改告警码 内容
|
||||
*/
|
||||
@Override
|
||||
public AjaxResult updateStockAlarmConfig(ArticleStockAlarmConfig alarmConfig) {
|
||||
//根据告警码修改告警配置
|
||||
LambdaUpdateWrapper<TbAlarmStockConfig> updateAlarmStockConfigWrapper = new LambdaUpdateWrapper<>();
|
||||
updateAlarmStockConfigWrapper.eq(TbAlarmStockConfig::getAlarmCode, alarmConfig.getAlarmCode());
|
||||
updateAlarmStockConfigWrapper.set(alarmConfig.getAlarmValue() != null, TbAlarmStockConfig::getAlarmValue, alarmConfig.getAlarmValue());
|
||||
updateAlarmStockConfigWrapper.set(StringUtils.isNotEmpty(alarmConfig.getRemark()), TbAlarmStockConfig::getRemark, alarmConfig.getRemark());
|
||||
this.alarmStockConfigMapper.update(new TbAlarmStockConfig(), updateAlarmStockConfigWrapper);
|
||||
//根据告警码修改告警码
|
||||
LambdaUpdateWrapper<TbAlarmCode> updateAlarmCodeWrapper = new LambdaUpdateWrapper<>();
|
||||
updateAlarmCodeWrapper.eq(TbAlarmCode::getAlarmCode, alarmConfig.getAlarmCode());
|
||||
updateAlarmCodeWrapper.set(StringUtils.isNotEmpty(alarmConfig.getAlarmName()), TbAlarmCode::getAlarmName, alarmConfig.getAlarmName());
|
||||
updateAlarmCodeWrapper.set(StringUtils.isNotEmpty(alarmConfig.getStatus()), TbAlarmCode::getStatus, alarmConfig.getStatus());
|
||||
updateAlarmCodeWrapper.set(StringUtils.isNotEmpty(alarmConfig.getAlarmCodeLevel()), TbAlarmCode::getAlarmCodeLevel, alarmConfig.getAlarmCodeLevel());
|
||||
updateAlarmCodeWrapper.set(StringUtils.isNotEmpty(alarmConfig.getAlarmWords()), TbAlarmCode::getAlarmWords, alarmConfig.getAlarmWords());
|
||||
updateAlarmCodeWrapper.set(StringUtils.isNotEmpty(alarmConfig.getIsShowBigScreen()), TbAlarmCode::getIsShowBigScreen, alarmConfig.getIsShowBigScreen());
|
||||
updateAlarmCodeWrapper.set(StringUtils.isNotEmpty(alarmConfig.getIsAutoDismissAlarms()), TbAlarmCode::getIsAutoDismissAlarms, alarmConfig.getIsAutoDismissAlarms());
|
||||
this.alarmCodeMapper.update(new TbAlarmCode(), updateAlarmCodeWrapper);
|
||||
return AjaxResult.success("修改成功");
|
||||
}
|
||||
}
|
|
@ -0,0 +1,118 @@
|
|||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.wms.alarm.mapper.TbAlarmCodeMapper">
|
||||
|
||||
<resultMap type="com.wms.alarm.domain.TbAlarmCode" id="TbAlarmCodeResult">
|
||||
<result property="alarmCode" column="alarm_code"/>
|
||||
<result property="alarmName" column="alarm_name"/>
|
||||
<result property="status" column="status"/>
|
||||
<result property="alarmCodeLevel" column="alarm_code_level"/>
|
||||
<result property="alarmWords" column="alarm_words"/>
|
||||
<result property="isShowBigScreen" column="is_show_big_screen"/>
|
||||
<result property="alarmType" column="alarm_type"/>
|
||||
<result property="createBy" column="create_by"/>
|
||||
<result property="createTime" column="create_time"/>
|
||||
<result property="updateBy" column="update_by"/>
|
||||
<result property="updateTime" column="update_time"/>
|
||||
<result property="remark" column="remark"/>
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectTbAlarmCodeVo">
|
||||
select alarm_code,
|
||||
alarm_name,
|
||||
status,
|
||||
alarm_code_level,
|
||||
alarm_words,
|
||||
is_show_big_screen,
|
||||
alarm_type,
|
||||
create_by,
|
||||
create_time,
|
||||
update_by,
|
||||
update_time,
|
||||
remark
|
||||
from tb_alarm_code
|
||||
</sql>
|
||||
|
||||
<select id="selectTbAlarmCodeList" parameterType="TbAlarmCode" resultMap="TbAlarmCodeResult">
|
||||
<include refid="selectTbAlarmCodeVo"/>
|
||||
<where>
|
||||
<if test="alarmName != null and alarmName != ''">and alarm_name like concat('%', #{alarmName}, '%')</if>
|
||||
<if test="status != null and status != ''">and status = #{status}</if>
|
||||
<if test="alarmCodeLevel != null and alarmCodeLevel != ''">and alarm_code_level = #{alarmCodeLevel}</if>
|
||||
<if test="alarmWords != null and alarmWords != ''">and alarm_words = #{alarmWords}</if>
|
||||
<if test="isShowBigScreen != null and isShowBigScreen != ''">and is_show_big_screen = #{isShowBigScreen}
|
||||
</if>
|
||||
<if test="alarmType != null and alarmType != ''">and alarm_type = #{alarmType}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectTbAlarmCodeByAlarmCode" parameterType="String" resultMap="TbAlarmCodeResult">
|
||||
<include refid="selectTbAlarmCodeVo"/>
|
||||
where alarm_code = #{alarmCode}
|
||||
</select>
|
||||
|
||||
<insert id="insertTbAlarmCode" parameterType="TbAlarmCode">
|
||||
insert into tb_alarm_code
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="alarmCode != null">alarm_code,</if>
|
||||
<if test="alarmName != null and alarmName != ''">alarm_name,</if>
|
||||
<if test="status != null">status,</if>
|
||||
<if test="alarmCodeLevel != null">alarm_code_level,</if>
|
||||
<if test="alarmWords != null">alarm_words,</if>
|
||||
<if test="isShowBigScreen != null">is_show_big_screen,</if>
|
||||
<if test="alarmType != null">alarm_type,</if>
|
||||
<if test="createBy != null">create_by,</if>
|
||||
<if test="createTime != null">create_time,</if>
|
||||
<if test="updateBy != null">update_by,</if>
|
||||
<if test="updateTime != null">update_time,</if>
|
||||
<if test="remark != null">remark,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="alarmCode != null">#{alarmCode},</if>
|
||||
<if test="alarmName != null and alarmName != ''">#{alarmName},</if>
|
||||
<if test="status != null">#{status},</if>
|
||||
<if test="alarmCodeLevel != null">#{alarmCodeLevel},</if>
|
||||
<if test="alarmWords != null">#{alarmWords},</if>
|
||||
<if test="isShowBigScreen != null">#{isShowBigScreen},</if>
|
||||
<if test="alarmType != null">#{alarmType},</if>
|
||||
<if test="createBy != null">#{createBy},</if>
|
||||
<if test="createTime != null">#{createTime},</if>
|
||||
<if test="updateBy != null">#{updateBy},</if>
|
||||
<if test="updateTime != null">#{updateTime},</if>
|
||||
<if test="remark != null">#{remark},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateTbAlarmCode" parameterType="TbAlarmCode">
|
||||
update tb_alarm_code
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="alarmName != null and alarmName != ''">alarm_name = #{alarmName},</if>
|
||||
<if test="status != null">status = #{status},</if>
|
||||
<if test="alarmCodeLevel != null">alarm_code_level = #{alarmCodeLevel},</if>
|
||||
<if test="alarmWords != null">alarm_words = #{alarmWords},</if>
|
||||
<if test="isShowBigScreen != null">is_show_big_screen = #{isShowBigScreen},</if>
|
||||
<if test="alarmType != null">alarm_type = #{alarmType},</if>
|
||||
<if test="createBy != null">create_by = #{createBy},</if>
|
||||
<if test="createTime != null">create_time = #{createTime},</if>
|
||||
<if test="updateBy != null">update_by = #{updateBy},</if>
|
||||
<if test="updateTime != null">update_time = #{updateTime},</if>
|
||||
<if test="remark != null">remark = #{remark},</if>
|
||||
</trim>
|
||||
where alarm_code = #{alarmCode}
|
||||
</update>
|
||||
|
||||
<delete id="deleteTbAlarmCodeByAlarmCode" parameterType="String">
|
||||
delete
|
||||
from tb_alarm_code
|
||||
where alarm_code = #{alarmCode}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteTbAlarmCodeByAlarmCodes" parameterType="String">
|
||||
delete from tb_alarm_code where alarm_code in
|
||||
<foreach item="alarmCode" collection="array" open="(" separator="," close=")">
|
||||
#{alarmCode}
|
||||
</foreach>
|
||||
</delete>
|
||||
</mapper>
|
|
@ -0,0 +1,188 @@
|
|||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.wms.alarm.mapper.TbAlarmHistoryMapper">
|
||||
|
||||
<resultMap type="com.wms.alarm.domain.TbAlarmHistory" id="TbAlarmHistoryResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="alarmValue" column="alarm_value" />
|
||||
<result property="alarmWords" column="alarm_words" />
|
||||
<result property="alarmTime" column="alarm_time" />
|
||||
<result property="alarmLevel" column="alarm_level" />
|
||||
<result property="alarmLevelName" column="alarm_level_name" />
|
||||
<result property="alarmDataSources" column="alarm_data_sources" />
|
||||
<result property="alarmSourceCode" column="alarm_source_code" />
|
||||
<result property="alarmSourceName" column="alarm_source_name" />
|
||||
<result property="alarmTypeName" column="alarm_type_name" />
|
||||
<result property="alarmTypeCode" column="alarm_type_code" />
|
||||
<result property="alarmConfigCode" column="alarm_config_code" />
|
||||
<result property="alarmConfigName" column="alarm_config_name" />
|
||||
<result property="isShowBigScreen" column="is_show_big_screen" />
|
||||
<result property="isDisarmAlarm" column="is_disarm_alarm" />
|
||||
<result property="isDisarmType" column="is_disarm_type" />
|
||||
<result property="disarmAlarmBy" column="disarm_alarm_by" />
|
||||
<result property="disarmAlarmReason" column="disarm_alarm_reason" />
|
||||
<result property="disarmAlarmTime" column="disarm_alarm_time" />
|
||||
<result property="isHandleAlarm" column="is_handle_alarm" />
|
||||
<result property="handleAlarmBy" column="handle_alarm_by" />
|
||||
<result property="handleAlarmProcess" column="handle_alarm_process" />
|
||||
<result property="handleAlarmResult" column="handle_alarm_result" />
|
||||
<result property="handleAlarmTime" column="handle_alarm_time" />
|
||||
<result property="createBy" column="create_by" />
|
||||
<result property="createTime" column="create_time" />
|
||||
<result property="updateBy" column="update_by" />
|
||||
<result property="updateTime" column="update_time" />
|
||||
<result property="remark" column="remark" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectTbAlarmHistoryVo">
|
||||
select id, alarm_value, alarm_words, alarm_time, alarm_level, alarm_level_name, alarm_data_sources, alarm_source_code, alarm_source_name, alarm_type_name, alarm_type_code, alarm_config_code, alarm_config_name, is_show_big_screen, is_disarm_alarm, is_disarm_type, disarm_alarm_by, disarm_alarm_reason, disarm_alarm_time, is_handle_alarm, handle_alarm_by, handle_alarm_process, handle_alarm_result, handle_alarm_time, create_by, create_time, update_by, update_time, remark from tb_alarm_history
|
||||
</sql>
|
||||
|
||||
<!-- <select id="selectTbAlarmHistoryList" parameterType="TbAlarmHistory" resultMap="TbAlarmHistoryResult">-->
|
||||
<!-- <include refid="selectTbAlarmHistoryVo"/>-->
|
||||
<!-- <where> -->
|
||||
<!-- <if test="alarmValue != null "> and alarm_value = #{alarmValue}</if>-->
|
||||
<!-- <if test="alarmWords != null and alarmWords != ''"> and alarm_words = #{alarmWords}</if>-->
|
||||
<!-- <if test="alarmTime != null "> and alarm_time = #{alarmTime}</if>-->
|
||||
<!-- <if test="alarmLevel != null and alarmLevel != ''"> and alarm_level = #{alarmLevel}</if>-->
|
||||
<!-- <if test="alarmLevelName != null and alarmLevelName != ''"> and alarm_level_name like concat('%', #{alarmLevelName}, '%')</if>-->
|
||||
<!-- <if test="alarmDataSources != null and alarmDataSources != ''"> and alarm_data_sources = #{alarmDataSources}</if>-->
|
||||
<!-- <if test="alarmSourceCode != null and alarmSourceCode != ''"> and alarm_source_code = #{alarmSourceCode}</if>-->
|
||||
<!-- <if test="alarmSourceName != null and alarmSourceName != ''"> and alarm_source_name like concat('%', #{alarmSourceName}, '%')</if>-->
|
||||
<!-- <if test="alarmTypeName != null and alarmTypeName != ''"> and alarm_type_name like concat('%', #{alarmTypeName}, '%')</if>-->
|
||||
<!-- <if test="alarmTypeCode != null and alarmTypeCode != ''"> and alarm_type_code = #{alarmTypeCode}</if>-->
|
||||
<!-- <if test="alarmConfigCode != null and alarmConfigCode != ''"> and alarm_config_code = #{alarmConfigCode}</if>-->
|
||||
<!-- <if test="alarmConfigName != null and alarmConfigName != ''"> and alarm_config_name like concat('%', #{alarmConfigName}, '%')</if>-->
|
||||
<!-- <if test="isShowBigScreen != null and isShowBigScreen != ''"> and is_show_big_screen = #{isShowBigScreen}</if>-->
|
||||
<!-- <if test="isDisarmAlarm != null and isDisarmAlarm != ''"> and is_disarm_alarm = #{isDisarmAlarm}</if>-->
|
||||
<!-- <if test="isDisarmType != null and isDisarmType != ''"> and is_disarm_type = #{isDisarmType}</if>-->
|
||||
<!-- <if test="disarmAlarmBy != null and disarmAlarmBy != ''"> and disarm_alarm_by = #{disarmAlarmBy}</if>-->
|
||||
<!-- <if test="disarmAlarmReason != null and disarmAlarmReason != ''"> and disarm_alarm_reason = #{disarmAlarmReason}</if>-->
|
||||
<!-- <if test="disarmAlarmTime != null "> and disarm_alarm_time = #{disarmAlarmTime}</if>-->
|
||||
<!-- <if test="isHandleAlarm != null and isHandleAlarm != ''"> and is_handle_alarm = #{isHandleAlarm}</if>-->
|
||||
<!-- <if test="handleAlarmBy != null and handleAlarmBy != ''"> and handle_alarm_by = #{handleAlarmBy}</if>-->
|
||||
<!-- <if test="handleAlarmProcess != null and handleAlarmProcess != ''"> and handle_alarm_process = #{handleAlarmProcess}</if>-->
|
||||
<!-- <if test="handleAlarmResult != null and handleAlarmResult != ''"> and handle_alarm_result = #{handleAlarmResult}</if>-->
|
||||
<!-- <if test="handleAlarmTime != null "> and handle_alarm_time = #{handleAlarmTime}</if>-->
|
||||
<!-- </where>-->
|
||||
<!-- </select>-->
|
||||
<!-- -->
|
||||
<!-- <select id="selectTbAlarmHistoryById" parameterType="String" resultMap="TbAlarmHistoryResult">-->
|
||||
<!-- <include refid="selectTbAlarmHistoryVo"/>-->
|
||||
<!-- where id = #{id}-->
|
||||
<!-- </select>-->
|
||||
<!-- -->
|
||||
<!-- <insert id="insertTbAlarmHistory" parameterType="TbAlarmHistory">-->
|
||||
<!-- insert into tb_alarm_history-->
|
||||
<!-- <trim prefix="(" suffix=")" suffixOverrides=",">-->
|
||||
<!-- <if test="id != null">id,</if>-->
|
||||
<!-- <if test="alarmValue != null">alarm_value,</if>-->
|
||||
<!-- <if test="alarmWords != null">alarm_words,</if>-->
|
||||
<!-- <if test="alarmTime != null">alarm_time,</if>-->
|
||||
<!-- <if test="alarmLevel != null and alarmLevel != ''">alarm_level,</if>-->
|
||||
<!-- <if test="alarmLevelName != null">alarm_level_name,</if>-->
|
||||
<!-- <if test="alarmDataSources != null">alarm_data_sources,</if>-->
|
||||
<!-- <if test="alarmSourceCode != null and alarmSourceCode != ''">alarm_source_code,</if>-->
|
||||
<!-- <if test="alarmSourceName != null">alarm_source_name,</if>-->
|
||||
<!-- <if test="alarmTypeName != null">alarm_type_name,</if>-->
|
||||
<!-- <if test="alarmTypeCode != null and alarmTypeCode != ''">alarm_type_code,</if>-->
|
||||
<!-- <if test="alarmConfigCode != null">alarm_config_code,</if>-->
|
||||
<!-- <if test="alarmConfigName != null">alarm_config_name,</if>-->
|
||||
<!-- <if test="isShowBigScreen != null">is_show_big_screen,</if>-->
|
||||
<!-- <if test="isDisarmAlarm != null">is_disarm_alarm,</if>-->
|
||||
<!-- <if test="isDisarmType != null">is_disarm_type,</if>-->
|
||||
<!-- <if test="disarmAlarmBy != null">disarm_alarm_by,</if>-->
|
||||
<!-- <if test="disarmAlarmReason != null">disarm_alarm_reason,</if>-->
|
||||
<!-- <if test="disarmAlarmTime != null">disarm_alarm_time,</if>-->
|
||||
<!-- <if test="isHandleAlarm != null">is_handle_alarm,</if>-->
|
||||
<!-- <if test="handleAlarmBy != null">handle_alarm_by,</if>-->
|
||||
<!-- <if test="handleAlarmProcess != null">handle_alarm_process,</if>-->
|
||||
<!-- <if test="handleAlarmResult != null">handle_alarm_result,</if>-->
|
||||
<!-- <if test="handleAlarmTime != null">handle_alarm_time,</if>-->
|
||||
<!-- <if test="createBy != null">create_by,</if>-->
|
||||
<!-- <if test="createTime != null">create_time,</if>-->
|
||||
<!-- <if test="updateBy != null">update_by,</if>-->
|
||||
<!-- <if test="updateTime != null">update_time,</if>-->
|
||||
<!-- <if test="remark != null">remark,</if>-->
|
||||
<!-- </trim>-->
|
||||
<!-- <trim prefix="values (" suffix=")" suffixOverrides=",">-->
|
||||
<!-- <if test="id != null">#{id},</if>-->
|
||||
<!-- <if test="alarmValue != null">#{alarmValue},</if>-->
|
||||
<!-- <if test="alarmWords != null">#{alarmWords},</if>-->
|
||||
<!-- <if test="alarmTime != null">#{alarmTime},</if>-->
|
||||
<!-- <if test="alarmLevel != null and alarmLevel != ''">#{alarmLevel},</if>-->
|
||||
<!-- <if test="alarmLevelName != null">#{alarmLevelName},</if>-->
|
||||
<!-- <if test="alarmDataSources != null">#{alarmDataSources},</if>-->
|
||||
<!-- <if test="alarmSourceCode != null and alarmSourceCode != ''">#{alarmSourceCode},</if>-->
|
||||
<!-- <if test="alarmSourceName != null">#{alarmSourceName},</if>-->
|
||||
<!-- <if test="alarmTypeName != null">#{alarmTypeName},</if>-->
|
||||
<!-- <if test="alarmTypeCode != null and alarmTypeCode != ''">#{alarmTypeCode},</if>-->
|
||||
<!-- <if test="alarmConfigCode != null">#{alarmConfigCode},</if>-->
|
||||
<!-- <if test="alarmConfigName != null">#{alarmConfigName},</if>-->
|
||||
<!-- <if test="isShowBigScreen != null">#{isShowBigScreen},</if>-->
|
||||
<!-- <if test="isDisarmAlarm != null">#{isDisarmAlarm},</if>-->
|
||||
<!-- <if test="isDisarmType != null">#{isDisarmType},</if>-->
|
||||
<!-- <if test="disarmAlarmBy != null">#{disarmAlarmBy},</if>-->
|
||||
<!-- <if test="disarmAlarmReason != null">#{disarmAlarmReason},</if>-->
|
||||
<!-- <if test="disarmAlarmTime != null">#{disarmAlarmTime},</if>-->
|
||||
<!-- <if test="isHandleAlarm != null">#{isHandleAlarm},</if>-->
|
||||
<!-- <if test="handleAlarmBy != null">#{handleAlarmBy},</if>-->
|
||||
<!-- <if test="handleAlarmProcess != null">#{handleAlarmProcess},</if>-->
|
||||
<!-- <if test="handleAlarmResult != null">#{handleAlarmResult},</if>-->
|
||||
<!-- <if test="handleAlarmTime != null">#{handleAlarmTime},</if>-->
|
||||
<!-- <if test="createBy != null">#{createBy},</if>-->
|
||||
<!-- <if test="createTime != null">#{createTime},</if>-->
|
||||
<!-- <if test="updateBy != null">#{updateBy},</if>-->
|
||||
<!-- <if test="updateTime != null">#{updateTime},</if>-->
|
||||
<!-- <if test="remark != null">#{remark},</if>-->
|
||||
<!-- </trim>-->
|
||||
<!-- </insert>-->
|
||||
|
||||
<!-- <update id="updateTbAlarmHistory" parameterType="TbAlarmHistory">-->
|
||||
<!-- update tb_alarm_history-->
|
||||
<!-- <trim prefix="SET" suffixOverrides=",">-->
|
||||
<!-- <if test="alarmValue != null">alarm_value = #{alarmValue},</if>-->
|
||||
<!-- <if test="alarmWords != null">alarm_words = #{alarmWords},</if>-->
|
||||
<!-- <if test="alarmTime != null">alarm_time = #{alarmTime},</if>-->
|
||||
<!-- <if test="alarmLevel != null and alarmLevel != ''">alarm_level = #{alarmLevel},</if>-->
|
||||
<!-- <if test="alarmLevelName != null">alarm_level_name = #{alarmLevelName},</if>-->
|
||||
<!-- <if test="alarmDataSources != null">alarm_data_sources = #{alarmDataSources},</if>-->
|
||||
<!-- <if test="alarmSourceCode != null and alarmSourceCode != ''">alarm_source_code = #{alarmSourceCode},</if>-->
|
||||
<!-- <if test="alarmSourceName != null">alarm_source_name = #{alarmSourceName},</if>-->
|
||||
<!-- <if test="alarmTypeName != null">alarm_type_name = #{alarmTypeName},</if>-->
|
||||
<!-- <if test="alarmTypeCode != null and alarmTypeCode != ''">alarm_type_code = #{alarmTypeCode},</if>-->
|
||||
<!-- <if test="alarmConfigCode != null">alarm_config_code = #{alarmConfigCode},</if>-->
|
||||
<!-- <if test="alarmConfigName != null">alarm_config_name = #{alarmConfigName},</if>-->
|
||||
<!-- <if test="isShowBigScreen != null">is_show_big_screen = #{isShowBigScreen},</if>-->
|
||||
<!-- <if test="isDisarmAlarm != null">is_disarm_alarm = #{isDisarmAlarm},</if>-->
|
||||
<!-- <if test="isDisarmType != null">is_disarm_type = #{isDisarmType},</if>-->
|
||||
<!-- <if test="disarmAlarmBy != null">disarm_alarm_by = #{disarmAlarmBy},</if>-->
|
||||
<!-- <if test="disarmAlarmReason != null">disarm_alarm_reason = #{disarmAlarmReason},</if>-->
|
||||
<!-- <if test="disarmAlarmTime != null">disarm_alarm_time = #{disarmAlarmTime},</if>-->
|
||||
<!-- <if test="isHandleAlarm != null">is_handle_alarm = #{isHandleAlarm},</if>-->
|
||||
<!-- <if test="handleAlarmBy != null">handle_alarm_by = #{handleAlarmBy},</if>-->
|
||||
<!-- <if test="handleAlarmProcess != null">handle_alarm_process = #{handleAlarmProcess},</if>-->
|
||||
<!-- <if test="handleAlarmResult != null">handle_alarm_result = #{handleAlarmResult},</if>-->
|
||||
<!-- <if test="handleAlarmTime != null">handle_alarm_time = #{handleAlarmTime},</if>-->
|
||||
<!-- <if test="createBy != null">create_by = #{createBy},</if>-->
|
||||
<!-- <if test="createTime != null">create_time = #{createTime},</if>-->
|
||||
<!-- <if test="updateBy != null">update_by = #{updateBy},</if>-->
|
||||
<!-- <if test="updateTime != null">update_time = #{updateTime},</if>-->
|
||||
<!-- <if test="remark != null">remark = #{remark},</if>-->
|
||||
<!-- </trim>-->
|
||||
<!-- where id = #{id}-->
|
||||
<!-- </update>-->
|
||||
|
||||
<!-- <delete id="deleteTbAlarmHistoryById" parameterType="String">-->
|
||||
<!-- delete from tb_alarm_history where id = #{id}-->
|
||||
<!-- </delete>-->
|
||||
|
||||
<!-- <delete id="deleteTbAlarmHistoryByIds" parameterType="String">-->
|
||||
<!-- delete from tb_alarm_history where id in -->
|
||||
<!-- <foreach item="id" collection="array" open="(" separator="," close=")">-->
|
||||
<!-- #{id}-->
|
||||
<!-- </foreach>-->
|
||||
<!-- </delete>-->
|
||||
</mapper>
|
|
@ -0,0 +1,126 @@
|
|||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.wms.alarm.mapper.TbAlarmRealtimeMapper">
|
||||
|
||||
<resultMap type="com.wms.alarm.domain.TbAlarmRealtime" id="TbAlarmRealtimeResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="alarmValue" column="alarm_value" />
|
||||
<result property="alarmWords" column="alarm_words" />
|
||||
<result property="alarmTime" column="alarm_time" />
|
||||
<result property="alarmLevel" column="alarm_level" />
|
||||
<result property="alarmLevelName" column="alarm_level_name" />
|
||||
<result property="alarmDataSources" column="alarm_data_sources" />
|
||||
<result property="alarmSourceCode" column="alarm_source_code" />
|
||||
<result property="alarmSourceName" column="alarm_source_name" />
|
||||
<result property="alarmTypeCode" column="alarm_type_code" />
|
||||
<result property="alarmTypeName" column="alarm_type_name" />
|
||||
<result property="alarmConfigCode" column="alarm_config_code" />
|
||||
<result property="alarmConfigName" column="alarm_config_name" />
|
||||
<result property="isShowBigScreen" column="is_show_big_screen" />
|
||||
<result property="createBy" column="create_by" />
|
||||
<result property="createTime" column="create_time" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectTbAlarmRealtimeVo">
|
||||
select id, alarm_value, alarm_words, alarm_time, alarm_level, alarm_level_name, alarm_data_sources, alarm_source_code, alarm_source_name, alarm_type_code, alarm_type_name, alarm_config_code, alarm_config_name, is_show_big_screen, create_by, create_time from tb_alarm_realtime
|
||||
</sql>
|
||||
|
||||
<!-- <select id="selectTbAlarmRealtimeList" parameterType="com.wms.alarm.domain.TbAlarmRealtime" resultMap="TbAlarmRealtimeResult">-->
|
||||
<!-- <include refid="selectTbAlarmRealtimeVo"/>-->
|
||||
<!-- <where> -->
|
||||
<!-- <if test="alarmValue != null "> and alarm_value = #{alarmValue}</if>-->
|
||||
<!-- <if test="alarmWords != null and alarmWords != ''"> and alarm_words = #{alarmWords}</if>-->
|
||||
<!-- <if test="alarmTime != null "> and alarm_time = #{alarmTime}</if>-->
|
||||
<!-- <if test="alarmLevel != null and alarmLevel != ''"> and alarm_level = #{alarmLevel}</if>-->
|
||||
<!-- <if test="alarmLevelName != null and alarmLevelName != ''"> and alarm_level_name like concat('%', #{alarmLevelName}, '%')</if>-->
|
||||
<!-- <if test="alarmDataSources != null and alarmDataSources != ''"> and alarm_data_sources = #{alarmDataSources}</if>-->
|
||||
<!-- <if test="alarmSourceCode != null and alarmSourceCode != ''"> and alarm_source_code = #{alarmSourceCode}</if>-->
|
||||
<!-- <if test="alarmSourceName != null and alarmSourceName != ''"> and alarm_source_name like concat('%', #{alarmSourceName}, '%')</if>-->
|
||||
<!-- <if test="alarmTypeCode != null and alarmTypeCode != ''"> and alarm_type_code = #{alarmTypeCode}</if>-->
|
||||
<!-- <if test="alarmTypeName != null and alarmTypeName != ''"> and alarm_type_name like concat('%', #{alarmTypeName}, '%')</if>-->
|
||||
<!-- <if test="alarmConfigCode != null and alarmConfigCode != ''"> and alarm_config_code = #{alarmConfigCode}</if>-->
|
||||
<!-- <if test="alarmConfigName != null and alarmConfigName != ''"> and alarm_config_name like concat('%', #{alarmConfigName}, '%')</if>-->
|
||||
<!-- <if test="isShowBigScreen != null and isShowBigScreen != ''"> and is_show_big_screen = #{isShowBigScreen}</if>-->
|
||||
<!-- </where>-->
|
||||
<!-- </select>-->
|
||||
<!-- -->
|
||||
<!-- <select id="selectTbAlarmRealtimeById" parameterType="String" resultMap="TbAlarmRealtimeResult">-->
|
||||
<!-- <include refid="selectTbAlarmRealtimeVo"/>-->
|
||||
<!-- where id = #{id}-->
|
||||
<!-- </select>-->
|
||||
<!-- -->
|
||||
<!-- <insert id="insertTbAlarmRealtime" parameterType="com.wms.alarm.domain.TbAlarmRealtime">-->
|
||||
<!-- insert into tb_alarm_realtime-->
|
||||
<!-- <trim prefix="(" suffix=")" suffixOverrides=",">-->
|
||||
<!-- <if test="id != null">id,</if>-->
|
||||
<!-- <if test="alarmValue != null">alarm_value,</if>-->
|
||||
<!-- <if test="alarmWords != null">alarm_words,</if>-->
|
||||
<!-- <if test="alarmTime != null">alarm_time,</if>-->
|
||||
<!-- <if test="alarmLevel != null and alarmLevel != ''">alarm_level,</if>-->
|
||||
<!-- <if test="alarmLevelName != null">alarm_level_name,</if>-->
|
||||
<!-- <if test="alarmDataSources != null">alarm_data_sources,</if>-->
|
||||
<!-- <if test="alarmSourceCode != null and alarmSourceCode != ''">alarm_source_code,</if>-->
|
||||
<!-- <if test="alarmSourceName != null">alarm_source_name,</if>-->
|
||||
<!-- <if test="alarmTypeCode != null">alarm_type_code,</if>-->
|
||||
<!-- <if test="alarmTypeName != null">alarm_type_name,</if>-->
|
||||
<!-- <if test="alarmConfigCode != null and alarmConfigCode != ''">alarm_config_code,</if>-->
|
||||
<!-- <if test="alarmConfigName != null">alarm_config_name,</if>-->
|
||||
<!-- <if test="isShowBigScreen != null">is_show_big_screen,</if>-->
|
||||
<!-- <if test="createBy != null">create_by,</if>-->
|
||||
<!-- <if test="createTime != null">create_time,</if>-->
|
||||
<!-- </trim>-->
|
||||
<!-- <trim prefix="values (" suffix=")" suffixOverrides=",">-->
|
||||
<!-- <if test="id != null">#{id},</if>-->
|
||||
<!-- <if test="alarmValue != null">#{alarmValue},</if>-->
|
||||
<!-- <if test="alarmWords != null">#{alarmWords},</if>-->
|
||||
<!-- <if test="alarmTime != null">#{alarmTime},</if>-->
|
||||
<!-- <if test="alarmLevel != null and alarmLevel != ''">#{alarmLevel},</if>-->
|
||||
<!-- <if test="alarmLevelName != null">#{alarmLevelName},</if>-->
|
||||
<!-- <if test="alarmDataSources != null">#{alarmDataSources},</if>-->
|
||||
<!-- <if test="alarmSourceCode != null and alarmSourceCode != ''">#{alarmSourceCode},</if>-->
|
||||
<!-- <if test="alarmSourceName != null">#{alarmSourceName},</if>-->
|
||||
<!-- <if test="alarmTypeCode != null">#{alarmTypeCode},</if>-->
|
||||
<!-- <if test="alarmTypeName != null">#{alarmTypeName},</if>-->
|
||||
<!-- <if test="alarmConfigCode != null and alarmConfigCode != ''">#{alarmConfigCode},</if>-->
|
||||
<!-- <if test="alarmConfigName != null">#{alarmConfigName},</if>-->
|
||||
<!-- <if test="isShowBigScreen != null">#{isShowBigScreen},</if>-->
|
||||
<!-- <if test="createBy != null">#{createBy},</if>-->
|
||||
<!-- <if test="createTime != null">#{createTime},</if>-->
|
||||
<!-- </trim>-->
|
||||
<!-- </insert>-->
|
||||
|
||||
<!-- <update id="updateTbAlarmRealtime" parameterType="com.wms.alarm.domain.TbAlarmRealtime">-->
|
||||
<!-- update tb_alarm_realtime-->
|
||||
<!-- <trim prefix="SET" suffixOverrides=",">-->
|
||||
<!-- <if test="alarmValue != null">alarm_value = #{alarmValue},</if>-->
|
||||
<!-- <if test="alarmWords != null">alarm_words = #{alarmWords},</if>-->
|
||||
<!-- <if test="alarmTime != null">alarm_time = #{alarmTime},</if>-->
|
||||
<!-- <if test="alarmLevel != null and alarmLevel != ''">alarm_level = #{alarmLevel},</if>-->
|
||||
<!-- <if test="alarmLevelName != null">alarm_level_name = #{alarmLevelName},</if>-->
|
||||
<!-- <if test="alarmDataSources != null">alarm_data_sources = #{alarmDataSources},</if>-->
|
||||
<!-- <if test="alarmSourceCode != null and alarmSourceCode != ''">alarm_source_code = #{alarmSourceCode},</if>-->
|
||||
<!-- <if test="alarmSourceName != null">alarm_source_name = #{alarmSourceName},</if>-->
|
||||
<!-- <if test="alarmTypeCode != null">alarm_type_code = #{alarmTypeCode},</if>-->
|
||||
<!-- <if test="alarmTypeName != null">alarm_type_name = #{alarmTypeName},</if>-->
|
||||
<!-- <if test="alarmConfigCode != null and alarmConfigCode != ''">alarm_config_code = #{alarmConfigCode},</if>-->
|
||||
<!-- <if test="alarmConfigName != null">alarm_config_name = #{alarmConfigName},</if>-->
|
||||
<!-- <if test="isShowBigScreen != null">is_show_big_screen = #{isShowBigScreen},</if>-->
|
||||
<!-- <if test="createBy != null">create_by = #{createBy},</if>-->
|
||||
<!-- <if test="createTime != null">create_time = #{createTime},</if>-->
|
||||
<!-- </trim>-->
|
||||
<!-- where id = #{id}-->
|
||||
<!-- </update>-->
|
||||
|
||||
<!-- <delete id="deleteTbAlarmRealtimeById" parameterType="String">-->
|
||||
<!-- delete from tb_alarm_realtime where id = #{id}-->
|
||||
<!-- </delete>-->
|
||||
|
||||
<!-- <delete id="deleteTbAlarmRealtimeByIds" parameterType="String">-->
|
||||
<!-- delete from tb_alarm_realtime where id in -->
|
||||
<!-- <foreach item="id" collection="array" open="(" separator="," close=")">-->
|
||||
<!-- #{id}-->
|
||||
<!-- </foreach>-->
|
||||
<!-- </delete>-->
|
||||
</mapper>
|
|
@ -0,0 +1,83 @@
|
|||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.wms.alarm.mapper.TbAlarmSourceMapper">
|
||||
|
||||
<resultMap type="com.wms.alarm.domain.TbAlarmSource" id="TbAlarmSourceResult">
|
||||
<result property="alarmSourceCode" column="alarm_source_code" />
|
||||
<result property="alarmSourceName" column="alarm_source_name" />
|
||||
<result property="status" column="status" />
|
||||
<result property="createBy" column="create_by" />
|
||||
<result property="createTime" column="create_time" />
|
||||
<result property="updateBy" column="update_by" />
|
||||
<result property="updateTime" column="update_time" />
|
||||
<result property="remark" column="remark" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectTbAlarmSourceVo">
|
||||
select alarm_source_code, alarm_source_name, status, create_by, create_time, update_by, update_time, remark from tb_alarm_source
|
||||
</sql>
|
||||
|
||||
<!-- <select id="selectTbAlarmSourceList" parameterType="com.wms.alarm.domain.TbAlarmSource" resultMap="TbAlarmSourceResult">-->
|
||||
<!-- <include refid="selectTbAlarmSourceVo"/>-->
|
||||
<!-- <where> -->
|
||||
<!-- <if test="alarmSourceName != null and alarmSourceName != ''"> and alarm_source_name like concat('%', #{alarmSourceName}, '%')</if>-->
|
||||
<!-- <if test="status != null and status != ''"> and status = #{status}</if>-->
|
||||
<!-- </where>-->
|
||||
<!-- </select>-->
|
||||
<!-- -->
|
||||
<!-- <select id="selectTbAlarmSourceByAlarmSourceCode" parameterType="String" resultMap="TbAlarmSourceResult">-->
|
||||
<!-- <include refid="selectTbAlarmSourceVo"/>-->
|
||||
<!-- where alarm_source_code = #{alarmSourceCode}-->
|
||||
<!-- </select>-->
|
||||
<!-- -->
|
||||
<!-- <insert id="insertTbAlarmSource" parameterType="com.wms.alarm.domain.TbAlarmSource">-->
|
||||
<!-- insert into tb_alarm_source-->
|
||||
<!-- <trim prefix="(" suffix=")" suffixOverrides=",">-->
|
||||
<!-- <if test="alarmSourceCode != null">alarm_source_code,</if>-->
|
||||
<!-- <if test="alarmSourceName != null and alarmSourceName != ''">alarm_source_name,</if>-->
|
||||
<!-- <if test="status != null">status,</if>-->
|
||||
<!-- <if test="createBy != null">create_by,</if>-->
|
||||
<!-- <if test="createTime != null">create_time,</if>-->
|
||||
<!-- <if test="updateBy != null">update_by,</if>-->
|
||||
<!-- <if test="updateTime != null">update_time,</if>-->
|
||||
<!-- <if test="remark != null">remark,</if>-->
|
||||
<!-- </trim>-->
|
||||
<!-- <trim prefix="values (" suffix=")" suffixOverrides=",">-->
|
||||
<!-- <if test="alarmSourceCode != null">#{alarmSourceCode},</if>-->
|
||||
<!-- <if test="alarmSourceName != null and alarmSourceName != ''">#{alarmSourceName},</if>-->
|
||||
<!-- <if test="status != null">#{status},</if>-->
|
||||
<!-- <if test="createBy != null">#{createBy},</if>-->
|
||||
<!-- <if test="createTime != null">#{createTime},</if>-->
|
||||
<!-- <if test="updateBy != null">#{updateBy},</if>-->
|
||||
<!-- <if test="updateTime != null">#{updateTime},</if>-->
|
||||
<!-- <if test="remark != null">#{remark},</if>-->
|
||||
<!-- </trim>-->
|
||||
<!-- </insert>-->
|
||||
|
||||
<!-- <update id="updateTbAlarmSource" parameterType="com.wms.alarm.domain.TbAlarmSource">-->
|
||||
<!-- update tb_alarm_source-->
|
||||
<!-- <trim prefix="SET" suffixOverrides=",">-->
|
||||
<!-- <if test="alarmSourceName != null and alarmSourceName != ''">alarm_source_name = #{alarmSourceName},</if>-->
|
||||
<!-- <if test="status != null">status = #{status},</if>-->
|
||||
<!-- <if test="createBy != null">create_by = #{createBy},</if>-->
|
||||
<!-- <if test="createTime != null">create_time = #{createTime},</if>-->
|
||||
<!-- <if test="updateBy != null">update_by = #{updateBy},</if>-->
|
||||
<!-- <if test="updateTime != null">update_time = #{updateTime},</if>-->
|
||||
<!-- <if test="remark != null">remark = #{remark},</if>-->
|
||||
<!-- </trim>-->
|
||||
<!-- where alarm_source_code = #{alarmSourceCode}-->
|
||||
<!-- </update>-->
|
||||
|
||||
<!-- <delete id="deleteTbAlarmSourceByAlarmSourceCode" parameterType="String">-->
|
||||
<!-- delete from tb_alarm_source where alarm_source_code = #{alarmSourceCode}-->
|
||||
<!-- </delete>-->
|
||||
|
||||
<!-- <delete id="deleteTbAlarmSourceByAlarmSourceCodes" parameterType="String">-->
|
||||
<!-- delete from tb_alarm_source where alarm_source_code in -->
|
||||
<!-- <foreach item="alarmSourceCode" collection="array" open="(" separator="," close=")">-->
|
||||
<!-- #{alarmSourceCode}-->
|
||||
<!-- </foreach>-->
|
||||
<!-- </delete>-->
|
||||
</mapper>
|
|
@ -0,0 +1,91 @@
|
|||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.wms.alarm.mapper.TbAlarmStockConfigMapper">
|
||||
|
||||
<resultMap type="TbAlarmStockConfig" id="TbAlarmStockConfigResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="alarmCode" column="alarm_code" />
|
||||
<result property="articleId" column="article_id" />
|
||||
<result property="stockAlarmType" column="stock_alarm_type" />
|
||||
<result property="alarmValue" column="alarm_value" />
|
||||
<result property="createBy" column="create_by" />
|
||||
<result property="createTime" column="create_time" />
|
||||
<result property="updateBy" column="update_by" />
|
||||
<result property="updateTime" column="update_time" />
|
||||
<result property="remark" column="remark" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectTbAlarmStockConfigVo">
|
||||
select id, alarm_code, article_id, stock_alarm_type, alarm_value, create_by, create_time, update_by, update_time, remark from tb_alarm_stock_config
|
||||
</sql>
|
||||
|
||||
<select id="selectTbAlarmStockConfigList" parameterType="TbAlarmStockConfig" resultMap="TbAlarmStockConfigResult">
|
||||
<include refid="selectTbAlarmStockConfigVo"/>
|
||||
<where>
|
||||
<if test="alarmCode != null and alarmCode != ''"> and alarm_code = #{alarmCode}</if>
|
||||
<if test="articleId != null and articleId != ''"> and article_id = #{articleId}</if>
|
||||
<if test="stockAlarmType != null and stockAlarmType != ''"> and stock_alarm_type = #{stockAlarmType}</if>
|
||||
<if test="alarmValue != null "> and alarm_value = #{alarmValue}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectTbAlarmStockConfigById" parameterType="Long" resultMap="TbAlarmStockConfigResult">
|
||||
<include refid="selectTbAlarmStockConfigVo"/>
|
||||
where id = #{id}
|
||||
</select>
|
||||
|
||||
<insert id="insertTbAlarmStockConfig" parameterType="TbAlarmStockConfig" useGeneratedKeys="true" keyProperty="id">
|
||||
insert into tb_alarm_stock_config
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="alarmCode != null and alarmCode != ''">alarm_code,</if>
|
||||
<if test="articleId != null and articleId != ''">article_id,</if>
|
||||
<if test="stockAlarmType != null and stockAlarmType != ''">stock_alarm_type,</if>
|
||||
<if test="alarmValue != null">alarm_value,</if>
|
||||
<if test="createBy != null">create_by,</if>
|
||||
<if test="createTime != null">create_time,</if>
|
||||
<if test="updateBy != null">update_by,</if>
|
||||
<if test="updateTime != null">update_time,</if>
|
||||
<if test="remark != null">remark,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="alarmCode != null and alarmCode != ''">#{alarmCode},</if>
|
||||
<if test="articleId != null and articleId != ''">#{articleId},</if>
|
||||
<if test="stockAlarmType != null and stockAlarmType != ''">#{stockAlarmType},</if>
|
||||
<if test="alarmValue != null">#{alarmValue},</if>
|
||||
<if test="createBy != null">#{createBy},</if>
|
||||
<if test="createTime != null">#{createTime},</if>
|
||||
<if test="updateBy != null">#{updateBy},</if>
|
||||
<if test="updateTime != null">#{updateTime},</if>
|
||||
<if test="remark != null">#{remark},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateTbAlarmStockConfig" parameterType="TbAlarmStockConfig">
|
||||
update tb_alarm_stock_config
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="alarmCode != null and alarmCode != ''">alarm_code = #{alarmCode},</if>
|
||||
<if test="articleId != null and articleId != ''">article_id = #{articleId},</if>
|
||||
<if test="stockAlarmType != null and stockAlarmType != ''">stock_alarm_type = #{stockAlarmType},</if>
|
||||
<if test="alarmValue != null">alarm_value = #{alarmValue},</if>
|
||||
<if test="createBy != null">create_by = #{createBy},</if>
|
||||
<if test="createTime != null">create_time = #{createTime},</if>
|
||||
<if test="updateBy != null">update_by = #{updateBy},</if>
|
||||
<if test="updateTime != null">update_time = #{updateTime},</if>
|
||||
<if test="remark != null">remark = #{remark},</if>
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<delete id="deleteTbAlarmStockConfigById" parameterType="Long">
|
||||
delete from tb_alarm_stock_config where id = #{id}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteTbAlarmStockConfigByIds" parameterType="String">
|
||||
delete from tb_alarm_stock_config where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
</mapper>
|
|
@ -0,0 +1,22 @@
|
|||
# 告诉EditorConfig插件,这是根文件,不用继续往上查找
|
||||
root = true
|
||||
|
||||
# 匹配全部文件
|
||||
[*]
|
||||
# 设置字符集
|
||||
charset = utf-8
|
||||
# 缩进风格,可选space、tab
|
||||
indent_style = space
|
||||
# 缩进的空格数
|
||||
indent_size = 2
|
||||
# 结尾换行符,可选lf、cr、crlf
|
||||
end_of_line = lf
|
||||
# 在文件结尾插入新行
|
||||
insert_final_newline = true
|
||||
# 删除一行中的前后空格
|
||||
trim_trailing_whitespace = true
|
||||
|
||||
# 匹配md结尾的文件
|
||||
[*.md]
|
||||
insert_final_newline = false
|
||||
trim_trailing_whitespace = false
|
|
@ -0,0 +1,11 @@
|
|||
# 页面标题
|
||||
VUE_APP_TITLE = Wms基础管理系统
|
||||
|
||||
# 开发环境配置
|
||||
ENV = 'development'
|
||||
|
||||
# Wms管理系统/开发环境
|
||||
VUE_APP_BASE_API = '/dev-api'
|
||||
|
||||
# 路由懒加载
|
||||
VUE_CLI_BABEL_TRANSPILE_MODULES = true
|
|
@ -0,0 +1,8 @@
|
|||
# 页面标题
|
||||
VUE_APP_TITLE = Wms基础管理系统
|
||||
|
||||
# 生产环境配置
|
||||
ENV = 'production'
|
||||
|
||||
# Wms管理系统/生产环境
|
||||
VUE_APP_BASE_API = '/prod-api'
|
|
@ -0,0 +1,10 @@
|
|||
# 页面标题
|
||||
VUE_APP_TITLE = Wms基础管理系统
|
||||
|
||||
NODE_ENV = production
|
||||
|
||||
# 测试环境配置
|
||||
ENV = 'staging'
|
||||
|
||||
# 管理系统/测试环境
|
||||
VUE_APP_BASE_API = '/stage-api'
|
|
@ -0,0 +1,10 @@
|
|||
# 忽略build目录下类型为js的文件的语法检查
|
||||
build/*.js
|
||||
# 忽略src/assets目录下文件的语法检查
|
||||
src/assets
|
||||
# 忽略public目录下文件的语法检查
|
||||
public
|
||||
# 忽略当前目录下为js的文件的语法检查
|
||||
*.js
|
||||
# 忽略当前目录下为vue的文件的语法检查
|
||||
*.vue
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue