diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..25b312e --- /dev/null +++ b/.editorconfig @@ -0,0 +1,18 @@ +# http://editorconfig.org +root = true + +# 空格替代Tab缩进在各种编辑工具下效果一致 +[*] +indent_style = space +indent_size = 4 +charset = utf-8 +end_of_line = lf +trim_trailing_whitespace = true +insert_final_newline = true + +[*.{json,yml,yaml}] +indent_size = 2 + +[*.md] +insert_final_newline = false +trim_trailing_whitespace = false diff --git a/.gitignore b/.gitignore index ff6b524..790500a 100644 --- a/.gitignore +++ b/.gitignore @@ -25,11 +25,13 @@ target/ *.iml *.ipr +### JRebel ### +rebel.xml + ### NetBeans ### nbproject/private/ build/* nbbuild/ -dist/ nbdist/ .nb-gradle/ @@ -42,7 +44,6 @@ nbdist/ !*/build/*.java !*/build/*.html !*/build/*.xml -/sql/local.sql -*local* -/ruoyi-admin/src/main/resources/application-dev.yml -/ruoyi-admin/src/main/resources/application-prod.yml +application-local.yml + +.flattened-pom.xml diff --git a/LICENSE b/LICENSE index 8564f29..907774e 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright (c) 2018 RuoYi +Copyright (c) 2024 ruoyi-fast-service 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 @@ -17,4 +17,4 @@ 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. \ No newline at end of file +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/README.md b/README.md index cf6e8c8..9422dce 100644 --- a/README.md +++ b/README.md @@ -1,75 +1,95 @@ -## 若依wms简介 -若依wms是一套基于若依的wms仓库管理系统,支持lodop和网页打印入库单、出库单。毫无保留给个人及企业免费使用。 -* 前端采用Vue、Element UI(ant design 正在开发中)。 -* 后端采用Spring Boot、Spring Security、Redis & Jwt。 -* 权限认证使用Jwt,支持多终端认证系统。 -* 支持加载动态权限菜单,多方式轻松权限控制。 -* 高效率开发,使用代码生成器可以一键生成前后端代码。 -## 代码自动生成 -修改application.yml文件中的backPath和frontPath路径。 -backPath:为后端项目路径 -frontPath:为前端项目路径 +## 平台简介 + +[![License](https://img.shields.io/badge/License-MIT-blue.svg)](https://gitee.com/dromara/RuoYi-Vue-Plus/blob/master/LICENSE) +[![Spring Boot](https://img.shields.io/badge/Spring%20Boot-3.1-blue.svg)]() +[![JDK-17](https://img.shields.io/badge/JDK-17-green.svg)]() + +> 本项目继承自ruoyi-vue-plus,由于ruoyi-vue-plus 4.x版本不再开发,而5.x过于庞大,增加了flowable和多租户,本项目在4.x基础上适当增加一些5.x比较好的功能。 + + +> 项目代码、文档 均开源免费可商用 遵循开源协议在项目中保留开源协议文件即可
+活到老写到老 为兴趣而开源 为学习而开源 为让大家真正可以学到技术而开源 + +## 更新记录 +参考:[UpdateHistory.md](UpdateHistory.md) ## 前端项目地址 -### gitee -https://gitee.com/zccbbg/ruo-yi-wms-vue -### github -https://github.com/zccbbg/RuoYi-WMS-VUE +#### gitee +[https://gitee.com/zccbbg/ruoyi-fast-vue3](https://gitee.com/zccbbg/ruoyi-fast-vue3) -## 在线体验 -- 演示地址:http://wms.ichengle.top -- 陆陆续续收到一些打赏,为了更好的体验已用于演示服务器升级。谢谢各位小伙伴。 +#### github +[https://github.com/zccbbg/ruoyi-fast-vue3](https://github.com/zccbbg/ruoyi-fast-vue3) -## CSDN若依技术专栏 -- 常见问题:https://blog.csdn.net/qq_27575627/category_12336113.html -- 后端技术:https://blog.csdn.net/qq_27575627/category_12331868.html -- 前端技术:https://blog.csdn.net/qq_27575627/category_12331867.html -- 运维:https://blog.csdn.net/qq_27575627/category_12332546.html +## 本框架与RuoYi的功能差异 -## B站视频介绍 -https://www.bilibili.com/video/BV1ys4y1q7uG +| 功能 | 本框架 | RuoYi | +|-------------|-------------------------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------| +| 前端项目 | 基于vue3-element-admin开源项目重写
Vue3 + TS + ElementPlus | 基于Vue2/Vue3 + JS | +| 后端项目结构 | 采用插件化 + 扩展包形式 结构解耦 易于扩展 | 模块相互注入耦合严重难以扩展 | +| 后端代码风格 | 严格遵守Alibaba规范与项目统一配置的代码格式化 | 代码书写与常规结构不同阅读障碍大 | +| Web容器 | 采用 Undertow 基于 XNIO 的高性能容器 | 采用 Tomcat | +| 权限认证 | 采用 Sa-Token、Jwt 静态使用功能齐全 低耦合 高扩展 | Spring Security 配置繁琐扩展性极差 | +| 权限注解 | 采用 Sa-Token 支持注解 登录校验、角色校验、权限校验、二级认证校验、HttpBasic校验、忽略校验
角色与权限校验支持多种条件 如 `AND` `OR` 或 `权限 OR 角色` 等复杂表达式 | 只支持是否存在匹配 | +| 关系数据库支持 | 原生支持 MySQL、Oracle、PostgreSQL、SQLServer
可同时使用异构切换 | 支持 Mysql、Oracle 不支持同时使用、不支持异构切换 | +| 缓存数据库 | 支持 Redis 5-7 支持大部分新功能特性 如 分布式限流、分布式队列 | Redis 简单 get set 支持 | +| Redis客户端 | 采用 Redisson Redis官方推荐 基于Netty的客户端工具
支持Redis 90%以上的命令 底层优化规避很多不正确的用法 例如: keys被转换为scan
支持单机、哨兵、单主集群、多主集群等模式 | Lettuce + RedisTemplate 支持模式少 工具使用繁琐
连接池采用 common-pool Bug多经常性出问题 | +| 缓存注解 | 采用 Spring-Cache 注解 对其扩展了实现支持了更多功能
例如 过期时间 最大空闲时间 组最大长度等 只需一个注解即可完成数据自动缓存 | 需手动编写Redis代码逻辑 | +| ORM框架 | 采用 Mybatis-Plus 基于对象几乎不用写SQL全java操作 功能强大插件众多
例如多租户插件 分页插件 乐观锁插件等等 | 采用 Mybatis 基于XML需要手写SQL | +| SQL监控 | 采用 p6spy 可输出完整SQL与执行时间监控 | log输出 需手动拼接sql与参数无法快速查看调试问题 | +| 数据分页 | 采用 Mybatis-Plus 分页插件
框架对其进行了扩展 对象化分页对象 支持多种方式传参 支持前端多排序 复杂排序 | 采用 PageHelper 仅支持单查询分页 参数只能从param传 只能单排序 功能扩展性差 体验不好 | +| 数据权限 | 采用 Mybatis-Plus 插件 自行分析拼接SQL 无感式过滤
只需为Mapper设置好注解条件 支持多种自定义 不限于部门角色 | 采用 注解+aop 实现 基于部门角色 生成的sql兼容性差 不支持其他业务扩展
生成sql后需手动拼接到具体业务sql上 对于多个Mapper查询不起作用 | +| 数据脱敏 | 采用 注解 + jackson 序列化期间脱敏 支持不同模块不同的脱敏条件
支持多种策略 如身份证、手机号、地址、邮箱、银行卡等 可自行扩展 | 无 | +| 数据加解密 | 采用 注解 + mybatis 拦截器 对存取数据期间自动加解密
支持多种策略 如BASE64、AES、RSA、SM2、SM4等 | 无 | +| 数据翻译 | 采用 注解 + jackson 序列化期间动态修改数据 数据进行翻译
支持多种模式: `映射翻译` `直接翻译` `其他扩展条件翻译` 接口化两步即可完成自定义扩展 内置多种翻译实现 | 无 | +| 多数据源框架 | 采用 dynamic-datasource 支持世面大部分数据库
通过yml配置即可动态管理异构不同种类的数据库 也可通过前端页面添加数据源
支持spel表达式从请求头参数等条件切换数据源 | 基于 druid 手动编写代码配置数据源 配置繁琐 支持性差 | +| 多数据源事务 | 采用 dynamic-datasource 支持多数据源不同种类的数据库事务回滚 | 不支持 | +| 数据库连接池 | 采用 HikariCP Spring官方内置连接池 配置简单 以性能与稳定性闻名天下 | 采用 druid bug众多 社区维护差 活跃度低 配置众多繁琐性能一般 | +| 数据库主键 | 采用 雪花ID 基于时间戳的 有序增长 唯一ID 再也不用为分库分表 数据合并主键冲突重复而发愁 | 采用 数据库自增ID 支持数据量有限 不支持多数据源主键唯一 | +| 序列化 | 采用 Jackson Spring官方内置序列化 靠谱!!! | 采用 fastjson bugjson 远近闻名 | +| 分布式幂等 | 参考美团GTIS防重系统简化实现(细节可看文档) | 手动编写注解基于aop实现 | +| 分布式任务调度 | 采用 Xxl-Job 天生支持分布式 统一的管理中心 | 采用 Quartz 基于数据库锁性能差 集群需要做很多配置与改造 | +| 文件存储 | 采用 Minio 分布式文件存储 天生支持多机、多硬盘、多分片、多副本存储
支持权限管理 安全可靠 文件可加密存储 | 采用 本机文件存储 文件裸漏 易丢失泄漏 不支持集群有单点效应 | +| 云存储 | 采用 AWS S3 协议客户端 支持 七牛、阿里、腾讯 等一切支持S3协议的厂家 | 不支持 | +| 短信 | 采用 sms4j 短信融合包 支持数十种短信厂家 只需在yml配置好厂家密钥即可使用 可多厂家共用 | 不支持 | +| 邮件 | 采用 mail-api 通用协议支持大部分邮件厂商 | 不支持 | +| 接口文档 | 采用 SpringDoc、javadoc 无注解零入侵基于java注释
只需把注释写好 无需再写一大堆的文档注解了 | 采用 Springfox 已停止维护 需要编写大量的注解来支持文档生成 | +| 校验框架 | 采用 Validation 支持注解与工具类校验 注解支持国际化 | 仅支持注解 且注解不支持国际化 | +| Excel框架 | 采用 Alibaba EasyExcel 基于插件化
框架对其增加了很多功能 例如 自动合并相同内容 自动排列布局 字典翻译等 | 基于 POI 手写实现 功能有限 复杂 扩展性差 | +| 工具类框架 | 采用 Hutool、Lombok 上百种工具覆盖90%的使用需求 基于注解自动生成 get set 等简化框架大量代码 | 手写工具稳定性差易出问题 工具数量有限 代码臃肿需自己手写 get set 等 | +| 监控框架 | 采用 SpringBoot-Admin 基于SpringBoot官方 actuator 探针机制
实时监控服务状态 框架还为其扩展了在线日志查看监控 | 无 | +| 链路追踪 | 采用 Apache SkyWalking 还在为请求不知道去哪了 到哪出了问题而烦恼吗
用了它即可实时查看请求经过的每一处每一个节点 | 无 | +| 代码生成器 | 只需设计好表结构 一键生成所有crud代码与页面
降低80%的开发量 把精力都投入到业务设计上
框架为其适配MP、SpringDoc规范化代码 同时支持动态多数据源代码生成 | 代码生成原生结构 只支持单数据源生成 | +| 项目路径修改 | 提供详细的修改方案文档 并为其做了一些改动 非常简单即可修改成自己想要的 | 需要做很多改造 文档说明有限 | +| 国际化 | 基于请求头动态返回不同语种的文本内容 开发难度低 有对应的工具类 支持大部分注解内容国际化 | 只提供基础功能 其他需自行编写扩展 | +| 代码单例测试 | 提供单例测试 使用方式编写方法与maven多环境单测插件 | 只提供基础功能 其他需自行编写扩展 | +| Demo案例 | 提供框架功能的实际使用案例 单独一个模块提供了很多很全 | 无 | -## 若依框架视频介绍 -对若依框架不了解,不知道怎么部署、修改密码等操作的,请参考:https://www.bilibili.com/video/BV1Fi4y1q74p/ -## 本地运行文档 -https://docs.ichengle.top/wms/open/run.html -## 系统部署文档 -https://docs.ichengle.top/wms/open/ops.html +## 本框架与RuoYi的业务差异 -## 若依wms功能 -1. 首页:库存预警与到期提醒、基础数据报表展示 -2. 仓库/库区:管理维护仓库基础数据 -3. 物料:管理维护物料基础数据 -4. 客户/供应商/承运商:管理维护联系人基础数据 -5. 入库:创建入库单后包括如下几个状态:未发货、在途(已发货未入库)、部分入库、作废、入库完成,入库类型包括:采购入库、外协入库、退货入库,入库单支持lodop和网页打印 -6. 出库:创建出库单后包括如下几个状态:未发货、部分发货、已发货、作废,入库类型包括:销售出库、外协出库、调拨出库,出库单支持lodop和网页打印 -7. 移库:创建移库单后包括如下几个状态:未操作、部分移动、操作完毕、作废 -8. 库存看板:查看当前物料库存数量 -9. 库存记录:查看当前物料库存操作记录 -10. 库存盘点:已完成 -11. 库存月结:已完成 -12. 各类报表: 已完成 -## 状态流转 -#### 入库状态流转 -![入库状态流转](https://oscimg.oschina.net/oscnet/up-6bdb5ad6d8ab236f763300b71cf175d9a99.jpg) -#### 出库状态流转 -![出库状态流转](https://oscimg.oschina.net/oscnet/up-55cad3f077f914e357efeaae0b3feecf942.jpg) +| 业务 | 功能说明 | 本框架 | RuoYi | +|--------|-----------------------------------------|-----|------------------| +| 用户管理 | 用户的管理配置 如:新增用户、分配用户所属部门、角色、岗位等 | 支持 | 支持 | +| 部门管理 | 配置系统组织机构(公司、部门、小组) 树结构展现支持数据权限 | 支持 | 支持 | +| 岗位管理 | 配置系统用户所属担任职务 | 支持 | 支持 | +| 菜单管理 | 配置系统菜单、操作权限、按钮权限标识等 | 支持 | 支持 | +| 角色管理 | 角色菜单权限分配、设置角色按机构进行数据范围权限划分 | 支持 | 支持 | +| 字典管理 | 对系统中经常使用的一些较为固定的数据进行维护 | 支持 | 支持 | +| 参数管理 | 对系统动态配置常用参数 | 支持 | 支持 | +| 通知公告 | 系统通知公告信息发布维护 | 支持 | 支持 | +| 操作日志 | 系统正常操作日志记录和查询 系统异常信息日志记录和查询 | 支持 | 支持 | +| 登录日志 | 系统登录日志记录查询包含登录异常 | 支持 | 支持 | +| 文件管理 | 系统文件展示、上传、下载、删除等管理 | 支持 | 无 | +| 文件配置管理 | 系统文件上传、下载所需要的配置信息动态添加、修改、删除等管理 | 支持 | 无 | +| 在线用户管理 | 已登录系统的在线用户信息监控与强制踢出操作 | 支持 | 支持 | +| 定时任务 | 运行报表、任务管理(添加、修改、删除)、日志管理、执行器管理等 | 支持 | 仅支持任务与日志管理 | +| 代码生成 | 多数据源前后端代码的生成(java、html、xml、sql)支持CRUD下载 | 支持 | 仅支持单数据源 | +| 系统接口 | 根据业务代码自动生成相关的api接口文档 | 支持 | 支持 | +| 服务监控 | 监视集群系统CPU、内存、磁盘、堆栈、在线日志、Spring相关配置等 | 支持 | 仅支持单机CPU、内存、磁盘监控 | +| 缓存监控 | 对系统的缓存信息查询,命令统计等。 | 支持 | 支持 | +| 在线构建器 | 拖动表单元素生成相应的HTML代码。 | 支持 | 支持 | +| 使用案例 | 系统的一些功能案例 | 支持 | 不支持 | -## 演示图 -![首页](https://oscimg.oschina.net/oscnet/up-89f751967b4145f7da92e23536bf231fbe8.jpg) -![支持两种打印方式](https://oscimg.oschina.net/oscnet/up-6daf90ef19571c7f0e7641ae59c403d8272.jpg) -![lodop打印](https://oscimg.oschina.net/oscnet/up-146d2105ae31a27e497323ad19f8bd0d7bd.jpg) -![网页打印](https://oscimg.oschina.net/oscnet/up-5664440042861199d1f3e60928e0700a9ce.jpg) -![仓库列表](https://oscimg.oschina.net/oscnet/up-a00eb79bee48e481249a12cb5e6c476aaa3.jpg) -![库存看板](https://oscimg.oschina.net/oscnet/up-78990915dfba902384ed4b09e3dc0f0fe05.jpg) +## 贡献代码 -## 大厂、外企内推 -关注“编写美好前程”公众号:每月记录一篇编程、创业、生活中踩坑的文章,陆续会开放一些微软、阿里、京东、拼多多等大厂或外企的内推岗位! - -## 加群/技术支持 - -| 公众号 | -|:------------------------------------------:| -| | -扫公众号二维码,回复:“加群”或“支持” \ No newline at end of file +欢迎各路英雄豪杰 `PR` 代码 请提交到 `dev` 开发分支 统一测试发版 \ No newline at end of file diff --git a/UpdateHistory.md b/UpdateHistory.md new file mode 100644 index 0000000..e53b122 --- /dev/null +++ b/UpdateHistory.md @@ -0,0 +1,12 @@ +## 230627 +1. 删除 snail-job monitor-admin ruoyi-extend 基本用不到 +2. 优化 获取aop代理的方式 减少与其他使用aop的功能冲突的概率 + +## 230620 +1. 完成重构 common, framework 包结构, 参照 cloud 版本拆分子模块 ; +update 更新模块包名 ; +2. 使用 jdk17 语法优化代码 +3. mapstruct-plus 接入替换 BeanUtil ,用于实体类转换 ; 原先BeanUtil 对jdk17实体类转换会出错。 + +## 230613 +1.删除vue代码,vue相关代码重新建项目。 \ No newline at end of file diff --git a/bin/clean.bat b/bin/clean.bat deleted file mode 100644 index 24c0974..0000000 --- a/bin/clean.bat +++ /dev/null @@ -1,12 +0,0 @@ -@echo off -echo. -echo [Ϣ] target· -echo. - -%~d0 -cd %~dp0 - -cd .. -call mvn clean - -pause \ No newline at end of file diff --git a/bin/package.bat b/bin/package.bat deleted file mode 100644 index c693ec0..0000000 --- a/bin/package.bat +++ /dev/null @@ -1,12 +0,0 @@ -@echo off -echo. -echo [Ϣ] Weḅwar/jarļ -echo. - -%~d0 -cd %~dp0 - -cd .. -call mvn clean package -Dmaven.test.skip=true - -pause \ No newline at end of file diff --git a/bin/run.bat b/bin/run.bat deleted file mode 100644 index 41efbd0..0000000 --- a/bin/run.bat +++ /dev/null @@ -1,14 +0,0 @@ -@echo off -echo. -echo [Ϣ] ʹJarWeb̡ -echo. - -cd %~dp0 -cd ../ruoyi-admin/target - -set JAVA_OPTS=-Xms256m -Xmx1024m -XX:MetaspaceSize=128m -XX:MaxMetaspaceSize=512m - -java -jar %JAVA_OPTS% ruoyi-admin.jar - -cd bin -pause \ No newline at end of file diff --git a/doc/datacall.jpg b/doc/datacall.jpg deleted file mode 100644 index 8a31a98..0000000 Binary files a/doc/datacall.jpg and /dev/null differ diff --git a/doc/zdg.jpg b/doc/zdg.jpg deleted file mode 100644 index e2c6a19..0000000 Binary files a/doc/zdg.jpg and /dev/null differ diff --git a/pom.xml b/pom.xml index 4c7f540..f6abdce 100644 --- a/pom.xml +++ b/pom.xml @@ -5,208 +5,127 @@ 4.0.0 com.ruoyi - ruoyi - 3.7.0 + ruoyi-fast-service + ${revision} - ruoyi + ruoyi-fast-service + https://gitee.com/zccbbg/ruoyi-fast-service + ruoyi-fast-service后台管理系统 - 3.7.0 + 5.2.0 + 3.2.6 UTF-8 UTF-8 - 1.8 - 3.1.1 - 1.2.6 - 1.21 - 3.0.0 - 2.3.2 - 2.1.4 - 1.3.1 - 1.2.78 - 5.8.0 - 5.8.0 - 2.11.0 - 1.4 - 3.2.2 - 4.1.2 - 1.7 - 0.9.1 - 1.16.20 - 3.3.2 + 17 + 3.5.16 + 3.5.6 + 2.5.0 + 0.15.0 + 5.2.3 + 3.3.4 + 2.3 + 1.37.0 + 3.9.1 + 5.8.27 + 4.10.0 + 3.2.3 + 3.29.0 + 2.2.7 + 4.3.0 + 2.14.2 + 1.3.6 + 0.2.0 + 1.18.32 + 1.18.30 + 1.72 + + 2.7.0 + + + 1.12.540 + + 2.2.0 + + + 3.2.2 + 3.2.2 + 3.11.0 + 3.1.2 + 1.3.0 + + + local + + + local + info + + + + dev + + + dev + info + + + + true + + + + prod + + prod + warn + + + + - + - org.springframework.boot - spring-boot-dependencies - 2.2.13.RELEASE + com.ruoyi + ruoyi-common-bom + ${revision} pom import - + - com.alibaba - druid-spring-boot-starter - ${druid.version} + org.springframework.boot + spring-boot-dependencies + ${spring-boot.version} + pom + import - + - eu.bitwalker - UserAgentUtils - ${bitwalker.version} - - - - - - - - com.github.pagehelper - pagehelper-spring-boot-starter - ${pagehelper.boot.version} - - - - - com.github.oshi - oshi-core - ${oshi.version} + cn.hutool + hutool-bom + ${hutool.version} + pom + import - net.java.dev.jna - jna - ${jna.version} + org.springdoc + springdoc-openapi-starter-webmvc-api + ${springdoc.version} - net.java.dev.jna - jna-platform - ${jna.version} - - - - - io.springfox - springfox-boot-starter - ${swagger.version} - - - io.swagger - swagger-models - - - org.mapstruct - mapstruct - - - - - - - commons-io - commons-io - ${commons.io.version} - - - - - commons-fileupload - commons-fileupload - ${commons.fileupload.version} - - - - - org.apache.poi - poi-ooxml - ${poi.version} - - - - - org.apache.velocity - velocity - ${velocity.version} - - - commons-collections - commons-collections - - - - - - - commons-collections - commons-collections - ${commons.collections.version} - - - - - com.alibaba - fastjson - ${fastjson.version} - - - - - io.jsonwebtoken - jjwt - ${jwt.version} - - - - - com.github.penggle - kaptcha - ${kaptcha.version} - - - - - com.ruoyi - ruoyi-quartz - ${ruoyi.version} - - - - - com.ruoyi - ruoyi-generator - ${ruoyi.version} - - - - - com.ruoyi - ruoyi-framework - ${ruoyi.version} - - - - - com.ruoyi - ruoyi-system - ${ruoyi.version} - - - - - com.ruoyi - ruoyi-common - ${ruoyi.version} + com.github.therapi + therapi-runtime-javadoc + ${therapi-javadoc.version} @@ -214,86 +133,310 @@ lombok ${lombok.version} + - cn.hutool - hutool-all - 5.7.13 + org.apache.poi + poi + ${poi.version} - - org.mapstruct - mapstruct - 1.4.2.Final + org.apache.poi + poi-ooxml + ${poi.version} + + com.alibaba + easyexcel + ${easyexcel.version} + + + org.apache.poi + poi-ooxml-schemas + + + + + + + org.apache.velocity + velocity-engine-core + ${velocity.version} + + + + + cn.dev33 + sa-token-spring-boot3-starter + ${satoken.version} + + + + cn.dev33 + sa-token-jwt + ${satoken.version} + + + cn.hutool + hutool-all + + + + + cn.dev33 + sa-token-core + ${satoken.version} + + + + + com.baomidou + dynamic-datasource-spring-boot3-starter + ${dynamic-ds.version} + + + + org.mybatis + mybatis + ${mybatis.version} + + + + com.baomidou + mybatis-plus-spring-boot3-starter + ${mybatis-plus.version} + + + + com.baomidou + mybatis-plus-annotation + ${mybatis-plus.version} + + + + + p6spy + p6spy + ${p6spy.version} + + + + com.squareup.okhttp3 + okhttp + ${okhttp.version} + + + + com.amazonaws + aws-java-sdk-s3 + ${aws-java-sdk-s3.version} + + + + + org.dromara.sms4j + sms4j-spring-boot-starter + ${sms4j.version} + + + + de.codecentric + spring-boot-admin-starter-server + ${spring-boot-admin.version} + + + de.codecentric + spring-boot-admin-starter-client + ${spring-boot-admin.version} + + + + + org.redisson + redisson-spring-boot-starter + ${redisson.version} + + + org.redisson + redisson-spring-data-30 + + + + + org.redisson + redisson-spring-data-27 + ${redisson.version} + + + + com.baomidou + lock4j-redisson-spring-boot-starter + ${lock4j.version} + + + + com.alibaba + transmittable-thread-local + ${alibaba-ttl.version} + + + + + org.lionsoul + ip2region + ${ip2region.version} + + + + + org.bouncycastle + bcprov-jdk15to18 + ${bouncycastle.version} + + + + + com.ruoyi + ruoyi-generator + ${revision} + + + + + com.ruoyi + ruoyi-system + ${revision} + + + + io.github.linpeilie + mapstruct-plus-spring-boot-starter + ${mapstruct-plus.version} + + + + + com.ruoyi + ruoyi-demo + ${revision} + + ruoyi-admin - wms - ruoyi-framework - ruoyi-system - ruoyi-quartz - ruoyi-generator ruoyi-common + ruoyi-modules pom - - - - org.projectlombok - lombok - - - cn.hutool - hutool-all - - - - com.baomidou - mybatis-plus-boot-starter - ${mybatis.plus.version} - - - org.apache.maven.plugins maven-compiler-plugin - 3.8.1 + ${maven-compiler-plugin.verison} ${java.version} ${java.version} ${project.build.sourceEncoding} - org.mapstruct - mapstruct-processor - 1.4.2.Final + com.github.therapi + therapi-runtime-javadoc-scribe + ${therapi-javadoc.version} org.projectlombok lombok - 1.18.4 + ${lombok.version} + + + org.springframework.boot + spring-boot-configuration-processor + ${spring-boot.version} + + + io.github.linpeilie + mapstruct-plus-processor + ${mapstruct-plus.version} org.projectlombok lombok-mapstruct-binding - 0.2.0 + ${mapstruct-plus.lombok.version} + + -parameters + + + + org.apache.maven.plugins + maven-surefire-plugin + ${maven-surefire-plugin.version} + + -Dfile.encoding=UTF-8 + + ${profiles.active} + + exclude + + + + + org.codehaus.mojo + flatten-maven-plugin + ${flatten-maven-plugin.version} + + true + resolveCiFriendliesOnly + + + + flatten + process-resources + + flatten + + + + flatten.clean + clean + + clean + + + + + + + src/main/resources + + false + + + src/main/resources + + + application* + bootstrap* + banner* + + + true + + public - aliyun nexus - http://maven.aliyun.com/nexus/content/groups/public/ + huawei nexus + https://mirrors.huaweicloud.com/repository/maven/ true @@ -303,8 +446,8 @@ public - aliyun nexus - http://maven.aliyun.com/nexus/content/groups/public/ + huawei nexus + https://mirrors.huaweicloud.com/repository/maven/ true @@ -315,3 +458,5 @@ + + diff --git a/ruoyi-admin/Dockerfile b/ruoyi-admin/Dockerfile new file mode 100644 index 0000000..6033f7e --- /dev/null +++ b/ruoyi-admin/Dockerfile @@ -0,0 +1,23 @@ +FROM anapsix/alpine-java:8_server-jre_unlimited + +MAINTAINER Lion Li + +RUN mkdir -p /ruoyi/server/logs \ + /ruoyi/server/temp \ + /ruoyi/skywalking/agent + +WORKDIR /ruoyi/server + +ENV SERVER_PORT=8080 + +EXPOSE ${SERVER_PORT} + +ADD ./target/ruoyi-admin.jar ./app.jar + +ENTRYPOINT ["java", \ + "-Djava.security.egd=file:/dev/./urandom", \ + "-Dserver.port=${SERVER_PORT}", \ + # 应用名称 如果想区分集群节点监控 改成不同的名称即可 +# "-Dskywalking.agent.service_name=ruoyi-server", \ +# "-javaagent:/ruoyi/skywalking/agent/skywalking-agent.jar", \ + "-jar", "app.jar"] diff --git a/ruoyi-admin/pom.xml b/ruoyi-admin/pom.xml index 867bc9e..5dd3111 100644 --- a/ruoyi-admin/pom.xml +++ b/ruoyi-admin/pom.xml @@ -3,9 +3,9 @@ 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"> - ruoyi + ruoyi-fast-service com.ruoyi - 3.7.0 + ${revision} 4.0.0 jar @@ -17,91 +17,93 @@ - - + org.springframework.boot spring-boot-devtools - true <!– 表示依赖不会传递 –> - --> - - - - io.springfox - springfox-boot-starter + true - + - io.swagger - swagger-models - 1.6.2 + com.mysql + mysql-connector-j + + + + com.oracle.database.jdbc + ojdbc8 + + + + org.postgresql + postgresql + + + + com.microsoft.sqlserver + mssql-jdbc - - - mysql - mysql-connector-java - - - com.ruoyi - ruoyi-framework - ${ruoyi.version} + ruoyi-system - com.ruoyi - ruoyi-quartz - ${ruoyi.version} + ruoyi-common-oss + + + + com.ruoyi + ruoyi-common-mail + + + + com.ruoyi + ruoyi-common-ratelimiter com.ruoyi ruoyi-generator - ${ruoyi.version} - - - com.ruoyi - wms - ${ruoyi.version} + - org.junit.vintage - junit-vintage-engine - test + com.ruoyi + ruoyi-demo + org.springframework.boot spring-boot-starter-test - 2.5.0 test - - com.h2database - h2 - test - - - - org.mapstruct - mapstruct - 1.4.2.Final - + + + + + + + + + + + + + + ${project.artifactId} org.springframework.boot spring-boot-maven-plugin - 2.1.1.RELEASE - - true - + ${spring-boot.version} @@ -110,17 +112,21 @@ - - org.apache.maven.plugins - maven-war-plugin - 3.1.0 + + org.apache.maven.plugins + maven-jar-plugin + ${maven-jar-plugin.version} + + + org.apache.maven.plugins + maven-war-plugin + ${maven-war-plugin.version} false ${project.artifactId} - - + + - ${project.artifactId} diff --git a/ruoyi-admin/src/main/java/com/ruoyi/RuoYiApplication.java b/ruoyi-admin/src/main/java/com/ruoyi/RuoYiApplication.java index c857bd1..b52d32d 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/RuoYiApplication.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/RuoYiApplication.java @@ -2,30 +2,23 @@ package com.ruoyi; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; -import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration; +import org.springframework.boot.context.metrics.buffering.BufferingApplicationStartup; /** * 启动程序 * * @author ruoyi */ -@SpringBootApplication( - exclude = {DataSourceAutoConfiguration.class}, - scanBasePackages = {"com.ruoyi", "com.cyl"} -) + +@SpringBootApplication public class RuoYiApplication { + public static void main(String[] args) { - // System.setProperty("spring.devtools.restart.enabled", "false"); - SpringApplication.run(RuoYiApplication.class, args); - System.out.println("(♥◠‿◠)ノ゙ 若依启动成功 ლ(´ڡ`ლ)゙ \n" + - " .-------. ____ __ \n" + - " | _ _ \\ \\ \\ / / \n" + - " | ( ' ) | \\ _. / ' \n" + - " |(_ o _) / _( )_ .' \n" + - " | (_,_).' __ ___(_ o _)' \n" + - " | |\\ \\ | || |(_,_)' \n" + - " | | \\ `' /| `-' / \n" + - " | | \\ / \\ / \n" + - " ''-' `'-' `-..-' "); + System.setProperty("spring.devtools.restart.enabled", "false"); + SpringApplication application = new SpringApplication(RuoYiApplication.class); + application.setApplicationStartup(new BufferingApplicationStartup(2048)); + application.run(args); + System.out.println("(♥◠‿◠)ノ゙ RuoYi-Vue-Plus启动成功 ლ(´ڡ`ლ)゙"); } + } diff --git a/ruoyi-admin/src/main/java/com/ruoyi/RuoYiServletInitializer.java b/ruoyi-admin/src/main/java/com/ruoyi/RuoYiServletInitializer.java index 6de67dc..dd05626 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/RuoYiServletInitializer.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/RuoYiServletInitializer.java @@ -5,14 +5,14 @@ import org.springframework.boot.web.servlet.support.SpringBootServletInitializer /** * web容器中进行部署 - * + * * @author ruoyi */ -public class RuoYiServletInitializer extends SpringBootServletInitializer -{ +public class RuoYiServletInitializer extends SpringBootServletInitializer { + @Override - protected SpringApplicationBuilder configure(SpringApplicationBuilder application) - { + protected SpringApplicationBuilder configure(SpringApplicationBuilder application) { return application.sources(RuoYiApplication.class); } + } diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/common/CaptchaController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/common/CaptchaController.java deleted file mode 100644 index 0aad226..0000000 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/common/CaptchaController.java +++ /dev/null @@ -1,96 +0,0 @@ -package com.ruoyi.web.controller.common; - -import java.awt.image.BufferedImage; -import java.io.IOException; -import java.util.concurrent.TimeUnit; -import javax.annotation.Resource; -import javax.imageio.ImageIO; -import javax.servlet.http.HttpServletResponse; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.beans.factory.annotation.Value; -import org.springframework.util.FastByteArrayOutputStream; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.RestController; -import com.google.code.kaptcha.Producer; -import com.ruoyi.common.constant.Constants; -import com.ruoyi.common.core.domain.AjaxResult; -import com.ruoyi.common.core.redis.RedisCache; -import com.ruoyi.common.utils.sign.Base64; -import com.ruoyi.common.utils.uuid.IdUtils; -import com.ruoyi.system.service.ISysConfigService; - -/** - * 验证码操作处理 - * - * @author ruoyi - */ -@RestController -public class CaptchaController -{ - @Resource(name = "captchaProducer") - private Producer captchaProducer; - - @Resource(name = "captchaProducerMath") - private Producer captchaProducerMath; - - @Autowired - private RedisCache redisCache; - - // 验证码类型 - @Value("${ruoyi.captchaType}") - private String captchaType; - - @Autowired - private ISysConfigService configService; - /** - * 生成验证码 - */ - @GetMapping("/captchaImage") - public AjaxResult getCode(HttpServletResponse response) throws IOException - { - AjaxResult ajax = AjaxResult.success(); - boolean captchaOnOff = configService.selectCaptchaOnOff(); - ajax.put("captchaOnOff", captchaOnOff); - if (!captchaOnOff) - { - return ajax; - } - - // 保存验证码信息 - String uuid = IdUtils.simpleUUID(); - String verifyKey = Constants.CAPTCHA_CODE_KEY + uuid; - - String capStr = null, code = null; - BufferedImage image = null; - - // 生成验证码 - 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; - } -} diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/common/CodeController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/common/CodeController.java deleted file mode 100644 index bf5656d..0000000 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/common/CodeController.java +++ /dev/null @@ -1,29 +0,0 @@ -package com.ruoyi.web.controller.common; - -import com.ruoyi.common.core.controller.BaseController; -import com.ruoyi.common.core.domain.AjaxResult; -import com.ruoyi.system.service.PhoneCodeService; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.beans.factory.annotation.Value; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.bind.annotation.RestController; - -import javax.servlet.http.HttpServletRequest; - -@RestController -@RequestMapping("/code") -public class CodeController extends BaseController { - @Value("${ruoyi.traceIdName}") - private String traceIdName; - @Autowired - private PhoneCodeService phoneCodeService; - - @GetMapping("/get") - public AjaxResult getCode(HttpServletRequest request, @RequestParam String phone) { - String uuid = request.getHeader(traceIdName); - boolean res = phoneCodeService.obtainCode(uuid, phone); - return AjaxResult.success(res); - } -} diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/common/CommonController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/common/CommonController.java deleted file mode 100644 index 84a5f3c..0000000 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/common/CommonController.java +++ /dev/null @@ -1,120 +0,0 @@ -package com.ruoyi.web.controller.common; - -import com.ruoyi.common.config.RuoYiConfig; -import com.ruoyi.common.constant.Constants; -import com.ruoyi.common.core.domain.AjaxResult; -import com.ruoyi.common.utils.StringUtils; -import com.ruoyi.common.utils.file.FileUploadUtils; -import com.ruoyi.common.utils.file.FileUtils; -import com.ruoyi.common.utils.file.MimeTypeUtils; -import com.ruoyi.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.RestController; -import org.springframework.web.multipart.MultipartFile; - -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -/** - * 通用请求处理 - * - * @author ruoyi - */ -@RestController -public class CommonController -{ - private static final Logger log = LoggerFactory.getLogger(CommonController.class); - - @Autowired - private ServerConfig serverConfig; - - /** - * 通用下载请求 - * - * @param fileName 文件名称 - * @param delete 是否删除 - */ - @GetMapping("common/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 = RuoYiConfig.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("/common/upload") - public AjaxResult uploadFile(MultipartFile file) throws Exception - { - try - { - // 上传文件路径 - String filePath = RuoYiConfig.getUploadPath(); - // 上传并返回新文件名称 - String fileName = FileUploadUtils.upload(filePath, file, MimeTypeUtils.isImg(file.getContentType())); - String url = serverConfig.getUrl() + fileName; - AjaxResult ajax = AjaxResult.success(); - ajax.put("fileName", fileName); - ajax.put("url", url); - return ajax; - } - catch (Exception e) - { - return AjaxResult.error(e.getMessage()); - } - } - - /** - * 本地资源通用下载 - */ - @GetMapping("/common/download/resource") - public void resourceDownload(String resource, HttpServletRequest request, HttpServletResponse response) - throws Exception - { - try - { - if (!FileUtils.checkAllowDownload(resource)) - { - throw new Exception(StringUtils.format("资源文件({})非法,不允许下载。 ", resource)); - } - // 本地资源路径 - String localPath = RuoYiConfig.getProfile(); - // 数据库资源地址 - String downloadPath = localPath + StringUtils.substringAfter(resource, Constants.RESOURCE_PREFIX); - // 下载名称 - String downloadName = StringUtils.substringAfterLast(downloadPath, "/"); - response.setContentType(MediaType.APPLICATION_OCTET_STREAM_VALUE); - FileUtils.setAttachmentResponseHeader(response, downloadName); - FileUtils.writeBytes(downloadPath, response.getOutputStream()); - } - catch (Exception e) - { - log.error("下载文件失败", e); - } - } -} diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/monitor/CacheController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/monitor/CacheController.java deleted file mode 100644 index 7b97de2..0000000 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/monitor/CacheController.java +++ /dev/null @@ -1,53 +0,0 @@ -package com.ruoyi.web.controller.monitor; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Properties; -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.GetMapping; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; -import com.ruoyi.common.core.domain.AjaxResult; -import com.ruoyi.common.utils.StringUtils; - -/** - * 缓存监控 - * - * @author ruoyi - */ -@RestController -@RequestMapping("/monitor/cache") -public class CacheController -{ - @Autowired - private RedisTemplate redisTemplate; - - @PreAuthorize("@ss.hasPermi('monitor:cache:list')") - @GetMapping() - public AjaxResult getInfo() throws Exception - { - Properties info = (Properties) redisTemplate.execute((RedisCallback) connection -> connection.info()); - Properties commandStats = (Properties) redisTemplate.execute((RedisCallback) connection -> connection.info("commandstats")); - Object dbSize = redisTemplate.execute((RedisCallback) connection -> connection.dbSize()); - - Map result = new HashMap<>(3); - result.put("info", info); - result.put("dbSize", dbSize); - - List> pieList = new ArrayList<>(); - commandStats.stringPropertyNames().forEach(key -> { - Map 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); - } -} diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/monitor/ServerController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/monitor/ServerController.java deleted file mode 100644 index cc805ad..0000000 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/monitor/ServerController.java +++ /dev/null @@ -1,27 +0,0 @@ -package com.ruoyi.web.controller.monitor; - -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; -import com.ruoyi.common.core.domain.AjaxResult; -import com.ruoyi.framework.web.domain.Server; - -/** - * 服务器监控 - * - * @author ruoyi - */ -@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); - } -} diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/monitor/SysLogininforController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/monitor/SysLogininforController.java deleted file mode 100644 index 339f242..0000000 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/monitor/SysLogininforController.java +++ /dev/null @@ -1,67 +0,0 @@ -package com.ruoyi.web.controller.monitor; - -import java.util.List; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.security.access.prepost.PreAuthorize; -import org.springframework.web.bind.annotation.DeleteMapping; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.PathVariable; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; -import com.ruoyi.common.annotation.Log; -import com.ruoyi.common.core.controller.BaseController; -import com.ruoyi.common.core.domain.AjaxResult; -import com.ruoyi.common.core.page.TableDataInfo; -import com.ruoyi.common.enums.BusinessType; -import com.ruoyi.common.utils.poi.ExcelUtil; -import com.ruoyi.system.domain.SysLogininfor; -import com.ruoyi.system.service.ISysLogininforService; - -/** - * 系统访问记录 - * - * @author ruoyi - */ -@RestController -@RequestMapping("/monitor/logininfor") -public class SysLogininforController extends BaseController -{ - @Autowired - private ISysLogininforService logininforService; - - @PreAuthorize("@ss.hasPermi('monitor:logininfor:list')") - @GetMapping("/list") - public TableDataInfo list(SysLogininfor logininfor) - { - startPage(); - List list = logininforService.selectLogininforList(logininfor); - return getDataTable(list); - } - - @Log(title = "登录日志", businessType = BusinessType.EXPORT) - @PreAuthorize("@ss.hasPermi('monitor:logininfor:export')") - @GetMapping("/export") - public AjaxResult export(SysLogininfor logininfor) - { - List list = logininforService.selectLogininforList(logininfor); - ExcelUtil util = new ExcelUtil(SysLogininfor.class); - return util.exportExcel(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 AjaxResult.success(); - } -} diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/monitor/SysOperlogController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/monitor/SysOperlogController.java deleted file mode 100644 index 1d7eb02..0000000 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/monitor/SysOperlogController.java +++ /dev/null @@ -1,67 +0,0 @@ -package com.ruoyi.web.controller.monitor; - -import java.util.List; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.security.access.prepost.PreAuthorize; -import org.springframework.web.bind.annotation.DeleteMapping; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.PathVariable; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; -import com.ruoyi.common.annotation.Log; -import com.ruoyi.common.core.controller.BaseController; -import com.ruoyi.common.core.domain.AjaxResult; -import com.ruoyi.common.core.page.TableDataInfo; -import com.ruoyi.common.enums.BusinessType; -import com.ruoyi.common.utils.poi.ExcelUtil; -import com.ruoyi.system.domain.SysOperLog; -import com.ruoyi.system.service.ISysOperLogService; - -/** - * 操作日志记录 - * - * @author ruoyi - */ -@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 list = operLogService.selectOperLogList(operLog); - return getDataTable(list); - } - - @Log(title = "操作日志", businessType = BusinessType.EXPORT) - @PreAuthorize("@ss.hasPermi('monitor:operlog:export')") - @GetMapping("/export") - public AjaxResult export(SysOperLog operLog) - { - List list = operLogService.selectOperLogList(operLog); - ExcelUtil util = new ExcelUtil(SysOperLog.class); - return util.exportExcel(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 AjaxResult.success(); - } -} diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/monitor/SysUserOnlineController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/monitor/SysUserOnlineController.java deleted file mode 100644 index 9b157ea..0000000 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/monitor/SysUserOnlineController.java +++ /dev/null @@ -1,92 +0,0 @@ -package com.ruoyi.web.controller.monitor; - -import java.util.ArrayList; -import java.util.Collection; -import java.util.Collections; -import java.util.List; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.security.access.prepost.PreAuthorize; -import org.springframework.web.bind.annotation.DeleteMapping; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.PathVariable; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; -import com.ruoyi.common.annotation.Log; -import com.ruoyi.common.constant.Constants; -import com.ruoyi.common.core.controller.BaseController; -import com.ruoyi.common.core.domain.AjaxResult; -import com.ruoyi.common.core.domain.model.LoginUser; -import com.ruoyi.common.core.page.TableDataInfo; -import com.ruoyi.common.core.redis.RedisCache; -import com.ruoyi.common.enums.BusinessType; -import com.ruoyi.common.utils.StringUtils; -import com.ruoyi.system.domain.SysUserOnline; -import com.ruoyi.system.service.ISysUserOnlineService; - -/** - * 在线用户监控 - * - * @author ruoyi - */ -@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 keys = redisCache.keys(Constants.LOGIN_TOKEN_KEY + "*"); - List userOnlineList = new ArrayList(); - for (String key : keys) - { - LoginUser user = redisCache.getCacheObject(key); - if (StringUtils.isNotEmpty(ipaddr) && StringUtils.isNotEmpty(userName)) - { - if (StringUtils.equals(ipaddr, user.getIpaddr()) && StringUtils.equals(userName, user.getUsername())) - { - userOnlineList.add(userOnlineService.selectOnlineByInfo(ipaddr, userName, user)); - } - } - else if (StringUtils.isNotEmpty(ipaddr)) - { - if (StringUtils.equals(ipaddr, user.getIpaddr())) - { - userOnlineList.add(userOnlineService.selectOnlineByIpaddr(ipaddr, user)); - } - } - else if (StringUtils.isNotEmpty(userName) && StringUtils.isNotNull(user.getUser())) - { - if (StringUtils.equals(userName, user.getUsername())) - { - 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(Constants.LOGIN_TOKEN_KEY + tokenId); - return AjaxResult.success(); - } -} diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysConfigController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysConfigController.java deleted file mode 100644 index 7f76a41..0000000 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysConfigController.java +++ /dev/null @@ -1,135 +0,0 @@ -package com.ruoyi.web.controller.system; - -import java.util.List; -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.DeleteMapping; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.PathVariable; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.PutMapping; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; -import com.ruoyi.common.annotation.Log; -import com.ruoyi.common.annotation.RepeatSubmit; -import com.ruoyi.common.constant.UserConstants; -import com.ruoyi.common.core.controller.BaseController; -import com.ruoyi.common.core.domain.AjaxResult; -import com.ruoyi.common.core.page.TableDataInfo; -import com.ruoyi.common.enums.BusinessType; -import com.ruoyi.common.utils.poi.ExcelUtil; -import com.ruoyi.system.domain.SysConfig; -import com.ruoyi.system.service.ISysConfigService; - -/** - * 参数配置 信息操作处理 - * - * @author ruoyi - */ -@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 list = configService.selectConfigList(config); - return getDataTable(list); - } - - @Log(title = "参数管理", businessType = BusinessType.EXPORT) - @PreAuthorize("@ss.hasPermi('system:config:export')") - @GetMapping("/export") - public AjaxResult export(SysConfig config) - { - List list = configService.selectConfigList(config); - ExcelUtil util = new ExcelUtil(SysConfig.class); - return util.exportExcel(list, "参数数据"); - } - - /** - * 根据参数编号获取详细信息 - */ - @PreAuthorize("@ss.hasPermi('system:config:query')") - @GetMapping(value = "/{configId}") - public AjaxResult getInfo(@PathVariable Long configId) - { - return AjaxResult.success(configService.selectConfigById(configId)); - } - - /** - * 根据参数键名查询参数值 - */ - @GetMapping(value = "/configKey/{configKey}") - public AjaxResult getConfigKey(@PathVariable String configKey) - { - return AjaxResult.success(configService.selectConfigByKey(configKey)); - } - - /** - * 新增参数配置 - */ - @PreAuthorize("@ss.hasPermi('system:config:add')") - @Log(title = "参数管理", businessType = BusinessType.INSERT) - @PostMapping - @RepeatSubmit - public AjaxResult add(@Validated @RequestBody SysConfig config) - { - if (UserConstants.NOT_UNIQUE.equals(configService.checkConfigKeyUnique(config))) - { - return AjaxResult.error("新增参数'" + config.getConfigName() + "'失败,参数键名已存在"); - } - config.setCreateBy(getUserId()); - 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 (UserConstants.NOT_UNIQUE.equals(configService.checkConfigKeyUnique(config))) - { - return AjaxResult.error("修改参数'" + config.getConfigName() + "'失败,参数键名已存在"); - } - config.setUpdateBy(getUserId()); - 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 AjaxResult.success(); - } -} diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysDeptController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysDeptController.java deleted file mode 100644 index 35a636a..0000000 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysDeptController.java +++ /dev/null @@ -1,163 +0,0 @@ -package com.ruoyi.web.controller.system; - -import java.util.Iterator; -import java.util.List; -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.DeleteMapping; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.PathVariable; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.PutMapping; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; -import com.ruoyi.common.annotation.Log; -import com.ruoyi.common.constant.UserConstants; -import com.ruoyi.common.core.controller.BaseController; -import com.ruoyi.common.core.domain.AjaxResult; -import com.ruoyi.common.core.domain.entity.SysDept; -import com.ruoyi.common.enums.BusinessType; -import com.ruoyi.common.utils.StringUtils; -import com.ruoyi.system.service.ISysDeptService; - -/** - * 部门信息 - * - * @author ruoyi - */ -@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 depts = deptService.selectDeptList(dept); - return AjaxResult.success(depts); - } - - /** - * 查询部门列表(排除节点) - */ - @PreAuthorize("@ss.hasPermi('system:dept:list')") - @GetMapping("/list/exclude/{deptId}") - public AjaxResult excludeChild(@PathVariable(value = "deptId", required = false) Long deptId) - { - List depts = deptService.selectDeptList(new SysDept()); - Iterator it = depts.iterator(); - while (it.hasNext()) - { - SysDept d = (SysDept) it.next(); - if (d.getDeptId().intValue() == deptId - || ArrayUtils.contains(StringUtils.split(d.getAncestors(), ","), deptId + "")) - { - it.remove(); - } - } - return AjaxResult.success(depts); - } - - /** - * 根据部门编号获取详细信息 - */ - @PreAuthorize("@ss.hasPermi('system:dept:query')") - @GetMapping(value = "/{deptId}") - public AjaxResult getInfo(@PathVariable Long deptId) - { - deptService.checkDeptDataScope(deptId); - return AjaxResult.success(deptService.selectDeptById(deptId)); - } - - /** - * 获取部门下拉树列表 - */ - @GetMapping("/treeselect") - public AjaxResult treeselect(SysDept dept) - { - List depts = deptService.selectDeptList(dept); - return AjaxResult.success(deptService.buildDeptTreeSelect(depts)); - } - - /** - * 加载对应角色部门列表树 - */ - @GetMapping(value = "/roleDeptTreeselect/{roleId}") - public AjaxResult roleDeptTreeselect(@PathVariable("roleId") Long roleId) - { - List depts = deptService.selectDeptList(new SysDept()); - AjaxResult ajax = AjaxResult.success(); - ajax.put("checkedKeys", deptService.selectDeptListByRoleId(roleId)); - ajax.put("depts", deptService.buildDeptTreeSelect(depts)); - return ajax; - } - - /** - * 新增部门 - */ - @PreAuthorize("@ss.hasPermi('system:dept:add')") - @Log(title = "部门管理", businessType = BusinessType.INSERT) - @PostMapping - public AjaxResult add(@Validated @RequestBody SysDept dept) - { - if (UserConstants.NOT_UNIQUE.equals(deptService.checkDeptNameUnique(dept))) - { - return AjaxResult.error("新增部门'" + dept.getDeptName() + "'失败,部门名称已存在"); - } - dept.setCreateBy(getUserId()); - return toAjax(deptService.insertDept(dept)); - } - - /** - * 修改部门 - */ - @PreAuthorize("@ss.hasPermi('system:dept:edit')") - @Log(title = "部门管理", businessType = BusinessType.UPDATE) - @PutMapping - public AjaxResult edit(@Validated @RequestBody SysDept dept) - { - if (UserConstants.NOT_UNIQUE.equals(deptService.checkDeptNameUnique(dept))) - { - return AjaxResult.error("修改部门'" + dept.getDeptName() + "'失败,部门名称已存在"); - } - else if (dept.getParentId().equals(dept.getDeptId())) - { - return AjaxResult.error("修改部门'" + dept.getDeptName() + "'失败,上级部门不能是自己"); - } - else if (StringUtils.equals(UserConstants.DEPT_DISABLE, dept.getStatus()) - && deptService.selectNormalChildrenDeptById(dept.getDeptId()) > 0) - { - return AjaxResult.error("该部门包含未停用的子部门!"); - } - dept.setUpdateBy(getUserId()); - 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 AjaxResult.error("存在下级部门,不允许删除"); - } - if (deptService.checkDeptExistUser(deptId)) - { - return AjaxResult.error("部门存在用户,不允许删除"); - } - return toAjax(deptService.deleteDeptById(deptId)); - } -} diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysDictDataController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysDictDataController.java deleted file mode 100644 index 24343dd..0000000 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysDictDataController.java +++ /dev/null @@ -1,121 +0,0 @@ -package com.ruoyi.web.controller.system; - -import java.util.ArrayList; -import java.util.List; -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 com.ruoyi.common.annotation.Log; -import com.ruoyi.common.core.controller.BaseController; -import com.ruoyi.common.core.domain.AjaxResult; -import com.ruoyi.common.core.domain.entity.SysDictData; -import com.ruoyi.common.core.page.TableDataInfo; -import com.ruoyi.common.enums.BusinessType; -import com.ruoyi.common.utils.StringUtils; -import com.ruoyi.common.utils.poi.ExcelUtil; -import com.ruoyi.system.service.ISysDictDataService; -import com.ruoyi.system.service.ISysDictTypeService; - -/** - * 数据字典信息 - * - * @author ruoyi - */ -@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 list = dictDataService.selectDictDataList(dictData); - return getDataTable(list); - } - - @Log(title = "字典数据", businessType = BusinessType.EXPORT) - @PreAuthorize("@ss.hasPermi('system:dict:export')") - @GetMapping("/export") - public AjaxResult export(SysDictData dictData) - { - List list = dictDataService.selectDictDataList(dictData); - ExcelUtil util = new ExcelUtil(SysDictData.class); - return util.exportExcel(list, "字典数据"); - } - - /** - * 查询字典数据详细 - */ - @PreAuthorize("@ss.hasPermi('system:dict:query')") - @GetMapping(value = "/{dictCode}") - public AjaxResult getInfo(@PathVariable Long dictCode) - { - return AjaxResult.success(dictDataService.selectDictDataById(dictCode)); - } - - /** - * 根据字典类型查询字典数据信息 - */ - @GetMapping(value = "/type/{dictType}") - public AjaxResult dictType(@PathVariable String dictType) - { - List data = dictTypeService.selectDictDataByType(dictType); - if (StringUtils.isNull(data)) - { - data = new ArrayList(); - } - return AjaxResult.success(data); - } - - /** - * 新增字典类型 - */ - @PreAuthorize("@ss.hasPermi('system:dict:add')") - @Log(title = "字典数据", businessType = BusinessType.INSERT) - @PostMapping - public AjaxResult add(@Validated @RequestBody SysDictData dict) - { - dict.setCreateBy(getUserId()); - 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(getUserId()); - 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(); - } - - @PreAuthorize("@ss.hasPermi('system:dict:list')") - @PostMapping("/by_types") - public TableDataInfo listByTypes(@RequestBody List dictTypes) - { - List list = dictDataService.selectDictDataByTypes(dictTypes); - return getDataTable(list); - } -} diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysDictTypeController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysDictTypeController.java deleted file mode 100644 index 0beaffe..0000000 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysDictTypeController.java +++ /dev/null @@ -1,131 +0,0 @@ -package com.ruoyi.web.controller.system; - -import java.util.List; -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.DeleteMapping; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.PathVariable; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.PutMapping; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; -import com.ruoyi.common.annotation.Log; -import com.ruoyi.common.constant.UserConstants; -import com.ruoyi.common.core.controller.BaseController; -import com.ruoyi.common.core.domain.AjaxResult; -import com.ruoyi.common.core.domain.entity.SysDictType; -import com.ruoyi.common.core.page.TableDataInfo; -import com.ruoyi.common.enums.BusinessType; -import com.ruoyi.common.utils.poi.ExcelUtil; -import com.ruoyi.system.service.ISysDictTypeService; - -/** - * 数据字典信息 - * - * @author ruoyi - */ -@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 list = dictTypeService.selectDictTypeList(dictType); - return getDataTable(list); - } - - @Log(title = "字典类型", businessType = BusinessType.EXPORT) - @PreAuthorize("@ss.hasPermi('system:dict:export')") - @GetMapping("/export") - public AjaxResult export(SysDictType dictType) - { - List list = dictTypeService.selectDictTypeList(dictType); - ExcelUtil util = new ExcelUtil(SysDictType.class); - return util.exportExcel(list, "字典类型"); - } - - /** - * 查询字典类型详细 - */ - @PreAuthorize("@ss.hasPermi('system:dict:query')") - @GetMapping(value = "/{dictId}") - public AjaxResult getInfo(@PathVariable Long dictId) - { - return AjaxResult.success(dictTypeService.selectDictTypeById(dictId)); - } - - /** - * 新增字典类型 - */ - @PreAuthorize("@ss.hasPermi('system:dict:add')") - @Log(title = "字典类型", businessType = BusinessType.INSERT) - @PostMapping - public AjaxResult add(@Validated @RequestBody SysDictType dict) - { - if (UserConstants.NOT_UNIQUE.equals(dictTypeService.checkDictTypeUnique(dict))) - { - return AjaxResult.error("新增字典'" + dict.getDictName() + "'失败,字典类型已存在"); - } - dict.setCreateBy(getUserId()); - 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 (UserConstants.NOT_UNIQUE.equals(dictTypeService.checkDictTypeUnique(dict))) - { - return AjaxResult.error("修改字典'" + dict.getDictName() + "'失败,字典类型已存在"); - } - dict.setUpdateBy(getUserId()); - 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 AjaxResult.success(); - } - - /** - * 获取字典选择框列表 - */ - @GetMapping("/optionselect") - public AjaxResult optionselect() - { - List dictTypes = dictTypeService.selectDictTypeAll(); - return AjaxResult.success(dictTypes); - } -} diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysIndexController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysIndexController.java deleted file mode 100644 index 13007eb..0000000 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysIndexController.java +++ /dev/null @@ -1,29 +0,0 @@ -package com.ruoyi.web.controller.system; - -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; -import com.ruoyi.common.config.RuoYiConfig; -import com.ruoyi.common.utils.StringUtils; - -/** - * 首页 - * - * @author ruoyi - */ -@RestController -public class SysIndexController -{ - /** 系统基础配置 */ - @Autowired - private RuoYiConfig ruoyiConfig; - - /** - * 访问首页,提示语 - */ - @RequestMapping("/") - public String index() - { - return StringUtils.format("欢迎使用{}后台管理框架,当前版本:v{},请通过前端地址访问。", ruoyiConfig.getName(), ruoyiConfig.getVersion()); - } -} diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysLoginController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysLoginController.java deleted file mode 100644 index 39b8297..0000000 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysLoginController.java +++ /dev/null @@ -1,98 +0,0 @@ -package com.ruoyi.web.controller.system; - -import com.ruoyi.common.constant.Constants; -import com.ruoyi.common.core.domain.AjaxResult; -import com.ruoyi.common.core.domain.entity.SysMenu; -import com.ruoyi.common.core.domain.entity.SysUser; -import com.ruoyi.common.core.domain.model.LoginBody; -import com.ruoyi.common.core.domain.model.PhoneLoginBody; -import com.ruoyi.common.utils.SecurityUtils; -import com.ruoyi.framework.web.service.SysLoginService; -import com.ruoyi.framework.web.service.SysPermissionService; -import com.ruoyi.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 ruoyi - */ -@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) { - AjaxResult ajax = AjaxResult.success(); - // 生成令牌 - String token = loginService.login(loginBody.getUsername(), loginBody.getPassword(), loginBody.getCode(), - loginBody.getUuid()); - ajax.put(Constants.TOKEN, token); - return ajax; - } - - /** - * 使用手机号登陆 - * - * @param loginBody 登录信息 - * @return 结果 - */ - @PostMapping("/login/phone") - public AjaxResult login(@RequestBody PhoneLoginBody loginBody) { - AjaxResult ajax = AjaxResult.success(); - SysUser user = loginService.phoneLogin(loginBody.getPhone(), loginBody.getCode(), loginBody.getUuid()); - // lcUserService.initVipUser(user); - ajax.put(Constants.TOKEN, loginService.createToken(user)); - return ajax; - } - - /** - * 获取用户信息 - * - * @return 用户信息 - */ - @GetMapping("getInfo") - public AjaxResult getInfo() { - SysUser user = SecurityUtils.getLoginUser().getUser(); - // 角色集合 - Set roles = permissionService.getRolePermission(user); - // 权限集合 - Set 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 menus = menuService.selectMenuTreeByUserId(userId); - return AjaxResult.success(menuService.buildMenus(menus)); - } -} diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysMenuController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysMenuController.java deleted file mode 100644 index 7dbcea0..0000000 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysMenuController.java +++ /dev/null @@ -1,142 +0,0 @@ -package com.ruoyi.web.controller.system; - -import java.util.List; -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.DeleteMapping; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.PathVariable; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.PutMapping; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; -import com.ruoyi.common.annotation.Log; -import com.ruoyi.common.constant.UserConstants; -import com.ruoyi.common.core.controller.BaseController; -import com.ruoyi.common.core.domain.AjaxResult; -import com.ruoyi.common.core.domain.entity.SysMenu; -import com.ruoyi.common.enums.BusinessType; -import com.ruoyi.common.utils.StringUtils; -import com.ruoyi.system.service.ISysMenuService; - -/** - * 菜单信息 - * - * @author ruoyi - */ -@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 menus = menuService.selectMenuList(menu, getUserId()); - return AjaxResult.success(menus); - } - - /** - * 根据菜单编号获取详细信息 - */ - @PreAuthorize("@ss.hasPermi('system:menu:query')") - @GetMapping(value = "/{menuId}") - public AjaxResult getInfo(@PathVariable Long menuId) - { - return AjaxResult.success(menuService.selectMenuById(menuId)); - } - - /** - * 获取菜单下拉树列表 - */ - @GetMapping("/treeselect") - public AjaxResult treeselect(SysMenu menu) - { - List menus = menuService.selectMenuList(menu, getUserId()); - return AjaxResult.success(menuService.buildMenuTreeSelect(menus)); - } - - /** - * 加载对应角色菜单列表树 - */ - @GetMapping(value = "/roleMenuTreeselect/{roleId}") - public AjaxResult roleMenuTreeselect(@PathVariable("roleId") Long roleId) - { - List 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 (UserConstants.NOT_UNIQUE.equals(menuService.checkMenuNameUnique(menu))) - { - return AjaxResult.error("新增菜单'" + menu.getMenuName() + "'失败,菜单名称已存在"); - } - else if (UserConstants.YES_FRAME.equals(menu.getIsFrame()) && !StringUtils.ishttp(menu.getPath())) - { - return AjaxResult.error("新增菜单'" + menu.getMenuName() + "'失败,地址必须以http(s)://开头"); - } - menu.setCreateBy(getUserId()); - 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 (UserConstants.NOT_UNIQUE.equals(menuService.checkMenuNameUnique(menu))) - { - return AjaxResult.error("修改菜单'" + menu.getMenuName() + "'失败,菜单名称已存在"); - } - else if (UserConstants.YES_FRAME.equals(menu.getIsFrame()) && !StringUtils.ishttp(menu.getPath())) - { - return AjaxResult.error("修改菜单'" + menu.getMenuName() + "'失败,地址必须以http(s)://开头"); - } - else if (menu.getMenuId().equals(menu.getParentId())) - { - return AjaxResult.error("修改菜单'" + menu.getMenuName() + "'失败,上级菜单不能选择自己"); - } - menu.setUpdateBy(getUserId()); - 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 AjaxResult.error("存在子菜单,不允许删除"); - } - if (menuService.checkMenuExistRole(menuId)) - { - return AjaxResult.error("菜单已分配,不允许删除"); - } - return toAjax(menuService.deleteMenuById(menuId)); - } -} diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysNoticeController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysNoticeController.java deleted file mode 100644 index ff3a1da..0000000 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysNoticeController.java +++ /dev/null @@ -1,91 +0,0 @@ -package com.ruoyi.web.controller.system; - -import java.util.List; -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.DeleteMapping; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.PathVariable; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.PutMapping; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; -import com.ruoyi.common.annotation.Log; -import com.ruoyi.common.core.controller.BaseController; -import com.ruoyi.common.core.domain.AjaxResult; -import com.ruoyi.common.core.page.TableDataInfo; -import com.ruoyi.common.enums.BusinessType; -import com.ruoyi.system.domain.SysNotice; -import com.ruoyi.system.service.ISysNoticeService; - -/** - * 公告 信息操作处理 - * - * @author ruoyi - */ -@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 list = noticeService.selectNoticeList(notice); - return getDataTable(list); - } - - /** - * 根据通知公告编号获取详细信息 - */ - @PreAuthorize("@ss.hasPermi('system:notice:query')") - @GetMapping(value = "/{noticeId}") - public AjaxResult getInfo(@PathVariable Long noticeId) - { - return AjaxResult.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(getUserId()); - 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(getUserId()); - 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)); - } -} diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysPostController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysPostController.java deleted file mode 100644 index 2f7736b..0000000 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysPostController.java +++ /dev/null @@ -1,129 +0,0 @@ -package com.ruoyi.web.controller.system; - -import java.util.List; -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.DeleteMapping; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.PathVariable; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.PutMapping; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; -import com.ruoyi.common.annotation.Log; -import com.ruoyi.common.constant.UserConstants; -import com.ruoyi.common.core.controller.BaseController; -import com.ruoyi.common.core.domain.AjaxResult; -import com.ruoyi.common.core.page.TableDataInfo; -import com.ruoyi.common.enums.BusinessType; -import com.ruoyi.common.utils.poi.ExcelUtil; -import com.ruoyi.system.domain.SysPost; -import com.ruoyi.system.service.ISysPostService; - -/** - * 岗位信息操作处理 - * - * @author ruoyi - */ -@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 list = postService.selectPostList(post); - return getDataTable(list); - } - - @Log(title = "岗位管理", businessType = BusinessType.EXPORT) - @PreAuthorize("@ss.hasPermi('system:post:export')") - @GetMapping("/export") - public AjaxResult export(SysPost post) - { - List list = postService.selectPostList(post); - ExcelUtil util = new ExcelUtil(SysPost.class); - return util.exportExcel(list, "岗位数据"); - } - - /** - * 根据岗位编号获取详细信息 - */ - @PreAuthorize("@ss.hasPermi('system:post:query')") - @GetMapping(value = "/{postId}") - public AjaxResult getInfo(@PathVariable Long postId) - { - return AjaxResult.success(postService.selectPostById(postId)); - } - - /** - * 新增岗位 - */ - @PreAuthorize("@ss.hasPermi('system:post:add')") - @Log(title = "岗位管理", businessType = BusinessType.INSERT) - @PostMapping - public AjaxResult add(@Validated @RequestBody SysPost post) - { - if (UserConstants.NOT_UNIQUE.equals(postService.checkPostNameUnique(post))) - { - return AjaxResult.error("新增岗位'" + post.getPostName() + "'失败,岗位名称已存在"); - } - else if (UserConstants.NOT_UNIQUE.equals(postService.checkPostCodeUnique(post))) - { - return AjaxResult.error("新增岗位'" + post.getPostName() + "'失败,岗位编码已存在"); - } - post.setCreateBy(getUserId()); - 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 (UserConstants.NOT_UNIQUE.equals(postService.checkPostNameUnique(post))) - { - return AjaxResult.error("修改岗位'" + post.getPostName() + "'失败,岗位名称已存在"); - } - else if (UserConstants.NOT_UNIQUE.equals(postService.checkPostCodeUnique(post))) - { - return AjaxResult.error("修改岗位'" + post.getPostName() + "'失败,岗位编码已存在"); - } - post.setUpdateBy(getUserId()); - 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 posts = postService.selectPostAll(); - return AjaxResult.success(posts); - } -} diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysProfileController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysProfileController.java deleted file mode 100644 index 90eb8f3..0000000 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysProfileController.java +++ /dev/null @@ -1,141 +0,0 @@ -package com.ruoyi.web.controller.system; - -import java.io.IOException; -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.RequestBody; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.bind.annotation.RestController; -import org.springframework.web.multipart.MultipartFile; -import com.ruoyi.common.annotation.Log; -import com.ruoyi.common.config.RuoYiConfig; -import com.ruoyi.common.constant.UserConstants; -import com.ruoyi.common.core.controller.BaseController; -import com.ruoyi.common.core.domain.AjaxResult; -import com.ruoyi.common.core.domain.entity.SysUser; -import com.ruoyi.common.core.domain.model.LoginUser; -import com.ruoyi.common.enums.BusinessType; -import com.ruoyi.common.utils.SecurityUtils; -import com.ruoyi.common.utils.StringUtils; -import com.ruoyi.common.utils.file.FileUploadUtils; -import com.ruoyi.framework.web.service.TokenService; -import com.ruoyi.system.service.ISysUserService; - -/** - * 个人信息 业务处理 - * - * @author ruoyi - */ -@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) - { - if (StringUtils.isNotEmpty(user.getPhonenumber()) - && UserConstants.NOT_UNIQUE.equals(userService.checkPhoneUnique(user))) - { - return AjaxResult.error("修改用户'" + user.getUserName() + "'失败,手机号码已存在"); - } - if (StringUtils.isNotEmpty(user.getEmail()) - && UserConstants.NOT_UNIQUE.equals(userService.checkEmailUnique(user))) - { - return AjaxResult.error("修改用户'" + user.getUserName() + "'失败,邮箱账号已存在"); - } - LoginUser loginUser = getLoginUser(); - SysUser sysUser = loginUser.getUser(); - user.setUserId(sysUser.getUserId()); - user.setPassword(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 AjaxResult.success(); - } - return AjaxResult.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 AjaxResult.error("修改密码失败,旧密码错误"); - } - if (SecurityUtils.matchesPassword(newPassword, password)) - { - return AjaxResult.error("新密码不能与旧密码相同"); - } - if (userService.resetUserPwd(userName, SecurityUtils.encryptPassword(newPassword)) > 0) - { - // 更新缓存用户密码 - loginUser.getUser().setPassword(SecurityUtils.encryptPassword(newPassword)); - tokenService.setLoginUser(loginUser); - return AjaxResult.success(); - } - return AjaxResult.error("修改密码异常,请联系管理员"); - } - - /** - * 头像上传 - */ - @Log(title = "用户头像", businessType = BusinessType.UPDATE) - @PostMapping("/avatar") - public AjaxResult avatar(@RequestParam("avatarfile") MultipartFile file) throws IOException - { - if (!file.isEmpty()) - { - LoginUser loginUser = getLoginUser(); - String avatar = FileUploadUtils.upload(RuoYiConfig.getAvatarPath(), file); - if (userService.updateUserAvatar(loginUser.getUsername(), avatar)) - { - AjaxResult ajax = AjaxResult.success(); - ajax.put("imgUrl", avatar); - // 更新缓存用户头像 - loginUser.getUser().setAvatar(avatar); - tokenService.setLoginUser(loginUser); - return ajax; - } - } - return AjaxResult.error("上传图片异常,请联系管理员"); - } -} diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysRegisterController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysRegisterController.java deleted file mode 100644 index 762f1d9..0000000 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysRegisterController.java +++ /dev/null @@ -1,38 +0,0 @@ -package com.ruoyi.web.controller.system; - -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.util.StringUtils; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RestController; -import com.ruoyi.common.core.controller.BaseController; -import com.ruoyi.common.core.domain.AjaxResult; -import com.ruoyi.common.core.domain.model.RegisterBody; -import com.ruoyi.framework.web.service.SysRegisterService; -import com.ruoyi.system.service.ISysConfigService; - -/** - * 注册验证 - * - * @author ruoyi - */ -@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); - } -} diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysRoleController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysRoleController.java deleted file mode 100644 index 56d947e..0000000 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysRoleController.java +++ /dev/null @@ -1,240 +0,0 @@ -package com.ruoyi.web.controller.system; - -import java.util.List; -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.DeleteMapping; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.PathVariable; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.PutMapping; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; -import com.ruoyi.common.annotation.Log; -import com.ruoyi.common.constant.UserConstants; -import com.ruoyi.common.core.controller.BaseController; -import com.ruoyi.common.core.domain.AjaxResult; -import com.ruoyi.common.core.domain.entity.SysRole; -import com.ruoyi.common.core.domain.entity.SysUser; -import com.ruoyi.common.core.domain.model.LoginUser; -import com.ruoyi.common.core.page.TableDataInfo; -import com.ruoyi.common.enums.BusinessType; -import com.ruoyi.common.utils.StringUtils; -import com.ruoyi.common.utils.poi.ExcelUtil; -import com.ruoyi.framework.web.service.SysPermissionService; -import com.ruoyi.framework.web.service.TokenService; -import com.ruoyi.system.domain.SysUserRole; -import com.ruoyi.system.service.ISysRoleService; -import com.ruoyi.system.service.ISysUserService; - -/** - * 角色信息 - * - * @author ruoyi - */ -@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; - - @PreAuthorize("@ss.hasPermi('system:role:list')") - @GetMapping("/list") - public TableDataInfo list(SysRole role) - { - startPage(); - List list = roleService.selectRoleList(role); - return getDataTable(list); - } - - @Log(title = "角色管理", businessType = BusinessType.EXPORT) - @PreAuthorize("@ss.hasPermi('system:role:export')") - @GetMapping("/export") - public AjaxResult export(SysRole role) - { - List list = roleService.selectRoleList(role); - ExcelUtil util = new ExcelUtil(SysRole.class); - return util.exportExcel(list, "角色数据"); - } - - /** - * 根据角色编号获取详细信息 - */ - @PreAuthorize("@ss.hasPermi('system:role:query')") - @GetMapping(value = "/{roleId}") - public AjaxResult getInfo(@PathVariable Long roleId) - { - roleService.checkRoleDataScope(roleId); - return AjaxResult.success(roleService.selectRoleById(roleId)); - } - - /** - * 新增角色 - */ - @PreAuthorize("@ss.hasPermi('system:role:add')") - @Log(title = "角色管理", businessType = BusinessType.INSERT) - @PostMapping - public AjaxResult add(@Validated @RequestBody SysRole role) - { - if (UserConstants.NOT_UNIQUE.equals(roleService.checkRoleNameUnique(role))) - { - return AjaxResult.error("新增角色'" + role.getRoleName() + "'失败,角色名称已存在"); - } - else if (UserConstants.NOT_UNIQUE.equals(roleService.checkRoleKeyUnique(role))) - { - return AjaxResult.error("新增角色'" + role.getRoleName() + "'失败,角色权限已存在"); - } - role.setCreateBy(getUserId()); - 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); - if (UserConstants.NOT_UNIQUE.equals(roleService.checkRoleNameUnique(role))) - { - return AjaxResult.error("修改角色'" + role.getRoleName() + "'失败,角色名称已存在"); - } - else if (UserConstants.NOT_UNIQUE.equals(roleService.checkRoleKeyUnique(role))) - { - return AjaxResult.error("修改角色'" + role.getRoleName() + "'失败,角色权限已存在"); - } - role.setUpdateBy(getUserId()); - - 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 AjaxResult.success(); - } - return AjaxResult.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); - 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); - role.setUpdateBy(getUserId()); - 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 AjaxResult.success(roleService.selectRoleAll()); - } - - /** - * 查询已分配用户角色列表 - */ - @PreAuthorize("@ss.hasPermi('system:role:list')") - @GetMapping("/authUser/allocatedList") - public TableDataInfo allocatedList(SysUser user) - { - startPage(); - List list = userService.selectAllocatedList(user); - return getDataTable(list); - } - - /** - * 查询未分配用户角色列表 - */ - @PreAuthorize("@ss.hasPermi('system:role:list')") - @GetMapping("/authUser/unallocatedList") - public TableDataInfo unallocatedList(SysUser user) - { - startPage(); - List 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) - { - return toAjax(roleService.insertAuthUsers(roleId, userIds)); - } -} diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysUserController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysUserController.java deleted file mode 100644 index 5c0875d..0000000 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysUserController.java +++ /dev/null @@ -1,230 +0,0 @@ -package com.ruoyi.web.controller.system; - -import java.util.List; -import java.util.stream.Collectors; -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.DeleteMapping; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.PathVariable; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.PutMapping; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; -import org.springframework.web.multipart.MultipartFile; -import com.ruoyi.common.annotation.Log; -import com.ruoyi.common.constant.UserConstants; -import com.ruoyi.common.core.controller.BaseController; -import com.ruoyi.common.core.domain.AjaxResult; -import com.ruoyi.common.core.domain.entity.SysRole; -import com.ruoyi.common.core.domain.entity.SysUser; -import com.ruoyi.common.core.page.TableDataInfo; -import com.ruoyi.common.enums.BusinessType; -import com.ruoyi.common.utils.SecurityUtils; -import com.ruoyi.common.utils.StringUtils; -import com.ruoyi.common.utils.poi.ExcelUtil; -import com.ruoyi.system.service.ISysPostService; -import com.ruoyi.system.service.ISysRoleService; -import com.ruoyi.system.service.ISysUserService; - -/** - * 用户信息 - * - * @author ruoyi - */ -@RestController -@RequestMapping("/system/user") -public class SysUserController extends BaseController -{ - @Autowired - private ISysUserService userService; - - @Autowired - private ISysRoleService roleService; - - @Autowired - private ISysPostService postService; - - /** - * 获取用户列表 - */ - @PreAuthorize("@ss.hasPermi('system:user:list')") - @GetMapping("/list") - public TableDataInfo list(SysUser user) - { - startPage(); - List list = userService.selectUserList(user); - return getDataTable(list); - } - - @Log(title = "用户管理", businessType = BusinessType.EXPORT) - @PreAuthorize("@ss.hasPermi('system:user:export')") - @GetMapping("/export") - public AjaxResult export(SysUser user) - { - List list = userService.selectUserList(user); - ExcelUtil util = new ExcelUtil(SysUser.class); - return util.exportExcel(list, "用户数据"); - } - - @Log(title = "用户管理", businessType = BusinessType.IMPORT) - @PreAuthorize("@ss.hasPermi('system:user:import')") - @PostMapping("/importData") - public AjaxResult importData(MultipartFile file, boolean updateSupport) throws Exception - { - ExcelUtil util = new ExcelUtil(SysUser.class); - List userList = util.importExcel(file.getInputStream()); - String message = userService.importUser(userList, updateSupport, getUserId()); - return AjaxResult.success(message); - } - - @GetMapping("/importTemplate") - public AjaxResult importTemplate() - { - ExcelUtil util = new ExcelUtil(SysUser.class); - return util.importTemplateExcel("用户数据"); - } - - /** - * 根据用户编号获取详细信息 - */ - @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 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)) - { - ajax.put(AjaxResult.DATA_TAG, userService.selectUserById(userId)); - ajax.put("postIds", postService.selectPostListByUserId(userId)); - ajax.put("roleIds", roleService.selectRoleListByUserId(userId)); - } - return ajax; - } - - /** - * 新增用户 - */ - @PreAuthorize("@ss.hasPermi('system:user:add')") - @Log(title = "用户管理", businessType = BusinessType.INSERT) - @PostMapping - public AjaxResult add(@Validated @RequestBody SysUser user) - { - if (UserConstants.NOT_UNIQUE.equals(userService.checkUserNameUnique(user.getUserName()))) - { - return AjaxResult.error("新增用户'" + user.getUserName() + "'失败,登录账号已存在"); - } - else if (StringUtils.isNotEmpty(user.getPhonenumber()) - && UserConstants.NOT_UNIQUE.equals(userService.checkPhoneUnique(user))) - { - return AjaxResult.error("新增用户'" + user.getUserName() + "'失败,手机号码已存在"); - } - else if (StringUtils.isNotEmpty(user.getEmail()) - && UserConstants.NOT_UNIQUE.equals(userService.checkEmailUnique(user))) - { - return AjaxResult.error("新增用户'" + user.getUserName() + "'失败,邮箱账号已存在"); - } - user.setCreateBy(getUserId()); - 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); - if (StringUtils.isNotEmpty(user.getPhonenumber()) - && UserConstants.NOT_UNIQUE.equals(userService.checkPhoneUnique(user))) - { - return AjaxResult.error("修改用户'" + user.getUserName() + "'失败,手机号码已存在"); - } - else if (StringUtils.isNotEmpty(user.getEmail()) - && UserConstants.NOT_UNIQUE.equals(userService.checkEmailUnique(user))) - { - return AjaxResult.error("修改用户'" + user.getUserName() + "'失败,邮箱账号已存在"); - } - user.setUpdateBy(getUserId()); - 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); - user.setPassword(SecurityUtils.encryptPassword(user.getPassword())); - user.setUpdateBy(getUserId()); - 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); - user.setUpdateBy(getUserId()); - 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 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.insertUserAuth(userId, roleIds); - return success(); - } -} diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/tool/SwaggerController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/tool/SwaggerController.java deleted file mode 100644 index f66ca24..0000000 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/tool/SwaggerController.java +++ /dev/null @@ -1,24 +0,0 @@ -package com.ruoyi.web.controller.tool; - -import org.springframework.security.access.prepost.PreAuthorize; -import org.springframework.stereotype.Controller; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.RequestMapping; -import com.ruoyi.common.core.controller.BaseController; - -/** - * swagger 接口 - * - * @author ruoyi - */ -@Controller -@RequestMapping("/tool/swagger") -public class SwaggerController extends BaseController -{ - @PreAuthorize("@ss.hasPermi('tool:swagger:view')") - @GetMapping() - public String index() - { - return redirect("/swagger-ui.html"); - } -} diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/tool/TestController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/tool/TestController.java deleted file mode 100644 index a989d28..0000000 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/tool/TestController.java +++ /dev/null @@ -1,170 +0,0 @@ -package com.ruoyi.web.controller.tool; - -import com.ruoyi.common.core.controller.BaseController; -import com.ruoyi.common.core.domain.AjaxResult; -import com.ruoyi.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 ruoyi - */ -@Api("用户信息管理") -@RestController -@RequestMapping("/test/user") -public class TestController extends BaseController -{ - private final static Map users = new LinkedHashMap(); - { - users.put(1, new UserEntity(1, "admin", "admin123", "15888888888")); - users.put(2, new UserEntity(2, "ry", "admin123", "15666666666")); - } - - @ApiOperation("获取用户列表") - @GetMapping("/list") - public AjaxResult userList() - { - List userList = new ArrayList(users.values()); - return AjaxResult.success(userList); - } - - @ApiOperation("获取用户详细") - @ApiImplicitParam(name = "userId", value = "用户ID", required = true, dataType = "int", dataTypeClass = Integer.class, paramType = "path") - @GetMapping("/{userId}") - public AjaxResult getUser(@PathVariable Integer userId) - { - if (!users.isEmpty() && users.containsKey(userId)) - { - return AjaxResult.success(users.get(userId)); - } - else - { - return error("用户不存在"); - } - } - - @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 AjaxResult save(UserEntity user) - { - if (StringUtils.isNull(user) || StringUtils.isNull(user.getUserId())) - { - return error("用户ID不能为空"); - } - return AjaxResult.success(users.put(user.getUserId(), user)); - } - - @ApiOperation("更新用户") - @PutMapping("/update") - public AjaxResult update(@RequestBody UserEntity user) - { - if (StringUtils.isNull(user) || StringUtils.isNull(user.getUserId())) - { - return error("用户ID不能为空"); - } - if (users.isEmpty() || !users.containsKey(user.getUserId())) - { - return error("用户不存在"); - } - users.remove(user.getUserId()); - return AjaxResult.success(users.put(user.getUserId(), user)); - } - - @ApiOperation("删除用户信息") - @ApiImplicitParam(name = "userId", value = "用户ID", required = true, dataType = "int", dataTypeClass = Integer.class, paramType = "path") - @DeleteMapping("/{userId}") - public AjaxResult delete(@PathVariable Integer userId) - { - if (!users.isEmpty() && users.containsKey(userId)) - { - users.remove(userId); - return success(); - } - else - { - return error("用户不存在"); - } - } -} - -@ApiModel(value = "UserEntity", description = "用户实体") -class UserEntity -{ - @ApiModelProperty("用户ID") - private Integer userId; - - @ApiModelProperty("用户名称") - private String username; - - @ApiModelProperty("用户密码") - private String password; - - @ApiModelProperty("用户手机") - private String mobile; - - public UserEntity() - { - - } - - public UserEntity(Integer userId, String username, String password, String mobile) - { - this.userId = userId; - this.username = username; - this.password = password; - this.mobile = mobile; - } - - public Integer getUserId() - { - return userId; - } - - public void setUserId(Integer userId) - { - this.userId = userId; - } - - public String getUsername() - { - return username; - } - - public void setUsername(String username) - { - this.username = username; - } - - public String getPassword() - { - return password; - } - - public void setPassword(String password) - { - this.password = password; - } - - public String getMobile() - { - return mobile; - } - - public void setMobile(String mobile) - { - this.mobile = mobile; - } -} diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/core/config/SwaggerConfig.java b/ruoyi-admin/src/main/java/com/ruoyi/web/core/config/SwaggerConfig.java deleted file mode 100644 index 30ff0c1..0000000 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/core/config/SwaggerConfig.java +++ /dev/null @@ -1,121 +0,0 @@ -package com.ruoyi.web.core.config; - -import com.ruoyi.common.config.RuoYiConfig; -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 ruoyi - */ -@Configuration -public class SwaggerConfig -{ - /** 系统基础配置 */ - @Autowired - private RuoYiConfig ruoyiConfig; - - /** 是否开启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.ruoyi.project.tool.swagger")) - // 扫描所有 .apis(RequestHandlerSelectors.any()) - .paths(PathSelectors.any()) - .build() - /* 设置安全模式,swagger可以设置访问token */ - .securitySchemes(securitySchemes()) - .securityContexts(securityContexts()) - .pathMapping(pathMapping); - } - - /** - * 安全模式,这里指定token通过Authorization头请求头传递 - */ - private List securitySchemes() - { - List apiKeyList = new ArrayList(); - apiKeyList.add(new ApiKey("Authorization", "Authorization", In.HEADER.toValue())); - return apiKeyList; - } - - /** - * 安全上下文 - */ - private List securityContexts() - { - List securityContexts = new ArrayList<>(); - securityContexts.add( - SecurityContext.builder() - .securityReferences(defaultAuth()) - .operationSelector(o -> o.requestMappingPattern().matches("/.*")) - .build()); - return securityContexts; - } - - /** - * 默认的安全上引用 - */ - private List defaultAuth() - { - AuthorizationScope authorizationScope = new AuthorizationScope("global", "accessEverything"); - AuthorizationScope[] authorizationScopes = new AuthorizationScope[1]; - authorizationScopes[0] = authorizationScope; - List 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(ruoyiConfig.getName(), null, null)) - // 版本 - .version("版本号:" + ruoyiConfig.getVersion()) - .build(); - } -} diff --git a/ruoyi-admin/src/main/resources/META-INF/spring-devtools.properties b/ruoyi-admin/src/main/resources/META-INF/spring-devtools.properties deleted file mode 100644 index 2b23f85..0000000 --- a/ruoyi-admin/src/main/resources/META-INF/spring-devtools.properties +++ /dev/null @@ -1 +0,0 @@ -restart.include.json=/com.alibaba.fastjson.*.jar \ No newline at end of file diff --git a/ruoyi-admin/src/main/resources/application-dev.yml b/ruoyi-admin/src/main/resources/application-dev.yml new file mode 100644 index 0000000..30303e5 --- /dev/null +++ b/ruoyi-admin/src/main/resources/application-dev.yml @@ -0,0 +1,150 @@ +--- # 数据源配置 +spring: + datasource: + type: com.zaxxer.hikari.HikariDataSource + # 动态数据源文档 https://www.kancloud.cn/tracy5546/dynamic-datasource/content + dynamic: + # 性能分析插件(有性能损耗 不建议生产环境使用) + p6spy: true + # 设置默认的数据源或者数据源组,默认值即为 master + primary: master + # 严格模式 匹配不到数据源则报错 + strict: true + datasource: + # 主库数据源 + master: + type: ${spring.datasource.type} + driverClassName: com.mysql.cj.jdbc.Driver + # jdbc 所有参数配置参考 https://lionli.blog.csdn.net/article/details/122018562 + # rewriteBatchedStatements=true 批处理优化 大幅提升批量插入更新删除性能(对数据库有性能损耗 使用批量操作应考虑性能问题) + url: jdbc:mysql://localhost:3306/ry-vue?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&autoReconnect=true&rewriteBatchedStatements=true + username: root + password: root + # 从库数据源 + slave: + lazy: true + type: ${spring.datasource.type} + driverClassName: com.mysql.cj.jdbc.Driver + url: jdbc:mysql://localhost:3306/ry-vue?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&autoReconnect=true&rewriteBatchedStatements=true + username: + password: +# oracle: +# type: ${spring.datasource.type} +# driverClassName: oracle.jdbc.OracleDriver +# url: jdbc:oracle:thin:@//localhost:1521/XE +# username: ROOT +# password: root +# postgres: +# type: ${spring.datasource.type} +# driverClassName: org.postgresql.Driver +# url: jdbc:postgresql://localhost:5432/postgres?useUnicode=true&characterEncoding=utf8&useSSL=true&autoReconnect=true&reWriteBatchedInserts=true +# username: root +# password: root +# sqlserver: +# type: ${spring.datasource.type} +# driverClassName: com.microsoft.sqlserver.jdbc.SQLServerDriver +# url: jdbc:sqlserver://localhost:1433;DatabaseName=tempdb;SelectMethod=cursor;encrypt=false;rewriteBatchedStatements=true +# username: SA +# password: root + hikari: + # 最大连接池数量 + maxPoolSize: 20 + # 最小空闲线程数量 + minIdle: 10 + # 配置获取连接等待超时的时间 + connectionTimeout: 30000 + # 校验超时时间 + validationTimeout: 5000 + # 空闲连接存活最大时间,默认10分钟 + idleTimeout: 600000 + # 此属性控制池中连接的最长生命周期,值0表示无限生命周期,默认30分钟 + maxLifetime: 1800000 + # 多久检查一次连接的活性 + keepaliveTime: 30000 + +--- # redis 单机配置(单机与集群只能开启一个另一个需要注释掉) +spring.data: + redis: + # 地址 + host: localhost + # 端口,默认为6379 + port: 6379 + # 数据库索引 + database: 0 + # 密码(如没有密码请注释掉) + # password: + # 连接超时时间 + timeout: 10s + # 是否开启ssl + ssl: false + +redisson: + # redis key前缀 + keyPrefix: + # 线程池数量 + threads: 4 + # Netty线程池数量 + nettyThreads: 8 + # 单节点配置 + singleServerConfig: + # 客户端名称 + clientName: ${ruoyi.name} + # 最小空闲连接数 + connectionMinimumIdleSize: 8 + # 连接池大小 + connectionPoolSize: 32 + # 连接空闲超时,单位:毫秒 + idleConnectionTimeout: 10000 + # 命令等待超时,单位:毫秒 + timeout: 3000 + # 发布和订阅连接池大小 + subscriptionConnectionPoolSize: 50 + +--- # mail 邮件发送 +mail: + enabled: false + host: smtp.163.com + port: 465 + # 是否需要用户名密码验证 + auth: true + # 发送方,遵循RFC-822标准 + from: xxx@163.com + # 用户名(注意:如果使用foxmail邮箱,此处user为qq号) + user: xxx@163.com + # 密码(注意,某些邮箱需要为SMTP服务单独设置密码,详情查看相关帮助) + pass: xxxxxxxxxx + # 使用 STARTTLS安全连接,STARTTLS是对纯文本通信协议的扩展。 + starttlsEnable: true + # 使用SSL安全连接 + sslEnable: true + # SMTP超时时长,单位毫秒,缺省值不超时 + timeout: 0 + # Socket连接超时值,单位毫秒,缺省值不超时 + connectionTimeout: 0 + +--- # sms 短信 支持 阿里云 腾讯云 云片 等等各式各样的短信服务商 +# https://wind.kim/doc/start 文档地址 各个厂商可同时使用 +sms: + # 阿里云 dysmsapi.aliyuncs.com + alibaba: + #请求地址 默认为 dysmsapi.aliyuncs.com 如无特殊改变可以不用设置 + requestUrl: dysmsapi.aliyuncs.com + #阿里云的accessKey + accessKeyId: xxxxxxx + #阿里云的accessKeySecret + accessKeySecret: xxxxxxx + #短信签名 + signature: 测试 + tencent: + #请求地址默认为 sms.tencentcloudapi.com 如无特殊改变可不用设置 + requestUrl: sms.tencentcloudapi.com + #腾讯云的accessKey + accessKeyId: xxxxxxx + #腾讯云的accessKeySecret + accessKeySecret: xxxxxxx + #短信签名 + signature: 测试 + #短信sdkAppId + sdkAppId: appid + #地域信息默认为 ap-guangzhou 如无特殊改变可不用设置 + territory: ap-guangzhou diff --git a/ruoyi-admin/src/main/resources/application-druid.yml b/ruoyi-admin/src/main/resources/application-druid.yml deleted file mode 100644 index e68d079..0000000 --- a/ruoyi-admin/src/main/resources/application-druid.yml +++ /dev/null @@ -1,37 +0,0 @@ -# 数据源配置 -spring: - datasource: - type: com.alibaba.druid.pool.DruidDataSource - driverClassName: com.mysql.cj.jdbc.Driver - druid: - # 主库数据源 - master: - url: jdbc:mysql://localhost:3306/wms?useUnicode=true&characterEncoding=utf8&useSSL=false&useLegacyDatetimeCode=false&serverTimezone=UTC&createDatabaseIfNotExist=true&allowPublicKeyRetrieval=true - username: - password: - # 从库数据源 - slave: - # 从数据源开关/默认关闭 - enabled: false - url: - username: - password: - statViewServlet: - # 控制台管理用户名和密码 - login-username: - login-password: - # redis 配置 - redis: - # 地址 - host: localhost - # 端口,默认为6379 - port: 6379 - # 数据库索引 - database: 1 - # 密码 - password: -ruoyi: - # 文件路径 示例( Windows配置D:/ruoyi/uploadPath,Linux配置 /home/ruoyi/uploadPath) - profile: C:/ruoyi/uploadPath -scheduling: - enabled: false diff --git a/ruoyi-admin/src/main/resources/application-prod.yml b/ruoyi-admin/src/main/resources/application-prod.yml new file mode 100644 index 0000000..fea02a1 --- /dev/null +++ b/ruoyi-admin/src/main/resources/application-prod.yml @@ -0,0 +1,153 @@ +--- # 临时文件存储位置 避免临时文件被系统清理报错 +spring.servlet.multipart.location: /ruoyi/server/temp + +--- # 数据源配置 +spring: + datasource: + type: com.zaxxer.hikari.HikariDataSource + # 动态数据源文档 https://www.kancloud.cn/tracy5546/dynamic-datasource/content + dynamic: + # 性能分析插件(有性能损耗 不建议生产环境使用) + p6spy: false + # 设置默认的数据源或者数据源组,默认值即为 master + primary: master + # 严格模式 匹配不到数据源则报错 + strict: true + datasource: + # 主库数据源 + master: + type: ${spring.datasource.type} + driverClassName: com.mysql.cj.jdbc.Driver + # jdbc 所有参数配置参考 https://lionli.blog.csdn.net/article/details/122018562 + # rewriteBatchedStatements=true 批处理优化 大幅提升批量插入更新删除性能(对数据库有性能损耗 使用批量操作应考虑性能问题) + url: jdbc:mysql://localhost:3306/ry-vue?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&autoReconnect=true&rewriteBatchedStatements=true + username: root + password: root + # 从库数据源 + slave: + lazy: true + type: ${spring.datasource.type} + driverClassName: com.mysql.cj.jdbc.Driver + url: jdbc:mysql://localhost:3306/ry-vue?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&autoReconnect=true&rewriteBatchedStatements=true + username: + password: +# oracle: +# type: ${spring.datasource.type} +# driverClassName: oracle.jdbc.OracleDriver +# url: jdbc:oracle:thin:@//localhost:1521/XE +# username: ROOT +# password: root +# postgres: +# type: ${spring.datasource.type} +# driverClassName: org.postgresql.Driver +# url: jdbc:postgresql://localhost:5432/postgres?useUnicode=true&characterEncoding=utf8&useSSL=true&autoReconnect=true&reWriteBatchedInserts=true +# username: root +# password: root +# sqlserver: +# type: ${spring.datasource.type} +# driverClassName: com.microsoft.sqlserver.jdbc.SQLServerDriver +# url: jdbc:sqlserver://localhost:1433;DatabaseName=tempdb;SelectMethod=cursor;encrypt=false;rewriteBatchedStatements=true +# username: SA +# password: root + hikari: + # 最大连接池数量 + maxPoolSize: 20 + # 最小空闲线程数量 + minIdle: 10 + # 配置获取连接等待超时的时间 + connectionTimeout: 30000 + # 校验超时时间 + validationTimeout: 5000 + # 空闲连接存活最大时间,默认10分钟 + idleTimeout: 600000 + # 此属性控制池中连接的最长生命周期,值0表示无限生命周期,默认30分钟 + maxLifetime: 1800000 + # 多久检查一次连接的活性 + keepaliveTime: 30000 + +--- # redis 单机配置(单机与集群只能开启一个另一个需要注释掉) +spring.data: + redis: + # 地址 + host: localhost + # 端口,默认为6379 + port: 6379 + # 数据库索引 + database: 0 + # 密码(如没有密码请注释掉) + # password: + # 连接超时时间 + timeout: 10s + # 是否开启ssl + ssl: false + +redisson: + # redis key前缀 + keyPrefix: + # 线程池数量 + threads: 16 + # Netty线程池数量 + nettyThreads: 32 + # 单节点配置 + singleServerConfig: + # 客户端名称 + clientName: ${ruoyi.name} + # 最小空闲连接数 + connectionMinimumIdleSize: 32 + # 连接池大小 + connectionPoolSize: 64 + # 连接空闲超时,单位:毫秒 + idleConnectionTimeout: 10000 + # 命令等待超时,单位:毫秒 + timeout: 3000 + # 发布和订阅连接池大小 + subscriptionConnectionPoolSize: 50 + +--- # mail 邮件发送 +mail: + enabled: false + host: smtp.163.com + port: 465 + # 是否需要用户名密码验证 + auth: true + # 发送方,遵循RFC-822标准 + from: xxx@163.com + # 用户名(注意:如果使用foxmail邮箱,此处user为qq号) + user: xxx@163.com + # 密码(注意,某些邮箱需要为SMTP服务单独设置密码,详情查看相关帮助) + pass: xxxxxxxxxx + # 使用 STARTTLS安全连接,STARTTLS是对纯文本通信协议的扩展。 + starttlsEnable: true + # 使用SSL安全连接 + sslEnable: true + # SMTP超时时长,单位毫秒,缺省值不超时 + timeout: 0 + # Socket连接超时值,单位毫秒,缺省值不超时 + connectionTimeout: 0 + +--- # sms 短信 支持 阿里云 腾讯云 云片 等等各式各样的短信服务商 +# https://wind.kim/doc/start 文档地址 各个厂商可同时使用 +sms: + # 阿里云 dysmsapi.aliyuncs.com + alibaba: + #请求地址 默认为 dysmsapi.aliyuncs.com 如无特殊改变可以不用设置 + requestUrl: dysmsapi.aliyuncs.com + #阿里云的accessKey + accessKeyId: xxxxxxx + #阿里云的accessKeySecret + accessKeySecret: xxxxxxx + #短信签名 + signature: 测试 + tencent: + #请求地址默认为 sms.tencentcloudapi.com 如无特殊改变可不用设置 + requestUrl: sms.tencentcloudapi.com + #腾讯云的accessKey + accessKeyId: xxxxxxx + #腾讯云的accessKeySecret + accessKeySecret: xxxxxxx + #短信签名 + signature: 测试 + #短信sdkAppId + sdkAppId: appid + #地域信息默认为 ap-guangzhou 如无特殊改变可不用设置 + territory: ap-guangzhou diff --git a/ruoyi-admin/src/main/resources/application.yml b/ruoyi-admin/src/main/resources/application.yml index 26941da..4698c2f 100644 --- a/ruoyi-admin/src/main/resources/application.yml +++ b/ruoyi-admin/src/main/resources/application.yml @@ -1,21 +1,25 @@ # 项目相关配置 ruoyi: # 名称 - name: RuoYi + name: RuoYi-Vue-Plus-Service # 版本 - version: 3.7.0 + version: ${revision} # 版权年份 - copyrightYear: 2022 - # 实例演示开关 - demoEnabled: true - # 文件路径 示例( Windows配置D:/ruoyi/uploadPath,Linux配置 /home/ruoyi/uploadPath) - profile: C:/ruoyi/uploadPath - # 获取ip地址开关 - addressEnabled: true + copyrightYear: 2023 + # 缓存懒加载 + cacheLazy: false + +captcha: + enable: true + # 页面 <参数设置> 可开启关闭 验证码校验 # 验证码类型 math 数组计算 char 字符验证 - captchaType: math - # 前端请求的 跟踪 header name - traceIdName: x-web-trace-id + type: MATH + # line 线段干扰 circle 圆圈干扰 shear 扭曲干扰 + category: CIRCLE + # 数字验证码位数 + numberLength: 1 + # 字符验证码长度 + charLength: 4 # 开发环境配置 server: @@ -24,28 +28,46 @@ server: servlet: # 应用的访问路径 context-path: / - tomcat: - # tomcat的URI编码 - uri-encoding: UTF-8 - # tomcat最大线程数,默认为200 - max-threads: 800 - # Tomcat启动初始化的线程数,默认值25 - min-spare-threads: 30 + # undertow 配置 + undertow: + # HTTP post内容的最大大小。当值为-1时,默认值为大小是无限的 + max-http-post-size: -1 + # 以下的配置会影响buffer,这些buffer会用于服务器连接的IO操作,有点类似netty的池化内存管理 + # 每块buffer的空间大小,越小的空间被利用越充分 + buffer-size: 512 + # 是否分配的直接内存 + direct-buffers: true + threads: + # 设置IO线程数, 它主要执行非阻塞的任务,它们会负责多个连接, 默认设置每个CPU核心一个线程 + io: 8 + # 阻塞任务线程池, 当执行类似servlet请求阻塞操作, undertow会从这个线程池中取得线程,它的值设置取决于系统的负载 + worker: 256 # 日志配置 logging: level: - com.ruoyi: debug + com.ruoyi: @logging.level@ org.springframework: warn + config: classpath:logback-plus.xml + +# 用户配置 +user: + password: + # 密码最大错误次数 + maxRetryCount: 5 + # 密码锁定时间(默认10分钟) + lockTime: 10 # Spring配置 spring: + application: + name: ${ruoyi.name} # 资源信息 messages: # 国际化资源文件路径 basename: i18n/messages profiles: - active: druid + active: @profiles.active@ # 文件上传 servlet: multipart: @@ -58,92 +80,156 @@ spring: restart: # 热部署开关 enabled: true - datasource: - type: com.alibaba.druid.pool.DruidDataSource - driverClassName: com.mysql.cj.jdbc.Driver - druid: - # 初始连接数 - initialSize: 5 - # 最小连接池数量 - minIdle: 10 - # 最大连接池数量 - maxActive: 20 - # 配置获取连接等待超时的时间 - maxWait: 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/* - filter: - stat: - enabled: true - # 慢SQL记录 - log-slow-sql: true - slow-sql-millis: 1000 - merge-sql: true - wall: - config: - multi-statement-allow: true - # redis 配置 - redis: - # 连接超时时间 - timeout: 50s - lettuce: - pool: - # 连接池中的最小空闲连接 - min-idle: 0 - # 连接池中的最大空闲连接 - max-idle: 8 - # 连接池的最大数据库连接数 - max-active: 8 - # #连接池最大阻塞等待时间(使用负值表示没有限制) - max-wait: -1ms + mvc: + format: + date-time: yyyy-MM-dd HH:mm:ss + jackson: + # 日期格式化 + date-format: yyyy-MM-dd HH:mm:ss + serialization: + # 格式化输出 + indent_output: false + # 忽略无法转换的对象 + fail_on_empty_beans: false + deserialization: + # 允许对象忽略json中不存在的属性 + fail_on_unknown_properties: false -# token配置 -token: - # 令牌自定义标识 - header: Authorization - # 令牌密钥 - secret: abcdefghijkomnopqrstuvwxyx - # 令牌有效期(默认30分钟) - expireTime: 30 -# mybatis-plus 配置 +# Sa-Token配置 +sa-token: + # token名称 (同时也是cookie名称) + token-name: Authorization + # token有效期 设为一天 (必定过期) 单位: 秒 + timeout: 86400 + # 多端不同 token 有效期 可查看 LoginHelper.loginByDevice 方法自定义 + # token最低活跃时间 (指定时间无操作就过期) 单位: 秒 + active-timeout: 1800 + # 允许动态设置 token 有效期 + dynamic-active-timeout: true + # 是否允许同一账号并发登录 (为true时允许一起登录, 为false时新登录挤掉旧登录) + is-concurrent: true + # 在多人登录同一账号时,是否共用一个token (为true时所有登录共用一个token, 为false时每次登录新建一个token) + is-share: false + # 是否尝试从header里读取token + is-read-header: true + # 是否尝试从cookie里读取token + is-read-cookie: false + # token前缀 + token-prefix: "Bearer" + # jwt秘钥 + jwt-secret-key: abcdefghijklmnopqrstuvwxyz + +# security配置 +security: + # 排除路径 + excludes: + # 静态资源 + - /*.html + - /**/*.html + - /**/*.css + - /**/*.js + # 公共路径 + - /favicon.ico + - /error + # swagger 文档配置 + - /*/api-docs + - /*/api-docs/** + # actuator 监控配置 + - /actuator + - /actuator/** + +# MyBatisPlus配置 +# https://baomidou.com/config/ mybatis-plus: - # 搜索指定包别名 - typeAliasesPackage: com.cyl.**.domain, com.ruoyi.common.core.domain.entity, com.ruoyi.**.domain - # 配置mapper的扫描,找到所有的mapper.xml映射文件 + # 不支持多包, 如有需要可在注解配置 或 提升扫包等级 + # 例如 com.**.**.mapper + mapperPackage: com.ruoyi.**.mapper + # 对应的 XML 文件位置 mapperLocations: classpath*:mapper/**/*Mapper.xml - # 加载全局的配置文件 - configLocation: classpath:mybatis/mybatis-config.xml + # 实体扫描,多个package用逗号或者分号分隔 + typeAliasesPackage: com.ruoyi.**.domain + # 启动时是否检查 MyBatis XML 文件的存在,默认不检查 + checkConfigLocation: false + configuration: + # 自动驼峰命名规则(camel case)映射 + mapUnderscoreToCamelCase: true + # MyBatis 自动映射策略 + # NONE:不启用 PARTIAL:只对非嵌套 resultMap 自动映射 FULL:对所有 resultMap 自动映射 + autoMappingBehavior: FULL + # MyBatis 自动映射时未知列或未知属性处理策 + # NONE:不做处理 WARNING:打印相关警告 FAILING:抛出异常和详细信息 + autoMappingUnknownColumnBehavior: NONE + # 更详细的日志输出 会有性能损耗 org.apache.ibatis.logging.stdout.StdOutImpl + # 关闭日志记录 (可单纯使用 p6spy 分析) org.apache.ibatis.logging.nologging.NoLoggingImpl + # 默认日志输出 org.apache.ibatis.logging.slf4j.Slf4jImpl + logImpl: org.apache.ibatis.logging.nologging.NoLoggingImpl global-config: - db-config: - id-type: auto - update-strategy: ignored -pagehelper: - helperDialect: mysql - supportMethodsArguments: true - params: count=countSql + # 是否打印 Logo banner + banner: true + dbConfig: + # 主键类型 + # AUTO 自增 NONE 空 INPUT 用户输入 ASSIGN_ID 雪花 ASSIGN_UUID 唯一 UUID + idType: ASSIGN_ID + # 逻辑已删除值 + logicDeleteValue: 2 + # 逻辑未删除值 + logicNotDeleteValue: 0 + # 字段验证策略之 insert,在 insert 的时候的字段验证策略 + # IGNORED 忽略 NOT_NULL 非NULL NOT_EMPTY 非空 DEFAULT 默认 NEVER 不加入 SQL + insertStrategy: NOT_NULL + # 字段验证策略之 update,在 update 的时候的字段验证策略 + updateStrategy: NOT_NULL + # 字段验证策略之 select,在 select 的时候的字段验证策略既 wrapper 根据内部 entity 生成的 where 条件 + where-strategy: NOT_NULL -# Swagger配置 -swagger: - # 是否开启swagger - enabled: true - # 请求前缀 - pathMapping: /dev-api +# 数据加密 +mybatis-encryptor: + # 是否开启加密 + enable: false + # 默认加密算法 + algorithm: BASE64 + # 编码方式 BASE64/HEX。默认BASE64 + encode: BASE64 + # 安全秘钥 对称算法的秘钥 如:AES,SM4 + password: + # 公私钥 非对称算法的公私钥 如:SM2,RSA + publicKey: + privateKey: + +springdoc: + api-docs: + # 是否开启接口文档 + enabled: true +# swagger-ui: +# # 持久化认证数据 +# persistAuthorization: true + info: + # 标题 + title: '标题:${ruoyi.name}后台管理系统_接口文档' + # 描述 + description: '描述:用于管理集团旗下公司的人员信息,具体包括XXX,XXX模块...' + # 版本 + version: '版本号: ${revision}' + # 作者信息 + contact: + name: Lion Li + email: crazylionli@163.com + url: https://gitee.com/dromara/RuoYi-Vue-Plus + components: + # 鉴权方式配置 + security-schemes: + apiKey: + type: APIKEY + in: HEADER + name: ${sa-token.token-name} + #这里定义了两个分组,可定义多个,也可以不定义 + group-configs: + - group: 1.演示模块 + packages-to-scan: com.ruoyi.demo + - group: 2.系统模块 + packages-to-scan: com.ruoyi.web + - group: 3.代码生成模块 + packages-to-scan: com.ruoyi.generator # 防止XSS攻击 xss: @@ -153,90 +239,31 @@ xss: excludes: /system/notice # 匹配链接 urlPatterns: /system/*,/monitor/*,/tool/* -extra: - wx: - appid: wxappid - secret: wxsecret - redirect: "" -scheduling: - enabled: true -gen: - # 作者 - author: zcc - # 默认生成包路径 system 需改成自己的模块名称 如 system monitor tool - packageName: com.cyl.wms - # 自动去除表前缀,默认是false - autoRemovePre: true - # 表前缀(生成类名不会包含表前缀,多个用逗号分隔) - tablePrefix: wms_ - # 一级权限名 - rootPermission: wms - # 模板根路径 - templateRootPath: vm - # 路径 - path: - # 后端根目录 - backPath: D:\java_project\wms\wms-ruoyi - # 后端 service 模块名 - serviceModule: wms - # 后端 api 模块名, 默认与 service 一致 - apiModule: wms - # 前端根目录 - frontPath: D:\java_project\wms\ruoyi-wms-vue2 - # 前端 api 目录 - frontApiPath: src/api/wms - # 前端 view 目录 - frontViewPath: src/views/wms - # sql 目录 - sql: sql - # 环境变量 - env: - # 审计 的 基类(创建者,创建时间,更新者,更新时间) - baseAudit: com.ruoyi.common.core.domain.BaseAudit - # 树 的 基类 - baseTree: com.ruoyi.common.core.domain.TreeEntity - # 对于新增的模板,如果没有默认值,在这里进行配置 - fileMap: - "api.js.vm": "${frontPath}/${frontApiPath}/${className}.js" - "controller.java.vm": "${backPath}/${serviceModule}/${MAIN_JAVA}/${packageName}/controller/${ClassName}Controller.java" - "service.java.vm": "${backPath}/${serviceModule}/${MAIN_JAVA}/${packageName}/service/${ClassName}Service.java" - "mapper.java.vm": "${backPath}/${serviceModule}/${MAIN_JAVA}/${packageName}/mapper/${ClassName}Mapper.java" - "convert.java.vm": "${backPath}/${serviceModule}/${MAIN_JAVA}/${packageName}/convert/${ClassName}Convert.java" - "example.java.vm": "${backPath}/${serviceModule}/${MAIN_JAVA}/${packageName}/pojo/example/${ClassName}Example.java" - "query.java.vm": "${backPath}/${serviceModule}/${MAIN_JAVA}/${packageName}/pojo/query/${ClassName}Query.java" - "dto.java.vm": "${backPath}/${serviceModule}/${MAIN_JAVA}/${packageName}/pojo/dto/${ClassName}DTO.java" - "vo.java.vm": "${backPath}/${serviceModule}/${MAIN_JAVA}/${packageName}/pojo/vo/${ClassName}VO.java" - "domain.java.vm": "${backPath}/${apiModule}/${MAIN_JAVA}/${packageName}/domain/${ClassName}.java" - "mapper.xml.vm": "${backPath}/${serviceModule}/${MAIN_RESOURCES}/mapper/${ClassName}Mapper.xml" - "sql.vm": "${backPath}/sql/${className}.sql" - "h2.sql.vm": "${backPath}/${serviceModule}/${MAIN_JAVA}/db/${tableName}-h2.sql" - "add.vue.vm": "${frontPath}/${frontViewPath}/Add${ClassName}.vue" - "index.vue.vm": "${frontPath}/${frontViewPath}/${className}/index.vue" - "index-tree.vue.vm": "${frontPath}/${frontViewPath}/index.vue" - "sub-domain.java.vm": "${frontPath}/${frontViewPath}/Sub${ClassName}.vue" - templates: - - vm/js/api.js.vm - - vm/java/controller.java.vm - - vm/java/service.java.vm - - vm/java/mapper.java.vm - - vm/java/convert.java.vm - - vm/java/query.java.vm - - vm/java/dto.java.vm - - vm/java/vo.java.vm - - vm/java/domain.java.vm - - vm/xml/mapper.xml.vm - - vm/sql/sql.vm - testTemplates: - # - vm/sql/h2.sql.vm - crudTemplates: - # - vm/vue/add.vue.vm - - vm/vue/index.vue.vm - treeTemplates: - # - vm/vue/index-tree.vue.vm - subTemplates: - # - vm/vue/index.vue.vm - # - vm/java/sub-domain.java.vm - type2component: - "String": "a-input(" - "LocalDate": "a-date-picker(" - "LocalDateTime": "a-date-picker(format=\"YYYY-MM-DD HH:mm\"" + +# 全局线程池相关配置 +thread-pool: + # 是否开启线程池 + enabled: false + # 队列最大长度 + queueCapacity: 128 + # 线程池维护线程所允许的空闲时间 + keepAliveSeconds: 300 + +--- # 分布式锁 lock4j 全局配置 +lock4j: + # 获取分布式锁超时时间,默认为 3000 毫秒 + acquire-timeout: 3000 + # 分布式锁的超时时间,默认为 30 秒 + expire: 30000 + +--- # Actuator 监控端点的配置项 +management: + endpoints: + web: + exposure: + include: '*' + endpoint: + health: + show-details: ALWAYS + logfile: + external-file: ./logs/sys-console.log diff --git a/ruoyi-admin/src/main/resources/banner.txt b/ruoyi-admin/src/main/resources/banner.txt index 0931cb8..1a0b58f 100644 --- a/ruoyi-admin/src/main/resources/banner.txt +++ b/ruoyi-admin/src/main/resources/banner.txt @@ -1,24 +1,2 @@ -Application Version: ${ruoyi.version} +Application Version: ${revision} Spring Boot Version: ${spring-boot.version} -//////////////////////////////////////////////////////////////////// -// _ooOoo_ // -// o8888888o // -// 88" . "88 // -// (| ^_^ |) // -// O\ = /O // -// ____/`---'\____ // -// .' \\| |// `. // -// / \\||| : |||// \ // -// / _||||| -:- |||||- \ // -// | | \\\ - /// | | // -// | \_| ''\---/'' | | // -// \ .-\__ `-` ___/-. / // -// ___`. .' /--.--\ `. . ___ // -// ."" '< `.___\_<|>_/___.' >'"". // -// | | : `- \`.;`\ _ /`;.`/ - ` : | | // -// \ \ `-. \_ __\ /__ _/ .-` / / // -// ========`-.____`-.___\_____/___.-`____.-'======== // -// `=---=' // -// ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ // -// 佛祖保佑 永不宕机 永无BUG // -//////////////////////////////////////////////////////////////////// \ No newline at end of file diff --git a/ruoyi-admin/src/main/resources/i18n/messages.properties b/ruoyi-admin/src/main/resources/i18n/messages.properties index 71cf52d..ffdd8f3 100644 --- a/ruoyi-admin/src/main/resources/i18n/messages.properties +++ b/ruoyi-admin/src/main/resources/i18n/messages.properties @@ -2,32 +2,35 @@ not.null=* 必须填写 user.jcaptcha.error=验证码错误 user.jcaptcha.expire=验证码已失效 -user.not.exists=用户不存在/密码错误 +user.not.exists=对不起, 您的账号:{0} 不存在. user.password.not.match=用户不存在/密码错误 user.password.retry.limit.count=密码输入错误{0}次 -user.password.retry.limit.exceed=密码输入错误{0}次,帐户锁定10分钟 -user.password.delete=对不起,您的账号已被删除 -user.blocked=用户已封禁,请联系管理员 +user.password.retry.limit.exceed=密码输入错误{0}次,帐户锁定{1}分钟 +user.password.delete=对不起,您的账号:{0} 已被删除 +user.blocked=对不起,您的账号:{0} 已禁用,请联系管理员 role.blocked=角色已封禁,请联系管理员 user.logout.success=退出成功 - length.not.valid=长度必须在{min}到{max}个字符之间 - +user.username.not.blank=用户名不能为空 user.username.not.valid=* 2到20个汉字、字母、数字或下划线组成,且必须以非数字开头 +user.username.length.valid=账户长度必须在{min}到{max}个字符之间 +user.password.not.blank=用户密码不能为空 +user.password.length.valid=用户密码长度必须在{min}到{max}个字符之间 user.password.not.valid=* 5-50个字符 - user.email.not.valid=邮箱格式错误 +user.email.not.blank=邮箱不能为空 +user.phonenumber.not.blank=用户手机号不能为空 user.mobile.phone.number.not.valid=手机号格式错误 user.login.success=登录成功 user.register.success=注册成功 +user.register.save.error=保存用户 {0} 失败,注册账号已存在 +user.register.error=注册失败,请联系系统管理人员 user.notfound=请重新登录 user.forcelogout=管理员强制退出,请重新登录 user.unknown.error=未知错误,请重新登录 - ##文件上传消息 upload.exceed.maxSize=上传的文件大小超出限制的文件大小!
允许的文件最大大小是:{0}MB! upload.filename.exceed.length=上传的文件名最长{0}个字符 - ##权限 no.permission=您没有数据的权限,请联系管理员添加权限 [{0}] no.create.permission=您没有创建数据的权限,请联系管理员添加权限 [{0}] @@ -35,3 +38,12 @@ no.update.permission=您没有修改数据的权限,请联系管理员添加 no.delete.permission=您没有删除数据的权限,请联系管理员添加权限 [{0}] no.export.permission=您没有导出数据的权限,请联系管理员添加权限 [{0}] no.view.permission=您没有查看数据的权限,请联系管理员添加权限 [{0}] +repeat.submit.message=不允许重复提交,请稍候再试 +rate.limiter.message=访问过于频繁,请稍候再试 +sms.code.not.blank=短信验证码不能为空 +sms.code.retry.limit.count=短信验证码输入错误{0}次 +sms.code.retry.limit.exceed=短信验证码输入错误{0}次,帐户锁定{1}分钟 +email.code.not.blank=邮箱验证码不能为空 +email.code.retry.limit.count=邮箱验证码输入错误{0}次 +email.code.retry.limit.exceed=邮箱验证码输入错误{0}次,帐户锁定{1}分钟 +xcx.code.not.blank=小程序code不能为空 diff --git a/ruoyi-admin/src/main/resources/i18n/messages_en_US.properties b/ruoyi-admin/src/main/resources/i18n/messages_en_US.properties new file mode 100644 index 0000000..c1ca439 --- /dev/null +++ b/ruoyi-admin/src/main/resources/i18n/messages_en_US.properties @@ -0,0 +1,49 @@ +#错误消息 +not.null=* Required fill in +user.jcaptcha.error=Captcha error +user.jcaptcha.expire=Captcha invalid +user.not.exists=Sorry, your account: {0} does not exist +user.password.not.match=User does not exist/Password error +user.password.retry.limit.count=Password input error {0} times +user.password.retry.limit.exceed=Password input error {0} times, account locked for {1} minutes +user.password.delete=Sorry, your account:{0} has been deleted +user.blocked=Sorry, your account: {0} has been disabled. Please contact the administrator +role.blocked=Role disabled,please contact administrators +user.logout.success=Exit successful +length.not.valid=The length must be between {min} and {max} characters +user.username.not.blank=Username cannot be blank +user.username.not.valid=* 2 to 20 chinese characters, letters, numbers or underscores, and must start with a non number +user.username.length.valid=Account length must be between {min} and {max} characters +user.password.not.blank=Password cannot be empty +user.password.length.valid=Password length must be between {min} and {max} characters +user.password.not.valid=* 5-50 characters +user.email.not.valid=Mailbox format error +user.email.not.blank=Mailbox cannot be blank +user.phonenumber.not.blank=Phone number cannot be blank +user.mobile.phone.number.not.valid=Phone number format error +user.login.success=Login successful +user.register.success=Register successful +user.register.save.error=Failed to save user {0}, The registered account already exists +user.register.error=Register failed, please contact system administrator +user.notfound=Please login again +user.forcelogout=The administrator is forced to exit,please login again +user.unknown.error=Unknown error, please login again +##文件上传消息 +upload.exceed.maxSize=The uploaded file size exceeds the limit file size!
the maximum allowed file size is:{0}MB! +upload.filename.exceed.length=The maximum length of uploaded file name is {0} characters +##权限 +no.permission=You do not have permission to the data,please contact your administrator to add permissions [{0}] +no.create.permission=You do not have permission to create data,please contact your administrator to add permissions [{0}] +no.update.permission=You do not have permission to modify data,please contact your administrator to add permissions [{0}] +no.delete.permission=You do not have permission to delete data,please contact your administrator to add permissions [{0}] +no.export.permission=You do not have permission to export data,please contact your administrator to add permissions [{0}] +no.view.permission=You do not have permission to view data,please contact your administrator to add permissions [{0}] +repeat.submit.message=Repeat submit is not allowed, please try again later +rate.limiter.message=Visit too frequently, please try again later +sms.code.not.blank=Sms code cannot be blank +sms.code.retry.limit.count=Sms code input error {0} times +sms.code.retry.limit.exceed=Sms code input error {0} times, account locked for {1} minutes +email.code.not.blank=Email code cannot be blank +email.code.retry.limit.count=Email code input error {0} times +email.code.retry.limit.exceed=Email code input error {0} times, account locked for {1} minutes +xcx.code.not.blank=Mini program code cannot be blank diff --git a/ruoyi-admin/src/main/resources/i18n/messages_zh_CN.properties b/ruoyi-admin/src/main/resources/i18n/messages_zh_CN.properties new file mode 100644 index 0000000..ffdd8f3 --- /dev/null +++ b/ruoyi-admin/src/main/resources/i18n/messages_zh_CN.properties @@ -0,0 +1,49 @@ +#错误消息 +not.null=* 必须填写 +user.jcaptcha.error=验证码错误 +user.jcaptcha.expire=验证码已失效 +user.not.exists=对不起, 您的账号:{0} 不存在. +user.password.not.match=用户不存在/密码错误 +user.password.retry.limit.count=密码输入错误{0}次 +user.password.retry.limit.exceed=密码输入错误{0}次,帐户锁定{1}分钟 +user.password.delete=对不起,您的账号:{0} 已被删除 +user.blocked=对不起,您的账号:{0} 已禁用,请联系管理员 +role.blocked=角色已封禁,请联系管理员 +user.logout.success=退出成功 +length.not.valid=长度必须在{min}到{max}个字符之间 +user.username.not.blank=用户名不能为空 +user.username.not.valid=* 2到20个汉字、字母、数字或下划线组成,且必须以非数字开头 +user.username.length.valid=账户长度必须在{min}到{max}个字符之间 +user.password.not.blank=用户密码不能为空 +user.password.length.valid=用户密码长度必须在{min}到{max}个字符之间 +user.password.not.valid=* 5-50个字符 +user.email.not.valid=邮箱格式错误 +user.email.not.blank=邮箱不能为空 +user.phonenumber.not.blank=用户手机号不能为空 +user.mobile.phone.number.not.valid=手机号格式错误 +user.login.success=登录成功 +user.register.success=注册成功 +user.register.save.error=保存用户 {0} 失败,注册账号已存在 +user.register.error=注册失败,请联系系统管理人员 +user.notfound=请重新登录 +user.forcelogout=管理员强制退出,请重新登录 +user.unknown.error=未知错误,请重新登录 +##文件上传消息 +upload.exceed.maxSize=上传的文件大小超出限制的文件大小!
允许的文件最大大小是:{0}MB! +upload.filename.exceed.length=上传的文件名最长{0}个字符 +##权限 +no.permission=您没有数据的权限,请联系管理员添加权限 [{0}] +no.create.permission=您没有创建数据的权限,请联系管理员添加权限 [{0}] +no.update.permission=您没有修改数据的权限,请联系管理员添加权限 [{0}] +no.delete.permission=您没有删除数据的权限,请联系管理员添加权限 [{0}] +no.export.permission=您没有导出数据的权限,请联系管理员添加权限 [{0}] +no.view.permission=您没有查看数据的权限,请联系管理员添加权限 [{0}] +repeat.submit.message=不允许重复提交,请稍候再试 +rate.limiter.message=访问过于频繁,请稍候再试 +sms.code.not.blank=短信验证码不能为空 +sms.code.retry.limit.count=短信验证码输入错误{0}次 +sms.code.retry.limit.exceed=短信验证码输入错误{0}次,帐户锁定{1}分钟 +email.code.not.blank=邮箱验证码不能为空 +email.code.retry.limit.count=邮箱验证码输入错误{0}次 +email.code.retry.limit.exceed=邮箱验证码输入错误{0}次,帐户锁定{1}分钟 +xcx.code.not.blank=小程序code不能为空 diff --git a/ruoyi-admin/src/main/resources/ip2region.xdb b/ruoyi-admin/src/main/resources/ip2region.xdb new file mode 100644 index 0000000..31f96a1 Binary files /dev/null and b/ruoyi-admin/src/main/resources/ip2region.xdb differ diff --git a/ruoyi-admin/src/main/resources/logback-plus.xml b/ruoyi-admin/src/main/resources/logback-plus.xml new file mode 100644 index 0000000..40fa33b --- /dev/null +++ b/ruoyi-admin/src/main/resources/logback-plus.xml @@ -0,0 +1,129 @@ + + + + + + + + + + ${console.log.pattern} + utf-8 + + + + + + ${log.path}/sys-console.log + + + ${log.path}/sys-console.%d{yyyy-MM-dd}.log + + 1 + + + ${log.pattern} + utf-8 + + + + INFO + + + + + + ${log.path}/sys-info.log + + + + ${log.path}/sys-info.%d{yyyy-MM-dd}.log + + 60 + + + ${log.pattern} + + + + INFO + + ACCEPT + + DENY + + + + + ${log.path}/sys-error.log + + + + ${log.path}/sys-error.%d{yyyy-MM-dd}.log + + 60 + + + ${log.pattern} + + + + ERROR + + ACCEPT + + DENY + + + + + + + 0 + + 512 + + + + + + + + 0 + + 512 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/ruoyi-admin/src/main/resources/logback.xml b/ruoyi-admin/src/main/resources/logback.xml deleted file mode 100644 index 2c73b6d..0000000 --- a/ruoyi-admin/src/main/resources/logback.xml +++ /dev/null @@ -1,87 +0,0 @@ - - - - - - - - - - - ${log.pattern} - - - - - - ${log.path}/wms.current.log - - - - ${log.path}/wms.%d{yyyy-MM-dd}.log - - 60 - - - ${log.pattern} - - - - INFO - - - - - ${log.path}/wms-error.log - - - - ${log.path}/wms-error.%d{yyyy-MM-dd}.log - - 60 - - - ${log.pattern} - - - - ERROR - - - - - - ${log.path}/sys-user.log - - - ${log.path}/sys-user.%d{yyyy-MM-dd}.log - - 60 - - - ${log.pattern} - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/ruoyi-admin/src/main/resources/mybatis/mybatis-config.xml b/ruoyi-admin/src/main/resources/mybatis/mybatis-config.xml deleted file mode 100644 index e62f8cc..0000000 --- a/ruoyi-admin/src/main/resources/mybatis/mybatis-config.xml +++ /dev/null @@ -1,15 +0,0 @@ - - - - - - - - - - - - - diff --git a/ruoyi-admin/src/main/resources/spy.properties b/ruoyi-admin/src/main/resources/spy.properties new file mode 100644 index 0000000..abbd893 --- /dev/null +++ b/ruoyi-admin/src/main/resources/spy.properties @@ -0,0 +1,28 @@ +# p6spy 性能分析插件配置文件 +modulelist=com.baomidou.mybatisplus.extension.p6spy.MybatisPlusLogFactory,com.p6spy.engine.outage.P6OutageFactory +# 自定义日志打印 +logMessageFormat=com.baomidou.mybatisplus.extension.p6spy.P6SpyLogger +#日志输出到控制台 +appender=com.baomidou.mybatisplus.extension.p6spy.StdoutLogger +# 使用日志系统记录 sql +#appender=com.p6spy.engine.spy.appender.Slf4JLogger +# 设置 p6spy driver 代理 +#deregisterdrivers=true +# 取消JDBC URL前缀 +useprefix=true +# 配置记录 Log 例外,可去掉的结果集有error,info,batch,debug,statement,commit,rollback,result,resultset. +excludecategories=info,debug,result,commit,resultset +# 日期格式 +dateformat=yyyy-MM-dd HH:mm:ss +# SQL语句打印时间格式 +databaseDialectTimestampFormat=yyyy-MM-dd HH:mm:ss +# 实际驱动可多个 +#driverlist=org.h2.Driver +# 是否开启慢SQL记录 +outagedetection=true +# 慢SQL记录标准 2 秒 +outagedetectioninterval=2 +# 是否过滤 Log +filter=true +# 过滤 Log 时所排除的 sql 关键字,以逗号分隔 +exclude=SELECT 1 diff --git a/ruoyi-admin/src/test/java/com/fjp/lc/test/common/CommonTest.java b/ruoyi-admin/src/test/java/com/fjp/lc/test/common/CommonTest.java deleted file mode 100644 index 59a7687..0000000 --- a/ruoyi-admin/src/test/java/com/fjp/lc/test/common/CommonTest.java +++ /dev/null @@ -1,45 +0,0 @@ -package com.fjp.lc.test.common; - -import cn.hutool.core.img.Img; -import cn.hutool.core.img.ImgUtil; -import cn.hutool.core.io.FileUtil; -import lombok.extern.slf4j.Slf4j; -import org.junit.Test; - -import java.io.File; -import java.io.IOException; - -@Slf4j -public class CommonTest { - /* @Test - public void test3() throws IOException { - Long start = System.currentTimeMillis(); - log.info("start {}", start); - Thumbnails.of("D:/build/tt.jpg") - .scale(1f) - .outputQuality(0.5f) - .toFile("D:/build/tt1.jpg"); - log.info("end {}", System.currentTimeMillis() - start); - }*/ - - @Test - public void test4() throws IOException { - String f1 = "D:/build/tt.jpg"; - String f2 = "D:/build/tt2.jpg"; - Long start = System.currentTimeMillis(); - log.info("start {}", start); - ImgUtil.scale(new File(f1), new File(f2), .1f); - log.info("end {}", System.currentTimeMillis() - start); - } - @Test - public void test5() throws IOException { - String f1 = "D:/build/tt.jpg"; - String f2 = "D:/build/tt3.jpg"; - Long start = System.currentTimeMillis(); - log.info("start {}", start); - Img.from(FileUtil.file(f1)) - .setQuality(1)//压缩比率 - .write(FileUtil.file(f2)); - log.info("end {}", System.currentTimeMillis() - start); - } -} diff --git a/ruoyi-admin/src/test/java/com/fjp/lc/test/service/ServiceTest.java b/ruoyi-admin/src/test/java/com/fjp/lc/test/service/ServiceTest.java deleted file mode 100644 index 97c4e77..0000000 --- a/ruoyi-admin/src/test/java/com/fjp/lc/test/service/ServiceTest.java +++ /dev/null @@ -1,30 +0,0 @@ -package com.fjp.lc.test.service; - -import com.cyl.wms.service.ShipmentOrderService; -import com.ruoyi.RuoYiApplication; -import com.ruoyi.common.utils.SecurityUtils; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.boot.test.context.SpringBootTest; -import org.springframework.test.context.junit4.SpringRunner; - -@RunWith(SpringRunner.class) -@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.NONE, classes = RuoYiApplication.class) -public class ServiceTest { - @Autowired - private ShipmentOrderService shipmentOrderService; - @Test - public void contextLoads() { - shipmentOrderService.allocatedInventory(490L,1); - } - - /* - * 加密密码 重置密码 默认密码 更改密码 - * */ - @Test - public void encryptPassword() { - String newPwd = "admin123"; - System.out.println("新密码:"+SecurityUtils.encryptPassword(newPwd)); - } -} diff --git a/ruoyi-admin/src/test/java/com/ruoyi/test/AssertUnitTest.java b/ruoyi-admin/src/test/java/com/ruoyi/test/AssertUnitTest.java new file mode 100644 index 0000000..5b9c9f8 --- /dev/null +++ b/ruoyi-admin/src/test/java/com/ruoyi/test/AssertUnitTest.java @@ -0,0 +1,45 @@ +package com.ruoyi.test; + +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.DisplayName; +import org.junit.jupiter.api.Test; + +/** + * 断言单元测试案例 + * + * @author Lion Li + */ +@DisplayName("断言单元测试案例") +public class AssertUnitTest { + + @DisplayName("测试 assertEquals 方法") + @Test + public void testAssertEquals() { + Assertions.assertEquals("666", new String("666")); + Assertions.assertNotEquals("666", new String("666")); + } + + @DisplayName("测试 assertSame 方法") + @Test + public void testAssertSame() { + Object obj = new Object(); + Object obj1 = obj; + Assertions.assertSame(obj, obj1); + Assertions.assertNotSame(obj, obj1); + } + + @DisplayName("测试 assertTrue 方法") + @Test + public void testAssertTrue() { + Assertions.assertTrue(true); + Assertions.assertFalse(true); + } + + @DisplayName("测试 assertNull 方法") + @Test + public void testAssertNull() { + Assertions.assertNull(null); + Assertions.assertNotNull(null); + } + +} diff --git a/ruoyi-admin/src/test/java/com/ruoyi/test/DemoUnitTest.java b/ruoyi-admin/src/test/java/com/ruoyi/test/DemoUnitTest.java new file mode 100644 index 0000000..b40c123 --- /dev/null +++ b/ruoyi-admin/src/test/java/com/ruoyi/test/DemoUnitTest.java @@ -0,0 +1,70 @@ +package com.ruoyi.test; + +import com.ruoyi.common.core.config.RuoYiConfig; +import org.junit.jupiter.api.*; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.boot.test.context.SpringBootTest; + +import java.util.concurrent.TimeUnit; + +/** + * 单元测试案例 + * + * @author Lion Li + */ +@SpringBootTest // 此注解只能在 springboot 主包下使用 需包含 main 方法与 yml 配置文件 +@DisplayName("单元测试案例") +public class DemoUnitTest { + + @Autowired + private RuoYiConfig ruoYiConfig; + + @DisplayName("测试 @SpringBootTest @Test @DisplayName 注解") + @Test + public void testTest() { + System.out.println(ruoYiConfig); + } + + @Disabled + @DisplayName("测试 @Disabled 注解") + @Test + public void testDisabled() { + System.out.println(ruoYiConfig); + } + + @Timeout(value = 2L, unit = TimeUnit.SECONDS) + @DisplayName("测试 @Timeout 注解") + @Test + public void testTimeout() throws InterruptedException { + Thread.sleep(3000); + System.out.println(ruoYiConfig); + } + + + @DisplayName("测试 @RepeatedTest 注解") + @RepeatedTest(3) + public void testRepeatedTest() { + System.out.println(666); + } + + @BeforeAll + public static void testBeforeAll() { + System.out.println("@BeforeAll =================="); + } + + @BeforeEach + public void testBeforeEach() { + System.out.println("@BeforeEach =================="); + } + + @AfterEach + public void testAfterEach() { + System.out.println("@AfterEach =================="); + } + + @AfterAll + public static void testAfterAll() { + System.out.println("@AfterAll =================="); + } + +} diff --git a/ruoyi-admin/src/test/java/com/ruoyi/test/ParamUnitTest.java b/ruoyi-admin/src/test/java/com/ruoyi/test/ParamUnitTest.java new file mode 100644 index 0000000..9d61383 --- /dev/null +++ b/ruoyi-admin/src/test/java/com/ruoyi/test/ParamUnitTest.java @@ -0,0 +1,72 @@ +package com.ruoyi.test; + +import com.ruoyi.common.core.enums.UserType; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.DisplayName; +import org.junit.jupiter.params.ParameterizedTest; +import org.junit.jupiter.params.provider.EnumSource; +import org.junit.jupiter.params.provider.MethodSource; +import org.junit.jupiter.params.provider.NullSource; +import org.junit.jupiter.params.provider.ValueSource; + +import java.util.ArrayList; +import java.util.List; +import java.util.stream.Stream; + +/** + * 带参数单元测试案例 + * + * @author Lion Li + */ +@DisplayName("带参数单元测试案例") +public class ParamUnitTest { + + @DisplayName("测试 @ValueSource 注解") + @ParameterizedTest + @ValueSource(strings = {"t1", "t2", "t3"}) + public void testValueSource(String str) { + System.out.println(str); + } + + @DisplayName("测试 @NullSource 注解") + @ParameterizedTest + @NullSource + public void testNullSource(String str) { + System.out.println(str); + } + + @DisplayName("测试 @EnumSource 注解") + @ParameterizedTest + @EnumSource(UserType.class) + public void testEnumSource(UserType type) { + System.out.println(type.getUserType()); + } + + @DisplayName("测试 @MethodSource 注解") + @ParameterizedTest + @MethodSource("getParam") + public void testMethodSource(String str) { + System.out.println(str); + } + + public static Stream getParam() { + List list = new ArrayList<>(); + list.add("t1"); + list.add("t2"); + list.add("t3"); + return list.stream(); + } + + @BeforeEach + public void testBeforeEach() { + System.out.println("@BeforeEach =================="); + } + + @AfterEach + public void testAfterEach() { + System.out.println("@AfterEach =================="); + } + + +} diff --git a/ruoyi-admin/src/test/java/com/ruoyi/test/TagUnitTest.java b/ruoyi-admin/src/test/java/com/ruoyi/test/TagUnitTest.java new file mode 100644 index 0000000..04240a0 --- /dev/null +++ b/ruoyi-admin/src/test/java/com/ruoyi/test/TagUnitTest.java @@ -0,0 +1,54 @@ +package com.ruoyi.test; + +import org.junit.jupiter.api.*; +import org.springframework.boot.test.context.SpringBootTest; + +/** + * 标签单元测试案例 + * + * @author Lion Li + */ +@SpringBootTest +@DisplayName("标签单元测试案例") +public class TagUnitTest { + + @Tag("dev") + @DisplayName("测试 @Tag dev") + @Test + public void testTagDev() { + System.out.println("dev"); + } + + @Tag("prod") + @DisplayName("测试 @Tag prod") + @Test + public void testTagProd() { + System.out.println("prod"); + } + + @Tag("local") + @DisplayName("测试 @Tag local") + @Test + public void testTagLocal() { + System.out.println("local"); + } + + @Tag("exclude") + @DisplayName("测试 @Tag exclude") + @Test + public void testTagExclude() { + System.out.println("exclude"); + } + + @BeforeEach + public void testBeforeEach() { + System.out.println("@BeforeEach =================="); + } + + @AfterEach + public void testAfterEach() { + System.out.println("@AfterEach =================="); + } + + +} diff --git a/ruoyi-common/pom.xml b/ruoyi-common/pom.xml index 420c027..d3ddd89 100644 --- a/ruoyi-common/pom.xml +++ b/ruoyi-common/pom.xml @@ -3,128 +3,39 @@ 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"> - ruoyi + ruoyi-fast-service com.ruoyi - 3.7.0 + ${revision} 4.0.0 + + ruoyi-common-bom + ruoyi-common-core + ruoyi-common-oss + ruoyi-common-sms + ruoyi-common-json + ruoyi-common-excel + ruoyi-common-redis + ruoyi-common-satoken + ruoyi-common-web + ruoyi-common-security + ruoyi-common-mybatis + ruoyi-common-mail + ruoyi-common-log + ruoyi-common-ratelimiter + ruoyi-common-translation + ruoyi-common-sensitive + ruoyi-common-encrypt + ruoyi-common-idempotent + ruoyi-common-doc + + ruoyi-common + pom - common通用工具 + common 通用模块 - - - - - org.springframework - spring-context-support - - - - - org.springframework - spring-web - - - - - org.springframework.boot - spring-boot-starter-security - - - - - com.github.pagehelper - pagehelper-spring-boot-starter - - - - - org.springframework.boot - spring-boot-starter-validation - - - - - org.apache.commons - commons-lang3 - - - - - com.fasterxml.jackson.core - jackson-databind - - - - - com.alibaba - fastjson - - - - - commons-io - commons-io - - - - - commons-fileupload - commons-fileupload - - - - - org.apache.poi - poi-ooxml - - - - - org.yaml - snakeyaml - - - - - io.jsonwebtoken - jjwt - - - - - javax.xml.bind - jaxb-api - - - - - org.springframework.boot - spring-boot-starter-data-redis - - - - - org.apache.commons - commons-pool2 - - - - - eu.bitwalker - UserAgentUtils - - - - - javax.servlet - javax.servlet-api - - - - diff --git a/ruoyi-common/ruoyi-common-bom/pom.xml b/ruoyi-common/ruoyi-common-bom/pom.xml new file mode 100644 index 0000000..b608de5 --- /dev/null +++ b/ruoyi-common/ruoyi-common-bom/pom.xml @@ -0,0 +1,146 @@ + + + 4.0.0 + + com.ruoyi + ruoyi-common-bom + ${revision} + pom + + + ruoyi-common-bom common依赖项 + + + + 5.2.0 + + + + + + + com.ruoyi + ruoyi-common-core + ${revision} + + + + + com.ruoyi + ruoyi-common-oss + ${revision} + + + + + com.ruoyi + ruoyi-common-sms + ${revision} + + + + + com.ruoyi + ruoyi-common-json + ${revision} + + + + + com.ruoyi + ruoyi-common-excel + ${revision} + + + + + com.ruoyi + ruoyi-common-redis + ${revision} + + + + + com.ruoyi + ruoyi-common-satoken + ${revision} + + + + com.ruoyi + ruoyi-common-web + ${revision} + + + + com.ruoyi + ruoyi-common-security + ${revision} + + + + com.ruoyi + ruoyi-common-mybatis + ${revision} + + + + com.ruoyi + ruoyi-common-mail + ${revision} + + + + com.ruoyi + ruoyi-common-log + ${revision} + + + + com.ruoyi + ruoyi-common-translation + ${revision} + + + + com.ruoyi + ruoyi-common-ratelimiter + ${revision} + + + + com.ruoyi + ruoyi-common-encrypt + ${revision} + + + + com.ruoyi + ruoyi-common-sensitive + ${revision} + + + + com.ruoyi + ruoyi-common-idempotent + ${revision} + + + + com.ruoyi + ruoyi-common-job + ${revision} + + + + com.ruoyi + ruoyi-common-doc + ${revision} + + + + + + diff --git a/ruoyi-common/ruoyi-common-core/pom.xml b/ruoyi-common/ruoyi-common-core/pom.xml new file mode 100644 index 0000000..a69a6bc --- /dev/null +++ b/ruoyi-common/ruoyi-common-core/pom.xml @@ -0,0 +1,157 @@ + + + + com.ruoyi + ruoyi-common + ${revision} + + 4.0.0 + + ruoyi-common-core + + + ruoyi-common-core 核心模块 + + + + + + + com.baomidou + dynamic-datasource-spring-boot3-starter + + + + com.baomidou + mybatis-plus-spring-boot3-starter + + + + + org.springframework + spring-context-support + + + + + org.springframework + spring-web + + + + + cn.dev33 + sa-token-spring-boot3-starter + + + + cn.dev33 + sa-token-jwt + + + + + org.springframework.boot + spring-boot-starter-validation + + + + + org.apache.commons + commons-lang3 + + + + + org.yaml + snakeyaml + + + + + jakarta.servlet + jakarta.servlet-api + + + + cn.hutool + hutool-core + + + + cn.hutool + hutool-http + + + + cn.hutool + hutool-captcha + + + + cn.hutool + hutool-jwt + + + + cn.hutool + hutool-extra + + + + jakarta.mail + jakarta.mail-api + + + org.eclipse.angus + jakarta.mail + + + + org.projectlombok + lombok + + + + + org.springframework.boot + spring-boot-configuration-processor + + + + + org.redisson + redisson-spring-boot-starter + + + + org.redisson + redisson-spring-data-27 + + + + com.baomidou + lock4j-redisson-spring-boot-starter + + + + + org.bouncycastle + bcprov-jdk15to18 + + + + + org.lionsoul + ip2region + + + + io.github.linpeilie + mapstruct-plus-spring-boot-starter + + + + diff --git a/ruoyi-common/ruoyi-common-core/src/main/java/com/ruoyi/common/core/config/ApplicationConfig.java b/ruoyi-common/ruoyi-common-core/src/main/java/com/ruoyi/common/core/config/ApplicationConfig.java new file mode 100644 index 0000000..2c0ba7b --- /dev/null +++ b/ruoyi-common/ruoyi-common-core/src/main/java/com/ruoyi/common/core/config/ApplicationConfig.java @@ -0,0 +1,17 @@ +package com.ruoyi.common.core.config; + +import org.springframework.boot.autoconfigure.AutoConfiguration; +import org.springframework.context.annotation.EnableAspectJAutoProxy; +import org.springframework.scheduling.annotation.EnableAsync; + +/** + * 程序注解配置 + * + * @author Lion Li + */ +@AutoConfiguration +@EnableAspectJAutoProxy +@EnableAsync(proxyTargetClass = true) +public class ApplicationConfig { + +} diff --git a/ruoyi-common/ruoyi-common-core/src/main/java/com/ruoyi/common/core/config/AsyncConfig.java b/ruoyi-common/ruoyi-common-core/src/main/java/com/ruoyi/common/core/config/AsyncConfig.java new file mode 100644 index 0000000..d3ed638 --- /dev/null +++ b/ruoyi-common/ruoyi-common-core/src/main/java/com/ruoyi/common/core/config/AsyncConfig.java @@ -0,0 +1,50 @@ +package com.ruoyi.common.core.config; + +import cn.hutool.core.util.ArrayUtil; +import com.ruoyi.common.core.exception.ServiceException; +import com.ruoyi.common.core.utils.SpringUtils; +import org.springframework.aop.interceptor.AsyncUncaughtExceptionHandler; +import org.springframework.boot.autoconfigure.AutoConfiguration; +import org.springframework.core.task.VirtualThreadTaskExecutor; +import org.springframework.scheduling.annotation.AsyncConfigurer; + +import java.util.Arrays; +import java.util.concurrent.Executor; + +/** + * 异步配置 + * + * @author Lion Li + */ +@AutoConfiguration +public class AsyncConfig implements AsyncConfigurer { + + /** + * 自定义 @Async 注解使用系统线程池 + */ + @Override + public Executor getAsyncExecutor() { + if(SpringUtils.isVirtual()) { + return new VirtualThreadTaskExecutor("async-"); + } + return SpringUtils.getBean("scheduledExecutorService"); + } + + /** + * 异步执行异常处理 + */ + @Override + public AsyncUncaughtExceptionHandler getAsyncUncaughtExceptionHandler() { + return (throwable, method, objects) -> { + throwable.printStackTrace(); + StringBuilder sb = new StringBuilder(); + sb.append("Exception message - ").append(throwable.getMessage()) + .append(", Method name - ").append(method.getName()); + if (ArrayUtil.isNotEmpty(objects)) { + sb.append(", Parameter value - ").append(Arrays.toString(objects)); + } + throw new ServiceException(sb.toString()); + }; + } + +} diff --git a/ruoyi-common/ruoyi-common-core/src/main/java/com/ruoyi/common/core/config/RuoYiConfig.java b/ruoyi-common/ruoyi-common-core/src/main/java/com/ruoyi/common/core/config/RuoYiConfig.java new file mode 100644 index 0000000..d2de20c --- /dev/null +++ b/ruoyi-common/ruoyi-common-core/src/main/java/com/ruoyi/common/core/config/RuoYiConfig.java @@ -0,0 +1,38 @@ +package com.ruoyi.common.core.config; + +import lombok.Data; +import org.springframework.boot.context.properties.ConfigurationProperties; +import org.springframework.stereotype.Component; + +/** + * 读取项目相关配置 + * + * @author Lion Li + */ + +@Data +@Component +@ConfigurationProperties(prefix = "ruoyi") +public class RuoYiConfig { + + /** + * 项目名称 + */ + private String name; + + /** + * 版本 + */ + private String version; + + /** + * 版权年份 + */ + private String copyrightYear; + + /** + * 缓存懒加载 + */ + private boolean cacheLazy; + +} diff --git a/ruoyi-common/ruoyi-common-core/src/main/java/com/ruoyi/common/core/config/ThreadPoolConfig.java b/ruoyi-common/ruoyi-common-core/src/main/java/com/ruoyi/common/core/config/ThreadPoolConfig.java new file mode 100644 index 0000000..99bb04d --- /dev/null +++ b/ruoyi-common/ruoyi-common-core/src/main/java/com/ruoyi/common/core/config/ThreadPoolConfig.java @@ -0,0 +1,78 @@ +package com.ruoyi.common.core.config; + +import com.ruoyi.common.core.config.properties.ThreadPoolProperties; +import com.ruoyi.common.core.utils.Threads; +import jakarta.annotation.PreDestroy; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.lang3.concurrent.BasicThreadFactory; +import org.springframework.boot.autoconfigure.AutoConfiguration; +import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; +import org.springframework.boot.context.properties.EnableConfigurationProperties; +import org.springframework.context.annotation.Bean; +import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor; + +import java.util.concurrent.ScheduledExecutorService; +import java.util.concurrent.ScheduledThreadPoolExecutor; +import java.util.concurrent.ThreadPoolExecutor; + +/** + * 线程池配置 + * + * @author Lion Li + **/ +@Slf4j +@AutoConfiguration +@EnableConfigurationProperties(ThreadPoolProperties.class) +public class ThreadPoolConfig { + + /** + * 核心线程数 = cpu 核心数 + 1 + */ + private final int core = Runtime.getRuntime().availableProcessors() + 1; + + private ScheduledExecutorService scheduledExecutorService; + + @Bean(name = "threadPoolTaskExecutor") + @ConditionalOnProperty(prefix = "thread-pool", name = "enabled", havingValue = "true") + public ThreadPoolTaskExecutor threadPoolTaskExecutor(ThreadPoolProperties threadPoolProperties) { + ThreadPoolTaskExecutor executor = new ThreadPoolTaskExecutor(); + executor.setCorePoolSize(core); + executor.setMaxPoolSize(core * 2); + executor.setQueueCapacity(threadPoolProperties.getQueueCapacity()); + executor.setKeepAliveSeconds(threadPoolProperties.getKeepAliveSeconds()); + executor.setRejectedExecutionHandler(new ThreadPoolExecutor.CallerRunsPolicy()); + return executor; + } + + /** + * 执行周期性或定时任务 + */ + @Bean(name = "scheduledExecutorService") + protected ScheduledExecutorService scheduledExecutorService() { + ScheduledThreadPoolExecutor scheduledThreadPoolExecutor = new ScheduledThreadPoolExecutor(core, + new BasicThreadFactory.Builder().namingPattern("schedule-pool-%d").daemon(true).build(), + new ThreadPoolExecutor.CallerRunsPolicy()) { + @Override + protected void afterExecute(Runnable r, Throwable t) { + super.afterExecute(r, t); + Threads.printException(r, t); + } + }; + this.scheduledExecutorService = scheduledThreadPoolExecutor; + return scheduledThreadPoolExecutor; + } + + /** + * 销毁事件 + */ + @PreDestroy + public void destroy() { + try { + log.info("====关闭后台任务任务线程池===="); + Threads.shutdownAndAwaitTermination(scheduledExecutorService); + } catch (Exception e) { + log.error(e.getMessage(), e); + } + } + +} diff --git a/ruoyi-common/ruoyi-common-core/src/main/java/com/ruoyi/common/core/config/ValidatorConfig.java b/ruoyi-common/ruoyi-common-core/src/main/java/com/ruoyi/common/core/config/ValidatorConfig.java new file mode 100644 index 0000000..bc52084 --- /dev/null +++ b/ruoyi-common/ruoyi-common-core/src/main/java/com/ruoyi/common/core/config/ValidatorConfig.java @@ -0,0 +1,40 @@ +package com.ruoyi.common.core.config; + +import org.hibernate.validator.HibernateValidator; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.MessageSource; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import org.springframework.validation.beanvalidation.LocalValidatorFactoryBean; + +import jakarta.validation.Validator; +import java.util.Properties; + +/** + * 校验框架配置类 + * + * @author Lion Li + */ +@Configuration +public class ValidatorConfig { + + /** + * 配置校验框架 快速返回模式 + */ + @Bean + public Validator validator(MessageSource messageSource) { + LocalValidatorFactoryBean factoryBean = new LocalValidatorFactoryBean(); + // 国际化 + factoryBean.setValidationMessageSource(messageSource); + // 设置使用 HibernateValidator 校验器 + factoryBean.setProviderClass(HibernateValidator.class); + Properties properties = new Properties(); + // 设置 快速异常返回 + properties.setProperty("hibernate.validator.fail_fast", "true"); + factoryBean.setValidationProperties(properties); + // 加载配置 + factoryBean.afterPropertiesSet(); + return factoryBean.getValidator(); + } + +} diff --git a/ruoyi-common/ruoyi-common-core/src/main/java/com/ruoyi/common/core/config/properties/ThreadPoolProperties.java b/ruoyi-common/ruoyi-common-core/src/main/java/com/ruoyi/common/core/config/properties/ThreadPoolProperties.java new file mode 100644 index 0000000..d7f4678 --- /dev/null +++ b/ruoyi-common/ruoyi-common-core/src/main/java/com/ruoyi/common/core/config/properties/ThreadPoolProperties.java @@ -0,0 +1,30 @@ +package com.ruoyi.common.core.config.properties; + +import lombok.Data; +import org.springframework.boot.context.properties.ConfigurationProperties; + +/** + * 线程池 配置属性 + * + * @author Lion Li + */ +@Data +@ConfigurationProperties(prefix = "thread-pool") +public class ThreadPoolProperties { + + /** + * 是否开启线程池 + */ + private boolean enabled; + + /** + * 队列最大长度 + */ + private int queueCapacity; + + /** + * 线程池维护线程所允许的空闲时间 + */ + private int keepAliveSeconds; + +} diff --git a/ruoyi-common/ruoyi-common-core/src/main/java/com/ruoyi/common/core/constant/CacheConstants.java b/ruoyi-common/ruoyi-common-core/src/main/java/com/ruoyi/common/core/constant/CacheConstants.java new file mode 100644 index 0000000..f5453dc --- /dev/null +++ b/ruoyi-common/ruoyi-common-core/src/main/java/com/ruoyi/common/core/constant/CacheConstants.java @@ -0,0 +1,44 @@ +package com.ruoyi.common.core.constant; + +/** + * 缓存的key 常量 + * + * @author ruoyi + */ +public interface CacheConstants { + + /** + * 在线用户 redis key + */ + String ONLINE_TOKEN_KEY = "online_tokens:"; + + /** + * 验证码 redis key + */ + String CAPTCHA_CODE_KEY = "captcha_codes:"; + + /** + * 参数管理 cache key + */ + String SYS_CONFIG_KEY = "sys_config:"; + + /** + * 字典管理 cache key + */ + String SYS_DICT_KEY = "sys_dict:"; + + /** + * 防重提交 redis key + */ + String REPEAT_SUBMIT_KEY = "repeat_submit:"; + + /** + * 限流 redis key + */ + String RATE_LIMIT_KEY = "rate_limit:"; + + /** + * 登录账户密码错误次数 redis key + */ + String PWD_ERR_CNT_KEY = "pwd_err_cnt:"; +} diff --git a/ruoyi-common/ruoyi-common-core/src/main/java/com/ruoyi/common/core/constant/CacheNames.java b/ruoyi-common/ruoyi-common-core/src/main/java/com/ruoyi/common/core/constant/CacheNames.java new file mode 100644 index 0000000..b0d6573 --- /dev/null +++ b/ruoyi-common/ruoyi-common-core/src/main/java/com/ruoyi/common/core/constant/CacheNames.java @@ -0,0 +1,58 @@ +package com.ruoyi.common.core.constant; + +/** + * 缓存组名称常量 + *

+ * key 格式为 cacheNames#ttl#maxIdleTime#maxSize + *

+ * ttl 过期时间 如果设置为0则不过期 默认为0 + * maxIdleTime 最大空闲时间 根据LRU算法清理空闲数据 如果设置为0则不检测 默认为0 + * maxSize 组最大长度 根据LRU算法清理溢出数据 如果设置为0则无限长 默认为0 + *

+ * 例子: test#60s、test#0#60s、test#0#1m#1000、test#1h#0#500 + * + * @author Lion Li + */ +public interface CacheNames { + + /** + * 演示案例 + */ + String DEMO_CACHE = "demo:cache#60s#10m#20"; + + /** + * 系统配置 + */ + String SYS_CONFIG = "sys_config"; + + /** + * 数据字典 + */ + String SYS_DICT = "sys_dict"; + + /** + * 用户账户 + */ + String SYS_USER_NAME = "sys_user_name#30d"; + + /** + * 部门 + */ + String SYS_DEPT = "sys_dept#30d"; + + /** + * OSS内容 + */ + String SYS_OSS = "sys_oss#30d"; + + /** + * OSS配置 + */ + String SYS_OSS_CONFIG = "sys_oss_config"; + + /** + * 在线用户 + */ + String ONLINE_TOKEN = "online_tokens"; + +} diff --git a/ruoyi-common/ruoyi-common-core/src/main/java/com/ruoyi/common/core/constant/Constants.java b/ruoyi-common/ruoyi-common-core/src/main/java/com/ruoyi/common/core/constant/Constants.java new file mode 100644 index 0000000..155d0dc --- /dev/null +++ b/ruoyi-common/ruoyi-common-core/src/main/java/com/ruoyi/common/core/constant/Constants.java @@ -0,0 +1,76 @@ +package com.ruoyi.common.core.constant; + +/** + * 通用常量信息 + * + * @author ruoyi + */ +public interface Constants { + + /** + * UTF-8 字符集 + */ + String UTF8 = "UTF-8"; + + /** + * GBK 字符集 + */ + String GBK = "GBK"; + + /** + * www主域 + */ + String WWW = "www."; + + /** + * http请求 + */ + String HTTP = "http://"; + + /** + * https请求 + */ + String HTTPS = "https://"; + + /** + * 通用成功标识 + */ + String SUCCESS = "0"; + + /** + * 通用失败标识 + */ + String FAIL = "1"; + + /** + * 登录成功 + */ + String LOGIN_SUCCESS = "Success"; + + /** + * 注销 + */ + String LOGOUT = "Logout"; + + /** + * 注册 + */ + String REGISTER = "Register"; + + /** + * 登录失败 + */ + String LOGIN_FAIL = "Error"; + + /** + * 验证码有效期(分钟) + */ + Integer CAPTCHA_EXPIRATION = 2; + + /** + * 令牌 + */ + String TOKEN = "token"; + +} + diff --git a/ruoyi-common/ruoyi-common-core/src/main/java/com/ruoyi/common/core/constant/GlobalConstants.java b/ruoyi-common/ruoyi-common-core/src/main/java/com/ruoyi/common/core/constant/GlobalConstants.java new file mode 100644 index 0000000..6e70146 --- /dev/null +++ b/ruoyi-common/ruoyi-common-core/src/main/java/com/ruoyi/common/core/constant/GlobalConstants.java @@ -0,0 +1,30 @@ +package com.ruoyi.common.core.constant; + +public interface GlobalConstants { + + /** + * 全局 redis key (业务无关的key) + */ + String GLOBAL_REDIS_KEY = "global:"; + + /** + * 验证码 redis key + */ + String CAPTCHA_CODE_KEY = GLOBAL_REDIS_KEY + "captcha_codes:"; + + /** + * 防重提交 redis key + */ + String REPEAT_SUBMIT_KEY = GLOBAL_REDIS_KEY + "repeat_submit:"; + + /** + * 限流 redis key + */ + String RATE_LIMIT_KEY = GLOBAL_REDIS_KEY + "rate_limit:"; + + /** + * 登录账户密码错误次数 redis key + */ + String PWD_ERR_CNT_KEY = GLOBAL_REDIS_KEY + "pwd_err_cnt:"; + +} diff --git a/ruoyi-common/ruoyi-common-core/src/main/java/com/ruoyi/common/core/constant/HttpStatus.java b/ruoyi-common/ruoyi-common-core/src/main/java/com/ruoyi/common/core/constant/HttpStatus.java new file mode 100644 index 0000000..d19931a --- /dev/null +++ b/ruoyi-common/ruoyi-common-core/src/main/java/com/ruoyi/common/core/constant/HttpStatus.java @@ -0,0 +1,93 @@ +package com.ruoyi.common.core.constant; + +/** + * 返回状态码 + * + * @author Lion Li + */ +public interface HttpStatus { + /** + * 操作成功 + */ + int SUCCESS = 200; + + /** + * 对象创建成功 + */ + int CREATED = 201; + + /** + * 请求已经被接受 + */ + int ACCEPTED = 202; + + /** + * 操作已经执行成功,但是没有返回数据 + */ + int NO_CONTENT = 204; + + /** + * 资源已被移除 + */ + int MOVED_PERM = 301; + + /** + * 重定向 + */ + int SEE_OTHER = 303; + + /** + * 资源没有被修改 + */ + int NOT_MODIFIED = 304; + + /** + * 参数列表错误(缺少,格式不匹配) + */ + int BAD_REQUEST = 400; + + /** + * 未授权 + */ + int UNAUTHORIZED = 401; + + /** + * 访问受限,授权过期 + */ + int FORBIDDEN = 403; + + /** + * 资源,服务未找到 + */ + int NOT_FOUND = 404; + + /** + * 不允许的http方法 + */ + int BAD_METHOD = 405; + + /** + * 资源冲突,或者资源被锁 + */ + int CONFLICT = 409; + + /** + * 不支持的数据,媒体类型 + */ + int UNSUPPORTED_TYPE = 415; + + /** + * 系统内部错误 + */ + int ERROR = 500; + + /** + * 接口未实现 + */ + int NOT_IMPLEMENTED = 501; + + /** + * 系统警告消息 + */ + int WARN = 601; +} diff --git a/ruoyi-common/ruoyi-common-core/src/main/java/com/ruoyi/common/core/constant/RegexConstants.java b/ruoyi-common/ruoyi-common-core/src/main/java/com/ruoyi/common/core/constant/RegexConstants.java new file mode 100644 index 0000000..8b03baf --- /dev/null +++ b/ruoyi-common/ruoyi-common-core/src/main/java/com/ruoyi/common/core/constant/RegexConstants.java @@ -0,0 +1,54 @@ +package com.ruoyi.common.core.constant; + +import cn.hutool.core.lang.RegexPool; + +/** + * 常用正则表达式字符串 + *

+ * 常用正则表达式集合,更多正则见: https://any86.github.io/any-rule/ + * + * @author Feng + */ +public interface RegexConstants extends RegexPool { + + /** + * 字典类型必须以字母开头,且只能为(小写字母,数字,下滑线) + */ + String DICTIONARY_TYPE = "^[a-z][a-z0-9_]*$"; + + /** + * 权限标识必须符合 tool:build:list 格式,或者空字符串 + */ + String PERMISSION_STRING = "^(|^[a-zA-Z0-9_]+:[a-zA-Z0-9_]+:[a-zA-Z0-9_]+)$"; + + /** + * 身份证号码(后6位) + */ + String ID_CARD_LAST_6 = "^(([0-2][1-9])|10|20|30|31)\\d{3}[0-9Xx]$"; + + /** + * QQ号码 + */ + String QQ_NUMBER = "^[1-9][0-9]\\d{4,9}$"; + + /** + * 邮政编码 + */ + String POSTAL_CODE = "^[1-9]\\d{5}$"; + + /** + * 注册账号 + */ + String ACCOUNT = "^[a-zA-Z][a-zA-Z0-9_]{4,15}$"; + + /** + * 密码:包含至少8个字符,包括大写字母、小写字母、数字和特殊字符 + */ + String PASSWORD = "^(?=.*[a-z])(?=.*[A-Z])(?=.*\\d)(?=.*[@$!%*?&])[A-Za-z\\d@$!%*?&]{8,}$"; + + /** + * 通用状态(0表示正常,1表示停用) + */ + String STATUS = "^[01]$"; + +} diff --git a/ruoyi-common/ruoyi-common-core/src/main/java/com/ruoyi/common/core/constant/UserConstants.java b/ruoyi-common/ruoyi-common-core/src/main/java/com/ruoyi/common/core/constant/UserConstants.java new file mode 100644 index 0000000..a054faf --- /dev/null +++ b/ruoyi-common/ruoyi-common-core/src/main/java/com/ruoyi/common/core/constant/UserConstants.java @@ -0,0 +1,147 @@ +package com.ruoyi.common.core.constant; + +/** + * 用户常量信息 + * + * @author ruoyi + */ +public interface UserConstants { + + /** + * 平台内系统用户的唯一标志 + */ + String SYS_USER = "SYS_USER"; + + /** + * 正常状态 + */ + String NORMAL = "0"; + + /** + * 异常状态 + */ + String EXCEPTION = "1"; + + /** + * 用户正常状态 + */ + String USER_NORMAL = "0"; + + /** + * 用户封禁状态 + */ + String USER_DISABLE = "1"; + + /** + * 角色正常状态 + */ + String ROLE_NORMAL = "0"; + + /** + * 角色封禁状态 + */ + String ROLE_DISABLE = "1"; + + /** + * 部门正常状态 + */ + String DEPT_NORMAL = "0"; + + /** + * 部门停用状态 + */ + String DEPT_DISABLE = "1"; + + /** + * 岗位正常状态 + */ + String POST_NORMAL = "0"; + + /** + * 岗位停用状态 + */ + String POST_DISABLE = "1"; + + /** + * 字典正常状态 + */ + String DICT_NORMAL = "0"; + + /** + * 是否为系统默认(是) + */ + String YES = "Y"; + + /** + * 是否菜单外链(是) + */ + String YES_FRAME = "0"; + + /** + * 是否菜单外链(否) + */ + String NO_FRAME = "1"; + + /** + * 菜单正常状态 + */ + String MENU_NORMAL = "0"; + + /** + * 菜单停用状态 + */ + String MENU_DISABLE = "1"; + + /** + * 菜单类型(目录) + */ + String TYPE_DIR = "M"; + + /** + * 菜单类型(菜单) + */ + String TYPE_MENU = "C"; + + /** + * 菜单类型(按钮) + */ + String TYPE_BUTTON = "F"; + + /** + * Layout组件标识 + */ + String LAYOUT = "Layout"; + + /** + * ParentView组件标识 + */ + String PARENT_VIEW = "ParentView"; + + /** + * InnerLink组件标识 + */ + String INNER_LINK = "InnerLink"; + + /** + * 用户名长度限制 + */ + int USERNAME_MIN_LENGTH = 2; + int USERNAME_MAX_LENGTH = 20; + + /** + * 密码长度限制 + */ + int PASSWORD_MIN_LENGTH = 5; + int PASSWORD_MAX_LENGTH = 20; + + /** + * 管理员ID + */ + Long ADMIN_ID = 1L; + + /** + * 管理员角色key + */ + String ADMIN_ROLE_KEY = "admin"; + +} diff --git a/ruoyi-common/ruoyi-common-core/src/main/java/com/ruoyi/common/core/domain/R.java b/ruoyi-common/ruoyi-common-core/src/main/java/com/ruoyi/common/core/domain/R.java new file mode 100644 index 0000000..1f28bd5 --- /dev/null +++ b/ruoyi-common/ruoyi-common-core/src/main/java/com/ruoyi/common/core/domain/R.java @@ -0,0 +1,107 @@ +package com.ruoyi.common.core.domain; + +import com.ruoyi.common.core.constant.HttpStatus; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.io.Serializable; + +/** + * 响应信息主体 + * + * @author Lion Li + */ +@Data +@NoArgsConstructor +public class R implements Serializable { + private static final long serialVersionUID = 1L; + + /** + * 成功 + */ + public static final int SUCCESS = 200; + + /** + * 失败 + */ + public static final int FAIL = 500; + + private int code; + + private String msg; + + private T data; + + public static R ok() { + return restResult(null, SUCCESS, "操作成功"); + } + + public static R ok(T data) { + return restResult(data, SUCCESS, "操作成功"); + } + + public static R ok(String msg) { + return restResult(null, SUCCESS, msg); + } + + public static R ok(String msg, T data) { + return restResult(data, SUCCESS, msg); + } + + public static R fail() { + return restResult(null, FAIL, "操作失败"); + } + + public static R fail(String msg) { + return restResult(null, FAIL, msg); + } + + public static R fail(T data) { + return restResult(data, FAIL, "操作失败"); + } + + public static R fail(String msg, T data) { + return restResult(data, FAIL, msg); + } + + public static R fail(int code, String msg) { + return restResult(null, code, msg); + } + + /** + * 返回警告消息 + * + * @param msg 返回内容 + * @return 警告消息 + */ + public static R warn(String msg) { + return restResult(null, HttpStatus.WARN, msg); + } + + /** + * 返回警告消息 + * + * @param msg 返回内容 + * @param data 数据对象 + * @return 警告消息 + */ + public static R warn(String msg, T data) { + return restResult(data, HttpStatus.WARN, msg); + } + + private static R restResult(T data, int code, String msg) { + R r = new R<>(); + r.setCode(code); + r.setData(data); + r.setMsg(msg); + return r; + } + + public static Boolean isError(R ret) { + return !isSuccess(ret); + } + + public static Boolean isSuccess(R ret) { + return R.SUCCESS == ret.getCode(); + } +} diff --git a/ruoyi-common/ruoyi-common-core/src/main/java/com/ruoyi/common/core/domain/bo/EmailLoginBody.java b/ruoyi-common/ruoyi-common-core/src/main/java/com/ruoyi/common/core/domain/bo/EmailLoginBody.java new file mode 100644 index 0000000..f1dc776 --- /dev/null +++ b/ruoyi-common/ruoyi-common-core/src/main/java/com/ruoyi/common/core/domain/bo/EmailLoginBody.java @@ -0,0 +1,30 @@ +package com.ruoyi.common.core.domain.bo; + +import lombok.Data; + +import jakarta.validation.constraints.Email; +import jakarta.validation.constraints.NotBlank; + +/** + * 邮箱登录对象 + * + * @author Lion Li + */ + +@Data +public class EmailLoginBody { + + /** + * 邮箱 + */ + @NotBlank(message = "{user.email.not.blank}") + @Email(message = "{user.email.not.valid}") + private String email; + + /** + * 邮箱code + */ + @NotBlank(message = "{email.code.not.blank}") + private String emailCode; + +} diff --git a/ruoyi-common/ruoyi-common-core/src/main/java/com/ruoyi/common/core/domain/bo/LoginBody.java b/ruoyi-common/ruoyi-common-core/src/main/java/com/ruoyi/common/core/domain/bo/LoginBody.java new file mode 100644 index 0000000..f05db9d --- /dev/null +++ b/ruoyi-common/ruoyi-common-core/src/main/java/com/ruoyi/common/core/domain/bo/LoginBody.java @@ -0,0 +1,42 @@ +package com.ruoyi.common.core.domain.bo; + +import com.ruoyi.common.core.constant.UserConstants; +import lombok.Data; +import org.hibernate.validator.constraints.Length; + +import jakarta.validation.constraints.NotBlank; + +/** + * 用户登录对象 + * + * @author Lion Li + */ + +@Data +public class LoginBody { + + /** + * 用户名 + */ + @NotBlank(message = "{user.username.not.blank}") + @Length(min = UserConstants.USERNAME_MIN_LENGTH, max = UserConstants.USERNAME_MAX_LENGTH, message = "{user.username.length.valid}") + private String username; + + /** + * 用户密码 + */ + @NotBlank(message = "{user.password.not.blank}") + @Length(min = UserConstants.PASSWORD_MIN_LENGTH, max = UserConstants.PASSWORD_MAX_LENGTH, message = "{user.password.length.valid}") + private String password; + + /** + * 验证码 + */ + private String code; + + /** + * 唯一标识 + */ + private String uuid; + +} diff --git a/ruoyi-common/ruoyi-common-core/src/main/java/com/ruoyi/common/core/domain/bo/LoginUser.java b/ruoyi-common/ruoyi-common-core/src/main/java/com/ruoyi/common/core/domain/bo/LoginUser.java new file mode 100644 index 0000000..6196e3b --- /dev/null +++ b/ruoyi-common/ruoyi-common-core/src/main/java/com/ruoyi/common/core/domain/bo/LoginUser.java @@ -0,0 +1,116 @@ +package com.ruoyi.common.core.domain.bo; + +import com.ruoyi.common.core.domain.vo.RoleVO; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.io.Serializable; +import java.util.List; +import java.util.Set; + +/** + * 登录用户身份权限 + * + * @author Lion Li + */ + +@Data +@NoArgsConstructor +public class LoginUser implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 用户ID + */ + private Long userId; + + /** + * 部门ID + */ + private Long deptId; + + /** + * 部门名 + */ + private String deptName; + + /** + * 用户唯一标识 + */ + private String token; + + /** + * 用户类型 + */ + private String userType; + + /** + * 登录时间 + */ + private Long loginTime; + + /** + * 过期时间 + */ + private Long expireTime; + + /** + * 登录IP地址 + */ + private String ipaddr; + + /** + * 登录地点 + */ + private String loginLocation; + + /** + * 浏览器类型 + */ + private String browser; + + /** + * 操作系统 + */ + private String os; + + /** + * 菜单权限 + */ + private Set menuPermission; + + /** + * 角色权限 + */ + private Set rolePermission; + + /** + * 用户名 + */ + private String username; + + /** + * 角色对象 + */ + private List roles; + + /** + * 数据权限 当前角色ID + */ + private Long roleId; + + /** + * 获取登录id + */ + public String getLoginId() { + if (userType == null) { + throw new IllegalArgumentException("用户类型不能为空"); + } + if (userId == null) { + throw new IllegalArgumentException("用户ID不能为空"); + } + return userType + ":" + userId; + } + +} diff --git a/ruoyi-common/ruoyi-common-core/src/main/java/com/ruoyi/common/core/domain/bo/RegisterBody.java b/ruoyi-common/ruoyi-common-core/src/main/java/com/ruoyi/common/core/domain/bo/RegisterBody.java new file mode 100644 index 0000000..d1f7732 --- /dev/null +++ b/ruoyi-common/ruoyi-common-core/src/main/java/com/ruoyi/common/core/domain/bo/RegisterBody.java @@ -0,0 +1,17 @@ +package com.ruoyi.common.core.domain.bo; + +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * 用户注册对象 + * + * @author Lion Li + */ +@Data +@EqualsAndHashCode(callSuper = true) +public class RegisterBody extends LoginBody { + + private String userType; + +} diff --git a/ruoyi-common/ruoyi-common-core/src/main/java/com/ruoyi/common/core/domain/bo/SmsLoginBody.java b/ruoyi-common/ruoyi-common-core/src/main/java/com/ruoyi/common/core/domain/bo/SmsLoginBody.java new file mode 100644 index 0000000..c0ecd62 --- /dev/null +++ b/ruoyi-common/ruoyi-common-core/src/main/java/com/ruoyi/common/core/domain/bo/SmsLoginBody.java @@ -0,0 +1,28 @@ +package com.ruoyi.common.core.domain.bo; + +import lombok.Data; + +import jakarta.validation.constraints.NotBlank; + +/** + * 短信登录对象 + * + * @author Lion Li + */ + +@Data +public class SmsLoginBody { + + /** + * 手机号 + */ + @NotBlank(message = "{user.phonenumber.not.blank}") + private String phonenumber; + + /** + * 短信code + */ + @NotBlank(message = "{sms.code.not.blank}") + private String smsCode; + +} diff --git a/ruoyi-common/ruoyi-common-core/src/main/java/com/ruoyi/common/core/domain/bo/XcxLoginUser.java b/ruoyi-common/ruoyi-common-core/src/main/java/com/ruoyi/common/core/domain/bo/XcxLoginUser.java new file mode 100644 index 0000000..66c2605 --- /dev/null +++ b/ruoyi-common/ruoyi-common-core/src/main/java/com/ruoyi/common/core/domain/bo/XcxLoginUser.java @@ -0,0 +1,24 @@ +package com.ruoyi.common.core.domain.bo; + +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.NoArgsConstructor; + +/** + * 小程序登录用户身份权限 + * + * @author Lion Li + */ +@Data +@EqualsAndHashCode(callSuper = true) +@NoArgsConstructor +public class XcxLoginUser extends LoginUser { + + private static final long serialVersionUID = 1L; + + /** + * openid + */ + private String openid; + +} diff --git a/ruoyi-common/ruoyi-common-core/src/main/java/com/ruoyi/common/core/domain/vo/RoleVO.java b/ruoyi-common/ruoyi-common-core/src/main/java/com/ruoyi/common/core/domain/vo/RoleVO.java new file mode 100644 index 0000000..29ecf78 --- /dev/null +++ b/ruoyi-common/ruoyi-common-core/src/main/java/com/ruoyi/common/core/domain/vo/RoleVO.java @@ -0,0 +1,38 @@ +package com.ruoyi.common.core.domain.vo; + +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.io.Serializable; + +/** + * 角色 + * + * @author Lion Li + */ + +@Data +@NoArgsConstructor +public class RoleVO implements Serializable { + + /** + * 角色ID + */ + private Long roleId; + + /** + * 角色名称 + */ + private String roleName; + + /** + * 角色权限 + */ + private String roleKey; + + /** + * 数据范围(1:所有数据权限;2:自定义数据权限;3:本部门数据权限;4:本部门及以下数据权限;5:仅本人数据权限) + */ + private String dataScope; + +} diff --git a/ruoyi-common/ruoyi-common-core/src/main/java/com/ruoyi/common/core/domain/vo/UserOnlineVO.java b/ruoyi-common/ruoyi-common-core/src/main/java/com/ruoyi/common/core/domain/vo/UserOnlineVO.java new file mode 100644 index 0000000..0fd3ca8 --- /dev/null +++ b/ruoyi-common/ruoyi-common-core/src/main/java/com/ruoyi/common/core/domain/vo/UserOnlineVO.java @@ -0,0 +1,60 @@ +package com.ruoyi.common.core.domain.vo; + +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.io.Serializable; + +/** + * 当前在线会话 + * + * @author ruoyi + */ + +@Data +@NoArgsConstructor +public class UserOnlineVO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 会话编号 + */ + private String tokenId; + + /** + * 部门名称 + */ + private String deptName; + + /** + * 用户名称 + */ + private String userName; + + /** + * 登录IP地址 + */ + private String ipaddr; + + /** + * 登录地址 + */ + private String loginLocation; + + /** + * 浏览器类型 + */ + private String browser; + + /** + * 操作系统 + */ + private String os; + + /** + * 登录时间 + */ + private Long loginTime; + +} diff --git a/ruoyi-common/ruoyi-common-core/src/main/java/com/ruoyi/common/core/enums/BusinessStatus.java b/ruoyi-common/ruoyi-common-core/src/main/java/com/ruoyi/common/core/enums/BusinessStatus.java new file mode 100644 index 0000000..970f1f9 --- /dev/null +++ b/ruoyi-common/ruoyi-common-core/src/main/java/com/ruoyi/common/core/enums/BusinessStatus.java @@ -0,0 +1,18 @@ +package com.ruoyi.common.core.enums; + +/** + * 操作状态 + * + * @author ruoyi + */ +public enum BusinessStatus { + /** + * 成功 + */ + SUCCESS, + + /** + * 失败 + */ + FAIL, +} diff --git a/ruoyi-common/ruoyi-common-core/src/main/java/com/ruoyi/common/core/enums/DeviceType.java b/ruoyi-common/ruoyi-common-core/src/main/java/com/ruoyi/common/core/enums/DeviceType.java new file mode 100644 index 0000000..b15b91c --- /dev/null +++ b/ruoyi-common/ruoyi-common-core/src/main/java/com/ruoyi/common/core/enums/DeviceType.java @@ -0,0 +1,32 @@ +package com.ruoyi.common.core.enums; + +import lombok.AllArgsConstructor; +import lombok.Getter; + +/** + * 设备类型 + * 针对一套 用户体系 + * + * @author Lion Li + */ +@Getter +@AllArgsConstructor +public enum DeviceType { + + /** + * pc端 + */ + PC("pc"), + + /** + * app端 + */ + APP("app"), + + /** + * 小程序端 + */ + XCX("xcx"); + + private final String device; +} diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/enums/HttpMethod.java b/ruoyi-common/ruoyi-common-core/src/main/java/com/ruoyi/common/core/enums/HttpMethod.java similarity index 66% rename from ruoyi-common/src/main/java/com/ruoyi/common/enums/HttpMethod.java rename to ruoyi-common/ruoyi-common-core/src/main/java/com/ruoyi/common/core/enums/HttpMethod.java index be6f739..7f1d7e1 100644 --- a/ruoyi-common/src/main/java/com/ruoyi/common/enums/HttpMethod.java +++ b/ruoyi-common/ruoyi-common-core/src/main/java/com/ruoyi/common/core/enums/HttpMethod.java @@ -1,36 +1,32 @@ -package com.ruoyi.common.enums; +package com.ruoyi.common.core.enums; + +import org.springframework.lang.Nullable; import java.util.HashMap; import java.util.Map; -import org.springframework.lang.Nullable; /** * 请求方式 * * @author ruoyi */ -public enum HttpMethod -{ +public enum HttpMethod { GET, HEAD, POST, PUT, PATCH, DELETE, OPTIONS, TRACE; private static final Map mappings = new HashMap<>(16); - static - { - for (HttpMethod httpMethod : values()) - { + static { + for (HttpMethod httpMethod : values()) { mappings.put(httpMethod.name(), httpMethod); } } @Nullable - public static HttpMethod resolve(@Nullable String method) - { + public static HttpMethod resolve(@Nullable String method) { return (method != null ? mappings.get(method) : null); } - public boolean matches(String method) - { + public boolean matches(String method) { return (this == resolve(method)); } } diff --git a/ruoyi-common/ruoyi-common-core/src/main/java/com/ruoyi/common/core/enums/LoginType.java b/ruoyi-common/ruoyi-common-core/src/main/java/com/ruoyi/common/core/enums/LoginType.java new file mode 100644 index 0000000..dbd6de1 --- /dev/null +++ b/ruoyi-common/ruoyi-common-core/src/main/java/com/ruoyi/common/core/enums/LoginType.java @@ -0,0 +1,44 @@ +package com.ruoyi.common.core.enums; + +import lombok.AllArgsConstructor; +import lombok.Getter; + +/** + * 登录类型 + * + * @author Lion Li + */ +@Getter +@AllArgsConstructor +public enum LoginType { + + /** + * 密码登录 + */ + PASSWORD("user.password.retry.limit.exceed", "user.password.retry.limit.count"), + + /** + * 短信登录 + */ + SMS("sms.code.retry.limit.exceed", "sms.code.retry.limit.count"), + + /** + * 邮箱登录 + */ + EMAIL("email.code.retry.limit.exceed", "email.code.retry.limit.count"), + + /** + * 小程序登录 + */ + XCX("", ""); + + /** + * 登录重试超出限制提示 + */ + final String retryLimitExceed; + + /** + * 登录重试限制计数提示 + */ + final String retryLimitCount; +} diff --git a/ruoyi-common/ruoyi-common-core/src/main/java/com/ruoyi/common/core/enums/OperatorType.java b/ruoyi-common/ruoyi-common-core/src/main/java/com/ruoyi/common/core/enums/OperatorType.java new file mode 100644 index 0000000..35416ed --- /dev/null +++ b/ruoyi-common/ruoyi-common-core/src/main/java/com/ruoyi/common/core/enums/OperatorType.java @@ -0,0 +1,23 @@ +package com.ruoyi.common.core.enums; + +/** + * 操作人类别 + * + * @author ruoyi + */ +public enum OperatorType { + /** + * 其它 + */ + OTHER, + + /** + * 后台用户 + */ + MANAGE, + + /** + * 手机端用户 + */ + MOBILE +} diff --git a/ruoyi-common/ruoyi-common-core/src/main/java/com/ruoyi/common/core/enums/UserStatus.java b/ruoyi-common/ruoyi-common-core/src/main/java/com/ruoyi/common/core/enums/UserStatus.java new file mode 100644 index 0000000..f602c9b --- /dev/null +++ b/ruoyi-common/ruoyi-common-core/src/main/java/com/ruoyi/common/core/enums/UserStatus.java @@ -0,0 +1,29 @@ +package com.ruoyi.common.core.enums; + +import lombok.AllArgsConstructor; +import lombok.Getter; + +/** + * 用户状态 + * + * @author ruoyi + */ +@Getter +@AllArgsConstructor +public enum UserStatus { + /** + * 正常 + */ + OK("0", "正常"), + /** + * 停用 + */ + DISABLE("1", "停用"), + /** + * 删除 + */ + DELETED("2", "删除"); + + private final String code; + private final String info; +} diff --git a/ruoyi-common/ruoyi-common-core/src/main/java/com/ruoyi/common/core/enums/UserType.java b/ruoyi-common/ruoyi-common-core/src/main/java/com/ruoyi/common/core/enums/UserType.java new file mode 100644 index 0000000..46e4005 --- /dev/null +++ b/ruoyi-common/ruoyi-common-core/src/main/java/com/ruoyi/common/core/enums/UserType.java @@ -0,0 +1,37 @@ +package com.ruoyi.common.core.enums; + +import com.ruoyi.common.core.utils.StringUtils; +import lombok.AllArgsConstructor; +import lombok.Getter; + +/** + * 设备类型 + * 针对多套 用户体系 + * + * @author Lion Li + */ +@Getter +@AllArgsConstructor +public enum UserType { + + /** + * pc端 + */ + SYS_USER("sys_user"), + + /** + * app端 + */ + APP_USER("app_user"); + + private final String userType; + + public static UserType getUserType(String str) { + for (UserType value : values()) { + if (StringUtils.contains(str, value.getUserType())) { + return value; + } + } + throw new RuntimeException("'UserType' not found By " + str); + } +} diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/exception/ServiceException.java b/ruoyi-common/ruoyi-common-core/src/main/java/com/ruoyi/common/core/exception/ServiceException.java similarity index 90% rename from ruoyi-common/src/main/java/com/ruoyi/common/exception/ServiceException.java rename to ruoyi-common/ruoyi-common-core/src/main/java/com/ruoyi/common/core/exception/ServiceException.java index 958e40b..f5b2cdc 100644 --- a/ruoyi-common/src/main/java/com/ruoyi/common/exception/ServiceException.java +++ b/ruoyi-common/ruoyi-common-core/src/main/java/com/ruoyi/common/core/exception/ServiceException.java @@ -1,11 +1,11 @@ -package com.ruoyi.common.exception; +package com.ruoyi.common.core.exception; /** * 业务异常 * * @author ruoyi */ -public class ServiceException extends RuntimeException { +public final class ServiceException extends RuntimeException { private static final long serialVersionUID = 1L; /** @@ -44,6 +44,7 @@ public class ServiceException extends RuntimeException { return detailMessage; } + @Override public String getMessage() { return message; } diff --git a/ruoyi-common/ruoyi-common-core/src/main/java/com/ruoyi/common/core/exception/base/BaseException.java b/ruoyi-common/ruoyi-common-core/src/main/java/com/ruoyi/common/core/exception/base/BaseException.java new file mode 100644 index 0000000..33b28e7 --- /dev/null +++ b/ruoyi-common/ruoyi-common-core/src/main/java/com/ruoyi/common/core/exception/base/BaseException.java @@ -0,0 +1,75 @@ +package com.ruoyi.common.core.exception.base; + +import com.ruoyi.common.core.utils.MessageUtils; +import com.ruoyi.common.core.utils.StringUtils; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.NoArgsConstructor; + +/** + * 基础异常 + * + * @author ruoyi + */ +@Data +@EqualsAndHashCode(callSuper = true) +@NoArgsConstructor +public class BaseException extends RuntimeException { + private static final long serialVersionUID = 1L; + + /** + * 所属模块 + */ + private String module; + + /** + * 错误码 + */ + private String code; + + /** + * 错误码对应的参数 + */ + private Object[] args; + + /** + * 错误消息 + */ + private String defaultMessage; + + public BaseException(String module, String code, Object[] args, String defaultMessage) { + this.module = module; + this.code = code; + this.args = args; + this.defaultMessage = defaultMessage; + } + + public BaseException(String module, String code, Object[] args) { + this(module, code, args, null); + } + + public BaseException(String module, String defaultMessage) { + this(module, null, null, defaultMessage); + } + + public BaseException(String code, Object[] args) { + this(null, code, args, null); + } + + public BaseException(String defaultMessage) { + this(null, null, null, defaultMessage); + } + + @Override + public String getMessage() { + String message = null; + if (!StringUtils.isEmpty(code)) { + message = MessageUtils.message(code, args); + } + if (message == null) { + message = defaultMessage; + } + return message; + } + +} diff --git a/ruoyi-common/ruoyi-common-core/src/main/java/com/ruoyi/common/core/exception/file/FileException.java b/ruoyi-common/ruoyi-common-core/src/main/java/com/ruoyi/common/core/exception/file/FileException.java new file mode 100644 index 0000000..8a6a70a --- /dev/null +++ b/ruoyi-common/ruoyi-common-core/src/main/java/com/ruoyi/common/core/exception/file/FileException.java @@ -0,0 +1,17 @@ +package com.ruoyi.common.core.exception.file; + +import com.ruoyi.common.core.exception.base.BaseException; + +/** + * 文件信息异常类 + * + * @author ruoyi + */ +public class FileException extends BaseException { + private static final long serialVersionUID = 1L; + + public FileException(String code, Object[] args) { + super("file", code, args, null); + } + +} diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/exception/file/FileNameLengthLimitExceededException.java b/ruoyi-common/ruoyi-common-core/src/main/java/com/ruoyi/common/core/exception/file/FileNameLengthLimitExceededException.java similarity index 61% rename from ruoyi-common/src/main/java/com/ruoyi/common/exception/file/FileNameLengthLimitExceededException.java rename to ruoyi-common/ruoyi-common-core/src/main/java/com/ruoyi/common/core/exception/file/FileNameLengthLimitExceededException.java index 70e0ec9..7c54c6a 100644 --- a/ruoyi-common/src/main/java/com/ruoyi/common/exception/file/FileNameLengthLimitExceededException.java +++ b/ruoyi-common/ruoyi-common-core/src/main/java/com/ruoyi/common/core/exception/file/FileNameLengthLimitExceededException.java @@ -1,16 +1,14 @@ -package com.ruoyi.common.exception.file; +package com.ruoyi.common.core.exception.file; /** * 文件名称超长限制异常类 - * + * * @author ruoyi */ -public class FileNameLengthLimitExceededException extends FileException -{ +public class FileNameLengthLimitExceededException extends FileException { private static final long serialVersionUID = 1L; - public FileNameLengthLimitExceededException(int defaultFileNameLength) - { - super("upload.filename.exceed.length", new Object[] { defaultFileNameLength }); + public FileNameLengthLimitExceededException(int defaultFileNameLength) { + super("upload.filename.exceed.length", new Object[]{defaultFileNameLength}); } } diff --git a/ruoyi-common/ruoyi-common-core/src/main/java/com/ruoyi/common/core/exception/file/FileSizeLimitExceededException.java b/ruoyi-common/ruoyi-common-core/src/main/java/com/ruoyi/common/core/exception/file/FileSizeLimitExceededException.java new file mode 100644 index 0000000..bc89b6f --- /dev/null +++ b/ruoyi-common/ruoyi-common-core/src/main/java/com/ruoyi/common/core/exception/file/FileSizeLimitExceededException.java @@ -0,0 +1,14 @@ +package com.ruoyi.common.core.exception.file; + +/** + * 文件名大小限制异常类 + * + * @author ruoyi + */ +public class FileSizeLimitExceededException extends FileException { + private static final long serialVersionUID = 1L; + + public FileSizeLimitExceededException(long defaultMaxSize) { + super("upload.exceed.maxSize", new Object[]{defaultMaxSize}); + } +} diff --git a/ruoyi-common/ruoyi-common-core/src/main/java/com/ruoyi/common/core/exception/user/CaptchaException.java b/ruoyi-common/ruoyi-common-core/src/main/java/com/ruoyi/common/core/exception/user/CaptchaException.java new file mode 100644 index 0000000..a2df75f --- /dev/null +++ b/ruoyi-common/ruoyi-common-core/src/main/java/com/ruoyi/common/core/exception/user/CaptchaException.java @@ -0,0 +1,14 @@ +package com.ruoyi.common.core.exception.user; + +/** + * 验证码错误异常类 + * + * @author ruoyi + */ +public class CaptchaException extends UserException { + private static final long serialVersionUID = 1L; + + public CaptchaException() { + super("user.jcaptcha.error"); + } +} diff --git a/ruoyi-common/ruoyi-common-core/src/main/java/com/ruoyi/common/core/exception/user/CaptchaExpireException.java b/ruoyi-common/ruoyi-common-core/src/main/java/com/ruoyi/common/core/exception/user/CaptchaExpireException.java new file mode 100644 index 0000000..3aa9d51 --- /dev/null +++ b/ruoyi-common/ruoyi-common-core/src/main/java/com/ruoyi/common/core/exception/user/CaptchaExpireException.java @@ -0,0 +1,14 @@ +package com.ruoyi.common.core.exception.user; + +/** + * 验证码失效异常类 + * + * @author ruoyi + */ +public class CaptchaExpireException extends UserException { + private static final long serialVersionUID = 1L; + + public CaptchaExpireException() { + super("user.jcaptcha.expire"); + } +} diff --git a/ruoyi-common/ruoyi-common-core/src/main/java/com/ruoyi/common/core/exception/user/UserException.java b/ruoyi-common/ruoyi-common-core/src/main/java/com/ruoyi/common/core/exception/user/UserException.java new file mode 100644 index 0000000..58d2a9f --- /dev/null +++ b/ruoyi-common/ruoyi-common-core/src/main/java/com/ruoyi/common/core/exception/user/UserException.java @@ -0,0 +1,16 @@ +package com.ruoyi.common.core.exception.user; + +import com.ruoyi.common.core.exception.base.BaseException; + +/** + * 用户信息异常类 + * + * @author ruoyi + */ +public class UserException extends BaseException { + private static final long serialVersionUID = 1L; + + public UserException(String code, Object... args) { + super("user", code, args, null); + } +} diff --git a/ruoyi-common/ruoyi-common-core/src/main/java/com/ruoyi/common/core/factory/RegexPatternPoolFactory.java b/ruoyi-common/ruoyi-common-core/src/main/java/com/ruoyi/common/core/factory/RegexPatternPoolFactory.java new file mode 100644 index 0000000..5b71957 --- /dev/null +++ b/ruoyi-common/ruoyi-common-core/src/main/java/com/ruoyi/common/core/factory/RegexPatternPoolFactory.java @@ -0,0 +1,52 @@ +package com.ruoyi.common.core.factory; + +import cn.hutool.core.lang.PatternPool; +import com.ruoyi.common.core.constant.RegexConstants; + +import java.util.regex.Pattern; + +/** + * 正则表达式模式池工厂 + *

初始化的时候将正则表达式加入缓存池当中

+ *

提高正则表达式的性能,避免重复编译相同的正则表达式

+ * + * @author 21001 + */ +public class RegexPatternPoolFactory extends PatternPool { + + /** + * 字典类型必须以字母开头,且只能为(小写字母,数字,下滑线) + */ + public static final Pattern DICTIONARY_TYPE = get(RegexConstants.DICTIONARY_TYPE); + + /** + * 身份证号码(后6位) + */ + public static final Pattern ID_CARD_LAST_6 = get(RegexConstants.ID_CARD_LAST_6); + + /** + * QQ号码 + */ + public static final Pattern QQ_NUMBER = get(RegexConstants.QQ_NUMBER); + + /** + * 邮政编码 + */ + public static final Pattern POSTAL_CODE = get(RegexConstants.POSTAL_CODE); + + /** + * 注册账号 + */ + public static final Pattern ACCOUNT = get(RegexConstants.ACCOUNT); + + /** + * 密码:包含至少8个字符,包括大写字母、小写字母、数字和特殊字符 + */ + public static final Pattern PASSWORD = get(RegexConstants.PASSWORD); + + /** + * 通用状态(0表示正常,1表示停用) + */ + public static final Pattern STATUS = get(RegexConstants.STATUS); + +} diff --git a/ruoyi-common/ruoyi-common-core/src/main/java/com/ruoyi/common/core/factory/YmlPropertySourceFactory.java b/ruoyi-common/ruoyi-common-core/src/main/java/com/ruoyi/common/core/factory/YmlPropertySourceFactory.java new file mode 100644 index 0000000..014033e --- /dev/null +++ b/ruoyi-common/ruoyi-common-core/src/main/java/com/ruoyi/common/core/factory/YmlPropertySourceFactory.java @@ -0,0 +1,31 @@ +package com.ruoyi.common.core.factory; + +import com.ruoyi.common.core.utils.StringUtils; +import org.springframework.beans.factory.config.YamlPropertiesFactoryBean; +import org.springframework.core.env.PropertiesPropertySource; +import org.springframework.core.env.PropertySource; +import org.springframework.core.io.support.DefaultPropertySourceFactory; +import org.springframework.core.io.support.EncodedResource; + +import java.io.IOException; + +/** + * yml 配置源工厂 + * + * @author Lion Li + */ +public class YmlPropertySourceFactory extends DefaultPropertySourceFactory { + + @Override + public PropertySource createPropertySource(String name, EncodedResource resource) throws IOException { + String sourceName = resource.getResource().getFilename(); + if (StringUtils.isNotBlank(sourceName) && StringUtils.endsWithAny(sourceName, ".yml", ".yaml")) { + YamlPropertiesFactoryBean factory = new YamlPropertiesFactoryBean(); + factory.setResources(resource.getResource()); + factory.afterPropertiesSet(); + return new PropertiesPropertySource(sourceName, factory.getObject()); + } + return super.createPropertySource(name, resource); + } + +} diff --git a/ruoyi-common/ruoyi-common-core/src/main/java/com/ruoyi/common/core/service/ConfigService.java b/ruoyi-common/ruoyi-common-core/src/main/java/com/ruoyi/common/core/service/ConfigService.java new file mode 100644 index 0000000..c6badf6 --- /dev/null +++ b/ruoyi-common/ruoyi-common-core/src/main/java/com/ruoyi/common/core/service/ConfigService.java @@ -0,0 +1,18 @@ +package com.ruoyi.common.core.service; + +/** + * 通用 参数配置服务 + * + * @author Lion Li + */ +public interface ConfigService { + + /** + * 根据参数 key 获取参数值 + * + * @param configKey 参数 key + * @return 参数值 + */ + String getConfigValue(String configKey); + +} diff --git a/ruoyi-common/ruoyi-common-core/src/main/java/com/ruoyi/common/core/service/DeptService.java b/ruoyi-common/ruoyi-common-core/src/main/java/com/ruoyi/common/core/service/DeptService.java new file mode 100644 index 0000000..c27f461 --- /dev/null +++ b/ruoyi-common/ruoyi-common-core/src/main/java/com/ruoyi/common/core/service/DeptService.java @@ -0,0 +1,18 @@ +package com.ruoyi.common.core.service; + +/** + * 通用 部门服务 + * + * @author Lion Li + */ +public interface DeptService { + + /** + * 通过部门ID查询部门名称 + * + * @param deptIds 部门ID串逗号分隔 + * @return 部门名称串逗号分隔 + */ + String selectDeptNameByIds(String deptIds); + +} diff --git a/ruoyi-common/ruoyi-common-core/src/main/java/com/ruoyi/common/core/service/DictService.java b/ruoyi-common/ruoyi-common-core/src/main/java/com/ruoyi/common/core/service/DictService.java new file mode 100644 index 0000000..a4dbfd5 --- /dev/null +++ b/ruoyi-common/ruoyi-common-core/src/main/java/com/ruoyi/common/core/service/DictService.java @@ -0,0 +1,66 @@ +package com.ruoyi.common.core.service; + +import java.util.Map; + +/** + * 通用 字典服务 + * + * @author Lion Li + */ +public interface DictService { + + /** + * 分隔符 + */ + String SEPARATOR = ","; + + /** + * 根据字典类型和字典值获取字典标签 + * + * @param dictType 字典类型 + * @param dictValue 字典值 + * @return 字典标签 + */ + default String getDictLabel(String dictType, String dictValue) { + return getDictLabel(dictType, dictValue, SEPARATOR); + } + + /** + * 根据字典类型和字典标签获取字典值 + * + * @param dictType 字典类型 + * @param dictLabel 字典标签 + * @return 字典值 + */ + default String getDictValue(String dictType, String dictLabel) { + return getDictValue(dictType, dictLabel, SEPARATOR); + } + + /** + * 根据字典类型和字典值获取字典标签 + * + * @param dictType 字典类型 + * @param dictValue 字典值 + * @param separator 分隔符 + * @return 字典标签 + */ + String getDictLabel(String dictType, String dictValue, String separator); + + /** + * 根据字典类型和字典标签获取字典值 + * + * @param dictType 字典类型 + * @param dictLabel 字典标签 + * @param separator 分隔符 + * @return 字典值 + */ + String getDictValue(String dictType, String dictLabel, String separator); + + /** + * 获取字典下所有的字典值与标签 + * + * @param dictType 字典类型 + * @return dictValue为key,dictLabel为值组成的Map + */ + Map getAllDictByDictType(String dictType); +} diff --git a/ruoyi-common/ruoyi-common-core/src/main/java/com/ruoyi/common/core/service/OssService.java b/ruoyi-common/ruoyi-common-core/src/main/java/com/ruoyi/common/core/service/OssService.java new file mode 100644 index 0000000..65dda7c --- /dev/null +++ b/ruoyi-common/ruoyi-common-core/src/main/java/com/ruoyi/common/core/service/OssService.java @@ -0,0 +1,18 @@ +package com.ruoyi.common.core.service; + +/** + * 通用 OSS服务 + * + * @author Lion Li + */ +public interface OssService { + + /** + * 通过ossId查询对应的url + * + * @param ossIds ossId串逗号分隔 + * @return url串逗号分隔 + */ + String selectUrlByIds(String ossIds); + +} diff --git a/ruoyi-common/ruoyi-common-core/src/main/java/com/ruoyi/common/core/service/UserService.java b/ruoyi-common/ruoyi-common-core/src/main/java/com/ruoyi/common/core/service/UserService.java new file mode 100644 index 0000000..d2206c8 --- /dev/null +++ b/ruoyi-common/ruoyi-common-core/src/main/java/com/ruoyi/common/core/service/UserService.java @@ -0,0 +1,18 @@ +package com.ruoyi.common.core.service; + +/** + * 通用 用户服务 + * + * @author Lion Li + */ +public interface UserService { + + /** + * 通过用户ID查询用户账户 + * + * @param userId 用户ID + * @return 用户账户 + */ + String selectUserNameById(Long userId); + +} diff --git a/ruoyi-common/ruoyi-common-core/src/main/java/com/ruoyi/common/core/utils/DateUtils.java b/ruoyi-common/ruoyi-common-core/src/main/java/com/ruoyi/common/core/utils/DateUtils.java new file mode 100644 index 0000000..804f1a2 --- /dev/null +++ b/ruoyi-common/ruoyi-common-core/src/main/java/com/ruoyi/common/core/utils/DateUtils.java @@ -0,0 +1,168 @@ +package com.ruoyi.common.core.utils; + +import lombok.AccessLevel; +import lombok.NoArgsConstructor; +import org.apache.commons.lang3.time.DateFormatUtils; + +import java.lang.management.ManagementFactory; +import java.text.ParseException; +import java.text.SimpleDateFormat; +import java.time.LocalDate; +import java.time.LocalDateTime; +import java.time.LocalTime; +import java.time.ZoneId; +import java.time.ZonedDateTime; +import java.util.Date; + +/** + * 时间工具类 + * + * @author ruoyi + */ +@NoArgsConstructor(access = AccessLevel.PRIVATE) +public class DateUtils extends org.apache.commons.lang3.time.DateUtils { + + public static final String YYYY = "yyyy"; + + public static final String YYYY_MM = "yyyy-MM"; + + public static final String YYYY_MM_DD = "yyyy-MM-dd"; + + public static final String YYYYMMDDHHMMSS = "yyyyMMddHHmmss"; + + public static final String YYYY_MM_DD_HH_MM_SS = "yyyy-MM-dd HH:mm:ss"; + + private static final String[] PARSE_PATTERNS = { + "yyyy-MM-dd", "yyyy-MM-dd HH:mm:ss", "yyyy-MM-dd HH:mm", "yyyy-MM", + "yyyy/MM/dd", "yyyy/MM/dd HH:mm:ss", "yyyy/MM/dd HH:mm", "yyyy/MM", + "yyyy.MM.dd", "yyyy.MM.dd HH:mm:ss", "yyyy.MM.dd HH:mm", "yyyy.MM"}; + + /** + * 获取当前Date型日期 + * + * @return Date() 当前日期 + */ + public static Date getNowDate() { + return new Date(); + } + + /** + * 获取当前日期, 默认格式为yyyy-MM-dd + * + * @return String + */ + public static String getDate() { + return dateTimeNow(YYYY_MM_DD); + } + + public static String getTime() { + return dateTimeNow(YYYY_MM_DD_HH_MM_SS); + } + + public static String dateTimeNow() { + return dateTimeNow(YYYYMMDDHHMMSS); + } + + public static String dateTimeNow(final String format) { + return parseDateToStr(format, new Date()); + } + + public static String dateTime(final Date date) { + return parseDateToStr(YYYY_MM_DD, date); + } + + public static String parseDateToStr(final String format, final Date date) { + return new SimpleDateFormat(format).format(date); + } + + public static Date dateTime(final String format, final String ts) { + try { + return new SimpleDateFormat(format).parse(ts); + } catch (ParseException e) { + throw new RuntimeException(e); + } + } + + /** + * 日期路径 即年/月/日 如2018/08/08 + */ + public static String datePath() { + Date now = new Date(); + return DateFormatUtils.format(now, "yyyy/MM/dd"); + } + + /** + * 日期路径 即年/月/日 如20180808 + */ + public static String dateTime() { + Date now = new Date(); + return DateFormatUtils.format(now, "yyyyMMdd"); + } + + /** + * 日期型字符串转化为日期 格式 + */ + public static Date parseDate(Object str) { + if (str == null) { + return null; + } + try { + return parseDate(str.toString(), PARSE_PATTERNS); + } catch (ParseException e) { + return null; + } + } + + /** + * 获取服务器启动时间 + */ + public static Date getServerStartDate() { + long time = ManagementFactory.getRuntimeMXBean().getStartTime(); + return new Date(time); + } + + /** + * 计算相差天数 + */ + public static int differentDaysByMillisecond(Date date1, Date date2) { + return Math.abs((int) ((date2.getTime() - date1.getTime()) / (1000 * 3600 * 24))); + } + + /** + * 计算两个时间差 + */ + public static String getDatePoor(Date endDate, Date nowDate) { + long nd = 1000 * 24 * 60 * 60; + long nh = 1000 * 60 * 60; + long nm = 1000 * 60; + // long ns = 1000; + // 获得两个时间的毫秒时间差异 + long diff = endDate.getTime() - nowDate.getTime(); + // 计算差多少天 + long day = diff / nd; + // 计算差多少小时 + long hour = diff % nd / nh; + // 计算差多少分钟 + long min = diff % nd % nh / nm; + // 计算差多少秒//输出结果 + // long sec = diff % nd % nh % nm / ns; + return day + "天" + hour + "小时" + min + "分钟"; + } + + /** + * 增加 LocalDateTime ==> Date + */ + public static Date toDate(LocalDateTime temporalAccessor) { + ZonedDateTime zdt = temporalAccessor.atZone(ZoneId.systemDefault()); + return Date.from(zdt.toInstant()); + } + + /** + * 增加 LocalDate ==> Date + */ + public static Date toDate(LocalDate temporalAccessor) { + LocalDateTime localDateTime = LocalDateTime.of(temporalAccessor, LocalTime.of(0, 0, 0)); + ZonedDateTime zdt = localDateTime.atZone(ZoneId.systemDefault()); + return Date.from(zdt.toInstant()); + } +} diff --git a/ruoyi-common/ruoyi-common-core/src/main/java/com/ruoyi/common/core/utils/MapstructUtils.java b/ruoyi-common/ruoyi-common-core/src/main/java/com/ruoyi/common/core/utils/MapstructUtils.java new file mode 100644 index 0000000..039aa2f --- /dev/null +++ b/ruoyi-common/ruoyi-common-core/src/main/java/com/ruoyi/common/core/utils/MapstructUtils.java @@ -0,0 +1,94 @@ +package com.ruoyi.common.core.utils; + +import cn.hutool.core.collection.CollUtil; +import cn.hutool.core.map.MapUtil; +import cn.hutool.core.util.ObjectUtil; +import io.github.linpeilie.Converter; +import lombok.AccessLevel; +import lombok.NoArgsConstructor; + +import java.util.List; +import java.util.Map; + +/** + * Mapstruct 工具类 + *

参考文档:mapstruct-plus

+ * + * + * @author Michelle.Chung + */ +@NoArgsConstructor(access = AccessLevel.PRIVATE) +public class MapstructUtils { + + private final static Converter CONVERTER = SpringUtils.getBean(Converter.class); + + /** + * 将 T 类型对象,转换为 desc 类型的对象并返回 + * + * @param source 数据来源实体 + * @param desc 描述对象 转换后的对象 + * @return desc + */ + public static V convert(T source, Class desc) { + if (ObjectUtil.isNull(source)) { + return null; + } + if (ObjectUtil.isNull(desc)) { + return null; + } + return CONVERTER.convert(source, desc); + } + + /** + * 将 T 类型对象,按照配置的映射字段规则,给 desc 类型的对象赋值并返回 desc 对象 + * + * @param source 数据来源实体 + * @param desc 转换后的对象 + * @return desc + */ + public static V convert(T source, V desc) { + if (ObjectUtil.isNull(source)) { + return null; + } + if (ObjectUtil.isNull(desc)) { + return null; + } + return CONVERTER.convert(source, desc); + } + + /** + * 将 T 类型的集合,转换为 desc 类型的集合并返回 + * + * @param sourceList 数据来源实体列表 + * @param desc 描述对象 转换后的对象 + * @return desc + */ + public static List convert(List sourceList, Class desc) { + if (ObjectUtil.isNull(sourceList)) { + return null; + } + if (CollUtil.isEmpty(sourceList)) { + return CollUtil.newArrayList(); + } + return CONVERTER.convert(sourceList, desc); + } + + /** + * 将 Map 转换为 beanClass 类型的集合并返回 + * + * @param map 数据来源 + * @param beanClass bean类 + * @return bean对象 + */ + public static T convert(Map map, Class beanClass) { + if (MapUtil.isEmpty(map)) { + return null; + } + if (ObjectUtil.isNull(beanClass)) { + return null; + } + return CONVERTER.convert(map, beanClass); + } + +} + diff --git a/ruoyi-common/ruoyi-common-core/src/main/java/com/ruoyi/common/core/utils/MessageUtils.java b/ruoyi-common/ruoyi-common-core/src/main/java/com/ruoyi/common/core/utils/MessageUtils.java new file mode 100644 index 0000000..24928f8 --- /dev/null +++ b/ruoyi-common/ruoyi-common-core/src/main/java/com/ruoyi/common/core/utils/MessageUtils.java @@ -0,0 +1,28 @@ +package com.ruoyi.common.core.utils; + +import lombok.AccessLevel; +import lombok.NoArgsConstructor; +import org.springframework.context.MessageSource; +import org.springframework.context.i18n.LocaleContextHolder; + +/** + * 获取i18n资源文件 + * + * @author Lion Li + */ +@NoArgsConstructor(access = AccessLevel.PRIVATE) +public class MessageUtils { + + private static final MessageSource MESSAGE_SOURCE = SpringUtils.getBean(MessageSource.class); + + /** + * 根据消息键和参数 获取消息 委托给spring messageSource + * + * @param code 消息键 + * @param args 参数 + * @return 获取国际化翻译值 + */ + public static String message(String code, Object... args) { + return MESSAGE_SOURCE.getMessage(code, args, LocaleContextHolder.getLocale()); + } +} diff --git a/ruoyi-common/ruoyi-common-core/src/main/java/com/ruoyi/common/core/utils/ServletUtils.java b/ruoyi-common/ruoyi-common-core/src/main/java/com/ruoyi/common/core/utils/ServletUtils.java new file mode 100644 index 0000000..ecfa390 --- /dev/null +++ b/ruoyi-common/ruoyi-common-core/src/main/java/com/ruoyi/common/core/utils/ServletUtils.java @@ -0,0 +1,193 @@ +package com.ruoyi.common.core.utils; + +import cn.hutool.core.convert.Convert; +import cn.hutool.extra.servlet.JakartaServletUtil; +import cn.hutool.http.HttpStatus; +import lombok.AccessLevel; +import lombok.NoArgsConstructor; +import org.springframework.http.MediaType; +import org.springframework.web.context.request.RequestAttributes; +import org.springframework.web.context.request.RequestContextHolder; +import org.springframework.web.context.request.ServletRequestAttributes; + +import jakarta.servlet.ServletRequest; +import jakarta.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletResponse; +import jakarta.servlet.http.HttpSession; +import java.io.IOException; +import java.net.URLDecoder; +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.Collections; +import java.util.HashMap; +import java.util.Map; + +/** + * 客户端工具类 + * + * @author ruoyi + */ +@NoArgsConstructor(access = AccessLevel.PRIVATE) +public class ServletUtils extends JakartaServletUtil { + + /** + * 获取String参数 + */ + public static String getParameter(String name) { + return getRequest().getParameter(name); + } + + /** + * 获取String参数 + */ + public static String getParameter(String name, String defaultValue) { + return Convert.toStr(getRequest().getParameter(name), defaultValue); + } + + /** + * 获取Integer参数 + */ + public static Integer getParameterToInt(String name) { + return Convert.toInt(getRequest().getParameter(name)); + } + + /** + * 获取Integer参数 + */ + public static Integer getParameterToInt(String name, Integer defaultValue) { + return Convert.toInt(getRequest().getParameter(name), defaultValue); + } + + /** + * 获取Boolean参数 + */ + public static Boolean getParameterToBool(String name) { + return Convert.toBool(getRequest().getParameter(name)); + } + + /** + * 获取Boolean参数 + */ + public static Boolean getParameterToBool(String name, Boolean defaultValue) { + return Convert.toBool(getRequest().getParameter(name), defaultValue); + } + + /** + * 获得所有请求参数 + * + * @param request 请求对象{@link ServletRequest} + * @return Map + */ + public static Map getParams(ServletRequest request) { + final Map map = request.getParameterMap(); + return Collections.unmodifiableMap(map); + } + + /** + * 获得所有请求参数 + * + * @param request 请求对象{@link ServletRequest} + * @return Map + */ + public static Map getParamMap(ServletRequest request) { + Map params = new HashMap<>(); + for (Map.Entry entry : getParams(request).entrySet()) { + params.put(entry.getKey(), StringUtils.join(entry.getValue(), StringUtils.SEPARATOR)); + } + return params; + } + + /** + * 获取request + */ + public static HttpServletRequest getRequest() { + return getRequestAttributes().getRequest(); + } + + /** + * 获取response + */ + public static HttpServletResponse getResponse() { + return getRequestAttributes().getResponse(); + } + + /** + * 获取session + */ + public static HttpSession getSession() { + return getRequest().getSession(); + } + + public static ServletRequestAttributes getRequestAttributes() { + RequestAttributes attributes = RequestContextHolder.getRequestAttributes(); + return (ServletRequestAttributes) attributes; + } + + /** + * 将字符串渲染到客户端 + * + * @param response 渲染对象 + * @param string 待渲染的字符串 + */ + public static void renderString(HttpServletResponse response, String string) { + try { + response.setStatus(HttpStatus.HTTP_OK); + response.setContentType(MediaType.APPLICATION_JSON_VALUE); + response.setCharacterEncoding(StandardCharsets.UTF_8.toString()); + response.getWriter().print(string); + } catch (IOException e) { + e.printStackTrace(); + } + } + + /** + * 是否是Ajax异步请求 + * + * @param request + */ + public static boolean isAjaxRequest(HttpServletRequest request) { + + String accept = request.getHeader("accept"); + if (accept != null && accept.contains(MediaType.APPLICATION_JSON_VALUE)) { + return true; + } + + String xRequestedWith = request.getHeader("X-Requested-With"); + if (xRequestedWith != null && xRequestedWith.contains("XMLHttpRequest")) { + return true; + } + + String uri = request.getRequestURI(); + if (StringUtils.equalsAnyIgnoreCase(uri, ".json", ".xml")) { + return true; + } + + String ajax = request.getParameter("__ajax"); + return StringUtils.equalsAnyIgnoreCase(ajax, "json", "xml"); + } + + public static String getClientIP() { + return getClientIP(getRequest()); + } + + /** + * 内容编码 + * + * @param str 内容 + * @return 编码后的内容 + */ + public static String urlEncode(String str) { + return URLEncoder.encode(str, StandardCharsets.UTF_8); + } + + /** + * 内容解码 + * + * @param str 内容 + * @return 解码后的内容 + */ + public static String urlDecode(String str) { + return URLDecoder.decode(str, StandardCharsets.UTF_8); + } + +} diff --git a/ruoyi-common/ruoyi-common-core/src/main/java/com/ruoyi/common/core/utils/SpringUtils.java b/ruoyi-common/ruoyi-common-core/src/main/java/com/ruoyi/common/core/utils/SpringUtils.java new file mode 100644 index 0000000..259a5e5 --- /dev/null +++ b/ruoyi-common/ruoyi-common-core/src/main/java/com/ruoyi/common/core/utils/SpringUtils.java @@ -0,0 +1,69 @@ +package com.ruoyi.common.core.utils; + +import cn.hutool.extra.spring.SpringUtil; +import org.springframework.beans.factory.NoSuchBeanDefinitionException; +import org.springframework.boot.autoconfigure.thread.Threading; +import org.springframework.context.ApplicationContext; +import org.springframework.core.env.Environment; +import org.springframework.stereotype.Component; + +/** + * spring工具类 + * + * @author Lion Li + */ +@Component +public final class SpringUtils extends SpringUtil { + + /** + * 如果BeanFactory包含一个与所给名称匹配的bean定义,则返回true + */ + public static boolean containsBean(String name) { + return getBeanFactory().containsBean(name); + } + + /** + * 判断以给定名字注册的bean定义是一个singleton还是一个prototype。 + * 如果与给定名字相应的bean定义没有被找到,将会抛出一个异常(NoSuchBeanDefinitionException) + * + */ + public static boolean isSingleton(String name) throws NoSuchBeanDefinitionException { + return getBeanFactory().isSingleton(name); + } + + /** + * @return Class 注册对象的类型 + */ + public static Class getType(String name) throws NoSuchBeanDefinitionException { + return getBeanFactory().getType(name); + } + + /** + * 如果给定的bean名字在bean定义中有别名,则返回这些别名 + */ + public static String[] getAliases(String name) throws NoSuchBeanDefinitionException { + return getBeanFactory().getAliases(name); + } + + /** + * 获取aop代理对象 + * + */ + @SuppressWarnings("unchecked") + public static T getAopProxy(T invoker) { + return (T) getBean(invoker.getClass()); + } + + + /** + * 获取spring上下文 + */ + public static ApplicationContext context() { + return getApplicationContext(); + } + + public static boolean isVirtual() { + return Threading.VIRTUAL.isActive(getBean(Environment.class)); + } + +} diff --git a/ruoyi-common/ruoyi-common-core/src/main/java/com/ruoyi/common/core/utils/StreamUtils.java b/ruoyi-common/ruoyi-common-core/src/main/java/com/ruoyi/common/core/utils/StreamUtils.java new file mode 100644 index 0000000..d0979cb --- /dev/null +++ b/ruoyi-common/ruoyi-common-core/src/main/java/com/ruoyi/common/core/utils/StreamUtils.java @@ -0,0 +1,254 @@ +package com.ruoyi.common.core.utils; + +import cn.hutool.core.collection.CollUtil; +import cn.hutool.core.map.MapUtil; +import lombok.AccessLevel; +import lombok.NoArgsConstructor; + +import java.util.*; +import java.util.function.BiFunction; +import java.util.function.Function; +import java.util.function.Predicate; +import java.util.stream.Collectors; + +/** + * stream 流工具类 + * + * @author Lion Li + */ +@NoArgsConstructor(access = AccessLevel.PRIVATE) +public class StreamUtils { + + /** + * 将collection过滤 + * + * @param collection 需要转化的集合 + * @param function 过滤方法 + * @return 过滤后的list + */ + public static List filter(Collection collection, Predicate function) { + if (CollUtil.isEmpty(collection)) { + return CollUtil.newArrayList(); + } + // 注意此处不要使用 .toList() 新语法 因为返回的是不可变List 会导致序列化问题 + return collection.stream().filter(function).collect(Collectors.toList()); + } + + /** + * 将collection拼接 + * + * @param collection 需要转化的集合 + * @param function 拼接方法 + * @return 拼接后的list + */ + public static String join(Collection collection, Function function) { + return join(collection, function, StringUtils.SEPARATOR); + } + + /** + * 将collection拼接 + * + * @param collection 需要转化的集合 + * @param function 拼接方法 + * @param delimiter 拼接符 + * @return 拼接后的list + */ + public static String join(Collection collection, Function function, CharSequence delimiter) { + if (CollUtil.isEmpty(collection)) { + return StringUtils.EMPTY; + } + return collection.stream().map(function).filter(Objects::nonNull).collect(Collectors.joining(delimiter)); + } + + /** + * 将collection排序 + * + * @param collection 需要转化的集合 + * @param comparing 排序方法 + * @return 排序后的list + */ + public static List sorted(Collection collection, Comparator comparing) { + if (CollUtil.isEmpty(collection)) { + return CollUtil.newArrayList(); + } + // 注意此处不要使用 .toList() 新语法 因为返回的是不可变List 会导致序列化问题 + return collection.stream().sorted(comparing).collect(Collectors.toList()); + } + + /** + * 将collection转化为类型不变的map
+ * {@code Collection ----> Map} + * + * @param collection 需要转化的集合 + * @param key V类型转化为K类型的lambda方法 + * @param collection中的泛型 + * @param map中的key类型 + * @return 转化后的map + */ + public static Map toIdentityMap(Collection collection, Function key) { + if (CollUtil.isEmpty(collection)) { + return MapUtil.newHashMap(); + } + return collection.stream().filter(Objects::nonNull).collect(Collectors.toMap(key, Function.identity(), (l, r) -> l)); + } + + /** + * 将Collection转化为map(value类型与collection的泛型不同)
+ * {@code Collection -----> Map } + * + * @param collection 需要转化的集合 + * @param key E类型转化为K类型的lambda方法 + * @param value E类型转化为V类型的lambda方法 + * @param collection中的泛型 + * @param map中的key类型 + * @param map中的value类型 + * @return 转化后的map + */ + public static Map toMap(Collection collection, Function key, Function value) { + if (CollUtil.isEmpty(collection)) { + return MapUtil.newHashMap(); + } + return collection.stream().filter(Objects::nonNull).collect(Collectors.toMap(key, value, (l, r) -> l)); + } + + /** + * 将collection按照规则(比如有相同的班级id)分类成map
+ * {@code Collection -------> Map> } + * + * @param collection 需要分类的集合 + * @param key 分类的规则 + * @param collection中的泛型 + * @param map中的key类型 + * @return 分类后的map + */ + public static Map> groupByKey(Collection collection, Function key) { + if (CollUtil.isEmpty(collection)) { + return MapUtil.newHashMap(); + } + return collection + .stream().filter(Objects::nonNull) + .collect(Collectors.groupingBy(key, LinkedHashMap::new, Collectors.toList())); + } + + /** + * 将collection按照两个规则(比如有相同的年级id,班级id)分类成双层map
+ * {@code Collection ---> Map>> } + * + * @param collection 需要分类的集合 + * @param key1 第一个分类的规则 + * @param key2 第二个分类的规则 + * @param 集合元素类型 + * @param 第一个map中的key类型 + * @param 第二个map中的key类型 + * @return 分类后的map + */ + public static Map>> groupBy2Key(Collection collection, Function key1, Function key2) { + if (CollUtil.isEmpty(collection)) { + return MapUtil.newHashMap(); + } + return collection + .stream().filter(Objects::nonNull) + .collect(Collectors.groupingBy(key1, LinkedHashMap::new, Collectors.groupingBy(key2, LinkedHashMap::new, Collectors.toList()))); + } + + /** + * 将collection按照两个规则(比如有相同的年级id,班级id)分类成双层map
+ * {@code Collection ---> Map> } + * + * @param collection 需要分类的集合 + * @param key1 第一个分类的规则 + * @param key2 第二个分类的规则 + * @param 第一个map中的key类型 + * @param 第二个map中的key类型 + * @param collection中的泛型 + * @return 分类后的map + */ + public static Map> group2Map(Collection collection, Function key1, Function key2) { + if (CollUtil.isEmpty(collection) || key1 == null || key2 == null) { + return MapUtil.newHashMap(); + } + return collection + .stream().filter(Objects::nonNull) + .collect(Collectors.groupingBy(key1, LinkedHashMap::new, Collectors.toMap(key2, Function.identity(), (l, r) -> l))); + } + + /** + * 将collection转化为List集合,但是两者的泛型不同
+ * {@code Collection ------> List } + * + * @param collection 需要转化的集合 + * @param function collection中的泛型转化为list泛型的lambda表达式 + * @param collection中的泛型 + * @param List中的泛型 + * @return 转化后的list + */ + public static List toList(Collection collection, Function function) { + if (CollUtil.isEmpty(collection)) { + return CollUtil.newArrayList(); + } + return collection + .stream() + .map(function) + .filter(Objects::nonNull) + // 注意此处不要使用 .toList() 新语法 因为返回的是不可变List 会导致序列化问题 + .collect(Collectors.toList()); + } + + /** + * 将collection转化为Set集合,但是两者的泛型不同
+ * {@code Collection ------> Set } + * + * @param collection 需要转化的集合 + * @param function collection中的泛型转化为set泛型的lambda表达式 + * @param collection中的泛型 + * @param Set中的泛型 + * @return 转化后的Set + */ + public static Set toSet(Collection collection, Function function) { + if (CollUtil.isEmpty(collection) || function == null) { + return CollUtil.newHashSet(); + } + return collection + .stream() + .map(function) + .filter(Objects::nonNull) + .collect(Collectors.toSet()); + } + + + /** + * 合并两个相同key类型的map + * + * @param map1 第一个需要合并的 map + * @param map2 第二个需要合并的 map + * @param merge 合并的lambda,将key value1 value2合并成最终的类型,注意value可能为空的情况 + * @param map中的key类型 + * @param 第一个 map的value类型 + * @param 第二个 map的value类型 + * @param 最终map的value类型 + * @return 合并后的map + */ + public static Map merge(Map map1, Map map2, BiFunction merge) { + if (MapUtil.isEmpty(map1) && MapUtil.isEmpty(map2)) { + return MapUtil.newHashMap(); + } else if (MapUtil.isEmpty(map1)) { + map1 = MapUtil.newHashMap(); + } else if (MapUtil.isEmpty(map2)) { + map2 = MapUtil.newHashMap(); + } + Set key = new HashSet<>(); + key.addAll(map1.keySet()); + key.addAll(map2.keySet()); + Map map = new HashMap<>(); + for (K t : key) { + X x = map1.get(t); + Y y = map2.get(t); + V z = merge.apply(x, y); + if (z != null) { + map.put(t, z); + } + } + return map; + } + +} diff --git a/ruoyi-common/ruoyi-common-core/src/main/java/com/ruoyi/common/core/utils/StringUtils.java b/ruoyi-common/ruoyi-common-core/src/main/java/com/ruoyi/common/core/utils/StringUtils.java new file mode 100644 index 0000000..c3e6033 --- /dev/null +++ b/ruoyi-common/ruoyi-common-core/src/main/java/com/ruoyi/common/core/utils/StringUtils.java @@ -0,0 +1,321 @@ +package com.ruoyi.common.core.utils; + +import cn.hutool.core.collection.CollUtil; +import cn.hutool.core.convert.Convert; +import cn.hutool.core.lang.Validator; +import cn.hutool.core.util.StrUtil; +import lombok.AccessLevel; +import lombok.NoArgsConstructor; +import org.springframework.util.AntPathMatcher; + +import java.util.*; +import java.util.function.Function; +import java.util.stream.Collectors; + +/** + * 字符串工具类 + * + * @author Lion Li + */ +@NoArgsConstructor(access = AccessLevel.PRIVATE) +public class StringUtils extends org.apache.commons.lang3.StringUtils { + + public static final String SEPARATOR = ","; + + /** + * 获取参数不为空值 + * + * @param str defaultValue 要判断的value + * @return value 返回值 + */ + public static String blankToDefault(String str, String defaultValue) { + return StrUtil.blankToDefault(str, defaultValue); + } + + /** + * * 判断一个字符串是否为空串 + * + * @param str String + * @return true:为空 false:非空 + */ + public static boolean isEmpty(String str) { + return StrUtil.isEmpty(str); + } + + /** + * * 判断一个字符串是否为非空串 + * + * @param str String + * @return true:非空串 false:空串 + */ + public static boolean isNotEmpty(String str) { + return !isEmpty(str); + } + + /** + * 去空格 + */ + public static String trim(String str) { + return StrUtil.trim(str); + } + + /** + * 截取字符串 + * + * @param str 字符串 + * @param start 开始 + * @return 结果 + */ + public static String substring(final String str, int start) { + return substring(str, start, str.length()); + } + + /** + * 截取字符串 + * + * @param str 字符串 + * @param start 开始 + * @param end 结束 + * @return 结果 + */ + public static String substring(final String str, int start, int end) { + return StrUtil.sub(str, start, end); + } + + /** + * 格式化文本, {} 表示占位符
+ * 此方法只是简单将占位符 {} 按照顺序替换为参数
+ * 如果想输出 {} 使用 \\转义 { 即可,如果想输出 {} 之前的 \ 使用双转义符 \\\\ 即可
+ * 例:
+ * 通常使用:format("this is {} for {}", "a", "b") -> this is a for b
+ * 转义{}: format("this is \\{} for {}", "a", "b") -> this is {} for a
+ * 转义\: format("this is \\\\{} for {}", "a", "b") -> this is \a for b
+ * + * @param template 文本模板,被替换的部分用 {} 表示 + * @param params 参数值 + * @return 格式化后的文本 + */ + public static String format(String template, Object... params) { + return StrUtil.format(template, params); + } + + /** + * 是否为http(s)://开头 + * + * @param link 链接 + * @return 结果 + */ + public static boolean ishttp(String link) { + return Validator.isUrl(link); + } + + /** + * 字符串转set + * + * @param str 字符串 + * @param sep 分隔符 + * @return set集合 + */ + public static Set str2Set(String str, String sep) { + return new HashSet<>(str2List(str, sep, true, false)); + } + + /** + * 字符串转list + * + * @param str 字符串 + * @param sep 分隔符 + * @param filterBlank 过滤纯空白 + * @param trim 去掉首尾空白 + * @return list集合 + */ + public static List str2List(String str, String sep, boolean filterBlank, boolean trim) { + List list = new ArrayList<>(); + if (isEmpty(str)) { + return list; + } + + // 过滤空白字符串 + if (filterBlank && isBlank(str)) { + return list; + } + String[] split = str.split(sep); + for (String string : split) { + if (filterBlank && isBlank(string)) { + continue; + } + if (trim) { + string = trim(string); + } + list.add(string); + } + + return list; + } + + /** + * 查找指定字符串是否包含指定字符串列表中的任意一个字符串同时串忽略大小写 + * + * @param cs 指定字符串 + * @param searchCharSequences 需要检查的字符串数组 + * @return 是否包含任意一个字符串 + */ + public static boolean containsAnyIgnoreCase(CharSequence cs, CharSequence... searchCharSequences) { + return StrUtil.containsAnyIgnoreCase(cs, searchCharSequences); + } + + /** + * 驼峰转下划线命名 + */ + public static String toUnderScoreCase(String str) { + return StrUtil.toUnderlineCase(str); + } + + /** + * 是否包含字符串 + * + * @param str 验证字符串 + * @param strs 字符串组 + * @return 包含返回true + */ + public static boolean inStringIgnoreCase(String str, String... strs) { + return StrUtil.equalsAnyIgnoreCase(str, strs); + } + + /** + * 将下划线大写方式命名的字符串转换为驼峰式。如果转换前的下划线大写方式命名的字符串为空,则返回空字符串。 例如:HELLO_WORLD->HelloWorld + * + * @param name 转换前的下划线大写方式命名的字符串 + * @return 转换后的驼峰式命名的字符串 + */ + public static String convertToCamelCase(String name) { + return StrUtil.upperFirst(StrUtil.toCamelCase(name)); + } + + /** + * 驼峰式命名法 例如:user_name->userName + */ + public static String toCamelCase(String s) { + return StrUtil.toCamelCase(s); + } + + /** + * 查找指定字符串是否匹配指定字符串列表中的任意一个字符串 + * + * @param str 指定字符串 + * @param strs 需要检查的字符串数组 + * @return 是否匹配 + */ + public static boolean matches(String str, List strs) { + if (isEmpty(str) || CollUtil.isEmpty(strs)) { + return false; + } + for (String pattern : strs) { + if (isMatch(pattern, str)) { + return true; + } + } + return false; + } + + /** + * 判断url是否与规则配置: + * ? 表示单个字符; + * * 表示一层路径内的任意字符串,不可跨层级; + * ** 表示任意层路径; + * + * @param pattern 匹配规则 + * @param url 需要匹配的url + */ + public static boolean isMatch(String pattern, String url) { + AntPathMatcher matcher = new AntPathMatcher(); + return matcher.match(pattern, url); + } + + /** + * 数字左边补齐0,使之达到指定长度。注意,如果数字转换为字符串后,长度大于size,则只保留 最后size个字符。 + * + * @param num 数字对象 + * @param size 字符串指定长度 + * @return 返回数字的字符串格式,该字符串为指定长度。 + */ + public static final String padl(final Number num, final int size) { + return padl(num.toString(), size, '0'); + } + + /** + * 字符串左补齐。如果原始字符串s长度大于size,则只保留最后size个字符。 + * + * @param s 原始字符串 + * @param size 字符串指定长度 + * @param c 用于补齐的字符 + * @return 返回指定长度的字符串,由原字符串左补齐或截取得到。 + */ + public static String padl(final String s, final int size, final char c) { + final StringBuilder sb = new StringBuilder(size); + if (s != null) { + final int len = s.length(); + if (s.length() <= size) { + sb.append(String.valueOf(c).repeat(size - len)); + sb.append(s); + } else { + return s.substring(len - size, len); + } + } else { + sb.append(String.valueOf(c).repeat(Math.max(0, size))); + } + return sb.toString(); + } + + /** + * 切分字符串(分隔符默认逗号) + * + * @param str 被切分的字符串 + * @return 分割后的数据列表 + */ + public static List splitList(String str) { + return splitTo(str, Convert::toStr); + } + + /** + * 切分字符串 + * + * @param str 被切分的字符串 + * @param separator 分隔符 + * @return 分割后的数据列表 + */ + public static List splitList(String str, String separator) { + return splitTo(str, separator, Convert::toStr); + } + + /** + * 切分字符串自定义转换(分隔符默认逗号) + * + * @param str 被切分的字符串 + * @param mapper 自定义转换 + * @return 分割后的数据列表 + */ + public static List splitTo(String str, Function mapper) { + return splitTo(str, SEPARATOR, mapper); + } + + /** + * 切分字符串自定义转换 + * + * @param str 被切分的字符串 + * @param separator 分隔符 + * @param mapper 自定义转换 + * @return 分割后的数据列表 + */ + public static List splitTo(String str, String separator, Function mapper) { + if (isBlank(str)) { + return new ArrayList<>(0); + } + return StrUtil.split(str, separator) + .stream() + .filter(Objects::nonNull) + .map(mapper) + .collect(Collectors.toList()); + } + +} diff --git a/ruoyi-common/ruoyi-common-core/src/main/java/com/ruoyi/common/core/utils/Threads.java b/ruoyi-common/ruoyi-common-core/src/main/java/com/ruoyi/common/core/utils/Threads.java new file mode 100644 index 0000000..89ca662 --- /dev/null +++ b/ruoyi-common/ruoyi-common-core/src/main/java/com/ruoyi/common/core/utils/Threads.java @@ -0,0 +1,75 @@ +package com.ruoyi.common.core.utils; + +import lombok.AccessLevel; +import lombok.NoArgsConstructor; +import lombok.extern.slf4j.Slf4j; + +import java.util.concurrent.*; + +/** + * 线程相关工具类. + * + * @author ruoyi + */ +@Slf4j +@NoArgsConstructor(access = AccessLevel.PRIVATE) +public class Threads { + + /** + * sleep等待,单位为毫秒 + */ + public static void sleep(long milliseconds) { + try { + Thread.sleep(milliseconds); + } catch (InterruptedException e) { + return; + } + } + + /** + * 停止线程池 + * 先使用shutdown, 停止接收新任务并尝试完成所有已存在任务. + * 如果超时, 则调用shutdownNow, 取消在workQueue中Pending的任务,并中断所有阻塞函数. + * 如果仍然超時,則強制退出. + * 另对在shutdown时线程本身被调用中断做了处理. + */ + public static void shutdownAndAwaitTermination(ExecutorService pool) { + if (pool != null && !pool.isShutdown()) { + pool.shutdown(); + try { + if (!pool.awaitTermination(120, TimeUnit.SECONDS)) { + pool.shutdownNow(); + if (!pool.awaitTermination(120, TimeUnit.SECONDS)) { + log.info("Pool did not terminate"); + } + } + } catch (InterruptedException ie) { + pool.shutdownNow(); + Thread.currentThread().interrupt(); + } + } + } + + /** + * 打印线程异常信息 + */ + public static void printException(Runnable r, Throwable t) { + if (t == null && r instanceof Future) { + try { + Future future = (Future) r; + if (future.isDone()) { + future.get(); + } + } catch (CancellationException ce) { + t = ce; + } catch (ExecutionException ee) { + t = ee.getCause(); + } catch (InterruptedException ie) { + Thread.currentThread().interrupt(); + } + } + if (t != null) { + log.error(t.getMessage(), t); + } + } +} diff --git a/ruoyi-common/ruoyi-common-core/src/main/java/com/ruoyi/common/core/utils/TreeBuildUtils.java b/ruoyi-common/ruoyi-common-core/src/main/java/com/ruoyi/common/core/utils/TreeBuildUtils.java new file mode 100644 index 0000000..0d24945 --- /dev/null +++ b/ruoyi-common/ruoyi-common-core/src/main/java/com/ruoyi/common/core/utils/TreeBuildUtils.java @@ -0,0 +1,35 @@ +package com.ruoyi.common.core.utils; + +import cn.hutool.core.collection.CollUtil; +import cn.hutool.core.lang.tree.Tree; +import cn.hutool.core.lang.tree.TreeNodeConfig; +import cn.hutool.core.lang.tree.TreeUtil; +import cn.hutool.core.lang.tree.parser.NodeParser; +import com.ruoyi.common.core.utils.reflect.ReflectUtils; +import lombok.AccessLevel; +import lombok.NoArgsConstructor; + +import java.util.List; + +/** + * 扩展 hutool TreeUtil 封装系统树构建 + * + * @author Lion Li + */ +@NoArgsConstructor(access = AccessLevel.PRIVATE) +public class TreeBuildUtils extends TreeUtil { + + /** + * 根据前端定制差异化字段 + */ + public static final TreeNodeConfig DEFAULT_CONFIG = TreeNodeConfig.DEFAULT_CONFIG.setNameKey("label"); + + public static List> build(List list, NodeParser nodeParser) { + if (CollUtil.isEmpty(list)) { + return null; + } + K k = ReflectUtils.invokeGetter(list.get(0), "parentId"); + return TreeUtil.build(list, k, DEFAULT_CONFIG, nodeParser); + } + +} diff --git a/ruoyi-common/ruoyi-common-core/src/main/java/com/ruoyi/common/core/utils/ValidatorUtils.java b/ruoyi-common/ruoyi-common-core/src/main/java/com/ruoyi/common/core/utils/ValidatorUtils.java new file mode 100644 index 0000000..7b331f0 --- /dev/null +++ b/ruoyi-common/ruoyi-common-core/src/main/java/com/ruoyi/common/core/utils/ValidatorUtils.java @@ -0,0 +1,28 @@ +package com.ruoyi.common.core.utils; + +import lombok.AccessLevel; +import lombok.NoArgsConstructor; + +import jakarta.validation.ConstraintViolation; +import jakarta.validation.ConstraintViolationException; +import jakarta.validation.Validator; +import java.util.Set; + +/** + * Validator 校验框架工具 + * + * @author Lion Li + */ +@NoArgsConstructor(access = AccessLevel.PRIVATE) +public class ValidatorUtils { + + private static final Validator VALID = SpringUtils.getBean(Validator.class); + + public static void validate(T object, Class... groups) { + Set> validate = VALID.validate(object, groups); + if (!validate.isEmpty()) { + throw new ConstraintViolationException("参数校验异常", validate); + } + } + +} diff --git a/ruoyi-common/ruoyi-common-core/src/main/java/com/ruoyi/common/core/utils/file/FileUtils.java b/ruoyi-common/ruoyi-common-core/src/main/java/com/ruoyi/common/core/utils/file/FileUtils.java new file mode 100644 index 0000000..bf65631 --- /dev/null +++ b/ruoyi-common/ruoyi-common-core/src/main/java/com/ruoyi/common/core/utils/file/FileUtils.java @@ -0,0 +1,44 @@ +package com.ruoyi.common.core.utils.file; + +import cn.hutool.core.io.FileUtil; +import lombok.AccessLevel; +import lombok.NoArgsConstructor; + +import jakarta.servlet.http.HttpServletResponse; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; + +/** + * 文件处理工具类 + * + * @author Lion Li + */ +@NoArgsConstructor(access = AccessLevel.PRIVATE) +public class FileUtils extends FileUtil { + + /** + * 下载文件名重新编码 + * + * @param response 响应对象 + * @param realFileName 真实文件名 + */ + public static void setAttachmentResponseHeader(HttpServletResponse response, String realFileName) { + String percentEncodedFileName = percentEncode(realFileName); + String contentDispositionValue = "attachment; filename=%s;filename*=utf-8''%s".formatted(percentEncodedFileName, percentEncodedFileName); + response.addHeader("Access-Control-Expose-Headers", "Content-Disposition,download-filename"); + response.setHeader("Content-disposition", contentDispositionValue); + response.setHeader("download-filename", percentEncodedFileName); + } + + /** + * 百分号编码工具方法 + * + * @param s 需要百分号编码的字符串 + * @return 百分号编码后的字符串 + */ + public static String percentEncode(String s) { + String encode = URLEncoder.encode(s, StandardCharsets.UTF_8); + return encode.replaceAll("\\+", "%20"); + } +} diff --git a/ruoyi-common/ruoyi-common-core/src/main/java/com/ruoyi/common/core/utils/file/MimeTypeUtils.java b/ruoyi-common/ruoyi-common-core/src/main/java/com/ruoyi/common/core/utils/file/MimeTypeUtils.java new file mode 100644 index 0000000..7291c0f --- /dev/null +++ b/ruoyi-common/ruoyi-common-core/src/main/java/com/ruoyi/common/core/utils/file/MimeTypeUtils.java @@ -0,0 +1,40 @@ +package com.ruoyi.common.core.utils.file; + +/** + * 媒体类型工具类 + * + * @author ruoyi + */ +public class MimeTypeUtils { + public static final String IMAGE_PNG = "image/png"; + + public static final String IMAGE_JPG = "image/jpg"; + + public static final String IMAGE_JPEG = "image/jpeg"; + + public static final String IMAGE_BMP = "image/bmp"; + + public static final String IMAGE_GIF = "image/gif"; + + public static final String[] IMAGE_EXTENSION = {"bmp", "gif", "jpg", "jpeg", "png"}; + + public static final String[] FLASH_EXTENSION = {"swf", "flv"}; + + public static final String[] MEDIA_EXTENSION = {"swf", "flv", "mp3", "wav", "wma", "wmv", "mid", "avi", "mpg", + "asf", "rm", "rmvb"}; + + public static final String[] VIDEO_EXTENSION = {"mp4", "avi", "rmvb"}; + + public static final String[] DEFAULT_ALLOWED_EXTENSION = { + // 图片 + "bmp", "gif", "jpg", "jpeg", "png", + // word excel powerpoint + "doc", "docx", "xls", "xlsx", "ppt", "pptx", "html", "htm", "txt", + // 压缩文件 + "rar", "zip", "gz", "bz2", + // 视频格式 + "mp4", "avi", "rmvb", + // pdf + "pdf"}; + +} diff --git a/ruoyi-common/ruoyi-common-core/src/main/java/com/ruoyi/common/core/utils/ip/AddressUtils.java b/ruoyi-common/ruoyi-common-core/src/main/java/com/ruoyi/common/core/utils/ip/AddressUtils.java new file mode 100644 index 0000000..84c7cf2 --- /dev/null +++ b/ruoyi-common/ruoyi-common-core/src/main/java/com/ruoyi/common/core/utils/ip/AddressUtils.java @@ -0,0 +1,33 @@ +package com.ruoyi.common.core.utils.ip; + +import cn.hutool.core.net.NetUtil; +import cn.hutool.http.HtmlUtil; +import com.ruoyi.common.core.utils.StringUtils; +import lombok.AccessLevel; +import lombok.NoArgsConstructor; +import lombok.extern.slf4j.Slf4j; + +/** + * 获取地址类 + * + * @author Lion Li + */ +@Slf4j +@NoArgsConstructor(access = AccessLevel.PRIVATE) +public class AddressUtils { + + // 未知地址 + public static final String UNKNOWN = "XX XX"; + + public static String getRealAddressByIP(String ip) { + if (StringUtils.isBlank(ip)) { + return UNKNOWN; + } + // 内网不查询 + ip = StringUtils.contains(ip, "0:0:0:0:0:0:0:1") ? "127.0.0.1" : HtmlUtil.cleanHtmlTag(ip); + if (NetUtil.isInnerIP(ip)) { + return "内网IP"; + } + return RegionUtils.getCityInfo(ip); + } +} diff --git a/ruoyi-common/ruoyi-common-core/src/main/java/com/ruoyi/common/core/utils/ip/RegionUtils.java b/ruoyi-common/ruoyi-common-core/src/main/java/com/ruoyi/common/core/utils/ip/RegionUtils.java new file mode 100644 index 0000000..4ff0f80 --- /dev/null +++ b/ruoyi-common/ruoyi-common-core/src/main/java/com/ruoyi/common/core/utils/ip/RegionUtils.java @@ -0,0 +1,66 @@ +package com.ruoyi.common.core.utils.ip; + +import cn.hutool.core.io.FileUtil; +import cn.hutool.core.io.resource.ClassPathResource; +import cn.hutool.core.util.ObjectUtil; +import com.ruoyi.common.core.exception.ServiceException; +import com.ruoyi.common.core.utils.file.FileUtils; +import lombok.extern.slf4j.Slf4j; +import org.lionsoul.ip2region.xdb.Searcher; + +import java.io.File; + +/** + * 根据ip地址定位工具类,离线方式 + * 参考地址:集成 ip2region 实现离线IP地址定位库 + * + * @author lishuyan + */ +@Slf4j +public class RegionUtils { + + private static final Searcher SEARCHER; + + static { + String fileName = "/ip2region.xdb"; + File existFile = FileUtils.file(FileUtil.getTmpDir() + FileUtil.FILE_SEPARATOR + fileName); + if (!FileUtils.exist(existFile)) { + ClassPathResource fileStream = new ClassPathResource(fileName); + if (ObjectUtil.isEmpty(fileStream.getStream())) { + throw new ServiceException("RegionUtils初始化失败,原因:IP地址库数据不存在!"); + } + FileUtils.writeFromStream(fileStream.getStream(), existFile); + } + + String dbPath = existFile.getPath(); + + // 1、从 dbPath 加载整个 xdb 到内存。 + byte[] cBuff; + try { + cBuff = Searcher.loadContentFromFile(dbPath); + } catch (Exception e) { + throw new ServiceException("RegionUtils初始化失败,原因:从ip2region.xdb文件加载内容失败!" + e.getMessage()); + } + // 2、使用上述的 cBuff 创建一个完全基于内存的查询对象。 + try { + SEARCHER = Searcher.newWithBuffer(cBuff); + } catch (Exception e) { + throw new ServiceException("RegionUtils初始化失败,原因:" + e.getMessage()); + } + } + + /** + * 根据IP地址离线获取城市 + */ + public static String getCityInfo(String ip) { + try { + ip = ip.trim(); + // 3、执行查询 + String region = SEARCHER.search(ip); + return region.replace("0|", "").replace("|0", ""); + } catch (Exception e) { + log.error("IP地址离线获取城市异常 {}", ip); + return "未知"; + } + } +} diff --git a/ruoyi-common/ruoyi-common-core/src/main/java/com/ruoyi/common/core/utils/reflect/ReflectUtils.java b/ruoyi-common/ruoyi-common-core/src/main/java/com/ruoyi/common/core/utils/reflect/ReflectUtils.java new file mode 100644 index 0000000..af0c560 --- /dev/null +++ b/ruoyi-common/ruoyi-common-core/src/main/java/com/ruoyi/common/core/utils/reflect/ReflectUtils.java @@ -0,0 +1,56 @@ +package com.ruoyi.common.core.utils.reflect; + +import cn.hutool.core.util.ReflectUtil; +import com.ruoyi.common.core.utils.StringUtils; +import lombok.AccessLevel; +import lombok.NoArgsConstructor; + +import java.lang.reflect.Method; + +/** + * 反射工具类. 提供调用getter/setter方法, 访问私有变量, 调用私有方法, 获取泛型类型Class, 被AOP过的真实类等工具函数. + * + * @author Lion Li + */ +@SuppressWarnings("rawtypes") +@NoArgsConstructor(access = AccessLevel.PRIVATE) +public class ReflectUtils extends ReflectUtil { + + private static final String SETTER_PREFIX = "set"; + + private static final String GETTER_PREFIX = "get"; + + /** + * 调用Getter方法. + * 支持多级,如:对象名.对象名.方法 + */ + @SuppressWarnings("unchecked") + public static E invokeGetter(Object obj, String propertyName) { + Object object = obj; + for (String name : StringUtils.split(propertyName, ".")) { + String getterMethodName = GETTER_PREFIX + StringUtils.capitalize(name); + object = invoke(object, getterMethodName); + } + return (E) object; + } + + /** + * 调用Setter方法, 仅匹配方法名。 + * 支持多级,如:对象名.对象名.方法 + */ + public static void invokeSetter(Object obj, String propertyName, E value) { + Object object = obj; + String[] names = StringUtils.split(propertyName, "."); + for (int i = 0; i < names.length; i++) { + if (i < names.length - 1) { + String getterMethodName = GETTER_PREFIX + StringUtils.capitalize(names[i]); + object = invoke(object, getterMethodName); + } else { + String setterMethodName = SETTER_PREFIX + StringUtils.capitalize(names[i]); + Method method = getMethodByName(object.getClass(), setterMethodName); + invoke(object, method, value); + } + } + } + +} diff --git a/ruoyi-common/ruoyi-common-core/src/main/java/com/ruoyi/common/core/utils/regex/RegexUtils.java b/ruoyi-common/ruoyi-common-core/src/main/java/com/ruoyi/common/core/utils/regex/RegexUtils.java new file mode 100644 index 0000000..e35f024 --- /dev/null +++ b/ruoyi-common/ruoyi-common-core/src/main/java/com/ruoyi/common/core/utils/regex/RegexUtils.java @@ -0,0 +1,30 @@ +package com.ruoyi.common.core.utils.regex; + + +import cn.hutool.core.util.ReUtil; +import com.ruoyi.common.core.constant.RegexConstants; + +/** + * 正则相关工具类 + * + * @author Feng + */ +public final class RegexUtils extends ReUtil { + + /** + * 从输入字符串中提取匹配的部分,如果没有匹配则返回默认值 + * + * @param input 要提取的输入字符串 + * @param regex 用于匹配的正则表达式,可以使用 {@link RegexConstants} 中定义的常量 + * @param defaultInput 如果没有匹配时返回的默认值 + * @return 如果找到匹配的部分,则返回匹配的部分,否则返回默认值 + */ + public static String extractFromString(String input, String regex, String defaultInput) { + try { + return ReUtil.get(regex, input, 1); + } catch (Exception e) { + return defaultInput; + } + } + +} diff --git a/ruoyi-common/ruoyi-common-core/src/main/java/com/ruoyi/common/core/utils/regex/RegexValidator.java b/ruoyi-common/ruoyi-common-core/src/main/java/com/ruoyi/common/core/utils/regex/RegexValidator.java new file mode 100644 index 0000000..a20bc6c --- /dev/null +++ b/ruoyi-common/ruoyi-common-core/src/main/java/com/ruoyi/common/core/utils/regex/RegexValidator.java @@ -0,0 +1,105 @@ +package com.ruoyi.common.core.utils.regex; + +import cn.hutool.core.exceptions.ValidateException; +import cn.hutool.core.lang.Validator; +import com.ruoyi.common.core.factory.RegexPatternPoolFactory; + +import java.util.regex.Pattern; + +/** + * 正则字段校验器 + * 主要验证字段非空、是否为满足指定格式等 + * + * @author Feng + */ +public class RegexValidator extends Validator { + + /** + * 字典类型必须以字母开头,且只能为(小写字母,数字,下滑线) + */ + public static final Pattern DICTIONARY_TYPE = RegexPatternPoolFactory.DICTIONARY_TYPE; + + /** + * 身份证号码(后6位) + */ + public static final Pattern ID_CARD_LAST_6 = RegexPatternPoolFactory.ID_CARD_LAST_6; + + /** + * QQ号码 + */ + public static final Pattern QQ_NUMBER = RegexPatternPoolFactory.QQ_NUMBER; + + /** + * 邮政编码 + */ + public static final Pattern POSTAL_CODE = RegexPatternPoolFactory.POSTAL_CODE; + + /** + * 注册账号 + */ + public static final Pattern ACCOUNT = RegexPatternPoolFactory.ACCOUNT; + + /** + * 密码:包含至少8个字符,包括大写字母、小写字母、数字和特殊字符 + */ + public static final Pattern PASSWORD = RegexPatternPoolFactory.PASSWORD; + + /** + * 通用状态(0表示正常,1表示停用) + */ + public static final Pattern STATUS = RegexPatternPoolFactory.STATUS; + + + /** + * 检查输入的账号是否匹配预定义的规则 + * + * @param value 要验证的账号 + * @return 如果账号符合规则,返回 true;否则,返回 false。 + */ + public static boolean isAccount(CharSequence value) { + return isMatchRegex(ACCOUNT, value); + } + + /** + * 验证输入的账号是否符合规则,如果不符合,则抛出 ValidateException 异常 + * + * @param value 要验证的账号 + * @param errorMsg 验证失败时抛出的异常消息 + * @param CharSequence 的子类型 + * @return 如果验证通过,返回输入的账号 + * @throws ValidateException 如果验证失败 + */ + public static T validateAccount(T value, String errorMsg) throws ValidateException { + if (!isAccount(value)) { + throw new ValidateException(errorMsg); + } + return value; + } + + /** + * 检查输入的状态是否匹配预定义的规则 + * + * @param value 要验证的状态 + * @return 如果状态符合规则,返回 true;否则,返回 false。 + */ + public static boolean isStatus(CharSequence value) { + return isMatchRegex(STATUS, value); + } + + /** + * 验证输入的状态是否符合规则,如果不符合,则抛出 ValidateException 异常 + * + * @param value 要验证的状态 + * @param errorMsg 验证失败时抛出的异常消息 + * @param CharSequence 的子类型 + * @return 如果验证通过,返回输入的状态 + * @throws ValidateException 如果验证失败 + */ + public static T validateStatus(T value, String errorMsg) throws ValidateException { + if (!isStatus(value)) { + throw new ValidateException(errorMsg); + } + return value; + } + +} diff --git a/ruoyi-common/ruoyi-common-core/src/main/java/com/ruoyi/common/core/utils/sql/SqlUtil.java b/ruoyi-common/ruoyi-common-core/src/main/java/com/ruoyi/common/core/utils/sql/SqlUtil.java new file mode 100644 index 0000000..72cf56d --- /dev/null +++ b/ruoyi-common/ruoyi-common-core/src/main/java/com/ruoyi/common/core/utils/sql/SqlUtil.java @@ -0,0 +1,56 @@ +package com.ruoyi.common.core.utils.sql; + +import com.ruoyi.common.core.utils.StringUtils; +import lombok.AccessLevel; +import lombok.NoArgsConstructor; + +/** + * sql操作工具类 + * + * @author ruoyi + */ +@NoArgsConstructor(access = AccessLevel.PRIVATE) +public class SqlUtil { + + /** + * 定义常用的 sql关键字 + */ + public static final String SQL_REGEX = "select |insert |delete |update |drop |count |exec |chr |mid |master |truncate |char |and |declare "; + + /** + * 仅支持字母、数字、下划线、空格、逗号、小数点(支持多个字段排序) + */ + public static final String SQL_PATTERN = "[a-zA-Z0-9_\\ \\,\\.]+"; + + /** + * 检查字符,防止注入绕过 + */ + public static String escapeOrderBySql(String value) { + if (StringUtils.isNotEmpty(value) && !isValidOrderBySql(value)) { + throw new IllegalArgumentException("参数不符合规范,不能进行查询"); + } + return value; + } + + /** + * 验证 order by 语法是否符合规范 + */ + public static boolean isValidOrderBySql(String value) { + return value.matches(SQL_PATTERN); + } + + /** + * SQL关键字检查 + */ + public static void filterKeyword(String value) { + if (StringUtils.isEmpty(value)) { + return; + } + String[] sqlKeywords = StringUtils.split(SQL_REGEX, "\\|"); + for (String sqlKeyword : sqlKeywords) { + if (StringUtils.indexOfIgnoreCase(value, sqlKeyword) > -1) { + throw new IllegalArgumentException("参数存在SQL注入风险"); + } + } + } +} diff --git a/ruoyi-common/ruoyi-common-core/src/main/java/com/ruoyi/common/core/validate/AddGroup.java b/ruoyi-common/ruoyi-common-core/src/main/java/com/ruoyi/common/core/validate/AddGroup.java new file mode 100644 index 0000000..e1934e1 --- /dev/null +++ b/ruoyi-common/ruoyi-common-core/src/main/java/com/ruoyi/common/core/validate/AddGroup.java @@ -0,0 +1,9 @@ +package com.ruoyi.common.core.validate; + +/** + * 校验分组 add + * + * @author Lion Li + */ +public interface AddGroup { +} diff --git a/ruoyi-common/ruoyi-common-core/src/main/java/com/ruoyi/common/core/validate/EditGroup.java b/ruoyi-common/ruoyi-common-core/src/main/java/com/ruoyi/common/core/validate/EditGroup.java new file mode 100644 index 0000000..3c6ca7f --- /dev/null +++ b/ruoyi-common/ruoyi-common-core/src/main/java/com/ruoyi/common/core/validate/EditGroup.java @@ -0,0 +1,9 @@ +package com.ruoyi.common.core.validate; + +/** + * 校验分组 edit + * + * @author Lion Li + */ +public interface EditGroup { +} diff --git a/ruoyi-common/ruoyi-common-core/src/main/java/com/ruoyi/common/core/validate/QueryGroup.java b/ruoyi-common/ruoyi-common-core/src/main/java/com/ruoyi/common/core/validate/QueryGroup.java new file mode 100644 index 0000000..bbbfe03 --- /dev/null +++ b/ruoyi-common/ruoyi-common-core/src/main/java/com/ruoyi/common/core/validate/QueryGroup.java @@ -0,0 +1,9 @@ +package com.ruoyi.common.core.validate; + +/** + * 校验分组 query + * + * @author Lion Li + */ +public interface QueryGroup { +} diff --git a/ruoyi-common/ruoyi-common-core/src/main/java/com/ruoyi/common/core/xss/Xss.java b/ruoyi-common/ruoyi-common-core/src/main/java/com/ruoyi/common/core/xss/Xss.java new file mode 100644 index 0000000..ee72bdb --- /dev/null +++ b/ruoyi-common/ruoyi-common-core/src/main/java/com/ruoyi/common/core/xss/Xss.java @@ -0,0 +1,26 @@ +package com.ruoyi.common.core.xss; + +import jakarta.validation.Constraint; +import jakarta.validation.Payload; +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +/** + * 自定义xss校验注解 + * + * @author Lion Li + */ +@Retention(RetentionPolicy.RUNTIME) +@Target(value = {ElementType.METHOD, ElementType.FIELD, ElementType.CONSTRUCTOR, ElementType.PARAMETER}) +@Constraint(validatedBy = {XssValidator.class}) +public @interface Xss { + + String message() default "不允许任何脚本运行"; + + Class[] groups() default {}; + + Class[] payload() default {}; + +} diff --git a/ruoyi-common/ruoyi-common-core/src/main/java/com/ruoyi/common/core/xss/XssValidator.java b/ruoyi-common/ruoyi-common-core/src/main/java/com/ruoyi/common/core/xss/XssValidator.java new file mode 100644 index 0000000..c6b6c6b --- /dev/null +++ b/ruoyi-common/ruoyi-common-core/src/main/java/com/ruoyi/common/core/xss/XssValidator.java @@ -0,0 +1,21 @@ +package com.ruoyi.common.core.xss; + +import cn.hutool.core.util.ReUtil; +import cn.hutool.http.HtmlUtil; + +import jakarta.validation.ConstraintValidator; +import jakarta.validation.ConstraintValidatorContext; + +/** + * 自定义xss校验注解实现 + * + * @author Lion Li + */ +public class XssValidator implements ConstraintValidator { + + @Override + public boolean isValid(String value, ConstraintValidatorContext constraintValidatorContext) { + return !ReUtil.contains(HtmlUtil.RE_HTML_MARK, value); + } + +} diff --git a/ruoyi-common/ruoyi-common-core/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports b/ruoyi-common/ruoyi-common-core/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports new file mode 100644 index 0000000..3b13226 --- /dev/null +++ b/ruoyi-common/ruoyi-common-core/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports @@ -0,0 +1,6 @@ +com.ruoyi.common.core.config.ApplicationConfig +com.ruoyi.common.core.config.AsyncConfig +com.ruoyi.common.core.config.RuoYiConfig +com.ruoyi.common.core.config.ThreadPoolConfig +com.ruoyi.common.core.config.ValidatorConfig +com.ruoyi.common.core.utils.SpringUtils diff --git a/ruoyi-common/ruoyi-common-doc/pom.xml b/ruoyi-common/ruoyi-common-doc/pom.xml new file mode 100644 index 0000000..62da586 --- /dev/null +++ b/ruoyi-common/ruoyi-common-doc/pom.xml @@ -0,0 +1,41 @@ + + + + com.ruoyi + ruoyi-common + ${revision} + + 4.0.0 + + ruoyi-common-doc + + + ruoyi-common-doc 系统接口 + + + + + com.ruoyi + ruoyi-common-core + + + + org.springdoc + springdoc-openapi-starter-webmvc-api + + + + com.github.therapi + therapi-runtime-javadoc + + + + com.fasterxml.jackson.module + jackson-module-kotlin + + + + + diff --git a/ruoyi-common/ruoyi-common-doc/src/main/java/com/ruoyi/common/doc/config/SpringDocConfig.java b/ruoyi-common/ruoyi-common-doc/src/main/java/com/ruoyi/common/doc/config/SpringDocConfig.java new file mode 100644 index 0000000..53ce30c --- /dev/null +++ b/ruoyi-common/ruoyi-common-doc/src/main/java/com/ruoyi/common/doc/config/SpringDocConfig.java @@ -0,0 +1,126 @@ +package com.ruoyi.common.doc.config; + +import io.swagger.v3.oas.models.OpenAPI; +import io.swagger.v3.oas.models.Paths; +import io.swagger.v3.oas.models.info.Info; +import io.swagger.v3.oas.models.security.SecurityRequirement; +import lombok.RequiredArgsConstructor; +import com.ruoyi.common.core.utils.StringUtils; +import com.ruoyi.common.doc.config.properties.SpringDocProperties; +import com.ruoyi.common.doc.handler.OpenApiHandler; +import org.springdoc.core.configuration.SpringDocConfiguration; +import org.springdoc.core.customizers.OpenApiBuilderCustomizer; +import org.springdoc.core.customizers.OpenApiCustomizer; +import org.springdoc.core.customizers.ServerBaseUrlCustomizer; +import org.springdoc.core.properties.SpringDocConfigProperties; +import org.springdoc.core.providers.JavadocProvider; +import org.springdoc.core.service.OpenAPIService; +import org.springdoc.core.service.SecurityService; +import org.springdoc.core.utils.PropertyResolverUtils; +import org.springframework.boot.autoconfigure.AutoConfiguration; +import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; +import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; +import org.springframework.boot.autoconfigure.web.ServerProperties; +import org.springframework.boot.context.properties.EnableConfigurationProperties; +import org.springframework.context.annotation.Bean; + +import java.util.ArrayList; +import java.util.List; +import java.util.Optional; +import java.util.Set; + +/** + * Swagger 文档配置 + * + * @author Lion Li + */ +@RequiredArgsConstructor +@AutoConfiguration(before = SpringDocConfiguration.class) +@EnableConfigurationProperties(SpringDocProperties.class) +@ConditionalOnProperty(name = "springdoc.api-docs.enabled", havingValue = "true", matchIfMissing = true) +public class SpringDocConfig { + + private final ServerProperties serverProperties; + + @Bean + @ConditionalOnMissingBean(OpenAPI.class) + public OpenAPI openApi(SpringDocProperties properties) { + OpenAPI openApi = new OpenAPI(); + // 文档基本信息 + SpringDocProperties.InfoProperties infoProperties = properties.getInfo(); + Info info = convertInfo(infoProperties); + openApi.info(info); + // 扩展文档信息 + openApi.externalDocs(properties.getExternalDocs()); + openApi.tags(properties.getTags()); + openApi.paths(properties.getPaths()); + openApi.components(properties.getComponents()); + Set keySet = properties.getComponents().getSecuritySchemes().keySet(); + List list = new ArrayList<>(); + SecurityRequirement securityRequirement = new SecurityRequirement(); + keySet.forEach(securityRequirement::addList); + list.add(securityRequirement); + openApi.security(list); + + return openApi; + } + + private Info convertInfo(SpringDocProperties.InfoProperties infoProperties) { + Info info = new Info(); + info.setTitle(infoProperties.getTitle()); + info.setDescription(infoProperties.getDescription()); + info.setContact(infoProperties.getContact()); + info.setLicense(infoProperties.getLicense()); + info.setVersion(infoProperties.getVersion()); + return info; + } + + /** + * 自定义 openapi 处理器 + */ + @Bean + public OpenAPIService openApiBuilder(Optional openAPI, + SecurityService securityParser, + SpringDocConfigProperties springDocConfigProperties, PropertyResolverUtils propertyResolverUtils, + Optional> openApiBuilderCustomisers, + Optional> serverBaseUrlCustomisers, Optional javadocProvider) { + return new OpenApiHandler(openAPI, securityParser, springDocConfigProperties, propertyResolverUtils, openApiBuilderCustomisers, serverBaseUrlCustomisers, javadocProvider); + } + + /** + * 对已经生成好的 OpenApi 进行自定义操作 + */ + @Bean + public OpenApiCustomizer openApiCustomizer() { + String contextPath = serverProperties.getServlet().getContextPath(); + String finalContextPath; + if (StringUtils.isBlank(contextPath) || "/".equals(contextPath)) { + finalContextPath = ""; + } else { + finalContextPath = contextPath; + } + // 对所有路径增加前置上下文路径 + return openApi -> { + Paths oldPaths = openApi.getPaths(); + if (oldPaths instanceof PlusPaths) { + return; + } + PlusPaths newPaths = new PlusPaths(); + oldPaths.forEach((k, v) -> newPaths.addPathItem(finalContextPath + k, v)); + openApi.setPaths(newPaths); + }; + } + + /** + * 单独使用一个类便于判断 解决springdoc路径拼接重复问题 + * + * @author Lion Li + */ + static class PlusPaths extends Paths { + + public PlusPaths() { + super(); + } + } + +} diff --git a/ruoyi-common/ruoyi-common-doc/src/main/java/com/ruoyi/common/doc/config/properties/SpringDocProperties.java b/ruoyi-common/ruoyi-common-doc/src/main/java/com/ruoyi/common/doc/config/properties/SpringDocProperties.java new file mode 100644 index 0000000..1a40cd9 --- /dev/null +++ b/ruoyi-common/ruoyi-common-doc/src/main/java/com/ruoyi/common/doc/config/properties/SpringDocProperties.java @@ -0,0 +1,94 @@ +package com.ruoyi.common.doc.config.properties; + +import io.swagger.v3.oas.models.Components; +import io.swagger.v3.oas.models.ExternalDocumentation; +import io.swagger.v3.oas.models.Paths; +import io.swagger.v3.oas.models.info.Contact; +import io.swagger.v3.oas.models.info.License; +import io.swagger.v3.oas.models.tags.Tag; +import lombok.Data; +import org.springframework.boot.context.properties.ConfigurationProperties; +import org.springframework.boot.context.properties.NestedConfigurationProperty; + +import java.util.List; + +/** + * swagger 配置属性 + * + * @author Lion Li + */ +@Data +@ConfigurationProperties(prefix = "springdoc") +public class SpringDocProperties { + + /** + * 文档基本信息 + */ + @NestedConfigurationProperty + private InfoProperties info = new InfoProperties(); + + /** + * 扩展文档地址 + */ + @NestedConfigurationProperty + private ExternalDocumentation externalDocs; + + /** + * 标签 + */ + private List tags = null; + + /** + * 路径 + */ + @NestedConfigurationProperty + private Paths paths = null; + + /** + * 组件 + */ + @NestedConfigurationProperty + private Components components = null; + + /** + *

+ * 文档的基础属性信息 + *

+ * + * @see io.swagger.v3.oas.models.info.Info + * + * 为了 springboot 自动生产配置提示信息,所以这里复制一个类出来 + */ + @Data + public static class InfoProperties { + + /** + * 标题 + */ + private String title = null; + + /** + * 描述 + */ + private String description = null; + + /** + * 联系人信息 + */ + @NestedConfigurationProperty + private Contact contact = null; + + /** + * 许可证 + */ + @NestedConfigurationProperty + private License license = null; + + /** + * 版本 + */ + private String version = null; + + } + +} diff --git a/ruoyi-common/ruoyi-common-doc/src/main/java/com/ruoyi/common/doc/handler/OpenApiHandler.java b/ruoyi-common/ruoyi-common-doc/src/main/java/com/ruoyi/common/doc/handler/OpenApiHandler.java new file mode 100644 index 0000000..7894bf1 --- /dev/null +++ b/ruoyi-common/ruoyi-common-doc/src/main/java/com/ruoyi/common/doc/handler/OpenApiHandler.java @@ -0,0 +1,252 @@ +package com.ruoyi.common.doc.handler; + +import cn.hutool.core.io.IoUtil; +import io.swagger.v3.core.jackson.TypeNameResolver; +import io.swagger.v3.core.util.AnnotationsUtils; +import io.swagger.v3.oas.annotations.tags.Tags; +import io.swagger.v3.oas.models.Components; +import io.swagger.v3.oas.models.OpenAPI; +import io.swagger.v3.oas.models.Operation; +import io.swagger.v3.oas.models.Paths; +import io.swagger.v3.oas.models.tags.Tag; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.lang3.StringUtils; +import org.springdoc.core.customizers.OpenApiBuilderCustomizer; +import org.springdoc.core.customizers.ServerBaseUrlCustomizer; +import org.springdoc.core.properties.SpringDocConfigProperties; +import org.springdoc.core.providers.JavadocProvider; +import org.springdoc.core.service.OpenAPIService; +import org.springdoc.core.service.SecurityService; +import org.springdoc.core.utils.PropertyResolverUtils; +import org.springframework.context.ApplicationContext; +import org.springframework.core.annotation.AnnotatedElementUtils; +import org.springframework.util.CollectionUtils; +import org.springframework.web.method.HandlerMethod; + +import java.io.StringReader; +import java.lang.reflect.Method; +import java.util.*; +import java.util.stream.Collectors; +import java.util.stream.Stream; + +/** + * 自定义 openapi 处理器 + * 对源码功能进行修改 增强使用 + */ +@Slf4j +@SuppressWarnings("all") +public class OpenApiHandler extends OpenAPIService { + + /** + * The Basic error controller. + */ + private static Class basicErrorController; + + /** + * The Security parser. + */ + private final SecurityService securityParser; + + /** + * The Mappings map. + */ + private final Map mappingsMap = new HashMap<>(); + + /** + * The Springdoc tags. + */ + private final Map springdocTags = new HashMap<>(); + + /** + * The Open api builder customisers. + */ + private final Optional> openApiBuilderCustomisers; + + /** + * The server base URL customisers. + */ + private final Optional> serverBaseUrlCustomizers; + + /** + * The Spring doc config properties. + */ + private final SpringDocConfigProperties springDocConfigProperties; + + /** + * The Cached open api map. + */ + private final Map cachedOpenAPI = new HashMap<>(); + + /** + * The Property resolver utils. + */ + private final PropertyResolverUtils propertyResolverUtils; + + /** + * The javadoc provider. + */ + private final Optional javadocProvider; + + /** + * The Context. + */ + private ApplicationContext context; + + /** + * The Open api. + */ + private OpenAPI openAPI; + + /** + * The Is servers present. + */ + private boolean isServersPresent; + + /** + * The Server base url. + */ + private String serverBaseUrl; + + /** + * Instantiates a new Open api builder. + * + * @param openAPI the open api + * @param securityParser the security parser + * @param springDocConfigProperties the spring doc config properties + * @param propertyResolverUtils the property resolver utils + * @param openApiBuilderCustomizers the open api builder customisers + * @param serverBaseUrlCustomizers the server base url customizers + * @param javadocProvider the javadoc provider + */ + public OpenApiHandler(Optional openAPI, SecurityService securityParser, + SpringDocConfigProperties springDocConfigProperties, PropertyResolverUtils propertyResolverUtils, + Optional> openApiBuilderCustomizers, + Optional> serverBaseUrlCustomizers, + Optional javadocProvider) { + super(openAPI, securityParser, springDocConfigProperties, propertyResolverUtils, openApiBuilderCustomizers, serverBaseUrlCustomizers, javadocProvider); + if (openAPI.isPresent()) { + this.openAPI = openAPI.get(); + if (this.openAPI.getComponents() == null) + this.openAPI.setComponents(new Components()); + if (this.openAPI.getPaths() == null) + this.openAPI.setPaths(new Paths()); + if (!CollectionUtils.isEmpty(this.openAPI.getServers())) + this.isServersPresent = true; + } + this.propertyResolverUtils = propertyResolverUtils; + this.securityParser = securityParser; + this.springDocConfigProperties = springDocConfigProperties; + this.openApiBuilderCustomisers = openApiBuilderCustomizers; + this.serverBaseUrlCustomizers = serverBaseUrlCustomizers; + this.javadocProvider = javadocProvider; + if (springDocConfigProperties.isUseFqn()) + TypeNameResolver.std.setUseFqn(true); + } + + @Override + public Operation buildTags(HandlerMethod handlerMethod, Operation operation, OpenAPI openAPI, Locale locale) { + + Set tags = new HashSet<>(); + Set tagsStr = new HashSet<>(); + + buildTagsFromMethod(handlerMethod.getMethod(), tags, tagsStr, locale); + buildTagsFromClass(handlerMethod.getBeanType(), tags, tagsStr, locale); + + if (!CollectionUtils.isEmpty(tagsStr)) + tagsStr = tagsStr.stream() + .map(str -> propertyResolverUtils.resolve(str, locale)) + .collect(Collectors.toSet()); + + if (springdocTags.containsKey(handlerMethod)) { + io.swagger.v3.oas.models.tags.Tag tag = springdocTags.get(handlerMethod); + tagsStr.add(tag.getName()); + if (openAPI.getTags() == null || !openAPI.getTags().contains(tag)) { + openAPI.addTagsItem(tag); + } + } + + if (!CollectionUtils.isEmpty(tagsStr)) { + if (CollectionUtils.isEmpty(operation.getTags())) + operation.setTags(new ArrayList<>(tagsStr)); + else { + Set operationTagsSet = new HashSet<>(operation.getTags()); + operationTagsSet.addAll(tagsStr); + operation.getTags().clear(); + operation.getTags().addAll(operationTagsSet); + } + } + + if (isAutoTagClasses(operation)) { + + + if (javadocProvider.isPresent()) { + String description = javadocProvider.get().getClassJavadoc(handlerMethod.getBeanType()); + if (StringUtils.isNotBlank(description)) { + io.swagger.v3.oas.models.tags.Tag tag = new io.swagger.v3.oas.models.tags.Tag(); + + // 自定义部分 修改使用java注释当tag名 + List list = IoUtil.readLines(new StringReader(description), new ArrayList<>()); + // tag.setName(tagAutoName); + tag.setName(list.get(0)); + operation.addTagsItem(list.get(0)); + + tag.setDescription(description); + if (openAPI.getTags() == null || !openAPI.getTags().contains(tag)) { + openAPI.addTagsItem(tag); + } + } + } else { + String tagAutoName = splitCamelCase(handlerMethod.getBeanType().getSimpleName()); + operation.addTagsItem(tagAutoName); + } + } + + if (!CollectionUtils.isEmpty(tags)) { + // Existing tags + List openApiTags = openAPI.getTags(); + if (!CollectionUtils.isEmpty(openApiTags)) + tags.addAll(openApiTags); + openAPI.setTags(new ArrayList<>(tags)); + } + + // Handle SecurityRequirement at operation level + io.swagger.v3.oas.annotations.security.SecurityRequirement[] securityRequirements = securityParser + .getSecurityRequirements(handlerMethod); + if (securityRequirements != null) { + if (securityRequirements.length == 0) + operation.setSecurity(Collections.emptyList()); + else + securityParser.buildSecurityRequirement(securityRequirements, operation); + } + + return operation; + } + + private void buildTagsFromMethod(Method method, Set tags, Set tagsStr, Locale locale) { + // method tags + Set tagsSet = AnnotatedElementUtils + .findAllMergedAnnotations(method, Tags.class); + Set methodTags = tagsSet.stream() + .flatMap(x -> Stream.of(x.value())).collect(Collectors.toSet()); + methodTags.addAll(AnnotatedElementUtils.findAllMergedAnnotations(method, io.swagger.v3.oas.annotations.tags.Tag.class)); + if (!CollectionUtils.isEmpty(methodTags)) { + tagsStr.addAll(methodTags.stream().map(tag -> propertyResolverUtils.resolve(tag.name(), locale)).collect(Collectors.toSet())); + List allTags = new ArrayList<>(methodTags); + addTags(allTags, tags, locale); + } + } + + private void addTags(List sourceTags, Set tags, Locale locale) { + Optional> optionalTagSet = AnnotationsUtils + .getTags(sourceTags.toArray(new io.swagger.v3.oas.annotations.tags.Tag[0]), true); + optionalTagSet.ifPresent(tagsSet -> { + tagsSet.forEach(tag -> { + tag.name(propertyResolverUtils.resolve(tag.getName(), locale)); + tag.description(propertyResolverUtils.resolve(tag.getDescription(), locale)); + if (tags.stream().noneMatch(t -> t.getName().equals(tag.getName()))) + tags.add(tag); + }); + }); + } + +} diff --git a/ruoyi-common/ruoyi-common-doc/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports b/ruoyi-common/ruoyi-common-doc/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports new file mode 100644 index 0000000..c7876aa --- /dev/null +++ b/ruoyi-common/ruoyi-common-doc/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports @@ -0,0 +1 @@ +com.ruoyi.common.doc.config.SpringDocConfig diff --git a/ruoyi-common/ruoyi-common-encrypt/pom.xml b/ruoyi-common/ruoyi-common-encrypt/pom.xml new file mode 100644 index 0000000..270ebf3 --- /dev/null +++ b/ruoyi-common/ruoyi-common-encrypt/pom.xml @@ -0,0 +1,54 @@ + + + + com.ruoyi + ruoyi-common + ${revision} + + 4.0.0 + + ruoyi-common-encrypt + + + ruoyi-common-encrypt 数据加解密模块 + + + + + + com.ruoyi + ruoyi-common-core + + + + org.bouncycastle + bcprov-jdk15to18 + + + + cn.hutool + hutool-crypto + + + + org.springframework + spring-webmvc + + + + com.baomidou + mybatis-plus-spring-boot3-starter + true + + + org.mybatis + mybatis-spring + + + + + + + diff --git a/ruoyi-common/ruoyi-common-encrypt/src/main/java/com/ruoyi/common/encrypt/annotation/ApiEncrypt.java b/ruoyi-common/ruoyi-common-encrypt/src/main/java/com/ruoyi/common/encrypt/annotation/ApiEncrypt.java new file mode 100644 index 0000000..d646a93 --- /dev/null +++ b/ruoyi-common/ruoyi-common-encrypt/src/main/java/com/ruoyi/common/encrypt/annotation/ApiEncrypt.java @@ -0,0 +1,20 @@ +package com.ruoyi.common.encrypt.annotation; + +import java.lang.annotation.*; + +/** + * 强制加密注解 + * + * @author Michelle.Chung + */ +@Documented +@Target({ElementType.METHOD}) +@Retention(RetentionPolicy.RUNTIME) +public @interface ApiEncrypt { + + /** + * 响应加密忽略,默认不加密,为 true 时加密 + */ + boolean response() default false; + +} diff --git a/ruoyi-common/ruoyi-common-encrypt/src/main/java/com/ruoyi/common/encrypt/annotation/EncryptField.java b/ruoyi-common/ruoyi-common-encrypt/src/main/java/com/ruoyi/common/encrypt/annotation/EncryptField.java new file mode 100644 index 0000000..0596bae --- /dev/null +++ b/ruoyi-common/ruoyi-common-encrypt/src/main/java/com/ruoyi/common/encrypt/annotation/EncryptField.java @@ -0,0 +1,44 @@ +package com.ruoyi.common.encrypt.annotation; + +import com.ruoyi.common.encrypt.enumd.AlgorithmType; +import com.ruoyi.common.encrypt.enumd.EncodeType; + +import java.lang.annotation.*; + +/** + * 字段加密注解 + * + * @author 老马 + */ +@Documented +@Inherited +@Target({ElementType.FIELD}) +@Retention(RetentionPolicy.RUNTIME) +public @interface EncryptField { + + /** + * 加密算法 + */ + AlgorithmType algorithm() default AlgorithmType.DEFAULT; + + /** + * 秘钥。AES、SM4需要 + */ + String password() default ""; + + /** + * 公钥。RSA、SM2需要 + */ + String publicKey() default ""; + + /** + * 私钥。RSA、SM2需要 + */ + String privateKey() default ""; + + /** + * 编码方式。对加密算法为BASE64的不起作用 + */ + EncodeType encode() default EncodeType.DEFAULT; + +} diff --git a/ruoyi-common/ruoyi-common-encrypt/src/main/java/com/ruoyi/common/encrypt/config/ApiDecryptAutoConfiguration.java b/ruoyi-common/ruoyi-common-encrypt/src/main/java/com/ruoyi/common/encrypt/config/ApiDecryptAutoConfiguration.java new file mode 100644 index 0000000..dbcc83d --- /dev/null +++ b/ruoyi-common/ruoyi-common-encrypt/src/main/java/com/ruoyi/common/encrypt/config/ApiDecryptAutoConfiguration.java @@ -0,0 +1,32 @@ +package com.ruoyi.common.encrypt.config; + +import jakarta.servlet.DispatcherType; +import com.ruoyi.common.encrypt.filter.CryptoFilter; +import com.ruoyi.common.encrypt.properties.ApiDecryptProperties; +import org.springframework.boot.autoconfigure.AutoConfiguration; +import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; +import org.springframework.boot.context.properties.EnableConfigurationProperties; +import org.springframework.boot.web.servlet.FilterRegistrationBean; +import org.springframework.context.annotation.Bean; + +/** + * api 解密自动配置 + * + * @author wdhcr + */ +@AutoConfiguration +@EnableConfigurationProperties(ApiDecryptProperties.class) +@ConditionalOnProperty(value = "api-decrypt.enabled", havingValue = "true") +public class ApiDecryptAutoConfiguration { + + @Bean + public FilterRegistrationBean cryptoFilterRegistration(ApiDecryptProperties properties) { + FilterRegistrationBean registration = new FilterRegistrationBean<>(); + registration.setDispatcherTypes(DispatcherType.REQUEST); + registration.setFilter(new CryptoFilter(properties)); + registration.addUrlPatterns("/*"); + registration.setName("cryptoFilter"); + registration.setOrder(FilterRegistrationBean.HIGHEST_PRECEDENCE); + return registration; + } +} diff --git a/ruoyi-common/ruoyi-common-encrypt/src/main/java/com/ruoyi/common/encrypt/config/EncryptorAutoConfiguration.java b/ruoyi-common/ruoyi-common-encrypt/src/main/java/com/ruoyi/common/encrypt/config/EncryptorAutoConfiguration.java new file mode 100644 index 0000000..9d5b791 --- /dev/null +++ b/ruoyi-common/ruoyi-common-encrypt/src/main/java/com/ruoyi/common/encrypt/config/EncryptorAutoConfiguration.java @@ -0,0 +1,49 @@ +package com.ruoyi.common.encrypt.config; + +import com.baomidou.mybatisplus.autoconfigure.MybatisPlusAutoConfiguration; +import com.baomidou.mybatisplus.autoconfigure.MybatisPlusProperties; +import lombok.extern.slf4j.Slf4j; +import com.ruoyi.common.encrypt.core.EncryptorManager; +import com.ruoyi.common.encrypt.interceptor.MybatisDecryptInterceptor; +import com.ruoyi.common.encrypt.interceptor.MybatisEncryptInterceptor; +import com.ruoyi.common.encrypt.properties.EncryptorProperties; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.boot.autoconfigure.AutoConfiguration; +import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; +import org.springframework.boot.context.properties.EnableConfigurationProperties; +import org.springframework.context.annotation.Bean; + +/** + * 加解密配置 + * + * @author 老马 + * @version 4.6.0 + */ +@AutoConfiguration(after = MybatisPlusAutoConfiguration.class) +@EnableConfigurationProperties(EncryptorProperties.class) +@ConditionalOnProperty(value = "mybatis-encryptor.enable", havingValue = "true") +@Slf4j +public class EncryptorAutoConfiguration { + + @Autowired + private EncryptorProperties properties; + + @Bean + public EncryptorManager encryptorManager(MybatisPlusProperties mybatisPlusProperties) { + return new EncryptorManager(mybatisPlusProperties.getTypeAliasesPackage()); + } + + @Bean + public MybatisEncryptInterceptor mybatisEncryptInterceptor(EncryptorManager encryptorManager) { + return new MybatisEncryptInterceptor(encryptorManager, properties); + } + + @Bean + public MybatisDecryptInterceptor mybatisDecryptInterceptor(EncryptorManager encryptorManager) { + return new MybatisDecryptInterceptor(encryptorManager, properties); + } + +} + + + diff --git a/ruoyi-common/ruoyi-common-encrypt/src/main/java/com/ruoyi/common/encrypt/core/EncryptContext.java b/ruoyi-common/ruoyi-common-encrypt/src/main/java/com/ruoyi/common/encrypt/core/EncryptContext.java new file mode 100644 index 0000000..ff38254 --- /dev/null +++ b/ruoyi-common/ruoyi-common-encrypt/src/main/java/com/ruoyi/common/encrypt/core/EncryptContext.java @@ -0,0 +1,41 @@ +package com.ruoyi.common.encrypt.core; + +import com.ruoyi.common.encrypt.enumd.AlgorithmType; +import com.ruoyi.common.encrypt.enumd.EncodeType; +import lombok.Data; + +/** + * 加密上下文 用于encryptor传递必要的参数。 + * + * @author 老马 + * @version 4.6.0 + */ +@Data +public class EncryptContext { + + /** + * 默认算法 + */ + private AlgorithmType algorithm; + + /** + * 安全秘钥 + */ + private String password; + + /** + * 公钥 + */ + private String publicKey; + + /** + * 私钥 + */ + private String privateKey; + + /** + * 编码方式,base64/hex + */ + private EncodeType encode; + +} diff --git a/ruoyi-common/ruoyi-common-encrypt/src/main/java/com/ruoyi/common/encrypt/core/EncryptorManager.java b/ruoyi-common/ruoyi-common-encrypt/src/main/java/com/ruoyi/common/encrypt/core/EncryptorManager.java new file mode 100644 index 0000000..ad77c11 --- /dev/null +++ b/ruoyi-common/ruoyi-common-encrypt/src/main/java/com/ruoyi/common/encrypt/core/EncryptorManager.java @@ -0,0 +1,158 @@ +package com.ruoyi.common.encrypt.core; + +import cn.hutool.core.collection.CollUtil; +import cn.hutool.core.util.ObjectUtil; +import cn.hutool.core.util.ReflectUtil; +import lombok.NoArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.apache.ibatis.io.Resources; +import com.ruoyi.common.core.utils.StringUtils; +import com.ruoyi.common.encrypt.annotation.EncryptField; +import org.springframework.context.ConfigurableApplicationContext; +import org.springframework.core.io.Resource; +import org.springframework.core.io.support.PathMatchingResourcePatternResolver; +import org.springframework.core.io.support.ResourcePatternResolver; +import org.springframework.core.type.ClassMetadata; +import org.springframework.core.type.classreading.CachingMetadataReaderFactory; +import org.springframework.util.ClassUtils; + +import java.lang.reflect.Field; +import java.util.*; +import java.util.concurrent.ConcurrentHashMap; +import java.util.stream.Collectors; + +/** + * 加密管理类 + * + * @author 老马 + * @version 4.6.0 + */ +@Slf4j +@NoArgsConstructor +public class EncryptorManager { + + /** + * 缓存加密器 + */ + Map encryptorMap = new ConcurrentHashMap<>(); + + /** + * 类加密字段缓存 + */ + Map, Set> fieldCache = new ConcurrentHashMap<>(); + + /** + * 构造方法传入类加密字段缓存 + * + * @param typeAliasesPackage 实体类包 + */ + public EncryptorManager(String typeAliasesPackage) { + scanEncryptClasses(typeAliasesPackage); + } + + + /** + * 获取类加密字段缓存 + */ + public Set getFieldCache(Class sourceClazz) { + if (ObjectUtil.isNotNull(fieldCache)) { + return fieldCache.get(sourceClazz); + } + return null; + } + + /** + * 注册加密执行者到缓存 + * + * @param encryptContext 加密执行者需要的相关配置参数 + */ + public IEncryptor registAndGetEncryptor(EncryptContext encryptContext) { + if (encryptorMap.containsKey(encryptContext)) { + return encryptorMap.get(encryptContext); + } + IEncryptor encryptor = ReflectUtil.newInstance(encryptContext.getAlgorithm().getClazz(), encryptContext); + encryptorMap.put(encryptContext, encryptor); + return encryptor; + } + + /** + * 移除缓存中的加密执行者 + * + * @param encryptContext 加密执行者需要的相关配置参数 + */ + public void removeEncryptor(EncryptContext encryptContext) { + this.encryptorMap.remove(encryptContext); + } + + /** + * 根据配置进行加密。会进行本地缓存对应的算法和对应的秘钥信息。 + * + * @param value 待加密的值 + * @param encryptContext 加密相关的配置信息 + */ + public String encrypt(String value, EncryptContext encryptContext) { + IEncryptor encryptor = this.registAndGetEncryptor(encryptContext); + return encryptor.encrypt(value, encryptContext.getEncode()); + } + + /** + * 根据配置进行解密 + * + * @param value 待解密的值 + * @param encryptContext 加密相关的配置信息 + */ + public String decrypt(String value, EncryptContext encryptContext) { + IEncryptor encryptor = this.registAndGetEncryptor(encryptContext); + return encryptor.decrypt(value); + } + + /** + * 通过 typeAliasesPackage 设置的扫描包 扫描缓存实体 + */ + private void scanEncryptClasses(String typeAliasesPackage) { + PathMatchingResourcePatternResolver resolver = new PathMatchingResourcePatternResolver(); + CachingMetadataReaderFactory factory = new CachingMetadataReaderFactory(); + String[] packagePatternArray = StringUtils.splitPreserveAllTokens(typeAliasesPackage, ConfigurableApplicationContext.CONFIG_LOCATION_DELIMITERS); + String classpath = ResourcePatternResolver.CLASSPATH_ALL_URL_PREFIX; + try { + for (String packagePattern : packagePatternArray) { + String path = ClassUtils.convertClassNameToResourcePath(packagePattern); + Resource[] resources = resolver.getResources(classpath + path + "/*.class"); + for (Resource resource : resources) { + ClassMetadata classMetadata = factory.getMetadataReader(resource).getClassMetadata(); + Class clazz = Resources.classForName(classMetadata.getClassName()); + Set encryptFieldSet = getEncryptFieldSetFromClazz(clazz); + if (CollUtil.isNotEmpty(encryptFieldSet)) { + fieldCache.put(clazz, encryptFieldSet); + } + } + } + } catch (Exception e) { + log.error("初始化数据安全缓存时出错:{}", e.getMessage()); + } + } + + /** + * 获得一个类的加密字段集合 + */ + private Set getEncryptFieldSetFromClazz(Class clazz) { + Set fieldSet = new HashSet<>(); + // 判断clazz如果是接口,内部类,匿名类就直接返回 + if (clazz.isInterface() || clazz.isMemberClass() || clazz.isAnonymousClass()) { + return fieldSet; + } + while (clazz != null) { + Field[] fields = clazz.getDeclaredFields(); + fieldSet.addAll(Arrays.asList(fields)); + clazz = clazz.getSuperclass(); + } + fieldSet = fieldSet.stream().filter(field -> + field.isAnnotationPresent(EncryptField.class) && field.getType() == String.class) + .collect(Collectors.toSet()); + for (Field field : fieldSet) { + field.setAccessible(true); + } + return fieldSet; + } + +} diff --git a/ruoyi-common/ruoyi-common-encrypt/src/main/java/com/ruoyi/common/encrypt/core/IEncryptor.java b/ruoyi-common/ruoyi-common-encrypt/src/main/java/com/ruoyi/common/encrypt/core/IEncryptor.java new file mode 100644 index 0000000..d9642c0 --- /dev/null +++ b/ruoyi-common/ruoyi-common-encrypt/src/main/java/com/ruoyi/common/encrypt/core/IEncryptor.java @@ -0,0 +1,35 @@ +package com.ruoyi.common.encrypt.core; + +import com.ruoyi.common.encrypt.enumd.AlgorithmType; +import com.ruoyi.common.encrypt.enumd.EncodeType; + +/** + * 加解者 + * + * @author 老马 + * @version 4.6.0 + */ +public interface IEncryptor { + + /** + * 获得当前算法 + */ + AlgorithmType algorithm(); + + /** + * 加密 + * + * @param value 待加密字符串 + * @param encodeType 加密后的编码格式 + * @return 加密后的字符串 + */ + String encrypt(String value, EncodeType encodeType); + + /** + * 解密 + * + * @param value 待加密字符串 + * @return 解密后的字符串 + */ + String decrypt(String value); +} diff --git a/ruoyi-common/ruoyi-common-encrypt/src/main/java/com/ruoyi/common/encrypt/core/encryptor/AbstractEncryptor.java b/ruoyi-common/ruoyi-common-encrypt/src/main/java/com/ruoyi/common/encrypt/core/encryptor/AbstractEncryptor.java new file mode 100644 index 0000000..b068ce7 --- /dev/null +++ b/ruoyi-common/ruoyi-common-encrypt/src/main/java/com/ruoyi/common/encrypt/core/encryptor/AbstractEncryptor.java @@ -0,0 +1,18 @@ +package com.ruoyi.common.encrypt.core.encryptor; + +import com.ruoyi.common.encrypt.core.EncryptContext; +import com.ruoyi.common.encrypt.core.IEncryptor; + +/** + * 所有加密执行者的基类 + * + * @author 老马 + * @version 4.6.0 + */ +public abstract class AbstractEncryptor implements IEncryptor { + + public AbstractEncryptor(EncryptContext context) { + // 用户配置校验与配置注入 + } + +} diff --git a/ruoyi-common/ruoyi-common-encrypt/src/main/java/com/ruoyi/common/encrypt/core/encryptor/AesEncryptor.java b/ruoyi-common/ruoyi-common-encrypt/src/main/java/com/ruoyi/common/encrypt/core/encryptor/AesEncryptor.java new file mode 100644 index 0000000..2491efb --- /dev/null +++ b/ruoyi-common/ruoyi-common-encrypt/src/main/java/com/ruoyi/common/encrypt/core/encryptor/AesEncryptor.java @@ -0,0 +1,55 @@ +package com.ruoyi.common.encrypt.core.encryptor; + +import com.ruoyi.common.encrypt.core.EncryptContext; +import com.ruoyi.common.encrypt.enumd.AlgorithmType; +import com.ruoyi.common.encrypt.enumd.EncodeType; +import com.ruoyi.common.encrypt.utils.EncryptUtils; + +/** + * AES算法实现 + * + * @author 老马 + * @version 4.6.0 + */ +public class AesEncryptor extends AbstractEncryptor { + + private final EncryptContext context; + + public AesEncryptor(EncryptContext context) { + super(context); + this.context = context; + } + + /** + * 获得当前算法 + */ + @Override + public AlgorithmType algorithm() { + return AlgorithmType.AES; + } + + /** + * 加密 + * + * @param value 待加密字符串 + * @param encodeType 加密后的编码格式 + */ + @Override + public String encrypt(String value, EncodeType encodeType) { + if (encodeType == EncodeType.HEX) { + return EncryptUtils.encryptByAesHex(value, context.getPassword()); + } else { + return EncryptUtils.encryptByAes(value, context.getPassword()); + } + } + + /** + * 解密 + * + * @param value 待加密字符串 + */ + @Override + public String decrypt(String value) { + return EncryptUtils.decryptByAes(value, context.getPassword()); + } +} diff --git a/ruoyi-common/ruoyi-common-encrypt/src/main/java/com/ruoyi/common/encrypt/core/encryptor/Base64Encryptor.java b/ruoyi-common/ruoyi-common-encrypt/src/main/java/com/ruoyi/common/encrypt/core/encryptor/Base64Encryptor.java new file mode 100644 index 0000000..abc3dcb --- /dev/null +++ b/ruoyi-common/ruoyi-common-encrypt/src/main/java/com/ruoyi/common/encrypt/core/encryptor/Base64Encryptor.java @@ -0,0 +1,48 @@ +package com.ruoyi.common.encrypt.core.encryptor; + +import com.ruoyi.common.encrypt.core.EncryptContext; +import com.ruoyi.common.encrypt.enumd.AlgorithmType; +import com.ruoyi.common.encrypt.enumd.EncodeType; +import com.ruoyi.common.encrypt.utils.EncryptUtils; + +/** + * Base64算法实现 + * + * @author 老马 + * @version 4.6.0 + */ +public class Base64Encryptor extends AbstractEncryptor { + + public Base64Encryptor(EncryptContext context) { + super(context); + } + + /** + * 获得当前算法 + */ + @Override + public AlgorithmType algorithm() { + return AlgorithmType.BASE64; + } + + /** + * 加密 + * + * @param value 待加密字符串 + * @param encodeType 加密后的编码格式 + */ + @Override + public String encrypt(String value, EncodeType encodeType) { + return EncryptUtils.encryptByBase64(value); + } + + /** + * 解密 + * + * @param value 待加密字符串 + */ + @Override + public String decrypt(String value) { + return EncryptUtils.decryptByBase64(value); + } +} diff --git a/ruoyi-common/ruoyi-common-encrypt/src/main/java/com/ruoyi/common/encrypt/core/encryptor/RsaEncryptor.java b/ruoyi-common/ruoyi-common-encrypt/src/main/java/com/ruoyi/common/encrypt/core/encryptor/RsaEncryptor.java new file mode 100644 index 0000000..c9e9fa4 --- /dev/null +++ b/ruoyi-common/ruoyi-common-encrypt/src/main/java/com/ruoyi/common/encrypt/core/encryptor/RsaEncryptor.java @@ -0,0 +1,62 @@ +package com.ruoyi.common.encrypt.core.encryptor; + +import com.ruoyi.common.core.utils.StringUtils; +import com.ruoyi.common.encrypt.core.EncryptContext; +import com.ruoyi.common.encrypt.enumd.AlgorithmType; +import com.ruoyi.common.encrypt.enumd.EncodeType; +import com.ruoyi.common.encrypt.utils.EncryptUtils; + + +/** + * RSA算法实现 + * + * @author 老马 + * @version 4.6.0 + */ +public class RsaEncryptor extends AbstractEncryptor { + + private final EncryptContext context; + + public RsaEncryptor(EncryptContext context) { + super(context); + String privateKey = context.getPrivateKey(); + String publicKey = context.getPublicKey(); + if (StringUtils.isAnyEmpty(privateKey, publicKey)) { + throw new IllegalArgumentException("RSA公私钥均需要提供,公钥加密,私钥解密。"); + } + this.context = context; + } + + /** + * 获得当前算法 + */ + @Override + public AlgorithmType algorithm() { + return AlgorithmType.RSA; + } + + /** + * 加密 + * + * @param value 待加密字符串 + * @param encodeType 加密后的编码格式 + */ + @Override + public String encrypt(String value, EncodeType encodeType) { + if (encodeType == EncodeType.HEX) { + return EncryptUtils.encryptByRsaHex(value, context.getPublicKey()); + } else { + return EncryptUtils.encryptByRsa(value, context.getPublicKey()); + } + } + + /** + * 解密 + * + * @param value 待加密字符串 + */ + @Override + public String decrypt(String value) { + return EncryptUtils.decryptByRsa(value, context.getPrivateKey()); + } +} diff --git a/ruoyi-common/ruoyi-common-encrypt/src/main/java/com/ruoyi/common/encrypt/core/encryptor/Sm2Encryptor.java b/ruoyi-common/ruoyi-common-encrypt/src/main/java/com/ruoyi/common/encrypt/core/encryptor/Sm2Encryptor.java new file mode 100644 index 0000000..8c616d3 --- /dev/null +++ b/ruoyi-common/ruoyi-common-encrypt/src/main/java/com/ruoyi/common/encrypt/core/encryptor/Sm2Encryptor.java @@ -0,0 +1,61 @@ +package com.ruoyi.common.encrypt.core.encryptor; + +import com.ruoyi.common.core.utils.StringUtils; +import com.ruoyi.common.encrypt.core.EncryptContext; +import com.ruoyi.common.encrypt.enumd.AlgorithmType; +import com.ruoyi.common.encrypt.enumd.EncodeType; +import com.ruoyi.common.encrypt.utils.EncryptUtils; + +/** + * sm2算法实现 + * + * @author 老马 + * @version 4.6.0 + */ +public class Sm2Encryptor extends AbstractEncryptor { + + private final EncryptContext context; + + public Sm2Encryptor(EncryptContext context) { + super(context); + String privateKey = context.getPrivateKey(); + String publicKey = context.getPublicKey(); + if (StringUtils.isAnyEmpty(privateKey, publicKey)) { + throw new IllegalArgumentException("SM2公私钥均需要提供,公钥加密,私钥解密。"); + } + this.context = context; + } + + /** + * 获得当前算法 + */ + @Override + public AlgorithmType algorithm() { + return AlgorithmType.SM2; + } + + /** + * 加密 + * + * @param value 待加密字符串 + * @param encodeType 加密后的编码格式 + */ + @Override + public String encrypt(String value, EncodeType encodeType) { + if (encodeType == EncodeType.HEX) { + return EncryptUtils.encryptBySm2Hex(value, context.getPublicKey()); + } else { + return EncryptUtils.encryptBySm2(value, context.getPublicKey()); + } + } + + /** + * 解密 + * + * @param value 待加密字符串 + */ + @Override + public String decrypt(String value) { + return EncryptUtils.decryptBySm2(value, context.getPrivateKey()); + } +} diff --git a/ruoyi-common/ruoyi-common-encrypt/src/main/java/com/ruoyi/common/encrypt/core/encryptor/Sm4Encryptor.java b/ruoyi-common/ruoyi-common-encrypt/src/main/java/com/ruoyi/common/encrypt/core/encryptor/Sm4Encryptor.java new file mode 100644 index 0000000..cdb8273 --- /dev/null +++ b/ruoyi-common/ruoyi-common-encrypt/src/main/java/com/ruoyi/common/encrypt/core/encryptor/Sm4Encryptor.java @@ -0,0 +1,55 @@ +package com.ruoyi.common.encrypt.core.encryptor; + +import com.ruoyi.common.encrypt.core.EncryptContext; +import com.ruoyi.common.encrypt.enumd.AlgorithmType; +import com.ruoyi.common.encrypt.enumd.EncodeType; +import com.ruoyi.common.encrypt.utils.EncryptUtils; + +/** + * sm4算法实现 + * + * @author 老马 + * @version 4.6.0 + */ +public class Sm4Encryptor extends AbstractEncryptor { + + private final EncryptContext context; + + public Sm4Encryptor(EncryptContext context) { + super(context); + this.context = context; + } + + /** + * 获得当前算法 + */ + @Override + public AlgorithmType algorithm() { + return AlgorithmType.SM4; + } + + /** + * 加密 + * + * @param value 待加密字符串 + * @param encodeType 加密后的编码格式 + */ + @Override + public String encrypt(String value, EncodeType encodeType) { + if (encodeType == EncodeType.HEX) { + return EncryptUtils.encryptBySm4Hex(value, context.getPassword()); + } else { + return EncryptUtils.encryptBySm4(value, context.getPassword()); + } + } + + /** + * 解密 + * + * @param value 待加密字符串 + */ + @Override + public String decrypt(String value) { + return EncryptUtils.decryptBySm4(value, context.getPassword()); + } +} diff --git a/ruoyi-common/ruoyi-common-encrypt/src/main/java/com/ruoyi/common/encrypt/enumd/AlgorithmType.java b/ruoyi-common/ruoyi-common-encrypt/src/main/java/com/ruoyi/common/encrypt/enumd/AlgorithmType.java new file mode 100644 index 0000000..10bbe0d --- /dev/null +++ b/ruoyi-common/ruoyi-common-encrypt/src/main/java/com/ruoyi/common/encrypt/enumd/AlgorithmType.java @@ -0,0 +1,48 @@ +package com.ruoyi.common.encrypt.enumd; + +import lombok.AllArgsConstructor; +import lombok.Getter; +import com.ruoyi.common.encrypt.core.encryptor.*; + +/** + * 算法名称 + * + * @author 老马 + * @version 4.6.0 + */ +@Getter +@AllArgsConstructor +public enum AlgorithmType { + + /** + * 默认走yml配置 + */ + DEFAULT(null), + + /** + * base64 + */ + BASE64(Base64Encryptor.class), + + /** + * aes + */ + AES(AesEncryptor.class), + + /** + * rsa + */ + RSA(RsaEncryptor.class), + + /** + * sm2 + */ + SM2(Sm2Encryptor.class), + + /** + * sm4 + */ + SM4(Sm4Encryptor.class); + + private final Class clazz; +} diff --git a/ruoyi-common/ruoyi-common-encrypt/src/main/java/com/ruoyi/common/encrypt/enumd/EncodeType.java b/ruoyi-common/ruoyi-common-encrypt/src/main/java/com/ruoyi/common/encrypt/enumd/EncodeType.java new file mode 100644 index 0000000..f8d5499 --- /dev/null +++ b/ruoyi-common/ruoyi-common-encrypt/src/main/java/com/ruoyi/common/encrypt/enumd/EncodeType.java @@ -0,0 +1,26 @@ +package com.ruoyi.common.encrypt.enumd; + +/** + * 编码类型 + * + * @author 老马 + * @version 4.6.0 + */ +public enum EncodeType { + + /** + * 默认使用yml配置 + */ + DEFAULT, + + /** + * base64编码 + */ + BASE64, + + /** + * 16进制编码 + */ + HEX; + +} diff --git a/ruoyi-common/ruoyi-common-encrypt/src/main/java/com/ruoyi/common/encrypt/filter/CryptoFilter.java b/ruoyi-common/ruoyi-common-encrypt/src/main/java/com/ruoyi/common/encrypt/filter/CryptoFilter.java new file mode 100644 index 0000000..4be1027 --- /dev/null +++ b/ruoyi-common/ruoyi-common-encrypt/src/main/java/com/ruoyi/common/encrypt/filter/CryptoFilter.java @@ -0,0 +1,110 @@ +package com.ruoyi.common.encrypt.filter; + +import cn.hutool.core.util.ObjectUtil; +import jakarta.servlet.*; +import jakarta.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletResponse; +import com.ruoyi.common.core.constant.HttpStatus; +import com.ruoyi.common.core.exception.ServiceException; +import com.ruoyi.common.core.utils.SpringUtils; +import com.ruoyi.common.core.utils.StringUtils; +import com.ruoyi.common.encrypt.annotation.ApiEncrypt; +import com.ruoyi.common.encrypt.properties.ApiDecryptProperties; +import org.springframework.http.HttpMethod; +import org.springframework.web.method.HandlerMethod; +import org.springframework.web.servlet.HandlerExceptionResolver; +import org.springframework.web.servlet.HandlerExecutionChain; +import org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping; + +import java.io.IOException; + + +/** + * Crypto 过滤器 + * + * @author wdhcr + */ +public class CryptoFilter implements Filter { + private final ApiDecryptProperties properties; + + public CryptoFilter(ApiDecryptProperties properties) { + this.properties = properties; + } + + @Override + public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException { + HttpServletRequest servletRequest = (HttpServletRequest) request; + HttpServletResponse servletResponse = (HttpServletResponse) response; + // 获取加密注解 + ApiEncrypt apiEncrypt = this.getApiEncryptAnnotation(servletRequest); + boolean responseFlag = apiEncrypt != null && apiEncrypt.response(); + ServletRequest requestWrapper = null; + ServletResponse responseWrapper = null; + EncryptResponseBodyWrapper responseBodyWrapper = null; + + // 是否为 put 或者 post 请求 + if (HttpMethod.PUT.matches(servletRequest.getMethod()) || HttpMethod.POST.matches(servletRequest.getMethod())) { + // 是否存在加密标头 + String headerValue = servletRequest.getHeader(properties.getHeaderFlag()); + if (StringUtils.isNotBlank(headerValue)) { + // 请求解密 + requestWrapper = new DecryptRequestBodyWrapper(servletRequest, properties.getPrivateKey(), properties.getHeaderFlag()); + } else { + // 是否有注解,有就报错,没有放行 + if (ObjectUtil.isNotNull(apiEncrypt)) { + HandlerExceptionResolver exceptionResolver = SpringUtils.getBean("handlerExceptionResolver", HandlerExceptionResolver.class); + exceptionResolver.resolveException( + servletRequest, servletResponse, null, + new ServiceException("没有访问权限,请联系管理员授权", HttpStatus.FORBIDDEN)); + return; + } + } + } + + // 判断是否响应加密 + if (responseFlag) { + responseBodyWrapper = new EncryptResponseBodyWrapper(servletResponse); + responseWrapper = responseBodyWrapper; + } + + chain.doFilter( + ObjectUtil.defaultIfNull(requestWrapper, request), + ObjectUtil.defaultIfNull(responseWrapper, response)); + + if (responseFlag) { + servletResponse.reset(); + // 对原始内容加密 + String encryptContent = responseBodyWrapper.getEncryptContent( + servletResponse, properties.getPublicKey(), properties.getHeaderFlag()); + // 对加密后的内容写出 + servletResponse.getWriter().write(encryptContent); + } + } + + /** + * 获取 ApiEncrypt 注解 + */ + private ApiEncrypt getApiEncryptAnnotation(HttpServletRequest servletRequest) { + RequestMappingHandlerMapping handlerMapping = SpringUtils.getBean("requestMappingHandlerMapping", RequestMappingHandlerMapping.class); + // 获取注解 + try { + HandlerExecutionChain mappingHandler = handlerMapping.getHandler(servletRequest); + if (ObjectUtil.isNotNull(mappingHandler)) { + Object handler = mappingHandler.getHandler(); + if (ObjectUtil.isNotNull(handler)) { + // 从handler获取注解 + if (handler instanceof HandlerMethod handlerMethod) { + return handlerMethod.getMethodAnnotation(ApiEncrypt.class); + } + } + } + } catch (Exception e) { + throw new RuntimeException(e); + } + return null; + } + + @Override + public void destroy() { + } +} diff --git a/ruoyi-common/ruoyi-common-encrypt/src/main/java/com/ruoyi/common/encrypt/filter/DecryptRequestBodyWrapper.java b/ruoyi-common/ruoyi-common-encrypt/src/main/java/com/ruoyi/common/encrypt/filter/DecryptRequestBodyWrapper.java new file mode 100644 index 0000000..51be6bf --- /dev/null +++ b/ruoyi-common/ruoyi-common-encrypt/src/main/java/com/ruoyi/common/encrypt/filter/DecryptRequestBodyWrapper.java @@ -0,0 +1,94 @@ +package com.ruoyi.common.encrypt.filter; + +import cn.hutool.core.io.IoUtil; +import jakarta.servlet.ReadListener; +import jakarta.servlet.ServletInputStream; +import jakarta.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletRequestWrapper; +import com.ruoyi.common.core.constant.Constants; +import com.ruoyi.common.encrypt.utils.EncryptUtils; +import org.springframework.http.MediaType; + +import java.io.BufferedReader; +import java.io.ByteArrayInputStream; +import java.io.IOException; +import java.io.InputStreamReader; +import java.nio.charset.StandardCharsets; + +/** + * 解密请求参数工具类 + * + * @author wdhcr + */ +public class DecryptRequestBodyWrapper extends HttpServletRequestWrapper { + + private final byte[] body; + + public DecryptRequestBodyWrapper(HttpServletRequest request, String privateKey, String headerFlag) throws IOException { + super(request); + // 获取 AES 密码 采用 RSA 加密 + String headerRsa = request.getHeader(headerFlag); + String decryptAes = EncryptUtils.decryptByRsa(headerRsa, privateKey); + // 解密 AES 密码 + String aesPassword = EncryptUtils.decryptByBase64(decryptAes); + request.setCharacterEncoding(Constants.UTF8); + byte[] readBytes = IoUtil.readBytes(request.getInputStream(), false); + String requestBody = new String(readBytes, StandardCharsets.UTF_8); + // 解密 body 采用 AES 加密 + String decryptBody = EncryptUtils.decryptByAes(requestBody, aesPassword); + body = decryptBody.getBytes(StandardCharsets.UTF_8); + } + + @Override + public BufferedReader getReader() { + return new BufferedReader(new InputStreamReader(getInputStream())); + } + + + @Override + public int getContentLength() { + return body.length; + } + + @Override + public long getContentLengthLong() { + return body.length; + } + + @Override + public String getContentType() { + return MediaType.APPLICATION_JSON_VALUE; + } + + + @Override + public ServletInputStream getInputStream() { + final ByteArrayInputStream bais = new ByteArrayInputStream(body); + return new ServletInputStream() { + @Override + public int read() { + return bais.read(); + } + + @Override + public int available() { + return body.length; + } + + @Override + public boolean isFinished() { + return false; + } + + @Override + public boolean isReady() { + return false; + } + + @Override + public void setReadListener(ReadListener readListener) { + + } + }; + } +} diff --git a/ruoyi-common/ruoyi-common-encrypt/src/main/java/com/ruoyi/common/encrypt/filter/EncryptResponseBodyWrapper.java b/ruoyi-common/ruoyi-common-encrypt/src/main/java/com/ruoyi/common/encrypt/filter/EncryptResponseBodyWrapper.java new file mode 100644 index 0000000..1ab2c46 --- /dev/null +++ b/ruoyi-common/ruoyi-common-encrypt/src/main/java/com/ruoyi/common/encrypt/filter/EncryptResponseBodyWrapper.java @@ -0,0 +1,121 @@ +package com.ruoyi.common.encrypt.filter; + +import cn.hutool.core.util.RandomUtil; +import jakarta.servlet.ServletOutputStream; +import jakarta.servlet.WriteListener; +import jakarta.servlet.http.HttpServletResponse; +import jakarta.servlet.http.HttpServletResponseWrapper; +import com.ruoyi.common.encrypt.utils.EncryptUtils; + +import java.io.*; +import java.nio.charset.StandardCharsets; + +/** + * 加密响应参数包装类 + * + * @author Michelle.Chung + */ +public class EncryptResponseBodyWrapper extends HttpServletResponseWrapper { + + private final ByteArrayOutputStream byteArrayOutputStream; + private final ServletOutputStream servletOutputStream; + private final PrintWriter printWriter; + + public EncryptResponseBodyWrapper(HttpServletResponse response) throws IOException { + super(response); + this.byteArrayOutputStream = new ByteArrayOutputStream(); + this.servletOutputStream = this.getOutputStream(); + this.printWriter = new PrintWriter(new OutputStreamWriter(byteArrayOutputStream)); + } + + @Override + public PrintWriter getWriter() { + return printWriter; + } + + @Override + public void flushBuffer() throws IOException { + if (servletOutputStream != null) { + servletOutputStream.flush(); + } + if (printWriter != null) { + printWriter.flush(); + } + } + + @Override + public void reset() { + byteArrayOutputStream.reset(); + } + + public byte[] getResponseData() throws IOException { + flushBuffer(); + return byteArrayOutputStream.toByteArray(); + } + + public String getContent() throws IOException { + flushBuffer(); + return byteArrayOutputStream.toString(); + } + + /** + * 获取加密内容 + * + * @param servletResponse response + * @param publicKey RSA公钥 (用于加密 AES 秘钥) + * @param headerFlag 请求头标志 + * @return 加密内容 + * @throws IOException + */ + public String getEncryptContent(HttpServletResponse servletResponse, String publicKey, String headerFlag) throws IOException { + // 生成秘钥 + String aesPassword = RandomUtil.randomString(32); + // 秘钥使用 Base64 编码 + String encryptAes = EncryptUtils.encryptByBase64(aesPassword); + // Rsa 公钥加密 Base64 编码 + String encryptPassword = EncryptUtils.encryptByRsa(encryptAes, publicKey); + + // 设置响应头 + servletResponse.addHeader("Access-Control-Expose-Headers", headerFlag); + servletResponse.setHeader(headerFlag, encryptPassword); + servletResponse.setHeader("Access-Control-Allow-Origin", "*"); + servletResponse.setHeader("Access-Control-Allow-Methods", "*"); + servletResponse.setCharacterEncoding(StandardCharsets.UTF_8.toString()); + + // 获取原始内容 + String originalBody = this.getContent(); + // 对内容进行加密 + return EncryptUtils.encryptByAes(originalBody, aesPassword); + } + + @Override + public ServletOutputStream getOutputStream() throws IOException { + return new ServletOutputStream() { + @Override + public boolean isReady() { + return false; + } + + @Override + public void setWriteListener(WriteListener writeListener) { + + } + + @Override + public void write(int b) throws IOException { + byteArrayOutputStream.write(b); + } + + @Override + public void write(byte[] b) throws IOException { + byteArrayOutputStream.write(b); + } + + @Override + public void write(byte[] b, int off, int len) throws IOException { + byteArrayOutputStream.write(b, off, len); + } + }; + } + +} diff --git a/ruoyi-common/ruoyi-common-encrypt/src/main/java/com/ruoyi/common/encrypt/interceptor/MybatisDecryptInterceptor.java b/ruoyi-common/ruoyi-common-encrypt/src/main/java/com/ruoyi/common/encrypt/interceptor/MybatisDecryptInterceptor.java new file mode 100644 index 0000000..8f68b85 --- /dev/null +++ b/ruoyi-common/ruoyi-common-encrypt/src/main/java/com/ruoyi/common/encrypt/interceptor/MybatisDecryptInterceptor.java @@ -0,0 +1,120 @@ +package com.ruoyi.common.encrypt.interceptor; + +import cn.hutool.core.collection.CollUtil; +import cn.hutool.core.convert.Convert; +import cn.hutool.core.util.ObjectUtil; +import lombok.AllArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.apache.ibatis.executor.resultset.ResultSetHandler; +import org.apache.ibatis.plugin.*; +import com.ruoyi.common.core.utils.StringUtils; +import com.ruoyi.common.encrypt.annotation.EncryptField; +import com.ruoyi.common.encrypt.core.EncryptContext; +import com.ruoyi.common.encrypt.core.EncryptorManager; +import com.ruoyi.common.encrypt.enumd.AlgorithmType; +import com.ruoyi.common.encrypt.enumd.EncodeType; +import com.ruoyi.common.encrypt.properties.EncryptorProperties; + +import java.lang.reflect.Field; +import java.sql.Statement; +import java.util.*; + +/** + * 出参解密拦截器 + * + * @author 老马 + * @version 4.6.0 + */ +@Slf4j +@Intercepts({@Signature( + type = ResultSetHandler.class, + method = "handleResultSets", + args = {Statement.class}) +}) +@AllArgsConstructor +public class MybatisDecryptInterceptor implements Interceptor { + + private final EncryptorManager encryptorManager; + private final EncryptorProperties defaultProperties; + + @Override + public Object intercept(Invocation invocation) throws Throwable { + // 获取执行mysql执行结果 + Object result = invocation.proceed(); + if (result == null) { + return null; + } + decryptHandler(result); + return result; + } + + /** + * 解密对象 + * + * @param sourceObject 待加密对象 + */ + private void decryptHandler(Object sourceObject) { + if (ObjectUtil.isNull(sourceObject)) { + return; + } + if (sourceObject instanceof Map map) { + new HashSet<>(map.values()).forEach(this::decryptHandler); + return; + } + if (sourceObject instanceof List list) { + if(CollUtil.isEmpty(list)) { + return; + } + // 判断第一个元素是否含有注解。如果没有直接返回,提高效率 + Object firstItem = list.get(0); + if (ObjectUtil.isNull(firstItem) || CollUtil.isEmpty(encryptorManager.getFieldCache(firstItem.getClass()))) { + return; + } + list.forEach(this::decryptHandler); + return; + } + // 不在缓存中的类,就是没有加密注解的类(当然也有可能是typeAliasesPackage写错) + Set fields = encryptorManager.getFieldCache(sourceObject.getClass()); + if(ObjectUtil.isNull(fields)){ + return; + } + try { + for (Field field : fields) { + field.set(sourceObject, this.decryptField(Convert.toStr(field.get(sourceObject)), field)); + } + } catch (Exception e) { + log.error("处理解密字段时出错", e); + } + } + + /** + * 字段值进行加密。通过字段的批注注册新的加密算法 + * + * @param value 待加密的值 + * @param field 待加密字段 + * @return 加密后结果 + */ + private String decryptField(String value, Field field) { + if (ObjectUtil.isNull(value)) { + return null; + } + EncryptField encryptField = field.getAnnotation(EncryptField.class); + EncryptContext encryptContext = new EncryptContext(); + encryptContext.setAlgorithm(encryptField.algorithm() == AlgorithmType.DEFAULT ? defaultProperties.getAlgorithm() : encryptField.algorithm()); + encryptContext.setEncode(encryptField.encode() == EncodeType.DEFAULT ? defaultProperties.getEncode() : encryptField.encode()); + encryptContext.setPassword(StringUtils.isBlank(encryptField.password()) ? defaultProperties.getPassword() : encryptField.password()); + encryptContext.setPrivateKey(StringUtils.isBlank(encryptField.privateKey()) ? defaultProperties.getPrivateKey() : encryptField.privateKey()); + encryptContext.setPublicKey(StringUtils.isBlank(encryptField.publicKey()) ? defaultProperties.getPublicKey() : encryptField.publicKey()); + return this.encryptorManager.decrypt(value, encryptContext); + } + + @Override + public Object plugin(Object target) { + return Plugin.wrap(target, this); + } + + @Override + public void setProperties(Properties properties) { + + } +} diff --git a/ruoyi-common/ruoyi-common-encrypt/src/main/java/com/ruoyi/common/encrypt/interceptor/MybatisEncryptInterceptor.java b/ruoyi-common/ruoyi-common-encrypt/src/main/java/com/ruoyi/common/encrypt/interceptor/MybatisEncryptInterceptor.java new file mode 100644 index 0000000..e990181 --- /dev/null +++ b/ruoyi-common/ruoyi-common-encrypt/src/main/java/com/ruoyi/common/encrypt/interceptor/MybatisEncryptInterceptor.java @@ -0,0 +1,124 @@ +package com.ruoyi.common.encrypt.interceptor; + +import cn.hutool.core.collection.CollUtil; +import cn.hutool.core.convert.Convert; +import cn.hutool.core.util.ObjectUtil; +import lombok.AllArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.apache.ibatis.executor.parameter.ParameterHandler; +import org.apache.ibatis.plugin.Interceptor; +import org.apache.ibatis.plugin.Intercepts; +import org.apache.ibatis.plugin.Invocation; +import org.apache.ibatis.plugin.Signature; +import com.ruoyi.common.core.utils.StringUtils; +import com.ruoyi.common.encrypt.annotation.EncryptField; +import com.ruoyi.common.encrypt.core.EncryptContext; +import com.ruoyi.common.encrypt.core.EncryptorManager; +import com.ruoyi.common.encrypt.enumd.AlgorithmType; +import com.ruoyi.common.encrypt.enumd.EncodeType; +import com.ruoyi.common.encrypt.properties.EncryptorProperties; + +import java.lang.reflect.Field; +import java.sql.PreparedStatement; +import java.util.*; + +/** + * 入参加密拦截器 + * + * @author 老马 + * @version 4.6.0 + */ +@Slf4j +@Intercepts({@Signature( + type = ParameterHandler.class, + method = "setParameters", + args = {PreparedStatement.class}) +}) +@AllArgsConstructor +public class MybatisEncryptInterceptor implements Interceptor { + + private final EncryptorManager encryptorManager; + private final EncryptorProperties defaultProperties; + + @Override + public Object intercept(Invocation invocation) throws Throwable { + return invocation; + } + + @Override + public Object plugin(Object target) { + if (target instanceof ParameterHandler parameterHandler) { + // 进行加密操作 + Object parameterObject = parameterHandler.getParameterObject(); + if (ObjectUtil.isNotNull(parameterObject) && !(parameterObject instanceof String)) { + this.encryptHandler(parameterObject); + } + } + return target; + } + + /** + * 加密对象 + * + * @param sourceObject 待加密对象 + */ + private void encryptHandler(Object sourceObject) { + if (ObjectUtil.isNull(sourceObject)) { + return; + } + if (sourceObject instanceof Map map) { + new HashSet<>(map.values()).forEach(this::encryptHandler); + return; + } + if (sourceObject instanceof List list) { + if(CollUtil.isEmpty(list)) { + return; + } + // 判断第一个元素是否含有注解。如果没有直接返回,提高效率 + Object firstItem = list.get(0); + if (ObjectUtil.isNull(firstItem) || CollUtil.isEmpty(encryptorManager.getFieldCache(firstItem.getClass()))) { + return; + } + list.forEach(this::encryptHandler); + return; + } + // 不在缓存中的类,就是没有加密注解的类(当然也有可能是typeAliasesPackage写错) + Set fields = encryptorManager.getFieldCache(sourceObject.getClass()); + if(ObjectUtil.isNull(fields)){ + return; + } + try { + for (Field field : fields) { + field.set(sourceObject, this.encryptField(Convert.toStr(field.get(sourceObject)), field)); + } + } catch (Exception e) { + log.error("处理加密字段时出错", e); + } + } + + /** + * 字段值进行加密。通过字段的批注注册新的加密算法 + * + * @param value 待加密的值 + * @param field 待加密字段 + * @return 加密后结果 + */ + private String encryptField(String value, Field field) { + if (ObjectUtil.isNull(value)) { + return null; + } + EncryptField encryptField = field.getAnnotation(EncryptField.class); + EncryptContext encryptContext = new EncryptContext(); + encryptContext.setAlgorithm(encryptField.algorithm() == AlgorithmType.DEFAULT ? defaultProperties.getAlgorithm() : encryptField.algorithm()); + encryptContext.setEncode(encryptField.encode() == EncodeType.DEFAULT ? defaultProperties.getEncode() : encryptField.encode()); + encryptContext.setPassword(StringUtils.isBlank(encryptField.password()) ? defaultProperties.getPassword() : encryptField.password()); + encryptContext.setPrivateKey(StringUtils.isBlank(encryptField.privateKey()) ? defaultProperties.getPrivateKey() : encryptField.privateKey()); + encryptContext.setPublicKey(StringUtils.isBlank(encryptField.publicKey()) ? defaultProperties.getPublicKey() : encryptField.publicKey()); + return this.encryptorManager.encrypt(value, encryptContext); + } + + + @Override + public void setProperties(Properties properties) { + } +} diff --git a/ruoyi-common/ruoyi-common-encrypt/src/main/java/com/ruoyi/common/encrypt/properties/ApiDecryptProperties.java b/ruoyi-common/ruoyi-common-encrypt/src/main/java/com/ruoyi/common/encrypt/properties/ApiDecryptProperties.java new file mode 100644 index 0000000..4070260 --- /dev/null +++ b/ruoyi-common/ruoyi-common-encrypt/src/main/java/com/ruoyi/common/encrypt/properties/ApiDecryptProperties.java @@ -0,0 +1,34 @@ +package com.ruoyi.common.encrypt.properties; + +import lombok.Data; +import org.springframework.boot.context.properties.ConfigurationProperties; + +/** + * api解密属性配置类 + * @author wdhcr + */ +@Data +@ConfigurationProperties(prefix = "api-decrypt") +public class ApiDecryptProperties { + + /** + * 加密开关 + */ + private Boolean enabled; + + /** + * 头部标识 + */ + private String headerFlag; + + /** + * 响应加密公钥 + */ + private String publicKey; + + /** + * 请求解密私钥 + */ + private String privateKey; + +} diff --git a/ruoyi-common/ruoyi-common-encrypt/src/main/java/com/ruoyi/common/encrypt/properties/EncryptorProperties.java b/ruoyi-common/ruoyi-common-encrypt/src/main/java/com/ruoyi/common/encrypt/properties/EncryptorProperties.java new file mode 100644 index 0000000..003db6c --- /dev/null +++ b/ruoyi-common/ruoyi-common-encrypt/src/main/java/com/ruoyi/common/encrypt/properties/EncryptorProperties.java @@ -0,0 +1,48 @@ +package com.ruoyi.common.encrypt.properties; + +import com.ruoyi.common.encrypt.enumd.AlgorithmType; +import com.ruoyi.common.encrypt.enumd.EncodeType; +import lombok.Data; +import org.springframework.boot.context.properties.ConfigurationProperties; + +/** + * 加解密属性配置类 + * + * @author 老马 + * @version 4.6.0 + */ +@Data +@ConfigurationProperties(prefix = "mybatis-encryptor") +public class EncryptorProperties { + + /** + * 过滤开关 + */ + private Boolean enable; + + /** + * 默认算法 + */ + private AlgorithmType algorithm; + + /** + * 安全秘钥 + */ + private String password; + + /** + * 公钥 + */ + private String publicKey; + + /** + * 私钥 + */ + private String privateKey; + + /** + * 编码方式,base64/hex + */ + private EncodeType encode; + +} diff --git a/ruoyi-common/ruoyi-common-encrypt/src/main/java/com/ruoyi/common/encrypt/utils/EncryptUtils.java b/ruoyi-common/ruoyi-common-encrypt/src/main/java/com/ruoyi/common/encrypt/utils/EncryptUtils.java new file mode 100644 index 0000000..e048faf --- /dev/null +++ b/ruoyi-common/ruoyi-common-encrypt/src/main/java/com/ruoyi/common/encrypt/utils/EncryptUtils.java @@ -0,0 +1,311 @@ +package com.ruoyi.common.encrypt.utils; + +import cn.hutool.core.codec.Base64; +import cn.hutool.core.util.ArrayUtil; +import cn.hutool.core.util.StrUtil; +import cn.hutool.crypto.SecureUtil; +import cn.hutool.crypto.SmUtil; +import cn.hutool.crypto.asymmetric.KeyType; +import cn.hutool.crypto.asymmetric.RSA; +import cn.hutool.crypto.asymmetric.SM2; + +import java.nio.charset.StandardCharsets; +import java.util.HashMap; +import java.util.Map; + +/** + * 安全相关工具类 + * + * @author 老马 + */ +public class EncryptUtils { + /** + * 公钥 + */ + public static final String PUBLIC_KEY = "publicKey"; + /** + * 私钥 + */ + public static final String PRIVATE_KEY = "privateKey"; + + /** + * Base64加密 + * + * @param data 待加密数据 + * @return 加密后字符串 + */ + public static String encryptByBase64(String data) { + return Base64.encode(data, StandardCharsets.UTF_8); + } + + /** + * Base64解密 + * + * @param data 待解密数据 + * @return 解密后字符串 + */ + public static String decryptByBase64(String data) { + return Base64.decodeStr(data, StandardCharsets.UTF_8); + } + + /** + * AES加密 + * + * @param data 待解密数据 + * @param password 秘钥字符串 + * @return 加密后字符串, 采用Base64编码 + */ + public static String encryptByAes(String data, String password) { + if (StrUtil.isBlank(password)) { + throw new IllegalArgumentException("AES需要传入秘钥信息"); + } + // aes算法的秘钥要求是16位、24位、32位 + int[] array = {16, 24, 32}; + if (!ArrayUtil.contains(array, password.length())) { + throw new IllegalArgumentException("AES秘钥长度要求为16位、24位、32位"); + } + return SecureUtil.aes(password.getBytes(StandardCharsets.UTF_8)).encryptBase64(data, StandardCharsets.UTF_8); + } + + /** + * AES加密 + * + * @param data 待解密数据 + * @param password 秘钥字符串 + * @return 加密后字符串, 采用Hex编码 + */ + public static String encryptByAesHex(String data, String password) { + if (StrUtil.isBlank(password)) { + throw new IllegalArgumentException("AES需要传入秘钥信息"); + } + // aes算法的秘钥要求是16位、24位、32位 + int[] array = {16, 24, 32}; + if (!ArrayUtil.contains(array, password.length())) { + throw new IllegalArgumentException("AES秘钥长度要求为16位、24位、32位"); + } + return SecureUtil.aes(password.getBytes(StandardCharsets.UTF_8)).encryptHex(data, StandardCharsets.UTF_8); + } + + /** + * AES解密 + * + * @param data 待解密数据 + * @param password 秘钥字符串 + * @return 解密后字符串 + */ + public static String decryptByAes(String data, String password) { + if (StrUtil.isBlank(password)) { + throw new IllegalArgumentException("AES需要传入秘钥信息"); + } + // aes算法的秘钥要求是16位、24位、32位 + int[] array = {16, 24, 32}; + if (!ArrayUtil.contains(array, password.length())) { + throw new IllegalArgumentException("AES秘钥长度要求为16位、24位、32位"); + } + return SecureUtil.aes(password.getBytes(StandardCharsets.UTF_8)).decryptStr(data, StandardCharsets.UTF_8); + } + + /** + * sm4加密 + * + * @param data 待加密数据 + * @param password 秘钥字符串 + * @return 加密后字符串, 采用Base64编码 + */ + public static String encryptBySm4(String data, String password) { + if (StrUtil.isBlank(password)) { + throw new IllegalArgumentException("SM4需要传入秘钥信息"); + } + // sm4算法的秘钥要求是16位长度 + int sm4PasswordLength = 16; + if (sm4PasswordLength != password.length()) { + throw new IllegalArgumentException("SM4秘钥长度要求为16位"); + } + return SmUtil.sm4(password.getBytes(StandardCharsets.UTF_8)).encryptBase64(data, StandardCharsets.UTF_8); + } + + /** + * sm4加密 + * + * @param data 待加密数据 + * @param password 秘钥字符串 + * @return 加密后字符串, 采用Base64编码 + */ + public static String encryptBySm4Hex(String data, String password) { + if (StrUtil.isBlank(password)) { + throw new IllegalArgumentException("SM4需要传入秘钥信息"); + } + // sm4算法的秘钥要求是16位长度 + int sm4PasswordLength = 16; + if (sm4PasswordLength != password.length()) { + throw new IllegalArgumentException("SM4秘钥长度要求为16位"); + } + return SmUtil.sm4(password.getBytes(StandardCharsets.UTF_8)).encryptHex(data, StandardCharsets.UTF_8); + } + + /** + * sm4解密 + * + * @param data 待解密数据 + * @param password 秘钥字符串 + * @return 解密后字符串 + */ + public static String decryptBySm4(String data, String password) { + if (StrUtil.isBlank(password)) { + throw new IllegalArgumentException("SM4需要传入秘钥信息"); + } + // sm4算法的秘钥要求是16位长度 + int sm4PasswordLength = 16; + if (sm4PasswordLength != password.length()) { + throw new IllegalArgumentException("SM4秘钥长度要求为16位"); + } + return SmUtil.sm4(password.getBytes(StandardCharsets.UTF_8)).decryptStr(data, StandardCharsets.UTF_8); + } + + /** + * 产生sm2加解密需要的公钥和私钥 + * + * @return 公私钥Map + */ + public static Map generateSm2Key() { + Map keyMap = new HashMap<>(2); + SM2 sm2 = SmUtil.sm2(); + keyMap.put(PRIVATE_KEY, sm2.getPrivateKeyBase64()); + keyMap.put(PUBLIC_KEY, sm2.getPublicKeyBase64()); + return keyMap; + } + + /** + * sm2公钥加密 + * + * @param data 待加密数据 + * @param publicKey 公钥 + * @return 加密后字符串, 采用Base64编码 + */ + public static String encryptBySm2(String data, String publicKey) { + if (StrUtil.isBlank(publicKey)) { + throw new IllegalArgumentException("SM2需要传入公钥进行加密"); + } + SM2 sm2 = SmUtil.sm2(null, publicKey); + return sm2.encryptBase64(data, StandardCharsets.UTF_8, KeyType.PublicKey); + } + + /** + * sm2公钥加密 + * + * @param data 待加密数据 + * @param publicKey 公钥 + * @return 加密后字符串, 采用Hex编码 + */ + public static String encryptBySm2Hex(String data, String publicKey) { + if (StrUtil.isBlank(publicKey)) { + throw new IllegalArgumentException("SM2需要传入公钥进行加密"); + } + SM2 sm2 = SmUtil.sm2(null, publicKey); + return sm2.encryptHex(data, StandardCharsets.UTF_8, KeyType.PublicKey); + } + + /** + * sm2私钥解密 + * + * @param data 待加密数据 + * @param privateKey 私钥 + * @return 解密后字符串 + */ + public static String decryptBySm2(String data, String privateKey) { + if (StrUtil.isBlank(privateKey)) { + throw new IllegalArgumentException("SM2需要传入私钥进行解密"); + } + SM2 sm2 = SmUtil.sm2(privateKey, null); + return sm2.decryptStr(data, KeyType.PrivateKey, StandardCharsets.UTF_8); + } + + /** + * 产生RSA加解密需要的公钥和私钥 + * + * @return 公私钥Map + */ + public static Map generateRsaKey() { + Map keyMap = new HashMap<>(2); + RSA rsa = SecureUtil.rsa(); + keyMap.put(PRIVATE_KEY, rsa.getPrivateKeyBase64()); + keyMap.put(PUBLIC_KEY, rsa.getPublicKeyBase64()); + return keyMap; + } + + /** + * rsa公钥加密 + * + * @param data 待加密数据 + * @param publicKey 公钥 + * @return 加密后字符串, 采用Base64编码 + */ + public static String encryptByRsa(String data, String publicKey) { + if (StrUtil.isBlank(publicKey)) { + throw new IllegalArgumentException("RSA需要传入公钥进行加密"); + } + RSA rsa = SecureUtil.rsa(null, publicKey); + return rsa.encryptBase64(data, StandardCharsets.UTF_8, KeyType.PublicKey); + } + + /** + * rsa公钥加密 + * + * @param data 待加密数据 + * @param publicKey 公钥 + * @return 加密后字符串, 采用Hex编码 + */ + public static String encryptByRsaHex(String data, String publicKey) { + if (StrUtil.isBlank(publicKey)) { + throw new IllegalArgumentException("RSA需要传入公钥进行加密"); + } + RSA rsa = SecureUtil.rsa(null, publicKey); + return rsa.encryptHex(data, StandardCharsets.UTF_8, KeyType.PublicKey); + } + + /** + * rsa私钥解密 + * + * @param data 待加密数据 + * @param privateKey 私钥 + * @return 解密后字符串 + */ + public static String decryptByRsa(String data, String privateKey) { + if (StrUtil.isBlank(privateKey)) { + throw new IllegalArgumentException("RSA需要传入私钥进行解密"); + } + RSA rsa = SecureUtil.rsa(privateKey, null); + return rsa.decryptStr(data, KeyType.PrivateKey, StandardCharsets.UTF_8); + } + + /** + * md5加密 + * + * @param data 待加密数据 + * @return 加密后字符串, 采用Hex编码 + */ + public static String encryptByMd5(String data) { + return SecureUtil.md5(data); + } + + /** + * sha256加密 + * + * @param data 待加密数据 + * @return 加密后字符串, 采用Hex编码 + */ + public static String encryptBySha256(String data) { + return SecureUtil.sha256(data); + } + + /** + * sm3加密 + * + * @param data 待加密数据 + * @return 加密后字符串, 采用Hex编码 + */ + public static String encryptBySm3(String data) { + return SmUtil.sm3(data); + } + +} diff --git a/ruoyi-common/ruoyi-common-encrypt/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports b/ruoyi-common/ruoyi-common-encrypt/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports new file mode 100644 index 0000000..fe61570 --- /dev/null +++ b/ruoyi-common/ruoyi-common-encrypt/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports @@ -0,0 +1,3 @@ +com.ruoyi.common.encrypt.config.EncryptorAutoConfiguration +com.ruoyi.common.encrypt.config.ApiDecryptAutoConfiguration + diff --git a/ruoyi-common/ruoyi-common-excel/pom.xml b/ruoyi-common/ruoyi-common-excel/pom.xml new file mode 100644 index 0000000..2cac9e0 --- /dev/null +++ b/ruoyi-common/ruoyi-common-excel/pom.xml @@ -0,0 +1,30 @@ + + + + com.ruoyi + ruoyi-common + ${revision} + + 4.0.0 + + ruoyi-common-excel + + + ruoyi-common-excel + + + + + com.ruoyi + ruoyi-common-json + + + + com.alibaba + easyexcel + + + + diff --git a/ruoyi-common/ruoyi-common-excel/src/main/java/com/ruoyi/common/excel/annotation/CellMerge.java b/ruoyi-common/ruoyi-common-excel/src/main/java/com/ruoyi/common/excel/annotation/CellMerge.java new file mode 100644 index 0000000..9d643e5 --- /dev/null +++ b/ruoyi-common/ruoyi-common-excel/src/main/java/com/ruoyi/common/excel/annotation/CellMerge.java @@ -0,0 +1,29 @@ +package com.ruoyi.common.excel.annotation; + +import com.ruoyi.common.excel.core.CellMergeStrategy; + +import java.lang.annotation.*; + +/** + * excel 列单元格合并(合并列相同项) + * + * 需搭配 {@link CellMergeStrategy} 策略使用 + * + * @author Lion Li + */ +@Target(ElementType.FIELD) +@Retention(RetentionPolicy.RUNTIME) +@Inherited +public @interface CellMerge { + + /** + * col index + */ + int index() default -1; + + /** + * 合并需要依赖的其他字段名称 + */ + String[] mergeBy() default {}; + +} diff --git a/ruoyi-common/ruoyi-common-excel/src/main/java/com/ruoyi/common/excel/annotation/ExcelDictFormat.java b/ruoyi-common/ruoyi-common-excel/src/main/java/com/ruoyi/common/excel/annotation/ExcelDictFormat.java new file mode 100644 index 0000000..162dc79 --- /dev/null +++ b/ruoyi-common/ruoyi-common-excel/src/main/java/com/ruoyi/common/excel/annotation/ExcelDictFormat.java @@ -0,0 +1,32 @@ +package com.ruoyi.common.excel.annotation; + +import com.ruoyi.common.core.utils.StringUtils; + +import java.lang.annotation.*; + +/** + * 字典格式化 + * + * @author Lion Li + */ +@Target({ElementType.FIELD}) +@Retention(RetentionPolicy.RUNTIME) +@Inherited +public @interface ExcelDictFormat { + + /** + * 如果是字典类型,请设置字典的type值 (如: sys_user_sex) + */ + String dictType() default ""; + + /** + * 读取内容转表达式 (如: 0=男,1=女,2=未知) + */ + String readConverterExp() default ""; + + /** + * 分隔符,读取字符串组内容 + */ + String separator() default StringUtils.SEPARATOR; + +} diff --git a/ruoyi-common/ruoyi-common-excel/src/main/java/com/ruoyi/common/excel/annotation/ExcelEnumFormat.java b/ruoyi-common/ruoyi-common-excel/src/main/java/com/ruoyi/common/excel/annotation/ExcelEnumFormat.java new file mode 100644 index 0000000..d5fda7c --- /dev/null +++ b/ruoyi-common/ruoyi-common-excel/src/main/java/com/ruoyi/common/excel/annotation/ExcelEnumFormat.java @@ -0,0 +1,30 @@ +package com.ruoyi.common.excel.annotation; + +import java.lang.annotation.*; + +/** + * 枚举格式化 + * + * @author Liang + */ +@Target({ElementType.FIELD}) +@Retention(RetentionPolicy.RUNTIME) +@Inherited +public @interface ExcelEnumFormat { + + /** + * 字典枚举类型 + */ + Class> enumClass(); + + /** + * 字典枚举类中对应的code属性名称,默认为code + */ + String codeField() default "code"; + + /** + * 字典枚举类中对应的text属性名称,默认为text + */ + String textField() default "text"; + +} diff --git a/ruoyi-common/ruoyi-common-excel/src/main/java/com/ruoyi/common/excel/convert/ExcelBigNumberConvert.java b/ruoyi-common/ruoyi-common-excel/src/main/java/com/ruoyi/common/excel/convert/ExcelBigNumberConvert.java new file mode 100644 index 0000000..1e10334 --- /dev/null +++ b/ruoyi-common/ruoyi-common-excel/src/main/java/com/ruoyi/common/excel/convert/ExcelBigNumberConvert.java @@ -0,0 +1,52 @@ +package com.ruoyi.common.excel.convert; + +import cn.hutool.core.convert.Convert; +import cn.hutool.core.util.ObjectUtil; +import com.alibaba.excel.converters.Converter; +import com.alibaba.excel.enums.CellDataTypeEnum; +import com.alibaba.excel.metadata.GlobalConfiguration; +import com.alibaba.excel.metadata.data.ReadCellData; +import com.alibaba.excel.metadata.data.WriteCellData; +import com.alibaba.excel.metadata.property.ExcelContentProperty; +import lombok.extern.slf4j.Slf4j; + +import java.math.BigDecimal; + +/** + * 大数值转换 + * Excel 数值长度位15位 大于15位的数值转换位字符串 + * + * @author Lion Li + */ +@Slf4j +public class ExcelBigNumberConvert implements Converter { + + @Override + public Class supportJavaTypeKey() { + return Long.class; + } + + @Override + public CellDataTypeEnum supportExcelTypeKey() { + return CellDataTypeEnum.STRING; + } + + @Override + public Long convertToJavaData(ReadCellData cellData, ExcelContentProperty contentProperty, GlobalConfiguration globalConfiguration) { + return Convert.toLong(cellData.getData()); + } + + @Override + public WriteCellData convertToExcelData(Long object, ExcelContentProperty contentProperty, GlobalConfiguration globalConfiguration) { + if (ObjectUtil.isNotNull(object)) { + String str = Convert.toStr(object); + if (str.length() > 15) { + return new WriteCellData<>(str); + } + } + WriteCellData cellData = new WriteCellData<>(new BigDecimal(object)); + cellData.setType(CellDataTypeEnum.NUMBER); + return cellData; + } + +} diff --git a/ruoyi-common/ruoyi-common-excel/src/main/java/com/ruoyi/common/excel/convert/ExcelDictConvert.java b/ruoyi-common/ruoyi-common-excel/src/main/java/com/ruoyi/common/excel/convert/ExcelDictConvert.java new file mode 100644 index 0000000..c44e511 --- /dev/null +++ b/ruoyi-common/ruoyi-common-excel/src/main/java/com/ruoyi/common/excel/convert/ExcelDictConvert.java @@ -0,0 +1,73 @@ +package com.ruoyi.common.excel.convert; + +import cn.hutool.core.annotation.AnnotationUtil; +import cn.hutool.core.convert.Convert; +import cn.hutool.core.util.ObjectUtil; +import com.alibaba.excel.converters.Converter; +import com.alibaba.excel.enums.CellDataTypeEnum; +import com.alibaba.excel.metadata.GlobalConfiguration; +import com.alibaba.excel.metadata.data.ReadCellData; +import com.alibaba.excel.metadata.data.WriteCellData; +import com.alibaba.excel.metadata.property.ExcelContentProperty; +import com.ruoyi.common.core.service.DictService; +import com.ruoyi.common.core.utils.StringUtils; +import com.ruoyi.common.core.utils.SpringUtils; +import com.ruoyi.common.excel.annotation.ExcelDictFormat; +import com.ruoyi.common.excel.utils.ExcelUtil; +import lombok.extern.slf4j.Slf4j; + +import java.lang.reflect.Field; + +/** + * 字典格式化转换处理 + * + * @author Lion Li + */ +@Slf4j +public class ExcelDictConvert implements Converter { + + @Override + public Class supportJavaTypeKey() { + return Object.class; + } + + @Override + public CellDataTypeEnum supportExcelTypeKey() { + return null; + } + + @Override + public Object convertToJavaData(ReadCellData cellData, ExcelContentProperty contentProperty, GlobalConfiguration globalConfiguration) { + ExcelDictFormat anno = getAnnotation(contentProperty.getField()); + String type = anno.dictType(); + String label = cellData.getStringValue(); + String value; + if (StringUtils.isBlank(type)) { + value = ExcelUtil.reverseByExp(label, anno.readConverterExp(), anno.separator()); + } else { + value = SpringUtils.getBean(DictService.class).getDictValue(type, label, anno.separator()); + } + return Convert.convert(contentProperty.getField().getType(), value); + } + + @Override + public WriteCellData convertToExcelData(Object object, ExcelContentProperty contentProperty, GlobalConfiguration globalConfiguration) { + if (ObjectUtil.isNull(object)) { + return new WriteCellData<>(""); + } + ExcelDictFormat anno = getAnnotation(contentProperty.getField()); + String type = anno.dictType(); + String value = Convert.toStr(object); + String label; + if (StringUtils.isBlank(type)) { + label = ExcelUtil.convertByExp(value, anno.readConverterExp(), anno.separator()); + } else { + label = SpringUtils.getBean(DictService.class).getDictLabel(type, value, anno.separator()); + } + return new WriteCellData<>(label); + } + + private ExcelDictFormat getAnnotation(Field field) { + return AnnotationUtil.getAnnotation(field, ExcelDictFormat.class); + } +} diff --git a/ruoyi-common/ruoyi-common-excel/src/main/java/com/ruoyi/common/excel/convert/ExcelEnumConvert.java b/ruoyi-common/ruoyi-common-excel/src/main/java/com/ruoyi/common/excel/convert/ExcelEnumConvert.java new file mode 100644 index 0000000..2fb1d32 --- /dev/null +++ b/ruoyi-common/ruoyi-common-excel/src/main/java/com/ruoyi/common/excel/convert/ExcelEnumConvert.java @@ -0,0 +1,87 @@ +package com.ruoyi.common.excel.convert; + +import cn.hutool.core.annotation.AnnotationUtil; +import cn.hutool.core.convert.Convert; +import cn.hutool.core.util.ObjectUtil; +import com.alibaba.excel.converters.Converter; +import com.alibaba.excel.enums.CellDataTypeEnum; +import com.alibaba.excel.metadata.GlobalConfiguration; +import com.alibaba.excel.metadata.data.ReadCellData; +import com.alibaba.excel.metadata.data.WriteCellData; +import com.alibaba.excel.metadata.property.ExcelContentProperty; +import com.ruoyi.common.core.utils.reflect.ReflectUtils; +import com.ruoyi.common.excel.annotation.ExcelEnumFormat; +import lombok.extern.slf4j.Slf4j; + +import java.lang.reflect.Field; +import java.util.HashMap; +import java.util.Map; + +/** + * 枚举格式化转换处理 + * + * @author Liang + */ +@Slf4j +public class ExcelEnumConvert implements Converter { + + @Override + public Class supportJavaTypeKey() { + return Object.class; + } + + @Override + public CellDataTypeEnum supportExcelTypeKey() { + return null; + } + + @Override + public Object convertToJavaData(ReadCellData cellData, ExcelContentProperty contentProperty, GlobalConfiguration globalConfiguration) { + cellData.checkEmpty(); + // Excel中填入的是枚举中指定的描述 + Object textValue = switch (cellData.getType()) { + case STRING, DIRECT_STRING, RICH_TEXT_STRING -> cellData.getStringValue(); + case NUMBER -> cellData.getNumberValue(); + case BOOLEAN -> cellData.getBooleanValue(); + default -> throw new IllegalArgumentException("单元格类型异常!"); + }; + // 如果是空值 + if (ObjectUtil.isNull(textValue)) { + return null; + } + Map enumCodeToTextMap = beforeConvert(contentProperty); + // 从Java输出至Excel是code转text + // 因此从Excel转Java应该将text与code对调 + Map enumTextToCodeMap = new HashMap<>(); + enumCodeToTextMap.forEach((key, value) -> enumTextToCodeMap.put(value, key)); + // 应该从text -> code中查找 + Object codeValue = enumTextToCodeMap.get(textValue); + return Convert.convert(contentProperty.getField().getType(), codeValue); + } + + @Override + public WriteCellData convertToExcelData(Object object, ExcelContentProperty contentProperty, GlobalConfiguration globalConfiguration) { + if (ObjectUtil.isNull(object)) { + return new WriteCellData<>(""); + } + Map enumValueMap = beforeConvert(contentProperty); + String value = Convert.toStr(enumValueMap.get(object), ""); + return new WriteCellData<>(value); + } + + private Map beforeConvert(ExcelContentProperty contentProperty) { + ExcelEnumFormat anno = getAnnotation(contentProperty.getField()); + Map enumValueMap = new HashMap<>(); + Enum[] enumConstants = anno.enumClass().getEnumConstants(); + for (Enum enumConstant : enumConstants) { + Object codeValue = ReflectUtils.invokeGetter(enumConstant, anno.codeField()); + String textValue = ReflectUtils.invokeGetter(enumConstant, anno.textField()); + enumValueMap.put(codeValue, textValue); + } + return enumValueMap; + } + + private ExcelEnumFormat getAnnotation(Field field) { + return AnnotationUtil.getAnnotation(field, ExcelEnumFormat.class); + } +} diff --git a/ruoyi-common/ruoyi-common-excel/src/main/java/com/ruoyi/common/excel/core/CellMergeStrategy.java b/ruoyi-common/ruoyi-common-excel/src/main/java/com/ruoyi/common/excel/core/CellMergeStrategy.java new file mode 100644 index 0000000..833ab3d --- /dev/null +++ b/ruoyi-common/ruoyi-common-excel/src/main/java/com/ruoyi/common/excel/core/CellMergeStrategy.java @@ -0,0 +1,152 @@ +package com.ruoyi.common.excel.core; + +import cn.hutool.core.collection.CollUtil; +import cn.hutool.core.util.ReflectUtil; +import cn.hutool.core.util.StrUtil; +import com.alibaba.excel.annotation.ExcelProperty; +import com.alibaba.excel.metadata.Head; +import com.alibaba.excel.write.handler.WorkbookWriteHandler; +import com.alibaba.excel.write.handler.context.WorkbookWriteHandlerContext; +import com.alibaba.excel.write.merge.AbstractMergeStrategy; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.SneakyThrows; +import lombok.extern.slf4j.Slf4j; +import org.apache.poi.ss.usermodel.Cell; +import org.apache.poi.ss.usermodel.Sheet; +import org.apache.poi.ss.util.CellRangeAddress; +import com.ruoyi.common.core.utils.reflect.ReflectUtils; +import com.ruoyi.common.excel.annotation.CellMerge; + +import java.lang.reflect.Field; +import java.util.*; + +/** + * 列值重复合并策略 + * + * @author Lion Li + */ +@Slf4j +public class CellMergeStrategy extends AbstractMergeStrategy implements WorkbookWriteHandler { + + private final List cellList; + private final boolean hasTitle; + private int rowIndex; + + public CellMergeStrategy(List list, boolean hasTitle) { + this.hasTitle = hasTitle; + // 行合并开始下标 + this.rowIndex = hasTitle ? 1 : 0; + this.cellList = handle(list, hasTitle); + } + + @Override + protected void merge(Sheet sheet, Cell cell, Head head, Integer relativeRowIndex) { + //单元格写入了,遍历合并区域,如果该Cell在区域内,但非首行,则清空 + final int rowIndex = cell.getRowIndex(); + if (CollUtil.isNotEmpty(cellList)){ + for (CellRangeAddress cellAddresses : cellList) { + final int firstRow = cellAddresses.getFirstRow(); + if (cellAddresses.isInRange(cell) && rowIndex != firstRow){ + cell.setBlank(); + } + } + } + } + + @Override + public void afterWorkbookDispose(final WorkbookWriteHandlerContext context) { + //当前表格写完后,统一写入 + if (CollUtil.isNotEmpty(cellList)){ + for (CellRangeAddress item : cellList) { + context.getWriteContext().writeSheetHolder().getSheet().addMergedRegion(item); + } + } + } + + @SneakyThrows + private List handle(List list, boolean hasTitle) { + List cellList = new ArrayList<>(); + if (CollUtil.isEmpty(list)) { + return cellList; + } + Field[] fields = ReflectUtils.getFields(list.get(0).getClass(), field -> !"serialVersionUID".equals(field.getName())); + + // 有注解的字段 + List mergeFields = new ArrayList<>(); + List mergeFieldsIndex = new ArrayList<>(); + for (int i = 0; i < fields.length; i++) { + Field field = fields[i]; + if (field.isAnnotationPresent(CellMerge.class)) { + CellMerge cm = field.getAnnotation(CellMerge.class); + mergeFields.add(field); + mergeFieldsIndex.add(cm.index() == -1 ? i : cm.index()); + if (hasTitle) { + ExcelProperty property = field.getAnnotation(ExcelProperty.class); + rowIndex = Math.max(rowIndex, property.value().length); + } + } + } + + Map map = new HashMap<>(); + // 生成两两合并单元格 + for (int i = 0; i < list.size(); i++) { + for (int j = 0; j < mergeFields.size(); j++) { + Field field = mergeFields.get(j); + Object val = ReflectUtils.invokeGetter(list.get(i), field.getName()); + + int colNum = mergeFieldsIndex.get(j); + if (!map.containsKey(field)) { + map.put(field, new RepeatCell(val, i)); + } else { + RepeatCell repeatCell = map.get(field); + Object cellValue = repeatCell.getValue(); + if (cellValue == null || "".equals(cellValue)) { + // 空值跳过不合并 + continue; + } + + if (!cellValue.equals(val)) { + if ((i - repeatCell.getCurrent() > 1) && isMerge(list, i, field)) { + cellList.add(new CellRangeAddress(repeatCell.getCurrent() + rowIndex, i + rowIndex - 1, colNum, colNum)); + } + map.put(field, new RepeatCell(val, i)); + } else if (i == list.size() - 1) { + if (i > repeatCell.getCurrent() && isMerge(list, i, field)) { + cellList.add(new CellRangeAddress(repeatCell.getCurrent() + rowIndex, i + rowIndex, colNum, colNum)); + } + } + } + } + } + return cellList; + } + + private boolean isMerge(List list, int i, Field field) { + boolean isMerge = true; + CellMerge cm = field.getAnnotation(CellMerge.class); + final String[] mergeBy = cm.mergeBy(); + if (StrUtil.isAllNotBlank(mergeBy)) { + //比对当前list(i)和list(i - 1)的各个属性值一一比对 如果全为真 则为真 + for (String fieldName : mergeBy) { + final Object valCurrent = ReflectUtil.getFieldValue(list.get(i), fieldName); + final Object valPre = ReflectUtil.getFieldValue(list.get(i - 1), fieldName); + if (!Objects.equals(valPre, valCurrent)) { + //依赖字段如有任一不等值,则标记为不可合并 + isMerge = false; + } + } + } + return isMerge; + } + + @Data + @AllArgsConstructor + static class RepeatCell { + + private Object value; + + private int current; + + } +} diff --git a/ruoyi-common/ruoyi-common-excel/src/main/java/com/ruoyi/common/excel/core/DefaultExcelListener.java b/ruoyi-common/ruoyi-common-excel/src/main/java/com/ruoyi/common/excel/core/DefaultExcelListener.java new file mode 100644 index 0000000..1cf6426 --- /dev/null +++ b/ruoyi-common/ruoyi-common-excel/src/main/java/com/ruoyi/common/excel/core/DefaultExcelListener.java @@ -0,0 +1,104 @@ +package com.ruoyi.common.excel.core; + +import cn.hutool.core.util.StrUtil; +import com.alibaba.excel.context.AnalysisContext; +import com.alibaba.excel.event.AnalysisEventListener; +import com.alibaba.excel.exception.ExcelAnalysisException; +import com.alibaba.excel.exception.ExcelDataConvertException; +import com.ruoyi.common.core.utils.StreamUtils; +import com.ruoyi.common.core.utils.ValidatorUtils; +import com.ruoyi.common.json.utils.JsonUtils; +import jakarta.validation.ConstraintViolation; +import jakarta.validation.ConstraintViolationException; +import lombok.NoArgsConstructor; +import lombok.extern.slf4j.Slf4j; + +import java.util.Map; +import java.util.Set; + +/** + * Excel 导入监听 + * + * @author Yjoioooo + * @author Lion Li + */ +@Slf4j +@NoArgsConstructor +public class DefaultExcelListener extends AnalysisEventListener implements ExcelListener { + + /** + * 是否Validator检验,默认为是 + */ + private Boolean isValidate = Boolean.TRUE; + + /** + * excel 表头数据 + */ + private Map headMap; + + /** + * 导入回执 + */ + private ExcelResult excelResult; + + public DefaultExcelListener(boolean isValidate) { + this.excelResult = new DefaultExcelResult<>(); + this.isValidate = isValidate; + } + + /** + * 处理异常 + * + * @param exception ExcelDataConvertException + * @param context Excel 上下文 + */ + @Override + public void onException(Exception exception, AnalysisContext context) throws Exception { + String errMsg = null; + if (exception instanceof ExcelDataConvertException excelDataConvertException) { + // 如果是某一个单元格的转换异常 能获取到具体行号 + Integer rowIndex = excelDataConvertException.getRowIndex(); + Integer columnIndex = excelDataConvertException.getColumnIndex(); + errMsg = StrUtil.format("第{}行-第{}列-表头{}: 解析异常
", + rowIndex + 1, columnIndex + 1, headMap.get(columnIndex)); + if (log.isDebugEnabled()) { + log.error(errMsg); + } + } + if (exception instanceof ConstraintViolationException constraintViolationException) { + Set> constraintViolations = constraintViolationException.getConstraintViolations(); + String constraintViolationsMsg = StreamUtils.join(constraintViolations, ConstraintViolation::getMessage, ", "); + errMsg = StrUtil.format("第{}行数据校验异常: {}", context.readRowHolder().getRowIndex() + 1, constraintViolationsMsg); + if (log.isDebugEnabled()) { + log.error(errMsg); + } + } + excelResult.getErrorList().add(errMsg); + throw new ExcelAnalysisException(errMsg); + } + + @Override + public void invokeHeadMap(Map headMap, AnalysisContext context) { + this.headMap = headMap; + log.debug("解析到一条表头数据: {}", JsonUtils.toJsonString(headMap)); + } + + @Override + public void invoke(T data, AnalysisContext context) { + if (isValidate) { + ValidatorUtils.validate(data); + } + excelResult.getList().add(data); + } + + @Override + public void doAfterAllAnalysed(AnalysisContext context) { + log.debug("所有数据解析完成!"); + } + + @Override + public ExcelResult getExcelResult() { + return excelResult; + } + +} diff --git a/ruoyi-common/ruoyi-common-excel/src/main/java/com/ruoyi/common/excel/core/DefaultExcelResult.java b/ruoyi-common/ruoyi-common-excel/src/main/java/com/ruoyi/common/excel/core/DefaultExcelResult.java new file mode 100644 index 0000000..e57b2a5 --- /dev/null +++ b/ruoyi-common/ruoyi-common-excel/src/main/java/com/ruoyi/common/excel/core/DefaultExcelResult.java @@ -0,0 +1,73 @@ +package com.ruoyi.common.excel.core; + +import cn.hutool.core.util.StrUtil; +import lombok.Setter; + +import java.util.ArrayList; +import java.util.List; + +/** + * 默认excel返回对象 + * + * @author Yjoioooo + * @author Lion Li + */ +public class DefaultExcelResult implements ExcelResult { + + /** + * 数据对象list + */ + @Setter + private List list; + + /** + * 错误信息列表 + */ + @Setter + private List errorList; + + public DefaultExcelResult() { + this.list = new ArrayList<>(); + this.errorList = new ArrayList<>(); + } + + public DefaultExcelResult(List list, List errorList) { + this.list = list; + this.errorList = errorList; + } + + public DefaultExcelResult(ExcelResult excelResult) { + this.list = excelResult.getList(); + this.errorList = excelResult.getErrorList(); + } + + @Override + public List getList() { + return list; + } + + @Override + public List getErrorList() { + return errorList; + } + + /** + * 获取导入回执 + * + * @return 导入回执 + */ + @Override + public String getAnalysis() { + int successCount = list.size(); + int errorCount = errorList.size(); + if (successCount == 0) { + return "读取失败,未解析到数据"; + } else { + if (errorCount == 0) { + return StrUtil.format("恭喜您,全部读取成功!共{}条", successCount); + } else { + return ""; + } + } + } +} diff --git a/ruoyi-common/ruoyi-common-excel/src/main/java/com/ruoyi/common/excel/core/DropDownOptions.java b/ruoyi-common/ruoyi-common-excel/src/main/java/com/ruoyi/common/excel/core/DropDownOptions.java new file mode 100644 index 0000000..1caf9bb --- /dev/null +++ b/ruoyi-common/ruoyi-common-excel/src/main/java/com/ruoyi/common/excel/core/DropDownOptions.java @@ -0,0 +1,149 @@ +package com.ruoyi.common.excel.core; + +import cn.hutool.core.util.StrUtil; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; +import com.ruoyi.common.core.exception.ServiceException; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.function.Function; +import java.util.stream.Collectors; + +/** + *

Excel下拉可选项

+ * 注意:为确保下拉框解析正确,传值务必使用createOptionValue()做为值的拼接 + * + * @author Emil.Zhang + */ +@Data +@AllArgsConstructor +@NoArgsConstructor +@SuppressWarnings("unused") +public class DropDownOptions { + /** + * 一级下拉所在列index,从0开始算 + */ + private int index = 0; + /** + * 二级下拉所在的index,从0开始算,不能与一级相同 + */ + private int nextIndex = 0; + /** + * 一级下拉所包含的数据 + */ + private List options = new ArrayList<>(); + /** + * 二级下拉所包含的数据Map + *

以每一个一级选项值为Key,每个一级选项对应的二级数据为Value

+ */ + private Map> nextOptions = new HashMap<>(); + /** + * 分隔符 + */ + private static final String DELIMITER = "_"; + + /** + * 创建只有一级的下拉选 + */ + public DropDownOptions(int index, List options) { + this.index = index; + this.options = options; + } + + /** + *

创建每个选项可选值

+ *

注意:不能以数字,特殊符号开头,选项中不可以包含任何运算符号

+ * + * @param vars 可选值内包含的参数 + * @return 合规的可选值 + */ + public static String createOptionValue(Object... vars) { + StringBuilder stringBuffer = new StringBuilder(); + String regex = "^[\\S\\d\\u4e00-\\u9fa5]+$"; + for (int i = 0; i < vars.length; i++) { + String var = StrUtil.trimToEmpty(String.valueOf(vars[i])); + if (!var.matches(regex)) { + throw new ServiceException("选项数据不符合规则,仅允许使用中英文字符以及数字"); + } + stringBuffer.append(var); + if (i < vars.length - 1) { + // 直至最后一个前,都以_作为切割线 + stringBuffer.append(DELIMITER); + } + } + if (stringBuffer.toString().matches("^\\d_*$")) { + throw new ServiceException("禁止以数字开头"); + } + return stringBuffer.toString(); + } + + /** + * 将处理后合理的可选值解析为原始的参数 + * + * @param option 经过处理后的合理的可选项 + * @return 原始的参数 + */ + public static List analyzeOptionValue(String option) { + return StrUtil.split(option, DELIMITER, true, true); + } + + /** + * 创建级联下拉选项 + * + * @param parentList 父实体可选项原始数据 + * @param parentIndex 父下拉选位置 + * @param sonList 子实体可选项原始数据 + * @param sonIndex 子下拉选位置 + * @param parentHowToGetIdFunction 父类如何获取唯一标识 + * @param sonHowToGetParentIdFunction 子类如何获取父类的唯一标识 + * @param howToBuildEveryOption 如何生成下拉选内容 + * @return 级联下拉选项 + */ + public static DropDownOptions buildLinkedOptions(List parentList, + int parentIndex, + List sonList, + int sonIndex, + Function parentHowToGetIdFunction, + Function sonHowToGetParentIdFunction, + Function howToBuildEveryOption) { + DropDownOptions parentLinkSonOptions = new DropDownOptions(); + // 先创建父类的下拉 + parentLinkSonOptions.setIndex(parentIndex); + parentLinkSonOptions.setOptions( + parentList.stream() + .map(howToBuildEveryOption) + .collect(Collectors.toList()) + ); + // 提取父-子级联下拉 + Map> sonOptions = new HashMap<>(); + // 父级依据自己的ID分组 + Map> parentGroupByIdMap = + parentList.stream().collect(Collectors.groupingBy(parentHowToGetIdFunction)); + // 遍历每个子集,提取到Map中 + sonList.forEach(everySon -> { + if (parentGroupByIdMap.containsKey(sonHowToGetParentIdFunction.apply(everySon))) { + // 找到对应的上级 + T parentObj = parentGroupByIdMap.get(sonHowToGetParentIdFunction.apply(everySon)).get(0); + // 提取名称和ID作为Key + String key = howToBuildEveryOption.apply(parentObj); + // Key对应的Value + List thisParentSonOptionList; + if (sonOptions.containsKey(key)) { + thisParentSonOptionList = sonOptions.get(key); + } else { + thisParentSonOptionList = new ArrayList<>(); + sonOptions.put(key, thisParentSonOptionList); + } + // 往Value中添加当前子集选项 + thisParentSonOptionList.add(howToBuildEveryOption.apply(everySon)); + } + }); + parentLinkSonOptions.setNextIndex(sonIndex); + parentLinkSonOptions.setNextOptions(sonOptions); + return parentLinkSonOptions; + } +} diff --git a/ruoyi-common/ruoyi-common-excel/src/main/java/com/ruoyi/common/excel/core/ExcelDownHandler.java b/ruoyi-common/ruoyi-common-excel/src/main/java/com/ruoyi/common/excel/core/ExcelDownHandler.java new file mode 100644 index 0000000..384d4e5 --- /dev/null +++ b/ruoyi-common/ruoyi-common-excel/src/main/java/com/ruoyi/common/excel/core/ExcelDownHandler.java @@ -0,0 +1,373 @@ +package com.ruoyi.common.excel.core; + +import cn.hutool.core.collection.CollUtil; +import cn.hutool.core.util.ArrayUtil; +import cn.hutool.core.util.EnumUtil; +import cn.hutool.core.util.ObjectUtil; +import cn.hutool.core.util.StrUtil; +import com.alibaba.excel.metadata.FieldCache; +import com.alibaba.excel.metadata.FieldWrapper; +import com.alibaba.excel.util.ClassUtils; +import com.alibaba.excel.write.handler.SheetWriteHandler; +import com.alibaba.excel.write.metadata.holder.WriteSheetHolder; +import com.alibaba.excel.write.metadata.holder.WriteWorkbookHolder; +import com.ruoyi.common.core.service.DictService; +import com.ruoyi.common.core.exception.ServiceException; +import com.ruoyi.common.core.utils.StreamUtils; +import com.ruoyi.common.core.utils.StringUtils; +import com.ruoyi.common.core.utils.SpringUtils; +import com.ruoyi.common.excel.annotation.ExcelDictFormat; +import com.ruoyi.common.excel.annotation.ExcelEnumFormat; +import lombok.extern.slf4j.Slf4j; +import org.apache.poi.ss.usermodel.*; +import org.apache.poi.ss.util.CellRangeAddressList; +import org.apache.poi.ss.util.WorkbookUtil; +import org.apache.poi.xssf.usermodel.XSSFDataValidation; + +import java.lang.reflect.Field; +import java.util.*; + +/** + *

Excel表格下拉选操作

+ * 考虑到下拉选过多可能导致Excel打开缓慢的问题,只校验前1000行 + *

+ * 即只有前1000行的数据可以用下拉框,超出的自行通过限制数据量的形式,第二次输出 + * + * @author Emil.Zhang + */ +@Slf4j +public class ExcelDownHandler implements SheetWriteHandler { + + /** + * Excel表格中的列名英文 + * 仅为了解析列英文,禁止修改 + */ + private static final String EXCEL_COLUMN_NAME = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"; + /** + * 单选数据Sheet名 + */ + private static final String OPTIONS_SHEET_NAME = "options"; + /** + * 联动选择数据Sheet名的头 + */ + private static final String LINKED_OPTIONS_SHEET_NAME = "linkedOptions"; + /** + * 下拉可选项 + */ + private final List dropDownOptions; + /** + * 当前单选进度 + */ + private int currentOptionsColumnIndex; + /** + * 当前联动选择进度 + */ + private int currentLinkedOptionsSheetIndex; + private final DictService dictService; + + public ExcelDownHandler(List options) { + this.dropDownOptions = options; + this.currentOptionsColumnIndex = 0; + this.currentLinkedOptionsSheetIndex = 0; + this.dictService = SpringUtils.getBean(DictService.class); + } + + /** + *

开始创建下拉数据

+ * 1.通过解析传入的@ExcelProperty同级是否标注有@DropDown选项 + * 如果有且设置了value值,则将其直接置为下拉可选项 + *

+ * 2.或者在调用ExcelUtil时指定了可选项,将依据传入的可选项做下拉 + *

+ * 3.二者并存,注意调用方式 + */ + @Override + public void afterSheetCreate(WriteWorkbookHolder writeWorkbookHolder, WriteSheetHolder writeSheetHolder) { + Sheet sheet = writeSheetHolder.getSheet(); + // 开始设置下拉框 HSSFWorkbook + DataValidationHelper helper = sheet.getDataValidationHelper(); + Workbook workbook = writeWorkbookHolder.getWorkbook(); + FieldCache fieldCache = ClassUtils.declaredFields(writeWorkbookHolder.getClazz(), writeWorkbookHolder); + for (Map.Entry entry : fieldCache.getSortedFieldMap().entrySet()) { + Integer index = entry.getKey(); + FieldWrapper wrapper = entry.getValue(); + Field field = wrapper.getField(); + // 循环实体中的每个属性 + // 可选的下拉值 + List options = new ArrayList<>(); + if (field.isAnnotationPresent(ExcelDictFormat.class)) { + // 如果指定了@ExcelDictFormat,则使用字典的逻辑 + ExcelDictFormat format = field.getDeclaredAnnotation(ExcelDictFormat.class); + String dictType = format.dictType(); + String converterExp = format.readConverterExp(); + if (StringUtils.isNotBlank(dictType)) { + // 如果传递了字典名,则依据字典建立下拉 + Collection values = Optional.ofNullable(dictService.getAllDictByDictType(dictType)) + .orElseThrow(() -> new ServiceException(String.format("字典 %s 不存在", dictType))) + .values(); + options = new ArrayList<>(values); + } else if (StringUtils.isNotBlank(converterExp)) { + // 如果指定了确切的值,则直接解析确切的值 + List strList = StringUtils.splitList(converterExp, format.separator()); + options = StreamUtils.toList(strList, s -> StringUtils.split(s, "=")[1]); + } + } else if (field.isAnnotationPresent(ExcelEnumFormat.class)) { + // 否则如果指定了@ExcelEnumFormat,则使用枚举的逻辑 + ExcelEnumFormat format = field.getDeclaredAnnotation(ExcelEnumFormat.class); + List values = EnumUtil.getFieldValues(format.enumClass(), format.textField()); + options = StreamUtils.toList(values, String::valueOf); + } + if (ObjectUtil.isNotEmpty(options)) { + // 仅当下拉可选项不为空时执行 + if (options.size() > 20) { + // 这里限制如果可选项大于20,则使用额外表形式 + dropDownWithSheet(helper, workbook, sheet, index, options); + } else { + // 否则使用固定值形式 + dropDownWithSimple(helper, sheet, index, options); + } + } + } + if (CollUtil.isEmpty(dropDownOptions)) { + return; + } + dropDownOptions.forEach(everyOptions -> { + // 如果传递了下拉框选择器参数 + if (!everyOptions.getNextOptions().isEmpty()) { + // 当二级选项不为空时,使用额外关联表的形式 + dropDownLinkedOptions(helper, workbook, sheet, everyOptions); + } else if (everyOptions.getOptions().size() > 10) { + // 当一级选项参数个数大于10,使用额外表的形式 + dropDownWithSheet(helper, workbook, sheet, everyOptions.getIndex(), everyOptions.getOptions()); + } else if (everyOptions.getOptions().size() != 0) { + // 当一级选项个数不为空,使用默认形式 + dropDownWithSimple(helper, sheet, everyOptions.getIndex(), everyOptions.getOptions()); + } + }); + } + + /** + *

简单下拉框

+ * 直接将可选项拼接为指定列的数据校验值 + * + * @param celIndex 列index + * @param value 下拉选可选值 + */ + private void dropDownWithSimple(DataValidationHelper helper, Sheet sheet, Integer celIndex, List value) { + if (ObjectUtil.isEmpty(value)) { + return; + } + this.markOptionsToSheet(helper, sheet, celIndex, helper.createExplicitListConstraint(ArrayUtil.toArray(value, String.class))); + } + + /** + *

额外表格形式的级联下拉框

+ * + * @param options 额外表格形式存储的下拉可选项 + */ + private void dropDownLinkedOptions(DataValidationHelper helper, Workbook workbook, Sheet sheet, DropDownOptions options) { + String linkedOptionsSheetName = String.format("%s_%d", LINKED_OPTIONS_SHEET_NAME, currentLinkedOptionsSheetIndex); + // 创建联动下拉数据表 + Sheet linkedOptionsDataSheet = workbook.createSheet(WorkbookUtil.createSafeSheetName(linkedOptionsSheetName)); + // 将下拉表隐藏 + workbook.setSheetHidden(workbook.getSheetIndex(linkedOptionsDataSheet), true); + // 完善横向的一级选项数据表 + List firstOptions = options.getOptions(); + Map> secoundOptionsMap = options.getNextOptions(); + + // 创建名称管理器 + Name name = workbook.createName(); + // 设置名称管理器的别名 + name.setNameName(linkedOptionsSheetName); + // 以横向第一行创建一级下拉拼接引用位置 + String firstOptionsFunction = String.format("%s!$%s$1:$%s$1", + linkedOptionsSheetName, + getExcelColumnName(0), + getExcelColumnName(firstOptions.size()) + ); + // 设置名称管理器的引用位置 + name.setRefersToFormula(firstOptionsFunction); + // 设置数据校验为序列模式,引用的是名称管理器中的别名 + this.markOptionsToSheet(helper, sheet, options.getIndex(), helper.createFormulaListConstraint(linkedOptionsSheetName)); + + for (int columIndex = 0; columIndex < firstOptions.size(); columIndex++) { + // 先提取主表中一级下拉的列名 + String firstOptionsColumnName = getExcelColumnName(columIndex); + // 一次循环是每一个一级选项 + int finalI = columIndex; + // 本次循环的一级选项值 + String thisFirstOptionsValue = firstOptions.get(columIndex); + // 创建第一行的数据 + Optional.ofNullable(linkedOptionsDataSheet.getRow(0)) + // 如果不存在则创建第一行 + .orElseGet(() -> linkedOptionsDataSheet.createRow(finalI)) + // 第一行当前列 + .createCell(columIndex) + // 设置值为当前一级选项值 + .setCellValue(thisFirstOptionsValue); + + // 第二行开始,设置第二级别选项参数 + List secondOptions = secoundOptionsMap.get(thisFirstOptionsValue); + if (CollUtil.isEmpty(secondOptions)) { + // 必须保证至少有一个关联选项,否则将导致Excel解析错误 + secondOptions = Collections.singletonList("暂无_0"); + } + + // 以该一级选项值创建子名称管理器 + Name sonName = workbook.createName(); + // 设置名称管理器的别名 + sonName.setNameName(thisFirstOptionsValue); + // 以第二行该列数据拼接引用位置 + String sonFunction = String.format("%s!$%s$2:$%s$%d", + linkedOptionsSheetName, + firstOptionsColumnName, + firstOptionsColumnName, + secondOptions.size() + 1 + ); + // 设置名称管理器的引用位置 + sonName.setRefersToFormula(sonFunction); + // 数据验证为序列模式,引用到每一个主表中的二级选项位置 + // 创建子项的名称管理器,只是为了使得Excel可以识别到数据 + String mainSheetFirstOptionsColumnName = getExcelColumnName(options.getIndex()); + for (int i = 0; i < 100; i++) { + // 以一级选项对应的主体所在位置创建二级下拉 + String secondOptionsFunction = String.format("=INDIRECT(%s%d)", mainSheetFirstOptionsColumnName, i + 1); + // 二级只能主表每一行的每一列添加二级校验 + markLinkedOptionsToSheet(helper, sheet, i, options.getNextIndex(), helper.createFormulaListConstraint(secondOptionsFunction)); + } + + for (int rowIndex = 0; rowIndex < secondOptions.size(); rowIndex++) { + // 从第二行开始填充二级选项 + int finalRowIndex = rowIndex + 1; + int finalColumIndex = columIndex; + + Row row = Optional.ofNullable(linkedOptionsDataSheet.getRow(finalRowIndex)) + // 没有则创建 + .orElseGet(() -> linkedOptionsDataSheet.createRow(finalRowIndex)); + Optional + // 在本级一级选项所在的列 + .ofNullable(row.getCell(finalColumIndex)) + // 不存在则创建 + .orElseGet(() -> row.createCell(finalColumIndex)) + // 设置二级选项值 + .setCellValue(secondOptions.get(rowIndex)); + } + } + + currentLinkedOptionsSheetIndex++; + } + + /** + *

额外表格形式的普通下拉框

+ * 由于下拉框可选值数量过多,为提升Excel打开效率,使用额外表格形式做下拉 + * + * @param celIndex 下拉选 + * @param value 下拉选可选值 + */ + private void dropDownWithSheet(DataValidationHelper helper, Workbook workbook, Sheet sheet, Integer celIndex, List value) { + // 创建下拉数据表 + Sheet simpleDataSheet = Optional.ofNullable(workbook.getSheet(WorkbookUtil.createSafeSheetName(OPTIONS_SHEET_NAME))) + .orElseGet(() -> workbook.createSheet(WorkbookUtil.createSafeSheetName(OPTIONS_SHEET_NAME))); + // 将下拉表隐藏 + workbook.setSheetHidden(workbook.getSheetIndex(simpleDataSheet), true); + // 完善纵向的一级选项数据表 + for (int i = 0; i < value.size(); i++) { + int finalI = i; + // 获取每一选项行,如果没有则创建 + Row row = Optional.ofNullable(simpleDataSheet.getRow(i)) + .orElseGet(() -> simpleDataSheet.createRow(finalI)); + // 获取本级选项对应的选项列,如果没有则创建 + Cell cell = Optional.ofNullable(row.getCell(currentOptionsColumnIndex)) + .orElseGet(() -> row.createCell(currentOptionsColumnIndex)); + // 设置值 + cell.setCellValue(value.get(i)); + } + + // 创建名称管理器 + Name name = workbook.createName(); + // 设置名称管理器的别名 + String nameName = String.format("%s_%d", OPTIONS_SHEET_NAME, celIndex); + name.setNameName(nameName); + // 以纵向第一列创建一级下拉拼接引用位置 + String function = String.format("%s!$%s$1:$%s$%d", + OPTIONS_SHEET_NAME, + getExcelColumnName(currentOptionsColumnIndex), + getExcelColumnName(currentOptionsColumnIndex), + value.size()); + // 设置名称管理器的引用位置 + name.setRefersToFormula(function); + // 设置数据校验为序列模式,引用的是名称管理器中的别名 + this.markOptionsToSheet(helper, sheet, celIndex, helper.createFormulaListConstraint(nameName)); + currentOptionsColumnIndex++; + } + + /** + * 挂载下拉的列,仅限一级选项 + */ + private void markOptionsToSheet(DataValidationHelper helper, Sheet sheet, Integer celIndex, + DataValidationConstraint constraint) { + // 设置数据有效性加载在哪个单元格上,四个参数分别是:起始行、终止行、起始列、终止列 + CellRangeAddressList addressList = new CellRangeAddressList(1, 1000, celIndex, celIndex); + markDataValidationToSheet(helper, sheet, constraint, addressList); + } + + /** + * 挂载下拉的列,仅限二级选项 + */ + private void markLinkedOptionsToSheet(DataValidationHelper helper, Sheet sheet, Integer rowIndex, + Integer celIndex, DataValidationConstraint constraint) { + // 设置数据有效性加载在哪个单元格上,四个参数分别是:起始行、终止行、起始列、终止列 + CellRangeAddressList addressList = new CellRangeAddressList(rowIndex, rowIndex, celIndex, celIndex); + markDataValidationToSheet(helper, sheet, constraint, addressList); + } + + /** + * 应用数据校验 + */ + private void markDataValidationToSheet(DataValidationHelper helper, Sheet sheet, + DataValidationConstraint constraint, CellRangeAddressList addressList) { + // 数据有效性对象 + DataValidation dataValidation = helper.createValidation(constraint, addressList); + // 处理Excel兼容性问题 + if (dataValidation instanceof XSSFDataValidation) { + //数据校验 + dataValidation.setSuppressDropDownArrow(true); + //错误提示 + dataValidation.setErrorStyle(DataValidation.ErrorStyle.STOP); + dataValidation.createErrorBox("提示", "此值与单元格定义数据不一致"); + dataValidation.setShowErrorBox(true); + //选定提示 + dataValidation.createPromptBox("填写说明:", "填写内容只能为下拉中数据,其他数据将导致导入失败"); + dataValidation.setShowPromptBox(true); + sheet.addValidationData(dataValidation); + } else { + dataValidation.setSuppressDropDownArrow(false); + } + sheet.addValidationData(dataValidation); + } + + /** + *

依据列index获取列名英文

+ * 依据列index转换为Excel中的列名英文 + *

例如第1列,index为0,解析出来为A列

+ * 第27列,index为26,解析为AA列 + *

第28列,index为27,解析为AB列

+ * + * @param columnIndex 列index + * @return 列index所在得英文名 + */ + private String getExcelColumnName(int columnIndex) { + // 26一循环的次数 + int columnCircleCount = columnIndex / 26; + // 26一循环内的位置 + int thisCircleColumnIndex = columnIndex % 26; + // 26一循环的次数大于0,则视为栏名至少两位 + String columnPrefix = columnCircleCount == 0 + ? StrUtil.EMPTY + : StrUtil.subWithLength(EXCEL_COLUMN_NAME, columnCircleCount - 1, 1); + // 从26一循环内取对应的栏位名 + String columnNext = StrUtil.subWithLength(EXCEL_COLUMN_NAME, thisCircleColumnIndex, 1); + // 将二者拼接即为最终的栏位名 + return columnPrefix + columnNext; + } +} diff --git a/ruoyi-common/ruoyi-common-excel/src/main/java/com/ruoyi/common/excel/core/ExcelListener.java b/ruoyi-common/ruoyi-common-excel/src/main/java/com/ruoyi/common/excel/core/ExcelListener.java new file mode 100644 index 0000000..093b94f --- /dev/null +++ b/ruoyi-common/ruoyi-common-excel/src/main/java/com/ruoyi/common/excel/core/ExcelListener.java @@ -0,0 +1,14 @@ +package com.ruoyi.common.excel.core; + +import com.alibaba.excel.read.listener.ReadListener; + +/** + * Excel 导入监听 + * + * @author Lion Li + */ +public interface ExcelListener extends ReadListener { + + ExcelResult getExcelResult(); + +} diff --git a/ruoyi-common/ruoyi-common-excel/src/main/java/com/ruoyi/common/excel/core/ExcelResult.java b/ruoyi-common/ruoyi-common-excel/src/main/java/com/ruoyi/common/excel/core/ExcelResult.java new file mode 100644 index 0000000..81aab5d --- /dev/null +++ b/ruoyi-common/ruoyi-common-excel/src/main/java/com/ruoyi/common/excel/core/ExcelResult.java @@ -0,0 +1,26 @@ +package com.ruoyi.common.excel.core; + +import java.util.List; + +/** + * excel返回对象 + * + * @author Lion Li + */ +public interface ExcelResult { + + /** + * 对象列表 + */ + List getList(); + + /** + * 错误列表 + */ + List getErrorList(); + + /** + * 导入回执 + */ + String getAnalysis(); +} diff --git a/ruoyi-common/ruoyi-common-excel/src/main/java/com/ruoyi/common/excel/utils/ExcelUtil.java b/ruoyi-common/ruoyi-common-excel/src/main/java/com/ruoyi/common/excel/utils/ExcelUtil.java new file mode 100644 index 0000000..cc24749 --- /dev/null +++ b/ruoyi-common/ruoyi-common-excel/src/main/java/com/ruoyi/common/excel/utils/ExcelUtil.java @@ -0,0 +1,436 @@ +package com.ruoyi.common.excel.utils; + +import cn.hutool.core.collection.CollUtil; +import cn.hutool.core.io.resource.ClassPathResource; +import cn.hutool.core.util.IdUtil; +import com.alibaba.excel.EasyExcel; +import com.alibaba.excel.ExcelWriter; +import com.alibaba.excel.write.builder.ExcelWriterSheetBuilder; +import com.alibaba.excel.write.metadata.WriteSheet; +import com.alibaba.excel.write.metadata.fill.FillConfig; +import com.alibaba.excel.write.metadata.fill.FillWrapper; +import com.alibaba.excel.write.style.column.LongestMatchColumnWidthStyleStrategy; +import jakarta.servlet.ServletOutputStream; +import jakarta.servlet.http.HttpServletResponse; +import lombok.AccessLevel; +import lombok.NoArgsConstructor; +import com.ruoyi.common.core.utils.StringUtils; +import com.ruoyi.common.core.utils.file.FileUtils; +import com.ruoyi.common.excel.convert.ExcelBigNumberConvert; +import com.ruoyi.common.excel.core.*; + +import java.io.IOException; +import java.io.InputStream; +import java.io.OutputStream; +import java.io.UnsupportedEncodingException; +import java.util.Collection; +import java.util.List; +import java.util.Map; + +/** + * Excel相关处理 + * + * @author Lion Li + */ +@NoArgsConstructor(access = AccessLevel.PRIVATE) +public class ExcelUtil { + + /** + * 同步导入(适用于小数据量) + * + * @param is 输入流 + * @return 转换后集合 + */ + public static List importExcel(InputStream is, Class clazz) { + return EasyExcel.read(is).head(clazz).autoCloseStream(false).sheet().doReadSync(); + } + + + /** + * 使用校验监听器 异步导入 同步返回 + * + * @param is 输入流 + * @param clazz 对象类型 + * @param isValidate 是否 Validator 检验 默认为是 + * @return 转换后集合 + */ + public static ExcelResult importExcel(InputStream is, Class clazz, boolean isValidate) { + DefaultExcelListener listener = new DefaultExcelListener<>(isValidate); + EasyExcel.read(is, clazz, listener).sheet().doRead(); + return listener.getExcelResult(); + } + + /** + * 使用自定义监听器 异步导入 自定义返回 + * + * @param is 输入流 + * @param clazz 对象类型 + * @param listener 自定义监听器 + * @return 转换后集合 + */ + public static ExcelResult importExcel(InputStream is, Class clazz, ExcelListener listener) { + EasyExcel.read(is, clazz, listener).sheet().doRead(); + return listener.getExcelResult(); + } + + /** + * 导出excel + * + * @param list 导出数据集合 + * @param sheetName 工作表的名称 + * @param clazz 实体类 + * @param response 响应体 + */ + public static void exportExcel(List list, String sheetName, Class clazz, HttpServletResponse response) { + try { + resetResponse(sheetName, response); + ServletOutputStream os = response.getOutputStream(); + exportExcel(list, sheetName, clazz, false, os, null); + } catch (IOException e) { + throw new RuntimeException("导出Excel异常"); + } + } + + /** + * 导出excel + * + * @param list 导出数据集合 + * @param sheetName 工作表的名称 + * @param clazz 实体类 + * @param response 响应体 + * @param options 级联下拉选 + */ + public static void exportExcel(List list, String sheetName, Class clazz, HttpServletResponse response, List options) { + try { + resetResponse(sheetName, response); + ServletOutputStream os = response.getOutputStream(); + exportExcel(list, sheetName, clazz, false, os, options); + } catch (IOException e) { + throw new RuntimeException("导出Excel异常"); + } + } + + /** + * 导出excel + * + * @param list 导出数据集合 + * @param sheetName 工作表的名称 + * @param clazz 实体类 + * @param merge 是否合并单元格 + * @param response 响应体 + */ + public static void exportExcel(List list, String sheetName, Class clazz, boolean merge, HttpServletResponse response) { + try { + resetResponse(sheetName, response); + ServletOutputStream os = response.getOutputStream(); + exportExcel(list, sheetName, clazz, merge, os, null); + } catch (IOException e) { + throw new RuntimeException("导出Excel异常"); + } + } + + /** + * 导出excel + * + * @param list 导出数据集合 + * @param sheetName 工作表的名称 + * @param clazz 实体类 + * @param merge 是否合并单元格 + * @param response 响应体 + * @param options 级联下拉选 + */ + public static void exportExcel(List list, String sheetName, Class clazz, boolean merge, HttpServletResponse response, List options) { + try { + resetResponse(sheetName, response); + ServletOutputStream os = response.getOutputStream(); + exportExcel(list, sheetName, clazz, merge, os, options); + } catch (IOException e) { + throw new RuntimeException("导出Excel异常"); + } + } + + /** + * 导出excel + * + * @param list 导出数据集合 + * @param sheetName 工作表的名称 + * @param clazz 实体类 + * @param os 输出流 + */ + public static void exportExcel(List list, String sheetName, Class clazz, OutputStream os) { + exportExcel(list, sheetName, clazz, false, os, null); + } + + /** + * 导出excel + * + * @param list 导出数据集合 + * @param sheetName 工作表的名称 + * @param clazz 实体类 + * @param os 输出流 + * @param options 级联下拉选内容 + */ + public static void exportExcel(List list, String sheetName, Class clazz, OutputStream os, List options) { + exportExcel(list, sheetName, clazz, false, os, options); + } + + /** + * 导出excel + * + * @param list 导出数据集合 + * @param sheetName 工作表的名称 + * @param clazz 实体类 + * @param merge 是否合并单元格 + * @param os 输出流 + */ + public static void exportExcel(List list, String sheetName, Class clazz, boolean merge, + OutputStream os, List options) { + ExcelWriterSheetBuilder builder = EasyExcel.write(os, clazz) + .autoCloseStream(false) + // 自动适配 + .registerWriteHandler(new LongestMatchColumnWidthStyleStrategy()) + // 大数值自动转换 防止失真 + .registerConverter(new ExcelBigNumberConvert()) + .sheet(sheetName); + if (merge) { + // 合并处理器 + builder.registerWriteHandler(new CellMergeStrategy(list, true)); + } + // 添加下拉框操作 + builder.registerWriteHandler(new ExcelDownHandler(options)); + builder.doWrite(list); + } + + /** + * 单表多数据模板导出 模板格式为 {.属性} + * + * @param filename 文件名 + * @param templatePath 模板路径 resource 目录下的路径包括模板文件名 + * 例如: excel/temp.xlsx + * 重点: 模板文件必须放置到启动类对应的 resource 目录下 + * @param data 模板需要的数据 + * @param response 响应体 + */ + public static void exportTemplate(List data, String filename, String templatePath, HttpServletResponse response) { + try { + resetResponse(filename, response); + ServletOutputStream os = response.getOutputStream(); + exportTemplate(data, templatePath, os); + } catch (IOException e) { + throw new RuntimeException("导出Excel异常"); + } + } + + /** + * 单表多数据模板导出 模板格式为 {.属性} + * + * @param templatePath 模板路径 resource 目录下的路径包括模板文件名 + * 例如: excel/temp.xlsx + * 重点: 模板文件必须放置到启动类对应的 resource 目录下 + * @param data 模板需要的数据 + * @param os 输出流 + */ + public static void exportTemplate(List data, String templatePath, OutputStream os) { + ClassPathResource templateResource = new ClassPathResource(templatePath); + ExcelWriter excelWriter = EasyExcel.write(os) + .withTemplate(templateResource.getStream()) + .autoCloseStream(false) + // 大数值自动转换 防止失真 + .registerConverter(new ExcelBigNumberConvert()) + .build(); + WriteSheet writeSheet = EasyExcel.writerSheet().build(); + if (CollUtil.isEmpty(data)) { + throw new IllegalArgumentException("数据为空"); + } + // 单表多数据导出 模板格式为 {.属性} + for (Object d : data) { + excelWriter.fill(d, writeSheet); + } + excelWriter.finish(); + } + + /** + * 多表多数据模板导出 模板格式为 {key.属性} + * + * @param filename 文件名 + * @param templatePath 模板路径 resource 目录下的路径包括模板文件名 + * 例如: excel/temp.xlsx + * 重点: 模板文件必须放置到启动类对应的 resource 目录下 + * @param data 模板需要的数据 + * @param response 响应体 + */ + public static void exportTemplateMultiList(Map data, String filename, String templatePath, HttpServletResponse response) { + try { + resetResponse(filename, response); + ServletOutputStream os = response.getOutputStream(); + exportTemplateMultiList(data, templatePath, os); + } catch (IOException e) { + throw new RuntimeException("导出Excel异常"); + } + } + + /** + * 多sheet模板导出 模板格式为 {key.属性} + * + * @param filename 文件名 + * @param templatePath 模板路径 resource 目录下的路径包括模板文件名 + * 例如: excel/temp.xlsx + * 重点: 模板文件必须放置到启动类对应的 resource 目录下 + * @param data 模板需要的数据 + * @param response 响应体 + */ + public static void exportTemplateMultiSheet(List> data, String filename, String templatePath, HttpServletResponse response) { + try { + resetResponse(filename, response); + ServletOutputStream os = response.getOutputStream(); + exportTemplateMultiSheet(data, templatePath, os); + } catch (IOException e) { + throw new RuntimeException("导出Excel异常"); + } + } + + /** + * 多表多数据模板导出 模板格式为 {key.属性} + * + * @param templatePath 模板路径 resource 目录下的路径包括模板文件名 + * 例如: excel/temp.xlsx + * 重点: 模板文件必须放置到启动类对应的 resource 目录下 + * @param data 模板需要的数据 + * @param os 输出流 + */ + public static void exportTemplateMultiList(Map data, String templatePath, OutputStream os) { + ClassPathResource templateResource = new ClassPathResource(templatePath); + ExcelWriter excelWriter = EasyExcel.write(os) + .withTemplate(templateResource.getStream()) + .autoCloseStream(false) + // 大数值自动转换 防止失真 + .registerConverter(new ExcelBigNumberConvert()) + .build(); + WriteSheet writeSheet = EasyExcel.writerSheet().build(); + if (CollUtil.isEmpty(data)) { + throw new IllegalArgumentException("数据为空"); + } + for (Map.Entry map : data.entrySet()) { + // 设置列表后续还有数据 + FillConfig fillConfig = FillConfig.builder().forceNewRow(Boolean.TRUE).build(); + if (map.getValue() instanceof Collection) { + // 多表导出必须使用 FillWrapper + excelWriter.fill(new FillWrapper(map.getKey(), (Collection) map.getValue()), fillConfig, writeSheet); + } else { + excelWriter.fill(map.getValue(), writeSheet); + } + } + excelWriter.finish(); + } + + /** + * 多sheet模板导出 模板格式为 {key.属性} + * + * @param templatePath 模板路径 resource 目录下的路径包括模板文件名 + * 例如: excel/temp.xlsx + * 重点: 模板文件必须放置到启动类对应的 resource 目录下 + * @param data 模板需要的数据 + * @param os 输出流 + */ + public static void exportTemplateMultiSheet(List> data, String templatePath, OutputStream os) { + ClassPathResource templateResource = new ClassPathResource(templatePath); + ExcelWriter excelWriter = EasyExcel.write(os) + .withTemplate(templateResource.getStream()) + .autoCloseStream(false) + // 大数值自动转换 防止失真 + .registerConverter(new ExcelBigNumberConvert()) + .build(); + if (CollUtil.isEmpty(data)) { + throw new IllegalArgumentException("数据为空"); + } + for (int i = 0; i < data.size(); i++) { + WriteSheet writeSheet = EasyExcel.writerSheet(i).build(); + for (Map.Entry map : data.get(i).entrySet()) { + // 设置列表后续还有数据 + FillConfig fillConfig = FillConfig.builder().forceNewRow(Boolean.TRUE).build(); + if (map.getValue() instanceof Collection) { + // 多表导出必须使用 FillWrapper + excelWriter.fill(new FillWrapper(map.getKey(), (Collection) map.getValue()), fillConfig, writeSheet); + } else { + excelWriter.fill(map.getValue(), writeSheet); + } + } + } + excelWriter.finish(); + } + + /** + * 重置响应体 + */ + private static void resetResponse(String sheetName, HttpServletResponse response) throws UnsupportedEncodingException { + String filename = encodingFilename(sheetName); + FileUtils.setAttachmentResponseHeader(response, filename); + response.setContentType("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;charset=UTF-8"); + } + + /** + * 解析导出值 0=男,1=女,2=未知 + * + * @param propertyValue 参数值 + * @param converterExp 翻译注解 + * @param separator 分隔符 + * @return 解析后值 + */ + public static String convertByExp(String propertyValue, String converterExp, String separator) { + StringBuilder propertyString = new StringBuilder(); + String[] convertSource = converterExp.split(StringUtils.SEPARATOR); + for (String item : convertSource) { + String[] itemArray = item.split("="); + if (StringUtils.containsAny(propertyValue, separator)) { + for (String value : propertyValue.split(separator)) { + if (itemArray[0].equals(value)) { + propertyString.append(itemArray[1] + separator); + break; + } + } + } else { + if (itemArray[0].equals(propertyValue)) { + return itemArray[1]; + } + } + } + return StringUtils.stripEnd(propertyString.toString(), separator); + } + + /** + * 反向解析值 男=0,女=1,未知=2 + * + * @param propertyValue 参数值 + * @param converterExp 翻译注解 + * @param separator 分隔符 + * @return 解析后值 + */ + public static String reverseByExp(String propertyValue, String converterExp, String separator) { + StringBuilder propertyString = new StringBuilder(); + String[] convertSource = converterExp.split(StringUtils.SEPARATOR); + for (String item : convertSource) { + String[] itemArray = item.split("="); + if (StringUtils.containsAny(propertyValue, separator)) { + for (String value : propertyValue.split(separator)) { + if (itemArray[1].equals(value)) { + propertyString.append(itemArray[0] + separator); + break; + } + } + } else { + if (itemArray[1].equals(propertyValue)) { + return itemArray[0]; + } + } + } + return StringUtils.stripEnd(propertyString.toString(), separator); + } + + /** + * 编码文件名 + */ + public static String encodingFilename(String filename) { + return IdUtil.fastSimpleUUID() + "_" + filename + ".xlsx"; + } + +} diff --git a/ruoyi-common/ruoyi-common-idempotent/pom.xml b/ruoyi-common/ruoyi-common-idempotent/pom.xml new file mode 100644 index 0000000..c5b459d --- /dev/null +++ b/ruoyi-common/ruoyi-common-idempotent/pom.xml @@ -0,0 +1,41 @@ + + + + com.ruoyi + ruoyi-common + ${revision} + + 4.0.0 + + ruoyi-common-idempotent + + + ruoyi-common-idempotent 幂等功能 + + + + + com.ruoyi + ruoyi-common-json + + + + com.ruoyi + ruoyi-common-redis + + + + cn.hutool + hutool-crypto + + + + cn.dev33 + sa-token-core + + + + + diff --git a/ruoyi-common/ruoyi-common-idempotent/src/main/java/com/ruoyi/common/idempotent/annotation/RepeatSubmit.java b/ruoyi-common/ruoyi-common-idempotent/src/main/java/com/ruoyi/common/idempotent/annotation/RepeatSubmit.java new file mode 100644 index 0000000..8801e49 --- /dev/null +++ b/ruoyi-common/ruoyi-common-idempotent/src/main/java/com/ruoyi/common/idempotent/annotation/RepeatSubmit.java @@ -0,0 +1,29 @@ +package com.ruoyi.common.idempotent.annotation; + +import java.lang.annotation.*; +import java.util.concurrent.TimeUnit; + +/** + * 自定义注解防止表单重复提交 + * + * @author Lion Li + */ +@Inherited +@Target(ElementType.METHOD) +@Retention(RetentionPolicy.RUNTIME) +@Documented +public @interface RepeatSubmit { + + /** + * 间隔时间(ms),小于此时间视为重复提交 + */ + int interval() default 5000; + + TimeUnit timeUnit() default TimeUnit.MILLISECONDS; + + /** + * 提示消息 支持国际化 格式为 {code} + */ + String message() default "{repeat.submit.message}"; + +} diff --git a/ruoyi-common/ruoyi-common-idempotent/src/main/java/com/ruoyi/common/idempotent/aspectj/RepeatSubmitAspect.java b/ruoyi-common/ruoyi-common-idempotent/src/main/java/com/ruoyi/common/idempotent/aspectj/RepeatSubmitAspect.java new file mode 100644 index 0000000..40cf25a --- /dev/null +++ b/ruoyi-common/ruoyi-common-idempotent/src/main/java/com/ruoyi/common/idempotent/aspectj/RepeatSubmitAspect.java @@ -0,0 +1,146 @@ +package com.ruoyi.common.idempotent.aspectj; + +import cn.dev33.satoken.SaManager; +import cn.hutool.core.util.ArrayUtil; +import cn.hutool.core.util.ObjectUtil; +import cn.hutool.crypto.SecureUtil; +import jakarta.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletResponse; +import org.aspectj.lang.JoinPoint; +import org.aspectj.lang.annotation.AfterReturning; +import org.aspectj.lang.annotation.AfterThrowing; +import org.aspectj.lang.annotation.Aspect; +import org.aspectj.lang.annotation.Before; +import com.ruoyi.common.core.constant.GlobalConstants; +import com.ruoyi.common.core.domain.R; +import com.ruoyi.common.core.exception.ServiceException; +import com.ruoyi.common.core.utils.MessageUtils; +import com.ruoyi.common.core.utils.ServletUtils; +import com.ruoyi.common.core.utils.StringUtils; +import com.ruoyi.common.idempotent.annotation.RepeatSubmit; +import com.ruoyi.common.json.utils.JsonUtils; +import com.ruoyi.common.redis.utils.RedisUtils; +import org.springframework.validation.BindingResult; +import org.springframework.web.multipart.MultipartFile; + +import java.time.Duration; +import java.util.Collection; +import java.util.Map; +import java.util.StringJoiner; + +/** + * 防止重复提交(参考美团GTIS防重系统) + * + * @author Lion Li + */ +@Aspect +public class RepeatSubmitAspect { + + private static final ThreadLocal KEY_CACHE = new ThreadLocal<>(); + + @Before("@annotation(repeatSubmit)") + public void doBefore(JoinPoint point, RepeatSubmit repeatSubmit) throws Throwable { + // 如果注解不为0 则使用注解数值 + long interval = repeatSubmit.timeUnit().toMillis(repeatSubmit.interval()); + + if (interval < 1000) { + throw new ServiceException("重复提交间隔时间不能小于'1'秒"); + } + HttpServletRequest request = ServletUtils.getRequest(); + String nowParams = argsArrayToString(point.getArgs()); + + // 请求地址(作为存放cache的key值) + String url = request.getRequestURI(); + + // 唯一值(没有消息头则使用请求地址) + String submitKey = StringUtils.trimToEmpty(request.getHeader(SaManager.getConfig().getTokenName())); + + submitKey = SecureUtil.md5(submitKey + ":" + nowParams); + // 唯一标识(指定key + url + 消息头) + String cacheRepeatKey = GlobalConstants.REPEAT_SUBMIT_KEY + url + submitKey; + if (RedisUtils.setObjectIfAbsent(cacheRepeatKey, "", Duration.ofMillis(interval))) { + KEY_CACHE.set(cacheRepeatKey); + } else { + String message = repeatSubmit.message(); + if (StringUtils.startsWith(message, "{") && StringUtils.endsWith(message, "}")) { + message = MessageUtils.message(StringUtils.substring(message, 1, message.length() - 1)); + } + throw new ServiceException(message); + } + } + + /** + * 处理完请求后执行 + * + * @param joinPoint 切点 + */ + @AfterReturning(pointcut = "@annotation(repeatSubmit)", returning = "jsonResult") + public void doAfterReturning(JoinPoint joinPoint, RepeatSubmit repeatSubmit, Object jsonResult) { + if (jsonResult instanceof R r) { + try { + // 成功则不删除redis数据 保证在有效时间内无法重复提交 + if (r.getCode() == R.SUCCESS) { + return; + } + RedisUtils.deleteObject(KEY_CACHE.get()); + } finally { + KEY_CACHE.remove(); + } + } + } + + /** + * 拦截异常操作 + * + * @param joinPoint 切点 + * @param e 异常 + */ + @AfterThrowing(value = "@annotation(repeatSubmit)", throwing = "e") + public void doAfterThrowing(JoinPoint joinPoint, RepeatSubmit repeatSubmit, Exception e) { + RedisUtils.deleteObject(KEY_CACHE.get()); + KEY_CACHE.remove(); + } + + /** + * 参数拼装 + */ + private String argsArrayToString(Object[] paramsArray) { + StringJoiner params = new StringJoiner(" "); + if (ArrayUtil.isEmpty(paramsArray)) { + return params.toString(); + } + for (Object o : paramsArray) { + if (ObjectUtil.isNotNull(o) && !isFilterObject(o)) { + params.add(JsonUtils.toJsonString(o)); + } + } + return params.toString(); + } + + /** + * 判断是否需要过滤的对象。 + * + * @param o 对象信息。 + * @return 如果是需要过滤的对象,则返回true;否则返回false。 + */ + @SuppressWarnings("rawtypes") + public boolean isFilterObject(final Object o) { + Class clazz = o.getClass(); + if (clazz.isArray()) { + return MultipartFile.class.isAssignableFrom(clazz.getComponentType()); + } else if (Collection.class.isAssignableFrom(clazz)) { + Collection collection = (Collection) o; + for (Object value : collection) { + return value instanceof MultipartFile; + } + } else if (Map.class.isAssignableFrom(clazz)) { + Map map = (Map) o; + for (Object value : map.values()) { + return value instanceof MultipartFile; + } + } + return o instanceof MultipartFile || o instanceof HttpServletRequest || o instanceof HttpServletResponse + || o instanceof BindingResult; + } + +} diff --git a/ruoyi-common/ruoyi-common-idempotent/src/main/java/com/ruoyi/common/idempotent/config/IdempotentConfig.java b/ruoyi-common/ruoyi-common-idempotent/src/main/java/com/ruoyi/common/idempotent/config/IdempotentConfig.java new file mode 100644 index 0000000..79f8d14 --- /dev/null +++ b/ruoyi-common/ruoyi-common-idempotent/src/main/java/com/ruoyi/common/idempotent/config/IdempotentConfig.java @@ -0,0 +1,21 @@ +package com.ruoyi.common.idempotent.config; + +import com.ruoyi.common.idempotent.aspectj.RepeatSubmitAspect; +import org.springframework.boot.autoconfigure.AutoConfiguration; +import org.springframework.context.annotation.Bean; +import org.springframework.data.redis.connection.RedisConfiguration; + +/** + * 幂等功能配置 + * + * @author Lion Li + */ +@AutoConfiguration(after = RedisConfiguration.class) +public class IdempotentConfig { + + @Bean + public RepeatSubmitAspect repeatSubmitAspect() { + return new RepeatSubmitAspect(); + } + +} diff --git a/ruoyi-common/ruoyi-common-idempotent/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports b/ruoyi-common/ruoyi-common-idempotent/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports new file mode 100644 index 0000000..3541517 --- /dev/null +++ b/ruoyi-common/ruoyi-common-idempotent/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports @@ -0,0 +1 @@ +com.ruoyi.common.idempotent.config.IdempotentConfig diff --git a/ruoyi-common/ruoyi-common-json/pom.xml b/ruoyi-common/ruoyi-common-json/pom.xml new file mode 100644 index 0000000..5491e3a --- /dev/null +++ b/ruoyi-common/ruoyi-common-json/pom.xml @@ -0,0 +1,37 @@ + + + + com.ruoyi + ruoyi-common + ${revision} + + 4.0.0 + + ruoyi-common-json + + + ruoyi-common-json 序列化模块 + + + + + com.ruoyi + ruoyi-common-core + + + + + com.fasterxml.jackson.core + jackson-databind + + + + com.fasterxml.jackson.datatype + jackson-datatype-jsr310 + + + + + diff --git a/ruoyi-common/ruoyi-common-json/src/main/java/com/ruoyi/common/json/config/JacksonConfig.java b/ruoyi-common/ruoyi-common-json/src/main/java/com/ruoyi/common/json/config/JacksonConfig.java new file mode 100644 index 0000000..6b09b47 --- /dev/null +++ b/ruoyi-common/ruoyi-common-json/src/main/java/com/ruoyi/common/json/config/JacksonConfig.java @@ -0,0 +1,47 @@ +package com.ruoyi.common.json.config; + +import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; +import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule; +import com.fasterxml.jackson.datatype.jsr310.deser.LocalDateTimeDeserializer; +import com.fasterxml.jackson.datatype.jsr310.ser.LocalDateTimeSerializer; +import com.ruoyi.common.json.handler.BigNumberSerializer; +import lombok.extern.slf4j.Slf4j; +import org.springframework.boot.autoconfigure.AutoConfiguration; +import org.springframework.boot.autoconfigure.jackson.Jackson2ObjectMapperBuilderCustomizer; +import org.springframework.boot.autoconfigure.jackson.JacksonAutoConfiguration; +import org.springframework.context.annotation.Bean; + +import java.math.BigDecimal; +import java.math.BigInteger; +import java.time.LocalDateTime; +import java.time.format.DateTimeFormatter; +import java.util.TimeZone; + +/** + * jackson 配置 + * + * @author Lion Li + */ +@Slf4j +@AutoConfiguration(before = JacksonAutoConfiguration.class) +public class JacksonConfig { + + @Bean + public Jackson2ObjectMapperBuilderCustomizer customizer() { + return builder -> { + // 全局配置序列化返回 JSON 处理 + JavaTimeModule javaTimeModule = new JavaTimeModule(); + javaTimeModule.addSerializer(Long.class, BigNumberSerializer.INSTANCE); + javaTimeModule.addSerializer(Long.TYPE, BigNumberSerializer.INSTANCE); + javaTimeModule.addSerializer(BigInteger.class, BigNumberSerializer.INSTANCE); + javaTimeModule.addSerializer(BigDecimal.class, ToStringSerializer.instance); + DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"); + javaTimeModule.addSerializer(LocalDateTime.class, new LocalDateTimeSerializer(formatter)); + javaTimeModule.addDeserializer(LocalDateTime.class, new LocalDateTimeDeserializer(formatter)); + builder.modules(javaTimeModule); + builder.timeZone(TimeZone.getDefault()); + log.info("初始化 jackson 配置"); + }; + } + +} diff --git a/ruoyi-common/ruoyi-common-json/src/main/java/com/ruoyi/common/json/handler/BigNumberSerializer.java b/ruoyi-common/ruoyi-common-json/src/main/java/com/ruoyi/common/json/handler/BigNumberSerializer.java new file mode 100644 index 0000000..bb797b3 --- /dev/null +++ b/ruoyi-common/ruoyi-common-json/src/main/java/com/ruoyi/common/json/handler/BigNumberSerializer.java @@ -0,0 +1,42 @@ +package com.ruoyi.common.json.handler; + +import com.fasterxml.jackson.core.JsonGenerator; +import com.fasterxml.jackson.databind.SerializerProvider; +import com.fasterxml.jackson.databind.annotation.JacksonStdImpl; +import com.fasterxml.jackson.databind.ser.std.NumberSerializer; + +import java.io.IOException; + +/** + * 超出 JS 最大最小值 处理 + * + * @author Lion Li + */ +@JacksonStdImpl +public class BigNumberSerializer extends NumberSerializer { + + /** + * 根据 JS Number.MAX_SAFE_INTEGER 与 Number.MIN_SAFE_INTEGER 得来 + */ + private static final long MAX_SAFE_INTEGER = 9007199254740991L; + private static final long MIN_SAFE_INTEGER = -9007199254740991L; + + /** + * 提供实例 + */ + public static final BigNumberSerializer INSTANCE = new BigNumberSerializer(Number.class); + + public BigNumberSerializer(Class rawType) { + super(rawType); + } + + @Override + public void serialize(Number value, JsonGenerator gen, SerializerProvider provider) throws IOException { + // 超出范围 序列化位字符串 + if (value.longValue() > MIN_SAFE_INTEGER && value.longValue() < MAX_SAFE_INTEGER) { + super.serialize(value, gen, provider); + } else { + gen.writeString(value.toString()); + } + } +} diff --git a/ruoyi-common/ruoyi-common-json/src/main/java/com/ruoyi/common/json/utils/JsonUtils.java b/ruoyi-common/ruoyi-common-json/src/main/java/com/ruoyi/common/json/utils/JsonUtils.java new file mode 100644 index 0000000..dfab00a --- /dev/null +++ b/ruoyi-common/ruoyi-common-json/src/main/java/com/ruoyi/common/json/utils/JsonUtils.java @@ -0,0 +1,170 @@ +package com.ruoyi.common.json.utils; + +import cn.hutool.core.lang.Dict; +import cn.hutool.core.util.ArrayUtil; +import cn.hutool.core.util.ObjectUtil; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.core.type.TypeReference; +import com.fasterxml.jackson.databind.ObjectMapper; +import com.fasterxml.jackson.databind.exc.MismatchedInputException; +import com.ruoyi.common.core.utils.StringUtils; +import com.ruoyi.common.core.utils.SpringUtils; +import lombok.AccessLevel; +import lombok.NoArgsConstructor; + +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; + +/** + * JSON 工具类 + * + * @author 芋道源码 + */ +@NoArgsConstructor(access = AccessLevel.PRIVATE) +public class JsonUtils { + + private static final ObjectMapper OBJECT_MAPPER = SpringUtils.getBean(ObjectMapper.class); + + public static ObjectMapper getObjectMapper() { + return OBJECT_MAPPER; + } + + /** + * 将对象转换为JSON格式的字符串 + * + * @param object 要转换的对象 + * @return JSON格式的字符串,如果对象为null,则返回null + * @throws RuntimeException 如果转换过程中发生JSON处理异常,则抛出运行时异常 + */ + public static String toJsonString(Object object) { + if (ObjectUtil.isNull(object)) { + return null; + } + try { + return OBJECT_MAPPER.writeValueAsString(object); + } catch (JsonProcessingException e) { + throw new RuntimeException(e); + } + } + + /** + * 将JSON格式的字符串转换为指定类型的对象 + * + * @param text JSON格式的字符串 + * @param clazz 要转换的目标对象类型 + * @param 目标对象的泛型类型 + * @return 转换后的对象,如果字符串为空则返回null + * @throws RuntimeException 如果转换过程中发生IO异常,则抛出运行时异常 + */ + public static T parseObject(String text, Class clazz) { + if (StringUtils.isEmpty(text)) { + return null; + } + try { + return OBJECT_MAPPER.readValue(text, clazz); + } catch (IOException e) { + throw new RuntimeException(e); + } + } + + /** + * 将字节数组转换为指定类型的对象 + * + * @param bytes 字节数组 + * @param clazz 要转换的目标对象类型 + * @param 目标对象的泛型类型 + * @return 转换后的对象,如果字节数组为空则返回null + * @throws RuntimeException 如果转换过程中发生IO异常,则抛出运行时异常 + */ + public static T parseObject(byte[] bytes, Class clazz) { + if (ArrayUtil.isEmpty(bytes)) { + return null; + } + try { + return OBJECT_MAPPER.readValue(bytes, clazz); + } catch (IOException e) { + throw new RuntimeException(e); + } + } + + /** + * 将JSON格式的字符串转换为指定类型的对象,支持复杂类型 + * + * @param text JSON格式的字符串 + * @param typeReference 指定类型的TypeReference对象 + * @param 目标对象的泛型类型 + * @return 转换后的对象,如果字符串为空则返回null + * @throws RuntimeException 如果转换过程中发生IO异常,则抛出运行时异常 + */ + public static T parseObject(String text, TypeReference typeReference) { + if (StringUtils.isBlank(text)) { + return null; + } + try { + return OBJECT_MAPPER.readValue(text, typeReference); + } catch (IOException e) { + throw new RuntimeException(e); + } + } + + /** + * 将JSON格式的字符串转换为Dict对象 + * + * @param text JSON格式的字符串 + * @return 转换后的Dict对象,如果字符串为空或者不是JSON格式则返回null + * @throws RuntimeException 如果转换过程中发生IO异常,则抛出运行时异常 + */ + public static Dict parseMap(String text) { + if (StringUtils.isBlank(text)) { + return null; + } + try { + return OBJECT_MAPPER.readValue(text, OBJECT_MAPPER.getTypeFactory().constructType(Dict.class)); + } catch (MismatchedInputException e) { + // 类型不匹配说明不是json + return null; + } catch (IOException e) { + throw new RuntimeException(e); + } + } + + /** + * 将JSON格式的字符串转换为Dict对象的列表 + * + * @param text JSON格式的字符串 + * @return 转换后的Dict对象的列表,如果字符串为空则返回null + * @throws RuntimeException 如果转换过程中发生IO异常,则抛出运行时异常 + */ + public static List parseArrayMap(String text) { + if (StringUtils.isBlank(text)) { + return null; + } + try { + return OBJECT_MAPPER.readValue(text, OBJECT_MAPPER.getTypeFactory().constructCollectionType(List.class, Dict.class)); + } catch (IOException e) { + throw new RuntimeException(e); + } + } + + /** + * 将JSON格式的字符串转换为指定类型对象的列表 + * + * @param text JSON格式的字符串 + * @param clazz 要转换的目标对象类型 + * @param 目标对象的泛型类型 + * @return 转换后的对象的列表,如果字符串为空则返回空列表 + * @throws RuntimeException 如果转换过程中发生IO异常,则抛出运行时异常 + */ + public static List parseArray(String text, Class clazz) { + if (StringUtils.isEmpty(text)) { + return new ArrayList<>(); + } + try { + return OBJECT_MAPPER.readValue(text, OBJECT_MAPPER.getTypeFactory().constructCollectionType(List.class, clazz)); + } catch (IOException e) { + throw new RuntimeException(e); + } + } + +} diff --git a/ruoyi-common/ruoyi-common-json/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports b/ruoyi-common/ruoyi-common-json/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports new file mode 100644 index 0000000..6847712 --- /dev/null +++ b/ruoyi-common/ruoyi-common-json/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports @@ -0,0 +1 @@ +com.ruoyi.common.json.config.JacksonConfig diff --git a/ruoyi-common/ruoyi-common-log/pom.xml b/ruoyi-common/ruoyi-common-log/pom.xml new file mode 100644 index 0000000..2a4a9e4 --- /dev/null +++ b/ruoyi-common/ruoyi-common-log/pom.xml @@ -0,0 +1,32 @@ + + + + com.ruoyi + ruoyi-common + ${revision} + + 4.0.0 + + ruoyi-common-log + + + ruoyi-common-log 日志记录 + + + + + + com.ruoyi + ruoyi-common-satoken + + + + com.ruoyi + ruoyi-common-json + + + + + diff --git a/ruoyi-common/ruoyi-common-log/src/main/java/com/ruoyi/common/log/annotation/Log.java b/ruoyi-common/ruoyi-common-log/src/main/java/com/ruoyi/common/log/annotation/Log.java new file mode 100644 index 0000000..4e5fc58 --- /dev/null +++ b/ruoyi-common/ruoyi-common-log/src/main/java/com/ruoyi/common/log/annotation/Log.java @@ -0,0 +1,48 @@ +package com.ruoyi.common.log.annotation; + +import com.ruoyi.common.log.enums.BusinessType; +import com.ruoyi.common.log.enums.OperatorType; + +import java.lang.annotation.*; + +/** + * 自定义操作日志记录注解 + * + * @author ruoyi + */ +@Target({ElementType.PARAMETER, ElementType.METHOD}) +@Retention(RetentionPolicy.RUNTIME) +@Documented +public @interface Log { + /** + * 模块 + */ + String title() default ""; + + /** + * 功能 + */ + BusinessType businessType() default BusinessType.OTHER; + + /** + * 操作人类别 + */ + OperatorType operatorType() default OperatorType.MANAGE; + + /** + * 是否保存请求的参数 + */ + boolean isSaveRequestData() default true; + + /** + * 是否保存响应的参数 + */ + boolean isSaveResponseData() default true; + + + /** + * 排除指定的请求参数 + */ + String[] excludeParamNames() default {}; + +} diff --git a/ruoyi-common/ruoyi-common-log/src/main/java/com/ruoyi/common/log/aspect/LogAspect.java b/ruoyi-common/ruoyi-common-log/src/main/java/com/ruoyi/common/log/aspect/LogAspect.java new file mode 100644 index 0000000..4230031 --- /dev/null +++ b/ruoyi-common/ruoyi-common-log/src/main/java/com/ruoyi/common/log/aspect/LogAspect.java @@ -0,0 +1,220 @@ +package com.ruoyi.common.log.aspect; + +import cn.hutool.core.lang.Dict; +import cn.hutool.core.map.MapUtil; +import cn.hutool.core.util.ArrayUtil; +import cn.hutool.core.util.ObjectUtil; +import jakarta.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletResponse; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.lang3.time.StopWatch; +import org.aspectj.lang.JoinPoint; +import org.aspectj.lang.annotation.AfterReturning; +import org.aspectj.lang.annotation.AfterThrowing; +import org.aspectj.lang.annotation.Aspect; +import org.aspectj.lang.annotation.Before; +import com.ruoyi.common.core.domain.bo.LoginUser; +import com.ruoyi.common.core.utils.ServletUtils; +import com.ruoyi.common.core.utils.SpringUtils; +import com.ruoyi.common.core.utils.StringUtils; +import com.ruoyi.common.json.utils.JsonUtils; +import com.ruoyi.common.log.annotation.Log; +import com.ruoyi.common.log.enums.BusinessStatus; +import com.ruoyi.common.log.event.OperLogEvent; +import com.ruoyi.common.satoken.utils.LoginHelper; +import org.springframework.boot.autoconfigure.AutoConfiguration; +import org.springframework.http.HttpMethod; +import org.springframework.validation.BindingResult; +import org.springframework.web.multipart.MultipartFile; + +import java.util.Collection; +import java.util.Map; +import java.util.StringJoiner; + +/** + * 操作日志记录处理 + * + * @author Lion Li + */ +@Slf4j +@Aspect +@AutoConfiguration +public class LogAspect { + + /** + * 排除敏感属性字段 + */ + public static final String[] EXCLUDE_PROPERTIES = { "password", "oldPassword", "newPassword", "confirmPassword" }; + + + /** + * 计时 key + */ + private static final ThreadLocal KEY_CACHE = new ThreadLocal<>(); + + /** + * 处理请求前执行 + */ + @Before(value = "@annotation(controllerLog)") + public void doBefore(JoinPoint joinPoint, Log controllerLog) { + StopWatch stopWatch = new StopWatch(); + KEY_CACHE.set(stopWatch); + stopWatch.start(); + } + + /** + * 处理完请求后执行 + * + * @param joinPoint 切点 + */ + @AfterReturning(pointcut = "@annotation(controllerLog)", returning = "jsonResult") + public void doAfterReturning(JoinPoint joinPoint, Log controllerLog, Object jsonResult) { + handleLog(joinPoint, controllerLog, null, jsonResult); + } + + /** + * 拦截异常操作 + * + * @param joinPoint 切点 + * @param e 异常 + */ + @AfterThrowing(value = "@annotation(controllerLog)", throwing = "e") + public void doAfterThrowing(JoinPoint joinPoint, Log controllerLog, Exception e) { + handleLog(joinPoint, controllerLog, e, null); + } + + protected void handleLog(final JoinPoint joinPoint, Log controllerLog, final Exception e, Object jsonResult) { + try { + + // *========数据库日志=========*// + OperLogEvent operLog = new OperLogEvent(); + operLog.setStatus(BusinessStatus.SUCCESS.ordinal()); + // 请求的地址 + String ip = ServletUtils.getClientIP(); + operLog.setOperIp(ip); + operLog.setOperUrl(StringUtils.substring(ServletUtils.getRequest().getRequestURI(), 0, 255)); + LoginUser loginUser = LoginHelper.getLoginUser(); + operLog.setOperName(loginUser.getUsername()); + operLog.setDeptName(loginUser.getDeptName()); + + if (e != null) { + operLog.setStatus(BusinessStatus.FAIL.ordinal()); + operLog.setErrorMsg(StringUtils.substring(e.getMessage(), 0, 2000)); + } + // 设置方法名称 + String className = joinPoint.getTarget().getClass().getName(); + String methodName = joinPoint.getSignature().getName(); + operLog.setMethod(className + "." + methodName + "()"); + // 设置请求方式 + operLog.setRequestMethod(ServletUtils.getRequest().getMethod()); + // 处理设置注解上的参数 + getControllerMethodDescription(joinPoint, controllerLog, operLog, jsonResult); + // 设置消耗时间 + StopWatch stopWatch = KEY_CACHE.get(); + stopWatch.stop(); + operLog.setCostTime(stopWatch.getTime()); + // 发布事件保存数据库 + SpringUtils.context().publishEvent(operLog); + } catch (Exception exp) { + // 记录本地异常日志 + log.error("异常信息:{}", exp.getMessage()); + exp.printStackTrace(); + } finally { + KEY_CACHE.remove(); + } + } + + /** + * 获取注解中对方法的描述信息 用于Controller层注解 + * + * @param log 日志 + * @param operLog 操作日志 + * @throws Exception + */ + public void getControllerMethodDescription(JoinPoint joinPoint, Log log, OperLogEvent operLog, Object jsonResult) throws Exception { + // 设置action动作 + operLog.setBusinessType(log.businessType().ordinal()); + // 设置标题 + operLog.setTitle(log.title()); + // 设置操作人类别 + operLog.setOperatorType(log.operatorType().ordinal()); + // 是否需要保存request,参数和值 + if (log.isSaveRequestData()) { + // 获取参数的信息,传入到数据库中。 + setRequestValue(joinPoint, operLog, log.excludeParamNames()); + } + // 是否需要保存response,参数和值 + if (log.isSaveResponseData() && ObjectUtil.isNotNull(jsonResult)) { + operLog.setJsonResult(StringUtils.substring(JsonUtils.toJsonString(jsonResult), 0, 2000)); + } + } + + /** + * 获取请求的参数,放到log中 + * + * @param operLog 操作日志 + * @throws Exception 异常 + */ + private void setRequestValue(JoinPoint joinPoint, OperLogEvent operLog, String[] excludeParamNames) throws Exception { + Map paramsMap = ServletUtils.getParamMap(ServletUtils.getRequest()); + String requestMethod = operLog.getRequestMethod(); + if (MapUtil.isEmpty(paramsMap) + && HttpMethod.PUT.name().equals(requestMethod) || HttpMethod.POST.name().equals(requestMethod)) { + String params = argsArrayToString(joinPoint.getArgs(), excludeParamNames); + operLog.setOperParam(StringUtils.substring(params, 0, 2000)); + } else { + MapUtil.removeAny(paramsMap, EXCLUDE_PROPERTIES); + MapUtil.removeAny(paramsMap, excludeParamNames); + operLog.setOperParam(StringUtils.substring(JsonUtils.toJsonString(paramsMap), 0, 2000)); + } + } + + /** + * 参数拼装 + */ + private String argsArrayToString(Object[] paramsArray, String[] excludeParamNames) { + StringJoiner params = new StringJoiner(" "); + if (ArrayUtil.isEmpty(paramsArray)) { + return params.toString(); + } + for (Object o : paramsArray) { + if (ObjectUtil.isNotNull(o) && !isFilterObject(o)) { + String str = JsonUtils.toJsonString(o); + Dict dict = JsonUtils.parseMap(str); + if (MapUtil.isNotEmpty(dict)) { + MapUtil.removeAny(dict, EXCLUDE_PROPERTIES); + MapUtil.removeAny(dict, excludeParamNames); + str = JsonUtils.toJsonString(dict); + } + params.add(str); + } + } + return params.toString(); + } + + /** + * 判断是否需要过滤的对象。 + * + * @param o 对象信息。 + * @return 如果是需要过滤的对象,则返回true;否则返回false。 + */ + @SuppressWarnings("rawtypes") + public boolean isFilterObject(final Object o) { + Class clazz = o.getClass(); + if (clazz.isArray()) { + return MultipartFile.class.isAssignableFrom(clazz.getComponentType()); + } else if (Collection.class.isAssignableFrom(clazz)) { + Collection collection = (Collection) o; + for (Object value : collection) { + return value instanceof MultipartFile; + } + } else if (Map.class.isAssignableFrom(clazz)) { + Map map = (Map) o; + for (Object value : map.values()) { + return value instanceof MultipartFile; + } + } + return o instanceof MultipartFile || o instanceof HttpServletRequest || o instanceof HttpServletResponse + || o instanceof BindingResult; + } +} diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/enums/BusinessStatus.java b/ruoyi-common/ruoyi-common-log/src/main/java/com/ruoyi/common/log/enums/BusinessStatus.java similarity index 66% rename from ruoyi-common/src/main/java/com/ruoyi/common/enums/BusinessStatus.java rename to ruoyi-common/ruoyi-common-log/src/main/java/com/ruoyi/common/log/enums/BusinessStatus.java index 10b7306..716c4cc 100644 --- a/ruoyi-common/src/main/java/com/ruoyi/common/enums/BusinessStatus.java +++ b/ruoyi-common/ruoyi-common-log/src/main/java/com/ruoyi/common/log/enums/BusinessStatus.java @@ -1,13 +1,11 @@ -package com.ruoyi.common.enums; +package com.ruoyi.common.log.enums; /** * 操作状态 - * - * @author ruoyi * + * @author ruoyi */ -public enum BusinessStatus -{ +public enum BusinessStatus { /** * 成功 */ diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/enums/BusinessType.java b/ruoyi-common/ruoyi-common-log/src/main/java/com/ruoyi/common/log/enums/BusinessType.java similarity index 87% rename from ruoyi-common/src/main/java/com/ruoyi/common/enums/BusinessType.java rename to ruoyi-common/ruoyi-common-log/src/main/java/com/ruoyi/common/log/enums/BusinessType.java index 2e17c4a..7314de5 100644 --- a/ruoyi-common/src/main/java/com/ruoyi/common/enums/BusinessType.java +++ b/ruoyi-common/ruoyi-common-log/src/main/java/com/ruoyi/common/log/enums/BusinessType.java @@ -1,12 +1,11 @@ -package com.ruoyi.common.enums; +package com.ruoyi.common.log.enums; /** * 业务操作类型 - * + * * @author ruoyi */ -public enum BusinessType -{ +public enum BusinessType { /** * 其它 */ @@ -51,7 +50,7 @@ public enum BusinessType * 生成代码 */ GENCODE, - + /** * 清空数据 */ diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/enums/OperatorType.java b/ruoyi-common/ruoyi-common-log/src/main/java/com/ruoyi/common/log/enums/OperatorType.java similarity index 74% rename from ruoyi-common/src/main/java/com/ruoyi/common/enums/OperatorType.java rename to ruoyi-common/ruoyi-common-log/src/main/java/com/ruoyi/common/log/enums/OperatorType.java index bdd143c..a93394a 100644 --- a/ruoyi-common/src/main/java/com/ruoyi/common/enums/OperatorType.java +++ b/ruoyi-common/ruoyi-common-log/src/main/java/com/ruoyi/common/log/enums/OperatorType.java @@ -1,12 +1,11 @@ -package com.ruoyi.common.enums; +package com.ruoyi.common.log.enums; /** * 操作人类别 - * + * * @author ruoyi */ -public enum OperatorType -{ +public enum OperatorType { /** * 其它 */ diff --git a/ruoyi-common/ruoyi-common-log/src/main/java/com/ruoyi/common/log/event/LogininforEvent.java b/ruoyi-common/ruoyi-common-log/src/main/java/com/ruoyi/common/log/event/LogininforEvent.java new file mode 100644 index 0000000..785f589 --- /dev/null +++ b/ruoyi-common/ruoyi-common-log/src/main/java/com/ruoyi/common/log/event/LogininforEvent.java @@ -0,0 +1,52 @@ +package com.ruoyi.common.log.event; + +import lombok.Data; + +import jakarta.servlet.http.HttpServletRequest; + +import java.io.Serial; +import java.io.Serializable; + +/** + * 登录事件 + * + * @author Lion Li + */ + +@Data +public class LogininforEvent implements Serializable { + + @Serial + private static final long serialVersionUID = 1L; + + /** + * 租户ID + */ + private String tenantId; + + /** + * 用户账号 + */ + private String username; + + /** + * 登录状态 0成功 1失败 + */ + private String status; + + /** + * 提示消息 + */ + private String message; + + /** + * 请求体 + */ + private HttpServletRequest request; + + /** + * 其他参数 + */ + private Object[] args; + +} diff --git a/ruoyi-common/ruoyi-common-log/src/main/java/com/ruoyi/common/log/event/OperLogEvent.java b/ruoyi-common/ruoyi-common-log/src/main/java/com/ruoyi/common/log/event/OperLogEvent.java new file mode 100644 index 0000000..2ff1cd7 --- /dev/null +++ b/ruoyi-common/ruoyi-common-log/src/main/java/com/ruoyi/common/log/event/OperLogEvent.java @@ -0,0 +1,110 @@ +package com.ruoyi.common.log.event; + +import lombok.Data; + +import java.io.Serial; +import java.io.Serializable; +import java.util.Date; + +/** + * 操作日志事件 + * + * @author Lion Li + */ + +@Data +public class OperLogEvent implements Serializable { + + @Serial + private static final long serialVersionUID = 1L; + + /** + * 日志主键 + */ + private Long operId; + + /** + * 操作模块 + */ + private String title; + + /** + * 业务类型(0其它 1新增 2修改 3删除) + */ + private Integer businessType; + + /** + * 业务类型数组 + */ + private Integer[] businessTypes; + + /** + * 请求方法 + */ + private String method; + + /** + * 请求方式 + */ + private String requestMethod; + + /** + * 操作类别(0其它 1后台用户 2手机端用户) + */ + private Integer operatorType; + + /** + * 操作人员 + */ + private String operName; + + /** + * 部门名称 + */ + private String deptName; + + /** + * 请求url + */ + private String operUrl; + + /** + * 操作地址 + */ + private String operIp; + + /** + * 操作地点 + */ + private String operLocation; + + /** + * 请求参数 + */ + private String operParam; + + /** + * 返回参数 + */ + private String jsonResult; + + /** + * 操作状态(0正常 1异常) + */ + private Integer status; + + /** + * 错误消息 + */ + private String errorMsg; + + /** + * 操作时间 + */ + private Date operTime; + + /** + * 消耗时间 + */ + private Long costTime; +} diff --git a/ruoyi-common/ruoyi-common-log/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports b/ruoyi-common/ruoyi-common-log/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports new file mode 100644 index 0000000..b8e3223 --- /dev/null +++ b/ruoyi-common/ruoyi-common-log/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports @@ -0,0 +1 @@ +com.ruoyi.common.log.aspect.LogAspect diff --git a/ruoyi-common/ruoyi-common-mail/pom.xml b/ruoyi-common/ruoyi-common-mail/pom.xml new file mode 100644 index 0000000..7dd6f50 --- /dev/null +++ b/ruoyi-common/ruoyi-common-mail/pom.xml @@ -0,0 +1,34 @@ + + + + com.ruoyi + ruoyi-common + ${revision} + + 4.0.0 + + ruoyi-common-mail + + + ruoyi-common-mail 邮件模块 + + + + + com.ruoyi + ruoyi-common-core + + + + jakarta.mail + jakarta.mail-api + + + org.eclipse.angus + jakarta.mail + + + + diff --git a/ruoyi-common/ruoyi-common-mail/src/main/java/com/ruoyi/common/mail/config/MailConfig.java b/ruoyi-common/ruoyi-common-mail/src/main/java/com/ruoyi/common/mail/config/MailConfig.java new file mode 100644 index 0000000..cd01a77 --- /dev/null +++ b/ruoyi-common/ruoyi-common-mail/src/main/java/com/ruoyi/common/mail/config/MailConfig.java @@ -0,0 +1,37 @@ +package com.ruoyi.common.mail.config; + +import com.ruoyi.common.mail.config.properties.MailProperties; +import com.ruoyi.common.mail.utils.MailAccount; +import org.springframework.boot.autoconfigure.AutoConfiguration; +import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; +import org.springframework.boot.context.properties.EnableConfigurationProperties; +import org.springframework.context.annotation.Bean; + +/** + * JavaMail 配置 + * + * @author Michelle.Chung + */ +@AutoConfiguration +@EnableConfigurationProperties(MailProperties.class) +public class MailConfig { + + @Bean + @ConditionalOnProperty(value = "mail.enabled", havingValue = "true") + public MailAccount mailAccount(MailProperties mailProperties) { + MailAccount account = new MailAccount(); + account.setHost(mailProperties.getHost()); + account.setPort(mailProperties.getPort()); + account.setAuth(mailProperties.getAuth()); + account.setFrom(mailProperties.getFrom()); + account.setUser(mailProperties.getUser()); + account.setPass(mailProperties.getPass()); + account.setSocketFactoryPort(mailProperties.getPort()); + account.setStarttlsEnable(mailProperties.getStarttlsEnable()); + account.setSslEnable(mailProperties.getSslEnable()); + account.setTimeout(mailProperties.getTimeout()); + account.setConnectionTimeout(mailProperties.getConnectionTimeout()); + return account; + } + +} diff --git a/ruoyi-common/ruoyi-common-mail/src/main/java/com/ruoyi/common/mail/config/properties/MailProperties.java b/ruoyi-common/ruoyi-common-mail/src/main/java/com/ruoyi/common/mail/config/properties/MailProperties.java new file mode 100644 index 0000000..7970e47 --- /dev/null +++ b/ruoyi-common/ruoyi-common-mail/src/main/java/com/ruoyi/common/mail/config/properties/MailProperties.java @@ -0,0 +1,69 @@ +package com.ruoyi.common.mail.config.properties; + +import lombok.Data; +import org.springframework.boot.context.properties.ConfigurationProperties; + +/** + * JavaMail 配置属性 + * + * @author Michelle.Chung + */ +@Data +@ConfigurationProperties(prefix = "mail") +public class MailProperties { + + /** + * 过滤开关 + */ + private Boolean enabled; + + /** + * SMTP服务器域名 + */ + private String host; + + /** + * SMTP服务端口 + */ + private Integer port; + + /** + * 是否需要用户名密码验证 + */ + private Boolean auth; + + /** + * 用户名 + */ + private String user; + + /** + * 密码 + */ + private String pass; + + /** + * 发送方,遵循RFC-822标准 + */ + private String from; + + /** + * 使用 STARTTLS安全连接,STARTTLS是对纯文本通信协议的扩展。它将纯文本连接升级为加密连接(TLS或SSL), 而不是使用一个单独的加密通信端口。 + */ + private Boolean starttlsEnable; + + /** + * 使用 SSL安全连接 + */ + private Boolean sslEnable; + + /** + * SMTP超时时长,单位毫秒,缺省值不超时 + */ + private Long timeout; + + /** + * Socket连接超时值,单位毫秒,缺省值不超时 + */ + private Long connectionTimeout; +} diff --git a/ruoyi-common/ruoyi-common-mail/src/main/java/com/ruoyi/common/mail/utils/GlobalMailAccount.java b/ruoyi-common/ruoyi-common-mail/src/main/java/com/ruoyi/common/mail/utils/GlobalMailAccount.java new file mode 100644 index 0000000..1465ccc --- /dev/null +++ b/ruoyi-common/ruoyi-common-mail/src/main/java/com/ruoyi/common/mail/utils/GlobalMailAccount.java @@ -0,0 +1,46 @@ +package com.ruoyi.common.mail.utils; + +import cn.hutool.core.io.IORuntimeException; + +/** + * 全局邮件帐户,依赖于邮件配置文件{@link MailAccount#MAIL_SETTING_PATHS} + * + * @author looly + */ +public enum GlobalMailAccount { + INSTANCE; + + private final MailAccount mailAccount; + + /** + * 构造 + */ + GlobalMailAccount() { + mailAccount = createDefaultAccount(); + } + + /** + * 获得邮件帐户 + * + * @return 邮件帐户 + */ + public MailAccount getAccount() { + return this.mailAccount; + } + + /** + * 创建默认帐户 + * + * @return MailAccount + */ + private MailAccount createDefaultAccount() { + for (String mailSettingPath : MailAccount.MAIL_SETTING_PATHS) { + try { + return new MailAccount(mailSettingPath); + } catch (IORuntimeException ignore) { + //ignore + } + } + return null; + } +} diff --git a/ruoyi-common/ruoyi-common-mail/src/main/java/com/ruoyi/common/mail/utils/InternalMailUtil.java b/ruoyi-common/ruoyi-common-mail/src/main/java/com/ruoyi/common/mail/utils/InternalMailUtil.java new file mode 100644 index 0000000..7f26dc3 --- /dev/null +++ b/ruoyi-common/ruoyi-common-mail/src/main/java/com/ruoyi/common/mail/utils/InternalMailUtil.java @@ -0,0 +1,108 @@ +package com.ruoyi.common.mail.utils; + +import cn.hutool.core.util.ArrayUtil; +import jakarta.mail.internet.AddressException; +import jakarta.mail.internet.InternetAddress; +import jakarta.mail.internet.MimeUtility; + +import java.io.UnsupportedEncodingException; +import java.nio.charset.Charset; +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; + +/** + * 邮件内部工具类 + * + * @author looly + * @since 3.2.3 + */ +public class InternalMailUtil { + + /** + * 将多个字符串邮件地址转为{@link InternetAddress}列表
+ * 单个字符串地址可以是多个地址合并的字符串 + * + * @param addrStrs 地址数组 + * @param charset 编码(主要用于中文用户名的编码) + * @return 地址数组 + * @since 4.0.3 + */ + public static InternetAddress[] parseAddressFromStrs(String[] addrStrs, Charset charset) { + final List resultList = new ArrayList<>(addrStrs.length); + InternetAddress[] addrs; + for (String addrStr : addrStrs) { + addrs = parseAddress(addrStr, charset); + if (ArrayUtil.isNotEmpty(addrs)) { + Collections.addAll(resultList, addrs); + } + } + return resultList.toArray(new InternetAddress[0]); + } + + /** + * 解析第一个地址 + * + * @param address 地址字符串 + * @param charset 编码,{@code null}表示使用系统属性定义的编码或系统编码 + * @return 地址列表 + */ + public static InternetAddress parseFirstAddress(String address, Charset charset) { + final InternetAddress[] internetAddresses = parseAddress(address, charset); + if (ArrayUtil.isEmpty(internetAddresses)) { + try { + return new InternetAddress(address); + } catch (AddressException e) { + throw new MailException(e); + } + } + return internetAddresses[0]; + } + + /** + * 将一个地址字符串解析为多个地址
+ * 地址间使用" "、","、";"分隔 + * + * @param address 地址字符串 + * @param charset 编码,{@code null}表示使用系统属性定义的编码或系统编码 + * @return 地址列表 + */ + public static InternetAddress[] parseAddress(String address, Charset charset) { + InternetAddress[] addresses; + try { + addresses = InternetAddress.parse(address); + } catch (AddressException e) { + throw new MailException(e); + } + //编码用户名 + if (ArrayUtil.isNotEmpty(addresses)) { + final String charsetStr = null == charset ? null : charset.name(); + for (InternetAddress internetAddress : addresses) { + try { + internetAddress.setPersonal(internetAddress.getPersonal(), charsetStr); + } catch (UnsupportedEncodingException e) { + throw new MailException(e); + } + } + } + + return addresses; + } + + /** + * 编码中文字符
+ * 编码失败返回原字符串 + * + * @param text 被编码的文本 + * @param charset 编码 + * @return 编码后的结果 + */ + public static String encodeText(String text, Charset charset) { + try { + return MimeUtility.encodeText(text, charset.name(), null); + } catch (UnsupportedEncodingException e) { + // ignore + } + return text; + } +} diff --git a/ruoyi-common/ruoyi-common-mail/src/main/java/com/ruoyi/common/mail/utils/Mail.java b/ruoyi-common/ruoyi-common-mail/src/main/java/com/ruoyi/common/mail/utils/Mail.java new file mode 100644 index 0000000..1a5b84b --- /dev/null +++ b/ruoyi-common/ruoyi-common-mail/src/main/java/com/ruoyi/common/mail/utils/Mail.java @@ -0,0 +1,483 @@ +package com.ruoyi.common.mail.utils; + +import cn.hutool.core.builder.Builder; +import cn.hutool.core.io.FileUtil; +import cn.hutool.core.io.IORuntimeException; +import cn.hutool.core.io.IoUtil; +import cn.hutool.core.util.ArrayUtil; +import cn.hutool.core.util.ObjectUtil; +import cn.hutool.core.util.StrUtil; +import jakarta.activation.DataHandler; +import jakarta.activation.DataSource; +import jakarta.activation.FileDataSource; +import jakarta.activation.FileTypeMap; +import jakarta.mail.*; +import jakarta.mail.internet.MimeBodyPart; +import jakarta.mail.internet.MimeMessage; +import jakarta.mail.internet.MimeMultipart; +import jakarta.mail.internet.MimeUtility; +import jakarta.mail.util.ByteArrayDataSource; + +import java.io.*; +import java.nio.charset.Charset; +import java.util.Date; + +/** + * 邮件发送客户端 + * + * @author looly + * @since 3.2.0 + */ +public class Mail implements Builder { + @Serial + private static final long serialVersionUID = 1L; + + /** + * 邮箱帐户信息以及一些客户端配置信息 + */ + private final MailAccount mailAccount; + /** + * 收件人列表 + */ + private String[] tos; + /** + * 抄送人列表(carbon copy) + */ + private String[] ccs; + /** + * 密送人列表(blind carbon copy) + */ + private String[] bccs; + /** + * 回复地址(reply-to) + */ + private String[] reply; + /** + * 标题 + */ + private String title; + /** + * 内容 + */ + private String content; + /** + * 是否为HTML + */ + private boolean isHtml; + /** + * 正文、附件和图片的混合部分 + */ + private final Multipart multipart = new MimeMultipart(); + /** + * 是否使用全局会话,默认为false + */ + private boolean useGlobalSession = false; + + /** + * debug输出位置,可以自定义debug日志 + */ + private PrintStream debugOutput; + + /** + * 创建邮件客户端 + * + * @param mailAccount 邮件帐号 + * @return Mail + */ + public static Mail create(MailAccount mailAccount) { + return new Mail(mailAccount); + } + + /** + * 创建邮件客户端,使用全局邮件帐户 + * + * @return Mail + */ + public static Mail create() { + return new Mail(); + } + + // --------------------------------------------------------------- Constructor start + + /** + * 构造,使用全局邮件帐户 + */ + public Mail() { + this(GlobalMailAccount.INSTANCE.getAccount()); + } + + /** + * 构造 + * + * @param mailAccount 邮件帐户,如果为null使用默认配置文件的全局邮件配置 + */ + public Mail(MailAccount mailAccount) { + mailAccount = (null != mailAccount) ? mailAccount : GlobalMailAccount.INSTANCE.getAccount(); + this.mailAccount = mailAccount.defaultIfEmpty(); + } + // --------------------------------------------------------------- Constructor end + + // --------------------------------------------------------------- Getters and Setters start + + /** + * 设置收件人 + * + * @param tos 收件人列表 + * @return this + * @see #setTos(String...) + */ + public Mail to(String... tos) { + return setTos(tos); + } + + /** + * 设置多个收件人 + * + * @param tos 收件人列表 + * @return this + */ + public Mail setTos(String... tos) { + this.tos = tos; + return this; + } + + /** + * 设置多个抄送人(carbon copy) + * + * @param ccs 抄送人列表 + * @return this + * @since 4.0.3 + */ + public Mail setCcs(String... ccs) { + this.ccs = ccs; + return this; + } + + /** + * 设置多个密送人(blind carbon copy) + * + * @param bccs 密送人列表 + * @return this + * @since 4.0.3 + */ + public Mail setBccs(String... bccs) { + this.bccs = bccs; + return this; + } + + /** + * 设置多个回复地址(reply-to) + * + * @param reply 回复地址(reply-to)列表 + * @return this + * @since 4.6.0 + */ + public Mail setReply(String... reply) { + this.reply = reply; + return this; + } + + /** + * 设置标题 + * + * @param title 标题 + * @return this + */ + public Mail setTitle(String title) { + this.title = title; + return this; + } + + /** + * 设置正文
+ * 正文可以是普通文本也可以是HTML(默认普通文本),可以通过调用{@link #setHtml(boolean)} 设置是否为HTML + * + * @param content 正文 + * @return this + */ + public Mail setContent(String content) { + this.content = content; + return this; + } + + /** + * 设置是否是HTML + * + * @param isHtml 是否为HTML + * @return this + */ + public Mail setHtml(boolean isHtml) { + this.isHtml = isHtml; + return this; + } + + /** + * 设置正文 + * + * @param content 正文内容 + * @param isHtml 是否为HTML + * @return this + */ + public Mail setContent(String content, boolean isHtml) { + setContent(content); + return setHtml(isHtml); + } + + /** + * 设置文件类型附件,文件可以是图片文件,此时自动设置cid(正文中引用图片),默认cid为文件名 + * + * @param files 附件文件列表 + * @return this + */ + public Mail setFiles(File... files) { + if (ArrayUtil.isEmpty(files)) { + return this; + } + + final DataSource[] attachments = new DataSource[files.length]; + for (int i = 0; i < files.length; i++) { + attachments[i] = new FileDataSource(files[i]); + } + return setAttachments(attachments); + } + + /** + * 增加附件或图片,附件使用{@link DataSource} 形式表示,可以使用{@link FileDataSource}包装文件表示文件附件 + * + * @param attachments 附件列表 + * @return this + * @since 4.0.9 + */ + public Mail setAttachments(DataSource... attachments) { + if (ArrayUtil.isNotEmpty(attachments)) { + final Charset charset = this.mailAccount.getCharset(); + MimeBodyPart bodyPart; + String nameEncoded; + try { + for (DataSource attachment : attachments) { + bodyPart = new MimeBodyPart(); + bodyPart.setDataHandler(new DataHandler(attachment)); + nameEncoded = attachment.getName(); + if (this.mailAccount.isEncodefilename()) { + nameEncoded = InternalMailUtil.encodeText(nameEncoded, charset); + } + // 普通附件文件名 + bodyPart.setFileName(nameEncoded); + if (StrUtil.startWith(attachment.getContentType(), "image/")) { + // 图片附件,用于正文中引用图片 + bodyPart.setContentID(nameEncoded); + } + this.multipart.addBodyPart(bodyPart); + } + } catch (MessagingException e) { + throw new MailException(e); + } + } + return this; + } + + /** + * 增加图片,图片的键对应到邮件模板中的占位字符串,图片类型默认为"image/jpeg" + * + * @param cid 图片与占位符,占位符格式为cid:${cid} + * @param imageStream 图片文件 + * @return this + * @since 4.6.3 + */ + public Mail addImage(String cid, InputStream imageStream) { + return addImage(cid, imageStream, null); + } + + /** + * 增加图片,图片的键对应到邮件模板中的占位字符串 + * + * @param cid 图片与占位符,占位符格式为cid:${cid} + * @param imageStream 图片流,不关闭 + * @param contentType 图片类型,null赋值默认的"image/jpeg" + * @return this + * @since 4.6.3 + */ + public Mail addImage(String cid, InputStream imageStream, String contentType) { + ByteArrayDataSource imgSource; + try { + imgSource = new ByteArrayDataSource(imageStream, ObjectUtil.defaultIfNull(contentType, "image/jpeg")); + } catch (IOException e) { + throw new IORuntimeException(e); + } + imgSource.setName(cid); + return setAttachments(imgSource); + } + + /** + * 增加图片,图片的键对应到邮件模板中的占位字符串 + * + * @param cid 图片与占位符,占位符格式为cid:${cid} + * @param imageFile 图片文件 + * @return this + * @since 4.6.3 + */ + public Mail addImage(String cid, File imageFile) { + InputStream in = null; + try { + in = FileUtil.getInputStream(imageFile); + return addImage(cid, in, FileTypeMap.getDefaultFileTypeMap().getContentType(imageFile)); + } finally { + IoUtil.close(in); + } + } + + /** + * 设置字符集编码 + * + * @param charset 字符集编码 + * @return this + * @see MailAccount#setCharset(Charset) + */ + public Mail setCharset(Charset charset) { + this.mailAccount.setCharset(charset); + return this; + } + + /** + * 设置是否使用全局会话,默认为true + * + * @param isUseGlobalSession 是否使用全局会话,默认为true + * @return this + * @since 4.0.2 + */ + public Mail setUseGlobalSession(boolean isUseGlobalSession) { + this.useGlobalSession = isUseGlobalSession; + return this; + } + + /** + * 设置debug输出位置,可以自定义debug日志 + * + * @param debugOutput debug输出位置 + * @return this + * @since 5.5.6 + */ + public Mail setDebugOutput(PrintStream debugOutput) { + this.debugOutput = debugOutput; + return this; + } + // --------------------------------------------------------------- Getters and Setters end + + @Override + public MimeMessage build() { + try { + return buildMsg(); + } catch (MessagingException e) { + throw new MailException(e); + } + } + + /** + * 发送 + * + * @return message-id + * @throws MailException 邮件发送异常 + */ + public String send() throws MailException { + try { + return doSend(); + } catch (MessagingException e) { + if (e instanceof SendFailedException) { + // 当地址无效时,显示更加详细的无效地址信息 + final Address[] invalidAddresses = ((SendFailedException) e).getInvalidAddresses(); + final String msg = StrUtil.format("Invalid Addresses: {}", ArrayUtil.toString(invalidAddresses)); + throw new MailException(msg, e); + } + throw new MailException(e); + } + } + + // --------------------------------------------------------------- Private method start + + /** + * 执行发送 + * + * @return message-id + * @throws MessagingException 发送异常 + */ + private String doSend() throws MessagingException { + final MimeMessage mimeMessage = buildMsg(); + Transport.send(mimeMessage); + return mimeMessage.getMessageID(); + } + + /** + * 构建消息 + * + * @return {@link MimeMessage}消息 + * @throws MessagingException 消息异常 + */ + private MimeMessage buildMsg() throws MessagingException { + final Charset charset = this.mailAccount.getCharset(); + final MimeMessage msg = new MimeMessage(getSession()); + // 发件人 + final String from = this.mailAccount.getFrom(); + if (StrUtil.isEmpty(from)) { + // 用户未提供发送方,则从Session中自动获取 + msg.setFrom(); + } else { + msg.setFrom(InternalMailUtil.parseFirstAddress(from, charset)); + } + // 标题 + msg.setSubject(this.title, (null == charset) ? null : charset.name()); + // 发送时间 + msg.setSentDate(new Date()); + // 内容和附件 + msg.setContent(buildContent(charset)); + // 收件人 + msg.setRecipients(MimeMessage.RecipientType.TO, InternalMailUtil.parseAddressFromStrs(this.tos, charset)); + // 抄送人 + if (ArrayUtil.isNotEmpty(this.ccs)) { + msg.setRecipients(MimeMessage.RecipientType.CC, InternalMailUtil.parseAddressFromStrs(this.ccs, charset)); + } + // 密送人 + if (ArrayUtil.isNotEmpty(this.bccs)) { + msg.setRecipients(MimeMessage.RecipientType.BCC, InternalMailUtil.parseAddressFromStrs(this.bccs, charset)); + } + // 回复地址(reply-to) + if (ArrayUtil.isNotEmpty(this.reply)) { + msg.setReplyTo(InternalMailUtil.parseAddressFromStrs(this.reply, charset)); + } + + return msg; + } + + /** + * 构建邮件信息主体 + * + * @param charset 编码,{@code null}则使用{@link MimeUtility#getDefaultJavaCharset()} + * @return 邮件信息主体 + * @throws MessagingException 消息异常 + */ + private Multipart buildContent(Charset charset) throws MessagingException { + final String charsetStr = null != charset ? charset.name() : MimeUtility.getDefaultJavaCharset(); + // 正文 + final MimeBodyPart body = new MimeBodyPart(); + body.setContent(content, StrUtil.format("text/{}; charset={}", isHtml ? "html" : "plain", charsetStr)); + this.multipart.addBodyPart(body); + + return this.multipart; + } + + /** + * 获取默认邮件会话
+ * 如果为全局单例的会话,则全局只允许一个邮件帐号,否则每次发送邮件会新建一个新的会话 + * + * @return 邮件会话 {@link Session} + */ + private Session getSession() { + final Session session = MailUtils.getSession(this.mailAccount, this.useGlobalSession); + + if (null != this.debugOutput) { + session.setDebugOut(debugOutput); + } + + return session; + } + // --------------------------------------------------------------- Private method end +} diff --git a/ruoyi-common/ruoyi-common-mail/src/main/java/com/ruoyi/common/mail/utils/MailAccount.java b/ruoyi-common/ruoyi-common-mail/src/main/java/com/ruoyi/common/mail/utils/MailAccount.java new file mode 100644 index 0000000..64679ed --- /dev/null +++ b/ruoyi-common/ruoyi-common-mail/src/main/java/com/ruoyi/common/mail/utils/MailAccount.java @@ -0,0 +1,659 @@ +package com.ruoyi.common.mail.utils; + +import cn.hutool.core.util.CharsetUtil; +import cn.hutool.core.util.ObjectUtil; +import cn.hutool.core.util.StrUtil; +import cn.hutool.setting.Setting; + +import java.io.Serial; +import java.io.Serializable; +import java.nio.charset.Charset; +import java.util.HashMap; +import java.util.Map; +import java.util.Properties; + +/** + * 邮件账户对象 + * + * @author Luxiaolei + */ +public class MailAccount implements Serializable { + @Serial + private static final long serialVersionUID = -6937313421815719204L; + + private static final String MAIL_PROTOCOL = "mail.transport.protocol"; + private static final String SMTP_HOST = "mail.smtp.host"; + private static final String SMTP_PORT = "mail.smtp.port"; + private static final String SMTP_AUTH = "mail.smtp.auth"; + private static final String SMTP_TIMEOUT = "mail.smtp.timeout"; + private static final String SMTP_CONNECTION_TIMEOUT = "mail.smtp.connectiontimeout"; + private static final String SMTP_WRITE_TIMEOUT = "mail.smtp.writetimeout"; + + // SSL + private static final String STARTTLS_ENABLE = "mail.smtp.starttls.enable"; + private static final String SSL_ENABLE = "mail.smtp.ssl.enable"; + private static final String SSL_PROTOCOLS = "mail.smtp.ssl.protocols"; + private static final String SOCKET_FACTORY = "mail.smtp.socketFactory.class"; + private static final String SOCKET_FACTORY_FALLBACK = "mail.smtp.socketFactory.fallback"; + private static final String SOCKET_FACTORY_PORT = "smtp.socketFactory.port"; + + // System Properties + private static final String SPLIT_LONG_PARAMS = "mail.mime.splitlongparameters"; + //private static final String ENCODE_FILE_NAME = "mail.mime.encodefilename"; + //private static final String CHARSET = "mail.mime.charset"; + + // 其他 + private static final String MAIL_DEBUG = "mail.debug"; + + public static final String[] MAIL_SETTING_PATHS = new String[]{"config/mail.setting", "config/mailAccount.setting", "mail.setting"}; + + /** + * SMTP服务器域名 + */ + private String host; + /** + * SMTP服务端口 + */ + private Integer port; + /** + * 是否需要用户名密码验证 + */ + private Boolean auth; + /** + * 用户名 + */ + private String user; + /** + * 密码 + */ + private String pass; + /** + * 发送方,遵循RFC-822标准 + */ + private String from; + + /** + * 是否打开调试模式,调试模式会显示与邮件服务器通信过程,默认不开启 + */ + private boolean debug; + /** + * 编码用于编码邮件正文和发送人、收件人等中文 + */ + private Charset charset = CharsetUtil.CHARSET_UTF_8; + /** + * 对于超长参数是否切分为多份,默认为false(国内邮箱附件不支持切分的附件名) + */ + private boolean splitlongparameters = false; + /** + * 对于文件名是否使用{@link #charset}编码,默认为 {@code true} + */ + private boolean encodefilename = true; + + /** + * 使用 STARTTLS安全连接,STARTTLS是对纯文本通信协议的扩展。它将纯文本连接升级为加密连接(TLS或SSL), 而不是使用一个单独的加密通信端口。 + */ + private boolean starttlsEnable = false; + /** + * 使用 SSL安全连接 + */ + private Boolean sslEnable; + + /** + * SSL协议,多个协议用空格分隔 + */ + private String sslProtocols; + + /** + * 指定实现javax.net.SocketFactory接口的类的名称,这个类将被用于创建SMTP的套接字 + */ + private String socketFactoryClass = "javax.net.ssl.SSLSocketFactory"; + /** + * 如果设置为true,未能创建一个套接字使用指定的套接字工厂类将导致使用java.net.Socket创建的套接字类, 默认值为true + */ + private boolean socketFactoryFallback; + /** + * 指定的端口连接到在使用指定的套接字工厂。如果没有设置,将使用默认端口 + */ + private int socketFactoryPort = 465; + + /** + * SMTP超时时长,单位毫秒,缺省值不超时 + */ + private long timeout; + /** + * Socket连接超时值,单位毫秒,缺省值不超时 + */ + private long connectionTimeout; + /** + * Socket写出超时值,单位毫秒,缺省值不超时 + */ + private long writeTimeout; + + /** + * 自定义的其他属性,此自定义属性会覆盖默认属性 + */ + private final Map customProperty = new HashMap<>(); + + // -------------------------------------------------------------- Constructor start + + /** + * 构造,所有参数需自行定义或保持默认值 + */ + public MailAccount() { + } + + /** + * 构造 + * + * @param settingPath 配置文件路径 + */ + public MailAccount(String settingPath) { + this(new Setting(settingPath)); + } + + /** + * 构造 + * + * @param setting 配置文件 + */ + public MailAccount(Setting setting) { + setting.toBean(this); + } + + // -------------------------------------------------------------- Constructor end + + /** + * 获得SMTP服务器域名 + * + * @return SMTP服务器域名 + */ + public String getHost() { + return host; + } + + /** + * 设置SMTP服务器域名 + * + * @param host SMTP服务器域名 + * @return this + */ + public MailAccount setHost(String host) { + this.host = host; + return this; + } + + /** + * 获得SMTP服务端口 + * + * @return SMTP服务端口 + */ + public Integer getPort() { + return port; + } + + /** + * 设置SMTP服务端口 + * + * @param port SMTP服务端口 + * @return this + */ + public MailAccount setPort(Integer port) { + this.port = port; + return this; + } + + /** + * 是否需要用户名密码验证 + * + * @return 是否需要用户名密码验证 + */ + public Boolean isAuth() { + return auth; + } + + /** + * 设置是否需要用户名密码验证 + * + * @param isAuth 是否需要用户名密码验证 + * @return this + */ + public MailAccount setAuth(boolean isAuth) { + this.auth = isAuth; + return this; + } + + /** + * 获取用户名 + * + * @return 用户名 + */ + public String getUser() { + return user; + } + + /** + * 设置用户名 + * + * @param user 用户名 + * @return this + */ + public MailAccount setUser(String user) { + this.user = user; + return this; + } + + /** + * 获取密码 + * + * @return 密码 + */ + public String getPass() { + return pass; + } + + /** + * 设置密码 + * + * @param pass 密码 + * @return this + */ + public MailAccount setPass(String pass) { + this.pass = pass; + return this; + } + + /** + * 获取发送方,遵循RFC-822标准 + * + * @return 发送方,遵循RFC-822标准 + */ + public String getFrom() { + return from; + } + + /** + * 设置发送方,遵循RFC-822标准
+ * 发件人可以是以下形式: + * + *
+     * 1. user@xxx.xx
+     * 2.  name <user@xxx.xx>
+     * 
+ * + * @param from 发送方,遵循RFC-822标准 + * @return this + */ + public MailAccount setFrom(String from) { + this.from = from; + return this; + } + + /** + * 是否打开调试模式,调试模式会显示与邮件服务器通信过程,默认不开启 + * + * @return 是否打开调试模式,调试模式会显示与邮件服务器通信过程,默认不开启 + * @since 4.0.2 + */ + public boolean isDebug() { + return debug; + } + + /** + * 设置是否打开调试模式,调试模式会显示与邮件服务器通信过程,默认不开启 + * + * @param debug 是否打开调试模式,调试模式会显示与邮件服务器通信过程,默认不开启 + * @return this + * @since 4.0.2 + */ + public MailAccount setDebug(boolean debug) { + this.debug = debug; + return this; + } + + /** + * 获取字符集编码 + * + * @return 编码,可能为{@code null} + */ + public Charset getCharset() { + return charset; + } + + /** + * 设置字符集编码,此选项不会修改全局配置,若修改全局配置,请设置此项为{@code null}并设置: + *
+     * 	System.setProperty("mail.mime.charset", charset);
+     * 
+ * + * @param charset 字符集编码,{@code null} 则表示使用全局设置的默认编码,全局编码为mail.mime.charset系统属性 + * @return this + */ + public MailAccount setCharset(Charset charset) { + this.charset = charset; + return this; + } + + /** + * 对于超长参数是否切分为多份,默认为false(国内邮箱附件不支持切分的附件名) + * + * @return 对于超长参数是否切分为多份 + */ + public boolean isSplitlongparameters() { + return splitlongparameters; + } + + /** + * 设置对于超长参数是否切分为多份,默认为false(国内邮箱附件不支持切分的附件名)
+ * 注意此项为全局设置,此项会调用 + *
+     * System.setProperty("mail.mime.splitlongparameters", true)
+     * 
+ * + * @param splitlongparameters 对于超长参数是否切分为多份 + */ + public void setSplitlongparameters(boolean splitlongparameters) { + this.splitlongparameters = splitlongparameters; + } + + /** + * 对于文件名是否使用{@link #charset}编码,默认为 {@code true} + * + * @return 对于文件名是否使用{@link #charset}编码,默认为 {@code true} + * @since 5.7.16 + */ + public boolean isEncodefilename() { + + return encodefilename; + } + + /** + * 设置对于文件名是否使用{@link #charset}编码,此选项不会修改全局配置
+ * 如果此选项设置为{@code false},则是否编码取决于两个系统属性: + *
    + *
  • mail.mime.encodefilename 是否编码附件文件名
  • + *
  • mail.mime.charset 编码文件名的编码
  • + *
+ * + * @param encodefilename 对于文件名是否使用{@link #charset}编码 + * @since 5.7.16 + */ + public void setEncodefilename(boolean encodefilename) { + this.encodefilename = encodefilename; + } + + /** + * 是否使用 STARTTLS安全连接,STARTTLS是对纯文本通信协议的扩展。它将纯文本连接升级为加密连接(TLS或SSL), 而不是使用一个单独的加密通信端口。 + * + * @return 是否使用 STARTTLS安全连接 + */ + public boolean isStarttlsEnable() { + return this.starttlsEnable; + } + + /** + * 设置是否使用STARTTLS安全连接,STARTTLS是对纯文本通信协议的扩展。它将纯文本连接升级为加密连接(TLS或SSL), 而不是使用一个单独的加密通信端口。 + * + * @param startttlsEnable 是否使用STARTTLS安全连接 + * @return this + */ + public MailAccount setStarttlsEnable(boolean startttlsEnable) { + this.starttlsEnable = startttlsEnable; + return this; + } + + /** + * 是否使用 SSL安全连接 + * + * @return 是否使用 SSL安全连接 + */ + public Boolean isSslEnable() { + return this.sslEnable; + } + + /** + * 设置是否使用SSL安全连接 + * + * @param sslEnable 是否使用SSL安全连接 + * @return this + */ + public MailAccount setSslEnable(Boolean sslEnable) { + this.sslEnable = sslEnable; + return this; + } + + /** + * 获取SSL协议,多个协议用空格分隔 + * + * @return SSL协议,多个协议用空格分隔 + * @since 5.5.7 + */ + public String getSslProtocols() { + return sslProtocols; + } + + /** + * 设置SSL协议,多个协议用空格分隔 + * + * @param sslProtocols SSL协议,多个协议用空格分隔 + * @since 5.5.7 + */ + public void setSslProtocols(String sslProtocols) { + this.sslProtocols = sslProtocols; + } + + /** + * 获取指定实现javax.net.SocketFactory接口的类的名称,这个类将被用于创建SMTP的套接字 + * + * @return 指定实现javax.net.SocketFactory接口的类的名称, 这个类将被用于创建SMTP的套接字 + */ + public String getSocketFactoryClass() { + return socketFactoryClass; + } + + /** + * 设置指定实现javax.net.SocketFactory接口的类的名称,这个类将被用于创建SMTP的套接字 + * + * @param socketFactoryClass 指定实现javax.net.SocketFactory接口的类的名称,这个类将被用于创建SMTP的套接字 + * @return this + */ + public MailAccount setSocketFactoryClass(String socketFactoryClass) { + this.socketFactoryClass = socketFactoryClass; + return this; + } + + /** + * 如果设置为true,未能创建一个套接字使用指定的套接字工厂类将导致使用java.net.Socket创建的套接字类, 默认值为true + * + * @return 如果设置为true, 未能创建一个套接字使用指定的套接字工厂类将导致使用java.net.Socket创建的套接字类, 默认值为true + */ + public boolean isSocketFactoryFallback() { + return socketFactoryFallback; + } + + /** + * 如果设置为true,未能创建一个套接字使用指定的套接字工厂类将导致使用java.net.Socket创建的套接字类, 默认值为true + * + * @param socketFactoryFallback 如果设置为true,未能创建一个套接字使用指定的套接字工厂类将导致使用java.net.Socket创建的套接字类, 默认值为true + * @return this + */ + public MailAccount setSocketFactoryFallback(boolean socketFactoryFallback) { + this.socketFactoryFallback = socketFactoryFallback; + return this; + } + + /** + * 获取指定的端口连接到在使用指定的套接字工厂。如果没有设置,将使用默认端口 + * + * @return 指定的端口连接到在使用指定的套接字工厂。如果没有设置,将使用默认端口 + */ + public int getSocketFactoryPort() { + return socketFactoryPort; + } + + /** + * 指定的端口连接到在使用指定的套接字工厂。如果没有设置,将使用默认端口 + * + * @param socketFactoryPort 指定的端口连接到在使用指定的套接字工厂。如果没有设置,将使用默认端口 + * @return this + */ + public MailAccount setSocketFactoryPort(int socketFactoryPort) { + this.socketFactoryPort = socketFactoryPort; + return this; + } + + /** + * 设置SMTP超时时长,单位毫秒,缺省值不超时 + * + * @param timeout SMTP超时时长,单位毫秒,缺省值不超时 + * @return this + * @since 4.1.17 + */ + public MailAccount setTimeout(long timeout) { + this.timeout = timeout; + return this; + } + + /** + * 设置Socket连接超时值,单位毫秒,缺省值不超时 + * + * @param connectionTimeout Socket连接超时值,单位毫秒,缺省值不超时 + * @return this + * @since 4.1.17 + */ + public MailAccount setConnectionTimeout(long connectionTimeout) { + this.connectionTimeout = connectionTimeout; + return this; + } + + /** + * 设置Socket写出超时值,单位毫秒,缺省值不超时 + * + * @param writeTimeout Socket写出超时值,单位毫秒,缺省值不超时 + * @return this + * @since 5.8.3 + */ + public MailAccount setWriteTimeout(long writeTimeout) { + this.writeTimeout = writeTimeout; + return this; + } + + /** + * 获取自定义属性列表 + * + * @return 自定义参数列表 + * @since 5.6.4 + */ + public Map getCustomProperty() { + return customProperty; + } + + /** + * 设置自定义属性,如mail.smtp.ssl.socketFactory + * + * @param key 属性名,空白被忽略 + * @param value 属性值, null被忽略 + * @return this + * @since 5.6.4 + */ + public MailAccount setCustomProperty(String key, Object value) { + if (StrUtil.isNotBlank(key) && ObjectUtil.isNotNull(value)) { + this.customProperty.put(key, value); + } + return this; + } + + /** + * 获得SMTP相关信息 + * + * @return {@link Properties} + */ + public Properties getSmtpProps() { + //全局系统参数 + System.setProperty(SPLIT_LONG_PARAMS, String.valueOf(this.splitlongparameters)); + + final Properties p = new Properties(); + p.put(MAIL_PROTOCOL, "smtp"); + p.put(SMTP_HOST, this.host); + p.put(SMTP_PORT, String.valueOf(this.port)); + p.put(SMTP_AUTH, String.valueOf(this.auth)); + if (this.timeout > 0) { + p.put(SMTP_TIMEOUT, String.valueOf(this.timeout)); + } + if (this.connectionTimeout > 0) { + p.put(SMTP_CONNECTION_TIMEOUT, String.valueOf(this.connectionTimeout)); + } + // issue#2355 + if (this.writeTimeout > 0) { + p.put(SMTP_WRITE_TIMEOUT, String.valueOf(this.writeTimeout)); + } + + p.put(MAIL_DEBUG, String.valueOf(this.debug)); + + if (this.starttlsEnable) { + //STARTTLS是对纯文本通信协议的扩展。它将纯文本连接升级为加密连接(TLS或SSL), 而不是使用一个单独的加密通信端口。 + p.put(STARTTLS_ENABLE, "true"); + + if (null == this.sslEnable) { + //为了兼容旧版本,当用户没有此项配置时,按照starttlsEnable开启状态时对待 + this.sslEnable = true; + } + } + + // SSL + if (null != this.sslEnable && this.sslEnable) { + p.put(SSL_ENABLE, "true"); + p.put(SOCKET_FACTORY, socketFactoryClass); + p.put(SOCKET_FACTORY_FALLBACK, String.valueOf(this.socketFactoryFallback)); + p.put(SOCKET_FACTORY_PORT, String.valueOf(this.socketFactoryPort)); + // issue#IZN95@Gitee,在Linux下需自定义SSL协议版本 + if (StrUtil.isNotBlank(this.sslProtocols)) { + p.put(SSL_PROTOCOLS, this.sslProtocols); + } + } + + // 补充自定义属性,允许自定属性覆盖已经设置的值 + p.putAll(this.customProperty); + + return p; + } + + /** + * 如果某些值为null,使用默认值 + * + * @return this + */ + public MailAccount defaultIfEmpty() { + // 去掉发件人的姓名部分 + final String fromAddress = InternalMailUtil.parseFirstAddress(this.from, this.charset).getAddress(); + + if (StrUtil.isBlank(this.host)) { + // 如果SMTP地址为空,默认使用smtp.<发件人邮箱后缀> + this.host = StrUtil.format("smtp.{}", StrUtil.subSuf(fromAddress, fromAddress.indexOf('@') + 1)); + } + if (StrUtil.isBlank(user)) { + // 如果用户名为空,默认为发件人(issue#I4FYVY@Gitee) + //this.user = StrUtil.subPre(fromAddress, fromAddress.indexOf('@')); + this.user = fromAddress; + } + if (null == this.auth) { + // 如果密码非空白,则使用认证模式 + this.auth = (false == StrUtil.isBlank(this.pass)); + } + if (null == this.port) { + // 端口在SSL状态下默认与socketFactoryPort一致,非SSL状态下默认为25 + this.port = (null != this.sslEnable && this.sslEnable) ? this.socketFactoryPort : 25; + } + if (null == this.charset) { + // 默认UTF-8编码 + this.charset = CharsetUtil.CHARSET_UTF_8; + } + + return this; + } + + @Override + public String toString() { + return "MailAccount [host=" + host + ", port=" + port + ", auth=" + auth + ", user=" + user + ", pass=" + (StrUtil.isEmpty(this.pass) ? "" : "******") + ", from=" + from + ", startttlsEnable=" + + starttlsEnable + ", socketFactoryClass=" + socketFactoryClass + ", socketFactoryFallback=" + socketFactoryFallback + ", socketFactoryPort=" + socketFactoryPort + "]"; + } +} diff --git a/ruoyi-common/ruoyi-common-mail/src/main/java/com/ruoyi/common/mail/utils/MailException.java b/ruoyi-common/ruoyi-common-mail/src/main/java/com/ruoyi/common/mail/utils/MailException.java new file mode 100644 index 0000000..f1aa0b2 --- /dev/null +++ b/ruoyi-common/ruoyi-common-mail/src/main/java/com/ruoyi/common/mail/utils/MailException.java @@ -0,0 +1,40 @@ +package com.ruoyi.common.mail.utils; + +import cn.hutool.core.exceptions.ExceptionUtil; +import cn.hutool.core.util.StrUtil; + +import java.io.Serial; + +/** + * 邮件异常 + * + * @author xiaoleilu + */ +public class MailException extends RuntimeException { + @Serial + private static final long serialVersionUID = 8247610319171014183L; + + public MailException(Throwable e) { + super(ExceptionUtil.getMessage(e), e); + } + + public MailException(String message) { + super(message); + } + + public MailException(String messageTemplate, Object... params) { + super(StrUtil.format(messageTemplate, params)); + } + + public MailException(String message, Throwable throwable) { + super(message, throwable); + } + + public MailException(String message, Throwable throwable, boolean enableSuppression, boolean writableStackTrace) { + super(message, throwable, enableSuppression, writableStackTrace); + } + + public MailException(Throwable throwable, String messageTemplate, Object... params) { + super(StrUtil.format(messageTemplate, params), throwable); + } +} diff --git a/ruoyi-common/ruoyi-common-mail/src/main/java/com/ruoyi/common/mail/utils/MailUtils.java b/ruoyi-common/ruoyi-common-mail/src/main/java/com/ruoyi/common/mail/utils/MailUtils.java new file mode 100644 index 0000000..ab3fe64 --- /dev/null +++ b/ruoyi-common/ruoyi-common-mail/src/main/java/com/ruoyi/common/mail/utils/MailUtils.java @@ -0,0 +1,467 @@ +package com.ruoyi.common.mail.utils; + +import cn.hutool.core.collection.CollUtil; +import cn.hutool.core.io.IoUtil; +import cn.hutool.core.map.MapUtil; +import cn.hutool.core.util.CharUtil; +import cn.hutool.core.util.StrUtil; +import jakarta.mail.Authenticator; +import jakarta.mail.Session; +import lombok.AccessLevel; +import lombok.NoArgsConstructor; +import com.ruoyi.common.core.utils.SpringUtils; +import com.ruoyi.common.core.utils.StringUtils; + +import java.io.File; +import java.io.InputStream; +import java.util.Collection; +import java.util.List; +import java.util.Map; + + +/** + * 邮件工具类 + */ +@NoArgsConstructor(access = AccessLevel.PRIVATE) +public class MailUtils { + + private static final MailAccount ACCOUNT = SpringUtils.getBean(MailAccount.class); + + /** + * 获取邮件发送实例 + */ + public static MailAccount getMailAccount() { + return ACCOUNT; + } + + /** + * 获取邮件发送实例 (自定义发送人以及授权码) + * + * @param user 发送人 + * @param pass 授权码 + */ + public static MailAccount getMailAccount(String from, String user, String pass) { + ACCOUNT.setFrom(StringUtils.blankToDefault(from, ACCOUNT.getFrom())); + ACCOUNT.setUser(StringUtils.blankToDefault(user, ACCOUNT.getUser())); + ACCOUNT.setPass(StringUtils.blankToDefault(pass, ACCOUNT.getPass())); + return ACCOUNT; + } + + /** + * 使用配置文件中设置的账户发送文本邮件,发送给单个或多个收件人
+ * 多个收件人可以使用逗号“,”分隔,也可以通过分号“;”分隔 + * + * @param to 收件人 + * @param subject 标题 + * @param content 正文 + * @param files 附件列表 + * @return message-id + * @since 3.2.0 + */ + public static String sendText(String to, String subject, String content, File... files) { + return send(to, subject, content, false, files); + } + + /** + * 使用配置文件中设置的账户发送HTML邮件,发送给单个或多个收件人
+ * 多个收件人可以使用逗号“,”分隔,也可以通过分号“;”分隔 + * + * @param to 收件人 + * @param subject 标题 + * @param content 正文 + * @param files 附件列表 + * @return message-id + * @since 3.2.0 + */ + public static String sendHtml(String to, String subject, String content, File... files) { + return send(to, subject, content, true, files); + } + + /** + * 使用配置文件中设置的账户发送邮件,发送单个或多个收件人
+ * 多个收件人可以使用逗号“,”分隔,也可以通过分号“;”分隔 + * + * @param to 收件人 + * @param subject 标题 + * @param content 正文 + * @param isHtml 是否为HTML + * @param files 附件列表 + * @return message-id + */ + public static String send(String to, String subject, String content, boolean isHtml, File... files) { + return send(splitAddress(to), subject, content, isHtml, files); + } + + /** + * 使用配置文件中设置的账户发送邮件,发送单个或多个收件人
+ * 多个收件人、抄送人、密送人可以使用逗号“,”分隔,也可以通过分号“;”分隔 + * + * @param to 收件人,可以使用逗号“,”分隔,也可以通过分号“;”分隔 + * @param cc 抄送人,可以使用逗号“,”分隔,也可以通过分号“;”分隔 + * @param bcc 密送人,可以使用逗号“,”分隔,也可以通过分号“;”分隔 + * @param subject 标题 + * @param content 正文 + * @param isHtml 是否为HTML + * @param files 附件列表 + * @return message-id + * @since 4.0.3 + */ + public static String send(String to, String cc, String bcc, String subject, String content, boolean isHtml, File... files) { + return send(splitAddress(to), splitAddress(cc), splitAddress(bcc), subject, content, isHtml, files); + } + + /** + * 使用配置文件中设置的账户发送文本邮件,发送给多人 + * + * @param tos 收件人列表 + * @param subject 标题 + * @param content 正文 + * @param files 附件列表 + * @return message-id + */ + public static String sendText(Collection tos, String subject, String content, File... files) { + return send(tos, subject, content, false, files); + } + + /** + * 使用配置文件中设置的账户发送HTML邮件,发送给多人 + * + * @param tos 收件人列表 + * @param subject 标题 + * @param content 正文 + * @param files 附件列表 + * @return message-id + * @since 3.2.0 + */ + public static String sendHtml(Collection tos, String subject, String content, File... files) { + return send(tos, subject, content, true, files); + } + + /** + * 使用配置文件中设置的账户发送邮件,发送给多人 + * + * @param tos 收件人列表 + * @param subject 标题 + * @param content 正文 + * @param isHtml 是否为HTML + * @param files 附件列表 + * @return message-id + */ + public static String send(Collection tos, String subject, String content, boolean isHtml, File... files) { + return send(tos, null, null, subject, content, isHtml, files); + } + + /** + * 使用配置文件中设置的账户发送邮件,发送给多人 + * + * @param tos 收件人列表 + * @param ccs 抄送人列表,可以为null或空 + * @param bccs 密送人列表,可以为null或空 + * @param subject 标题 + * @param content 正文 + * @param isHtml 是否为HTML + * @param files 附件列表 + * @return message-id + * @since 4.0.3 + */ + public static String send(Collection tos, Collection ccs, Collection bccs, String subject, String content, boolean isHtml, File... files) { + return send(getMailAccount(), true, tos, ccs, bccs, subject, content, null, isHtml, files); + } + + // ------------------------------------------------------------------------------------------------------------------------------- Custom MailAccount + + /** + * 发送邮件给多人 + * + * @param mailAccount 邮件认证对象 + * @param to 收件人,多个收件人逗号或者分号隔开 + * @param subject 标题 + * @param content 正文 + * @param isHtml 是否为HTML格式 + * @param files 附件列表 + * @return message-id + * @since 3.2.0 + */ + public static String send(MailAccount mailAccount, String to, String subject, String content, boolean isHtml, File... files) { + return send(mailAccount, splitAddress(to), subject, content, isHtml, files); + } + + /** + * 发送邮件给多人 + * + * @param mailAccount 邮件帐户信息 + * @param tos 收件人列表 + * @param subject 标题 + * @param content 正文 + * @param isHtml 是否为HTML格式 + * @param files 附件列表 + * @return message-id + */ + public static String send(MailAccount mailAccount, Collection tos, String subject, String content, boolean isHtml, File... files) { + return send(mailAccount, tos, null, null, subject, content, isHtml, files); + } + + /** + * 发送邮件给多人 + * + * @param mailAccount 邮件帐户信息 + * @param tos 收件人列表 + * @param ccs 抄送人列表,可以为null或空 + * @param bccs 密送人列表,可以为null或空 + * @param subject 标题 + * @param content 正文 + * @param isHtml 是否为HTML格式 + * @param files 附件列表 + * @return message-id + * @since 4.0.3 + */ + public static String send(MailAccount mailAccount, Collection tos, Collection ccs, Collection bccs, String subject, String content, boolean isHtml, File... files) { + return send(mailAccount, false, tos, ccs, bccs, subject, content, null, isHtml, files); + } + + /** + * 使用配置文件中设置的账户发送HTML邮件,发送给单个或多个收件人
+ * 多个收件人可以使用逗号“,”分隔,也可以通过分号“;”分隔 + * + * @param to 收件人 + * @param subject 标题 + * @param content 正文 + * @param imageMap 图片与占位符,占位符格式为cid:$IMAGE_PLACEHOLDER + * @param files 附件列表 + * @return message-id + * @since 3.2.0 + */ + public static String sendHtml(String to, String subject, String content, Map imageMap, File... files) { + return send(to, subject, content, imageMap, true, files); + } + + /** + * 使用配置文件中设置的账户发送邮件,发送单个或多个收件人
+ * 多个收件人可以使用逗号“,”分隔,也可以通过分号“;”分隔 + * + * @param to 收件人 + * @param subject 标题 + * @param content 正文 + * @param imageMap 图片与占位符,占位符格式为cid:$IMAGE_PLACEHOLDER + * @param isHtml 是否为HTML + * @param files 附件列表 + * @return message-id + */ + public static String send(String to, String subject, String content, Map imageMap, boolean isHtml, File... files) { + return send(splitAddress(to), subject, content, imageMap, isHtml, files); + } + + /** + * 使用配置文件中设置的账户发送邮件,发送单个或多个收件人
+ * 多个收件人、抄送人、密送人可以使用逗号“,”分隔,也可以通过分号“;”分隔 + * + * @param to 收件人,可以使用逗号“,”分隔,也可以通过分号“;”分隔 + * @param cc 抄送人,可以使用逗号“,”分隔,也可以通过分号“;”分隔 + * @param bcc 密送人,可以使用逗号“,”分隔,也可以通过分号“;”分隔 + * @param subject 标题 + * @param content 正文 + * @param imageMap 图片与占位符,占位符格式为cid:$IMAGE_PLACEHOLDER + * @param isHtml 是否为HTML + * @param files 附件列表 + * @return message-id + * @since 4.0.3 + */ + public static String send(String to, String cc, String bcc, String subject, String content, Map imageMap, boolean isHtml, File... files) { + return send(splitAddress(to), splitAddress(cc), splitAddress(bcc), subject, content, imageMap, isHtml, files); + } + + /** + * 使用配置文件中设置的账户发送HTML邮件,发送给多人 + * + * @param tos 收件人列表 + * @param subject 标题 + * @param content 正文 + * @param imageMap 图片与占位符,占位符格式为cid:$IMAGE_PLACEHOLDER + * @param files 附件列表 + * @return message-id + * @since 3.2.0 + */ + public static String sendHtml(Collection tos, String subject, String content, Map imageMap, File... files) { + return send(tos, subject, content, imageMap, true, files); + } + + /** + * 使用配置文件中设置的账户发送邮件,发送给多人 + * + * @param tos 收件人列表 + * @param subject 标题 + * @param content 正文 + * @param imageMap 图片与占位符,占位符格式为cid:$IMAGE_PLACEHOLDER + * @param isHtml 是否为HTML + * @param files 附件列表 + * @return message-id + */ + public static String send(Collection tos, String subject, String content, Map imageMap, boolean isHtml, File... files) { + return send(tos, null, null, subject, content, imageMap, isHtml, files); + } + + /** + * 使用配置文件中设置的账户发送邮件,发送给多人 + * + * @param tos 收件人列表 + * @param ccs 抄送人列表,可以为null或空 + * @param bccs 密送人列表,可以为null或空 + * @param subject 标题 + * @param content 正文 + * @param imageMap 图片与占位符,占位符格式为cid:$IMAGE_PLACEHOLDER + * @param isHtml 是否为HTML + * @param files 附件列表 + * @return message-id + * @since 4.0.3 + */ + public static String send(Collection tos, Collection ccs, Collection bccs, String subject, String content, Map imageMap, boolean isHtml, File... files) { + return send(getMailAccount(), true, tos, ccs, bccs, subject, content, imageMap, isHtml, files); + } + + // ------------------------------------------------------------------------------------------------------------------------------- Custom MailAccount + + /** + * 发送邮件给多人 + * + * @param mailAccount 邮件认证对象 + * @param to 收件人,多个收件人逗号或者分号隔开 + * @param subject 标题 + * @param content 正文 + * @param imageMap 图片与占位符,占位符格式为cid:$IMAGE_PLACEHOLDER + * @param isHtml 是否为HTML格式 + * @param files 附件列表 + * @return message-id + * @since 3.2.0 + */ + public static String send(MailAccount mailAccount, String to, String subject, String content, Map imageMap, boolean isHtml, File... files) { + return send(mailAccount, splitAddress(to), subject, content, imageMap, isHtml, files); + } + + /** + * 发送邮件给多人 + * + * @param mailAccount 邮件帐户信息 + * @param tos 收件人列表 + * @param subject 标题 + * @param content 正文 + * @param imageMap 图片与占位符,占位符格式为cid:$IMAGE_PLACEHOLDER + * @param isHtml 是否为HTML格式 + * @param files 附件列表 + * @return message-id + * @since 4.6.3 + */ + public static String send(MailAccount mailAccount, Collection tos, String subject, String content, Map imageMap, boolean isHtml, File... files) { + return send(mailAccount, tos, null, null, subject, content, imageMap, isHtml, files); + } + + /** + * 发送邮件给多人 + * + * @param mailAccount 邮件帐户信息 + * @param tos 收件人列表 + * @param ccs 抄送人列表,可以为null或空 + * @param bccs 密送人列表,可以为null或空 + * @param subject 标题 + * @param content 正文 + * @param imageMap 图片与占位符,占位符格式为cid:$IMAGE_PLACEHOLDER + * @param isHtml 是否为HTML格式 + * @param files 附件列表 + * @return message-id + * @since 4.6.3 + */ + public static String send(MailAccount mailAccount, Collection tos, Collection ccs, Collection bccs, String subject, String content, Map imageMap, + boolean isHtml, File... files) { + return send(mailAccount, false, tos, ccs, bccs, subject, content, imageMap, isHtml, files); + } + + /** + * 根据配置文件,获取邮件客户端会话 + * + * @param mailAccount 邮件账户配置 + * @param isSingleton 是否单例(全局共享会话) + * @return {@link Session} + * @since 5.5.7 + */ + public static Session getSession(MailAccount mailAccount, boolean isSingleton) { + Authenticator authenticator = null; + if (mailAccount.isAuth()) { + authenticator = new UserPassAuthenticator(mailAccount.getUser(), mailAccount.getPass()); + } + + return isSingleton ? Session.getDefaultInstance(mailAccount.getSmtpProps(), authenticator) // + : Session.getInstance(mailAccount.getSmtpProps(), authenticator); + } + + // ------------------------------------------------------------------------------------------------------------------------ Private method start + + /** + * 发送邮件给多人 + * + * @param mailAccount 邮件帐户信息 + * @param useGlobalSession 是否全局共享Session + * @param tos 收件人列表 + * @param ccs 抄送人列表,可以为null或空 + * @param bccs 密送人列表,可以为null或空 + * @param subject 标题 + * @param content 正文 + * @param imageMap 图片与占位符,占位符格式为cid:${cid} + * @param isHtml 是否为HTML格式 + * @param files 附件列表 + * @return message-id + * @since 4.6.3 + */ + private static String send(MailAccount mailAccount, boolean useGlobalSession, Collection tos, Collection ccs, Collection bccs, String subject, String content, + Map imageMap, boolean isHtml, File... files) { + final Mail mail = Mail.create(mailAccount).setUseGlobalSession(useGlobalSession); + + // 可选抄送人 + if (CollUtil.isNotEmpty(ccs)) { + mail.setCcs(ccs.toArray(new String[0])); + } + // 可选密送人 + if (CollUtil.isNotEmpty(bccs)) { + mail.setBccs(bccs.toArray(new String[0])); + } + + mail.setTos(tos.toArray(new String[0])); + mail.setTitle(subject); + mail.setContent(content); + mail.setHtml(isHtml); + mail.setFiles(files); + + // 图片 + if (MapUtil.isNotEmpty(imageMap)) { + for (Map.Entry entry : imageMap.entrySet()) { + mail.addImage(entry.getKey(), entry.getValue()); + // 关闭流 + IoUtil.close(entry.getValue()); + } + } + + return mail.send(); + } + + /** + * 将多个联系人转为列表,分隔符为逗号或者分号 + * + * @param addresses 多个联系人,如果为空返回null + * @return 联系人列表 + */ + private static List splitAddress(String addresses) { + if (StrUtil.isBlank(addresses)) { + return null; + } + + List result; + if (StrUtil.contains(addresses, CharUtil.COMMA)) { + result = StrUtil.splitTrim(addresses, CharUtil.COMMA); + } else if (StrUtil.contains(addresses, ';')) { + result = StrUtil.splitTrim(addresses, ';'); + } else { + result = CollUtil.newArrayList(addresses); + } + return result; + } + // ------------------------------------------------------------------------------------------------------------------------ Private method end + +} diff --git a/ruoyi-common/ruoyi-common-mail/src/main/java/com/ruoyi/common/mail/utils/UserPassAuthenticator.java b/ruoyi-common/ruoyi-common-mail/src/main/java/com/ruoyi/common/mail/utils/UserPassAuthenticator.java new file mode 100644 index 0000000..01b721d --- /dev/null +++ b/ruoyi-common/ruoyi-common-mail/src/main/java/com/ruoyi/common/mail/utils/UserPassAuthenticator.java @@ -0,0 +1,33 @@ +package com.ruoyi.common.mail.utils; + +import jakarta.mail.Authenticator; +import jakarta.mail.PasswordAuthentication; + +/** + * 用户名密码验证器 + * + * @author looly + * @since 3.1.2 + */ +public class UserPassAuthenticator extends Authenticator { + + private final String user; + private final String pass; + + /** + * 构造 + * + * @param user 用户名 + * @param pass 密码 + */ + public UserPassAuthenticator(String user, String pass) { + this.user = user; + this.pass = pass; + } + + @Override + protected PasswordAuthentication getPasswordAuthentication() { + return new PasswordAuthentication(this.user, this.pass); + } + +} diff --git a/ruoyi-common/ruoyi-common-mail/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports b/ruoyi-common/ruoyi-common-mail/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports new file mode 100644 index 0000000..f067b8b --- /dev/null +++ b/ruoyi-common/ruoyi-common-mail/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports @@ -0,0 +1 @@ +com.ruoyi.common.mail.config.MailConfig diff --git a/ruoyi-common/ruoyi-common-mybatis/pom.xml b/ruoyi-common/ruoyi-common-mybatis/pom.xml new file mode 100644 index 0000000..43ea284 --- /dev/null +++ b/ruoyi-common/ruoyi-common-mybatis/pom.xml @@ -0,0 +1,47 @@ + + + + com.ruoyi + ruoyi-common + ${revision} + + 4.0.0 + + ruoyi-common-mybatis + + + ruoyi-common-mybatis 数据库服务 + + + + + com.ruoyi + ruoyi-common-core + + + + com.ruoyi + ruoyi-common-satoken + + + + + com.baomidou + dynamic-datasource-spring-boot3-starter + + + + com.baomidou + mybatis-plus-spring-boot3-starter + + + + + p6spy + p6spy + + + + diff --git a/ruoyi-common/ruoyi-common-mybatis/src/main/java/com/rouyi/common/mybatis/annotation/DataColumn.java b/ruoyi-common/ruoyi-common-mybatis/src/main/java/com/rouyi/common/mybatis/annotation/DataColumn.java new file mode 100644 index 0000000..a034c78 --- /dev/null +++ b/ruoyi-common/ruoyi-common-mybatis/src/main/java/com/rouyi/common/mybatis/annotation/DataColumn.java @@ -0,0 +1,28 @@ +package com.rouyi.common.mybatis.annotation; + +import java.lang.annotation.*; + +/** + * 数据权限 + * + * 一个注解只能对应一个模板 + * + * @author Lion Li + * @version 3.5.0 + */ +@Target(ElementType.METHOD) +@Retention(RetentionPolicy.RUNTIME) +@Documented +public @interface DataColumn { + + /** + * 占位符关键字 + */ + String[] key() default "deptName"; + + /** + * 占位符替换值 + */ + String[] value() default "dept_id"; + +} diff --git a/ruoyi-common/ruoyi-common-mybatis/src/main/java/com/rouyi/common/mybatis/annotation/DataPermission.java b/ruoyi-common/ruoyi-common-mybatis/src/main/java/com/rouyi/common/mybatis/annotation/DataPermission.java new file mode 100644 index 0000000..f1039c9 --- /dev/null +++ b/ruoyi-common/ruoyi-common-mybatis/src/main/java/com/rouyi/common/mybatis/annotation/DataPermission.java @@ -0,0 +1,18 @@ +package com.rouyi.common.mybatis.annotation; + +import java.lang.annotation.*; + +/** + * 数据权限组 + * + * @author Lion Li + * @version 3.5.0 + */ +@Target({ElementType.METHOD, ElementType.TYPE}) +@Retention(RetentionPolicy.RUNTIME) +@Documented +public @interface DataPermission { + + DataColumn[] value(); + +} diff --git a/ruoyi-common/ruoyi-common-mybatis/src/main/java/com/rouyi/common/mybatis/config/MybatisPlusConfig.java b/ruoyi-common/ruoyi-common-mybatis/src/main/java/com/rouyi/common/mybatis/config/MybatisPlusConfig.java new file mode 100644 index 0000000..18f8526 --- /dev/null +++ b/ruoyi-common/ruoyi-common-mybatis/src/main/java/com/rouyi/common/mybatis/config/MybatisPlusConfig.java @@ -0,0 +1,119 @@ +package com.rouyi.common.mybatis.config; + +import cn.hutool.core.net.NetUtil; +import com.baomidou.mybatisplus.core.handlers.MetaObjectHandler; +import com.baomidou.mybatisplus.core.incrementer.DefaultIdentifierGenerator; +import com.baomidou.mybatisplus.core.incrementer.IdentifierGenerator; +import com.baomidou.mybatisplus.extension.plugins.MybatisPlusInterceptor; +import com.baomidou.mybatisplus.extension.plugins.inner.OptimisticLockerInnerInterceptor; +import com.baomidou.mybatisplus.extension.plugins.inner.PaginationInnerInterceptor; +import com.baomidou.mybatisplus.extension.plugins.inner.TenantLineInnerInterceptor; +import com.rouyi.common.mybatis.handler.InjectionMetaObjectHandler; +import com.rouyi.common.mybatis.handler.MybatisExceptionHandler; +import com.ruoyi.common.core.factory.YmlPropertySourceFactory; +import com.ruoyi.common.core.utils.SpringUtils; +import com.rouyi.common.mybatis.interceptor.PlusDataPermissionInterceptor; +import org.mybatis.spring.annotation.MapperScan; +import org.springframework.beans.BeansException; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.PropertySource; +import org.springframework.transaction.annotation.EnableTransactionManagement; + +/** + * mybatis-plus配置类(下方注释有插件介绍) + * + * @author Lion Li + */ +@EnableTransactionManagement(proxyTargetClass = true) +@MapperScan("${mybatis-plus.mapperPackage}") +@PropertySource(value = "classpath:common-mybatis.yml", factory = YmlPropertySourceFactory.class) +public class MybatisPlusConfig { + + @Bean + public MybatisPlusInterceptor mybatisPlusInterceptor() { + MybatisPlusInterceptor interceptor = new MybatisPlusInterceptor(); + // 多租户插件 必须放到第一位 + try { + TenantLineInnerInterceptor tenant = SpringUtils.getBean(TenantLineInnerInterceptor.class); + interceptor.addInnerInterceptor(tenant); + } catch (BeansException ignore) { + } + // 数据权限处理 + interceptor.addInnerInterceptor(dataPermissionInterceptor()); + // 分页插件 + interceptor.addInnerInterceptor(paginationInnerInterceptor()); + // 乐观锁插件 + interceptor.addInnerInterceptor(optimisticLockerInnerInterceptor()); + return interceptor; + } + + /** + * 数据权限拦截器 + */ + public PlusDataPermissionInterceptor dataPermissionInterceptor() { + return new PlusDataPermissionInterceptor(SpringUtils.getProperty("mybatis-plus.mapperPackage")); + } + + /** + * 分页插件,自动识别数据库类型 + */ + public PaginationInnerInterceptor paginationInnerInterceptor() { + PaginationInnerInterceptor paginationInnerInterceptor = new PaginationInnerInterceptor(); + // 分页合理化 + paginationInnerInterceptor.setOverflow(true); + return paginationInnerInterceptor; + } + + /** + * 乐观锁插件 + */ + public OptimisticLockerInnerInterceptor optimisticLockerInnerInterceptor() { + return new OptimisticLockerInnerInterceptor(); + } + + /** + * 元对象字段填充控制器 + */ + @Bean + public MetaObjectHandler metaObjectHandler() { + return new InjectionMetaObjectHandler(); + } + + /** + * 使用网卡信息绑定雪花生成器 + * 防止集群雪花ID重复 + */ + @Bean + public IdentifierGenerator idGenerator() { + return new DefaultIdentifierGenerator(NetUtil.getLocalhost()); + } + + /** + * 异常处理器 + */ + @Bean + public MybatisExceptionHandler mybatisExceptionHandler() { + return new MybatisExceptionHandler(); + } + + /** + * PaginationInnerInterceptor 分页插件,自动识别数据库类型 + * https://baomidou.com/pages/97710a/ + * OptimisticLockerInnerInterceptor 乐观锁插件 + * https://baomidou.com/pages/0d93c0/ + * MetaObjectHandler 元对象字段填充控制器 + * https://baomidou.com/pages/4c6bcf/ + * ISqlInjector sql注入器 + * https://baomidou.com/pages/42ea4a/ + * BlockAttackInnerInterceptor 如果是对全表的删除或更新操作,就会终止该操作 + * https://baomidou.com/pages/f9a237/ + * IllegalSQLInnerInterceptor sql性能规范插件(垃圾SQL拦截) + * IdentifierGenerator 自定义主键策略 + * https://baomidou.com/pages/568eb2/ + * TenantLineInnerInterceptor 多租户插件 + * https://baomidou.com/pages/aef2f2/ + * DynamicTableNameInnerInterceptor 动态表名插件 + * https://baomidou.com/pages/2a45ff/ + */ + +} diff --git a/ruoyi-common/ruoyi-common-mybatis/src/main/java/com/rouyi/common/mybatis/core/domain/BaseEntity.java b/ruoyi-common/ruoyi-common-mybatis/src/main/java/com/rouyi/common/mybatis/core/domain/BaseEntity.java new file mode 100644 index 0000000..6a2ac6b --- /dev/null +++ b/ruoyi-common/ruoyi-common-mybatis/src/main/java/com/rouyi/common/mybatis/core/domain/BaseEntity.java @@ -0,0 +1,63 @@ +package com.rouyi.common.mybatis.core.domain; + +import com.baomidou.mybatisplus.annotation.FieldFill; +import com.baomidou.mybatisplus.annotation.TableField; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; +import java.util.HashMap; +import java.util.Map; + +/** + * Entity基类 + * + * @author Lion Li + */ + +@Data +public class BaseEntity implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 搜索值 + */ + @JsonIgnore + @TableField(exist = false) + private String searchValue; + + /** + * 创建者 + */ + @TableField(fill = FieldFill.INSERT) + private String createBy; + + /** + * 创建时间 + */ + @TableField(fill = FieldFill.INSERT) + private Date createTime; + + /** + * 更新者 + */ + @TableField(fill = FieldFill.INSERT_UPDATE) + private String updateBy; + + /** + * 更新时间 + */ + @TableField(fill = FieldFill.INSERT_UPDATE) + private Date updateTime; + + /** + * 请求参数 + */ + @JsonInclude(JsonInclude.Include.NON_EMPTY) + @TableField(exist = false) + private Map params = new HashMap<>(); + +} diff --git a/ruoyi-common/ruoyi-common-mybatis/src/main/java/com/rouyi/common/mybatis/core/mapper/BaseMapperPlus.java b/ruoyi-common/ruoyi-common-mybatis/src/main/java/com/rouyi/common/mybatis/core/mapper/BaseMapperPlus.java new file mode 100644 index 0000000..877d0e9 --- /dev/null +++ b/ruoyi-common/ruoyi-common-mybatis/src/main/java/com/rouyi/common/mybatis/core/mapper/BaseMapperPlus.java @@ -0,0 +1,202 @@ +package com.rouyi.common.mybatis.core.mapper; + +import cn.hutool.core.collection.CollUtil; +import cn.hutool.core.util.ObjectUtil; +import com.baomidou.mybatisplus.core.conditions.Wrapper; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.core.toolkit.reflect.GenericTypeUtils; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.baomidou.mybatisplus.extension.toolkit.Db; +import org.apache.ibatis.logging.Log; +import org.apache.ibatis.logging.LogFactory; +import com.ruoyi.common.core.utils.MapstructUtils; + +import java.io.Serializable; +import java.util.Collection; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.function.Function; +import java.util.stream.Collectors; + +/** + * 自定义 Mapper 接口, 实现 自定义扩展 + * + * @param table 泛型 + * @param vo 泛型 + * @author Lion Li + * @since 2021-05-13 + */ +@SuppressWarnings("unchecked") +public interface BaseMapperPlus extends BaseMapper { + + Log log = LogFactory.getLog(BaseMapperPlus.class); + + default Class currentVoClass() { + return (Class) GenericTypeUtils.resolveTypeArguments(this.getClass(), BaseMapperPlus.class)[1]; + } + + default Class currentModelClass() { + return (Class) GenericTypeUtils.resolveTypeArguments(this.getClass(), BaseMapperPlus.class)[0]; + } + + default List selectList() { + return this.selectList(new QueryWrapper<>()); + } + + /** + * 批量插入 + */ + default boolean insertBatch(Collection entityList) { + return Db.saveBatch(entityList); + } + + /** + * 批量更新 + */ + default boolean updateBatchById(Collection entityList) { + return Db.updateBatchById(entityList); + } + + /** + * 批量插入或更新 + */ + default boolean insertOrUpdateBatch(Collection entityList) { + return Db.saveOrUpdateBatch(entityList); + } + + /** + * 批量插入(包含限制条数) + */ + default boolean insertBatch(Collection entityList, int batchSize) { + return Db.saveBatch(entityList, batchSize); + } + + /** + * 批量更新(包含限制条数) + */ + default boolean updateBatchById(Collection entityList, int batchSize) { + return Db.updateBatchById(entityList, batchSize); + } + + /** + * 批量插入或更新(包含限制条数) + */ + default boolean insertOrUpdateBatch(Collection entityList, int batchSize) { + return Db.saveOrUpdateBatch(entityList, batchSize); + } + + default V selectVoById(Serializable id) { + return selectVoById(id, this.currentVoClass()); + } + + /** + * 根据 ID 查询 + */ + default C selectVoById(Serializable id, Class voClass) { + T obj = this.selectById(id); + if (ObjectUtil.isNull(obj)) { + return null; + } + return MapstructUtils.convert(obj, voClass); + } + + default List selectVoBatchIds(Collection idList) { + return selectVoBatchIds(idList, this.currentVoClass()); + } + + /** + * 查询(根据ID 批量查询) + */ + default List selectVoBatchIds(Collection idList, Class voClass) { + List list = this.selectBatchIds(idList); + if (CollUtil.isEmpty(list)) { + return CollUtil.newArrayList(); + } + return MapstructUtils.convert(list, voClass); + } + + default List selectVoByMap(Map map) { + return selectVoByMap(map, this.currentVoClass()); + } + + /** + * 查询(根据 columnMap 条件) + */ + default List selectVoByMap(Map map, Class voClass) { + List list = this.selectByMap(map); + if (CollUtil.isEmpty(list)) { + return CollUtil.newArrayList(); + } + return MapstructUtils.convert(list, voClass); + } + + default V selectVoOne(Wrapper wrapper) { + return selectVoOne(wrapper, this.currentVoClass()); + } + + default V selectVoOne(Wrapper wrapper, boolean throwEx) { + return selectVoOne(wrapper, this.currentVoClass(), throwEx); + } + + /** + * 根据 entity 条件,查询一条记录 + */ + default C selectVoOne(Wrapper wrapper, Class voClass) { + return selectVoOne(wrapper, voClass, true); + } + + /** + * 根据 entity 条件,查询一条记录 + */ + default C selectVoOne(Wrapper wrapper, Class voClass, boolean throwEx) { + T obj = this.selectOne(wrapper, throwEx); + if (ObjectUtil.isNull(obj)) { + return null; + } + return MapstructUtils.convert(obj, voClass); + } + + default List selectVoList() { + return selectVoList(new QueryWrapper<>(), this.currentVoClass()); + } + + default List selectVoList(Wrapper wrapper) { + return selectVoList(wrapper, this.currentVoClass()); + } + + /** + * 根据 entity 条件,查询全部记录 + */ + default List selectVoList(Wrapper wrapper, Class voClass) { + List list = this.selectList(wrapper); + if (CollUtil.isEmpty(list)) { + return CollUtil.newArrayList(); + } + return MapstructUtils.convert(list, voClass); + } + + default

> P selectVoPage(IPage page, Wrapper wrapper) { + return selectVoPage(page, wrapper, this.currentVoClass()); + } + + /** + * 分页查询VO + */ + default > P selectVoPage(IPage page, Wrapper wrapper, Class voClass) { + List list = this.selectList(page, wrapper); + IPage voPage = new Page<>(page.getCurrent(), page.getSize(), page.getTotal()); + if (CollUtil.isEmpty(list)) { + return (P) voPage; + } + voPage.setRecords(MapstructUtils.convert(list, voClass)); + return (P) voPage; + } + + default List selectObjs(Wrapper wrapper, Function mapper) { + return this.selectObjs(wrapper).stream().filter(Objects::nonNull).map(mapper).collect(Collectors.toList()); + } + +} diff --git a/ruoyi-common/ruoyi-common-mybatis/src/main/java/com/rouyi/common/mybatis/core/page/PageQuery.java b/ruoyi-common/ruoyi-common-mybatis/src/main/java/com/rouyi/common/mybatis/core/page/PageQuery.java new file mode 100644 index 0000000..ae969f3 --- /dev/null +++ b/ruoyi-common/ruoyi-common-mybatis/src/main/java/com/rouyi/common/mybatis/core/page/PageQuery.java @@ -0,0 +1,118 @@ +package com.rouyi.common.mybatis.core.page; + +import cn.hutool.core.collection.CollUtil; +import cn.hutool.core.util.ObjectUtil; +import com.baomidou.mybatisplus.core.metadata.OrderItem; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.ruoyi.common.core.exception.ServiceException; +import com.ruoyi.common.core.utils.StringUtils; +import com.ruoyi.common.core.utils.sql.SqlUtil; +import lombok.Data; + +import java.io.Serial; +import java.io.Serializable; +import java.util.ArrayList; +import java.util.List; + +/** + * 分页查询实体类 + * + * @author Lion Li + */ + +@Data +public class PageQuery implements Serializable { + + @Serial + private static final long serialVersionUID = 1L; + + /** + * 分页大小 + */ + private Integer pageSize; + + /** + * 当前页数 + */ + private Integer pageNum; + + /** + * 排序列 + */ + private String orderByColumn; + + /** + * 排序的方向desc或者asc + */ + private String isAsc; + + /** + * 当前记录起始索引 默认值 + */ + public static final int DEFAULT_PAGE_NUM = 1; + + /** + * 每页显示记录数 默认值 默认查全部 + */ + public static final int DEFAULT_PAGE_SIZE = Integer.MAX_VALUE; + + public Page build() { + Integer pageNum = ObjectUtil.defaultIfNull(getPageNum(), DEFAULT_PAGE_NUM); + Integer pageSize = ObjectUtil.defaultIfNull(getPageSize(), DEFAULT_PAGE_SIZE); + if (pageNum <= 0) { + pageNum = DEFAULT_PAGE_NUM; + } + Page page = new Page<>(pageNum, pageSize); + List orderItems = buildOrderItem(); + if (CollUtil.isNotEmpty(orderItems)) { + page.addOrder(orderItems); + } + return page; + } + + /** + * 构建排序 + * + * 支持的用法如下: + * {isAsc:"asc",orderByColumn:"id"} order by id asc + * {isAsc:"asc",orderByColumn:"id,createTime"} order by id asc,create_time asc + * {isAsc:"desc",orderByColumn:"id,createTime"} order by id desc,create_time desc + * {isAsc:"asc,desc",orderByColumn:"id,createTime"} order by id asc,create_time desc + */ + private List buildOrderItem() { + if (StringUtils.isBlank(orderByColumn) || StringUtils.isBlank(isAsc)) { + return null; + } + String orderBy = SqlUtil.escapeOrderBySql(orderByColumn); + orderBy = StringUtils.toUnderScoreCase(orderBy); + + // 兼容前端排序类型 + isAsc = StringUtils.replaceEach(isAsc, new String[]{"ascending", "descending"}, new String[]{"asc", "desc"}); + + String[] orderByArr = orderBy.split(StringUtils.SEPARATOR); + String[] isAscArr = isAsc.split(StringUtils.SEPARATOR); + if (isAscArr.length != 1 && isAscArr.length != orderByArr.length) { + throw new ServiceException("排序参数有误"); + } + + List list = new ArrayList<>(); + // 每个字段各自排序 + for (int i = 0; i < orderByArr.length; i++) { + String orderByStr = orderByArr[i]; + String isAscStr = isAscArr.length == 1 ? isAscArr[0] : isAscArr[i]; + if ("asc".equals(isAscStr)) { + list.add(OrderItem.asc(orderByStr)); + } else if ("desc".equals(isAscStr)) { + list.add(OrderItem.desc(orderByStr)); + } else { + throw new ServiceException("排序参数有误"); + } + } + return list; + } + + public Integer getFirstNum() { + return (pageNum - 1) * pageSize; + } + +} diff --git a/ruoyi-common/ruoyi-common-mybatis/src/main/java/com/rouyi/common/mybatis/core/page/TableDataInfo.java b/ruoyi-common/ruoyi-common-mybatis/src/main/java/com/rouyi/common/mybatis/core/page/TableDataInfo.java new file mode 100644 index 0000000..c0d4efb --- /dev/null +++ b/ruoyi-common/ruoyi-common-mybatis/src/main/java/com/rouyi/common/mybatis/core/page/TableDataInfo.java @@ -0,0 +1,81 @@ +package com.rouyi.common.mybatis.core.page; + +import cn.hutool.http.HttpStatus; +import com.baomidou.mybatisplus.core.metadata.IPage; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.io.Serial; +import java.io.Serializable; +import java.util.List; + +/** + * 表格分页数据对象 + * + * @author Lion Li + */ + +@Data +@NoArgsConstructor +public class TableDataInfo implements Serializable { + + @Serial + private static final long serialVersionUID = 1L; + + /** + * 总记录数 + */ + private long total; + + /** + * 列表数据 + */ + private List rows; + + /** + * 消息状态码 + */ + private int code; + + /** + * 消息内容 + */ + private String msg; + + /** + * 分页 + * + * @param list 列表数据 + * @param total 总记录数 + */ + public TableDataInfo(List list, long total) { + this.rows = list; + this.total = total; + } + + public static TableDataInfo build(IPage page) { + TableDataInfo rspData = new TableDataInfo<>(); + rspData.setCode(HttpStatus.HTTP_OK); + rspData.setMsg("查询成功"); + rspData.setRows(page.getRecords()); + rspData.setTotal(page.getTotal()); + return rspData; + } + + public static TableDataInfo build(List list) { + TableDataInfo rspData = new TableDataInfo<>(); + rspData.setCode(HttpStatus.HTTP_OK); + rspData.setMsg("查询成功"); + rspData.setRows(list); + rspData.setTotal(list.size()); + return rspData; + } + + public static TableDataInfo build() { + TableDataInfo rspData = new TableDataInfo<>(); + rspData.setCode(HttpStatus.HTTP_OK); + rspData.setMsg("查询成功"); + return rspData; + } + +} diff --git a/ruoyi-common/ruoyi-common-mybatis/src/main/java/com/rouyi/common/mybatis/enums/DataBaseType.java b/ruoyi-common/ruoyi-common-mybatis/src/main/java/com/rouyi/common/mybatis/enums/DataBaseType.java new file mode 100644 index 0000000..7df6d63 --- /dev/null +++ b/ruoyi-common/ruoyi-common-mybatis/src/main/java/com/rouyi/common/mybatis/enums/DataBaseType.java @@ -0,0 +1,49 @@ +package com.rouyi.common.mybatis.enums; + +import com.ruoyi.common.core.utils.StringUtils; +import lombok.AllArgsConstructor; +import lombok.Getter; + +/** + * 数据库类型 + * + * @author Lion Li + */ +@Getter +@AllArgsConstructor +public enum DataBaseType { + + /** + * MySQL + */ + MY_SQL("MySQL"), + + /** + * Oracle + */ + ORACLE("Oracle"), + + /** + * PostgreSQL + */ + POSTGRE_SQL("PostgreSQL"), + + /** + * SQL Server + */ + SQL_SERVER("Microsoft SQL Server"); + + private final String type; + + public static DataBaseType find(String databaseProductName) { + if (StringUtils.isBlank(databaseProductName)) { + return null; + } + for (DataBaseType type : values()) { + if (type.getType().equals(databaseProductName)) { + return type; + } + } + return null; + } +} diff --git a/ruoyi-common/ruoyi-common-mybatis/src/main/java/com/rouyi/common/mybatis/enums/DataScopeType.java b/ruoyi-common/ruoyi-common-mybatis/src/main/java/com/rouyi/common/mybatis/enums/DataScopeType.java new file mode 100644 index 0000000..a379ace --- /dev/null +++ b/ruoyi-common/ruoyi-common-mybatis/src/main/java/com/rouyi/common/mybatis/enums/DataScopeType.java @@ -0,0 +1,73 @@ +package com.rouyi.common.mybatis.enums; + +import com.rouyi.common.mybatis.helper.DataPermissionHelper; +import com.ruoyi.common.core.utils.StringUtils; +import lombok.AllArgsConstructor; +import lombok.Getter; + +/** + * 数据权限类型 + *

+ * 语法支持 spel 模板表达式 + *

+ * 内置数据 user 当前用户 内容参考 LoginUser + * 如需扩展数据 可使用 {@link DataPermissionHelper} 操作 + * 内置服务 sdss 系统数据权限服务 内容参考 SysDataScopeService + * 如需扩展更多自定义服务 可以参考 sdss 自行编写 + * + * @author Lion Li + * @version 3.5.0 + */ +@Getter +@AllArgsConstructor +public enum DataScopeType { + + /** + * 全部数据权限 + */ + ALL("1", "", ""), + + /** + * 自定数据权限 + */ + CUSTOM("2", " #{#deptName} IN ( #{@sdss.getRoleCustom( #user.roleId )} ) ", " 1 = 0 "), + + /** + * 部门数据权限 + */ + DEPT("3", " #{#deptName} = #{#user.deptId} ", " 1 = 0 "), + + /** + * 部门及以下数据权限 + */ + DEPT_AND_CHILD("4", " #{#deptName} IN ( #{@sdss.getDeptAndChild( #user.deptId )} )", " 1 = 0 "), + + /** + * 仅本人数据权限 + */ + SELF("5", " #{#userName} = #{#user.userId} ", " 1 = 0 "); + + private final String code; + + /** + * 语法 采用 spel 模板表达式 + */ + private final String sqlTemplate; + + /** + * 不满足 sqlTemplate 则填充 + */ + private final String elseSql; + + public static DataScopeType findCode(String code) { + if (StringUtils.isBlank(code)) { + return null; + } + for (DataScopeType type : values()) { + if (type.getCode().equals(code)) { + return type; + } + } + return null; + } +} diff --git a/ruoyi-common/ruoyi-common-mybatis/src/main/java/com/rouyi/common/mybatis/handler/InjectionMetaObjectHandler.java b/ruoyi-common/ruoyi-common-mybatis/src/main/java/com/rouyi/common/mybatis/handler/InjectionMetaObjectHandler.java new file mode 100644 index 0000000..0108475 --- /dev/null +++ b/ruoyi-common/ruoyi-common-mybatis/src/main/java/com/rouyi/common/mybatis/handler/InjectionMetaObjectHandler.java @@ -0,0 +1,79 @@ +package com.rouyi.common.mybatis.handler; + +import cn.hutool.core.util.ObjectUtil; +import cn.hutool.http.HttpStatus; +import com.baomidou.mybatisplus.core.handlers.MetaObjectHandler; +import com.ruoyi.common.core.domain.bo.LoginUser; +import com.ruoyi.common.core.exception.ServiceException; +import com.rouyi.common.mybatis.core.domain.BaseEntity; +import com.ruoyi.common.satoken.utils.LoginHelper; +import com.ruoyi.common.core.utils.StringUtils; +import lombok.extern.slf4j.Slf4j; +import org.apache.ibatis.reflection.MetaObject; + +import java.util.Date; + +/** + * MP注入处理器 + * + * @author Lion Li + * @date 2021/4/25 + */ +@Slf4j +public class InjectionMetaObjectHandler implements MetaObjectHandler { + + @Override + public void insertFill(MetaObject metaObject) { + try { + if (ObjectUtil.isNotNull(metaObject) && metaObject.getOriginalObject() instanceof BaseEntity baseEntity) { + Date current = ObjectUtil.isNotNull(baseEntity.getCreateTime()) + ? baseEntity.getCreateTime() : new Date(); + baseEntity.setCreateTime(current); + baseEntity.setUpdateTime(current); + if (ObjectUtil.isNull(baseEntity.getCreateBy())) { + String username = StringUtils.isNotBlank(baseEntity.getCreateBy()) + ? baseEntity.getCreateBy() : getLoginUsername(); + // 当前已登录 且 创建人为空 则填充 + baseEntity.setCreateBy(username); + // 当前已登录 且 更新人为空 则填充 + baseEntity.setUpdateBy(username); + } + } + } catch (Exception e) { + throw new ServiceException("自动注入异常 => " + e.getMessage(), HttpStatus.HTTP_UNAUTHORIZED); + } + } + + @Override + public void updateFill(MetaObject metaObject) { + try { + if (ObjectUtil.isNotNull(metaObject) && metaObject.getOriginalObject() instanceof BaseEntity baseEntity) { + Date current = new Date(); + // 更新时间填充(不管为不为空) + baseEntity.setUpdateTime(current); + String username = getLoginUsername(); + // 当前已登录 更新人填充(不管为不为空) + if (StringUtils.isNotBlank(username)) { + baseEntity.setUpdateBy(username); + } + } + } catch (Exception e) { + throw new ServiceException("自动注入异常 => " + e.getMessage(), HttpStatus.HTTP_UNAUTHORIZED); + } + } + + /** + * 获取登录用户名 + */ + private String getLoginUsername() { + LoginUser loginUser; + try { + loginUser = LoginHelper.getLoginUser(); + } catch (Exception e) { + log.warn("自动注入警告 => 用户未登录"); + return null; + } + return ObjectUtil.isNotNull(loginUser) ? loginUser.getUsername() : null; + } + +} diff --git a/ruoyi-common/ruoyi-common-mybatis/src/main/java/com/rouyi/common/mybatis/handler/MybatisExceptionHandler.java b/ruoyi-common/ruoyi-common-mybatis/src/main/java/com/rouyi/common/mybatis/handler/MybatisExceptionHandler.java new file mode 100644 index 0000000..7aaa407 --- /dev/null +++ b/ruoyi-common/ruoyi-common-mybatis/src/main/java/com/rouyi/common/mybatis/handler/MybatisExceptionHandler.java @@ -0,0 +1,47 @@ +package com.rouyi.common.mybatis.handler; + +import com.ruoyi.common.core.domain.R; +import lombok.extern.slf4j.Slf4j; +import com.ruoyi.common.core.utils.StringUtils; +import org.mybatis.spring.MyBatisSystemException; +import org.springframework.dao.DuplicateKeyException; +import org.springframework.web.bind.annotation.ExceptionHandler; +import org.springframework.web.bind.annotation.RestControllerAdvice; + +import jakarta.servlet.http.HttpServletRequest; + +/** + * Mybatis异常处理器 + * + * @author Lion Li + */ +@Slf4j +@RestControllerAdvice +public class MybatisExceptionHandler { + + /** + * 主键或UNIQUE索引,数据重复异常 + */ + @ExceptionHandler(DuplicateKeyException.class) + public R handleDuplicateKeyException(DuplicateKeyException e, HttpServletRequest request) { + String requestURI = request.getRequestURI(); + log.error("请求地址'{}',数据库中已存在记录'{}'", requestURI, e.getMessage()); + return R.fail("数据库中已存在该记录,请联系管理员确认"); + } + + /** + * Mybatis系统异常 通用处理 + */ + @ExceptionHandler(MyBatisSystemException.class) + public R handleCannotFindDataSourceException(MyBatisSystemException e, HttpServletRequest request) { + String requestURI = request.getRequestURI(); + String message = e.getMessage(); + if (StringUtils.contains("CannotFindDataSourceException", message)) { + log.error("请求地址'{}', 未找到数据源", requestURI); + return R.fail("未找到数据源,请联系管理员确认"); + } + log.error("请求地址'{}', Mybatis系统异常", requestURI, e); + return R.fail(message); + } + +} diff --git a/ruoyi-common/ruoyi-common-mybatis/src/main/java/com/rouyi/common/mybatis/handler/PlusDataPermissionHandler.java b/ruoyi-common/ruoyi-common-mybatis/src/main/java/com/rouyi/common/mybatis/handler/PlusDataPermissionHandler.java new file mode 100644 index 0000000..0b74732 --- /dev/null +++ b/ruoyi-common/ruoyi-common-mybatis/src/main/java/com/rouyi/common/mybatis/handler/PlusDataPermissionHandler.java @@ -0,0 +1,221 @@ +package com.rouyi.common.mybatis.handler; + +import cn.hutool.core.annotation.AnnotationUtil; +import cn.hutool.core.collection.CollUtil; +import cn.hutool.core.util.ObjectUtil; +import com.rouyi.common.mybatis.annotation.DataColumn; +import com.rouyi.common.mybatis.annotation.DataPermission; +import lombok.extern.slf4j.Slf4j; +import net.sf.jsqlparser.JSQLParserException; +import net.sf.jsqlparser.expression.Expression; +import net.sf.jsqlparser.expression.Parenthesis; +import net.sf.jsqlparser.expression.operators.conditional.AndExpression; +import net.sf.jsqlparser.parser.CCJSqlParserUtil; +import org.apache.ibatis.io.Resources; +import com.ruoyi.common.core.domain.vo.RoleVO; +import com.ruoyi.common.core.domain.bo.LoginUser; +import com.ruoyi.common.core.exception.ServiceException; +import com.ruoyi.common.core.utils.SpringUtils; +import com.ruoyi.common.core.utils.StreamUtils; +import com.ruoyi.common.core.utils.StringUtils; +import com.rouyi.common.mybatis.enums.DataScopeType; +import com.rouyi.common.mybatis.helper.DataPermissionHelper; +import com.ruoyi.common.satoken.utils.LoginHelper; +import org.springframework.context.ConfigurableApplicationContext; +import org.springframework.context.expression.BeanFactoryResolver; +import org.springframework.core.io.Resource; +import org.springframework.core.io.support.PathMatchingResourcePatternResolver; +import org.springframework.core.io.support.ResourcePatternResolver; +import org.springframework.core.type.ClassMetadata; +import org.springframework.core.type.classreading.CachingMetadataReaderFactory; +import org.springframework.expression.BeanResolver; +import org.springframework.expression.ExpressionParser; +import org.springframework.expression.ParserContext; +import org.springframework.expression.common.TemplateParserContext; +import org.springframework.expression.spel.standard.SpelExpressionParser; +import org.springframework.expression.spel.support.StandardEvaluationContext; +import org.springframework.util.ClassUtils; + +import java.lang.reflect.Method; +import java.util.Arrays; +import java.util.HashSet; +import java.util.Map; +import java.util.Set; +import java.util.concurrent.ConcurrentHashMap; +import java.util.function.Function; + +/** + * 数据权限过滤 + * + * @author Lion Li + * @version 3.5.0 + */ +@Slf4j +public class PlusDataPermissionHandler { + + /** + * 方法或类(名称) 与 注解的映射关系缓存 + */ + private final Map dataPermissionCacheMap = new ConcurrentHashMap<>(); + + /** + * spel 解析器 + */ + private final ExpressionParser parser = new SpelExpressionParser(); + private final ParserContext parserContext = new TemplateParserContext(); + /** + * bean解析器 用于处理 spel 表达式中对 bean 的调用 + */ + private final BeanResolver beanResolver = new BeanFactoryResolver(SpringUtils.getBeanFactory()); + + public PlusDataPermissionHandler(String mapperPackage) { + scanMapperClasses(mapperPackage); + } + + + public Expression getSqlSegment(Expression where, String mappedStatementId, boolean isSelect) { + DataPermission dataPermission = getDataPermission(mappedStatementId); + LoginUser currentUser = DataPermissionHelper.getVariable("user"); + if (ObjectUtil.isNull(currentUser)) { + currentUser = LoginHelper.getLoginUser(); + DataPermissionHelper.setVariable("user", currentUser); + } + // 如果是超级管理员或租户管理员,则不过滤数据 + if (LoginHelper.isAdmin()) { + return where; + } + String dataFilterSql = buildDataFilter(dataPermission.value(), isSelect); + if (StringUtils.isBlank(dataFilterSql)) { + return where; + } + try { + Expression expression = CCJSqlParserUtil.parseExpression(dataFilterSql); + // 数据权限使用单独的括号 防止与其他条件冲突 + Parenthesis parenthesis = new Parenthesis(expression); + if (ObjectUtil.isNotNull(where)) { + return new AndExpression(where, parenthesis); + } else { + return parenthesis; + } + } catch (JSQLParserException e) { + throw new ServiceException("数据权限解析异常 => " + e.getMessage()); + } + } + + /** + * 构造数据过滤sql + */ + private String buildDataFilter(DataColumn[] dataColumns, boolean isSelect) { + // 更新或删除需满足所有条件 + String joinStr = isSelect ? " OR " : " AND "; + LoginUser user = DataPermissionHelper.getVariable("user"); + StandardEvaluationContext context = new StandardEvaluationContext(); + context.setBeanResolver(beanResolver); + DataPermissionHelper.getContext().forEach(context::setVariable); + Set conditions = new HashSet<>(); + for (RoleVO role : user.getRoles()) { + user.setRoleId(role.getRoleId()); + // 获取角色权限泛型 + DataScopeType type = DataScopeType.findCode(role.getDataScope()); + if (ObjectUtil.isNull(type)) { + throw new ServiceException("角色数据范围异常 => " + role.getDataScope()); + } + // 全部数据权限直接返回 + if (type == DataScopeType.ALL) { + return ""; + } + boolean isSuccess = false; + for (DataColumn dataColumn : dataColumns) { + if (dataColumn.key().length != dataColumn.value().length) { + throw new ServiceException("角色数据范围异常 => key与value长度不匹配"); + } + // 不包含 key 变量 则不处理 + if (!StringUtils.containsAny(type.getSqlTemplate(), + Arrays.stream(dataColumn.key()).map(key -> "#" + key).toArray(String[]::new) + )) { + continue; + } + // 设置注解变量 key 为表达式变量 value 为变量值 + for (int i = 0; i < dataColumn.key().length; i++) { + context.setVariable(dataColumn.key()[i], dataColumn.value()[i]); + } + + // 解析sql模板并填充 + String sql = parser.parseExpression(type.getSqlTemplate(), parserContext).getValue(context, String.class); + conditions.add(joinStr + sql); + isSuccess = true; + } + // 未处理成功则填充兜底方案 + if (!isSuccess && StringUtils.isNotBlank(type.getElseSql())) { + conditions.add(joinStr + type.getElseSql()); + } + } + + if (CollUtil.isNotEmpty(conditions)) { + String sql = StreamUtils.join(conditions, Function.identity(), ""); + return sql.substring(joinStr.length()); + } + return ""; + } + + /** + * 通过 mapperPackage 设置的扫描包 扫描缓存有注解的方法与类 + */ + private void scanMapperClasses(String mapperPackage) { + PathMatchingResourcePatternResolver resolver = new PathMatchingResourcePatternResolver(); + CachingMetadataReaderFactory factory = new CachingMetadataReaderFactory(); + String[] packagePatternArray = StringUtils.splitPreserveAllTokens(mapperPackage, ConfigurableApplicationContext.CONFIG_LOCATION_DELIMITERS); + String classpath = ResourcePatternResolver.CLASSPATH_ALL_URL_PREFIX; + try { + for (String packagePattern : packagePatternArray) { + String path = ClassUtils.convertClassNameToResourcePath(packagePattern); + Resource[] resources = resolver.getResources(classpath + path + "/*.class"); + for (Resource resource : resources) { + ClassMetadata classMetadata = factory.getMetadataReader(resource).getClassMetadata(); + Class clazz = Resources.classForName(classMetadata.getClassName()); + findAnnotation(clazz); + } + } + } catch (Exception e) { + log.error("初始化数据安全缓存时出错:{}", e.getMessage()); + } + } + + private void findAnnotation(Class clazz) { + DataPermission dataPermission; + // 获取方法注解 + for (Method method : clazz.getMethods()) { + if (method.isDefault() || method.isVarArgs()) { + continue; + } + String mappedStatementId = clazz.getName() + "." + method.getName(); + if (AnnotationUtil.hasAnnotation(method, DataPermission.class)) { + dataPermission = AnnotationUtil.getAnnotation(method, DataPermission.class); + dataPermissionCacheMap.put(mappedStatementId, dataPermission); + } + } + // 获取类注解 + if (AnnotationUtil.hasAnnotation(clazz, DataPermission.class)) { + dataPermission = AnnotationUtil.getAnnotation(clazz, DataPermission.class); + dataPermissionCacheMap.put(clazz.getName(), dataPermission); + } + } + + public DataPermission getDataPermission(String mapperId) { + if (dataPermissionCacheMap.containsKey(mapperId)) { + return dataPermissionCacheMap.get(mapperId); + } + String clazzName = mapperId.substring(0, mapperId.lastIndexOf(".")); + if (dataPermissionCacheMap.containsKey(clazzName)) { + return dataPermissionCacheMap.get(clazzName); + } + return null; + } + + /** + * 是否无效 + */ + public boolean invalid(String mapperId) { + return getDataPermission(mapperId) == null; + } +} diff --git a/ruoyi-common/ruoyi-common-mybatis/src/main/java/com/rouyi/common/mybatis/helper/DataBaseHelper.java b/ruoyi-common/ruoyi-common-mybatis/src/main/java/com/rouyi/common/mybatis/helper/DataBaseHelper.java new file mode 100644 index 0000000..60b4a85 --- /dev/null +++ b/ruoyi-common/ruoyi-common-mybatis/src/main/java/com/rouyi/common/mybatis/helper/DataBaseHelper.java @@ -0,0 +1,81 @@ +package com.rouyi.common.mybatis.helper; + +import cn.hutool.core.convert.Convert; +import com.baomidou.dynamic.datasource.DynamicRoutingDataSource; +import com.ruoyi.common.core.exception.ServiceException; +import com.ruoyi.common.core.utils.SpringUtils; +import com.rouyi.common.mybatis.enums.DataBaseType; +import lombok.AccessLevel; +import lombok.NoArgsConstructor; + +import javax.sql.DataSource; +import java.sql.Connection; +import java.sql.DatabaseMetaData; +import java.sql.SQLException; +import java.util.ArrayList; +import java.util.List; + +/** + * 数据库助手 + * + * @author Lion Li + */ +@NoArgsConstructor(access = AccessLevel.PRIVATE) +public class DataBaseHelper { + + private static final DynamicRoutingDataSource DS = SpringUtils.getBean(DynamicRoutingDataSource.class); + + /** + * 获取当前数据库类型 + */ + public static DataBaseType getDataBaseType() { + DataSource dataSource = DS.determineDataSource(); + try (Connection conn = dataSource.getConnection()) { + DatabaseMetaData metaData = conn.getMetaData(); + String databaseProductName = metaData.getDatabaseProductName(); + return DataBaseType.find(databaseProductName); + } catch (SQLException e) { + throw new ServiceException(e.getMessage()); + } + } + + public static boolean isMySql() { + return DataBaseType.MY_SQL == getDataBaseType(); + } + + public static boolean isOracle() { + return DataBaseType.ORACLE == getDataBaseType(); + } + + public static boolean isPostgerSql() { + return DataBaseType.POSTGRE_SQL == getDataBaseType(); + } + + public static boolean isSqlServer() { + return DataBaseType.SQL_SERVER == getDataBaseType(); + } + + public static String findInSet(Object var1, String var2) { + DataBaseType dataBasyType = getDataBaseType(); + String var = Convert.toStr(var1); + if (dataBasyType == DataBaseType.SQL_SERVER) { + // charindex(',100,' , ',0,100,101,') <> 0 + return "charindex(',%s,' , ','+%s+',') <> 0".formatted(var, var2); + } else if (dataBasyType == DataBaseType.POSTGRE_SQL) { + // (select position(',100,' in ',0,100,101,')) <> 0 + return "(select position(',%s,' in ','||%s||',')) <> 0".formatted(var, var2); + } else if (dataBasyType == DataBaseType.ORACLE) { + // instr(',0,100,101,' , ',100,') <> 0 + return "instr(','||%s||',' , ',%s,') <> 0".formatted(var2, var); + } + // find_in_set(100 , '0,100,101') + return "find_in_set('%s' , %s) <> 0".formatted(var, var2); + } + + /** + * 获取当前加载的数据库名 + */ + public static List getDataSourceNameList() { + return new ArrayList<>(DS.getDataSources().keySet()); + } +} diff --git a/ruoyi-common/ruoyi-common-mybatis/src/main/java/com/rouyi/common/mybatis/helper/DataPermissionHelper.java b/ruoyi-common/ruoyi-common-mybatis/src/main/java/com/rouyi/common/mybatis/helper/DataPermissionHelper.java new file mode 100644 index 0000000..03dc7f9 --- /dev/null +++ b/ruoyi-common/ruoyi-common-mybatis/src/main/java/com/rouyi/common/mybatis/helper/DataPermissionHelper.java @@ -0,0 +1,93 @@ +package com.rouyi.common.mybatis.helper; + +import cn.dev33.satoken.context.SaHolder; +import cn.dev33.satoken.context.model.SaStorage; +import cn.hutool.core.util.ObjectUtil; +import com.baomidou.mybatisplus.core.plugins.IgnoreStrategy; +import com.baomidou.mybatisplus.core.plugins.InterceptorIgnoreHelper; +import lombok.AccessLevel; +import lombok.NoArgsConstructor; + +import java.util.HashMap; +import java.util.Map; +import java.util.function.Supplier; + +/** + * 数据权限助手 + * + * @author Lion Li + * @version 3.5.0 + */ +@NoArgsConstructor(access = AccessLevel.PRIVATE) +@SuppressWarnings("unchecked cast") +public class DataPermissionHelper { + + private static final String DATA_PERMISSION_KEY = "data:permission"; + + public static T getVariable(String key) { + Map context = getContext(); + return (T) context.get(key); + } + + + public static void setVariable(String key, Object value) { + Map context = getContext(); + context.put(key, value); + } + + public static Map getContext() { + SaStorage saStorage = SaHolder.getStorage(); + Object attribute = saStorage.get(DATA_PERMISSION_KEY); + if (ObjectUtil.isNull(attribute)) { + saStorage.set(DATA_PERMISSION_KEY, new HashMap<>()); + attribute = saStorage.get(DATA_PERMISSION_KEY); + } + if (attribute instanceof Map map) { + return map; + } + throw new NullPointerException("data permission context type exception"); + } + + /** + * 开启忽略数据权限(开启后需手动调用 {@link #disableIgnore()} 关闭) + */ + public static void enableIgnore() { + InterceptorIgnoreHelper.handle(IgnoreStrategy.builder().dataPermission(true).build()); + } + + /** + * 关闭忽略数据权限 + */ + public static void disableIgnore() { + InterceptorIgnoreHelper.clearIgnoreStrategy(); + } + + /** + * 在忽略数据权限中执行 + * + * @param handle 处理执行方法 + */ + public static void ignore(Runnable handle) { + enableIgnore(); + try { + handle.run(); + } finally { + disableIgnore(); + } + } + + /** + * 在忽略数据权限中执行 + * + * @param handle 处理执行方法 + */ + public static T ignore(Supplier handle) { + enableIgnore(); + try { + return handle.get(); + } finally { + disableIgnore(); + } + } + +} diff --git a/ruoyi-common/ruoyi-common-mybatis/src/main/java/com/rouyi/common/mybatis/interceptor/PlusDataPermissionInterceptor.java b/ruoyi-common/ruoyi-common-mybatis/src/main/java/com/rouyi/common/mybatis/interceptor/PlusDataPermissionInterceptor.java new file mode 100644 index 0000000..f6907fd --- /dev/null +++ b/ruoyi-common/ruoyi-common-mybatis/src/main/java/com/rouyi/common/mybatis/interceptor/PlusDataPermissionInterceptor.java @@ -0,0 +1,123 @@ +package com.rouyi.common.mybatis.interceptor; + +import com.baomidou.mybatisplus.core.plugins.InterceptorIgnoreHelper; +import com.baomidou.mybatisplus.core.toolkit.PluginUtils; +import com.baomidou.mybatisplus.extension.plugins.handler.MultiDataPermissionHandler; +import com.baomidou.mybatisplus.extension.plugins.inner.BaseMultiTableInnerInterceptor; +import com.baomidou.mybatisplus.extension.plugins.inner.InnerInterceptor; +import com.rouyi.common.mybatis.handler.PlusDataPermissionHandler; +import lombok.extern.slf4j.Slf4j; +import net.sf.jsqlparser.expression.Expression; +import net.sf.jsqlparser.schema.Table; +import net.sf.jsqlparser.statement.delete.Delete; +import net.sf.jsqlparser.statement.select.PlainSelect; +import net.sf.jsqlparser.statement.select.Select; +import net.sf.jsqlparser.statement.select.SetOperationList; +import net.sf.jsqlparser.statement.update.Update; +import org.apache.ibatis.executor.Executor; +import org.apache.ibatis.executor.statement.StatementHandler; +import org.apache.ibatis.mapping.BoundSql; +import org.apache.ibatis.mapping.MappedStatement; +import org.apache.ibatis.mapping.SqlCommandType; +import org.apache.ibatis.session.ResultHandler; +import org.apache.ibatis.session.RowBounds; + +import java.sql.Connection; +import java.sql.SQLException; +import java.util.List; + +/** + * 数据权限拦截器 + * + * @author Lion Li + * @version 3.5.0 + */ +@Slf4j +public class PlusDataPermissionInterceptor extends BaseMultiTableInnerInterceptor implements InnerInterceptor { + + private final PlusDataPermissionHandler dataPermissionHandler; + + public PlusDataPermissionInterceptor(String mapperPackage) { + this.dataPermissionHandler = new PlusDataPermissionHandler(mapperPackage); + } + + @Override + public void beforeQuery(Executor executor, MappedStatement ms, Object parameter, RowBounds rowBounds, ResultHandler resultHandler, BoundSql boundSql) throws SQLException { + // 检查忽略注解 + if (InterceptorIgnoreHelper.willIgnoreDataPermission(ms.getId())) { + return; + } + // 检查是否无效 无数据权限注解 + if (dataPermissionHandler.invalid(ms.getId())) { + return; + } + // 解析 sql 分配对应方法 + PluginUtils.MPBoundSql mpBs = PluginUtils.mpBoundSql(boundSql); + mpBs.sql(parserSingle(mpBs.sql(), ms.getId())); + } + + @Override + public void beforePrepare(StatementHandler sh, Connection connection, Integer transactionTimeout) { + PluginUtils.MPStatementHandler mpSh = PluginUtils.mpStatementHandler(sh); + MappedStatement ms = mpSh.mappedStatement(); + SqlCommandType sct = ms.getSqlCommandType(); + if (sct == SqlCommandType.UPDATE || sct == SqlCommandType.DELETE) { + if (InterceptorIgnoreHelper.willIgnoreDataPermission(ms.getId())) { + return; + } + // 检查是否无效 无数据权限注解 + if (dataPermissionHandler.invalid(ms.getId())) { + return; + } + PluginUtils.MPBoundSql mpBs = mpSh.mPBoundSql(); + mpBs.sql(parserMulti(mpBs.sql(), ms.getId())); + } + } + + @Override + protected void processSelect(Select select, int index, String sql, Object obj) { + if (select instanceof PlainSelect) { + this.setWhere((PlainSelect) select, (String) obj); + } else if (select instanceof SetOperationList setOperationList) { + List - - where table_id = #{tableId} - order by sort - - - - - - insert into gen_table_column ( - table_id, - column_name, - column_comment, - column_type, - java_type, - java_field, - is_pk, - is_increment, - is_required, - is_insert, - is_edit, - is_list, - is_query, - query_type, - html_type, - dict_type, - sort, - create_by, - create_time - )values( - #{tableId}, - #{columnName}, - #{columnComment}, - #{columnType}, - #{javaType}, - #{javaField}, - #{isPk}, - #{isIncrement}, - #{isRequired}, - #{isInsert}, - #{isEdit}, - #{isList}, - #{isQuery}, - #{queryType}, - #{htmlType}, - #{dictType}, - #{sort}, - #{createBy}, - sysdate() - ) - - - - update gen_table_column - - column_comment = #{columnComment}, - java_type = #{javaType}, - java_field = #{javaField}, - is_insert = #{isInsert}, - is_edit = #{isEdit}, - is_list = #{isList}, - is_query = #{isQuery}, - is_required = #{isRequired}, - query_type = #{queryType}, - html_type = #{htmlType}, - dict_type = #{dictType}, - sort = #{sort}, - update_by = #{updateBy}, - update_time = sysdate() - - where column_id = #{columnId} - - - - delete from gen_table_column where table_id in - - #{tableId} - - - - - delete from gen_table_column where column_id in - - #{item.columnId} - - - - diff --git a/ruoyi-generator/src/main/resources/mapper/generator/GenTableMapper.xml b/ruoyi-generator/src/main/resources/mapper/generator/GenTableMapper.xml deleted file mode 100644 index 1cf4e7a..0000000 --- a/ruoyi-generator/src/main/resources/mapper/generator/GenTableMapper.xml +++ /dev/null @@ -1,215 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - select table_id, table_name, table_comment, sub_table_name, sub_table_fk_name, class_name, tpl_category, package_name, module_name, business_name, function_name, function_author, gen_type, gen_path, options, create_by, create_time, update_by, update_time, remark from gen_table - - - - - - - - - - - - - - - - - - - insert into gen_table ( - table_name, - table_comment, - class_name, - tpl_category, - package_name, - module_name, - business_name, - function_name, - function_author, - gen_type, - gen_path, - remark, - create_by, - create_time - )values( - #{tableName}, - #{tableComment}, - #{className}, - #{tplCategory}, - #{packageName}, - #{moduleName}, - #{businessName}, - #{functionName}, - #{functionAuthor}, - #{genType}, - #{genPath}, - #{remark}, - #{createBy}, - sysdate() - ) - - - - update gen_table - - table_name = #{tableName}, - table_comment = #{tableComment}, - sub_table_name = #{subTableName}, - sub_table_fk_name = #{subTableFkName}, - class_name = #{className}, - function_author = #{functionAuthor}, - gen_type = #{genType}, - gen_path = #{genPath}, - tpl_category = #{tplCategory}, - package_name = #{packageName}, - module_name = #{moduleName}, - business_name = #{businessName}, - function_name = #{functionName}, - options = #{options}, - update_by = #{updateBy}, - remark = #{remark}, - update_time = sysdate() - - where table_id = #{tableId} - - - - delete from gen_table where table_id in - - #{tableId} - - - - diff --git a/ruoyi-generator/src/main/resources/vm/java/controller.java.vm b/ruoyi-generator/src/main/resources/vm/java/controller.java.vm deleted file mode 100644 index a8df03b..0000000 --- a/ruoyi-generator/src/main/resources/vm/java/controller.java.vm +++ /dev/null @@ -1,93 +0,0 @@ -package ${fullPackage}; - -import java.util.List; - -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; -import org.springframework.data.domain.PageImpl; -import org.springframework.data.domain.Pageable; -import org.springframework.data.domain.Page; -import org.springframework.http.ResponseEntity; -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.ruoyi.common.annotation.Log; -import com.ruoyi.common.core.controller.BaseController; -import com.ruoyi.common.enums.BusinessType; -import ${_fullClass.convert}; -import ${_fullClass.domain}; -import ${_fullClass.query}; -import ${_fullClass.service}; -import ${_fullClass.vo}; -import com.ruoyi.common.utils.poi.ExcelUtil; -/** - * ${functionName}Controller - * - * @author ${author} - * @date ${datetime} - */ -@Api(description ="${functionName}接口列表") -@RestController -@RequestMapping("/${moduleName}/${className}") -public class ${_className.controller} extends BaseController { - @Autowired - private ${_className.service} service; - @Autowired - private ${_className.convert} convert; - - @ApiOperation("查询${functionName}列表") - @PreAuthorize("@ss.hasPermi('${permissionPrefix}:list')") - @PostMapping("/list") - public ResponseEntity> list(@RequestBody ${_className.query} query, Pageable page) { - List<${_className.domain}> list = service.selectList(query, page); - return ResponseEntity.ok(new PageImpl<>(list, page, ((com.github.pagehelper.Page)list).getTotal())); - } - - @ApiOperation("导出${functionName}列表") - @PreAuthorize("@ss.hasPermi('${permissionPrefix}:export')") - @Log(title = "${functionName}", businessType = BusinessType.EXPORT) - @GetMapping("/export") - public ResponseEntity export(${_className.query} query) { - List<${ClassName}> list = service.selectList(query, null); - ExcelUtil<${_className.vo}> util = new ExcelUtil<>(${_className.vo}.class); - return ResponseEntity.ok(util.writeExcel(convert.dos2vos(list), "${functionName}数据")); - } - - @ApiOperation("获取${functionName}详细信息") - @PreAuthorize("@ss.hasPermi('${permissionPrefix}:query')") - @GetMapping(value = "/{${pkColumn.javaField}}") - public ResponseEntity<${ClassName}> getInfo(@PathVariable("${pkColumn.javaField}") ${pkColumn.javaType} ${pkColumn.javaField}) { - return ResponseEntity.ok(service.selectBy${pkColumn.capJavaField}(${pkColumn.javaField})); - } - - @ApiOperation("新增${functionName}") - @PreAuthorize("@ss.hasPermi('${permissionPrefix}:add')") - @Log(title = "${functionName}", businessType = BusinessType.INSERT) - @PostMapping - public ResponseEntity add(@RequestBody ${ClassName} ${className}) { - return ResponseEntity.ok(service.insert(${className})); - } - - @ApiOperation("修改${functionName}") - @PreAuthorize("@ss.hasPermi('${permissionPrefix}:edit')") - @Log(title = "${functionName}", businessType = BusinessType.UPDATE) - @PutMapping - public ResponseEntity edit(@RequestBody ${ClassName} ${className}) { - return ResponseEntity.ok(service.update(${className})); - } - - @ApiOperation("删除${functionName}") - @PreAuthorize("@ss.hasPermi('${permissionPrefix}:remove')") - @Log(title = "${functionName}", businessType = BusinessType.DELETE) - @DeleteMapping("/{${pkColumn.javaField}s}") - public ResponseEntity remove(@PathVariable ${pkColumn.javaType}[] ${pkColumn.javaField}s) { - return ResponseEntity.ok(service.deleteBy${pkColumn.capJavaField}s(${pkColumn.javaField}s)); - } -} diff --git a/ruoyi-generator/src/main/resources/vm/java/convert.java.vm b/ruoyi-generator/src/main/resources/vm/java/convert.java.vm deleted file mode 100644 index 2d420b9..0000000 --- a/ruoyi-generator/src/main/resources/vm/java/convert.java.vm +++ /dev/null @@ -1,29 +0,0 @@ -package ${fullPackage}; - -import org.mapstruct.Mapper; -import ${_fullClass.domain}; -import ${_fullClass.dto}; -import ${_fullClass.vo}; -import java.util.List; -/** - * ${functionName} DO <=> DTO <=> VO / BO / Query - * - * @author ${author} - */ -@Mapper(componentModel = "spring"#if($table.sub), uses = ${subClassName}Convert.class#end) -public interface ${ClassName}Convert { - - /** - * @param source DO - * @return DTO - */ - ${ClassName}DTO do2dto(${ClassName} source); - - /** - * @param source DTO - * @return DO - */ - ${ClassName} dto2do(${ClassName}DTO source); - - List<${_className.vo}> dos2vos(List<${_className.domain}> list); -} diff --git a/ruoyi-generator/src/main/resources/vm/java/domain.java.vm b/ruoyi-generator/src/main/resources/vm/java/domain.java.vm deleted file mode 100644 index 6b8cf3c..0000000 --- a/ruoyi-generator/src/main/resources/vm/java/domain.java.vm +++ /dev/null @@ -1,55 +0,0 @@ -package ${fullPackage}; - -#foreach ($import in $importList) -import ${import}; -#end -import com.ruoyi.common.annotation.Excel; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -#if(($table.crud || $table.sub) && $table.audit == 1) -import ${env.baseAudit}; -#end -import lombok.Data; -import com.baomidou.mybatisplus.annotation.TableName; -/** - * ${functionName}对象 ${tableName} - * - * @author ${author} - */ -@ApiModel(description="${functionName}对象") -#if(($table.crud || $table.sub) && $table.audit == 1) -#set($Entity="BaseAudit") -#end -@Data -@TableName("${tableName}") -public class ${ClassName}#if($Entity) extends ${Entity}#end { - private static final long serialVersionUID = 1L; - -#foreach ($column in $columns) -#if(!$table.isSuperColumn($column.javaField)) - @ApiModelProperty("$column.columnComment") -#if($column.list) -#set($parentheseIndex=$column.columnComment.indexOf("(")) -#if($parentheseIndex != -1) -#set($comment=$column.columnComment.substring(0, $parentheseIndex)) -#else -#set($comment=$column.columnComment) -#end -#if($parentheseIndex != -1) - @Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()") -#elseif($column.isDate()) - @Excel(name = "${comment}", width = 30, dateFormat = "${column.dateFormat}") -#else - @Excel(name = "${comment}") -#end -#end - private $column.javaType $column.javaField; - -#end -#end -#if($table.sub) - /** $table.subTable.functionName信息 */ - private List<${subClassName}> ${subclassName}List; - -#end -} diff --git a/ruoyi-generator/src/main/resources/vm/java/dto.java.vm b/ruoyi-generator/src/main/resources/vm/java/dto.java.vm deleted file mode 100644 index bba80d8..0000000 --- a/ruoyi-generator/src/main/resources/vm/java/dto.java.vm +++ /dev/null @@ -1,25 +0,0 @@ -package ${fullPackage}; - -#foreach ($import in $importList) -import ${import}; -#end -#if( ${table.audit} == 1 ) -import ${env.baseAudit}; -#end -import lombok.Data; -/** - * ${functionName} DTO 对象 - * - * @author ${author} - */ -@Data -public class ${ClassName}DTO#if( ${table.audit} == 1 ) extends BaseAudit#end { -#foreach ($column in $columns) -#if(!$table.isSuperColumn($column.javaField) and $column.javaField != "delFlag") - private $column.javaType $column.javaField; -#end -#end -#if($table.sub) - private List<${subClassName}DTO> ${subclassName}List; -#end -} diff --git a/ruoyi-generator/src/main/resources/vm/java/example.java.vm b/ruoyi-generator/src/main/resources/vm/java/example.java.vm deleted file mode 100644 index 14c3938..0000000 --- a/ruoyi-generator/src/main/resources/vm/java/example.java.vm +++ /dev/null @@ -1,305 +0,0 @@ -package ${fullPackage}; - -#foreach ($import in $importList) -import ${import}; -#end -import java.util.ArrayList; -import java.util.Date; -import java.util.Iterator; -import java.util.List; -import java.time.LocalDate; -import java.time.LocalDateTime; - -public class ${ClassName}Example { - protected String orderByClause; - - protected boolean distinct; - - protected List oredCriteria; - - public ${ClassName}Example() { - oredCriteria = new ArrayList<>(); - } - - public void setOrderByClause(String orderByClause) { - this.orderByClause = orderByClause; - } - - public String getOrderByClause() { - return orderByClause; - } - - public void setDistinct(boolean distinct) { - this.distinct = distinct; - } - - public boolean isDistinct() { - return distinct; - } - - public List getOredCriteria() { - return oredCriteria; - } - - public void or(Criteria criteria) { - oredCriteria.add(criteria); - } - - public Criteria or() { - Criteria criteria = createCriteriaInternal(); - oredCriteria.add(criteria); - return criteria; - } - - public Criteria createCriteria() { - Criteria criteria = createCriteriaInternal(); - if (oredCriteria.size() == 0) { - oredCriteria.add(criteria); - } - return criteria; - } - - protected Criteria createCriteriaInternal() { - Criteria criteria = new Criteria(); - return criteria; - } - - public void clear() { - oredCriteria.clear(); - orderByClause = null; - distinct = false; - } - - protected abstract static class GeneratedCriteria { - protected List criteria; - - protected GeneratedCriteria() { - super(); - criteria = new ArrayList<>(); - } - - public boolean isValid() { - return criteria.size() > 0; - } - - public List getAllCriteria() { - return criteria; - } - - public List getCriteria() { - return criteria; - } - - protected void addCriterion(String condition) { - if (condition == null) { - throw new RuntimeException("Value for condition cannot be null"); - } - criteria.add(new Criterion(condition)); - } - - protected void addCriterion(String condition, Object value, String property) { - if (value == null) { - throw new RuntimeException("Value for " + property + " cannot be null"); - } - criteria.add(new Criterion(condition, value)); - } - - protected void addCriterion(String condition, Object value1, Object value2, String property) { - if (value1 == null || value2 == null) { - throw new RuntimeException("Between values for " + property + " cannot be null"); - } - criteria.add(new Criterion(condition, value1, value2)); - } - - protected void addCriterionForJDBCDate(String condition, Date value, String property) { - if (value == null) { - throw new RuntimeException("Value for " + property + " cannot be null"); - } - addCriterion(condition, new java.sql.Date(value.getTime()), property); - } - - protected void addCriterionForJDBCDate(String condition, List values, String property) { - if (values == null || values.size() == 0) { - throw new RuntimeException("Value list for " + property + " cannot be null or empty"); - } - List dateList = new ArrayList<>(); - Iterator iter = values.iterator(); - while (iter.hasNext()) { - dateList.add(new java.sql.Date(iter.next().getTime())); - } - addCriterion(condition, dateList, property); - } - - protected void addCriterionForJDBCDate(String condition, Date value1, Date value2, String property) { - if (value1 == null || value2 == null) { - throw new RuntimeException("Between values for " + property + " cannot be null"); - } - addCriterion(condition, new java.sql.Date(value1.getTime()), new java.sql.Date(value2.getTime()), property); - } -#foreach ($column in $columns) - public Criteria and${column.capJavaField}IsNull() { - addCriterion("${column.columnName} is null"); - return (Criteria) this; - } - - public Criteria and${column.capJavaField}IsNotNull() { - addCriterion("${column.columnName} is not null"); - return (Criteria) this; - } - - public Criteria and${column.capJavaField}EqualTo(${column.javaType} value) { - addCriterion("${column.columnName} =", value, "${column.javaField}"); - return (Criteria) this; - } - - public Criteria and${column.capJavaField}NotEqualTo(${column.javaType} value) { - addCriterion("${column.columnName} <>", value, "${column.javaField}"); - return (Criteria) this; - } - - public Criteria and${column.capJavaField}GreaterThan(${column.javaType} value) { - addCriterion("${column.columnName} >", value, "${column.javaField}"); - return (Criteria) this; - } - - public Criteria and${column.capJavaField}GreaterThanOrEqualTo(${column.javaType} value) { - addCriterion("${column.columnName} >=", value, "${column.javaField}"); - return (Criteria) this; - } - - public Criteria and${column.capJavaField}LessThan(${column.javaType} value) { - addCriterion("${column.columnName} <", value, "${column.javaField}"); - return (Criteria) this; - } - - public Criteria and${column.capJavaField}LessThanOrEqualTo(${column.javaType} value) { - addCriterion("${column.columnName} <=", value, "${column.javaField}"); - return (Criteria) this; - } -#if($column.javaType == 'String') - - public Criteria and${column.capJavaField}Like(${column.javaType} value) { - addCriterion("${column.columnName} like", value, "${column.javaField}"); - return (Criteria) this; - } - - public Criteria and${column.capJavaField}NotLike(${column.javaType} value) { - addCriterion("${column.columnName} not like", value, "${column.javaField}"); - return (Criteria) this; - } - -#end - public Criteria and${column.capJavaField}In(List<${column.javaType}> values) { - addCriterion("${column.columnName} in", values, "${column.javaField}"); - return (Criteria) this; - } - - public Criteria and${column.capJavaField}NotIn(List<${column.javaType}> values) { - addCriterion("${column.columnName} not in", values, "${column.javaField}"); - return (Criteria) this; - } - - public Criteria and${column.capJavaField}Between(${column.javaType} value1, ${column.javaType} value2) { - addCriterion("${column.columnName} between", value1, value2, "${column.javaField}"); - return (Criteria) this; - } - - public Criteria and${column.capJavaField}NotBetween(${column.javaType} value1, ${column.javaType} value2) { - addCriterion("${column.columnName} not between", value1, value2, "${column.javaField}"); - return (Criteria) this; - } -#end - } - - public static class Criteria extends GeneratedCriteria { - protected Criteria() { - super(); - } - } - - public static class Criterion { - private String condition; - - private Object value; - - private Object secondValue; - - private boolean noValue; - - private boolean singleValue; - - private boolean betweenValue; - - private boolean listValue; - - private String typeHandler; - - public String getCondition() { - return condition; - } - - public Object getValue() { - return value; - } - - public Object getSecondValue() { - return secondValue; - } - - public boolean isNoValue() { - return noValue; - } - - public boolean isSingleValue() { - return singleValue; - } - - public boolean isBetweenValue() { - return betweenValue; - } - - public boolean isListValue() { - return listValue; - } - - public String getTypeHandler() { - return typeHandler; - } - - protected Criterion(String condition) { - super(); - this.condition = condition; - this.typeHandler = null; - this.noValue = true; - } - - protected Criterion(String condition, Object value, String typeHandler) { - super(); - this.condition = condition; - this.value = value; - this.typeHandler = typeHandler; - if (value instanceof List) { - this.listValue = true; - } else { - this.singleValue = true; - } - } - - protected Criterion(String condition, Object value) { - this(condition, value, null); - } - - protected Criterion(String condition, Object value, Object secondValue, String typeHandler) { - super(); - this.condition = condition; - this.value = value; - this.secondValue = secondValue; - this.typeHandler = typeHandler; - this.betweenValue = true; - } - - protected Criterion(String condition, Object value, Object secondValue) { - this(condition, value, secondValue, null); - } - } -} diff --git a/ruoyi-generator/src/main/resources/vm/java/mapper.java.vm b/ruoyi-generator/src/main/resources/vm/java/mapper.java.vm deleted file mode 100644 index 0d44884..0000000 --- a/ruoyi-generator/src/main/resources/vm/java/mapper.java.vm +++ /dev/null @@ -1,28 +0,0 @@ -package ${fullPackage}; - -import java.util.List; -import com.baomidou.mybatisplus.core.mapper.BaseMapper; -import org.apache.ibatis.annotations.Param; -import ${_fullClass.domain}; - -/** - * ${functionName}Mapper接口 - * - * @author ${author} - */ -public interface ${ClassName}Mapper extends BaseMapper<${ClassName}> { - /** - * 查询${functionName}列表 - * - * @param ${className} ${functionName} - * @return ${functionName}集合 - */ - List<${ClassName}> selectByEntity(${ClassName} ${className}); - - /** - * 批量软删除 - * @param ids - * @return - */ - int updateDelFlagByIds(@Param("ids") Long[] ids); -} diff --git a/ruoyi-generator/src/main/resources/vm/java/query.java.vm b/ruoyi-generator/src/main/resources/vm/java/query.java.vm deleted file mode 100644 index b28af37..0000000 --- a/ruoyi-generator/src/main/resources/vm/java/query.java.vm +++ /dev/null @@ -1,32 +0,0 @@ -package ${fullPackage}; - -#foreach ($import in $importList) -import ${import}; -#end -import lombok.Data; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; - -/** - * ${functionName} 查询 对象 - * - * @author ${author} - */ -@ApiModel(description="${functionName} 查询 对象") -@Data -public class ${_className.query} { -#foreach($column in $columns) -#if($column.query) -## 根据查询类型生成 EQ等于、NE不等于、GT大于、LT小于、LIKE模糊、BETWEEN范围 -## 范围查询, 使用数组实现 -#if($column.queryType == 'BETWEEN') - @ApiModelProperty("${column.genLabel()} 范围") - private ${column.javaType}[] ${column.javaField}${column.queryField}; -#else - @ApiModelProperty("${column.genLabel()} 精确匹配") - private ${column.javaType} ${column.javaField}${column.queryField}; -#end - -#end -#end -} diff --git a/ruoyi-generator/src/main/resources/vm/java/service.java.vm b/ruoyi-generator/src/main/resources/vm/java/service.java.vm deleted file mode 100644 index d2d6508..0000000 --- a/ruoyi-generator/src/main/resources/vm/java/service.java.vm +++ /dev/null @@ -1,149 +0,0 @@ -package ${fullPackage}; - -#foreach ($import in $importList) -import ${import}; -#end -import java.util.Arrays; -import java.util.List; -#if($table.hasDate()) -#foreach($date in $table.dateImports()) -import $date; -#end -#end -import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; -import com.github.pagehelper.PageHelper; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.data.domain.Pageable; -import org.apache.commons.lang3.StringUtils; -import org.springframework.stereotype.Service; -import ${_fullClass.mapper}; -import #evaluate(${_fullClass.domain}); -import #evaluate(${_fullClass.query}); - -/** - * ${functionName}Service业务层处理 - * - * - * @author ${author} - */ -@Service -public class ${ClassName}Service { - @Autowired - private ${_className.mapper} ${className}Mapper; - - /** - * 查询${functionName} - * - * @param ${pkColumn.javaField} ${functionName}主键 - * @return ${functionName} - */ - public ${ClassName} selectBy${pkColumn.capJavaField}(${pkColumn.javaType} ${pkColumn.javaField}) { - return ${className}Mapper.selectById(${pkColumn.javaField}); - } - - /** - * 查询${functionName}列表 - * - * @param query 查询条件 - * @param page 分页条件 - * @return ${functionName} - */ - public List<${_className.domain}> selectList(${_className.query} query, Pageable page) { - if (page != null) { - PageHelper.startPage(page.getPageNumber() + 1, page.getPageSize()); - } - QueryWrapper<${_className.domain}> qw = new QueryWrapper<>(); - qw.eq("del_flag",0); -#foreach($column in $columns) -#if($column.query) -## 根据查询类型生成 EQ等于、NE不等于、GT大于、LT小于、LIKE模糊、BETWEEN范围 -## 范围查询, 使用数组实现 -#if($column.queryType == 'BETWEEN') - ${column.javaType}[] ${column.javaField}${column.queryField} = query.get${column.capJavaField}${column.queryField}(); - if (${column.javaField}${column.queryField} != null && ${column.javaField}${column.queryField}.length == 2) { - ${column.javaType} start = ${column.javaField}${column.queryField}[0]; - if (#if($column.javaType == 'String')!StringUtils.isEmpty(start)#{else}start != null#end) { - qw.ge("${column.columnName}", start); - } - ${column.javaType} end = ${column.javaField}Range[0]; - if (#if($column.javaType == 'String')!StringUtils.isEmpty(end) #{else}end != null#end) { - qw.le("${column.columnName}", end); - } - } -#else - ${column.javaType} ${column.javaField}${column.queryField} = query.get${column.capJavaField}${column.queryField}(); - if (#if($column.javaType == 'String')!StringUtils.isEmpty(${column.javaField}${column.queryField})#{else}${column.javaField}${column.queryField} != null#end) { - qw.${column.queryMethod}("${column.columnName}", ${column.javaField}${column.queryField}); - } -#end -#end -#end - return ${className}Mapper.selectList(qw); - } - - /** - * 新增${functionName} - * - * @param ${className} ${functionName} - * @return 结果 - */ -#if($table.sub) - @Transactional -#end - public int insert(${ClassName} ${className}) { - ${className}.setDelFlag(0); -#foreach ($column in $columns) -#if($column.javaField == 'createTime') - ${className}.setCreateTime(#if($column.javaType == "Date")new Date()#else${column.javaType}.now()#end); -#end -#end -#if($table.sub) - int rows = ${className}Mapper.insert(${className}); - insert${subClassName}(${className}); - return rows; -#else - return ${className}Mapper.insert(${className}); -#end - } - - /** - * 修改${functionName} - * - * @param ${className} ${functionName} - * @return 结果 - */ -#if($table.sub) - @Transactional -#end - public int update(${ClassName} ${className}) { -#if($table.sub) - ${className}Mapper.delete${subClassName}By${subTableFkClassName}(${className}.get${pkColumn.capJavaField}()); - insert${subClassName}(${className}); -#end - return ${className}Mapper.updateById(${className}); - } - - /** - * 批量删除${functionName} - * - * @param ${pkColumn.javaField}s 需要删除的${functionName}主键 - * @return 结果 - */ -#if($table.sub) - @Transactional -#end - public int deleteBy${pkColumn.capJavaField}s(${pkColumn.javaType}[] ${pkColumn.javaField}s) { - return ${className}Mapper.updateDelFlagByIds(${pkColumn.javaField}s); - } - - /** - * 删除${functionName}信息 - * - * @param ${pkColumn.javaField} ${functionName}主键 - * @return 结果 - */ - public int deleteBy${pkColumn.capJavaField}(${pkColumn.javaType} ${pkColumn.javaField}) { - Long[] ${pkColumn.javaField}s = {${pkColumn.javaField}}; - return ${className}Mapper.updateDelFlagByIds(${pkColumn.javaField}s); - } -} diff --git a/ruoyi-generator/src/main/resources/vm/java/serviceImpl.java.vm b/ruoyi-generator/src/main/resources/vm/java/serviceImpl.java.vm deleted file mode 100644 index f6480c8..0000000 --- a/ruoyi-generator/src/main/resources/vm/java/serviceImpl.java.vm +++ /dev/null @@ -1,155 +0,0 @@ -package ${fullPackage}; - -import java.util.Arrays; -import java.util.List; -#if($table.hasDate()) -#foreach($date in $table.dateImports()) -import $date; -#end -#end -import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; -import com.github.pagehelper.PageHelper; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.data.domain.Pageable; -import org.springframework.stereotype.Service; -import org.apache.commons.lang3.StringUtils; -import ${_fullClass.mapper}; -import ${_fullClass.domain}; -import ${_fullClass.query}; -import ${_fullClass.service}; - -/** - * ${functionName}Service业务层处理 - * - * @author ${author} - */ -@Service -public class ${_className.serviceImpl} implements ${_className.service} { - @Autowired - private ${_className.mapper} ${className}Mapper; - - /** - * 查询${functionName} - * - * @param ${pkColumn.javaField} ${functionName}主键 - * @return ${functionName} - */ - @Override - public ${ClassName} selectBy${pkColumn.capJavaField}(${pkColumn.javaType} ${pkColumn.javaField}) { - return ${className}Mapper.selectBy${pkColumn.capJavaField}(${pkColumn.javaField}); - } - - /** - * 查询${functionName}列表 - * - * @param query 查询条件 - * @param page 分页条件 - * @return ${functionName} - */ - @Override - public List<${_className.domain}> selectList(${_className.query} query, Pageable page) { - if (page != null) { - PageHelper.startPage(page.getPageNumber() + 1, page.getPageSize()); - } - QueryWrapper<${_className.domain}> qw = new QueryWrapper<>(); -#foreach($column in $columns) -#if($column.query) -## 根据查询类型生成 EQ等于、NE不等于、GT大于、LT小于、LIKE模糊、BETWEEN范围 -## 范围查询, 使用数组实现 -#if($column.queryType == 'BETWEEN') - ${column.javaType}[] ${column.javaField}${column.queryField} = query.get${column.capJavaField}${column.queryField}(); - if (${column.javaField}${column.queryField} != null && ${column.javaField}${column.queryField}.length == 2) { - ${column.javaType} start = ${column.javaField}${column.queryField}[0]; - if (#if($column.javaType == 'String')!StringUtils.isEmpty(start)#{else}start != null#end) { - qw.ge("${column.columnName}", start); - } - ${column.javaType} end = ${column.javaField}Range[0]; - if (#if($column.javaType == 'String')!StringUtils.isEmpty(end) #{else}end != null#end) { - qw.le("${column.columnName}", end); - } - } -#else - ${column.javaType} ${column.javaField}${column.queryField} = query.get${column.capJavaField}${column.queryField}(); - if (#if($column.javaType == 'String')!StringUtils.isEmpty(${column.javaField}${column.queryField})#{else}${column.javaField}${column.queryField} != null#end) { - qw.${column.queryMethod}("${column.columnName}", ${column.javaField}${column.queryField}); - } -#end -#end -#end - return ${className}Mapper.selectList(qw); - } - - /** - * 新增${functionName} - * - * @param ${className} ${functionName} - * @return 结果 - */ -#if($table.sub) - @Transactional -#end - @Override - public int insert(${ClassName} ${className}) { -#foreach ($column in $columns) -#if($column.javaField == 'createTime') - ${className}.setCreateTime(#if($column.javaType == "Date")new Date()#else${column.javaType}.now()#end); -#end -#end -#if($table.sub) - int rows = ${className}Mapper.insert(${className}); - insert${subClassName}(${className}); - return rows; -#else - return ${className}Mapper.insert(${className}); -#end - } - - /** - * 修改${functionName} - * - * @param ${className} ${functionName} - * @return 结果 - */ -#if($table.sub) - @Transactional -#end - @Override - public int update(${ClassName} ${className}) { -#if($table.sub) - ${className}Mapper.delete${subClassName}By${subTableFkClassName}(${className}.get${pkColumn.capJavaField}()); - insert${subClassName}(${className}); -#end - return ${className}Mapper.updateById(${className}); - } - - /** - * 批量删除${functionName} - * - * @param ${pkColumn.javaField}s 需要删除的${functionName}主键 - * @return 结果 - */ -#if($table.sub) - @Transactional -#end - @Override - public int deleteBy${pkColumn.capJavaField}s(${pkColumn.javaType}[] ${pkColumn.javaField}s) { -#if($table.sub) - ${className}Mapper.delete${subClassName}By${subTableFkClassName}s(${pkColumn.javaField}s); -#end - return ${className}Mapper.deleteBatchIds(Arrays.asList(${pkColumn.javaField}s)); - } - - /** - * 删除${functionName}信息 - * - * @param ${pkColumn.javaField} ${functionName}主键 - * @return 结果 - */ - @Override - public int deleteBy${pkColumn.capJavaField}(${pkColumn.javaType} ${pkColumn.javaField}) { -#if($table.sub) - ${className}Mapper.delete${subClassName}By${subTableFkClassName}(${pkColumn.javaField}); -#end - return ${className}Mapper.deleteById(${pkColumn.javaField}); - } -} diff --git a/ruoyi-generator/src/main/resources/vm/java/vo.java.vm b/ruoyi-generator/src/main/resources/vm/java/vo.java.vm deleted file mode 100644 index 5c34821..0000000 --- a/ruoyi-generator/src/main/resources/vm/java/vo.java.vm +++ /dev/null @@ -1,47 +0,0 @@ -package ${fullPackage}; - -#foreach ($import in $importList) -import ${import}; -#end -import com.ruoyi.common.annotation.Excel; -import com.fasterxml.jackson.annotation.JsonFormat; -#if(${table.audit} == 1) -import ${env.baseAudit}; -#end -#if($table.sub) -import ${packageName}.pojo.dto.${subClassName}DTO; -#end -import lombok.Data; -/** - * ${functionName} 数据视图对象 - * - * @author ${author} - */ -@Data -public class ${ClassName}VO #if(${table.audit} == 1)extends BaseAudit#end { -#foreach ($column in $columns) -#if(!$table.isSuperColumn($column.javaField) and $column.javaField != "delFlag") - /** $column.columnComment */ -#if($column.list) -#set($parentheseIndex=$column.columnComment.indexOf("(")) -#if($parentheseIndex != -1) - #set($comment=$column.columnComment.substring(0, $parentheseIndex)) -#else - #set($comment=$column.columnComment) -#end -#if($parentheseIndex != -1) - @Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()") -#elseif($column.isDate()) - @JsonFormat(pattern = "${column.dateFormat}") - @Excel(name = "${comment}", width = 30, dateFormat = "${column.dateFormat}") -#else - @Excel(name = "${comment}") -#end -#end - private $column.javaType $column.javaField; -#end -#end -#if($table.sub) - private List<${subClassName}DTO> ${subclassName}List; -#end -} diff --git a/ruoyi-generator/src/main/resources/vm/sql/sql.vm b/ruoyi-generator/src/main/resources/vm/sql/sql.vm deleted file mode 100644 index c1ff1e6..0000000 --- a/ruoyi-generator/src/main/resources/vm/sql/sql.vm +++ /dev/null @@ -1,22 +0,0 @@ --- 菜单 SQL -insert into sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark) -values('${functionName}', '${parentMenuId}', '1', '${className}', '${moduleName}/${className}/index', 1, 0, 'C', '0', '0', '${permissionPrefix}:list', '#', 1, sysdate(), 1, null, '${functionName}菜单'); - --- 按钮父菜单ID -SELECT @parentId := LAST_INSERT_ID(); - --- 按钮 SQL -insert into sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark) -values('${functionName}查询', @parentId, '1', '#', '', 1, 0, 'F', '0', '0', '${permissionPrefix}:query', '#', 1, sysdate(), 1, null, ''); - -insert into sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark) -values('${functionName}新增', @parentId, '2', '#', '', 1, 0, 'F', '0', '0', '${permissionPrefix}:add', '#', 1, sysdate(), 1, null, ''); - -insert into sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark) -values('${functionName}修改', @parentId, '3', '#', '', 1, 0, 'F', '0', '0', '${permissionPrefix}:edit', '#', 1, sysdate(), 1, null, ''); - -insert into sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark) -values('${functionName}删除', @parentId, '4', '#', '', 1, 0, 'F', '0', '0', '${permissionPrefix}:remove', '#', 1, sysdate(), 1, null, ''); - -insert into sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark) -values('${functionName}导出', @parentId, '5', '#', '', 1, 0, 'F', '0', '0', '${permissionPrefix}:export', '#', 1, sysdate(), 1, null, ''); diff --git a/ruoyi-generator/src/main/resources/vm/vue/index-tree.vue.vm b/ruoyi-generator/src/main/resources/vm/vue/index-tree.vue.vm deleted file mode 100644 index a7febf1..0000000 --- a/ruoyi-generator/src/main/resources/vm/vue/index-tree.vue.vm +++ /dev/null @@ -1,476 +0,0 @@ - - - diff --git a/ruoyi-generator/src/main/resources/vm/vue/index.vue.vm b/ruoyi-generator/src/main/resources/vm/vue/index.vue.vm deleted file mode 100644 index 2e0fca6..0000000 --- a/ruoyi-generator/src/main/resources/vm/vue/index.vue.vm +++ /dev/null @@ -1,635 +0,0 @@ - - - diff --git a/ruoyi-generator/src/main/resources/vm/xml/mapper.xml.vm b/ruoyi-generator/src/main/resources/vm/xml/mapper.xml.vm deleted file mode 100644 index a3ecbf9..0000000 --- a/ruoyi-generator/src/main/resources/vm/xml/mapper.xml.vm +++ /dev/null @@ -1,61 +0,0 @@ - - - - - -#foreach ($column in $columns) - -#end -#if(${table.audit} == 1) - - - - -#end - - - - select#foreach($column in $columns) $column.columnName#if($velocityCount != $columns.size()),#end#end #if(${table.audit} == 1) #end from ${tableName} - - - - - - update ${tableName} set del_flag=1 - - id in #{it} - - - diff --git a/ruoyi-generator/src/test/java/com/ruoyi/generator/ApplicationTest.java b/ruoyi-generator/src/test/java/com/ruoyi/generator/ApplicationTest.java deleted file mode 100644 index cc25c1c..0000000 --- a/ruoyi-generator/src/test/java/com/ruoyi/generator/ApplicationTest.java +++ /dev/null @@ -1,75 +0,0 @@ -package com.ruoyi.generator; - -import com.ruoyi.generator.domain.GenTable; -import com.ruoyi.generator.service.IGenTableService; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.beans.factory.annotation.Qualifier; -import org.springframework.boot.test.context.SpringBootTest; -import org.springframework.test.context.ActiveProfiles; -import org.springframework.test.context.junit4.SpringRunner; - -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; - -@RunWith(SpringRunner.class) -@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.NONE, classes = SpringAppTest.class) -@ActiveProfiles("local") -public class ApplicationTest { - @Autowired - @Qualifier("genTableServiceImpl") - private IGenTableService genTableService; - - @Test - public void test2() { - List tableNames = Arrays.asList( -// 以下表前端改动交大 -// "wms_item", -// "wms_area" , -// "wms_carrier", -// "wms_supplier", -// "wms_rack" , -// 以下表,前端改动不大 -// "wms_warehouse" , -// "wms_customer" , -// "wms_inventory", -// "wms_inventory_history", -// "wms_receipt_order", -// "wms_receipt_order_detail" -// "wms_shipment_order", -// "wms_shipment_order_detail", -// "wms_inventory_movement", -// "wms_inventory_movement_detail", -// "wms_delivery" -// "wms_inventory_check", -// "wms_inventory_check_detail" - "wms_item_type" - ); - // 查询表信息 - List tableList = genTableService.selectGenTableByName(tableNames); - List notExist = new ArrayList<>(); - try { - tableList.forEach(it -> { - if (it.getTableId() == null) { - it.setAudit(1); - notExist.add(it); - } - }); - if (notExist.size() > 0) { - genTableService.importGenTable(notExist, -1L); - } - for (String tableName : tableNames) { - genTableService.generatorCode(tableName); - } - } finally { - // 删除生成 - if (notExist.size() > 0) { - Long[] ids = notExist.stream().map(GenTable::getTableId).toArray(Long[]::new); - genTableService.deleteGenTableByIds(ids); - } - } - } - -} diff --git a/ruoyi-generator/src/test/java/com/ruoyi/generator/CommonTest.java b/ruoyi-generator/src/test/java/com/ruoyi/generator/CommonTest.java deleted file mode 100644 index 7071e78..0000000 --- a/ruoyi-generator/src/test/java/com/ruoyi/generator/CommonTest.java +++ /dev/null @@ -1,14 +0,0 @@ -package com.ruoyi.generator; - -import cn.hutool.core.io.FileUtil; -import org.junit.jupiter.api.Test; - -import java.io.File; - -public class CommonTest { - @Test - public void testPath() { - System.out.println(System.getProperty("user.dir")); - System.out.println(FileUtil.getParent(System.getProperty("user.dir"), 1) + File.separator); - } -} diff --git a/ruoyi-generator/src/test/java/com/ruoyi/generator/SingleComponentTest.java b/ruoyi-generator/src/test/java/com/ruoyi/generator/SingleComponentTest.java deleted file mode 100644 index 1d73bdc..0000000 --- a/ruoyi-generator/src/test/java/com/ruoyi/generator/SingleComponentTest.java +++ /dev/null @@ -1,50 +0,0 @@ -package com.ruoyi.generator; - -import com.ruoyi.generator.domain.GenTable; -import com.ruoyi.generator.mapper.GenTableColumnMapper; -import com.ruoyi.generator.mapper.GenTableMapper; -import com.ruoyi.generator.service.GenTableServiceImpl; -import com.ruoyi.generator.service.IGenTableService; -import org.junit.Before; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.mockito.Mockito; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.boot.test.context.TestConfiguration; -import org.springframework.boot.test.mock.mockito.MockBean; -import org.springframework.context.annotation.Bean; -import org.springframework.test.context.junit4.SpringRunner; - -@RunWith(SpringRunner.class) -public class SingleComponentTest { - @TestConfiguration - static class EmployeeServiceImplTestContextConfiguration { - @Bean - public IGenTableService employeeService() { - return new GenTableServiceImpl(); - } - } - - @MockBean - private GenTableMapper genTableMapper; - @MockBean - private GenTableColumnMapper genTableColumnMapper; - - @Autowired - private IGenTableService genTableService; - - private String tableName = "sys_dept"; - - @Before - public void setUp() { - GenTable table = new GenTable(); - table.setTableName(tableName); - Mockito.when(genTableMapper.selectGenTableByName(tableName)) - .thenReturn(table); - } - - @Test - public void test1() { - genTableService.generatorCode(tableName); - } -} diff --git a/ruoyi-generator/src/test/java/com/ruoyi/generator/SpringAppTest.java b/ruoyi-generator/src/test/java/com/ruoyi/generator/SpringAppTest.java deleted file mode 100644 index 6fee30b..0000000 --- a/ruoyi-generator/src/test/java/com/ruoyi/generator/SpringAppTest.java +++ /dev/null @@ -1,16 +0,0 @@ -package com.ruoyi.generator; - -import org.mybatis.spring.annotation.MapperScan; -import org.springframework.boot.SpringApplication; -import org.springframework.boot.autoconfigure.SpringBootApplication; - -@SpringBootApplication( - scanBasePackages = {"com.ruoyi.generator"} -) -@MapperScan("com.ruoyi.generator.mapper") -public class SpringAppTest { - public static void main(String[] args) { - SpringApplication.run(SpringAppTest.class, args); - System.out.println("(♥◠‿◠)ノ゙ 若依启动成功 ლ(´ڡ`ლ)゙"); - } -} diff --git a/ruoyi-generator/src/test/resources/application.yml b/ruoyi-generator/src/test/resources/application.yml deleted file mode 100644 index 3d4d236..0000000 --- a/ruoyi-generator/src/test/resources/application.yml +++ /dev/null @@ -1,105 +0,0 @@ -spring: - datasource: - # driverClassName: org.h2.Driver - # url: jdbc:h2:mem:test;DB_CLOSE_DELAY=-1;MODE=MySQL - # schema: classpath*:sql/init.sql - # data: classpath:sql/data.sql - driverClassName: com.mysql.cj.jdbc.Driver - url: jdbc:mysql://localhost:3306/wms?useUnicode=true&characterEncoding=utf8&useSSL=false&useLegacyDatetimeCode=false&serverTimezone=UTC&createDatabaseIfNotExist=true&allowPublicKeyRetrieval=true - username: - password: - jpa: - properties: - hibernate: - dialect: org.hibernate.dialect.H2Dialect - show-sql: true -mybatis-plus: - # 搜索指定包别名 - typeAliasesPackage: com.ruoyi.**.domain - # 配置mapper的扫描,找到所有的mapper.xml映射文件 - mapperLocations: classpath*:mapper/**/*Mapper.xml - # 加载全局的配置文件 - # configLocation: classpath:mybatis/mybatis-config.xml -logging: - level: - root: info -gen: - # 作者 - author: zcc - # 默认生成包路径 system 需改成自己的模块名称 如 system monitor tool - packageName: com.cyl.wms - # 自动去除表前缀,默认是false - autoRemovePre: true - # 表前缀(生成类名不会包含表前缀,多个用逗号分隔) - tablePrefix: wms_ - # 一级权限名 - rootPermission: wms - # 模板根路径 - templateRootPath: vm2 - # 路径 - path: - # 后端根目录 - backPath: C:\Users\zccbbg\ichengle\ruoyi-vue-fork\ - # 后端 service 模块名 - serviceModule: wms - # 后端 api 模块名, 默认与 service 一致 - apiModule: wms - # 前端根目录 - frontPath: C:\Users\zccbbg\ichengle\ruoyi-ui\ - # 前端 api 目录 - frontApiPath: src/api/wms - # 前端 view 目录 - frontViewPath: src/views/wms - # sql 目录 - sql: sql - # 环境变量 - env: - # 审计 的 基类(创建者,创建时间,更新者,更新时间) - baseAudit: com.ruoyi.common.core.domain.BaseAudit - # 树 的 基类 - baseTree: com.ruoyi.common.core.domain.TreeEntity - # 对于新增的模板,如果没有默认值,在这里进行配置 - fileMap: - "api.js.vm": "${frontPath}/${frontApiPath}/${className}.js" - "controller.java.vm": "${backPath}/${serviceModule}/${MAIN_JAVA}/${packageName}/controller/${ClassName}Controller.java" - "service.java.vm": "${backPath}/${serviceModule}/${MAIN_JAVA}/${packageName}/service/${ClassName}Service.java" - "mapper.java.vm": "${backPath}/${serviceModule}/${MAIN_JAVA}/${packageName}/mapper/${ClassName}Mapper.java" - "convert.java.vm": "${backPath}/${serviceModule}/${MAIN_JAVA}/${packageName}/convert/${ClassName}Convert.java" - "example.java.vm": "${backPath}/${serviceModule}/${MAIN_JAVA}/${packageName}/pojo/example/${ClassName}Example.java" - "query.java.vm": "${backPath}/${serviceModule}/${MAIN_JAVA}/${packageName}/pojo/query/${ClassName}Query.java" - "dto.java.vm": "${backPath}/${serviceModule}/${MAIN_JAVA}/${packageName}/pojo/dto/${ClassName}DTO.java" - "vo.java.vm": "${backPath}/${serviceModule}/${MAIN_JAVA}/${packageName}/pojo/vo/${ClassName}VO.java" - "domain.java.vm": "${backPath}/${apiModule}/${MAIN_JAVA}/${packageName}/domain/${ClassName}.java" - "mapper.xml.vm": "${backPath}/${serviceModule}/${MAIN_RESOURCES}/mapper/${ClassName}Mapper.xml" - "sql.vm": "${backPath}/sql/${className}.sql" - "h2.sql.vm": "${backPath}/${serviceModule}/${MAIN_JAVA}/db/${tableName}-h2.sql" - "add.vue.vm": "${frontPath}/${frontViewPath}/Add${ClassName}.vue" - "index.vue.vm": "${frontPath}/${frontViewPath}/${className}/index.vue" - "index-tree.vue.vm": "${frontPath}/${frontViewPath}/index.vue" - "sub-domain.java.vm": "${frontPath}/${frontViewPath}/Sub${ClassName}.vue" - templates: - - vm2/js/api.js.vm - - vm2/java/controller.java.vm - - vm2/java/service.java.vm - - vm2/java/mapper.java.vm - - vm2/java/convert.java.vm - - vm2/java/query.java.vm - - vm2/java/dto.java.vm - - vm2/java/vo.java.vm - - vm2/java/domain.java.vm - - vm2/xml/mapper.xml.vm - # - vm2/sql/sql.vm - testTemplates: - # - vm2/sql/h2.sql.vm - crudTemplates: - # - vm2/vue/add.vue.vm - - vm2/vue/index.vue.vm - treeTemplates: - # - vm2/vue/index-tree.vue.vm - subTemplates: - # - vm2/vue/index.vue.vm - # - vm2/java/sub-domain.java.vm - type2component: - "String": "a-input(" - "LocalDate": "a-date-picker(" - "LocalDateTime": "a-date-picker(format=\"YYYY-MM-DD HH:mm\"" diff --git a/ruoyi-generator/src/test/resources/generator.properties b/ruoyi-generator/src/test/resources/generator.properties deleted file mode 100644 index 753c707..0000000 --- a/ruoyi-generator/src/test/resources/generator.properties +++ /dev/null @@ -1,5 +0,0 @@ -jdbc.driverClass=com.mysql.cj.jdbc.Driver -jdbc.connectionURL=jdbc:mysql://localhost:3306/test?useUnicode=true&characterEncoding=utf8&useSSL=false&useLegacyDatetimeCode=false&serverTimezone=UTC&createDatabaseIfNotExist=true&allowPublicKeyRetrieval=true -jdbc.userId=love_circle -jdbc.password=Flc2021! -root.path=C:\\workspace\\chengyule\\cdc\\bryx-platform\\bryx-emergency-duty-service diff --git a/ruoyi-generator/src/test/resources/generatorConfig.xml b/ruoyi-generator/src/test/resources/generatorConfig.xml deleted file mode 100644 index 7a7a886..0000000 --- a/ruoyi-generator/src/test/resources/generatorConfig.xml +++ /dev/null @@ -1,40 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-
-
diff --git a/ruoyi-generator/src/test/resources/logback.xml b/ruoyi-generator/src/test/resources/logback.xml deleted file mode 100644 index 7cbd86f..0000000 --- a/ruoyi-generator/src/test/resources/logback.xml +++ /dev/null @@ -1,87 +0,0 @@ - - - - - - - - - - - ${log.pattern} - - - - - - ${log.path}/lc.current.log - - - - ${log.path}/lc.%d{yyyy-MM-dd}.log - - 60 - - - ${log.pattern} - - - - INFO - - - - - ${log.path}/lc-error.log - - - - ${log.path}/lc-error.%d{yyyy-MM-dd}.log - - 60 - - - ${log.pattern} - - - - ERROR - - - - - - ${log.path}/sys-user.log - - - ${log.path}/sys-user.%d{yyyy-MM-dd}.log - - 60 - - - ${log.pattern} - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/ruoyi-generator/src/test/resources/vm2/java/controller.java.vm b/ruoyi-generator/src/test/resources/vm2/java/controller.java.vm deleted file mode 100644 index af28e19..0000000 --- a/ruoyi-generator/src/test/resources/vm2/java/controller.java.vm +++ /dev/null @@ -1,93 +0,0 @@ -package ${fullPackage}; - -import java.util.List; - -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; -import org.springframework.data.domain.PageImpl; -import org.springframework.data.domain.Pageable; -import org.springframework.data.domain.Page; -import org.springframework.http.ResponseEntity; -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.ruoyi.common.annotation.Log; -import com.ruoyi.common.core.controller.BaseController; -import com.ruoyi.common.enums.BusinessType; -import ${_fullClass.convert}; -import ${_fullClass.domain}; -import ${_fullClass.query}; -import ${_fullClass.service}; -import ${_fullClass.vo}; -import com.ruoyi.common.utils.poi.ExcelUtil; -/** - * ${functionName}Controller - * - * @author ${author} - * @date ${datetime} - */ -@Api(description ="${functionName}接口列表") -@RestController -@RequestMapping("/${moduleName}/${className}") -public class ${_className.controller} extends BaseController { - @Autowired - private ${_className.service} service; - @Autowired - private ${_className.convert} convert; - - @ApiOperation("查询${functionName}列表") - @PreAuthorize("@ss.hasPermi('${permissionPrefix}:list')") - @PostMapping("/list") - public ResponseEntity> list(@RequestBody ${_className.query} query, Pageable page) { - List<${_className.domain}> list = service.selectList(query, page); - return ResponseEntity.ok(new PageImpl<>(list, page, ((com.github.pagehelper.Page)list).getTotal())); - } - - @ApiOperation("导出${functionName}列表") - @PreAuthorize("@ss.hasPermi('${permissionPrefix}:export')") - @Log(title = "${functionName}", businessType = BusinessType.EXPORT) - @GetMapping("/export") - public ResponseEntity export(${_className.query} query) { - List<${ClassName}> list = service.selectList(query, null); - ExcelUtil<${_className.vo}> util = new ExcelUtil<>(${_className.vo}.class); - return ResponseEntity.ok(util.writeExcel(convert.dos2vos(list), "${functionName}数据")); - } - - @ApiOperation("获取${functionName}详细信息") - @PreAuthorize("@ss.hasPermi('${permissionPrefix}:query')") - @GetMapping(value = "/{${pkColumn.javaField}}") - public ResponseEntity<${ClassName}> getInfo(@PathVariable("${pkColumn.javaField}") ${pkColumn.javaType} ${pkColumn.javaField}) { - return ResponseEntity.ok(service.selectBy${pkColumn.capJavaField}(${pkColumn.javaField})); - } - - @ApiOperation("新增${functionName}") - @PreAuthorize("@ss.hasPermi('${permissionPrefix}:add')") - @Log(title = "${functionName}", businessType = BusinessType.INSERT) - @PostMapping - public ResponseEntity add(@RequestBody ${ClassName} ${className}) { - return ResponseEntity.ok(service.insert(${className})); - } - - @ApiOperation("修改${functionName}") - @PreAuthorize("@ss.hasPermi('${permissionPrefix}:edit')") - @Log(title = "${functionName}", businessType = BusinessType.UPDATE) - @PutMapping - public ResponseEntity edit(@RequestBody ${ClassName} ${className}) { - return ResponseEntity.ok(service.update(${className})); - } - - @ApiOperation("删除${functionName}") - @PreAuthorize("@ss.hasPermi('${permissionPrefix}:remove')") - @Log(title = "${functionName}", businessType = BusinessType.DELETE) - @DeleteMapping("/{${pkColumn.javaField}s}") - public ResponseEntity remove(@PathVariable ${pkColumn.javaType}[] ${pkColumn.javaField}s) { - return ResponseEntity.ok(service.deleteBy${pkColumn.capJavaField}s(${pkColumn.javaField}s)); - } -} diff --git a/ruoyi-generator/src/test/resources/vm2/java/convert.java.vm b/ruoyi-generator/src/test/resources/vm2/java/convert.java.vm deleted file mode 100644 index 2d420b9..0000000 --- a/ruoyi-generator/src/test/resources/vm2/java/convert.java.vm +++ /dev/null @@ -1,29 +0,0 @@ -package ${fullPackage}; - -import org.mapstruct.Mapper; -import ${_fullClass.domain}; -import ${_fullClass.dto}; -import ${_fullClass.vo}; -import java.util.List; -/** - * ${functionName} DO <=> DTO <=> VO / BO / Query - * - * @author ${author} - */ -@Mapper(componentModel = "spring"#if($table.sub), uses = ${subClassName}Convert.class#end) -public interface ${ClassName}Convert { - - /** - * @param source DO - * @return DTO - */ - ${ClassName}DTO do2dto(${ClassName} source); - - /** - * @param source DTO - * @return DO - */ - ${ClassName} dto2do(${ClassName}DTO source); - - List<${_className.vo}> dos2vos(List<${_className.domain}> list); -} diff --git a/ruoyi-generator/src/test/resources/vm2/java/domain.java.vm b/ruoyi-generator/src/test/resources/vm2/java/domain.java.vm deleted file mode 100644 index 6b8cf3c..0000000 --- a/ruoyi-generator/src/test/resources/vm2/java/domain.java.vm +++ /dev/null @@ -1,55 +0,0 @@ -package ${fullPackage}; - -#foreach ($import in $importList) -import ${import}; -#end -import com.ruoyi.common.annotation.Excel; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -#if(($table.crud || $table.sub) && $table.audit == 1) -import ${env.baseAudit}; -#end -import lombok.Data; -import com.baomidou.mybatisplus.annotation.TableName; -/** - * ${functionName}对象 ${tableName} - * - * @author ${author} - */ -@ApiModel(description="${functionName}对象") -#if(($table.crud || $table.sub) && $table.audit == 1) -#set($Entity="BaseAudit") -#end -@Data -@TableName("${tableName}") -public class ${ClassName}#if($Entity) extends ${Entity}#end { - private static final long serialVersionUID = 1L; - -#foreach ($column in $columns) -#if(!$table.isSuperColumn($column.javaField)) - @ApiModelProperty("$column.columnComment") -#if($column.list) -#set($parentheseIndex=$column.columnComment.indexOf("(")) -#if($parentheseIndex != -1) -#set($comment=$column.columnComment.substring(0, $parentheseIndex)) -#else -#set($comment=$column.columnComment) -#end -#if($parentheseIndex != -1) - @Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()") -#elseif($column.isDate()) - @Excel(name = "${comment}", width = 30, dateFormat = "${column.dateFormat}") -#else - @Excel(name = "${comment}") -#end -#end - private $column.javaType $column.javaField; - -#end -#end -#if($table.sub) - /** $table.subTable.functionName信息 */ - private List<${subClassName}> ${subclassName}List; - -#end -} diff --git a/ruoyi-generator/src/test/resources/vm2/java/dto.java.vm b/ruoyi-generator/src/test/resources/vm2/java/dto.java.vm deleted file mode 100644 index bba80d8..0000000 --- a/ruoyi-generator/src/test/resources/vm2/java/dto.java.vm +++ /dev/null @@ -1,25 +0,0 @@ -package ${fullPackage}; - -#foreach ($import in $importList) -import ${import}; -#end -#if( ${table.audit} == 1 ) -import ${env.baseAudit}; -#end -import lombok.Data; -/** - * ${functionName} DTO 对象 - * - * @author ${author} - */ -@Data -public class ${ClassName}DTO#if( ${table.audit} == 1 ) extends BaseAudit#end { -#foreach ($column in $columns) -#if(!$table.isSuperColumn($column.javaField) and $column.javaField != "delFlag") - private $column.javaType $column.javaField; -#end -#end -#if($table.sub) - private List<${subClassName}DTO> ${subclassName}List; -#end -} diff --git a/ruoyi-generator/src/test/resources/vm2/java/example.java.vm b/ruoyi-generator/src/test/resources/vm2/java/example.java.vm deleted file mode 100644 index 14c3938..0000000 --- a/ruoyi-generator/src/test/resources/vm2/java/example.java.vm +++ /dev/null @@ -1,305 +0,0 @@ -package ${fullPackage}; - -#foreach ($import in $importList) -import ${import}; -#end -import java.util.ArrayList; -import java.util.Date; -import java.util.Iterator; -import java.util.List; -import java.time.LocalDate; -import java.time.LocalDateTime; - -public class ${ClassName}Example { - protected String orderByClause; - - protected boolean distinct; - - protected List oredCriteria; - - public ${ClassName}Example() { - oredCriteria = new ArrayList<>(); - } - - public void setOrderByClause(String orderByClause) { - this.orderByClause = orderByClause; - } - - public String getOrderByClause() { - return orderByClause; - } - - public void setDistinct(boolean distinct) { - this.distinct = distinct; - } - - public boolean isDistinct() { - return distinct; - } - - public List getOredCriteria() { - return oredCriteria; - } - - public void or(Criteria criteria) { - oredCriteria.add(criteria); - } - - public Criteria or() { - Criteria criteria = createCriteriaInternal(); - oredCriteria.add(criteria); - return criteria; - } - - public Criteria createCriteria() { - Criteria criteria = createCriteriaInternal(); - if (oredCriteria.size() == 0) { - oredCriteria.add(criteria); - } - return criteria; - } - - protected Criteria createCriteriaInternal() { - Criteria criteria = new Criteria(); - return criteria; - } - - public void clear() { - oredCriteria.clear(); - orderByClause = null; - distinct = false; - } - - protected abstract static class GeneratedCriteria { - protected List criteria; - - protected GeneratedCriteria() { - super(); - criteria = new ArrayList<>(); - } - - public boolean isValid() { - return criteria.size() > 0; - } - - public List getAllCriteria() { - return criteria; - } - - public List getCriteria() { - return criteria; - } - - protected void addCriterion(String condition) { - if (condition == null) { - throw new RuntimeException("Value for condition cannot be null"); - } - criteria.add(new Criterion(condition)); - } - - protected void addCriterion(String condition, Object value, String property) { - if (value == null) { - throw new RuntimeException("Value for " + property + " cannot be null"); - } - criteria.add(new Criterion(condition, value)); - } - - protected void addCriterion(String condition, Object value1, Object value2, String property) { - if (value1 == null || value2 == null) { - throw new RuntimeException("Between values for " + property + " cannot be null"); - } - criteria.add(new Criterion(condition, value1, value2)); - } - - protected void addCriterionForJDBCDate(String condition, Date value, String property) { - if (value == null) { - throw new RuntimeException("Value for " + property + " cannot be null"); - } - addCriterion(condition, new java.sql.Date(value.getTime()), property); - } - - protected void addCriterionForJDBCDate(String condition, List values, String property) { - if (values == null || values.size() == 0) { - throw new RuntimeException("Value list for " + property + " cannot be null or empty"); - } - List dateList = new ArrayList<>(); - Iterator iter = values.iterator(); - while (iter.hasNext()) { - dateList.add(new java.sql.Date(iter.next().getTime())); - } - addCriterion(condition, dateList, property); - } - - protected void addCriterionForJDBCDate(String condition, Date value1, Date value2, String property) { - if (value1 == null || value2 == null) { - throw new RuntimeException("Between values for " + property + " cannot be null"); - } - addCriterion(condition, new java.sql.Date(value1.getTime()), new java.sql.Date(value2.getTime()), property); - } -#foreach ($column in $columns) - public Criteria and${column.capJavaField}IsNull() { - addCriterion("${column.columnName} is null"); - return (Criteria) this; - } - - public Criteria and${column.capJavaField}IsNotNull() { - addCriterion("${column.columnName} is not null"); - return (Criteria) this; - } - - public Criteria and${column.capJavaField}EqualTo(${column.javaType} value) { - addCriterion("${column.columnName} =", value, "${column.javaField}"); - return (Criteria) this; - } - - public Criteria and${column.capJavaField}NotEqualTo(${column.javaType} value) { - addCriterion("${column.columnName} <>", value, "${column.javaField}"); - return (Criteria) this; - } - - public Criteria and${column.capJavaField}GreaterThan(${column.javaType} value) { - addCriterion("${column.columnName} >", value, "${column.javaField}"); - return (Criteria) this; - } - - public Criteria and${column.capJavaField}GreaterThanOrEqualTo(${column.javaType} value) { - addCriterion("${column.columnName} >=", value, "${column.javaField}"); - return (Criteria) this; - } - - public Criteria and${column.capJavaField}LessThan(${column.javaType} value) { - addCriterion("${column.columnName} <", value, "${column.javaField}"); - return (Criteria) this; - } - - public Criteria and${column.capJavaField}LessThanOrEqualTo(${column.javaType} value) { - addCriterion("${column.columnName} <=", value, "${column.javaField}"); - return (Criteria) this; - } -#if($column.javaType == 'String') - - public Criteria and${column.capJavaField}Like(${column.javaType} value) { - addCriterion("${column.columnName} like", value, "${column.javaField}"); - return (Criteria) this; - } - - public Criteria and${column.capJavaField}NotLike(${column.javaType} value) { - addCriterion("${column.columnName} not like", value, "${column.javaField}"); - return (Criteria) this; - } - -#end - public Criteria and${column.capJavaField}In(List<${column.javaType}> values) { - addCriterion("${column.columnName} in", values, "${column.javaField}"); - return (Criteria) this; - } - - public Criteria and${column.capJavaField}NotIn(List<${column.javaType}> values) { - addCriterion("${column.columnName} not in", values, "${column.javaField}"); - return (Criteria) this; - } - - public Criteria and${column.capJavaField}Between(${column.javaType} value1, ${column.javaType} value2) { - addCriterion("${column.columnName} between", value1, value2, "${column.javaField}"); - return (Criteria) this; - } - - public Criteria and${column.capJavaField}NotBetween(${column.javaType} value1, ${column.javaType} value2) { - addCriterion("${column.columnName} not between", value1, value2, "${column.javaField}"); - return (Criteria) this; - } -#end - } - - public static class Criteria extends GeneratedCriteria { - protected Criteria() { - super(); - } - } - - public static class Criterion { - private String condition; - - private Object value; - - private Object secondValue; - - private boolean noValue; - - private boolean singleValue; - - private boolean betweenValue; - - private boolean listValue; - - private String typeHandler; - - public String getCondition() { - return condition; - } - - public Object getValue() { - return value; - } - - public Object getSecondValue() { - return secondValue; - } - - public boolean isNoValue() { - return noValue; - } - - public boolean isSingleValue() { - return singleValue; - } - - public boolean isBetweenValue() { - return betweenValue; - } - - public boolean isListValue() { - return listValue; - } - - public String getTypeHandler() { - return typeHandler; - } - - protected Criterion(String condition) { - super(); - this.condition = condition; - this.typeHandler = null; - this.noValue = true; - } - - protected Criterion(String condition, Object value, String typeHandler) { - super(); - this.condition = condition; - this.value = value; - this.typeHandler = typeHandler; - if (value instanceof List) { - this.listValue = true; - } else { - this.singleValue = true; - } - } - - protected Criterion(String condition, Object value) { - this(condition, value, null); - } - - protected Criterion(String condition, Object value, Object secondValue, String typeHandler) { - super(); - this.condition = condition; - this.value = value; - this.secondValue = secondValue; - this.typeHandler = typeHandler; - this.betweenValue = true; - } - - protected Criterion(String condition, Object value, Object secondValue) { - this(condition, value, secondValue, null); - } - } -} diff --git a/ruoyi-generator/src/test/resources/vm2/java/mapper.java.vm b/ruoyi-generator/src/test/resources/vm2/java/mapper.java.vm deleted file mode 100644 index 0d44884..0000000 --- a/ruoyi-generator/src/test/resources/vm2/java/mapper.java.vm +++ /dev/null @@ -1,28 +0,0 @@ -package ${fullPackage}; - -import java.util.List; -import com.baomidou.mybatisplus.core.mapper.BaseMapper; -import org.apache.ibatis.annotations.Param; -import ${_fullClass.domain}; - -/** - * ${functionName}Mapper接口 - * - * @author ${author} - */ -public interface ${ClassName}Mapper extends BaseMapper<${ClassName}> { - /** - * 查询${functionName}列表 - * - * @param ${className} ${functionName} - * @return ${functionName}集合 - */ - List<${ClassName}> selectByEntity(${ClassName} ${className}); - - /** - * 批量软删除 - * @param ids - * @return - */ - int updateDelFlagByIds(@Param("ids") Long[] ids); -} diff --git a/ruoyi-generator/src/test/resources/vm2/java/query.java.vm b/ruoyi-generator/src/test/resources/vm2/java/query.java.vm deleted file mode 100644 index b28af37..0000000 --- a/ruoyi-generator/src/test/resources/vm2/java/query.java.vm +++ /dev/null @@ -1,32 +0,0 @@ -package ${fullPackage}; - -#foreach ($import in $importList) -import ${import}; -#end -import lombok.Data; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; - -/** - * ${functionName} 查询 对象 - * - * @author ${author} - */ -@ApiModel(description="${functionName} 查询 对象") -@Data -public class ${_className.query} { -#foreach($column in $columns) -#if($column.query) -## 根据查询类型生成 EQ等于、NE不等于、GT大于、LT小于、LIKE模糊、BETWEEN范围 -## 范围查询, 使用数组实现 -#if($column.queryType == 'BETWEEN') - @ApiModelProperty("${column.genLabel()} 范围") - private ${column.javaType}[] ${column.javaField}${column.queryField}; -#else - @ApiModelProperty("${column.genLabel()} 精确匹配") - private ${column.javaType} ${column.javaField}${column.queryField}; -#end - -#end -#end -} diff --git a/ruoyi-generator/src/test/resources/vm2/java/service.java.vm b/ruoyi-generator/src/test/resources/vm2/java/service.java.vm deleted file mode 100644 index d2d6508..0000000 --- a/ruoyi-generator/src/test/resources/vm2/java/service.java.vm +++ /dev/null @@ -1,149 +0,0 @@ -package ${fullPackage}; - -#foreach ($import in $importList) -import ${import}; -#end -import java.util.Arrays; -import java.util.List; -#if($table.hasDate()) -#foreach($date in $table.dateImports()) -import $date; -#end -#end -import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; -import com.github.pagehelper.PageHelper; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.data.domain.Pageable; -import org.apache.commons.lang3.StringUtils; -import org.springframework.stereotype.Service; -import ${_fullClass.mapper}; -import #evaluate(${_fullClass.domain}); -import #evaluate(${_fullClass.query}); - -/** - * ${functionName}Service业务层处理 - * - * - * @author ${author} - */ -@Service -public class ${ClassName}Service { - @Autowired - private ${_className.mapper} ${className}Mapper; - - /** - * 查询${functionName} - * - * @param ${pkColumn.javaField} ${functionName}主键 - * @return ${functionName} - */ - public ${ClassName} selectBy${pkColumn.capJavaField}(${pkColumn.javaType} ${pkColumn.javaField}) { - return ${className}Mapper.selectById(${pkColumn.javaField}); - } - - /** - * 查询${functionName}列表 - * - * @param query 查询条件 - * @param page 分页条件 - * @return ${functionName} - */ - public List<${_className.domain}> selectList(${_className.query} query, Pageable page) { - if (page != null) { - PageHelper.startPage(page.getPageNumber() + 1, page.getPageSize()); - } - QueryWrapper<${_className.domain}> qw = new QueryWrapper<>(); - qw.eq("del_flag",0); -#foreach($column in $columns) -#if($column.query) -## 根据查询类型生成 EQ等于、NE不等于、GT大于、LT小于、LIKE模糊、BETWEEN范围 -## 范围查询, 使用数组实现 -#if($column.queryType == 'BETWEEN') - ${column.javaType}[] ${column.javaField}${column.queryField} = query.get${column.capJavaField}${column.queryField}(); - if (${column.javaField}${column.queryField} != null && ${column.javaField}${column.queryField}.length == 2) { - ${column.javaType} start = ${column.javaField}${column.queryField}[0]; - if (#if($column.javaType == 'String')!StringUtils.isEmpty(start)#{else}start != null#end) { - qw.ge("${column.columnName}", start); - } - ${column.javaType} end = ${column.javaField}Range[0]; - if (#if($column.javaType == 'String')!StringUtils.isEmpty(end) #{else}end != null#end) { - qw.le("${column.columnName}", end); - } - } -#else - ${column.javaType} ${column.javaField}${column.queryField} = query.get${column.capJavaField}${column.queryField}(); - if (#if($column.javaType == 'String')!StringUtils.isEmpty(${column.javaField}${column.queryField})#{else}${column.javaField}${column.queryField} != null#end) { - qw.${column.queryMethod}("${column.columnName}", ${column.javaField}${column.queryField}); - } -#end -#end -#end - return ${className}Mapper.selectList(qw); - } - - /** - * 新增${functionName} - * - * @param ${className} ${functionName} - * @return 结果 - */ -#if($table.sub) - @Transactional -#end - public int insert(${ClassName} ${className}) { - ${className}.setDelFlag(0); -#foreach ($column in $columns) -#if($column.javaField == 'createTime') - ${className}.setCreateTime(#if($column.javaType == "Date")new Date()#else${column.javaType}.now()#end); -#end -#end -#if($table.sub) - int rows = ${className}Mapper.insert(${className}); - insert${subClassName}(${className}); - return rows; -#else - return ${className}Mapper.insert(${className}); -#end - } - - /** - * 修改${functionName} - * - * @param ${className} ${functionName} - * @return 结果 - */ -#if($table.sub) - @Transactional -#end - public int update(${ClassName} ${className}) { -#if($table.sub) - ${className}Mapper.delete${subClassName}By${subTableFkClassName}(${className}.get${pkColumn.capJavaField}()); - insert${subClassName}(${className}); -#end - return ${className}Mapper.updateById(${className}); - } - - /** - * 批量删除${functionName} - * - * @param ${pkColumn.javaField}s 需要删除的${functionName}主键 - * @return 结果 - */ -#if($table.sub) - @Transactional -#end - public int deleteBy${pkColumn.capJavaField}s(${pkColumn.javaType}[] ${pkColumn.javaField}s) { - return ${className}Mapper.updateDelFlagByIds(${pkColumn.javaField}s); - } - - /** - * 删除${functionName}信息 - * - * @param ${pkColumn.javaField} ${functionName}主键 - * @return 结果 - */ - public int deleteBy${pkColumn.capJavaField}(${pkColumn.javaType} ${pkColumn.javaField}) { - Long[] ${pkColumn.javaField}s = {${pkColumn.javaField}}; - return ${className}Mapper.updateDelFlagByIds(${pkColumn.javaField}s); - } -} diff --git a/ruoyi-generator/src/test/resources/vm2/java/serviceImpl.java.vm b/ruoyi-generator/src/test/resources/vm2/java/serviceImpl.java.vm deleted file mode 100644 index f6480c8..0000000 --- a/ruoyi-generator/src/test/resources/vm2/java/serviceImpl.java.vm +++ /dev/null @@ -1,155 +0,0 @@ -package ${fullPackage}; - -import java.util.Arrays; -import java.util.List; -#if($table.hasDate()) -#foreach($date in $table.dateImports()) -import $date; -#end -#end -import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; -import com.github.pagehelper.PageHelper; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.data.domain.Pageable; -import org.springframework.stereotype.Service; -import org.apache.commons.lang3.StringUtils; -import ${_fullClass.mapper}; -import ${_fullClass.domain}; -import ${_fullClass.query}; -import ${_fullClass.service}; - -/** - * ${functionName}Service业务层处理 - * - * @author ${author} - */ -@Service -public class ${_className.serviceImpl} implements ${_className.service} { - @Autowired - private ${_className.mapper} ${className}Mapper; - - /** - * 查询${functionName} - * - * @param ${pkColumn.javaField} ${functionName}主键 - * @return ${functionName} - */ - @Override - public ${ClassName} selectBy${pkColumn.capJavaField}(${pkColumn.javaType} ${pkColumn.javaField}) { - return ${className}Mapper.selectBy${pkColumn.capJavaField}(${pkColumn.javaField}); - } - - /** - * 查询${functionName}列表 - * - * @param query 查询条件 - * @param page 分页条件 - * @return ${functionName} - */ - @Override - public List<${_className.domain}> selectList(${_className.query} query, Pageable page) { - if (page != null) { - PageHelper.startPage(page.getPageNumber() + 1, page.getPageSize()); - } - QueryWrapper<${_className.domain}> qw = new QueryWrapper<>(); -#foreach($column in $columns) -#if($column.query) -## 根据查询类型生成 EQ等于、NE不等于、GT大于、LT小于、LIKE模糊、BETWEEN范围 -## 范围查询, 使用数组实现 -#if($column.queryType == 'BETWEEN') - ${column.javaType}[] ${column.javaField}${column.queryField} = query.get${column.capJavaField}${column.queryField}(); - if (${column.javaField}${column.queryField} != null && ${column.javaField}${column.queryField}.length == 2) { - ${column.javaType} start = ${column.javaField}${column.queryField}[0]; - if (#if($column.javaType == 'String')!StringUtils.isEmpty(start)#{else}start != null#end) { - qw.ge("${column.columnName}", start); - } - ${column.javaType} end = ${column.javaField}Range[0]; - if (#if($column.javaType == 'String')!StringUtils.isEmpty(end) #{else}end != null#end) { - qw.le("${column.columnName}", end); - } - } -#else - ${column.javaType} ${column.javaField}${column.queryField} = query.get${column.capJavaField}${column.queryField}(); - if (#if($column.javaType == 'String')!StringUtils.isEmpty(${column.javaField}${column.queryField})#{else}${column.javaField}${column.queryField} != null#end) { - qw.${column.queryMethod}("${column.columnName}", ${column.javaField}${column.queryField}); - } -#end -#end -#end - return ${className}Mapper.selectList(qw); - } - - /** - * 新增${functionName} - * - * @param ${className} ${functionName} - * @return 结果 - */ -#if($table.sub) - @Transactional -#end - @Override - public int insert(${ClassName} ${className}) { -#foreach ($column in $columns) -#if($column.javaField == 'createTime') - ${className}.setCreateTime(#if($column.javaType == "Date")new Date()#else${column.javaType}.now()#end); -#end -#end -#if($table.sub) - int rows = ${className}Mapper.insert(${className}); - insert${subClassName}(${className}); - return rows; -#else - return ${className}Mapper.insert(${className}); -#end - } - - /** - * 修改${functionName} - * - * @param ${className} ${functionName} - * @return 结果 - */ -#if($table.sub) - @Transactional -#end - @Override - public int update(${ClassName} ${className}) { -#if($table.sub) - ${className}Mapper.delete${subClassName}By${subTableFkClassName}(${className}.get${pkColumn.capJavaField}()); - insert${subClassName}(${className}); -#end - return ${className}Mapper.updateById(${className}); - } - - /** - * 批量删除${functionName} - * - * @param ${pkColumn.javaField}s 需要删除的${functionName}主键 - * @return 结果 - */ -#if($table.sub) - @Transactional -#end - @Override - public int deleteBy${pkColumn.capJavaField}s(${pkColumn.javaType}[] ${pkColumn.javaField}s) { -#if($table.sub) - ${className}Mapper.delete${subClassName}By${subTableFkClassName}s(${pkColumn.javaField}s); -#end - return ${className}Mapper.deleteBatchIds(Arrays.asList(${pkColumn.javaField}s)); - } - - /** - * 删除${functionName}信息 - * - * @param ${pkColumn.javaField} ${functionName}主键 - * @return 结果 - */ - @Override - public int deleteBy${pkColumn.capJavaField}(${pkColumn.javaType} ${pkColumn.javaField}) { -#if($table.sub) - ${className}Mapper.delete${subClassName}By${subTableFkClassName}(${pkColumn.javaField}); -#end - return ${className}Mapper.deleteById(${pkColumn.javaField}); - } -} diff --git a/ruoyi-generator/src/test/resources/vm2/java/vo.java.vm b/ruoyi-generator/src/test/resources/vm2/java/vo.java.vm deleted file mode 100644 index 5c34821..0000000 --- a/ruoyi-generator/src/test/resources/vm2/java/vo.java.vm +++ /dev/null @@ -1,47 +0,0 @@ -package ${fullPackage}; - -#foreach ($import in $importList) -import ${import}; -#end -import com.ruoyi.common.annotation.Excel; -import com.fasterxml.jackson.annotation.JsonFormat; -#if(${table.audit} == 1) -import ${env.baseAudit}; -#end -#if($table.sub) -import ${packageName}.pojo.dto.${subClassName}DTO; -#end -import lombok.Data; -/** - * ${functionName} 数据视图对象 - * - * @author ${author} - */ -@Data -public class ${ClassName}VO #if(${table.audit} == 1)extends BaseAudit#end { -#foreach ($column in $columns) -#if(!$table.isSuperColumn($column.javaField) and $column.javaField != "delFlag") - /** $column.columnComment */ -#if($column.list) -#set($parentheseIndex=$column.columnComment.indexOf("(")) -#if($parentheseIndex != -1) - #set($comment=$column.columnComment.substring(0, $parentheseIndex)) -#else - #set($comment=$column.columnComment) -#end -#if($parentheseIndex != -1) - @Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()") -#elseif($column.isDate()) - @JsonFormat(pattern = "${column.dateFormat}") - @Excel(name = "${comment}", width = 30, dateFormat = "${column.dateFormat}") -#else - @Excel(name = "${comment}") -#end -#end - private $column.javaType $column.javaField; -#end -#end -#if($table.sub) - private List<${subClassName}DTO> ${subclassName}List; -#end -} diff --git a/ruoyi-generator/src/test/resources/vm2/js/api.js.vm b/ruoyi-generator/src/test/resources/vm2/js/api.js.vm deleted file mode 100644 index 5d868f2..0000000 --- a/ruoyi-generator/src/test/resources/vm2/js/api.js.vm +++ /dev/null @@ -1,54 +0,0 @@ -import request from '@/utils/request' - -// 查询${functionName}列表 -export function list${BusinessName}(query, pageReq) { - return request({ - url: '/${moduleName}/${className}/list', - method: 'post', - data: query, - params: pageReq - }) -} - -// 查询${functionName}详细 -export function get${BusinessName}(${pkColumn.javaField}) { - return request({ - url: '/${moduleName}/${className}/' + ${pkColumn.javaField}, - method: 'get' - }) -} - -// 新增${functionName} -export function add${BusinessName}(data) { - return request({ - url: '/${moduleName}/${className}', - method: 'post', - data: data - }) -} - -// 修改${functionName} -export function update${BusinessName}(data) { - return request({ - url: '/${moduleName}/${className}', - method: 'put', - data: data - }) -} - -// 删除${functionName} -export function del${BusinessName}(${pkColumn.javaField}) { - return request({ - url: '/${moduleName}/${className}/' + ${pkColumn.javaField}, - method: 'delete' - }) -} - -// 导出${functionName} -export function export${BusinessName}(query) { - return request({ - url: '/${moduleName}/${className}/export', - method: 'get', - params: query - }) -} diff --git a/ruoyi-generator/src/test/resources/vm2/sql/sql.vm b/ruoyi-generator/src/test/resources/vm2/sql/sql.vm deleted file mode 100644 index c1ff1e6..0000000 --- a/ruoyi-generator/src/test/resources/vm2/sql/sql.vm +++ /dev/null @@ -1,22 +0,0 @@ --- 菜单 SQL -insert into sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark) -values('${functionName}', '${parentMenuId}', '1', '${className}', '${moduleName}/${className}/index', 1, 0, 'C', '0', '0', '${permissionPrefix}:list', '#', 1, sysdate(), 1, null, '${functionName}菜单'); - --- 按钮父菜单ID -SELECT @parentId := LAST_INSERT_ID(); - --- 按钮 SQL -insert into sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark) -values('${functionName}查询', @parentId, '1', '#', '', 1, 0, 'F', '0', '0', '${permissionPrefix}:query', '#', 1, sysdate(), 1, null, ''); - -insert into sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark) -values('${functionName}新增', @parentId, '2', '#', '', 1, 0, 'F', '0', '0', '${permissionPrefix}:add', '#', 1, sysdate(), 1, null, ''); - -insert into sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark) -values('${functionName}修改', @parentId, '3', '#', '', 1, 0, 'F', '0', '0', '${permissionPrefix}:edit', '#', 1, sysdate(), 1, null, ''); - -insert into sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark) -values('${functionName}删除', @parentId, '4', '#', '', 1, 0, 'F', '0', '0', '${permissionPrefix}:remove', '#', 1, sysdate(), 1, null, ''); - -insert into sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark) -values('${functionName}导出', @parentId, '5', '#', '', 1, 0, 'F', '0', '0', '${permissionPrefix}:export', '#', 1, sysdate(), 1, null, ''); diff --git a/ruoyi-generator/src/test/resources/vm2/vue/index-tree.vue.vm b/ruoyi-generator/src/test/resources/vm2/vue/index-tree.vue.vm deleted file mode 100644 index a7febf1..0000000 --- a/ruoyi-generator/src/test/resources/vm2/vue/index-tree.vue.vm +++ /dev/null @@ -1,476 +0,0 @@ - - - diff --git a/ruoyi-generator/src/test/resources/vm2/vue/index.vue.vm b/ruoyi-generator/src/test/resources/vm2/vue/index.vue.vm deleted file mode 100644 index 9f6bb99..0000000 --- a/ruoyi-generator/src/test/resources/vm2/vue/index.vue.vm +++ /dev/null @@ -1,635 +0,0 @@ - - - diff --git a/ruoyi-generator/src/test/resources/vm2/xml/mapper.xml.vm b/ruoyi-generator/src/test/resources/vm2/xml/mapper.xml.vm deleted file mode 100644 index a3ecbf9..0000000 --- a/ruoyi-generator/src/test/resources/vm2/xml/mapper.xml.vm +++ /dev/null @@ -1,61 +0,0 @@ - - - - - -#foreach ($column in $columns) - -#end -#if(${table.audit} == 1) - - - - -#end - - - - select#foreach($column in $columns) $column.columnName#if($velocityCount != $columns.size()),#end#end #if(${table.audit} == 1) #end from ${tableName} - - - - - - update ${tableName} set del_flag=1 - - id in #{it} - - - diff --git a/ruoyi-modules/pom.xml b/ruoyi-modules/pom.xml new file mode 100644 index 0000000..a1e5139 --- /dev/null +++ b/ruoyi-modules/pom.xml @@ -0,0 +1,25 @@ + + + + ruoyi-fast-service + com.ruoyi + ${revision} + + 4.0.0 + + + ruoyi-demo + ruoyi-generator + ruoyi-system + + + ruoyi-modules + pom + + + ruoyi-modules 业务模块 + + + diff --git a/ruoyi-modules/ruoyi-demo/pom.xml b/ruoyi-modules/ruoyi-demo/pom.xml new file mode 100644 index 0000000..cafd6d1 --- /dev/null +++ b/ruoyi-modules/ruoyi-demo/pom.xml @@ -0,0 +1,98 @@ + + + + ruoyi-modules + com.ruoyi + ${revision} + + 4.0.0 + + ruoyi-demo + + + demo模块 + + + + + + + com.ruoyi + ruoyi-common-core + + + + com.ruoyi + ruoyi-common-sms + + + + com.ruoyi + ruoyi-common-excel + + + + com.ruoyi + ruoyi-common-log + + + + com.ruoyi + ruoyi-common-mail + + + + com.ruoyi + ruoyi-common-redis + + + + com.ruoyi + ruoyi-common-web + + + + com.ruoyi + ruoyi-common-security + + + + com.ruoyi + ruoyi-common-mybatis + + + + com.ruoyi + ruoyi-common-ratelimiter + + + + com.ruoyi + ruoyi-common-translation + + + + com.ruoyi + ruoyi-common-sensitive + + + + com.ruoyi + ruoyi-common-encrypt + + + + com.ruoyi + ruoyi-common-idempotent + + + + com.ruoyi + ruoyi-common-doc + + + + + diff --git a/ruoyi-modules/ruoyi-demo/src/main/java/com/ruoyi/demo/controller/MailController.java b/ruoyi-modules/ruoyi-demo/src/main/java/com/ruoyi/demo/controller/MailController.java new file mode 100644 index 0000000..3d890ac --- /dev/null +++ b/ruoyi-modules/ruoyi-demo/src/main/java/com/ruoyi/demo/controller/MailController.java @@ -0,0 +1,52 @@ +package com.ruoyi.demo.controller; + +import com.ruoyi.common.core.domain.R; +import com.ruoyi.common.mail.utils.MailUtils; +import lombok.RequiredArgsConstructor; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +import java.io.File; + + +/** + * 邮件发送案例 + * + * @author Michelle.Chung + */ +@Validated +@RequiredArgsConstructor +@RestController +@RequestMapping("/demo/mail") +public class MailController { + + /** + * 发送邮件 + * + * @param to 接收人 + * @param subject 标题 + * @param text 内容 + */ + @GetMapping("/sendSimpleMessage") + public R sendSimpleMessage(String to, String subject, String text) { + MailUtils.sendText(to, subject, text); + return R.ok(); + } + + /** + * 发送邮件(带附件) + * + * @param to 接收人 + * @param subject 标题 + * @param text 内容 + * @param filePath 附件路径 + */ + @GetMapping("/sendMessageWithAttachment") + public R sendMessageWithAttachment(String to, String subject, String text, String filePath) { + MailUtils.sendText(to, subject, text, new File(filePath)); + return R.ok(); + } + +} diff --git a/ruoyi-modules/ruoyi-demo/src/main/java/com/ruoyi/demo/controller/RedisCacheController.java b/ruoyi-modules/ruoyi-demo/src/main/java/com/ruoyi/demo/controller/RedisCacheController.java new file mode 100644 index 0000000..672608b --- /dev/null +++ b/ruoyi-modules/ruoyi-demo/src/main/java/com/ruoyi/demo/controller/RedisCacheController.java @@ -0,0 +1,95 @@ +package com.ruoyi.demo.controller; + +import com.ruoyi.common.core.constant.CacheNames; +import com.ruoyi.common.core.domain.R; +import com.ruoyi.common.redis.utils.RedisUtils; +import lombok.RequiredArgsConstructor; +import org.springframework.cache.annotation.CacheEvict; +import org.springframework.cache.annotation.CachePut; +import org.springframework.cache.annotation.Cacheable; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +import java.time.Duration; + +/** + * spring-cache 演示案例 + * + * @author Lion Li + */ +// 类级别 缓存统一配置 +//@CacheConfig(cacheNames = CacheNames.DEMO_CACHE) +@RequiredArgsConstructor +@RestController +@RequestMapping("/demo/cache") +public class RedisCacheController { + + /** + * 测试 @Cacheable + *

+ * 表示这个方法有了缓存的功能,方法的返回值会被缓存下来 + * 下一次调用该方法前,会去检查是否缓存中已经有值 + * 如果有就直接返回,不调用方法 + * 如果没有,就调用方法,然后把结果缓存起来 + * 这个注解「一般用在查询方法上」 + *

+ * 重点说明: 缓存注解严禁与其他筛选数据功能一起使用 + * 例如: 数据权限注解 会造成 缓存击穿 与 数据不一致问题 + *

+ * cacheNames 命名规则 查看 {@link CacheNames} 注释 支持多参数 + */ + @Cacheable(cacheNames = "demo:cache#60s#10m#20", key = "#key", condition = "#key != null") + @GetMapping("/test1") + public R test1(String key, String value) { + return R.ok("操作成功", value); + } + + /** + * 测试 @CachePut + *

+ * 加了@CachePut注解的方法,会把方法的返回值put到缓存里面缓存起来,供其它地方使用 + * 它「通常用在新增或者实时更新方法上」 + *

+ * cacheNames 命名规则 查看 {@link CacheNames} 注释 支持多参数 + */ + @CachePut(cacheNames = CacheNames.DEMO_CACHE, key = "#key", condition = "#key != null") + @GetMapping("/test2") + public R test2(String key, String value) { + return R.ok("操作成功", value); + } + + /** + * 测试 @CacheEvict + *

+ * 使用了CacheEvict注解的方法,会清空指定缓存 + * 「一般用在删除的方法上」 + *

+ * cacheNames 命名规则 查看 {@link CacheNames} 注释 支持多参数 + */ + @CacheEvict(cacheNames = CacheNames.DEMO_CACHE, key = "#key", condition = "#key != null") + @GetMapping("/test3") + public R test3(String key, String value) { + return R.ok("操作成功", value); + } + + /** + * 测试设置过期时间 + * 手动设置过期时间10秒 + * 11秒后获取 判断是否相等 + */ + @GetMapping("/test6") + public R test6(String key, String value) { + RedisUtils.setCacheObject(key, value); + boolean flag = RedisUtils.expire(key, Duration.ofSeconds(10)); + System.out.println("***********" + flag); + try { + Thread.sleep(11 * 1000); + } catch (InterruptedException e) { + e.printStackTrace(); + } + Object obj = RedisUtils.getCacheObject(key); + return R.ok(value.equals(obj)); + } + +} diff --git a/ruoyi-modules/ruoyi-demo/src/main/java/com/ruoyi/demo/controller/RedisLockController.java b/ruoyi-modules/ruoyi-demo/src/main/java/com/ruoyi/demo/controller/RedisLockController.java new file mode 100644 index 0000000..ebc923d --- /dev/null +++ b/ruoyi-modules/ruoyi-demo/src/main/java/com/ruoyi/demo/controller/RedisLockController.java @@ -0,0 +1,71 @@ +package com.ruoyi.demo.controller; + +import com.baomidou.lock.LockInfo; +import com.baomidou.lock.LockTemplate; +import com.baomidou.lock.annotation.Lock4j; +import com.baomidou.lock.executor.RedissonLockExecutor; +import com.ruoyi.common.core.domain.R; +import lombok.extern.slf4j.Slf4j; +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.time.LocalTime; + + +/** + * 测试分布式锁的样例 + * + * @author shenxinquan + */ +@Slf4j +@RestController +@RequestMapping("/demo/redisLock") +public class RedisLockController { + + @Autowired + private LockTemplate lockTemplate; + + /** + * 测试lock4j 注解 + */ + @Lock4j(keys = {"#key"}) + @GetMapping("/testLock4j") + public R testLock4j(String key, String value) { + System.out.println("start:" + key + ",time:" + LocalTime.now().toString()); + try { + Thread.sleep(10000); + } catch (InterruptedException e) { + e.printStackTrace(); + } + System.out.println("end :" + key + ",time:" + LocalTime.now().toString()); + return R.ok("操作成功", value); + } + + /** + * 测试lock4j 工具 + */ + @GetMapping("/testLock4jLockTemplate") + public R testLock4jLockTemplate(String key, String value) { + final LockInfo lockInfo = lockTemplate.lock(key, 30000L, 5000L, RedissonLockExecutor.class); + if (null == lockInfo) { + throw new RuntimeException("业务处理中,请稍后再试"); + } + // 获取锁成功,处理业务 + try { + try { + Thread.sleep(8000); + } catch (InterruptedException e) { + // + } + System.out.println("执行简单方法1 , 当前线程:" + Thread.currentThread().getName()); + } finally { + //释放锁 + lockTemplate.releaseLock(lockInfo); + } + //结束 + return R.ok("操作成功", value); + } + +} diff --git a/ruoyi-modules/ruoyi-demo/src/main/java/com/ruoyi/demo/controller/RedisPubSubController.java b/ruoyi-modules/ruoyi-demo/src/main/java/com/ruoyi/demo/controller/RedisPubSubController.java new file mode 100644 index 0000000..6ad80ce --- /dev/null +++ b/ruoyi-modules/ruoyi-demo/src/main/java/com/ruoyi/demo/controller/RedisPubSubController.java @@ -0,0 +1,47 @@ +package com.ruoyi.demo.controller; + +import com.ruoyi.common.core.domain.R; +import com.ruoyi.common.redis.utils.RedisUtils; +import lombok.RequiredArgsConstructor; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +/** + * Redis 发布订阅 演示案例 + * + * @author Lion Li + */ +@RequiredArgsConstructor +@RestController +@RequestMapping("/demo/redis/pubsub") +public class RedisPubSubController { + + /** + * 发布消息 + * + * @param key 通道Key + * @param value 发送内容 + */ + @GetMapping("/pub") + public R pub(String key, String value) { + RedisUtils.publish(key, value, consumer -> { + System.out.println("发布通道 => " + key + ", 发送值 => " + value); + }); + return R.ok("操作成功"); + } + + /** + * 订阅消息 + * + * @param key 通道Key + */ + @GetMapping("/sub") + public R sub(String key) { + RedisUtils.subscribe(key, String.class, msg -> { + System.out.println("订阅通道 => " + key + ", 接收值 => " + msg); + }); + return R.ok("操作成功"); + } + +} diff --git a/ruoyi-modules/ruoyi-demo/src/main/java/com/ruoyi/demo/controller/RedisRateLimiterController.java b/ruoyi-modules/ruoyi-demo/src/main/java/com/ruoyi/demo/controller/RedisRateLimiterController.java new file mode 100644 index 0000000..98faee6 --- /dev/null +++ b/ruoyi-modules/ruoyi-demo/src/main/java/com/ruoyi/demo/controller/RedisRateLimiterController.java @@ -0,0 +1,64 @@ +package com.ruoyi.demo.controller; + +import com.ruoyi.common.core.domain.R; +import com.ruoyi.common.ratelimiter.annotation.RateLimiter; +import com.ruoyi.common.ratelimiter.enums.LimitType; +import lombok.extern.slf4j.Slf4j; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + + +/** + * 测试分布式限流样例 + * + * @author Lion Li + */ +@Slf4j +@RestController +@RequestMapping("/demo/rateLimiter") +public class RedisRateLimiterController { + + /** + * 测试全局限流 + * 全局影响 + */ + @RateLimiter(count = 2, time = 10) + @GetMapping("/test") + public R test(String value) { + return R.ok("操作成功", value); + } + + /** + * 测试请求IP限流 + * 同一IP请求受影响 + */ + @RateLimiter(count = 2, time = 10, limitType = LimitType.IP) + @GetMapping("/testip") + public R testip(String value) { + return R.ok("操作成功", value); + } + + /** + * 测试集群实例限流 + * 启动两个后端服务互不影响 + */ + @RateLimiter(count = 2, time = 10, limitType = LimitType.CLUSTER) + @GetMapping("/testcluster") + public R testcluster(String value) { + return R.ok("操作成功", value); + } + + /** + * 测试请求IP限流(key基于参数获取) + * 同一IP请求受影响 + * + * 简单变量获取 #变量 复杂表达式 #{#变量 != 1 ? 1 : 0} + */ + @RateLimiter(count = 2, time = 10, limitType = LimitType.IP, key = "#value") + @GetMapping("/testObj") + public R testObj(String value) { + return R.ok("操作成功", value); + } + +} diff --git a/ruoyi-modules/ruoyi-demo/src/main/java/com/ruoyi/demo/controller/SmsController.java b/ruoyi-modules/ruoyi-demo/src/main/java/com/ruoyi/demo/controller/SmsController.java new file mode 100644 index 0000000..8965a2d --- /dev/null +++ b/ruoyi-modules/ruoyi-demo/src/main/java/com/ruoyi/demo/controller/SmsController.java @@ -0,0 +1,60 @@ +package com.ruoyi.demo.controller; + +import com.ruoyi.common.core.domain.R; +import lombok.RequiredArgsConstructor; +import org.dromara.sms4j.api.SmsBlend; +import org.dromara.sms4j.api.entity.SmsResponse; +import org.dromara.sms4j.core.factory.SmsFactory; +import org.dromara.sms4j.provider.enumerate.SupplierType; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +import java.util.LinkedHashMap; + +/** + * 短信演示案例 + * 请先阅读文档 否则无法使用 + * + * @author Lion Li + * @version 4.2.0 + */ +@Validated +@RequiredArgsConstructor +@RestController +@RequestMapping("/demo/sms") +public class SmsController { + + /** + * 发送短信Aliyun + * + * @param phones 电话号 + * @param templateId 模板ID + */ + @GetMapping("/sendAliyun") + public R sendAliyun(String phones, String templateId) { + LinkedHashMap map = new LinkedHashMap<>(1); + map.put("code", "1234"); + SmsBlend smsBlend = SmsFactory.createSmsBlend(SupplierType.ALIBABA); + SmsResponse smsResponse = smsBlend.sendMessage(phones, templateId, map); + return R.ok(smsResponse); + } + + /** + * 发送短信Tencent + * + * @param phones 电话号 + * @param templateId 模板ID + */ + @GetMapping("/sendTencent") + public R sendTencent(String phones, String templateId) { + LinkedHashMap map = new LinkedHashMap<>(1); +// map.put("2", "测试测试"); + map.put("1", "1234"); + SmsBlend smsBlend = SmsFactory.createSmsBlend(SupplierType.TENCENT); + SmsResponse smsResponse = smsBlend.sendMessage(phones, templateId, map); + return R.ok(smsResponse); + } + +} diff --git a/ruoyi-modules/ruoyi-demo/src/main/java/com/ruoyi/demo/controller/Swagger3DemoController.java b/ruoyi-modules/ruoyi-demo/src/main/java/com/ruoyi/demo/controller/Swagger3DemoController.java new file mode 100644 index 0000000..0398b14 --- /dev/null +++ b/ruoyi-modules/ruoyi-demo/src/main/java/com/ruoyi/demo/controller/Swagger3DemoController.java @@ -0,0 +1,31 @@ +package com.ruoyi.demo.controller; + +import com.ruoyi.common.core.domain.R; +import org.springframework.http.MediaType; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestPart; +import org.springframework.web.bind.annotation.RestController; +import org.springframework.web.multipart.MultipartFile; + +/** + * swagger3 用法示例 + * + * @author Lion Li + */ +@RestController +@RequestMapping("/swagger/demo") +public class Swagger3DemoController { + + /** + * 上传请求 + * 必须使用 @RequestPart 注解标注为文件 + * + * @param file 文件 + */ + @PostMapping(value = "/upload", consumes = MediaType.MULTIPART_FORM_DATA_VALUE) + public R upload(@RequestPart("file") MultipartFile file) { + return R.ok("操作成功", file.getOriginalFilename()); + } + +} diff --git a/ruoyi-modules/ruoyi-demo/src/main/java/com/ruoyi/demo/controller/TestBatchController.java b/ruoyi-modules/ruoyi-demo/src/main/java/com/ruoyi/demo/controller/TestBatchController.java new file mode 100644 index 0000000..d0cb57d --- /dev/null +++ b/ruoyi-modules/ruoyi-demo/src/main/java/com/ruoyi/demo/controller/TestBatchController.java @@ -0,0 +1,90 @@ +package com.ruoyi.demo.controller; + +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.ruoyi.common.core.domain.R; +import com.ruoyi.common.web.core.BaseController; +import com.ruoyi.demo.domain.entity.TestDemo; +import com.ruoyi.demo.mapper.TestDemoMapper; +import lombok.RequiredArgsConstructor; +import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +import java.util.ArrayList; +import java.util.List; + +/** + * 测试批量方法 + * + * @author Lion Li + * @date 2021-05-30 + */ +@RequiredArgsConstructor +@RestController +@RequestMapping("/demo/batch") +public class TestBatchController extends BaseController { + + /** + * 为了便于测试 直接引入mapper + */ + private final TestDemoMapper testDemoMapper; + + /** + * 新增批量方法 可完美替代 saveBatch 秒级插入上万数据 (对mysql负荷较大) + *

+ * 3.5.0 版本 增加 rewriteBatchedStatements=true 批处理参数 使 MP 原生批处理可以达到同样的速度 + */ + @PostMapping("/add") +// @DS("slave") + public R add() { + List list = new ArrayList<>(); + for (int i = 0; i < 1000; i++) { + TestDemo testDemo = new TestDemo(); + testDemo.setOrderNum(-1); + testDemo.setTestKey("批量新增"); + testDemo.setValue("测试新增"); + list.add(testDemo); + } + return toAjax(testDemoMapper.insertBatch(list)); + } + + /** + * 新增或更新 可完美替代 saveOrUpdateBatch 高性能 + *

+ * 3.5.0 版本 增加 rewriteBatchedStatements=true 批处理参数 使 MP 原生批处理可以达到同样的速度 + */ + @PostMapping("/addOrUpdate") +// @DS("slave") + public R addOrUpdate() { + List list = new ArrayList<>(); + for (int i = 0; i < 1000; i++) { + TestDemo testDemo = new TestDemo(); + testDemo.setOrderNum(-1); + testDemo.setTestKey("批量新增"); + testDemo.setValue("测试新增"); + list.add(testDemo); + } + testDemoMapper.insertBatch(list); + for (int i = 0; i < list.size(); i++) { + TestDemo testDemo = list.get(i); + testDemo.setTestKey("批量新增或修改"); + testDemo.setValue("批量新增或修改"); + if (i % 2 == 0) { + testDemo.setId(null); + } + } + return toAjax(testDemoMapper.insertOrUpdateBatch(list)); + } + + /** + * 删除批量方法 + */ + @DeleteMapping() +// @DS("slave") + public R remove() { + return toAjax(testDemoMapper.delete(new LambdaQueryWrapper() + .eq(TestDemo::getOrderNum, -1L))); + } + +} diff --git a/ruoyi-modules/ruoyi-demo/src/main/java/com/ruoyi/demo/controller/TestDemoController.java b/ruoyi-modules/ruoyi-demo/src/main/java/com/ruoyi/demo/controller/TestDemoController.java new file mode 100644 index 0000000..63ed708 --- /dev/null +++ b/ruoyi-modules/ruoyi-demo/src/main/java/com/ruoyi/demo/controller/TestDemoController.java @@ -0,0 +1,148 @@ +package com.ruoyi.demo.controller; + +import cn.dev33.satoken.annotation.SaCheckPermission; +import com.rouyi.common.mybatis.core.page.PageQuery; +import com.rouyi.common.mybatis.core.page.TableDataInfo; +import com.ruoyi.common.core.domain.R; +import com.ruoyi.common.core.utils.MapstructUtils; +import com.ruoyi.common.core.utils.ValidatorUtils; +import com.ruoyi.common.core.validate.AddGroup; +import com.ruoyi.common.core.validate.EditGroup; +import com.ruoyi.common.core.validate.QueryGroup; +import com.ruoyi.common.excel.core.ExcelResult; +import com.ruoyi.common.excel.utils.ExcelUtil; +import com.ruoyi.common.idempotent.annotation.RepeatSubmit; +import com.ruoyi.common.log.annotation.Log; +import com.ruoyi.common.log.enums.BusinessType; +import com.ruoyi.common.web.core.BaseController; +import com.ruoyi.demo.domain.entity.TestDemo; +import com.ruoyi.demo.domain.bo.TestDemoBo; +import com.ruoyi.demo.domain.bo.TestDemoImportVo; +import com.ruoyi.demo.domain.vo.TestDemoVo; +import com.ruoyi.demo.service.ITestDemoService; +import jakarta.servlet.http.HttpServletResponse; +import jakarta.validation.constraints.NotEmpty; +import jakarta.validation.constraints.NotNull; +import lombok.RequiredArgsConstructor; +import org.springframework.http.MediaType; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.*; +import org.springframework.web.multipart.MultipartFile; + +import java.util.Arrays; +import java.util.List; +import java.util.concurrent.TimeUnit; + +/** + * 测试单表Controller + * + * @author Lion Li + * @date 2021-07-26 + */ +@Validated +@RequiredArgsConstructor +@RestController +@RequestMapping("/demo/demo") +public class TestDemoController extends BaseController { + + private final ITestDemoService iTestDemoService; + + /** + * 查询测试单表列表 + */ + @SaCheckPermission("demo:demo:list") + @GetMapping("/list") + public TableDataInfo list(@Validated(QueryGroup.class) TestDemoBo bo, PageQuery pageQuery) { + return iTestDemoService.queryPageList(bo, pageQuery); + } + + /** + * 自定义分页查询 + */ + @SaCheckPermission("demo:demo:list") + @GetMapping("/page") + public TableDataInfo page(@Validated(QueryGroup.class) TestDemoBo bo, PageQuery pageQuery) { + return iTestDemoService.customPageList(bo, pageQuery); + } + + /** + * 导入数据 + * + * @param file 导入文件 + */ + @Log(title = "测试单表", businessType = BusinessType.IMPORT) + @SaCheckPermission("demo:demo:import") + @PostMapping(value = "/importData", consumes = MediaType.MULTIPART_FORM_DATA_VALUE) + public R importData(@RequestPart("file") MultipartFile file) throws Exception { + ExcelResult excelResult = ExcelUtil.importExcel(file.getInputStream(), TestDemoImportVo.class, true); + List volist = excelResult.getList(); + List list = MapstructUtils.convert(volist, TestDemo.class); + iTestDemoService.saveBatch(list); + return R.ok(excelResult.getAnalysis()); + } + + /** + * 导出测试单表列表 + */ + @SaCheckPermission("demo:demo:export") + @Log(title = "测试单表", businessType = BusinessType.EXPORT) + @PostMapping("/export") + public void export(@Validated TestDemoBo bo, HttpServletResponse response) { + List list = iTestDemoService.queryList(bo); + // 测试雪花id导出 +// for (TestDemoVo vo : list) { +// vo.setId(1234567891234567893L); +// } + ExcelUtil.exportExcel(list, "测试单表", TestDemoVo.class, response); + } + + /** + * 获取测试单表详细信息 + * + * @param id 测试ID + */ + @SaCheckPermission("demo:demo:query") + @GetMapping("/{id}") + public R getInfo(@NotNull(message = "主键不能为空") + @PathVariable("id") Long id) { + return R.ok(iTestDemoService.queryById(id)); + } + + /** + * 新增测试单表 + */ + @SaCheckPermission("demo:demo:add") + @Log(title = "测试单表", businessType = BusinessType.INSERT) + @RepeatSubmit(interval = 2, timeUnit = TimeUnit.SECONDS, message = "{repeat.submit.message}") + @PostMapping() + public R add(@RequestBody TestDemoBo bo) { + // 使用校验工具对标 @Validated(AddGroup.class) 注解 + // 用于在非 Controller 的地方校验对象 + ValidatorUtils.validate(bo, AddGroup.class); + return toAjax(iTestDemoService.insertByBo(bo)); + } + + /** + * 修改测试单表 + */ + @SaCheckPermission("demo:demo:edit") + @Log(title = "测试单表", businessType = BusinessType.UPDATE) + @RepeatSubmit + @PutMapping() + public R edit(@Validated(EditGroup.class) @RequestBody TestDemoBo bo) { + return toAjax(iTestDemoService.updateByBo(bo)); + } + + /** + * 删除测试单表 + * + * @param ids 测试ID串 + */ + @SaCheckPermission("demo:demo:remove") + @Log(title = "测试单表", businessType = BusinessType.DELETE) + @DeleteMapping("/{ids}") + public R remove(@NotEmpty(message = "主键不能为空") + @PathVariable Long[] ids) { + return toAjax(iTestDemoService.deleteWithValidByIds(Arrays.asList(ids), true)); + } +} diff --git a/ruoyi-modules/ruoyi-demo/src/main/java/com/ruoyi/demo/controller/TestEncryptController.java b/ruoyi-modules/ruoyi-demo/src/main/java/com/ruoyi/demo/controller/TestEncryptController.java new file mode 100644 index 0000000..2648e09 --- /dev/null +++ b/ruoyi-modules/ruoyi-demo/src/main/java/com/ruoyi/demo/controller/TestEncryptController.java @@ -0,0 +1,55 @@ +package com.ruoyi.demo.controller; + +import com.ruoyi.common.core.domain.R; +import com.ruoyi.demo.domain.entity.TestDemoEncrypt; +import com.ruoyi.demo.mapper.TestDemoEncryptMapper; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +import java.util.HashMap; +import java.util.Map; + + +/** + * 测试数据库加解密功能 + * + * @author Lion Li + */ +@Validated +@RestController +@RequestMapping("/demo/encrypt") +public class TestEncryptController { + + @Autowired + private TestDemoEncryptMapper mapper; + @Value("${mybatis-encryptor.enable}") + private Boolean encryptEnable; + + /** + * 测试数据库加解密 + * + * @param key 测试key + * @param value 测试value + */ + @GetMapping() + public R> test(String key, String value) { + if (!encryptEnable) { + throw new RuntimeException("加密功能未开启!"); + } + Map map = new HashMap<>(2); + TestDemoEncrypt demo = new TestDemoEncrypt(); + demo.setTestKey(key); + demo.setValue(value); + mapper.insert(demo); + map.put("加密", demo); + TestDemoEncrypt testDemo = mapper.selectById(demo.getId()); + map.put("解密", testDemo); + return R.ok(map); + } + + +} diff --git a/ruoyi-modules/ruoyi-demo/src/main/java/com/ruoyi/demo/controller/TestExcelController.java b/ruoyi-modules/ruoyi-demo/src/main/java/com/ruoyi/demo/controller/TestExcelController.java new file mode 100644 index 0000000..407bb54 --- /dev/null +++ b/ruoyi-modules/ruoyi-demo/src/main/java/com/ruoyi/demo/controller/TestExcelController.java @@ -0,0 +1,125 @@ +package com.ruoyi.demo.controller; + +import cn.hutool.core.collection.CollUtil; +import com.ruoyi.common.excel.core.ExcelResult; +import com.ruoyi.common.excel.utils.ExcelUtil; +import com.ruoyi.demo.domain.vo.ExportDemoVo; +import com.ruoyi.demo.listener.ExportDemoListener; +import com.ruoyi.demo.service.IExportExcelService; +import jakarta.servlet.http.HttpServletResponse; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.RequiredArgsConstructor; +import org.springframework.http.MediaType; +import org.springframework.web.bind.annotation.*; +import org.springframework.web.multipart.MultipartFile; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +/** + * 测试Excel功能 + * + * @author Lion Li + */ +@RestController +@RequiredArgsConstructor +@RequestMapping("/demo/excel") +public class TestExcelController { + + private final IExportExcelService exportExcelService; + + /** + * 单列表多数据 + */ + @GetMapping("/exportTemplateOne") + public void exportTemplateOne(HttpServletResponse response) { + Map map = new HashMap<>(); + map.put("title", "单列表多数据"); + map.put("test1", "数据测试1"); + map.put("test2", "数据测试2"); + map.put("test3", "数据测试3"); + map.put("test4", "数据测试4"); + map.put("testTest", "666"); + List list = new ArrayList<>(); + list.add(new TestObj("单列表测试1", "列表测试1", "列表测试2", "列表测试3", "列表测试4")); + list.add(new TestObj("单列表测试2", "列表测试5", "列表测试6", "列表测试7", "列表测试8")); + list.add(new TestObj("单列表测试3", "列表测试9", "列表测试10", "列表测试11", "列表测试12")); + ExcelUtil.exportTemplate(CollUtil.newArrayList(map, list), "单列表.xlsx", "excel/单列表.xlsx", response); + } + + /** + * 多列表多数据 + */ + @GetMapping("/exportTemplateMuliti") + public void exportTemplateMuliti(HttpServletResponse response) { + Map map = new HashMap<>(); + map.put("title1", "标题1"); + map.put("title2", "标题2"); + map.put("title3", "标题3"); + map.put("title4", "标题4"); + map.put("author", "Lion Li"); + List list1 = new ArrayList<>(); + list1.add(new TestObj1("list1测试1", "list1测试2", "list1测试3")); + list1.add(new TestObj1("list1测试4", "list1测试5", "list1测试6")); + list1.add(new TestObj1("list1测试7", "list1测试8", "list1测试9")); + List list2 = new ArrayList<>(); + list2.add(new TestObj1("list2测试1", "list2测试2", "list2测试3")); + list2.add(new TestObj1("list2测试4", "list2测试5", "list2测试6")); + List list3 = new ArrayList<>(); + list3.add(new TestObj1("list3测试1", "list3测试2", "list3测试3")); + List list4 = new ArrayList<>(); + list4.add(new TestObj1("list4测试1", "list4测试2", "list4测试3")); + list4.add(new TestObj1("list4测试4", "list4测试5", "list4测试6")); + list4.add(new TestObj1("list4测试7", "list4测试8", "list4测试9")); + list4.add(new TestObj1("list4测试10", "list4测试11", "list4测试12")); + Map multiListMap = new HashMap<>(); + multiListMap.put("map", map); + multiListMap.put("data1", list1); + multiListMap.put("data2", list2); + multiListMap.put("data3", list3); + multiListMap.put("data4", list4); + ExcelUtil.exportTemplateMultiList(multiListMap, "多列表.xlsx", "excel/多列表.xlsx", response); + } + + /** + * 导出下拉框 + * + * @param response / + */ + @GetMapping("/exportWithOptions") + public void exportWithOptions(HttpServletResponse response) { + exportExcelService.exportWithOptions(response); + } + + /** + * 导入表格 + */ + @PostMapping(value = "/importWithOptions", consumes = MediaType.MULTIPART_FORM_DATA_VALUE) + public List importWithOptions(@RequestPart("file") MultipartFile file) throws Exception { + // 处理解析结果 + ExcelResult excelResult = ExcelUtil.importExcel(file.getInputStream(), ExportDemoVo.class, new ExportDemoListener()); + return excelResult.getList(); + } + + @Data + @AllArgsConstructor + static class TestObj1 { + private String test1; + private String test2; + private String test3; + } + + @Data + @AllArgsConstructor + static class TestObj { + private String name; + private String list1; + private String list2; + private String list3; + private String list4; + } + +} diff --git a/ruoyi-modules/ruoyi-demo/src/main/java/com/ruoyi/demo/controller/TestI18nController.java b/ruoyi-modules/ruoyi-demo/src/main/java/com/ruoyi/demo/controller/TestI18nController.java new file mode 100644 index 0000000..5cc6a2e --- /dev/null +++ b/ruoyi-modules/ruoyi-demo/src/main/java/com/ruoyi/demo/controller/TestI18nController.java @@ -0,0 +1,71 @@ +package com.ruoyi.demo.controller; + +import com.ruoyi.common.core.domain.R; +import com.ruoyi.common.core.utils.MessageUtils; +import lombok.Data; +import org.hibernate.validator.constraints.Range; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +import jakarta.validation.constraints.NotBlank; +import jakarta.validation.constraints.NotNull; + + +/** + * 测试国际化 + * + * @author Lion Li + */ +@Validated +@RestController +@RequestMapping("/demo/i18n") +public class TestI18nController { + + /** + * 通过code获取国际化内容 + * code为 messages.properties 中的 key + *

+ * 测试使用 user.register.success + * + * @param code 国际化code + */ + @GetMapping() + public R get(String code) { + return R.ok(MessageUtils.message(code)); + } + + /** + * Validator 校验国际化 + * 不传值 分别查看异常返回 + *

+ * 测试使用 not.null + */ + @GetMapping("/test1") + public R test1(@NotBlank(message = "{not.null}") String str) { + return R.ok(str); + } + + /** + * Bean 校验国际化 + * 不传值 分别查看异常返回 + *

+ * 测试使用 not.null + */ + @GetMapping("/test2") + public R test2(@Validated TestI18nBo bo) { + return R.ok(bo); + } + + @Data + public static class TestI18nBo { + + @NotBlank(message = "{not.null}") + private String name; + + @NotNull(message = "{not.null}") + @Range(min = 0, max = 100, message = "{length.not.valid}") + private Integer age; + } +} diff --git a/ruoyi-modules/ruoyi-demo/src/main/java/com/ruoyi/demo/controller/TestSensitiveController.java b/ruoyi-modules/ruoyi-demo/src/main/java/com/ruoyi/demo/controller/TestSensitiveController.java new file mode 100644 index 0000000..b9a9b01 --- /dev/null +++ b/ruoyi-modules/ruoyi-demo/src/main/java/com/ruoyi/demo/controller/TestSensitiveController.java @@ -0,0 +1,76 @@ +package com.ruoyi.demo.controller; + +import com.ruoyi.common.core.domain.R; +import com.ruoyi.common.sensitive.annotation.Sensitive; +import com.ruoyi.common.sensitive.core.SensitiveService; +import com.ruoyi.common.sensitive.core.SensitiveStrategy; +import com.ruoyi.common.web.core.BaseController; +import lombok.Data; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +/** + * 测试数据脱敏控制器 + *

+ * 默认管理员不过滤 + * 需自行根据业务重写实现 + * + * @author Lion Li + * @version 3.6.0 + * @see SensitiveService + */ +@RestController +@RequestMapping("/demo/sensitive") +public class TestSensitiveController extends BaseController { + + /** + * 测试数据脱敏 + */ + @GetMapping("/test") + public R test() { + TestSensitive testSensitive = new TestSensitive(); + testSensitive.setIdCard("210397198608215431"); + testSensitive.setPhone("17640125371"); + testSensitive.setAddress("北京市朝阳区某某四合院1203室"); + testSensitive.setEmail("17640125371@163.com"); + testSensitive.setBankCard("6226456952351452853"); + return R.ok(testSensitive); + } + + @Data + static class TestSensitive { + + /** + * 身份证 + */ + @Sensitive(strategy = SensitiveStrategy.ID_CARD) + private String idCard; + + /** + * 电话 + */ + @Sensitive(strategy = SensitiveStrategy.PHONE) + private String phone; + + /** + * 地址 + */ + @Sensitive(strategy = SensitiveStrategy.ADDRESS) + private String address; + + /** + * 邮箱 + */ + @Sensitive(strategy = SensitiveStrategy.EMAIL) + private String email; + + /** + * 银行卡 + */ + @Sensitive(strategy = SensitiveStrategy.BANK_CARD) + private String bankCard; + + } + +} diff --git a/ruoyi-modules/ruoyi-demo/src/main/java/com/ruoyi/demo/controller/TestTreeController.java b/ruoyi-modules/ruoyi-demo/src/main/java/com/ruoyi/demo/controller/TestTreeController.java new file mode 100644 index 0000000..d931a8a --- /dev/null +++ b/ruoyi-modules/ruoyi-demo/src/main/java/com/ruoyi/demo/controller/TestTreeController.java @@ -0,0 +1,107 @@ +package com.ruoyi.demo.controller; + +import cn.dev33.satoken.annotation.SaCheckPermission; +import com.ruoyi.common.core.domain.R; +import com.ruoyi.common.core.validate.AddGroup; +import com.ruoyi.common.core.validate.EditGroup; +import com.ruoyi.common.core.validate.QueryGroup; +import com.ruoyi.common.excel.utils.ExcelUtil; +import com.ruoyi.common.idempotent.annotation.RepeatSubmit; +import com.ruoyi.common.log.annotation.Log; +import com.ruoyi.common.log.enums.BusinessType; +import com.ruoyi.common.web.core.BaseController; +import com.ruoyi.demo.domain.bo.TestTreeBo; +import com.ruoyi.demo.domain.vo.TestTreeVo; +import com.ruoyi.demo.service.ITestTreeService; +import jakarta.servlet.http.HttpServletResponse; +import jakarta.validation.constraints.NotEmpty; +import jakarta.validation.constraints.NotNull; +import lombok.RequiredArgsConstructor; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.*; + +import java.util.Arrays; +import java.util.List; + +/** + * 测试树表Controller + * + * @author Lion Li + * @date 2021-07-26 + */ +@Validated +@RequiredArgsConstructor +@RestController +@RequestMapping("/demo/tree") +public class TestTreeController extends BaseController { + + private final ITestTreeService iTestTreeService; + + /** + * 查询测试树表列表 + */ + @SaCheckPermission("demo:tree:list") + @GetMapping("/list") + public R> list(@Validated(QueryGroup.class) TestTreeBo bo) { + List list = iTestTreeService.queryList(bo); + return R.ok(list); + } + + /** + * 导出测试树表列表 + */ + @SaCheckPermission("demo:tree:export") + @Log(title = "测试树表", businessType = BusinessType.EXPORT) + @GetMapping("/export") + public void export(@Validated TestTreeBo bo, HttpServletResponse response) { + List list = iTestTreeService.queryList(bo); + ExcelUtil.exportExcel(list, "测试树表", TestTreeVo.class, response); + } + + /** + * 获取测试树表详细信息 + * + * @param id 测试树ID + */ + @SaCheckPermission("demo:tree:query") + @GetMapping("/{id}") + public R getInfo(@NotNull(message = "主键不能为空") + @PathVariable("id") Long id) { + return R.ok(iTestTreeService.queryById(id)); + } + + /** + * 新增测试树表 + */ + @SaCheckPermission("demo:tree:add") + @Log(title = "测试树表", businessType = BusinessType.INSERT) + @RepeatSubmit + @PostMapping() + public R add(@Validated(AddGroup.class) @RequestBody TestTreeBo bo) { + return toAjax(iTestTreeService.insertByBo(bo)); + } + + /** + * 修改测试树表 + */ + @SaCheckPermission("demo:tree:edit") + @Log(title = "测试树表", businessType = BusinessType.UPDATE) + @RepeatSubmit + @PutMapping() + public R edit(@Validated(EditGroup.class) @RequestBody TestTreeBo bo) { + return toAjax(iTestTreeService.updateByBo(bo)); + } + + /** + * 删除测试树表 + * + * @param ids 测试树ID串 + */ + @SaCheckPermission("demo:tree:remove") + @Log(title = "测试树表", businessType = BusinessType.DELETE) + @DeleteMapping("/{ids}") + public R remove(@NotEmpty(message = "主键不能为空") + @PathVariable Long[] ids) { + return toAjax(iTestTreeService.deleteWithValidByIds(Arrays.asList(ids), true)); + } +} diff --git a/ruoyi-modules/ruoyi-demo/src/main/java/com/ruoyi/demo/controller/package-info.java b/ruoyi-modules/ruoyi-demo/src/main/java/com/ruoyi/demo/controller/package-info.java new file mode 100644 index 0000000..4239668 --- /dev/null +++ b/ruoyi-modules/ruoyi-demo/src/main/java/com/ruoyi/demo/controller/package-info.java @@ -0,0 +1 @@ +package com.ruoyi.demo.controller; \ No newline at end of file diff --git a/ruoyi-modules/ruoyi-demo/src/main/java/com/ruoyi/demo/controller/queue/BoundedQueueController.java b/ruoyi-modules/ruoyi-demo/src/main/java/com/ruoyi/demo/controller/queue/BoundedQueueController.java new file mode 100644 index 0000000..f654e42 --- /dev/null +++ b/ruoyi-modules/ruoyi-demo/src/main/java/com/ruoyi/demo/controller/queue/BoundedQueueController.java @@ -0,0 +1,90 @@ +package com.ruoyi.demo.controller.queue; + +import com.ruoyi.common.core.domain.R; +import com.ruoyi.common.redis.utils.QueueUtils; +import lombok.RequiredArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +/** + * 有界队列 演示案例 + *

+ * 轻量级队列 重量级数据量 请使用 MQ + *

+ * 集群测试通过 同一个数据只会被消费一次 做好事务补偿 + * 集群测试流程 在其中一台发送数据 两端分别调用获取接口 一次获取一条 + * + * @author Lion Li + * @version 3.6.0 + */ +@Slf4j +@RequiredArgsConstructor +@RestController +@RequestMapping("/demo/queue/bounded") +public class BoundedQueueController { + + + /** + * 添加队列数据 + * + * @param queueName 队列名 + * @param capacity 容量 + */ + @GetMapping("/add") + public R add(String queueName, int capacity) { + // 用完了一定要销毁 否则会一直存在 + boolean b = QueueUtils.destroyBoundedQueue(queueName); + log.info("通道: {} , 删除: {}", queueName, b); + // 初始化设置一次即可 + if (QueueUtils.trySetBoundedQueueCapacity(queueName, capacity)) { + log.info("通道: {} , 设置容量: {}", queueName, capacity); + } else { + log.info("通道: {} , 设置容量失败", queueName); + return R.fail("操作失败"); + } + for (int i = 0; i < 11; i++) { + String data = "data-" + i; + boolean flag = QueueUtils.addBoundedQueueObject(queueName, data); + if (flag == false) { + log.info("通道: {} , 发送数据: {} 失败, 通道已满", queueName, data); + } else { + log.info("通道: {} , 发送数据: {}", queueName, data); + } + } + return R.ok("操作成功"); + } + + /** + * 删除队列数据 + * + * @param queueName 队列名 + */ + @GetMapping("/remove") + public R remove(String queueName) { + String data = "data-" + 5; + if (QueueUtils.removeBoundedQueueObject(queueName, data)) { + log.info("通道: {} , 删除数据: {}", queueName, data); + } else { + return R.fail("操作失败"); + } + return R.ok("操作成功"); + } + + /** + * 获取队列数据 + * + * @param queueName 队列名 + */ + @GetMapping("/get") + public R get(String queueName) { + String data; + do { + data = QueueUtils.getBoundedQueueObject(queueName); + log.info("通道: {} , 获取数据: {}", queueName, data); + } while (data != null); + return R.ok("操作成功"); + } + +} diff --git a/ruoyi-modules/ruoyi-demo/src/main/java/com/ruoyi/demo/controller/queue/DelayedQueueController.java b/ruoyi-modules/ruoyi-demo/src/main/java/com/ruoyi/demo/controller/queue/DelayedQueueController.java new file mode 100644 index 0000000..fd51065 --- /dev/null +++ b/ruoyi-modules/ruoyi-demo/src/main/java/com/ruoyi/demo/controller/queue/DelayedQueueController.java @@ -0,0 +1,90 @@ +package com.ruoyi.demo.controller.queue; + +import com.ruoyi.common.core.domain.R; +import com.ruoyi.common.redis.utils.QueueUtils; +import lombok.RequiredArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +import java.util.concurrent.TimeUnit; + +/** + * 延迟队列 演示案例 + *

+ * 轻量级队列 重量级数据量 请使用 MQ + * 例如: 创建订单30分钟后过期处理 + *

+ * 集群测试通过 同一个数据只会被消费一次 做好事务补偿 + * 集群测试流程 两台集群分别开启订阅 在其中一台发送数据 观察接收消息的规律 + * + * @author Lion Li + * @version 3.6.0 + */ +@Slf4j +@RequiredArgsConstructor +@RestController +@RequestMapping("/demo/queue/delayed") +public class DelayedQueueController { + + /** + * 订阅队列 + * + * @param queueName 队列名 + */ + @GetMapping("/subscribe") + public R subscribe(String queueName) { + log.info("通道: {} 监听中......", queueName); + // 项目初始化设置一次即可 + QueueUtils.subscribeBlockingQueue(queueName, (String orderNum) -> { + // 观察接收时间 + log.info("通道: {}, 收到数据: {}", queueName, orderNum); + }, true); + return R.ok("操作成功"); + } + + /** + * 添加队列数据 + * + * @param queueName 队列名 + * @param orderNum 订单号 + * @param time 延迟时间(秒) + */ + @GetMapping("/add") + public R add(String queueName, String orderNum, Long time) { + QueueUtils.addDelayedQueueObject(queueName, orderNum, time, TimeUnit.SECONDS); + // 观察发送时间 + log.info("通道: {} , 发送数据: {}", queueName, orderNum); + return R.ok("操作成功"); + } + + /** + * 删除队列数据 + * + * @param queueName 队列名 + * @param orderNum 订单号 + */ + @GetMapping("/remove") + public R remove(String queueName, String orderNum) { + if (QueueUtils.removeDelayedQueueObject(queueName, orderNum)) { + log.info("通道: {} , 删除数据: {}", queueName, orderNum); + } else { + return R.fail("操作失败"); + } + return R.ok("操作成功"); + } + + /** + * 销毁队列 + * + * @param queueName 队列名 + */ + @GetMapping("/destroy") + public R destroy(String queueName) { + // 用完了一定要销毁 否则会一直存在 + QueueUtils.destroyDelayedQueue(queueName); + return R.ok("操作成功"); + } + +} diff --git a/ruoyi-modules/ruoyi-demo/src/main/java/com/ruoyi/demo/controller/queue/PriorityDemo.java b/ruoyi-modules/ruoyi-demo/src/main/java/com/ruoyi/demo/controller/queue/PriorityDemo.java new file mode 100644 index 0000000..c86c92a --- /dev/null +++ b/ruoyi-modules/ruoyi-demo/src/main/java/com/ruoyi/demo/controller/queue/PriorityDemo.java @@ -0,0 +1,22 @@ +package com.ruoyi.demo.controller.queue; + +import lombok.Data; +import lombok.NoArgsConstructor; + +/** + * 实体类 注意不允许使用内部类 否则会找不到类 + * + * @author Lion Li + * @version 3.6.0 + */ +@Data +@NoArgsConstructor +public class PriorityDemo implements Comparable { + private String name; + private Integer orderNum; + + @Override + public int compareTo(PriorityDemo other) { + return Integer.compare(getOrderNum(), other.getOrderNum()); + } +} diff --git a/ruoyi-modules/ruoyi-demo/src/main/java/com/ruoyi/demo/controller/queue/PriorityQueueController.java b/ruoyi-modules/ruoyi-demo/src/main/java/com/ruoyi/demo/controller/queue/PriorityQueueController.java new file mode 100644 index 0000000..b44045f --- /dev/null +++ b/ruoyi-modules/ruoyi-demo/src/main/java/com/ruoyi/demo/controller/queue/PriorityQueueController.java @@ -0,0 +1,89 @@ +package com.ruoyi.demo.controller.queue; + +import cn.hutool.core.util.RandomUtil; +import com.ruoyi.common.core.domain.R; +import com.ruoyi.common.redis.utils.QueueUtils; +import lombok.RequiredArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +/** + * 优先队列 演示案例 + *

+ * 轻量级队列 重量级数据量 请使用 MQ + *

+ * 集群测试通过 同一个消息只会被消费一次 做好事务补偿 + * 集群测试流程 在其中一台发送数据 两端分别调用获取接口 一次获取一条 + * + * @author Lion Li + * @version 3.6.0 + */ +@Slf4j +@RequiredArgsConstructor +@RestController +@RequestMapping("/demo/queue/priority") +public class PriorityQueueController { + + /** + * 添加队列数据 + * + * @param queueName 队列名 + */ + @GetMapping("/add") + public R add(String queueName) { + // 用完了一定要销毁 否则会一直存在 + boolean b = QueueUtils.destroyPriorityQueue(queueName); + log.info("通道: {} , 删除: {}", queueName, b); + + for (int i = 0; i < 10; i++) { + int randomNum = RandomUtil.randomInt(10); + PriorityDemo data = new PriorityDemo(); + data.setName("data-" + i); + data.setOrderNum(randomNum); + if (QueueUtils.addPriorityQueueObject(queueName, data)) { + log.info("通道: {} , 发送数据: {}", queueName, data); + } else { + log.info("通道: {} , 发送数据: {}, 发送失败", queueName, data); + } + } + return R.ok("操作成功"); + } + + /** + * 删除队列数据 + * + * @param queueName 队列名 + * @param name 对象名 + * @param orderNum 排序号 + */ + @GetMapping("/remove") + public R remove(String queueName, String name, Integer orderNum) { + PriorityDemo data = new PriorityDemo(); + data.setName(name); + data.setOrderNum(orderNum); + if (QueueUtils.removePriorityQueueObject(queueName, data)) { + log.info("通道: {} , 删除数据: {}", queueName, data); + } else { + return R.fail("操作失败"); + } + return R.ok("操作成功"); + } + + /** + * 获取队列数据 + * + * @param queueName 队列名 + */ + @GetMapping("/get") + public R get(String queueName) { + PriorityDemo data; + do { + data = QueueUtils.getPriorityQueueObject(queueName); + log.info("通道: {} , 获取数据: {}", queueName, data); + } while (data != null); + return R.ok("操作成功"); + } + +} diff --git a/ruoyi-modules/ruoyi-demo/src/main/java/com/ruoyi/demo/domain/bo/TestDemoBo.java b/ruoyi-modules/ruoyi-demo/src/main/java/com/ruoyi/demo/domain/bo/TestDemoBo.java new file mode 100644 index 0000000..162f211 --- /dev/null +++ b/ruoyi-modules/ruoyi-demo/src/main/java/com/ruoyi/demo/domain/bo/TestDemoBo.java @@ -0,0 +1,62 @@ +package com.ruoyi.demo.domain.bo; + +import com.rouyi.common.mybatis.core.domain.BaseEntity; +import com.ruoyi.common.core.validate.AddGroup; +import com.ruoyi.common.core.validate.EditGroup; +import com.ruoyi.demo.domain.entity.TestDemo; +import io.github.linpeilie.annotations.AutoMapper; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import jakarta.validation.constraints.NotBlank; +import jakarta.validation.constraints.NotNull; + +/** + * 测试单表业务对象 test_demo + * + * @author Lion Li + * @date 2021-07-26 + */ + +@Data +@EqualsAndHashCode(callSuper = true) +@AutoMapper(target = TestDemo.class) +public class TestDemoBo extends BaseEntity { + + /** + * 主键 + */ + @NotNull(message = "主键不能为空", groups = {EditGroup.class}) + private Long id; + + /** + * 部门id + */ + @NotNull(message = "部门id不能为空", groups = {AddGroup.class, EditGroup.class}) + private Long deptId; + + /** + * 用户id + */ + @NotNull(message = "用户id不能为空", groups = {AddGroup.class, EditGroup.class}) + private Long userId; + + /** + * 排序号 + */ + @NotNull(message = "排序号不能为空", groups = {AddGroup.class, EditGroup.class}) + private Integer orderNum; + + /** + * key键 + */ + @NotBlank(message = "key键不能为空", groups = {AddGroup.class, EditGroup.class}) + private String testKey; + + /** + * 值 + */ + @NotBlank(message = "值不能为空", groups = {AddGroup.class, EditGroup.class}) + private String value; + +} diff --git a/ruoyi-modules/ruoyi-demo/src/main/java/com/ruoyi/demo/domain/bo/TestDemoImportVo.java b/ruoyi-modules/ruoyi-demo/src/main/java/com/ruoyi/demo/domain/bo/TestDemoImportVo.java new file mode 100644 index 0000000..26318e4 --- /dev/null +++ b/ruoyi-modules/ruoyi-demo/src/main/java/com/ruoyi/demo/domain/bo/TestDemoImportVo.java @@ -0,0 +1,53 @@ +package com.ruoyi.demo.domain.bo; + +import com.alibaba.excel.annotation.ExcelProperty; +import lombok.Data; + +import jakarta.validation.constraints.NotBlank; +import jakarta.validation.constraints.NotNull; + +/** + * 测试单表业务对象 test_demo + * + * @author Lion Li + * @date 2021-07-26 + */ +@Data +public class TestDemoImportVo { + + /** + * 部门id + */ + @NotNull(message = "部门id不能为空") + @ExcelProperty(value = "部门id") + private Long deptId; + + /** + * 用户id + */ + @NotNull(message = "用户id不能为空") + @ExcelProperty(value = "用户id") + private Long userId; + + /** + * 排序号 + */ + @NotNull(message = "排序号不能为空") + @ExcelProperty(value = "排序号") + private Long orderNum; + + /** + * key键 + */ + @NotBlank(message = "key键不能为空") + @ExcelProperty(value = "key键") + private String testKey; + + /** + * 值 + */ + @NotBlank(message = "值不能为空") + @ExcelProperty(value = "值") + private String value; + +} diff --git a/ruoyi-modules/ruoyi-demo/src/main/java/com/ruoyi/demo/domain/bo/TestTreeBo.java b/ruoyi-modules/ruoyi-demo/src/main/java/com/ruoyi/demo/domain/bo/TestTreeBo.java new file mode 100644 index 0000000..f198dd6 --- /dev/null +++ b/ruoyi-modules/ruoyi-demo/src/main/java/com/ruoyi/demo/domain/bo/TestTreeBo.java @@ -0,0 +1,54 @@ +package com.ruoyi.demo.domain.bo; + +import com.rouyi.common.mybatis.core.domain.BaseEntity; +import com.ruoyi.common.core.validate.AddGroup; +import com.ruoyi.common.core.validate.EditGroup; +import com.ruoyi.demo.domain.entity.TestTree; +import io.github.linpeilie.annotations.AutoMapper; +import jakarta.validation.constraints.NotBlank; +import jakarta.validation.constraints.NotNull; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * 测试树表业务对象 test_tree + * + * @author Lion Li + * @date 2021-07-26 + */ + +@Data +@EqualsAndHashCode(callSuper = true) +@AutoMapper(target = TestTree.class) +public class TestTreeBo extends BaseEntity { + + /** + * 主键 + */ + @NotNull(message = "主键不能为空", groups = {EditGroup.class}) + private Long id; + + /** + * 父ID + */ + private Long parentId; + + /** + * 部门id + */ + @NotNull(message = "部门id不能为空", groups = {AddGroup.class, EditGroup.class}) + private Long deptId; + + /** + * 用户id + */ + @NotNull(message = "用户id不能为空", groups = {AddGroup.class, EditGroup.class}) + private Long userId; + + /** + * 树节点名 + */ + @NotBlank(message = "树节点名不能为空", groups = {AddGroup.class, EditGroup.class}) + private String treeName; + +} diff --git a/ruoyi-modules/ruoyi-demo/src/main/java/com/ruoyi/demo/domain/entity/TestDemo.java b/ruoyi-modules/ruoyi-demo/src/main/java/com/ruoyi/demo/domain/entity/TestDemo.java new file mode 100644 index 0000000..b0d1037 --- /dev/null +++ b/ruoyi-modules/ruoyi-demo/src/main/java/com/ruoyi/demo/domain/entity/TestDemo.java @@ -0,0 +1,66 @@ +package com.ruoyi.demo.domain.entity; + +import com.baomidou.mybatisplus.annotation.*; +import com.rouyi.common.mybatis.core.domain.BaseEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * 测试单表对象 test_demo + * + * @author Lion Li + * @date 2021-07-26 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@TableName("test_demo") +public class TestDemo extends BaseEntity { + + private static final long serialVersionUID = 1L; + + + /** + * 主键 + */ + @TableId(value = "id") + private Long id; + + /** + * 部门id + */ + private Long deptId; + + /** + * 用户id + */ + private Long userId; + + /** + * 排序号 + */ + @OrderBy(asc = false, sort = 1) + private Integer orderNum; + + /** + * key键 + */ + private String testKey; + + /** + * 值 + */ + private String value; + + /** + * 版本 + */ + @Version + private Long version; + + /** + * 删除标志 + */ + @TableLogic + private Long delFlag; + +} diff --git a/ruoyi-modules/ruoyi-demo/src/main/java/com/ruoyi/demo/domain/entity/TestDemoEncrypt.java b/ruoyi-modules/ruoyi-demo/src/main/java/com/ruoyi/demo/domain/entity/TestDemoEncrypt.java new file mode 100644 index 0000000..d223b1a --- /dev/null +++ b/ruoyi-modules/ruoyi-demo/src/main/java/com/ruoyi/demo/domain/entity/TestDemoEncrypt.java @@ -0,0 +1,29 @@ +package com.ruoyi.demo.domain.entity; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.ruoyi.common.encrypt.annotation.EncryptField; +import com.ruoyi.common.encrypt.enumd.AlgorithmType; +import lombok.Data; +import lombok.EqualsAndHashCode; + +@Data +@EqualsAndHashCode(callSuper = true) +@TableName("test_demo") +public class TestDemoEncrypt extends TestDemo { + + /** + * key键 + */ + // @EncryptField(algorithm=AlgorithmType.SM2, privateKey = "MIGTAgEAMBMGByqGSM49AgEGCCqBHM9VAYItBHkwdwIBAQQgZSlOvw8FBiH+aFJWLYZP/VRjg9wjfRarTkGBZd/T3N+gCgYIKoEcz1UBgi2hRANCAAR5DGuQwJqkxnbCsP+iPSDoHWIF4RwcR5EsSvT8QPxO1wRkR2IhCkzvRb32x2CUgJFdvoqVqfApFDPZzShqzBwX", publicKey = "MFkwEwYHKoZIzj0CAQYIKoEcz1UBgi0DQgAEeQxrkMCapMZ2wrD/oj0g6B1iBeEcHEeRLEr0/ED8TtcEZEdiIQpM70W99sdglICRXb6KlanwKRQz2c0oaswcFw==") + @EncryptField(algorithm = AlgorithmType.RSA, privateKey = "MIICdQIBADANBgkqhkiG9w0BAQEFAASCAl8wggJbAgEAAoGBANBBEeueWlXlkkj2+WY5l+IWe42d8b5K28g+G/CFKC/yYAEHtqGlCsBOrb+YBkG9mPzmuYA/n9k0NFIc8E8yY5vZQaroyFBrTTWEzG9RY2f7Y3svVyybs6jpXSUs4xff8abo7wL1Y/wUaeatTViamxYnyTvdTmLm3d+JjRij68rxAgMBAAECgYAB0TnhXraSopwIVRfmboea1b0upl+BUdTJcmci412UjrKr5aE695ZLPkXbFXijVu7HJlyyv94NVUdaMACV7Ku/S2RuNB70M7YJm8rAjHFC3/i2ZeIM60h1Ziy4QKv0XM3pRATlDCDNhC1WUrtQCQSgU8kcp6eUUppruOqDzcY04QJBAPm9+sBP9CwDRgy3e5+V8aZtJkwDstb0lVVV/KY890cydVxiCwvX3fqVnxKMlb+x0YtH0sb9v+71xvK2lGobaRECQQDVePU6r/cCEfpc+nkWF6osAH1f8Mux3rYv2DoBGvaPzV2BGfsLed4neRfCwWNCKvGPCdW+L0xMJg8+RwaoBUPhAkAT5kViqXxFPYWJYd1h2+rDXhMdH3ZSlm6HvDBDdrwlWinr0Iwcx3iSjPV93uHXwm118aUj4fg3LDJMCKxOwBxhAkByrQXfvwOMYygBprRBf/j0plazoWFrbd6lGR0f1uI5IfNnFRPdeFw1DEINZ2Hw+6zEUF44SqRMC+4IYJNc02dBAkBCgy7RvfyV/A7N6kKXxTHauY0v6XwSSvpeKtRJkbIcRWOdIYvaHO9L7cklj3vIEdwjSUp9K4VTBYYlmAz1xh03", publicKey = "MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDQQRHrnlpV5ZJI9vlmOZfiFnuNnfG+StvIPhvwhSgv8mABB7ahpQrATq2/mAZBvZj85rmAP5/ZNDRSHPBPMmOb2UGq6MhQa001hMxvUWNn+2N7L1csm7Oo6V0lLOMX3/Gm6O8C9WP8FGnmrU1YmpsWJ8k73U5i5t3fiY0Yo+vK8QIDAQAB") + private String testKey; + + /** + * 值 + */ + // @EncryptField // 什么也不写走默认yml配置 + // @EncryptField(algorithm = AlgorithmType.SM4, password = "10rfylhtccpuyke5") + @EncryptField(algorithm = AlgorithmType.AES, password = "10rfylhtccpuyke5") + private String value; + +} diff --git a/ruoyi-modules/ruoyi-demo/src/main/java/com/ruoyi/demo/domain/entity/TestTree.java b/ruoyi-modules/ruoyi-demo/src/main/java/com/ruoyi/demo/domain/entity/TestTree.java new file mode 100644 index 0000000..5de3d6e --- /dev/null +++ b/ruoyi-modules/ruoyi-demo/src/main/java/com/ruoyi/demo/domain/entity/TestTree.java @@ -0,0 +1,58 @@ +package com.ruoyi.demo.domain.entity; + +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableLogic; +import com.baomidou.mybatisplus.annotation.TableName; +import com.baomidou.mybatisplus.annotation.Version; +import com.rouyi.common.mybatis.core.domain.BaseEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * 测试树表对象 test_tree + * + * @author Lion Li + * @date 2021-07-26 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@TableName("test_tree") +public class TestTree extends BaseEntity { + + private static final long serialVersionUID = 1L; + + + /** + * 主键 + */ + @TableId(value = "id") + private Long id; + + /** + * 部门id + */ + private Long deptId; + + /** + * 用户id + */ + private Long userId; + + /** + * 树节点名 + */ + private String treeName; + + /** + * 版本 + */ + @Version + private Long version; + + /** + * 删除标志 + */ + @TableLogic + private Long delFlag; + +} diff --git a/ruoyi-modules/ruoyi-demo/src/main/java/com/ruoyi/demo/domain/package-info.java b/ruoyi-modules/ruoyi-demo/src/main/java/com/ruoyi/demo/domain/package-info.java new file mode 100644 index 0000000..e2da765 --- /dev/null +++ b/ruoyi-modules/ruoyi-demo/src/main/java/com/ruoyi/demo/domain/package-info.java @@ -0,0 +1 @@ +package com.ruoyi.demo.domain; \ No newline at end of file diff --git a/ruoyi-modules/ruoyi-demo/src/main/java/com/ruoyi/demo/domain/vo/ExportDemoVo.java b/ruoyi-modules/ruoyi-demo/src/main/java/com/ruoyi/demo/domain/vo/ExportDemoVo.java new file mode 100644 index 0000000..56d4cb9 --- /dev/null +++ b/ruoyi-modules/ruoyi-demo/src/main/java/com/ruoyi/demo/domain/vo/ExportDemoVo.java @@ -0,0 +1,118 @@ +package com.ruoyi.demo.domain.vo; + +import com.alibaba.excel.annotation.ExcelIgnoreUnannotated; +import com.alibaba.excel.annotation.ExcelProperty; +import com.ruoyi.common.core.validate.AddGroup; +import com.ruoyi.common.core.validate.EditGroup; +import com.ruoyi.common.core.enums.UserStatus; +import com.ruoyi.common.excel.annotation.ExcelDictFormat; +import com.ruoyi.common.excel.annotation.ExcelEnumFormat; +import com.ruoyi.common.excel.convert.ExcelDictConvert; +import com.ruoyi.common.excel.convert.ExcelEnumConvert; +import jakarta.validation.constraints.NotEmpty; +import jakarta.validation.constraints.NotNull; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; + +/** + * 带有下拉选的Excel导出 + * + * @author Emil.Zhang + */ +@Data +@ExcelIgnoreUnannotated +@AllArgsConstructor +@NoArgsConstructor +public class ExportDemoVo { + + private static final long serialVersionUID = 1L; + + /** + * 用户昵称 + */ + @ExcelProperty(value = "用户名", index = 0) + @NotEmpty(message = "用户名不能为空", groups = AddGroup.class) + private String nickName; + + /** + * 用户类型 + *

+ * 使用ExcelEnumFormat注解需要进行下拉选的部分 + */ + @ExcelProperty(value = "用户类型", index = 1, converter = ExcelEnumConvert.class) + @ExcelEnumFormat(enumClass = UserStatus.class, textField = "info") + @NotEmpty(message = "用户类型不能为空", groups = AddGroup.class) + private String userStatus; + + /** + * 性别 + *

+ * 使用ExcelDictFormat注解需要进行下拉选的部分 + */ + @ExcelProperty(value = "性别", index = 2, converter = ExcelDictConvert.class) + @ExcelDictFormat(dictType = "sys_user_sex") + @NotEmpty(message = "性别不能为空", groups = AddGroup.class) + private String gender; + + /** + * 手机号 + */ + @ExcelProperty(value = "手机号", index = 3) + @NotEmpty(message = "手机号不能为空", groups = AddGroup.class) + private String phoneNumber; + + /** + * Email + */ + @ExcelProperty(value = "Email", index = 4) + @NotEmpty(message = "Email不能为空", groups = AddGroup.class) + private String email; + + /** + * 省 + *

+ * 级联下拉,仅判断是否选了 + */ + @ExcelProperty(value = "省", index = 5) + @NotNull(message = "省不能为空", groups = AddGroup.class) + private String province; + + /** + * 数据库中的省ID + *

+ * 处理完毕后再判断是否市正确的值 + */ + @NotNull(message = "请勿手动输入", groups = EditGroup.class) + private Integer provinceId; + + /** + * 市 + *

+ * 级联下拉 + */ + @ExcelProperty(value = "市", index = 6) + @NotNull(message = "市不能为空", groups = AddGroup.class) + private String city; + + /** + * 数据库中的市ID + */ + @NotNull(message = "请勿手动输入", groups = EditGroup.class) + private Integer cityId; + + /** + * 县 + *

+ * 级联下拉 + */ + @ExcelProperty(value = "县", index = 7) + @NotNull(message = "县不能为空", groups = AddGroup.class) + private String area; + + /** + * 数据库中的县ID + */ + @NotNull(message = "请勿手动输入", groups = EditGroup.class) + private Integer areaId; +} diff --git a/ruoyi-modules/ruoyi-demo/src/main/java/com/ruoyi/demo/domain/vo/TestDemoVo.java b/ruoyi-modules/ruoyi-demo/src/main/java/com/ruoyi/demo/domain/vo/TestDemoVo.java new file mode 100644 index 0000000..d57a319 --- /dev/null +++ b/ruoyi-modules/ruoyi-demo/src/main/java/com/ruoyi/demo/domain/vo/TestDemoVo.java @@ -0,0 +1,86 @@ +package com.ruoyi.demo.domain.vo; + +import com.alibaba.excel.annotation.ExcelIgnoreUnannotated; +import com.alibaba.excel.annotation.ExcelProperty; +import com.ruoyi.demo.domain.entity.TestDemo; +import io.github.linpeilie.annotations.AutoMapper; +import lombok.Data; + +import java.util.Date; + + +/** + * 测试单表视图对象 test_demo + * + * @author Lion Li + * @date 2021-07-26 + */ +@Data +@ExcelIgnoreUnannotated +@AutoMapper(target = TestDemo.class) +public class TestDemoVo { + + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + @ExcelProperty(value = "主键") + private Long id; + + /** + * 部门id + */ + @ExcelProperty(value = "部门id") + private Long deptId; + + /** + * 用户id + */ + @ExcelProperty(value = "用户id") + private Long userId; + + /** + * 排序号 + */ + @ExcelProperty(value = "排序号") + private Integer orderNum; + + /** + * key键 + */ + @ExcelProperty(value = "key键") + private String testKey; + + /** + * 值 + */ + @ExcelProperty(value = "值") + private String value; + + /** + * 创建时间 + */ + @ExcelProperty(value = "创建时间") + private Date createTime; + + /** + * 创建人 + */ + @ExcelProperty(value = "创建人") + private String createBy; + + /** + * 更新时间 + */ + @ExcelProperty(value = "更新时间") + private Date updateTime; + + /** + * 更新人 + */ + @ExcelProperty(value = "更新人") + private String updateBy; + + +} diff --git a/ruoyi-modules/ruoyi-demo/src/main/java/com/ruoyi/demo/domain/vo/TestTreeVo.java b/ruoyi-modules/ruoyi-demo/src/main/java/com/ruoyi/demo/domain/vo/TestTreeVo.java new file mode 100644 index 0000000..21907fa --- /dev/null +++ b/ruoyi-modules/ruoyi-demo/src/main/java/com/ruoyi/demo/domain/vo/TestTreeVo.java @@ -0,0 +1,61 @@ +package com.ruoyi.demo.domain.vo; + +import com.alibaba.excel.annotation.ExcelIgnoreUnannotated; +import com.alibaba.excel.annotation.ExcelProperty; +import com.ruoyi.demo.domain.entity.TestTree; +import io.github.linpeilie.annotations.AutoMapper; +import lombok.Data; + +import java.util.Date; + + +/** + * 测试树表视图对象 test_tree + * + * @author Lion Li + * @date 2021-07-26 + */ +@Data +@ExcelIgnoreUnannotated +@AutoMapper(target = TestTree.class) +public class TestTreeVo { + + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + private Long id; + + /** + * 父id + */ + @ExcelProperty(value = "父id") + private Long parentId; + + /** + * 部门id + */ + @ExcelProperty(value = "部门id") + private Long deptId; + + /** + * 用户id + */ + @ExcelProperty(value = "用户id") + private Long userId; + + /** + * 树节点名 + */ + @ExcelProperty(value = "树节点名") + private String treeName; + + /** + * 创建时间 + */ + @ExcelProperty(value = "创建时间") + private Date createTime; + + +} diff --git a/ruoyi-modules/ruoyi-demo/src/main/java/com/ruoyi/demo/listener/ExportDemoListener.java b/ruoyi-modules/ruoyi-demo/src/main/java/com/ruoyi/demo/listener/ExportDemoListener.java new file mode 100644 index 0000000..5aa6792 --- /dev/null +++ b/ruoyi-modules/ruoyi-demo/src/main/java/com/ruoyi/demo/listener/ExportDemoListener.java @@ -0,0 +1,68 @@ +package com.ruoyi.demo.listener; + +import cn.hutool.core.util.NumberUtil; +import com.alibaba.excel.context.AnalysisContext; +import com.ruoyi.common.core.validate.AddGroup; +import com.ruoyi.common.core.validate.EditGroup; +import com.ruoyi.common.core.utils.ValidatorUtils; +import com.ruoyi.common.excel.core.DefaultExcelListener; +import com.ruoyi.common.excel.core.DropDownOptions; +import com.ruoyi.demo.domain.vo.ExportDemoVo; + +import java.util.List; + +/** + * Excel带下拉框的解析处理器 + * + * @author Emil.Zhang + */ +public class ExportDemoListener extends DefaultExcelListener { + + public ExportDemoListener() { + // 显示使用构造函数,否则将导致空指针 + super(true); + } + + @Override + public void invoke(ExportDemoVo data, AnalysisContext context) { + // 先校验必填 + ValidatorUtils.validate(data, AddGroup.class); + + // 处理级联下拉的部分 + String province = data.getProvince(); + String city = data.getCity(); + String area = data.getArea(); + // 本行用户选择的省 + List thisRowSelectedProvinceOption = DropDownOptions.analyzeOptionValue(province); + if (thisRowSelectedProvinceOption.size() == 2) { + String provinceIdStr = thisRowSelectedProvinceOption.get(1); + if (NumberUtil.isNumber(provinceIdStr)) { + // 严格要求数据的话可以在这里做与数据库相关的判断 + // 例如判断省信息是否在数据库中存在等,建议结合RedisCache做缓存10s,减少数据库调用 + data.setProvinceId(Integer.parseInt(provinceIdStr)); + } + } + // 本行用户选择的市 + List thisRowSelectedCityOption = DropDownOptions.analyzeOptionValue(city); + if (thisRowSelectedCityOption.size() == 2) { + String cityIdStr = thisRowSelectedCityOption.get(1); + if (NumberUtil.isNumber(cityIdStr)) { + data.setCityId(Integer.parseInt(cityIdStr)); + } + } + // 本行用户选择的县 + List thisRowSelectedAreaOption = DropDownOptions.analyzeOptionValue(area); + if (thisRowSelectedAreaOption.size() == 2) { + String areaIdStr = thisRowSelectedAreaOption.get(1); + if (NumberUtil.isNumber(areaIdStr)) { + data.setAreaId(Integer.parseInt(areaIdStr)); + } + } + + // 处理完毕以后判断是否符合规则 + ValidatorUtils.validate(data, EditGroup.class); + + // 添加到处理结果中 + getExcelResult().getList().add(data); + } +} diff --git a/ruoyi-modules/ruoyi-demo/src/main/java/com/ruoyi/demo/mapper/TestDemoEncryptMapper.java b/ruoyi-modules/ruoyi-demo/src/main/java/com/ruoyi/demo/mapper/TestDemoEncryptMapper.java new file mode 100644 index 0000000..e5444f6 --- /dev/null +++ b/ruoyi-modules/ruoyi-demo/src/main/java/com/ruoyi/demo/mapper/TestDemoEncryptMapper.java @@ -0,0 +1,13 @@ +package com.ruoyi.demo.mapper; + +import com.rouyi.common.mybatis.core.mapper.BaseMapperPlus; +import com.ruoyi.demo.domain.entity.TestDemoEncrypt; + +/** + * 测试加密功能 + * + * @author Lion Li + */ +public interface TestDemoEncryptMapper extends BaseMapperPlus { + +} diff --git a/ruoyi-modules/ruoyi-demo/src/main/java/com/ruoyi/demo/mapper/TestDemoMapper.java b/ruoyi-modules/ruoyi-demo/src/main/java/com/ruoyi/demo/mapper/TestDemoMapper.java new file mode 100644 index 0000000..cffda06 --- /dev/null +++ b/ruoyi-modules/ruoyi-demo/src/main/java/com/ruoyi/demo/mapper/TestDemoMapper.java @@ -0,0 +1,58 @@ +package com.ruoyi.demo.mapper; + +import com.baomidou.mybatisplus.core.conditions.Wrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.core.toolkit.Constants; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.rouyi.common.mybatis.annotation.DataColumn; +import com.rouyi.common.mybatis.annotation.DataPermission; +import com.rouyi.common.mybatis.core.mapper.BaseMapperPlus; +import com.ruoyi.demo.domain.entity.TestDemo; +import com.ruoyi.demo.domain.vo.TestDemoVo; +import org.apache.ibatis.annotations.Param; + +import java.util.Collection; +import java.util.List; + +/** + * 测试单表Mapper接口 + * + * @author Lion Li + * @date 2021-07-26 + */ +public interface TestDemoMapper extends BaseMapperPlus { + + @DataPermission({ + @DataColumn(key = "deptName", value = "dept_id"), + @DataColumn(key = "userName", value = "user_id") + }) + Page customPageList(@Param("page") Page page, @Param("ew") Wrapper wrapper); + + @Override + @DataPermission({ + @DataColumn(key = "deptName", value = "dept_id"), + @DataColumn(key = "userName", value = "user_id") + }) + List selectList(IPage page, @Param(Constants.WRAPPER) Wrapper queryWrapper); + + @Override + @DataPermission({ + @DataColumn(key = "deptName", value = "dept_id"), + @DataColumn(key = "userName", value = "user_id") + }) + List selectList(@Param(Constants.WRAPPER) Wrapper queryWrapper); + + @Override + @DataPermission({ + @DataColumn(key = "deptName", value = "dept_id"), + @DataColumn(key = "userName", value = "user_id") + }) + int updateById(@Param(Constants.ENTITY) TestDemo entity); + + @Override + @DataPermission({ + @DataColumn(key = "deptName", value = "dept_id"), + @DataColumn(key = "userName", value = "user_id") + }) + int deleteBatchIds(@Param(Constants.COLL) Collection idList); +} diff --git a/ruoyi-modules/ruoyi-demo/src/main/java/com/ruoyi/demo/mapper/TestTreeMapper.java b/ruoyi-modules/ruoyi-demo/src/main/java/com/ruoyi/demo/mapper/TestTreeMapper.java new file mode 100644 index 0000000..d67212f --- /dev/null +++ b/ruoyi-modules/ruoyi-demo/src/main/java/com/ruoyi/demo/mapper/TestTreeMapper.java @@ -0,0 +1,21 @@ +package com.ruoyi.demo.mapper; + +import com.rouyi.common.mybatis.annotation.DataColumn; +import com.rouyi.common.mybatis.annotation.DataPermission; +import com.rouyi.common.mybatis.core.mapper.BaseMapperPlus; +import com.ruoyi.demo.domain.entity.TestTree; +import com.ruoyi.demo.domain.vo.TestTreeVo; + +/** + * 测试树表Mapper接口 + * + * @author Lion Li + * @date 2021-07-26 + */ +@DataPermission({ + @DataColumn(key = "deptName", value = "dept_id"), + @DataColumn(key = "userName", value = "user_id") +}) +public interface TestTreeMapper extends BaseMapperPlus { + +} diff --git a/ruoyi-modules/ruoyi-demo/src/main/java/com/ruoyi/demo/mapper/package-info.java b/ruoyi-modules/ruoyi-demo/src/main/java/com/ruoyi/demo/mapper/package-info.java new file mode 100644 index 0000000..7243da9 --- /dev/null +++ b/ruoyi-modules/ruoyi-demo/src/main/java/com/ruoyi/demo/mapper/package-info.java @@ -0,0 +1 @@ +package com.ruoyi.demo.mapper; \ No newline at end of file diff --git a/ruoyi-modules/ruoyi-demo/src/main/java/com/ruoyi/demo/service/IExportExcelService.java b/ruoyi-modules/ruoyi-demo/src/main/java/com/ruoyi/demo/service/IExportExcelService.java new file mode 100644 index 0000000..4e0328a --- /dev/null +++ b/ruoyi-modules/ruoyi-demo/src/main/java/com/ruoyi/demo/service/IExportExcelService.java @@ -0,0 +1,18 @@ +package com.ruoyi.demo.service; + +import jakarta.servlet.http.HttpServletResponse; + +/** + * 导出下拉框Excel示例 + * + * @author Emil.Zhang + */ +public interface IExportExcelService { + + /** + * 导出下拉框 + * + * @param response / + */ + void exportWithOptions(HttpServletResponse response); +} diff --git a/ruoyi-modules/ruoyi-demo/src/main/java/com/ruoyi/demo/service/ITestDemoService.java b/ruoyi-modules/ruoyi-demo/src/main/java/com/ruoyi/demo/service/ITestDemoService.java new file mode 100644 index 0000000..45fdb7f --- /dev/null +++ b/ruoyi-modules/ruoyi-demo/src/main/java/com/ruoyi/demo/service/ITestDemoService.java @@ -0,0 +1,71 @@ +package com.ruoyi.demo.service; + +import com.rouyi.common.mybatis.core.page.PageQuery; +import com.rouyi.common.mybatis.core.page.TableDataInfo; +import com.ruoyi.demo.domain.entity.TestDemo; +import com.ruoyi.demo.domain.bo.TestDemoBo; +import com.ruoyi.demo.domain.vo.TestDemoVo; + +import java.util.Collection; +import java.util.List; + +/** + * 测试单表Service接口 + * + * @author Lion Li + * @date 2021-07-26 + */ +public interface ITestDemoService { + + /** + * 查询单个 + * + * @return + */ + TestDemoVo queryById(Long id); + + /** + * 查询列表 + */ + TableDataInfo queryPageList(TestDemoBo bo, PageQuery pageQuery); + + /** + * 自定义分页查询 + */ + TableDataInfo customPageList(TestDemoBo bo, PageQuery pageQuery); + + /** + * 查询列表 + */ + List queryList(TestDemoBo bo); + + /** + * 根据新增业务对象插入测试单表 + * + * @param bo 测试单表新增业务对象 + * @return + */ + Boolean insertByBo(TestDemoBo bo); + + /** + * 根据编辑业务对象修改测试单表 + * + * @param bo 测试单表编辑业务对象 + * @return + */ + Boolean updateByBo(TestDemoBo bo); + + /** + * 校验并删除数据 + * + * @param ids 主键集合 + * @param isValid 是否校验,true-删除前校验,false-不校验 + * @return + */ + Boolean deleteWithValidByIds(Collection ids, Boolean isValid); + + /** + * 批量保存 + */ + Boolean saveBatch(List list); +} diff --git a/ruoyi-modules/ruoyi-demo/src/main/java/com/ruoyi/demo/service/ITestTreeService.java b/ruoyi-modules/ruoyi-demo/src/main/java/com/ruoyi/demo/service/ITestTreeService.java new file mode 100644 index 0000000..366e515 --- /dev/null +++ b/ruoyi-modules/ruoyi-demo/src/main/java/com/ruoyi/demo/service/ITestTreeService.java @@ -0,0 +1,52 @@ +package com.ruoyi.demo.service; + +import com.ruoyi.demo.domain.bo.TestTreeBo; +import com.ruoyi.demo.domain.vo.TestTreeVo; + +import java.util.Collection; +import java.util.List; + +/** + * 测试树表Service接口 + * + * @author Lion Li + * @date 2021-07-26 + */ +public interface ITestTreeService { + /** + * 查询单个 + * + * @return + */ + TestTreeVo queryById(Long id); + + /** + * 查询列表 + */ + List queryList(TestTreeBo bo); + + /** + * 根据新增业务对象插入测试树表 + * + * @param bo 测试树表新增业务对象 + * @return + */ + Boolean insertByBo(TestTreeBo bo); + + /** + * 根据编辑业务对象修改测试树表 + * + * @param bo 测试树表编辑业务对象 + * @return + */ + Boolean updateByBo(TestTreeBo bo); + + /** + * 校验并删除数据 + * + * @param ids 主键集合 + * @param isValid 是否校验,true-删除前校验,false-不校验 + * @return + */ + Boolean deleteWithValidByIds(Collection ids, Boolean isValid); +} diff --git a/ruoyi-modules/ruoyi-demo/src/main/java/com/ruoyi/demo/service/impl/ExportExcelServiceImpl.java b/ruoyi-modules/ruoyi-demo/src/main/java/com/ruoyi/demo/service/impl/ExportExcelServiceImpl.java new file mode 100644 index 0000000..f27108f --- /dev/null +++ b/ruoyi-modules/ruoyi-demo/src/main/java/com/ruoyi/demo/service/impl/ExportExcelServiceImpl.java @@ -0,0 +1,222 @@ +package com.ruoyi.demo.service.impl; + +import cn.hutool.core.util.StrUtil; +import com.ruoyi.common.core.enums.UserStatus; +import com.ruoyi.common.core.utils.StreamUtils; +import com.ruoyi.common.excel.core.DropDownOptions; +import com.ruoyi.common.excel.utils.ExcelUtil; +import com.ruoyi.demo.domain.vo.ExportDemoVo; +import com.ruoyi.demo.service.IExportExcelService; +import jakarta.servlet.http.HttpServletResponse; +import lombok.Data; +import lombok.RequiredArgsConstructor; +import org.springframework.stereotype.Service; + +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; + +/** + * 导出下拉框Excel示例 + * + * @author Emil.Zhang + */ +@Service +@RequiredArgsConstructor +public class ExportExcelServiceImpl implements IExportExcelService { + + @Override + public void exportWithOptions(HttpServletResponse response) { + // 创建表格数据,业务中一般通过数据库查询 + List excelDataList = new ArrayList<>(); + for (int i = 0; i < 3; i++) { + // 模拟数据库中的一条数据 + ExportDemoVo everyRowData = new ExportDemoVo(); + everyRowData.setNickName("用户-" + i); + everyRowData.setUserStatus(UserStatus.OK.getCode()); + everyRowData.setGender("1"); + everyRowData.setPhoneNumber(String.format("175%08d", i)); + everyRowData.setEmail(String.format("175%08d", i) + "@163.com"); + everyRowData.setProvinceId(i); + everyRowData.setCityId(i); + everyRowData.setAreaId(i); + excelDataList.add(everyRowData); + } + + // 通过@ExcelIgnoreUnannotated配合@ExcelProperty合理显示需要的列 + // 并通过@DropDown注解指定下拉值,或者通过创建ExcelOptions来指定下拉框 + // 使用ExcelOptions时建议指定列index,防止出现下拉列解析不对齐 + + // 首先从数据库中查询下拉框内的可选项 + // 这里模拟查询结果 + List provinceList = getProvinceList(), + cityList = getCityList(provinceList), + areaList = getAreaList(cityList); + int provinceIndex = 5, cityIndex = 6, areaIndex = 7; + + DropDownOptions provinceToCity = DropDownOptions.buildLinkedOptions( + provinceList, + provinceIndex, + cityList, + cityIndex, + DemoCityData::getId, + DemoCityData::getPid, + everyOptions -> DropDownOptions.createOptionValue( + everyOptions.getName(), + everyOptions.getId() + ) + ); + + DropDownOptions cityToArea = DropDownOptions.buildLinkedOptions( + cityList, + cityIndex, + areaList, + areaIndex, + DemoCityData::getId, + DemoCityData::getPid, + everyOptions -> DropDownOptions.createOptionValue( + everyOptions.getName(), + everyOptions.getId() + ) + ); + + // 把所有的下拉框存储 + List options = new ArrayList<>(); + options.add(provinceToCity); + options.add(cityToArea); + + // 到此为止所有的下拉框可选项已全部配置完毕 + + // 接下来需要将Excel中的展示数据转换为对应的下拉选 + List outList = StreamUtils.toList(excelDataList, everyRowData -> { + // 只需要处理没有使用@ExcelDictFormat注解的下拉框 + // 一般来说,可以直接在数据库查询即查询出省市县信息,这里通过模拟操作赋值 + everyRowData.setProvince(buildOptions(provinceList, everyRowData.getProvinceId())); + everyRowData.setCity(buildOptions(cityList, everyRowData.getCityId())); + everyRowData.setArea(buildOptions(areaList, everyRowData.getAreaId())); + return everyRowData; + }); + + ExcelUtil.exportExcel(outList, "下拉框示例", ExportDemoVo.class, response, options); + } + + private String buildOptions(List cityDataList, Integer id) { + Map> groupByIdMap = + cityDataList.stream().collect(Collectors.groupingBy(DemoCityData::getId)); + if (groupByIdMap.containsKey(id)) { + DemoCityData demoCityData = groupByIdMap.get(id).get(0); + return DropDownOptions.createOptionValue(demoCityData.getName(), demoCityData.getId()); + } else { + return StrUtil.EMPTY; + } + } + + /** + * 模拟查询数据库操作 + * + * @return / + */ + private List getProvinceList() { + List provinceList = new ArrayList<>(); + + // 实际业务中一般采用数据库读取的形式,这里直接拼接创建 + provinceList.add(new DemoCityData(0, null, "安徽省")); + provinceList.add(new DemoCityData(1, null, "江苏省")); + + return provinceList; + } + + /** + * 模拟查找数据库操作,需要连带查询出省的数据 + * + * @param provinceList 模拟的父省数据 + * @return / + */ + private List getCityList(List provinceList) { + List cityList = new ArrayList<>(); + + // 实际业务中一般采用数据库读取的形式,这里直接拼接创建 + cityList.add(new DemoCityData(0, 0, "合肥市")); + cityList.add(new DemoCityData(1, 0, "芜湖市")); + cityList.add(new DemoCityData(2, 1, "南京市")); + cityList.add(new DemoCityData(3, 1, "无锡市")); + cityList.add(new DemoCityData(4, 1, "徐州市")); + + selectParentData(provinceList, cityList); + + return cityList; + } + + /** + * 模拟查找数据库操作,需要连带查询出市的数据 + * + * @param cityList 模拟的父市数据 + * @return / + */ + private List getAreaList(List cityList) { + List areaList = new ArrayList<>(); + + // 实际业务中一般采用数据库读取的形式,这里直接拼接创建 + areaList.add(new DemoCityData(0, 0, "瑶海区")); + areaList.add(new DemoCityData(1, 0, "庐江区")); + areaList.add(new DemoCityData(2, 1, "南宁县")); + areaList.add(new DemoCityData(3, 1, "镜湖区")); + areaList.add(new DemoCityData(4, 2, "玄武区")); + areaList.add(new DemoCityData(5, 2, "秦淮区")); + areaList.add(new DemoCityData(6, 3, "宜兴市")); + areaList.add(new DemoCityData(7, 3, "新吴区")); + areaList.add(new DemoCityData(8, 4, "鼓楼区")); + areaList.add(new DemoCityData(9, 4, "丰县")); + + selectParentData(cityList, areaList); + + return areaList; + } + + /** + * 模拟数据库的查询父数据操作 + * + * @param parentList / + * @param sonList / + */ + private void selectParentData(List parentList, List sonList) { + Map> parentGroupByIdMap = + parentList.stream().collect(Collectors.groupingBy(DemoCityData::getId)); + + sonList.forEach(everySon -> { + if (parentGroupByIdMap.containsKey(everySon.getPid())) { + everySon.setPData(parentGroupByIdMap.get(everySon.getPid()).get(0)); + } + }); + } + + /** + * 模拟的数据库省市县 + */ + @Data + private static class DemoCityData { + /** + * 数据库id字段 + */ + private Integer id; + /** + * 数据库pid字段 + */ + private Integer pid; + /** + * 数据库name字段 + */ + private String name; + /** + * MyBatisPlus连带查询父数据 + */ + private DemoCityData pData; + + public DemoCityData(Integer id, Integer pid, String name) { + this.id = id; + this.pid = pid; + this.name = name; + } + } +} diff --git a/ruoyi-modules/ruoyi-demo/src/main/java/com/ruoyi/demo/service/impl/TestDemoServiceImpl.java b/ruoyi-modules/ruoyi-demo/src/main/java/com/ruoyi/demo/service/impl/TestDemoServiceImpl.java new file mode 100644 index 0000000..a3fad4f --- /dev/null +++ b/ruoyi-modules/ruoyi-demo/src/main/java/com/ruoyi/demo/service/impl/TestDemoServiceImpl.java @@ -0,0 +1,110 @@ +package com.ruoyi.demo.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.toolkit.Wrappers; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.rouyi.common.mybatis.core.page.PageQuery; +import com.rouyi.common.mybatis.core.page.TableDataInfo; +import com.ruoyi.common.core.utils.MapstructUtils; +import com.ruoyi.common.core.utils.StringUtils; +import com.ruoyi.demo.domain.entity.TestDemo; +import com.ruoyi.demo.domain.bo.TestDemoBo; +import com.ruoyi.demo.domain.vo.TestDemoVo; +import com.ruoyi.demo.mapper.TestDemoMapper; +import com.ruoyi.demo.service.ITestDemoService; +import lombok.RequiredArgsConstructor; +import org.springframework.stereotype.Service; + +import java.util.Collection; +import java.util.List; +import java.util.Map; + +/** + * 测试单表Service业务层处理 + * + * @author Lion Li + * @date 2021-07-26 + */ +@RequiredArgsConstructor +@Service +public class TestDemoServiceImpl implements ITestDemoService { + + private final TestDemoMapper baseMapper; + + @Override + public TestDemoVo queryById(Long id) { + return baseMapper.selectVoById(id); + } + + @Override + public TableDataInfo queryPageList(TestDemoBo bo, PageQuery pageQuery) { + LambdaQueryWrapper lqw = buildQueryWrapper(bo); + Page result = baseMapper.selectVoPage(pageQuery.build(), lqw); + return TableDataInfo.build(result); + } + + /** + * 自定义分页查询 + */ + @Override + public TableDataInfo customPageList(TestDemoBo bo, PageQuery pageQuery) { + LambdaQueryWrapper lqw = buildQueryWrapper(bo); + Page result = baseMapper.customPageList(pageQuery.build(), lqw); + return TableDataInfo.build(result); + } + + @Override + public List queryList(TestDemoBo bo) { + return baseMapper.selectVoList(buildQueryWrapper(bo)); + } + + private LambdaQueryWrapper buildQueryWrapper(TestDemoBo bo) { + Map params = bo.getParams(); + LambdaQueryWrapper lqw = Wrappers.lambdaQuery(); + lqw.like(StringUtils.isNotBlank(bo.getTestKey()), TestDemo::getTestKey, bo.getTestKey()); + lqw.eq(StringUtils.isNotBlank(bo.getValue()), TestDemo::getValue, bo.getValue()); + lqw.between(params.get("beginCreateTime") != null && params.get("endCreateTime") != null, + TestDemo::getCreateTime, params.get("beginCreateTime"), params.get("endCreateTime")); + return lqw; + } + + @Override + public Boolean insertByBo(TestDemoBo bo) { + TestDemo add = MapstructUtils.convert(bo, TestDemo.class); + validEntityBeforeSave(add); + boolean flag = baseMapper.insert(add) > 0; + if (flag) { + bo.setId(add.getId()); + } + return flag; + } + + @Override + public Boolean updateByBo(TestDemoBo bo) { + TestDemo update = MapstructUtils.convert(bo, TestDemo.class); + validEntityBeforeSave(update); + return baseMapper.updateById(update) > 0; + } + + /** + * 保存前的数据校验 + * + * @param entity 实体类数据 + */ + private void validEntityBeforeSave(TestDemo entity) { + //TODO 做一些数据校验,如唯一约束 + } + + @Override + public Boolean deleteWithValidByIds(Collection ids, Boolean isValid) { + if (isValid) { + //TODO 做一些业务上的校验,判断是否需要校验 + } + return baseMapper.deleteBatchIds(ids) > 0; + } + + @Override + public Boolean saveBatch(List list) { + return baseMapper.insertBatch(list); + } +} diff --git a/ruoyi-modules/ruoyi-demo/src/main/java/com/ruoyi/demo/service/impl/TestTreeServiceImpl.java b/ruoyi-modules/ruoyi-demo/src/main/java/com/ruoyi/demo/service/impl/TestTreeServiceImpl.java new file mode 100644 index 0000000..779eafc --- /dev/null +++ b/ruoyi-modules/ruoyi-demo/src/main/java/com/ruoyi/demo/service/impl/TestTreeServiceImpl.java @@ -0,0 +1,87 @@ +package com.ruoyi.demo.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.toolkit.Wrappers; +import com.ruoyi.common.core.utils.MapstructUtils; +import com.ruoyi.common.core.utils.StringUtils; +import com.ruoyi.demo.domain.entity.TestTree; +import com.ruoyi.demo.domain.bo.TestTreeBo; +import com.ruoyi.demo.domain.vo.TestTreeVo; +import com.ruoyi.demo.mapper.TestTreeMapper; +import com.ruoyi.demo.service.ITestTreeService; +import lombok.RequiredArgsConstructor; +import org.springframework.stereotype.Service; + +import java.util.Collection; +import java.util.List; +import java.util.Map; + +/** + * 测试树表Service业务层处理 + * + * @author Lion Li + * @date 2021-07-26 + */ +// @DS("slave") // 切换从库查询 +@RequiredArgsConstructor +@Service +public class TestTreeServiceImpl implements ITestTreeService { + + private final TestTreeMapper baseMapper; + + @Override + public TestTreeVo queryById(Long id) { + return baseMapper.selectVoById(id); + } + + // @DS("slave") // 切换从库查询 + @Override + public List queryList(TestTreeBo bo) { + LambdaQueryWrapper lqw = buildQueryWrapper(bo); + return baseMapper.selectVoList(lqw); + } + + private LambdaQueryWrapper buildQueryWrapper(TestTreeBo bo) { + Map params = bo.getParams(); + LambdaQueryWrapper lqw = Wrappers.lambdaQuery(); + lqw.like(StringUtils.isNotBlank(bo.getTreeName()), TestTree::getTreeName, bo.getTreeName()); + lqw.between(params.get("beginCreateTime") != null && params.get("endCreateTime") != null, + TestTree::getCreateTime, params.get("beginCreateTime"), params.get("endCreateTime")); + return lqw; + } + + @Override + public Boolean insertByBo(TestTreeBo bo) { + TestTree add = MapstructUtils.convert(bo, TestTree.class); + validEntityBeforeSave(add); + boolean flag = baseMapper.insert(add) > 0; + if (flag) { + bo.setId(add.getId()); + } + return flag; + } + + @Override + public Boolean updateByBo(TestTreeBo bo) { + TestTree update = MapstructUtils.convert(bo, TestTree.class); + validEntityBeforeSave(update); + return baseMapper.updateById(update) > 0; + } + + /** + * 保存前的数据校验 + * + * @param entity 实体类数据 + */ + private void validEntityBeforeSave(TestTree entity) { + //TODO 做一些数据校验,如唯一约束 + } + + @Override + public Boolean deleteWithValidByIds(Collection ids, Boolean isValid) { + if (isValid) { + //TODO 做一些业务上的校验,判断是否需要校验 + } + return baseMapper.deleteBatchIds(ids) > 0; + } +} diff --git a/ruoyi-modules/ruoyi-demo/src/main/java/com/ruoyi/demo/service/impl/package-info.java b/ruoyi-modules/ruoyi-demo/src/main/java/com/ruoyi/demo/service/impl/package-info.java new file mode 100644 index 0000000..6060849 --- /dev/null +++ b/ruoyi-modules/ruoyi-demo/src/main/java/com/ruoyi/demo/service/impl/package-info.java @@ -0,0 +1 @@ +package com.ruoyi.demo.service.impl; \ No newline at end of file diff --git a/ruoyi-modules/ruoyi-demo/src/main/java/com/ruoyi/demo/service/package-info.java b/ruoyi-modules/ruoyi-demo/src/main/java/com/ruoyi/demo/service/package-info.java new file mode 100644 index 0000000..d6a44c9 --- /dev/null +++ b/ruoyi-modules/ruoyi-demo/src/main/java/com/ruoyi/demo/service/package-info.java @@ -0,0 +1 @@ +package com.ruoyi.demo.service; \ No newline at end of file diff --git a/ruoyi-modules/ruoyi-demo/src/main/resources/excel/单列表.xlsx b/ruoyi-modules/ruoyi-demo/src/main/resources/excel/单列表.xlsx new file mode 100644 index 0000000..0f7347d Binary files /dev/null and b/ruoyi-modules/ruoyi-demo/src/main/resources/excel/单列表.xlsx differ diff --git a/ruoyi-modules/ruoyi-demo/src/main/resources/excel/多列表.xlsx b/ruoyi-modules/ruoyi-demo/src/main/resources/excel/多列表.xlsx new file mode 100644 index 0000000..c7d11dc Binary files /dev/null and b/ruoyi-modules/ruoyi-demo/src/main/resources/excel/多列表.xlsx differ diff --git a/ruoyi-modules/ruoyi-demo/src/main/resources/mapper/demo/TestDemoMapper.xml b/ruoyi-modules/ruoyi-demo/src/main/resources/mapper/demo/TestDemoMapper.xml new file mode 100644 index 0000000..26f86bd --- /dev/null +++ b/ruoyi-modules/ruoyi-demo/src/main/resources/mapper/demo/TestDemoMapper.xml @@ -0,0 +1,11 @@ + + + + + + + diff --git a/ruoyi-modules/ruoyi-demo/src/main/resources/mapper/demo/TestTreeMapper.xml b/ruoyi-modules/ruoyi-demo/src/main/resources/mapper/demo/TestTreeMapper.xml new file mode 100644 index 0000000..53c714f --- /dev/null +++ b/ruoyi-modules/ruoyi-demo/src/main/resources/mapper/demo/TestTreeMapper.xml @@ -0,0 +1,6 @@ + + + + diff --git a/ruoyi-modules/ruoyi-demo/src/main/resources/mapper/package-info.md b/ruoyi-modules/ruoyi-demo/src/main/resources/mapper/package-info.md new file mode 100644 index 0000000..c938b1e --- /dev/null +++ b/ruoyi-modules/ruoyi-demo/src/main/resources/mapper/package-info.md @@ -0,0 +1,3 @@ +java包使用 `.` 分割 resource 目录使用 `/` 分割 +
+此文件目的 防止文件夹粘连找不到 `xml` 文件 \ No newline at end of file diff --git a/ruoyi-modules/ruoyi-generator/pom.xml b/ruoyi-modules/ruoyi-generator/pom.xml new file mode 100644 index 0000000..0d20f54 --- /dev/null +++ b/ruoyi-modules/ruoyi-generator/pom.xml @@ -0,0 +1,54 @@ + + + + ruoyi-modules + com.ruoyi + ${revision} + + 4.0.0 + + ruoyi-generator + + + generator代码生成 + + + + + + com.ruoyi + ruoyi-common-doc + + + + + org.apache.velocity + velocity-engine-core + + + + + com.ruoyi + ruoyi-common-core + + + + com.ruoyi + ruoyi-common-web + + + + com.ruoyi + ruoyi-common-log + + + + com.ruoyi + ruoyi-common-mybatis + + + + + diff --git a/ruoyi-modules/ruoyi-generator/src/main/java/com/ruoyi/generator/config/GenConfig.java b/ruoyi-modules/ruoyi-generator/src/main/java/com/ruoyi/generator/config/GenConfig.java new file mode 100644 index 0000000..187426f --- /dev/null +++ b/ruoyi-modules/ruoyi-generator/src/main/java/com/ruoyi/generator/config/GenConfig.java @@ -0,0 +1,73 @@ +package com.ruoyi.generator.config; + +import org.springframework.beans.factory.annotation.Value; +import org.springframework.boot.context.properties.ConfigurationProperties; +import org.springframework.context.annotation.PropertySource; +import org.springframework.stereotype.Component; + +/** + * 读取代码生成相关配置 + * + * @author ruoyi + */ +@Component +@ConfigurationProperties(prefix = "gen") +@PropertySource(value = {"classpath:generator.yml"}, encoding = "UTF-8") +public class GenConfig { + + /** + * 作者 + */ + public static String author; + + /** + * 生成包路径 + */ + public static String packageName; + + /** + * 自动去除表前缀,默认是false + */ + public static boolean autoRemovePre; + + /** + * 表前缀(类名不会包含表前缀) + */ + public static String tablePrefix; + + public static String getAuthor() { + return author; + } + + @Value("${author}") + public void setAuthor(String author) { + GenConfig.author = author; + } + + public static String getPackageName() { + return packageName; + } + + @Value("${packageName}") + public void setPackageName(String packageName) { + GenConfig.packageName = packageName; + } + + public static boolean getAutoRemovePre() { + return autoRemovePre; + } + + @Value("${autoRemovePre}") + public void setAutoRemovePre(boolean autoRemovePre) { + GenConfig.autoRemovePre = autoRemovePre; + } + + public static String getTablePrefix() { + return tablePrefix; + } + + @Value("${tablePrefix}") + public void setTablePrefix(String tablePrefix) { + GenConfig.tablePrefix = tablePrefix; + } +} diff --git a/ruoyi-modules/ruoyi-generator/src/main/java/com/ruoyi/generator/constant/GenConstants.java b/ruoyi-modules/ruoyi-generator/src/main/java/com/ruoyi/generator/constant/GenConstants.java new file mode 100644 index 0000000..00b2004 --- /dev/null +++ b/ruoyi-modules/ruoyi-generator/src/main/java/com/ruoyi/generator/constant/GenConstants.java @@ -0,0 +1,193 @@ +package com.ruoyi.generator.constant; + +/** + * 代码生成通用常量 + * + * @author ruoyi + */ +public interface GenConstants { + /** + * 单表(增删改查) + */ + String TPL_CRUD = "crud"; + + /** + * 树表(增删改查) + */ + String TPL_TREE = "tree"; + + /** + * 主子表(增删改查) + */ + String TPL_SUB = "sub"; + + /** + * 树编码字段 + */ + String TREE_CODE = "treeCode"; + + /** + * 树父编码字段 + */ + String TREE_PARENT_CODE = "treeParentCode"; + + /** + * 树名称字段 + */ + String TREE_NAME = "treeName"; + + /** + * 上级菜单ID字段 + */ + String PARENT_MENU_ID = "parentMenuId"; + + /** + * 上级菜单名称字段 + */ + String PARENT_MENU_NAME = "parentMenuName"; + + /** + * 数据库字符串类型 + */ + String[] COLUMNTYPE_STR = {"char", "varchar", "nvarchar", "varchar2"}; + + /** + * 数据库文本类型 + */ + String[] COLUMNTYPE_TEXT = {"tinytext", "text", "mediumtext", "longtext"}; + + /** + * 数据库时间类型 + */ + String[] COLUMNTYPE_TIME = {"datetime", "time", "date", "timestamp"}; + + /** + * 数据库数字类型 + */ + String[] COLUMNTYPE_NUMBER = {"tinyint", "smallint", "mediumint", "int", "number", "integer", + "bit", "bigint", "float", "double", "decimal"}; + + /** + * BO对象 不需要添加字段 + */ + String[] COLUMNNAME_NOT_ADD = {"create_by", "create_time", "del_flag", "update_by", + "update_time", "version"}; + + /** + * BO对象 不需要编辑字段 + */ + String[] COLUMNNAME_NOT_EDIT = {"create_by", "create_time", "del_flag", "update_by", + "update_time", "version"}; + + /** + * VO对象 不需要返回字段 + */ + String[] COLUMNNAME_NOT_LIST = {"create_by", "create_time", "del_flag", "update_by", + "update_time", "version"}; + + /** + * BO对象 不需要查询字段 + */ + String[] COLUMNNAME_NOT_QUERY = {"id", "create_by", "create_time", "del_flag", "update_by", + "update_time", "remark", "version"}; + + /** + * Entity基类字段 + */ + String[] BASE_ENTITY = {"createBy", "createTime", "updateBy", "updateTime"}; + + /** + * Tree基类字段 + */ + String[] TREE_ENTITY = {"parentName", "parentId", "children"}; + + /** + * 文本框 + */ + String HTML_INPUT = "input"; + + /** + * 文本域 + */ + String HTML_TEXTAREA = "textarea"; + + /** + * 下拉框 + */ + String HTML_SELECT = "select"; + + /** + * 单选框 + */ + String HTML_RADIO = "radio"; + + /** + * 复选框 + */ + String HTML_CHECKBOX = "checkbox"; + + /** + * 日期控件 + */ + String HTML_DATETIME = "datetime"; + + /** + * 图片上传控件 + */ + String HTML_IMAGE_UPLOAD = "imageUpload"; + + /** + * 文件上传控件 + */ + String HTML_FILE_UPLOAD = "fileUpload"; + + /** + * 富文本控件 + */ + String HTML_EDITOR = "editor"; + + /** + * 字符串类型 + */ + String TYPE_STRING = "String"; + + /** + * 整型 + */ + String TYPE_INTEGER = "Integer"; + + /** + * 长整型 + */ + String TYPE_LONG = "Long"; + + /** + * 浮点型 + */ + String TYPE_DOUBLE = "Double"; + + /** + * 高精度计算类型 + */ + String TYPE_BIGDECIMAL = "BigDecimal"; + + /** + * 时间类型 + */ + String TYPE_DATE = "Date"; + + /** + * 模糊查询 + */ + String QUERY_LIKE = "LIKE"; + + /** + * 相等查询 + */ + String QUERY_EQ = "EQ"; + + /** + * 需要 + */ + String REQUIRE = "1"; +} diff --git a/ruoyi-modules/ruoyi-generator/src/main/java/com/ruoyi/generator/controller/GenController.java b/ruoyi-modules/ruoyi-generator/src/main/java/com/ruoyi/generator/controller/GenController.java new file mode 100644 index 0000000..e038041 --- /dev/null +++ b/ruoyi-modules/ruoyi-generator/src/main/java/com/ruoyi/generator/controller/GenController.java @@ -0,0 +1,207 @@ +package com.ruoyi.generator.controller; + +import cn.dev33.satoken.annotation.SaCheckPermission; +import cn.hutool.core.convert.Convert; +import cn.hutool.core.io.IoUtil; +import com.rouyi.common.mybatis.core.page.PageQuery; +import com.rouyi.common.mybatis.core.page.TableDataInfo; +import com.ruoyi.common.core.domain.R; +import com.ruoyi.common.log.annotation.Log; +import com.ruoyi.common.log.enums.BusinessType; +import com.ruoyi.common.web.core.BaseController; +import com.ruoyi.generator.domain.GenTable; +import com.ruoyi.generator.domain.GenTableColumn; +import com.ruoyi.generator.service.IGenTableService; +import jakarta.servlet.http.HttpServletResponse; +import lombok.RequiredArgsConstructor; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.*; + +import java.io.IOException; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +/** + * 代码生成 操作处理 + * + * @author Lion Li + */ +@Validated +@RequiredArgsConstructor +@RestController +@RequestMapping("/tool/gen") +public class GenController extends BaseController { + + private final IGenTableService genTableService; + + /** + * 查询代码生成列表 + */ + @SaCheckPermission("tool:gen:list") + @GetMapping("/list") + public TableDataInfo genList(GenTable genTable, PageQuery pageQuery) { + return genTableService.selectPageGenTableList(genTable, pageQuery); + } + + /** + * 修改代码生成业务 + * + * @param tableId 表ID + */ + @SaCheckPermission("tool:gen:query") + @GetMapping(value = "/{tableId}") + public R> getInfo(@PathVariable Long tableId) { + GenTable table = genTableService.selectGenTableById(tableId); + List tables = genTableService.selectGenTableAll(); + List list = genTableService.selectGenTableColumnListByTableId(tableId); + Map map = new HashMap(); + map.put("info", table); + map.put("rows", list); + map.put("tables", tables); + return R.ok(map); + } + + /** + * 查询数据库列表 + */ + @SaCheckPermission("tool:gen:list") + @GetMapping("/db/list") + public TableDataInfo dataList(GenTable genTable, PageQuery pageQuery) { + return genTableService.selectPageDbTableList(genTable, pageQuery); + } + + /** + * 查询数据表字段列表 + * + * @param tableId 表ID + */ + @SaCheckPermission("tool:gen:list") + @GetMapping(value = "/column/{tableId}") + public TableDataInfo columnList(@PathVariable("tableId") Long tableId) { + TableDataInfo dataInfo = new TableDataInfo<>(); + List list = genTableService.selectGenTableColumnListByTableId(tableId); + dataInfo.setRows(list); + dataInfo.setTotal(list.size()); + return dataInfo; + } + + /** + * 导入表结构(保存) + * + * @param tables 表名串 + */ + @SaCheckPermission("tool:gen:import") + @Log(title = "代码生成", businessType = BusinessType.IMPORT) + @PostMapping("/importTable") + public R importTableSave(String tables) { + String[] tableNames = Convert.toStrArray(tables); + // 查询表信息 + List tableList = genTableService.selectDbTableListByNames(tableNames); + genTableService.importGenTable(tableList); + return R.ok(); + } + + /** + * 修改保存代码生成业务 + */ + @SaCheckPermission("tool:gen:edit") + @Log(title = "代码生成", businessType = BusinessType.UPDATE) + @PutMapping + public R editSave(@Validated @RequestBody GenTable genTable) { + genTableService.validateEdit(genTable); + genTableService.updateGenTable(genTable); + return R.ok(); + } + + /** + * 删除代码生成 + * + * @param tableIds 表ID串 + */ + @SaCheckPermission("tool:gen:remove") + @Log(title = "代码生成", businessType = BusinessType.DELETE) + @DeleteMapping("/{tableIds}") + public R remove(@PathVariable Long[] tableIds) { + genTableService.deleteGenTableByIds(tableIds); + return R.ok(); + } + + /** + * 预览代码 + * + * @param tableId 表ID + */ + @SaCheckPermission("tool:gen:preview") + @GetMapping("/preview/{tableId}") + public R> preview(@PathVariable("tableId") Long tableId) throws IOException { + Map dataMap = genTableService.previewCode(tableId); + return R.ok(dataMap); + } + + /** + * 生成代码(下载方式) + * + * @param tableName 表名 + */ + @SaCheckPermission("tool:gen:code") + @Log(title = "代码生成", businessType = BusinessType.GENCODE) + @GetMapping("/download/{tableName}") + public void download(HttpServletResponse response, @PathVariable("tableName") String tableName) throws IOException { + byte[] data = genTableService.downloadCode(tableName); + genCode(response, data); + } + + /** + * 生成代码(自定义路径) + * + * @param tableName 表名 + */ + @SaCheckPermission("tool:gen:code") + @Log(title = "代码生成", businessType = BusinessType.GENCODE) + @GetMapping("/genCode/{tableName}") + public R genCode(@PathVariable("tableName") String tableName) { + genTableService.generatorCode(tableName); + return R.ok(); + } + + /** + * 同步数据库 + * + * @param tableName 表名 + */ + @SaCheckPermission("tool:gen:edit") + @Log(title = "代码生成", businessType = BusinessType.UPDATE) + @GetMapping("/synchDb/{tableName}") + public R synchDb(@PathVariable("tableName") String tableName) { + genTableService.synchDb(tableName); + return R.ok(); + } + + /** + * 批量生成代码 + * + * @param tables 表名串 + */ + @SaCheckPermission("tool:gen:code") + @Log(title = "代码生成", businessType = BusinessType.GENCODE) + @GetMapping("/batchGenCode") + public void batchGenCode(HttpServletResponse response, String tables) throws IOException { + String[] tableNames = Convert.toStrArray(tables); + byte[] data = genTableService.downloadCode(tableNames); + genCode(response, data); + } + + /** + * 生成zip文件 + */ + private void genCode(HttpServletResponse response, byte[] data) throws IOException { + response.reset(); + response.addHeader("Access-Control-Allow-Origin", "*"); + response.addHeader("Access-Control-Expose-Headers", "Content-Disposition"); + response.setHeader("Content-Disposition", "attachment; filename=\"ruoyi.zip\""); + response.addHeader("Content-Length", "" + data.length); + response.setContentType("application/octet-stream; charset=UTF-8"); + IoUtil.write(response.getOutputStream(), false, data); + } +} diff --git a/ruoyi-modules/ruoyi-generator/src/main/java/com/ruoyi/generator/domain/GenTable.java b/ruoyi-modules/ruoyi-generator/src/main/java/com/ruoyi/generator/domain/GenTable.java new file mode 100644 index 0000000..86339e0 --- /dev/null +++ b/ruoyi-modules/ruoyi-generator/src/main/java/com/ruoyi/generator/domain/GenTable.java @@ -0,0 +1,206 @@ +package com.ruoyi.generator.domain; + +import com.baomidou.mybatisplus.annotation.*; +import com.ruoyi.generator.constant.GenConstants; +import com.rouyi.common.mybatis.core.domain.BaseEntity; +import com.ruoyi.common.core.utils.StringUtils; +import lombok.Data; +import lombok.EqualsAndHashCode; +import org.apache.commons.lang3.ArrayUtils; + +import jakarta.validation.Valid; +import jakarta.validation.constraints.NotBlank; +import java.util.List; + +/** + * 业务表 gen_table + * + * @author Lion Li + */ + +@Data +@EqualsAndHashCode(callSuper = true) +@TableName("gen_table") +public class GenTable extends BaseEntity { + + /** + * 编号 + */ + @TableId(value = "table_id") + private Long tableId; + + /** + * 表名称 + */ + @NotBlank(message = "表名称不能为空") + private String tableName; + + /** + * 表描述 + */ + @NotBlank(message = "表描述不能为空") + private String tableComment; + + /** + * 关联父表的表名 + */ + private String subTableName; + + /** + * 本表关联父表的外键名 + */ + private String subTableFkName; + + /** + * 实体类名称(首字母大写) + */ + @NotBlank(message = "实体类名称不能为空") + private String className; + + /** + * 使用的模板(crud单表操作 tree树表操作 sub主子表操作) + */ + private String tplCategory; + + /** + * 生成包路径 + */ + @NotBlank(message = "生成包路径不能为空") + private String packageName; + + /** + * 生成模块名 + */ + @NotBlank(message = "生成模块名不能为空") + private String moduleName; + + /** + * 生成业务名 + */ + @NotBlank(message = "生成业务名不能为空") + private String businessName; + + /** + * 生成功能名 + */ + @NotBlank(message = "生成功能名不能为空") + private String functionName; + + /** + * 生成作者 + */ + @NotBlank(message = "作者不能为空") + private String functionAuthor; + + /** + * 生成代码方式(0zip压缩包 1自定义路径) + */ + private String genType; + + /** + * 生成路径(不填默认项目路径) + */ + @TableField(updateStrategy = FieldStrategy.NOT_EMPTY) + private String genPath; + + /** + * 主键信息 + */ + @TableField(exist = false) + private GenTableColumn pkColumn; + + /** + * 子表信息 + */ + @TableField(exist = false) + private GenTable subTable; + + /** + * 表列信息 + */ + @Valid + @TableField(exist = false) + private List columns; + + /** + * 其它生成选项 + */ + private String options; + + /** + * 备注 + */ + private String remark; + + /** + * 树编码字段 + */ + @TableField(exist = false) + private String treeCode; + + /** + * 树父编码字段 + */ + @TableField(exist = false) + private String treeParentCode; + + /** + * 树名称字段 + */ + @TableField(exist = false) + private String treeName; + + /* + * 菜单id列表 + */ + @TableField(exist = false) + private List menuIds; + + /** + * 上级菜单ID字段 + */ + @TableField(exist = false) + private String parentMenuId; + + /** + * 上级菜单名称字段 + */ + @TableField(exist = false) + private String parentMenuName; + + public boolean isSub() { + return isSub(this.tplCategory); + } + + public static boolean isSub(String tplCategory) { + return tplCategory != null && StringUtils.equals(GenConstants.TPL_SUB, tplCategory); + } + + public boolean isTree() { + return isTree(this.tplCategory); + } + + public static boolean isTree(String tplCategory) { + return tplCategory != null && StringUtils.equals(GenConstants.TPL_TREE, tplCategory); + } + + public boolean isCrud() { + return isCrud(this.tplCategory); + } + + public static boolean isCrud(String tplCategory) { + return tplCategory != null && StringUtils.equals(GenConstants.TPL_CRUD, tplCategory); + } + + public boolean isSuperColumn(String javaField) { + return isSuperColumn(this.tplCategory, javaField); + } + + public static boolean isSuperColumn(String tplCategory, String javaField) { + if (isTree(tplCategory)) { + return StringUtils.equalsAnyIgnoreCase(javaField, + ArrayUtils.addAll(GenConstants.TREE_ENTITY, GenConstants.BASE_ENTITY)); + } + return StringUtils.equalsAnyIgnoreCase(javaField, GenConstants.BASE_ENTITY); + } +} diff --git a/ruoyi-modules/ruoyi-generator/src/main/java/com/ruoyi/generator/domain/GenTableColumn.java b/ruoyi-modules/ruoyi-generator/src/main/java/com/ruoyi/generator/domain/GenTableColumn.java new file mode 100644 index 0000000..414c616 --- /dev/null +++ b/ruoyi-modules/ruoyi-generator/src/main/java/com/ruoyi/generator/domain/GenTableColumn.java @@ -0,0 +1,223 @@ +package com.ruoyi.generator.domain; + +import com.baomidou.mybatisplus.annotation.FieldStrategy; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import com.rouyi.common.mybatis.core.domain.BaseEntity; +import com.ruoyi.common.core.utils.StringUtils; +import lombok.Data; +import lombok.EqualsAndHashCode; +import org.apache.ibatis.type.JdbcType; + +import jakarta.validation.constraints.NotBlank; + +/** + * 代码生成业务字段表 gen_table_column + * + * @author Lion Li + */ + +@Data +@EqualsAndHashCode(callSuper = true) +@TableName("gen_table_column") +public class GenTableColumn extends BaseEntity { + + /** + * 编号 + */ + @TableId(value = "column_id") + private Long columnId; + + /** + * 归属表编号 + */ + private Long tableId; + + /** + * 列名称 + */ + private String columnName; + + /** + * 列描述 + */ + @TableField(updateStrategy = FieldStrategy.IGNORED, jdbcType = JdbcType.VARCHAR) + private String columnComment; + + /** + * 列类型 + */ + private String columnType; + + /** + * JAVA类型 + */ + private String javaType; + + /** + * JAVA字段名 + */ + @NotBlank(message = "Java属性不能为空") + private String javaField; + + /** + * 是否主键(1是) + */ + @TableField(updateStrategy = FieldStrategy.IGNORED, jdbcType = JdbcType.VARCHAR) + private String isPk; + + /** + * 是否自增(1是) + */ + @TableField(updateStrategy = FieldStrategy.IGNORED, jdbcType = JdbcType.VARCHAR) + private String isIncrement; + + /** + * 是否必填(1是) + */ + @TableField(updateStrategy = FieldStrategy.IGNORED, jdbcType = JdbcType.VARCHAR) + private String isRequired; + + /** + * 是否为插入字段(1是) + */ + @TableField(updateStrategy = FieldStrategy.IGNORED, jdbcType = JdbcType.VARCHAR) + private String isInsert; + + /** + * 是否编辑字段(1是) + */ + @TableField(updateStrategy = FieldStrategy.IGNORED, jdbcType = JdbcType.VARCHAR) + private String isEdit; + + /** + * 是否列表字段(1是) + */ + @TableField(updateStrategy = FieldStrategy.IGNORED, jdbcType = JdbcType.VARCHAR) + private String isList; + + /** + * 是否查询字段(1是) + */ + @TableField(updateStrategy = FieldStrategy.IGNORED, jdbcType = JdbcType.VARCHAR) + private String isQuery; + + /** + * 查询方式(EQ等于、NE不等于、GT大于、LT小于、LIKE模糊、BETWEEN范围) + */ + private String queryType; + + /** + * 显示类型(input文本框、textarea文本域、select下拉框、checkbox复选框、radio单选框、datetime日期控件、image图片上传控件、upload文件上传控件、editor富文本控件) + */ + private String htmlType; + + /** + * 字典类型 + */ + private String dictType; + + /** + * 排序 + */ + private Integer sort; + + public String getCapJavaField() { + return StringUtils.capitalize(javaField); + } + + public boolean isPk() { + return isPk(this.isPk); + } + + public boolean isPk(String isPk) { + return isPk != null && StringUtils.equals("1", isPk); + } + + public boolean isIncrement() { + return isIncrement(this.isIncrement); + } + + public boolean isIncrement(String isIncrement) { + return isIncrement != null && StringUtils.equals("1", isIncrement); + } + + public boolean isRequired() { + return isRequired(this.isRequired); + } + + public boolean isRequired(String isRequired) { + return isRequired != null && StringUtils.equals("1", isRequired); + } + + public boolean isInsert() { + return isInsert(this.isInsert); + } + + public boolean isInsert(String isInsert) { + return isInsert != null && StringUtils.equals("1", isInsert); + } + + public boolean isEdit() { + return isInsert(this.isEdit); + } + + public boolean isEdit(String isEdit) { + return isEdit != null && StringUtils.equals("1", isEdit); + } + + public boolean isList() { + return isList(this.isList); + } + + public boolean isList(String isList) { + return isList != null && StringUtils.equals("1", isList); + } + + public boolean isQuery() { + return isQuery(this.isQuery); + } + + public boolean isQuery(String isQuery) { + return isQuery != null && StringUtils.equals("1", isQuery); + } + + public boolean isSuperColumn() { + return isSuperColumn(this.javaField); + } + + public static boolean isSuperColumn(String javaField) { + return StringUtils.equalsAnyIgnoreCase(javaField, + // BaseEntity + "createBy", "createTime", "updateBy", "updateTime", + // TreeEntity + "parentName", "parentId"); + } + + public boolean isUsableColumn() { + return isUsableColumn(javaField); + } + + public static boolean isUsableColumn(String javaField) { + // isSuperColumn()中的名单用于避免生成多余Domain属性,若某些属性在生成页面时需要用到不能忽略,则放在此处白名单 + return StringUtils.equalsAnyIgnoreCase(javaField, "parentId", "orderNum", "remark"); + } + + public String readConverterExp() { + String remarks = StringUtils.substringBetween(this.columnComment, "(", ")"); + StringBuffer sb = new StringBuffer(); + if (StringUtils.isNotEmpty(remarks)) { + for (String value : remarks.split(" ")) { + if (StringUtils.isNotEmpty(value)) { + Object startStr = value.subSequence(0, 1); + String endStr = value.substring(1); + sb.append(StringUtils.EMPTY).append(startStr).append("=").append(endStr).append(StringUtils.SEPARATOR); + } + } + return sb.deleteCharAt(sb.length() - 1).toString(); + } else { + return this.columnComment; + } + } +} diff --git a/ruoyi-modules/ruoyi-generator/src/main/java/com/ruoyi/generator/mapper/GenTableColumnMapper.java b/ruoyi-modules/ruoyi-generator/src/main/java/com/ruoyi/generator/mapper/GenTableColumnMapper.java new file mode 100644 index 0000000..9c0ac48 --- /dev/null +++ b/ruoyi-modules/ruoyi-generator/src/main/java/com/ruoyi/generator/mapper/GenTableColumnMapper.java @@ -0,0 +1,24 @@ +package com.ruoyi.generator.mapper; + +import com.baomidou.mybatisplus.annotation.InterceptorIgnore; +import com.rouyi.common.mybatis.core.mapper.BaseMapperPlus; +import com.ruoyi.generator.domain.GenTableColumn; + +import java.util.List; + +/** + * 业务字段 数据层 + * + * @author Lion Li + */ +@InterceptorIgnore(dataPermission = "true") +public interface GenTableColumnMapper extends BaseMapperPlus { + /** + * 根据表名称查询列信息 + * + * @param tableName 表名称 + * @return 列信息 + */ + List selectDbTableColumnsByName(String tableName); + +} diff --git a/ruoyi-modules/ruoyi-generator/src/main/java/com/ruoyi/generator/mapper/GenTableMapper.java b/ruoyi-modules/ruoyi-generator/src/main/java/com/ruoyi/generator/mapper/GenTableMapper.java new file mode 100644 index 0000000..0b31c15 --- /dev/null +++ b/ruoyi-modules/ruoyi-generator/src/main/java/com/ruoyi/generator/mapper/GenTableMapper.java @@ -0,0 +1,58 @@ +package com.ruoyi.generator.mapper; + +import com.baomidou.mybatisplus.annotation.InterceptorIgnore; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.rouyi.common.mybatis.core.mapper.BaseMapperPlus; +import com.ruoyi.generator.domain.GenTable; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +/** + * 业务 数据层 + * + * @author Lion Li + */ +@InterceptorIgnore(dataPermission = "true") +public interface GenTableMapper extends BaseMapperPlus { + + /** + * 查询据库列表 + * + * @param genTable 查询条件 + * @return 数据库表集合 + */ + Page selectPageDbTableList(@Param("page") Page page, @Param("genTable") GenTable genTable); + + /** + * 查询据库列表 + * + * @param tableNames 表名称组 + * @return 数据库表集合 + */ + List selectDbTableListByNames(String[] tableNames); + + /** + * 查询所有表信息 + * + * @return 表信息集合 + */ + List selectGenTableAll(); + + /** + * 查询表ID业务信息 + * + * @param id 业务ID + * @return 业务信息 + */ + GenTable selectGenTableById(Long id); + + /** + * 查询表名称业务信息 + * + * @param tableName 表名称 + * @return 业务信息 + */ + GenTable selectGenTableByName(String tableName); + +} diff --git a/ruoyi-modules/ruoyi-generator/src/main/java/com/ruoyi/generator/service/GenTableServiceImpl.java b/ruoyi-modules/ruoyi-generator/src/main/java/com/ruoyi/generator/service/GenTableServiceImpl.java new file mode 100644 index 0000000..51fb127 --- /dev/null +++ b/ruoyi-modules/ruoyi-generator/src/main/java/com/ruoyi/generator/service/GenTableServiceImpl.java @@ -0,0 +1,493 @@ +package com.ruoyi.generator.service; + +import cn.hutool.core.collection.CollUtil; +import cn.hutool.core.io.IoUtil; +import cn.hutool.core.lang.Dict; +import cn.hutool.core.util.ObjectUtil; +import com.baomidou.dynamic.datasource.annotation.DS; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.incrementer.IdentifierGenerator; +import com.baomidou.mybatisplus.core.toolkit.Wrappers; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.ruoyi.common.core.constant.Constants; +import com.ruoyi.generator.constant.GenConstants; +import com.rouyi.common.mybatis.core.page.TableDataInfo; +import com.rouyi.common.mybatis.core.page.PageQuery; +import com.ruoyi.common.core.exception.ServiceException; +import com.ruoyi.common.json.utils.JsonUtils; +import com.ruoyi.common.core.utils.StreamUtils; +import com.ruoyi.common.core.utils.StringUtils; +import com.ruoyi.common.core.utils.file.FileUtils; +import com.ruoyi.common.satoken.utils.LoginHelper; +import com.ruoyi.generator.domain.GenTable; +import com.ruoyi.generator.domain.GenTableColumn; +import com.ruoyi.generator.mapper.GenTableColumnMapper; +import com.ruoyi.generator.mapper.GenTableMapper; +import com.ruoyi.generator.util.GenUtils; +import com.ruoyi.generator.util.VelocityInitializer; +import com.ruoyi.generator.util.VelocityUtils; +import lombok.RequiredArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.apache.velocity.Template; +import org.apache.velocity.VelocityContext; +import org.apache.velocity.app.Velocity; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.io.ByteArrayOutputStream; +import java.io.File; +import java.io.IOException; +import java.io.StringWriter; +import java.nio.charset.StandardCharsets; +import java.util.*; +import java.util.zip.ZipEntry; +import java.util.zip.ZipOutputStream; + +/** + * 业务 服务层实现 + * + * @author Lion Li + */ +@DS("#header.datasource") +@Slf4j +@RequiredArgsConstructor +@Service +public class GenTableServiceImpl implements IGenTableService { + + private final GenTableMapper baseMapper; + private final GenTableColumnMapper genTableColumnMapper; + private final IdentifierGenerator identifierGenerator; + + /** + * 查询业务字段列表 + * + * @param tableId 业务字段编号 + * @return 业务字段集合 + */ + @Override + public List selectGenTableColumnListByTableId(Long tableId) { + return genTableColumnMapper.selectList(new LambdaQueryWrapper() + .eq(GenTableColumn::getTableId, tableId) + .orderByAsc(GenTableColumn::getSort)); + } + + /** + * 查询业务信息 + * + * @param id 业务ID + * @return 业务信息 + */ + @Override + public GenTable selectGenTableById(Long id) { + GenTable genTable = baseMapper.selectGenTableById(id); + setTableFromOptions(genTable); + return genTable; + } + + @Override + public TableDataInfo selectPageGenTableList(GenTable genTable, PageQuery pageQuery) { + Page page = baseMapper.selectPage(pageQuery.build(), this.buildGenTableQueryWrapper(genTable)); + return TableDataInfo.build(page); + } + + private QueryWrapper buildGenTableQueryWrapper(GenTable genTable) { + Map params = genTable.getParams(); + QueryWrapper wrapper = Wrappers.query(); + wrapper.like(StringUtils.isNotBlank(genTable.getTableName()), "lower(table_name)", StringUtils.lowerCase(genTable.getTableName())) + .like(StringUtils.isNotBlank(genTable.getTableComment()), "lower(table_comment)", StringUtils.lowerCase(genTable.getTableComment())) + .between(params.get("beginTime") != null && params.get("endTime") != null, + "create_time", params.get("beginTime"), params.get("endTime")); + return wrapper; + } + + + @Override + public TableDataInfo selectPageDbTableList(GenTable genTable, PageQuery pageQuery) { + Page page = baseMapper.selectPageDbTableList(pageQuery.build(), genTable); + return TableDataInfo.build(page); + } + + /** + * 查询据库列表 + * + * @param tableNames 表名称组 + * @return 数据库表集合 + */ + @Override + public List selectDbTableListByNames(String[] tableNames) { + return baseMapper.selectDbTableListByNames(tableNames); + } + + /** + * 查询所有表信息 + * + * @return 表信息集合 + */ + @Override + public List selectGenTableAll() { + return baseMapper.selectGenTableAll(); + } + + /** + * 修改业务 + * + * @param genTable 业务信息 + * @return 结果 + */ + @Transactional(rollbackFor = Exception.class) + @Override + public void updateGenTable(GenTable genTable) { + String options = JsonUtils.toJsonString(genTable.getParams()); + genTable.setOptions(options); + int row = baseMapper.updateById(genTable); + if (row > 0) { + for (GenTableColumn cenTableColumn : genTable.getColumns()) { + genTableColumnMapper.updateById(cenTableColumn); + } + } + } + + /** + * 删除业务对象 + * + * @param tableIds 需要删除的数据ID + * @return 结果 + */ + @Transactional(rollbackFor = Exception.class) + @Override + public void deleteGenTableByIds(Long[] tableIds) { + List ids = Arrays.asList(tableIds); + baseMapper.deleteBatchIds(ids); + genTableColumnMapper.delete(new LambdaQueryWrapper().in(GenTableColumn::getTableId, ids)); + } + + /** + * 导入表结构 + * + * @param tableList 导入表列表 + */ + @Transactional(rollbackFor = Exception.class) + @Override + public void importGenTable(List tableList) { + String operName = LoginHelper.getUsername(); + try { + for (GenTable table : tableList) { + String tableName = table.getTableName(); + GenUtils.initTable(table, operName); + int row = baseMapper.insert(table); + if (row > 0) { + // 保存列信息 + List genTableColumns = genTableColumnMapper.selectDbTableColumnsByName(tableName); + List saveColumns = new ArrayList<>(); + for (GenTableColumn column : genTableColumns) { + GenUtils.initColumnField(column, table); + saveColumns.add(column); + } + if (CollUtil.isNotEmpty(saveColumns)) { + genTableColumnMapper.insertBatch(saveColumns); + } + } + } + } catch (Exception e) { + throw new ServiceException("导入失败:" + e.getMessage()); + } + } + + /** + * 预览代码 + * + * @param tableId 表编号 + * @return 预览数据列表 + */ + @Override + public Map previewCode(Long tableId) { + Map dataMap = new LinkedHashMap<>(); + // 查询表信息 + GenTable table = baseMapper.selectGenTableById(tableId); + List menuIds = new ArrayList<>(); + for (int i = 0; i < 6; i++) { + menuIds.add(identifierGenerator.nextId(null).longValue()); + } + table.setMenuIds(menuIds); + // 设置主子表信息 + setSubTable(table); + // 设置主键列信息 + setPkColumn(table); + VelocityInitializer.initVelocity(); + + VelocityContext context = VelocityUtils.prepareContext(table); + + // 获取模板列表 + List templates = VelocityUtils.getTemplateList(table.getTplCategory()); + for (String template : templates) { + // 渲染模板 + StringWriter sw = new StringWriter(); + Template tpl = Velocity.getTemplate(template, Constants.UTF8); + tpl.merge(context, sw); + dataMap.put(template, sw.toString()); + } + return dataMap; + } + + /** + * 生成代码(下载方式) + * + * @param tableName 表名称 + * @return 数据 + */ + @Override + public byte[] downloadCode(String tableName) { + ByteArrayOutputStream outputStream = new ByteArrayOutputStream(); + ZipOutputStream zip = new ZipOutputStream(outputStream); + generatorCode(tableName, zip); + IoUtil.close(zip); + return outputStream.toByteArray(); + } + + /** + * 生成代码(自定义路径) + * + * @param tableName 表名称 + */ + @Override + public void generatorCode(String tableName) { + // 查询表信息 + GenTable table = baseMapper.selectGenTableByName(tableName); + // 设置主子表信息 + setSubTable(table); + // 设置主键列信息 + setPkColumn(table); + + VelocityInitializer.initVelocity(); + + VelocityContext context = VelocityUtils.prepareContext(table); + + // 获取模板列表 + List templates = VelocityUtils.getTemplateList(table.getTplCategory()); + for (String template : templates) { + if (!StringUtils.containsAny(template, "sql.vm", "api.js.vm", "index.vue.vm", "index-tree.vue.vm")) { + // 渲染模板 + StringWriter sw = new StringWriter(); + Template tpl = Velocity.getTemplate(template, Constants.UTF8); + tpl.merge(context, sw); + try { + String path = getGenPath(table, template); + FileUtils.writeUtf8String(sw.toString(), path); + } catch (Exception e) { + throw new ServiceException("渲染模板失败,表名:" + table.getTableName()); + } + } + } + } + + /** + * 同步数据库 + * + * @param tableName 表名称 + */ + @Transactional(rollbackFor = Exception.class) + @Override + public void synchDb(String tableName) { + GenTable table = baseMapper.selectGenTableByName(tableName); + List tableColumns = table.getColumns(); + Map tableColumnMap = StreamUtils.toIdentityMap(tableColumns, GenTableColumn::getColumnName); + + List dbTableColumns = genTableColumnMapper.selectDbTableColumnsByName(tableName); + if (CollUtil.isEmpty(dbTableColumns)) { + throw new ServiceException("同步数据失败,原表结构不存在"); + } + List dbTableColumnNames = StreamUtils.toList(dbTableColumns, GenTableColumn::getColumnName); + + List saveColumns = new ArrayList<>(); + dbTableColumns.forEach(column -> { + GenUtils.initColumnField(column, table); + if (tableColumnMap.containsKey(column.getColumnName())) { + GenTableColumn prevColumn = tableColumnMap.get(column.getColumnName()); + column.setColumnId(prevColumn.getColumnId()); + if (column.isList()) { + // 如果是列表,继续保留查询方式/字典类型选项 + column.setDictType(prevColumn.getDictType()); + column.setQueryType(prevColumn.getQueryType()); + } + if (StringUtils.isNotEmpty(prevColumn.getIsRequired()) && !column.isPk() + && (column.isInsert() || column.isEdit()) + && ((column.isUsableColumn()) || (!column.isSuperColumn()))) { + // 如果是(新增/修改&非主键/非忽略及父属性),继续保留必填/显示类型选项 + column.setIsRequired(prevColumn.getIsRequired()); + column.setHtmlType(prevColumn.getHtmlType()); + } + } + saveColumns.add(column); + }); + if (CollUtil.isNotEmpty(saveColumns)) { + genTableColumnMapper.insertOrUpdateBatch(saveColumns); + } + List delColumns = StreamUtils.filter(tableColumns, column -> !dbTableColumnNames.contains(column.getColumnName())); + if (CollUtil.isNotEmpty(delColumns)) { + List ids = StreamUtils.toList(delColumns, GenTableColumn::getColumnId); + genTableColumnMapper.deleteBatchIds(ids); + } + } + + /** + * 批量生成代码(下载方式) + * + * @param tableNames 表数组 + * @return 数据 + */ + @Override + public byte[] downloadCode(String[] tableNames) { + ByteArrayOutputStream outputStream = new ByteArrayOutputStream(); + ZipOutputStream zip = new ZipOutputStream(outputStream); + for (String tableName : tableNames) { + generatorCode(tableName, zip); + } + IoUtil.close(zip); + return outputStream.toByteArray(); + } + + /** + * 查询表信息并生成代码 + */ + private void generatorCode(String tableName, ZipOutputStream zip) { + // 查询表信息 + GenTable table = baseMapper.selectGenTableByName(tableName); + List menuIds = new ArrayList<>(); + for (int i = 0; i < 6; i++) { + menuIds.add(identifierGenerator.nextId(null).longValue()); + } + table.setMenuIds(menuIds); + // 设置主子表信息 + setSubTable(table); + // 设置主键列信息 + setPkColumn(table); + + VelocityInitializer.initVelocity(); + + VelocityContext context = VelocityUtils.prepareContext(table); + + // 获取模板列表 + List templates = VelocityUtils.getTemplateList(table.getTplCategory()); + for (String template : templates) { + // 渲染模板 + StringWriter sw = new StringWriter(); + Template tpl = Velocity.getTemplate(template, Constants.UTF8); + tpl.merge(context, sw); + try { + // 添加到zip + zip.putNextEntry(new ZipEntry(VelocityUtils.getFileName(template, table))); + IoUtil.write(zip, StandardCharsets.UTF_8, false, sw.toString()); + IoUtil.close(sw); + zip.flush(); + zip.closeEntry(); + } catch (IOException e) { + log.error("渲染模板失败,表名:" + table.getTableName(), e); + } + } + } + + /** + * 修改保存参数校验 + * + * @param genTable 业务信息 + */ + @Override + public void validateEdit(GenTable genTable) { + if (GenConstants.TPL_TREE.equals(genTable.getTplCategory())) { + String options = JsonUtils.toJsonString(genTable.getParams()); + Dict paramsObj = JsonUtils.parseMap(options); + if (StringUtils.isEmpty(paramsObj.getStr(GenConstants.TREE_CODE))) { + throw new ServiceException("树编码字段不能为空"); + } else if (StringUtils.isEmpty(paramsObj.getStr(GenConstants.TREE_PARENT_CODE))) { + throw new ServiceException("树父编码字段不能为空"); + } else if (StringUtils.isEmpty(paramsObj.getStr(GenConstants.TREE_NAME))) { + throw new ServiceException("树名称字段不能为空"); + } else if (GenConstants.TPL_SUB.equals(genTable.getTplCategory())) { + if (StringUtils.isEmpty(genTable.getSubTableName())) { + throw new ServiceException("关联子表的表名不能为空"); + } else if (StringUtils.isEmpty(genTable.getSubTableFkName())) { + throw new ServiceException("子表关联的外键名不能为空"); + } + } + } + } + + /** + * 设置主键列信息 + * + * @param table 业务表信息 + */ + public void setPkColumn(GenTable table) { + for (GenTableColumn column : table.getColumns()) { + if (column.isPk()) { + table.setPkColumn(column); + break; + } + } + if (ObjectUtil.isNull(table.getPkColumn())) { + table.setPkColumn(table.getColumns().get(0)); + } + if (GenConstants.TPL_SUB.equals(table.getTplCategory())) { + for (GenTableColumn column : table.getSubTable().getColumns()) { + if (column.isPk()) { + table.getSubTable().setPkColumn(column); + break; + } + } + if (ObjectUtil.isNull(table.getSubTable().getPkColumn())) { + table.getSubTable().setPkColumn(table.getSubTable().getColumns().get(0)); + } + } + } + + /** + * 设置主子表信息 + * + * @param table 业务表信息 + */ + public void setSubTable(GenTable table) { + String subTableName = table.getSubTableName(); + if (StringUtils.isNotEmpty(subTableName)) { + table.setSubTable(baseMapper.selectGenTableByName(subTableName)); + } + } + + /** + * 设置代码生成其他选项值 + * + * @param genTable 设置后的生成对象 + */ + public void setTableFromOptions(GenTable genTable) { + Dict paramsObj = JsonUtils.parseMap(genTable.getOptions()); + if (ObjectUtil.isNotNull(paramsObj)) { + String treeCode = paramsObj.getStr(GenConstants.TREE_CODE); + String treeParentCode = paramsObj.getStr(GenConstants.TREE_PARENT_CODE); + String treeName = paramsObj.getStr(GenConstants.TREE_NAME); + String parentMenuId = paramsObj.getStr(GenConstants.PARENT_MENU_ID); + String parentMenuName = paramsObj.getStr(GenConstants.PARENT_MENU_NAME); + + genTable.setTreeCode(treeCode); + genTable.setTreeParentCode(treeParentCode); + genTable.setTreeName(treeName); + genTable.setParentMenuId(parentMenuId); + genTable.setParentMenuName(parentMenuName); + } + } + + /** + * 获取代码生成地址 + * + * @param table 业务表信息 + * @param template 模板文件路径 + * @return 生成地址 + */ + public static String getGenPath(GenTable table, String template) { + String genPath = table.getGenPath(); + if (StringUtils.equals(genPath, "/")) { + return System.getProperty("user.dir") + File.separator + "src" + File.separator + VelocityUtils.getFileName(template, table); + } + return genPath + File.separator + VelocityUtils.getFileName(template, table); + } +} + diff --git a/ruoyi-generator/src/main/java/com/ruoyi/generator/service/IGenTableService.java b/ruoyi-modules/ruoyi-generator/src/main/java/com/ruoyi/generator/service/IGenTableService.java similarity index 55% rename from ruoyi-generator/src/main/java/com/ruoyi/generator/service/IGenTableService.java rename to ruoyi-modules/ruoyi-generator/src/main/java/com/ruoyi/generator/service/IGenTableService.java index ae57f74..fb406a7 100644 --- a/ruoyi-generator/src/main/java/com/ruoyi/generator/service/IGenTableService.java +++ b/ruoyi-modules/ruoyi-generator/src/main/java/com/ruoyi/generator/service/IGenTableService.java @@ -1,123 +1,133 @@ package com.ruoyi.generator.service; +import com.rouyi.common.mybatis.core.page.PageQuery; +import com.rouyi.common.mybatis.core.page.TableDataInfo; +import com.ruoyi.generator.domain.GenTable; +import com.ruoyi.generator.domain.GenTableColumn; + import java.util.List; import java.util.Map; -import com.ruoyi.generator.domain.GenTable; /** * 业务 服务层 - * - * @author ruoyi + * + * @author Lion Li */ -public interface IGenTableService -{ +public interface IGenTableService { + + /** + * 查询业务字段列表 + * + * @param tableId 业务字段编号 + * @return 业务字段集合 + */ + List selectGenTableColumnListByTableId(Long tableId); + /** * 查询业务列表 - * + * * @param genTable 业务信息 * @return 业务集合 */ - public List selectGenTableList(GenTable genTable); + TableDataInfo selectPageGenTableList(GenTable genTable, PageQuery pageQuery); /** * 查询据库列表 - * + * * @param genTable 业务信息 * @return 数据库表集合 */ - public List selectDbTableList(GenTable genTable); + TableDataInfo selectPageDbTableList(GenTable genTable, PageQuery pageQuery); /** * 查询据库列表 - * + * * @param tableNames 表名称组 * @return 数据库表集合 */ - public List selectDbTableListByNames(String[] tableNames); + List selectDbTableListByNames(String[] tableNames); /** * 查询所有表信息 - * + * * @return 表信息集合 */ - public List selectGenTableAll(); + List selectGenTableAll(); /** * 查询业务信息 - * + * * @param id 业务ID * @return 业务信息 */ - public GenTable selectGenTableById(Long id); + GenTable selectGenTableById(Long id); /** * 修改业务 - * + * * @param genTable 业务信息 * @return 结果 */ - public void updateGenTable(GenTable genTable); + void updateGenTable(GenTable genTable); /** * 删除业务信息 - * + * * @param tableIds 需要删除的表数据ID * @return 结果 */ - public void deleteGenTableByIds(Long[] tableIds); + void deleteGenTableByIds(Long[] tableIds); /** * 导入表结构 - * + * * @param tableList 导入表列表 */ - public void importGenTable(List tableList, Long userId); + void importGenTable(List tableList); /** * 预览代码 - * + * * @param tableId 表编号 * @return 预览数据列表 */ - public Map previewCode(Long tableId); + Map previewCode(Long tableId); /** * 生成代码(下载方式) - * + * * @param tableName 表名称 * @return 数据 */ - public byte[] downloadCode(String tableName); + byte[] downloadCode(String tableName); /** * 生成代码(自定义路径) - * + * * @param tableName 表名称 * @return 数据 */ - public void generatorCode(String tableName); + void generatorCode(String tableName); /** * 同步数据库 - * + * * @param tableName 表名称 */ - public void synchDb(String tableName); + void synchDb(String tableName); /** * 批量生成代码(下载方式) - * + * * @param tableNames 表数组 * @return 数据 */ - public byte[] downloadCode(String[] tableNames); + byte[] downloadCode(String[] tableNames); /** * 修改保存参数校验 - * + * * @param genTable 业务信息 */ - public void validateEdit(GenTable genTable); - - List selectGenTableByName(List tableNames); + void validateEdit(GenTable genTable); } diff --git a/ruoyi-generator/src/main/java/com/ruoyi/generator/util/GenUtils.java b/ruoyi-modules/ruoyi-generator/src/main/java/com/ruoyi/generator/util/GenUtils.java similarity index 59% rename from ruoyi-generator/src/main/java/com/ruoyi/generator/util/GenUtils.java rename to ruoyi-modules/ruoyi-generator/src/main/java/com/ruoyi/generator/util/GenUtils.java index 911dc03..68c01f3 100644 --- a/ruoyi-generator/src/main/java/com/ruoyi/generator/util/GenUtils.java +++ b/ruoyi-modules/ruoyi-generator/src/main/java/com/ruoyi/generator/util/GenUtils.java @@ -1,61 +1,35 @@ package com.ruoyi.generator.util; -import cn.hutool.core.util.StrUtil; -import com.ruoyi.common.constant.GenConstants; -import com.ruoyi.common.utils.StringUtils; +import com.ruoyi.generator.constant.GenConstants; +import com.ruoyi.common.core.utils.StringUtils; import com.ruoyi.generator.config.GenConfig; import com.ruoyi.generator.domain.GenTable; import com.ruoyi.generator.domain.GenTableColumn; +import lombok.AccessLevel; +import lombok.NoArgsConstructor; import org.apache.commons.lang3.RegExUtils; import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; /** * 代码生成器 工具类 * * @author ruoyi */ +@NoArgsConstructor(access = AccessLevel.PRIVATE) public class GenUtils { - private static GenConfig genConfig; - public static final Map queryType2Suffix; - static { - queryType2Suffix = new HashMap<>(); - queryType2Suffix.put("BETWEEN", "Range"); - queryType2Suffix.put("NE", "NotEqual"); - queryType2Suffix.put("GT", "GreatThan"); - queryType2Suffix.put("GTE", "GreatThanOrEqual"); - queryType2Suffix.put("LT", "LessThan"); - queryType2Suffix.put("LTE", "LessThanOrEqual"); - queryType2Suffix.put("LIKE", "Like"); - } - public static final Map queryType2Method; - static { - queryType2Method = new HashMap<>(); - queryType2Method.put("EQ", "eq"); - queryType2Method.put("NE", "ne"); - queryType2Method.put("GT", "gt"); - queryType2Method.put("GTE", "ge"); - queryType2Method.put("LT", "lt"); - queryType2Method.put("LTE", "le"); - queryType2Method.put("LIKE", "like"); - } - public static void setGenConfig(GenConfig genConfig) { - GenUtils.genConfig = genConfig; - } /** * 初始化表信息 */ - public static void initTable(GenTable genTable, Long userId) { + public static void initTable(GenTable genTable, String operName) { genTable.setClassName(convertClassName(genTable.getTableName())); - genTable.setPackageName(genConfig.getPackageName()); - genTable.setModuleName(getModuleName(genConfig.getPackageName())); + genTable.setPackageName(GenConfig.getPackageName()); + genTable.setModuleName(getModuleName(GenConfig.getPackageName())); genTable.setBusinessName(getBusinessName(genTable.getTableName())); genTable.setFunctionName(replaceText(genTable.getTableComment())); - genTable.setFunctionAuthor(genConfig.getAuthor()); - genTable.setCreateBy(userId); + genTable.setFunctionAuthor(GenConfig.getAuthor()); + genTable.setCreateBy(operName); } /** @@ -70,45 +44,26 @@ public class GenUtils { column.setJavaField(StringUtils.toCamelCase(columnName)); // 设置默认类型 column.setJavaType(GenConstants.TYPE_STRING); - // 注释为空处理 - if (StringUtils.isEmpty(column.getColumnComment())) { - column.setColumnComment(column.getColumnName().toUpperCase()); - } + column.setQueryType(GenConstants.QUERY_EQ); + if (arraysContains(GenConstants.COLUMNTYPE_STR, dataType) || arraysContains(GenConstants.COLUMNTYPE_TEXT, dataType)) { // 字符串长度超过500设置为文本域 Integer columnLength = getColumnLength(column.getColumnType()); String htmlType = columnLength >= 500 || arraysContains(GenConstants.COLUMNTYPE_TEXT, dataType) ? GenConstants.HTML_TEXTAREA : GenConstants.HTML_INPUT; column.setHtmlType(htmlType); - } else if (StrUtil.equals(dataType, "datetime")) { - column.setJavaType("LocalDateTime"); + } else if (arraysContains(GenConstants.COLUMNTYPE_TIME, dataType)) { + column.setJavaType(GenConstants.TYPE_DATE); column.setHtmlType(GenConstants.HTML_DATETIME); - } else if (StrUtil.equals(dataType, "date")) { - column.setJavaType("LocalDate"); - column.setHtmlType("date"); - } else if (StrUtil.equals(dataType, "time")) { - column.setJavaType("LocalTime"); - column.setHtmlType("time"); - } else if (StrUtil.equals(dataType, "int")) { - column.setJavaType(GenConstants.TYPE_INTEGER); - column.setHtmlType(GenConstants.HTML_INPUT); } else if (arraysContains(GenConstants.COLUMNTYPE_NUMBER, dataType)) { column.setHtmlType(GenConstants.HTML_INPUT); // 如果是浮点型 统一用BigDecimal - String[] str = StringUtils.split(StringUtils.substringBetween(column.getColumnType(), "(", ")"), ","); - if (str == null) { - if (arraysContains(GenConstants.COLUMNTYPE_INT, dataType)) { - column.setJavaType(GenConstants.TYPE_INTEGER); - } else if (arraysContains(GenConstants.COLUMNTYPE_DECIMAL, dataType)) { - column.setJavaType(GenConstants.TYPE_BIGDECIMAL); - } else { - column.setJavaType(GenConstants.TYPE_LONG); - } - } else if (str.length == 2 && Integer.parseInt(str[1]) > 0) { + String[] str = StringUtils.split(StringUtils.substringBetween(column.getColumnType(), "(", ")"), StringUtils.SEPARATOR); + if (str != null && str.length == 2 && Integer.parseInt(str[1]) > 0) { column.setJavaType(GenConstants.TYPE_BIGDECIMAL); } // 如果是整形 - else if (str.length == 1 && Integer.parseInt(str[0]) <= 10) { + else if (str != null && str.length == 1 && Integer.parseInt(str[0]) <= 10) { column.setJavaType(GenConstants.TYPE_INTEGER); } // 长整形 @@ -117,18 +72,23 @@ public class GenUtils { } } - // 插入字段(默认所有字段都需要插入) - column.setIsInsert(GenConstants.REQUIRE); - - // 编辑字段 - if (!arraysContains(GenConstants.COLUMNNAME_NOT_EDIT, columnName) && !column.isPk()) { + // BO对象 默认插入勾选 + if (!arraysContains(GenConstants.COLUMNNAME_NOT_ADD, columnName) && !column.isPk()) { + column.setIsInsert(GenConstants.REQUIRE); + } + // BO对象 默认编辑勾选 + if (!arraysContains(GenConstants.COLUMNNAME_NOT_EDIT, columnName)) { column.setIsEdit(GenConstants.REQUIRE); } - // 列表字段 - if (!arraysContains(GenConstants.COLUMNNAME_NOT_LIST, columnName) && !column.isPk()) { + // BO对象 默认是否必填勾选 + if (!arraysContains(GenConstants.COLUMNNAME_NOT_EDIT, columnName)) { + column.setIsRequired(GenConstants.REQUIRE); + } + // VO对象 默认返回勾选 + if (!arraysContains(GenConstants.COLUMNNAME_NOT_LIST, columnName)) { column.setIsList(GenConstants.REQUIRE); } - // 查询字段 + // BO对象 默认查询勾选 if (!arraysContains(GenConstants.COLUMNNAME_NOT_QUERY, columnName) && !column.isPk()) { column.setIsQuery(GenConstants.REQUIRE); } @@ -143,11 +103,11 @@ public class GenUtils { } // 类型&性别字段设置下拉框 else if (StringUtils.endsWithIgnoreCase(columnName, "type") - || StringUtils.endsWithIgnoreCase(columnName, "sex")) { + || StringUtils.endsWithIgnoreCase(columnName, "sex")) { column.setHtmlType(GenConstants.HTML_SELECT); } // 图片字段设置图片上传控件 - else if (StringUtils.endsWithIgnoreCase(columnName, "image") || StringUtils.endsWithIgnoreCase(columnName, "images") || StringUtils.endsWithIgnoreCase(columnName, "photos")) { + else if (StringUtils.endsWithIgnoreCase(columnName, "image")) { column.setHtmlType(GenConstants.HTML_IMAGE_UPLOAD); } // 文件字段设置文件上传控件 @@ -180,8 +140,7 @@ public class GenUtils { public static String getModuleName(String packageName) { int lastIndex = packageName.lastIndexOf("."); int nameLength = packageName.length(); - String moduleName = StringUtils.substring(packageName, lastIndex + 1, nameLength); - return moduleName; + return StringUtils.substring(packageName, lastIndex + 1, nameLength); } /** @@ -191,13 +150,11 @@ public class GenUtils { * @return 业务名 */ public static String getBusinessName(String tableName) { - boolean autoRemovePre = genConfig.isAutoRemovePre(); - String tablePrefix = genConfig.getTablePrefix(); - if (autoRemovePre && StringUtils.isNotEmpty(tablePrefix)) { - String[] searchList = StringUtils.split(tablePrefix, ","); - tableName = replaceFirst(tableName, searchList); - } - return StringUtils.convertToCamelCase(tableName); + int firstIndex = tableName.indexOf("_"); + int nameLength = tableName.length(); + String businessName = StringUtils.substring(tableName, firstIndex + 1, nameLength); + businessName = StringUtils.toCamelCase(businessName); + return businessName; } /** @@ -207,10 +164,10 @@ public class GenUtils { * @return 类名 */ public static String convertClassName(String tableName) { - boolean autoRemovePre = genConfig.isAutoRemovePre(); - String tablePrefix = genConfig.getTablePrefix(); + boolean autoRemovePre = GenConfig.getAutoRemovePre(); + String tablePrefix = GenConfig.getTablePrefix(); if (autoRemovePre && StringUtils.isNotEmpty(tablePrefix)) { - String[] searchList = StringUtils.split(tablePrefix, ","); + String[] searchList = StringUtils.split(tablePrefix, StringUtils.SEPARATOR); tableName = replaceFirst(tableName, searchList); } return StringUtils.convertToCamelCase(tableName); @@ -227,7 +184,7 @@ public class GenUtils { String text = replacementm; for (String searchString : searchList) { if (replacementm.startsWith(searchString)) { - text = replacementm.replaceFirst(searchString, ""); + text = replacementm.replaceFirst(searchString, StringUtils.EMPTY); break; } } @@ -241,7 +198,7 @@ public class GenUtils { * @return 替换后的名字 */ public static String replaceText(String text) { - return RegExUtils.replaceAll(text, "(?:若依)", ""); + return RegExUtils.replaceAll(text, "(?:表|若依)", ""); } /** @@ -251,10 +208,8 @@ public class GenUtils { * @return 截取后的列类型 */ public static String getDbType(String columnType) { - if (StringUtils.indexOf(columnType, "(") > 0) { + if (StringUtils.indexOf(columnType, '(') > 0) { return StringUtils.substringBefore(columnType, "("); - } else if (columnType.toLowerCase().endsWith(" unsigned")) { - return columnType.substring(0, columnType.length() - 9).toLowerCase(); } else { return columnType; } @@ -267,7 +222,7 @@ public class GenUtils { * @return 截取后的列类型 */ public static Integer getColumnLength(String columnType) { - if (StringUtils.indexOf(columnType, "(") > 0) { + if (StringUtils.indexOf(columnType, '(') > 0) { String length = StringUtils.substringBetween(columnType, "(", ")"); return Integer.valueOf(length); } else { diff --git a/ruoyi-generator/src/main/java/com/ruoyi/generator/util/VelocityInitializer.java b/ruoyi-modules/ruoyi-generator/src/main/java/com/ruoyi/generator/util/VelocityInitializer.java similarity index 58% rename from ruoyi-generator/src/main/java/com/ruoyi/generator/util/VelocityInitializer.java rename to ruoyi-modules/ruoyi-generator/src/main/java/com/ruoyi/generator/util/VelocityInitializer.java index 2be3fc4..045e303 100644 --- a/ruoyi-generator/src/main/java/com/ruoyi/generator/util/VelocityInitializer.java +++ b/ruoyi-modules/ruoyi-generator/src/main/java/com/ruoyi/generator/util/VelocityInitializer.java @@ -1,35 +1,35 @@ package com.ruoyi.generator.util; -import java.util.Properties; +import com.ruoyi.common.core.constant.Constants; +import lombok.AccessLevel; +import lombok.NoArgsConstructor; import org.apache.velocity.app.Velocity; -import com.ruoyi.common.constant.Constants; + +import java.util.Properties; /** * VelocityEngine工厂 - * + * * @author ruoyi */ -public class VelocityInitializer -{ +@NoArgsConstructor(access = AccessLevel.PRIVATE) +public class VelocityInitializer { + /** * 初始化vm方法 */ - public static void initVelocity() - { + public static void initVelocity() { Properties p = new Properties(); - try - { - // 加载classpath目录下的文件 - p.setProperty("file.resource.loader.class", "org.apache.velocity.runtime.resource.loader.ClasspathResourceLoader"); + try { + // 加载classpath目录下的vm文件 + p.setProperty("resource.loader.file.class", "org.apache.velocity.runtime.resource.loader.ClasspathResourceLoader"); // 定义字符集 p.setProperty(Velocity.INPUT_ENCODING, Constants.UTF8); - p.setProperty(Velocity.OUTPUT_ENCODING, Constants.UTF8); // 初始化Velocity引擎,指定配置Properties Velocity.init(p); - } - catch (Exception e) - { + } catch (Exception e) { throw new RuntimeException(e); } } + } diff --git a/ruoyi-generator/src/main/java/com/ruoyi/generator/util/VelocityUtils.java b/ruoyi-modules/ruoyi-generator/src/main/java/com/ruoyi/generator/util/VelocityUtils.java similarity index 57% rename from ruoyi-generator/src/main/java/com/ruoyi/generator/util/VelocityUtils.java rename to ruoyi-modules/ruoyi-generator/src/main/java/com/ruoyi/generator/util/VelocityUtils.java index 0f3b23e..06bdcb1 100644 --- a/ruoyi-generator/src/main/java/com/ruoyi/generator/util/VelocityUtils.java +++ b/ruoyi-modules/ruoyi-generator/src/main/java/com/ruoyi/generator/util/VelocityUtils.java @@ -1,27 +1,30 @@ package com.ruoyi.generator.util; -import cn.hutool.core.util.StrUtil; -import com.alibaba.fastjson.JSONObject; -import com.ruoyi.common.constant.GenConstants; -import com.ruoyi.common.utils.DateUtils; -import com.ruoyi.common.utils.StringUtils; -import com.ruoyi.generator.config.GenConfig; +import cn.hutool.core.collection.CollUtil; +import cn.hutool.core.convert.Convert; +import cn.hutool.core.lang.Dict; +import cn.hutool.core.util.ObjectUtil; +import com.ruoyi.generator.constant.GenConstants; +import com.rouyi.common.mybatis.helper.DataBaseHelper; +import com.ruoyi.common.core.utils.DateUtils; +import com.ruoyi.common.json.utils.JsonUtils; +import com.ruoyi.common.core.utils.StringUtils; import com.ruoyi.generator.domain.GenTable; import com.ruoyi.generator.domain.GenTableColumn; +import lombok.AccessLevel; +import lombok.NoArgsConstructor; import org.apache.velocity.VelocityContext; -import java.util.ArrayList; -import java.util.HashSet; -import java.util.List; -import java.util.Objects; -import java.util.stream.Collectors; +import java.util.*; /** * 模板处理工具类 * * @author ruoyi */ +@NoArgsConstructor(access = AccessLevel.PRIVATE) public class VelocityUtils { + /** * 项目空间路径 */ @@ -36,11 +39,6 @@ public class VelocityUtils { * 默认上级菜单,系统工具 */ private static final String DEFAULT_PARENT_MENU_ID = "3"; - private static GenConfig genConfig; - - public static void setGenConfig(GenConfig genConfig) { - VelocityUtils.genConfig = genConfig; - } /** * 设置模板变量信息 @@ -53,14 +51,13 @@ public class VelocityUtils { String packageName = genTable.getPackageName(); String tplCategory = genTable.getTplCategory(); String functionName = genTable.getFunctionName(); - String className = StringUtils.uncapitalize(genTable.getClassName()); VelocityContext velocityContext = new VelocityContext(); velocityContext.put("tplCategory", genTable.getTplCategory()); velocityContext.put("tableName", genTable.getTableName()); velocityContext.put("functionName", StringUtils.isNotEmpty(functionName) ? functionName : "【请填写功能名称】"); velocityContext.put("ClassName", genTable.getClassName()); - velocityContext.put("className", className); + velocityContext.put("className", StringUtils.uncapitalize(genTable.getClassName())); velocityContext.put("moduleName", genTable.getModuleName()); velocityContext.put("BusinessName", StringUtils.capitalize(genTable.getBusinessName())); velocityContext.put("businessName", genTable.getBusinessName()); @@ -70,10 +67,8 @@ public class VelocityUtils { velocityContext.put("datetime", DateUtils.getDate()); velocityContext.put("pkColumn", genTable.getPkColumn()); velocityContext.put("importList", getImportList(genTable)); - velocityContext.put("permissionPrefix", getPermissionPrefix(moduleName, className)); - velocityContext.put("rootPermission", genConfig.getRootPermission()); + velocityContext.put("permissionPrefix", getPermissionPrefix(moduleName, businessName)); velocityContext.put("columns", genTable.getColumns()); - velocityContext.put("queryLength", genTable.getColumns().stream().filter(GenTableColumn::isQuery).count()); velocityContext.put("table", genTable); velocityContext.put("dicts", getDicts(genTable)); setMenuVelocityContext(velocityContext, genTable); @@ -88,14 +83,14 @@ public class VelocityUtils { public static void setMenuVelocityContext(VelocityContext context, GenTable genTable) { String options = genTable.getOptions(); - JSONObject paramsObj = JSONObject.parseObject(options); + Dict paramsObj = JsonUtils.parseMap(options); String parentMenuId = getParentMenuId(paramsObj); context.put("parentMenuId", parentMenuId); } public static void setTreeVelocityContext(VelocityContext context, GenTable genTable) { String options = genTable.getOptions(); - JSONObject paramsObj = JSONObject.parseObject(options); + Dict paramsObj = JsonUtils.parseMap(options); String treeCode = getTreecode(paramsObj); String treeParentCode = getTreeParentCode(paramsObj); String treeName = getTreeName(paramsObj); @@ -105,10 +100,10 @@ public class VelocityUtils { context.put("treeName", treeName); context.put("expandColumn", getExpandColumn(genTable)); if (paramsObj.containsKey(GenConstants.TREE_PARENT_CODE)) { - context.put("tree_parent_code", paramsObj.getString(GenConstants.TREE_PARENT_CODE)); + context.put("tree_parent_code", paramsObj.get(GenConstants.TREE_PARENT_CODE)); } if (paramsObj.containsKey(GenConstants.TREE_NAME)) { - context.put("tree_name", paramsObj.getString(GenConstants.TREE_NAME)); + context.put("tree_name", paramsObj.get(GenConstants.TREE_NAME)); } } @@ -135,20 +130,34 @@ public class VelocityUtils { * @return 模板列表 */ public static List getTemplateList(String tplCategory) { - List templates = new ArrayList<>(genConfig.templates); - if (GenConstants.TPL_CRUD.equals(tplCategory) && genConfig.crudTemplates != null) { - templates.addAll(genConfig.crudTemplates); - } else if (GenConstants.TPL_TREE.equals(tplCategory) && genConfig.treeTemplates != null) { - templates.addAll(genConfig.treeTemplates); - } else if (GenConstants.TPL_SUB.equals(tplCategory) && genConfig.subTemplates != null) { - templates.addAll(genConfig.subTemplates); + List templates = new ArrayList(); + templates.add("vm/java/domain.java.vm"); + templates.add("vm/java/vo.java.vm"); + templates.add("vm/java/bo.java.vm"); + templates.add("vm/java/mapper.java.vm"); + templates.add("vm/java/service.java.vm"); + templates.add("vm/java/serviceImpl.java.vm"); + templates.add("vm/java/controller.java.vm"); + templates.add("vm/xml/mapper.xml.vm"); + if (DataBaseHelper.isOracle()) { + templates.add("vm/sql/oracle/sql.vm"); + } else if (DataBaseHelper.isPostgerSql()) { + templates.add("vm/sql/postgres/sql.vm"); + } else if (DataBaseHelper.isSqlServer()) { + templates.add("vm/sql/sqlserver/sql.vm"); + } else { + templates.add("vm/sql/sql.vm"); } - return templates.stream().map(t -> { - if (t.startsWith("./")) { - return t.replace("./", genConfig.templateRootPath + "/"); - } - return t; - }).collect(Collectors.toList()); + templates.add("vm/js/api.js.vm"); + if (GenConstants.TPL_CRUD.equals(tplCategory)) { + templates.add("vm/vue/index.vue.vm"); + } else if (GenConstants.TPL_TREE.equals(tplCategory)) { + templates.add("vm/vue/index-tree.vue.vm"); + } else if (GenConstants.TPL_SUB.equals(tplCategory)) { + templates.add("vm/vue/index.vue.vm"); + templates.add("vm/java/sub-domain.java.vm"); + } + return templates; } /** @@ -164,66 +173,41 @@ public class VelocityUtils { // 大写类名 String className = genTable.getClassName(); // 业务名称 - String businessName = StrUtil.lowerFirst(genTable.getBusinessName()); + String businessName = genTable.getBusinessName(); String javaPath = PROJECT_PATH + "/" + StringUtils.replace(packageName, ".", "/"); String mybatisPath = MYBATIS_PATH + "/" + moduleName; String vuePath = "vue"; if (template.contains("domain.java.vm")) { - return StringUtils.format("{}/domain/{}.java", javaPath, className); + fileName = StringUtils.format("{}/domain/{}.java", javaPath, className); } - - if (template.contains("dto.java.vm")) { - return StringUtils.format("{}/pojo/dto/{}DTO.java", javaPath, className); - } - - if (template.contains("query.java.vm")) { - return StringUtils.format("{}/pojo/query/{}Query.java", javaPath, className); - } - if (template.contains("vo.java.vm")) { - return StringUtils.format("{}/pojo/vo/{}VO.java", javaPath, className); + fileName = StringUtils.format("{}/domain/vo/{}Vo.java", javaPath, className); } - - if (template.contains("convert.java.vm")) { - return StringUtils.format("{}/convert/{}Convert.java", javaPath, className); + if (template.contains("bo.java.vm")) { + fileName = StringUtils.format("{}/domain/bo/{}Bo.java", javaPath, className); } - if (template.contains("sub-domain.java.vm") && StringUtils.equals(GenConstants.TPL_SUB, genTable.getTplCategory())) { - return StringUtils.format("{}/domain/{}.java", javaPath, genTable.getSubTable().getClassName()); - } - - if (template.contains("mapper.java.vm")) { - return StringUtils.format("{}/mapper/{}Mapper.java", javaPath, className); - } - - if (template.contains("service.java.vm")) { - return StringUtils.format("{}/service/{}Service.java", javaPath, className); - } - - if (template.contains("controller.java.vm")) { - return StringUtils.format("{}/controller/{}Controller.java", javaPath, className); - } - - if (template.contains("mapper.xml.vm")) { - return StringUtils.format("{}/{}Mapper.xml", mybatisPath, className); - } - - if (template.contains("sql.vm")) { - return businessName + "Menu.sql"; - } - - if (template.contains("api.js.vm")) { - return StringUtils.format("{}/api/{}/{}.js", vuePath, moduleName, businessName); - } - - if (template.contains("index.vue.vm")) { - return StringUtils.format("{}/views/{}/{}/index.vue", vuePath, moduleName, businessName); - } - - if (template.contains("index-tree.vue.vm")) { - return StringUtils.format("{}/views/{}/{}/index.vue", vuePath, moduleName, businessName); + fileName = StringUtils.format("{}/domain/{}.java", javaPath, genTable.getSubTable().getClassName()); + } else if (template.contains("mapper.java.vm")) { + fileName = StringUtils.format("{}/mapper/{}Mapper.java", javaPath, className); + } else if (template.contains("service.java.vm")) { + fileName = StringUtils.format("{}/service/I{}Service.java", javaPath, className); + } else if (template.contains("serviceImpl.java.vm")) { + fileName = StringUtils.format("{}/service/impl/{}ServiceImpl.java", javaPath, className); + } else if (template.contains("controller.java.vm")) { + fileName = StringUtils.format("{}/controller/{}Controller.java", javaPath, className); + } else if (template.contains("mapper.xml.vm")) { + fileName = StringUtils.format("{}/{}Mapper.xml", mybatisPath, className); + } else if (template.contains("sql.vm")) { + fileName = businessName + "Menu.sql"; + } else if (template.contains("api.js.vm")) { + fileName = StringUtils.format("{}/api/{}/{}.js", vuePath, moduleName, businessName); + } else if (template.contains("index.vue.vm")) { + fileName = StringUtils.format("{}/views/{}/{}/index.vue", vuePath, moduleName, businessName); + } else if (template.contains("index-tree.vue.vm")) { + fileName = StringUtils.format("{}/views/{}/{}/index.vue", vuePath, moduleName, businessName); } return fileName; } @@ -236,8 +220,7 @@ public class VelocityUtils { */ public static String getPackagePrefix(String packageName) { int lastIndex = packageName.lastIndexOf("."); - String basePackage = StringUtils.substring(packageName, 0, lastIndex); - return basePackage; + return StringUtils.substring(packageName, 0, lastIndex); } /** @@ -249,19 +232,15 @@ public class VelocityUtils { public static HashSet getImportList(GenTable genTable) { List columns = genTable.getColumns(); GenTable subGenTable = genTable.getSubTable(); - HashSet importList = new HashSet(); - if (StringUtils.isNotNull(subGenTable)) { + HashSet importList = new HashSet<>(); + if (ObjectUtil.isNotNull(subGenTable)) { importList.add("java.util.List"); } for (GenTableColumn column : columns) { - if (Objects.equals(genTable.getAudit(), 1) && column.isSuperColumn()) { - continue; - } - if (GenConstants.TYPE_DATE.equals(column.getJavaType())) { + if (!column.isSuperColumn() && GenConstants.TYPE_DATE.equals(column.getJavaType())) { importList.add("java.util.Date"); - } else if (GenConstants.TYPE_DATE_ARR.contains(column.getJavaType())) { - importList.add("java.time." + column.getJavaType()); - } else if (GenConstants.TYPE_BIGDECIMAL.equals(column.getJavaType())) { + importList.add("com.fasterxml.jackson.annotation.JsonFormat"); + } else if (!column.isSuperColumn() && GenConstants.TYPE_BIGDECIMAL.equals(column.getJavaType())) { importList.add("java.math.BigDecimal"); } } @@ -276,14 +255,29 @@ public class VelocityUtils { */ public static String getDicts(GenTable genTable) { List columns = genTable.getColumns(); - List dicts = new ArrayList(); + Set dicts = new HashSet(); + addDicts(dicts, columns); + if (ObjectUtil.isNotNull(genTable.getSubTable())) { + List subColumns = genTable.getSubTable().getColumns(); + addDicts(dicts, subColumns); + } + return StringUtils.join(dicts, ", "); + } + + /** + * 添加字典列表 + * + * @param dicts 字典列表 + * @param columns 列集合 + */ + public static void addDicts(Set dicts, List columns) { for (GenTableColumn column : columns) { if (!column.isSuperColumn() && StringUtils.isNotEmpty(column.getDictType()) && StringUtils.equalsAny( - column.getHtmlType(), new String[]{GenConstants.HTML_SELECT, GenConstants.HTML_RADIO})) { + column.getHtmlType(), + new String[] { GenConstants.HTML_SELECT, GenConstants.HTML_RADIO, GenConstants.HTML_CHECKBOX })) { dicts.add("'" + column.getDictType() + "'"); } } - return StringUtils.join(dicts, ", "); } /** @@ -303,10 +297,10 @@ public class VelocityUtils { * @param paramsObj 生成其他选项 * @return 上级菜单ID字段 */ - public static String getParentMenuId(JSONObject paramsObj) { - if (StringUtils.isNotEmpty(paramsObj) && paramsObj.containsKey(GenConstants.PARENT_MENU_ID) - && StringUtils.isNotEmpty(paramsObj.getString(GenConstants.PARENT_MENU_ID))) { - return paramsObj.getString(GenConstants.PARENT_MENU_ID); + public static String getParentMenuId(Dict paramsObj) { + if (CollUtil.isNotEmpty(paramsObj) && paramsObj.containsKey(GenConstants.PARENT_MENU_ID) + && StringUtils.isNotEmpty(paramsObj.getStr(GenConstants.PARENT_MENU_ID))) { + return paramsObj.getStr(GenConstants.PARENT_MENU_ID); } return DEFAULT_PARENT_MENU_ID; } @@ -317,9 +311,9 @@ public class VelocityUtils { * @param paramsObj 生成其他选项 * @return 树编码 */ - public static String getTreecode(JSONObject paramsObj) { - if (paramsObj.containsKey(GenConstants.TREE_CODE)) { - return StringUtils.toCamelCase(paramsObj.getString(GenConstants.TREE_CODE)); + public static String getTreecode(Map paramsObj) { + if (CollUtil.isNotEmpty(paramsObj) && paramsObj.containsKey(GenConstants.TREE_CODE)) { + return StringUtils.toCamelCase(Convert.toStr(paramsObj.get(GenConstants.TREE_CODE))); } return StringUtils.EMPTY; } @@ -330,9 +324,9 @@ public class VelocityUtils { * @param paramsObj 生成其他选项 * @return 树父编码 */ - public static String getTreeParentCode(JSONObject paramsObj) { - if (paramsObj.containsKey(GenConstants.TREE_PARENT_CODE)) { - return StringUtils.toCamelCase(paramsObj.getString(GenConstants.TREE_PARENT_CODE)); + public static String getTreeParentCode(Dict paramsObj) { + if (CollUtil.isNotEmpty(paramsObj) && paramsObj.containsKey(GenConstants.TREE_PARENT_CODE)) { + return StringUtils.toCamelCase(paramsObj.getStr(GenConstants.TREE_PARENT_CODE)); } return StringUtils.EMPTY; } @@ -343,9 +337,9 @@ public class VelocityUtils { * @param paramsObj 生成其他选项 * @return 树名称 */ - public static String getTreeName(JSONObject paramsObj) { - if (paramsObj.containsKey(GenConstants.TREE_NAME)) { - return StringUtils.toCamelCase(paramsObj.getString(GenConstants.TREE_NAME)); + public static String getTreeName(Dict paramsObj) { + if (CollUtil.isNotEmpty(paramsObj) && paramsObj.containsKey(GenConstants.TREE_NAME)) { + return StringUtils.toCamelCase(paramsObj.getStr(GenConstants.TREE_NAME)); } return StringUtils.EMPTY; } @@ -358,8 +352,8 @@ public class VelocityUtils { */ public static int getExpandColumn(GenTable genTable) { String options = genTable.getOptions(); - JSONObject paramsObj = JSONObject.parseObject(options); - String treeName = paramsObj.getString(GenConstants.TREE_NAME); + Dict paramsObj = JsonUtils.parseMap(options); + String treeName = paramsObj.getStr(GenConstants.TREE_NAME); int num = 0; for (GenTableColumn column : genTable.getColumns()) { if (column.isList()) { diff --git a/ruoyi-modules/ruoyi-generator/src/main/resources/generator.yml b/ruoyi-modules/ruoyi-generator/src/main/resources/generator.yml new file mode 100644 index 0000000..5bd3dd6 --- /dev/null +++ b/ruoyi-modules/ruoyi-generator/src/main/resources/generator.yml @@ -0,0 +1,10 @@ +# 代码生成 +gen: + # 作者 + author: ruoyi + # 默认生成包路径 system 需改成自己的模块名称 如 system monitor tool + packageName: com.ruoyi.system + # 自动去除表前缀,默认是false + autoRemovePre: false + # 表前缀(生成类名不会包含表前缀,多个用逗号分隔) + tablePrefix: sys_ \ No newline at end of file diff --git a/ruoyi-modules/ruoyi-generator/src/main/resources/mapper/generator/GenTableColumnMapper.xml b/ruoyi-modules/ruoyi-generator/src/main/resources/mapper/generator/GenTableColumnMapper.xml new file mode 100644 index 0000000..d129786 --- /dev/null +++ b/ruoyi-modules/ruoyi-generator/src/main/resources/mapper/generator/GenTableColumnMapper.xml @@ -0,0 +1,93 @@ + + + + + + + + + + diff --git a/ruoyi-modules/ruoyi-generator/src/main/resources/mapper/generator/GenTableMapper.xml b/ruoyi-modules/ruoyi-generator/src/main/resources/mapper/generator/GenTableMapper.xml new file mode 100644 index 0000000..4d4e68e --- /dev/null +++ b/ruoyi-modules/ruoyi-generator/src/main/resources/mapper/generator/GenTableMapper.xml @@ -0,0 +1,220 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/ruoyi-modules/ruoyi-generator/src/main/resources/mapper/package-info.md b/ruoyi-modules/ruoyi-generator/src/main/resources/mapper/package-info.md new file mode 100644 index 0000000..c938b1e --- /dev/null +++ b/ruoyi-modules/ruoyi-generator/src/main/resources/mapper/package-info.md @@ -0,0 +1,3 @@ +java包使用 `.` 分割 resource 目录使用 `/` 分割 +
+此文件目的 防止文件夹粘连找不到 `xml` 文件 \ No newline at end of file diff --git a/ruoyi-modules/ruoyi-generator/src/main/resources/vm/java/bo.java.vm b/ruoyi-modules/ruoyi-generator/src/main/resources/vm/java/bo.java.vm new file mode 100644 index 0000000..cedc96e --- /dev/null +++ b/ruoyi-modules/ruoyi-generator/src/main/resources/vm/java/bo.java.vm @@ -0,0 +1,56 @@ +package ${packageName}.domain.bo; + +import lombok.Data; +import lombok.EqualsAndHashCode; +import jakarta.validation.constraints.*; +import io.github.linpeilie.annotations.AutoMapper; + +#foreach ($import in $importList) +import ${import}; +#end +#if($table.crud || $table.sub) +#elseif($table.tree) +#end + +/** + * ${functionName}业务对象 ${tableName} + * + * @author ${author} + * @date ${datetime} + */ +#if($table.crud || $table.sub) +#set($Entity="BaseEntity") +#elseif($table.tree) +#set($Entity="TreeEntity<${ClassName}Bo>") +#end + +@Data +@EqualsAndHashCode(callSuper = true) +@AutoMapper(target = ${ClassName}.class, reverseConvertGenerate = false) +public class ${ClassName}Bo extends ${Entity} { + +#foreach ($column in $columns) +#if(!$table.isSuperColumn($column.javaField) && ($column.query || $column.insert || $column.edit)) + /** + * $column.columnComment + */ +#if($column.insert && $column.edit) +#set($Group="AddGroup.class, EditGroup.class") +#elseif($column.insert) +#set($Group="AddGroup.class") +#elseif($column.edit) +#set($Group="EditGroup.class") +#end +#if($column.required) +#if($column.javaType == 'String') + @NotBlank(message = "$column.columnComment不能为空", groups = { $Group }) +#else + @NotNull(message = "$column.columnComment不能为空", groups = { $Group }) +#end +#end + private $column.javaType $column.javaField; + +#end +#end + +} diff --git a/ruoyi-modules/ruoyi-generator/src/main/resources/vm/java/controller.java.vm b/ruoyi-modules/ruoyi-generator/src/main/resources/vm/java/controller.java.vm new file mode 100644 index 0000000..134b508 --- /dev/null +++ b/ruoyi-modules/ruoyi-generator/src/main/resources/vm/java/controller.java.vm @@ -0,0 +1,115 @@ +package ${packageName}.controller; + +import java.util.List; + +import lombok.RequiredArgsConstructor; +import javax.servlet.http.HttpServletResponse; +import javax.validation.constraints.*; +import cn.dev33.satoken.annotation.SaCheckPermission; +import org.springframework.web.bind.annotation.*; +import org.springframework.validation.annotation.Validated; +import com.ruoyi.common.core.annotation.RepeatSubmit; +import com.ruoyi.common.log.annotation.Log; +import com.ruoyi.common.web.core.BaseController; +import com.rouyi.common.mybatis.core.page.PageQuery; +import com.ruoyi.common.core.domain.R; +import com.ruoyi.common.core.validate.AddGroup; +import com.ruoyi.common.core.validate.EditGroup; +import com.ruoyi.common.log.enums.BusinessType; +import com.ruoyi.common.core.utils.poi.ExcelUtil; +import ${packageName}.domain.vo.${ClassName}Vo; +import ${packageName}.domain.bo.${ClassName}Bo; +import ${packageName}.service.I${ClassName}Service; +#if($table.crud || $table.sub) +import com.rouyi.common.mybatis.core.page.TableDataInfo; +#elseif($table.tree) +#end + +/** + * ${functionName} + * + * @author ${author} + * @date ${datetime} + */ +@Validated +@RequiredArgsConstructor +@RestController +@RequestMapping("/${moduleName}/${businessName}") +public class ${ClassName}Controller extends BaseController { + + private final I${ClassName}Service i${ClassName}Service; + + /** + * 查询${functionName}列表 + */ + @SaCheckPermission("${permissionPrefix}:list") + @GetMapping("/list") +#if($table.crud || $table.sub) + public TableDataInfo<${ClassName}Vo> list(${ClassName}Bo bo, PageQuery pageQuery) { + return i${ClassName}Service.queryPageList(bo, pageQuery); + } +#elseif($table.tree) + public R> list(${ClassName}Bo bo) { + List<${ClassName}Vo> list = i${ClassName}Service.queryList(bo); + return R.ok(list); + } +#end + + /** + * 导出${functionName}列表 + */ + @SaCheckPermission("${permissionPrefix}:export") + @Log(title = "${functionName}", businessType = BusinessType.EXPORT) + @PostMapping("/export") + public void export(${ClassName}Bo bo, HttpServletResponse response) { + List<${ClassName}Vo> list = i${ClassName}Service.queryList(bo); + ExcelUtil.exportExcel(list, "${functionName}", ${ClassName}Vo.class, response); + } + + /** + * 获取${functionName}详细信息 + * + * @param ${pkColumn.javaField} 主键 + */ + @SaCheckPermission("${permissionPrefix}:query") + @GetMapping("/{${pkColumn.javaField}}") + public R<${ClassName}Vo> getInfo(@NotNull(message = "主键不能为空") + @PathVariable ${pkColumn.javaType} ${pkColumn.javaField}) { + return R.ok(i${ClassName}Service.queryById(${pkColumn.javaField})); + } + + /** + * 新增${functionName} + */ + @SaCheckPermission("${permissionPrefix}:add") + @Log(title = "${functionName}", businessType = BusinessType.INSERT) + @RepeatSubmit() + @PostMapping() + public R add(@Validated(AddGroup.class) @RequestBody ${ClassName}Bo bo) { + return toAjax(i${ClassName}Service.insertByBo(bo)); + } + + /** + * 修改${functionName} + */ + @SaCheckPermission("${permissionPrefix}:edit") + @Log(title = "${functionName}", businessType = BusinessType.UPDATE) + @RepeatSubmit() + @PutMapping() + public R edit(@Validated(EditGroup.class) @RequestBody ${ClassName}Bo bo) { + return toAjax(i${ClassName}Service.updateByBo(bo)); + } + + /** + * 删除${functionName} + * + * @param ${pkColumn.javaField}s 主键串 + */ + @SaCheckPermission("${permissionPrefix}:remove") + @Log(title = "${functionName}", businessType = BusinessType.DELETE) + @DeleteMapping("/{${pkColumn.javaField}s}") + public R remove(@NotEmpty(message = "主键不能为空") + @PathVariable ${pkColumn.javaType}[] ${pkColumn.javaField}s) { + return toAjax(i${ClassName}Service.deleteWithValidByIds(List.of(${pkColumn.javaField}s), true)); + } +} diff --git a/ruoyi-modules/ruoyi-generator/src/main/resources/vm/java/domain.java.vm b/ruoyi-modules/ruoyi-generator/src/main/resources/vm/java/domain.java.vm new file mode 100644 index 0000000..385a6d6 --- /dev/null +++ b/ruoyi-modules/ruoyi-generator/src/main/resources/vm/java/domain.java.vm @@ -0,0 +1,50 @@ +package ${packageName}.domain; + +import com.baomidou.mybatisplus.annotation.*; +import lombok.Data; +import lombok.EqualsAndHashCode; + +#foreach ($import in $importList) +import ${import}; +#end +#if($table.crud || $table.sub) +#elseif($table.tree) +#end + +/** + * ${functionName}对象 ${tableName} + * + * @author ${author} + * @date ${datetime} + */ +#if($table.crud || $table.sub) + #set($Entity="BaseEntity") +#elseif($table.tree) + #set($Entity="TreeEntity<${ClassName}>") +#end +@Data +@EqualsAndHashCode(callSuper = true) +@TableName("${tableName}") +public class ${ClassName} extends ${Entity} { + + private static final long serialVersionUID=1L; + +#foreach ($column in $columns) +#if(!$table.isSuperColumn($column.javaField)) + /** + * $column.columnComment + */ +#if($column.javaField=='delFlag') + @TableLogic +#end +#if($column.javaField=='version') + @Version +#end +#if($column.pk) + @TableId(value = "$column.columnName") +#end + private $column.javaType $column.javaField; +#end +#end + +} diff --git a/ruoyi-modules/ruoyi-generator/src/main/resources/vm/java/mapper.java.vm b/ruoyi-modules/ruoyi-generator/src/main/resources/vm/java/mapper.java.vm new file mode 100644 index 0000000..294af99 --- /dev/null +++ b/ruoyi-modules/ruoyi-generator/src/main/resources/vm/java/mapper.java.vm @@ -0,0 +1,15 @@ +package ${packageName}.mapper; + +import ${packageName}.domain.${ClassName}; +import ${packageName}.domain.vo.${ClassName}Vo; +import com.ruoyi.common.core.core.mapper.BaseMapperPlus; + +/** + * ${functionName}Mapper接口 + * + * @author ${author} + * @date ${datetime} + */ +public interface ${ClassName}Mapper extends BaseMapperPlus<${ClassName}Mapper, ${ClassName}, ${ClassName}Vo> { + +} diff --git a/ruoyi-modules/ruoyi-generator/src/main/resources/vm/java/service.java.vm b/ruoyi-modules/ruoyi-generator/src/main/resources/vm/java/service.java.vm new file mode 100644 index 0000000..a2979d4 --- /dev/null +++ b/ruoyi-modules/ruoyi-generator/src/main/resources/vm/java/service.java.vm @@ -0,0 +1,53 @@ +package ${packageName}.service; + +import ${packageName}.domain.${ClassName}; +import ${packageName}.domain.vo.${ClassName}Vo; +import ${packageName}.domain.bo.${ClassName}Bo; +#if($table.crud || $table.sub) +import com.rouyi.common.mybatis.core.page.TableDataInfo; +import com.rouyi.common.mybatis.core.page.PageQuery; +#end + +import java.util.Collection; +import java.util.List; + +/** + * ${functionName}Service接口 + * + * @author ${author} + * @date ${datetime} + */ +public interface I${ClassName}Service { + + /** + * 查询${functionName} + */ + ${ClassName}Vo queryById(${pkColumn.javaType} ${pkColumn.javaField}); + +#if($table.crud || $table.sub) + /** + * 查询${functionName}列表 + */ + TableDataInfo<${ClassName}Vo> queryPageList(${ClassName}Bo bo, PageQuery pageQuery); +#end + + /** + * 查询${functionName}列表 + */ + List<${ClassName}Vo> queryList(${ClassName}Bo bo); + + /** + * 新增${functionName} + */ + Boolean insertByBo(${ClassName}Bo bo); + + /** + * 修改${functionName} + */ + Boolean updateByBo(${ClassName}Bo bo); + + /** + * 校验并批量删除${functionName}信息 + */ + Boolean deleteWithValidByIds(Collection<${pkColumn.javaType}> ids, Boolean isValid); +} diff --git a/ruoyi-modules/ruoyi-generator/src/main/resources/vm/java/serviceImpl.java.vm b/ruoyi-modules/ruoyi-generator/src/main/resources/vm/java/serviceImpl.java.vm new file mode 100644 index 0000000..7ffde85 --- /dev/null +++ b/ruoyi-modules/ruoyi-generator/src/main/resources/vm/java/serviceImpl.java.vm @@ -0,0 +1,133 @@ +package ${packageName}.service.impl; + +import com.ruoyi.common.core.utils.MapstructUtils; + #if($table.crud || $table.sub) +import com.rouyi.common.mybatis.core.page.TableDataInfo; +import com.rouyi.common.mybatis.core.page.PageQuery; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +#end +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.toolkit.Wrappers; +import lombok.RequiredArgsConstructor; +import org.springframework.stereotype.Service; +import ${packageName}.domain.bo.${ClassName}Bo; +import ${packageName}.domain.vo.${ClassName}Vo; +import ${packageName}.domain.${ClassName}; +import ${packageName}.mapper.${ClassName}Mapper; +import ${packageName}.service.I${ClassName}Service; + +import java.util.List; +import java.util.Map; +import java.util.Collection; + +/** + * ${functionName}Service业务层处理 + * + * @author ${author} + * @date ${datetime} + */ +@RequiredArgsConstructor +@Service +public class ${ClassName}ServiceImpl implements I${ClassName}Service { + + private final ${ClassName}Mapper baseMapper; + + /** + * 查询${functionName} + */ + @Override + public ${ClassName}Vo queryById(${pkColumn.javaType} ${pkColumn.javaField}){ + return baseMapper.selectVoById(${pkColumn.javaField}); + } + +#if($table.crud || $table.sub) + /** + * 查询${functionName}列表 + */ + @Override + public TableDataInfo<${ClassName}Vo> queryPageList(${ClassName}Bo bo, PageQuery pageQuery) { + LambdaQueryWrapper<${ClassName}> lqw = buildQueryWrapper(bo); + Page<${ClassName}Vo> result = baseMapper.selectVoPage(pageQuery.build(), lqw); + return TableDataInfo.build(result); + } +#end + + /** + * 查询${functionName}列表 + */ + @Override + public List<${ClassName}Vo> queryList(${ClassName}Bo bo) { + LambdaQueryWrapper<${ClassName}> lqw = buildQueryWrapper(bo); + return baseMapper.selectVoList(lqw); + } + + private LambdaQueryWrapper<${ClassName}> buildQueryWrapper(${ClassName}Bo bo) { + Map params = bo.getParams(); + LambdaQueryWrapper<${ClassName}> lqw = Wrappers.lambdaQuery(); +#foreach($column in $columns) +#if($column.query) +#set($queryType=$column.queryType) +#set($javaField=$column.javaField) +#set($javaType=$column.javaType) +#set($columnName=$column.columnName) +#set($AttrName=$column.javaField.substring(0,1).toUpperCase() + ${column.javaField.substring(1)}) +#set($mpMethod=$column.queryType.toLowerCase()) +#if($queryType != 'BETWEEN') +#if($javaType == 'String') +#set($condition='StringUtils.isNotBlank(bo.get'+$AttrName+'())') +#else +#set($condition='bo.get'+$AttrName+'() != null') +#end + lqw.$mpMethod($condition, ${ClassName}::get$AttrName, bo.get$AttrName()); +#else + lqw.between(params.get("begin$AttrName") != null && params.get("end$AttrName") != null, + ${ClassName}::get$AttrName ,params.get("begin$AttrName"), params.get("end$AttrName")); +#end +#end +#end + return lqw; + } + + /** + * 新增${functionName} + */ + @Override + public Boolean insertByBo(${ClassName}Bo bo) { + ${ClassName} add = MapstructUtils.convert(bo, ${ClassName}.class); + validEntityBeforeSave(add); + boolean flag = baseMapper.insert(add) > 0; +#set($pk=$pkColumn.javaField.substring(0,1).toUpperCase() + ${pkColumn.javaField.substring(1)}) + if (flag) { + bo.set$pk(add.get$pk()); + } + return flag; + } + + /** + * 修改${functionName} + */ + @Override + public Boolean updateByBo(${ClassName}Bo bo) { + ${ClassName} update = MapstructUtils.convert(bo, ${ClassName}.class); + validEntityBeforeSave(update); + return baseMapper.updateById(update) > 0; + } + + /** + * 保存前的数据校验 + */ + private void validEntityBeforeSave(${ClassName} entity){ + //TODO 做一些数据校验,如唯一约束 + } + + /** + * 批量删除${functionName} + */ + @Override + public Boolean deleteWithValidByIds(Collection<${pkColumn.javaType}> ids, Boolean isValid) { + if(isValid){ + //TODO 做一些业务上的校验,判断是否需要校验 + } + return baseMapper.deleteBatchIds(ids) > 0; + } +} diff --git a/ruoyi-generator/src/main/resources/vm/java/sub-domain.java.vm b/ruoyi-modules/ruoyi-generator/src/main/resources/vm/java/sub-domain.java.vm similarity index 70% rename from ruoyi-generator/src/main/resources/vm/java/sub-domain.java.vm rename to ruoyi-modules/ruoyi-generator/src/main/resources/vm/java/sub-domain.java.vm index 951aeab..2f025bb 100644 --- a/ruoyi-generator/src/main/resources/vm/java/sub-domain.java.vm +++ b/ruoyi-modules/ruoyi-generator/src/main/resources/vm/java/sub-domain.java.vm @@ -3,20 +3,16 @@ package ${packageName}.domain; #foreach ($import in $subImportList) import ${import}; #end -import com.fasterxml.jackson.annotation.JsonFormat; -import org.apache.commons.lang3.builder.ToStringBuilder; -import org.apache.commons.lang3.builder.ToStringStyle; import com.ruoyi.common.annotation.Excel; -import com.ruoyi.common.core.domain.BaseEntity; -import lombok.Data; + /** * ${subTable.functionName}对象 ${subTableName} - * + * * @author ${author} * @date ${datetime} */ -@Data -public class ${subClassName} extends BaseEntity { +public class ${subClassName} extends BaseEntity +{ private static final long serialVersionUID = 1L; #foreach ($column in $subTable.columns) @@ -41,6 +37,24 @@ public class ${subClassName} extends BaseEntity { private $column.javaType $column.javaField; #end +#end +#foreach ($column in $subTable.columns) +#if(!$table.isSuperColumn($column.javaField)) +#if($column.javaField.length() > 2 && $column.javaField.substring(1,2).matches("[A-Z]")) +#set($AttrName=$column.javaField) +#else +#set($AttrName=$column.javaField.substring(0,1).toUpperCase() + ${column.javaField.substring(1)}) +#end + public void set${AttrName}($column.javaType $column.javaField) + { + this.$column.javaField = $column.javaField; + } + + public $column.javaType get${AttrName}() + { + return $column.javaField; + } +#end #end @Override diff --git a/ruoyi-modules/ruoyi-generator/src/main/resources/vm/java/vo.java.vm b/ruoyi-modules/ruoyi-generator/src/main/resources/vm/java/vo.java.vm new file mode 100644 index 0000000..8f8b149 --- /dev/null +++ b/ruoyi-modules/ruoyi-generator/src/main/resources/vm/java/vo.java.vm @@ -0,0 +1,53 @@ +package ${packageName}.domain.vo; + +#foreach ($import in $importList) +import ${import}; +#end +import com.alibaba.excel.annotation.ExcelIgnoreUnannotated; +import com.alibaba.excel.annotation.ExcelProperty; +import com.ruoyi.common.excel.annotation.ExcelDictFormat; +import com.ruoyi.common.excel.convert.ExcelDictConvert; +import lombok.Data; +import io.github.linpeilie.annotations.AutoMapper; + +import java.io.Serializable; + +/** + * ${functionName}视图对象 ${tableName} + * + * @author ${author} + * @date ${datetime} + */ +@Data +@ExcelIgnoreUnannotated +@AutoMapper(target = ${ClassName}.class) +public class ${ClassName}Vo implements Serializable { + + private static final long serialVersionUID = 1L; + +#foreach ($column in $columns) +#if($column.list) + /** + * $column.columnComment + */ +#set($parentheseIndex=$column.columnComment.indexOf("(")) +#if($parentheseIndex != -1) +#set($comment=$column.columnComment.substring(0, $parentheseIndex)) +#else +#set($comment=$column.columnComment) +#end +#if(${column.dictType} && ${column.dictType} != '') + @ExcelProperty(value = "${comment}", converter = ExcelDictConvert.class) + @ExcelDictFormat(dictType = "${column.dictType}") +#elseif($parentheseIndex != -1) + @ExcelProperty(value = "${comment}", converter = ExcelDictConvert.class) + @ExcelDictFormat(readConverterExp = "$column.readConverterExp()") +#else + @ExcelProperty(value = "${comment}") +#end + private $column.javaType $column.javaField; + +#end +#end + +} diff --git a/ruoyi-generator/src/main/resources/vm/js/api.js.vm b/ruoyi-modules/ruoyi-generator/src/main/resources/vm/js/api.js.vm similarity index 56% rename from ruoyi-generator/src/main/resources/vm/js/api.js.vm rename to ruoyi-modules/ruoyi-generator/src/main/resources/vm/js/api.js.vm index 5d868f2..9295524 100644 --- a/ruoyi-generator/src/main/resources/vm/js/api.js.vm +++ b/ruoyi-modules/ruoyi-generator/src/main/resources/vm/js/api.js.vm @@ -1,19 +1,18 @@ import request from '@/utils/request' // 查询${functionName}列表 -export function list${BusinessName}(query, pageReq) { +export function list${BusinessName}(query) { return request({ - url: '/${moduleName}/${className}/list', - method: 'post', - data: query, - params: pageReq + url: '/${moduleName}/${businessName}/list', + method: 'get', + params: query }) } // 查询${functionName}详细 export function get${BusinessName}(${pkColumn.javaField}) { return request({ - url: '/${moduleName}/${className}/' + ${pkColumn.javaField}, + url: '/${moduleName}/${businessName}/' + ${pkColumn.javaField}, method: 'get' }) } @@ -21,7 +20,7 @@ export function get${BusinessName}(${pkColumn.javaField}) { // 新增${functionName} export function add${BusinessName}(data) { return request({ - url: '/${moduleName}/${className}', + url: '/${moduleName}/${businessName}', method: 'post', data: data }) @@ -30,7 +29,7 @@ export function add${BusinessName}(data) { // 修改${functionName} export function update${BusinessName}(data) { return request({ - url: '/${moduleName}/${className}', + url: '/${moduleName}/${businessName}', method: 'put', data: data }) @@ -39,16 +38,7 @@ export function update${BusinessName}(data) { // 删除${functionName} export function del${BusinessName}(${pkColumn.javaField}) { return request({ - url: '/${moduleName}/${className}/' + ${pkColumn.javaField}, + url: '/${moduleName}/${businessName}/' + ${pkColumn.javaField}, method: 'delete' }) } - -// 导出${functionName} -export function export${BusinessName}(query) { - return request({ - url: '/${moduleName}/${className}/export', - method: 'get', - params: query - }) -} diff --git a/ruoyi-modules/ruoyi-generator/src/main/resources/vm/sql/oracle/sql.vm b/ruoyi-modules/ruoyi-generator/src/main/resources/vm/sql/oracle/sql.vm new file mode 100644 index 0000000..3de2fa4 --- /dev/null +++ b/ruoyi-modules/ruoyi-generator/src/main/resources/vm/sql/oracle/sql.vm @@ -0,0 +1,19 @@ +-- 菜单 SQL +insert into sys_menu (menu_id, menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark) +values(${table.menuIds[0]}, '${functionName}', '${parentMenuId}', '1', '${businessName}', '${moduleName}/${businessName}/index', 1, 0, 'C', '0', '0', '${permissionPrefix}:list', '#', 'admin', sysdate, '', null, '${functionName}菜单'); + +-- 按钮 SQL +insert into sys_menu (menu_id, menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark) +values(${table.menuIds[1]}, '${functionName}查询', ${table.menuIds[0]}, '1', '#', '', 1, 0, 'F', '0', '0', '${permissionPrefix}:query', '#', 'admin', sysdate, '', null, ''); + +insert into sys_menu (menu_id, menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark) +values(${table.menuIds[2]}, '${functionName}新增', ${table.menuIds[0]}, '2', '#', '', 1, 0, 'F', '0', '0', '${permissionPrefix}:add', '#', 'admin', sysdate, '', null, ''); + +insert into sys_menu (menu_id, menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark) +values(${table.menuIds[3]}, '${functionName}修改', ${table.menuIds[0]}, '3', '#', '', 1, 0, 'F', '0', '0', '${permissionPrefix}:edit', '#', 'admin', sysdate, '', null, ''); + +insert into sys_menu (menu_id, menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark) +values(${table.menuIds[4]}, '${functionName}删除', ${table.menuIds[0]}, '4', '#', '', 1, 0, 'F', '0', '0', '${permissionPrefix}:remove', '#', 'admin', sysdate, '', null, ''); + +insert into sys_menu (menu_id, menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark) +values(${table.menuIds[5]}, '${functionName}导出', ${table.menuIds[0]}, '5', '#', '', 1, 0, 'F', '0', '0', '${permissionPrefix}:export', '#', 'admin', sysdate, '', null, ''); diff --git a/ruoyi-modules/ruoyi-generator/src/main/resources/vm/sql/postgres/sql.vm b/ruoyi-modules/ruoyi-generator/src/main/resources/vm/sql/postgres/sql.vm new file mode 100644 index 0000000..e8b45c9 --- /dev/null +++ b/ruoyi-modules/ruoyi-generator/src/main/resources/vm/sql/postgres/sql.vm @@ -0,0 +1,20 @@ +-- 菜单 SQL +insert into sys_menu (menu_id, menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark) +values(${table.menuIds[0]}, '${functionName}', '${parentMenuId}', '1', '${businessName}', '${moduleName}/${businessName}/index', 1, 0, 'C', '0', '0', '${permissionPrefix}:list', '#', 'admin', now(), '', null, '${functionName}菜单'); + +-- 按钮 SQL +insert into sys_menu (menu_id, menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark) +values(${table.menuIds[1]}, '${functionName}查询', ${table.menuIds[0]}, '1', '#', '', 1, 0, 'F', '0', '0', '${permissionPrefix}:query', '#', 'admin', now(), '', null, ''); + +insert into sys_menu (menu_id, menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark) +values(${table.menuIds[2]}, '${functionName}新增', ${table.menuIds[0]}, '2', '#', '', 1, 0, 'F', '0', '0', '${permissionPrefix}:add', '#', 'admin', now(), '', null, ''); + +insert into sys_menu (menu_id, menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark) +values(${table.menuIds[3]}, '${functionName}修改', ${table.menuIds[0]}, '3', '#', '', 1, 0, 'F', '0', '0', '${permissionPrefix}:edit', '#', 'admin', now(), '', null, ''); + +insert into sys_menu (menu_id, menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark) +values(${table.menuIds[4]}, '${functionName}删除', ${table.menuIds[0]}, '4', '#', '', 1, 0, 'F', '0', '0', '${permissionPrefix}:remove', '#', 'admin', now(), '', null, ''); + +insert into sys_menu (menu_id, menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark) +values(${table.menuIds[5]}, '${functionName}导出', ${table.menuIds[0]}, '5', '#', '', 1, 0, 'F', '0', '0', '${permissionPrefix}:export', '#', 'admin', now(), '', null, ''); + diff --git a/ruoyi-modules/ruoyi-generator/src/main/resources/vm/sql/sql.vm b/ruoyi-modules/ruoyi-generator/src/main/resources/vm/sql/sql.vm new file mode 100644 index 0000000..9bc0b02 --- /dev/null +++ b/ruoyi-modules/ruoyi-generator/src/main/resources/vm/sql/sql.vm @@ -0,0 +1,19 @@ +-- 菜单 SQL +insert into sys_menu (menu_id, menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark) +values(${table.menuIds[0]}, '${functionName}', '${parentMenuId}', '1', '${businessName}', '${moduleName}/${businessName}/index', 1, 0, 'C', '0', '0', '${permissionPrefix}:list', '#', 'admin', sysdate(), '', null, '${functionName}菜单'); + +-- 按钮 SQL +insert into sys_menu (menu_id, menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark) +values(${table.menuIds[1]}, '${functionName}查询', ${table.menuIds[0]}, '1', '#', '', 1, 0, 'F', '0', '0', '${permissionPrefix}:query', '#', 'admin', sysdate(), '', null, ''); + +insert into sys_menu (menu_id, menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark) +values(${table.menuIds[2]}, '${functionName}新增', ${table.menuIds[0]}, '2', '#', '', 1, 0, 'F', '0', '0', '${permissionPrefix}:add', '#', 'admin', sysdate(), '', null, ''); + +insert into sys_menu (menu_id, menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark) +values(${table.menuIds[3]}, '${functionName}修改', ${table.menuIds[0]}, '3', '#', '', 1, 0, 'F', '0', '0', '${permissionPrefix}:edit', '#', 'admin', sysdate(), '', null, ''); + +insert into sys_menu (menu_id, menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark) +values(${table.menuIds[4]}, '${functionName}删除', ${table.menuIds[0]}, '4', '#', '', 1, 0, 'F', '0', '0', '${permissionPrefix}:remove', '#', 'admin', sysdate(), '', null, ''); + +insert into sys_menu (menu_id, menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark) +values(${table.menuIds[5]}, '${functionName}导出', ${table.menuIds[0]}, '5', '#', '', 1, 0, 'F', '0', '0', '${permissionPrefix}:export', '#', 'admin', sysdate(), '', null, ''); diff --git a/ruoyi-modules/ruoyi-generator/src/main/resources/vm/sql/sqlserver/sql.vm b/ruoyi-modules/ruoyi-generator/src/main/resources/vm/sql/sqlserver/sql.vm new file mode 100644 index 0000000..956534f --- /dev/null +++ b/ruoyi-modules/ruoyi-generator/src/main/resources/vm/sql/sqlserver/sql.vm @@ -0,0 +1,19 @@ +-- 菜单 SQL +insert into sys_menu (menu_id, menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark) +values(${table.menuIds[0]}, '${functionName}', '${parentMenuId}', '1', '${businessName}', '${moduleName}/${businessName}/index', 1, 0, 'C', '0', '0', '${permissionPrefix}:list', '#', 'admin', getdate(), '', null, '${functionName}菜单'); + +-- 按钮 SQL +insert into sys_menu (menu_id, menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark) +values(${table.menuIds[1]}, '${functionName}查询', ${table.menuIds[0]}, '1', '#', '', 1, 0, 'F', '0', '0', '${permissionPrefix}:query', '#', 'admin', getdate(), '', null, ''); + +insert into sys_menu (menu_id, menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark) +values(${table.menuIds[2]}, '${functionName}新增', ${table.menuIds[0]}, '2', '#', '', 1, 0, 'F', '0', '0', '${permissionPrefix}:add', '#', 'admin', getdate(), '', null, ''); + +insert into sys_menu (menu_id, menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark) +values(${table.menuIds[3]}, '${functionName}修改', ${table.menuIds[0]}, '3', '#', '', 1, 0, 'F', '0', '0', '${permissionPrefix}:edit', '#', 'admin', getdate(), '', null, ''); + +insert into sys_menu (menu_id, menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark) +values(${table.menuIds[4]}, '${functionName}删除', ${table.menuIds[0]}, '4', '#', '', 1, 0, 'F', '0', '0', '${permissionPrefix}:remove', '#', 'admin', getdate(), '', null, ''); + +insert into sys_menu (menu_id, menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark) +values(${table.menuIds[5]}, '${functionName}导出', ${table.menuIds[0]}, '5', '#', '', 1, 0, 'F', '0', '0', '${permissionPrefix}:export', '#', 'admin', getdate(), '', null, ''); diff --git a/ruoyi-modules/ruoyi-generator/src/main/resources/vm/vue/index-tree.vue.vm b/ruoyi-modules/ruoyi-generator/src/main/resources/vm/vue/index-tree.vue.vm new file mode 100644 index 0000000..2937f7c --- /dev/null +++ b/ruoyi-modules/ruoyi-generator/src/main/resources/vm/vue/index-tree.vue.vm @@ -0,0 +1,486 @@ + + + diff --git a/ruoyi-modules/ruoyi-generator/src/main/resources/vm/vue/index.vue.vm b/ruoyi-modules/ruoyi-generator/src/main/resources/vm/vue/index.vue.vm new file mode 100644 index 0000000..7053940 --- /dev/null +++ b/ruoyi-modules/ruoyi-generator/src/main/resources/vm/vue/index.vue.vm @@ -0,0 +1,601 @@ + + + diff --git a/ruoyi-modules/ruoyi-generator/src/main/resources/vm/xml/mapper.xml.vm b/ruoyi-modules/ruoyi-generator/src/main/resources/vm/xml/mapper.xml.vm new file mode 100644 index 0000000..2a128fb --- /dev/null +++ b/ruoyi-modules/ruoyi-generator/src/main/resources/vm/xml/mapper.xml.vm @@ -0,0 +1,14 @@ + + + + + +#foreach ($column in $columns) + +#end + + + + diff --git a/ruoyi-modules/ruoyi-system/pom.xml b/ruoyi-modules/ruoyi-system/pom.xml new file mode 100644 index 0000000..ed8fb0e --- /dev/null +++ b/ruoyi-modules/ruoyi-system/pom.xml @@ -0,0 +1,96 @@ + + + + ruoyi-modules + com.ruoyi + ${revision} + + 4.0.0 + + ruoyi-system + + + system系统模块 + + + + + + + com.ruoyi + ruoyi-common-core + + + + + com.ruoyi + ruoyi-common-oss + + + + + com.ruoyi + ruoyi-common-sms + + + + + com.ruoyi + ruoyi-common-excel + + + + com.ruoyi + ruoyi-common-log + + + + com.ruoyi + ruoyi-common-translation + + + + com.ruoyi + ruoyi-common-sensitive + + + + com.ruoyi + ruoyi-common-redis + + + + com.ruoyi + ruoyi-common-web + + + + com.ruoyi + ruoyi-common-security + + + + com.ruoyi + ruoyi-common-mybatis + + + + com.ruoyi + ruoyi-common-encrypt + + + + com.ruoyi + ruoyi-common-idempotent + + + + com.ruoyi + ruoyi-common-doc + + + + + diff --git a/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/controller/monitor/CacheController.java b/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/controller/monitor/CacheController.java new file mode 100644 index 0000000..8c54ac9 --- /dev/null +++ b/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/controller/monitor/CacheController.java @@ -0,0 +1,167 @@ +package com.ruoyi.system.controller.monitor; + +import cn.dev33.satoken.annotation.SaCheckPermission; +import cn.hutool.core.collection.CollUtil; +import com.ruoyi.common.core.constant.CacheConstants; +import com.ruoyi.common.core.constant.CacheNames; +import com.ruoyi.common.core.domain.R; +import com.ruoyi.common.core.utils.StreamUtils; +import com.ruoyi.common.core.utils.StringUtils; +import com.ruoyi.common.json.utils.JsonUtils; +import com.ruoyi.common.redis.utils.CacheUtils; +import com.ruoyi.common.redis.utils.RedisUtils; +import com.ruoyi.system.domain.entity.SysCache; +import lombok.RequiredArgsConstructor; +import org.redisson.spring.data.connection.RedissonConnectionFactory; +import org.springframework.data.redis.connection.RedisConnection; +import org.springframework.web.bind.annotation.*; + +import java.util.*; + +; + +/** + * 缓存监控 + * + * @author Lion Li + */ +@RequiredArgsConstructor +@RestController +@RequestMapping("/monitor/cache") +public class CacheController { + + private final RedissonConnectionFactory connectionFactory; + + private final static List CACHES = new ArrayList<>(); + + static { + CACHES.add(new SysCache(CacheConstants.ONLINE_TOKEN_KEY, "在线用户")); + CACHES.add(new SysCache(CacheNames.SYS_CONFIG, "配置信息")); + CACHES.add(new SysCache(CacheNames.SYS_DICT, "数据字典")); + 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(CacheNames.SYS_OSS_CONFIG, "OSS配置")); + CACHES.add(new SysCache(CacheConstants.PWD_ERR_CNT_KEY, "密码错误次数")); + } + + /** + * 获取缓存监控列表 + */ + @SaCheckPermission("monitor:cache:list") + @GetMapping() + public R> getInfo() throws Exception { + RedisConnection connection = connectionFactory.getConnection(); + Properties commandStats = connection.commands().info("commandstats"); + + List> pieList = new ArrayList<>(); + if (commandStats != null) { + commandStats.stringPropertyNames().forEach(key -> { + Map 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); + }); + } + return R.ok(Map.of( + "info", connection.commands().info(), + "dbSize", connection.commands().dbSize(), + "commandStats", pieList + )); + } + + /** + * 获取缓存监控缓存名列表 + */ + @SaCheckPermission("monitor:cache:list") + @GetMapping("/getNames") + public R> cache() { + return R.ok(CACHES); + } + + /** + * 获取缓存监控Key列表 + * + * @param cacheName 缓存名 + */ + @SaCheckPermission("monitor:cache:list") + @GetMapping("/getKeys/{cacheName}") + public R> getCacheKeys(@PathVariable String cacheName) { + Collection cacheKeys = new HashSet<>(0); + if (isCacheNames(cacheName)) { + Set keys = CacheUtils.keys(cacheName); + if (CollUtil.isNotEmpty(keys)) { + cacheKeys = StreamUtils.toList(keys, Object::toString); + } + } else { + cacheKeys = RedisUtils.keys(cacheName + "*"); + } + return R.ok(cacheKeys); + } + + /** + * 获取缓存监控缓存值详情 + * + * @param cacheName 缓存名 + * @param cacheKey 缓存key + */ + @SaCheckPermission("monitor:cache:list") + @GetMapping("/getValue/{cacheName}/{cacheKey}") + public R getCacheValue(@PathVariable String cacheName, @PathVariable String cacheKey) { + Object cacheValue; + if (isCacheNames(cacheName)) { + cacheValue = CacheUtils.get(cacheName, cacheKey); + } else { + cacheValue = RedisUtils.getCacheObject(cacheKey); + } + SysCache sysCache = new SysCache(cacheName, cacheKey, JsonUtils.toJsonString(cacheValue)); + return R.ok(sysCache); + } + + /** + * 清理缓存监控缓存名 + * + * @param cacheName 缓存名 + */ + @SaCheckPermission("monitor:cache:list") + @DeleteMapping("/clearCacheName/{cacheName}") + public R clearCacheName(@PathVariable String cacheName) { + if (isCacheNames(cacheName)) { + CacheUtils.clear(cacheName); + } else { + RedisUtils.deleteKeys(cacheName + "*"); + } + return R.ok(); + } + + /** + * 清理缓存监控Key + * + * @param cacheKey key名 + */ + @SaCheckPermission("monitor:cache:list") + @DeleteMapping("/clearCacheKey/{cacheName}/{cacheKey}") + public R clearCacheKey(@PathVariable String cacheName, @PathVariable String cacheKey) { + if (isCacheNames(cacheName)) { + CacheUtils.evict(cacheName, cacheKey); + } else { + RedisUtils.deleteObject(cacheKey); + } + return R.ok(); + } + + /** + * 清理全部缓存监控 + */ + @SaCheckPermission("monitor:cache:list") + @DeleteMapping("/clearCacheAll") + public R clearCacheAll() { + RedisUtils.deleteKeys("*"); + return R.ok(); + } + + private boolean isCacheNames(String cacheName) { + return !StringUtils.contains(cacheName, ":"); + } +} diff --git a/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/controller/monitor/SysLogininforController.java b/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/controller/monitor/SysLogininforController.java new file mode 100644 index 0000000..c510ad9 --- /dev/null +++ b/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/controller/monitor/SysLogininforController.java @@ -0,0 +1,88 @@ +package com.ruoyi.system.controller.monitor; + +import cn.dev33.satoken.annotation.SaCheckPermission; +import com.ruoyi.common.log.annotation.Log; +import com.ruoyi.common.core.constant.CacheConstants; +import com.ruoyi.common.web.core.BaseController; +import com.rouyi.common.mybatis.core.page.PageQuery; +import com.ruoyi.common.core.domain.R; +import com.rouyi.common.mybatis.core.page.TableDataInfo; +import com.ruoyi.common.log.enums.BusinessType; +import com.ruoyi.common.redis.utils.RedisUtils; +import com.ruoyi.common.excel.utils.ExcelUtil; +import com.ruoyi.system.domain.entity.SysLogininfor; +import com.ruoyi.system.service.ISysLogininforService; +import jakarta.servlet.http.HttpServletResponse; +import lombok.RequiredArgsConstructor; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.*; + +import java.util.List; + +/** + * 系统访问记录 + * + * @author Lion Li + */ +@Validated +@RequiredArgsConstructor +@RestController +@RequestMapping("/monitor/logininfor") +public class SysLogininforController extends BaseController { + + private final ISysLogininforService logininforService; + + /** + * 获取系统访问记录列表 + */ + @SaCheckPermission("monitor:logininfor:list") + @GetMapping("/list") + public TableDataInfo list(SysLogininfor logininfor, PageQuery pageQuery) { + return logininforService.selectPageLogininforList(logininfor, pageQuery); + } + + /** + * 导出系统访问记录列表 + */ + @Log(title = "登录日志", businessType = BusinessType.EXPORT) + @SaCheckPermission("monitor:logininfor:export") + @PostMapping("/export") + public void export(SysLogininfor logininfor, HttpServletResponse response) { + List list = logininforService.selectLogininforList(logininfor); + ExcelUtil.exportExcel(list, "登录日志", SysLogininfor.class, response); + } + + /** + * 批量删除登录日志 + * @param infoIds 日志ids + */ + @SaCheckPermission("monitor:logininfor:remove") + @Log(title = "登录日志", businessType = BusinessType.DELETE) + @DeleteMapping("/{infoIds}") + public R remove(@PathVariable Long[] infoIds) { + return toAjax(logininforService.deleteLogininforByIds(infoIds)); + } + + /** + * 清理系统访问记录 + */ + @SaCheckPermission("monitor:logininfor:remove") + @Log(title = "登录日志", businessType = BusinessType.CLEAN) + @DeleteMapping("/clean") + public R clean() { + logininforService.cleanLogininfor(); + return R.ok(); + } + + @SaCheckPermission("monitor:logininfor:unlock") + @Log(title = "账户解锁", businessType = BusinessType.OTHER) + @GetMapping("/unlock/{userName}") + public R unlock(@PathVariable("userName") String userName) { + String loginName = CacheConstants.PWD_ERR_CNT_KEY + userName; + if (RedisUtils.hasKey(loginName)) { + RedisUtils.deleteObject(loginName); + } + return R.ok(); + } + +} diff --git a/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/controller/monitor/SysOperlogController.java b/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/controller/monitor/SysOperlogController.java new file mode 100644 index 0000000..59e594a --- /dev/null +++ b/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/controller/monitor/SysOperlogController.java @@ -0,0 +1,74 @@ +package com.ruoyi.system.controller.monitor; + +import cn.dev33.satoken.annotation.SaCheckPermission; +import com.ruoyi.common.log.annotation.Log; +import com.ruoyi.common.web.core.BaseController; +import com.rouyi.common.mybatis.core.page.PageQuery; +import com.ruoyi.common.core.domain.R; +import com.rouyi.common.mybatis.core.page.TableDataInfo; +import com.ruoyi.common.log.enums.BusinessType; +import com.ruoyi.common.excel.utils.ExcelUtil; +import com.ruoyi.system.domain.entity.SysOperLog; +import com.ruoyi.system.service.ISysOperLogService; +import jakarta.servlet.http.HttpServletResponse; +import lombok.RequiredArgsConstructor; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.*; + +import java.util.List; + +/** + * 操作日志记录 + * + * @author Lion Li + */ +@Validated +@RequiredArgsConstructor +@RestController +@RequestMapping("/monitor/operlog") +public class SysOperlogController extends BaseController { + + private final ISysOperLogService operLogService; + + /** + * 获取操作日志记录列表 + */ + @SaCheckPermission("monitor:operlog:list") + @GetMapping("/list") + public TableDataInfo list(SysOperLog operLog, PageQuery pageQuery) { + return operLogService.selectPageOperLogList(operLog, pageQuery); + } + + /** + * 导出操作日志记录列表 + */ + @Log(title = "操作日志", businessType = BusinessType.EXPORT) + @SaCheckPermission("monitor:operlog:export") + @PostMapping("/export") + public void export(SysOperLog operLog, HttpServletResponse response) { + List list = operLogService.selectOperLogList(operLog); + ExcelUtil.exportExcel(list, "操作日志", SysOperLog.class, response); + } + + /** + * 批量删除操作日志记录 + * @param operIds 日志ids + */ + @Log(title = "操作日志", businessType = BusinessType.DELETE) + @SaCheckPermission("monitor:operlog:remove") + @DeleteMapping("/{operIds}") + public R remove(@PathVariable Long[] operIds) { + return toAjax(operLogService.deleteOperLogByIds(operIds)); + } + + /** + * 清理操作日志记录 + */ + @Log(title = "操作日志", businessType = BusinessType.CLEAN) + @SaCheckPermission("monitor:operlog:remove") + @DeleteMapping("/clean") + public R clean() { + operLogService.cleanOperLog(); + return R.ok(); + } +} diff --git a/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/controller/monitor/SysUserOnlineController.java b/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/controller/monitor/SysUserOnlineController.java new file mode 100644 index 0000000..4b11fa4 --- /dev/null +++ b/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/controller/monitor/SysUserOnlineController.java @@ -0,0 +1,90 @@ +package com.ruoyi.system.controller.monitor; + +import cn.dev33.satoken.annotation.SaCheckPermission; +import cn.dev33.satoken.exception.NotLoginException; +import cn.dev33.satoken.stp.StpUtil; +import cn.hutool.core.bean.BeanUtil; +import com.ruoyi.common.log.annotation.Log; +import com.ruoyi.common.core.constant.CacheConstants; +import com.ruoyi.common.web.core.BaseController; +import com.ruoyi.common.core.domain.R; +import com.ruoyi.common.core.domain.vo.UserOnlineVO; +import com.rouyi.common.mybatis.core.page.TableDataInfo; +import com.ruoyi.common.log.enums.BusinessType; +import com.ruoyi.common.core.utils.StreamUtils; +import com.ruoyi.common.core.utils.StringUtils; +import com.ruoyi.common.redis.utils.RedisUtils; +import com.ruoyi.system.domain.entity.SysUserOnline; +import lombok.RequiredArgsConstructor; +import org.springframework.web.bind.annotation.*; + +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; + +/** + * 在线用户监控 + * + * @author Lion Li + */ +@RequiredArgsConstructor +@RestController +@RequestMapping("/monitor/online") +public class SysUserOnlineController extends BaseController { + + /** + * 获取在线用户监控列表 + * + * @param ipaddr IP地址 + * @param userName 用户名 + */ + @SaCheckPermission("monitor:online:list") + @GetMapping("/list") + public TableDataInfo list(String ipaddr, String userName) { + // 获取所有未过期的 token + List keys = StpUtil.searchTokenValue("", 0, -1, false); + List userOnlineDTOList = new ArrayList<>(); + for (String key : keys) { + String token = StringUtils.substringAfterLast(key, ":"); + // 如果已经过期则跳过 + if (StpUtil.stpLogic.getTokenActiveTimeoutByToken(token) < -1) { + continue; + } + userOnlineDTOList.add(RedisUtils.getCacheObject(CacheConstants.ONLINE_TOKEN_KEY + token)); + } + if (StringUtils.isNotEmpty(ipaddr) && StringUtils.isNotEmpty(userName)) { + userOnlineDTOList = StreamUtils.filter(userOnlineDTOList, userOnline -> + StringUtils.equals(ipaddr, userOnline.getIpaddr()) && + StringUtils.equals(userName, userOnline.getUserName()) + ); + } else if (StringUtils.isNotEmpty(ipaddr)) { + userOnlineDTOList = StreamUtils.filter(userOnlineDTOList, userOnline -> + StringUtils.equals(ipaddr, userOnline.getIpaddr()) + ); + } else if (StringUtils.isNotEmpty(userName)) { + userOnlineDTOList = StreamUtils.filter(userOnlineDTOList, userOnline -> + StringUtils.equals(userName, userOnline.getUserName()) + ); + } + Collections.reverse(userOnlineDTOList); + userOnlineDTOList.removeAll(Collections.singleton(null)); + List userOnlineList = BeanUtil.copyToList(userOnlineDTOList, SysUserOnline.class); + return TableDataInfo.build(userOnlineList); + } + + /** + * 强退用户 + * + * @param tokenId token值 + */ + @SaCheckPermission("monitor:online:forceLogout") + @Log(title = "在线用户", businessType = BusinessType.FORCE) + @DeleteMapping("/{tokenId}") + public R forceLogout(@PathVariable String tokenId) { + try { + StpUtil.kickoutByTokenValue(tokenId); + } catch (NotLoginException ignored) { + } + return R.ok(); + } +} diff --git a/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/controller/system/CaptchaController.java b/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/controller/system/CaptchaController.java new file mode 100644 index 0000000..667bf48 --- /dev/null +++ b/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/controller/system/CaptchaController.java @@ -0,0 +1,102 @@ +package com.ruoyi.system.controller.system; + +import cn.dev33.satoken.annotation.SaIgnore; +import cn.hutool.captcha.AbstractCaptcha; +import cn.hutool.captcha.generator.CodeGenerator; +import cn.hutool.core.util.IdUtil; +import cn.hutool.core.util.RandomUtil; +import com.ruoyi.common.core.constant.CacheConstants; +import com.ruoyi.common.core.constant.Constants; +import com.ruoyi.common.core.domain.R; +import com.ruoyi.common.core.utils.SpringUtils; +import com.ruoyi.common.core.utils.StringUtils; +import com.ruoyi.common.core.utils.reflect.ReflectUtils; +import com.ruoyi.common.redis.utils.RedisUtils; +import com.ruoyi.common.web.config.properties.CaptchaProperties; +import com.ruoyi.common.web.enums.CaptchaType; +import jakarta.validation.constraints.NotBlank; +import lombok.RequiredArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.dromara.sms4j.api.SmsBlend; +import org.dromara.sms4j.api.entity.SmsResponse; +import org.dromara.sms4j.core.factory.SmsFactory; +import org.dromara.sms4j.provider.enumerate.SupplierType; +import org.springframework.expression.Expression; +import org.springframework.expression.ExpressionParser; +import org.springframework.expression.spel.standard.SpelExpressionParser; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RestController; + +import java.time.Duration; +import java.util.LinkedHashMap; +import java.util.Map; + +/** + * 验证码操作处理 + * + * @author Lion Li + */ +@SaIgnore +@Slf4j +@Validated +@RequiredArgsConstructor +@RestController +public class CaptchaController { + + private final CaptchaProperties captchaProperties; + + /** + * 短信验证码 + * + * @param phonenumber 用户手机号 + */ + @GetMapping("/captchaSms") + public R smsCaptcha(@NotBlank(message = "{user.phonenumber.not.blank}") String phonenumber) { + String key = CacheConstants.CAPTCHA_CODE_KEY + phonenumber; + String code = RandomUtil.randomNumbers(4); + RedisUtils.setCacheObject(key, code, Duration.ofMinutes(Constants.CAPTCHA_EXPIRATION)); + // 验证码模板id 自行处理 (查数据库或写死均可) + String templateId = ""; + LinkedHashMap map = new LinkedHashMap<>(1); + map.put("code", code); + SmsBlend smsBlend = SmsFactory.createSmsBlend(SupplierType.ALIBABA); + SmsResponse smsResponse = smsBlend.sendMessage(phonenumber, templateId, map); + if (!"OK".equals(smsResponse.getCode())) { + log.error("验证码短信发送异常 => {}", smsResponse); + return R.fail(smsResponse.getMessage()); + } + return R.ok(); + } + + /** + * 生成验证码 + */ + @GetMapping("/captchaImage") + public R> getCode() { + boolean captchaEnabled = captchaProperties.getEnable(); + if (!captchaEnabled) { + return R.ok(Map.of("captchaEnabled", captchaEnabled)); + } + // 保存验证码信息 + String uuid = IdUtil.simpleUUID(); + String verifyKey = CacheConstants.CAPTCHA_CODE_KEY + uuid; + // 生成验证码 + CaptchaType captchaType = captchaProperties.getType(); + boolean isMath = CaptchaType.MATH == captchaType; + Integer length = isMath ? captchaProperties.getNumberLength() : captchaProperties.getCharLength(); + CodeGenerator codeGenerator = ReflectUtils.newInstance(captchaType.getClazz(), length); + AbstractCaptcha captcha = SpringUtils.getBean(captchaProperties.getCategory().getClazz()); + captcha.setGenerator(codeGenerator); + captcha.createCode(); + String code = captcha.getCode(); + if (isMath) { + ExpressionParser parser = new SpelExpressionParser(); + Expression exp = parser.parseExpression(StringUtils.remove(code, "=")); + code = exp.getValue(String.class); + } + RedisUtils.setCacheObject(verifyKey, code, Duration.ofMinutes(Constants.CAPTCHA_EXPIRATION)); + return R.ok(Map.of("uuid", uuid, "img", captcha.getImageBase64())); + } + +} diff --git a/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/controller/system/SysConfigController.java b/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/controller/system/SysConfigController.java new file mode 100644 index 0000000..52dc8ea --- /dev/null +++ b/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/controller/system/SysConfigController.java @@ -0,0 +1,136 @@ +package com.ruoyi.system.controller.system; + +import cn.dev33.satoken.annotation.SaCheckPermission; +import com.ruoyi.common.log.annotation.Log; +import com.ruoyi.common.web.core.BaseController; +import com.rouyi.common.mybatis.core.page.PageQuery; +import com.ruoyi.common.core.domain.R; +import com.rouyi.common.mybatis.core.page.TableDataInfo; +import com.ruoyi.common.log.enums.BusinessType; +import com.ruoyi.common.excel.utils.ExcelUtil; +import com.ruoyi.system.domain.entity.SysConfig; +import com.ruoyi.system.service.ISysConfigService; +import jakarta.servlet.http.HttpServletResponse; +import lombok.RequiredArgsConstructor; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.*; + +import java.util.List; + +/** + * 参数配置 信息操作处理 + * + * @author Lion Li + */ +@Validated +@RequiredArgsConstructor +@RestController +@RequestMapping("/system/config") +public class SysConfigController extends BaseController { + + private final ISysConfigService configService; + + /** + * 获取参数配置列表 + */ + @SaCheckPermission("system:config:list") + @GetMapping("/list") + public TableDataInfo list(SysConfig config, PageQuery pageQuery) { + return configService.selectPageConfigList(config, pageQuery); + } + + /** + * 导出参数配置列表 + */ + @Log(title = "参数管理", businessType = BusinessType.EXPORT) + @SaCheckPermission("system:config:export") + @PostMapping("/export") + public void export(SysConfig config, HttpServletResponse response) { + List list = configService.selectConfigList(config); + ExcelUtil.exportExcel(list, "参数数据", SysConfig.class, response); + } + + /** + * 根据参数编号获取详细信息 + * + * @param configId 参数ID + */ + @SaCheckPermission("system:config:query") + @GetMapping(value = "/{configId}") + public R getInfo(@PathVariable Long configId) { + return R.ok(configService.selectConfigById(configId)); + } + + /** + * 根据参数键名查询参数值 + * + * @param configKey 参数Key + */ + @GetMapping(value = "/configKey/{configKey}") + public R getConfigKey(@PathVariable String configKey) { + return R.ok(configService.selectConfigByKey(configKey)); + } + + /** + * 新增参数配置 + */ + @SaCheckPermission("system:config:add") + @Log(title = "参数管理", businessType = BusinessType.INSERT) + @PostMapping + public R add(@Validated @RequestBody SysConfig config) { + if (!configService.checkConfigKeyUnique(config)) { + return R.fail("新增参数'" + config.getConfigName() + "'失败,参数键名已存在"); + } + configService.insertConfig(config); + return R.ok(); + } + + /** + * 修改参数配置 + */ + @SaCheckPermission("system:config:edit") + @Log(title = "参数管理", businessType = BusinessType.UPDATE) + @PutMapping + public R edit(@Validated @RequestBody SysConfig config) { + if (!configService.checkConfigKeyUnique(config)) { + return R.fail("修改参数'" + config.getConfigName() + "'失败,参数键名已存在"); + } + configService.updateConfig(config); + return R.ok(); + } + + /** + * 根据参数键名修改参数配置 + */ + @SaCheckPermission("system:config:edit") + @Log(title = "参数管理", businessType = BusinessType.UPDATE) + @PutMapping("/updateByKey") + public R updateByKey(@RequestBody SysConfig config) { + configService.updateConfig(config); + return R.ok(); + } + + /** + * 删除参数配置 + * + * @param configIds 参数ID串 + */ + @SaCheckPermission("system:config:remove") + @Log(title = "参数管理", businessType = BusinessType.DELETE) + @DeleteMapping("/{configIds}") + public R remove(@PathVariable Long[] configIds) { + configService.deleteConfigByIds(configIds); + return R.ok(); + } + + /** + * 刷新参数缓存 + */ + @SaCheckPermission("system:config:remove") + @Log(title = "参数管理", businessType = BusinessType.CLEAN) + @DeleteMapping("/refreshCache") + public R refreshCache() { + configService.resetConfigCache(); + return R.ok(); + } +} diff --git a/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/controller/system/SysDeptController.java b/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/controller/system/SysDeptController.java new file mode 100644 index 0000000..0e77c60 --- /dev/null +++ b/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/controller/system/SysDeptController.java @@ -0,0 +1,122 @@ +package com.ruoyi.system.controller.system; + +import cn.dev33.satoken.annotation.SaCheckPermission; +import cn.hutool.core.convert.Convert; +import com.ruoyi.common.log.annotation.Log; +import com.ruoyi.common.core.constant.UserConstants; +import com.ruoyi.common.web.core.BaseController; +import com.ruoyi.common.core.domain.R; +import com.ruoyi.system.domain.entity.SysDept; +import com.ruoyi.common.log.enums.BusinessType; +import com.ruoyi.common.core.utils.StringUtils; +import com.ruoyi.system.service.ISysDeptService; +import lombok.RequiredArgsConstructor; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.*; + +import java.util.List; + +/** + * 部门信息 + * + * @author Lion Li + */ +@Validated +@RequiredArgsConstructor +@RestController +@RequestMapping("/system/dept") +public class SysDeptController extends BaseController { + + private final ISysDeptService deptService; + + /** + * 获取部门列表 + */ + @SaCheckPermission("system:dept:list") + @GetMapping("/list") + public R> list(SysDept dept) { + List depts = deptService.selectDeptList(dept); + return R.ok(depts); + } + + /** + * 查询部门列表(排除节点) + * + * @param deptId 部门ID + */ + @SaCheckPermission("system:dept:list") + @GetMapping("/list/exclude/{deptId}") + public R> excludeChild(@PathVariable(value = "deptId", required = false) Long deptId) { + List depts = deptService.selectDeptList(new SysDept()); + depts.removeIf(d -> d.getDeptId().equals(deptId) + || StringUtils.splitList(d.getAncestors()).contains(Convert.toStr(deptId))); + return R.ok(depts); + } + + /** + * 根据部门编号获取详细信息 + * + * @param deptId 部门ID + */ + @SaCheckPermission("system:dept:query") + @GetMapping(value = "/{deptId}") + public R getInfo(@PathVariable Long deptId) { + deptService.checkDeptDataScope(deptId); + return R.ok(deptService.selectDeptById(deptId)); + } + + /** + * 新增部门 + */ + @SaCheckPermission("system:dept:add") + @Log(title = "部门管理", businessType = BusinessType.INSERT) + @PostMapping + public R add(@Validated @RequestBody SysDept dept) { + if (!deptService.checkDeptNameUnique(dept)) { + return R.fail("新增部门'" + dept.getDeptName() + "'失败,部门名称已存在"); + } + return toAjax(deptService.insertDept(dept)); + } + + /** + * 修改部门 + */ + @SaCheckPermission("system:dept:edit") + @Log(title = "部门管理", businessType = BusinessType.UPDATE) + @PutMapping + public R edit(@Validated @RequestBody SysDept dept) { + Long deptId = dept.getDeptId(); + deptService.checkDeptDataScope(deptId); + if (!deptService.checkDeptNameUnique(dept)) { + return R.fail("修改部门'" + dept.getDeptName() + "'失败,部门名称已存在"); + } else if (dept.getParentId().equals(deptId)) { + return R.fail("修改部门'" + dept.getDeptName() + "'失败,上级部门不能是自己"); + } else if (StringUtils.equals(UserConstants.DEPT_DISABLE, dept.getStatus())) { + if (deptService.selectNormalChildrenDeptById(deptId) > 0) { + return R.fail("该部门包含未停用的子部门!"); + } else if (deptService.checkDeptExistUser(deptId)) { + return R.fail("该部门下存在已分配用户,不能禁用!"); + } + } + return toAjax(deptService.updateDept(dept)); + } + + /** + * 删除部门 + * + * @param deptId 部门ID + */ + @SaCheckPermission("system:dept:remove") + @Log(title = "部门管理", businessType = BusinessType.DELETE) + @DeleteMapping("/{deptId}") + public R remove(@PathVariable Long deptId) { + if (deptService.hasChildByDeptId(deptId)) { + return R.warn("存在下级部门,不允许删除"); + } + if (deptService.checkDeptExistUser(deptId)) { + return R.warn("部门存在用户,不允许删除"); + } + deptService.checkDeptDataScope(deptId); + return toAjax(deptService.deleteDeptById(deptId)); + } +} diff --git a/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/controller/system/SysDictDataController.java b/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/controller/system/SysDictDataController.java new file mode 100644 index 0000000..9aac5f1 --- /dev/null +++ b/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/controller/system/SysDictDataController.java @@ -0,0 +1,116 @@ +package com.ruoyi.system.controller.system; + +import cn.dev33.satoken.annotation.SaCheckPermission; +import cn.hutool.core.util.ObjectUtil; +import com.ruoyi.common.log.annotation.Log; +import com.ruoyi.common.web.core.BaseController; +import com.rouyi.common.mybatis.core.page.PageQuery; +import com.ruoyi.common.core.domain.R; +import com.rouyi.common.mybatis.core.page.TableDataInfo; +import com.ruoyi.common.log.enums.BusinessType; +import com.ruoyi.common.excel.utils.ExcelUtil; +import com.ruoyi.system.domain.entity.SysDictData; +import com.ruoyi.system.service.ISysDictDataService; +import com.ruoyi.system.service.ISysDictTypeService; +import jakarta.servlet.http.HttpServletResponse; +import lombok.RequiredArgsConstructor; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.*; + +import java.util.ArrayList; +import java.util.List; + +/** + * 数据字典信息 + * + * @author Lion Li + */ +@Validated +@RequiredArgsConstructor +@RestController +@RequestMapping("/system/dict/data") +public class SysDictDataController extends BaseController { + + private final ISysDictDataService dictDataService; + private final ISysDictTypeService dictTypeService; + + /** + * 查询字典数据列表 + */ + @SaCheckPermission("system:dict:list") + @GetMapping("/list") + public TableDataInfo list(SysDictData dictData, PageQuery pageQuery) { + return dictDataService.selectPageDictDataList(dictData, pageQuery); + } + + /** + * 导出字典数据列表 + */ + @Log(title = "字典数据", businessType = BusinessType.EXPORT) + @SaCheckPermission("system:dict:export") + @PostMapping("/export") + public void export(SysDictData dictData, HttpServletResponse response) { + List list = dictDataService.selectDictDataList(dictData); + ExcelUtil.exportExcel(list, "字典数据", SysDictData.class, response); + } + + /** + * 查询字典数据详细 + * + * @param dictCode 字典code + */ + @SaCheckPermission("system:dict:query") + @GetMapping(value = "/{dictCode}") + public R getInfo(@PathVariable Long dictCode) { + return R.ok(dictDataService.selectDictDataById(dictCode)); + } + + /** + * 根据字典类型查询字典数据信息 + * + * @param dictType 字典类型 + */ + @GetMapping(value = "/type/{dictType}") + public R> dictType(@PathVariable String dictType) { + List data = dictTypeService.selectDictDataByType(dictType); + if (ObjectUtil.isNull(data)) { + data = new ArrayList<>(); + } + return R.ok(data); + } + + /** + * 新增字典类型 + */ + @SaCheckPermission("system:dict:add") + @Log(title = "字典数据", businessType = BusinessType.INSERT) + @PostMapping + public R add(@Validated @RequestBody SysDictData dict) { + dictDataService.insertDictData(dict); + return R.ok(); + } + + /** + * 修改保存字典类型 + */ + @SaCheckPermission("system:dict:edit") + @Log(title = "字典数据", businessType = BusinessType.UPDATE) + @PutMapping + public R edit(@Validated @RequestBody SysDictData dict) { + dictDataService.updateDictData(dict); + return R.ok(); + } + + /** + * 删除字典类型 + * + * @param dictCodes 字典code串 + */ + @SaCheckPermission("system:dict:remove") + @Log(title = "字典类型", businessType = BusinessType.DELETE) + @DeleteMapping("/{dictCodes}") + public R remove(@PathVariable Long[] dictCodes) { + dictDataService.deleteDictDataByIds(dictCodes); + return R.ok(); + } +} diff --git a/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/controller/system/SysDictTypeController.java b/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/controller/system/SysDictTypeController.java new file mode 100644 index 0000000..fea905f --- /dev/null +++ b/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/controller/system/SysDictTypeController.java @@ -0,0 +1,124 @@ +package com.ruoyi.system.controller.system; + +import cn.dev33.satoken.annotation.SaCheckPermission; +import com.ruoyi.common.log.annotation.Log; +import com.ruoyi.common.web.core.BaseController; +import com.rouyi.common.mybatis.core.page.PageQuery; +import com.ruoyi.common.core.domain.R; +import com.rouyi.common.mybatis.core.page.TableDataInfo; +import com.ruoyi.common.log.enums.BusinessType; +import com.ruoyi.common.excel.utils.ExcelUtil; +import com.ruoyi.system.domain.entity.SysDictType; +import com.ruoyi.system.service.ISysDictTypeService; +import jakarta.servlet.http.HttpServletResponse; +import lombok.RequiredArgsConstructor; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.*; + +import java.util.List; + +/** + * 数据字典信息 + * + * @author Lion Li + */ +@Validated +@RequiredArgsConstructor +@RestController +@RequestMapping("/system/dict/type") +public class SysDictTypeController extends BaseController { + + private final ISysDictTypeService dictTypeService; + + /** + * 查询字典类型列表 + */ + @SaCheckPermission("system:dict:list") + @GetMapping("/list") + public TableDataInfo list(SysDictType dictType, PageQuery pageQuery) { + return dictTypeService.selectPageDictTypeList(dictType, pageQuery); + } + + /** + * 导出字典类型列表 + */ + @Log(title = "字典类型", businessType = BusinessType.EXPORT) + @SaCheckPermission("system:dict:export") + @PostMapping("/export") + public void export(SysDictType dictType, HttpServletResponse response) { + List list = dictTypeService.selectDictTypeList(dictType); + ExcelUtil.exportExcel(list, "字典类型", SysDictType.class, response); + } + + /** + * 查询字典类型详细 + * + * @param dictId 字典ID + */ + @SaCheckPermission("system:dict:query") + @GetMapping(value = "/{dictId}") + public R getInfo(@PathVariable Long dictId) { + return R.ok(dictTypeService.selectDictTypeById(dictId)); + } + + /** + * 新增字典类型 + */ + @SaCheckPermission("system:dict:add") + @Log(title = "字典类型", businessType = BusinessType.INSERT) + @PostMapping + public R add(@Validated @RequestBody SysDictType dict) { + if (!dictTypeService.checkDictTypeUnique(dict)) { + return R.fail("新增字典'" + dict.getDictName() + "'失败,字典类型已存在"); + } + dictTypeService.insertDictType(dict); + return R.ok(); + } + + /** + * 修改字典类型 + */ + @SaCheckPermission("system:dict:edit") + @Log(title = "字典类型", businessType = BusinessType.UPDATE) + @PutMapping + public R edit(@Validated @RequestBody SysDictType dict) { + if (!dictTypeService.checkDictTypeUnique(dict)) { + return R.fail("修改字典'" + dict.getDictName() + "'失败,字典类型已存在"); + } + dictTypeService.updateDictType(dict); + return R.ok(); + } + + /** + * 删除字典类型 + * + * @param dictIds 字典ID串 + */ + @SaCheckPermission("system:dict:remove") + @Log(title = "字典类型", businessType = BusinessType.DELETE) + @DeleteMapping("/{dictIds}") + public R remove(@PathVariable Long[] dictIds) { + dictTypeService.deleteDictTypeByIds(dictIds); + return R.ok(); + } + + /** + * 刷新字典缓存 + */ + @SaCheckPermission("system:dict:remove") + @Log(title = "字典类型", businessType = BusinessType.CLEAN) + @DeleteMapping("/refreshCache") + public R refreshCache() { + dictTypeService.resetDictCache(); + return R.ok(); + } + + /** + * 获取字典选择框列表 + */ + @GetMapping("/optionselect") + public R> optionselect() { + List dictTypes = dictTypeService.selectDictTypeAll(); + return R.ok(dictTypes); + } +} diff --git a/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/controller/system/SysIndexController.java b/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/controller/system/SysIndexController.java new file mode 100644 index 0000000..dabd2dc --- /dev/null +++ b/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/controller/system/SysIndexController.java @@ -0,0 +1,32 @@ +package com.ruoyi.system.controller.system; + +import cn.dev33.satoken.annotation.SaIgnore; +import com.ruoyi.common.core.config.RuoYiConfig; +import com.ruoyi.common.core.utils.StringUtils; +import lombok.RequiredArgsConstructor; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RestController; + +/** + * 首页 + * + * @author Lion Li + */ +@RequiredArgsConstructor +@RestController +public class SysIndexController { + + /** + * 系统基础配置 + */ + private final RuoYiConfig ruoyiConfig; + + /** + * 访问首页,提示语 + */ + @SaIgnore + @GetMapping("/") + public String index() { + return StringUtils.format("欢迎使用{}后台管理框架,当前版本:v{},请通过前端地址访问。", ruoyiConfig.getName(), ruoyiConfig.getVersion()); + } +} diff --git a/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/controller/system/SysLoginController.java b/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/controller/system/SysLoginController.java new file mode 100644 index 0000000..d36fb75 --- /dev/null +++ b/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/controller/system/SysLoginController.java @@ -0,0 +1,137 @@ +package com.ruoyi.system.controller.system; + +import cn.dev33.satoken.annotation.SaIgnore; +import com.ruoyi.common.core.constant.Constants; +import com.ruoyi.common.core.domain.R; +import com.ruoyi.system.domain.entity.SysMenu; +import com.ruoyi.system.domain.entity.SysUser; +import com.ruoyi.common.core.domain.bo.EmailLoginBody; +import com.ruoyi.common.core.domain.bo.LoginBody; +import com.ruoyi.common.core.domain.bo.LoginUser; +import com.ruoyi.common.core.domain.bo.SmsLoginBody; +import com.ruoyi.common.satoken.utils.LoginHelper; +import com.ruoyi.system.domain.vo.RouterVo; +import com.ruoyi.system.service.ISysMenuService; +import com.ruoyi.system.service.ISysUserService; +import com.ruoyi.system.service.SysLoginService; +import lombok.RequiredArgsConstructor; +import org.springframework.validation.annotation.Validated; +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 jakarta.validation.constraints.NotBlank; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +/** + * 登录验证 + * + * @author Lion Li + */ +@Validated +@RequiredArgsConstructor +@RestController +public class SysLoginController { + + private final SysLoginService loginService; + private final ISysMenuService menuService; + private final ISysUserService userService; + + /** + * 登录方法 + * + * @param loginBody 登录信息 + * @return 结果 + */ + @SaIgnore + @PostMapping("/login") + public R> login(@Validated @RequestBody LoginBody loginBody) { + // 生成令牌 + String token = loginService.login(loginBody.getUsername(), loginBody.getPassword(), loginBody.getCode(), + loginBody.getUuid()); + return R.ok(Map.of(Constants.TOKEN, token)); + } + + /** + * 短信登录 + * + * @param smsLoginBody 登录信息 + * @return 结果 + */ + @SaIgnore + @PostMapping("/smsLogin") + public R> smsLogin(@Validated @RequestBody SmsLoginBody smsLoginBody) { + // 生成令牌 + String token = loginService.smsLogin(smsLoginBody.getPhonenumber(), smsLoginBody.getSmsCode()); + return R.ok(Map.of(Constants.TOKEN, token)); + } + + /** + * 邮件登录 + * + * @param body 登录信息 + * @return 结果 + */ + @PostMapping("/emailLogin") + public R> emailLogin(@Validated @RequestBody EmailLoginBody body) { + // 生成令牌 + String token = loginService.emailLogin(body.getEmail(), body.getEmailCode()); + return R.ok(Map.of(Constants.TOKEN, token)); + } + + /** + * 小程序登录(示例) + * + * @param xcxCode 小程序code + * @return 结果 + */ + @SaIgnore + @PostMapping("/xcxLogin") + public R> xcxLogin(@NotBlank(message = "{xcx.code.not.blank}") String xcxCode) { + Map ajax = new HashMap<>(); + // 生成令牌 + String token = loginService.xcxLogin(xcxCode); + return R.ok(Map.of(Constants.TOKEN, token)); + } + + /** + * 退出登录 + */ + @SaIgnore + @PostMapping("/logout") + public R logout() { + loginService.logout(); + return R.ok("退出成功"); + } + + /** + * 获取用户信息 + * + * @return 用户信息 + */ + @GetMapping("getInfo") + public R> getInfo() { + LoginUser loginUser = LoginHelper.getLoginUser(); + SysUser user = userService.selectUserById(loginUser.getUserId()); + return R.ok(Map.of( + "user", user, + "roles", loginUser.getRolePermission(), + "permissions", loginUser.getMenuPermission() + ) + ); + } + + /** + * 获取路由信息 + * + * @return 路由信息 + */ + @GetMapping("getRouters") + public R> getRouters() { + List menus = menuService.selectMenuTreeByUserId(LoginHelper.getUserId()); + return R.ok(menuService.buildMenus(menus)); + } +} diff --git a/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/controller/system/SysMenuController.java b/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/controller/system/SysMenuController.java new file mode 100644 index 0000000..9f3d754 --- /dev/null +++ b/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/controller/system/SysMenuController.java @@ -0,0 +1,126 @@ +package com.ruoyi.system.controller.system; + +import cn.dev33.satoken.annotation.SaCheckPermission; +import cn.hutool.core.lang.tree.Tree; +import com.ruoyi.common.log.annotation.Log; +import com.ruoyi.common.core.constant.UserConstants; +import com.ruoyi.common.core.domain.R; +import com.ruoyi.common.log.enums.BusinessType; +import com.ruoyi.common.core.utils.StringUtils; +import com.ruoyi.common.satoken.utils.LoginHelper; +import com.ruoyi.common.web.core.BaseController; +import com.ruoyi.system.domain.entity.SysMenu; +import com.ruoyi.system.service.ISysMenuService; +import lombok.RequiredArgsConstructor; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.*; + +import java.util.List; +import java.util.Map; + +/** + * 菜单信息 + * + * @author Lion Li + */ +@Validated +@RequiredArgsConstructor +@RestController +@RequestMapping("/system/menu") +public class SysMenuController extends BaseController { + + private final ISysMenuService menuService; + + /** + * 获取菜单列表 + */ + @SaCheckPermission("system:menu:list") + @GetMapping("/list") + public R> list(SysMenu menu) { + List menus = menuService.selectMenuList(menu, LoginHelper.getUserId()); + return R.ok(menus); + } + + /** + * 根据菜单编号获取详细信息 + * + * @param menuId 菜单ID + */ + @SaCheckPermission("system:menu:query") + @GetMapping(value = "/{menuId}") + public R getInfo(@PathVariable Long menuId) { + return R.ok(menuService.selectMenuById(menuId)); + } + + /** + * 获取菜单下拉树列表 + */ + @GetMapping("/treeselect") + public R>> treeselect(SysMenu menu) { + List menus = menuService.selectMenuList(menu, LoginHelper.getUserId()); + return R.ok(menuService.buildMenuTreeSelect(menus)); + } + + /** + * 加载对应角色菜单列表树 + * + * @param roleId 角色ID + */ + @GetMapping(value = "/roleMenuTreeselect/{roleId}") + public R> roleMenuTreeselect(@PathVariable("roleId") Long roleId) { + List menus = menuService.selectMenuList(LoginHelper.getUserId()); + return R.ok(Map.of( + "checkedKeys", menuService.selectMenuListByRoleId(roleId), + "menus", menuService.buildMenuTreeSelect(menus) + )); + } + /** + * 新增菜单 + */ + @SaCheckPermission("system:menu:add") + @Log(title = "菜单管理", businessType = BusinessType.INSERT) + @PostMapping + public R add(@Validated @RequestBody SysMenu menu) { + if (!menuService.checkMenuNameUnique(menu)) { + return R.fail("新增菜单'" + menu.getMenuName() + "'失败,菜单名称已存在"); + } else if (UserConstants.YES_FRAME.equals(menu.getIsFrame()) && !StringUtils.ishttp(menu.getPath())) { + return R.fail("新增菜单'" + menu.getMenuName() + "'失败,地址必须以http(s)://开头"); + } + return toAjax(menuService.insertMenu(menu)); + } + + /** + * 修改菜单 + */ + @SaCheckPermission("system:menu:edit") + @Log(title = "菜单管理", businessType = BusinessType.UPDATE) + @PutMapping + public R edit(@Validated @RequestBody SysMenu menu) { + if (!menuService.checkMenuNameUnique(menu)) { + return R.fail("修改菜单'" + menu.getMenuName() + "'失败,菜单名称已存在"); + } else if (UserConstants.YES_FRAME.equals(menu.getIsFrame()) && !StringUtils.ishttp(menu.getPath())) { + return R.fail("修改菜单'" + menu.getMenuName() + "'失败,地址必须以http(s)://开头"); + } else if (menu.getMenuId().equals(menu.getParentId())) { + return R.fail("修改菜单'" + menu.getMenuName() + "'失败,上级菜单不能选择自己"); + } + return toAjax(menuService.updateMenu(menu)); + } + + /** + * 删除菜单 + * + * @param menuId 菜单ID + */ + @SaCheckPermission("system:menu:remove") + @Log(title = "菜单管理", businessType = BusinessType.DELETE) + @DeleteMapping("/{menuId}") + public R remove(@PathVariable("menuId") Long menuId) { + if (menuService.hasChildByMenuId(menuId)) { + return R.warn("存在子菜单,不允许删除"); + } + if (menuService.checkMenuExistRole(menuId)) { + return R.warn("菜单已分配,不允许删除"); + } + return toAjax(menuService.deleteMenuById(menuId)); + } +} diff --git a/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/controller/system/SysNoticeController.java b/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/controller/system/SysNoticeController.java new file mode 100644 index 0000000..48a76ba --- /dev/null +++ b/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/controller/system/SysNoticeController.java @@ -0,0 +1,80 @@ +package com.ruoyi.system.controller.system; + +import cn.dev33.satoken.annotation.SaCheckPermission; +import com.ruoyi.common.log.annotation.Log; +import com.ruoyi.common.web.core.BaseController; +import com.rouyi.common.mybatis.core.page.PageQuery; +import com.ruoyi.common.core.domain.R; +import com.rouyi.common.mybatis.core.page.TableDataInfo; +import com.ruoyi.common.log.enums.BusinessType; +import com.ruoyi.system.domain.entity.SysNotice; +import com.ruoyi.system.service.ISysNoticeService; +import lombok.RequiredArgsConstructor; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.*; + +/** + * 公告 信息操作处理 + * + * @author Lion Li + */ +@Validated +@RequiredArgsConstructor +@RestController +@RequestMapping("/system/notice") +public class SysNoticeController extends BaseController { + + private final ISysNoticeService noticeService; + + /** + * 获取通知公告列表 + */ + @SaCheckPermission("system:notice:list") + @GetMapping("/list") + public TableDataInfo list(SysNotice notice, PageQuery pageQuery) { + return noticeService.selectPageNoticeList(notice, pageQuery); + } + + /** + * 根据通知公告编号获取详细信息 + * + * @param noticeId 公告ID + */ + @SaCheckPermission("system:notice:query") + @GetMapping(value = "/{noticeId}") + public R getInfo(@PathVariable Long noticeId) { + return R.ok(noticeService.selectNoticeById(noticeId)); + } + + /** + * 新增通知公告 + */ + @SaCheckPermission("system:notice:add") + @Log(title = "通知公告", businessType = BusinessType.INSERT) + @PostMapping + public R add(@Validated @RequestBody SysNotice notice) { + return toAjax(noticeService.insertNotice(notice)); + } + + /** + * 修改通知公告 + */ + @SaCheckPermission("system:notice:edit") + @Log(title = "通知公告", businessType = BusinessType.UPDATE) + @PutMapping + public R edit(@Validated @RequestBody SysNotice notice) { + return toAjax(noticeService.updateNotice(notice)); + } + + /** + * 删除通知公告 + * + * @param noticeIds 公告ID串 + */ + @SaCheckPermission("system:notice:remove") + @Log(title = "通知公告", businessType = BusinessType.DELETE) + @DeleteMapping("/{noticeIds}") + public R remove(@PathVariable Long[] noticeIds) { + return toAjax(noticeService.deleteNoticeByIds(noticeIds)); + } +} diff --git a/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/controller/system/SysOssConfigController.java b/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/controller/system/SysOssConfigController.java new file mode 100644 index 0000000..78c7c96 --- /dev/null +++ b/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/controller/system/SysOssConfigController.java @@ -0,0 +1,105 @@ +package com.ruoyi.system.controller.system; + +import cn.dev33.satoken.annotation.SaCheckPermission; +import com.rouyi.common.mybatis.core.page.PageQuery; +import com.rouyi.common.mybatis.core.page.TableDataInfo; +import com.ruoyi.common.core.domain.R; +import com.ruoyi.common.core.validate.AddGroup; +import com.ruoyi.common.core.validate.EditGroup; +import com.ruoyi.common.core.validate.QueryGroup; +import com.ruoyi.common.idempotent.annotation.RepeatSubmit; +import com.ruoyi.common.log.annotation.Log; +import com.ruoyi.common.log.enums.BusinessType; +import com.ruoyi.common.web.core.BaseController; +import com.ruoyi.system.domain.bo.SysOssConfigBo; +import com.ruoyi.system.domain.vo.SysOssConfigVo; +import com.ruoyi.system.service.ISysOssConfigService; +import jakarta.validation.constraints.NotEmpty; +import jakarta.validation.constraints.NotNull; +import lombok.RequiredArgsConstructor; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.*; + +import java.util.List; + +/** + * 对象存储配置 + * + * @author Lion Li + * @author 孤舟烟雨 + * @date 2021-08-13 + */ +@Validated +@RequiredArgsConstructor +@RestController +@RequestMapping("/system/oss/config") +public class SysOssConfigController extends BaseController { + + private final ISysOssConfigService iSysOssConfigService; + + /** + * 查询对象存储配置列表 + */ + @SaCheckPermission("system:oss:list") + @GetMapping("/list") + public TableDataInfo list(@Validated(QueryGroup.class) SysOssConfigBo bo, PageQuery pageQuery) { + return iSysOssConfigService.queryPageList(bo, pageQuery); + } + + /** + * 获取对象存储配置详细信息 + * + * @param ossConfigId OSS配置ID + */ + @SaCheckPermission("system:oss:query") + @GetMapping("/{ossConfigId}") + public R getInfo(@NotNull(message = "主键不能为空") + @PathVariable Long ossConfigId) { + return R.ok(iSysOssConfigService.queryById(ossConfigId)); + } + + /** + * 新增对象存储配置 + */ + @SaCheckPermission("system:oss:add") + @Log(title = "对象存储配置", businessType = BusinessType.INSERT) + @RepeatSubmit() + @PostMapping() + public R add(@Validated(AddGroup.class) @RequestBody SysOssConfigBo bo) { + return toAjax(iSysOssConfigService.insertByBo(bo)); + } + + /** + * 修改对象存储配置 + */ + @SaCheckPermission("system:oss:edit") + @Log(title = "对象存储配置", businessType = BusinessType.UPDATE) + @RepeatSubmit() + @PutMapping() + public R edit(@Validated(EditGroup.class) @RequestBody SysOssConfigBo bo) { + return toAjax(iSysOssConfigService.updateByBo(bo)); + } + + /** + * 删除对象存储配置 + * + * @param ossConfigIds OSS配置ID串 + */ + @SaCheckPermission("system:oss:remove") + @Log(title = "对象存储配置", businessType = BusinessType.DELETE) + @DeleteMapping("/{ossConfigIds}") + public R remove(@NotEmpty(message = "主键不能为空") + @PathVariable Long[] ossConfigIds) { + return toAjax(iSysOssConfigService.deleteWithValidByIds(List.of(ossConfigIds), true)); + } + + /** + * 状态修改 + */ + @SaCheckPermission("system:oss:edit") + @Log(title = "对象存储状态修改", businessType = BusinessType.UPDATE) + @PutMapping("/changeStatus") + public R changeStatus(@RequestBody SysOssConfigBo bo) { + return toAjax(iSysOssConfigService.updateOssConfigStatus(bo)); + } +} diff --git a/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/controller/system/SysOssController.java b/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/controller/system/SysOssController.java new file mode 100644 index 0000000..af0773c --- /dev/null +++ b/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/controller/system/SysOssController.java @@ -0,0 +1,109 @@ +package com.ruoyi.system.controller.system; + + +import cn.dev33.satoken.annotation.SaCheckPermission; +import cn.hutool.core.util.ObjectUtil; +import com.ruoyi.common.log.annotation.Log; +import com.ruoyi.common.web.core.BaseController; +import com.rouyi.common.mybatis.core.page.PageQuery; +import com.ruoyi.common.core.domain.R; +import com.rouyi.common.mybatis.core.page.TableDataInfo; +import com.ruoyi.common.core.validate.QueryGroup; +import com.ruoyi.common.log.enums.BusinessType; +import com.ruoyi.common.core.exception.ServiceException; +import com.ruoyi.system.domain.bo.SysOssBo; +import com.ruoyi.system.domain.vo.SysOssVo; +import com.ruoyi.system.service.ISysOssService; +import lombok.RequiredArgsConstructor; +import org.springframework.http.MediaType; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.*; +import org.springframework.web.multipart.MultipartFile; + +import jakarta.servlet.http.HttpServletResponse; +import jakarta.validation.constraints.NotEmpty; +import java.io.IOException; +import java.util.Arrays; +import java.util.List; +import java.util.Map; + +/** + * 文件上传 控制层 + * + * @author Lion Li + */ +@Validated +@RequiredArgsConstructor +@RestController +@RequestMapping("/system/oss") +public class SysOssController extends BaseController { + + private final ISysOssService iSysOssService; + + /** + * 查询OSS对象存储列表 + */ + @SaCheckPermission("system:oss:list") + @GetMapping("/list") + public TableDataInfo list(@Validated(QueryGroup.class) SysOssBo bo, PageQuery pageQuery) { + return iSysOssService.queryPageList(bo, pageQuery); + } + + /** + * 查询OSS对象基于id串 + * + * @param ossIds OSS对象ID串 + */ + @SaCheckPermission("system:oss:list") + @GetMapping("/listByIds/{ossIds}") + public R> listByIds(@NotEmpty(message = "主键不能为空") + @PathVariable Long[] ossIds) { + List list = iSysOssService.listByIds(Arrays.asList(ossIds)); + return R.ok(list); + } + + /** + * 上传OSS对象存储 + * + * @param file 文件 + */ + @SaCheckPermission("system:oss:upload") + @Log(title = "OSS对象存储", businessType = BusinessType.INSERT) + @PostMapping(value = "/upload", consumes = MediaType.MULTIPART_FORM_DATA_VALUE) + public R> upload(@RequestPart("file") MultipartFile file) { + if (ObjectUtil.isNull(file)) { + throw new ServiceException("上传文件不能为空"); + } + SysOssVo oss = iSysOssService.upload(file); + return R.ok(Map.of( + "url", oss.getUrl(), + "fileName", oss.getOriginalName(), + "ossId", oss.getOssId().toString() + )); + } + + /** + * 下载OSS对象 + * + * @param ossId OSS对象ID + */ + @SaCheckPermission("system:oss:download") + @GetMapping("/download/{ossId}") + public void download(@PathVariable Long ossId, HttpServletResponse response) throws IOException { + iSysOssService.download(ossId,response); + } + + /** + * 删除OSS对象存储 + * + * @param ossIds OSS对象ID串 + */ + @SaCheckPermission("system:oss:remove") + @Log(title = "OSS对象存储", businessType = BusinessType.DELETE) + @DeleteMapping("/{ossIds}") + public R remove(@NotEmpty(message = "主键不能为空") + @PathVariable Long[] ossIds) { + return toAjax(iSysOssService.deleteWithValidByIds(List.of(ossIds), true)); + } + +} diff --git a/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/controller/system/SysPostController.java b/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/controller/system/SysPostController.java new file mode 100644 index 0000000..3f227ff --- /dev/null +++ b/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/controller/system/SysPostController.java @@ -0,0 +1,120 @@ +package com.ruoyi.system.controller.system; + +import cn.dev33.satoken.annotation.SaCheckPermission; +import com.ruoyi.common.log.annotation.Log; +import com.ruoyi.common.core.constant.UserConstants; +import com.ruoyi.common.web.core.BaseController; +import com.rouyi.common.mybatis.core.page.PageQuery; +import com.ruoyi.common.core.domain.R; +import com.rouyi.common.mybatis.core.page.TableDataInfo; +import com.ruoyi.common.log.enums.BusinessType; +import com.ruoyi.common.excel.utils.ExcelUtil; +import com.ruoyi.system.domain.entity.SysPost; +import com.ruoyi.system.service.ISysPostService; +import jakarta.servlet.http.HttpServletResponse; +import lombok.RequiredArgsConstructor; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.*; + +import java.util.List; + +/** + * 岗位信息操作处理 + * + * @author Lion Li + */ +@Validated +@RequiredArgsConstructor +@RestController +@RequestMapping("/system/post") +public class SysPostController extends BaseController { + + private final ISysPostService postService; + + /** + * 获取岗位列表 + */ + @SaCheckPermission("system:post:list") + @GetMapping("/list") + public TableDataInfo list(SysPost post, PageQuery pageQuery) { + return postService.selectPagePostList(post, pageQuery); + } + + /** + * 导出岗位列表 + */ + @Log(title = "岗位管理", businessType = BusinessType.EXPORT) + @SaCheckPermission("system:post:export") + @PostMapping("/export") + public void export(SysPost post, HttpServletResponse response) { + List list = postService.selectPostList(post); + ExcelUtil.exportExcel(list, "岗位数据", SysPost.class, response); + } + + /** + * 根据岗位编号获取详细信息 + * + * @param postId 岗位ID + */ + @SaCheckPermission("system:post:query") + @GetMapping(value = "/{postId}") + public R getInfo(@PathVariable Long postId) { + return R.ok(postService.selectPostById(postId)); + } + + /** + * 新增岗位 + */ + @SaCheckPermission("system:post:add") + @Log(title = "岗位管理", businessType = BusinessType.INSERT) + @PostMapping + public R add(@Validated @RequestBody SysPost post) { + if (!postService.checkPostNameUnique(post)) { + return R.fail("新增岗位'" + post.getPostName() + "'失败,岗位名称已存在"); + } else if (!postService.checkPostCodeUnique(post)) { + return R.fail("新增岗位'" + post.getPostName() + "'失败,岗位编码已存在"); + } + return toAjax(postService.insertPost(post)); + } + + /** + * 修改岗位 + */ + @SaCheckPermission("system:post:edit") + @Log(title = "岗位管理", businessType = BusinessType.UPDATE) + @PutMapping + public R edit(@Validated @RequestBody SysPost post) { + if (!postService.checkPostNameUnique(post)) { + return R.fail("修改岗位'" + post.getPostName() + "'失败,岗位名称已存在"); + } else if (!postService.checkPostCodeUnique(post)) { + return R.fail("修改岗位'" + post.getPostName() + "'失败,岗位编码已存在"); + } else if (UserConstants.POST_DISABLE.equals(post.getStatus()) + && postService.countUserPostById(post.getPostId()) > 0) { + return R.fail("该岗位下存在已分配用户,不能禁用!"); + } + return toAjax(postService.updatePost(post)); + } + + /** + * 删除岗位 + * + * @param postIds 岗位ID串 + */ + @SaCheckPermission("system:post:remove") + @Log(title = "岗位管理", businessType = BusinessType.DELETE) + @DeleteMapping("/{postIds}") + public R remove(@PathVariable Long[] postIds) { + return toAjax(postService.deletePostByIds(postIds)); + } + + /** + * 获取岗位选择框列表 + */ + @GetMapping("/optionselect") + public R> optionselect() { + SysPost post = new SysPost(); + post.setStatus(UserConstants.POST_NORMAL); + List posts = postService.selectPostList(post); + return R.ok(posts); + } +} diff --git a/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/controller/system/SysProfileController.java b/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/controller/system/SysProfileController.java new file mode 100644 index 0000000..47c46c4 --- /dev/null +++ b/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/controller/system/SysProfileController.java @@ -0,0 +1,121 @@ +package com.ruoyi.system.controller.system; + +import cn.dev33.satoken.secure.BCrypt; +import cn.hutool.core.io.FileUtil; +import com.ruoyi.common.log.annotation.Log; +import com.ruoyi.common.web.core.BaseController; +import com.ruoyi.common.core.domain.R; +import com.ruoyi.system.domain.entity.SysUser; +import com.ruoyi.common.log.enums.BusinessType; +import com.ruoyi.common.satoken.utils.LoginHelper; +import com.ruoyi.common.core.utils.StringUtils; +import com.ruoyi.common.core.utils.file.MimeTypeUtils; +import com.ruoyi.system.domain.vo.SysOssVo; +import com.ruoyi.system.service.ISysOssService; +import com.ruoyi.system.service.ISysUserService; +import lombok.RequiredArgsConstructor; +import org.springframework.http.MediaType; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.*; +import org.springframework.web.multipart.MultipartFile; + +import java.util.Arrays; +import java.util.Map; + +/** + * 个人信息 业务处理 + * + * @author Lion Li + */ +@Validated +@RequiredArgsConstructor +@RestController +@RequestMapping("/system/user/profile") +public class SysProfileController extends BaseController { + + private final ISysUserService userService; + private final ISysOssService iSysOssService; + + /** + * 个人信息 + */ + @GetMapping + public R> profile() { + SysUser user = userService.selectUserById(LoginHelper.getUserId()); + return R.ok(Map.of( + "user", user, + "roleGroup", userService.selectUserRoleGroup(user.getUserName()), + "postGroup", userService.selectUserPostGroup(user.getUserName()) + )); + } + + /** + * 修改用户 + */ + @Log(title = "个人信息", businessType = BusinessType.UPDATE) + @PutMapping + public R updateProfile(@RequestBody SysUser user) { + if (StringUtils.isNotEmpty(user.getPhonenumber()) && !userService.checkPhoneUnique(user)) { + return R.fail("修改用户'" + user.getUserName() + "'失败,手机号码已存在"); + } + if (StringUtils.isNotEmpty(user.getEmail()) && !userService.checkEmailUnique(user)) { + return R.fail("修改用户'" + user.getUserName() + "'失败,邮箱账号已存在"); + } + user.setUserId(LoginHelper.getUserId()); + user.setUserName(null); + user.setPassword(null); + user.setAvatar(null); + user.setDeptId(null); + if (userService.updateUserProfile(user) > 0) { + return R.ok(); + } + return R.fail("修改个人信息异常,请联系管理员"); + } + + /** + * 重置密码 + * + * @param newPassword 新密码 + * @param oldPassword 旧密码 + */ + @Log(title = "个人信息", businessType = BusinessType.UPDATE) + @PutMapping("/updatePwd") + public R updatePwd(String oldPassword, String newPassword) { + SysUser user = userService.selectUserById(LoginHelper.getUserId()); + String userName = user.getUserName(); + String password = user.getPassword(); + if (!BCrypt.checkpw(oldPassword, password)) { + return R.fail("修改密码失败,旧密码错误"); + } + if (BCrypt.checkpw(newPassword, password)) { + return R.fail("新密码不能与旧密码相同"); + } + + if (userService.resetUserPwd(userName, BCrypt.hashpw(newPassword)) > 0) { + return R.ok(); + } + return R.fail("修改密码异常,请联系管理员"); + } + + /** + * 头像上传 + * + * @param avatarfile 用户头像 + */ + @Log(title = "用户头像", businessType = BusinessType.UPDATE) + @PostMapping(value = "/avatar", consumes = MediaType.MULTIPART_FORM_DATA_VALUE) + public R> avatar(@RequestPart("avatarfile") MultipartFile avatarfile) { + if (!avatarfile.isEmpty()) { + String extension = FileUtil.extName(avatarfile.getOriginalFilename()); + if (!StringUtils.equalsAnyIgnoreCase(extension, MimeTypeUtils.IMAGE_EXTENSION)) { + return R.fail("文件格式不正确,请上传" + Arrays.toString(MimeTypeUtils.IMAGE_EXTENSION) + "格式"); + } + SysOssVo oss = iSysOssService.upload(avatarfile); + String avatar = oss.getUrl(); + if (userService.updateUserAvatar(LoginHelper.getUsername(), avatar)) { + return R.ok(Map.of("imgUrl", avatar)); + } + } + return R.fail("上传图片异常,请联系管理员"); + } +} diff --git a/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/controller/system/SysRegisterController.java b/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/controller/system/SysRegisterController.java new file mode 100644 index 0000000..22eb799 --- /dev/null +++ b/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/controller/system/SysRegisterController.java @@ -0,0 +1,40 @@ +package com.ruoyi.system.controller.system; + +import cn.dev33.satoken.annotation.SaIgnore; +import com.ruoyi.common.web.core.BaseController; +import com.ruoyi.common.core.domain.R; +import com.ruoyi.common.core.domain.bo.RegisterBody; +import com.ruoyi.system.service.ISysConfigService; +import com.ruoyi.system.service.SysRegisterService; +import lombok.RequiredArgsConstructor; +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.RestController; + +/** + * 注册验证 + * + * @author Lion Li + */ +@Validated +@RequiredArgsConstructor +@RestController +public class SysRegisterController extends BaseController { + + private final SysRegisterService registerService; + private final ISysConfigService configService; + + /** + * 用户注册 + */ + @SaIgnore + @PostMapping("/register") + public R register(@Validated @RequestBody RegisterBody user) { + if (!("true".equals(configService.selectConfigByKey("sys.account.registerUser")))) { + return R.fail("当前系统没有开启注册功能!"); + } + registerService.register(user); + return R.ok(); + } +} diff --git a/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/controller/system/SysRoleController.java b/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/controller/system/SysRoleController.java new file mode 100644 index 0000000..ace2b53 --- /dev/null +++ b/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/controller/system/SysRoleController.java @@ -0,0 +1,227 @@ +package com.ruoyi.system.controller.system; + +import cn.dev33.satoken.annotation.SaCheckPermission; +import com.ruoyi.common.log.annotation.Log; +import com.ruoyi.common.web.core.BaseController; +import com.rouyi.common.mybatis.core.page.PageQuery; +import com.ruoyi.common.core.domain.R; +import com.rouyi.common.mybatis.core.page.TableDataInfo; +import com.ruoyi.common.log.enums.BusinessType; +import com.ruoyi.common.excel.utils.ExcelUtil; +import com.ruoyi.system.domain.entity.SysDept; +import com.ruoyi.system.domain.entity.SysRole; +import com.ruoyi.system.domain.entity.SysUser; +import com.ruoyi.system.domain.entity.SysUserRole; +import com.ruoyi.system.service.ISysDeptService; +import com.ruoyi.system.service.ISysRoleService; +import com.ruoyi.system.service.ISysUserService; +import com.ruoyi.system.service.SysPermissionService; +import jakarta.servlet.http.HttpServletResponse; +import lombok.RequiredArgsConstructor; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.*; + +import java.util.List; +import java.util.Map; + +/** + * 角色信息 + * + * @author Lion Li + */ +@Validated +@RequiredArgsConstructor +@RestController +@RequestMapping("/system/role") +public class SysRoleController extends BaseController { + + private final ISysRoleService roleService; + private final ISysUserService userService; + private final ISysDeptService deptService; + private final SysPermissionService permissionService; + + /** + * 获取角色信息列表 + */ + @SaCheckPermission("system:role:list") + @GetMapping("/list") + public TableDataInfo list(SysRole role, PageQuery pageQuery) { + return roleService.selectPageRoleList(role, pageQuery); + } + + /** + * 导出角色信息列表 + */ + @Log(title = "角色管理", businessType = BusinessType.EXPORT) + @SaCheckPermission("system:role:export") + @PostMapping("/export") + public void export(SysRole role, HttpServletResponse response) { + List list = roleService.selectRoleList(role); + ExcelUtil.exportExcel(list, "角色数据", SysRole.class, response); + } + + /** + * 根据角色编号获取详细信息 + * + * @param roleId 角色ID + */ + @SaCheckPermission("system:role:query") + @GetMapping(value = "/{roleId}") + public R getInfo(@PathVariable Long roleId) { + roleService.checkRoleDataScope(roleId); + return R.ok(roleService.selectRoleById(roleId)); + } + + /** + * 新增角色 + */ + @SaCheckPermission("system:role:add") + @Log(title = "角色管理", businessType = BusinessType.INSERT) + @PostMapping + public R add(@Validated @RequestBody SysRole role) { + roleService.checkRoleAllowed(role); + if (!roleService.checkRoleNameUnique(role)) { + return R.fail("新增角色'" + role.getRoleName() + "'失败,角色名称已存在"); + } else if (!roleService.checkRoleKeyUnique(role)) { + return R.fail("新增角色'" + role.getRoleName() + "'失败,角色权限已存在"); + } + return toAjax(roleService.insertRole(role)); + + } + + /** + * 修改保存角色 + */ + @SaCheckPermission("system:role:edit") + @Log(title = "角色管理", businessType = BusinessType.UPDATE) + @PutMapping + public R edit(@Validated @RequestBody SysRole role) { + roleService.checkRoleAllowed(role); + roleService.checkRoleDataScope(role.getRoleId()); + if (!roleService.checkRoleNameUnique(role)) { + return R.fail("修改角色'" + role.getRoleName() + "'失败,角色名称已存在"); + } else if (!roleService.checkRoleKeyUnique(role)) { + return R.fail("修改角色'" + role.getRoleName() + "'失败,角色权限已存在"); + } + + if (roleService.updateRole(role) > 0) { + roleService.cleanOnlineUserByRole(role.getRoleId()); + return R.ok(); + } + return R.fail("修改角色'" + role.getRoleName() + "'失败,请联系管理员"); + } + + /** + * 修改保存数据权限 + */ + @SaCheckPermission("system:role:edit") + @Log(title = "角色管理", businessType = BusinessType.UPDATE) + @PutMapping("/dataScope") + public R dataScope(@RequestBody SysRole role) { + roleService.checkRoleAllowed(role); + roleService.checkRoleDataScope(role.getRoleId()); + return toAjax(roleService.authDataScope(role)); + } + + /** + * 状态修改 + */ + @SaCheckPermission("system:role:edit") + @Log(title = "角色管理", businessType = BusinessType.UPDATE) + @PutMapping("/changeStatus") + public R changeStatus(@RequestBody SysRole role) { + roleService.checkRoleAllowed(role); + roleService.checkRoleDataScope(role.getRoleId()); + return toAjax(roleService.updateRoleStatus(role)); + } + + /** + * 删除角色 + * + * @param roleIds 角色ID串 + */ + @SaCheckPermission("system:role:remove") + @Log(title = "角色管理", businessType = BusinessType.DELETE) + @DeleteMapping("/{roleIds}") + public R remove(@PathVariable Long[] roleIds) { + return toAjax(roleService.deleteRoleByIds(roleIds)); + } + + /** + * 获取角色选择框列表 + */ + @SaCheckPermission("system:role:query") + @GetMapping("/optionselect") + public R> optionselect() { + return R.ok(roleService.selectRoleAll()); + } + + /** + * 查询已分配用户角色列表 + */ + @SaCheckPermission("system:role:list") + @GetMapping("/authUser/allocatedList") + public TableDataInfo allocatedList(SysUser user, PageQuery pageQuery) { + return userService.selectAllocatedList(user, pageQuery); + } + + /** + * 查询未分配用户角色列表 + */ + @SaCheckPermission("system:role:list") + @GetMapping("/authUser/unallocatedList") + public TableDataInfo unallocatedList(SysUser user, PageQuery pageQuery) { + return userService.selectUnallocatedList(user, pageQuery); + } + + /** + * 取消授权用户 + */ + @SaCheckPermission("system:role:edit") + @Log(title = "角色管理", businessType = BusinessType.GRANT) + @PutMapping("/authUser/cancel") + public R cancelAuthUser(@RequestBody SysUserRole userRole) { + return toAjax(roleService.deleteAuthUser(userRole)); + } + + /** + * 批量取消授权用户 + * + * @param roleId 角色ID + * @param userIds 用户ID串 + */ + @SaCheckPermission("system:role:edit") + @Log(title = "角色管理", businessType = BusinessType.GRANT) + @PutMapping("/authUser/cancelAll") + public R cancelAuthUserAll(Long roleId, Long[] userIds) { + return toAjax(roleService.deleteAuthUsers(roleId, userIds)); + } + + /** + * 批量选择用户授权 + * + * @param roleId 角色ID + * @param userIds 用户ID串 + */ + @SaCheckPermission("system:role:edit") + @Log(title = "角色管理", businessType = BusinessType.GRANT) + @PutMapping("/authUser/selectAll") + public R selectAuthUserAll(Long roleId, Long[] userIds) { + roleService.checkRoleDataScope(roleId); + return toAjax(roleService.insertAuthUsers(roleId, userIds)); + } + + /** + * 获取对应角色部门树列表 + * + * @param roleId 角色ID + */ + @SaCheckPermission("system:role:list") + @GetMapping(value = "/deptTree/{roleId}") + public R> roleDeptTreeselect(@PathVariable("roleId") Long roleId) { + return R.ok(Map.of( + "checkedKeys", deptService.selectDeptListByRoleId(roleId), + "depts", deptService.selectDeptTreeList(new SysDept()) + )); + } +} diff --git a/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/controller/system/SysUserController.java b/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/controller/system/SysUserController.java new file mode 100644 index 0000000..4856b94 --- /dev/null +++ b/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/controller/system/SysUserController.java @@ -0,0 +1,256 @@ +package com.ruoyi.system.controller.system; + +import cn.dev33.satoken.annotation.SaCheckPermission; +import cn.dev33.satoken.secure.BCrypt; +import cn.hutool.core.lang.tree.Tree; +import cn.hutool.core.util.ArrayUtil; +import cn.hutool.core.util.ObjectUtil; +import com.ruoyi.common.log.annotation.Log; +import com.ruoyi.common.core.constant.UserConstants; +import com.ruoyi.common.web.core.BaseController; +import com.rouyi.common.mybatis.core.page.PageQuery; +import com.ruoyi.common.core.domain.R; +import com.rouyi.common.mybatis.core.page.TableDataInfo; +import com.ruoyi.common.log.enums.BusinessType; +import com.ruoyi.common.satoken.utils.LoginHelper; +import com.ruoyi.common.core.utils.MapstructUtils; +import com.ruoyi.common.core.utils.StreamUtils; +import com.ruoyi.common.core.utils.StringUtils; +import com.ruoyi.common.excel.core.ExcelResult; +import com.ruoyi.common.excel.utils.ExcelUtil; +import com.ruoyi.system.domain.entity.SysDept; +import com.ruoyi.system.domain.entity.SysPost; +import com.ruoyi.system.domain.entity.SysRole; +import com.ruoyi.system.domain.entity.SysUser; +import com.ruoyi.system.domain.vo.SysUserExportVo; +import com.ruoyi.system.domain.vo.SysUserImportVo; +import com.ruoyi.system.listener.SysUserImportListener; +import com.ruoyi.system.service.ISysDeptService; +import com.ruoyi.system.service.ISysPostService; +import com.ruoyi.system.service.ISysRoleService; +import com.ruoyi.system.service.ISysUserService; +import jakarta.servlet.http.HttpServletResponse; +import lombok.RequiredArgsConstructor; +import org.springframework.http.MediaType; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.*; +import org.springframework.web.multipart.MultipartFile; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +/** + * 用户信息 + * + * @author Lion Li + */ +@Validated +@RequiredArgsConstructor +@RestController +@RequestMapping("/system/user") +public class SysUserController extends BaseController { + + private final ISysUserService userService; + private final ISysRoleService roleService; + private final ISysPostService postService; + private final ISysDeptService deptService; + + /** + * 获取用户列表 + */ + @SaCheckPermission("system:user:list") + @GetMapping("/list") + public TableDataInfo list(SysUser user, PageQuery pageQuery) { + return userService.selectPageUserList(user, pageQuery); + } + + /** + * 导出用户列表 + */ + @Log(title = "用户管理", businessType = BusinessType.EXPORT) + @SaCheckPermission("system:user:export") + @PostMapping("/export") + public void export(SysUser user, HttpServletResponse response) { + List list = userService.selectUserList(user); + List listVo = MapstructUtils.convert(list, SysUserExportVo.class); + for (int i = 0; i < list.size(); i++) { + SysDept dept = list.get(i).getDept(); + SysUserExportVo vo = listVo.get(i); + if (ObjectUtil.isNotEmpty(dept)) { + vo.setDeptName(dept.getDeptName()); + vo.setLeader(dept.getLeader()); + } + } + ExcelUtil.exportExcel(listVo, "用户数据", SysUserExportVo.class, response); + } + + /** + * 导入数据 + * + * @param file 导入文件 + * @param updateSupport 是否更新已存在数据 + */ + @Log(title = "用户管理", businessType = BusinessType.IMPORT) + @SaCheckPermission("system:user:import") + @PostMapping(value = "/importData", consumes = MediaType.MULTIPART_FORM_DATA_VALUE) + public R importData(@RequestPart("file") MultipartFile file, boolean updateSupport) throws Exception { + ExcelResult result = ExcelUtil.importExcel(file.getInputStream(), SysUserImportVo.class, new SysUserImportListener(updateSupport)); + return R.ok(result.getAnalysis()); + } + + /** + * 获取导入模板 + */ + @PostMapping("/importTemplate") + public void importTemplate(HttpServletResponse response) { + ExcelUtil.exportExcel(new ArrayList<>(), "用户数据", SysUserImportVo.class, response); + } + + /** + * 根据用户编号获取详细信息 + * + * @param userId 用户ID + */ + @SaCheckPermission("system:user:query") + @GetMapping(value = {"/", "/{userId}"}) + public R> getInfo(@PathVariable(value = "userId", required = false) Long userId) { + userService.checkUserDataScope(userId); + Map ajax = new HashMap<>(); + SysRole role = new SysRole(); + role.setStatus(UserConstants.ROLE_NORMAL); + SysPost post = new SysPost(); + post.setStatus(UserConstants.POST_NORMAL); + List roles = roleService.selectRoleList(role); + ajax.put("roles", LoginHelper.isAdmin(userId) ? roles : StreamUtils.filter(roles, r -> !r.isAdmin())); + ajax.put("posts", postService.selectPostList(post)); + if (ObjectUtil.isNotNull(userId)) { + SysUser sysUser = userService.selectUserById(userId); + ajax.put("user", sysUser); + ajax.put("postIds", postService.selectPostListByUserId(userId)); + ajax.put("roleIds", StreamUtils.toList(sysUser.getRoles(), SysRole::getRoleId)); + } + return R.ok(ajax); + } + + /** + * 新增用户 + */ + @SaCheckPermission("system:user:add") + @Log(title = "用户管理", businessType = BusinessType.INSERT) + @PostMapping + public R add(@Validated @RequestBody SysUser user) { + deptService.checkDeptDataScope(user.getDeptId()); + if (!userService.checkUserNameUnique(user)) { + return R.fail("新增用户'" + user.getUserName() + "'失败,登录账号已存在"); + } else if (StringUtils.isNotEmpty(user.getPhonenumber()) && !userService.checkPhoneUnique(user)) { + return R.fail("新增用户'" + user.getUserName() + "'失败,手机号码已存在"); + } else if (StringUtils.isNotEmpty(user.getEmail()) && !userService.checkEmailUnique(user)) { + return R.fail("新增用户'" + user.getUserName() + "'失败,邮箱账号已存在"); + } + user.setPassword(BCrypt.hashpw(user.getPassword())); + return toAjax(userService.insertUser(user)); + } + + /** + * 修改用户 + */ + @SaCheckPermission("system:user:edit") + @Log(title = "用户管理", businessType = BusinessType.UPDATE) + @PutMapping + public R edit(@Validated @RequestBody SysUser user) { + userService.checkUserAllowed(user); + userService.checkUserDataScope(user.getUserId()); + deptService.checkDeptDataScope(user.getDeptId()); + if (!userService.checkUserNameUnique(user)) { + return R.fail("修改用户'" + user.getUserName() + "'失败,登录账号已存在"); + } else if (StringUtils.isNotEmpty(user.getPhonenumber()) && !userService.checkPhoneUnique(user)) { + return R.fail("修改用户'" + user.getUserName() + "'失败,手机号码已存在"); + } else if (StringUtils.isNotEmpty(user.getEmail()) && !userService.checkEmailUnique(user)) { + return R.fail("修改用户'" + user.getUserName() + "'失败,邮箱账号已存在"); + } + return toAjax(userService.updateUser(user)); + } + + /** + * 删除用户 + * + * @param userIds 角色ID串 + */ + @SaCheckPermission("system:user:remove") + @Log(title = "用户管理", businessType = BusinessType.DELETE) + @DeleteMapping("/{userIds}") + public R remove(@PathVariable Long[] userIds) { + if (ArrayUtil.contains(userIds, LoginHelper.getUserId())) { + return R.fail("当前用户不能删除"); + } + return toAjax(userService.deleteUserByIds(userIds)); + } + + /** + * 重置密码 + */ + @SaCheckPermission("system:user:resetPwd") + @Log(title = "用户管理", businessType = BusinessType.UPDATE) + @PutMapping("/resetPwd") + public R resetPwd(@RequestBody SysUser user) { + userService.checkUserAllowed(user); + userService.checkUserDataScope(user.getUserId()); + user.setPassword(BCrypt.hashpw(user.getPassword())); + return toAjax(userService.resetPwd(user)); + } + + /** + * 状态修改 + */ + @SaCheckPermission("system:user:edit") + @Log(title = "用户管理", businessType = BusinessType.UPDATE) + @PutMapping("/changeStatus") + public R changeStatus(@RequestBody SysUser user) { + userService.checkUserAllowed(user); + userService.checkUserDataScope(user.getUserId()); + return toAjax(userService.updateUserStatus(user)); + } + + /** + * 根据用户编号获取授权角色 + * + * @param userId 用户ID + */ + @SaCheckPermission("system:user:query") + @GetMapping("/authRole/{userId}") + public R> authRole(@PathVariable Long userId) { + SysUser user = userService.selectUserById(userId); + List roles = roleService.selectRolesByUserId(userId); + return R.ok(Map.of( + "user", user, + "roles", LoginHelper.isAdmin(userId) ? roles : StreamUtils.filter(roles, r -> !r.isAdmin()) + )); + } + + /** + * 用户授权角色 + * + * @param userId 用户Id + * @param roleIds 角色ID串 + */ + @SaCheckPermission("system:user:edit") + @Log(title = "用户管理", businessType = BusinessType.GRANT) + @PutMapping("/authRole") + public R insertAuthRole(Long userId, Long[] roleIds) { + userService.checkUserDataScope(userId); + userService.insertUserAuth(userId, roleIds); + return R.ok(); + } + + /** + * 获取部门树列表 + */ + @SaCheckPermission("system:user:list") + @GetMapping("/deptTree") + public R>> deptTree(SysDept dept) { + return R.ok(deptService.selectDeptTreeList(dept)); + } + +} diff --git a/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/domain/bo/SysOssBo.java b/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/domain/bo/SysOssBo.java new file mode 100644 index 0000000..436b8ba --- /dev/null +++ b/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/domain/bo/SysOssBo.java @@ -0,0 +1,49 @@ +package com.ruoyi.system.domain.bo; + +import com.rouyi.common.mybatis.core.domain.BaseEntity; +import com.ruoyi.system.domain.entity.SysOss; +import io.github.linpeilie.annotations.AutoMapper; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * OSS对象存储分页查询对象 sys_oss + * + * @author Lion Li + */ +@Data +@EqualsAndHashCode(callSuper = true) +@AutoMapper(target = SysOss.class, reverseConvertGenerate = false) +public class SysOssBo extends BaseEntity { + + /** + * ossId + */ + private Long ossId; + + /** + * 文件名 + */ + private String fileName; + + /** + * 原名 + */ + private String originalName; + + /** + * 文件后缀名 + */ + private String fileSuffix; + + /** + * URL地址 + */ + private String url; + + /** + * 服务商 + */ + private String service; + +} diff --git a/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/domain/bo/SysOssConfigBo.java b/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/domain/bo/SysOssConfigBo.java new file mode 100644 index 0000000..2ec2046 --- /dev/null +++ b/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/domain/bo/SysOssConfigBo.java @@ -0,0 +1,109 @@ +package com.ruoyi.system.domain.bo; + +import com.rouyi.common.mybatis.core.domain.BaseEntity; +import com.ruoyi.common.core.validate.AddGroup; +import com.ruoyi.common.core.validate.EditGroup; +import com.ruoyi.system.domain.entity.SysOssConfig; +import io.github.linpeilie.annotations.AutoMapper; +import jakarta.validation.constraints.NotBlank; +import jakarta.validation.constraints.NotNull; +import jakarta.validation.constraints.Size; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * 对象存储配置业务对象 sys_oss_config + * + * @author Lion Li + * @author 孤舟烟雨 + * @date 2021-08-13 + */ + +@Data +@EqualsAndHashCode(callSuper = true) +@AutoMapper(target = SysOssConfig.class, reverseConvertGenerate = false) +public class SysOssConfigBo extends BaseEntity { + + /** + * 主建 + */ + @NotNull(message = "主建不能为空", groups = {EditGroup.class}) + private Long ossConfigId; + + /** + * 配置key + */ + @NotBlank(message = "配置key不能为空", groups = {AddGroup.class, EditGroup.class}) + @Size(min = 2, max = 100, message = "configKey长度必须介于{min}和{max} 之间") + private String configKey; + + /** + * accessKey + */ + @NotBlank(message = "accessKey不能为空", groups = {AddGroup.class, EditGroup.class}) + @Size(min = 2, max = 100, message = "accessKey长度必须介于{min}和{max} 之间") + private String accessKey; + + /** + * 秘钥 + */ + @NotBlank(message = "secretKey不能为空", groups = {AddGroup.class, EditGroup.class}) + @Size(min = 2, max = 100, message = "secretKey长度必须介于{min}和{max} 之间") + private String secretKey; + + /** + * 桶名称 + */ + @NotBlank(message = "桶名称不能为空", groups = {AddGroup.class, EditGroup.class}) + @Size(min = 2, max = 100, message = "bucketName长度必须介于{min}和{max}之间") + private String bucketName; + + /** + * 前缀 + */ + private String prefix; + + /** + * 访问站点 + */ + @NotBlank(message = "访问站点不能为空", groups = {AddGroup.class, EditGroup.class}) + @Size(min = 2, max = 100, message = "endpoint长度必须介于{min}和{max}之间") + private String endpoint; + + /** + * 自定义域名 + */ + private String domain; + + /** + * 是否https(Y=是,N=否) + */ + private String isHttps; + + /** + * 是否默认(0=是,1=否) + */ + private String status; + + /** + * 域 + */ + private String region; + + /** + * 扩展字段 + */ + private String ext1; + + /** + * 备注 + */ + private String remark; + + /** + * 桶权限类型(0private 1public 2custom) + */ + @NotBlank(message = "桶权限类型不能为空", groups = {AddGroup.class, EditGroup.class}) + private String accessPolicy; + +} diff --git a/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/domain/entity/SysCache.java b/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/domain/entity/SysCache.java new file mode 100644 index 0000000..8ecf62c --- /dev/null +++ b/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/domain/entity/SysCache.java @@ -0,0 +1,47 @@ +package com.ruoyi.system.domain.entity; + +import com.ruoyi.common.core.utils.StringUtils; +import lombok.Data; +import lombok.NoArgsConstructor; + +/** + * 缓存信息 + * + * @author Lion Li + */ +@Data +@NoArgsConstructor +public class SysCache { + + /** + * 缓存名称 + */ + private String cacheName = ""; + + /** + * 缓存键名 + */ + private String cacheKey = ""; + + /** + * 缓存内容 + */ + private String cacheValue = ""; + + /** + * 备注 + */ + private String remark = ""; + + public SysCache(String cacheName, String remark) { + this.cacheName = cacheName; + this.remark = remark; + } + + public SysCache(String cacheName, String cacheKey, String cacheValue) { + this.cacheName = StringUtils.replace(cacheName, ":", ""); + this.cacheKey = StringUtils.replace(cacheKey, cacheName, ""); + this.cacheValue = cacheValue; + } + +} diff --git a/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/domain/entity/SysConfig.java b/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/domain/entity/SysConfig.java new file mode 100644 index 0000000..b724f35 --- /dev/null +++ b/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/domain/entity/SysConfig.java @@ -0,0 +1,71 @@ +package com.ruoyi.system.domain.entity; + +import com.alibaba.excel.annotation.ExcelIgnoreUnannotated; +import com.alibaba.excel.annotation.ExcelProperty; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import com.ruoyi.common.excel.annotation.ExcelDictFormat; +import com.ruoyi.common.excel.convert.ExcelDictConvert; +import com.rouyi.common.mybatis.core.domain.BaseEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import jakarta.validation.constraints.NotBlank; +import jakarta.validation.constraints.Size; + +/** + * 参数配置表 sys_config + * + * @author Lion Li + */ + +@Data +@EqualsAndHashCode(callSuper = true) +@TableName("sys_config") +@ExcelIgnoreUnannotated +public class SysConfig extends BaseEntity { + + /** + * 参数主键 + */ + @ExcelProperty(value = "参数主键") + @TableId(value = "config_id") + private Long configId; + + /** + * 参数名称 + */ + @ExcelProperty(value = "参数名称") + @NotBlank(message = "参数名称不能为空") + @Size(min = 0, max = 100, message = "参数名称不能超过{max}个字符") + private String configName; + + /** + * 参数键名 + */ + @ExcelProperty(value = "参数键名") + @NotBlank(message = "参数键名长度不能为空") + @Size(min = 0, max = 100, message = "参数键名长度不能超过{max}个字符") + private String configKey; + + /** + * 参数键值 + */ + @ExcelProperty(value = "参数键值") + @NotBlank(message = "参数键值不能为空") + @Size(min = 0, max = 500, message = "参数键值长度不能超过{max}个字符") + private String configValue; + + /** + * 系统内置(Y是 N否) + */ + @ExcelProperty(value = "系统内置", converter = ExcelDictConvert.class) + @ExcelDictFormat(dictType = "sys_yes_no") + private String configType; + + /** + * 备注 + */ + private String remark; + +} diff --git a/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/domain/entity/SysDept.java b/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/domain/entity/SysDept.java new file mode 100644 index 0000000..a6a9a42 --- /dev/null +++ b/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/domain/entity/SysDept.java @@ -0,0 +1,100 @@ +package com.ruoyi.system.domain.entity; + +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableLogic; +import com.baomidou.mybatisplus.annotation.TableName; +import com.rouyi.common.mybatis.core.domain.BaseEntity; +import jakarta.validation.constraints.Email; +import jakarta.validation.constraints.NotBlank; +import jakarta.validation.constraints.NotNull; +import jakarta.validation.constraints.Size; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.ArrayList; +import java.util.List; + +/** + * 部门表 sys_dept + * + * @author Lion Li + */ + +@Data +@EqualsAndHashCode(callSuper = true) +@TableName("sys_dept") +public class SysDept extends BaseEntity { + private static final long serialVersionUID = 1L; + + /** + * 部门ID + */ + @TableId(value = "dept_id") + private Long deptId; + + /** + * 部门名称 + */ + @NotBlank(message = "部门名称不能为空") + @Size(min = 0, max = 30, message = "部门名称长度不能超过{max}个字符") + private String deptName; + + /** + * 显示顺序 + */ + @NotNull(message = "显示顺序不能为空") + private Integer orderNum; + + /** + * 负责人 + */ + private String leader; + + /** + * 联系电话 + */ + @Size(min = 0, max = 11, message = "联系电话长度不能超过{max}个字符") + private String phone; + + /** + * 邮箱 + */ + @Email(message = "邮箱格式不正确") + @Size(min = 0, max = 50, message = "邮箱长度不能超过{max}个字符") + private String email; + + /** + * 部门状态:0正常,1停用 + */ + private String status; + + /** + * 删除标志(0代表存在 2代表删除) + */ + @TableLogic + private String delFlag; + + /** + * 祖级列表 + */ + private String ancestors; + + /** + * 父菜单名称 + */ + @TableField(exist = false) + private String parentName; + + /** + * 父菜单ID + */ + private Long parentId; + + /** + * 子部门 + */ + @TableField(exist = false) + private List children = new ArrayList<>(); + +} diff --git a/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/domain/entity/SysDictData.java b/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/domain/entity/SysDictData.java new file mode 100644 index 0000000..11f11c1 --- /dev/null +++ b/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/domain/entity/SysDictData.java @@ -0,0 +1,100 @@ +package com.ruoyi.system.domain.entity; + +import com.alibaba.excel.annotation.ExcelIgnoreUnannotated; +import com.alibaba.excel.annotation.ExcelProperty; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import com.ruoyi.common.excel.annotation.ExcelDictFormat; +import com.ruoyi.common.core.constant.UserConstants; +import com.ruoyi.common.excel.convert.ExcelDictConvert; +import com.rouyi.common.mybatis.core.domain.BaseEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import jakarta.validation.constraints.NotBlank; +import jakarta.validation.constraints.Size; + +/** + * 字典数据表 sys_dict_data + * + * @author Lion Li + */ + +@Data +@EqualsAndHashCode(callSuper = true) +@TableName("sys_dict_data") +@ExcelIgnoreUnannotated +public class SysDictData extends BaseEntity { + + /** + * 字典编码 + */ + @ExcelProperty(value = "字典编码") + @TableId(value = "dict_code") + private Long dictCode; + + /** + * 字典排序 + */ + @ExcelProperty(value = "字典排序") + private Integer dictSort; + + /** + * 字典标签 + */ + @ExcelProperty(value = "字典标签") + @NotBlank(message = "字典标签不能为空") + @Size(min = 0, max = 100, message = "字典标签长度不能超过{max}个字符") + private String dictLabel; + + /** + * 字典键值 + */ + @ExcelProperty(value = "字典键值") + @NotBlank(message = "字典键值不能为空") + @Size(min = 0, max = 100, message = "字典键值长度不能超过{max}个字符") + private String dictValue; + + /** + * 字典类型 + */ + @ExcelProperty(value = "字典类型") + @NotBlank(message = "字典类型不能为空") + @Size(min = 0, max = 100, message = "字典类型长度不能超过{max}个字符") + private String dictType; + + /** + * 样式属性(其他样式扩展) + */ + @Size(min = 0, max = 100, message = "样式属性长度不能超过{max}个字符") + private String cssClass; + + /** + * 表格字典样式 + */ + private String listClass; + + /** + * 是否默认(Y是 N否) + */ + @ExcelProperty(value = "是否默认", converter = ExcelDictConvert.class) + @ExcelDictFormat(dictType = "sys_yes_no") + private String isDefault; + + /** + * 状态(0正常 1停用) + */ + @ExcelProperty(value = "状态", converter = ExcelDictConvert.class) + @ExcelDictFormat(dictType = "sys_normal_disable") + private String status; + + /** + * 备注 + */ + private String remark; + + public boolean getDefault() { + return UserConstants.YES.equals(this.isDefault); + } + +} diff --git a/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/domain/entity/SysDictType.java b/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/domain/entity/SysDictType.java new file mode 100644 index 0000000..7e4dd21 --- /dev/null +++ b/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/domain/entity/SysDictType.java @@ -0,0 +1,65 @@ +package com.ruoyi.system.domain.entity; + +import com.alibaba.excel.annotation.ExcelIgnoreUnannotated; +import com.alibaba.excel.annotation.ExcelProperty; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import com.ruoyi.common.excel.annotation.ExcelDictFormat; +import com.ruoyi.common.excel.convert.ExcelDictConvert; +import com.rouyi.common.mybatis.core.domain.BaseEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import jakarta.validation.constraints.NotBlank; +import jakarta.validation.constraints.Pattern; +import jakarta.validation.constraints.Size; + +/** + * 字典类型表 sys_dict_type + * + * @author Lion Li + */ + +@Data +@EqualsAndHashCode(callSuper = true) +@TableName("sys_dict_type") +@ExcelIgnoreUnannotated +public class SysDictType extends BaseEntity { + + /** + * 字典主键 + */ + @ExcelProperty(value = "字典主键") + @TableId(value = "dict_id") + private Long dictId; + + /** + * 字典名称 + */ + @ExcelProperty(value = "字典名称") + @NotBlank(message = "字典名称不能为空") + @Size(min = 0, max = 100, message = "字典类型名称长度不能超过{max}个字符") + private String dictName; + + /** + * 字典类型 + */ + @ExcelProperty(value = "字典类型") + @NotBlank(message = "字典类型不能为空") + @Size(min = 0, max = 100, message = "字典类型类型长度不能超过{max}个字符") + @Pattern(regexp = "^[a-z][a-z0-9_]*$", message = "字典类型必须以字母开头,且只能为(小写字母,数字,下滑线)") + private String dictType; + + /** + * 状态(0正常 1停用) + */ + @ExcelProperty(value = "状态", converter = ExcelDictConvert.class) + @ExcelDictFormat(dictType = "sys_normal_disable") + private String status; + + /** + * 备注 + */ + private String remark; + +} diff --git a/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/domain/entity/SysLogininfor.java b/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/domain/entity/SysLogininfor.java new file mode 100644 index 0000000..5050c04 --- /dev/null +++ b/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/domain/entity/SysLogininfor.java @@ -0,0 +1,91 @@ +package com.ruoyi.system.domain.entity; + +import com.alibaba.excel.annotation.ExcelIgnoreUnannotated; +import com.alibaba.excel.annotation.ExcelProperty; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import com.ruoyi.common.excel.annotation.ExcelDictFormat; +import com.ruoyi.common.excel.convert.ExcelDictConvert; +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; +import java.util.HashMap; +import java.util.Map; + +/** + * 系统访问记录表 sys_logininfor + * + * @author Lion Li + */ + +@Data +@TableName("sys_logininfor") +@ExcelIgnoreUnannotated +public class SysLogininfor implements Serializable { + private static final long serialVersionUID = 1L; + + /** + * ID + */ + @ExcelProperty(value = "序号") + @TableId(value = "info_id") + private Long infoId; + + /** + * 用户账号 + */ + @ExcelProperty(value = "用户账号") + private String userName; + + /** + * 登录状态 0成功 1失败 + */ + @ExcelProperty(value = "登录状态", converter = ExcelDictConvert.class) + @ExcelDictFormat(dictType = "sys_common_status") + private String status; + + /** + * 登录IP地址 + */ + @ExcelProperty(value = "登录地址") + private String ipaddr; + + /** + * 登录地点 + */ + @ExcelProperty(value = "登录地点") + private String loginLocation; + + /** + * 浏览器类型 + */ + @ExcelProperty(value = "浏览器") + private String browser; + + /** + * 操作系统 + */ + @ExcelProperty(value = "操作系统") + private String os; + + /** + * 提示消息 + */ + @ExcelProperty(value = "提示消息") + private String msg; + + /** + * 访问时间 + */ + @ExcelProperty(value = "访问时间") + private Date loginTime; + + /** + * 请求参数 + */ + @TableField(exist = false) + private Map params = new HashMap<>(); + +} diff --git a/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/domain/entity/SysMenu.java b/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/domain/entity/SysMenu.java new file mode 100644 index 0000000..e384754 --- /dev/null +++ b/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/domain/entity/SysMenu.java @@ -0,0 +1,124 @@ +package com.ruoyi.system.domain.entity; + +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.rouyi.common.mybatis.core.domain.BaseEntity; +import jakarta.validation.constraints.NotBlank; +import jakarta.validation.constraints.NotNull; +import jakarta.validation.constraints.Size; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.ArrayList; +import java.util.List; + +/** + * 菜单权限表 sys_menu + * + * @author Lion Li + */ + +@Data +@EqualsAndHashCode(callSuper = true) +@TableName("sys_menu") +public class SysMenu extends BaseEntity { + + /** + * 菜单ID + */ + @TableId(value = "menu_id") + private Long menuId; + + /** + * 菜单名称 + */ + @NotBlank(message = "菜单名称不能为空") + @Size(min = 0, max = 50, message = "菜单名称长度不能超过{max}个字符") + private String menuName; + + /** + * 显示顺序 + */ + @NotNull(message = "显示顺序不能为空") + private Integer orderNum; + + /** + * 路由地址 + */ + @Size(min = 0, max = 200, message = "路由地址不能超过{max}个字符") + private String path; + + /** + * 组件路径 + */ + @Size(min = 0, max = 200, message = "组件路径不能超过{max}个字符") + private String component; + + /** + * 路由参数 + */ + private String queryParam; + + /** + * 是否为外链(0是 1否) + */ + private String isFrame; + + /** + * 是否缓存(0缓存 1不缓存) + */ + private String isCache; + + /** + * 类型(M目录 C菜单 F按钮) + */ + @NotBlank(message = "菜单类型不能为空") + private String menuType; + + /** + * 显示状态(0显示 1隐藏) + */ + private String visible; + + /** + * 菜单状态(0正常 1停用) + */ + private String status; + + /** + * 权限字符串 + */ + @JsonInclude(JsonInclude.Include.NON_NULL) + @Size(min = 0, max = 100, message = "权限标识长度不能超过{max}个字符") + private String perms; + + /** + * 菜单图标 + */ + private String icon; + + /** + * 备注 + */ + private String remark; + + /** + * 父菜单名称 + */ + @TableField(exist = false) + private String parentName; + + /** + * 父菜单ID + */ + private Long parentId; + + /** + * 子部门 + */ + @TableField(exist = false) + private List children = new ArrayList<>(); + +} diff --git a/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/domain/entity/SysNotice.java b/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/domain/entity/SysNotice.java new file mode 100644 index 0000000..d4672d2 --- /dev/null +++ b/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/domain/entity/SysNotice.java @@ -0,0 +1,58 @@ +package com.ruoyi.system.domain.entity; + +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import com.rouyi.common.mybatis.core.domain.BaseEntity; +import com.ruoyi.common.core.xss.Xss; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import jakarta.validation.constraints.NotBlank; +import jakarta.validation.constraints.Size; + + +/** + * 通知公告表 sys_notice + * + * @author Lion Li + */ +@Data +@EqualsAndHashCode(callSuper = true) +@TableName("sys_notice") +public class SysNotice extends BaseEntity { + + /** + * 公告ID + */ + @TableId(value = "notice_id") + private Long noticeId; + + /** + * 公告标题 + */ + @Xss(message = "公告标题不能包含脚本字符") + @NotBlank(message = "公告标题不能为空") + @Size(min = 0, max = 50, message = "公告标题不能超过{max}个字符") + private String noticeTitle; + + /** + * 公告类型(1通知 2公告) + */ + private String noticeType; + + /** + * 公告内容 + */ + private String noticeContent; + + /** + * 公告状态(0正常 1关闭) + */ + private String status; + + /** + * 备注 + */ + private String remark; + +} diff --git a/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/domain/entity/SysOperLog.java b/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/domain/entity/SysOperLog.java new file mode 100644 index 0000000..0890de6 --- /dev/null +++ b/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/domain/entity/SysOperLog.java @@ -0,0 +1,142 @@ +package com.ruoyi.system.domain.entity; + +import com.alibaba.excel.annotation.ExcelIgnoreUnannotated; +import com.alibaba.excel.annotation.ExcelProperty; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import com.ruoyi.common.excel.annotation.ExcelDictFormat; +import com.ruoyi.common.excel.convert.ExcelDictConvert; +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; +import java.util.HashMap; +import java.util.Map; + +/** + * 操作日志记录表 oper_log + * + * @author Lion Li + */ + +@Data +@TableName("sys_oper_log") +@ExcelIgnoreUnannotated +public class SysOperLog implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 日志主键 + */ + @ExcelProperty(value = "日志主键") + @TableId(value = "oper_id") + private Long operId; + + /** + * 操作模块 + */ + @ExcelProperty(value = "操作模块") + private String title; + + /** + * 业务类型(0其它 1新增 2修改 3删除) + */ + @ExcelProperty(value = "业务类型", converter = ExcelDictConvert.class) + @ExcelDictFormat(dictType = "sys_oper_type") + private Integer businessType; + + /** + * 业务类型数组 + */ + @TableField(exist = false) + private Integer[] businessTypes; + + /** + * 请求方法 + */ + @ExcelProperty(value = "请求方法") + private String method; + + /** + * 请求方式 + */ + @ExcelProperty(value = "请求方式") + private String requestMethod; + + /** + * 操作类别(0其它 1后台用户 2手机端用户) + */ + @ExcelProperty(value = "操作类别", converter = ExcelDictConvert.class) + @ExcelDictFormat(readConverterExp = "0=其它,1=后台用户,2=手机端用户") + private Integer operatorType; + + /** + * 操作人员 + */ + @ExcelProperty(value = "操作人员") + private String operName; + + /** + * 部门名称 + */ + @ExcelProperty(value = "部门名称") + private String deptName; + + /** + * 请求url + */ + @ExcelProperty(value = "请求地址") + private String operUrl; + + /** + * 操作地址 + */ + @ExcelProperty(value = "操作地址") + private String operIp; + + /** + * 操作地点 + */ + @ExcelProperty(value = "操作地点") + private String operLocation; + + /** + * 请求参数 + */ + @ExcelProperty(value = "请求参数") + private String operParam; + + /** + * 返回参数 + */ + @ExcelProperty(value = "返回参数") + private String jsonResult; + + /** + * 操作状态(0正常 1异常) + */ + @ExcelProperty(value = "状态", converter = ExcelDictConvert.class) + @ExcelDictFormat(dictType = "sys_common_status") + private Integer status; + + /** + * 错误消息 + */ + @ExcelProperty(value = "错误消息") + private String errorMsg; + + /** + * 操作时间 + */ + @ExcelProperty(value = "操作时间") + private Date operTime; + + /** + * 请求参数 + */ + @TableField(exist = false) + private Map params = new HashMap<>(); + +} diff --git a/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/domain/entity/SysOss.java b/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/domain/entity/SysOss.java new file mode 100644 index 0000000..1dc0adf --- /dev/null +++ b/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/domain/entity/SysOss.java @@ -0,0 +1,50 @@ +package com.ruoyi.system.domain.entity; + +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import com.rouyi.common.mybatis.core.domain.BaseEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * OSS对象存储对象 + * + * @author Lion Li + */ +@Data +@EqualsAndHashCode(callSuper = true) +@TableName("sys_oss") +public class SysOss extends BaseEntity { + + /** + * 对象存储主键 + */ + @TableId(value = "oss_id") + private Long ossId; + + /** + * 文件名 + */ + private String fileName; + + /** + * 原名 + */ + private String originalName; + + /** + * 文件后缀名 + */ + private String fileSuffix; + + /** + * URL地址 + */ + private String url; + + /** + * 服务商 + */ + private String service; + +} diff --git a/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/domain/entity/SysOssConfig.java b/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/domain/entity/SysOssConfig.java new file mode 100644 index 0000000..4fdf49d --- /dev/null +++ b/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/domain/entity/SysOssConfig.java @@ -0,0 +1,89 @@ +package com.ruoyi.system.domain.entity; + +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import com.rouyi.common.mybatis.core.domain.BaseEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * 对象存储配置对象 sys_oss_config + * + * @author Lion Li + */ +@Data +@EqualsAndHashCode(callSuper = true) +@TableName("sys_oss_config") +public class SysOssConfig extends BaseEntity { + + /** + * 主建 + */ + @TableId(value = "oss_config_id") + private Long ossConfigId; + + /** + * 配置key + */ + private String configKey; + + /** + * accessKey + */ + private String accessKey; + + /** + * 秘钥 + */ + private String secretKey; + + /** + * 桶名称 + */ + private String bucketName; + + /** + * 前缀 + */ + private String prefix; + + /** + * 访问站点 + */ + private String endpoint; + + /** + * 自定义域名 + */ + private String domain; + + /** + * 是否https(0否 1是) + */ + private String isHttps; + + /** + * 域 + */ + private String region; + + /** + * 是否默认(0=是,1=否) + */ + private String status; + + /** + * 扩展字段 + */ + private String ext1; + + /** + * 备注 + */ + private String remark; + + /** + * 桶权限类型(0private 1public 2custom) + */ + private String accessPolicy; +} diff --git a/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/domain/entity/SysPost.java b/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/domain/entity/SysPost.java new file mode 100644 index 0000000..56d1350 --- /dev/null +++ b/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/domain/entity/SysPost.java @@ -0,0 +1,78 @@ +package com.ruoyi.system.domain.entity; + +import com.alibaba.excel.annotation.ExcelIgnoreUnannotated; +import com.alibaba.excel.annotation.ExcelProperty; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import com.ruoyi.common.excel.annotation.ExcelDictFormat; +import com.ruoyi.common.excel.convert.ExcelDictConvert; +import com.rouyi.common.mybatis.core.domain.BaseEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import jakarta.validation.constraints.NotBlank; +import jakarta.validation.constraints.NotNull; +import jakarta.validation.constraints.Size; + +/** + * 岗位表 sys_post + * + * @author Lion Li + */ + +@Data +@EqualsAndHashCode(callSuper = true) +@TableName("sys_post") +@ExcelIgnoreUnannotated +public class SysPost extends BaseEntity { + + /** + * 岗位序号 + */ + @ExcelProperty(value = "岗位序号") + @TableId(value = "post_id") + private Long postId; + + /** + * 岗位编码 + */ + @ExcelProperty(value = "岗位编码") + @NotBlank(message = "岗位编码不能为空") + @Size(min = 0, max = 64, message = "岗位编码长度不能超过{max}个字符") + private String postCode; + + /** + * 岗位名称 + */ + @ExcelProperty(value = "岗位名称") + @NotBlank(message = "岗位名称不能为空") + @Size(min = 0, max = 50, message = "岗位名称长度不能超过{max}个字符") + private String postName; + + /** + * 岗位排序 + */ + @ExcelProperty(value = "岗位排序") + @NotNull(message = "显示顺序不能为空") + private Integer postSort; + + /** + * 状态(0正常 1停用) + */ + @ExcelProperty(value = "状态", converter = ExcelDictConvert.class) + @ExcelDictFormat(dictType = "sys_normal_disable") + private String status; + + /** + * 备注 + */ + private String remark; + + /** + * 用户是否存在此岗位标识 默认不存在 + */ + @TableField(exist = false) + private boolean flag = false; + +} diff --git a/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/domain/entity/SysRole.java b/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/domain/entity/SysRole.java new file mode 100644 index 0000000..87556cb --- /dev/null +++ b/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/domain/entity/SysRole.java @@ -0,0 +1,123 @@ +package com.ruoyi.system.domain.entity; + +import com.alibaba.excel.annotation.ExcelIgnoreUnannotated; +import com.alibaba.excel.annotation.ExcelProperty; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableLogic; +import com.baomidou.mybatisplus.annotation.TableName; +import com.rouyi.common.mybatis.core.domain.BaseEntity; +import com.ruoyi.common.core.constant.UserConstants; +import com.ruoyi.common.excel.annotation.ExcelDictFormat; +import com.ruoyi.common.excel.convert.ExcelDictConvert; +import jakarta.validation.constraints.NotBlank; +import jakarta.validation.constraints.NotNull; +import jakarta.validation.constraints.Size; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.NoArgsConstructor; + +/** + * 角色表 sys_role + * + * @author Lion Li + */ + +@Data +@NoArgsConstructor +@EqualsAndHashCode(callSuper = true) +@TableName("sys_role") +@ExcelIgnoreUnannotated +public class SysRole extends BaseEntity { + + /** + * 角色ID + */ + @ExcelProperty(value = "角色序号") + @TableId(value = "role_id") + private Long roleId; + + /** + * 角色名称 + */ + @ExcelProperty(value = "角色名称") + @NotBlank(message = "角色名称不能为空") + @Size(min = 0, max = 30, message = "角色名称长度不能超过{max}个字符") + private String roleName; + + /** + * 角色权限 + */ + @ExcelProperty(value = "角色权限") + @NotBlank(message = "权限字符不能为空") + @Size(min = 0, max = 100, message = "权限字符长度不能超过{max}个字符") + private String roleKey; + + /** + * 角色排序 + */ + @ExcelProperty(value = "角色排序") + @NotNull(message = "显示顺序不能为空") + private Integer roleSort; + + /** + * 数据范围(1:所有数据权限;2:自定义数据权限;3:本部门数据权限;4:本部门及以下数据权限;5:仅本人数据权限) + */ + @ExcelProperty(value = "数据范围", converter = ExcelDictConvert.class) + @ExcelDictFormat(readConverterExp = "1=所有数据权限,2=自定义数据权限,3=本部门数据权限,4=本部门及以下数据权限,5=仅本人数据权限") + private String dataScope; + + /** + * 菜单树选择项是否关联显示( 0:父子不互相关联显示 1:父子互相关联显示) + */ + private Boolean menuCheckStrictly; + + /** + * 部门树选择项是否关联显示(0:父子不互相关联显示 1:父子互相关联显示 ) + */ + private Boolean deptCheckStrictly; + + /** + * 角色状态(0正常 1停用) + */ + @ExcelProperty(value = "角色状态", converter = ExcelDictConvert.class) + @ExcelDictFormat(dictType = "sys_normal_disable") + private String status; + + /** + * 删除标志(0代表存在 2代表删除) + */ + @TableLogic + private String delFlag; + + /** + * 备注 + */ + private String remark; + + /** + * 用户是否存在此角色标识 默认不存在 + */ + @TableField(exist = false) + private boolean flag = false; + + /** + * 菜单组 + */ + @TableField(exist = false) + private Long[] menuIds; + + /** + * 部门组(数据权限) + */ + @TableField(exist = false) + private Long[] deptIds; + + public SysRole(Long roleId) { + this.roleId = roleId; + } + + public boolean isAdmin() { + return UserConstants.ADMIN_ID.equals(this.roleId); + } +} diff --git a/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/domain/entity/SysRoleDept.java b/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/domain/entity/SysRoleDept.java new file mode 100644 index 0000000..1272a60 --- /dev/null +++ b/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/domain/entity/SysRoleDept.java @@ -0,0 +1,29 @@ +package com.ruoyi.system.domain.entity; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import lombok.Data; + +/** + * 角色和部门关联 sys_role_dept + * + * @author Lion Li + */ + +@Data +@TableName("sys_role_dept") +public class SysRoleDept { + + /** + * 角色ID + */ + @TableId(type = IdType.INPUT) + private Long roleId; + + /** + * 部门ID + */ + private Long deptId; + +} diff --git a/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/domain/entity/SysRoleMenu.java b/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/domain/entity/SysRoleMenu.java new file mode 100644 index 0000000..3dacb48 --- /dev/null +++ b/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/domain/entity/SysRoleMenu.java @@ -0,0 +1,29 @@ +package com.ruoyi.system.domain.entity; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import lombok.Data; + +/** + * 角色和菜单关联 sys_role_menu + * + * @author Lion Li + */ + +@Data +@TableName("sys_role_menu") +public class SysRoleMenu { + + /** + * 角色ID + */ + @TableId(type = IdType.INPUT) + private Long roleId; + + /** + * 菜单ID + */ + private Long menuId; + +} diff --git a/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/domain/entity/SysUser.java b/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/domain/entity/SysUser.java new file mode 100644 index 0000000..3fd10dd --- /dev/null +++ b/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/domain/entity/SysUser.java @@ -0,0 +1,169 @@ +package com.ruoyi.system.domain.entity; + +import com.baomidou.mybatisplus.annotation.*; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.rouyi.common.mybatis.core.domain.BaseEntity; +import com.ruoyi.common.core.constant.UserConstants; +import com.ruoyi.common.core.xss.Xss; +import com.ruoyi.common.sensitive.annotation.Sensitive; +import com.ruoyi.common.sensitive.core.SensitiveStrategy; +import jakarta.validation.constraints.Email; +import jakarta.validation.constraints.NotBlank; +import jakarta.validation.constraints.Size; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.NoArgsConstructor; + +import java.util.Date; +import java.util.List; + +/** + * 用户对象 sys_user + * + * @author Lion Li + */ + +@Data +@NoArgsConstructor +@EqualsAndHashCode(callSuper = true) +@TableName("sys_user") +public class SysUser extends BaseEntity { + + /** + * 用户ID + */ + @TableId(value = "user_id") + private Long userId; + + /** + * 部门ID + */ + private Long deptId; + + /** + * 用户账号 + */ + @Xss(message = "用户账号不能包含脚本字符") + @NotBlank(message = "用户账号不能为空") + @Size(min = 0, max = 30, message = "用户账号长度不能超过{max}个字符") + private String userName; + + /** + * 用户昵称 + */ + @Xss(message = "用户昵称不能包含脚本字符") + @NotBlank(message = "用户昵称不能为空") + @Size(min = 0, max = 30, message = "用户昵称长度不能超过{max}个字符") + private String nickName; + + /** + * 用户类型(sys_user系统用户) + */ + private String userType; + + /** + * 用户邮箱 + */ + @Sensitive(strategy = SensitiveStrategy.EMAIL) + @Email(message = "邮箱格式不正确") + @Size(min = 0, max = 50, message = "邮箱长度不能超过{max}个字符") + private String email; + + /** + * 手机号码 + */ + @Sensitive(strategy = SensitiveStrategy.PHONE) + private String phonenumber; + + /** + * 用户性别 + */ + private String sex; + + /** + * 用户头像 + */ + private String avatar; + + /** + * 密码 + */ + @TableField( + insertStrategy = FieldStrategy.NOT_EMPTY, + updateStrategy = FieldStrategy.NOT_EMPTY, + whereStrategy = FieldStrategy.NOT_EMPTY + ) + private String password; + + @JsonIgnore + @JsonProperty + public String getPassword() { + return password; + } + + /** + * 帐号状态(0正常 1停用) + */ + private String status; + + /** + * 删除标志(0代表存在 2代表删除) + */ + @TableLogic + private String delFlag; + + /** + * 最后登录IP + */ + private String loginIp; + + /** + * 最后登录时间 + */ + private Date loginDate; + + /** + * 备注 + */ + private String remark; + + /** + * 部门对象 + */ + @TableField(exist = false) + private SysDept dept; + + /** + * 角色对象 + */ + @TableField(exist = false) + private List roles; + + /** + * 角色组 + */ + @TableField(exist = false) + private Long[] roleIds; + + /** + * 岗位组 + */ + @TableField(exist = false) + private Long[] postIds; + + /** + * 数据权限 当前角色ID + */ + @TableField(exist = false) + private Long roleId; + + public SysUser(Long userId) { + this.userId = userId; + } + + public boolean isAdmin() { + return UserConstants.ADMIN_ID.equals(this.userId); + } + +} diff --git a/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/domain/entity/SysUserOnline.java b/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/domain/entity/SysUserOnline.java new file mode 100644 index 0000000..0504a79 --- /dev/null +++ b/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/domain/entity/SysUserOnline.java @@ -0,0 +1,54 @@ +package com.ruoyi.system.domain.entity; + +import lombok.Data; + +/** + * 当前在线会话 + * + * @author Lion Li + */ + +@Data +public class SysUserOnline { + + /** + * 会话编号 + */ + private String tokenId; + + /** + * 部门名称 + */ + private String deptName; + + /** + * 用户名称 + */ + private String userName; + + /** + * 登录IP地址 + */ + private String ipaddr; + + /** + * 登录地址 + */ + private String loginLocation; + + /** + * 浏览器类型 + */ + private String browser; + + /** + * 操作系统 + */ + private String os; + + /** + * 登录时间 + */ + private Long loginTime; + +} diff --git a/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/domain/entity/SysUserPost.java b/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/domain/entity/SysUserPost.java new file mode 100644 index 0000000..487d580 --- /dev/null +++ b/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/domain/entity/SysUserPost.java @@ -0,0 +1,29 @@ +package com.ruoyi.system.domain.entity; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import lombok.Data; + +/** + * 用户和岗位关联 sys_user_post + * + * @author Lion Li + */ + +@Data +@TableName("sys_user_post") +public class SysUserPost { + + /** + * 用户ID + */ + @TableId(type = IdType.INPUT) + private Long userId; + + /** + * 岗位ID + */ + private Long postId; + +} diff --git a/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/domain/entity/SysUserRole.java b/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/domain/entity/SysUserRole.java new file mode 100644 index 0000000..d99307c --- /dev/null +++ b/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/domain/entity/SysUserRole.java @@ -0,0 +1,29 @@ +package com.ruoyi.system.domain.entity; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import lombok.Data; + +/** + * 用户和角色关联 sys_user_role + * + * @author Lion Li + */ + +@Data +@TableName("sys_user_role") +public class SysUserRole { + + /** + * 用户ID + */ + @TableId(type = IdType.INPUT) + private Long userId; + + /** + * 角色ID + */ + private Long roleId; + +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/domain/vo/MetaVo.java b/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/domain/vo/MetaVo.java similarity index 50% rename from ruoyi-system/src/main/java/com/ruoyi/system/domain/vo/MetaVo.java rename to ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/domain/vo/MetaVo.java index a5d5fdc..a8606f3 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/domain/vo/MetaVo.java +++ b/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/domain/vo/MetaVo.java @@ -1,14 +1,17 @@ package com.ruoyi.system.domain.vo; -import com.ruoyi.common.utils.StringUtils; +import com.ruoyi.common.core.utils.StringUtils; +import lombok.Data; /** * 路由显示信息 - * + * * @author ruoyi */ -public class MetaVo -{ + +@Data +public class MetaVo { + /** * 设置该路由在侧边栏和面包屑中展示的名字 */ @@ -29,78 +32,30 @@ public class MetaVo */ private String link; - public MetaVo() - { - } - - public MetaVo(String title, String icon) - { + public MetaVo(String title, String icon) { this.title = title; this.icon = icon; } - public MetaVo(String title, String icon, boolean noCache) - { + public MetaVo(String title, String icon, boolean noCache) { this.title = title; this.icon = icon; this.noCache = noCache; } - public MetaVo(String title, String icon, String link) - { + public MetaVo(String title, String icon, String link) { this.title = title; this.icon = icon; this.link = link; } - public MetaVo(String title, String icon, boolean noCache, String link) - { + public MetaVo(String title, String icon, boolean noCache, String link) { this.title = title; this.icon = icon; this.noCache = noCache; - if (StringUtils.ishttp(link)) - { + if (StringUtils.ishttp(link)) { this.link = link; } } - public boolean isNoCache() - { - return noCache; - } - - public void setNoCache(boolean noCache) - { - this.noCache = noCache; - } - - public String getTitle() - { - return title; - } - - public void setTitle(String title) - { - this.title = title; - } - - public String getIcon() - { - return icon; - } - - public void setIcon(String icon) - { - this.icon = icon; - } - - public String getLink() - { - return link; - } - - public void setLink(String link) - { - this.link = link; - } } diff --git a/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/domain/vo/RouterVo.java b/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/domain/vo/RouterVo.java new file mode 100644 index 0000000..8351f7c --- /dev/null +++ b/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/domain/vo/RouterVo.java @@ -0,0 +1,62 @@ +package com.ruoyi.system.domain.vo; + +import com.fasterxml.jackson.annotation.JsonInclude; +import lombok.Data; + +import java.util.List; + +/** + * 路由配置信息 + * + * @author Lion Li + */ +@Data +@JsonInclude(JsonInclude.Include.NON_EMPTY) +public class RouterVo { + + /** + * 路由名字 + */ + private String name; + + /** + * 路由地址 + */ + private String path; + + /** + * 是否隐藏路由,当设置 true 的时候该路由不会再侧边栏出现 + */ + private boolean hidden; + + /** + * 重定向地址,当设置 noRedirect 的时候该路由在面包屑导航中不可被点击 + */ + private String redirect; + + /** + * 组件地址 + */ + private String component; + + /** + * 路由参数:如 {"id": 1, "name": "ry"} + */ + private String query; + + /** + * 当你一个路由下面的 children 声明的路由大于1个时,自动会变成嵌套的模式--如组件页面 + */ + private Boolean alwaysShow; + + /** + * 其他元素 + */ + private MetaVo meta; + + /** + * 子路由 + */ + private List children; + +} diff --git a/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/domain/vo/SysOssConfigVo.java b/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/domain/vo/SysOssConfigVo.java new file mode 100644 index 0000000..dd24f17 --- /dev/null +++ b/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/domain/vo/SysOssConfigVo.java @@ -0,0 +1,93 @@ +package com.ruoyi.system.domain.vo; + +import com.alibaba.excel.annotation.ExcelIgnoreUnannotated; +import com.ruoyi.system.domain.entity.SysOssConfig; +import io.github.linpeilie.annotations.AutoMapper; +import lombok.Data; + + +/** + * 对象存储配置视图对象 sys_oss_config + * + * @author Lion Li + * @author 孤舟烟雨 + * @date 2021-08-13 + */ +@Data +@ExcelIgnoreUnannotated +@AutoMapper(target = SysOssConfig.class) +public class SysOssConfigVo { + + private static final long serialVersionUID = 1L; + + /** + * 主建 + */ + private Long ossConfigId; + + /** + * 配置key + */ + private String configKey; + + /** + * accessKey + */ + private String accessKey; + + /** + * 秘钥 + */ + private String secretKey; + + /** + * 桶名称 + */ + private String bucketName; + + /** + * 前缀 + */ + private String prefix; + + /** + * 访问站点 + */ + private String endpoint; + + /** + * 自定义域名 + */ + private String domain; + + /** + * 是否https(Y=是,N=否) + */ + private String isHttps; + + /** + * 域 + */ + private String region; + + /** + * 是否默认(0=是,1=否) + */ + private String status; + + /** + * 扩展字段 + */ + private String ext1; + + /** + * 备注 + */ + private String remark; + + /** + * 桶权限类型(0private 1public 2custom) + */ + private String accessPolicy; + +} diff --git a/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/domain/vo/SysOssVo.java b/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/domain/vo/SysOssVo.java new file mode 100644 index 0000000..3225f22 --- /dev/null +++ b/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/domain/vo/SysOssVo.java @@ -0,0 +1,61 @@ +package com.ruoyi.system.domain.vo; + +import com.ruoyi.system.domain.entity.SysOss; +import io.github.linpeilie.annotations.AutoMapper; +import lombok.Data; + +import java.util.Date; + +/** + * OSS对象存储视图对象 sys_oss + * + * @author Lion Li + */ +@Data +@AutoMapper(target = SysOss.class) +public class SysOssVo { + + private static final long serialVersionUID = 1L; + + /** + * 对象存储主键 + */ + private Long ossId; + + /** + * 文件名 + */ + private String fileName; + + /** + * 原名 + */ + private String originalName; + + /** + * 文件后缀名 + */ + private String fileSuffix; + + /** + * URL地址 + */ + private String url; + + /** + * 创建时间 + */ + private Date createTime; + + /** + * 上传人 + */ + private String createBy; + + /** + * 服务商 + */ + private String service; + + +} diff --git a/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/domain/vo/SysUserExportVo.java b/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/domain/vo/SysUserExportVo.java new file mode 100644 index 0000000..eae4c41 --- /dev/null +++ b/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/domain/vo/SysUserExportVo.java @@ -0,0 +1,94 @@ +package com.ruoyi.system.domain.vo; + +import com.alibaba.excel.annotation.ExcelProperty; +import com.ruoyi.common.excel.annotation.ExcelDictFormat; +import com.ruoyi.common.excel.convert.ExcelDictConvert; +import com.ruoyi.system.domain.entity.SysUser; +import io.github.linpeilie.annotations.AutoMapper; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.io.Serializable; +import java.util.Date; + +/** + * 用户对象导出VO + * + * @author Lion Li + */ + +@Data +@NoArgsConstructor +@AutoMapper(target = SysUser.class, convertGenerate = false) +public class SysUserExportVo implements Serializable { + private static final long serialVersionUID = 1L; + + /** + * 用户ID + */ + @ExcelProperty(value = "用户序号") + private Long userId; + + /** + * 用户账号 + */ + @ExcelProperty(value = "登录名称") + private String userName; + + /** + * 用户昵称 + */ + @ExcelProperty(value = "用户名称") + private String nickName; + + /** + * 用户邮箱 + */ + @ExcelProperty(value = "用户邮箱") + private String email; + + /** + * 手机号码 + */ + @ExcelProperty(value = "手机号码") + private String phonenumber; + + /** + * 用户性别 + */ + @ExcelProperty(value = "用户性别", converter = ExcelDictConvert.class) + @ExcelDictFormat(dictType = "sys_user_sex") + private String sex; + + /** + * 帐号状态(0正常 1停用) + */ + @ExcelProperty(value = "帐号状态", converter = ExcelDictConvert.class) + @ExcelDictFormat(dictType = "sys_normal_disable") + private String status; + + /** + * 最后登录IP + */ + @ExcelProperty(value = "最后登录IP") + private String loginIp; + + /** + * 最后登录时间 + */ + @ExcelProperty(value = "最后登录时间") + private Date loginDate; + + /** + * 部门名称 + */ + @ExcelProperty(value = "部门名称") + private String deptName; + + /** + * 负责人 + */ + @ExcelProperty(value = "部门负责人") + private String leader; + +} diff --git a/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/domain/vo/SysUserImportVo.java b/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/domain/vo/SysUserImportVo.java new file mode 100644 index 0000000..d77f383 --- /dev/null +++ b/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/domain/vo/SysUserImportVo.java @@ -0,0 +1,73 @@ +package com.ruoyi.system.domain.vo; + +import com.alibaba.excel.annotation.ExcelProperty; +import com.ruoyi.common.excel.annotation.ExcelDictFormat; +import com.ruoyi.common.excel.convert.ExcelDictConvert; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.io.Serializable; + +/** + * 用户对象导入VO + * + * @author Lion Li + */ + +@Data +@NoArgsConstructor +// @Accessors(chain = true) // 导入不允许使用 会找不到set方法 +public class SysUserImportVo implements Serializable { + private static final long serialVersionUID = 1L; + + /** + * 用户ID + */ + @ExcelProperty(value = "用户序号") + private Long userId; + + /** + * 部门ID + */ + @ExcelProperty(value = "部门编号") + private Long deptId; + + /** + * 用户账号 + */ + @ExcelProperty(value = "登录名称") + private String userName; + + /** + * 用户昵称 + */ + @ExcelProperty(value = "用户名称") + private String nickName; + + /** + * 用户邮箱 + */ + @ExcelProperty(value = "用户邮箱") + private String email; + + /** + * 手机号码 + */ + @ExcelProperty(value = "手机号码") + private String phonenumber; + + /** + * 用户性别 + */ + @ExcelProperty(value = "用户性别", converter = ExcelDictConvert.class) + @ExcelDictFormat(dictType = "sys_user_sex") + private String sex; + + /** + * 帐号状态(0正常 1停用) + */ + @ExcelProperty(value = "帐号状态", converter = ExcelDictConvert.class) + @ExcelDictFormat(dictType = "sys_normal_disable") + private String status; + +} diff --git a/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/listener/SysUserImportListener.java b/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/listener/SysUserImportListener.java new file mode 100644 index 0000000..2b70915 --- /dev/null +++ b/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/listener/SysUserImportListener.java @@ -0,0 +1,118 @@ +package com.ruoyi.system.listener; + +import cn.dev33.satoken.secure.BCrypt; +import cn.hutool.core.util.ObjectUtil; +import com.alibaba.excel.context.AnalysisContext; +import com.alibaba.excel.event.AnalysisEventListener; +import com.ruoyi.common.core.exception.ServiceException; +import com.ruoyi.common.satoken.utils.LoginHelper; +import com.ruoyi.common.core.utils.MapstructUtils; +import com.ruoyi.common.core.utils.ValidatorUtils; +import com.ruoyi.common.core.utils.SpringUtils; +import com.ruoyi.common.excel.core.ExcelListener; +import com.ruoyi.common.excel.core.ExcelResult; +import com.ruoyi.system.domain.entity.SysUser; +import com.ruoyi.system.domain.vo.SysUserImportVo; +import com.ruoyi.system.service.ISysConfigService; +import com.ruoyi.system.service.ISysUserService; +import lombok.extern.slf4j.Slf4j; + +import java.util.List; + +/** + * 系统用户自定义导入 + * + * @author Lion Li + */ +@Slf4j +public class SysUserImportListener extends AnalysisEventListener implements ExcelListener { + + private final ISysUserService userService; + + private final String password; + + private final Boolean isUpdateSupport; + + private final String operName; + + private int successNum = 0; + private int failureNum = 0; + private final StringBuilder successMsg = new StringBuilder(); + private final StringBuilder failureMsg = new StringBuilder(); + + public SysUserImportListener(Boolean isUpdateSupport) { + String initPassword = SpringUtils.getBean(ISysConfigService.class).selectConfigByKey("sys.user.initPassword"); + this.userService = SpringUtils.getBean(ISysUserService.class); + this.password = BCrypt.hashpw(initPassword); + this.isUpdateSupport = isUpdateSupport; + this.operName = LoginHelper.getUsername(); + } + + @Override + public void invoke(SysUserImportVo userVo, AnalysisContext context) { + SysUser user = this.userService.selectUserByUserName(userVo.getUserName()); + try { + // 验证是否存在这个用户 + if (ObjectUtil.isNull(user)) { + user = MapstructUtils.convert(userVo, SysUser.class); + ValidatorUtils.validate(user); + user.setPassword(password); + user.setCreateBy(operName); + userService.insertUser(user); + successNum++; + successMsg.append("
").append(successNum).append("、账号 ").append(user.getUserName()).append(" 导入成功"); + } else if (isUpdateSupport) { + Long userId = user.getUserId(); + user = MapstructUtils.convert(userVo, SysUser.class); + user.setUserId(userId); + ValidatorUtils.validate(user); + userService.checkUserAllowed(user); + userService.checkUserDataScope(user.getUserId()); + user.setUpdateBy(operName); + userService.updateUser(user); + successNum++; + successMsg.append("
").append(successNum).append("、账号 ").append(user.getUserName()).append(" 更新成功"); + } else { + failureNum++; + failureMsg.append("
").append(failureNum).append("、账号 ").append(user.getUserName()).append(" 已存在"); + } + } catch (Exception e) { + failureNum++; + String msg = "
" + failureNum + "、账号 " + user.getUserName() + " 导入失败:"; + failureMsg.append(msg).append(e.getMessage()); + log.error(msg, e); + } + } + + @Override + public void doAfterAllAnalysed(AnalysisContext context) { + + } + + @Override + public ExcelResult getExcelResult() { + return new ExcelResult() { + + @Override + public String getAnalysis() { + if (failureNum > 0) { + failureMsg.insert(0, "很抱歉,导入失败!共 " + failureNum + " 条数据格式不正确,错误如下:"); + throw new ServiceException(failureMsg.toString()); + } else { + successMsg.insert(0, "恭喜您,数据已全部导入成功!共 " + successNum + " 条,数据如下:"); + } + return successMsg.toString(); + } + + @Override + public List getList() { + return null; + } + + @Override + public List getErrorList() { + return null; + } + }; + } +} diff --git a/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/listener/UserActionListener.java b/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/listener/UserActionListener.java new file mode 100644 index 0000000..655bac5 --- /dev/null +++ b/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/listener/UserActionListener.java @@ -0,0 +1,138 @@ +package com.ruoyi.system.listener; + +import cn.dev33.satoken.config.SaTokenConfig; +import cn.dev33.satoken.listener.SaTokenListener; +import cn.dev33.satoken.stp.SaLoginModel; +import cn.hutool.http.useragent.UserAgent; +import cn.hutool.http.useragent.UserAgentUtil; +import com.ruoyi.common.core.constant.CacheConstants; +import com.ruoyi.common.core.domain.vo.UserOnlineVO; +import com.ruoyi.common.core.domain.bo.LoginUser; +import com.ruoyi.common.core.enums.UserType; +import com.ruoyi.common.core.utils.ServletUtils; +import com.ruoyi.common.core.utils.ip.AddressUtils; +import com.ruoyi.common.redis.utils.RedisUtils; +import com.ruoyi.common.satoken.utils.LoginHelper; +import lombok.RequiredArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.springframework.stereotype.Component; + +import java.time.Duration; + +/** + * 用户行为 侦听器的实现 + * + * @author Lion Li + */ +@RequiredArgsConstructor +@Component +@Slf4j +public class UserActionListener implements SaTokenListener { + + private final SaTokenConfig tokenConfig; + + /** + * 每次登录时触发 + */ + @Override + public void doLogin(String loginType, Object loginId, String tokenValue, SaLoginModel loginModel) { + UserType userType = UserType.getUserType(loginId.toString()); + if (userType == UserType.SYS_USER) { + UserAgent userAgent = UserAgentUtil.parse(ServletUtils.getRequest().getHeader("User-Agent")); + String ip = ServletUtils.getClientIP(); + LoginUser user = LoginHelper.getLoginUser(); + UserOnlineVO dto = new UserOnlineVO(); + dto.setIpaddr(ip); + dto.setLoginLocation(AddressUtils.getRealAddressByIP(ip)); + dto.setBrowser(userAgent.getBrowser().getName()); + dto.setOs(userAgent.getOs().getName()); + dto.setLoginTime(System.currentTimeMillis()); + dto.setTokenId(tokenValue); + dto.setUserName(user.getUsername()); + dto.setDeptName(user.getDeptName()); + if(tokenConfig.getTimeout() == -1) { + RedisUtils.setCacheObject(CacheConstants.ONLINE_TOKEN_KEY + tokenValue, dto); + } else { + RedisUtils.setCacheObject(CacheConstants.ONLINE_TOKEN_KEY + tokenValue, dto, Duration.ofSeconds(tokenConfig.getTimeout())); + } + } else if (userType == UserType.APP_USER) { + // app端 自行根据业务编写 + } + } + + /** + * 每次注销时触发 + */ + @Override + public void doLogout(String loginType, Object loginId, String tokenValue) { + RedisUtils.deleteObject(CacheConstants.ONLINE_TOKEN_KEY + tokenValue); + log.info("user doLogout, userId:{}, token:{}", loginId, tokenValue); + } + + /** + * 每次被踢下线时触发 + */ + @Override + public void doKickout(String loginType, Object loginId, String tokenValue) { + RedisUtils.deleteObject(CacheConstants.ONLINE_TOKEN_KEY + tokenValue); + log.info("user doLogoutByLoginId, userId:{}, token:{}", loginId, tokenValue); + } + + /** + * 每次被顶下线时触发 + */ + @Override + public void doReplaced(String loginType, Object loginId, String tokenValue) { + RedisUtils.deleteObject(CacheConstants.ONLINE_TOKEN_KEY + tokenValue); + log.info("user doReplaced, userId:{}, token:{}", loginId, tokenValue); + } + + /** + * 每次被封禁时触发 + */ + @Override + public void doDisable(String loginType, Object loginId, String service, int level, long disableTime) { + } + + /** + * 每次被解封时触发 + */ + @Override + public void doUntieDisable(String loginType, Object loginId, String service) { + } + + /** + * 每次打开二级认证时触发 + */ + @Override + public void doOpenSafe(String loginType, String tokenValue, String service, long safeTime) { + } + + /** + * 每次创建Session时触发 + */ + @Override + public void doCloseSafe(String loginType, String tokenValue, String service) { + } + + /** + * 每次创建Session时触发 + */ + @Override + public void doCreateSession(String id) { + } + + /** + * 每次注销Session时触发 + */ + @Override + public void doLogoutSession(String id) { + } + + /** + * 每次Token续期时触发 + */ + @Override + public void doRenewTimeout(String tokenValue, Object loginId, long timeout) { + } +} diff --git a/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysConfigMapper.java b/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysConfigMapper.java new file mode 100644 index 0000000..1eae7d0 --- /dev/null +++ b/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysConfigMapper.java @@ -0,0 +1,13 @@ +package com.ruoyi.system.mapper; + +import com.rouyi.common.mybatis.core.mapper.BaseMapperPlus; +import com.ruoyi.system.domain.entity.SysConfig; + +/** + * 参数配置 数据层 + * + * @author Lion Li + */ +public interface SysConfigMapper extends BaseMapperPlus { + +} diff --git a/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysDeptMapper.java b/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysDeptMapper.java new file mode 100644 index 0000000..4e0c824 --- /dev/null +++ b/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysDeptMapper.java @@ -0,0 +1,40 @@ +package com.ruoyi.system.mapper; + +import com.baomidou.mybatisplus.core.conditions.Wrapper; +import com.baomidou.mybatisplus.core.toolkit.Constants; +import com.rouyi.common.mybatis.annotation.DataColumn; +import com.rouyi.common.mybatis.annotation.DataPermission; +import com.rouyi.common.mybatis.core.mapper.BaseMapperPlus; +import com.ruoyi.system.domain.entity.SysDept; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +/** + * 部门管理 数据层 + * + * @author Lion Li + */ +public interface SysDeptMapper extends BaseMapperPlus { + + /** + * 查询部门管理数据 + * + * @param queryWrapper 查询条件 + * @return 部门信息集合 + */ + @DataPermission({ + @DataColumn(key = "deptName", value = "dept_id") + }) + List selectDeptList(@Param(Constants.WRAPPER) Wrapper queryWrapper); + + /** + * 根据角色ID查询部门树信息 + * + * @param roleId 角色ID + * @param deptCheckStrictly 部门树选择项是否关联显示 + * @return 选中部门列表 + */ + List selectDeptListByRoleId(@Param("roleId") Long roleId, @Param("deptCheckStrictly") boolean deptCheckStrictly); + +} diff --git a/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysDictDataMapper.java b/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysDictDataMapper.java new file mode 100644 index 0000000..1860221 --- /dev/null +++ b/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysDictDataMapper.java @@ -0,0 +1,24 @@ +package com.ruoyi.system.mapper; + +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.rouyi.common.mybatis.core.mapper.BaseMapperPlus; +import com.ruoyi.common.core.constant.UserConstants; +import com.ruoyi.system.domain.entity.SysDictData; + +import java.util.List; + +/** + * 字典表 数据层 + * + * @author Lion Li + */ +public interface SysDictDataMapper extends BaseMapperPlus { + + default List selectDictDataByType(String dictType) { + return selectList( + new LambdaQueryWrapper() + .eq(SysDictData::getStatus, UserConstants.DICT_NORMAL) + .eq(SysDictData::getDictType, dictType) + .orderByAsc(SysDictData::getDictSort)); + } +} diff --git a/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysDictTypeMapper.java b/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysDictTypeMapper.java new file mode 100644 index 0000000..276a265 --- /dev/null +++ b/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysDictTypeMapper.java @@ -0,0 +1,13 @@ +package com.ruoyi.system.mapper; + +import com.rouyi.common.mybatis.core.mapper.BaseMapperPlus; +import com.ruoyi.system.domain.entity.SysDictType; + +/** + * 字典表 数据层 + * + * @author Lion Li + */ +public interface SysDictTypeMapper extends BaseMapperPlus { + +} diff --git a/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysLogininforMapper.java b/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysLogininforMapper.java new file mode 100644 index 0000000..901e251 --- /dev/null +++ b/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysLogininforMapper.java @@ -0,0 +1,13 @@ +package com.ruoyi.system.mapper; + +import com.rouyi.common.mybatis.core.mapper.BaseMapperPlus; +import com.ruoyi.system.domain.entity.SysLogininfor; + +/** + * 系统访问日志情况信息 数据层 + * + * @author Lion Li + */ +public interface SysLogininforMapper extends BaseMapperPlus { + +} diff --git a/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysMenuMapper.java b/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysMenuMapper.java new file mode 100644 index 0000000..00d1981 --- /dev/null +++ b/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysMenuMapper.java @@ -0,0 +1,82 @@ +package com.ruoyi.system.mapper; + +import com.baomidou.mybatisplus.core.conditions.Wrapper; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.toolkit.Constants; +import com.rouyi.common.mybatis.core.mapper.BaseMapperPlus; +import com.ruoyi.common.core.constant.UserConstants; +import com.ruoyi.system.domain.entity.SysMenu; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +/** + * 菜单表 数据层 + * + * @author Lion Li + */ +public interface SysMenuMapper extends BaseMapperPlus { + + /** + * 根据用户所有权限 + * + * @return 权限列表 + */ + List selectMenuPerms(); + + /** + * 根据用户查询系统菜单列表 + * + * @param queryWrapper 查询条件 + * @return 菜单列表 + */ + List selectMenuListByUserId(@Param(Constants.WRAPPER) Wrapper queryWrapper); + + /** + * 根据用户ID查询权限 + * + * @param userId 用户ID + * @return 权限列表 + */ + List selectMenuPermsByUserId(Long userId); + + /** + * 根据角色ID查询权限 + * + * @param roleId 角色ID + * @return 权限列表 + */ + List selectMenuPermsByRoleId(Long roleId); + + /** + * 根据用户ID查询菜单 + * + * @return 菜单列表 + */ + default List selectMenuTreeAll() { + LambdaQueryWrapper lqw = new LambdaQueryWrapper() + .in(SysMenu::getMenuType, UserConstants.TYPE_DIR, UserConstants.TYPE_MENU) + .eq(SysMenu::getStatus, UserConstants.MENU_NORMAL) + .orderByAsc(SysMenu::getParentId) + .orderByAsc(SysMenu::getOrderNum); + return this.selectList(lqw); + } + + /** + * 根据用户ID查询菜单 + * + * @param userId 用户ID + * @return 菜单列表 + */ + List selectMenuTreeByUserId(Long userId); + + /** + * 根据角色ID查询菜单树信息 + * + * @param roleId 角色ID + * @param menuCheckStrictly 菜单树选择项是否关联显示 + * @return 选中菜单列表 + */ + List selectMenuListByRoleId(@Param("roleId") Long roleId, @Param("menuCheckStrictly") boolean menuCheckStrictly); + +} diff --git a/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysNoticeMapper.java b/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysNoticeMapper.java new file mode 100644 index 0000000..1d9ecb5 --- /dev/null +++ b/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysNoticeMapper.java @@ -0,0 +1,13 @@ +package com.ruoyi.system.mapper; + +import com.rouyi.common.mybatis.core.mapper.BaseMapperPlus; +import com.ruoyi.system.domain.entity.SysNotice; + +/** + * 通知公告表 数据层 + * + * @author Lion Li + */ +public interface SysNoticeMapper extends BaseMapperPlus { + +} diff --git a/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysOperLogMapper.java b/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysOperLogMapper.java new file mode 100644 index 0000000..2901916 --- /dev/null +++ b/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysOperLogMapper.java @@ -0,0 +1,13 @@ +package com.ruoyi.system.mapper; + +import com.rouyi.common.mybatis.core.mapper.BaseMapperPlus; +import com.ruoyi.system.domain.entity.SysOperLog; + +/** + * 操作日志 数据层 + * + * @author Lion Li + */ +public interface SysOperLogMapper extends BaseMapperPlus { + +} diff --git a/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysOssConfigMapper.java b/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysOssConfigMapper.java new file mode 100644 index 0000000..e09aa31 --- /dev/null +++ b/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysOssConfigMapper.java @@ -0,0 +1,16 @@ +package com.ruoyi.system.mapper; + +import com.rouyi.common.mybatis.core.mapper.BaseMapperPlus; +import com.ruoyi.system.domain.entity.SysOssConfig; +import com.ruoyi.system.domain.vo.SysOssConfigVo; + +/** + * 对象存储配置Mapper接口 + * + * @author Lion Li + * @author 孤舟烟雨 + * @date 2021-08-13 + */ +public interface SysOssConfigMapper extends BaseMapperPlus { + +} diff --git a/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysOssMapper.java b/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysOssMapper.java new file mode 100644 index 0000000..a42e2c0 --- /dev/null +++ b/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysOssMapper.java @@ -0,0 +1,13 @@ +package com.ruoyi.system.mapper; + +import com.rouyi.common.mybatis.core.mapper.BaseMapperPlus; +import com.ruoyi.system.domain.entity.SysOss; +import com.ruoyi.system.domain.vo.SysOssVo; + +/** + * 文件上传 数据层 + * + * @author Lion Li + */ +public interface SysOssMapper extends BaseMapperPlus { +} diff --git a/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysPostMapper.java b/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysPostMapper.java new file mode 100644 index 0000000..55575a9 --- /dev/null +++ b/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysPostMapper.java @@ -0,0 +1,31 @@ +package com.ruoyi.system.mapper; + +import com.rouyi.common.mybatis.core.mapper.BaseMapperPlus; +import com.ruoyi.system.domain.entity.SysPost; + +import java.util.List; + +/** + * 岗位信息 数据层 + * + * @author Lion Li + */ +public interface SysPostMapper extends BaseMapperPlus { + + /** + * 根据用户ID获取岗位选择框列表 + * + * @param userId 用户ID + * @return 选中岗位ID列表 + */ + List selectPostListByUserId(Long userId); + + /** + * 查询用户所属岗位组 + * + * @param userName 用户名 + * @return 结果 + */ + List selectPostsByUserName(String userName); + +} diff --git a/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysRoleDeptMapper.java b/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysRoleDeptMapper.java new file mode 100644 index 0000000..cfa8419 --- /dev/null +++ b/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysRoleDeptMapper.java @@ -0,0 +1,13 @@ +package com.ruoyi.system.mapper; + +import com.rouyi.common.mybatis.core.mapper.BaseMapperPlus; +import com.ruoyi.system.domain.entity.SysRoleDept; + +/** + * 角色与部门关联表 数据层 + * + * @author Lion Li + */ +public interface SysRoleDeptMapper extends BaseMapperPlus { + +} diff --git a/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysRoleMapper.java b/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysRoleMapper.java new file mode 100644 index 0000000..98bacfe --- /dev/null +++ b/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysRoleMapper.java @@ -0,0 +1,64 @@ +package com.ruoyi.system.mapper; + +import com.baomidou.mybatisplus.core.conditions.Wrapper; +import com.baomidou.mybatisplus.core.toolkit.Constants; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.rouyi.common.mybatis.annotation.DataColumn; +import com.rouyi.common.mybatis.annotation.DataPermission; +import com.rouyi.common.mybatis.core.mapper.BaseMapperPlus; +import com.ruoyi.system.domain.entity.SysRole; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +/** + * 角色表 数据层 + * + * @author Lion Li + */ +public interface SysRoleMapper extends BaseMapperPlus { + + @DataPermission({ + @DataColumn(key = "deptName", value = "d.dept_id"), + @DataColumn(key = "userName", value = "us.user_id") + }) + Page selectPageRoleList(@Param("page") Page page, @Param(Constants.WRAPPER) Wrapper queryWrapper); + + /** + * 根据条件分页查询角色数据 + * + * @param queryWrapper 查询条件 + * @return 角色数据集合信息 + */ + @DataPermission({ + @DataColumn(key = "deptName", value = "d.dept_id"), + @DataColumn(key = "userName", value = "us.user_id") + }) + List selectRoleList(@Param(Constants.WRAPPER) Wrapper queryWrapper); + + /** + * 根据用户ID查询角色 + * + * @param userId 用户ID + * @return 角色列表 + */ + List selectRolePermissionByUserId(Long userId); + + + /** + * 根据用户ID获取角色选择框列表 + * + * @param userId 用户ID + * @return 选中角色ID列表 + */ + List selectRoleListByUserId(Long userId); + + /** + * 根据用户ID查询角色 + * + * @param userName 用户名 + * @return 角色列表 + */ + List selectRolesByUserName(String userName); + +} diff --git a/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysRoleMenuMapper.java b/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysRoleMenuMapper.java new file mode 100644 index 0000000..7d4c6c0 --- /dev/null +++ b/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysRoleMenuMapper.java @@ -0,0 +1,13 @@ +package com.ruoyi.system.mapper; + +import com.rouyi.common.mybatis.core.mapper.BaseMapperPlus; +import com.ruoyi.system.domain.entity.SysRoleMenu; + +/** + * 角色与菜单关联表 数据层 + * + * @author Lion Li + */ +public interface SysRoleMenuMapper extends BaseMapperPlus { + +} diff --git a/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysUserMapper.java b/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysUserMapper.java new file mode 100644 index 0000000..78f1c6f --- /dev/null +++ b/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysUserMapper.java @@ -0,0 +1,95 @@ +package com.ruoyi.system.mapper; + +import com.baomidou.mybatisplus.core.conditions.Wrapper; +import com.baomidou.mybatisplus.core.toolkit.Constants; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.rouyi.common.mybatis.annotation.DataColumn; +import com.rouyi.common.mybatis.annotation.DataPermission; +import com.rouyi.common.mybatis.core.mapper.BaseMapperPlus; +import com.ruoyi.system.domain.entity.SysUser; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +/** + * 用户表 数据层 + * + * @author Lion Li + */ +public interface SysUserMapper extends BaseMapperPlus { + + @DataPermission({ + @DataColumn(key = "deptName", value = "d.dept_id"), + @DataColumn(key = "userName", value = "u.user_id") + }) + Page selectPageUserList(@Param("page") Page page, @Param(Constants.WRAPPER) Wrapper queryWrapper); + + /** + * 根据条件分页查询用户列表 + * + * @param queryWrapper 查询条件 + * @return 用户信息集合信息 + */ + @DataPermission({ + @DataColumn(key = "deptName", value = "d.dept_id"), + @DataColumn(key = "userName", value = "u.user_id") + }) + List selectUserList(@Param(Constants.WRAPPER) Wrapper queryWrapper); + + /** + * 根据条件分页查询已配用户角色列表 + * + * @param queryWrapper 查询条件 + * @return 用户信息集合信息 + */ + @DataPermission({ + @DataColumn(key = "deptName", value = "d.dept_id"), + @DataColumn(key = "userName", value = "u.user_id") + }) + Page selectAllocatedList(@Param("page") Page page, @Param(Constants.WRAPPER) Wrapper queryWrapper); + + /** + * 根据条件分页查询未分配用户角色列表 + * + * @param queryWrapper 查询条件 + * @return 用户信息集合信息 + */ + @DataPermission({ + @DataColumn(key = "deptName", value = "d.dept_id"), + @DataColumn(key = "userName", value = "u.user_id") + }) + Page selectUnallocatedList(@Param("page") Page page, @Param(Constants.WRAPPER) Wrapper queryWrapper); + + /** + * 通过用户名查询用户 + * + * @param userName 用户名 + * @return 用户对象信息 + */ + SysUser selectUserByUserName(String userName); + + /** + * 通过手机号查询用户 + * + * @param phonenumber 手机号 + * @return 用户对象信息 + */ + SysUser selectUserByPhonenumber(String phonenumber); + + /** + * 通过邮箱查询用户 + * + * @param email 邮箱 + * @return 用户对象信息 + */ + SysUser selectUserByEmail(String email); + + /** + * 通过用户ID查询用户 + * + * @param userId 用户ID + * @return 用户对象信息 + */ + SysUser selectUserById(Long userId); + +} diff --git a/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysUserPostMapper.java b/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysUserPostMapper.java new file mode 100644 index 0000000..a9ce76f --- /dev/null +++ b/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysUserPostMapper.java @@ -0,0 +1,13 @@ +package com.ruoyi.system.mapper; + +import com.rouyi.common.mybatis.core.mapper.BaseMapperPlus; +import com.ruoyi.system.domain.entity.SysUserPost; + +/** + * 用户与岗位关联表 数据层 + * + * @author Lion Li + */ +public interface SysUserPostMapper extends BaseMapperPlus { + +} diff --git a/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysUserRoleMapper.java b/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysUserRoleMapper.java new file mode 100644 index 0000000..9769fdb --- /dev/null +++ b/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysUserRoleMapper.java @@ -0,0 +1,17 @@ +package com.ruoyi.system.mapper; + +import com.rouyi.common.mybatis.core.mapper.BaseMapperPlus; +import com.ruoyi.system.domain.entity.SysUserRole; + +import java.util.List; + +/** + * 用户与角色关联表 数据层 + * + * @author Lion Li + */ +public interface SysUserRoleMapper extends BaseMapperPlus { + + List selectUserIdsByRoleId(Long roleId); + +} diff --git a/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/runner/SystemApplicationRunner.java b/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/runner/SystemApplicationRunner.java new file mode 100644 index 0000000..36ed651 --- /dev/null +++ b/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/runner/SystemApplicationRunner.java @@ -0,0 +1,41 @@ +package com.ruoyi.system.runner; + +import com.ruoyi.common.core.config.RuoYiConfig; +import com.ruoyi.system.service.ISysConfigService; +import com.ruoyi.system.service.ISysDictTypeService; +import com.ruoyi.system.service.ISysOssConfigService; +import lombok.RequiredArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.springframework.boot.ApplicationArguments; +import org.springframework.boot.ApplicationRunner; +import org.springframework.stereotype.Component; + +/** + * 初始化 system 模块对应业务数据 + * + * @author Lion Li + */ +@Slf4j +@RequiredArgsConstructor +@Component +public class SystemApplicationRunner implements ApplicationRunner { + + private final RuoYiConfig ruoyiConfig; + private final ISysConfigService configService; + private final ISysDictTypeService dictTypeService; + private final ISysOssConfigService ossConfigService; + + @Override + public void run(ApplicationArguments args) throws Exception { + ossConfigService.init(); + log.info("初始化OSS配置成功"); + if (ruoyiConfig.isCacheLazy()) { + return; + } + configService.loadingConfigCache(); + log.info("加载参数缓存数据成功"); + dictTypeService.loadingDictCache(); + log.info("加载字典缓存数据成功"); + } + +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service/ISysConfigService.java b/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/service/ISysConfigService.java similarity index 56% rename from ruoyi-system/src/main/java/com/ruoyi/system/service/ISysConfigService.java rename to ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/service/ISysConfigService.java index f867e63..ee0fa7e 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/service/ISysConfigService.java +++ b/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/service/ISysConfigService.java @@ -1,90 +1,89 @@ package com.ruoyi.system.service; +import com.rouyi.common.mybatis.core.page.PageQuery; +import com.rouyi.common.mybatis.core.page.TableDataInfo; +import com.ruoyi.system.domain.entity.SysConfig; + import java.util.List; -import com.ruoyi.system.domain.SysConfig; /** * 参数配置 服务层 - * - * @author ruoyi + * + * @author Lion Li */ -public interface ISysConfigService -{ +public interface ISysConfigService { + + + TableDataInfo selectPageConfigList(SysConfig config, PageQuery pageQuery); + /** * 查询参数配置信息 - * + * * @param configId 参数配置ID * @return 参数配置信息 */ - public SysConfig selectConfigById(Long configId); + SysConfig selectConfigById(Long configId); /** * 根据键名查询参数配置信息 - * + * * @param configKey 参数键名 * @return 参数键值 */ - public String selectConfigByKey(String configKey); - - /** - * 获取验证码开关 - * - * @return true开启,false关闭 - */ - public boolean selectCaptchaOnOff(); + String selectConfigByKey(String configKey); /** * 查询参数配置列表 - * + * * @param config 参数配置信息 * @return 参数配置集合 */ - public List selectConfigList(SysConfig config); + List selectConfigList(SysConfig config); /** * 新增参数配置 - * + * * @param config 参数配置信息 * @return 结果 */ - public int insertConfig(SysConfig config); + String insertConfig(SysConfig config); /** * 修改参数配置 - * + * * @param config 参数配置信息 * @return 结果 */ - public int updateConfig(SysConfig config); + String updateConfig(SysConfig config); /** * 批量删除参数信息 - * + * * @param configIds 需要删除的参数ID - * @return 结果 */ - public void deleteConfigByIds(Long[] configIds); + void deleteConfigByIds(Long[] configIds); /** * 加载参数缓存数据 */ - public void loadingConfigCache(); + void loadingConfigCache(); /** * 清空参数缓存数据 */ - public void clearConfigCache(); + void clearConfigCache(); /** * 重置参数缓存数据 */ - public void resetConfigCache(); + void resetConfigCache(); /** * 校验参数键名是否唯一 - * + * * @param config 参数信息 * @return 结果 */ - public String checkConfigKeyUnique(SysConfig config); + boolean checkConfigKeyUnique(SysConfig config); + } diff --git a/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/service/ISysDataScopeService.java b/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/service/ISysDataScopeService.java new file mode 100644 index 0000000..4ad4e45 --- /dev/null +++ b/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/service/ISysDataScopeService.java @@ -0,0 +1,26 @@ +package com.ruoyi.system.service; + +/** + * 通用 数据权限 服务 + * + * @author Lion Li + */ +public interface ISysDataScopeService { + + /** + * 获取角色自定义权限 + * + * @param roleId 角色id + * @return 部门id组 + */ + String getRoleCustom(Long roleId); + + /** + * 获取部门及以下权限 + * + * @param deptId 部门id + * @return 部门id组 + */ + String getDeptAndChild(Long deptId); + +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service/ISysDeptService.java b/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/service/ISysDeptService.java similarity index 56% rename from ruoyi-system/src/main/java/com/ruoyi/system/service/ISysDeptService.java rename to ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/service/ISysDeptService.java index 1bdd472..4b4949a 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/service/ISysDeptService.java +++ b/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/service/ISysDeptService.java @@ -1,116 +1,116 @@ package com.ruoyi.system.service; +import cn.hutool.core.lang.tree.Tree; +import com.ruoyi.system.domain.entity.SysDept; + import java.util.List; -import com.ruoyi.common.core.domain.TreeSelect; -import com.ruoyi.common.core.domain.entity.SysDept; /** * 部门管理 服务层 - * - * @author ruoyi + * + * @author Lion Li */ -public interface ISysDeptService -{ +public interface ISysDeptService { /** * 查询部门管理数据 - * + * * @param dept 部门信息 * @return 部门信息集合 */ - public List selectDeptList(SysDept dept); + List selectDeptList(SysDept dept); /** - * 构建前端所需要树结构 - * - * @param depts 部门列表 - * @return 树结构列表 + * 查询部门树结构信息 + * + * @param dept 部门信息 + * @return 部门树信息集合 */ - public List buildDeptTree(List depts); + List> selectDeptTreeList(SysDept dept); /** * 构建前端所需要下拉树结构 - * + * * @param depts 部门列表 * @return 下拉树结构列表 */ - public List buildDeptTreeSelect(List depts); + List> buildDeptTreeSelect(List depts); /** * 根据角色ID查询部门树信息 - * + * * @param roleId 角色ID * @return 选中部门列表 */ - public List selectDeptListByRoleId(Long roleId); + List selectDeptListByRoleId(Long roleId); /** * 根据部门ID查询信息 - * + * * @param deptId 部门ID * @return 部门信息 */ - public SysDept selectDeptById(Long deptId); + SysDept selectDeptById(Long deptId); /** - * 根据ID查询所有子部门(正常状态) - * + * 根据ID查询所有子部门数(正常状态) + * * @param deptId 部门ID * @return 子部门数 */ - public int selectNormalChildrenDeptById(Long deptId); + long selectNormalChildrenDeptById(Long deptId); /** * 是否存在部门子节点 - * + * * @param deptId 部门ID * @return 结果 */ - public boolean hasChildByDeptId(Long deptId); + boolean hasChildByDeptId(Long deptId); /** * 查询部门是否存在用户 - * + * * @param deptId 部门ID * @return 结果 true 存在 false 不存在 */ - public boolean checkDeptExistUser(Long deptId); + boolean checkDeptExistUser(Long deptId); /** * 校验部门名称是否唯一 - * + * * @param dept 部门信息 * @return 结果 */ - public String checkDeptNameUnique(SysDept dept); + boolean checkDeptNameUnique(SysDept dept); /** * 校验部门是否有数据权限 - * + * * @param deptId 部门id */ - public void checkDeptDataScope(Long deptId); + void checkDeptDataScope(Long deptId); /** * 新增保存部门信息 - * + * * @param dept 部门信息 * @return 结果 */ - public int insertDept(SysDept dept); + int insertDept(SysDept dept); /** * 修改保存部门信息 - * + * * @param dept 部门信息 * @return 结果 */ - public int updateDept(SysDept dept); + int updateDept(SysDept dept); /** * 删除部门管理信息 - * + * * @param deptId 部门ID * @return 结果 */ - public int deleteDeptById(Long deptId); + int deleteDeptById(Long deptId); } diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service/ISysDictDataService.java b/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/service/ISysDictDataService.java similarity index 53% rename from ruoyi-system/src/main/java/com/ruoyi/system/service/ISysDictDataService.java rename to ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/service/ISysDictDataService.java index e255a44..54f6b2d 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/service/ISysDictDataService.java +++ b/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/service/ISysDictDataService.java @@ -1,64 +1,66 @@ package com.ruoyi.system.service; -import java.util.Collection; +import com.rouyi.common.mybatis.core.page.PageQuery; +import com.ruoyi.system.domain.entity.SysDictData; +import com.rouyi.common.mybatis.core.page.TableDataInfo; + import java.util.List; -import com.ruoyi.common.core.domain.entity.SysDictData; /** * 字典 业务层 - * - * @author ruoyi + * + * @author Lion Li */ -public interface ISysDictDataService -{ +public interface ISysDictDataService { + + + TableDataInfo selectPageDictDataList(SysDictData dictData, PageQuery pageQuery); + /** * 根据条件分页查询字典数据 - * + * * @param dictData 字典数据信息 * @return 字典数据集合信息 */ - public List selectDictDataList(SysDictData dictData); + List selectDictDataList(SysDictData dictData); /** * 根据字典类型和字典键值查询字典数据信息 - * - * @param dictType 字典类型 + * + * @param dictType 字典类型 * @param dictValue 字典键值 * @return 字典标签 */ - public String selectDictLabel(String dictType, String dictValue); + String selectDictLabel(String dictType, String dictValue); /** * 根据字典数据ID查询信息 - * + * * @param dictCode 字典数据ID * @return 字典数据 */ - public SysDictData selectDictDataById(Long dictCode); + SysDictData selectDictDataById(Long dictCode); /** * 批量删除字典数据信息 - * + * * @param dictCodes 需要删除的字典数据ID - * @return 结果 */ - public void deleteDictDataByIds(Long[] dictCodes); + void deleteDictDataByIds(Long[] dictCodes); /** * 新增保存字典数据信息 - * + * * @param dictData 字典数据信息 * @return 结果 */ - public int insertDictData(SysDictData dictData); + List insertDictData(SysDictData dictData); /** * 修改保存字典数据信息 - * + * * @param dictData 字典数据信息 * @return 结果 */ - public int updateDictData(SysDictData dictData); - - List selectDictDataByTypes(Collection dictTypes); + List updateDictData(SysDictData dictData); } diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service/ISysDictTypeService.java b/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/service/ISysDictTypeService.java similarity index 56% rename from ruoyi-system/src/main/java/com/ruoyi/system/service/ISysDictTypeService.java rename to ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/service/ISysDictTypeService.java index 72d9af5..f480dbd 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/service/ISysDictTypeService.java +++ b/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/service/ISysDictTypeService.java @@ -1,99 +1,104 @@ package com.ruoyi.system.service; +import com.rouyi.common.mybatis.core.page.PageQuery; +import com.ruoyi.system.domain.entity.SysDictData; +import com.ruoyi.system.domain.entity.SysDictType; +import com.rouyi.common.mybatis.core.page.TableDataInfo; + import java.util.List; -import com.ruoyi.common.core.domain.entity.SysDictData; -import com.ruoyi.common.core.domain.entity.SysDictType; /** * 字典 业务层 - * - * @author ruoyi + * + * @author Lion Li */ -public interface ISysDictTypeService -{ +public interface ISysDictTypeService { + + + TableDataInfo selectPageDictTypeList(SysDictType dictType, PageQuery pageQuery); + /** * 根据条件分页查询字典类型 - * + * * @param dictType 字典类型信息 * @return 字典类型集合信息 */ - public List selectDictTypeList(SysDictType dictType); + List selectDictTypeList(SysDictType dictType); /** * 根据所有字典类型 - * + * * @return 字典类型集合信息 */ - public List selectDictTypeAll(); + List selectDictTypeAll(); /** * 根据字典类型查询字典数据 - * + * * @param dictType 字典类型 * @return 字典数据集合信息 */ - public List selectDictDataByType(String dictType); + List selectDictDataByType(String dictType); /** * 根据字典类型ID查询信息 - * + * * @param dictId 字典类型ID * @return 字典类型 */ - public SysDictType selectDictTypeById(Long dictId); + SysDictType selectDictTypeById(Long dictId); /** * 根据字典类型查询信息 - * + * * @param dictType 字典类型 * @return 字典类型 */ - public SysDictType selectDictTypeByType(String dictType); + SysDictType selectDictTypeByType(String dictType); /** * 批量删除字典信息 - * + * * @param dictIds 需要删除的字典ID - * @return 结果 */ - public void deleteDictTypeByIds(Long[] dictIds); + void deleteDictTypeByIds(Long[] dictIds); /** * 加载字典缓存数据 */ - public void loadingDictCache(); + void loadingDictCache(); /** * 清空字典缓存数据 */ - public void clearDictCache(); + void clearDictCache(); /** * 重置字典缓存数据 */ - public void resetDictCache(); + void resetDictCache(); /** * 新增保存字典类型信息 - * + * * @param dictType 字典类型信息 * @return 结果 */ - public int insertDictType(SysDictType dictType); + List insertDictType(SysDictType dictType); /** * 修改保存字典类型信息 - * + * * @param dictType 字典类型信息 * @return 结果 */ - public int updateDictType(SysDictType dictType); + List updateDictType(SysDictType dictType); /** * 校验字典类型称是否唯一 - * + * * @param dictType 字典类型 * @return 结果 */ - public String checkDictTypeUnique(SysDictType dictType); + boolean checkDictTypeUnique(SysDictType dictType); } diff --git a/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/service/ISysLogininforService.java b/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/service/ISysLogininforService.java new file mode 100644 index 0000000..d078384 --- /dev/null +++ b/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/service/ISysLogininforService.java @@ -0,0 +1,46 @@ +package com.ruoyi.system.service; + +import com.rouyi.common.mybatis.core.page.PageQuery; +import com.rouyi.common.mybatis.core.page.TableDataInfo; +import com.ruoyi.system.domain.entity.SysLogininfor; + +import java.util.List; + +/** + * 系统访问日志情况信息 服务层 + * + * @author Lion Li + */ +public interface ISysLogininforService { + + + TableDataInfo selectPageLogininforList(SysLogininfor logininfor, PageQuery pageQuery); + + /** + * 新增系统登录日志 + * + * @param logininfor 访问日志对象 + */ + void insertLogininfor(SysLogininfor logininfor); + + /** + * 查询系统登录日志集合 + * + * @param logininfor 访问日志对象 + * @return 登录记录集合 + */ + List selectLogininforList(SysLogininfor logininfor); + + /** + * 批量删除系统登录日志 + * + * @param infoIds 需要删除的登录日志ID + * @return 结果 + */ + int deleteLogininforByIds(Long[] infoIds); + + /** + * 清空系统登录日志 + */ + void cleanLogininfor(); +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service/ISysMenuService.java b/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/service/ISysMenuService.java similarity index 59% rename from ruoyi-system/src/main/java/com/ruoyi/system/service/ISysMenuService.java rename to ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/service/ISysMenuService.java index f64bee1..fb2b86c 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/service/ISysMenuService.java +++ b/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/service/ISysMenuService.java @@ -1,136 +1,137 @@ package com.ruoyi.system.service; +import cn.hutool.core.lang.tree.Tree; +import com.ruoyi.system.domain.entity.SysMenu; +import com.ruoyi.system.domain.vo.RouterVo; + import java.util.List; import java.util.Set; -import com.ruoyi.common.core.domain.TreeSelect; -import com.ruoyi.common.core.domain.entity.SysMenu; -import com.ruoyi.system.domain.vo.RouterVo; /** * 菜单 业务层 - * - * @author ruoyi + * + * @author Lion Li */ -public interface ISysMenuService -{ - /** - * 根据用户查询系统菜单列表 - * - * @param userId 用户ID - * @return 菜单列表 - */ - public List selectMenuList(Long userId); +public interface ISysMenuService { /** * 根据用户查询系统菜单列表 - * - * @param menu 菜单信息 + * * @param userId 用户ID * @return 菜单列表 */ - public List selectMenuList(SysMenu menu, Long userId); + List selectMenuList(Long userId); + + /** + * 根据用户查询系统菜单列表 + * + * @param menu 菜单信息 + * @param userId 用户ID + * @return 菜单列表 + */ + List selectMenuList(SysMenu menu, Long userId); /** * 根据用户ID查询权限 - * + * * @param userId 用户ID * @return 权限列表 */ - public Set selectMenuPermsByUserId(Long userId); + Set selectMenuPermsByUserId(Long userId); + + /** + * 根据角色ID查询权限 + * + * @param roleId 角色ID + * @return 权限列表 + */ + Set selectMenuPermsByRoleId(Long roleId); /** * 根据用户ID查询菜单树信息 - * + * * @param userId 用户ID * @return 菜单列表 */ - public List selectMenuTreeByUserId(Long userId); + List selectMenuTreeByUserId(Long userId); /** * 根据角色ID查询菜单树信息 - * + * * @param roleId 角色ID * @return 选中菜单列表 */ - public List selectMenuListByRoleId(Long roleId); + List selectMenuListByRoleId(Long roleId); /** * 构建前端路由所需要的菜单 - * + * * @param menus 菜单列表 * @return 路由列表 */ - public List buildMenus(List menus); - - /** - * 构建前端所需要树结构 - * - * @param menus 菜单列表 - * @return 树结构列表 - */ - public List buildMenuTree(List menus); + List buildMenus(List menus); /** * 构建前端所需要下拉树结构 - * + * * @param menus 菜单列表 * @return 下拉树结构列表 */ - public List buildMenuTreeSelect(List menus); + List> buildMenuTreeSelect(List menus); /** * 根据菜单ID查询信息 - * + * * @param menuId 菜单ID * @return 菜单信息 */ - public SysMenu selectMenuById(Long menuId); + SysMenu selectMenuById(Long menuId); /** * 是否存在菜单子节点 - * + * * @param menuId 菜单ID * @return 结果 true 存在 false 不存在 */ - public boolean hasChildByMenuId(Long menuId); + boolean hasChildByMenuId(Long menuId); /** * 查询菜单是否存在角色 - * + * * @param menuId 菜单ID * @return 结果 true 存在 false 不存在 */ - public boolean checkMenuExistRole(Long menuId); + boolean checkMenuExistRole(Long menuId); /** * 新增保存菜单信息 - * + * * @param menu 菜单信息 * @return 结果 */ - public int insertMenu(SysMenu menu); + int insertMenu(SysMenu menu); /** * 修改保存菜单信息 - * + * * @param menu 菜单信息 * @return 结果 */ - public int updateMenu(SysMenu menu); + int updateMenu(SysMenu menu); /** * 删除菜单管理信息 - * + * * @param menuId 菜单ID * @return 结果 */ - public int deleteMenuById(Long menuId); + int deleteMenuById(Long menuId); /** * 校验菜单名称是否唯一 - * + * * @param menu 菜单信息 * @return 结果 */ - public String checkMenuNameUnique(SysMenu menu); + boolean checkMenuNameUnique(SysMenu menu); } diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service/ISysNoticeService.java b/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/service/ISysNoticeService.java similarity index 52% rename from ruoyi-system/src/main/java/com/ruoyi/system/service/ISysNoticeService.java rename to ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/service/ISysNoticeService.java index 47ce1b7..6b3ec12 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/service/ISysNoticeService.java +++ b/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/service/ISysNoticeService.java @@ -1,60 +1,66 @@ package com.ruoyi.system.service; +import com.rouyi.common.mybatis.core.page.PageQuery; +import com.rouyi.common.mybatis.core.page.TableDataInfo; +import com.ruoyi.system.domain.entity.SysNotice; + import java.util.List; -import com.ruoyi.system.domain.SysNotice; /** * 公告 服务层 - * - * @author ruoyi + * + * @author Lion Li */ -public interface ISysNoticeService -{ +public interface ISysNoticeService { + + + TableDataInfo selectPageNoticeList(SysNotice notice, PageQuery pageQuery); + /** * 查询公告信息 - * + * * @param noticeId 公告ID * @return 公告信息 */ - public SysNotice selectNoticeById(Long noticeId); + SysNotice selectNoticeById(Long noticeId); /** * 查询公告列表 - * + * * @param notice 公告信息 * @return 公告集合 */ - public List selectNoticeList(SysNotice notice); + List selectNoticeList(SysNotice notice); /** * 新增公告 - * + * * @param notice 公告信息 * @return 结果 */ - public int insertNotice(SysNotice notice); + int insertNotice(SysNotice notice); /** * 修改公告 - * + * * @param notice 公告信息 * @return 结果 */ - public int updateNotice(SysNotice notice); + int updateNotice(SysNotice notice); /** * 删除公告信息 - * + * * @param noticeId 公告ID * @return 结果 */ - public int deleteNoticeById(Long noticeId); - + int deleteNoticeById(Long noticeId); + /** * 批量删除公告信息 - * + * * @param noticeIds 需要删除的公告ID * @return 结果 */ - public int deleteNoticeByIds(Long[] noticeIds); + int deleteNoticeByIds(Long[] noticeIds); } diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service/ISysOperLogService.java b/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/service/ISysOperLogService.java similarity index 51% rename from ruoyi-system/src/main/java/com/ruoyi/system/service/ISysOperLogService.java rename to ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/service/ISysOperLogService.java index 4fd8e5a..cea844a 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/service/ISysOperLogService.java +++ b/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/service/ISysOperLogService.java @@ -1,48 +1,53 @@ package com.ruoyi.system.service; +import com.rouyi.common.mybatis.core.page.PageQuery; +import com.rouyi.common.mybatis.core.page.TableDataInfo; +import com.ruoyi.system.domain.entity.SysOperLog; + import java.util.List; -import com.ruoyi.system.domain.SysOperLog; /** * 操作日志 服务层 - * - * @author ruoyi + * + * @author Lion Li */ -public interface ISysOperLogService -{ +public interface ISysOperLogService { + + TableDataInfo selectPageOperLogList(SysOperLog operLog, PageQuery pageQuery); + /** * 新增操作日志 - * + * * @param operLog 操作日志对象 */ - public void insertOperlog(SysOperLog operLog); + void insertOperlog(SysOperLog operLog); /** * 查询系统操作日志集合 - * + * * @param operLog 操作日志对象 * @return 操作日志集合 */ - public List selectOperLogList(SysOperLog operLog); + List selectOperLogList(SysOperLog operLog); /** * 批量删除系统操作日志 - * + * * @param operIds 需要删除的操作日志ID * @return 结果 */ - public int deleteOperLogByIds(Long[] operIds); + int deleteOperLogByIds(Long[] operIds); /** * 查询操作日志详细 - * + * * @param operId 操作ID * @return 操作日志对象 */ - public SysOperLog selectOperLogById(Long operId); + SysOperLog selectOperLogById(Long operId); /** * 清空操作日志 */ - public void cleanOperLog(); + void cleanOperLog(); } diff --git a/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/service/ISysOssConfigService.java b/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/service/ISysOssConfigService.java new file mode 100644 index 0000000..18a04af --- /dev/null +++ b/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/service/ISysOssConfigService.java @@ -0,0 +1,65 @@ +package com.ruoyi.system.service; + +import com.rouyi.common.mybatis.core.page.PageQuery; +import com.rouyi.common.mybatis.core.page.TableDataInfo; +import com.ruoyi.system.domain.bo.SysOssConfigBo; +import com.ruoyi.system.domain.vo.SysOssConfigVo; + +import java.util.Collection; + +/** + * 对象存储配置Service接口 + * + * @author Lion Li + * @author 孤舟烟雨 + * @date 2021-08-13 + */ +public interface ISysOssConfigService { + + /** + * 初始化OSS配置 + */ + void init(); + + /** + * 查询单个 + */ + SysOssConfigVo queryById(Long ossConfigId); + + /** + * 查询列表 + */ + TableDataInfo queryPageList(SysOssConfigBo bo, PageQuery pageQuery); + + + /** + * 根据新增业务对象插入对象存储配置 + * + * @param bo 对象存储配置新增业务对象 + * @return + */ + Boolean insertByBo(SysOssConfigBo bo); + + /** + * 根据编辑业务对象修改对象存储配置 + * + * @param bo 对象存储配置编辑业务对象 + * @return + */ + Boolean updateByBo(SysOssConfigBo bo); + + /** + * 校验并删除数据 + * + * @param ids 主键集合 + * @param isValid 是否校验,true-删除前校验,false-不校验 + * @return + */ + Boolean deleteWithValidByIds(Collection ids, Boolean isValid); + + /** + * 启用停用状态 + */ + int updateOssConfigStatus(SysOssConfigBo bo); + +} diff --git a/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/service/ISysOssService.java b/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/service/ISysOssService.java new file mode 100644 index 0000000..ac141bf --- /dev/null +++ b/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/service/ISysOssService.java @@ -0,0 +1,36 @@ +package com.ruoyi.system.service; + +import com.rouyi.common.mybatis.core.page.PageQuery; +import com.rouyi.common.mybatis.core.page.TableDataInfo; +import com.ruoyi.system.domain.bo.SysOssBo; +import com.ruoyi.system.domain.vo.SysOssVo; +import org.springframework.web.multipart.MultipartFile; + +import jakarta.servlet.http.HttpServletResponse; +import java.io.File; +import java.io.IOException; +import java.util.Collection; +import java.util.List; + +/** + * 文件上传 服务层 + * + * @author Lion Li + */ +public interface ISysOssService { + + TableDataInfo queryPageList(SysOssBo sysOss, PageQuery pageQuery); + + List listByIds(Collection ossIds); + + SysOssVo getById(Long ossId); + + SysOssVo upload(MultipartFile file); + + SysOssVo upload(File file); + + void download(Long ossId, HttpServletResponse response) throws IOException; + + Boolean deleteWithValidByIds(Collection ids, Boolean isValid); + +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service/ISysPostService.java b/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/service/ISysPostService.java similarity index 60% rename from ruoyi-system/src/main/java/com/ruoyi/system/service/ISysPostService.java rename to ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/service/ISysPostService.java index aab216d..a420ffc 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/service/ISysPostService.java +++ b/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/service/ISysPostService.java @@ -1,100 +1,105 @@ package com.ruoyi.system.service; +import com.rouyi.common.mybatis.core.page.PageQuery; +import com.rouyi.common.mybatis.core.page.TableDataInfo; +import com.ruoyi.system.domain.entity.SysPost; + import java.util.List; -import com.ruoyi.system.domain.SysPost; /** * 岗位信息 服务层 - * - * @author ruoyi + * + * @author Lion Li */ -public interface ISysPostService -{ +public interface ISysPostService { + + + TableDataInfo selectPagePostList(SysPost post, PageQuery pageQuery); + /** * 查询岗位信息集合 - * + * * @param post 岗位信息 * @return 岗位列表 */ - public List selectPostList(SysPost post); + List selectPostList(SysPost post); /** * 查询所有岗位 - * + * * @return 岗位列表 */ - public List selectPostAll(); + List selectPostAll(); /** * 通过岗位ID查询岗位信息 - * + * * @param postId 岗位ID * @return 角色对象信息 */ - public SysPost selectPostById(Long postId); + SysPost selectPostById(Long postId); /** * 根据用户ID获取岗位选择框列表 - * + * * @param userId 用户ID * @return 选中岗位ID列表 */ - public List selectPostListByUserId(Long userId); + List selectPostListByUserId(Long userId); /** * 校验岗位名称 - * + * * @param post 岗位信息 * @return 结果 */ - public String checkPostNameUnique(SysPost post); + boolean checkPostNameUnique(SysPost post); /** * 校验岗位编码 - * + * * @param post 岗位信息 * @return 结果 */ - public String checkPostCodeUnique(SysPost post); + boolean checkPostCodeUnique(SysPost post); /** * 通过岗位ID查询岗位使用数量 - * + * * @param postId 岗位ID * @return 结果 */ - public int countUserPostById(Long postId); + long countUserPostById(Long postId); /** * 删除岗位信息 - * + * * @param postId 岗位ID * @return 结果 */ - public int deletePostById(Long postId); + int deletePostById(Long postId); /** * 批量删除岗位信息 - * + * * @param postIds 需要删除的岗位ID * @return 结果 - * @throws Exception 异常 */ - public int deletePostByIds(Long[] postIds); + int deletePostByIds(Long[] postIds); /** * 新增保存岗位信息 - * + * * @param post 岗位信息 * @return 结果 */ - public int insertPost(SysPost post); + int insertPost(SysPost post); /** * 修改保存岗位信息 - * + * * @param post 岗位信息 * @return 结果 */ - public int updatePost(SysPost post); + int updatePost(SysPost post); } diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service/ISysRoleService.java b/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/service/ISysRoleService.java similarity index 60% rename from ruoyi-system/src/main/java/com/ruoyi/system/service/ISysRoleService.java rename to ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/service/ISysRoleService.java index ac090c7..b33e98c 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/service/ISysRoleService.java +++ b/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/service/ISysRoleService.java @@ -1,180 +1,181 @@ package com.ruoyi.system.service; -import com.ruoyi.common.core.domain.entity.SysRole; -import com.ruoyi.system.domain.SysUserRole; +import com.rouyi.common.mybatis.core.page.PageQuery; +import com.rouyi.common.mybatis.core.page.TableDataInfo; +import com.ruoyi.system.domain.entity.SysRole; +import com.ruoyi.system.domain.entity.SysUserRole; import java.util.List; import java.util.Set; /** * 角色业务层 - * - * @author ruoyi + * + * @author Lion Li */ -public interface ISysRoleService -{ +public interface ISysRoleService { + + + TableDataInfo selectPageRoleList(SysRole role, PageQuery pageQuery); + /** * 根据条件分页查询角色数据 - * + * * @param role 角色信息 * @return 角色数据集合信息 */ - public List selectRoleList(SysRole role); + List selectRoleList(SysRole role); /** * 根据用户ID查询角色列表 - * + * * @param userId 用户ID * @return 角色列表 */ - public List selectRolesByUserId(Long userId); + List selectRolesByUserId(Long userId); /** * 根据用户ID查询角色权限 - * + * * @param userId 用户ID * @return 权限列表 */ - public Set selectRolePermissionByUserId(Long userId); + Set selectRolePermissionByUserId(Long userId); /** * 查询所有角色 - * + * * @return 角色列表 */ - public List selectRoleAll(); + List selectRoleAll(); /** * 根据用户ID获取角色选择框列表 - * + * * @param userId 用户ID * @return 选中角色ID列表 */ - public List selectRoleListByUserId(Long userId); + List selectRoleListByUserId(Long userId); /** * 通过角色ID查询角色 - * + * * @param roleId 角色ID * @return 角色对象信息 */ - public SysRole selectRoleById(Long roleId); + SysRole selectRoleById(Long roleId); /** * 校验角色名称是否唯一 - * + * * @param role 角色信息 * @return 结果 */ - public String checkRoleNameUnique(SysRole role); + boolean checkRoleNameUnique(SysRole role); /** * 校验角色权限是否唯一 - * + * * @param role 角色信息 * @return 结果 */ - public String checkRoleKeyUnique(SysRole role); + boolean checkRoleKeyUnique(SysRole role); /** * 校验角色是否允许操作 - * + * * @param role 角色信息 */ - public void checkRoleAllowed(SysRole role); + void checkRoleAllowed(SysRole role); /** * 校验角色是否有数据权限 - * + * * @param roleId 角色id */ - public void checkRoleDataScope(Long roleId); + void checkRoleDataScope(Long roleId); /** * 通过角色ID查询角色使用数量 - * + * * @param roleId 角色ID * @return 结果 */ - public int countUserRoleByRoleId(Long roleId); + long countUserRoleByRoleId(Long roleId); /** * 新增保存角色信息 - * + * * @param role 角色信息 * @return 结果 */ - public int insertRole(SysRole role); + int insertRole(SysRole role); /** * 修改保存角色信息 - * + * * @param role 角色信息 * @return 结果 */ - public int updateRole(SysRole role); + int updateRole(SysRole role); /** * 修改角色状态 - * + * * @param role 角色信息 * @return 结果 */ - public int updateRoleStatus(SysRole role); + int updateRoleStatus(SysRole role); /** * 修改数据权限信息 - * + * * @param role 角色信息 * @return 结果 */ - public int authDataScope(SysRole role); + int authDataScope(SysRole role); /** * 通过角色ID删除角色 - * + * * @param roleId 角色ID * @return 结果 */ - public int deleteRoleById(Long roleId); + int deleteRoleById(Long roleId); /** * 批量删除角色信息 - * + * * @param roleIds 需要删除的角色ID * @return 结果 */ - public int deleteRoleByIds(Long[] roleIds); + int deleteRoleByIds(Long[] roleIds); /** * 取消授权用户角色 - * + * * @param userRole 用户和角色关联信息 * @return 结果 */ - public int deleteAuthUser(SysUserRole userRole); + int deleteAuthUser(SysUserRole userRole); /** * 批量取消授权用户角色 - * - * @param roleId 角色ID + * + * @param roleId 角色ID * @param userIds 需要取消授权的用户数据ID * @return 结果 */ - public int deleteAuthUsers(Long roleId, Long[] userIds); + int deleteAuthUsers(Long roleId, Long[] userIds); /** * 批量选择授权用户角色 - * - * @param roleId 角色ID + * + * @param roleId 角色ID * @param userIds 需要删除的用户数据ID * @return 结果 */ - public int insertAuthUsers(Long roleId, Long[] userIds); + int insertAuthUsers(Long roleId, Long[] userIds); - SysRole selectRoleByKey(String vip); - - int allocateRole2User(String role, Long userId); - - boolean hasRole(String roleKey, Long userId); + void cleanOnlineUserByRole(Long roleId); } diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service/ISysUserService.java b/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/service/ISysUserService.java similarity index 57% rename from ruoyi-system/src/main/java/com/ruoyi/system/service/ISysUserService.java rename to ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/service/ISysUserService.java index d8da330..b969817 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/service/ISysUserService.java +++ b/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/service/ISysUserService.java @@ -1,78 +1,92 @@ package com.ruoyi.system.service; +import com.rouyi.common.mybatis.core.page.PageQuery; +import com.ruoyi.system.domain.entity.SysUser; +import com.rouyi.common.mybatis.core.page.TableDataInfo; + import java.util.List; -import com.ruoyi.common.core.domain.entity.SysUser; /** * 用户 业务层 - * - * @author ruoyi + * + * @author Lion Li */ -public interface ISysUserService -{ +public interface ISysUserService { + + + TableDataInfo selectPageUserList(SysUser user, PageQuery pageQuery); + /** * 根据条件分页查询用户列表 - * + * * @param user 用户信息 * @return 用户信息集合信息 */ - public List selectUserList(SysUser user); + List selectUserList(SysUser user); /** * 根据条件分页查询已分配用户角色列表 - * + * * @param user 用户信息 * @return 用户信息集合信息 */ - public List selectAllocatedList(SysUser user); + TableDataInfo selectAllocatedList(SysUser user, PageQuery pageQuery); /** * 根据条件分页查询未分配用户角色列表 - * + * * @param user 用户信息 * @return 用户信息集合信息 */ - public List selectUnallocatedList(SysUser user); + TableDataInfo selectUnallocatedList(SysUser user, PageQuery pageQuery); /** * 通过用户名查询用户 - * + * * @param userName 用户名 * @return 用户对象信息 */ - public SysUser selectUserByUserName(String userName); + SysUser selectUserByUserName(String userName); + + /** + * 通过手机号查询用户 + * + * @param phonenumber 手机号 + * @return 用户对象信息 + */ + SysUser selectUserByPhonenumber(String phonenumber); /** * 通过用户ID查询用户 - * + * * @param userId 用户ID * @return 用户对象信息 */ - public SysUser selectUserById(Long userId); + SysUser selectUserById(Long userId); /** * 根据用户ID查询用户所属角色组 - * + * * @param userName 用户名 * @return 结果 */ - public String selectUserRoleGroup(String userName); + String selectUserRoleGroup(String userName); /** * 根据用户ID查询用户所属岗位组 - * + * * @param userName 用户名 * @return 结果 */ - public String selectUserPostGroup(String userName); + String selectUserPostGroup(String userName); /** * 校验用户名称是否唯一 - * - * @param userName 用户名称 + * + * @param user 用户信息 * @return 结果 */ - public String checkUserNameUnique(String userName); + boolean checkUserNameUnique(SysUser user); /** * 校验手机号码是否唯一 @@ -80,7 +94,7 @@ public interface ISysUserService * @param user 用户信息 * @return 结果 */ - public String checkPhoneUnique(SysUser user); + boolean checkPhoneUnique(SysUser user); /** * 校验email是否唯一 @@ -88,121 +102,110 @@ public interface ISysUserService * @param user 用户信息 * @return 结果 */ - public String checkEmailUnique(SysUser user); + boolean checkEmailUnique(SysUser user); /** * 校验用户是否允许操作 - * + * * @param user 用户信息 */ - public void checkUserAllowed(SysUser user); + void checkUserAllowed(SysUser user); /** * 校验用户是否有数据权限 - * + * * @param userId 用户id */ - public void checkUserDataScope(Long userId); + void checkUserDataScope(Long userId); /** * 新增用户信息 - * + * * @param user 用户信息 * @return 结果 */ - public int insertUser(SysUser user); + int insertUser(SysUser user); /** * 注册用户信息 - * + * * @param user 用户信息 * @return 结果 */ - public boolean registerUser(SysUser user); + boolean registerUser(SysUser user); /** * 修改用户信息 - * + * * @param user 用户信息 * @return 结果 */ - public int updateUser(SysUser user); + int updateUser(SysUser user); /** * 用户授权角色 - * - * @param userId 用户ID + * + * @param userId 用户ID * @param roleIds 角色组 */ - public void insertUserAuth(Long userId, Long[] roleIds); + void insertUserAuth(Long userId, Long[] roleIds); /** * 修改用户状态 - * + * * @param user 用户信息 * @return 结果 */ - public int updateUserStatus(SysUser user); + int updateUserStatus(SysUser user); /** * 修改用户基本信息 - * + * * @param user 用户信息 * @return 结果 */ - public int updateUserProfile(SysUser user); + int updateUserProfile(SysUser user); /** * 修改用户头像 - * + * * @param userName 用户名 - * @param avatar 头像地址 + * @param avatar 头像地址 * @return 结果 */ - public boolean updateUserAvatar(String userName, String avatar); + boolean updateUserAvatar(String userName, String avatar); /** * 重置用户密码 - * + * * @param user 用户信息 * @return 结果 */ - public int resetPwd(SysUser user); + int resetPwd(SysUser user); /** * 重置用户密码 - * + * * @param userName 用户名 * @param password 密码 * @return 结果 */ - public int resetUserPwd(String userName, String password); + int resetUserPwd(String userName, String password); /** * 通过用户ID删除用户 - * + * * @param userId 用户ID * @return 结果 */ - public int deleteUserById(Long userId); + int deleteUserById(Long userId); /** * 批量删除用户信息 - * + * * @param userIds 需要删除的用户ID * @return 结果 */ - public int deleteUserByIds(Long[] userIds); + int deleteUserByIds(Long[] userIds); - /** - * 导入用户数据 - * - * @param userList 用户数据列表 - * @param isUpdateSupport 是否更新支持,如果已存在,则进行更新数据 - * @param userId 操作用户 - * @return 结果 - */ - public String importUser(List userList, Boolean isUpdateSupport, Long userId); - - SysUser selectUserByPhoneOrUserName(String phone); } diff --git a/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/service/SysLoginService.java b/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/service/SysLoginService.java new file mode 100644 index 0000000..57019da --- /dev/null +++ b/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/service/SysLoginService.java @@ -0,0 +1,334 @@ +package com.ruoyi.system.service; + +import cn.dev33.satoken.exception.NotLoginException; +import cn.dev33.satoken.secure.BCrypt; +import cn.dev33.satoken.stp.StpUtil; +import cn.hutool.core.bean.BeanUtil; +import cn.hutool.core.util.ObjectUtil; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.ruoyi.common.core.constant.CacheConstants; +import com.ruoyi.common.core.constant.Constants; +import com.ruoyi.common.core.domain.vo.RoleVO; +import com.ruoyi.common.core.domain.bo.LoginUser; +import com.ruoyi.common.core.domain.bo.XcxLoginUser; +import com.ruoyi.common.core.enums.DeviceType; +import com.ruoyi.common.core.enums.LoginType; +import com.ruoyi.common.core.enums.UserStatus; +import com.ruoyi.common.core.exception.user.CaptchaException; +import com.ruoyi.common.core.exception.user.CaptchaExpireException; +import com.ruoyi.common.core.exception.user.UserException; +import com.ruoyi.common.core.utils.*; +import com.ruoyi.common.log.event.LogininforEvent; +import com.ruoyi.common.redis.utils.RedisUtils; +import com.ruoyi.common.satoken.utils.LoginHelper; +import com.ruoyi.common.web.config.properties.CaptchaProperties; +import com.ruoyi.system.domain.entity.SysUser; +import com.ruoyi.system.mapper.SysUserMapper; +import lombok.RequiredArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.stereotype.Service; + +import java.time.Duration; +import java.util.List; +import java.util.function.Supplier; + +/** + * 登录校验方法 + * + * @author Lion Li + */ +@RequiredArgsConstructor +@Slf4j +@Service +public class SysLoginService { + + private final SysUserMapper userMapper; + private final CaptchaProperties captchaProperties; + private final SysPermissionService permissionService; + + @Value("${user.password.maxRetryCount}") + private Integer maxRetryCount; + + @Value("${user.password.lockTime}") + private Integer lockTime; + + /** + * 登录验证 + * + * @param username 用户名 + * @param password 密码 + * @param code 验证码 + * @param uuid 唯一标识 + * @return 结果 + */ + public String login(String username, String password, String code, String uuid) { + boolean captchaEnabled = captchaProperties.getEnable(); + // 验证码开关 + if (captchaEnabled) { + validateCaptcha(username, code, uuid); + } + // 框架登录不限制从什么表查询 只要最终构建出 LoginUser 即可 + SysUser user = loadUserByUsername(username); + checkLogin(LoginType.PASSWORD, username, () -> !BCrypt.checkpw(password, user.getPassword())); + // 此处可根据登录用户的数据不同 自行创建 loginUser 属性不够用继承扩展就行了 + LoginUser loginUser = buildLoginUser(user); + // 生成token + LoginHelper.loginByDevice(loginUser, DeviceType.PC); + + recordLogininfor(username, Constants.LOGIN_SUCCESS, MessageUtils.message("user.login.success")); + recordLoginInfo(user.getUserId(), username); + return StpUtil.getTokenValue(); + } + + public String smsLogin(String phonenumber, String smsCode) { + // 通过手机号查找用户 + SysUser user = loadUserByPhonenumber(phonenumber); + + checkLogin(LoginType.SMS, user.getUserName(), () -> !validateSmsCode(phonenumber, smsCode)); + // 此处可根据登录用户的数据不同 自行创建 loginUser 属性不够用继承扩展就行了 + LoginUser loginUser = buildLoginUser(user); + // 生成token + LoginHelper.loginByDevice(loginUser, DeviceType.APP); + + recordLogininfor(user.getUserName(), Constants.LOGIN_SUCCESS, MessageUtils.message("user.login.success")); + recordLoginInfo(user.getUserId(), user.getUserName()); + return StpUtil.getTokenValue(); + } + + public String emailLogin(String email, String emailCode) { + // 通过手邮箱查找用户 + SysUser user = loadUserByEmail(email); + + checkLogin(LoginType.EMAIL, user.getUserName(), () -> !validateEmailCode(email, emailCode)); + // 此处可根据登录用户的数据不同 自行创建 loginUser 属性不够用继承扩展就行了 + LoginUser loginUser = buildLoginUser(user); + // 生成token + LoginHelper.loginByDevice(loginUser, DeviceType.APP); + + recordLogininfor(user.getUserName(), Constants.LOGIN_SUCCESS, MessageUtils.message("user.login.success")); + recordLoginInfo(user.getUserId(), user.getUserName()); + return StpUtil.getTokenValue(); + } + + public String xcxLogin(String xcxCode) { + // xcxCode 为 小程序调用 wx.login 授权后获取 + // todo 以下自行实现 + // 校验 appid + appsrcret + xcxCode 调用登录凭证校验接口 获取 session_key 与 openid + String openid = ""; + + // 框架登录不限制从什么表查询 只要最终构建出 LoginUser 即可 + SysUser user = loadUserByOpenid(openid); + + // 此处可根据登录用户的数据不同 自行创建 loginUser 属性不够用继承扩展就行了 + XcxLoginUser loginUser = new XcxLoginUser(); + loginUser.setUserId(user.getUserId()); + loginUser.setUsername(user.getUserName()); + loginUser.setUserType(user.getUserType()); + loginUser.setOpenid(openid); + // 生成token + LoginHelper.loginByDevice(loginUser, DeviceType.XCX); + + recordLogininfor(user.getUserName(), Constants.LOGIN_SUCCESS, MessageUtils.message("user.login.success")); + recordLoginInfo(user.getUserId(), user.getUserName()); + return StpUtil.getTokenValue(); + } + + /** + * 退出登录 + */ + public void logout() { + try { + LoginUser loginUser = LoginHelper.getLoginUser(); + recordLogininfor(loginUser.getUsername(), Constants.LOGOUT, MessageUtils.message("user.logout.success")); + } catch (NotLoginException ignored) { + } finally { + try { + StpUtil.logout(); + } catch (NotLoginException ignored) { + } + } + } + + /** + * 记录登录信息 + * + * @param username 用户名 + * @param status 状态 + * @param message 消息内容 + */ + private void recordLogininfor(String username, String status, String message) { + LogininforEvent logininforEvent = new LogininforEvent(); + logininforEvent.setUsername(username); + logininforEvent.setStatus(status); + logininforEvent.setMessage(message); + logininforEvent.setRequest(ServletUtils.getRequest()); + SpringUtils.context().publishEvent(logininforEvent); + } + + /** + * 校验短信验证码 + */ + private boolean validateSmsCode(String phonenumber, String smsCode) { + String code = RedisUtils.getCacheObject(CacheConstants.CAPTCHA_CODE_KEY + phonenumber); + if (StringUtils.isBlank(code)) { + recordLogininfor(phonenumber, Constants.LOGIN_FAIL, MessageUtils.message("user.jcaptcha.expire")); + throw new CaptchaExpireException(); + } + return code.equals(smsCode); + } + + /** + * 校验邮箱验证码 + */ + private boolean validateEmailCode(String email, String emailCode) { + String code = RedisUtils.getCacheObject(CacheConstants.CAPTCHA_CODE_KEY + email); + if (StringUtils.isBlank(code)) { + recordLogininfor(email, Constants.LOGIN_FAIL, MessageUtils.message("user.jcaptcha.expire")); + throw new CaptchaExpireException(); + } + return code.equals(emailCode); + } + + /** + * 校验验证码 + * + * @param username 用户名 + * @param code 验证码 + * @param uuid 唯一标识 + */ + public void validateCaptcha(String username, String code, String uuid) { + String verifyKey = CacheConstants.CAPTCHA_CODE_KEY + StringUtils.defaultString(uuid, ""); + String captcha = RedisUtils.getCacheObject(verifyKey); + RedisUtils.deleteObject(verifyKey); + if (captcha == null) { + recordLogininfor(username, Constants.LOGIN_FAIL, MessageUtils.message("user.jcaptcha.expire")); + throw new CaptchaExpireException(); + } + if (!code.equalsIgnoreCase(captcha)) { + recordLogininfor(username, Constants.LOGIN_FAIL, MessageUtils.message("user.jcaptcha.error")); + throw new CaptchaException(); + } + } + + private SysUser loadUserByUsername(String username) { + SysUser user = userMapper.selectOne(new LambdaQueryWrapper() + .select(SysUser::getUserName, SysUser::getStatus) + .eq(SysUser::getUserName, username)); + if (ObjectUtil.isNull(user)) { + log.info("登录用户:{} 不存在.", username); + throw new UserException("user.not.exists", username); + } else if (UserStatus.DISABLE.getCode().equals(user.getStatus())) { + log.info("登录用户:{} 已被停用.", username); + throw new UserException("user.blocked", username); + } + return userMapper.selectUserByUserName(username); + } + + private SysUser loadUserByPhonenumber(String phonenumber) { + SysUser user = userMapper.selectOne(new LambdaQueryWrapper() + .select(SysUser::getPhonenumber, SysUser::getStatus) + .eq(SysUser::getPhonenumber, phonenumber)); + if (ObjectUtil.isNull(user)) { + log.info("登录用户:{} 不存在.", phonenumber); + throw new UserException("user.not.exists", phonenumber); + } else if (UserStatus.DISABLE.getCode().equals(user.getStatus())) { + log.info("登录用户:{} 已被停用.", phonenumber); + throw new UserException("user.blocked", phonenumber); + } + return userMapper.selectUserByPhonenumber(phonenumber); + } + + private SysUser loadUserByEmail(String email) { + SysUser user = userMapper.selectOne(new LambdaQueryWrapper() + .select(SysUser::getPhonenumber, SysUser::getStatus) + .eq(SysUser::getEmail, email)); + if (ObjectUtil.isNull(user)) { + log.info("登录用户:{} 不存在.", email); + throw new UserException("user.not.exists", email); + } else if (UserStatus.DISABLE.getCode().equals(user.getStatus())) { + log.info("登录用户:{} 已被停用.", email); + throw new UserException("user.blocked", email); + } + return userMapper.selectUserByEmail(email); + } + + private SysUser loadUserByOpenid(String openid) { + // 使用 openid 查询绑定用户 如未绑定用户 则根据业务自行处理 例如 创建默认用户 + // todo 自行实现 userService.selectUserByOpenid(openid); + SysUser user = new SysUser(); + if (ObjectUtil.isNull(user)) { + log.info("登录用户:{} 不存在.", openid); + // todo 用户不存在 业务逻辑自行实现 + } else if (UserStatus.DISABLE.getCode().equals(user.getStatus())) { + log.info("登录用户:{} 已被停用.", openid); + // todo 用户已被停用 业务逻辑自行实现 + } + return user; + } + + /** + * 构建登录用户 + */ + private LoginUser buildLoginUser(SysUser user) { + LoginUser loginUser = new LoginUser(); + loginUser.setUserId(user.getUserId()); + loginUser.setDeptId(user.getDeptId()); + loginUser.setUsername(user.getUserName()); + loginUser.setUserType(user.getUserType()); + loginUser.setMenuPermission(permissionService.getMenuPermission(user)); + loginUser.setRolePermission(permissionService.getRolePermission(user)); + loginUser.setDeptName(ObjectUtil.isNull(user.getDept()) ? "" : user.getDept().getDeptName()); + List roles = BeanUtil.copyToList(user.getRoles(), RoleVO.class); + loginUser.setRoles(roles); + return loginUser; + } + + /** + * 记录登录信息 + * + * @param userId 用户ID + */ + public void recordLoginInfo(Long userId, String username) { + SysUser sysUser = new SysUser(); + sysUser.setUserId(userId); + sysUser.setLoginIp(ServletUtils.getClientIP()); + sysUser.setLoginDate(DateUtils.getNowDate()); + sysUser.setUpdateBy(username); + userMapper.updateById(sysUser); + } + + /** + * 登录校验 + */ + private void checkLogin(LoginType loginType, String username, Supplier supplier) { + String errorKey = CacheConstants.PWD_ERR_CNT_KEY + username; + String loginFail = Constants.LOGIN_FAIL; + + // 获取用户登录错误次数,默认为0 (可自定义限制策略 例如: key + username + ip) + int errorNumber = ObjectUtil.defaultIfNull(RedisUtils.getCacheObject(errorKey), 0); + // 锁定时间内登录 则踢出 + if (errorNumber >= maxRetryCount) { + recordLogininfor(username, loginFail, MessageUtils.message(loginType.getRetryLimitExceed(), maxRetryCount, lockTime)); + throw new UserException(loginType.getRetryLimitExceed(), maxRetryCount, lockTime); + } + + if (supplier.get()) { + // 错误次数递增 + errorNumber++; + RedisUtils.setCacheObject(errorKey, errorNumber, Duration.ofMinutes(lockTime)); + // 达到规定错误次数 则锁定登录 + if (errorNumber >= maxRetryCount) { + recordLogininfor(username, loginFail, MessageUtils.message(loginType.getRetryLimitExceed(), maxRetryCount, lockTime)); + throw new UserException(loginType.getRetryLimitExceed(), maxRetryCount, lockTime); + } else { + // 未达到规定错误次数 + recordLogininfor(username, loginFail, MessageUtils.message(loginType.getRetryLimitCount(), errorNumber)); + throw new UserException(loginType.getRetryLimitCount(), errorNumber); + } + } + + // 登录成功 清空错误次数 + RedisUtils.deleteObject(errorKey); + } +} diff --git a/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/service/SysPermissionService.java b/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/service/SysPermissionService.java new file mode 100644 index 0000000..58f7c1c --- /dev/null +++ b/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/service/SysPermissionService.java @@ -0,0 +1,55 @@ +package com.ruoyi.system.service; + +import com.ruoyi.system.domain.entity.SysUser; +import lombok.RequiredArgsConstructor; +import org.springframework.stereotype.Service; + +import java.util.HashSet; +import java.util.Set; + +/** + * 用户权限处理 + * + * @author ruoyi + */ +@RequiredArgsConstructor +@Service +public class SysPermissionService { + + private final ISysRoleService roleService; + private final ISysMenuService menuService; + + /** + * 获取角色数据权限 + * + * @param user 用户信息 + * @return 角色权限信息 + */ + public Set getRolePermission(SysUser user) { + Set roles = new HashSet<>(); + // 管理员拥有所有权限 + if (user.isAdmin()) { + roles.add("admin"); + } else { + roles.addAll(roleService.selectRolePermissionByUserId(user.getUserId())); + } + return roles; + } + + /** + * 获取菜单数据权限 + * + * @param user 用户信息 + * @return 菜单权限信息 + */ + public Set getMenuPermission(SysUser user) { + Set perms = new HashSet<>(); + // 管理员拥有所有权限 + if (user.isAdmin()) { + perms.add("*:*:*"); + } else { + perms.addAll(menuService.selectMenuPermsByUserId(user.getUserId())); + } + return perms; + } +} diff --git a/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/service/SysRegisterService.java b/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/service/SysRegisterService.java new file mode 100644 index 0000000..ff9248d --- /dev/null +++ b/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/service/SysRegisterService.java @@ -0,0 +1,102 @@ +package com.ruoyi.system.service; + +import cn.dev33.satoken.secure.BCrypt; +import com.ruoyi.common.core.constant.CacheConstants; +import com.ruoyi.common.core.constant.Constants; +import com.ruoyi.common.core.domain.bo.RegisterBody; +import com.ruoyi.common.core.enums.UserType; +import com.ruoyi.common.core.exception.user.CaptchaException; +import com.ruoyi.common.core.exception.user.CaptchaExpireException; +import com.ruoyi.common.core.exception.user.UserException; +import com.ruoyi.common.core.utils.MessageUtils; +import com.ruoyi.common.core.utils.ServletUtils; +import com.ruoyi.common.core.utils.SpringUtils; +import com.ruoyi.common.core.utils.StringUtils; +import com.ruoyi.common.log.event.LogininforEvent; +import com.ruoyi.common.redis.utils.RedisUtils; +import com.ruoyi.common.web.config.properties.CaptchaProperties; +import com.ruoyi.system.domain.entity.SysUser; +import lombok.RequiredArgsConstructor; +import org.springframework.stereotype.Service; + +/** + * 注册校验方法 + * + * @author Lion Li + */ +@RequiredArgsConstructor +@Service +public class SysRegisterService { + + private final ISysUserService userService; + private final CaptchaProperties captchaProperties; + + /** + * 注册 + */ + public void register(RegisterBody registerBody) { + String username = registerBody.getUsername(); + String password = registerBody.getPassword(); + // 校验用户类型是否存在 + String userType = UserType.getUserType(registerBody.getUserType()).getUserType(); + + boolean captchaEnabled = captchaProperties.getEnable(); + // 验证码开关 + if (captchaEnabled) { + validateCaptcha(username, registerBody.getCode(), registerBody.getUuid()); + } + SysUser sysUser = new SysUser(); + sysUser.setUserName(username); + sysUser.setNickName(username); + sysUser.setPassword(BCrypt.hashpw(password)); + sysUser.setUserType(userType); + + if (!userService.checkUserNameUnique(sysUser)) { + throw new UserException("user.register.save.error", username); + } + boolean regFlag = userService.registerUser(sysUser); + if (!regFlag) { + throw new UserException("user.register.error"); + } + recordLogininfor(username, Constants.REGISTER, MessageUtils.message("user.register.success")); + } + + /** + * 校验验证码 + * + * @param username 用户名 + * @param code 验证码 + * @param uuid 唯一标识 + */ + public void validateCaptcha(String username, String code, String uuid) { + String verifyKey = CacheConstants.CAPTCHA_CODE_KEY + StringUtils.defaultString(uuid, ""); + String captcha = RedisUtils.getCacheObject(verifyKey); + RedisUtils.deleteObject(verifyKey); + if (captcha == null) { + recordLogininfor(username, Constants.REGISTER, MessageUtils.message("user.jcaptcha.expire")); + throw new CaptchaExpireException(); + } + if (!code.equalsIgnoreCase(captcha)) { + recordLogininfor(username, Constants.REGISTER, MessageUtils.message("user.jcaptcha.error")); + throw new CaptchaException(); + } + } + + /** + * 记录登录信息 + * + * @param username 用户名 + * @param status 状态 + * @param message 消息内容 + * @return + */ + private void recordLogininfor(String username, String status, String message) { + LogininforEvent logininforEvent = new LogininforEvent(); + logininforEvent.setUsername(username); + logininforEvent.setStatus(status); + logininforEvent.setMessage(message); + logininforEvent.setRequest(ServletUtils.getRequest()); + SpringUtils.context().publishEvent(logininforEvent); + } + +} diff --git a/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysConfigServiceImpl.java b/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysConfigServiceImpl.java new file mode 100644 index 0000000..e7d81c1 --- /dev/null +++ b/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysConfigServiceImpl.java @@ -0,0 +1,212 @@ +package com.ruoyi.system.service.impl; + +import cn.hutool.core.util.ObjectUtil; +import com.baomidou.dynamic.datasource.annotation.DS; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.ruoyi.common.core.constant.CacheNames; +import com.ruoyi.common.core.constant.UserConstants; +import com.rouyi.common.mybatis.core.page.PageQuery; +import com.rouyi.common.mybatis.core.page.TableDataInfo; +import com.ruoyi.common.core.service.ConfigService; +import com.ruoyi.common.core.exception.ServiceException; +import com.ruoyi.common.core.utils.StringUtils; +import com.ruoyi.common.redis.utils.CacheUtils; +import com.ruoyi.common.core.utils.SpringUtils; +import com.ruoyi.system.domain.entity.SysConfig; +import com.ruoyi.system.mapper.SysConfigMapper; +import com.ruoyi.system.service.ISysConfigService; +import lombok.RequiredArgsConstructor; +import org.springframework.cache.annotation.CachePut; +import org.springframework.cache.annotation.Cacheable; +import org.springframework.stereotype.Service; + +import java.util.Arrays; +import java.util.List; +import java.util.Map; + +/** + * 参数配置 服务层实现 + * + * @author Lion Li + */ +@RequiredArgsConstructor +@Service +public class SysConfigServiceImpl implements ISysConfigService, ConfigService { + + private final SysConfigMapper baseMapper; + + @Override + public TableDataInfo selectPageConfigList(SysConfig config, PageQuery pageQuery) { + Map params = config.getParams(); + LambdaQueryWrapper lqw = new LambdaQueryWrapper() + .like(StringUtils.isNotBlank(config.getConfigName()), SysConfig::getConfigName, config.getConfigName()) + .eq(StringUtils.isNotBlank(config.getConfigType()), SysConfig::getConfigType, config.getConfigType()) + .like(StringUtils.isNotBlank(config.getConfigKey()), SysConfig::getConfigKey, config.getConfigKey()) + .between(params.get("beginTime") != null && params.get("endTime") != null, + SysConfig::getCreateTime, params.get("beginTime"), params.get("endTime")); + Page page = baseMapper.selectPage(pageQuery.build(), lqw); + return TableDataInfo.build(page); + } + + /** + * 查询参数配置信息 + * + * @param configId 参数配置ID + * @return 参数配置信息 + */ + @Override + @DS("master") + public SysConfig selectConfigById(Long configId) { + return baseMapper.selectById(configId); + } + + /** + * 根据键名查询参数配置信息 + * + * @param configKey 参数key + * @return 参数键值 + */ + @Cacheable(cacheNames = CacheNames.SYS_CONFIG, key = "#configKey") + @Override + public String selectConfigByKey(String configKey) { + SysConfig retConfig = baseMapper.selectOne(new LambdaQueryWrapper() + .eq(SysConfig::getConfigKey, configKey)); + if (ObjectUtil.isNotNull(retConfig)) { + return retConfig.getConfigValue(); + } + return StringUtils.EMPTY; + } + + /** + * 查询参数配置列表 + * + * @param config 参数配置信息 + * @return 参数配置集合 + */ + @Override + public List selectConfigList(SysConfig config) { + Map params = config.getParams(); + LambdaQueryWrapper lqw = new LambdaQueryWrapper() + .like(StringUtils.isNotBlank(config.getConfigName()), SysConfig::getConfigName, config.getConfigName()) + .eq(StringUtils.isNotBlank(config.getConfigType()), SysConfig::getConfigType, config.getConfigType()) + .like(StringUtils.isNotBlank(config.getConfigKey()), SysConfig::getConfigKey, config.getConfigKey()) + .between(params.get("beginTime") != null && params.get("endTime") != null, + SysConfig::getCreateTime, params.get("beginTime"), params.get("endTime")); + return baseMapper.selectList(lqw); + } + + /** + * 新增参数配置 + * + * @param config 参数配置信息 + * @return 结果 + */ + @CachePut(cacheNames = CacheNames.SYS_CONFIG, key = "#config.configKey") + @Override + public String insertConfig(SysConfig config) { + int row = baseMapper.insert(config); + if (row > 0) { + return config.getConfigValue(); + } + throw new ServiceException("操作失败"); + } + + /** + * 修改参数配置 + * + * @param config 参数配置信息 + * @return 结果 + */ + @CachePut(cacheNames = CacheNames.SYS_CONFIG, key = "#config.configKey") + @Override + public String updateConfig(SysConfig config) { + int row = 0; + if (config.getConfigId() != null) { + SysConfig temp = baseMapper.selectById(config.getConfigId()); + if (!StringUtils.equals(temp.getConfigKey(), config.getConfigKey())) { + CacheUtils.evict(CacheNames.SYS_CONFIG, temp.getConfigKey()); + } + row = baseMapper.updateById(config); + } else { + row = baseMapper.update(config, new LambdaQueryWrapper() + .eq(SysConfig::getConfigKey, config.getConfigKey())); + } + if (row > 0) { + return config.getConfigValue(); + } + throw new ServiceException("操作失败"); + } + + /** + * 批量删除参数信息 + * + * @param configIds 需要删除的参数ID + */ + @Override + public void deleteConfigByIds(Long[] configIds) { + for (Long configId : configIds) { + SysConfig config = selectConfigById(configId); + if (StringUtils.equals(UserConstants.YES, config.getConfigType())) { + throw new ServiceException(String.format("内置参数【%1$s】不能删除 ", config.getConfigKey())); + } + CacheUtils.evict(CacheNames.SYS_CONFIG, config.getConfigKey()); + } + baseMapper.deleteBatchIds(Arrays.asList(configIds)); + } + + /** + * 加载参数缓存数据 + */ + @Override + public void loadingConfigCache() { + List configsList = selectConfigList(new SysConfig()); + configsList.forEach(config -> + CacheUtils.put(CacheNames.SYS_CONFIG, config.getConfigKey(), config.getConfigValue())); + } + + /** + * 清空参数缓存数据 + */ + @Override + public void clearConfigCache() { + CacheUtils.clear(CacheNames.SYS_CONFIG); + } + + /** + * 重置参数缓存数据 + */ + @Override + public void resetConfigCache() { + clearConfigCache(); + loadingConfigCache(); + } + + /** + * 校验参数键名是否唯一 + * + * @param config 参数配置信息 + * @return 结果 + */ + @Override + public boolean checkConfigKeyUnique(SysConfig config) { + long configId = ObjectUtil.isNull(config.getConfigId()) ? -1L : config.getConfigId(); + SysConfig info = baseMapper.selectOne(new LambdaQueryWrapper().eq(SysConfig::getConfigKey, config.getConfigKey())); + if (ObjectUtil.isNotNull(info) && info.getConfigId() != configId) { + return false; + } + return true; + } + + /** + * 根据参数 key 获取参数值 + * + * @param configKey 参数 key + * @return 参数值 + */ + @Override + public String getConfigValue(String configKey) { + return SpringUtils.getAopProxy(this).selectConfigByKey(configKey); + } + +} diff --git a/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysDataScopeServiceImpl.java b/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysDataScopeServiceImpl.java new file mode 100644 index 0000000..5ea1238 --- /dev/null +++ b/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysDataScopeServiceImpl.java @@ -0,0 +1,58 @@ +package com.ruoyi.system.service.impl; + +import cn.hutool.core.collection.CollUtil; +import cn.hutool.core.convert.Convert; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.rouyi.common.mybatis.helper.DataBaseHelper; +import com.ruoyi.common.core.utils.StreamUtils; +import com.ruoyi.system.domain.entity.SysDept; +import com.ruoyi.system.domain.entity.SysRoleDept; +import com.ruoyi.system.mapper.SysDeptMapper; +import com.ruoyi.system.mapper.SysRoleDeptMapper; +import com.ruoyi.system.service.ISysDataScopeService; +import lombok.RequiredArgsConstructor; +import org.springframework.stereotype.Service; + +import java.util.List; + +/** + * 数据权限 实现 + *

+ * 注意: 此Service内不允许调用标注`数据权限`注解的方法 + * 例如: deptMapper.selectList 此 selectList 方法标注了`数据权限`注解 会出现循环解析的问题 + * + * @author Lion Li + */ +@RequiredArgsConstructor +@Service("sdss") +public class SysDataScopeServiceImpl implements ISysDataScopeService { + + private final SysRoleDeptMapper roleDeptMapper; + private final SysDeptMapper deptMapper; + + @Override + public String getRoleCustom(Long roleId) { + List list = roleDeptMapper.selectList( + new LambdaQueryWrapper() + .select(SysRoleDept::getDeptId) + .eq(SysRoleDept::getRoleId, roleId)); + if (CollUtil.isNotEmpty(list)) { + return StreamUtils.join(list, rd -> Convert.toStr(rd.getDeptId())); + } + return null; + } + + @Override + public String getDeptAndChild(Long deptId) { + List deptList = deptMapper.selectList(new LambdaQueryWrapper() + .select(SysDept::getDeptId) + .apply(DataBaseHelper.findInSet(deptId, "ancestors"))); + List ids = StreamUtils.toList(deptList, SysDept::getDeptId); + ids.add(deptId); + if (CollUtil.isNotEmpty(ids)) { + return StreamUtils.join(ids, Convert::toStr); + } + return null; + } + +} diff --git a/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysDeptServiceImpl.java b/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysDeptServiceImpl.java new file mode 100644 index 0000000..c62947a --- /dev/null +++ b/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysDeptServiceImpl.java @@ -0,0 +1,309 @@ +package com.ruoyi.system.service.impl; + +import cn.hutool.core.collection.CollUtil; +import cn.hutool.core.convert.Convert; +import cn.hutool.core.lang.tree.Tree; +import cn.hutool.core.util.ObjectUtil; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; +import com.ruoyi.common.core.constant.CacheNames; +import com.ruoyi.common.core.constant.UserConstants; +import com.ruoyi.system.domain.entity.SysDept; +import com.ruoyi.system.domain.entity.SysRole; +import com.ruoyi.system.domain.entity.SysUser; +import com.ruoyi.common.core.service.DeptService; +import com.ruoyi.common.core.exception.ServiceException; +import com.rouyi.common.mybatis.helper.DataBaseHelper; +import com.ruoyi.common.satoken.utils.LoginHelper; +import com.ruoyi.common.core.utils.StringUtils; +import com.ruoyi.common.core.utils.TreeBuildUtils; +import com.ruoyi.common.redis.utils.CacheUtils; +import com.ruoyi.common.core.utils.SpringUtils; +import com.ruoyi.system.mapper.SysDeptMapper; +import com.ruoyi.system.mapper.SysRoleMapper; +import com.ruoyi.system.mapper.SysUserMapper; +import com.ruoyi.system.service.ISysDeptService; +import lombok.RequiredArgsConstructor; +import org.springframework.cache.annotation.CacheEvict; +import org.springframework.cache.annotation.Cacheable; +import org.springframework.stereotype.Service; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; + +/** + * 部门管理 服务实现 + * + * @author Lion Li + */ +@RequiredArgsConstructor +@Service +public class SysDeptServiceImpl implements ISysDeptService, DeptService { + + private final SysDeptMapper baseMapper; + private final SysRoleMapper roleMapper; + private final SysUserMapper userMapper; + + /** + * 查询部门管理数据 + * + * @param dept 部门信息 + * @return 部门信息集合 + */ + @Override + public List selectDeptList(SysDept dept) { + LambdaQueryWrapper lqw = new LambdaQueryWrapper<>(); + lqw.eq(SysDept::getDelFlag, "0") + .eq(ObjectUtil.isNotNull(dept.getDeptId()), SysDept::getDeptId, dept.getDeptId()) + .eq(ObjectUtil.isNotNull(dept.getParentId()), SysDept::getParentId, dept.getParentId()) + .like(StringUtils.isNotBlank(dept.getDeptName()), SysDept::getDeptName, dept.getDeptName()) + .eq(StringUtils.isNotBlank(dept.getStatus()), SysDept::getStatus, dept.getStatus()) + .orderByAsc(SysDept::getParentId) + .orderByAsc(SysDept::getOrderNum); + return baseMapper.selectDeptList(lqw); + } + + /** + * 查询部门树结构信息 + * + * @param dept 部门信息 + * @return 部门树信息集合 + */ + @Override + public List> selectDeptTreeList(SysDept dept) { + // 只查询未禁用部门 + dept.setStatus(UserConstants.DEPT_NORMAL); + List depts = this.selectDeptList(dept); + return buildDeptTreeSelect(depts); + } + + /** + * 构建前端所需要下拉树结构 + * + * @param depts 部门列表 + * @return 下拉树结构列表 + */ + @Override + public List> buildDeptTreeSelect(List depts) { + if (CollUtil.isEmpty(depts)) { + return CollUtil.newArrayList(); + } + return TreeBuildUtils.build(depts, (dept, tree) -> + tree.setId(dept.getDeptId()) + .setParentId(dept.getParentId()) + .setName(dept.getDeptName()) + .setWeight(dept.getOrderNum())); + } + + /** + * 根据角色ID查询部门树信息 + * + * @param roleId 角色ID + * @return 选中部门列表 + */ + @Override + public List selectDeptListByRoleId(Long roleId) { + SysRole role = roleMapper.selectById(roleId); + return baseMapper.selectDeptListByRoleId(roleId, role.getDeptCheckStrictly()); + } + + /** + * 根据部门ID查询信息 + * + * @param deptId 部门ID + * @return 部门信息 + */ + @Cacheable(cacheNames = CacheNames.SYS_DEPT, key = "#deptId") + @Override + public SysDept selectDeptById(Long deptId) { + SysDept dept = baseMapper.selectById(deptId); + if (ObjectUtil.isNull(dept)) { + return null; + } + SysDept parentDept = baseMapper.selectOne(new LambdaQueryWrapper() + .select(SysDept::getDeptName).eq(SysDept::getDeptId, dept.getParentId())); + dept.setParentName(ObjectUtil.isNotNull(parentDept) ? parentDept.getDeptName() : null); + return dept; + } + + /** + * 通过部门ID查询部门名称 + * + * @param deptIds 部门ID串逗号分隔 + * @return 部门名称串逗号分隔 + */ + @Override + public String selectDeptNameByIds(String deptIds) { + List list = new ArrayList<>(); + for (Long id : StringUtils.splitTo(deptIds, Convert::toLong)) { + SysDept dept = SpringUtils.getAopProxy(this).selectDeptById(id); + if (ObjectUtil.isNotNull(dept)) { + list.add(dept.getDeptName()); + } + } + return String.join(StringUtils.SEPARATOR, list); + } + + /** + * 根据ID查询所有子部门数(正常状态) + * + * @param deptId 部门ID + * @return 子部门数 + */ + @Override + public long selectNormalChildrenDeptById(Long deptId) { + return baseMapper.selectCount(new LambdaQueryWrapper() + .eq(SysDept::getStatus, UserConstants.DEPT_NORMAL) + .apply(DataBaseHelper.findInSet(deptId, "ancestors"))); + } + + /** + * 是否存在子节点 + * + * @param deptId 部门ID + * @return 结果 + */ + @Override + public boolean hasChildByDeptId(Long deptId) { + return baseMapper.exists(new LambdaQueryWrapper() + .eq(SysDept::getParentId, deptId)); + } + + /** + * 查询部门是否存在用户 + * + * @param deptId 部门ID + * @return 结果 true 存在 false 不存在 + */ + @Override + public boolean checkDeptExistUser(Long deptId) { + return userMapper.exists(new LambdaQueryWrapper() + .eq(SysUser::getDeptId, deptId)); + } + + /** + * 校验部门名称是否唯一 + * + * @param dept 部门信息 + * @return 结果 + */ + @Override + public boolean checkDeptNameUnique(SysDept dept) { + boolean exist = baseMapper.exists(new LambdaQueryWrapper() + .eq(SysDept::getDeptName, dept.getDeptName()) + .eq(SysDept::getParentId, dept.getParentId()) + .ne(ObjectUtil.isNotNull(dept.getDeptId()), SysDept::getDeptId, dept.getDeptId())); + return !exist; + } + + /** + * 校验部门是否有数据权限 + * + * @param deptId 部门id + */ + @Override + public void checkDeptDataScope(Long deptId) { + if (!LoginHelper.isAdmin()) { + SysDept dept = new SysDept(); + dept.setDeptId(deptId); + List depts = this.selectDeptList(dept); + if (CollUtil.isEmpty(depts)) { + throw new ServiceException("没有权限访问部门数据!"); + } + } + } + + /** + * 新增保存部门信息 + * + * @param dept 部门信息 + * @return 结果 + */ + @Override + public int insertDept(SysDept dept) { + SysDept info = baseMapper.selectById(dept.getParentId()); + // 如果父节点不为正常状态,则不允许新增子节点 + if (!UserConstants.DEPT_NORMAL.equals(info.getStatus())) { + throw new ServiceException("部门停用,不允许新增"); + } + dept.setAncestors(info.getAncestors() + StringUtils.SEPARATOR + dept.getParentId()); + return baseMapper.insert(dept); + } + + /** + * 修改保存部门信息 + * + * @param dept 部门信息 + * @return 结果 + */ + @CacheEvict(cacheNames = CacheNames.SYS_DEPT, key = "#dept.deptId") + @Override + public int updateDept(SysDept dept) { + SysDept newParentDept = baseMapper.selectById(dept.getParentId()); + SysDept oldDept = baseMapper.selectById(dept.getDeptId()); + if (ObjectUtil.isNotNull(newParentDept) && ObjectUtil.isNotNull(oldDept)) { + String newAncestors = newParentDept.getAncestors() + StringUtils.SEPARATOR + newParentDept.getDeptId(); + String oldAncestors = oldDept.getAncestors(); + dept.setAncestors(newAncestors); + updateDeptChildren(dept.getDeptId(), newAncestors, oldAncestors); + } + int result = baseMapper.updateById(dept); + if (UserConstants.DEPT_NORMAL.equals(dept.getStatus()) && StringUtils.isNotEmpty(dept.getAncestors()) + && !StringUtils.equals(UserConstants.DEPT_NORMAL, dept.getAncestors())) { + // 如果该部门是启用状态,则启用该部门的所有上级部门 + updateParentDeptStatusNormal(dept); + } + return result; + } + + /** + * 修改该部门的父级部门状态 + * + * @param dept 当前部门 + */ + private void updateParentDeptStatusNormal(SysDept dept) { + String ancestors = dept.getAncestors(); + Long[] deptIds = Convert.toLongArray(ancestors); + baseMapper.update(null, new LambdaUpdateWrapper() + .set(SysDept::getStatus, UserConstants.DEPT_NORMAL) + .in(SysDept::getDeptId, Arrays.asList(deptIds))); + } + + /** + * 修改子元素关系 + * + * @param deptId 被修改的部门ID + * @param newAncestors 新的父ID集合 + * @param oldAncestors 旧的父ID集合 + */ + public void updateDeptChildren(Long deptId, String newAncestors, String oldAncestors) { + List children = baseMapper.selectList(new LambdaQueryWrapper() + .apply(DataBaseHelper.findInSet(deptId, "ancestors"))); + List list = new ArrayList<>(); + for (SysDept child : children) { + SysDept dept = new SysDept(); + dept.setDeptId(child.getDeptId()); + dept.setAncestors(child.getAncestors().replaceFirst(oldAncestors, newAncestors)); + list.add(dept); + } + if (CollUtil.isNotEmpty(list)) { + if (baseMapper.updateBatchById(list)) { + list.forEach(dept -> CacheUtils.evict(CacheNames.SYS_DEPT, dept.getDeptId())); + } + } + } + + /** + * 删除部门管理信息 + * + * @param deptId 部门ID + * @return 结果 + */ + @CacheEvict(cacheNames = CacheNames.SYS_DEPT, key = "#deptId") + @Override + public int deleteDeptById(Long deptId) { + return baseMapper.deleteById(deptId); + } + +} diff --git a/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysDictDataServiceImpl.java b/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysDictDataServiceImpl.java new file mode 100644 index 0000000..4e9f41f --- /dev/null +++ b/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysDictDataServiceImpl.java @@ -0,0 +1,130 @@ +package com.ruoyi.system.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.ruoyi.common.core.constant.CacheNames; +import com.rouyi.common.mybatis.core.page.PageQuery; +import com.ruoyi.system.domain.entity.SysDictData; +import com.rouyi.common.mybatis.core.page.TableDataInfo; +import com.ruoyi.common.core.exception.ServiceException; +import com.ruoyi.common.core.utils.StringUtils; +import com.ruoyi.common.redis.utils.CacheUtils; +import com.ruoyi.system.mapper.SysDictDataMapper; +import com.ruoyi.system.service.ISysDictDataService; +import lombok.RequiredArgsConstructor; +import org.springframework.cache.annotation.CachePut; +import org.springframework.stereotype.Service; + +import java.util.List; + +/** + * 字典 业务层处理 + * + * @author Lion Li + */ +@RequiredArgsConstructor +@Service +public class SysDictDataServiceImpl implements ISysDictDataService { + + private final SysDictDataMapper baseMapper; + + @Override + public TableDataInfo selectPageDictDataList(SysDictData dictData, PageQuery pageQuery) { + LambdaQueryWrapper lqw = new LambdaQueryWrapper() + .eq(StringUtils.isNotBlank(dictData.getDictType()), SysDictData::getDictType, dictData.getDictType()) + .like(StringUtils.isNotBlank(dictData.getDictLabel()), SysDictData::getDictLabel, dictData.getDictLabel()) + .eq(StringUtils.isNotBlank(dictData.getStatus()), SysDictData::getStatus, dictData.getStatus()) + .orderByAsc(SysDictData::getDictSort); + Page page = baseMapper.selectPage(pageQuery.build(), lqw); + return TableDataInfo.build(page); + } + + /** + * 根据条件分页查询字典数据 + * + * @param dictData 字典数据信息 + * @return 字典数据集合信息 + */ + @Override + public List selectDictDataList(SysDictData dictData) { + return baseMapper.selectList(new LambdaQueryWrapper() + .eq(StringUtils.isNotBlank(dictData.getDictType()), SysDictData::getDictType, dictData.getDictType()) + .like(StringUtils.isNotBlank(dictData.getDictLabel()), SysDictData::getDictLabel, dictData.getDictLabel()) + .eq(StringUtils.isNotBlank(dictData.getStatus()), SysDictData::getStatus, dictData.getStatus()) + .orderByAsc(SysDictData::getDictSort)); + } + + /** + * 根据字典类型和字典键值查询字典数据信息 + * + * @param dictType 字典类型 + * @param dictValue 字典键值 + * @return 字典标签 + */ + @Override + public String selectDictLabel(String dictType, String dictValue) { + return baseMapper.selectOne(new LambdaQueryWrapper() + .select(SysDictData::getDictLabel) + .eq(SysDictData::getDictType, dictType) + .eq(SysDictData::getDictValue, dictValue)) + .getDictLabel(); + } + + /** + * 根据字典数据ID查询信息 + * + * @param dictCode 字典数据ID + * @return 字典数据 + */ + @Override + public SysDictData selectDictDataById(Long dictCode) { + return baseMapper.selectById(dictCode); + } + + /** + * 批量删除字典数据信息 + * + * @param dictCodes 需要删除的字典数据ID + */ + @Override + public void deleteDictDataByIds(Long[] dictCodes) { + for (Long dictCode : dictCodes) { + SysDictData data = selectDictDataById(dictCode); + baseMapper.deleteById(dictCode); + CacheUtils.evict(CacheNames.SYS_DICT, data.getDictType()); + } + } + + /** + * 新增保存字典数据信息 + * + * @param data 字典数据信息 + * @return 结果 + */ + @CachePut(cacheNames = CacheNames.SYS_DICT, key = "#data.dictType") + @Override + public List insertDictData(SysDictData data) { + int row = baseMapper.insert(data); + if (row > 0) { + return baseMapper.selectDictDataByType(data.getDictType()); + } + throw new ServiceException("操作失败"); + } + + /** + * 修改保存字典数据信息 + * + * @param data 字典数据信息 + * @return 结果 + */ + @CachePut(cacheNames = CacheNames.SYS_DICT, key = "#data.dictType") + @Override + public List updateDictData(SysDictData data) { + int row = baseMapper.updateById(data); + if (row > 0) { + return baseMapper.selectDictDataByType(data.getDictType()); + } + throw new ServiceException("操作失败"); + } + +} diff --git a/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysDictTypeServiceImpl.java b/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysDictTypeServiceImpl.java new file mode 100644 index 0000000..a1ee332 --- /dev/null +++ b/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysDictTypeServiceImpl.java @@ -0,0 +1,287 @@ +package com.ruoyi.system.service.impl; + +import cn.dev33.satoken.context.SaHolder; +import cn.hutool.core.collection.CollUtil; +import cn.hutool.core.util.ObjectUtil; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.ruoyi.common.core.constant.CacheConstants; +import com.ruoyi.common.core.constant.CacheNames; +import com.ruoyi.common.core.constant.UserConstants; +import com.rouyi.common.mybatis.core.page.PageQuery; +import com.ruoyi.system.domain.entity.SysDictData; +import com.ruoyi.system.domain.entity.SysDictType; +import com.rouyi.common.mybatis.core.page.TableDataInfo; +import com.ruoyi.common.core.service.DictService; +import com.ruoyi.common.core.exception.ServiceException; +import com.ruoyi.common.core.utils.StreamUtils; +import com.ruoyi.common.core.utils.StringUtils; +import com.ruoyi.common.redis.utils.CacheUtils; +import com.ruoyi.common.core.utils.SpringUtils; +import com.ruoyi.system.mapper.SysDictDataMapper; +import com.ruoyi.system.mapper.SysDictTypeMapper; +import com.ruoyi.system.service.ISysDictTypeService; +import lombok.RequiredArgsConstructor; +import org.springframework.cache.annotation.CachePut; +import org.springframework.cache.annotation.Cacheable; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.*; +import java.util.stream.Collectors; + +/** + * 字典 业务层处理 + * + * @author Lion Li + */ +@RequiredArgsConstructor +@Service +public class SysDictTypeServiceImpl implements ISysDictTypeService, DictService { + + private final SysDictTypeMapper baseMapper; + private final SysDictDataMapper dictDataMapper; + + @Override + public TableDataInfo selectPageDictTypeList(SysDictType dictType, PageQuery pageQuery) { + Map params = dictType.getParams(); + LambdaQueryWrapper lqw = new LambdaQueryWrapper() + .like(StringUtils.isNotBlank(dictType.getDictName()), SysDictType::getDictName, dictType.getDictName()) + .eq(StringUtils.isNotBlank(dictType.getStatus()), SysDictType::getStatus, dictType.getStatus()) + .like(StringUtils.isNotBlank(dictType.getDictType()), SysDictType::getDictType, dictType.getDictType()) + .between(params.get("beginTime") != null && params.get("endTime") != null, + SysDictType::getCreateTime, params.get("beginTime"), params.get("endTime")); + Page page = baseMapper.selectPage(pageQuery.build(), lqw); + return TableDataInfo.build(page); + } + + /** + * 根据条件分页查询字典类型 + * + * @param dictType 字典类型信息 + * @return 字典类型集合信息 + */ + @Override + public List selectDictTypeList(SysDictType dictType) { + Map params = dictType.getParams(); + return baseMapper.selectList(new LambdaQueryWrapper() + .like(StringUtils.isNotBlank(dictType.getDictName()), SysDictType::getDictName, dictType.getDictName()) + .eq(StringUtils.isNotBlank(dictType.getStatus()), SysDictType::getStatus, dictType.getStatus()) + .like(StringUtils.isNotBlank(dictType.getDictType()), SysDictType::getDictType, dictType.getDictType()) + .between(params.get("beginTime") != null && params.get("endTime") != null, + SysDictType::getCreateTime, params.get("beginTime"), params.get("endTime"))); + } + + /** + * 根据所有字典类型 + * + * @return 字典类型集合信息 + */ + @Override + public List selectDictTypeAll() { + return baseMapper.selectList(); + } + + /** + * 根据字典类型查询字典数据 + * + * @param dictType 字典类型 + * @return 字典数据集合信息 + */ + @Cacheable(cacheNames = CacheNames.SYS_DICT, key = "#dictType") + @Override + public List selectDictDataByType(String dictType) { + List dictDatas = dictDataMapper.selectDictDataByType(dictType); + if (CollUtil.isNotEmpty(dictDatas)) { + return dictDatas; + } + return null; + } + + /** + * 根据字典类型ID查询信息 + * + * @param dictId 字典类型ID + * @return 字典类型 + */ + @Override + public SysDictType selectDictTypeById(Long dictId) { + return baseMapper.selectById(dictId); + } + + /** + * 根据字典类型查询信息 + * + * @param dictType 字典类型 + * @return 字典类型 + */ + @Override + public SysDictType selectDictTypeByType(String dictType) { + return baseMapper.selectVoOne(new LambdaQueryWrapper().eq(SysDictType::getDictType, dictType)); + } + + /** + * 批量删除字典类型信息 + * + * @param dictIds 需要删除的字典ID + */ + @Override + public void deleteDictTypeByIds(Long[] dictIds) { + for (Long dictId : dictIds) { + SysDictType dictType = selectDictTypeById(dictId); + if (dictDataMapper.exists(new LambdaQueryWrapper() + .eq(SysDictData::getDictType, dictType.getDictType()))) { + throw new ServiceException(String.format("%1$s已分配,不能删除", dictType.getDictName())); + } + CacheUtils.evict(CacheNames.SYS_DICT, dictType.getDictType()); + } + baseMapper.deleteBatchIds(Arrays.asList(dictIds)); + } + + /** + * 加载字典缓存数据 + */ + @Override + public void loadingDictCache() { + List dictDataList = dictDataMapper.selectList( + new LambdaQueryWrapper().eq(SysDictData::getStatus, UserConstants.DICT_NORMAL)); + Map> dictDataMap = StreamUtils.groupByKey(dictDataList, SysDictData::getDictType); + dictDataMap.forEach((k, v) -> { + List dictList = StreamUtils.sorted(v, Comparator.comparing(SysDictData::getDictSort)); + CacheUtils.put(CacheNames.SYS_DICT, k, dictList); + }); + } + + /** + * 清空字典缓存数据 + */ + @Override + public void clearDictCache() { + CacheUtils.clear(CacheNames.SYS_DICT); + } + + /** + * 重置字典缓存数据 + */ + @Override + public void resetDictCache() { + clearDictCache(); + loadingDictCache(); + } + + /** + * 新增保存字典类型信息 + * + * @param dict 字典类型信息 + * @return 结果 + */ + @CachePut(cacheNames = CacheNames.SYS_DICT, key = "#dict.dictType") + @Override + public List insertDictType(SysDictType dict) { + int row = baseMapper.insert(dict); + if (row > 0) { + // 新增 type 下无 data 数据 返回空防止缓存穿透 + return new ArrayList<>(); + } + throw new ServiceException("操作失败"); + } + + /** + * 修改保存字典类型信息 + * + * @param dict 字典类型信息 + * @return 结果 + */ + @CachePut(cacheNames = CacheNames.SYS_DICT, key = "#dict.dictType") + @Override + @Transactional(rollbackFor = Exception.class) + public List updateDictType(SysDictType dict) { + SysDictType oldDict = baseMapper.selectById(dict.getDictId()); + dictDataMapper.update(null, new LambdaUpdateWrapper() + .set(SysDictData::getDictType, dict.getDictType()) + .eq(SysDictData::getDictType, oldDict.getDictType())); + int row = baseMapper.updateById(dict); + if (row > 0) { + CacheUtils.evict(CacheNames.SYS_DICT, oldDict.getDictType()); + return dictDataMapper.selectDictDataByType(dict.getDictType()); + } + throw new ServiceException("操作失败"); + } + + /** + * 校验字典类型称是否唯一 + * + * @param dict 字典类型 + * @return 结果 + */ + @Override + public boolean checkDictTypeUnique(SysDictType dict) { + boolean exist = baseMapper.exists(new LambdaQueryWrapper() + .eq(SysDictType::getDictType, dict.getDictType()) + .ne(ObjectUtil.isNotNull(dict.getDictId()), SysDictType::getDictId, dict.getDictId())); + return !exist; + } + + /** + * 根据字典类型和字典值获取字典标签 + * + * @param dictType 字典类型 + * @param dictValue 字典值 + * @param separator 分隔符 + * @return 字典标签 + */ + @SuppressWarnings("unchecked cast") + @Override + public String getDictLabel(String dictType, String dictValue, String separator) { + // 优先从本地缓存获取 + List datas = (List) SaHolder.getStorage().get(CacheConstants.SYS_DICT_KEY + dictType); + if (ObjectUtil.isNull(datas)) { + datas = SpringUtils.getAopProxy(this).selectDictDataByType(dictType); + SaHolder.getStorage().set(CacheConstants.SYS_DICT_KEY + dictType, datas); + } + + Map map = StreamUtils.toMap(datas, SysDictData::getDictValue, SysDictData::getDictLabel); + if (StringUtils.containsAny(dictValue, separator)) { + return Arrays.stream(dictValue.split(separator)) + .map(v -> map.getOrDefault(v, StringUtils.EMPTY)) + .collect(Collectors.joining(separator)); + } else { + return map.getOrDefault(dictValue, StringUtils.EMPTY); + } + } + + /** + * 根据字典类型和字典标签获取字典值 + * + * @param dictType 字典类型 + * @param dictLabel 字典标签 + * @param separator 分隔符 + * @return 字典值 + */ + @SuppressWarnings("unchecked cast") + @Override + public String getDictValue(String dictType, String dictLabel, String separator) { + // 优先从本地缓存获取 + List datas = (List) SaHolder.getStorage().get(CacheConstants.SYS_DICT_KEY + dictType); + if (ObjectUtil.isNull(datas)) { + datas = SpringUtils.getAopProxy(this).selectDictDataByType(dictType); + SaHolder.getStorage().set(CacheConstants.SYS_DICT_KEY + dictType, datas); + } + + Map map = StreamUtils.toMap(datas, SysDictData::getDictLabel, SysDictData::getDictValue); + if (StringUtils.containsAny(dictLabel, separator)) { + return Arrays.stream(dictLabel.split(separator)) + .map(l -> map.getOrDefault(l, StringUtils.EMPTY)) + .collect(Collectors.joining(separator)); + } else { + return map.getOrDefault(dictLabel, StringUtils.EMPTY); + } + } + + @Override + public Map getAllDictByDictType(String dictType) { + List list = selectDictDataByType(dictType); + return StreamUtils.toMap(list, SysDictData::getDictValue, SysDictData::getDictLabel); + } +} diff --git a/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysLogininforServiceImpl.java b/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysLogininforServiceImpl.java new file mode 100644 index 0000000..e925a7e --- /dev/null +++ b/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysLogininforServiceImpl.java @@ -0,0 +1,155 @@ +package com.ruoyi.system.service.impl; + +import cn.hutool.http.useragent.UserAgent; +import cn.hutool.http.useragent.UserAgentUtil; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.rouyi.common.mybatis.core.page.PageQuery; +import com.rouyi.common.mybatis.core.page.TableDataInfo; +import com.ruoyi.common.core.constant.Constants; +import com.ruoyi.common.core.utils.ServletUtils; +import com.ruoyi.common.core.utils.StringUtils; +import com.ruoyi.common.core.utils.ip.AddressUtils; +import com.ruoyi.common.log.event.LogininforEvent; +import com.ruoyi.system.domain.entity.SysLogininfor; +import com.ruoyi.system.mapper.SysLogininforMapper; +import com.ruoyi.system.service.ISysLogininforService; +import jakarta.servlet.http.HttpServletRequest; +import lombok.RequiredArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.springframework.context.event.EventListener; +import org.springframework.scheduling.annotation.Async; +import org.springframework.stereotype.Service; + +import java.util.Arrays; +import java.util.Date; +import java.util.List; +import java.util.Map; + +/** + * 系统访问日志情况信息 服务层处理 + * + * @author Lion Li + */ +@RequiredArgsConstructor +@Slf4j +@Service +public class SysLogininforServiceImpl implements ISysLogininforService { + + private final SysLogininforMapper baseMapper; + + /** + * 记录登录信息 + * + * @param logininforEvent 登录事件 + */ + @Async + @EventListener + public void recordLogininfor(LogininforEvent logininforEvent) { + HttpServletRequest request = logininforEvent.getRequest(); + final UserAgent userAgent = UserAgentUtil.parse(request.getHeader("User-Agent")); + final String ip = ServletUtils.getClientIP(request); + + String address = AddressUtils.getRealAddressByIP(ip); + StringBuilder s = new StringBuilder(); + s.append(getBlock(ip)); + s.append(address); + s.append(getBlock(logininforEvent.getUsername())); + s.append(getBlock(logininforEvent.getStatus())); + s.append(getBlock(logininforEvent.getMessage())); + // 打印信息到日志 + log.info(s.toString(), logininforEvent.getArgs()); + // 获取客户端操作系统 + String os = userAgent.getOs().getName(); + // 获取客户端浏览器 + String browser = userAgent.getBrowser().getName(); + // 封装对象 + SysLogininfor logininfor = new SysLogininfor(); + logininfor.setUserName(logininforEvent.getUsername()); + logininfor.setIpaddr(ip); + logininfor.setLoginLocation(address); + logininfor.setBrowser(browser); + logininfor.setOs(os); + logininfor.setMsg(logininforEvent.getMessage()); + // 日志状态 + if (StringUtils.equalsAny(logininforEvent.getStatus(), Constants.LOGIN_SUCCESS, Constants.LOGOUT, Constants.REGISTER)) { + logininfor.setStatus(Constants.SUCCESS); + } else if (Constants.LOGIN_FAIL.equals(logininforEvent.getStatus())) { + logininfor.setStatus(Constants.FAIL); + } + // 插入数据 + insertLogininfor(logininfor); + } + + private String getBlock(Object msg) { + if (msg == null) { + msg = ""; + } + return "[" + msg.toString() + "]"; + } + + @Override + public TableDataInfo selectPageLogininforList(SysLogininfor logininfor, PageQuery pageQuery) { + Map params = logininfor.getParams(); + LambdaQueryWrapper lqw = new LambdaQueryWrapper() + .like(StringUtils.isNotBlank(logininfor.getIpaddr()), SysLogininfor::getIpaddr, logininfor.getIpaddr()) + .eq(StringUtils.isNotBlank(logininfor.getStatus()), SysLogininfor::getStatus, logininfor.getStatus()) + .like(StringUtils.isNotBlank(logininfor.getUserName()), SysLogininfor::getUserName, logininfor.getUserName()) + .between(params.get("beginTime") != null && params.get("endTime") != null, + SysLogininfor::getLoginTime, params.get("beginTime"), params.get("endTime")); + if (StringUtils.isBlank(pageQuery.getOrderByColumn())) { + pageQuery.setOrderByColumn("info_id"); + pageQuery.setIsAsc("desc"); + } + Page page = baseMapper.selectPage(pageQuery.build(), lqw); + return TableDataInfo.build(page); + } + + /** + * 新增系统登录日志 + * + * @param logininfor 访问日志对象 + */ + @Override + public void insertLogininfor(SysLogininfor logininfor) { + logininfor.setLoginTime(new Date()); + baseMapper.insert(logininfor); + } + + /** + * 查询系统登录日志集合 + * + * @param logininfor 访问日志对象 + * @return 登录记录集合 + */ + @Override + public List selectLogininforList(SysLogininfor logininfor) { + Map params = logininfor.getParams(); + return baseMapper.selectList(new LambdaQueryWrapper() + .like(StringUtils.isNotBlank(logininfor.getIpaddr()), SysLogininfor::getIpaddr, logininfor.getIpaddr()) + .eq(StringUtils.isNotBlank(logininfor.getStatus()), SysLogininfor::getStatus, logininfor.getStatus()) + .like(StringUtils.isNotBlank(logininfor.getUserName()), SysLogininfor::getUserName, logininfor.getUserName()) + .between(params.get("beginTime") != null && params.get("endTime") != null, + SysLogininfor::getLoginTime, params.get("beginTime"), params.get("endTime")) + .orderByDesc(SysLogininfor::getInfoId)); + } + + /** + * 批量删除系统登录日志 + * + * @param infoIds 需要删除的登录日志ID + * @return 结果 + */ + @Override + public int deleteLogininforByIds(Long[] infoIds) { + return baseMapper.deleteBatchIds(Arrays.asList(infoIds)); + } + + /** + * 清空系统登录日志 + */ + @Override + public void cleanLogininfor() { + baseMapper.delete(new LambdaQueryWrapper<>()); + } +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysMenuServiceImpl.java b/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysMenuServiceImpl.java similarity index 50% rename from ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysMenuServiceImpl.java rename to ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysMenuServiceImpl.java index f450caa..1558a7f 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysMenuServiceImpl.java +++ b/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysMenuServiceImpl.java @@ -1,100 +1,116 @@ package com.ruoyi.system.service.impl; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.HashSet; -import java.util.Iterator; -import java.util.LinkedList; -import java.util.List; -import java.util.Set; -import java.util.stream.Collectors; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; -import com.ruoyi.common.constant.Constants; -import com.ruoyi.common.constant.UserConstants; -import com.ruoyi.common.core.domain.TreeSelect; -import com.ruoyi.common.core.domain.entity.SysMenu; -import com.ruoyi.common.core.domain.entity.SysRole; -import com.ruoyi.common.core.domain.entity.SysUser; -import com.ruoyi.common.utils.SecurityUtils; -import com.ruoyi.common.utils.StringUtils; +import cn.hutool.core.collection.CollUtil; +import cn.hutool.core.lang.tree.Tree; +import cn.hutool.core.util.ObjectUtil; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.toolkit.Wrappers; +import com.ruoyi.common.core.constant.Constants; +import com.ruoyi.common.core.constant.UserConstants; +import com.ruoyi.system.domain.entity.SysMenu; +import com.ruoyi.system.domain.entity.SysRole; +import com.ruoyi.common.satoken.utils.LoginHelper; +import com.ruoyi.common.core.utils.StreamUtils; +import com.ruoyi.common.core.utils.StringUtils; +import com.ruoyi.common.core.utils.TreeBuildUtils; +import com.ruoyi.system.domain.entity.SysRoleMenu; import com.ruoyi.system.domain.vo.MetaVo; import com.ruoyi.system.domain.vo.RouterVo; import com.ruoyi.system.mapper.SysMenuMapper; import com.ruoyi.system.mapper.SysRoleMapper; import com.ruoyi.system.mapper.SysRoleMenuMapper; import com.ruoyi.system.service.ISysMenuService; +import lombok.RequiredArgsConstructor; +import org.springframework.stereotype.Service; + +import java.util.*; /** * 菜单 业务层处理 - * - * @author ruoyi + * + * @author Lion Li */ +@RequiredArgsConstructor @Service -public class SysMenuServiceImpl implements ISysMenuService -{ - public static final String PREMISSION_STRING = "perms[\"{0}\"]"; +public class SysMenuServiceImpl implements ISysMenuService { - @Autowired - private SysMenuMapper menuMapper; - - @Autowired - private SysRoleMapper roleMapper; - - @Autowired - private SysRoleMenuMapper roleMenuMapper; + private final SysMenuMapper baseMapper; + private final SysRoleMapper roleMapper; + private final SysRoleMenuMapper roleMenuMapper; /** * 根据用户查询系统菜单列表 - * + * * @param userId 用户ID * @return 菜单列表 */ @Override - public List selectMenuList(Long userId) - { + public List selectMenuList(Long userId) { return selectMenuList(new SysMenu(), userId); } /** * 查询系统菜单列表 - * + * * @param menu 菜单信息 * @return 菜单列表 */ @Override - public List selectMenuList(SysMenu menu, Long userId) - { + public List selectMenuList(SysMenu menu, Long userId) { List menuList = null; // 管理员显示所有菜单信息 - if (SysUser.isAdmin(userId)) - { - menuList = menuMapper.selectMenuList(menu); - } - else - { - menu.getParams().put("userId", userId); - menuList = menuMapper.selectMenuListByUserId(menu); + if (LoginHelper.isAdmin(userId)) { + menuList = baseMapper.selectList(new LambdaQueryWrapper() + .like(StringUtils.isNotBlank(menu.getMenuName()), SysMenu::getMenuName, menu.getMenuName()) + .eq(StringUtils.isNotBlank(menu.getVisible()), SysMenu::getVisible, menu.getVisible()) + .eq(StringUtils.isNotBlank(menu.getStatus()), SysMenu::getStatus, menu.getStatus()) + .orderByAsc(SysMenu::getParentId) + .orderByAsc(SysMenu::getOrderNum)); + } else { + QueryWrapper wrapper = Wrappers.query(); + wrapper.eq("sur.user_id", userId) + .like(StringUtils.isNotBlank(menu.getMenuName()), "m.menu_name", menu.getMenuName()) + .eq(StringUtils.isNotBlank(menu.getVisible()), "m.visible", menu.getVisible()) + .eq(StringUtils.isNotBlank(menu.getStatus()), "m.status", menu.getStatus()) + .orderByAsc("m.parent_id") + .orderByAsc("m.order_num"); + menuList = baseMapper.selectMenuListByUserId(wrapper); } return menuList; } /** * 根据用户ID查询权限 - * + * * @param userId 用户ID * @return 权限列表 */ @Override - public Set selectMenuPermsByUserId(Long userId) - { - List perms = menuMapper.selectMenuPermsByUserId(userId); + public Set selectMenuPermsByUserId(Long userId) { + List perms = baseMapper.selectMenuPermsByUserId(userId); Set permsSet = new HashSet<>(); - for (String perm : perms) - { - if (StringUtils.isNotEmpty(perm)) - { - permsSet.addAll(Arrays.asList(perm.trim().split(","))); + for (String perm : perms) { + if (StringUtils.isNotEmpty(perm)) { + permsSet.addAll(StringUtils.splitList(perm.trim())); + } + } + return permsSet; + } + + /** + * 根据角色ID查询权限 + * + * @param roleId 角色ID + * @return 权限列表 + */ + @Override + public Set selectMenuPermsByRoleId(Long roleId) { + List perms = baseMapper.selectMenuPermsByRoleId(roleId); + Set permsSet = new HashSet<>(); + for (String perm : perms) { + if (StringUtils.isNotEmpty(perm)) { + permsSet.addAll(StringUtils.splitList(perm.trim())); } } return permsSet; @@ -102,83 +118,72 @@ public class SysMenuServiceImpl implements ISysMenuService /** * 根据用户ID查询菜单 - * + * * @param userId 用户名称 * @return 菜单列表 */ @Override - public List selectMenuTreeByUserId(Long userId) - { + public List selectMenuTreeByUserId(Long userId) { List menus = null; - if (SecurityUtils.isAdmin(userId)) - { - menus = menuMapper.selectMenuTreeAll(); - } - else - { - menus = menuMapper.selectMenuTreeByUserId(userId); + if (LoginHelper.isAdmin(userId)) { + menus = baseMapper.selectMenuTreeAll(); + } else { + menus = baseMapper.selectMenuTreeByUserId(userId); } return getChildPerms(menus, 0); } /** * 根据角色ID查询菜单树信息 - * + * * @param roleId 角色ID * @return 选中菜单列表 */ @Override - public List selectMenuListByRoleId(Long roleId) - { - SysRole role = roleMapper.selectRoleById(roleId); - return menuMapper.selectMenuListByRoleId(roleId, role.isMenuCheckStrictly()); + public List selectMenuListByRoleId(Long roleId) { + SysRole role = roleMapper.selectById(roleId); + return baseMapper.selectMenuListByRoleId(roleId, role.getMenuCheckStrictly()); } /** * 构建前端路由所需要的菜单 - * + * * @param menus 菜单列表 * @return 路由列表 */ @Override - public List buildMenus(List menus) - { - List routers = new LinkedList(); - for (SysMenu menu : menus) - { + public List buildMenus(List menus) { + List routers = new LinkedList<>(); + for (SysMenu menu : menus) { RouterVo router = new RouterVo(); router.setHidden("1".equals(menu.getVisible())); router.setName(getRouteName(menu)); router.setPath(getRouterPath(menu)); router.setComponent(getComponent(menu)); - router.setQuery(menu.getQuery()); + router.setQuery(menu.getQueryParam()); router.setMeta(new MetaVo(menu.getMenuName(), menu.getIcon(), StringUtils.equals("1", menu.getIsCache()), menu.getPath())); List cMenus = menu.getChildren(); - if (!cMenus.isEmpty() && cMenus.size() > 0 && UserConstants.TYPE_DIR.equals(menu.getMenuType())) - { + if (CollUtil.isNotEmpty(cMenus) && UserConstants.TYPE_DIR.equals(menu.getMenuType())) { router.setAlwaysShow(true); router.setRedirect("noRedirect"); router.setChildren(buildMenus(cMenus)); - } - else if (isMenuFrame(menu)) - { + } else if (isMenuFrame(menu)) { router.setMeta(null); - List childrenList = new ArrayList(); + List childrenList = new ArrayList<>(); RouterVo children = new RouterVo(); children.setPath(menu.getPath()); children.setComponent(menu.getComponent()); children.setName(StringUtils.capitalize(menu.getPath())); children.setMeta(new MetaVo(menu.getMenuName(), menu.getIcon(), StringUtils.equals("1", menu.getIsCache()), menu.getPath())); + children.setQuery(menu.getQueryParam()); childrenList.add(children); router.setChildren(childrenList); - } - else if (menu.getParentId().intValue() == 0 && isInnerLink(menu)) - { + } else if (menu.getParentId().intValue() == 0 && isInnerLink(menu)) { router.setMeta(new MetaVo(menu.getMenuName(), menu.getIcon())); - router.setPath("/inner"); - List childrenList = new ArrayList(); + router.setPath("/"); + List childrenList = new ArrayList<>(); RouterVo children = new RouterVo(); - String routerPath = StringUtils.replaceEach(menu.getPath(), new String[] { Constants.HTTP, Constants.HTTPS }, new String[] { "", "" }); + String routerPath = innerLinkReplaceEach(menu.getPath()); children.setPath(routerPath); children.setComponent(UserConstants.INNER_LINK); children.setName(StringUtils.capitalize(routerPath)); @@ -191,155 +196,115 @@ public class SysMenuServiceImpl implements ISysMenuService return routers; } - /** - * 构建前端所需要树结构 - * - * @param menus 菜单列表 - * @return 树结构列表 - */ - @Override - public List buildMenuTree(List menus) - { - List returnList = new ArrayList(); - List tempList = new ArrayList(); - for (SysMenu dept : menus) - { - tempList.add(dept.getMenuId()); - } - for (Iterator iterator = menus.iterator(); iterator.hasNext();) - { - SysMenu menu = (SysMenu) iterator.next(); - // 如果是顶级节点, 遍历该父节点的所有子节点 - if (!tempList.contains(menu.getParentId())) - { - recursionFn(menus, menu); - returnList.add(menu); - } - } - if (returnList.isEmpty()) - { - returnList = menus; - } - return returnList; - } - /** * 构建前端所需要下拉树结构 - * + * * @param menus 菜单列表 * @return 下拉树结构列表 */ @Override - public List buildMenuTreeSelect(List menus) - { - List menuTrees = buildMenuTree(menus); - return menuTrees.stream().map(TreeSelect::new).collect(Collectors.toList()); + public List> buildMenuTreeSelect(List menus) { + if (CollUtil.isEmpty(menus)) { + return CollUtil.newArrayList(); + } + return TreeBuildUtils.build(menus, (menu, tree) -> + tree.setId(menu.getMenuId()) + .setParentId(menu.getParentId()) + .setName(menu.getMenuName()) + .setWeight(menu.getOrderNum())); } /** * 根据菜单ID查询信息 - * + * * @param menuId 菜单ID * @return 菜单信息 */ @Override - public SysMenu selectMenuById(Long menuId) - { - return menuMapper.selectMenuById(menuId); + public SysMenu selectMenuById(Long menuId) { + return baseMapper.selectById(menuId); } /** * 是否存在菜单子节点 - * + * * @param menuId 菜单ID * @return 结果 */ @Override - public boolean hasChildByMenuId(Long menuId) - { - int result = menuMapper.hasChildByMenuId(menuId); - return result > 0 ? true : false; + public boolean hasChildByMenuId(Long menuId) { + return baseMapper.exists(new LambdaQueryWrapper().eq(SysMenu::getParentId, menuId)); } /** * 查询菜单使用数量 - * + * * @param menuId 菜单ID * @return 结果 */ @Override - public boolean checkMenuExistRole(Long menuId) - { - int result = roleMenuMapper.checkMenuExistRole(menuId); - return result > 0 ? true : false; + public boolean checkMenuExistRole(Long menuId) { + return roleMenuMapper.exists(new LambdaQueryWrapper().eq(SysRoleMenu::getMenuId, menuId)); } /** * 新增保存菜单信息 - * + * * @param menu 菜单信息 * @return 结果 */ @Override - public int insertMenu(SysMenu menu) - { - return menuMapper.insertMenu(menu); + public int insertMenu(SysMenu menu) { + return baseMapper.insert(menu); } /** * 修改保存菜单信息 - * + * * @param menu 菜单信息 * @return 结果 */ @Override - public int updateMenu(SysMenu menu) - { - return menuMapper.updateMenu(menu); + public int updateMenu(SysMenu menu) { + return baseMapper.updateById(menu); } /** * 删除菜单管理信息 - * + * * @param menuId 菜单ID * @return 结果 */ @Override - public int deleteMenuById(Long menuId) - { - return menuMapper.deleteMenuById(menuId); + public int deleteMenuById(Long menuId) { + return baseMapper.deleteById(menuId); } /** * 校验菜单名称是否唯一 - * + * * @param menu 菜单信息 * @return 结果 */ @Override - public String checkMenuNameUnique(SysMenu menu) - { - Long menuId = StringUtils.isNull(menu.getMenuId()) ? -1L : menu.getMenuId(); - SysMenu info = menuMapper.checkMenuNameUnique(menu.getMenuName(), menu.getParentId()); - if (StringUtils.isNotNull(info) && info.getMenuId().longValue() != menuId.longValue()) - { - return UserConstants.NOT_UNIQUE; - } - return UserConstants.UNIQUE; + public boolean checkMenuNameUnique(SysMenu menu) { + boolean exist = baseMapper.exists(new LambdaQueryWrapper() + .eq(SysMenu::getMenuName, menu.getMenuName()) + .eq(SysMenu::getParentId, menu.getParentId()) + .ne(ObjectUtil.isNotNull(menu.getMenuId()), SysMenu::getMenuId, menu.getMenuId())); + return !exist; } /** * 获取路由名称 - * + * * @param menu 菜单信息 * @return 路由名称 */ - public String getRouteName(SysMenu menu) - { + public String getRouteName(SysMenu menu) { String routerName = StringUtils.capitalize(menu.getPath()); // 非外链并且是一级目录(类型为目录) - if (isMenuFrame(menu)) - { + if (isMenuFrame(menu)) { routerName = StringUtils.EMPTY; } return routerName; @@ -347,27 +312,23 @@ public class SysMenuServiceImpl implements ISysMenuService /** * 获取路由地址 - * + * * @param menu 菜单信息 * @return 路由地址 */ - public String getRouterPath(SysMenu menu) - { + public String getRouterPath(SysMenu menu) { String routerPath = menu.getPath(); // 内链打开外网方式 - if (menu.getParentId().intValue() != 0 && isInnerLink(menu)) - { - routerPath = StringUtils.replaceEach(routerPath, new String[] { Constants.HTTP, Constants.HTTPS }, new String[] { "", "" }); + if (menu.getParentId().intValue() != 0 && isInnerLink(menu)) { + routerPath = innerLinkReplaceEach(routerPath); } // 非外链并且是一级目录(类型为目录) if (0 == menu.getParentId().intValue() && UserConstants.TYPE_DIR.equals(menu.getMenuType()) - && UserConstants.NO_FRAME.equals(menu.getIsFrame())) - { + && UserConstants.NO_FRAME.equals(menu.getIsFrame())) { routerPath = "/" + menu.getPath(); } // 非外链并且是一级目录(类型为菜单) - else if (isMenuFrame(menu)) - { + else if (isMenuFrame(menu)) { routerPath = "/"; } return routerPath; @@ -375,23 +336,17 @@ public class SysMenuServiceImpl implements ISysMenuService /** * 获取组件信息 - * + * * @param menu 菜单信息 * @return 组件信息 */ - public String getComponent(SysMenu menu) - { + public String getComponent(SysMenu menu) { String component = UserConstants.LAYOUT; - if (StringUtils.isNotEmpty(menu.getComponent()) && !isMenuFrame(menu)) - { + if (StringUtils.isNotEmpty(menu.getComponent()) && !isMenuFrame(menu)) { component = menu.getComponent(); - } - else if (StringUtils.isEmpty(menu.getComponent()) && menu.getParentId().intValue() != 0 && isInnerLink(menu)) - { + } else if (StringUtils.isEmpty(menu.getComponent()) && menu.getParentId().intValue() != 0 && isInnerLink(menu)) { component = UserConstants.INNER_LINK; - } - else if (StringUtils.isEmpty(menu.getComponent()) && isParentView(menu)) - { + } else if (StringUtils.isEmpty(menu.getComponent()) && isParentView(menu)) { component = UserConstants.PARENT_VIEW; } return component; @@ -399,54 +354,47 @@ public class SysMenuServiceImpl implements ISysMenuService /** * 是否为菜单内部跳转 - * + * * @param menu 菜单信息 * @return 结果 */ - public boolean isMenuFrame(SysMenu menu) - { + public boolean isMenuFrame(SysMenu menu) { return menu.getParentId().intValue() == 0 && UserConstants.TYPE_MENU.equals(menu.getMenuType()) - && menu.getIsFrame().equals(UserConstants.NO_FRAME); + && menu.getIsFrame().equals(UserConstants.NO_FRAME); } /** * 是否为内链组件 - * + * * @param menu 菜单信息 * @return 结果 */ - public boolean isInnerLink(SysMenu menu) - { + public boolean isInnerLink(SysMenu menu) { return menu.getIsFrame().equals(UserConstants.NO_FRAME) && StringUtils.ishttp(menu.getPath()); } /** * 是否为parent_view组件 - * + * * @param menu 菜单信息 * @return 结果 */ - public boolean isParentView(SysMenu menu) - { + public boolean isParentView(SysMenu menu) { return menu.getParentId().intValue() != 0 && UserConstants.TYPE_DIR.equals(menu.getMenuType()); } /** * 根据父节点的ID获取所有子节点 - * - * @param list 分类表 + * + * @param list 分类表 * @param parentId 传入的父节点ID * @return String */ - public List getChildPerms(List list, int parentId) - { - List returnList = new ArrayList(); - for (Iterator iterator = list.iterator(); iterator.hasNext();) - { - SysMenu t = (SysMenu) iterator.next(); + public List getChildPerms(List list, int parentId) { + List returnList = new ArrayList<>(); + for (SysMenu t : list) { // 一、根据传入的某个父节点ID,遍历该父节点的所有子节点 - if (t.getParentId() == parentId) - { + if (t.getParentId() == parentId) { recursionFn(list, t); returnList.add(t); } @@ -456,19 +404,14 @@ public class SysMenuServiceImpl implements ISysMenuService /** * 递归列表 - * - * @param list - * @param t + * */ - private void recursionFn(List list, SysMenu t) - { + private void recursionFn(List list, SysMenu t) { // 得到子节点列表 List childList = getChildList(list, t); t.setChildren(childList); - for (SysMenu tChild : childList) - { - if (hasChild(list, tChild)) - { + for (SysMenu tChild : childList) { + if (hasChild(list, tChild)) { recursionFn(list, tChild); } } @@ -477,26 +420,22 @@ public class SysMenuServiceImpl implements ISysMenuService /** * 得到子节点列表 */ - private List getChildList(List list, SysMenu t) - { - List tlist = new ArrayList(); - Iterator it = list.iterator(); - while (it.hasNext()) - { - SysMenu n = (SysMenu) it.next(); - if (n.getParentId().longValue() == t.getMenuId().longValue()) - { - tlist.add(n); - } - } - return tlist; + private List getChildList(List list, SysMenu t) { + return StreamUtils.filter(list, n -> n.getParentId().equals(t.getMenuId())); } /** * 判断是否有子节点 */ - private boolean hasChild(List list, SysMenu t) - { - return getChildList(list, t).size() > 0 ? true : false; + private boolean hasChild(List list, SysMenu t) { + return CollUtil.isNotEmpty(getChildList(list, t)); + } + + /** + * 内链域名特殊字符替换 + */ + public String innerLinkReplaceEach(String path) { + return StringUtils.replaceEach(path, new String[]{Constants.HTTP, Constants.HTTPS, Constants.WWW, ".", ":"}, + new String[]{"", "", "", "/", "/"}); } } diff --git a/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysNoticeServiceImpl.java b/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysNoticeServiceImpl.java new file mode 100644 index 0000000..b557364 --- /dev/null +++ b/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysNoticeServiceImpl.java @@ -0,0 +1,106 @@ +package com.ruoyi.system.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.rouyi.common.mybatis.core.page.PageQuery; +import com.rouyi.common.mybatis.core.page.TableDataInfo; +import com.ruoyi.common.core.utils.StringUtils; +import com.ruoyi.system.domain.entity.SysNotice; +import com.ruoyi.system.mapper.SysNoticeMapper; +import com.ruoyi.system.service.ISysNoticeService; +import lombok.RequiredArgsConstructor; +import org.springframework.stereotype.Service; + +import java.util.Arrays; +import java.util.List; + +/** + * 公告 服务层实现 + * + * @author Lion Li + */ +@RequiredArgsConstructor +@Service +public class SysNoticeServiceImpl implements ISysNoticeService { + + private final SysNoticeMapper baseMapper; + + @Override + public TableDataInfo selectPageNoticeList(SysNotice notice, PageQuery pageQuery) { + LambdaQueryWrapper lqw = new LambdaQueryWrapper() + .like(StringUtils.isNotBlank(notice.getNoticeTitle()), SysNotice::getNoticeTitle, notice.getNoticeTitle()) + .eq(StringUtils.isNotBlank(notice.getNoticeType()), SysNotice::getNoticeType, notice.getNoticeType()) + .like(StringUtils.isNotBlank(notice.getCreateBy()), SysNotice::getCreateBy, notice.getCreateBy()); + Page page = baseMapper.selectPage(pageQuery.build(), lqw); + return TableDataInfo.build(page); + } + + /** + * 查询公告信息 + * + * @param noticeId 公告ID + * @return 公告信息 + */ + @Override + public SysNotice selectNoticeById(Long noticeId) { + return baseMapper.selectById(noticeId); + } + + /** + * 查询公告列表 + * + * @param notice 公告信息 + * @return 公告集合 + */ + @Override + public List selectNoticeList(SysNotice notice) { + return baseMapper.selectList(new LambdaQueryWrapper() + .like(StringUtils.isNotBlank(notice.getNoticeTitle()), SysNotice::getNoticeTitle, notice.getNoticeTitle()) + .eq(StringUtils.isNotBlank(notice.getNoticeType()), SysNotice::getNoticeType, notice.getNoticeType()) + .like(StringUtils.isNotBlank(notice.getCreateBy()), SysNotice::getCreateBy, notice.getCreateBy())); + } + + /** + * 新增公告 + * + * @param notice 公告信息 + * @return 结果 + */ + @Override + public int insertNotice(SysNotice notice) { + return baseMapper.insert(notice); + } + + /** + * 修改公告 + * + * @param notice 公告信息 + * @return 结果 + */ + @Override + public int updateNotice(SysNotice notice) { + return baseMapper.updateById(notice); + } + + /** + * 删除公告对象 + * + * @param noticeId 公告ID + * @return 结果 + */ + @Override + public int deleteNoticeById(Long noticeId) { + return baseMapper.deleteById(noticeId); + } + + /** + * 批量删除公告信息 + * + * @param noticeIds 需要删除的公告ID + * @return 结果 + */ + @Override + public int deleteNoticeByIds(Long[] noticeIds) { + return baseMapper.deleteBatchIds(Arrays.asList(noticeIds)); + } +} diff --git a/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysOperLogServiceImpl.java b/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysOperLogServiceImpl.java new file mode 100644 index 0000000..29da4b6 --- /dev/null +++ b/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysOperLogServiceImpl.java @@ -0,0 +1,143 @@ +package com.ruoyi.system.service.impl; + +import cn.hutool.core.util.ArrayUtil; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.rouyi.common.mybatis.core.page.PageQuery; +import com.rouyi.common.mybatis.core.page.TableDataInfo; +import com.ruoyi.common.core.utils.MapstructUtils; +import com.ruoyi.common.core.utils.StringUtils; +import com.ruoyi.common.core.utils.ip.AddressUtils; +import com.ruoyi.common.log.event.OperLogEvent; +import com.ruoyi.system.domain.entity.SysOperLog; +import com.ruoyi.system.mapper.SysOperLogMapper; +import com.ruoyi.system.service.ISysOperLogService; +import lombok.RequiredArgsConstructor; +import org.springframework.context.event.EventListener; +import org.springframework.scheduling.annotation.Async; +import org.springframework.stereotype.Service; + +import java.util.Arrays; +import java.util.Date; +import java.util.List; +import java.util.Map; + +/** + * 操作日志 服务层处理 + * + * @author Lion Li + */ +@RequiredArgsConstructor +@Service +public class SysOperLogServiceImpl implements ISysOperLogService { + + private final SysOperLogMapper baseMapper; + + /** + * 操作日志记录 + * + * @param operLogEvent 操作日志事件 + */ + @Async + @EventListener + public void recordOper(OperLogEvent operLogEvent) { + SysOperLog operLog = MapstructUtils.convert(operLogEvent, SysOperLog.class); + // 远程查询操作地点 + operLog.setOperLocation(AddressUtils.getRealAddressByIP(operLog.getOperIp())); + insertOperlog(operLog); + } + + @Override + public TableDataInfo selectPageOperLogList(SysOperLog operLog, PageQuery pageQuery) { + Map params = operLog.getParams(); + LambdaQueryWrapper lqw = new LambdaQueryWrapper() + .like(StringUtils.isNotBlank(operLog.getOperIp()), SysOperLog::getOperIp, operLog.getOperIp()) + .like(StringUtils.isNotBlank(operLog.getTitle()), SysOperLog::getTitle, operLog.getTitle()) + .eq(operLog.getBusinessType() != null && operLog.getBusinessType() > 0, + SysOperLog::getBusinessType, operLog.getBusinessType()) + .func(f -> { + if (ArrayUtil.isNotEmpty(operLog.getBusinessTypes())) { + f.in(SysOperLog::getBusinessType, Arrays.asList(operLog.getBusinessTypes())); + } + }) + .eq(operLog.getStatus() != null, + SysOperLog::getStatus, operLog.getStatus()) + .like(StringUtils.isNotBlank(operLog.getOperName()), SysOperLog::getOperName, operLog.getOperName()) + .between(params.get("beginTime") != null && params.get("endTime") != null, + SysOperLog::getOperTime, params.get("beginTime"), params.get("endTime")); + if (StringUtils.isBlank(pageQuery.getOrderByColumn())) { + pageQuery.setOrderByColumn("oper_id"); + pageQuery.setIsAsc("desc"); + } + Page page = baseMapper.selectPage(pageQuery.build(), lqw); + return TableDataInfo.build(page); + } + + /** + * 新增操作日志 + * + * @param operLog 操作日志对象 + */ + @Override + public void insertOperlog(SysOperLog operLog) { + operLog.setOperTime(new Date()); + baseMapper.insert(operLog); + } + + /** + * 查询系统操作日志集合 + * + * @param operLog 操作日志对象 + * @return 操作日志集合 + */ + @Override + public List selectOperLogList(SysOperLog operLog) { + Map params = operLog.getParams(); + return baseMapper.selectList(new LambdaQueryWrapper() + .like(StringUtils.isNotBlank(operLog.getOperIp()), SysOperLog::getOperIp, operLog.getOperIp()) + .like(StringUtils.isNotBlank(operLog.getTitle()), SysOperLog::getTitle, operLog.getTitle()) + .eq(operLog.getBusinessType() != null && operLog.getBusinessType() > 0, + SysOperLog::getBusinessType, operLog.getBusinessType()) + .func(f -> { + if (ArrayUtil.isNotEmpty(operLog.getBusinessTypes())) { + f.in(SysOperLog::getBusinessType, Arrays.asList(operLog.getBusinessTypes())); + } + }) + .eq(operLog.getStatus() != null && operLog.getStatus() > 0, + SysOperLog::getStatus, operLog.getStatus()) + .like(StringUtils.isNotBlank(operLog.getOperName()), SysOperLog::getOperName, operLog.getOperName()) + .between(params.get("beginTime") != null && params.get("endTime") != null, + SysOperLog::getOperTime, params.get("beginTime"), params.get("endTime")) + .orderByDesc(SysOperLog::getOperId)); + } + + /** + * 批量删除系统操作日志 + * + * @param operIds 需要删除的操作日志ID + * @return 结果 + */ + @Override + public int deleteOperLogByIds(Long[] operIds) { + return baseMapper.deleteBatchIds(Arrays.asList(operIds)); + } + + /** + * 查询操作日志详细 + * + * @param operId 操作ID + * @return 操作日志对象 + */ + @Override + public SysOperLog selectOperLogById(Long operId) { + return baseMapper.selectById(operId); + } + + /** + * 清空操作日志 + */ + @Override + public void cleanOperLog() { + baseMapper.delete(new LambdaQueryWrapper<>()); + } +} diff --git a/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysOssConfigServiceImpl.java b/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysOssConfigServiceImpl.java new file mode 100644 index 0000000..59846df --- /dev/null +++ b/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysOssConfigServiceImpl.java @@ -0,0 +1,170 @@ +package com.ruoyi.system.service.impl; + +import cn.hutool.core.collection.CollUtil; +import cn.hutool.core.util.ObjectUtil; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; +import com.baomidou.mybatisplus.core.toolkit.Wrappers; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.ruoyi.common.core.constant.CacheNames; +import com.rouyi.common.mybatis.core.page.PageQuery; +import com.rouyi.common.mybatis.core.page.TableDataInfo; +import com.ruoyi.common.core.exception.ServiceException; +import com.ruoyi.common.json.utils.JsonUtils; +import com.ruoyi.common.core.utils.MapstructUtils; +import com.ruoyi.common.core.utils.StringUtils; +import com.ruoyi.common.redis.utils.CacheUtils; +import com.ruoyi.common.redis.utils.RedisUtils; +import com.ruoyi.common.oss.constant.OssConstant; +import com.ruoyi.system.domain.entity.SysOssConfig; +import com.ruoyi.system.domain.bo.SysOssConfigBo; +import com.ruoyi.system.domain.vo.SysOssConfigVo; +import com.ruoyi.system.mapper.SysOssConfigMapper; +import com.ruoyi.system.service.ISysOssConfigService; +import lombok.RequiredArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.Collection; +import java.util.List; + +/** + * 对象存储配置Service业务层处理 + * + * @author Lion Li + * @author 孤舟烟雨 + * @date 2021-08-13 + */ +@Slf4j +@RequiredArgsConstructor +@Service +public class SysOssConfigServiceImpl implements ISysOssConfigService { + + private final SysOssConfigMapper baseMapper; + + /** + * 项目启动时,初始化参数到缓存,加载配置类 + */ + @Override + public void init() { + List list = baseMapper.selectList(); + // 加载OSS初始化配置 + for (SysOssConfig config : list) { + String configKey = config.getConfigKey(); + if ("0".equals(config.getStatus())) { + RedisUtils.setCacheObject(OssConstant.DEFAULT_CONFIG_KEY, configKey); + } + CacheUtils.put(CacheNames.SYS_OSS_CONFIG, config.getConfigKey(), JsonUtils.toJsonString(config)); + } + } + + @Override + public SysOssConfigVo queryById(Long ossConfigId) { + return baseMapper.selectVoById(ossConfigId); + } + + @Override + public TableDataInfo queryPageList(SysOssConfigBo bo, PageQuery pageQuery) { + LambdaQueryWrapper lqw = buildQueryWrapper(bo); + Page result = baseMapper.selectVoPage(pageQuery.build(), lqw); + return TableDataInfo.build(result); + } + + + private LambdaQueryWrapper buildQueryWrapper(SysOssConfigBo bo) { + LambdaQueryWrapper lqw = Wrappers.lambdaQuery(); + lqw.eq(StringUtils.isNotBlank(bo.getConfigKey()), SysOssConfig::getConfigKey, bo.getConfigKey()); + lqw.like(StringUtils.isNotBlank(bo.getBucketName()), SysOssConfig::getBucketName, bo.getBucketName()); + lqw.eq(StringUtils.isNotBlank(bo.getStatus()), SysOssConfig::getStatus, bo.getStatus()); + return lqw; + } + + @Override + public Boolean insertByBo(SysOssConfigBo bo) { + SysOssConfig config = MapstructUtils.convert(bo, SysOssConfig.class); + validEntityBeforeSave(config); + boolean flag = baseMapper.insert(config) > 0; + if (flag) { + CacheUtils.put(CacheNames.SYS_OSS_CONFIG, config.getConfigKey(), JsonUtils.toJsonString(config)); + } + return flag; + } + + @Override + public Boolean updateByBo(SysOssConfigBo bo) { + SysOssConfig config = MapstructUtils.convert(bo, SysOssConfig.class); + validEntityBeforeSave(config); + LambdaUpdateWrapper luw = new LambdaUpdateWrapper<>(); + luw.set(ObjectUtil.isNull(config.getPrefix()), SysOssConfig::getPrefix, ""); + luw.set(ObjectUtil.isNull(config.getRegion()), SysOssConfig::getRegion, ""); + luw.set(ObjectUtil.isNull(config.getExt1()), SysOssConfig::getExt1, ""); + luw.set(ObjectUtil.isNull(config.getRemark()), SysOssConfig::getRemark, ""); + luw.eq(SysOssConfig::getOssConfigId, config.getOssConfigId()); + boolean flag = baseMapper.update(config, luw) > 0; + if (flag) { + CacheUtils.put(CacheNames.SYS_OSS_CONFIG, config.getConfigKey(), JsonUtils.toJsonString(config)); + } + return flag; + } + + /** + * 保存前的数据校验 + */ + private void validEntityBeforeSave(SysOssConfig entity) { + if (StringUtils.isNotEmpty(entity.getConfigKey()) && !checkConfigKeyUnique(entity)) { + throw new ServiceException("操作配置'" + entity.getConfigKey() + "'失败, 配置key已存在!"); + } + } + + @Override + public Boolean deleteWithValidByIds(Collection ids, Boolean isValid) { + if (isValid) { + if (CollUtil.containsAny(ids, OssConstant.SYSTEM_DATA_IDS)) { + throw new ServiceException("系统内置, 不可删除!"); + } + } + List list = CollUtil.newArrayList(); + for (Long configId : ids) { + SysOssConfig config = baseMapper.selectById(configId); + list.add(config); + } + boolean flag = baseMapper.deleteBatchIds(ids) > 0; + if (flag) { + list.forEach(sysOssConfig -> + CacheUtils.evict(CacheNames.SYS_OSS_CONFIG, sysOssConfig.getConfigKey())); + } + return flag; + } + + /** + * 判断configKey是否唯一 + */ + private boolean checkConfigKeyUnique(SysOssConfig sysOssConfig) { + long ossConfigId = ObjectUtil.isNull(sysOssConfig.getOssConfigId()) ? -1L : sysOssConfig.getOssConfigId(); + SysOssConfig info = baseMapper.selectOne(new LambdaQueryWrapper() + .select(SysOssConfig::getOssConfigId, SysOssConfig::getConfigKey) + .eq(SysOssConfig::getConfigKey, sysOssConfig.getConfigKey())); + if (ObjectUtil.isNotNull(info) && info.getOssConfigId() != ossConfigId) { + return false; + } + return true; + } + + /** + * 启用禁用状态 + */ + @Override + @Transactional(rollbackFor = Exception.class) + public int updateOssConfigStatus(SysOssConfigBo bo) { + SysOssConfig sysOssConfig = MapstructUtils.convert(bo, SysOssConfig.class); + int row = baseMapper.update(null, new LambdaUpdateWrapper() + .set(SysOssConfig::getStatus, "1")); + row += baseMapper.updateById(sysOssConfig); + if (row > 0) { + RedisUtils.setCacheObject(OssConstant.DEFAULT_CONFIG_KEY, sysOssConfig.getConfigKey()); + } + return row; + } + +} diff --git a/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysOssServiceImpl.java b/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysOssServiceImpl.java new file mode 100644 index 0000000..ac62387 --- /dev/null +++ b/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysOssServiceImpl.java @@ -0,0 +1,198 @@ +package com.ruoyi.system.service.impl; + +import cn.hutool.core.convert.Convert; +import cn.hutool.core.io.IoUtil; +import cn.hutool.core.util.ObjectUtil; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.toolkit.Wrappers; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.ruoyi.common.core.constant.CacheNames; +import com.rouyi.common.mybatis.core.page.PageQuery; +import com.rouyi.common.mybatis.core.page.TableDataInfo; +import com.ruoyi.common.core.service.OssService; +import com.ruoyi.common.core.exception.ServiceException; +import com.ruoyi.common.core.utils.MapstructUtils; +import com.ruoyi.common.core.utils.StreamUtils; +import com.ruoyi.common.core.utils.StringUtils; +import com.ruoyi.common.core.utils.file.FileUtils; +import com.ruoyi.common.core.utils.SpringUtils; +import com.ruoyi.common.oss.core.OssClient; +import com.ruoyi.common.oss.entity.UploadResult; +import com.ruoyi.common.oss.enumd.AccessPolicyType; +import com.ruoyi.common.oss.factory.OssFactory; +import com.ruoyi.system.domain.entity.SysOss; +import com.ruoyi.system.domain.bo.SysOssBo; +import com.ruoyi.system.domain.vo.SysOssVo; +import com.ruoyi.system.mapper.SysOssMapper; +import com.ruoyi.system.service.ISysOssService; +import jakarta.servlet.http.HttpServletResponse; +import lombok.RequiredArgsConstructor; +import org.springframework.cache.annotation.Cacheable; +import org.springframework.http.MediaType; +import org.springframework.stereotype.Service; +import org.springframework.web.multipart.MultipartFile; + +import java.io.File; +import java.io.IOException; +import java.io.InputStream; +import java.util.ArrayList; +import java.util.Collection; +import java.util.List; +import java.util.Map; + +/** + * 文件上传 服务层实现 + * + * @author Lion Li + */ +@RequiredArgsConstructor +@Service +public class SysOssServiceImpl implements ISysOssService, OssService { + + private final SysOssMapper baseMapper; + + @Override + public TableDataInfo queryPageList(SysOssBo bo, PageQuery pageQuery) { + LambdaQueryWrapper lqw = buildQueryWrapper(bo); + Page result = baseMapper.selectVoPage(pageQuery.build(), lqw); + List filterResult = StreamUtils.toList(result.getRecords(), this::matchingUrl); + result.setRecords(filterResult); + return TableDataInfo.build(result); + } + + @Override + public List listByIds(Collection ossIds) { + List list = new ArrayList<>(); + for (Long id : ossIds) { + SysOssVo vo = SpringUtils.getAopProxy(this).getById(id); + if (ObjectUtil.isNotNull(vo)) { + try { + list.add(this.matchingUrl(vo)); + } catch (Exception ignored) { + // 如果oss异常无法连接则将数据直接返回 + list.add(vo); + } } + } + return list; + } + + @Override + public String selectUrlByIds(String ossIds) { + List list = new ArrayList<>(); + for (Long id : StringUtils.splitTo(ossIds, Convert::toLong)) { + SysOssVo vo = SpringUtils.getAopProxy(this).getById(id); + if (ObjectUtil.isNotNull(vo)) { + try { + list.add(this.matchingUrl(vo).getUrl()); + } catch (Exception ignored) { + // 如果oss异常无法连接则将数据直接返回 + list.add(vo.getUrl()); + } + } + } + return String.join(StringUtils.SEPARATOR, list); + } + + private LambdaQueryWrapper buildQueryWrapper(SysOssBo bo) { + Map params = bo.getParams(); + LambdaQueryWrapper lqw = Wrappers.lambdaQuery(); + lqw.like(StringUtils.isNotBlank(bo.getFileName()), SysOss::getFileName, bo.getFileName()); + lqw.like(StringUtils.isNotBlank(bo.getOriginalName()), SysOss::getOriginalName, bo.getOriginalName()); + lqw.eq(StringUtils.isNotBlank(bo.getFileSuffix()), SysOss::getFileSuffix, bo.getFileSuffix()); + lqw.eq(StringUtils.isNotBlank(bo.getUrl()), SysOss::getUrl, bo.getUrl()); + lqw.between(params.get("beginCreateTime") != null && params.get("endCreateTime") != null, + SysOss::getCreateTime, params.get("beginCreateTime"), params.get("endCreateTime")); + lqw.eq(StringUtils.isNotBlank(bo.getCreateBy()), SysOss::getCreateBy, bo.getCreateBy()); + lqw.eq(StringUtils.isNotBlank(bo.getService()), SysOss::getService, bo.getService()); + return lqw; + } + + @Cacheable(cacheNames = CacheNames.SYS_OSS, key = "#ossId") + @Override + public SysOssVo getById(Long ossId) { + return baseMapper.selectVoById(ossId); + } + + @Override + public void download(Long ossId, HttpServletResponse response) throws IOException { + SysOssVo sysOss = SpringUtils.getAopProxy(this).getById(ossId); + if (ObjectUtil.isNull(sysOss)) { + throw new ServiceException("文件数据不存在!"); + } + FileUtils.setAttachmentResponseHeader(response, sysOss.getOriginalName()); + response.setContentType(MediaType.APPLICATION_OCTET_STREAM_VALUE + "; charset=UTF-8"); + OssClient storage = OssFactory.instance(sysOss.getService()); + try(InputStream inputStream = storage.getObjectContent(sysOss.getUrl())) { + int available = inputStream.available(); + IoUtil.copy(inputStream, response.getOutputStream(), available); + response.setContentLength(available); + } catch (Exception e) { + throw new ServiceException(e.getMessage()); + } + } + + @Override + public SysOssVo upload(MultipartFile file) { + String originalfileName = file.getOriginalFilename(); + String suffix = StringUtils.substring(originalfileName, originalfileName.lastIndexOf("."), originalfileName.length()); + OssClient storage = OssFactory.instance(); + UploadResult uploadResult; + try { + uploadResult = storage.uploadSuffix(file.getBytes(), suffix, file.getContentType()); + } catch (IOException e) { + throw new ServiceException(e.getMessage()); + } + // 保存文件信息 + return buildResultEntity(originalfileName, suffix, storage.getConfigKey(), uploadResult); + } + + @Override + public SysOssVo upload(File file) { + String originalfileName = file.getName(); + String suffix = StringUtils.substring(originalfileName, originalfileName.lastIndexOf("."), originalfileName.length()); + OssClient storage = OssFactory.instance(); + UploadResult uploadResult = storage.uploadSuffix(file, suffix); + // 保存文件信息 + return buildResultEntity(originalfileName, suffix, storage.getConfigKey(), uploadResult); + } + + private SysOssVo buildResultEntity(String originalfileName, String suffix, String configKey, UploadResult uploadResult) { + SysOss oss = new SysOss(); + oss.setUrl(uploadResult.getUrl()); + oss.setFileSuffix(suffix); + oss.setFileName(uploadResult.getFilename()); + oss.setOriginalName(originalfileName); + oss.setService(configKey); + baseMapper.insert(oss); + SysOssVo sysOssVo = MapstructUtils.convert(oss, SysOssVo.class); + return this.matchingUrl(sysOssVo); + } + + @Override + public Boolean deleteWithValidByIds(Collection ids, Boolean isValid) { + if (isValid) { + // 做一些业务上的校验,判断是否需要校验 + } + List list = baseMapper.selectBatchIds(ids); + for (SysOss sysOss : list) { + OssClient storage = OssFactory.instance(sysOss.getService()); + storage.delete(sysOss.getUrl()); + } + return baseMapper.deleteBatchIds(ids) > 0; + } + + /** + * 匹配Url + * + * @param oss OSS对象 + * @return oss 匹配Url的OSS对象 + */ + private SysOssVo matchingUrl(SysOssVo oss) { + OssClient storage = OssFactory.instance(oss.getService()); + // 仅修改桶类型为 private 的URL,临时URL时长为120s + if (AccessPolicyType.PRIVATE == storage.getAccessPolicy()) { + oss.setUrl(storage.getPrivateUrl(oss.getFileName(), 120)); + } + return oss; + } +} diff --git a/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysPostServiceImpl.java b/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysPostServiceImpl.java new file mode 100644 index 0000000..69cd8b4 --- /dev/null +++ b/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysPostServiceImpl.java @@ -0,0 +1,177 @@ +package com.ruoyi.system.service.impl; + +import cn.hutool.core.util.ObjectUtil; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.rouyi.common.mybatis.core.page.PageQuery; +import com.rouyi.common.mybatis.core.page.TableDataInfo; +import com.ruoyi.common.core.exception.ServiceException; +import com.ruoyi.common.core.utils.StringUtils; +import com.ruoyi.system.domain.entity.SysPost; +import com.ruoyi.system.domain.entity.SysUserPost; +import com.ruoyi.system.mapper.SysPostMapper; +import com.ruoyi.system.mapper.SysUserPostMapper; +import com.ruoyi.system.service.ISysPostService; +import lombok.RequiredArgsConstructor; +import org.springframework.stereotype.Service; + +import java.util.Arrays; +import java.util.List; + +/** + * 岗位信息 服务层处理 + * + * @author Lion Li + */ +@RequiredArgsConstructor +@Service +public class SysPostServiceImpl implements ISysPostService { + + private final SysPostMapper baseMapper; + private final SysUserPostMapper userPostMapper; + + @Override + public TableDataInfo selectPagePostList(SysPost post, PageQuery pageQuery) { + LambdaQueryWrapper lqw = new LambdaQueryWrapper() + .like(StringUtils.isNotBlank(post.getPostCode()), SysPost::getPostCode, post.getPostCode()) + .eq(StringUtils.isNotBlank(post.getStatus()), SysPost::getStatus, post.getStatus()) + .like(StringUtils.isNotBlank(post.getPostName()), SysPost::getPostName, post.getPostName()); + Page page = baseMapper.selectPage(pageQuery.build(), lqw); + return TableDataInfo.build(page); + } + + /** + * 查询岗位信息集合 + * + * @param post 岗位信息 + * @return 岗位信息集合 + */ + @Override + public List selectPostList(SysPost post) { + return baseMapper.selectList(new LambdaQueryWrapper() + .like(StringUtils.isNotBlank(post.getPostCode()), SysPost::getPostCode, post.getPostCode()) + .eq(StringUtils.isNotBlank(post.getStatus()), SysPost::getStatus, post.getStatus()) + .like(StringUtils.isNotBlank(post.getPostName()), SysPost::getPostName, post.getPostName())); + } + + /** + * 查询所有岗位 + * + * @return 岗位列表 + */ + @Override + public List selectPostAll() { + return baseMapper.selectList(); + } + + /** + * 通过岗位ID查询岗位信息 + * + * @param postId 岗位ID + * @return 角色对象信息 + */ + @Override + public SysPost selectPostById(Long postId) { + return baseMapper.selectById(postId); + } + + /** + * 根据用户ID获取岗位选择框列表 + * + * @param userId 用户ID + * @return 选中岗位ID列表 + */ + @Override + public List selectPostListByUserId(Long userId) { + return baseMapper.selectPostListByUserId(userId); + } + + /** + * 校验岗位名称是否唯一 + * + * @param post 岗位信息 + * @return 结果 + */ + @Override + public boolean checkPostNameUnique(SysPost post) { + boolean exist = baseMapper.exists(new LambdaQueryWrapper() + .eq(SysPost::getPostName, post.getPostName()) + .ne(ObjectUtil.isNotNull(post.getPostId()), SysPost::getPostId, post.getPostId())); + return !exist; + } + + /** + * 校验岗位编码是否唯一 + * + * @param post 岗位信息 + * @return 结果 + */ + @Override + public boolean checkPostCodeUnique(SysPost post) { + boolean exist = baseMapper.exists(new LambdaQueryWrapper() + .eq(SysPost::getPostCode, post.getPostCode()) + .ne(ObjectUtil.isNotNull(post.getPostId()), SysPost::getPostId, post.getPostId())); + return !exist; + } + + /** + * 通过岗位ID查询岗位使用数量 + * + * @param postId 岗位ID + * @return 结果 + */ + @Override + public long countUserPostById(Long postId) { + return userPostMapper.selectCount(new LambdaQueryWrapper().eq(SysUserPost::getPostId, postId)); + } + + /** + * 删除岗位信息 + * + * @param postId 岗位ID + * @return 结果 + */ + @Override + public int deletePostById(Long postId) { + return baseMapper.deleteById(postId); + } + + /** + * 批量删除岗位信息 + * + * @param postIds 需要删除的岗位ID + * @return 结果 + */ + @Override + public int deletePostByIds(Long[] postIds) { + for (Long postId : postIds) { + SysPost post = selectPostById(postId); + if (countUserPostById(postId) > 0) { + throw new ServiceException(String.format("%1$s已分配,不能删除!", post.getPostName())); + } + } + return baseMapper.deleteBatchIds(Arrays.asList(postIds)); + } + + /** + * 新增保存岗位信息 + * + * @param post 岗位信息 + * @return 结果 + */ + @Override + public int insertPost(SysPost post) { + return baseMapper.insert(post); + } + + /** + * 修改保存岗位信息 + * + * @param post 岗位信息 + * @return 结果 + */ + @Override + public int updatePost(SysPost post) { + return baseMapper.updateById(post); + } +} diff --git a/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysRoleServiceImpl.java b/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysRoleServiceImpl.java new file mode 100644 index 0000000..6b34db0 --- /dev/null +++ b/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysRoleServiceImpl.java @@ -0,0 +1,468 @@ +package com.ruoyi.system.service.impl; + +import cn.dev33.satoken.exception.NotLoginException; +import cn.dev33.satoken.stp.StpUtil; +import cn.hutool.core.collection.CollUtil; +import cn.hutool.core.util.ObjectUtil; +import com.baomidou.mybatisplus.core.conditions.Wrapper; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.toolkit.Wrappers; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.ruoyi.common.core.constant.UserConstants; +import com.rouyi.common.mybatis.core.page.PageQuery; +import com.ruoyi.system.domain.entity.SysRole; +import com.ruoyi.common.core.domain.bo.LoginUser; +import com.rouyi.common.mybatis.core.page.TableDataInfo; +import com.ruoyi.common.core.exception.ServiceException; +import com.ruoyi.common.satoken.utils.LoginHelper; +import com.ruoyi.common.core.utils.StreamUtils; +import com.ruoyi.common.core.utils.StringUtils; +import com.ruoyi.system.domain.entity.SysRoleDept; +import com.ruoyi.system.domain.entity.SysRoleMenu; +import com.ruoyi.system.domain.entity.SysUserRole; +import com.ruoyi.system.mapper.SysRoleDeptMapper; +import com.ruoyi.system.mapper.SysRoleMapper; +import com.ruoyi.system.mapper.SysRoleMenuMapper; +import com.ruoyi.system.mapper.SysUserRoleMapper; +import com.ruoyi.system.service.ISysRoleService; +import lombok.RequiredArgsConstructor; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.*; + +/** + * 角色 业务层处理 + * + * @author Lion Li + */ +@RequiredArgsConstructor +@Service +public class SysRoleServiceImpl implements ISysRoleService { + + private final SysRoleMapper baseMapper; + private final SysRoleMenuMapper roleMenuMapper; + private final SysUserRoleMapper userRoleMapper; + private final SysRoleDeptMapper roleDeptMapper; + + @Override + public TableDataInfo selectPageRoleList(SysRole role, PageQuery pageQuery) { + Page page = baseMapper.selectPageRoleList(pageQuery.build(), this.buildQueryWrapper(role)); + return TableDataInfo.build(page); + } + + /** + * 根据条件分页查询角色数据 + * + * @param role 角色信息 + * @return 角色数据集合信息 + */ + @Override + public List selectRoleList(SysRole role) { + return baseMapper.selectRoleList(this.buildQueryWrapper(role)); + } + + private Wrapper buildQueryWrapper(SysRole role) { + Map params = role.getParams(); + QueryWrapper wrapper = Wrappers.query(); + wrapper.eq("r.del_flag", UserConstants.ROLE_NORMAL) + .eq(ObjectUtil.isNotNull(role.getRoleId()), "r.role_id", role.getRoleId()) + .like(StringUtils.isNotBlank(role.getRoleName()), "r.role_name", role.getRoleName()) + .eq(StringUtils.isNotBlank(role.getStatus()), "r.status", role.getStatus()) + .like(StringUtils.isNotBlank(role.getRoleKey()), "r.role_key", role.getRoleKey()) + .between(params.get("beginTime") != null && params.get("endTime") != null, + "r.create_time", params.get("beginTime"), params.get("endTime")) + .orderByAsc("r.role_sort").orderByAsc("r.create_time"); + return wrapper; + } + + /** + * 根据用户ID查询角色 + * + * @param userId 用户ID + * @return 角色列表 + */ + @Override + public List selectRolesByUserId(Long userId) { + List userRoles = baseMapper.selectRolePermissionByUserId(userId); + List roles = selectRoleAll(); + for (SysRole role : roles) { + for (SysRole userRole : userRoles) { + if (role.getRoleId().longValue() == userRole.getRoleId().longValue()) { + role.setFlag(true); + break; + } + } + } + return roles; + } + + /** + * 根据用户ID查询权限 + * + * @param userId 用户ID + * @return 权限列表 + */ + @Override + public Set selectRolePermissionByUserId(Long userId) { + List perms = baseMapper.selectRolePermissionByUserId(userId); + Set permsSet = new HashSet<>(); + for (SysRole perm : perms) { + if (ObjectUtil.isNotNull(perm)) { + permsSet.addAll(StringUtils.splitList(perm.getRoleKey().trim())); + } + } + return permsSet; + } + + /** + * 查询所有角色 + * + * @return 角色列表 + */ + @Override + public List selectRoleAll() { + return this.selectRoleList(new SysRole()); + } + + /** + * 根据用户ID获取角色选择框列表 + * + * @param userId 用户ID + * @return 选中角色ID列表 + */ + @Override + public List selectRoleListByUserId(Long userId) { + return baseMapper.selectRoleListByUserId(userId); + } + + /** + * 通过角色ID查询角色 + * + * @param roleId 角色ID + * @return 角色对象信息 + */ + @Override + public SysRole selectRoleById(Long roleId) { + return baseMapper.selectById(roleId); + } + + /** + * 校验角色名称是否唯一 + * + * @param role 角色信息 + * @return 结果 + */ + @Override + public boolean checkRoleNameUnique(SysRole role) { + boolean exist = baseMapper.exists(new LambdaQueryWrapper() + .eq(SysRole::getRoleName, role.getRoleName()) + .ne(ObjectUtil.isNotNull(role.getRoleId()), SysRole::getRoleId, role.getRoleId())); + return !exist; + } + + /** + * 校验角色权限是否唯一 + * + * @param role 角色信息 + * @return 结果 + */ + @Override + public boolean checkRoleKeyUnique(SysRole role) { + boolean exist = baseMapper.exists(new LambdaQueryWrapper() + .eq(SysRole::getRoleKey, role.getRoleKey()) + .ne(ObjectUtil.isNotNull(role.getRoleId()), SysRole::getRoleId, role.getRoleId())); + return !exist; + } + + /** + * 校验角色是否允许操作 + * + * @param role 角色信息 + */ + @Override + public void checkRoleAllowed(SysRole role) { + if (ObjectUtil.isNotNull(role.getRoleId()) && role.isAdmin()) { + throw new ServiceException("不允许操作超级管理员角色"); + } + // 新增不允许使用 管理员标识符 + if (ObjectUtil.isNull(role.getRoleId()) + && StringUtils.equals(role.getRoleKey(), UserConstants.ADMIN_ROLE_KEY)) { + throw new ServiceException("不允许使用系统内置管理员角色标识符!"); + } + // 修改不允许修改 管理员标识符 + if (ObjectUtil.isNotNull(role.getRoleId())) { + SysRole sysRole = baseMapper.selectById(role.getRoleId()); + // 如果标识符不相等 判断为修改了管理员标识符 + if (!StringUtils.equals(sysRole.getRoleKey(), role.getRoleKey())) { + if (StringUtils.equals(sysRole.getRoleKey(), UserConstants.ADMIN_ROLE_KEY)) { + throw new ServiceException("不允许修改系统内置管理员角色标识符!"); + } else if (StringUtils.equals(role.getRoleKey(), UserConstants.ADMIN_ROLE_KEY)) { + throw new ServiceException("不允许使用系统内置管理员角色标识符!"); + } + } + } + } + + /** + * 校验角色是否有数据权限 + * + * @param roleId 角色id + */ + @Override + public void checkRoleDataScope(Long roleId) { + if (!LoginHelper.isAdmin()) { + SysRole role = new SysRole(); + role.setRoleId(roleId); + List roles = this.selectRoleList(role); + if (CollUtil.isEmpty(roles)) { + throw new ServiceException("没有权限访问角色数据!"); + } + } + } + + /** + * 通过角色ID查询角色使用数量 + * + * @param roleId 角色ID + * @return 结果 + */ + @Override + public long countUserRoleByRoleId(Long roleId) { + return userRoleMapper.selectCount(new LambdaQueryWrapper().eq(SysUserRole::getRoleId, roleId)); + } + + /** + * 新增保存角色信息 + * + * @param role 角色信息 + * @return 结果 + */ + @Override + @Transactional(rollbackFor = Exception.class) + public int insertRole(SysRole role) { + // 新增角色信息 + baseMapper.insert(role); + return insertRoleMenu(role); + } + + /** + * 修改保存角色信息 + * + * @param role 角色信息 + * @return 结果 + */ + @Override + @Transactional(rollbackFor = Exception.class) + public int updateRole(SysRole role) { + // 修改角色信息 + baseMapper.updateById(role); + // 删除角色与菜单关联 + roleMenuMapper.delete(new LambdaQueryWrapper().eq(SysRoleMenu::getRoleId, role.getRoleId())); + return insertRoleMenu(role); + } + + /** + * 修改角色状态 + * + * @param role 角色信息 + * @return 结果 + */ + @Override + public int updateRoleStatus(SysRole role) { + if (UserConstants.ROLE_DISABLE.equals(role.getStatus()) && this.countUserRoleByRoleId(role.getRoleId()) > 0) { + throw new ServiceException("角色已分配,不能禁用!"); + } + return baseMapper.updateById(role); + } + + /** + * 修改数据权限信息 + * + * @param role 角色信息 + * @return 结果 + */ + @Override + @Transactional(rollbackFor = Exception.class) + public int authDataScope(SysRole role) { + // 修改角色信息 + baseMapper.updateById(role); + // 删除角色与部门关联 + roleDeptMapper.delete(new LambdaQueryWrapper().eq(SysRoleDept::getRoleId, role.getRoleId())); + // 新增角色和部门信息(数据权限) + return insertRoleDept(role); + } + + /** + * 新增角色菜单信息 + * + * @param role 角色对象 + */ + public int insertRoleMenu(SysRole role) { + int rows = 1; + // 新增用户与角色管理 + List list = new ArrayList(); + for (Long menuId : role.getMenuIds()) { + SysRoleMenu rm = new SysRoleMenu(); + rm.setRoleId(role.getRoleId()); + rm.setMenuId(menuId); + list.add(rm); + } + if (list.size() > 0) { + rows = roleMenuMapper.insertBatch(list) ? list.size() : 0; + } + return rows; + } + + /** + * 新增角色部门信息(数据权限) + * + * @param role 角色对象 + */ + public int insertRoleDept(SysRole role) { + int rows = 1; + // 新增角色与部门(数据权限)管理 + List list = new ArrayList(); + for (Long deptId : role.getDeptIds()) { + SysRoleDept rd = new SysRoleDept(); + rd.setRoleId(role.getRoleId()); + rd.setDeptId(deptId); + list.add(rd); + } + if (list.size() > 0) { + rows = roleDeptMapper.insertBatch(list) ? list.size() : 0; + } + return rows; + } + + /** + * 通过角色ID删除角色 + * + * @param roleId 角色ID + * @return 结果 + */ + @Override + @Transactional(rollbackFor = Exception.class) + public int deleteRoleById(Long roleId) { + // 删除角色与菜单关联 + roleMenuMapper.delete(new LambdaQueryWrapper().eq(SysRoleMenu::getRoleId, roleId)); + // 删除角色与部门关联 + roleDeptMapper.delete(new LambdaQueryWrapper().eq(SysRoleDept::getRoleId, roleId)); + return baseMapper.deleteById(roleId); + } + + /** + * 批量删除角色信息 + * + * @param roleIds 需要删除的角色ID + * @return 结果 + */ + @Override + @Transactional(rollbackFor = Exception.class) + public int deleteRoleByIds(Long[] roleIds) { + for (Long roleId : roleIds) { + SysRole role = selectRoleById(roleId); + checkRoleAllowed(role); + checkRoleDataScope(roleId); + if (countUserRoleByRoleId(roleId) > 0) { + throw new ServiceException(String.format("%1$s已分配,不能删除!", role.getRoleName())); + } + } + List ids = Arrays.asList(roleIds); + // 删除角色与菜单关联 + roleMenuMapper.delete(new LambdaQueryWrapper().in(SysRoleMenu::getRoleId, ids)); + // 删除角色与部门关联 + roleDeptMapper.delete(new LambdaQueryWrapper().in(SysRoleDept::getRoleId, ids)); + return baseMapper.deleteBatchIds(ids); + } + + /** + * 取消授权用户角色 + * + * @param userRole 用户和角色关联信息 + * @return 结果 + */ + @Override + public int deleteAuthUser(SysUserRole userRole) { + int rows = userRoleMapper.delete(new LambdaQueryWrapper() + .eq(SysUserRole::getRoleId, userRole.getRoleId()) + .eq(SysUserRole::getUserId, userRole.getUserId())); + if (rows > 0) { + cleanOnlineUserByRole(userRole.getRoleId()); + } + return rows; + } + + /** + * 批量取消授权用户角色 + * + * @param roleId 角色ID + * @param userIds 需要取消授权的用户数据ID + * @return 结果 + */ + @Override + public int deleteAuthUsers(Long roleId, Long[] userIds) { + int rows = userRoleMapper.delete(new LambdaQueryWrapper() + .eq(SysUserRole::getRoleId, roleId) + .in(SysUserRole::getUserId, Arrays.asList(userIds))); + if (rows > 0) { + cleanOnlineUserByRole(roleId); + } + return rows; + } + + /** + * 批量选择授权用户角色 + * + * @param roleId 角色ID + * @param userIds 需要授权的用户数据ID + * @return 结果 + */ + @Override + public int insertAuthUsers(Long roleId, Long[] userIds) { + // 新增用户与角色管理 + int rows = 1; + List list = StreamUtils.toList(Arrays.asList(userIds), userId -> { + SysUserRole ur = new SysUserRole(); + ur.setUserId(userId); + ur.setRoleId(roleId); + return ur; + }); + if (CollUtil.isNotEmpty(list)) { + rows = userRoleMapper.insertBatch(list) ? list.size() : 0; + } + if (rows > 0) { + cleanOnlineUserByRole(roleId); + } + return rows; + } + + @Override + public void cleanOnlineUserByRole(Long roleId) { + // 如果角色未绑定用户 直接返回 + Long num = userRoleMapper.selectCount(new LambdaQueryWrapper().eq(SysUserRole::getRoleId, roleId)); + if (num == 0) { + return; + } + List keys = StpUtil.searchTokenValue("", 0, -1, false); + if (CollUtil.isEmpty(keys)) { + return; + } + // 角色关联的在线用户量过大会导致redis阻塞卡顿 谨慎操作 + keys.parallelStream().forEach(key -> { + String token = StringUtils.substringAfterLast(key, ":"); + // 如果已经过期则跳过 + if (StpUtil.stpLogic.getTokenActiveTimeoutByToken(token) < -1) { + return; + } + LoginUser loginUser = LoginHelper.getLoginUser(token); + if (ObjectUtil.isNotNull(loginUser) && loginUser.getRoles().stream().anyMatch(r -> r.getRoleId().equals(roleId))) { + try { + StpUtil.logoutByTokenValue(token); + } catch (NotLoginException ignored) { + } + } + }); + } +} diff --git a/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysSensitiveServiceImpl.java b/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysSensitiveServiceImpl.java new file mode 100644 index 0000000..6463edc --- /dev/null +++ b/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysSensitiveServiceImpl.java @@ -0,0 +1,42 @@ +package com.ruoyi.system.service.impl; + +import cn.dev33.satoken.stp.StpUtil; +import com.ruoyi.common.core.utils.StringUtils; +import com.ruoyi.common.satoken.utils.LoginHelper; +import com.ruoyi.common.sensitive.core.SensitiveService; +import org.springframework.stereotype.Service; + +/** + * 脱敏服务 + * 默认管理员不过滤 + * 需自行根据业务重写实现 + * + * @author Lion Li + * @version 3.6.0 + */ +@Service +public class SysSensitiveServiceImpl implements SensitiveService { + + /** + * 是否脱敏 + */ + @Override + public boolean isSensitive(String roleKey, String perms) { + if (!LoginHelper.isLogin()) { + return true; + } + boolean roleExist = StringUtils.isNotBlank(roleKey); + boolean permsExist = StringUtils.isNotBlank(perms); + if (roleExist && permsExist) { + if (StpUtil.hasRole(roleKey) && StpUtil.hasPermission(perms)) { + return false; + } + } else if (roleExist && StpUtil.hasRole(roleKey)) { + return false; + } else if (permsExist && StpUtil.hasPermission(perms)) { + return false; + } + return !LoginHelper.isAdmin(); + } + +} diff --git a/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysUserServiceImpl.java b/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysUserServiceImpl.java new file mode 100644 index 0000000..009c57c --- /dev/null +++ b/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysUserServiceImpl.java @@ -0,0 +1,485 @@ +package com.ruoyi.system.service.impl; + +import cn.hutool.core.collection.CollUtil; +import cn.hutool.core.util.ArrayUtil; +import cn.hutool.core.util.ObjectUtil; +import com.baomidou.mybatisplus.core.conditions.Wrapper; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; +import com.baomidou.mybatisplus.core.toolkit.Wrappers; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.ruoyi.common.core.constant.CacheNames; +import com.ruoyi.common.core.constant.UserConstants; +import com.rouyi.common.mybatis.core.page.PageQuery; +import com.ruoyi.system.domain.entity.SysDept; +import com.ruoyi.system.domain.entity.SysRole; +import com.ruoyi.system.domain.entity.SysUser; +import com.rouyi.common.mybatis.core.page.TableDataInfo; +import com.ruoyi.common.core.service.UserService; +import com.ruoyi.common.core.exception.ServiceException; +import com.rouyi.common.mybatis.helper.DataBaseHelper; +import com.ruoyi.common.satoken.utils.LoginHelper; +import com.ruoyi.common.core.utils.StreamUtils; +import com.ruoyi.common.core.utils.StringUtils; +import com.ruoyi.system.domain.entity.SysPost; +import com.ruoyi.system.domain.entity.SysUserPost; +import com.ruoyi.system.domain.entity.SysUserRole; +import com.ruoyi.system.mapper.*; +import com.ruoyi.system.service.ISysUserService; +import lombok.RequiredArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.springframework.cache.annotation.Cacheable; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.Arrays; +import java.util.List; +import java.util.Map; + +/** + * 用户 业务层处理 + * + * @author Lion Li + */ +@Slf4j +@RequiredArgsConstructor +@Service +public class SysUserServiceImpl implements ISysUserService, UserService { + + private final SysUserMapper baseMapper; + private final SysDeptMapper deptMapper; + private final SysRoleMapper roleMapper; + private final SysPostMapper postMapper; + private final SysUserRoleMapper userRoleMapper; + private final SysUserPostMapper userPostMapper; + + @Override + public TableDataInfo selectPageUserList(SysUser user, PageQuery pageQuery) { + Page page = baseMapper.selectPageUserList(pageQuery.build(), this.buildQueryWrapper(user)); + return TableDataInfo.build(page); + } + + /** + * 根据条件分页查询用户列表 + * + * @param user 用户信息 + * @return 用户信息集合信息 + */ + @Override + public List selectUserList(SysUser user) { + return baseMapper.selectUserList(this.buildQueryWrapper(user)); + } + + private Wrapper buildQueryWrapper(SysUser user) { + Map params = user.getParams(); + QueryWrapper wrapper = Wrappers.query(); + wrapper.eq("u.del_flag", UserConstants.USER_NORMAL) + .eq(ObjectUtil.isNotNull(user.getUserId()), "u.user_id", user.getUserId()) + .like(StringUtils.isNotBlank(user.getUserName()), "u.user_name", user.getUserName()) + .eq(StringUtils.isNotBlank(user.getStatus()), "u.status", user.getStatus()) + .like(StringUtils.isNotBlank(user.getPhonenumber()), "u.phonenumber", user.getPhonenumber()) + .between(params.get("beginTime") != null && params.get("endTime") != null, + "u.create_time", params.get("beginTime"), params.get("endTime")) + .and(ObjectUtil.isNotNull(user.getDeptId()), w -> { + List deptList = deptMapper.selectList(new LambdaQueryWrapper() + .select(SysDept::getDeptId) + .apply(DataBaseHelper.findInSet(user.getDeptId(), "ancestors"))); + List ids = StreamUtils.toList(deptList, SysDept::getDeptId); + ids.add(user.getDeptId()); + w.in("u.dept_id", ids); + }); + return wrapper; + } + + /** + * 根据条件分页查询已分配用户角色列表 + * + * @param user 用户信息 + * @return 用户信息集合信息 + */ + @Override + public TableDataInfo selectAllocatedList(SysUser user, PageQuery pageQuery) { + QueryWrapper wrapper = Wrappers.query(); + wrapper.eq("u.del_flag", UserConstants.USER_NORMAL) + .eq(ObjectUtil.isNotNull(user.getRoleId()), "r.role_id", user.getRoleId()) + .like(StringUtils.isNotBlank(user.getUserName()), "u.user_name", user.getUserName()) + .eq(StringUtils.isNotBlank(user.getStatus()), "u.status", user.getStatus()) + .like(StringUtils.isNotBlank(user.getPhonenumber()), "u.phonenumber", user.getPhonenumber()); + Page page = baseMapper.selectAllocatedList(pageQuery.build(), wrapper); + return TableDataInfo.build(page); + } + + /** + * 根据条件分页查询未分配用户角色列表 + * + * @param user 用户信息 + * @return 用户信息集合信息 + */ + @Override + public TableDataInfo selectUnallocatedList(SysUser user, PageQuery pageQuery) { + List userIds = userRoleMapper.selectUserIdsByRoleId(user.getRoleId()); + QueryWrapper wrapper = Wrappers.query(); + wrapper.eq("u.del_flag", UserConstants.USER_NORMAL) + .and(w -> w.ne("r.role_id", user.getRoleId()).or().isNull("r.role_id")) + .notIn(CollUtil.isNotEmpty(userIds), "u.user_id", userIds) + .like(StringUtils.isNotBlank(user.getUserName()), "u.user_name", user.getUserName()) + .like(StringUtils.isNotBlank(user.getPhonenumber()), "u.phonenumber", user.getPhonenumber()); + Page page = baseMapper.selectUnallocatedList(pageQuery.build(), wrapper); + return TableDataInfo.build(page); + } + + /** + * 通过用户名查询用户 + * + * @param userName 用户名 + * @return 用户对象信息 + */ + @Override + public SysUser selectUserByUserName(String userName) { + return baseMapper.selectUserByUserName(userName); + } + + /** + * 通过手机号查询用户 + * + * @param phonenumber 手机号 + * @return 用户对象信息 + */ + @Override + public SysUser selectUserByPhonenumber(String phonenumber) { + return baseMapper.selectUserByPhonenumber(phonenumber); + } + + /** + * 通过用户ID查询用户 + * + * @param userId 用户ID + * @return 用户对象信息 + */ + @Override + public SysUser selectUserById(Long userId) { + return baseMapper.selectUserById(userId); + } + + /** + * 查询用户所属角色组 + * + * @param userName 用户名 + * @return 结果 + */ + @Override + public String selectUserRoleGroup(String userName) { + List list = roleMapper.selectRolesByUserName(userName); + if (CollUtil.isEmpty(list)) { + return StringUtils.EMPTY; + } + return StreamUtils.join(list, SysRole::getRoleName); + } + + /** + * 查询用户所属岗位组 + * + * @param userName 用户名 + * @return 结果 + */ + @Override + public String selectUserPostGroup(String userName) { + List list = postMapper.selectPostsByUserName(userName); + if (CollUtil.isEmpty(list)) { + return StringUtils.EMPTY; + } + return StreamUtils.join(list, SysPost::getPostName); + } + + /** + * 校验用户名称是否唯一 + * + * @param user 用户信息 + * @return 结果 + */ + @Override + public boolean checkUserNameUnique(SysUser user) { + boolean exist = baseMapper.exists(new LambdaQueryWrapper() + .eq(SysUser::getUserName, user.getUserName()) + .ne(ObjectUtil.isNotNull(user.getUserId()), SysUser::getUserId, user.getUserId())); + return !exist; + } + + /** + * 校验手机号码是否唯一 + * + * @param user 用户信息 + */ + @Override + public boolean checkPhoneUnique(SysUser user) { + boolean exist = baseMapper.exists(new LambdaQueryWrapper() + .eq(SysUser::getPhonenumber, user.getPhonenumber()) + .ne(ObjectUtil.isNotNull(user.getUserId()), SysUser::getUserId, user.getUserId())); + return !exist; + } + + /** + * 校验email是否唯一 + * + * @param user 用户信息 + */ + @Override + public boolean checkEmailUnique(SysUser user) { + boolean exist = baseMapper.exists(new LambdaQueryWrapper() + .eq(SysUser::getEmail, user.getEmail()) + .ne(ObjectUtil.isNotNull(user.getUserId()), SysUser::getUserId, user.getUserId())); + return !exist; + } + + /** + * 校验用户是否允许操作 + * + * @param user 用户信息 + */ + @Override + public void checkUserAllowed(SysUser user) { + if (ObjectUtil.isNotNull(user.getUserId()) && user.isAdmin()) { + throw new ServiceException("不允许操作超级管理员用户"); + } + } + + /** + * 校验用户是否有数据权限 + * + * @param userId 用户id + */ + @Override + public void checkUserDataScope(Long userId) { + if (!LoginHelper.isAdmin()) { + SysUser user = new SysUser(); + user.setUserId(userId); + List users = this.selectUserList(user); + if (CollUtil.isEmpty(users)) { + throw new ServiceException("没有权限访问用户数据!"); + } + } + } + + /** + * 新增保存用户信息 + * + * @param user 用户信息 + * @return 结果 + */ + @Override + @Transactional(rollbackFor = Exception.class) + public int insertUser(SysUser user) { + // 新增用户信息 + int rows = baseMapper.insert(user); + // 新增用户岗位关联 + insertUserPost(user); + // 新增用户与角色管理 + insertUserRole(user); + return rows; + } + + /** + * 注册用户信息 + * + * @param user 用户信息 + * @return 结果 + */ + @Override + public boolean registerUser(SysUser user) { + user.setCreateBy(user.getUserName()); + user.setUpdateBy(user.getUserName()); + return baseMapper.insert(user) > 0; + } + + /** + * 修改保存用户信息 + * + * @param user 用户信息 + * @return 结果 + */ + @Override + @Transactional(rollbackFor = Exception.class) + public int updateUser(SysUser user) { + Long userId = user.getUserId(); + // 删除用户与角色关联 + userRoleMapper.delete(new LambdaQueryWrapper().eq(SysUserRole::getUserId, userId)); + // 新增用户与角色管理 + insertUserRole(user); + // 删除用户与岗位关联 + userPostMapper.delete(new LambdaQueryWrapper().eq(SysUserPost::getUserId, userId)); + // 新增用户与岗位管理 + insertUserPost(user); + return baseMapper.updateById(user); + } + + /** + * 用户授权角色 + * + * @param userId 用户ID + * @param roleIds 角色组 + */ + @Override + @Transactional(rollbackFor = Exception.class) + public void insertUserAuth(Long userId, Long[] roleIds) { + userRoleMapper.delete(new LambdaQueryWrapper() + .eq(SysUserRole::getUserId, userId)); + insertUserRole(userId, roleIds); + } + + /** + * 修改用户状态 + * + * @param user 用户信息 + * @return 结果 + */ + @Override + public int updateUserStatus(SysUser user) { + return baseMapper.updateById(user); + } + + /** + * 修改用户基本信息 + * + * @param user 用户信息 + * @return 结果 + */ + @Override + public int updateUserProfile(SysUser user) { + return baseMapper.updateById(user); + } + + /** + * 修改用户头像 + * + * @param userName 用户名 + * @param avatar 头像地址 + * @return 结果 + */ + @Override + public boolean updateUserAvatar(String userName, String avatar) { + return baseMapper.update(null, + new LambdaUpdateWrapper() + .set(SysUser::getAvatar, avatar) + .eq(SysUser::getUserName, userName)) > 0; + } + + /** + * 重置用户密码 + * + * @param user 用户信息 + * @return 结果 + */ + @Override + public int resetPwd(SysUser user) { + return baseMapper.updateById(user); + } + + /** + * 重置用户密码 + * + * @param userName 用户名 + * @param password 密码 + * @return 结果 + */ + @Override + public int resetUserPwd(String userName, String password) { + return baseMapper.update(null, + new LambdaUpdateWrapper() + .set(SysUser::getPassword, password) + .eq(SysUser::getUserName, userName)); + } + + /** + * 新增用户角色信息 + * + * @param user 用户对象 + */ + public void insertUserRole(SysUser user) { + this.insertUserRole(user.getUserId(), user.getRoleIds()); + } + + /** + * 新增用户岗位信息 + * + * @param user 用户对象 + */ + public void insertUserPost(SysUser user) { + Long[] posts = user.getPostIds(); + if (ArrayUtil.isNotEmpty(posts)) { + // 新增用户与岗位管理 + List list = StreamUtils.toList(Arrays.asList(posts), postId -> { + SysUserPost up = new SysUserPost(); + up.setUserId(user.getUserId()); + up.setPostId(postId); + return up; + }); + userPostMapper.insertBatch(list); + } + } + + /** + * 新增用户角色信息 + * + * @param userId 用户ID + * @param roleIds 角色组 + */ + public void insertUserRole(Long userId, Long[] roleIds) { + if (ArrayUtil.isNotEmpty(roleIds)) { + // 新增用户与角色管理 + List list = StreamUtils.toList(Arrays.asList(roleIds), roleId -> { + SysUserRole ur = new SysUserRole(); + ur.setUserId(userId); + ur.setRoleId(roleId); + return ur; + }); + userRoleMapper.insertBatch(list); + } + } + + /** + * 通过用户ID删除用户 + * + * @param userId 用户ID + * @return 结果 + */ + @Override + @Transactional(rollbackFor = Exception.class) + public int deleteUserById(Long userId) { + // 删除用户与角色关联 + userRoleMapper.delete(new LambdaQueryWrapper().eq(SysUserRole::getUserId, userId)); + // 删除用户与岗位表 + userPostMapper.delete(new LambdaQueryWrapper().eq(SysUserPost::getUserId, userId)); + return baseMapper.deleteById(userId); + } + + /** + * 批量删除用户信息 + * + * @param userIds 需要删除的用户ID + * @return 结果 + */ + @Override + @Transactional(rollbackFor = Exception.class) + public int deleteUserByIds(Long[] userIds) { + for (Long userId : userIds) { + checkUserAllowed(new SysUser(userId)); + checkUserDataScope(userId); + } + List ids = Arrays.asList(userIds); + // 删除用户与角色关联 + userRoleMapper.delete(new LambdaQueryWrapper().in(SysUserRole::getUserId, ids)); + // 删除用户与岗位表 + userPostMapper.delete(new LambdaQueryWrapper().in(SysUserPost::getUserId, ids)); + return baseMapper.deleteBatchIds(ids); + } + + @Cacheable(cacheNames = CacheNames.SYS_USER_NAME, key = "#userId") + @Override + public String selectUserNameById(Long userId) { + SysUser sysUser = baseMapper.selectOne(new LambdaQueryWrapper() + .select(SysUser::getUserName).eq(SysUser::getUserId, userId)); + return ObjectUtil.isNull(sysUser) ? null : sysUser.getUserName(); + } + +} diff --git a/ruoyi-modules/ruoyi-system/src/main/resources/mapper/package-info.md b/ruoyi-modules/ruoyi-system/src/main/resources/mapper/package-info.md new file mode 100644 index 0000000..c938b1e --- /dev/null +++ b/ruoyi-modules/ruoyi-system/src/main/resources/mapper/package-info.md @@ -0,0 +1,3 @@ +java包使用 `.` 分割 resource 目录使用 `/` 分割 +
+此文件目的 防止文件夹粘连找不到 `xml` 文件 \ No newline at end of file diff --git a/ruoyi-modules/ruoyi-system/src/main/resources/mapper/system/SysConfigMapper.xml b/ruoyi-modules/ruoyi-system/src/main/resources/mapper/system/SysConfigMapper.xml new file mode 100644 index 0000000..4c0d25a --- /dev/null +++ b/ruoyi-modules/ruoyi-system/src/main/resources/mapper/system/SysConfigMapper.xml @@ -0,0 +1,6 @@ + + + + diff --git a/ruoyi-modules/ruoyi-system/src/main/resources/mapper/system/SysDeptMapper.xml b/ruoyi-modules/ruoyi-system/src/main/resources/mapper/system/SysDeptMapper.xml new file mode 100644 index 0000000..81e6378 --- /dev/null +++ b/ruoyi-modules/ruoyi-system/src/main/resources/mapper/system/SysDeptMapper.xml @@ -0,0 +1,25 @@ + + + + + + + + + + + + diff --git a/ruoyi-modules/ruoyi-system/src/main/resources/mapper/system/SysDictDataMapper.xml b/ruoyi-modules/ruoyi-system/src/main/resources/mapper/system/SysDictDataMapper.xml new file mode 100644 index 0000000..dfc8e0d --- /dev/null +++ b/ruoyi-modules/ruoyi-system/src/main/resources/mapper/system/SysDictDataMapper.xml @@ -0,0 +1,6 @@ + + + + diff --git a/ruoyi-modules/ruoyi-system/src/main/resources/mapper/system/SysDictTypeMapper.xml b/ruoyi-modules/ruoyi-system/src/main/resources/mapper/system/SysDictTypeMapper.xml new file mode 100644 index 0000000..a205559 --- /dev/null +++ b/ruoyi-modules/ruoyi-system/src/main/resources/mapper/system/SysDictTypeMapper.xml @@ -0,0 +1,6 @@ + + + + diff --git a/ruoyi-modules/ruoyi-system/src/main/resources/mapper/system/SysLogininforMapper.xml b/ruoyi-modules/ruoyi-system/src/main/resources/mapper/system/SysLogininforMapper.xml new file mode 100644 index 0000000..103c109 --- /dev/null +++ b/ruoyi-modules/ruoyi-system/src/main/resources/mapper/system/SysLogininforMapper.xml @@ -0,0 +1,6 @@ + + + + diff --git a/ruoyi-modules/ruoyi-system/src/main/resources/mapper/system/SysMenuMapper.xml b/ruoyi-modules/ruoyi-system/src/main/resources/mapper/system/SysMenuMapper.xml new file mode 100644 index 0000000..7174e4c --- /dev/null +++ b/ruoyi-modules/ruoyi-system/src/main/resources/mapper/system/SysMenuMapper.xml @@ -0,0 +1,85 @@ + + + + + + + + + + + + + + + + + + + + diff --git a/ruoyi-modules/ruoyi-system/src/main/resources/mapper/system/SysNoticeMapper.xml b/ruoyi-modules/ruoyi-system/src/main/resources/mapper/system/SysNoticeMapper.xml new file mode 100644 index 0000000..e7aeaf9 --- /dev/null +++ b/ruoyi-modules/ruoyi-system/src/main/resources/mapper/system/SysNoticeMapper.xml @@ -0,0 +1,7 @@ + + + + + diff --git a/ruoyi-modules/ruoyi-system/src/main/resources/mapper/system/SysOperLogMapper.xml b/ruoyi-modules/ruoyi-system/src/main/resources/mapper/system/SysOperLogMapper.xml new file mode 100644 index 0000000..af70259 --- /dev/null +++ b/ruoyi-modules/ruoyi-system/src/main/resources/mapper/system/SysOperLogMapper.xml @@ -0,0 +1,7 @@ + + + + + diff --git a/ruoyi-modules/ruoyi-system/src/main/resources/mapper/system/SysOssConfigMapper.xml b/ruoyi-modules/ruoyi-system/src/main/resources/mapper/system/SysOssConfigMapper.xml new file mode 100644 index 0000000..8af22fe --- /dev/null +++ b/ruoyi-modules/ruoyi-system/src/main/resources/mapper/system/SysOssConfigMapper.xml @@ -0,0 +1,7 @@ + + + + + diff --git a/ruoyi-modules/ruoyi-system/src/main/resources/mapper/system/SysOssMapper.xml b/ruoyi-modules/ruoyi-system/src/main/resources/mapper/system/SysOssMapper.xml new file mode 100644 index 0000000..24714f6 --- /dev/null +++ b/ruoyi-modules/ruoyi-system/src/main/resources/mapper/system/SysOssMapper.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/ruoyi-modules/ruoyi-system/src/main/resources/mapper/system/SysPostMapper.xml b/ruoyi-modules/ruoyi-system/src/main/resources/mapper/system/SysPostMapper.xml new file mode 100644 index 0000000..a9737f5 --- /dev/null +++ b/ruoyi-modules/ruoyi-system/src/main/resources/mapper/system/SysPostMapper.xml @@ -0,0 +1,26 @@ + + + + + + + + + + + + diff --git a/ruoyi-modules/ruoyi-system/src/main/resources/mapper/system/SysRoleDeptMapper.xml b/ruoyi-modules/ruoyi-system/src/main/resources/mapper/system/SysRoleDeptMapper.xml new file mode 100644 index 0000000..94740f4 --- /dev/null +++ b/ruoyi-modules/ruoyi-system/src/main/resources/mapper/system/SysRoleDeptMapper.xml @@ -0,0 +1,7 @@ + + + + + diff --git a/ruoyi-modules/ruoyi-system/src/main/resources/mapper/system/SysRoleMapper.xml b/ruoyi-modules/ruoyi-system/src/main/resources/mapper/system/SysRoleMapper.xml new file mode 100644 index 0000000..ea27055 --- /dev/null +++ b/ruoyi-modules/ruoyi-system/src/main/resources/mapper/system/SysRoleMapper.xml @@ -0,0 +1,57 @@ + + + + + + + + + select distinct r.role_id, + r.role_name, + r.role_key, + r.role_sort, + r.data_scope, + r.menu_check_strictly, + r.dept_check_strictly, + r.status, + r.del_flag, + r.create_time, + r.remark + from sys_role r + left join sys_user_role sur on sur.role_id = r.role_id + left join sys_user u on u.user_id = sur.user_id + left join sys_user us on us.user_name = r.create_by + left join sys_dept d on u.dept_id = d.dept_id + + + + + + + + + + + + + diff --git a/ruoyi-modules/ruoyi-system/src/main/resources/mapper/system/SysRoleMenuMapper.xml b/ruoyi-modules/ruoyi-system/src/main/resources/mapper/system/SysRoleMenuMapper.xml new file mode 100644 index 0000000..e40a242 --- /dev/null +++ b/ruoyi-modules/ruoyi-system/src/main/resources/mapper/system/SysRoleMenuMapper.xml @@ -0,0 +1,7 @@ + + + + + diff --git a/ruoyi-modules/ruoyi-system/src/main/resources/mapper/system/SysUserMapper.xml b/ruoyi-modules/ruoyi-system/src/main/resources/mapper/system/SysUserMapper.xml new file mode 100644 index 0000000..a46062e --- /dev/null +++ b/ruoyi-modules/ruoyi-system/src/main/resources/mapper/system/SysUserMapper.xml @@ -0,0 +1,116 @@ + + + + + + + + + + + + + + + + + + + + + + + select u.user_id, + u.dept_id, + u.user_name, + u.nick_name, + u.user_type, + u.email, + u.avatar, + u.phonenumber, + u.password, + u.sex, + u.status, + u.del_flag, + u.login_ip, + u.login_date, + u.create_by, + u.create_time, + u.remark, + d.dept_id, + d.parent_id, + d.ancestors, + d.dept_name, + d.order_num, + d.leader, + d.status as dept_status, + r.role_id, + r.role_name, + r.role_key, + r.role_sort, + r.data_scope, + r.status as role_status + from sys_user u + left join sys_dept d on u.dept_id = d.dept_id + left join sys_user_role sur on u.user_id = sur.user_id + left join sys_role r on r.role_id = sur.role_id + + + + + + + + + + + + + + + + + + + + diff --git a/ruoyi-modules/ruoyi-system/src/main/resources/mapper/system/SysUserPostMapper.xml b/ruoyi-modules/ruoyi-system/src/main/resources/mapper/system/SysUserPostMapper.xml new file mode 100644 index 0000000..d6dffcd --- /dev/null +++ b/ruoyi-modules/ruoyi-system/src/main/resources/mapper/system/SysUserPostMapper.xml @@ -0,0 +1,7 @@ + + + + + diff --git a/ruoyi-modules/ruoyi-system/src/main/resources/mapper/system/SysUserRoleMapper.xml b/ruoyi-modules/ruoyi-system/src/main/resources/mapper/system/SysUserRoleMapper.xml new file mode 100644 index 0000000..0691b58 --- /dev/null +++ b/ruoyi-modules/ruoyi-system/src/main/resources/mapper/system/SysUserRoleMapper.xml @@ -0,0 +1,12 @@ + + + + + + diff --git a/ruoyi-quartz/src/main/java/com/ruoyi/quartz/config/ScheduleConfig.java b/ruoyi-quartz/src/main/java/com/ruoyi/quartz/config/ScheduleConfig.java deleted file mode 100644 index 7fbea22..0000000 --- a/ruoyi-quartz/src/main/java/com/ruoyi/quartz/config/ScheduleConfig.java +++ /dev/null @@ -1,60 +0,0 @@ -package com.ruoyi.quartz.config; - -import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; -import org.springframework.context.annotation.Bean; -import org.springframework.context.annotation.Conditional; -import org.springframework.context.annotation.Configuration; -import org.springframework.scheduling.quartz.SchedulerFactoryBean; -import javax.sql.DataSource; -import java.util.Properties; - -/** - * 定时任务配置 - * - * @author ruoyi - */ -@Configuration -@ConditionalOnProperty(prefix = "scheduling", name = "enabled", havingValue = "true") -public class ScheduleConfig -{ - @Bean - public SchedulerFactoryBean schedulerFactoryBean(DataSource dataSource) - { - SchedulerFactoryBean factory = new SchedulerFactoryBean(); - factory.setDataSource(dataSource); - - // quartz参数 - Properties prop = new Properties(); - prop.put("org.quartz.scheduler.instanceName", "RuoyiScheduler"); - prop.put("org.quartz.scheduler.instanceId", "AUTO"); - // 线程池配置 - prop.put("org.quartz.threadPool.class", "org.quartz.simpl.SimpleThreadPool"); - prop.put("org.quartz.threadPool.threadCount", "20"); - prop.put("org.quartz.threadPool.threadPriority", "5"); - // JobStore配置 - prop.put("org.quartz.jobStore.class", "org.quartz.impl.jdbcjobstore.JobStoreTX"); - // 集群配置 - prop.put("org.quartz.jobStore.isClustered", "true"); - prop.put("org.quartz.jobStore.clusterCheckinInterval", "15000"); - prop.put("org.quartz.jobStore.maxMisfiresToHandleAtATime", "1"); - prop.put("org.quartz.jobStore.txIsolationLevelSerializable", "true"); - - // sqlserver 启用 - // prop.put("org.quartz.jobStore.selectWithLockSQL", "SELECT * FROM {0}LOCKS UPDLOCK WHERE LOCK_NAME = ?"); - prop.put("org.quartz.jobStore.misfireThreshold", "12000"); - prop.put("org.quartz.jobStore.tablePrefix", "QRTZ_"); - factory.setQuartzProperties(prop); - - factory.setSchedulerName("RuoyiScheduler"); - // 延时启动 - factory.setStartupDelay(1); - factory.setApplicationContextSchedulerContextKey("applicationContextKey"); - // 可选,QuartzScheduler - // 启动时更新己存在的Job,这样就不用每次修改targetObject后删除qrtz_job_details表对应记录了 - factory.setOverwriteExistingJobs(true); - // 设置自动启动,默认为true - factory.setAutoStartup(true); - - return factory; - } -} diff --git a/ruoyi-quartz/src/main/java/com/ruoyi/quartz/controller/SysJobController.java b/ruoyi-quartz/src/main/java/com/ruoyi/quartz/controller/SysJobController.java deleted file mode 100644 index 6a2f975..0000000 --- a/ruoyi-quartz/src/main/java/com/ruoyi/quartz/controller/SysJobController.java +++ /dev/null @@ -1,167 +0,0 @@ -package com.ruoyi.quartz.controller; - -import java.util.List; -import org.quartz.SchedulerException; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.security.access.prepost.PreAuthorize; -import org.springframework.web.bind.annotation.DeleteMapping; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.PathVariable; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.PutMapping; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; -import com.ruoyi.common.annotation.Log; -import com.ruoyi.common.constant.Constants; -import com.ruoyi.common.core.controller.BaseController; -import com.ruoyi.common.core.domain.AjaxResult; -import com.ruoyi.common.core.page.TableDataInfo; -import com.ruoyi.common.enums.BusinessType; -import com.ruoyi.common.exception.job.TaskException; -import com.ruoyi.common.utils.StringUtils; -import com.ruoyi.common.utils.poi.ExcelUtil; -import com.ruoyi.quartz.domain.SysJob; -import com.ruoyi.quartz.service.ISysJobService; -import com.ruoyi.quartz.util.CronUtils; - -/** - * 调度任务信息操作处理 - * - * @author ruoyi - */ -@RestController -@RequestMapping("/monitor/job") -public class SysJobController extends BaseController -{ - @Autowired - private ISysJobService jobService; - - /** - * 查询定时任务列表 - */ - @PreAuthorize("@ss.hasPermi('monitor:job:list')") - @GetMapping("/list") - public TableDataInfo list(SysJob sysJob) - { - startPage(); - List list = jobService.selectJobList(sysJob); - return getDataTable(list); - } - - /** - * 导出定时任务列表 - */ - @PreAuthorize("@ss.hasPermi('monitor:job:export')") - @Log(title = "定时任务", businessType = BusinessType.EXPORT) - @GetMapping("/export") - public AjaxResult export(SysJob sysJob) - { - List list = jobService.selectJobList(sysJob); - ExcelUtil util = new ExcelUtil(SysJob.class); - return util.exportExcel(list, "定时任务"); - } - - /** - * 获取定时任务详细信息 - */ - @PreAuthorize("@ss.hasPermi('monitor:job:query')") - @GetMapping(value = "/{jobId}") - public AjaxResult getInfo(@PathVariable("jobId") Long jobId) - { - return AjaxResult.success(jobService.selectJobById(jobId)); - } - - /** - * 新增定时任务 - */ - @PreAuthorize("@ss.hasPermi('monitor:job:add')") - @Log(title = "定时任务", businessType = BusinessType.INSERT) - @PostMapping - public AjaxResult add(@RequestBody SysJob job) throws SchedulerException, TaskException - { - if (!CronUtils.isValid(job.getCronExpression())) - { - return error("新增任务'" + job.getJobName() + "'失败,Cron表达式不正确"); - } - else if (StringUtils.containsIgnoreCase(job.getInvokeTarget(), Constants.LOOKUP_RMI)) - { - return error("新增任务'" + job.getJobName() + "'失败,目标字符串不允许'rmi://'调用"); - } - else if (StringUtils.containsIgnoreCase(job.getInvokeTarget(), Constants.LOOKUP_LDAP)) - { - return error("新增任务'" + job.getJobName() + "'失败,目标字符串不允许'ldap://'调用"); - } - else if (StringUtils.containsAnyIgnoreCase(job.getInvokeTarget(), new String[] { Constants.HTTP, Constants.HTTPS })) - { - return error("新增任务'" + job.getJobName() + "'失败,目标字符串不允许'http(s)//'调用"); - } - job.setCreateBy(getUserId()); - return toAjax(jobService.insertJob(job)); - } - - /** - * 修改定时任务 - */ - @PreAuthorize("@ss.hasPermi('monitor:job:edit')") - @Log(title = "定时任务", businessType = BusinessType.UPDATE) - @PutMapping - public AjaxResult edit(@RequestBody SysJob job) throws SchedulerException, TaskException - { - if (!CronUtils.isValid(job.getCronExpression())) - { - return error("修改任务'" + job.getJobName() + "'失败,Cron表达式不正确"); - } - else if (StringUtils.containsIgnoreCase(job.getInvokeTarget(), Constants.LOOKUP_RMI)) - { - return error("修改任务'" + job.getJobName() + "'失败,目标字符串不允许'rmi://'调用"); - } - else if (StringUtils.containsIgnoreCase(job.getInvokeTarget(), Constants.LOOKUP_LDAP)) - { - return error("修改任务'" + job.getJobName() + "'失败,目标字符串不允许'ldap://'调用"); - } - else if (StringUtils.containsAnyIgnoreCase(job.getInvokeTarget(), new String[] { Constants.HTTP, Constants.HTTPS })) - { - return error("修改任务'" + job.getJobName() + "'失败,目标字符串不允许'http(s)//'调用"); - } - job.setUpdateBy(getUserId()); - return toAjax(jobService.updateJob(job)); - } - - /** - * 定时任务状态修改 - */ - @PreAuthorize("@ss.hasPermi('monitor:job:changeStatus')") - @Log(title = "定时任务", businessType = BusinessType.UPDATE) - @PutMapping("/changeStatus") - public AjaxResult changeStatus(@RequestBody SysJob job) throws SchedulerException - { - SysJob newJob = jobService.selectJobById(job.getJobId()); - newJob.setStatus(job.getStatus()); - return toAjax(jobService.changeStatus(newJob)); - } - - /** - * 定时任务立即执行一次 - */ - @PreAuthorize("@ss.hasPermi('monitor:job:changeStatus')") - @Log(title = "定时任务", businessType = BusinessType.UPDATE) - @PutMapping("/run") - public AjaxResult run(@RequestBody SysJob job) throws SchedulerException - { - jobService.run(job); - return AjaxResult.success(); - } - - /** - * 删除定时任务 - */ - @PreAuthorize("@ss.hasPermi('monitor:job:remove')") - @Log(title = "定时任务", businessType = BusinessType.DELETE) - @DeleteMapping("/{jobIds}") - public AjaxResult remove(@PathVariable Long[] jobIds) throws SchedulerException, TaskException - { - jobService.deleteJobByIds(jobIds); - return AjaxResult.success(); - } -} diff --git a/ruoyi-quartz/src/main/java/com/ruoyi/quartz/controller/SysJobLogController.java b/ruoyi-quartz/src/main/java/com/ruoyi/quartz/controller/SysJobLogController.java deleted file mode 100644 index b1f8204..0000000 --- a/ruoyi-quartz/src/main/java/com/ruoyi/quartz/controller/SysJobLogController.java +++ /dev/null @@ -1,90 +0,0 @@ -package com.ruoyi.quartz.controller; - -import java.util.List; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.security.access.prepost.PreAuthorize; -import org.springframework.web.bind.annotation.DeleteMapping; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.PathVariable; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; -import com.ruoyi.common.annotation.Log; -import com.ruoyi.common.core.controller.BaseController; -import com.ruoyi.common.core.domain.AjaxResult; -import com.ruoyi.common.core.page.TableDataInfo; -import com.ruoyi.common.enums.BusinessType; -import com.ruoyi.common.utils.poi.ExcelUtil; -import com.ruoyi.quartz.domain.SysJobLog; -import com.ruoyi.quartz.service.ISysJobLogService; - -/** - * 调度日志操作处理 - * - * @author ruoyi - */ -@RestController -@RequestMapping("/monitor/jobLog") -public class SysJobLogController extends BaseController -{ - @Autowired - private ISysJobLogService jobLogService; - - /** - * 查询定时任务调度日志列表 - */ - @PreAuthorize("@ss.hasPermi('monitor:job:list')") - @GetMapping("/list") - public TableDataInfo list(SysJobLog sysJobLog) - { - startPage(); - List list = jobLogService.selectJobLogList(sysJobLog); - return getDataTable(list); - } - - /** - * 导出定时任务调度日志列表 - */ - @PreAuthorize("@ss.hasPermi('monitor:job:export')") - @Log(title = "任务调度日志", businessType = BusinessType.EXPORT) - @GetMapping("/export") - public AjaxResult export(SysJobLog sysJobLog) - { - List list = jobLogService.selectJobLogList(sysJobLog); - ExcelUtil util = new ExcelUtil(SysJobLog.class); - return util.exportExcel(list, "调度日志"); - } - - /** - * 根据调度编号获取详细信息 - */ - @PreAuthorize("@ss.hasPermi('monitor:job:query')") - @GetMapping(value = "/{configId}") - public AjaxResult getInfo(@PathVariable Long jobLogId) - { - return AjaxResult.success(jobLogService.selectJobLogById(jobLogId)); - } - - - /** - * 删除定时任务调度日志 - */ - @PreAuthorize("@ss.hasPermi('monitor:job:remove')") - @Log(title = "定时任务调度日志", businessType = BusinessType.DELETE) - @DeleteMapping("/{jobLogIds}") - public AjaxResult remove(@PathVariable Long[] jobLogIds) - { - return toAjax(jobLogService.deleteJobLogByIds(jobLogIds)); - } - - /** - * 清空定时任务调度日志 - */ - @PreAuthorize("@ss.hasPermi('monitor:job:remove')") - @Log(title = "调度日志", businessType = BusinessType.CLEAN) - @DeleteMapping("/clean") - public AjaxResult clean() - { - jobLogService.cleanJobLog(); - return AjaxResult.success(); - } -} diff --git a/ruoyi-quartz/src/main/java/com/ruoyi/quartz/domain/SysJob.java b/ruoyi-quartz/src/main/java/com/ruoyi/quartz/domain/SysJob.java deleted file mode 100644 index 1f49695..0000000 --- a/ruoyi-quartz/src/main/java/com/ruoyi/quartz/domain/SysJob.java +++ /dev/null @@ -1,171 +0,0 @@ -package com.ruoyi.quartz.domain; - -import java.util.Date; -import javax.validation.constraints.NotBlank; -import javax.validation.constraints.Size; -import org.apache.commons.lang3.builder.ToStringBuilder; -import org.apache.commons.lang3.builder.ToStringStyle; -import com.fasterxml.jackson.annotation.JsonFormat; -import com.ruoyi.common.annotation.Excel; -import com.ruoyi.common.annotation.Excel.ColumnType; -import com.ruoyi.common.constant.ScheduleConstants; -import com.ruoyi.common.core.domain.BaseEntity; -import com.ruoyi.common.utils.StringUtils; -import com.ruoyi.quartz.util.CronUtils; - -/** - * 定时任务调度表 sys_job - * - * @author ruoyi - */ -public class SysJob extends BaseEntity -{ - private static final long serialVersionUID = 1L; - - /** 任务ID */ - @Excel(name = "任务序号", cellType = ColumnType.NUMERIC) - private Long jobId; - - /** 任务名称 */ - @Excel(name = "任务名称") - private String jobName; - - /** 任务组名 */ - @Excel(name = "任务组名") - private String jobGroup; - - /** 调用目标字符串 */ - @Excel(name = "调用目标字符串") - private String invokeTarget; - - /** cron执行表达式 */ - @Excel(name = "执行表达式 ") - private String cronExpression; - - /** cron计划策略 */ - @Excel(name = "计划策略 ", readConverterExp = "0=默认,1=立即触发执行,2=触发一次执行,3=不触发立即执行") - private String misfirePolicy = ScheduleConstants.MISFIRE_DEFAULT; - - /** 是否并发执行(0允许 1禁止) */ - @Excel(name = "并发执行", readConverterExp = "0=允许,1=禁止") - private String concurrent; - - /** 任务状态(0正常 1暂停) */ - @Excel(name = "任务状态", readConverterExp = "0=正常,1=暂停") - private String status; - - public Long getJobId() - { - return jobId; - } - - public void setJobId(Long jobId) - { - this.jobId = jobId; - } - - @NotBlank(message = "任务名称不能为空") - @Size(min = 0, max = 64, message = "任务名称不能超过64个字符") - public String getJobName() - { - return jobName; - } - - public void setJobName(String jobName) - { - this.jobName = jobName; - } - - public String getJobGroup() - { - return jobGroup; - } - - public void setJobGroup(String jobGroup) - { - this.jobGroup = jobGroup; - } - - @NotBlank(message = "调用目标字符串不能为空") - @Size(min = 0, max = 500, message = "调用目标字符串长度不能超过500个字符") - public String getInvokeTarget() - { - return invokeTarget; - } - - public void setInvokeTarget(String invokeTarget) - { - this.invokeTarget = invokeTarget; - } - - @NotBlank(message = "Cron执行表达式不能为空") - @Size(min = 0, max = 255, message = "Cron执行表达式不能超过255个字符") - public String getCronExpression() - { - return cronExpression; - } - - public void setCronExpression(String cronExpression) - { - this.cronExpression = cronExpression; - } - - @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") - public Date getNextValidTime() - { - if (StringUtils.isNotEmpty(cronExpression)) - { - return CronUtils.getNextExecution(cronExpression); - } - return null; - } - - public String getMisfirePolicy() - { - return misfirePolicy; - } - - public void setMisfirePolicy(String misfirePolicy) - { - this.misfirePolicy = misfirePolicy; - } - - public String getConcurrent() - { - return concurrent; - } - - public void setConcurrent(String concurrent) - { - this.concurrent = concurrent; - } - - public String getStatus() - { - return status; - } - - public void setStatus(String status) - { - this.status = status; - } - - @Override - public String toString() { - return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) - .append("jobId", getJobId()) - .append("jobName", getJobName()) - .append("jobGroup", getJobGroup()) - .append("cronExpression", getCronExpression()) - .append("nextValidTime", getNextValidTime()) - .append("misfirePolicy", getMisfirePolicy()) - .append("concurrent", getConcurrent()) - .append("status", getStatus()) - .append("createBy", getCreateBy()) - .append("createTime", getCreateTime()) - .append("updateBy", getUpdateBy()) - .append("updateTime", getUpdateTime()) - .append("remark", getRemark()) - .toString(); - } -} diff --git a/ruoyi-quartz/src/main/java/com/ruoyi/quartz/domain/SysJobLog.java b/ruoyi-quartz/src/main/java/com/ruoyi/quartz/domain/SysJobLog.java deleted file mode 100644 index 121c035..0000000 --- a/ruoyi-quartz/src/main/java/com/ruoyi/quartz/domain/SysJobLog.java +++ /dev/null @@ -1,155 +0,0 @@ -package com.ruoyi.quartz.domain; - -import java.util.Date; -import org.apache.commons.lang3.builder.ToStringBuilder; -import org.apache.commons.lang3.builder.ToStringStyle; -import com.ruoyi.common.annotation.Excel; -import com.ruoyi.common.core.domain.BaseEntity; - -/** - * 定时任务调度日志表 sys_job_log - * - * @author ruoyi - */ -public class SysJobLog extends BaseEntity -{ - private static final long serialVersionUID = 1L; - - /** ID */ - @Excel(name = "日志序号") - private Long jobLogId; - - /** 任务名称 */ - @Excel(name = "任务名称") - private String jobName; - - /** 任务组名 */ - @Excel(name = "任务组名") - private String jobGroup; - - /** 调用目标字符串 */ - @Excel(name = "调用目标字符串") - private String invokeTarget; - - /** 日志信息 */ - @Excel(name = "日志信息") - private String jobMessage; - - /** 执行状态(0正常 1失败) */ - @Excel(name = "执行状态", readConverterExp = "0=正常,1=失败") - private String status; - - /** 异常信息 */ - @Excel(name = "异常信息") - private String exceptionInfo; - - /** 开始时间 */ - private Date startTime; - - /** 停止时间 */ - private Date stopTime; - - public Long getJobLogId() - { - return jobLogId; - } - - public void setJobLogId(Long jobLogId) - { - this.jobLogId = jobLogId; - } - - public String getJobName() - { - return jobName; - } - - public void setJobName(String jobName) - { - this.jobName = jobName; - } - - public String getJobGroup() - { - return jobGroup; - } - - public void setJobGroup(String jobGroup) - { - this.jobGroup = jobGroup; - } - - public String getInvokeTarget() - { - return invokeTarget; - } - - public void setInvokeTarget(String invokeTarget) - { - this.invokeTarget = invokeTarget; - } - - public String getJobMessage() - { - return jobMessage; - } - - public void setJobMessage(String jobMessage) - { - this.jobMessage = jobMessage; - } - - public String getStatus() - { - return status; - } - - public void setStatus(String status) - { - this.status = status; - } - - public String getExceptionInfo() - { - return exceptionInfo; - } - - public void setExceptionInfo(String exceptionInfo) - { - this.exceptionInfo = exceptionInfo; - } - - public Date getStartTime() - { - return startTime; - } - - public void setStartTime(Date startTime) - { - this.startTime = startTime; - } - - public Date getStopTime() - { - return stopTime; - } - - public void setStopTime(Date stopTime) - { - this.stopTime = stopTime; - } - - @Override - public String toString() { - return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) - .append("jobLogId", getJobLogId()) - .append("jobName", getJobName()) - .append("jobGroup", getJobGroup()) - .append("jobMessage", getJobMessage()) - .append("status", getStatus()) - .append("exceptionInfo", getExceptionInfo()) - .append("startTime", getStartTime()) - .append("stopTime", getStopTime()) - .toString(); - } -} diff --git a/ruoyi-quartz/src/main/java/com/ruoyi/quartz/mapper/SysJobLogMapper.java b/ruoyi-quartz/src/main/java/com/ruoyi/quartz/mapper/SysJobLogMapper.java deleted file mode 100644 index 727d916..0000000 --- a/ruoyi-quartz/src/main/java/com/ruoyi/quartz/mapper/SysJobLogMapper.java +++ /dev/null @@ -1,64 +0,0 @@ -package com.ruoyi.quartz.mapper; - -import java.util.List; -import com.ruoyi.quartz.domain.SysJobLog; - -/** - * 调度任务日志信息 数据层 - * - * @author ruoyi - */ -public interface SysJobLogMapper -{ - /** - * 获取quartz调度器日志的计划任务 - * - * @param jobLog 调度日志信息 - * @return 调度任务日志集合 - */ - public List selectJobLogList(SysJobLog jobLog); - - /** - * 查询所有调度任务日志 - * - * @return 调度任务日志列表 - */ - public List selectJobLogAll(); - - /** - * 通过调度任务日志ID查询调度信息 - * - * @param jobLogId 调度任务日志ID - * @return 调度任务日志对象信息 - */ - public SysJobLog selectJobLogById(Long jobLogId); - - /** - * 新增任务日志 - * - * @param jobLog 调度日志信息 - * @return 结果 - */ - public int insertJobLog(SysJobLog jobLog); - - /** - * 批量删除调度日志信息 - * - * @param logIds 需要删除的数据ID - * @return 结果 - */ - public int deleteJobLogByIds(Long[] logIds); - - /** - * 删除任务日志 - * - * @param jobId 调度日志ID - * @return 结果 - */ - public int deleteJobLogById(Long jobId); - - /** - * 清空任务日志 - */ - public void cleanJobLog(); -} diff --git a/ruoyi-quartz/src/main/java/com/ruoyi/quartz/mapper/SysJobMapper.java b/ruoyi-quartz/src/main/java/com/ruoyi/quartz/mapper/SysJobMapper.java deleted file mode 100644 index 20f45db..0000000 --- a/ruoyi-quartz/src/main/java/com/ruoyi/quartz/mapper/SysJobMapper.java +++ /dev/null @@ -1,67 +0,0 @@ -package com.ruoyi.quartz.mapper; - -import java.util.List; -import com.ruoyi.quartz.domain.SysJob; - -/** - * 调度任务信息 数据层 - * - * @author ruoyi - */ -public interface SysJobMapper -{ - /** - * 查询调度任务日志集合 - * - * @param job 调度信息 - * @return 操作日志集合 - */ - public List selectJobList(SysJob job); - - /** - * 查询所有调度任务 - * - * @return 调度任务列表 - */ - public List selectJobAll(); - - /** - * 通过调度ID查询调度任务信息 - * - * @param jobId 调度ID - * @return 角色对象信息 - */ - public SysJob selectJobById(Long jobId); - - /** - * 通过调度ID删除调度任务信息 - * - * @param jobId 调度ID - * @return 结果 - */ - public int deleteJobById(Long jobId); - - /** - * 批量删除调度任务信息 - * - * @param ids 需要删除的数据ID - * @return 结果 - */ - public int deleteJobByIds(Long[] ids); - - /** - * 修改调度任务信息 - * - * @param job 调度任务信息 - * @return 结果 - */ - public int updateJob(SysJob job); - - /** - * 新增调度任务信息 - * - * @param job 调度任务信息 - * @return 结果 - */ - public int insertJob(SysJob job); -} diff --git a/ruoyi-quartz/src/main/java/com/ruoyi/quartz/service/ISysJobLogService.java b/ruoyi-quartz/src/main/java/com/ruoyi/quartz/service/ISysJobLogService.java deleted file mode 100644 index 8546792..0000000 --- a/ruoyi-quartz/src/main/java/com/ruoyi/quartz/service/ISysJobLogService.java +++ /dev/null @@ -1,56 +0,0 @@ -package com.ruoyi.quartz.service; - -import java.util.List; -import com.ruoyi.quartz.domain.SysJobLog; - -/** - * 定时任务调度日志信息信息 服务层 - * - * @author ruoyi - */ -public interface ISysJobLogService -{ - /** - * 获取quartz调度器日志的计划任务 - * - * @param jobLog 调度日志信息 - * @return 调度任务日志集合 - */ - public List selectJobLogList(SysJobLog jobLog); - - /** - * 通过调度任务日志ID查询调度信息 - * - * @param jobLogId 调度任务日志ID - * @return 调度任务日志对象信息 - */ - public SysJobLog selectJobLogById(Long jobLogId); - - /** - * 新增任务日志 - * - * @param jobLog 调度日志信息 - */ - public void addJobLog(SysJobLog jobLog); - - /** - * 批量删除调度日志信息 - * - * @param logIds 需要删除的日志ID - * @return 结果 - */ - public int deleteJobLogByIds(Long[] logIds); - - /** - * 删除任务日志 - * - * @param jobId 调度日志ID - * @return 结果 - */ - public int deleteJobLogById(Long jobId); - - /** - * 清空任务日志 - */ - public void cleanJobLog(); -} diff --git a/ruoyi-quartz/src/main/java/com/ruoyi/quartz/service/ISysJobService.java b/ruoyi-quartz/src/main/java/com/ruoyi/quartz/service/ISysJobService.java deleted file mode 100644 index 6d62661..0000000 --- a/ruoyi-quartz/src/main/java/com/ruoyi/quartz/service/ISysJobService.java +++ /dev/null @@ -1,102 +0,0 @@ -package com.ruoyi.quartz.service; - -import java.util.List; -import org.quartz.SchedulerException; -import com.ruoyi.common.exception.job.TaskException; -import com.ruoyi.quartz.domain.SysJob; - -/** - * 定时任务调度信息信息 服务层 - * - * @author ruoyi - */ -public interface ISysJobService -{ - /** - * 获取quartz调度器的计划任务 - * - * @param job 调度信息 - * @return 调度任务集合 - */ - public List selectJobList(SysJob job); - - /** - * 通过调度任务ID查询调度信息 - * - * @param jobId 调度任务ID - * @return 调度任务对象信息 - */ - public SysJob selectJobById(Long jobId); - - /** - * 暂停任务 - * - * @param job 调度信息 - * @return 结果 - */ - public int pauseJob(SysJob job) throws SchedulerException; - - /** - * 恢复任务 - * - * @param job 调度信息 - * @return 结果 - */ - public int resumeJob(SysJob job) throws SchedulerException; - - /** - * 删除任务后,所对应的trigger也将被删除 - * - * @param job 调度信息 - * @return 结果 - */ - public int deleteJob(SysJob job) throws SchedulerException; - - /** - * 批量删除调度信息 - * - * @param jobIds 需要删除的任务ID - * @return 结果 - */ - public void deleteJobByIds(Long[] jobIds) throws SchedulerException; - - /** - * 任务调度状态修改 - * - * @param job 调度信息 - * @return 结果 - */ - public int changeStatus(SysJob job) throws SchedulerException; - - /** - * 立即运行任务 - * - * @param job 调度信息 - * @return 结果 - */ - public void run(SysJob job) throws SchedulerException; - - /** - * 新增任务 - * - * @param job 调度信息 - * @return 结果 - */ - public int insertJob(SysJob job) throws SchedulerException, TaskException; - - /** - * 更新任务 - * - * @param job 调度信息 - * @return 结果 - */ - public int updateJob(SysJob job) throws SchedulerException, TaskException; - - /** - * 校验cron表达式是否有效 - * - * @param cronExpression 表达式 - * @return 结果 - */ - public boolean checkCronExpressionIsValid(String cronExpression); -} diff --git a/ruoyi-quartz/src/main/java/com/ruoyi/quartz/service/impl/SysJobLogServiceImpl.java b/ruoyi-quartz/src/main/java/com/ruoyi/quartz/service/impl/SysJobLogServiceImpl.java deleted file mode 100644 index 812eed7..0000000 --- a/ruoyi-quartz/src/main/java/com/ruoyi/quartz/service/impl/SysJobLogServiceImpl.java +++ /dev/null @@ -1,87 +0,0 @@ -package com.ruoyi.quartz.service.impl; - -import java.util.List; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; -import com.ruoyi.quartz.domain.SysJobLog; -import com.ruoyi.quartz.mapper.SysJobLogMapper; -import com.ruoyi.quartz.service.ISysJobLogService; - -/** - * 定时任务调度日志信息 服务层 - * - * @author ruoyi - */ -@Service -public class SysJobLogServiceImpl implements ISysJobLogService -{ - @Autowired - private SysJobLogMapper jobLogMapper; - - /** - * 获取quartz调度器日志的计划任务 - * - * @param jobLog 调度日志信息 - * @return 调度任务日志集合 - */ - @Override - public List selectJobLogList(SysJobLog jobLog) - { - return jobLogMapper.selectJobLogList(jobLog); - } - - /** - * 通过调度任务日志ID查询调度信息 - * - * @param jobLogId 调度任务日志ID - * @return 调度任务日志对象信息 - */ - @Override - public SysJobLog selectJobLogById(Long jobLogId) - { - return jobLogMapper.selectJobLogById(jobLogId); - } - - /** - * 新增任务日志 - * - * @param jobLog 调度日志信息 - */ - @Override - public void addJobLog(SysJobLog jobLog) - { - jobLogMapper.insertJobLog(jobLog); - } - - /** - * 批量删除调度日志信息 - * - * @param logIds 需要删除的数据ID - * @return 结果 - */ - @Override - public int deleteJobLogByIds(Long[] logIds) - { - return jobLogMapper.deleteJobLogByIds(logIds); - } - - /** - * 删除任务日志 - * - * @param jobId 调度日志ID - */ - @Override - public int deleteJobLogById(Long jobId) - { - return jobLogMapper.deleteJobLogById(jobId); - } - - /** - * 清空任务日志 - */ - @Override - public void cleanJobLog() - { - jobLogMapper.cleanJobLog(); - } -} diff --git a/ruoyi-quartz/src/main/java/com/ruoyi/quartz/service/impl/SysJobServiceImpl.java b/ruoyi-quartz/src/main/java/com/ruoyi/quartz/service/impl/SysJobServiceImpl.java deleted file mode 100644 index 0d9a53d..0000000 --- a/ruoyi-quartz/src/main/java/com/ruoyi/quartz/service/impl/SysJobServiceImpl.java +++ /dev/null @@ -1,254 +0,0 @@ -package com.ruoyi.quartz.service.impl; - -import java.util.List; -import javax.annotation.PostConstruct; -import org.quartz.JobDataMap; -import org.quartz.JobKey; -import org.quartz.Scheduler; -import org.quartz.SchedulerException; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; -import org.springframework.transaction.annotation.Transactional; -import com.ruoyi.common.constant.ScheduleConstants; -import com.ruoyi.common.exception.job.TaskException; -import com.ruoyi.quartz.domain.SysJob; -import com.ruoyi.quartz.mapper.SysJobMapper; -import com.ruoyi.quartz.service.ISysJobService; -import com.ruoyi.quartz.util.CronUtils; -import com.ruoyi.quartz.util.ScheduleUtils; - -/** - * 定时任务调度信息 服务层 - * - * @author ruoyi - */ -@Service -public class SysJobServiceImpl implements ISysJobService -{ - @Autowired - private Scheduler scheduler; - - @Autowired - private SysJobMapper jobMapper; - - /** - * 项目启动时,初始化定时器 主要是防止手动修改数据库导致未同步到定时任务处理(注:不能手动修改数据库ID和任务组名,否则会导致脏数据) - */ - @PostConstruct - public void init() throws SchedulerException, TaskException - { - scheduler.clear(); - List jobList = jobMapper.selectJobAll(); - for (SysJob job : jobList) - { - ScheduleUtils.createScheduleJob(scheduler, job); - } - } - - /** - * 获取quartz调度器的计划任务列表 - * - * @param job 调度信息 - * @return - */ - @Override - public List selectJobList(SysJob job) - { - return jobMapper.selectJobList(job); - } - - /** - * 通过调度任务ID查询调度信息 - * - * @param jobId 调度任务ID - * @return 调度任务对象信息 - */ - @Override - public SysJob selectJobById(Long jobId) - { - return jobMapper.selectJobById(jobId); - } - - /** - * 暂停任务 - * - * @param job 调度信息 - */ - @Override - @Transactional(rollbackFor = Exception.class) - public int pauseJob(SysJob job) throws SchedulerException - { - Long jobId = job.getJobId(); - String jobGroup = job.getJobGroup(); - job.setStatus(ScheduleConstants.Status.PAUSE.getValue()); - int rows = jobMapper.updateJob(job); - if (rows > 0) - { - scheduler.pauseJob(ScheduleUtils.getJobKey(jobId, jobGroup)); - } - return rows; - } - - /** - * 恢复任务 - * - * @param job 调度信息 - */ - @Override - @Transactional(rollbackFor = Exception.class) - public int resumeJob(SysJob job) throws SchedulerException - { - Long jobId = job.getJobId(); - String jobGroup = job.getJobGroup(); - job.setStatus(ScheduleConstants.Status.NORMAL.getValue()); - int rows = jobMapper.updateJob(job); - if (rows > 0) - { - scheduler.resumeJob(ScheduleUtils.getJobKey(jobId, jobGroup)); - } - return rows; - } - - /** - * 删除任务后,所对应的trigger也将被删除 - * - * @param job 调度信息 - */ - @Override - @Transactional(rollbackFor = Exception.class) - public int deleteJob(SysJob job) throws SchedulerException - { - Long jobId = job.getJobId(); - String jobGroup = job.getJobGroup(); - int rows = jobMapper.deleteJobById(jobId); - if (rows > 0) - { - scheduler.deleteJob(ScheduleUtils.getJobKey(jobId, jobGroup)); - } - return rows; - } - - /** - * 批量删除调度信息 - * - * @param jobIds 需要删除的任务ID - * @return 结果 - */ - @Override - @Transactional(rollbackFor = Exception.class) - public void deleteJobByIds(Long[] jobIds) throws SchedulerException - { - for (Long jobId : jobIds) - { - SysJob job = jobMapper.selectJobById(jobId); - deleteJob(job); - } - } - - /** - * 任务调度状态修改 - * - * @param job 调度信息 - */ - @Override - @Transactional(rollbackFor = Exception.class) - public int changeStatus(SysJob job) throws SchedulerException - { - int rows = 0; - String status = job.getStatus(); - if (ScheduleConstants.Status.NORMAL.getValue().equals(status)) - { - rows = resumeJob(job); - } - else if (ScheduleConstants.Status.PAUSE.getValue().equals(status)) - { - rows = pauseJob(job); - } - return rows; - } - - /** - * 立即运行任务 - * - * @param job 调度信息 - */ - @Override - @Transactional(rollbackFor = Exception.class) - public void run(SysJob job) throws SchedulerException - { - Long jobId = job.getJobId(); - String jobGroup = job.getJobGroup(); - SysJob properties = selectJobById(job.getJobId()); - // 参数 - JobDataMap dataMap = new JobDataMap(); - dataMap.put(ScheduleConstants.TASK_PROPERTIES, properties); - scheduler.triggerJob(ScheduleUtils.getJobKey(jobId, jobGroup), dataMap); - } - - /** - * 新增任务 - * - * @param job 调度信息 调度信息 - */ - @Override - @Transactional(rollbackFor = Exception.class) - public int insertJob(SysJob job) throws SchedulerException, TaskException - { - job.setStatus(ScheduleConstants.Status.PAUSE.getValue()); - int rows = jobMapper.insertJob(job); - if (rows > 0) - { - ScheduleUtils.createScheduleJob(scheduler, job); - } - return rows; - } - - /** - * 更新任务的时间表达式 - * - * @param job 调度信息 - */ - @Override - @Transactional(rollbackFor = Exception.class) - public int updateJob(SysJob job) throws SchedulerException, TaskException - { - SysJob properties = selectJobById(job.getJobId()); - int rows = jobMapper.updateJob(job); - if (rows > 0) - { - updateSchedulerJob(job, properties.getJobGroup()); - } - return rows; - } - - /** - * 更新任务 - * - * @param job 任务对象 - * @param jobGroup 任务组名 - */ - public void updateSchedulerJob(SysJob job, String jobGroup) throws SchedulerException, TaskException - { - Long jobId = job.getJobId(); - // 判断是否存在 - JobKey jobKey = ScheduleUtils.getJobKey(jobId, jobGroup); - if (scheduler.checkExists(jobKey)) - { - // 防止创建时存在数据问题 先移除,然后在执行创建操作 - scheduler.deleteJob(jobKey); - } - ScheduleUtils.createScheduleJob(scheduler, job); - } - - /** - * 校验cron表达式是否有效 - * - * @param cronExpression 表达式 - * @return 结果 - */ - @Override - public boolean checkCronExpressionIsValid(String cronExpression) - { - return CronUtils.isValid(cronExpression); - } -} diff --git a/ruoyi-quartz/src/main/java/com/ruoyi/quartz/task/RyTask.java b/ruoyi-quartz/src/main/java/com/ruoyi/quartz/task/RyTask.java deleted file mode 100644 index 853243b..0000000 --- a/ruoyi-quartz/src/main/java/com/ruoyi/quartz/task/RyTask.java +++ /dev/null @@ -1,28 +0,0 @@ -package com.ruoyi.quartz.task; - -import org.springframework.stereotype.Component; -import com.ruoyi.common.utils.StringUtils; - -/** - * 定时任务调度测试 - * - * @author ruoyi - */ -@Component("ryTask") -public class RyTask -{ - public void ryMultipleParams(String s, Boolean b, Long l, Double d, Integer i) - { - System.out.println(StringUtils.format("执行多参方法: 字符串类型{},布尔类型{},长整型{},浮点型{},整形{}", s, b, l, d, i)); - } - - public void ryParams(String params) - { - System.out.println("执行有参方法:" + params); - } - - public void ryNoParams() - { - System.out.println("执行无参方法"); - } -} diff --git a/ruoyi-quartz/src/main/java/com/ruoyi/quartz/util/AbstractQuartzJob.java b/ruoyi-quartz/src/main/java/com/ruoyi/quartz/util/AbstractQuartzJob.java deleted file mode 100644 index 731a5eb..0000000 --- a/ruoyi-quartz/src/main/java/com/ruoyi/quartz/util/AbstractQuartzJob.java +++ /dev/null @@ -1,107 +0,0 @@ -package com.ruoyi.quartz.util; - -import java.util.Date; -import org.quartz.Job; -import org.quartz.JobExecutionContext; -import org.quartz.JobExecutionException; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import com.ruoyi.common.constant.Constants; -import com.ruoyi.common.constant.ScheduleConstants; -import com.ruoyi.common.utils.ExceptionUtil; -import com.ruoyi.common.utils.StringUtils; -import com.ruoyi.common.utils.bean.BeanUtils; -import com.ruoyi.common.utils.spring.SpringUtils; -import com.ruoyi.quartz.domain.SysJob; -import com.ruoyi.quartz.domain.SysJobLog; -import com.ruoyi.quartz.service.ISysJobLogService; - -/** - * 抽象quartz调用 - * - * @author ruoyi - */ -public abstract class AbstractQuartzJob implements Job -{ - private static final Logger log = LoggerFactory.getLogger(AbstractQuartzJob.class); - - /** - * 线程本地变量 - */ - private static ThreadLocal threadLocal = new ThreadLocal<>(); - - @Override - public void execute(JobExecutionContext context) throws JobExecutionException - { - SysJob sysJob = new SysJob(); - BeanUtils.copyBeanProp(sysJob, context.getMergedJobDataMap().get(ScheduleConstants.TASK_PROPERTIES)); - try - { - before(context, sysJob); - if (sysJob != null) - { - doExecute(context, sysJob); - } - after(context, sysJob, null); - } - catch (Exception e) - { - log.error("任务执行异常 - :", e); - after(context, sysJob, e); - } - } - - /** - * 执行前 - * - * @param context 工作执行上下文对象 - * @param sysJob 系统计划任务 - */ - protected void before(JobExecutionContext context, SysJob sysJob) - { - threadLocal.set(new Date()); - } - - /** - * 执行后 - * - * @param context 工作执行上下文对象 - * @param sysJob 系统计划任务 - */ - protected void after(JobExecutionContext context, SysJob sysJob, Exception e) - { - Date startTime = threadLocal.get(); - threadLocal.remove(); - - final SysJobLog sysJobLog = new SysJobLog(); - sysJobLog.setJobName(sysJob.getJobName()); - sysJobLog.setJobGroup(sysJob.getJobGroup()); - sysJobLog.setInvokeTarget(sysJob.getInvokeTarget()); - sysJobLog.setStartTime(startTime); - sysJobLog.setStopTime(new Date()); - long runMs = sysJobLog.getStopTime().getTime() - sysJobLog.getStartTime().getTime(); - sysJobLog.setJobMessage(sysJobLog.getJobName() + " 总共耗时:" + runMs + "毫秒"); - if (e != null) - { - sysJobLog.setStatus(Constants.FAIL); - String errorMsg = StringUtils.substring(ExceptionUtil.getExceptionMessage(e), 0, 2000); - sysJobLog.setExceptionInfo(errorMsg); - } - else - { - sysJobLog.setStatus(Constants.SUCCESS); - } - - // 写入数据库当中 - SpringUtils.getBean(ISysJobLogService.class).addJobLog(sysJobLog); - } - - /** - * 执行方法,由子类重载 - * - * @param context 工作执行上下文对象 - * @param sysJob 系统计划任务 - * @throws Exception 执行过程中的异常 - */ - protected abstract void doExecute(JobExecutionContext context, SysJob sysJob) throws Exception; -} diff --git a/ruoyi-quartz/src/main/java/com/ruoyi/quartz/util/CronUtils.java b/ruoyi-quartz/src/main/java/com/ruoyi/quartz/util/CronUtils.java deleted file mode 100644 index dd53839..0000000 --- a/ruoyi-quartz/src/main/java/com/ruoyi/quartz/util/CronUtils.java +++ /dev/null @@ -1,63 +0,0 @@ -package com.ruoyi.quartz.util; - -import java.text.ParseException; -import java.util.Date; -import org.quartz.CronExpression; - -/** - * cron表达式工具类 - * - * @author ruoyi - * - */ -public class CronUtils -{ - /** - * 返回一个布尔值代表一个给定的Cron表达式的有效性 - * - * @param cronExpression Cron表达式 - * @return boolean 表达式是否有效 - */ - public static boolean isValid(String cronExpression) - { - return CronExpression.isValidExpression(cronExpression); - } - - /** - * 返回一个字符串值,表示该消息无效Cron表达式给出有效性 - * - * @param cronExpression Cron表达式 - * @return String 无效时返回表达式错误描述,如果有效返回null - */ - public static String getInvalidMessage(String cronExpression) - { - try - { - new CronExpression(cronExpression); - return null; - } - catch (ParseException pe) - { - return pe.getMessage(); - } - } - - /** - * 返回下一个执行时间根据给定的Cron表达式 - * - * @param cronExpression Cron表达式 - * @return Date 下次Cron表达式执行时间 - */ - public static Date getNextExecution(String cronExpression) - { - try - { - CronExpression cron = new CronExpression(cronExpression); - return cron.getNextValidTimeAfter(new Date(System.currentTimeMillis())); - } - catch (ParseException e) - { - throw new IllegalArgumentException(e.getMessage()); - } - } -} diff --git a/ruoyi-quartz/src/main/java/com/ruoyi/quartz/util/JobInvokeUtil.java b/ruoyi-quartz/src/main/java/com/ruoyi/quartz/util/JobInvokeUtil.java deleted file mode 100644 index 40a19bd..0000000 --- a/ruoyi-quartz/src/main/java/com/ruoyi/quartz/util/JobInvokeUtil.java +++ /dev/null @@ -1,182 +0,0 @@ -package com.ruoyi.quartz.util; - -import java.lang.reflect.InvocationTargetException; -import java.lang.reflect.Method; -import java.util.LinkedList; -import java.util.List; -import com.ruoyi.common.utils.StringUtils; -import com.ruoyi.common.utils.spring.SpringUtils; -import com.ruoyi.quartz.domain.SysJob; - -/** - * 任务执行工具 - * - * @author ruoyi - */ -public class JobInvokeUtil -{ - /** - * 执行方法 - * - * @param sysJob 系统任务 - */ - public static void invokeMethod(SysJob sysJob) throws Exception - { - String invokeTarget = sysJob.getInvokeTarget(); - String beanName = getBeanName(invokeTarget); - String methodName = getMethodName(invokeTarget); - List methodParams = getMethodParams(invokeTarget); - - if (!isValidClassName(beanName)) - { - Object bean = SpringUtils.getBean(beanName); - invokeMethod(bean, methodName, methodParams); - } - else - { - Object bean = Class.forName(beanName).newInstance(); - invokeMethod(bean, methodName, methodParams); - } - } - - /** - * 调用任务方法 - * - * @param bean 目标对象 - * @param methodName 方法名称 - * @param methodParams 方法参数 - */ - private static void invokeMethod(Object bean, String methodName, List methodParams) - throws NoSuchMethodException, SecurityException, IllegalAccessException, IllegalArgumentException, - InvocationTargetException - { - if (StringUtils.isNotNull(methodParams) && methodParams.size() > 0) - { - Method method = bean.getClass().getDeclaredMethod(methodName, getMethodParamsType(methodParams)); - method.invoke(bean, getMethodParamsValue(methodParams)); - } - else - { - Method method = bean.getClass().getDeclaredMethod(methodName); - method.invoke(bean); - } - } - - /** - * 校验是否为为class包名 - * - * @param str 名称 - * @return true是 false否 - */ - public static boolean isValidClassName(String invokeTarget) - { - return StringUtils.countMatches(invokeTarget, ".") > 1; - } - - /** - * 获取bean名称 - * - * @param invokeTarget 目标字符串 - * @return bean名称 - */ - public static String getBeanName(String invokeTarget) - { - String beanName = StringUtils.substringBefore(invokeTarget, "("); - return StringUtils.substringBeforeLast(beanName, "."); - } - - /** - * 获取bean方法 - * - * @param invokeTarget 目标字符串 - * @return method方法 - */ - public static String getMethodName(String invokeTarget) - { - String methodName = StringUtils.substringBefore(invokeTarget, "("); - return StringUtils.substringAfterLast(methodName, "."); - } - - /** - * 获取method方法参数相关列表 - * - * @param invokeTarget 目标字符串 - * @return method方法相关参数列表 - */ - public static List getMethodParams(String invokeTarget) - { - String methodStr = StringUtils.substringBetween(invokeTarget, "(", ")"); - if (StringUtils.isEmpty(methodStr)) - { - return null; - } - String[] methodParams = methodStr.split(","); - List classs = new LinkedList<>(); - for (int i = 0; i < methodParams.length; i++) - { - String str = StringUtils.trimToEmpty(methodParams[i]); - // String字符串类型,包含' - if (StringUtils.contains(str, "'")) - { - classs.add(new Object[] { StringUtils.replace(str, "'", ""), String.class }); - } - // boolean布尔类型,等于true或者false - else if (StringUtils.equals(str, "true") || StringUtils.equalsIgnoreCase(str, "false")) - { - classs.add(new Object[] { Boolean.valueOf(str), Boolean.class }); - } - // long长整形,包含L - else if (StringUtils.containsIgnoreCase(str, "L")) - { - classs.add(new Object[] { Long.valueOf(StringUtils.replaceIgnoreCase(str, "L", "")), Long.class }); - } - // double浮点类型,包含D - else if (StringUtils.containsIgnoreCase(str, "D")) - { - classs.add(new Object[] { Double.valueOf(StringUtils.replaceIgnoreCase(str, "D", "")), Double.class }); - } - // 其他类型归类为整形 - else - { - classs.add(new Object[] { Integer.valueOf(str), Integer.class }); - } - } - return classs; - } - - /** - * 获取参数类型 - * - * @param methodParams 参数相关列表 - * @return 参数类型列表 - */ - public static Class[] getMethodParamsType(List methodParams) - { - Class[] classs = new Class[methodParams.size()]; - int index = 0; - for (Object[] os : methodParams) - { - classs[index] = (Class) os[1]; - index++; - } - return classs; - } - - /** - * 获取参数值 - * - * @param methodParams 参数相关列表 - * @return 参数值列表 - */ - public static Object[] getMethodParamsValue(List methodParams) - { - Object[] classs = new Object[methodParams.size()]; - int index = 0; - for (Object[] os : methodParams) - { - classs[index] = (Object) os[0]; - index++; - } - return classs; - } -} diff --git a/ruoyi-quartz/src/main/java/com/ruoyi/quartz/util/QuartzDisallowConcurrentExecution.java b/ruoyi-quartz/src/main/java/com/ruoyi/quartz/util/QuartzDisallowConcurrentExecution.java deleted file mode 100644 index 5e13558..0000000 --- a/ruoyi-quartz/src/main/java/com/ruoyi/quartz/util/QuartzDisallowConcurrentExecution.java +++ /dev/null @@ -1,21 +0,0 @@ -package com.ruoyi.quartz.util; - -import org.quartz.DisallowConcurrentExecution; -import org.quartz.JobExecutionContext; -import com.ruoyi.quartz.domain.SysJob; - -/** - * 定时任务处理(禁止并发执行) - * - * @author ruoyi - * - */ -@DisallowConcurrentExecution -public class QuartzDisallowConcurrentExecution extends AbstractQuartzJob -{ - @Override - protected void doExecute(JobExecutionContext context, SysJob sysJob) throws Exception - { - JobInvokeUtil.invokeMethod(sysJob); - } -} diff --git a/ruoyi-quartz/src/main/java/com/ruoyi/quartz/util/QuartzJobExecution.java b/ruoyi-quartz/src/main/java/com/ruoyi/quartz/util/QuartzJobExecution.java deleted file mode 100644 index e975326..0000000 --- a/ruoyi-quartz/src/main/java/com/ruoyi/quartz/util/QuartzJobExecution.java +++ /dev/null @@ -1,19 +0,0 @@ -package com.ruoyi.quartz.util; - -import org.quartz.JobExecutionContext; -import com.ruoyi.quartz.domain.SysJob; - -/** - * 定时任务处理(允许并发执行) - * - * @author ruoyi - * - */ -public class QuartzJobExecution extends AbstractQuartzJob -{ - @Override - protected void doExecute(JobExecutionContext context, SysJob sysJob) throws Exception - { - JobInvokeUtil.invokeMethod(sysJob); - } -} diff --git a/ruoyi-quartz/src/main/java/com/ruoyi/quartz/util/ScheduleUtils.java b/ruoyi-quartz/src/main/java/com/ruoyi/quartz/util/ScheduleUtils.java deleted file mode 100644 index 7f4213f..0000000 --- a/ruoyi-quartz/src/main/java/com/ruoyi/quartz/util/ScheduleUtils.java +++ /dev/null @@ -1,113 +0,0 @@ -package com.ruoyi.quartz.util; - -import org.quartz.CronScheduleBuilder; -import org.quartz.CronTrigger; -import org.quartz.Job; -import org.quartz.JobBuilder; -import org.quartz.JobDetail; -import org.quartz.JobKey; -import org.quartz.Scheduler; -import org.quartz.SchedulerException; -import org.quartz.TriggerBuilder; -import org.quartz.TriggerKey; -import com.ruoyi.common.constant.ScheduleConstants; -import com.ruoyi.common.exception.job.TaskException; -import com.ruoyi.common.exception.job.TaskException.Code; -import com.ruoyi.quartz.domain.SysJob; - -/** - * 定时任务工具类 - * - * @author ruoyi - * - */ -public class ScheduleUtils -{ - /** - * 得到quartz任务类 - * - * @param sysJob 执行计划 - * @return 具体执行任务类 - */ - private static Class getQuartzJobClass(SysJob sysJob) - { - boolean isConcurrent = "0".equals(sysJob.getConcurrent()); - return isConcurrent ? QuartzJobExecution.class : QuartzDisallowConcurrentExecution.class; - } - - /** - * 构建任务触发对象 - */ - public static TriggerKey getTriggerKey(Long jobId, String jobGroup) - { - return TriggerKey.triggerKey(ScheduleConstants.TASK_CLASS_NAME + jobId, jobGroup); - } - - /** - * 构建任务键对象 - */ - public static JobKey getJobKey(Long jobId, String jobGroup) - { - return JobKey.jobKey(ScheduleConstants.TASK_CLASS_NAME + jobId, jobGroup); - } - - /** - * 创建定时任务 - */ - public static void createScheduleJob(Scheduler scheduler, SysJob job) throws SchedulerException, TaskException - { - Class jobClass = getQuartzJobClass(job); - // 构建job信息 - Long jobId = job.getJobId(); - String jobGroup = job.getJobGroup(); - JobDetail jobDetail = JobBuilder.newJob(jobClass).withIdentity(getJobKey(jobId, jobGroup)).build(); - - // 表达式调度构建器 - CronScheduleBuilder cronScheduleBuilder = CronScheduleBuilder.cronSchedule(job.getCronExpression()); - cronScheduleBuilder = handleCronScheduleMisfirePolicy(job, cronScheduleBuilder); - - // 按新的cronExpression表达式构建一个新的trigger - CronTrigger trigger = TriggerBuilder.newTrigger().withIdentity(getTriggerKey(jobId, jobGroup)) - .withSchedule(cronScheduleBuilder).build(); - - // 放入参数,运行时的方法可以获取 - jobDetail.getJobDataMap().put(ScheduleConstants.TASK_PROPERTIES, job); - - // 判断是否存在 - if (scheduler.checkExists(getJobKey(jobId, jobGroup))) - { - // 防止创建时存在数据问题 先移除,然后在执行创建操作 - scheduler.deleteJob(getJobKey(jobId, jobGroup)); - } - - scheduler.scheduleJob(jobDetail, trigger); - - // 暂停任务 - if (job.getStatus().equals(ScheduleConstants.Status.PAUSE.getValue())) - { - scheduler.pauseJob(ScheduleUtils.getJobKey(jobId, jobGroup)); - } - } - - /** - * 设置定时任务策略 - */ - public static CronScheduleBuilder handleCronScheduleMisfirePolicy(SysJob job, CronScheduleBuilder cb) - throws TaskException - { - switch (job.getMisfirePolicy()) - { - case ScheduleConstants.MISFIRE_DEFAULT: - return cb; - case ScheduleConstants.MISFIRE_IGNORE_MISFIRES: - return cb.withMisfireHandlingInstructionIgnoreMisfires(); - case ScheduleConstants.MISFIRE_FIRE_AND_PROCEED: - return cb.withMisfireHandlingInstructionFireAndProceed(); - case ScheduleConstants.MISFIRE_DO_NOTHING: - return cb.withMisfireHandlingInstructionDoNothing(); - default: - throw new TaskException("The task misfire policy '" + job.getMisfirePolicy() - + "' cannot be used in cron schedule tasks", Code.CONFIG_ERROR); - } - } -} diff --git a/ruoyi-quartz/src/main/resources/mapper/quartz/SysJobLogMapper.xml b/ruoyi-quartz/src/main/resources/mapper/quartz/SysJobLogMapper.xml deleted file mode 100644 index e608e42..0000000 --- a/ruoyi-quartz/src/main/resources/mapper/quartz/SysJobLogMapper.xml +++ /dev/null @@ -1,93 +0,0 @@ - - - - - - - - - - - - - - - - - select job_log_id, job_name, job_group, invoke_target, job_message, status, exception_info, create_time - from sys_job_log - - - - - - - - - - delete from sys_job_log where job_log_id = #{jobLogId} - - - - delete from sys_job_log where job_log_id in - - #{jobLogId} - - - - - truncate table sys_job_log - - - - insert into sys_job_log( - job_log_id, - job_name, - job_group, - invoke_target, - job_message, - status, - exception_info, - create_time - )values( - #{jobLogId}, - #{jobName}, - #{jobGroup}, - #{invokeTarget}, - #{jobMessage}, - #{status}, - #{exceptionInfo}, - sysdate() - ) - - - \ No newline at end of file diff --git a/ruoyi-quartz/src/main/resources/mapper/quartz/SysJobMapper.xml b/ruoyi-quartz/src/main/resources/mapper/quartz/SysJobMapper.xml deleted file mode 100644 index 6ef0432..0000000 --- a/ruoyi-quartz/src/main/resources/mapper/quartz/SysJobMapper.xml +++ /dev/null @@ -1,111 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - select job_id, job_name, job_group, invoke_target, cron_expression, misfire_policy, concurrent, status, create_by, create_time, remark - from sys_job - - - - - - - - - - delete from sys_job where job_id = #{jobId} - - - - delete from sys_job where job_id in - - #{jobId} - - - - - update sys_job - - job_name = #{jobName}, - job_group = #{jobGroup}, - invoke_target = #{invokeTarget}, - cron_expression = #{cronExpression}, - misfire_policy = #{misfirePolicy}, - concurrent = #{concurrent}, - status = #{status}, - remark = #{remark}, - update_by = #{updateBy}, - update_time = sysdate() - - where job_id = #{jobId} - - - - insert into sys_job( - job_id, - job_name, - job_group, - invoke_target, - cron_expression, - misfire_policy, - concurrent, - status, - remark, - create_by, - create_time - )values( - #{jobId}, - #{jobName}, - #{jobGroup}, - #{invokeTarget}, - #{cronExpression}, - #{misfirePolicy}, - #{concurrent}, - #{status}, - #{remark}, - #{createBy}, - sysdate() - ) - - - diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/domain/SysConfig.java b/ruoyi-system/src/main/java/com/ruoyi/system/domain/SysConfig.java deleted file mode 100644 index c54678c..0000000 --- a/ruoyi-system/src/main/java/com/ruoyi/system/domain/SysConfig.java +++ /dev/null @@ -1,111 +0,0 @@ -package com.ruoyi.system.domain; - -import javax.validation.constraints.NotBlank; -import javax.validation.constraints.Size; -import org.apache.commons.lang3.builder.ToStringBuilder; -import org.apache.commons.lang3.builder.ToStringStyle; -import com.ruoyi.common.annotation.Excel; -import com.ruoyi.common.annotation.Excel.ColumnType; -import com.ruoyi.common.core.domain.BaseEntity; - -/** - * 参数配置表 sys_config - * - * @author ruoyi - */ -public class SysConfig extends BaseEntity -{ - private static final long serialVersionUID = 1L; - - /** 参数主键 */ - @Excel(name = "参数主键", cellType = ColumnType.NUMERIC) - private Long configId; - - /** 参数名称 */ - @Excel(name = "参数名称") - private String configName; - - /** 参数键名 */ - @Excel(name = "参数键名") - private String configKey; - - /** 参数键值 */ - @Excel(name = "参数键值") - private String configValue; - - /** 系统内置(Y是 N否) */ - @Excel(name = "系统内置", readConverterExp = "Y=是,N=否") - private String configType; - - public Long getConfigId() - { - return configId; - } - - public void setConfigId(Long configId) - { - this.configId = configId; - } - - @NotBlank(message = "参数名称不能为空") - @Size(min = 0, max = 100, message = "参数名称不能超过100个字符") - public String getConfigName() - { - return configName; - } - - public void setConfigName(String configName) - { - this.configName = configName; - } - - @NotBlank(message = "参数键名长度不能为空") - @Size(min = 0, max = 100, message = "参数键名长度不能超过100个字符") - public String getConfigKey() - { - return configKey; - } - - public void setConfigKey(String configKey) - { - this.configKey = configKey; - } - - @NotBlank(message = "参数键值不能为空") - @Size(min = 0, max = 500, message = "参数键值长度不能超过500个字符") - public String getConfigValue() - { - return configValue; - } - - public void setConfigValue(String configValue) - { - this.configValue = configValue; - } - - public String getConfigType() - { - return configType; - } - - public void setConfigType(String configType) - { - this.configType = configType; - } - - @Override - public String toString() { - return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) - .append("configId", getConfigId()) - .append("configName", getConfigName()) - .append("configKey", getConfigKey()) - .append("configValue", getConfigValue()) - .append("configType", getConfigType()) - .append("createBy", getCreateBy()) - .append("createTime", getCreateTime()) - .append("updateBy", getUpdateBy()) - .append("updateTime", getUpdateTime()) - .append("remark", getRemark()) - .toString(); - } -} diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/domain/SysLogininfor.java b/ruoyi-system/src/main/java/com/ruoyi/system/domain/SysLogininfor.java deleted file mode 100644 index ebd7734..0000000 --- a/ruoyi-system/src/main/java/com/ruoyi/system/domain/SysLogininfor.java +++ /dev/null @@ -1,145 +0,0 @@ -package com.ruoyi.system.domain; - -import java.time.LocalDateTime; -import java.util.Date; -import com.fasterxml.jackson.annotation.JsonFormat; -import com.ruoyi.common.annotation.Excel; -import com.ruoyi.common.annotation.Excel.ColumnType; -import com.ruoyi.common.core.domain.BaseEntity; - -/** - * 系统访问记录表 sys_logininfor - * - * @author ruoyi - */ -public class SysLogininfor extends BaseEntity -{ - private static final long serialVersionUID = 1L; - - /** ID */ - @Excel(name = "序号", cellType = ColumnType.NUMERIC) - private Long infoId; - - /** 用户账号 */ - @Excel(name = "用户账号") - private String userName; - - /** 登录状态 0成功 1失败 */ - @Excel(name = "登录状态", readConverterExp = "0=成功,1=失败") - private String status; - - /** 登录IP地址 */ - @Excel(name = "登录地址") - private String ipaddr; - - /** 登录地点 */ - @Excel(name = "登录地点") - private String loginLocation; - - /** 浏览器类型 */ - @Excel(name = "浏览器") - private String browser; - - /** 操作系统 */ - @Excel(name = "操作系统") - private String os; - - /** 提示消息 */ - @Excel(name = "提示消息") - private String msg; - - /** 访问时间 */ - @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") - @Excel(name = "访问时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss") - private LocalDateTime loginTime; - - public Long getInfoId() - { - return infoId; - } - - public void setInfoId(Long infoId) - { - this.infoId = infoId; - } - - public String getUserName() - { - return userName; - } - - public void setUserName(String userName) - { - this.userName = userName; - } - - public String getStatus() - { - return status; - } - - public void setStatus(String status) - { - this.status = status; - } - - public String getIpaddr() - { - return ipaddr; - } - - public void setIpaddr(String ipaddr) - { - this.ipaddr = ipaddr; - } - - public String getLoginLocation() - { - return loginLocation; - } - - public void setLoginLocation(String loginLocation) - { - this.loginLocation = loginLocation; - } - - public String getBrowser() - { - return browser; - } - - public void setBrowser(String browser) - { - this.browser = browser; - } - - public String getOs() - { - return os; - } - - public void setOs(String os) - { - this.os = os; - } - - public LocalDateTime getLoginTime() { - return loginTime; - } - - public void setLoginTime(LocalDateTime loginTime) { - this.loginTime = loginTime; - } - - public String getMsg() - { - return msg; - } - - public void setMsg(String msg) - { - this.msg = msg; - } - - -} diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/domain/SysNotice.java b/ruoyi-system/src/main/java/com/ruoyi/system/domain/SysNotice.java deleted file mode 100644 index b43abea..0000000 --- a/ruoyi-system/src/main/java/com/ruoyi/system/domain/SysNotice.java +++ /dev/null @@ -1,100 +0,0 @@ -package com.ruoyi.system.domain; - -import javax.validation.constraints.NotBlank; -import javax.validation.constraints.Size; -import org.apache.commons.lang3.builder.ToStringBuilder; -import org.apache.commons.lang3.builder.ToStringStyle; -import com.ruoyi.common.core.domain.BaseEntity; - -/** - * 通知公告表 sys_notice - * - * @author ruoyi - */ -public class SysNotice extends BaseEntity -{ - private static final long serialVersionUID = 1L; - - /** 公告ID */ - private Long noticeId; - - /** 公告标题 */ - private String noticeTitle; - - /** 公告类型(1通知 2公告) */ - private String noticeType; - - /** 公告内容 */ - private String noticeContent; - - /** 公告状态(0正常 1关闭) */ - private String status; - - public Long getNoticeId() - { - return noticeId; - } - - public void setNoticeId(Long noticeId) - { - this.noticeId = noticeId; - } - - public void setNoticeTitle(String noticeTitle) - { - this.noticeTitle = noticeTitle; - } - - @NotBlank(message = "公告标题不能为空") - @Size(min = 0, max = 50, message = "公告标题不能超过50个字符") - public String getNoticeTitle() - { - return noticeTitle; - } - - public void setNoticeType(String noticeType) - { - this.noticeType = noticeType; - } - - public String getNoticeType() - { - return noticeType; - } - - public void setNoticeContent(String noticeContent) - { - this.noticeContent = noticeContent; - } - - public String getNoticeContent() - { - return noticeContent; - } - - public void setStatus(String status) - { - this.status = status; - } - - public String getStatus() - { - return status; - } - - @Override - public String toString() { - return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) - .append("noticeId", getNoticeId()) - .append("noticeTitle", getNoticeTitle()) - .append("noticeType", getNoticeType()) - .append("noticeContent", getNoticeContent()) - .append("status", getStatus()) - .append("createBy", getCreateBy()) - .append("createTime", getCreateTime()) - .append("updateBy", getUpdateBy()) - .append("updateTime", getUpdateTime()) - .append("remark", getRemark()) - .toString(); - } -} diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/domain/SysOperLog.java b/ruoyi-system/src/main/java/com/ruoyi/system/domain/SysOperLog.java deleted file mode 100644 index 175ee03..0000000 --- a/ruoyi-system/src/main/java/com/ruoyi/system/domain/SysOperLog.java +++ /dev/null @@ -1,255 +0,0 @@ -package com.ruoyi.system.domain; - -import java.util.Date; -import com.fasterxml.jackson.annotation.JsonFormat; -import com.ruoyi.common.annotation.Excel; -import com.ruoyi.common.annotation.Excel.ColumnType; -import com.ruoyi.common.core.domain.BaseEntity; - -/** - * 操作日志记录表 oper_log - * - * @author ruoyi - */ -public class SysOperLog extends BaseEntity -{ - private static final long serialVersionUID = 1L; - - /** 日志主键 */ - @Excel(name = "操作序号", cellType = ColumnType.NUMERIC) - private Long operId; - - /** 操作模块 */ - @Excel(name = "操作模块") - private String title; - - /** 业务类型(0其它 1新增 2修改 3删除) */ - @Excel(name = "业务类型", readConverterExp = "0=其它,1=新增,2=修改,3=删除,4=授权,5=导出,6=导入,7=强退,8=生成代码,9=清空数据") - private Integer businessType; - - /** 业务类型数组 */ - private Integer[] businessTypes; - - /** 请求方法 */ - @Excel(name = "请求方法") - private String method; - - /** 请求方式 */ - @Excel(name = "请求方式") - private String requestMethod; - - /** 操作类别(0其它 1后台用户 2手机端用户) */ - @Excel(name = "操作类别", readConverterExp = "0=其它,1=后台用户,2=手机端用户") - private Integer operatorType; - - /** 操作人员 */ - @Excel(name = "操作人员") - private String operName; - - /** 部门名称 */ - @Excel(name = "部门名称") - private String deptName; - - /** 请求url */ - @Excel(name = "请求地址") - private String operUrl; - - /** 操作地址 */ - @Excel(name = "操作地址") - private String operIp; - - /** 操作地点 */ - @Excel(name = "操作地点") - private String operLocation; - - /** 请求参数 */ - @Excel(name = "请求参数") - private String operParam; - - /** 返回参数 */ - @Excel(name = "返回参数") - private String jsonResult; - - /** 操作状态(0正常 1异常) */ - @Excel(name = "状态", readConverterExp = "0=正常,1=异常") - private Integer status; - - /** 错误消息 */ - @Excel(name = "错误消息") - private String errorMsg; - - /** 操作时间 */ - @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") - @Excel(name = "操作时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss") - private Date operTime; - - public Long getOperId() - { - return operId; - } - - public void setOperId(Long operId) - { - this.operId = operId; - } - - public String getTitle() - { - return title; - } - - public void setTitle(String title) - { - this.title = title; - } - - public Integer getBusinessType() - { - return businessType; - } - - public void setBusinessType(Integer businessType) - { - this.businessType = businessType; - } - - public Integer[] getBusinessTypes() - { - return businessTypes; - } - - public void setBusinessTypes(Integer[] businessTypes) - { - this.businessTypes = businessTypes; - } - - public String getMethod() - { - return method; - } - - public void setMethod(String method) - { - this.method = method; - } - - public String getRequestMethod() - { - return requestMethod; - } - - public void setRequestMethod(String requestMethod) - { - this.requestMethod = requestMethod; - } - - public Integer getOperatorType() - { - return operatorType; - } - - public void setOperatorType(Integer operatorType) - { - this.operatorType = operatorType; - } - - public String getOperName() - { - return operName; - } - - public void setOperName(String operName) - { - this.operName = operName; - } - - public String getDeptName() - { - return deptName; - } - - public void setDeptName(String deptName) - { - this.deptName = deptName; - } - - public String getOperUrl() - { - return operUrl; - } - - public void setOperUrl(String operUrl) - { - this.operUrl = operUrl; - } - - public String getOperIp() - { - return operIp; - } - - public void setOperIp(String operIp) - { - this.operIp = operIp; - } - - public String getOperLocation() - { - return operLocation; - } - - public void setOperLocation(String operLocation) - { - this.operLocation = operLocation; - } - - public String getOperParam() - { - return operParam; - } - - public void setOperParam(String operParam) - { - this.operParam = operParam; - } - - public String getJsonResult() - { - return jsonResult; - } - - public void setJsonResult(String jsonResult) - { - this.jsonResult = jsonResult; - } - - public Integer getStatus() - { - return status; - } - - public void setStatus(Integer status) - { - this.status = status; - } - - public String getErrorMsg() - { - return errorMsg; - } - - public void setErrorMsg(String errorMsg) - { - this.errorMsg = errorMsg; - } - - public Date getOperTime() - { - return operTime; - } - - public void setOperTime(Date operTime) - { - this.operTime = operTime; - } -} diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/domain/SysPost.java b/ruoyi-system/src/main/java/com/ruoyi/system/domain/SysPost.java deleted file mode 100644 index 1f1fcf4..0000000 --- a/ruoyi-system/src/main/java/com/ruoyi/system/domain/SysPost.java +++ /dev/null @@ -1,123 +0,0 @@ -package com.ruoyi.system.domain; - -import javax.validation.constraints.NotBlank; -import javax.validation.constraints.Size; -import org.apache.commons.lang3.builder.ToStringBuilder; -import org.apache.commons.lang3.builder.ToStringStyle; -import com.ruoyi.common.annotation.Excel; -import com.ruoyi.common.annotation.Excel.ColumnType; -import com.ruoyi.common.core.domain.BaseEntity; - -/** - * 岗位表 sys_post - * - * @author ruoyi - */ -public class SysPost extends BaseEntity -{ - private static final long serialVersionUID = 1L; - - /** 岗位序号 */ - @Excel(name = "岗位序号", cellType = ColumnType.NUMERIC) - private Long postId; - - /** 岗位编码 */ - @Excel(name = "岗位编码") - private String postCode; - - /** 岗位名称 */ - @Excel(name = "岗位名称") - private String postName; - - /** 岗位排序 */ - @Excel(name = "岗位排序") - private String postSort; - - /** 状态(0正常 1停用) */ - @Excel(name = "状态", readConverterExp = "0=正常,1=停用") - private String status; - - /** 用户是否存在此岗位标识 默认不存在 */ - private boolean flag = false; - - public Long getPostId() - { - return postId; - } - - public void setPostId(Long postId) - { - this.postId = postId; - } - - @NotBlank(message = "岗位编码不能为空") - @Size(min = 0, max = 64, message = "岗位编码长度不能超过64个字符") - public String getPostCode() - { - return postCode; - } - - public void setPostCode(String postCode) - { - this.postCode = postCode; - } - - @NotBlank(message = "岗位名称不能为空") - @Size(min = 0, max = 50, message = "岗位名称长度不能超过50个字符") - public String getPostName() - { - return postName; - } - - public void setPostName(String postName) - { - this.postName = postName; - } - - @NotBlank(message = "显示顺序不能为空") - public String getPostSort() - { - return postSort; - } - - public void setPostSort(String postSort) - { - this.postSort = postSort; - } - - public String getStatus() - { - return status; - } - - public void setStatus(String status) - { - this.status = status; - } - - public boolean isFlag() - { - return flag; - } - - public void setFlag(boolean flag) - { - this.flag = flag; - } - - @Override - public String toString() { - return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) - .append("postId", getPostId()) - .append("postCode", getPostCode()) - .append("postName", getPostName()) - .append("postSort", getPostSort()) - .append("status", getStatus()) - .append("createBy", getCreateBy()) - .append("createTime", getCreateTime()) - .append("updateBy", getUpdateBy()) - .append("updateTime", getUpdateTime()) - .append("remark", getRemark()) - .toString(); - } -} diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/domain/SysRoleDept.java b/ruoyi-system/src/main/java/com/ruoyi/system/domain/SysRoleDept.java deleted file mode 100644 index 47b21bf..0000000 --- a/ruoyi-system/src/main/java/com/ruoyi/system/domain/SysRoleDept.java +++ /dev/null @@ -1,46 +0,0 @@ -package com.ruoyi.system.domain; - -import org.apache.commons.lang3.builder.ToStringBuilder; -import org.apache.commons.lang3.builder.ToStringStyle; - -/** - * 角色和部门关联 sys_role_dept - * - * @author ruoyi - */ -public class SysRoleDept -{ - /** 角色ID */ - private Long roleId; - - /** 部门ID */ - private Long deptId; - - public Long getRoleId() - { - return roleId; - } - - public void setRoleId(Long roleId) - { - this.roleId = roleId; - } - - public Long getDeptId() - { - return deptId; - } - - public void setDeptId(Long deptId) - { - this.deptId = deptId; - } - - @Override - public String toString() { - return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) - .append("roleId", getRoleId()) - .append("deptId", getDeptId()) - .toString(); - } -} diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/domain/SysRoleMenu.java b/ruoyi-system/src/main/java/com/ruoyi/system/domain/SysRoleMenu.java deleted file mode 100644 index de10a74..0000000 --- a/ruoyi-system/src/main/java/com/ruoyi/system/domain/SysRoleMenu.java +++ /dev/null @@ -1,46 +0,0 @@ -package com.ruoyi.system.domain; - -import org.apache.commons.lang3.builder.ToStringBuilder; -import org.apache.commons.lang3.builder.ToStringStyle; - -/** - * 角色和菜单关联 sys_role_menu - * - * @author ruoyi - */ -public class SysRoleMenu -{ - /** 角色ID */ - private Long roleId; - - /** 菜单ID */ - private Long menuId; - - public Long getRoleId() - { - return roleId; - } - - public void setRoleId(Long roleId) - { - this.roleId = roleId; - } - - public Long getMenuId() - { - return menuId; - } - - public void setMenuId(Long menuId) - { - this.menuId = menuId; - } - - @Override - public String toString() { - return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) - .append("roleId", getRoleId()) - .append("menuId", getMenuId()) - .toString(); - } -} diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/domain/SysUserOnline.java b/ruoyi-system/src/main/java/com/ruoyi/system/domain/SysUserOnline.java deleted file mode 100644 index 2bbd318..0000000 --- a/ruoyi-system/src/main/java/com/ruoyi/system/domain/SysUserOnline.java +++ /dev/null @@ -1,113 +0,0 @@ -package com.ruoyi.system.domain; - -/** - * 当前在线会话 - * - * @author ruoyi - */ -public class SysUserOnline -{ - /** 会话编号 */ - private String tokenId; - - /** 部门名称 */ - private String deptName; - - /** 用户名称 */ - private String userName; - - /** 登录IP地址 */ - private String ipaddr; - - /** 登录地址 */ - private String loginLocation; - - /** 浏览器类型 */ - private String browser; - - /** 操作系统 */ - private String os; - - /** 登录时间 */ - private Long loginTime; - - public String getTokenId() - { - return tokenId; - } - - public void setTokenId(String tokenId) - { - this.tokenId = tokenId; - } - - public String getDeptName() - { - return deptName; - } - - public void setDeptName(String deptName) - { - this.deptName = deptName; - } - - public String getUserName() - { - return userName; - } - - public void setUserName(String userName) - { - this.userName = userName; - } - - public String getIpaddr() - { - return ipaddr; - } - - public void setIpaddr(String ipaddr) - { - this.ipaddr = ipaddr; - } - - public String getLoginLocation() - { - return loginLocation; - } - - public void setLoginLocation(String loginLocation) - { - this.loginLocation = loginLocation; - } - - public String getBrowser() - { - return browser; - } - - public void setBrowser(String browser) - { - this.browser = browser; - } - - public String getOs() - { - return os; - } - - public void setOs(String os) - { - this.os = os; - } - - public Long getLoginTime() - { - return loginTime; - } - - public void setLoginTime(Long loginTime) - { - this.loginTime = loginTime; - } -} diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/domain/SysUserPost.java b/ruoyi-system/src/main/java/com/ruoyi/system/domain/SysUserPost.java deleted file mode 100644 index 6e8c416..0000000 --- a/ruoyi-system/src/main/java/com/ruoyi/system/domain/SysUserPost.java +++ /dev/null @@ -1,46 +0,0 @@ -package com.ruoyi.system.domain; - -import org.apache.commons.lang3.builder.ToStringBuilder; -import org.apache.commons.lang3.builder.ToStringStyle; - -/** - * 用户和岗位关联 sys_user_post - * - * @author ruoyi - */ -public class SysUserPost -{ - /** 用户ID */ - private Long userId; - - /** 岗位ID */ - private Long postId; - - public Long getUserId() - { - return userId; - } - - public void setUserId(Long userId) - { - this.userId = userId; - } - - public Long getPostId() - { - return postId; - } - - public void setPostId(Long postId) - { - this.postId = postId; - } - - @Override - public String toString() { - return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) - .append("userId", getUserId()) - .append("postId", getPostId()) - .toString(); - } -} diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/domain/SysUserRole.java b/ruoyi-system/src/main/java/com/ruoyi/system/domain/SysUserRole.java deleted file mode 100644 index 4d15810..0000000 --- a/ruoyi-system/src/main/java/com/ruoyi/system/domain/SysUserRole.java +++ /dev/null @@ -1,46 +0,0 @@ -package com.ruoyi.system.domain; - -import org.apache.commons.lang3.builder.ToStringBuilder; -import org.apache.commons.lang3.builder.ToStringStyle; - -/** - * 用户和角色关联 sys_user_role - * - * @author ruoyi - */ -public class SysUserRole -{ - /** 用户ID */ - private Long userId; - - /** 角色ID */ - private Long roleId; - - public Long getUserId() - { - return userId; - } - - public void setUserId(Long userId) - { - this.userId = userId; - } - - public Long getRoleId() - { - return roleId; - } - - public void setRoleId(Long roleId) - { - this.roleId = roleId; - } - - @Override - public String toString() { - return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) - .append("userId", getUserId()) - .append("roleId", getRoleId()) - .toString(); - } -} diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/domain/vo/RouterVo.java b/ruoyi-system/src/main/java/com/ruoyi/system/domain/vo/RouterVo.java deleted file mode 100644 index afff8c9..0000000 --- a/ruoyi-system/src/main/java/com/ruoyi/system/domain/vo/RouterVo.java +++ /dev/null @@ -1,148 +0,0 @@ -package com.ruoyi.system.domain.vo; - -import com.fasterxml.jackson.annotation.JsonInclude; -import java.util.List; - -/** - * 路由配置信息 - * - * @author ruoyi - */ -@JsonInclude(JsonInclude.Include.NON_EMPTY) -public class RouterVo -{ - /** - * 路由名字 - */ - private String name; - - /** - * 路由地址 - */ - private String path; - - /** - * 是否隐藏路由,当设置 true 的时候该路由不会再侧边栏出现 - */ - private boolean hidden; - - /** - * 重定向地址,当设置 noRedirect 的时候该路由在面包屑导航中不可被点击 - */ - private String redirect; - - /** - * 组件地址 - */ - private String component; - - /** - * 路由参数:如 {"id": 1, "name": "ry"} - */ - private String query; - - /** - * 当你一个路由下面的 children 声明的路由大于1个时,自动会变成嵌套的模式--如组件页面 - */ - private Boolean alwaysShow; - - /** - * 其他元素 - */ - private MetaVo meta; - - /** - * 子路由 - */ - private List children; - - public String getName() - { - return name; - } - - public void setName(String name) - { - this.name = name; - } - - public String getPath() - { - return path; - } - - public void setPath(String path) - { - this.path = path; - } - - public boolean getHidden() - { - return hidden; - } - - public void setHidden(boolean hidden) - { - this.hidden = hidden; - } - - public String getRedirect() - { - return redirect; - } - - public void setRedirect(String redirect) - { - this.redirect = redirect; - } - - public String getComponent() - { - return component; - } - - public void setComponent(String component) - { - this.component = component; - } - - public String getQuery() - { - return query; - } - - public void setQuery(String query) - { - this.query = query; - } - - public Boolean getAlwaysShow() - { - return alwaysShow; - } - - public void setAlwaysShow(Boolean alwaysShow) - { - this.alwaysShow = alwaysShow; - } - - public MetaVo getMeta() - { - return meta; - } - - public void setMeta(MetaVo meta) - { - this.meta = meta; - } - - public List getChildren() - { - return children; - } - - public void setChildren(List children) - { - this.children = children; - } -} diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysConfigMapper.java b/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysConfigMapper.java deleted file mode 100644 index 0ed0c0a..0000000 --- a/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysConfigMapper.java +++ /dev/null @@ -1,68 +0,0 @@ -package com.ruoyi.system.mapper; - -import java.util.List; -import com.ruoyi.system.domain.SysConfig; - -/** - * 参数配置 数据层 - * - * @author ruoyi - */ -public interface SysConfigMapper -{ - /** - * 查询参数配置信息 - * - * @param config 参数配置信息 - * @return 参数配置信息 - */ - public SysConfig selectConfig(SysConfig config); - - /** - * 查询参数配置列表 - * - * @param config 参数配置信息 - * @return 参数配置集合 - */ - public List selectConfigList(SysConfig config); - - /** - * 根据键名查询参数配置信息 - * - * @param configKey 参数键名 - * @return 参数配置信息 - */ - public SysConfig checkConfigKeyUnique(String configKey); - - /** - * 新增参数配置 - * - * @param config 参数配置信息 - * @return 结果 - */ - public int insertConfig(SysConfig config); - - /** - * 修改参数配置 - * - * @param config 参数配置信息 - * @return 结果 - */ - public int updateConfig(SysConfig config); - - /** - * 删除参数配置 - * - * @param configId 参数ID - * @return 结果 - */ - public int deleteConfigById(Long configId); - - /** - * 批量删除参数信息 - * - * @param configIds 需要删除的参数ID - * @return 结果 - */ - public int deleteConfigByIds(Long[] configIds); -} diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysDeptMapper.java b/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysDeptMapper.java deleted file mode 100644 index 415599c..0000000 --- a/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysDeptMapper.java +++ /dev/null @@ -1,118 +0,0 @@ -package com.ruoyi.system.mapper; - -import java.util.List; -import org.apache.ibatis.annotations.Param; -import com.ruoyi.common.core.domain.entity.SysDept; - -/** - * 部门管理 数据层 - * - * @author ruoyi - */ -public interface SysDeptMapper -{ - /** - * 查询部门管理数据 - * - * @param dept 部门信息 - * @return 部门信息集合 - */ - public List selectDeptList(SysDept dept); - - /** - * 根据角色ID查询部门树信息 - * - * @param roleId 角色ID - * @param deptCheckStrictly 部门树选择项是否关联显示 - * @return 选中部门列表 - */ - public List selectDeptListByRoleId(@Param("roleId") Long roleId, @Param("deptCheckStrictly") boolean deptCheckStrictly); - - /** - * 根据部门ID查询信息 - * - * @param deptId 部门ID - * @return 部门信息 - */ - public SysDept selectDeptById(Long deptId); - - /** - * 根据ID查询所有子部门 - * - * @param deptId 部门ID - * @return 部门列表 - */ - public List selectChildrenDeptById(Long deptId); - - /** - * 根据ID查询所有子部门(正常状态) - * - * @param deptId 部门ID - * @return 子部门数 - */ - public int selectNormalChildrenDeptById(Long deptId); - - /** - * 是否存在子节点 - * - * @param deptId 部门ID - * @return 结果 - */ - public int hasChildByDeptId(Long deptId); - - /** - * 查询部门是否存在用户 - * - * @param deptId 部门ID - * @return 结果 - */ - public int checkDeptExistUser(Long deptId); - - /** - * 校验部门名称是否唯一 - * - * @param deptName 部门名称 - * @param parentId 父部门ID - * @return 结果 - */ - public SysDept checkDeptNameUnique(@Param("deptName") String deptName, @Param("parentId") Long parentId); - - /** - * 新增部门信息 - * - * @param dept 部门信息 - * @return 结果 - */ - public int insertDept(SysDept dept); - - /** - * 修改部门信息 - * - * @param dept 部门信息 - * @return 结果 - */ - public int updateDept(SysDept dept); - - /** - * 修改所在部门正常状态 - * - * @param deptIds 部门ID组 - */ - public void updateDeptStatusNormal(Long[] deptIds); - - /** - * 修改子元素关系 - * - * @param depts 子元素 - * @return 结果 - */ - public int updateDeptChildren(@Param("depts") List depts); - - /** - * 删除部门管理信息 - * - * @param deptId 部门ID - * @return 结果 - */ - public int deleteDeptById(Long deptId); -} diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysDictDataMapper.java b/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysDictDataMapper.java deleted file mode 100644 index 3a7e5d5..0000000 --- a/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysDictDataMapper.java +++ /dev/null @@ -1,97 +0,0 @@ -package com.ruoyi.system.mapper; - -import java.util.List; - -import com.baomidou.mybatisplus.core.mapper.BaseMapper; -import org.apache.ibatis.annotations.Param; -import com.ruoyi.common.core.domain.entity.SysDictData; - -/** - * 字典表 数据层 - * - * @author ruoyi - */ -public interface SysDictDataMapper extends BaseMapper -{ - /** - * 根据条件分页查询字典数据 - * - * @param dictData 字典数据信息 - * @return 字典数据集合信息 - */ - public List selectDictDataList(SysDictData dictData); - - /** - * 根据字典类型查询字典数据 - * - * @param dictType 字典类型 - * @return 字典数据集合信息 - */ - public List selectDictDataByType(String dictType); - - /** - * 根据字典类型和字典键值查询字典数据信息 - * - * @param dictType 字典类型 - * @param dictValue 字典键值 - * @return 字典标签 - */ - public String selectDictLabel(@Param("dictType") String dictType, @Param("dictValue") String dictValue); - - /** - * 根据字典数据ID查询信息 - * - * @param dictCode 字典数据ID - * @return 字典数据 - */ - public SysDictData selectDictDataById(Long dictCode); - - /** - * 查询字典数据 - * - * @param dictType 字典类型 - * @return 字典数据 - */ - public int countDictDataByType(String dictType); - - /** - * 通过字典ID删除字典数据信息 - * - * @param dictCode 字典数据ID - * @return 结果 - */ - public int deleteDictDataById(Long dictCode); - - /** - * 批量删除字典数据信息 - * - * @param dictCodes 需要删除的字典数据ID - * @return 结果 - */ - public int deleteDictDataByIds(Long[] dictCodes); - - /** - * 新增字典数据信息 - * - * @param dictData 字典数据信息 - * @return 结果 - */ - public int insertDictData(SysDictData dictData); - - /** - * 修改字典数据信息 - * - * @param dictData 字典数据信息 - * @return 结果 - */ - public int updateDictData(SysDictData dictData); - - /** - * 同步修改字典类型 - * - * @param oldDictType 旧字典类型 - * @param newDictType 新旧字典类型 - * @return 结果 - */ - public int updateDictDataType(@Param("oldDictType") String oldDictType, @Param("newDictType") String newDictType); -} diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysDictTypeMapper.java b/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysDictTypeMapper.java deleted file mode 100644 index 17545cd..0000000 --- a/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysDictTypeMapper.java +++ /dev/null @@ -1,85 +0,0 @@ -package com.ruoyi.system.mapper; - -import java.util.List; -import org.apache.ibatis.annotations.Mapper; -import com.ruoyi.common.core.domain.entity.SysDictType; - -/** - * 字典表 数据层 - * - * @author ruoyi - */ -@Mapper -public interface SysDictTypeMapper -{ - /** - * 根据条件分页查询字典类型 - * - * @param dictType 字典类型信息 - * @return 字典类型集合信息 - */ - public List selectDictTypeList(SysDictType dictType); - - /** - * 根据所有字典类型 - * - * @return 字典类型集合信息 - */ - public List selectDictTypeAll(); - - /** - * 根据字典类型ID查询信息 - * - * @param dictId 字典类型ID - * @return 字典类型 - */ - public SysDictType selectDictTypeById(Long dictId); - - /** - * 根据字典类型查询信息 - * - * @param dictType 字典类型 - * @return 字典类型 - */ - public SysDictType selectDictTypeByType(String dictType); - - /** - * 通过字典ID删除字典信息 - * - * @param dictId 字典ID - * @return 结果 - */ - public int deleteDictTypeById(Long dictId); - - /** - * 批量删除字典类型信息 - * - * @param dictIds 需要删除的字典ID - * @return 结果 - */ - public int deleteDictTypeByIds(Long[] dictIds); - - /** - * 新增字典类型信息 - * - * @param dictType 字典类型信息 - * @return 结果 - */ - public int insertDictType(SysDictType dictType); - - /** - * 修改字典类型信息 - * - * @param dictType 字典类型信息 - * @return 结果 - */ - public int updateDictType(SysDictType dictType); - - /** - * 校验字典类型称是否唯一 - * - * @param dictType 字典类型 - * @return 结果 - */ - public SysDictType checkDictTypeUnique(String dictType); -} diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysLogininforMapper.java b/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysLogininforMapper.java deleted file mode 100644 index 629866f..0000000 --- a/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysLogininforMapper.java +++ /dev/null @@ -1,42 +0,0 @@ -package com.ruoyi.system.mapper; - -import java.util.List; -import com.ruoyi.system.domain.SysLogininfor; - -/** - * 系统访问日志情况信息 数据层 - * - * @author ruoyi - */ -public interface SysLogininforMapper -{ - /** - * 新增系统登录日志 - * - * @param logininfor 访问日志对象 - */ - public void insertLogininfor(SysLogininfor logininfor); - - /** - * 查询系统登录日志集合 - * - * @param logininfor 访问日志对象 - * @return 登录记录集合 - */ - public List selectLogininforList(SysLogininfor logininfor); - - /** - * 批量删除系统登录日志 - * - * @param infoIds 需要删除的登录日志ID - * @return 结果 - */ - public int deleteLogininforByIds(Long[] infoIds); - - /** - * 清空系统登录日志 - * - * @return 结果 - */ - public int cleanLogininfor(); -} diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysMenuMapper.java b/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysMenuMapper.java deleted file mode 100644 index 1c2e853..0000000 --- a/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysMenuMapper.java +++ /dev/null @@ -1,117 +0,0 @@ -package com.ruoyi.system.mapper; - -import java.util.List; -import org.apache.ibatis.annotations.Param; -import com.ruoyi.common.core.domain.entity.SysMenu; - -/** - * 菜单表 数据层 - * - * @author ruoyi - */ -public interface SysMenuMapper -{ - /** - * 查询系统菜单列表 - * - * @param menu 菜单信息 - * @return 菜单列表 - */ - public List selectMenuList(SysMenu menu); - - /** - * 根据用户所有权限 - * - * @return 权限列表 - */ - public List selectMenuPerms(); - - /** - * 根据用户查询系统菜单列表 - * - * @param menu 菜单信息 - * @return 菜单列表 - */ - public List selectMenuListByUserId(SysMenu menu); - - /** - * 根据用户ID查询权限 - * - * @param userId 用户ID - * @return 权限列表 - */ - public List selectMenuPermsByUserId(Long userId); - - /** - * 根据用户ID查询菜单 - * - * @return 菜单列表 - */ - public List selectMenuTreeAll(); - - /** - * 根据用户ID查询菜单 - * - * @param userId 用户ID - * @return 菜单列表 - */ - public List selectMenuTreeByUserId(Long userId); - - /** - * 根据角色ID查询菜单树信息 - * - * @param roleId 角色ID - * @param menuCheckStrictly 菜单树选择项是否关联显示 - * @return 选中菜单列表 - */ - public List selectMenuListByRoleId(@Param("roleId") Long roleId, @Param("menuCheckStrictly") boolean menuCheckStrictly); - - /** - * 根据菜单ID查询信息 - * - * @param menuId 菜单ID - * @return 菜单信息 - */ - public SysMenu selectMenuById(Long menuId); - - /** - * 是否存在菜单子节点 - * - * @param menuId 菜单ID - * @return 结果 - */ - public int hasChildByMenuId(Long menuId); - - /** - * 新增菜单信息 - * - * @param menu 菜单信息 - * @return 结果 - */ - public int insertMenu(SysMenu menu); - - /** - * 修改菜单信息 - * - * @param menu 菜单信息 - * @return 结果 - */ - public int updateMenu(SysMenu menu); - - /** - * 删除菜单管理信息 - * - * @param menuId 菜单ID - * @return 结果 - */ - public int deleteMenuById(Long menuId); - - /** - * 校验菜单名称是否唯一 - * - * @param menuName 菜单名称 - * @param parentId 父菜单ID - * @return 结果 - */ - public SysMenu checkMenuNameUnique(@Param("menuName") String menuName, @Param("parentId") Long parentId); -} diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysNoticeMapper.java b/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysNoticeMapper.java deleted file mode 100644 index c34f0a2..0000000 --- a/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysNoticeMapper.java +++ /dev/null @@ -1,60 +0,0 @@ -package com.ruoyi.system.mapper; - -import java.util.List; -import com.ruoyi.system.domain.SysNotice; - -/** - * 通知公告表 数据层 - * - * @author ruoyi - */ -public interface SysNoticeMapper -{ - /** - * 查询公告信息 - * - * @param noticeId 公告ID - * @return 公告信息 - */ - public SysNotice selectNoticeById(Long noticeId); - - /** - * 查询公告列表 - * - * @param notice 公告信息 - * @return 公告集合 - */ - public List selectNoticeList(SysNotice notice); - - /** - * 新增公告 - * - * @param notice 公告信息 - * @return 结果 - */ - public int insertNotice(SysNotice notice); - - /** - * 修改公告 - * - * @param notice 公告信息 - * @return 结果 - */ - public int updateNotice(SysNotice notice); - - /** - * 批量删除公告 - * - * @param noticeId 公告ID - * @return 结果 - */ - public int deleteNoticeById(Long noticeId); - - /** - * 批量删除公告信息 - * - * @param noticeIds 需要删除的公告ID - * @return 结果 - */ - public int deleteNoticeByIds(Long[] noticeIds); -} diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysOperLogMapper.java b/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysOperLogMapper.java deleted file mode 100644 index 2ae6457..0000000 --- a/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysOperLogMapper.java +++ /dev/null @@ -1,48 +0,0 @@ -package com.ruoyi.system.mapper; - -import java.util.List; -import com.ruoyi.system.domain.SysOperLog; - -/** - * 操作日志 数据层 - * - * @author ruoyi - */ -public interface SysOperLogMapper -{ - /** - * 新增操作日志 - * - * @param operLog 操作日志对象 - */ - public void insertOperlog(SysOperLog operLog); - - /** - * 查询系统操作日志集合 - * - * @param operLog 操作日志对象 - * @return 操作日志集合 - */ - public List selectOperLogList(SysOperLog operLog); - - /** - * 批量删除系统操作日志 - * - * @param operIds 需要删除的操作日志ID - * @return 结果 - */ - public int deleteOperLogByIds(Long[] operIds); - - /** - * 查询操作日志详细 - * - * @param operId 操作ID - * @return 操作日志对象 - */ - public SysOperLog selectOperLogById(Long operId); - - /** - * 清空操作日志 - */ - public void cleanOperLog(); -} diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysPostMapper.java b/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysPostMapper.java deleted file mode 100644 index b428747..0000000 --- a/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysPostMapper.java +++ /dev/null @@ -1,99 +0,0 @@ -package com.ruoyi.system.mapper; - -import java.util.List; -import com.ruoyi.system.domain.SysPost; - -/** - * 岗位信息 数据层 - * - * @author ruoyi - */ -public interface SysPostMapper -{ - /** - * 查询岗位数据集合 - * - * @param post 岗位信息 - * @return 岗位数据集合 - */ - public List selectPostList(SysPost post); - - /** - * 查询所有岗位 - * - * @return 岗位列表 - */ - public List selectPostAll(); - - /** - * 通过岗位ID查询岗位信息 - * - * @param postId 岗位ID - * @return 角色对象信息 - */ - public SysPost selectPostById(Long postId); - - /** - * 根据用户ID获取岗位选择框列表 - * - * @param userId 用户ID - * @return 选中岗位ID列表 - */ - public List selectPostListByUserId(Long userId); - - /** - * 查询用户所属岗位组 - * - * @param userName 用户名 - * @return 结果 - */ - public List selectPostsByUserName(String userName); - - /** - * 删除岗位信息 - * - * @param postId 岗位ID - * @return 结果 - */ - public int deletePostById(Long postId); - - /** - * 批量删除岗位信息 - * - * @param postIds 需要删除的岗位ID - * @return 结果 - */ - public int deletePostByIds(Long[] postIds); - - /** - * 修改岗位信息 - * - * @param post 岗位信息 - * @return 结果 - */ - public int updatePost(SysPost post); - - /** - * 新增岗位信息 - * - * @param post 岗位信息 - * @return 结果 - */ - public int insertPost(SysPost post); - - /** - * 校验岗位名称 - * - * @param postName 岗位名称 - * @return 结果 - */ - public SysPost checkPostNameUnique(String postName); - - /** - * 校验岗位编码 - * - * @param postCode 岗位编码 - * @return 结果 - */ - public SysPost checkPostCodeUnique(String postCode); -} diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysRoleDeptMapper.java b/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysRoleDeptMapper.java deleted file mode 100644 index f9d3a2f..0000000 --- a/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysRoleDeptMapper.java +++ /dev/null @@ -1,44 +0,0 @@ -package com.ruoyi.system.mapper; - -import java.util.List; -import com.ruoyi.system.domain.SysRoleDept; - -/** - * 角色与部门关联表 数据层 - * - * @author ruoyi - */ -public interface SysRoleDeptMapper -{ - /** - * 通过角色ID删除角色和部门关联 - * - * @param roleId 角色ID - * @return 结果 - */ - public int deleteRoleDeptByRoleId(Long roleId); - - /** - * 批量删除角色部门关联信息 - * - * @param ids 需要删除的数据ID - * @return 结果 - */ - public int deleteRoleDept(Long[] ids); - - /** - * 查询部门使用数量 - * - * @param deptId 部门ID - * @return 结果 - */ - public int selectCountRoleDeptByDeptId(Long deptId); - - /** - * 批量新增角色部门信息 - * - * @param roleDeptList 角色部门列表 - * @return 结果 - */ - public int batchRoleDept(List roleDeptList); -} diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysRoleMapper.java b/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysRoleMapper.java deleted file mode 100644 index 11647ab..0000000 --- a/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysRoleMapper.java +++ /dev/null @@ -1,111 +0,0 @@ -package com.ruoyi.system.mapper; - -import java.util.List; -import com.ruoyi.common.core.domain.entity.SysRole; -import org.apache.ibatis.annotations.Select; - -/** - * 角色表 数据层 - * - * @author ruoyi - */ -public interface SysRoleMapper -{ - /** - * 根据条件分页查询角色数据 - * - * @param role 角色信息 - * @return 角色数据集合信息 - */ - public List selectRoleList(SysRole role); - - /** - * 根据用户ID查询角色 - * - * @param userId 用户ID - * @return 角色列表 - */ - public List selectRolePermissionByUserId(Long userId); - - /** - * 查询所有角色 - * - * @return 角色列表 - */ - public List selectRoleAll(); - - /** - * 根据用户ID获取角色选择框列表 - * - * @param userId 用户ID - * @return 选中角色ID列表 - */ - public List selectRoleListByUserId(Long userId); - - /** - * 通过角色ID查询角色 - * - * @param roleId 角色ID - * @return 角色对象信息 - */ - public SysRole selectRoleById(Long roleId); - - /** - * 根据用户ID查询角色 - * - * @param userName 用户名 - * @return 角色列表 - */ - public List selectRolesByUserName(String userName); - - /** - * 校验角色名称是否唯一 - * - * @param roleName 角色名称 - * @return 角色信息 - */ - public SysRole checkRoleNameUnique(String roleName); - - /** - * 校验角色权限是否唯一 - * - * @param roleKey 角色权限 - * @return 角色信息 - */ - public SysRole checkRoleKeyUnique(String roleKey); - - /** - * 修改角色信息 - * - * @param role 角色信息 - * @return 结果 - */ - public int updateRole(SysRole role); - - /** - * 新增角色信息 - * - * @param role 角色信息 - * @return 结果 - */ - public int insertRole(SysRole role); - - /** - * 通过角色ID删除角色 - * - * @param roleId 角色ID - * @return 结果 - */ - public int deleteRoleById(Long roleId); - - /** - * 批量删除角色信息 - * - * @param roleIds 需要删除的角色ID - * @return 结果 - */ - public int deleteRoleByIds(Long[] roleIds); - - @Select("SELECT * FROM sys_role where role_key = #{roleKey}") - SysRole selectRoleByKey(String roleKey); -} diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysRoleMenuMapper.java b/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysRoleMenuMapper.java deleted file mode 100644 index 6602bee..0000000 --- a/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysRoleMenuMapper.java +++ /dev/null @@ -1,44 +0,0 @@ -package com.ruoyi.system.mapper; - -import java.util.List; -import com.ruoyi.system.domain.SysRoleMenu; - -/** - * 角色与菜单关联表 数据层 - * - * @author ruoyi - */ -public interface SysRoleMenuMapper -{ - /** - * 查询菜单使用数量 - * - * @param menuId 菜单ID - * @return 结果 - */ - public int checkMenuExistRole(Long menuId); - - /** - * 通过角色ID删除角色和菜单关联 - * - * @param roleId 角色ID - * @return 结果 - */ - public int deleteRoleMenuByRoleId(Long roleId); - - /** - * 批量删除角色菜单关联信息 - * - * @param ids 需要删除的数据ID - * @return 结果 - */ - public int deleteRoleMenu(Long[] ids); - - /** - * 批量新增角色菜单信息 - * - * @param roleMenuList 角色菜单列表 - * @return 结果 - */ - public int batchRoleMenu(List roleMenuList); -} diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysUserMapper.java b/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysUserMapper.java deleted file mode 100644 index dd8309f..0000000 --- a/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysUserMapper.java +++ /dev/null @@ -1,136 +0,0 @@ -package com.ruoyi.system.mapper; - -import java.util.Collection; -import java.util.List; - -import com.baomidou.mybatisplus.core.mapper.BaseMapper; -import org.apache.ibatis.annotations.Param; -import com.ruoyi.common.core.domain.entity.SysUser; -import org.apache.ibatis.annotations.Select; - -/** - * 用户表 数据层 - * - * @author ruoyi - */ -public interface SysUserMapper -{ - /** - * 根据条件分页查询用户列表 - * - * @param sysUser 用户信息 - * @return 用户信息集合信息 - */ - public List selectUserList(SysUser sysUser); - - /** - * 根据条件分页查询未已配用户角色列表 - * - * @param user 用户信息 - * @return 用户信息集合信息 - */ - public List selectAllocatedList(SysUser user); - - /** - * 根据条件分页查询未分配用户角色列表 - * - * @param user 用户信息 - * @return 用户信息集合信息 - */ - public List selectUnallocatedList(SysUser user); - - /** - * 通过用户名查询用户 - * - * @param userName 用户名 - * @return 用户对象信息 - */ - public SysUser selectUserByUserName(String userName); - - /** - * 通过用户ID查询用户 - * - * @param userId 用户ID - * @return 用户对象信息 - */ - public SysUser selectUserById(Long userId); - - /** - * 新增用户信息 - * - * @param user 用户信息 - * @return 结果 - */ - public int insertUser(SysUser user); - - /** - * 修改用户信息 - * - * @param user 用户信息 - * @return 结果 - */ - public int updateUser(SysUser user); - - /** - * 修改用户头像 - * - * @param userName 用户名 - * @param avatar 头像地址 - * @return 结果 - */ - public int updateUserAvatar(@Param("userName") String userName, @Param("avatar") String avatar); - - /** - * 重置用户密码 - * - * @param userName 用户名 - * @param password 密码 - * @return 结果 - */ - public int resetUserPwd(@Param("userName") String userName, @Param("password") String password); - - /** - * 通过用户ID删除用户 - * - * @param userId 用户ID - * @return 结果 - */ - public int deleteUserById(Long userId); - - /** - * 批量删除用户信息 - * - * @param userIds 需要删除的用户ID - * @return 结果 - */ - public int deleteUserByIds(Long[] userIds); - - /** - * 校验用户名称是否唯一 - * - * @param userName 用户名称 - * @return 结果 - */ - public int checkUserNameUnique(String userName); - - /** - * 校验手机号码是否唯一 - * - * @param phonenumber 手机号码 - * @return 结果 - */ - public SysUser checkPhoneUnique(String phonenumber); - - /** - * 校验email是否唯一 - * - * @param email 用户邮箱 - * @return 结果 - */ - public SysUser checkEmailUnique(String email); - - @Select("SELECT * from sys_user WHERE (phonenumber = #{phone} or user_name = #{phone}) limit 1") - SysUser selectUserByPhone(@Param("phone") String phone); - - List selectByBatchIds(@Param("list") Collection list); -} diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysUserPostMapper.java b/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysUserPostMapper.java deleted file mode 100644 index e08991d..0000000 --- a/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysUserPostMapper.java +++ /dev/null @@ -1,44 +0,0 @@ -package com.ruoyi.system.mapper; - -import java.util.List; -import com.ruoyi.system.domain.SysUserPost; - -/** - * 用户与岗位关联表 数据层 - * - * @author ruoyi - */ -public interface SysUserPostMapper -{ - /** - * 通过用户ID删除用户和岗位关联 - * - * @param userId 用户ID - * @return 结果 - */ - public int deleteUserPostByUserId(Long userId); - - /** - * 通过岗位ID查询岗位使用数量 - * - * @param postId 岗位ID - * @return 结果 - */ - public int countUserPostById(Long postId); - - /** - * 批量删除用户和岗位关联 - * - * @param ids 需要删除的数据ID - * @return 结果 - */ - public int deleteUserPost(Long[] ids); - - /** - * 批量新增用户岗位信息 - * - * @param userPostList 用户角色列表 - * @return 结果 - */ - public int batchUserPost(List userPostList); -} diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysUserRoleMapper.java b/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysUserRoleMapper.java deleted file mode 100644 index d1fa12a..0000000 --- a/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysUserRoleMapper.java +++ /dev/null @@ -1,67 +0,0 @@ -package com.ruoyi.system.mapper; - -import com.ruoyi.system.domain.SysUserRole; -import org.apache.ibatis.annotations.Param; -import org.apache.ibatis.annotations.Select; - -import java.util.List; - -/** - * 用户与角色关联表 数据层 - * - * @author ruoyi - */ -public interface SysUserRoleMapper -{ - /** - * 通过用户ID删除用户和角色关联 - * - * @param userId 用户ID - * @return 结果 - */ - public int deleteUserRoleByUserId(Long userId); - - /** - * 批量删除用户和角色关联 - * - * @param ids 需要删除的数据ID - * @return 结果 - */ - public int deleteUserRole(Long[] ids); - - /** - * 通过角色ID查询角色使用数量 - * - * @param roleId 角色ID - * @return 结果 - */ - public int countUserRoleByRoleId(Long roleId); - - /** - * 批量新增用户角色信息 - * - * @param userRoleList 用户角色列表 - * @return 结果 - */ - public int batchUserRole(List userRoleList); - - /** - * 删除用户和角色关联信息 - * - * @param userRole 用户和角色关联信息 - * @return 结果 - */ - public int deleteUserRoleInfo(SysUserRole userRole); - - /** - * 批量取消授权用户角色 - * - * @param roleId 角色ID - * @param userIds 需要删除的用户数据ID - * @return 结果 - */ - public int deleteUserRoleInfos(@Param("roleId") Long roleId, @Param("userIds") Long[] userIds); - - @Select("SELECT count(0) FROM sys_user_role WHERE user_id = #{userId} AND role_id = #{roleId}") - int countRoleAndUserId(@Param("roleId") Long roleId, @Param("userId") Long userId); -} diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service/ISysLogininforService.java b/ruoyi-system/src/main/java/com/ruoyi/system/service/ISysLogininforService.java deleted file mode 100644 index 96c4d54..0000000 --- a/ruoyi-system/src/main/java/com/ruoyi/system/service/ISysLogininforService.java +++ /dev/null @@ -1,40 +0,0 @@ -package com.ruoyi.system.service; - -import java.util.List; -import com.ruoyi.system.domain.SysLogininfor; - -/** - * 系统访问日志情况信息 服务层 - * - * @author ruoyi - */ -public interface ISysLogininforService -{ - /** - * 新增系统登录日志 - * - * @param logininfor 访问日志对象 - */ - public void insertLogininfor(SysLogininfor logininfor); - - /** - * 查询系统登录日志集合 - * - * @param logininfor 访问日志对象 - * @return 登录记录集合 - */ - public List selectLogininforList(SysLogininfor logininfor); - - /** - * 批量删除系统登录日志 - * - * @param infoIds 需要删除的登录日志ID - * @return - */ - public int deleteLogininforByIds(Long[] infoIds); - - /** - * 清空系统登录日志 - */ - public void cleanLogininfor(); -} diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service/ISysUserOnlineService.java b/ruoyi-system/src/main/java/com/ruoyi/system/service/ISysUserOnlineService.java deleted file mode 100644 index 8eb5448..0000000 --- a/ruoyi-system/src/main/java/com/ruoyi/system/service/ISysUserOnlineService.java +++ /dev/null @@ -1,48 +0,0 @@ -package com.ruoyi.system.service; - -import com.ruoyi.common.core.domain.model.LoginUser; -import com.ruoyi.system.domain.SysUserOnline; - -/** - * 在线用户 服务层 - * - * @author ruoyi - */ -public interface ISysUserOnlineService -{ - /** - * 通过登录地址查询信息 - * - * @param ipaddr 登录地址 - * @param user 用户信息 - * @return 在线用户信息 - */ - public SysUserOnline selectOnlineByIpaddr(String ipaddr, LoginUser user); - - /** - * 通过用户名称查询信息 - * - * @param userName 用户名称 - * @param user 用户信息 - * @return 在线用户信息 - */ - public SysUserOnline selectOnlineByUserName(String userName, LoginUser user); - - /** - * 通过登录地址/用户名称查询信息 - * - * @param ipaddr 登录地址 - * @param userName 用户名称 - * @param user 用户信息 - * @return 在线用户信息 - */ - public SysUserOnline selectOnlineByInfo(String ipaddr, String userName, LoginUser user); - - /** - * 设置在线用户信息 - * - * @param user 用户信息 - * @return 在线用户 - */ - public SysUserOnline loginUserToUserOnline(LoginUser user); -} diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service/PhoneCodeService.java b/ruoyi-system/src/main/java/com/ruoyi/system/service/PhoneCodeService.java deleted file mode 100644 index 461a6be..0000000 --- a/ruoyi-system/src/main/java/com/ruoyi/system/service/PhoneCodeService.java +++ /dev/null @@ -1,65 +0,0 @@ -package com.ruoyi.system.service; - -import cn.hutool.core.util.StrUtil; -import com.ruoyi.common.exception.GlobalException; -import lombok.extern.slf4j.Slf4j; -import org.springframework.stereotype.Service; - -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; - -@Service -@Slf4j -public class PhoneCodeService { - public boolean obtainCode(String uuid, String phone) { - if (StrUtil.isEmpty(uuid)) { - throw new GlobalException("uuid 为空"); - } - if (StrUtil.isEmpty(phone)) { - throw new GlobalException("手机号码为空"); - } - if (!phone.matches("^1\\d{10}$")) { - throw new GlobalException("手机号码错误"); - } - String code = createRandom(true, 6); - sendCode(uuid, phone, code); - log.debug("uuid: {}, phone: {}, code: {}" , uuid, phone, code); - return true; - } - - public static String createRandom(boolean numberFlag, int length) { - String retStr = ""; - String strTable = numberFlag ? "1234567890" : "1234567890abcdefghijkmnpqrstuvwxyz"; - int len = strTable.length(); - boolean bDone = true; - do { - retStr = ""; - int count = 0; - for (int i = 0; i < length; i++) { - double dblR = Math.random() * len; - int intR = (int) Math.floor(dblR); - char c = strTable.charAt(intR); - if (('0' <= c) && (c <= '9')) { - count++; - } - retStr += strTable.charAt(intR); - } - if (count >= 2) { - bDone = false; - } - } while (bDone); - return retStr; - } - - private Map codeCache = new HashMap<>(); - - public void sendCode(String uuid, String phone, String code) { - codeCache.put(uuid + "_" + phone, code); - } - - public boolean validCode(String uuid, String phone, String code) { - return Objects.equals(code, codeCache.get(uuid + "_" + phone)); - } - -} diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysConfigServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysConfigServiceImpl.java deleted file mode 100644 index 6f5e5e4..0000000 --- a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysConfigServiceImpl.java +++ /dev/null @@ -1,227 +0,0 @@ -package com.ruoyi.system.service.impl; - -import com.ruoyi.common.annotation.DataSource; -import com.ruoyi.common.constant.Constants; -import com.ruoyi.common.constant.UserConstants; -import com.ruoyi.common.core.redis.RedisCache; -import com.ruoyi.common.core.text.Convert; -import com.ruoyi.common.enums.DataSourceType; -import com.ruoyi.common.exception.ServiceException; -import com.ruoyi.common.utils.StringUtils; -import com.ruoyi.system.domain.SysConfig; -import com.ruoyi.system.mapper.SysConfigMapper; -import com.ruoyi.system.service.ISysConfigService; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; -import javax.annotation.PostConstruct; -import java.util.Collection; -import java.util.List; - -/** - * 参数配置 服务层实现 - * - * @author ruoyi - */ -@Service -public class SysConfigServiceImpl implements ISysConfigService -{ - @Autowired - private SysConfigMapper configMapper; - - @Autowired - private RedisCache redisCache; - - /** - * 项目启动时,初始化参数到缓存 - */ - @PostConstruct - public void init() - { - loadingConfigCache(); - } - - /** - * 查询参数配置信息 - * - * @param configId 参数配置ID - * @return 参数配置信息 - */ - @Override - @DataSource(DataSourceType.MASTER) - public SysConfig selectConfigById(Long configId) - { - SysConfig config = new SysConfig(); - config.setConfigId(configId); - return configMapper.selectConfig(config); - } - - /** - * 根据键名查询参数配置信息 - * - * @param configKey 参数key - * @return 参数键值 - */ - @Override - public String selectConfigByKey(String configKey) - { - String configValue = Convert.toStr(redisCache.getCacheObject(getCacheKey(configKey))); - if (StringUtils.isNotEmpty(configValue)) - { - return configValue; - } - SysConfig config = new SysConfig(); - config.setConfigKey(configKey); - SysConfig retConfig = configMapper.selectConfig(config); - if (StringUtils.isNotNull(retConfig)) - { - redisCache.setCacheObject(getCacheKey(configKey), retConfig.getConfigValue()); - return retConfig.getConfigValue(); - } - return StringUtils.EMPTY; - } - - /** - * 获取验证码开关 - * - * @return true开启,false关闭 - */ - @Override - public boolean selectCaptchaOnOff() - { - String captchaOnOff = selectConfigByKey("sys.account.captchaOnOff"); - if (StringUtils.isEmpty(captchaOnOff)) - { - return true; - } - return Convert.toBool(captchaOnOff); - } - - /** - * 查询参数配置列表 - * - * @param config 参数配置信息 - * @return 参数配置集合 - */ - @Override - public List selectConfigList(SysConfig config) - { - return configMapper.selectConfigList(config); - } - - /** - * 新增参数配置 - * - * @param config 参数配置信息 - * @return 结果 - */ - @Override - public int insertConfig(SysConfig config) - { - int row = configMapper.insertConfig(config); - if (row > 0) - { - redisCache.setCacheObject(getCacheKey(config.getConfigKey()), config.getConfigValue()); - } - return row; - } - - /** - * 修改参数配置 - * - * @param config 参数配置信息 - * @return 结果 - */ - @Override - public int updateConfig(SysConfig config) - { - int row = configMapper.updateConfig(config); - if (row > 0) - { - redisCache.setCacheObject(getCacheKey(config.getConfigKey()), config.getConfigValue()); - } - return row; - } - - /** - * 批量删除参数信息 - * - * @param configIds 需要删除的参数ID - * @return 结果 - */ - @Override - public void deleteConfigByIds(Long[] configIds) - { - for (Long configId : configIds) - { - SysConfig config = selectConfigById(configId); - if (StringUtils.equals(UserConstants.YES, config.getConfigType())) - { - throw new ServiceException(String.format("内置参数【%1$s】不能删除 ", config.getConfigKey())); - } - configMapper.deleteConfigById(configId); - redisCache.deleteObject(getCacheKey(config.getConfigKey())); - } - } - - /** - * 加载参数缓存数据 - */ - @Override - public void loadingConfigCache() - { - List configsList = configMapper.selectConfigList(new SysConfig()); - for (SysConfig config : configsList) - { - redisCache.setCacheObject(getCacheKey(config.getConfigKey()), config.getConfigValue()); - } - } - - /** - * 清空参数缓存数据 - */ - @Override - public void clearConfigCache() - { - Collection keys = redisCache.keys(Constants.SYS_CONFIG_KEY + "*"); - redisCache.deleteObject(keys); - } - - /** - * 重置参数缓存数据 - */ - @Override - public void resetConfigCache() - { - clearConfigCache(); - loadingConfigCache(); - } - - /** - * 校验参数键名是否唯一 - * - * @param config 参数配置信息 - * @return 结果 - */ - @Override - public String checkConfigKeyUnique(SysConfig config) - { - Long configId = StringUtils.isNull(config.getConfigId()) ? -1L : config.getConfigId(); - SysConfig info = configMapper.checkConfigKeyUnique(config.getConfigKey()); - if (StringUtils.isNotNull(info) && info.getConfigId().longValue() != configId.longValue()) - { - return UserConstants.NOT_UNIQUE; - } - return UserConstants.UNIQUE; - } - - /** - * 设置cache key - * - * @param configKey 参数键 - * @return 缓存键key - */ - private String getCacheKey(String configKey) - { - return Constants.SYS_CONFIG_KEY + configKey; - } -} diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysDeptServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysDeptServiceImpl.java deleted file mode 100644 index 46f75a3..0000000 --- a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysDeptServiceImpl.java +++ /dev/null @@ -1,330 +0,0 @@ -package com.ruoyi.system.service.impl; - -import java.util.ArrayList; -import java.util.Iterator; -import java.util.List; -import java.util.stream.Collectors; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; -import com.ruoyi.common.annotation.DataScope; -import com.ruoyi.common.constant.UserConstants; -import com.ruoyi.common.core.domain.TreeSelect; -import com.ruoyi.common.core.domain.entity.SysDept; -import com.ruoyi.common.core.domain.entity.SysRole; -import com.ruoyi.common.core.domain.entity.SysUser; -import com.ruoyi.common.core.text.Convert; -import com.ruoyi.common.exception.ServiceException; -import com.ruoyi.common.utils.SecurityUtils; -import com.ruoyi.common.utils.StringUtils; -import com.ruoyi.common.utils.spring.SpringUtils; -import com.ruoyi.system.mapper.SysDeptMapper; -import com.ruoyi.system.mapper.SysRoleMapper; -import com.ruoyi.system.service.ISysDeptService; - -/** - * 部门管理 服务实现 - * - * @author ruoyi - */ -@Service -public class SysDeptServiceImpl implements ISysDeptService -{ - @Autowired - private SysDeptMapper deptMapper; - - @Autowired - private SysRoleMapper roleMapper; - - /** - * 查询部门管理数据 - * - * @param dept 部门信息 - * @return 部门信息集合 - */ - @Override - @DataScope(deptAlias = "d") - public List selectDeptList(SysDept dept) - { - return deptMapper.selectDeptList(dept); - } - - /** - * 构建前端所需要树结构 - * - * @param depts 部门列表 - * @return 树结构列表 - */ - @Override - public List buildDeptTree(List depts) - { - List returnList = new ArrayList(); - List tempList = new ArrayList(); - for (SysDept dept : depts) - { - tempList.add(dept.getDeptId()); - } - for (Iterator iterator = depts.iterator(); iterator.hasNext();) - { - SysDept dept = (SysDept) iterator.next(); - // 如果是顶级节点, 遍历该父节点的所有子节点 - if (!tempList.contains(dept.getParentId())) - { - recursionFn(depts, dept); - returnList.add(dept); - } - } - if (returnList.isEmpty()) - { - returnList = depts; - } - return returnList; - } - - /** - * 构建前端所需要下拉树结构 - * - * @param depts 部门列表 - * @return 下拉树结构列表 - */ - @Override - public List buildDeptTreeSelect(List depts) - { - List deptTrees = buildDeptTree(depts); - return deptTrees.stream().map(TreeSelect::new).collect(Collectors.toList()); - } - - /** - * 根据角色ID查询部门树信息 - * - * @param roleId 角色ID - * @return 选中部门列表 - */ - @Override - public List selectDeptListByRoleId(Long roleId) - { - SysRole role = roleMapper.selectRoleById(roleId); - return deptMapper.selectDeptListByRoleId(roleId, role.isDeptCheckStrictly()); - } - - /** - * 根据部门ID查询信息 - * - * @param deptId 部门ID - * @return 部门信息 - */ - @Override - public SysDept selectDeptById(Long deptId) - { - return deptMapper.selectDeptById(deptId); - } - - /** - * 根据ID查询所有子部门(正常状态) - * - * @param deptId 部门ID - * @return 子部门数 - */ - @Override - public int selectNormalChildrenDeptById(Long deptId) - { - return deptMapper.selectNormalChildrenDeptById(deptId); - } - - /** - * 是否存在子节点 - * - * @param deptId 部门ID - * @return 结果 - */ - @Override - public boolean hasChildByDeptId(Long deptId) - { - int result = deptMapper.hasChildByDeptId(deptId); - return result > 0 ? true : false; - } - - /** - * 查询部门是否存在用户 - * - * @param deptId 部门ID - * @return 结果 true 存在 false 不存在 - */ - @Override - public boolean checkDeptExistUser(Long deptId) - { - int result = deptMapper.checkDeptExistUser(deptId); - return result > 0 ? true : false; - } - - /** - * 校验部门名称是否唯一 - * - * @param dept 部门信息 - * @return 结果 - */ - @Override - public String checkDeptNameUnique(SysDept dept) - { - Long deptId = StringUtils.isNull(dept.getDeptId()) ? -1L : dept.getDeptId(); - SysDept info = deptMapper.checkDeptNameUnique(dept.getDeptName(), dept.getParentId()); - if (StringUtils.isNotNull(info) && info.getDeptId().longValue() != deptId.longValue()) - { - return UserConstants.NOT_UNIQUE; - } - return UserConstants.UNIQUE; - } - - /** - * 校验部门是否有数据权限 - * - * @param deptId 部门id - */ - @Override - public void checkDeptDataScope(Long deptId) - { - if (!SysUser.isAdmin(SecurityUtils.getUserId())) - { - SysDept dept = new SysDept(); - dept.setDeptId(deptId); - List depts = SpringUtils.getAopProxy(this).selectDeptList(dept); - if (StringUtils.isEmpty(depts)) - { - throw new ServiceException("没有权限访问部门数据!"); - } - } - } - - /** - * 新增保存部门信息 - * - * @param dept 部门信息 - * @return 结果 - */ - @Override - public int insertDept(SysDept dept) - { - SysDept info = deptMapper.selectDeptById(dept.getParentId()); - // 如果父节点不为正常状态,则不允许新增子节点 - if (!UserConstants.DEPT_NORMAL.equals(info.getStatus())) - { - throw new ServiceException("部门停用,不允许新增"); - } - dept.setAncestors(info.getAncestors() + "," + dept.getParentId()); - return deptMapper.insertDept(dept); - } - - /** - * 修改保存部门信息 - * - * @param dept 部门信息 - * @return 结果 - */ - @Override - public int updateDept(SysDept dept) - { - SysDept newParentDept = deptMapper.selectDeptById(dept.getParentId()); - SysDept oldDept = deptMapper.selectDeptById(dept.getDeptId()); - if (StringUtils.isNotNull(newParentDept) && StringUtils.isNotNull(oldDept)) - { - String newAncestors = newParentDept.getAncestors() + "," + newParentDept.getDeptId(); - String oldAncestors = oldDept.getAncestors(); - dept.setAncestors(newAncestors); - updateDeptChildren(dept.getDeptId(), newAncestors, oldAncestors); - } - int result = deptMapper.updateDept(dept); - if (UserConstants.DEPT_NORMAL.equals(dept.getStatus()) && StringUtils.isNotEmpty(dept.getAncestors()) - && !StringUtils.equals("0", dept.getAncestors())) - { - // 如果该部门是启用状态,则启用该部门的所有上级部门 - updateParentDeptStatusNormal(dept); - } - return result; - } - - /** - * 修改该部门的父级部门状态 - * - * @param dept 当前部门 - */ - private void updateParentDeptStatusNormal(SysDept dept) - { - String ancestors = dept.getAncestors(); - Long[] deptIds = Convert.toLongArray(ancestors); - deptMapper.updateDeptStatusNormal(deptIds); - } - - /** - * 修改子元素关系 - * - * @param deptId 被修改的部门ID - * @param newAncestors 新的父ID集合 - * @param oldAncestors 旧的父ID集合 - */ - public void updateDeptChildren(Long deptId, String newAncestors, String oldAncestors) - { - List children = deptMapper.selectChildrenDeptById(deptId); - for (SysDept child : children) - { - child.setAncestors(child.getAncestors().replaceFirst(oldAncestors, newAncestors)); - } - if (children.size() > 0) - { - deptMapper.updateDeptChildren(children); - } - } - - /** - * 删除部门管理信息 - * - * @param deptId 部门ID - * @return 结果 - */ - @Override - public int deleteDeptById(Long deptId) - { - return deptMapper.deleteDeptById(deptId); - } - - /** - * 递归列表 - */ - private void recursionFn(List list, SysDept t) - { - // 得到子节点列表 - List childList = getChildList(list, t); - t.setChildren(childList); - for (SysDept tChild : childList) - { - if (hasChild(list, tChild)) - { - recursionFn(list, tChild); - } - } - } - - /** - * 得到子节点列表 - */ - private List getChildList(List list, SysDept t) - { - List tlist = new ArrayList(); - Iterator it = list.iterator(); - while (it.hasNext()) - { - SysDept n = (SysDept) it.next(); - if (StringUtils.isNotNull(n.getParentId()) && n.getParentId().longValue() == t.getDeptId().longValue()) - { - tlist.add(n); - } - } - return tlist; - } - - /** - * 判断是否有子节点 - */ - private boolean hasChild(List list, SysDept t) - { - return getChildList(list, t).size() > 0 ? true : false; - } -} diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysDictDataServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysDictDataServiceImpl.java deleted file mode 100644 index 34d6282..0000000 --- a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysDictDataServiceImpl.java +++ /dev/null @@ -1,123 +0,0 @@ -package com.ruoyi.system.service.impl; - -import java.util.Collection; -import java.util.List; - -import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; -import com.ruoyi.common.core.domain.entity.SysDictData; -import com.ruoyi.common.utils.DictUtils; -import com.ruoyi.system.mapper.SysDictDataMapper; -import com.ruoyi.system.service.ISysDictDataService; - -/** - * 字典 业务层处理 - * - * @author ruoyi - */ -@Service -public class SysDictDataServiceImpl implements ISysDictDataService -{ - @Autowired - private SysDictDataMapper dictDataMapper; - - /** - * 根据条件分页查询字典数据 - * - * @param dictData 字典数据信息 - * @return 字典数据集合信息 - */ - @Override - public List selectDictDataList(SysDictData dictData) - { - return dictDataMapper.selectDictDataList(dictData); - } - - /** - * 根据字典类型和字典键值查询字典数据信息 - * - * @param dictType 字典类型 - * @param dictValue 字典键值 - * @return 字典标签 - */ - @Override - public String selectDictLabel(String dictType, String dictValue) - { - return dictDataMapper.selectDictLabel(dictType, dictValue); - } - - /** - * 根据字典数据ID查询信息 - * - * @param dictCode 字典数据ID - * @return 字典数据 - */ - @Override - public SysDictData selectDictDataById(Long dictCode) - { - return dictDataMapper.selectDictDataById(dictCode); - } - - /** - * 批量删除字典数据信息 - * - * @param dictCodes 需要删除的字典数据ID - * @return 结果 - */ - @Override - public void deleteDictDataByIds(Long[] dictCodes) - { - for (Long dictCode : dictCodes) - { - SysDictData data = selectDictDataById(dictCode); - dictDataMapper.deleteDictDataById(dictCode); - List dictDatas = dictDataMapper.selectDictDataByType(data.getDictType()); - DictUtils.setDictCache(data.getDictType(), dictDatas); - } - } - - /** - * 新增保存字典数据信息 - * - * @param data 字典数据信息 - * @return 结果 - */ - @Override - public int insertDictData(SysDictData data) - { - int row = dictDataMapper.insertDictData(data); - if (row > 0) - { - List dictDatas = dictDataMapper.selectDictDataByType(data.getDictType()); - DictUtils.setDictCache(data.getDictType(), dictDatas); - } - return row; - } - - /** - * 修改保存字典数据信息 - * - * @param data 字典数据信息 - * @return 结果 - */ - @Override - public int updateDictData(SysDictData data) - { - int row = dictDataMapper.updateDictData(data); - if (row > 0) - { - List dictDatas = dictDataMapper.selectDictDataByType(data.getDictType()); - DictUtils.setDictCache(data.getDictType(), dictDatas); - } - return row; - } - - @Override - public List selectDictDataByTypes(Collection dictTypes) { - LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper<>(); - queryWrapper.select(SysDictData::getDictCode, SysDictData::getDictValue, SysDictData::getDictLabel, SysDictData::getDictType); - queryWrapper.in(SysDictData::getDictType, dictTypes); - return dictDataMapper.selectList(queryWrapper); - } -} diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysDictTypeServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysDictTypeServiceImpl.java deleted file mode 100644 index 8e75c4f..0000000 --- a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysDictTypeServiceImpl.java +++ /dev/null @@ -1,220 +0,0 @@ -package com.ruoyi.system.service.impl; - -import com.ruoyi.common.constant.UserConstants; -import com.ruoyi.common.core.domain.entity.SysDictData; -import com.ruoyi.common.core.domain.entity.SysDictType; -import com.ruoyi.common.exception.ServiceException; -import com.ruoyi.common.utils.DictUtils; -import com.ruoyi.common.utils.StringUtils; -import com.ruoyi.system.mapper.SysDictDataMapper; -import com.ruoyi.system.mapper.SysDictTypeMapper; -import com.ruoyi.system.service.ISysDictTypeService; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; -import org.springframework.transaction.annotation.Transactional; -import javax.annotation.PostConstruct; -import java.util.List; - -/** - * 字典 业务层处理 - * - * @author ruoyi - */ -@Service -public class SysDictTypeServiceImpl implements ISysDictTypeService -{ - @Autowired - private SysDictTypeMapper dictTypeMapper; - - @Autowired - private SysDictDataMapper dictDataMapper; - - /** - * 项目启动时,初始化字典到缓存 - */ - @PostConstruct - public void init() - { - loadingDictCache(); - } - - /** - * 根据条件分页查询字典类型 - * - * @param dictType 字典类型信息 - * @return 字典类型集合信息 - */ - @Override - public List selectDictTypeList(SysDictType dictType) - { - return dictTypeMapper.selectDictTypeList(dictType); - } - - /** - * 根据所有字典类型 - * - * @return 字典类型集合信息 - */ - @Override - public List selectDictTypeAll() - { - return dictTypeMapper.selectDictTypeAll(); - } - - /** - * 根据字典类型查询字典数据 - * - * @param dictType 字典类型 - * @return 字典数据集合信息 - */ - @Override - public List selectDictDataByType(String dictType) - { - List dictDatas = DictUtils.getDictCache(dictType); - if (StringUtils.isNotEmpty(dictDatas)) - { - return dictDatas; - } - dictDatas = dictDataMapper.selectDictDataByType(dictType); - if (StringUtils.isNotEmpty(dictDatas)) - { - DictUtils.setDictCache(dictType, dictDatas); - return dictDatas; - } - return null; - } - - /** - * 根据字典类型ID查询信息 - * - * @param dictId 字典类型ID - * @return 字典类型 - */ - @Override - public SysDictType selectDictTypeById(Long dictId) - { - return dictTypeMapper.selectDictTypeById(dictId); - } - - /** - * 根据字典类型查询信息 - * - * @param dictType 字典类型 - * @return 字典类型 - */ - @Override - public SysDictType selectDictTypeByType(String dictType) - { - return dictTypeMapper.selectDictTypeByType(dictType); - } - - /** - * 批量删除字典类型信息 - * - * @param dictIds 需要删除的字典ID - * @return 结果 - */ - @Override - public void deleteDictTypeByIds(Long[] dictIds) - { - for (Long dictId : dictIds) - { - SysDictType dictType = selectDictTypeById(dictId); - if (dictDataMapper.countDictDataByType(dictType.getDictType()) > 0) - { - throw new ServiceException(String.format("%1$s已分配,不能删除", dictType.getDictName())); - } - dictTypeMapper.deleteDictTypeById(dictId); - DictUtils.removeDictCache(dictType.getDictType()); - } - } - - /** - * 加载字典缓存数据 - */ - @Override - public void loadingDictCache() - { - List dictTypeList = dictTypeMapper.selectDictTypeAll(); - for (SysDictType dictType : dictTypeList) - { - List dictDatas = dictDataMapper.selectDictDataByType(dictType.getDictType()); - DictUtils.setDictCache(dictType.getDictType(), dictDatas); - } - } - - /** - * 清空字典缓存数据 - */ - @Override - public void clearDictCache() - { - DictUtils.clearDictCache(); - } - - /** - * 重置字典缓存数据 - */ - @Override - public void resetDictCache() - { - clearDictCache(); - loadingDictCache(); - } - - /** - * 新增保存字典类型信息 - * - * @param dict 字典类型信息 - * @return 结果 - */ - @Override - public int insertDictType(SysDictType dict) - { - int row = dictTypeMapper.insertDictType(dict); - if (row > 0) - { - DictUtils.setDictCache(dict.getDictType(), null); - } - return row; - } - - /** - * 修改保存字典类型信息 - * - * @param dict 字典类型信息 - * @return 结果 - */ - @Override - @Transactional - public int updateDictType(SysDictType dict) - { - SysDictType oldDict = dictTypeMapper.selectDictTypeById(dict.getDictId()); - dictDataMapper.updateDictDataType(oldDict.getDictType(), dict.getDictType()); - int row = dictTypeMapper.updateDictType(dict); - if (row > 0) - { - List dictDatas = dictDataMapper.selectDictDataByType(dict.getDictType()); - DictUtils.setDictCache(dict.getDictType(), dictDatas); - } - return row; - } - - /** - * 校验字典类型称是否唯一 - * - * @param dict 字典类型 - * @return 结果 - */ - @Override - public String checkDictTypeUnique(SysDictType dict) - { - Long dictId = StringUtils.isNull(dict.getDictId()) ? -1L : dict.getDictId(); - SysDictType dictType = dictTypeMapper.checkDictTypeUnique(dict.getDictType()); - if (StringUtils.isNotNull(dictType) && dictType.getDictId().longValue() != dictId.longValue()) - { - return UserConstants.NOT_UNIQUE; - } - return UserConstants.UNIQUE; - } -} diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysLogininforServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysLogininforServiceImpl.java deleted file mode 100644 index a3b5257..0000000 --- a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysLogininforServiceImpl.java +++ /dev/null @@ -1,65 +0,0 @@ -package com.ruoyi.system.service.impl; - -import java.util.List; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; -import com.ruoyi.system.domain.SysLogininfor; -import com.ruoyi.system.mapper.SysLogininforMapper; -import com.ruoyi.system.service.ISysLogininforService; - -/** - * 系统访问日志情况信息 服务层处理 - * - * @author ruoyi - */ -@Service -public class SysLogininforServiceImpl implements ISysLogininforService -{ - - @Autowired - private SysLogininforMapper logininforMapper; - - /** - * 新增系统登录日志 - * - * @param logininfor 访问日志对象 - */ - @Override - public void insertLogininfor(SysLogininfor logininfor) - { - logininforMapper.insertLogininfor(logininfor); - } - - /** - * 查询系统登录日志集合 - * - * @param logininfor 访问日志对象 - * @return 登录记录集合 - */ - @Override - public List selectLogininforList(SysLogininfor logininfor) - { - return logininforMapper.selectLogininforList(logininfor); - } - - /** - * 批量删除系统登录日志 - * - * @param infoIds 需要删除的登录日志ID - * @return - */ - @Override - public int deleteLogininforByIds(Long[] infoIds) - { - return logininforMapper.deleteLogininforByIds(infoIds); - } - - /** - * 清空系统登录日志 - */ - @Override - public void cleanLogininfor() - { - logininforMapper.cleanLogininfor(); - } -} diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysNoticeServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysNoticeServiceImpl.java deleted file mode 100644 index 765438b..0000000 --- a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysNoticeServiceImpl.java +++ /dev/null @@ -1,92 +0,0 @@ -package com.ruoyi.system.service.impl; - -import java.util.List; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; -import com.ruoyi.system.domain.SysNotice; -import com.ruoyi.system.mapper.SysNoticeMapper; -import com.ruoyi.system.service.ISysNoticeService; - -/** - * 公告 服务层实现 - * - * @author ruoyi - */ -@Service -public class SysNoticeServiceImpl implements ISysNoticeService -{ - @Autowired - private SysNoticeMapper noticeMapper; - - /** - * 查询公告信息 - * - * @param noticeId 公告ID - * @return 公告信息 - */ - @Override - public SysNotice selectNoticeById(Long noticeId) - { - return noticeMapper.selectNoticeById(noticeId); - } - - /** - * 查询公告列表 - * - * @param notice 公告信息 - * @return 公告集合 - */ - @Override - public List selectNoticeList(SysNotice notice) - { - return noticeMapper.selectNoticeList(notice); - } - - /** - * 新增公告 - * - * @param notice 公告信息 - * @return 结果 - */ - @Override - public int insertNotice(SysNotice notice) - { - return noticeMapper.insertNotice(notice); - } - - /** - * 修改公告 - * - * @param notice 公告信息 - * @return 结果 - */ - @Override - public int updateNotice(SysNotice notice) - { - return noticeMapper.updateNotice(notice); - } - - /** - * 删除公告对象 - * - * @param noticeId 公告ID - * @return 结果 - */ - @Override - public int deleteNoticeById(Long noticeId) - { - return noticeMapper.deleteNoticeById(noticeId); - } - - /** - * 批量删除公告信息 - * - * @param noticeIds 需要删除的公告ID - * @return 结果 - */ - @Override - public int deleteNoticeByIds(Long[] noticeIds) - { - return noticeMapper.deleteNoticeByIds(noticeIds); - } -} diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysOperLogServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysOperLogServiceImpl.java deleted file mode 100644 index 5489815..0000000 --- a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysOperLogServiceImpl.java +++ /dev/null @@ -1,76 +0,0 @@ -package com.ruoyi.system.service.impl; - -import java.util.List; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; -import com.ruoyi.system.domain.SysOperLog; -import com.ruoyi.system.mapper.SysOperLogMapper; -import com.ruoyi.system.service.ISysOperLogService; - -/** - * 操作日志 服务层处理 - * - * @author ruoyi - */ -@Service -public class SysOperLogServiceImpl implements ISysOperLogService -{ - @Autowired - private SysOperLogMapper operLogMapper; - - /** - * 新增操作日志 - * - * @param operLog 操作日志对象 - */ - @Override - public void insertOperlog(SysOperLog operLog) - { - operLogMapper.insertOperlog(operLog); - } - - /** - * 查询系统操作日志集合 - * - * @param operLog 操作日志对象 - * @return 操作日志集合 - */ - @Override - public List selectOperLogList(SysOperLog operLog) - { - return operLogMapper.selectOperLogList(operLog); - } - - /** - * 批量删除系统操作日志 - * - * @param operIds 需要删除的操作日志ID - * @return 结果 - */ - @Override - public int deleteOperLogByIds(Long[] operIds) - { - return operLogMapper.deleteOperLogByIds(operIds); - } - - /** - * 查询操作日志详细 - * - * @param operId 操作ID - * @return 操作日志对象 - */ - @Override - public SysOperLog selectOperLogById(Long operId) - { - return operLogMapper.selectOperLogById(operId); - } - - /** - * 清空操作日志 - */ - @Override - public void cleanOperLog() - { - operLogMapper.cleanOperLog(); - } -} diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysPostServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysPostServiceImpl.java deleted file mode 100644 index 46805ef..0000000 --- a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysPostServiceImpl.java +++ /dev/null @@ -1,179 +0,0 @@ -package com.ruoyi.system.service.impl; - -import java.util.List; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; -import com.ruoyi.common.constant.UserConstants; -import com.ruoyi.common.exception.ServiceException; -import com.ruoyi.common.utils.StringUtils; -import com.ruoyi.system.domain.SysPost; -import com.ruoyi.system.mapper.SysPostMapper; -import com.ruoyi.system.mapper.SysUserPostMapper; -import com.ruoyi.system.service.ISysPostService; - -/** - * 岗位信息 服务层处理 - * - * @author ruoyi - */ -@Service -public class SysPostServiceImpl implements ISysPostService -{ - @Autowired - private SysPostMapper postMapper; - - @Autowired - private SysUserPostMapper userPostMapper; - - /** - * 查询岗位信息集合 - * - * @param post 岗位信息 - * @return 岗位信息集合 - */ - @Override - public List selectPostList(SysPost post) - { - return postMapper.selectPostList(post); - } - - /** - * 查询所有岗位 - * - * @return 岗位列表 - */ - @Override - public List selectPostAll() - { - return postMapper.selectPostAll(); - } - - /** - * 通过岗位ID查询岗位信息 - * - * @param postId 岗位ID - * @return 角色对象信息 - */ - @Override - public SysPost selectPostById(Long postId) - { - return postMapper.selectPostById(postId); - } - - /** - * 根据用户ID获取岗位选择框列表 - * - * @param userId 用户ID - * @return 选中岗位ID列表 - */ - @Override - public List selectPostListByUserId(Long userId) - { - return postMapper.selectPostListByUserId(userId); - } - - /** - * 校验岗位名称是否唯一 - * - * @param post 岗位信息 - * @return 结果 - */ - @Override - public String checkPostNameUnique(SysPost post) - { - Long postId = StringUtils.isNull(post.getPostId()) ? -1L : post.getPostId(); - SysPost info = postMapper.checkPostNameUnique(post.getPostName()); - if (StringUtils.isNotNull(info) && info.getPostId().longValue() != postId.longValue()) - { - return UserConstants.NOT_UNIQUE; - } - return UserConstants.UNIQUE; - } - - /** - * 校验岗位编码是否唯一 - * - * @param post 岗位信息 - * @return 结果 - */ - @Override - public String checkPostCodeUnique(SysPost post) - { - Long postId = StringUtils.isNull(post.getPostId()) ? -1L : post.getPostId(); - SysPost info = postMapper.checkPostCodeUnique(post.getPostCode()); - if (StringUtils.isNotNull(info) && info.getPostId().longValue() != postId.longValue()) - { - return UserConstants.NOT_UNIQUE; - } - return UserConstants.UNIQUE; - } - - /** - * 通过岗位ID查询岗位使用数量 - * - * @param postId 岗位ID - * @return 结果 - */ - @Override - public int countUserPostById(Long postId) - { - return userPostMapper.countUserPostById(postId); - } - - /** - * 删除岗位信息 - * - * @param postId 岗位ID - * @return 结果 - */ - @Override - public int deletePostById(Long postId) - { - return postMapper.deletePostById(postId); - } - - /** - * 批量删除岗位信息 - * - * @param postIds 需要删除的岗位ID - * @return 结果 - * @throws Exception 异常 - */ - @Override - public int deletePostByIds(Long[] postIds) - { - for (Long postId : postIds) - { - SysPost post = selectPostById(postId); - if (countUserPostById(postId) > 0) - { - throw new ServiceException(String.format("%1$s已分配,不能删除", post.getPostName())); - } - } - return postMapper.deletePostByIds(postIds); - } - - /** - * 新增保存岗位信息 - * - * @param post 岗位信息 - * @return 结果 - */ - @Override - public int insertPost(SysPost post) - { - return postMapper.insertPost(post); - } - - /** - * 修改保存岗位信息 - * - * @param post 岗位信息 - * @return 结果 - */ - @Override - public int updatePost(SysPost post) - { - return postMapper.updatePost(post); - } -} diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysRoleServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysRoleServiceImpl.java deleted file mode 100644 index 352a5cc..0000000 --- a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysRoleServiceImpl.java +++ /dev/null @@ -1,440 +0,0 @@ -package com.ruoyi.system.service.impl; - -import com.ruoyi.common.annotation.DataScope; -import com.ruoyi.common.constant.UserConstants; -import com.ruoyi.common.core.domain.entity.SysRole; -import com.ruoyi.common.core.domain.entity.SysUser; -import com.ruoyi.common.exception.ServiceException; -import com.ruoyi.common.utils.SecurityUtils; -import com.ruoyi.common.utils.StringUtils; -import com.ruoyi.common.utils.spring.SpringUtils; -import com.ruoyi.system.domain.SysRoleDept; -import com.ruoyi.system.domain.SysRoleMenu; -import com.ruoyi.system.domain.SysUserRole; -import com.ruoyi.system.mapper.SysRoleDeptMapper; -import com.ruoyi.system.mapper.SysRoleMapper; -import com.ruoyi.system.mapper.SysRoleMenuMapper; -import com.ruoyi.system.mapper.SysUserRoleMapper; -import com.ruoyi.system.service.ISysRoleService; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; -import org.springframework.transaction.annotation.Transactional; - -import java.util.*; - -/** - * 角色 业务层处理 - * - * @author ruoyi - */ -@Service -public class SysRoleServiceImpl implements ISysRoleService -{ - @Autowired - private SysRoleMapper roleMapper; - - @Autowired - private SysRoleMenuMapper roleMenuMapper; - - @Autowired - private SysUserRoleMapper userRoleMapper; - - @Autowired - private SysRoleDeptMapper roleDeptMapper; - - /** - * 根据条件分页查询角色数据 - * - * @param role 角色信息 - * @return 角色数据集合信息 - */ - @Override - @DataScope(deptAlias = "d") - public List selectRoleList(SysRole role) - { - return roleMapper.selectRoleList(role); - } - - /** - * 根据用户ID查询角色 - * - * @param userId 用户ID - * @return 角色列表 - */ - @Override - public List selectRolesByUserId(Long userId) - { - List userRoles = roleMapper.selectRolePermissionByUserId(userId); - List roles = selectRoleAll(); - for (SysRole role : roles) - { - for (SysRole userRole : userRoles) - { - if (role.getRoleId().longValue() == userRole.getRoleId().longValue()) - { - role.setFlag(true); - break; - } - } - } - return roles; - } - - /** - * 根据用户ID查询权限 - * - * @param userId 用户ID - * @return 权限列表 - */ - @Override - public Set selectRolePermissionByUserId(Long userId) - { - List perms = roleMapper.selectRolePermissionByUserId(userId); - Set permsSet = new HashSet<>(); - for (SysRole perm : perms) - { - if (StringUtils.isNotNull(perm)) - { - permsSet.addAll(Arrays.asList(perm.getRoleKey().trim().split(","))); - } - } - return permsSet; - } - - /** - * 查询所有角色 - * - * @return 角色列表 - */ - @Override - public List selectRoleAll() - { - return SpringUtils.getAopProxy(this).selectRoleList(new SysRole()); - } - - /** - * 根据用户ID获取角色选择框列表 - * - * @param userId 用户ID - * @return 选中角色ID列表 - */ - @Override - public List selectRoleListByUserId(Long userId) - { - return roleMapper.selectRoleListByUserId(userId); - } - - /** - * 通过角色ID查询角色 - * - * @param roleId 角色ID - * @return 角色对象信息 - */ - @Override - public SysRole selectRoleById(Long roleId) - { - return roleMapper.selectRoleById(roleId); - } - - /** - * 校验角色名称是否唯一 - * - * @param role 角色信息 - * @return 结果 - */ - @Override - public String checkRoleNameUnique(SysRole role) - { - Long roleId = StringUtils.isNull(role.getRoleId()) ? -1L : role.getRoleId(); - SysRole info = roleMapper.checkRoleNameUnique(role.getRoleName()); - if (StringUtils.isNotNull(info) && info.getRoleId().longValue() != roleId.longValue()) - { - return UserConstants.NOT_UNIQUE; - } - return UserConstants.UNIQUE; - } - - /** - * 校验角色权限是否唯一 - * - * @param role 角色信息 - * @return 结果 - */ - @Override - public String checkRoleKeyUnique(SysRole role) - { - Long roleId = StringUtils.isNull(role.getRoleId()) ? -1L : role.getRoleId(); - SysRole info = roleMapper.checkRoleKeyUnique(role.getRoleKey()); - if (StringUtils.isNotNull(info) && info.getRoleId().longValue() != roleId.longValue()) - { - return UserConstants.NOT_UNIQUE; - } - return UserConstants.UNIQUE; - } - - /** - * 校验角色是否允许操作 - * - * @param role 角色信息 - */ - @Override - public void checkRoleAllowed(SysRole role) - { - if (StringUtils.isNotNull(role.getRoleId()) && role.isAdmin()) - { - throw new ServiceException("不允许操作超级管理员角色"); - } - } - - /** - * 校验角色是否有数据权限 - * - * @param roleId 角色id - */ - @Override - public void checkRoleDataScope(Long roleId) - { - if (!SysUser.isAdmin(SecurityUtils.getUserId())) - { - SysRole role = new SysRole(); - role.setRoleId(roleId); - List roles = SpringUtils.getAopProxy(this).selectRoleList(role); - if (StringUtils.isEmpty(roles)) - { - throw new ServiceException("没有权限访问角色数据!"); - } - } - } - - /** - * 通过角色ID查询角色使用数量 - * - * @param roleId 角色ID - * @return 结果 - */ - @Override - public int countUserRoleByRoleId(Long roleId) - { - return userRoleMapper.countUserRoleByRoleId(roleId); - } - - /** - * 新增保存角色信息 - * - * @param role 角色信息 - * @return 结果 - */ - @Override - @Transactional - public int insertRole(SysRole role) - { - // 新增角色信息 - roleMapper.insertRole(role); - return insertRoleMenu(role); - } - - /** - * 修改保存角色信息 - * - * @param role 角色信息 - * @return 结果 - */ - @Override - @Transactional - public int updateRole(SysRole role) - { - // 修改角色信息 - roleMapper.updateRole(role); - // 删除角色与菜单关联 - roleMenuMapper.deleteRoleMenuByRoleId(role.getRoleId()); - return insertRoleMenu(role); - } - - /** - * 修改角色状态 - * - * @param role 角色信息 - * @return 结果 - */ - @Override - public int updateRoleStatus(SysRole role) - { - return roleMapper.updateRole(role); - } - - /** - * 修改数据权限信息 - * - * @param role 角色信息 - * @return 结果 - */ - @Override - @Transactional - public int authDataScope(SysRole role) - { - // 修改角色信息 - roleMapper.updateRole(role); - // 删除角色与部门关联 - roleDeptMapper.deleteRoleDeptByRoleId(role.getRoleId()); - // 新增角色和部门信息(数据权限) - return insertRoleDept(role); - } - - /** - * 新增角色菜单信息 - * - * @param role 角色对象 - */ - public int insertRoleMenu(SysRole role) - { - int rows = 1; - // 新增用户与角色管理 - List list = new ArrayList(); - for (Long menuId : role.getMenuIds()) - { - SysRoleMenu rm = new SysRoleMenu(); - rm.setRoleId(role.getRoleId()); - rm.setMenuId(menuId); - list.add(rm); - } - if (list.size() > 0) - { - rows = roleMenuMapper.batchRoleMenu(list); - } - return rows; - } - - /** - * 新增角色部门信息(数据权限) - * - * @param role 角色对象 - */ - public int insertRoleDept(SysRole role) - { - int rows = 1; - // 新增角色与部门(数据权限)管理 - List list = new ArrayList(); - for (Long deptId : role.getDeptIds()) - { - SysRoleDept rd = new SysRoleDept(); - rd.setRoleId(role.getRoleId()); - rd.setDeptId(deptId); - list.add(rd); - } - if (list.size() > 0) - { - rows = roleDeptMapper.batchRoleDept(list); - } - return rows; - } - - /** - * 通过角色ID删除角色 - * - * @param roleId 角色ID - * @return 结果 - */ - @Override - @Transactional - public int deleteRoleById(Long roleId) - { - // 删除角色与菜单关联 - roleMenuMapper.deleteRoleMenuByRoleId(roleId); - // 删除角色与部门关联 - roleDeptMapper.deleteRoleDeptByRoleId(roleId); - return roleMapper.deleteRoleById(roleId); - } - - /** - * 批量删除角色信息 - * - * @param roleIds 需要删除的角色ID - * @return 结果 - */ - @Override - @Transactional - public int deleteRoleByIds(Long[] roleIds) - { - for (Long roleId : roleIds) - { - checkRoleAllowed(new SysRole(roleId)); - SysRole role = selectRoleById(roleId); - if (countUserRoleByRoleId(roleId) > 0) - { - throw new ServiceException(String.format("%1$s已分配,不能删除", role.getRoleName())); - } - } - // 删除角色与菜单关联 - roleMenuMapper.deleteRoleMenu(roleIds); - // 删除角色与部门关联 - roleDeptMapper.deleteRoleDept(roleIds); - return roleMapper.deleteRoleByIds(roleIds); - } - - /** - * 取消授权用户角色 - * - * @param userRole 用户和角色关联信息 - * @return 结果 - */ - @Override - public int deleteAuthUser(SysUserRole userRole) - { - return userRoleMapper.deleteUserRoleInfo(userRole); - } - - /** - * 批量取消授权用户角色 - * - * @param roleId 角色ID - * @param userIds 需要取消授权的用户数据ID - * @return 结果 - */ - @Override - public int deleteAuthUsers(Long roleId, Long[] userIds) - { - return userRoleMapper.deleteUserRoleInfos(roleId, userIds); - } - - /** - * 批量选择授权用户角色 - * - * @param roleId 角色ID - * @param userIds 需要删除的用户数据ID - * @return 结果 - */ - @Override - public int insertAuthUsers(Long roleId, Long[] userIds) - { - // 新增用户与角色管理 - List list = new ArrayList(); - for (Long userId : userIds) - { - SysUserRole ur = new SysUserRole(); - ur.setUserId(userId); - ur.setRoleId(roleId); - list.add(ur); - } - return userRoleMapper.batchUserRole(list); - } - - @Override - public SysRole selectRoleByKey(String roleKey) { - return roleMapper.selectRoleByKey(roleKey); - } - - @Override - public int allocateRole2User(String role, Long userId) { - SysRole role1 = selectRoleByKey(role); - SysUserRole ur = new SysUserRole(); - ur.setUserId(userId); - ur.setRoleId(role1.getRoleId()); - return userRoleMapper.batchUserRole(Arrays.asList(ur)); - } - - @Override - public boolean hasRole(String roleKey, Long userId) { - SysRole role = selectRoleByKey(roleKey); - return userRoleMapper.countRoleAndUserId(role.getRoleId(), userId) > 0; - } -} diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysUserOnlineServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysUserOnlineServiceImpl.java deleted file mode 100644 index f80a877..0000000 --- a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysUserOnlineServiceImpl.java +++ /dev/null @@ -1,96 +0,0 @@ -package com.ruoyi.system.service.impl; - -import org.springframework.stereotype.Service; -import com.ruoyi.common.core.domain.model.LoginUser; -import com.ruoyi.common.utils.StringUtils; -import com.ruoyi.system.domain.SysUserOnline; -import com.ruoyi.system.service.ISysUserOnlineService; - -/** - * 在线用户 服务层处理 - * - * @author ruoyi - */ -@Service -public class SysUserOnlineServiceImpl implements ISysUserOnlineService -{ - /** - * 通过登录地址查询信息 - * - * @param ipaddr 登录地址 - * @param user 用户信息 - * @return 在线用户信息 - */ - @Override - public SysUserOnline selectOnlineByIpaddr(String ipaddr, LoginUser user) - { - if (StringUtils.equals(ipaddr, user.getIpaddr())) - { - return loginUserToUserOnline(user); - } - return null; - } - - /** - * 通过用户名称查询信息 - * - * @param userName 用户名称 - * @param user 用户信息 - * @return 在线用户信息 - */ - @Override - public SysUserOnline selectOnlineByUserName(String userName, LoginUser user) - { - if (StringUtils.equals(userName, user.getUsername())) - { - return loginUserToUserOnline(user); - } - return null; - } - - /** - * 通过登录地址/用户名称查询信息 - * - * @param ipaddr 登录地址 - * @param userName 用户名称 - * @param user 用户信息 - * @return 在线用户信息 - */ - @Override - public SysUserOnline selectOnlineByInfo(String ipaddr, String userName, LoginUser user) - { - if (StringUtils.equals(ipaddr, user.getIpaddr()) && StringUtils.equals(userName, user.getUsername())) - { - return loginUserToUserOnline(user); - } - return null; - } - - /** - * 设置在线用户信息 - * - * @param user 用户信息 - * @return 在线用户 - */ - @Override - public SysUserOnline loginUserToUserOnline(LoginUser user) - { - if (StringUtils.isNull(user) || StringUtils.isNull(user.getUser())) - { - return null; - } - SysUserOnline sysUserOnline = new SysUserOnline(); - sysUserOnline.setTokenId(user.getToken()); - sysUserOnline.setUserName(user.getUsername()); - sysUserOnline.setIpaddr(user.getIpaddr()); - sysUserOnline.setLoginLocation(user.getLoginLocation()); - sysUserOnline.setBrowser(user.getBrowser()); - sysUserOnline.setOs(user.getOs()); - sysUserOnline.setLoginTime(user.getLoginTime()); - if (StringUtils.isNotNull(user.getUser().getDept())) - { - sysUserOnline.setDeptName(user.getUser().getDept().getDeptName()); - } - return sysUserOnline; - } -} diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysUserServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysUserServiceImpl.java deleted file mode 100644 index a3a0055..0000000 --- a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysUserServiceImpl.java +++ /dev/null @@ -1,567 +0,0 @@ -package com.ruoyi.system.service.impl; - -import java.util.ArrayList; -import java.util.List; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; -import org.springframework.transaction.annotation.Transactional; -import com.ruoyi.common.annotation.DataScope; -import com.ruoyi.common.constant.UserConstants; -import com.ruoyi.common.core.domain.entity.SysRole; -import com.ruoyi.common.core.domain.entity.SysUser; -import com.ruoyi.common.exception.ServiceException; -import com.ruoyi.common.utils.SecurityUtils; -import com.ruoyi.common.utils.StringUtils; -import com.ruoyi.common.utils.spring.SpringUtils; -import com.ruoyi.system.domain.SysPost; -import com.ruoyi.system.domain.SysUserPost; -import com.ruoyi.system.domain.SysUserRole; -import com.ruoyi.system.mapper.SysPostMapper; -import com.ruoyi.system.mapper.SysRoleMapper; -import com.ruoyi.system.mapper.SysUserMapper; -import com.ruoyi.system.mapper.SysUserPostMapper; -import com.ruoyi.system.mapper.SysUserRoleMapper; -import com.ruoyi.system.service.ISysConfigService; -import com.ruoyi.system.service.ISysUserService; - -/** - * 用户 业务层处理 - * - * @author ruoyi - */ -@Service -public class SysUserServiceImpl implements ISysUserService -{ - private static final Logger log = LoggerFactory.getLogger(SysUserServiceImpl.class); - - @Autowired - private SysUserMapper userMapper; - - @Autowired - private SysRoleMapper roleMapper; - - @Autowired - private SysPostMapper postMapper; - - @Autowired - private SysUserRoleMapper userRoleMapper; - - @Autowired - private SysUserPostMapper userPostMapper; - - @Autowired - private ISysConfigService configService; - - /** - * 根据条件分页查询用户列表 - * - * @param user 用户信息 - * @return 用户信息集合信息 - */ - @Override - @DataScope(deptAlias = "d", userAlias = "u") - public List selectUserList(SysUser user) - { - return userMapper.selectUserList(user); - } - - /** - * 根据条件分页查询已分配用户角色列表 - * - * @param user 用户信息 - * @return 用户信息集合信息 - */ - @Override - @DataScope(deptAlias = "d", userAlias = "u") - public List selectAllocatedList(SysUser user) - { - return userMapper.selectAllocatedList(user); - } - - /** - * 根据条件分页查询未分配用户角色列表 - * - * @param user 用户信息 - * @return 用户信息集合信息 - */ - @Override - @DataScope(deptAlias = "d", userAlias = "u") - public List selectUnallocatedList(SysUser user) - { - return userMapper.selectUnallocatedList(user); - } - - /** - * 通过用户名查询用户 - * - * @param userName 用户名 - * @return 用户对象信息 - */ - @Override - public SysUser selectUserByUserName(String userName) - { - return userMapper.selectUserByUserName(userName); - } - - /** - * 通过用户ID查询用户 - * - * @param userId 用户ID - * @return 用户对象信息 - */ - @Override - public SysUser selectUserById(Long userId) - { - return userMapper.selectUserById(userId); - } - - /** - * 查询用户所属角色组 - * - * @param userName 用户名 - * @return 结果 - */ - @Override - public String selectUserRoleGroup(String userName) - { - List list = roleMapper.selectRolesByUserName(userName); - StringBuffer idsStr = new StringBuffer(); - for (SysRole role : list) - { - idsStr.append(role.getRoleName()).append(","); - } - if (StringUtils.isNotEmpty(idsStr.toString())) - { - return idsStr.substring(0, idsStr.length() - 1); - } - return idsStr.toString(); - } - - /** - * 查询用户所属岗位组 - * - * @param userName 用户名 - * @return 结果 - */ - @Override - public String selectUserPostGroup(String userName) - { - List list = postMapper.selectPostsByUserName(userName); - StringBuffer idsStr = new StringBuffer(); - for (SysPost post : list) - { - idsStr.append(post.getPostName()).append(","); - } - if (StringUtils.isNotEmpty(idsStr.toString())) - { - return idsStr.substring(0, idsStr.length() - 1); - } - return idsStr.toString(); - } - - /** - * 校验用户名称是否唯一 - * - * @param userName 用户名称 - * @return 结果 - */ - @Override - public String checkUserNameUnique(String userName) - { - int count = userMapper.checkUserNameUnique(userName); - if (count > 0) - { - return UserConstants.NOT_UNIQUE; - } - return UserConstants.UNIQUE; - } - - /** - * 校验用户名称是否唯一 - * - * @param user 用户信息 - * @return - */ - @Override - public String checkPhoneUnique(SysUser user) - { - Long userId = StringUtils.isNull(user.getUserId()) ? -1L : user.getUserId(); - SysUser info = userMapper.checkPhoneUnique(user.getPhonenumber()); - if (StringUtils.isNotNull(info) && info.getUserId().longValue() != userId.longValue()) - { - return UserConstants.NOT_UNIQUE; - } - return UserConstants.UNIQUE; - } - - /** - * 校验email是否唯一 - * - * @param user 用户信息 - * @return - */ - @Override - public String checkEmailUnique(SysUser user) - { - Long userId = StringUtils.isNull(user.getUserId()) ? -1L : user.getUserId(); - SysUser info = userMapper.checkEmailUnique(user.getEmail()); - if (StringUtils.isNotNull(info) && info.getUserId().longValue() != userId.longValue()) - { - return UserConstants.NOT_UNIQUE; - } - return UserConstants.UNIQUE; - } - - /** - * 校验用户是否允许操作 - * - * @param user 用户信息 - */ - @Override - public void checkUserAllowed(SysUser user) - { - if (StringUtils.isNotNull(user.getUserId()) && user.isAdmin()) - { - throw new ServiceException("不允许操作超级管理员用户"); - } - } - - /** - * 校验用户是否有数据权限 - * - * @param userId 用户id - */ - @Override - public void checkUserDataScope(Long userId) - { - if (!SysUser.isAdmin(SecurityUtils.getUserId())) - { - SysUser user = new SysUser(); - user.setUserId(userId); - List users = SpringUtils.getAopProxy(this).selectUserList(user); - if (StringUtils.isEmpty(users)) - { - throw new ServiceException("没有权限访问用户数据!"); - } - } - } - - /** - * 新增保存用户信息 - * - * @param user 用户信息 - * @return 结果 - */ - @Override - @Transactional - public int insertUser(SysUser user) - { - // 新增用户信息 - int rows = userMapper.insertUser(user); - // 新增用户岗位关联 - insertUserPost(user); - // 新增用户与角色管理 - insertUserRole(user); - return rows; - } - - /** - * 注册用户信息 - * - * @param user 用户信息 - * @return 结果 - */ - @Override - public boolean registerUser(SysUser user) - { - return userMapper.insertUser(user) > 0; - } - - /** - * 修改保存用户信息 - * - * @param user 用户信息 - * @return 结果 - */ - @Override - @Transactional - public int updateUser(SysUser user) - { - Long userId = user.getUserId(); - // 删除用户与角色关联 - userRoleMapper.deleteUserRoleByUserId(userId); - // 新增用户与角色管理 - insertUserRole(user); - // 删除用户与岗位关联 - userPostMapper.deleteUserPostByUserId(userId); - // 新增用户与岗位管理 - insertUserPost(user); - return userMapper.updateUser(user); - } - - /** - * 用户授权角色 - * - * @param userId 用户ID - * @param roleIds 角色组 - */ - @Override - @Transactional - public void insertUserAuth(Long userId, Long[] roleIds) - { - userRoleMapper.deleteUserRoleByUserId(userId); - insertUserRole(userId, roleIds); - } - - /** - * 修改用户状态 - * - * @param user 用户信息 - * @return 结果 - */ - @Override - public int updateUserStatus(SysUser user) - { - return userMapper.updateUser(user); - } - - /** - * 修改用户基本信息 - * - * @param user 用户信息 - * @return 结果 - */ - @Override - public int updateUserProfile(SysUser user) - { - return userMapper.updateUser(user); - } - - /** - * 修改用户头像 - * - * @param userName 用户名 - * @param avatar 头像地址 - * @return 结果 - */ - @Override - public boolean updateUserAvatar(String userName, String avatar) - { - return userMapper.updateUserAvatar(userName, avatar) > 0; - } - - /** - * 重置用户密码 - * - * @param user 用户信息 - * @return 结果 - */ - @Override - public int resetPwd(SysUser user) - { - return userMapper.updateUser(user); - } - - /** - * 重置用户密码 - * - * @param userName 用户名 - * @param password 密码 - * @return 结果 - */ - @Override - public int resetUserPwd(String userName, String password) - { - return userMapper.resetUserPwd(userName, password); - } - - /** - * 新增用户角色信息 - * - * @param user 用户对象 - */ - public void insertUserRole(SysUser user) - { - Long[] roles = user.getRoleIds(); - if (StringUtils.isNotNull(roles)) - { - // 新增用户与角色管理 - List list = new ArrayList(); - for (Long roleId : roles) - { - SysUserRole ur = new SysUserRole(); - ur.setUserId(user.getUserId()); - ur.setRoleId(roleId); - list.add(ur); - } - if (list.size() > 0) - { - userRoleMapper.batchUserRole(list); - } - } - } - - /** - * 新增用户岗位信息 - * - * @param user 用户对象 - */ - public void insertUserPost(SysUser user) - { - Long[] posts = user.getPostIds(); - if (StringUtils.isNotNull(posts)) - { - // 新增用户与岗位管理 - List list = new ArrayList(); - for (Long postId : posts) - { - SysUserPost up = new SysUserPost(); - up.setUserId(user.getUserId()); - up.setPostId(postId); - list.add(up); - } - if (list.size() > 0) - { - userPostMapper.batchUserPost(list); - } - } - } - - /** - * 新增用户角色信息 - * - * @param userId 用户ID - * @param roleIds 角色组 - */ - public void insertUserRole(Long userId, Long[] roleIds) - { - if (StringUtils.isNotNull(roleIds)) - { - // 新增用户与角色管理 - List list = new ArrayList(); - for (Long roleId : roleIds) - { - SysUserRole ur = new SysUserRole(); - ur.setUserId(userId); - ur.setRoleId(roleId); - list.add(ur); - } - if (list.size() > 0) - { - userRoleMapper.batchUserRole(list); - } - } - } - - /** - * 通过用户ID删除用户 - * - * @param userId 用户ID - * @return 结果 - */ - @Override - @Transactional - public int deleteUserById(Long userId) - { - // 删除用户与角色关联 - userRoleMapper.deleteUserRoleByUserId(userId); - // 删除用户与岗位表 - userPostMapper.deleteUserPostByUserId(userId); - return userMapper.deleteUserById(userId); - } - - /** - * 批量删除用户信息 - * - * @param userIds 需要删除的用户ID - * @return 结果 - */ - @Override - @Transactional - public int deleteUserByIds(Long[] userIds) - { - for (Long userId : userIds) - { - checkUserAllowed(new SysUser(userId)); - } - // 删除用户与角色关联 - userRoleMapper.deleteUserRole(userIds); - // 删除用户与岗位关联 - userPostMapper.deleteUserPost(userIds); - return userMapper.deleteUserByIds(userIds); - } - - /** - * 导入用户数据 - * - * @param userList 用户数据列表 - * @param isUpdateSupport 是否更新支持,如果已存在,则进行更新数据 - * @param userId 操作用户 - * @return 结果 - */ - @Override - public String importUser(List userList, Boolean isUpdateSupport, Long userId) - { - if (StringUtils.isNull(userList) || userList.size() == 0) - { - throw new ServiceException("导入用户数据不能为空!"); - } - int successNum = 0; - int failureNum = 0; - StringBuilder successMsg = new StringBuilder(); - StringBuilder failureMsg = new StringBuilder(); - String password = configService.selectConfigByKey("sys.user.initPassword"); - for (SysUser user : userList) - { - try - { - // 验证是否存在这个用户 - SysUser u = userMapper.selectUserByUserName(user.getUserName()); - if (StringUtils.isNull(u)) - { - user.setPassword(SecurityUtils.encryptPassword(password)); - user.setCreateBy(userId); - this.insertUser(user); - successNum++; - successMsg.append("
" + successNum + "、账号 " + user.getUserName() + " 导入成功"); - } - else if (isUpdateSupport) - { - user.setUpdateBy(userId); - this.updateUser(user); - successNum++; - successMsg.append("
" + successNum + "、账号 " + user.getUserName() + " 更新成功"); - } - else - { - failureNum++; - failureMsg.append("
" + failureNum + "、账号 " + user.getUserName() + " 已存在"); - } - } - catch (Exception e) - { - failureNum++; - String msg = "
" + failureNum + "、账号 " + user.getUserName() + " 导入失败:"; - failureMsg.append(msg + e.getMessage()); - log.error(msg, e); - } - } - if (failureNum > 0) - { - failureMsg.insert(0, "很抱歉,导入失败!共 " + failureNum + " 条数据格式不正确,错误如下:"); - throw new ServiceException(failureMsg.toString()); - } - else - { - successMsg.insert(0, "恭喜您,数据已全部导入成功!共 " + successNum + " 条,数据如下:"); - } - return successMsg.toString(); - } - - @Override - public SysUser selectUserByPhoneOrUserName(String phone) { - return userMapper.selectUserByPhone(phone); - } -} diff --git a/ruoyi-system/src/main/resources/mapper/system/SysConfigMapper.xml b/ruoyi-system/src/main/resources/mapper/system/SysConfigMapper.xml deleted file mode 100644 index a58a82d..0000000 --- a/ruoyi-system/src/main/resources/mapper/system/SysConfigMapper.xml +++ /dev/null @@ -1,112 +0,0 @@ - - - - - - - - - - - - - - - - - - select config_id, config_name, config_key, config_value, config_type, create_by, create_time, update_by, update_time, remark - from sys_config - - - - - - - and config_id = #{configId} - - - and config_key = #{configKey} - - - - - - - - - - - - insert into sys_config ( - config_name, - config_key, - config_value, - config_type, - create_by, - remark, - create_time - )values( - #{configName}, - #{configKey}, - #{configValue}, - #{configType}, - #{createBy}, - #{remark}, - sysdate() - ) - - - - update sys_config - - config_name = #{configName}, - config_key = #{configKey}, - config_value = #{configValue}, - config_type = #{configType}, - update_by = #{updateBy}, - remark = #{remark}, - update_time = sysdate() - - where config_id = #{configId} - - - - delete from sys_config where config_id = #{configId} - - - - delete from sys_config where config_id in - - #{configId} - - - - diff --git a/ruoyi-system/src/main/resources/mapper/system/SysDeptMapper.xml b/ruoyi-system/src/main/resources/mapper/system/SysDeptMapper.xml deleted file mode 100644 index a6a9e81..0000000 --- a/ruoyi-system/src/main/resources/mapper/system/SysDeptMapper.xml +++ /dev/null @@ -1,157 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - select d.dept_id, d.parent_id, d.ancestors, d.dept_name, d.order_num, d.leader, d.phone, d.email, d.status, d.del_flag, d.create_by, d.create_time - from sys_dept d - - - - - - - - - - - - - - - - - - - - insert into sys_dept( - dept_id, - parent_id, - dept_name, - ancestors, - order_num, - leader, - phone, - email, - status, - create_by, - create_time - )values( - #{deptId}, - #{parentId}, - #{deptName}, - #{ancestors}, - #{orderNum}, - #{leader}, - #{phone}, - #{email}, - #{status}, - #{createBy}, - sysdate() - ) - - - - update sys_dept - - parent_id = #{parentId}, - dept_name = #{deptName}, - ancestors = #{ancestors}, - order_num = #{orderNum}, - leader = #{leader}, - phone = #{phone}, - email = #{email}, - status = #{status}, - update_by = #{updateBy}, - update_time = sysdate() - - where dept_id = #{deptId} - - - - update sys_dept set ancestors = - - when #{item.deptId} then #{item.ancestors} - - where dept_id in - - #{item.deptId} - - - - - update sys_dept set status = '0' where dept_id in - - #{deptId} - - - - - update sys_dept set del_flag = '2' where dept_id = #{deptId} - - - diff --git a/ruoyi-system/src/main/resources/mapper/system/SysDictDataMapper.xml b/ruoyi-system/src/main/resources/mapper/system/SysDictDataMapper.xml deleted file mode 100644 index 9e06985..0000000 --- a/ruoyi-system/src/main/resources/mapper/system/SysDictDataMapper.xml +++ /dev/null @@ -1,124 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - select dict_code, dict_sort, dict_label, dict_value, dict_type, css_class, list_class, is_default, status, create_by, create_time, remark - from sys_dict_data - - - - - - - - - - - - - - delete from sys_dict_data where dict_code = #{dictCode} - - - - delete from sys_dict_data where dict_code in - - #{dictCode} - - - - - update sys_dict_data - - dict_sort = #{dictSort}, - dict_label = #{dictLabel}, - dict_value = #{dictValue}, - dict_type = #{dictType}, - css_class = #{cssClass}, - list_class = #{listClass}, - is_default = #{isDefault}, - status = #{status}, - remark = #{remark}, - update_by = #{updateBy}, - update_time = sysdate() - - where dict_code = #{dictCode} - - - - update sys_dict_data set dict_type = #{newDictType} where dict_type = #{oldDictType} - - - - insert into sys_dict_data( - dict_sort, - dict_label, - dict_value, - dict_type, - css_class, - list_class, - is_default, - status, - remark, - create_by, - create_time - )values( - #{dictSort}, - #{dictLabel}, - #{dictValue}, - #{dictType}, - #{cssClass}, - #{listClass}, - #{isDefault}, - #{status}, - #{remark}, - #{createBy}, - sysdate() - ) - - - diff --git a/ruoyi-system/src/main/resources/mapper/system/SysDictTypeMapper.xml b/ruoyi-system/src/main/resources/mapper/system/SysDictTypeMapper.xml deleted file mode 100644 index 0898cb7..0000000 --- a/ruoyi-system/src/main/resources/mapper/system/SysDictTypeMapper.xml +++ /dev/null @@ -1,105 +0,0 @@ - - - - - - - - - - - - - - - - - select dict_id, dict_name, dict_type, status, create_by, create_time, remark - from sys_dict_type - - - - - - - - - - - - - - delete from sys_dict_type where dict_id = #{dictId} - - - - delete from sys_dict_type where dict_id in - - #{dictId} - - - - - update sys_dict_type - - dict_name = #{dictName}, - dict_type = #{dictType}, - status = #{status}, - remark = #{remark}, - update_by = #{updateBy}, - update_time = sysdate() - - where dict_id = #{dictId} - - - - insert into sys_dict_type( - dict_name, - dict_type, - status, - remark, - create_by, - create_time - )values( - #{dictName}, - #{dictType}, - #{status}, - #{remark}, - #{createBy}, - sysdate() - ) - - - diff --git a/ruoyi-system/src/main/resources/mapper/system/SysLogininforMapper.xml b/ruoyi-system/src/main/resources/mapper/system/SysLogininforMapper.xml deleted file mode 100644 index b8178fa..0000000 --- a/ruoyi-system/src/main/resources/mapper/system/SysLogininforMapper.xml +++ /dev/null @@ -1,57 +0,0 @@ - - - - - - - - - - - - - - - - - - insert into sys_logininfor (user_name, status, ipaddr, login_location, browser, os, msg, login_time) - values (#{userName}, #{status}, #{ipaddr}, #{loginLocation}, #{browser}, #{os}, #{msg}, sysdate()) - - - - - - delete from sys_logininfor where info_id in - - #{infoId} - - - - - truncate table sys_logininfor - - - \ No newline at end of file diff --git a/ruoyi-system/src/main/resources/mapper/system/SysMenuMapper.xml b/ruoyi-system/src/main/resources/mapper/system/SysMenuMapper.xml deleted file mode 100644 index e34d32a..0000000 --- a/ruoyi-system/src/main/resources/mapper/system/SysMenuMapper.xml +++ /dev/null @@ -1,195 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - select menu_id, menu_name, parent_id, order_num, path, component, query, is_frame, is_cache, menu_type, visible, status, ifnull(perms,'') as perms, icon, create_time - from sys_menu - - - - - - - - - - - - - - - - - - - - - - - - update sys_menu - - menu_name = #{menuName}, - parent_id = #{parentId}, - order_num = #{orderNum}, - path = #{path}, - component = #{component}, - query = #{query}, - is_frame = #{isFrame}, - is_cache = #{isCache}, - menu_type = #{menuType}, - visible = #{visible}, - status = #{status}, - perms = #{perms}, - icon = #{icon}, - remark = #{remark}, - update_by = #{updateBy}, - update_time = sysdate() - - where menu_id = #{menuId} - - - - insert into sys_menu( - menu_id, - parent_id, - menu_name, - order_num, - path, - component, - query, - is_frame, - is_cache, - menu_type, - visible, - status, - perms, - icon, - remark, - create_by, - create_time - )values( - #{menuId}, - #{parentId}, - #{menuName}, - #{orderNum}, - #{path}, - #{component}, - #{query}, - #{isFrame}, - #{isCache}, - #{menuType}, - #{visible}, - #{status}, - #{perms}, - #{icon}, - #{remark}, - #{createBy}, - sysdate() - ) - - - - delete from sys_menu where menu_id = #{menuId} - - - diff --git a/ruoyi-system/src/main/resources/mapper/system/SysNoticeMapper.xml b/ruoyi-system/src/main/resources/mapper/system/SysNoticeMapper.xml deleted file mode 100644 index 955f2e9..0000000 --- a/ruoyi-system/src/main/resources/mapper/system/SysNoticeMapper.xml +++ /dev/null @@ -1,89 +0,0 @@ - - - - - - - - - - - - - - - - - - - select notice_id, notice_title, notice_type, cast(notice_content as char) as notice_content, status, create_by, create_time, update_by, update_time, remark - from sys_notice - - - - - - - - insert into sys_notice ( - notice_title, - notice_type, - notice_content, - status, - remark, - create_by, - create_time - )values( - #{noticeTitle}, - #{noticeType}, - #{noticeContent}, - #{status}, - #{remark}, - #{createBy}, - sysdate() - ) - - - - update sys_notice - - notice_title = #{noticeTitle}, - notice_type = #{noticeType}, - notice_content = #{noticeContent}, - status = #{status}, - update_by = #{updateBy}, - update_time = sysdate() - - where notice_id = #{noticeId} - - - - delete from sys_notice where notice_id = #{noticeId} - - - - delete from sys_notice where notice_id in - - #{noticeId} - - - - diff --git a/ruoyi-system/src/main/resources/mapper/system/SysOperLogMapper.xml b/ruoyi-system/src/main/resources/mapper/system/SysOperLogMapper.xml deleted file mode 100644 index f017ef8..0000000 --- a/ruoyi-system/src/main/resources/mapper/system/SysOperLogMapper.xml +++ /dev/null @@ -1,83 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - select oper_id, title, business_type, method, request_method, operator_type, oper_name, dept_name, oper_url, oper_ip, oper_location, oper_param, json_result, status, error_msg, oper_time - from sys_oper_log - - - - insert into sys_oper_log(title, business_type, method, request_method, operator_type, oper_name, dept_name, oper_url, oper_ip, oper_location, oper_param, json_result, status, error_msg, oper_time) - values (#{title}, #{businessType}, #{method}, #{requestMethod}, #{operatorType}, #{operName}, #{deptName}, #{operUrl}, #{operIp}, #{operLocation}, #{operParam}, #{jsonResult}, #{status}, #{errorMsg}, sysdate()) - - - - - - delete from sys_oper_log where oper_id in - - #{operId} - - - - - - - truncate table sys_oper_log - - - \ No newline at end of file diff --git a/ruoyi-system/src/main/resources/mapper/system/SysPostMapper.xml b/ruoyi-system/src/main/resources/mapper/system/SysPostMapper.xml deleted file mode 100644 index dd89e8d..0000000 --- a/ruoyi-system/src/main/resources/mapper/system/SysPostMapper.xml +++ /dev/null @@ -1,122 +0,0 @@ - - - - - - - - - - - - - - - - - - - select post_id, post_code, post_name, post_sort, status, create_by, create_time, remark - from sys_post - - - - - - - - - - - - - - - - - - update sys_post - - post_code = #{postCode}, - post_name = #{postName}, - post_sort = #{postSort}, - status = #{status}, - remark = #{remark}, - update_by = #{updateBy}, - update_time = sysdate() - - where post_id = #{postId} - - - - insert into sys_post( - post_id, - post_code, - post_name, - post_sort, - status, - remark, - create_by, - create_time - )values( - #{postId}, - #{postCode}, - #{postName}, - #{postSort}, - #{status}, - #{remark}, - #{createBy}, - sysdate() - ) - - - - delete from sys_post where post_id = #{postId} - - - - delete from sys_post where post_id in - - #{postId} - - - - diff --git a/ruoyi-system/src/main/resources/mapper/system/SysRoleDeptMapper.xml b/ruoyi-system/src/main/resources/mapper/system/SysRoleDeptMapper.xml deleted file mode 100644 index 7c4139b..0000000 --- a/ruoyi-system/src/main/resources/mapper/system/SysRoleDeptMapper.xml +++ /dev/null @@ -1,34 +0,0 @@ - - - - - - - - - - - delete from sys_role_dept where role_id=#{roleId} - - - - - - delete from sys_role_dept where role_id in - - #{roleId} - - - - - insert into sys_role_dept(role_id, dept_id) values - - (#{item.roleId},#{item.deptId}) - - - - \ No newline at end of file diff --git a/ruoyi-system/src/main/resources/mapper/system/SysRoleMapper.xml b/ruoyi-system/src/main/resources/mapper/system/SysRoleMapper.xml deleted file mode 100644 index 7d4941a..0000000 --- a/ruoyi-system/src/main/resources/mapper/system/SysRoleMapper.xml +++ /dev/null @@ -1,152 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - select distinct r.role_id, r.role_name, r.role_key, r.role_sort, r.data_scope, r.menu_check_strictly, r.dept_check_strictly, - r.status, r.del_flag, r.create_time, r.remark - from sys_role r - left join sys_user_role ur on ur.role_id = r.role_id - left join sys_user u on u.user_id = ur.user_id - left join sys_dept d on u.dept_id = d.dept_id - - - - - - - - - - - - - - - - - - - - insert into sys_role( - role_id, - role_name, - role_key, - role_sort, - data_scope, - menu_check_strictly, - dept_check_strictly, - status, - remark, - create_by, - create_time - )values( - #{roleId}, - #{roleName}, - #{roleKey}, - #{roleSort}, - #{dataScope}, - #{menuCheckStrictly}, - #{deptCheckStrictly}, - #{status}, - #{remark}, - #{createBy}, - sysdate() - ) - - - - update sys_role - - role_name = #{roleName}, - role_key = #{roleKey}, - role_sort = #{roleSort}, - data_scope = #{dataScope}, - menu_check_strictly = #{menuCheckStrictly}, - dept_check_strictly = #{deptCheckStrictly}, - status = #{status}, - remark = #{remark}, - update_by = #{updateBy}, - update_time = sysdate() - - where role_id = #{roleId} - - - - update sys_role set del_flag = '2' where role_id = #{roleId} - - - - update sys_role set del_flag = '2' where role_id in - - #{roleId} - - - - diff --git a/ruoyi-system/src/main/resources/mapper/system/SysRoleMenuMapper.xml b/ruoyi-system/src/main/resources/mapper/system/SysRoleMenuMapper.xml deleted file mode 100644 index cb60a85..0000000 --- a/ruoyi-system/src/main/resources/mapper/system/SysRoleMenuMapper.xml +++ /dev/null @@ -1,34 +0,0 @@ - - - - - - - - - - - - - delete from sys_role_menu where role_id=#{roleId} - - - - delete from sys_role_menu where role_id in - - #{roleId} - - - - - insert into sys_role_menu(role_id, menu_id) values - - (#{item.roleId},#{item.menuId}) - - - - \ No newline at end of file diff --git a/ruoyi-system/src/main/resources/mapper/system/SysUserMapper.xml b/ruoyi-system/src/main/resources/mapper/system/SysUserMapper.xml deleted file mode 100644 index 4a4a220..0000000 --- a/ruoyi-system/src/main/resources/mapper/system/SysUserMapper.xml +++ /dev/null @@ -1,227 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - select u.user_id, u.dept_id, u.user_name, u.nick_name, u.email, u.avatar, u.phonenumber, u.password, u.sex, u.status, u.del_flag, u.login_ip, u.login_date, u.create_by, u.create_time, u.remark, - d.dept_id, d.parent_id, d.dept_name, d.order_num, d.leader, d.status as dept_status, - r.role_id, r.role_name, r.role_key, r.role_sort, r.data_scope, r.status as role_status - from sys_user u - left join sys_dept d on u.dept_id = d.dept_id - left join sys_user_role ur on u.user_id = ur.user_id - left join sys_role r on r.role_id = ur.role_id - - - - - - - - - - - - - - - - - - - - - insert into sys_user( - user_id, - dept_id, - user_name, - nick_name, - email, - avatar, - phonenumber, - sex, - password, - status, - create_by, - remark, - create_time - )values( - #{userId}, - #{deptId}, - #{userName}, - #{nickName}, - #{email}, - #{avatar}, - #{phonenumber}, - #{sex}, - #{password}, - #{status}, - #{createBy}, - #{remark}, - sysdate() - ) - - - - update sys_user - - dept_id = #{deptId}, - user_name = #{userName}, - nick_name = #{nickName}, - email = #{email}, - phonenumber = #{phonenumber}, - sex = #{sex}, - avatar = #{avatar}, - password = #{password}, - status = #{status}, - login_ip = #{loginIp}, - login_date = #{loginDate}, - update_by = #{updateBy}, - remark = #{remark}, - update_time = sysdate() - - where user_id = #{userId} - - - - update sys_user set status = #{status} where user_id = #{userId} - - - - update sys_user set avatar = #{avatar} where user_name = #{userName} - - - - update sys_user set password = #{password} where user_name = #{userName} - - - - update sys_user set del_flag = '2' where user_id = #{userId} - - - - update sys_user set del_flag = '2' where user_id in - - #{userId} - - - - diff --git a/ruoyi-system/src/main/resources/mapper/system/SysUserPostMapper.xml b/ruoyi-system/src/main/resources/mapper/system/SysUserPostMapper.xml deleted file mode 100644 index 2b90bc4..0000000 --- a/ruoyi-system/src/main/resources/mapper/system/SysUserPostMapper.xml +++ /dev/null @@ -1,34 +0,0 @@ - - - - - - - - - - - delete from sys_user_post where user_id=#{userId} - - - - - - delete from sys_user_post where user_id in - - #{userId} - - - - - insert into sys_user_post(user_id, post_id) values - - (#{item.userId},#{item.postId}) - - - - \ No newline at end of file diff --git a/ruoyi-system/src/main/resources/mapper/system/SysUserRoleMapper.xml b/ruoyi-system/src/main/resources/mapper/system/SysUserRoleMapper.xml deleted file mode 100644 index dd72689..0000000 --- a/ruoyi-system/src/main/resources/mapper/system/SysUserRoleMapper.xml +++ /dev/null @@ -1,44 +0,0 @@ - - - - - - - - - - - delete from sys_user_role where user_id=#{userId} - - - - - - delete from sys_user_role where user_id in - - #{userId} - - - - - insert into sys_user_role(user_id, role_id) values - - (#{item.userId},#{item.roleId}) - - - - - delete from sys_user_role where user_id=#{userId} and role_id=#{roleId} - - - - delete from sys_user_role where role_id=#{roleId} and user_id in - - #{userId} - - - \ No newline at end of file diff --git a/ry.bat b/script/bin/ry.bat similarity index 52% rename from ry.bat rename to script/bin/ry.bat index a6ba5a5..94434a9 100644 --- a/ry.bat +++ b/script/bin/ry.bat @@ -1,45 +1,46 @@ +rem 使用者应根据自身平台编码自行转换 防止乱码 例如 win使用gbk编码 @echo off -rem jarƽĿ¼ +rem jar平级目录 set AppName=ruoyi-admin.jar -rem JVM -set JVM_OPTS="-Dname=%AppName% -Duser.timezone=Asia/Shanghai -Xms512M -Xmx512M -XX:PermSize=256M -XX:MaxPermSize=512M -XX:+HeapDumpOnOutOfMemoryError -XX:+PrintGCDateStamps -XX:+PrintGCDetails -XX:NewRatio=1 -XX:SurvivorRatio=30 -XX:+UseParallelGC -XX:+UseParallelOldGC" +rem JVM参数 +set JVM_OPTS="-Dname=%AppName% -Duser.timezone=Asia/Shanghai -Xms512m -Xmx1024m -XX:MetaspaceSize=128m -XX:MaxMetaspaceSize=512m -XX:+HeapDumpOnOutOfMemoryError -XX:+PrintGCDateStamps -XX:+PrintGCDetails -XX:NewRatio=1 -XX:SurvivorRatio=30 -XX:+UseParallelGC -XX:+UseParallelOldGC" -ECHO. - ECHO. [1] %AppName% - ECHO. [2] ر%AppName% - ECHO. [3] %AppName% - ECHO. [4] ״̬ %AppName% - ECHO. [5] -ECHO. +ECHO. + ECHO. [1] 启动%AppName% + ECHO. [2] 关闭%AppName% + ECHO. [3] 重启%AppName% + ECHO. [4] 启动状态 %AppName% + ECHO. [5] 退 出 +ECHO. -ECHO.ѡĿ: +ECHO.请输入选择项目的序号: set /p ID= - IF "%id%"=="1" GOTO start - IF "%id%"=="2" GOTO stop - IF "%id%"=="3" GOTO restart + IF "%id%"=="1" GOTO start + IF "%id%"=="2" GOTO stop + IF "%id%"=="3" GOTO restart IF "%id%"=="4" GOTO status IF "%id%"=="5" EXIT -PAUSE +PAUSE :start for /f "usebackq tokens=1-2" %%a in (`jps -l ^| findstr %AppName%`) do ( set pid=%%a set image_name=%%b ) if defined pid ( - echo %%is running - PAUSE - ) + echo %%is running + PAUSE + ) -start javaw -jar %JAVA_OPTS% ruoyi-admin.jar +start javaw %JVM_OPTS% -jar %AppName% -echo starting +echo starting…… echo Start %AppName% success... goto:eof -rem stopͨjpspid +rem 函数stop通过jps命令查找pid并结束进程 :stop for /f "usebackq tokens=1-2" %%a in (`jps -l ^| findstr %AppName%`) do ( set pid=%%a @@ -48,7 +49,7 @@ rem if not defined pid (echo process %AppName% does not exists) else ( echo prepare to kill %image_name% echo start kill %pid% ... - rem ݽIDkill + rem 根据进程ID,kill进程 taskkill /f /pid %pid% ) goto:eof @@ -64,4 +65,4 @@ goto:eof if not defined pid (echo process %AppName% is dead ) else ( echo %image_name% is running ) -goto:eof \ No newline at end of file +goto:eof diff --git a/ry.sh b/script/bin/ry.sh similarity index 51% rename from ry.sh rename to script/bin/ry.sh index 7c4f503..0cf5ce9 100644 --- a/ry.sh +++ b/script/bin/ry.sh @@ -1,13 +1,9 @@ #!/bin/sh -# author ruoyi -# ./ry.sh start 启动 -# ./ry.sh stop 停止 -# ./ry.sh restart 重启 -# ./ry.sh status 状态 +# ./ry.sh start 启动 stop 停止 restart 重启 status 状态 AppName=ruoyi-admin.jar # JVM参数 -JVM_OPTS="-Dname=$AppName -Duser.timezone=Asia/Shanghai -Xms512M -Xmx512M -XX:PermSize=256M -XX:MaxPermSize=512M -XX:+HeapDumpOnOutOfMemoryError -XX:+PrintGCDateStamps -XX:+PrintGCDetails -XX:NewRatio=1 -XX:SurvivorRatio=30 -XX:+UseParallelGC -XX:+UseParallelOldGC" +JVM_OPTS="-Dname=$AppName -Duser.timezone=Asia/Shanghai -Xms512m -Xmx1024m -XX:MetaspaceSize=128m -XX:MaxMetaspaceSize=512m -XX:+HeapDumpOnOutOfMemoryError -XX:+PrintGCDateStamps -XX:+PrintGCDetails -XX:NewRatio=1 -XX:SurvivorRatio=30 -XX:+UseParallelGC -XX:+UseParallelOldGC" APP_HOME=`pwd` LOG_PATH=$APP_HOME/logs/$AppName.log @@ -27,36 +23,36 @@ function start() { PID=`ps -ef |grep java|grep $AppName|grep -v grep|awk '{print $2}'` - if [ x"$PID" != x"" ]; then - echo "$AppName is running..." - else - nohup java -jar $JVM_OPTS target/$AppName > /dev/null 2>&1 & - echo "Start $AppName success..." - fi + if [ x"$PID" != x"" ]; then + echo "$AppName is running..." + else + nohup java $JVM_OPTS -jar $AppName > /dev/null 2>&1 & + echo "Start $AppName success..." + fi } function stop() { echo "Stop $AppName" - - PID="" - query(){ - PID=`ps -ef |grep java|grep $AppName|grep -v grep|awk '{print $2}'` - } - query - if [ x"$PID" != x"" ]; then - kill -TERM $PID - echo "$AppName (pid:$PID) exiting..." - while [ x"$PID" != x"" ] - do - sleep 1 - query - done - echo "$AppName exited." - else - echo "$AppName already stopped." - fi + PID="" + query(){ + PID=`ps -ef |grep java|grep $AppName|grep -v grep|awk '{print $2}'` + } + + query + if [ x"$PID" != x"" ]; then + kill -TERM $PID + echo "$AppName (pid:$PID) exiting..." + while [ x"$PID" != x"" ] + do + sleep 1 + query + done + echo "$AppName exited." + else + echo "$AppName already stopped." + fi } function restart() diff --git a/script/docker/database.yml b/script/docker/database.yml new file mode 100644 index 0000000..0368fd2 --- /dev/null +++ b/script/docker/database.yml @@ -0,0 +1,61 @@ +version: '3' + +services: + # 此镜像仅用于测试 正式环境需自行安装数据库 + # SID: XE user: system password: oracle + oracle: + image: tekintian/oracle12c:latest + container_name: oracle + environment: + # 时区上海 + TZ: Asia/Shanghai + DBCA_TOTAL_MEMORY: 16192 + ports: + - "18080:8080" + - "1521:1521" + volumes: + # 数据挂载 + - "/docker/oracle/data:/u01/app/oracle" + network_mode: "host" + + # 此镜像仅用于测试 正式环境需自行安装数据库 + sqlserver: + image: mcr.microsoft.com/mssql/server:2017-latest + container_name: sqlserver + environment: + # 时区上海 + TZ: Asia/Shanghai + ACCEPT_EULA: "Y" + SA_PASSWORD: "Ruoyi@123" + ports: + - "1433:1433" + volumes: + # 数据挂载 + - "/docker/sqlserver/data:/var/opt/mssql" + network_mode: "host" + + postgres: + image: postgres:14.2 + container_name: postgres + environment: + POSTGRES_USER: root + POSTGRES_PASSWORD: root + POSTGRES_DB: postgres + ports: + - "5432:5432" + volumes: + - /docker/postgres/data:/var/lib/postgresql/data + network_mode: "host" + + postgres13: + image: postgres:13.6 + container_name: postgres13 + environment: + POSTGRES_USER: root + POSTGRES_PASSWORD: root + POSTGRES_DB: postgres + ports: + - "5433:5432" + volumes: + - /docker/postgres13/data:/var/lib/postgresql/data + network_mode: "host" diff --git a/script/docker/docker-compose.yml b/script/docker/docker-compose.yml new file mode 100644 index 0000000..b817f6e --- /dev/null +++ b/script/docker/docker-compose.yml @@ -0,0 +1,154 @@ +version: '3' + +services: + mysql: + image: mysql:8.0.31 + container_name: mysql + environment: + # 时区上海 + TZ: Asia/Shanghai + # root 密码 + MYSQL_ROOT_PASSWORD: root + # 初始化数据库(后续的初始化sql会在这个库执行) + MYSQL_DATABASE: ry-vue + ports: + - "3306:3306" + volumes: + # 数据挂载 + - /docker/mysql/data/:/var/lib/mysql/ + # 配置挂载 + - /docker/mysql/conf/:/etc/mysql/conf.d/ + command: + # 将mysql8.0默认密码策略 修改为 原先 策略 (mysql8.0对其默认策略做了更改 会导致密码无法匹配) + --default-authentication-plugin=mysql_native_password + --character-set-server=utf8mb4 + --collation-server=utf8mb4_general_ci + --explicit_defaults_for_timestamp=true + --lower_case_table_names=1 + privileged: true + network_mode: "host" + + nginx-web: + image: nginx:1.22.1 + container_name: nginx-web + environment: + # 时区上海 + TZ: Asia/Shanghai + ports: + - "80:80" + - "443:443" + volumes: + # 证书映射 + - /docker/nginx/cert:/etc/nginx/cert + # 配置文件映射 + - /docker/nginx/conf/nginx.conf:/etc/nginx/nginx.conf + # 页面目录 + - /docker/nginx/html:/usr/share/nginx/html + # 日志目录 + - /docker/nginx/log:/var/log/nginx + privileged: true + network_mode: "host" + + redis: + image: redis:6.2.7 + container_name: redis + ports: + - "6379:6379" + environment: + # 时区上海 + TZ: Asia/Shanghai + volumes: + # 配置文件 + - /docker/redis/conf:/redis/config:rw + # 数据文件 + - /docker/redis/data/:/redis/data/:rw + command: "redis-server /redis/config/redis.conf" + privileged: true + network_mode: "host" + + minio: + image: minio/minio:RELEASE.2023-03-24T21-41-23Z + container_name: minio + ports: + # api 端口 + - "9000:9000" + # 控制台端口 + - "9001:9001" + environment: + # 时区上海 + TZ: Asia/Shanghai + # 管理后台用户名 + MINIO_ROOT_USER: ruoyi + # 管理后台密码,最小8个字符 + MINIO_ROOT_PASSWORD: ruoyi123 + # https需要指定域名 + #MINIO_SERVER_URL: "https://xxx.com:9000" + #MINIO_BROWSER_REDIRECT_URL: "https://xxx.com:9001" + # 开启压缩 on 开启 off 关闭 + MINIO_COMPRESS: "off" + # 扩展名 .pdf,.doc 为空 所有类型均压缩 + MINIO_COMPRESS_EXTENSIONS: "" + # mime 类型 application/pdf 为空 所有类型均压缩 + MINIO_COMPRESS_MIME_TYPES: "" + volumes: + # 映射当前目录下的data目录至容器内/data目录 + - /docker/minio/data:/data + # 映射配置目录 + - /docker/minio/config:/root/.minio/ + command: server --address ':9000' --console-address ':9001' /data # 指定容器中的目录 /data + privileged: true + network_mode: "host" + + ruoyi-server1: + image: ruoyi/ruoyi-server:4.8.2 + container_name: ruoyi-server1 + environment: + # 时区上海 + TZ: Asia/Shanghai + SERVER_PORT: 8080 + volumes: + # 配置文件 + - /docker/server1/logs/:/ruoyi/server/logs/ + # skywalking 探针 +# - /docker/skywalking/agent/:/ruoyi/skywalking/agent + privileged: true + network_mode: "host" + + ruoyi-server2: + image: "ruoyi/ruoyi-server:4.8.2" + container_name: ruoyi-server2 + environment: + # 时区上海 + TZ: Asia/Shanghai + SERVER_PORT: 8081 + volumes: + # 配置文件 + - /docker/server2/logs/:/ruoyi/server/logs/ + # skywalking 探针 +# - /docker/skywalking/agent/:/ruoyi/skywalking/agent + privileged: true + network_mode: "host" + + ruoyi-monitor-admin: + image: ruoyi/ruoyi-monitor-admin:4.8.2 + container_name: ruoyi-monitor-admin + environment: + # 时区上海 + TZ: Asia/Shanghai + volumes: + # 配置文件 + - /docker/monitor/logs/:/ruoyi/monitor/logs + privileged: true + network_mode: "host" + + ruoyi-xxl-job-admin: + image: ruoyi/ruoyi-xxl-job-admin:4.8.2 + container_name: ruoyi-xxl-job-admin + environment: + # 时区上海 + TZ: Asia/Shanghai + volumes: + # 配置文件 + - /docker/xxljob/logs/:/ruoyi/xxljob/logs + privileged: true + network_mode: "host" diff --git a/script/docker/nginx/conf/nginx.conf b/script/docker/nginx/conf/nginx.conf new file mode 100644 index 0000000..e9630aa --- /dev/null +++ b/script/docker/nginx/conf/nginx.conf @@ -0,0 +1,111 @@ +worker_processes 1; + +error_log /var/log/nginx/error.log warn; +pid /var/run/nginx.pid; + +events { + worker_connections 1024; +} + +http { + include mime.types; + default_type application/octet-stream; + sendfile on; + keepalive_timeout 65; + # 限制body大小 + client_max_body_size 100m; + + log_format main '$remote_addr - $remote_user [$time_local] "$request" ' + '$status $body_bytes_sent "$http_referer" ' + '"$http_user_agent" "$http_x_forwarded_for"'; + + access_log /var/log/nginx/access.log main; + + upstream server { + ip_hash; + server 127.0.0.1:8080; + server 127.0.0.1:8081; + } + + upstream monitor-admin { + server 127.0.0.1:9090; + } + + upstream xxljob-admin { + server 127.0.0.1:9100; + } + + server { + listen 80; + server_name localhost; + + # https配置参考 start + #listen 443 ssl; + + # 证书直接存放 /docker/nginx/cert/ 目录下即可 更改证书名称即可 无需更改证书路径 + #ssl on; + #ssl_certificate /etc/nginx/cert/xxx.local.crt; # /etc/nginx/cert/ 为docker映射路径 不允许更改 + #ssl_certificate_key /etc/nginx/cert/xxx.local.key; # /etc/nginx/cert/ 为docker映射路径 不允许更改 + #ssl_session_timeout 5m; + #ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:ECDHE:ECDH:AES:HIGH:!NULL:!aNULL:!MD5:!ADH:!RC4; + #ssl_protocols TLSv1 TLSv1.1 TLSv1.2; + #ssl_prefer_server_ciphers on; + # https配置参考 end + + # 演示环境配置 拦截除 GET POST 之外的所有请求 + # if ($request_method !~* GET|POST) { + # rewrite ^/(.*)$ /403; + # } + + # location = /403 { + # default_type application/json; + # return 200 '{"msg":"演示模式,不允许操作","code":500}'; + # } + + # 限制外网访问内网 actuator 相关路径 + location ~ ^(/[^/]*)?/actuator(/.*)?$ { + return 403; + } + + location / { + root /usr/share/nginx/html; + try_files $uri $uri/ /index.html; + index index.html index.htm; + } + + location /prod-api/ { + proxy_set_header Host $http_host; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header REMOTE-HOST $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_pass http://server/; + } + + # https 会拦截内链所有的 http 请求 造成功能无法使用 + # 解决方案1 将 admin 服务 也配置成 https + # 解决方案2 将菜单配置为外链访问 走独立页面 http 访问 + location /admin/ { + proxy_set_header Host $http_host; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header REMOTE-HOST $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_pass http://monitor-admin/admin/; + } + + # https 会拦截内链所有的 http 请求 造成功能无法使用 + # 解决方案1 将 xxljob 服务 也配置成 https + # 解决方案2 将菜单配置为外链访问 走独立页面 http 访问 + location /xxl-job-admin/ { + proxy_set_header Host $http_host; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header REMOTE-HOST $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_pass http://xxljob-admin/xxl-job-admin/; + } + + error_page 500 502 503 504 /50x.html; + location = /50x.html { + root html; + } + } +} diff --git a/script/docker/redis/conf/redis.conf b/script/docker/redis/conf/redis.conf new file mode 100644 index 0000000..72255c6 --- /dev/null +++ b/script/docker/redis/conf/redis.conf @@ -0,0 +1,28 @@ +# redis 密码 +requirepass ruoyi123 + +# key 监听器配置 +# notify-keyspace-events Ex + +# 配置持久化文件存储路径 +dir /redis/data +# 配置rdb +# 15分钟内有至少1个key被更改则进行快照 +save 900 1 +# 5分钟内有至少10个key被更改则进行快照 +save 300 10 +# 1分钟内有至少10000个key被更改则进行快照 +save 60 10000 +# 开启压缩 +rdbcompression yes +# rdb文件名 用默认的即可 +dbfilename dump.rdb + +# 开启aof +appendonly yes +# 文件名 +appendfilename "appendonly.aof" +# 持久化策略,no:不同步,everysec:每秒一次,always:总是同步,速度比较慢 +# appendfsync always +appendfsync everysec +# appendfsync no diff --git a/script/docker/redis/data/README.md b/script/docker/redis/data/README.md new file mode 100644 index 0000000..fbc5474 --- /dev/null +++ b/script/docker/redis/data/README.md @@ -0,0 +1 @@ +数据目录 请执行 `chmod 777 /docker/redis/data` 赋予读写权限 否则将无法写入数据 \ No newline at end of file diff --git a/script/sql/oracle/oracle_ry_vue_4.X.sql b/script/sql/oracle/oracle_ry_vue_4.X.sql new file mode 100644 index 0000000..6c17214 --- /dev/null +++ b/script/sql/oracle/oracle_ry_vue_4.X.sql @@ -0,0 +1,965 @@ +-- ---------------------------- +-- 1、部门表 +-- ---------------------------- +create table sys_dept ( + dept_id number(20) not null, + parent_id number(20) default 0, + ancestors varchar2(500) default '', + dept_name varchar2(30) default '', + order_num number(4) default 0, + leader varchar2(20) default null, + phone varchar2(11) default null, + email varchar2(50) default null, + status char(1) default '0', + del_flag char(1) default '0', + create_by varchar2(64) default '', + create_time date, + update_by varchar2(64) default '', + update_time date +); + +alter table sys_dept add constraint pk_sys_dept primary key (dept_id); + +comment on table sys_dept is '部门表'; +comment on column sys_dept.dept_id is '部门id'; +comment on column sys_dept.parent_id is '父部门id'; +comment on column sys_dept.ancestors is '祖级列表'; +comment on column sys_dept.dept_name is '部门名称'; +comment on column sys_dept.order_num is '显示顺序'; +comment on column sys_dept.leader is '负责人'; +comment on column sys_dept.phone is '联系电话'; +comment on column sys_dept.email is '邮箱'; +comment on column sys_dept.status is '部门状态(0正常 1停用)'; +comment on column sys_dept.del_flag is '删除标志(0代表存在 2代表删除)'; +comment on column sys_dept.create_by is '创建者'; +comment on column sys_dept.create_time is '创建时间'; +comment on column sys_dept.update_by is '更新者'; +comment on column sys_dept.update_time is '更新时间'; + +-- ---------------------------- +-- 初始化-部门表数据 +-- ---------------------------- +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、用户信息表 +-- ---------------------------- +create table sys_user ( + user_id number(20) not null, + dept_id number(20) default null, + user_name varchar2(40) not null, + nick_name varchar2(40) not null, + user_type varchar2(10) default 'sys_user', + email varchar2(50) default '', + phonenumber varchar2(11) default '', + sex char(1) default '0', + avatar varchar2(100) default '', + password varchar2(100) default '', + status char(1) default '0', + del_flag char(1) default '0', + login_ip varchar2(128) default '', + login_date date, + create_by varchar2(64), + create_time date, + update_by varchar2(64) default '', + update_time date, + remark varchar2(500) default '' +); + +alter table sys_user add constraint pk_sys_user primary key (user_id); + +comment on table sys_user is '用户信息表'; +comment on column sys_user.user_id is '用户ID'; +comment on column sys_user.dept_id is '部门ID'; +comment on column sys_user.user_name is '用户账号'; +comment on column sys_user.nick_name is '用户昵称'; +comment on column sys_user.user_type is '用户类型(sys_user系统用户)'; +comment on column sys_user.email is '用户邮箱'; +comment on column sys_user.phonenumber is '手机号码'; +comment on column sys_user.sex is '用户性别(0男 1女 2未知)'; +comment on column sys_user.avatar is '头像路径'; +comment on column sys_user.password is '密码'; +comment on column sys_user.status is '帐号状态(0正常 1停用)'; +comment on column sys_user.del_flag is '删除标志(0代表存在 2代表删除)'; +comment on column sys_user.login_ip is '最后登录IP'; +comment on column sys_user.login_date is '最后登录时间'; +comment on column sys_user.create_by is '创建者'; +comment on column sys_user.create_time is '创建时间'; +comment on column sys_user.update_by is '更新者'; +comment on column sys_user.update_time is '更新时间'; +comment on column sys_user.remark is '备注'; + +-- ---------------------------- +-- 初始化-用户信息表数据 +-- ---------------------------- +insert into sys_user values(1, 103, 'admin', '疯狂的狮子Li', 'sys_user', 'crazyLionLi@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, 'lionli', '疯狂的狮子Li', 'sys_user', 'crazyLionLi@qq.com', '15666666666', '1', '', '$2a$10$7JB720yubVSZvUI0rEqK/.VqGOZTH.ulu33dHOiBE8ByOhJIrdAu2', '0', '0', '127.0.0.1', sysdate, 'admin', sysdate, '', null, '测试员'); + + +-- ---------------------------- +-- 3、岗位信息表 +-- ---------------------------- +create table sys_post ( + post_id number(20) not null, + post_code varchar2(64) not null, + post_name varchar2(50) not null, + post_sort number(4) not null, + status char(1) not null, + create_by varchar2(64) default '', + create_time date, + update_by varchar2(64) default '', + update_time date, + remark varchar2(500) +); + +alter table sys_post add constraint pk_sys_post primary key (post_id); + +comment on table sys_post is '岗位信息表'; +comment on column sys_post.post_id is '岗位ID'; +comment on column sys_post.post_code is '岗位编码'; +comment on column sys_post.post_name is '岗位名称'; +comment on column sys_post.post_sort is '显示顺序'; +comment on column sys_post.status is '状态(0正常 1停用)'; +comment on column sys_post.create_by is '创建者'; +comment on column sys_post.create_time is '创建时间'; +comment on column sys_post.update_by is '更新者'; +comment on column sys_post.update_time is '更新时间'; +comment on column sys_post.remark is '备注'; + +-- ---------------------------- +-- 初始化-岗位信息表数据 +-- ---------------------------- +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、角色信息表 +-- ---------------------------- +create table sys_role ( + role_id number(20) not null, + role_name varchar2(30) not null, + role_key varchar2(100) not null, + role_sort number(4) not null, + data_scope char(1) default '1', + menu_check_strictly number(1) default 1, + dept_check_strictly number(1) default 1, + status char(1) not null, + del_flag char(1) default '0', + create_by varchar2(64) default '', + create_time date, + update_by varchar2(64) default '', + update_time date, + remark varchar2(500) default null +); + +alter table sys_role add constraint pk_sys_role primary key (role_id); + +comment on table sys_role is '角色信息表'; +comment on column sys_role.role_id is '角色ID'; +comment on column sys_role.role_name is '角色名称'; +comment on column sys_role.role_key is '角色权限字符串'; +comment on column sys_role.role_sort is '显示顺序'; +comment on column sys_role.data_scope is '数据范围(1:全部数据权限 2:自定数据权限 3:本部门数据权限 4:本部门及以下数据权限)'; +comment on column sys_role.menu_check_strictly is '菜单树选择项是否关联显示'; +comment on column sys_role.dept_check_strictly is '部门树选择项是否关联显示'; +comment on column sys_role.status is '角色状态(0正常 1停用)'; +comment on column sys_role.del_flag is '删除标志(0代表存在 2代表删除)'; +comment on column sys_role.create_by is '创建者'; +comment on column sys_role.create_time is '创建时间'; +comment on column sys_role.update_by is '更新者'; +comment on column sys_role.update_time is '更新时间'; +comment on column sys_role.remark is '备注'; + +-- ---------------------------- +-- 初始化-角色信息表数据 +-- ---------------------------- +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、菜单权限表 +-- ---------------------------- +create table sys_menu ( + menu_id number(20) not null, + menu_name varchar2(50) not null, + parent_id number(20) default 0, + order_num number(4) default 0, + path varchar(200) default '', + component varchar(255) default null, + query_param varchar(255) default null, + is_frame number(1) default 1, + is_cache number(1) default 0, + menu_type char(1) default '', + visible char(1) default 0, + status char(1) default 0, + perms varchar2(100) default null, + icon varchar2(100) default '#', + create_by varchar2(64) default '', + create_time date, + update_by varchar2(64) default '', + update_time date , + remark varchar2(500) default '' +); + +alter table sys_menu add constraint pk_sys_menu primary key (menu_id); + +comment on table sys_menu is '菜单权限表'; +comment on column sys_menu.menu_id is '菜单ID'; +comment on column sys_menu.menu_name is '菜单名称'; +comment on column sys_menu.parent_id is '父菜单ID'; +comment on column sys_menu.order_num is '显示顺序'; +comment on column sys_menu.path is '请求地址'; +comment on column sys_menu.component is '路由地址'; +comment on column sys_menu.query_param is '路由参数'; +comment on column sys_menu.is_frame is '是否为外链(0是 1否)'; +comment on column sys_menu.is_cache is '是否缓存(0缓存 1不缓存)'; +comment on column sys_menu.menu_type is '菜单类型(M目录 C菜单 F按钮)'; +comment on column sys_menu.visible is '显示状态(0显示 1隐藏)'; +comment on column sys_menu.status is '菜单状态(0正常 1停用)'; +comment on column sys_menu.perms is '权限标识'; +comment on column sys_menu.icon is '菜单图标'; +comment on column sys_menu.create_by is '创建者'; +comment on column sys_menu.create_time is '创建时间'; +comment on column sys_menu.update_by is '更新者'; +comment on column sys_menu.update_time is '更新时间'; +comment on column sys_menu.remark is '备注'; + +-- ---------------------------- +-- 初始化-菜单信息表数据 +-- ---------------------------- +-- 一级菜单 +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', 'PLUS官网', '0', '4', 'https://gitee.com/dromara/RuoYi-Vue-Plus', null, '', 0, 0, 'M', '0', '0', '', 'guide', 'admin', sysdate, '', null, 'RuoYi-Vue-Plus官网地址'); +-- 二级菜单 +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('112', '缓存列表', '2', '6', 'cacheList', 'monitor/cache/list', '', 1, 0, 'C', '0', '0', 'monitor:cache:list', 'redis-list', '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', '表单构建', '3', '1', 'build', 'tool/build/index', '', 1, 0, 'C', '0', '0', 'tool:build:list', 'build', 'admin', sysdate, '', null, '表单构建菜单'); +insert into sys_menu values('115', '代码生成', '3', '2', 'gen', 'tool/gen/index', '', 1, 0, 'C', '0', '0', 'tool:gen:list', 'code', 'admin', sysdate, '', null, '代码生成菜单'); +-- springboot-admin监控 +insert into sys_menu values('117', 'Admin监控', '2', '5', 'Admin', 'monitor/admin/index', '', 1, 0, 'C', '0', '0', 'monitor:admin:list', 'dashboard', 'admin', sysdate, '', null, 'Admin监控菜单'); +-- oss菜单 +insert into sys_menu values('118', '文件管理', '1', '10', 'oss', 'system/oss/index', '', 1, 0, 'C', '0', '0', 'system:oss:list', 'upload', 'admin', sysdate, '', null, '文件管理菜单'); +-- xxl-job-admin控制台 +insert into sys_menu values('120', '任务调度中心', '2', '5', 'XxlJob', 'monitor/xxljob/index', '', 1, 0, 'C', '0', '0', 'monitor:xxljob:list', 'job', 'admin', sysdate, '', null, 'Xxl-Job控制台菜单'); + +-- 三级菜单 +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('1001', '用户查询', '100', '1', '', '', '', 1, 0, 'F', '0', '0', 'system:user:query', '#', 'admin', sysdate, '', null, ''); +insert into sys_menu values('1002', '用户新增', '100', '2', '', '', '', 1, 0, 'F', '0', '0', 'system:user:add', '#', 'admin', sysdate, '', null, ''); +insert into sys_menu values('1003', '用户修改', '100', '3', '', '', '', 1, 0, 'F', '0', '0', 'system:user:edit', '#', 'admin', sysdate, '', null, ''); +insert into sys_menu values('1004', '用户删除', '100', '4', '', '', '', 1, 0, 'F', '0', '0', 'system:user:remove', '#', 'admin', sysdate, '', null, ''); +insert into sys_menu values('1005', '用户导出', '100', '5', '', '', '', 1, 0, 'F', '0', '0', 'system:user:export', '#', 'admin', sysdate, '', null, ''); +insert into sys_menu values('1006', '用户导入', '100', '6', '', '', '', 1, 0, 'F', '0', '0', 'system:user:import', '#', 'admin', sysdate, '', null, ''); +insert into sys_menu values('1007', '重置密码', '100', '7', '', '', '', 1, 0, 'F', '0', '0', 'system:user:resetPwd', '#', 'admin', sysdate, '', null, ''); +-- 角色管理按钮 +insert into sys_menu values('1008', '角色查询', '101', '1', '', '', '', 1, 0, 'F', '0', '0', 'system:role:query', '#', 'admin', sysdate, '', null, ''); +insert into sys_menu values('1009', '角色新增', '101', '2', '', '', '', 1, 0, 'F', '0', '0', 'system:role:add', '#', 'admin', sysdate, '', null, ''); +insert into sys_menu values('1010', '角色修改', '101', '3', '', '', '', 1, 0, 'F', '0', '0', 'system:role:edit', '#', 'admin', sysdate, '', null, ''); +insert into sys_menu values('1011', '角色删除', '101', '4', '', '', '', 1, 0, 'F', '0', '0', 'system:role:remove', '#', 'admin', sysdate, '', null, ''); +insert into sys_menu values('1012', '角色导出', '101', '5', '', '', '', 1, 0, 'F', '0', '0', 'system:role:export', '#', 'admin', sysdate, '', null, ''); +-- 菜单管理按钮 +insert into sys_menu values('1013', '菜单查询', '102', '1', '', '', '', 1, 0, 'F', '0', '0', 'system:menu:query', '#', 'admin', sysdate, '', null, ''); +insert into sys_menu values('1014', '菜单新增', '102', '2', '', '', '', 1, 0, 'F', '0', '0', 'system:menu:add', '#', 'admin', sysdate, '', null, ''); +insert into sys_menu values('1015', '菜单修改', '102', '3', '', '', '', 1, 0, 'F', '0', '0', 'system:menu:edit', '#', 'admin', sysdate, '', null, ''); +insert into sys_menu values('1016', '菜单删除', '102', '4', '', '', '', 1, 0, 'F', '0', '0', 'system:menu:remove', '#', 'admin', sysdate, '', null, ''); +-- 部门管理按钮 +insert into sys_menu values('1017', '部门查询', '103', '1', '', '', '', 1, 0, 'F', '0', '0', 'system:dept:query', '#', 'admin', sysdate, '', null, ''); +insert into sys_menu values('1018', '部门新增', '103', '2', '', '', '', 1, 0, 'F', '0', '0', 'system:dept:add', '#', 'admin', sysdate, '', null, ''); +insert into sys_menu values('1019', '部门修改', '103', '3', '', '', '', 1, 0, 'F', '0', '0', 'system:dept:edit', '#', 'admin', sysdate, '', null, ''); +insert into sys_menu values('1020', '部门删除', '103', '4', '', '', '', 1, 0, 'F', '0', '0', 'system:dept:remove', '#', 'admin', sysdate, '', null, ''); +-- 岗位管理按钮 +insert into sys_menu values('1021', '岗位查询', '104', '1', '', '', '', 1, 0, 'F', '0', '0', 'system:post:query', '#', 'admin', sysdate, '', null, ''); +insert into sys_menu values('1022', '岗位新增', '104', '2', '', '', '', 1, 0, 'F', '0', '0', 'system:post:add', '#', 'admin', sysdate, '', null, ''); +insert into sys_menu values('1023', '岗位修改', '104', '3', '', '', '', 1, 0, 'F', '0', '0', 'system:post:edit', '#', 'admin', sysdate, '', null, ''); +insert into sys_menu values('1024', '岗位删除', '104', '4', '', '', '', 1, 0, 'F', '0', '0', 'system:post:remove', '#', 'admin', sysdate, '', null, ''); +insert into sys_menu values('1025', '岗位导出', '104', '5', '', '', '', 1, 0, 'F', '0', '0', 'system:post:export', '#', 'admin', sysdate, '', null, ''); +-- 字典管理按钮 +insert into sys_menu values('1026', '字典查询', '105', '1', '#', '', '', 1, 0, 'F', '0', '0', 'system:dict:query', '#', 'admin', sysdate, '', null, ''); +insert into sys_menu values('1027', '字典新增', '105', '2', '#', '', '', 1, 0, 'F', '0', '0', 'system:dict:add', '#', 'admin', sysdate, '', null, ''); +insert into sys_menu values('1028', '字典修改', '105', '3', '#', '', '', 1, 0, 'F', '0', '0', 'system:dict:edit', '#', 'admin', sysdate, '', null, ''); +insert into sys_menu values('1029', '字典删除', '105', '4', '#', '', '', 1, 0, 'F', '0', '0', 'system:dict:remove', '#', 'admin', sysdate, '', null, ''); +insert into sys_menu values('1030', '字典导出', '105', '5', '#', '', '', 1, 0, 'F', '0', '0', 'system:dict:export', '#', 'admin', sysdate, '', null, ''); +-- 参数设置按钮 +insert into sys_menu values('1031', '参数查询', '106', '1', '#', '', '', 1, 0, 'F', '0', '0', 'system:config:query', '#', 'admin', sysdate, '', null, ''); +insert into sys_menu values('1032', '参数新增', '106', '2', '#', '', '', 1, 0, 'F', '0', '0', 'system:config:add', '#', 'admin', sysdate, '', null, ''); +insert into sys_menu values('1033', '参数修改', '106', '3', '#', '', '', 1, 0, 'F', '0', '0', 'system:config:edit', '#', 'admin', sysdate, '', null, ''); +insert into sys_menu values('1034', '参数删除', '106', '4', '#', '', '', 1, 0, 'F', '0', '0', 'system:config:remove', '#', 'admin', sysdate, '', null, ''); +insert into sys_menu values('1035', '参数导出', '106', '5', '#', '', '', 1, 0, 'F', '0', '0', 'system:config:export', '#', 'admin', sysdate, '', null, ''); +-- 通知公告按钮 +insert into sys_menu values('1036', '公告查询', '107', '1', '#', '', '', 1, 0, 'F', '0', '0', 'system:notice:query', '#', 'admin', sysdate, '', null, ''); +insert into sys_menu values('1037', '公告新增', '107', '2', '#', '', '', 1, 0, 'F', '0', '0', 'system:notice:add', '#', 'admin', sysdate, '', null, ''); +insert into sys_menu values('1038', '公告修改', '107', '3', '#', '', '', 1, 0, 'F', '0', '0', 'system:notice:edit', '#', 'admin', sysdate, '', null, ''); +insert into sys_menu values('1039', '公告删除', '107', '4', '#', '', '', 1, 0, 'F', '0', '0', 'system:notice:remove', '#', 'admin', sysdate, '', null, ''); +-- 操作日志按钮 +insert into sys_menu values('1040', '操作查询', '500', '1', '#', '', '', 1, 0, 'F', '0', '0', 'monitor:operlog:query', '#', 'admin', sysdate, '', null, ''); +insert into sys_menu values('1041', '操作删除', '500', '2', '#', '', '', 1, 0, 'F', '0', '0', 'monitor:operlog:remove', '#', 'admin', sysdate, '', null, ''); +insert into sys_menu values('1042', '日志导出', '500', '4', '#', '', '', 1, 0, 'F', '0', '0', 'monitor:operlog:export', '#', 'admin', sysdate, '', null, ''); +-- 登录日志按钮 +insert into sys_menu values('1043', '登录查询', '501', '1', '#', '', '', 1, 0, 'F', '0', '0', 'monitor:logininfor:query', '#', 'admin', sysdate, '', null, ''); +insert into sys_menu values('1044', '登录删除', '501', '2', '#', '', '', 1, 0, 'F', '0', '0', 'monitor:logininfor:remove', '#', 'admin', sysdate, '', null, ''); +insert into sys_menu values('1045', '日志导出', '501', '3', '#', '', '', 1, 0, 'F', '0', '0', 'monitor:logininfor:export', '#', 'admin', sysdate, '', null, ''); +insert into sys_menu values('1050', '账户解锁', '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('1055', '生成查询', '115', '1', '#', '', '', 1, 0, 'F', '0', '0', 'tool:gen:query', '#', 'admin', sysdate, '', null, ''); +insert into sys_menu values('1056', '生成修改', '115', '2', '#', '', '', 1, 0, 'F', '0', '0', 'tool:gen:edit', '#', 'admin', sysdate, '', null, ''); +insert into sys_menu values('1057', '生成删除', '115', '3', '#', '', '', 1, 0, 'F', '0', '0', 'tool:gen:remove', '#', 'admin', sysdate, '', null, ''); +insert into sys_menu values('1058', '导入代码', '115', '2', '#', '', '', 1, 0, 'F', '0', '0', 'tool:gen:import', '#', 'admin', sysdate, '', null, ''); +insert into sys_menu values('1059', '预览代码', '115', '4', '#', '', '', 1, 0, 'F', '0', '0', 'tool:gen:preview', '#', 'admin', sysdate, '', null, ''); +insert into sys_menu values('1060', '生成代码', '115', '5', '#', '', '', 1, 0, 'F', '0', '0', 'tool:gen:code', '#', 'admin', sysdate, '', null, ''); +-- oss相关按钮 +insert into sys_menu values('1600', '文件查询', '118', '1', '#', '', '', 1, 0, 'F', '0', '0', 'system:oss:query', '#', 'admin', sysdate, '', null, ''); +insert into sys_menu values('1601', '文件上传', '118', '2', '#', '', '', 1, 0, 'F', '0', '0', 'system:oss:upload', '#', 'admin', sysdate, '', null, ''); +insert into sys_menu values('1602', '文件下载', '118', '3', '#', '', '', 1, 0, 'F', '0', '0', 'system:oss:download', '#', 'admin', sysdate, '', null, ''); +insert into sys_menu values('1603', '文件删除', '118', '4', '#', '', '', 1, 0, 'F', '0', '0', 'system:oss:remove', '#', 'admin', sysdate, '', null, ''); +insert into sys_menu values('1604', '配置添加', '118', '5', '#', '', '', 1, 0, 'F', '0', '0', 'system:oss:add', '#', 'admin', sysdate, '', null, ''); +insert into sys_menu values('1605', '配置编辑', '118', '6', '#', '', '', 1, 0, 'F', '0', '0', 'system:oss:edit', '#', 'admin', sysdate, '', null, ''); + + +-- ---------------------------- +-- 6、用户和角色关联表 用户N-1角色 +-- ---------------------------- +create table sys_user_role ( + user_id number(20) not null, + role_id number(20) not null +); + +alter table sys_user_role add constraint pk_sys_user_role primary key (user_id, role_id); + +comment on table sys_user_role is '用户和角色关联表'; +comment on column sys_user_role.user_id is '用户ID'; +comment on column sys_user_role.role_id is '角色ID'; + +-- ---------------------------- +-- 初始化-用户和角色关联表数据 +-- ---------------------------- +insert into sys_user_role values ('1', '1'); +insert into sys_user_role values ('2', '2'); + + +-- ---------------------------- +-- 7、角色和菜单关联表 角色1-N菜单 +-- ---------------------------- +create table sys_role_menu ( + role_id number(20) not null, + menu_id number(20) not null +); + +alter table sys_role_menu add constraint pk_sys_role_menu primary key (role_id, menu_id); + +comment on table sys_role_menu is '角色和菜单关联表'; +comment on column sys_role_menu.role_id is '角色ID'; +comment on column sys_role_menu.menu_id is '菜单ID'; + +-- ---------------------------- +-- 初始化-角色和菜单关联表数据 +-- ---------------------------- +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', '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', '1050'); +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', '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部门 +-- ---------------------------- +create table sys_role_dept ( + role_id number(20) not null, + dept_id number(20) not null +); + +alter table sys_role_dept add constraint pk_sys_role_dept primary key (role_id, dept_id); + +comment on table sys_role_dept is '角色和部门关联表'; +comment on column sys_role_dept.role_id is '角色ID'; +comment on column sys_role_dept.dept_id is '部门ID'; + +-- ---------------------------- +-- 初始化-角色和部门关联表数据 +-- ---------------------------- +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岗位 +-- ---------------------------- +create table sys_user_post ( + user_id number(20) not null, + post_id number(20) not null +); + +alter table sys_user_post add constraint pk_sys_user_post primary key (user_id, post_id); + +comment on table sys_user_post is '用户与岗位关联表'; +comment on column sys_user_post.user_id is '用户ID'; +comment on column sys_user_post.post_id is '岗位ID'; + +-- ---------------------------- +-- 初始化-用户与岗位关联表数据 +-- ---------------------------- +insert into sys_user_post values ('1', '1'); +insert into sys_user_post values ('2', '2'); + + +-- ---------------------------- +-- 10、操作日志记录 +-- ---------------------------- +create table sys_oper_log ( + oper_id number(20) not null , + title varchar2(50) default '', + business_type number(2) default 0, + method varchar2(100) default '', + request_method varchar(10) default '', + operator_type number(1) default 0, + oper_name varchar2(50) default '', + dept_name varchar2(50) default '', + oper_url varchar2(255) default '', + oper_ip varchar2(128) default '', + oper_location varchar2(255) default '', + oper_param varchar2(2100) default '', + json_result varchar2(2100) default '', + status number(1) default 0, + error_msg varchar2(2100) default '' , + oper_time date +); + +alter table sys_oper_log add constraint pk_sys_oper_log primary key (oper_id); +create index idx_sys_oper_log_bt on sys_oper_log (business_type); +create index idx_sys_oper_log_s on sys_oper_log (status); +create index idx_sys_oper_log_ot on sys_oper_log (oper_time); + +comment on table sys_oper_log is '操作日志记录'; +comment on column sys_oper_log.oper_id is '日志主键'; +comment on column sys_oper_log.title is '模块标题'; +comment on column sys_oper_log.business_type is '业务类型(0其它 1新增 2修改 3删除)'; +comment on column sys_oper_log.method is '方法名称'; +comment on column sys_oper_log.request_method is '请求方式'; +comment on column sys_oper_log.operator_type is '操作类别(0其它 1后台用户 2手机端用户)'; +comment on column sys_oper_log.oper_name is '操作人员'; +comment on column sys_oper_log.dept_name is '部门名称'; +comment on column sys_oper_log.oper_url is '请求URL'; +comment on column sys_oper_log.oper_ip is '主机地址'; +comment on column sys_oper_log.oper_location is '操作地点'; +comment on column sys_oper_log.oper_param is '请求参数'; +comment on column sys_oper_log.json_result is '返回参数'; +comment on column sys_oper_log.status is '操作状态(0正常 1异常)'; +comment on column sys_oper_log.error_msg is '错误消息'; +comment on column sys_oper_log.oper_time is '操作时间'; + + +-- ---------------------------- +-- 11、字典类型表 +-- ---------------------------- +create table sys_dict_type ( + dict_id number(20) not null, + dict_name varchar2(100) default '', + dict_type varchar2(100) default '', + status char(1) default '0', + create_by varchar2(64) default '', + create_time date, + update_by varchar2(64) default '', + update_time date, + remark varchar2(500) default null +); + +alter table sys_dict_type add constraint pk_sys_dict_type primary key (dict_id); +create unique index sys_dict_type_index1 on sys_dict_type (dict_type); + +comment on table sys_dict_type is '字典类型表'; +comment on column sys_dict_type.dict_id is '字典主键'; +comment on column sys_dict_type.dict_name is '字典名称'; +comment on column sys_dict_type.dict_type is '字典类型'; +comment on column sys_dict_type.status is '状态(0正常 1停用)'; +comment on column sys_dict_type.create_by is '创建者'; +comment on column sys_dict_type.create_time is '创建时间'; +comment on column sys_dict_type.update_by is '更新者'; +comment on column sys_dict_type.update_time is '更新时间'; +comment on column sys_dict_type.remark is '备注'; + +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(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、字典数据表 +-- ---------------------------- +create table sys_dict_data ( + dict_code number(20) not null, + dict_sort number(4) default 0, + dict_label varchar2(100) default '', + dict_value varchar2(100) default '', + dict_type varchar2(100) default '', + css_class varchar2(100) default null, + list_class varchar2(100) default null, + is_default char(1) default 'N', + status char(1) default '0', + create_by varchar2(64) default '', + create_time date, + update_by varchar2(64) default '', + update_time date, + remark varchar2(500) default null +); + +alter table sys_dict_data add constraint pk_sys_dict_data primary key (dict_code); + +comment on table sys_dict_data is '字典数据表'; +comment on column sys_dict_data.dict_code is '字典主键'; +comment on column sys_dict_data.dict_sort is '字典排序'; +comment on column sys_dict_data.dict_label is '字典标签'; +comment on column sys_dict_data.dict_value is '字典键值'; +comment on column sys_dict_data.dict_type is '字典类型'; +comment on column sys_dict_data.css_class is '样式属性(其他样式扩展)'; +comment on column sys_dict_data.list_class is '表格回显样式'; +comment on column sys_dict_data.is_default is '是否默认(Y是 N否)'; +comment on column sys_dict_data.status is '状态(0正常 1停用)'; +comment on column sys_dict_data.create_by is '创建者'; +comment on column sys_dict_data.create_time is '创建时间'; +comment on column sys_dict_data.update_by is '更新者'; +comment on column sys_dict_data.update_time is '更新时间'; +comment on column sys_dict_data.remark is '备注'; + +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(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(29, 99, '其他', '0', 'sys_oper_type', '', 'info', 'N', '0', 'admin', sysdate, '', null, '其他操作'); +insert into sys_dict_data values(18, 1, '新增', '1', 'sys_oper_type', '', 'info', 'N', '0', 'admin', sysdate, '', null, '新增操作'); +insert into sys_dict_data values(19, 2, '修改', '2', 'sys_oper_type', '', 'info', 'N', '0', 'admin', sysdate, '', null, '修改操作'); +insert into sys_dict_data values(20, 3, '删除', '3', 'sys_oper_type', '', 'danger', 'N', '0', 'admin', sysdate, '', null, '删除操作'); +insert into sys_dict_data values(21, 4, '授权', '4', 'sys_oper_type', '', 'primary', 'N', '0', 'admin', sysdate, '', null, '授权操作'); +insert into sys_dict_data values(22, 5, '导出', '5', 'sys_oper_type', '', 'warning', 'N', '0', 'admin', sysdate, '', null, '导出操作'); +insert into sys_dict_data values(23, 6, '导入', '6', 'sys_oper_type', '', 'warning', 'N', '0', 'admin', sysdate, '', null, '导入操作'); +insert into sys_dict_data values(24, 7, '强退', '7', 'sys_oper_type', '', 'danger', 'N', '0', 'admin', sysdate, '', null, '强退操作'); +insert into sys_dict_data values(25, 8, '生成代码', '8', 'sys_oper_type', '', 'warning', 'N', '0', 'admin', sysdate, '', null, '生成操作'); +insert into sys_dict_data values(26, 9, '清空数据', '9', 'sys_oper_type', '', 'danger', 'N', '0', 'admin', sysdate, '', null, '清空操作'); +insert into sys_dict_data values(27, 1, '成功', '0', 'sys_common_status', '', 'primary', 'N', '0', 'admin', sysdate, '', null, '正常状态'); +insert into sys_dict_data values(28, 2, '失败', '1', 'sys_common_status', '', 'danger', 'N', '0', 'admin', sysdate, '', null, '停用状态'); + + +-- ---------------------------- +-- 13、参数配置表 +-- ---------------------------- +create table sys_config ( + config_id number(20) not null, + config_name varchar2(100) default '', + config_key varchar2(100) default '', + config_value varchar2(100) default '', + config_type char(1) default 'N', + create_by varchar2(64) default '', + create_time date, + update_by varchar2(64) default '', + update_time date, + remark varchar2(500) default null +); +alter table sys_config add constraint pk_sys_config primary key (config_id); + +comment on table sys_config is '参数配置表'; +comment on column sys_config.config_id is '参数主键'; +comment on column sys_config.config_name is '参数名称'; +comment on column sys_config.config_key is '参数键名'; +comment on column sys_config.config_value is '参数键值'; +comment on column sys_config.config_type is '系统内置(Y是 N否)'; +comment on column sys_config.create_by is '创建者'; +comment on column sys_config.create_time is '创建时间'; +comment on column sys_config.update_by is '更新者'; +comment on column sys_config.update_time is '更新时间'; +comment on column sys_config.remark is '备注'; + +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(11, 'OSS预览列表资源开关', 'sys.oss.previewListResource', 'true', 'Y', 'admin', sysdate, '', null, 'true:开启, false:关闭'); + + +-- ---------------------------- +-- 14、系统访问记录 +-- ---------------------------- +create table sys_logininfor ( + info_id number(20) not null, + user_name varchar2(50) default '', + ipaddr varchar2(128) default '', + login_location varchar2(255) default '', + browser varchar2(50) default '', + os varchar2(50) default '', + status char(1) default '0', + msg varchar2(255) default '', + login_time date +); + +alter table sys_logininfor add constraint pk_sys_logininfor primary key (info_id); +create index idx_sys_logininfor_s on sys_logininfor (status); +create index idx_sys_logininfor_lt on sys_logininfor (login_time); + +comment on table sys_logininfor is '系统访问记录'; +comment on column sys_logininfor.info_id is '访问ID'; +comment on column sys_logininfor.user_name is '登录账号'; +comment on column sys_logininfor.ipaddr is '登录IP地址'; +comment on column sys_logininfor.login_location is '登录地点'; +comment on column sys_logininfor.browser is '浏览器类型'; +comment on column sys_logininfor.os is '操作系统'; +comment on column sys_logininfor.status is '登录状态(0成功 1失败)'; +comment on column sys_logininfor.msg is '提示消息'; +comment on column sys_logininfor.login_time is '访问时间'; + + +-- ---------------------------- +-- 17、通知公告表 +-- ---------------------------- +create table sys_notice ( + notice_id number(20) not null, + notice_title varchar2(50) not null, + notice_type char(1) not null, + notice_content clob default null, + status char(1) default '0', + create_by varchar2(64) default '', + create_time date, + update_by varchar2(64) default '', + update_time date, + remark varchar2(255) default null +); + +alter table sys_notice add constraint pk_sys_notice primary key (notice_id); + +comment on table sys_notice is '通知公告表'; +comment on column sys_notice.notice_id is '公告主键'; +comment on column sys_notice.notice_title is '公告标题'; +comment on column sys_notice.notice_type is '公告类型(1通知 2公告)'; +comment on column sys_notice.notice_content is '公告内容'; +comment on column sys_notice.status is '公告状态(0正常 1关闭)'; +comment on column sys_notice.create_by is '创建者'; +comment on column sys_notice.create_time is '创建时间'; +comment on column sys_notice.update_by is '更新者'; +comment on column sys_notice.update_time is '更新时间'; +comment on column sys_notice.remark is '备注'; + +-- ---------------------------- +-- 初始化-公告信息表数据 +-- ---------------------------- +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、代码生成业务表 +-- ---------------------------- +create table gen_table ( + table_id number(20) not null, + table_name varchar2(200) default '', + table_comment varchar2(500) default '', + sub_table_name varchar(64) default null, + sub_table_fk_name varchar(64) default null, + class_name varchar2(100) default '', + tpl_category varchar2(200) default 'crud', + package_name varchar2(100), + module_name varchar2(30), + business_name varchar2(30), + function_name varchar2(50), + function_author varchar2(50), + gen_type char(1) default '0', + gen_path varchar2(200) default '/', + options varchar2(1000), + create_by varchar2(64) default '', + create_time date, + update_by varchar2(64) default '', + update_time date, + remark varchar2(500) default null +); + +alter table gen_table add constraint pk_gen_table primary key (table_id); + +comment on table gen_table is '代码生成业务表'; +comment on column gen_table.table_id is '编号'; +comment on column gen_table.table_name is '表名称'; +comment on column gen_table.table_comment is '表描述'; +comment on column gen_table.sub_table_name is '关联子表的表名'; +comment on column gen_table.sub_table_fk_name is '子表关联的外键名'; +comment on column gen_table.class_name is '实体类名称'; +comment on column gen_table.tpl_category is '使用的模板(crud单表操作 tree树表操作)'; +comment on column gen_table.package_name is '生成包路径'; +comment on column gen_table.module_name is '生成模块名'; +comment on column gen_table.business_name is '生成业务名'; +comment on column gen_table.function_name is '生成功能名'; +comment on column gen_table.function_author is '生成功能作者'; +comment on column gen_table.gen_type is '生成代码方式(0zip压缩包 1自定义路径)'; +comment on column gen_table.gen_path is '生成路径(不填默认项目路径)'; +comment on column gen_table.options is '其它生成选项'; +comment on column gen_table.create_by is '创建者'; +comment on column gen_table.create_time is '创建时间'; +comment on column gen_table.update_by is '更新者'; +comment on column gen_table.update_time is '更新时间'; +comment on column gen_table.remark is '备注'; + + +-- ---------------------------- +-- 19、代码生成业务表字段 +-- ---------------------------- +create table gen_table_column ( + column_id number(20) not null, + table_id number(20), + column_name varchar2(200), + column_comment varchar2(500), + column_type varchar2(100), + java_type varchar2(500), + java_field varchar2(200), + is_pk char(1), + is_increment char(1), + is_required char(1), + is_insert char(1), + is_edit char(1), + is_list char(1), + is_query char(1), + query_type varchar(200) default 'EQ', + html_type varchar(200), + dict_type varchar(200) default '', + sort number(4), + create_by varchar(64) default '', + create_time date , + update_by varchar(64) default '', + update_time date +); + +alter table gen_table_column add constraint pk_gen_table_column primary key (column_id); + +comment on table gen_table_column is '代码生成业务表字段'; +comment on column gen_table_column.column_id is '编号'; +comment on column gen_table_column.table_id is '归属表编号'; +comment on column gen_table_column.column_name is '列名称'; +comment on column gen_table_column.column_comment is '列描述'; +comment on column gen_table_column.column_type is '列类型'; +comment on column gen_table_column.java_type is 'JAVA类型'; +comment on column gen_table_column.java_field is 'JAVA字段名'; +comment on column gen_table_column.is_pk is '是否主键(1是)'; +comment on column gen_table_column.is_increment is '是否自增(1是)'; +comment on column gen_table_column.is_required is '是否必填(1是)'; +comment on column gen_table_column.is_insert is '是否为插入字段(1是)'; +comment on column gen_table_column.is_edit is '是否编辑字段(1是)'; +comment on column gen_table_column.is_list is '是否列表字段(1是)'; +comment on column gen_table_column.is_query is '是否查询字段(1是)'; +comment on column gen_table_column.query_type is '查询方式(等于、不等于、大于、小于、范围)'; +comment on column gen_table_column.html_type is '显示类型(文本框、文本域、下拉框、复选框、单选框、日期控件)'; +comment on column gen_table_column.dict_type is '字典类型'; +comment on column gen_table_column.sort is '排序'; +comment on column gen_table_column.create_by is '创建者'; +comment on column gen_table_column.create_time is '创建时间'; +comment on column gen_table_column.update_by is '更新者'; +comment on column gen_table_column.update_time is '更新时间'; + + +-- ---------------------------- +-- OSS对象存储表 +-- ---------------------------- +create table sys_oss ( + oss_id number(20) not null, + file_name varchar(255) not null, + original_name varchar(255) not null, + file_suffix varchar(10) not null, + url varchar(500) not null, + service varchar(20) default 'minio' not null, + create_by varchar(64) default '', + create_time date, + update_by varchar(64) default '', + update_time date +); + +alter table sys_oss add constraint pk_sys_oss primary key (oss_id); + +comment on table sys_oss is 'OSS对象存储表'; +comment on column sys_oss.oss_id is '对象存储主键'; +comment on column sys_oss.file_name is '文件名'; +comment on column sys_oss.original_name is '原名'; +comment on column sys_oss.file_suffix is '文件后缀名'; +comment on column sys_oss.url is 'URL地址'; +comment on column sys_oss.service is '服务商'; +comment on column sys_oss.create_time is '创建时间'; +comment on column sys_oss.create_by is '上传者'; +comment on column sys_oss.update_time is '更新时间'; +comment on column sys_oss.update_by is '更新者'; + + +-- ---------------------------- +-- OSS对象存储动态配置表 +-- ---------------------------- +create table sys_oss_config ( + oss_config_id number(20) not null, + config_key varchar(20) not null, + access_key varchar(255) default '', + secret_key varchar(255) default '', + bucket_name varchar(255) default '', + prefix varchar(255) default '', + endpoint varchar(255) default '', + domain varchar(255) default '', + is_https char(1) default 'N', + region varchar(255) default '', + access_policy char(1) default '1' not null, + status char(1) default '1', + ext1 varchar(255) default '', + create_by varchar(64) default '', + remark varchar(500) default null, + create_time date, + update_by varchar(64) default '', + update_time date +); + +alter table sys_oss_config add constraint pk_sys_oss_config primary key (oss_config_id); + +comment on table sys_oss_config is '对象存储配置表'; +comment on column sys_oss_config.oss_config_id is '主建'; +comment on column sys_oss_config.config_key is '配置key'; +comment on column sys_oss_config.access_key is 'accesskey'; +comment on column sys_oss_config.secret_key is '秘钥'; +comment on column sys_oss_config.bucket_name is '桶名称'; +comment on column sys_oss_config.prefix is '前缀'; +comment on column sys_oss_config.endpoint is '访问站点'; +comment on column sys_oss_config.domain is '自定义域名'; +comment on column sys_oss_config.is_https is '是否https(Y=是,N=否)'; +comment on column sys_oss_config.region is '域'; +comment on column sys_oss_config.access_policy is '桶权限类型(0=private 1=public 2=custom)'; +comment on column sys_oss_config.status is '是否默认(0=是,1=否)'; +comment on column sys_oss_config.ext1 is '扩展字段'; +comment on column sys_oss_config.remark is '备注'; +comment on column sys_oss_config.create_by is '创建者'; +comment on column sys_oss_config.create_time is '创建时间'; +comment on column sys_oss_config.update_by is '更新者'; +comment on column sys_oss_config.update_time is '更新时间'; + +insert into sys_oss_config values (1, 'minio', 'ruoyi', 'ruoyi123', 'ruoyi', '', '127.0.0.1:9000', '','N', '', '1', '0', '', NULL, 'admin', sysdate, 'admin', sysdate); +insert into sys_oss_config values (2, 'qiniu', 'XXXXXXXXXXXXXXX', 'XXXXXXXXXXXXXXX', 'ruoyi', '', 's3-cn-north-1.qiniucs.com', '','N', '', '1', '1', '', NULL, 'admin', sysdate, 'admin', sysdate); +insert into sys_oss_config values (3, 'aliyun', 'XXXXXXXXXXXXXXX', 'XXXXXXXXXXXXXXX', 'ruoyi', '', 'oss-cn-beijing.aliyuncs.com', '','N', '', '1', '1', '', NULL, 'admin', sysdate, 'admin', sysdate); +insert into sys_oss_config values (4, 'qcloud', 'XXXXXXXXXXXXXXX', 'XXXXXXXXXXXXXXX', 'ruoyi-1250000000', '', 'cos.ap-beijing.myqcloud.com', '','N', 'ap-beijing', '1', '1', '', NULL, 'admin', sysdate, 'admin', sysdate); +insert into sys_oss_config values (5, 'image', 'ruoyi', 'ruoyi123', 'ruoyi', 'image', '127.0.0.1:9000', '','N', '', '1', '1', '', NULL, 'admin', sysdate, 'admin', sysdate); + + +-- ---------------------------- +-- 钩子 ,用于session连接之后 自动设置默认的date类型格式化 简化时间查询 +-- 如需设置其它配置 可在此钩子内任意增加处理语句 +-- 例如: SELECT * FROM sys_user WHERE create_time BETWEEN '2022-03-01 00:00:00' AND '2022-04-01 00:00:00' +-- ---------------------------- +create or replace trigger login_trg +after logon on database +begin +execute immediate 'alter session set nls_date_format=''YYYY-MM-DD HH24:MI:SS'''; +end; diff --git a/script/sql/oracle/oracle_test.sql b/script/sql/oracle/oracle_test.sql new file mode 100644 index 0000000..97a427e --- /dev/null +++ b/script/sql/oracle/oracle_test.sql @@ -0,0 +1,196 @@ +create table test_demo ( + id number(20) not null, + dept_id number(20) default null, + user_id number(20) default null, + order_num number(10) default 0, + test_key varchar2(255) default null, + value varchar2(255) default null, + version number(10) default 0, + create_time date, + create_by varchar2(64) default null, + update_time date, + update_by varchar2(64) default null, + del_flag number(2) default 0 +); + +alter table test_demo add constraint pk_test_demo primary key (id); + +comment on table test_demo is '测试单表'; +comment on column test_demo.id is '主键'; +comment on column test_demo.dept_id is '部门id'; +comment on column test_demo.user_id is '用户id'; +comment on column test_demo.order_num is '排序号'; +comment on column test_demo.test_key is 'key键'; +comment on column test_demo.value is '值'; +comment on column test_demo.version is '版本'; +comment on column test_demo.create_time is '创建时间'; +comment on column test_demo.create_by is '创建人'; +comment on column test_demo.update_time is '更新时间'; +comment on column test_demo.update_by is '更新人'; +comment on column test_demo.del_flag is '删除标志'; + +create table test_tree ( + id number(20) not null, + parent_id number(20) default 0, + dept_id number(20) default null, + user_id number(20) default null, + tree_name varchar2(255) default null, + version number(10) default 0, + create_time date, + create_by varchar2(64) default null, + update_time date, + update_by varchar2(64) default null, + del_flag number(2) default 0 +); + +alter table test_tree add constraint pk_test_tree primary key (id); + +comment on table test_tree is '测试树表'; +comment on column test_tree.id is '主键'; +comment on column test_tree.parent_id is '父id'; +comment on column test_tree.dept_id is '部门id'; +comment on column test_tree.user_id is '用户id'; +comment on column test_tree.tree_name is '值'; +comment on column test_tree.version is '版本'; +comment on column test_tree.create_time is '创建时间'; +comment on column test_tree.create_by is '创建人'; +comment on column test_tree.update_time is '更新时间'; +comment on column test_tree.update_by is '更新人'; +comment on column test_tree.del_flag is '删除标志'; + +insert into sys_user(user_id, dept_id, user_name, nick_name, user_type, email, phonenumber, sex, avatar, password, status, del_flag, login_ip, login_date, create_by, create_time, update_by, update_time, remark) values (3, 108, 'test', '本部门及以下 密码666666', 'sys_user', '', '', '0', '', '$2a$10$b8yUzN0C71sbz.PhNOCgJe.Tu1yWC3RNrTyjSQ8p1W0.aaUXUJ.Ne', '0', '0', '127.0.0.1', sysdate, 'admin', sysdate, 'test', sysdate, null); +insert into sys_user(user_id, dept_id, user_name, nick_name, user_type, email, phonenumber, sex, avatar, password, status, del_flag, login_ip, login_date, create_by, create_time, update_by, update_time, remark) values (4, 102, 'test1', '仅本人 密码666666', 'sys_user', '', '', '0', '', '$2a$10$b8yUzN0C71sbz.PhNOCgJe.Tu1yWC3RNrTyjSQ8p1W0.aaUXUJ.Ne', '0', '0', '127.0.0.1', sysdate, 'admin', sysdate, 'test1', sysdate, null); + +insert into sys_menu(menu_id, menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark) values (5, '测试菜单', 0, 5, 'demo', null, 1, 0, 'M', '0', '0', null, 'star', 'admin', sysdate, 'admin', sysdate, ''); + +insert into sys_menu(menu_id, menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark) values (1500, '测试单表', 5, 1, 'demo', 'demo/demo/index', 1, 0, 'C', '0', '0', 'demo:demo:list', '#', 'admin', sysdate, '', null, '测试单表菜单'); +insert into sys_menu(menu_id, menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark) values (1501, '测试单表查询', 1500, 1, '#', '', 1, 0, 'F', '0', '0', 'demo:demo:query', '#', 'admin', sysdate, '', null, ''); +insert into sys_menu(menu_id, menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark) values (1502, '测试单表新增', 1500, 2, '#', '', 1, 0, 'F', '0', '0', 'demo:demo:add', '#', 'admin', sysdate, '', null, ''); +insert into sys_menu(menu_id, menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark) values (1503, '测试单表修改', 1500, 3, '#', '', 1, 0, 'F', '0', '0', 'demo:demo:edit', '#', 'admin', sysdate, '', null, ''); +insert into sys_menu(menu_id, menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark) values (1504, '测试单表删除', 1500, 4, '#', '', 1, 0, 'F', '0', '0', 'demo:demo:remove', '#', 'admin', sysdate, '', null, ''); +insert into sys_menu(menu_id, menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark) values (1505, '测试单表导出', 1500, 5, '#', '', 1, 0, 'F', '0', '0', 'demo:demo:export', '#', 'admin', sysdate, '', null, ''); + +insert into sys_menu(menu_id, menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark) values (1506, '测试树表', 5, 1, 'tree', 'demo/tree/index', 1, 0, 'C', '0', '0', 'demo:tree:list', '#', 'admin', sysdate, '', null, '测试树表菜单'); +insert into sys_menu(menu_id, menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark) values (1507, '测试树表查询', 1506, 1, '#', '', 1, 0, 'F', '0', '0', 'demo:tree:query', '#', 'admin', sysdate, '', null, ''); +insert into sys_menu(menu_id, menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark) values (1508, '测试树表新增', 1506, 2, '#', '', 1, 0, 'F', '0', '0', 'demo:tree:add', '#', 'admin', sysdate, '', null, ''); +insert into sys_menu(menu_id, menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark) values (1509, '测试树表修改', 1506, 3, '#', '', 1, 0, 'F', '0', '0', 'demo:tree:edit', '#', 'admin', sysdate, '', null, ''); +insert into sys_menu(menu_id, menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark) values (1510, '测试树表删除', 1506, 4, '#', '', 1, 0, 'F', '0', '0', 'demo:tree:remove', '#', 'admin', sysdate, '', null, ''); +insert into sys_menu(menu_id, menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark) values (1511, '测试树表导出', 1506, 5, '#', '', 1, 0, 'F', '0', '0', 'demo:tree:export', '#', 'admin', sysdate, '', null, ''); + +insert into sys_role(role_id, role_name, role_key, role_sort, data_scope, menu_check_strictly, dept_check_strictly, status, del_flag, create_by, create_time, update_by, update_time, remark) values (3, '本部门及以下', 'test1', 3, '4', 1, 1, '0', '0', 'admin', sysdate, '', null, null); +insert into sys_role(role_id, role_name, role_key, role_sort, data_scope, menu_check_strictly, dept_check_strictly, status, del_flag, create_by, create_time, update_by, update_time, remark) values (4, '仅本人', 'test2', 4, '5', 1, 1, '0', '0', 'admin', sysdate, '', null, null); + +insert into sys_role_menu(role_id, menu_id) values (3, 1); +insert into sys_role_menu(role_id, menu_id) values (3, 5); +insert into sys_role_menu(role_id, menu_id) values (3, 100); +insert into sys_role_menu(role_id, menu_id) values (3, 101); +insert into sys_role_menu(role_id, menu_id) values (3, 102); +insert into sys_role_menu(role_id, menu_id) values (3, 103); +insert into sys_role_menu(role_id, menu_id) values (3, 104); +insert into sys_role_menu(role_id, menu_id) values (3, 105); +insert into sys_role_menu(role_id, menu_id) values (3, 106); +insert into sys_role_menu(role_id, menu_id) values (3, 107); +insert into sys_role_menu(role_id, menu_id) values (3, 108); +insert into sys_role_menu(role_id, menu_id) values (3, 500); +insert into sys_role_menu(role_id, menu_id) values (3, 501); +insert into sys_role_menu(role_id, menu_id) values (3, 1001); +insert into sys_role_menu(role_id, menu_id) values (3, 1002); +insert into sys_role_menu(role_id, menu_id) values (3, 1003); +insert into sys_role_menu(role_id, menu_id) values (3, 1004); +insert into sys_role_menu(role_id, menu_id) values (3, 1005); +insert into sys_role_menu(role_id, menu_id) values (3, 1006); +insert into sys_role_menu(role_id, menu_id) values (3, 1007); +insert into sys_role_menu(role_id, menu_id) values (3, 1008); +insert into sys_role_menu(role_id, menu_id) values (3, 1009); +insert into sys_role_menu(role_id, menu_id) values (3, 1010); +insert into sys_role_menu(role_id, menu_id) values (3, 1011); +insert into sys_role_menu(role_id, menu_id) values (3, 1012); +insert into sys_role_menu(role_id, menu_id) values (3, 1013); +insert into sys_role_menu(role_id, menu_id) values (3, 1014); +insert into sys_role_menu(role_id, menu_id) values (3, 1015); +insert into sys_role_menu(role_id, menu_id) values (3, 1016); +insert into sys_role_menu(role_id, menu_id) values (3, 1017); +insert into sys_role_menu(role_id, menu_id) values (3, 1018); +insert into sys_role_menu(role_id, menu_id) values (3, 1019); +insert into sys_role_menu(role_id, menu_id) values (3, 1020); +insert into sys_role_menu(role_id, menu_id) values (3, 1021); +insert into sys_role_menu(role_id, menu_id) values (3, 1022); +insert into sys_role_menu(role_id, menu_id) values (3, 1023); +insert into sys_role_menu(role_id, menu_id) values (3, 1024); +insert into sys_role_menu(role_id, menu_id) values (3, 1025); +insert into sys_role_menu(role_id, menu_id) values (3, 1026); +insert into sys_role_menu(role_id, menu_id) values (3, 1027); +insert into sys_role_menu(role_id, menu_id) values (3, 1028); +insert into sys_role_menu(role_id, menu_id) values (3, 1029); +insert into sys_role_menu(role_id, menu_id) values (3, 1030); +insert into sys_role_menu(role_id, menu_id) values (3, 1031); +insert into sys_role_menu(role_id, menu_id) values (3, 1032); +insert into sys_role_menu(role_id, menu_id) values (3, 1033); +insert into sys_role_menu(role_id, menu_id) values (3, 1034); +insert into sys_role_menu(role_id, menu_id) values (3, 1035); +insert into sys_role_menu(role_id, menu_id) values (3, 1036); +insert into sys_role_menu(role_id, menu_id) values (3, 1037); +insert into sys_role_menu(role_id, menu_id) values (3, 1038); +insert into sys_role_menu(role_id, menu_id) values (3, 1039); +insert into sys_role_menu(role_id, menu_id) values (3, 1040); +insert into sys_role_menu(role_id, menu_id) values (3, 1041); +insert into sys_role_menu(role_id, menu_id) values (3, 1042); +insert into sys_role_menu(role_id, menu_id) values (3, 1043); +insert into sys_role_menu(role_id, menu_id) values (3, 1044); +insert into sys_role_menu(role_id, menu_id) values (3, 1045); +insert into sys_role_menu(role_id, menu_id) values (3, 1500); +insert into sys_role_menu(role_id, menu_id) values (3, 1501); +insert into sys_role_menu(role_id, menu_id) values (3, 1502); +insert into sys_role_menu(role_id, menu_id) values (3, 1503); +insert into sys_role_menu(role_id, menu_id) values (3, 1504); +insert into sys_role_menu(role_id, menu_id) values (3, 1505); +insert into sys_role_menu(role_id, menu_id) values (3, 1506); +insert into sys_role_menu(role_id, menu_id) values (3, 1507); +insert into sys_role_menu(role_id, menu_id) values (3, 1508); +insert into sys_role_menu(role_id, menu_id) values (3, 1509); +insert into sys_role_menu(role_id, menu_id) values (3, 1510); +insert into sys_role_menu(role_id, menu_id) values (3, 1511); +insert into sys_role_menu(role_id, menu_id) values (4, 5); +insert into sys_role_menu(role_id, menu_id) values (4, 1500); +insert into sys_role_menu(role_id, menu_id) values (4, 1501); +insert into sys_role_menu(role_id, menu_id) values (4, 1502); +insert into sys_role_menu(role_id, menu_id) values (4, 1503); +insert into sys_role_menu(role_id, menu_id) values (4, 1504); +insert into sys_role_menu(role_id, menu_id) values (4, 1505); +insert into sys_role_menu(role_id, menu_id) values (4, 1506); +insert into sys_role_menu(role_id, menu_id) values (4, 1507); +insert into sys_role_menu(role_id, menu_id) values (4, 1508); +insert into sys_role_menu(role_id, menu_id) values (4, 1509); +insert into sys_role_menu(role_id, menu_id) values (4, 1510); +insert into sys_role_menu(role_id, menu_id) values (4, 1511); + +insert into sys_user_role(user_id, role_id) values (3, 3); +insert into sys_user_role(user_id, role_id) values (4, 4); + +insert into test_demo(id, dept_id, user_id, order_num, test_key, value, version, create_time, create_by, update_time, update_by, del_flag) values (1, 102, 4, 1, '测试数据权限', '测试', 0, sysdate, 'admin', null, '', 0); +insert into test_demo(id, dept_id, user_id, order_num, test_key, value, version, create_time, create_by, update_time, update_by, del_flag) values (2, 102, 3, 2, '子节点1', '111', 0, sysdate, 'admin', null, '', 0); +insert into test_demo(id, dept_id, user_id, order_num, test_key, value, version, create_time, create_by, update_time, update_by, del_flag) values (3, 102, 3, 3, '子节点2', '222', 0, sysdate, 'admin', null, '', 0); +insert into test_demo(id, dept_id, user_id, order_num, test_key, value, version, create_time, create_by, update_time, update_by, del_flag) values (4, 108, 4, 4, '测试数据', 'demo', 0, sysdate, 'admin', null, '', 0); +insert into test_demo(id, dept_id, user_id, order_num, test_key, value, version, create_time, create_by, update_time, update_by, del_flag) values (5, 108, 3, 13, '子节点11', '1111', 0, sysdate, 'admin', null, '', 0); +insert into test_demo(id, dept_id, user_id, order_num, test_key, value, version, create_time, create_by, update_time, update_by, del_flag) values (6, 108, 3, 12, '子节点22', '2222', 0, sysdate, 'admin', null, '', 0); +insert into test_demo(id, dept_id, user_id, order_num, test_key, value, version, create_time, create_by, update_time, update_by, del_flag) values (7, 108, 3, 11, '子节点33', '3333', 0, sysdate, 'admin', null, '', 0); +insert into test_demo(id, dept_id, user_id, order_num, test_key, value, version, create_time, create_by, update_time, update_by, del_flag) values (8, 108, 3, 10, '子节点44', '4444', 0, sysdate, 'admin', null, '', 0); +insert into test_demo(id, dept_id, user_id, order_num, test_key, value, version, create_time, create_by, update_time, update_by, del_flag) values (9, 108, 3, 9, '子节点55', '5555', 0, sysdate, 'admin', null, '', 0); +insert into test_demo(id, dept_id, user_id, order_num, test_key, value, version, create_time, create_by, update_time, update_by, del_flag) values (10, 108, 3, 8, '子节点66', '6666', 0, sysdate, 'admin', null, '', 0); +insert into test_demo(id, dept_id, user_id, order_num, test_key, value, version, create_time, create_by, update_time, update_by, del_flag) values (11, 108, 3, 7, '子节点77', '7777', 0, sysdate, 'admin', null, '', 0); +insert into test_demo(id, dept_id, user_id, order_num, test_key, value, version, create_time, create_by, update_time, update_by, del_flag) values (12, 108, 3, 6, '子节点88', '8888', 0, sysdate, 'admin', null, '', 0); +insert into test_demo(id, dept_id, user_id, order_num, test_key, value, version, create_time, create_by, update_time, update_by, del_flag) values (13, 108, 3, 5, '子节点99', '9999', 0, sysdate, 'admin', null, '', 0); + +insert into test_tree(id, parent_id, dept_id, user_id, tree_name, version, create_time, create_by, update_time, update_by, del_flag) values (1, 0, 102, 4, '测试数据权限', 0, sysdate, 'admin', null, '', 0); +insert into test_tree(id, parent_id, dept_id, user_id, tree_name, version, create_time, create_by, update_time, update_by, del_flag) values (2, 1, 102, 3, '子节点1', 0, sysdate, 'admin', null, '', 0); +insert into test_tree(id, parent_id, dept_id, user_id, tree_name, version, create_time, create_by, update_time, update_by, del_flag) values (3, 2, 102, 3, '子节点2', 0, sysdate, 'admin', null, '', 0); +insert into test_tree(id, parent_id, dept_id, user_id, tree_name, version, create_time, create_by, update_time, update_by, del_flag) values (4, 0, 108, 4, '测试树1', 0, sysdate, 'admin', null, '', 0); +insert into test_tree(id, parent_id, dept_id, user_id, tree_name, version, create_time, create_by, update_time, update_by, del_flag) values (5, 4, 108, 3, '子节点11', 0, sysdate, 'admin', null, '', 0); +insert into test_tree(id, parent_id, dept_id, user_id, tree_name, version, create_time, create_by, update_time, update_by, del_flag) values (6, 4, 108, 3, '子节点22', 0, sysdate, 'admin', null, '', 0); +insert into test_tree(id, parent_id, dept_id, user_id, tree_name, version, create_time, create_by, update_time, update_by, del_flag) values (7, 4, 108, 3, '子节点33', 0, sysdate, 'admin', null, '', 0); +insert into test_tree(id, parent_id, dept_id, user_id, tree_name, version, create_time, create_by, update_time, update_by, del_flag) values (8, 5, 108, 3, '子节点44', 0, sysdate, 'admin', null, '', 0); +insert into test_tree(id, parent_id, dept_id, user_id, tree_name, version, create_time, create_by, update_time, update_by, del_flag) values (9, 6, 108, 3, '子节点55', 0, sysdate, 'admin', null, '', 0); +insert into test_tree(id, parent_id, dept_id, user_id, tree_name, version, create_time, create_by, update_time, update_by, del_flag) values (10, 7, 108, 3, '子节点66', 0, sysdate, 'admin', null, '', 0); +insert into test_tree(id, parent_id, dept_id, user_id, tree_name, version, create_time, create_by, update_time, update_by, del_flag) values (11, 7, 108, 3, '子节点77', 0, sysdate, 'admin', null, '', 0); +insert into test_tree(id, parent_id, dept_id, user_id, tree_name, version, create_time, create_by, update_time, update_by, del_flag) values (12, 10, 108, 3, '子节点88', 0, sysdate, 'admin', null, '', 0); +insert into test_tree(id, parent_id, dept_id, user_id, tree_name, version, create_time, create_by, update_time, update_by, del_flag) values (13, 10, 108, 3, '子节点99', 0, sysdate, 'admin', null, '', 0); diff --git a/script/sql/postgres/postgres_ry_vue_4.X.sql b/script/sql/postgres/postgres_ry_vue_4.X.sql new file mode 100644 index 0000000..dc1f248 --- /dev/null +++ b/script/sql/postgres/postgres_ry_vue_4.X.sql @@ -0,0 +1,976 @@ +-- ---------------------------- +-- 1、部门表 +-- ---------------------------- +drop table if exists sys_dept; +create table if not exists sys_dept +( + dept_id int8, + parent_id int8 default 0, + ancestors varchar(500)default ''::varchar, + dept_name varchar(30) default ''::varchar, + order_num int4 default 0, + leader varchar(20) default null::varchar, + phone varchar(11) default null::varchar, + email varchar(50) default null::varchar, + status char default '0'::bpchar, + del_flag char default '0'::bpchar, + create_by varchar(64) default ''::varchar, + create_time timestamp, + update_by varchar(64) default ''::varchar, + update_time timestamp, + constraint "sys_dept_pk" primary key (dept_id) +); + +comment on table sys_dept is '部门表'; +comment on column sys_dept.dept_id is '部门ID'; +comment on column sys_dept.parent_id is '父部门ID'; +comment on column sys_dept.ancestors is '祖级列表'; +comment on column sys_dept.dept_name is '部门名称'; +comment on column sys_dept.order_num is '显示顺序'; +comment on column sys_dept.leader is '负责人'; +comment on column sys_dept.phone is '联系电话'; +comment on column sys_dept.email is '邮箱'; +comment on column sys_dept.status is '部门状态(0正常 1停用)'; +comment on column sys_dept.del_flag is '删除标志(0代表存在 2代表删除)'; +comment on column sys_dept.create_by is '创建者'; +comment on column sys_dept.create_time is '创建时间'; +comment on column sys_dept.update_by is '更新者'; +comment on column sys_dept.update_time is '更新时间'; + +-- ---------------------------- +-- 初始化-部门表数据 +-- ---------------------------- +insert into sys_dept values(100, 0, '0', '若依科技', 0, '若依', '15888888888', 'ry@qq.com', '0', '0', 'admin', now(), '', null); +insert into sys_dept values(101, 100, '0,100', '深圳总公司', 1, '若依', '15888888888', 'ry@qq.com', '0', '0', 'admin', now(), '', null); +insert into sys_dept values(102, 100, '0,100', '长沙分公司', 2, '若依', '15888888888', 'ry@qq.com', '0', '0', 'admin', now(), '', null); +insert into sys_dept values(103, 101, '0,100,101', '研发部门', 1, '若依', '15888888888', 'ry@qq.com', '0', '0', 'admin', now(), '', null); +insert into sys_dept values(104, 101, '0,100,101', '市场部门', 2, '若依', '15888888888', 'ry@qq.com', '0', '0', 'admin', now(), '', null); +insert into sys_dept values(105, 101, '0,100,101', '测试部门', 3, '若依', '15888888888', 'ry@qq.com', '0', '0', 'admin', now(), '', null); +insert into sys_dept values(106, 101, '0,100,101', '财务部门', 4, '若依', '15888888888', 'ry@qq.com', '0', '0', 'admin', now(), '', null); +insert into sys_dept values(107, 101, '0,100,101', '运维部门', 5, '若依', '15888888888', 'ry@qq.com', '0', '0', 'admin', now(), '', null); +insert into sys_dept values(108, 102, '0,100,102', '市场部门', 1, '若依', '15888888888', 'ry@qq.com', '0', '0', 'admin', now(), '', null); +insert into sys_dept values(109, 102, '0,100,102', '财务部门', 2, '若依', '15888888888', 'ry@qq.com', '0', '0', 'admin', now(), '', null); + +-- ---------------------------- +-- 2、用户信息表 +-- ---------------------------- +drop table if exists sys_user; +create table if not exists sys_user +( + user_id int8, + dept_id int8, + user_name varchar(30) not null, + nick_name varchar(30) not null, + user_type varchar(10) default 'sys_user'::varchar, + email varchar(50) default ''::varchar, + phonenumber varchar(11) default ''::varchar, + sex char default '0'::bpchar, + avatar varchar(100) default ''::varchar, + password varchar(100) default ''::varchar, + status char default '0'::bpchar, + del_flag char default '0'::bpchar, + login_ip varchar(128) default ''::varchar, + login_date timestamp, + create_by varchar(64) default ''::varchar, + create_time timestamp, + update_by varchar(64) default ''::varchar, + update_time timestamp, + remark varchar(500) default null::varchar, + constraint "sys_user_pk" primary key (user_id) +); + +comment on table sys_user is '用户信息表'; +comment on column sys_user.user_id is '用户ID'; +comment on column sys_user.dept_id is '部门ID'; +comment on column sys_user.user_name is '用户账号'; +comment on column sys_user.nick_name is '用户昵称'; +comment on column sys_user.user_type is '用户类型(sys_user系统用户)'; +comment on column sys_user.email is '用户邮箱'; +comment on column sys_user.phonenumber is '手机号码'; +comment on column sys_user.sex is '用户性别(0男 1女 2未知)'; +comment on column sys_user.avatar is '头像地址'; +comment on column sys_user.password is '密码'; +comment on column sys_user.status is '帐号状态(0正常 1停用)'; +comment on column sys_user.del_flag is '删除标志(0代表存在 2代表删除)'; +comment on column sys_user.login_ip is '最后登陆IP'; +comment on column sys_user.login_date is '最后登陆时间'; +comment on column sys_user.create_by is '创建者'; +comment on column sys_user.create_time is '创建时间'; +comment on column sys_user.update_by is '更新者'; +comment on column sys_user.update_time is '更新时间'; +comment on column sys_user.remark is '备注'; + +-- ---------------------------- +-- 初始化-用户信息表数据 +-- ---------------------------- +insert into sys_user values(1, 103, 'admin', '疯狂的狮子Li', 'sys_user', 'crazyLionLi@163.com', '15888888888', '1', '', '$2a$10$7JB720yubVSZvUI0rEqK/.VqGOZTH.ulu33dHOiBE8ByOhJIrdAu2', '0', '0', '127.0.0.1', now(), 'admin', now(), '', null, '管理员'); +insert into sys_user values(2, 105, 'ry', '疯狂的狮子Li', 'sys_user', 'crazyLionLi@qq.com', '15666666666', '1', '', '$2a$10$7JB720yubVSZvUI0rEqK/.VqGOZTH.ulu33dHOiBE8ByOhJIrdAu2', '0', '0', '127.0.0.1', now(), 'admin', now(), '', null, '测试员'); + + +-- ---------------------------- +-- 3、岗位信息表 +-- ---------------------------- +drop table if exists sys_post; +create table if not exists sys_post +( + post_id int8, + post_code varchar(64) not null, + post_name varchar(50) not null, + post_sort int4 not null, + status char not null, + create_by varchar(64) default ''::varchar, + create_time timestamp, + update_by varchar(64) default ''::varchar, + update_time timestamp, + remark varchar(500) default null::varchar, + constraint "sys_post_pk" primary key (post_id) +); + +comment on table sys_post is '岗位信息表'; +comment on column sys_post.post_id is '岗位ID'; +comment on column sys_post.post_code is '岗位编码'; +comment on column sys_post.post_name is '岗位名称'; +comment on column sys_post.post_sort is '显示顺序'; +comment on column sys_post.status is '状态(0正常 1停用)'; +comment on column sys_post.create_by is '创建者'; +comment on column sys_post.create_time is '创建时间'; +comment on column sys_post.update_by is '更新者'; +comment on column sys_post.update_time is '更新时间'; +comment on column sys_post.remark is '备注'; + +-- ---------------------------- +-- 初始化-岗位信息表数据 +-- ---------------------------- +insert into sys_post values(1, 'ceo', '董事长', 1, '0', 'admin', now(), '', null, ''); +insert into sys_post values(2, 'se', '项目经理', 2, '0', 'admin', now(), '', null, ''); +insert into sys_post values(3, 'hr', '人力资源', 3, '0', 'admin', now(), '', null, ''); +insert into sys_post values(4, 'user', '普通员工', 4, '0', 'admin', now(), '', null, ''); + +-- ---------------------------- +-- 4、角色信息表 +-- ---------------------------- +drop table if exists sys_role; +create table if not exists sys_role +( + role_id int8, + role_name varchar(30) not null, + role_key varchar(100) not null, + role_sort int4 not null, + data_scope char default '1'::bpchar, + menu_check_strictly bool default true, + dept_check_strictly bool default true, + status char not null, + del_flag char default '0'::bpchar, + create_by varchar(64) default ''::varchar, + create_time timestamp, + update_by varchar(64) default ''::varchar, + update_time timestamp, + remark varchar(500) default null::varchar, + constraint "sys_role_pk" primary key (role_id) +); + +comment on table sys_role is '角色信息表'; +comment on column sys_role.role_id is '角色ID'; +comment on column sys_role.role_name is '角色名称'; +comment on column sys_role.role_key is '角色权限字符串'; +comment on column sys_role.role_sort is '显示顺序'; +comment on column sys_role.data_scope is '数据范围(1:全部数据权限 2:自定数据权限 3:本部门数据权限 4:本部门及以下数据权限)'; +comment on column sys_role.menu_check_strictly is '菜单树选择项是否关联显示'; +comment on column sys_role.dept_check_strictly is '部门树选择项是否关联显示'; +comment on column sys_role.status is '角色状态(0正常 1停用)'; +comment on column sys_role.del_flag is '删除标志(0代表存在 2代表删除)'; +comment on column sys_role.create_by is '创建者'; +comment on column sys_role.create_time is '创建时间'; +comment on column sys_role.update_by is '更新者'; +comment on column sys_role.update_time is '更新时间'; +comment on column sys_role.remark is '备注'; + +-- ---------------------------- +-- 初始化-角色信息表数据 +-- ---------------------------- +insert into sys_role values('1', '超级管理员', 'admin', 1, '1', 't', 't', '0', '0', 'admin', now(), '', null, '超级管理员'); +insert into sys_role values('2', '普通角色', 'common', 2, '2', 't', 't', '0', '0', 'admin', now(), '', null, '普通角色'); + + +-- ---------------------------- +-- 5、菜单权限表 +-- ---------------------------- +drop table if exists sys_menu; +create table if not exists sys_menu +( + menu_id int8, + menu_name varchar(50) not null, + parent_id int8 default 0, + order_num int4 default 0, + path varchar(200) default ''::varchar, + component varchar(255) default null::varchar, + query_param varchar(255) default null::varchar, + is_frame char default '1'::bpchar, + is_cache char default '0'::bpchar, + menu_type char default ''::bpchar, + visible char default '0'::bpchar, + status char default '0'::bpchar, + perms varchar(100) default null::varchar, + icon varchar(100) default '#'::varchar, + create_by varchar(64) default ''::varchar, + create_time timestamp, + update_by varchar(64) default ''::varchar, + update_time timestamp, + remark varchar(500) default ''::varchar, + constraint "sys_menu_pk" primary key (menu_id) +); + +comment on table sys_menu is '菜单权限表'; +comment on column sys_menu.menu_id is '菜单ID'; +comment on column sys_menu.menu_name is '菜单名称'; +comment on column sys_menu.parent_id is '父菜单ID'; +comment on column sys_menu.order_num is '显示顺序'; +comment on column sys_menu.path is '路由地址'; +comment on column sys_menu.component is '组件路径'; +comment on column sys_menu.query_param is '路由参数'; +comment on column sys_menu.is_frame is '是否为外链(0是 1否)'; +comment on column sys_menu.is_cache is '是否缓存(0缓存 1不缓存)'; +comment on column sys_menu.menu_type is '菜单类型(M目录 C菜单 F按钮)'; +comment on column sys_menu.visible is '显示状态(0显示 1隐藏)'; +comment on column sys_menu.status is '菜单状态(0正常 1停用)'; +comment on column sys_menu.perms is '权限标识'; +comment on column sys_menu.icon is '菜单图标'; +comment on column sys_menu.create_by is '创建者'; +comment on column sys_menu.create_time is '创建时间'; +comment on column sys_menu.update_by is '更新者'; +comment on column sys_menu.update_time is '更新时间'; +comment on column sys_menu.remark is '备注'; + +-- ---------------------------- +-- 初始化-菜单信息表数据 +-- ---------------------------- +-- 一级菜单 +insert into sys_menu values('1', '系统管理', '0', '1', 'system', null, '', '1', '0', 'M', '0', '0', '', 'system', 'admin', now(), '', null, '系统管理目录'); +insert into sys_menu values('2', '系统监控', '0', '2', 'monitor', null, '', '1', '0', 'M', '0', '0', '', 'monitor', 'admin', now(), '', null, '系统监控目录'); +insert into sys_menu values('3', '系统工具', '0', '3', 'tool', null, '', '1', '0', 'M', '0', '0', '', 'tool', 'admin', now(), '', null, '系统工具目录'); +insert into sys_menu values('4', 'PLUS官网', '0', '4', 'https://gitee.com/dromara/RuoYi-Vue-Plus', null, '', '0', '0', 'M', '0', '0', '', 'guide', 'admin', now(), '', null, 'RuoYi-Vue-Plus官网地址'); +-- 二级菜单 +insert into sys_menu values('100', '用户管理', '1', '1', 'user', 'system/user/index', '', '1', '0', 'C', '0', '0', 'system:user:list', 'user', 'admin', now(), '', null, '用户管理菜单'); +insert into sys_menu values('101', '角色管理', '1', '2', 'role', 'system/role/index', '', '1', '0', 'C', '0', '0', 'system:role:list', 'peoples', 'admin', now(), '', null, '角色管理菜单'); +insert into sys_menu values('102', '菜单管理', '1', '3', 'menu', 'system/menu/index', '', '1', '0', 'C', '0', '0', 'system:menu:list', 'tree-table', 'admin', now(), '', null, '菜单管理菜单'); +insert into sys_menu values('103', '部门管理', '1', '4', 'dept', 'system/dept/index', '', '1', '0', 'C', '0', '0', 'system:dept:list', 'tree', 'admin', now(), '', null, '部门管理菜单'); +insert into sys_menu values('104', '岗位管理', '1', '5', 'post', 'system/post/index', '', '1', '0', 'C', '0', '0', 'system:post:list', 'post', 'admin', now(), '', null, '岗位管理菜单'); +insert into sys_menu values('105', '字典管理', '1', '6', 'dict', 'system/dict/index', '', '1', '0', 'C', '0', '0', 'system:dict:list', 'dict', 'admin', now(), '', null, '字典管理菜单'); +insert into sys_menu values('106', '参数设置', '1', '7', 'config', 'system/config/index', '', '1', '0', 'C', '0', '0', 'system:config:list', 'edit', 'admin', now(), '', null, '参数设置菜单'); +insert into sys_menu values('107', '通知公告', '1', '8', 'notice', 'system/notice/index', '', '1', '0', 'C', '0', '0', 'system:notice:list', 'message', 'admin', now(), '', null, '通知公告菜单'); +insert into sys_menu values('108', '日志管理', '1', '9', 'log', '', '', '1', '0', 'M', '0', '0', '', 'log', 'admin', now(), '', null, '日志管理菜单'); +insert into sys_menu values('109', '在线用户', '2', '1', 'online', 'monitor/online/index', '', '1', '0', 'C', '0', '0', 'monitor:online:list', 'online', 'admin', now(), '', null, '在线用户菜单'); +insert into sys_menu values('112', '缓存列表', '2', '6', 'cacheList', 'monitor/cache/list', '', '1', '0', 'C', '0', '0', 'monitor:cache:list', 'redis-list', 'admin', now(), '', null, '缓存列表菜单'); +insert into sys_menu values('113', '缓存监控', '2', '5', 'cache', 'monitor/cache/index', '', '1', '0', 'C', '0', '0', 'monitor:cache:list', 'redis', 'admin', now(), '', null, '缓存监控菜单'); +insert into sys_menu values('114', '表单构建', '3', '1', 'build', 'tool/build/index', '', '1', '0', 'C', '0', '0', 'tool:build:list', 'build', 'admin', now(), '', null, '表单构建菜单'); +insert into sys_menu values('115', '代码生成', '3', '2', 'gen', 'tool/gen/index', '', '1', '0', 'C', '0', '0', 'tool:gen:list', 'code', 'admin', now(), '', null, '代码生成菜单'); +-- springboot-admin监控 +insert into sys_menu values('117', 'Admin监控', '2', '5', 'Admin', 'monitor/admin/index', '', '1', '0', 'C', '0', '0', 'monitor:admin:list', 'dashboard', 'admin', now(), '', null, 'Admin监控菜单'); +-- oss菜单 +insert into sys_menu values('118', '文件管理', '1', '10', 'oss', 'system/oss/index', '', '1', '0', 'C', '0', '0', 'system:oss:list', 'upload', 'admin', now(), '', null, '文件管理菜单'); +-- xxl-job-admin控制台 +insert into sys_menu values('120', '任务调度中心', '2', '5', 'XxlJob', 'monitor/xxljob/index', '', '1', '0', 'C', '0', '0', 'monitor:xxljob:list', 'job', 'admin', now(), '', null, 'Xxl-Job控制台菜单'); + +-- 三级菜单 +insert into sys_menu values('500', '操作日志', '108', '1', 'operlog', 'monitor/operlog/index', '', '1', '0', 'C', '0', '0', 'monitor:operlog:list', 'form', 'admin', now(), '', null, '操作日志菜单'); +insert into sys_menu values('501', '登录日志', '108', '2', 'logininfor', 'monitor/logininfor/index', '', '1', '0', 'C', '0', '0', 'monitor:logininfor:list', 'logininfor', 'admin', now(), '', null, '登录日志菜单'); +-- 用户管理按钮 +insert into sys_menu values('1001', '用户查询', '100', '1', '', '', '', '1', '0', 'F', '0', '0', 'system:user:query', '#', 'admin', now(), '', null, ''); +insert into sys_menu values('1002', '用户新增', '100', '2', '', '', '', '1', '0', 'F', '0', '0', 'system:user:add', '#', 'admin', now(), '', null, ''); +insert into sys_menu values('1003', '用户修改', '100', '3', '', '', '', '1', '0', 'F', '0', '0', 'system:user:edit', '#', 'admin', now(), '', null, ''); +insert into sys_menu values('1004', '用户删除', '100', '4', '', '', '', '1', '0', 'F', '0', '0', 'system:user:remove', '#', 'admin', now(), '', null, ''); +insert into sys_menu values('1005', '用户导出', '100', '5', '', '', '', '1', '0', 'F', '0', '0', 'system:user:export', '#', 'admin', now(), '', null, ''); +insert into sys_menu values('1006', '用户导入', '100', '6', '', '', '', '1', '0', 'F', '0', '0', 'system:user:import', '#', 'admin', now(), '', null, ''); +insert into sys_menu values('1007', '重置密码', '100', '7', '', '', '', '1', '0', 'F', '0', '0', 'system:user:resetPwd', '#', 'admin', now(), '', null, ''); +-- 角色管理按钮 +insert into sys_menu values('1008', '角色查询', '101', '1', '', '', '', '1', '0', 'F', '0', '0', 'system:role:query', '#', 'admin', now(), '', null, ''); +insert into sys_menu values('1009', '角色新增', '101', '2', '', '', '', '1', '0', 'F', '0', '0', 'system:role:add', '#', 'admin', now(), '', null, ''); +insert into sys_menu values('1010', '角色修改', '101', '3', '', '', '', '1', '0', 'F', '0', '0', 'system:role:edit', '#', 'admin', now(), '', null, ''); +insert into sys_menu values('1011', '角色删除', '101', '4', '', '', '', '1', '0', 'F', '0', '0', 'system:role:remove', '#', 'admin', now(), '', null, ''); +insert into sys_menu values('1012', '角色导出', '101', '5', '', '', '', '1', '0', 'F', '0', '0', 'system:role:export', '#', 'admin', now(), '', null, ''); +-- 菜单管理按钮 +insert into sys_menu values('1013', '菜单查询', '102', '1', '', '', '', '1', '0', 'F', '0', '0', 'system:menu:query', '#', 'admin', now(), '', null, ''); +insert into sys_menu values('1014', '菜单新增', '102', '2', '', '', '', '1', '0', 'F', '0', '0', 'system:menu:add', '#', 'admin', now(), '', null, ''); +insert into sys_menu values('1015', '菜单修改', '102', '3', '', '', '', '1', '0', 'F', '0', '0', 'system:menu:edit', '#', 'admin', now(), '', null, ''); +insert into sys_menu values('1016', '菜单删除', '102', '4', '', '', '', '1', '0', 'F', '0', '0', 'system:menu:remove', '#', 'admin', now(), '', null, ''); +-- 部门管理按钮 +insert into sys_menu values('1017', '部门查询', '103', '1', '', '', '', '1', '0', 'F', '0', '0', 'system:dept:query', '#', 'admin', now(), '', null, ''); +insert into sys_menu values('1018', '部门新增', '103', '2', '', '', '', '1', '0', 'F', '0', '0', 'system:dept:add', '#', 'admin', now(), '', null, ''); +insert into sys_menu values('1019', '部门修改', '103', '3', '', '', '', '1', '0', 'F', '0', '0', 'system:dept:edit', '#', 'admin', now(), '', null, ''); +insert into sys_menu values('1020', '部门删除', '103', '4', '', '', '', '1', '0', 'F', '0', '0', 'system:dept:remove', '#', 'admin', now(), '', null, ''); +-- 岗位管理按钮 +insert into sys_menu values('1021', '岗位查询', '104', '1', '', '', '', '1', '0', 'F', '0', '0', 'system:post:query', '#', 'admin', now(), '', null, ''); +insert into sys_menu values('1022', '岗位新增', '104', '2', '', '', '', '1', '0', 'F', '0', '0', 'system:post:add', '#', 'admin', now(), '', null, ''); +insert into sys_menu values('1023', '岗位修改', '104', '3', '', '', '', '1', '0', 'F', '0', '0', 'system:post:edit', '#', 'admin', now(), '', null, ''); +insert into sys_menu values('1024', '岗位删除', '104', '4', '', '', '', '1', '0', 'F', '0', '0', 'system:post:remove', '#', 'admin', now(), '', null, ''); +insert into sys_menu values('1025', '岗位导出', '104', '5', '', '', '', '1', '0', 'F', '0', '0', 'system:post:export', '#', 'admin', now(), '', null, ''); +-- 字典管理按钮 +insert into sys_menu values('1026', '字典查询', '105', '1', '#', '', '', '1', '0', 'F', '0', '0', 'system:dict:query', '#', 'admin', now(), '', null, ''); +insert into sys_menu values('1027', '字典新增', '105', '2', '#', '', '', '1', '0', 'F', '0', '0', 'system:dict:add', '#', 'admin', now(), '', null, ''); +insert into sys_menu values('1028', '字典修改', '105', '3', '#', '', '', '1', '0', 'F', '0', '0', 'system:dict:edit', '#', 'admin', now(), '', null, ''); +insert into sys_menu values('1029', '字典删除', '105', '4', '#', '', '', '1', '0', 'F', '0', '0', 'system:dict:remove', '#', 'admin', now(), '', null, ''); +insert into sys_menu values('1030', '字典导出', '105', '5', '#', '', '', '1', '0', 'F', '0', '0', 'system:dict:export', '#', 'admin', now(), '', null, ''); +-- 参数设置按钮 +insert into sys_menu values('1031', '参数查询', '106', '1', '#', '', '', '1', '0', 'F', '0', '0', 'system:config:query', '#', 'admin', now(), '', null, ''); +insert into sys_menu values('1032', '参数新增', '106', '2', '#', '', '', '1', '0', 'F', '0', '0', 'system:config:add', '#', 'admin', now(), '', null, ''); +insert into sys_menu values('1033', '参数修改', '106', '3', '#', '', '', '1', '0', 'F', '0', '0', 'system:config:edit', '#', 'admin', now(), '', null, ''); +insert into sys_menu values('1034', '参数删除', '106', '4', '#', '', '', '1', '0', 'F', '0', '0', 'system:config:remove', '#', 'admin', now(), '', null, ''); +insert into sys_menu values('1035', '参数导出', '106', '5', '#', '', '', '1', '0', 'F', '0', '0', 'system:config:export', '#', 'admin', now(), '', null, ''); +-- 通知公告按钮 +insert into sys_menu values('1036', '公告查询', '107', '1', '#', '', '', '1', '0', 'F', '0', '0', 'system:notice:query', '#', 'admin', now(), '', null, ''); +insert into sys_menu values('1037', '公告新增', '107', '2', '#', '', '', '1', '0', 'F', '0', '0', 'system:notice:add', '#', 'admin', now(), '', null, ''); +insert into sys_menu values('1038', '公告修改', '107', '3', '#', '', '', '1', '0', 'F', '0', '0', 'system:notice:edit', '#', 'admin', now(), '', null, ''); +insert into sys_menu values('1039', '公告删除', '107', '4', '#', '', '', '1', '0', 'F', '0', '0', 'system:notice:remove', '#', 'admin', now(), '', null, ''); +-- 操作日志按钮 +insert into sys_menu values('1040', '操作查询', '500', '1', '#', '', '', '1', '0', 'F', '0', '0', 'monitor:operlog:query', '#', 'admin', now(), '', null, ''); +insert into sys_menu values('1041', '操作删除', '500', '2', '#', '', '', '1', '0', 'F', '0', '0', 'monitor:operlog:remove', '#', 'admin', now(), '', null, ''); +insert into sys_menu values('1042', '日志导出', '500', '4', '#', '', '', '1', '0', 'F', '0', '0', 'monitor:operlog:export', '#', 'admin', now(), '', null, ''); +-- 登录日志按钮 +insert into sys_menu values('1043', '登录查询', '501', '1', '#', '', '', '1', '0', 'F', '0', '0', 'monitor:logininfor:query', '#', 'admin', now(), '', null, ''); +insert into sys_menu values('1044', '登录删除', '501', '2', '#', '', '', '1', '0', 'F', '0', '0', 'monitor:logininfor:remove', '#', 'admin', now(), '', null, ''); +insert into sys_menu values('1045', '日志导出', '501', '3', '#', '', '', '1', '0', 'F', '0', '0', 'monitor:logininfor:export', '#', 'admin', now(), '', null, ''); +insert into sys_menu values('1050', '账户解锁', '501', '4', '#', '', '', '1', '0', 'F', '0', '0', 'monitor:logininfor:unlock', '#', 'admin', now(), '', null, ''); +-- 在线用户按钮 +insert into sys_menu values('1046', '在线查询', '109', '1', '#', '', '', '1', '0', 'F', '0', '0', 'monitor:online:query', '#', 'admin', now(), '', null, ''); +insert into sys_menu values('1047', '批量强退', '109', '2', '#', '', '', '1', '0', 'F', '0', '0', 'monitor:online:batchLogout', '#', 'admin', now(), '', null, ''); +insert into sys_menu values('1048', '单条强退', '109', '3', '#', '', '', '1', '0', 'F', '0', '0', 'monitor:online:forceLogout', '#', 'admin', now(), '', null, ''); +-- 代码生成按钮 +insert into sys_menu values('1055', '生成查询', '115', '1', '#', '', '', '1', '0', 'F', '0', '0', 'tool:gen:query', '#', 'admin', now(), '', null, ''); +insert into sys_menu values('1056', '生成修改', '115', '2', '#', '', '', '1', '0', 'F', '0', '0', 'tool:gen:edit', '#', 'admin', now(), '', null, ''); +insert into sys_menu values('1057', '生成删除', '115', '3', '#', '', '', '1', '0', 'F', '0', '0', 'tool:gen:remove', '#', 'admin', now(), '', null, ''); +insert into sys_menu values('1058', '导入代码', '115', '2', '#', '', '', '1', '0', 'F', '0', '0', 'tool:gen:import', '#', 'admin', now(), '', null, ''); +insert into sys_menu values('1059', '预览代码', '115', '4', '#', '', '', '1', '0', 'F', '0', '0', 'tool:gen:preview', '#', 'admin', now(), '', null, ''); +insert into sys_menu values('1060', '生成代码', '115', '5', '#', '', '', '1', '0', 'F', '0', '0', 'tool:gen:code', '#', 'admin', now(), '', null, ''); +-- oss相关按钮 +insert into sys_menu values('1600', '文件查询', '118', '1', '#', '', '', '1', '0', 'F', '0', '0', 'system:oss:query', '#', 'admin', now(), '', null, ''); +insert into sys_menu values('1601', '文件上传', '118', '2', '#', '', '', '1', '0', 'F', '0', '0', 'system:oss:upload', '#', 'admin', now(), '', null, ''); +insert into sys_menu values('1602', '文件下载', '118', '3', '#', '', '', '1', '0', 'F', '0', '0', 'system:oss:download', '#', 'admin', now(), '', null, ''); +insert into sys_menu values('1603', '文件删除', '118', '4', '#', '', '', '1', '0', 'F', '0', '0', 'system:oss:remove', '#', 'admin', now(), '', null, ''); +insert into sys_menu values('1604', '配置添加', '118', '5', '#', '', '', '1', '0', 'F', '0', '0', 'system:oss:add', '#', 'admin', now(), '', null, ''); +insert into sys_menu values('1605', '配置编辑', '118', '6', '#', '', '', '1', '0', 'F', '0', '0', 'system:oss:edit', '#', 'admin', now(), '', null, ''); + + +-- ---------------------------- +-- 6、用户和角色关联表 用户N-1角色 +-- ---------------------------- +drop table if exists sys_user_role; +create table if not exists sys_user_role +( + user_id int8 not null, + role_id int8 not null, + constraint sys_user_role_pk primary key (user_id, role_id) +); + +comment on table sys_user_role is '用户和角色关联表'; +comment on column sys_user_role.user_id is '用户ID'; +comment on column sys_user_role.role_id is '角色ID'; + +-- ---------------------------- +-- 初始化-用户和角色关联表数据 +-- ---------------------------- +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 if not exists sys_role_menu +( + role_id int8 not null, + menu_id int8 not null, + constraint sys_role_menu_pk primary key (role_id, menu_id) +); + +comment on table sys_role_menu is '角色和菜单关联表'; +comment on column sys_role_menu.role_id is '角色ID'; +comment on column sys_role_menu.menu_id is '菜单ID'; + +-- ---------------------------- +-- 初始化-角色和菜单关联表数据 +-- ---------------------------- +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', '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', '1050'); +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', '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 if not exists sys_role_dept +( + role_id int8 not null, + dept_id int8 not null, + constraint sys_role_dept_pk primary key (role_id, dept_id) +); + +comment on table sys_role_dept is '角色和部门关联表'; +comment on column sys_role_dept.role_id is '角色ID'; +comment on column sys_role_dept.dept_id is '部门ID'; + +-- ---------------------------- +-- 初始化-角色和部门关联表数据 +-- ---------------------------- +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 if not exists sys_user_post +( + user_id int8 not null, + post_id int8 not null, + constraint sys_user_post_pk primary key (user_id, post_id) +); + +comment on table sys_user_post is '用户与岗位关联表'; +comment on column sys_user_post.user_id is '用户ID'; +comment on column sys_user_post.post_id is '岗位ID'; + +-- ---------------------------- +-- 初始化-用户与岗位关联表数据 +-- ---------------------------- +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 if not exists sys_oper_log +( + oper_id int8, + title varchar(50) default ''::varchar, + business_type int4 default 0, + method varchar(100) default ''::varchar, + request_method varchar(10) default ''::varchar, + operator_type int4 default 0, + oper_name varchar(50) default ''::varchar, + dept_name varchar(50) default ''::varchar, + oper_url varchar(255) default ''::varchar, + oper_ip varchar(128) default ''::varchar, + oper_location varchar(255) default ''::varchar, + oper_param varchar(2000) default ''::varchar, + json_result varchar(2000) default ''::varchar, + status int4 default 0, + error_msg varchar(2000) default ''::varchar, + oper_time timestamp, + constraint sys_oper_log_pk primary key (oper_id) +); + +create index idx_sys_oper_log_bt ON sys_oper_log (business_type); +create index idx_sys_oper_log_s ON sys_oper_log (status); +create index idx_sys_oper_log_ot ON sys_oper_log (oper_time); + +comment on table sys_oper_log is '操作日志记录'; +comment on column sys_oper_log.oper_id is '日志主键'; +comment on column sys_oper_log.title is '模块标题'; +comment on column sys_oper_log.business_type is '业务类型(0其它 1新增 2修改 3删除)'; +comment on column sys_oper_log.method is '方法名称'; +comment on column sys_oper_log.request_method is '请求方式'; +comment on column sys_oper_log.operator_type is '操作类别(0其它 1后台用户 2手机端用户)'; +comment on column sys_oper_log.oper_name is '操作人员'; +comment on column sys_oper_log.dept_name is '部门名称'; +comment on column sys_oper_log.oper_url is '请求URL'; +comment on column sys_oper_log.oper_ip is '主机地址'; +comment on column sys_oper_log.oper_location is '操作地点'; +comment on column sys_oper_log.oper_param is '请求参数'; +comment on column sys_oper_log.json_result is '返回参数'; +comment on column sys_oper_log.status is '操作状态(0正常 1异常)'; +comment on column sys_oper_log.error_msg is '错误消息'; +comment on column sys_oper_log.oper_time is '操作时间'; + +-- ---------------------------- +-- 11、字典类型表 +-- ---------------------------- +drop table if exists sys_dict_type; +create table if not exists sys_dict_type +( + dict_id int8, + dict_name varchar(100) default ''::varchar, + dict_type varchar(100) default ''::varchar, + status char default '0'::bpchar, + create_by varchar(64) default ''::varchar, + create_time timestamp, + update_by varchar(64) default ''::varchar, + update_time timestamp, + remark varchar(500) default null::varchar, + constraint sys_dict_type_pk primary key (dict_id) +); + +create unique index sys_dict_type_index1 ON sys_dict_type (dict_type); + +comment on table sys_dict_type is '字典类型表'; +comment on column sys_dict_type.dict_id is '字典主键'; +comment on column sys_dict_type.dict_name is '字典名称'; +comment on column sys_dict_type.dict_type is '字典类型'; +comment on column sys_dict_type.status is '状态(0正常 1停用)'; +comment on column sys_dict_type.create_by is '创建者'; +comment on column sys_dict_type.create_time is '创建时间'; +comment on column sys_dict_type.update_by is '更新者'; +comment on column sys_dict_type.update_time is '更新时间'; +comment on column sys_dict_type.remark is '备注'; + +insert into sys_dict_type values(1, '用户性别', 'sys_user_sex', '0', 'admin', now(), '', null, '用户性别列表'); +insert into sys_dict_type values(2, '菜单状态', 'sys_show_hide', '0', 'admin', now(), '', null, '菜单状态列表'); +insert into sys_dict_type values(3, '系统开关', 'sys_normal_disable', '0', 'admin', now(), '', null, '系统开关列表'); +insert into sys_dict_type values(6, '系统是否', 'sys_yes_no', '0', 'admin', now(), '', null, '系统是否列表'); +insert into sys_dict_type values(7, '通知类型', 'sys_notice_type', '0', 'admin', now(), '', null, '通知类型列表'); +insert into sys_dict_type values(8, '通知状态', 'sys_notice_status', '0', 'admin', now(), '', null, '通知状态列表'); +insert into sys_dict_type values(9, '操作类型', 'sys_oper_type', '0', 'admin', now(), '', null, '操作类型列表'); +insert into sys_dict_type values(10, '系统状态', 'sys_common_status', '0', 'admin', now(), '', null, '登录状态列表'); + + +-- ---------------------------- +-- 12、字典数据表 +-- ---------------------------- +drop table if exists sys_dict_data; +create table if not exists sys_dict_data +( + dict_code int8, + dict_sort int4 default 0, + dict_label varchar(100) default ''::varchar, + dict_value varchar(100) default ''::varchar, + dict_type varchar(100) default ''::varchar, + css_class varchar(100) default null::varchar, + list_class varchar(100) default null::varchar, + is_default char default 'N'::bpchar, + status char default '0'::bpchar, + create_by varchar(64) default ''::varchar, + create_time timestamp, + update_by varchar(64) default ''::varchar, + update_time timestamp, + remark varchar(500) default null::varchar, + constraint sys_dict_data_pk primary key (dict_code) +); + +comment on table sys_dict_data is '字典数据表'; +comment on column sys_dict_data.dict_code is '字典编码'; +comment on column sys_dict_data.dict_sort is '字典排序'; +comment on column sys_dict_data.dict_label is '字典标签'; +comment on column sys_dict_data.dict_value is '字典键值'; +comment on column sys_dict_data.dict_type is '字典类型'; +comment on column sys_dict_data.css_class is '样式属性(其他样式扩展)'; +comment on column sys_dict_data.list_class is '表格回显样式'; +comment on column sys_dict_data.is_default is '是否默认(Y是 N否)'; +comment on column sys_dict_data.status is '状态(0正常 1停用)'; +comment on column sys_dict_data.create_by is '创建者'; +comment on column sys_dict_data.create_time is '创建时间'; +comment on column sys_dict_data.update_by is '更新者'; +comment on column sys_dict_data.update_time is '更新时间'; +comment on column sys_dict_data.remark is '备注'; + +insert into sys_dict_data values(1, 1, '男', '0', 'sys_user_sex', '', '', 'Y', '0', 'admin', now(), '', null, '性别男'); +insert into sys_dict_data values(2, 2, '女', '1', 'sys_user_sex', '', '', 'N', '0', 'admin', now(), '', null, '性别女'); +insert into sys_dict_data values(3, 3, '未知', '2', 'sys_user_sex', '', '', 'N', '0', 'admin', now(), '', null, '性别未知'); +insert into sys_dict_data values(4, 1, '显示', '0', 'sys_show_hide', '', 'primary', 'Y', '0', 'admin', now(), '', null, '显示菜单'); +insert into sys_dict_data values(5, 2, '隐藏', '1', 'sys_show_hide', '', 'danger', 'N', '0', 'admin', now(), '', null, '隐藏菜单'); +insert into sys_dict_data values(6, 1, '正常', '0', 'sys_normal_disable', '', 'primary', 'Y', '0', 'admin', now(), '', null, '正常状态'); +insert into sys_dict_data values(7, 2, '停用', '1', 'sys_normal_disable', '', 'danger', 'N', '0', 'admin', now(), '', null, '停用状态'); +insert into sys_dict_data values(12, 1, '是', 'Y', 'sys_yes_no', '', 'primary', 'Y', '0', 'admin', now(), '', null, '系统默认是'); +insert into sys_dict_data values(13, 2, '否', 'N', 'sys_yes_no', '', 'danger', 'N', '0', 'admin', now(), '', null, '系统默认否'); +insert into sys_dict_data values(14, 1, '通知', '1', 'sys_notice_type', '', 'warning', 'Y', '0', 'admin', now(), '', null, '通知'); +insert into sys_dict_data values(15, 2, '公告', '2', 'sys_notice_type', '', 'success', 'N', '0', 'admin', now(), '', null, '公告'); +insert into sys_dict_data values(16, 1, '正常', '0', 'sys_notice_status', '', 'primary', 'Y', '0', 'admin', now(), '', null, '正常状态'); +insert into sys_dict_data values(17, 2, '关闭', '1', 'sys_notice_status', '', 'danger', 'N', '0', 'admin', now(), '', null, '关闭状态'); +insert into sys_dict_data values(29, 99, '其他', '0', 'sys_oper_type', '', 'info', 'N', '0', 'admin', now(), '', null, '其他操作'); +insert into sys_dict_data values(18, 1, '新增', '1', 'sys_oper_type', '', 'info', 'N', '0', 'admin', now(), '', null, '新增操作'); +insert into sys_dict_data values(19, 2, '修改', '2', 'sys_oper_type', '', 'info', 'N', '0', 'admin', now(), '', null, '修改操作'); +insert into sys_dict_data values(20, 3, '删除', '3', 'sys_oper_type', '', 'danger', 'N', '0', 'admin', now(), '', null, '删除操作'); +insert into sys_dict_data values(21, 4, '授权', '4', 'sys_oper_type', '', 'primary', 'N', '0', 'admin', now(), '', null, '授权操作'); +insert into sys_dict_data values(22, 5, '导出', '5', 'sys_oper_type', '', 'warning', 'N', '0', 'admin', now(), '', null, '导出操作'); +insert into sys_dict_data values(23, 6, '导入', '6', 'sys_oper_type', '', 'warning', 'N', '0', 'admin', now(), '', null, '导入操作'); +insert into sys_dict_data values(24, 7, '强退', '7', 'sys_oper_type', '', 'danger', 'N', '0', 'admin', now(), '', null, '强退操作'); +insert into sys_dict_data values(25, 8, '生成代码', '8', 'sys_oper_type', '', 'warning', 'N', '0', 'admin', now(), '', null, '生成操作'); +insert into sys_dict_data values(26, 9, '清空数据', '9', 'sys_oper_type', '', 'danger', 'N', '0', 'admin', now(), '', null, '清空操作'); +insert into sys_dict_data values(27, 1, '成功', '0', 'sys_common_status', '', 'primary', 'N', '0', 'admin', now(), '', null, '正常状态'); +insert into sys_dict_data values(28, 2, '失败', '1', 'sys_common_status', '', 'danger', 'N', '0', 'admin', now(), '', null, '停用状态'); + + +-- ---------------------------- +-- 13、参数配置表 +-- ---------------------------- +drop table if exists sys_config; +create table if not exists sys_config +( + config_id int8, + config_name varchar(100) default ''::varchar, + config_key varchar(100) default ''::varchar, + config_value varchar(500) default ''::varchar, + config_type char default 'N'::bpchar, + create_by varchar(64) default ''::varchar, + create_time timestamp, + update_by varchar(64) default ''::varchar, + update_time timestamp, + remark varchar(500) default null::varchar, + constraint sys_config_pk primary key (config_id) +); + +comment on table sys_config is '参数配置表'; +comment on column sys_config.config_id is '参数主键'; +comment on column sys_config.config_name is '参数名称'; +comment on column sys_config.config_key is '参数键名'; +comment on column sys_config.config_value is '参数键值'; +comment on column sys_config.config_type is '系统内置(Y是 N否)'; +comment on column sys_config.create_by is '创建者'; +comment on column sys_config.create_time is '创建时间'; +comment on column sys_config.update_by is '更新者'; +comment on column sys_config.update_time is '更新时间'; +comment on column sys_config.remark is '备注'; + +insert into sys_config values(1, '主框架页-默认皮肤样式名称', 'sys.index.skinName', 'skin-blue', 'Y', 'admin', now(), '', null, '蓝色 skin-blue、绿色 skin-green、紫色 skin-purple、红色 skin-red、黄色 skin-yellow' ); +insert into sys_config values(2, '用户管理-账号初始密码', 'sys.user.initPassword', '123456', 'Y', 'admin', now(), '', null, '初始化密码 123456' ); +insert into sys_config values(3, '主框架页-侧边栏主题', 'sys.index.sideTheme', 'theme-dark', 'Y', 'admin', now(), '', null, '深色主题theme-dark,浅色主题theme-light' ); +insert into sys_config values(4, '账号自助-验证码开关', 'sys.account.captchaEnabled', 'true', 'Y', 'admin', now(), '', null, '是否开启验证码功能(true开启,false关闭)'); +insert into sys_config values(5, '账号自助-是否开启用户注册功能', 'sys.account.registerUser', 'false', 'Y', 'admin', now(), '', null, '是否开启注册用户功能(true开启,false关闭)'); +insert into sys_config values(11, 'OSS预览列表资源开关', 'sys.oss.previewListResource', 'true', 'Y', 'admin', now(), '', null, 'true:开启, false:关闭'); + + +-- ---------------------------- +-- 14、系统访问记录 +-- ---------------------------- +drop table if exists sys_logininfor; +create table if not exists sys_logininfor +( + info_id int8, + user_name varchar(50) default ''::varchar, + ipaddr varchar(128) default ''::varchar, + login_location varchar(255) default ''::varchar, + browser varchar(50) default ''::varchar, + os varchar(50) default ''::varchar, + status char default '0'::bpchar, + msg varchar(255) default ''::varchar, + login_time timestamp, + constraint sys_logininfor_pk primary key (info_id) +); + +create index idx_sys_logininfor_s ON sys_logininfor (status); +create index idx_sys_logininfor_lt ON sys_logininfor (login_time); + +comment on table sys_logininfor is '系统访问记录'; +comment on column sys_logininfor.info_id is '访问ID'; +comment on column sys_logininfor.user_name is '用户账号'; +comment on column sys_logininfor.ipaddr is '登录IP地址'; +comment on column sys_logininfor.login_location is '登录地点'; +comment on column sys_logininfor.browser is '浏览器类型'; +comment on column sys_logininfor.os is '操作系统'; +comment on column sys_logininfor.status is '登录状态(0成功 1失败)'; +comment on column sys_logininfor.msg is '提示消息'; +comment on column sys_logininfor.login_time is '访问时间'; + +-- ---------------------------- +-- 17、通知公告表 +-- ---------------------------- +drop table if exists sys_notice; +create table if not exists sys_notice +( + notice_id int8, + notice_title varchar(50) not null, + notice_type char not null, + notice_content text, + status char default '0'::bpchar, + create_by varchar(64) default ''::varchar, + create_time timestamp, + update_by varchar(64) default ''::varchar, + update_time timestamp, + remark varchar(255) default null::varchar, + constraint sys_notice_pk primary key (notice_id) +); + +comment on table sys_notice is '通知公告表'; +comment on column sys_notice.notice_id is '公告ID'; +comment on column sys_notice.notice_title is '公告标题'; +comment on column sys_notice.notice_type is '公告类型(1通知 2公告)'; +comment on column sys_notice.notice_content is '公告内容'; +comment on column sys_notice.status is '公告状态(0正常 1关闭)'; +comment on column sys_notice.create_by is '创建者'; +comment on column sys_notice.create_time is '创建时间'; +comment on column sys_notice.update_by is '更新者'; +comment on column sys_notice.update_time is '更新时间'; +comment on column sys_notice.remark is '备注'; + +-- ---------------------------- +-- 初始化-公告信息表数据 +-- ---------------------------- +insert into sys_notice values('1', '温馨提醒:2018-07-01 新版本发布啦', '2', '新版本内容', '0', 'admin', now(), '', null, '管理员'); +insert into sys_notice values('2', '维护通知:2018-07-01 系统凌晨维护', '1', '维护内容', '0', 'admin', now(), '', null, '管理员'); + + +-- ---------------------------- +-- 18、代码生成业务表 +-- ---------------------------- +drop table if exists gen_table; +create table if not exists gen_table +( + table_id int8, + table_name varchar(200) default ''::varchar, + table_comment varchar(500) default ''::varchar, + sub_table_name varchar(64) default ''::varchar, + sub_table_fk_name varchar(64) default ''::varchar, + class_name varchar(100) default ''::varchar, + tpl_category varchar(200) default 'crud'::varchar, + package_name varchar(100) default null::varchar, + module_name varchar(30) default null::varchar, + business_name varchar(30) default null::varchar, + function_name varchar(50) default null::varchar, + function_author varchar(50) default null::varchar, + gen_type char default '0'::bpchar not null, + gen_path varchar(200) default '/'::varchar, + options varchar(1000) default null::varchar, + create_by varchar(64) default ''::varchar, + create_time timestamp, + update_by varchar(64) default ''::varchar, + update_time timestamp, + remark varchar(500) default null::varchar, + constraint gen_table_pk primary key (table_id) +); + +comment on table gen_table is '代码生成业务表'; +comment on column gen_table.table_id is '编号'; +comment on column gen_table.table_name is '表名称'; +comment on column gen_table.table_comment is '表描述'; +comment on column gen_table.sub_table_name is '关联子表的表名'; +comment on column gen_table.sub_table_fk_name is '子表关联的外键名'; +comment on column gen_table.class_name is '实体类名称'; +comment on column gen_table.tpl_category is '使用的模板(CRUD单表操作 TREE树表操作)'; +comment on column gen_table.package_name is '生成包路径'; +comment on column gen_table.module_name is '生成模块名'; +comment on column gen_table.business_name is '生成业务名'; +comment on column gen_table.function_name is '生成功能名'; +comment on column gen_table.function_author is '生成功能作者'; +comment on column gen_table.gen_type is '生成代码方式(0zip压缩包 1自定义路径)'; +comment on column gen_table.gen_path is '生成路径(不填默认项目路径)'; +comment on column gen_table.options is '其它生成选项'; +comment on column gen_table.create_by is '创建者'; +comment on column gen_table.create_time is '创建时间'; +comment on column gen_table.update_by is '更新者'; +comment on column gen_table.update_time is '更新时间'; +comment on column gen_table.remark is '备注'; + +-- ---------------------------- +-- 19、代码生成业务表字段 +-- ---------------------------- +drop table if exists gen_table_column; +create table if not exists gen_table_column +( + column_id int8, + table_id int8, + column_name varchar(200) default null::varchar, + column_comment varchar(500) default null::varchar, + column_type varchar(100) default null::varchar, + java_type varchar(500) default null::varchar, + java_field varchar(200) default null::varchar, + is_pk char default null::bpchar, + is_increment char default null::bpchar, + is_required char default null::bpchar, + is_insert char default null::bpchar, + is_edit char default null::bpchar, + is_list char default null::bpchar, + is_query char default null::bpchar, + query_type varchar(200) default 'EQ'::varchar, + html_type varchar(200) default null::varchar, + dict_type varchar(200) default ''::varchar, + sort int4, + create_by varchar(64) default ''::varchar, + create_time timestamp, + update_by varchar(64) default ''::varchar, + update_time timestamp, + constraint gen_table_column_pk primary key (column_id) +); + +comment on table gen_table_column is '代码生成业务表字段'; +comment on column gen_table_column.column_id is '编号'; +comment on column gen_table_column.table_id is '归属表编号'; +comment on column gen_table_column.column_name is '列名称'; +comment on column gen_table_column.column_comment is '列描述'; +comment on column gen_table_column.column_type is '列类型'; +comment on column gen_table_column.java_type is 'JAVA类型'; +comment on column gen_table_column.java_field is 'JAVA字段名'; +comment on column gen_table_column.is_pk is '是否主键(1是)'; +comment on column gen_table_column.is_increment is '是否自增(1是)'; +comment on column gen_table_column.is_required is '是否必填(1是)'; +comment on column gen_table_column.is_insert is '是否为插入字段(1是)'; +comment on column gen_table_column.is_edit is '是否编辑字段(1是)'; +comment on column gen_table_column.is_list is '是否列表字段(1是)'; +comment on column gen_table_column.is_query is '是否查询字段(1是)'; +comment on column gen_table_column.query_type is '查询方式(等于、不等于、大于、小于、范围)'; +comment on column gen_table_column.html_type is '显示类型(文本框、文本域、下拉框、复选框、单选框、日期控件)'; +comment on column gen_table_column.dict_type is '字典类型'; +comment on column gen_table_column.sort is '排序'; +comment on column gen_table_column.create_by is '创建者'; +comment on column gen_table_column.create_time is '创建时间'; +comment on column gen_table_column.update_by is '更新者'; +comment on column gen_table_column.update_time is '更新时间'; + +-- ---------------------------- +-- OSS对象存储表 +-- ---------------------------- +drop table if exists sys_oss; +create table if not exists sys_oss +( + oss_id int8, + file_name varchar(255) default ''::varchar not null, + original_name varchar(255) default ''::varchar not null, + file_suffix varchar(10) default ''::varchar not null, + url varchar(500) default ''::varchar not null, + create_by varchar(64) default ''::varchar, + create_time timestamp, + update_by varchar(64) default ''::varchar, + update_time timestamp, + service varchar(20) default 'minio'::varchar, + constraint sys_oss_pk primary key (oss_id) +); + +comment on table sys_oss is 'OSS对象存储表'; +comment on column sys_oss.oss_id is '对象存储主键'; +comment on column sys_oss.file_name is '文件名'; +comment on column sys_oss.original_name is '原名'; +comment on column sys_oss.file_suffix is '文件后缀名'; +comment on column sys_oss.url is 'URL地址'; +comment on column sys_oss.create_by is '上传人'; +comment on column sys_oss.create_time is '创建时间'; +comment on column sys_oss.update_by is '更新者'; +comment on column sys_oss.update_time is '更新时间'; +comment on column sys_oss.service is '服务商'; + +-- ---------------------------- +-- OSS对象存储动态配置表 +-- ---------------------------- +drop table if exists sys_oss_config; +create table if not exists sys_oss_config +( + oss_config_id int8, + config_key varchar(20) default ''::varchar not null, + access_key varchar(255) default ''::varchar, + secret_key varchar(255) default ''::varchar, + bucket_name varchar(255) default ''::varchar, + prefix varchar(255) default ''::varchar, + endpoint varchar(255) default ''::varchar, + domain varchar(255) default ''::varchar, + is_https char default 'N'::bpchar, + region varchar(255) default ''::varchar, + access_policy char(1) default '1'::bpchar not null, + status char default '1'::bpchar, + ext1 varchar(255) default ''::varchar, + create_by varchar(64) default ''::varchar, + create_time timestamp, + update_by varchar(64) default ''::varchar, + update_time timestamp, + remark varchar(500) default ''::varchar, + constraint sys_oss_config_pk primary key (oss_config_id) +); + +comment on table sys_oss_config is '对象存储配置表'; +comment on column sys_oss_config.oss_config_id is '主建'; +comment on column sys_oss_config.config_key is '配置key'; +comment on column sys_oss_config.access_key is 'accessKey'; +comment on column sys_oss_config.secret_key is '秘钥'; +comment on column sys_oss_config.bucket_name is '桶名称'; +comment on column sys_oss_config.prefix is '前缀'; +comment on column sys_oss_config.endpoint is '访问站点'; +comment on column sys_oss_config.domain is '自定义域名'; +comment on column sys_oss_config.is_https is '是否https(Y=是,N=否)'; +comment on column sys_oss_config.region is '域'; +comment on column sys_oss_config.access_policy is '桶权限类型(0=private 1=public 2=custom)'; +comment on column sys_oss_config.status is '是否默认(0=是,1=否)'; +comment on column sys_oss_config.ext1 is '扩展字段'; +comment on column sys_oss_config.create_by is '创建者'; +comment on column sys_oss_config.create_time is '创建时间'; +comment on column sys_oss_config.update_by is '更新者'; +comment on column sys_oss_config.update_time is '更新时间'; +comment on column sys_oss_config.remark is '备注'; + +insert into sys_oss_config values (1, 'minio', 'ruoyi', 'ruoyi123', 'ruoyi', '', '127.0.0.1:9000', '','N', '', '1', '0', '', 'admin', now(), 'admin', now(), null); +insert into sys_oss_config values (2, 'qiniu', 'XXXXXXXXXXXXXXX', 'XXXXXXXXXXXXXXX', 'ruoyi', '', 's3-cn-north-1.qiniucs.com', '','N', '', '1', '1', '', 'admin', now(), 'admin', now(), null); +insert into sys_oss_config values (3, 'aliyun', 'XXXXXXXXXXXXXXX', 'XXXXXXXXXXXXXXX', 'ruoyi', '', 'oss-cn-beijing.aliyuncs.com', '','N', '', '1', '1', '', 'admin', now(), 'admin', now(), null); +insert into sys_oss_config values (4, 'qcloud', 'XXXXXXXXXXXXXXX', 'XXXXXXXXXXXXXXX', 'ruoyi-1250000000', '', 'cos.ap-beijing.myqcloud.com', '','N', 'ap-beijing', '1', '1', '', 'admin', now(), 'admin', now(), null); +insert into sys_oss_config values (5, 'image', 'ruoyi', 'ruoyi123', 'ruoyi', 'image', '127.0.0.1:9000', '','N', '', '1', '1', '', 'admin', now(), 'admin', now(), NULL); + +-- 字符串自动转时间 避免框架时间查询报错问题 +create or replace function cast_varchar_to_timestamp(varchar) returns timestamptz as $$ +select to_timestamp($1, 'yyyy-mm-dd hh24:mi:ss'); +$$ language sql strict ; + +create cast (varchar as timestamptz) with function cast_varchar_to_timestamp as IMPLICIT; diff --git a/script/sql/postgres/postgres_test.sql b/script/sql/postgres/postgres_test.sql new file mode 100644 index 0000000..29b4ea7 --- /dev/null +++ b/script/sql/postgres/postgres_test.sql @@ -0,0 +1,196 @@ +DROP TABLE if EXISTS test_demo; +create table if not exists test_demo +( + id int8, + dept_id int8, + user_id int8, + order_num int4 default 0, + test_key varchar(255), + value varchar(255), + version int4 default 0, + create_time timestamp, + create_by varchar(64), + update_time timestamp, + update_by varchar(64), + del_flag int4 default 0 +); + +comment on table test_demo is '测试单表'; +comment on column test_demo.id is '主键'; +comment on column test_demo.dept_id is '部门id'; +comment on column test_demo.user_id is '用户id'; +comment on column test_demo.order_num is '排序号'; +comment on column test_demo.test_key is 'key键'; +comment on column test_demo.value is '值'; +comment on column test_demo.version is '版本'; +comment on column test_demo.create_time is '创建时间'; +comment on column test_demo.create_by is '创建人'; +comment on column test_demo.update_time is '更新时间'; +comment on column test_demo.update_by is '更新人'; +comment on column test_demo.del_flag is '删除标志'; + +DROP TABLE if EXISTS test_tree; +create table if not exists test_tree +( + id int8, + parent_id int8 default 0, + dept_id int8, + user_id int8, + tree_name varchar(255), + version int4 default 0, + create_time timestamp, + create_by varchar(64), + update_time timestamp, + update_by varchar(64), + del_flag integer default 0 +); + +comment on table test_tree is '测试树表'; +comment on column test_tree.id is '主键'; +comment on column test_tree.parent_id is '父id'; +comment on column test_tree.dept_id is '部门id'; +comment on column test_tree.user_id is '用户id'; +comment on column test_tree.tree_name is '值'; +comment on column test_tree.version is '版本'; +comment on column test_tree.create_time is '创建时间'; +comment on column test_tree.create_by is '创建人'; +comment on column test_tree.update_time is '更新时间'; +comment on column test_tree.update_by is '更新人'; +comment on column test_tree.del_flag is '删除标志'; + +INSERT INTO sys_user(user_id, dept_id, user_name, nick_name, user_type, email, phonenumber, sex, avatar, password, status, del_flag, login_ip, login_date, create_by, create_time, update_by, update_time, remark) VALUES (3, 108, 'test', '本部门及以下 密码666666', 'sys_user', '', '', '0', '', '$2a$10$b8yUzN0C71sbz.PhNOCgJe.Tu1yWC3RNrTyjSQ8p1W0.aaUXUJ.Ne', '0', '0', '127.0.0.1', now(), 'admin', now(), 'test', now(), NULL); +INSERT INTO sys_user(user_id, dept_id, user_name, nick_name, user_type, email, phonenumber, sex, avatar, password, status, del_flag, login_ip, login_date, create_by, create_time, update_by, update_time, remark) VALUES (4, 102, 'test1', '仅本人 密码666666', 'sys_user', '', '', '0', '', '$2a$10$b8yUzN0C71sbz.PhNOCgJe.Tu1yWC3RNrTyjSQ8p1W0.aaUXUJ.Ne', '0', '0', '127.0.0.1', now(), 'admin', now(), 'test1', now(), NULL); + +INSERT INTO sys_menu(menu_id, menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark) VALUES (5, '测试菜单', 0, 5, 'demo', NULL, 1, 0, 'M', '0', '0', NULL, 'star', 'admin', now(), NULL, NULL, ''); + +INSERT INTO sys_menu(menu_id, menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark) VALUES (1500, '测试单表', 5, 1, 'demo', 'demo/demo/index', 1, 0, 'C', '0', '0', 'demo:demo:list', '#', 'admin', now(), '', NULL, '测试单表菜单'); +INSERT INTO sys_menu(menu_id, menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark) VALUES (1501, '测试单表查询', 1500, 1, '#', '', 1, 0, 'F', '0', '0', 'demo:demo:query', '#', 'admin', now(), '', NULL, ''); +INSERT INTO sys_menu(menu_id, menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark) VALUES (1502, '测试单表新增', 1500, 2, '#', '', 1, 0, 'F', '0', '0', 'demo:demo:add', '#', 'admin', now(), '', NULL, ''); +INSERT INTO sys_menu(menu_id, menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark) VALUES (1503, '测试单表修改', 1500, 3, '#', '', 1, 0, 'F', '0', '0', 'demo:demo:edit', '#', 'admin', now(), '', NULL, ''); +INSERT INTO sys_menu(menu_id, menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark) VALUES (1504, '测试单表删除', 1500, 4, '#', '', 1, 0, 'F', '0', '0', 'demo:demo:remove', '#', 'admin', now(), '', NULL, ''); +INSERT INTO sys_menu(menu_id, menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark) VALUES (1505, '测试单表导出', 1500, 5, '#', '', 1, 0, 'F', '0', '0', 'demo:demo:export', '#', 'admin', now(), '', NULL, ''); + +INSERT INTO sys_menu(menu_id, menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark) VALUES (1506, '测试树表', 5, 1, 'tree', 'demo/tree/index', 1, 0, 'C', '0', '0', 'demo:tree:list', '#', 'admin', now(), '', NULL, '测试树表菜单'); +INSERT INTO sys_menu(menu_id, menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark) VALUES (1507, '测试树表查询', 1506, 1, '#', '', 1, 0, 'F', '0', '0', 'demo:tree:query', '#', 'admin', now(), '', NULL, ''); +INSERT INTO sys_menu(menu_id, menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark) VALUES (1508, '测试树表新增', 1506, 2, '#', '', 1, 0, 'F', '0', '0', 'demo:tree:add', '#', 'admin', now(), '', NULL, ''); +INSERT INTO sys_menu(menu_id, menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark) VALUES (1509, '测试树表修改', 1506, 3, '#', '', 1, 0, 'F', '0', '0', 'demo:tree:edit', '#', 'admin', now(), '', NULL, ''); +INSERT INTO sys_menu(menu_id, menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark) VALUES (1510, '测试树表删除', 1506, 4, '#', '', 1, 0, 'F', '0', '0', 'demo:tree:remove', '#', 'admin', now(), '', NULL, ''); +INSERT INTO sys_menu(menu_id, menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark) VALUES (1511, '测试树表导出', 1506, 5, '#', '', 1, 0, 'F', '0', '0', 'demo:tree:export', '#', 'admin', now(), '', NULL, ''); + +INSERT INTO sys_role(role_id, role_name, role_key, role_sort, data_scope, menu_check_strictly, dept_check_strictly, status, del_flag, create_by, create_time, update_by, update_time, remark) VALUES (3, '本部门及以下', 'test1', 3, '4', 't', 't', '0', '0', 'admin', now(), 'admin', NULL, NULL); +INSERT INTO sys_role(role_id, role_name, role_key, role_sort, data_scope, menu_check_strictly, dept_check_strictly, status, del_flag, create_by, create_time, update_by, update_time, remark) VALUES (4, '仅本人', 'test2', 4, '5', 't', 't', '0', '0', 'admin', now(), 'admin', NULL, NULL); + +INSERT INTO sys_role_menu(role_id, menu_id) VALUES (3, 1); +INSERT INTO sys_role_menu(role_id, menu_id) VALUES (3, 5); +INSERT INTO sys_role_menu(role_id, menu_id) VALUES (3, 100); +INSERT INTO sys_role_menu(role_id, menu_id) VALUES (3, 101); +INSERT INTO sys_role_menu(role_id, menu_id) VALUES (3, 102); +INSERT INTO sys_role_menu(role_id, menu_id) VALUES (3, 103); +INSERT INTO sys_role_menu(role_id, menu_id) VALUES (3, 104); +INSERT INTO sys_role_menu(role_id, menu_id) VALUES (3, 105); +INSERT INTO sys_role_menu(role_id, menu_id) VALUES (3, 106); +INSERT INTO sys_role_menu(role_id, menu_id) VALUES (3, 107); +INSERT INTO sys_role_menu(role_id, menu_id) VALUES (3, 108); +INSERT INTO sys_role_menu(role_id, menu_id) VALUES (3, 500); +INSERT INTO sys_role_menu(role_id, menu_id) VALUES (3, 501); +INSERT INTO sys_role_menu(role_id, menu_id) VALUES (3, 1001); +INSERT INTO sys_role_menu(role_id, menu_id) VALUES (3, 1002); +INSERT INTO sys_role_menu(role_id, menu_id) VALUES (3, 1003); +INSERT INTO sys_role_menu(role_id, menu_id) VALUES (3, 1004); +INSERT INTO sys_role_menu(role_id, menu_id) VALUES (3, 1005); +INSERT INTO sys_role_menu(role_id, menu_id) VALUES (3, 1006); +INSERT INTO sys_role_menu(role_id, menu_id) VALUES (3, 1007); +INSERT INTO sys_role_menu(role_id, menu_id) VALUES (3, 1008); +INSERT INTO sys_role_menu(role_id, menu_id) VALUES (3, 1009); +INSERT INTO sys_role_menu(role_id, menu_id) VALUES (3, 1010); +INSERT INTO sys_role_menu(role_id, menu_id) VALUES (3, 1011); +INSERT INTO sys_role_menu(role_id, menu_id) VALUES (3, 1012); +INSERT INTO sys_role_menu(role_id, menu_id) VALUES (3, 1013); +INSERT INTO sys_role_menu(role_id, menu_id) VALUES (3, 1014); +INSERT INTO sys_role_menu(role_id, menu_id) VALUES (3, 1015); +INSERT INTO sys_role_menu(role_id, menu_id) VALUES (3, 1016); +INSERT INTO sys_role_menu(role_id, menu_id) VALUES (3, 1017); +INSERT INTO sys_role_menu(role_id, menu_id) VALUES (3, 1018); +INSERT INTO sys_role_menu(role_id, menu_id) VALUES (3, 1019); +INSERT INTO sys_role_menu(role_id, menu_id) VALUES (3, 1020); +INSERT INTO sys_role_menu(role_id, menu_id) VALUES (3, 1021); +INSERT INTO sys_role_menu(role_id, menu_id) VALUES (3, 1022); +INSERT INTO sys_role_menu(role_id, menu_id) VALUES (3, 1023); +INSERT INTO sys_role_menu(role_id, menu_id) VALUES (3, 1024); +INSERT INTO sys_role_menu(role_id, menu_id) VALUES (3, 1025); +INSERT INTO sys_role_menu(role_id, menu_id) VALUES (3, 1026); +INSERT INTO sys_role_menu(role_id, menu_id) VALUES (3, 1027); +INSERT INTO sys_role_menu(role_id, menu_id) VALUES (3, 1028); +INSERT INTO sys_role_menu(role_id, menu_id) VALUES (3, 1029); +INSERT INTO sys_role_menu(role_id, menu_id) VALUES (3, 1030); +INSERT INTO sys_role_menu(role_id, menu_id) VALUES (3, 1031); +INSERT INTO sys_role_menu(role_id, menu_id) VALUES (3, 1032); +INSERT INTO sys_role_menu(role_id, menu_id) VALUES (3, 1033); +INSERT INTO sys_role_menu(role_id, menu_id) VALUES (3, 1034); +INSERT INTO sys_role_menu(role_id, menu_id) VALUES (3, 1035); +INSERT INTO sys_role_menu(role_id, menu_id) VALUES (3, 1036); +INSERT INTO sys_role_menu(role_id, menu_id) VALUES (3, 1037); +INSERT INTO sys_role_menu(role_id, menu_id) VALUES (3, 1038); +INSERT INTO sys_role_menu(role_id, menu_id) VALUES (3, 1039); +INSERT INTO sys_role_menu(role_id, menu_id) VALUES (3, 1040); +INSERT INTO sys_role_menu(role_id, menu_id) VALUES (3, 1041); +INSERT INTO sys_role_menu(role_id, menu_id) VALUES (3, 1042); +INSERT INTO sys_role_menu(role_id, menu_id) VALUES (3, 1043); +INSERT INTO sys_role_menu(role_id, menu_id) VALUES (3, 1044); +INSERT INTO sys_role_menu(role_id, menu_id) VALUES (3, 1045); +INSERT INTO sys_role_menu(role_id, menu_id) VALUES (3, 1500); +INSERT INTO sys_role_menu(role_id, menu_id) VALUES (3, 1501); +INSERT INTO sys_role_menu(role_id, menu_id) VALUES (3, 1502); +INSERT INTO sys_role_menu(role_id, menu_id) VALUES (3, 1503); +INSERT INTO sys_role_menu(role_id, menu_id) VALUES (3, 1504); +INSERT INTO sys_role_menu(role_id, menu_id) VALUES (3, 1505); +INSERT INTO sys_role_menu(role_id, menu_id) VALUES (3, 1506); +INSERT INTO sys_role_menu(role_id, menu_id) VALUES (3, 1507); +INSERT INTO sys_role_menu(role_id, menu_id) VALUES (3, 1508); +INSERT INTO sys_role_menu(role_id, menu_id) VALUES (3, 1509); +INSERT INTO sys_role_menu(role_id, menu_id) VALUES (3, 1510); +INSERT INTO sys_role_menu(role_id, menu_id) VALUES (3, 1511); +INSERT INTO sys_role_menu(role_id, menu_id) VALUES (4, 5); +INSERT INTO sys_role_menu(role_id, menu_id) VALUES (4, 1500); +INSERT INTO sys_role_menu(role_id, menu_id) VALUES (4, 1501); +INSERT INTO sys_role_menu(role_id, menu_id) VALUES (4, 1502); +INSERT INTO sys_role_menu(role_id, menu_id) VALUES (4, 1503); +INSERT INTO sys_role_menu(role_id, menu_id) VALUES (4, 1504); +INSERT INTO sys_role_menu(role_id, menu_id) VALUES (4, 1505); +INSERT INTO sys_role_menu(role_id, menu_id) VALUES (4, 1506); +INSERT INTO sys_role_menu(role_id, menu_id) VALUES (4, 1507); +INSERT INTO sys_role_menu(role_id, menu_id) VALUES (4, 1508); +INSERT INTO sys_role_menu(role_id, menu_id) VALUES (4, 1509); +INSERT INTO sys_role_menu(role_id, menu_id) VALUES (4, 1510); +INSERT INTO sys_role_menu(role_id, menu_id) VALUES (4, 1511); + +INSERT INTO sys_user_role(user_id, role_id) VALUES (3, 3); +INSERT INTO sys_user_role(user_id, role_id) VALUES (4, 4); + +INSERT INTO test_demo(id, dept_id, user_id, order_num, test_key, value, version, create_time, create_by, update_time, update_by, del_flag) VALUES (1, 102, 4, 1, '测试数据权限', '测试', 0, now(), 'admin', NULL, NULL, 0); +INSERT INTO test_demo(id, dept_id, user_id, order_num, test_key, value, version, create_time, create_by, update_time, update_by, del_flag) VALUES (2, 102, 3, 2, '子节点1', '111', 0, now(), 'admin', NULL, NULL, 0); +INSERT INTO test_demo(id, dept_id, user_id, order_num, test_key, value, version, create_time, create_by, update_time, update_by, del_flag) VALUES (3, 102, 3, 3, '子节点2', '222', 0, now(), 'admin', NULL, NULL, 0); +INSERT INTO test_demo(id, dept_id, user_id, order_num, test_key, value, version, create_time, create_by, update_time, update_by, del_flag) VALUES (4, 108, 4, 4, '测试数据', 'demo', 0, now(), 'admin', NULL, NULL, 0); +INSERT INTO test_demo(id, dept_id, user_id, order_num, test_key, value, version, create_time, create_by, update_time, update_by, del_flag) VALUES (5, 108, 3, 13, '子节点11', '1111', 0, now(), 'admin', NULL, NULL, 0); +INSERT INTO test_demo(id, dept_id, user_id, order_num, test_key, value, version, create_time, create_by, update_time, update_by, del_flag) VALUES (6, 108, 3, 12, '子节点22', '2222', 0, now(), 'admin', NULL, NULL, 0); +INSERT INTO test_demo(id, dept_id, user_id, order_num, test_key, value, version, create_time, create_by, update_time, update_by, del_flag) VALUES (7, 108, 3, 11, '子节点33', '3333', 0, now(), 'admin', NULL, NULL, 0); +INSERT INTO test_demo(id, dept_id, user_id, order_num, test_key, value, version, create_time, create_by, update_time, update_by, del_flag) VALUES (8, 108, 3, 10, '子节点44', '4444', 0, now(), 'admin', NULL, NULL, 0); +INSERT INTO test_demo(id, dept_id, user_id, order_num, test_key, value, version, create_time, create_by, update_time, update_by, del_flag) VALUES (9, 108, 3, 9, '子节点55', '5555', 0, now(), 'admin', NULL, NULL, 0); +INSERT INTO test_demo(id, dept_id, user_id, order_num, test_key, value, version, create_time, create_by, update_time, update_by, del_flag) VALUES (10, 108, 3, 8, '子节点66', '6666', 0, now(), 'admin', NULL, NULL, 0); +INSERT INTO test_demo(id, dept_id, user_id, order_num, test_key, value, version, create_time, create_by, update_time, update_by, del_flag) VALUES (11, 108, 3, 7, '子节点77', '7777', 0, now(), 'admin', NULL, NULL, 0); +INSERT INTO test_demo(id, dept_id, user_id, order_num, test_key, value, version, create_time, create_by, update_time, update_by, del_flag) VALUES (12, 108, 3, 6, '子节点88', '8888', 0, now(), 'admin', NULL, NULL, 0); +INSERT INTO test_demo(id, dept_id, user_id, order_num, test_key, value, version, create_time, create_by, update_time, update_by, del_flag) VALUES (13, 108, 3, 5, '子节点99', '9999', 0, now(), 'admin', NULL, NULL, 0); + +INSERT INTO test_tree(id, parent_id, dept_id, user_id, tree_name, version, create_time, create_by, update_time, update_by, del_flag) VALUES (1, 0, 102, 4, '测试数据权限', 0, now(), 'admin', NULL, NULL, 0); +INSERT INTO test_tree(id, parent_id, dept_id, user_id, tree_name, version, create_time, create_by, update_time, update_by, del_flag) VALUES (2, 1, 102, 3, '子节点1', 0, now(), 'admin', NULL, NULL, 0); +INSERT INTO test_tree(id, parent_id, dept_id, user_id, tree_name, version, create_time, create_by, update_time, update_by, del_flag) VALUES (3, 2, 102, 3, '子节点2', 0, now(), 'admin', NULL, NULL, 0); +INSERT INTO test_tree(id, parent_id, dept_id, user_id, tree_name, version, create_time, create_by, update_time, update_by, del_flag) VALUES (4, 0, 108, 4, '测试树1', 0, now(), 'admin', NULL, NULL, 0); +INSERT INTO test_tree(id, parent_id, dept_id, user_id, tree_name, version, create_time, create_by, update_time, update_by, del_flag) VALUES (5, 4, 108, 3, '子节点11', 0, now(), 'admin', NULL, NULL, 0); +INSERT INTO test_tree(id, parent_id, dept_id, user_id, tree_name, version, create_time, create_by, update_time, update_by, del_flag) VALUES (6, 4, 108, 3, '子节点22', 0, now(), 'admin', NULL, NULL, 0); +INSERT INTO test_tree(id, parent_id, dept_id, user_id, tree_name, version, create_time, create_by, update_time, update_by, del_flag) VALUES (7, 4, 108, 3, '子节点33', 0, now(), 'admin', NULL, NULL, 0); +INSERT INTO test_tree(id, parent_id, dept_id, user_id, tree_name, version, create_time, create_by, update_time, update_by, del_flag) VALUES (8, 5, 108, 3, '子节点44', 0, now(), 'admin', NULL, NULL, 0); +INSERT INTO test_tree(id, parent_id, dept_id, user_id, tree_name, version, create_time, create_by, update_time, update_by, del_flag) VALUES (9, 6, 108, 3, '子节点55', 0, now(), 'admin', NULL, NULL, 0); +INSERT INTO test_tree(id, parent_id, dept_id, user_id, tree_name, version, create_time, create_by, update_time, update_by, del_flag) VALUES (10, 7, 108, 3, '子节点66', 0, now(), 'admin', NULL, NULL, 0); +INSERT INTO test_tree(id, parent_id, dept_id, user_id, tree_name, version, create_time, create_by, update_time, update_by, del_flag) VALUES (11, 7, 108, 3, '子节点77', 0, now(), 'admin', NULL, NULL, 0); +INSERT INTO test_tree(id, parent_id, dept_id, user_id, tree_name, version, create_time, create_by, update_time, update_by, del_flag) VALUES (12, 10, 108, 3, '子节点88', 0, now(), 'admin', NULL, NULL, 0); +INSERT INTO test_tree(id, parent_id, dept_id, user_id, tree_name, version, create_time, create_by, update_time, update_by, del_flag) VALUES (13, 10, 108, 3, '子节点99', 0, now(), 'admin', NULL, NULL, 0); diff --git a/script/sql/ry_vue_4.X.sql b/script/sql/ry_vue_4.X.sql new file mode 100644 index 0000000..7c7bc2e --- /dev/null +++ b/script/sql/ry_vue_4.X.sql @@ -0,0 +1,696 @@ +-- ---------------------------- +-- 1、部门表 +-- ---------------------------- +drop table if exists sys_dept; +create table sys_dept ( + dept_id bigint(20) not null comment '部门id', + parent_id bigint(20) default 0 comment '父部门id', + ancestors varchar(500) 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 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 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(10) default 'sys_user' comment '用户类型(sys_user系统用户)', + 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 comment = '用户信息表'; + +-- ---------------------------- +-- 初始化-用户信息表数据 +-- ---------------------------- +insert into sys_user values(1, 103, 'admin', '疯狂的狮子Li', 'sys_user', 'crazyLionLi@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, 'lionli', '疯狂的狮子Li', 'sys_user', 'crazyLionLi@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 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 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 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 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_param 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 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', 'PLUS官网', '0', '4', 'https://gitee.com/dromara/RuoYi-Vue-Plus', null, '', 0, 0, 'M', '0', '0', '', 'guide', 'admin', sysdate(), '', null, 'RuoYi-Vue-Plus官网地址'); +-- 二级菜单 +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('112', '缓存列表', '2', '6', 'cacheList', 'monitor/cache/list', '', 1, 0, 'C', '0', '0', 'monitor:cache:list', 'redis-list', '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', '表单构建', '3', '1', 'build', 'tool/build/index', '', 1, 0, 'C', '0', '0', 'tool:build:list', 'build', 'admin', sysdate(), '', null, '表单构建菜单'); +insert into sys_menu values('115', '代码生成', '3', '2', 'gen', 'tool/gen/index', '', 1, 0, 'C', '0', '0', 'tool:gen:list', 'code', 'admin', sysdate(), '', null, '代码生成菜单'); +-- springboot-admin监控 +insert into sys_menu values('117', 'Admin监控', '2', '5', 'Admin', 'monitor/admin/index', '', 1, 0, 'C', '0', '0', 'monitor:admin:list', 'dashboard', 'admin', sysdate(), '', null, 'Admin监控菜单'); +-- oss菜单 +insert into sys_menu values('118', '文件管理', '1', '10', 'oss', 'system/oss/index', '', 1, 0, 'C', '0', '0', 'system:oss:list', 'upload', 'admin', sysdate(), '', null, '文件管理菜单'); +-- xxl-job-admin控制台 +insert into sys_menu values('120', '任务调度中心', '2', '5', 'XxlJob', 'monitor/xxljob/index', '', 1, 0, 'C', '0', '0', 'monitor:xxljob:list', 'job', 'admin', sysdate(), '', null, 'Xxl-Job控制台菜单'); + +-- 三级菜单 +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('1001', '用户查询', '100', '1', '', '', '', 1, 0, 'F', '0', '0', 'system:user:query', '#', 'admin', sysdate(), '', null, ''); +insert into sys_menu values('1002', '用户新增', '100', '2', '', '', '', 1, 0, 'F', '0', '0', 'system:user:add', '#', 'admin', sysdate(), '', null, ''); +insert into sys_menu values('1003', '用户修改', '100', '3', '', '', '', 1, 0, 'F', '0', '0', 'system:user:edit', '#', 'admin', sysdate(), '', null, ''); +insert into sys_menu values('1004', '用户删除', '100', '4', '', '', '', 1, 0, 'F', '0', '0', 'system:user:remove', '#', 'admin', sysdate(), '', null, ''); +insert into sys_menu values('1005', '用户导出', '100', '5', '', '', '', 1, 0, 'F', '0', '0', 'system:user:export', '#', 'admin', sysdate(), '', null, ''); +insert into sys_menu values('1006', '用户导入', '100', '6', '', '', '', 1, 0, 'F', '0', '0', 'system:user:import', '#', 'admin', sysdate(), '', null, ''); +insert into sys_menu values('1007', '重置密码', '100', '7', '', '', '', 1, 0, 'F', '0', '0', 'system:user:resetPwd', '#', 'admin', sysdate(), '', null, ''); +-- 角色管理按钮 +insert into sys_menu values('1008', '角色查询', '101', '1', '', '', '', 1, 0, 'F', '0', '0', 'system:role:query', '#', 'admin', sysdate(), '', null, ''); +insert into sys_menu values('1009', '角色新增', '101', '2', '', '', '', 1, 0, 'F', '0', '0', 'system:role:add', '#', 'admin', sysdate(), '', null, ''); +insert into sys_menu values('1010', '角色修改', '101', '3', '', '', '', 1, 0, 'F', '0', '0', 'system:role:edit', '#', 'admin', sysdate(), '', null, ''); +insert into sys_menu values('1011', '角色删除', '101', '4', '', '', '', 1, 0, 'F', '0', '0', 'system:role:remove', '#', 'admin', sysdate(), '', null, ''); +insert into sys_menu values('1012', '角色导出', '101', '5', '', '', '', 1, 0, 'F', '0', '0', 'system:role:export', '#', 'admin', sysdate(), '', null, ''); +-- 菜单管理按钮 +insert into sys_menu values('1013', '菜单查询', '102', '1', '', '', '', 1, 0, 'F', '0', '0', 'system:menu:query', '#', 'admin', sysdate(), '', null, ''); +insert into sys_menu values('1014', '菜单新增', '102', '2', '', '', '', 1, 0, 'F', '0', '0', 'system:menu:add', '#', 'admin', sysdate(), '', null, ''); +insert into sys_menu values('1015', '菜单修改', '102', '3', '', '', '', 1, 0, 'F', '0', '0', 'system:menu:edit', '#', 'admin', sysdate(), '', null, ''); +insert into sys_menu values('1016', '菜单删除', '102', '4', '', '', '', 1, 0, 'F', '0', '0', 'system:menu:remove', '#', 'admin', sysdate(), '', null, ''); +-- 部门管理按钮 +insert into sys_menu values('1017', '部门查询', '103', '1', '', '', '', 1, 0, 'F', '0', '0', 'system:dept:query', '#', 'admin', sysdate(), '', null, ''); +insert into sys_menu values('1018', '部门新增', '103', '2', '', '', '', 1, 0, 'F', '0', '0', 'system:dept:add', '#', 'admin', sysdate(), '', null, ''); +insert into sys_menu values('1019', '部门修改', '103', '3', '', '', '', 1, 0, 'F', '0', '0', 'system:dept:edit', '#', 'admin', sysdate(), '', null, ''); +insert into sys_menu values('1020', '部门删除', '103', '4', '', '', '', 1, 0, 'F', '0', '0', 'system:dept:remove', '#', 'admin', sysdate(), '', null, ''); +-- 岗位管理按钮 +insert into sys_menu values('1021', '岗位查询', '104', '1', '', '', '', 1, 0, 'F', '0', '0', 'system:post:query', '#', 'admin', sysdate(), '', null, ''); +insert into sys_menu values('1022', '岗位新增', '104', '2', '', '', '', 1, 0, 'F', '0', '0', 'system:post:add', '#', 'admin', sysdate(), '', null, ''); +insert into sys_menu values('1023', '岗位修改', '104', '3', '', '', '', 1, 0, 'F', '0', '0', 'system:post:edit', '#', 'admin', sysdate(), '', null, ''); +insert into sys_menu values('1024', '岗位删除', '104', '4', '', '', '', 1, 0, 'F', '0', '0', 'system:post:remove', '#', 'admin', sysdate(), '', null, ''); +insert into sys_menu values('1025', '岗位导出', '104', '5', '', '', '', 1, 0, 'F', '0', '0', 'system:post:export', '#', 'admin', sysdate(), '', null, ''); +-- 字典管理按钮 +insert into sys_menu values('1026', '字典查询', '105', '1', '#', '', '', 1, 0, 'F', '0', '0', 'system:dict:query', '#', 'admin', sysdate(), '', null, ''); +insert into sys_menu values('1027', '字典新增', '105', '2', '#', '', '', 1, 0, 'F', '0', '0', 'system:dict:add', '#', 'admin', sysdate(), '', null, ''); +insert into sys_menu values('1028', '字典修改', '105', '3', '#', '', '', 1, 0, 'F', '0', '0', 'system:dict:edit', '#', 'admin', sysdate(), '', null, ''); +insert into sys_menu values('1029', '字典删除', '105', '4', '#', '', '', 1, 0, 'F', '0', '0', 'system:dict:remove', '#', 'admin', sysdate(), '', null, ''); +insert into sys_menu values('1030', '字典导出', '105', '5', '#', '', '', 1, 0, 'F', '0', '0', 'system:dict:export', '#', 'admin', sysdate(), '', null, ''); +-- 参数设置按钮 +insert into sys_menu values('1031', '参数查询', '106', '1', '#', '', '', 1, 0, 'F', '0', '0', 'system:config:query', '#', 'admin', sysdate(), '', null, ''); +insert into sys_menu values('1032', '参数新增', '106', '2', '#', '', '', 1, 0, 'F', '0', '0', 'system:config:add', '#', 'admin', sysdate(), '', null, ''); +insert into sys_menu values('1033', '参数修改', '106', '3', '#', '', '', 1, 0, 'F', '0', '0', 'system:config:edit', '#', 'admin', sysdate(), '', null, ''); +insert into sys_menu values('1034', '参数删除', '106', '4', '#', '', '', 1, 0, 'F', '0', '0', 'system:config:remove', '#', 'admin', sysdate(), '', null, ''); +insert into sys_menu values('1035', '参数导出', '106', '5', '#', '', '', 1, 0, 'F', '0', '0', 'system:config:export', '#', 'admin', sysdate(), '', null, ''); +-- 通知公告按钮 +insert into sys_menu values('1036', '公告查询', '107', '1', '#', '', '', 1, 0, 'F', '0', '0', 'system:notice:query', '#', 'admin', sysdate(), '', null, ''); +insert into sys_menu values('1037', '公告新增', '107', '2', '#', '', '', 1, 0, 'F', '0', '0', 'system:notice:add', '#', 'admin', sysdate(), '', null, ''); +insert into sys_menu values('1038', '公告修改', '107', '3', '#', '', '', 1, 0, 'F', '0', '0', 'system:notice:edit', '#', 'admin', sysdate(), '', null, ''); +insert into sys_menu values('1039', '公告删除', '107', '4', '#', '', '', 1, 0, 'F', '0', '0', 'system:notice:remove', '#', 'admin', sysdate(), '', null, ''); +-- 操作日志按钮 +insert into sys_menu values('1040', '操作查询', '500', '1', '#', '', '', 1, 0, 'F', '0', '0', 'monitor:operlog:query', '#', 'admin', sysdate(), '', null, ''); +insert into sys_menu values('1041', '操作删除', '500', '2', '#', '', '', 1, 0, 'F', '0', '0', 'monitor:operlog:remove', '#', 'admin', sysdate(), '', null, ''); +insert into sys_menu values('1042', '日志导出', '500', '4', '#', '', '', 1, 0, 'F', '0', '0', 'monitor:operlog:export', '#', 'admin', sysdate(), '', null, ''); +-- 登录日志按钮 +insert into sys_menu values('1043', '登录查询', '501', '1', '#', '', '', 1, 0, 'F', '0', '0', 'monitor:logininfor:query', '#', 'admin', sysdate(), '', null, ''); +insert into sys_menu values('1044', '登录删除', '501', '2', '#', '', '', 1, 0, 'F', '0', '0', 'monitor:logininfor:remove', '#', 'admin', sysdate(), '', null, ''); +insert into sys_menu values('1045', '日志导出', '501', '3', '#', '', '', 1, 0, 'F', '0', '0', 'monitor:logininfor:export', '#', 'admin', sysdate(), '', null, ''); +insert into sys_menu values('1050', '账户解锁', '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('1055', '生成查询', '115', '1', '#', '', '', 1, 0, 'F', '0', '0', 'tool:gen:query', '#', 'admin', sysdate(), '', null, ''); +insert into sys_menu values('1056', '生成修改', '115', '2', '#', '', '', 1, 0, 'F', '0', '0', 'tool:gen:edit', '#', 'admin', sysdate(), '', null, ''); +insert into sys_menu values('1057', '生成删除', '115', '3', '#', '', '', 1, 0, 'F', '0', '0', 'tool:gen:remove', '#', 'admin', sysdate(), '', null, ''); +insert into sys_menu values('1058', '导入代码', '115', '2', '#', '', '', 1, 0, 'F', '0', '0', 'tool:gen:import', '#', 'admin', sysdate(), '', null, ''); +insert into sys_menu values('1059', '预览代码', '115', '4', '#', '', '', 1, 0, 'F', '0', '0', 'tool:gen:preview', '#', 'admin', sysdate(), '', null, ''); +insert into sys_menu values('1060', '生成代码', '115', '5', '#', '', '', 1, 0, 'F', '0', '0', 'tool:gen:code', '#', 'admin', sysdate(), '', null, ''); +-- oss相关按钮 +insert into sys_menu values('1600', '文件查询', '118', '1', '#', '', '', 1, 0, 'F', '0', '0', 'system:oss:query', '#', 'admin', sysdate(), '', null, ''); +insert into sys_menu values('1601', '文件上传', '118', '2', '#', '', '', 1, 0, 'F', '0', '0', 'system:oss:upload', '#', 'admin', sysdate(), '', null, ''); +insert into sys_menu values('1602', '文件下载', '118', '3', '#', '', '', 1, 0, 'F', '0', '0', 'system:oss:download', '#', 'admin', sysdate(), '', null, ''); +insert into sys_menu values('1603', '文件删除', '118', '4', '#', '', '', 1, 0, 'F', '0', '0', 'system:oss:remove', '#', 'admin', sysdate(), '', null, ''); +insert into sys_menu values('1604', '配置添加', '118', '5', '#', '', '', 1, 0, 'F', '0', '0', 'system:oss:add', '#', 'admin', sysdate(), '', null, ''); +insert into sys_menu values('1605', '配置编辑', '118', '6', '#', '', '', 1, 0, 'F', '0', '0', 'system:oss:edit', '#', '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', '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', '1050'); +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', '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 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 '操作时间', + 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 comment = '操作日志记录'; + + +-- ---------------------------- +-- 11、字典类型表 +-- ---------------------------- +drop table if exists sys_dict_type; +create table sys_dict_type +( + dict_id bigint(20) not null 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 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(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 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 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(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(29, 99, '其他', '0', 'sys_oper_type', '', 'info', 'N', '0', 'admin', sysdate(), '', null, '其他操作'); +insert into sys_dict_data values(18, 1, '新增', '1', 'sys_oper_type', '', 'info', 'N', '0', 'admin', sysdate(), '', null, '新增操作'); +insert into sys_dict_data values(19, 2, '修改', '2', 'sys_oper_type', '', 'info', 'N', '0', 'admin', sysdate(), '', null, '修改操作'); +insert into sys_dict_data values(20, 3, '删除', '3', 'sys_oper_type', '', 'danger', 'N', '0', 'admin', sysdate(), '', null, '删除操作'); +insert into sys_dict_data values(21, 4, '授权', '4', 'sys_oper_type', '', 'primary', 'N', '0', 'admin', sysdate(), '', null, '授权操作'); +insert into sys_dict_data values(22, 5, '导出', '5', 'sys_oper_type', '', 'warning', 'N', '0', 'admin', sysdate(), '', null, '导出操作'); +insert into sys_dict_data values(23, 6, '导入', '6', 'sys_oper_type', '', 'warning', 'N', '0', 'admin', sysdate(), '', null, '导入操作'); +insert into sys_dict_data values(24, 7, '强退', '7', 'sys_oper_type', '', 'danger', 'N', '0', 'admin', sysdate(), '', null, '强退操作'); +insert into sys_dict_data values(25, 8, '生成代码', '8', 'sys_oper_type', '', 'warning', 'N', '0', 'admin', sysdate(), '', null, '生成操作'); +insert into sys_dict_data values(26, 9, '清空数据', '9', 'sys_oper_type', '', 'danger', 'N', '0', 'admin', sysdate(), '', null, '清空操作'); +insert into sys_dict_data values(27, 1, '成功', '0', 'sys_common_status', '', 'primary', 'N', '0', 'admin', sysdate(), '', null, '正常状态'); +insert into sys_dict_data values(28, 2, '失败', '1', 'sys_common_status', '', 'danger', 'N', '0', 'admin', sysdate(), '', null, '停用状态'); + + +-- ---------------------------- +-- 13、参数配置表 +-- ---------------------------- +drop table if exists sys_config; +create table sys_config ( + config_id bigint(20) not null 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 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(11, 'OSS预览列表资源开关', 'sys.oss.previewListResource', 'true', 'Y', 'admin', sysdate(), '', null, 'true:开启, false:关闭'); + + +-- ---------------------------- +-- 14、系统访问记录 +-- ---------------------------- +drop table if exists sys_logininfor; +create table sys_logininfor ( + info_id bigint(20) not null 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 comment = '系统访问记录'; + + +-- ---------------------------- +-- 17、通知公告表 +-- ---------------------------- +drop table if exists sys_notice; +create table sys_notice ( + notice_id bigint(20) not null 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 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 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 comment = '代码生成业务表'; + + +-- ---------------------------- +-- 19、代码生成业务表字段 +-- ---------------------------- +drop table if exists gen_table_column; +create table gen_table_column ( + column_id bigint(20) not null comment '编号', + table_id bigint(20) 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 comment = '代码生成业务表字段'; + +-- ---------------------------- +-- OSS对象存储表 +-- ---------------------------- +drop table if exists sys_oss; +create table sys_oss ( + oss_id bigint(20) not null comment '对象存储主键', + file_name varchar(255) not null default '' comment '文件名', + original_name varchar(255) not null default '' comment '原名', + file_suffix varchar(10) not null default '' comment '文件后缀名', + url varchar(500) not null comment 'URL地址', + create_time datetime default null comment '创建时间', + create_by varchar(64) default '' comment '上传人', + update_time datetime default null comment '更新时间', + update_by varchar(64) default '' comment '更新人', + service varchar(20) not null default 'minio' comment '服务商', + primary key (oss_id) +) engine=innodb comment ='OSS对象存储表'; + +-- ---------------------------- +-- OSS对象存储动态配置表 +-- ---------------------------- +drop table if exists sys_oss_config; +create table sys_oss_config ( + oss_config_id bigint(20) not null comment '主建', + config_key varchar(20) not null default '' comment '配置key', + access_key varchar(255) default '' comment 'accessKey', + secret_key varchar(255) default '' comment '秘钥', + bucket_name varchar(255) default '' comment '桶名称', + prefix varchar(255) default '' comment '前缀', + endpoint varchar(255) default '' comment '访问站点', + domain varchar(255) default '' comment '自定义域名', + is_https char(1) default 'N' comment '是否https(Y=是,N=否)', + region varchar(255) default '' comment '域', + access_policy char(1) not null default '1' comment '桶权限类型(0=private 1=public 2=custom)', + status char(1) default '1' comment '是否默认(0=是,1=否)', + ext1 varchar(255) default '' comment '扩展字段', + create_by varchar(64) default '' comment '创建者', + create_time datetime default null comment '创建时间', + update_by varchar(64) default '' comment '更新者', + update_time datetime default null comment '更新时间', + remark varchar(500) default null comment '备注', + primary key (oss_config_id) +) engine=innodb comment='对象存储配置表'; + +insert into sys_oss_config values (1, 'minio', 'ruoyi', 'ruoyi123', 'ruoyi', '', '127.0.0.1:9000', '','N', '', '1' ,'0', '', 'admin', sysdate(), 'admin', sysdate(), NULL); +insert into sys_oss_config values (2, 'qiniu', 'XXXXXXXXXXXXXXX', 'XXXXXXXXXXXXXXX', 'ruoyi', '', 's3-cn-north-1.qiniucs.com', '','N', '', '1' ,'1', '', 'admin', sysdate(), 'admin', sysdate(), NULL); +insert into sys_oss_config values (3, 'aliyun', 'XXXXXXXXXXXXXXX', 'XXXXXXXXXXXXXXX', 'ruoyi', '', 'oss-cn-beijing.aliyuncs.com', '','N', '', '1' ,'1', '', 'admin', sysdate(), 'admin', sysdate(), NULL); +insert into sys_oss_config values (4, 'qcloud', 'XXXXXXXXXXXXXXX', 'XXXXXXXXXXXXXXX', 'ruoyi-1250000000', '', 'cos.ap-beijing.myqcloud.com', '','N', 'ap-beijing', '1' ,'1', '', 'admin', sysdate(), 'admin', sysdate(), NULL); +insert into sys_oss_config values (5, 'image', 'ruoyi', 'ruoyi123', 'ruoyi', 'image', '127.0.0.1:9000', '','N', '', '1' ,'1', '', 'admin', sysdate(), 'admin', sysdate(), NULL); diff --git a/script/sql/sqlserver/sqlserver_ry_vue_4.X.sql b/script/sql/sqlserver/sqlserver_ry_vue_4.X.sql new file mode 100644 index 0000000..c45fdc4 --- /dev/null +++ b/script/sql/sqlserver/sqlserver_ry_vue_4.X.sql @@ -0,0 +1,2344 @@ + +CREATE TABLE gen_table +( + table_id bigint NOT NULL, + table_name nvarchar(200) DEFAULT '' NULL, + table_comment nvarchar(500) DEFAULT '' NULL, + sub_table_name nvarchar(64) NULL, + sub_table_fk_name nvarchar(64) NULL, + class_name nvarchar(100) DEFAULT '' NULL, + tpl_category nvarchar(200) DEFAULT ('crud') NULL, + package_name nvarchar(100) NULL, + module_name nvarchar(30) NULL, + business_name nvarchar(30) NULL, + function_name nvarchar(50) NULL, + function_author nvarchar(50) NULL, + gen_type nchar(1) DEFAULT ('0') NULL, + gen_path nvarchar(200) DEFAULT ('/') NULL, + options nvarchar(1000) NULL, + create_by nvarchar(64) DEFAULT '' NULL, + create_time datetime2(7) NULL, + update_by nvarchar(64) DEFAULT '' NULL, + update_time datetime2(7) NULL, + remark nvarchar(500) NULL, + CONSTRAINT PK__gen_tabl__B21E8F2427725F8A PRIMARY KEY CLUSTERED (table_id) + WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) + ON [PRIMARY] +) +ON [PRIMARY] +GO + +EXEC sys.sp_addextendedproperty + 'MS_Description', N'编号' , + 'SCHEMA', N'dbo', + 'TABLE', N'gen_table', + 'COLUMN', N'table_id' +GO +EXEC sys.sp_addextendedproperty + 'MS_Description', N'表名称' , + 'SCHEMA', N'dbo', + 'TABLE', N'gen_table', + 'COLUMN', N'table_name' +GO +EXEC sys.sp_addextendedproperty + 'MS_Description', N'表描述' , + 'SCHEMA', N'dbo', + 'TABLE', N'gen_table', + 'COLUMN', N'table_comment' +GO +EXEC sys.sp_addextendedproperty + 'MS_Description', N'关联子表的表名' , + 'SCHEMA', N'dbo', + 'TABLE', N'gen_table', + 'COLUMN', N'sub_table_name' +GO +EXEC sys.sp_addextendedproperty + 'MS_Description', N'子表关联的外键名' , + 'SCHEMA', N'dbo', + 'TABLE', N'gen_table', + 'COLUMN', N'sub_table_fk_name' +GO +EXEC sys.sp_addextendedproperty + 'MS_Description', N'实体类名称' , + 'SCHEMA', N'dbo', + 'TABLE', N'gen_table', + 'COLUMN', N'class_name' +GO +EXEC sys.sp_addextendedproperty + 'MS_Description', N'使用的模板(crud单表操作 tree树表操作)' , + 'SCHEMA', N'dbo', + 'TABLE', N'gen_table', + 'COLUMN', N'tpl_category' +GO +EXEC sys.sp_addextendedproperty + 'MS_Description', N'生成包路径' , + 'SCHEMA', N'dbo', + 'TABLE', N'gen_table', + 'COLUMN', N'package_name' +GO +EXEC sys.sp_addextendedproperty + 'MS_Description', N'生成模块名' , + 'SCHEMA', N'dbo', + 'TABLE', N'gen_table', + 'COLUMN', N'module_name' +GO +EXEC sys.sp_addextendedproperty + 'MS_Description', N'生成业务名' , + 'SCHEMA', N'dbo', + 'TABLE', N'gen_table', + 'COLUMN', N'business_name' +GO +EXEC sys.sp_addextendedproperty + 'MS_Description', N'生成功能名' , + 'SCHEMA', N'dbo', + 'TABLE', N'gen_table', + 'COLUMN', N'function_name' +GO +EXEC sys.sp_addextendedproperty + 'MS_Description', N'生成功能作者' , + 'SCHEMA', N'dbo', + 'TABLE', N'gen_table', + 'COLUMN', N'function_author' +GO +EXEC sys.sp_addextendedproperty + 'MS_Description', N'生成代码方式(0zip压缩包 1自定义路径)' , + 'SCHEMA', N'dbo', + 'TABLE', N'gen_table', + 'COLUMN', N'gen_type' +GO +EXEC sys.sp_addextendedproperty + 'MS_Description', N'生成路径(不填默认项目路径)' , + 'SCHEMA', N'dbo', + 'TABLE', N'gen_table', + 'COLUMN', N'gen_path' +GO +EXEC sys.sp_addextendedproperty + 'MS_Description', N'其它生成选项' , + 'SCHEMA', N'dbo', + 'TABLE', N'gen_table', + 'COLUMN', N'options' +GO +EXEC sys.sp_addextendedproperty + 'MS_Description', N'创建者' , + 'SCHEMA', N'dbo', + 'TABLE', N'gen_table', + 'COLUMN', N'create_by' +GO +EXEC sys.sp_addextendedproperty + 'MS_Description', N'创建时间' , + 'SCHEMA', N'dbo', + 'TABLE', N'gen_table', + 'COLUMN', N'create_time' +GO +EXEC sys.sp_addextendedproperty + 'MS_Description', N'更新者' , + 'SCHEMA', N'dbo', + 'TABLE', N'gen_table', + 'COLUMN', N'update_by' +GO +EXEC sys.sp_addextendedproperty + 'MS_Description', N'更新时间' , + 'SCHEMA', N'dbo', + 'TABLE', N'gen_table', + 'COLUMN', N'update_time' +GO +EXEC sys.sp_addextendedproperty + 'MS_Description', N'备注' , + 'SCHEMA', N'dbo', + 'TABLE', N'gen_table', + 'COLUMN', N'remark' +GO +EXEC sys.sp_addextendedproperty + 'MS_Description', N'代码生成业务表' , + 'SCHEMA', N'dbo', + 'TABLE', N'gen_table' +GO + +CREATE TABLE gen_table_column +( + column_id bigint NOT NULL, + table_id bigint NULL, + column_name nvarchar(200) NULL, + column_comment nvarchar(500) NULL, + column_type nvarchar(100) NULL, + java_type nvarchar(500) NULL, + java_field nvarchar(200) NULL, + is_pk nchar(1) NULL, + is_increment nchar(1) NULL, + is_required nchar(1) NULL, + is_insert nchar(1) NULL, + is_edit nchar(1) NULL, + is_list nchar(1) NULL, + is_query nchar(1) NULL, + query_type nvarchar(200) DEFAULT ('EQ') NULL, + html_type nvarchar(200) NULL, + dict_type nvarchar(200) DEFAULT '' NULL, + sort int NULL, + create_by nvarchar(64) DEFAULT '' NULL, + create_time datetime2(7) NULL, + update_by nvarchar(64) DEFAULT '' NULL, + update_time datetime2(7) NULL, + CONSTRAINT PK__gen_tabl__E301851F2E68B4E8 PRIMARY KEY CLUSTERED (column_id) + WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) + ON [PRIMARY] +) +ON [PRIMARY] +GO + +EXEC sys.sp_addextendedproperty + 'MS_Description', N'编号' , + 'SCHEMA', N'dbo', + 'TABLE', N'gen_table_column', + 'COLUMN', N'column_id' +GO +EXEC sys.sp_addextendedproperty + 'MS_Description', N'归属表编号' , + 'SCHEMA', N'dbo', + 'TABLE', N'gen_table_column', + 'COLUMN', N'table_id' +GO +EXEC sys.sp_addextendedproperty + 'MS_Description', N'列名称' , + 'SCHEMA', N'dbo', + 'TABLE', N'gen_table_column', + 'COLUMN', N'column_name' +GO +EXEC sys.sp_addextendedproperty + 'MS_Description', N'列描述' , + 'SCHEMA', N'dbo', + 'TABLE', N'gen_table_column', + 'COLUMN', N'column_comment' +GO +EXEC sys.sp_addextendedproperty + 'MS_Description', N'列类型' , + 'SCHEMA', N'dbo', + 'TABLE', N'gen_table_column', + 'COLUMN', N'column_type' +GO +EXEC sys.sp_addextendedproperty + 'MS_Description', N'JAVA类型' , + 'SCHEMA', N'dbo', + 'TABLE', N'gen_table_column', + 'COLUMN', N'java_type' +GO +EXEC sys.sp_addextendedproperty + 'MS_Description', N'JAVA字段名' , + 'SCHEMA', N'dbo', + 'TABLE', N'gen_table_column', + 'COLUMN', N'java_field' +GO +EXEC sys.sp_addextendedproperty + 'MS_Description', N'是否主键(1是)' , + 'SCHEMA', N'dbo', + 'TABLE', N'gen_table_column', + 'COLUMN', N'is_pk' +GO +EXEC sys.sp_addextendedproperty + 'MS_Description', N'是否自增(1是)' , + 'SCHEMA', N'dbo', + 'TABLE', N'gen_table_column', + 'COLUMN', N'is_increment' +GO +EXEC sys.sp_addextendedproperty + 'MS_Description', N'是否必填(1是)' , + 'SCHEMA', N'dbo', + 'TABLE', N'gen_table_column', + 'COLUMN', N'is_required' +GO +EXEC sys.sp_addextendedproperty + 'MS_Description', N'是否为插入字段(1是)' , + 'SCHEMA', N'dbo', + 'TABLE', N'gen_table_column', + 'COLUMN', N'is_insert' +GO +EXEC sys.sp_addextendedproperty + 'MS_Description', N'是否编辑字段(1是)' , + 'SCHEMA', N'dbo', + 'TABLE', N'gen_table_column', + 'COLUMN', N'is_edit' +GO +EXEC sys.sp_addextendedproperty + 'MS_Description', N'是否列表字段(1是)' , + 'SCHEMA', N'dbo', + 'TABLE', N'gen_table_column', + 'COLUMN', N'is_list' +GO +EXEC sys.sp_addextendedproperty + 'MS_Description', N'是否查询字段(1是)' , + 'SCHEMA', N'dbo', + 'TABLE', N'gen_table_column', + 'COLUMN', N'is_query' +GO +EXEC sys.sp_addextendedproperty + 'MS_Description', N'查询方式(等于、不等于、大于、小于、范围)' , + 'SCHEMA', N'dbo', + 'TABLE', N'gen_table_column', + 'COLUMN', N'query_type' +GO +EXEC sys.sp_addextendedproperty + 'MS_Description', N'显示类型(文本框、文本域、下拉框、复选框、单选框、日期控件)' , + 'SCHEMA', N'dbo', + 'TABLE', N'gen_table_column', + 'COLUMN', N'html_type' +GO +EXEC sys.sp_addextendedproperty + 'MS_Description', N'字典类型' , + 'SCHEMA', N'dbo', + 'TABLE', N'gen_table_column', + 'COLUMN', N'dict_type' +GO +EXEC sys.sp_addextendedproperty + 'MS_Description', N'排序' , + 'SCHEMA', N'dbo', + 'TABLE', N'gen_table_column', + 'COLUMN', N'sort' +GO +EXEC sys.sp_addextendedproperty + 'MS_Description', N'创建者' , + 'SCHEMA', N'dbo', + 'TABLE', N'gen_table_column', + 'COLUMN', N'create_by' +GO +EXEC sys.sp_addextendedproperty + 'MS_Description', N'创建时间' , + 'SCHEMA', N'dbo', + 'TABLE', N'gen_table_column', + 'COLUMN', N'create_time' +GO +EXEC sys.sp_addextendedproperty + 'MS_Description', N'更新者' , + 'SCHEMA', N'dbo', + 'TABLE', N'gen_table_column', + 'COLUMN', N'update_by' +GO +EXEC sys.sp_addextendedproperty + 'MS_Description', N'更新时间' , + 'SCHEMA', N'dbo', + 'TABLE', N'gen_table_column', + 'COLUMN', N'update_time' +GO +EXEC sys.sp_addextendedproperty + 'MS_Description', N'代码生成业务表字段' , + 'SCHEMA', N'dbo', + 'TABLE', N'gen_table_column' +GO + +CREATE TABLE sys_config +( + config_id bigint NOT NULL, + config_name nvarchar(100) DEFAULT '' NULL, + config_key nvarchar(100) DEFAULT '' NULL, + config_value nvarchar(500) DEFAULT '' NULL, + config_type nchar(1) DEFAULT ('N') NULL, + create_by nvarchar(64) DEFAULT '' NULL, + create_time datetime2(7) NULL, + update_by nvarchar(64) DEFAULT '' NULL, + update_time datetime2(7) NULL, + remark nvarchar(500) NULL, + CONSTRAINT PK__sys_conf__4AD1BFF182643682 PRIMARY KEY CLUSTERED (config_id) + WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) + ON [PRIMARY] +) +ON [PRIMARY] +GO + +EXEC sys.sp_addextendedproperty + 'MS_Description', N'参数主键' , + 'SCHEMA', N'dbo', + 'TABLE', N'sys_config', + 'COLUMN', N'config_id' +GO +EXEC sys.sp_addextendedproperty + 'MS_Description', N'参数名称' , + 'SCHEMA', N'dbo', + 'TABLE', N'sys_config', + 'COLUMN', N'config_name' +GO +EXEC sys.sp_addextendedproperty + 'MS_Description', N'参数键名' , + 'SCHEMA', N'dbo', + 'TABLE', N'sys_config', + 'COLUMN', N'config_key' +GO +EXEC sys.sp_addextendedproperty + 'MS_Description', N'参数键值' , + 'SCHEMA', N'dbo', + 'TABLE', N'sys_config', + 'COLUMN', N'config_value' +GO +EXEC sys.sp_addextendedproperty + 'MS_Description', N'系统内置(Y是 N否)' , + 'SCHEMA', N'dbo', + 'TABLE', N'sys_config', + 'COLUMN', N'config_type' +GO +EXEC sys.sp_addextendedproperty + 'MS_Description', N'创建者' , + 'SCHEMA', N'dbo', + 'TABLE', N'sys_config', + 'COLUMN', N'create_by' +GO +EXEC sys.sp_addextendedproperty + 'MS_Description', N'创建时间' , + 'SCHEMA', N'dbo', + 'TABLE', N'sys_config', + 'COLUMN', N'create_time' +GO +EXEC sys.sp_addextendedproperty + 'MS_Description', N'更新者' , + 'SCHEMA', N'dbo', + 'TABLE', N'sys_config', + 'COLUMN', N'update_by' +GO +EXEC sys.sp_addextendedproperty + 'MS_Description', N'更新时间' , + 'SCHEMA', N'dbo', + 'TABLE', N'sys_config', + 'COLUMN', N'update_time' +GO +EXEC sys.sp_addextendedproperty + 'MS_Description', N'备注' , + 'SCHEMA', N'dbo', + 'TABLE', N'sys_config', + 'COLUMN', N'remark' +GO +EXEC sys.sp_addextendedproperty + 'MS_Description', N'参数配置表' , + 'SCHEMA', N'dbo', + 'TABLE', N'sys_config' +GO + +INSERT sys_config VALUES (1, N'主框架页-默认皮肤样式名称', N'sys.index.skinName', N'skin-blue', N'Y', N'admin', getdate(), N'', NULL, N'蓝色 skin-blue、绿色 skin-green、紫色 skin-purple、红色 skin-red、黄色 skin-yellow') +GO +INSERT sys_config VALUES (2, N'用户管理-账号初始密码', N'sys.user.initPassword', N'123456', N'Y', N'admin', getdate(), N'', NULL, N'初始化密码 123456') +GO +INSERT sys_config VALUES (3, N'主框架页-侧边栏主题', N'sys.index.sideTheme', N'theme-dark', N'Y', N'admin', getdate(), N'', NULL, N'深色主题theme-dark,浅色主题theme-light') +GO +INSERT sys_config VALUES (4, N'账号自助-验证码开关', N'sys.account.captchaEnabled', N'true', N'Y', N'admin', getdate(), N'', NULL, N'是否开启验证码功能(true开启,false关闭)') +GO +INSERT sys_config VALUES (5, N'账号自助-是否开启用户注册功能', N'sys.account.registerUser', N'false', N'Y', N'admin', getdate(), N'', NULL, N'是否开启注册用户功能(true开启,false关闭)') +GO +INSERT sys_config VALUES (11, N'OSS预览列表资源开关', N'sys.oss.previewListResource', N'true', N'Y', N'admin', getdate(), N'', null, N'true:开启, false:关闭'); +GO + +CREATE TABLE sys_dept +( + dept_id bigint NOT NULL, + parent_id bigint DEFAULT ((0)) NULL, + ancestors nvarchar(500)DEFAULT '' NULL, + dept_name nvarchar(30) DEFAULT '' NULL, + order_num int DEFAULT ((0)) NULL, + leader nvarchar(20) NULL, + phone nvarchar(11) NULL, + email nvarchar(50) NULL, + status nchar(1) DEFAULT ('0') NULL, + del_flag nchar(1) DEFAULT ('0') NULL, + create_by nvarchar(64) DEFAULT '' NULL, + create_time datetime2(7) NULL, + update_by nvarchar(64) DEFAULT '' NULL, + update_time datetime2(7) NULL, + CONSTRAINT PK__sys_dept__DCA659747DE13804 PRIMARY KEY CLUSTERED (dept_id) + WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) + ON [PRIMARY] +) +ON [PRIMARY] +GO + +EXEC sys.sp_addextendedproperty + 'MS_Description', N'部门id' , + 'SCHEMA', N'dbo', + 'TABLE', N'sys_dept', + 'COLUMN', N'dept_id' +GO +EXEC sys.sp_addextendedproperty + 'MS_Description', N'父部门id' , + 'SCHEMA', N'dbo', + 'TABLE', N'sys_dept', + 'COLUMN', N'parent_id' +GO +EXEC sys.sp_addextendedproperty + 'MS_Description', N'祖级列表' , + 'SCHEMA', N'dbo', + 'TABLE', N'sys_dept', + 'COLUMN', N'ancestors' +GO +EXEC sys.sp_addextendedproperty + 'MS_Description', N'部门名称' , + 'SCHEMA', N'dbo', + 'TABLE', N'sys_dept', + 'COLUMN', N'dept_name' +GO +EXEC sys.sp_addextendedproperty + 'MS_Description', N'显示顺序' , + 'SCHEMA', N'dbo', + 'TABLE', N'sys_dept', + 'COLUMN', N'order_num' +GO +EXEC sys.sp_addextendedproperty + 'MS_Description', N'负责人' , + 'SCHEMA', N'dbo', + 'TABLE', N'sys_dept', + 'COLUMN', N'leader' +GO +EXEC sys.sp_addextendedproperty + 'MS_Description', N'联系电话' , + 'SCHEMA', N'dbo', + 'TABLE', N'sys_dept', + 'COLUMN', N'phone' +GO +EXEC sys.sp_addextendedproperty + 'MS_Description', N'邮箱' , + 'SCHEMA', N'dbo', + 'TABLE', N'sys_dept', + 'COLUMN', N'email' +GO +EXEC sys.sp_addextendedproperty + 'MS_Description', N'部门状态(0正常 1停用)' , + 'SCHEMA', N'dbo', + 'TABLE', N'sys_dept', + 'COLUMN', N'status' +GO +EXEC sys.sp_addextendedproperty + 'MS_Description', N'删除标志(0代表存在 2代表删除)' , + 'SCHEMA', N'dbo', + 'TABLE', N'sys_dept', + 'COLUMN', N'del_flag' +GO +EXEC sys.sp_addextendedproperty + 'MS_Description', N'创建者' , + 'SCHEMA', N'dbo', + 'TABLE', N'sys_dept', + 'COLUMN', N'create_by' +GO +EXEC sys.sp_addextendedproperty + 'MS_Description', N'创建时间' , + 'SCHEMA', N'dbo', + 'TABLE', N'sys_dept', + 'COLUMN', N'create_time' +GO +EXEC sys.sp_addextendedproperty + 'MS_Description', N'更新者' , + 'SCHEMA', N'dbo', + 'TABLE', N'sys_dept', + 'COLUMN', N'update_by' +GO +EXEC sys.sp_addextendedproperty + 'MS_Description', N'更新时间' , + 'SCHEMA', N'dbo', + 'TABLE', N'sys_dept', + 'COLUMN', N'update_time' +GO +EXEC sys.sp_addextendedproperty + 'MS_Description', N'部门表' , + 'SCHEMA', N'dbo', + 'TABLE', N'sys_dept' +GO + +INSERT sys_dept VALUES (100, 0, N'0', N'若依科技', 0, N'若依', N'15888888888', N'ry@qq.com', N'0', N'0', N'admin', getdate(), N'', NULL) +GO +INSERT sys_dept VALUES (101, 100, N'0,100', N'深圳总公司', 1, N'若依', N'15888888888', N'ry@qq.com', N'0', N'0', N'admin', getdate(), N'', NULL) +GO +INSERT sys_dept VALUES (102, 100, N'0,100', N'长沙分公司', 2, N'若依', N'15888888888', N'ry@qq.com', N'0', N'0', N'admin', getdate(), N'', NULL) +GO +INSERT sys_dept VALUES (103, 101, N'0,100,101', N'研发部门', 1, N'若依', N'15888888888', N'ry@qq.com', N'0', N'0', N'admin', getdate(), N'', NULL) +GO +INSERT sys_dept VALUES (104, 101, N'0,100,101', N'市场部门', 2, N'若依', N'15888888888', N'ry@qq.com', N'0', N'0', N'admin', getdate(), N'', NULL) +GO +INSERT sys_dept VALUES (105, 101, N'0,100,101', N'测试部门', 3, N'若依', N'15888888888', N'ry@qq.com', N'0', N'0', N'admin', getdate(), N'', NULL) +GO +INSERT sys_dept VALUES (106, 101, N'0,100,101', N'财务部门', 4, N'若依', N'15888888888', N'ry@qq.com', N'0', N'0', N'admin', getdate(), N'', NULL) +GO +INSERT sys_dept VALUES (107, 101, N'0,100,101', N'运维部门', 5, N'若依', N'15888888888', N'ry@qq.com', N'0', N'0', N'admin', getdate(), N'', NULL) +GO +INSERT sys_dept VALUES (108, 102, N'0,100,102', N'市场部门', 1, N'若依', N'15888888888', N'ry@qq.com', N'0', N'0', N'admin', getdate(), N'', NULL) +GO +INSERT sys_dept VALUES (109, 102, N'0,100,102', N'财务部门', 2, N'若依', N'15888888888', N'ry@qq.com', N'0', N'0', N'admin', getdate(), N'', NULL) +GO + +CREATE TABLE sys_dict_data +( + dict_code bigint NOT NULL, + dict_sort int DEFAULT ((0)) NULL, + dict_label nvarchar(100) DEFAULT '' NULL, + dict_value nvarchar(100) DEFAULT '' NULL, + dict_type nvarchar(100) DEFAULT '' NULL, + css_class nvarchar(100) NULL, + list_class nvarchar(100) NULL, + is_default nchar(1) DEFAULT ('N') NULL, + status nchar(1) DEFAULT ('0') NULL, + create_by nvarchar(64) DEFAULT '' NULL, + create_time datetime2(7) NULL, + update_by nvarchar(64) DEFAULT '' NULL, + update_time datetime2(7) NULL, + remark nvarchar(500) NULL, + CONSTRAINT PK__sys_dict__19CBC34B661AF3B3 PRIMARY KEY CLUSTERED (dict_code) + WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) + ON [PRIMARY] +) +ON [PRIMARY] +GO + +EXEC sys.sp_addextendedproperty + 'MS_Description', N'字典编码' , + 'SCHEMA', N'dbo', + 'TABLE', N'sys_dict_data', + 'COLUMN', N'dict_code' +GO +EXEC sys.sp_addextendedproperty + 'MS_Description', N'字典排序' , + 'SCHEMA', N'dbo', + 'TABLE', N'sys_dict_data', + 'COLUMN', N'dict_sort' +GO +EXEC sys.sp_addextendedproperty + 'MS_Description', N'字典标签' , + 'SCHEMA', N'dbo', + 'TABLE', N'sys_dict_data', + 'COLUMN', N'dict_label' +GO +EXEC sys.sp_addextendedproperty + 'MS_Description', N'字典键值' , + 'SCHEMA', N'dbo', + 'TABLE', N'sys_dict_data', + 'COLUMN', N'dict_value' +GO +EXEC sys.sp_addextendedproperty + 'MS_Description', N'字典类型' , + 'SCHEMA', N'dbo', + 'TABLE', N'sys_dict_data', + 'COLUMN', N'dict_type' +GO +EXEC sys.sp_addextendedproperty + 'MS_Description', N'样式属性(其他样式扩展)' , + 'SCHEMA', N'dbo', + 'TABLE', N'sys_dict_data', + 'COLUMN', N'css_class' +GO +EXEC sys.sp_addextendedproperty + 'MS_Description', N'表格回显样式' , + 'SCHEMA', N'dbo', + 'TABLE', N'sys_dict_data', + 'COLUMN', N'list_class' +GO +EXEC sys.sp_addextendedproperty + 'MS_Description', N'是否默认(Y是 N否)' , + 'SCHEMA', N'dbo', + 'TABLE', N'sys_dict_data', + 'COLUMN', N'is_default' +GO +EXEC sys.sp_addextendedproperty + 'MS_Description', N'状态(0正常 1停用)' , + 'SCHEMA', N'dbo', + 'TABLE', N'sys_dict_data', + 'COLUMN', N'status' +GO +EXEC sys.sp_addextendedproperty + 'MS_Description', N'创建者' , + 'SCHEMA', N'dbo', + 'TABLE', N'sys_dict_data', + 'COLUMN', N'create_by' +GO +EXEC sys.sp_addextendedproperty + 'MS_Description', N'创建时间' , + 'SCHEMA', N'dbo', + 'TABLE', N'sys_dict_data', + 'COLUMN', N'create_time' +GO +EXEC sys.sp_addextendedproperty + 'MS_Description', N'更新者' , + 'SCHEMA', N'dbo', + 'TABLE', N'sys_dict_data', + 'COLUMN', N'update_by' +GO +EXEC sys.sp_addextendedproperty + 'MS_Description', N'更新时间' , + 'SCHEMA', N'dbo', + 'TABLE', N'sys_dict_data', + 'COLUMN', N'update_time' +GO +EXEC sys.sp_addextendedproperty + 'MS_Description', N'备注' , + 'SCHEMA', N'dbo', + 'TABLE', N'sys_dict_data', + 'COLUMN', N'remark' +GO +EXEC sys.sp_addextendedproperty + 'MS_Description', N'字典数据表' , + 'SCHEMA', N'dbo', + 'TABLE', N'sys_dict_data' +GO + +INSERT sys_dict_data VALUES (1, 1, N'男', N'0', N'sys_user_sex', N'', N'', N'Y', N'0', N'admin', getdate(), N'', NULL, N'性别男') +GO +INSERT sys_dict_data VALUES (2, 2, N'女', N'1', N'sys_user_sex', N'', N'', N'N', N'0', N'admin', getdate(), N'', NULL, N'性别女') +GO +INSERT sys_dict_data VALUES (3, 3, N'未知', N'2', N'sys_user_sex', N'', N'', N'N', N'0', N'admin', getdate(), N'', NULL, N'性别未知') +GO +INSERT sys_dict_data VALUES (4, 1, N'显示', N'0', N'sys_show_hide', N'', N'primary', N'Y', N'0', N'admin', getdate(), N'', NULL, N'显示菜单') +GO +INSERT sys_dict_data VALUES (5, 2, N'隐藏', N'1', N'sys_show_hide', N'', N'danger', N'N', N'0', N'admin', getdate(), N'', NULL, N'隐藏菜单') +GO +INSERT sys_dict_data VALUES (6, 1, N'正常', N'0', N'sys_normal_disable', N'', N'primary', N'Y', N'0', N'admin', getdate(), N'', NULL, N'正常状态') +GO +INSERT sys_dict_data VALUES (7, 2, N'停用', N'1', N'sys_normal_disable', N'', N'danger', N'N', N'0', N'admin', getdate(), N'', NULL, N'停用状态') +GO +INSERT sys_dict_data VALUES (12, 1, N'是', N'Y', N'sys_yes_no', N'', N'primary', N'Y', N'0', N'admin', getdate(), N'', NULL, N'系统默认是') +GO +INSERT sys_dict_data VALUES (13, 2, N'否', N'N', N'sys_yes_no', N'', N'danger', N'N', N'0', N'admin', getdate(), N'', NULL, N'系统默认否') +GO +INSERT sys_dict_data VALUES (14, 1, N'通知', N'1', N'sys_notice_type', N'', N'warning', N'Y', N'0', N'admin', getdate(), N'', NULL, N'通知') +GO +INSERT sys_dict_data VALUES (15, 2, N'公告', N'2', N'sys_notice_type', N'', N'success', N'N', N'0', N'admin', getdate(), N'', NULL, N'公告') +GO +INSERT sys_dict_data VALUES (16, 1, N'正常', N'0', N'sys_notice_status', N'', N'primary', N'Y', N'0', N'admin', getdate(), N'', NULL, N'正常状态') +GO +INSERT sys_dict_data VALUES (17, 2, N'关闭', N'1', N'sys_notice_status', N'', N'danger', N'N', N'0', N'admin', getdate(), N'', NULL, N'关闭状态') +GO +INSERT sys_dict_data VALUES (29, 99, N'其他', N'0', N'sys_oper_type', N'', N'info', N'N', N'0', N'admin', getdate(), N'', NULL, N'其他操作'); +GO +INSERT sys_dict_data VALUES (18, 1, N'新增', N'1', N'sys_oper_type', N'', N'info', N'N', N'0', N'admin', getdate(), N'', NULL, N'新增操作') +GO +INSERT sys_dict_data VALUES (19, 2, N'修改', N'2', N'sys_oper_type', N'', N'info', N'N', N'0', N'admin', getdate(), N'', NULL, N'修改操作') +GO +INSERT sys_dict_data VALUES (20, 3, N'删除', N'3', N'sys_oper_type', N'', N'danger', N'N', N'0', N'admin', getdate(), N'', NULL, N'删除操作') +GO +INSERT sys_dict_data VALUES (21, 4, N'授权', N'4', N'sys_oper_type', N'', N'primary', N'N', N'0', N'admin', getdate(), N'', NULL, N'授权操作') +GO +INSERT sys_dict_data VALUES (22, 5, N'导出', N'5', N'sys_oper_type', N'', N'warning', N'N', N'0', N'admin', getdate(), N'', NULL, N'导出操作') +GO +INSERT sys_dict_data VALUES (23, 6, N'导入', N'6', N'sys_oper_type', N'', N'warning', N'N', N'0', N'admin', getdate(), N'', NULL, N'导入操作') +GO +INSERT sys_dict_data VALUES (24, 7, N'强退', N'7', N'sys_oper_type', N'', N'danger', N'N', N'0', N'admin', getdate(), N'', NULL, N'强退操作') +GO +INSERT sys_dict_data VALUES (25, 8, N'生成代码', N'8', N'sys_oper_type', N'', N'warning', N'N', N'0', N'admin', getdate(), N'', NULL, N'生成操作') +GO +INSERT sys_dict_data VALUES (26, 9, N'清空数据', N'9', N'sys_oper_type', N'', N'danger', N'N', N'0', N'admin', getdate(), N'', NULL, N'清空操作') +GO +INSERT sys_dict_data VALUES (27, 1, N'成功', N'0', N'sys_common_status', N'', N'primary', N'N', N'0', N'admin', getdate(), N'', NULL, N'正常状态') +GO +INSERT sys_dict_data VALUES (28, 2, N'失败', N'1', N'sys_common_status', N'', N'danger', N'N', N'0', N'admin', getdate(), N'', NULL, N'停用状态') +GO + +CREATE TABLE sys_dict_type +( + dict_id bigint NOT NULL, + dict_name nvarchar(100) DEFAULT '' NULL, + dict_type nvarchar(100) DEFAULT '' NULL, + status nchar(1) DEFAULT ('0') NULL, + create_by nvarchar(64) DEFAULT '' NULL, + create_time datetime2(7) NULL, + update_by nvarchar(64) DEFAULT '' NULL, + update_time datetime2(7) NULL, + remark nvarchar(500) NULL, + CONSTRAINT PK__sys_dict__3BD4186C409C5391 PRIMARY KEY CLUSTERED (dict_id) + WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) + ON [PRIMARY] +) +ON [PRIMARY] +GO + +CREATE NONCLUSTERED INDEX sys_dict_type_index1 ON sys_dict_type (dict_type) +GO + +EXEC sys.sp_addextendedproperty + 'MS_Description', N'字典主键' , + 'SCHEMA', N'dbo', + 'TABLE', N'sys_dict_type', + 'COLUMN', N'dict_id' +GO +EXEC sys.sp_addextendedproperty + 'MS_Description', N'字典名称' , + 'SCHEMA', N'dbo', + 'TABLE', N'sys_dict_type', + 'COLUMN', N'dict_name' +GO +EXEC sys.sp_addextendedproperty + 'MS_Description', N'字典类型' , + 'SCHEMA', N'dbo', + 'TABLE', N'sys_dict_type', + 'COLUMN', N'dict_type' +GO +EXEC sys.sp_addextendedproperty + 'MS_Description', N'状态(0正常 1停用)' , + 'SCHEMA', N'dbo', + 'TABLE', N'sys_dict_type', + 'COLUMN', N'status' +GO +EXEC sys.sp_addextendedproperty + 'MS_Description', N'创建者' , + 'SCHEMA', N'dbo', + 'TABLE', N'sys_dict_type', + 'COLUMN', N'create_by' +GO +EXEC sys.sp_addextendedproperty + 'MS_Description', N'创建时间' , + 'SCHEMA', N'dbo', + 'TABLE', N'sys_dict_type', + 'COLUMN', N'create_time' +GO +EXEC sys.sp_addextendedproperty + 'MS_Description', N'更新者' , + 'SCHEMA', N'dbo', + 'TABLE', N'sys_dict_type', + 'COLUMN', N'update_by' +GO +EXEC sys.sp_addextendedproperty + 'MS_Description', N'更新时间' , + 'SCHEMA', N'dbo', + 'TABLE', N'sys_dict_type', + 'COLUMN', N'update_time' +GO +EXEC sys.sp_addextendedproperty + 'MS_Description', N'备注' , + 'SCHEMA', N'dbo', + 'TABLE', N'sys_dict_type', + 'COLUMN', N'remark' +GO +EXEC sys.sp_addextendedproperty + 'MS_Description', N'字典类型表' , + 'SCHEMA', N'dbo', + 'TABLE', N'sys_dict_type' +GO + +INSERT sys_dict_type VALUES (1, N'用户性别', N'sys_user_sex', N'0', N'admin', getdate(), N'', NULL, N'用户性别列表') +GO +INSERT sys_dict_type VALUES (2, N'菜单状态', N'sys_show_hide', N'0', N'admin', getdate(), N'', NULL, N'菜单状态列表') +GO +INSERT sys_dict_type VALUES (3, N'系统开关', N'sys_normal_disable', N'0', N'admin', getdate(), N'', NULL, N'系统开关列表') +GO +INSERT sys_dict_type VALUES (6, N'系统是否', N'sys_yes_no', N'0', N'admin', getdate(), N'', NULL, N'系统是否列表') +GO +INSERT sys_dict_type VALUES (7, N'通知类型', N'sys_notice_type', N'0', N'admin', getdate(), N'', NULL, N'通知类型列表') +GO +INSERT sys_dict_type VALUES (8, N'通知状态', N'sys_notice_status', N'0', N'admin', getdate(), N'', NULL, N'通知状态列表') +GO +INSERT sys_dict_type VALUES (9, N'操作类型', N'sys_oper_type', N'0', N'admin', getdate(), N'', NULL, N'操作类型列表') +GO +INSERT sys_dict_type VALUES (10, N'系统状态', N'sys_common_status', N'0', N'admin', getdate(), N'', NULL, N'登录状态列表') +GO + +CREATE TABLE sys_logininfor +( + info_id bigint NOT NULL, + user_name nvarchar(50) DEFAULT '' NULL, + ipaddr nvarchar(128) DEFAULT '' NULL, + login_location nvarchar(255) DEFAULT '' NULL, + browser nvarchar(50) DEFAULT '' NULL, + os nvarchar(50) DEFAULT '' NULL, + status nchar(1) DEFAULT ('0') NULL, + msg nvarchar(255) DEFAULT '' NULL, + login_time datetime2(7) NULL, + CONSTRAINT PK__sys_logi__3D8A9C1A1854AE10 PRIMARY KEY CLUSTERED (info_id) + WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) + ON [PRIMARY] +) +ON [PRIMARY] +GO + +CREATE NONCLUSTERED INDEX idx_sys_logininfor_s ON sys_logininfor (status) +GO +CREATE NONCLUSTERED INDEX idx_sys_logininfor_lt ON sys_logininfor (login_time) +GO + +EXEC sys.sp_addextendedproperty + 'MS_Description', N'访问ID' , + 'SCHEMA', N'dbo', + 'TABLE', N'sys_logininfor', + 'COLUMN', N'info_id' +GO +EXEC sys.sp_addextendedproperty + 'MS_Description', N'用户账号' , + 'SCHEMA', N'dbo', + 'TABLE', N'sys_logininfor', + 'COLUMN', N'user_name' +GO +EXEC sys.sp_addextendedproperty + 'MS_Description', N'登录IP地址' , + 'SCHEMA', N'dbo', + 'TABLE', N'sys_logininfor', + 'COLUMN', N'ipaddr' +GO +EXEC sys.sp_addextendedproperty + 'MS_Description', N'登录地点' , + 'SCHEMA', N'dbo', + 'TABLE', N'sys_logininfor', + 'COLUMN', N'login_location' +GO +EXEC sys.sp_addextendedproperty + 'MS_Description', N'浏览器类型' , + 'SCHEMA', N'dbo', + 'TABLE', N'sys_logininfor', + 'COLUMN', N'browser' +GO +EXEC sys.sp_addextendedproperty + 'MS_Description', N'操作系统' , + 'SCHEMA', N'dbo', + 'TABLE', N'sys_logininfor', + 'COLUMN', N'os' +GO +EXEC sys.sp_addextendedproperty + 'MS_Description', N'登录状态(0成功 1失败)' , + 'SCHEMA', N'dbo', + 'TABLE', N'sys_logininfor', + 'COLUMN', N'status' +GO +EXEC sys.sp_addextendedproperty + 'MS_Description', N'提示消息' , + 'SCHEMA', N'dbo', + 'TABLE', N'sys_logininfor', + 'COLUMN', N'msg' +GO +EXEC sys.sp_addextendedproperty + 'MS_Description', N'访问时间' , + 'SCHEMA', N'dbo', + 'TABLE', N'sys_logininfor', + 'COLUMN', N'login_time' +GO +EXEC sys.sp_addextendedproperty + 'MS_Description', N'系统访问记录' , + 'SCHEMA', N'dbo', + 'TABLE', N'sys_logininfor' +GO + +CREATE TABLE sys_menu +( + menu_id bigint NOT NULL, + menu_name nvarchar(50) NOT NULL, + parent_id bigint DEFAULT ((0)) NULL, + order_num int DEFAULT ((0)) NULL, + path nvarchar(200) DEFAULT '' NULL, + component nvarchar(255) NULL, + query_param nvarchar(255) NULL, + is_frame int DEFAULT ((1)) NULL, + is_cache int DEFAULT ((0)) NULL, + menu_type nchar(1) DEFAULT '' NULL, + visible nchar(1) DEFAULT ((0)) NULL, + status nchar(1) DEFAULT ((0)) NULL, + perms nvarchar(100) NULL, + icon nvarchar(100) DEFAULT ('#') NULL, + create_by nvarchar(64) DEFAULT '' NULL, + create_time datetime2(7) NULL, + update_by nvarchar(64) DEFAULT '' NULL, + update_time datetime2(7) NULL, + remark nvarchar(500) DEFAULT '' NULL, + CONSTRAINT PK__sys_menu__4CA0FADCF8545C58 PRIMARY KEY CLUSTERED (menu_id) + WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) + ON [PRIMARY] +) +ON [PRIMARY] +GO + +EXEC sys.sp_addextendedproperty + 'MS_Description', N'菜单ID' , + 'SCHEMA', N'dbo', + 'TABLE', N'sys_menu', + 'COLUMN', N'menu_id' +GO +EXEC sys.sp_addextendedproperty + 'MS_Description', N'菜单名称' , + 'SCHEMA', N'dbo', + 'TABLE', N'sys_menu', + 'COLUMN', N'menu_name' +GO +EXEC sys.sp_addextendedproperty + 'MS_Description', N'父菜单ID' , + 'SCHEMA', N'dbo', + 'TABLE', N'sys_menu', + 'COLUMN', N'parent_id' +GO +EXEC sys.sp_addextendedproperty + 'MS_Description', N'显示顺序' , + 'SCHEMA', N'dbo', + 'TABLE', N'sys_menu', + 'COLUMN', N'order_num' +GO +EXEC sys.sp_addextendedproperty + 'MS_Description', N'路由地址' , + 'SCHEMA', N'dbo', + 'TABLE', N'sys_menu', + 'COLUMN', N'path' +GO +EXEC sys.sp_addextendedproperty + 'MS_Description', N'组件路径' , + 'SCHEMA', N'dbo', + 'TABLE', N'sys_menu', + 'COLUMN', N'component' +GO +EXEC sys.sp_addextendedproperty + 'MS_Description', N'路由参数' , + 'SCHEMA', N'dbo', + 'TABLE', N'sys_menu', + 'COLUMN', N'query_param' +GO +EXEC sys.sp_addextendedproperty + 'MS_Description', N'是否为外链(0是 1否)' , + 'SCHEMA', N'dbo', + 'TABLE', N'sys_menu', + 'COLUMN', N'is_frame' +GO +EXEC sys.sp_addextendedproperty + 'MS_Description', N'是否缓存(0缓存 1不缓存)' , + 'SCHEMA', N'dbo', + 'TABLE', N'sys_menu', + 'COLUMN', N'is_cache' +GO +EXEC sys.sp_addextendedproperty + 'MS_Description', N'菜单类型(M目录 C菜单 F按钮)' , + 'SCHEMA', N'dbo', + 'TABLE', N'sys_menu', + 'COLUMN', N'menu_type' +GO +EXEC sys.sp_addextendedproperty + 'MS_Description', N'显示状态(0显示 1隐藏)' , + 'SCHEMA', N'dbo', + 'TABLE', N'sys_menu', + 'COLUMN', N'visible' +GO +EXEC sys.sp_addextendedproperty + 'MS_Description', N'菜单状态(0正常 1停用)' , + 'SCHEMA', N'dbo', + 'TABLE', N'sys_menu', + 'COLUMN', N'status' +GO +EXEC sys.sp_addextendedproperty + 'MS_Description', N'权限标识' , + 'SCHEMA', N'dbo', + 'TABLE', N'sys_menu', + 'COLUMN', N'perms' +GO +EXEC sys.sp_addextendedproperty + 'MS_Description', N'菜单图标' , + 'SCHEMA', N'dbo', + 'TABLE', N'sys_menu', + 'COLUMN', N'icon' +GO +EXEC sys.sp_addextendedproperty + 'MS_Description', N'创建者' , + 'SCHEMA', N'dbo', + 'TABLE', N'sys_menu', + 'COLUMN', N'create_by' +GO +EXEC sys.sp_addextendedproperty + 'MS_Description', N'创建时间' , + 'SCHEMA', N'dbo', + 'TABLE', N'sys_menu', + 'COLUMN', N'create_time' +GO +EXEC sys.sp_addextendedproperty + 'MS_Description', N'更新者' , + 'SCHEMA', N'dbo', + 'TABLE', N'sys_menu', + 'COLUMN', N'update_by' +GO +EXEC sys.sp_addextendedproperty + 'MS_Description', N'更新时间' , + 'SCHEMA', N'dbo', + 'TABLE', N'sys_menu', + 'COLUMN', N'update_time' +GO +EXEC sys.sp_addextendedproperty + 'MS_Description', N'备注' , + 'SCHEMA', N'dbo', + 'TABLE', N'sys_menu', + 'COLUMN', N'remark' +GO +EXEC sys.sp_addextendedproperty + 'MS_Description', N'菜单权限表' , + 'SCHEMA', N'dbo', + 'TABLE', N'sys_menu' +GO + +INSERT sys_menu VALUES (1, N'系统管理', 0, 1, N'system', NULL, N'', 1, 0, N'M', N'0', N'0', N'', N'system', N'admin', getdate(), N'', NULL, N'系统管理目录') +GO +INSERT sys_menu VALUES (2, N'系统监控', 0, 2, N'monitor', NULL, N'', 1, 0, N'M', N'0', N'0', N'', N'monitor', N'admin', getdate(), N'', NULL, N'系统监控目录') +GO +INSERT sys_menu VALUES (3, N'系统工具', 0, 3, N'tool', NULL, N'', 1, 0, N'M', N'0', N'0', N'', N'tool', N'admin', getdate(), N'', NULL, N'系统工具目录') +GO +INSERT sys_menu VALUES (4, N'PLUS官网', 0, 5, N'https://gitee.com/dromara/RuoYi-Vue-Plus', null, N'', 0, 0, N'M', N'0', N'0', N'', N'guide', N'admin', getdate(), N'', null, N'RuoYi-Vue-Plus官网地址'); +GO +INSERT sys_menu VALUES (100, N'用户管理', 1, 1, N'user', N'system/user/index', N'', 1, 0, N'C', N'0', N'0', N'system:user:list', N'user', N'admin', getdate(), N'', NULL, N'用户管理菜单') +GO +INSERT sys_menu VALUES (101, N'角色管理', 1, 2, N'role', N'system/role/index', N'', 1, 0, N'C', N'0', N'0', N'system:role:list', N'peoples', N'admin', getdate(), N'', NULL, N'角色管理菜单') +GO +INSERT sys_menu VALUES (102, N'菜单管理', 1, 3, N'menu', N'system/menu/index', N'', 1, 0, N'C', N'0', N'0', N'system:menu:list', N'tree-table', N'admin', getdate(), N'', NULL, N'菜单管理菜单') +GO +INSERT sys_menu VALUES (103, N'部门管理', 1, 4, N'dept', N'system/dept/index', N'', 1, 0, N'C', N'0', N'0', N'system:dept:list', N'tree', N'admin', getdate(), N'', NULL, N'部门管理菜单') +GO +INSERT sys_menu VALUES (104, N'岗位管理', 1, 5, N'post', N'system/post/index', N'', 1, 0, N'C', N'0', N'0', N'system:post:list', N'post', N'admin', getdate(), N'', NULL, N'岗位管理菜单') +GO +INSERT sys_menu VALUES (105, N'字典管理', 1, 6, N'dict', N'system/dict/index', N'', 1, 0, N'C', N'0', N'0', N'system:dict:list', N'dict', N'admin', getdate(), N'', NULL, N'字典管理菜单') +GO +INSERT sys_menu VALUES (106, N'参数设置', 1, 7, N'config', N'system/config/index', N'', 1, 0, N'C', N'0', N'0', N'system:config:list', N'edit', N'admin', getdate(), N'', NULL, N'参数设置菜单') +GO +INSERT sys_menu VALUES (107, N'通知公告', 1, 8, N'notice', N'system/notice/index', N'', 1, 0, N'C', N'0', N'0', N'system:notice:list', N'message', N'admin', getdate(), N'', NULL, N'通知公告菜单') +GO +INSERT sys_menu VALUES (108, N'日志管理', 1, 9, N'log', N'', N'', 1, 0, N'M', N'0', N'0', N'', N'log', N'admin', getdate(), N'', NULL, N'日志管理菜单') +GO +INSERT sys_menu VALUES (109, N'在线用户', 2, 1, N'online', N'monitor/online/index', N'', 1, 0, N'C', N'0', N'0', N'monitor:online:list', N'online', N'admin', getdate(), N'', NULL, N'在线用户菜单') +GO +INSERT sys_menu VALUES (112, N'缓存列表', 2, 6, N'cacheList', N'monitor/cache/list', N'', 1, 0, N'C', N'0', N'0', N'monitor:cache:list', N'redis-list', N'admin', getdate(), N'', NULL, N'缓存列表菜单') +GO +INSERT sys_menu VALUES (113, N'缓存监控', 2, 5, N'cache', N'monitor/cache/index', N'', 1, 0, N'C', N'0', N'0', N'monitor:cache:list', N'redis', N'admin', getdate(), N'', NULL, N'缓存监控菜单') +GO +INSERT sys_menu VALUES (114, N'表单构建', 3, 1, N'build', N'tool/build/index', N'', 1, 0, N'C', N'0', N'0', N'tool:build:list', N'build', N'admin', getdate(), N'', NULL, N'表单构建菜单') +GO +INSERT sys_menu VALUES (115, N'代码生成', 3, 2, N'gen', N'tool/gen/index', N'', 1, 0, N'C', N'0', N'0', N'tool:gen:list', N'code', N'admin', getdate(), N'', NULL, N'代码生成菜单') +GO +INSERT sys_menu VALUES (117, N'Admin监控', 2, 5, N'Admin', N'monitor/admin/index', N'', 1, 0, N'C', N'0', N'0', N'monitor:admin:list', N'dashboard', N'admin', getdate(), N'', NULL, N'Admin监控菜单'); +GO +INSERT sys_menu VALUES (118, N'文件管理', 1, 10, N'oss', N'system/oss/index', N'', 1, 0, N'C', '0', N'0', N'system:oss:list', N'upload', N'admin', getdate(), N'', NULL, N'文件管理菜单'); +GO +INSERT sys_menu VALUES (120, N'任务调度中心', 2, 5, N'XxlJob', N'monitor/xxljob/index', N'', 1, 0, N'C', N'0', N'0', N'monitor:xxljob:list', N'job', N'admin', getdate(), N'', NULL, N'Xxl-Job控制台菜单'); +GO +INSERT sys_menu VALUES (500, N'操作日志', 108, 1, N'operlog', N'monitor/operlog/index', N'', 1, 0, N'C', N'0', N'0', N'monitor:operlog:list', N'form', N'admin', getdate(), N'', NULL, N'操作日志菜单') +GO +INSERT sys_menu VALUES (501, N'登录日志', 108, 2, N'logininfor', N'monitor/logininfor/index', N'', 1, 0, N'C', N'0', N'0', N'monitor:logininfor:list', N'logininfor', N'admin', getdate(), N'', NULL, N'登录日志菜单') +GO +INSERT sys_menu VALUES (1001, N'用户查询', 100, 1, N'', N'', N'', 1, 0, N'F', N'0', N'0', N'system:user:query', N'#', N'admin', getdate(), N'', NULL, N'') +GO +INSERT sys_menu VALUES (1002, N'用户新增', 100, 2, N'', N'', N'', 1, 0, N'F', N'0', N'0', N'system:user:add', N'#', N'admin', getdate(), N'', NULL, N'') +GO +INSERT sys_menu VALUES (1003, N'用户修改', 100, 3, N'', N'', N'', 1, 0, N'F', N'0', N'0', N'system:user:edit', N'#', N'admin', getdate(), N'', NULL, N'') +GO +INSERT sys_menu VALUES (1004, N'用户删除', 100, 4, N'', N'', N'', 1, 0, N'F', N'0', N'0', N'system:user:remove', N'#', N'admin', getdate(), N'', NULL, N'') +GO +INSERT sys_menu VALUES (1005, N'用户导出', 100, 5, N'', N'', N'', 1, 0, N'F', N'0', N'0', N'system:user:export', N'#', N'admin', getdate(), N'', NULL, N'') +GO +INSERT sys_menu VALUES (1006, N'用户导入', 100, 6, N'', N'', N'', 1, 0, N'F', N'0', N'0', N'system:user:import', N'#', N'admin', getdate(), N'', NULL, N'') +GO +INSERT sys_menu VALUES (1007, N'重置密码', 100, 7, N'', N'', N'', 1, 0, N'F', N'0', N'0', N'system:user:resetPwd', N'#', N'admin', getdate(), N'', NULL, N'') +GO +INSERT sys_menu VALUES (1008, N'角色查询', 101, 1, N'', N'', N'', 1, 0, N'F', N'0', N'0', N'system:role:query', N'#', N'admin', getdate(), N'', NULL, N'') +GO +INSERT sys_menu VALUES (1009, N'角色新增', 101, 2, N'', N'', N'', 1, 0, N'F', N'0', N'0', N'system:role:add', N'#', N'admin', getdate(), N'', NULL, N'') +GO +INSERT sys_menu VALUES (1010, N'角色修改', 101, 3, N'', N'', N'', 1, 0, N'F', N'0', N'0', N'system:role:edit', N'#', N'admin', getdate(), N'', NULL, N'') +GO +INSERT sys_menu VALUES (1011, N'角色删除', 101, 4, N'', N'', N'', 1, 0, N'F', N'0', N'0', N'system:role:remove', N'#', N'admin', getdate(), N'', NULL, N'') +GO +INSERT sys_menu VALUES (1012, N'角色导出', 101, 5, N'', N'', N'', 1, 0, N'F', N'0', N'0', N'system:role:export', N'#', N'admin', getdate(), N'', NULL, N'') +GO +INSERT sys_menu VALUES (1013, N'菜单查询', 102, 1, N'', N'', N'', 1, 0, N'F', N'0', N'0', N'system:menu:query', N'#', N'admin', getdate(), N'', NULL, N'') +GO +INSERT sys_menu VALUES (1014, N'菜单新增', 102, 2, N'', N'', N'', 1, 0, N'F', N'0', N'0', N'system:menu:add', N'#', N'admin', getdate(), N'', NULL, N'') +GO +INSERT sys_menu VALUES (1015, N'菜单修改', 102, 3, N'', N'', N'', 1, 0, N'F', N'0', N'0', N'system:menu:edit', N'#', N'admin', getdate(), N'', NULL, N'') +GO +INSERT sys_menu VALUES (1016, N'菜单删除', 102, 4, N'', N'', N'', 1, 0, N'F', N'0', N'0', N'system:menu:remove', N'#', N'admin', getdate(), N'', NULL, N'') +GO +INSERT sys_menu VALUES (1017, N'部门查询', 103, 1, N'', N'', N'', 1, 0, N'F', N'0', N'0', N'system:dept:query', N'#', N'admin', getdate(), N'', NULL, N'') +GO +INSERT sys_menu VALUES (1018, N'部门新增', 103, 2, N'', N'', N'', 1, 0, N'F', N'0', N'0', N'system:dept:add', N'#', N'admin', getdate(), N'', NULL, N'') +GO +INSERT sys_menu VALUES (1019, N'部门修改', 103, 3, N'', N'', N'', 1, 0, N'F', N'0', N'0', N'system:dept:edit', N'#', N'admin', getdate(), N'', NULL, N'') +GO +INSERT sys_menu VALUES (1020, N'部门删除', 103, 4, N'', N'', N'', 1, 0, N'F', N'0', N'0', N'system:dept:remove', N'#', N'admin', getdate(), N'', NULL, N'') +GO +INSERT sys_menu VALUES (1021, N'岗位查询', 104, 1, N'', N'', N'', 1, 0, N'F', N'0', N'0', N'system:post:query', N'#', N'admin', getdate(), N'', NULL, N'') +GO +INSERT sys_menu VALUES (1022, N'岗位新增', 104, 2, N'', N'', N'', 1, 0, N'F', N'0', N'0', N'system:post:add', N'#', N'admin', getdate(), N'', NULL, N'') +GO +INSERT sys_menu VALUES (1023, N'岗位修改', 104, 3, N'', N'', N'', 1, 0, N'F', N'0', N'0', N'system:post:edit', N'#', N'admin', getdate(), N'', NULL, N'') +GO +INSERT sys_menu VALUES (1024, N'岗位删除', 104, 4, N'', N'', N'', 1, 0, N'F', N'0', N'0', N'system:post:remove', N'#', N'admin', getdate(), N'', NULL, N'') +GO +INSERT sys_menu VALUES (1025, N'岗位导出', 104, 5, N'', N'', N'', 1, 0, N'F', N'0', N'0', N'system:post:export', N'#', N'admin', getdate(), N'', NULL, N'') +GO +INSERT sys_menu VALUES (1026, N'字典查询', 105, 1, N'#', N'', N'', 1, 0, N'F', N'0', N'0', N'system:dict:query', N'#', N'admin', getdate(), N'', NULL, N'') +GO +INSERT sys_menu VALUES (1027, N'字典新增', 105, 2, N'#', N'', N'', 1, 0, N'F', N'0', N'0', N'system:dict:add', N'#', N'admin', getdate(), N'', NULL, N'') +GO +INSERT sys_menu VALUES (1028, N'字典修改', 105, 3, N'#', N'', N'', 1, 0, N'F', N'0', N'0', N'system:dict:edit', N'#', N'admin', getdate(), N'', NULL, N'') +GO +INSERT sys_menu VALUES (1029, N'字典删除', 105, 4, N'#', N'', N'', 1, 0, N'F', N'0', N'0', N'system:dict:remove', N'#', N'admin', getdate(), N'', NULL, N'') +GO +INSERT sys_menu VALUES (1030, N'字典导出', 105, 5, N'#', N'', N'', 1, 0, N'F', N'0', N'0', N'system:dict:export', N'#', N'admin', getdate(), N'', NULL, N'') +GO +INSERT sys_menu VALUES (1031, N'参数查询', 106, 1, N'#', N'', N'', 1, 0, N'F', N'0', N'0', N'system:config:query', N'#', N'admin', getdate(), N'', NULL, N'') +GO +INSERT sys_menu VALUES (1032, N'参数新增', 106, 2, N'#', N'', N'', 1, 0, N'F', N'0', N'0', N'system:config:add', N'#', N'admin', getdate(), N'', NULL, N'') +GO +INSERT sys_menu VALUES (1033, N'参数修改', 106, 3, N'#', N'', N'', 1, 0, N'F', N'0', N'0', N'system:config:edit', N'#', N'admin', getdate(), N'', NULL, N'') +GO +INSERT sys_menu VALUES (1034, N'参数删除', 106, 4, N'#', N'', N'', 1, 0, N'F', N'0', N'0', N'system:config:remove', N'#', N'admin', getdate(), N'', NULL, N'') +GO +INSERT sys_menu VALUES (1035, N'参数导出', 106, 5, N'#', N'', N'', 1, 0, N'F', N'0', N'0', N'system:config:export', N'#', N'admin', getdate(), N'', NULL, N'') +GO +INSERT sys_menu VALUES (1036, N'公告查询', 107, 1, N'#', N'', N'', 1, 0, N'F', N'0', N'0', N'system:notice:query', N'#', N'admin', getdate(), N'', NULL, N'') +GO +INSERT sys_menu VALUES (1037, N'公告新增', 107, 2, N'#', N'', N'', 1, 0, N'F', N'0', N'0', N'system:notice:add', N'#', N'admin', getdate(), N'', NULL, N'') +GO +INSERT sys_menu VALUES (1038, N'公告修改', 107, 3, N'#', N'', N'', 1, 0, N'F', N'0', N'0', N'system:notice:edit', N'#', N'admin', getdate(), N'', NULL, N'') +GO +INSERT sys_menu VALUES (1039, N'公告删除', 107, 4, N'#', N'', N'', 1, 0, N'F', N'0', N'0', N'system:notice:remove', N'#', N'admin', getdate(), N'', NULL, N'') +GO +INSERT sys_menu VALUES (1040, N'操作查询', 500, 1, N'#', N'', N'', 1, 0, N'F', N'0', N'0', N'monitor:operlog:query', N'#', N'admin', getdate(), N'', NULL, N'') +GO +INSERT sys_menu VALUES (1041, N'操作删除', 500, 2, N'#', N'', N'', 1, 0, N'F', N'0', N'0', N'monitor:operlog:remove', N'#', N'admin', getdate(), N'', NULL, N'') +GO +INSERT sys_menu VALUES (1042, N'日志导出', 500, 4, N'#', N'', N'', 1, 0, N'F', N'0', N'0', N'monitor:operlog:export', N'#', N'admin', getdate(), N'', NULL, N'') +GO +INSERT sys_menu VALUES (1043, N'登录查询', 501, 1, N'#', N'', N'', 1, 0, N'F', N'0', N'0', N'monitor:logininfor:query', N'#', N'admin', getdate(), N'', NULL, N'') +GO +INSERT sys_menu VALUES (1044, N'登录删除', 501, 2, N'#', N'', N'', 1, 0, N'F', N'0', N'0', N'monitor:logininfor:remove', N'#', N'admin', getdate(), N'', NULL, N'') +GO +INSERT sys_menu VALUES (1045, N'日志导出', 501, 3, N'#', N'', N'', 1, 0, N'F', N'0', N'0', N'monitor:logininfor:export', N'#', N'admin', getdate(), N'', NULL, N'') +GO +INSERT sys_menu VALUES (1050, N'账户解锁', 501, 4, N'#', N'', N'', 1, 0, N'F', N'0', N'0', N'monitor:logininfor:unlock', N'#', N'admin', getdate(), N'', null, N'') +GO +INSERT sys_menu VALUES (1046, N'在线查询', 109, 1, N'#', N'', N'', 1, 0, N'F', N'0', N'0', N'monitor:online:query', N'#', N'admin', getdate(), N'', NULL, N'') +GO +INSERT sys_menu VALUES (1047, N'批量强退', 109, 2, N'#', N'', N'', 1, 0, N'F', N'0', N'0', N'monitor:online:batchLogout', N'#', N'admin', getdate(), N'', NULL, N'') +GO +INSERT sys_menu VALUES (1048, N'单条强退', 109, 3, N'#', N'', N'', 1, 0, N'F', N'0', N'0', N'monitor:online:forceLogout', N'#', N'admin', getdate(), N'', NULL, N'') +GO +INSERT sys_menu VALUES (1055, N'生成查询', 115, 1, N'#', N'', N'', 1, 0, N'F', N'0', N'0', N'tool:gen:query', N'#', N'admin', getdate(), N'', NULL, N'') +GO +INSERT sys_menu VALUES (1056, N'生成修改', 115, 2, N'#', N'', N'', 1, 0, N'F', N'0', N'0', N'tool:gen:edit', N'#', N'admin', getdate(), N'', NULL, N'') +GO +INSERT sys_menu VALUES (1057, N'生成删除', 115, 3, N'#', N'', N'', 1, 0, N'F', N'0', N'0', N'tool:gen:remove', N'#', N'admin', getdate(), N'', NULL, N'') +GO +INSERT sys_menu VALUES (1058, N'导入代码', 115, 2, N'#', N'', N'', 1, 0, N'F', N'0', N'0', N'tool:gen:import', N'#', N'admin', getdate(), N'', NULL, N'') +GO +INSERT sys_menu VALUES (1059, N'预览代码', 115, 4, N'#', N'', N'', 1, 0, N'F', N'0', N'0', N'tool:gen:preview', N'#', N'admin', getdate(), N'', NULL, N'') +GO +INSERT sys_menu VALUES (1060, N'生成代码', 115, 5, N'#', N'', N'', 1, 0, N'F', N'0', N'0', N'tool:gen:code', N'#', N'admin', getdate(), N'', NULL, N'') +GO +-- oss相关按钮 +INSERT sys_menu VALUES (1600, N'文件查询', 118, 1, N'#', N'', N'', 1, 0, N'F', N'0', N'0', N'system:oss:query', N'#', N'admin', getdate(), N'', NULL, N''); +GO +INSERT sys_menu VALUES (1601, N'文件上传', 118, 2, N'#', N'', N'', 1, 0, N'F', N'0', N'0', N'system:oss:upload', N'#', N'admin', getdate(), N'', NULL, N''); +GO +INSERT sys_menu VALUES (1602, N'文件下载', 118, 3, N'#', N'', N'', 1, 0, N'F', N'0', N'0', N'system:oss:download', N'#', N'admin', getdate(), N'', NULL, N''); +GO +INSERT sys_menu VALUES (1603, N'文件删除', 118, 4, N'#', N'', N'', 1, 0, N'F', N'0', N'0', N'system:oss:remove', N'#', N'admin', getdate(), N'', NULL, N''); +GO +INSERT sys_menu VALUES (1604, N'配置添加', 118, 5, N'#', N'', N'', 1, 0, N'F', N'0', N'0', N'system:oss:add', N'#', N'admin', getdate(), N'', NULL, N''); +GO +INSERT sys_menu VALUES (1605, N'配置编辑', 118, 6, N'#', N'', N'', 1, 0, N'F', N'0', N'0', N'system:oss:edit', N'#', N'admin', getdate(), N'', NULL, N''); +GO + +CREATE TABLE sys_notice +( + notice_id bigint NOT NULL, + notice_title nvarchar(50) NOT NULL, + notice_type nchar(1) NOT NULL, + notice_content nvarchar(max) NULL, + status nchar(1) DEFAULT ('0') NULL, + create_by nvarchar(64) DEFAULT '' NULL, + create_time datetime2(7) NULL, + update_by nvarchar(64) DEFAULT '' NULL, + update_time datetime2(7) NULL, + remark nvarchar(255) NULL, + CONSTRAINT PK__sys_noti__3E82A5DB0EC94801 PRIMARY KEY CLUSTERED (notice_id) + WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) + ON [PRIMARY] +) +ON [PRIMARY] +TEXTIMAGE_ON [PRIMARY] +GO + +EXEC sys.sp_addextendedproperty + 'MS_Description', N'公告ID' , + 'SCHEMA', N'dbo', + 'TABLE', N'sys_notice', + 'COLUMN', N'notice_id' +GO +EXEC sys.sp_addextendedproperty + 'MS_Description', N'公告标题' , + 'SCHEMA', N'dbo', + 'TABLE', N'sys_notice', + 'COLUMN', N'notice_title' +GO +EXEC sys.sp_addextendedproperty + 'MS_Description', N'公告类型(1通知 2公告)' , + 'SCHEMA', N'dbo', + 'TABLE', N'sys_notice', + 'COLUMN', N'notice_type' +GO +EXEC sys.sp_addextendedproperty + 'MS_Description', N'公告内容' , + 'SCHEMA', N'dbo', + 'TABLE', N'sys_notice', + 'COLUMN', N'notice_content' +GO +EXEC sys.sp_addextendedproperty + 'MS_Description', N'公告状态(0正常 1关闭)' , + 'SCHEMA', N'dbo', + 'TABLE', N'sys_notice', + 'COLUMN', N'status' +GO +EXEC sys.sp_addextendedproperty + 'MS_Description', N'创建者' , + 'SCHEMA', N'dbo', + 'TABLE', N'sys_notice', + 'COLUMN', N'create_by' +GO +EXEC sys.sp_addextendedproperty + 'MS_Description', N'创建时间' , + 'SCHEMA', N'dbo', + 'TABLE', N'sys_notice', + 'COLUMN', N'create_time' +GO +EXEC sys.sp_addextendedproperty + 'MS_Description', N'更新者' , + 'SCHEMA', N'dbo', + 'TABLE', N'sys_notice', + 'COLUMN', N'update_by' +GO +EXEC sys.sp_addextendedproperty + 'MS_Description', N'更新时间' , + 'SCHEMA', N'dbo', + 'TABLE', N'sys_notice', + 'COLUMN', N'update_time' +GO +EXEC sys.sp_addextendedproperty + 'MS_Description', N'备注' , + 'SCHEMA', N'dbo', + 'TABLE', N'sys_notice', + 'COLUMN', N'remark' +GO +EXEC sys.sp_addextendedproperty + 'MS_Description', N'通知公告表' , + 'SCHEMA', N'dbo', + 'TABLE', N'sys_notice' +GO + +INSERT sys_notice VALUES (1, N'温馨提醒:2018-07-01 若依新版本发布啦', N'2', N'新版本内容', N'0', N'admin', getdate(), N'admin', getdate(), N'管理员') +GO +INSERT sys_notice VALUES (2, N'维护通知:2018-07-01 若依系统凌晨维护', N'1', N'维护内容', N'0', N'admin', getdate(), N'admin', getdate(), N'管理员') +GO + +CREATE TABLE sys_oper_log +( + oper_id bigint NOT NULL, + title nvarchar(50) DEFAULT '' NULL, + business_type int DEFAULT ((0)) NULL, + method nvarchar(100) DEFAULT '' NULL, + request_method nvarchar(10) DEFAULT '' NULL, + operator_type int DEFAULT ((0)) NULL, + oper_name nvarchar(50) DEFAULT '' NULL, + dept_name nvarchar(50) DEFAULT '' NULL, + oper_url nvarchar(255) DEFAULT '' NULL, + oper_ip nvarchar(128) DEFAULT '' NULL, + oper_location nvarchar(255) DEFAULT '' NULL, + oper_param nvarchar(2000) DEFAULT '' NULL, + json_result nvarchar(2000) DEFAULT '' NULL, + status int DEFAULT ((0)) NULL, + error_msg nvarchar(2000) DEFAULT '' NULL, + oper_time datetime2(7) NULL, + CONSTRAINT PK__sys_oper__34723BF9BD954573 PRIMARY KEY CLUSTERED (oper_id) + WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) + ON [PRIMARY] +) +ON [PRIMARY] +GO + +CREATE NONCLUSTERED INDEX idx_sys_oper_log_bt ON sys_oper_log (business_type) +GO +CREATE NONCLUSTERED INDEX idx_sys_oper_log_s ON sys_oper_log (status) +GO +CREATE NONCLUSTERED INDEX idx_sys_oper_log_ot ON sys_oper_log (oper_time) +GO + +EXEC sys.sp_addextendedproperty + 'MS_Description', N'日志主键' , + 'SCHEMA', N'dbo', + 'TABLE', N'sys_oper_log', + 'COLUMN', N'oper_id' +GO +EXEC sys.sp_addextendedproperty + 'MS_Description', N'模块标题' , + 'SCHEMA', N'dbo', + 'TABLE', N'sys_oper_log', + 'COLUMN', N'title' +GO +EXEC sys.sp_addextendedproperty + 'MS_Description', N'业务类型(0其它 1新增 2修改 3删除)' , + 'SCHEMA', N'dbo', + 'TABLE', N'sys_oper_log', + 'COLUMN', N'business_type' +GO +EXEC sys.sp_addextendedproperty + 'MS_Description', N'方法名称' , + 'SCHEMA', N'dbo', + 'TABLE', N'sys_oper_log', + 'COLUMN', N'method' +GO +EXEC sys.sp_addextendedproperty + 'MS_Description', N'请求方式' , + 'SCHEMA', N'dbo', + 'TABLE', N'sys_oper_log', + 'COLUMN', N'request_method' +GO +EXEC sys.sp_addextendedproperty + 'MS_Description', N'操作类别(0其它 1后台用户 2手机端用户)' , + 'SCHEMA', N'dbo', + 'TABLE', N'sys_oper_log', + 'COLUMN', N'operator_type' +GO +EXEC sys.sp_addextendedproperty + 'MS_Description', N'操作人员' , + 'SCHEMA', N'dbo', + 'TABLE', N'sys_oper_log', + 'COLUMN', N'oper_name' +GO +EXEC sys.sp_addextendedproperty + 'MS_Description', N'部门名称' , + 'SCHEMA', N'dbo', + 'TABLE', N'sys_oper_log', + 'COLUMN', N'dept_name' +GO +EXEC sys.sp_addextendedproperty + 'MS_Description', N'请求URL' , + 'SCHEMA', N'dbo', + 'TABLE', N'sys_oper_log', + 'COLUMN', N'oper_url' +GO +EXEC sys.sp_addextendedproperty + 'MS_Description', N'主机地址' , + 'SCHEMA', N'dbo', + 'TABLE', N'sys_oper_log', + 'COLUMN', N'oper_ip' +GO +EXEC sys.sp_addextendedproperty + 'MS_Description', N'操作地点' , + 'SCHEMA', N'dbo', + 'TABLE', N'sys_oper_log', + 'COLUMN', N'oper_location' +GO +EXEC sys.sp_addextendedproperty + 'MS_Description', N'请求参数' , + 'SCHEMA', N'dbo', + 'TABLE', N'sys_oper_log', + 'COLUMN', N'oper_param' +GO +EXEC sys.sp_addextendedproperty + 'MS_Description', N'返回参数' , + 'SCHEMA', N'dbo', + 'TABLE', N'sys_oper_log', + 'COLUMN', N'json_result' +GO +EXEC sys.sp_addextendedproperty + 'MS_Description', N'操作状态(0正常 1异常)' , + 'SCHEMA', N'dbo', + 'TABLE', N'sys_oper_log', + 'COLUMN', N'status' +GO +EXEC sys.sp_addextendedproperty + 'MS_Description', N'错误消息' , + 'SCHEMA', N'dbo', + 'TABLE', N'sys_oper_log', + 'COLUMN', N'error_msg' +GO +EXEC sys.sp_addextendedproperty + 'MS_Description', N'操作时间' , + 'SCHEMA', N'dbo', + 'TABLE', N'sys_oper_log', + 'COLUMN', N'oper_time' +GO +EXEC sys.sp_addextendedproperty + 'MS_Description', N'操作日志记录' , + 'SCHEMA', N'dbo', + 'TABLE', N'sys_oper_log' +GO + +CREATE TABLE sys_post +( + post_id bigint NOT NULL, + post_code nvarchar(64) NOT NULL, + post_name nvarchar(50) NOT NULL, + post_sort int NOT NULL, + status nchar(1) NOT NULL, + create_by nvarchar(64) DEFAULT '' NULL, + create_time datetime2(7) NULL, + update_by nvarchar(64) DEFAULT '' NULL, + update_time datetime2(7) NULL, + remark nvarchar(500) NULL, + CONSTRAINT PK__sys_post__3ED7876668E2D081 PRIMARY KEY CLUSTERED (post_id) + WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) + ON [PRIMARY] +) +ON [PRIMARY] +GO + +EXEC sys.sp_addextendedproperty + 'MS_Description', N'岗位ID' , + 'SCHEMA', N'dbo', + 'TABLE', N'sys_post', + 'COLUMN', N'post_id' +GO +EXEC sys.sp_addextendedproperty + 'MS_Description', N'岗位编码' , + 'SCHEMA', N'dbo', + 'TABLE', N'sys_post', + 'COLUMN', N'post_code' +GO +EXEC sys.sp_addextendedproperty + 'MS_Description', N'岗位名称' , + 'SCHEMA', N'dbo', + 'TABLE', N'sys_post', + 'COLUMN', N'post_name' +GO +EXEC sys.sp_addextendedproperty + 'MS_Description', N'显示顺序' , + 'SCHEMA', N'dbo', + 'TABLE', N'sys_post', + 'COLUMN', N'post_sort' +GO +EXEC sys.sp_addextendedproperty + 'MS_Description', N'状态(0正常 1停用)' , + 'SCHEMA', N'dbo', + 'TABLE', N'sys_post', + 'COLUMN', N'status' +GO +EXEC sys.sp_addextendedproperty + 'MS_Description', N'创建者' , + 'SCHEMA', N'dbo', + 'TABLE', N'sys_post', + 'COLUMN', N'create_by' +GO +EXEC sys.sp_addextendedproperty + 'MS_Description', N'创建时间' , + 'SCHEMA', N'dbo', + 'TABLE', N'sys_post', + 'COLUMN', N'create_time' +GO +EXEC sys.sp_addextendedproperty + 'MS_Description', N'更新者' , + 'SCHEMA', N'dbo', + 'TABLE', N'sys_post', + 'COLUMN', N'update_by' +GO +EXEC sys.sp_addextendedproperty + 'MS_Description', N'更新时间' , + 'SCHEMA', N'dbo', + 'TABLE', N'sys_post', + 'COLUMN', N'update_time' +GO +EXEC sys.sp_addextendedproperty + 'MS_Description', N'备注' , + 'SCHEMA', N'dbo', + 'TABLE', N'sys_post', + 'COLUMN', N'remark' +GO +EXEC sys.sp_addextendedproperty + 'MS_Description', N'岗位信息表' , + 'SCHEMA', N'dbo', + 'TABLE', N'sys_post' +GO + +INSERT sys_post VALUES (1, N'ceo', N'董事长', 1, N'0', N'admin', getdate(), N'', NULL, N'') +GO +INSERT sys_post VALUES (2, N'se', N'项目经理', 2, N'0', N'admin', getdate(), N'', NULL, N'') +GO +INSERT sys_post VALUES (3, N'hr', N'人力资源', 3, N'0', N'admin', getdate(), N'', NULL, N'') +GO +INSERT sys_post VALUES (4, N'user', N'普通员工', 4, N'0', N'admin', getdate(), N'', NULL, N'') +GO + +CREATE TABLE sys_role +( + role_id bigint NOT NULL, + role_name nvarchar(30) NOT NULL, + role_key nvarchar(100) NOT NULL, + role_sort int NOT NULL, + data_scope nchar(1) DEFAULT ('1') NULL, + menu_check_strictly tinyint DEFAULT ((1)) NULL, + dept_check_strictly tinyint DEFAULT ((1)) NULL, + status nchar(1) NOT NULL, + del_flag nchar(1) DEFAULT ('0') NULL, + create_by nvarchar(64) DEFAULT '' NULL, + create_time datetime2(7) NULL, + update_by nvarchar(64) DEFAULT '' NULL, + update_time datetime2(7) NULL, + remark nvarchar(500) NULL, + CONSTRAINT PK__sys_role__760965CCF9383145 PRIMARY KEY CLUSTERED (role_id) + WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) + ON [PRIMARY] +) +ON [PRIMARY] +GO + +EXEC sys.sp_addextendedproperty + 'MS_Description', N'角色ID' , + 'SCHEMA', N'dbo', + 'TABLE', N'sys_role', + 'COLUMN', N'role_id' +GO +EXEC sys.sp_addextendedproperty + 'MS_Description', N'角色名称' , + 'SCHEMA', N'dbo', + 'TABLE', N'sys_role', + 'COLUMN', N'role_name' +GO +EXEC sys.sp_addextendedproperty + 'MS_Description', N'角色权限字符串' , + 'SCHEMA', N'dbo', + 'TABLE', N'sys_role', + 'COLUMN', N'role_key' +GO +EXEC sys.sp_addextendedproperty + 'MS_Description', N'显示顺序' , + 'SCHEMA', N'dbo', + 'TABLE', N'sys_role', + 'COLUMN', N'role_sort' +GO +EXEC sys.sp_addextendedproperty + 'MS_Description', N'数据范围(1:全部数据权限 2:自定数据权限 3:本部门数据权限 4:本部门及以下数据权限)' , + 'SCHEMA', N'dbo', + 'TABLE', N'sys_role', + 'COLUMN', N'data_scope' +GO +EXEC sys.sp_addextendedproperty + 'MS_Description', N'菜单树选择项是否关联显示' , + 'SCHEMA', N'dbo', + 'TABLE', N'sys_role', + 'COLUMN', N'menu_check_strictly' +GO +EXEC sys.sp_addextendedproperty + 'MS_Description', N'部门树选择项是否关联显示' , + 'SCHEMA', N'dbo', + 'TABLE', N'sys_role', + 'COLUMN', N'dept_check_strictly' +GO +EXEC sys.sp_addextendedproperty + 'MS_Description', N'角色状态(0正常 1停用)' , + 'SCHEMA', N'dbo', + 'TABLE', N'sys_role', + 'COLUMN', N'status' +GO +EXEC sys.sp_addextendedproperty + 'MS_Description', N'删除标志(0代表存在 2代表删除)' , + 'SCHEMA', N'dbo', + 'TABLE', N'sys_role', + 'COLUMN', N'del_flag' +GO +EXEC sys.sp_addextendedproperty + 'MS_Description', N'创建者' , + 'SCHEMA', N'dbo', + 'TABLE', N'sys_role', + 'COLUMN', N'create_by' +GO +EXEC sys.sp_addextendedproperty + 'MS_Description', N'创建时间' , + 'SCHEMA', N'dbo', + 'TABLE', N'sys_role', + 'COLUMN', N'create_time' +GO +EXEC sys.sp_addextendedproperty + 'MS_Description', N'更新者' , + 'SCHEMA', N'dbo', + 'TABLE', N'sys_role', + 'COLUMN', N'update_by' +GO +EXEC sys.sp_addextendedproperty + 'MS_Description', N'更新时间' , + 'SCHEMA', N'dbo', + 'TABLE', N'sys_role', + 'COLUMN', N'update_time' +GO +EXEC sys.sp_addextendedproperty + 'MS_Description', N'备注' , + 'SCHEMA', N'dbo', + 'TABLE', N'sys_role', + 'COLUMN', N'remark' +GO +EXEC sys.sp_addextendedproperty + 'MS_Description', N'角色信息表' , + 'SCHEMA', N'dbo', + 'TABLE', N'sys_role' +GO + +INSERT sys_role VALUES (1, N'超级管理员', N'admin', 1, N'1', 1, 1, N'0', N'0', N'admin', getdate(), N'', NULL, N'超级管理员') +GO +INSERT sys_role VALUES (2, N'普通角色', N'common', 2, N'2', 1, 1, N'0', N'0', N'admin', getdate(), N'', NULL, N'普通角色') +GO + +CREATE TABLE sys_role_dept +( + role_id bigint NOT NULL, + dept_id bigint NOT NULL, + CONSTRAINT PK__sys_role__2BC3005BABBCA08A PRIMARY KEY CLUSTERED (role_id, dept_id) + WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) + ON [PRIMARY] +) +ON [PRIMARY] +GO + +EXEC sys.sp_addextendedproperty + 'MS_Description', N'角色ID' , + 'SCHEMA', N'dbo', + 'TABLE', N'sys_role_dept', + 'COLUMN', N'role_id' +GO +EXEC sys.sp_addextendedproperty + 'MS_Description', N'部门ID' , + 'SCHEMA', N'dbo', + 'TABLE', N'sys_role_dept', + 'COLUMN', N'dept_id' +GO +EXEC sys.sp_addextendedproperty + 'MS_Description', N'角色和部门关联表' , + 'SCHEMA', N'dbo', + 'TABLE', N'sys_role_dept' +GO + +INSERT sys_role_dept VALUES (2, 100) +GO +INSERT sys_role_dept VALUES (2, 101) +GO +INSERT sys_role_dept VALUES (2, 105) +GO + +CREATE TABLE sys_role_menu +( + role_id bigint NOT NULL, + menu_id bigint NOT NULL, + CONSTRAINT PK__sys_role__A2C36A6187BA4B17 PRIMARY KEY CLUSTERED (role_id, menu_id) + WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) + ON [PRIMARY] +) +ON [PRIMARY] +GO + +EXEC sys.sp_addextendedproperty + 'MS_Description', N'角色ID' , + 'SCHEMA', N'dbo', + 'TABLE', N'sys_role_menu', + 'COLUMN', N'role_id' +GO +EXEC sys.sp_addextendedproperty + 'MS_Description', N'菜单ID' , + 'SCHEMA', N'dbo', + 'TABLE', N'sys_role_menu', + 'COLUMN', N'menu_id' +GO +EXEC sys.sp_addextendedproperty + 'MS_Description', N'角色和菜单关联表' , + 'SCHEMA', N'dbo', + 'TABLE', N'sys_role_menu' +GO + +INSERT sys_role_menu VALUES (2, 1) +GO +INSERT sys_role_menu VALUES (2, 2) +GO +INSERT sys_role_menu VALUES (2, 3) +GO +INSERT sys_role_menu VALUES (2, 100) +GO +INSERT sys_role_menu VALUES (2, 101) +GO +INSERT sys_role_menu VALUES (2, 102) +GO +INSERT sys_role_menu VALUES (2, 103) +GO +INSERT sys_role_menu VALUES (2, 104) +GO +INSERT sys_role_menu VALUES (2, 105) +GO +INSERT sys_role_menu VALUES (2, 106) +GO +INSERT sys_role_menu VALUES (2, 107) +GO +INSERT sys_role_menu VALUES (2, 108) +GO +INSERT sys_role_menu VALUES (2, 109) +GO +INSERT sys_role_menu VALUES (2, 110) +GO +INSERT sys_role_menu VALUES (2, 111) +GO +INSERT sys_role_menu VALUES (2, 112) +GO +INSERT sys_role_menu VALUES (2, 113) +GO +INSERT sys_role_menu VALUES (2, 114) +GO +INSERT sys_role_menu VALUES (2, 115) +GO +INSERT sys_role_menu VALUES (2, 116) +GO +INSERT sys_role_menu VALUES (2, 500) +GO +INSERT sys_role_menu VALUES (2, 501) +GO +INSERT sys_role_menu VALUES (2, 1001) +GO +INSERT sys_role_menu VALUES (2, 1002) +GO +INSERT sys_role_menu VALUES (2, 1003) +GO +INSERT sys_role_menu VALUES (2, 1004) +GO +INSERT sys_role_menu VALUES (2, 1005) +GO +INSERT sys_role_menu VALUES (2, 1006) +GO +INSERT sys_role_menu VALUES (2, 1007) +GO +INSERT sys_role_menu VALUES (2, 1008) +GO +INSERT sys_role_menu VALUES (2, 1009) +GO +INSERT sys_role_menu VALUES (2, 1010) +GO +INSERT sys_role_menu VALUES (2, 1011) +GO +INSERT sys_role_menu VALUES (2, 1012) +GO +INSERT sys_role_menu VALUES (2, 1013) +GO +INSERT sys_role_menu VALUES (2, 1014) +GO +INSERT sys_role_menu VALUES (2, 1015) +GO +INSERT sys_role_menu VALUES (2, 1016) +GO +INSERT sys_role_menu VALUES (2, 1017) +GO +INSERT sys_role_menu VALUES (2, 1018) +GO +INSERT sys_role_menu VALUES (2, 1019) +GO +INSERT sys_role_menu VALUES (2, 1020) +GO +INSERT sys_role_menu VALUES (2, 1021) +GO +INSERT sys_role_menu VALUES (2, 1022) +GO +INSERT sys_role_menu VALUES (2, 1023) +GO +INSERT sys_role_menu VALUES (2, 1024) +GO +INSERT sys_role_menu VALUES (2, 1025) +GO +INSERT sys_role_menu VALUES (2, 1026) +GO +INSERT sys_role_menu VALUES (2, 1027) +GO +INSERT sys_role_menu VALUES (2, 1028) +GO +INSERT sys_role_menu VALUES (2, 1029) +GO +INSERT sys_role_menu VALUES (2, 1030) +GO +INSERT sys_role_menu VALUES (2, 1031) +GO +INSERT sys_role_menu VALUES (2, 1032) +GO +INSERT sys_role_menu VALUES (2, 1033) +GO +INSERT sys_role_menu VALUES (2, 1034) +GO +INSERT sys_role_menu VALUES (2, 1035) +GO +INSERT sys_role_menu VALUES (2, 1036) +GO +INSERT sys_role_menu VALUES (2, 1037) +GO +INSERT sys_role_menu VALUES (2, 1038) +GO +INSERT sys_role_menu VALUES (2, 1039) +GO +INSERT sys_role_menu VALUES (2, 1040) +GO +INSERT sys_role_menu VALUES (2, 1041) +GO +INSERT sys_role_menu VALUES (2, 1042) +GO +INSERT sys_role_menu VALUES (2, 1043) +GO +INSERT sys_role_menu VALUES (2, 1044) +GO +INSERT sys_role_menu VALUES (2, 1045) +GO +INSERT sys_role_menu VALUES (2, 1046) +GO +INSERT sys_role_menu VALUES (2, 1047) +GO +INSERT sys_role_menu VALUES (2, 1048) +GO +INSERT sys_role_menu VALUES (2, 1049) +GO +INSERT sys_role_menu VALUES (2, 1050) +GO +INSERT sys_role_menu VALUES (2, 1051) +GO +INSERT sys_role_menu VALUES (2, 1052) +GO +INSERT sys_role_menu VALUES (2, 1053) +GO +INSERT sys_role_menu VALUES (2, 1054) +GO +INSERT sys_role_menu VALUES (2, 1055) +GO +INSERT sys_role_menu VALUES (2, 1056) +GO +INSERT sys_role_menu VALUES (2, 1057) +GO +INSERT sys_role_menu VALUES (2, 1058) +GO +INSERT sys_role_menu VALUES (2, 1059) +GO +INSERT sys_role_menu VALUES (2, 1060) +GO + +CREATE TABLE sys_user +( + user_id bigint NOT NULL, + dept_id bigint NULL, + user_name nvarchar(30) NOT NULL, + nick_name nvarchar(30) NOT NULL, + user_type nvarchar(10) DEFAULT ('sys_user') NULL, + email nvarchar(50) DEFAULT '' NULL, + phonenumber nvarchar(11) DEFAULT '' NULL, + sex nchar(1) DEFAULT ('0') NULL, + avatar nvarchar(100) DEFAULT '' NULL, + password nvarchar(100) DEFAULT '' NULL, + status nchar(1) DEFAULT ('0') NULL, + del_flag nchar(1) DEFAULT ('0') NULL, + login_ip nvarchar(128) DEFAULT '' NULL, + login_date datetime2(7) NULL, + create_by nvarchar(64) DEFAULT '' NULL, + create_time datetime2(7) NULL, + update_by nvarchar(64) DEFAULT '' NULL, + update_time datetime2(7) NULL, + remark nvarchar(500) NULL, + CONSTRAINT PK__sys_user__B9BE370F79170B6A PRIMARY KEY CLUSTERED (user_id) + WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) + ON [PRIMARY] +) +ON [PRIMARY] +GO + +EXEC sys.sp_addextendedproperty + 'MS_Description', N'用户ID' , + 'SCHEMA', N'dbo', + 'TABLE', N'sys_user', + 'COLUMN', N'user_id' +GO +EXEC sys.sp_addextendedproperty + 'MS_Description', N'部门ID' , + 'SCHEMA', N'dbo', + 'TABLE', N'sys_user', + 'COLUMN', N'dept_id' +GO +EXEC sys.sp_addextendedproperty + 'MS_Description', N'用户账号' , + 'SCHEMA', N'dbo', + 'TABLE', N'sys_user', + 'COLUMN', N'user_name' +GO +EXEC sys.sp_addextendedproperty + 'MS_Description', N'用户昵称' , + 'SCHEMA', N'dbo', + 'TABLE', N'sys_user', + 'COLUMN', N'nick_name' +GO +EXEC sys.sp_addextendedproperty + 'MS_Description', N'用户类型(sys_user系统用户)' , + 'SCHEMA', N'dbo', + 'TABLE', N'sys_user', + 'COLUMN', N'user_type' +GO +EXEC sys.sp_addextendedproperty + 'MS_Description', N'用户邮箱' , + 'SCHEMA', N'dbo', + 'TABLE', N'sys_user', + 'COLUMN', N'email' +GO +EXEC sys.sp_addextendedproperty + 'MS_Description', N'手机号码' , + 'SCHEMA', N'dbo', + 'TABLE', N'sys_user', + 'COLUMN', N'phonenumber' +GO +EXEC sys.sp_addextendedproperty + 'MS_Description', N'用户性别(0男 1女 2未知)' , + 'SCHEMA', N'dbo', + 'TABLE', N'sys_user', + 'COLUMN', N'sex' +GO +EXEC sys.sp_addextendedproperty + 'MS_Description', N'头像地址' , + 'SCHEMA', N'dbo', + 'TABLE', N'sys_user', + 'COLUMN', N'avatar' +GO +EXEC sys.sp_addextendedproperty + 'MS_Description', N'密码' , + 'SCHEMA', N'dbo', + 'TABLE', N'sys_user', + 'COLUMN', N'password' +GO +EXEC sys.sp_addextendedproperty + 'MS_Description', N'帐号状态(0正常 1停用)' , + 'SCHEMA', N'dbo', + 'TABLE', N'sys_user', + 'COLUMN', N'status' +GO +EXEC sys.sp_addextendedproperty + 'MS_Description', N'删除标志(0代表存在 2代表删除)' , + 'SCHEMA', N'dbo', + 'TABLE', N'sys_user', + 'COLUMN', N'del_flag' +GO +EXEC sys.sp_addextendedproperty + 'MS_Description', N'最后登录IP' , + 'SCHEMA', N'dbo', + 'TABLE', N'sys_user', + 'COLUMN', N'login_ip' +GO +EXEC sys.sp_addextendedproperty + 'MS_Description', N'最后登录时间' , + 'SCHEMA', N'dbo', + 'TABLE', N'sys_user', + 'COLUMN', N'login_date' +GO +EXEC sys.sp_addextendedproperty + 'MS_Description', N'创建者' , + 'SCHEMA', N'dbo', + 'TABLE', N'sys_user', + 'COLUMN', N'create_by' +GO +EXEC sys.sp_addextendedproperty + 'MS_Description', N'创建时间' , + 'SCHEMA', N'dbo', + 'TABLE', N'sys_user', + 'COLUMN', N'create_time' +GO +EXEC sys.sp_addextendedproperty + 'MS_Description', N'更新者' , + 'SCHEMA', N'dbo', + 'TABLE', N'sys_user', + 'COLUMN', N'update_by' +GO +EXEC sys.sp_addextendedproperty + 'MS_Description', N'更新时间' , + 'SCHEMA', N'dbo', + 'TABLE', N'sys_user', + 'COLUMN', N'update_time' +GO +EXEC sys.sp_addextendedproperty + 'MS_Description', N'备注' , + 'SCHEMA', N'dbo', + 'TABLE', N'sys_user', + 'COLUMN', N'remark' +GO +EXEC sys.sp_addextendedproperty + 'MS_Description', N'用户信息表' , + 'SCHEMA', N'dbo', + 'TABLE', N'sys_user' +GO + +INSERT sys_user VALUES (1, 103, N'admin', N'疯狂的狮子Li', N'sys_user', N'crazyLionLi@163.com', N'15888888888', N'1', N'', N'$2a$10$7JB720yubVSZvUI0rEqK/.VqGOZTH.ulu33dHOiBE8ByOhJIrdAu2', N'0', N'0', N'127.0.0.1', getdate(), N'admin', getdate(), N'', getdate(), N'管理员') +GO +INSERT sys_user VALUES (2, 105, N'lionli', N'疯狂的狮子Li', N'sys_user', N'crazyLionLi@qq.com', N'15666666666', N'1', N'', N'$2a$10$7JB720yubVSZvUI0rEqK/.VqGOZTH.ulu33dHOiBE8ByOhJIrdAu2', N'0', N'0', N'127.0.0.1', getdate(), N'admin', getdate(), N'admin', getdate(), N'测试员') +GO + +CREATE TABLE sys_user_post +( + user_id bigint NOT NULL, + post_id bigint NOT NULL, + CONSTRAINT PK__sys_user__CA534F799C04589B PRIMARY KEY CLUSTERED (user_id, post_id) + WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) + ON [PRIMARY] +) +ON [PRIMARY] +GO + +EXEC sys.sp_addextendedproperty + 'MS_Description', N'用户ID' , + 'SCHEMA', N'dbo', + 'TABLE', N'sys_user_post', + 'COLUMN', N'user_id' +GO +EXEC sys.sp_addextendedproperty + 'MS_Description', N'岗位ID' , + 'SCHEMA', N'dbo', + 'TABLE', N'sys_user_post', + 'COLUMN', N'post_id' +GO +EXEC sys.sp_addextendedproperty + 'MS_Description', N'用户与岗位关联表' , + 'SCHEMA', N'dbo', + 'TABLE', N'sys_user_post' +GO + +INSERT sys_user_post VALUES (1, 1) +GO +INSERT sys_user_post VALUES (2, 2) +GO + +CREATE TABLE sys_user_role +( + user_id bigint NOT NULL, + role_id bigint NOT NULL, + CONSTRAINT PK__sys_user__6EDEA153FB34D8F0 PRIMARY KEY CLUSTERED (user_id, role_id) + WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) + ON [PRIMARY] +) +ON [PRIMARY] +GO + +EXEC sys.sp_addextendedproperty + 'MS_Description', N'用户ID' , + 'SCHEMA', N'dbo', + 'TABLE', N'sys_user_role', + 'COLUMN', N'user_id' +GO +EXEC sys.sp_addextendedproperty + 'MS_Description', N'角色ID' , + 'SCHEMA', N'dbo', + 'TABLE', N'sys_user_role', + 'COLUMN', N'role_id' +GO +EXEC sys.sp_addextendedproperty + 'MS_Description', N'用户和角色关联表' , + 'SCHEMA', N'dbo', + 'TABLE', N'sys_user_role' +GO + +INSERT sys_user_role VALUES (1, 1) +GO +INSERT sys_user_role VALUES (2, 2) +GO + +CREATE TABLE sys_oss +( + oss_id bigint NOT NULL, + file_name nvarchar(255) DEFAULT '' NOT NULL, + original_name nvarchar(255) DEFAULT '' NOT NULL, + file_suffix nvarchar(10) DEFAULT '' NOT NULL, + url nvarchar(500) NOT NULL, + create_time datetime2(7) NULL, + create_by nvarchar(64) DEFAULT '' NULL, + update_time datetime2(7) NULL, + update_by nvarchar(64) DEFAULT '' NULL, + service nvarchar(20) DEFAULT ('minio') NOT NULL, + CONSTRAINT PK__sys_oss__91241EA442389F0D PRIMARY KEY CLUSTERED (oss_id) + WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) + ON [PRIMARY] +) +ON [PRIMARY] +GO + +EXEC sp_addextendedproperty + 'MS_Description', N'对象存储主键', + 'SCHEMA', N'dbo', + 'TABLE', N'sys_oss', + 'COLUMN', N'oss_id' +GO +EXEC sp_addextendedproperty + 'MS_Description', N'文件名', + 'SCHEMA', N'dbo', + 'TABLE', N'sys_oss', + 'COLUMN', N'file_name' +GO +EXEC sp_addextendedproperty + 'MS_Description', N'原名', + 'SCHEMA', N'dbo', + 'TABLE', N'sys_oss', + 'COLUMN', N'original_name' +GO +EXEC sp_addextendedproperty + 'MS_Description', N'文件后缀名', + 'SCHEMA', N'dbo', + 'TABLE', N'sys_oss', + 'COLUMN', N'file_suffix' +GO +EXEC sp_addextendedproperty + 'MS_Description', N'URL地址', + 'SCHEMA', N'dbo', + 'TABLE', N'sys_oss', + 'COLUMN', N'url' +GO +EXEC sp_addextendedproperty + 'MS_Description', N'创建时间', + 'SCHEMA', N'dbo', + 'TABLE', N'sys_oss', + 'COLUMN', N'create_time' +GO +EXEC sp_addextendedproperty + 'MS_Description', N'上传人', + 'SCHEMA', N'dbo', + 'TABLE', N'sys_oss', + 'COLUMN', N'create_by' +GO +EXEC sp_addextendedproperty + 'MS_Description', N'更新时间', + 'SCHEMA', N'dbo', + 'TABLE', N'sys_oss', + 'COLUMN', N'update_time' +GO +EXEC sp_addextendedproperty + 'MS_Description', N'更新人', + 'SCHEMA', N'dbo', + 'TABLE', N'sys_oss', + 'COLUMN', N'update_by' +GO +EXEC sp_addextendedproperty + 'MS_Description', N'服务商', + 'SCHEMA', N'dbo', + 'TABLE', N'sys_oss', + 'COLUMN', N'service' +GO +EXEC sp_addextendedproperty + 'MS_Description', N'OSS对象存储表', + 'SCHEMA', N'dbo', + 'TABLE', N'sys_oss' +GO + +CREATE TABLE sys_oss_config +( + oss_config_id bigint NOT NULL, + config_key nvarchar(20) DEFAULT '' NOT NULL, + access_key nvarchar(255) DEFAULT '' NULL, + secret_key nvarchar(255) DEFAULT '' NULL, + bucket_name nvarchar(255) DEFAULT '' NULL, + prefix nvarchar(255) DEFAULT '' NULL, + endpoint nvarchar(255) DEFAULT '' NULL, + domain nvarchar(255) DEFAULT '' NULL, + is_https nchar(1) DEFAULT ('N') NULL, + region nvarchar(255) DEFAULT '' NULL, + access_policy nchar(1) DEFAULT ('1') NOT NULL, + status nchar(1) DEFAULT ('1') NULL, + ext1 nvarchar(255) DEFAULT '' NULL, + create_by nvarchar(64) DEFAULT '' NULL, + create_time datetime2(7) NULL, + update_by nvarchar(64) DEFAULT '' NULL, + update_time datetime2(7) NULL, + remark nvarchar(500) NULL, + CONSTRAINT PK__sys_oss___BFBDE87009ED2882 PRIMARY KEY CLUSTERED (oss_config_id) + WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) + ON [PRIMARY] +) +ON [PRIMARY] +GO + +EXEC sp_addextendedproperty + 'MS_Description', N'主建', + 'SCHEMA', N'dbo', + 'TABLE', N'sys_oss_config', + 'COLUMN', N'oss_config_id' +GO +EXEC sp_addextendedproperty + 'MS_Description', N'配置key', + 'SCHEMA', N'dbo', + 'TABLE', N'sys_oss_config', + 'COLUMN', N'config_key' +GO +EXEC sp_addextendedproperty + 'MS_Description', N'accessKey', + 'SCHEMA', N'dbo', + 'TABLE', N'sys_oss_config', + 'COLUMN', N'access_key' +GO +EXEC sp_addextendedproperty + 'MS_Description', N'秘钥', + 'SCHEMA', N'dbo', + 'TABLE', N'sys_oss_config', + 'COLUMN', N'secret_key' +GO +EXEC sp_addextendedproperty + 'MS_Description', N'桶名称', + 'SCHEMA', N'dbo', + 'TABLE', N'sys_oss_config', + 'COLUMN', N'bucket_name' +GO +EXEC sp_addextendedproperty + 'MS_Description', N'前缀', + 'SCHEMA', N'dbo', + 'TABLE', N'sys_oss_config', + 'COLUMN', N'prefix' +GO +EXEC sp_addextendedproperty + 'MS_Description', N'访问站点', + 'SCHEMA', N'dbo', + 'TABLE', N'sys_oss_config', + 'COLUMN', N'endpoint' +GO +EXEC sp_addextendedproperty + 'MS_Description', N'自定义域名', + 'SCHEMA', N'dbo', + 'TABLE', N'sys_oss_config', + 'COLUMN', N'domain' +GO +EXEC sp_addextendedproperty + 'MS_Description', N'是否https(Y=是,N=否)', + 'SCHEMA', N'dbo', + 'TABLE', N'sys_oss_config', + 'COLUMN', N'is_https' +GO +EXEC sp_addextendedproperty + 'MS_Description', N'域', + 'SCHEMA', N'dbo', + 'TABLE', N'sys_oss_config', + 'COLUMN', N'region' +GO +EXEC sp_addextendedproperty + 'MS_Description', N'桶权限类型(0=private 1=public 2=custom)', + 'SCHEMA', N'dbo', + 'TABLE', N'sys_oss_config', + 'COLUMN', N'access_policy' +GO +EXEC sp_addextendedproperty + 'MS_Description', N'是否默认(0=是,1=否)', + 'SCHEMA', N'dbo', + 'TABLE', N'sys_oss_config', + 'COLUMN', N'status' +GO +EXEC sp_addextendedproperty + 'MS_Description', N'扩展字段', + 'SCHEMA', N'dbo', + 'TABLE', N'sys_oss_config', + 'COLUMN', N'ext1' +GO +EXEC sp_addextendedproperty + 'MS_Description', N'创建者', + 'SCHEMA', N'dbo', + 'TABLE', N'sys_oss_config', + 'COLUMN', N'create_by' +GO +EXEC sp_addextendedproperty + 'MS_Description', N'创建时间', + 'SCHEMA', N'dbo', + 'TABLE', N'sys_oss_config', + 'COLUMN', N'create_time' +GO +EXEC sp_addextendedproperty + 'MS_Description', N'更新者', + 'SCHEMA', N'dbo', + 'TABLE', N'sys_oss_config', + 'COLUMN', N'update_by' +GO +EXEC sp_addextendedproperty + 'MS_Description', N'更新时间', + 'SCHEMA', N'dbo', + 'TABLE', N'sys_oss_config', + 'COLUMN', N'update_time' +GO +EXEC sp_addextendedproperty + 'MS_Description', N'备注', + 'SCHEMA', N'dbo', + 'TABLE', N'sys_oss_config', + 'COLUMN', N'remark' +GO +EXEC sp_addextendedproperty + 'MS_Description', N'对象存储配置表', + 'SCHEMA', N'dbo', + 'TABLE', N'sys_oss_config' +GO + +INSERT INTO sys_oss_config VALUES (N'1', N'minio', N'ruoyi', N'ruoyi123', N'ruoyi', N'', N'127.0.0.1:9000', N'',N'N', N'', N'1', N'0', N'', N'admin', getdate(), N'admin', getdate(), NULL) +GO +INSERT INTO sys_oss_config VALUES (N'2', N'qiniu', N'XXXXXXXXXXXXXXXX', N'XXXXXXXXXXXXXXX', N'ruoyi', N'', N's3-cn-north-1.qiniucs.com', N'',N'N', N'', N'1', N'1', N'', N'admin', getdate(), N'admin', getdate(), NULL) +GO +INSERT INTO sys_oss_config VALUES (N'3', N'aliyun', N'XXXXXXXXXXXXXXX', N'XXXXXXXXXXXXXXX', N'ruoyi', N'', N'oss-cn-beijing.aliyuncs.com', N'',N'N', N'', N'1', N'1', N'', N'admin', getdate(), N'admin', getdate(), NULL) +GO +INSERT INTO sys_oss_config VALUES (N'4', N'qcloud', N'XXXXXXXXXXXXXXX', N'XXXXXXXXXXXXXXX', N'ruoyi-1250000000', N'', N'cos.ap-beijing.myqcloud.com', N'',N'N', N'ap-beijing', N'1', N'1', N'', N'admin', getdate(), N'admin', getdate(), NULL) +GO +INSERT INTO sys_oss_config VALUES (N'5', N'image', N'ruoyi', N'ruoyi123', N'ruoyi', N'image', N'127.0.0.1:9000', N'',N'N', N'', N'1', N'1', N'', N'admin', getdate(), N'admin', getdate(), NULL) +GO diff --git a/script/sql/sqlserver/sqlserver_test.sql b/script/sql/sqlserver/sqlserver_test.sql new file mode 100644 index 0000000..234eab7 --- /dev/null +++ b/script/sql/sqlserver/sqlserver_test.sql @@ -0,0 +1,478 @@ +CREATE TABLE test_demo +( + id bigint NOT NULL, + dept_id bigint NULL, + user_id bigint NULL, + order_num int DEFAULT ((0)) NULL, + test_key nvarchar(255) NULL, + value nvarchar(255) NULL, + version int DEFAULT ((0)) NULL, + create_time datetime2(0) NULL, + create_by nvarchar(64) NULL, + update_time datetime2(0) NULL, + update_by nvarchar(64) NULL, + del_flag int DEFAULT ((0)) NULL, + CONSTRAINT PK__test_dem__3213E83F176051C8 PRIMARY KEY CLUSTERED (id) + WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) + ON [PRIMARY] +) +ON [PRIMARY] +GO + +EXEC sp_addextendedproperty + 'MS_Description', N'主键', + 'SCHEMA', N'dbo', + 'TABLE', N'test_demo', + 'COLUMN', N'id' +GO + +EXEC sp_addextendedproperty + 'MS_Description', N'部门id', + 'SCHEMA', N'dbo', + 'TABLE', N'test_demo', + 'COLUMN', N'dept_id' +GO + +EXEC sp_addextendedproperty + 'MS_Description', N'用户id', + 'SCHEMA', N'dbo', + 'TABLE', N'test_demo', + 'COLUMN', N'user_id' +GO + +EXEC sp_addextendedproperty + 'MS_Description', N'排序号', + 'SCHEMA', N'dbo', + 'TABLE', N'test_demo', + 'COLUMN', N'order_num' +GO + +EXEC sp_addextendedproperty + 'MS_Description', N'key键', + 'SCHEMA', N'dbo', + 'TABLE', N'test_demo', + 'COLUMN', N'test_key' +GO + +EXEC sp_addextendedproperty + 'MS_Description', N'值', + 'SCHEMA', N'dbo', + 'TABLE', N'test_demo', + 'COLUMN', N'value' +GO + +EXEC sp_addextendedproperty + 'MS_Description', N'版本', + 'SCHEMA', N'dbo', + 'TABLE', N'test_demo', + 'COLUMN', N'version' +GO + +EXEC sp_addextendedproperty + 'MS_Description', N'创建时间', + 'SCHEMA', N'dbo', + 'TABLE', N'test_demo', + 'COLUMN', N'create_time' +GO + +EXEC sp_addextendedproperty + 'MS_Description', N'创建人', + 'SCHEMA', N'dbo', + 'TABLE', N'test_demo', + 'COLUMN', N'create_by' +GO + +EXEC sp_addextendedproperty + 'MS_Description', N'更新时间', + 'SCHEMA', N'dbo', + 'TABLE', N'test_demo', + 'COLUMN', N'update_time' +GO + +EXEC sp_addextendedproperty + 'MS_Description', N'更新人', + 'SCHEMA', N'dbo', + 'TABLE', N'test_demo', + 'COLUMN', N'update_by' +GO + +EXEC sp_addextendedproperty + 'MS_Description', N'删除标志', + 'SCHEMA', N'dbo', + 'TABLE', N'test_demo', + 'COLUMN', N'del_flag' +GO + +EXEC sp_addextendedproperty + 'MS_Description', N'测试单表', + 'SCHEMA', N'dbo', + 'TABLE', N'test_demo' +GO + +CREATE TABLE test_tree +( + id bigint NOT NULL, + parent_id bigint DEFAULT ((0)) NULL, + dept_id bigint NULL, + user_id bigint NULL, + tree_name nvarchar(255) NULL, + version int DEFAULT ((0)) NULL, + create_time datetime2(0) NULL, + create_by nvarchar(64) NULL, + update_time datetime2(0) NULL, + update_by nvarchar(64) NULL, + del_flag int DEFAULT ((0)) NULL, + CONSTRAINT PK__test_tre__3213E83FC75A1B63 PRIMARY KEY CLUSTERED (id) + WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) + ON [PRIMARY] +) +ON [PRIMARY] +GO + +EXEC sp_addextendedproperty + 'MS_Description', N'主键', + 'SCHEMA', N'dbo', + 'TABLE', N'test_tree', + 'COLUMN', N'id' +GO + +EXEC sp_addextendedproperty + 'MS_Description', N'父id', + 'SCHEMA', N'dbo', + 'TABLE', N'test_tree', + 'COLUMN', N'parent_id' +GO + +EXEC sp_addextendedproperty + 'MS_Description', N'部门id', + 'SCHEMA', N'dbo', + 'TABLE', N'test_tree', + 'COLUMN', N'dept_id' +GO + +EXEC sp_addextendedproperty + 'MS_Description', N'用户id', + 'SCHEMA', N'dbo', + 'TABLE', N'test_tree', + 'COLUMN', N'user_id' +GO + +EXEC sp_addextendedproperty + 'MS_Description', N'值', + 'SCHEMA', N'dbo', + 'TABLE', N'test_tree', + 'COLUMN', N'tree_name' +GO + +EXEC sp_addextendedproperty + 'MS_Description', N'版本', + 'SCHEMA', N'dbo', + 'TABLE', N'test_tree', + 'COLUMN', N'version' +GO + +EXEC sp_addextendedproperty + 'MS_Description', N'创建时间', + 'SCHEMA', N'dbo', + 'TABLE', N'test_tree', + 'COLUMN', N'create_time' +GO + +EXEC sp_addextendedproperty + 'MS_Description', N'创建人', + 'SCHEMA', N'dbo', + 'TABLE', N'test_tree', + 'COLUMN', N'create_by' +GO + +EXEC sp_addextendedproperty + 'MS_Description', N'更新时间', + 'SCHEMA', N'dbo', + 'TABLE', N'test_tree', + 'COLUMN', N'update_time' +GO + +EXEC sp_addextendedproperty + 'MS_Description', N'更新人', + 'SCHEMA', N'dbo', + 'TABLE', N'test_tree', + 'COLUMN', N'update_by' +GO + +EXEC sp_addextendedproperty + 'MS_Description', N'删除标志', + 'SCHEMA', N'dbo', + 'TABLE', N'test_tree', + 'COLUMN', N'del_flag' +GO + +EXEC sp_addextendedproperty + 'MS_Description', N'测试树表', + 'SCHEMA', N'dbo', + 'TABLE', N'test_tree' +GO + +INSERT sys_user VALUES (3, 108, N'test', N'本部门及以下 密码666666', N'sys_user', N'', N'', N'0', N'', N'$2a$10$b8yUzN0C71sbz.PhNOCgJe.Tu1yWC3RNrTyjSQ8p1W0.aaUXUJ.Ne', N'0', N'0', N'127.0.0.1', getdate(), N'admin', getdate(), N'test', getdate(), NULL); +GO +INSERT sys_user VALUES (4, 102, N'test1', N'仅本人 密码666666', N'sys_user', N'', N'', N'0', N'', N'$2a$10$b8yUzN0C71sbz.PhNOCgJe.Tu1yWC3RNrTyjSQ8p1W0.aaUXUJ.Ne', N'0', N'0', N'127.0.0.1', getdate(), N'admin', getdate(), N'test1', getdate(), NULL); +GO + +INSERT sys_menu VALUES (5, N'测试菜单', 0, 5, N'demo', NULL, 1, 0, N'M', N'0', N'0', NULL, N'star', N'admin', getdate(), NULL, NULL, N''); +GO + +INSERT sys_menu VALUES (1500, N'测试单表', 5, 1, N'demo', N'demo/demo/index', 1, 0, N'C', N'0', N'0', N'demo:demo:list', N'#', N'admin', getdate(), N'', NULL, N'测试单表菜单'); +GO +INSERT sys_menu VALUES (1501, N'测试单表查询', 1500, 1, N'#', N'', 1, 0, N'F', N'0', N'0', N'demo:demo:query', N'#', N'admin', getdate(), N'', NULL, N''); +GO +INSERT sys_menu VALUES (1502, N'测试单表新增', 1500, 2, N'#', N'', 1, 0, N'F', N'0', N'0', N'demo:demo:add', N'#', N'admin', getdate(), N'', NULL, N''); +GO +INSERT sys_menu VALUES (1503, N'测试单表修改', 1500, 3, N'#', N'', 1, 0, N'F', N'0', N'0', N'demo:demo:edit', N'#', N'admin', getdate(), N'', NULL, N''); +GO +INSERT sys_menu VALUES (1504, N'测试单表删除', 1500, 4, N'#', N'', 1, 0, N'F', N'0', N'0', N'demo:demo:remove', N'#', N'admin', getdate(), N'', NULL, N''); +GO +INSERT sys_menu VALUES (1505, N'测试单表导出', 1500, 5, N'#', N'', 1, 0, N'F', N'0', N'0', N'demo:demo:export', N'#', N'admin', getdate(), N'', NULL, N''); +GO + +INSERT sys_menu VALUES (1506, N'测试树表', 5, 1, N'tree', N'demo/tree/index', 1, 0, N'C', N'0', N'0', N'demo:tree:list', N'#', N'admin', getdate(), N'', NULL, N'测试树表菜单'); +GO +INSERT sys_menu VALUES (1507, N'测试树表查询', 1506, 1, N'#', N'', 1, 0, N'F', N'0', N'0', N'demo:tree:query', N'#', N'admin', getdate(), N'', NULL, N''); +GO +INSERT sys_menu VALUES (1508, N'测试树表新增', 1506, 2, N'#', N'', 1, 0, N'F', N'0', N'0', N'demo:tree:add', N'#', N'admin', getdate(), N'', NULL, N''); +GO +INSERT sys_menu VALUES (1509, N'测试树表修改', 1506, 3, N'#', N'', 1, 0, N'F', N'0', N'0', N'demo:tree:edit', N'#', N'admin', getdate(), N'', NULL, N''); +GO +INSERT sys_menu VALUES (1510, N'测试树表删除', 1506, 4, N'#', N'', 1, 0, N'F', N'0', N'0', N'demo:tree:remove', N'#', N'admin', getdate(), N'', NULL, N''); +GO +INSERT sys_menu VALUES (1511, N'测试树表导出', 1506, 5, N'#', N'', 1, 0, N'F', N'0', N'0', N'demo:tree:export', N'#', N'admin', getdate(), N'', NULL, N''); +GO + +INSERT sys_role VALUES (3, N'本部门及以下', N'test1', 3, N'4', 1, 1, N'0', N'0', N'admin', getdate(), N'admin', NULL, NULL); +GO +INSERT sys_role VALUES (4, N'仅本人', N'test2', 4, N'5', 1, 1, N'0', N'0', N'admin', getdate(), N'admin', NULL, NULL); +GO + +INSERT sys_role_menu VALUES (3, 1); +GO +INSERT sys_role_menu VALUES (3, 5); +GO +INSERT sys_role_menu VALUES (3, 100); +GO +INSERT sys_role_menu VALUES (3, 101); +GO +INSERT sys_role_menu VALUES (3, 102); +GO +INSERT sys_role_menu VALUES (3, 103); +GO +INSERT sys_role_menu VALUES (3, 104); +GO +INSERT sys_role_menu VALUES (3, 105); +GO +INSERT sys_role_menu VALUES (3, 106); +GO +INSERT sys_role_menu VALUES (3, 107); +GO +INSERT sys_role_menu VALUES (3, 108); +GO +INSERT sys_role_menu VALUES (3, 500); +GO +INSERT sys_role_menu VALUES (3, 501); +GO +INSERT sys_role_menu VALUES (3, 1001); +GO +INSERT sys_role_menu VALUES (3, 1002); +GO +INSERT sys_role_menu VALUES (3, 1003); +GO +INSERT sys_role_menu VALUES (3, 1004); +GO +INSERT sys_role_menu VALUES (3, 1005); +GO +INSERT sys_role_menu VALUES (3, 1006); +GO +INSERT sys_role_menu VALUES (3, 1007); +GO +INSERT sys_role_menu VALUES (3, 1008); +GO +INSERT sys_role_menu VALUES (3, 1009); +GO +INSERT sys_role_menu VALUES (3, 1010); +GO +INSERT sys_role_menu VALUES (3, 1011); +GO +INSERT sys_role_menu VALUES (3, 1012); +GO +INSERT sys_role_menu VALUES (3, 1013); +GO +INSERT sys_role_menu VALUES (3, 1014); +GO +INSERT sys_role_menu VALUES (3, 1015); +GO +INSERT sys_role_menu VALUES (3, 1016); +GO +INSERT sys_role_menu VALUES (3, 1017); +GO +INSERT sys_role_menu VALUES (3, 1018); +GO +INSERT sys_role_menu VALUES (3, 1019); +GO +INSERT sys_role_menu VALUES (3, 1020); +GO +INSERT sys_role_menu VALUES (3, 1021); +GO +INSERT sys_role_menu VALUES (3, 1022); +GO +INSERT sys_role_menu VALUES (3, 1023); +GO +INSERT sys_role_menu VALUES (3, 1024); +GO +INSERT sys_role_menu VALUES (3, 1025); +GO +INSERT sys_role_menu VALUES (3, 1026); +GO +INSERT sys_role_menu VALUES (3, 1027); +GO +INSERT sys_role_menu VALUES (3, 1028); +GO +INSERT sys_role_menu VALUES (3, 1029); +GO +INSERT sys_role_menu VALUES (3, 1030); +GO +INSERT sys_role_menu VALUES (3, 1031); +GO +INSERT sys_role_menu VALUES (3, 1032); +GO +INSERT sys_role_menu VALUES (3, 1033); +GO +INSERT sys_role_menu VALUES (3, 1034); +GO +INSERT sys_role_menu VALUES (3, 1035); +GO +INSERT sys_role_menu VALUES (3, 1036); +GO +INSERT sys_role_menu VALUES (3, 1037); +GO +INSERT sys_role_menu VALUES (3, 1038); +GO +INSERT sys_role_menu VALUES (3, 1039); +GO +INSERT sys_role_menu VALUES (3, 1040); +GO +INSERT sys_role_menu VALUES (3, 1041); +GO +INSERT sys_role_menu VALUES (3, 1042); +GO +INSERT sys_role_menu VALUES (3, 1043); +GO +INSERT sys_role_menu VALUES (3, 1044); +GO +INSERT sys_role_menu VALUES (3, 1045); +GO +INSERT sys_role_menu VALUES (3, 1500); +GO +INSERT sys_role_menu VALUES (3, 1501); +GO +INSERT sys_role_menu VALUES (3, 1502); +GO +INSERT sys_role_menu VALUES (3, 1503); +GO +INSERT sys_role_menu VALUES (3, 1504); +GO +INSERT sys_role_menu VALUES (3, 1505); +GO +INSERT sys_role_menu VALUES (3, 1506); +GO +INSERT sys_role_menu VALUES (3, 1507); +GO +INSERT sys_role_menu VALUES (3, 1508); +GO +INSERT sys_role_menu VALUES (3, 1509); +GO +INSERT sys_role_menu VALUES (3, 1510); +GO +INSERT sys_role_menu VALUES (3, 1511); +GO +INSERT sys_role_menu VALUES (4, 5); +GO +INSERT sys_role_menu VALUES (4, 1500); +GO +INSERT sys_role_menu VALUES (4, 1501); +GO +INSERT sys_role_menu VALUES (4, 1502); +GO +INSERT sys_role_menu VALUES (4, 1503); +GO +INSERT sys_role_menu VALUES (4, 1504); +GO +INSERT sys_role_menu VALUES (4, 1505); +GO +INSERT sys_role_menu VALUES (4, 1506); +GO +INSERT sys_role_menu VALUES (4, 1507); +GO +INSERT sys_role_menu VALUES (4, 1508); +GO +INSERT sys_role_menu VALUES (4, 1509); +GO +INSERT sys_role_menu VALUES (4, 1510); +GO +INSERT sys_role_menu VALUES (4, 1511); +GO + +INSERT sys_user_role VALUES (3, 3); +GO +INSERT sys_user_role VALUES (4, 4); +GO + +INSERT test_demo VALUES (1, 102, 4, 1, N'测试数据权限', N'测试', 0, getdate(), N'admin', NULL, NULL, 0); +GO +INSERT test_demo VALUES (2, 102, 3, 2, N'子节点1', N'111', 0, getdate(), N'admin', NULL, NULL, 0); +GO +INSERT test_demo VALUES (3, 102, 3, 3, N'子节点2', N'222', 0, getdate(), N'admin', NULL, NULL, 0); +GO +INSERT test_demo VALUES (4, 108, 4, 4, N'测试数据', N'demo', 0, getdate(), N'admin', NULL, NULL, 0); +GO +INSERT test_demo VALUES (5, 108, 3, 13, N'子节点11', N'1111', 0, getdate(), N'admin', NULL, NULL, 0); +GO +INSERT test_demo VALUES (6, 108, 3, 12, N'子节点22', N'2222', 0, getdate(), N'admin', NULL, NULL, 0); +GO +INSERT test_demo VALUES (7, 108, 3, 11, N'子节点33', N'3333', 0, getdate(), N'admin', NULL, NULL, 0); +GO +INSERT test_demo VALUES (8, 108, 3, 10, N'子节点44', N'4444', 0, getdate(), N'admin', NULL, NULL, 0); +GO +INSERT test_demo VALUES (9, 108, 3, 9, N'子节点55', N'5555', 0, getdate(), N'admin', NULL, NULL, 0); +GO +INSERT test_demo VALUES (10, 108, 3, 8, N'子节点66', N'6666', 0, getdate(), N'admin', NULL, NULL, 0); +GO +INSERT test_demo VALUES (11, 108, 3, 7, N'子节点77', N'7777', 0, getdate(), N'admin', NULL, NULL, 0); +GO +INSERT test_demo VALUES (12, 108, 3, 6, N'子节点88', N'8888', 0, getdate(), N'admin', NULL, NULL, 0); +GO +INSERT test_demo VALUES (13, 108, 3, 5, N'子节点99', N'9999', 0, getdate(), N'admin', NULL, NULL, 0); +GO + +INSERT test_tree VALUES (1, 0, 102, 4, N'测试数据权限', 0, getdate(), N'admin', NULL, NULL, 0); +GO +INSERT test_tree VALUES (2, 1, 102, 3, N'子节点1', 0, getdate(), N'admin', NULL, NULL, 0); +GO +INSERT test_tree VALUES (3, 2, 102, 3, N'子节点2', 0, getdate(), N'admin', NULL, NULL, 0); +GO +INSERT test_tree VALUES (4, 0, 108, 4, N'测试树1', 0, getdate(), N'admin', NULL, NULL, 0); +GO +INSERT test_tree VALUES (5, 4, 108, 3, N'子节点11', 0, getdate(), N'admin', NULL, NULL, 0); +GO +INSERT test_tree VALUES (6, 4, 108, 3, N'子节点22', 0, getdate(), N'admin', NULL, NULL, 0); +GO +INSERT test_tree VALUES (7, 4, 108, 3, N'子节点33', 0, getdate(), N'admin', NULL, NULL, 0); +GO +INSERT test_tree VALUES (8, 5, 108, 3, N'子节点44', 0, getdate(), N'admin', NULL, NULL, 0); +GO +INSERT test_tree VALUES (9, 6, 108, 3, N'子节点55', 0, getdate(), N'admin', NULL, NULL, 0); +GO +INSERT test_tree VALUES (10, 7, 108, 3, N'子节点66', 0, getdate(), N'admin', NULL, NULL, 0); +GO +INSERT test_tree VALUES (11, 7, 108, 3, N'子节点77', 0, getdate(), N'admin', NULL, NULL, 0); +GO +INSERT test_tree VALUES (12, 10, 108, 3, N'子节点88', 0, getdate(), N'admin', NULL, NULL, 0); +GO +INSERT test_tree VALUES (13, 10, 108, 3, N'子节点99', 0, getdate(), N'admin', NULL, NULL, 0); +GO diff --git a/script/sql/test.sql b/script/sql/test.sql new file mode 100644 index 0000000..6232bab --- /dev/null +++ b/script/sql/test.sql @@ -0,0 +1,171 @@ +DROP TABLE if EXISTS test_demo; +CREATE TABLE test_demo +( + id bigint(0) NOT NULL COMMENT '主键', + dept_id bigint(0) NULL DEFAULT NULL COMMENT '部门id', + user_id bigint(0) NULL DEFAULT NULL COMMENT '用户id', + order_num int(0) NULL DEFAULT 0 COMMENT '排序号', + test_key varchar(255) NULL DEFAULT NULL COMMENT 'key键', + value varchar(255) NULL DEFAULT NULL COMMENT '值', + version int(0) NULL DEFAULT 0 COMMENT '版本', + create_time datetime(0) NULL DEFAULT NULL COMMENT '创建时间', + create_by varchar(64) NULL DEFAULT NULL COMMENT '创建人', + update_time datetime(0) NULL DEFAULT NULL COMMENT '更新时间', + update_by varchar(64) NULL DEFAULT NULL COMMENT '更新人', + del_flag int(0) NULL DEFAULT 0 COMMENT '删除标志', + PRIMARY KEY (id) USING BTREE +) ENGINE = InnoDB COMMENT = '测试单表'; + +DROP TABLE if EXISTS test_tree; +CREATE TABLE test_tree +( + id bigint(0) NOT NULL COMMENT '主键', + parent_id bigint(0) NULL DEFAULT 0 COMMENT '父id', + dept_id bigint(0) NULL DEFAULT NULL COMMENT '部门id', + user_id bigint(0) NULL DEFAULT NULL COMMENT '用户id', + tree_name varchar(255) NULL DEFAULT NULL COMMENT '值', + version int(0) NULL DEFAULT 0 COMMENT '版本', + create_time datetime(0) NULL DEFAULT NULL COMMENT '创建时间', + create_by varchar(64) NULL DEFAULT NULL COMMENT '创建人', + update_time datetime(0) NULL DEFAULT NULL COMMENT '更新时间', + update_by varchar(64) NULL DEFAULT NULL COMMENT '更新人', + del_flag int(0) NULL DEFAULT 0 COMMENT '删除标志', + PRIMARY KEY (id) USING BTREE +) ENGINE = InnoDB COMMENT = '测试树表'; + +INSERT INTO sys_user(user_id, dept_id, user_name, nick_name, user_type, email, phonenumber, sex, avatar, password, status, del_flag, login_ip, login_date, create_by, create_time, update_by, update_time, remark) VALUES (3, 108, 'test', '本部门及以下 密码666666', 'sys_user', '', '', '0', '', '$2a$10$b8yUzN0C71sbz.PhNOCgJe.Tu1yWC3RNrTyjSQ8p1W0.aaUXUJ.Ne', '0', '0', '127.0.0.1', sysdate(), 'admin', sysdate(), 'test', sysdate(), NULL); +INSERT INTO sys_user(user_id, dept_id, user_name, nick_name, user_type, email, phonenumber, sex, avatar, password, status, del_flag, login_ip, login_date, create_by, create_time, update_by, update_time, remark) VALUES (4, 102, 'test1', '仅本人 密码666666', 'sys_user', '', '', '0', '', '$2a$10$b8yUzN0C71sbz.PhNOCgJe.Tu1yWC3RNrTyjSQ8p1W0.aaUXUJ.Ne', '0', '0', '127.0.0.1', sysdate(), 'admin', sysdate(), 'test1', sysdate(), NULL); + +INSERT INTO sys_menu(menu_id, menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark) VALUES (5, '测试菜单', 0, 5, 'demo', NULL, 1, 0, 'M', '0', '0', NULL, 'star', 'admin', sysdate(), NULL, NULL, ''); + +INSERT INTO sys_menu(menu_id, menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark) VALUES (1500, '测试单表', 5, 1, 'demo', 'demo/demo/index', 1, 0, 'C', '0', '0', 'demo:demo:list', '#', 'admin', sysdate(), '', NULL, '测试单表菜单'); +INSERT INTO sys_menu(menu_id, menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark) VALUES (1501, '测试单表查询', 1500, 1, '#', '', 1, 0, 'F', '0', '0', 'demo:demo:query', '#', 'admin', sysdate(), '', NULL, ''); +INSERT INTO sys_menu(menu_id, menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark) VALUES (1502, '测试单表新增', 1500, 2, '#', '', 1, 0, 'F', '0', '0', 'demo:demo:add', '#', 'admin', sysdate(), '', NULL, ''); +INSERT INTO sys_menu(menu_id, menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark) VALUES (1503, '测试单表修改', 1500, 3, '#', '', 1, 0, 'F', '0', '0', 'demo:demo:edit', '#', 'admin', sysdate(), '', NULL, ''); +INSERT INTO sys_menu(menu_id, menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark) VALUES (1504, '测试单表删除', 1500, 4, '#', '', 1, 0, 'F', '0', '0', 'demo:demo:remove', '#', 'admin', sysdate(), '', NULL, ''); +INSERT INTO sys_menu(menu_id, menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark) VALUES (1505, '测试单表导出', 1500, 5, '#', '', 1, 0, 'F', '0', '0', 'demo:demo:export', '#', 'admin', sysdate(), '', NULL, ''); + +INSERT INTO sys_menu(menu_id, menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark) VALUES (1506, '测试树表', 5, 1, 'tree', 'demo/tree/index', 1, 0, 'C', '0', '0', 'demo:tree:list', '#', 'admin', sysdate(), '', NULL, '测试树表菜单'); +INSERT INTO sys_menu(menu_id, menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark) VALUES (1507, '测试树表查询', 1506, 1, '#', '', 1, 0, 'F', '0', '0', 'demo:tree:query', '#', 'admin', sysdate(), '', NULL, ''); +INSERT INTO sys_menu(menu_id, menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark) VALUES (1508, '测试树表新增', 1506, 2, '#', '', 1, 0, 'F', '0', '0', 'demo:tree:add', '#', 'admin', sysdate(), '', NULL, ''); +INSERT INTO sys_menu(menu_id, menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark) VALUES (1509, '测试树表修改', 1506, 3, '#', '', 1, 0, 'F', '0', '0', 'demo:tree:edit', '#', 'admin', sysdate(), '', NULL, ''); +INSERT INTO sys_menu(menu_id, menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark) VALUES (1510, '测试树表删除', 1506, 4, '#', '', 1, 0, 'F', '0', '0', 'demo:tree:remove', '#', 'admin', sysdate(), '', NULL, ''); +INSERT INTO sys_menu(menu_id, menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark) VALUES (1511, '测试树表导出', 1506, 5, '#', '', 1, 0, 'F', '0', '0', 'demo:tree:export', '#', 'admin', sysdate(), '', NULL, ''); + +INSERT INTO sys_role(role_id, role_name, role_key, role_sort, data_scope, menu_check_strictly, dept_check_strictly, status, del_flag, create_by, create_time, update_by, update_time, remark) VALUES (3, '本部门及以下', 'test1', 3, '4', 1, 1, '0', '0', 'admin', sysdate(), 'admin', NULL, NULL); +INSERT INTO sys_role(role_id, role_name, role_key, role_sort, data_scope, menu_check_strictly, dept_check_strictly, status, del_flag, create_by, create_time, update_by, update_time, remark) VALUES (4, '仅本人', 'test2', 4, '5', 1, 1, '0', '0', 'admin', sysdate(), 'admin', NULL, NULL); + +INSERT INTO sys_role_menu(role_id, menu_id) VALUES (3, 1); +INSERT INTO sys_role_menu(role_id, menu_id) VALUES (3, 5); +INSERT INTO sys_role_menu(role_id, menu_id) VALUES (3, 100); +INSERT INTO sys_role_menu(role_id, menu_id) VALUES (3, 101); +INSERT INTO sys_role_menu(role_id, menu_id) VALUES (3, 102); +INSERT INTO sys_role_menu(role_id, menu_id) VALUES (3, 103); +INSERT INTO sys_role_menu(role_id, menu_id) VALUES (3, 104); +INSERT INTO sys_role_menu(role_id, menu_id) VALUES (3, 105); +INSERT INTO sys_role_menu(role_id, menu_id) VALUES (3, 106); +INSERT INTO sys_role_menu(role_id, menu_id) VALUES (3, 107); +INSERT INTO sys_role_menu(role_id, menu_id) VALUES (3, 108); +INSERT INTO sys_role_menu(role_id, menu_id) VALUES (3, 500); +INSERT INTO sys_role_menu(role_id, menu_id) VALUES (3, 501); +INSERT INTO sys_role_menu(role_id, menu_id) VALUES (3, 1001); +INSERT INTO sys_role_menu(role_id, menu_id) VALUES (3, 1002); +INSERT INTO sys_role_menu(role_id, menu_id) VALUES (3, 1003); +INSERT INTO sys_role_menu(role_id, menu_id) VALUES (3, 1004); +INSERT INTO sys_role_menu(role_id, menu_id) VALUES (3, 1005); +INSERT INTO sys_role_menu(role_id, menu_id) VALUES (3, 1006); +INSERT INTO sys_role_menu(role_id, menu_id) VALUES (3, 1007); +INSERT INTO sys_role_menu(role_id, menu_id) VALUES (3, 1008); +INSERT INTO sys_role_menu(role_id, menu_id) VALUES (3, 1009); +INSERT INTO sys_role_menu(role_id, menu_id) VALUES (3, 1010); +INSERT INTO sys_role_menu(role_id, menu_id) VALUES (3, 1011); +INSERT INTO sys_role_menu(role_id, menu_id) VALUES (3, 1012); +INSERT INTO sys_role_menu(role_id, menu_id) VALUES (3, 1013); +INSERT INTO sys_role_menu(role_id, menu_id) VALUES (3, 1014); +INSERT INTO sys_role_menu(role_id, menu_id) VALUES (3, 1015); +INSERT INTO sys_role_menu(role_id, menu_id) VALUES (3, 1016); +INSERT INTO sys_role_menu(role_id, menu_id) VALUES (3, 1017); +INSERT INTO sys_role_menu(role_id, menu_id) VALUES (3, 1018); +INSERT INTO sys_role_menu(role_id, menu_id) VALUES (3, 1019); +INSERT INTO sys_role_menu(role_id, menu_id) VALUES (3, 1020); +INSERT INTO sys_role_menu(role_id, menu_id) VALUES (3, 1021); +INSERT INTO sys_role_menu(role_id, menu_id) VALUES (3, 1022); +INSERT INTO sys_role_menu(role_id, menu_id) VALUES (3, 1023); +INSERT INTO sys_role_menu(role_id, menu_id) VALUES (3, 1024); +INSERT INTO sys_role_menu(role_id, menu_id) VALUES (3, 1025); +INSERT INTO sys_role_menu(role_id, menu_id) VALUES (3, 1026); +INSERT INTO sys_role_menu(role_id, menu_id) VALUES (3, 1027); +INSERT INTO sys_role_menu(role_id, menu_id) VALUES (3, 1028); +INSERT INTO sys_role_menu(role_id, menu_id) VALUES (3, 1029); +INSERT INTO sys_role_menu(role_id, menu_id) VALUES (3, 1030); +INSERT INTO sys_role_menu(role_id, menu_id) VALUES (3, 1031); +INSERT INTO sys_role_menu(role_id, menu_id) VALUES (3, 1032); +INSERT INTO sys_role_menu(role_id, menu_id) VALUES (3, 1033); +INSERT INTO sys_role_menu(role_id, menu_id) VALUES (3, 1034); +INSERT INTO sys_role_menu(role_id, menu_id) VALUES (3, 1035); +INSERT INTO sys_role_menu(role_id, menu_id) VALUES (3, 1036); +INSERT INTO sys_role_menu(role_id, menu_id) VALUES (3, 1037); +INSERT INTO sys_role_menu(role_id, menu_id) VALUES (3, 1038); +INSERT INTO sys_role_menu(role_id, menu_id) VALUES (3, 1039); +INSERT INTO sys_role_menu(role_id, menu_id) VALUES (3, 1040); +INSERT INTO sys_role_menu(role_id, menu_id) VALUES (3, 1041); +INSERT INTO sys_role_menu(role_id, menu_id) VALUES (3, 1042); +INSERT INTO sys_role_menu(role_id, menu_id) VALUES (3, 1043); +INSERT INTO sys_role_menu(role_id, menu_id) VALUES (3, 1044); +INSERT INTO sys_role_menu(role_id, menu_id) VALUES (3, 1045); +INSERT INTO sys_role_menu(role_id, menu_id) VALUES (3, 1500); +INSERT INTO sys_role_menu(role_id, menu_id) VALUES (3, 1501); +INSERT INTO sys_role_menu(role_id, menu_id) VALUES (3, 1502); +INSERT INTO sys_role_menu(role_id, menu_id) VALUES (3, 1503); +INSERT INTO sys_role_menu(role_id, menu_id) VALUES (3, 1504); +INSERT INTO sys_role_menu(role_id, menu_id) VALUES (3, 1505); +INSERT INTO sys_role_menu(role_id, menu_id) VALUES (3, 1506); +INSERT INTO sys_role_menu(role_id, menu_id) VALUES (3, 1507); +INSERT INTO sys_role_menu(role_id, menu_id) VALUES (3, 1508); +INSERT INTO sys_role_menu(role_id, menu_id) VALUES (3, 1509); +INSERT INTO sys_role_menu(role_id, menu_id) VALUES (3, 1510); +INSERT INTO sys_role_menu(role_id, menu_id) VALUES (3, 1511); +INSERT INTO sys_role_menu(role_id, menu_id) VALUES (4, 5); +INSERT INTO sys_role_menu(role_id, menu_id) VALUES (4, 1500); +INSERT INTO sys_role_menu(role_id, menu_id) VALUES (4, 1501); +INSERT INTO sys_role_menu(role_id, menu_id) VALUES (4, 1502); +INSERT INTO sys_role_menu(role_id, menu_id) VALUES (4, 1503); +INSERT INTO sys_role_menu(role_id, menu_id) VALUES (4, 1504); +INSERT INTO sys_role_menu(role_id, menu_id) VALUES (4, 1505); +INSERT INTO sys_role_menu(role_id, menu_id) VALUES (4, 1506); +INSERT INTO sys_role_menu(role_id, menu_id) VALUES (4, 1507); +INSERT INTO sys_role_menu(role_id, menu_id) VALUES (4, 1508); +INSERT INTO sys_role_menu(role_id, menu_id) VALUES (4, 1509); +INSERT INTO sys_role_menu(role_id, menu_id) VALUES (4, 1510); +INSERT INTO sys_role_menu(role_id, menu_id) VALUES (4, 1511); + +INSERT INTO sys_user_role(user_id, role_id) VALUES (3, 3); +INSERT INTO sys_user_role(user_id, role_id) VALUES (4, 4); + +INSERT INTO test_demo(id, dept_id, user_id, order_num, test_key, value, version, create_time, create_by, update_time, update_by, del_flag) VALUES (1, 102, 4, 1, '测试数据权限', '测试', 0, sysdate(), 'admin', NULL, NULL, 0); +INSERT INTO test_demo(id, dept_id, user_id, order_num, test_key, value, version, create_time, create_by, update_time, update_by, del_flag) VALUES (2, 102, 3, 2, '子节点1', '111', 0, sysdate(), 'admin', NULL, NULL, 0); +INSERT INTO test_demo(id, dept_id, user_id, order_num, test_key, value, version, create_time, create_by, update_time, update_by, del_flag) VALUES (3, 102, 3, 3, '子节点2', '222', 0, sysdate(), 'admin', NULL, NULL, 0); +INSERT INTO test_demo(id, dept_id, user_id, order_num, test_key, value, version, create_time, create_by, update_time, update_by, del_flag) VALUES (4, 108, 4, 4, '测试数据', 'demo', 0, sysdate(), 'admin', NULL, NULL, 0); +INSERT INTO test_demo(id, dept_id, user_id, order_num, test_key, value, version, create_time, create_by, update_time, update_by, del_flag) VALUES (5, 108, 3, 13, '子节点11', '1111', 0, sysdate(), 'admin', NULL, NULL, 0); +INSERT INTO test_demo(id, dept_id, user_id, order_num, test_key, value, version, create_time, create_by, update_time, update_by, del_flag) VALUES (6, 108, 3, 12, '子节点22', '2222', 0, sysdate(), 'admin', NULL, NULL, 0); +INSERT INTO test_demo(id, dept_id, user_id, order_num, test_key, value, version, create_time, create_by, update_time, update_by, del_flag) VALUES (7, 108, 3, 11, '子节点33', '3333', 0, sysdate(), 'admin', NULL, NULL, 0); +INSERT INTO test_demo(id, dept_id, user_id, order_num, test_key, value, version, create_time, create_by, update_time, update_by, del_flag) VALUES (8, 108, 3, 10, '子节点44', '4444', 0, sysdate(), 'admin', NULL, NULL, 0); +INSERT INTO test_demo(id, dept_id, user_id, order_num, test_key, value, version, create_time, create_by, update_time, update_by, del_flag) VALUES (9, 108, 3, 9, '子节点55', '5555', 0, sysdate(), 'admin', NULL, NULL, 0); +INSERT INTO test_demo(id, dept_id, user_id, order_num, test_key, value, version, create_time, create_by, update_time, update_by, del_flag) VALUES (10, 108, 3, 8, '子节点66', '6666', 0, sysdate(), 'admin', NULL, NULL, 0); +INSERT INTO test_demo(id, dept_id, user_id, order_num, test_key, value, version, create_time, create_by, update_time, update_by, del_flag) VALUES (11, 108, 3, 7, '子节点77', '7777', 0, sysdate(), 'admin', NULL, NULL, 0); +INSERT INTO test_demo(id, dept_id, user_id, order_num, test_key, value, version, create_time, create_by, update_time, update_by, del_flag) VALUES (12, 108, 3, 6, '子节点88', '8888', 0, sysdate(), 'admin', NULL, NULL, 0); +INSERT INTO test_demo(id, dept_id, user_id, order_num, test_key, value, version, create_time, create_by, update_time, update_by, del_flag) VALUES (13, 108, 3, 5, '子节点99', '9999', 0, sysdate(), 'admin', NULL, NULL, 0); + +INSERT INTO test_tree(id, parent_id, dept_id, user_id, tree_name, version, create_time, create_by, update_time, update_by, del_flag) VALUES (1, 0, 102, 4, '测试数据权限', 0, sysdate(), 'admin', NULL, NULL, 0); +INSERT INTO test_tree(id, parent_id, dept_id, user_id, tree_name, version, create_time, create_by, update_time, update_by, del_flag) VALUES (2, 1, 102, 3, '子节点1', 0, sysdate(), 'admin', NULL, NULL, 0); +INSERT INTO test_tree(id, parent_id, dept_id, user_id, tree_name, version, create_time, create_by, update_time, update_by, del_flag) VALUES (3, 2, 102, 3, '子节点2', 0, sysdate(), 'admin', NULL, NULL, 0); +INSERT INTO test_tree(id, parent_id, dept_id, user_id, tree_name, version, create_time, create_by, update_time, update_by, del_flag) VALUES (4, 0, 108, 4, '测试树1', 0, sysdate(), 'admin', NULL, NULL, 0); +INSERT INTO test_tree(id, parent_id, dept_id, user_id, tree_name, version, create_time, create_by, update_time, update_by, del_flag) VALUES (5, 4, 108, 3, '子节点11', 0, sysdate(), 'admin', NULL, NULL, 0); +INSERT INTO test_tree(id, parent_id, dept_id, user_id, tree_name, version, create_time, create_by, update_time, update_by, del_flag) VALUES (6, 4, 108, 3, '子节点22', 0, sysdate(), 'admin', NULL, NULL, 0); +INSERT INTO test_tree(id, parent_id, dept_id, user_id, tree_name, version, create_time, create_by, update_time, update_by, del_flag) VALUES (7, 4, 108, 3, '子节点33', 0, sysdate(), 'admin', NULL, NULL, 0); +INSERT INTO test_tree(id, parent_id, dept_id, user_id, tree_name, version, create_time, create_by, update_time, update_by, del_flag) VALUES (8, 5, 108, 3, '子节点44', 0, sysdate(), 'admin', NULL, NULL, 0); +INSERT INTO test_tree(id, parent_id, dept_id, user_id, tree_name, version, create_time, create_by, update_time, update_by, del_flag) VALUES (9, 6, 108, 3, '子节点55', 0, sysdate(), 'admin', NULL, NULL, 0); +INSERT INTO test_tree(id, parent_id, dept_id, user_id, tree_name, version, create_time, create_by, update_time, update_by, del_flag) VALUES (10, 7, 108, 3, '子节点66', 0, sysdate(), 'admin', NULL, NULL, 0); +INSERT INTO test_tree(id, parent_id, dept_id, user_id, tree_name, version, create_time, create_by, update_time, update_by, del_flag) VALUES (11, 7, 108, 3, '子节点77', 0, sysdate(), 'admin', NULL, NULL, 0); +INSERT INTO test_tree(id, parent_id, dept_id, user_id, tree_name, version, create_time, create_by, update_time, update_by, del_flag) VALUES (12, 10, 108, 3, '子节点88', 0, sysdate(), 'admin', NULL, NULL, 0); +INSERT INTO test_tree(id, parent_id, dept_id, user_id, tree_name, version, create_time, create_by, update_time, update_by, del_flag) VALUES (13, 10, 108, 3, '子节点99', 0, sysdate(), 'admin', NULL, NULL, 0); diff --git a/script/sql/update/oracle/update-4.1-4.2.sql b/script/sql/update/oracle/update-4.1-4.2.sql new file mode 100644 index 0000000..a4cbf24 --- /dev/null +++ b/script/sql/update/oracle/update-4.1-4.2.sql @@ -0,0 +1,12 @@ +ALTER TABLE "SYS_OSS_CONFIG" ADD ("DOMAIN" VARCHAR2(255)); + +COMMENT ON COLUMN "SYS_OSS_CONFIG"."DOMAIN" IS '自定义域名'; + +update sys_oss_config set endpoint = '127.0.0.1:9000' where oss_config_id = 1; +update sys_oss_config set endpoint = 's3-cn-north-1.qiniucs.com', region = '' where oss_config_id = 2; +update sys_oss_config set endpoint = 'oss-cn-beijing.aliyuncs.com' where oss_config_id = 3; +update sys_oss_config set endpoint = 'cos.ap-beijing.myqcloud.com' where oss_config_id = 4; + +insert into sys_oss_config values (5, 'image', 'ruoyi', 'ruoyi123', 'ruoyi', 'image', '127.0.0.1:9000', 'N', '', '1', '', NULL, 'admin', sysdate, 'admin', sysdate, ''); + +ALTER TABLE "GEN_TABLE_COLUMN" MODIFY ("TABLE_ID" NUMBER(20,0)); diff --git a/script/sql/update/oracle/update-4.2-4.3.sql b/script/sql/update/oracle/update-4.2-4.3.sql new file mode 100644 index 0000000..ec19d25 --- /dev/null +++ b/script/sql/update/oracle/update-4.2-4.3.sql @@ -0,0 +1,11 @@ +insert into sys_menu values('112', '缓存列表', '2', '6', 'cacheList', 'monitor/cache/list', '', 1, 0, 'C', '0', '0', 'monitor:cache:list', 'redis-list', 'admin', sysdate, '', null, '缓存列表菜单'); + +delete from sys_menu WHERE menu_id = 116; + +update sys_config set config_key = 'sys.account.captchaEnabled' where config_id = 4; + +insert into sys_menu values('1050', '账户解锁', '501', '4', '#', '', '', 1, 0, 'F', '0', '0', 'monitor:logininfor:unlock', '#', 'admin', sysdate, '', null, ''); + +insert into sys_role_menu values ('2', '1050'); + +insert into sys_dict_data values(29, 99, '其他', '0', 'sys_oper_type', '', 'info', 'N', '0', 'admin', sysdate, '', null, '其他操作'); diff --git a/script/sql/update/oracle/update-4.3-4.4.sql b/script/sql/update/oracle/update-4.3-4.4.sql new file mode 100644 index 0000000..77e12ed --- /dev/null +++ b/script/sql/update/oracle/update-4.3-4.4.sql @@ -0,0 +1,3 @@ +ALTER TABLE "SYS_OSS_CONFIG" ADD ("ACCESS_POLICY" CHAR(1) DEFAULT '1' NOT NULL); + +COMMENT ON COLUMN "SYS_OSS_CONFIG"."ACCESS_POLICY" IS '桶权限类型(0=private 1=public 2=custom)'; diff --git a/script/sql/update/postgres/update-4.1-4.2.sql b/script/sql/update/postgres/update-4.1-4.2.sql new file mode 100644 index 0000000..5ea2cf5 --- /dev/null +++ b/script/sql/update/postgres/update-4.1-4.2.sql @@ -0,0 +1,11 @@ +ALTER TABLE "sys_oss_config" ADD COLUMN "domain" varchar(255); + +COMMENT ON COLUMN "sys_oss_config"."domain" IS '自定义域名'; + +update sys_oss_config set endpoint = '127.0.0.1:9000' where oss_config_id = 1; +update sys_oss_config set endpoint = 's3-cn-north-1.qiniucs.com', region = '' where oss_config_id = 2; +update sys_oss_config set endpoint = 'oss-cn-beijing.aliyuncs.com' where oss_config_id = 3; +update sys_oss_config set endpoint = 'cos.ap-beijing.myqcloud.com' where oss_config_id = 4; + +insert into sys_oss_config values (5, 'image', 'ruoyi', 'ruoyi123', 'ruoyi', 'image', '127.0.0.1:9000', 'N', '', '1', '', 'admin', now(), 'admin', now(), NULL, ''); + diff --git a/script/sql/update/postgres/update-4.2-4.3.sql b/script/sql/update/postgres/update-4.2-4.3.sql new file mode 100644 index 0000000..9479f3f --- /dev/null +++ b/script/sql/update/postgres/update-4.2-4.3.sql @@ -0,0 +1,19 @@ +insert into sys_menu values('112', '缓存列表', '2', '6', 'cacheList', 'monitor/cache/list', '', '1', '0', 'C', '0', '0', 'monitor:cache:list', 'redis-list', 'admin', now(), '', null, '缓存列表菜单'); + +delete from sys_menu WHERE menu_id = 116; + +update sys_config set config_key = 'sys.account.captchaEnabled' where config_id = 4; + +insert into sys_menu values('1050', '账户解锁', '501', '4', '#', '', '', '1', '0', 'F', '0', '0', 'monitor:logininfor:unlock', '#', 'admin', now(), '', null, ''); + +insert into sys_role_menu values ('2', '1050'); + +-- 字符串自动转时间 避免框架时间查询报错问题 +create or replace function cast_varchar_to_timestamp(varchar) returns timestamptz as $$ +select to_timestamp($1, 'yyyy-mm-dd hh24:mi:ss'); +$$ language sql strict ; + +create cast (varchar as timestamptz) with function cast_varchar_to_timestamp as IMPLICIT; + +insert into sys_dict_data values(29, 99, '其他', '0', 'sys_oper_type', '', 'info', 'N', '0', 'admin', now(), '', null, '其他操作'); + diff --git a/script/sql/update/postgres/update-4.3-4.4.sql b/script/sql/update/postgres/update-4.3-4.4.sql new file mode 100644 index 0000000..e74357a --- /dev/null +++ b/script/sql/update/postgres/update-4.3-4.4.sql @@ -0,0 +1,3 @@ +ALTER TABLE "sys_oss_config" ADD COLUMN "access_policy" char(1) NOT NULL DEFAULT '1'::bpchar; + +COMMENT ON COLUMN "sys_oss_config"."access_policy" IS '桶权限类型(0=private 1=public 2=custom)'; diff --git a/script/sql/update/sqlserver/update-4.1-4.2.sql b/script/sql/update/sqlserver/update-4.1-4.2.sql new file mode 100644 index 0000000..9e217ec --- /dev/null +++ b/script/sql/update/sqlserver/update-4.1-4.2.sql @@ -0,0 +1,27 @@ +ALTER TABLE [sys_oss_config] ADD [domain] nvarchar(255) DEFAULT '' NULL +GO + +EXEC sp_addextendedproperty +'MS_Description', N'自定义域名', +'SCHEMA', N'dbo', +'TABLE', N'sys_oss_config', +'COLUMN', N'domain' +GO + +UPDATE [sys_oss_config] SET [access_key] = N'ruoyi', [secret_key] = N'ruoyi123', [endpoint] = N'127.0.0.1:9000' WHERE [oss_config_id] = 1 +GO + +UPDATE [sys_oss_config] SET [endpoint] = N's3-cn-north-1.qiniucs.com' WHERE [oss_config_id] = 2 +GO + +UPDATE [sys_oss_config] SET [endpoint] = N'oss-cn-beijing.aliyuncs.com' WHERE [oss_config_id] = 3 +GO + +UPDATE [sys_oss_config] SET [endpoint] = N'cos.ap-beijing.myqcloud.com' WHERE [oss_config_id] = 4 +GO + +INSERT INTO [sys_oss_config] ([oss_config_id], [config_key], [access_key], [secret_key], [bucket_name], [prefix], [endpoint], [domain], [is_https], [region], [status], [ext1], [create_by], [create_time], [update_by], [update_time], [remark]) VALUES (N'5', N'image', N'ruoyi', N'ruoyi123', N'ruoyi', N'image', N'127.0.0.1:9000', N'',N'N', N'', N'1', N'', N'admin', getdate(), N'admin', getdate(), NULL) +GO + +ALTER TABLE [gen_table_column] ALTER COLUMN [table_id] bigint NULL +GO diff --git a/script/sql/update/sqlserver/update-4.2-4.3.sql b/script/sql/update/sqlserver/update-4.2-4.3.sql new file mode 100644 index 0000000..19e5a9f --- /dev/null +++ b/script/sql/update/sqlserver/update-4.2-4.3.sql @@ -0,0 +1,17 @@ +INSERT [sys_menu] ([menu_id], [menu_name], [parent_id], [order_num], [path], [component], [query_param], [is_frame], [is_cache], [menu_type], [visible], [status], [perms], [icon], [create_by], [create_time], [update_by], [update_time], [remark]) VALUES (112, N'缓存列表', 2, 6, N'cacheList', N'monitor/cache/list', N'', 1, 0, N'C', N'0', N'0', N'monitor:cache:list', N'redis-list', N'admin', getdate(), N'', NULL, N'缓存列表菜单') +GO + +delete from sys_menu WHERE menu_id = 116; +GO + +update sys_config set config_key = 'sys.account.captchaEnabled' where config_id = 4 +GO + +INSERT [sys_menu] ([menu_id], [menu_name], [parent_id], [order_num], [path], [component], [query_param], [is_frame], [is_cache], [menu_type], [visible], [status], [perms], [icon], [create_by], [create_time], [update_by], [update_time], [remark]) VALUES (1050, N'账户解锁', 501, 4, N'#', N'', N'', 1, 0, N'F', N'0', N'0', N'monitor:logininfor:unlock', N'#', N'admin', getdate(), N'', null, N'') +GO + +INSERT [sys_role_menu] ([role_id], [menu_id]) VALUES (2, 1050) +GO + +INSERT [sys_dict_data] ([dict_code], [dict_sort], [dict_label], [dict_value], [dict_type], [css_class], [list_class], [is_default], [status], [create_by], [create_time], [update_by], [update_time], [remark]) VALUES (29, 99, N'其他', N'0', N'sys_oper_type', N'', N'info', N'N', N'0', N'admin', getdate(), N'', NULL, N'其他操作'); +GO diff --git a/script/sql/update/sqlserver/update-4.3-4.4.sql b/script/sql/update/sqlserver/update-4.3-4.4.sql new file mode 100644 index 0000000..8e36db5 --- /dev/null +++ b/script/sql/update/sqlserver/update-4.3-4.4.sql @@ -0,0 +1,9 @@ +ALTER TABLE [sys_oss_config] ADD [access_policy] nchar(1) DEFAULT ('1') NOT NULL +GO + +EXEC sp_addextendedproperty +'MS_Description', N'桶权限类型(0=private 1=public 2=custom)', +'SCHEMA', N'dbo', +'TABLE', N'sys_oss_config', +'COLUMN', N'access_policy' +GO diff --git a/script/sql/update/update-3.X-4.0.sql b/script/sql/update/update-3.X-4.0.sql new file mode 100644 index 0000000..aac1e6f --- /dev/null +++ b/script/sql/update/update-3.X-4.0.sql @@ -0,0 +1,6 @@ +ALTER TABLE `sys_user` MODIFY COLUMN `user_type` varchar(10) DEFAULT 'sys_user' COMMENT '用户类型(sys_user系统用户)' AFTER `nick_name`; + +UPDATE `sys_user` SET `nick_name` = '疯狂的狮子Li', `user_type` = 'sys_user', `email` = 'crazyLionLi@163.com' WHERE `user_id` = 1; +UPDATE `sys_user` SET `user_name` = 'lionli', `nick_name` = '疯狂的狮子Li', `user_type` = 'sys_user', `email` = 'crazyLionLi@163.com' WHERE `user_id` = 2; +UPDATE `sys_user` SET `nick_name` = '本部门及以下 密码666666', `user_type` = 'sys_user', `password` = '$2a$10$b8yUzN0C71sbz.PhNOCgJe.Tu1yWC3RNrTyjSQ8p1W0.aaUXUJ.Ne' WHERE `user_id` = 3; +UPDATE `sys_user` SET `nick_name` = '仅本人 密码666666', `user_type` = 'sys_user', `password` = '$2a$10$b8yUzN0C71sbz.PhNOCgJe.Tu1yWC3RNrTyjSQ8p1W0.aaUXUJ.Ne' WHERE `user_id` = 4; diff --git a/script/sql/update/update-4.0-4.1.sql b/script/sql/update/update-4.0-4.1.sql new file mode 100644 index 0000000..28e545a --- /dev/null +++ b/script/sql/update/update-4.0-4.1.sql @@ -0,0 +1,3 @@ +alter table sys_menu change query query_param varchar(255) default null comment '路由参数'; + +alter table sys_dept modify column ancestors varchar(500) null default '' comment '祖级列表'; diff --git a/script/sql/update/update-4.1-4.2.sql b/script/sql/update/update-4.1-4.2.sql new file mode 100644 index 0000000..1d9cf50 --- /dev/null +++ b/script/sql/update/update-4.1-4.2.sql @@ -0,0 +1,14 @@ +alter table sys_oss_config add column domain varchar(255) null default '' COMMENT '自定义域名'; + +update sys_oss_config set endpoint = '127.0.0.1:9000' where oss_config_id = 1; +update sys_oss_config set endpoint = 's3-cn-north-1.qiniucs.com', region = '' where oss_config_id = 2; +update sys_oss_config set endpoint = 'oss-cn-beijing.aliyuncs.com' where oss_config_id = 3; +update sys_oss_config set endpoint = 'cos.ap-beijing.myqcloud.com' where oss_config_id = 4; + +insert into sys_oss_config values (5, 'image', 'ruoyi', 'ruoyi123', 'ruoyi', 'image', '127.0.0.1:9000', 'N', '', '1', '', 'admin', sysdate(), 'admin', sysdate(), NULL, ''); + +alter table gen_table_column modify column table_id bigint(0) null default null COMMENT '归属表编号'; + +alter table sys_notice modify column notice_id bigint(0) not null COMMENT '公告ID'; + +alter table sys_config modify column config_id bigint(0) not null COMMENT '参数主键'; diff --git a/script/sql/update/update-4.2-4.3.sql b/script/sql/update/update-4.2-4.3.sql new file mode 100644 index 0000000..900657d --- /dev/null +++ b/script/sql/update/update-4.2-4.3.sql @@ -0,0 +1,11 @@ +insert into sys_menu values('112', '缓存列表', '2', '6', 'cacheList', 'monitor/cache/list', '', 1, 0, 'C', '0', '0', 'monitor:cache:list', 'redis-list', 'admin', sysdate(), '', null, '缓存列表菜单'); + +delete from sys_menu WHERE menu_id = 116; + +update sys_config set config_key = 'sys.account.captchaEnabled' where config_id = 4; + +insert into sys_menu values('1050', '账户解锁', '501', '4', '#', '', '', 1, 0, 'F', '0', '0', 'monitor:logininfor:unlock', '#', 'admin', sysdate(), '', null, ''); + +insert into sys_role_menu values ('2', '1050'); + +insert into sys_dict_data values(29, 99, '其他', '0', 'sys_oper_type', '', 'info', 'N', '0', 'admin', sysdate(), '', null, '其他操作'); diff --git a/script/sql/update/update-4.3-4.4.sql b/script/sql/update/update-4.3-4.4.sql new file mode 100644 index 0000000..5a59987 --- /dev/null +++ b/script/sql/update/update-4.3-4.4.sql @@ -0,0 +1 @@ +ALTER TABLE sys_oss_config ADD COLUMN access_policy char(1) NOT NULL DEFAULT 1 COMMENT '桶权限类型(0=private 1=public 2=custom)' AFTER region; diff --git a/sql/仅结构.sql b/sql/仅结构.sql deleted file mode 100644 index dd14285..0000000 --- a/sql/仅结构.sql +++ /dev/null @@ -1,887 +0,0 @@ -SET NAMES utf8mb4; -SET -FOREIGN_KEY_CHECKS = 0; - --- ---------------------------- --- Table structure for gen_table --- ---------------------------- -DROP TABLE IF EXISTS `gen_table`; -CREATE TABLE `gen_table` -( - `table_id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '编号', - `table_name` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '表名称', - `table_comment` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '表描述', - `sub_table_name` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '关联子表的表名', - `sub_table_fk_name` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '子表关联的外键名', - `class_name` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '实体类名称', - `tpl_category` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT 'crud' COMMENT '使用的模板(crud单表操作 tree树表操作)', - `package_name` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '生成包路径', - `module_name` varchar(30) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '生成模块名', - `business_name` varchar(30) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '生成业务名', - `function_name` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '生成功能名', - `function_author` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '生成功能作者', - `gen_type` char(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '0' COMMENT '生成代码方式(0zip压缩包 1自定义路径)', - `gen_path` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '/' COMMENT '生成路径(不填默认项目路径)', - `options` varchar(1000) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '其它生成选项', - `create_by` bigint(20) NULL DEFAULT NULL COMMENT '创建者', - `create_time` datetime(0) NULL DEFAULT NULL COMMENT '创建时间', - `update_by` bigint(20) NULL DEFAULT NULL COMMENT '更新者', - `update_time` datetime(3) NULL DEFAULT NULL COMMENT '更新时间', - `remark` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '备注', - PRIMARY KEY (`table_id`) USING BTREE -) ENGINE = InnoDB AUTO_INCREMENT = 920 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '代码生成业务表' ROW_FORMAT = Dynamic; - --- ---------------------------- --- Table structure for gen_table_column --- ---------------------------- -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) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '归属表编号', - `column_name` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '列名称', - `column_comment` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '列描述', - `column_type` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '列类型', - `java_type` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT 'JAVA类型', - `java_field` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT 'JAVA字段名', - `is_pk` char(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '是否主键(1是)', - `is_increment` char(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '是否自增(1是)', - `is_required` char(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '是否必填(1是)', - `is_insert` char(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '是否为插入字段(1是)', - `is_edit` char(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '是否编辑字段(1是)', - `is_list` char(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '是否列表字段(1是)', - `is_query` char(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '是否查询字段(1是)', - `query_type` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT 'EQ' COMMENT '查询方式(等于、不等于、大于、小于、范围)', - `html_type` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '显示类型(文本框、文本域、下拉框、复选框、单选框、日期控件)', - `dict_type` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '字典类型', - `sort` int(11) NULL DEFAULT NULL COMMENT '排序', - `create_by` bigint(20) NULL DEFAULT NULL COMMENT '创建者', - `create_time` datetime(0) NULL DEFAULT NULL COMMENT '创建时间', - `update_by` bigint(20) NULL DEFAULT NULL COMMENT '更新者', - `update_time` datetime(3) NULL DEFAULT NULL COMMENT '更新时间', - PRIMARY KEY (`column_id`) USING BTREE -) ENGINE = InnoDB AUTO_INCREMENT = 11628 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '代码生成业务表字段' ROW_FORMAT = Dynamic; - --- ---------------------------- --- Table structure for qrtz_locks --- ---------------------------- -DROP TABLE IF EXISTS `qrtz_locks`; -CREATE TABLE `qrtz_locks` -( - `sched_name` varchar(120) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '调度名称', - `lock_name` varchar(40) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '悲观锁名称', - PRIMARY KEY (`sched_name`, `lock_name`) USING BTREE -) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '存储的悲观锁信息表' ROW_FORMAT = Dynamic; - --- ---------------------------- --- Table structure for sys_config --- ---------------------------- -DROP TABLE IF EXISTS `sys_config`; -CREATE TABLE `sys_config` -( - `config_id` int(5) NOT NULL AUTO_INCREMENT COMMENT '参数主键', - `config_name` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '参数名称', - `config_key` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '参数键名', - `config_value` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '参数键值', - `config_type` char(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT 'N' COMMENT '系统内置(Y是 N否)', - `create_by` bigint(20) NULL DEFAULT NULL COMMENT '创建者', - `create_time` datetime(0) NULL DEFAULT NULL COMMENT '创建时间', - `update_by` bigint(20) NULL DEFAULT NULL COMMENT '更新者', - `update_time` datetime(3) NULL DEFAULT NULL COMMENT '更新时间', - `remark` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '备注', - PRIMARY KEY (`config_id`) USING BTREE -) ENGINE = InnoDB AUTO_INCREMENT = 100 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '参数配置表' ROW_FORMAT = Dynamic; - --- ---------------------------- --- Table structure for sys_dept --- ---------------------------- -DROP TABLE IF EXISTS `sys_dept`; -CREATE TABLE `sys_dept` -( - `dept_id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '部门id', - `parent_id` bigint(20) NULL DEFAULT 0 COMMENT '父部门id', - `ancestors` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '祖级列表', - `dept_name` varchar(30) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '部门名称', - `order_num` int(4) NULL DEFAULT 0 COMMENT '显示顺序', - `leader` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '负责人', - `phone` varchar(11) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '联系电话', - `email` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '邮箱', - `status` char(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '0' COMMENT '部门状态(0正常 1停用)', - `del_flag` char(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '0' COMMENT '删除标志(0代表存在 2代表删除)', - `create_by` bigint(20) NULL DEFAULT NULL COMMENT '创建者', - `create_time` datetime(3) NULL DEFAULT NULL COMMENT '创建时间', - `update_by` bigint(20) NULL DEFAULT NULL COMMENT '更新者', - `update_time` datetime(3) NULL DEFAULT NULL COMMENT '更新时间', - PRIMARY KEY (`dept_id`) USING BTREE -) ENGINE = InnoDB AUTO_INCREMENT = 200 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '部门表' ROW_FORMAT = Dynamic; - --- ---------------------------- --- Table structure for sys_dict_data --- ---------------------------- -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) NULL DEFAULT 0 COMMENT '字典排序', - `dict_label` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '字典标签', - `dict_value` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '字典键值', - `dict_type` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '字典类型', - `css_class` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '样式属性(其他样式扩展)', - `list_class` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '表格回显样式', - `is_default` char(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT 'N' COMMENT '是否默认(Y是 N否)', - `status` char(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '0' COMMENT '状态(0正常 1停用)', - `create_by` bigint(20) NULL DEFAULT NULL COMMENT '创建者', - `create_time` datetime(3) NULL DEFAULT NULL COMMENT '创建时间', - `update_by` bigint(20) NULL DEFAULT NULL COMMENT '更新者', - `update_time` datetime(3) NULL DEFAULT NULL COMMENT '更新时间', - `remark` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '备注', - PRIMARY KEY (`dict_code`) USING BTREE -) ENGINE = InnoDB AUTO_INCREMENT = 139 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '字典数据表' ROW_FORMAT = Dynamic; - --- ---------------------------- --- Table structure for sys_dict_type --- ---------------------------- -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) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '字典名称', - `dict_type` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '字典类型', - `status` char(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '0' COMMENT '状态(0正常 1停用)', - `create_by` bigint(20) NULL DEFAULT NULL COMMENT '创建者', - `create_time` datetime(3) NULL DEFAULT NULL COMMENT '创建时间', - `update_by` bigint(20) NULL DEFAULT NULL COMMENT '更新者', - `update_time` datetime(3) NULL DEFAULT NULL COMMENT '更新时间', - `remark` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '备注', - PRIMARY KEY (`dict_id`) USING BTREE, - UNIQUE INDEX `dict_type`(`dict_type`) USING BTREE -) ENGINE = InnoDB AUTO_INCREMENT = 112 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '字典类型表' ROW_FORMAT = Dynamic; - --- ---------------------------- --- Table structure for sys_job --- ---------------------------- -DROP TABLE IF EXISTS `sys_job`; -CREATE TABLE `sys_job` -( - `job_id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '任务ID', - `job_name` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '任务名称', - `job_group` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT 'DEFAULT' COMMENT '任务组名', - `invoke_target` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '调用目标字符串', - `cron_expression` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT 'cron执行表达式', - `misfire_policy` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '3' COMMENT '计划执行错误策略(1立即执行 2执行一次 3放弃执行)', - `concurrent` char(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '1' COMMENT '是否并发执行(0允许 1禁止)', - `status` char(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '0' COMMENT '状态(0正常 1暂停)', - `create_by` bigint(20) NULL DEFAULT NULL COMMENT '创建者', - `create_time` datetime(3) NULL DEFAULT NULL COMMENT '创建时间', - `update_by` bigint(20) NULL DEFAULT NULL COMMENT '更新者', - `update_time` datetime(3) NULL DEFAULT NULL COMMENT '更新时间', - `remark` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '备注信息', - PRIMARY KEY (`job_id`, `job_name`, `job_group`) USING BTREE -) ENGINE = InnoDB AUTO_INCREMENT = 100 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '定时任务调度表' ROW_FORMAT = Dynamic; - --- ---------------------------- --- Table structure for sys_job_log --- ---------------------------- -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) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '任务名称', - `job_group` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '任务组名', - `invoke_target` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '调用目标字符串', - `job_message` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '日志信息', - `status` char(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '0' COMMENT '执行状态(0正常 1失败)', - `exception_info` varchar(2000) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '异常信息', - `create_time` datetime(0) NULL DEFAULT NULL COMMENT '创建时间', - PRIMARY KEY (`job_log_id`) USING BTREE -) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '定时任务调度日志表' ROW_FORMAT = Dynamic; - --- ---------------------------- --- Table structure for sys_logininfor --- ---------------------------- -DROP TABLE IF EXISTS `sys_logininfor`; -CREATE TABLE `sys_logininfor` -( - `info_id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '访问ID', - `user_name` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '用户账号', - `ipaddr` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '登录IP地址', - `login_location` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '登录地点', - `browser` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '浏览器类型', - `os` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '操作系统', - `status` char(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '0' COMMENT '登录状态(0成功 1失败)', - `msg` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '提示消息', - `login_time` datetime(0) NULL DEFAULT NULL COMMENT '访问时间', - PRIMARY KEY (`info_id`) USING BTREE -) ENGINE = InnoDB AUTO_INCREMENT = 17576 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '系统访问记录' ROW_FORMAT = Dynamic; - --- ---------------------------- --- Table structure for sys_menu --- ---------------------------- -DROP TABLE IF EXISTS `sys_menu`; -CREATE TABLE `sys_menu` -( - `menu_id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '菜单ID', - `menu_name` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '菜单名称', - `parent_id` bigint(20) NULL DEFAULT 0 COMMENT '父菜单ID', - `order_num` int(4) NULL DEFAULT 0 COMMENT '显示顺序', - `path` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '路由地址', - `component` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '组件路径', - `query` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '路由参数', - `is_frame` int(1) NULL DEFAULT 1 COMMENT '是否为外链(0是 1否)', - `is_cache` int(1) NULL DEFAULT 0 COMMENT '是否缓存(0缓存 1不缓存)', - `menu_type` char(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '菜单类型(M目录 C菜单 F按钮)', - `visible` char(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '0' COMMENT '菜单状态(0显示 1隐藏)', - `status` char(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '0' COMMENT '菜单状态(0正常 1停用)', - `perms` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '权限标识', - `icon` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '#' COMMENT '菜单图标', - `create_by` bigint(20) NULL DEFAULT NULL COMMENT '创建者', - `create_time` datetime(3) NULL DEFAULT NULL COMMENT '创建时间', - `update_by` bigint(20) NULL DEFAULT NULL COMMENT '更新者', - `update_time` datetime(3) NULL DEFAULT NULL COMMENT '更新时间', - `remark` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '备注', - PRIMARY KEY (`menu_id`) USING BTREE -) ENGINE = InnoDB AUTO_INCREMENT = 2235 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '菜单权限表' ROW_FORMAT = Dynamic; - --- ---------------------------- --- Table structure for sys_notice --- ---------------------------- -DROP TABLE IF EXISTS `sys_notice`; -CREATE TABLE `sys_notice` -( - `notice_id` int(4) NOT NULL AUTO_INCREMENT COMMENT '公告ID', - `notice_title` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '公告标题', - `notice_type` char(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '公告类型(1通知 2公告)', - `notice_content` longblob NULL COMMENT '公告内容', - `status` char(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '0' COMMENT '公告状态(0正常 1关闭)', - `create_by` bigint(20) NULL DEFAULT NULL COMMENT '创建者', - `create_time` datetime(0) NULL DEFAULT NULL COMMENT '创建时间', - `update_by` bigint(20) NULL DEFAULT NULL COMMENT '更新者', - `update_time` datetime(3) NULL DEFAULT NULL COMMENT '更新时间', - `remark` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '备注', - PRIMARY KEY (`notice_id`) USING BTREE -) ENGINE = InnoDB AUTO_INCREMENT = 10 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '通知公告表' ROW_FORMAT = Dynamic; - --- ---------------------------- --- Table structure for sys_oper_log --- ---------------------------- -DROP TABLE IF EXISTS `sys_oper_log`; -CREATE TABLE `sys_oper_log` -( - `oper_id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '日志主键', - `title` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '模块标题', - `business_type` int(2) NULL DEFAULT 0 COMMENT '业务类型(0其它 1新增 2修改 3删除)', - `method` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '方法名称', - `request_method` varchar(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '请求方式', - `operator_type` int(1) NULL DEFAULT 0 COMMENT '操作类别(0其它 1后台用户 2手机端用户)', - `oper_name` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '操作人员', - `dept_name` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '部门名称', - `oper_url` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '请求URL', - `oper_ip` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '主机地址', - `oper_location` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '操作地点', - `oper_param` varchar(2000) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '请求参数', - `json_result` varchar(2000) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '返回参数', - `status` int(1) NULL DEFAULT 0 COMMENT '操作状态(0正常 1异常)', - `error_msg` varchar(2000) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '错误消息', - `oper_time` datetime(0) NULL DEFAULT NULL COMMENT '操作时间', - PRIMARY KEY (`oper_id`) USING BTREE -) ENGINE = InnoDB AUTO_INCREMENT = 7161 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '操作日志记录' ROW_FORMAT = Dynamic; - --- ---------------------------- --- Table structure for sys_post --- ---------------------------- -DROP TABLE IF EXISTS `sys_post`; -CREATE TABLE `sys_post` -( - `post_id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '岗位ID', - `post_code` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '岗位编码', - `post_name` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '岗位名称', - `post_sort` int(4) NOT NULL COMMENT '显示顺序', - `status` char(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '状态(0正常 1停用)', - `create_by` bigint(20) NULL DEFAULT NULL COMMENT '创建者', - `create_time` datetime(3) NULL DEFAULT NULL COMMENT '创建时间', - `update_by` bigint(20) NULL DEFAULT NULL COMMENT '更新者', - `update_time` datetime(0) NULL DEFAULT NULL COMMENT '更新时间', - `remark` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '备注', - PRIMARY KEY (`post_id`) USING BTREE -) ENGINE = InnoDB AUTO_INCREMENT = 5 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '岗位信息表' ROW_FORMAT = Dynamic; - --- ---------------------------- --- Table structure for sys_role --- ---------------------------- -DROP TABLE IF EXISTS `sys_role`; -CREATE TABLE `sys_role` -( - `role_id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '角色ID', - `role_name` varchar(30) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '角色名称', - `role_key` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '角色权限字符串', - `role_sort` int(4) NOT NULL COMMENT '显示顺序', - `data_scope` char(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '1' COMMENT '数据范围(1:全部数据权限 2:自定数据权限 3:本部门数据权限 4:本部门及以下数据权限)', - `menu_check_strictly` tinyint(1) NULL DEFAULT 1 COMMENT '菜单树选择项是否关联显示', - `dept_check_strictly` tinyint(1) NULL DEFAULT 1 COMMENT '部门树选择项是否关联显示', - `status` char(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '角色状态(0正常 1停用)', - `del_flag` char(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '0' COMMENT '删除标志(0代表存在 2代表删除)', - `create_by` bigint(20) NULL DEFAULT NULL COMMENT '创建者', - `create_time` datetime(0) NULL DEFAULT NULL COMMENT '创建时间', - `update_by` bigint(20) NULL DEFAULT NULL COMMENT '更新者', - `update_time` datetime(3) NULL DEFAULT NULL COMMENT '更新时间', - `remark` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '备注', - PRIMARY KEY (`role_id`) USING BTREE -) ENGINE = InnoDB AUTO_INCREMENT = 102 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '角色信息表' ROW_FORMAT = Dynamic; - --- ---------------------------- --- Table structure for sys_role_dept --- ---------------------------- -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`) USING BTREE -) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '角色和部门关联表' ROW_FORMAT = Dynamic; - --- ---------------------------- --- Table structure for sys_role_menu --- ---------------------------- -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`) USING BTREE -) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '角色和菜单关联表' ROW_FORMAT = Dynamic; - --- ---------------------------- --- Table structure for sys_user --- ---------------------------- -DROP TABLE IF EXISTS `sys_user`; -CREATE TABLE `sys_user` -( - `user_id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '用户ID', - `dept_id` bigint(20) NULL DEFAULT NULL COMMENT '部门ID', - `user_name` varchar(30) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '用户账号', - `nick_name` varchar(30) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '用户昵称', - `user_type` varchar(2) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '00' COMMENT '用户类型(00系统用户)', - `email` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '用户邮箱', - `phonenumber` varchar(11) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '手机号码', - `sex` char(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '0' COMMENT '用户性别(0男 1女 2未知)', - `avatar` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '头像地址', - `password` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '密码', - `status` char(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '0' COMMENT '帐号状态(0正常 1停用)', - `del_flag` char(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '0' COMMENT '删除标志(0代表存在 2代表删除)', - `login_ip` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '最后登录IP', - `login_date` datetime(0) NULL DEFAULT NULL COMMENT '最后登录时间', - `create_by` bigint(20) NULL DEFAULT NULL COMMENT '创建者', - `create_time` datetime(3) NULL DEFAULT NULL COMMENT '创建时间', - `update_by` bigint(20) NULL DEFAULT NULL COMMENT '更新者', - `update_time` datetime(3) NULL DEFAULT NULL COMMENT '更新时间', - `remark` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '备注', - PRIMARY KEY (`user_id`) USING BTREE -) ENGINE = InnoDB AUTO_INCREMENT = 117 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '用户信息表' ROW_FORMAT = Dynamic; - --- ---------------------------- --- Table structure for sys_user_post --- ---------------------------- -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`) USING BTREE -) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '用户与岗位关联表' ROW_FORMAT = Dynamic; - --- ---------------------------- --- Table structure for sys_user_role --- ---------------------------- -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`) USING BTREE -) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '用户和角色关联表' ROW_FORMAT = Dynamic; - --- ---------------------------- --- Table structure for wms_area --- ---------------------------- -DROP TABLE IF EXISTS `wms_area`; -CREATE TABLE `wms_area` -( - `id` bigint(20) NOT NULL AUTO_INCREMENT, - `area_no` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '编号', - `area_name` varchar(60) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '名称', - `warehouse_id` bigint(20) NOT NULL COMMENT '所属仓库ID', - `remark` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '备注', - `del_flag` tinyint(4) NOT NULL DEFAULT 0 COMMENT '删除标识', - `create_by` bigint(20) NULL DEFAULT NULL COMMENT '创建人', - `create_time` datetime(3) NULL DEFAULT NULL COMMENT '创建时间', - `update_by` bigint(20) NULL DEFAULT NULL COMMENT '修改人', - `update_time` datetime(3) NULL DEFAULT NULL COMMENT '修改时间', - PRIMARY KEY (`id`) USING BTREE -) ENGINE = InnoDB AUTO_INCREMENT = 222 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '库区' ROW_FORMAT = Dynamic; - --- ---------------------------- --- Table structure for wms_carrier --- ---------------------------- -DROP TABLE IF EXISTS `wms_carrier`; -CREATE TABLE `wms_carrier` -( - `id` bigint(20) NOT NULL AUTO_INCREMENT, - `carrier_no` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '编号', - `carrier_name` varchar(60) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '名称', - `address` varchar(80) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '地址', - `mobile` varchar(13) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '手机号', - `tel` varchar(13) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '座机号', - `contact` varchar(30) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '联系人', - `level` varchar(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '级别', - `email` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT 'Email', - `remark` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '备注', - `del_flag` tinyint(4) NOT NULL DEFAULT 0 COMMENT '删除标识', - `create_by` bigint(20) NULL DEFAULT NULL COMMENT '创建人', - `create_time` datetime(3) NULL DEFAULT NULL COMMENT '创建时间', - `update_by` bigint(20) NULL DEFAULT NULL COMMENT '修改人', - `update_time` datetime(3) NULL DEFAULT NULL COMMENT '修改时间', - PRIMARY KEY (`id`) USING BTREE -) ENGINE = InnoDB AUTO_INCREMENT = 24 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '承运商' ROW_FORMAT = Dynamic; - --- ---------------------------- --- Table structure for wms_customer --- ---------------------------- -DROP TABLE IF EXISTS `wms_customer`; -CREATE TABLE `wms_customer` -( - `id` bigint(20) NOT NULL AUTO_INCREMENT, - `customer_no` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '编号', - `customer_name` varchar(60) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '名称', - `bank_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '开户行', - `bank_account` varchar(40) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '银行账户', - `receivable_amount` decimal(10, 2) NULL DEFAULT 0.00 COMMENT '应收款', - `address` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '地址', - `mobile` varchar(13) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '手机号', - `tel` varchar(13) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '座机号', - `customer_person` varchar(30) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '联系人', - `customer_level` varchar(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '级别', - `email` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT 'Email', - `remark` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '备注', - `del_flag` tinyint(4) NOT NULL DEFAULT 0 COMMENT '删除标识', - `create_by` bigint(20) NULL DEFAULT NULL COMMENT '创建人', - `create_time` datetime(3) NULL DEFAULT NULL COMMENT '创建时间', - `update_by` bigint(20) NULL DEFAULT NULL COMMENT '修改人', - `update_time` datetime(3) NULL DEFAULT NULL COMMENT '修改时间', - PRIMARY KEY (`id`) USING BTREE -) ENGINE = InnoDB AUTO_INCREMENT = 40 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '客户' ROW_FORMAT = Dynamic; - --- ---------------------------- --- Table structure for wms_customer_transaction --- ---------------------------- -DROP TABLE IF EXISTS `wms_customer_transaction`; -CREATE TABLE `wms_customer_transaction` -( - `id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'id', - `transaction_code` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '交易编号', - `customer_id` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '用户编号', - `transaction_type` varchar(2) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '交易类型 1:结款 2:应付 ', - `transaction_amount` decimal(18, 2) NOT NULL COMMENT '交易金额', - `previous_balance` decimal(18, 2) NOT NULL COMMENT '上期余额', - `current_balance` decimal(18, 2) NOT NULL COMMENT '当前余额', - `shipment_order_id` bigint(20) NULL DEFAULT NULL COMMENT '出库单号', - `remark` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '备注', - `del_flag` tinyint(4) NOT NULL DEFAULT 0 COMMENT '删除标志', - `create_time` datetime(0) NOT NULL DEFAULT CURRENT_TIMESTAMP (0) COMMENT '创建时间', - `update_time` datetime(0) NOT NULL DEFAULT CURRENT_TIMESTAMP (0) ON UPDATE CURRENT_TIMESTAMP (0) COMMENT '更新时间', - PRIMARY KEY (`id`) USING BTREE -) ENGINE = InnoDB AUTO_INCREMENT = 47 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '客户账户流水' ROW_FORMAT = Dynamic; - --- ---------------------------- --- Table structure for wms_delivery --- ---------------------------- -DROP TABLE IF EXISTS `wms_delivery`; -CREATE TABLE `wms_delivery` -( - `id` bigint(20) NOT NULL AUTO_INCREMENT, - `shipment_order_id` bigint(20) NULL DEFAULT NULL COMMENT '出库单主表Id', - `carrier_id` bigint(20) NULL DEFAULT NULL COMMENT '承运商Id', - `delivery_date` datetime(3) NULL DEFAULT NULL COMMENT '发货日期', - `tracking_no` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '快递单号', - `remark` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '备注', - `del_flag` tinyint(4) NOT NULL DEFAULT 0 COMMENT '删除标识', - `create_by` bigint(20) NULL DEFAULT NULL COMMENT '创建人', - `create_time` datetime(3) NULL DEFAULT NULL COMMENT '创建时间', - `update_by` bigint(20) NULL DEFAULT NULL COMMENT '修改人', - `update_time` datetime(3) NULL DEFAULT NULL COMMENT '修改时间', - PRIMARY KEY (`id`) USING BTREE -) ENGINE = InnoDB AUTO_INCREMENT = 25 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '发货记录' ROW_FORMAT = Dynamic; - --- ---------------------------- --- Table structure for wms_inventory --- ---------------------------- -DROP TABLE IF EXISTS `wms_inventory`; -CREATE TABLE `wms_inventory` -( - `id` bigint(20) NOT NULL AUTO_INCREMENT, - `item_id` bigint(20) NULL DEFAULT NULL COMMENT '物料ID', - `rack_id` bigint(20) NULL DEFAULT NULL COMMENT '货架id', - `quantity` decimal(20, 2) NULL DEFAULT NULL COMMENT '库存', - `remark` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '备注', - `del_flag` tinyint(4) NOT NULL DEFAULT 0 COMMENT '删除标识', - `create_by` bigint(20) NULL DEFAULT NULL COMMENT '创建人', - `create_time` datetime(3) NULL DEFAULT NULL COMMENT '创建时间', - `update_by` bigint(20) NULL DEFAULT NULL COMMENT '修改人', - `update_time` datetime(3) NULL DEFAULT NULL COMMENT '修改时间', - `warehouse_id` bigint(20) NULL DEFAULT NULL COMMENT '所属仓库', - `area_id` bigint(20) NULL DEFAULT NULL COMMENT '所属库区', - PRIMARY KEY (`id`) USING BTREE -) ENGINE = InnoDB AUTO_INCREMENT = 373 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '库存' ROW_FORMAT = Dynamic; - --- ---------------------------- --- Table structure for wms_inventory_check --- ---------------------------- -DROP TABLE IF EXISTS `wms_inventory_check`; -CREATE TABLE `wms_inventory_check` -( - `id` bigint(20) NOT NULL AUTO_INCREMENT, - `inventory_check_no` varchar(22) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '库存盘点单号,系统自动生成', - `inventory_check_type` int(11) NULL DEFAULT NULL COMMENT '库存盘点类型', - `inventory_check_status` tinyint(4) NULL DEFAULT 11 COMMENT '库存盘点单状态11:盘点中 22:已完成', - `inventory_check_total` decimal(20, 2) NULL DEFAULT NULL COMMENT '盈亏数', - `check_status` tinyint(4) NULL DEFAULT NULL COMMENT '审核状态', - `check_user_id` bigint(20) NULL DEFAULT NULL COMMENT '审核人', - `check_time` datetime(3) NULL DEFAULT NULL COMMENT '审核时间', - `warehouse_id` bigint(20) NULL DEFAULT NULL COMMENT '所属仓库', - `area_id` bigint(20) NULL DEFAULT NULL COMMENT '所属库区', - `rack_id` bigint(20) NULL DEFAULT NULL COMMENT '货架', - `attachment` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '附件文件', - `remark` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '备注', - `del_flag` tinyint(4) NOT NULL DEFAULT 0 COMMENT '删除标识', - `create_by` bigint(20) NULL DEFAULT NULL COMMENT '创建人', - `create_time` datetime(3) NULL DEFAULT NULL COMMENT '创建时间', - `update_by` bigint(20) NULL DEFAULT NULL COMMENT '修改人', - `update_time` datetime(3) NULL DEFAULT NULL COMMENT '修改时间', - PRIMARY KEY (`id`) USING BTREE -) ENGINE = InnoDB AUTO_INCREMENT = 52 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '库存盘点单据' ROW_FORMAT = Dynamic; - --- ---------------------------- --- Table structure for wms_inventory_check_detail --- ---------------------------- -DROP TABLE IF EXISTS `wms_inventory_check_detail`; -CREATE TABLE `wms_inventory_check_detail` -( - `id` bigint(20) NOT NULL AUTO_INCREMENT, - `inventory_check_id` bigint(20) NULL DEFAULT NULL COMMENT '库存盘点单', - `item_id` bigint(20) NULL DEFAULT NULL COMMENT '物料', - `quantity` decimal(20, 2) NULL DEFAULT NULL COMMENT '库存数量', - `check_quantity` decimal(20, 2) NULL DEFAULT NULL COMMENT '盘点数量', - `warehouse_id` bigint(20) NULL DEFAULT NULL COMMENT '所属仓库', - `area_id` bigint(20) NULL DEFAULT NULL COMMENT '所属库区', - `rack_id` bigint(20) NULL DEFAULT NULL COMMENT '货架', - `del_flag` tinyint(4) NOT NULL DEFAULT 0 COMMENT '删除标识', - `remark` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '备注', - `create_by` bigint(20) NULL DEFAULT NULL COMMENT '创建人', - `create_time` datetime(3) NULL DEFAULT NULL COMMENT '创建时间', - `update_by` bigint(20) NULL DEFAULT NULL COMMENT '修改人', - `update_time` datetime(3) NULL DEFAULT NULL COMMENT '修改时间', - PRIMARY KEY (`id`) USING BTREE -) ENGINE = InnoDB AUTO_INCREMENT = 241 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '库存盘点单据详情' ROW_FORMAT = Dynamic; - --- ---------------------------- --- Table structure for wms_inventory_history --- ---------------------------- -DROP TABLE IF EXISTS `wms_inventory_history`; -CREATE TABLE `wms_inventory_history` -( - `id` bigint(20) NOT NULL AUTO_INCREMENT, - `form_id` bigint(20) NULL DEFAULT NULL COMMENT '操作id(出库、入库、库存移动表单id)', - `form_type` int(11) NULL DEFAULT NULL COMMENT '操作类型', - `item_id` bigint(20) NULL DEFAULT NULL COMMENT '物料ID', - `rack_id` bigint(20) NULL DEFAULT NULL COMMENT '货架id', - `quantity` decimal(20, 2) NULL DEFAULT NULL COMMENT '库存变化', - `remark` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '备注', - `del_flag` tinyint(4) NOT NULL DEFAULT 0 COMMENT '删除标识', - `create_by` bigint(20) NULL DEFAULT NULL COMMENT '创建人', - `create_time` datetime(3) NULL DEFAULT NULL COMMENT '创建时间', - `update_by` bigint(20) NULL DEFAULT NULL COMMENT '修改人', - `update_time` datetime(3) NULL DEFAULT NULL COMMENT '修改时间', - `warehouse_id` bigint(20) NULL DEFAULT NULL COMMENT '所属仓库', - `area_id` bigint(20) NULL DEFAULT NULL COMMENT '所属库区', - PRIMARY KEY (`id`) USING BTREE -) ENGINE = InnoDB AUTO_INCREMENT = 706 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '库存记录' ROW_FORMAT = Dynamic; - --- ---------------------------- --- Table structure for wms_inventory_movement --- ---------------------------- -DROP TABLE IF EXISTS `wms_inventory_movement`; -CREATE TABLE `wms_inventory_movement` -( - `id` bigint(20) NOT NULL AUTO_INCREMENT, - `inventory_movement_no` varchar(30) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '编号', - `source_rack_id` bigint(20) NULL DEFAULT NULL COMMENT '原货架Id', - `target_rack_id` bigint(20) NULL DEFAULT NULL COMMENT '目标货架', - `status` tinyint(4) NULL DEFAULT NULL COMMENT '状态', - `check_status` tinyint(4) NULL DEFAULT NULL COMMENT '审核状态', - `check_user_id` bigint(20) NULL DEFAULT NULL COMMENT '审核人', - `check_time` datetime(3) NULL DEFAULT NULL COMMENT '审核时间', - `remark` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '备注', - `del_flag` tinyint(4) NOT NULL DEFAULT 0 COMMENT '删除标识', - `create_by` bigint(20) NULL DEFAULT NULL COMMENT '创建人', - `create_time` datetime(3) NULL DEFAULT NULL COMMENT '创建时间', - `update_by` bigint(20) NULL DEFAULT NULL COMMENT '修改人', - `update_time` datetime(3) NULL DEFAULT NULL COMMENT '修改时间', - PRIMARY KEY (`id`) USING BTREE -) ENGINE = InnoDB AUTO_INCREMENT = 99 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '库存移动' ROW_FORMAT = Dynamic; - --- ---------------------------- --- Table structure for wms_inventory_movement_detail --- ---------------------------- -DROP TABLE IF EXISTS `wms_inventory_movement_detail`; -CREATE TABLE `wms_inventory_movement_detail` -( - `id` bigint(20) NOT NULL AUTO_INCREMENT, - `inventory_movement_id` bigint(20) NULL DEFAULT NULL COMMENT '库存移动Id', - `item_id` bigint(20) NULL DEFAULT NULL COMMENT '物料', - `plan_quantity` decimal(20, 2) NULL DEFAULT NULL COMMENT '计划数量', - `real_quantity` decimal(20, 2) NULL DEFAULT NULL COMMENT '实际数量', - `del_flag` tinyint(4) NOT NULL DEFAULT 0 COMMENT '删除标识', - `remark` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '备注', - `create_by` bigint(20) NULL DEFAULT NULL COMMENT '创建人', - `create_time` datetime(3) NULL DEFAULT NULL COMMENT '创建时间', - `update_by` bigint(20) NULL DEFAULT NULL COMMENT '修改人', - `update_time` datetime(3) NULL DEFAULT NULL COMMENT '修改时间', - `source_rack_id` bigint(20) NULL DEFAULT NULL COMMENT '源货架', - `source_warehouse_id` bigint(20) NULL DEFAULT NULL COMMENT '源仓库', - `source_area_id` bigint(20) NULL DEFAULT NULL COMMENT '源库区', - `move_status` tinyint(4) NULL DEFAULT NULL COMMENT '移库状态', - `target_rack_id` bigint(20) NULL DEFAULT NULL COMMENT '目标货架', - `target_warehouse_id` bigint(20) NULL DEFAULT NULL COMMENT '目标仓库', - `target_area_id` bigint(20) NULL DEFAULT NULL COMMENT '目标库区', - PRIMARY KEY (`id`) USING BTREE -) ENGINE = InnoDB AUTO_INCREMENT = 198 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '库存移动详情' ROW_FORMAT = Dynamic; - --- ---------------------------- --- Table structure for wms_item --- ---------------------------- -DROP TABLE IF EXISTS `wms_item`; -CREATE TABLE `wms_item` -( - `id` bigint(20) NOT NULL AUTO_INCREMENT, - `item_no` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '编号', - `item_name` varchar(60) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '名称', - `item_type` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '分类', - `unit` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '单位类别', - `rack_id` bigint(20) NULL DEFAULT NULL COMMENT '所属货架', - `area_id` bigint(20) NULL DEFAULT NULL COMMENT '所属库区', - `warehouse_id` bigint(20) NULL DEFAULT NULL COMMENT '所属仓库', - `quantity` decimal(20, 2) NULL DEFAULT NULL COMMENT '安全库存', - `expiry_date` datetime(3) NULL DEFAULT NULL COMMENT '有效期', - `del_flag` tinyint(4) NOT NULL DEFAULT 0 COMMENT '删除标识', - `remark` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '备注', - `create_by` bigint(20) NULL DEFAULT NULL COMMENT '创建人', - `create_time` datetime(3) NULL DEFAULT NULL COMMENT '创建时间', - `update_by` bigint(20) NULL DEFAULT NULL COMMENT '修改人', - `update_time` datetime(3) NULL DEFAULT NULL COMMENT '修改时间', - PRIMARY KEY (`id`) USING BTREE -) ENGINE = InnoDB AUTO_INCREMENT = 194 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '物料' ROW_FORMAT = Dynamic; - --- ---------------------------- --- Table structure for wms_item_type --- ---------------------------- -DROP TABLE IF EXISTS `wms_item_type`; -CREATE TABLE `wms_item_type` -( - `item_type_id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '物料类型id', - `parent_id` bigint(20) NULL DEFAULT 0 COMMENT '父物料类型id', - `ancestors` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '祖级列表', - `type_name` varchar(30) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '物料类型名称', - `order_num` int(11) NULL DEFAULT 0 COMMENT '显示顺序', - `status` char(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '0' COMMENT '物料类型状态(0正常 1停用)', - `del_flag` char(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '0' COMMENT '删除标志(0代表存在 2代表删除)', - `create_by` bigint(20) NULL DEFAULT NULL COMMENT '创建者', - `create_time` datetime(3) NULL DEFAULT NULL COMMENT '创建时间', - `update_by` bigint(20) NULL DEFAULT NULL COMMENT '更新者', - `update_time` datetime(3) NULL DEFAULT NULL COMMENT '更新时间', - PRIMARY KEY (`item_type_id`) USING BTREE -) ENGINE = InnoDB AUTO_INCREMENT = 215 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '物料类型表' ROW_FORMAT = Dynamic; - --- ---------------------------- --- Table structure for wms_rack --- ---------------------------- -DROP TABLE IF EXISTS `wms_rack`; -CREATE TABLE `wms_rack` -( - `id` bigint(20) NOT NULL AUTO_INCREMENT, - `rack_no` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '编号', - `rack_name` varchar(60) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '名称', - `area_id` bigint(20) NOT NULL COMMENT '所属库区', - `warehouse_id` bigint(20) NOT NULL COMMENT '所属仓库', - `remark` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '备注', - `del_flag` tinyint(4) NOT NULL DEFAULT 0 COMMENT '删除标识', - `create_by` bigint(20) NULL DEFAULT NULL COMMENT '创建人', - `create_time` datetime(3) NULL DEFAULT NULL COMMENT '创建时间', - `update_by` bigint(20) NULL DEFAULT NULL COMMENT '修改人', - `update_time` datetime(3) NULL DEFAULT NULL COMMENT '修改时间', - PRIMARY KEY (`id`) USING BTREE -) ENGINE = InnoDB AUTO_INCREMENT = 128 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '货架' ROW_FORMAT = Dynamic; - --- ---------------------------- --- Table structure for wms_receipt_order --- ---------------------------- -DROP TABLE IF EXISTS `wms_receipt_order`; -CREATE TABLE `wms_receipt_order` -( - `id` bigint(20) NOT NULL AUTO_INCREMENT, - `receipt_order_no` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '入库单号', - `receipt_order_type` int(11) NULL DEFAULT NULL COMMENT '入库类型', - `supplier_id` bigint(20) NULL DEFAULT NULL COMMENT '供应商', - `order_no` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '订单号', - `payable_amount` decimal(10, 2) NULL DEFAULT NULL COMMENT '订单金额', - `receipt_order_status` tinyint(4) NULL DEFAULT NULL COMMENT '入库状态', - `remark` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '备注', - `del_flag` tinyint(4) NOT NULL DEFAULT 0 COMMENT '删除标识', - `create_by` bigint(20) NULL DEFAULT NULL COMMENT '创建人', - `create_time` datetime(3) NULL DEFAULT NULL COMMENT '创建时间', - `update_by` bigint(20) NULL DEFAULT NULL COMMENT '修改人', - `update_time` datetime(3) NULL DEFAULT NULL COMMENT '修改时间', - PRIMARY KEY (`id`) USING BTREE -) ENGINE = InnoDB AUTO_INCREMENT = 626 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '入库单' ROW_FORMAT = Dynamic; - --- ---------------------------- --- Table structure for wms_receipt_order_detail --- ---------------------------- -DROP TABLE IF EXISTS `wms_receipt_order_detail`; -CREATE TABLE `wms_receipt_order_detail` -( - `id` bigint(20) NOT NULL AUTO_INCREMENT, - `receipt_order_id` bigint(20) NULL DEFAULT NULL COMMENT '入库单号', - `item_id` bigint(20) NULL DEFAULT NULL COMMENT '物料', - `plan_quantity` decimal(20, 2) NULL DEFAULT NULL COMMENT '计划数量', - `real_quantity` decimal(20, 2) NULL DEFAULT NULL COMMENT '实际数量', - `rack_id` bigint(20) NULL DEFAULT NULL COMMENT '所属货架', - `money` decimal(10, 2) NULL DEFAULT NULL COMMENT '金额', - `del_flag` tinyint(4) NOT NULL DEFAULT 0 COMMENT '删除标识', - `remark` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '备注', - `create_by` bigint(20) NULL DEFAULT NULL COMMENT '创建人', - `create_time` datetime(3) NULL DEFAULT NULL COMMENT '创建时间', - `update_by` bigint(20) NULL DEFAULT NULL COMMENT '修改人', - `update_time` datetime(3) NULL DEFAULT NULL COMMENT '修改时间', - `warehouse_id` bigint(20) NULL DEFAULT NULL COMMENT '所属仓库', - `area_id` bigint(20) NULL DEFAULT NULL COMMENT '所属库区', - `receipt_order_status` tinyint(4) NULL DEFAULT NULL COMMENT '入库状态', - PRIMARY KEY (`id`) USING BTREE -) ENGINE = InnoDB AUTO_INCREMENT = 2642 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '入库单详情' ROW_FORMAT = Dynamic; - --- ---------------------------- --- Table structure for wms_shipment_order --- ---------------------------- -DROP TABLE IF EXISTS `wms_shipment_order`; -CREATE TABLE `wms_shipment_order` -( - `id` bigint(20) NOT NULL AUTO_INCREMENT, - `shipment_order_no` varchar(22) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '出库单号,系统自动生成', - `shipment_order_type` int(11) NULL DEFAULT NULL COMMENT '出库类型', - `order_no` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '出库订单', - `customer_id` bigint(20) NULL DEFAULT NULL COMMENT '客户', - `receivable_amount` decimal(10, 2) NULL DEFAULT NULL COMMENT '订单金额', - `shipment_order_status` tinyint(4) NULL DEFAULT NULL COMMENT '出库单状态', - `check_status` tinyint(4) NULL DEFAULT NULL COMMENT '审核状态', - `check_user_id` bigint(20) NULL DEFAULT NULL COMMENT '审核人', - `check_time` datetime(3) NULL DEFAULT NULL COMMENT '审核时间', - `remark` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '备注', - `del_flag` tinyint(4) NOT NULL DEFAULT 0 COMMENT '删除标识', - `create_by` bigint(20) NULL DEFAULT NULL COMMENT '创建人', - `create_time` datetime(3) NULL DEFAULT NULL COMMENT '创建时间', - `update_by` bigint(20) NULL DEFAULT NULL COMMENT '修改人', - `update_time` datetime(3) NULL DEFAULT NULL COMMENT '修改时间', - PRIMARY KEY (`id`) USING BTREE -) ENGINE = InnoDB AUTO_INCREMENT = 273 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '出库单' ROW_FORMAT = Dynamic; - --- ---------------------------- --- Table structure for wms_shipment_order_detail --- ---------------------------- -DROP TABLE IF EXISTS `wms_shipment_order_detail`; -CREATE TABLE `wms_shipment_order_detail` -( - `id` bigint(20) NOT NULL AUTO_INCREMENT, - `shipment_order_id` bigint(20) NULL DEFAULT NULL COMMENT '出库单', - `item_id` bigint(20) NULL DEFAULT NULL COMMENT '物料', - `plan_quantity` decimal(20, 2) NULL DEFAULT NULL COMMENT '计划数量', - `real_quantity` decimal(20, 2) NULL DEFAULT NULL COMMENT '实际数量', - `rack_id` bigint(20) NULL DEFAULT NULL COMMENT '货架', - `money` decimal(10, 2) NULL DEFAULT NULL COMMENT '金额', - `del_flag` tinyint(4) NOT NULL DEFAULT 0 COMMENT '删除标识', - `remark` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '备注', - `create_by` bigint(20) NULL DEFAULT NULL COMMENT '创建人', - `create_time` datetime(3) NULL DEFAULT NULL COMMENT '创建时间', - `update_by` bigint(20) NULL DEFAULT NULL COMMENT '修改人', - `update_time` datetime(3) NULL DEFAULT NULL COMMENT '修改时间', - `warehouse_id` bigint(20) NULL DEFAULT NULL COMMENT '所属仓库', - `area_id` bigint(20) NULL DEFAULT NULL COMMENT '所属库区', - `shipment_order_status` tinyint(4) NULL DEFAULT NULL COMMENT '出库状态', - PRIMARY KEY (`id`) USING BTREE -) ENGINE = InnoDB AUTO_INCREMENT = 889 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '出库单详情' ROW_FORMAT = Dynamic; - --- ---------------------------- --- Table structure for wms_supplier --- ---------------------------- -DROP TABLE IF EXISTS `wms_supplier`; -CREATE TABLE `wms_supplier` -( - `id` bigint(20) NOT NULL AUTO_INCREMENT, - `supplier_no` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '编号', - `supplier_name` varchar(60) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '名称', - `bank_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '开户行', - `bank_account` varchar(40) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '银行账户', - `payable_amount` decimal(10, 2) NULL DEFAULT 0.00 COMMENT '应付款', - `address` varchar(80) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '地址', - `mobile_no` varchar(13) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '手机号', - `tel_no` varchar(13) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '座机号', - `contact` varchar(30) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '联系人', - `level` varchar(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '级别', - `email` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT 'Email', - `remark` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '备注', - `del_flag` tinyint(4) NOT NULL DEFAULT 0 COMMENT '删除标识', - `create_by` bigint(20) NULL DEFAULT NULL COMMENT '创建人', - `create_time` datetime(3) NULL DEFAULT NULL COMMENT '创建时间', - `update_by` bigint(20) NULL DEFAULT NULL COMMENT '修改人', - `update_time` datetime(3) NULL DEFAULT NULL COMMENT '修改时间', - PRIMARY KEY (`id`) USING BTREE -) ENGINE = InnoDB AUTO_INCREMENT = 53 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '供应商' ROW_FORMAT = Dynamic; - --- ---------------------------- --- Table structure for wms_supplier_transaction --- ---------------------------- -DROP TABLE IF EXISTS `wms_supplier_transaction`; -CREATE TABLE `wms_supplier_transaction` -( - `id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'id', - `transaction_code` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '交易编号', - `supplier_id` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '供应商编号', - `transaction_type` varchar(2) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '交易类型 1:结款 2:应付 ', - `transaction_amount` decimal(18, 2) NOT NULL COMMENT '交易金额', - `previous_balance` decimal(18, 2) NOT NULL COMMENT '上期余额', - `current_balance` decimal(18, 2) NOT NULL COMMENT '当前余额', - `receipt_order_id` bigint(20) NULL DEFAULT NULL COMMENT '入库单号', - `remark` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '备注', - `del_flag` tinyint(4) NOT NULL DEFAULT 0 COMMENT '删除标志', - `create_time` datetime(0) NOT NULL DEFAULT CURRENT_TIMESTAMP (0) COMMENT '创建时间', - `update_time` datetime(0) NOT NULL DEFAULT CURRENT_TIMESTAMP (0) ON UPDATE CURRENT_TIMESTAMP (0) COMMENT '更新时间', - PRIMARY KEY (`id`) USING BTREE -) ENGINE = InnoDB AUTO_INCREMENT = 49 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '供应商账户流水' ROW_FORMAT = Dynamic; - --- ---------------------------- --- Table structure for wms_warehouse --- ---------------------------- -DROP TABLE IF EXISTS `wms_warehouse`; -CREATE TABLE `wms_warehouse` -( - `id` bigint(20) NOT NULL AUTO_INCREMENT, - `warehouse_no` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '编号', - `warehouse_name` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '名称', - `del_flag` tinyint(4) NOT NULL DEFAULT 0 COMMENT '删除标识', - `remark` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '备注', - `create_by` bigint(20) NULL DEFAULT NULL COMMENT '创建人', - `create_time` datetime(3) NULL DEFAULT NULL COMMENT '创建时间', - `update_by` bigint(20) NULL DEFAULT NULL COMMENT '修改人', - `update_time` datetime(3) NULL DEFAULT NULL COMMENT '修改时间', - PRIMARY KEY (`id`) USING BTREE -) ENGINE = InnoDB AUTO_INCREMENT = 236 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '仓库' ROW_FORMAT = Dynamic; - -SET -FOREIGN_KEY_CHECKS = 1; diff --git a/sql/结构和数据.sql b/sql/结构和数据.sql deleted file mode 100644 index 5804602..0000000 --- a/sql/结构和数据.sql +++ /dev/null @@ -1,5563 +0,0 @@ -SET NAMES utf8mb4; -SET FOREIGN_KEY_CHECKS = 0; - --- ---------------------------- --- Table structure for gen_table --- ---------------------------- -DROP TABLE IF EXISTS `gen_table`; -CREATE TABLE `gen_table` ( - `table_id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '编号', - `table_name` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '表名称', - `table_comment` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '表描述', - `sub_table_name` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '关联子表的表名', - `sub_table_fk_name` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '子表关联的外键名', - `class_name` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '实体类名称', - `tpl_category` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT 'crud' COMMENT '使用的模板(crud单表操作 tree树表操作)', - `package_name` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '生成包路径', - `module_name` varchar(30) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '生成模块名', - `business_name` varchar(30) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '生成业务名', - `function_name` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '生成功能名', - `function_author` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '生成功能作者', - `gen_type` char(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '0' COMMENT '生成代码方式(0zip压缩包 1自定义路径)', - `gen_path` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '/' COMMENT '生成路径(不填默认项目路径)', - `options` varchar(1000) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '其它生成选项', - `create_by` bigint(20) NULL DEFAULT NULL COMMENT '创建者', - `create_time` datetime(0) NULL DEFAULT NULL COMMENT '创建时间', - `update_by` bigint(20) NULL DEFAULT NULL COMMENT '更新者', - `update_time` datetime(3) NULL DEFAULT NULL COMMENT '更新时间', - `remark` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '备注', - PRIMARY KEY (`table_id`) USING BTREE -) ENGINE = InnoDB AUTO_INCREMENT = 920 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '代码生成业务表' ROW_FORMAT = Dynamic; - --- ---------------------------- --- Records of gen_table --- ---------------------------- -INSERT INTO `gen_table` VALUES (865, 'wms_inventory_history', '库存记录', NULL, NULL, 'WmsInventoryHistory', 'crud', 'com.cyl.wms', 'wms', 'wmsInventoryHistory', '库存记录', 'feijinping', '0', '/', NULL, -1, '2022-10-10 21:08:55', NULL, NULL, NULL); -INSERT INTO `gen_table` VALUES (866, 'wms_inventory', '库存', NULL, NULL, 'WmsInventory', 'crud', 'com.cyl.wms', 'wms', 'wmsInventory', '库存', 'feijinping', '0', '/', NULL, -1, '2022-10-10 22:30:47', NULL, NULL, NULL); -INSERT INTO `gen_table` VALUES (908, 'test', 'test', NULL, NULL, 'Test', 'crud', 'com.cyl.demo', 'demo', 'test', 'test', 'shelly', '1', '/', '{}', 1, '2022-12-01 11:28:35', NULL, '2022-12-01 11:29:24.000', NULL); - --- ---------------------------- --- Table structure for gen_table_column --- ---------------------------- -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) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '归属表编号', - `column_name` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '列名称', - `column_comment` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '列描述', - `column_type` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '列类型', - `java_type` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT 'JAVA类型', - `java_field` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT 'JAVA字段名', - `is_pk` char(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '是否主键(1是)', - `is_increment` char(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '是否自增(1是)', - `is_required` char(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '是否必填(1是)', - `is_insert` char(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '是否为插入字段(1是)', - `is_edit` char(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '是否编辑字段(1是)', - `is_list` char(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '是否列表字段(1是)', - `is_query` char(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '是否查询字段(1是)', - `query_type` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT 'EQ' COMMENT '查询方式(等于、不等于、大于、小于、范围)', - `html_type` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '显示类型(文本框、文本域、下拉框、复选框、单选框、日期控件)', - `dict_type` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '字典类型', - `sort` int(11) NULL DEFAULT NULL COMMENT '排序', - `create_by` bigint(20) NULL DEFAULT NULL COMMENT '创建者', - `create_time` datetime(0) NULL DEFAULT NULL COMMENT '创建时间', - `update_by` bigint(20) NULL DEFAULT NULL COMMENT '更新者', - `update_time` datetime(3) NULL DEFAULT NULL COMMENT '更新时间', - PRIMARY KEY (`column_id`) USING BTREE -) ENGINE = InnoDB AUTO_INCREMENT = 11628 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '代码生成业务表字段' ROW_FORMAT = Dynamic; - --- ---------------------------- --- Records of gen_table_column --- ---------------------------- -INSERT INTO `gen_table_column` VALUES (10878, '865', 'id', 'ID', 'bigint(20)', 'Long', 'id', '1', '1', NULL, '1', NULL, NULL, NULL, 'EQ', 'input', '', 1, -1, '2022-10-10 21:08:56', NULL, NULL); -INSERT INTO `gen_table_column` VALUES (10879, '865', 'form_id', '操作id(出库、入库、库存移动表单id)', 'bigint(20)', 'Long', 'formId', '0', '0', NULL, '1', '1', '1', '1', 'EQ', 'input', '', 2, -1, '2022-10-10 21:08:56', NULL, NULL); -INSERT INTO `gen_table_column` VALUES (10880, '865', 'form_type', '操作类型', 'int(11)', 'Integer', 'formType', '0', '0', NULL, '1', '1', '1', '1', 'EQ', 'select', '', 3, -1, '2022-10-10 21:08:56', NULL, NULL); -INSERT INTO `gen_table_column` VALUES (10881, '865', 'item_id', '物料ID', 'bigint(20)', 'Long', 'itemId', '0', '0', NULL, '1', '1', '1', '1', 'EQ', 'input', '', 4, -1, '2022-10-10 21:08:56', NULL, NULL); -INSERT INTO `gen_table_column` VALUES (10882, '865', 'rack_id', '货架id', 'bigint(20)', 'Long', 'rackId', '0', '0', NULL, '1', '1', '1', '1', 'EQ', 'input', '', 5, -1, '2022-10-10 21:08:56', NULL, NULL); -INSERT INTO `gen_table_column` VALUES (10883, '865', 'quantity', '库存变化', 'decimal(20,2)', 'BigDecimal', 'quantity', '0', '0', NULL, '1', '1', '1', '1', 'EQ', 'input', '', 6, -1, '2022-10-10 21:08:56', NULL, NULL); -INSERT INTO `gen_table_column` VALUES (10884, '865', 'remark', '备注', 'varchar(255)', 'String', 'remark', '0', '0', NULL, '1', '1', '1', NULL, 'EQ', 'input', '', 7, -1, '2022-10-10 21:08:56', NULL, NULL); -INSERT INTO `gen_table_column` VALUES (10885, '865', 'del_flag', '删除标识', 'tinyint(4)', 'Integer', 'delFlag', '0', '0', '1', '1', NULL, NULL, NULL, 'EQ', 'input', '', 8, -1, '2022-10-10 21:08:56', NULL, NULL); -INSERT INTO `gen_table_column` VALUES (10886, '865', 'create_by', '创建人', 'bigint(20)', 'Long', 'createBy', '0', '0', NULL, '1', NULL, NULL, NULL, 'EQ', 'input', '', 9, -1, '2022-10-10 21:08:56', NULL, NULL); -INSERT INTO `gen_table_column` VALUES (10887, '865', 'create_time', '创建时间', 'datetime(3)', 'LocalDateTime', 'createTime', '0', '0', NULL, '1', NULL, NULL, NULL, 'EQ', 'datetime', '', 10, -1, '2022-10-10 21:08:56', NULL, NULL); -INSERT INTO `gen_table_column` VALUES (10888, '865', 'update_by', '修改人', 'bigint(20)', 'Long', 'updateBy', '0', '0', NULL, '1', '1', NULL, NULL, 'EQ', 'input', '', 11, -1, '2022-10-10 21:08:56', NULL, NULL); -INSERT INTO `gen_table_column` VALUES (10889, '865', 'update_time', '修改时间', 'datetime(3)', 'LocalDateTime', 'updateTime', '0', '0', NULL, '1', '1', NULL, NULL, 'EQ', 'datetime', '', 12, -1, '2022-10-10 21:08:56', NULL, NULL); -INSERT INTO `gen_table_column` VALUES (10890, '865', 'warehouseId', '所属仓库', 'bigint(20)', 'Long', 'warehouseid', '0', '0', NULL, '1', '1', '1', '1', 'EQ', 'input', '', 13, -1, '2022-10-10 21:08:56', NULL, NULL); -INSERT INTO `gen_table_column` VALUES (10891, '865', 'areaId', '所属库区', 'bigint(20)', 'Long', 'areaid', '0', '0', NULL, '1', '1', '1', '1', 'EQ', 'input', '', 14, -1, '2022-10-10 21:08:56', NULL, NULL); -INSERT INTO `gen_table_column` VALUES (10892, '866', 'id', 'ID', 'bigint(20)', 'Long', 'id', '1', '1', NULL, '1', NULL, NULL, NULL, 'EQ', 'input', '', 1, -1, '2022-10-10 22:30:47', NULL, NULL); -INSERT INTO `gen_table_column` VALUES (10893, '866', 'item_id', '物料ID', 'bigint(20)', 'Long', 'itemId', '0', '0', NULL, '1', '1', '1', '1', 'EQ', 'input', '', 2, -1, '2022-10-10 22:30:47', NULL, NULL); -INSERT INTO `gen_table_column` VALUES (10894, '866', 'rack_id', '货架id', 'bigint(20)', 'Long', 'rackId', '0', '0', NULL, '1', '1', '1', '1', 'EQ', 'input', '', 3, -1, '2022-10-10 22:30:47', NULL, NULL); -INSERT INTO `gen_table_column` VALUES (10895, '866', 'quantity', '库存', 'decimal(20,2)', 'BigDecimal', 'quantity', '0', '0', NULL, '1', '1', '1', '1', 'EQ', 'input', '', 4, -1, '2022-10-10 22:30:47', NULL, NULL); -INSERT INTO `gen_table_column` VALUES (10896, '866', 'remark', '备注', 'varchar(255)', 'String', 'remark', '0', '0', NULL, '1', '1', '1', NULL, 'EQ', 'input', '', 5, -1, '2022-10-10 22:30:47', NULL, NULL); -INSERT INTO `gen_table_column` VALUES (10897, '866', 'del_flag', '删除标识', 'tinyint(4)', 'Integer', 'delFlag', '0', '0', '1', '1', NULL, NULL, NULL, 'EQ', 'input', '', 6, -1, '2022-10-10 22:30:48', NULL, NULL); -INSERT INTO `gen_table_column` VALUES (10898, '866', 'create_by', '创建人', 'bigint(20)', 'Long', 'createBy', '0', '0', NULL, '1', NULL, NULL, NULL, 'EQ', 'input', '', 7, -1, '2022-10-10 22:30:48', NULL, NULL); -INSERT INTO `gen_table_column` VALUES (10899, '866', 'create_time', '创建时间', 'datetime(3)', 'LocalDateTime', 'createTime', '0', '0', NULL, '1', NULL, NULL, NULL, 'EQ', 'datetime', '', 8, -1, '2022-10-10 22:30:48', NULL, NULL); -INSERT INTO `gen_table_column` VALUES (10900, '866', 'update_by', '修改人', 'bigint(20)', 'Long', 'updateBy', '0', '0', NULL, '1', '1', NULL, NULL, 'EQ', 'input', '', 9, -1, '2022-10-10 22:30:48', NULL, NULL); -INSERT INTO `gen_table_column` VALUES (10901, '866', 'update_time', '修改时间', 'datetime(3)', 'LocalDateTime', 'updateTime', '0', '0', NULL, '1', '1', NULL, NULL, 'EQ', 'datetime', '', 10, -1, '2022-10-10 22:30:48', NULL, NULL); -INSERT INTO `gen_table_column` VALUES (10902, '866', 'warehouse_id', '所属仓库', 'bigint(20)', 'Long', 'warehouseId', '0', '0', NULL, '1', '1', '1', '1', 'EQ', 'input', '', 11, -1, '2022-10-10 22:30:48', NULL, NULL); -INSERT INTO `gen_table_column` VALUES (10903, '866', 'area_id', '所属库区', 'bigint(20)', 'Long', 'areaId', '0', '0', NULL, '1', '1', '1', '1', 'EQ', 'input', '', 12, -1, '2022-10-10 22:30:48', NULL, NULL); -INSERT INTO `gen_table_column` VALUES (11462, '908', 'id', 'ID', 'int(11)', 'Integer', 'id', '1', '0', NULL, '1', NULL, NULL, NULL, 'EQ', 'input', '', 1, 1, '2022-12-01 11:28:35', NULL, '2022-12-01 11:29:24.000'); -INSERT INTO `gen_table_column` VALUES (11463, '908', 'name', 'NAME', 'varchar(255)', 'String', 'name', '0', '0', NULL, '1', '1', '1', '1', 'LIKE', 'input', '', 2, 1, '2022-12-01 11:28:35', NULL, '2022-12-01 11:29:24.000'); -INSERT INTO `gen_table_column` VALUES (11464, '908', 'remark', 'REMARK', 'varchar(255)', 'String', 'remark', '0', '0', NULL, '1', '1', '1', NULL, 'EQ', 'input', '', 3, 1, '2022-12-01 11:28:35', NULL, '2022-12-01 11:29:24.000'); - --- ---------------------------- --- Table structure for qrtz_locks --- ---------------------------- -DROP TABLE IF EXISTS `qrtz_locks`; -CREATE TABLE `qrtz_locks` ( - `sched_name` varchar(120) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '调度名称', - `lock_name` varchar(40) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '悲观锁名称', - PRIMARY KEY (`sched_name`, `lock_name`) USING BTREE -) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '存储的悲观锁信息表' ROW_FORMAT = Dynamic; - --- ---------------------------- --- Records of qrtz_locks --- ---------------------------- -INSERT INTO `qrtz_locks` VALUES ('RuoyiScheduler', 'TRIGGER_ACCESS'); - --- ---------------------------- --- Table structure for sys_config --- ---------------------------- -DROP TABLE IF EXISTS `sys_config`; -CREATE TABLE `sys_config` ( - `config_id` int(5) NOT NULL AUTO_INCREMENT COMMENT '参数主键', - `config_name` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '参数名称', - `config_key` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '参数键名', - `config_value` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '参数键值', - `config_type` char(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT 'N' COMMENT '系统内置(Y是 N否)', - `create_by` bigint(20) NULL DEFAULT NULL COMMENT '创建者', - `create_time` datetime(0) NULL DEFAULT NULL COMMENT '创建时间', - `update_by` bigint(20) NULL DEFAULT NULL COMMENT '更新者', - `update_time` datetime(3) NULL DEFAULT NULL COMMENT '更新时间', - `remark` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '备注', - PRIMARY KEY (`config_id`) USING BTREE -) ENGINE = InnoDB AUTO_INCREMENT = 100 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '参数配置表' ROW_FORMAT = Dynamic; - --- ---------------------------- --- Records of sys_config --- ---------------------------- -INSERT INTO `sys_config` VALUES (1, '主框架页-默认皮肤样式名称', 'sys.index.skinName', 'skin-blue', 'Y', 1, '2022-06-17 17:20:29', 1, '2023-02-16 17:15:08.000', '蓝色 skin-blue、绿色 skin-green、紫色 skin-purple、红色 skin-red、黄色 skin-yellow'); -INSERT INTO `sys_config` VALUES (2, '用户管理-账号初始密码', 'sys.user.initPassword', '123456', 'Y', 1, '2022-06-17 17:20:29', NULL, NULL, '初始化密码 123456'); -INSERT INTO `sys_config` VALUES (3, '主框架页-侧边栏主题', 'sys.index.sideTheme', 'theme-dark', 'Y', 1, '2022-06-17 17:20:29', NULL, NULL, '深色主题theme-dark,浅色主题theme-light'); -INSERT INTO `sys_config` VALUES (4, '账号自助-验证码开关', 'sys.account.captchaOnOff', 'true', 'Y', 1, '2022-06-17 17:20:29', NULL, NULL, '是否开启验证码功能(true开启,false关闭)'); -INSERT INTO `sys_config` VALUES (5, '账号自助-是否开启用户注册功能', 'sys.account.registerUser', 'false', 'Y', 1, '2022-06-17 17:20:29', NULL, NULL, '是否开启注册用户功能(true开启,false关闭)'); - --- ---------------------------- --- Table structure for sys_dept --- ---------------------------- -DROP TABLE IF EXISTS `sys_dept`; -CREATE TABLE `sys_dept` ( - `dept_id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '部门id', - `parent_id` bigint(20) NULL DEFAULT 0 COMMENT '父部门id', - `ancestors` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '祖级列表', - `dept_name` varchar(30) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '部门名称', - `order_num` int(4) NULL DEFAULT 0 COMMENT '显示顺序', - `leader` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '负责人', - `phone` varchar(11) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '联系电话', - `email` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '邮箱', - `status` char(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '0' COMMENT '部门状态(0正常 1停用)', - `del_flag` char(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '0' COMMENT '删除标志(0代表存在 2代表删除)', - `create_by` bigint(20) NULL DEFAULT NULL COMMENT '创建者', - `create_time` datetime(3) NULL DEFAULT NULL COMMENT '创建时间', - `update_by` bigint(20) NULL DEFAULT NULL COMMENT '更新者', - `update_time` datetime(3) NULL DEFAULT NULL COMMENT '更新时间', - PRIMARY KEY (`dept_id`) USING BTREE -) ENGINE = InnoDB AUTO_INCREMENT = 200 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '部门表' ROW_FORMAT = Dynamic; - --- ---------------------------- --- Records of sys_dept --- ---------------------------- -INSERT INTO `sys_dept` VALUES (100, 0, '0', '若依科技', 0, '若依', '15888888888', 'ry@qq.com', '0', '0', 1, '2022-06-17 17:20:19.000', NULL, NULL); -INSERT INTO `sys_dept` VALUES (101, 100, '0,100', '深圳总公司', 1, '若依', '15888888888', 'ry@qq.com', '0', '0', 1, '2022-06-17 17:20:19.000', 1, '2022-12-09 20:38:19.000'); -INSERT INTO `sys_dept` VALUES (102, 100, '0,100', '长沙分公司', 2, '若依', '15888888888', 'ry@qq.com', '0', '0', 1, '2022-06-17 17:20:19.000', NULL, NULL); -INSERT INTO `sys_dept` VALUES (103, 101, '0,100,101', '研发部门', 1, '若依', '15888888888', 'ry@qq.com', '0', '0', 1, '2022-06-17 17:20:19.000', NULL, NULL); -INSERT INTO `sys_dept` VALUES (104, 101, '0,100,101', '市场部门', 2, '若依', '15888888888', 'ry@qq.com', '0', '0', 1, '2022-06-17 17:20:19.000', NULL, NULL); -INSERT INTO `sys_dept` VALUES (105, 101, '0,100,101', '测试部门', 3, '若依', '15888888888', 'ry@qq.com', '0', '0', 1, '2022-06-17 17:20:19.000', NULL, NULL); -INSERT INTO `sys_dept` VALUES (106, 101, '0,100,101', '财务部门', 4, '若依', '15888888888', 'ry@qq.com', '0', '0', 1, '2022-06-17 17:20:19.000', NULL, NULL); -INSERT INTO `sys_dept` VALUES (107, 101, '0,100,101', '运维部门', 5, '若依', '15888888888', 'ry@qq.com', '0', '0', 1, '2022-06-17 17:20:19.000', NULL, NULL); -INSERT INTO `sys_dept` VALUES (108, 102, '0,100,102', '市场部门', 1, '若依', '15888888888', 'ry@qq.com', '0', '0', 1, '2022-06-17 17:20:19.000', NULL, NULL); -INSERT INTO `sys_dept` VALUES (109, 102, '0,100,102', '财务部门', 2, '若依', '15888888888', 'ry@qq.com', '0', '0', 1, '2022-06-17 17:20:19.000', NULL, NULL); - --- ---------------------------- --- Table structure for sys_dict_data --- ---------------------------- -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) NULL DEFAULT 0 COMMENT '字典排序', - `dict_label` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '字典标签', - `dict_value` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '字典键值', - `dict_type` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '字典类型', - `css_class` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '样式属性(其他样式扩展)', - `list_class` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '表格回显样式', - `is_default` char(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT 'N' COMMENT '是否默认(Y是 N否)', - `status` char(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '0' COMMENT '状态(0正常 1停用)', - `create_by` bigint(20) NULL DEFAULT NULL COMMENT '创建者', - `create_time` datetime(3) NULL DEFAULT NULL COMMENT '创建时间', - `update_by` bigint(20) NULL DEFAULT NULL COMMENT '更新者', - `update_time` datetime(3) NULL DEFAULT NULL COMMENT '更新时间', - `remark` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '备注', - PRIMARY KEY (`dict_code`) USING BTREE -) ENGINE = InnoDB AUTO_INCREMENT = 144 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '字典数据表' ROW_FORMAT = Dynamic; - --- ---------------------------- --- Records of sys_dict_data --- ---------------------------- -INSERT INTO `sys_dict_data` VALUES (1, 1, '男', '0', 'sys_user_sex', '', '', 'Y', '0', 1, '2022-06-17 17:20:28.000', NULL, NULL, '性别男'); -INSERT INTO `sys_dict_data` VALUES (2, 2, '女', '1', 'sys_user_sex', '', '', 'N', '0', 1, '2022-06-17 17:20:28.000', NULL, NULL, '性别女'); -INSERT INTO `sys_dict_data` VALUES (3, 3, '未知', '2', 'sys_user_sex', '', '', 'N', '0', 1, '2022-06-17 17:20:28.000', NULL, NULL, '性别未知'); -INSERT INTO `sys_dict_data` VALUES (4, 1, '显示', '0', 'sys_show_hide', '', 'primary', 'Y', '0', 1, '2022-06-17 17:20:28.000', NULL, NULL, '显示菜单'); -INSERT INTO `sys_dict_data` VALUES (5, 2, '隐藏', '1', 'sys_show_hide', '', 'danger', 'N', '0', 1, '2022-06-17 17:20:28.000', NULL, NULL, '隐藏菜单'); -INSERT INTO `sys_dict_data` VALUES (6, 1, '正常', '0', 'sys_normal_disable', '', 'primary', 'Y', '0', 1, '2022-06-17 17:20:28.000', NULL, NULL, '正常状态'); -INSERT INTO `sys_dict_data` VALUES (7, 2, '停用', '1', 'sys_normal_disable', '', 'danger', 'N', '0', 1, '2022-06-17 17:20:28.000', NULL, NULL, '停用状态'); -INSERT INTO `sys_dict_data` VALUES (8, 1, '正常', '0', 'sys_job_status', '', 'primary', 'Y', '0', 1, '2022-06-17 17:20:28.000', NULL, NULL, '正常状态'); -INSERT INTO `sys_dict_data` VALUES (9, 2, '暂停', '1', 'sys_job_status', '', 'danger', 'N', '0', 1, '2022-06-17 17:20:28.000', NULL, NULL, '停用状态'); -INSERT INTO `sys_dict_data` VALUES (10, 1, '默认', 'DEFAULT', 'sys_job_group', '', '', 'Y', '0', 1, '2022-06-17 17:20:28.000', NULL, NULL, '默认分组'); -INSERT INTO `sys_dict_data` VALUES (11, 2, '系统', 'SYSTEM', 'sys_job_group', '', '', 'N', '0', 1, '2022-06-17 17:20:28.000', NULL, NULL, '系统分组'); -INSERT INTO `sys_dict_data` VALUES (12, 1, '是', 'Y', 'sys_yes_no', '', 'primary', 'Y', '0', 1, '2022-06-17 17:20:28.000', NULL, NULL, '系统默认是'); -INSERT INTO `sys_dict_data` VALUES (13, 2, '否', 'N', 'sys_yes_no', '', 'danger', 'N', '0', 1, '2022-06-17 17:20:28.000', NULL, NULL, '系统默认否'); -INSERT INTO `sys_dict_data` VALUES (14, 1, '通知', '1', 'sys_notice_type', '', 'warning', 'Y', '0', 1, '2022-06-17 17:20:28.000', NULL, NULL, '通知'); -INSERT INTO `sys_dict_data` VALUES (15, 2, '公告', '2', 'sys_notice_type', '', 'success', 'N', '0', 1, '2022-06-17 17:20:28.000', NULL, NULL, '公告'); -INSERT INTO `sys_dict_data` VALUES (16, 1, '正常', '0', 'sys_notice_status', '', 'primary', 'Y', '0', 1, '2022-06-17 17:20:29.000', NULL, NULL, '正常状态'); -INSERT INTO `sys_dict_data` VALUES (17, 2, '关闭', '1', 'sys_notice_status', '', 'danger', 'N', '0', 1, '2022-06-17 17:20:29.000', NULL, NULL, '关闭状态'); -INSERT INTO `sys_dict_data` VALUES (18, 1, '新增', '1', 'sys_oper_type', '', 'info', 'N', '0', 1, '2022-06-17 17:20:29.000', NULL, NULL, '新增操作'); -INSERT INTO `sys_dict_data` VALUES (19, 2, '修改', '2', 'sys_oper_type', '', 'info', 'N', '0', 1, '2022-06-17 17:20:29.000', NULL, NULL, '修改操作'); -INSERT INTO `sys_dict_data` VALUES (20, 3, '删除', '3', 'sys_oper_type', '', 'danger', 'N', '0', 1, '2022-06-17 17:20:29.000', NULL, NULL, '删除操作'); -INSERT INTO `sys_dict_data` VALUES (21, 4, '授权', '4', 'sys_oper_type', '', 'primary', 'N', '0', 1, '2022-06-17 17:20:29.000', NULL, NULL, '授权操作'); -INSERT INTO `sys_dict_data` VALUES (22, 5, '导出', '5', 'sys_oper_type', '', 'warning', 'N', '0', 1, '2022-06-17 17:20:29.000', NULL, NULL, '导出操作'); -INSERT INTO `sys_dict_data` VALUES (23, 6, '导入', '6', 'sys_oper_type', '', 'warning', 'N', '0', 1, '2022-06-17 17:20:29.000', NULL, NULL, '导入操作'); -INSERT INTO `sys_dict_data` VALUES (24, 7, '强退', '7', 'sys_oper_type', '', 'danger', 'N', '0', 1, '2022-06-17 17:20:29.000', NULL, NULL, '强退操作'); -INSERT INTO `sys_dict_data` VALUES (25, 8, '生成代码', '8', 'sys_oper_type', '', 'warning', 'N', '0', 1, '2022-06-17 17:20:29.000', NULL, NULL, '生成操作'); -INSERT INTO `sys_dict_data` VALUES (26, 9, '清空数据', '9', 'sys_oper_type', '', 'danger', 'N', '0', 1, '2022-06-17 17:20:29.000', NULL, NULL, '清空操作'); -INSERT INTO `sys_dict_data` VALUES (27, 1, '成功', '0', 'sys_common_status', '', 'primary', 'N', '0', 1, '2022-06-17 17:20:29.000', NULL, NULL, '正常状态'); -INSERT INTO `sys_dict_data` VALUES (28, 2, '失败', '1', 'sys_common_status', '', 'danger', 'N', '0', 1, '2022-06-17 17:20:29.000', NULL, NULL, '停用状态'); -INSERT INTO `sys_dict_data` VALUES (100, 0, '原物料', '原物料', 'wms_item_type', NULL, 'default', 'N', '0', 1, '2022-08-18 15:49:33.000', NULL, NULL, NULL); -INSERT INTO `sys_dict_data` VALUES (101, 1, '半成品', '半成品', 'wms_item_type', NULL, 'default', 'N', '0', 1, '2022-08-18 15:49:58.000', NULL, NULL, NULL); -INSERT INTO `sys_dict_data` VALUES (102, 2, '产成品', '产成品', 'wms_item_type', NULL, 'default', 'N', '0', 1, '2022-08-18 15:50:15.000', NULL, NULL, NULL); -INSERT INTO `sys_dict_data` VALUES (103, 3, '原辅料', '原辅料', 'wms_item_type', NULL, 'default', 'N', '0', 1, '2022-08-18 15:50:35.000', NULL, NULL, NULL); -INSERT INTO `sys_dict_data` VALUES (104, 0, '第一级', '第一级', 'wms_carrier_level', NULL, 'default', 'N', '0', 1, '2022-08-18 17:51:14.000', NULL, NULL, NULL); -INSERT INTO `sys_dict_data` VALUES (105, 1, '第二级', '第二级', 'wms_carrier_level', NULL, 'default', 'N', '0', 1, '2022-08-18 17:51:27.000', NULL, NULL, NULL); -INSERT INTO `sys_dict_data` VALUES (106, 0, '第一级', '第一级', 'wms_supplier_level', NULL, 'default', 'N', '0', 1, '2022-08-18 18:05:23.000', NULL, NULL, NULL); -INSERT INTO `sys_dict_data` VALUES (107, 1, '第二级', '第二级', 'wms_supplier_level', NULL, 'default', 'N', '0', 1, '2022-08-18 18:05:35.000', NULL, NULL, NULL); -INSERT INTO `sys_dict_data` VALUES (108, 2, '第三级', '第三级', 'wms_supplier_level', NULL, 'default', 'N', '0', 1, '2022-08-18 18:05:48.000', NULL, NULL, NULL); -INSERT INTO `sys_dict_data` VALUES (109, 0, '采购入库', '1', 'wms_receipt_type', NULL, 'default', 'N', '0', 1, '2022-08-21 15:04:34.000', 1, '2022-08-23 17:37:07.000', NULL); -INSERT INTO `sys_dict_data` VALUES (110, 1, '外协入库', '2', 'wms_receipt_type', NULL, 'default', 'N', '0', 1, '2022-08-21 15:05:39.000', 1, '2022-08-23 17:37:16.000', NULL); -INSERT INTO `sys_dict_data` VALUES (112, 2, '退货入库', '3', 'wms_receipt_type', NULL, 'default', 'N', '0', 1, '2022-08-23 17:31:45.000', 1, '2022-08-23 17:37:21.000', NULL); -INSERT INTO `sys_dict_data` VALUES (113, 0, '未发货', '0', 'wms_receipt_status', NULL, 'default', 'N', '0', 1, '2022-08-29 17:19:12.000', NULL, NULL, NULL); -INSERT INTO `sys_dict_data` VALUES (114, 1, '在途(已发货未入库)', '1', 'wms_receipt_status', NULL, 'default', 'N', '0', 1, '2022-08-29 17:19:24.000', 1, '2022-08-29 17:53:52.000', NULL); -INSERT INTO `sys_dict_data` VALUES (115, 2, '部分入库', '2', 'wms_receipt_status', NULL, 'default', 'N', '0', 1, '2022-08-29 17:19:35.000', 1, '2022-08-29 17:19:47.000', NULL); -INSERT INTO `sys_dict_data` VALUES (116, 4, '入库完成', '3', 'wms_receipt_status', NULL, 'default', 'N', '0', 1, '2022-08-29 17:20:35.000', 1, '2022-09-21 11:59:33.000', NULL); -INSERT INTO `sys_dict_data` VALUES (117, 3, '作废', '4', 'wms_receipt_status', NULL, 'default', 'N', '0', 1, '2022-09-21 11:59:23.000', NULL, NULL, NULL); -INSERT INTO `sys_dict_data` VALUES (118, 0, '销售出库', '11', 'wms_shipment_type', NULL, 'default', 'N', '0', 1, '2022-10-20 13:34:06.000', NULL, NULL, NULL); -INSERT INTO `sys_dict_data` VALUES (119, 1, '外协出库', '12', 'wms_shipment_type', NULL, 'default', 'N', '0', 1, '2022-10-20 13:34:26.000', NULL, NULL, NULL); -INSERT INTO `sys_dict_data` VALUES (121, 0, '未发货', '11', 'wms_shipment_status', NULL, 'default', 'N', '0', 1, '2022-10-20 13:40:02.000', NULL, NULL, NULL); -INSERT INTO `sys_dict_data` VALUES (122, 1, '部分发货', '12', 'wms_shipment_status', NULL, 'default', 'N', '0', 1, '2022-10-20 13:40:26.000', NULL, NULL, NULL); -INSERT INTO `sys_dict_data` VALUES (123, 2, '已发货', '13', 'wms_shipment_status', NULL, 'default', 'N', '0', 1, '2022-10-20 13:40:44.000', NULL, NULL, NULL); -INSERT INTO `sys_dict_data` VALUES (124, 3, '作废', '14', 'wms_shipment_status', NULL, 'default', 'N', '0', 1, '2022-10-20 13:41:05.000', NULL, NULL, NULL); -INSERT INTO `sys_dict_data` VALUES (125, 0, '调拨出库', '21', 'wms_movement_type', NULL, 'default', 'N', '0', 1, '2022-10-20 14:23:13.000', 1, '2022-11-02 16:00:25.000', NULL); -INSERT INTO `sys_dict_data` VALUES (126, 0, '调拨入库', '22', 'wms_movement_type', NULL, 'default', 'N', '0', 1, '2022-10-20 14:23:24.000', 1, '2022-11-02 16:00:32.000', NULL); -INSERT INTO `sys_dict_data` VALUES (127, 0, '未操作', '21', 'wms_movement_status', NULL, 'default', 'N', '0', 1, '2022-10-20 14:25:46.000', 1, '2022-10-20 14:26:08.000', NULL); -INSERT INTO `sys_dict_data` VALUES (128, 1, '部分移动', '22', 'wms_movement_status', NULL, 'default', 'N', '0', 1, '2022-10-20 14:26:20.000', NULL, NULL, NULL); -INSERT INTO `sys_dict_data` VALUES (129, 2, '操作完毕', '23', 'wms_movement_status', NULL, 'default', 'N', '0', 1, '2022-10-20 14:26:35.000', 1, '2022-10-20 14:26:44.000', NULL); -INSERT INTO `sys_dict_data` VALUES (130, 3, '已作废', '24', 'wms_movement_status', NULL, 'default', 'N', '0', 1, '2022-10-20 14:27:03.000', NULL, NULL, NULL); -INSERT INTO `sys_dict_data` VALUES (131, 0, '盘库中', '11', 'wms_check_status', NULL, 'default', 'N', '0', 1, '2023-04-26 11:19:35.000', NULL, NULL, NULL); -INSERT INTO `sys_dict_data` VALUES (132, 0, '已完成', '22', 'wms_check_status', NULL, 'default', 'N', '0', 1, '2023-04-26 11:19:43.000', NULL, NULL, NULL); -INSERT INTO `sys_dict_data` VALUES (133, 0, '结款', '11', 'wms_supplier_transaction_type', NULL, 'default', 'N', '0', 1, '2023-05-04 12:53:39.000', NULL, NULL, NULL); -INSERT INTO `sys_dict_data` VALUES (134, 0, '应付', '22', 'wms_supplier_transaction_type', NULL, 'default', 'N', '0', 1, '2023-05-04 12:53:48.000', NULL, NULL, NULL); -INSERT INTO `sys_dict_data` VALUES (135, 0, '采购入库', '33', 'wms_supplier_transaction_type', NULL, 'default', 'N', '0', 1, '2023-05-04 12:54:02.000', 1, '2023-05-04 17:40:16.000', NULL); -INSERT INTO `sys_dict_data` VALUES (136, 0, '结款', '11', 'wms_customer_transaction_type', NULL, 'default', 'N', '0', 1, '2023-05-04 16:59:16.000', NULL, NULL, NULL); -INSERT INTO `sys_dict_data` VALUES (137, 0, '应收', '22', 'wms_customer_transaction_type', NULL, 'default', 'N', '0', 1, '2023-05-04 16:59:28.000', 1, '2023-05-04 17:49:51.000', NULL); -INSERT INTO `sys_dict_data` VALUES (138, 0, '销售出库', '33', 'wms_customer_transaction_type', NULL, 'default', 'N', '0', 1, '2023-05-04 17:00:43.000', 1, '2023-05-04 17:40:09.000', NULL); -INSERT INTO `sys_dict_data` VALUES (139, 1, '盘盈入库', '32', 'wms_check_type', NULL, 'default', 'N', '0', 1, '2023-07-25 05:30:29.000', NULL, NULL, NULL); -INSERT INTO `sys_dict_data` VALUES (140, 0, '盘亏出库', '31', 'wms_check_type', NULL, 'default', 'N', '0', 1, '2023-07-25 05:30:52.000', NULL, NULL, NULL); -INSERT INTO `sys_dict_data` VALUES (141, 0, '仓库', '5', 'wms_inventory_panel_type', NULL, 'default', 'N', '0', 1, '2023-07-28 07:15:00.000', NULL, NULL, NULL); -INSERT INTO `sys_dict_data` VALUES (142, 1, '库区', '10', 'wms_inventory_panel_type', NULL, 'default', 'N', '0', 1, '2023-07-28 07:15:10.000', NULL, NULL, NULL); -INSERT INTO `sys_dict_data` VALUES (144, 3, '物料', '20', 'wms_inventory_panel_type', NULL, 'default', 'N', '0', 1, '2023-07-28 07:18:05.000', NULL, NULL, NULL); --- ---------------------------- --- Table structure for sys_dict_type --- ---------------------------- -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) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '字典名称', - `dict_type` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '字典类型', - `status` char(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '0' COMMENT '状态(0正常 1停用)', - `create_by` bigint(20) NULL DEFAULT NULL COMMENT '创建者', - `create_time` datetime(3) NULL DEFAULT NULL COMMENT '创建时间', - `update_by` bigint(20) NULL DEFAULT NULL COMMENT '更新者', - `update_time` datetime(3) NULL DEFAULT NULL COMMENT '更新时间', - `remark` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '备注', - PRIMARY KEY (`dict_id`) USING BTREE, - UNIQUE INDEX `dict_type`(`dict_type`) USING BTREE -) ENGINE = InnoDB AUTO_INCREMENT = 113 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '字典类型表' ROW_FORMAT = Dynamic; - --- ---------------------------- --- Records of sys_dict_type --- ---------------------------- -INSERT INTO `sys_dict_type` VALUES (1, '用户性别', 'sys_user_sex', '0', 1, '2022-06-17 17:20:27.000', NULL, NULL, '用户性别列表'); -INSERT INTO `sys_dict_type` VALUES (2, '菜单状态', 'sys_show_hide', '0', 1, '2022-06-17 17:20:27.000', NULL, NULL, '菜单状态列表'); -INSERT INTO `sys_dict_type` VALUES (3, '系统开关', 'sys_normal_disable', '0', 1, '2022-06-17 17:20:27.000', NULL, NULL, '系统开关列表'); -INSERT INTO `sys_dict_type` VALUES (4, '任务状态', 'sys_job_status', '0', 1, '2022-06-17 17:20:28.000', NULL, NULL, '任务状态列表'); -INSERT INTO `sys_dict_type` VALUES (5, '任务分组', 'sys_job_group', '0', 1, '2022-06-17 17:20:28.000', NULL, NULL, '任务分组列表'); -INSERT INTO `sys_dict_type` VALUES (6, '系统是否', 'sys_yes_no', '0', 1, '2022-06-17 17:20:28.000', NULL, NULL, '系统是否列表'); -INSERT INTO `sys_dict_type` VALUES (7, '通知类型', 'sys_notice_type', '0', 1, '2022-06-17 17:20:28.000', NULL, NULL, '通知类型列表'); -INSERT INTO `sys_dict_type` VALUES (8, '通知状态', 'sys_notice_status', '0', 1, '2022-06-17 17:20:28.000', NULL, NULL, '通知状态列表'); -INSERT INTO `sys_dict_type` VALUES (9, '操作类型', 'sys_oper_type', '0', 1, '2022-06-17 17:20:28.000', NULL, NULL, '操作类型列表'); -INSERT INTO `sys_dict_type` VALUES (10, '系统状态', 'sys_common_status', '0', 1, '2022-06-17 17:20:28.000', NULL, NULL, '登录状态列表'); -INSERT INTO `sys_dict_type` VALUES (100, '物料分类', 'wms_item_type', '0', 1, '2022-08-18 15:47:49.000', NULL, NULL, NULL); -INSERT INTO `sys_dict_type` VALUES (101, '承运商级别', 'wms_carrier_level', '0', 1, '2022-08-18 17:50:40.000', NULL, NULL, NULL); -INSERT INTO `sys_dict_type` VALUES (102, '供应商级别', 'wms_supplier_level', '0', 1, '2022-08-18 18:05:02.000', NULL, NULL, NULL); -INSERT INTO `sys_dict_type` VALUES (103, '入库类型', 'wms_receipt_type', '0', 1, '2022-08-21 15:03:58.000', NULL, NULL, NULL); -INSERT INTO `sys_dict_type` VALUES (104, '入库状态', 'wms_receipt_status', '0', 1, '2022-08-29 17:18:35.000', NULL, NULL, NULL); -INSERT INTO `sys_dict_type` VALUES (105, '出库类型', 'wms_shipment_type', '0', 1, '2022-10-20 13:33:29.000', NULL, NULL, NULL); -INSERT INTO `sys_dict_type` VALUES (106, '出库状态', 'wms_shipment_status', '0', 1, '2022-10-20 13:39:41.000', NULL, NULL, NULL); -INSERT INTO `sys_dict_type` VALUES (107, '移库类型', 'wms_movement_type', '0', 1, '2022-10-20 14:22:52.000', NULL, NULL, NULL); -INSERT INTO `sys_dict_type` VALUES (108, '移库状态', 'wms_movement_status', '0', 1, '2022-10-20 14:24:43.000', 1, '2022-10-20 14:24:55.000', NULL); -INSERT INTO `sys_dict_type` VALUES (109, '盘点单据状态', 'wms_check_status', '0', 1, '2023-04-26 11:17:35.000', NULL, NULL, NULL); -INSERT INTO `sys_dict_type` VALUES (110, '供应商账号交易类型', 'wms_supplier_transaction_type', '0', 1, '2023-05-04 12:52:59.000', NULL, NULL, '1:结款;2:应付;3:入库单'); -INSERT INTO `sys_dict_type` VALUES (111, '客户账户交易类型', 'wms_customer_transaction_type', '0', 1, '2023-05-04 16:58:45.000', NULL, NULL, '1:结款;2:应付;3:出库单'); -INSERT INTO `sys_dict_type` VALUES (112, '盘点类型', 'wms_check_type', '0', 1, '2023-07-25 05:29:44.000', NULL, NULL, NULL); -INSERT INTO `sys_dict_type` VALUES (113, '库存看板类型', 'wms_inventory_panel_type', '0', 1, '2023-07-28 07:12:50.000', NULL, NULL, NULL); - --- ---------------------------- --- Table structure for sys_job --- ---------------------------- -DROP TABLE IF EXISTS `sys_job`; -CREATE TABLE `sys_job` ( - `job_id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '任务ID', - `job_name` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '任务名称', - `job_group` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT 'DEFAULT' COMMENT '任务组名', - `invoke_target` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '调用目标字符串', - `cron_expression` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT 'cron执行表达式', - `misfire_policy` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '3' COMMENT '计划执行错误策略(1立即执行 2执行一次 3放弃执行)', - `concurrent` char(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '1' COMMENT '是否并发执行(0允许 1禁止)', - `status` char(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '0' COMMENT '状态(0正常 1暂停)', - `create_by` bigint(20) NULL DEFAULT NULL COMMENT '创建者', - `create_time` datetime(3) NULL DEFAULT NULL COMMENT '创建时间', - `update_by` bigint(20) NULL DEFAULT NULL COMMENT '更新者', - `update_time` datetime(3) NULL DEFAULT NULL COMMENT '更新时间', - `remark` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '备注信息', - PRIMARY KEY (`job_id`, `job_name`, `job_group`) USING BTREE -) ENGINE = InnoDB AUTO_INCREMENT = 100 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '定时任务调度表' ROW_FORMAT = Dynamic; - --- ---------------------------- --- Records of sys_job --- ---------------------------- -INSERT INTO `sys_job` VALUES (1, '系统默认(无参)', 'DEFAULT', 'ryTask.ryNoParams', '0/10 * * * * ?', '3', '1', '1', 1, '2022-06-17 17:20:29.000', NULL, NULL, ''); -INSERT INTO `sys_job` VALUES (2, '系统默认(有参)', 'DEFAULT', 'ryTask.ryParams(\'ry\')', '0/15 * * * * ?', '3', '1', '1', 1, '2022-06-17 17:20:29.000', NULL, NULL, ''); -INSERT INTO `sys_job` VALUES (3, '系统默认(多参)', 'DEFAULT', 'ryTask.ryMultipleParams(\'ry\', true, 2000L, 316.50D, 100)', '0/20 * * * * ?', '3', '1', '1', 1, '2022-06-17 17:20:29.000', NULL, NULL, ''); - --- ---------------------------- --- Table structure for sys_job_log --- ---------------------------- -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) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '任务名称', - `job_group` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '任务组名', - `invoke_target` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '调用目标字符串', - `job_message` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '日志信息', - `status` char(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '0' COMMENT '执行状态(0正常 1失败)', - `exception_info` varchar(2000) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '异常信息', - `create_time` datetime(0) NULL DEFAULT NULL COMMENT '创建时间', - PRIMARY KEY (`job_log_id`) USING BTREE -) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '定时任务调度日志表' ROW_FORMAT = Dynamic; - --- ---------------------------- --- Table structure for sys_logininfor --- ---------------------------- -DROP TABLE IF EXISTS `sys_logininfor`; -CREATE TABLE `sys_logininfor` ( - `info_id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '访问ID', - `user_name` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '用户账号', - `ipaddr` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '登录IP地址', - `login_location` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '登录地点', - `browser` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '浏览器类型', - `os` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '操作系统', - `status` char(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '0' COMMENT '登录状态(0成功 1失败)', - `msg` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '提示消息', - `login_time` datetime(0) NULL DEFAULT NULL COMMENT '访问时间', - PRIMARY KEY (`info_id`) USING BTREE -) ENGINE = InnoDB AUTO_INCREMENT = 920 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '系统访问记录' ROW_FORMAT = Dynamic; - --- ---------------------------- --- Table structure for sys_menu --- ---------------------------- -DROP TABLE IF EXISTS `sys_menu`; -CREATE TABLE `sys_menu` ( - `menu_id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '菜单ID', - `menu_name` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '菜单名称', - `parent_id` bigint(20) NULL DEFAULT 0 COMMENT '父菜单ID', - `order_num` int(4) NULL DEFAULT 0 COMMENT '显示顺序', - `path` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '路由地址', - `component` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '组件路径', - `query` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '路由参数', - `is_frame` int(1) NULL DEFAULT 1 COMMENT '是否为外链(0是 1否)', - `is_cache` int(1) NULL DEFAULT 0 COMMENT '是否缓存(0缓存 1不缓存)', - `menu_type` char(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '菜单类型(M目录 C菜单 F按钮)', - `visible` char(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '0' COMMENT '菜单状态(0显示 1隐藏)', - `status` char(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '0' COMMENT '菜单状态(0正常 1停用)', - `perms` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '权限标识', - `icon` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '#' COMMENT '菜单图标', - `create_by` bigint(20) NULL DEFAULT NULL COMMENT '创建者', - `create_time` datetime(3) NULL DEFAULT NULL COMMENT '创建时间', - `update_by` bigint(20) NULL DEFAULT NULL COMMENT '更新者', - `update_time` datetime(3) NULL DEFAULT NULL COMMENT '更新时间', - `remark` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '备注', - PRIMARY KEY (`menu_id`) USING BTREE -) ENGINE = InnoDB AUTO_INCREMENT = 2235 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '菜单权限表' ROW_FORMAT = Dynamic; - --- ---------------------------- --- Records of sys_menu --- ---------------------------- -INSERT INTO `sys_menu` VALUES (1, '系统管理', 0, 300, 'system', NULL, '', 1, 0, 'M', '0', '0', '', 'system', 1, '2022-06-17 17:20:20.000', 1, '2022-10-31 09:09:13.000', '系统管理目录'); -INSERT INTO `sys_menu` VALUES (2, '系统监控', 0, 200, 'monitor', NULL, '', 1, 0, 'M', '0', '0', '', 'monitor', 1, '2022-06-17 17:20:20.000', 1, '2022-10-31 09:09:02.000', '系统监控目录'); -INSERT INTO `sys_menu` VALUES (3, '系统工具', 0, 100, 'tool', NULL, '', 1, 0, 'M', '0', '0', '', 'tool', 1, '2022-06-17 17:20:20.000', 1, '2022-10-31 09:08:48.000', '系统工具目录'); -INSERT INTO `sys_menu` VALUES (100, '用户管理', 1, 1, 'user', 'system/user/index', '', 1, 0, 'C', '0', '0', 'system:user:list', 'user', 1, '2022-06-17 17:20:20.000', NULL, NULL, '用户管理菜单'); -INSERT INTO `sys_menu` VALUES (101, '角色管理', 1, 2, 'role', 'system/role/index', '', 1, 0, 'C', '0', '0', 'system:role:list', 'peoples', 1, '2022-06-17 17:20:20.000', NULL, NULL, '角色管理菜单'); -INSERT INTO `sys_menu` VALUES (102, '菜单管理', 1, 3, 'menu', 'system/menu/index', '', 1, 0, 'C', '0', '0', 'system:menu:list', 'tree-table', 1, '2022-06-17 17:20:20.000', NULL, NULL, '菜单管理菜单'); -INSERT INTO `sys_menu` VALUES (103, '部门管理', 1, 4, 'dept', 'system/dept/index', '', 1, 0, 'C', '0', '0', 'system:dept:list', 'tree', 1, '2022-06-17 17:20:20.000', NULL, NULL, '部门管理菜单'); -INSERT INTO `sys_menu` VALUES (104, '岗位管理', 1, 5, 'post', 'system/post/index', '', 1, 0, 'C', '0', '0', 'system:post:list', 'post', 1, '2022-06-17 17:20:20.000', NULL, NULL, '岗位管理菜单'); -INSERT INTO `sys_menu` VALUES (105, '字典管理', 1, 6, 'dict', 'system/dict/index', '', 1, 0, 'C', '0', '0', 'system:dict:list', 'dict', 1, '2022-06-17 17:20:20.000', NULL, NULL, '字典管理菜单'); -INSERT INTO `sys_menu` VALUES (106, '参数设置', 1, 7, 'config', 'system/config/index', '', 1, 0, 'C', '0', '0', 'system:config:list', 'edit', 1, '2022-06-17 17:20:20.000', NULL, NULL, '参数设置菜单'); -INSERT INTO `sys_menu` VALUES (107, '通知公告', 1, 8, 'notice', 'system/notice/index', '', 1, 0, 'C', '0', '0', 'system:notice:list', 'message', 1, '2022-06-17 17:20:20.000', NULL, NULL, '通知公告菜单'); -INSERT INTO `sys_menu` VALUES (108, '日志管理', 1, 9, 'log', '', '', 1, 0, 'M', '0', '0', '', 'log', 1, '2022-06-17 17:20:20.000', NULL, NULL, '日志管理菜单'); -INSERT INTO `sys_menu` VALUES (109, '在线用户', 2, 1, 'online', 'monitor/online/index', '', 1, 0, 'C', '0', '0', 'monitor:online:list', 'online', 1, '2022-06-17 17:20:20.000', NULL, NULL, '在线用户菜单'); -INSERT INTO `sys_menu` VALUES (110, '定时任务', 2, 2, 'job', 'monitor/job/index', '', 1, 0, 'C', '0', '0', 'monitor:job:list', 'job', 1, '2022-06-17 17:20:20.000', NULL, NULL, '定时任务菜单'); -INSERT INTO `sys_menu` VALUES (111, '数据监控', 2, 3, 'druid', 'monitor/druid/index', '', 1, 0, 'C', '0', '0', 'monitor:druid:list', 'druid', 1, '2022-06-17 17:20:20.000', NULL, NULL, '数据监控菜单'); -INSERT INTO `sys_menu` VALUES (112, '服务监控', 2, 4, 'server', 'monitor/server/index', '', 1, 0, 'C', '0', '0', 'monitor:server:list', 'server', 1, '2022-06-17 17:20:20.000', NULL, NULL, '服务监控菜单'); -INSERT INTO `sys_menu` VALUES (113, '缓存监控', 2, 5, 'cache', 'monitor/cache/index', '', 1, 0, 'C', '0', '0', 'monitor:cache:list', 'redis', 1, '2022-06-17 17:20:20.000', NULL, NULL, '缓存监控菜单'); -INSERT INTO `sys_menu` VALUES (114, '表单构建', 3, 1, 'build', 'tool/build/index', '', 1, 0, 'C', '0', '0', 'tool:build:list', 'build', 1, '2022-06-17 17:20:21.000', NULL, NULL, '表单构建菜单'); -INSERT INTO `sys_menu` VALUES (115, '代码生成', 3, 2, 'gen', 'tool/gen/index', '', 1, 0, 'C', '0', '0', 'tool:gen:list', 'code', 1, '2022-06-17 17:20:21.000', NULL, NULL, '代码生成菜单'); -INSERT INTO `sys_menu` VALUES (116, '系统接口', 3, 3, 'swagger', 'tool/swagger/index', '', 1, 0, 'C', '0', '0', 'tool:swagger:list', 'swagger', 1, '2022-06-17 17:20:21.000', NULL, NULL, '系统接口菜单'); -INSERT INTO `sys_menu` VALUES (500, '操作日志', 108, 1, 'operlog', 'monitor/operlog/index', '', 1, 0, 'C', '0', '0', 'monitor:operlog:list', 'form', 1, '2022-06-17 17:20:21.000', NULL, NULL, '操作日志菜单'); -INSERT INTO `sys_menu` VALUES (501, '登录日志', 108, 2, 'logininfor', 'monitor/logininfor/index', '', 1, 0, 'C', '0', '0', 'monitor:logininfor:list', 'logininfor', 1, '2022-06-17 17:20:21.000', NULL, NULL, '登录日志菜单'); -INSERT INTO `sys_menu` VALUES (1001, '用户查询', 100, 1, '', '', '', 1, 0, 'F', '0', '0', 'system:user:query', '#', 1, '2022-06-17 17:20:21.000', NULL, NULL, ''); -INSERT INTO `sys_menu` VALUES (1002, '用户新增', 100, 2, '', '', '', 1, 0, 'F', '0', '0', 'system:user:add', '#', 1, '2022-06-17 17:20:21.000', NULL, NULL, ''); -INSERT INTO `sys_menu` VALUES (1003, '用户修改', 100, 3, '', '', '', 1, 0, 'F', '0', '0', 'system:user:edit', '#', 1, '2022-06-17 17:20:21.000', NULL, NULL, ''); -INSERT INTO `sys_menu` VALUES (1004, '用户删除', 100, 4, '', '', '', 1, 0, 'F', '0', '0', 'system:user:remove', '#', 1, '2022-06-17 17:20:21.000', NULL, NULL, ''); -INSERT INTO `sys_menu` VALUES (1005, '用户导出', 100, 5, '', '', '', 1, 0, 'F', '0', '0', 'system:user:export', '#', 1, '2022-06-17 17:20:21.000', NULL, NULL, ''); -INSERT INTO `sys_menu` VALUES (1006, '用户导入', 100, 6, '', '', '', 1, 0, 'F', '0', '0', 'system:user:import', '#', 1, '2022-06-17 17:20:21.000', NULL, NULL, ''); -INSERT INTO `sys_menu` VALUES (1007, '重置密码', 100, 7, '', '', '', 1, 0, 'F', '0', '0', 'system:user:resetPwd', '#', 1, '2022-06-17 17:20:21.000', NULL, NULL, ''); -INSERT INTO `sys_menu` VALUES (1008, '角色查询', 101, 1, '', '', '', 1, 0, 'F', '0', '0', 'system:role:query', '#', 1, '2022-06-17 17:20:21.000', NULL, NULL, ''); -INSERT INTO `sys_menu` VALUES (1009, '角色新增', 101, 2, '', '', '', 1, 0, 'F', '0', '0', 'system:role:add', '#', 1, '2022-06-17 17:20:21.000', NULL, NULL, ''); -INSERT INTO `sys_menu` VALUES (1010, '角色修改', 101, 3, '', '', '', 1, 0, 'F', '0', '0', 'system:role:edit', '#', 1, '2022-06-17 17:20:21.000', NULL, NULL, ''); -INSERT INTO `sys_menu` VALUES (1011, '角色删除', 101, 4, '', '', '', 1, 0, 'F', '0', '0', 'system:role:remove', '#', 1, '2022-06-17 17:20:21.000', NULL, NULL, ''); -INSERT INTO `sys_menu` VALUES (1012, '角色导出', 101, 5, '', '', '', 1, 0, 'F', '0', '0', 'system:role:export', '#', 1, '2022-06-17 17:20:21.000', NULL, NULL, ''); -INSERT INTO `sys_menu` VALUES (1013, '菜单查询', 102, 1, '', '', '', 1, 0, 'F', '0', '0', 'system:menu:query', '#', 1, '2022-06-17 17:20:21.000', NULL, NULL, ''); -INSERT INTO `sys_menu` VALUES (1014, '菜单新增', 102, 2, '', '', '', 1, 0, 'F', '0', '0', 'system:menu:add', '#', 1, '2022-06-17 17:20:21.000', NULL, NULL, ''); -INSERT INTO `sys_menu` VALUES (1015, '菜单修改', 102, 3, '', '', '', 1, 0, 'F', '0', '0', 'system:menu:edit', '#', 1, '2022-06-17 17:20:21.000', NULL, NULL, ''); -INSERT INTO `sys_menu` VALUES (1016, '菜单删除', 102, 4, '', '', '', 1, 0, 'F', '0', '0', 'system:menu:remove', '#', 1, '2022-06-17 17:20:21.000', NULL, NULL, ''); -INSERT INTO `sys_menu` VALUES (1017, '部门查询', 103, 1, '', '', '', 1, 0, 'F', '0', '0', 'system:dept:query', '#', 1, '2022-06-17 17:20:21.000', NULL, NULL, ''); -INSERT INTO `sys_menu` VALUES (1018, '部门新增', 103, 2, '', '', '', 1, 0, 'F', '0', '0', 'system:dept:add', '#', 1, '2022-06-17 17:20:22.000', NULL, NULL, ''); -INSERT INTO `sys_menu` VALUES (1019, '部门修改', 103, 3, '', '', '', 1, 0, 'F', '0', '0', 'system:dept:edit', '#', 1, '2022-06-17 17:20:22.000', NULL, NULL, ''); -INSERT INTO `sys_menu` VALUES (1020, '部门删除', 103, 4, '', '', '', 1, 0, 'F', '0', '0', 'system:dept:remove', '#', 1, '2022-06-17 17:20:22.000', NULL, NULL, ''); -INSERT INTO `sys_menu` VALUES (1021, '岗位查询', 104, 1, '', '', '', 1, 0, 'F', '0', '0', 'system:post:query', '#', 1, '2022-06-17 17:20:22.000', NULL, NULL, ''); -INSERT INTO `sys_menu` VALUES (1022, '岗位新增', 104, 2, '', '', '', 1, 0, 'F', '0', '0', 'system:post:add', '#', 1, '2022-06-17 17:20:22.000', NULL, NULL, ''); -INSERT INTO `sys_menu` VALUES (1023, '岗位修改', 104, 3, '', '', '', 1, 0, 'F', '0', '0', 'system:post:edit', '#', 1, '2022-06-17 17:20:22.000', NULL, NULL, ''); -INSERT INTO `sys_menu` VALUES (1024, '岗位删除', 104, 4, '', '', '', 1, 0, 'F', '0', '0', 'system:post:remove', '#', 1, '2022-06-17 17:20:22.000', NULL, NULL, ''); -INSERT INTO `sys_menu` VALUES (1025, '岗位导出', 104, 5, '', '', '', 1, 0, 'F', '0', '0', 'system:post:export', '#', 1, '2022-06-17 17:20:22.000', NULL, NULL, ''); -INSERT INTO `sys_menu` VALUES (1026, '字典查询', 105, 1, '#', '', '', 1, 0, 'F', '0', '0', 'system:dict:query', '#', 1, '2022-06-17 17:20:22.000', NULL, NULL, ''); -INSERT INTO `sys_menu` VALUES (1027, '字典新增', 105, 2, '#', '', '', 1, 0, 'F', '0', '0', 'system:dict:add', '#', 1, '2022-06-17 17:20:22.000', NULL, NULL, ''); -INSERT INTO `sys_menu` VALUES (1028, '字典修改', 105, 3, '#', '', '', 1, 0, 'F', '0', '0', 'system:dict:edit', '#', 1, '2022-06-17 17:20:22.000', NULL, NULL, ''); -INSERT INTO `sys_menu` VALUES (1029, '字典删除', 105, 4, '#', '', '', 1, 0, 'F', '0', '0', 'system:dict:remove', '#', 1, '2022-06-17 17:20:22.000', NULL, NULL, ''); -INSERT INTO `sys_menu` VALUES (1030, '字典导出', 105, 5, '#', '', '', 1, 0, 'F', '0', '0', 'system:dict:export', '#', 1, '2022-06-17 17:20:22.000', NULL, NULL, ''); -INSERT INTO `sys_menu` VALUES (1031, '参数查询', 106, 1, '#', '', '', 1, 0, 'F', '0', '0', 'system:config:query', '#', 1, '2022-06-17 17:20:22.000', NULL, NULL, ''); -INSERT INTO `sys_menu` VALUES (1032, '参数新增', 106, 2, '#', '', '', 1, 0, 'F', '0', '0', 'system:config:add', '#', 1, '2022-06-17 17:20:22.000', NULL, NULL, ''); -INSERT INTO `sys_menu` VALUES (1033, '参数修改', 106, 3, '#', '', '', 1, 0, 'F', '0', '0', 'system:config:edit', '#', 1, '2022-06-17 17:20:22.000', NULL, NULL, ''); -INSERT INTO `sys_menu` VALUES (1034, '参数删除', 106, 4, '#', '', '', 1, 0, 'F', '0', '0', 'system:config:remove', '#', 1, '2022-06-17 17:20:22.000', NULL, NULL, ''); -INSERT INTO `sys_menu` VALUES (1035, '参数导出', 106, 5, '#', '', '', 1, 0, 'F', '0', '0', 'system:config:export', '#', 1, '2022-06-17 17:20:22.000', NULL, NULL, ''); -INSERT INTO `sys_menu` VALUES (1036, '公告查询', 107, 1, '#', '', '', 1, 0, 'F', '0', '0', 'system:notice:query', '#', 1, '2022-06-17 17:20:22.000', NULL, NULL, ''); -INSERT INTO `sys_menu` VALUES (1037, '公告新增', 107, 2, '#', '', '', 1, 0, 'F', '0', '0', 'system:notice:add', '#', 1, '2022-06-17 17:20:22.000', NULL, NULL, ''); -INSERT INTO `sys_menu` VALUES (1038, '公告修改', 107, 3, '#', '', '', 1, 0, 'F', '0', '0', 'system:notice:edit', '#', 1, '2022-06-17 17:20:22.000', NULL, NULL, ''); -INSERT INTO `sys_menu` VALUES (1039, '公告删除', 107, 4, '#', '', '', 1, 0, 'F', '0', '0', 'system:notice:remove', '#', 1, '2022-06-17 17:20:22.000', NULL, NULL, ''); -INSERT INTO `sys_menu` VALUES (1040, '操作查询', 500, 1, '#', '', '', 1, 0, 'F', '0', '0', 'monitor:operlog:query', '#', 1, '2022-06-17 17:20:22.000', NULL, NULL, ''); -INSERT INTO `sys_menu` VALUES (1041, '操作删除', 500, 2, '#', '', '', 1, 0, 'F', '0', '0', 'monitor:operlog:remove', '#', 1, '2022-06-17 17:20:23.000', NULL, NULL, ''); -INSERT INTO `sys_menu` VALUES (1042, '日志导出', 500, 4, '#', '', '', 1, 0, 'F', '0', '0', 'monitor:operlog:export', '#', 1, '2022-06-17 17:20:23.000', NULL, NULL, ''); -INSERT INTO `sys_menu` VALUES (1043, '登录查询', 501, 1, '#', '', '', 1, 0, 'F', '0', '0', 'monitor:logininfor:query', '#', 1, '2022-06-17 17:20:23.000', NULL, NULL, ''); -INSERT INTO `sys_menu` VALUES (1044, '登录删除', 501, 2, '#', '', '', 1, 0, 'F', '0', '0', 'monitor:logininfor:remove', '#', 1, '2022-06-17 17:20:23.000', NULL, NULL, ''); -INSERT INTO `sys_menu` VALUES (1045, '日志导出', 501, 3, '#', '', '', 1, 0, 'F', '0', '0', 'monitor:logininfor:export', '#', 1, '2022-06-17 17:20:23.000', NULL, NULL, ''); -INSERT INTO `sys_menu` VALUES (1046, '在线查询', 109, 1, '#', '', '', 1, 0, 'F', '0', '0', 'monitor:online:query', '#', 1, '2022-06-17 17:20:23.000', NULL, NULL, ''); -INSERT INTO `sys_menu` VALUES (1047, '批量强退', 109, 2, '#', '', '', 1, 0, 'F', '0', '0', 'monitor:online:batchLogout', '#', 1, '2022-06-17 17:20:23.000', NULL, NULL, ''); -INSERT INTO `sys_menu` VALUES (1048, '单条强退', 109, 3, '#', '', '', 1, 0, 'F', '0', '0', 'monitor:online:forceLogout', '#', 1, '2022-06-17 17:20:23.000', NULL, NULL, ''); -INSERT INTO `sys_menu` VALUES (1049, '任务查询', 110, 1, '#', '', '', 1, 0, 'F', '0', '0', 'monitor:job:query', '#', 1, '2022-06-17 17:20:23.000', NULL, NULL, ''); -INSERT INTO `sys_menu` VALUES (1050, '任务新增', 110, 2, '#', '', '', 1, 0, 'F', '0', '0', 'monitor:job:add', '#', 1, '2022-06-17 17:20:23.000', NULL, NULL, ''); -INSERT INTO `sys_menu` VALUES (1051, '任务修改', 110, 3, '#', '', '', 1, 0, 'F', '0', '0', 'monitor:job:edit', '#', 1, '2022-06-17 17:20:23.000', NULL, NULL, ''); -INSERT INTO `sys_menu` VALUES (1052, '任务删除', 110, 4, '#', '', '', 1, 0, 'F', '0', '0', 'monitor:job:remove', '#', 1, '2022-06-17 17:20:23.000', NULL, NULL, ''); -INSERT INTO `sys_menu` VALUES (1053, '状态修改', 110, 5, '#', '', '', 1, 0, 'F', '0', '0', 'monitor:job:changeStatus', '#', 1, '2022-06-17 17:20:23.000', NULL, NULL, ''); -INSERT INTO `sys_menu` VALUES (1054, '任务导出', 110, 7, '#', '', '', 1, 0, 'F', '0', '0', 'monitor:job:export', '#', 1, '2022-06-17 17:20:23.000', NULL, NULL, ''); -INSERT INTO `sys_menu` VALUES (1055, '生成查询', 115, 1, '#', '', '', 1, 0, 'F', '0', '0', 'tool:gen:query', '#', 1, '2022-06-17 17:20:23.000', NULL, NULL, ''); -INSERT INTO `sys_menu` VALUES (1056, '生成修改', 115, 2, '#', '', '', 1, 0, 'F', '0', '0', 'tool:gen:edit', '#', 1, '2022-06-17 17:20:23.000', NULL, NULL, ''); -INSERT INTO `sys_menu` VALUES (1057, '生成删除', 115, 3, '#', '', '', 1, 0, 'F', '0', '0', 'tool:gen:remove', '#', 1, '2022-06-17 17:20:23.000', NULL, NULL, ''); -INSERT INTO `sys_menu` VALUES (1058, '导入代码', 115, 2, '#', '', '', 1, 0, 'F', '0', '0', 'tool:gen:import', '#', 1, '2022-06-17 17:20:23.000', NULL, NULL, ''); -INSERT INTO `sys_menu` VALUES (1059, '预览代码', 115, 4, '#', '', '', 1, 0, 'F', '0', '0', 'tool:gen:preview', '#', 1, '2022-06-17 17:20:23.000', NULL, NULL, ''); -INSERT INTO `sys_menu` VALUES (1060, '生成代码', 115, 5, '#', '', '', 1, 0, 'F', '0', '0', 'tool:gen:code', '#', 1, '2022-06-17 17:20:23.000', NULL, NULL, ''); -INSERT INTO `sys_menu` VALUES (2096, '库区', 2193, 2, 'area', 'wms/area/index', NULL, 1, 0, 'C', '0', '0', 'wms:area:list', '#', 1, '2022-07-29 16:08:33.000', 1, '2022-10-30 22:17:57.000', '货区菜单'); -INSERT INTO `sys_menu` VALUES (2097, '货区查询', 2096, 1, '', '', NULL, 1, 0, 'F', '0', '0', 'wms:area:query', '#', 1, '2022-07-29 16:08:33.000', 0, NULL, ''); -INSERT INTO `sys_menu` VALUES (2098, '货区新增', 2096, 2, '', '', NULL, 1, 0, 'F', '0', '0', 'wms:area:add', '#', 1, '2022-07-29 16:08:33.000', 0, NULL, ''); -INSERT INTO `sys_menu` VALUES (2099, '货区修改', 2096, 3, '', '', NULL, 1, 0, 'F', '0', '0', 'wms:area:edit', '#', 1, '2022-07-29 16:08:33.000', 0, NULL, ''); -INSERT INTO `sys_menu` VALUES (2100, '货区删除', 2096, 4, '', '', NULL, 1, 0, 'F', '0', '0', 'wms:area:remove', '#', 1, '2022-07-29 16:08:33.000', 0, NULL, ''); -INSERT INTO `sys_menu` VALUES (2101, '货区导出', 2096, 5, '', '', NULL, 1, 0, 'F', '0', '0', 'wms:area:export', '#', 1, '2022-07-29 16:08:33.000', 0, NULL, ''); -INSERT INTO `sys_menu` VALUES (2102, '承运商', 2198, 6, 'carrier', 'wms/carrier/index', NULL, 1, 0, 'C', '0', '0', 'wms:carrier:list', '#', 1, '2022-07-29 16:08:42.000', 1, '2022-10-31 09:10:41.000', '承运商菜单'); -INSERT INTO `sys_menu` VALUES (2103, '承运商查询', 2102, 1, '', '', NULL, 1, 0, 'F', '0', '0', 'wms:carrier:query', '#', 1, '2022-07-29 16:08:42.000', 0, NULL, ''); -INSERT INTO `sys_menu` VALUES (2104, '承运商新增', 2102, 2, '', '', NULL, 1, 0, 'F', '0', '0', 'wms:carrier:add', '#', 1, '2022-07-29 16:08:42.000', 0, NULL, ''); -INSERT INTO `sys_menu` VALUES (2105, '承运商修改', 2102, 3, '', '', NULL, 1, 0, 'F', '0', '0', 'wms:carrier:edit', '#', 1, '2022-07-29 16:08:42.000', 0, NULL, ''); -INSERT INTO `sys_menu` VALUES (2106, '承运商删除', 2102, 4, '', '', NULL, 1, 0, 'F', '0', '0', 'wms:carrier:remove', '#', 1, '2022-07-29 16:08:43.000', 0, NULL, ''); -INSERT INTO `sys_menu` VALUES (2107, '承运商导出', 2102, 5, '', '', NULL, 1, 0, 'F', '0', '0', 'wms:carrier:export', '#', 1, '2022-07-29 16:08:43.000', 0, NULL, ''); -INSERT INTO `sys_menu` VALUES (2108, '客户', 2198, 5, 'customer', 'wms/customer/index', NULL, 1, 0, 'C', '0', '0', 'wms:customer:list', '#', 1, '2022-07-29 16:08:51.000', 1, '2022-10-31 09:10:21.000', '客户菜单'); -INSERT INTO `sys_menu` VALUES (2109, '客户查询', 2108, 1, '', '', NULL, 1, 0, 'F', '0', '0', 'wms:customer:query', '#', 1, '2022-07-29 16:08:51.000', 0, NULL, ''); -INSERT INTO `sys_menu` VALUES (2110, '客户新增', 2108, 2, '', '', NULL, 1, 0, 'F', '0', '0', 'wms:customer:add', '#', 1, '2022-07-29 16:08:51.000', 0, NULL, ''); -INSERT INTO `sys_menu` VALUES (2111, '客户修改', 2108, 3, '', '', NULL, 1, 0, 'F', '0', '0', 'wms:customer:edit', '#', 1, '2022-07-29 16:08:51.000', 0, NULL, ''); -INSERT INTO `sys_menu` VALUES (2112, '客户删除', 2108, 4, '', '', NULL, 1, 0, 'F', '0', '0', 'wms:customer:remove', '#', 1, '2022-07-29 16:08:51.000', 0, NULL, ''); -INSERT INTO `sys_menu` VALUES (2113, '客户导出', 2108, 5, '', '', NULL, 1, 0, 'F', '0', '0', 'wms:customer:export', '#', 1, '2022-07-29 16:08:51.000', 0, NULL, ''); -INSERT INTO `sys_menu` VALUES (2114, '发货记录', 2197, 5, 'delivery', 'wms/delivery/index', NULL, 1, 0, 'C', '0', '0', 'wms:delivery:list', '#', 1, '2022-07-29 16:31:18.000', 1, '2022-10-30 22:09:55.000', '发货记录菜单'); -INSERT INTO `sys_menu` VALUES (2115, '发货记录查询', 2114, 1, '', '', NULL, 1, 0, 'F', '0', '0', 'wms:delivery:query', '#', 1, '2022-07-29 16:31:18.000', 0, NULL, ''); -INSERT INTO `sys_menu` VALUES (2116, '发货记录新增', 2114, 2, '', '', NULL, 1, 0, 'F', '0', '0', 'wms:delivery:add', '#', 1, '2022-07-29 16:31:18.000', 0, NULL, ''); -INSERT INTO `sys_menu` VALUES (2117, '发货记录修改', 2114, 3, '', '', NULL, 1, 0, 'F', '0', '0', 'wms:delivery:edit', '#', 1, '2022-07-29 16:31:18.000', 0, NULL, ''); -INSERT INTO `sys_menu` VALUES (2118, '发货记录删除', 2114, 4, '', '', NULL, 1, 0, 'F', '0', '0', 'wms:delivery:remove', '#', 1, '2022-07-29 16:31:18.000', 0, NULL, ''); -INSERT INTO `sys_menu` VALUES (2119, '发货记录导出', 2114, 5, '', '', NULL, 1, 0, 'F', '0', '0', 'wms:delivery:export', '#', 1, '2022-07-29 16:31:18.000', 0, NULL, ''); -INSERT INTO `sys_menu` VALUES (2120, '库存看板', 2197, 3, 'inventory', 'wms/inventory/index', NULL, 1, 0, 'C', '0', '0', 'wms:inventory:list', '#', 1, '2022-07-29 16:34:37.000', 1, '2022-10-30 22:09:10.000', '库存菜单'); -INSERT INTO `sys_menu` VALUES (2121, '库存查询', 2120, 1, '', '', NULL, 1, 0, 'F', '0', '0', 'wms:inventory:query', '#', 1, '2022-07-29 16:34:37.000', 0, NULL, ''); -INSERT INTO `sys_menu` VALUES (2122, '库存新增', 2120, 2, '', '', NULL, 1, 0, 'F', '0', '0', 'wms:inventory:add', '#', 1, '2022-07-29 16:34:37.000', 0, NULL, ''); -INSERT INTO `sys_menu` VALUES (2123, '库存修改', 2120, 3, '', '', NULL, 1, 0, 'F', '0', '0', 'wms:inventory:edit', '#', 1, '2022-07-29 16:34:37.000', 0, NULL, ''); -INSERT INTO `sys_menu` VALUES (2124, '库存删除', 2120, 4, '', '', NULL, 1, 0, 'F', '0', '0', 'wms:inventory:remove', '#', 1, '2022-07-29 16:34:37.000', 0, NULL, ''); -INSERT INTO `sys_menu` VALUES (2125, '库存导出', 2120, 5, '', '', NULL, 1, 0, 'F', '0', '0', 'wms:inventory:export', '#', 1, '2022-07-29 16:34:37.000', 0, NULL, ''); -INSERT INTO `sys_menu` VALUES (2126, '库存记录', 2197, 4, 'inventoryHistory', 'wms/inventoryHistory/index', NULL, 1, 0, 'C', '0', '0', 'wms:inventoryHistory:list', '#', 1, '2022-07-29 16:34:45.000', 1, '2022-10-30 22:09:40.000', '库存记录菜单'); -INSERT INTO `sys_menu` VALUES (2127, '库存记录查询', 2126, 1, '', '', NULL, 1, 0, 'F', '0', '0', 'wms:inventoryHistory:query', '#', 1, '2022-07-29 16:34:46.000', 0, NULL, ''); -INSERT INTO `sys_menu` VALUES (2128, '库存记录新增', 2126, 2, '', '', NULL, 1, 0, 'F', '0', '0', 'wms:inventoryHistory:add', '#', 1, '2022-07-29 16:34:46.000', 0, NULL, ''); -INSERT INTO `sys_menu` VALUES (2129, '库存记录修改', 2126, 3, '', '', NULL, 1, 0, 'F', '0', '0', 'wms:inventoryHistory:edit', '#', 1, '2022-07-29 16:34:46.000', 0, NULL, ''); -INSERT INTO `sys_menu` VALUES (2130, '库存记录删除', 2126, 4, '', '', NULL, 1, 0, 'F', '0', '0', 'wms:inventoryHistory:remove', '#', 1, '2022-07-29 16:34:46.000', 0, NULL, ''); -INSERT INTO `sys_menu` VALUES (2131, '库存记录导出', 2126, 5, '', '', NULL, 1, 0, 'F', '0', '0', 'wms:inventoryHistory:export', '#', 1, '2022-07-29 16:34:46.000', 0, NULL, ''); -INSERT INTO `sys_menu` VALUES (2132, '移库', 2192, 6, 'inventoryMovement', 'wms/inventoryMovement/index', NULL, 1, 0, 'C', '0', '0', 'wms:inventoryMovement:list', '#', 1, '2022-07-29 16:34:54.000', 1, '2022-10-30 22:07:05.000', '库存移动菜单'); -INSERT INTO `sys_menu` VALUES (2133, '库存移动查询', 2132, 1, '', '', NULL, 1, 0, 'F', '0', '0', 'wms:inventoryMovement:query', '#', 1, '2022-07-29 16:34:54.000', 0, NULL, ''); -INSERT INTO `sys_menu` VALUES (2134, '库存移动新增', 2132, 2, '', '', NULL, 1, 0, 'F', '0', '0', 'wms:inventoryMovement:add', '#', 1, '2022-07-29 16:34:54.000', 0, NULL, ''); -INSERT INTO `sys_menu` VALUES (2135, '库存移动修改', 2132, 3, '', '', NULL, 1, 0, 'F', '0', '0', 'wms:inventoryMovement:edit', '#', 1, '2022-07-29 16:34:54.000', 0, NULL, ''); -INSERT INTO `sys_menu` VALUES (2136, '库存移动删除', 2132, 4, '', '', NULL, 1, 0, 'F', '0', '0', 'wms:inventoryMovement:remove', '#', 1, '2022-07-29 16:34:54.000', 0, NULL, ''); -INSERT INTO `sys_menu` VALUES (2137, '库存移动导出', 2132, 5, '', '', NULL, 1, 0, 'F', '0', '0', 'wms:inventoryMovement:export', '#', 1, '2022-07-29 16:34:54.000', 0, NULL, ''); -INSERT INTO `sys_menu` VALUES (2138, '库存移动详情', 2192, 100, 'inventoryMovementDetail', 'wms/inventoryMovementDetail/index', NULL, 1, 0, 'C', '1', '0', 'wms:inventoryMovementDetail:list', '#', 1, '2022-07-29 16:35:04.000', 1, '2022-10-30 22:05:06.000', '库存移动详情菜单'); -INSERT INTO `sys_menu` VALUES (2139, '库存移动详情查询', 2138, 1, '', '', NULL, 1, 0, 'F', '0', '0', 'wms:inventoryMovementDetail:query', '#', 1, '2022-07-29 16:35:04.000', 0, NULL, ''); -INSERT INTO `sys_menu` VALUES (2140, '库存移动详情新增', 2138, 2, '', '', NULL, 1, 0, 'F', '0', '0', 'wms:inventoryMovementDetail:add', '#', 1, '2022-07-29 16:35:04.000', 0, NULL, ''); -INSERT INTO `sys_menu` VALUES (2141, '库存移动详情修改', 2138, 3, '', '', NULL, 1, 0, 'F', '0', '0', 'wms:inventoryMovementDetail:edit', '#', 1, '2022-07-29 16:35:04.000', 0, NULL, ''); -INSERT INTO `sys_menu` VALUES (2142, '库存移动详情删除', 2138, 4, '', '', NULL, 1, 0, 'F', '0', '0', 'wms:inventoryMovementDetail:remove', '#', 1, '2022-07-29 16:35:04.000', 0, NULL, ''); -INSERT INTO `sys_menu` VALUES (2143, '库存移动详情导出', 2138, 5, '', '', NULL, 1, 0, 'F', '0', '0', 'wms:inventoryMovementDetail:export', '#', 1, '2022-07-29 16:35:04.000', 0, NULL, ''); -INSERT INTO `sys_menu` VALUES (2144, '物料', 0, 2, 'item', '', NULL, 1, 0, 'M', '0', '0', '', 'shopping', 1, '2022-07-29 16:35:13.000', 1, '2023-04-26 17:39:30.000', '物料菜单'); -INSERT INTO `sys_menu` VALUES (2145, '物料查询', 2216, 1, '', '', NULL, 1, 0, 'F', '0', '0', 'wms:item:query', '#', 1, '2022-07-29 16:35:13.000', 1, '2023-04-26 17:34:01.000', ''); -INSERT INTO `sys_menu` VALUES (2146, '物料新增', 2216, 2, '', '', NULL, 1, 0, 'F', '0', '0', 'wms:item:add', '#', 1, '2022-07-29 16:35:13.000', 1, '2023-04-26 17:34:18.000', ''); -INSERT INTO `sys_menu` VALUES (2147, '物料修改', 2216, 3, '', '', NULL, 1, 0, 'F', '0', '0', 'wms:item:edit', '#', 1, '2022-07-29 16:35:13.000', 1, '2023-04-26 17:34:25.000', ''); -INSERT INTO `sys_menu` VALUES (2148, '物料删除', 2216, 4, '', '', NULL, 1, 0, 'F', '0', '0', 'wms:item:remove', '#', 1, '2022-07-29 16:35:13.000', 1, '2023-04-26 17:34:33.000', ''); -INSERT INTO `sys_menu` VALUES (2149, '物料导出', 2216, 5, '', '', NULL, 1, 0, 'F', '0', '0', 'wms:item:export', '#', 1, '2022-07-29 16:35:13.000', 1, '2023-04-26 17:34:41.000', ''); -INSERT INTO `sys_menu` VALUES (2150, '货架', 2193, 3, 'rack', 'wms/rack/index', NULL, 1, 0, 'C', '0', '0', 'wms:rack:list', '#', 1, '2022-07-29 16:35:22.000', 1, '2022-10-30 22:18:04.000', '货架菜单'); -INSERT INTO `sys_menu` VALUES (2151, '货架查询', 2150, 1, '', '', NULL, 1, 0, 'F', '0', '0', 'wms:rack:query', '#', 1, '2022-07-29 16:35:22.000', 0, NULL, ''); -INSERT INTO `sys_menu` VALUES (2152, '货架新增', 2150, 2, '', '', NULL, 1, 0, 'F', '0', '0', 'wms:rack:add', '#', 1, '2022-07-29 16:35:22.000', 0, NULL, ''); -INSERT INTO `sys_menu` VALUES (2153, '货架修改', 2150, 3, '', '', NULL, 1, 0, 'F', '0', '0', 'wms:rack:edit', '#', 1, '2022-07-29 16:35:22.000', 0, NULL, ''); -INSERT INTO `sys_menu` VALUES (2154, '货架删除', 2150, 4, '', '', NULL, 1, 0, 'F', '0', '0', 'wms:rack:remove', '#', 1, '2022-07-29 16:35:22.000', 0, NULL, ''); -INSERT INTO `sys_menu` VALUES (2155, '货架导出', 2150, 5, '', '', NULL, 1, 0, 'F', '0', '0', 'wms:rack:export', '#', 1, '2022-07-29 16:35:22.000', 0, NULL, ''); -INSERT INTO `sys_menu` VALUES (2156, '入库', 2192, 1, 'receiptOrder', 'wms/receiptOrder/index', NULL, 1, 0, 'C', '0', '0', 'wms:receiptOrder:list', '#', 1, '2022-07-29 16:35:29.000', 1, '2022-10-30 22:06:34.000', '入库单菜单'); -INSERT INTO `sys_menu` VALUES (2157, '入库单查询', 2156, 1, '', '', NULL, 1, 0, 'F', '0', '0', 'wms:receiptOrder:query', '#', 1, '2022-07-29 16:35:29.000', 0, NULL, ''); -INSERT INTO `sys_menu` VALUES (2158, '编辑入库单', 2192, 2, 'receiptOrder/edit', 'wms/receiptOrder/edit', NULL, 1, 0, 'C', '1', '0', 'wms:receiptOrder:add', '#', 1, '2022-07-29 16:35:29.000', 1, '2022-08-31 15:54:00.000', ''); -INSERT INTO `sys_menu` VALUES (2159, '入库单修改', 2156, 3, '', '', NULL, 1, 0, 'F', '0', '0', 'wms:receiptOrder:edit', '#', 1, '2022-07-29 16:35:29.000', 0, NULL, ''); -INSERT INTO `sys_menu` VALUES (2160, '入库单删除', 2156, 4, '', '', NULL, 1, 0, 'F', '0', '0', 'wms:receiptOrder:remove', '#', 1, '2022-07-29 16:35:30.000', 0, NULL, ''); -INSERT INTO `sys_menu` VALUES (2161, '入库单导出', 2156, 5, '', '', NULL, 1, 0, 'F', '0', '0', 'wms:receiptOrder:export', '#', 1, '2022-07-29 16:35:30.000', 0, NULL, ''); -INSERT INTO `sys_menu` VALUES (2162, '入库单详情', 2192, 100, 'receiptOrderDetail', 'wms/receiptOrderDetail/index', NULL, 1, 0, 'C', '1', '0', 'wms:receiptOrderDetail:list', '#', 1, '2022-07-29 16:35:36.000', 1, '2022-10-30 22:04:29.000', '入库单详情菜单'); -INSERT INTO `sys_menu` VALUES (2163, '入库单详情查询', 2162, 1, '', '', NULL, 1, 0, 'F', '0', '0', 'wms:receiptOrderDetail:query', '#', 1, '2022-07-29 16:35:36.000', 0, NULL, ''); -INSERT INTO `sys_menu` VALUES (2164, '入库单详情新增', 2162, 2, '', '', NULL, 1, 0, 'F', '0', '0', 'wms:receiptOrderDetail:add', '#', 1, '2022-07-29 16:35:36.000', 0, NULL, ''); -INSERT INTO `sys_menu` VALUES (2165, '入库单详情修改', 2162, 3, '', '', NULL, 1, 0, 'F', '0', '0', 'wms:receiptOrderDetail:edit', '#', 1, '2022-07-29 16:35:36.000', 0, NULL, ''); -INSERT INTO `sys_menu` VALUES (2166, '入库单详情删除', 2162, 4, '', '', NULL, 1, 0, 'F', '0', '0', 'wms:receiptOrderDetail:remove', '#', 1, '2022-07-29 16:35:36.000', 0, NULL, ''); -INSERT INTO `sys_menu` VALUES (2167, '入库单详情导出', 2162, 5, '', '', NULL, 1, 0, 'F', '0', '0', 'wms:receiptOrderDetail:export', '#', 1, '2022-07-29 16:35:36.000', 0, NULL, ''); -INSERT INTO `sys_menu` VALUES (2168, '出库', 2192, 2, 'shipmentOrder', 'wms/shipmentOrder/index', NULL, 1, 0, 'C', '0', '0', 'wms:shipmentOrder:list', '#', 1, '2022-07-29 16:35:44.000', 1, '2022-10-30 22:06:45.000', '出库单菜单'); -INSERT INTO `sys_menu` VALUES (2169, '出库单查询', 2168, 1, '', '', NULL, 1, 0, 'F', '0', '0', 'wms:shipmentOrder:query', '#', 1, '2022-07-29 16:35:45.000', 0, NULL, ''); -INSERT INTO `sys_menu` VALUES (2170, '出库单新增', 2168, 2, '', '', NULL, 1, 0, 'F', '0', '0', 'wms:shipmentOrder:add', '#', 1, '2022-07-29 16:35:45.000', 0, NULL, ''); -INSERT INTO `sys_menu` VALUES (2171, '出库单修改', 2168, 3, '', '', NULL, 1, 0, 'F', '0', '0', 'wms:shipmentOrder:edit', '#', 1, '2022-07-29 16:35:45.000', 0, NULL, ''); -INSERT INTO `sys_menu` VALUES (2172, '出库单删除', 2168, 4, '', '', NULL, 1, 0, 'F', '0', '0', 'wms:shipmentOrder:remove', '#', 1, '2022-07-29 16:35:45.000', 0, NULL, ''); -INSERT INTO `sys_menu` VALUES (2173, '出库单导出', 2168, 5, '', '', NULL, 1, 0, 'F', '0', '0', 'wms:shipmentOrder:export', '#', 1, '2022-07-29 16:35:45.000', 0, NULL, ''); -INSERT INTO `sys_menu` VALUES (2174, '出库单详情', 2192, 100, 'shipmentOrderDetail', 'wms/shipmentOrderDetail/index', NULL, 1, 0, 'C', '1', '0', 'wms:shipmentOrderDetail:list', '#', 1, '2022-07-29 16:35:52.000', 1, '2022-10-30 22:04:05.000', '出库单详情菜单'); -INSERT INTO `sys_menu` VALUES (2175, '出库单详情查询', 2174, 1, '', '', NULL, 1, 0, 'F', '0', '0', 'wms:shipmentOrderDetail:query', '#', 1, '2022-07-29 16:35:52.000', 0, NULL, ''); -INSERT INTO `sys_menu` VALUES (2176, '出库单详情新增', 2174, 2, '', '', NULL, 1, 0, 'F', '0', '0', 'wms:shipmentOrderDetail:add', '#', 1, '2022-07-29 16:35:52.000', 0, NULL, ''); -INSERT INTO `sys_menu` VALUES (2177, '出库单详情修改', 2174, 3, '', '', NULL, 1, 0, 'F', '0', '0', 'wms:shipmentOrderDetail:edit', '#', 1, '2022-07-29 16:35:52.000', 0, NULL, ''); -INSERT INTO `sys_menu` VALUES (2178, '出库单详情删除', 2174, 4, '', '', NULL, 1, 0, 'F', '0', '0', 'wms:shipmentOrderDetail:remove', '#', 1, '2022-07-29 16:35:52.000', 0, NULL, ''); -INSERT INTO `sys_menu` VALUES (2179, '出库单详情导出', 2174, 5, '', '', NULL, 1, 0, 'F', '0', '0', 'wms:shipmentOrderDetail:export', '#', 1, '2022-07-29 16:35:52.000', 0, NULL, ''); -INSERT INTO `sys_menu` VALUES (2180, '供应商', 2198, 5, 'supplier', 'wms/supplier/index', NULL, 1, 0, 'C', '0', '0', 'wms:supplier:list', '#', 1, '2022-07-29 16:35:59.000', 1, '2022-10-31 09:10:34.000', '供应商菜单'); -INSERT INTO `sys_menu` VALUES (2181, '供应商查询', 2180, 1, '', '', NULL, 1, 0, 'F', '0', '0', 'wms:supplier:query', '#', 1, '2022-07-29 16:35:59.000', 0, NULL, ''); -INSERT INTO `sys_menu` VALUES (2182, '供应商新增', 2180, 2, '', '', NULL, 1, 0, 'F', '0', '0', 'wms:supplier:add', '#', 1, '2022-07-29 16:35:59.000', 0, NULL, ''); -INSERT INTO `sys_menu` VALUES (2183, '供应商修改', 2180, 3, '', '', NULL, 1, 0, 'F', '0', '0', 'wms:supplier:edit', '#', 1, '2022-07-29 16:35:59.000', 0, NULL, ''); -INSERT INTO `sys_menu` VALUES (2184, '供应商删除', 2180, 4, '', '', NULL, 1, 0, 'F', '0', '0', 'wms:supplier:remove', '#', 1, '2022-07-29 16:35:59.000', 0, NULL, ''); -INSERT INTO `sys_menu` VALUES (2185, '供应商导出', 2180, 5, '', '', NULL, 1, 0, 'F', '0', '0', 'wms:supplier:export', '#', 1, '2022-07-29 16:36:00.000', 0, NULL, ''); -INSERT INTO `sys_menu` VALUES (2186, '仓库/库区', 0, 1, 'warehouse', 'wms/warehouse/index', NULL, 1, 0, 'C', '0', '0', 'wms:warehouse:list', 'component', 1, '2022-07-29 16:36:31.000', 1, '2023-04-26 10:45:58.000', '仓库菜单'); -INSERT INTO `sys_menu` VALUES (2187, '仓库查询', 2186, 1, '', '', NULL, 1, 0, 'F', '0', '0', 'wms:warehouse:query', '#', 1, '2022-07-29 16:36:31.000', 0, NULL, ''); -INSERT INTO `sys_menu` VALUES (2188, '仓库新增', 2186, 2, '', '', NULL, 1, 0, 'F', '0', '0', 'wms:warehouse:add', '#', 1, '2022-07-29 16:36:31.000', 0, NULL, ''); -INSERT INTO `sys_menu` VALUES (2189, '仓库修改', 2186, 3, '', '', NULL, 1, 0, 'F', '0', '0', 'wms:warehouse:edit', '#', 1, '2022-07-29 16:36:31.000', 0, NULL, ''); -INSERT INTO `sys_menu` VALUES (2190, '仓库删除', 2186, 4, '', '', NULL, 1, 0, 'F', '0', '0', 'wms:warehouse:remove', '#', 1, '2022-07-29 16:36:31.000', 0, NULL, ''); -INSERT INTO `sys_menu` VALUES (2191, '仓库导出', 2186, 5, '', '', NULL, 1, 0, 'F', '0', '0', 'wms:warehouse:export', '#', 1, '2022-07-29 16:36:31.000', 0, NULL, ''); -INSERT INTO `sys_menu` VALUES (2192, '出入库', 0, 4, 'wms', NULL, NULL, 1, 0, 'M', '0', '0', '', 'redis', 1, '2022-07-29 18:09:52.000', 1, '2022-10-31 09:11:33.000', ''); -INSERT INTO `sys_menu` VALUES (2193, '仓库/库区/货架', 0, 1, 'basic', NULL, NULL, 1, 0, 'M', '1', '0', '', 'component', 1, '2022-08-09 08:57:46.000', 1, '2023-04-26 10:46:05.000', ''); -INSERT INTO `sys_menu` VALUES (2194, '发货/入库', 2192, 2, 'receiptOrder/status', 'wms/receiptOrder/status', NULL, 1, 0, 'C', '1', '0', 'wms:receiptOrder:status', '#', 1, '2022-09-27 14:16:42.000', 1, '2022-09-27 14:17:19.000', ''); -INSERT INTO `sys_menu` VALUES (2195, '编辑出库单', 2192, 2, 'shipmentOrder/edit', 'wms/shipmentOrder/edit', NULL, 1, 0, 'C', '1', '0', 'wms:shipmentOrder:add', '#', 1, '2022-10-20 16:38:26.000', 1, '2022-10-24 18:47:03.000', ''); -INSERT INTO `sys_menu` VALUES (2196, '发货/出库', 2192, 2, 'shipmentOrder/status', 'wms/shipmentOrder/status', NULL, 1, 0, 'C', '1', '0', 'wms:shipmentOrder:status', '#', 1, '2022-10-20 18:25:10.000', 1, '2022-10-24 18:47:15.000', ''); -INSERT INTO `sys_menu` VALUES (2197, '报表', 0, 6, 'report', NULL, NULL, 1, 0, 'M', '0', '0', '', 'chart', 1, '2022-10-30 22:08:28.000', 1, '2023-04-26 14:19:18.000', ''); -INSERT INTO `sys_menu` VALUES (2198, '客户/供应商/承运商', 0, 3, 'relation', NULL, NULL, 1, 0, 'M', '0', '0', NULL, 'peoples', 1, '2022-10-30 22:20:24.000', NULL, NULL, ''); -INSERT INTO `sys_menu` VALUES (2199, '编辑移库', 2192, 3, 'inventoryMovement/edit', 'wms/inventoryMovement/edit', NULL, 1, 0, 'C', '1', '0', 'wms:inventoryMovement:edit', '#', 1, '2022-11-02 15:13:46.000', 1, '2022-11-02 15:14:49.000', ''); -INSERT INTO `sys_menu` VALUES (2200, '移库操作', 2192, 4, 'inventoryMovement/status', 'wms/inventoryMovement/status', NULL, 1, 0, 'C', '1', '0', 'wms:inventoryMovement:status', '#', 1, '2022-11-02 15:15:57.000', NULL, NULL, ''); -INSERT INTO `sys_menu` VALUES (2201, '库存盘点', 0, 10, 'inventoryCheck', 'wms/inventoryCheck/index', NULL, 1, 0, 'C', '0', '0', 'wms:inventoryCheck:list', 'example', 1, '2023-04-20 13:24:37.000', NULL, NULL, ''); -INSERT INTO `sys_menu` VALUES (2202, '库存盘点单据查询', 2201, 1, '', NULL, NULL, 1, 0, 'F', '0', '0', 'wms:inventoryCheck:query', '#', 1, '2023-04-26 14:16:50.000', NULL, NULL, ''); -INSERT INTO `sys_menu` VALUES (2203, '库存盘点单据新增', 2201, 2, '', NULL, NULL, 1, 0, 'F', '0', '0', 'wms:inventoryCheck:add', '#', 1, '2023-04-26 14:17:20.000', NULL, NULL, ''); -INSERT INTO `sys_menu` VALUES (2204, '库存盘点单据修改', 2201, 3, '', NULL, NULL, 1, 0, 'F', '0', '0', 'wms:inventoryCheck:edit', '#', 1, '2023-04-26 14:17:49.000', NULL, NULL, ''); -INSERT INTO `sys_menu` VALUES (2205, '库存盘点单据删除', 2201, 4, '', NULL, NULL, 1, 0, 'F', '0', '0', 'wms:inventoryCheck:remove', '#', 1, '2023-04-26 14:18:11.000', NULL, NULL, ''); -INSERT INTO `sys_menu` VALUES (2206, '库存盘点单据导出', 2201, 5, '', NULL, NULL, 1, 0, 'F', '0', '0', 'wms:inventoryCheck:export', '#', 1, '2023-04-26 14:18:28.000', NULL, NULL, ''); -INSERT INTO `sys_menu` VALUES (2207, '盘库', 0, 5, '/check', NULL, NULL, 1, 0, 'M', '1', '0', NULL, 'checkbox', 1, '2023-04-26 14:19:57.000', NULL, NULL, ''); -INSERT INTO `sys_menu` VALUES (2208, '编辑盘点单', 2207, 0, 'edit', 'wms/inventoryCheck/edit', NULL, 1, 0, 'C', '1', '0', 'wms:inventoryCheck:list', 'checkbox', 1, '2023-04-26 14:20:43.000', NULL, NULL, ''); -INSERT INTO `sys_menu` VALUES (2209, '查看盘点单', 2207, 1, 'status', 'wms/inventoryCheck/status', NULL, 1, 0, 'C', '1', '0', NULL, '#', 1, '2023-04-26 14:22:09.000', NULL, NULL, ''); -INSERT INTO `sys_menu` VALUES (2210, '盘点单据详情', 2207, 1, 'inventoryCheckDetail', 'wms/inventoryCheckDetail/ind', NULL, 1, 0, 'C', '1', '0', 'wms:inventoryCheckDetail:list', '#', 1, '2023-04-26 14:22:47.000', NULL, NULL, ''); -INSERT INTO `sys_menu` VALUES (2211, '库存盘点单据详情查询', 2210, 1, '', NULL, NULL, 1, 0, 'F', '0', '0', 'wms:inventoryCheckDetail:query', '#', 1, '2023-04-26 14:23:19.000', NULL, NULL, ''); -INSERT INTO `sys_menu` VALUES (2212, '库存盘点单据详情新增', 2210, 2, '', NULL, NULL, 1, 0, 'F', '0', '0', 'wms:inventoryCheckDetail:add', '#', 1, '2023-04-26 14:23:45.000', NULL, NULL, ''); -INSERT INTO `sys_menu` VALUES (2213, '库存盘点单据详情修改', 2210, 3, '', NULL, NULL, 1, 0, 'F', '0', '0', 'wms:inventoryCheckDetail:edit', '#', 1, '2023-04-26 14:24:16.000', NULL, NULL, ''); -INSERT INTO `sys_menu` VALUES (2214, '库存盘点单据详情删除', 2210, 4, '', NULL, NULL, 1, 0, 'F', '0', '0', 'wms:inventoryCheckDetail:remove', '#', 1, '2023-04-26 14:24:36.000', NULL, NULL, ''); -INSERT INTO `sys_menu` VALUES (2215, '库存盘点单据详情导出', 2210, 5, '', NULL, NULL, 1, 0, 'F', '0', '0', 'wms:inventoryCheckDetail:export', '#', 1, '2023-04-26 14:24:56.000', NULL, NULL, ''); -INSERT INTO `sys_menu` VALUES (2216, '物料管理', 2144, 2, 'item', 'wms/item/index', NULL, 1, 0, 'C', '0', '0', 'wms:item:list', 'dict', 1, '2023-04-26 17:33:32.000', NULL, NULL, ''); -INSERT INTO `sys_menu` VALUES (2217, '分类管理', 2144, 1, 'itemType', 'wms/itemType/index', NULL, 1, 0, 'C', '0', '0', 'wms:itemType:list', 'dict', 1, '2023-04-26 17:35:52.000', NULL, NULL, ''); -INSERT INTO `sys_menu` VALUES (2218, '物料类型表查询', 2217, 1, '', NULL, NULL, 1, 0, 'F', '0', '0', 'wms:itemType:query', '#', 1, '2023-04-26 17:36:20.000', NULL, NULL, ''); -INSERT INTO `sys_menu` VALUES (2219, '物料类型表新增', 2217, 2, '', NULL, NULL, 1, 0, 'F', '0', '0', 'wms:itemType:add', '#', 1, '2023-04-26 17:36:49.000', NULL, NULL, ''); -INSERT INTO `sys_menu` VALUES (2220, '物料类型表修改', 2217, 3, '', NULL, NULL, 1, 0, 'F', '0', '0', 'wms:itemType:edit', '#', 1, '2023-04-26 17:37:06.000', NULL, NULL, ''); -INSERT INTO `sys_menu` VALUES (2221, '物料类型表删除', 2217, 4, '', NULL, NULL, 1, 0, 'F', '0', '0', 'wms:itemType:remove', '#', 1, '2023-04-26 17:37:25.000', NULL, NULL, ''); -INSERT INTO `sys_menu` VALUES (2222, '物料类型表导出', 2217, 5, '', NULL, NULL, 1, 0, 'F', '0', '0', 'wms:itemType:export', '#', 1, '2023-04-26 17:37:42.000', NULL, NULL, ''); -INSERT INTO `sys_menu` VALUES (2223, '供应商账户流水', 2198, 1, 'supplierTransaction', 'wms/supplierTransaction/index', NULL, 1, 0, 'C', '1', '0', 'wms:supplierTransaction:list', '#', 1, '2023-05-04 13:39:35.000', NULL, NULL, ''); -INSERT INTO `sys_menu` VALUES (2224, '供应商账户流水查询', 2223, 1, '', NULL, NULL, 1, 0, 'F', '0', '0', 'wms:supplierTransaction:query', '#', 1, '2023-05-04 13:39:55.000', NULL, NULL, ''); -INSERT INTO `sys_menu` VALUES (2225, '供应商账户流水新增', 2223, 2, '', NULL, NULL, 1, 0, 'F', '0', '0', 'wms:supplierTransaction:add', '#', 1, '2023-05-04 13:40:18.000', NULL, NULL, ''); -INSERT INTO `sys_menu` VALUES (2226, '供应商账户流水修改', 2223, 3, '', NULL, NULL, 1, 0, 'F', '0', '0', 'wms:supplierTransaction:edit', '#', 1, '2023-05-04 13:40:34.000', NULL, NULL, ''); -INSERT INTO `sys_menu` VALUES (2227, '供应商账户流水删除', 2223, 4, '', NULL, NULL, 1, 0, 'F', '0', '0', 'wms:supplierTransaction:remove', '#', 1, '2023-05-04 13:40:52.000', NULL, NULL, ''); -INSERT INTO `sys_menu` VALUES (2228, '供应商账户流水导出', 2223, 5, '', NULL, NULL, 1, 0, 'F', '0', '0', 'wms:supplierTransaction:export', '#', 1, '2023-05-04 13:41:14.000', NULL, NULL, ''); -INSERT INTO `sys_menu` VALUES (2229, '客户账户流水', 2198, 1, 'customerTransaction', 'wms/customerTransaction/index', NULL, 1, 0, 'C', '1', '0', 'wms:customerTransaction:list', '#', 1, '2023-05-04 16:55:03.000', NULL, NULL, ''); -INSERT INTO `sys_menu` VALUES (2230, '客户账户流水查询', 2229, 1, '', NULL, NULL, 1, 0, 'F', '0', '0', 'wms:customerTransaction:query', '#', 1, '2023-05-04 16:55:57.000', NULL, NULL, ''); -INSERT INTO `sys_menu` VALUES (2231, '客户账户流水新增', 2229, 2, '', NULL, NULL, 1, 0, 'F', '0', '0', 'wms:customerTransaction:add', '#', 1, '2023-05-04 16:56:36.000', NULL, NULL, ''); -INSERT INTO `sys_menu` VALUES (2232, '客户账户流水修改', 2229, 3, '', NULL, NULL, 1, 0, 'F', '0', '0', 'wms:customerTransaction:edit', '#', 1, '2023-05-04 16:57:02.000', NULL, NULL, ''); -INSERT INTO `sys_menu` VALUES (2233, '客户账户流水删除', 2229, 4, '', NULL, NULL, 1, 0, 'F', '0', '0', 'wms:customerTransaction:remove', '#', 1, '2023-05-04 16:57:27.000', NULL, NULL, ''); -INSERT INTO `sys_menu` VALUES (2234, '客户账户流水导出', 2229, 5, '', NULL, NULL, 1, 0, 'F', '0', '0', 'wms:customerTransaction:export', '#', 1, '2023-05-04 16:57:56.000', NULL, NULL, ''); -INSERT INTO `sys_menu` VALUES (2244, '波次', 2192, 1, 'wave', 'wms/wave/index', NULL, 1, 0, 'C', '1', '0', 'wms:wave:list', '#', 1, '2023-08-16 05:24:03.000', 1, '2023-08-16 09:09:00.000', '波次菜单'); -INSERT INTO `sys_menu` VALUES (2245, '波次查询', 2244, 1, '#', '', NULL, 1, 0, 'F', '0', '0', 'wms:wave:query', '#', 1, '2023-08-16 05:24:03.000', 1, NULL, ''); -INSERT INTO `sys_menu` VALUES (2246, '波次新增', 2244, 2, '#', '', NULL, 1, 0, 'F', '0', '0', 'wms:wave:add', '#', 1, '2023-08-16 05:24:03.000', 1, NULL, ''); -INSERT INTO `sys_menu` VALUES (2247, '波次修改', 2244, 3, '#', '', NULL, 1, 0, 'F', '0', '0', 'wms:wave:edit', '#', 1, '2023-08-16 05:24:03.000', 1, NULL, ''); -INSERT INTO `sys_menu` VALUES (2248, '波次删除', 2244, 4, '#', '', NULL, 1, 0, 'F', '0', '0', 'wms:wave:remove', '#', 1, '2023-08-16 05:24:03.000', 1, NULL, ''); -INSERT INTO `sys_menu` VALUES (2249, '波次导出', 2244, 5, '#', '', NULL, 1, 0, 'F', '0', '0', 'wms:wave:export', '#', 1, '2023-08-16 05:24:03.000', 1, NULL, ''); -INSERT INTO `sys_menu` VALUES (2250, '波次作业', 2192, 2, 'wave/status', 'wms/wave/status', NULL, 1, 0, 'C', '1', '0', '', 'checkbox', 1, '2023-08-16 07:44:29.000', 1, '2023-08-16 09:09:04.000', ''); --- ---------------------------- --- Table structure for sys_notice --- ---------------------------- -DROP TABLE IF EXISTS `sys_notice`; -CREATE TABLE `sys_notice` ( - `notice_id` int(4) NOT NULL AUTO_INCREMENT COMMENT '公告ID', - `notice_title` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '公告标题', - `notice_type` char(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '公告类型(1通知 2公告)', - `notice_content` longblob NULL COMMENT '公告内容', - `status` char(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '0' COMMENT '公告状态(0正常 1关闭)', - `create_by` bigint(20) NULL DEFAULT NULL COMMENT '创建者', - `create_time` datetime(0) NULL DEFAULT NULL COMMENT '创建时间', - `update_by` bigint(20) NULL DEFAULT NULL COMMENT '更新者', - `update_time` datetime(3) NULL DEFAULT NULL COMMENT '更新时间', - `remark` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '备注', - PRIMARY KEY (`notice_id`) USING BTREE -) ENGINE = InnoDB AUTO_INCREMENT = 10 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '通知公告表' ROW_FORMAT = Dynamic; - --- ---------------------------- --- Records of sys_notice --- ---------------------------- -INSERT INTO `sys_notice` VALUES (1, '温馨提醒:2018-07-01 若依新版本发布啦', '2', 0xE696B0E78988E69CACE58685E5AEB9, '0', 1, '2022-06-17 17:20:29', NULL, NULL, '管理员'); -INSERT INTO `sys_notice` VALUES (2, '维护通知:2018-07-01 若依系统凌晨维护', '1', 0xE7BBB4E68AA4E58685E5AEB9, '0', 1, '2022-06-17 17:20:30', NULL, NULL, '管理员'); - --- ---------------------------- --- Table structure for sys_oper_log --- ---------------------------- -DROP TABLE IF EXISTS `sys_oper_log`; -CREATE TABLE `sys_oper_log` ( - `oper_id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '日志主键', - `title` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '模块标题', - `business_type` int(2) NULL DEFAULT 0 COMMENT '业务类型(0其它 1新增 2修改 3删除)', - `method` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '方法名称', - `request_method` varchar(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '请求方式', - `operator_type` int(1) NULL DEFAULT 0 COMMENT '操作类别(0其它 1后台用户 2手机端用户)', - `oper_name` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '操作人员', - `dept_name` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '部门名称', - `oper_url` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '请求URL', - `oper_ip` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '主机地址', - `oper_location` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '操作地点', - `oper_param` varchar(2000) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '请求参数', - `json_result` varchar(2000) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '返回参数', - `status` int(1) NULL DEFAULT 0 COMMENT '操作状态(0正常 1异常)', - `error_msg` varchar(2000) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '错误消息', - `oper_time` datetime(0) NULL DEFAULT NULL COMMENT '操作时间', - PRIMARY KEY (`oper_id`) USING BTREE -) ENGINE = InnoDB AUTO_INCREMENT = 876 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '操作日志记录' ROW_FORMAT = Dynamic; - --- ---------------------------- --- Table structure for sys_post --- ---------------------------- -DROP TABLE IF EXISTS `sys_post`; -CREATE TABLE `sys_post` ( - `post_id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '岗位ID', - `post_code` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '岗位编码', - `post_name` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '岗位名称', - `post_sort` int(4) NOT NULL COMMENT '显示顺序', - `status` char(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '状态(0正常 1停用)', - `create_by` bigint(20) NULL DEFAULT NULL COMMENT '创建者', - `create_time` datetime(3) NULL DEFAULT NULL COMMENT '创建时间', - `update_by` bigint(20) NULL DEFAULT NULL COMMENT '更新者', - `update_time` datetime(0) NULL DEFAULT NULL COMMENT '更新时间', - `remark` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '备注', - PRIMARY KEY (`post_id`) USING BTREE -) ENGINE = InnoDB AUTO_INCREMENT = 5 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '岗位信息表' ROW_FORMAT = Dynamic; - --- ---------------------------- --- Records of sys_post --- ---------------------------- -INSERT INTO `sys_post` VALUES (1, 'ceo', '董事长', 1, '0', 1, '2022-06-17 17:20:20.000', NULL, NULL, ''); -INSERT INTO `sys_post` VALUES (2, 'se', '项目经理', 2, '0', 1, '2022-06-17 17:20:20.000', NULL, NULL, ''); -INSERT INTO `sys_post` VALUES (3, 'hr', '人力资源', 3, '0', 1, '2022-06-17 17:20:20.000', NULL, NULL, ''); -INSERT INTO `sys_post` VALUES (4, 'user', '普通员工', 4, '0', 1, '2022-06-17 17:20:20.000', 1, '2023-01-06 12:45:30', ''); - --- ---------------------------- --- Table structure for sys_role --- ---------------------------- -DROP TABLE IF EXISTS `sys_role`; -CREATE TABLE `sys_role` ( - `role_id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '角色ID', - `role_name` varchar(30) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '角色名称', - `role_key` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '角色权限字符串', - `role_sort` int(4) NOT NULL COMMENT '显示顺序', - `data_scope` char(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '1' COMMENT '数据范围(1:全部数据权限 2:自定数据权限 3:本部门数据权限 4:本部门及以下数据权限)', - `menu_check_strictly` tinyint(1) NULL DEFAULT 1 COMMENT '菜单树选择项是否关联显示', - `dept_check_strictly` tinyint(1) NULL DEFAULT 1 COMMENT '部门树选择项是否关联显示', - `status` char(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '角色状态(0正常 1停用)', - `del_flag` char(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '0' COMMENT '删除标志(0代表存在 2代表删除)', - `create_by` bigint(20) NULL DEFAULT NULL COMMENT '创建者', - `create_time` datetime(0) NULL DEFAULT NULL COMMENT '创建时间', - `update_by` bigint(20) NULL DEFAULT NULL COMMENT '更新者', - `update_time` datetime(3) NULL DEFAULT NULL COMMENT '更新时间', - `remark` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '备注', - PRIMARY KEY (`role_id`) USING BTREE -) ENGINE = InnoDB AUTO_INCREMENT = 102 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '角色信息表' ROW_FORMAT = Dynamic; - --- ---------------------------- --- Records of sys_role --- ---------------------------- -INSERT INTO `sys_role` VALUES (1, '超级管理员', 'admin', 1, '1', 1, 1, '0', '0', 1, '2022-06-17 17:20:20', NULL, NULL, '超级管理员'); -INSERT INTO `sys_role` VALUES (3, '管理员', 'super', 3, '1', 1, 1, '0', '0', 1, '2022-06-28 15:57:51', NULL, NULL, '管理员'); -INSERT INTO `sys_role` VALUES (100, '普通用户', 'common', 2, '2', 0, 0, '0', '0', NULL, '2022-06-20 09:52:16', 1, '2023-05-04 22:37:22.000', NULL); -INSERT INTO `sys_role` VALUES (101, '浏览者', 'viewer', 4, '1', 1, 1, '0', '0', 1, '2022-11-01 17:52:33', 1, '2022-11-01 17:55:33.000', NULL); - --- ---------------------------- --- Table structure for sys_role_dept --- ---------------------------- -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`) USING BTREE -) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '角色和部门关联表' ROW_FORMAT = Dynamic; - --- ---------------------------- --- Records of sys_role_dept --- ---------------------------- -INSERT INTO `sys_role_dept` VALUES (2, 100); -INSERT INTO `sys_role_dept` VALUES (2, 101); -INSERT INTO `sys_role_dept` VALUES (2, 105); - --- ---------------------------- --- Table structure for sys_role_menu --- ---------------------------- -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`) USING BTREE -) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '角色和菜单关联表' ROW_FORMAT = Dynamic; - --- ---------------------------- --- Records of sys_role_menu --- ---------------------------- -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, 500); -INSERT INTO `sys_role_menu` VALUES (2, 501); -INSERT INTO `sys_role_menu` VALUES (2, 1000); -INSERT INTO `sys_role_menu` VALUES (2, 1001); -INSERT INTO `sys_role_menu` VALUES (2, 1002); -INSERT INTO `sys_role_menu` VALUES (2, 1003); -INSERT INTO `sys_role_menu` VALUES (2, 1004); -INSERT INTO `sys_role_menu` VALUES (2, 1005); -INSERT INTO `sys_role_menu` VALUES (2, 1006); -INSERT INTO `sys_role_menu` VALUES (2, 1007); -INSERT INTO `sys_role_menu` VALUES (2, 1008); -INSERT INTO `sys_role_menu` VALUES (2, 1009); -INSERT INTO `sys_role_menu` VALUES (2, 1010); -INSERT INTO `sys_role_menu` VALUES (2, 1011); -INSERT INTO `sys_role_menu` VALUES (2, 1012); -INSERT INTO `sys_role_menu` VALUES (2, 1013); -INSERT INTO `sys_role_menu` VALUES (2, 1014); -INSERT INTO `sys_role_menu` VALUES (2, 1015); -INSERT INTO `sys_role_menu` VALUES (2, 1016); -INSERT INTO `sys_role_menu` VALUES (2, 1017); -INSERT INTO `sys_role_menu` VALUES (2, 1018); -INSERT INTO `sys_role_menu` VALUES (2, 1019); -INSERT INTO `sys_role_menu` VALUES (2, 1020); -INSERT INTO `sys_role_menu` VALUES (2, 1021); -INSERT INTO `sys_role_menu` VALUES (2, 1022); -INSERT INTO `sys_role_menu` VALUES (2, 1023); -INSERT INTO `sys_role_menu` VALUES (2, 1024); -INSERT INTO `sys_role_menu` VALUES (2, 1025); -INSERT INTO `sys_role_menu` VALUES (2, 1026); -INSERT INTO `sys_role_menu` VALUES (2, 1027); -INSERT INTO `sys_role_menu` VALUES (2, 1028); -INSERT INTO `sys_role_menu` VALUES (2, 1029); -INSERT INTO `sys_role_menu` VALUES (2, 1030); -INSERT INTO `sys_role_menu` VALUES (2, 1031); -INSERT INTO `sys_role_menu` VALUES (2, 1032); -INSERT INTO `sys_role_menu` VALUES (2, 1033); -INSERT INTO `sys_role_menu` VALUES (2, 1034); -INSERT INTO `sys_role_menu` VALUES (2, 1035); -INSERT INTO `sys_role_menu` VALUES (2, 1036); -INSERT INTO `sys_role_menu` VALUES (2, 1037); -INSERT INTO `sys_role_menu` VALUES (2, 1038); -INSERT INTO `sys_role_menu` VALUES (2, 1039); -INSERT INTO `sys_role_menu` VALUES (2, 1040); -INSERT INTO `sys_role_menu` VALUES (2, 1041); -INSERT INTO `sys_role_menu` VALUES (2, 1042); -INSERT INTO `sys_role_menu` VALUES (2, 1043); -INSERT INTO `sys_role_menu` VALUES (2, 1044); -INSERT INTO `sys_role_menu` VALUES (2, 1045); -INSERT INTO `sys_role_menu` VALUES (2, 1046); -INSERT INTO `sys_role_menu` VALUES (2, 1047); -INSERT INTO `sys_role_menu` VALUES (2, 1048); -INSERT INTO `sys_role_menu` VALUES (2, 1049); -INSERT INTO `sys_role_menu` VALUES (2, 1050); -INSERT INTO `sys_role_menu` VALUES (2, 1051); -INSERT INTO `sys_role_menu` VALUES (2, 1052); -INSERT INTO `sys_role_menu` VALUES (2, 1053); -INSERT INTO `sys_role_menu` VALUES (2, 1054); -INSERT INTO `sys_role_menu` VALUES (2, 1055); -INSERT INTO `sys_role_menu` VALUES (2, 1056); -INSERT INTO `sys_role_menu` VALUES (2, 1057); -INSERT INTO `sys_role_menu` VALUES (2, 1058); -INSERT INTO `sys_role_menu` VALUES (2, 1059); -INSERT INTO `sys_role_menu` VALUES (2, 1060); -INSERT INTO `sys_role_menu` VALUES (100, 1); -INSERT INTO `sys_role_menu` VALUES (100, 100); -INSERT INTO `sys_role_menu` VALUES (100, 101); -INSERT INTO `sys_role_menu` VALUES (100, 103); -INSERT INTO `sys_role_menu` VALUES (100, 104); -INSERT INTO `sys_role_menu` VALUES (100, 105); -INSERT INTO `sys_role_menu` VALUES (100, 107); -INSERT INTO `sys_role_menu` VALUES (100, 108); -INSERT INTO `sys_role_menu` VALUES (100, 500); -INSERT INTO `sys_role_menu` VALUES (100, 501); -INSERT INTO `sys_role_menu` VALUES (100, 1001); -INSERT INTO `sys_role_menu` VALUES (100, 1008); -INSERT INTO `sys_role_menu` VALUES (100, 1017); -INSERT INTO `sys_role_menu` VALUES (100, 1021); -INSERT INTO `sys_role_menu` VALUES (100, 1026); -INSERT INTO `sys_role_menu` VALUES (100, 1036); -INSERT INTO `sys_role_menu` VALUES (100, 1040); -INSERT INTO `sys_role_menu` VALUES (100, 1043); -INSERT INTO `sys_role_menu` VALUES (100, 2096); -INSERT INTO `sys_role_menu` VALUES (100, 2097); -INSERT INTO `sys_role_menu` VALUES (100, 2098); -INSERT INTO `sys_role_menu` VALUES (100, 2099); -INSERT INTO `sys_role_menu` VALUES (100, 2100); -INSERT INTO `sys_role_menu` VALUES (100, 2101); -INSERT INTO `sys_role_menu` VALUES (100, 2102); -INSERT INTO `sys_role_menu` VALUES (100, 2103); -INSERT INTO `sys_role_menu` VALUES (100, 2104); -INSERT INTO `sys_role_menu` VALUES (100, 2105); -INSERT INTO `sys_role_menu` VALUES (100, 2106); -INSERT INTO `sys_role_menu` VALUES (100, 2107); -INSERT INTO `sys_role_menu` VALUES (100, 2108); -INSERT INTO `sys_role_menu` VALUES (100, 2109); -INSERT INTO `sys_role_menu` VALUES (100, 2110); -INSERT INTO `sys_role_menu` VALUES (100, 2111); -INSERT INTO `sys_role_menu` VALUES (100, 2112); -INSERT INTO `sys_role_menu` VALUES (100, 2113); -INSERT INTO `sys_role_menu` VALUES (100, 2114); -INSERT INTO `sys_role_menu` VALUES (100, 2115); -INSERT INTO `sys_role_menu` VALUES (100, 2116); -INSERT INTO `sys_role_menu` VALUES (100, 2117); -INSERT INTO `sys_role_menu` VALUES (100, 2118); -INSERT INTO `sys_role_menu` VALUES (100, 2119); -INSERT INTO `sys_role_menu` VALUES (100, 2120); -INSERT INTO `sys_role_menu` VALUES (100, 2121); -INSERT INTO `sys_role_menu` VALUES (100, 2122); -INSERT INTO `sys_role_menu` VALUES (100, 2123); -INSERT INTO `sys_role_menu` VALUES (100, 2124); -INSERT INTO `sys_role_menu` VALUES (100, 2125); -INSERT INTO `sys_role_menu` VALUES (100, 2126); -INSERT INTO `sys_role_menu` VALUES (100, 2127); -INSERT INTO `sys_role_menu` VALUES (100, 2128); -INSERT INTO `sys_role_menu` VALUES (100, 2129); -INSERT INTO `sys_role_menu` VALUES (100, 2130); -INSERT INTO `sys_role_menu` VALUES (100, 2131); -INSERT INTO `sys_role_menu` VALUES (100, 2132); -INSERT INTO `sys_role_menu` VALUES (100, 2133); -INSERT INTO `sys_role_menu` VALUES (100, 2134); -INSERT INTO `sys_role_menu` VALUES (100, 2135); -INSERT INTO `sys_role_menu` VALUES (100, 2136); -INSERT INTO `sys_role_menu` VALUES (100, 2137); -INSERT INTO `sys_role_menu` VALUES (100, 2138); -INSERT INTO `sys_role_menu` VALUES (100, 2139); -INSERT INTO `sys_role_menu` VALUES (100, 2140); -INSERT INTO `sys_role_menu` VALUES (100, 2141); -INSERT INTO `sys_role_menu` VALUES (100, 2142); -INSERT INTO `sys_role_menu` VALUES (100, 2143); -INSERT INTO `sys_role_menu` VALUES (100, 2144); -INSERT INTO `sys_role_menu` VALUES (100, 2145); -INSERT INTO `sys_role_menu` VALUES (100, 2146); -INSERT INTO `sys_role_menu` VALUES (100, 2147); -INSERT INTO `sys_role_menu` VALUES (100, 2148); -INSERT INTO `sys_role_menu` VALUES (100, 2149); -INSERT INTO `sys_role_menu` VALUES (100, 2150); -INSERT INTO `sys_role_menu` VALUES (100, 2151); -INSERT INTO `sys_role_menu` VALUES (100, 2152); -INSERT INTO `sys_role_menu` VALUES (100, 2153); -INSERT INTO `sys_role_menu` VALUES (100, 2154); -INSERT INTO `sys_role_menu` VALUES (100, 2155); -INSERT INTO `sys_role_menu` VALUES (100, 2156); -INSERT INTO `sys_role_menu` VALUES (100, 2157); -INSERT INTO `sys_role_menu` VALUES (100, 2158); -INSERT INTO `sys_role_menu` VALUES (100, 2159); -INSERT INTO `sys_role_menu` VALUES (100, 2160); -INSERT INTO `sys_role_menu` VALUES (100, 2161); -INSERT INTO `sys_role_menu` VALUES (100, 2162); -INSERT INTO `sys_role_menu` VALUES (100, 2163); -INSERT INTO `sys_role_menu` VALUES (100, 2164); -INSERT INTO `sys_role_menu` VALUES (100, 2165); -INSERT INTO `sys_role_menu` VALUES (100, 2166); -INSERT INTO `sys_role_menu` VALUES (100, 2167); -INSERT INTO `sys_role_menu` VALUES (100, 2168); -INSERT INTO `sys_role_menu` VALUES (100, 2169); -INSERT INTO `sys_role_menu` VALUES (100, 2170); -INSERT INTO `sys_role_menu` VALUES (100, 2171); -INSERT INTO `sys_role_menu` VALUES (100, 2172); -INSERT INTO `sys_role_menu` VALUES (100, 2173); -INSERT INTO `sys_role_menu` VALUES (100, 2174); -INSERT INTO `sys_role_menu` VALUES (100, 2175); -INSERT INTO `sys_role_menu` VALUES (100, 2176); -INSERT INTO `sys_role_menu` VALUES (100, 2177); -INSERT INTO `sys_role_menu` VALUES (100, 2178); -INSERT INTO `sys_role_menu` VALUES (100, 2179); -INSERT INTO `sys_role_menu` VALUES (100, 2180); -INSERT INTO `sys_role_menu` VALUES (100, 2181); -INSERT INTO `sys_role_menu` VALUES (100, 2182); -INSERT INTO `sys_role_menu` VALUES (100, 2183); -INSERT INTO `sys_role_menu` VALUES (100, 2184); -INSERT INTO `sys_role_menu` VALUES (100, 2185); -INSERT INTO `sys_role_menu` VALUES (100, 2186); -INSERT INTO `sys_role_menu` VALUES (100, 2187); -INSERT INTO `sys_role_menu` VALUES (100, 2188); -INSERT INTO `sys_role_menu` VALUES (100, 2189); -INSERT INTO `sys_role_menu` VALUES (100, 2190); -INSERT INTO `sys_role_menu` VALUES (100, 2191); -INSERT INTO `sys_role_menu` VALUES (100, 2192); -INSERT INTO `sys_role_menu` VALUES (100, 2193); -INSERT INTO `sys_role_menu` VALUES (100, 2194); -INSERT INTO `sys_role_menu` VALUES (100, 2195); -INSERT INTO `sys_role_menu` VALUES (100, 2196); -INSERT INTO `sys_role_menu` VALUES (100, 2197); -INSERT INTO `sys_role_menu` VALUES (100, 2198); -INSERT INTO `sys_role_menu` VALUES (100, 2199); -INSERT INTO `sys_role_menu` VALUES (100, 2200); -INSERT INTO `sys_role_menu` VALUES (100, 2201); -INSERT INTO `sys_role_menu` VALUES (100, 2202); -INSERT INTO `sys_role_menu` VALUES (100, 2203); -INSERT INTO `sys_role_menu` VALUES (100, 2204); -INSERT INTO `sys_role_menu` VALUES (100, 2205); -INSERT INTO `sys_role_menu` VALUES (100, 2206); -INSERT INTO `sys_role_menu` VALUES (100, 2207); -INSERT INTO `sys_role_menu` VALUES (100, 2208); -INSERT INTO `sys_role_menu` VALUES (100, 2209); -INSERT INTO `sys_role_menu` VALUES (100, 2210); -INSERT INTO `sys_role_menu` VALUES (100, 2216); -INSERT INTO `sys_role_menu` VALUES (100, 2217); -INSERT INTO `sys_role_menu` VALUES (100, 2218); -INSERT INTO `sys_role_menu` VALUES (100, 2219); -INSERT INTO `sys_role_menu` VALUES (100, 2220); -INSERT INTO `sys_role_menu` VALUES (100, 2221); -INSERT INTO `sys_role_menu` VALUES (100, 2222); -INSERT INTO `sys_role_menu` VALUES (100, 2223); -INSERT INTO `sys_role_menu` VALUES (100, 2224); -INSERT INTO `sys_role_menu` VALUES (100, 2225); -INSERT INTO `sys_role_menu` VALUES (100, 2226); -INSERT INTO `sys_role_menu` VALUES (100, 2227); -INSERT INTO `sys_role_menu` VALUES (100, 2228); -INSERT INTO `sys_role_menu` VALUES (100, 2229); -INSERT INTO `sys_role_menu` VALUES (100, 2230); -INSERT INTO `sys_role_menu` VALUES (100, 2231); -INSERT INTO `sys_role_menu` VALUES (100, 2232); -INSERT INTO `sys_role_menu` VALUES (100, 2233); -INSERT INTO `sys_role_menu` VALUES (100, 2234); -INSERT INTO `sys_role_menu` VALUES (101, 1); -INSERT INTO `sys_role_menu` VALUES (101, 105); -INSERT INTO `sys_role_menu` VALUES (101, 1026); -INSERT INTO `sys_role_menu` VALUES (101, 2096); -INSERT INTO `sys_role_menu` VALUES (101, 2097); -INSERT INTO `sys_role_menu` VALUES (101, 2098); -INSERT INTO `sys_role_menu` VALUES (101, 2099); -INSERT INTO `sys_role_menu` VALUES (101, 2100); -INSERT INTO `sys_role_menu` VALUES (101, 2101); -INSERT INTO `sys_role_menu` VALUES (101, 2102); -INSERT INTO `sys_role_menu` VALUES (101, 2103); -INSERT INTO `sys_role_menu` VALUES (101, 2104); -INSERT INTO `sys_role_menu` VALUES (101, 2105); -INSERT INTO `sys_role_menu` VALUES (101, 2106); -INSERT INTO `sys_role_menu` VALUES (101, 2107); -INSERT INTO `sys_role_menu` VALUES (101, 2108); -INSERT INTO `sys_role_menu` VALUES (101, 2109); -INSERT INTO `sys_role_menu` VALUES (101, 2110); -INSERT INTO `sys_role_menu` VALUES (101, 2111); -INSERT INTO `sys_role_menu` VALUES (101, 2112); -INSERT INTO `sys_role_menu` VALUES (101, 2113); -INSERT INTO `sys_role_menu` VALUES (101, 2114); -INSERT INTO `sys_role_menu` VALUES (101, 2115); -INSERT INTO `sys_role_menu` VALUES (101, 2116); -INSERT INTO `sys_role_menu` VALUES (101, 2117); -INSERT INTO `sys_role_menu` VALUES (101, 2118); -INSERT INTO `sys_role_menu` VALUES (101, 2119); -INSERT INTO `sys_role_menu` VALUES (101, 2120); -INSERT INTO `sys_role_menu` VALUES (101, 2121); -INSERT INTO `sys_role_menu` VALUES (101, 2122); -INSERT INTO `sys_role_menu` VALUES (101, 2123); -INSERT INTO `sys_role_menu` VALUES (101, 2124); -INSERT INTO `sys_role_menu` VALUES (101, 2125); -INSERT INTO `sys_role_menu` VALUES (101, 2126); -INSERT INTO `sys_role_menu` VALUES (101, 2127); -INSERT INTO `sys_role_menu` VALUES (101, 2128); -INSERT INTO `sys_role_menu` VALUES (101, 2129); -INSERT INTO `sys_role_menu` VALUES (101, 2130); -INSERT INTO `sys_role_menu` VALUES (101, 2131); -INSERT INTO `sys_role_menu` VALUES (101, 2132); -INSERT INTO `sys_role_menu` VALUES (101, 2133); -INSERT INTO `sys_role_menu` VALUES (101, 2134); -INSERT INTO `sys_role_menu` VALUES (101, 2135); -INSERT INTO `sys_role_menu` VALUES (101, 2136); -INSERT INTO `sys_role_menu` VALUES (101, 2137); -INSERT INTO `sys_role_menu` VALUES (101, 2138); -INSERT INTO `sys_role_menu` VALUES (101, 2139); -INSERT INTO `sys_role_menu` VALUES (101, 2140); -INSERT INTO `sys_role_menu` VALUES (101, 2141); -INSERT INTO `sys_role_menu` VALUES (101, 2142); -INSERT INTO `sys_role_menu` VALUES (101, 2143); -INSERT INTO `sys_role_menu` VALUES (101, 2144); -INSERT INTO `sys_role_menu` VALUES (101, 2145); -INSERT INTO `sys_role_menu` VALUES (101, 2146); -INSERT INTO `sys_role_menu` VALUES (101, 2147); -INSERT INTO `sys_role_menu` VALUES (101, 2148); -INSERT INTO `sys_role_menu` VALUES (101, 2149); -INSERT INTO `sys_role_menu` VALUES (101, 2150); -INSERT INTO `sys_role_menu` VALUES (101, 2151); -INSERT INTO `sys_role_menu` VALUES (101, 2152); -INSERT INTO `sys_role_menu` VALUES (101, 2153); -INSERT INTO `sys_role_menu` VALUES (101, 2154); -INSERT INTO `sys_role_menu` VALUES (101, 2155); -INSERT INTO `sys_role_menu` VALUES (101, 2156); -INSERT INTO `sys_role_menu` VALUES (101, 2157); -INSERT INTO `sys_role_menu` VALUES (101, 2158); -INSERT INTO `sys_role_menu` VALUES (101, 2159); -INSERT INTO `sys_role_menu` VALUES (101, 2160); -INSERT INTO `sys_role_menu` VALUES (101, 2161); -INSERT INTO `sys_role_menu` VALUES (101, 2162); -INSERT INTO `sys_role_menu` VALUES (101, 2163); -INSERT INTO `sys_role_menu` VALUES (101, 2164); -INSERT INTO `sys_role_menu` VALUES (101, 2165); -INSERT INTO `sys_role_menu` VALUES (101, 2166); -INSERT INTO `sys_role_menu` VALUES (101, 2167); -INSERT INTO `sys_role_menu` VALUES (101, 2168); -INSERT INTO `sys_role_menu` VALUES (101, 2169); -INSERT INTO `sys_role_menu` VALUES (101, 2170); -INSERT INTO `sys_role_menu` VALUES (101, 2171); -INSERT INTO `sys_role_menu` VALUES (101, 2172); -INSERT INTO `sys_role_menu` VALUES (101, 2173); -INSERT INTO `sys_role_menu` VALUES (101, 2174); -INSERT INTO `sys_role_menu` VALUES (101, 2175); -INSERT INTO `sys_role_menu` VALUES (101, 2176); -INSERT INTO `sys_role_menu` VALUES (101, 2177); -INSERT INTO `sys_role_menu` VALUES (101, 2178); -INSERT INTO `sys_role_menu` VALUES (101, 2179); -INSERT INTO `sys_role_menu` VALUES (101, 2180); -INSERT INTO `sys_role_menu` VALUES (101, 2181); -INSERT INTO `sys_role_menu` VALUES (101, 2182); -INSERT INTO `sys_role_menu` VALUES (101, 2183); -INSERT INTO `sys_role_menu` VALUES (101, 2184); -INSERT INTO `sys_role_menu` VALUES (101, 2185); -INSERT INTO `sys_role_menu` VALUES (101, 2186); -INSERT INTO `sys_role_menu` VALUES (101, 2187); -INSERT INTO `sys_role_menu` VALUES (101, 2188); -INSERT INTO `sys_role_menu` VALUES (101, 2189); -INSERT INTO `sys_role_menu` VALUES (101, 2190); -INSERT INTO `sys_role_menu` VALUES (101, 2191); -INSERT INTO `sys_role_menu` VALUES (101, 2192); -INSERT INTO `sys_role_menu` VALUES (101, 2193); -INSERT INTO `sys_role_menu` VALUES (101, 2194); -INSERT INTO `sys_role_menu` VALUES (101, 2195); -INSERT INTO `sys_role_menu` VALUES (101, 2196); -INSERT INTO `sys_role_menu` VALUES (101, 2197); -INSERT INTO `sys_role_menu` VALUES (101, 2198); - --- ---------------------------- --- Table structure for sys_user --- ---------------------------- -DROP TABLE IF EXISTS `sys_user`; -CREATE TABLE `sys_user` ( - `user_id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '用户ID', - `dept_id` bigint(20) NULL DEFAULT NULL COMMENT '部门ID', - `user_name` varchar(30) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '用户账号', - `nick_name` varchar(30) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '用户昵称', - `user_type` varchar(2) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '00' COMMENT '用户类型(00系统用户)', - `email` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '用户邮箱', - `phonenumber` varchar(11) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '手机号码', - `sex` char(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '0' COMMENT '用户性别(0男 1女 2未知)', - `avatar` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '头像地址', - `password` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '密码', - `status` char(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '0' COMMENT '帐号状态(0正常 1停用)', - `del_flag` char(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '0' COMMENT '删除标志(0代表存在 2代表删除)', - `login_ip` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '最后登录IP', - `login_date` datetime(0) NULL DEFAULT NULL COMMENT '最后登录时间', - `create_by` bigint(20) NULL DEFAULT NULL COMMENT '创建者', - `create_time` datetime(3) NULL DEFAULT NULL COMMENT '创建时间', - `update_by` bigint(20) NULL DEFAULT NULL COMMENT '更新者', - `update_time` datetime(3) NULL DEFAULT NULL COMMENT '更新时间', - `remark` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '备注', - PRIMARY KEY (`user_id`) USING BTREE -) ENGINE = InnoDB AUTO_INCREMENT = 117 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '用户信息表' ROW_FORMAT = Dynamic; - --- ---------------------------- --- Records of sys_user admin 密码和cyl一样 --- ---------------------------- -BEGIN; -INSERT INTO `sys_user` (`user_id`, `dept_id`, `user_name`, `nick_name`, `user_type`, `email`, `phonenumber`, `sex`, `avatar`, `password`, `status`, `del_flag`, `login_ip`, `login_date`, `create_by`, `create_time`, `update_by`, `update_time`, `remark`) VALUES (1, 103, 'admin', '若依', '00', 'ry@163.com', '15888888888', '1', '', '$2a$10$f/LxZ5IyZTuArQyKDhSzbOB17dDiGzV.BSmbPcVVU62I2ryPhP82m', '0', '0', '127.0.0.1', '2023-03-30 12:43:20', 1, '2022-06-17 17:20:19.000', NULL, '2023-03-30 12:43:20.000', '管理员'); -INSERT INTO `sys_user` (`user_id`, `dept_id`, `user_name`, `nick_name`, `user_type`, `email`, `phonenumber`, `sex`, `avatar`, `password`, `status`, `del_flag`, `login_ip`, `login_date`, `create_by`, `create_time`, `update_by`, `update_time`, `remark`) VALUES (115, 100, 'cyl', 'cyl', '00', '', '', '0', '', '$2a$10$f/LxZ5IyZTuArQyKDhSzbOB17dDiGzV.BSmbPcVVU62I2ryPhP82m', '0', '0', '127.0.0.1', '2023-03-30 12:43:59', 1, '2022-11-04 17:06:20.000', 1, '2023-03-30 12:43:58.000', NULL); -COMMIT; - --- ---------------------------- --- Table structure for sys_user_post --- ---------------------------- -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`) USING BTREE -) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '用户与岗位关联表' ROW_FORMAT = Dynamic; - --- ---------------------------- --- Records of sys_user_post --- ---------------------------- -INSERT INTO `sys_user_post` VALUES (1, 1); -INSERT INTO `sys_user_post` VALUES (115, 1); - --- ---------------------------- --- Table structure for sys_user_role --- ---------------------------- -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`) USING BTREE -) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '用户和角色关联表' ROW_FORMAT = Dynamic; - --- ---------------------------- --- Records of sys_user_role --- ---------------------------- -INSERT INTO `sys_user_role` VALUES (1, 1); -INSERT INTO `sys_user_role` VALUES (113, 100); -INSERT INTO `sys_user_role` VALUES (114, 100); -INSERT INTO `sys_user_role` VALUES (115, 100); - --- ---------------------------- --- Table structure for wms_area --- ---------------------------- -DROP TABLE IF EXISTS `wms_area`; -CREATE TABLE `wms_area` ( - `id` bigint(20) NOT NULL AUTO_INCREMENT, - `area_no` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '编号', - `area_name` varchar(60) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '名称', - `warehouse_id` bigint(20) NOT NULL COMMENT '所属仓库ID', - `remark` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '备注', - `del_flag` tinyint(4) NOT NULL DEFAULT 0 COMMENT '删除标识', - `create_by` bigint(20) NULL DEFAULT NULL COMMENT '创建人', - `create_time` datetime(3) NULL DEFAULT NULL COMMENT '创建时间', - `update_by` bigint(20) NULL DEFAULT NULL COMMENT '修改人', - `update_time` datetime(3) NULL DEFAULT NULL COMMENT '修改时间', - PRIMARY KEY (`id`) USING BTREE -) ENGINE = InnoDB AUTO_INCREMENT = 222 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '库区' ROW_FORMAT = Dynamic; - --- ---------------------------- --- Records of wms_area --- ---------------------------- -INSERT INTO `wms_area` VALUES (2, '1', '1', 1, NULL, 1, 1, '2022-08-04 11:31:25.475', NULL, NULL); -INSERT INTO `wms_area` VALUES (3, '2', '1', 2, NULL, 1, 1, '2022-08-04 11:31:40.840', NULL, NULL); -INSERT INTO `wms_area` VALUES (4, '22', '222', 22, '2222', 1, 1, '2022-08-04 11:33:31.133', NULL, NULL); -INSERT INTO `wms_area` VALUES (5, '1', '1', 1, NULL, 1, 1, '2022-08-04 15:18:04.047', NULL, NULL); -INSERT INTO `wms_area` VALUES (6, '2', '2', 2, NULL, 1, 1, '2022-08-04 15:18:10.829', NULL, NULL); -INSERT INTO `wms_area` VALUES (7, '1', '2', 2, NULL, 1, 1, '2022-08-04 16:01:26.000', NULL, NULL); -INSERT INTO `wms_area` VALUES (8, '11', '11', 11, NULL, 1, 1, '2022-08-04 18:24:36.594', NULL, NULL); -INSERT INTO `wms_area` VALUES (9, '1', '1', 1, NULL, 1, 1, '2022-08-05 16:24:00.949', NULL, NULL); -INSERT INTO `wms_area` VALUES (10, '2', '2', 2, NULL, 1, 1, '2022-08-05 16:24:06.854', NULL, NULL); -INSERT INTO `wms_area` VALUES (11, '1', '1', 1, NULL, 1, 1, '2022-08-05 16:52:10.332', NULL, NULL); -INSERT INTO `wms_area` VALUES (12, '2', '2', 2, NULL, 1, 1, '2022-08-05 16:52:17.457', NULL, NULL); -INSERT INTO `wms_area` VALUES (13, 'suzhouxi', '苏州西', 4, 'suzhouxi', 1, 1, '2022-08-05 17:00:56.000', 115, '2022-11-10 13:53:18.044'); -INSERT INTO `wms_area` VALUES (14, 'shanghainan', '上海南', 4, NULL, 1, 1, '2022-08-09 11:05:53.000', 115, '2022-11-10 13:53:26.127'); -INSERT INTO `wms_area` VALUES (15, '877', '苏州东', 14, NULL, 1, 1, '2022-08-09 11:07:10.000', 115, '2022-11-10 13:53:32.045'); -INSERT INTO `wms_area` VALUES (16, 'shx', '上海西', 14, NULL, 1, 1, '2022-08-09 16:49:57.000', 115, '2022-11-10 13:53:36.751'); -INSERT INTO `wms_area` VALUES (17, '23', '南京北', 2, NULL, 1, 1, '2022-08-09 16:50:07.892', NULL, NULL); -INSERT INTO `wms_area` VALUES (18, '45', '南京西', 2, NULL, 1, 1, '2022-08-09 16:50:19.181', NULL, NULL); -INSERT INTO `wms_area` VALUES (19, '111', '111', 5, '111', 1, 1, '2022-08-29 12:09:38.000', 1, '2022-08-29 12:09:45.421'); -INSERT INTO `wms_area` VALUES (20, 'sz11', '苏州中', 14, NULL, 1, 1, '2022-11-01 14:15:05.000', 115, '2022-11-10 13:53:46.718'); -INSERT INTO `wms_area` VALUES (22, 'test1102', 'test', 1, NULL, 1, NULL, '2022-11-02 11:28:08.857', NULL, NULL); -INSERT INTO `wms_area` VALUES (23, 'test1102', 'test2', 1, NULL, 1, NULL, '2022-11-02 13:52:34.796', NULL, NULL); -INSERT INTO `wms_area` VALUES (24, 'test1102', 'test2', 1, NULL, 1, NULL, '2022-11-02 13:55:24.365', NULL, NULL); -INSERT INTO `wms_area` VALUES (25, 'test1102', 'test2', 1, NULL, 1, NULL, '2022-11-02 13:59:14.964', NULL, NULL); -INSERT INTO `wms_area` VALUES (26, 'test1102', 'test2', 1, NULL, 1, NULL, '2022-11-02 14:10:05.488', NULL, NULL); -INSERT INTO `wms_area` VALUES (35, 'test1102', 'test2', 1, NULL, 1, NULL, '2022-11-02 14:31:49.176', NULL, NULL); -INSERT INTO `wms_area` VALUES (36, 'test1102', 'test2', 1, NULL, 1, NULL, '2022-11-02 14:31:49.176', NULL, NULL); -INSERT INTO `wms_area` VALUES (39, 'test1102', 'test2', 1, NULL, 1, NULL, '2022-11-02 14:58:27.596', NULL, NULL); -INSERT INTO `wms_area` VALUES (40, 'test1102', 'test2', 1, NULL, 1, NULL, '2022-11-02 14:58:27.596', NULL, NULL); -INSERT INTO `wms_area` VALUES (41, '001', '贵阳区', 20, NULL, 1, 115, '2022-11-07 21:38:14.243', NULL, NULL); -INSERT INTO `wms_area` VALUES (42, '002', '贵安区', 20, NULL, 1, 115, '2022-11-07 21:38:28.434', NULL, NULL); -INSERT INTO `wms_area` VALUES (43, '1-001', '库区1-A', 21, NULL, 1, 115, '2022-11-11 17:03:21.000', 115, '2022-11-11 17:04:29.842'); -INSERT INTO `wms_area` VALUES (44, '1-002', '库区1-B', 2, NULL, 1, 115, '2022-11-11 17:03:33.000', 115, '2022-11-15 09:54:54.155'); -INSERT INTO `wms_area` VALUES (45, '1-003', '库区1-C', 4, NULL, 1, 115, '2022-11-11 17:03:45.000', 115, '2022-12-04 15:36:49.766'); -INSERT INTO `wms_area` VALUES (46, '1-003', '库区2-A', 14, NULL, 1, 115, '2022-11-11 17:04:56.000', 115, '2022-11-29 17:05:54.445'); -INSERT INTO `wms_area` VALUES (47, '3-001', '库区3-A', 23, NULL, 1, 115, '2022-11-11 17:05:06.344', NULL, NULL); -INSERT INTO `wms_area` VALUES (48, '4-001', '库区4-A', 24, NULL, 1, 115, '2022-11-11 17:05:19.477', NULL, NULL); -INSERT INTO `wms_area` VALUES (49, '4-002', '库区4-B', 24, NULL, 1, 115, '2022-11-11 17:05:31.630', NULL, NULL); -INSERT INTO `wms_area` VALUES (50, '萝卜1库区444', '萝卜1库区444', 25, NULL, 1, 115, '2022-11-13 17:09:18.000', 115, '2022-11-13 17:12:29.396'); -INSERT INTO `wms_area` VALUES (51, 'a101', '1212', 26, '121', 1, 115, '2022-11-14 16:37:44.110', NULL, NULL); -INSERT INTO `wms_area` VALUES (52, 'test-1', 'test-1', 27, NULL, 1, 115, '2022-11-20 15:08:16.939', NULL, NULL); -INSERT INTO `wms_area` VALUES (53, '212', '12', 14, '21', 1, 115, '2022-11-20 21:19:10.209', NULL, NULL); -INSERT INTO `wms_area` VALUES (54, '1', '1', 4, '1', 1, 115, '2022-11-21 04:41:52.000', 115, '2022-11-30 11:49:01.613'); -INSERT INTO `wms_area` VALUES (55, '001', '水果', 14, NULL, 1, 115, '2022-12-04 15:37:56.930', NULL, NULL); -INSERT INTO `wms_area` VALUES (56, 'A-01', '金融仓库中间', 31, '金融仓库中间', 1, 115, '2022-12-05 15:47:58.000', 115, '2022-12-08 10:28:41.348'); -INSERT INTO `wms_area` VALUES (57, 'xmld_b1', '北仓1-1', 33, NULL, 1, 115, '2022-12-07 09:12:15.000', 115, '2022-12-08 10:28:49.174'); -INSERT INTO `wms_area` VALUES (58, 'KQ0001', '库区A', 34, NULL, 1, 115, '2022-12-09 16:23:15.037', NULL, NULL); -INSERT INTO `wms_area` VALUES (59, 'KQ0002', '库区B', 34, NULL, 1, 115, '2022-12-09 16:23:31.176', NULL, NULL); -INSERT INTO `wms_area` VALUES (60, '01', '拣货区', 39, NULL, 1, 115, '2022-12-12 13:14:39.514', NULL, NULL); -INSERT INTO `wms_area` VALUES (61, '2243', 'sfsd', 38, 'sdf', 1, 115, '2022-12-14 23:13:02.000', 115, '2022-12-23 19:26:20.318'); -INSERT INTO `wms_area` VALUES (62, 'A001-01', '成品仓01库区', 43, '成品仓01库区', 1, 115, '2022-12-18 17:33:34.100', NULL, NULL); -INSERT INTO `wms_area` VALUES (63, '11', '11', 42, NULL, 1, 115, '2022-12-22 08:53:14.906', NULL, NULL); -INSERT INTO `wms_area` VALUES (64, '22', '22', 41, '22', 1, 115, '2022-12-22 08:53:29.376', NULL, NULL); -INSERT INTO `wms_area` VALUES (65, 'B0023', '测试库区', 45, '无备注', 1, 115, '2022-12-27 14:12:23.832', NULL, NULL); -INSERT INTO `wms_area` VALUES (66, '11', '1', 47, '111', 1, 115, '2022-12-28 14:04:56.620', NULL, NULL); -INSERT INTO `wms_area` VALUES (67, '002', '车衣', 50, '111', 1, 115, '2023-01-04 14:13:26.543', NULL, NULL); -INSERT INTO `wms_area` VALUES (68, '001', 'sd', 51, NULL, 1, 115, '2023-01-05 14:48:26.568', NULL, NULL); -INSERT INTO `wms_area` VALUES (69, '003', '1库', 50, '111', 1, 115, '2023-01-05 16:38:44.660', NULL, NULL); -INSERT INTO `wms_area` VALUES (70, 'KQ001', '库区01', 50, NULL, 1, 115, '2023-01-06 07:57:48.055', NULL, NULL); -INSERT INTO `wms_area` VALUES (71, 'KQ001', '库区01', 50, NULL, 1, 115, '2023-01-06 07:57:48.474', NULL, NULL); -INSERT INTO `wms_area` VALUES (72, '123', '123', 52, NULL, 1, 115, '2023-01-06 14:22:23.805', NULL, NULL); -INSERT INTO `wms_area` VALUES (73, '01', '仓库1-库区1', 53, NULL, 1, 115, '2023-01-06 16:55:43.509', NULL, NULL); -INSERT INTO `wms_area` VALUES (74, '02', '仓库1-库区2', 53, NULL, 1, 115, '2023-01-06 16:55:59.192', NULL, NULL); -INSERT INTO `wms_area` VALUES (75, '03', '03', 55, NULL, 1, 115, '2023-01-07 10:23:55.504', NULL, NULL); -INSERT INTO `wms_area` VALUES (76, 'kuqu33333', '库区3333', 55, '测试', 1, 115, '2023-01-07 15:50:17.525', NULL, NULL); -INSERT INTO `wms_area` VALUES (77, '1', '博爱东库区', 61, NULL, 1, 115, '2023-01-07 23:55:12.779', NULL, NULL); -INSERT INTO `wms_area` VALUES (78, '2', '博爱西库区', 61, '', 1, 115, '2023-01-07 23:55:39.000', 115, '2023-01-08 23:10:33.081'); -INSERT INTO `wms_area` VALUES (79, '3', '博爱南库区', 61, NULL, 1, 115, '2023-01-08 23:10:10.391', NULL, NULL); -INSERT INTO `wms_area` VALUES (80, '4', '博爱北库区', 61, '备用库区', 1, 115, '2023-01-08 23:10:25.000', 115, '2023-01-08 23:10:43.522'); -INSERT INTO `wms_area` VALUES (81, '5', '博爱中库区', 61, '修改,添加了条备注', 1, 115, '2023-01-08 23:21:16.000', 115, '2023-01-08 23:29:47.922'); -INSERT INTO `wms_area` VALUES (82, '1', '测试库区', 64, NULL, 1, 115, '2023-01-11 20:47:17.635', NULL, NULL); -INSERT INTO `wms_area` VALUES (83, '01', '冰柜', 65, NULL, 1, 115, '2023-01-13 12:40:58.752', NULL, NULL); -INSERT INTO `wms_area` VALUES (84, '01', 'B1仓库', 74, NULL, 1, 115, '2023-01-13 12:49:38.000', 115, '2023-01-31 14:07:44.035'); -INSERT INTO `wms_area` VALUES (85, '02', '冰柜1号', 68, NULL, 1, 115, '2023-01-13 12:50:36.845', NULL, NULL); -INSERT INTO `wms_area` VALUES (86, '9', '冷冻', 66, NULL, 1, 115, '2023-01-14 12:40:44.000', 115, '2023-01-29 16:13:57.622'); -INSERT INTO `wms_area` VALUES (87, '211', '111', 66, NULL, 1, 115, '2023-01-14 16:55:27.528', NULL, NULL); -INSERT INTO `wms_area` VALUES (88, '999-1', '999-1', 72, NULL, 1, 115, '2023-01-29 21:28:27.847', NULL, NULL); -INSERT INTO `wms_area` VALUES (89, '02', 'BB', 76, NULL, 1, 115, '2023-02-01 13:39:09.000', 115, '2023-02-01 22:02:01.126'); -INSERT INTO `wms_area` VALUES (90, '01', 'AA', 84, NULL, 1, 115, '2023-02-01 22:01:47.000', 115, '2023-02-14 09:15:22.596'); -INSERT INTO `wms_area` VALUES (91, '03', '00', 77, NULL, 1, 115, '2023-02-01 22:02:11.032', NULL, NULL); -INSERT INTO `wms_area` VALUES (92, '04', '不良品', 78, NULL, 1, 115, '2023-02-01 22:02:19.305', NULL, NULL); -INSERT INTO `wms_area` VALUES (93, '11', '11', 82, NULL, 1, 115, '2023-02-03 16:46:10.932', NULL, NULL); -INSERT INTO `wms_area` VALUES (94, '0206测试', '0206测试', 83, '0206测试', 1, 115, '2023-02-06 14:11:37.841', NULL, NULL); -INSERT INTO `wms_area` VALUES (95, '001901', '种花库区1号', 85, NULL, 1, 115, '2023-02-06 16:28:14.695', NULL, NULL); -INSERT INTO `wms_area` VALUES (96, '11111111', '222', 84, NULL, 1, 115, '2023-02-07 16:33:02.460', NULL, NULL); -INSERT INTO `wms_area` VALUES (97, '44', '就是看书', 83, NULL, 1, 115, '2023-02-07 21:12:39.872', NULL, NULL); -INSERT INTO `wms_area` VALUES (98, '3001', 'A区', 86, NULL, 1, 115, '2023-02-08 09:08:21.000', 115, '2023-02-08 09:10:27.989'); -INSERT INTO `wms_area` VALUES (99, '3002', 'B区', 86, NULL, 1, 115, '2023-02-08 09:08:36.000', 115, '2023-02-08 09:10:33.453'); -INSERT INTO `wms_area` VALUES (100, '2601', '东A区', 87, NULL, 1, 115, '2023-02-08 16:31:54.986', NULL, NULL); -INSERT INTO `wms_area` VALUES (101, '002', 'a仓库', 88, NULL, 1, 115, '2023-02-10 10:42:38.219', NULL, NULL); -INSERT INTO `wms_area` VALUES (102, 'SCZX001', '打印机', 89, NULL, 1, 115, '2023-02-10 15:23:22.341', NULL, NULL); -INSERT INTO `wms_area` VALUES (103, '数创中心库房', '库房1', 89, NULL, 1, 115, '2023-02-10 15:53:22.090', NULL, NULL); -INSERT INTO `wms_area` VALUES (104, '510510', 'A区', 90, '测试用', 1, 115, '2023-02-11 10:54:30.295', NULL, NULL); -INSERT INTO `wms_area` VALUES (105, 'A001001', '轴承', 91, NULL, 1, 115, '2023-02-11 14:04:57.910', NULL, NULL); -INSERT INTO `wms_area` VALUES (106, 'A001002', '皮带', 91, NULL, 1, 115, '2023-02-11 14:05:37.433', NULL, NULL); -INSERT INTO `wms_area` VALUES (107, 'A001003', '传感器', 91, NULL, 1, 115, '2023-02-11 14:06:20.471', NULL, NULL); -INSERT INTO `wms_area` VALUES (108, 'A001004', '线缆', 91, NULL, 1, 115, '2023-02-11 14:06:38.770', NULL, NULL); -INSERT INTO `wms_area` VALUES (109, 'A001-00111', '配件A区', 92, '111111', 1, 115, '2023-02-13 13:48:35.061', NULL, NULL); -INSERT INTO `wms_area` VALUES (110, '010', '库区A1', 94, NULL, 1, 115, '2023-02-15 14:07:50.950', NULL, NULL); -INSERT INTO `wms_area` VALUES (111, '03', 'A区', 95, NULL, 1, 115, '2023-02-15 15:02:35.921', NULL, NULL); -INSERT INTO `wms_area` VALUES (112, 't001', '轮胎1', 98, NULL, 1, 115, '2023-02-16 15:07:10.456', NULL, NULL); -INSERT INTO `wms_area` VALUES (113, '11', '11', 84, '11', 1, 115, '2023-02-16 16:30:34.904', NULL, NULL); -INSERT INTO `wms_area` VALUES (114, '11', '11', 84, '11', 1, 115, '2023-02-16 16:30:48.264', NULL, NULL); -INSERT INTO `wms_area` VALUES (115, 'WB001A01', 'A库区', 101, NULL, 1, 115, '2023-02-17 10:48:15.227', NULL, NULL); -INSERT INTO `wms_area` VALUES (116, 'd01', 'dddd', 102, 'd', 1, 115, '2023-02-17 13:07:20.390', NULL, NULL); -INSERT INTO `wms_area` VALUES (117, '111111', '半成品', 104, '半成品', 1, 115, '2023-02-17 13:50:27.233', NULL, NULL); -INSERT INTO `wms_area` VALUES (118, '1', '河南', 106, NULL, 1, 115, '2023-02-21 12:00:38.421', NULL, NULL); -INSERT INTO `wms_area` VALUES (119, '001', 'Gcc', 109, 'XXX', 1, 115, '2023-02-23 19:51:29.469', NULL, NULL); -INSERT INTO `wms_area` VALUES (120, '123', '456', 109, '123456', 1, 115, '2023-02-24 15:00:19.034', NULL, NULL); -INSERT INTO `wms_area` VALUES (121, '0321', '0321库区', 111, '123456789645', 1, 115, '2023-02-24 15:01:38.033', NULL, NULL); -INSERT INTO `wms_area` VALUES (122, '001', '办公用品', 112, NULL, 1, 115, '2023-02-25 08:19:17.149', NULL, NULL); -INSERT INTO `wms_area` VALUES (123, '002', '临时堆放', 112, NULL, 1, 115, '2023-02-25 08:20:06.243', NULL, NULL); -INSERT INTO `wms_area` VALUES (124, 'test', 'test22-2-25-19:51', 112, 'test', 1, 115, '2023-02-25 19:51:53.315', NULL, NULL); -INSERT INTO `wms_area` VALUES (125, '100_01', 'm_test_01', 115, NULL, 1, 115, '2023-02-27 10:29:43.393', NULL, NULL); -INSERT INTO `wms_area` VALUES (126, '343', '1', 116, '2', 1, 115, '2023-03-01 01:09:14.767', NULL, NULL); -INSERT INTO `wms_area` VALUES (127, '002', '231', 117, '123123', 1, 115, '2023-03-01 15:29:37.220', NULL, NULL); -INSERT INTO `wms_area` VALUES (128, 'A', '疫苗库', 120, 'A', 1, 115, '2023-03-01 17:28:47.000', 115, '2023-03-02 10:16:44.047'); -INSERT INTO `wms_area` VALUES (129, 'B', 'B', 118, 'B', 1, 115, '2023-03-01 17:29:01.000', 115, '2023-03-01 17:31:19.705'); -INSERT INTO `wms_area` VALUES (130, 'A', '3A', 119, '3A', 1, 115, '2023-03-01 17:30:49.000', 115, '2023-03-01 17:32:22.777'); -INSERT INTO `wms_area` VALUES (131, 'B', '3B', 119, NULL, 1, 115, '2023-03-01 17:32:31.902', NULL, NULL); -INSERT INTO `wms_area` VALUES (132, 'C', '3C', 119, NULL, 1, 115, '2023-03-01 17:32:46.799', NULL, NULL); -INSERT INTO `wms_area` VALUES (133, 'D', '3D', 119, NULL, 1, 115, '2023-03-01 17:32:58.666', NULL, NULL); -INSERT INTO `wms_area` VALUES (134, 'A', 'A区', 121, NULL, 1, 115, '2023-03-03 20:07:24.000', 115, '2023-03-03 20:10:56.511'); -INSERT INTO `wms_area` VALUES (135, 'B', ' B区', 122, NULL, 1, 115, '2023-03-03 21:25:34.564', NULL, NULL); -INSERT INTO `wms_area` VALUES (136, '0307', '0307', 117, '0307', 1, 115, '2023-03-07 16:31:51.341', NULL, NULL); -INSERT INTO `wms_area` VALUES (137, '0089', '领用区', 122, NULL, 1, 115, '2023-03-08 13:21:47.681', NULL, NULL); -INSERT INTO `wms_area` VALUES (138, '02854', '发2', 126, NULL, 1, 115, '2023-03-09 13:11:27.625', NULL, NULL); -INSERT INTO `wms_area` VALUES (139, '123', 'A1', 128, '156', 1, 115, '2023-03-11 13:56:55.501', NULL, NULL); -INSERT INTO `wms_area` VALUES (140, '123', 'A2', 128, '2341', 1, 115, '2023-03-11 13:57:06.850', NULL, NULL); -INSERT INTO `wms_area` VALUES (141, '123', 'a3', 129, NULL, 1, 115, '2023-03-11 21:35:38.489', NULL, NULL); -INSERT INTO `wms_area` VALUES (142, '测试库区', '测试库区', 131, '测试仓库', 1, 115, '2023-03-12 15:51:17.675', NULL, NULL); -INSERT INTO `wms_area` VALUES (143, '1', '啊', 131, NULL, 1, 115, '2023-03-12 19:11:57.000', 115, '2023-03-12 19:12:17.362'); -INSERT INTO `wms_area` VALUES (144, 'a', '1', 134, NULL, 1, 115, '2023-03-13 14:40:01.458', NULL, NULL); -INSERT INTO `wms_area` VALUES (145, 'hhh', 'hhh', 140, NULL, 1, 115, '2023-03-13 15:52:51.000', 115, '2023-03-30 17:33:38.041'); -INSERT INTO `wms_area` VALUES (146, 'hhh', 'hhh', 136, NULL, 1, 115, '2023-03-13 15:52:51.998', NULL, NULL); -INSERT INTO `wms_area` VALUES (147, '111', '111', 135, NULL, 1, 115, '2023-03-13 16:11:35.778', NULL, NULL); -INSERT INTO `wms_area` VALUES (148, '123', '111', 137, NULL, 1, 115, '2023-03-14 14:12:08.312', NULL, NULL); -INSERT INTO `wms_area` VALUES (149, '555', '555', 135, NULL, 1, 115, '2023-03-14 23:57:20.887', NULL, NULL); -INSERT INTO `wms_area` VALUES (150, '222', '222', 138, NULL, 1, 115, '2023-03-20 13:45:55.556', NULL, NULL); -INSERT INTO `wms_area` VALUES (151, '123111', 'igc', 149, NULL, 1, 115, '2023-03-21 17:30:15.608', NULL, NULL); -INSERT INTO `wms_area` VALUES (152, '0322', '服装1-库区-甲', 154, '20230322', 1, 115, '2023-03-22 15:46:37.000', 115, '2023-03-22 15:48:00.840'); -INSERT INTO `wms_area` VALUES (153, 'HD-PC-01', '华东电脑库区', 155, NULL, 1, 115, '2023-03-22 22:48:02.211', NULL, NULL); -INSERT INTO `wms_area` VALUES (154, '1234', '喝的', 160, NULL, 1, 115, '2023-03-24 14:21:03.000', 115, '2023-03-28 08:50:18.712'); -INSERT INTO `wms_area` VALUES (155, '1351', '器材库', 139, 'fcl/T1', 1, 115, '2023-03-24 23:58:00.000', 115, '2023-03-29 20:34:58.978'); -INSERT INTO `wms_area` VALUES (156, '777', '777', 163, '66', 1, 115, '2023-03-25 15:19:10.224', NULL, NULL); -INSERT INTO `wms_area` VALUES (157, '00101', '00101', 165, NULL, 1, 115, '2023-03-25 15:22:21.090', NULL, NULL); -INSERT INTO `wms_area` VALUES (158, '123', '123', 167, NULL, 1, 115, '2023-03-27 13:44:07.435', NULL, NULL); -INSERT INTO `wms_area` VALUES (159, 'kq-01', '测试库区1', 171, NULL, 1, 115, '2023-03-29 13:32:45.275', NULL, NULL); -INSERT INTO `wms_area` VALUES (160, '本子', '本子', 138, NULL, 1, 115, '2023-03-30 18:21:07.566', NULL, NULL); -INSERT INTO `wms_area` VALUES (161, 'cq001-1', '一库区', 173, NULL, 1, 115, '2023-03-31 12:06:47.095', NULL, NULL); -INSERT INTO `wms_area` VALUES (162, 'gongsi', '公司', 174, NULL, 1, 115, '2023-04-01 06:31:40.749', NULL, NULL); -INSERT INTO `wms_area` VALUES (163, 'HZ1', '华中1号库', 178, '童鞋', 1, 115, '2023-04-04 11:46:03.000', 115, '2023-04-04 14:52:04.029'); -INSERT INTO `wms_area` VALUES (164, 'HZ2', '华中2号库', 178, '男鞋', 1, 115, '2023-04-04 11:48:49.000', 115, '2023-04-04 14:52:10.059'); -INSERT INTO `wms_area` VALUES (165, 'HZ3', '华中3号库', 178, '女鞋', 1, 115, '2023-04-04 11:49:10.000', 115, '2023-04-04 14:52:20.434'); -INSERT INTO `wms_area` VALUES (166, 'HZ4', '华中4号库', 178, '备品库', 1, 115, '2023-04-04 14:53:32.409', NULL, NULL); -INSERT INTO `wms_area` VALUES (167, '141431', '45225', 180, NULL, 1, 115, '2023-04-05 12:27:14.466', NULL, NULL); -INSERT INTO `wms_area` VALUES (168, '大内密探002', '我是库区', 181, '大内密探002', 1, 115, '2023-04-06 14:06:09.000', 115, '2023-04-06 14:07:53.499'); -INSERT INTO `wms_area` VALUES (169, 'one-1', 'yyf的仓库的库区', 184, 'yyf', 1, 115, '2023-04-06 14:58:18.174', NULL, NULL); -INSERT INTO `wms_area` VALUES (170, '800', '冷藏', 185, NULL, 1, 115, '2023-04-06 22:42:00.151', NULL, NULL); -INSERT INTO `wms_area` VALUES (171, '111', '一库区', 155, NULL, 1, 115, '2023-04-10 09:11:57.879', NULL, NULL); -INSERT INTO `wms_area` VALUES (172, '2222', '二库区', 155, NULL, 1, 115, '2023-04-10 09:12:10.843', NULL, NULL); -INSERT INTO `wms_area` VALUES (173, '333', '三库区', 155, NULL, 1, 115, '2023-04-10 09:12:22.867', NULL, NULL); -INSERT INTO `wms_area` VALUES (174, 'test01', 'test1234', 178, NULL, 1, 115, '2023-04-10 13:35:14.501', NULL, NULL); -INSERT INTO `wms_area` VALUES (175, 'test02', 'test02', 178, NULL, 1, 115, '2023-04-10 13:35:30.937', NULL, NULL); -INSERT INTO `wms_area` VALUES (176, 'test02', 'test02', 178, '', 1, 115, '2023-04-10 13:42:26.000', 115, '2023-04-11 16:46:22.708'); -INSERT INTO `wms_area` VALUES (177, '123', 'sf', 154, '123', 1, 115, '2023-04-11 08:09:55.948', NULL, NULL); -INSERT INTO `wms_area` VALUES (178, '10001', '常温库区', 193, '规划局', 0, 115, '2023-04-13 10:08:19.000', 115, '2023-04-18 19:04:09.427'); -INSERT INTO `wms_area` VALUES (179, '10002', '低温库区', 192, NULL, 0, 115, '2023-04-13 10:08:56.000', 115, '2023-04-13 10:11:23.383'); -INSERT INTO `wms_area` VALUES (180, '10003', '低温库区', 193, NULL, 0, 115, '2023-04-13 10:09:22.000', 115, '2023-04-13 10:11:49.267'); -INSERT INTO `wms_area` VALUES (181, '10004', '常温库区', 194, '111', 0, 115, '2023-04-13 10:09:43.000', 1, '2023-04-26 09:01:45.846'); -INSERT INTO `wms_area` VALUES (182, '10005', '低温库区', 195, NULL, 0, 115, '2023-04-13 10:10:04.000', 115, '2023-04-13 10:11:41.306'); -INSERT INTO `wms_area` VALUES (183, '10006', '常温库区', 196, NULL, 0, 115, '2023-04-13 10:10:18.000', 115, '2023-04-13 10:12:01.775'); -INSERT INTO `wms_area` VALUES (184, '10007', '低温库区', 197, NULL, 0, 115, '2023-04-13 10:10:30.000', 115, '2023-04-13 10:11:37.194'); -INSERT INTO `wms_area` VALUES (185, '10008', '常温库区', 198, NULL, 0, 115, '2023-04-13 10:10:39.000', 115, '2023-04-13 10:12:05.256'); -INSERT INTO `wms_area` VALUES (186, '10009', '低温库区', 199, NULL, 0, 115, '2023-04-13 10:10:49.000', 115, '2023-04-13 10:11:32.915'); -INSERT INTO `wms_area` VALUES (187, '10010', '常温库区', 204, NULL, 1, 115, '2023-04-18 11:28:40.083', NULL, NULL); -INSERT INTO `wms_area` VALUES (188, '22', '22', 210, NULL, 0, 115, '2023-04-20 11:30:17.471', NULL, NULL); -INSERT INTO `wms_area` VALUES (189, '1001', '南1区', 215, NULL, 0, 115, '2023-04-24 15:33:03.797', NULL, NULL); -INSERT INTO `wms_area` VALUES (190, '1002', '南2区', 215, NULL, 0, 115, '2023-04-24 15:33:17.553', NULL, NULL); -INSERT INTO `wms_area` VALUES (191, 'test194', 'test194', 194, '194浙江1仓的修改了', 1, 1, '2023-04-25 22:37:53.000', 1, '2023-04-25 22:38:03.888'); -INSERT INTO `wms_area` VALUES (192, '1', '1', 194, '1', 1, 1, '2023-04-25 22:55:26.660', NULL, NULL); -INSERT INTO `wms_area` VALUES (193, '2', '2', 194, '2', 1, 1, '2023-04-25 22:55:31.071', NULL, NULL); -INSERT INTO `wms_area` VALUES (194, '123213', '321321', 194, '312312', 1, 1, '2023-04-26 08:50:15.078', NULL, NULL); -INSERT INTO `wms_area` VALUES (195, 'kq1', 'kq1', 224, '111', 0, 1, '2023-04-26 09:57:59.000', 1, '2023-04-26 10:20:17.709'); -INSERT INTO `wms_area` VALUES (196, 'kq2', 'kq2', 224, NULL, 0, 1, '2023-04-26 09:58:07.159', NULL, NULL); -INSERT INTO `wms_area` VALUES (197, 'kq3', 'kq3', 224, NULL, 0, 1, '2023-04-26 09:58:18.238', NULL, NULL); -INSERT INTO `wms_area` VALUES (198, 'kq4', 'kq4', 224, NULL, 0, 1, '2023-04-26 09:58:25.437', NULL, NULL); -INSERT INTO `wms_area` VALUES (199, 'kq5', 'kq5', 224, NULL, 0, 1, '2023-04-26 09:58:34.960', NULL, NULL); -INSERT INTO `wms_area` VALUES (200, 'kq6', 'kq6', 224, NULL, 0, 1, '2023-04-26 09:58:41.499', NULL, NULL); -INSERT INTO `wms_area` VALUES (201, 'kq7', 'kq7', 224, NULL, 0, 1, '2023-04-26 09:58:47.518', NULL, NULL); -INSERT INTO `wms_area` VALUES (202, 'kq8', 'kq8', 224, NULL, 1, 1, '2023-04-26 09:58:54.161', NULL, NULL); -INSERT INTO `wms_area` VALUES (203, 'kq9', 'kq9', 224, NULL, 1, 1, '2023-04-26 09:59:01.554', NULL, NULL); -INSERT INTO `wms_area` VALUES (204, 'kq8', 'kq8', 224, NULL, 0, 1, '2023-04-26 10:16:20.641', NULL, NULL); -INSERT INTO `wms_area` VALUES (205, 'kq10', 'kq10', 224, NULL, 0, 1, '2023-04-26 10:48:46.016', NULL, NULL); -INSERT INTO `wms_area` VALUES (206, 'kq11', 'kq11', 224, NULL, 0, 1, '2023-04-26 10:48:53.575', NULL, NULL); -INSERT INTO `wms_area` VALUES (207, 'kq12', 'kq12', 224, NULL, 0, 1, '2023-04-26 10:50:09.014', NULL, NULL); -INSERT INTO `wms_area` VALUES (208, 'kq12', 'kq12', 224, NULL, 0, 1, '2023-04-26 10:50:11.038', NULL, NULL); -INSERT INTO `wms_area` VALUES (209, '一giao窝里giaogiao', '一giao窝里giaogiao', 196, '一giao窝里giaogiao', 0, 115, '2023-04-27 16:10:56.328', NULL, NULL); -INSERT INTO `wms_area` VALUES (210, '货架层及更细库位管理', '货架层及更细库位管理', 225, '货架层及更细库位管理', 0, 115, '2023-04-27 16:50:16.202', NULL, NULL); -INSERT INTO `wms_area` VALUES (211, '213', '21', 198, '21', 0, 115, '2023-04-29 08:41:14.695', NULL, NULL); -INSERT INTO `wms_area` VALUES (212, '123', '11', 227, '11', 0, 115, '2023-04-29 08:43:33.377', NULL, NULL); -INSERT INTO `wms_area` VALUES (213, '3333', '333', 227, '33', 0, 115, '2023-04-29 08:43:37.250', NULL, NULL); -INSERT INTO `wms_area` VALUES (214, '222', '22', 227, '22', 0, 115, '2023-04-29 08:43:40.872', NULL, NULL); -INSERT INTO `wms_area` VALUES (215, 'k1', '北京库', 228, NULL, 0, 115, '2023-04-30 16:43:32.000', 115, '2023-04-30 16:44:58.989'); -INSERT INTO `wms_area` VALUES (216, 'xinqu', '001', 229, '222', 0, 115, '2023-05-01 12:16:59.000', 115, '2023-05-03 11:11:08.616'); -INSERT INTO `wms_area` VALUES (217, '1001', '收3232', 231, NULL, 0, 115, '2023-05-02 13:40:58.644', NULL, NULL); -INSERT INTO `wms_area` VALUES (218, '22', '22', 229, '22', 0, 115, '2023-05-02 16:01:09.988', NULL, NULL); -INSERT INTO `wms_area` VALUES (219, '33', '大理', 229, '零食', 0, 115, '2023-05-03 19:21:00.961', NULL, NULL); -INSERT INTO `wms_area` VALUES (220, '2', '3ref', 235, 'fsd', 0, 115, '2023-05-04 16:43:02.651', NULL, NULL); -INSERT INTO `wms_area` VALUES (221, 'gdf', 'sdgf', 234, 'erf', 0, 115, '2023-05-04 16:43:11.246', NULL, NULL); - --- ---------------------------- --- Table structure for wms_carrier --- ---------------------------- -DROP TABLE IF EXISTS `wms_carrier`; -CREATE TABLE `wms_carrier` ( - `id` bigint(20) NOT NULL AUTO_INCREMENT, - `carrier_no` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '编号', - `carrier_name` varchar(60) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '名称', - `address` varchar(80) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '地址', - `mobile` varchar(13) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '手机号', - `tel` varchar(13) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '座机号', - `contact` varchar(30) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '联系人', - `level` varchar(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '级别', - `email` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT 'Email', - `remark` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '备注', - `del_flag` tinyint(4) NOT NULL DEFAULT 0 COMMENT '删除标识', - `create_by` bigint(20) NULL DEFAULT NULL COMMENT '创建人', - `create_time` datetime(3) NULL DEFAULT NULL COMMENT '创建时间', - `update_by` bigint(20) NULL DEFAULT NULL COMMENT '修改人', - `update_time` datetime(3) NULL DEFAULT NULL COMMENT '修改时间', - PRIMARY KEY (`id`) USING BTREE -) ENGINE = InnoDB AUTO_INCREMENT = 24 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '承运商' ROW_FORMAT = Dynamic; - --- ---------------------------- --- Records of wms_carrier --- ---------------------------- -INSERT INTO `wms_carrier` VALUES (1, 'sf', '顺丰快运', '上海', '18010008888', '0512-52251234', '李', '第一级', '1111', '1111', 1, 1, '2022-07-29 18:04:11.000', 115, '2022-11-16 15:44:03.292'); -INSERT INTO `wms_carrier` VALUES (2, '1', '11', '1', '1', '1', '1', '第一级', '1', '1111111111111', 1, 115, '2022-12-28 14:06:27.136', NULL, NULL); -INSERT INTO `wms_carrier` VALUES (3, '123456', '承运商1', NULL, NULL, NULL, NULL, NULL, NULL, NULL, 1, 115, '2022-12-29 15:30:57.899', NULL, NULL); -INSERT INTO `wms_carrier` VALUES (4, '01', '京东', NULL, NULL, NULL, NULL, NULL, NULL, NULL, 1, 115, '2023-01-08 23:52:04.864', NULL, NULL); -INSERT INTO `wms_carrier` VALUES (5, '02', '顺丰', NULL, NULL, NULL, NULL, NULL, NULL, NULL, 1, 115, '2023-01-08 23:52:13.119', NULL, NULL); -INSERT INTO `wms_carrier` VALUES (6, '03', '圆通', NULL, NULL, NULL, NULL, NULL, NULL, NULL, 1, 115, '2023-01-08 23:52:22.153', NULL, NULL); -INSERT INTO `wms_carrier` VALUES (7, '04', '邮政', NULL, NULL, NULL, NULL, NULL, NULL, NULL, 1, 115, '2023-01-09 01:24:19.710', NULL, NULL); -INSERT INTO `wms_carrier` VALUES (8, '05', '中通', NULL, NULL, NULL, NULL, NULL, NULL, NULL, 1, 115, '2023-01-09 01:29:02.614', NULL, NULL); -INSERT INTO `wms_carrier` VALUES (9, '123', '123', '123', '123', '123', '123', '第一级', '123', '123', 1, 115, '2023-01-14 13:26:47.000', 115, '2023-01-28 17:47:25.969'); -INSERT INTO `wms_carrier` VALUES (10, '01', '承运', '承运地址', '1545631296', '21562163', '接电话', '第一级', NULL, NULL, 1, 115, '2023-02-01 22:06:10.000', 115, '2023-02-04 17:16:47.000'); -INSERT INTO `wms_carrier` VALUES (11, '02', '承运商2', NULL, NULL, NULL, NULL, NULL, NULL, NULL, 1, 115, '2023-02-06 10:14:15.079', NULL, NULL); -INSERT INTO `wms_carrier` VALUES (12, '03', '承运商3', '天朝', '13188888888', '123456', '宋霸天', '第一级', 'za.r.a.e.l.l.i.s.33@gmail.com', NULL, 1, 115, '2023-02-15 15:01:11.454', NULL, NULL); -INSERT INTO `wms_carrier` VALUES (13, '+21321', '12131', '杭州滨江长河街道', NULL, NULL, NULL, NULL, '11756@qq.com', NULL, 1, 115, '2023-02-27 12:26:50.190', NULL, NULL); -INSERT INTO `wms_carrier` VALUES (14, '乐途', '上海乐途物流有限公司', NULL, NULL, NULL, NULL, NULL, NULL, NULL, 1, 115, '2023-03-01 17:59:32.889', NULL, NULL); -INSERT INTO `wms_carrier` VALUES (15, '上海智胜', '上海智胜', NULL, NULL, NULL, NULL, NULL, NULL, NULL, 1, 115, '2023-03-01 18:00:02.219', NULL, NULL); -INSERT INTO `wms_carrier` VALUES (16, 'cys1', '承运商1', NULL, NULL, NULL, NULL, NULL, NULL, NULL, 1, 115, '2023-03-14 10:03:07.825', NULL, NULL); -INSERT INTO `wms_carrier` VALUES (17, 'sy1', '承运1', NULL, NULL, NULL, NULL, NULL, NULL, NULL, 1, 115, '2023-03-22 15:53:48.924', NULL, NULL); -INSERT INTO `wms_carrier` VALUES (18, 'sy0323', '快的', '上海市浦东新区', '15546310885', '15546310885', '孙垚', '第一级', 'sunyao@sinosoft.com.cn', 'yiyiyiy', 1, 115, '2023-03-23 13:58:31.803', NULL, NULL); -INSERT INTO `wms_carrier` VALUES (19, '001', '汽车运输', '1', '1', '1', '1', '第一级', '1', '1', 0, 115, '2023-04-06 14:09:54.000', 115, '2023-04-26 10:57:14.385'); -INSERT INTO `wms_carrier` VALUES (20, '002', '火车运输', NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, 115, '2023-04-26 10:57:27.883', NULL, NULL); -INSERT INTO `wms_carrier` VALUES (21, '003', '水路运输', NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, 115, '2023-04-26 10:57:46.418', NULL, NULL); -INSERT INTO `wms_carrier` VALUES (22, '004', '飞机运输', NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, 115, '2023-04-26 10:57:58.532', NULL, NULL); -INSERT INTO `wms_carrier` VALUES (23, '005', '2', '22', '4333', '22', '2222', '第一级', '222', '22', 0, 115, '2023-04-29 18:11:44.425', NULL, NULL); - --- ---------------------------- --- Table structure for wms_customer --- ---------------------------- -DROP TABLE IF EXISTS `wms_customer`; -CREATE TABLE `wms_customer` ( - `id` bigint(20) NOT NULL AUTO_INCREMENT, - `customer_no` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '编号', - `customer_name` varchar(60) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '名称', - `bank_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '开户行', - `bank_account` varchar(40) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '银行账户', - `receivable_amount` decimal(10, 2) NULL DEFAULT 0.00 COMMENT '应收款', - `address` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '地址', - `mobile` varchar(13) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '手机号', - `tel` varchar(13) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '座机号', - `customer_person` varchar(30) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '联系人', - `customer_level` varchar(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '级别', - `email` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT 'Email', - `remark` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '备注', - `del_flag` tinyint(4) NOT NULL DEFAULT 0 COMMENT '删除标识', - `create_by` bigint(20) NULL DEFAULT NULL COMMENT '创建人', - `create_time` datetime(3) NULL DEFAULT NULL COMMENT '创建时间', - `update_by` bigint(20) NULL DEFAULT NULL COMMENT '修改人', - `update_time` datetime(3) NULL DEFAULT NULL COMMENT '修改时间', - PRIMARY KEY (`id`) USING BTREE -) ENGINE = InnoDB AUTO_INCREMENT = 40 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '客户' ROW_FORMAT = Dynamic; - --- ---------------------------- --- Records of wms_customer --- ---------------------------- -INSERT INTO `wms_customer` VALUES (1, '1', '1', NULL, NULL, NULL, '1', '1', '1', '1', NULL, NULL, NULL, 1, 1, '2022-07-29 18:16:17.761', NULL, NULL); -INSERT INTO `wms_customer` VALUES (2, '1', '1', NULL, NULL, NULL, '1', '1', '1', '1', '1', '1', '1', 1, 1, '2022-08-04 15:28:11.436', NULL, NULL); -INSERT INTO `wms_customer` VALUES (3, '1', '1', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '1', 1, 1, '2022-08-04 18:24:50.963', NULL, NULL); -INSERT INTO `wms_customer` VALUES (4, '1', '苏州霍地', NULL, NULL, NULL, '星湖街328号', '17156568888', '0512-12345678', '李先生', '1', NULL, NULL, 1, 1, '2022-08-11 21:14:54.000', 115, '2022-11-07 11:27:37.635'); -INSERT INTO `wms_customer` VALUES (5, '111', '1111', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 1, 1, '2022-08-11 21:32:58.323', NULL, NULL); -INSERT INTO `wms_customer` VALUES (6, '1111', '1111', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 1, NULL, '2022-08-13 13:52:47.891', NULL, NULL); -INSERT INTO `wms_customer` VALUES (7, '1111', '1111', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 1, NULL, '2022-08-13 13:52:48.793', NULL, NULL); -INSERT INTO `wms_customer` VALUES (8, 'sss', 'sss', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 1, NULL, '2022-08-13 13:54:10.586', NULL, NULL); -INSERT INTO `wms_customer` VALUES (9, '11', '111', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 1, 1, '2022-08-13 13:57:05.004', NULL, NULL); -INSERT INTO `wms_customer` VALUES (10, '2', '山东A企业', NULL, NULL, NULL, 'ABC', '1852354427', '86060606', '刘女士', '2', '12345@qq.com', 'aaaaaa', 1, 115, '2022-11-10 16:55:07.344', NULL, NULL); -INSERT INTO `wms_customer` VALUES (11, '111', '111', NULL, NULL, NULL, '111', '12312341234', '12345678901', 'dewqrew', '4', 'fds', 'test3', 1, 115, '2022-12-07 19:17:56.000', 115, '2022-12-08 15:13:07.998'); -INSERT INTO `wms_customer` VALUES (12, '001', '渣土', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 1, 115, '2022-12-28 11:39:45.000', 115, '2023-01-05 08:54:22.131'); -INSERT INTO `wms_customer` VALUES (13, '002', '客户2', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 1, 115, '2023-01-05 16:41:13.190', NULL, NULL); -INSERT INTO `wms_customer` VALUES (14, '01', '张三', NULL, NULL, NULL, '东城', NULL, NULL, NULL, NULL, NULL, NULL, 1, 115, '2023-01-06 16:56:59.000', 115, '2023-01-08 23:50:52.836'); -INSERT INTO `wms_customer` VALUES (15, '02', '李四', NULL, NULL, NULL, '西城', NULL, NULL, NULL, NULL, NULL, NULL, 1, 115, '2023-01-08 23:51:09.538', NULL, NULL); -INSERT INTO `wms_customer` VALUES (16, '03', '王五', NULL, NULL, NULL, '南城', NULL, NULL, NULL, NULL, NULL, NULL, 1, 115, '2023-01-08 23:51:23.617', NULL, NULL); -INSERT INTO `wms_customer` VALUES (17, '04', '赵六', NULL, NULL, NULL, '北城', NULL, NULL, NULL, NULL, NULL, NULL, 1, 115, '2023-01-09 01:21:58.222', NULL, NULL); -INSERT INTO `wms_customer` VALUES (18, '01', '客户', NULL, NULL, NULL, '1', '1563163', '26521563', '抠脚大', 'VIP', NULL, NULL, 1, 115, '2023-02-01 22:05:48.000', 115, '2023-02-04 17:14:46.125'); -INSERT INTO `wms_customer` VALUES (19, '02', '客户2', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 1, 115, '2023-02-06 10:13:59.968', NULL, NULL); -INSERT INTO `wms_customer` VALUES (20, '2302060001', '废料收购商', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 1, 115, '2023-02-06 15:19:42.828', NULL, NULL); -INSERT INTO `wms_customer` VALUES (21, '03', '动霸', NULL, NULL, NULL, '天朝', '13288888888', '123456', '王霸天', 'VIP', 'za.r.a.e.l.l.i.s.33@gmail.com', NULL, 1, 115, '2023-02-15 14:59:01.000', 115, '2023-02-15 14:59:12.618'); -INSERT INTO `wms_customer` VALUES (22, 'AA01', '测试客户1', NULL, NULL, NULL, 'd', '18909090909', NULL, NULL, NULL, NULL, NULL, 1, 115, '2023-02-17 13:09:52.314', NULL, NULL); -INSERT INTO `wms_customer` VALUES (23, '213212', '421', NULL, NULL, NULL, '杭州滨江长河街道', NULL, NULL, NULL, NULL, '11756@qq.com', NULL, 1, 115, '2023-02-27 12:26:37.815', NULL, NULL); -INSERT INTO `wms_customer` VALUES (24, '怡康', '怡康', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 1, 115, '2023-03-01 17:55:59.963', NULL, NULL); -INSERT INTO `wms_customer` VALUES (25, '高航', '高航', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 1, 115, '2023-03-01 17:56:11.280', NULL, NULL); -INSERT INTO `wms_customer` VALUES (26, 'ewrwer', 'qweqwe', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 1, 115, '2023-03-11 12:27:50.796', NULL, NULL); -INSERT INTO `wms_customer` VALUES (27, 'kh1', '客户1', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 1, 115, '2023-03-14 10:03:26.829', NULL, NULL); -INSERT INTO `wms_customer` VALUES (28, 'sy001', '哈哈', NULL, NULL, NULL, '上海市浦东新区五星路', '15546310885', NULL, '孙垚', '一级', 'sunyao@sinosoft.com.cn', NULL, 1, 115, '2023-03-22 15:52:04.671', NULL, NULL); -INSERT INTO `wms_customer` VALUES (29, '1', '123', NULL, NULL, NULL, '河北邯郸', '15110032656', NULL, '五', NULL, '2813846259@qq.com', NULL, 1, 115, '2023-03-25 16:38:09.333', NULL, NULL); -INSERT INTO `wms_customer` VALUES (30, '1', '威威', NULL, NULL, NULL, '河北邯郸肥乡区', '15110043888', NULL, '嗡嗡嗡', NULL, '2813846259@qq.com', NULL, 1, 115, '2023-03-28 15:29:00.487', NULL, NULL); -INSERT INTO `wms_customer` VALUES (31, '123', '嗡嗡嗡企鹅', NULL, NULL, NULL, '北京', '12345678912', NULL, '锵锵锵', '库长', 'hang18732057137@163.com', '韩寒', 1, 115, '2023-03-28 15:34:16.581', NULL, NULL); -INSERT INTO `wms_customer` VALUES (32, '123', '嗡嗡嗡企鹅', NULL, NULL, NULL, '北京', '12345678912', NULL, '锵锵锵', '库长', 'hang18732057137@163.com', '韩寒', 1, 115, '2023-03-28 15:34:26.095', NULL, NULL); -INSERT INTO `wms_customer` VALUES (33, '1', '南京大学', NULL, NULL, NULL, '南京', '13456789045', '002731283', '体育协会', '3', NULL, NULL, 1, 115, '2023-03-29 20:44:05.656', NULL, NULL); -INSERT INTO `wms_customer` VALUES (34, '111', '1', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 1, 115, '2023-03-30 16:50:56.417', NULL, NULL); -INSERT INTO `wms_customer` VALUES (35, '1', '京东', NULL, NULL, NULL, '1', '1', '1', '1', '1', '1', '1', 1, 115, '2023-04-06 14:09:27.000', 115, '2023-04-15 20:42:41.326'); -INSERT INTO `wms_customer` VALUES (36, '2', '国美电器', NULL, NULL, NULL, '四川成都', '13288888888', '028-666666', '成*', '2', '123@163.com', 'test', 1, 115, '2023-04-06 15:15:01.000', 115, '2023-04-19 12:07:52.815'); -INSERT INTO `wms_customer` VALUES (37, '3', '苏宁', NULL, NULL, 1850.00, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, 115, '2023-04-06 22:43:51.000', 1, '2023-05-04 18:17:16.013'); -INSERT INTO `wms_customer` VALUES (38, '4', '老师好', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 1, 115, '2023-04-12 21:20:34.000', 115, '2023-04-12 21:21:10.464'); -INSERT INTO `wms_customer` VALUES (39, '2', '兴盛果蔬', NULL, NULL, 0.00, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, 115, '2023-04-26 10:54:25.522', NULL, NULL); - --- ---------------------------- --- Table structure for wms_customer_transaction --- ---------------------------- -DROP TABLE IF EXISTS `wms_customer_transaction`; -CREATE TABLE `wms_customer_transaction` ( - `id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'id', - `transaction_code` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '交易编号', - `customer_id` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '用户编号', - `transaction_type` varchar(2) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '交易类型 1:结款 2:应付 ', - `transaction_amount` decimal(18, 2) NOT NULL COMMENT '交易金额', - `previous_balance` decimal(18, 2) NOT NULL COMMENT '上期余额', - `current_balance` decimal(18, 2) NOT NULL COMMENT '当前余额', - `shipment_order_id` bigint(20) NULL DEFAULT NULL COMMENT '出库单号', - `remark` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '备注', - `del_flag` tinyint(4) NOT NULL DEFAULT 0 COMMENT '删除标志', - `create_time` datetime(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0) COMMENT '创建时间', - `update_time` datetime(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0) ON UPDATE CURRENT_TIMESTAMP(0) COMMENT '更新时间', - PRIMARY KEY (`id`) USING BTREE -) ENGINE = InnoDB AUTO_INCREMENT = 47 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '客户账户流水' ROW_FORMAT = Dynamic; - --- ---------------------------- --- Records of wms_customer_transaction --- ---------------------------- -INSERT INTO `wms_customer_transaction` VALUES (44, 'TS-2023-05-04-180642', '37', '22', 100.00, 0.00, 100.00, 0, NULL, 0, '2023-05-04 18:07:52', '2023-05-04 18:06:07'); -INSERT INTO `wms_customer_transaction` VALUES (45, 'TS-2023-05-04-180859', '37', '11', 50.00, 100.00, 50.00, 0, NULL, 0, '2023-05-04 18:09:04', '2023-05-04 18:07:19'); -INSERT INTO `wms_customer_transaction` VALUES (46, 'TS-2023-05-124-181715', '37', '33', 1800.00, 50.00, 1850.00, 271, NULL, 0, '2023-05-04 18:17:16', '2023-05-04 18:15:31'); - --- ---------------------------- --- Table structure for wms_delivery --- ---------------------------- -DROP TABLE IF EXISTS `wms_delivery`; -CREATE TABLE `wms_delivery` ( - `id` bigint(20) NOT NULL AUTO_INCREMENT, - `shipment_order_id` bigint(20) NULL DEFAULT NULL COMMENT '出库单主表Id', - `carrier_id` bigint(20) NULL DEFAULT NULL COMMENT '承运商Id', - `delivery_date` datetime(3) NULL DEFAULT NULL COMMENT '发货日期', - `tracking_no` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '快递单号', - `remark` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '备注', - `del_flag` tinyint(4) NOT NULL DEFAULT 0 COMMENT '删除标识', - `create_by` bigint(20) NULL DEFAULT NULL COMMENT '创建人', - `create_time` datetime(3) NULL DEFAULT NULL COMMENT '创建时间', - `update_by` bigint(20) NULL DEFAULT NULL COMMENT '修改人', - `update_time` datetime(3) NULL DEFAULT NULL COMMENT '修改时间', - PRIMARY KEY (`id`) USING BTREE -) ENGINE = InnoDB AUTO_INCREMENT = 25 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '发货记录' ROW_FORMAT = Dynamic; - --- ---------------------------- --- Records of wms_delivery --- ---------------------------- -INSERT INTO `wms_delivery` VALUES (1, 209, 16, '2023-03-30 00:00:00.000', '78671332383267', NULL, 0, 1, '2023-03-30 21:13:39.769', NULL, NULL); -INSERT INTO `wms_delivery` VALUES (2, 203, 16, '2023-03-30 00:00:00.000', '78671332383267', NULL, 0, 1, '2023-03-30 21:15:24.551', NULL, NULL); -INSERT INTO `wms_delivery` VALUES (3, 210, 16, NULL, NULL, NULL, 0, 115, '2023-04-02 05:20:22.998', NULL, NULL); -INSERT INTO `wms_delivery` VALUES (4, 209, 16, '2023-04-07 00:00:00.000', '123123', '123213', 0, 115, '2023-04-03 17:25:38.181', NULL, NULL); -INSERT INTO `wms_delivery` VALUES (5, 221, 17, '2023-04-03 00:00:00.000', '213', '123', 0, 115, '2023-04-03 17:34:05.452', NULL, NULL); -INSERT INTO `wms_delivery` VALUES (6, 224, NULL, NULL, '111', NULL, 0, 115, '2023-04-06 10:38:40.627', NULL, NULL); -INSERT INTO `wms_delivery` VALUES (7, 217, NULL, '2023-04-05 00:00:00.000', '111', '111', 0, 115, '2023-04-06 14:23:51.455', NULL, NULL); -INSERT INTO `wms_delivery` VALUES (8, 227, 19, NULL, NULL, NULL, 0, 115, '2023-04-06 22:46:21.738', NULL, NULL); -INSERT INTO `wms_delivery` VALUES (9, 229, 19, '2023-02-01 00:00:00.000', 'SF20223236', NULL, 0, 115, '2023-04-08 10:50:45.866', NULL, NULL); -INSERT INTO `wms_delivery` VALUES (10, 235, 19, '2023-04-11 00:00:00.000', '56151565', NULL, 0, 115, '2023-04-11 12:59:00.283', NULL, NULL); -INSERT INTO `wms_delivery` VALUES (11, 237, 19, '2023-04-11 16:01:31.000', NULL, NULL, 0, 115, '2023-04-11 16:01:33.591', NULL, NULL); -INSERT INTO `wms_delivery` VALUES (12, 239, 19, '2023-04-12 00:00:00.000', '2222', '2222', 0, 115, '2023-04-12 19:01:06.938', NULL, NULL); -INSERT INTO `wms_delivery` VALUES (13, 241, 19, '2023-04-13 00:00:00.000', '1', '1', 0, 115, '2023-04-13 21:51:29.734', NULL, NULL); -INSERT INTO `wms_delivery` VALUES (14, 246, 19, '2023-04-13 00:00:00.000', '11', '11', 0, 115, '2023-04-15 22:23:30.600', NULL, NULL); -INSERT INTO `wms_delivery` VALUES (15, 209, 19, '2023-04-11 00:00:00.000', '2222', NULL, 0, 115, '2023-04-19 23:29:05.678', NULL, NULL); -INSERT INTO `wms_delivery` VALUES (16, 245, 19, '2023-04-21 00:00:00.000', '1234', NULL, 0, 115, '2023-04-21 09:52:19.925', NULL, NULL); -INSERT INTO `wms_delivery` VALUES (17, 253, 19, '2023-04-22 00:00:00.000', '1', '1', 0, 115, '2023-04-22 19:11:25.666', NULL, NULL); -INSERT INTO `wms_delivery` VALUES (18, 252, 19, '2023-04-22 00:00:00.000', '22', NULL, 0, 115, '2023-04-22 19:12:09.435', NULL, NULL); -INSERT INTO `wms_delivery` VALUES (19, 250, 19, '2023-04-22 00:00:00.000', '222', '1', 0, 115, '2023-04-22 19:17:45.132', NULL, NULL); -INSERT INTO `wms_delivery` VALUES (20, 260, 19, '2023-04-28 00:00:00.000', NULL, NULL, 0, 115, '2023-04-25 15:00:11.168', NULL, NULL); -INSERT INTO `wms_delivery` VALUES (21, 260, 19, '2023-04-28 00:00:00.000', NULL, NULL, 0, 115, '2023-04-25 15:00:19.713', NULL, NULL); -INSERT INTO `wms_delivery` VALUES (22, 261, 19, '2023-04-25 00:00:00.000', NULL, '4444444444', 0, 115, '2023-04-25 15:56:32.913', NULL, NULL); -INSERT INTO `wms_delivery` VALUES (23, 258, 19, '2023-04-20 00:00:00.000', '123141', '234', 0, 115, '2023-04-25 17:55:33.745', NULL, NULL); -INSERT INTO `wms_delivery` VALUES (24, 254, 19, '2023-04-25 18:39:07.000', '2333', NULL, 0, 115, '2023-04-25 18:39:14.128', NULL, NULL); - --- ---------------------------- --- Table structure for wms_inventory --- ---------------------------- -DROP TABLE IF EXISTS `wms_inventory`; -CREATE TABLE `wms_inventory` ( - `id` bigint(20) NOT NULL AUTO_INCREMENT, - `item_id` bigint(20) NULL DEFAULT NULL COMMENT '物料ID', - `rack_id` bigint(20) NULL DEFAULT NULL COMMENT '货架id', - `quantity` decimal(20, 2) NULL DEFAULT NULL COMMENT '库存', - `remark` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '备注', - `del_flag` tinyint(4) NOT NULL DEFAULT 0 COMMENT '删除标识', - `create_by` bigint(20) NULL DEFAULT NULL COMMENT '创建人', - `create_time` datetime(3) NULL DEFAULT NULL COMMENT '创建时间', - `update_by` bigint(20) NULL DEFAULT NULL COMMENT '修改人', - `update_time` datetime(3) NULL DEFAULT NULL COMMENT '修改时间', - `warehouse_id` bigint(20) NULL DEFAULT NULL COMMENT '所属仓库', - `area_id` bigint(20) NULL DEFAULT NULL COMMENT '所属库区', - PRIMARY KEY (`id`) USING BTREE -) ENGINE = InnoDB AUTO_INCREMENT = 373 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '库存' ROW_FORMAT = Dynamic; - --- ---------------------------- --- Records of wms_inventory --- ---------------------------- -INSERT INTO `wms_inventory` VALUES (1, 1, 1, 19.00, '1', 0, NULL, NULL, 1, '2022-10-10 23:15:28.499', 1, 1); -INSERT INTO `wms_inventory` VALUES (2, 2, NULL, 3.00, NULL, 1, NULL, NULL, NULL, NULL, NULL, NULL); -INSERT INTO `wms_inventory` VALUES (3, 2, NULL, 1.00, NULL, 1, NULL, NULL, NULL, NULL, NULL, NULL); -INSERT INTO `wms_inventory` VALUES (4, 1, 5, 50.00, NULL, 0, 1, '2022-10-10 23:05:13.969', NULL, NULL, 1, 13); -INSERT INTO `wms_inventory` VALUES (5, 2, 1, 25.00, NULL, 0, 1, '2022-10-10 23:05:13.969', 115, '2022-11-12 16:58:55.449', 1, 13); -INSERT INTO `wms_inventory` VALUES (7, 1, 1, 9.00, NULL, 0, 1, '2022-10-24 18:05:17.538', 115, '2022-11-08 17:14:51.745', 1, 13); -INSERT INTO `wms_inventory` VALUES (8, 2, 6, 26.00, NULL, 0, 1, '2022-11-02 17:25:32.344', 115, '2022-11-12 16:58:55.604', 2, 18); -INSERT INTO `wms_inventory` VALUES (9, 1, NULL, 2.00, NULL, 0, 1, '2022-11-02 17:25:32.344', NULL, NULL, 4, NULL); -INSERT INTO `wms_inventory` VALUES (14, 2, NULL, 3.00, NULL, 0, 1, '2022-11-03 17:40:30.566', 115, '2022-11-13 17:33:14.788', 2, 18); -INSERT INTO `wms_inventory` VALUES (15, 2, NULL, 2.00, NULL, 0, 1, '2022-11-03 17:43:44.004', 1, '2022-11-03 17:48:28.148', 3, 16); -INSERT INTO `wms_inventory` VALUES (16, 1, 7, 1.00, NULL, 0, 115, '2022-11-07 08:25:36.418', NULL, NULL, 3, 16); -INSERT INTO `wms_inventory` VALUES (17, 2, NULL, 8.00, NULL, 0, 115, '2022-11-07 21:46:30.673', NULL, NULL, 20, 41); -INSERT INTO `wms_inventory` VALUES (18, 1, 8, 5.00, NULL, 0, 115, '2022-11-07 21:46:30.673', NULL, NULL, 20, 42); -INSERT INTO `wms_inventory` VALUES (19, 1, NULL, 6.00, NULL, 0, 115, '2022-11-09 14:58:41.835', 115, '2022-11-09 14:59:20.883', 1, 13); -INSERT INTO `wms_inventory` VALUES (20, 1, NULL, 1.00, NULL, 0, 115, '2022-11-09 18:32:26.133', NULL, NULL, 3, 14); -INSERT INTO `wms_inventory` VALUES (21, 5, 6, 1.00, NULL, 0, 115, '2022-11-11 16:24:13.425', 115, '2022-11-13 17:33:14.788', 2, 18); -INSERT INTO `wms_inventory` VALUES (22, 7, 9, 591.00, NULL, 0, 115, '2022-11-11 17:19:21.005', 115, '2022-11-13 17:33:14.788', 21, 43); -INSERT INTO `wms_inventory` VALUES (23, 8, 11, 151.00, NULL, 0, 115, '2022-11-11 17:19:21.005', 115, '2022-11-13 17:33:14.788', 21, 44); -INSERT INTO `wms_inventory` VALUES (24, 8, NULL, 40.00, NULL, 0, 115, '2022-11-11 17:30:50.040', NULL, NULL, 22, NULL); -INSERT INTO `wms_inventory` VALUES (25, 3, NULL, 1.00, NULL, 0, 115, '2022-11-13 17:33:14.788', NULL, NULL, 3, 14); -INSERT INTO `wms_inventory` VALUES (26, 1, 17, 1.00, NULL, 0, 115, '2022-11-13 17:33:14.788', NULL, NULL, 25, 50); -INSERT INTO `wms_inventory` VALUES (27, 4, 1, 1.00, NULL, 0, 115, '2022-11-13 17:33:14.788', NULL, NULL, 2, 17); -INSERT INTO `wms_inventory` VALUES (28, 6, 1, 1.00, NULL, 0, 115, '2022-11-13 17:33:14.788', NULL, NULL, 2, 17); -INSERT INTO `wms_inventory` VALUES (29, 9, 12, 1.00, NULL, 0, 115, '2022-11-13 17:33:14.788', NULL, NULL, 22, 46); -INSERT INTO `wms_inventory` VALUES (30, 10, 14, 1.00, NULL, 0, 115, '2022-11-13 17:33:14.788', NULL, NULL, 23, 47); -INSERT INTO `wms_inventory` VALUES (31, 12, 17, 1.00, NULL, 0, 115, '2022-11-13 17:41:54.669', NULL, NULL, 25, 50); -INSERT INTO `wms_inventory` VALUES (32, 13, 4, 2.00, NULL, 0, 115, '2022-11-13 17:44:49.159', 115, '2022-12-05 14:08:46.134', 4, 14); -INSERT INTO `wms_inventory` VALUES (33, 12, NULL, 1.00, NULL, 0, 115, '2022-11-15 16:42:56.213', NULL, NULL, 2, 44); -INSERT INTO `wms_inventory` VALUES (34, 13, NULL, 1.00, NULL, 0, 115, '2022-11-15 16:42:56.213', NULL, NULL, 2, 44); -INSERT INTO `wms_inventory` VALUES (35, 14, NULL, 0.00, NULL, 0, 115, '2022-11-15 16:42:56.213', 115, '2022-11-15 16:48:25.656', 2, 44); -INSERT INTO `wms_inventory` VALUES (36, 17, 13, 1.00, NULL, 0, 115, '2022-11-17 16:21:05.926', NULL, NULL, 2, 44); -INSERT INTO `wms_inventory` VALUES (37, 13, NULL, 1.00, NULL, 0, 115, '2022-11-18 09:11:32.704', NULL, NULL, 14, NULL); -INSERT INTO `wms_inventory` VALUES (38, 14, 13, 2.00, NULL, 0, 115, '2022-11-18 09:11:32.704', 115, '2022-11-23 13:50:47.958', 2, 44); -INSERT INTO `wms_inventory` VALUES (39, 12, NULL, 1.00, NULL, 0, 115, '2022-11-18 09:11:43.818', NULL, NULL, 4, NULL); -INSERT INTO `wms_inventory` VALUES (40, 13, 13, 2.00, NULL, 0, 115, '2022-11-18 10:56:31.989', 115, '2022-11-23 13:51:53.331', 2, 44); -INSERT INTO `wms_inventory` VALUES (41, 12, 13, 6.00, NULL, 0, 115, '2022-11-18 11:02:07.120', 115, '2022-11-20 14:33:49.484', 2, 44); -INSERT INTO `wms_inventory` VALUES (42, 20, 13, 20.00, NULL, 0, 115, '2022-11-20 08:53:41.836', 115, '2022-11-20 08:54:13.793', 2, 44); -INSERT INTO `wms_inventory` VALUES (43, 20, 19, 30.00, NULL, 0, 115, '2022-11-20 08:53:56.037', 115, '2022-11-20 08:54:07.301', 14, 46); -INSERT INTO `wms_inventory` VALUES (44, 20, NULL, 4.00, NULL, 0, 115, '2022-11-20 09:26:06.100', 115, '2022-11-20 15:01:21.749', 4, NULL); -INSERT INTO `wms_inventory` VALUES (45, 21, 20, 2000.00, NULL, 0, 115, '2022-11-20 15:11:18.656', NULL, NULL, 27, 52); -INSERT INTO `wms_inventory` VALUES (46, 14, NULL, 10.00, NULL, 0, 115, '2022-11-23 08:24:32.968', 115, '2022-11-23 08:29:54.374', 4, NULL); -INSERT INTO `wms_inventory` VALUES (47, 15, NULL, 8.00, NULL, 0, 115, '2022-11-23 08:29:54.374', NULL, NULL, NULL, NULL); -INSERT INTO `wms_inventory` VALUES (48, 16, NULL, 1.00, NULL, 0, 115, '2022-11-23 08:31:43.578', NULL, NULL, NULL, NULL); -INSERT INTO `wms_inventory` VALUES (49, 20, NULL, 1.00, NULL, 0, 115, '2022-11-23 08:32:46.369', NULL, NULL, NULL, NULL); -INSERT INTO `wms_inventory` VALUES (50, 21, NULL, 1.00, NULL, 0, 115, '2022-11-23 15:28:22.096', NULL, NULL, 14, 53); -INSERT INTO `wms_inventory` VALUES (51, 18, 13, 1.00, NULL, 0, 115, '2022-11-23 15:28:22.096', NULL, NULL, 2, 44); -INSERT INTO `wms_inventory` VALUES (52, 22, 20, 1.00, NULL, 0, 115, '2022-11-23 15:28:22.096', NULL, NULL, 27, 52); -INSERT INTO `wms_inventory` VALUES (53, 20, NULL, 1.00, NULL, 0, 115, '2022-11-25 10:39:13.638', NULL, NULL, NULL, NULL); -INSERT INTO `wms_inventory` VALUES (54, 14, 18, 2.00, NULL, 0, 115, '2022-11-25 10:39:13.638', 115, '2022-12-02 14:34:53.417', 26, 51); -INSERT INTO `wms_inventory` VALUES (55, 13, 13, 1.00, NULL, 0, 115, '2022-11-28 21:19:12.583', NULL, NULL, 2, 45); -INSERT INTO `wms_inventory` VALUES (56, 28, 13, 5.00, NULL, 0, 115, '2022-11-30 14:25:42.820', NULL, NULL, 2, 45); -INSERT INTO `wms_inventory` VALUES (57, 13, NULL, 134.00, NULL, 0, 115, '2022-12-01 09:56:47.430', 115, '2022-12-05 14:06:20.903', 4, 54); -INSERT INTO `wms_inventory` VALUES (58, 27, 14, 19.00, NULL, 0, 1, '2022-12-01 11:05:02.490', 1, '2022-12-01 11:16:14.334', 14, 46); -INSERT INTO `wms_inventory` VALUES (59, 28, NULL, 98.00, NULL, 0, 1, '2022-12-01 11:05:38.603', 1, '2022-12-01 11:23:05.974', 4, 54); -INSERT INTO `wms_inventory` VALUES (60, 13, NULL, 1.00, NULL, 0, 1, '2022-12-01 11:08:39.626', NULL, NULL, 14, 46); -INSERT INTO `wms_inventory` VALUES (61, 17, 14, 1.00, NULL, 0, 1, '2022-12-01 11:08:39.626', NULL, NULL, 14, 46); -INSERT INTO `wms_inventory` VALUES (62, 28, NULL, 1.00, NULL, 0, 1, '2022-12-01 11:23:06.136', NULL, NULL, 14, 53); -INSERT INTO `wms_inventory` VALUES (63, 17, NULL, 1.00, NULL, 0, 115, '2022-12-02 14:34:45.559', NULL, NULL, NULL, NULL); -INSERT INTO `wms_inventory` VALUES (64, 19, 13, 1.00, NULL, 0, 115, '2022-12-03 08:46:58.315', NULL, NULL, 2, 44); -INSERT INTO `wms_inventory` VALUES (65, 25, 20, 2.00, NULL, 0, 115, '2022-12-05 14:06:42.893', NULL, NULL, 27, 52); -INSERT INTO `wms_inventory` VALUES (66, 29, 24, 44.00, NULL, 0, 115, '2022-12-06 00:00:54.199', 115, '2022-12-08 15:14:08.529', 30, 56); -INSERT INTO `wms_inventory` VALUES (67, 29, 25, 5.00, NULL, 0, 115, '2022-12-07 09:16:38.204', 115, '2022-12-07 09:18:25.583', 31, 57); -INSERT INTO `wms_inventory` VALUES (68, 29, NULL, -1.00, NULL, 0, 115, '2022-12-09 19:41:34.349', NULL, NULL, 30, NULL); -INSERT INTO `wms_inventory` VALUES (69, 29, 24, 1.00, NULL, 0, 115, '2022-12-09 19:41:34.371', NULL, NULL, 31, 56); -INSERT INTO `wms_inventory` VALUES (70, 55, NULL, 99.00, NULL, 0, 115, '2022-12-10 15:31:02.883', 115, '2022-12-12 13:19:41.583', 39, NULL); -INSERT INTO `wms_inventory` VALUES (71, 53, NULL, 100.00, NULL, 0, 115, '2022-12-10 15:31:02.883', NULL, NULL, 39, NULL); -INSERT INTO `wms_inventory` VALUES (72, 55, NULL, 0.00, NULL, 0, 115, '2022-12-10 17:01:54.532', 115, '2022-12-10 17:04:23.470', 38, NULL); -INSERT INTO `wms_inventory` VALUES (73, 55, NULL, 1.00, NULL, 0, 115, '2022-12-12 13:16:36.867', NULL, NULL, 39, 60); -INSERT INTO `wms_inventory` VALUES (74, 60, NULL, 13.00, NULL, 0, 115, '2022-12-20 17:27:22.290', 115, '2022-12-22 09:43:54.747', 42, NULL); -INSERT INTO `wms_inventory` VALUES (75, 60, NULL, 12.00, NULL, 0, 115, '2022-12-20 17:40:03.707', 115, '2022-12-20 17:40:38.931', 40, NULL); -INSERT INTO `wms_inventory` VALUES (76, 60, NULL, 10.00, NULL, 0, 115, '2022-12-20 17:42:29.385', 115, '2022-12-20 17:42:42.488', 38, 61); -INSERT INTO `wms_inventory` VALUES (77, 58, NULL, 8.00, NULL, 0, 115, '2022-12-20 17:42:29.385', NULL, NULL, 43, 62); -INSERT INTO `wms_inventory` VALUES (78, 58, 28, 1.00, NULL, 0, 115, '2022-12-20 17:45:45.221', NULL, NULL, 38, 61); -INSERT INTO `wms_inventory` VALUES (79, 60, 29, 1.00, NULL, 0, 115, '2022-12-21 16:11:48.918', 115, '2022-12-28 11:39:15.139', 38, 61); -INSERT INTO `wms_inventory` VALUES (80, 60, NULL, 1.00, NULL, 0, 115, '2022-12-22 12:35:50.450', NULL, NULL, 38, NULL); -INSERT INTO `wms_inventory` VALUES (81, 60, NULL, 1002.00, NULL, 0, 115, '2022-12-27 15:33:46.653', 115, '2023-01-03 12:09:21.717', 45, 65); -INSERT INTO `wms_inventory` VALUES (82, 61, 29, 1.00, NULL, 0, 115, '2022-12-28 11:39:15.139', 115, '2022-12-30 13:47:44.764', 38, 61); -INSERT INTO `wms_inventory` VALUES (83, 58, NULL, -1.00, NULL, 0, 115, '2022-12-28 13:42:51.766', NULL, NULL, 38, 61); -INSERT INTO `wms_inventory` VALUES (84, 58, NULL, 1.00, NULL, 0, 115, '2022-12-28 13:42:51.782', NULL, NULL, 42, 63); -INSERT INTO `wms_inventory` VALUES (85, 60, 30, 1.00, NULL, 0, 115, '2022-12-28 16:41:46.909', NULL, NULL, 43, 62); -INSERT INTO `wms_inventory` VALUES (86, 61, NULL, 14.00, NULL, 0, 115, '2022-12-28 17:11:04.420', 115, '2022-12-28 19:27:56.303', 42, 63); -INSERT INTO `wms_inventory` VALUES (87, 58, NULL, 11.00, NULL, 0, 115, '2022-12-28 17:11:04.420', NULL, NULL, 45, 65); -INSERT INTO `wms_inventory` VALUES (88, 61, NULL, -1.00, NULL, 0, 115, '2023-01-03 10:38:07.710', NULL, NULL, 38, 61); -INSERT INTO `wms_inventory` VALUES (89, 63, 31, 3.00, NULL, 0, 115, '2023-01-05 10:09:08.257', 115, '2023-01-05 16:08:25.963', 50, 67); -INSERT INTO `wms_inventory` VALUES (90, 65, NULL, 0.00, NULL, 0, 115, '2023-01-05 18:30:12.570', 115, '2023-01-06 14:19:56.094', 50, 69); -INSERT INTO `wms_inventory` VALUES (91, 63, 31, 2.00, NULL, 0, 115, '2023-01-06 08:02:26.984', 115, '2023-01-06 14:18:47.063', 50, 70); -INSERT INTO `wms_inventory` VALUES (92, 62, 31, 1.00, NULL, 0, 115, '2023-01-06 08:02:26.984', NULL, NULL, 50, 70); -INSERT INTO `wms_inventory` VALUES (93, 68, 34, 2.00, NULL, 0, 115, '2023-01-06 16:58:27.096', 115, '2023-01-07 14:14:37.234', 53, 73); -INSERT INTO `wms_inventory` VALUES (94, 67, 34, 1.00, NULL, 0, 115, '2023-01-06 16:58:27.096', NULL, NULL, 53, 73); -INSERT INTO `wms_inventory` VALUES (95, 67, NULL, 1.00, NULL, 0, 115, '2023-01-07 14:14:48.192', NULL, NULL, 54, NULL); -INSERT INTO `wms_inventory` VALUES (96, 75, 38, 202.00, NULL, 0, 115, '2023-01-08 00:19:53.237', 115, '2023-01-11 16:49:13.016', 61, 77); -INSERT INTO `wms_inventory` VALUES (97, 76, 43, 10100.00, NULL, 0, 115, '2023-01-09 00:17:19.189', 115, '2023-01-09 00:18:51.723', 61, 80); -INSERT INTO `wms_inventory` VALUES (98, 74, 38, 201.00, NULL, 0, 115, '2023-01-09 00:17:19.189', 115, '2023-01-11 16:49:13.016', 61, 77); -INSERT INTO `wms_inventory` VALUES (99, 73, 37, 10101.00, NULL, 0, 115, '2023-01-09 00:17:19.189', 115, '2023-01-11 16:49:13.016', 61, 77); -INSERT INTO `wms_inventory` VALUES (100, 72, 37, 100101.00, NULL, 0, 115, '2023-01-09 00:17:19.189', 115, '2023-01-11 16:49:13.016', 61, 77); -INSERT INTO `wms_inventory` VALUES (101, 71, 37, 1102.00, NULL, 0, 115, '2023-01-09 00:17:19.189', 115, '2023-01-11 20:49:04.489', 61, 77); -INSERT INTO `wms_inventory` VALUES (102, 74, 37, 10.00, NULL, 0, 115, '2023-01-09 02:17:11.315', NULL, NULL, 61, 77); -INSERT INTO `wms_inventory` VALUES (103, 71, 38, 1000.00, NULL, 0, 115, '2023-01-09 02:17:11.315', NULL, NULL, 61, 77); -INSERT INTO `wms_inventory` VALUES (104, 77, 47, 1.00, NULL, 0, 115, '2023-01-11 20:49:04.489', NULL, NULL, 64, 82); -INSERT INTO `wms_inventory` VALUES (105, 74, 47, 1.00, NULL, 0, 115, '2023-01-11 20:49:04.489', NULL, NULL, 64, 82); -INSERT INTO `wms_inventory` VALUES (106, 78, 49, 1.00, NULL, 0, 115, '2023-01-13 14:59:32.697', NULL, NULL, 67, 84); -INSERT INTO `wms_inventory` VALUES (107, 78, NULL, 19.00, NULL, 0, 115, '2023-01-13 19:26:39.264', 115, '2023-01-21 12:20:07.322', 69, NULL); -INSERT INTO `wms_inventory` VALUES (108, 80, NULL, 2.00, NULL, 0, 115, '2023-01-16 11:15:08.487', 115, '2023-01-21 12:20:07.322', 65, 86); -INSERT INTO `wms_inventory` VALUES (109, 80, 51, 127.00, NULL, 0, 115, '2023-01-16 11:17:07.421', 115, '2023-01-18 15:19:43.576', 65, 86); -INSERT INTO `wms_inventory` VALUES (110, 79, 50, 11.00, NULL, 0, 115, '2023-01-18 15:19:43.576', 115, '2023-01-23 20:23:34.171', 65, 86); -INSERT INTO `wms_inventory` VALUES (111, 80, 49, 1.00, NULL, 0, 115, '2023-01-23 16:33:55.410', NULL, NULL, 68, 85); -INSERT INTO `wms_inventory` VALUES (112, 80, NULL, 1.00, NULL, 0, 115, '2023-01-25 15:12:03.877', NULL, NULL, 66, 87); -INSERT INTO `wms_inventory` VALUES (113, 80, NULL, 2.00, NULL, 0, 115, '2023-01-25 17:24:35.635', NULL, NULL, 67, 84); -INSERT INTO `wms_inventory` VALUES (114, 87, NULL, 1.00, NULL, 0, 115, '2023-01-28 12:40:38.293', NULL, NULL, 66, 87); -INSERT INTO `wms_inventory` VALUES (115, 88, 50, 1.00, NULL, 0, 115, '2023-01-31 11:53:58.503', NULL, NULL, 66, 86); -INSERT INTO `wms_inventory` VALUES (116, 88, NULL, -1.00, NULL, 0, 115, '2023-01-31 11:57:19.259', NULL, NULL, 66, 86); -INSERT INTO `wms_inventory` VALUES (117, 88, NULL, 1.00, NULL, 0, 115, '2023-01-31 11:57:19.272', NULL, NULL, 67, NULL); -INSERT INTO `wms_inventory` VALUES (118, 88, 49, 1.00, NULL, 0, 115, '2023-01-31 14:09:17.803', NULL, NULL, 74, 84); -INSERT INTO `wms_inventory` VALUES (119, 88, NULL, 2.00, NULL, 0, 115, '2023-01-31 16:23:22.423', 115, '2023-01-31 16:38:29.464', 74, NULL); -INSERT INTO `wms_inventory` VALUES (120, 88, 49, 0.00, NULL, 0, 115, '2023-01-31 16:37:03.769', 115, '2023-01-31 16:39:58.324', 68, 85); -INSERT INTO `wms_inventory` VALUES (121, 89, 50, 490.00, NULL, 0, 115, '2023-02-01 22:08:22.038', 115, '2023-02-01 22:09:50.850', 76, 89); -INSERT INTO `wms_inventory` VALUES (122, 90, 49, 1.00, NULL, 0, 115, '2023-02-02 15:07:16.278', 115, '2023-02-04 20:50:32.322', 75, 90); -INSERT INTO `wms_inventory` VALUES (123, 90, NULL, -1.00, NULL, 0, 115, '2023-02-02 15:08:54.702', NULL, NULL, 75, 90); -INSERT INTO `wms_inventory` VALUES (124, 89, NULL, 0.00, NULL, 0, 115, '2023-02-02 15:11:59.389', 115, '2023-02-02 15:12:45.118', 75, NULL); -INSERT INTO `wms_inventory` VALUES (125, 91, 50, 4.00, NULL, 0, 115, '2023-02-02 22:07:16.216', 115, '2023-02-04 20:50:32.322', 76, 89); -INSERT INTO `wms_inventory` VALUES (126, 91, 49, 2.00, NULL, 0, 115, '2023-02-04 00:31:27.945', 115, '2023-02-06 14:13:47.132', 75, 90); -INSERT INTO `wms_inventory` VALUES (127, 91, NULL, 1.00, NULL, 0, 115, '2023-02-04 03:00:15.403', NULL, NULL, 75, 90); -INSERT INTO `wms_inventory` VALUES (128, 90, 52, 1.00, NULL, 0, 115, '2023-02-04 08:54:14.673', NULL, NULL, 78, 92); -INSERT INTO `wms_inventory` VALUES (129, 91, 52, 1.00, NULL, 0, 115, '2023-02-04 16:09:45.169', NULL, NULL, 78, 92); -INSERT INTO `wms_inventory` VALUES (130, 92, 52, 5.00, NULL, 0, 115, '2023-02-04 16:11:45.689', 115, '2023-02-04 16:38:06.194', 78, 92); -INSERT INTO `wms_inventory` VALUES (131, 93, 52, 5.00, NULL, 0, 115, '2023-02-04 16:36:29.671', 115, '2023-02-04 20:50:32.322', 78, 92); -INSERT INTO `wms_inventory` VALUES (132, 90, 51, 1.00, NULL, 0, 115, '2023-02-04 18:00:58.935', NULL, NULL, 77, 91); -INSERT INTO `wms_inventory` VALUES (133, 91, 51, 4.00, NULL, 0, 115, '2023-02-04 20:29:37.614', 115, '2023-02-06 13:54:18.212', 77, 91); -INSERT INTO `wms_inventory` VALUES (134, 94, 49, 0.00, NULL, 0, 115, '2023-02-06 11:51:05.721', 115, '2023-02-06 11:51:14.586', 75, 90); -INSERT INTO `wms_inventory` VALUES (135, 93, 50, 1.00, NULL, 0, 115, '2023-02-06 13:54:18.212', NULL, NULL, 76, 89); -INSERT INTO `wms_inventory` VALUES (136, 94, 53, 0.00, NULL, 0, 115, '2023-02-06 14:13:36.580', 115, '2023-02-06 15:15:14.142', 83, 94); -INSERT INTO `wms_inventory` VALUES (137, 93, 53, 0.00, NULL, 0, 115, '2023-02-06 14:13:36.580', 115, '2023-02-06 15:15:14.142', 83, 94); -INSERT INTO `wms_inventory` VALUES (138, 92, 53, 1.00, NULL, 0, 115, '2023-02-06 15:13:22.523', NULL, NULL, 83, 94); -INSERT INTO `wms_inventory` VALUES (139, 95, NULL, 0.00, NULL, 0, 115, '2023-02-06 15:21:15.363', 115, '2023-02-07 18:50:16.075', 84, NULL); -INSERT INTO `wms_inventory` VALUES (140, 94, NULL, 2.00, NULL, 0, 115, '2023-02-07 09:21:35.190', 115, '2023-02-08 09:36:43.833', 85, 95); -INSERT INTO `wms_inventory` VALUES (141, 96, 56, 1.00, NULL, 0, 115, '2023-02-08 09:16:11.419', NULL, NULL, 86, 98); -INSERT INTO `wms_inventory` VALUES (142, 97, 55, 1.00, NULL, 0, 115, '2023-02-08 09:16:11.419', NULL, NULL, 86, 98); -INSERT INTO `wms_inventory` VALUES (143, 94, 55, 1.00, NULL, 0, 115, '2023-02-08 09:35:44.281', NULL, NULL, 86, 98); -INSERT INTO `wms_inventory` VALUES (144, 97, 49, 2.00, NULL, 0, 115, '2023-02-08 10:40:33.292', NULL, NULL, 84, 96); -INSERT INTO `wms_inventory` VALUES (145, 97, NULL, 1.00, NULL, 0, 115, '2023-02-08 11:38:59.147', NULL, NULL, 85, 95); -INSERT INTO `wms_inventory` VALUES (146, 96, 55, 1.00, NULL, 0, 115, '2023-02-08 11:38:59.147', NULL, NULL, 86, 98); -INSERT INTO `wms_inventory` VALUES (147, 99, 57, 99.00, NULL, 0, 115, '2023-02-08 16:40:11.375', 115, '2023-02-08 16:43:52.724', 87, 100); -INSERT INTO `wms_inventory` VALUES (148, 99, 55, 1.00, NULL, 0, 115, '2023-02-08 16:43:52.739', NULL, NULL, 86, 98); -INSERT INTO `wms_inventory` VALUES (149, 99, 53, 0.00, NULL, 0, 115, '2023-02-09 14:27:51.818', 115, '2023-02-09 14:49:06.379', 83, 94); -INSERT INTO `wms_inventory` VALUES (150, 99, NULL, 1.00, NULL, 0, 115, '2023-02-09 14:49:06.392', NULL, NULL, 84, NULL); -INSERT INTO `wms_inventory` VALUES (151, 100, 49, 2.00, NULL, 0, 115, '2023-02-10 15:50:01.969', 115, '2023-02-12 11:11:02.998', 84, 96); -INSERT INTO `wms_inventory` VALUES (152, 101, NULL, 0.00, NULL, 0, 115, '2023-02-10 15:56:53.563', 115, '2023-02-10 15:57:49.152', 89, 103); -INSERT INTO `wms_inventory` VALUES (153, 94, NULL, 2.00, NULL, 0, 115, '2023-02-11 11:10:58.900', NULL, NULL, 86, 99); -INSERT INTO `wms_inventory` VALUES (154, 93, 49, 2.00, NULL, 0, 115, '2023-02-11 11:10:58.900', NULL, NULL, 84, 96); -INSERT INTO `wms_inventory` VALUES (155, 99, NULL, 150.00, NULL, 0, 115, '2023-02-11 19:02:04.522', NULL, NULL, 91, 108); -INSERT INTO `wms_inventory` VALUES (156, 101, 61, 15.00, NULL, 0, 115, '2023-02-11 19:04:58.599', 115, '2023-02-12 11:12:08.970', 91, 105); -INSERT INTO `wms_inventory` VALUES (157, 99, 61, 5.00, NULL, 0, 115, '2023-02-11 19:04:58.599', 115, '2023-02-12 11:12:08.970', 91, 105); -INSERT INTO `wms_inventory` VALUES (158, 99, NULL, 10.00, NULL, 0, 115, '2023-02-11 20:17:33.114', NULL, NULL, 91, 106); -INSERT INTO `wms_inventory` VALUES (159, 103, NULL, 1.00, NULL, 0, 115, '2023-02-13 11:35:41.681', NULL, NULL, 86, 99); -INSERT INTO `wms_inventory` VALUES (160, 102, 57, 1.00, NULL, 0, 115, '2023-02-13 11:36:15.370', NULL, NULL, 87, 100); -INSERT INTO `wms_inventory` VALUES (161, 103, 55, 2.00, NULL, 0, 115, '2023-02-13 11:38:39.754', 115, '2023-02-15 12:10:33.985', 86, 98); -INSERT INTO `wms_inventory` VALUES (162, 102, 56, 1.00, NULL, 0, 115, '2023-02-13 11:38:39.754', NULL, NULL, 86, 98); -INSERT INTO `wms_inventory` VALUES (163, 103, 57, 5.00, NULL, 0, 115, '2023-02-13 11:40:48.868', NULL, NULL, 87, 100); -INSERT INTO `wms_inventory` VALUES (164, 102, 61, 9.00, NULL, 0, 115, '2023-02-13 11:40:48.868', NULL, NULL, 91, 105); -INSERT INTO `wms_inventory` VALUES (165, 104, NULL, 1003.00, NULL, 0, 115, '2023-02-14 09:32:14.458', 115, '2023-02-14 17:24:04.141', 88, NULL); -INSERT INTO `wms_inventory` VALUES (166, 105, NULL, 4.00, NULL, 0, 115, '2023-02-15 11:30:11.909', NULL, NULL, 93, NULL); -INSERT INTO `wms_inventory` VALUES (167, 107, 64, 8888.00, NULL, 0, 115, '2023-02-15 15:09:57.330', NULL, NULL, 95, 111); -INSERT INTO `wms_inventory` VALUES (168, 108, 65, 15.00, NULL, 0, 115, '2023-02-16 15:19:19.833', NULL, NULL, 98, 112); -INSERT INTO `wms_inventory` VALUES (169, 110, 66, 16.00, NULL, 0, 115, '2023-02-17 10:56:03.265', 115, '2023-02-22 20:05:14.153', 101, 115); -INSERT INTO `wms_inventory` VALUES (170, 111, 67, 9.00, NULL, 0, 115, '2023-02-17 13:21:49.743', 115, '2023-02-17 13:22:13.036', 102, 116); -INSERT INTO `wms_inventory` VALUES (171, 113, 67, 2.00, NULL, 0, 115, '2023-02-17 15:52:07.266', 115, '2023-02-24 15:24:09.538', 102, 116); -INSERT INTO `wms_inventory` VALUES (172, 112, 67, 1.00, NULL, 0, 115, '2023-02-17 15:52:30.923', NULL, NULL, 102, 116); -INSERT INTO `wms_inventory` VALUES (173, 115, 67, 1.00, NULL, 0, 115, '2023-02-18 00:32:00.462', NULL, NULL, 101, 115); -INSERT INTO `wms_inventory` VALUES (174, 114, 67, 1.00, NULL, 0, 115, '2023-02-18 00:32:00.462', NULL, NULL, 101, 115); -INSERT INTO `wms_inventory` VALUES (175, 111, 67, 1.00, NULL, 0, 115, '2023-02-19 23:33:13.569', NULL, NULL, 104, 117); -INSERT INTO `wms_inventory` VALUES (176, 114, 67, 2.00, NULL, 0, 115, '2023-02-20 10:41:13.526', 115, '2023-02-24 15:24:09.538', 102, 116); -INSERT INTO `wms_inventory` VALUES (177, 115, NULL, 11.00, NULL, 0, 115, '2023-02-21 10:32:34.983', 115, '2023-02-21 10:41:20.284', 105, NULL); -INSERT INTO `wms_inventory` VALUES (178, 117, 68, 897.00, NULL, 0, 115, '2023-02-21 14:19:02.943', 115, '2023-02-24 15:24:09.538', 106, 118); -INSERT INTO `wms_inventory` VALUES (179, 117, NULL, 1.00, NULL, 0, 115, '2023-02-21 14:21:05.790', NULL, NULL, 105, NULL); -INSERT INTO `wms_inventory` VALUES (180, 117, NULL, -1.00, NULL, 0, 115, '2023-02-22 14:00:20.327', NULL, NULL, 106, NULL); -INSERT INTO `wms_inventory` VALUES (181, 112, 66, 1.00, NULL, 0, 115, '2023-02-22 20:05:14.153', 115, '2023-02-24 16:38:24.378', 101, 115); -INSERT INTO `wms_inventory` VALUES (182, 114, NULL, 1.00, NULL, 0, 115, '2023-02-23 22:16:22.929', NULL, NULL, 107, NULL); -INSERT INTO `wms_inventory` VALUES (183, 112, NULL, 1.00, NULL, 0, 115, '2023-02-23 22:16:22.929', NULL, NULL, 107, NULL); -INSERT INTO `wms_inventory` VALUES (184, 115, 67, 1.00, NULL, 0, 115, '2023-02-24 15:24:09.538', NULL, NULL, 104, 117); -INSERT INTO `wms_inventory` VALUES (185, 117, 71, 1.00, NULL, 0, 115, '2023-02-24 15:28:30.433', 115, '2023-02-24 16:38:24.378', 109, 120); -INSERT INTO `wms_inventory` VALUES (186, 117, NULL, 2.00, NULL, 0, 115, '2023-02-25 00:41:10.269', NULL, NULL, 111, 121); -INSERT INTO `wms_inventory` VALUES (187, 112, NULL, 1.00, NULL, 0, 115, '2023-02-25 00:41:10.269', NULL, NULL, 111, 121); -INSERT INTO `wms_inventory` VALUES (188, 119, NULL, 9.00, NULL, 0, 115, '2023-02-26 15:13:26.028', 115, '2023-02-27 12:33:01.014', 111, NULL); -INSERT INTO `wms_inventory` VALUES (189, 118, NULL, 8.00, NULL, 0, 115, '2023-02-26 15:17:09.372', 115, '2023-02-27 12:33:01.014', 111, NULL); -INSERT INTO `wms_inventory` VALUES (190, 121, NULL, 6.00, NULL, 0, 115, '2023-02-27 10:20:16.149', 115, '2023-02-28 11:08:42.073', 111, NULL); -INSERT INTO `wms_inventory` VALUES (191, 122, NULL, 0.00, NULL, 0, 115, '2023-02-27 10:36:12.838', 115, '2023-02-27 10:36:27.673', 115, 125); -INSERT INTO `wms_inventory` VALUES (192, 120, NULL, 4.00, NULL, 0, 115, '2023-02-27 12:33:01.014', 115, '2023-02-27 12:34:17.346', 111, NULL); -INSERT INTO `wms_inventory` VALUES (193, 121, NULL, 1.00, NULL, 0, 115, '2023-02-27 22:45:36.778', NULL, NULL, 114, NULL); -INSERT INTO `wms_inventory` VALUES (194, 120, NULL, 1.00, NULL, 0, 115, '2023-02-27 22:45:36.778', NULL, NULL, 114, NULL); -INSERT INTO `wms_inventory` VALUES (195, 119, NULL, 1.00, NULL, 0, 115, '2023-02-27 22:45:36.778', NULL, NULL, 114, NULL); -INSERT INTO `wms_inventory` VALUES (196, 118, NULL, 1.00, NULL, 0, 115, '2023-02-27 22:45:36.778', NULL, NULL, 114, NULL); -INSERT INTO `wms_inventory` VALUES (197, 121, NULL, 3.00, NULL, 0, 115, '2023-02-28 00:16:22.646', 115, '2023-02-28 11:07:08.792', 113, NULL); -INSERT INTO `wms_inventory` VALUES (198, 121, 74, 322424.00, NULL, 0, 115, '2023-03-01 03:09:32.715', NULL, NULL, 116, 126); -INSERT INTO `wms_inventory` VALUES (199, 120, 74, 234324224.00, NULL, 0, 115, '2023-03-01 03:09:32.715', NULL, NULL, 116, 126); -INSERT INTO `wms_inventory` VALUES (200, 121, NULL, 100.00, NULL, 0, 115, '2023-03-01 10:26:33.722', NULL, NULL, 116, NULL); -INSERT INTO `wms_inventory` VALUES (201, 123, 74, 2147484147.00, NULL, 0, 115, '2023-03-01 16:06:21.737', 115, '2023-03-01 17:29:30.106', 116, 126); -INSERT INTO `wms_inventory` VALUES (202, 125, 77, 600.00, NULL, 0, 115, '2023-03-01 18:04:56.697', 115, '2023-03-02 09:46:27.576', 118, 128); -INSERT INTO `wms_inventory` VALUES (203, 124, 76, 1.00, NULL, 0, 115, '2023-03-01 18:04:56.697', NULL, NULL, 119, 131); -INSERT INTO `wms_inventory` VALUES (204, 124, 79, 173.00, NULL, 0, 115, '2023-03-02 09:21:54.236', 115, '2023-03-02 09:26:39.313', 119, 131); -INSERT INTO `wms_inventory` VALUES (205, 125, 78, 100.00, NULL, 0, 115, '2023-03-02 09:36:22.806', 115, '2023-03-03 08:51:42.551', 118, 129); -INSERT INTO `wms_inventory` VALUES (206, 125, NULL, 1.00, NULL, 0, 115, '2023-03-03 08:30:31.419', NULL, NULL, 117, 127); -INSERT INTO `wms_inventory` VALUES (207, 124, 78, 1.00, NULL, 0, 115, '2023-03-03 08:30:31.419', NULL, NULL, 118, 129); -INSERT INTO `wms_inventory` VALUES (208, 125, NULL, 2.00, NULL, 0, 115, '2023-03-03 08:44:50.870', 115, '2023-03-03 08:45:43.804', 118, 129); -INSERT INTO `wms_inventory` VALUES (209, 125, NULL, -1.00, NULL, 0, 115, '2023-03-03 08:46:33.889', NULL, NULL, 118, NULL); -INSERT INTO `wms_inventory` VALUES (210, 125, NULL, -1.00, NULL, 0, 115, '2023-03-03 08:50:25.513', NULL, NULL, 117, NULL); -INSERT INTO `wms_inventory` VALUES (211, 125, NULL, 1.00, NULL, 0, 115, '2023-03-03 12:57:29.349', NULL, NULL, 116, NULL); -INSERT INTO `wms_inventory` VALUES (212, 128, 90, 2.00, NULL, 0, 115, '2023-03-03 21:42:50.036', NULL, NULL, 122, 135); -INSERT INTO `wms_inventory` VALUES (213, 127, 91, 12.00, NULL, 0, 115, '2023-03-03 21:42:50.036', NULL, NULL, 122, 135); -INSERT INTO `wms_inventory` VALUES (214, 127, 90, 291.00, NULL, 0, 115, '2023-03-03 22:00:24.609', 115, '2023-03-05 16:13:36.820', 122, 135); -INSERT INTO `wms_inventory` VALUES (215, 130, NULL, 9.00, NULL, 0, 115, '2023-03-03 22:37:09.320', 115, '2023-03-06 16:55:41.104', 117, 127); -INSERT INTO `wms_inventory` VALUES (216, 130, 89, 2.00, NULL, 0, 115, '2023-03-06 08:28:08.819', 115, '2023-03-07 14:17:46.380', 121, 134); -INSERT INTO `wms_inventory` VALUES (217, 129, 89, 2.00, NULL, 0, 115, '2023-03-06 08:28:08.819', 115, '2023-03-07 09:41:10.157', 121, 134); -INSERT INTO `wms_inventory` VALUES (218, 128, 91, 0.00, NULL, 0, 115, '2023-03-06 08:28:08.819', 115, '2023-03-10 15:24:24.792', 122, 135); -INSERT INTO `wms_inventory` VALUES (219, 130, 78, 10.00, NULL, 0, 115, '2023-03-06 16:53:49.700', 115, '2023-03-06 16:55:41.118', 118, 129); -INSERT INTO `wms_inventory` VALUES (220, 131, 92, 1.00, NULL, 0, 115, '2023-03-08 09:37:18.541', NULL, NULL, 117, 136); -INSERT INTO `wms_inventory` VALUES (221, 131, NULL, 200.00, NULL, 0, 115, '2023-03-08 09:39:15.806', NULL, NULL, 117, 127); -INSERT INTO `wms_inventory` VALUES (222, 133, 92, 16.00, NULL, 0, 115, '2023-03-09 13:02:37.798', 115, '2023-03-10 15:24:18.514', 117, 136); -INSERT INTO `wms_inventory` VALUES (223, 131, NULL, 1.00, NULL, 0, 115, '2023-03-09 15:10:54.188', NULL, NULL, 117, 136); -INSERT INTO `wms_inventory` VALUES (224, 132, NULL, 1.00, NULL, 0, 115, '2023-03-10 15:29:42.886', NULL, NULL, NULL, NULL); -INSERT INTO `wms_inventory` VALUES (225, 134, NULL, 1.00, NULL, 0, 115, '2023-03-12 13:39:25.770', NULL, NULL, 130, NULL); -INSERT INTO `wms_inventory` VALUES (226, 134, 94, 0.00, NULL, 0, 115, '2023-03-12 16:02:14.188', 115, '2023-03-12 16:10:28.545', 131, 142); -INSERT INTO `wms_inventory` VALUES (227, 134, NULL, 6.00, NULL, 0, 115, '2023-03-13 00:24:13.168', NULL, NULL, 132, NULL); -INSERT INTO `wms_inventory` VALUES (228, 135, NULL, 1.00, NULL, 0, 115, '2023-03-13 04:17:07.848', NULL, NULL, 133, NULL); -INSERT INTO `wms_inventory` VALUES (229, 136, NULL, 1.00, NULL, 0, 115, '2023-03-13 10:30:16.750', NULL, NULL, NULL, NULL); -INSERT INTO `wms_inventory` VALUES (230, 137, NULL, 50.00, NULL, 0, 115, '2023-03-13 10:32:39.616', NULL, NULL, NULL, NULL); -INSERT INTO `wms_inventory` VALUES (231, 136, NULL, 100.00, NULL, 0, 115, '2023-03-13 10:32:39.616', NULL, NULL, NULL, NULL); -INSERT INTO `wms_inventory` VALUES (232, 138, 96, 1.00, NULL, 0, 115, '2023-03-13 15:23:51.408', NULL, NULL, 134, 144); -INSERT INTO `wms_inventory` VALUES (233, 137, 96, 1.00, NULL, 0, 115, '2023-03-13 15:23:51.408', NULL, NULL, 134, 144); -INSERT INTO `wms_inventory` VALUES (234, 138, NULL, -1.00, NULL, 0, 115, '2023-03-13 15:25:21.387', NULL, NULL, 134, 144); -INSERT INTO `wms_inventory` VALUES (235, 137, NULL, 4.00, NULL, 0, 115, '2023-03-13 15:39:42.613', 115, '2023-03-22 15:29:18.441', 135, NULL); -INSERT INTO `wms_inventory` VALUES (236, 138, NULL, 3.00, NULL, 0, 115, '2023-03-13 15:52:23.875', 115, '2023-03-22 15:29:18.441', 135, NULL); -INSERT INTO `wms_inventory` VALUES (237, 139, NULL, 102.00, NULL, 0, 115, '2023-03-13 15:56:25.101', 115, '2023-03-14 13:49:07.851', 136, 145); -INSERT INTO `wms_inventory` VALUES (238, 140, NULL, 0.00, NULL, 0, 115, '2023-03-13 16:30:47.757', 115, '2023-03-13 16:33:18.100', 135, 147); -INSERT INTO `wms_inventory` VALUES (239, 136, 96, 1.00, NULL, 0, 115, '2023-03-14 09:53:57.700', NULL, NULL, 135, 147); -INSERT INTO `wms_inventory` VALUES (240, 140, 96, 3.00, NULL, 0, 115, '2023-03-14 13:49:07.851', 115, '2023-03-22 15:29:18.441', 135, 147); -INSERT INTO `wms_inventory` VALUES (241, 142, 97, 9852.00, NULL, 0, 115, '2023-03-14 16:17:08.572', 115, '2023-03-16 11:30:34.615', 135, 147); -INSERT INTO `wms_inventory` VALUES (242, 141, NULL, 0.00, NULL, 0, 115, '2023-03-15 18:46:37.832', 115, '2023-03-16 18:32:12.617', 137, NULL); -INSERT INTO `wms_inventory` VALUES (243, 142, NULL, 1.00, NULL, 0, 115, '2023-03-15 18:46:37.832', NULL, NULL, 137, 148); -INSERT INTO `wms_inventory` VALUES (244, 140, NULL, 1.00, NULL, 0, 115, '2023-03-15 21:50:15.570', NULL, NULL, 135, 149); -INSERT INTO `wms_inventory` VALUES (245, 142, NULL, 1.00, NULL, 0, 115, '2023-03-16 09:21:46.760', NULL, NULL, 138, NULL); -INSERT INTO `wms_inventory` VALUES (246, 139, NULL, 3.00, NULL, 0, 115, '2023-03-16 11:30:34.615', 115, '2023-03-22 15:29:18.441', 136, NULL); -INSERT INTO `wms_inventory` VALUES (247, 136, NULL, 1.00, NULL, 0, 115, '2023-03-16 11:30:34.615', NULL, NULL, NULL, NULL); -INSERT INTO `wms_inventory` VALUES (248, 141, 96, 2.00, NULL, 0, 115, '2023-03-16 11:30:34.615', 115, '2023-03-16 18:07:01.878', 135, 147); -INSERT INTO `wms_inventory` VALUES (249, 141, NULL, 1.00, NULL, 0, 115, '2023-03-16 18:32:12.633', NULL, NULL, 135, 149); -INSERT INTO `wms_inventory` VALUES (250, 142, NULL, 3.00, NULL, 0, 115, '2023-03-17 15:32:11.118', 115, '2023-03-22 15:29:18.441', 136, 145); -INSERT INTO `wms_inventory` VALUES (251, 142, 98, 1.00, NULL, 0, 115, '2023-03-17 18:06:04.191', NULL, NULL, 137, 148); -INSERT INTO `wms_inventory` VALUES (252, 141, 97, 1.00, NULL, 0, 115, '2023-03-17 18:06:04.191', NULL, NULL, 135, 147); -INSERT INTO `wms_inventory` VALUES (253, 142, NULL, 1.00, NULL, 0, 115, '2023-03-20 08:40:39.425', NULL, NULL, 137, NULL); -INSERT INTO `wms_inventory` VALUES (254, 141, NULL, 1.00, NULL, 0, 115, '2023-03-20 08:40:39.425', NULL, NULL, 138, NULL); -INSERT INTO `wms_inventory` VALUES (255, 142, NULL, 188.00, NULL, 0, 115, '2023-03-20 11:36:07.211', NULL, NULL, 139, NULL); -INSERT INTO `wms_inventory` VALUES (256, 141, NULL, 6000.00, NULL, 0, 115, '2023-03-20 11:36:07.211', NULL, NULL, 135, NULL); -INSERT INTO `wms_inventory` VALUES (257, 143, 97, 1.00, NULL, 0, 115, '2023-03-20 13:48:34.926', 115, '2023-03-20 14:08:46.476', 135, 147); -INSERT INTO `wms_inventory` VALUES (258, 142, NULL, 1.00, NULL, 0, 115, '2023-03-20 16:49:02.100', NULL, NULL, 135, 149); -INSERT INTO `wms_inventory` VALUES (259, 144, 98, 1.00, NULL, 0, 115, '2023-03-21 17:24:15.426', NULL, NULL, 137, 148); -INSERT INTO `wms_inventory` VALUES (260, 143, 96, 2.00, NULL, 0, 115, '2023-03-21 17:24:15.426', 115, '2023-03-22 15:29:18.441', 136, 145); -INSERT INTO `wms_inventory` VALUES (261, 144, NULL, 1.00, NULL, 0, 115, '2023-03-21 17:25:21.779', NULL, NULL, 139, NULL); -INSERT INTO `wms_inventory` VALUES (262, 145, 99, 4.00, NULL, 0, 115, '2023-03-21 19:33:36.157', 115, '2023-03-23 11:07:53.379', 149, 151); -INSERT INTO `wms_inventory` VALUES (263, 146, NULL, 1.00, NULL, 0, 115, '2023-03-22 00:18:02.107', NULL, NULL, 150, NULL); -INSERT INTO `wms_inventory` VALUES (264, 144, NULL, 1.00, NULL, 0, 115, '2023-03-22 09:44:10.142', NULL, NULL, NULL, NULL); -INSERT INTO `wms_inventory` VALUES (265, 146, NULL, 1.00, NULL, 0, 115, '2023-03-22 12:58:50.520', NULL, NULL, NULL, NULL); -INSERT INTO `wms_inventory` VALUES (266, 146, NULL, 1.00, NULL, 0, 115, '2023-03-22 15:29:18.441', NULL, NULL, 143, NULL); -INSERT INTO `wms_inventory` VALUES (267, 144, NULL, 1.00, NULL, 0, 115, '2023-03-22 15:29:18.441', NULL, NULL, NULL, NULL); -INSERT INTO `wms_inventory` VALUES (268, 141, 98, 1.00, NULL, 0, 115, '2023-03-22 15:29:18.441', NULL, NULL, 137, 148); -INSERT INTO `wms_inventory` VALUES (269, 146, NULL, 1.00, NULL, 0, 115, '2023-03-22 15:31:47.070', NULL, NULL, 136, NULL); -INSERT INTO `wms_inventory` VALUES (270, 145, NULL, 1.00, NULL, 0, 115, '2023-03-22 15:31:47.070', NULL, NULL, 136, NULL); -INSERT INTO `wms_inventory` VALUES (271, 147, 100, 122.00, NULL, 0, 115, '2023-03-22 15:56:16.813', 115, '2023-03-23 11:07:53.379', 154, 152); -INSERT INTO `wms_inventory` VALUES (272, 147, 101, 2.00, NULL, 0, 115, '2023-03-22 16:15:01.729', 115, '2023-03-23 13:39:37.480', 154, 152); -INSERT INTO `wms_inventory` VALUES (273, 148, 102, 0.00, NULL, 0, 115, '2023-03-22 22:51:19.722', 115, '2023-03-22 22:53:08.555', 155, 153); -INSERT INTO `wms_inventory` VALUES (274, 148, NULL, 1.00, NULL, 0, 115, '2023-03-23 09:46:58.327', NULL, NULL, NULL, NULL); -INSERT INTO `wms_inventory` VALUES (275, 148, NULL, 1.00, NULL, 0, 115, '2023-03-23 10:37:47.940', NULL, NULL, NULL, NULL); -INSERT INTO `wms_inventory` VALUES (276, 140, NULL, 1.00, NULL, 0, 115, '2023-03-23 10:40:39.851', NULL, NULL, 136, 145); -INSERT INTO `wms_inventory` VALUES (277, 148, NULL, 1.00, NULL, 0, 115, '2023-03-23 11:05:57.971', NULL, NULL, NULL, NULL); -INSERT INTO `wms_inventory` VALUES (278, 146, NULL, 1.00, NULL, 0, 115, '2023-03-23 11:05:57.971', NULL, NULL, NULL, NULL); -INSERT INTO `wms_inventory` VALUES (279, 144, NULL, 1.00, NULL, 0, 115, '2023-03-23 11:05:57.971', NULL, NULL, NULL, NULL); -INSERT INTO `wms_inventory` VALUES (280, 146, NULL, 1.00, NULL, 0, 115, '2023-03-23 11:07:53.379', NULL, NULL, NULL, NULL); -INSERT INTO `wms_inventory` VALUES (281, 148, 98, 2.00, NULL, 0, 115, '2023-03-23 11:07:53.379', 115, '2023-04-01 23:51:54.865', 137, 148); -INSERT INTO `wms_inventory` VALUES (282, 152, NULL, 1.00, NULL, 0, 115, '2023-03-24 14:24:55.539', NULL, NULL, 137, NULL); -INSERT INTO `wms_inventory` VALUES (283, 150, NULL, 10.00, NULL, 0, 115, '2023-03-24 15:50:14.267', NULL, NULL, 138, 150); -INSERT INTO `wms_inventory` VALUES (284, 146, NULL, 1.00, NULL, 0, 115, '2023-03-25 15:27:42.038', NULL, NULL, 164, NULL); -INSERT INTO `wms_inventory` VALUES (285, 156, NULL, 1.00, NULL, 0, 115, '2023-03-25 15:27:42.038', NULL, NULL, 165, 157); -INSERT INTO `wms_inventory` VALUES (286, 157, NULL, 1.00, NULL, 0, 115, '2023-03-26 19:52:24.467', NULL, NULL, 166, NULL); -INSERT INTO `wms_inventory` VALUES (287, 158, NULL, 100.00, NULL, 0, 115, '2023-03-27 11:17:46.282', NULL, NULL, NULL, NULL); -INSERT INTO `wms_inventory` VALUES (288, 158, NULL, 200.00, NULL, 0, 115, '2023-03-27 11:18:43.718', NULL, NULL, 143, NULL); -INSERT INTO `wms_inventory` VALUES (289, 159, NULL, 100.00, NULL, 0, 115, '2023-03-27 11:20:41.528', 115, '2023-03-27 11:22:04.530', 143, NULL); -INSERT INTO `wms_inventory` VALUES (290, 160, NULL, 1.00, NULL, 0, 115, '2023-03-29 13:59:56.940', NULL, NULL, 140, NULL); -INSERT INTO `wms_inventory` VALUES (291, 161, NULL, 1.00, NULL, 0, 115, '2023-03-29 13:59:56.940', NULL, NULL, 138, 150); -INSERT INTO `wms_inventory` VALUES (292, 156, 98, 1.00, NULL, 0, 115, '2023-03-29 14:36:11.984', NULL, NULL, 137, 148); -INSERT INTO `wms_inventory` VALUES (293, 161, NULL, 16.00, NULL, 0, 115, '2023-03-29 14:40:03.030', 115, '2023-03-29 15:04:23.597', 140, NULL); -INSERT INTO `wms_inventory` VALUES (294, 158, NULL, 5.00, NULL, 0, 115, '2023-03-29 15:13:42.511', NULL, NULL, NULL, NULL); -INSERT INTO `wms_inventory` VALUES (295, 160, NULL, 9.00, NULL, 0, 115, '2023-03-29 15:13:42.511', 115, '2023-03-29 15:21:50.786', 138, 150); -INSERT INTO `wms_inventory` VALUES (296, 158, NULL, 1.00, NULL, 0, 115, '2023-03-29 15:16:21.476', NULL, NULL, NULL, NULL); -INSERT INTO `wms_inventory` VALUES (297, 162, NULL, 149.00, NULL, 0, 115, '2023-03-30 18:29:22.343', 115, '2023-04-03 13:48:21.561', 138, 160); -INSERT INTO `wms_inventory` VALUES (298, 158, NULL, 1.00, NULL, 0, 115, '2023-03-31 14:31:38.872', NULL, NULL, 138, 150); -INSERT INTO `wms_inventory` VALUES (299, 152, NULL, 1.00, NULL, 0, 115, '2023-04-01 23:51:54.865', NULL, NULL, 138, 150); -INSERT INTO `wms_inventory` VALUES (300, 157, NULL, 1.00, NULL, 0, 115, '2023-04-03 09:21:08.866', NULL, NULL, 138, 150); -INSERT INTO `wms_inventory` VALUES (301, 162, 110, 2.00, NULL, 0, 115, '2023-04-03 13:17:38.341', 115, '2023-04-06 17:42:32.407', 138, 160); -INSERT INTO `wms_inventory` VALUES (302, 162, NULL, 1.00, NULL, 0, 115, '2023-04-03 13:40:59.690', NULL, NULL, 138, 150); -INSERT INTO `wms_inventory` VALUES (303, 157, NULL, 1.00, NULL, 0, 115, '2023-04-03 13:40:59.690', NULL, NULL, 140, 145); -INSERT INTO `wms_inventory` VALUES (304, 158, 107, 1.00, NULL, 0, 115, '2023-04-03 13:40:59.690', NULL, NULL, 139, 155); -INSERT INTO `wms_inventory` VALUES (305, 157, NULL, 1.00, NULL, 0, 115, '2023-04-03 14:00:07.341', NULL, NULL, NULL, NULL); -INSERT INTO `wms_inventory` VALUES (306, 157, NULL, 499.00, NULL, 0, 115, '2023-04-03 14:00:48.544', NULL, NULL, NULL, NULL); -INSERT INTO `wms_inventory` VALUES (307, 157, NULL, 500.00, NULL, 0, 115, '2023-04-03 14:01:22.059', NULL, NULL, NULL, NULL); -INSERT INTO `wms_inventory` VALUES (308, 157, NULL, 300.00, NULL, 0, 115, '2023-04-03 14:10:43.967', NULL, NULL, NULL, NULL); -INSERT INTO `wms_inventory` VALUES (309, 157, 104, 300.00, NULL, 0, 115, '2023-04-03 14:16:27.977', NULL, NULL, 139, 155); -INSERT INTO `wms_inventory` VALUES (310, 157, NULL, -1.00, NULL, 0, 115, '2023-04-03 14:17:44.014', NULL, NULL, 139, NULL); -INSERT INTO `wms_inventory` VALUES (311, 157, NULL, 3700.00, NULL, 0, 115, '2023-04-03 14:23:52.108', 115, '2023-04-03 14:25:19.501', 144, NULL); -INSERT INTO `wms_inventory` VALUES (312, 163, 110, 80.00, NULL, 0, 115, '2023-04-03 16:25:21.859', 115, '2023-04-03 16:27:17.515', 138, 160); -INSERT INTO `wms_inventory` VALUES (313, 162, 104, 1.00, NULL, 0, 115, '2023-04-04 13:40:37.680', NULL, NULL, 139, 155); -INSERT INTO `wms_inventory` VALUES (314, 162, 107, 2.00, NULL, 0, 115, '2023-04-04 15:53:10.982', 115, '2023-04-06 22:34:08.212', 139, 155); -INSERT INTO `wms_inventory` VALUES (315, 162, NULL, 4.00, NULL, 0, 115, '2023-04-04 15:55:45.063', 115, '2023-04-07 11:10:06.408', 147, NULL); -INSERT INTO `wms_inventory` VALUES (316, 168, NULL, 21.00, NULL, 0, 115, '2023-04-06 14:13:57.963', 115, '2023-04-06 14:14:19.352', 181, NULL); -INSERT INTO `wms_inventory` VALUES (317, 169, 113, 12.00, NULL, 0, 115, '2023-04-06 15:12:31.959', 115, '2023-04-06 18:02:20.479', 184, 169); -INSERT INTO `wms_inventory` VALUES (318, 169, 107, 1.00, NULL, 0, 115, '2023-04-06 17:56:51.673', NULL, NULL, 139, 155); -INSERT INTO `wms_inventory` VALUES (319, 165, 109, 1.00, NULL, 0, 115, '2023-04-06 18:02:05.717', NULL, NULL, 139, 155); -INSERT INTO `wms_inventory` VALUES (320, 170, 114, 0.00, NULL, 0, 115, '2023-04-06 22:45:01.075', 115, '2023-04-06 22:46:28.694', 185, 170); -INSERT INTO `wms_inventory` VALUES (321, 170, 107, 101.00, NULL, 0, 115, '2023-04-07 11:07:27.883', 115, '2023-04-07 11:11:55.447', 139, 155); -INSERT INTO `wms_inventory` VALUES (322, 170, 113, 1.00, NULL, 0, 115, '2023-04-08 21:37:28.900', NULL, NULL, 184, 169); -INSERT INTO `wms_inventory` VALUES (323, 171, NULL, 2.00, NULL, 0, 115, '2023-04-10 10:49:53.343', NULL, NULL, 155, 172); -INSERT INTO `wms_inventory` VALUES (324, 171, 102, 2.00, NULL, 0, 115, '2023-04-10 16:07:17.853', 115, '2023-04-12 09:14:43.050', 155, 171); -INSERT INTO `wms_inventory` VALUES (325, 172, NULL, 8.00, NULL, 0, 115, '2023-04-10 16:50:33.609', 115, '2023-04-12 14:12:40.744', 154, NULL); -INSERT INTO `wms_inventory` VALUES (326, 171, NULL, 1.00, NULL, 0, 115, '2023-04-10 19:53:21.497', NULL, NULL, 154, NULL); -INSERT INTO `wms_inventory` VALUES (327, 172, NULL, 1.00, NULL, 0, 115, '2023-04-11 12:03:34.277', NULL, NULL, 190, NULL); -INSERT INTO `wms_inventory` VALUES (328, 172, NULL, 1.00, NULL, 0, 115, '2023-04-11 12:04:55.554', NULL, NULL, 189, NULL); -INSERT INTO `wms_inventory` VALUES (329, 173, NULL, 3.00, NULL, 0, 115, '2023-04-11 15:25:07.184', NULL, NULL, 157, NULL); -INSERT INTO `wms_inventory` VALUES (330, 173, 115, 0.00, NULL, 0, 115, '2023-04-11 15:58:50.262', 115, '2023-04-11 16:01:14.384', 178, 176); -INSERT INTO `wms_inventory` VALUES (331, 172, NULL, 3.00, NULL, 0, 115, '2023-04-11 15:59:25.789', 115, '2023-04-11 17:33:10.519', 157, NULL); -INSERT INTO `wms_inventory` VALUES (332, 174, NULL, 6.00, NULL, 0, 115, '2023-04-12 16:54:37.727', NULL, NULL, 157, NULL); -INSERT INTO `wms_inventory` VALUES (333, 173, NULL, 5.00, NULL, 0, 115, '2023-04-12 16:54:51.002', NULL, NULL, 158, NULL); -INSERT INTO `wms_inventory` VALUES (334, 178, 116, 0.00, NULL, 0, 115, '2023-04-13 12:23:32.711', 115, '2023-04-25 15:46:56.392', 192, 178); -INSERT INTO `wms_inventory` VALUES (335, 180, 122, 194.00, NULL, 0, 115, '2023-04-13 13:52:02.635', 115, '2023-04-25 15:46:56.392', 198, 185); -INSERT INTO `wms_inventory` VALUES (336, 178, 120, 1.00, NULL, 0, 115, '2023-04-13 13:54:23.411', NULL, NULL, 196, 183); -INSERT INTO `wms_inventory` VALUES (337, 180, NULL, 1.00, NULL, 0, 115, '2023-04-13 13:55:12.863', NULL, NULL, 199, 186); -INSERT INTO `wms_inventory` VALUES (338, 180, 119, 2.00, NULL, 0, 115, '2023-04-14 11:18:22.794', 115, '2023-04-14 15:52:38.690', 195, 182); -INSERT INTO `wms_inventory` VALUES (339, 180, 118, 0.00, NULL, 0, 115, '2023-04-15 09:09:42.331', 115, '2023-04-22 19:18:53.015', 194, 181); -INSERT INTO `wms_inventory` VALUES (340, 176, 118, 1.00, NULL, 0, 115, '2023-04-15 09:09:42.331', NULL, NULL, 194, 181); -INSERT INTO `wms_inventory` VALUES (341, 178, 117, 5.00, NULL, 0, 115, '2023-04-15 16:23:32.420', NULL, NULL, 193, 180); -INSERT INTO `wms_inventory` VALUES (342, 180, NULL, 1.00, NULL, 0, 115, '2023-04-15 16:27:27.847', NULL, NULL, 193, NULL); -INSERT INTO `wms_inventory` VALUES (343, 178, 118, 5.00, NULL, 0, 115, '2023-04-15 16:48:15.398', NULL, NULL, 194, 181); -INSERT INTO `wms_inventory` VALUES (344, 180, 116, 10.00, NULL, 0, 115, '2023-04-17 13:33:54.127', NULL, NULL, 193, 178); -INSERT INTO `wms_inventory` VALUES (345, 180, NULL, -3.00, NULL, 0, 115, '2023-04-17 13:50:04.379', NULL, NULL, 198, 185); -INSERT INTO `wms_inventory` VALUES (346, 180, 123, 3.00, NULL, 0, 115, '2023-04-17 13:50:04.395', NULL, NULL, 199, 186); -INSERT INTO `wms_inventory` VALUES (347, 182, 116, 50.00, NULL, 0, 115, '2023-04-17 15:43:40.394', NULL, NULL, 193, 178); -INSERT INTO `wms_inventory` VALUES (348, 181, 124, 51.00, NULL, 0, 115, '2023-04-17 15:43:40.394', 115, '2023-04-19 09:24:19.759', 193, 178); -INSERT INTO `wms_inventory` VALUES (349, 182, 118, 0.00, NULL, 0, 115, '2023-04-18 13:28:06.084', 115, '2023-04-27 15:18:00.357', 194, 181); -INSERT INTO `wms_inventory` VALUES (350, 182, 124, 2.00, NULL, 0, 115, '2023-04-19 09:24:19.759', 115, '2023-04-19 23:03:23.574', 193, 178); -INSERT INTO `wms_inventory` VALUES (351, 182, NULL, 1.00, NULL, 0, 115, '2023-04-19 21:07:55.569', NULL, NULL, 194, 181); -INSERT INTO `wms_inventory` VALUES (352, 181, 116, 0.00, NULL, 0, 115, '2023-04-19 21:07:55.569', 115, '2023-04-25 15:46:56.392', 193, 178); -INSERT INTO `wms_inventory` VALUES (353, 181, 118, 8.00, NULL, 0, 115, '2023-04-22 19:15:25.129', 115, '2023-04-29 13:56:40.350', 194, 181); -INSERT INTO `wms_inventory` VALUES (354, 182, NULL, 1.00, NULL, 0, 115, '2023-04-23 14:01:12.828', NULL, NULL, 196, 183); -INSERT INTO `wms_inventory` VALUES (355, 184, 118, 1.00, NULL, 0, 115, '2023-04-24 10:35:48.434', NULL, NULL, 194, 181); -INSERT INTO `wms_inventory` VALUES (356, 182, 121, 1.00, NULL, 0, 115, '2023-04-24 10:35:48.434', NULL, NULL, 195, 182); -INSERT INTO `wms_inventory` VALUES (357, 181, 124, 1.00, NULL, 0, 115, '2023-04-24 10:35:48.434', NULL, NULL, 198, 185); -INSERT INTO `wms_inventory` VALUES (358, 185, 127, 0.00, NULL, 0, 115, '2023-04-24 15:36:26.664', 115, '2023-04-24 15:37:10.984', 215, 189); -INSERT INTO `wms_inventory` VALUES (359, 183, NULL, 1.00, NULL, 0, 115, '2023-04-25 14:56:10.790', NULL, NULL, 196, 183); -INSERT INTO `wms_inventory` VALUES (360, 185, 118, 0.00, NULL, 0, 115, '2023-04-25 14:56:10.790', 115, '2023-04-25 15:01:00.126', 194, 181); -INSERT INTO `wms_inventory` VALUES (361, 186, NULL, 6.00, NULL, 0, 115, '2023-04-25 15:54:34.259', 115, '2023-04-28 23:45:44.067', 196, 183); -INSERT INTO `wms_inventory` VALUES (362, 186, 118, 5.00, NULL, 0, 115, '2023-04-25 16:53:40.790', NULL, NULL, 194, 181); -INSERT INTO `wms_inventory` VALUES (363, 183, 119, 4.00, NULL, 0, 115, '2023-04-25 16:53:40.790', NULL, NULL, 195, 182); -INSERT INTO `wms_inventory` VALUES (364, 183, NULL, 1.00, NULL, 0, 115, '2023-04-25 18:31:31.133', NULL, NULL, NULL, NULL); -INSERT INTO `wms_inventory` VALUES (365, 187, 117, 2.00, NULL, 0, 115, '2023-04-26 17:17:59.199', 115, '2023-04-28 16:44:42.069', 194, 181); -INSERT INTO `wms_inventory` VALUES (366, 186, NULL, -1.00, NULL, 0, 115, '2023-04-28 23:45:44.067', 115, '2023-04-28 23:45:44.062', 194, 181); -INSERT INTO `wms_inventory` VALUES (367, 188, 117, 1.00, NULL, 0, 115, '2023-04-30 16:33:48.741', NULL, NULL, 194, 181); -INSERT INTO `wms_inventory` VALUES (368, 193, NULL, 1.00, NULL, 0, 115, '2023-05-04 10:35:32.621', NULL, NULL, 230, NULL); -INSERT INTO `wms_inventory` VALUES (369, 191, NULL, 1.00, NULL, 0, 115, '2023-05-04 10:35:32.621', NULL, NULL, 229, NULL); -INSERT INTO `wms_inventory` VALUES (370, 190, NULL, 1.00, NULL, 0, 115, '2023-05-04 10:35:32.621', NULL, NULL, 229, NULL); -INSERT INTO `wms_inventory` VALUES (371, 189, NULL, 1.00, NULL, 0, 115, '2023-05-04 10:35:32.621', NULL, NULL, 231, NULL); -INSERT INTO `wms_inventory` VALUES (372, 193, NULL, 1.00, NULL, 0, 115, '2023-05-04 16:41:41.994', NULL, NULL, 229, 216); - --- ---------------------------- --- Table structure for wms_inventory_check --- ---------------------------- -DROP TABLE IF EXISTS `wms_inventory_check`; -CREATE TABLE `wms_inventory_check` ( - `id` bigint(20) NOT NULL AUTO_INCREMENT, - `inventory_check_no` varchar(22) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '库存盘点单号,系统自动生成', - `inventory_check_type` int(11) NULL DEFAULT NULL COMMENT '库存盘点类型', - `inventory_check_status` tinyint(4) NULL DEFAULT 11 COMMENT '库存盘点单状态11:盘点中 22:已完成', - `inventory_check_total` decimal(20, 2) NULL DEFAULT NULL COMMENT '盈亏数', - `check_status` tinyint(4) NULL DEFAULT NULL COMMENT '审核状态', - `check_user_id` bigint(20) NULL DEFAULT NULL COMMENT '审核人', - `check_time` datetime(3) NULL DEFAULT NULL COMMENT '审核时间', - `warehouse_id` bigint(20) NULL DEFAULT NULL COMMENT '所属仓库', - `area_id` bigint(20) NULL DEFAULT NULL COMMENT '所属库区', - `rack_id` bigint(20) NULL DEFAULT NULL COMMENT '货架', - `attachment` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '附件文件', - `remark` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '备注', - `del_flag` tinyint(4) NOT NULL DEFAULT 0 COMMENT '删除标识', - `create_by` bigint(20) NULL DEFAULT NULL COMMENT '创建人', - `create_time` datetime(3) NULL DEFAULT NULL COMMENT '创建时间', - `update_by` bigint(20) NULL DEFAULT NULL COMMENT '修改人', - `update_time` datetime(3) NULL DEFAULT NULL COMMENT '修改时间', - PRIMARY KEY (`id`) USING BTREE -) ENGINE = InnoDB AUTO_INCREMENT = 52 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '库存盘点单据' ROW_FORMAT = Dynamic; - --- ---------------------------- --- Records of wms_inventory_check --- ---------------------------- -INSERT INTO `wms_inventory_check` VALUES (42, 'IV-2023-04-26-152650', NULL, 22, 0.00, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, 1, '2023-04-26 15:26:56.000', 1, '2023-04-26 17:01:05.241'); -INSERT INTO `wms_inventory_check` VALUES (43, 'IV-2023-04-26-163020', NULL, 22, 1.00, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, 1, '2023-04-26 16:30:43.000', 115, '2023-04-28 16:44:42.030'); -INSERT INTO `wms_inventory_check` VALUES (44, 'IV-2023-04-26-163845', NULL, 11, 0.00, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 1, 1, '2023-04-26 16:38:59.447', NULL, NULL); -INSERT INTO `wms_inventory_check` VALUES (45, 'IV-2023-04-28-223832', NULL, 22, 0.00, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, 115, '2023-04-28 22:38:52.764', NULL, NULL); -INSERT INTO `wms_inventory_check` VALUES (46, 'IV-2023-04-28-223902', NULL, 22, 1.00, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, 115, '2023-04-28 22:39:41.000', 115, '2023-04-28 23:45:44.047'); -INSERT INTO `wms_inventory_check` VALUES (47, 'IV-2023-05-01-011346', NULL, 11, 0.00, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, 115, '2023-05-01 01:13:51.726', NULL, NULL); -INSERT INTO `wms_inventory_check` VALUES (48, 'IV-2023-05-02-090600', NULL, 11, 0.00, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, 115, '2023-05-02 09:06:05.860', NULL, NULL); -INSERT INTO `wms_inventory_check` VALUES (49, 'IV-2023-05-03-030804', NULL, 11, 3.00, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, 115, '2023-05-03 03:08:49.260', NULL, NULL); -INSERT INTO `wms_inventory_check` VALUES (50, 'IV-2023-05-03-030904', NULL, 11, 6.00, NULL, NULL, NULL, 231, 217, NULL, NULL, NULL, 0, 115, '2023-05-03 03:10:01.700', NULL, NULL); -INSERT INTO `wms_inventory_check` VALUES (51, 'IV-2023-05-04-104902', NULL, 11, 0.00, NULL, NULL, NULL, 229, 216, NULL, NULL, NULL, 0, 115, '2023-05-04 10:50:08.621', NULL, NULL); - --- ---------------------------- --- Table structure for wms_inventory_check_detail --- ---------------------------- -DROP TABLE IF EXISTS `wms_inventory_check_detail`; -CREATE TABLE `wms_inventory_check_detail` ( - `id` bigint(20) NOT NULL AUTO_INCREMENT, - `inventory_check_id` bigint(20) NULL DEFAULT NULL COMMENT '库存盘点单', - `item_id` bigint(20) NULL DEFAULT NULL COMMENT '物料', - `quantity` decimal(20, 2) NULL DEFAULT NULL COMMENT '库存数量', - `check_quantity` decimal(20, 2) NULL DEFAULT NULL COMMENT '盘点数量', - `warehouse_id` bigint(20) NULL DEFAULT NULL COMMENT '所属仓库', - `area_id` bigint(20) NULL DEFAULT NULL COMMENT '所属库区', - `rack_id` bigint(20) NULL DEFAULT NULL COMMENT '货架', - `del_flag` tinyint(4) NOT NULL DEFAULT 0 COMMENT '删除标识', - `remark` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '备注', - `create_by` bigint(20) NULL DEFAULT NULL COMMENT '创建人', - `create_time` datetime(3) NULL DEFAULT NULL COMMENT '创建时间', - `update_by` bigint(20) NULL DEFAULT NULL COMMENT '修改人', - `update_time` datetime(3) NULL DEFAULT NULL COMMENT '修改时间', - PRIMARY KEY (`id`) USING BTREE -) ENGINE = InnoDB AUTO_INCREMENT = 241 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '库存盘点单据详情' ROW_FORMAT = Dynamic; - --- ---------------------------- --- Records of wms_inventory_check_detail --- ---------------------------- -INSERT INTO `wms_inventory_check_detail` VALUES (195, 44, 186, 5.00, 5.00, 194, 181, NULL, 0, NULL, NULL, NULL, NULL, NULL); -INSERT INTO `wms_inventory_check_detail` VALUES (196, 44, 186, 6.00, 6.00, 196, 183, NULL, 0, NULL, NULL, NULL, NULL, NULL); -INSERT INTO `wms_inventory_check_detail` VALUES (197, 42, 187, 0.00, 0.00, NULL, NULL, NULL, 0, '物料是箱子', NULL, NULL, NULL, NULL); -INSERT INTO `wms_inventory_check_detail` VALUES (198, 43, 187, 0.00, 1.00, 194, 181, 117, 0, '测试一下说明', NULL, NULL, NULL, NULL); -INSERT INTO `wms_inventory_check_detail` VALUES (199, 45, 188, 0.00, 0.00, 197, 184, NULL, 0, NULL, NULL, NULL, NULL, NULL); -INSERT INTO `wms_inventory_check_detail` VALUES (200, 45, 178, 0.00, 0.00, NULL, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL); -INSERT INTO `wms_inventory_check_detail` VALUES (201, 45, 176, 0.00, 0.00, NULL, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL); -INSERT INTO `wms_inventory_check_detail` VALUES (202, 45, 187, 2.00, 2.00, 194, 181, NULL, 0, NULL, NULL, NULL, NULL, NULL); -INSERT INTO `wms_inventory_check_detail` VALUES (203, 45, 183, 1.00, 1.00, NULL, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL); -INSERT INTO `wms_inventory_check_detail` VALUES (204, 45, 183, 4.00, 4.00, 195, 182, NULL, 0, NULL, NULL, NULL, NULL, NULL); -INSERT INTO `wms_inventory_check_detail` VALUES (205, 45, 186, 5.00, 5.00, 194, 181, NULL, 0, NULL, NULL, NULL, NULL, NULL); -INSERT INTO `wms_inventory_check_detail` VALUES (206, 45, 186, 4.00, 4.00, 196, 183, NULL, 0, NULL, NULL, NULL, NULL, NULL); -INSERT INTO `wms_inventory_check_detail` VALUES (207, 45, 183, 1.00, 1.00, 196, 183, NULL, 0, NULL, NULL, NULL, NULL, NULL); -INSERT INTO `wms_inventory_check_detail` VALUES (208, 45, 181, 1.00, 1.00, 198, 185, NULL, 0, NULL, NULL, NULL, NULL, NULL); -INSERT INTO `wms_inventory_check_detail` VALUES (209, 45, 182, 1.00, 1.00, 195, 182, NULL, 0, NULL, NULL, NULL, NULL, NULL); -INSERT INTO `wms_inventory_check_detail` VALUES (210, 45, 182, 1.00, 1.00, 196, 183, NULL, 0, NULL, NULL, NULL, NULL, NULL); -INSERT INTO `wms_inventory_check_detail` VALUES (211, 45, 181, 2.00, 2.00, 194, 181, NULL, 0, NULL, NULL, NULL, NULL, NULL); -INSERT INTO `wms_inventory_check_detail` VALUES (212, 45, 181, 0.00, 0.00, 193, 178, NULL, 0, NULL, NULL, NULL, NULL, NULL); -INSERT INTO `wms_inventory_check_detail` VALUES (213, 45, 182, 1.00, 1.00, 194, 181, NULL, 0, NULL, NULL, NULL, NULL, NULL); -INSERT INTO `wms_inventory_check_detail` VALUES (214, 45, 182, 2.00, 2.00, 193, 178, NULL, 0, NULL, NULL, NULL, NULL, NULL); -INSERT INTO `wms_inventory_check_detail` VALUES (215, 45, 182, 0.00, 0.00, 194, 181, NULL, 0, NULL, NULL, NULL, NULL, NULL); -INSERT INTO `wms_inventory_check_detail` VALUES (216, 45, 181, 51.00, 51.00, 193, 178, NULL, 0, NULL, NULL, NULL, NULL, NULL); -INSERT INTO `wms_inventory_check_detail` VALUES (217, 45, 182, 50.00, 50.00, 193, 178, NULL, 0, NULL, NULL, NULL, NULL, NULL); -INSERT INTO `wms_inventory_check_detail` VALUES (218, 45, 180, 3.00, 3.00, 199, 186, NULL, 0, NULL, NULL, NULL, NULL, NULL); -INSERT INTO `wms_inventory_check_detail` VALUES (227, 46, 186, 5.00, 4.00, 194, 181, NULL, 0, NULL, NULL, NULL, NULL, NULL); -INSERT INTO `wms_inventory_check_detail` VALUES (228, 46, 186, 4.00, 6.00, 196, 183, NULL, 0, NULL, NULL, NULL, NULL, NULL); -INSERT INTO `wms_inventory_check_detail` VALUES (229, 46, 182, 1.00, 1.00, 195, 182, NULL, 0, NULL, NULL, NULL, NULL, NULL); -INSERT INTO `wms_inventory_check_detail` VALUES (230, 46, 182, 1.00, 1.00, 196, 183, NULL, 0, NULL, NULL, NULL, NULL, NULL); -INSERT INTO `wms_inventory_check_detail` VALUES (231, 46, 182, 1.00, 1.00, 194, 181, NULL, 0, NULL, NULL, NULL, NULL, NULL); -INSERT INTO `wms_inventory_check_detail` VALUES (232, 46, 182, 2.00, 2.00, 193, 178, NULL, 0, NULL, NULL, NULL, NULL, NULL); -INSERT INTO `wms_inventory_check_detail` VALUES (233, 46, 182, 0.00, 0.00, 194, 181, NULL, 0, NULL, NULL, NULL, NULL, NULL); -INSERT INTO `wms_inventory_check_detail` VALUES (234, 46, 182, 50.00, 50.00, 193, 178, NULL, 0, NULL, NULL, NULL, NULL, NULL); -INSERT INTO `wms_inventory_check_detail` VALUES (235, 49, 176, 0.00, 3.00, 229, 216, NULL, 0, NULL, NULL, NULL, NULL, NULL); -INSERT INTO `wms_inventory_check_detail` VALUES (236, 50, 149, 0.00, 6.00, 231, 217, NULL, 0, '88888888', NULL, NULL, NULL, NULL); -INSERT INTO `wms_inventory_check_detail` VALUES (237, 51, 193, 0.00, 0.00, 229, 216, NULL, 0, NULL, NULL, NULL, NULL, NULL); -INSERT INTO `wms_inventory_check_detail` VALUES (238, 51, 191, 0.00, 0.00, 229, 216, NULL, 0, NULL, NULL, NULL, NULL, NULL); -INSERT INTO `wms_inventory_check_detail` VALUES (239, 51, 190, 0.00, 0.00, 229, 216, NULL, 0, NULL, NULL, NULL, NULL, NULL); -INSERT INTO `wms_inventory_check_detail` VALUES (240, 51, 189, 0.00, 0.00, 229, 216, NULL, 0, NULL, NULL, NULL, NULL, NULL); - --- ---------------------------- --- Table structure for wms_inventory_history --- ---------------------------- -DROP TABLE IF EXISTS `wms_inventory_history`; -CREATE TABLE `wms_inventory_history` ( - `id` bigint(20) NOT NULL AUTO_INCREMENT, - `form_id` bigint(20) NULL DEFAULT NULL COMMENT '操作id(出库、入库、库存移动表单id)', - `form_type` int(11) NULL DEFAULT NULL COMMENT '操作类型', - `item_id` bigint(20) NULL DEFAULT NULL COMMENT '物料ID', - `rack_id` bigint(20) NULL DEFAULT NULL COMMENT '货架id', - `quantity` decimal(20, 2) NULL DEFAULT NULL COMMENT '库存变化', - `remark` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '备注', - `del_flag` tinyint(4) NOT NULL DEFAULT 0 COMMENT '删除标识', - `create_by` bigint(20) NULL DEFAULT NULL COMMENT '创建人', - `create_time` datetime(3) NULL DEFAULT NULL COMMENT '创建时间', - `update_by` bigint(20) NULL DEFAULT NULL COMMENT '修改人', - `update_time` datetime(3) NULL DEFAULT NULL COMMENT '修改时间', - `warehouse_id` bigint(20) NULL DEFAULT NULL COMMENT '所属仓库', - `area_id` bigint(20) NULL DEFAULT NULL COMMENT '所属库区', - PRIMARY KEY (`id`) USING BTREE -) ENGINE = InnoDB AUTO_INCREMENT = 706 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '库存记录' ROW_FORMAT = Dynamic; - --- ---------------------------- --- Records of wms_inventory_history --- ---------------------------- -INSERT INTO `wms_inventory_history` VALUES (18, 9, 13, 1, 1, 9.00, NULL, 0, 1, '2022-10-24 18:48:00.020', NULL, NULL, 1, 13); -INSERT INTO `wms_inventory_history` VALUES (19, 9, 13, 1, 1, 18.00, NULL, 0, 1, '2022-10-24 18:49:30.030', NULL, NULL, 1, 13); -INSERT INTO `wms_inventory_history` VALUES (20, 10, 12, 1, 1, 1.00, NULL, 0, 1, '2022-10-24 18:54:54.774', NULL, NULL, 1, 13); -INSERT INTO `wms_inventory_history` VALUES (21, 13, 1, 1, 1, 7.00, NULL, 0, 1, '2022-10-31 22:08:12.343', NULL, NULL, 1, 13); -INSERT INTO `wms_inventory_history` VALUES (22, 13, 1, 2, 5, 1.00, NULL, 0, 1, '2022-10-31 22:10:22.774', NULL, NULL, 1, 13); -INSERT INTO `wms_inventory_history` VALUES (23, 14, 1, 1, 1, 1.00, NULL, 0, 1, '2022-11-01 15:44:15.883', NULL, NULL, 1, 13); -INSERT INTO `wms_inventory_history` VALUES (24, 4, 22, 2, 6, 2.00, NULL, 0, 1, '2022-11-02 17:25:28.225', NULL, NULL, 2, 18); -INSERT INTO `wms_inventory_history` VALUES (25, 4, 22, 1, NULL, 2.00, NULL, 0, 1, '2022-11-02 17:25:28.225', NULL, NULL, 4, NULL); -INSERT INTO `wms_inventory_history` VALUES (26, 4, 21, 2, 1, 2.00, NULL, 0, 1, '2022-11-02 17:25:28.225', NULL, NULL, 1, 13); -INSERT INTO `wms_inventory_history` VALUES (27, 4, 21, 1, 1, 2.00, NULL, 0, 1, '2022-11-02 17:25:28.225', NULL, NULL, 1, 13); -INSERT INTO `wms_inventory_history` VALUES (28, 4, 21, 2, 1, 3.00, NULL, 0, 1, '2022-11-02 17:28:45.483', NULL, NULL, 1, 13); -INSERT INTO `wms_inventory_history` VALUES (29, 4, 21, 1, 1, 3.00, NULL, 0, 1, '2022-11-02 17:28:45.483', NULL, NULL, 1, 13); -INSERT INTO `wms_inventory_history` VALUES (30, 4, 22, 2, 6, 3.00, NULL, 0, 1, '2022-11-02 17:28:45.483', NULL, NULL, 2, 18); -INSERT INTO `wms_inventory_history` VALUES (31, 4, 22, 1, NULL, 3.00, NULL, 0, 1, '2022-11-02 17:28:45.483', NULL, NULL, 4, NULL); -INSERT INTO `wms_inventory_history` VALUES (32, 4, 21, 2, 1, 5.00, NULL, 0, 1, '2022-11-02 17:30:35.124', NULL, NULL, 1, 13); -INSERT INTO `wms_inventory_history` VALUES (33, 4, 21, 1, 1, 5.00, NULL, 0, 1, '2022-11-02 17:30:35.124', NULL, NULL, 1, 13); -INSERT INTO `wms_inventory_history` VALUES (34, 4, 22, 2, 6, 5.00, NULL, 0, 1, '2022-11-02 17:30:35.124', NULL, NULL, 2, 18); -INSERT INTO `wms_inventory_history` VALUES (35, 4, 22, 1, NULL, 5.00, NULL, 0, 1, '2022-11-02 17:30:35.124', NULL, NULL, 4, NULL); -INSERT INTO `wms_inventory_history` VALUES (36, 4, 21, 2, 1, 1.00, NULL, 0, 1, '2022-11-02 17:34:50.453', NULL, NULL, 1, 13); -INSERT INTO `wms_inventory_history` VALUES (37, 4, 21, 1, 1, 1.00, NULL, 0, 1, '2022-11-02 17:34:50.453', NULL, NULL, 1, 13); -INSERT INTO `wms_inventory_history` VALUES (38, 4, 22, 2, 6, 1.00, NULL, 0, 1, '2022-11-02 17:34:50.453', NULL, NULL, 2, 18); -INSERT INTO `wms_inventory_history` VALUES (39, 4, 22, 1, NULL, 1.00, NULL, 0, 1, '2022-11-02 17:34:50.453', NULL, NULL, 4, NULL); -INSERT INTO `wms_inventory_history` VALUES (40, 4, 21, 2, 1, 1.00, NULL, 0, 1, '2022-11-02 17:39:48.448', NULL, NULL, 1, 13); -INSERT INTO `wms_inventory_history` VALUES (41, 4, 21, 1, 1, 1.00, NULL, 0, 1, '2022-11-02 17:39:48.448', NULL, NULL, 1, 13); -INSERT INTO `wms_inventory_history` VALUES (42, 4, 22, 2, 6, 1.00, NULL, 0, 1, '2022-11-02 17:39:48.448', NULL, NULL, 2, 18); -INSERT INTO `wms_inventory_history` VALUES (43, 4, 22, 1, NULL, 1.00, NULL, 0, 1, '2022-11-02 17:39:48.448', NULL, NULL, 4, NULL); -INSERT INTO `wms_inventory_history` VALUES (44, 4, 21, 2, 1, 9.00, NULL, 0, 1, '2022-11-02 17:50:02.308', NULL, NULL, 1, 13); -INSERT INTO `wms_inventory_history` VALUES (45, 4, 22, 2, 6, 9.00, NULL, 0, 1, '2022-11-02 17:50:02.308', NULL, NULL, 2, 18); -INSERT INTO `wms_inventory_history` VALUES (46, 14, 1, 2, NULL, 1.00, NULL, 0, 1, '2022-11-03 17:40:30.449', NULL, NULL, 2, 18); -INSERT INTO `wms_inventory_history` VALUES (47, 13, 1, 2, NULL, 1.00, NULL, 0, 1, '2022-11-03 17:43:43.910', NULL, NULL, 3, 16); -INSERT INTO `wms_inventory_history` VALUES (48, 13, 1, 2, NULL, 1.00, NULL, 0, 1, '2022-11-03 17:48:24.811', NULL, NULL, 3, 16); -INSERT INTO `wms_inventory_history` VALUES (49, 16, 1, 1, 7, 1.00, NULL, 0, 115, '2022-11-07 08:25:36.358', NULL, NULL, 3, 16); -INSERT INTO `wms_inventory_history` VALUES (50, 19, 1, 1, 8, 5.00, NULL, 0, 115, '2022-11-07 21:46:30.614', NULL, NULL, 20, 42); -INSERT INTO `wms_inventory_history` VALUES (51, 19, 1, 2, NULL, 8.00, NULL, 0, 115, '2022-11-07 21:46:30.614', NULL, NULL, 20, 41); -INSERT INTO `wms_inventory_history` VALUES (52, 14, 1, 1, 1, 4.00, NULL, 0, 115, '2022-11-08 17:14:51.687', NULL, NULL, 1, 13); -INSERT INTO `wms_inventory_history` VALUES (53, 22, 1, 1, NULL, 1.00, NULL, 0, 115, '2022-11-09 14:58:41.776', NULL, NULL, 1, 13); -INSERT INTO `wms_inventory_history` VALUES (54, 22, 1, 2, NULL, 1.00, NULL, 0, 115, '2022-11-09 14:58:41.776', NULL, NULL, 2, 18); -INSERT INTO `wms_inventory_history` VALUES (55, 22, 1, 1, NULL, 2.00, NULL, 0, 115, '2022-11-09 14:59:13.862', NULL, NULL, 1, 13); -INSERT INTO `wms_inventory_history` VALUES (56, 22, 1, 1, NULL, 3.00, NULL, 0, 115, '2022-11-09 14:59:20.823', NULL, NULL, 1, 13); -INSERT INTO `wms_inventory_history` VALUES (57, 23, 1, 1, NULL, 1.00, NULL, 0, 115, '2022-11-09 18:32:26.071', NULL, NULL, 3, 14); -INSERT INTO `wms_inventory_history` VALUES (58, 29, 1, 5, 6, 1.00, NULL, 0, 115, '2022-11-11 16:24:13.363', NULL, NULL, 2, 18); -INSERT INTO `wms_inventory_history` VALUES (59, 17, 11, 5, 6, 1.00, NULL, 0, 115, '2022-11-11 16:47:16.638', NULL, NULL, 2, 18); -INSERT INTO `wms_inventory_history` VALUES (60, 31, 1, 7, 9, 400.00, NULL, 0, 115, '2022-11-11 17:19:20.946', NULL, NULL, 21, 43); -INSERT INTO `wms_inventory_history` VALUES (61, 31, 1, 8, 11, 100.00, NULL, 0, 115, '2022-11-11 17:19:20.946', NULL, NULL, 21, 44); -INSERT INTO `wms_inventory_history` VALUES (62, 31, 1, 7, 9, 200.00, NULL, 0, 115, '2022-11-11 17:20:58.097', NULL, NULL, 21, 43); -INSERT INTO `wms_inventory_history` VALUES (63, 18, 11, 7, 9, 10.00, NULL, 0, 115, '2022-11-11 17:23:27.352', NULL, NULL, 21, 43); -INSERT INTO `wms_inventory_history` VALUES (64, 18, 11, 8, 11, 10.00, NULL, 0, 115, '2022-11-11 17:23:27.352', NULL, NULL, 21, 44); -INSERT INTO `wms_inventory_history` VALUES (65, 31, 1, 8, 11, 100.00, NULL, 0, 115, '2022-11-11 17:26:04.650', NULL, NULL, 21, 44); -INSERT INTO `wms_inventory_history` VALUES (66, 8, 21, 8, 11, 40.00, NULL, 0, 115, '2022-11-11 17:30:49.794', NULL, NULL, 21, 44); -INSERT INTO `wms_inventory_history` VALUES (67, 8, 22, 8, NULL, 40.00, NULL, 0, 115, '2022-11-11 17:30:49.794', NULL, NULL, 22, NULL); -INSERT INTO `wms_inventory_history` VALUES (68, 4, 21, 2, 1, 8.00, NULL, 0, 115, '2022-11-12 16:58:55.355', NULL, NULL, 1, 13); -INSERT INTO `wms_inventory_history` VALUES (69, 4, 22, 2, 6, 8.00, NULL, 0, 115, '2022-11-12 16:58:55.355', NULL, NULL, 2, 18); -INSERT INTO `wms_inventory_history` VALUES (70, 33, 2, 1, 17, 1.00, NULL, 0, 115, '2022-11-13 17:33:14.726', NULL, NULL, 25, 50); -INSERT INTO `wms_inventory_history` VALUES (71, 33, 2, 2, NULL, 1.00, NULL, 0, 115, '2022-11-13 17:33:14.726', NULL, NULL, 2, 18); -INSERT INTO `wms_inventory_history` VALUES (72, 33, 2, 3, NULL, 1.00, NULL, 0, 115, '2022-11-13 17:33:14.726', NULL, NULL, 3, 14); -INSERT INTO `wms_inventory_history` VALUES (73, 33, 2, 4, 1, 1.00, NULL, 0, 115, '2022-11-13 17:33:14.726', NULL, NULL, 2, 17); -INSERT INTO `wms_inventory_history` VALUES (74, 33, 2, 5, 6, 1.00, NULL, 0, 115, '2022-11-13 17:33:14.726', NULL, NULL, 2, 18); -INSERT INTO `wms_inventory_history` VALUES (75, 33, 2, 6, 1, 1.00, NULL, 0, 115, '2022-11-13 17:33:14.726', NULL, NULL, 2, 17); -INSERT INTO `wms_inventory_history` VALUES (76, 33, 2, 7, 9, 1.00, NULL, 0, 115, '2022-11-13 17:33:14.726', NULL, NULL, 21, 43); -INSERT INTO `wms_inventory_history` VALUES (77, 33, 2, 8, 11, 1.00, NULL, 0, 115, '2022-11-13 17:33:14.726', NULL, NULL, 21, 44); -INSERT INTO `wms_inventory_history` VALUES (78, 33, 2, 9, 12, 1.00, NULL, 0, 115, '2022-11-13 17:33:14.726', NULL, NULL, 22, 46); -INSERT INTO `wms_inventory_history` VALUES (79, 33, 2, 10, 14, 1.00, NULL, 0, 115, '2022-11-13 17:33:14.726', NULL, NULL, 23, 47); -INSERT INTO `wms_inventory_history` VALUES (80, 35, 1, 12, 17, 1.00, NULL, 0, 115, '2022-11-13 17:41:54.608', NULL, NULL, 25, 50); -INSERT INTO `wms_inventory_history` VALUES (81, 36, 1, 13, 4, 1.00, NULL, 0, 115, '2022-11-13 17:44:49.102', NULL, NULL, 4, 14); -INSERT INTO `wms_inventory_history` VALUES (82, 42, 1, 12, NULL, 1.00, NULL, 0, 115, '2022-11-15 16:42:56.206', NULL, NULL, 2, 44); -INSERT INTO `wms_inventory_history` VALUES (83, 42, 1, 13, NULL, 1.00, NULL, 0, 115, '2022-11-15 16:42:56.206', NULL, NULL, 2, 44); -INSERT INTO `wms_inventory_history` VALUES (84, 42, 1, 14, NULL, 1.00, NULL, 0, 115, '2022-11-15 16:42:56.206', NULL, NULL, 2, 44); -INSERT INTO `wms_inventory_history` VALUES (85, 21, 1, 14, NULL, 1.00, NULL, 0, 115, '2022-11-15 16:48:25.641', NULL, NULL, 2, 44); -INSERT INTO `wms_inventory_history` VALUES (86, 48, 1, 17, 13, 1.00, NULL, 0, 115, '2022-11-17 16:21:05.918', NULL, NULL, 2, 44); -INSERT INTO `wms_inventory_history` VALUES (87, 44, 1, 13, NULL, 1.00, NULL, 0, 115, '2022-11-18 09:11:32.694', NULL, NULL, 14, NULL); -INSERT INTO `wms_inventory_history` VALUES (88, 44, 1, 14, 13, 1.00, NULL, 0, 115, '2022-11-18 09:11:32.694', NULL, NULL, 2, 44); -INSERT INTO `wms_inventory_history` VALUES (89, 44, 1, 12, NULL, 1.00, NULL, 0, 115, '2022-11-18 09:11:43.812', NULL, NULL, 4, NULL); -INSERT INTO `wms_inventory_history` VALUES (90, 50, 3, 13, 13, 1.00, NULL, 0, 115, '2022-11-18 10:56:31.983', NULL, NULL, 2, 44); -INSERT INTO `wms_inventory_history` VALUES (91, 50, 3, 12, 13, 1.00, NULL, 0, 115, '2022-11-18 11:02:07.113', NULL, NULL, 2, 44); -INSERT INTO `wms_inventory_history` VALUES (92, 50, 3, 12, 13, 2.00, NULL, 0, 115, '2022-11-18 11:09:13.201', NULL, NULL, 2, 44); -INSERT INTO `wms_inventory_history` VALUES (93, 54, 1, 20, 13, 1.00, NULL, 0, 115, '2022-11-20 08:53:41.829', NULL, NULL, 2, 44); -INSERT INTO `wms_inventory_history` VALUES (94, 55, 1, 20, 19, 1.00, NULL, 0, 115, '2022-11-20 08:53:56.029', NULL, NULL, 14, 46); -INSERT INTO `wms_inventory_history` VALUES (95, 55, 1, 20, 19, 29.00, NULL, 0, 115, '2022-11-20 08:54:07.292', NULL, NULL, 14, 46); -INSERT INTO `wms_inventory_history` VALUES (96, 54, 1, 20, 13, 19.00, NULL, 0, 115, '2022-11-20 08:54:13.786', NULL, NULL, 2, 44); -INSERT INTO `wms_inventory_history` VALUES (97, 53, 1, 20, NULL, 1.00, NULL, 0, 115, '2022-11-20 09:26:06.094', NULL, NULL, 4, NULL); -INSERT INTO `wms_inventory_history` VALUES (98, 56, 1, 12, 13, 3.00, NULL, 0, 115, '2022-11-20 14:33:49.477', NULL, NULL, 2, 44); -INSERT INTO `wms_inventory_history` VALUES (99, 53, 1, 20, NULL, 3.00, NULL, 0, 115, '2022-11-20 15:01:21.744', NULL, NULL, 4, NULL); -INSERT INTO `wms_inventory_history` VALUES (100, 57, 1, 21, 20, 2000.00, NULL, 0, 115, '2022-11-20 15:11:18.651', NULL, NULL, 27, 52); -INSERT INTO `wms_inventory_history` VALUES (101, 67, 1, 13, 4, 1.00, NULL, 0, 115, '2022-11-23 08:23:21.447', NULL, NULL, 4, 14); -INSERT INTO `wms_inventory_history` VALUES (102, 66, 1, 14, NULL, 1.00, NULL, 0, 115, '2022-11-23 08:24:32.961', NULL, NULL, 4, NULL); -INSERT INTO `wms_inventory_history` VALUES (103, 68, 2, 14, NULL, 9.00, NULL, 0, 115, '2022-11-23 08:29:54.367', NULL, NULL, 4, NULL); -INSERT INTO `wms_inventory_history` VALUES (104, 68, 2, 15, NULL, 8.00, NULL, 0, 115, '2022-11-23 08:29:54.367', NULL, NULL, NULL, NULL); -INSERT INTO `wms_inventory_history` VALUES (105, 64, 1, 16, NULL, 1.00, NULL, 0, 115, '2022-11-23 08:31:43.572', NULL, NULL, NULL, NULL); -INSERT INTO `wms_inventory_history` VALUES (106, 69, 1, 20, NULL, 1.00, NULL, 0, 115, '2022-11-23 08:32:46.363', NULL, NULL, NULL, NULL); -INSERT INTO `wms_inventory_history` VALUES (107, 70, 3, 13, 13, 1.00, NULL, 0, 115, '2022-11-23 10:56:54.477', NULL, NULL, 2, 44); -INSERT INTO `wms_inventory_history` VALUES (108, 72, 1, 13, 13, 1.00, NULL, 0, 115, '2022-11-23 13:50:47.951', NULL, NULL, 2, 44); -INSERT INTO `wms_inventory_history` VALUES (109, 72, 1, 14, 13, 1.00, NULL, 0, 115, '2022-11-23 13:50:47.951', NULL, NULL, 2, 44); -INSERT INTO `wms_inventory_history` VALUES (110, 35, 11, 13, 13, 1.00, NULL, 0, 115, '2022-11-23 13:51:53.320', NULL, NULL, 2, 44); -INSERT INTO `wms_inventory_history` VALUES (111, 75, 1, 18, 13, 1.00, NULL, 0, 115, '2022-11-23 15:28:22.091', NULL, NULL, 2, 44); -INSERT INTO `wms_inventory_history` VALUES (112, 75, 1, 21, NULL, 1.00, NULL, 0, 115, '2022-11-23 15:28:22.091', NULL, NULL, 14, 53); -INSERT INTO `wms_inventory_history` VALUES (113, 75, 1, 22, 20, 1.00, NULL, 0, 115, '2022-11-23 15:28:22.091', NULL, NULL, 27, 52); -INSERT INTO `wms_inventory_history` VALUES (114, 78, 1, 13, 4, 1.00, NULL, 0, 115, '2022-11-25 10:39:13.631', NULL, NULL, 4, 14); -INSERT INTO `wms_inventory_history` VALUES (115, 78, 1, 14, 18, 1.00, NULL, 0, 115, '2022-11-25 10:39:13.631', NULL, NULL, 26, 51); -INSERT INTO `wms_inventory_history` VALUES (116, 78, 1, 20, NULL, 1.00, NULL, 0, 115, '2022-11-25 10:39:13.631', NULL, NULL, NULL, NULL); -INSERT INTO `wms_inventory_history` VALUES (117, 89, 1, 13, 13, 1.00, NULL, 0, 115, '2022-11-28 21:19:12.578', NULL, NULL, 2, 45); -INSERT INTO `wms_inventory_history` VALUES (118, 91, 2, 13, 4, 1.00, NULL, 0, 115, '2022-11-29 19:22:14.320', NULL, NULL, 4, 14); -INSERT INTO `wms_inventory_history` VALUES (119, 93, 1, 28, 13, 5.00, NULL, 0, 115, '2022-11-30 14:25:42.810', NULL, NULL, 2, 45); -INSERT INTO `wms_inventory_history` VALUES (120, 96, 1, 13, NULL, 1.00, NULL, 0, 115, '2022-12-01 09:56:47.423', NULL, NULL, 4, 54); -INSERT INTO `wms_inventory_history` VALUES (121, 96, 1, 13, NULL, 131.00, NULL, 0, 1, '2022-12-01 10:53:10.535', NULL, NULL, 4, 54); -INSERT INTO `wms_inventory_history` VALUES (122, 97, 1, 27, 14, 11.00, NULL, 0, 1, '2022-12-01 11:05:02.411', NULL, NULL, 14, 46); -INSERT INTO `wms_inventory_history` VALUES (123, 97, 1, 27, 14, 9.00, NULL, 0, 1, '2022-12-01 11:05:14.525', NULL, NULL, 14, 46); -INSERT INTO `wms_inventory_history` VALUES (124, 97, 1, 28, NULL, 100.00, NULL, 0, 1, '2022-12-01 11:05:38.528', NULL, NULL, 4, 54); -INSERT INTO `wms_inventory_history` VALUES (125, 94, 1, 13, NULL, 1.00, NULL, 0, 1, '2022-12-01 11:08:39.562', NULL, NULL, 14, 46); -INSERT INTO `wms_inventory_history` VALUES (126, 94, 1, 17, 14, 1.00, NULL, 0, 1, '2022-12-01 11:08:39.562', NULL, NULL, 14, 46); -INSERT INTO `wms_inventory_history` VALUES (127, 44, 11, 28, NULL, 1.00, NULL, 0, 1, '2022-12-01 11:14:59.956', NULL, NULL, 4, 54); -INSERT INTO `wms_inventory_history` VALUES (128, 44, 11, 27, 14, 1.00, NULL, 0, 1, '2022-12-01 11:16:14.223', NULL, NULL, 14, 46); -INSERT INTO `wms_inventory_history` VALUES (129, 79, 3, 13, NULL, 1.00, NULL, 0, 1, '2022-12-01 11:16:52.573', NULL, NULL, 4, 54); -INSERT INTO `wms_inventory_history` VALUES (130, 5, 21, 28, NULL, 1.00, NULL, 0, 1, '2022-12-01 11:23:05.858', NULL, NULL, 4, 54); -INSERT INTO `wms_inventory_history` VALUES (131, 5, 22, 28, NULL, 1.00, NULL, 0, 1, '2022-12-01 11:23:05.858', NULL, NULL, 14, 53); -INSERT INTO `wms_inventory_history` VALUES (132, 99, 1, 17, NULL, 1.00, NULL, 0, 115, '2022-12-02 14:34:45.554', NULL, NULL, NULL, NULL); -INSERT INTO `wms_inventory_history` VALUES (133, 99, 1, 14, 18, 1.00, NULL, 0, 115, '2022-12-02 14:34:53.411', NULL, NULL, 26, 51); -INSERT INTO `wms_inventory_history` VALUES (134, 101, 1, 13, NULL, 1.00, NULL, 0, 115, '2022-12-03 08:28:10.409', NULL, NULL, 4, 54); -INSERT INTO `wms_inventory_history` VALUES (135, 102, 1, 19, 13, 1.00, NULL, 0, 115, '2022-12-03 08:46:58.309', NULL, NULL, 2, 44); -INSERT INTO `wms_inventory_history` VALUES (136, 45, 11, 13, NULL, 1.00, NULL, 0, 115, '2022-12-03 08:47:53.576', NULL, NULL, 4, 54); -INSERT INTO `wms_inventory_history` VALUES (137, 98, 1, 13, NULL, 1.00, NULL, 0, 115, '2022-12-05 14:06:20.894', NULL, NULL, 4, 54); -INSERT INTO `wms_inventory_history` VALUES (138, 86, 1, 25, 20, 2.00, NULL, 0, 115, '2022-12-05 14:06:42.886', NULL, NULL, 27, 52); -INSERT INTO `wms_inventory_history` VALUES (139, 46, 1, 13, 4, 2.00, NULL, 0, 115, '2022-12-05 14:08:46.120', NULL, NULL, 4, 14); -INSERT INTO `wms_inventory_history` VALUES (140, 105, 1, 29, 24, 1.00, NULL, 0, 115, '2022-12-06 00:00:54.192', NULL, NULL, 30, 56); -INSERT INTO `wms_inventory_history` VALUES (141, 105, 1, 29, 24, 26.00, NULL, 0, 115, '2022-12-06 00:01:25.536', NULL, NULL, 30, 56); -INSERT INTO `wms_inventory_history` VALUES (142, 106, 1, 29, 24, 15.00, NULL, 0, 115, '2022-12-06 00:05:20.512', NULL, NULL, 30, 56); -INSERT INTO `wms_inventory_history` VALUES (143, 107, 1, 29, 24, 1.00, NULL, 0, 115, '2022-12-06 13:52:32.546', NULL, NULL, 30, 56); -INSERT INTO `wms_inventory_history` VALUES (144, 110, 1, 29, 25, 8.00, NULL, 0, 115, '2022-12-07 09:16:38.197', NULL, NULL, 31, 57); -INSERT INTO `wms_inventory_history` VALUES (145, 49, 11, 29, 25, 3.00, NULL, 0, 115, '2022-12-07 09:18:25.572', NULL, NULL, 31, 57); -INSERT INTO `wms_inventory_history` VALUES (146, 110, 1, 29, 24, 1.00, NULL, 0, 115, '2022-12-07 15:24:48.419', NULL, NULL, 30, 56); -INSERT INTO `wms_inventory_history` VALUES (147, 111, 1, 29, 24, 1.00, NULL, 0, 115, '2022-12-08 15:13:32.651', NULL, NULL, 30, 56); -INSERT INTO `wms_inventory_history` VALUES (148, 48, 11, 29, 24, 1.00, NULL, 0, 115, '2022-12-08 15:14:08.517', NULL, NULL, 30, 56); -INSERT INTO `wms_inventory_history` VALUES (149, 15, 21, 29, NULL, 1.00, NULL, 0, 115, '2022-12-09 19:41:34.306', NULL, NULL, 30, NULL); -INSERT INTO `wms_inventory_history` VALUES (150, 15, 22, 29, 24, 1.00, NULL, 0, 115, '2022-12-09 19:41:34.306', NULL, NULL, 31, 56); -INSERT INTO `wms_inventory_history` VALUES (151, 115, 1, 55, NULL, 100.00, NULL, 0, 115, '2022-12-10 15:31:02.873', NULL, NULL, 39, NULL); -INSERT INTO `wms_inventory_history` VALUES (152, 115, 1, 53, NULL, 100.00, NULL, 0, 115, '2022-12-10 15:31:02.873', NULL, NULL, 39, NULL); -INSERT INTO `wms_inventory_history` VALUES (153, 116, 1, 55, NULL, 1.00, NULL, 0, 115, '2022-12-10 17:01:54.526', NULL, NULL, 38, NULL); -INSERT INTO `wms_inventory_history` VALUES (154, 52, 11, 55, NULL, 1.00, NULL, 0, 115, '2022-12-10 17:04:23.458', NULL, NULL, 38, NULL); -INSERT INTO `wms_inventory_history` VALUES (155, 119, 1, 55, NULL, 1.00, NULL, 0, 115, '2022-12-12 13:16:36.860', NULL, NULL, 39, 60); -INSERT INTO `wms_inventory_history` VALUES (156, 53, 11, 55, NULL, 1.00, NULL, 0, 115, '2022-12-12 13:19:41.574', NULL, NULL, 39, NULL); -INSERT INTO `wms_inventory_history` VALUES (157, 130, 1, 60, NULL, 1.00, NULL, 0, 115, '2022-12-20 17:27:22.283', NULL, NULL, 42, NULL); -INSERT INTO `wms_inventory_history` VALUES (158, 133, 1, 60, NULL, 6.00, NULL, 0, 115, '2022-12-20 17:40:03.701', NULL, NULL, 40, NULL); -INSERT INTO `wms_inventory_history` VALUES (159, 133, 1, 60, NULL, 6.00, NULL, 0, 115, '2022-12-20 17:40:38.925', NULL, NULL, 40, NULL); -INSERT INTO `wms_inventory_history` VALUES (160, 135, 1, 60, NULL, 6.00, NULL, 0, 115, '2022-12-20 17:42:29.379', NULL, NULL, 38, 61); -INSERT INTO `wms_inventory_history` VALUES (161, 135, 1, 58, NULL, 8.00, NULL, 0, 115, '2022-12-20 17:42:29.379', NULL, NULL, 43, 62); -INSERT INTO `wms_inventory_history` VALUES (162, 135, 1, 60, NULL, 4.00, NULL, 0, 115, '2022-12-20 17:42:42.482', NULL, NULL, 38, 61); -INSERT INTO `wms_inventory_history` VALUES (163, 136, 1, 58, 28, 1.00, NULL, 0, 115, '2022-12-20 17:45:45.216', NULL, NULL, 38, 61); -INSERT INTO `wms_inventory_history` VALUES (164, 137, 1, 60, NULL, 8.00, NULL, 0, 115, '2022-12-20 17:58:02.786', NULL, NULL, 42, NULL); -INSERT INTO `wms_inventory_history` VALUES (165, 138, 1, 60, NULL, 1.00, NULL, 0, 115, '2022-12-20 17:59:47.967', NULL, NULL, 42, NULL); -INSERT INTO `wms_inventory_history` VALUES (166, 138, 1, 60, NULL, 4.00, NULL, 0, 115, '2022-12-20 18:00:01.168', NULL, NULL, 42, NULL); -INSERT INTO `wms_inventory_history` VALUES (167, 139, 1, 60, 29, 1.00, NULL, 0, 115, '2022-12-21 16:11:48.910', NULL, NULL, 38, 61); -INSERT INTO `wms_inventory_history` VALUES (168, 55, 11, 60, 29, 1.00, NULL, 0, 115, '2022-12-22 09:15:28.713', NULL, NULL, 38, 61); -INSERT INTO `wms_inventory_history` VALUES (169, 57, 11, 60, NULL, 1.00, NULL, 0, 115, '2022-12-22 09:43:54.738', NULL, NULL, 42, NULL); -INSERT INTO `wms_inventory_history` VALUES (170, 143, 1, 60, NULL, 1.00, NULL, 0, 115, '2022-12-22 12:35:50.445', NULL, NULL, 38, NULL); -INSERT INTO `wms_inventory_history` VALUES (171, 145, 1, 60, NULL, 1000.00, NULL, 0, 115, '2022-12-27 15:33:46.645', NULL, NULL, 45, 65); -INSERT INTO `wms_inventory_history` VALUES (172, 147, 1, 61, 29, 1.00, NULL, 0, 115, '2022-12-28 11:39:15.134', NULL, NULL, 38, 61); -INSERT INTO `wms_inventory_history` VALUES (173, 147, 1, 60, 29, 1.00, NULL, 0, 115, '2022-12-28 11:39:15.134', NULL, NULL, 38, 61); -INSERT INTO `wms_inventory_history` VALUES (174, 59, 11, 61, 29, 1.00, NULL, 0, 115, '2022-12-28 11:41:57.684', NULL, NULL, 38, 61); -INSERT INTO `wms_inventory_history` VALUES (175, 17, 21, 58, NULL, 1.00, NULL, 0, 115, '2022-12-28 13:42:51.754', NULL, NULL, 38, 61); -INSERT INTO `wms_inventory_history` VALUES (176, 17, 22, 58, NULL, 1.00, NULL, 0, 115, '2022-12-28 13:42:51.754', NULL, NULL, 42, 63); -INSERT INTO `wms_inventory_history` VALUES (177, 144, 1, 60, 30, 1.00, NULL, 0, 115, '2022-12-28 16:41:46.903', NULL, NULL, 43, 62); -INSERT INTO `wms_inventory_history` VALUES (178, 148, 1, 61, NULL, 13.00, NULL, 0, 115, '2022-12-28 17:11:04.415', NULL, NULL, 42, 63); -INSERT INTO `wms_inventory_history` VALUES (179, 148, 1, 58, NULL, 11.00, NULL, 0, 115, '2022-12-28 17:11:04.415', NULL, NULL, 45, 65); -INSERT INTO `wms_inventory_history` VALUES (180, 148, 1, 60, NULL, 1.00, NULL, 0, 115, '2022-12-28 17:11:26.578', NULL, NULL, 45, 65); -INSERT INTO `wms_inventory_history` VALUES (181, 149, 1, 61, NULL, 1.00, NULL, 0, 115, '2022-12-28 19:27:56.298', NULL, NULL, 42, 63); -INSERT INTO `wms_inventory_history` VALUES (182, 150, 1, 61, 29, 1.00, NULL, 0, 115, '2022-12-30 13:47:44.757', NULL, NULL, 38, 61); -INSERT INTO `wms_inventory_history` VALUES (183, 60, 11, 61, NULL, 1.00, NULL, 0, 115, '2023-01-03 10:38:07.700', NULL, NULL, 38, 61); -INSERT INTO `wms_inventory_history` VALUES (184, 152, 1, 60, NULL, 1.00, NULL, 0, 115, '2023-01-03 12:09:21.712', NULL, NULL, 45, 65); -INSERT INTO `wms_inventory_history` VALUES (185, 157, 1, 63, 31, 1.00, NULL, 0, 115, '2023-01-05 10:09:08.251', NULL, NULL, 50, 67); -INSERT INTO `wms_inventory_history` VALUES (186, 156, 1, 63, 31, 3.00, NULL, 0, 115, '2023-01-05 14:51:25.953', NULL, NULL, 50, 67); -INSERT INTO `wms_inventory_history` VALUES (187, 61, 11, 63, 31, 1.00, NULL, 0, 115, '2023-01-05 16:08:25.953', NULL, NULL, 50, 67); -INSERT INTO `wms_inventory_history` VALUES (188, 160, 1, 65, NULL, 1.00, NULL, 0, 115, '2023-01-05 18:30:12.564', NULL, NULL, 50, 69); -INSERT INTO `wms_inventory_history` VALUES (189, 160, 1, 63, 31, 1.00, NULL, 0, 115, '2023-01-06 08:02:26.975', NULL, NULL, 50, 70); -INSERT INTO `wms_inventory_history` VALUES (190, 160, 1, 62, 31, 1.00, NULL, 0, 115, '2023-01-06 08:02:26.975', NULL, NULL, 50, 70); -INSERT INTO `wms_inventory_history` VALUES (191, 161, 1, 63, 31, 1.00, NULL, 0, 115, '2023-01-06 14:18:47.047', NULL, NULL, 50, 70); -INSERT INTO `wms_inventory_history` VALUES (192, 63, 11, 65, NULL, 1.00, NULL, 0, 115, '2023-01-06 14:19:56.077', NULL, NULL, 50, 69); -INSERT INTO `wms_inventory_history` VALUES (193, 162, 1, 68, 34, 1.00, NULL, 0, 115, '2023-01-06 16:58:27.090', NULL, NULL, 53, 73); -INSERT INTO `wms_inventory_history` VALUES (194, 162, 1, 67, 34, 1.00, NULL, 0, 115, '2023-01-06 16:58:27.090', NULL, NULL, 53, 73); -INSERT INTO `wms_inventory_history` VALUES (195, 164, 1, 68, 34, 1.00, NULL, 0, 115, '2023-01-07 14:14:37.227', NULL, NULL, 53, 73); -INSERT INTO `wms_inventory_history` VALUES (196, 164, 1, 67, NULL, 1.00, NULL, 0, 115, '2023-01-07 14:14:48.184', NULL, NULL, 54, NULL); -INSERT INTO `wms_inventory_history` VALUES (197, 166, 1, 75, 38, 1.00, NULL, 0, 115, '2023-01-08 00:19:53.231', NULL, NULL, 61, 77); -INSERT INTO `wms_inventory_history` VALUES (198, 169, 1, 76, 43, 100.00, NULL, 0, 115, '2023-01-09 00:17:19.181', NULL, NULL, 61, 80); -INSERT INTO `wms_inventory_history` VALUES (199, 169, 1, 75, 38, 100.00, NULL, 0, 115, '2023-01-09 00:17:19.181', NULL, NULL, 61, 77); -INSERT INTO `wms_inventory_history` VALUES (200, 169, 1, 74, 38, 100.00, NULL, 0, 115, '2023-01-09 00:17:19.181', NULL, NULL, 61, 77); -INSERT INTO `wms_inventory_history` VALUES (201, 169, 1, 73, 37, 100.00, NULL, 0, 115, '2023-01-09 00:17:19.181', NULL, NULL, 61, 77); -INSERT INTO `wms_inventory_history` VALUES (202, 169, 1, 72, 37, 100.00, NULL, 0, 115, '2023-01-09 00:17:19.181', NULL, NULL, 61, 77); -INSERT INTO `wms_inventory_history` VALUES (203, 169, 1, 71, 37, 100.00, NULL, 0, 115, '2023-01-09 00:17:19.181', NULL, NULL, 61, 77); -INSERT INTO `wms_inventory_history` VALUES (204, 170, 2, 76, 43, 10000.00, NULL, 0, 115, '2023-01-09 00:18:51.714', NULL, NULL, 61, 80); -INSERT INTO `wms_inventory_history` VALUES (205, 170, 2, 75, 38, 100.00, NULL, 0, 115, '2023-01-09 00:18:51.714', NULL, NULL, 61, 77); -INSERT INTO `wms_inventory_history` VALUES (206, 170, 2, 74, 38, 100.00, NULL, 0, 115, '2023-01-09 00:18:51.714', NULL, NULL, 61, 77); -INSERT INTO `wms_inventory_history` VALUES (207, 170, 2, 73, 37, 10000.00, NULL, 0, 115, '2023-01-09 00:18:51.714', NULL, NULL, 61, 77); -INSERT INTO `wms_inventory_history` VALUES (208, 170, 2, 72, 37, 100000.00, NULL, 0, 115, '2023-01-09 00:18:51.714', NULL, NULL, 61, 77); -INSERT INTO `wms_inventory_history` VALUES (209, 170, 2, 71, 37, 1000.00, NULL, 0, 115, '2023-01-09 00:18:51.714', NULL, NULL, 61, 77); -INSERT INTO `wms_inventory_history` VALUES (210, 171, 2, 75, 38, 1.00, NULL, 0, 115, '2023-01-09 01:35:41.331', NULL, NULL, 61, 77); -INSERT INTO `wms_inventory_history` VALUES (211, 172, 1, 74, 37, 10.00, NULL, 0, 115, '2023-01-09 02:17:11.309', NULL, NULL, 61, 77); -INSERT INTO `wms_inventory_history` VALUES (212, 172, 1, 71, 38, 1000.00, NULL, 0, 115, '2023-01-09 02:17:11.309', NULL, NULL, 61, 77); -INSERT INTO `wms_inventory_history` VALUES (213, 68, 11, 75, 38, 1.00, NULL, 0, 115, '2023-01-09 02:49:33.186', NULL, NULL, 61, 77); -INSERT INTO `wms_inventory_history` VALUES (214, 173, 1, 75, 38, 1.00, NULL, 0, 115, '2023-01-11 16:49:13.009', NULL, NULL, 61, 77); -INSERT INTO `wms_inventory_history` VALUES (215, 173, 1, 74, 38, 1.00, NULL, 0, 115, '2023-01-11 16:49:13.009', NULL, NULL, 61, 77); -INSERT INTO `wms_inventory_history` VALUES (216, 173, 1, 73, 37, 1.00, NULL, 0, 115, '2023-01-11 16:49:13.009', NULL, NULL, 61, 77); -INSERT INTO `wms_inventory_history` VALUES (217, 173, 1, 72, 37, 1.00, NULL, 0, 115, '2023-01-11 16:49:13.009', NULL, NULL, 61, 77); -INSERT INTO `wms_inventory_history` VALUES (218, 173, 1, 71, 37, 1.00, NULL, 0, 115, '2023-01-11 16:49:13.009', NULL, NULL, 61, 77); -INSERT INTO `wms_inventory_history` VALUES (219, 174, 1, 77, 47, 1.00, NULL, 0, 115, '2023-01-11 20:49:04.483', NULL, NULL, 64, 82); -INSERT INTO `wms_inventory_history` VALUES (220, 174, 1, 74, 47, 1.00, NULL, 0, 115, '2023-01-11 20:49:04.483', NULL, NULL, 64, 82); -INSERT INTO `wms_inventory_history` VALUES (221, 174, 1, 71, 37, 1.00, NULL, 0, 115, '2023-01-11 20:49:04.483', NULL, NULL, 61, 77); -INSERT INTO `wms_inventory_history` VALUES (222, 180, 3, 78, 49, 1.00, NULL, 0, 115, '2023-01-13 14:59:32.692', NULL, NULL, 67, 84); -INSERT INTO `wms_inventory_history` VALUES (223, 181, 1, 78, NULL, 12.00, NULL, 0, 115, '2023-01-13 19:26:39.259', NULL, NULL, 69, NULL); -INSERT INTO `wms_inventory_history` VALUES (224, 75, 11, 78, NULL, 4.00, NULL, 0, 115, '2023-01-13 19:27:25.747', NULL, NULL, 69, NULL); -INSERT INTO `wms_inventory_history` VALUES (225, 179, 1, 78, NULL, 1.00, NULL, 0, 115, '2023-01-15 10:08:00.562', NULL, NULL, 69, NULL); -INSERT INTO `wms_inventory_history` VALUES (226, 182, 1, 80, NULL, 1.00, NULL, 0, 115, '2023-01-16 11:15:08.481', NULL, NULL, 65, 86); -INSERT INTO `wms_inventory_history` VALUES (227, 183, 1, 80, 51, 122.00, NULL, 0, 115, '2023-01-16 11:17:07.415', NULL, NULL, 65, 86); -INSERT INTO `wms_inventory_history` VALUES (228, 76, 11, 80, 51, 4.00, NULL, 0, 115, '2023-01-16 11:17:34.786', NULL, NULL, 65, 86); -INSERT INTO `wms_inventory_history` VALUES (229, 186, 1, 80, 51, 1.00, NULL, 0, 115, '2023-01-17 10:31:15.871', NULL, NULL, 65, 86); -INSERT INTO `wms_inventory_history` VALUES (230, 77, 11, 80, 51, 1.00, NULL, 0, 115, '2023-01-18 15:17:39.825', NULL, NULL, 65, 86); -INSERT INTO `wms_inventory_history` VALUES (231, 189, 1, 80, 51, 9.00, NULL, 0, 115, '2023-01-18 15:19:43.569', NULL, NULL, 65, 86); -INSERT INTO `wms_inventory_history` VALUES (232, 189, 1, 79, 50, 9.00, NULL, 0, 115, '2023-01-18 15:19:43.569', NULL, NULL, 65, 86); -INSERT INTO `wms_inventory_history` VALUES (233, 189, 1, 78, NULL, 9.00, NULL, 0, 115, '2023-01-18 15:19:43.569', NULL, NULL, 69, NULL); -INSERT INTO `wms_inventory_history` VALUES (234, 191, 3, 80, NULL, 1.00, NULL, 0, 115, '2023-01-21 12:20:07.315', NULL, NULL, 65, 86); -INSERT INTO `wms_inventory_history` VALUES (235, 191, 3, 79, 50, 1.00, NULL, 0, 115, '2023-01-21 12:20:07.315', NULL, NULL, 65, 86); -INSERT INTO `wms_inventory_history` VALUES (236, 191, 3, 78, NULL, 1.00, NULL, 0, 115, '2023-01-21 12:20:07.315', NULL, NULL, 69, NULL); -INSERT INTO `wms_inventory_history` VALUES (237, 192, 1, 80, 49, 1.00, NULL, 0, 115, '2023-01-23 16:33:55.404', NULL, NULL, 68, 85); -INSERT INTO `wms_inventory_history` VALUES (238, 193, 1, 79, 50, 1.00, NULL, 0, 115, '2023-01-23 20:23:34.164', NULL, NULL, 65, 86); -INSERT INTO `wms_inventory_history` VALUES (239, 194, 1, 80, NULL, 1.00, NULL, 0, 115, '2023-01-25 15:12:03.871', NULL, NULL, 66, 87); -INSERT INTO `wms_inventory_history` VALUES (240, 196, 1, 80, NULL, 2.00, NULL, 0, 115, '2023-01-25 17:24:35.629', NULL, NULL, 67, 84); -INSERT INTO `wms_inventory_history` VALUES (241, 199, 1, 87, NULL, 1.00, NULL, 0, 115, '2023-01-28 12:40:38.288', NULL, NULL, 66, 87); -INSERT INTO `wms_inventory_history` VALUES (242, 207, 1, 88, 50, 1.00, NULL, 0, 115, '2023-01-31 11:53:58.497', NULL, NULL, 66, 86); -INSERT INTO `wms_inventory_history` VALUES (243, 26, 21, 88, NULL, 1.00, NULL, 0, 115, '2023-01-31 11:57:19.243', NULL, NULL, 66, 86); -INSERT INTO `wms_inventory_history` VALUES (244, 26, 22, 88, NULL, 1.00, NULL, 0, 115, '2023-01-31 11:57:19.243', NULL, NULL, 67, NULL); -INSERT INTO `wms_inventory_history` VALUES (245, 208, 1, 88, 49, 1.00, NULL, 0, 115, '2023-01-31 14:09:17.798', NULL, NULL, 74, 84); -INSERT INTO `wms_inventory_history` VALUES (246, 210, 1, 88, NULL, 1.00, NULL, 0, 115, '2023-01-31 16:23:22.418', NULL, NULL, 74, NULL); -INSERT INTO `wms_inventory_history` VALUES (247, 211, 1, 88, 49, 1.00, NULL, 0, 115, '2023-01-31 16:37:03.764', NULL, NULL, 68, 85); -INSERT INTO `wms_inventory_history` VALUES (248, 212, 1, 88, NULL, 1.00, NULL, 0, 115, '2023-01-31 16:38:29.458', NULL, NULL, 74, NULL); -INSERT INTO `wms_inventory_history` VALUES (249, 86, 11, 88, 49, 1.00, NULL, 0, 115, '2023-01-31 16:39:58.316', NULL, NULL, 68, 85); -INSERT INTO `wms_inventory_history` VALUES (250, 217, 1, 89, 50, 500.00, NULL, 0, 115, '2023-02-01 22:08:22.032', NULL, NULL, 76, 89); -INSERT INTO `wms_inventory_history` VALUES (251, 88, 11, 89, 50, 10.00, NULL, 0, 115, '2023-02-01 22:09:50.841', NULL, NULL, 76, 89); -INSERT INTO `wms_inventory_history` VALUES (252, 218, 1, 90, 49, 1.00, NULL, 0, 115, '2023-02-02 15:07:16.272', NULL, NULL, 75, 90); -INSERT INTO `wms_inventory_history` VALUES (253, 90, 11, 90, NULL, 1.00, NULL, 0, 115, '2023-02-02 15:08:54.691', NULL, NULL, 75, 90); -INSERT INTO `wms_inventory_history` VALUES (254, 220, 1, 89, NULL, 1.00, NULL, 0, 115, '2023-02-02 15:11:59.384', NULL, NULL, 75, NULL); -INSERT INTO `wms_inventory_history` VALUES (255, 91, 11, 89, NULL, 1.00, NULL, 0, 115, '2023-02-02 15:12:45.107', NULL, NULL, 75, NULL); -INSERT INTO `wms_inventory_history` VALUES (256, 223, 1, 91, 50, 1.00, NULL, 0, 115, '2023-02-02 22:07:16.210', NULL, NULL, 76, 89); -INSERT INTO `wms_inventory_history` VALUES (257, 222, 1, 91, 50, 1.00, NULL, 0, 115, '2023-02-02 22:08:31.981', NULL, NULL, 76, 89); -INSERT INTO `wms_inventory_history` VALUES (258, 226, 1, 91, 50, 1.00, NULL, 0, 115, '2023-02-03 15:29:26.719', NULL, NULL, 76, 89); -INSERT INTO `wms_inventory_history` VALUES (259, 228, 1, 91, 49, 1.00, NULL, 0, 115, '2023-02-04 00:31:27.938', NULL, NULL, 75, 90); -INSERT INTO `wms_inventory_history` VALUES (260, 229, 1, 91, NULL, 1.00, NULL, 0, 115, '2023-02-04 03:00:15.398', NULL, NULL, 75, 90); -INSERT INTO `wms_inventory_history` VALUES (261, 230, 2, 90, 52, 1.00, NULL, 0, 115, '2023-02-04 08:54:14.668', NULL, NULL, 78, 92); -INSERT INTO `wms_inventory_history` VALUES (262, 231, 1, 91, 52, 1.00, NULL, 0, 115, '2023-02-04 16:09:45.164', NULL, NULL, 78, 92); -INSERT INTO `wms_inventory_history` VALUES (263, 233, 1, 92, 52, 6.00, NULL, 0, 115, '2023-02-04 16:11:45.684', NULL, NULL, 78, 92); -INSERT INTO `wms_inventory_history` VALUES (264, 234, 1, 93, 52, 1.00, NULL, 0, 115, '2023-02-04 16:36:29.666', NULL, NULL, 78, 92); -INSERT INTO `wms_inventory_history` VALUES (265, 97, 11, 92, 52, 1.00, NULL, 0, 115, '2023-02-04 16:38:06.184', NULL, NULL, 78, 92); -INSERT INTO `wms_inventory_history` VALUES (266, 29, 21, 90, 49, 1.00, NULL, 0, 115, '2023-02-04 18:00:58.909', NULL, NULL, 75, 90); -INSERT INTO `wms_inventory_history` VALUES (267, 29, 22, 90, 51, 1.00, NULL, 0, 115, '2023-02-04 18:00:58.909', NULL, NULL, 77, 91); -INSERT INTO `wms_inventory_history` VALUES (268, 236, 1, 91, 51, 3.00, NULL, 0, 115, '2023-02-04 20:29:37.608', NULL, NULL, 77, 91); -INSERT INTO `wms_inventory_history` VALUES (269, 237, 1, 93, 52, 4.00, NULL, 0, 115, '2023-02-04 20:50:32.317', NULL, NULL, 78, 92); -INSERT INTO `wms_inventory_history` VALUES (270, 237, 1, 91, 50, 1.00, NULL, 0, 115, '2023-02-04 20:50:32.317', NULL, NULL, 76, 89); -INSERT INTO `wms_inventory_history` VALUES (271, 237, 1, 90, 49, 1.00, NULL, 0, 115, '2023-02-04 20:50:32.317', NULL, NULL, 75, 90); -INSERT INTO `wms_inventory_history` VALUES (272, 238, 1, 94, 49, 1.00, NULL, 0, 115, '2023-02-06 11:51:05.714', NULL, NULL, 75, 90); -INSERT INTO `wms_inventory_history` VALUES (273, 99, 11, 94, 49, 1.00, NULL, 0, 115, '2023-02-06 11:51:14.576', NULL, NULL, 75, 90); -INSERT INTO `wms_inventory_history` VALUES (274, 239, 1, 93, 50, 1.00, NULL, 0, 115, '2023-02-06 13:54:18.205', NULL, NULL, 76, 89); -INSERT INTO `wms_inventory_history` VALUES (275, 239, 1, 91, 51, 1.00, NULL, 0, 115, '2023-02-06 13:54:18.205', NULL, NULL, 77, 91); -INSERT INTO `wms_inventory_history` VALUES (276, 240, 1, 94, 53, 1.00, NULL, 0, 115, '2023-02-06 14:13:36.576', NULL, NULL, 83, 94); -INSERT INTO `wms_inventory_history` VALUES (277, 240, 1, 93, 53, 1.00, NULL, 0, 115, '2023-02-06 14:13:36.576', NULL, NULL, 83, 94); -INSERT INTO `wms_inventory_history` VALUES (278, 232, 1, 91, 49, 1.00, NULL, 0, 115, '2023-02-06 14:13:47.127', NULL, NULL, 75, 90); -INSERT INTO `wms_inventory_history` VALUES (279, 240, 1, 92, 53, 1.00, NULL, 0, 115, '2023-02-06 15:13:22.518', NULL, NULL, 83, 94); -INSERT INTO `wms_inventory_history` VALUES (280, 100, 11, 94, 53, 1.00, NULL, 0, 115, '2023-02-06 15:15:14.130', NULL, NULL, 83, 94); -INSERT INTO `wms_inventory_history` VALUES (281, 100, 11, 93, 53, 1.00, NULL, 0, 115, '2023-02-06 15:15:14.130', NULL, NULL, 83, 94); -INSERT INTO `wms_inventory_history` VALUES (282, 241, 1, 95, NULL, 1.00, NULL, 0, 115, '2023-02-06 15:21:15.356', NULL, NULL, 84, NULL); -INSERT INTO `wms_inventory_history` VALUES (283, 101, 11, 95, NULL, 1.00, NULL, 0, 115, '2023-02-06 15:22:34.727', NULL, NULL, 84, NULL); -INSERT INTO `wms_inventory_history` VALUES (284, 243, 1, 95, NULL, 1.00, NULL, 0, 115, '2023-02-07 09:21:35.184', NULL, NULL, 84, NULL); -INSERT INTO `wms_inventory_history` VALUES (285, 243, 1, 94, NULL, 1.00, NULL, 0, 115, '2023-02-07 09:21:35.184', NULL, NULL, 85, 95); -INSERT INTO `wms_inventory_history` VALUES (286, 104, 11, 95, NULL, 1.00, NULL, 0, 115, '2023-02-07 18:50:16.067', NULL, NULL, 84, NULL); -INSERT INTO `wms_inventory_history` VALUES (287, 249, 1, 96, 56, 1.00, NULL, 0, 115, '2023-02-08 09:16:11.414', NULL, NULL, 86, 98); -INSERT INTO `wms_inventory_history` VALUES (288, 249, 1, 97, 55, 1.00, NULL, 0, 115, '2023-02-08 09:16:11.414', NULL, NULL, 86, 98); -INSERT INTO `wms_inventory_history` VALUES (289, 250, 1, 94, 55, 1.00, NULL, 0, 115, '2023-02-08 09:35:44.276', NULL, NULL, 86, 98); -INSERT INTO `wms_inventory_history` VALUES (290, 251, 1, 94, NULL, 1.00, NULL, 0, 115, '2023-02-08 09:36:43.829', NULL, NULL, 85, 95); -INSERT INTO `wms_inventory_history` VALUES (291, 252, 1, 97, 49, 2.00, NULL, 0, 115, '2023-02-08 10:40:33.286', NULL, NULL, 84, 96); -INSERT INTO `wms_inventory_history` VALUES (292, 253, 1, 97, NULL, 1.00, NULL, 0, 115, '2023-02-08 11:38:59.140', NULL, NULL, 85, 95); -INSERT INTO `wms_inventory_history` VALUES (293, 253, 1, 96, 55, 1.00, NULL, 0, 115, '2023-02-08 11:38:59.140', NULL, NULL, 86, 98); -INSERT INTO `wms_inventory_history` VALUES (294, 254, 1, 99, 57, 100.00, NULL, 0, 115, '2023-02-08 16:40:11.370', NULL, NULL, 87, 100); -INSERT INTO `wms_inventory_history` VALUES (295, 34, 21, 99, 57, 1.00, NULL, 0, 115, '2023-02-08 16:43:52.713', NULL, NULL, 87, 100); -INSERT INTO `wms_inventory_history` VALUES (296, 34, 22, 99, 55, 1.00, NULL, 0, 115, '2023-02-08 16:43:52.713', NULL, NULL, 86, 98); -INSERT INTO `wms_inventory_history` VALUES (297, 257, 1, 99, 53, 1.00, NULL, 0, 115, '2023-02-09 14:27:51.811', NULL, NULL, 83, 94); -INSERT INTO `wms_inventory_history` VALUES (298, 35, 21, 99, 53, 1.00, NULL, 0, 115, '2023-02-09 14:49:06.371', NULL, NULL, 83, 94); -INSERT INTO `wms_inventory_history` VALUES (299, 35, 22, 99, NULL, 1.00, NULL, 0, 115, '2023-02-09 14:49:06.371', NULL, NULL, 84, NULL); -INSERT INTO `wms_inventory_history` VALUES (300, 261, 3, 100, 49, 1.00, NULL, 0, 115, '2023-02-10 15:50:01.962', NULL, NULL, 84, 96); -INSERT INTO `wms_inventory_history` VALUES (301, 262, 3, 101, NULL, 1.00, NULL, 0, 115, '2023-02-10 15:56:53.558', NULL, NULL, 89, 103); -INSERT INTO `wms_inventory_history` VALUES (302, 114, 13, 101, NULL, 1.00, NULL, 0, 115, '2023-02-10 15:57:49.144', NULL, NULL, 89, 103); -INSERT INTO `wms_inventory_history` VALUES (303, 260, 2, 93, 49, 2.00, NULL, 0, 115, '2023-02-11 11:10:58.894', NULL, NULL, 84, 96); -INSERT INTO `wms_inventory_history` VALUES (304, 260, 2, 94, NULL, 2.00, NULL, 0, 115, '2023-02-11 11:10:58.894', NULL, NULL, 86, 99); -INSERT INTO `wms_inventory_history` VALUES (305, 263, 1, 99, NULL, 150.00, NULL, 0, 115, '2023-02-11 19:02:04.517', NULL, NULL, 91, 108); -INSERT INTO `wms_inventory_history` VALUES (306, 264, 1, 101, 61, 2.00, NULL, 0, 115, '2023-02-11 19:04:58.594', NULL, NULL, 91, 105); -INSERT INTO `wms_inventory_history` VALUES (307, 264, 1, 99, 61, 3.00, NULL, 0, 115, '2023-02-11 19:04:58.594', NULL, NULL, 91, 105); -INSERT INTO `wms_inventory_history` VALUES (308, 265, 1, 101, 61, 10.00, NULL, 0, 115, '2023-02-11 20:17:33.109', NULL, NULL, 91, 105); -INSERT INTO `wms_inventory_history` VALUES (309, 265, 1, 99, NULL, 10.00, NULL, 0, 115, '2023-02-11 20:17:33.109', NULL, NULL, 91, 106); -INSERT INTO `wms_inventory_history` VALUES (310, 258, 1, 100, 49, 1.00, NULL, 0, 115, '2023-02-12 11:11:02.993', NULL, NULL, 84, 96); -INSERT INTO `wms_inventory_history` VALUES (311, 264, 1, 101, 61, 3.00, NULL, 0, 115, '2023-02-12 11:12:08.963', NULL, NULL, 91, 105); -INSERT INTO `wms_inventory_history` VALUES (312, 264, 1, 99, 61, 2.00, NULL, 0, 115, '2023-02-12 11:12:08.963', NULL, NULL, 91, 105); -INSERT INTO `wms_inventory_history` VALUES (313, 271, 1, 103, NULL, 1.00, NULL, 0, 115, '2023-02-13 11:35:41.675', NULL, NULL, 86, 99); -INSERT INTO `wms_inventory_history` VALUES (314, 271, 1, 102, 57, 1.00, NULL, 0, 115, '2023-02-13 11:36:15.364', NULL, NULL, 87, 100); -INSERT INTO `wms_inventory_history` VALUES (315, 273, 1, 103, 55, 1.00, NULL, 0, 115, '2023-02-13 11:38:39.748', NULL, NULL, 86, 98); -INSERT INTO `wms_inventory_history` VALUES (316, 273, 1, 102, 56, 1.00, NULL, 0, 115, '2023-02-13 11:38:39.748', NULL, NULL, 86, 98); -INSERT INTO `wms_inventory_history` VALUES (317, 274, 1, 103, 57, 5.00, NULL, 0, 115, '2023-02-13 11:40:48.863', NULL, NULL, 87, 100); -INSERT INTO `wms_inventory_history` VALUES (318, 274, 1, 102, 61, 9.00, NULL, 0, 115, '2023-02-13 11:40:48.863', NULL, NULL, 91, 105); -INSERT INTO `wms_inventory_history` VALUES (319, 275, 1, 103, 55, 1.00, NULL, 0, 115, '2023-02-13 16:26:38.792', NULL, NULL, 86, 98); -INSERT INTO `wms_inventory_history` VALUES (320, 119, 11, 103, 55, 1.00, NULL, 0, 115, '2023-02-13 17:21:47.932', NULL, NULL, 86, 98); -INSERT INTO `wms_inventory_history` VALUES (321, 277, 1, 104, NULL, 1000.00, NULL, 0, 115, '2023-02-14 09:32:14.452', NULL, NULL, 88, NULL); -INSERT INTO `wms_inventory_history` VALUES (322, 278, 1, 104, NULL, 1.00, NULL, 0, 115, '2023-02-14 09:48:07.474', NULL, NULL, 88, NULL); -INSERT INTO `wms_inventory_history` VALUES (323, 279, 1, 104, NULL, 2.00, NULL, 0, 115, '2023-02-14 17:24:04.134', NULL, NULL, 88, NULL); -INSERT INTO `wms_inventory_history` VALUES (324, 279, 1, 103, 55, 2.00, NULL, 0, 115, '2023-02-14 17:24:04.134', NULL, NULL, 86, 98); -INSERT INTO `wms_inventory_history` VALUES (325, 284, 1, 105, NULL, 4.00, NULL, 0, 115, '2023-02-15 11:30:11.903', NULL, NULL, 93, NULL); -INSERT INTO `wms_inventory_history` VALUES (326, 117, 11, 103, 55, 1.00, NULL, 0, 115, '2023-02-15 12:10:33.974', NULL, NULL, 86, 98); -INSERT INTO `wms_inventory_history` VALUES (327, 286, 1, 107, 64, 8888.00, NULL, 0, 115, '2023-02-15 15:09:57.324', NULL, NULL, 95, 111); -INSERT INTO `wms_inventory_history` VALUES (328, 292, 1, 108, 65, 15.00, NULL, 0, 115, '2023-02-16 15:19:19.829', NULL, NULL, 98, 112); -INSERT INTO `wms_inventory_history` VALUES (329, 293, 3, 110, 66, 1.00, NULL, 0, 115, '2023-02-17 10:56:03.259', NULL, NULL, 101, 115); -INSERT INTO `wms_inventory_history` VALUES (330, 294, 1, 110, 66, 14.00, NULL, 0, 115, '2023-02-17 11:13:17.734', NULL, NULL, 101, 115); -INSERT INTO `wms_inventory_history` VALUES (331, 295, 1, 111, 67, 10.00, NULL, 0, 115, '2023-02-17 13:21:49.739', NULL, NULL, 102, 116); -INSERT INTO `wms_inventory_history` VALUES (332, 120, 11, 111, 67, 1.00, NULL, 0, 115, '2023-02-17 13:22:13.027', NULL, NULL, 102, 116); -INSERT INTO `wms_inventory_history` VALUES (333, 297, 1, 113, 67, 1.00, NULL, 0, 115, '2023-02-17 15:52:07.260', NULL, NULL, 102, 116); -INSERT INTO `wms_inventory_history` VALUES (334, 296, 1, 112, 67, 1.00, NULL, 0, 115, '2023-02-17 15:52:30.917', NULL, NULL, 102, 116); -INSERT INTO `wms_inventory_history` VALUES (335, 301, 1, 115, 67, 1.00, NULL, 0, 115, '2023-02-18 00:32:00.457', NULL, NULL, 101, 115); -INSERT INTO `wms_inventory_history` VALUES (336, 301, 1, 114, 67, 1.00, NULL, 0, 115, '2023-02-18 00:32:00.457', NULL, NULL, 101, 115); -INSERT INTO `wms_inventory_history` VALUES (337, 303, 1, 111, 67, 1.00, NULL, 0, 115, '2023-02-19 23:33:13.563', NULL, NULL, 104, 117); -INSERT INTO `wms_inventory_history` VALUES (338, 300, 2, 114, 67, 1.00, NULL, 0, 115, '2023-02-20 10:41:13.520', NULL, NULL, 102, 116); -INSERT INTO `wms_inventory_history` VALUES (339, 306, 1, 115, NULL, 10.00, NULL, 0, 115, '2023-02-21 10:32:34.977', NULL, NULL, 105, NULL); -INSERT INTO `wms_inventory_history` VALUES (340, 304, 1, 115, NULL, 1.00, NULL, 0, 115, '2023-02-21 10:41:20.278', NULL, NULL, 105, NULL); -INSERT INTO `wms_inventory_history` VALUES (341, 307, 1, 117, 68, 999.00, NULL, 0, 115, '2023-02-21 14:19:02.938', NULL, NULL, 106, 118); -INSERT INTO `wms_inventory_history` VALUES (342, 125, 11, 117, 68, 100.00, NULL, 0, 115, '2023-02-21 14:19:36.490', NULL, NULL, 106, 118); -INSERT INTO `wms_inventory_history` VALUES (343, 48, 21, 117, 68, 1.00, NULL, 0, 115, '2023-02-21 14:21:05.766', NULL, NULL, 106, 118); -INSERT INTO `wms_inventory_history` VALUES (344, 48, 22, 117, NULL, 1.00, NULL, 0, 115, '2023-02-21 14:21:05.766', NULL, NULL, 105, NULL); -INSERT INTO `wms_inventory_history` VALUES (345, 312, 1, 117, 68, 1.00, NULL, 0, 115, '2023-02-22 07:22:49.661', NULL, NULL, 106, 118); -INSERT INTO `wms_inventory_history` VALUES (346, 127, 11, 117, NULL, 1.00, NULL, 0, 115, '2023-02-22 14:00:20.315', NULL, NULL, 106, NULL); -INSERT INTO `wms_inventory_history` VALUES (347, 130, 11, 117, 68, 1.00, NULL, 0, 115, '2023-02-22 17:22:06.413', NULL, NULL, 106, 118); -INSERT INTO `wms_inventory_history` VALUES (348, 317, 1, 112, 66, 1.00, NULL, 0, 115, '2023-02-22 20:05:14.148', NULL, NULL, 101, 115); -INSERT INTO `wms_inventory_history` VALUES (349, 317, 1, 110, 66, 1.00, NULL, 0, 115, '2023-02-22 20:05:14.148', NULL, NULL, 101, 115); -INSERT INTO `wms_inventory_history` VALUES (350, 133, 13, 117, 68, 1.00, NULL, 0, 115, '2023-02-23 14:59:15.442', NULL, NULL, 106, 118); -INSERT INTO `wms_inventory_history` VALUES (351, 316, 1, 117, 68, 1.00, NULL, 0, 115, '2023-02-23 15:33:07.261', NULL, NULL, 106, 118); -INSERT INTO `wms_inventory_history` VALUES (352, 132, 11, 117, 68, 1.00, NULL, 0, 115, '2023-02-23 15:33:25.230', NULL, NULL, 106, 118); -INSERT INTO `wms_inventory_history` VALUES (353, 129, 11, 117, 68, 1.00, NULL, 0, 115, '2023-02-23 15:33:40.852', NULL, NULL, 106, 118); -INSERT INTO `wms_inventory_history` VALUES (354, 320, 1, 114, NULL, 1.00, NULL, 0, 115, '2023-02-23 22:16:22.924', NULL, NULL, 107, NULL); -INSERT INTO `wms_inventory_history` VALUES (355, 320, 1, 112, NULL, 1.00, NULL, 0, 115, '2023-02-23 22:16:22.924', NULL, NULL, 107, NULL); -INSERT INTO `wms_inventory_history` VALUES (356, 323, 1, 117, 68, 1.00, NULL, 0, 115, '2023-02-24 15:24:09.533', NULL, NULL, 106, 118); -INSERT INTO `wms_inventory_history` VALUES (357, 323, 1, 115, 67, 1.00, NULL, 0, 115, '2023-02-24 15:24:09.533', NULL, NULL, 104, 117); -INSERT INTO `wms_inventory_history` VALUES (358, 323, 1, 114, 67, 1.00, NULL, 0, 115, '2023-02-24 15:24:09.533', NULL, NULL, 102, 116); -INSERT INTO `wms_inventory_history` VALUES (359, 323, 1, 113, 67, 1.00, NULL, 0, 115, '2023-02-24 15:24:09.533', NULL, NULL, 102, 116); -INSERT INTO `wms_inventory_history` VALUES (360, 324, 1, 117, 71, 1.00, NULL, 0, 115, '2023-02-24 15:28:30.427', NULL, NULL, 109, 120); -INSERT INTO `wms_inventory_history` VALUES (361, 325, 1, 117, 71, 1.00, NULL, 0, 115, '2023-02-24 16:36:51.134', NULL, NULL, 109, 120); -INSERT INTO `wms_inventory_history` VALUES (362, 325, 1, 112, 66, 1.00, NULL, 0, 115, '2023-02-24 16:36:51.134', NULL, NULL, 101, 115); -INSERT INTO `wms_inventory_history` VALUES (363, 138, 11, 117, 71, 1.00, NULL, 0, 115, '2023-02-24 16:38:24.366', NULL, NULL, 109, 120); -INSERT INTO `wms_inventory_history` VALUES (364, 138, 11, 112, 66, 1.00, NULL, 0, 115, '2023-02-24 16:38:24.366', NULL, NULL, 101, 115); -INSERT INTO `wms_inventory_history` VALUES (365, 326, 1, 117, NULL, 2.00, NULL, 0, 115, '2023-02-25 00:41:10.262', NULL, NULL, 111, 121); -INSERT INTO `wms_inventory_history` VALUES (366, 326, 1, 112, NULL, 1.00, NULL, 0, 115, '2023-02-25 00:41:10.262', NULL, NULL, 111, 121); -INSERT INTO `wms_inventory_history` VALUES (367, 333, 3, 119, NULL, 1.00, NULL, 0, 115, '2023-02-26 15:13:26.023', NULL, NULL, 111, NULL); -INSERT INTO `wms_inventory_history` VALUES (368, 334, 1, 119, NULL, 1.00, NULL, 0, 115, '2023-02-26 15:17:09.367', NULL, NULL, 111, NULL); -INSERT INTO `wms_inventory_history` VALUES (369, 334, 1, 118, NULL, 1.00, NULL, 0, 115, '2023-02-26 15:17:09.367', NULL, NULL, 111, NULL); -INSERT INTO `wms_inventory_history` VALUES (370, 334, 1, 118, NULL, 1.00, NULL, 0, 115, '2023-02-26 17:55:39.094', NULL, NULL, 111, NULL); -INSERT INTO `wms_inventory_history` VALUES (371, 336, 1, 121, NULL, 1.00, NULL, 0, 115, '2023-02-27 10:20:16.142', NULL, NULL, 111, NULL); -INSERT INTO `wms_inventory_history` VALUES (372, 336, 1, 119, NULL, 1.00, NULL, 0, 115, '2023-02-27 10:20:16.142', NULL, NULL, 111, NULL); -INSERT INTO `wms_inventory_history` VALUES (373, 337, 1, 122, NULL, 1.00, NULL, 0, 115, '2023-02-27 10:36:12.832', NULL, NULL, 115, 125); -INSERT INTO `wms_inventory_history` VALUES (374, 142, 11, 122, NULL, 1.00, NULL, 0, 115, '2023-02-27 10:36:27.664', NULL, NULL, 115, 125); -INSERT INTO `wms_inventory_history` VALUES (375, 339, 1, 121, NULL, 6.00, NULL, 0, 115, '2023-02-27 12:33:01.009', NULL, NULL, 111, NULL); -INSERT INTO `wms_inventory_history` VALUES (376, 339, 1, 120, NULL, 5.00, NULL, 0, 115, '2023-02-27 12:33:01.009', NULL, NULL, 111, NULL); -INSERT INTO `wms_inventory_history` VALUES (377, 339, 1, 119, NULL, 6.00, NULL, 0, 115, '2023-02-27 12:33:01.009', NULL, NULL, 111, NULL); -INSERT INTO `wms_inventory_history` VALUES (378, 339, 1, 118, NULL, 6.00, NULL, 0, 115, '2023-02-27 12:33:01.009', NULL, NULL, 111, NULL); -INSERT INTO `wms_inventory_history` VALUES (379, 143, 11, 121, NULL, 1.00, NULL, 0, 115, '2023-02-27 12:34:17.334', NULL, NULL, 111, NULL); -INSERT INTO `wms_inventory_history` VALUES (380, 143, 11, 120, NULL, 1.00, NULL, 0, 115, '2023-02-27 12:34:17.334', NULL, NULL, 111, NULL); -INSERT INTO `wms_inventory_history` VALUES (381, 341, 1, 121, NULL, 1.00, NULL, 0, 115, '2023-02-27 22:45:36.773', NULL, NULL, 114, NULL); -INSERT INTO `wms_inventory_history` VALUES (382, 341, 1, 120, NULL, 1.00, NULL, 0, 115, '2023-02-27 22:45:36.773', NULL, NULL, 114, NULL); -INSERT INTO `wms_inventory_history` VALUES (383, 341, 1, 119, NULL, 1.00, NULL, 0, 115, '2023-02-27 22:45:36.773', NULL, NULL, 114, NULL); -INSERT INTO `wms_inventory_history` VALUES (384, 341, 1, 118, NULL, 1.00, NULL, 0, 115, '2023-02-27 22:45:36.773', NULL, NULL, 114, NULL); -INSERT INTO `wms_inventory_history` VALUES (385, 343, 1, 121, NULL, 1.00, NULL, 0, 115, '2023-02-28 00:16:22.640', NULL, NULL, 113, NULL); -INSERT INTO `wms_inventory_history` VALUES (386, 342, 1, 121, NULL, 1.00, NULL, 0, 115, '2023-02-28 00:16:38.741', NULL, NULL, 113, NULL); -INSERT INTO `wms_inventory_history` VALUES (387, 55, 21, 121, NULL, 1.00, NULL, 0, 115, '2023-02-28 11:07:08.767', NULL, NULL, 111, NULL); -INSERT INTO `wms_inventory_history` VALUES (388, 55, 22, 121, NULL, 1.00, NULL, 0, 115, '2023-02-28 11:07:08.767', NULL, NULL, 113, NULL); -INSERT INTO `wms_inventory_history` VALUES (389, 344, 1, 121, NULL, 1.00, NULL, 0, 115, '2023-02-28 11:08:42.068', NULL, NULL, 111, NULL); -INSERT INTO `wms_inventory_history` VALUES (390, 348, 2, 121, 74, 322424.00, NULL, 0, 115, '2023-03-01 03:09:32.710', NULL, NULL, 116, 126); -INSERT INTO `wms_inventory_history` VALUES (391, 348, 2, 120, 74, 234324224.00, NULL, 0, 115, '2023-03-01 03:09:32.710', NULL, NULL, 116, 126); -INSERT INTO `wms_inventory_history` VALUES (392, 349, 1, 121, NULL, 100.00, NULL, 0, 115, '2023-03-01 10:26:33.717', NULL, NULL, 116, NULL); -INSERT INTO `wms_inventory_history` VALUES (393, 352, 1, 123, 74, 500.00, NULL, 0, 115, '2023-03-01 16:06:21.730', NULL, NULL, 116, 126); -INSERT INTO `wms_inventory_history` VALUES (394, 355, 1, 123, 74, 2147483647.00, NULL, 0, 115, '2023-03-01 17:29:30.101', NULL, NULL, 116, 126); -INSERT INTO `wms_inventory_history` VALUES (395, 356, 1, 125, 77, 1.00, NULL, 0, 115, '2023-03-01 18:04:56.693', NULL, NULL, 118, 128); -INSERT INTO `wms_inventory_history` VALUES (396, 356, 1, 124, 76, 1.00, NULL, 0, 115, '2023-03-01 18:04:56.693', NULL, NULL, 119, 131); -INSERT INTO `wms_inventory_history` VALUES (397, 357, 1, 125, 77, 1000.00, NULL, 0, 115, '2023-03-02 09:21:54.230', NULL, NULL, 118, 128); -INSERT INTO `wms_inventory_history` VALUES (398, 357, 1, 124, 79, 190.00, NULL, 0, 115, '2023-03-02 09:21:54.230', NULL, NULL, 119, 131); -INSERT INTO `wms_inventory_history` VALUES (399, 150, 11, 125, 77, 300.00, NULL, 0, 115, '2023-03-02 09:25:17.571', NULL, NULL, 118, 128); -INSERT INTO `wms_inventory_history` VALUES (400, 150, 11, 124, 79, 17.00, NULL, 0, 115, '2023-03-02 09:26:39.301', NULL, NULL, 119, 131); -INSERT INTO `wms_inventory_history` VALUES (401, 56, 21, 125, 77, 1.00, NULL, 0, 115, '2023-03-02 09:36:22.784', NULL, NULL, 118, 128); -INSERT INTO `wms_inventory_history` VALUES (402, 56, 22, 125, 78, 1.00, NULL, 0, 115, '2023-03-02 09:36:22.784', NULL, NULL, 118, 129); -INSERT INTO `wms_inventory_history` VALUES (403, 57, 21, 125, 77, 100.00, NULL, 0, 115, '2023-03-02 09:46:27.567', NULL, NULL, 118, 128); -INSERT INTO `wms_inventory_history` VALUES (404, 57, 22, 125, 78, 100.00, NULL, 0, 115, '2023-03-02 09:46:27.567', NULL, NULL, 118, 129); -INSERT INTO `wms_inventory_history` VALUES (405, 362, 1, 125, NULL, 1.00, NULL, 0, 115, '2023-03-03 08:30:31.413', NULL, NULL, 117, 127); -INSERT INTO `wms_inventory_history` VALUES (406, 362, 1, 124, 78, 1.00, NULL, 0, 115, '2023-03-03 08:30:31.413', NULL, NULL, 118, 129); -INSERT INTO `wms_inventory_history` VALUES (407, 364, 1, 125, NULL, 1.00, NULL, 0, 115, '2023-03-03 08:44:50.864', NULL, NULL, 118, 129); -INSERT INTO `wms_inventory_history` VALUES (408, 363, 1, 125, NULL, 1.00, NULL, 0, 115, '2023-03-03 08:45:43.799', NULL, NULL, 118, 129); -INSERT INTO `wms_inventory_history` VALUES (409, 154, 11, 125, NULL, 1.00, NULL, 0, 115, '2023-03-03 08:46:33.879', NULL, NULL, 118, NULL); -INSERT INTO `wms_inventory_history` VALUES (410, 155, 11, 125, NULL, 1.00, NULL, 0, 115, '2023-03-03 08:50:25.503', NULL, NULL, 117, NULL); -INSERT INTO `wms_inventory_history` VALUES (411, 156, 11, 125, 78, 1.00, NULL, 0, 115, '2023-03-03 08:51:42.543', NULL, NULL, 118, 129); -INSERT INTO `wms_inventory_history` VALUES (412, 365, 1, 125, NULL, 1.00, NULL, 0, 115, '2023-03-03 12:57:29.344', NULL, NULL, 116, NULL); -INSERT INTO `wms_inventory_history` VALUES (413, 367, 1, 128, 90, 2.00, NULL, 0, 115, '2023-03-03 21:42:50.029', NULL, NULL, 122, 135); -INSERT INTO `wms_inventory_history` VALUES (414, 367, 1, 127, 91, 12.00, NULL, 0, 115, '2023-03-03 21:42:50.029', NULL, NULL, 122, 135); -INSERT INTO `wms_inventory_history` VALUES (415, 368, 1, 127, 90, 100.00, NULL, 0, 115, '2023-03-03 22:00:24.594', NULL, NULL, 122, 135); -INSERT INTO `wms_inventory_history` VALUES (416, 369, 1, 127, 90, 200.00, NULL, 0, 115, '2023-03-03 22:03:10.273', NULL, NULL, 122, 135); -INSERT INTO `wms_inventory_history` VALUES (417, 157, 11, 127, 90, 8.00, NULL, 0, 115, '2023-03-03 22:12:16.462', NULL, NULL, 122, 135); -INSERT INTO `wms_inventory_history` VALUES (418, 370, 1, 130, NULL, 13.00, NULL, 0, 115, '2023-03-03 22:37:09.315', NULL, NULL, 117, 127); -INSERT INTO `wms_inventory_history` VALUES (419, 371, 1, 130, NULL, 6.00, NULL, 0, 115, '2023-03-03 22:39:13.283', NULL, NULL, 117, 127); -INSERT INTO `wms_inventory_history` VALUES (420, 158, 11, 127, 90, 1.00, NULL, 0, 115, '2023-03-05 16:13:36.811', NULL, NULL, 122, 135); -INSERT INTO `wms_inventory_history` VALUES (421, 373, 1, 130, 89, 1.00, NULL, 0, 115, '2023-03-06 08:28:08.813', NULL, NULL, 121, 134); -INSERT INTO `wms_inventory_history` VALUES (422, 373, 1, 129, 89, 1.00, NULL, 0, 115, '2023-03-06 08:28:08.813', NULL, NULL, 121, 134); -INSERT INTO `wms_inventory_history` VALUES (423, 373, 1, 128, 91, 1.00, NULL, 0, 115, '2023-03-06 08:28:08.813', NULL, NULL, 122, 135); -INSERT INTO `wms_inventory_history` VALUES (424, 366, 1, 130, 89, 1.00, NULL, 0, 115, '2023-03-06 13:37:34.158', NULL, NULL, 121, 134); -INSERT INTO `wms_inventory_history` VALUES (425, 59, 21, 130, NULL, 1.00, NULL, 0, 115, '2023-03-06 16:53:49.677', NULL, NULL, 117, 127); -INSERT INTO `wms_inventory_history` VALUES (426, 59, 22, 130, 78, 1.00, NULL, 0, 115, '2023-03-06 16:53:49.677', NULL, NULL, 118, 129); -INSERT INTO `wms_inventory_history` VALUES (427, 59, 21, 130, NULL, 9.00, NULL, 0, 115, '2023-03-06 16:55:41.094', NULL, NULL, 117, 127); -INSERT INTO `wms_inventory_history` VALUES (428, 59, 22, 130, 78, 9.00, NULL, 0, 115, '2023-03-06 16:55:41.094', NULL, NULL, 118, 129); -INSERT INTO `wms_inventory_history` VALUES (429, 374, 1, 130, 89, 1.00, NULL, 0, 115, '2023-03-07 09:15:59.618', NULL, NULL, 121, 134); -INSERT INTO `wms_inventory_history` VALUES (430, 374, 1, 129, 89, 1.00, NULL, 0, 115, '2023-03-07 09:41:10.152', NULL, NULL, 121, 134); -INSERT INTO `wms_inventory_history` VALUES (431, 162, 11, 130, 89, 1.00, NULL, 0, 115, '2023-03-07 14:17:46.370', NULL, NULL, 121, 134); -INSERT INTO `wms_inventory_history` VALUES (432, 379, 1, 131, 92, 1.00, NULL, 0, 115, '2023-03-08 09:37:18.535', NULL, NULL, 117, 136); -INSERT INTO `wms_inventory_history` VALUES (433, 380, 1, 131, NULL, 200.00, NULL, 0, 115, '2023-03-08 09:39:15.801', NULL, NULL, 117, 127); -INSERT INTO `wms_inventory_history` VALUES (434, 385, 1, 133, 92, 1.00, NULL, 0, 115, '2023-03-09 13:02:37.792', NULL, NULL, 117, 136); -INSERT INTO `wms_inventory_history` VALUES (435, 385, 1, 133, 92, 9.00, NULL, 0, 115, '2023-03-09 13:04:20.196', NULL, NULL, 117, 136); -INSERT INTO `wms_inventory_history` VALUES (436, 164, 11, 133, 92, 1.00, NULL, 0, 115, '2023-03-09 13:05:28.478', NULL, NULL, 117, 136); -INSERT INTO `wms_inventory_history` VALUES (437, 165, 11, 133, 92, 1.00, NULL, 0, 115, '2023-03-09 13:07:54.025', NULL, NULL, 117, 136); -INSERT INTO `wms_inventory_history` VALUES (438, 386, 1, 133, 92, 1.00, NULL, 0, 115, '2023-03-09 13:09:36.818', NULL, NULL, 117, 136); -INSERT INTO `wms_inventory_history` VALUES (439, 166, 11, 133, 92, 1.00, NULL, 0, 115, '2023-03-09 13:10:25.839', NULL, NULL, 117, 136); -INSERT INTO `wms_inventory_history` VALUES (440, 387, 1, 131, NULL, 1.00, NULL, 0, 115, '2023-03-09 15:10:54.182', NULL, NULL, 117, 136); -INSERT INTO `wms_inventory_history` VALUES (441, 388, 1, 133, 92, 10.00, NULL, 0, 115, '2023-03-09 15:11:49.674', NULL, NULL, 117, 136); -INSERT INTO `wms_inventory_history` VALUES (442, 167, 11, 133, 92, 1.00, NULL, 0, 115, '2023-03-09 17:32:08.514', NULL, NULL, 117, 136); -INSERT INTO `wms_inventory_history` VALUES (443, 168, 11, 133, 92, 1.00, NULL, 0, 115, '2023-03-10 15:24:18.504', NULL, NULL, 117, 136); -INSERT INTO `wms_inventory_history` VALUES (444, 168, 11, 128, 91, 1.00, NULL, 0, 115, '2023-03-10 15:24:24.782', NULL, NULL, 122, 135); -INSERT INTO `wms_inventory_history` VALUES (445, 382, 1, 132, NULL, 1.00, NULL, 0, 115, '2023-03-10 15:29:42.881', NULL, NULL, NULL, NULL); -INSERT INTO `wms_inventory_history` VALUES (446, 391, 1, 134, NULL, 1.00, NULL, 0, 115, '2023-03-12 13:39:25.765', NULL, NULL, 130, NULL); -INSERT INTO `wms_inventory_history` VALUES (447, 392, 1, 134, 94, 10.00, NULL, 0, 115, '2023-03-12 16:02:14.183', NULL, NULL, 131, 142); -INSERT INTO `wms_inventory_history` VALUES (448, 170, 11, 134, 94, 7.00, NULL, 0, 115, '2023-03-12 16:05:24.352', NULL, NULL, 131, 142); -INSERT INTO `wms_inventory_history` VALUES (449, 171, 11, 134, 94, 3.00, NULL, 0, 115, '2023-03-12 16:10:28.534', NULL, NULL, 131, 142); -INSERT INTO `wms_inventory_history` VALUES (450, 394, 1, 134, NULL, 6.00, NULL, 0, 115, '2023-03-13 00:24:13.163', NULL, NULL, 132, NULL); -INSERT INTO `wms_inventory_history` VALUES (451, 395, 1, 135, NULL, 1.00, NULL, 0, 115, '2023-03-13 04:17:07.843', NULL, NULL, 133, NULL); -INSERT INTO `wms_inventory_history` VALUES (452, 396, 1, 136, NULL, 1.00, NULL, 0, 115, '2023-03-13 10:30:16.745', NULL, NULL, NULL, NULL); -INSERT INTO `wms_inventory_history` VALUES (453, 396, 2, 137, NULL, 50.00, NULL, 0, 115, '2023-03-13 10:32:39.611', NULL, NULL, NULL, NULL); -INSERT INTO `wms_inventory_history` VALUES (454, 396, 2, 136, NULL, 100.00, NULL, 0, 115, '2023-03-13 10:32:39.611', NULL, NULL, NULL, NULL); -INSERT INTO `wms_inventory_history` VALUES (455, 397, 1, 138, 96, 1.00, NULL, 0, 115, '2023-03-13 15:23:51.403', NULL, NULL, 134, 144); -INSERT INTO `wms_inventory_history` VALUES (456, 397, 1, 137, 96, 1.00, NULL, 0, 115, '2023-03-13 15:23:51.403', NULL, NULL, 134, 144); -INSERT INTO `wms_inventory_history` VALUES (457, 175, 11, 138, NULL, 1.00, NULL, 0, 115, '2023-03-13 15:25:21.378', NULL, NULL, 134, 144); -INSERT INTO `wms_inventory_history` VALUES (458, 398, 1, 137, NULL, 1.00, NULL, 0, 115, '2023-03-13 15:39:42.608', NULL, NULL, 135, NULL); -INSERT INTO `wms_inventory_history` VALUES (459, 399, 1, 138, NULL, 1.00, NULL, 0, 115, '2023-03-13 15:52:23.869', NULL, NULL, 135, NULL); -INSERT INTO `wms_inventory_history` VALUES (460, 400, 1, 139, NULL, 1.00, NULL, 0, 115, '2023-03-13 15:56:25.095', NULL, NULL, 136, 145); -INSERT INTO `wms_inventory_history` VALUES (461, 401, 1, 139, NULL, 100.00, NULL, 0, 115, '2023-03-13 15:58:56.646', NULL, NULL, 136, 145); -INSERT INTO `wms_inventory_history` VALUES (462, 402, 1, 140, NULL, 1.00, NULL, 0, 115, '2023-03-13 16:30:47.752', NULL, NULL, 135, 147); -INSERT INTO `wms_inventory_history` VALUES (463, 177, 11, 140, NULL, 1.00, NULL, 0, 115, '2023-03-13 16:31:08.269', NULL, NULL, 135, 147); -INSERT INTO `wms_inventory_history` VALUES (464, 403, 1, 140, NULL, 4.00, NULL, 0, 115, '2023-03-13 16:32:56.763', NULL, NULL, 135, 147); -INSERT INTO `wms_inventory_history` VALUES (465, 178, 11, 140, NULL, 4.00, NULL, 0, 115, '2023-03-13 16:33:18.093', NULL, NULL, 135, 147); -INSERT INTO `wms_inventory_history` VALUES (466, 404, 1, 136, 96, 1.00, NULL, 0, 115, '2023-03-14 09:53:57.694', NULL, NULL, 135, 147); -INSERT INTO `wms_inventory_history` VALUES (467, 407, 1, 140, 96, 1.00, NULL, 0, 115, '2023-03-14 13:49:07.845', NULL, NULL, 135, 147); -INSERT INTO `wms_inventory_history` VALUES (468, 407, 1, 139, NULL, 1.00, NULL, 0, 115, '2023-03-14 13:49:07.845', NULL, NULL, 136, 145); -INSERT INTO `wms_inventory_history` VALUES (469, 408, 1, 142, 97, 1.00, NULL, 0, 115, '2023-03-14 16:17:08.567', NULL, NULL, 135, 147); -INSERT INTO `wms_inventory_history` VALUES (470, 409, 1, 142, 97, 10000.00, NULL, 0, 115, '2023-03-14 16:18:41.549', NULL, NULL, 135, 147); -INSERT INTO `wms_inventory_history` VALUES (471, 182, 11, 142, 97, 100.00, NULL, 0, 115, '2023-03-14 16:20:11.497', NULL, NULL, 135, 147); -INSERT INTO `wms_inventory_history` VALUES (472, 184, 11, 142, 97, 50.00, NULL, 0, 115, '2023-03-15 13:30:11.450', NULL, NULL, 135, 147); -INSERT INTO `wms_inventory_history` VALUES (473, 413, 1, 142, NULL, 1.00, NULL, 0, 115, '2023-03-15 18:46:37.826', NULL, NULL, 137, 148); -INSERT INTO `wms_inventory_history` VALUES (474, 413, 1, 141, NULL, 1.00, NULL, 0, 115, '2023-03-15 18:46:37.826', NULL, NULL, 137, NULL); -INSERT INTO `wms_inventory_history` VALUES (475, 414, 1, 140, NULL, 1.00, NULL, 0, 115, '2023-03-15 21:50:15.566', NULL, NULL, 135, 149); -INSERT INTO `wms_inventory_history` VALUES (476, 415, 1, 142, NULL, 1.00, NULL, 0, 115, '2023-03-16 09:21:46.755', NULL, NULL, 138, NULL); -INSERT INTO `wms_inventory_history` VALUES (477, 416, 1, 142, 97, 1.00, NULL, 0, 115, '2023-03-16 11:30:34.608', NULL, NULL, 135, 147); -INSERT INTO `wms_inventory_history` VALUES (478, 416, 1, 141, 96, 1.00, NULL, 0, 115, '2023-03-16 11:30:34.608', NULL, NULL, 135, 147); -INSERT INTO `wms_inventory_history` VALUES (479, 416, 1, 140, 96, 1.00, NULL, 0, 115, '2023-03-16 11:30:34.608', NULL, NULL, 135, 147); -INSERT INTO `wms_inventory_history` VALUES (480, 416, 1, 139, NULL, 1.00, NULL, 0, 115, '2023-03-16 11:30:34.608', NULL, NULL, 136, NULL); -INSERT INTO `wms_inventory_history` VALUES (481, 416, 1, 138, NULL, 1.00, NULL, 0, 115, '2023-03-16 11:30:34.608', NULL, NULL, 135, NULL); -INSERT INTO `wms_inventory_history` VALUES (482, 416, 1, 137, NULL, 1.00, NULL, 0, 115, '2023-03-16 11:30:34.608', NULL, NULL, 135, NULL); -INSERT INTO `wms_inventory_history` VALUES (483, 416, 1, 136, NULL, 1.00, NULL, 0, 115, '2023-03-16 11:30:34.608', NULL, NULL, NULL, NULL); -INSERT INTO `wms_inventory_history` VALUES (484, 418, 1, 141, 96, 1.00, NULL, 0, 115, '2023-03-16 18:07:01.872', NULL, NULL, 135, 147); -INSERT INTO `wms_inventory_history` VALUES (485, 66, 21, 141, NULL, 1.00, NULL, 0, 115, '2023-03-16 18:32:12.598', NULL, NULL, 137, NULL); -INSERT INTO `wms_inventory_history` VALUES (486, 66, 22, 141, NULL, 1.00, NULL, 0, 115, '2023-03-16 18:32:12.598', NULL, NULL, 135, 149); -INSERT INTO `wms_inventory_history` VALUES (487, 421, 1, 142, NULL, 1.00, NULL, 0, 115, '2023-03-17 15:32:11.113', NULL, NULL, 136, 145); -INSERT INTO `wms_inventory_history` VALUES (488, 421, 1, 137, NULL, 1.00, NULL, 0, 115, '2023-03-17 15:32:11.113', NULL, NULL, 135, NULL); -INSERT INTO `wms_inventory_history` VALUES (489, 423, 2, 142, 98, 1.00, NULL, 0, 115, '2023-03-17 18:06:04.186', NULL, NULL, 137, 148); -INSERT INTO `wms_inventory_history` VALUES (490, 423, 2, 141, 97, 1.00, NULL, 0, 115, '2023-03-17 18:06:04.186', NULL, NULL, 135, 147); -INSERT INTO `wms_inventory_history` VALUES (491, 422, 1, 142, NULL, 1.00, NULL, 0, 115, '2023-03-20 08:40:39.405', NULL, NULL, 137, NULL); -INSERT INTO `wms_inventory_history` VALUES (492, 422, 1, 141, NULL, 1.00, NULL, 0, 115, '2023-03-20 08:40:39.405', NULL, NULL, 138, NULL); -INSERT INTO `wms_inventory_history` VALUES (493, 425, 1, 142, NULL, 188.00, NULL, 0, 115, '2023-03-20 11:36:07.205', NULL, NULL, 139, NULL); -INSERT INTO `wms_inventory_history` VALUES (494, 425, 1, 141, NULL, 6000.00, NULL, 0, 115, '2023-03-20 11:36:07.205', NULL, NULL, 135, NULL); -INSERT INTO `wms_inventory_history` VALUES (495, 428, 1, 143, 97, 1.00, NULL, 0, 115, '2023-03-20 13:48:34.919', NULL, NULL, 135, 147); -INSERT INTO `wms_inventory_history` VALUES (496, 194, 11, 143, 97, 1.00, NULL, 0, 115, '2023-03-20 13:50:47.091', NULL, NULL, 135, 147); -INSERT INTO `wms_inventory_history` VALUES (497, 429, 1, 143, 97, 1.00, NULL, 0, 115, '2023-03-20 14:08:46.470', NULL, NULL, 135, 147); -INSERT INTO `wms_inventory_history` VALUES (498, 429, 1, 142, NULL, 1.00, NULL, 0, 115, '2023-03-20 14:08:46.470', NULL, NULL, 136, 145); -INSERT INTO `wms_inventory_history` VALUES (499, 429, 1, 139, NULL, 1.00, NULL, 0, 115, '2023-03-20 14:08:46.470', NULL, NULL, 136, NULL); -INSERT INTO `wms_inventory_history` VALUES (500, 430, 1, 142, NULL, 1.00, NULL, 0, 115, '2023-03-20 16:49:02.094', NULL, NULL, 135, 149); -INSERT INTO `wms_inventory_history` VALUES (501, 440, 1, 144, 98, 1.00, NULL, 0, 115, '2023-03-21 17:24:15.420', NULL, NULL, 137, 148); -INSERT INTO `wms_inventory_history` VALUES (502, 440, 1, 143, 96, 1.00, NULL, 0, 115, '2023-03-21 17:24:15.420', NULL, NULL, 136, 145); -INSERT INTO `wms_inventory_history` VALUES (503, 439, 1, 144, NULL, 1.00, NULL, 0, 115, '2023-03-21 17:25:21.773', NULL, NULL, 139, NULL); -INSERT INTO `wms_inventory_history` VALUES (504, 439, 1, 143, 96, 1.00, NULL, 0, 115, '2023-03-21 17:25:21.773', NULL, NULL, 136, 145); -INSERT INTO `wms_inventory_history` VALUES (505, 195, 11, 143, 96, 1.00, NULL, 0, 115, '2023-03-21 19:27:13.303', NULL, NULL, 136, 145); -INSERT INTO `wms_inventory_history` VALUES (506, 441, 1, 145, 99, 1.00, NULL, 0, 115, '2023-03-21 19:33:36.152', NULL, NULL, 149, 151); -INSERT INTO `wms_inventory_history` VALUES (507, 442, 1, 145, 99, 2.00, NULL, 0, 115, '2023-03-21 19:35:15.556', NULL, NULL, 149, 151); -INSERT INTO `wms_inventory_history` VALUES (508, 199, 11, 145, 99, 3.00, NULL, 0, 115, '2023-03-21 19:36:49.594', NULL, NULL, 149, 151); -INSERT INTO `wms_inventory_history` VALUES (509, 443, 1, 146, NULL, 1.00, NULL, 0, 115, '2023-03-22 00:18:02.100', NULL, NULL, 150, NULL); -INSERT INTO `wms_inventory_history` VALUES (510, 437, 1, 144, NULL, 1.00, NULL, 0, 115, '2023-03-22 09:44:10.136', NULL, NULL, NULL, NULL); -INSERT INTO `wms_inventory_history` VALUES (511, 444, 1, 146, NULL, 1.00, NULL, 0, 115, '2023-03-22 12:58:50.515', NULL, NULL, NULL, NULL); -INSERT INTO `wms_inventory_history` VALUES (512, 444, 1, 145, 99, 1.00, NULL, 0, 115, '2023-03-22 12:58:50.515', NULL, NULL, 149, 151); -INSERT INTO `wms_inventory_history` VALUES (513, 445, 1, 146, NULL, 1.00, NULL, 0, 115, '2023-03-22 15:29:18.433', NULL, NULL, 143, NULL); -INSERT INTO `wms_inventory_history` VALUES (514, 445, 1, 145, 99, 1.00, NULL, 0, 115, '2023-03-22 15:29:18.433', NULL, NULL, 149, 151); -INSERT INTO `wms_inventory_history` VALUES (515, 445, 1, 144, NULL, 1.00, NULL, 0, 115, '2023-03-22 15:29:18.433', NULL, NULL, NULL, NULL); -INSERT INTO `wms_inventory_history` VALUES (516, 445, 1, 143, 96, 1.00, NULL, 0, 115, '2023-03-22 15:29:18.433', NULL, NULL, 136, 145); -INSERT INTO `wms_inventory_history` VALUES (517, 445, 1, 142, NULL, 1.00, NULL, 0, 115, '2023-03-22 15:29:18.433', NULL, NULL, 136, 145); -INSERT INTO `wms_inventory_history` VALUES (518, 445, 1, 141, 98, 1.00, NULL, 0, 115, '2023-03-22 15:29:18.433', NULL, NULL, 137, 148); -INSERT INTO `wms_inventory_history` VALUES (519, 445, 1, 140, 96, 1.00, NULL, 0, 115, '2023-03-22 15:29:18.433', NULL, NULL, 135, 147); -INSERT INTO `wms_inventory_history` VALUES (520, 445, 1, 139, NULL, 1.00, NULL, 0, 115, '2023-03-22 15:29:18.433', NULL, NULL, 136, NULL); -INSERT INTO `wms_inventory_history` VALUES (521, 445, 1, 138, NULL, 1.00, NULL, 0, 115, '2023-03-22 15:29:18.433', NULL, NULL, 135, NULL); -INSERT INTO `wms_inventory_history` VALUES (522, 445, 1, 137, NULL, 1.00, NULL, 0, 115, '2023-03-22 15:29:18.433', NULL, NULL, 135, NULL); -INSERT INTO `wms_inventory_history` VALUES (523, 446, 1, 146, NULL, 1.00, NULL, 0, 115, '2023-03-22 15:31:47.064', NULL, NULL, 136, NULL); -INSERT INTO `wms_inventory_history` VALUES (524, 446, 1, 145, NULL, 1.00, NULL, 0, 115, '2023-03-22 15:31:47.064', NULL, NULL, 136, NULL); -INSERT INTO `wms_inventory_history` VALUES (525, 448, 1, 147, 100, 1.00, NULL, 0, 115, '2023-03-22 15:56:16.808', NULL, NULL, 154, 152); -INSERT INTO `wms_inventory_history` VALUES (526, 448, 1, 147, 100, 99.00, NULL, 0, 115, '2023-03-22 15:59:03.799', NULL, NULL, 154, 152); -INSERT INTO `wms_inventory_history` VALUES (527, 450, 1, 147, 100, 50.00, NULL, 0, 115, '2023-03-22 16:10:18.453', NULL, NULL, 154, 152); -INSERT INTO `wms_inventory_history` VALUES (528, 200, 11, 147, 100, 30.00, NULL, 0, 115, '2023-03-22 16:11:49.972', NULL, NULL, 154, 152); -INSERT INTO `wms_inventory_history` VALUES (529, 68, 21, 147, 100, 1.00, NULL, 0, 115, '2023-03-22 16:15:01.704', NULL, NULL, 154, 152); -INSERT INTO `wms_inventory_history` VALUES (530, 68, 22, 147, 101, 1.00, NULL, 0, 115, '2023-03-22 16:15:01.704', NULL, NULL, 154, 152); -INSERT INTO `wms_inventory_history` VALUES (531, 451, 1, 148, 102, 1.00, NULL, 0, 115, '2023-03-22 22:51:19.716', NULL, NULL, 155, 153); -INSERT INTO `wms_inventory_history` VALUES (532, 201, 11, 148, 102, 1.00, NULL, 0, 115, '2023-03-22 22:53:08.546', NULL, NULL, 155, 153); -INSERT INTO `wms_inventory_history` VALUES (533, 452, 1, 148, NULL, 1.00, NULL, 0, 115, '2023-03-23 09:46:58.320', NULL, NULL, NULL, NULL); -INSERT INTO `wms_inventory_history` VALUES (534, 452, 1, 147, 100, 1.00, NULL, 0, 115, '2023-03-23 09:47:06.066', NULL, NULL, 154, 152); -INSERT INTO `wms_inventory_history` VALUES (535, 452, 1, 148, NULL, 1.00, NULL, 0, 115, '2023-03-23 10:37:47.935', NULL, NULL, NULL, NULL); -INSERT INTO `wms_inventory_history` VALUES (536, 406, 3, 140, NULL, 1.00, NULL, 0, 115, '2023-03-23 10:40:39.845', NULL, NULL, 136, 145); -INSERT INTO `wms_inventory_history` VALUES (537, 454, 1, 148, NULL, 1.00, NULL, 0, 115, '2023-03-23 11:05:57.966', NULL, NULL, NULL, NULL); -INSERT INTO `wms_inventory_history` VALUES (538, 454, 1, 147, 100, 1.00, NULL, 0, 115, '2023-03-23 11:05:57.966', NULL, NULL, 154, 152); -INSERT INTO `wms_inventory_history` VALUES (539, 454, 1, 146, NULL, 1.00, NULL, 0, 115, '2023-03-23 11:05:57.966', NULL, NULL, NULL, NULL); -INSERT INTO `wms_inventory_history` VALUES (540, 454, 1, 145, 99, 1.00, NULL, 0, 115, '2023-03-23 11:05:57.966', NULL, NULL, 149, 151); -INSERT INTO `wms_inventory_history` VALUES (541, 454, 1, 144, NULL, 1.00, NULL, 0, 115, '2023-03-23 11:05:57.966', NULL, NULL, NULL, NULL); -INSERT INTO `wms_inventory_history` VALUES (542, 455, 1, 148, 98, 1.00, NULL, 0, 115, '2023-03-23 11:07:53.373', NULL, NULL, 137, 148); -INSERT INTO `wms_inventory_history` VALUES (543, 455, 1, 147, 100, 1.00, NULL, 0, 115, '2023-03-23 11:07:53.373', NULL, NULL, 154, 152); -INSERT INTO `wms_inventory_history` VALUES (544, 455, 1, 146, NULL, 1.00, NULL, 0, 115, '2023-03-23 11:07:53.373', NULL, NULL, NULL, NULL); -INSERT INTO `wms_inventory_history` VALUES (545, 455, 1, 145, 99, 1.00, NULL, 0, 115, '2023-03-23 11:07:53.373', NULL, NULL, 149, 151); -INSERT INTO `wms_inventory_history` VALUES (546, 457, 1, 147, 101, 1.00, NULL, 0, 115, '2023-03-23 13:39:37.474', NULL, NULL, 154, 152); -INSERT INTO `wms_inventory_history` VALUES (547, 470, 1, 152, NULL, 1.00, NULL, 0, 115, '2023-03-24 14:24:55.532', NULL, NULL, 137, NULL); -INSERT INTO `wms_inventory_history` VALUES (548, 472, 1, 150, NULL, 10.00, NULL, 0, 115, '2023-03-24 15:50:14.262', NULL, NULL, 138, 150); -INSERT INTO `wms_inventory_history` VALUES (549, 474, 1, 156, NULL, 1.00, NULL, 0, 115, '2023-03-25 15:27:42.033', NULL, NULL, 165, 157); -INSERT INTO `wms_inventory_history` VALUES (550, 474, 1, 146, NULL, 1.00, NULL, 0, 115, '2023-03-25 15:27:42.033', NULL, NULL, 164, NULL); -INSERT INTO `wms_inventory_history` VALUES (551, 476, 1, 157, NULL, 1.00, NULL, 0, 115, '2023-03-26 19:52:24.461', NULL, NULL, 166, NULL); -INSERT INTO `wms_inventory_history` VALUES (552, 477, 1, 158, NULL, 100.00, NULL, 0, 115, '2023-03-27 11:17:46.276', NULL, NULL, NULL, NULL); -INSERT INTO `wms_inventory_history` VALUES (553, 477, 1, 158, NULL, 200.00, NULL, 0, 115, '2023-03-27 11:18:43.712', NULL, NULL, 143, NULL); -INSERT INTO `wms_inventory_history` VALUES (554, 478, 1, 159, NULL, 20.00, NULL, 0, 115, '2023-03-27 11:20:41.522', NULL, NULL, 143, NULL); -INSERT INTO `wms_inventory_history` VALUES (555, 478, 1, 159, NULL, 10.00, NULL, 0, 115, '2023-03-27 11:21:09.147', NULL, NULL, 143, NULL); -INSERT INTO `wms_inventory_history` VALUES (556, 478, 1, 159, NULL, 70.00, NULL, 0, 115, '2023-03-27 11:22:04.525', NULL, NULL, 143, NULL); -INSERT INTO `wms_inventory_history` VALUES (557, 484, 1, 161, NULL, 1.00, NULL, 0, 115, '2023-03-29 13:59:56.934', NULL, NULL, 138, 150); -INSERT INTO `wms_inventory_history` VALUES (558, 484, 1, 160, NULL, 1.00, NULL, 0, 115, '2023-03-29 13:59:56.934', NULL, NULL, 140, NULL); -INSERT INTO `wms_inventory_history` VALUES (559, 475, 1, 156, 98, 1.00, NULL, 0, 115, '2023-03-29 14:36:11.979', NULL, NULL, 137, 148); -INSERT INTO `wms_inventory_history` VALUES (560, 486, 1, 161, NULL, 1.00, NULL, 0, 115, '2023-03-29 14:40:03.024', NULL, NULL, 140, NULL); -INSERT INTO `wms_inventory_history` VALUES (561, 485, 1, 161, NULL, 10.00, NULL, 0, 115, '2023-03-29 15:04:11.374', NULL, NULL, 140, NULL); -INSERT INTO `wms_inventory_history` VALUES (562, 485, 1, 161, NULL, 5.00, NULL, 0, 115, '2023-03-29 15:04:23.592', NULL, NULL, 140, NULL); -INSERT INTO `wms_inventory_history` VALUES (563, 487, 1, 160, NULL, 5.00, NULL, 0, 115, '2023-03-29 15:13:42.505', NULL, NULL, 138, 150); -INSERT INTO `wms_inventory_history` VALUES (564, 487, 1, 158, NULL, 5.00, NULL, 0, 115, '2023-03-29 15:13:42.505', NULL, NULL, NULL, NULL); -INSERT INTO `wms_inventory_history` VALUES (565, 487, 1, 160, NULL, 1.00, NULL, 0, 115, '2023-03-29 15:16:21.470', NULL, NULL, 138, 150); -INSERT INTO `wms_inventory_history` VALUES (566, 487, 1, 158, NULL, 1.00, NULL, 0, 115, '2023-03-29 15:16:21.470', NULL, NULL, NULL, NULL); -INSERT INTO `wms_inventory_history` VALUES (567, 487, 1, 160, NULL, 3.00, NULL, 0, 115, '2023-03-29 15:21:50.780', NULL, NULL, 138, 150); -INSERT INTO `wms_inventory_history` VALUES (568, 491, 1, 162, NULL, 1.00, NULL, 0, 115, '2023-03-30 18:29:22.337', NULL, NULL, 138, 160); -INSERT INTO `wms_inventory_history` VALUES (569, 492, 1, 162, NULL, 99.00, NULL, 0, 115, '2023-03-30 18:32:33.512', NULL, NULL, 138, 160); -INSERT INTO `wms_inventory_history` VALUES (570, 489, 1, 158, NULL, 1.00, NULL, 0, 115, '2023-03-31 14:31:38.865', NULL, NULL, 138, 150); -INSERT INTO `wms_inventory_history` VALUES (571, 469, 2, 148, 98, 1.00, NULL, 0, 115, '2023-04-01 23:51:54.859', NULL, NULL, 137, 148); -INSERT INTO `wms_inventory_history` VALUES (572, 469, 2, 152, NULL, 1.00, NULL, 0, 115, '2023-04-01 23:51:54.859', NULL, NULL, 138, 150); -INSERT INTO `wms_inventory_history` VALUES (573, 215, 13, 162, NULL, 1.00, NULL, 0, 115, '2023-04-03 09:18:34.911', NULL, NULL, 138, 160); -INSERT INTO `wms_inventory_history` VALUES (574, 497, 2, 157, NULL, 1.00, NULL, 0, 115, '2023-04-03 09:21:08.860', NULL, NULL, 138, 150); -INSERT INTO `wms_inventory_history` VALUES (575, 498, 1, 162, NULL, 1.00, NULL, 0, 115, '2023-04-03 09:31:56.801', NULL, NULL, 138, 160); -INSERT INTO `wms_inventory_history` VALUES (576, 216, 11, 162, NULL, 1.00, NULL, 0, 115, '2023-04-03 09:32:39.280', NULL, NULL, 138, 160); -INSERT INTO `wms_inventory_history` VALUES (577, 499, 1, 162, NULL, 1.00, NULL, 0, 115, '2023-04-03 13:16:25.330', NULL, NULL, 138, 160); -INSERT INTO `wms_inventory_history` VALUES (578, 495, 1, 162, 110, 1.00, NULL, 0, 115, '2023-04-03 13:17:38.333', NULL, NULL, 138, 160); -INSERT INTO `wms_inventory_history` VALUES (579, 217, 11, 162, NULL, 1.00, NULL, 0, 115, '2023-04-03 13:19:29.513', NULL, NULL, 138, 160); -INSERT INTO `wms_inventory_history` VALUES (580, 500, 1, 162, NULL, 1.00, NULL, 0, 115, '2023-04-03 13:40:59.682', NULL, NULL, 138, 150); -INSERT INTO `wms_inventory_history` VALUES (581, 500, 1, 158, 107, 1.00, NULL, 0, 115, '2023-04-03 13:40:59.682', NULL, NULL, 139, 155); -INSERT INTO `wms_inventory_history` VALUES (582, 500, 1, 157, NULL, 1.00, NULL, 0, 115, '2023-04-03 13:40:59.682', NULL, NULL, 140, 145); -INSERT INTO `wms_inventory_history` VALUES (583, 500, 1, 162, NULL, 50.00, NULL, 0, 115, '2023-04-03 13:48:21.554', NULL, NULL, 138, 160); -INSERT INTO `wms_inventory_history` VALUES (584, 501, 1, 157, NULL, 1.00, NULL, 0, 115, '2023-04-03 14:00:07.325', NULL, NULL, NULL, NULL); -INSERT INTO `wms_inventory_history` VALUES (585, 501, 1, 157, NULL, 499.00, NULL, 0, 115, '2023-04-03 14:00:48.534', NULL, NULL, NULL, NULL); -INSERT INTO `wms_inventory_history` VALUES (586, 501, 1, 157, NULL, 500.00, NULL, 0, 115, '2023-04-03 14:01:22.052', NULL, NULL, NULL, NULL); -INSERT INTO `wms_inventory_history` VALUES (587, 502, 1, 157, NULL, 300.00, NULL, 0, 115, '2023-04-03 14:10:43.960', NULL, NULL, NULL, NULL); -INSERT INTO `wms_inventory_history` VALUES (588, 502, 1, 157, 104, 300.00, NULL, 0, 115, '2023-04-03 14:16:27.969', NULL, NULL, 139, 155); -INSERT INTO `wms_inventory_history` VALUES (589, 218, 11, 157, NULL, 1.00, NULL, 0, 115, '2023-04-03 14:17:44.003', NULL, NULL, 139, NULL); -INSERT INTO `wms_inventory_history` VALUES (590, 504, 1, 157, NULL, 1999.00, NULL, 0, 115, '2023-04-03 14:23:52.101', NULL, NULL, 144, NULL); -INSERT INTO `wms_inventory_history` VALUES (591, 505, 1, 157, NULL, 1001.00, NULL, 0, 115, '2023-04-03 14:24:29.598', NULL, NULL, 144, NULL); -INSERT INTO `wms_inventory_history` VALUES (592, 506, 1, 157, NULL, 700.00, NULL, 0, 115, '2023-04-03 14:25:19.494', NULL, NULL, 144, NULL); -INSERT INTO `wms_inventory_history` VALUES (593, 509, 1, 163, 110, 100.00, NULL, 0, 115, '2023-04-03 16:25:21.853', NULL, NULL, 138, 160); -INSERT INTO `wms_inventory_history` VALUES (594, 219, 11, 163, 110, 20.00, NULL, 0, 115, '2023-04-03 16:27:17.503', NULL, NULL, 138, 160); -INSERT INTO `wms_inventory_history` VALUES (595, 510, 1, 162, 104, 1.00, NULL, 0, 115, '2023-04-04 13:40:37.674', NULL, NULL, 139, 155); -INSERT INTO `wms_inventory_history` VALUES (596, 511, 1, 162, 107, 1.00, NULL, 0, 115, '2023-04-04 15:53:10.976', NULL, NULL, 139, 155); -INSERT INTO `wms_inventory_history` VALUES (597, 512, 1, 162, NULL, 5.00, NULL, 0, 115, '2023-04-04 15:55:45.057', NULL, NULL, 147, NULL); -INSERT INTO `wms_inventory_history` VALUES (598, 224, 11, 162, 107, 1.00, NULL, 0, 115, '2023-04-06 10:38:58.205', NULL, NULL, 139, 155); -INSERT INTO `wms_inventory_history` VALUES (599, 514, 1, 168, NULL, 22.00, NULL, 0, 115, '2023-04-06 14:13:57.957', NULL, NULL, 181, NULL); -INSERT INTO `wms_inventory_history` VALUES (600, 225, 11, 168, NULL, 1.00, NULL, 0, 115, '2023-04-06 14:14:19.341', NULL, NULL, 181, NULL); -INSERT INTO `wms_inventory_history` VALUES (601, 515, 1, 169, 113, 1.00, NULL, 0, 115, '2023-04-06 15:12:31.955', NULL, NULL, 184, 169); -INSERT INTO `wms_inventory_history` VALUES (602, 226, 11, 169, 113, 1.00, NULL, 0, 115, '2023-04-06 15:16:12.791', NULL, NULL, 184, 169); -INSERT INTO `wms_inventory_history` VALUES (603, 516, 1, 169, 113, 10.00, NULL, 0, 115, '2023-04-06 15:20:01.996', NULL, NULL, 184, 169); -INSERT INTO `wms_inventory_history` VALUES (604, 503, 1, 162, 110, 1.00, NULL, 0, 115, '2023-04-06 17:42:32.402', NULL, NULL, 138, 160); -INSERT INTO `wms_inventory_history` VALUES (605, 517, 1, 169, 107, 1.00, NULL, 0, 115, '2023-04-06 17:56:51.667', NULL, NULL, 139, 155); -INSERT INTO `wms_inventory_history` VALUES (606, 517, 1, 162, 107, 1.00, NULL, 0, 115, '2023-04-06 17:56:51.667', NULL, NULL, 139, 155); -INSERT INTO `wms_inventory_history` VALUES (607, 519, 1, 169, 113, 1.00, NULL, 0, 115, '2023-04-06 17:59:48.037', NULL, NULL, 184, 169); -INSERT INTO `wms_inventory_history` VALUES (608, 519, 1, 165, 109, 1.00, NULL, 0, 115, '2023-04-06 18:02:05.710', NULL, NULL, 139, 155); -INSERT INTO `wms_inventory_history` VALUES (609, 518, 1, 169, 113, 1.00, NULL, 0, 115, '2023-04-06 18:02:20.473', NULL, NULL, 184, 169); -INSERT INTO `wms_inventory_history` VALUES (610, 522, 1, 162, 107, 1.00, NULL, 0, 115, '2023-04-06 22:34:08.206', NULL, NULL, 139, 155); -INSERT INTO `wms_inventory_history` VALUES (611, 523, 1, 170, 114, 1.00, NULL, 0, 115, '2023-04-06 22:45:01.069', NULL, NULL, 185, 170); -INSERT INTO `wms_inventory_history` VALUES (612, 227, 11, 170, 114, 1.00, NULL, 0, 115, '2023-04-06 22:46:28.685', NULL, NULL, 185, 170); -INSERT INTO `wms_inventory_history` VALUES (613, 524, 1, 170, 107, 1.00, NULL, 0, 115, '2023-04-07 11:07:27.876', NULL, NULL, 139, 155); -INSERT INTO `wms_inventory_history` VALUES (614, 228, 11, 162, NULL, 1.00, NULL, 0, 115, '2023-04-07 11:10:06.398', NULL, NULL, 147, NULL); -INSERT INTO `wms_inventory_history` VALUES (615, 525, 1, 170, 107, 100.00, NULL, 0, 115, '2023-04-07 11:11:55.441', NULL, NULL, 139, 155); -INSERT INTO `wms_inventory_history` VALUES (616, 526, 1, 170, 113, 1.00, NULL, 0, 115, '2023-04-08 21:37:28.894', NULL, NULL, 184, 169); -INSERT INTO `wms_inventory_history` VALUES (617, 528, 3, 171, NULL, 2.00, NULL, 0, 115, '2023-04-10 10:49:53.337', NULL, NULL, 155, 172); -INSERT INTO `wms_inventory_history` VALUES (618, 530, 2, 171, 102, 1.00, NULL, 0, 115, '2023-04-10 16:07:17.829', NULL, NULL, 155, 171); -INSERT INTO `wms_inventory_history` VALUES (619, 531, 1, 172, NULL, 1.00, NULL, 0, 115, '2023-04-10 16:50:33.603', NULL, NULL, 154, NULL); -INSERT INTO `wms_inventory_history` VALUES (620, 236, 11, 172, NULL, 1.00, NULL, 0, 115, '2023-04-10 16:51:24.543', NULL, NULL, 154, NULL); -INSERT INTO `wms_inventory_history` VALUES (621, 532, 1, 172, NULL, 1.00, NULL, 0, 115, '2023-04-10 19:53:21.490', NULL, NULL, 154, NULL); -INSERT INTO `wms_inventory_history` VALUES (622, 532, 1, 171, NULL, 1.00, NULL, 0, 115, '2023-04-10 19:53:21.490', NULL, NULL, 154, NULL); -INSERT INTO `wms_inventory_history` VALUES (623, 533, 1, 172, NULL, 1.00, NULL, 0, 115, '2023-04-11 12:03:34.269', NULL, NULL, 190, NULL); -INSERT INTO `wms_inventory_history` VALUES (624, 534, 1, 172, NULL, 1.00, NULL, 0, 115, '2023-04-11 12:04:55.547', NULL, NULL, 189, NULL); -INSERT INTO `wms_inventory_history` VALUES (625, 536, 1, 173, NULL, 3.00, NULL, 0, 115, '2023-04-11 15:25:07.179', NULL, NULL, 157, NULL); -INSERT INTO `wms_inventory_history` VALUES (626, 535, 1, 173, 115, 1.00, NULL, 0, 115, '2023-04-11 15:58:50.257', NULL, NULL, 178, 176); -INSERT INTO `wms_inventory_history` VALUES (627, 535, 1, 172, NULL, 1.00, NULL, 0, 115, '2023-04-11 15:59:25.784', NULL, NULL, 157, NULL); -INSERT INTO `wms_inventory_history` VALUES (628, 237, 11, 173, 115, 1.00, NULL, 0, 115, '2023-04-11 16:01:14.375', NULL, NULL, 178, 176); -INSERT INTO `wms_inventory_history` VALUES (629, 537, 1, 172, NULL, 3.00, NULL, 0, 115, '2023-04-11 16:55:36.736', NULL, NULL, 157, NULL); -INSERT INTO `wms_inventory_history` VALUES (630, 235, 11, 172, NULL, 1.00, NULL, 0, 115, '2023-04-11 17:33:10.510', NULL, NULL, 157, NULL); -INSERT INTO `wms_inventory_history` VALUES (631, 539, 1, 171, 102, 1.00, NULL, 0, 115, '2023-04-12 09:14:43.045', NULL, NULL, 155, 171); -INSERT INTO `wms_inventory_history` VALUES (632, 539, 1, 172, NULL, 7.00, NULL, 0, 115, '2023-04-12 14:12:40.738', NULL, NULL, 154, NULL); -INSERT INTO `wms_inventory_history` VALUES (633, 541, 1, 174, NULL, 6.00, NULL, 0, 115, '2023-04-12 16:54:37.722', NULL, NULL, 157, NULL); -INSERT INTO `wms_inventory_history` VALUES (634, 541, 1, 173, NULL, 5.00, NULL, 0, 115, '2023-04-12 16:54:50.997', NULL, NULL, 158, NULL); -INSERT INTO `wms_inventory_history` VALUES (635, 544, 1, 178, 116, 1.00, NULL, 0, 115, '2023-04-13 12:23:32.705', NULL, NULL, 192, 178); -INSERT INTO `wms_inventory_history` VALUES (636, 546, 1, 180, 122, 1.00, NULL, 0, 115, '2023-04-13 13:52:02.629', NULL, NULL, 198, 185); -INSERT INTO `wms_inventory_history` VALUES (637, 545, 1, 178, 120, 1.00, NULL, 0, 115, '2023-04-13 13:54:23.406', NULL, NULL, 196, 183); -INSERT INTO `wms_inventory_history` VALUES (638, 85, 21, 180, 122, 1.00, NULL, 0, 115, '2023-04-13 13:55:12.832', NULL, NULL, 198, 185); -INSERT INTO `wms_inventory_history` VALUES (639, 85, 22, 180, NULL, 1.00, NULL, 0, 115, '2023-04-13 13:55:12.832', NULL, NULL, 199, 186); -INSERT INTO `wms_inventory_history` VALUES (640, 549, 1, 180, 119, 1.00, NULL, 0, 115, '2023-04-14 11:18:22.788', NULL, NULL, 195, 182); -INSERT INTO `wms_inventory_history` VALUES (641, 551, 1, 180, 119, 1.00, NULL, 0, 115, '2023-04-14 15:52:38.685', NULL, NULL, 195, 182); -INSERT INTO `wms_inventory_history` VALUES (642, 555, 1, 180, 118, 1.00, NULL, 0, 115, '2023-04-15 09:09:42.324', NULL, NULL, 194, 181); -INSERT INTO `wms_inventory_history` VALUES (643, 555, 1, 176, 118, 1.00, NULL, 0, 115, '2023-04-15 09:09:42.324', NULL, NULL, 194, 181); -INSERT INTO `wms_inventory_history` VALUES (644, 560, 1, 178, 117, 5.00, NULL, 0, 115, '2023-04-15 16:23:32.414', NULL, NULL, 193, 180); -INSERT INTO `wms_inventory_history` VALUES (645, 561, 1, 180, NULL, 1.00, NULL, 0, 115, '2023-04-15 16:27:27.841', NULL, NULL, 193, NULL); -INSERT INTO `wms_inventory_history` VALUES (646, 560, 1, 178, 118, 5.00, NULL, 0, 115, '2023-04-15 16:48:15.391', NULL, NULL, 194, 181); -INSERT INTO `wms_inventory_history` VALUES (647, 562, 1, 180, 122, 203.00, NULL, 0, 115, '2023-04-15 20:45:45.152', NULL, NULL, 198, 185); -INSERT INTO `wms_inventory_history` VALUES (648, 246, 11, 180, 122, 10.00, NULL, 0, 115, '2023-04-15 20:49:04.304', NULL, NULL, 198, 185); -INSERT INTO `wms_inventory_history` VALUES (649, 565, 1, 180, 116, 10.00, NULL, 0, 115, '2023-04-17 13:33:54.121', NULL, NULL, 193, 178); -INSERT INTO `wms_inventory_history` VALUES (650, 91, 21, 180, NULL, 3.00, NULL, 0, 115, '2023-04-17 13:50:04.367', NULL, NULL, 198, 185); -INSERT INTO `wms_inventory_history` VALUES (651, 91, 22, 180, 123, 3.00, NULL, 0, 115, '2023-04-17 13:50:04.367', NULL, NULL, 199, 186); -INSERT INTO `wms_inventory_history` VALUES (652, 566, 1, 182, 116, 50.00, NULL, 0, 115, '2023-04-17 15:43:40.388', NULL, NULL, 193, 178); -INSERT INTO `wms_inventory_history` VALUES (653, 566, 1, 181, 124, 50.00, NULL, 0, 115, '2023-04-17 15:43:40.388', NULL, NULL, 193, 178); -INSERT INTO `wms_inventory_history` VALUES (654, 568, 1, 182, 118, 1.00, NULL, 0, 115, '2023-04-18 13:28:06.078', NULL, NULL, 194, 181); -INSERT INTO `wms_inventory_history` VALUES (655, 247, 11, 182, 118, 1.00, NULL, 0, 115, '2023-04-18 13:30:05.413', NULL, NULL, 194, 181); -INSERT INTO `wms_inventory_history` VALUES (656, 571, 1, 182, 124, 1.00, NULL, 0, 115, '2023-04-19 09:24:19.752', NULL, NULL, 193, 178); -INSERT INTO `wms_inventory_history` VALUES (657, 571, 1, 181, 124, 1.00, NULL, 0, 115, '2023-04-19 09:24:19.752', NULL, NULL, 193, 178); -INSERT INTO `wms_inventory_history` VALUES (658, 572, 1, 182, NULL, 1.00, NULL, 0, 115, '2023-04-19 21:07:55.564', NULL, NULL, 194, 181); -INSERT INTO `wms_inventory_history` VALUES (659, 572, 1, 181, 116, 1.00, NULL, 0, 115, '2023-04-19 21:07:55.564', NULL, NULL, 193, 178); -INSERT INTO `wms_inventory_history` VALUES (660, 572, 1, 180, 122, 1.00, NULL, 0, 115, '2023-04-19 21:07:55.564', NULL, NULL, 198, 185); -INSERT INTO `wms_inventory_history` VALUES (661, 569, 1, 182, 124, 1.00, NULL, 0, 115, '2023-04-19 23:03:23.570', NULL, NULL, 193, 178); -INSERT INTO `wms_inventory_history` VALUES (662, 569, 1, 181, 116, 1.00, NULL, 0, 115, '2023-04-19 23:03:23.570', NULL, NULL, 193, 178); -INSERT INTO `wms_inventory_history` VALUES (663, 569, 1, 180, 122, 1.00, NULL, 0, 115, '2023-04-19 23:03:23.570', NULL, NULL, 198, 185); -INSERT INTO `wms_inventory_history` VALUES (664, 567, 1, 182, 118, 1.00, NULL, 0, 115, '2023-04-19 23:04:23.153', NULL, NULL, 194, 181); -INSERT INTO `wms_inventory_history` VALUES (665, 253, 11, 182, 118, 1.00, NULL, 0, 115, '2023-04-22 19:11:49.673', NULL, NULL, 194, 181); -INSERT INTO `wms_inventory_history` VALUES (666, 253, 11, 181, 116, 1.00, NULL, 0, 115, '2023-04-22 19:11:49.673', NULL, NULL, 193, 178); -INSERT INTO `wms_inventory_history` VALUES (667, 584, 1, 182, 118, 1.00, NULL, 0, 115, '2023-04-22 19:15:25.123', NULL, NULL, 194, 181); -INSERT INTO `wms_inventory_history` VALUES (668, 584, 1, 181, 118, 1.00, NULL, 0, 115, '2023-04-22 19:15:25.123', NULL, NULL, 194, 181); -INSERT INTO `wms_inventory_history` VALUES (669, 585, 1, 182, 118, 1.00, NULL, 0, 115, '2023-04-22 19:17:01.731', NULL, NULL, 194, 181); -INSERT INTO `wms_inventory_history` VALUES (670, 585, 1, 181, 118, 1.00, NULL, 0, 115, '2023-04-22 19:17:01.731', NULL, NULL, 194, 181); -INSERT INTO `wms_inventory_history` VALUES (671, 250, 11, 182, 118, 1.00, NULL, 0, 115, '2023-04-22 19:18:23.765', NULL, NULL, 194, 181); -INSERT INTO `wms_inventory_history` VALUES (672, 250, 11, 180, 118, 1.00, NULL, 0, 115, '2023-04-22 19:18:53.007', NULL, NULL, 194, 181); -INSERT INTO `wms_inventory_history` VALUES (673, 586, 3, 182, NULL, 1.00, NULL, 0, 115, '2023-04-23 14:01:12.823', NULL, NULL, 196, 183); -INSERT INTO `wms_inventory_history` VALUES (674, 591, 1, 184, 118, 1.00, NULL, 0, 115, '2023-04-24 10:35:48.429', NULL, NULL, 194, 181); -INSERT INTO `wms_inventory_history` VALUES (675, 591, 1, 182, 121, 1.00, NULL, 0, 115, '2023-04-24 10:35:48.429', NULL, NULL, 195, 182); -INSERT INTO `wms_inventory_history` VALUES (676, 591, 1, 181, 124, 1.00, NULL, 0, 115, '2023-04-24 10:35:48.429', NULL, NULL, 198, 185); -INSERT INTO `wms_inventory_history` VALUES (677, 592, 1, 185, 127, 1.00, NULL, 0, 115, '2023-04-24 15:36:26.659', NULL, NULL, 215, 189); -INSERT INTO `wms_inventory_history` VALUES (678, 259, 11, 185, 127, 1.00, NULL, 0, 115, '2023-04-24 15:37:10.975', NULL, NULL, 215, 189); -INSERT INTO `wms_inventory_history` VALUES (679, 595, 1, 185, 118, 1.00, NULL, 0, 115, '2023-04-25 14:56:10.784', NULL, NULL, 194, 181); -INSERT INTO `wms_inventory_history` VALUES (680, 595, 1, 183, NULL, 1.00, NULL, 0, 115, '2023-04-25 14:56:10.784', NULL, NULL, 196, 183); -INSERT INTO `wms_inventory_history` VALUES (681, 260, 11, 185, 118, 1.00, NULL, 0, 115, '2023-04-25 15:01:00.119', NULL, NULL, 194, 181); -INSERT INTO `wms_inventory_history` VALUES (682, 251, 11, 182, 118, 1.00, NULL, 0, 115, '2023-04-25 15:46:56.376', NULL, NULL, 194, 181); -INSERT INTO `wms_inventory_history` VALUES (683, 251, 11, 181, 116, 1.00, NULL, 0, 115, '2023-04-25 15:46:56.376', NULL, NULL, 193, 178); -INSERT INTO `wms_inventory_history` VALUES (684, 251, 11, 180, 122, 1.00, NULL, 0, 115, '2023-04-25 15:46:56.376', NULL, NULL, 198, 185); -INSERT INTO `wms_inventory_history` VALUES (685, 251, 11, 178, 116, 1.00, NULL, 0, 115, '2023-04-25 15:46:56.376', NULL, NULL, 192, 178); -INSERT INTO `wms_inventory_history` VALUES (686, 597, 1, 186, NULL, 14.00, NULL, 0, 115, '2023-04-25 15:54:34.255', NULL, NULL, 196, 183); -INSERT INTO `wms_inventory_history` VALUES (687, 261, 11, 186, NULL, 8.00, NULL, 0, 115, '2023-04-25 15:54:56.883', NULL, NULL, 196, 183); -INSERT INTO `wms_inventory_history` VALUES (688, 598, 1, 186, 118, 5.00, NULL, 0, 115, '2023-04-25 16:53:40.784', NULL, NULL, 194, 181); -INSERT INTO `wms_inventory_history` VALUES (689, 598, 1, 183, 119, 4.00, NULL, 0, 115, '2023-04-25 16:53:40.784', NULL, NULL, 195, 182); -INSERT INTO `wms_inventory_history` VALUES (690, 599, 1, 183, NULL, 1.00, NULL, 0, 115, '2023-04-25 18:31:31.129', NULL, NULL, NULL, NULL); -INSERT INTO `wms_inventory_history` VALUES (691, 599, 1, 182, 118, 1.00, NULL, 0, 115, '2023-04-25 18:32:26.377', NULL, NULL, 194, 181); -INSERT INTO `wms_inventory_history` VALUES (692, 601, 1, 187, 117, 1.00, NULL, 0, 115, '2023-04-26 17:17:59.193', NULL, NULL, 194, 181); -INSERT INTO `wms_inventory_history` VALUES (693, 258, 12, 186, NULL, 1.00, NULL, 0, 115, '2023-04-27 15:06:07.919', NULL, NULL, 196, 183); -INSERT INTO `wms_inventory_history` VALUES (694, 258, 12, 186, NULL, 1.00, NULL, 0, 115, '2023-04-27 15:06:23.200', NULL, NULL, 196, 183); -INSERT INTO `wms_inventory_history` VALUES (695, 258, 12, 182, 118, 1.00, NULL, 0, 115, '2023-04-27 15:18:00.351', NULL, NULL, 194, 181); -INSERT INTO `wms_inventory_history` VALUES (696, 43, 4, 187, 117, 1.00, '测试一下说明', 0, 115, '2023-04-28 16:44:42.064', 115, '2023-04-28 16:44:42.064', 194, 181); -INSERT INTO `wms_inventory_history` VALUES (697, 46, 15, 186, NULL, -1.00, NULL, 0, 115, '2023-04-28 23:45:44.062', 115, '2023-04-28 23:45:44.062', 194, 181); -INSERT INTO `wms_inventory_history` VALUES (698, 46, 4, 186, NULL, 2.00, NULL, 0, 115, '2023-04-28 23:45:44.062', 115, '2023-04-28 23:45:44.062', 196, 183); -INSERT INTO `wms_inventory_history` VALUES (699, 594, 1, 181, 118, 6.00, NULL, 0, 115, '2023-04-29 13:56:40.346', NULL, NULL, 194, 181); -INSERT INTO `wms_inventory_history` VALUES (700, 611, 1, 188, 117, 1.00, NULL, 0, 115, '2023-04-30 16:33:48.736', NULL, NULL, 194, 181); -INSERT INTO `wms_inventory_history` VALUES (701, 621, 1, 193, NULL, 1.00, NULL, 0, 115, '2023-05-04 10:35:32.609', NULL, NULL, 230, NULL); -INSERT INTO `wms_inventory_history` VALUES (702, 621, 1, 191, NULL, 1.00, NULL, 0, 115, '2023-05-04 10:35:32.609', NULL, NULL, 229, NULL); -INSERT INTO `wms_inventory_history` VALUES (703, 621, 1, 190, NULL, 1.00, NULL, 0, 115, '2023-05-04 10:35:32.609', NULL, NULL, 229, NULL); -INSERT INTO `wms_inventory_history` VALUES (704, 621, 1, 189, NULL, 1.00, NULL, 0, 115, '2023-05-04 10:35:32.609', NULL, NULL, 231, NULL); -INSERT INTO `wms_inventory_history` VALUES (705, 625, 1, 193, NULL, 1.00, NULL, 0, 115, '2023-05-04 16:41:41.989', NULL, NULL, 229, 216); - --- ---------------------------- --- Table structure for wms_inventory_movement --- ---------------------------- -DROP TABLE IF EXISTS `wms_inventory_movement`; -CREATE TABLE `wms_inventory_movement` ( - `id` bigint(20) NOT NULL AUTO_INCREMENT, - `inventory_movement_no` varchar(30) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '编号', - `source_rack_id` bigint(20) NULL DEFAULT NULL COMMENT '原货架Id', - `target_rack_id` bigint(20) NULL DEFAULT NULL COMMENT '目标货架', - `status` tinyint(4) NULL DEFAULT NULL COMMENT '状态', - `check_status` tinyint(4) NULL DEFAULT NULL COMMENT '审核状态', - `check_user_id` bigint(20) NULL DEFAULT NULL COMMENT '审核人', - `check_time` datetime(3) NULL DEFAULT NULL COMMENT '审核时间', - `remark` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '备注', - `del_flag` tinyint(4) NOT NULL DEFAULT 0 COMMENT '删除标识', - `create_by` bigint(20) NULL DEFAULT NULL COMMENT '创建人', - `create_time` datetime(3) NULL DEFAULT NULL COMMENT '创建时间', - `update_by` bigint(20) NULL DEFAULT NULL COMMENT '修改人', - `update_time` datetime(3) NULL DEFAULT NULL COMMENT '修改时间', - PRIMARY KEY (`id`) USING BTREE -) ENGINE = InnoDB AUTO_INCREMENT = 99 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '库存移动' ROW_FORMAT = Dynamic; - --- ---------------------------- --- Records of wms_inventory_movement --- ---------------------------- -INSERT INTO `wms_inventory_movement` VALUES (4, 'M-2022-11-02-162844', NULL, NULL, 24, NULL, NULL, NULL, '测试', 0, 1, '2022-11-02 16:38:04.000', 115, '2022-11-12 16:59:24.508'); -INSERT INTO `wms_inventory_movement` VALUES (5, 'M-2022-11-07-214759', NULL, NULL, 23, NULL, NULL, NULL, NULL, 0, 115, '2022-11-07 21:48:25.000', 1, '2022-12-01 11:23:06.364'); -INSERT INTO `wms_inventory_movement` VALUES (6, 'M-2022-11-10-135556', NULL, NULL, 21, NULL, NULL, NULL, NULL, 1, 115, '2022-11-10 13:56:18.866', NULL, NULL); -INSERT INTO `wms_inventory_movement` VALUES (7, 'M-2022-11-11-161911', NULL, NULL, 21, NULL, NULL, NULL, '这是移库的备注,要求100字之内。', 1, 115, '2022-11-11 16:19:58.000', 115, '2022-11-11 16:25:36.948'); -INSERT INTO `wms_inventory_movement` VALUES (8, 'M-2022-11-11-172656', NULL, NULL, 22, NULL, NULL, NULL, 'THIS IS YIKU!', 0, 115, '2022-11-11 17:30:31.000', 115, '2022-11-11 17:30:50.247'); -INSERT INTO `wms_inventory_movement` VALUES (9, 'M-2022-11-11-205127', NULL, NULL, 21, NULL, NULL, NULL, NULL, 1, 115, '2022-11-11 20:52:22.417', NULL, NULL); -INSERT INTO `wms_inventory_movement` VALUES (10, 'M-2022-11-13-231102', NULL, NULL, 21, NULL, NULL, NULL, NULL, 1, 115, '2022-11-13 23:11:40.712', NULL, NULL); -INSERT INTO `wms_inventory_movement` VALUES (11, 'M-2022-11-16-145020', NULL, NULL, 21, NULL, NULL, NULL, NULL, 1, 115, '2022-11-16 14:50:23.275', NULL, NULL); -INSERT INTO `wms_inventory_movement` VALUES (12, 'M-2022-11-25-224827', NULL, NULL, 21, NULL, NULL, NULL, NULL, 1, 115, '2022-11-25 22:49:12.661', NULL, NULL); -INSERT INTO `wms_inventory_movement` VALUES (13, 'M-2022-11-26-230159', NULL, NULL, 21, NULL, NULL, NULL, NULL, 1, 115, '2022-11-26 23:02:20.597', NULL, NULL); -INSERT INTO `wms_inventory_movement` VALUES (14, 'M-2022-11-26-230222', NULL, NULL, 21, NULL, NULL, NULL, NULL, 1, 115, '2022-11-26 23:03:15.271', NULL, NULL); -INSERT INTO `wms_inventory_movement` VALUES (15, 'M-2022-12-07-105253', NULL, NULL, 22, NULL, NULL, NULL, NULL, 0, 115, '2022-12-07 10:53:16.000', 115, '2022-12-09 19:41:34.397'); -INSERT INTO `wms_inventory_movement` VALUES (16, 'M-2022-12-07-152629', NULL, NULL, 21, NULL, NULL, NULL, NULL, 1, 115, '2022-12-07 15:26:58.790', NULL, NULL); -INSERT INTO `wms_inventory_movement` VALUES (17, 'M-2022-12-07-152724', NULL, NULL, 22, NULL, NULL, NULL, NULL, 0, 115, '2022-12-07 15:27:44.000', 115, '2022-12-28 13:42:51.800'); -INSERT INTO `wms_inventory_movement` VALUES (18, 'M-2022-12-09-191503', NULL, NULL, 21, NULL, NULL, NULL, NULL, 1, 115, '2022-12-09 19:15:32.778', NULL, NULL); -INSERT INTO `wms_inventory_movement` VALUES (19, 'M-2022-12-16-160301', NULL, NULL, 21, NULL, NULL, NULL, NULL, 1, 115, '2022-12-16 16:03:28.013', NULL, NULL); -INSERT INTO `wms_inventory_movement` VALUES (20, 'M-2023-01-09-014651', NULL, NULL, 21, NULL, NULL, NULL, NULL, 1, 115, '2023-01-09 01:47:22.541', NULL, NULL); -INSERT INTO `wms_inventory_movement` VALUES (21, 'M-2023-01-11-160556', NULL, NULL, 21, NULL, NULL, NULL, NULL, 0, 115, '2023-01-11 16:06:49.048', NULL, NULL); -INSERT INTO `wms_inventory_movement` VALUES (22, 'M-2023-01-12-134240', NULL, NULL, 21, NULL, NULL, NULL, '测试', 1, 115, '2023-01-12 13:44:00.482', NULL, NULL); -INSERT INTO `wms_inventory_movement` VALUES (23, 'M-2023-01-14-095257', NULL, NULL, 21, NULL, NULL, NULL, '111111', 1, 115, '2023-01-14 09:53:38.000', 115, '2023-01-14 09:56:14.662'); -INSERT INTO `wms_inventory_movement` VALUES (24, 'M-2023-01-20-234708', NULL, NULL, 21, NULL, NULL, NULL, NULL, 0, 115, '2023-01-20 23:47:45.584', NULL, NULL); -INSERT INTO `wms_inventory_movement` VALUES (25, 'M-2023-01-26-224430', NULL, NULL, 21, NULL, NULL, NULL, NULL, 0, 115, '2023-01-26 22:45:39.435', NULL, NULL); -INSERT INTO `wms_inventory_movement` VALUES (26, 'M-2023-01-31-115610', NULL, NULL, 23, NULL, NULL, NULL, NULL, 0, 115, '2023-01-31 11:56:31.000', 115, '2023-01-31 11:57:19.289'); -INSERT INTO `wms_inventory_movement` VALUES (27, 'M-2023-02-02-151424', NULL, NULL, 21, NULL, NULL, NULL, '11', 0, 115, '2023-02-02 15:14:47.032', NULL, NULL); -INSERT INTO `wms_inventory_movement` VALUES (28, 'M-2023-02-03-163557', NULL, NULL, 21, NULL, NULL, NULL, NULL, 0, 115, '2023-02-03 16:36:50.000', 115, '2023-02-04 15:59:42.382'); -INSERT INTO `wms_inventory_movement` VALUES (29, 'M-2023-02-04-155912', NULL, NULL, 23, NULL, NULL, NULL, NULL, 0, 115, '2023-02-04 15:59:26.000', 115, '2023-02-04 18:00:58.954'); -INSERT INTO `wms_inventory_movement` VALUES (30, 'M-2023-02-04-175734', NULL, NULL, 21, NULL, NULL, NULL, NULL, 0, 115, '2023-02-04 17:59:22.074', NULL, NULL); -INSERT INTO `wms_inventory_movement` VALUES (31, 'M-2023-02-06-113659', NULL, NULL, 21, NULL, NULL, NULL, NULL, 0, 115, '2023-02-06 11:37:26.075', NULL, NULL); -INSERT INTO `wms_inventory_movement` VALUES (32, 'M-2023-02-06-163009', NULL, NULL, 21, NULL, NULL, NULL, NULL, 0, 115, '2023-02-06 16:30:14.643', NULL, NULL); -INSERT INTO `wms_inventory_movement` VALUES (33, 'M-2023-02-08-122535', NULL, NULL, 24, NULL, NULL, NULL, NULL, 0, 115, '2023-02-08 12:25:53.000', 115, '2023-02-08 12:26:33.810'); -INSERT INTO `wms_inventory_movement` VALUES (34, 'M-2023-02-08-164113', NULL, NULL, 23, NULL, NULL, NULL, NULL, 0, 115, '2023-02-08 16:41:42.000', 115, '2023-02-08 16:43:52.760'); -INSERT INTO `wms_inventory_movement` VALUES (35, 'M-2023-02-09-144340', NULL, NULL, 23, NULL, NULL, NULL, NULL, 0, 115, '2023-02-09 14:44:06.000', 115, '2023-02-09 14:49:06.409'); -INSERT INTO `wms_inventory_movement` VALUES (36, 'M-2023-02-11-141000', NULL, NULL, 21, NULL, NULL, NULL, NULL, 0, 115, '2023-02-11 14:11:04.394', NULL, NULL); -INSERT INTO `wms_inventory_movement` VALUES (37, 'M-2023-02-11-200859', NULL, NULL, 21, NULL, NULL, NULL, '库区和货架有所调整,需将相关物品移库到新货架。', 0, 115, '2023-02-11 20:12:21.423', NULL, NULL); -INSERT INTO `wms_inventory_movement` VALUES (38, 'M-2023-02-11-201448', NULL, NULL, 21, NULL, NULL, NULL, '货架存货规则调整,物品移库到新货架上', 0, 115, '2023-02-11 20:15:50.508', NULL, NULL); -INSERT INTO `wms_inventory_movement` VALUES (39, 'M-2023-02-12-093617', NULL, NULL, 21, NULL, NULL, NULL, NULL, 0, 115, '2023-02-12 09:36:58.000', 115, '2023-02-12 09:37:24.795'); -INSERT INTO `wms_inventory_movement` VALUES (40, 'M-2023-02-12-103520', NULL, NULL, 21, NULL, NULL, NULL, NULL, 0, 115, '2023-02-12 10:35:54.699', NULL, NULL); -INSERT INTO `wms_inventory_movement` VALUES (41, 'M-2023-02-13-090937', NULL, NULL, 21, NULL, NULL, NULL, NULL, 0, 115, '2023-02-13 09:09:39.000', 115, '2023-02-13 09:10:16.161'); -INSERT INTO `wms_inventory_movement` VALUES (42, 'M-2023-02-13-091623', NULL, NULL, 21, NULL, NULL, NULL, NULL, 0, 115, '2023-02-13 09:16:56.328', NULL, NULL); -INSERT INTO `wms_inventory_movement` VALUES (43, 'M-2023-02-15-150619', NULL, NULL, 21, NULL, NULL, NULL, NULL, 0, 115, '2023-02-15 15:07:27.718', NULL, NULL); -INSERT INTO `wms_inventory_movement` VALUES (44, 'M-2023-02-15-164103', NULL, NULL, 21, NULL, NULL, NULL, NULL, 0, 115, '2023-02-15 16:37:47.370', NULL, NULL); -INSERT INTO `wms_inventory_movement` VALUES (45, 'M-2023-02-15-210429', NULL, NULL, 21, NULL, NULL, NULL, NULL, 0, 115, '2023-02-15 21:05:27.000', 115, '2023-02-15 21:05:49.345'); -INSERT INTO `wms_inventory_movement` VALUES (46, 'M-2023-02-16-135615', NULL, NULL, 24, NULL, NULL, NULL, NULL, 0, 115, '2023-02-16 13:57:25.000', 115, '2023-02-16 13:58:09.224'); -INSERT INTO `wms_inventory_movement` VALUES (47, 'M-2023-02-17-163727', NULL, NULL, 21, NULL, NULL, NULL, NULL, 0, 115, '2023-02-17 16:37:51.556', NULL, NULL); -INSERT INTO `wms_inventory_movement` VALUES (48, 'M-2023-02-21-142009', NULL, NULL, 23, NULL, NULL, NULL, NULL, 0, 115, '2023-02-21 14:20:31.000', 115, '2023-02-21 14:21:05.810'); -INSERT INTO `wms_inventory_movement` VALUES (49, 'M-2023-02-21-153848', NULL, NULL, 21, NULL, NULL, NULL, NULL, 0, 115, '2023-02-21 15:39:19.412', NULL, NULL); -INSERT INTO `wms_inventory_movement` VALUES (50, 'M-2023-02-22-164043', NULL, NULL, 21, NULL, NULL, NULL, NULL, 0, 115, '2023-02-22 16:41:23.549', NULL, NULL); -INSERT INTO `wms_inventory_movement` VALUES (51, 'M-2023-02-23-120125', NULL, NULL, 21, NULL, NULL, NULL, NULL, 0, 115, '2023-02-23 12:02:15.950', NULL, NULL); -INSERT INTO `wms_inventory_movement` VALUES (52, 'M-2023-02-23-145952', NULL, NULL, 21, NULL, NULL, NULL, NULL, 0, 115, '2023-02-23 15:00:16.987', NULL, NULL); -INSERT INTO `wms_inventory_movement` VALUES (53, 'M-2023-02-23-150049', NULL, NULL, 21, NULL, NULL, NULL, NULL, 0, 115, '2023-02-23 15:01:47.119', NULL, NULL); -INSERT INTO `wms_inventory_movement` VALUES (54, 'M-2023-02-28-103343', NULL, NULL, 21, NULL, NULL, NULL, NULL, 0, 115, '2023-02-28 10:35:38.976', NULL, NULL); -INSERT INTO `wms_inventory_movement` VALUES (55, 'M-2023-02-28-110521', NULL, NULL, 23, NULL, NULL, NULL, NULL, 0, 115, '2023-02-28 11:06:27.000', 115, '2023-02-28 11:07:08.810'); -INSERT INTO `wms_inventory_movement` VALUES (56, 'M-2023-03-02-093406', NULL, NULL, 23, NULL, NULL, NULL, '12', 0, 115, '2023-03-02 09:34:13.000', 115, '2023-03-02 09:36:22.823'); -INSERT INTO `wms_inventory_movement` VALUES (57, 'M-2023-03-02-094422', NULL, NULL, 23, NULL, NULL, NULL, '12', 0, 115, '2023-03-02 09:45:05.000', 115, '2023-03-02 09:46:27.606'); -INSERT INTO `wms_inventory_movement` VALUES (58, 'M-2023-03-03-083239', NULL, NULL, 21, NULL, NULL, NULL, NULL, 0, 115, '2023-03-03 08:32:51.992', NULL, NULL); -INSERT INTO `wms_inventory_movement` VALUES (59, 'M-2023-03-06-165212', NULL, NULL, 22, NULL, NULL, NULL, 'test', 0, 115, '2023-03-06 16:52:41.000', 115, '2023-03-06 16:55:41.138'); -INSERT INTO `wms_inventory_movement` VALUES (60, 'M-2023-03-09-014236', NULL, NULL, 21, NULL, NULL, NULL, NULL, 0, 115, '2023-03-09 01:42:59.198', NULL, NULL); -INSERT INTO `wms_inventory_movement` VALUES (61, 'M-2023-03-09-171017', NULL, NULL, 21, NULL, NULL, NULL, NULL, 0, 115, '2023-03-09 17:10:49.236', NULL, NULL); -INSERT INTO `wms_inventory_movement` VALUES (62, 'M-2023-03-13-211038', NULL, NULL, 21, NULL, NULL, NULL, NULL, 0, 115, '2023-03-13 21:12:26.000', 115, '2023-03-13 21:14:33.607'); -INSERT INTO `wms_inventory_movement` VALUES (63, 'M-2023-03-15-104621', NULL, NULL, 21, NULL, NULL, NULL, NULL, 0, 115, '2023-03-15 10:47:02.735', NULL, NULL); -INSERT INTO `wms_inventory_movement` VALUES (64, 'M-2023-03-16-165142', NULL, NULL, 21, NULL, NULL, NULL, NULL, 0, 115, '2023-03-16 16:52:10.384', NULL, NULL); -INSERT INTO `wms_inventory_movement` VALUES (65, 'M-2023-03-16-182424', NULL, NULL, 21, NULL, NULL, NULL, NULL, 0, 115, '2023-03-16 18:25:52.025', NULL, NULL); -INSERT INTO `wms_inventory_movement` VALUES (66, 'M-2023-03-16-182908', NULL, NULL, 23, NULL, NULL, NULL, NULL, 0, 115, '2023-03-16 18:29:56.000', 115, '2023-03-16 18:32:12.656'); -INSERT INTO `wms_inventory_movement` VALUES (67, 'M-2023-03-20-135242', NULL, NULL, 21, NULL, NULL, NULL, NULL, 0, 115, '2023-03-20 13:52:59.049', NULL, NULL); -INSERT INTO `wms_inventory_movement` VALUES (68, 'M-2023-03-22-161342', NULL, NULL, 23, NULL, NULL, NULL, NULL, 0, 115, '2023-03-22 16:14:04.000', 115, '2023-03-22 16:15:01.759'); -INSERT INTO `wms_inventory_movement` VALUES (69, 'M-2023-03-22-225330', NULL, NULL, 21, NULL, NULL, NULL, NULL, 0, 115, '2023-03-22 22:53:55.738', NULL, NULL); -INSERT INTO `wms_inventory_movement` VALUES (70, 'M-2023-03-23-094905', NULL, NULL, 21, NULL, NULL, NULL, NULL, 0, 115, '2023-03-23 09:49:37.620', NULL, NULL); -INSERT INTO `wms_inventory_movement` VALUES (71, 'M-2023-03-23-143802', NULL, NULL, 21, NULL, NULL, NULL, NULL, 0, 115, '2023-03-23 14:38:49.646', NULL, NULL); -INSERT INTO `wms_inventory_movement` VALUES (72, 'M-2023-03-29-114618', NULL, NULL, 21, NULL, NULL, NULL, '21', 0, 115, '2023-03-29 11:46:50.529', NULL, NULL); -INSERT INTO `wms_inventory_movement` VALUES (73, 'M-2023-03-30-113433', NULL, NULL, 21, NULL, NULL, NULL, NULL, 0, 115, '2023-03-30 11:34:48.701', NULL, NULL); -INSERT INTO `wms_inventory_movement` VALUES (74, 'M-2023-03-30-183501', NULL, NULL, 21, NULL, NULL, NULL, NULL, 0, 115, '2023-03-30 18:36:35.826', NULL, NULL); -INSERT INTO `wms_inventory_movement` VALUES (75, 'M-2023-04-03-090308', NULL, NULL, 21, NULL, NULL, NULL, NULL, 0, 115, '2023-04-03 09:03:41.287', NULL, NULL); -INSERT INTO `wms_inventory_movement` VALUES (76, 'M-2023-04-03-144422', NULL, NULL, 21, NULL, NULL, NULL, NULL, 0, 115, '2023-04-03 14:44:51.096', NULL, NULL); -INSERT INTO `wms_inventory_movement` VALUES (77, 'M-2023-04-06-145744', NULL, NULL, 21, NULL, NULL, NULL, NULL, 0, 115, '2023-04-06 14:58:16.812', NULL, NULL); -INSERT INTO `wms_inventory_movement` VALUES (78, 'M-2023-04-08-141029', NULL, NULL, 21, NULL, NULL, NULL, NULL, 0, 115, '2023-04-08 14:11:22.011', NULL, NULL); -INSERT INTO `wms_inventory_movement` VALUES (79, 'M-2023-04-10-214934', NULL, NULL, 21, NULL, NULL, NULL, NULL, 0, 115, '2023-04-10 21:49:52.884', NULL, NULL); -INSERT INTO `wms_inventory_movement` VALUES (80, 'M-2023-04-10-215917', NULL, NULL, 21, NULL, NULL, NULL, NULL, 0, 115, '2023-04-10 22:00:56.847', NULL, NULL); -INSERT INTO `wms_inventory_movement` VALUES (81, 'M-2023-04-10-220105', NULL, NULL, 21, NULL, NULL, NULL, NULL, 0, 115, '2023-04-10 22:01:14.910', NULL, NULL); -INSERT INTO `wms_inventory_movement` VALUES (82, 'M-2023-04-11-135737', NULL, NULL, 21, NULL, NULL, NULL, NULL, 0, 115, '2023-04-11 13:57:57.000', 115, '2023-04-11 14:06:06.789'); -INSERT INTO `wms_inventory_movement` VALUES (83, 'M-2023-04-12-172822', NULL, NULL, 21, NULL, NULL, NULL, NULL, 0, 115, '2023-04-12 17:28:39.630', NULL, NULL); -INSERT INTO `wms_inventory_movement` VALUES (84, 'M-2023-04-12-210150', NULL, NULL, 21, NULL, NULL, NULL, '临时测试', 0, 115, '2023-04-12 21:02:27.453', NULL, NULL); -INSERT INTO `wms_inventory_movement` VALUES (85, 'M-2023-04-13-135345', NULL, NULL, 23, NULL, NULL, NULL, NULL, 0, 115, '2023-04-13 13:54:28.000', 115, '2023-04-13 13:55:12.898'); -INSERT INTO `wms_inventory_movement` VALUES (86, 'M-2023-04-13-151416', NULL, NULL, 21, NULL, NULL, NULL, NULL, 0, 115, '2023-04-13 15:14:58.019', NULL, NULL); -INSERT INTO `wms_inventory_movement` VALUES (87, 'M-2023-04-13-214805', NULL, NULL, 21, NULL, NULL, NULL, 'cs', 0, 115, '2023-04-13 21:49:19.630', NULL, NULL); -INSERT INTO `wms_inventory_movement` VALUES (88, 'M-2023-04-14-180220', NULL, NULL, 21, NULL, NULL, NULL, NULL, 0, 115, '2023-04-14 18:03:00.499', NULL, NULL); -INSERT INTO `wms_inventory_movement` VALUES (89, 'M-2023-04-15-162900', NULL, NULL, 21, NULL, NULL, NULL, 'sfsdf', 0, 115, '2023-04-15 16:29:18.208', NULL, NULL); -INSERT INTO `wms_inventory_movement` VALUES (90, 'M-2023-04-17-134138', NULL, NULL, 21, NULL, NULL, NULL, '我是新建的移库单', 1, 115, '2023-04-17 13:43:09.000', 115, '2023-04-17 13:45:46.125'); -INSERT INTO `wms_inventory_movement` VALUES (91, 'M-2023-04-17-134821', NULL, NULL, 23, NULL, NULL, NULL, 'a000000', 0, 115, '2023-04-17 13:49:09.000', 115, '2023-04-17 13:50:44.369'); -INSERT INTO `wms_inventory_movement` VALUES (92, 'M-2023-04-17-150809', NULL, NULL, 21, NULL, NULL, NULL, '12313213213521352132', 0, 115, '2023-04-17 15:09:30.000', NULL, NULL); -INSERT INTO `wms_inventory_movement` VALUES (93, 'M-2023-04-19-100559', NULL, NULL, 21, NULL, NULL, NULL, NULL, 0, 115, '2023-04-19 10:06:25.847', NULL, NULL); -INSERT INTO `wms_inventory_movement` VALUES (94, 'M-2023-04-19-205405', NULL, NULL, 21, NULL, NULL, NULL, NULL, 0, 115, '2023-04-19 20:55:23.771', NULL, NULL); -INSERT INTO `wms_inventory_movement` VALUES (95, 'M-2023-04-21-150041', NULL, NULL, 21, NULL, NULL, NULL, NULL, 0, 115, '2023-04-21 15:01:06.609', NULL, NULL); -INSERT INTO `wms_inventory_movement` VALUES (96, 'M-2023-04-24-153715', NULL, NULL, 21, NULL, NULL, NULL, NULL, 0, 115, '2023-04-24 15:37:31.000', 115, '2023-04-24 15:38:27.688'); -INSERT INTO `wms_inventory_movement` VALUES (97, 'M-2023-04-26-115348', NULL, NULL, 21, NULL, NULL, NULL, 'fdef', 0, 115, '2023-04-26 11:54:39.178', NULL, NULL); -INSERT INTO `wms_inventory_movement` VALUES (98, 'M-2023-04-29-170422', NULL, NULL, 21, NULL, NULL, NULL, NULL, 0, 115, '2023-04-29 17:04:49.929', NULL, NULL); - --- ---------------------------- --- Table structure for wms_inventory_movement_detail --- ---------------------------- -DROP TABLE IF EXISTS `wms_inventory_movement_detail`; -CREATE TABLE `wms_inventory_movement_detail` ( - `id` bigint(20) NOT NULL AUTO_INCREMENT, - `inventory_movement_id` bigint(20) NULL DEFAULT NULL COMMENT '库存移动Id', - `item_id` bigint(20) NULL DEFAULT NULL COMMENT '物料', - `plan_quantity` decimal(20, 2) NULL DEFAULT NULL COMMENT '计划数量', - `real_quantity` decimal(20, 2) NULL DEFAULT NULL COMMENT '实际数量', - `del_flag` tinyint(4) NOT NULL DEFAULT 0 COMMENT '删除标识', - `remark` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '备注', - `create_by` bigint(20) NULL DEFAULT NULL COMMENT '创建人', - `create_time` datetime(3) NULL DEFAULT NULL COMMENT '创建时间', - `update_by` bigint(20) NULL DEFAULT NULL COMMENT '修改人', - `update_time` datetime(3) NULL DEFAULT NULL COMMENT '修改时间', - `source_rack_id` bigint(20) NULL DEFAULT NULL COMMENT '源货架', - `source_warehouse_id` bigint(20) NULL DEFAULT NULL COMMENT '源仓库', - `source_area_id` bigint(20) NULL DEFAULT NULL COMMENT '源库区', - `move_status` tinyint(4) NULL DEFAULT NULL COMMENT '移库状态', - `target_rack_id` bigint(20) NULL DEFAULT NULL COMMENT '目标货架', - `target_warehouse_id` bigint(20) NULL DEFAULT NULL COMMENT '目标仓库', - `target_area_id` bigint(20) NULL DEFAULT NULL COMMENT '目标库区', - PRIMARY KEY (`id`) USING BTREE -) ENGINE = InnoDB AUTO_INCREMENT = 198 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '库存移动详情' ROW_FORMAT = Dynamic; - --- ---------------------------- --- Records of wms_inventory_movement_detail --- ---------------------------- -INSERT INTO `wms_inventory_movement_detail` VALUES (27, 6, 1, 1.00, NULL, 0, NULL, NULL, NULL, NULL, NULL, 1, 2, 17, 21, 5, 4, 13); -INSERT INTO `wms_inventory_movement_detail` VALUES (30, 7, 5, 10.00, 1.00, 0, NULL, NULL, NULL, NULL, NULL, NULL, 20, 41, 21, NULL, 20, 42); -INSERT INTO `wms_inventory_movement_detail` VALUES (33, 8, 8, 40.00, 40.00, 0, NULL, NULL, NULL, NULL, NULL, 11, 21, 44, 22, NULL, 22, NULL); -INSERT INTO `wms_inventory_movement_detail` VALUES (34, 9, 6, 1.00, NULL, 0, NULL, NULL, NULL, NULL, NULL, 7, 14, 16, 21, NULL, 2, 17); -INSERT INTO `wms_inventory_movement_detail` VALUES (37, 4, 2, 20.00, 29.00, 0, NULL, NULL, NULL, NULL, NULL, 1, 1, 13, 24, 6, 2, 18); -INSERT INTO `wms_inventory_movement_detail` VALUES (38, 4, 1, 10.00, 1.00, 0, NULL, NULL, NULL, NULL, NULL, 1, 1, 13, 24, NULL, 4, NULL); -INSERT INTO `wms_inventory_movement_detail` VALUES (39, 10, 12, 1.00, NULL, 0, NULL, NULL, NULL, NULL, NULL, 1, 2, 17, 21, NULL, 4, 13); -INSERT INTO `wms_inventory_movement_detail` VALUES (40, 12, 13, 1.00, NULL, 0, NULL, NULL, NULL, NULL, NULL, 21, 2, 45, 21, 19, 14, 46); -INSERT INTO `wms_inventory_movement_detail` VALUES (41, 13, 13, 1.00, NULL, 0, NULL, NULL, NULL, NULL, NULL, 19, 14, 46, 21, NULL, 4, NULL); -INSERT INTO `wms_inventory_movement_detail` VALUES (42, 14, 13, 1.00, NULL, 0, NULL, NULL, NULL, NULL, NULL, 21, 2, 45, 21, NULL, 4, NULL); -INSERT INTO `wms_inventory_movement_detail` VALUES (43, 14, 22, 1.00, NULL, 0, NULL, NULL, NULL, NULL, NULL, 19, 14, 46, 21, NULL, 4, NULL); -INSERT INTO `wms_inventory_movement_detail` VALUES (45, 5, 28, 1.00, 1.00, 0, NULL, NULL, NULL, NULL, NULL, NULL, 4, 54, 23, NULL, 14, 53); -INSERT INTO `wms_inventory_movement_detail` VALUES (47, 16, 29, 1.00, NULL, 0, NULL, NULL, NULL, NULL, NULL, 24, 30, 56, 21, 25, 31, 57); -INSERT INTO `wms_inventory_movement_detail` VALUES (49, 18, 32, 1.00, NULL, 0, NULL, NULL, NULL, NULL, NULL, 24, 31, 56, 21, NULL, 32, NULL); -INSERT INTO `wms_inventory_movement_detail` VALUES (50, 15, 29, 1.00, 1.00, 0, NULL, NULL, NULL, NULL, NULL, NULL, 30, NULL, 22, 24, 31, 56); -INSERT INTO `wms_inventory_movement_detail` VALUES (52, 19, 58, 1.00, NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL, 40, NULL, 21, NULL, 42, NULL); -INSERT INTO `wms_inventory_movement_detail` VALUES (53, 17, 58, 3.00, 1.00, 0, NULL, NULL, NULL, NULL, NULL, NULL, 38, 61, 22, NULL, 42, 63); -INSERT INTO `wms_inventory_movement_detail` VALUES (54, 20, 75, 1.00, NULL, 0, NULL, NULL, NULL, NULL, NULL, 37, 61, 77, 21, 38, 61, 77); -INSERT INTO `wms_inventory_movement_detail` VALUES (55, 21, 75, 1.00, NULL, 0, NULL, NULL, NULL, NULL, NULL, 40, 61, 78, 21, 42, 61, 79); -INSERT INTO `wms_inventory_movement_detail` VALUES (56, 22, 75, 1.00, NULL, 0, NULL, NULL, NULL, NULL, NULL, 37, 61, 77, 21, 47, 64, 82); -INSERT INTO `wms_inventory_movement_detail` VALUES (58, 23, 78, 2.00, NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL, 69, NULL, 21, NULL, 66, NULL); -INSERT INTO `wms_inventory_movement_detail` VALUES (59, 24, 80, 1.00, NULL, 0, NULL, NULL, NULL, NULL, NULL, 50, 65, 86, 21, 51, 65, 86); -INSERT INTO `wms_inventory_movement_detail` VALUES (60, 25, 87, 1.00, NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL, 67, 84, 21, NULL, 68, 85); -INSERT INTO `wms_inventory_movement_detail` VALUES (63, 26, 88, 1.00, 1.00, 0, NULL, NULL, NULL, NULL, NULL, NULL, 66, 86, 23, NULL, 67, NULL); -INSERT INTO `wms_inventory_movement_detail` VALUES (64, 27, 89, 1.00, NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL, 75, NULL, 21, NULL, 75, 90); -INSERT INTO `wms_inventory_movement_detail` VALUES (68, 28, 91, 1000.00, NULL, 0, NULL, NULL, NULL, NULL, NULL, 49, 75, 90, 21, 50, 76, 89); -INSERT INTO `wms_inventory_movement_detail` VALUES (69, 28, 90, 1200.00, NULL, 0, NULL, NULL, NULL, NULL, NULL, 50, 76, 89, 21, 49, 75, 90); -INSERT INTO `wms_inventory_movement_detail` VALUES (70, 30, 90, 1.00, NULL, 0, NULL, NULL, NULL, NULL, NULL, 49, 75, 90, 21, 52, 78, 92); -INSERT INTO `wms_inventory_movement_detail` VALUES (71, 30, 89, 1.00, NULL, 0, NULL, NULL, NULL, NULL, NULL, 50, 76, 89, 21, 51, 77, 91); -INSERT INTO `wms_inventory_movement_detail` VALUES (73, 29, 90, 1.00, 1.00, 0, NULL, NULL, NULL, NULL, NULL, 49, 75, 90, 23, 51, 77, 91); -INSERT INTO `wms_inventory_movement_detail` VALUES (74, 31, 92, 1.00, NULL, 0, NULL, NULL, NULL, NULL, NULL, 50, 76, 89, 21, 51, 77, 91); -INSERT INTO `wms_inventory_movement_detail` VALUES (76, 33, 97, 1.00, 1.00, 0, NULL, NULL, NULL, NULL, NULL, NULL, 83, NULL, 24, NULL, 85, NULL); -INSERT INTO `wms_inventory_movement_detail` VALUES (78, 34, 99, 2.00, 1.00, 0, NULL, NULL, NULL, NULL, NULL, 57, 87, 100, 23, 55, 86, 98); -INSERT INTO `wms_inventory_movement_detail` VALUES (83, 35, 99, 1.00, 1.00, 0, NULL, NULL, NULL, NULL, NULL, 53, 83, 94, 23, NULL, 84, NULL); -INSERT INTO `wms_inventory_movement_detail` VALUES (84, 36, 99, 6.00, NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL, 88, NULL, 21, NULL, 91, 108); -INSERT INTO `wms_inventory_movement_detail` VALUES (85, 37, 99, 20.00, NULL, 0, NULL, NULL, NULL, NULL, NULL, 61, 91, 105, 21, NULL, 88, NULL); -INSERT INTO `wms_inventory_movement_detail` VALUES (86, 38, 99, 10.00, NULL, 0, NULL, NULL, NULL, NULL, NULL, 61, 91, 105, 21, 55, 86, 98); -INSERT INTO `wms_inventory_movement_detail` VALUES (88, 39, 101, 2.00, 1.00, 0, NULL, NULL, NULL, NULL, NULL, 55, 86, 98, 21, 49, 84, 96); -INSERT INTO `wms_inventory_movement_detail` VALUES (89, 40, 101, 3.00, NULL, 0, NULL, NULL, NULL, NULL, NULL, 55, 86, 98, 21, NULL, 86, 99); -INSERT INTO `wms_inventory_movement_detail` VALUES (90, 41, 102, 1.00, NULL, 0, NULL, NULL, NULL, NULL, NULL, 49, 84, 96, 21, NULL, 86, 99); -INSERT INTO `wms_inventory_movement_detail` VALUES (91, 42, 102, 1.00, NULL, 0, NULL, NULL, NULL, NULL, NULL, 49, 84, 96, 21, NULL, 86, 99); -INSERT INTO `wms_inventory_movement_detail` VALUES (92, 43, 107, 2.00, NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL, 84, 90, 21, 55, 86, 98); -INSERT INTO `wms_inventory_movement_detail` VALUES (93, 43, 106, 2.00, NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL, 84, 90, 21, NULL, 88, NULL); -INSERT INTO `wms_inventory_movement_detail` VALUES (94, 43, 105, 2.00, NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL, 89, 103, 21, NULL, 84, 90); -INSERT INTO `wms_inventory_movement_detail` VALUES (95, 44, 107, 1.00, NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL, 84, 90, 21, 49, 84, 96); -INSERT INTO `wms_inventory_movement_detail` VALUES (99, 45, 107, 2.00, NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL, 86, 99, 21, NULL, 88, NULL); -INSERT INTO `wms_inventory_movement_detail` VALUES (100, 45, 106, 2.00, NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL, 86, 99, 21, NULL, 89, 103); -INSERT INTO `wms_inventory_movement_detail` VALUES (101, 45, 105, 2.00, NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL, 91, 108, 21, NULL, 91, 107); -INSERT INTO `wms_inventory_movement_detail` VALUES (104, 46, 107, 1.00, 1.00, 0, NULL, NULL, NULL, NULL, NULL, NULL, 93, NULL, 24, NULL, 86, 99); -INSERT INTO `wms_inventory_movement_detail` VALUES (105, 46, 102, 1.00, 1.00, 0, NULL, NULL, NULL, NULL, NULL, NULL, 88, NULL, 24, NULL, 84, 96); -INSERT INTO `wms_inventory_movement_detail` VALUES (106, 47, 114, 90.00, NULL, 0, NULL, NULL, NULL, NULL, NULL, 67, 102, 116, 21, NULL, 101, 115); -INSERT INTO `wms_inventory_movement_detail` VALUES (109, 48, 117, 11.00, 1.00, 0, NULL, NULL, NULL, NULL, NULL, 68, 106, 118, 23, NULL, 105, NULL); -INSERT INTO `wms_inventory_movement_detail` VALUES (110, 49, 117, 1.00, NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL, 105, NULL, 21, 68, 106, 118); -INSERT INTO `wms_inventory_movement_detail` VALUES (111, 50, 117, 1.00, NULL, 0, NULL, NULL, NULL, NULL, NULL, 68, 106, 118, 21, NULL, 107, NULL); -INSERT INTO `wms_inventory_movement_detail` VALUES (112, 51, 117, 4.00, NULL, 0, NULL, NULL, NULL, NULL, NULL, 68, 106, 118, 21, NULL, 107, NULL); -INSERT INTO `wms_inventory_movement_detail` VALUES (113, 51, 115, 1.00, NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL, 105, NULL, 21, 68, 106, 118); -INSERT INTO `wms_inventory_movement_detail` VALUES (114, 52, 117, 1.00, NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL, 105, NULL, 21, NULL, 107, NULL); -INSERT INTO `wms_inventory_movement_detail` VALUES (115, 53, 117, 2.00, NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL, 105, NULL, 21, NULL, 108, NULL); -INSERT INTO `wms_inventory_movement_detail` VALUES (116, 53, 115, 2.00, NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL, 105, NULL, 21, NULL, 107, NULL); -INSERT INTO `wms_inventory_movement_detail` VALUES (117, 53, 113, 2.00, NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL, 105, NULL, 21, NULL, 107, NULL); -INSERT INTO `wms_inventory_movement_detail` VALUES (118, 54, 121, 13.00, NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL, 114, NULL, 21, NULL, 111, NULL); -INSERT INTO `wms_inventory_movement_detail` VALUES (119, 54, 120, 1.00, NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL, 113, NULL, 21, NULL, 111, NULL); -INSERT INTO `wms_inventory_movement_detail` VALUES (120, 54, 119, 2.00, NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL, 113, NULL, 21, NULL, 111, NULL); -INSERT INTO `wms_inventory_movement_detail` VALUES (121, 54, 118, 1.00, NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL, 114, NULL, 21, NULL, 111, NULL); -INSERT INTO `wms_inventory_movement_detail` VALUES (124, 55, 121, 4.00, 1.00, 0, NULL, NULL, NULL, NULL, NULL, NULL, 111, NULL, 23, NULL, 113, NULL); -INSERT INTO `wms_inventory_movement_detail` VALUES (126, 56, 125, 100.00, 1.00, 0, NULL, NULL, NULL, NULL, NULL, 77, 118, 128, 23, 78, 118, 129); -INSERT INTO `wms_inventory_movement_detail` VALUES (128, 57, 125, 100.00, 100.00, 0, NULL, NULL, NULL, NULL, NULL, 77, 118, 128, 23, 78, 118, 129); -INSERT INTO `wms_inventory_movement_detail` VALUES (129, 58, 125, 1.00, NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL, 116, NULL, 21, NULL, 117, 127); -INSERT INTO `wms_inventory_movement_detail` VALUES (133, 59, 130, 100.00, 10.00, 0, NULL, NULL, NULL, NULL, NULL, NULL, 117, 127, 22, 78, 118, 129); -INSERT INTO `wms_inventory_movement_detail` VALUES (134, 61, 133, 1.00, NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL, 117, 127, 21, 83, 119, 130); -INSERT INTO `wms_inventory_movement_detail` VALUES (139, 62, 140, 1.00, 1.00, 0, NULL, NULL, NULL, NULL, NULL, 96, 135, 147, 21, 97, 135, 147); -INSERT INTO `wms_inventory_movement_detail` VALUES (140, 62, 139, 1.00, 1.00, 0, NULL, NULL, NULL, NULL, NULL, 97, 135, 147, 21, NULL, 136, 145); -INSERT INTO `wms_inventory_movement_detail` VALUES (141, 63, 142, 1.00, NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL, 137, NULL, 21, NULL, 136, 145); -INSERT INTO `wms_inventory_movement_detail` VALUES (142, 63, 141, 1.00, NULL, 0, NULL, NULL, NULL, NULL, NULL, 96, 135, 147, 21, NULL, 135, 149); -INSERT INTO `wms_inventory_movement_detail` VALUES (143, 64, 142, 1.00, NULL, 0, NULL, NULL, NULL, NULL, NULL, 96, 135, 147, 21, 97, 135, 147); -INSERT INTO `wms_inventory_movement_detail` VALUES (144, 65, 141, 2.00, NULL, 0, NULL, NULL, NULL, NULL, NULL, 96, 135, 147, 21, NULL, 135, 149); -INSERT INTO `wms_inventory_movement_detail` VALUES (146, 66, 141, 1.00, 1.00, 0, NULL, NULL, NULL, NULL, NULL, NULL, 137, NULL, 23, NULL, 135, 149); -INSERT INTO `wms_inventory_movement_detail` VALUES (147, 67, 143, 1.00, NULL, 0, NULL, NULL, NULL, NULL, NULL, 97, 135, 147, 21, NULL, 135, 149); -INSERT INTO `wms_inventory_movement_detail` VALUES (150, 68, 147, 1.00, 1.00, 0, NULL, NULL, NULL, NULL, NULL, 100, 154, 152, 23, 101, 154, 152); -INSERT INTO `wms_inventory_movement_detail` VALUES (151, 69, 148, 1.00, NULL, 0, NULL, NULL, NULL, NULL, NULL, 98, 137, 148, 21, 102, 155, 153); -INSERT INTO `wms_inventory_movement_detail` VALUES (152, 70, 141, 1.00, NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL, 138, 150, 21, 98, 137, 148); -INSERT INTO `wms_inventory_movement_detail` VALUES (153, 71, 150, 1.00, NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL, 139, NULL, 21, NULL, 140, NULL); -INSERT INTO `wms_inventory_movement_detail` VALUES (154, 72, 161, 1.00, NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL, 138, 150, 21, NULL, 140, NULL); -INSERT INTO `wms_inventory_movement_detail` VALUES (155, 73, 161, 1.00, NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL, 138, 150, 21, NULL, 139, 155); -INSERT INTO `wms_inventory_movement_detail` VALUES (156, 74, 162, 1.00, NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL, 138, 160, 21, NULL, 138, 150); -INSERT INTO `wms_inventory_movement_detail` VALUES (157, 75, 158, 6.00, NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL, 140, 145, 21, 107, 139, 155); -INSERT INTO `wms_inventory_movement_detail` VALUES (158, 76, 162, 1.00, NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL, 138, 150, 21, 104, 139, 155); -INSERT INTO `wms_inventory_movement_detail` VALUES (159, 77, 168, 1.00, NULL, 0, NULL, NULL, NULL, NULL, NULL, 107, 139, 155, 21, NULL, 140, 145); -INSERT INTO `wms_inventory_movement_detail` VALUES (160, 78, 170, 20.00, NULL, 0, NULL, NULL, NULL, NULL, NULL, 107, 139, 155, 21, 104, 139, 155); -INSERT INTO `wms_inventory_movement_detail` VALUES (161, 78, 169, 1.00, NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL, 151, NULL, 21, NULL, 147, NULL); -INSERT INTO `wms_inventory_movement_detail` VALUES (162, 78, 168, 1.00, NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL, 151, NULL, 21, NULL, 147, NULL); -INSERT INTO `wms_inventory_movement_detail` VALUES (163, 79, 172, 9.00, NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL, 154, NULL, 21, NULL, 157, NULL); -INSERT INTO `wms_inventory_movement_detail` VALUES (164, 80, 172, 999999.00, NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL, 154, NULL, 21, NULL, 157, NULL); -INSERT INTO `wms_inventory_movement_detail` VALUES (165, 81, 171, 2147483647.00, NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL, 154, NULL, 21, NULL, 157, NULL); -INSERT INTO `wms_inventory_movement_detail` VALUES (167, 82, 173, 1.00, NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL, 190, NULL, 21, NULL, 189, NULL); -INSERT INTO `wms_inventory_movement_detail` VALUES (168, 83, 173, 1.00, NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL, 157, NULL, 21, NULL, 158, NULL); -INSERT INTO `wms_inventory_movement_detail` VALUES (169, 84, 173, 20.00, NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL, 164, NULL, 21, NULL, 165, NULL); -INSERT INTO `wms_inventory_movement_detail` VALUES (171, 85, 180, 5000.00, 1.00, 0, NULL, NULL, NULL, NULL, NULL, 122, 198, 185, 23, NULL, 199, 186); -INSERT INTO `wms_inventory_movement_detail` VALUES (172, 86, 180, 3.00, NULL, 0, NULL, NULL, NULL, NULL, NULL, 116, 192, 178, 21, 118, 194, 181); -INSERT INTO `wms_inventory_movement_detail` VALUES (173, 87, 180, 5.00, NULL, 0, NULL, NULL, NULL, NULL, NULL, 116, 192, 178, 21, 118, 194, 181); -INSERT INTO `wms_inventory_movement_detail` VALUES (174, 87, 178, 5.00, NULL, 0, NULL, NULL, NULL, NULL, NULL, 118, 194, 181, 21, NULL, 196, 183); -INSERT INTO `wms_inventory_movement_detail` VALUES (175, 87, 173, 1.00, NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL, 198, NULL, 21, NULL, 192, NULL); -INSERT INTO `wms_inventory_movement_detail` VALUES (176, 87, 172, 1.00, NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL, 196, NULL, 21, NULL, 198, NULL); -INSERT INTO `wms_inventory_movement_detail` VALUES (177, 88, 180, 1.00, NULL, 0, NULL, NULL, NULL, NULL, NULL, 116, 192, 178, 21, 117, 193, 180); -INSERT INTO `wms_inventory_movement_detail` VALUES (178, 88, 178, 1.00, NULL, 0, NULL, NULL, NULL, NULL, NULL, 117, 193, 180, 21, 118, 194, 181); -INSERT INTO `wms_inventory_movement_detail` VALUES (179, 89, 180, 1.00, NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL, 193, NULL, 21, NULL, 194, NULL); -INSERT INTO `wms_inventory_movement_detail` VALUES (182, 90, 178, 100.00, 1.00, 0, NULL, NULL, NULL, NULL, NULL, NULL, 194, 181, 21, 124, 193, 178); -INSERT INTO `wms_inventory_movement_detail` VALUES (183, 90, 176, 20.00, 1.00, 0, NULL, NULL, NULL, NULL, NULL, 117, 193, 180, 21, NULL, 193, NULL); -INSERT INTO `wms_inventory_movement_detail` VALUES (188, 91, 180, 5.00, 3.00, 0, NULL, NULL, NULL, NULL, NULL, NULL, 198, 185, 23, 123, 199, 186); -INSERT INTO `wms_inventory_movement_detail` VALUES (189, 92, 180, 5.00, NULL, 0, NULL, NULL, NULL, NULL, NULL, 122, 198, 185, 21, 123, 199, 186); -INSERT INTO `wms_inventory_movement_detail` VALUES (190, 93, 182, 1.00, NULL, 0, NULL, NULL, NULL, NULL, NULL, 124, 193, 178, 21, 118, 194, 181); -INSERT INTO `wms_inventory_movement_detail` VALUES (191, 94, 182, 1.00, NULL, 0, NULL, NULL, NULL, NULL, NULL, 118, 194, 181, 21, NULL, 196, 183); -INSERT INTO `wms_inventory_movement_detail` VALUES (192, 94, 181, 1.00, NULL, 0, NULL, NULL, NULL, NULL, NULL, 118, 194, 181, 21, 119, 195, 182); -INSERT INTO `wms_inventory_movement_detail` VALUES (193, 95, 182, 1.00, NULL, 0, NULL, NULL, NULL, NULL, NULL, 118, 194, 181, 21, NULL, 196, 183); -INSERT INTO `wms_inventory_movement_detail` VALUES (195, 96, 185, 10.00, NULL, 0, NULL, NULL, NULL, NULL, NULL, 127, 215, 189, 21, 118, 194, 181); -INSERT INTO `wms_inventory_movement_detail` VALUES (196, 97, 182, 1.00, NULL, 0, NULL, NULL, NULL, NULL, NULL, 117, 194, 181, 21, 118, 194, 181); -INSERT INTO `wms_inventory_movement_detail` VALUES (197, 98, 188, 1.00, NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL, 198, 185, 21, NULL, 198, 211); - --- ---------------------------- --- Table structure for wms_item --- ---------------------------- -DROP TABLE IF EXISTS `wms_item`; -CREATE TABLE `wms_item` ( - `id` bigint(20) NOT NULL AUTO_INCREMENT, - `item_no` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '编号', - `item_name` varchar(60) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '名称', - `item_type` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '分类', - `unit` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '单位类别', - `rack_id` bigint(20) NULL DEFAULT NULL COMMENT '所属货架', - `area_id` bigint(20) NULL DEFAULT NULL COMMENT '所属库区', - `warehouse_id` bigint(20) NULL DEFAULT NULL COMMENT '所属仓库', - `quantity` decimal(20, 2) NULL DEFAULT NULL COMMENT '安全库存', - `expiry_date` datetime(3) NULL DEFAULT NULL COMMENT '有效期', - `del_flag` tinyint(4) NOT NULL DEFAULT 0 COMMENT '删除标识', - `remark` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '备注', - `create_by` bigint(20) NULL DEFAULT NULL COMMENT '创建人', - `create_time` datetime(3) NULL DEFAULT NULL COMMENT '创建时间', - `update_by` bigint(20) NULL DEFAULT NULL COMMENT '修改人', - `update_time` datetime(3) NULL DEFAULT NULL COMMENT '修改时间', - PRIMARY KEY (`id`) USING BTREE -) ENGINE = InnoDB AUTO_INCREMENT = 194 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '物料' ROW_FORMAT = Dynamic; - --- ---------------------------- --- Records of wms_item --- ---------------------------- -INSERT INTO `wms_item` VALUES (1, 'yejingpin', '液晶屏', '200', '个', NULL, 13, 1, 100000.00, NULL, 1, NULL, 1, '2022-08-10 11:31:24.000', 1, '2022-10-11 18:12:43.959'); -INSERT INTO `wms_item` VALUES (2, 'shoujike', '手机壳', '200', NULL, NULL, 18, 2, NULL, NULL, 1, NULL, 1, '2022-08-10 11:32:50.000', 1, '2022-10-10 15:46:59.106'); -INSERT INTO `wms_item` VALUES (3, '12', '21', '200', '21', NULL, 14, 3, 21.00, '2022-11-09 00:00:00.000', 1, '21', 115, '2022-11-09 11:58:59.837', NULL, NULL); -INSERT INTO `wms_item` VALUES (4, '00000', '000', '200', NULL, 1, 17, 2, NULL, NULL, 1, NULL, 115, '2022-11-09 16:24:56.849', NULL, NULL); -INSERT INTO `wms_item` VALUES (5, 'test', '123', '200', '单位类别111', 6, 18, 2, 130.00, '2022-11-30 00:00:01.000', 1, 'qqqqqqqqqq', 115, '2022-11-10 15:38:41.000', 115, '2022-11-11 16:46:07.059'); -INSERT INTO `wms_item` VALUES (6, '3213', '321313', '200', '321', 1, 17, 2, 11.00, '2022-11-19 00:00:00.000', 1, NULL, 115, '2022-11-11 16:28:35.752', NULL, NULL); -INSERT INTO `wms_item` VALUES (7, 'Apple', 'Apple', '200', '个', 9, 43, 21, 300.00, '2022-11-18 00:00:01.000', 1, NULL, 115, '2022-11-11 17:11:37.000', 115, '2022-11-11 17:14:36.531'); -INSERT INTO `wms_item` VALUES (8, 'PuTao', 'PuTao', '200', '提', 11, 44, 21, 210.00, '2022-11-17 00:00:01.000', 1, NULL, 115, '2022-11-11 17:12:44.000', 115, '2022-11-11 17:14:21.840'); -INSERT INTO `wms_item` VALUES (9, 'ShuPian', 'ShuPian', '200', '包', 12, 46, 22, 900.00, '2022-11-30 00:00:00.000', 1, NULL, 115, '2022-11-11 17:14:07.635', NULL, NULL); -INSERT INTO `wms_item` VALUES (10, 'CoolKeLe', 'CoolKeLe', '200', '听', 14, 47, 23, 3000.00, '2023-11-30 00:00:00.000', 1, NULL, 115, '2022-11-11 17:15:41.506', NULL, NULL); -INSERT INTO `wms_item` VALUES (11, '435tgfdg4', 'tretwe', '200', 'tew534', 1, 17, 2, NULL, NULL, 1, NULL, 115, '2022-11-12 15:55:18.819', NULL, NULL); -INSERT INTO `wms_item` VALUES (12, 'wuliao1', '物料1', '200', '吨', 17, 50, 25, 12.00, '2022-11-13 17:38:18.000', 1, '萝卜测试物料', 115, '2022-11-13 17:13:24.000', 115, '2022-11-13 17:38:19.880'); -INSERT INTO `wms_item` VALUES (13, 'wuliao2', '物料2', '200', 'KG', 4, 14, 4, 158.00, '2022-12-03 02:02:00.000', 1, NULL, 115, '2022-11-13 17:42:55.367', NULL, NULL); -INSERT INTO `wms_item` VALUES (14, 'iu一头热', '空间和广泛的', '200', NULL, 18, 51, 26, NULL, '2022-11-11 00:00:00.000', 1, NULL, 115, '2022-11-14 16:40:54.029', NULL, NULL); -INSERT INTO `wms_item` VALUES (15, '1', '1', '200', NULL, NULL, NULL, NULL, NULL, NULL, 1, NULL, 115, '2022-11-15 13:16:03.368', NULL, NULL); -INSERT INTO `wms_item` VALUES (16, '1', '1', '200', NULL, NULL, NULL, NULL, NULL, NULL, 1, NULL, 115, '2022-11-15 13:16:06.231', NULL, NULL); -INSERT INTO `wms_item` VALUES (17, '213', '看见了', '200', '1', NULL, NULL, NULL, 100.00, '2022-11-15 00:00:02.000', 1, '1', 115, '2022-11-15 16:37:56.000', 115, '2022-11-17 16:19:22.759'); -INSERT INTO `wms_item` VALUES (18, '11', '11', '200', '11', 13, 44, 2, 1.00, '2022-11-08 00:00:00.000', 1, '1', 115, '2022-11-17 11:37:48.009', NULL, NULL); -INSERT INTO `wms_item` VALUES (19, '9323', '3232', '200', NULL, 13, 44, 2, NULL, '2022-11-17 00:00:00.000', 1, NULL, 115, '2022-11-17 19:58:16.177', NULL, NULL); -INSERT INTO `wms_item` VALUES (20, 'TEST', 'TEST', '200', '只', NULL, NULL, NULL, 100.00, '2022-11-30 00:00:00.000', 1, '测试', 115, '2022-11-20 08:50:25.503', NULL, NULL); -INSERT INTO `wms_item` VALUES (21, 'test', 'test', '200', NULL, 20, 52, 27, 1000.00, '2022-11-20 15:09:23.000', 1, NULL, 115, '2022-11-20 15:09:22.124', NULL, NULL); -INSERT INTO `wms_item` VALUES (22, '123', '百威', '200', '瓶', 13, 44, 2, 100.00, '2023-11-08 00:00:00.000', 1, NULL, 1, '2022-11-22 13:08:17.000', 1, '2022-11-22 13:15:00.750'); -INSERT INTO `wms_item` VALUES (23, '02315178', '02315178', '200', '1', 21, 45, 2, 11.00, '2022-11-22 00:00:00.000', 1, '11', 115, '2022-11-22 19:14:00.004', NULL, NULL); -INSERT INTO `wms_item` VALUES (24, '13333', '333', '200', NULL, 13, 44, 2, 500.00, '2022-11-01 00:00:00.000', 1, NULL, 115, '2022-11-23 09:55:36.814', NULL, NULL); -INSERT INTO `wms_item` VALUES (25, '33', '3', '200', NULL, 21, 45, 2, 1000000.00, '2022-11-03 00:00:00.000', 1, NULL, 115, '2022-11-25 10:36:24.759', NULL, NULL); -INSERT INTO `wms_item` VALUES (26, '12313123', '123123', '200', 'pcs', 20, 52, 27, 1231.00, NULL, 1, NULL, 115, '2022-11-26 22:21:43.669', NULL, NULL); -INSERT INTO `wms_item` VALUES (27, 'abc1234', '测试物料', '200', NULL, NULL, 45, 2, NULL, '2022-12-10 00:00:00.000', 1, NULL, 115, '2022-11-29 10:56:13.441', NULL, NULL); -INSERT INTO `wms_item` VALUES (28, '编号123', '名称111', '200', '个', 13, 45, 2, 12.00, '2022-12-22 00:00:00.000', 1, NULL, 115, '2022-11-30 14:24:57.834', NULL, NULL); -INSERT INTO `wms_item` VALUES (29, '6902957196994', '玉米油', '200', '箱', 24, 56, 30, 1.00, NULL, 1, NULL, 115, '2022-12-05 15:59:05.000', 115, '2022-12-05 16:55:50.345'); -INSERT INTO `wms_item` VALUES (30, '123', '辣椒', '200', NULL, NULL, NULL, 30, NULL, NULL, 1, NULL, 115, '2022-12-08 09:55:50.000', 115, '2022-12-08 09:56:01.611'); -INSERT INTO `wms_item` VALUES (31, 'WL0001', '螺丝配件', '200', '1', 26, 58, 34, 100.00, '2022-12-31 00:00:00.000', 1, NULL, 115, '2022-12-09 16:24:41.565', NULL, NULL); -INSERT INTO `wms_item` VALUES (32, 'WL0002', '螺丝', '200', '1', NULL, 59, 34, 100.00, '2022-12-09 16:25:13.000', 1, NULL, 115, '2022-12-09 16:25:02.000', 115, '2022-12-09 16:25:14.520'); -INSERT INTO `wms_item` VALUES (33, 'F5*15', '韩国货', '200', '个', NULL, NULL, 39, 17300.00, NULL, 1, '有管空底', 115, '2022-12-10 15:00:06.818', NULL, NULL); -INSERT INTO `wms_item` VALUES (34, 'F5*17', '韩国货', '200', '个', NULL, NULL, 39, 700.00, NULL, 1, '有管空底', 115, '2022-12-10 15:01:20.759', NULL, NULL); -INSERT INTO `wms_item` VALUES (35, 'F5*19', '韩国货', '200', '个', NULL, NULL, 39, 600.00, NULL, 1, '有管空底', 115, '2022-12-10 15:02:06.571', NULL, NULL); -INSERT INTO `wms_item` VALUES (36, 'F5*19', '韩国货', '200', '个', NULL, NULL, 39, 600.00, NULL, 1, '有管空底', 115, '2022-12-10 15:02:11.759', NULL, NULL); -INSERT INTO `wms_item` VALUES (37, 'F5*19', '韩国货', '200', '个', NULL, NULL, 39, 600.00, NULL, 1, '有管空底', 115, '2022-12-10 15:02:11.871', NULL, NULL); -INSERT INTO `wms_item` VALUES (38, 'F5*19', '韩国货', '200', '个', NULL, NULL, 39, 600.00, NULL, 1, '有管空底', 115, '2022-12-10 15:02:14.842', NULL, NULL); -INSERT INTO `wms_item` VALUES (39, 'F6*19', '韩国货', '200', '个', NULL, NULL, 39, 400.00, NULL, 1, '有管空底', 115, '2022-12-10 15:03:36.376', NULL, NULL); -INSERT INTO `wms_item` VALUES (40, 'F6*21', '韩国货', '200', '个', NULL, NULL, 39, 100.00, NULL, 1, '有管空底', 115, '2022-12-10 15:04:28.136', NULL, NULL); -INSERT INTO `wms_item` VALUES (41, 'F6*23', '韩国货', '200', '个', NULL, NULL, 39, 0.00, NULL, 1, '有管空底', 115, '2022-12-10 15:05:15.275', NULL, NULL); -INSERT INTO `wms_item` VALUES (42, 'F6*25', '韩国货', '200', '个', NULL, NULL, 39, 0.00, NULL, 1, '有管空底', 115, '2022-12-10 15:06:02.456', NULL, NULL); -INSERT INTO `wms_item` VALUES (43, 'F6*27', '韩国货', '200', '个', NULL, NULL, 39, 0.00, NULL, 1, '有管空底', 115, '2022-12-10 15:06:49.503', NULL, NULL); -INSERT INTO `wms_item` VALUES (44, 'H5*15', '韩国货', '200', '个', NULL, NULL, 39, 27500.00, NULL, 1, '有管密底', 115, '2022-12-10 15:10:35.692', NULL, NULL); -INSERT INTO `wms_item` VALUES (45, 'H5*17', '韩国货', '200', '个', NULL, NULL, 39, 5200.00, NULL, 1, '有管密底', 115, '2022-12-10 15:11:31.293', NULL, NULL); -INSERT INTO `wms_item` VALUES (46, 'H5*19', '韩国货', '200', '个', NULL, NULL, 39, 10400.00, NULL, 1, '有管密底', 115, '2022-12-10 15:13:10.361', NULL, NULL); -INSERT INTO `wms_item` VALUES (47, 'H6*19', '韩国货', '200', '个', NULL, NULL, 39, 0.00, NULL, 1, '有管密底', 115, '2022-12-10 15:14:06.737', NULL, NULL); -INSERT INTO `wms_item` VALUES (48, 'H6*21', '韩国货', '200', '个', NULL, NULL, 39, 0.00, NULL, 1, '有管密底', 115, '2022-12-10 15:15:03.616', NULL, NULL); -INSERT INTO `wms_item` VALUES (49, 'H6*23', '韩国货', '200', '个', NULL, NULL, 39, 200.00, NULL, 1, '有管密底', 115, '2022-12-10 15:15:56.228', NULL, NULL); -INSERT INTO `wms_item` VALUES (50, 'H6*25', '韩国货', '200', '个', NULL, NULL, 39, 28350.00, NULL, 1, '有管密底', 115, '2022-12-10 15:16:45.695', NULL, NULL); -INSERT INTO `wms_item` VALUES (51, 'H6*27', '韩国货', '200', '个', NULL, NULL, 39, 18500.00, NULL, 1, '有管密底', 115, '2022-12-10 15:19:55.734', NULL, NULL); -INSERT INTO `wms_item` VALUES (52, 'F5*15', '最新', '200', '个', NULL, NULL, 39, 118900.00, NULL, 1, '有管空底', 115, '2022-12-10 15:21:02.700', NULL, NULL); -INSERT INTO `wms_item` VALUES (53, 'F5*15', '无管', '200', '个', NULL, NULL, 39, 34000.00, NULL, 1, '无管空底', 115, '2022-12-10 15:22:08.000', 115, '2022-12-10 15:22:26.518'); -INSERT INTO `wms_item` VALUES (54, 'F*15', '新', '200', '个', NULL, NULL, 39, 31280.00, NULL, 1, '有管空底', 115, '2022-12-10 15:23:18.173', NULL, NULL); -INSERT INTO `wms_item` VALUES (55, '20#', '皮带扣', '200', '个', NULL, NULL, 39, 450.00, NULL, 1, '密底', 115, '2022-12-10 15:24:56.000', 115, '2022-12-12 11:00:33.933'); -INSERT INTO `wms_item` VALUES (56, '2132', 'c3', '200', NULL, NULL, NULL, 38, NULL, NULL, 1, NULL, 115, '2022-12-12 16:34:03.840', NULL, NULL); -INSERT INTO `wms_item` VALUES (57, '1', '一次性口罩', '200', NULL, NULL, NULL, 38, NULL, NULL, 1, NULL, 115, '2022-12-13 15:31:04.000', 115, '2022-12-13 15:32:35.765'); -INSERT INTO `wms_item` VALUES (58, '11', '2222', '200', NULL, 28, 61, 38, 3.00, NULL, 1, NULL, 115, '2022-12-13 15:58:07.000', 115, '2022-12-21 16:56:35.060'); -INSERT INTO `wms_item` VALUES (59, '22222', '222222', '200', '2222', NULL, NULL, 40, 22.00, '2022-12-15 00:00:00.000', 1, 'sss', 115, '2022-12-15 14:43:42.361', NULL, NULL); -INSERT INTO `wms_item` VALUES (60, '0001地方', '测试物料', '200', '测试1', 30, 62, 43, 1.00, NULL, 1, NULL, 115, '2022-12-20 17:14:06.000', 115, '2022-12-22 12:36:20.479'); -INSERT INTO `wms_item` VALUES (61, '0001', '主动安全设备', '200', NULL, NULL, NULL, NULL, 10.00, NULL, 1, NULL, 115, '2022-12-28 11:35:45.000', 115, '2022-12-28 11:36:30.350'); -INSERT INTO `wms_item` VALUES (62, '011', '5555', '200', NULL, 31, 67, 50, 35.00, '2023-01-04 00:00:00.000', 1, '11', 115, '2023-01-04 14:14:29.368', NULL, NULL); -INSERT INTO `wms_item` VALUES (63, '320', 'pp管', '200', '米', 31, 67, 50, NULL, '2023-01-19 00:00:00.000', 1, '1', 115, '2023-01-04 14:46:17.000', 115, '2023-01-04 19:07:05.219'); -INSERT INTO `wms_item` VALUES (64, '12', '23', '200', NULL, NULL, NULL, 50, NULL, NULL, 1, NULL, 115, '2023-01-05 12:04:39.968', NULL, NULL); -INSERT INTO `wms_item` VALUES (65, '002', '物料002', '200', '箱', NULL, 69, 50, NULL, '2023-01-28 00:00:00.000', 1, NULL, 115, '2023-01-05 16:40:04.470', NULL, NULL); -INSERT INTO `wms_item` VALUES (66, '123', '123', '200', NULL, NULL, NULL, 50, NULL, NULL, 1, NULL, 115, '2023-01-06 14:23:24.094', NULL, NULL); -INSERT INTO `wms_item` VALUES (67, '001', '苹果', '200', '个', 31, 70, 50, 100.00, '2023-01-27 00:00:00.000', 1, NULL, 115, '2023-01-06 16:50:50.731', NULL, NULL); -INSERT INTO `wms_item` VALUES (68, '002', '橘子', '200', '个', 34, 73, 53, 200.00, '2023-01-28 00:00:00.000', 1, NULL, 115, '2023-01-06 16:51:15.000', 115, '2023-01-07 13:43:30.134'); -INSERT INTO `wms_item` VALUES (69, '003', '百事可乐330*24罐装', '200', NULL, NULL, NULL, NULL, NULL, NULL, 1, NULL, 115, '2023-01-07 18:08:44.874', NULL, NULL); -INSERT INTO `wms_item` VALUES (70, '222', 'jj', '200', 'j', NULL, NULL, 60, 90.00, '2023-01-04 00:00:00.000', 1, NULL, 115, '2023-01-07 23:45:33.532', NULL, NULL); -INSERT INTO `wms_item` VALUES (71, '1', '皮线光缆', '200', '米', 37, 77, 61, NULL, '2023-01-01 00:00:00.000', 1, NULL, 115, '2023-01-08 00:06:48.931', NULL, NULL); -INSERT INTO `wms_item` VALUES (72, '2', '双绞线', '200', '米', 37, 77, 61, NULL, '2023-01-01 16:08:03.000', 1, NULL, 115, '2023-01-08 00:08:24.000', 115, '2023-01-08 00:08:36.432'); -INSERT INTO `wms_item` VALUES (73, '3', '同轴电缆', '200', '米', 37, 77, 61, NULL, '2022-12-01 00:00:00.000', 1, NULL, 115, '2023-01-08 00:09:19.524', NULL, NULL); -INSERT INTO `wms_item` VALUES (74, '4', '一级分纤箱', '200', '个', 38, 77, 61, NULL, '2022-12-31 00:00:00.000', 1, NULL, 115, '2023-01-08 00:10:13.512', NULL, NULL); -INSERT INTO `wms_item` VALUES (75, '5', '二级分纤箱', '200', '个', 38, 77, 61, NULL, '2021-08-01 00:00:00.000', 1, NULL, 115, '2023-01-08 00:10:51.254', NULL, NULL); -INSERT INTO `wms_item` VALUES (76, '6', '热熔管', '200', '个', 43, 80, 61, NULL, '2023-01-09 00:00:37.000', 1, '修改一下', 115, '2023-01-09 00:12:03.000', 115, '2023-01-09 00:23:43.512'); -INSERT INTO `wms_item` VALUES (77, '1', '1', '200', NULL, 46, 77, 61, NULL, '2023-01-11 20:45:02.000', 1, NULL, 115, '2023-01-11 20:45:03.000', 115, '2023-01-13 11:09:29.266'); -INSERT INTO `wms_item` VALUES (78, '001', '酱油', '200', '1', NULL, NULL, 69, NULL, NULL, 1, NULL, 115, '2023-01-13 12:51:24.488', NULL, NULL); -INSERT INTO `wms_item` VALUES (79, '002', '平遥牛肉', '200', NULL, 50, 86, 65, NULL, NULL, 1, NULL, 115, '2023-01-14 13:01:08.302', NULL, NULL); -INSERT INTO `wms_item` VALUES (80, 'A-03', '物料ABC', '200', NULL, NULL, 86, 65, 22.00, NULL, 1, NULL, 115, '2023-01-16 10:59:03.000', 115, '2023-01-25 15:14:23.276'); -INSERT INTO `wms_item` VALUES (81, '004', '电视机', '200', '件', NULL, NULL, NULL, NULL, NULL, 1, NULL, 115, '2023-01-26 20:51:25.254', NULL, NULL); -INSERT INTO `wms_item` VALUES (82, '005', '电脑', '200', NULL, NULL, NULL, NULL, NULL, NULL, 1, NULL, 115, '2023-01-26 20:51:41.547', NULL, NULL); -INSERT INTO `wms_item` VALUES (83, '006', '啦啦啦', '200', NULL, NULL, NULL, NULL, NULL, NULL, 1, NULL, 115, '2023-01-26 20:51:52.217', NULL, NULL); -INSERT INTO `wms_item` VALUES (84, '007', 'ok酱', '200', NULL, NULL, NULL, NULL, NULL, NULL, 1, NULL, 115, '2023-01-26 20:52:09.897', NULL, NULL); -INSERT INTO `wms_item` VALUES (85, '008', '木材', '200', NULL, NULL, NULL, NULL, NULL, NULL, 1, NULL, 115, '2023-01-26 20:52:23.169', NULL, NULL); -INSERT INTO `wms_item` VALUES (86, '009', '松木', '200', NULL, NULL, NULL, NULL, NULL, NULL, 1, NULL, 115, '2023-01-26 20:52:35.426', NULL, NULL); -INSERT INTO `wms_item` VALUES (87, '010', '平底锅', '200', NULL, NULL, 87, 66, NULL, NULL, 1, NULL, 115, '2023-01-26 20:52:54.000', 115, '2023-01-27 19:52:49.843'); -INSERT INTO `wms_item` VALUES (88, '11', '11', '200', NULL, 49, 85, 68, NULL, '2023-01-07 00:00:00.000', 1, NULL, 115, '2023-01-28 17:07:57.000', 115, '2023-01-28 17:09:22.894'); -INSERT INTO `wms_item` VALUES (89, '01', '热水器', '200', 'TAI', 50, 89, 76, NULL, NULL, 1, NULL, 115, '2023-02-01 22:00:25.000', 115, '2023-02-02 14:08:16.256'); -INSERT INTO `wms_item` VALUES (90, '1321', '测试商品', '200', '1', 49, 90, 75, 1.00, '2023-02-02 00:00:00.000', 1, '1', 115, '2023-02-02 15:03:45.000', 115, '2023-02-03 14:11:20.747'); -INSERT INTO `wms_item` VALUES (91, '1', '1', '200', NULL, 50, 89, 76, NULL, '2023-02-02 00:00:00.000', 1, NULL, 115, '2023-02-02 15:09:59.564', NULL, NULL); -INSERT INTO `wms_item` VALUES (92, '6668', '666', '200', NULL, 52, 92, 78, NULL, '2023-02-25 00:00:00.000', 1, NULL, 115, '2023-02-04 16:10:51.000', 115, '2023-02-04 16:35:27.153'); -INSERT INTO `wms_item` VALUES (93, '776', '777', '200', NULL, 52, 92, 78, NULL, NULL, 1, NULL, 115, '2023-02-04 16:35:58.962', NULL, NULL); -INSERT INTO `wms_item` VALUES (94, '99', '笔记本电脑', '200', NULL, 54, 95, 85, 15.00, '2023-02-16 00:00:00.000', 1, '备注', 115, '2023-02-06 11:46:51.000', 115, '2023-02-10 15:16:52.567'); -INSERT INTO `wms_item` VALUES (95, 'AAAAAA', '生产废料', '200', 'KG', NULL, NULL, 84, NULL, NULL, 1, NULL, 115, '2023-02-06 15:18:38.000', 115, '2023-02-06 15:19:10.461'); -INSERT INTO `wms_item` VALUES (96, '123654789', '六类网线', '200', NULL, 56, 98, 86, NULL, NULL, 1, NULL, 115, '2023-02-08 09:11:36.874', NULL, NULL); -INSERT INTO `wms_item` VALUES (97, '145789451', '联想蓝牙鼠标', '200', NULL, NULL, NULL, NULL, NULL, NULL, 1, NULL, 115, '2023-02-08 09:12:15.000', 115, '2023-02-08 10:38:21.121'); -INSERT INTO `wms_item` VALUES (98, '145789451', '1111', '200', NULL, NULL, NULL, NULL, NULL, NULL, 1, NULL, 115, '2023-02-08 14:15:22.652', NULL, NULL); -INSERT INTO `wms_item` VALUES (99, '12345678', '贴片电阻', '200', '电子料', 53, 94, 83, 66.00, '2023-02-01 00:00:00.000', 1, NULL, 115, '2023-02-08 16:35:15.000', 115, '2023-02-09 14:34:23.332'); -INSERT INTO `wms_item` VALUES (100, '11', '11', '200', NULL, 49, 96, 84, NULL, NULL, 1, NULL, 115, '2023-02-09 14:40:11.000', 115, '2023-02-10 13:03:39.498'); -INSERT INTO `wms_item` VALUES (101, '0210', '电子桌牌', '200', '台', NULL, 103, 89, NULL, NULL, 1, NULL, 115, '2023-02-10 15:55:13.137', NULL, NULL); -INSERT INTO `wms_item` VALUES (102, '0001', '测试', '200', '个', NULL, 103, 89, 2.00, '2023-02-23 00:00:00.000', 1, '222', 115, '2023-02-12 13:27:03.748', NULL, NULL); -INSERT INTO `wms_item` VALUES (103, '0002', '测试2', '200', '21', 55, 98, 86, 1000.00, '2023-02-24 00:00:00.000', 1, NULL, 115, '2023-02-13 11:34:33.000', 115, '2023-02-14 10:02:44.271'); -INSERT INTO `wms_item` VALUES (104, '0001', 'iPhone12', '200', '个', NULL, NULL, 88, 100.00, '2025-03-06 00:00:00.000', 1, NULL, 115, '2023-02-14 09:28:50.162', NULL, NULL); -INSERT INTO `wms_item` VALUES (105, '111', '111', '200', NULL, NULL, NULL, 93, NULL, NULL, 1, NULL, 115, '2023-02-15 11:28:16.866', NULL, NULL); -INSERT INTO `wms_item` VALUES (106, 'aa', 'AA', '200', NULL, NULL, NULL, NULL, NULL, NULL, 1, NULL, 115, '2023-02-15 14:06:01.263', NULL, NULL); -INSERT INTO `wms_item` VALUES (107, '0004', '肉夹馍', '200', NULL, 64, 111, 95, 10000.00, '2023-02-15 00:00:00.000', 1, NULL, 115, '2023-02-15 15:04:25.000', 115, '2023-02-15 15:07:02.311'); -INSERT INTO `wms_item` VALUES (108, '001', '废胎1', '200', NULL, 65, 112, 98, NULL, NULL, 1, NULL, 115, '2023-02-16 15:15:04.766', NULL, NULL); -INSERT INTO `wms_item` VALUES (109, '000001', '馍馍', '200', '食品', 55, 98, 86, 1000.00, '2023-02-17 00:00:00.000', 1, '', 115, '2023-02-16 16:04:56.000', 115, '2023-02-16 16:05:15.936'); -INSERT INTO `wms_item` VALUES (110, '1', '折叠框', '200', '600*400', 66, 115, 101, 10.00, '2023-02-28 00:00:00.000', 1, NULL, 115, '2023-02-17 10:50:10.533', NULL, NULL); -INSERT INTO `wms_item` VALUES (111, 'A001', 'test', '200', 'ddd', 67, 116, 102, 10.00, '2023-02-24 00:00:00.000', 1, 'd', 115, '2023-02-17 13:08:53.450', NULL, NULL); -INSERT INTO `wms_item` VALUES (112, '000', '9999', '200', NULL, 66, 115, 101, NULL, NULL, 1, NULL, 115, '2023-02-17 13:38:11.385', NULL, NULL); -INSERT INTO `wms_item` VALUES (113, '90990', '090909', '200', NULL, 67, 116, 102, NULL, '2023-02-17 00:00:00.000', 1, NULL, 115, '2023-02-17 13:38:36.865', NULL, NULL); -INSERT INTO `wms_item` VALUES (114, 'ddd', 'ddd', '200', 'dddd', 67, 116, 102, NULL, NULL, 1, NULL, 115, '2023-02-17 16:36:09.307', NULL, NULL); -INSERT INTO `wms_item` VALUES (115, 'ddd', 'ddd', '200', NULL, 67, 117, 104, 12.00, '2023-02-17 17:32:23.000', 1, NULL, 115, '2023-02-17 17:32:24.000', 115, '2023-02-19 20:17:27.461'); -INSERT INTO `wms_item` VALUES (116, '2137237', '肉夹馍', '200', '食品', NULL, 117, 104, NULL, '2023-05-23 00:00:00.000', 1, '尽快出库 ', 115, '2023-02-18 16:24:02.035', NULL, NULL); -INSERT INTO `wms_item` VALUES (117, '1', '敌敌畏', '200', 'kg', 71, 120, 109, 100.00, '2023-02-21 00:00:00.000', 1, NULL, 115, '2023-02-21 12:01:30.000', 115, '2023-02-24 15:26:16.804'); -INSERT INTO `wms_item` VALUES (118, '001', '桃花酿', '200', '测试', 72, 122, 112, NULL, NULL, 1, NULL, 115, '2023-02-26 13:23:48.000', 115, '2023-02-26 14:41:39.839'); -INSERT INTO `wms_item` VALUES (119, '111', '11', '200', '11', NULL, NULL, 111, 11.00, '2023-02-26 14:41:04.000', 1, '11', 115, '2023-02-26 14:41:09.540', NULL, NULL); -INSERT INTO `wms_item` VALUES (120, '1231', '成品', '200', NULL, NULL, NULL, NULL, NULL, NULL, 1, NULL, 115, '2023-02-27 09:33:46.396', NULL, NULL); -INSERT INTO `wms_item` VALUES (121, '111', '成品', '200', NULL, NULL, NULL, NULL, NULL, NULL, 1, NULL, 115, '2023-02-27 09:34:20.801', NULL, NULL); -INSERT INTO `wms_item` VALUES (122, 'm_001', 'm_test', '200', 'kg', NULL, 125, 115, NULL, NULL, 1, NULL, 115, '2023-02-27 10:31:17.000', 115, '2023-02-27 10:35:27.678'); -INSERT INTO `wms_item` VALUES (123, '8914651', '疫苗', '200', '111', NULL, NULL, NULL, 111.00, NULL, 1, NULL, 115, '2023-03-01 13:25:31.000', 115, '2023-03-01 16:38:59.501'); -INSERT INTO `wms_item` VALUES (124, 'HPEAUH650-D', '其他初级形状比重≥0.94的聚乙烯', '200', '', NULL, NULL, NULL, NULL, NULL, 1, NULL, 115, '2023-03-01 17:52:02.829', NULL, NULL); -INSERT INTO `wms_item` VALUES (125, 'HPEASH800-M', '其他初级形状比重≥0.94的聚乙烯', '200', NULL, 74, 126, 116, NULL, '2023-03-05 00:00:00.000', 1, NULL, 115, '2023-03-01 17:52:39.000', 115, '2023-03-02 21:49:20.231'); -INSERT INTO `wms_item` VALUES (126, '111', '111', '200', '11', NULL, NULL, NULL, NULL, NULL, 1, NULL, 115, '2023-03-03 13:46:50.186', NULL, NULL); -INSERT INTO `wms_item` VALUES (127, '11218010', '压缩弹簧', '200', '件', 90, 135, 122, 10.00, '2023-03-06 00:00:00.000', 1, NULL, 115, '2023-03-03 21:28:25.000', 115, '2023-03-03 21:28:37.446'); -INSERT INTO `wms_item` VALUES (128, '18121032', '短圆柱滚子', '200', '件', 91, 135, 122, 10.00, '2023-03-07 00:00:00.000', 1, NULL, 115, '2023-03-03 21:29:05.000', 115, '2023-03-03 21:29:13.680'); -INSERT INTO `wms_item` VALUES (129, '79914884', '输入花键轴', '200', '件', 89, 134, 121, NULL, NULL, 1, NULL, 115, '2023-03-03 21:29:52.232', NULL, NULL); -INSERT INTO `wms_item` VALUES (130, '79913766', '油封座', '200', '件', 89, 134, 121, NULL, NULL, 1, NULL, 115, '2023-03-03 21:30:24.000', 115, '2023-03-06 13:39:52.670'); -INSERT INTO `wms_item` VALUES (131, '20230307123131', 'mac笔记本', '200', '台', NULL, 136, 117, 100.00, '2024-03-08 00:00:00.000', 1, '测试', 115, '2023-03-08 09:30:13.000', 115, '2023-03-08 09:40:21.207'); -INSERT INTO `wms_item` VALUES (132, '79913766', '高低压柜', '200', '哥', NULL, NULL, NULL, NULL, NULL, 1, NULL, 115, '2023-03-08 13:43:14.188', NULL, NULL); -INSERT INTO `wms_item` VALUES (133, 'aaa', '瓶子', '200', '个', 92, 136, 117, 10.00, NULL, 1, '答复', 115, '2023-03-09 13:00:29.000', 115, '2023-03-10 10:52:35.472'); -INSERT INTO `wms_item` VALUES (134, '333', '333', '200', '33', NULL, NULL, NULL, 1000.00, NULL, 1, NULL, 115, '2023-03-12 13:35:14.000', 115, '2023-03-13 00:23:23.991'); -INSERT INTO `wms_item` VALUES (135, '123', '123', '200', '1', NULL, NULL, 133, 123.00, NULL, 1, NULL, 115, '2023-03-13 04:16:40.657', NULL, NULL); -INSERT INTO `wms_item` VALUES (136, 'JD7', 'JD7', '200', NULL, NULL, NULL, NULL, NULL, NULL, 1, NULL, 115, '2023-03-13 10:25:54.000', 115, '2023-03-13 10:29:33.129'); -INSERT INTO `wms_item` VALUES (137, 'CESHI', '测试设备', '200', NULL, NULL, NULL, 135, NULL, NULL, 1, NULL, 115, '2023-03-13 10:31:53.000', 115, '2023-03-13 15:42:45.348'); -INSERT INTO `wms_item` VALUES (138, '1232', '产出', '200', '斤', NULL, NULL, 135, 2.00, '2023-03-15 00:00:00.000', 1, NULL, 115, '2023-03-13 14:04:37.000', 115, '2023-03-13 15:44:55.797'); -INSERT INTO `wms_item` VALUES (139, '666', '标枪', '200', '支', 107, 155, 139, NULL, NULL, 1, NULL, 115, '2023-03-13 15:54:53.000', 115, '2023-03-29 20:42:39.149'); -INSERT INTO `wms_item` VALUES (140, '333', 'xxx', '200', '11', 96, 147, 135, 0.00, '2023-03-14 00:00:00.000', 1, '12345', 115, '2023-03-13 15:58:38.000', 115, '2023-03-28 08:51:39.192'); -INSERT INTO `wms_item` VALUES (141, '111', '111', '200', '123', 98, 148, 137, 10.00, '2023-03-09 00:00:00.000', 1, NULL, 115, '2023-03-14 14:13:17.845', NULL, NULL); -INSERT INTO `wms_item` VALUES (142, '789', '发铜球', '200', '个', NULL, 145, 136, 9.00, NULL, 1, NULL, 115, '2023-03-14 16:15:38.000', 115, '2023-03-20 12:21:38.786'); -INSERT INTO `wms_item` VALUES (143, '111', '1111', '200', NULL, 96, 145, 136, NULL, NULL, 1, NULL, 115, '2023-03-18 14:50:13.000', 115, '2023-03-20 17:01:27.406'); -INSERT INTO `wms_item` VALUES (144, '801', '双面弹', '200', NULL, NULL, NULL, NULL, NULL, NULL, 1, NULL, 115, '2023-03-20 22:12:16.166', NULL, NULL); -INSERT INTO `wms_item` VALUES (145, '3213123', '茅台1', '200', NULL, 99, 151, 149, 5.00, '2023-03-01 00:00:00.000', 1, NULL, 115, '2023-03-21 17:31:54.425', NULL, NULL); -INSERT INTO `wms_item` VALUES (146, 'GZMT', '贵州茅台', '200', NULL, NULL, NULL, NULL, NULL, NULL, 1, NULL, 115, '2023-03-22 00:15:44.229', NULL, NULL); -INSERT INTO `wms_item` VALUES (147, '2023.3.22', '外套1', '200', NULL, 100, 152, 154, 100.00, NULL, 1, NULL, 115, '2023-03-22 15:50:03.000', 115, '2023-03-22 16:05:52.151'); -INSERT INTO `wms_item` VALUES (148, 'PC', '电脑设备', '200', NULL, NULL, NULL, NULL, NULL, NULL, 1, NULL, 115, '2023-03-22 22:49:34.658', NULL, NULL); -INSERT INTO `wms_item` VALUES (149, '0001', '阿达', '200', NULL, NULL, NULL, 139, NULL, NULL, 1, NULL, 115, '2023-03-23 14:07:33.839', NULL, NULL); -INSERT INTO `wms_item` VALUES (150, 'sy0323', '流程验证', '200', '1', NULL, NULL, 139, NULL, NULL, 1, NULL, 115, '2023-03-23 14:11:07.990', NULL, NULL); -INSERT INTO `wms_item` VALUES (151, 'sy0323', 'iPhone14', '200', '1', 98, 148, 137, 100.00, '2023-03-31 10:44:39.000', 1, NULL, 115, '2023-03-23 14:11:38.000', 115, '2023-03-28 10:44:57.903'); -INSERT INTO `wms_item` VALUES (152, '15', '可劲', '200', NULL, NULL, 150, 138, NULL, NULL, 1, NULL, 115, '2023-03-23 14:41:25.000', 115, '2023-03-24 13:32:17.971'); -INSERT INTO `wms_item` VALUES (153, '123456', '测试sy', '200', NULL, NULL, NULL, NULL, NULL, NULL, 1, NULL, 115, '2023-03-23 15:08:14.716', NULL, NULL); -INSERT INTO `wms_item` VALUES (154, '135111', 'WMS管理', '200', '十大', 104, 155, 161, 1212.00, NULL, 1, '地方', 115, '2023-03-25 00:06:02.000', 115, '2023-03-25 00:48:13.937'); -INSERT INTO `wms_item` VALUES (155, '777', '777', '200', '777', NULL, 156, 163, NULL, '2023-03-31 00:00:00.000', 1, NULL, 115, '2023-03-25 15:19:47.861', NULL, NULL); -INSERT INTO `wms_item` VALUES (156, '01', '大米', '200', NULL, NULL, 157, 165, 10.00, '2023-03-31 00:00:00.000', 1, NULL, 115, '2023-03-25 15:24:19.000', 115, '2023-03-28 08:51:25.433'); -INSERT INTO `wms_item` VALUES (157, '001', '垃圾袋', '200', NULL, 104, 155, 139, NULL, NULL, 1, NULL, 115, '2023-03-26 19:51:08.000', 115, '2023-04-06 15:06:47.437'); -INSERT INTO `wms_item` VALUES (158, 'tzlj001', '铁质料箱', '200', NULL, NULL, NULL, NULL, NULL, '2023-04-07 15:39:49.000', 1, NULL, 115, '2023-03-27 11:16:42.000', 115, '2023-04-07 15:41:33.509'); -INSERT INTO `wms_item` VALUES (159, 'kbx001', '卡板箱', '200', '个', NULL, NULL, NULL, NULL, NULL, 1, NULL, 115, '2023-03-27 11:19:48.836', NULL, NULL); -INSERT INTO `wms_item` VALUES (160, '453534', '测试打印', '200', '的撒', NULL, 150, 138, 1.00, '2023-03-09 09:19:34.000', 1, '的说法', 115, '2023-03-28 09:20:28.000', 115, '2023-03-28 14:15:03.331'); -INSERT INTO `wms_item` VALUES (161, '1313123', '名称', '200', '9999', NULL, NULL, 140, 12321.00, '2023-03-01 00:00:00.000', 1, '123213', 115, '2023-03-28 22:31:32.000', 115, '2023-03-28 22:31:48.651'); -INSERT INTO `wms_item` VALUES (162, '笔记本-红色', '笔记本-红色', '200', NULL, NULL, 160, 138, 10.00, NULL, 1, NULL, 115, '2023-03-30 18:27:42.000', 115, '2023-03-30 21:38:59.520'); -INSERT INTO `wms_item` VALUES (163, 'AAA', 'AA', '200', 'A', NULL, NULL, NULL, 2000.00, '2023-04-03 16:22:20.000', 1, 'AA', 115, '2023-04-03 16:22:28.474', NULL, NULL); -INSERT INTO `wms_item` VALUES (164, '66', '22', '200', '2', NULL, NULL, 147, NULL, NULL, 1, NULL, 115, '2023-04-04 17:05:39.683', NULL, NULL); -INSERT INTO `wms_item` VALUES (165, '00001', '册数', '200', '2233', 109, 155, 139, 22.00, '2023-04-06 11:00:49.000', 1, '899', 115, '2023-04-06 11:00:54.107', NULL, NULL); -INSERT INTO `wms_item` VALUES (166, '2', '2', '200', '2', NULL, NULL, 151, 2.00, '2023-04-06 14:00:35.000', 1, '2', 115, '2023-04-06 14:00:36.812', NULL, NULL); -INSERT INTO `wms_item` VALUES (167, '0406', '嘿咻', '200', '1', 107, 155, 139, 1.00, '2023-04-15 00:00:00.000', 1, '1', 115, '2023-04-06 14:01:28.603', NULL, NULL); -INSERT INTO `wms_item` VALUES (168, '001', '我是商品', '200', '1', NULL, NULL, 181, 11.00, '2023-04-08 00:00:00.000', 1, '1', 115, '2023-04-06 14:08:54.000', 115, '2023-04-06 14:13:30.027'); -INSERT INTO `wms_item` VALUES (169, '1', 'yyf的物料', '200', NULL, 113, 169, 184, 100.00, '2023-04-06 00:00:00.000', 1, 'yyf', 115, '2023-04-06 15:09:14.317', NULL, NULL); -INSERT INTO `wms_item` VALUES (170, '800', '猪肉', '200', NULL, 114, 170, 185, NULL, NULL, 1, NULL, 115, '2023-04-06 22:43:30.200', NULL, NULL); -INSERT INTO `wms_item` VALUES (171, '001', '1111', '200', '1', 102, 171, 155, NULL, '2023-04-10 00:00:00.000', 1, NULL, 115, '2023-04-09 23:27:41.000', 115, '2023-04-10 14:40:51.972'); -INSERT INTO `wms_item` VALUES (172, '0001', '元器件', '200', '个', NULL, NULL, 154, 100.00, '2023-04-12 00:00:00.000', 1, NULL, 115, '2023-04-10 16:00:47.000', 115, '2023-04-10 16:52:38.443'); -INSERT INTO `wms_item` VALUES (173, '0001', '手机膜', '200', '张', 115, 176, 178, 500.00, '2023-04-30 00:00:00.000', 1, 'test', 115, '2023-04-11 13:35:58.000', 115, '2023-04-12 09:30:18.107'); -INSERT INTO `wms_item` VALUES (174, '111', '111', '200', NULL, NULL, NULL, 158, NULL, '2023-04-12 00:00:00.000', 1, NULL, 115, '2023-04-11 15:23:12.475', NULL, NULL); -INSERT INTO `wms_item` VALUES (175, '123', 'sdafssfas fasts. afsfas', '200', '吨', NULL, NULL, 164, 4.32, NULL, 1, NULL, 115, '2023-04-12 23:23:52.713', NULL, NULL); -INSERT INTO `wms_item` VALUES (176, 'test0001', '卫龙', '200', '包', 116, 178, 192, 500.00, '2023-07-31 00:00:00.000', 1, '测试', 115, '2023-04-13 10:29:45.000', 115, '2023-04-13 10:42:46.658'); -INSERT INTO `wms_item` VALUES (177, 'test0002', '薯条', '200', '包', 116, 178, 192, 50.00, '2024-04-30 00:00:00.000', 1, '测试', 115, '2023-04-13 10:31:31.638', NULL, NULL); -INSERT INTO `wms_item` VALUES (178, 'test0002', '薯条', '200', '包', 116, 178, 192, 500.00, '2024-04-30 00:00:00.000', 1, '测试', 115, '2023-04-13 10:31:31.000', 115, '2023-04-13 10:42:39.985'); -INSERT INTO `wms_item` VALUES (179, 'test0002', '薯条', '200', '包', 116, 178, 192, 50.00, '2024-04-30 00:00:00.000', 1, '测试', 115, '2023-04-13 10:31:31.833', NULL, NULL); -INSERT INTO `wms_item` VALUES (180, '56765513131313', '泰国榴莲', '200', 'g', 122, 185, 198, 200.00, '2024-04-25 00:00:02.000', 1, NULL, 115, '2023-04-13 13:49:39.000', 115, '2023-04-15 20:47:51.460'); -INSERT INTO `wms_item` VALUES (181, 'iphone15', '苹果15', '200', '个', 116, 178, 193, 100.00, '2023-04-29 00:00:00.000', 1, NULL, 115, '2023-04-17 15:40:31.084', NULL, NULL); -INSERT INTO `wms_item` VALUES (182, 'iPhone16', '苹果16', '200', '个', 118, 181, 194, 100.00, '2023-04-29 00:00:00.000', 1, NULL, 115, '2023-04-17 15:41:21.504', NULL, NULL); -INSERT INTO `wms_item` VALUES (183, '1', '泰国榴莲', '200', NULL, NULL, NULL, NULL, NULL, NULL, 1, NULL, 115, '2023-04-22 23:55:58.037', NULL, NULL); -INSERT INTO `wms_item` VALUES (184, 'xcsfasdsa', 'dsdsds', '200', 'ds', 118, 181, 194, NULL, NULL, 1, NULL, 115, '2023-04-23 14:31:22.651', NULL, NULL); -INSERT INTO `wms_item` VALUES (185, '100121', '8号螺丝', '200', '颗', 127, 189, 215, 1000.00, '2023-04-29 00:00:00.000', 1, NULL, 115, '2023-04-24 15:34:38.000', 115, '2023-04-25 15:47:55.731'); -INSERT INTO `wms_item` VALUES (186, '57610634', '象牙芒', '200', '111', NULL, 183, 196, 5000.00, '2024-04-12 00:00:00.000', 1, NULL, 115, '2023-04-25 14:31:08.000', 115, '2023-04-26 10:50:52.413'); -INSERT INTO `wms_item` VALUES (187, '5744-0426', '箱子', '200', NULL, 117, 181, 194, 20.00, '2023-03-31 00:00:00.000', 1, NULL, 115, '2023-04-26 10:51:28.924', NULL, NULL); -INSERT INTO `wms_item` VALUES (188, '2', '2', '200', '2', 117, 181, 194, 2.00, NULL, 1, NULL, 115, '2023-04-26 17:01:50.000', 115, '2023-04-26 17:32:17.925'); -INSERT INTO `wms_item` VALUES (189, '12345', 'test', '200', '个', NULL, 216, 229, 111.00, NULL, 0, '111', 1, '2023-05-04 09:24:00.444', NULL, NULL); -INSERT INTO `wms_item` VALUES (190, 'test2', 'test2', '211', '个', NULL, 216, 229, 111.00, '2023-05-01 00:00:00.000', 0, '111', 1, '2023-05-04 10:12:44.000', 115, '2023-05-04 10:33:21.831'); -INSERT INTO `wms_item` VALUES (191, 'test3', 'test3', '213', '个', NULL, NULL, 230, 222.00, '2023-05-01 00:00:00.000', 0, '222', 1, '2023-05-04 10:13:14.000', 115, '2023-05-04 10:33:11.249'); -INSERT INTO `wms_item` VALUES (192, '123', '123', '200', '个', NULL, NULL, 230, 333.00, '2023-05-31 00:00:00.000', 1, '333', 1, '2023-05-04 10:14:12.000', 1, '2023-05-04 10:14:20.238'); -INSERT INTO `wms_item` VALUES (193, 'iphone14', 'iphone14', '212', NULL, NULL, 216, 229, 1000.00, NULL, 0, NULL, 115, '2023-05-04 10:34:10.038', NULL, NULL); - --- ---------------------------- --- Table structure for wms_item_type --- ---------------------------- -DROP TABLE IF EXISTS `wms_item_type`; -CREATE TABLE `wms_item_type` ( - `item_type_id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '物料类型id', - `parent_id` bigint(20) NULL DEFAULT 0 COMMENT '父物料类型id', - `ancestors` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '祖级列表', - `type_name` varchar(30) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '物料类型名称', - `order_num` int(11) NULL DEFAULT 0 COMMENT '显示顺序', - `status` char(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '0' COMMENT '物料类型状态(0正常 1停用)', - `del_flag` char(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '0' COMMENT '删除标志(0代表存在 2代表删除)', - `create_by` bigint(20) NULL DEFAULT NULL COMMENT '创建者', - `create_time` datetime(3) NULL DEFAULT NULL COMMENT '创建时间', - `update_by` bigint(20) NULL DEFAULT NULL COMMENT '更新者', - `update_time` datetime(3) NULL DEFAULT NULL COMMENT '更新时间', - PRIMARY KEY (`item_type_id`) USING BTREE -) ENGINE = InnoDB AUTO_INCREMENT = 215 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '物料类型表' ROW_FORMAT = Dynamic; - --- ---------------------------- --- Records of wms_item_type --- ---------------------------- -INSERT INTO `wms_item_type` VALUES (100, 0, '0', '信息化耗材', 2, '0', '0', 0, '2023-04-03 14:31:16.000', 115, '2023-04-30 16:41:51.963'); -INSERT INTO `wms_item_type` VALUES (200, 100, '0,100', '电脑配件', 1, '0', '0', NULL, '2023-04-03 14:31:16.000', 1, '2023-04-03 20:06:16.989'); -INSERT INTO `wms_item_type` VALUES (201, 100, '0,100', '办公室', 2, '0', '1', NULL, '2023-04-03 14:31:16.700', 0, '2023-04-03 14:31:16.700'); -INSERT INTO `wms_item_type` VALUES (202, 100, '0,100', '技术处', 4, '0', '1', NULL, '2023-04-03 14:31:16.700', 0, '2023-04-03 14:31:16.700'); -INSERT INTO `wms_item_type` VALUES (203, 100, '0,100', '刑事法庭', 5, '0', '1', NULL, '2023-04-03 14:31:16.700', 0, '2023-04-03 14:31:16.700'); -INSERT INTO `wms_item_type` VALUES (204, 100, '0,100', '民事法庭', 6, '0', '1', NULL, '2023-04-03 14:31:16.700', 0, '2023-04-03 14:31:16.700'); -INSERT INTO `wms_item_type` VALUES (205, 100, '0,100', '政治部', 3, '0', '1', NULL, '2023-04-03 14:31:16.700', 0, '2023-04-03 14:31:16.700'); -INSERT INTO `wms_item_type` VALUES (206, 100, '', '测试', 0, '0', '1', 1, '2023-04-03 18:02:22.015', NULL, NULL); -INSERT INTO `wms_item_type` VALUES (207, 200, '', '111', 0, '0', '1', 1, '2023-04-03 18:02:30.320', NULL, NULL); -INSERT INTO `wms_item_type` VALUES (208, 200, '0,100,200', '内存', 0, '0', '0', 1, '2023-04-03 20:07:10.178', NULL, NULL); -INSERT INTO `wms_item_type` VALUES (209, 200, '0,100,200', '硬盘', 0, '0', '0', 1, '2023-04-03 20:07:23.678', NULL, NULL); -INSERT INTO `wms_item_type` VALUES (211, 0, '', 'test', 0, '0', '0', 1, '2023-04-27 08:54:01.869', NULL, NULL); -INSERT INTO `wms_item_type` VALUES (212, 100, '', '555', 0, '0', '0', 115, '2023-04-29 17:07:51.000', 115, '2023-04-29 17:08:59.853'); -INSERT INTO `wms_item_type` VALUES (213, 100, '', '2222', 3, '0', '0', 115, '2023-04-29 17:08:15.710', NULL, NULL); -INSERT INTO `wms_item_type` VALUES (214, 0, '', '干果', 0, '0', '0', 115, '2023-05-02 13:38:41.000', 115, '2023-05-03 15:16:25.322'); - --- ---------------------------- --- Table structure for wms_rack --- ---------------------------- -DROP TABLE IF EXISTS `wms_rack`; -CREATE TABLE `wms_rack` ( - `id` bigint(20) NOT NULL AUTO_INCREMENT, - `rack_no` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '编号', - `rack_name` varchar(60) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '名称', - `area_id` bigint(20) NOT NULL COMMENT '所属库区', - `warehouse_id` bigint(20) NOT NULL COMMENT '所属仓库', - `remark` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '备注', - `del_flag` tinyint(4) NOT NULL DEFAULT 0 COMMENT '删除标识', - `create_by` bigint(20) NULL DEFAULT NULL COMMENT '创建人', - `create_time` datetime(3) NULL DEFAULT NULL COMMENT '创建时间', - `update_by` bigint(20) NULL DEFAULT NULL COMMENT '修改人', - `update_time` datetime(3) NULL DEFAULT NULL COMMENT '修改时间', - PRIMARY KEY (`id`) USING BTREE -) ENGINE = InnoDB AUTO_INCREMENT = 128 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '货架' ROW_FORMAT = Dynamic; - --- ---------------------------- --- Records of wms_rack --- ---------------------------- -INSERT INTO `wms_rack` VALUES (1, '1', '苏州东1', 17, 2, NULL, 1, 1, '2022-08-09 11:50:30.000', 1, '2022-11-04 22:55:31.231'); -INSERT INTO `wms_rack` VALUES (2, '23', 'sd', 14, 2, NULL, 1, 1, '2022-08-09 13:54:03.000', NULL, NULL); -INSERT INTO `wms_rack` VALUES (3, '23', '45', 13, 1, NULL, 1, 1, '2022-08-09 15:33:18.000', NULL, NULL); -INSERT INTO `wms_rack` VALUES (4, '23', '南京北1', 14, 3, NULL, 1, 1, '2022-08-09 15:37:15.000', 115, '2022-11-09 16:48:11.177'); -INSERT INTO `wms_rack` VALUES (5, '22', '苏州东2', 17, 2, NULL, 1, 1, '2022-08-10 10:13:02.000', 115, '2022-11-12 10:50:56.824'); -INSERT INTO `wms_rack` VALUES (6, '12', '上海南3', 18, 2, NULL, 1, 1, '2022-08-10 10:13:14.000', 1, '2022-10-09 23:02:31.322'); -INSERT INTO `wms_rack` VALUES (7, '111', NULL, 16, 3, NULL, 1, 1, '2022-10-09 23:44:11.544', NULL, NULL); -INSERT INTO `wms_rack` VALUES (8, '01-01-998', NULL, 42, 20, NULL, 1, 115, '2022-11-07 21:39:03.288', NULL, NULL); -INSERT INTO `wms_rack` VALUES (9, '1-A-1', '苹果', 43, 21, NULL, 1, 115, '2022-11-11 17:07:13.652', NULL, NULL); -INSERT INTO `wms_rack` VALUES (10, '1-A-2', '梨', 43, 21, NULL, 1, 115, '2022-11-11 17:07:29.700', NULL, NULL); -INSERT INTO `wms_rack` VALUES (11, '1-B-1', '葡萄', 44, 21, NULL, 1, 115, '2022-11-11 17:07:44.089', NULL, NULL); -INSERT INTO `wms_rack` VALUES (12, '2-A-1', '薯片', 46, 22, NULL, 1, 115, '2022-11-11 17:08:06.115', NULL, NULL); -INSERT INTO `wms_rack` VALUES (13, '2-A-2', '虾片', 53, 14, NULL, 1, 115, '2022-11-11 17:08:34.000', 115, '2022-12-02 18:43:14.915'); -INSERT INTO `wms_rack` VALUES (14, '3-A-1', '可口可乐', 46, 14, NULL, 1, 115, '2022-11-11 17:08:53.000', 115, '2022-11-27 20:52:04.405'); -INSERT INTO `wms_rack` VALUES (15, '4-A-1', '非你莫属', 48, 24, NULL, 1, 115, '2022-11-11 17:09:08.703', NULL, NULL); -INSERT INTO `wms_rack` VALUES (16, '4-B-1', 'ABC', 49, 24, NULL, 1, 115, '2022-11-11 17:09:34.038', NULL, NULL); -INSERT INTO `wms_rack` VALUES (17, 'luobohuojia', '萝卜货架', 50, 25, '无', 1, 115, '2022-11-13 17:12:01.932', NULL, NULL); -INSERT INTO `wms_rack` VALUES (18, '3444', '巨化股份', 51, 26, '雷', 1, 115, '2022-11-14 16:40:10.222', NULL, NULL); -INSERT INTO `wms_rack` VALUES (19, '123123', '123123123', 46, 14, NULL, 1, 115, '2022-11-20 08:53:13.880', NULL, NULL); -INSERT INTO `wms_rack` VALUES (20, 'test-1-A', 'test-1-A', 45, 2, NULL, 1, 115, '2022-11-20 15:08:52.000', 115, '2022-11-30 14:41:21.313'); -INSERT INTO `wms_rack` VALUES (21, '12', '21', 45, 2, NULL, 1, 115, '2022-11-20 21:19:28.402', NULL, NULL); -INSERT INTO `wms_rack` VALUES (22, '111', '11', 45, 2, '1', 1, 115, '2022-11-29 15:10:43.618', NULL, NULL); -INSERT INTO `wms_rack` VALUES (23, '002', NULL, 55, 14, NULL, 1, 115, '2022-12-04 15:38:15.553', NULL, NULL); -INSERT INTO `wms_rack` VALUES (24, 'A-01-01', '金融仓库中间南排', 56, 30, '金融仓库中间南排', 1, 115, '2022-12-05 15:48:40.022', NULL, NULL); -INSERT INTO `wms_rack` VALUES (25, 'xmld_b1_1_1', '北仓1-1-1', 57, 33, NULL, 1, 115, '2022-12-07 09:13:00.000', 115, '2022-12-08 10:28:57.591'); -INSERT INTO `wms_rack` VALUES (26, 'HJ0001', '货架A1', 58, 34, NULL, 1, 115, '2022-12-09 16:23:48.279', NULL, NULL); -INSERT INTO `wms_rack` VALUES (27, '0101', '1号货架', 60, 39, NULL, 1, 115, '2022-12-12 13:15:06.451', NULL, NULL); -INSERT INTO `wms_rack` VALUES (28, '123', 'sdfsd', 61, 38, NULL, 1, 115, '2022-12-14 23:13:14.234', NULL, NULL); -INSERT INTO `wms_rack` VALUES (29, '23', '345', 61, 38, NULL, 1, 115, '2022-12-15 13:26:31.419', NULL, NULL); -INSERT INTO `wms_rack` VALUES (30, 'A001-01-H01-01', '成品仓01区1号货架1层', 63, 42, '成品仓01区1号货架1层', 1, 115, '2022-12-18 17:35:11.000', 115, '2023-01-03 16:23:19.430'); -INSERT INTO `wms_rack` VALUES (31, '222', '1111', 70, 50, '111', 1, 115, '2023-01-04 14:13:49.000', 115, '2023-01-06 07:58:13.480'); -INSERT INTO `wms_rack` VALUES (32, '001', NULL, 68, 51, NULL, 1, 115, '2023-01-05 14:48:42.575', NULL, NULL); -INSERT INTO `wms_rack` VALUES (33, '123', NULL, 72, 52, NULL, 1, 115, '2023-01-06 14:22:48.571', NULL, NULL); -INSERT INTO `wms_rack` VALUES (34, '01', '货架1', 73, 53, NULL, 1, 115, '2023-01-06 16:56:13.529', NULL, NULL); -INSERT INTO `wms_rack` VALUES (35, '02', '货架2', 73, 53, NULL, 1, 115, '2023-01-06 16:56:31.948', NULL, NULL); -INSERT INTO `wms_rack` VALUES (36, '03', '工序站点1', 73, 53, NULL, 1, 115, '2023-01-07 10:21:32.019', NULL, NULL); -INSERT INTO `wms_rack` VALUES (37, '1', '博爱东库区-1号架', 77, 61, NULL, 1, 115, '2023-01-07 23:57:52.000', 115, '2023-01-11 16:41:36.960'); -INSERT INTO `wms_rack` VALUES (38, '2', '博爱东库区-2号架', 77, 61, NULL, 1, 115, '2023-01-07 23:58:45.840', NULL, NULL); -INSERT INTO `wms_rack` VALUES (39, '3', '博爱西库区-1号架', 78, 61, NULL, 1, 115, '2023-01-08 00:01:09.139', NULL, NULL); -INSERT INTO `wms_rack` VALUES (40, '4', '博爱西库区-2号架', 78, 61, NULL, 1, 115, '2023-01-08 00:01:38.450', NULL, NULL); -INSERT INTO `wms_rack` VALUES (41, '5', '博爱南库区-1号架', 79, 61, NULL, 1, 115, '2023-01-08 23:15:13.674', NULL, NULL); -INSERT INTO `wms_rack` VALUES (42, '6', '博爱南库区-2号架', 79, 61, NULL, 1, 115, '2023-01-08 23:15:37.591', NULL, NULL); -INSERT INTO `wms_rack` VALUES (43, '7', '博爱北库区-1号架', 80, 61, NULL, 1, 115, '2023-01-08 23:16:14.785', NULL, NULL); -INSERT INTO `wms_rack` VALUES (44, '8', '博爱北库区-2号架', 80, 61, NULL, 1, 115, '2023-01-08 23:53:46.462', NULL, NULL); -INSERT INTO `wms_rack` VALUES (45, '8', '博爱北库区-2号架', 80, 61, '我要修改啦', 1, 115, '2023-01-08 23:57:49.000', 115, '2023-01-09 00:02:24.414'); -INSERT INTO `wms_rack` VALUES (46, 'A', ' AS', 77, 61, '1111', 1, 115, '2023-01-10 16:29:49.004', NULL, NULL); -INSERT INTO `wms_rack` VALUES (47, '1', '测试货架', 82, 64, NULL, 1, 115, '2023-01-11 20:47:34.761', NULL, NULL); -INSERT INTO `wms_rack` VALUES (48, '01', NULL, 83, 65, NULL, 1, 115, '2023-01-13 12:41:14.566', NULL, NULL); -INSERT INTO `wms_rack` VALUES (49, '01', '不良品', 96, 84, '1', 1, 115, '2023-01-13 12:50:55.000', 115, '2023-02-08 10:37:46.199'); -INSERT INTO `wms_rack` VALUES (50, '2', '成品库', 89, 76, NULL, 1, 115, '2023-01-14 12:59:42.000', 115, '2023-02-01 22:02:52.420'); -INSERT INTO `wms_rack` VALUES (51, '3', '外库', 91, 77, NULL, 1, 115, '2023-01-14 16:55:53.000', 115, '2023-02-01 22:03:13.824'); -INSERT INTO `wms_rack` VALUES (52, '04', '不良品', 92, 78, NULL, 1, 115, '2023-01-29 21:29:10.000', 115, '2023-02-01 22:03:33.273'); -INSERT INTO `wms_rack` VALUES (53, '0206测试', '0206测试', 94, 83, '0206测试', 1, 115, '2023-02-06 14:11:55.627', NULL, NULL); -INSERT INTO `wms_rack` VALUES (54, '123', NULL, 95, 85, NULL, 1, 115, '2023-02-07 10:22:08.616', NULL, NULL); -INSERT INTO `wms_rack` VALUES (55, '30011', '一层', 98, 86, NULL, 1, 115, '2023-02-08 09:09:27.000', 115, '2023-02-08 09:10:43.042'); -INSERT INTO `wms_rack` VALUES (56, '30012', '二层', 98, 86, NULL, 1, 115, '2023-02-08 09:09:48.000', 115, '2023-02-08 09:10:52.195'); -INSERT INTO `wms_rack` VALUES (57, '260102', '东区二层架', 100, 87, NULL, 1, 115, '2023-02-08 16:32:37.968', NULL, NULL); -INSERT INTO `wms_rack` VALUES (58, '003', 'aa货架', 101, 88, '1', 1, 115, '2023-02-10 10:43:17.300', NULL, NULL); -INSERT INTO `wms_rack` VALUES (59, 'SCZX001', NULL, 102, 89, NULL, 1, 115, '2023-02-10 15:23:54.628', NULL, NULL); -INSERT INTO `wms_rack` VALUES (60, '001', 'm78星能量石', 104, 90, '测试', 1, 115, '2023-02-11 10:56:36.449', NULL, NULL); -INSERT INTO `wms_rack` VALUES (61, 'A001001001', '50mm', 105, 91, NULL, 1, 115, '2023-02-11 14:07:29.296', NULL, NULL); -INSERT INTO `wms_rack` VALUES (62, '003', '轴承架子', 109, 92, '轴承', 1, 115, '2023-02-13 13:49:44.185', NULL, NULL); -INSERT INTO `wms_rack` VALUES (63, 'A1001', '货架A1001', 110, 94, NULL, 1, 115, '2023-02-15 14:08:32.590', NULL, NULL); -INSERT INTO `wms_rack` VALUES (64, '01', '货架1', 111, 95, NULL, 1, 115, '2023-02-15 15:03:03.757', NULL, NULL); -INSERT INTO `wms_rack` VALUES (65, '2001', '废胎', 112, 98, NULL, 1, 115, '2023-02-16 15:09:06.723', NULL, NULL); -INSERT INTO `wms_rack` VALUES (66, '001', '货架一', 115, 101, NULL, 1, 115, '2023-02-17 10:49:06.139', NULL, NULL); -INSERT INTO `wms_rack` VALUES (67, 'd0001', 'dddd', 117, 104, 'd', 1, 115, '2023-02-17 13:07:56.000', 115, '2023-02-19 01:01:03.293'); -INSERT INTO `wms_rack` VALUES (68, '1', '郑州', 118, 106, NULL, 1, 115, '2023-02-21 12:00:56.455', NULL, NULL); -INSERT INTO `wms_rack` VALUES (69, '007', 'ii', 118, 106, NULL, 1, 115, '2023-02-23 15:04:56.000', 115, '2023-02-23 15:05:04.435'); -INSERT INTO `wms_rack` VALUES (70, '001', '', 119, 109, NULL, 1, 115, '2023-02-23 20:09:04.593', NULL, NULL); -INSERT INTO `wms_rack` VALUES (71, '0111', '0111货架', 120, 109, '123456', 1, 115, '2023-02-24 15:02:49.734', NULL, NULL); -INSERT INTO `wms_rack` VALUES (72, '001', '键盘', 122, 112, NULL, 1, 115, '2023-02-25 08:21:48.064', NULL, NULL); -INSERT INTO `wms_rack` VALUES (73, '100_01_01', NULL, 125, 115, NULL, 1, 115, '2023-02-27 10:30:20.533', NULL, NULL); -INSERT INTO `wms_rack` VALUES (74, '3243', '43', 126, 116, '4343', 1, 115, '2023-03-01 01:09:46.141', NULL, NULL); -INSERT INTO `wms_rack` VALUES (75, 'B02', 'B02', 131, 119, NULL, 1, 115, '2023-03-01 17:34:12.313', NULL, NULL); -INSERT INTO `wms_rack` VALUES (76, 'B03', 'B03', 131, 119, NULL, 1, 115, '2023-03-01 17:36:35.675', NULL, NULL); -INSERT INTO `wms_rack` VALUES (77, 'A', 'A', 128, 118, NULL, 1, 115, '2023-03-01 17:38:29.034', NULL, NULL); -INSERT INTO `wms_rack` VALUES (78, 'B', 'B', 129, 118, NULL, 1, 115, '2023-03-01 17:39:37.316', NULL, NULL); -INSERT INTO `wms_rack` VALUES (79, 'B11-A07', 'B11-A07', 131, 119, NULL, 1, 115, '2023-03-01 17:40:20.000', 115, '2023-03-01 17:44:26.278'); -INSERT INTO `wms_rack` VALUES (80, '3A02', 'A02', 130, 119, NULL, 1, 115, '2023-03-01 17:40:57.000', 115, '2023-03-01 17:45:09.486'); -INSERT INTO `wms_rack` VALUES (81, 'B11-A04', 'B11-A04', 131, 119, NULL, 1, 115, '2023-03-01 17:45:39.111', NULL, NULL); -INSERT INTO `wms_rack` VALUES (82, '3A11', 'A11', 130, 119, NULL, 1, 115, '2023-03-01 17:46:08.392', NULL, NULL); -INSERT INTO `wms_rack` VALUES (83, '3A10', 'A10', 130, 119, NULL, 1, 115, '2023-03-01 17:46:43.687', NULL, NULL); -INSERT INTO `wms_rack` VALUES (84, '3A01G01-4', 'A01G01-4', 130, 119, NULL, 1, 115, '2023-03-01 17:47:08.789', NULL, NULL); -INSERT INTO `wms_rack` VALUES (85, '3A01G03-3', 'A01G03-3', 130, 119, NULL, 1, 115, '2023-03-01 17:47:40.145', NULL, NULL); -INSERT INTO `wms_rack` VALUES (86, '3A01G08-2', 'A01G08-2', 130, 119, NULL, 1, 115, '2023-03-01 17:48:23.495', NULL, NULL); -INSERT INTO `wms_rack` VALUES (87, '3B01G01-1', 'B01G01-1', 131, 119, NULL, 1, 115, '2023-03-01 17:48:51.961', NULL, NULL); -INSERT INTO `wms_rack` VALUES (88, '2-3', '2-3', 134, 121, NULL, 1, 115, '2023-03-03 20:09:55.036', NULL, NULL); -INSERT INTO `wms_rack` VALUES (89, '1-2-3', '1-2-3', 134, 121, NULL, 1, 115, '2023-03-03 20:11:16.246', NULL, NULL); -INSERT INTO `wms_rack` VALUES (90, '2-1-1', '2-1-1', 135, 122, NULL, 1, 115, '2023-03-03 21:26:29.339', NULL, NULL); -INSERT INTO `wms_rack` VALUES (91, '2-1-2', '2-1-2', 135, 122, NULL, 1, 115, '2023-03-03 21:26:50.592', NULL, NULL); -INSERT INTO `wms_rack` VALUES (92, 'HJ030701', '货架001', 136, 117, '货架001', 1, 115, '2023-03-07 16:33:23.890', NULL, NULL); -INSERT INTO `wms_rack` VALUES (93, '123', 'as', 141, 129, 'asd', 1, 115, '2023-03-11 21:35:57.694', NULL, NULL); -INSERT INTO `wms_rack` VALUES (94, '测试货架', '测试货架', 142, 131, '测试货架', 1, 115, '2023-03-12 15:51:59.835', NULL, NULL); -INSERT INTO `wms_rack` VALUES (95, '1', '货架', 142, 131, '1', 1, 115, '2023-03-12 19:12:32.372', NULL, NULL); -INSERT INTO `wms_rack` VALUES (96, '123', '货架12', 156, 163, '电脑', 1, 115, '2023-03-13 15:20:40.000', 115, '2023-03-29 14:50:13.343'); -INSERT INTO `wms_rack` VALUES (97, '2', '22', 159, 171, '2', 1, 115, '2023-03-13 16:37:38.000', 115, '2023-04-03 17:31:52.624'); -INSERT INTO `wms_rack` VALUES (98, '011', '1111', 148, 137, NULL, 1, 115, '2023-03-14 14:12:30.467', NULL, NULL); -INSERT INTO `wms_rack` VALUES (99, '12321312', '1111', 151, 149, NULL, 1, 115, '2023-03-21 17:30:41.550', NULL, NULL); -INSERT INTO `wms_rack` VALUES (100, '3.22', '服装1-甲-架A', 152, 154, '20230322', 1, 115, '2023-03-22 15:48:55.511', NULL, NULL); -INSERT INTO `wms_rack` VALUES (101, '3.22-1', '服装1-甲-B', 152, 154, NULL, 1, 115, '2023-03-22 16:13:34.000', 115, '2023-04-10 11:18:50.543'); -INSERT INTO `wms_rack` VALUES (102, 'HD-PC-01', '华东1库区1货架', 171, 155, NULL, 1, 115, '2023-03-22 22:48:59.000', 115, '2023-04-10 14:40:25.501'); -INSERT INTO `wms_rack` VALUES (103, '001', NULL, 148, 137, NULL, 1, 115, '2023-03-23 14:06:51.654', NULL, NULL); -INSERT INTO `wms_rack` VALUES (104, '13511', 'fcl/T1/T2', 155, 161, 'fcl/T1/T2', 1, 115, '2023-03-25 00:02:16.842', NULL, NULL); -INSERT INTO `wms_rack` VALUES (105, '01', NULL, 157, 165, NULL, 1, 115, '2023-03-25 15:22:53.199', NULL, NULL); -INSERT INTO `wms_rack` VALUES (106, '033123', '033123', 158, 167, NULL, 1, 115, '2023-03-27 13:44:41.522', NULL, NULL); -INSERT INTO `wms_rack` VALUES (107, '11', '器材库', 155, 139, '体育器材', 1, 115, '2023-03-28 08:49:32.000', 115, '2023-04-08 10:06:15.357'); -INSERT INTO `wms_rack` VALUES (108, 'hj-01', '货架1', 159, 171, NULL, 1, 115, '2023-03-29 13:33:25.000', 115, '2023-03-29 13:33:50.306'); -INSERT INTO `wms_rack` VALUES (109, '444', 'test', 155, 139, NULL, 1, 115, '2023-03-30 18:20:26.751', NULL, NULL); -INSERT INTO `wms_rack` VALUES (110, '笔', '笔', 160, 138, NULL, 1, 115, '2023-03-30 18:22:04.840', NULL, NULL); -INSERT INTO `wms_rack` VALUES (111, '301', '301', 162, 174, NULL, 1, 115, '2023-04-01 06:32:08.122', NULL, NULL); -INSERT INTO `wms_rack` VALUES (112, '大内密探003', '我是货架', 168, 181, '大内密探003', 1, 115, '2023-04-06 14:06:40.000', 115, '2023-04-06 14:08:08.795'); -INSERT INTO `wms_rack` VALUES (113, 'one-1-1', 'yyf的仓库的库区的货架', 169, 184, 'yyf', 1, 115, '2023-04-06 14:59:11.708', NULL, NULL); -INSERT INTO `wms_rack` VALUES (114, '800', '肉类', 170, 185, NULL, 1, 115, '2023-04-06 22:42:40.678', NULL, NULL); -INSERT INTO `wms_rack` VALUES (115, 'T02-01', 'test02库区1号货架', 176, 178, 'hentai', 1, 115, '2023-04-11 09:10:05.000', 115, '2023-04-11 09:22:56.680'); -INSERT INTO `wms_rack` VALUES (116, '1000011', '1号货架', 178, 192, NULL, 1, 115, '2023-04-13 10:13:32.000', 115, '2023-04-13 14:06:05.035'); -INSERT INTO `wms_rack` VALUES (117, '1000032', '1232114货架', 181, 194, NULL, 0, 115, '2023-04-13 10:13:49.000', 115, '2023-04-25 17:31:17.857'); -INSERT INTO `wms_rack` VALUES (118, '1231231', '111233货架', 181, 194, NULL, 0, 115, '2023-04-13 10:14:17.000', 115, '2023-04-13 10:14:46.451'); -INSERT INTO `wms_rack` VALUES (119, '1234567', '232323货架', 182, 195, NULL, 0, 115, '2023-04-13 10:15:01.923', NULL, NULL); -INSERT INTO `wms_rack` VALUES (120, '1388799', '1231231货架', 183, 196, NULL, 1, 115, '2023-04-13 10:15:18.452', NULL, NULL); -INSERT INTO `wms_rack` VALUES (121, '1231456', '758748货架', 182, 195, NULL, 0, 115, '2023-04-13 10:16:32.000', 115, '2023-04-22 21:07:41.581'); -INSERT INTO `wms_rack` VALUES (122, '7657364', '163636货架', 185, 198, NULL, 0, 115, '2023-04-13 10:16:46.660', NULL, NULL); -INSERT INTO `wms_rack` VALUES (123, '1765654', '1728371货架', 186, 199, NULL, 0, 115, '2023-04-13 10:17:04.083', NULL, NULL); -INSERT INTO `wms_rack` VALUES (124, '1000012', '2号货架', 185, 198, NULL, 0, 115, '2023-04-13 14:06:46.000', 115, '2023-04-20 08:46:09.744'); -INSERT INTO `wms_rack` VALUES (125, '3500549', '小件架', 187, 204, '25m*3m*3m三层架', 0, 115, '2023-04-18 16:05:23.509', NULL, NULL); -INSERT INTO `wms_rack` VALUES (126, '11', NULL, 188, 210, NULL, 0, 115, '2023-04-20 11:30:30.846', NULL, NULL); -INSERT INTO `wms_rack` VALUES (127, '001', '货架1', 189, 215, NULL, 0, 115, '2023-04-24 15:33:36.867', NULL, NULL); - --- ---------------------------- --- Table structure for wms_receipt_order --- ---------------------------- -DROP TABLE IF EXISTS `wms_receipt_order`; -CREATE TABLE `wms_receipt_order` ( - `id` bigint(20) NOT NULL AUTO_INCREMENT, - `receipt_order_no` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '入库单号', - `receipt_order_type` int(11) NULL DEFAULT NULL COMMENT '入库类型', - `supplier_id` bigint(20) NULL DEFAULT NULL COMMENT '供应商', - `order_no` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '订单号', - `payable_amount` decimal(10, 2) NULL DEFAULT NULL COMMENT '订单金额', - `receipt_order_status` tinyint(4) NULL DEFAULT NULL COMMENT '入库状态', - `remark` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '备注', - `del_flag` tinyint(4) NOT NULL DEFAULT 0 COMMENT '删除标识', - `create_by` bigint(20) NULL DEFAULT NULL COMMENT '创建人', - `create_time` datetime(3) NULL DEFAULT NULL COMMENT '创建时间', - `update_by` bigint(20) NULL DEFAULT NULL COMMENT '修改人', - `update_time` datetime(3) NULL DEFAULT NULL COMMENT '修改时间', - PRIMARY KEY (`id`) USING BTREE -) ENGINE = InnoDB AUTO_INCREMENT = 626 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '入库单' ROW_FORMAT = Dynamic; - --- ---------------------------- --- Records of wms_receipt_order --- ---------------------------- -INSERT INTO `wms_receipt_order` VALUES (1, '1', 3, 1, '112', NULL, 0, '222', 1, NULL, '2022-08-13 13:51:29.000', 1, '2022-09-07 16:33:49.108'); -INSERT INTO `wms_receipt_order` VALUES (2, NULL, 1, 11, '11', NULL, 0, NULL, 1, 1, '2022-08-23 17:37:34.232', NULL, NULL); -INSERT INTO `wms_receipt_order` VALUES (3, NULL, 1, 1, 'q', NULL, 0, NULL, 1, 1, '2022-08-30 19:36:47.983', NULL, NULL); -INSERT INTO `wms_receipt_order` VALUES (4, NULL, 3, NULL, '1111', NULL, 0, NULL, 1, 1, '2022-08-30 19:37:30.517', NULL, NULL); -INSERT INTO `wms_receipt_order` VALUES (5, 'R-20220901194301-2303', 1, 1, '20220901-1234234123423', NULL, 0, '采购入库', 1, 1, '2022-09-01 19:43:56.000', 115, '2022-11-06 00:16:48.482'); -INSERT INTO `wms_receipt_order` VALUES (6, 'R-20220901194936-0377', 1, 1, '20220901-15645132132', NULL, 0, '采购', 1, 1, '2022-09-01 19:50:04.000', 115, '2022-11-06 00:16:52.436'); -INSERT INTO `wms_receipt_order` VALUES (7, 'R-20220901200200-7813', 1, 1, '20220901-12346598321354', NULL, 0, '测试', 1, 1, '2022-09-01 20:03:35.000', 1, '2022-10-11 14:52:27.764'); -INSERT INTO `wms_receipt_order` VALUES (8, 'R-20220901200359-3039', 1, 1, '20220901-123456789', NULL, 2, 'test', 1, 1, '2022-09-01 20:04:22.000', 1, '2022-10-10 10:55:28.806'); -INSERT INTO `wms_receipt_order` VALUES (9, 'R-2022-09-14-112215', 2, 1, '111222', NULL, 2, '11dfasdfdasfsdf中文', 1, 1, '2022-09-14 11:23:14.000', 1, '2022-10-09 15:13:27.901'); -INSERT INTO `wms_receipt_order` VALUES (10, 'R-2022-10-10-162014', 1, 1, '1', NULL, 0, '2', 1, 1, '2022-10-10 16:20:22.282', NULL, NULL); -INSERT INTO `wms_receipt_order` VALUES (11, 'R-2022-10-10-220001', 1, 1, '20221010-1', NULL, 2, '测试没有物料', 1, 1, '2022-10-10 22:00:24.000', 1, '2022-10-10 22:52:53.910'); -INSERT INTO `wms_receipt_order` VALUES (12, 'R-2022-10-10-225306', 1, 1, '20221010-2', NULL, 2, '测试入库', 1, 1, '2022-10-10 22:53:34.000', 1, '2022-10-10 23:05:14.209'); -INSERT INTO `wms_receipt_order` VALUES (13, 'R-2022-10-10-231339', 1, 2, '20221010-3', NULL, 2, NULL, 1, 1, '2022-10-10 23:14:04.000', 1, '2022-11-03 17:48:36.779'); -INSERT INTO `wms_receipt_order` VALUES (14, 'R-2022-10-20-143634', 1, NULL, NULL, NULL, 3, NULL, 1, 1, '2022-10-20 14:37:18.000', 115, '2022-11-08 17:14:51.948'); -INSERT INTO `wms_receipt_order` VALUES (15, 'R-2022-11-06-155158', 1, 2, '1', NULL, 1, NULL, 1, 115, '2022-11-06 15:52:22.000', 115, '2022-11-09 11:36:54.441'); -INSERT INTO `wms_receipt_order` VALUES (16, 'R-2022-11-06-210843', 1, 2, '1111', NULL, 2, '1111', 1, 115, '2022-11-06 21:09:18.000', 115, '2022-11-07 08:25:36.632'); -INSERT INTO `wms_receipt_order` VALUES (17, 'R-2022-11-07-082418', 1, 2, NULL, NULL, 0, NULL, 1, 115, '2022-11-07 08:24:52.146', NULL, NULL); -INSERT INTO `wms_receipt_order` VALUES (18, 'R-2022-11-07-172648', 1, 1, NULL, NULL, 0, NULL, 1, 115, '2022-11-07 17:27:04.000', 115, '2022-11-08 09:10:00.495'); -INSERT INTO `wms_receipt_order` VALUES (19, 'R-2022-11-07-214023', 1, 1, '0009', NULL, 3, NULL, 1, 115, '2022-11-07 21:41:19.000', 115, '2022-11-07 21:46:38.799'); -INSERT INTO `wms_receipt_order` VALUES (20, 'R-2022-11-08-102247', 1, NULL, NULL, NULL, 0, NULL, 1, 115, '2022-11-08 10:22:59.884', NULL, NULL); -INSERT INTO `wms_receipt_order` VALUES (21, 'R-2022-11-09-115801', 3, 3, NULL, NULL, 0, NULL, 1, 115, '2022-11-09 11:58:22.094', NULL, NULL); -INSERT INTO `wms_receipt_order` VALUES (22, 'R-2022-11-09-145407', 1, 2, NULL, NULL, 3, NULL, 1, 115, '2022-11-09 14:55:02.000', 115, '2022-11-09 14:59:21.091'); -INSERT INTO `wms_receipt_order` VALUES (23, 'R-2022-11-09-162100', 1, 1, '333', NULL, 3, 'ww', 1, 115, '2022-11-09 16:21:29.000', 115, '2022-11-09 18:32:26.350'); -INSERT INTO `wms_receipt_order` VALUES (24, 'R-2022-11-09-162513', 1, 1, NULL, NULL, 0, NULL, 1, 115, '2022-11-09 16:25:23.063', NULL, NULL); -INSERT INTO `wms_receipt_order` VALUES (25, 'R-2022-11-09-183606', 3, NULL, NULL, NULL, 0, NULL, 1, 115, '2022-11-09 18:37:04.348', NULL, NULL); -INSERT INTO `wms_receipt_order` VALUES (26, 'R-2022-11-09-184059', 1, NULL, NULL, NULL, 0, NULL, 1, 115, '2022-11-09 18:41:17.246', NULL, NULL); -INSERT INTO `wms_receipt_order` VALUES (27, 'R-2022-11-10-094219', 1, 1, 'ioi08900909', NULL, 0, 'test', 1, 115, '2022-11-10 09:42:35.452', NULL, NULL); -INSERT INTO `wms_receipt_order` VALUES (28, 'R-2022-11-10-135511', 1, NULL, NULL, NULL, 0, NULL, 1, 115, '2022-11-10 13:55:37.000', 115, '2022-11-10 21:17:03.608'); -INSERT INTO `wms_receipt_order` VALUES (29, 'R-2022-11-11-160624', 1, 2, '这是手动输入的订单号', NULL, 3, '这是备注,要求100字之内', 1, 115, '2022-11-11 16:07:37.000', 115, '2022-11-11 16:24:29.164'); -INSERT INTO `wms_receipt_order` VALUES (30, 'R-2022-11-11-163005', 1, 3, '1321213213123', NULL, 0, NULL, 1, 115, '2022-11-11 16:30:45.663', NULL, NULL); -INSERT INTO `wms_receipt_order` VALUES (31, 'R-2022-11-11-171713', 1, 4, 'ShuiGuo', NULL, 3, 'This is ShuiGuo', 1, 115, '2022-11-11 17:18:19.000', 115, '2022-11-13 17:14:45.564'); -INSERT INTO `wms_receipt_order` VALUES (32, 'R-2022-11-13-171809', 1, 1, 'DD001', NULL, 0, NULL, 1, 115, '2022-11-13 17:30:42.793', NULL, NULL); -INSERT INTO `wms_receipt_order` VALUES (33, 'R-2022-11-13-173203', 2, 1, '173203', NULL, 3, '173203', 1, 115, '2022-11-13 17:32:35.000', 115, '2022-11-13 17:33:50.693'); -INSERT INTO `wms_receipt_order` VALUES (34, 'R-2022-11-13-173926', 1, NULL, NULL, NULL, 0, NULL, 1, 115, '2022-11-13 17:39:37.243', NULL, NULL); -INSERT INTO `wms_receipt_order` VALUES (35, 'R-2022-11-13-174117', 1, 1, '11', NULL, 2, '11', 1, 115, '2022-11-13 17:41:27.000', 115, '2022-11-13 17:41:54.881'); -INSERT INTO `wms_receipt_order` VALUES (36, 'R-2022-11-13-174258', 1, 2, NULL, NULL, 2, NULL, 1, 115, '2022-11-13 17:43:06.000', 115, '2022-11-13 21:02:33.763'); -INSERT INTO `wms_receipt_order` VALUES (37, 'R-2022-11-14-044038', 1, 1, NULL, NULL, 1, NULL, 1, 115, '2022-11-14 04:41:23.000', 115, '2022-11-14 16:45:52.290'); -INSERT INTO `wms_receipt_order` VALUES (38, 'R-2022-11-14-133808', 1, NULL, NULL, NULL, 1, NULL, 1, 115, '2022-11-14 13:38:25.000', 115, '2022-11-14 16:46:51.725'); -INSERT INTO `wms_receipt_order` VALUES (39, 'R-2022-11-14-164413', 3, 1, NULL, NULL, 0, NULL, 1, 115, '2022-11-14 16:44:47.703', NULL, NULL); -INSERT INTO `wms_receipt_order` VALUES (40, 'R-2022-11-14-173247', 1, 1, 'hhj', NULL, 1, NULL, 1, 115, '2022-11-14 17:33:06.000', 115, '2022-11-14 17:33:30.838'); -INSERT INTO `wms_receipt_order` VALUES (41, 'R-2022-11-14-231535', 1, 1, NULL, NULL, 0, NULL, 1, 115, '2022-11-14 23:16:05.420', NULL, NULL); -INSERT INTO `wms_receipt_order` VALUES (42, 'R-2022-11-15-163458', 1, 1, '123213132', NULL, 3, '123213', 1, 115, '2022-11-15 16:35:23.000', 115, '2022-11-15 16:42:56.246'); -INSERT INTO `wms_receipt_order` VALUES (43, 'R-2022-11-15-214714', 1, NULL, NULL, NULL, 0, NULL, 1, 115, '2022-11-15 21:47:54.000', 115, '2022-11-15 21:48:08.429'); -INSERT INTO `wms_receipt_order` VALUES (44, 'R-2022-11-16-142759', 1, 1, '124568623', NULL, 2, NULL, 1, 115, '2022-11-16 14:28:56.000', 115, '2022-11-18 09:11:43.841'); -INSERT INTO `wms_receipt_order` VALUES (45, 'R-2022-11-16-150215', 1, 2, '123227', NULL, 0, NULL, 1, 115, '2022-11-16 15:03:17.052', NULL, NULL); -INSERT INTO `wms_receipt_order` VALUES (46, 'R-2022-11-17-044529', 1, 1, NULL, NULL, 0, NULL, 1, 115, '2022-11-17 04:45:44.513', NULL, NULL); -INSERT INTO `wms_receipt_order` VALUES (47, 'R-2022-11-17-095500', 1, NULL, '1', NULL, 1, '1', 1, 115, '2022-11-17 10:19:27.000', 115, '2022-11-17 11:05:36.735'); -INSERT INTO `wms_receipt_order` VALUES (48, 'R-2022-11-17-161938', 1, 1, 'AAAAAAAAAAAA', NULL, 3, NULL, 1, 115, '2022-11-17 16:20:00.000', 115, '2022-11-17 16:21:05.955'); -INSERT INTO `wms_receipt_order` VALUES (49, 'R-2022-11-17-214945', 1, 1, '2344444444444', NULL, 0, '23444444', 1, 115, '2022-11-17 21:49:59.713', NULL, NULL); -INSERT INTO `wms_receipt_order` VALUES (50, 'R-2022-11-18-105642', 3, NULL, NULL, NULL, 3, NULL, 1, 115, '2022-11-18 10:55:30.000', 115, '2022-11-18 11:09:13.229'); -INSERT INTO `wms_receipt_order` VALUES (51, 'R-2022-11-18-160100', 1, 1, 'kkk', NULL, 0, 'kkk', 1, 115, '2022-11-18 16:01:28.842', NULL, NULL); -INSERT INTO `wms_receipt_order` VALUES (52, 'R-2022-11-19-003105', 3, 1, NULL, NULL, 0, NULL, 1, 115, '2022-11-19 00:31:41.000', 115, '2022-11-21 09:23:36.650'); -INSERT INTO `wms_receipt_order` VALUES (53, 'R-2022-11-19-181712', 1, NULL, '111', NULL, 3, '11', 1, 115, '2022-11-19 18:17:31.000', 115, '2022-11-20 15:01:21.765'); -INSERT INTO `wms_receipt_order` VALUES (54, 'R-2022-11-20-085034', 1, 1, 'AOE2022112001', NULL, 3, 'TEST', 1, 115, '2022-11-20 08:51:03.000', 115, '2022-11-20 08:54:13.817'); -INSERT INTO `wms_receipt_order` VALUES (55, 'R-2022-11-20-085105', 1, 2, 'AOE2022112002', NULL, 3, 'TEST', 1, 115, '2022-11-20 08:51:28.000', 115, '2022-11-21 09:22:23.261'); -INSERT INTO `wms_receipt_order` VALUES (56, 'R-2022-11-20-143243', 1, 1, 'test', NULL, 3, NULL, 1, 115, '2022-11-20 14:33:09.000', 115, '2022-11-20 14:33:49.506'); -INSERT INTO `wms_receipt_order` VALUES (57, 'R-2022-11-20-151009', 1, 2, 'r001', NULL, 3, NULL, 1, 115, '2022-11-20 15:10:38.000', 115, '2022-11-20 15:11:18.674'); -INSERT INTO `wms_receipt_order` VALUES (58, 'R-2022-11-20-161037', 1, 3, NULL, NULL, 0, NULL, 1, 115, '2022-11-20 16:17:02.089', NULL, NULL); -INSERT INTO `wms_receipt_order` VALUES (59, 'R-2022-11-21-100130', 1, 1, '11', NULL, 0, NULL, 1, 115, '2022-11-21 10:02:28.000', 115, '2022-11-21 11:12:53.287'); -INSERT INTO `wms_receipt_order` VALUES (60, 'R-2022-11-21-130247', 1, 1, '5555', NULL, 0, NULL, 1, 115, '2022-11-21 13:03:40.530', NULL, NULL); -INSERT INTO `wms_receipt_order` VALUES (61, 'R-2022-11-21-165653', 1, 2, NULL, NULL, 0, NULL, 1, 115, '2022-11-21 16:57:51.000', 115, '2022-11-22 08:26:58.481'); -INSERT INTO `wms_receipt_order` VALUES (62, 'R-2022-11-22-085427', 1, 1, NULL, NULL, NULL, NULL, 1, 115, '2022-11-22 08:55:01.000', 115, '2022-11-22 15:54:09.965'); -INSERT INTO `wms_receipt_order` VALUES (63, 'R-2022-11-22-095059', 3, 2, NULL, NULL, NULL, NULL, 1, 115, '2022-11-22 09:53:21.000', 115, '2022-11-23 08:27:33.480'); -INSERT INTO `wms_receipt_order` VALUES (64, 'R-2022-11-22-160335', 1, NULL, NULL, NULL, 2, NULL, 1, 115, '2022-11-22 16:04:10.000', 115, '2022-11-23 08:32:03.133'); -INSERT INTO `wms_receipt_order` VALUES (65, 'R-2022-11-22-185924', 1, 1, NULL, NULL, 1, NULL, 1, 115, '2022-11-22 18:59:50.000', 115, '2022-11-23 08:24:54.495'); -INSERT INTO `wms_receipt_order` VALUES (66, 'R-2022-11-22-193351', 1, 1, NULL, NULL, 2, NULL, 1, 115, '2022-11-22 19:34:27.000', 115, '2022-11-23 08:24:32.988'); -INSERT INTO `wms_receipt_order` VALUES (67, 'R-2022-11-22-210900', 1, 3, '1', NULL, 3, '1', 1, 115, '2022-11-22 21:09:29.000', 115, '2022-11-23 08:23:21.479'); -INSERT INTO `wms_receipt_order` VALUES (68, 'R-2022-11-23-082836', 2, 4, '6666', NULL, 2, NULL, 1, 115, '2022-11-23 08:28:54.000', 115, '2022-11-23 08:29:54.400'); -INSERT INTO `wms_receipt_order` VALUES (69, 'R-2022-11-23-083205', 1, 3, '212131221', NULL, 3, NULL, 1, 115, '2022-11-23 08:32:37.000', 115, '2022-11-23 08:35:25.058'); -INSERT INTO `wms_receipt_order` VALUES (70, 'R-2022-11-23-095554', 3, NULL, NULL, NULL, 3, NULL, 1, 115, '2022-11-23 09:56:13.000', 115, '2022-11-23 14:26:06.024'); -INSERT INTO `wms_receipt_order` VALUES (71, 'R-2022-11-23-105344', 2, 1, '111', NULL, 0, NULL, 1, 115, '2022-11-23 10:53:57.000', 115, '2022-11-25 20:30:19.746'); -INSERT INTO `wms_receipt_order` VALUES (72, 'R-2022-11-23-135005', 1, NULL, NULL, NULL, 3, NULL, 1, 115, '2022-11-23 13:50:31.000', 115, '2022-11-23 13:50:47.983'); -INSERT INTO `wms_receipt_order` VALUES (73, 'R-2022-11-23-135109', 1, NULL, NULL, NULL, 0, NULL, 1, 115, '2022-11-23 13:51:52.843', NULL, NULL); -INSERT INTO `wms_receipt_order` VALUES (74, 'R-2022-11-23-151739', 1, NULL, NULL, NULL, 0, NULL, 1, 115, '2022-11-23 15:18:01.534', NULL, NULL); -INSERT INTO `wms_receipt_order` VALUES (75, 'R-2022-11-23-152548', 1, 1, NULL, NULL, 3, NULL, 1, 115, '2022-11-23 15:27:33.000', 115, '2022-11-23 15:28:22.126'); -INSERT INTO `wms_receipt_order` VALUES (76, 'R-2022-11-24-110018', 1, NULL, NULL, NULL, 0, NULL, 1, 115, '2022-11-24 11:00:39.000', 115, '2022-11-24 11:00:48.965'); -INSERT INTO `wms_receipt_order` VALUES (77, 'R-2022-11-24-114225', 2, 1, 'fafasfasfa', NULL, 0, 'afasfa', 1, 115, '2022-11-24 11:42:54.000', 115, '2022-11-25 20:27:31.251'); -INSERT INTO `wms_receipt_order` VALUES (78, 'R-2022-11-25-103742', 1, 1, NULL, NULL, 3, NULL, 1, 115, '2022-11-25 10:38:14.000', 115, '2022-11-25 10:39:13.688'); -INSERT INTO `wms_receipt_order` VALUES (79, 'R-2022-11-25-161122', 3, 1, '1234', NULL, 2, NULL, 1, 115, '2022-11-25 16:12:59.000', 1, '2022-12-01 11:16:52.910'); -INSERT INTO `wms_receipt_order` VALUES (80, 'R-2022-11-25-213433', 1, 1, '1321353535', NULL, 0, '434', 1, 115, '2022-11-25 21:35:06.550', NULL, NULL); -INSERT INTO `wms_receipt_order` VALUES (81, 'R-2022-11-25-215548', 1, NULL, NULL, NULL, 0, NULL, 1, 115, '2022-11-25 21:57:22.649', NULL, NULL); -INSERT INTO `wms_receipt_order` VALUES (82, 'R-2022-11-25-223717', 1, 1, NULL, NULL, 0, NULL, 1, 115, '2022-11-25 22:41:33.796', NULL, NULL); -INSERT INTO `wms_receipt_order` VALUES (83, 'R-2022-11-27-183631', 1, 2, NULL, NULL, 0, NULL, 1, 115, '2022-11-27 18:36:52.347', NULL, NULL); -INSERT INTO `wms_receipt_order` VALUES (84, 'R-2022-11-27-205257', 2, 3, NULL, NULL, 0, NULL, 1, 115, '2022-11-27 20:53:45.118', NULL, NULL); -INSERT INTO `wms_receipt_order` VALUES (85, 'R-2022-11-27-212921', 1, NULL, NULL, NULL, 0, NULL, 1, 115, '2022-11-27 21:29:25.297', NULL, NULL); -INSERT INTO `wms_receipt_order` VALUES (86, 'R-2022-11-27-232649', 1, 3, '100022444', NULL, 3, '加急', 1, 115, '2022-11-27 23:29:47.000', 115, '2022-12-05 14:06:42.921'); -INSERT INTO `wms_receipt_order` VALUES (87, 'R-2022-11-28-091735', 1, NULL, NULL, NULL, 0, NULL, 1, 115, '2022-11-28 09:19:02.000', 115, '2022-11-28 12:58:29.773'); -INSERT INTO `wms_receipt_order` VALUES (88, 'R-2022-11-28-163455', 1, 1, '1121', NULL, 0, NULL, 1, 115, '2022-11-28 16:35:20.911', NULL, NULL); -INSERT INTO `wms_receipt_order` VALUES (89, 'R-2022-11-28-211705', 1, 1, '321312321', NULL, 3, NULL, 1, 115, '2022-11-28 21:18:54.000', 115, '2022-11-28 21:19:12.601'); -INSERT INTO `wms_receipt_order` VALUES (90, 'R-2022-11-29-115854', 1, NULL, NULL, NULL, 0, NULL, 1, 115, '2022-11-29 11:59:42.437', NULL, NULL); -INSERT INTO `wms_receipt_order` VALUES (91, 'R-2022-11-29-192052', 2, 2, NULL, NULL, 3, NULL, 1, 115, '2022-11-29 19:21:12.000', 115, '2022-11-29 19:22:38.349'); -INSERT INTO `wms_receipt_order` VALUES (92, 'R-2022-11-30-112042', 3, 3, NULL, NULL, 0, NULL, 1, 115, '2022-11-30 11:22:07.440', NULL, NULL); -INSERT INTO `wms_receipt_order` VALUES (93, 'R-2022-11-30-142507', 1, NULL, NULL, NULL, 3, NULL, 1, 115, '2022-11-30 14:25:31.000', 115, '2022-11-30 14:25:42.856'); -INSERT INTO `wms_receipt_order` VALUES (94, 'R-2022-11-30-143847', 1, 3, NULL, NULL, 3, NULL, 1, 115, '2022-11-30 14:39:14.000', 1, '2022-12-01 11:08:39.941'); -INSERT INTO `wms_receipt_order` VALUES (95, 'R-2022-12-01-095315', 1, 1, '23', NULL, 0, '123', 1, 115, '2022-12-01 09:53:55.268', NULL, NULL); -INSERT INTO `wms_receipt_order` VALUES (96, 'R-2022-12-01-095454', 1, 1, '123', NULL, 3, '1231', 1, 115, '2022-12-01 09:55:33.000', 1, '2022-12-01 10:53:10.851'); -INSERT INTO `wms_receipt_order` VALUES (97, 'R-2022-12-01-110349', 1, 1, '47328472934-23123', NULL, 3, '德的', 1, 1, '2022-12-01 11:04:18.000', 115, '2022-12-01 14:02:53.412'); -INSERT INTO `wms_receipt_order` VALUES (98, 'R-2022-12-02-143311', 1, 3, '111111111', NULL, 3, NULL, 1, 115, '2022-12-02 14:33:30.000', 115, '2022-12-05 14:06:20.949'); -INSERT INTO `wms_receipt_order` VALUES (99, 'R-2022-12-02-143356', 1, 4, NULL, NULL, 3, NULL, 1, 115, '2022-12-02 14:34:08.000', 115, '2022-12-02 14:34:58.512'); -INSERT INTO `wms_receipt_order` VALUES (100, 'R-2022-12-02-184125', 1, 4, '1234567', NULL, 0, NULL, 1, 115, '2022-12-02 18:41:58.750', NULL, NULL); -INSERT INTO `wms_receipt_order` VALUES (101, 'R-2022-12-03-082459', 1, 1, '111', NULL, 3, NULL, 1, 115, '2022-12-03 08:25:18.000', 115, '2022-12-03 08:28:10.442'); -INSERT INTO `wms_receipt_order` VALUES (102, 'R-2022-12-03-084615', 1, 1, '123', NULL, 3, NULL, 1, 115, '2022-12-03 08:46:36.000', 115, '2022-12-03 08:46:58.339'); -INSERT INTO `wms_receipt_order` VALUES (103, 'R-2022-12-03-142143', 1, 5, '1', NULL, 0, '123', 1, 115, '2022-12-03 14:22:42.689', NULL, NULL); -INSERT INTO `wms_receipt_order` VALUES (104, 'R-2022-12-05-112849', 1, NULL, NULL, NULL, 0, NULL, 1, 115, '2022-12-05 11:29:47.030', NULL, NULL); -INSERT INTO `wms_receipt_order` VALUES (105, 'R-2022-12-05-160213', 1, 6, NULL, NULL, 3, NULL, 1, 115, '2022-12-05 16:03:28.000', 115, '2022-12-06 00:01:25.575'); -INSERT INTO `wms_receipt_order` VALUES (106, 'R-2022-12-06-000217', 1, 6, NULL, NULL, 3, NULL, 1, 115, '2022-12-06 00:03:16.000', 115, '2022-12-08 10:31:09.697'); -INSERT INTO `wms_receipt_order` VALUES (107, 'R-2022-12-06-095539', 1, 6, NULL, NULL, 3, NULL, 1, 115, '2022-12-06 09:57:23.000', 115, '2022-12-06 13:52:32.581'); -INSERT INTO `wms_receipt_order` VALUES (108, 'R-2022-12-06-135307', 1, 6, NULL, NULL, 0, NULL, 1, 115, '2022-12-06 13:53:38.115', NULL, NULL); -INSERT INTO `wms_receipt_order` VALUES (109, 'R-2022-12-06-151007', 1, 6, NULL, NULL, 0, NULL, 1, 115, '2022-12-06 15:10:14.000', 115, '2022-12-07 12:32:06.047'); -INSERT INTO `wms_receipt_order` VALUES (110, 'R-2022-12-07-091540', 1, NULL, NULL, NULL, 3, NULL, 1, 115, '2022-12-07 09:16:12.000', 115, '2022-12-07 15:24:48.445'); -INSERT INTO `wms_receipt_order` VALUES (111, 'R-2022-12-07-152237', 1, NULL, NULL, NULL, 3, NULL, 1, 115, '2022-12-07 15:22:47.000', 115, '2022-12-08 15:13:32.683'); -INSERT INTO `wms_receipt_order` VALUES (112, 'R-2022-12-07-222610', 3, 6, NULL, NULL, 0, NULL, 1, 115, '2022-12-07 22:26:54.000', 115, '2022-12-07 22:27:14.461'); -INSERT INTO `wms_receipt_order` VALUES (113, 'R-2022-12-08-201519', 1, 6, NULL, NULL, 0, NULL, 1, 115, '2022-12-08 20:15:46.403', NULL, NULL); -INSERT INTO `wms_receipt_order` VALUES (114, 'R-2022-12-09-162525', 1, 6, '141', NULL, 0, '11', 1, 115, '2022-12-09 16:26:03.000', 115, '2022-12-09 16:26:36.063'); -INSERT INTO `wms_receipt_order` VALUES (115, 'R-2022-12-10-153102', 1, NULL, NULL, NULL, 3, NULL, 1, 115, '2022-12-10 15:30:12.000', 115, '2022-12-10 15:31:02.911'); -INSERT INTO `wms_receipt_order` VALUES (116, 'R-2022-12-10-170006', 1, 7, '111', NULL, 3, '22222', 1, 115, '2022-12-10 17:00:26.000', 115, '2022-12-10 17:01:54.566'); -INSERT INTO `wms_receipt_order` VALUES (117, 'R-2022-12-10-170553', 1, 7, '123123123', NULL, 0, '123123123123123', 1, 115, '2022-12-10 17:06:40.453', NULL, NULL); -INSERT INTO `wms_receipt_order` VALUES (118, 'R-2022-12-12-131028', 1, 7, NULL, NULL, 0, NULL, 1, 115, '2022-12-12 13:11:10.893', NULL, NULL); -INSERT INTO `wms_receipt_order` VALUES (119, 'R-2022-12-12-131511', 1, NULL, NULL, NULL, 3, NULL, 1, 115, '2022-12-12 13:15:23.000', 115, '2022-12-12 13:16:36.893'); -INSERT INTO `wms_receipt_order` VALUES (120, 'R-2022-12-12-162038', 1, 7, NULL, NULL, 0, '1', 1, 115, '2022-12-12 16:24:44.008', NULL, NULL); -INSERT INTO `wms_receipt_order` VALUES (121, 'R-2022-12-13-110343', 1, 7, NULL, NULL, 0, NULL, 1, 115, '2022-12-13 11:04:04.351', NULL, NULL); -INSERT INTO `wms_receipt_order` VALUES (122, 'R-2022-12-13-130618', 1, 7, NULL, NULL, 0, NULL, 1, 115, '2022-12-13 13:06:57.675', NULL, NULL); -INSERT INTO `wms_receipt_order` VALUES (123, 'R-2022-12-13-153253', 2, 7, NULL, NULL, 0, NULL, 1, 115, '2022-12-13 15:33:35.952', NULL, NULL); -INSERT INTO `wms_receipt_order` VALUES (124, 'R-2022-12-13-163358', 1, 8, '12', NULL, 0, '12', 1, 115, '2022-12-13 16:34:03.127', NULL, NULL); -INSERT INTO `wms_receipt_order` VALUES (125, 'R-2022-12-13-223220', 1, NULL, NULL, NULL, 0, NULL, 1, 115, '2022-12-13 22:33:37.891', NULL, NULL); -INSERT INTO `wms_receipt_order` VALUES (126, 'R-2022-12-14-011434', 1, 7, '想啊的说法', NULL, 1, '啊说的啊', 1, 115, '2022-12-14 01:15:22.000', 115, '2022-12-15 14:48:18.266'); -INSERT INTO `wms_receipt_order` VALUES (127, 'R-2022-12-15-105247', 1, 8, NULL, NULL, 0, NULL, 1, 115, '2022-12-15 10:54:49.677', NULL, NULL); -INSERT INTO `wms_receipt_order` VALUES (128, 'R-2022-12-15-153715', 1, NULL, NULL, NULL, 0, NULL, 1, 115, '2022-12-15 15:37:18.383', NULL, NULL); -INSERT INTO `wms_receipt_order` VALUES (129, 'R-2022-12-17-173642', 1, NULL, NULL, NULL, 0, NULL, 1, 115, '2022-12-17 17:36:48.522', NULL, NULL); -INSERT INTO `wms_receipt_order` VALUES (130, 'R-2022-12-18-173632', 1, 7, 'CP-00001', NULL, 3, '成品', 1, 115, '2022-12-18 17:37:42.000', 115, '2022-12-20 17:27:22.313'); -INSERT INTO `wms_receipt_order` VALUES (131, 'R-2022-12-19-134621', 1, 7, '1111122222222', NULL, 0, 'test', 1, 115, '2022-12-19 13:47:16.000', 115, '2022-12-20 10:37:58.279'); -INSERT INTO `wms_receipt_order` VALUES (132, 'R-2022-12-19-173728', 1, 7, '12345', NULL, 0, '123123', 1, 115, '2022-12-19 17:37:35.785', NULL, NULL); -INSERT INTO `wms_receipt_order` VALUES (133, 'R-2022-12-20-173920', 1, NULL, NULL, NULL, 2, NULL, 1, 115, '2022-12-20 17:39:26.000', 115, '2022-12-20 17:40:38.952'); -INSERT INTO `wms_receipt_order` VALUES (134, 'R-2022-12-20-174152', 1, NULL, NULL, NULL, 0, NULL, 1, 115, '2022-12-20 17:41:48.685', NULL, NULL); -INSERT INTO `wms_receipt_order` VALUES (135, 'R-2022-12-20-174202', 1, NULL, NULL, NULL, 3, NULL, 1, 115, '2022-12-20 17:42:15.000', 115, '2022-12-20 17:42:42.506'); -INSERT INTO `wms_receipt_order` VALUES (136, 'R-2022-12-20-174514', 1, NULL, NULL, NULL, 3, NULL, 1, 115, '2022-12-20 17:45:24.000', 115, '2022-12-20 17:45:45.242'); -INSERT INTO `wms_receipt_order` VALUES (137, 'R-2022-12-20-175601', 1, NULL, NULL, NULL, 3, NULL, 1, 115, '2022-12-20 17:56:04.000', 115, '2022-12-20 17:58:54.541'); -INSERT INTO `wms_receipt_order` VALUES (138, 'R-2022-12-20-175924', 1, NULL, NULL, NULL, 3, NULL, 1, 115, '2022-12-20 17:59:26.000', 115, '2022-12-20 18:00:33.724'); -INSERT INTO `wms_receipt_order` VALUES (139, 'R-2022-12-21-161118', 1, 7, NULL, NULL, 3, NULL, 1, 115, '2022-12-21 16:11:01.000', 115, '2022-12-21 16:11:48.941'); -INSERT INTO `wms_receipt_order` VALUES (140, 'R-2022-12-21-163853', 1, 7, 'sd ', NULL, 0, 'sdf ', 1, 115, '2022-12-21 16:39:09.000', 115, '2022-12-21 16:39:16.583'); -INSERT INTO `wms_receipt_order` VALUES (141, 'R-2022-12-22-091343', 1, 8, NULL, NULL, 0, NULL, 1, 115, '2022-12-22 09:14:27.906', NULL, NULL); -INSERT INTO `wms_receipt_order` VALUES (142, 'R-2022-12-22-093747', 1, 7, NULL, NULL, 0, NULL, 1, 115, '2022-12-22 09:38:58.368', NULL, NULL); -INSERT INTO `wms_receipt_order` VALUES (143, 'R-2022-12-22-123510', 1, NULL, NULL, NULL, 3, NULL, 1, 115, '2022-12-22 12:35:41.000', 115, '2022-12-22 12:35:50.471'); -INSERT INTO `wms_receipt_order` VALUES (144, 'R-2022-12-24-104201', 1, NULL, NULL, NULL, 2, NULL, 1, 115, '2022-12-24 10:43:08.000', 115, '2022-12-28 16:41:46.928'); -INSERT INTO `wms_receipt_order` VALUES (145, 'R-2022-12-27-153240', 1, 7, NULL, NULL, 3, NULL, 1, 115, '2022-12-27 15:33:13.000', 115, '2022-12-27 15:33:46.679'); -INSERT INTO `wms_receipt_order` VALUES (146, 'R-2022-12-27-181817', 1, 7, NULL, NULL, 1, NULL, 1, 115, '2022-12-27 18:18:40.000', 115, '2022-12-28 17:09:35.986'); -INSERT INTO `wms_receipt_order` VALUES (147, 'R-2022-12-28-113634', 1, 7, '0001', NULL, 3, NULL, 1, 115, '2022-12-28 11:37:20.000', 115, '2022-12-28 11:39:15.161'); -INSERT INTO `wms_receipt_order` VALUES (148, 'R-2022-12-28-170614', 1, 7, NULL, NULL, 3, NULL, 1, 115, '2022-12-28 17:07:18.000', 115, '2022-12-28 17:11:26.602'); -INSERT INTO `wms_receipt_order` VALUES (149, 'R-2022-12-28-192529', 1, 7, NULL, NULL, 3, NULL, 1, 115, '2022-12-28 19:25:47.000', 115, '2022-12-28 19:27:56.330'); -INSERT INTO `wms_receipt_order` VALUES (150, 'R-2022-12-30-084812', 1, 7, NULL, NULL, 3, NULL, 1, 115, '2022-12-30 08:50:14.000', 115, '2022-12-30 13:47:44.794'); -INSERT INTO `wms_receipt_order` VALUES (151, 'R-2023-01-01-183427', 1, 7, '111', NULL, 0, NULL, 1, 115, '2023-01-01 18:34:37.783', NULL, NULL); -INSERT INTO `wms_receipt_order` VALUES (152, 'R-2023-01-03-120801', 1, 7, '1', NULL, 3, NULL, 1, 115, '2023-01-03 12:08:59.000', 115, '2023-01-03 12:09:21.734'); -INSERT INTO `wms_receipt_order` VALUES (153, 'R-2023-01-03-142236', 1, NULL, NULL, NULL, 0, NULL, 1, 115, '2023-01-03 14:33:56.000', 115, '2023-01-03 16:00:46.317'); -INSERT INTO `wms_receipt_order` VALUES (154, 'R-2023-01-03-143406', 1, NULL, NULL, NULL, 0, NULL, 1, 115, '2023-01-03 14:47:47.436', NULL, NULL); -INSERT INTO `wms_receipt_order` VALUES (155, 'R-2023-01-04-102301', 1, 8, NULL, NULL, 0, NULL, 1, 115, '2023-01-04 10:23:39.853', NULL, NULL); -INSERT INTO `wms_receipt_order` VALUES (156, 'R-2023-01-04-193802', 1, 8, '202220', NULL, 3, NULL, 1, 115, '2023-01-04 19:43:00.000', 115, '2023-01-05 14:51:25.977'); -INSERT INTO `wms_receipt_order` VALUES (157, 'R-2023-01-05-094605', 1, NULL, NULL, NULL, 3, NULL, 1, 115, '2023-01-05 10:05:07.000', 115, '2023-01-05 10:09:08.279'); -INSERT INTO `wms_receipt_order` VALUES (158, 'R-2023-01-05-144925', 1, NULL, NULL, NULL, 0, NULL, 1, 115, '2023-01-05 14:49:44.000', 115, '2023-01-05 18:44:11.940'); -INSERT INTO `wms_receipt_order` VALUES (159, 'R-2023-01-05-145200', 1, 10, NULL, NULL, 0, NULL, 1, 115, '2023-01-05 14:54:41.000', 115, '2023-01-05 16:43:42.802'); -INSERT INTO `wms_receipt_order` VALUES (160, 'R-2023-01-05-182955', 1, 8, '222', NULL, 3, '222', 1, 115, '2023-01-05 18:30:05.000', 115, '2023-01-06 08:02:27.033'); -INSERT INTO `wms_receipt_order` VALUES (161, 'R-2023-01-06-141746', 1, 8, '12312', NULL, 3, '4234', 1, 115, '2023-01-06 14:18:24.000', 115, '2023-01-06 14:18:47.113'); -INSERT INTO `wms_receipt_order` VALUES (162, 'R-2023-01-06-165731', 1, 11, '01', NULL, 3, NULL, 1, 115, '2023-01-06 16:58:10.000', 115, '2023-01-06 16:58:27.119'); -INSERT INTO `wms_receipt_order` VALUES (163, 'R-2023-01-07-101921', 3, 11, NULL, NULL, 0, NULL, 1, 115, '2023-01-07 10:19:58.393', NULL, NULL); -INSERT INTO `wms_receipt_order` VALUES (164, 'R-2023-01-07-140132', 1, 13, '1111', NULL, 3, '11111', 1, 115, '2023-01-07 14:13:36.000', 115, '2023-01-07 14:14:48.221'); -INSERT INTO `wms_receipt_order` VALUES (165, 'R-2023-01-07-180904', 2, 11, NULL, NULL, 0, NULL, 1, 115, '2023-01-07 18:09:26.841', NULL, NULL); -INSERT INTO `wms_receipt_order` VALUES (166, 'R-2023-01-08-001506', 1, 11, NULL, NULL, 2, NULL, 1, 115, '2023-01-08 00:18:00.000', 115, '2023-01-08 00:19:53.261'); -INSERT INTO `wms_receipt_order` VALUES (167, 'R-2023-01-08-091707', 1, 11, '1111111', NULL, 1, '测试', 1, 115, '2023-01-08 09:18:16.000', 115, '2023-01-08 09:18:45.452'); -INSERT INTO `wms_receipt_order` VALUES (168, 'R-2023-01-08-095133', 3, 11, NULL, NULL, 0, NULL, 1, 115, '2023-01-08 09:52:29.732', NULL, NULL); -INSERT INTO `wms_receipt_order` VALUES (169, 'R-2023-01-09-001525', 1, 13, '1', NULL, 3, NULL, 1, 115, '2023-01-09 00:16:16.000', 115, '2023-01-09 00:17:19.218'); -INSERT INTO `wms_receipt_order` VALUES (170, 'R-2023-01-09-001734', 2, 11, NULL, NULL, 3, NULL, 1, 115, '2023-01-09 00:18:10.000', 115, '2023-01-09 00:18:51.747'); -INSERT INTO `wms_receipt_order` VALUES (171, 'R-2023-01-09-013310', 2, 11, NULL, NULL, 3, NULL, 1, 115, '2023-01-09 01:33:12.000', 115, '2023-01-09 01:35:41.360'); -INSERT INTO `wms_receipt_order` VALUES (172, 'R-2023-01-09-015730', 1, 13, NULL, NULL, 3, NULL, 1, 115, '2023-01-09 02:09:05.000', 115, '2023-01-09 02:17:11.337'); -INSERT INTO `wms_receipt_order` VALUES (173, 'R-2023-01-05-184724', 1, 11, '4123142343', NULL, 3, NULL, 1, 115, '2023-01-11 16:48:29.000', 115, '2023-01-11 16:49:13.038'); -INSERT INTO `wms_receipt_order` VALUES (174, 'R-2023-01-11-204743', 1, 13, '1', NULL, 3, NULL, 1, 115, '2023-01-11 20:48:17.000', 115, '2023-01-11 20:49:04.515'); -INSERT INTO `wms_receipt_order` VALUES (175, 'R-2023-01-12-093419', 1, 11, NULL, NULL, 0, NULL, 1, 115, '2023-01-12 09:37:31.998', NULL, NULL); -INSERT INTO `wms_receipt_order` VALUES (176, 'R-2023-01-12-101630', 1, NULL, NULL, NULL, 0, NULL, 1, 115, '2023-01-12 10:18:09.013', NULL, NULL); -INSERT INTO `wms_receipt_order` VALUES (177, 'R-2023-01-12-161713', 1, 11, '11112', NULL, 1, '222', 1, 115, '2023-01-12 16:17:26.000', 115, '2023-01-12 16:18:27.369'); -INSERT INTO `wms_receipt_order` VALUES (178, 'R-2023-01-12-163907', 1, 11, '99999', NULL, 0, '9999', 1, 115, '2023-01-12 16:39:41.808', NULL, NULL); -INSERT INTO `wms_receipt_order` VALUES (179, 'R-2023-01-13-125142', 1, 11, '001', NULL, 3, NULL, 1, 115, '2023-01-13 12:52:14.000', 115, '2023-01-15 10:08:00.587'); -INSERT INTO `wms_receipt_order` VALUES (180, 'R-2023-01-13-145817', 3, 11, '2023011301', NULL, 3, 'LD测试', 1, 115, '2023-01-13 14:58:46.000', 115, '2023-01-13 14:59:32.717'); -INSERT INTO `wms_receipt_order` VALUES (181, 'R-2023-01-13-192556', 1, 11, '54325432', NULL, 3, NULL, 1, 115, '2023-01-13 19:26:19.000', 115, '2023-01-13 19:26:39.286'); -INSERT INTO `wms_receipt_order` VALUES (182, 'R-2023-01-16-111325', 1, 11, '1111', NULL, 3, NULL, 1, 115, '2023-01-16 11:13:48.000', 115, '2023-01-16 11:15:08.508'); -INSERT INTO `wms_receipt_order` VALUES (183, 'R-2023-01-16-111631', 1, 11, '1112222', NULL, 3, NULL, 1, 115, '2023-01-16 11:16:46.000', 115, '2023-01-16 11:17:07.440'); -INSERT INTO `wms_receipt_order` VALUES (184, 'R-2023-01-16-112225', 3, 11, '222', NULL, 0, NULL, 1, 115, '2023-01-16 11:22:41.558', NULL, NULL); -INSERT INTO `wms_receipt_order` VALUES (185, 'R-2023-01-16-154102', 1, NULL, NULL, NULL, 0, NULL, 1, 115, '2023-01-16 15:41:29.948', NULL, NULL); -INSERT INTO `wms_receipt_order` VALUES (186, 'R-2023-01-17-103035', 1, 11, NULL, NULL, 3, NULL, 1, 115, '2023-01-17 10:30:49.000', 115, '2023-01-17 10:31:15.896'); -INSERT INTO `wms_receipt_order` VALUES (187, 'R-2023-01-17-173949', 1, 13, '2222676767676767', NULL, 0, '2222', 1, 115, '2023-01-17 17:40:03.000', 115, '2023-01-17 20:22:47.298'); -INSERT INTO `wms_receipt_order` VALUES (188, 'R-2023-01-18-135305', 1, NULL, NULL, NULL, 0, NULL, 1, 115, '2023-01-18 13:53:22.948', NULL, NULL); -INSERT INTO `wms_receipt_order` VALUES (189, 'R-2023-01-18-151227', 1, NULL, NULL, NULL, 3, NULL, 1, 115, '2023-01-18 15:12:54.000', 115, '2023-01-18 15:19:43.617'); -INSERT INTO `wms_receipt_order` VALUES (190, 'R-2023-01-18-202856', 1, NULL, NULL, NULL, 0, NULL, 1, 115, '2023-01-18 20:28:59.902', NULL, NULL); -INSERT INTO `wms_receipt_order` VALUES (191, 'R-2023-01-21-121859', 3, 13, NULL, NULL, 3, NULL, 1, 115, '2023-01-21 12:19:25.000', 115, '2023-01-21 12:20:07.358'); -INSERT INTO `wms_receipt_order` VALUES (192, 'R-2023-01-23-163252', 1, 11, '111111', NULL, 3, NULL, 1, 115, '2023-01-23 16:33:27.000', 115, '2023-01-23 16:33:55.430'); -INSERT INTO `wms_receipt_order` VALUES (193, 'R-2023-01-23-200927', 1, 11, '234', NULL, 2, NULL, 1, 115, '2023-01-23 20:09:46.000', 115, '2023-01-24 17:01:09.692'); -INSERT INTO `wms_receipt_order` VALUES (194, 'R-2023-01-25-151054', 1, 11, NULL, NULL, 2, NULL, 1, 115, '2023-01-25 15:11:41.000', 115, '2023-01-25 15:12:03.902'); -INSERT INTO `wms_receipt_order` VALUES (195, 'R-2023-01-25-171956', 1, 11, NULL, NULL, 0, NULL, 1, 115, '2023-01-25 17:19:59.000', 115, '2023-01-25 17:20:31.562'); -INSERT INTO `wms_receipt_order` VALUES (196, 'R-2023-01-25-172049', 1, 11, NULL, NULL, 3, NULL, 1, 115, '2023-01-25 17:21:27.000', 115, '2023-01-25 17:24:35.658'); -INSERT INTO `wms_receipt_order` VALUES (197, 'R-2023-01-26-135630', 1, 13, NULL, NULL, 0, NULL, 1, 115, '2023-01-26 13:57:45.564', NULL, NULL); -INSERT INTO `wms_receipt_order` VALUES (198, 'R-2023-01-27-164443', 1, 11, '4645', NULL, 0, NULL, 1, 115, '2023-01-27 16:45:00.782', NULL, NULL); -INSERT INTO `wms_receipt_order` VALUES (199, 'R-2023-01-28-123935', 1, 11, NULL, NULL, 3, NULL, 1, 115, '2023-01-28 12:39:55.000', 115, '2023-01-28 12:40:38.313'); -INSERT INTO `wms_receipt_order` VALUES (200, 'R-2023-01-28-162751', 1, NULL, NULL, NULL, 1, NULL, 1, 115, '2023-01-28 16:28:10.000', 115, '2023-01-29 16:21:53.642'); -INSERT INTO `wms_receipt_order` VALUES (201, 'R-2023-01-29-103136', 1, 11, '3467189194948', NULL, 1, NULL, 1, 115, '2023-01-29 10:32:55.000', 115, '2023-01-30 09:50:41.209'); -INSERT INTO `wms_receipt_order` VALUES (202, 'R-2023-01-29-154910', 3, NULL, 'aaa', NULL, 0, 'aaa', 1, 115, '2023-01-29 15:49:46.000', 115, '2023-01-29 15:51:35.735'); -INSERT INTO `wms_receipt_order` VALUES (203, 'R-2023-01-29-202256', 3, NULL, NULL, NULL, 0, NULL, 1, 115, '2023-01-29 20:24:46.000', 115, '2023-01-30 11:33:31.235'); -INSERT INTO `wms_receipt_order` VALUES (204, 'R-2023-01-30-135728', 1, NULL, NULL, NULL, 0, NULL, 1, 115, '2023-01-30 13:58:32.506', NULL, NULL); -INSERT INTO `wms_receipt_order` VALUES (205, 'R-2023-01-30-205256', 3, 11, NULL, NULL, 0, NULL, 1, 115, '2023-01-30 20:53:25.915', NULL, NULL); -INSERT INTO `wms_receipt_order` VALUES (206, 'R-2023-01-31-100621', 1, 11, NULL, NULL, 0, NULL, 1, 115, '2023-01-31 10:07:28.911', NULL, NULL); -INSERT INTO `wms_receipt_order` VALUES (207, 'R-2023-01-31-115302', 1, 11, NULL, NULL, 3, NULL, 1, 115, '2023-01-31 11:53:34.000', 115, '2023-01-31 11:54:08.145'); -INSERT INTO `wms_receipt_order` VALUES (208, 'R-2023-01-31-140814', 1, 11, 'ssag', NULL, 3, 'sadgsdg', 1, 115, '2023-01-31 14:08:48.000', 115, '2023-01-31 14:09:17.822'); -INSERT INTO `wms_receipt_order` VALUES (209, 'R-2023-01-31-154755', 1, NULL, NULL, NULL, 0, NULL, 1, 115, '2023-01-31 15:48:29.027', NULL, NULL); -INSERT INTO `wms_receipt_order` VALUES (210, 'R-2023-01-31-162116', 1, NULL, NULL, NULL, 3, NULL, 1, 115, '2023-01-31 16:21:35.000', 115, '2023-01-31 16:23:22.441'); -INSERT INTO `wms_receipt_order` VALUES (211, 'R-2023-01-31-163546', 1, NULL, '001', NULL, 3, NULL, 1, 115, '2023-01-31 16:35:56.000', 115, '2023-01-31 16:37:03.789'); -INSERT INTO `wms_receipt_order` VALUES (212, 'R-2023-01-31-163741', 1, NULL, NULL, NULL, 3, NULL, 1, 115, '2023-01-31 16:38:14.000', 115, '2023-01-31 16:38:29.481'); -INSERT INTO `wms_receipt_order` VALUES (213, 'R-2023-01-31-204004', 1, NULL, '1111', NULL, 0, '1111', 1, 115, '2023-01-31 20:40:45.392', NULL, NULL); -INSERT INTO `wms_receipt_order` VALUES (214, 'R-2023-02-01-092904', 1, NULL, NULL, NULL, 0, NULL, 1, 115, '2023-02-01 09:29:26.356', NULL, NULL); -INSERT INTO `wms_receipt_order` VALUES (215, 'R-2023-02-01-134319', 1, 16, NULL, NULL, 0, NULL, 1, 115, '2023-02-01 13:43:38.900', NULL, NULL); -INSERT INTO `wms_receipt_order` VALUES (216, 'R-2023-02-01-190750', 1, 16, NULL, NULL, 0, NULL, 1, 115, '2023-02-01 19:08:08.133', NULL, NULL); -INSERT INTO `wms_receipt_order` VALUES (217, 'R-2023-02-01-220619', 1, 16, '29668974', NULL, 3, '', 1, 115, '2023-02-01 22:07:15.000', 115, '2023-02-01 22:08:22.057'); -INSERT INTO `wms_receipt_order` VALUES (218, 'R-2023-02-02-150545', 1, 16, '1', NULL, 3, '1', 1, 115, '2023-02-02 15:06:31.000', 115, '2023-02-02 15:07:16.301'); -INSERT INTO `wms_receipt_order` VALUES (219, 'R-2023-02-02-151022', 1, 16, '21', NULL, 0, '1', 1, 115, '2023-02-02 15:10:36.000', 115, '2023-02-03 16:35:30.749'); -INSERT INTO `wms_receipt_order` VALUES (220, 'R-2023-02-02-151126', 1, 16, 'aaa', NULL, 3, NULL, 1, 115, '2023-02-02 15:11:41.000', 115, '2023-02-02 15:11:59.410'); -INSERT INTO `wms_receipt_order` VALUES (221, 'R-2023-02-02-151136', 1, 16, NULL, NULL, 1, NULL, 1, 115, '2023-02-02 15:12:29.000', 115, '2023-02-02 15:13:05.519'); -INSERT INTO `wms_receipt_order` VALUES (222, 'R-2023-02-02-151955', 1, 16, '1111', NULL, 3, NULL, 1, 115, '2023-02-02 15:20:19.000', 115, '2023-02-02 22:09:47.502'); -INSERT INTO `wms_receipt_order` VALUES (223, 'R-2023-02-02-215530', 1, 16, '23365222', NULL, 2, '00', 1, 115, '2023-02-02 21:59:03.000', 115, '2023-02-02 22:07:16.237'); -INSERT INTO `wms_receipt_order` VALUES (224, 'R-2023-02-02-221218', 1, 16, 'jjnkjnkjnk', NULL, 0, NULL, 1, 115, '2023-02-02 22:12:35.393', NULL, NULL); -INSERT INTO `wms_receipt_order` VALUES (225, 'R-2023-02-03-141134', 1, NULL, NULL, NULL, 0, NULL, 1, 115, '2023-02-03 14:11:58.000', 115, '2023-02-03 15:45:42.783'); -INSERT INTO `wms_receipt_order` VALUES (226, 'R-2023-02-03-152638', 1, 16, '10086', NULL, 3, '测试数据10086', 1, 115, '2023-02-03 15:27:16.000', 115, '2023-02-03 15:29:26.748'); -INSERT INTO `wms_receipt_order` VALUES (227, 'R-2023-02-03-163430', 1, NULL, NULL, NULL, 0, NULL, 1, 115, '2023-02-03 16:35:20.902', NULL, NULL); -INSERT INTO `wms_receipt_order` VALUES (228, 'R-2023-02-04-002956', 1, 16, NULL, NULL, 3, NULL, 1, 115, '2023-02-04 00:30:21.000', 115, '2023-02-04 00:31:27.970'); -INSERT INTO `wms_receipt_order` VALUES (229, 'R-2023-02-04-025804', 1, 16, '123132', NULL, 3, '1231321', 1, 115, '2023-02-04 02:58:24.000', 115, '2023-02-04 03:00:15.425'); -INSERT INTO `wms_receipt_order` VALUES (230, 'R-2023-02-04-085335', 2, 16, 'rgertertret', NULL, 3, NULL, 1, 115, '2023-02-04 08:53:50.000', 115, '2023-02-04 08:54:14.693'); -INSERT INTO `wms_receipt_order` VALUES (231, 'R-2023-02-04-090418', 1, 16, NULL, NULL, 2, NULL, 1, 115, '2023-02-04 09:05:37.000', 115, '2023-02-04 16:09:45.187'); -INSERT INTO `wms_receipt_order` VALUES (232, 'R-2023-02-04-154742', 1, NULL, NULL, NULL, 3, NULL, 1, 115, '2023-02-04 15:47:53.000', 115, '2023-02-06 14:13:47.149'); -INSERT INTO `wms_receipt_order` VALUES (233, 'R-2023-02-04-161056', 1, 16, '123465', NULL, 3, NULL, 1, 115, '2023-02-04 16:11:14.000', 115, '2023-02-04 16:12:09.807'); -INSERT INTO `wms_receipt_order` VALUES (234, 'R-2023-02-04-163604', 1, 16, '7777', NULL, 3, NULL, 1, 115, '2023-02-04 16:36:20.000', 115, '2023-02-04 16:36:29.689'); -INSERT INTO `wms_receipt_order` VALUES (235, 'R-2023-02-04-182112', 1, NULL, NULL, NULL, 0, NULL, 1, 115, '2023-02-04 18:21:27.000', 115, '2023-02-04 20:53:43.573'); -INSERT INTO `wms_receipt_order` VALUES (236, 'R-2023-02-04-200947', 1, NULL, NULL, NULL, 3, NULL, 1, 115, '2023-02-04 20:27:32.000', 115, '2023-02-04 20:29:37.637'); -INSERT INTO `wms_receipt_order` VALUES (237, 'R-2023-02-04-204928', 1, NULL, NULL, NULL, 3, NULL, 1, 115, '2023-02-04 20:49:43.000', 115, '2023-02-04 20:50:32.342'); -INSERT INTO `wms_receipt_order` VALUES (238, 'R-2023-02-06-114700', 1, 16, '2023092', NULL, 3, NULL, 1, 115, '2023-02-06 11:49:52.000', 115, '2023-02-06 11:51:05.744'); -INSERT INTO `wms_receipt_order` VALUES (239, 'R-2023-02-06-135246', 1, 16, NULL, NULL, 3, NULL, 1, 115, '2023-02-06 13:53:44.000', 115, '2023-02-06 13:54:18.254'); -INSERT INTO `wms_receipt_order` VALUES (240, 'R-2023-02-06-141205', 1, 18, '121212', NULL, 2, '0206测试', 1, 115, '2023-02-06 14:13:03.000', 115, '2023-02-06 15:13:45.013'); -INSERT INTO `wms_receipt_order` VALUES (241, 'R-2023-02-06-152033', 1, 19, NULL, NULL, 3, NULL, 1, 115, '2023-02-06 15:21:02.000', 115, '2023-02-06 15:21:15.389'); -INSERT INTO `wms_receipt_order` VALUES (242, 'R-2023-02-06-160328', 1, NULL, NULL, NULL, 0, NULL, 1, 115, '2023-02-06 16:03:43.263', NULL, NULL); -INSERT INTO `wms_receipt_order` VALUES (243, 'R-2023-02-06-171115', 1, 18, '12342134', NULL, 3, NULL, 1, 115, '2023-02-06 17:14:53.000', 115, '2023-02-07 09:21:35.221'); -INSERT INTO `wms_receipt_order` VALUES (244, 'R-2023-02-06-185143', 1, 18, NULL, NULL, 0, NULL, 1, 115, '2023-02-06 18:53:19.000', 115, '2023-02-07 09:20:49.308'); -INSERT INTO `wms_receipt_order` VALUES (245, 'R-2023-02-06-191711', 1, 18, NULL, NULL, 0, NULL, 1, 115, '2023-02-06 19:17:14.000', 115, '2023-02-07 14:30:07.508'); -INSERT INTO `wms_receipt_order` VALUES (246, 'R-2023-02-07-160404', 2, NULL, NULL, NULL, 0, NULL, 1, 115, '2023-02-07 16:04:39.375', NULL, NULL); -INSERT INTO `wms_receipt_order` VALUES (247, 'R-2023-02-07-184609', 3, NULL, NULL, NULL, 0, NULL, 1, 115, '2023-02-07 18:46:59.295', NULL, NULL); -INSERT INTO `wms_receipt_order` VALUES (248, 'R-2023-02-07-213740', 2, 18, '123456', NULL, 0, NULL, 1, 115, '2023-02-07 21:37:55.789', NULL, NULL); -INSERT INTO `wms_receipt_order` VALUES (249, 'R-2023-02-08-091328', 1, 20, '461231635465464', NULL, 3, '配件定期采购', 1, 115, '2023-02-08 09:14:21.000', 115, '2023-02-08 09:16:11.439'); -INSERT INTO `wms_receipt_order` VALUES (250, 'R-2023-02-08-093459', 1, 18, NULL, NULL, 3, NULL, 1, 115, '2023-02-08 09:35:25.000', 115, '2023-02-08 09:35:44.302'); -INSERT INTO `wms_receipt_order` VALUES (251, 'R-2023-02-08-093610', 1, 18, NULL, NULL, 3, NULL, 1, 115, '2023-02-08 09:36:38.000', 115, '2023-02-08 09:36:43.850'); -INSERT INTO `wms_receipt_order` VALUES (252, 'R-2023-02-08-103928', 1, NULL, NULL, NULL, 3, NULL, 1, 115, '2023-02-08 10:40:02.000', 115, '2023-02-08 10:40:33.316'); -INSERT INTO `wms_receipt_order` VALUES (253, 'R-2023-02-08-142734', 1, 20, NULL, NULL, 3, NULL, 1, 115, '2023-02-08 11:29:00.000', 115, '2023-02-08 11:38:59.181'); -INSERT INTO `wms_receipt_order` VALUES (254, 'R-2023-02-08-163630', 1, 18, '87654', NULL, 3, NULL, 1, 115, '2023-02-08 16:37:35.000', 115, '2023-02-08 16:40:11.395'); -INSERT INTO `wms_receipt_order` VALUES (255, 'R-2023-02-09-095333', 1, 18, '11111111111111', NULL, 0, NULL, 1, 115, '2023-02-09 09:53:42.803', NULL, NULL); -INSERT INTO `wms_receipt_order` VALUES (256, 'R-2023-02-09-100609', 3, NULL, NULL, NULL, 0, NULL, 1, 115, '2023-02-09 10:06:41.000', 115, '2023-02-09 16:15:27.572'); -INSERT INTO `wms_receipt_order` VALUES (257, 'R-2023-02-09-142652', 1, 19, NULL, NULL, 3, NULL, 1, 115, '2023-02-09 14:27:17.000', 115, '2023-02-09 14:27:51.839'); -INSERT INTO `wms_receipt_order` VALUES (258, 'R-2023-02-10-090155', 1, 19, '21', NULL, 2, '21', 1, 115, '2023-02-10 09:02:17.000', 115, '2023-02-12 11:11:03.018'); -INSERT INTO `wms_receipt_order` VALUES (259, 'R-2023-02-10-102435', 2, 18, NULL, NULL, 1, NULL, 1, 115, '2023-02-10 10:25:01.000', 115, '2023-02-10 10:25:22.410'); -INSERT INTO `wms_receipt_order` VALUES (260, 'R-2023-02-10-151714', 2, 18, NULL, NULL, 3, NULL, 1, 115, '2023-02-10 15:17:53.000', 115, '2023-02-11 11:10:58.929'); -INSERT INTO `wms_receipt_order` VALUES (261, 'R-2023-02-10-154642', 3, 29, '原本项目名称', NULL, 3, NULL, 1, 115, '2023-02-10 15:48:01.000', 115, '2023-02-10 15:50:01.992'); -INSERT INTO `wms_receipt_order` VALUES (262, 'R-2023-02-10-155613', 3, 29, '2023年2月9日', NULL, 3, '原本项目为****', 1, 115, '2023-02-10 15:56:43.000', 115, '2023-02-10 15:56:53.589'); -INSERT INTO `wms_receipt_order` VALUES (263, 'R-2023-02-11-184426', 1, 29, 'SK20230228201', NULL, 3, NULL, 1, 115, '2023-02-11 18:58:02.000', 115, '2023-02-11 19:02:04.543'); -INSERT INTO `wms_receipt_order` VALUES (264, 'R-2023-02-11-190306', 1, 19, 'DK20230223443', NULL, 3, NULL, 1, 115, '2023-02-11 19:03:52.000', 115, '2023-02-12 11:12:23.861'); -INSERT INTO `wms_receipt_order` VALUES (265, 'R-2023-02-11-201648', 1, 19, 'SK12340U820489', NULL, 3, NULL, 1, 115, '2023-02-11 20:17:18.000', 115, '2023-02-11 20:17:33.142'); -INSERT INTO `wms_receipt_order` VALUES (266, 'R-2023-02-12-103134', 1, NULL, NULL, NULL, 0, NULL, 1, 115, '2023-02-12 10:31:48.000', 115, '2023-02-12 16:57:03.000'); -INSERT INTO `wms_receipt_order` VALUES (267, 'R-2023-02-12-163609', 2, 18, NULL, NULL, 0, NULL, 1, 115, '2023-02-12 16:36:55.000', 115, '2023-02-12 16:55:55.242'); -INSERT INTO `wms_receipt_order` VALUES (268, 'R-2023-02-13-100202', 1, NULL, NULL, NULL, 0, NULL, 1, 115, '2023-02-13 10:02:36.821', NULL, NULL); -INSERT INTO `wms_receipt_order` VALUES (269, 'R-2023-02-13-104454', 1, NULL, NULL, NULL, 0, NULL, 1, 115, '2023-02-13 10:45:00.601', NULL, NULL); -INSERT INTO `wms_receipt_order` VALUES (270, 'R-2023-02-13-104536', 1, 18, NULL, NULL, 0, NULL, 1, 115, '2023-02-13 10:46:44.506', NULL, NULL); -INSERT INTO `wms_receipt_order` VALUES (271, 'R-2023-02-13-110004', 1, 18, '21', NULL, 3, '321', 1, 115, '2023-02-13 11:23:58.000', 115, '2023-02-13 11:36:24.760'); -INSERT INTO `wms_receipt_order` VALUES (272, 'R-2023-02-13-113226', 1, NULL, NULL, NULL, 0, NULL, 1, 115, '2023-02-13 11:32:30.000', 115, '2023-02-13 11:32:55.350'); -INSERT INTO `wms_receipt_order` VALUES (273, 'R-2023-02-13-113759', 1, 18, '21', NULL, 3, '21', 1, 115, '2023-02-13 11:38:24.000', 115, '2023-02-13 11:38:39.777'); -INSERT INTO `wms_receipt_order` VALUES (274, 'R-2023-02-13-113942', 1, 18, '21', NULL, 3, '32', 1, 115, '2023-02-13 11:40:21.000', 115, '2023-02-13 11:40:48.887'); -INSERT INTO `wms_receipt_order` VALUES (275, 'R-2023-02-13-151051', 1, 19, '32', NULL, 3, '332', 1, 115, '2023-02-13 15:11:13.000', 115, '2023-02-13 16:26:38.816'); -INSERT INTO `wms_receipt_order` VALUES (276, 'R-2023-02-13-160741', 1, NULL, NULL, NULL, 0, NULL, 1, 115, '2023-02-13 16:07:59.000', 115, '2023-02-13 17:48:25.145'); -INSERT INTO `wms_receipt_order` VALUES (277, 'R-2023-02-14-093028', 1, 18, NULL, NULL, 3, NULL, 1, 115, '2023-02-14 09:30:55.000', 115, '2023-02-14 09:32:21.050'); -INSERT INTO `wms_receipt_order` VALUES (278, 'R-2023-02-14-094447', 1, 18, '123', NULL, 3, '123', 1, 115, '2023-02-14 09:45:00.000', 115, '2023-02-14 09:48:07.505'); -INSERT INTO `wms_receipt_order` VALUES (279, 'R-2023-02-14-172319', 1, 18, '000001', NULL, 3, NULL, 1, 115, '2023-02-14 17:23:36.000', 115, '2023-02-15 09:01:44.072'); -INSERT INTO `wms_receipt_order` VALUES (280, 'R-2023-02-14-182241', 1, 18, 'fsd', NULL, 0, 'sdf', 1, 115, '2023-02-14 18:22:56.653', NULL, NULL); -INSERT INTO `wms_receipt_order` VALUES (281, 'R-2023-02-15-103135', 2, 18, '234e', NULL, 0, 'sdf ', 1, 115, '2023-02-15 10:31:49.247', NULL, NULL); -INSERT INTO `wms_receipt_order` VALUES (282, 'R-2023-02-15-110504', 1, 19, '21', NULL, 0, '21', 1, 115, '2023-02-15 11:05:39.990', NULL, NULL); -INSERT INTO `wms_receipt_order` VALUES (283, 'R-2023-02-15-112632', 1, NULL, NULL, NULL, 0, NULL, 1, 115, '2023-02-15 11:26:59.938', NULL, NULL); -INSERT INTO `wms_receipt_order` VALUES (284, 'R-2023-02-15-112853', 1, 18, NULL, NULL, 3, NULL, 1, 115, '2023-02-15 11:29:05.000', 115, '2023-02-15 11:30:11.930'); -INSERT INTO `wms_receipt_order` VALUES (285, 'R-2023-02-15-115751', 1, 19, '123123', NULL, 0, '测试入库号码', 1, 115, '2023-02-15 11:58:24.000', 115, '2023-02-15 11:58:39.189'); -INSERT INTO `wms_receipt_order` VALUES (286, 'R-2023-02-15-150722', 1, 30, '963258', NULL, 3, '这一个测试', 1, 115, '2023-02-15 15:08:21.000', 115, '2023-02-15 15:11:13.492'); -INSERT INTO `wms_receipt_order` VALUES (287, 'R-2023-02-15-151734', 3, NULL, NULL, NULL, 0, NULL, 1, 115, '2023-02-15 15:18:55.050', NULL, NULL); -INSERT INTO `wms_receipt_order` VALUES (288, 'R-2023-02-15-155446', 1, 18, NULL, NULL, 0, NULL, 1, 115, '2023-02-15 15:51:35.000', 115, '2023-02-15 15:51:45.603'); -INSERT INTO `wms_receipt_order` VALUES (289, 'R-2023-02-15-162106', 1, 19, '21', NULL, 0, '333333', 1, 115, '2023-02-15 16:21:53.771', NULL, NULL); -INSERT INTO `wms_receipt_order` VALUES (290, 'R-2023-02-16-132214', 1, 18, 'AAA', NULL, 0, NULL, 1, 115, '2023-02-16 13:22:38.426', NULL, NULL); -INSERT INTO `wms_receipt_order` VALUES (291, 'R-2023-02-16-135005', 1, NULL, NULL, NULL, 0, NULL, 1, 115, '2023-02-16 13:50:31.000', 115, '2023-02-16 16:41:18.266'); -INSERT INTO `wms_receipt_order` VALUES (292, 'R-2023-02-16-151616', 1, 30, NULL, NULL, 3, NULL, 1, 115, '2023-02-16 15:17:26.000', 115, '2023-02-16 15:19:19.850'); -INSERT INTO `wms_receipt_order` VALUES (293, 'R-2023-02-17-105146', 3, 29, '001', NULL, 3, NULL, 1, 115, '2023-02-17 10:55:46.000', 115, '2023-02-17 10:56:03.285'); -INSERT INTO `wms_receipt_order` VALUES (294, 'R-2023-02-17-111149', 1, 29, '2', NULL, 3, NULL, 1, 115, '2023-02-17 11:12:37.000', 115, '2023-02-17 11:13:17.763'); -INSERT INTO `wms_receipt_order` VALUES (295, 'R-2023-02-17-131936', 1, 19, NULL, NULL, 3, NULL, 1, 115, '2023-02-17 13:19:52.000', 115, '2023-02-17 13:21:49.759'); -INSERT INTO `wms_receipt_order` VALUES (296, 'R-2023-02-17-134011', 1, 18, NULL, NULL, 2, NULL, 1, 115, '2023-02-17 13:40:24.000', 115, '2023-02-17 15:52:30.944'); -INSERT INTO `wms_receipt_order` VALUES (297, 'R-2023-02-17-154837', 1, 19, '1231234123', NULL, 3, '123412341', 1, 115, '2023-02-17 15:48:53.000', 115, '2023-02-17 15:52:07.287'); -INSERT INTO `wms_receipt_order` VALUES (298, 'R-2023-02-17-163629', 1, 18, '1', NULL, NULL, NULL, 1, 115, '2023-02-17 16:36:52.000', 115, '2023-02-21 10:41:08.010'); -INSERT INTO `wms_receipt_order` VALUES (299, 'R-2023-02-17-165104', 1, NULL, '20200305', NULL, 0, NULL, 1, 115, '2023-02-17 16:51:29.378', NULL, NULL); -INSERT INTO `wms_receipt_order` VALUES (300, 'R-2023-02-18-000524', 2, 18, '6544', NULL, 3, NULL, 1, 115, '2023-02-18 00:05:50.000', 115, '2023-02-20 10:41:13.552'); -INSERT INTO `wms_receipt_order` VALUES (301, 'R-2023-02-18-003112', 1, 19, NULL, NULL, 3, NULL, 1, 115, '2023-02-18 00:31:39.000', 115, '2023-02-18 00:32:00.485'); -INSERT INTO `wms_receipt_order` VALUES (302, 'R-2023-02-18-142159', 1, NULL, NULL, NULL, 0, NULL, 1, 115, '2023-02-18 14:22:44.000', 115, '2023-02-20 19:49:27.529'); -INSERT INTO `wms_receipt_order` VALUES (303, 'R-2023-02-19-015850', 1, NULL, NULL, NULL, 2, NULL, 1, 115, '2023-02-19 01:59:50.000', 115, '2023-02-20 17:40:29.932'); -INSERT INTO `wms_receipt_order` VALUES (304, 'R-2023-02-20-111056', 1, 18, '1', NULL, 3, '11', 1, 115, '2023-02-20 11:11:35.000', 115, '2023-02-22 15:45:29.599'); -INSERT INTO `wms_receipt_order` VALUES (305, 'R-2023-02-20-210704', 1, 18, NULL, NULL, 0, NULL, 1, 115, '2023-02-20 21:07:38.347', NULL, NULL); -INSERT INTO `wms_receipt_order` VALUES (306, 'R-2023-02-21-103132', 1, 18, NULL, NULL, 3, NULL, 1, 115, '2023-02-21 10:32:01.000', 115, '2023-02-21 10:40:53.849'); -INSERT INTO `wms_receipt_order` VALUES (307, 'R-2023-02-21-114102', 1, 18, NULL, NULL, 3, NULL, 1, 115, '2023-02-21 11:41:13.000', 115, '2023-02-21 14:19:02.966'); -INSERT INTO `wms_receipt_order` VALUES (308, 'R-2023-02-21-162310', 1, 19, '123213123123123', NULL, 1, '123123', 1, 115, '2023-02-21 16:23:29.000', 115, '2023-02-22 15:45:19.096'); -INSERT INTO `wms_receipt_order` VALUES (309, 'R-2023-02-21-165831', 1, 18, '1', NULL, 0, '1', 1, 115, '2023-02-21 16:58:56.730', NULL, NULL); -INSERT INTO `wms_receipt_order` VALUES (310, 'R-2023-02-22-070714', 1, NULL, NULL, NULL, 0, NULL, 1, 115, '2023-02-22 07:07:20.200', NULL, NULL); -INSERT INTO `wms_receipt_order` VALUES (311, 'R-2023-02-22-070724', 1, NULL, NULL, NULL, 0, NULL, 1, 115, '2023-02-22 07:10:20.042', NULL, NULL); -INSERT INTO `wms_receipt_order` VALUES (312, 'R-2023-02-22-071148', 1, NULL, NULL, NULL, 3, NULL, 1, 115, '2023-02-22 07:12:13.000', 115, '2023-02-22 07:22:49.685'); -INSERT INTO `wms_receipt_order` VALUES (313, 'R-2023-02-22-095848', 1, NULL, NULL, NULL, 0, NULL, 1, 115, '2023-02-22 09:58:51.541', NULL, NULL); -INSERT INTO `wms_receipt_order` VALUES (314, 'R-2023-02-22-134156', 1, 18, '2242343242', NULL, 0, '423432', 1, 115, '2023-02-22 13:42:48.000', 115, '2023-02-22 14:47:36.084'); -INSERT INTO `wms_receipt_order` VALUES (315, 'R-2023-02-22-162514', 1, 23, NULL, NULL, 0, NULL, 1, 115, '2023-02-22 16:25:32.268', NULL, NULL); -INSERT INTO `wms_receipt_order` VALUES (316, 'R-2023-02-22-171944', 1, 18, 'cx0000', NULL, 2, NULL, 1, 115, '2023-02-22 17:20:19.000', 115, '2023-02-23 15:33:07.285'); -INSERT INTO `wms_receipt_order` VALUES (317, 'R-2023-02-22-200437', 1, 20, NULL, NULL, 3, NULL, 1, 115, '2023-02-22 20:04:56.000', 115, '2023-02-22 20:05:14.175'); -INSERT INTO `wms_receipt_order` VALUES (318, 'R-2023-02-23-154501', 3, 30, 'fdsfdsfsdf', NULL, 0, '123123', 1, 115, '2023-02-23 15:43:55.000', 115, '2023-02-24 10:02:02.875'); -INSERT INTO `wms_receipt_order` VALUES (319, 'R-2023-02-23-213337', 1, 18, '11123', NULL, 1, NULL, 1, 115, '2023-02-23 21:34:09.000', 115, '2023-02-24 10:00:56.251'); -INSERT INTO `wms_receipt_order` VALUES (320, 'R-2023-02-23-221505', 1, 18, NULL, NULL, 3, NULL, 1, 115, '2023-02-23 22:15:51.000', 115, '2023-02-23 22:16:22.948'); -INSERT INTO `wms_receipt_order` VALUES (321, 'R-2023-02-24-124441', 1, 19, NULL, NULL, 0, NULL, 1, 115, '2023-02-24 12:45:00.524', NULL, NULL); -INSERT INTO `wms_receipt_order` VALUES (322, 'R-2023-02-24-145630', 3, 19, NULL, NULL, 0, NULL, 1, 115, '2023-02-24 14:57:16.000', 115, '2023-02-24 16:43:22.696'); -INSERT INTO `wms_receipt_order` VALUES (323, 'R-2023-02-24-152308', 1, 18, 'dsdd', NULL, 3, 'dsdsdsd', 1, 115, '2023-02-24 15:23:26.000', 115, '2023-02-24 15:24:09.566'); -INSERT INTO `wms_receipt_order` VALUES (324, 'R-2023-02-24-152748', 1, 19, 'fd', NULL, 3, 'fdf', 1, 115, '2023-02-24 15:28:20.000', 115, '2023-02-24 15:28:30.453'); -INSERT INTO `wms_receipt_order` VALUES (325, 'R-2023-02-24-163535', 1, 18, '000001', NULL, 3, NULL, 1, 115, '2023-02-24 16:36:07.000', 115, '2023-02-24 16:36:51.160'); -INSERT INTO `wms_receipt_order` VALUES (326, 'R-2023-02-24-164055', 1, 18, NULL, NULL, 3, NULL, 1, 115, '2023-02-24 16:41:45.000', 115, '2023-02-25 00:41:10.295'); -INSERT INTO `wms_receipt_order` VALUES (327, 'R-2023-02-25-003746', 1, 20, '0test', NULL, 0, 'test', 1, 115, '2023-02-25 00:38:24.000', 115, '2023-02-25 00:39:48.009'); -INSERT INTO `wms_receipt_order` VALUES (328, 'R-2023-02-25-102931', 1, 18, '123456456451231', NULL, 0, '入库入库', 1, 115, '2023-02-25 10:30:41.000', 115, '2023-02-25 10:31:11.812'); -INSERT INTO `wms_receipt_order` VALUES (329, 'R-2023-02-25-104058', 1, 19, '111', NULL, 0, NULL, 1, 115, '2023-02-25 10:41:13.000', 115, '2023-02-25 10:42:54.643'); -INSERT INTO `wms_receipt_order` VALUES (330, 'R-2023-02-25-212437', 1, 18, NULL, NULL, 0, NULL, 1, 115, '2023-02-25 21:25:00.345', NULL, NULL); -INSERT INTO `wms_receipt_order` VALUES (331, 'R-2023-02-26-133820', 1, 31, NULL, NULL, NULL, NULL, 1, 115, '2023-02-26 13:41:11.000', 115, '2023-02-26 14:10:09.994'); -INSERT INTO `wms_receipt_order` VALUES (332, 'R-2023-02-26-140939', 1, 31, NULL, NULL, 0, NULL, 1, 115, '2023-02-26 14:09:48.721', NULL, NULL); -INSERT INTO `wms_receipt_order` VALUES (333, 'R-2023-02-26-151158', 3, 31, '123', NULL, 3, '123', 1, 115, '2023-02-26 15:12:19.000', 115, '2023-02-26 15:13:26.049'); -INSERT INTO `wms_receipt_order` VALUES (334, 'R-2023-02-26-151630', 1, 31, '1111', NULL, 2, NULL, 1, 115, '2023-02-26 15:16:52.000', 115, '2023-02-26 17:55:48.144'); -INSERT INTO `wms_receipt_order` VALUES (335, 'R-2023-02-26-174654', 1, 32, 'YT123456', NULL, 0, NULL, 1, 115, '2023-02-26 17:47:20.000', 115, '2023-02-27 10:45:34.084'); -INSERT INTO `wms_receipt_order` VALUES (336, 'R-2023-02-27-021853', 1, 31, NULL, NULL, 3, NULL, 1, 115, '2023-02-27 10:19:21.000', 115, '2023-02-27 10:20:24.573'); -INSERT INTO `wms_receipt_order` VALUES (337, 'R-2023-02-27-103359', 1, 32, NULL, NULL, 3, NULL, 1, 115, '2023-02-27 10:33:52.000', 115, '2023-02-27 10:36:12.856'); -INSERT INTO `wms_receipt_order` VALUES (338, 'R-2023-02-27-104833', 1, 31, '11', NULL, 0, '111', 1, 115, '2023-02-27 10:48:48.000', 115, '2023-02-27 16:25:19.901'); -INSERT INTO `wms_receipt_order` VALUES (339, 'R-2023-02-27-123140', 1, 31, '13212312', NULL, 3, NULL, 1, 115, '2023-02-27 12:32:06.000', 115, '2023-02-27 12:33:01.040'); -INSERT INTO `wms_receipt_order` VALUES (340, 'R-2023-02-27-143544', 1, 31, NULL, NULL, 0, '12456', 1, 115, '2023-02-27 14:36:14.000', 115, '2023-02-28 10:02:29.717'); -INSERT INTO `wms_receipt_order` VALUES (341, 'R-2023-02-27-224430', 1, NULL, NULL, NULL, 3, NULL, 1, 115, '2023-02-27 22:45:10.000', 115, '2023-02-27 22:45:36.799'); -INSERT INTO `wms_receipt_order` VALUES (342, 'R-2023-02-27-233836', 1, NULL, NULL, NULL, 2, NULL, 1, 115, '2023-02-27 23:39:19.000', 115, '2023-02-28 00:16:38.766'); -INSERT INTO `wms_receipt_order` VALUES (343, 'R-2023-02-28-001311', 1, NULL, NULL, NULL, 3, NULL, 1, 115, '2023-02-28 00:15:57.000', 115, '2023-02-28 00:16:22.664'); -INSERT INTO `wms_receipt_order` VALUES (344, 'R-2023-02-28-110759', 1, 31, 'dsfdsfdsfdsfds', NULL, 3, NULL, 1, 115, '2023-02-28 11:08:09.000', 115, '2023-02-28 11:08:42.093'); -INSERT INTO `wms_receipt_order` VALUES (345, 'R-2023-02-28-111745', 1, 31, '123123123', NULL, 0, '123', 1, 115, '2023-02-28 11:17:59.000', 115, '2023-02-28 11:49:29.589'); -INSERT INTO `wms_receipt_order` VALUES (346, 'R-2023-02-28-142036', 1, 32, '1561665659', NULL, 0, NULL, 1, 115, '2023-02-28 14:21:03.439', NULL, NULL); -INSERT INTO `wms_receipt_order` VALUES (347, 'R-2023-03-01-025917', 1, 31, '123123', NULL, 0, NULL, 1, 115, '2023-03-01 02:59:40.550', NULL, NULL); -INSERT INTO `wms_receipt_order` VALUES (348, 'R-2023-03-01-030053', 2, 32, '111', NULL, 3, NULL, 1, 115, '2023-03-01 03:00:58.000', 115, '2023-03-01 03:09:32.734'); -INSERT INTO `wms_receipt_order` VALUES (349, 'R-2023-03-01-102526', 1, 32, '123123', NULL, 3, NULL, 1, 115, '2023-03-01 10:25:41.000', 115, '2023-03-01 10:26:33.740'); -INSERT INTO `wms_receipt_order` VALUES (350, 'R-2023-03-01-103238', 3, 31, NULL, NULL, 0, NULL, 1, 115, '2023-03-01 10:33:57.951', NULL, NULL); -INSERT INTO `wms_receipt_order` VALUES (351, 'R-2023-03-01-122704', 1, 31, '12313231', NULL, NULL, NULL, 1, 115, '2023-03-01 12:27:26.000', 115, '2023-03-01 17:34:06.692'); -INSERT INTO `wms_receipt_order` VALUES (352, 'R-2023-03-01-160512', 1, 31, 'TEST001', NULL, 2, NULL, 1, 115, '2023-03-01 16:05:47.000', 115, '2023-03-01 19:14:12.004'); -INSERT INTO `wms_receipt_order` VALUES (353, 'R-2023-03-01-161448', 1, NULL, NULL, NULL, 0, NULL, 1, 115, '2023-03-01 16:16:03.424', NULL, NULL); -INSERT INTO `wms_receipt_order` VALUES (354, 'R-2023-03-01-170434', 1, 31, '12313', NULL, 0, NULL, 1, 115, '2023-03-01 17:04:59.000', 115, '2023-03-01 20:51:47.968'); -INSERT INTO `wms_receipt_order` VALUES (355, 'R-2023-03-01-170730', 1, NULL, NULL, NULL, 3, NULL, 1, 115, '2023-03-01 17:07:51.000', 115, '2023-03-01 17:29:30.125'); -INSERT INTO `wms_receipt_order` VALUES (356, 'R-2023-03-01-180013', 1, 33, 'QD221823I000081771', NULL, 3, 'IP23020069', 1, 115, '2023-03-01 18:00:56.000', 115, '2023-03-01 18:06:30.377'); -INSERT INTO `wms_receipt_order` VALUES (357, 'R-2023-03-02-092011', 1, 33, '2333', NULL, 3, '', 1, 115, '2023-03-02 09:20:22.000', 115, '2023-03-02 09:21:54.260'); -INSERT INTO `wms_receipt_order` VALUES (358, 'R-2023-03-02-095154', 1, 34, '1222', NULL, 0, NULL, 1, 115, '2023-03-02 09:52:02.000', 115, '2023-03-02 09:53:14.198'); -INSERT INTO `wms_receipt_order` VALUES (359, 'R-2023-03-02-152801', 1, 31, '11121', NULL, 0, NULL, 1, 115, '2023-03-02 15:28:39.851', NULL, NULL); -INSERT INTO `wms_receipt_order` VALUES (360, 'R-2023-03-02-154753', 1, 33, NULL, NULL, 0, NULL, 1, 115, '2023-03-02 15:48:52.000', 115, '2023-03-03 07:31:28.540'); -INSERT INTO `wms_receipt_order` VALUES (361, 'R-2023-03-02-165007', 1, 31, NULL, NULL, 0, NULL, 1, 115, '2023-03-02 16:50:18.321', NULL, NULL); -INSERT INTO `wms_receipt_order` VALUES (362, 'R-2023-03-03-082828', 1, 33, '1212121', NULL, 3, NULL, 1, 115, '2023-03-03 08:28:58.000', 115, '2023-03-03 08:30:31.444'); -INSERT INTO `wms_receipt_order` VALUES (363, 'R-2023-03-03-084147', 1, 33, '123', NULL, 3, NULL, 1, 115, '2023-03-03 08:42:06.000', 115, '2023-03-03 08:45:43.819'); -INSERT INTO `wms_receipt_order` VALUES (364, 'R-2023-03-03-084413', 1, 32, 'sasasas', NULL, 3, 'asasasasa', 1, 115, '2023-03-03 08:44:27.000', 115, '2023-03-03 08:44:50.890'); -INSERT INTO `wms_receipt_order` VALUES (365, 'R-2023-03-03-125340', 1, 33, '131313', NULL, 3, '1111', 1, 115, '2023-03-03 12:54:24.000', 115, '2023-03-03 12:57:29.371'); -INSERT INTO `wms_receipt_order` VALUES (366, 'R-2023-03-03-213231', 1, 33, NULL, NULL, 2, NULL, 1, 115, '2023-03-03 21:33:04.000', 115, '2023-03-06 13:37:34.183'); -INSERT INTO `wms_receipt_order` VALUES (367, 'R-2023-03-03-213252', 1, 35, NULL, NULL, 3, NULL, 1, 115, '2023-03-03 21:39:41.000', 115, '2023-03-03 21:42:50.054'); -INSERT INTO `wms_receipt_order` VALUES (368, 'R-2023-03-03-214947', 1, 35, NULL, NULL, 3, NULL, 1, 115, '2023-03-03 21:50:46.000', 115, '2023-03-03 22:00:24.630'); -INSERT INTO `wms_receipt_order` VALUES (369, 'R-2023-03-03-220105', 1, 35, NULL, NULL, 3, NULL, 1, 115, '2023-03-03 22:01:45.000', 115, '2023-03-03 22:03:10.296'); -INSERT INTO `wms_receipt_order` VALUES (370, 'R-2023-03-03-223627', 1, 35, '111111111', NULL, 3, NULL, 1, 115, '2023-03-03 22:36:55.000', 115, '2023-03-03 22:37:09.338'); -INSERT INTO `wms_receipt_order` VALUES (371, 'R-2023-03-03-223812', 1, 35, '12', NULL, 3, '121', 1, 115, '2023-03-03 22:38:30.000', 115, '2023-03-03 22:39:13.306'); -INSERT INTO `wms_receipt_order` VALUES (372, 'R-2023-03-05-163838', 1, 35, '11111111111111', NULL, 0, NULL, 1, 115, '2023-03-05 16:39:06.940', NULL, NULL); -INSERT INTO `wms_receipt_order` VALUES (373, 'R-2023-03-06-082707', 1, 33, '22222', NULL, 3, '2222', 1, 115, '2023-03-06 08:27:32.000', 115, '2023-03-06 08:28:08.839'); -INSERT INTO `wms_receipt_order` VALUES (374, 'R-2023-03-06-173242', 1, 35, '123445', NULL, 3, NULL, 1, 115, '2023-03-06 17:33:32.000', 115, '2023-03-07 09:41:16.639'); -INSERT INTO `wms_receipt_order` VALUES (375, 'R-2023-03-07-093736', 1, 33, '112', NULL, 1, '121', 1, 115, '2023-03-07 09:38:21.000', 115, '2023-03-07 09:40:01.281'); -INSERT INTO `wms_receipt_order` VALUES (376, 'R-2023-03-07-103917', 1, 32, NULL, NULL, 0, NULL, 1, 115, '2023-03-07 10:39:38.753', NULL, NULL); -INSERT INTO `wms_receipt_order` VALUES (377, 'R-2023-03-07-143417', 1, NULL, NULL, NULL, 0, NULL, 1, 115, '2023-03-07 14:34:26.478', NULL, NULL); -INSERT INTO `wms_receipt_order` VALUES (378, 'R-2023-03-07-152418', 1, 32, NULL, NULL, 0, NULL, 1, 115, '2023-03-07 15:25:05.000', 115, '2023-03-08 18:55:40.232'); -INSERT INTO `wms_receipt_order` VALUES (379, 'R-2023-03-08-093047', 1, 33, 'RK202303070000001', NULL, 3, 'RK202303070000001测试', 1, 115, '2023-03-08 09:37:03.000', 115, '2023-03-08 09:37:18.561'); -INSERT INTO `wms_receipt_order` VALUES (380, 'R-2023-03-08-093738', 1, 35, 'RK20230307000002', NULL, 3, 'RK20230307000002测试', 1, 115, '2023-03-08 09:38:18.000', 115, '2023-03-08 09:39:15.826'); -INSERT INTO `wms_receipt_order` VALUES (381, 'R-2023-03-08-143918', 1, 33, NULL, NULL, 0, NULL, 1, 115, '2023-03-08 14:39:26.761', NULL, NULL); -INSERT INTO `wms_receipt_order` VALUES (382, 'R-2023-03-08-174305', 1, 32, NULL, NULL, 3, NULL, 1, 115, '2023-03-08 17:43:22.000', 115, '2023-03-10 15:29:42.908'); -INSERT INTO `wms_receipt_order` VALUES (383, 'R-2023-03-08-235915', 1, 33, '454564456', NULL, 0, '44', 1, 115, '2023-03-08 23:58:45.461', NULL, NULL); -INSERT INTO `wms_receipt_order` VALUES (384, 'R-2023-03-09-100314', 1, 33, NULL, NULL, 0, NULL, 1, 115, '2023-03-09 10:03:55.166', NULL, NULL); -INSERT INTO `wms_receipt_order` VALUES (385, 'R-2023-03-09-130054', 1, 34, '11', NULL, 3, '11', 1, 115, '2023-03-09 13:01:24.000', 115, '2023-03-09 13:04:31.031'); -INSERT INTO `wms_receipt_order` VALUES (386, 'R-2023-03-09-130903', 1, 32, '11', NULL, 3, '11', 1, 115, '2023-03-09 13:09:19.000', 115, '2023-03-09 13:09:36.842'); -INSERT INTO `wms_receipt_order` VALUES (387, 'R-2023-03-09-150957', 1, 33, '24', NULL, 3, NULL, 1, 115, '2023-03-09 15:10:30.000', 115, '2023-03-10 10:17:42.529'); -INSERT INTO `wms_receipt_order` VALUES (388, 'R-2023-03-09-151125', 1, 34, '434', NULL, 3, NULL, 1, 115, '2023-03-09 15:11:38.000', 115, '2023-03-09 15:11:59.084'); -INSERT INTO `wms_receipt_order` VALUES (389, 'R-2023-03-10-175854', 1, 33, '11111', NULL, 0, NULL, 1, 115, '2023-03-10 17:59:17.862', NULL, NULL); -INSERT INTO `wms_receipt_order` VALUES (390, 'R-2023-03-11-135708', 1, 33, NULL, NULL, 0, NULL, 1, 115, '2023-03-11 13:58:07.002', NULL, NULL); -INSERT INTO `wms_receipt_order` VALUES (391, 'R-2023-03-12-133547', 1, 33, '3333', NULL, 3, NULL, 1, 115, '2023-03-12 13:36:57.000', 115, '2023-03-12 13:39:25.788'); -INSERT INTO `wms_receipt_order` VALUES (392, 'R-2023-03-12-155449', 1, 32, '11', NULL, 3, '11', 1, 115, '2023-03-12 16:01:28.000', 115, '2023-03-12 16:02:14.208'); -INSERT INTO `wms_receipt_order` VALUES (393, 'R-2023-03-12-172806', 1, 32, '111000', NULL, 0, NULL, 1, 115, '2023-03-12 17:28:54.034', NULL, NULL); -INSERT INTO `wms_receipt_order` VALUES (394, 'R-2023-03-13-002327', 1, 34, '123', NULL, 3, NULL, 1, 115, '2023-03-13 00:23:45.000', 115, '2023-03-13 00:24:13.185'); -INSERT INTO `wms_receipt_order` VALUES (395, 'R-2023-03-13-041649', 1, 36, '5456', NULL, 3, NULL, 1, 115, '2023-03-13 04:17:02.000', 115, '2023-03-13 04:17:07.867'); -INSERT INTO `wms_receipt_order` VALUES (396, 'R-2023-03-13-102918', 2, 34, '11111111111111', NULL, 3, '质检借出归还', 1, 115, '2023-03-13 10:30:09.000', 115, '2023-03-13 10:32:39.637'); -INSERT INTO `wms_receipt_order` VALUES (397, 'R-2023-03-13-152157', 1, NULL, NULL, NULL, 3, NULL, 1, 115, '2023-03-13 15:23:21.000', 115, '2023-03-13 15:23:51.429'); -INSERT INTO `wms_receipt_order` VALUES (398, 'R-2023-03-13-153843', 1, 32, '111', NULL, 3, NULL, 1, 115, '2023-03-13 15:39:27.000', 115, '2023-03-13 15:39:42.631'); -INSERT INTO `wms_receipt_order` VALUES (399, 'R-2023-03-13-155141', 1, 33, '123', NULL, 3, NULL, 1, 115, '2023-03-13 15:52:10.000', 115, '2023-03-13 15:52:23.897'); -INSERT INTO `wms_receipt_order` VALUES (400, 'R-2023-03-13-155503', 1, 32, '66666', NULL, 3, NULL, 1, 115, '2023-03-13 15:55:33.000', 115, '2023-03-13 15:56:25.123'); -INSERT INTO `wms_receipt_order` VALUES (401, 'R-2023-03-13-155805', 1, 33, '66767', NULL, 3, NULL, 1, 115, '2023-03-13 15:58:32.000', 115, '2023-03-13 15:58:56.672'); -INSERT INTO `wms_receipt_order` VALUES (402, 'R-2023-03-13-163012', 1, 33, '333', NULL, 3, NULL, 1, 115, '2023-03-13 16:30:39.000', 115, '2023-03-13 16:30:47.777'); -INSERT INTO `wms_receipt_order` VALUES (403, 'R-2023-03-13-163117', 1, 32, NULL, NULL, 3, NULL, 1, 115, '2023-03-13 16:31:49.000', 115, '2023-03-13 16:32:56.785'); -INSERT INTO `wms_receipt_order` VALUES (404, 'R-2023-03-14-095219', 1, NULL, NULL, NULL, 3, NULL, 1, 115, '2023-03-14 09:53:00.000', 115, '2023-03-14 09:53:57.723'); -INSERT INTO `wms_receipt_order` VALUES (405, 'R-2023-03-14-112014', 1, 34, NULL, NULL, 1, NULL, 1, 115, '2023-03-14 11:20:28.000', 115, '2023-03-14 11:20:54.920'); -INSERT INTO `wms_receipt_order` VALUES (406, 'R-2023-03-14-130541', 3, 33, NULL, NULL, 2, NULL, 1, 115, '2023-03-14 13:06:23.000', 115, '2023-03-23 10:40:39.872'); -INSERT INTO `wms_receipt_order` VALUES (407, 'R-2023-03-14-134738', 1, 33, '1235566', NULL, 3, '备注达到的', 1, 115, '2023-03-14 13:48:35.000', 115, '2023-03-14 13:49:07.881'); -INSERT INTO `wms_receipt_order` VALUES (408, 'R-2023-03-14-161602', 1, 33, NULL, NULL, 3, NULL, 1, 115, '2023-03-14 16:16:27.000', 115, '2023-03-14 16:17:08.589'); -INSERT INTO `wms_receipt_order` VALUES (409, 'R-2023-03-14-161751', 1, NULL, NULL, NULL, 3, NULL, 1, 115, '2023-03-14 16:18:08.000', 115, '2023-03-14 16:18:41.570'); -INSERT INTO `wms_receipt_order` VALUES (410, 'R-2023-03-14-200938', 1, 33, '123', NULL, 0, '123', 1, 115, '2023-03-14 20:10:52.000', 115, '2023-03-14 23:57:41.427'); -INSERT INTO `wms_receipt_order` VALUES (411, 'R-2023-03-14-235746', 1, 33, NULL, NULL, 0, NULL, 1, 115, '2023-03-14 23:58:14.783', NULL, NULL); -INSERT INTO `wms_receipt_order` VALUES (412, 'R-2023-03-15-094959', 1, 33, NULL, NULL, 1, NULL, 1, 115, '2023-03-15 09:50:34.000', 115, '2023-03-23 10:40:26.872'); -INSERT INTO `wms_receipt_order` VALUES (413, 'R-2023-03-15-184530', 1, 34, '12333333331233', NULL, 3, '23', 1, 115, '2023-03-15 18:46:04.000', 115, '2023-03-15 18:46:37.861'); -INSERT INTO `wms_receipt_order` VALUES (414, 'R-2023-03-15-214955', 1, 36, '789', NULL, 3, '?', 1, 115, '2023-03-15 21:50:07.000', 115, '2023-03-15 21:50:15.587'); -INSERT INTO `wms_receipt_order` VALUES (415, 'R-2023-03-16-092020', 1, 34, NULL, NULL, 3, NULL, 1, 115, '2023-03-16 09:21:11.000', 115, '2023-03-16 09:21:46.780'); -INSERT INTO `wms_receipt_order` VALUES (416, 'R-2023-03-16-112921', 1, NULL, NULL, NULL, 3, NULL, 1, 115, '2023-03-16 11:30:08.000', 115, '2023-03-16 11:30:49.772'); -INSERT INTO `wms_receipt_order` VALUES (417, 'R-2023-03-16-155045', 1, NULL, NULL, NULL, 0, NULL, 1, 115, '2023-03-16 15:51:13.000', 115, '2023-03-19 10:37:19.726'); -INSERT INTO `wms_receipt_order` VALUES (418, 'R-2023-03-16-180049', 1, 33, 'ODR0316', NULL, 3, NULL, 1, 115, '2023-03-16 18:01:58.000', 115, '2023-03-21 14:40:37.680'); -INSERT INTO `wms_receipt_order` VALUES (419, 'R-2023-03-17-112828', 1, NULL, NULL, NULL, 0, NULL, 1, 115, '2023-03-17 11:29:00.096', NULL, NULL); -INSERT INTO `wms_receipt_order` VALUES (420, 'R-2023-03-17-115516', 2, 33, 'fwefwefwefwe', NULL, 0, NULL, 1, 115, '2023-03-17 11:55:47.000', 115, '2023-03-17 14:54:47.483'); -INSERT INTO `wms_receipt_order` VALUES (421, 'R-2023-03-17-152847', 1, 33, 'GMS1100231', NULL, 3, NULL, 1, 115, '2023-03-17 15:29:18.000', 115, '2023-03-17 15:32:11.147'); -INSERT INTO `wms_receipt_order` VALUES (422, 'R-2023-03-17-161935', 1, 33, NULL, NULL, 3, NULL, 1, 115, '2023-03-17 16:20:13.000', 115, '2023-03-20 08:40:39.446'); -INSERT INTO `wms_receipt_order` VALUES (423, 'R-2023-03-17-180515', 2, 33, '123', NULL, 3, '1231321', 1, 115, '2023-03-17 18:05:46.000', 115, '2023-03-17 18:06:04.210'); -INSERT INTO `wms_receipt_order` VALUES (424, 'R-2023-03-20-110410', 1, 32, '打撒所', NULL, 0, NULL, 1, 115, '2023-03-20 11:04:27.341', NULL, NULL); -INSERT INTO `wms_receipt_order` VALUES (425, 'R-2023-03-20-113352', 1, 33, NULL, NULL, 2, NULL, 1, 115, '2023-03-20 11:34:32.000', 115, '2023-03-20 11:36:07.231'); -INSERT INTO `wms_receipt_order` VALUES (426, 'R-2023-03-20-131852', 3, 34, NULL, NULL, 0, '1', 1, 115, '2023-03-20 13:19:35.000', 115, '2023-03-20 13:20:05.250'); -INSERT INTO `wms_receipt_order` VALUES (427, 'R-2023-03-20-133130', 1, 32, '123123', NULL, 0, '123', 1, 115, '2023-03-20 13:31:38.658', NULL, NULL); -INSERT INTO `wms_receipt_order` VALUES (428, 'R-2023-03-20-134726', 1, 32, NULL, NULL, 3, NULL, 1, 115, '2023-03-20 13:47:47.000', 115, '2023-03-20 13:48:40.624'); -INSERT INTO `wms_receipt_order` VALUES (429, 'R-2023-03-20-140513', 1, 33, NULL, NULL, 3, NULL, 1, 115, '2023-03-20 14:07:02.000', 115, '2023-03-20 14:08:46.518'); -INSERT INTO `wms_receipt_order` VALUES (430, 'R-2023-03-20-164817', 1, 33, NULL, NULL, 3, NULL, 1, 115, '2023-03-20 16:48:40.000', 115, '2023-03-20 16:49:02.122'); -INSERT INTO `wms_receipt_order` VALUES (431, 'R-2023-03-20-170442', 1, 32, '1', NULL, 0, '1', 1, 115, '2023-03-20 17:04:58.339', NULL, NULL); -INSERT INTO `wms_receipt_order` VALUES (432, 'R-2023-03-20-170502', 1, 33, '1', NULL, 0, '1', 1, 115, '2023-03-20 17:05:14.141', NULL, NULL); -INSERT INTO `wms_receipt_order` VALUES (433, 'R-2023-03-20-170714', 1, 32, NULL, NULL, 0, NULL, 1, 115, '2023-03-20 17:07:40.000', 115, '2023-03-20 17:07:46.200'); -INSERT INTO `wms_receipt_order` VALUES (434, 'R-2023-03-20-170223', 1, 34, NULL, NULL, 0, NULL, 1, 115, '2023-03-20 17:12:06.850', NULL, NULL); -INSERT INTO `wms_receipt_order` VALUES (435, 'R-2023-03-20-172750', 1, NULL, NULL, NULL, 0, NULL, 1, 115, '2023-03-20 17:28:54.059', NULL, NULL); -INSERT INTO `wms_receipt_order` VALUES (436, 'R-2023-03-20-173014', 1, 33, 'fsdfsfds', NULL, 1, 'fdsfsdf', 1, 115, '2023-03-20 17:30:59.000', 115, '2023-03-20 20:59:06.463'); -INSERT INTO `wms_receipt_order` VALUES (437, 'R-2023-03-20-221222', 1, 38, '8801', NULL, 3, NULL, 1, 115, '2023-03-20 22:13:42.000', 115, '2023-03-22 09:44:10.166'); -INSERT INTO `wms_receipt_order` VALUES (438, 'R-2023-03-21-141407', 1, 38, 'regrer4', NULL, 0, '34fgd', 1, 115, '2023-03-21 14:14:12.087', NULL, NULL); -INSERT INTO `wms_receipt_order` VALUES (439, 'R-2023-03-21-164843', 1, 37, '1', NULL, 3, '1', 1, 115, '2023-03-21 16:48:54.000', 115, '2023-03-21 17:25:21.809'); -INSERT INTO `wms_receipt_order` VALUES (440, 'R-2023-03-21-165904', 1, 37, '1', NULL, 3, '1', 1, 115, '2023-03-21 16:59:18.000', 115, '2023-03-21 17:24:15.447'); -INSERT INTO `wms_receipt_order` VALUES (441, 'R-2023-03-21-193225', 1, 37, '1932', NULL, 3, NULL, 1, 115, '2023-03-21 19:32:52.000', 115, '2023-03-21 19:33:36.177'); -INSERT INTO `wms_receipt_order` VALUES (442, 'R-2023-03-21-193443', 1, 37, '1934', NULL, 3, NULL, 1, 115, '2023-03-21 19:35:02.000', 115, '2023-03-21 19:35:15.580'); -INSERT INTO `wms_receipt_order` VALUES (443, 'R-2023-03-22-001707', 1, NULL, NULL, NULL, 3, NULL, 1, 115, '2023-03-22 00:17:31.000', 115, '2023-03-22 00:18:02.130'); -INSERT INTO `wms_receipt_order` VALUES (444, 'R-2023-03-22-125811', 1, NULL, NULL, NULL, 2, NULL, 1, 115, '2023-03-22 12:58:19.000', 115, '2023-03-22 12:58:50.545'); -INSERT INTO `wms_receipt_order` VALUES (445, 'R-2023-03-22-152645', 1, 37, '15237', NULL, 3, NULL, 1, 115, '2023-03-22 15:27:54.000', 115, '2023-03-22 15:29:18.493'); -INSERT INTO `wms_receipt_order` VALUES (446, 'R-2023-03-22-152954', 1, 37, '3.22', NULL, 3, NULL, 1, 115, '2023-03-22 15:30:18.000', 115, '2023-03-22 15:31:47.094'); -INSERT INTO `wms_receipt_order` VALUES (447, 'R-2023-03-22-154443', 1, 37, '123', NULL, 0, NULL, 1, 115, '2023-03-22 15:44:50.327', NULL, NULL); -INSERT INTO `wms_receipt_order` VALUES (448, 'R-2023-03-22-155530', 1, 37, '123132', NULL, 3, NULL, 1, 115, '2023-03-22 15:55:43.000', 115, '2023-03-22 16:08:24.828'); -INSERT INTO `wms_receipt_order` VALUES (449, 'R-2023-03-22-155913', 1, 40, '20230322', NULL, 0, NULL, 1, 115, '2023-03-22 15:59:32.000', 115, '2023-03-22 16:00:00.177'); -INSERT INTO `wms_receipt_order` VALUES (450, 'R-2023-03-22-160828', 1, 40, '021212', NULL, 3, NULL, 1, 115, '2023-03-22 16:09:14.000', 115, '2023-03-22 16:10:18.479'); -INSERT INTO `wms_receipt_order` VALUES (451, 'R-2023-03-22-224953', 1, 40, 'G2023033300001', NULL, 3, '电脑采购入库', 1, 115, '2023-03-22 22:50:52.000', 115, '2023-03-22 22:51:19.743'); -INSERT INTO `wms_receipt_order` VALUES (452, 'R-2023-03-23-094543', 1, NULL, NULL, NULL, 2, NULL, 1, 115, '2023-03-23 09:46:12.000', 115, '2023-03-23 10:37:47.961'); -INSERT INTO `wms_receipt_order` VALUES (453, 'R-2023-03-23-104053', 2, 40, NULL, NULL, 0, NULL, 1, 115, '2023-03-23 10:41:13.702', NULL, NULL); -INSERT INTO `wms_receipt_order` VALUES (454, 'R-2023-03-23-110454', 1, 39, NULL, NULL, 3, NULL, 1, 115, '2023-03-23 11:05:10.000', 115, '2023-03-23 11:05:57.998'); -INSERT INTO `wms_receipt_order` VALUES (455, 'R-2023-03-23-110700', 1, NULL, NULL, NULL, 3, NULL, 1, 115, '2023-03-23 11:07:31.000', 115, '2023-03-23 11:07:53.421'); -INSERT INTO `wms_receipt_order` VALUES (456, 'R-2023-03-23-111439', 3, 39, '1', NULL, 0, '1', 1, 115, '2023-03-23 11:14:56.490', NULL, NULL); -INSERT INTO `wms_receipt_order` VALUES (457, 'R-2023-03-23-133348', 1, NULL, NULL, NULL, 3, NULL, 1, 115, '2023-03-23 13:36:21.000', 115, '2023-03-23 13:39:53.484'); -INSERT INTO `wms_receipt_order` VALUES (458, 'R-2023-03-23-134151', 1, NULL, NULL, NULL, 0, NULL, 1, 115, '2023-03-23 13:43:28.000', 115, '2023-03-23 13:47:17.603'); -INSERT INTO `wms_receipt_order` VALUES (459, 'R-2023-03-23-140915', 1, NULL, NULL, NULL, 0, NULL, 1, 115, '2023-03-23 14:09:51.421', NULL, NULL); -INSERT INTO `wms_receipt_order` VALUES (460, 'R-2023-03-23-143353', 1, NULL, NULL, NULL, 0, NULL, 1, 115, '2023-03-23 14:34:13.456', NULL, NULL); -INSERT INTO `wms_receipt_order` VALUES (461, 'R-2023-03-23-143432', 1, NULL, NULL, NULL, 1, NULL, 1, 115, '2023-03-23 14:34:50.000', 115, '2023-03-23 14:35:36.741'); -INSERT INTO `wms_receipt_order` VALUES (462, 'R-2023-03-23-143712', 3, NULL, NULL, NULL, 0, NULL, 1, 115, '2023-03-23 14:37:44.800', NULL, NULL); -INSERT INTO `wms_receipt_order` VALUES (463, 'R-2023-03-23-144433', 2, NULL, NULL, NULL, 1, NULL, 1, 115, '2023-03-23 14:45:09.000', 115, '2023-03-23 14:45:21.449'); -INSERT INTO `wms_receipt_order` VALUES (464, 'R-2023-03-23-144954', 1, NULL, NULL, NULL, 0, NULL, 1, 115, '2023-03-23 14:51:05.291', NULL, NULL); -INSERT INTO `wms_receipt_order` VALUES (465, 'R-2023-03-23-145152', 1, 39, NULL, NULL, 0, NULL, 1, 115, '2023-03-23 14:52:00.897', NULL, NULL); -INSERT INTO `wms_receipt_order` VALUES (466, 'R-2023-03-23-145233', 1, 40, '刘老师', NULL, 0, '梅花四尺', 0, 115, '2023-03-23 14:53:06.000', 115, '2023-03-30 14:16:12.958'); -INSERT INTO `wms_receipt_order` VALUES (467, 'R-2023-03-23-145745', 1, NULL, NULL, NULL, 0, NULL, 1, 115, '2023-03-23 14:57:49.248', NULL, NULL); -INSERT INTO `wms_receipt_order` VALUES (468, 'R-2023-03-23-150820', 1, NULL, NULL, NULL, 0, NULL, 1, 115, '2023-03-23 15:08:31.422', NULL, NULL); -INSERT INTO `wms_receipt_order` VALUES (469, 'R-2023-03-23-235114', 2, 40, '哎哎哎', NULL, 3, '点对点', 0, 115, '2023-03-23 23:51:53.000', 115, '2023-04-01 23:51:54.904'); -INSERT INTO `wms_receipt_order` VALUES (470, 'R-2023-03-24-142429', 1, 37, '1111111', NULL, 3, '111111111111', 0, 115, '2023-03-24 14:24:44.000', 115, '2023-03-24 14:25:05.570'); -INSERT INTO `wms_receipt_order` VALUES (471, 'R-2023-03-24-145728', 1, NULL, NULL, NULL, 0, NULL, 0, 115, '2023-03-24 14:57:30.000', 115, '2023-03-25 09:39:38.232'); -INSERT INTO `wms_receipt_order` VALUES (472, 'R-2023-03-24-154701', 1, 39, NULL, NULL, 3, NULL, 0, 115, '2023-03-24 15:47:47.000', 115, '2023-03-24 15:51:08.114'); -INSERT INTO `wms_receipt_order` VALUES (473, 'R-2023-03-25-151955', 1, 37, '666', NULL, 0, '666', 0, 115, '2023-03-25 15:20:24.283', NULL, NULL); -INSERT INTO `wms_receipt_order` VALUES (474, 'R-2023-03-25-152604', 1, 42, '001', NULL, 3, NULL, 0, 115, '2023-03-25 15:27:07.000', 115, '2023-03-25 15:27:42.067'); -INSERT INTO `wms_receipt_order` VALUES (475, 'R-2023-03-25-164207', 1, NULL, NULL, NULL, 2, NULL, 0, 115, '2023-03-25 16:42:35.000', 115, '2023-03-29 14:36:12.005'); -INSERT INTO `wms_receipt_order` VALUES (476, 'R-2023-03-26-195119', 1, NULL, NULL, NULL, 3, NULL, 0, 115, '2023-03-26 19:52:04.000', 115, '2023-03-26 19:52:24.491'); -INSERT INTO `wms_receipt_order` VALUES (477, 'R-2023-03-27-111704', 1, 40, 'test001', NULL, 3, NULL, 0, 115, '2023-03-27 11:17:29.000', 115, '2023-03-27 11:18:43.739'); -INSERT INTO `wms_receipt_order` VALUES (478, 'R-2023-03-27-111954', 1, 39, 'test010111111', NULL, 3, NULL, 0, 115, '2023-03-27 11:20:26.000', 115, '2023-03-27 11:22:04.546'); -INSERT INTO `wms_receipt_order` VALUES (479, 'R-2023-03-27-142534', 1, 39, '11', NULL, 0, '111', 0, 115, '2023-03-27 14:25:46.896', NULL, NULL); -INSERT INTO `wms_receipt_order` VALUES (480, 'R-2023-03-27-170255', 1, 41, '123213213123123', NULL, 0, '123123123123213123', 0, 115, '2023-03-27 17:03:22.190', NULL, NULL); -INSERT INTO `wms_receipt_order` VALUES (481, 'R-2023-03-27-175706', 1, 39, NULL, NULL, 0, NULL, 0, 115, '2023-03-27 17:58:17.480', NULL, NULL); -INSERT INTO `wms_receipt_order` VALUES (482, 'R-2023-03-27-213057', 3, 41, NULL, NULL, 0, NULL, 0, 115, '2023-03-27 21:31:38.513', NULL, NULL); -INSERT INTO `wms_receipt_order` VALUES (483, 'R-2023-03-28-223034', 1, 37, NULL, NULL, 0, '22222222222', 0, 115, '2023-03-28 22:30:49.567', NULL, NULL); -INSERT INTO `wms_receipt_order` VALUES (484, 'R-2023-03-28-231554', 1, 41, NULL, NULL, 3, NULL, 0, 115, '2023-03-28 23:16:21.000', 115, '2023-03-29 14:00:17.570'); -INSERT INTO `wms_receipt_order` VALUES (485, 'R-2023-03-29-114447', 1, NULL, '2121', NULL, 2, '2121', 0, 115, '2023-03-29 11:45:26.000', 115, '2023-03-29 15:04:23.615'); -INSERT INTO `wms_receipt_order` VALUES (486, 'R-2023-03-29-132010', 1, NULL, NULL, NULL, 2, NULL, 0, 115, '2023-03-29 13:21:40.000', 115, '2023-03-29 14:40:09.644'); -INSERT INTO `wms_receipt_order` VALUES (487, 'R-2023-03-29-151302', 1, NULL, '1231', NULL, 2, '1231', 0, 115, '2023-03-29 15:13:23.000', 115, '2023-03-30 12:00:59.822'); -INSERT INTO `wms_receipt_order` VALUES (488, 'R-2023-03-30-152558', 1, 45, NULL, NULL, 0, NULL, 0, 115, '2023-03-30 15:26:23.712', NULL, NULL); -INSERT INTO `wms_receipt_order` VALUES (489, 'R-2023-03-30-173542', 1, NULL, NULL, NULL, 3, NULL, 0, 115, '2023-03-30 17:37:22.000', 115, '2023-03-31 14:31:38.905'); -INSERT INTO `wms_receipt_order` VALUES (490, 'R-2023-03-30-182659', 1, NULL, NULL, NULL, 0, NULL, 0, 115, '2023-03-30 18:28:25.340', NULL, NULL); -INSERT INTO `wms_receipt_order` VALUES (491, 'R-2023-03-30-182722', 1, NULL, '123', NULL, 3, '买了100个本子', 0, 115, '2023-03-30 18:29:06.000', 115, '2023-03-30 18:29:22.366'); -INSERT INTO `wms_receipt_order` VALUES (492, 'R-2023-03-30-183020', 1, NULL, NULL, NULL, 3, '买99个本子', 0, 115, '2023-03-30 18:32:09.000', 115, '2023-03-30 18:32:38.888'); -INSERT INTO `wms_receipt_order` VALUES (493, 'R-2023-03-30-203551', 1, NULL, NULL, NULL, 0, NULL, 1, 115, '2023-03-30 20:36:42.000', 115, '2023-03-31 09:19:16.688'); -INSERT INTO `wms_receipt_order` VALUES (494, 'R-2023-03-31-092819', 1, NULL, NULL, NULL, 0, NULL, 1, 115, '2023-03-31 09:28:54.163', NULL, NULL); -INSERT INTO `wms_receipt_order` VALUES (495, 'R-2023-04-01-143449', 1, 46, '12', NULL, 3, NULL, 0, 115, '2023-04-01 14:34:57.000', 115, '2023-04-03 13:17:47.522'); -INSERT INTO `wms_receipt_order` VALUES (496, 'R-2023-04-03-090716', 1, 46, '123', NULL, 0, NULL, 1, 115, '2023-04-03 09:07:35.432', NULL, NULL); -INSERT INTO `wms_receipt_order` VALUES (497, 'R-2023-04-03-091935', 2, 46, '123434', NULL, 3, NULL, 0, 115, '2023-04-03 09:20:56.000', 115, '2023-04-03 09:21:08.892'); -INSERT INTO `wms_receipt_order` VALUES (498, 'R-2023-04-03-093118', 1, 46, '2324324', NULL, 3, '对方是否', 0, 115, '2023-04-03 09:31:39.000', 115, '2023-04-03 09:31:56.827'); -INSERT INTO `wms_receipt_order` VALUES (499, 'R-2023-04-03-131419', 1, NULL, NULL, NULL, 3, NULL, 0, 115, '2023-04-03 13:14:37.000', 115, '2023-04-03 13:16:25.362'); -INSERT INTO `wms_receipt_order` VALUES (500, 'R-2023-04-03-133836', 1, NULL, NULL, NULL, 3, NULL, 0, 115, '2023-04-03 13:40:20.000', 115, '2023-04-03 13:48:21.584'); -INSERT INTO `wms_receipt_order` VALUES (501, 'R-2023-04-03-135832', 1, NULL, NULL, NULL, 3, NULL, 0, 115, '2023-04-03 13:58:51.000', 115, '2023-04-03 14:01:22.081'); -INSERT INTO `wms_receipt_order` VALUES (502, 'R-2023-04-03-140424', 1, NULL, NULL, NULL, 3, 'test', 0, 115, '2023-04-03 14:04:51.000', 115, '2023-04-03 14:22:41.999'); -INSERT INTO `wms_receipt_order` VALUES (503, 'R-2023-04-03-141314', 1, 46, NULL, NULL, 2, NULL, 0, 115, '2023-04-03 14:14:49.000', 115, '2023-04-06 17:42:32.425'); -INSERT INTO `wms_receipt_order` VALUES (504, 'R-2023-04-03-142320', 1, NULL, NULL, NULL, 3, NULL, 0, 115, '2023-04-03 14:23:35.000', 115, '2023-04-03 14:23:52.131'); -INSERT INTO `wms_receipt_order` VALUES (505, 'R-2023-04-03-142404', 1, NULL, NULL, NULL, 3, NULL, 0, 115, '2023-04-03 14:24:16.000', 115, '2023-04-03 14:24:29.628'); -INSERT INTO `wms_receipt_order` VALUES (506, 'R-2023-04-03-142453', 1, NULL, NULL, NULL, 3, NULL, 0, 115, '2023-04-03 14:25:05.000', 115, '2023-04-04 13:45:42.326'); -INSERT INTO `wms_receipt_order` VALUES (507, 'R-2023-04-03-143725', 1, NULL, NULL, NULL, 0, NULL, 1, 115, '2023-04-03 14:37:30.517', NULL, NULL); -INSERT INTO `wms_receipt_order` VALUES (508, 'R-2023-04-03-152627', 1, 46, '123123', NULL, 0, '123', 1, 115, '2023-04-03 15:26:21.996', NULL, NULL); -INSERT INTO `wms_receipt_order` VALUES (509, 'R-2023-04-03-162242', 1, 46, NULL, NULL, 3, NULL, 0, 115, '2023-04-03 16:23:05.000', 115, '2023-04-03 16:25:21.881'); -INSERT INTO `wms_receipt_order` VALUES (510, 'R-2023-04-04-134012', 1, NULL, 'asdasd', NULL, 3, 'asasdasd', 0, 115, '2023-04-04 13:40:27.000', 115, '2023-04-04 13:40:37.707'); -INSERT INTO `wms_receipt_order` VALUES (511, 'R-2023-04-04-155230', 1, NULL, NULL, NULL, 3, NULL, 0, 115, '2023-04-04 15:52:46.000', 115, '2023-04-04 15:53:11.006'); -INSERT INTO `wms_receipt_order` VALUES (512, 'R-2023-04-04-155451', 1, NULL, NULL, NULL, 3, NULL, 0, 115, '2023-04-04 15:55:12.000', 115, '2023-04-04 15:55:45.084'); -INSERT INTO `wms_receipt_order` VALUES (513, 'R-2023-04-04-160304', 1, 47, 'dddddd', NULL, 0, 'ddd ', 0, 115, '2023-04-04 16:03:32.674', NULL, NULL); -INSERT INTO `wms_receipt_order` VALUES (514, 'R-2023-04-06-141005', 1, 48, '001', NULL, 3, '001', 0, 115, '2023-04-06 14:10:45.000', 115, '2023-04-06 14:13:57.984'); -INSERT INTO `wms_receipt_order` VALUES (515, 'R-2023-04-06-151014', 1, 49, '000001', NULL, 3, NULL, 0, 115, '2023-04-06 15:11:32.000', 115, '2023-04-06 15:12:31.977'); -INSERT INTO `wms_receipt_order` VALUES (516, 'R-2023-04-06-151916', 1, 49, '000001', NULL, 3, NULL, 0, 115, '2023-04-06 15:19:48.000', 115, '2023-04-06 15:20:02.022'); -INSERT INTO `wms_receipt_order` VALUES (517, 'R-2023-04-06-175515', 1, 47, '885578785', NULL, 3, NULL, 0, 115, '2023-04-06 17:55:59.000', 115, '2023-04-06 17:57:00.874'); -INSERT INTO `wms_receipt_order` VALUES (518, 'R-2023-04-06-175716', 1, NULL, NULL, NULL, 3, NULL, 0, 115, '2023-04-06 17:57:28.000', 115, '2023-04-06 18:02:20.500'); -INSERT INTO `wms_receipt_order` VALUES (519, 'R-2023-04-06-175804', 1, NULL, NULL, NULL, 2, NULL, 0, 115, '2023-04-06 17:58:43.000', 115, '2023-04-06 18:02:05.741'); -INSERT INTO `wms_receipt_order` VALUES (520, 'R-2023-04-06-180452', 1, NULL, NULL, NULL, 1, NULL, 0, 115, '2023-04-06 18:05:09.000', 115, '2023-04-07 17:56:53.387'); -INSERT INTO `wms_receipt_order` VALUES (521, 'R-2023-04-06-214457', 1, 48, NULL, NULL, 0, NULL, 0, 115, '2023-04-06 21:45:19.000', 115, '2023-04-07 10:06:51.142'); -INSERT INTO `wms_receipt_order` VALUES (522, 'R-2023-04-06-223251', 1, 47, NULL, NULL, 3, NULL, 0, 115, '2023-04-06 22:33:43.000', 115, '2023-04-06 22:34:08.233'); -INSERT INTO `wms_receipt_order` VALUES (523, 'R-2023-04-06-224415', 1, 50, '800', NULL, 3, NULL, 0, 115, '2023-04-06 22:44:48.000', 115, '2023-04-06 22:45:01.095'); -INSERT INTO `wms_receipt_order` VALUES (524, 'R-2023-04-07-093503', 1, 47, '777788899/*/*7*/', NULL, 2, NULL, 0, 115, '2023-04-07 09:36:00.000', 115, '2023-04-07 11:07:27.916'); -INSERT INTO `wms_receipt_order` VALUES (525, 'R-2023-04-07-110707', 1, 47, NULL, NULL, 3, NULL, 0, 115, '2023-04-07 11:07:32.000', 115, '2023-04-07 11:11:55.470'); -INSERT INTO `wms_receipt_order` VALUES (526, 'R-2023-04-08-175620', 1, NULL, NULL, NULL, 3, NULL, 0, 115, '2023-04-08 17:56:44.000', 115, '2023-04-08 21:37:28.923'); -INSERT INTO `wms_receipt_order` VALUES (527, 'R-2023-04-09-171825', 1, 47, NULL, NULL, 0, NULL, 0, 115, '2023-04-09 17:19:49.953', NULL, NULL); -INSERT INTO `wms_receipt_order` VALUES (528, 'R-2023-04-10-091256', 3, 48, NULL, NULL, 3, NULL, 0, 115, '2023-04-10 09:13:14.000', 115, '2023-04-10 10:49:53.365'); -INSERT INTO `wms_receipt_order` VALUES (529, 'R-2023-04-10-114135', 1, 49, 'HR0001', NULL, 0, 'lei', 0, 115, '2023-04-10 11:42:38.000', 115, '2023-04-10 11:44:02.127'); -INSERT INTO `wms_receipt_order` VALUES (530, 'R-2023-04-10-144101', 2, 47, NULL, NULL, 3, NULL, 0, 115, '2023-04-10 14:41:31.000', 115, '2023-04-10 16:07:17.879'); -INSERT INTO `wms_receipt_order` VALUES (531, 'R-2023-04-10-165002', 1, NULL, NULL, NULL, 3, NULL, 0, 115, '2023-04-10 16:50:16.000', 115, '2023-04-10 16:50:33.633'); -INSERT INTO `wms_receipt_order` VALUES (532, 'R-2023-04-10-195143', 1, 48, NULL, NULL, 3, NULL, 0, 115, '2023-04-10 19:53:06.000', 115, '2023-04-10 19:53:21.525'); -INSERT INTO `wms_receipt_order` VALUES (533, 'R-2023-04-11-120049', 1, 49, '2023041101201001', NULL, 3, NULL, 0, 115, '2023-04-11 12:02:06.000', 115, '2023-04-11 12:03:34.304'); -INSERT INTO `wms_receipt_order` VALUES (534, 'R-2023-04-11-120359', 1, 50, '20230411022330', NULL, 2, NULL, 0, 115, '2023-04-11 12:04:47.000', 115, '2023-04-11 12:04:55.577'); -INSERT INTO `wms_receipt_order` VALUES (535, 'R-2023-04-11-143906', 1, 47, '1210001', NULL, 3, '测试入库', 0, 115, '2023-04-11 14:41:29.000', 115, '2023-04-11 15:59:25.817'); -INSERT INTO `wms_receipt_order` VALUES (536, 'R-2023-04-11-152420', 1, 47, '1212313', NULL, 2, NULL, 0, 115, '2023-04-11 15:24:44.000', 115, '2023-04-11 15:25:07.204'); -INSERT INTO `wms_receipt_order` VALUES (537, 'R-2023-04-11-164808', 1, 47, '0411', NULL, 2, NULL, 0, 115, '2023-04-11 16:49:28.000', 115, '2023-04-11 16:56:03.323'); -INSERT INTO `wms_receipt_order` VALUES (538, 'R-2023-04-11-174149', 1, 48, NULL, NULL, 0, NULL, 0, 115, '2023-04-11 17:42:25.000', 115, '2023-04-12 09:12:46.112'); -INSERT INTO `wms_receipt_order` VALUES (539, 'R-2023-04-12-091342', 1, 47, '1111111', NULL, 3, 'test', 0, 115, '2023-04-12 09:14:27.000', 115, '2023-04-12 14:13:07.730'); -INSERT INTO `wms_receipt_order` VALUES (540, 'R-2023-04-12-141326', 1, 51, '12t6y78', NULL, 0, '56789\n', 0, 115, '2023-04-12 14:14:22.052', NULL, NULL); -INSERT INTO `wms_receipt_order` VALUES (541, 'R-2023-04-12-165234', 1, 47, NULL, NULL, 3, NULL, 0, 115, '2023-04-12 16:53:03.000', 115, '2023-04-12 16:54:51.021'); -INSERT INTO `wms_receipt_order` VALUES (542, 'R-2023-04-13-103200', 1, 47, '0001', NULL, 0, NULL, 0, 115, '2023-04-13 10:32:42.814', NULL, NULL); -INSERT INTO `wms_receipt_order` VALUES (543, 'R-2023-04-13-105455', 1, 47, '121212', NULL, 0, NULL, 0, 115, '2023-04-13 10:55:46.911', NULL, NULL); -INSERT INTO `wms_receipt_order` VALUES (544, 'R-2023-04-13-122249', 1, 47, '001', NULL, 3, NULL, 0, 115, '2023-04-13 12:23:19.000', 115, '2023-04-13 12:23:32.732'); -INSERT INTO `wms_receipt_order` VALUES (545, 'R-2023-04-13-134609', 1, 48, '1111', NULL, 3, NULL, 0, 115, '2023-04-13 13:46:44.000', 115, '2023-04-13 13:54:23.429'); -INSERT INTO `wms_receipt_order` VALUES (546, 'R-2023-04-13-135052', 1, 48, '1231231231313', NULL, 3, NULL, 0, 115, '2023-04-13 13:51:17.000', 115, '2023-04-13 13:52:02.653'); -INSERT INTO `wms_receipt_order` VALUES (547, 'R-2023-04-13-135847', 1, 50, NULL, NULL, 0, NULL, 1, 115, '2023-04-13 13:58:59.402', NULL, NULL); -INSERT INTO `wms_receipt_order` VALUES (548, 'R-2023-04-13-140732', 1, 48, 'T202304131407', NULL, 1, NULL, 0, 115, '2023-04-13 14:08:11.000', 115, '2023-04-13 17:43:04.129'); -INSERT INTO `wms_receipt_order` VALUES (549, 'R-2023-04-14-092034', 1, 52, '000054', NULL, 3, NULL, 0, 115, '2023-04-14 09:21:42.000', 115, '2023-04-14 11:23:28.657'); -INSERT INTO `wms_receipt_order` VALUES (550, 'R-2023-04-14-131307', 1, 52, '0008', NULL, NULL, NULL, 0, 115, '2023-04-14 13:13:41.000', 115, '2023-04-14 13:13:58.030'); -INSERT INTO `wms_receipt_order` VALUES (551, 'R-2023-04-14-155105', 1, 52, NULL, NULL, 3, NULL, 0, 115, '2023-04-14 15:52:04.000', 115, '2023-04-14 15:52:52.053'); -INSERT INTO `wms_receipt_order` VALUES (552, 'R-2023-04-14-161943', 1, NULL, NULL, NULL, 0, NULL, 0, 115, '2023-04-14 16:23:49.000', 115, '2023-04-14 17:04:52.313'); -INSERT INTO `wms_receipt_order` VALUES (553, 'R-2023-04-14-175419', 1, 52, NULL, NULL, 0, NULL, 0, 115, '2023-04-14 17:54:54.375', NULL, NULL); -INSERT INTO `wms_receipt_order` VALUES (554, 'R-2023-04-14-175950', 3, 52, '111', NULL, 0, '1111', 1, 115, '2023-04-14 18:00:12.000', 115, '2023-04-14 18:01:22.102'); -INSERT INTO `wms_receipt_order` VALUES (555, 'R-2023-04-15-090831', 1, 52, '001', NULL, 2, '阿萨', 0, 115, '2023-04-15 09:09:26.000', 115, '2023-04-15 09:09:42.357'); -INSERT INTO `wms_receipt_order` VALUES (556, 'R-2023-04-15-094424', 1, 52, '110', NULL, 1, NULL, 0, 115, '2023-04-15 09:44:37.000', 115, '2023-04-15 09:57:02.348'); -INSERT INTO `wms_receipt_order` VALUES (557, 'R-2023-04-15-102637', 1, NULL, '999', NULL, 0, NULL, 0, 115, '2023-04-15 10:27:02.000', 115, '2023-04-15 21:37:15.383'); -INSERT INTO `wms_receipt_order` VALUES (558, 'R-2023-04-15-140641', 1, 52, NULL, NULL, 0, NULL, 0, 115, '2023-04-15 14:06:59.000', 115, '2023-04-15 21:37:09.824'); -INSERT INTO `wms_receipt_order` VALUES (559, 'R-2023-04-15-160043', 1, NULL, NULL, NULL, 0, NULL, 0, 115, '2023-04-15 16:01:10.742', NULL, NULL); -INSERT INTO `wms_receipt_order` VALUES (560, 'R-2023-04-15-162252', 1, NULL, 'xx-111000', NULL, 2, NULL, 0, 115, '2023-04-15 16:23:15.000', 115, '2023-04-15 16:48:15.422'); -INSERT INTO `wms_receipt_order` VALUES (561, 'R-2023-04-15-162643', 1, 52, 'sfsd', NULL, 3, 'dfs', 0, 115, '2023-04-15 16:27:09.000', 115, '2023-04-15 16:27:27.869'); -INSERT INTO `wms_receipt_order` VALUES (562, 'R-2023-04-15-204444', 1, 52, '1212', NULL, 3, '121', 0, 115, '2023-04-15 20:45:17.000', 115, '2023-04-15 20:45:45.175'); -INSERT INTO `wms_receipt_order` VALUES (563, 'R-2023-04-15-230524', 1, 52, NULL, NULL, 0, NULL, 0, 115, '2023-04-15 23:06:47.000', 115, '2023-04-15 23:06:55.173'); -INSERT INTO `wms_receipt_order` VALUES (564, 'R-2023-04-17-094958', 1, 52, 'ds122234452211', NULL, 0, NULL, 0, 115, '2023-04-17 09:51:41.388', NULL, NULL); -INSERT INTO `wms_receipt_order` VALUES (565, 'R-2023-04-17-133037', 1, 52, '2000', NULL, 2, NULL, 0, 115, '2023-04-17 13:31:23.000', 115, '2023-04-17 13:33:54.151'); -INSERT INTO `wms_receipt_order` VALUES (566, 'R-2023-04-17-154127', 1, 52, 'iphone', NULL, 2, NULL, 0, 115, '2023-04-17 15:42:19.000', 115, '2023-04-17 15:43:40.419'); -INSERT INTO `wms_receipt_order` VALUES (567, 'R-2023-04-17-173254', 1, NULL, NULL, NULL, 3, NULL, 0, 115, '2023-04-17 17:33:04.000', 115, '2023-04-19 23:04:23.170'); -INSERT INTO `wms_receipt_order` VALUES (568, 'R-2023-04-18-132602', 1, 52, '556666', NULL, 3, NULL, 0, 115, '2023-04-18 13:26:49.000', 115, '2023-04-18 13:28:06.108'); -INSERT INTO `wms_receipt_order` VALUES (569, 'R-2023-04-18-210337', 1, 52, NULL, NULL, 3, NULL, 0, 115, '2023-04-18 21:04:07.000', 115, '2023-04-19 23:03:23.587'); -INSERT INTO `wms_receipt_order` VALUES (570, 'R-2023-04-18-211542', 1, 52, '莪术胡索', NULL, 0, NULL, 0, 115, '2023-04-18 21:16:17.385', NULL, NULL); -INSERT INTO `wms_receipt_order` VALUES (571, 'R-2023-04-19-092256', 1, 52, NULL, NULL, 3, NULL, 0, 115, '2023-04-19 09:23:48.000', 115, '2023-04-19 09:24:19.790'); -INSERT INTO `wms_receipt_order` VALUES (572, 'R-2023-04-19-144008', 1, NULL, NULL, NULL, 3, NULL, 0, 115, '2023-04-19 14:40:46.000', 115, '2023-04-19 21:07:55.595'); -INSERT INTO `wms_receipt_order` VALUES (573, 'R-2023-04-19-110139', 1, 52, NULL, NULL, 0, NULL, 0, 115, '2023-04-19 23:02:10.908', NULL, NULL); -INSERT INTO `wms_receipt_order` VALUES (574, 'R-2023-04-20-093754', 1, NULL, NULL, NULL, 0, NULL, 0, 115, '2023-04-20 09:38:25.000', 115, '2023-04-20 09:40:28.437'); -INSERT INTO `wms_receipt_order` VALUES (575, 'R-2023-04-20-113035', 1, 52, NULL, NULL, 0, NULL, 0, 115, '2023-04-20 11:31:03.166', NULL, NULL); -INSERT INTO `wms_receipt_order` VALUES (576, 'R-2023-04-20-164905', 3, 52, '', NULL, 0, NULL, 0, 115, '2023-04-20 16:49:30.114', NULL, NULL); -INSERT INTO `wms_receipt_order` VALUES (577, 'R-2023-04-20-201813', 1, 52, '43334', NULL, 0, '3434344343', 0, 115, '2023-04-20 20:18:41.000', 115, '2023-04-21 15:23:39.720'); -INSERT INTO `wms_receipt_order` VALUES (578, 'R-2023-04-20-222713', 1, 52, NULL, NULL, 0, NULL, 0, 115, '2023-04-20 22:27:31.952', NULL, NULL); -INSERT INTO `wms_receipt_order` VALUES (579, 'R-2023-04-21-091131', 1, 52, 'PO123456', NULL, 1, NULL, 0, 115, '2023-04-21 09:12:11.000', 115, '2023-04-22 12:08:39.599'); -INSERT INTO `wms_receipt_order` VALUES (580, 'R-2023-04-21-145553', 2, 52, NULL, NULL, 0, NULL, 0, 115, '2023-04-21 14:56:15.000', 115, '2023-04-21 15:31:49.246'); -INSERT INTO `wms_receipt_order` VALUES (581, 'R-2023-04-21-164531', 1, 52, '1111', NULL, 0, '11', 0, 115, '2023-04-21 16:44:35.555', NULL, NULL); -INSERT INTO `wms_receipt_order` VALUES (582, 'R-2023-04-21-164545', 1, 52, '500', NULL, 0, NULL, 0, 115, '2023-04-21 16:44:55.853', NULL, NULL); -INSERT INTO `wms_receipt_order` VALUES (583, 'R-2023-04-22-145410', 1, 52, 'afaf', NULL, 0, 'adad', 0, 115, '2023-04-22 14:54:41.000', 115, '2023-04-22 21:20:50.514'); -INSERT INTO `wms_receipt_order` VALUES (584, 'R-2023-04-22-191440', 1, NULL, NULL, NULL, 3, NULL, 0, 115, '2023-04-22 19:15:10.000', 115, '2023-04-22 19:15:25.152'); -INSERT INTO `wms_receipt_order` VALUES (585, 'R-2023-04-22-191619', 1, 52, NULL, NULL, 3, NULL, 0, 115, '2023-04-22 19:16:52.000', 115, '2023-04-22 19:17:01.755'); -INSERT INTO `wms_receipt_order` VALUES (586, 'R-2023-04-22-211946', 3, 52, NULL, NULL, 2, NULL, 0, 115, '2023-04-22 21:20:23.000', 115, '2023-04-23 14:01:12.846'); -INSERT INTO `wms_receipt_order` VALUES (587, 'R-2023-04-23-135017', 1, 52, '202304231450', NULL, 0, NULL, 0, 115, '2023-04-23 13:50:51.000', 115, '2023-04-23 13:52:04.235'); -INSERT INTO `wms_receipt_order` VALUES (588, 'R-2023-04-23-143509', 1, 52, '20230423', NULL, 0, NULL, 0, 115, '2023-04-23 14:35:47.000', 115, '2023-04-23 16:58:36.362'); -INSERT INTO `wms_receipt_order` VALUES (589, 'R-2023-04-24-093736', 1, 52, '111', NULL, 0, NULL, 0, 115, '2023-04-24 09:38:32.561', NULL, NULL); -INSERT INTO `wms_receipt_order` VALUES (590, 'R-2023-04-24-102509', 1, 52, '2342yte343458', NULL, 0, '4566', 0, 115, '2023-04-24 10:27:16.000', 115, '2023-04-24 14:24:33.274'); -INSERT INTO `wms_receipt_order` VALUES (591, 'R-2023-04-24-103436', 1, 52, NULL, NULL, 3, NULL, 0, 115, '2023-04-24 10:35:21.000', 115, '2023-04-24 10:35:48.451'); -INSERT INTO `wms_receipt_order` VALUES (592, 'R-2023-04-24-153509', 1, 52, '12123132', NULL, 3, '123123', 0, 115, '2023-04-24 15:35:31.000', 115, '2023-04-24 15:36:26.683'); -INSERT INTO `wms_receipt_order` VALUES (593, 'R-2023-04-24-154707', 1, 52, '212132', NULL, 0, '76trytrr756', 0, 115, '2023-04-24 16:03:04.131', NULL, NULL); -INSERT INTO `wms_receipt_order` VALUES (594, 'R-2023-04-25-110948', 1, 52, NULL, NULL, 3, NULL, 0, 115, '2023-04-25 11:10:43.000', 115, '2023-04-29 13:56:40.366'); -INSERT INTO `wms_receipt_order` VALUES (595, 'R-2023-04-25-144508', 1, 52, NULL, NULL, 3, NULL, 0, 115, '2023-04-25 14:46:57.000', 115, '2023-04-25 14:56:10.813'); -INSERT INTO `wms_receipt_order` VALUES (596, 'R-2023-04-25-153614', 1, 52, NULL, NULL, 0, NULL, 1, 115, '2023-04-25 15:36:50.398', NULL, NULL); -INSERT INTO `wms_receipt_order` VALUES (597, 'R-2023-04-25-155353', 1, 52, '12312', NULL, 3, 'aaaaaaaaaaaaaaaaafffffffffffffffff', 0, 115, '2023-04-25 15:54:16.000', 115, '2023-04-25 15:54:34.276'); -INSERT INTO `wms_receipt_order` VALUES (598, 'R-2023-04-25-164843', 1, NULL, '222222222,', NULL, 3, NULL, 0, 115, '2023-04-25 16:52:53.000', 115, '2023-04-26 11:05:08.748'); -INSERT INTO `wms_receipt_order` VALUES (599, 'R-2023-04-25-183027', 1, 52, '1212', NULL, 3, NULL, 0, 115, '2023-04-25 18:30:46.000', 115, '2023-04-25 18:32:41.346'); -INSERT INTO `wms_receipt_order` VALUES (600, 'R-2023-04-26-170434', 1, 52, '123', NULL, 0, '123', 0, 115, '2023-04-26 17:09:11.000', 115, '2023-04-27 18:36:04.748'); -INSERT INTO `wms_receipt_order` VALUES (601, 'R-2023-04-26-171740', 1, NULL, NULL, NULL, 3, NULL, 1, 115, '2023-04-26 17:17:27.000', 115, '2023-04-26 17:17:59.220'); -INSERT INTO `wms_receipt_order` VALUES (602, 'R-2023-04-26-171718', 1, 52, '手打订单号', 0.00, 0, 'textarea测试', 0, 115, '2023-04-26 17:17:36.000', 115, '2023-04-30 22:24:55.498'); -INSERT INTO `wms_receipt_order` VALUES (603, 'R-2023-04-28-151535', 1, NULL, NULL, NULL, 0, NULL, 0, 1, '2023-04-28 15:20:58.779', NULL, NULL); -INSERT INTO `wms_receipt_order` VALUES (609, 'R-2023-04-28-174905', 1, 52, '1111111111', 111.00, 0, '11111111111111111111111111111111111111111111111111111111111111', 0, 1, '2023-04-28 17:50:28.000', 115, '2023-04-29 13:56:10.481'); -INSERT INTO `wms_receipt_order` VALUES (610, 'R-2023-04-29-171402', 1, NULL, NULL, 222.00, 0, NULL, 0, 115, '2023-04-29 17:14:23.153', NULL, NULL); -INSERT INTO `wms_receipt_order` VALUES (611, 'R-2023-04-30-152334', 1, 52, '1', 5.00, 3, NULL, 0, 115, '2023-04-30 15:24:48.000', 115, '2023-04-30 16:33:48.759'); -INSERT INTO `wms_receipt_order` VALUES (612, 'R-2023-04-30-164132', 1, NULL, NULL, NULL, 0, NULL, 0, 115, '2023-04-30 16:43:13.849', NULL, NULL); -INSERT INTO `wms_receipt_order` VALUES (613, 'R-2023-05-01-041559', 1, 52, '6666', 6.66, 0, '66666', 0, 115, '2023-05-01 04:16:23.532', NULL, NULL); -INSERT INTO `wms_receipt_order` VALUES (614, 'R-2023-05-01-045400', 2, 52, '555555', 2.00, 0, '5555555588', 0, 115, '2023-05-01 04:54:53.000', 115, '2023-05-01 23:17:49.494'); -INSERT INTO `wms_receipt_order` VALUES (615, 'R-2023-05-02-000747', 1, 52, '手殴打', 1.00, 0, NULL, 0, 115, '2023-05-02 00:07:58.078', NULL, NULL); -INSERT INTO `wms_receipt_order` VALUES (616, 'R-2023-05-02-155915', 1, 52, NULL, 11.00, 0, NULL, 0, 115, '2023-05-02 15:59:42.959', NULL, NULL); -INSERT INTO `wms_receipt_order` VALUES (617, 'R-2023-05-03-033206', 1, 52, NULL, 3.00, 0, NULL, 1, 115, '2023-05-03 03:32:40.703', NULL, NULL); -INSERT INTO `wms_receipt_order` VALUES (618, 'R-2023-05-03-033259', 1, 52, '666666666', 2.00, 0, NULL, 0, 115, '2023-05-03 03:33:36.397', NULL, NULL); -INSERT INTO `wms_receipt_order` VALUES (619, 'R-2023-05-03-033345', 1, 52, '88888888888', 1.00, 0, '888888888888888888', 0, 115, '2023-05-03 03:34:15.921', NULL, NULL); -INSERT INTO `wms_receipt_order` VALUES (620, 'R-2023-05-03-110802', 1, 52, NULL, 1.00, 0, NULL, 0, 115, '2023-05-03 11:08:37.000', 115, '2023-05-04 13:35:26.405'); -INSERT INTO `wms_receipt_order` VALUES (621, 'R-2023-05-04-103434', 1, 52, NULL, 11.00, 3, NULL, 0, 115, '2023-05-04 10:35:16.000', 115, '2023-05-04 10:35:32.651'); -INSERT INTO `wms_receipt_order` VALUES (622, 'R-2023-05-04-105751', 1, NULL, NULL, NULL, 0, NULL, 0, 115, '2023-05-04 10:57:52.438', NULL, NULL); -INSERT INTO `wms_receipt_order` VALUES (624, 'R-2023-05-04-135306', 1, 52, '123456', 10.00, 0, '113231231', 0, 1, '2023-05-04 13:53:24.617', NULL, NULL); -INSERT INTO `wms_receipt_order` VALUES (625, 'R-2023-05-04-164043', 1, 52, '234233', 700000.00, 3, 'ruku', 0, 115, '2023-05-04 16:41:24.000', 115, '2023-05-04 16:41:42.011'); - --- ---------------------------- --- Table structure for wms_receipt_order_detail --- ---------------------------- -DROP TABLE IF EXISTS `wms_receipt_order_detail`; -CREATE TABLE `wms_receipt_order_detail` ( - `id` bigint(20) NOT NULL AUTO_INCREMENT, - `receipt_order_id` bigint(20) NULL DEFAULT NULL COMMENT '入库单号', - `item_id` bigint(20) NULL DEFAULT NULL COMMENT '物料', - `plan_quantity` decimal(20, 2) NULL DEFAULT NULL COMMENT '计划数量', - `real_quantity` decimal(20, 2) NULL DEFAULT NULL COMMENT '实际数量', - `rack_id` bigint(20) NULL DEFAULT NULL COMMENT '所属货架', - `money` decimal(10, 2) NULL DEFAULT NULL COMMENT '金额', - `del_flag` tinyint(4) NOT NULL DEFAULT 0 COMMENT '删除标识', - `remark` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '备注', - `create_by` bigint(20) NULL DEFAULT NULL COMMENT '创建人', - `create_time` datetime(3) NULL DEFAULT NULL COMMENT '创建时间', - `update_by` bigint(20) NULL DEFAULT NULL COMMENT '修改人', - `update_time` datetime(3) NULL DEFAULT NULL COMMENT '修改时间', - `warehouse_id` bigint(20) NULL DEFAULT NULL COMMENT '所属仓库', - `area_id` bigint(20) NULL DEFAULT NULL COMMENT '所属库区', - `receipt_order_status` tinyint(4) NULL DEFAULT NULL COMMENT '入库状态', - PRIMARY KEY (`id`) USING BTREE -) ENGINE = InnoDB AUTO_INCREMENT = 2642 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '入库单详情' ROW_FORMAT = Dynamic; - --- ---------------------------- --- Records of wms_receipt_order_detail --- ---------------------------- -INSERT INTO `wms_receipt_order_detail` VALUES (184, 9, 1, 1000.00, 10.00, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, 1, 13, 3); -INSERT INTO `wms_receipt_order_detail` VALUES (185, 9, 2, 1000.00, 1.00, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, 1, 13, 2); -INSERT INTO `wms_receipt_order_detail` VALUES (190, 8, 1, 200.00, 20.00, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 2); -INSERT INTO `wms_receipt_order_detail` VALUES (191, 8, 2, 200.00, 1.00, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0); -INSERT INTO `wms_receipt_order_detail` VALUES (204, 11, 1, 15.00, 14.00, 1, NULL, 0, NULL, NULL, NULL, NULL, NULL, 1, 13, 2); -INSERT INTO `wms_receipt_order_detail` VALUES (205, 11, 2, 15.00, 14.00, 6, NULL, 0, NULL, NULL, NULL, NULL, NULL, 2, 18, 2); -INSERT INTO `wms_receipt_order_detail` VALUES (218, 12, 1, 10.00, 3.00, 5, NULL, 0, NULL, NULL, NULL, NULL, NULL, 1, 13, 2); -INSERT INTO `wms_receipt_order_detail` VALUES (219, 12, 2, 10.00, 3.00, 1, NULL, 0, NULL, NULL, NULL, NULL, NULL, 1, 13, 2); -INSERT INTO `wms_receipt_order_detail` VALUES (228, 7, 1, 10000.00, NULL, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, 1, NULL, 0); -INSERT INTO `wms_receipt_order_detail` VALUES (229, 7, 2, 10000.00, NULL, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, 1, NULL, 0); -INSERT INTO `wms_receipt_order_detail` VALUES (248, 13, 1, 10.00, 10.00, 1, NULL, 0, NULL, NULL, NULL, NULL, NULL, 1, 13, 2); -INSERT INTO `wms_receipt_order_detail` VALUES (249, 13, 2, 10.00, 6.00, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, 3, 16, 2); -INSERT INTO `wms_receipt_order_detail` VALUES (256, 16, 1, 1.00, 1.00, 7, NULL, 0, NULL, NULL, NULL, NULL, NULL, 3, 16, 2); -INSERT INTO `wms_receipt_order_detail` VALUES (268, 19, 1, 5.00, 5.00, 8, NULL, 0, NULL, NULL, NULL, NULL, NULL, 20, 42, 3); -INSERT INTO `wms_receipt_order_detail` VALUES (269, 19, 2, 8.00, 8.00, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, 20, 41, 3); -INSERT INTO `wms_receipt_order_detail` VALUES (270, 18, 1, 1.00, 12.00, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, 1, 13, 0); -INSERT INTO `wms_receipt_order_detail` VALUES (271, 14, 1, 1.00, 5.00, 1, NULL, 0, NULL, NULL, NULL, NULL, NULL, 1, 13, 3); -INSERT INTO `wms_receipt_order_detail` VALUES (272, 14, 2, 1.00, 1.00, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, 2, 18, 3); -INSERT INTO `wms_receipt_order_detail` VALUES (273, 15, 1, 2.00, 1.00, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, 4, NULL, 1); -INSERT INTO `wms_receipt_order_detail` VALUES (274, 21, 2, 1.00, NULL, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, 3, 14, 0); -INSERT INTO `wms_receipt_order_detail` VALUES (284, 22, 1, 6.00, 6.00, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, 1, 13, 3); -INSERT INTO `wms_receipt_order_detail` VALUES (285, 22, 2, 3.00, 1.00, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, 2, 18, 3); -INSERT INTO `wms_receipt_order_detail` VALUES (288, 23, 1, 3.00, 1.00, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, 3, 14, 3); -INSERT INTO `wms_receipt_order_detail` VALUES (289, 25, 1, 1000.00, NULL, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, 2, 17, 0); -INSERT INTO `wms_receipt_order_detail` VALUES (290, 25, 2, 1.00, NULL, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0); -INSERT INTO `wms_receipt_order_detail` VALUES (291, 25, 3, 1.00, NULL, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0); -INSERT INTO `wms_receipt_order_detail` VALUES (292, 25, 4, 1.00, NULL, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0); -INSERT INTO `wms_receipt_order_detail` VALUES (293, 26, 1, 1.00, NULL, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0); -INSERT INTO `wms_receipt_order_detail` VALUES (294, 26, 2, 1.00, NULL, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0); -INSERT INTO `wms_receipt_order_detail` VALUES (296, 28, 1, 3.00, 4.00, 4, NULL, 0, NULL, NULL, NULL, NULL, NULL, 4, 14, 0); -INSERT INTO `wms_receipt_order_detail` VALUES (301, 29, 5, 5.00, 1.00, 6, NULL, 0, NULL, NULL, NULL, NULL, NULL, 2, 18, 3); -INSERT INTO `wms_receipt_order_detail` VALUES (320, 31, 7, 500.00, 600.00, 9, NULL, 0, NULL, NULL, NULL, NULL, NULL, 21, 43, 3); -INSERT INTO `wms_receipt_order_detail` VALUES (321, 31, 8, 100.00, 200.00, 11, NULL, 0, NULL, NULL, NULL, NULL, NULL, 21, 44, 3); -INSERT INTO `wms_receipt_order_detail` VALUES (322, 32, 4, 3.00, NULL, 1, NULL, 0, NULL, NULL, NULL, NULL, NULL, 2, 17, 0); -INSERT INTO `wms_receipt_order_detail` VALUES (323, 32, 5, 3.00, NULL, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0); -INSERT INTO `wms_receipt_order_detail` VALUES (324, 32, 1, 1.00, NULL, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0); -INSERT INTO `wms_receipt_order_detail` VALUES (325, 32, 10, 1.00, NULL, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0); -INSERT INTO `wms_receipt_order_detail` VALUES (356, 33, 1, 2.00, 1.00, 17, NULL, 0, NULL, NULL, NULL, NULL, NULL, 25, 50, 3); -INSERT INTO `wms_receipt_order_detail` VALUES (357, 33, 2, 2.00, 1.00, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, 2, 18, 3); -INSERT INTO `wms_receipt_order_detail` VALUES (358, 33, 3, 2.00, 1.00, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, 3, 14, 3); -INSERT INTO `wms_receipt_order_detail` VALUES (359, 33, 4, 1.00, 1.00, 1, NULL, 0, NULL, NULL, NULL, NULL, NULL, 2, 17, 3); -INSERT INTO `wms_receipt_order_detail` VALUES (360, 33, 5, 1.00, 1.00, 6, NULL, 0, NULL, NULL, NULL, NULL, NULL, 2, 18, 3); -INSERT INTO `wms_receipt_order_detail` VALUES (361, 33, 6, 1.00, 1.00, 1, NULL, 0, NULL, NULL, NULL, NULL, NULL, 2, 17, 3); -INSERT INTO `wms_receipt_order_detail` VALUES (362, 33, 7, 1.00, 1.00, 9, NULL, 0, NULL, NULL, NULL, NULL, NULL, 21, 43, 3); -INSERT INTO `wms_receipt_order_detail` VALUES (363, 33, 8, 1.00, 1.00, 11, NULL, 0, NULL, NULL, NULL, NULL, NULL, 21, 44, 3); -INSERT INTO `wms_receipt_order_detail` VALUES (364, 33, 9, 1.00, 1.00, 12, NULL, 0, NULL, NULL, NULL, NULL, NULL, 22, 46, 3); -INSERT INTO `wms_receipt_order_detail` VALUES (365, 33, 10, 1.00, 1.00, 14, NULL, 0, NULL, NULL, NULL, NULL, NULL, 23, 47, 3); -INSERT INTO `wms_receipt_order_detail` VALUES (366, 34, 12, 1.00, NULL, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0); -INSERT INTO `wms_receipt_order_detail` VALUES (368, 35, 12, 1.00, 1.00, 17, NULL, 0, NULL, NULL, NULL, NULL, NULL, 25, 50, 2); -INSERT INTO `wms_receipt_order_detail` VALUES (375, 36, 12, 1.00, 1.00, 17, NULL, 0, NULL, NULL, NULL, NULL, NULL, 25, 50, 1); -INSERT INTO `wms_receipt_order_detail` VALUES (376, 36, 13, 1.00, 1.00, 4, NULL, 0, NULL, NULL, NULL, NULL, NULL, 4, 14, 3); -INSERT INTO `wms_receipt_order_detail` VALUES (380, 39, 12, 1.00, NULL, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0); -INSERT INTO `wms_receipt_order_detail` VALUES (381, 37, 12, 1.00, 1.00, 1, NULL, 0, NULL, NULL, NULL, NULL, NULL, 2, 17, 1); -INSERT INTO `wms_receipt_order_detail` VALUES (382, 37, 13, 1.00, 1.00, 1, NULL, 0, NULL, NULL, NULL, NULL, NULL, 2, 17, 0); -INSERT INTO `wms_receipt_order_detail` VALUES (383, 38, 12, 3.00, 1.00, 17, NULL, 0, NULL, NULL, NULL, NULL, NULL, 25, 50, 1); -INSERT INTO `wms_receipt_order_detail` VALUES (385, 40, 13, 1.00, 1.00, 4, NULL, 0, NULL, NULL, NULL, NULL, NULL, 4, 14, 1); -INSERT INTO `wms_receipt_order_detail` VALUES (386, 41, 12, 1.00, NULL, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, 2, NULL, 0); -INSERT INTO `wms_receipt_order_detail` VALUES (393, 42, 12, 1.00, 1.00, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, 2, 44, 3); -INSERT INTO `wms_receipt_order_detail` VALUES (394, 42, 13, 1.00, 1.00, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, 2, 44, 3); -INSERT INTO `wms_receipt_order_detail` VALUES (395, 42, 14, 1.00, 1.00, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, 2, 44, 3); -INSERT INTO `wms_receipt_order_detail` VALUES (399, 43, 12, 2.00, NULL, 13, NULL, 0, NULL, NULL, NULL, NULL, NULL, 2, 44, 0); -INSERT INTO `wms_receipt_order_detail` VALUES (400, 43, 13, 1.00, NULL, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0); -INSERT INTO `wms_receipt_order_detail` VALUES (401, 43, 14, 1.00, NULL, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0); -INSERT INTO `wms_receipt_order_detail` VALUES (402, 45, 13, 17.00, NULL, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, 4, NULL, 0); -INSERT INTO `wms_receipt_order_detail` VALUES (403, 46, 12, 1.00, NULL, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0); -INSERT INTO `wms_receipt_order_detail` VALUES (404, 46, 13, 1.00, NULL, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0); -INSERT INTO `wms_receipt_order_detail` VALUES (406, 47, 12, 1.00, 1.00, 17, NULL, 0, NULL, NULL, NULL, NULL, NULL, 25, 50, 1); -INSERT INTO `wms_receipt_order_detail` VALUES (409, 48, 17, 50.00, 1.00, 13, NULL, 0, NULL, NULL, NULL, NULL, NULL, 2, 44, 3); -INSERT INTO `wms_receipt_order_detail` VALUES (410, 49, 12, 1.00, NULL, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0); -INSERT INTO `wms_receipt_order_detail` VALUES (417, 44, 12, 4.00, 1.00, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, 4, NULL, 3); -INSERT INTO `wms_receipt_order_detail` VALUES (418, 44, 13, 4.00, 1.00, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, 14, NULL, 2); -INSERT INTO `wms_receipt_order_detail` VALUES (419, 44, 14, 1.00, 1.00, 13, NULL, 0, NULL, NULL, NULL, NULL, NULL, 2, 44, 2); -INSERT INTO `wms_receipt_order_detail` VALUES (430, 50, 12, 1.00, 3.00, 13, NULL, 0, NULL, NULL, NULL, NULL, NULL, 2, 44, 3); -INSERT INTO `wms_receipt_order_detail` VALUES (431, 50, 13, 1.00, 1.00, 13, NULL, 0, NULL, NULL, NULL, NULL, NULL, 2, 44, 3); -INSERT INTO `wms_receipt_order_detail` VALUES (432, 51, 12, 1.00, NULL, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0); -INSERT INTO `wms_receipt_order_detail` VALUES (433, 51, 13, 1.00, NULL, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0); -INSERT INTO `wms_receipt_order_detail` VALUES (444, 54, 20, 20.00, 20.00, 13, NULL, 0, NULL, NULL, NULL, NULL, NULL, 2, 44, 3); -INSERT INTO `wms_receipt_order_detail` VALUES (452, 56, 12, 3.00, 3.00, 13, NULL, 0, NULL, NULL, NULL, NULL, NULL, 2, 44, 3); -INSERT INTO `wms_receipt_order_detail` VALUES (453, 53, 20, 1.00, 4.00, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, 4, NULL, 3); -INSERT INTO `wms_receipt_order_detail` VALUES (456, 57, 21, 2000.00, 2000.00, 20, NULL, 0, NULL, NULL, NULL, NULL, NULL, 27, 52, 3); -INSERT INTO `wms_receipt_order_detail` VALUES (457, 58, 12, 4.00, NULL, 19, NULL, 0, NULL, NULL, NULL, NULL, NULL, 14, 46, 0); -INSERT INTO `wms_receipt_order_detail` VALUES (458, 55, 20, 30.00, 29.00, 13, NULL, 0, NULL, NULL, NULL, NULL, NULL, 2, 44, 3); -INSERT INTO `wms_receipt_order_detail` VALUES (459, 52, 12, 2.00, 1.00, 17, NULL, 0, NULL, NULL, NULL, NULL, NULL, 25, 50, 0); -INSERT INTO `wms_receipt_order_detail` VALUES (460, 52, 14, 1.00, 1.00, 18, NULL, 0, NULL, NULL, NULL, NULL, NULL, 26, 51, 0); -INSERT INTO `wms_receipt_order_detail` VALUES (463, 59, 12, 22.00, NULL, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, 14, 53, 0); -INSERT INTO `wms_receipt_order_detail` VALUES (464, 59, 13, 13.00, NULL, 20, NULL, 0, NULL, NULL, NULL, NULL, NULL, 27, 52, 0); -INSERT INTO `wms_receipt_order_detail` VALUES (465, 60, 14, 1.00, NULL, 13, NULL, 0, NULL, NULL, NULL, NULL, NULL, 2, 44, 0); -INSERT INTO `wms_receipt_order_detail` VALUES (475, 61, 13, 1.00, NULL, 21, NULL, 0, NULL, NULL, NULL, NULL, NULL, 2, 45, 0); -INSERT INTO `wms_receipt_order_detail` VALUES (476, 61, 15, 1.00, NULL, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0); -INSERT INTO `wms_receipt_order_detail` VALUES (477, 61, 16, 1.00, NULL, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0); -INSERT INTO `wms_receipt_order_detail` VALUES (478, 61, 17, 1.00, NULL, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0); -INSERT INTO `wms_receipt_order_detail` VALUES (479, 61, 18, 1.00, NULL, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0); -INSERT INTO `wms_receipt_order_detail` VALUES (480, 61, 19, 1.00, NULL, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0); -INSERT INTO `wms_receipt_order_detail` VALUES (481, 61, 20, 1.00, NULL, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0); -INSERT INTO `wms_receipt_order_detail` VALUES (482, 61, 21, 1.00, NULL, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0); -INSERT INTO `wms_receipt_order_detail` VALUES (525, 62, 17, 1.00, 1.00, 13, NULL, 0, NULL, NULL, NULL, NULL, NULL, 2, 44, 4); -INSERT INTO `wms_receipt_order_detail` VALUES (526, 62, 18, 1.00, 1.00, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, 4, NULL, 4); -INSERT INTO `wms_receipt_order_detail` VALUES (527, 62, 19, 1.00, 1.00, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, 14, 53, 4); -INSERT INTO `wms_receipt_order_detail` VALUES (534, 67, 13, 1.00, 1.00, 4, NULL, 0, NULL, NULL, NULL, NULL, NULL, 4, 14, 3); -INSERT INTO `wms_receipt_order_detail` VALUES (535, 66, 14, 1.00, 1.00, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, 4, NULL, 2); -INSERT INTO `wms_receipt_order_detail` VALUES (536, 65, 13, 1.00, 1.00, 19, NULL, 0, NULL, NULL, NULL, NULL, NULL, 14, 46, 1); -INSERT INTO `wms_receipt_order_detail` VALUES (538, 63, 13, 1.00, 1.00, 4, NULL, 0, NULL, NULL, NULL, NULL, NULL, 4, 14, 4); -INSERT INTO `wms_receipt_order_detail` VALUES (539, 63, 14, 1.00, 1.00, 18, NULL, 0, NULL, NULL, NULL, NULL, NULL, 26, 51, 4); -INSERT INTO `wms_receipt_order_detail` VALUES (540, 63, 16, 1.00, 1.00, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 4); -INSERT INTO `wms_receipt_order_detail` VALUES (541, 63, 17, 1.00, 1.00, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 4); -INSERT INTO `wms_receipt_order_detail` VALUES (542, 63, 18, 1.00, 1.00, 13, NULL, 0, NULL, NULL, NULL, NULL, NULL, 2, 44, 4); -INSERT INTO `wms_receipt_order_detail` VALUES (543, 63, 19, 1.00, 1.00, 13, NULL, 0, NULL, NULL, NULL, NULL, NULL, 2, 44, 4); -INSERT INTO `wms_receipt_order_detail` VALUES (544, 63, 20, 1.00, 1.00, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 4); -INSERT INTO `wms_receipt_order_detail` VALUES (545, 63, 21, 1.00, 1.00, 20, NULL, 0, NULL, NULL, NULL, NULL, NULL, 27, 52, 4); -INSERT INTO `wms_receipt_order_detail` VALUES (552, 68, 14, 1.00, 9.00, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, 4, NULL, 2); -INSERT INTO `wms_receipt_order_detail` VALUES (553, 68, 15, 1.00, 8.00, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 2); -INSERT INTO `wms_receipt_order_detail` VALUES (563, 64, 16, 1.00, 1.00, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 3); -INSERT INTO `wms_receipt_order_detail` VALUES (564, 64, 17, 1.00, 1.00, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0); -INSERT INTO `wms_receipt_order_detail` VALUES (565, 64, 18, 1.00, 1.00, 13, NULL, 0, NULL, NULL, NULL, NULL, NULL, 2, 44, 0); -INSERT INTO `wms_receipt_order_detail` VALUES (575, 69, 20, 12.00, 1.00, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 3); -INSERT INTO `wms_receipt_order_detail` VALUES (576, 69, 21, 12.00, 1.00, 20, NULL, 0, NULL, NULL, NULL, NULL, NULL, 27, 52, 4); -INSERT INTO `wms_receipt_order_detail` VALUES (577, 69, 22, 12.00, 1.00, 13, NULL, 0, NULL, NULL, NULL, NULL, NULL, 2, 44, 4); -INSERT INTO `wms_receipt_order_detail` VALUES (584, 72, 13, 1.00, 1.00, 13, NULL, 0, NULL, NULL, NULL, NULL, NULL, 2, 44, 3); -INSERT INTO `wms_receipt_order_detail` VALUES (585, 72, 14, 1.00, 1.00, 13, NULL, 0, NULL, NULL, NULL, NULL, NULL, 2, 44, 3); -INSERT INTO `wms_receipt_order_detail` VALUES (586, 73, 13, 3.00, NULL, 13, NULL, 0, NULL, NULL, NULL, NULL, NULL, 2, 44, 0); -INSERT INTO `wms_receipt_order_detail` VALUES (587, 73, 14, 1.00, NULL, 13, NULL, 0, NULL, NULL, NULL, NULL, NULL, 2, 44, 0); -INSERT INTO `wms_receipt_order_detail` VALUES (588, 70, 13, 4.00, 1.00, 13, NULL, 0, NULL, NULL, NULL, NULL, NULL, 2, 44, 3); -INSERT INTO `wms_receipt_order_detail` VALUES (592, 75, 18, 1.00, 1.00, 13, NULL, 0, NULL, NULL, NULL, NULL, NULL, 2, 44, 3); -INSERT INTO `wms_receipt_order_detail` VALUES (593, 75, 21, 1.00, 1.00, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, 14, 53, 3); -INSERT INTO `wms_receipt_order_detail` VALUES (594, 75, 22, 1.00, 1.00, 20, NULL, 0, NULL, NULL, NULL, NULL, NULL, 27, 52, 3); -INSERT INTO `wms_receipt_order_detail` VALUES (596, 76, 13, 8.00, 1.00, 19, NULL, 0, NULL, NULL, NULL, NULL, NULL, 14, 46, 0); -INSERT INTO `wms_receipt_order_detail` VALUES (601, 78, 13, 7.00, 1.00, 4, NULL, 0, NULL, NULL, NULL, NULL, NULL, 4, 14, 3); -INSERT INTO `wms_receipt_order_detail` VALUES (602, 78, 14, 1.00, 1.00, 18, NULL, 0, NULL, NULL, NULL, NULL, NULL, 26, 51, 3); -INSERT INTO `wms_receipt_order_detail` VALUES (603, 78, 20, 1.00, 1.00, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 3); -INSERT INTO `wms_receipt_order_detail` VALUES (609, 77, 13, 1.00, NULL, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0); -INSERT INTO `wms_receipt_order_detail` VALUES (612, 80, 19, 1.00, NULL, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, 2, 54, 0); -INSERT INTO `wms_receipt_order_detail` VALUES (613, 81, 13, 1.00, NULL, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0); -INSERT INTO `wms_receipt_order_detail` VALUES (614, 81, 14, 1.00, NULL, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0); -INSERT INTO `wms_receipt_order_detail` VALUES (615, 81, 15, 1.00, NULL, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0); -INSERT INTO `wms_receipt_order_detail` VALUES (616, 81, 16, 1.00, NULL, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0); -INSERT INTO `wms_receipt_order_detail` VALUES (617, 81, 17, 1.00, NULL, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0); -INSERT INTO `wms_receipt_order_detail` VALUES (618, 81, 18, 1.00, NULL, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0); -INSERT INTO `wms_receipt_order_detail` VALUES (619, 81, 19, 1.00, NULL, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0); -INSERT INTO `wms_receipt_order_detail` VALUES (620, 81, 20, 1.00, NULL, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0); -INSERT INTO `wms_receipt_order_detail` VALUES (621, 81, 21, 1.00, NULL, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0); -INSERT INTO `wms_receipt_order_detail` VALUES (622, 81, 22, 1.00, NULL, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0); -INSERT INTO `wms_receipt_order_detail` VALUES (623, 82, 14, 1.00, NULL, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, 2, 54, 0); -INSERT INTO `wms_receipt_order_detail` VALUES (624, 84, 13, 1.00, NULL, 21, NULL, 0, NULL, NULL, NULL, NULL, NULL, 2, 45, 0); -INSERT INTO `wms_receipt_order_detail` VALUES (625, 84, 14, 1.00, NULL, 20, NULL, 0, NULL, NULL, NULL, NULL, NULL, 27, 52, 0); -INSERT INTO `wms_receipt_order_detail` VALUES (632, 87, 14, 1.00, 1.00, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, 2, NULL, 0); -INSERT INTO `wms_receipt_order_detail` VALUES (633, 87, 18, 1.00, 1.00, 14, NULL, 0, NULL, NULL, NULL, NULL, NULL, 14, 46, 0); -INSERT INTO `wms_receipt_order_detail` VALUES (634, 87, 19, 1.00, 1.00, 13, NULL, 0, NULL, NULL, NULL, NULL, NULL, 2, 44, 0); -INSERT INTO `wms_receipt_order_detail` VALUES (635, 88, 14, 1.00, NULL, 21, NULL, 0, NULL, NULL, NULL, NULL, NULL, 2, 45, 0); -INSERT INTO `wms_receipt_order_detail` VALUES (636, 88, 13, 1.00, NULL, 21, NULL, 0, NULL, NULL, NULL, NULL, NULL, 2, 45, 0); -INSERT INTO `wms_receipt_order_detail` VALUES (640, 89, 13, 1.00, 1.00, 13, NULL, 0, NULL, NULL, NULL, NULL, NULL, 2, 45, 3); -INSERT INTO `wms_receipt_order_detail` VALUES (641, 90, 16, 1.00, NULL, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, 2, 45, 0); -INSERT INTO `wms_receipt_order_detail` VALUES (642, 90, 17, 1.00, NULL, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, 2, 45, 0); -INSERT INTO `wms_receipt_order_detail` VALUES (643, 90, 18, 1.00, NULL, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, 2, 45, 0); -INSERT INTO `wms_receipt_order_detail` VALUES (644, 90, 19, 1.00, NULL, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, 2, 45, 0); -INSERT INTO `wms_receipt_order_detail` VALUES (648, 91, 13, 6.00, 1.00, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, 4, NULL, 3); -INSERT INTO `wms_receipt_order_detail` VALUES (649, 92, 13, 4.00, NULL, 22, NULL, 0, NULL, NULL, NULL, NULL, NULL, 2, 45, 0); -INSERT INTO `wms_receipt_order_detail` VALUES (650, 92, 14, 1.00, NULL, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, 14, 53, 0); -INSERT INTO `wms_receipt_order_detail` VALUES (651, 92, 15, 1.00, NULL, 14, NULL, 0, NULL, NULL, NULL, NULL, NULL, 14, 46, 0); -INSERT INTO `wms_receipt_order_detail` VALUES (653, 93, 28, 3.00, 5.00, 13, NULL, 0, NULL, NULL, NULL, NULL, NULL, 2, 45, 3); -INSERT INTO `wms_receipt_order_detail` VALUES (662, 96, 13, 132.00, 132.00, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, 4, 54, 3); -INSERT INTO `wms_receipt_order_detail` VALUES (673, 94, 13, 1.00, 1.00, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, 14, 46, 3); -INSERT INTO `wms_receipt_order_detail` VALUES (674, 94, 17, 1.00, 1.00, 14, NULL, 0, NULL, NULL, NULL, NULL, NULL, 14, 46, 3); -INSERT INTO `wms_receipt_order_detail` VALUES (675, 79, 13, 1.00, 1.00, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, 4, 54, 3); -INSERT INTO `wms_receipt_order_detail` VALUES (676, 79, 14, 1.00, 1.00, 21, NULL, 0, NULL, NULL, NULL, NULL, NULL, 2, 45, 1); -INSERT INTO `wms_receipt_order_detail` VALUES (677, 97, 28, 100.00, 100.00, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, 4, 54, 3); -INSERT INTO `wms_receipt_order_detail` VALUES (678, 97, 27, 20.00, 20.00, 14, NULL, 0, NULL, NULL, NULL, NULL, NULL, 14, 46, 3); -INSERT INTO `wms_receipt_order_detail` VALUES (697, 99, 14, 1.00, 1.00, 18, NULL, 0, NULL, NULL, NULL, NULL, NULL, 26, 51, 3); -INSERT INTO `wms_receipt_order_detail` VALUES (698, 99, 15, 1.00, 1.00, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 4); -INSERT INTO `wms_receipt_order_detail` VALUES (699, 99, 17, 1.00, 1.00, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 3); -INSERT INTO `wms_receipt_order_detail` VALUES (700, 100, 13, 1.00, NULL, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0); -INSERT INTO `wms_receipt_order_detail` VALUES (703, 101, 13, 10.00, 1.00, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, 4, 54, 3); -INSERT INTO `wms_receipt_order_detail` VALUES (705, 102, 19, 6.00, 1.00, 13, NULL, 0, NULL, NULL, NULL, NULL, NULL, 2, 44, 3); -INSERT INTO `wms_receipt_order_detail` VALUES (706, 103, 13, 5.00, NULL, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, 4, 54, 0); -INSERT INTO `wms_receipt_order_detail` VALUES (707, 104, 27, 4.00, NULL, 23, NULL, 0, NULL, NULL, NULL, NULL, NULL, 14, 55, 0); -INSERT INTO `wms_receipt_order_detail` VALUES (708, 98, 13, 1.00, 1.00, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, 4, 54, 3); -INSERT INTO `wms_receipt_order_detail` VALUES (709, 86, 25, 2.00, 2.00, 20, NULL, 0, NULL, NULL, NULL, NULL, NULL, 27, 52, 3); -INSERT INTO `wms_receipt_order_detail` VALUES (712, 105, 29, 26.00, 27.00, 24, NULL, 0, NULL, NULL, NULL, NULL, NULL, 30, 56, 3); -INSERT INTO `wms_receipt_order_detail` VALUES (719, 107, 29, 1.00, 1.00, 24, NULL, 0, NULL, NULL, NULL, NULL, NULL, 30, 56, 3); -INSERT INTO `wms_receipt_order_detail` VALUES (720, 108, 29, 1.00, NULL, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0); -INSERT INTO `wms_receipt_order_detail` VALUES (723, 109, 29, 1.00, NULL, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0); -INSERT INTO `wms_receipt_order_detail` VALUES (726, 110, 29, 1.00, 1.00, 24, NULL, 0, NULL, NULL, NULL, NULL, NULL, 30, 56, 3); -INSERT INTO `wms_receipt_order_detail` VALUES (728, 112, 29, 1.00, 1.00, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, 32, NULL, 0); -INSERT INTO `wms_receipt_order_detail` VALUES (729, 106, 29, 25.00, 15.00, 24, NULL, 0, NULL, NULL, NULL, NULL, NULL, 30, 56, 3); -INSERT INTO `wms_receipt_order_detail` VALUES (730, 111, 29, 1.00, 1.00, 24, NULL, 0, NULL, NULL, NULL, NULL, NULL, 30, 56, 3); -INSERT INTO `wms_receipt_order_detail` VALUES (731, 113, 29, 1.00, NULL, 24, NULL, 0, NULL, NULL, NULL, NULL, NULL, 31, 56, 0); -INSERT INTO `wms_receipt_order_detail` VALUES (734, 114, 32, 100.00, 6.00, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, 34, 59, 0); -INSERT INTO `wms_receipt_order_detail` VALUES (735, 114, 31, 100.00, 5.00, 24, NULL, 0, NULL, NULL, NULL, NULL, NULL, 31, 56, 0); -INSERT INTO `wms_receipt_order_detail` VALUES (738, 115, 55, 100.00, 100.00, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, 39, NULL, 3); -INSERT INTO `wms_receipt_order_detail` VALUES (739, 115, 53, 100.00, 100.00, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, 39, NULL, 3); -INSERT INTO `wms_receipt_order_detail` VALUES (741, 116, 55, 2.00, 1.00, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, 38, NULL, 3); -INSERT INTO `wms_receipt_order_detail` VALUES (742, 117, 55, 2.00, NULL, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, 38, NULL, 0); -INSERT INTO `wms_receipt_order_detail` VALUES (743, 117, 54, 2.00, NULL, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, 39, NULL, 0); -INSERT INTO `wms_receipt_order_detail` VALUES (744, 117, 53, 2.00, NULL, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, 38, NULL, 0); -INSERT INTO `wms_receipt_order_detail` VALUES (745, 117, 52, 2.00, NULL, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, 39, NULL, 0); -INSERT INTO `wms_receipt_order_detail` VALUES (746, 117, 51, 1.00, NULL, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, 39, NULL, 0); -INSERT INTO `wms_receipt_order_detail` VALUES (747, 118, 55, 1.00, NULL, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, 38, NULL, 0); -INSERT INTO `wms_receipt_order_detail` VALUES (751, 119, 55, 1.00, 1.00, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, 39, 60, 3); -INSERT INTO `wms_receipt_order_detail` VALUES (752, 120, 50, 1.00, NULL, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, 38, NULL, 0); -INSERT INTO `wms_receipt_order_detail` VALUES (753, 121, 56, 1.00, NULL, 27, NULL, 0, NULL, NULL, NULL, NULL, NULL, 39, 60, 0); -INSERT INTO `wms_receipt_order_detail` VALUES (754, 121, 55, 1.00, NULL, 27, NULL, 0, NULL, NULL, NULL, NULL, NULL, 39, 60, 0); -INSERT INTO `wms_receipt_order_detail` VALUES (755, 122, 56, 1.00, NULL, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0); -INSERT INTO `wms_receipt_order_detail` VALUES (756, 122, 55, 1.00, NULL, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0); -INSERT INTO `wms_receipt_order_detail` VALUES (757, 122, 54, 1.00, NULL, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0); -INSERT INTO `wms_receipt_order_detail` VALUES (758, 122, 53, 1.00, NULL, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0); -INSERT INTO `wms_receipt_order_detail` VALUES (759, 122, 52, 1.00, NULL, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0); -INSERT INTO `wms_receipt_order_detail` VALUES (760, 122, 51, 1.00, NULL, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0); -INSERT INTO `wms_receipt_order_detail` VALUES (761, 122, 50, 1.00, NULL, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0); -INSERT INTO `wms_receipt_order_detail` VALUES (762, 122, 49, 1.00, NULL, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0); -INSERT INTO `wms_receipt_order_detail` VALUES (763, 122, 48, 1.00, NULL, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0); -INSERT INTO `wms_receipt_order_detail` VALUES (764, 122, 47, 1.00, NULL, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0); -INSERT INTO `wms_receipt_order_detail` VALUES (765, 123, 57, 600.00, NULL, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, 38, NULL, 0); -INSERT INTO `wms_receipt_order_detail` VALUES (766, 125, 58, 1.00, NULL, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0); -INSERT INTO `wms_receipt_order_detail` VALUES (769, 126, 58, 3.00, 5.00, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, 38, NULL, 1); -INSERT INTO `wms_receipt_order_detail` VALUES (772, 131, 58, 1.00, 1.00, 29, NULL, 0, NULL, NULL, NULL, NULL, NULL, 38, 61, 0); -INSERT INTO `wms_receipt_order_detail` VALUES (776, 130, 60, 10.00, 1.00, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, 42, NULL, 3); -INSERT INTO `wms_receipt_order_detail` VALUES (780, 133, 60, 10.00, 12.00, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, 40, NULL, 2); -INSERT INTO `wms_receipt_order_detail` VALUES (785, 135, 60, 10.00, 10.00, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, 38, 61, 3); -INSERT INTO `wms_receipt_order_detail` VALUES (786, 135, 58, 10.00, 8.00, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, 43, 62, 3); -INSERT INTO `wms_receipt_order_detail` VALUES (789, 136, 60, 3.00, 1.00, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, 42, NULL, 4); -INSERT INTO `wms_receipt_order_detail` VALUES (790, 136, 58, 3.00, 1.00, 28, NULL, 0, NULL, NULL, NULL, NULL, NULL, 38, 61, 3); -INSERT INTO `wms_receipt_order_detail` VALUES (799, 137, 60, 11.00, 1.00, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, 42, NULL, 3); -INSERT INTO `wms_receipt_order_detail` VALUES (805, 138, 60, 1.00, 1.00, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, 42, NULL, 3); -INSERT INTO `wms_receipt_order_detail` VALUES (808, 139, 60, 1.00, 1.00, 29, NULL, 0, NULL, NULL, NULL, NULL, NULL, 38, 61, 3); -INSERT INTO `wms_receipt_order_detail` VALUES (811, 140, 60, 2.00, NULL, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0); -INSERT INTO `wms_receipt_order_detail` VALUES (812, 140, 58, 2.00, NULL, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0); -INSERT INTO `wms_receipt_order_detail` VALUES (813, 141, 60, 5.00, NULL, 29, NULL, 0, NULL, NULL, NULL, NULL, NULL, 38, 61, 0); -INSERT INTO `wms_receipt_order_detail` VALUES (814, 142, 58, 8.00, NULL, 29, NULL, 0, NULL, NULL, NULL, NULL, NULL, 38, 61, 0); -INSERT INTO `wms_receipt_order_detail` VALUES (815, 142, 60, 6.00, NULL, 29, NULL, 0, NULL, NULL, NULL, NULL, NULL, 38, 61, 0); -INSERT INTO `wms_receipt_order_detail` VALUES (817, 143, 60, 1.00, 1.00, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, 38, NULL, 3); -INSERT INTO `wms_receipt_order_detail` VALUES (821, 145, 60, 1000.00, 1000.00, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, 45, 65, 3); -INSERT INTO `wms_receipt_order_detail` VALUES (829, 147, 61, 20.00, 1.00, 29, NULL, 0, NULL, NULL, NULL, NULL, NULL, 38, 61, 3); -INSERT INTO `wms_receipt_order_detail` VALUES (830, 147, 60, 20.00, 1.00, 29, NULL, 0, NULL, NULL, NULL, NULL, NULL, 38, 61, 3); -INSERT INTO `wms_receipt_order_detail` VALUES (831, 144, 60, 1.00, 1.00, 30, NULL, 0, NULL, NULL, NULL, NULL, NULL, 43, 62, 2); -INSERT INTO `wms_receipt_order_detail` VALUES (832, 144, 58, 1.00, 1.00, 28, NULL, 0, NULL, NULL, NULL, NULL, NULL, 38, 61, 0); -INSERT INTO `wms_receipt_order_detail` VALUES (846, 146, 60, 2.00, 8.00, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, 42, 63, 1); -INSERT INTO `wms_receipt_order_detail` VALUES (859, 148, 61, 13.00, 13.00, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, 42, 63, 3); -INSERT INTO `wms_receipt_order_detail` VALUES (860, 148, 60, 12.00, 1.00, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, 45, 65, 3); -INSERT INTO `wms_receipt_order_detail` VALUES (861, 148, 58, 11.00, 11.00, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, 45, 65, 3); -INSERT INTO `wms_receipt_order_detail` VALUES (863, 149, 61, 1.00, 1.00, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, 42, 63, 3); -INSERT INTO `wms_receipt_order_detail` VALUES (867, 150, 61, 9.00, 1.00, 29, NULL, 0, NULL, NULL, NULL, NULL, NULL, 38, 61, 3); -INSERT INTO `wms_receipt_order_detail` VALUES (869, 152, 60, 1.00, 1.00, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, 45, 65, 3); -INSERT INTO `wms_receipt_order_detail` VALUES (871, 153, 61, 4.00, 1.00, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0); -INSERT INTO `wms_receipt_order_detail` VALUES (872, 155, 61, 1.00, NULL, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, 43, NULL, 0); -INSERT INTO `wms_receipt_order_detail` VALUES (875, 157, 63, 30.00, 1.00, 31, NULL, 0, NULL, NULL, NULL, NULL, NULL, 50, 67, 3); -INSERT INTO `wms_receipt_order_detail` VALUES (877, 156, 63, 1.00, 3.00, 31, NULL, 0, NULL, NULL, NULL, NULL, NULL, 50, 67, 3); -INSERT INTO `wms_receipt_order_detail` VALUES (880, 159, 63, 2.00, NULL, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0); -INSERT INTO `wms_receipt_order_detail` VALUES (881, 159, 62, 2.00, NULL, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0); -INSERT INTO `wms_receipt_order_detail` VALUES (886, 160, 63, 3.00, 1.00, 31, NULL, 0, NULL, NULL, NULL, NULL, NULL, 50, 70, 3); -INSERT INTO `wms_receipt_order_detail` VALUES (887, 160, 62, 3.00, 1.00, 31, NULL, 0, NULL, NULL, NULL, NULL, NULL, 50, 70, 3); -INSERT INTO `wms_receipt_order_detail` VALUES (889, 161, 63, 3.00, 1.00, 31, NULL, 0, NULL, NULL, NULL, NULL, NULL, 50, 70, 3); -INSERT INTO `wms_receipt_order_detail` VALUES (892, 162, 68, 100.00, 1.00, 34, NULL, 0, NULL, NULL, NULL, NULL, NULL, 53, 73, 3); -INSERT INTO `wms_receipt_order_detail` VALUES (893, 162, 67, 100.00, 1.00, 34, NULL, 0, NULL, NULL, NULL, NULL, NULL, 53, 73, 3); -INSERT INTO `wms_receipt_order_detail` VALUES (894, 163, 68, 4.00, NULL, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0); -INSERT INTO `wms_receipt_order_detail` VALUES (895, 163, 67, 3.00, NULL, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0); -INSERT INTO `wms_receipt_order_detail` VALUES (904, 164, 68, 1.00, 1.00, 34, NULL, 0, NULL, NULL, NULL, NULL, NULL, 53, 73, 3); -INSERT INTO `wms_receipt_order_detail` VALUES (905, 164, 67, 1.00, 1.00, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, 54, NULL, 3); -INSERT INTO `wms_receipt_order_detail` VALUES (906, 165, 69, 3000.00, NULL, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, 58, NULL, 0); -INSERT INTO `wms_receipt_order_detail` VALUES (909, 166, 75, 1.00, 1.00, 38, NULL, 0, NULL, NULL, NULL, NULL, NULL, 61, 77, 3); -INSERT INTO `wms_receipt_order_detail` VALUES (910, 166, 74, 1.00, 1.00, 38, NULL, 0, NULL, NULL, NULL, NULL, NULL, 61, 77, 0); -INSERT INTO `wms_receipt_order_detail` VALUES (912, 167, 73, 6.00, 1.00, 37, NULL, 0, NULL, NULL, NULL, NULL, NULL, 61, 77, 1); -INSERT INTO `wms_receipt_order_detail` VALUES (913, 168, 75, 2.00, NULL, 37, NULL, 0, NULL, NULL, NULL, NULL, NULL, 61, 77, 0); -INSERT INTO `wms_receipt_order_detail` VALUES (914, 168, 74, 2.00, NULL, 37, NULL, 0, NULL, NULL, NULL, NULL, NULL, 61, 77, 0); -INSERT INTO `wms_receipt_order_detail` VALUES (927, 169, 76, 100.00, 100.00, 43, NULL, 0, NULL, NULL, NULL, NULL, NULL, 61, 80, 3); -INSERT INTO `wms_receipt_order_detail` VALUES (928, 169, 75, 100.00, 100.00, 38, NULL, 0, NULL, NULL, NULL, NULL, NULL, 61, 77, 3); -INSERT INTO `wms_receipt_order_detail` VALUES (929, 169, 74, 100.00, 100.00, 38, NULL, 0, NULL, NULL, NULL, NULL, NULL, 61, 77, 3); -INSERT INTO `wms_receipt_order_detail` VALUES (930, 169, 73, 100.00, 100.00, 37, NULL, 0, NULL, NULL, NULL, NULL, NULL, 61, 77, 3); -INSERT INTO `wms_receipt_order_detail` VALUES (931, 169, 72, 100.00, 100.00, 37, NULL, 0, NULL, NULL, NULL, NULL, NULL, 61, 77, 3); -INSERT INTO `wms_receipt_order_detail` VALUES (932, 169, 71, 100.00, 100.00, 37, NULL, 0, NULL, NULL, NULL, NULL, NULL, 61, 77, 3); -INSERT INTO `wms_receipt_order_detail` VALUES (939, 170, 76, 10000.00, 10000.00, 43, NULL, 0, NULL, NULL, NULL, NULL, NULL, 61, 80, 3); -INSERT INTO `wms_receipt_order_detail` VALUES (940, 170, 75, 100.00, 100.00, 38, NULL, 0, NULL, NULL, NULL, NULL, NULL, 61, 77, 3); -INSERT INTO `wms_receipt_order_detail` VALUES (941, 170, 74, 100.00, 100.00, 38, NULL, 0, NULL, NULL, NULL, NULL, NULL, 61, 77, 3); -INSERT INTO `wms_receipt_order_detail` VALUES (942, 170, 73, 10000.00, 10000.00, 37, NULL, 0, NULL, NULL, NULL, NULL, NULL, 61, 77, 3); -INSERT INTO `wms_receipt_order_detail` VALUES (943, 170, 72, 10000.00, 100000.00, 37, NULL, 0, NULL, NULL, NULL, NULL, NULL, 61, 77, 3); -INSERT INTO `wms_receipt_order_detail` VALUES (944, 170, 71, 10000.00, 1000.00, 37, NULL, 0, NULL, NULL, NULL, NULL, NULL, 61, 77, 3); -INSERT INTO `wms_receipt_order_detail` VALUES (946, 171, 75, 1.00, 1.00, 38, NULL, 0, NULL, NULL, NULL, NULL, NULL, 61, 77, 3); -INSERT INTO `wms_receipt_order_detail` VALUES (949, 172, 74, 10.00, 10.00, 37, NULL, 0, NULL, NULL, NULL, NULL, NULL, 61, 77, 3); -INSERT INTO `wms_receipt_order_detail` VALUES (950, 172, 71, 10000.00, 1000.00, 38, NULL, 0, NULL, NULL, NULL, NULL, NULL, 61, 77, 3); -INSERT INTO `wms_receipt_order_detail` VALUES (956, 173, 75, 1.00, 1.00, 38, NULL, 0, NULL, NULL, NULL, NULL, NULL, 61, 77, 3); -INSERT INTO `wms_receipt_order_detail` VALUES (957, 173, 74, 1.00, 1.00, 38, NULL, 0, NULL, NULL, NULL, NULL, NULL, 61, 77, 3); -INSERT INTO `wms_receipt_order_detail` VALUES (958, 173, 73, 1.00, 1.00, 37, NULL, 0, NULL, NULL, NULL, NULL, NULL, 61, 77, 3); -INSERT INTO `wms_receipt_order_detail` VALUES (959, 173, 72, 1.00, 1.00, 37, NULL, 0, NULL, NULL, NULL, NULL, NULL, 61, 77, 3); -INSERT INTO `wms_receipt_order_detail` VALUES (960, 173, 71, 1.00, 1.00, 37, NULL, 0, NULL, NULL, NULL, NULL, NULL, 61, 77, 3); -INSERT INTO `wms_receipt_order_detail` VALUES (967, 174, 77, 1.00, 1.00, 47, NULL, 0, NULL, NULL, NULL, NULL, NULL, 64, 82, 3); -INSERT INTO `wms_receipt_order_detail` VALUES (968, 174, 74, 1.00, 1.00, 47, NULL, 0, NULL, NULL, NULL, NULL, NULL, 64, 82, 3); -INSERT INTO `wms_receipt_order_detail` VALUES (969, 174, 71, 1.00, 1.00, 37, NULL, 0, NULL, NULL, NULL, NULL, NULL, 61, 77, 3); -INSERT INTO `wms_receipt_order_detail` VALUES (970, 175, 77, 5.00, NULL, 37, NULL, 0, NULL, NULL, NULL, NULL, NULL, 61, 77, 0); -INSERT INTO `wms_receipt_order_detail` VALUES (971, 175, 75, 1.00, NULL, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, 61, NULL, 0); -INSERT INTO `wms_receipt_order_detail` VALUES (972, 176, 73, 1.00, NULL, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0); -INSERT INTO `wms_receipt_order_detail` VALUES (975, 177, 75, 1.00, 1.00, 37, NULL, 0, NULL, NULL, NULL, NULL, NULL, 61, 77, 1); -INSERT INTO `wms_receipt_order_detail` VALUES (976, 178, 75, 1.00, NULL, 47, NULL, 0, NULL, NULL, NULL, NULL, NULL, 64, 82, 0); -INSERT INTO `wms_receipt_order_detail` VALUES (980, 180, 78, 10.00, 1.00, 49, NULL, 0, NULL, NULL, NULL, NULL, NULL, 67, 84, 3); -INSERT INTO `wms_receipt_order_detail` VALUES (982, 181, 78, 12.00, 12.00, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, 69, NULL, 3); -INSERT INTO `wms_receipt_order_detail` VALUES (984, 179, 78, 20.00, 1.00, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, 69, NULL, 3); -INSERT INTO `wms_receipt_order_detail` VALUES (986, 182, 80, 7.00, 1.00, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, 65, 86, 3); -INSERT INTO `wms_receipt_order_detail` VALUES (989, 183, 80, 122.00, 122.00, 51, NULL, 0, NULL, NULL, NULL, NULL, NULL, 65, 86, 3); -INSERT INTO `wms_receipt_order_detail` VALUES (990, 184, 80, 1.00, NULL, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0); -INSERT INTO `wms_receipt_order_detail` VALUES (991, 185, 79, 2.00, NULL, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0); -INSERT INTO `wms_receipt_order_detail` VALUES (994, 186, 80, 1.00, 1.00, 51, NULL, 0, NULL, NULL, NULL, NULL, NULL, 65, 86, 3); -INSERT INTO `wms_receipt_order_detail` VALUES (996, 187, 80, 1.00, NULL, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0); -INSERT INTO `wms_receipt_order_detail` VALUES (997, 188, 80, 1.00, NULL, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0); -INSERT INTO `wms_receipt_order_detail` VALUES (1004, 189, 80, 1.00, 9.00, 51, NULL, 0, NULL, NULL, NULL, NULL, NULL, 65, 86, 3); -INSERT INTO `wms_receipt_order_detail` VALUES (1005, 189, 79, 1.00, 9.00, 50, NULL, 0, NULL, NULL, NULL, NULL, NULL, 65, 86, 3); -INSERT INTO `wms_receipt_order_detail` VALUES (1006, 189, 78, 1.00, 9.00, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, 69, NULL, 3); -INSERT INTO `wms_receipt_order_detail` VALUES (1013, 191, 80, 100.00, 1.00, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, 65, 86, 3); -INSERT INTO `wms_receipt_order_detail` VALUES (1014, 191, 79, 1100.00, 1.00, 50, NULL, 0, NULL, NULL, NULL, NULL, NULL, 65, 86, 3); -INSERT INTO `wms_receipt_order_detail` VALUES (1015, 191, 78, 100.00, 1.00, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, 69, NULL, 3); -INSERT INTO `wms_receipt_order_detail` VALUES (1017, 192, 80, 6.00, 1.00, 49, NULL, 0, NULL, NULL, NULL, NULL, NULL, 68, 85, 3); -INSERT INTO `wms_receipt_order_detail` VALUES (1025, 193, 79, 1.00, 1.00, 50, NULL, 0, NULL, NULL, NULL, NULL, NULL, 65, 86, 3); -INSERT INTO `wms_receipt_order_detail` VALUES (1026, 193, 78, 1.00, 1.00, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, 69, NULL, 1); -INSERT INTO `wms_receipt_order_detail` VALUES (1029, 194, 80, 3.00, 1.00, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, 66, 87, 3); -INSERT INTO `wms_receipt_order_detail` VALUES (1030, 194, 79, 1.00, 1.00, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, 66, 87, 0); -INSERT INTO `wms_receipt_order_detail` VALUES (1036, 196, 80, 3.00, 2.00, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, 67, 84, 3); -INSERT INTO `wms_receipt_order_detail` VALUES (1037, 198, 87, 1.00, NULL, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0); -INSERT INTO `wms_receipt_order_detail` VALUES (1038, 198, 86, 1.00, NULL, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0); -INSERT INTO `wms_receipt_order_detail` VALUES (1039, 198, 85, 1.00, NULL, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0); -INSERT INTO `wms_receipt_order_detail` VALUES (1042, 199, 87, 1.00, 1.00, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, 66, 87, 3); -INSERT INTO `wms_receipt_order_detail` VALUES (1051, 202, 88, 1.00, NULL, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, 66, 87, 0); -INSERT INTO `wms_receipt_order_detail` VALUES (1052, 200, 85, 1.00, 1.00, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 1); -INSERT INTO `wms_receipt_order_detail` VALUES (1053, 200, 84, 1.00, 1.00, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0); -INSERT INTO `wms_receipt_order_detail` VALUES (1055, 201, 88, 1.00, 1.00, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, 67, 84, 1); -INSERT INTO `wms_receipt_order_detail` VALUES (1056, 203, 88, 10.00, 1.00, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, 66, 86, 0); -INSERT INTO `wms_receipt_order_detail` VALUES (1057, 204, 88, 1000.00, NULL, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0); -INSERT INTO `wms_receipt_order_detail` VALUES (1058, 204, 86, 1000.00, NULL, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0); -INSERT INTO `wms_receipt_order_detail` VALUES (1059, 204, 85, 100.00, NULL, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0); -INSERT INTO `wms_receipt_order_detail` VALUES (1060, 205, 88, 1.00, NULL, 50, NULL, 0, NULL, NULL, NULL, NULL, NULL, 66, 86, 0); -INSERT INTO `wms_receipt_order_detail` VALUES (1061, 205, 86, 1.00, NULL, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0); -INSERT INTO `wms_receipt_order_detail` VALUES (1062, 205, 85, 1.00, NULL, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0); -INSERT INTO `wms_receipt_order_detail` VALUES (1063, 205, 84, 1.00, NULL, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0); -INSERT INTO `wms_receipt_order_detail` VALUES (1064, 205, 83, 1.00, NULL, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0); -INSERT INTO `wms_receipt_order_detail` VALUES (1065, 206, 82, 1.00, NULL, 52, NULL, 0, NULL, NULL, NULL, NULL, NULL, 72, 88, 0); -INSERT INTO `wms_receipt_order_detail` VALUES (1066, 206, 80, 1.00, NULL, 52, NULL, 0, NULL, NULL, NULL, NULL, NULL, 72, 88, 0); -INSERT INTO `wms_receipt_order_detail` VALUES (1070, 207, 88, 2.00, 1.00, 50, NULL, 0, NULL, NULL, NULL, NULL, NULL, 66, 86, 3); -INSERT INTO `wms_receipt_order_detail` VALUES (1072, 208, 88, 222.00, 1.00, 49, NULL, 0, NULL, NULL, NULL, NULL, NULL, 74, 84, 3); -INSERT INTO `wms_receipt_order_detail` VALUES (1073, 209, 88, 16.00, NULL, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, 74, NULL, 0); -INSERT INTO `wms_receipt_order_detail` VALUES (1075, 210, 88, 1.00, 1.00, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, 74, NULL, 3); -INSERT INTO `wms_receipt_order_detail` VALUES (1077, 211, 88, 10.00, 1.00, 49, NULL, 0, NULL, NULL, NULL, NULL, NULL, 68, 85, 3); -INSERT INTO `wms_receipt_order_detail` VALUES (1079, 212, 88, 2.00, 1.00, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, 74, NULL, 3); -INSERT INTO `wms_receipt_order_detail` VALUES (1080, 213, 88, 1.00, NULL, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, 74, NULL, 0); -INSERT INTO `wms_receipt_order_detail` VALUES (1081, 214, 79, 1.00, NULL, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, 74, NULL, 0); -INSERT INTO `wms_receipt_order_detail` VALUES (1082, 215, 88, 1.00, NULL, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0); -INSERT INTO `wms_receipt_order_detail` VALUES (1083, 216, 88, 1.00, NULL, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0); -INSERT INTO `wms_receipt_order_detail` VALUES (1084, 216, 85, 1.00, NULL, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0); -INSERT INTO `wms_receipt_order_detail` VALUES (1087, 217, 89, 500.00, 500.00, 50, NULL, 0, NULL, NULL, NULL, NULL, NULL, 76, 89, 3); -INSERT INTO `wms_receipt_order_detail` VALUES (1090, 218, 90, 1.00, 1.00, 49, NULL, 0, NULL, NULL, NULL, NULL, NULL, 75, 90, 3); -INSERT INTO `wms_receipt_order_detail` VALUES (1093, 220, 89, 2.00, 1.00, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, 75, NULL, 3); -INSERT INTO `wms_receipt_order_detail` VALUES (1096, 221, 91, 1.00, 1.00, 52, NULL, 0, NULL, NULL, NULL, NULL, NULL, 78, 92, 1); -INSERT INTO `wms_receipt_order_detail` VALUES (1097, 221, 90, 1.00, 1.00, 50, NULL, 0, NULL, NULL, NULL, NULL, NULL, 76, 89, 1); -INSERT INTO `wms_receipt_order_detail` VALUES (1100, 223, 91, 1.00, 1.00, 50, NULL, 0, NULL, NULL, NULL, NULL, NULL, 76, 89, 2); -INSERT INTO `wms_receipt_order_detail` VALUES (1113, 222, 90, 1.00, 1.00, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, 75, 90, 4); -INSERT INTO `wms_receipt_order_detail` VALUES (1114, 222, 89, 1.00, 1.00, 50, NULL, 0, NULL, NULL, NULL, NULL, NULL, 76, 89, 4); -INSERT INTO `wms_receipt_order_detail` VALUES (1115, 222, 91, 1.00, 1.00, 50, NULL, 0, NULL, NULL, NULL, NULL, NULL, 76, 89, 3); -INSERT INTO `wms_receipt_order_detail` VALUES (1116, 224, 91, 1.00, NULL, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0); -INSERT INTO `wms_receipt_order_detail` VALUES (1117, 224, 90, 1.00, NULL, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0); -INSERT INTO `wms_receipt_order_detail` VALUES (1118, 224, 89, 1.00, NULL, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0); -INSERT INTO `wms_receipt_order_detail` VALUES (1122, 226, 91, 1.00, 1.00, 50, NULL, 0, NULL, NULL, NULL, NULL, NULL, 76, 89, 3); -INSERT INTO `wms_receipt_order_detail` VALUES (1125, 225, 90, 3.00, NULL, 49, NULL, 0, NULL, NULL, NULL, NULL, NULL, 75, 90, 0); -INSERT INTO `wms_receipt_order_detail` VALUES (1126, 227, 91, 1.00, NULL, 52, NULL, 0, NULL, NULL, NULL, NULL, NULL, 78, 92, 0); -INSERT INTO `wms_receipt_order_detail` VALUES (1127, 227, 90, 1.00, NULL, 52, NULL, 0, NULL, NULL, NULL, NULL, NULL, 78, 92, 0); -INSERT INTO `wms_receipt_order_detail` VALUES (1128, 219, 91, 1.00, 1.00, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, 75, 90, 0); -INSERT INTO `wms_receipt_order_detail` VALUES (1132, 228, 91, 5.00, 1.00, 49, NULL, 0, NULL, NULL, NULL, NULL, NULL, 75, 90, 3); -INSERT INTO `wms_receipt_order_detail` VALUES (1134, 229, 91, 1.00, 1.00, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, 75, 90, 3); -INSERT INTO `wms_receipt_order_detail` VALUES (1136, 230, 90, 1.00, 1.00, 52, NULL, 0, NULL, NULL, NULL, NULL, NULL, 78, 92, 3); -INSERT INTO `wms_receipt_order_detail` VALUES (1139, 231, 91, 1.00, 1.00, 52, NULL, 0, NULL, NULL, NULL, NULL, NULL, 78, 92, 2); -INSERT INTO `wms_receipt_order_detail` VALUES (1143, 233, 92, 6.00, 6.00, 52, NULL, 0, NULL, NULL, NULL, NULL, NULL, 78, 92, 3); -INSERT INTO `wms_receipt_order_detail` VALUES (1145, 234, 93, 8.00, 1.00, 52, NULL, 0, NULL, NULL, NULL, NULL, NULL, 78, 92, 3); -INSERT INTO `wms_receipt_order_detail` VALUES (1151, 236, 91, 5.00, 3.00, 51, NULL, 0, NULL, NULL, NULL, NULL, NULL, 77, 91, 3); -INSERT INTO `wms_receipt_order_detail` VALUES (1158, 237, 93, 2.00, 4.00, 52, NULL, 0, NULL, NULL, NULL, NULL, NULL, 78, 92, 3); -INSERT INTO `wms_receipt_order_detail` VALUES (1159, 237, 91, 3.00, 1.00, 50, NULL, 0, NULL, NULL, NULL, NULL, NULL, 76, 89, 3); -INSERT INTO `wms_receipt_order_detail` VALUES (1160, 237, 90, 3.00, 1.00, 49, NULL, 0, NULL, NULL, NULL, NULL, NULL, 75, 90, 3); -INSERT INTO `wms_receipt_order_detail` VALUES (1161, 235, 93, 1.00, NULL, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0); -INSERT INTO `wms_receipt_order_detail` VALUES (1164, 238, 94, 30.00, 1.00, 49, NULL, 0, NULL, NULL, NULL, NULL, NULL, 75, 90, 3); -INSERT INTO `wms_receipt_order_detail` VALUES (1167, 239, 93, 10.00, 1.00, 50, NULL, 0, NULL, NULL, NULL, NULL, NULL, 76, 89, 3); -INSERT INTO `wms_receipt_order_detail` VALUES (1168, 239, 91, 6.00, 1.00, 51, NULL, 0, NULL, NULL, NULL, NULL, NULL, 77, 91, 3); -INSERT INTO `wms_receipt_order_detail` VALUES (1182, 232, 91, 100.00, 1.00, 49, NULL, 0, NULL, NULL, NULL, NULL, NULL, 75, 90, 3); -INSERT INTO `wms_receipt_order_detail` VALUES (1189, 240, 94, 10.00, 1.00, 53, NULL, 0, NULL, NULL, NULL, NULL, NULL, 83, 94, 3); -INSERT INTO `wms_receipt_order_detail` VALUES (1190, 240, 93, 1.00, 1.00, 53, NULL, 0, NULL, NULL, NULL, NULL, NULL, 83, 94, 3); -INSERT INTO `wms_receipt_order_detail` VALUES (1191, 240, 92, 1.00, 1.00, 53, NULL, 0, NULL, NULL, NULL, NULL, NULL, 83, 94, 3); -INSERT INTO `wms_receipt_order_detail` VALUES (1192, 240, 91, 1.00, 1.00, 53, NULL, 0, NULL, NULL, NULL, NULL, NULL, 83, 94, 0); -INSERT INTO `wms_receipt_order_detail` VALUES (1193, 240, 90, 1.00, 1.00, 49, NULL, 0, NULL, NULL, NULL, NULL, NULL, 75, 90, 0); -INSERT INTO `wms_receipt_order_detail` VALUES (1194, 240, 89, 1.00, 1.00, 50, NULL, 0, NULL, NULL, NULL, NULL, NULL, 76, 89, 0); -INSERT INTO `wms_receipt_order_detail` VALUES (1196, 241, 95, 50.00, 1.00, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, 84, NULL, 3); -INSERT INTO `wms_receipt_order_detail` VALUES (1197, 242, 95, 1.00, NULL, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0); -INSERT INTO `wms_receipt_order_detail` VALUES (1201, 244, 95, 1.00, 1.00, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, 84, NULL, 0); -INSERT INTO `wms_receipt_order_detail` VALUES (1204, 243, 95, 2.00, 1.00, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, 84, NULL, 3); -INSERT INTO `wms_receipt_order_detail` VALUES (1205, 243, 94, 2.00, 1.00, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, 85, 95, 3); -INSERT INTO `wms_receipt_order_detail` VALUES (1207, 245, 95, 1.00, 1.00, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, 84, NULL, 0); -INSERT INTO `wms_receipt_order_detail` VALUES (1208, 246, 94, 1.00, NULL, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, 85, NULL, 0); -INSERT INTO `wms_receipt_order_detail` VALUES (1209, 247, 95, 3.00, NULL, 53, NULL, 0, NULL, NULL, NULL, NULL, NULL, 83, 94, 0); -INSERT INTO `wms_receipt_order_detail` VALUES (1210, 248, 95, 1.00, NULL, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0); -INSERT INTO `wms_receipt_order_detail` VALUES (1215, 249, 96, 6.00, 1.00, 56, NULL, 0, NULL, NULL, NULL, NULL, NULL, 86, 98, 3); -INSERT INTO `wms_receipt_order_detail` VALUES (1216, 249, 97, 6.00, 1.00, 55, NULL, 0, NULL, NULL, NULL, NULL, NULL, 86, 98, 3); -INSERT INTO `wms_receipt_order_detail` VALUES (1219, 250, 94, 1.00, 1.00, 55, NULL, 0, NULL, NULL, NULL, NULL, NULL, 86, 98, 3); -INSERT INTO `wms_receipt_order_detail` VALUES (1221, 251, 94, 1.00, 1.00, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, 85, 95, 3); -INSERT INTO `wms_receipt_order_detail` VALUES (1223, 252, 97, 2.00, 2.00, 49, NULL, 0, NULL, NULL, NULL, NULL, NULL, 84, 96, 3); -INSERT INTO `wms_receipt_order_detail` VALUES (1228, 253, 97, 800.00, 1.00, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, 85, 95, 3); -INSERT INTO `wms_receipt_order_detail` VALUES (1229, 253, 96, 500.00, 1.00, 55, NULL, 0, NULL, NULL, NULL, NULL, NULL, 86, 98, 3); -INSERT INTO `wms_receipt_order_detail` VALUES (1233, 254, 99, 100.00, 100.00, 57, NULL, 0, NULL, NULL, NULL, NULL, NULL, 87, 100, 3); -INSERT INTO `wms_receipt_order_detail` VALUES (1238, 257, 99, 10.00, 1.00, 53, NULL, 0, NULL, NULL, NULL, NULL, NULL, 83, 94, 3); -INSERT INTO `wms_receipt_order_detail` VALUES (1239, 256, 99, 1.00, 1.00, 53, NULL, 0, NULL, NULL, NULL, NULL, NULL, 83, 94, 0); -INSERT INTO `wms_receipt_order_detail` VALUES (1240, 256, 97, 1.00, 1.00, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0); -INSERT INTO `wms_receipt_order_detail` VALUES (1241, 256, 96, 1.00, 1.00, 56, NULL, 0, NULL, NULL, NULL, NULL, NULL, 86, 98, 0); -INSERT INTO `wms_receipt_order_detail` VALUES (1245, 259, 97, 1.00, 1.00, 49, NULL, 0, NULL, NULL, NULL, NULL, NULL, 84, 96, 1); -INSERT INTO `wms_receipt_order_detail` VALUES (1250, 261, 100, 1.00, 1.00, 49, NULL, 0, NULL, NULL, NULL, NULL, NULL, 84, 96, 3); -INSERT INTO `wms_receipt_order_detail` VALUES (1252, 262, 101, 1.00, 1.00, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, 89, 103, 3); -INSERT INTO `wms_receipt_order_detail` VALUES (1253, 260, 93, 1.00, 2.00, 49, NULL, 0, NULL, NULL, NULL, NULL, NULL, 84, 96, 3); -INSERT INTO `wms_receipt_order_detail` VALUES (1254, 260, 94, 1.00, 2.00, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, 86, 99, 3); -INSERT INTO `wms_receipt_order_detail` VALUES (1257, 263, 99, 200.00, 150.00, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, 91, 108, 3); -INSERT INTO `wms_receipt_order_detail` VALUES (1264, 265, 101, 10.00, 10.00, 61, NULL, 0, NULL, NULL, NULL, NULL, NULL, 91, 105, 3); -INSERT INTO `wms_receipt_order_detail` VALUES (1265, 265, 99, 10.00, 10.00, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, 91, 106, 3); -INSERT INTO `wms_receipt_order_detail` VALUES (1266, 258, 100, 1.00, 1.00, 49, NULL, 0, NULL, NULL, NULL, NULL, NULL, 84, 96, 3); -INSERT INTO `wms_receipt_order_detail` VALUES (1267, 258, 99, 1.00, 1.00, 53, NULL, 0, NULL, NULL, NULL, NULL, NULL, 83, 94, 0); -INSERT INTO `wms_receipt_order_detail` VALUES (1270, 264, 101, 5.00, 4.00, 61, NULL, 0, NULL, NULL, NULL, NULL, NULL, 91, 105, 3); -INSERT INTO `wms_receipt_order_detail` VALUES (1271, 264, 99, 5.00, 5.00, 61, NULL, 0, NULL, NULL, NULL, NULL, NULL, 91, 105, 3); -INSERT INTO `wms_receipt_order_detail` VALUES (1273, 267, 102, 3.00, NULL, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0); -INSERT INTO `wms_receipt_order_detail` VALUES (1274, 266, 102, 1.00, NULL, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0); -INSERT INTO `wms_receipt_order_detail` VALUES (1276, 272, 102, 1.00, NULL, 49, NULL, 0, NULL, NULL, NULL, NULL, NULL, 84, 96, 0); -INSERT INTO `wms_receipt_order_detail` VALUES (1283, 271, 103, 8.00, 1.00, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, 86, 99, 3); -INSERT INTO `wms_receipt_order_detail` VALUES (1284, 271, 102, 8.00, 1.00, 57, NULL, 0, NULL, NULL, NULL, NULL, NULL, 87, 100, 3); -INSERT INTO `wms_receipt_order_detail` VALUES (1287, 273, 103, 5.00, 1.00, 55, NULL, 0, NULL, NULL, NULL, NULL, NULL, 86, 98, 3); -INSERT INTO `wms_receipt_order_detail` VALUES (1288, 273, 102, 14.00, 1.00, 56, NULL, 0, NULL, NULL, NULL, NULL, NULL, 86, 98, 3); -INSERT INTO `wms_receipt_order_detail` VALUES (1291, 274, 103, 4.00, 5.00, 57, NULL, 0, NULL, NULL, NULL, NULL, NULL, 87, 100, 3); -INSERT INTO `wms_receipt_order_detail` VALUES (1292, 274, 102, 10.00, 9.00, 61, NULL, 0, NULL, NULL, NULL, NULL, NULL, 91, 105, 3); -INSERT INTO `wms_receipt_order_detail` VALUES (1294, 275, 103, 1.00, 1.00, 55, NULL, 0, NULL, NULL, NULL, NULL, NULL, 86, 98, 3); -INSERT INTO `wms_receipt_order_detail` VALUES (1295, 276, 103, 5.00, NULL, 49, NULL, 0, NULL, NULL, NULL, NULL, NULL, 84, 96, 0); -INSERT INTO `wms_receipt_order_detail` VALUES (1299, 277, 104, 1000.00, 1000.00, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, 88, NULL, 3); -INSERT INTO `wms_receipt_order_detail` VALUES (1301, 278, 104, 1.00, 1.00, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, 88, NULL, 3); -INSERT INTO `wms_receipt_order_detail` VALUES (1310, 279, 104, 10.00, 2.00, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, 88, NULL, 3); -INSERT INTO `wms_receipt_order_detail` VALUES (1311, 279, 103, 10.00, 2.00, 55, NULL, 0, NULL, NULL, NULL, NULL, NULL, 86, 98, 3); -INSERT INTO `wms_receipt_order_detail` VALUES (1312, 281, 104, 1.00, NULL, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0); -INSERT INTO `wms_receipt_order_detail` VALUES (1313, 281, 103, 1.00, NULL, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0); -INSERT INTO `wms_receipt_order_detail` VALUES (1314, 282, 104, 4.00, NULL, 49, NULL, 0, NULL, NULL, NULL, NULL, NULL, 84, 96, 0); -INSERT INTO `wms_receipt_order_detail` VALUES (1315, 282, 103, 7.00, NULL, 49, NULL, 0, NULL, NULL, NULL, NULL, NULL, 84, 96, 0); -INSERT INTO `wms_receipt_order_detail` VALUES (1316, 282, 102, 3.00, NULL, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, 89, 103, 0); -INSERT INTO `wms_receipt_order_detail` VALUES (1317, 283, 104, 1.00, NULL, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, 84, NULL, 0); -INSERT INTO `wms_receipt_order_detail` VALUES (1320, 284, 105, 1.00, 4.00, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, 93, NULL, 3); -INSERT INTO `wms_receipt_order_detail` VALUES (1322, 285, 104, 1.00, 1.00, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, 88, NULL, 0); -INSERT INTO `wms_receipt_order_detail` VALUES (1327, 286, 107, 10000.00, 8888.00, 64, NULL, 0, NULL, NULL, NULL, NULL, NULL, 95, 111, 3); -INSERT INTO `wms_receipt_order_detail` VALUES (1328, 287, 106, 1.00, NULL, 55, NULL, 0, NULL, NULL, NULL, NULL, NULL, 86, 98, 0); -INSERT INTO `wms_receipt_order_detail` VALUES (1329, 287, 105, 1.00, NULL, 56, NULL, 0, NULL, NULL, NULL, NULL, NULL, 86, 98, 0); -INSERT INTO `wms_receipt_order_detail` VALUES (1330, 287, 104, 1.00, NULL, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, 89, 103, 0); -INSERT INTO `wms_receipt_order_detail` VALUES (1331, 287, 103, 4.00, NULL, 62, NULL, 0, NULL, NULL, NULL, NULL, NULL, 92, 109, 0); -INSERT INTO `wms_receipt_order_detail` VALUES (1334, 288, 107, 1.00, 1.00, 64, NULL, 0, NULL, NULL, NULL, NULL, NULL, 95, 111, 0); -INSERT INTO `wms_receipt_order_detail` VALUES (1335, 288, 106, 1.00, 1.00, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0); -INSERT INTO `wms_receipt_order_detail` VALUES (1336, 289, 107, 4.00, NULL, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, 84, 90, 0); -INSERT INTO `wms_receipt_order_detail` VALUES (1337, 289, 106, 3.00, NULL, 55, NULL, 0, NULL, NULL, NULL, NULL, NULL, 86, 98, 0); -INSERT INTO `wms_receipt_order_detail` VALUES (1338, 289, 104, 18.00, NULL, 55, NULL, 0, NULL, NULL, NULL, NULL, NULL, 86, 98, 0); -INSERT INTO `wms_receipt_order_detail` VALUES (1339, 289, 103, 122.00, NULL, 56, NULL, 0, NULL, NULL, NULL, NULL, NULL, 86, 98, 0); -INSERT INTO `wms_receipt_order_detail` VALUES (1340, 290, 104, 4.00, NULL, 55, NULL, 0, NULL, NULL, NULL, NULL, NULL, 86, 98, 0); -INSERT INTO `wms_receipt_order_detail` VALUES (1341, 290, 103, 3.00, NULL, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, 88, NULL, 0); -INSERT INTO `wms_receipt_order_detail` VALUES (1346, 292, 108, 15.00, 15.00, 65, NULL, 0, NULL, NULL, NULL, NULL, NULL, 98, 112, 3); -INSERT INTO `wms_receipt_order_detail` VALUES (1347, 291, 107, 1.00, 1.00, 55, NULL, 0, NULL, NULL, NULL, NULL, NULL, 86, 98, 0); -INSERT INTO `wms_receipt_order_detail` VALUES (1348, 291, 104, 1.00, 1.00, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, 88, NULL, 0); -INSERT INTO `wms_receipt_order_detail` VALUES (1350, 293, 110, 31.00, 1.00, 66, NULL, 0, NULL, NULL, NULL, NULL, NULL, 101, 115, 3); -INSERT INTO `wms_receipt_order_detail` VALUES (1352, 294, 110, 21.00, 14.00, 66, NULL, 0, NULL, NULL, NULL, NULL, NULL, 101, 115, 3); -INSERT INTO `wms_receipt_order_detail` VALUES (1355, 295, 111, 10.00, 10.00, 67, NULL, 0, NULL, NULL, NULL, NULL, NULL, 102, 116, 3); -INSERT INTO `wms_receipt_order_detail` VALUES (1363, 297, 113, 1.00, 1.00, 67, NULL, 0, NULL, NULL, NULL, NULL, NULL, 102, 116, 3); -INSERT INTO `wms_receipt_order_detail` VALUES (1364, 296, 113, 1.00, 1.00, 67, NULL, 0, NULL, NULL, NULL, NULL, NULL, 102, 116, 0); -INSERT INTO `wms_receipt_order_detail` VALUES (1365, 296, 112, 1.00, 1.00, 67, NULL, 0, NULL, NULL, NULL, NULL, NULL, 102, 116, 2); -INSERT INTO `wms_receipt_order_detail` VALUES (1366, 296, 111, 1.00, 1.00, 67, NULL, 0, NULL, NULL, NULL, NULL, NULL, 102, 116, 0); -INSERT INTO `wms_receipt_order_detail` VALUES (1367, 296, 110, 1.00, 1.00, 66, NULL, 0, NULL, NULL, NULL, NULL, NULL, 101, 115, 0); -INSERT INTO `wms_receipt_order_detail` VALUES (1372, 301, 115, 1.00, 1.00, 67, NULL, 0, NULL, NULL, NULL, NULL, NULL, 101, 115, 3); -INSERT INTO `wms_receipt_order_detail` VALUES (1373, 301, 114, 1.00, 1.00, 67, NULL, 0, NULL, NULL, NULL, NULL, NULL, 101, 115, 3); -INSERT INTO `wms_receipt_order_detail` VALUES (1380, 300, 114, 1.00, 1.00, 67, NULL, 0, NULL, NULL, NULL, NULL, NULL, 102, 116, 3); -INSERT INTO `wms_receipt_order_detail` VALUES (1388, 303, 111, 5.00, 1.00, 67, NULL, 0, NULL, NULL, NULL, NULL, NULL, 104, 117, 2); -INSERT INTO `wms_receipt_order_detail` VALUES (1389, 302, 112, 1.00, NULL, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0); -INSERT INTO `wms_receipt_order_detail` VALUES (1390, 302, 114, 1.00, NULL, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0); -INSERT INTO `wms_receipt_order_detail` VALUES (1391, 302, 111, 1.00, NULL, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0); -INSERT INTO `wms_receipt_order_detail` VALUES (1392, 302, 110, 1.00, NULL, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0); -INSERT INTO `wms_receipt_order_detail` VALUES (1393, 305, 115, 1.00, NULL, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0); -INSERT INTO `wms_receipt_order_detail` VALUES (1394, 305, 114, 1.00, NULL, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0); -INSERT INTO `wms_receipt_order_detail` VALUES (1400, 306, 115, 100.00, 10.00, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, 105, NULL, 3); -INSERT INTO `wms_receipt_order_detail` VALUES (1401, 298, 114, 100.00, 1.00, 67, NULL, 0, NULL, NULL, NULL, NULL, NULL, 102, 116, 4); -INSERT INTO `wms_receipt_order_detail` VALUES (1408, 307, 117, 1000.00, 999.00, 68, NULL, 0, NULL, NULL, NULL, NULL, NULL, 106, 118, 3); -INSERT INTO `wms_receipt_order_detail` VALUES (1412, 309, 117, 1.00, NULL, 68, NULL, 0, NULL, NULL, NULL, NULL, NULL, 106, 118, 0); -INSERT INTO `wms_receipt_order_detail` VALUES (1413, 311, 117, 1.00, NULL, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0); -INSERT INTO `wms_receipt_order_detail` VALUES (1416, 312, 117, 2.00, 1.00, 68, NULL, 0, NULL, NULL, NULL, NULL, NULL, 106, 118, 3); -INSERT INTO `wms_receipt_order_detail` VALUES (1421, 314, 117, 1.33, 1.33, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, 107, NULL, 0); -INSERT INTO `wms_receipt_order_detail` VALUES (1422, 314, 115, 13333434.00, 146654.00, 68, NULL, 0, NULL, NULL, NULL, NULL, NULL, 106, 118, 0); -INSERT INTO `wms_receipt_order_detail` VALUES (1423, 308, 117, 4.00, 4.00, 68, NULL, 0, NULL, NULL, NULL, NULL, NULL, 106, 118, 1); -INSERT INTO `wms_receipt_order_detail` VALUES (1424, 304, 115, 1.00, 1.00, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, 105, NULL, 3); -INSERT INTO `wms_receipt_order_detail` VALUES (1425, 304, 114, 1.00, 1.00, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, 105, NULL, 4); -INSERT INTO `wms_receipt_order_detail` VALUES (1426, 315, 117, 1.00, NULL, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0); -INSERT INTO `wms_receipt_order_detail` VALUES (1430, 317, 112, 3.00, 1.00, 66, NULL, 0, NULL, NULL, NULL, NULL, NULL, 101, 115, 3); -INSERT INTO `wms_receipt_order_detail` VALUES (1431, 317, 110, 3.00, 1.00, 66, NULL, 0, NULL, NULL, NULL, NULL, NULL, 101, 115, 3); -INSERT INTO `wms_receipt_order_detail` VALUES (1433, 316, 117, 1.00, 1.00, 68, NULL, 0, NULL, NULL, NULL, NULL, NULL, 106, 118, 2); -INSERT INTO `wms_receipt_order_detail` VALUES (1439, 320, 114, 8.00, 1.00, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, 107, NULL, 3); -INSERT INTO `wms_receipt_order_detail` VALUES (1440, 320, 112, 5.00, 1.00, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, 107, NULL, 3); -INSERT INTO `wms_receipt_order_detail` VALUES (1443, 319, 117, 7.00, 1.00, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, 107, NULL, 1); -INSERT INTO `wms_receipt_order_detail` VALUES (1449, 323, 117, 10.00, 1.00, 68, NULL, 0, NULL, NULL, NULL, NULL, NULL, 106, 118, 3); -INSERT INTO `wms_receipt_order_detail` VALUES (1450, 323, 115, 7.00, 1.00, 67, NULL, 0, NULL, NULL, NULL, NULL, NULL, 104, 117, 3); -INSERT INTO `wms_receipt_order_detail` VALUES (1451, 323, 114, 5.00, 1.00, 67, NULL, 0, NULL, NULL, NULL, NULL, NULL, 102, 116, 3); -INSERT INTO `wms_receipt_order_detail` VALUES (1452, 323, 113, 5.00, 1.00, 67, NULL, 0, NULL, NULL, NULL, NULL, NULL, 102, 116, 3); -INSERT INTO `wms_receipt_order_detail` VALUES (1454, 324, 117, 20.00, 1.00, 71, NULL, 0, NULL, NULL, NULL, NULL, NULL, 109, 120, 3); -INSERT INTO `wms_receipt_order_detail` VALUES (1459, 325, 117, 1.00, 1.00, 71, NULL, 0, NULL, NULL, NULL, NULL, NULL, 109, 120, 3); -INSERT INTO `wms_receipt_order_detail` VALUES (1460, 325, 112, 1.00, 1.00, 66, NULL, 0, NULL, NULL, NULL, NULL, NULL, 101, 115, 3); -INSERT INTO `wms_receipt_order_detail` VALUES (1463, 322, 117, 2.00, 1.00, 71, NULL, 0, NULL, NULL, NULL, NULL, NULL, 109, 120, 0); -INSERT INTO `wms_receipt_order_detail` VALUES (1466, 326, 117, 1.00, 2.00, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, 111, 121, 3); -INSERT INTO `wms_receipt_order_detail` VALUES (1467, 326, 112, 1.00, 1.00, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, 111, 121, 3); -INSERT INTO `wms_receipt_order_detail` VALUES (1470, 328, 117, 4.00, 1.00, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, 109, NULL, 0); -INSERT INTO `wms_receipt_order_detail` VALUES (1471, 328, 115, 1.00, 1.00, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, 109, NULL, 0); -INSERT INTO `wms_receipt_order_detail` VALUES (1487, 329, 117, 5.00, 4.00, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, 109, NULL, 0); -INSERT INTO `wms_receipt_order_detail` VALUES (1488, 329, 115, 5.00, 1.00, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, 112, 123, 0); -INSERT INTO `wms_receipt_order_detail` VALUES (1489, 329, 114, 5.00, 1.00, 67, NULL, 0, NULL, NULL, NULL, NULL, NULL, 102, 116, 0); -INSERT INTO `wms_receipt_order_detail` VALUES (1490, 330, 117, 1.00, NULL, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0); -INSERT INTO `wms_receipt_order_detail` VALUES (1493, 331, 118, 1000.00, 1.00, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 4); -INSERT INTO `wms_receipt_order_detail` VALUES (1495, 333, 119, 1.00, 1.00, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, 111, NULL, 3); -INSERT INTO `wms_receipt_order_detail` VALUES (1502, 334, 119, 4.00, 1.00, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, 111, NULL, 3); -INSERT INTO `wms_receipt_order_detail` VALUES (1503, 334, 118, 4.00, 1.00, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, 111, NULL, 2); -INSERT INTO `wms_receipt_order_detail` VALUES (1510, 336, 121, 1.00, 1.00, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, 111, NULL, 3); -INSERT INTO `wms_receipt_order_detail` VALUES (1511, 336, 119, 1.00, 1.00, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, 111, NULL, 3); -INSERT INTO `wms_receipt_order_detail` VALUES (1514, 337, 122, 1.00, 1.00, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, 115, 125, 3); -INSERT INTO `wms_receipt_order_detail` VALUES (1524, 339, 121, 6.00, 6.00, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, 111, NULL, 3); -INSERT INTO `wms_receipt_order_detail` VALUES (1525, 339, 120, 5.00, 5.00, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, 111, NULL, 3); -INSERT INTO `wms_receipt_order_detail` VALUES (1526, 339, 119, 6.00, 6.00, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, 111, NULL, 3); -INSERT INTO `wms_receipt_order_detail` VALUES (1527, 339, 118, 6.00, 6.00, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, 111, NULL, 3); -INSERT INTO `wms_receipt_order_detail` VALUES (1528, 338, 120, 3.00, NULL, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0); -INSERT INTO `wms_receipt_order_detail` VALUES (1529, 338, 119, 1.00, NULL, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0); -INSERT INTO `wms_receipt_order_detail` VALUES (1530, 338, 121, 1.00, NULL, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0); -INSERT INTO `wms_receipt_order_detail` VALUES (1531, 338, 118, 1.00, NULL, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0); -INSERT INTO `wms_receipt_order_detail` VALUES (1548, 341, 121, 1.00, 1.00, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, 114, NULL, 3); -INSERT INTO `wms_receipt_order_detail` VALUES (1549, 341, 120, 1.00, 1.00, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, 114, NULL, 3); -INSERT INTO `wms_receipt_order_detail` VALUES (1550, 341, 119, 1.00, 1.00, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, 114, NULL, 3); -INSERT INTO `wms_receipt_order_detail` VALUES (1551, 341, 118, 1.00, 1.00, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, 114, NULL, 3); -INSERT INTO `wms_receipt_order_detail` VALUES (1558, 343, 121, 4.00, 1.00, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, 113, NULL, 3); -INSERT INTO `wms_receipt_order_detail` VALUES (1561, 342, 121, 5.00, 1.00, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, 113, NULL, 3); -INSERT INTO `wms_receipt_order_detail` VALUES (1562, 342, 120, 4.00, 1.00, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, 113, NULL, 0); -INSERT INTO `wms_receipt_order_detail` VALUES (1567, 340, 121, 1.00, NULL, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0); -INSERT INTO `wms_receipt_order_detail` VALUES (1568, 340, 120, 1.00, NULL, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0); -INSERT INTO `wms_receipt_order_detail` VALUES (1569, 340, 119, 1.00, NULL, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0); -INSERT INTO `wms_receipt_order_detail` VALUES (1571, 344, 121, 11.00, 1.00, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, 111, NULL, 3); -INSERT INTO `wms_receipt_order_detail` VALUES (1574, 345, 121, 1.00, 1.00, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, 111, NULL, 0); -INSERT INTO `wms_receipt_order_detail` VALUES (1577, 348, 121, 100000.00, 322424.00, 74, NULL, 0, NULL, NULL, NULL, NULL, NULL, 116, 126, 3); -INSERT INTO `wms_receipt_order_detail` VALUES (1578, 348, 120, 1.00, 234324224.00, 74, NULL, 0, NULL, NULL, NULL, NULL, NULL, 116, 126, 3); -INSERT INTO `wms_receipt_order_detail` VALUES (1582, 349, 121, 100.00, 100.00, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, 116, NULL, 3); -INSERT INTO `wms_receipt_order_detail` VALUES (1583, 350, 121, 3.00, NULL, 74, NULL, 0, NULL, NULL, NULL, NULL, NULL, 116, 126, 0); -INSERT INTO `wms_receipt_order_detail` VALUES (1584, 350, 118, 2.00, NULL, 74, NULL, 0, NULL, NULL, NULL, NULL, NULL, 116, 126, 0); -INSERT INTO `wms_receipt_order_detail` VALUES (1588, 353, 123, 1.00, NULL, 74, NULL, 0, NULL, NULL, NULL, NULL, NULL, 116, 126, 0); -INSERT INTO `wms_receipt_order_detail` VALUES (1594, 355, 123, 2147483647.00, 2147483647.00, 74, NULL, 0, NULL, NULL, NULL, NULL, NULL, 116, 126, 3); -INSERT INTO `wms_receipt_order_detail` VALUES (1599, 351, 123, 1.00, 1.00, 74, NULL, 0, NULL, NULL, NULL, NULL, NULL, 116, 126, 4); -INSERT INTO `wms_receipt_order_detail` VALUES (1606, 356, 125, 1000.00, 1.00, 77, NULL, 0, NULL, NULL, NULL, NULL, NULL, 118, 128, 3); -INSERT INTO `wms_receipt_order_detail` VALUES (1607, 356, 124, 198.00, 1.00, 76, NULL, 0, NULL, NULL, NULL, NULL, NULL, 119, 131, 3); -INSERT INTO `wms_receipt_order_detail` VALUES (1608, 354, 123, 3.00, NULL, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0); -INSERT INTO `wms_receipt_order_detail` VALUES (1611, 357, 125, 1000.00, 1000.00, 77, NULL, 0, NULL, NULL, NULL, NULL, NULL, 118, 128, 3); -INSERT INTO `wms_receipt_order_detail` VALUES (1612, 357, 124, 190.00, 190.00, 79, NULL, 0, NULL, NULL, NULL, NULL, NULL, 119, 131, 3); -INSERT INTO `wms_receipt_order_detail` VALUES (1615, 358, 125, 100.00, 50.00, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0); -INSERT INTO `wms_receipt_order_detail` VALUES (1616, 359, 125, 1.00, NULL, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0); -INSERT INTO `wms_receipt_order_detail` VALUES (1619, 360, 124, 1.00, NULL, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0); -INSERT INTO `wms_receipt_order_detail` VALUES (1620, 360, 125, 1.00, NULL, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0); -INSERT INTO `wms_receipt_order_detail` VALUES (1625, 362, 125, 2.00, 1.00, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, 117, 127, 3); -INSERT INTO `wms_receipt_order_detail` VALUES (1626, 362, 124, 1.00, 1.00, 78, NULL, 0, NULL, NULL, NULL, NULL, NULL, 118, 129, 3); -INSERT INTO `wms_receipt_order_detail` VALUES (1629, 364, 125, 4.00, 1.00, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, 118, 129, 3); -INSERT INTO `wms_receipt_order_detail` VALUES (1630, 363, 125, 1.00, 1.00, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, 118, 129, 3); -INSERT INTO `wms_receipt_order_detail` VALUES (1632, 365, 125, 1.00, 1.00, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, 116, NULL, 3); -INSERT INTO `wms_receipt_order_detail` VALUES (1637, 367, 128, 2.00, 2.00, 90, NULL, 0, NULL, NULL, NULL, NULL, NULL, 122, 135, 3); -INSERT INTO `wms_receipt_order_detail` VALUES (1638, 367, 127, 11.00, 12.00, 91, NULL, 0, NULL, NULL, NULL, NULL, NULL, 122, 135, 3); -INSERT INTO `wms_receipt_order_detail` VALUES (1640, 368, 127, 100.00, 100.00, 90, NULL, 0, NULL, NULL, NULL, NULL, NULL, 122, 135, 3); -INSERT INTO `wms_receipt_order_detail` VALUES (1643, 369, 127, 200.00, 200.00, 90, NULL, 0, NULL, NULL, NULL, NULL, NULL, 122, 135, 3); -INSERT INTO `wms_receipt_order_detail` VALUES (1645, 370, 130, 13.00, 13.00, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, 117, 127, 3); -INSERT INTO `wms_receipt_order_detail` VALUES (1648, 371, 130, 6.00, 6.00, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, 117, 127, 3); -INSERT INTO `wms_receipt_order_detail` VALUES (1649, 372, 129, 2.00, NULL, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0); -INSERT INTO `wms_receipt_order_detail` VALUES (1656, 373, 130, 1.00, 1.00, 89, NULL, 0, NULL, NULL, NULL, NULL, NULL, 121, 134, 3); -INSERT INTO `wms_receipt_order_detail` VALUES (1657, 373, 129, 1.00, 1.00, 89, NULL, 0, NULL, NULL, NULL, NULL, NULL, 121, 134, 3); -INSERT INTO `wms_receipt_order_detail` VALUES (1658, 373, 128, 1.00, 1.00, 91, NULL, 0, NULL, NULL, NULL, NULL, NULL, 122, 135, 3); -INSERT INTO `wms_receipt_order_detail` VALUES (1659, 366, 130, 3.00, 1.00, 89, NULL, 0, NULL, NULL, NULL, NULL, NULL, 121, 134, 3); -INSERT INTO `wms_receipt_order_detail` VALUES (1660, 366, 129, 1.00, 1.00, 89, NULL, 0, NULL, NULL, NULL, NULL, NULL, 121, 134, 0); -INSERT INTO `wms_receipt_order_detail` VALUES (1670, 375, 130, 1.00, 1.00, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, 117, 127, 1); -INSERT INTO `wms_receipt_order_detail` VALUES (1677, 374, 130, 1.00, 1.00, 89, NULL, 0, NULL, NULL, NULL, NULL, NULL, 121, 134, 3); -INSERT INTO `wms_receipt_order_detail` VALUES (1678, 374, 129, 1.00, 1.00, 89, NULL, 0, NULL, NULL, NULL, NULL, NULL, 121, 134, 3); -INSERT INTO `wms_receipt_order_detail` VALUES (1679, 376, 130, 1.00, NULL, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0); -INSERT INTO `wms_receipt_order_detail` VALUES (1680, 376, 129, 1.00, NULL, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0); -INSERT INTO `wms_receipt_order_detail` VALUES (1681, 376, 128, 1.00, NULL, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0); -INSERT INTO `wms_receipt_order_detail` VALUES (1682, 376, 127, 1.00, NULL, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0); -INSERT INTO `wms_receipt_order_detail` VALUES (1683, 376, 126, 1.00, NULL, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0); -INSERT INTO `wms_receipt_order_detail` VALUES (1684, 376, 125, 1.00, NULL, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0); -INSERT INTO `wms_receipt_order_detail` VALUES (1685, 376, 124, 1.00, NULL, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0); -INSERT INTO `wms_receipt_order_detail` VALUES (1686, 377, 130, 1.00, NULL, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0); -INSERT INTO `wms_receipt_order_detail` VALUES (1687, 377, 129, 1.00, NULL, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0); -INSERT INTO `wms_receipt_order_detail` VALUES (1692, 379, 131, 20.00, 1.00, 92, NULL, 0, NULL, NULL, NULL, NULL, NULL, 117, 136, 3); -INSERT INTO `wms_receipt_order_detail` VALUES (1694, 380, 131, 200.00, 200.00, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, 117, 127, 3); -INSERT INTO `wms_receipt_order_detail` VALUES (1696, 378, 130, 1.00, 1.00, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, 117, 127, 0); -INSERT INTO `wms_receipt_order_detail` VALUES (1697, 378, 129, 1.00, 1.00, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, 117, NULL, 0); -INSERT INTO `wms_receipt_order_detail` VALUES (1698, 378, 128, 1.00, 1.00, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, 117, 127, 0); -INSERT INTO `wms_receipt_order_detail` VALUES (1699, 383, 132, 1.00, NULL, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0); -INSERT INTO `wms_receipt_order_detail` VALUES (1700, 384, 132, 1.00, NULL, 78, NULL, 0, NULL, NULL, NULL, NULL, NULL, 118, 129, 0); -INSERT INTO `wms_receipt_order_detail` VALUES (1701, 384, 131, 1.00, NULL, 89, NULL, 0, NULL, NULL, NULL, NULL, NULL, 121, 134, 0); -INSERT INTO `wms_receipt_order_detail` VALUES (1702, 384, 130, 1.00, NULL, 89, NULL, 0, NULL, NULL, NULL, NULL, NULL, 121, 134, 0); -INSERT INTO `wms_receipt_order_detail` VALUES (1708, 385, 133, 10.00, 10.00, 92, NULL, 0, NULL, NULL, NULL, NULL, NULL, 117, 136, 3); -INSERT INTO `wms_receipt_order_detail` VALUES (1710, 386, 133, 100.00, 1.00, 92, NULL, 0, NULL, NULL, NULL, NULL, NULL, 117, 136, 3); -INSERT INTO `wms_receipt_order_detail` VALUES (1722, 388, 133, 100.00, 10.00, 92, NULL, 0, NULL, NULL, NULL, NULL, NULL, 117, 136, 3); -INSERT INTO `wms_receipt_order_detail` VALUES (1729, 387, 132, 1.00, 1.00, 92, NULL, 0, NULL, NULL, NULL, NULL, NULL, 117, 136, 4); -INSERT INTO `wms_receipt_order_detail` VALUES (1730, 387, 131, 1.00, 1.00, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, 117, 136, 3); -INSERT INTO `wms_receipt_order_detail` VALUES (1731, 387, 131, 1.00, 1.00, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, 117, 136, 4); -INSERT INTO `wms_receipt_order_detail` VALUES (1732, 382, 132, 1.00, 1.00, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 3); -INSERT INTO `wms_receipt_order_detail` VALUES (1733, 390, 131, 2.00, NULL, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, 128, 140, 0); -INSERT INTO `wms_receipt_order_detail` VALUES (1734, 390, 120, 5.00, NULL, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, 128, 140, 0); -INSERT INTO `wms_receipt_order_detail` VALUES (1737, 391, 134, 14.00, 1.00, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, 130, NULL, 3); -INSERT INTO `wms_receipt_order_detail` VALUES (1739, 392, 134, 10.00, 10.00, 94, NULL, 0, NULL, NULL, NULL, NULL, NULL, 131, 142, 3); -INSERT INTO `wms_receipt_order_detail` VALUES (1740, 393, 134, 5.00, NULL, 94, NULL, 0, NULL, NULL, NULL, NULL, NULL, 131, 142, 0); -INSERT INTO `wms_receipt_order_detail` VALUES (1742, 394, 134, 1.00, 6.00, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, 132, NULL, 3); -INSERT INTO `wms_receipt_order_detail` VALUES (1744, 395, 135, 100.00, 1.00, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, 133, NULL, 3); -INSERT INTO `wms_receipt_order_detail` VALUES (1749, 396, 137, 8.00, 50.00, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 3); -INSERT INTO `wms_receipt_order_detail` VALUES (1750, 396, 136, 100.00, 100.00, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 3); -INSERT INTO `wms_receipt_order_detail` VALUES (1753, 397, 138, 5.00, 1.00, 96, NULL, 0, NULL, NULL, NULL, NULL, NULL, 134, 144, 3); -INSERT INTO `wms_receipt_order_detail` VALUES (1754, 397, 137, 8.00, 1.00, 96, NULL, 0, NULL, NULL, NULL, NULL, NULL, 134, 144, 3); -INSERT INTO `wms_receipt_order_detail` VALUES (1756, 398, 137, 1.00, 1.00, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, 135, NULL, 3); -INSERT INTO `wms_receipt_order_detail` VALUES (1758, 399, 138, 3.00, 1.00, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, 135, NULL, 3); -INSERT INTO `wms_receipt_order_detail` VALUES (1761, 400, 139, 100.00, 1.00, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, 136, 145, 3); -INSERT INTO `wms_receipt_order_detail` VALUES (1763, 401, 139, 100.00, 100.00, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, 136, 145, 3); -INSERT INTO `wms_receipt_order_detail` VALUES (1765, 402, 140, 2.00, 1.00, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, 135, 147, 3); -INSERT INTO `wms_receipt_order_detail` VALUES (1767, 403, 140, 4.00, 4.00, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, 135, 147, 3); -INSERT INTO `wms_receipt_order_detail` VALUES (1769, 404, 136, 3.00, 1.00, 96, NULL, 0, NULL, NULL, NULL, NULL, NULL, 135, 147, 3); -INSERT INTO `wms_receipt_order_detail` VALUES (1773, 405, 140, 1.00, 1.00, 96, NULL, 0, NULL, NULL, NULL, NULL, NULL, 135, 147, 1); -INSERT INTO `wms_receipt_order_detail` VALUES (1774, 405, 139, 1.00, 1.00, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, 136, NULL, 1); -INSERT INTO `wms_receipt_order_detail` VALUES (1775, 405, 138, 1.00, 1.00, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, 135, NULL, 1); -INSERT INTO `wms_receipt_order_detail` VALUES (1786, 407, 140, 1000.00, 1.00, 96, NULL, 0, NULL, NULL, NULL, NULL, NULL, 135, 147, 3); -INSERT INTO `wms_receipt_order_detail` VALUES (1787, 407, 139, 2000.00, 1.00, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, 136, 145, 3); -INSERT INTO `wms_receipt_order_detail` VALUES (1790, 408, 142, 100000.00, 1.00, 97, NULL, 0, NULL, NULL, NULL, NULL, NULL, 135, 147, 3); -INSERT INTO `wms_receipt_order_detail` VALUES (1792, 409, 142, 10000.00, 10000.00, 97, NULL, 0, NULL, NULL, NULL, NULL, NULL, 135, 147, 3); -INSERT INTO `wms_receipt_order_detail` VALUES (1797, 410, 142, 1.00, 1.00, 96, NULL, 0, NULL, NULL, NULL, NULL, NULL, 135, 147, 0); -INSERT INTO `wms_receipt_order_detail` VALUES (1798, 410, 139, 1.00, 1.00, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, 136, 145, 0); -INSERT INTO `wms_receipt_order_detail` VALUES (1799, 411, 141, 4.00, NULL, 97, NULL, 0, NULL, NULL, NULL, NULL, NULL, 135, 147, 0); -INSERT INTO `wms_receipt_order_detail` VALUES (1806, 413, 142, 4.00, 1.00, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, 137, 148, 3); -INSERT INTO `wms_receipt_order_detail` VALUES (1807, 413, 141, 3.00, 1.00, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, 137, NULL, 3); -INSERT INTO `wms_receipt_order_detail` VALUES (1809, 414, 140, 1.00, 1.00, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, 135, 149, 3); -INSERT INTO `wms_receipt_order_detail` VALUES (1811, 415, 142, 10.00, 1.00, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, 138, NULL, 3); -INSERT INTO `wms_receipt_order_detail` VALUES (1826, 416, 142, 1.00, 1.00, 97, NULL, 0, NULL, NULL, NULL, NULL, NULL, 135, 147, 3); -INSERT INTO `wms_receipt_order_detail` VALUES (1827, 416, 141, 1.00, 1.00, 96, NULL, 0, NULL, NULL, NULL, NULL, NULL, 135, 147, 3); -INSERT INTO `wms_receipt_order_detail` VALUES (1828, 416, 140, 1.00, 1.00, 96, NULL, 0, NULL, NULL, NULL, NULL, NULL, 135, 147, 3); -INSERT INTO `wms_receipt_order_detail` VALUES (1829, 416, 139, 1.00, 1.00, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, 136, NULL, 3); -INSERT INTO `wms_receipt_order_detail` VALUES (1830, 416, 138, 1.00, 1.00, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, 135, NULL, 3); -INSERT INTO `wms_receipt_order_detail` VALUES (1831, 416, 137, 1.00, 1.00, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, 135, NULL, 3); -INSERT INTO `wms_receipt_order_detail` VALUES (1832, 416, 136, 1.00, 1.00, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 3); -INSERT INTO `wms_receipt_order_detail` VALUES (1840, 419, 142, 1.00, NULL, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, 138, NULL, 0); -INSERT INTO `wms_receipt_order_detail` VALUES (1841, 419, 141, 1.00, NULL, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, 137, NULL, 0); -INSERT INTO `wms_receipt_order_detail` VALUES (1846, 421, 142, 1.00, 1.00, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, 136, 145, 3); -INSERT INTO `wms_receipt_order_detail` VALUES (1847, 421, 137, 1.00, 1.00, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, 135, NULL, 3); -INSERT INTO `wms_receipt_order_detail` VALUES (1854, 423, 142, 1.00, 1.00, 98, NULL, 0, NULL, NULL, NULL, NULL, NULL, 137, 148, 3); -INSERT INTO `wms_receipt_order_detail` VALUES (1855, 423, 141, 1.00, 1.00, 97, NULL, 0, NULL, NULL, NULL, NULL, NULL, 135, 147, 3); -INSERT INTO `wms_receipt_order_detail` VALUES (1859, 417, 142, 1.00, 1.00, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, 136, 145, 0); -INSERT INTO `wms_receipt_order_detail` VALUES (1860, 417, 141, 1.00, 1.00, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, 136, 145, 0); -INSERT INTO `wms_receipt_order_detail` VALUES (1861, 417, 140, 1.00, 1.00, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, 137, 148, 0); -INSERT INTO `wms_receipt_order_detail` VALUES (1864, 422, 142, 1.00, 1.00, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, 137, NULL, 3); -INSERT INTO `wms_receipt_order_detail` VALUES (1865, 422, 141, 1.00, 1.00, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, 138, NULL, 3); -INSERT INTO `wms_receipt_order_detail` VALUES (1866, 424, 142, 1.00, NULL, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0); -INSERT INTO `wms_receipt_order_detail` VALUES (1873, 425, 142, 1000.00, 188.00, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, 139, NULL, 2); -INSERT INTO `wms_receipt_order_detail` VALUES (1874, 425, 141, 8888.00, 6000.00, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, 135, NULL, 2); -INSERT INTO `wms_receipt_order_detail` VALUES (1876, 426, 141, 4.00, NULL, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, 135, NULL, 0); -INSERT INTO `wms_receipt_order_detail` VALUES (1880, 428, 143, 1.00, 1.00, 97, NULL, 0, NULL, NULL, NULL, NULL, NULL, 135, 147, 3); -INSERT INTO `wms_receipt_order_detail` VALUES (1884, 429, 143, 10.00, 1.00, 97, NULL, 0, NULL, NULL, NULL, NULL, NULL, 135, 147, 3); -INSERT INTO `wms_receipt_order_detail` VALUES (1885, 429, 142, 10.00, 1.00, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, 136, 145, 3); -INSERT INTO `wms_receipt_order_detail` VALUES (1886, 429, 139, 10.00, 1.00, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, 136, NULL, 3); -INSERT INTO `wms_receipt_order_detail` VALUES (1888, 430, 142, 11.00, 1.00, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, 135, 149, 3); -INSERT INTO `wms_receipt_order_detail` VALUES (1891, 433, 142, 4.00, 1.00, 97, NULL, 0, NULL, NULL, NULL, NULL, NULL, 135, 147, 0); -INSERT INTO `wms_receipt_order_detail` VALUES (1892, 433, 141, 1.00, 1.00, 98, NULL, 0, NULL, NULL, NULL, NULL, NULL, 137, 148, 0); -INSERT INTO `wms_receipt_order_detail` VALUES (1893, 434, 143, 1.00, NULL, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0); -INSERT INTO `wms_receipt_order_detail` VALUES (1895, 436, 143, 1.00, 1.00, 96, NULL, 0, NULL, NULL, NULL, NULL, NULL, 136, 145, 1); -INSERT INTO `wms_receipt_order_detail` VALUES (1902, 418, 141, 1.00, 1.00, 98, NULL, 0, NULL, NULL, NULL, NULL, NULL, 137, 148, 3); -INSERT INTO `wms_receipt_order_detail` VALUES (1903, 418, 140, 1.00, 1.00, 96, NULL, 0, NULL, NULL, NULL, NULL, NULL, 136, 145, 4); -INSERT INTO `wms_receipt_order_detail` VALUES (1914, 440, 144, 1.00, 1.00, 98, NULL, 0, NULL, NULL, NULL, NULL, NULL, 137, 148, 3); -INSERT INTO `wms_receipt_order_detail` VALUES (1915, 440, 143, 1.00, 1.00, 96, NULL, 0, NULL, NULL, NULL, NULL, NULL, 136, 145, 3); -INSERT INTO `wms_receipt_order_detail` VALUES (1916, 439, 144, 1.00, 1.00, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, 139, NULL, 3); -INSERT INTO `wms_receipt_order_detail` VALUES (1917, 439, 143, 1.00, 1.00, 96, NULL, 0, NULL, NULL, NULL, NULL, NULL, 136, 145, 3); -INSERT INTO `wms_receipt_order_detail` VALUES (1919, 441, 145, 5.00, 1.00, 99, NULL, 0, NULL, NULL, NULL, NULL, NULL, 149, 151, 3); -INSERT INTO `wms_receipt_order_detail` VALUES (1922, 442, 145, 2.00, 2.00, 99, NULL, 0, NULL, NULL, NULL, NULL, NULL, 149, 151, 3); -INSERT INTO `wms_receipt_order_detail` VALUES (1924, 443, 146, 100.00, 1.00, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, 150, NULL, 3); -INSERT INTO `wms_receipt_order_detail` VALUES (1925, 437, 144, 200.00, 1.00, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 3); -INSERT INTO `wms_receipt_order_detail` VALUES (1928, 444, 146, 1.00, 1.00, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 2); -INSERT INTO `wms_receipt_order_detail` VALUES (1929, 444, 145, 1.00, 1.00, 99, NULL, 0, NULL, NULL, NULL, NULL, NULL, 149, 151, 2); -INSERT INTO `wms_receipt_order_detail` VALUES (1960, 445, 146, 50.00, 1.00, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, 143, NULL, 3); -INSERT INTO `wms_receipt_order_detail` VALUES (1961, 445, 145, 30.00, 1.00, 99, NULL, 0, NULL, NULL, NULL, NULL, NULL, 149, 151, 3); -INSERT INTO `wms_receipt_order_detail` VALUES (1962, 445, 144, 20.00, 1.00, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 3); -INSERT INTO `wms_receipt_order_detail` VALUES (1963, 445, 143, 1.00, 1.00, 96, NULL, 0, NULL, NULL, NULL, NULL, NULL, 136, 145, 3); -INSERT INTO `wms_receipt_order_detail` VALUES (1964, 445, 142, 10.00, 1.00, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, 136, 145, 3); -INSERT INTO `wms_receipt_order_detail` VALUES (1965, 445, 141, 100.00, 1.00, 98, NULL, 0, NULL, NULL, NULL, NULL, NULL, 137, 148, 3); -INSERT INTO `wms_receipt_order_detail` VALUES (1966, 445, 140, 100.00, 1.00, 96, NULL, 0, NULL, NULL, NULL, NULL, NULL, 135, 147, 3); -INSERT INTO `wms_receipt_order_detail` VALUES (1967, 445, 139, 10.00, 1.00, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, 136, NULL, 3); -INSERT INTO `wms_receipt_order_detail` VALUES (1968, 445, 138, 10.00, 1.00, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, 135, NULL, 3); -INSERT INTO `wms_receipt_order_detail` VALUES (1969, 445, 137, 10.00, 1.00, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, 135, NULL, 3); -INSERT INTO `wms_receipt_order_detail` VALUES (1972, 446, 146, 1.00, 1.00, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, 136, NULL, 3); -INSERT INTO `wms_receipt_order_detail` VALUES (1973, 446, 145, 1.00, 1.00, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, 136, NULL, 3); -INSERT INTO `wms_receipt_order_detail` VALUES (1978, 450, 147, 50.00, 50.00, 100, NULL, 0, NULL, NULL, NULL, NULL, NULL, 154, 152, 3); -INSERT INTO `wms_receipt_order_detail` VALUES (1980, 451, 148, 10.00, 1.00, 102, NULL, 0, NULL, NULL, NULL, NULL, NULL, 155, 153, 3); -INSERT INTO `wms_receipt_order_detail` VALUES (1989, 452, 148, 1.00, 2.00, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 2); -INSERT INTO `wms_receipt_order_detail` VALUES (1990, 452, 147, 1.00, 1.00, 100, NULL, 0, NULL, NULL, NULL, NULL, NULL, 154, 152, 3); -INSERT INTO `wms_receipt_order_detail` VALUES (1991, 412, 142, 1.00, 1.00, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, 136, 145, 1); -INSERT INTO `wms_receipt_order_detail` VALUES (1992, 412, 141, 1.00, 1.00, 98, NULL, 0, NULL, NULL, NULL, NULL, NULL, 137, 148, 1); -INSERT INTO `wms_receipt_order_detail` VALUES (1993, 406, 140, 1.00, 1.00, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, 136, 145, 3); -INSERT INTO `wms_receipt_order_detail` VALUES (1994, 406, 139, 1.00, 1.00, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, 136, 145, 1); -INSERT INTO `wms_receipt_order_detail` VALUES (1995, 453, 141, 1.00, NULL, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0); -INSERT INTO `wms_receipt_order_detail` VALUES (1996, 453, 140, 1.00, NULL, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0); -INSERT INTO `wms_receipt_order_detail` VALUES (1997, 453, 139, 1.00, NULL, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0); -INSERT INTO `wms_receipt_order_detail` VALUES (2003, 454, 148, 1.00, 1.00, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 3); -INSERT INTO `wms_receipt_order_detail` VALUES (2004, 454, 147, 1.00, 1.00, 100, NULL, 0, NULL, NULL, NULL, NULL, NULL, 154, 152, 3); -INSERT INTO `wms_receipt_order_detail` VALUES (2005, 454, 146, 1.00, 1.00, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 3); -INSERT INTO `wms_receipt_order_detail` VALUES (2006, 454, 145, 1.00, 1.00, 99, NULL, 0, NULL, NULL, NULL, NULL, NULL, 149, 151, 3); -INSERT INTO `wms_receipt_order_detail` VALUES (2007, 454, 144, 1.00, 1.00, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 3); -INSERT INTO `wms_receipt_order_detail` VALUES (2012, 455, 148, 1.00, 1.00, 98, NULL, 0, NULL, NULL, NULL, NULL, NULL, 137, 148, 3); -INSERT INTO `wms_receipt_order_detail` VALUES (2013, 455, 147, 1.00, 1.00, 100, NULL, 0, NULL, NULL, NULL, NULL, NULL, 154, 152, 3); -INSERT INTO `wms_receipt_order_detail` VALUES (2014, 455, 146, 1.00, 1.00, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 3); -INSERT INTO `wms_receipt_order_detail` VALUES (2015, 455, 145, 1.00, 1.00, 99, NULL, 0, NULL, NULL, NULL, NULL, NULL, 149, 151, 3); -INSERT INTO `wms_receipt_order_detail` VALUES (2020, 457, 147, 1.00, 1.00, 101, NULL, 0, NULL, NULL, NULL, NULL, NULL, 154, 152, 3); -INSERT INTO `wms_receipt_order_detail` VALUES (2023, 458, 147, 1.00, 1.00, 100, NULL, 0, NULL, NULL, NULL, NULL, NULL, 154, 152, 0); -INSERT INTO `wms_receipt_order_detail` VALUES (2024, 459, 148, 1.00, NULL, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, 139, NULL, 0); -INSERT INTO `wms_receipt_order_detail` VALUES (2026, 461, 150, 1.00, 1.00, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, 139, NULL, 1); -INSERT INTO `wms_receipt_order_detail` VALUES (2027, 462, 150, 1.00, NULL, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0); -INSERT INTO `wms_receipt_order_detail` VALUES (2029, 463, 151, 1.00, 1.00, 98, NULL, 0, NULL, NULL, NULL, NULL, NULL, 137, 148, 1); -INSERT INTO `wms_receipt_order_detail` VALUES (2030, 464, 151, 1.00, NULL, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0); -INSERT INTO `wms_receipt_order_detail` VALUES (2031, 468, 153, 1.00, NULL, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0); -INSERT INTO `wms_receipt_order_detail` VALUES (2038, 470, 152, 1.00, 1.00, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, 137, NULL, 3); -INSERT INTO `wms_receipt_order_detail` VALUES (2053, 472, 151, 20.00, 10.00, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, 138, 150, 4); -INSERT INTO `wms_receipt_order_detail` VALUES (2054, 472, 150, 13.00, 10.00, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, 138, 150, 3); -INSERT INTO `wms_receipt_order_detail` VALUES (2055, 471, 151, 3.00, NULL, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, 137, NULL, 0); -INSERT INTO `wms_receipt_order_detail` VALUES (2056, 473, 155, 100.00, NULL, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, 163, 156, 0); -INSERT INTO `wms_receipt_order_detail` VALUES (2059, 474, 156, 200.50, 1.00, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, 165, 157, 3); -INSERT INTO `wms_receipt_order_detail` VALUES (2060, 474, 146, 10.00, 1.00, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, 164, NULL, 3); -INSERT INTO `wms_receipt_order_detail` VALUES (2066, 476, 157, 3.00, 1.00, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, 166, NULL, 3); -INSERT INTO `wms_receipt_order_detail` VALUES (2070, 477, 158, 300.00, 300.00, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, 143, NULL, 3); -INSERT INTO `wms_receipt_order_detail` VALUES (2074, 478, 159, 100.00, 100.00, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, 143, NULL, 3); -INSERT INTO `wms_receipt_order_detail` VALUES (2075, 479, 159, 1.00, NULL, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0); -INSERT INTO `wms_receipt_order_detail` VALUES (2076, 479, 157, 1.00, NULL, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0); -INSERT INTO `wms_receipt_order_detail` VALUES (2077, 480, 159, 1.00, NULL, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0); -INSERT INTO `wms_receipt_order_detail` VALUES (2078, 480, 158, 1.00, NULL, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0); -INSERT INTO `wms_receipt_order_detail` VALUES (2079, 480, 157, 1.00, NULL, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0); -INSERT INTO `wms_receipt_order_detail` VALUES (2080, 480, 156, 1.00, NULL, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0); -INSERT INTO `wms_receipt_order_detail` VALUES (2081, 480, 155, 1.00, NULL, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0); -INSERT INTO `wms_receipt_order_detail` VALUES (2082, 481, 159, 20.00, NULL, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, 137, NULL, 0); -INSERT INTO `wms_receipt_order_detail` VALUES (2083, 481, 158, 5.00, NULL, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0); -INSERT INTO `wms_receipt_order_detail` VALUES (2084, 481, 157, 4.00, NULL, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0); -INSERT INTO `wms_receipt_order_detail` VALUES (2085, 482, 159, 1.00, NULL, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, 138, 150, 0); -INSERT INTO `wms_receipt_order_detail` VALUES (2086, 482, 158, 1.00, NULL, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, 138, 150, 0); -INSERT INTO `wms_receipt_order_detail` VALUES (2087, 482, 157, 1.00, NULL, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, 138, 150, 0); -INSERT INTO `wms_receipt_order_detail` VALUES (2097, 484, 161, 1.00, 1.00, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, 138, 150, 3); -INSERT INTO `wms_receipt_order_detail` VALUES (2098, 484, 160, 1.00, 1.00, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, 140, NULL, 3); -INSERT INTO `wms_receipt_order_detail` VALUES (2099, 475, 156, 3.00, 1.00, 98, NULL, 0, NULL, NULL, NULL, NULL, NULL, 137, 148, 2); -INSERT INTO `wms_receipt_order_detail` VALUES (2100, 475, 155, 1.00, 1.00, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, 163, 156, 0); -INSERT INTO `wms_receipt_order_detail` VALUES (2105, 486, 161, 1.00, 1.00, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, 140, NULL, 2); -INSERT INTO `wms_receipt_order_detail` VALUES (2106, 486, 160, 1.00, 1.00, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, 138, 150, 1); -INSERT INTO `wms_receipt_order_detail` VALUES (2108, 485, 161, 1.00, 15.00, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, 140, NULL, 2); -INSERT INTO `wms_receipt_order_detail` VALUES (2119, 487, 160, 10.00, 6.00, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, 138, 150, 2); -INSERT INTO `wms_receipt_order_detail` VALUES (2120, 487, 158, 10.00, 6.00, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 2); -INSERT INTO `wms_receipt_order_detail` VALUES (2121, 466, 147, 1.00, NULL, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0); -INSERT INTO `wms_receipt_order_detail` VALUES (2122, 466, 145, 1.00, NULL, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0); -INSERT INTO `wms_receipt_order_detail` VALUES (2123, 488, 161, 1.00, NULL, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0); -INSERT INTO `wms_receipt_order_detail` VALUES (2124, 488, 160, 1.00, NULL, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0); -INSERT INTO `wms_receipt_order_detail` VALUES (2128, 491, 162, 100.00, 1.00, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, 138, 160, 3); -INSERT INTO `wms_receipt_order_detail` VALUES (2132, 492, 162, 99.00, 99.00, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, 138, 160, 3); -INSERT INTO `wms_receipt_order_detail` VALUES (2134, 493, 158, 1.00, 1.00, 110, NULL, 0, NULL, NULL, NULL, NULL, NULL, 138, 160, 0); -INSERT INTO `wms_receipt_order_detail` VALUES (2135, 494, 162, 1.00, NULL, 110, NULL, 0, NULL, NULL, NULL, NULL, NULL, 138, 160, 0); -INSERT INTO `wms_receipt_order_detail` VALUES (2136, 494, 158, 1.00, NULL, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0); -INSERT INTO `wms_receipt_order_detail` VALUES (2137, 494, 157, 3.00, NULL, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0); -INSERT INTO `wms_receipt_order_detail` VALUES (2138, 494, 156, 1.00, NULL, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0); -INSERT INTO `wms_receipt_order_detail` VALUES (2139, 494, 155, 1.00, NULL, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0); -INSERT INTO `wms_receipt_order_detail` VALUES (2140, 494, 154, 3.00, NULL, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0); -INSERT INTO `wms_receipt_order_detail` VALUES (2141, 494, 152, 1.00, NULL, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0); -INSERT INTO `wms_receipt_order_detail` VALUES (2142, 494, 151, 3.00, NULL, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0); -INSERT INTO `wms_receipt_order_detail` VALUES (2143, 494, 150, 3.00, NULL, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0); -INSERT INTO `wms_receipt_order_detail` VALUES (2144, 494, 149, 1.00, NULL, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0); -INSERT INTO `wms_receipt_order_detail` VALUES (2146, 489, 158, 1.00, 1.00, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, 138, 150, 3); -INSERT INTO `wms_receipt_order_detail` VALUES (2147, 469, 148, 1.00, 1.00, 98, NULL, 0, NULL, NULL, NULL, NULL, NULL, 137, 148, 3); -INSERT INTO `wms_receipt_order_detail` VALUES (2148, 469, 152, 1.00, 1.00, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, 138, 150, 3); -INSERT INTO `wms_receipt_order_detail` VALUES (2152, 497, 157, 1.00, 1.00, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, 138, 150, 3); -INSERT INTO `wms_receipt_order_detail` VALUES (2154, 498, 162, 1.00, 1.00, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, 138, 160, 3); -INSERT INTO `wms_receipt_order_detail` VALUES (2156, 499, 162, 987.00, 1.00, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, 138, 160, 3); -INSERT INTO `wms_receipt_order_detail` VALUES (2161, 495, 162, 1.00, 1.00, 110, NULL, 0, NULL, NULL, NULL, NULL, NULL, 138, 160, 3); -INSERT INTO `wms_receipt_order_detail` VALUES (2162, 495, 158, 1.00, 1.00, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, 143, NULL, 4); -INSERT INTO `wms_receipt_order_detail` VALUES (2170, 500, 162, 100.00, 50.00, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, 138, 160, 3); -INSERT INTO `wms_receipt_order_detail` VALUES (2174, 501, 157, 1000.00, 1000.00, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 3); -INSERT INTO `wms_receipt_order_detail` VALUES (2185, 502, 157, 1000.00, 500.00, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, 139, NULL, 3); -INSERT INTO `wms_receipt_order_detail` VALUES (2187, 504, 157, 1999.00, 1999.00, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, 144, NULL, 3); -INSERT INTO `wms_receipt_order_detail` VALUES (2189, 505, 157, 1001.00, 1001.00, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, 144, NULL, 3); -INSERT INTO `wms_receipt_order_detail` VALUES (2192, 507, 157, 1.00, NULL, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0); -INSERT INTO `wms_receipt_order_detail` VALUES (2193, 508, 162, 1.00, NULL, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0); -INSERT INTO `wms_receipt_order_detail` VALUES (2195, 509, 163, 100.00, 100.00, 110, NULL, 0, NULL, NULL, NULL, NULL, NULL, 138, 160, 3); -INSERT INTO `wms_receipt_order_detail` VALUES (2197, 510, 162, 111.00, 1.00, 104, NULL, 0, NULL, NULL, NULL, NULL, NULL, 139, 155, 3); -INSERT INTO `wms_receipt_order_detail` VALUES (2198, 506, 157, 1500.00, 700.00, 104, NULL, 0, NULL, NULL, NULL, NULL, NULL, 139, 155, 3); -INSERT INTO `wms_receipt_order_detail` VALUES (2200, 511, 162, 111.00, 1.00, 107, NULL, 0, NULL, NULL, NULL, NULL, NULL, 139, 155, 3); -INSERT INTO `wms_receipt_order_detail` VALUES (2202, 512, 162, 10.00, 5.00, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, 147, NULL, 3); -INSERT INTO `wms_receipt_order_detail` VALUES (2203, 513, 162, 1.00, NULL, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0); -INSERT INTO `wms_receipt_order_detail` VALUES (2204, 513, 158, 1.00, NULL, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0); -INSERT INTO `wms_receipt_order_detail` VALUES (2205, 513, 157, 1.00, NULL, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0); -INSERT INTO `wms_receipt_order_detail` VALUES (2206, 513, 156, 1.00, NULL, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0); -INSERT INTO `wms_receipt_order_detail` VALUES (2207, 513, 155, 1.00, NULL, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0); -INSERT INTO `wms_receipt_order_detail` VALUES (2208, 513, 154, 1.00, NULL, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0); -INSERT INTO `wms_receipt_order_detail` VALUES (2209, 513, 152, 1.00, NULL, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0); -INSERT INTO `wms_receipt_order_detail` VALUES (2210, 513, 151, 1.00, NULL, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0); -INSERT INTO `wms_receipt_order_detail` VALUES (2211, 513, 150, 1.00, NULL, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0); -INSERT INTO `wms_receipt_order_detail` VALUES (2212, 513, 149, 1.00, NULL, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0); -INSERT INTO `wms_receipt_order_detail` VALUES (2216, 514, 168, 1.00, 22.00, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, 181, NULL, 3); -INSERT INTO `wms_receipt_order_detail` VALUES (2219, 515, 169, 10.00, 1.00, 113, NULL, 0, NULL, NULL, NULL, NULL, NULL, 184, 169, 3); -INSERT INTO `wms_receipt_order_detail` VALUES (2221, 516, 169, 10.00, 10.00, 113, NULL, 0, NULL, NULL, NULL, NULL, NULL, 184, 169, 3); -INSERT INTO `wms_receipt_order_detail` VALUES (2222, 503, 162, 1.00, 1.00, 110, NULL, 0, NULL, NULL, NULL, NULL, NULL, 138, 160, 2); -INSERT INTO `wms_receipt_order_detail` VALUES (2223, 503, 156, 1.00, 1.00, 110, NULL, 0, NULL, NULL, NULL, NULL, NULL, 138, 160, 1); -INSERT INTO `wms_receipt_order_detail` VALUES (2230, 517, 169, 1.00, 1.00, 107, NULL, 0, NULL, NULL, NULL, NULL, NULL, 139, 155, 3); -INSERT INTO `wms_receipt_order_detail` VALUES (2231, 517, 162, 1.00, 1.00, 107, NULL, 0, NULL, NULL, NULL, NULL, NULL, 139, 155, 3); -INSERT INTO `wms_receipt_order_detail` VALUES (2263, 519, 169, 1.00, 1.00, 113, NULL, 0, NULL, NULL, NULL, NULL, NULL, 184, 169, 3); -INSERT INTO `wms_receipt_order_detail` VALUES (2264, 519, 168, 1.00, 1.00, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, 181, NULL, 4); -INSERT INTO `wms_receipt_order_detail` VALUES (2265, 519, 167, 1.00, 1.00, 107, NULL, 0, NULL, NULL, NULL, NULL, NULL, 139, 155, 0); -INSERT INTO `wms_receipt_order_detail` VALUES (2266, 519, 165, 1.00, 1.00, 109, NULL, 0, NULL, NULL, NULL, NULL, NULL, 139, 155, 3); -INSERT INTO `wms_receipt_order_detail` VALUES (2267, 519, 164, 1.00, 1.00, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, 147, NULL, 0); -INSERT INTO `wms_receipt_order_detail` VALUES (2268, 519, 162, 1.00, 1.00, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, 138, 160, 0); -INSERT INTO `wms_receipt_order_detail` VALUES (2269, 519, 158, 1.00, 1.00, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0); -INSERT INTO `wms_receipt_order_detail` VALUES (2270, 519, 157, 1.00, 1.00, 104, NULL, 0, NULL, NULL, NULL, NULL, NULL, 139, 155, 0); -INSERT INTO `wms_receipt_order_detail` VALUES (2271, 519, 156, 1.00, 1.00, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, 165, 157, 0); -INSERT INTO `wms_receipt_order_detail` VALUES (2272, 519, 155, 1.00, 1.00, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, 163, 156, 0); -INSERT INTO `wms_receipt_order_detail` VALUES (2273, 518, 169, 1.00, 1.00, 113, NULL, 0, NULL, NULL, NULL, NULL, NULL, 184, 169, 3); -INSERT INTO `wms_receipt_order_detail` VALUES (2278, 522, 162, 1.00, 1.00, 107, NULL, 0, NULL, NULL, NULL, NULL, NULL, 139, 155, 3); -INSERT INTO `wms_receipt_order_detail` VALUES (2280, 523, 170, 1.00, 1.00, 114, NULL, 0, NULL, NULL, NULL, NULL, NULL, 185, 170, 3); -INSERT INTO `wms_receipt_order_detail` VALUES (2287, 521, 169, 1.00, NULL, 107, NULL, 0, NULL, NULL, NULL, NULL, NULL, 139, 155, 0); -INSERT INTO `wms_receipt_order_detail` VALUES (2312, 524, 170, 6.00, 1.00, 107, NULL, 0, NULL, NULL, NULL, NULL, NULL, 139, 155, 3); -INSERT INTO `wms_receipt_order_detail` VALUES (2313, 524, 167, 7.00, 1.00, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, 140, 145, 0); -INSERT INTO `wms_receipt_order_detail` VALUES (2314, 524, 165, 4.00, 1.00, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, 151, NULL, 0); -INSERT INTO `wms_receipt_order_detail` VALUES (2315, 524, 162, 2.00, 1.00, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, 138, 160, 0); -INSERT INTO `wms_receipt_order_detail` VALUES (2316, 524, 158, 2.00, 1.00, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0); -INSERT INTO `wms_receipt_order_detail` VALUES (2317, 524, 157, 7.00, 1.00, 104, NULL, 0, NULL, NULL, NULL, NULL, NULL, 139, 155, 0); -INSERT INTO `wms_receipt_order_detail` VALUES (2320, 525, 170, 100.00, 100.00, 107, NULL, 0, NULL, NULL, NULL, NULL, NULL, 139, 155, 3); -INSERT INTO `wms_receipt_order_detail` VALUES (2321, 520, 168, 1.00, 1.00, 106, NULL, 0, NULL, NULL, NULL, NULL, NULL, 167, 158, 1); -INSERT INTO `wms_receipt_order_detail` VALUES (2323, 526, 170, 10.00, 1.00, 113, NULL, 0, NULL, NULL, NULL, NULL, NULL, 184, 169, 3); -INSERT INTO `wms_receipt_order_detail` VALUES (2324, 527, 169, 1.00, NULL, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0); -INSERT INTO `wms_receipt_order_detail` VALUES (2325, 527, 168, 1.00, NULL, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0); -INSERT INTO `wms_receipt_order_detail` VALUES (2329, 528, 171, 2.00, 2.00, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, 155, 172, 3); -INSERT INTO `wms_receipt_order_detail` VALUES (2332, 530, 171, 10.00, 1.00, 102, NULL, 0, NULL, NULL, NULL, NULL, NULL, 155, 171, 3); -INSERT INTO `wms_receipt_order_detail` VALUES (2334, 531, 172, 3.00, 1.00, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, 154, NULL, 3); -INSERT INTO `wms_receipt_order_detail` VALUES (2337, 532, 172, 1.00, 1.00, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, 154, NULL, 3); -INSERT INTO `wms_receipt_order_detail` VALUES (2338, 532, 171, 1.00, 1.00, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, 154, NULL, 3); -INSERT INTO `wms_receipt_order_detail` VALUES (2340, 533, 172, 16.00, 1.00, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, 190, NULL, 3); -INSERT INTO `wms_receipt_order_detail` VALUES (2343, 534, 172, 100.00, 1.00, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, 189, NULL, 2); -INSERT INTO `wms_receipt_order_detail` VALUES (2344, 534, 171, 200.00, 1.00, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, 189, NULL, 0); -INSERT INTO `wms_receipt_order_detail` VALUES (2350, 536, 173, 1.00, 3.00, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, 157, NULL, 2); -INSERT INTO `wms_receipt_order_detail` VALUES (2359, 535, 173, 6.00, 1.00, 115, NULL, 0, NULL, NULL, NULL, NULL, NULL, 178, 176, 3); -INSERT INTO `wms_receipt_order_detail` VALUES (2360, 535, 172, 4.00, 1.00, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, 157, NULL, 3); -INSERT INTO `wms_receipt_order_detail` VALUES (2365, 537, 172, 6.00, 3.00, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, 157, NULL, 3); -INSERT INTO `wms_receipt_order_detail` VALUES (2366, 537, 173, 2.00, 1.00, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, 157, NULL, 0); -INSERT INTO `wms_receipt_order_detail` VALUES (2369, 538, 173, 1000.00, 1.00, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, 157, NULL, 0); -INSERT INTO `wms_receipt_order_detail` VALUES (2376, 539, 171, 2.00, 1.00, 102, NULL, 0, NULL, NULL, NULL, NULL, NULL, 155, 171, 3); -INSERT INTO `wms_receipt_order_detail` VALUES (2377, 539, 172, 2.00, 7.00, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, 160, NULL, 3); -INSERT INTO `wms_receipt_order_detail` VALUES (2382, 541, 174, 10.00, 6.00, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, 157, NULL, 3); -INSERT INTO `wms_receipt_order_detail` VALUES (2383, 541, 173, 11.00, 5.00, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, 158, NULL, 3); -INSERT INTO `wms_receipt_order_detail` VALUES (2384, 542, 178, 100.00, NULL, 117, NULL, 0, NULL, NULL, NULL, NULL, NULL, 193, 180, 0); -INSERT INTO `wms_receipt_order_detail` VALUES (2385, 542, 176, 100.00, NULL, 118, NULL, 0, NULL, NULL, NULL, NULL, NULL, 194, 181, 0); -INSERT INTO `wms_receipt_order_detail` VALUES (2386, 543, 178, 3.00, NULL, 118, NULL, 0, NULL, NULL, NULL, NULL, NULL, 194, 181, 0); -INSERT INTO `wms_receipt_order_detail` VALUES (2387, 543, 176, 3.00, NULL, 120, NULL, 0, NULL, NULL, NULL, NULL, NULL, 196, 183, 0); -INSERT INTO `wms_receipt_order_detail` VALUES (2389, 544, 178, 55.00, 1.00, 116, NULL, 0, NULL, NULL, NULL, NULL, NULL, 192, 178, 3); -INSERT INTO `wms_receipt_order_detail` VALUES (2393, 546, 180, 100000.00, 1.00, 122, NULL, 0, NULL, NULL, NULL, NULL, NULL, 198, 185, 3); -INSERT INTO `wms_receipt_order_detail` VALUES (2394, 545, 178, 1.00, 1.00, 120, NULL, 0, NULL, NULL, NULL, NULL, NULL, 196, 183, 3); -INSERT INTO `wms_receipt_order_detail` VALUES (2397, 548, 180, 10.00, 1.00, 116, NULL, 0, NULL, NULL, NULL, NULL, NULL, 192, 178, 0); -INSERT INTO `wms_receipt_order_detail` VALUES (2398, 548, 178, 10.00, 1.00, 124, NULL, 0, NULL, NULL, NULL, NULL, NULL, 192, 178, 1); -INSERT INTO `wms_receipt_order_detail` VALUES (2403, 549, 180, 150.00, 1.00, 119, NULL, 0, NULL, NULL, NULL, NULL, NULL, 195, 182, 3); -INSERT INTO `wms_receipt_order_detail` VALUES (2404, 549, 178, 110.00, 1.00, 122, NULL, 0, NULL, NULL, NULL, NULL, NULL, 198, 185, 4); -INSERT INTO `wms_receipt_order_detail` VALUES (2407, 550, 180, 99.00, 1.00, 123, NULL, 0, NULL, NULL, NULL, NULL, NULL, 199, 186, 4); -INSERT INTO `wms_receipt_order_detail` VALUES (2408, 550, 178, 99.00, 1.00, 123, NULL, 0, NULL, NULL, NULL, NULL, NULL, 199, 186, 4); -INSERT INTO `wms_receipt_order_detail` VALUES (2411, 551, 180, 10.00, 1.00, 119, NULL, 0, NULL, NULL, NULL, NULL, NULL, 195, 182, 3); -INSERT INTO `wms_receipt_order_detail` VALUES (2413, 552, 180, 1.00, NULL, 116, NULL, 0, NULL, NULL, NULL, NULL, NULL, 192, 178, 0); -INSERT INTO `wms_receipt_order_detail` VALUES (2414, 553, 180, 2.00, NULL, 116, NULL, 0, NULL, NULL, NULL, NULL, NULL, 192, 178, 0); -INSERT INTO `wms_receipt_order_detail` VALUES (2418, 554, 180, 1.00, 1.00, 116, NULL, 0, NULL, NULL, NULL, NULL, NULL, 192, 178, 0); -INSERT INTO `wms_receipt_order_detail` VALUES (2419, 554, 178, 1.00, 1.00, 124, NULL, 0, NULL, NULL, NULL, NULL, NULL, 192, 178, 0); -INSERT INTO `wms_receipt_order_detail` VALUES (2420, 554, 176, 1.00, 1.00, 116, NULL, 0, NULL, NULL, NULL, NULL, NULL, 192, 178, 0); -INSERT INTO `wms_receipt_order_detail` VALUES (2423, 555, 180, 100.00, 1.00, 118, NULL, 0, NULL, NULL, NULL, NULL, NULL, 194, 181, 2); -INSERT INTO `wms_receipt_order_detail` VALUES (2424, 555, 176, 100.00, 1.00, 118, NULL, 0, NULL, NULL, NULL, NULL, NULL, 194, 181, 3); -INSERT INTO `wms_receipt_order_detail` VALUES (2427, 556, 180, 10.00, 1.00, 117, NULL, 0, NULL, NULL, NULL, NULL, NULL, 193, 180, 1); -INSERT INTO `wms_receipt_order_detail` VALUES (2430, 559, 180, 3.00, NULL, 117, NULL, 0, NULL, NULL, NULL, NULL, NULL, 193, 180, 0); -INSERT INTO `wms_receipt_order_detail` VALUES (2431, 559, 178, 5.00, NULL, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0); -INSERT INTO `wms_receipt_order_detail` VALUES (2432, 559, 176, 3.00, NULL, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0); -INSERT INTO `wms_receipt_order_detail` VALUES (2437, 561, 180, 1.00, 1.00, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, 193, NULL, 3); -INSERT INTO `wms_receipt_order_detail` VALUES (2439, 560, 178, 10.00, 10.00, 118, NULL, 0, NULL, NULL, NULL, NULL, NULL, 194, 181, 2); -INSERT INTO `wms_receipt_order_detail` VALUES (2442, 562, 180, 203.00, 203.00, 122, NULL, 0, NULL, NULL, NULL, NULL, NULL, 198, 185, 3); -INSERT INTO `wms_receipt_order_detail` VALUES (2443, 558, 180, 1.00, 1.00, 122, NULL, 0, NULL, NULL, NULL, NULL, NULL, 198, 185, 0); -INSERT INTO `wms_receipt_order_detail` VALUES (2444, 557, 178, 1.00, 1.00, 117, NULL, 0, NULL, NULL, NULL, NULL, NULL, 193, 180, 0); -INSERT INTO `wms_receipt_order_detail` VALUES (2448, 563, 180, 1.00, 1.00, 124, NULL, 0, NULL, NULL, NULL, NULL, NULL, 193, 178, 0); -INSERT INTO `wms_receipt_order_detail` VALUES (2449, 563, 178, 1.00, 1.00, 118, NULL, 0, NULL, NULL, NULL, NULL, NULL, 194, 181, 0); -INSERT INTO `wms_receipt_order_detail` VALUES (2450, 563, 176, 1.00, 1.00, 121, NULL, 0, NULL, NULL, NULL, NULL, NULL, 197, 184, 0); -INSERT INTO `wms_receipt_order_detail` VALUES (2451, 564, 180, 3.00, NULL, 116, NULL, 0, NULL, NULL, NULL, NULL, NULL, 193, 178, 0); -INSERT INTO `wms_receipt_order_detail` VALUES (2452, 564, 178, 4.00, NULL, 124, NULL, 0, NULL, NULL, NULL, NULL, NULL, 193, 178, 0); -INSERT INTO `wms_receipt_order_detail` VALUES (2453, 564, 176, 5.00, NULL, 121, NULL, 0, NULL, NULL, NULL, NULL, NULL, 197, 184, 0); -INSERT INTO `wms_receipt_order_detail` VALUES (2456, 565, 180, 100.00, 10.00, 116, NULL, 0, NULL, NULL, NULL, NULL, NULL, 193, 178, 2); -INSERT INTO `wms_receipt_order_detail` VALUES (2459, 566, 182, 100.00, 50.00, 116, NULL, 0, NULL, NULL, NULL, NULL, NULL, 193, 178, 2); -INSERT INTO `wms_receipt_order_detail` VALUES (2460, 566, 181, 100.00, 50.00, 124, NULL, 0, NULL, NULL, NULL, NULL, NULL, 193, 178, 2); -INSERT INTO `wms_receipt_order_detail` VALUES (2464, 568, 182, 1.00, 1.00, 118, NULL, 0, NULL, NULL, NULL, NULL, NULL, 194, 181, 3); -INSERT INTO `wms_receipt_order_detail` VALUES (2469, 570, 182, 1.00, NULL, 124, NULL, 0, NULL, NULL, NULL, NULL, NULL, 193, 178, 0); -INSERT INTO `wms_receipt_order_detail` VALUES (2470, 570, 181, 1.00, NULL, 124, NULL, 0, NULL, NULL, NULL, NULL, NULL, 193, 178, 0); -INSERT INTO `wms_receipt_order_detail` VALUES (2473, 571, 182, 7.00, 1.00, 124, NULL, 0, NULL, NULL, NULL, NULL, NULL, 193, 178, 3); -INSERT INTO `wms_receipt_order_detail` VALUES (2474, 571, 181, 1.00, 1.00, 124, NULL, 0, NULL, NULL, NULL, NULL, NULL, 193, 178, 3); -INSERT INTO `wms_receipt_order_detail` VALUES (2478, 572, 182, 5.00, 1.00, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, 194, 181, 3); -INSERT INTO `wms_receipt_order_detail` VALUES (2479, 572, 181, 1.00, 1.00, 116, NULL, 0, NULL, NULL, NULL, NULL, NULL, 193, 178, 3); -INSERT INTO `wms_receipt_order_detail` VALUES (2480, 572, 180, 1.00, 1.00, 122, NULL, 0, NULL, NULL, NULL, NULL, NULL, 198, 185, 3); -INSERT INTO `wms_receipt_order_detail` VALUES (2481, 573, 182, 6.00, NULL, 119, NULL, 0, NULL, NULL, NULL, NULL, NULL, 195, 182, 0); -INSERT INTO `wms_receipt_order_detail` VALUES (2482, 569, 182, 2.00, 1.00, 124, NULL, 0, NULL, NULL, NULL, NULL, NULL, 193, 178, 3); -INSERT INTO `wms_receipt_order_detail` VALUES (2483, 569, 181, 3.00, 1.00, 116, NULL, 0, NULL, NULL, NULL, NULL, NULL, 193, 178, 3); -INSERT INTO `wms_receipt_order_detail` VALUES (2484, 569, 180, 3.00, 1.00, 122, NULL, 0, NULL, NULL, NULL, NULL, NULL, 198, 185, 3); -INSERT INTO `wms_receipt_order_detail` VALUES (2485, 567, 182, 1.00, 1.00, 118, NULL, 0, NULL, NULL, NULL, NULL, NULL, 194, 181, 3); -INSERT INTO `wms_receipt_order_detail` VALUES (2488, 574, 181, 1.00, NULL, 119, NULL, 0, NULL, NULL, NULL, NULL, NULL, 195, 182, 0); -INSERT INTO `wms_receipt_order_detail` VALUES (2489, 574, 180, 1.00, NULL, 121, NULL, 0, NULL, NULL, NULL, NULL, NULL, 197, 184, 0); -INSERT INTO `wms_receipt_order_detail` VALUES (2490, 575, 182, 1.00, NULL, 126, NULL, 0, NULL, NULL, NULL, NULL, NULL, 210, 188, 0); -INSERT INTO `wms_receipt_order_detail` VALUES (2491, 576, 182, 1.00, NULL, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0); -INSERT INTO `wms_receipt_order_detail` VALUES (2505, 577, 182, 5.00, 2.00, 118, NULL, 0, NULL, NULL, NULL, NULL, NULL, 194, 181, 0); -INSERT INTO `wms_receipt_order_detail` VALUES (2506, 577, 181, 4.00, 2.00, 116, NULL, 0, NULL, NULL, NULL, NULL, NULL, 193, 178, 0); -INSERT INTO `wms_receipt_order_detail` VALUES (2507, 577, 180, 3.00, 2.00, 122, NULL, 0, NULL, NULL, NULL, NULL, NULL, 198, 185, 0); -INSERT INTO `wms_receipt_order_detail` VALUES (2508, 580, 182, 1.00, NULL, 118, NULL, 0, NULL, NULL, NULL, NULL, NULL, 194, 181, 0); -INSERT INTO `wms_receipt_order_detail` VALUES (2509, 582, 182, 1.00, NULL, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0); -INSERT INTO `wms_receipt_order_detail` VALUES (2510, 579, 182, 1000.00, 800.00, 118, NULL, 0, NULL, NULL, NULL, NULL, NULL, 194, 181, 1); -INSERT INTO `wms_receipt_order_detail` VALUES (2511, 579, 181, 1000.00, 500.00, 118, NULL, 0, NULL, NULL, NULL, NULL, NULL, 194, 181, 1); -INSERT INTO `wms_receipt_order_detail` VALUES (2516, 584, 182, 1.00, 1.00, 118, NULL, 0, NULL, NULL, NULL, NULL, NULL, 194, 181, 3); -INSERT INTO `wms_receipt_order_detail` VALUES (2517, 584, 181, 1.00, 1.00, 118, NULL, 0, NULL, NULL, NULL, NULL, NULL, 194, 181, 3); -INSERT INTO `wms_receipt_order_detail` VALUES (2520, 585, 182, 100.00, 1.00, 118, NULL, 0, NULL, NULL, NULL, NULL, NULL, 194, 181, 3); -INSERT INTO `wms_receipt_order_detail` VALUES (2521, 585, 181, 100.00, 1.00, 118, NULL, 0, NULL, NULL, NULL, NULL, NULL, 194, 181, 3); -INSERT INTO `wms_receipt_order_detail` VALUES (2524, 583, 182, 3.00, 1.00, 118, NULL, 0, NULL, NULL, NULL, NULL, NULL, 194, 181, 0); -INSERT INTO `wms_receipt_order_detail` VALUES (2525, 583, 181, 1.00, 1.00, 116, NULL, 0, NULL, NULL, NULL, NULL, NULL, 193, 178, 0); -INSERT INTO `wms_receipt_order_detail` VALUES (2527, 587, 182, 1.00, NULL, 118, NULL, 0, NULL, NULL, NULL, NULL, NULL, 194, 181, 0); -INSERT INTO `wms_receipt_order_detail` VALUES (2528, 586, 182, 1.00, 1.00, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, 196, 183, 3); -INSERT INTO `wms_receipt_order_detail` VALUES (2529, 586, 181, 1.00, 1.00, 124, NULL, 0, NULL, NULL, NULL, NULL, NULL, 198, 185, 0); -INSERT INTO `wms_receipt_order_detail` VALUES (2533, 588, 182, 1.00, 1.00, 118, NULL, 0, NULL, NULL, NULL, NULL, NULL, 194, 181, 0); -INSERT INTO `wms_receipt_order_detail` VALUES (2534, 588, 184, 1.00, 1.00, 118, NULL, 0, NULL, NULL, NULL, NULL, NULL, 194, 181, 0); -INSERT INTO `wms_receipt_order_detail` VALUES (2535, 589, 181, 1.00, NULL, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, 194, NULL, 0); -INSERT INTO `wms_receipt_order_detail` VALUES (2536, 589, 182, 2.00, NULL, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, 195, 182, 0); -INSERT INTO `wms_receipt_order_detail` VALUES (2543, 591, 184, 1.00, 1.00, 118, NULL, 0, NULL, NULL, NULL, NULL, NULL, 194, 181, 3); -INSERT INTO `wms_receipt_order_detail` VALUES (2544, 591, 182, 1.00, 1.00, 121, NULL, 0, NULL, NULL, NULL, NULL, NULL, 195, 182, 3); -INSERT INTO `wms_receipt_order_detail` VALUES (2545, 591, 181, 1.00, 1.00, 124, NULL, 0, NULL, NULL, NULL, NULL, NULL, 198, 185, 3); -INSERT INTO `wms_receipt_order_detail` VALUES (2546, 590, 182, 3.00, 1.00, 123, NULL, 0, NULL, NULL, NULL, NULL, NULL, 199, 186, 0); -INSERT INTO `wms_receipt_order_detail` VALUES (2547, 590, 181, 3.00, 1.00, 124, NULL, 0, NULL, NULL, NULL, NULL, NULL, 198, 185, 0); -INSERT INTO `wms_receipt_order_detail` VALUES (2548, 590, 180, 100.00, 1.00, 118, NULL, 0, NULL, NULL, NULL, NULL, NULL, 194, 181, 0); -INSERT INTO `wms_receipt_order_detail` VALUES (2552, 592, 185, 200.00, 1.00, 127, NULL, 0, NULL, NULL, NULL, NULL, NULL, 215, 189, 3); -INSERT INTO `wms_receipt_order_detail` VALUES (2553, 593, 185, 1.00, NULL, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0); -INSERT INTO `wms_receipt_order_detail` VALUES (2554, 593, 184, 1.00, NULL, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0); -INSERT INTO `wms_receipt_order_detail` VALUES (2560, 595, 185, 1.00, 1.00, 118, NULL, 0, NULL, NULL, NULL, NULL, NULL, 194, 181, 3); -INSERT INTO `wms_receipt_order_detail` VALUES (2561, 595, 183, 1.00, 1.00, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, 196, 183, 3); -INSERT INTO `wms_receipt_order_detail` VALUES (2562, 596, 185, 1000.00, NULL, 118, NULL, 0, NULL, NULL, NULL, NULL, NULL, 194, 181, 0); -INSERT INTO `wms_receipt_order_detail` VALUES (2564, 597, 186, 12.00, 14.00, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, 196, 183, 3); -INSERT INTO `wms_receipt_order_detail` VALUES (2591, 599, 186, 3.00, 3.00, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, 196, 183, 4); -INSERT INTO `wms_receipt_order_detail` VALUES (2592, 599, 183, 4.00, 1.00, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 3); -INSERT INTO `wms_receipt_order_detail` VALUES (2593, 599, 182, 5.00, 1.00, 118, NULL, 0, NULL, NULL, NULL, NULL, NULL, 194, 181, 3); -INSERT INTO `wms_receipt_order_detail` VALUES (2594, 598, 186, 4.00, 4.00, 118, NULL, 0, NULL, NULL, NULL, NULL, NULL, 194, 181, 3); -INSERT INTO `wms_receipt_order_detail` VALUES (2595, 598, 183, 3.00, 3.00, 119, NULL, 0, NULL, NULL, NULL, NULL, NULL, 195, 182, 3); -INSERT INTO `wms_receipt_order_detail` VALUES (2602, 601, 187, 1.00, 1.00, 117, NULL, 0, NULL, NULL, NULL, NULL, NULL, 194, 181, 3); -INSERT INTO `wms_receipt_order_detail` VALUES (2606, 600, 182, 1.00, NULL, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, 196, 183, 0); -INSERT INTO `wms_receipt_order_detail` VALUES (2610, 603, 188, 1.00, NULL, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, 198, 185, 0); -INSERT INTO `wms_receipt_order_detail` VALUES (2616, 609, 176, 1.00, 1.00, 116, NULL, 0, NULL, NULL, NULL, NULL, NULL, 192, 178, 0); -INSERT INTO `wms_receipt_order_detail` VALUES (2617, 594, 181, 6.00, 6.00, 118, NULL, 0, NULL, NULL, NULL, NULL, NULL, 194, 181, 3); -INSERT INTO `wms_receipt_order_detail` VALUES (2618, 610, 188, 2.00, NULL, NULL, 222.00, 0, NULL, NULL, NULL, NULL, NULL, 198, 185, 0); -INSERT INTO `wms_receipt_order_detail` VALUES (2621, 611, 188, 1.00, 1.00, 117, NULL, 0, NULL, NULL, NULL, NULL, NULL, 194, 181, 3); -INSERT INTO `wms_receipt_order_detail` VALUES (2622, 612, 188, 1.00, NULL, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0); -INSERT INTO `wms_receipt_order_detail` VALUES (2623, 602, 188, 2147483647.00, NULL, NULL, 0.00, 0, NULL, NULL, NULL, NULL, NULL, 225, 210, 0); -INSERT INTO `wms_receipt_order_detail` VALUES (2624, 602, 187, 2147483647.00, NULL, NULL, 0.00, 0, NULL, NULL, NULL, NULL, NULL, 225, 210, 0); -INSERT INTO `wms_receipt_order_detail` VALUES (2625, 602, 186, 2147483647.00, NULL, NULL, 0.00, 0, NULL, NULL, NULL, NULL, NULL, 225, 210, 0); -INSERT INTO `wms_receipt_order_detail` VALUES (2626, 617, 109, 2.00, NULL, NULL, 3.00, 0, NULL, NULL, NULL, NULL, NULL, 230, NULL, 0); -INSERT INTO `wms_receipt_order_detail` VALUES (2627, 618, 165, 1.00, NULL, NULL, 2.00, 0, NULL, NULL, NULL, NULL, NULL, 229, 216, 0); -INSERT INTO `wms_receipt_order_detail` VALUES (2628, 619, 130, 1.00, NULL, NULL, 1.00, 0, NULL, NULL, NULL, NULL, NULL, 230, NULL, 0); -INSERT INTO `wms_receipt_order_detail` VALUES (2633, 621, 193, 1.00, 1.00, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, 230, NULL, 3); -INSERT INTO `wms_receipt_order_detail` VALUES (2634, 621, 191, 1.00, 1.00, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, 229, NULL, 3); -INSERT INTO `wms_receipt_order_detail` VALUES (2635, 621, 190, 1.00, 1.00, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, 229, NULL, 3); -INSERT INTO `wms_receipt_order_detail` VALUES (2636, 621, 189, 1.00, 1.00, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, 231, NULL, 3); -INSERT INTO `wms_receipt_order_detail` VALUES (2637, 620, 189, 1.00, NULL, NULL, 1.00, 0, NULL, NULL, NULL, NULL, NULL, 231, 217, 0); -INSERT INTO `wms_receipt_order_detail` VALUES (2639, 624, 193, 1.00, NULL, NULL, 10.00, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0); -INSERT INTO `wms_receipt_order_detail` VALUES (2641, 625, 193, 10.00, 1.00, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, 229, 216, 3); - --- ---------------------------- --- Table structure for wms_shipment_order --- ---------------------------- -DROP TABLE IF EXISTS `wms_shipment_order`; -CREATE TABLE `wms_shipment_order` ( - `id` bigint(20) NOT NULL AUTO_INCREMENT, - `shipment_order_no` varchar(22) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '出库单号,系统自动生成', - `shipment_order_type` int(11) NULL DEFAULT NULL COMMENT '出库类型', - `order_no` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '出库订单', - `customer_id` bigint(20) NULL DEFAULT NULL COMMENT '客户', - `receivable_amount` decimal(10, 2) NULL DEFAULT NULL COMMENT '订单金额', - `shipment_order_status` tinyint(4) NULL DEFAULT NULL COMMENT '出库单状态', - `check_status` tinyint(4) NULL DEFAULT NULL COMMENT '审核状态', - `check_user_id` bigint(20) NULL DEFAULT NULL COMMENT '审核人', - `check_time` datetime(3) NULL DEFAULT NULL COMMENT '审核时间', - `wave_no` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '波次号', - `remark` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '备注', - `del_flag` tinyint(4) NOT NULL DEFAULT 0 COMMENT '删除标识', - `create_by` bigint(20) NULL DEFAULT NULL COMMENT '创建人', - `create_time` datetime(3) NULL DEFAULT NULL COMMENT '创建时间', - `update_by` bigint(20) NULL DEFAULT NULL COMMENT '修改人', - `update_time` datetime(3) NULL DEFAULT NULL COMMENT '修改时间', - PRIMARY KEY (`id`) USING BTREE -) ENGINE = InnoDB AUTO_INCREMENT = 273 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '出库单' ROW_FORMAT = Dynamic; - --- ---------------------------- --- Records of wms_shipment_order --- ---------------------------- - --- ---------------------------- --- Table structure for wms_shipment_order_detail --- ---------------------------- -DROP TABLE IF EXISTS `wms_shipment_order_detail`; -CREATE TABLE `wms_shipment_order_detail` ( - `id` bigint(20) NOT NULL AUTO_INCREMENT, - `shipment_order_id` bigint(20) NULL DEFAULT NULL COMMENT '出库单', - `item_id` bigint(20) NULL DEFAULT NULL COMMENT '物料', - `plan_quantity` decimal(20, 2) NULL DEFAULT NULL COMMENT '计划数量', - `real_quantity` decimal(20, 2) NULL DEFAULT NULL COMMENT '实际数量', - `rack_id` bigint(20) NULL DEFAULT NULL COMMENT '货架', - `money` decimal(10, 2) NULL DEFAULT NULL COMMENT '金额', - `del_flag` tinyint(4) NOT NULL DEFAULT 0 COMMENT '删除标识', - `remark` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '备注', - `create_by` bigint(20) NULL DEFAULT NULL COMMENT '创建人', - `create_time` datetime(3) NULL DEFAULT NULL COMMENT '创建时间', - `update_by` bigint(20) NULL DEFAULT NULL COMMENT '修改人', - `update_time` datetime(3) NULL DEFAULT NULL COMMENT '修改时间', - `warehouse_id` bigint(20) NULL DEFAULT NULL COMMENT '所属仓库', - `area_id` bigint(20) NULL DEFAULT NULL COMMENT '所属库区', - `shipment_order_status` tinyint(4) NULL DEFAULT NULL COMMENT '出库状态', - PRIMARY KEY (`id`) USING BTREE -) ENGINE = InnoDB AUTO_INCREMENT = 889 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '出库单详情' ROW_FORMAT = Dynamic; - --- ---------------------------- --- Records of wms_shipment_order_detail --- ---------------------------- - --- ---------------------------- --- Table structure for wms_supplier --- ---------------------------- -DROP TABLE IF EXISTS `wms_supplier`; -CREATE TABLE `wms_supplier` ( - `id` bigint(20) NOT NULL AUTO_INCREMENT, - `supplier_no` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '编号', - `supplier_name` varchar(60) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '名称', - `bank_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '开户行', - `bank_account` varchar(40) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '银行账户', - `payable_amount` decimal(10, 2) NULL DEFAULT 0.00 COMMENT '应付款', - `address` varchar(80) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '地址', - `mobile_no` varchar(13) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '手机号', - `tel_no` varchar(13) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '座机号', - `contact` varchar(30) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '联系人', - `level` varchar(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '级别', - `email` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT 'Email', - `remark` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '备注', - `del_flag` tinyint(4) NOT NULL DEFAULT 0 COMMENT '删除标识', - `create_by` bigint(20) NULL DEFAULT NULL COMMENT '创建人', - `create_time` datetime(3) NULL DEFAULT NULL COMMENT '创建时间', - `update_by` bigint(20) NULL DEFAULT NULL COMMENT '修改人', - `update_time` datetime(3) NULL DEFAULT NULL COMMENT '修改时间', - PRIMARY KEY (`id`) USING BTREE -) ENGINE = InnoDB AUTO_INCREMENT = 53 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '供应商' ROW_FORMAT = Dynamic; - --- ---------------------------- --- Records of wms_supplier --- ---------------------------- -INSERT INTO `wms_supplier` VALUES (1, 'youda', '友达光电', NULL, NULL, NULL, NULL, NULL, NULL, NULL, '第一级', NULL, NULL, 1, 1, '2022-08-19 09:08:03.000', 115, '2022-11-25 20:29:35.345'); -INSERT INTO `wms_supplier` VALUES (2, 'huawei', '华为', NULL, NULL, NULL, NULL, NULL, NULL, NULL, '第一级', NULL, NULL, 1, 1, '2022-09-07 17:15:38.364', NULL, NULL); -INSERT INTO `wms_supplier` VALUES (3, 'ximenzi', '西门子', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 1, 1, '2022-09-07 17:15:49.629', NULL, NULL); -INSERT INTO `wms_supplier` VALUES (4, 'aike', '艾克', NULL, NULL, NULL, 'AAA', '1354175285', '8054152', 'A', '第二级', 'A', 'A', 1, 115, '2022-11-10 16:56:27.364', NULL, NULL); -INSERT INTO `wms_supplier` VALUES (5, '11', '222', NULL, NULL, NULL, NULL, 'fgfgf', NULL, NULL, NULL, NULL, NULL, 1, 115, '2022-11-21 10:01:08.627', NULL, NULL); -INSERT INTO `wms_supplier` VALUES (6, 'G10000', 'ddd', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 1, 115, '2022-12-05 16:01:39.771', NULL, NULL); -INSERT INTO `wms_supplier` VALUES (7, '1', '博世', NULL, NULL, NULL, '祥符', NULL, NULL, NULL, NULL, NULL, NULL, 1, 115, '2022-12-10 14:53:22.000', 115, '2022-12-30 12:22:40.787'); -INSERT INTO `wms_supplier` VALUES (8, '2', '英飞凌', NULL, NULL, NULL, '祥符', NULL, NULL, NULL, NULL, NULL, NULL, 1, 115, '2022-12-13 15:28:29.000', 115, '2022-12-30 12:22:57.832'); -INSERT INTO `wms_supplier` VALUES (9, '123', '123', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 1, 115, '2022-12-28 21:02:07.589', NULL, NULL); -INSERT INTO `wms_supplier` VALUES (10, '8', '供应商', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 1, 115, '2023-01-03 13:50:27.000', 115, '2023-01-05 16:41:34.448'); -INSERT INTO `wms_supplier` VALUES (11, '01', '焦作市公司', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 1, 115, '2023-01-06 16:57:16.000', 115, '2023-01-09 00:53:25.267'); -INSERT INTO `wms_supplier` VALUES (12, '01', '供应商2', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 1, 115, '2023-01-06 16:57:24.396', NULL, NULL); -INSERT INTO `wms_supplier` VALUES (13, '02', '在线商城', NULL, NULL, NULL, '', NULL, NULL, NULL, NULL, NULL, NULL, 1, 115, '2023-01-07 14:01:28.000', 115, '2023-01-28 17:47:14.412'); -INSERT INTO `wms_supplier` VALUES (14, '03', '淘宝修改后', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 1, 115, '2023-01-09 00:58:01.000', 115, '2023-01-09 01:02:54.994'); -INSERT INTO `wms_supplier` VALUES (15, '03', '淘宝修改后', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 1, 115, '2023-01-09 01:07:14.000', 115, '2023-01-09 01:07:48.019'); -INSERT INTO `wms_supplier` VALUES (16, '1', '供应商', NULL, NULL, NULL, '会计核算法国人付好款', '15463126', '33262', '215623252', '第一级', NULL, NULL, 1, 115, '2023-02-01 13:43:09.000', 115, '2023-02-01 22:04:57.844'); -INSERT INTO `wms_supplier` VALUES (17, '2', '供应商2', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 1, 115, '2023-02-06 10:13:44.464', NULL, NULL); -INSERT INTO `wms_supplier` VALUES (18, '001', '哈尔滨千合', NULL, NULL, NULL, NULL, NULL, NULL, NULL, '第一级', NULL, NULL, 1, 115, '2023-02-06 14:00:00.505', NULL, NULL); -INSERT INTO `wms_supplier` VALUES (19, '23020600001', '生产机台', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 1, 115, '2023-02-06 15:20:26.000', 115, '2023-02-16 09:08:31.528'); -INSERT INTO `wms_supplier` VALUES (20, '74564987', '联想配件供应商', NULL, NULL, NULL, '北京科技园', NULL, NULL, NULL, '第一级', NULL, NULL, 1, 115, '2023-02-08 09:13:21.482', NULL, NULL); -INSERT INTO `wms_supplier` VALUES (21, '444', '444', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 1, 115, '2023-02-09 11:36:13.446', NULL, NULL); -INSERT INTO `wms_supplier` VALUES (22, '45', '44', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 1, 115, '2023-02-09 11:36:17.000', 115, '2023-02-18 00:29:56.669'); -INSERT INTO `wms_supplier` VALUES (23, '44', '44', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 1, 115, '2023-02-09 11:36:20.870', NULL, NULL); -INSERT INTO `wms_supplier` VALUES (24, '44', '44', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 1, 115, '2023-02-09 11:36:24.163', NULL, NULL); -INSERT INTO `wms_supplier` VALUES (25, '44', '44', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 1, 115, '2023-02-09 11:36:28.378', NULL, NULL); -INSERT INTO `wms_supplier` VALUES (26, '44', '44', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 1, 115, '2023-02-09 11:36:43.981', NULL, NULL); -INSERT INTO `wms_supplier` VALUES (27, '44', '44', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 1, 115, '2023-02-09 11:36:49.755', NULL, NULL); -INSERT INTO `wms_supplier` VALUES (28, '44', '44', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 1, 115, '2023-02-09 11:36:58.366', NULL, NULL); -INSERT INTO `wms_supplier` VALUES (29, '01', '广州雅量科技有限公司', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 1, 115, '2023-02-10 15:46:02.000', 115, '2023-02-10 15:55:30.698'); -INSERT INTO `wms_supplier` VALUES (30, '963258', '供应商2', NULL, NULL, NULL, '天朝', '13288888888', '123456', '王霸天', '第一级', 'za.r.a.e.l.l.i.s.33@gmail.com', NULL, 1, 115, '2023-02-15 15:00:20.077', NULL, NULL); -INSERT INTO `wms_supplier` VALUES (31, '1001', '青丘特供', NULL, NULL, NULL, '东荒青丘', '1380001234', NULL, NULL, NULL, '123456@qq.com', NULL, 1, 115, '2023-02-26 13:32:57.046', NULL, NULL); -INSERT INTO `wms_supplier` VALUES (32, 'g_001', 'g_test', NULL, NULL, NULL, NULL, '1234567890', NULL, NULL, NULL, NULL, NULL, 1, 115, '2023-02-27 10:32:47.000', 115, '2023-03-13 14:04:49.156'); -INSERT INTO `wms_supplier` VALUES (33, '国贸', '国贸', NULL, NULL, NULL, '12', '12', '123', '123', '第一级', '123', '132', 1, 115, '2023-03-01 17:57:58.000', 115, '2023-03-10 15:02:45.150'); -INSERT INTO `wms_supplier` VALUES (34, '电机供应商', '电机供应商', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 1, 115, '2023-03-01 17:58:45.476', NULL, NULL); -INSERT INTO `wms_supplier` VALUES (35, 'A001', '青岛新材料有限公司', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 1, 115, '2023-03-03 21:32:36.706', NULL, NULL); -INSERT INTO `wms_supplier` VALUES (36, 'g_002', 'g_002test', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 1, 115, '2023-03-12 15:53:50.633', NULL, NULL); -INSERT INTO `wms_supplier` VALUES (37, 'x', 'x', NULL, NULL, NULL, 'x', NULL, 'x', NULL, '第一级', NULL, 'x', 1, 115, '2023-03-20 20:55:03.226', NULL, NULL); -INSERT INTO `wms_supplier` VALUES (38, '001', '天升', NULL, NULL, NULL, '11', NULL, NULL, NULL, NULL, NULL, NULL, 1, 115, '2023-03-20 22:09:32.000', 115, '2023-03-20 22:11:36.112'); -INSERT INTO `wms_supplier` VALUES (39, '46', '546', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 1, 115, '2023-03-21 16:16:29.856', NULL, NULL); -INSERT INTO `wms_supplier` VALUES (40, 'sy01', '大铜', NULL, NULL, NULL, '北京市朝阳区', '222', '111', NULL, '第一级', NULL, '1', 1, 115, '2023-03-22 15:53:16.000', 115, '2023-03-22 16:07:58.098'); -INSERT INTO `wms_supplier` VALUES (41, '31354', '哈哈哈哈', NULL, NULL, NULL, '河北邯郸', '15110043888', NULL, '维持', '第一级', '2813846259@qq.com', '123', 1, 115, '2023-03-25 14:22:03.729', NULL, NULL); -INSERT INTO `wms_supplier` VALUES (42, '0101', '好邻居', NULL, NULL, NULL, '襄阳', NULL, NULL, NULL, '第一级', NULL, NULL, 1, 115, '2023-03-25 15:25:55.043', NULL, NULL); -INSERT INTO `wms_supplier` VALUES (43, '11', 'DEMATIC', NULL, NULL, NULL, '湖北武汉', '17756628255', '177123456', 'hhhhh', '第二级', '2581626255@qq.com', '第二大供应商', 1, 115, '2023-03-28 08:55:12.163', NULL, NULL); -INSERT INTO `wms_supplier` VALUES (44, '11', 'DEMATIC', NULL, NULL, NULL, '湖北武汉', '17756628255', '177123456', 'hhhhh', '第二级', '2581626255@qq.com', '第二大供应商', 1, 115, '2023-03-28 08:55:12.166', NULL, NULL); -INSERT INTO `wms_supplier` VALUES (45, '2', '李宁体育器材提供商', NULL, NULL, NULL, '北京朝阳', '13454353441', '1231321331', '张思', '第一级', NULL, NULL, 1, 115, '2023-03-29 20:45:27.828', NULL, NULL); -INSERT INTO `wms_supplier` VALUES (46, '01', '电脑', NULL, NULL, NULL, '山西太原', '15110688276', '122345', '小柳', '第一级', NULL, NULL, 1, 115, '2023-04-01 14:34:38.192', NULL, NULL); -INSERT INTO `wms_supplier` VALUES (47, 'SP0001', '玖龙', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 1, 115, '2023-04-04 16:02:44.000', 115, '2023-04-08 19:06:43.194'); -INSERT INTO `wms_supplier` VALUES (48, 'SP0002', '熊猫', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 1, 115, '2023-04-06 14:09:40.000', 115, '2023-04-08 19:06:57.556'); -INSERT INTO `wms_supplier` VALUES (49, 'SP0003', '利乐', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 1, 115, '2023-04-06 15:10:08.000', 115, '2023-04-08 19:06:48.051'); -INSERT INTO `wms_supplier` VALUES (50, 'SP0004', '金轮', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 1, 115, '2023-04-06 22:44:05.000', 115, '2023-04-08 18:52:41.073'); -INSERT INTO `wms_supplier` VALUES (51, 'sp0005', '海洋', NULL, NULL, NULL, '湖南', '17873378924', '01', '海洋', '第三级', '2602065420@163.com', '客户', 1, 115, '2023-04-11 14:08:55.459', NULL, NULL); -INSERT INTO `wms_supplier` VALUES (52, 'SP0005', '王成', NULL, NULL, 990.00, '广东省深圳市中广核大厦', '', NULL, NULL, '第一级', NULL, '', 0, 115, '2023-04-12 20:37:43.000', 1, '2023-05-04 15:01:04.489'); - --- ---------------------------- --- Table structure for wms_supplier_transaction --- ---------------------------- -DROP TABLE IF EXISTS `wms_supplier_transaction`; -CREATE TABLE `wms_supplier_transaction` ( - `id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'id', - `transaction_code` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '交易编号', - `supplier_id` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '供应商编号', - `transaction_type` varchar(2) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '交易类型 1:结款 2:应付 ', - `transaction_amount` decimal(18, 2) NOT NULL COMMENT '交易金额', - `previous_balance` decimal(18, 2) NOT NULL COMMENT '上期余额', - `current_balance` decimal(18, 2) NOT NULL COMMENT '当前余额', - `receipt_order_id` bigint(20) NULL DEFAULT NULL COMMENT '入库单号', - `remark` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '备注', - `del_flag` tinyint(4) NOT NULL DEFAULT 0 COMMENT '删除标志', - `create_time` datetime(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0) COMMENT '创建时间', - `update_time` datetime(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0) ON UPDATE CURRENT_TIMESTAMP(0) COMMENT '更新时间', - PRIMARY KEY (`id`) USING BTREE -) ENGINE = InnoDB AUTO_INCREMENT = 49 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '供应商账户流水' ROW_FORMAT = Dynamic; - --- ---------------------------- --- Records of wms_supplier_transaction --- ---------------------------- -INSERT INTO `wms_supplier_transaction` VALUES (44, 'TS-2023-05-124-135324', '52', '33', 10.00, 0.00, 10.00, 624, NULL, 0, '2023-05-04 13:53:25', '2023-05-04 13:51:40'); -INSERT INTO `wms_supplier_transaction` VALUES (45, 'TS-2023-05-04-141335', '52', '22', 5.00, 10.00, 15.00, 0, NULL, 0, '2023-05-04 14:13:40', '2023-05-04 14:11:54'); -INSERT INTO `wms_supplier_transaction` VALUES (46, 'TS-2023-05-04-141517', '52', '11', 5.00, 15.00, 10.00, 0, NULL, 0, '2023-05-04 14:15:21', '2023-05-04 14:13:36'); -INSERT INTO `wms_supplier_transaction` VALUES (47, 'TS-2023-05-04-141543', '52', '11', 20.00, 10.00, -10.00, 0, NULL, 0, '2023-05-04 14:15:47', '2023-05-04 14:14:02'); -INSERT INTO `wms_supplier_transaction` VALUES (48, 'TS-2023-05-04-150058', '52', '22', 1000.00, -10.00, 990.00, 0, NULL, 0, '2023-05-04 15:01:04', '2023-05-04 14:59:20'); - --- ---------------------------- --- Table structure for wms_warehouse --- ---------------------------- -DROP TABLE IF EXISTS `wms_warehouse`; -CREATE TABLE `wms_warehouse` ( - `id` bigint(20) NOT NULL AUTO_INCREMENT, - `warehouse_no` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '编号', - `warehouse_name` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '名称', - `del_flag` tinyint(4) NOT NULL DEFAULT 0 COMMENT '删除标识', - `remark` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '备注', - `create_by` bigint(20) NULL DEFAULT NULL COMMENT '创建人', - `create_time` datetime(3) NULL DEFAULT NULL COMMENT '创建时间', - `update_by` bigint(20) NULL DEFAULT NULL COMMENT '修改人', - `update_time` datetime(3) NULL DEFAULT NULL COMMENT '修改时间', - PRIMARY KEY (`id`) USING BTREE -) ENGINE = InnoDB AUTO_INCREMENT = 236 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '仓库' ROW_FORMAT = Dynamic; - --- ---------------------------- --- Records of wms_warehouse --- ---------------------------- -INSERT INTO `wms_warehouse` VALUES (1, 'suzhou', '苏州', 1, '创意产业园', 1, '2022-08-03 18:15:44.000', 115, '2022-11-07 11:21:23.129'); -INSERT INTO `wms_warehouse` VALUES (2, 'nanjing', '南京', 1, '中央门1号', 1, '2022-08-08 11:06:22.000', 115, '2022-11-21 11:52:28.182'); -INSERT INTO `wms_warehouse` VALUES (3, 'shanghai', '上海', 1, '青浦仓', 1, '2022-08-08 22:12:22.000', 115, '2022-11-07 11:21:43.635'); -INSERT INTO `wms_warehouse` VALUES (4, 'guagnzhou', '广州', 1, NULL, 1, '2022-08-16 11:14:01.000', 115, '2022-11-15 15:02:36.952'); -INSERT INTO `wms_warehouse` VALUES (5, '22222', '2222', 1, NULL, 1, '2022-08-16 11:14:05.000', 1, '2022-10-09 09:36:56.646'); -INSERT INTO `wms_warehouse` VALUES (6, '3', '3', 1, NULL, 1, '2022-08-16 11:14:10.409', NULL, NULL); -INSERT INTO `wms_warehouse` VALUES (7, '4', '4', 1, NULL, 1, '2022-08-16 11:14:14.965', NULL, NULL); -INSERT INTO `wms_warehouse` VALUES (8, '5', '5', 1, NULL, 1, '2022-08-16 11:14:19.883', NULL, NULL); -INSERT INTO `wms_warehouse` VALUES (9, '6', '6', 1, NULL, 1, '2022-08-16 11:14:25.186', NULL, NULL); -INSERT INTO `wms_warehouse` VALUES (10, '7', '7', 1, NULL, 1, '2022-08-16 11:14:30.594', NULL, NULL); -INSERT INTO `wms_warehouse` VALUES (11, '8', '8', 1, NULL, 1, '2022-08-16 11:14:35.686', NULL, NULL); -INSERT INTO `wms_warehouse` VALUES (12, '11', '11', 1, NULL, 1, '2022-10-18 18:57:23.006', NULL, NULL); -INSERT INTO `wms_warehouse` VALUES (13, '11', '北京', 1, NULL, 1, '2022-11-01 14:12:13.665', NULL, NULL); -INSERT INTO `wms_warehouse` VALUES (14, 'beijing', '北京', 1, NULL, 1, '2022-11-01 14:12:15.000', 115, '2022-11-07 11:22:43.136'); -INSERT INTO `wms_warehouse` VALUES (15, '11', '北京', 1, NULL, 1, '2022-11-01 14:12:17.170', NULL, NULL); -INSERT INTO `wms_warehouse` VALUES (16, '12', '北京', 1, NULL, 1, '2022-11-01 14:13:15.060', NULL, NULL); -INSERT INTO `wms_warehouse` VALUES (17, '12', '北京', 1, NULL, 1, '2022-11-01 14:14:01.121', NULL, NULL); -INSERT INTO `wms_warehouse` VALUES (18, '009', 'guangzhou', 1, NULL, 115, '2022-11-07 21:36:06.396', NULL, NULL); -INSERT INTO `wms_warehouse` VALUES (19, '010', 'shenzhen', 1, NULL, 115, '2022-11-07 21:36:43.488', NULL, NULL); -INSERT INTO `wms_warehouse` VALUES (20, 'guizhou', '贵州', 1, NULL, 115, '2022-11-07 21:37:52.646', NULL, NULL); -INSERT INTO `wms_warehouse` VALUES (21, 'cangku1', '仓库1', 1, '感谢字节叔叔', 115, '2022-11-11 17:01:11.000', 115, '2022-11-11 17:02:36.564'); -INSERT INTO `wms_warehouse` VALUES (22, 'cangku2', '仓库2', 1, '感谢字节叔叔', 115, '2022-11-11 17:01:23.000', 115, '2022-11-11 17:02:40.528'); -INSERT INTO `wms_warehouse` VALUES (23, 'cangku3', '仓库3', 1, '感谢字节叔叔', 115, '2022-11-11 17:01:30.000', 115, '2022-11-11 17:02:42.916'); -INSERT INTO `wms_warehouse` VALUES (24, 'cangku4', '仓库4', 1, '感谢字节叔叔', 115, '2022-11-11 17:01:40.000', 115, '2022-11-11 17:02:45.575'); -INSERT INTO `wms_warehouse` VALUES (25, 'luobo', '萝卜仓库', 1, '萝卜仓库备注', 115, '2022-11-13 17:08:46.966', NULL, NULL); -INSERT INTO `wms_warehouse` VALUES (26, 'A100', '服装', 1, '现场v从', 115, '2022-11-14 16:36:55.213', NULL, NULL); -INSERT INTO `wms_warehouse` VALUES (27, '001', '深圳', 1, NULL, 115, '2022-11-20 15:07:55.284', NULL, NULL); -INSERT INTO `wms_warehouse` VALUES (28, '哈哈', '是是是', 1, NULL, 115, '2022-11-23 10:48:52.246', NULL, NULL); -INSERT INTO `wms_warehouse` VALUES (29, '12', '12', 1, '12', 115, '2022-11-29 19:20:21.561', NULL, NULL); -INSERT INTO `wms_warehouse` VALUES (30, 'A', '金融仓库', 1, '金融仓库', 115, '2022-12-05 15:46:35.000', 115, '2022-12-08 10:27:45.868'); -INSERT INTO `wms_warehouse` VALUES (31, 'xmld', '北仓1', 1, NULL, 115, '2022-12-07 09:11:26.167', NULL, NULL); -INSERT INTO `wms_warehouse` VALUES (32, '001', '天等工业园区仓库', 1, NULL, 115, '2022-12-07 14:50:32.751', NULL, NULL); -INSERT INTO `wms_warehouse` VALUES (33, 'b', 'bb', 1, 'bbb', 115, '2022-12-08 10:28:01.407', NULL, NULL); -INSERT INTO `wms_warehouse` VALUES (34, 'A0001', '仓库1', 1, NULL, 115, '2022-12-09 16:22:48.790', NULL, NULL); -INSERT INTO `wms_warehouse` VALUES (35, '最新', '最新', 1, '有管', 115, '2022-12-10 14:45:37.053', NULL, NULL); -INSERT INTO `wms_warehouse` VALUES (36, '新', '新', 1, '有管', 115, '2022-12-10 14:46:21.971', NULL, NULL); -INSERT INTO `wms_warehouse` VALUES (37, '无管', '无管', 1, '无管', 115, '2022-12-10 14:46:58.200', NULL, NULL); -INSERT INTO `wms_warehouse` VALUES (38, '1', '支队警保', 1, 'A仓库1', 115, '2022-12-10 14:51:15.000', 115, '2023-01-04 09:19:11.213'); -INSERT INTO `wms_warehouse` VALUES (39, '2', '钟表城', 1, NULL, 115, '2022-12-10 14:51:59.000', 115, '2022-12-10 22:43:05.171'); -INSERT INTO `wms_warehouse` VALUES (40, '1231231231', 'sdrfsd', 1, '14', 115, '2022-12-14 23:12:50.000', 115, '2022-12-15 16:07:22.036'); -INSERT INTO `wms_warehouse` VALUES (41, '123', 'sdrfsd', 1, '14', 115, '2022-12-14 23:12:50.747', NULL, NULL); -INSERT INTO `wms_warehouse` VALUES (42, '001', '黑线', 1, NULL, 115, '2022-12-15 14:38:42.563', NULL, NULL); -INSERT INTO `wms_warehouse` VALUES (43, 'A001', '成品仓', 1, '成品仓', 115, '2022-12-18 17:32:37.952', NULL, NULL); -INSERT INTO `wms_warehouse` VALUES (44, '1', '1', 1, '1', 115, '2022-12-26 15:48:20.289', NULL, NULL); -INSERT INTO `wms_warehouse` VALUES (45, 'AA001', '测试仓库', 1, '无备注', 115, '2022-12-27 14:10:43.467', NULL, NULL); -INSERT INTO `wms_warehouse` VALUES (46, '1', '1', 1, '1', 115, '2022-12-27 15:32:12.187', NULL, NULL); -INSERT INTO `wms_warehouse` VALUES (47, '111', '111', 1, '111', 115, '2022-12-28 14:04:42.745', NULL, NULL); -INSERT INTO `wms_warehouse` VALUES (48, 'test', 'test', 1, 'test', 115, '2023-01-03 10:06:43.689', NULL, NULL); -INSERT INTO `wms_warehouse` VALUES (49, '010', '加绒款', 1, '3L', 115, '2023-01-04 14:11:06.027', NULL, NULL); -INSERT INTO `wms_warehouse` VALUES (50, '001', '车衣库', 1, NULL, 115, '2023-01-04 14:12:32.000', 115, '2023-01-04 19:06:39.470'); -INSERT INTO `wms_warehouse` VALUES (51, '001', '云南仓', 1, NULL, 115, '2023-01-05 14:48:02.911', NULL, NULL); -INSERT INTO `wms_warehouse` VALUES (52, '1123', '123', 1, '123', 115, '2023-01-06 14:22:02.095', NULL, NULL); -INSERT INTO `wms_warehouse` VALUES (53, '01', '仓库1', 1, NULL, 115, '2023-01-06 16:54:59.571', NULL, NULL); -INSERT INTO `wms_warehouse` VALUES (54, '02', '仓库2', 1, NULL, 115, '2023-01-06 16:55:06.639', NULL, NULL); -INSERT INTO `wms_warehouse` VALUES (55, '03', '仓库33', 1, NULL, 115, '2023-01-06 16:55:16.000', 115, '2023-01-07 10:23:36.204'); -INSERT INTO `wms_warehouse` VALUES (56, '33333', '3333', 1, '33333', 115, '2023-01-07 15:49:21.962', NULL, NULL); -INSERT INTO `wms_warehouse` VALUES (57, '44444', '44444', 1, '44444', 115, '2023-01-07 15:49:34.824', NULL, NULL); -INSERT INTO `wms_warehouse` VALUES (58, 'TX_01', '仓库1', 1, NULL, 115, '2023-01-07 18:07:55.686', NULL, NULL); -INSERT INTO `wms_warehouse` VALUES (59, 'TX_02', '仓库2', 1, NULL, 115, '2023-01-07 18:08:05.652', NULL, NULL); -INSERT INTO `wms_warehouse` VALUES (60, '1', '博爱西仓', 1, 'BOAI-XI', 115, '2023-01-07 22:17:18.603', NULL, NULL); -INSERT INTO `wms_warehouse` VALUES (61, '2', 'BOAI', 1, '博爱', 115, '2023-01-07 23:52:23.000', 115, '2023-01-13 11:15:03.385'); -INSERT INTO `wms_warehouse` VALUES (62, '2', '修改后的test', 1, '测试仓库', 115, '2023-01-08 22:57:21.000', 115, '2023-01-08 23:00:22.141'); -INSERT INTO `wms_warehouse` VALUES (63, '2', '323', 1, '4545', 115, '2023-01-10 18:37:45.380', NULL, NULL); -INSERT INTO `wms_warehouse` VALUES (64, '2', '测试仓库', 1, NULL, 115, '2023-01-11 20:47:03.415', NULL, NULL); -INSERT INTO `wms_warehouse` VALUES (65, '01', '华南仓库', 1, NULL, 115, '2023-01-13 12:40:12.000', 115, '2023-01-14 12:58:11.402'); -INSERT INTO `wms_warehouse` VALUES (66, '01', '成品库', 1, NULL, 115, '2023-01-13 12:40:12.000', 115, '2023-01-30 16:35:51.758'); -INSERT INTO `wms_warehouse` VALUES (67, '01', '咖啡厅仓库', 1, NULL, 115, '2023-01-13 12:48:18.997', NULL, NULL); -INSERT INTO `wms_warehouse` VALUES (68, '02', '餐厅冷藏间', 1, NULL, 115, '2023-01-13 12:48:30.627', NULL, NULL); -INSERT INTO `wms_warehouse` VALUES (69, '03', '餐厅仓库', 1, NULL, 115, '2023-01-13 12:48:46.741', NULL, NULL); -INSERT INTO `wms_warehouse` VALUES (70, '001', '智能柜1', 1, '1', 115, '2023-01-28 17:06:55.249', NULL, NULL); -INSERT INTO `wms_warehouse` VALUES (71, '03', 'testtest', 1, '测试', 115, '2023-01-29 16:12:59.000', 115, '2023-01-29 16:13:08.262'); -INSERT INTO `wms_warehouse` VALUES (72, '999', '999', 1, NULL, 115, '2023-01-29 21:27:57.637', NULL, NULL); -INSERT INTO `wms_warehouse` VALUES (73, '1', '没', 1, NULL, 115, '2023-01-31 13:28:52.171', NULL, NULL); -INSERT INTO `wms_warehouse` VALUES (74, 'asgfsadg', 'sdg', 1, NULL, 115, '2023-01-31 14:07:27.097', NULL, NULL); -INSERT INTO `wms_warehouse` VALUES (75, '01', '原材料库', 1, NULL, 115, '2023-02-01 22:01:00.157', NULL, NULL); -INSERT INTO `wms_warehouse` VALUES (76, '02', '成品库', 1, NULL, 115, '2023-02-01 22:01:14.149', NULL, NULL); -INSERT INTO `wms_warehouse` VALUES (77, '03', '外库', 1, NULL, 115, '2023-02-01 22:01:26.652', NULL, NULL); -INSERT INTO `wms_warehouse` VALUES (78, '04', '不良品库', 1, NULL, 115, '2023-02-01 22:01:36.220', NULL, NULL); -INSERT INTO `wms_warehouse` VALUES (79, '1', '1', 1, NULL, 115, '2023-02-02 13:50:21.221', NULL, NULL); -INSERT INTO `wms_warehouse` VALUES (80, '11', '11', 1, '13', 115, '2023-02-02 15:05:11.909', NULL, NULL); -INSERT INTO `wms_warehouse` VALUES (81, 'A-1-1', '1号', 1, NULL, 115, '2023-02-03 16:03:42.752', NULL, NULL); -INSERT INTO `wms_warehouse` VALUES (82, 'SWV', 'dfd', 1, NULL, 115, '2023-02-03 16:45:55.102', NULL, NULL); -INSERT INTO `wms_warehouse` VALUES (83, '0801965387', '消黄利', 1, NULL, 115, '2023-02-06 14:01:22.000', 115, '2023-02-10 09:27:00.090'); -INSERT INTO `wms_warehouse` VALUES (84, '230206001', '废料仓', 1, NULL, 115, '2023-02-06 15:17:53.000', 115, '2023-02-13 16:34:38.388'); -INSERT INTO `wms_warehouse` VALUES (85, '0019', '种花仓库', 1, NULL, 115, '2023-02-06 16:27:47.388', NULL, NULL); -INSERT INTO `wms_warehouse` VALUES (86, '3000', '四楼仓库', 1, NULL, 115, '2023-02-08 09:03:41.000', 115, '2023-02-16 15:03:19.074'); -INSERT INTO `wms_warehouse` VALUES (87, '26', '26楼原材料仓', 1, '存放电子料', 115, '2023-02-08 16:31:16.364', NULL, NULL); -INSERT INTO `wms_warehouse` VALUES (88, '001', 'A仓库', 1, 'A仓库', 115, '2023-02-10 10:42:14.817', NULL, NULL); -INSERT INTO `wms_warehouse` VALUES (89, '数创中心库存', '库房1', 1, '产品室办公室', 115, '2023-02-10 15:21:23.000', 115, '2023-02-10 15:52:51.372'); -INSERT INTO `wms_warehouse` VALUES (90, '510', 'wyl的仓库', 1, '测试用', 115, '2023-02-11 10:53:40.542', NULL, NULL); -INSERT INTO `wms_warehouse` VALUES (91, 'A001', '备品备件仓库', 1, NULL, 115, '2023-02-11 14:04:36.168', NULL, NULL); -INSERT INTO `wms_warehouse` VALUES (92, 'A000001', '配件仓库', 1, '备注test', 115, '2023-02-13 13:47:13.541', NULL, NULL); -INSERT INTO `wms_warehouse` VALUES (93, '1', '11', 1, NULL, 115, '2023-02-15 11:27:35.250', NULL, NULL); -INSERT INTO `wms_warehouse` VALUES (94, '01', '仓库A', 1, '备注', 115, '2023-02-15 14:06:46.000', 115, '2023-02-15 14:08:45.687'); -INSERT INTO `wms_warehouse` VALUES (95, '01', '食品仓库', 1, NULL, 115, '2023-02-15 15:01:55.264', NULL, NULL); -INSERT INTO `wms_warehouse` VALUES (96, '202302151', '二楼仓库', 1, '水泥', 115, '2023-02-15 17:24:18.863', NULL, NULL); -INSERT INTO `wms_warehouse` VALUES (97, '01', '天线', 1, '700~3700', 115, '2023-02-15 19:27:32.000', 115, '2023-02-15 19:28:41.662'); -INSERT INTO `wms_warehouse` VALUES (98, '3002', 'test', 1, NULL, 115, '2023-02-16 15:03:55.714', NULL, NULL); -INSERT INTO `wms_warehouse` VALUES (99, '30021', 'ooop', 1, NULL, 115, '2023-02-16 15:04:53.699', NULL, NULL); -INSERT INTO `wms_warehouse` VALUES (100, '899', '6355', 1, NULL, 115, '2023-02-16 15:05:35.331', NULL, NULL); -INSERT INTO `wms_warehouse` VALUES (101, 'WB001', '焦作万邦周转筐集散中心', 1, NULL, 115, '2023-02-17 10:47:05.000', 115, '2023-02-17 10:47:25.371'); -INSERT INTO `wms_warehouse` VALUES (102, 'test', 'dddd', 1, 'dd', 115, '2023-02-17 13:06:09.992', NULL, NULL); -INSERT INTO `wms_warehouse` VALUES (103, 'aaa', 'ddd', 1, 'dd', 115, '2023-02-17 13:06:23.341', NULL, NULL); -INSERT INTO `wms_warehouse` VALUES (104, '333333', 'A仓库', 1, '仓库A', 115, '2023-02-17 13:49:52.633', NULL, NULL); -INSERT INTO `wms_warehouse` VALUES (105, '123', '阿拉伯', 1, '干什么用的', 115, '2023-02-18 16:18:09.000', 115, '2023-02-23 15:41:14.834'); -INSERT INTO `wms_warehouse` VALUES (106, '1', '中国', 1, NULL, 115, '2023-02-21 12:00:26.144', NULL, NULL); -INSERT INTO `wms_warehouse` VALUES (107, '001', '大仓', 1, NULL, 115, '2023-02-21 22:15:44.547', NULL, NULL); -INSERT INTO `wms_warehouse` VALUES (108, '2', '2', 1, '2', 115, '2023-02-23 14:52:31.818', NULL, NULL); -INSERT INTO `wms_warehouse` VALUES (109, '001', 'ICC', 1, 'xxx', 115, '2023-02-23 17:48:31.373', NULL, NULL); -INSERT INTO `wms_warehouse` VALUES (110, '001', 'ICC', 1, 'xxx', 115, '2023-02-23 17:51:25.210', NULL, NULL); -INSERT INTO `wms_warehouse` VALUES (111, '001', 'kkk', 1, 'kk', 115, '2023-02-24 14:02:35.785', NULL, NULL); -INSERT INTO `wms_warehouse` VALUES (112, '001', '深北莫学生服务中心', 1, NULL, 115, '2023-02-25 08:16:53.376', NULL, NULL); -INSERT INTO `wms_warehouse` VALUES (113, 'test', 'test12:55', 1, NULL, 115, '2023-02-25 12:55:21.863', NULL, NULL); -INSERT INTO `wms_warehouse` VALUES (114, '002', '库区2', 1, NULL, 115, '2023-02-25 17:08:59.287', NULL, NULL); -INSERT INTO `wms_warehouse` VALUES (115, '100', 'm_test', 1, NULL, 115, '2023-02-27 10:28:58.806', NULL, NULL); -INSERT INTO `wms_warehouse` VALUES (116, '001', '1号仓库', 1, '张氏牛场', 115, '2023-03-01 01:08:45.000', 115, '2023-03-02 10:14:30.603'); -INSERT INTO `wms_warehouse` VALUES (117, '002', '2号仓库', 1, '王某牛场000', 115, '2023-03-01 15:29:08.000', 115, '2023-03-07 22:37:35.224'); -INSERT INTO `wms_warehouse` VALUES (118, '003', '3号仓库', 1, '丰都牛场', 115, '2023-03-01 17:27:10.000', 115, '2023-03-02 10:15:04.947'); -INSERT INTO `wms_warehouse` VALUES (119, '004', '3号仓库', 1, '私家牛舍', 115, '2023-03-01 17:27:26.000', 115, '2023-03-02 10:15:39.108'); -INSERT INTO `wms_warehouse` VALUES (120, '005', '5号仓库', 1, '王木牛', 115, '2023-03-02 10:16:18.000', 115, '2023-03-02 10:16:24.332'); -INSERT INTO `wms_warehouse` VALUES (121, '7100', '半成品一库', 1, NULL, 115, '2023-03-03 20:03:03.000', 115, '2023-03-03 20:04:44.792'); -INSERT INTO `wms_warehouse` VALUES (122, '1200', '原料标准件库', 1, NULL, 115, '2023-03-03 20:04:39.677', NULL, NULL); -INSERT INTO `wms_warehouse` VALUES (123, '1', '1', 1, '1', 115, '2023-03-03 20:04:50.276', NULL, NULL); -INSERT INTO `wms_warehouse` VALUES (124, '1', '1', 1, '2', 115, '2023-03-03 20:05:31.882', NULL, NULL); -INSERT INTO `wms_warehouse` VALUES (125, '155', '495646', 1, NULL, 115, '2023-03-08 23:57:39.854', NULL, NULL); -INSERT INTO `wms_warehouse` VALUES (126, '258', '份饭', 1, NULL, 115, '2023-03-09 13:10:35.838', NULL, NULL); -INSERT INTO `wms_warehouse` VALUES (127, '01', '粤东中心仓库', 1, NULL, 115, '2023-03-10 17:57:38.838', NULL, NULL); -INSERT INTO `wms_warehouse` VALUES (128, '02', '潮州仓库', 1, NULL, 115, '2023-03-10 17:57:59.433', NULL, NULL); -INSERT INTO `wms_warehouse` VALUES (129, '3', '22', 1, NULL, 115, '2023-03-11 21:22:03.849', NULL, NULL); -INSERT INTO `wms_warehouse` VALUES (130, '33', '333', 1, NULL, 115, '2023-03-12 13:37:54.419', NULL, NULL); -INSERT INTO `wms_warehouse` VALUES (131, '001', '测试仓库', 1, '测试仓库', 115, '2023-03-12 15:50:48.572', NULL, NULL); -INSERT INTO `wms_warehouse` VALUES (132, '2', 'dwsd', 1, NULL, 115, '2023-03-12 16:32:07.615', NULL, NULL); -INSERT INTO `wms_warehouse` VALUES (133, '测试1', '仓库1', 1, NULL, 115, '2023-03-12 19:11:43.396', NULL, NULL); -INSERT INTO `wms_warehouse` VALUES (134, 'A', 'AKU', 1, NULL, 115, '2023-03-13 14:39:27.992', NULL, NULL); -INSERT INTO `wms_warehouse` VALUES (135, '1', '1', 1, NULL, 115, '2023-03-13 15:29:24.257', NULL, NULL); -INSERT INTO `wms_warehouse` VALUES (136, 'ggg', 'fff', 1, NULL, 115, '2023-03-13 15:51:54.133', NULL, NULL); -INSERT INTO `wms_warehouse` VALUES (137, '001', '欧拉sss', 1, NULL, 115, '2023-03-14 14:11:48.000', 115, '2023-03-28 12:27:21.420'); -INSERT INTO `wms_warehouse` VALUES (138, '1001sss', '物料', 1, '123', 115, '2023-03-15 16:15:35.000', 115, '2023-03-30 17:34:51.717'); -INSERT INTO `wms_warehouse` VALUES (139, '001', '一号仓', 1, '北京', 115, '2023-03-16 16:28:58.000', 115, '2023-03-23 09:12:26.931'); -INSERT INTO `wms_warehouse` VALUES (140, '002', '上海仓', 1, NULL, 115, '2023-03-16 16:29:19.171', NULL, NULL); -INSERT INTO `wms_warehouse` VALUES (141, '1', '11', 1, NULL, 115, '2023-03-17 09:58:38.171', NULL, NULL); -INSERT INTO `wms_warehouse` VALUES (142, '1', '11', 1, NULL, 115, '2023-03-17 09:58:46.514', NULL, NULL); -INSERT INTO `wms_warehouse` VALUES (143, '666', '测试', 1, '测试666', 115, '2023-03-20 08:42:06.808', NULL, NULL); -INSERT INTO `wms_warehouse` VALUES (144, '3333', '333', 1, NULL, 115, '2023-03-20 11:31:24.000', 115, '2023-03-22 09:09:13.759'); -INSERT INTO `wms_warehouse` VALUES (145, '2133', '2222', 1, '灌灌灌灌', 115, '2023-03-20 11:32:29.953', NULL, NULL); -INSERT INTO `wms_warehouse` VALUES (146, '针织', '8088', 1, '正常款未加长', 115, '2023-03-20 18:02:54.284', NULL, NULL); -INSERT INTO `wms_warehouse` VALUES (147, '12312', '白酒', 1, '1111111', 115, '2023-03-21 17:25:59.663', NULL, NULL); -INSERT INTO `wms_warehouse` VALUES (148, '123', '白酒', 1, NULL, 115, '2023-03-21 17:28:02.906', NULL, NULL); -INSERT INTO `wms_warehouse` VALUES (149, '111', '白酒仓库', 1, NULL, 115, '2023-03-21 17:29:42.077', NULL, NULL); -INSERT INTO `wms_warehouse` VALUES (150, '茅台仓库', '茅台仓库', 1, NULL, 115, '2023-03-22 00:17:01.307', NULL, NULL); -INSERT INTO `wms_warehouse` VALUES (151, '888', '测试', 1, NULL, 115, '2023-03-22 09:09:39.162', NULL, NULL); -INSERT INTO `wms_warehouse` VALUES (152, '111', '111', 1, '111', 115, '2023-03-22 14:28:04.589', NULL, NULL); -INSERT INTO `wms_warehouse` VALUES (153, '111', '111', 1, '111', 115, '2023-03-22 14:28:12.324', NULL, NULL); -INSERT INTO `wms_warehouse` VALUES (154, '20230322', '服装仓1', 1, NULL, 115, '2023-03-22 15:44:47.463', NULL, NULL); -INSERT INTO `wms_warehouse` VALUES (155, 'HD-01', '华东1号库', 1, NULL, 115, '2023-03-22 22:46:42.842', NULL, NULL); -INSERT INTO `wms_warehouse` VALUES (156, '666', '测试', 1, '001', 115, '2023-03-23 00:47:27.306', NULL, NULL); -INSERT INTO `wms_warehouse` VALUES (157, 'sy01', '仓库1', 1, NULL, 115, '2023-03-23 14:04:51.000', 115, '2023-04-12 14:45:47.746'); -INSERT INTO `wms_warehouse` VALUES (158, 'sy001', '仓库的', 1, NULL, 115, '2023-03-23 14:05:21.894', NULL, NULL); -INSERT INTO `wms_warehouse` VALUES (159, 'test', 'test', 1, NULL, 115, '2023-03-24 11:13:10.198', NULL, NULL); -INSERT INTO `wms_warehouse` VALUES (160, '1234', '啤酒', 1, NULL, 115, '2023-03-24 14:20:14.726', NULL, NULL); -INSERT INTO `wms_warehouse` VALUES (161, '135', 'fcl', 1, '', 115, '2023-03-24 23:56:47.000', 115, '2023-04-12 14:19:39.119'); -INSERT INTO `wms_warehouse` VALUES (162, 'baohan', '159', 1, '4526', 115, '2023-03-25 12:06:43.252', NULL, NULL); -INSERT INTO `wms_warehouse` VALUES (163, '666', '666', 1, NULL, 115, '2023-03-25 15:18:45.541', NULL, NULL); -INSERT INTO `wms_warehouse` VALUES (164, '001', '001', 1, NULL, 115, '2023-03-25 15:21:06.252', NULL, NULL); -INSERT INTO `wms_warehouse` VALUES (165, '00101', '00101', 1, NULL, 115, '2023-03-25 15:21:38.322', NULL, NULL); -INSERT INTO `wms_warehouse` VALUES (166, '001', '商学院', 1, NULL, 115, '2023-03-26 19:50:46.095', NULL, NULL); -INSERT INTO `wms_warehouse` VALUES (167, '033', '033', 1, NULL, 115, '2023-03-27 13:43:18.000', 115, '2023-03-27 13:43:28.329'); -INSERT INTO `wms_warehouse` VALUES (168, '004', '正常运行', 1, '面包', 115, '2023-03-28 08:45:12.673', NULL, NULL); -INSERT INTO `wms_warehouse` VALUES (169, '777', '数据', 1, '包子', 115, '2023-03-28 08:45:59.000', 115, '2023-03-28 08:47:07.787'); -INSERT INTO `wms_warehouse` VALUES (170, '123', '威威', 1, '威威嗡嗡嗡', 115, '2023-03-28 15:30:20.059', NULL, NULL); -INSERT INTO `wms_warehouse` VALUES (171, 'test20230329-01', '测试仓库1', 1, '', 115, '2023-03-29 13:31:48.682', NULL, NULL); -INSERT INTO `wms_warehouse` VALUES (172, '185', '厦门仓', 1, '无', 115, '2023-03-30 14:11:36.977', NULL, NULL); -INSERT INTO `wms_warehouse` VALUES (173, 'cq001', '莆田鞋', 1, '重庆仓', 115, '2023-03-31 12:05:16.497', NULL, NULL); -INSERT INTO `wms_warehouse` VALUES (174, 'beijing', '北京', 1, NULL, 115, '2023-04-01 06:30:59.411', NULL, NULL); -INSERT INTO `wms_warehouse` VALUES (175, '22222222222', 'byrzjhh', 1, 'byrzjhh', 115, '2023-04-03 17:30:55.984', NULL, NULL); -INSERT INTO `wms_warehouse` VALUES (176, 'No.89757', '不潮不用花钱', 1, '莆田潮鞋', 115, '2023-04-04 11:39:54.000', 115, '2023-04-04 11:44:11.326'); -INSERT INTO `wms_warehouse` VALUES (177, '不能 ', '一条', 1, NULL, 115, '2023-04-04 11:57:53.918', NULL, NULL); -INSERT INTO `wms_warehouse` VALUES (178, 'No.89757', '不潮不用花钱', 1, '莆田潮鞋~~不潮不花钱', 115, '2023-04-04 14:51:45.437', NULL, NULL); -INSERT INTO `wms_warehouse` VALUES (179, '111', 'aaaa', 1, 'ccc', 115, '2023-04-04 22:19:16.898', NULL, NULL); -INSERT INTO `wms_warehouse` VALUES (180, '333', '333', 1, NULL, 115, '2023-04-05 12:22:50.146', NULL, NULL); -INSERT INTO `wms_warehouse` VALUES (181, '1', '我是仓库', 1, '1', 115, '2023-04-06 14:03:47.000', 115, '2023-04-06 14:49:50.781'); -INSERT INTO `wms_warehouse` VALUES (182, '001', '111', 1, '111', 115, '2023-04-06 14:05:12.478', NULL, NULL); -INSERT INTO `wms_warehouse` VALUES (183, '003', 'ceshi', 1, '111', 115, '2023-04-06 14:10:28.893', NULL, NULL); -INSERT INTO `wms_warehouse` VALUES (184, 'one', 'yyf的仓库', 1, 'yyf', 115, '2023-04-06 14:57:31.399', NULL, NULL); -INSERT INTO `wms_warehouse` VALUES (185, '800', 'sjtu', 1, NULL, 115, '2023-04-06 22:41:21.285', NULL, NULL); -INSERT INTO `wms_warehouse` VALUES (186, '001', '黄酒', 1, NULL, 115, '2023-04-06 23:09:39.639', NULL, NULL); -INSERT INTO `wms_warehouse` VALUES (187, '0025', '总仓', 1, NULL, 115, '2023-04-07 14:34:02.572', NULL, NULL); -INSERT INTO `wms_warehouse` VALUES (188, '6677', '213423', 1, '4324', 115, '2023-04-08 12:04:34.108', NULL, NULL); -INSERT INTO `wms_warehouse` VALUES (189, 'BJT0001', '一队', 1, NULL, 115, '2023-04-11 11:59:08.385', NULL, NULL); -INSERT INTO `wms_warehouse` VALUES (190, 'BJT0002', '二队', 1, NULL, 115, '2023-04-11 11:59:30.519', NULL, NULL); -INSERT INTO `wms_warehouse` VALUES (191, '2019065416', '王成', 1, '中期答辩', 115, '2023-04-12 20:13:33.571', NULL, NULL); -INSERT INTO `wms_warehouse` VALUES (192, 'TG101', '泰国1仓', 1, '泰国1仓', 115, '2023-04-13 10:04:53.741', NULL, NULL); -INSERT INTO `wms_warehouse` VALUES (193, 'TG102', '泰国2仓', 1, '二仓', 115, '2023-04-13 10:05:11.000', 115, '2023-04-15 12:53:28.563'); -INSERT INTO `wms_warehouse` VALUES (194, 'ZJ201', '浙江1仓', 1, '浙江仓12', 115, '2023-04-13 10:06:03.000', 1, '2023-04-26 13:18:15.920'); -INSERT INTO `wms_warehouse` VALUES (195, 'ZJ202', '浙江2仓', 1, '浙江202', 115, '2023-04-13 10:06:17.988', NULL, NULL); -INSERT INTO `wms_warehouse` VALUES (196, 'FJ301', '福建1仓', 1, NULL, 115, '2023-04-13 10:06:38.612', NULL, NULL); -INSERT INTO `wms_warehouse` VALUES (197, 'FJ302', '福建2仓', 1, '福建2仓', 115, '2023-04-13 10:07:06.000', 115, '2023-04-28 11:35:53.262'); -INSERT INTO `wms_warehouse` VALUES (198, 'SC401', '四川1仓', 1, NULL, 115, '2023-04-13 10:07:29.513', NULL, NULL); -INSERT INTO `wms_warehouse` VALUES (199, 'SC402', '四川2仓', 1, NULL, 115, '2023-04-13 10:07:44.135', NULL, NULL); -INSERT INTO `wms_warehouse` VALUES (200, '0001', '一门店', 1, '一门店', 115, '2023-04-13 14:39:12.930', NULL, NULL); -INSERT INTO `wms_warehouse` VALUES (201, 'TG004', '1', 1, '1', 115, '2023-04-15 12:54:04.763', NULL, NULL); -INSERT INTO `wms_warehouse` VALUES (202, 'TG10002', 'ff', 1, NULL, 115, '2023-04-18 10:49:40.938', NULL, NULL); -INSERT INTO `wms_warehouse` VALUES (203, '10002', 'gg', 1, NULL, 115, '2023-04-18 10:49:49.000', 115, '2023-04-18 10:54:08.451'); -INSERT INTO `wms_warehouse` VALUES (204, 'SXJ01', '山西1仓', 1, '太原中心仓', 115, '2023-04-18 11:00:06.000', 115, '2023-04-18 16:02:23.129'); -INSERT INTO `wms_warehouse` VALUES (205, 'SXS01', '陕西1仓', 1, '陕西1仓', 115, '2023-04-18 11:19:26.694', NULL, NULL); -INSERT INTO `wms_warehouse` VALUES (206, '34', '34', 1, NULL, 115, '2023-04-18 16:25:15.908', NULL, NULL); -INSERT INTO `wms_warehouse` VALUES (207, 'TG102', '2323', 1, NULL, 115, '2023-04-18 16:54:50.414', NULL, NULL); -INSERT INTO `wms_warehouse` VALUES (208, 'sdf', 'sdf', 1, NULL, 115, '2023-04-18 18:01:23.934', NULL, NULL); -INSERT INTO `wms_warehouse` VALUES (209, 'sdf', 'sdf', 1, NULL, 115, '2023-04-18 18:01:24.079', NULL, NULL); -INSERT INTO `wms_warehouse` VALUES (210, '33', '33', 1, NULL, 115, '2023-04-20 11:29:52.156', NULL, NULL); -INSERT INTO `wms_warehouse` VALUES (211, '99', 'gk', 1, NULL, 115, '2023-04-21 14:56:41.829', NULL, NULL); -INSERT INTO `wms_warehouse` VALUES (212, '1', '1', 1, '1', 115, '2023-04-23 18:22:24.337', NULL, NULL); -INSERT INTO `wms_warehouse` VALUES (213, 'FV222', '黑龙江1仓', 1, NULL, 115, '2023-04-23 19:17:46.607', NULL, NULL); -INSERT INTO `wms_warehouse` VALUES (214, 'test', 'test', 1, NULL, 115, '2023-04-24 14:44:03.585', NULL, NULL); -INSERT INTO `wms_warehouse` VALUES (215, 'HF001', '合肥1仓', 1, NULL, 115, '2023-04-24 15:32:22.013', NULL, NULL); -INSERT INTO `wms_warehouse` VALUES (216, 'FFF101', 'FFF仓库', 1, '测试在何处', 115, '2023-04-24 17:24:07.492', NULL, NULL); -INSERT INTO `wms_warehouse` VALUES (217, '111', '111111', 1, '111', 115, '2023-04-25 15:56:51.980', NULL, NULL); -INSERT INTO `wms_warehouse` VALUES (218, 'test', 'test', 1, 'tsest', 1, '2023-04-26 09:24:23.601', NULL, NULL); -INSERT INTO `wms_warehouse` VALUES (219, 'test', 'test', 1, 'test', 1, '2023-04-26 09:35:38.004', NULL, NULL); -INSERT INTO `wms_warehouse` VALUES (220, 'test3', 'test3', 1, 'test3', 1, '2023-04-26 09:36:16.703', NULL, NULL); -INSERT INTO `wms_warehouse` VALUES (221, 'test4', 'test4', 1, 'test4', 1, '2023-04-26 09:37:31.304', NULL, NULL); -INSERT INTO `wms_warehouse` VALUES (222, 'test5', 'test5', 1, 'test5', 1, '2023-04-26 09:37:59.511', NULL, NULL); -INSERT INTO `wms_warehouse` VALUES (223, 'test', 'testestest', 1, 'tset', 1, '2023-04-26 09:44:54.988', NULL, NULL); -INSERT INTO `wms_warehouse` VALUES (224, 'test6', '这个仓库名称会比较昌', 1, NULL, 1, '2023-04-26 09:46:47.419', NULL, NULL); -INSERT INTO `wms_warehouse` VALUES (225, '实际线下已有库位规划的情况下', '允许编号输入', 1, NULL, 115, '2023-04-27 16:49:30.156', NULL, NULL); -INSERT INTO `wms_warehouse` VALUES (226, '4', '4', 1, '4', 115, '2023-04-28 17:24:07.514', NULL, NULL); -INSERT INTO `wms_warehouse` VALUES (227, '111', '231', 1, '231', 115, '2023-04-29 08:43:27.263', NULL, NULL); -INSERT INTO `wms_warehouse` VALUES (228, '1', '1', 1, '1', 115, '2023-04-30 16:43:16.443', NULL, NULL); -INSERT INTO `wms_warehouse` VALUES (229, 'suzhou', '苏州仓', 1, NULL, 115, '2023-05-01 12:16:42.300', NULL, NULL); -INSERT INTO `wms_warehouse` VALUES (230, 'shanghia', '上海仓库', 1, NULL, 115, '2023-05-01 12:17:11.184', NULL, NULL); -INSERT INTO `wms_warehouse` VALUES (231, '测试', '测试仓库', 1, NULL, 115, '2023-05-02 13:35:54.829', NULL, NULL); -INSERT INTO `wms_warehouse` VALUES (232, '12345', '南京仓', 1, NULL, 1, '2023-05-04 16:31:13.661', NULL, NULL); -INSERT INTO `wms_warehouse` VALUES (233, 'nanjing', '南京仓', 1, '南京的仓库', 1, '2023-05-04 16:38:02.861', NULL, NULL); -INSERT INTO `wms_warehouse` VALUES (234, '1', 'df', 0, 'dfasd', 115, '2023-05-04 16:42:43.844', NULL, NULL); -INSERT INTO `wms_warehouse` VALUES (235, 'ghh', 'drw', 0, 'fff', 115, '2023-05-04 16:42:55.223', NULL, NULL); --- ---------------------------- --- Table structure for wms_wave --- ---------------------------- -DROP TABLE IF EXISTS `wms_wave`; -CREATE TABLE `wms_wave` ( - `id` bigint(20) NOT NULL AUTO_INCREMENT, - `wave_no` varchar(32) NOT NULL COMMENT '波次号', - `status` varchar(255) DEFAULT NULL COMMENT '状态', - `remark` varchar(255) DEFAULT NULL COMMENT '备注', - `del_flag` tinyint(4) NOT NULL DEFAULT '0' COMMENT '删除标识', - `create_by` bigint(20) DEFAULT NULL COMMENT '创建人', - `create_time` datetime(3) DEFAULT NULL COMMENT '创建时间', - `update_by` bigint(20) DEFAULT NULL COMMENT '修改人', - `update_time` datetime(3) DEFAULT NULL COMMENT '修改时间', - PRIMARY KEY (`id`) USING BTREE -) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC COMMENT='波次'; --- ---------------------------- --- Records of wms_wave --- ---------------------------- - -SET FOREIGN_KEY_CHECKS = 1; diff --git a/wms/.gitignore b/wms/.gitignore deleted file mode 100644 index 549e00a..0000000 --- a/wms/.gitignore +++ /dev/null @@ -1,33 +0,0 @@ -HELP.md -target/ -!.mvn/wrapper/maven-wrapper.jar -!**/src/main/**/target/ -!**/src/test/**/target/ - -### STS ### -.apt_generated -.classpath -.factorypath -.project -.settings -.springBeans -.sts4-cache - -### IntelliJ IDEA ### -.idea -*.iws -*.iml -*.ipr - -### NetBeans ### -/nbproject/private/ -/nbbuild/ -/dist/ -/nbdist/ -/.nb-gradle/ -build/ -!**/src/main/**/build/ -!**/src/test/**/build/ - -### VS Code ### -.vscode/ diff --git a/wms/.mvn/wrapper/maven-wrapper.jar b/wms/.mvn/wrapper/maven-wrapper.jar deleted file mode 100644 index c1dd12f..0000000 Binary files a/wms/.mvn/wrapper/maven-wrapper.jar and /dev/null differ diff --git a/wms/.mvn/wrapper/maven-wrapper.properties b/wms/.mvn/wrapper/maven-wrapper.properties deleted file mode 100644 index b74bf7f..0000000 --- a/wms/.mvn/wrapper/maven-wrapper.properties +++ /dev/null @@ -1,2 +0,0 @@ -distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.8.6/apache-maven-3.8.6-bin.zip -wrapperUrl=https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.1.0/maven-wrapper-3.1.0.jar diff --git a/wms/mvnw b/wms/mvnw deleted file mode 100644 index 8a8fb22..0000000 --- a/wms/mvnw +++ /dev/null @@ -1,316 +0,0 @@ -#!/bin/sh -# ---------------------------------------------------------------------------- -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. -# ---------------------------------------------------------------------------- - -# ---------------------------------------------------------------------------- -# Maven Start Up Batch script -# -# Required ENV vars: -# ------------------ -# JAVA_HOME - location of a JDK home dir -# -# Optional ENV vars -# ----------------- -# M2_HOME - location of maven2's installed home dir -# MAVEN_OPTS - parameters passed to the Java VM when running Maven -# e.g. to debug Maven itself, use -# set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000 -# MAVEN_SKIP_RC - flag to disable loading of mavenrc files -# ---------------------------------------------------------------------------- - -if [ -z "$MAVEN_SKIP_RC" ] ; then - - if [ -f /usr/local/etc/mavenrc ] ; then - . /usr/local/etc/mavenrc - fi - - if [ -f /etc/mavenrc ] ; then - . /etc/mavenrc - fi - - if [ -f "$HOME/.mavenrc" ] ; then - . "$HOME/.mavenrc" - fi - -fi - -# OS specific support. $var _must_ be set to either true or false. -cygwin=false; -darwin=false; -mingw=false -case "`uname`" in - CYGWIN*) cygwin=true ;; - MINGW*) mingw=true;; - Darwin*) darwin=true - # Use /usr/libexec/java_home if available, otherwise fall back to /Library/Java/Home - # See https://developer.apple.com/library/mac/qa/qa1170/_index.html - if [ -z "$JAVA_HOME" ]; then - if [ -x "/usr/libexec/java_home" ]; then - export JAVA_HOME="`/usr/libexec/java_home`" - else - export JAVA_HOME="/Library/Java/Home" - fi - fi - ;; -esac - -if [ -z "$JAVA_HOME" ] ; then - if [ -r /etc/gentoo-release ] ; then - JAVA_HOME=`java-config --jre-home` - fi -fi - -if [ -z "$M2_HOME" ] ; then - ## resolve links - $0 may be a link to maven's home - PRG="$0" - - # need this for relative symlinks - while [ -h "$PRG" ] ; do - ls=`ls -ld "$PRG"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - PRG="$link" - else - PRG="`dirname "$PRG"`/$link" - fi - done - - saveddir=`pwd` - - M2_HOME=`dirname "$PRG"`/.. - - # make it fully qualified - M2_HOME=`cd "$M2_HOME" && pwd` - - cd "$saveddir" - # echo Using m2 at $M2_HOME -fi - -# For Cygwin, ensure paths are in UNIX format before anything is touched -if $cygwin ; then - [ -n "$M2_HOME" ] && - M2_HOME=`cygpath --unix "$M2_HOME"` - [ -n "$JAVA_HOME" ] && - JAVA_HOME=`cygpath --unix "$JAVA_HOME"` - [ -n "$CLASSPATH" ] && - CLASSPATH=`cygpath --path --unix "$CLASSPATH"` -fi - -# For Mingw, ensure paths are in UNIX format before anything is touched -if $mingw ; then - [ -n "$M2_HOME" ] && - M2_HOME="`(cd "$M2_HOME"; pwd)`" - [ -n "$JAVA_HOME" ] && - JAVA_HOME="`(cd "$JAVA_HOME"; pwd)`" -fi - -if [ -z "$JAVA_HOME" ]; then - javaExecutable="`which javac`" - if [ -n "$javaExecutable" ] && ! [ "`expr \"$javaExecutable\" : '\([^ ]*\)'`" = "no" ]; then - # readlink(1) is not available as standard on Solaris 10. - readLink=`which readlink` - if [ ! `expr "$readLink" : '\([^ ]*\)'` = "no" ]; then - if $darwin ; then - javaHome="`dirname \"$javaExecutable\"`" - javaExecutable="`cd \"$javaHome\" && pwd -P`/javac" - else - javaExecutable="`readlink -f \"$javaExecutable\"`" - fi - javaHome="`dirname \"$javaExecutable\"`" - javaHome=`expr "$javaHome" : '\(.*\)/bin'` - JAVA_HOME="$javaHome" - export JAVA_HOME - fi - fi -fi - -if [ -z "$JAVACMD" ] ; then - if [ -n "$JAVA_HOME" ] ; then - if [ -x "$JAVA_HOME/jre/sh/java" ] ; then - # IBM's JDK on AIX uses strange locations for the executables - JAVACMD="$JAVA_HOME/jre/sh/java" - else - JAVACMD="$JAVA_HOME/bin/java" - fi - else - JAVACMD="`\\unset -f command; \\command -v java`" - fi -fi - -if [ ! -x "$JAVACMD" ] ; then - echo "Error: JAVA_HOME is not defined correctly." >&2 - echo " We cannot execute $JAVACMD" >&2 - exit 1 -fi - -if [ -z "$JAVA_HOME" ] ; then - echo "Warning: JAVA_HOME environment variable is not set." -fi - -CLASSWORLDS_LAUNCHER=org.codehaus.plexus.classworlds.launcher.Launcher - -# traverses directory structure from process work directory to filesystem root -# first directory with .mvn subdirectory is considered project base directory -find_maven_basedir() { - - if [ -z "$1" ] - then - echo "Path not specified to find_maven_basedir" - return 1 - fi - - basedir="$1" - wdir="$1" - while [ "$wdir" != '/' ] ; do - if [ -d "$wdir"/.mvn ] ; then - basedir=$wdir - break - fi - # workaround for JBEAP-8937 (on Solaris 10/Sparc) - if [ -d "${wdir}" ]; then - wdir=`cd "$wdir/.."; pwd` - fi - # end of workaround - done - echo "${basedir}" -} - -# concatenates all lines of a file -concat_lines() { - if [ -f "$1" ]; then - echo "$(tr -s '\n' ' ' < "$1")" - fi -} - -BASE_DIR=`find_maven_basedir "$(pwd)"` -if [ -z "$BASE_DIR" ]; then - exit 1; -fi - -########################################################################################## -# Extension to allow automatically downloading the maven-wrapper.jar from Maven-central -# This allows using the maven wrapper in projects that prohibit checking in binary data. -########################################################################################## -if [ -r "$BASE_DIR/.mvn/wrapper/maven-wrapper.jar" ]; then - if [ "$MVNW_VERBOSE" = true ]; then - echo "Found .mvn/wrapper/maven-wrapper.jar" - fi -else - if [ "$MVNW_VERBOSE" = true ]; then - echo "Couldn't find .mvn/wrapper/maven-wrapper.jar, downloading it ..." - fi - if [ -n "$MVNW_REPOURL" ]; then - jarUrl="$MVNW_REPOURL/org/apache/maven/wrapper/maven-wrapper/3.1.0/maven-wrapper-3.1.0.jar" - else - jarUrl="https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.1.0/maven-wrapper-3.1.0.jar" - fi - while IFS="=" read key value; do - case "$key" in (wrapperUrl) jarUrl="$value"; break ;; - esac - done < "$BASE_DIR/.mvn/wrapper/maven-wrapper.properties" - if [ "$MVNW_VERBOSE" = true ]; then - echo "Downloading from: $jarUrl" - fi - wrapperJarPath="$BASE_DIR/.mvn/wrapper/maven-wrapper.jar" - if $cygwin; then - wrapperJarPath=`cygpath --path --windows "$wrapperJarPath"` - fi - - if command -v wget > /dev/null; then - if [ "$MVNW_VERBOSE" = true ]; then - echo "Found wget ... using wget" - fi - if [ -z "$MVNW_USERNAME" ] || [ -z "$MVNW_PASSWORD" ]; then - wget "$jarUrl" -O "$wrapperJarPath" || rm -f "$wrapperJarPath" - else - wget --http-user=$MVNW_USERNAME --http-password=$MVNW_PASSWORD "$jarUrl" -O "$wrapperJarPath" || rm -f "$wrapperJarPath" - fi - elif command -v curl > /dev/null; then - if [ "$MVNW_VERBOSE" = true ]; then - echo "Found curl ... using curl" - fi - if [ -z "$MVNW_USERNAME" ] || [ -z "$MVNW_PASSWORD" ]; then - curl -o "$wrapperJarPath" "$jarUrl" -f - else - curl --user $MVNW_USERNAME:$MVNW_PASSWORD -o "$wrapperJarPath" "$jarUrl" -f - fi - - else - if [ "$MVNW_VERBOSE" = true ]; then - echo "Falling back to using Java to download" - fi - javaClass="$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.java" - # For Cygwin, switch paths to Windows format before running javac - if $cygwin; then - javaClass=`cygpath --path --windows "$javaClass"` - fi - if [ -e "$javaClass" ]; then - if [ ! -e "$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.class" ]; then - if [ "$MVNW_VERBOSE" = true ]; then - echo " - Compiling MavenWrapperDownloader.java ..." - fi - # Compiling the Java class - ("$JAVA_HOME/bin/javac" "$javaClass") - fi - if [ -e "$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.class" ]; then - # Running the downloader - if [ "$MVNW_VERBOSE" = true ]; then - echo " - Running MavenWrapperDownloader.java ..." - fi - ("$JAVA_HOME/bin/java" -cp .mvn/wrapper MavenWrapperDownloader "$MAVEN_PROJECTBASEDIR") - fi - fi - fi -fi -########################################################################################## -# End of extension -########################################################################################## - -export MAVEN_PROJECTBASEDIR=${MAVEN_BASEDIR:-"$BASE_DIR"} -if [ "$MVNW_VERBOSE" = true ]; then - echo $MAVEN_PROJECTBASEDIR -fi -MAVEN_OPTS="$(concat_lines "$MAVEN_PROJECTBASEDIR/.mvn/jvm.config") $MAVEN_OPTS" - -# For Cygwin, switch paths to Windows format before running java -if $cygwin; then - [ -n "$M2_HOME" ] && - M2_HOME=`cygpath --path --windows "$M2_HOME"` - [ -n "$JAVA_HOME" ] && - JAVA_HOME=`cygpath --path --windows "$JAVA_HOME"` - [ -n "$CLASSPATH" ] && - CLASSPATH=`cygpath --path --windows "$CLASSPATH"` - [ -n "$MAVEN_PROJECTBASEDIR" ] && - MAVEN_PROJECTBASEDIR=`cygpath --path --windows "$MAVEN_PROJECTBASEDIR"` -fi - -# Provide a "standardized" way to retrieve the CLI args that will -# work with both Windows and non-Windows executions. -MAVEN_CMD_LINE_ARGS="$MAVEN_CONFIG $@" -export MAVEN_CMD_LINE_ARGS - -WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain - -exec "$JAVACMD" \ - $MAVEN_OPTS \ - $MAVEN_DEBUG_OPTS \ - -classpath "$MAVEN_PROJECTBASEDIR/.mvn/wrapper/maven-wrapper.jar" \ - "-Dmaven.home=${M2_HOME}" \ - "-Dmaven.multiModuleProjectDirectory=${MAVEN_PROJECTBASEDIR}" \ - ${WRAPPER_LAUNCHER} $MAVEN_CONFIG "$@" diff --git a/wms/mvnw.cmd b/wms/mvnw.cmd deleted file mode 100644 index 1d8ab01..0000000 --- a/wms/mvnw.cmd +++ /dev/null @@ -1,188 +0,0 @@ -@REM ---------------------------------------------------------------------------- -@REM Licensed to the Apache Software Foundation (ASF) under one -@REM or more contributor license agreements. See the NOTICE file -@REM distributed with this work for additional information -@REM regarding copyright ownership. The ASF licenses this file -@REM to you under the Apache License, Version 2.0 (the -@REM "License"); you may not use this file except in compliance -@REM with the License. You may obtain a copy of the License at -@REM -@REM https://www.apache.org/licenses/LICENSE-2.0 -@REM -@REM Unless required by applicable law or agreed to in writing, -@REM software distributed under the License is distributed on an -@REM "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -@REM KIND, either express or implied. See the License for the -@REM specific language governing permissions and limitations -@REM under the License. -@REM ---------------------------------------------------------------------------- - -@REM ---------------------------------------------------------------------------- -@REM Maven Start Up Batch script -@REM -@REM Required ENV vars: -@REM JAVA_HOME - location of a JDK home dir -@REM -@REM Optional ENV vars -@REM M2_HOME - location of maven2's installed home dir -@REM MAVEN_BATCH_ECHO - set to 'on' to enable the echoing of the batch commands -@REM MAVEN_BATCH_PAUSE - set to 'on' to wait for a keystroke before ending -@REM MAVEN_OPTS - parameters passed to the Java VM when running Maven -@REM e.g. to debug Maven itself, use -@REM set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000 -@REM MAVEN_SKIP_RC - flag to disable loading of mavenrc files -@REM ---------------------------------------------------------------------------- - -@REM Begin all REM lines with '@' in case MAVEN_BATCH_ECHO is 'on' -@echo off -@REM set title of command window -title %0 -@REM enable echoing by setting MAVEN_BATCH_ECHO to 'on' -@if "%MAVEN_BATCH_ECHO%" == "on" echo %MAVEN_BATCH_ECHO% - -@REM set %HOME% to equivalent of $HOME -if "%HOME%" == "" (set "HOME=%HOMEDRIVE%%HOMEPATH%") - -@REM Execute a user defined script before this one -if not "%MAVEN_SKIP_RC%" == "" goto skipRcPre -@REM check for pre script, once with legacy .bat ending and once with .cmd ending -if exist "%USERPROFILE%\mavenrc_pre.bat" call "%USERPROFILE%\mavenrc_pre.bat" %* -if exist "%USERPROFILE%\mavenrc_pre.cmd" call "%USERPROFILE%\mavenrc_pre.cmd" %* -:skipRcPre - -@setlocal - -set ERROR_CODE=0 - -@REM To isolate internal variables from possible post scripts, we use another setlocal -@setlocal - -@REM ==== START VALIDATION ==== -if not "%JAVA_HOME%" == "" goto OkJHome - -echo. -echo Error: JAVA_HOME not found in your environment. >&2 -echo Please set the JAVA_HOME variable in your environment to match the >&2 -echo location of your Java installation. >&2 -echo. -goto error - -:OkJHome -if exist "%JAVA_HOME%\bin\java.exe" goto init - -echo. -echo Error: JAVA_HOME is set to an invalid directory. >&2 -echo JAVA_HOME = "%JAVA_HOME%" >&2 -echo Please set the JAVA_HOME variable in your environment to match the >&2 -echo location of your Java installation. >&2 -echo. -goto error - -@REM ==== END VALIDATION ==== - -:init - -@REM Find the project base dir, i.e. the directory that contains the folder ".mvn". -@REM Fallback to current working directory if not found. - -set MAVEN_PROJECTBASEDIR=%MAVEN_BASEDIR% -IF NOT "%MAVEN_PROJECTBASEDIR%"=="" goto endDetectBaseDir - -set EXEC_DIR=%CD% -set WDIR=%EXEC_DIR% -:findBaseDir -IF EXIST "%WDIR%"\.mvn goto baseDirFound -cd .. -IF "%WDIR%"=="%CD%" goto baseDirNotFound -set WDIR=%CD% -goto findBaseDir - -:baseDirFound -set MAVEN_PROJECTBASEDIR=%WDIR% -cd "%EXEC_DIR%" -goto endDetectBaseDir - -:baseDirNotFound -set MAVEN_PROJECTBASEDIR=%EXEC_DIR% -cd "%EXEC_DIR%" - -:endDetectBaseDir - -IF NOT EXIST "%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config" goto endReadAdditionalConfig - -@setlocal EnableExtensions EnableDelayedExpansion -for /F "usebackq delims=" %%a in ("%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config") do set JVM_CONFIG_MAVEN_PROPS=!JVM_CONFIG_MAVEN_PROPS! %%a -@endlocal & set JVM_CONFIG_MAVEN_PROPS=%JVM_CONFIG_MAVEN_PROPS% - -:endReadAdditionalConfig - -SET MAVEN_JAVA_EXE="%JAVA_HOME%\bin\java.exe" -set WRAPPER_JAR="%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.jar" -set WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain - -set DOWNLOAD_URL="https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.1.0/maven-wrapper-3.1.0.jar" - -FOR /F "usebackq tokens=1,2 delims==" %%A IN ("%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.properties") DO ( - IF "%%A"=="wrapperUrl" SET DOWNLOAD_URL=%%B -) - -@REM Extension to allow automatically downloading the maven-wrapper.jar from Maven-central -@REM This allows using the maven wrapper in projects that prohibit checking in binary data. -if exist %WRAPPER_JAR% ( - if "%MVNW_VERBOSE%" == "true" ( - echo Found %WRAPPER_JAR% - ) -) else ( - if not "%MVNW_REPOURL%" == "" ( - SET DOWNLOAD_URL="%MVNW_REPOURL%/org/apache/maven/wrapper/maven-wrapper/3.1.0/maven-wrapper-3.1.0.jar" - ) - if "%MVNW_VERBOSE%" == "true" ( - echo Couldn't find %WRAPPER_JAR%, downloading it ... - echo Downloading from: %DOWNLOAD_URL% - ) - - powershell -Command "&{"^ - "$webclient = new-object System.Net.WebClient;"^ - "if (-not ([string]::IsNullOrEmpty('%MVNW_USERNAME%') -and [string]::IsNullOrEmpty('%MVNW_PASSWORD%'))) {"^ - "$webclient.Credentials = new-object System.Net.NetworkCredential('%MVNW_USERNAME%', '%MVNW_PASSWORD%');"^ - "}"^ - "[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; $webclient.DownloadFile('%DOWNLOAD_URL%', '%WRAPPER_JAR%')"^ - "}" - if "%MVNW_VERBOSE%" == "true" ( - echo Finished downloading %WRAPPER_JAR% - ) -) -@REM End of extension - -@REM Provide a "standardized" way to retrieve the CLI args that will -@REM work with both Windows and non-Windows executions. -set MAVEN_CMD_LINE_ARGS=%* - -%MAVEN_JAVA_EXE% ^ - %JVM_CONFIG_MAVEN_PROPS% ^ - %MAVEN_OPTS% ^ - %MAVEN_DEBUG_OPTS% ^ - -classpath %WRAPPER_JAR% ^ - "-Dmaven.multiModuleProjectDirectory=%MAVEN_PROJECTBASEDIR%" ^ - %WRAPPER_LAUNCHER% %MAVEN_CONFIG% %* -if ERRORLEVEL 1 goto error -goto end - -:error -set ERROR_CODE=1 - -:end -@endlocal & set ERROR_CODE=%ERROR_CODE% - -if not "%MAVEN_SKIP_RC%"=="" goto skipRcPost -@REM check for post script, once with legacy .bat ending and once with .cmd ending -if exist "%USERPROFILE%\mavenrc_post.bat" call "%USERPROFILE%\mavenrc_post.bat" -if exist "%USERPROFILE%\mavenrc_post.cmd" call "%USERPROFILE%\mavenrc_post.cmd" -:skipRcPost - -@REM pause the script if MAVEN_BATCH_PAUSE is set to 'on' -if "%MAVEN_BATCH_PAUSE%"=="on" pause - -if "%MAVEN_TERMINATE_CMD%"=="on" exit %ERROR_CODE% - -cmd /C exit /B %ERROR_CODE% diff --git a/wms/pom.xml b/wms/pom.xml deleted file mode 100644 index ef45566..0000000 --- a/wms/pom.xml +++ /dev/null @@ -1,85 +0,0 @@ - - - - ruoyi - com.ruoyi - 3.7.0 - - 4.0.0 - - wms - - - 8 - 8 - - - - com.ruoyi - ruoyi-common - ${ruoyi.version} - - - com.ruoyi - ruoyi-system - ${ruoyi.version} - - - com.baomidou - mybatis-plus-boot-starter - ${mybatis.plus.version} - - - org.mapstruct - mapstruct - - - org.springframework.boot - spring-boot-starter - test - - - org.springframework.boot - spring-boot-starter-test - test - - - com.h2database - h2 - test - - - org.springframework.boot - spring-boot-test - test - - - junit - junit - test - - - org.springframework - spring-test - test - - - io.springfox - springfox-boot-starter - ${swagger.version} - - - io.swagger - swagger-models - - - org.mapstruct - mapstruct - - - - - - diff --git a/wms/src/main/java/com/cyl/wms/WmsApplication.java b/wms/src/main/java/com/cyl/wms/WmsApplication.java deleted file mode 100644 index 9968868..0000000 --- a/wms/src/main/java/com/cyl/wms/WmsApplication.java +++ /dev/null @@ -1,13 +0,0 @@ -package com.cyl.wms; - -import org.springframework.boot.SpringApplication; -import org.springframework.boot.autoconfigure.SpringBootApplication; - -@SpringBootApplication -public class WmsApplication { - - public static void main(String[] args) { - SpringApplication.run(WmsApplication.class, args); - } - -} diff --git a/wms/src/main/java/com/cyl/wms/constant/InventoryMovementConstant.java b/wms/src/main/java/com/cyl/wms/constant/InventoryMovementConstant.java deleted file mode 100644 index 77ea536..0000000 --- a/wms/src/main/java/com/cyl/wms/constant/InventoryMovementConstant.java +++ /dev/null @@ -1,18 +0,0 @@ -package com.cyl.wms.constant; - -public interface InventoryMovementConstant { - // 未操作 - int NOT_IN = 21; - // 部分移动 - int PART_IN = 22; - // 移动完毕 - int ALL_IN = 23; - // 作废 - int DROP = 24; - - - //调拨出库 - int OUT_TYPE = 21; - //调拨入库 - int IN_TYPE = 22; -} diff --git a/wms/src/main/java/com/cyl/wms/constant/ReceiptOrderConstant.java b/wms/src/main/java/com/cyl/wms/constant/ReceiptOrderConstant.java deleted file mode 100644 index 5d9b6f3..0000000 --- a/wms/src/main/java/com/cyl/wms/constant/ReceiptOrderConstant.java +++ /dev/null @@ -1,24 +0,0 @@ -package com.cyl.wms.constant; - -public interface ReceiptOrderConstant { - // 未入库 - int NOT_IN = 0; - // 在途 - int IN_PATH = 1; - // 部分入库 - int PART_IN = 2; - // 全部入库 - int ALL_IN = 3; - // 作废 - int DROP = 2; - - /*订单类型*/ - //采购 - int PURCHASE = 1; - //外协 - int OUTSOURCING = 2; - //退货 - int RETURN = 3; - //盘盈入库 - int CHECK_IN = 32; -} diff --git a/wms/src/main/java/com/cyl/wms/constant/ShipmentOrderConstant.java b/wms/src/main/java/com/cyl/wms/constant/ShipmentOrderConstant.java deleted file mode 100644 index db4e6bf..0000000 --- a/wms/src/main/java/com/cyl/wms/constant/ShipmentOrderConstant.java +++ /dev/null @@ -1,22 +0,0 @@ -package com.cyl.wms.constant; - -public interface ShipmentOrderConstant { - - // 未出库 - int NOT_IN = 11; - // 部分出库 - int PART_IN = 12; - // 全部出库 - int ALL_IN = 13; - // 作废 - int DROP = 14; - - /*订单类型*/ - int SALE = 11; - int OUTSOURCING = 12; - int RANSFER = 13; - //部门领料出库 - int DEPT = 14; - //盘亏出库 - int CHECK_OUT = 31; -} diff --git a/wms/src/main/java/com/cyl/wms/controller/AreaController.java b/wms/src/main/java/com/cyl/wms/controller/AreaController.java deleted file mode 100644 index f4c8216..0000000 --- a/wms/src/main/java/com/cyl/wms/controller/AreaController.java +++ /dev/null @@ -1,93 +0,0 @@ -package com.cyl.wms.controller; - -import java.util.List; - -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; -import org.springframework.data.domain.PageImpl; -import org.springframework.data.domain.Pageable; -import org.springframework.data.domain.Page; -import org.springframework.http.ResponseEntity; -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.ruoyi.common.annotation.Log; -import com.ruoyi.common.core.controller.BaseController; -import com.ruoyi.common.enums.BusinessType; -import com.cyl.wms.convert.AreaConvert; -import com.cyl.wms.domain.Area; -import com.cyl.wms.pojo.query.AreaQuery; -import com.cyl.wms.service.AreaService; -import com.cyl.wms.pojo.vo.AreaVO; -import com.ruoyi.common.utils.poi.ExcelUtil; -/** - * 货区Controller - * - * @author zcc - * @date 2022-08-05 - */ -@Api(description ="货区接口列表") -@RestController -@RequestMapping("/wms/area") -public class AreaController extends BaseController { - @Autowired - private AreaService service; - @Autowired - private AreaConvert convert; - - @ApiOperation("查询货区列表") - @PreAuthorize("@ss.hasPermi('wms:area:list')") - @PostMapping("/list") - public ResponseEntity> list(@RequestBody AreaQuery query, Pageable page) { - List list = service.selectList(query, page); - return ResponseEntity.ok(new PageImpl<>(list, page, ((com.github.pagehelper.Page)list).getTotal())); - } - - @ApiOperation("导出货区列表") - @PreAuthorize("@ss.hasPermi('wms:area:export')") - @Log(title = "货区", businessType = BusinessType.EXPORT) - @GetMapping("/export") - public ResponseEntity export(AreaQuery query) { - List list = service.selectList(query, null); - ExcelUtil util = new ExcelUtil<>(AreaVO.class); - return ResponseEntity.ok(util.writeExcel(convert.dos2vos(list), "货区数据")); - } - - @ApiOperation("获取货区详细信息") - @PreAuthorize("@ss.hasPermi('wms:area:query')") - @GetMapping(value = "/{id}") - public ResponseEntity getInfo(@PathVariable("id") Long id) { - return ResponseEntity.ok(service.selectById(id)); - } - - @ApiOperation("新增货区") - @PreAuthorize("@ss.hasPermi('wms:area:add')") - @Log(title = "货区", businessType = BusinessType.INSERT) - @PostMapping - public ResponseEntity add(@RequestBody Area area) { - return ResponseEntity.ok(service.insert(area)); - } - - @ApiOperation("修改货区") - @PreAuthorize("@ss.hasPermi('wms:area:edit')") - @Log(title = "货区", businessType = BusinessType.UPDATE) - @PutMapping - public ResponseEntity edit(@RequestBody Area area) { - return ResponseEntity.ok(service.update(area)); - } - - @ApiOperation("删除货区") - @PreAuthorize("@ss.hasPermi('wms:area:remove')") - @Log(title = "货区", businessType = BusinessType.DELETE) - @DeleteMapping("/{ids}") - public ResponseEntity remove(@PathVariable Long[] ids) { - return ResponseEntity.ok(service.deleteByIds(ids)); - } -} diff --git a/wms/src/main/java/com/cyl/wms/controller/CarrierController.java b/wms/src/main/java/com/cyl/wms/controller/CarrierController.java deleted file mode 100644 index f01835b..0000000 --- a/wms/src/main/java/com/cyl/wms/controller/CarrierController.java +++ /dev/null @@ -1,93 +0,0 @@ -package com.cyl.wms.controller; - -import java.util.List; - -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; -import org.springframework.data.domain.PageImpl; -import org.springframework.data.domain.Pageable; -import org.springframework.data.domain.Page; -import org.springframework.http.ResponseEntity; -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.ruoyi.common.annotation.Log; -import com.ruoyi.common.core.controller.BaseController; -import com.ruoyi.common.enums.BusinessType; -import com.cyl.wms.convert.CarrierConvert; -import com.cyl.wms.domain.Carrier; -import com.cyl.wms.pojo.query.CarrierQuery; -import com.cyl.wms.service.CarrierService; -import com.cyl.wms.pojo.vo.CarrierVO; -import com.ruoyi.common.utils.poi.ExcelUtil; -/** - * 承运商Controller - * - * @author zcc - * @date 2022-08-05 - */ -@Api(description ="承运商接口列表") -@RestController -@RequestMapping("/wms/carrier") -public class CarrierController extends BaseController { - @Autowired - private CarrierService service; - @Autowired - private CarrierConvert convert; - - @ApiOperation("查询承运商列表") - @PreAuthorize("@ss.hasPermi('wms:carrier:list')") - @PostMapping("/list") - public ResponseEntity> list(@RequestBody CarrierQuery query, Pageable page) { - List list = service.selectList(query, page); - return ResponseEntity.ok(new PageImpl<>(list, page, ((com.github.pagehelper.Page)list).getTotal())); - } - - @ApiOperation("导出承运商列表") - @PreAuthorize("@ss.hasPermi('wms:carrier:export')") - @Log(title = "承运商", businessType = BusinessType.EXPORT) - @GetMapping("/export") - public ResponseEntity export(CarrierQuery query) { - List list = service.selectList(query, null); - ExcelUtil util = new ExcelUtil<>(CarrierVO.class); - return ResponseEntity.ok(util.writeExcel(convert.dos2vos(list), "承运商数据")); - } - - @ApiOperation("获取承运商详细信息") - @PreAuthorize("@ss.hasPermi('wms:carrier:query')") - @GetMapping(value = "/{id}") - public ResponseEntity getInfo(@PathVariable("id") Long id) { - return ResponseEntity.ok(service.selectById(id)); - } - - @ApiOperation("新增承运商") - @PreAuthorize("@ss.hasPermi('wms:carrier:add')") - @Log(title = "承运商", businessType = BusinessType.INSERT) - @PostMapping - public ResponseEntity add(@RequestBody Carrier carrier) { - return ResponseEntity.ok(service.insert(carrier)); - } - - @ApiOperation("修改承运商") - @PreAuthorize("@ss.hasPermi('wms:carrier:edit')") - @Log(title = "承运商", businessType = BusinessType.UPDATE) - @PutMapping - public ResponseEntity edit(@RequestBody Carrier carrier) { - return ResponseEntity.ok(service.update(carrier)); - } - - @ApiOperation("删除承运商") - @PreAuthorize("@ss.hasPermi('wms:carrier:remove')") - @Log(title = "承运商", businessType = BusinessType.DELETE) - @DeleteMapping("/{ids}") - public ResponseEntity remove(@PathVariable Long[] ids) { - return ResponseEntity.ok(service.deleteByIds(ids)); - } -} diff --git a/wms/src/main/java/com/cyl/wms/controller/CustomerController.java b/wms/src/main/java/com/cyl/wms/controller/CustomerController.java deleted file mode 100644 index 9d63eed..0000000 --- a/wms/src/main/java/com/cyl/wms/controller/CustomerController.java +++ /dev/null @@ -1,93 +0,0 @@ -package com.cyl.wms.controller; - -import java.util.List; - -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; -import org.springframework.data.domain.PageImpl; -import org.springframework.data.domain.Pageable; -import org.springframework.data.domain.Page; -import org.springframework.http.ResponseEntity; -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.ruoyi.common.annotation.Log; -import com.ruoyi.common.core.controller.BaseController; -import com.ruoyi.common.enums.BusinessType; -import com.cyl.wms.convert.CustomerConvert; -import com.cyl.wms.domain.Customer; -import com.cyl.wms.pojo.query.CustomerQuery; -import com.cyl.wms.service.CustomerService; -import com.cyl.wms.pojo.vo.CustomerVO; -import com.ruoyi.common.utils.poi.ExcelUtil; -/** - * 客户Controller - * - * @author zcc - * @date 2022-08-05 - */ -@Api(description ="客户接口列表") -@RestController -@RequestMapping("/wms/customer") -public class CustomerController extends BaseController { - @Autowired - private CustomerService service; - @Autowired - private CustomerConvert convert; - - @ApiOperation("查询客户列表") - @PreAuthorize("@ss.hasPermi('wms:customer:list')") - @PostMapping("/list") - public ResponseEntity> list(@RequestBody CustomerQuery query, Pageable page) { - List list = service.selectList(query, page); - return ResponseEntity.ok(new PageImpl<>(list, page, ((com.github.pagehelper.Page)list).getTotal())); - } - - @ApiOperation("导出客户列表") - @PreAuthorize("@ss.hasPermi('wms:customer:export')") - @Log(title = "客户", businessType = BusinessType.EXPORT) - @GetMapping("/export") - public ResponseEntity export(CustomerQuery query) { - List list = service.selectList(query, null); - ExcelUtil util = new ExcelUtil<>(CustomerVO.class); - return ResponseEntity.ok(util.writeExcel(convert.dos2vos(list), "客户数据")); - } - - @ApiOperation("获取客户详细信息") - @PreAuthorize("@ss.hasPermi('wms:customer:query')") - @GetMapping(value = "/{id}") - public ResponseEntity getInfo(@PathVariable("id") Long id) { - return ResponseEntity.ok(service.selectById(id)); - } - - @ApiOperation("新增客户") - @PreAuthorize("@ss.hasPermi('wms:customer:add')") - @Log(title = "客户", businessType = BusinessType.INSERT) - @PostMapping - public ResponseEntity add(@RequestBody Customer customer) { - return ResponseEntity.ok(service.insert(customer)); - } - - @ApiOperation("修改客户") - @PreAuthorize("@ss.hasPermi('wms:customer:edit')") - @Log(title = "客户", businessType = BusinessType.UPDATE) - @PutMapping - public ResponseEntity edit(@RequestBody Customer customer) { - return ResponseEntity.ok(service.update(customer)); - } - - @ApiOperation("删除客户") - @PreAuthorize("@ss.hasPermi('wms:customer:remove')") - @Log(title = "客户", businessType = BusinessType.DELETE) - @DeleteMapping("/{ids}") - public ResponseEntity remove(@PathVariable Long[] ids) { - return ResponseEntity.ok(service.deleteByIds(ids)); - } -} diff --git a/wms/src/main/java/com/cyl/wms/controller/CustomerTransactionController.java b/wms/src/main/java/com/cyl/wms/controller/CustomerTransactionController.java deleted file mode 100644 index b64a4dd..0000000 --- a/wms/src/main/java/com/cyl/wms/controller/CustomerTransactionController.java +++ /dev/null @@ -1,93 +0,0 @@ -package com.cyl.wms.controller; - -import java.util.List; - -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; -import org.springframework.data.domain.PageImpl; -import org.springframework.data.domain.Pageable; -import org.springframework.data.domain.Page; -import org.springframework.http.ResponseEntity; -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.ruoyi.common.annotation.Log; -import com.ruoyi.common.core.controller.BaseController; -import com.ruoyi.common.enums.BusinessType; -import com.cyl.wms.convert.CustomerTransactionConvert; -import com.cyl.wms.domain.CustomerTransaction; -import com.cyl.wms.pojo.query.CustomerTransactionQuery; -import com.cyl.wms.service.CustomerTransactionService; -import com.cyl.wms.pojo.vo.CustomerTransactionVO; -import com.ruoyi.common.utils.poi.ExcelUtil; -/** - * 客户账户流水Controller - * - * @author zcc - * @date 2023-05-04 - */ -@Api(description ="客户账户流水接口列表") -@RestController -@RequestMapping("/wms/customerTransaction") -public class CustomerTransactionController extends BaseController { - @Autowired - private CustomerTransactionService service; - @Autowired - private CustomerTransactionConvert convert; - - @ApiOperation("查询客户账户流水列表") - @PreAuthorize("@ss.hasPermi('wms:customerTransaction:list')") - @PostMapping("/list") - public ResponseEntity> list(@RequestBody CustomerTransactionQuery query, Pageable page) { - List list = service.selectList(query, page); - return ResponseEntity.ok(new PageImpl<>(list, page, ((com.github.pagehelper.Page)list).getTotal())); - } - - @ApiOperation("导出客户账户流水列表") - @PreAuthorize("@ss.hasPermi('wms:customerTransaction:export')") - @Log(title = "客户账户流水", businessType = BusinessType.EXPORT) - @GetMapping("/export") - public ResponseEntity export(CustomerTransactionQuery query) { - List list = service.selectList(query, null); - ExcelUtil util = new ExcelUtil<>(CustomerTransactionVO.class); - return ResponseEntity.ok(util.writeExcel(convert.dos2vos(list), "客户账户流水数据")); - } - - @ApiOperation("获取客户账户流水详细信息") - @PreAuthorize("@ss.hasPermi('wms:customerTransaction:query')") - @GetMapping(value = "/{id}") - public ResponseEntity getInfo(@PathVariable("id") Integer id) { - return ResponseEntity.ok(service.selectById(id)); - } - - @ApiOperation("新增客户账户流水") - @PreAuthorize("@ss.hasPermi('wms:customerTransaction:add')") - @Log(title = "客户账户流水", businessType = BusinessType.INSERT) - @PostMapping - public ResponseEntity add(@RequestBody CustomerTransaction customerTransaction) { - return ResponseEntity.ok(service.insert(customerTransaction)); - } - - @ApiOperation("修改客户账户流水") - @PreAuthorize("@ss.hasPermi('wms:customerTransaction:edit')") - @Log(title = "客户账户流水", businessType = BusinessType.UPDATE) - @PutMapping - public ResponseEntity edit(@RequestBody CustomerTransaction customerTransaction) { - return ResponseEntity.ok(service.update(customerTransaction)); - } - - @ApiOperation("删除客户账户流水") - @PreAuthorize("@ss.hasPermi('wms:customerTransaction:remove')") - @Log(title = "客户账户流水", businessType = BusinessType.DELETE) - @DeleteMapping("/{ids}") - public ResponseEntity remove(@PathVariable Long[] ids) { - return ResponseEntity.ok(service.deleteByIds(ids)); - } -} diff --git a/wms/src/main/java/com/cyl/wms/controller/DeliveryController.java b/wms/src/main/java/com/cyl/wms/controller/DeliveryController.java deleted file mode 100644 index b3c1851..0000000 --- a/wms/src/main/java/com/cyl/wms/controller/DeliveryController.java +++ /dev/null @@ -1,93 +0,0 @@ -package com.cyl.wms.controller; - -import java.util.List; - -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; -import org.springframework.data.domain.PageImpl; -import org.springframework.data.domain.Pageable; -import org.springframework.data.domain.Page; -import org.springframework.http.ResponseEntity; -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.ruoyi.common.annotation.Log; -import com.ruoyi.common.core.controller.BaseController; -import com.ruoyi.common.enums.BusinessType; -import com.cyl.wms.convert.DeliveryConvert; -import com.cyl.wms.domain.Delivery; -import com.cyl.wms.pojo.query.DeliveryQuery; -import com.cyl.wms.service.DeliveryService; -import com.cyl.wms.pojo.vo.DeliveryVO; -import com.ruoyi.common.utils.poi.ExcelUtil; -/** - * 发货记录Controller - * - * @author zcc - * @date 2022-08-05 - */ -@Api(description ="发货记录接口列表") -@RestController -@RequestMapping("/wms/delivery") -public class DeliveryController extends BaseController { - @Autowired - private DeliveryService service; - @Autowired - private DeliveryConvert convert; - - @ApiOperation("查询发货记录列表") - @PreAuthorize("@ss.hasPermi('wms:delivery:list')") - @PostMapping("/list") - public ResponseEntity> list(@RequestBody DeliveryQuery query, Pageable page) { - List list = service.selectList(query, page); - return ResponseEntity.ok(new PageImpl<>(list, page, ((com.github.pagehelper.Page)list).getTotal())); - } - - @ApiOperation("导出发货记录列表") - @PreAuthorize("@ss.hasPermi('wms:delivery:export')") - @Log(title = "发货记录", businessType = BusinessType.EXPORT) - @GetMapping("/export") - public ResponseEntity export(DeliveryQuery query) { - List list = service.selectList(query, null); - ExcelUtil util = new ExcelUtil<>(DeliveryVO.class); - return ResponseEntity.ok(util.writeExcel(convert.dos2vos(list), "发货记录数据")); - } - - @ApiOperation("获取发货记录详细信息") - @PreAuthorize("@ss.hasPermi('wms:delivery:query')") - @GetMapping(value = "/{id}") - public ResponseEntity getInfo(@PathVariable("id") Long id) { - return ResponseEntity.ok(service.selectById(id)); - } - - @ApiOperation("新增发货记录") - @PreAuthorize("@ss.hasPermi('wms:delivery:add')") - @Log(title = "发货记录", businessType = BusinessType.INSERT) - @PostMapping - public ResponseEntity add(@RequestBody Delivery delivery) { - return ResponseEntity.ok(service.insert(delivery)); - } - - @ApiOperation("修改发货记录") - @PreAuthorize("@ss.hasPermi('wms:delivery:edit')") - @Log(title = "发货记录", businessType = BusinessType.UPDATE) - @PutMapping - public ResponseEntity edit(@RequestBody Delivery delivery) { - return ResponseEntity.ok(service.update(delivery)); - } - - @ApiOperation("删除发货记录") - @PreAuthorize("@ss.hasPermi('wms:delivery:remove')") - @Log(title = "发货记录", businessType = BusinessType.DELETE) - @DeleteMapping("/{ids}") - public ResponseEntity remove(@PathVariable Long[] ids) { - return ResponseEntity.ok(service.deleteByIds(ids)); - } -} diff --git a/wms/src/main/java/com/cyl/wms/controller/InventoryCheckController.java b/wms/src/main/java/com/cyl/wms/controller/InventoryCheckController.java deleted file mode 100644 index 45625a8..0000000 --- a/wms/src/main/java/com/cyl/wms/controller/InventoryCheckController.java +++ /dev/null @@ -1,102 +0,0 @@ -package com.cyl.wms.controller; - -import java.util.List; - -import com.cyl.wms.pojo.vo.form.InventoryCheckFrom; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; -import org.springframework.data.domain.PageImpl; -import org.springframework.data.domain.Pageable; -import org.springframework.data.domain.Page; -import org.springframework.http.ResponseEntity; -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.ruoyi.common.annotation.Log; -import com.ruoyi.common.core.controller.BaseController; -import com.ruoyi.common.enums.BusinessType; -import com.cyl.wms.convert.InventoryCheckConvert; -import com.cyl.wms.domain.InventoryCheck; -import com.cyl.wms.pojo.query.InventoryCheckQuery; -import com.cyl.wms.service.InventoryCheckService; -import com.cyl.wms.pojo.vo.InventoryCheckVO; -import com.ruoyi.common.utils.poi.ExcelUtil; -/** - * 库存盘点单据Controller - * - * @author zcc - * @date 2023-04-25 - */ -@Api(description ="库存盘点单据接口列表") -@RestController -@RequestMapping("/wms/inventoryCheck") -public class InventoryCheckController extends BaseController { - @Autowired - private InventoryCheckService service; - @Autowired - private InventoryCheckConvert convert; - - @ApiOperation("查询库存盘点单据列表") - @PreAuthorize("@ss.hasPermi('wms:inventoryCheck:list')") - @PostMapping("/list") - public ResponseEntity> list(@RequestBody InventoryCheckQuery query, Pageable page) { - List list = service.selectList(query, page); - return ResponseEntity.ok(new PageImpl<>(list, page, ((com.github.pagehelper.Page)list).getTotal())); - } - - @ApiOperation("导出库存盘点单据列表") - @PreAuthorize("@ss.hasPermi('wms:inventoryCheck:export')") - @Log(title = "库存盘点单据", businessType = BusinessType.EXPORT) - @GetMapping("/export") - public ResponseEntity export(InventoryCheckQuery query) { - List list = service.selectList(query, null); - ExcelUtil util = new ExcelUtil<>(InventoryCheckVO.class); - return ResponseEntity.ok(util.writeExcel(convert.dos2vos(list), "库存盘点单据数据")); - } - - @ApiOperation("获取库存盘点单据详细信息") - @PreAuthorize("@ss.hasPermi('wms:inventoryCheck:query')") - @GetMapping(value = "/{id}") - public ResponseEntity getInfo(@PathVariable("id") Long id) { - return ResponseEntity.ok(service.selectById(id)); - } - - @ApiOperation("新增库存盘点单据") - @PreAuthorize("@ss.hasPermi('wms:inventoryCheck:add')") - @Log(title = "库存盘点单据", businessType = BusinessType.INSERT) - @PostMapping - public ResponseEntity add(@RequestBody InventoryCheck inventoryCheck) { - return ResponseEntity.ok(service.insert(inventoryCheck)); - } - - @ApiOperation("修改库存盘点单据") - @PreAuthorize("@ss.hasPermi('wms:inventoryCheck:edit')") - @Log(title = "库存盘点单据", businessType = BusinessType.UPDATE) - @PutMapping - public ResponseEntity edit(@RequestBody InventoryCheck inventoryCheck) { - return ResponseEntity.ok(service.update(inventoryCheck)); - } - - @ApiOperation("删除库存盘点单据") - @PreAuthorize("@ss.hasPermi('wms:inventoryCheck:remove')") - @Log(title = "库存盘点单据", businessType = BusinessType.DELETE) - @DeleteMapping("/{ids}") - public ResponseEntity remove(@PathVariable Long[] ids) { - return ResponseEntity.ok(service.deleteByIds(ids)); - } - - @ApiOperation("新增或更新盘点单据以及盘点单据明细") - @PreAuthorize("@ss.hasPermi('wms:inventoryCheck:edit')") - @Log(title = "库存盘点单据", businessType = BusinessType.INSERT) - @PostMapping("add-or-update") - public ResponseEntity addOrUpdate(@RequestBody InventoryCheckFrom inventoryCheckFrom) { - return ResponseEntity.ok(service.addOrUpdate(inventoryCheckFrom)); - } -} diff --git a/wms/src/main/java/com/cyl/wms/controller/InventoryCheckDetailController.java b/wms/src/main/java/com/cyl/wms/controller/InventoryCheckDetailController.java deleted file mode 100644 index 4017641..0000000 --- a/wms/src/main/java/com/cyl/wms/controller/InventoryCheckDetailController.java +++ /dev/null @@ -1,93 +0,0 @@ -package com.cyl.wms.controller; - -import java.util.List; - -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; -import org.springframework.data.domain.PageImpl; -import org.springframework.data.domain.Pageable; -import org.springframework.data.domain.Page; -import org.springframework.http.ResponseEntity; -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.ruoyi.common.annotation.Log; -import com.ruoyi.common.core.controller.BaseController; -import com.ruoyi.common.enums.BusinessType; -import com.cyl.wms.convert.InventoryCheckDetailConvert; -import com.cyl.wms.domain.InventoryCheckDetail; -import com.cyl.wms.pojo.query.InventoryCheckDetailQuery; -import com.cyl.wms.service.InventoryCheckDetailService; -import com.cyl.wms.pojo.vo.InventoryCheckDetailVO; -import com.ruoyi.common.utils.poi.ExcelUtil; -/** - * 库存盘点单据详情Controller - * - * @author zcc - * @date 2023-04-25 - */ -@Api(description ="库存盘点单据详情接口列表") -@RestController -@RequestMapping("/wms/inventoryCheckDetail") -public class InventoryCheckDetailController extends BaseController { - @Autowired - private InventoryCheckDetailService service; - @Autowired - private InventoryCheckDetailConvert convert; - - @ApiOperation("查询库存盘点单据详情列表") - @PreAuthorize("@ss.hasPermi('wms:inventoryCheckDetail:list')") - @PostMapping("/list") - public ResponseEntity> list(@RequestBody InventoryCheckDetailQuery query, Pageable page) { - List list = service.selectList(query, page); - return ResponseEntity.ok(new PageImpl<>(list, page, ((com.github.pagehelper.Page)list).getTotal())); - } - - @ApiOperation("导出库存盘点单据详情列表") - @PreAuthorize("@ss.hasPermi('wms:inventoryCheckDetail:export')") - @Log(title = "库存盘点单据详情", businessType = BusinessType.EXPORT) - @GetMapping("/export") - public ResponseEntity export(InventoryCheckDetailQuery query) { - List list = service.selectList(query, null); - ExcelUtil util = new ExcelUtil<>(InventoryCheckDetailVO.class); - return ResponseEntity.ok(util.writeExcel(convert.dos2vos(list), "库存盘点单据详情数据")); - } - - @ApiOperation("获取库存盘点单据详情详细信息") - @PreAuthorize("@ss.hasPermi('wms:inventoryCheckDetail:query')") - @GetMapping(value = "/{id}") - public ResponseEntity getInfo(@PathVariable("id") Long id) { - return ResponseEntity.ok(service.selectById(id)); - } - - @ApiOperation("新增库存盘点单据详情") - @PreAuthorize("@ss.hasPermi('wms:inventoryCheckDetail:add')") - @Log(title = "库存盘点单据详情", businessType = BusinessType.INSERT) - @PostMapping - public ResponseEntity add(@RequestBody InventoryCheckDetail inventoryCheckDetail) { - return ResponseEntity.ok(service.insert(inventoryCheckDetail)); - } - - @ApiOperation("修改库存盘点单据详情") - @PreAuthorize("@ss.hasPermi('wms:inventoryCheckDetail:edit')") - @Log(title = "库存盘点单据详情", businessType = BusinessType.UPDATE) - @PutMapping - public ResponseEntity edit(@RequestBody InventoryCheckDetail inventoryCheckDetail) { - return ResponseEntity.ok(service.update(inventoryCheckDetail)); - } - - @ApiOperation("删除库存盘点单据详情") - @PreAuthorize("@ss.hasPermi('wms:inventoryCheckDetail:remove')") - @Log(title = "库存盘点单据详情", businessType = BusinessType.DELETE) - @DeleteMapping("/{ids}") - public ResponseEntity remove(@PathVariable Long[] ids) { - return ResponseEntity.ok(service.deleteByIds(ids)); - } -} diff --git a/wms/src/main/java/com/cyl/wms/controller/InventoryController.java b/wms/src/main/java/com/cyl/wms/controller/InventoryController.java deleted file mode 100644 index ba1d8dd..0000000 --- a/wms/src/main/java/com/cyl/wms/controller/InventoryController.java +++ /dev/null @@ -1,113 +0,0 @@ -package com.cyl.wms.controller; - -import com.cyl.wms.convert.InventoryConvert; -import com.cyl.wms.domain.Inventory; -import com.cyl.wms.pojo.query.InventoryQuery; -import com.cyl.wms.pojo.vo.InventoryVO; -import com.cyl.wms.service.InventoryService; -import com.ruoyi.common.annotation.Log; -import com.ruoyi.common.core.controller.BaseController; -import com.ruoyi.common.enums.BusinessType; -import com.ruoyi.common.utils.poi.ExcelUtil; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.data.domain.Page; -import org.springframework.data.domain.Pageable; -import org.springframework.http.ResponseEntity; -import org.springframework.security.access.prepost.PreAuthorize; -import org.springframework.web.bind.annotation.*; - -import java.util.List; -/** - * 库存Controller - * - * @author zcc - * @date 2022-08-05 - */ -@Api(description ="库存接口列表") -@RestController -@RequestMapping("/wms/inventory") -public class InventoryController extends BaseController { - @Autowired - private InventoryService service; - @Autowired - private InventoryConvert convert; - - @ApiOperation("查询库存列表") - @PreAuthorize("@ss.hasPermi('wms:inventory:list')") - @PostMapping("/list") - public ResponseEntity> list(@RequestBody InventoryQuery query, Pageable page) { - return ResponseEntity.ok(service.queryPage(query, page)); - } - - @ApiOperation("查询预警列表") - @PreAuthorize("@ss.hasPermi('wms:inventory:list')") - @PostMapping("/warnList") - public ResponseEntity> listWarning(Pageable page) { - return ResponseEntity.ok(service.queryWarning(page)); - } - - @ApiOperation("查询过期列表") - @PreAuthorize("@ss.hasPermi('wms:inventory:list')") - @PostMapping("/expiryList") - public ResponseEntity> listExpiry(Pageable page) { - return ResponseEntity.ok(service.queryExpiry(page)); - } - - @ApiOperation("导出库存列表") - @PreAuthorize("@ss.hasPermi('wms:inventory:export')") - @Log(title = "库存", businessType = BusinessType.EXPORT) - @GetMapping("/export") - public ResponseEntity export(InventoryQuery query) { - List list = service.selectList(query, null); - ExcelUtil util = new ExcelUtil<>(InventoryVO.class); - return ResponseEntity.ok(util.writeExcel(convert.dos2vos(list), "库存数据")); - } - - @ApiOperation("获取库存详细信息") - @PreAuthorize("@ss.hasPermi('wms:inventory:query')") - @GetMapping(value = "/{id}") - public ResponseEntity getInfo(@PathVariable("id") Long id) { - return ResponseEntity.ok(service.selectById(id)); - } - - @ApiOperation("新增库存") - @PreAuthorize("@ss.hasPermi('wms:inventory:add')") - @Log(title = "库存", businessType = BusinessType.INSERT) - @PostMapping - public ResponseEntity add(@RequestBody Inventory inventory) { - return ResponseEntity.ok(service.insert(inventory)); - } - - @ApiOperation("修改库存") - @PreAuthorize("@ss.hasPermi('wms:inventory:edit')") - @Log(title = "库存", businessType = BusinessType.UPDATE) - @PutMapping - public ResponseEntity edit(@RequestBody Inventory inventory) { - return ResponseEntity.ok(service.update(inventory)); - } - - @ApiOperation("删除库存") - @PreAuthorize("@ss.hasPermi('wms:inventory:remove')") - @Log(title = "库存", businessType = BusinessType.DELETE) - @DeleteMapping("/{ids}") - public ResponseEntity remove(@PathVariable Long[] ids) { - return ResponseEntity.ok(service.deleteByIds(ids)); - } - @ApiOperation("删除库存") - @PreAuthorize("@ss.hasPermi('wms:inventory:remove')") - @Log(title = "库存", businessType = BusinessType.DELETE) - @DeleteMapping("/item/{ids}") - public ResponseEntity removeByItem(@PathVariable Long[] ids) { - return ResponseEntity.ok(service.deleteByItemIds(ids)); - } - - @ApiOperation("删除库存") - @PreAuthorize("@ss.hasPermi('wms:inventory:remove')") - @Log(title = "库存", businessType = BusinessType.DELETE) - @DeleteMapping("/warehouse/{ids}") - public ResponseEntity removeByWarehouse(@PathVariable Long[] ids) { - return ResponseEntity.ok(service.deleteByWarehouseIds(ids)); - } -} diff --git a/wms/src/main/java/com/cyl/wms/controller/InventoryHistoryController.java b/wms/src/main/java/com/cyl/wms/controller/InventoryHistoryController.java deleted file mode 100644 index 1a51cd3..0000000 --- a/wms/src/main/java/com/cyl/wms/controller/InventoryHistoryController.java +++ /dev/null @@ -1,92 +0,0 @@ -package com.cyl.wms.controller; - -import java.util.List; - -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; -import org.springframework.data.domain.PageImpl; -import org.springframework.data.domain.Pageable; -import org.springframework.data.domain.Page; -import org.springframework.http.ResponseEntity; -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.ruoyi.common.annotation.Log; -import com.ruoyi.common.core.controller.BaseController; -import com.ruoyi.common.enums.BusinessType; -import com.cyl.wms.convert.InventoryHistoryConvert; -import com.cyl.wms.domain.InventoryHistory; -import com.cyl.wms.pojo.query.InventoryHistoryQuery; -import com.cyl.wms.service.InventoryHistoryService; -import com.cyl.wms.pojo.vo.InventoryHistoryVO; -import com.ruoyi.common.utils.poi.ExcelUtil; -/** - * 库存记录Controller - * - * @author zcc - * @date 2022-08-05 - */ -@Api(description ="库存记录接口列表") -@RestController -@RequestMapping("/wms/inventoryHistory") -public class InventoryHistoryController extends BaseController { - @Autowired - private InventoryHistoryService service; - @Autowired - private InventoryHistoryConvert convert; - - @ApiOperation("查询库存记录列表") - @PreAuthorize("@ss.hasPermi('wms:inventoryHistory:list')") - @PostMapping("/list") - public ResponseEntity> list(@RequestBody InventoryHistoryQuery query, Pageable page) { - return ResponseEntity.ok(service.selectList(query, page)); - } - - @ApiOperation("导出库存记录列表") - @PreAuthorize("@ss.hasPermi('wms:inventoryHistory:export')") - @Log(title = "库存记录", businessType = BusinessType.EXPORT) - @GetMapping("/export") - public ResponseEntity export(InventoryHistoryQuery query) { - List list = service.selectList(query); - ExcelUtil util = new ExcelUtil<>(InventoryHistoryVO.class); - return ResponseEntity.ok(util.writeExcel(list, "库存记录数据")); - } - - @ApiOperation("获取库存记录详细信息") - @PreAuthorize("@ss.hasPermi('wms:inventoryHistory:query')") - @GetMapping(value = "/{id}") - public ResponseEntity getInfo(@PathVariable("id") Long id) { - return ResponseEntity.ok(service.selectById(id)); - } - - @ApiOperation("新增库存记录") - @PreAuthorize("@ss.hasPermi('wms:inventoryHistory:add')") - @Log(title = "库存记录", businessType = BusinessType.INSERT) - @PostMapping - public ResponseEntity add(@RequestBody InventoryHistory inventoryHistory) { - return ResponseEntity.ok(service.insert(inventoryHistory)); - } - - @ApiOperation("修改库存记录") - @PreAuthorize("@ss.hasPermi('wms:inventoryHistory:edit')") - @Log(title = "库存记录", businessType = BusinessType.UPDATE) - @PutMapping - public ResponseEntity edit(@RequestBody InventoryHistory inventoryHistory) { - return ResponseEntity.ok(service.update(inventoryHistory)); - } - - @ApiOperation("删除库存记录") - @PreAuthorize("@ss.hasPermi('wms:inventoryHistory:remove')") - @Log(title = "库存记录", businessType = BusinessType.DELETE) - @DeleteMapping("/{ids}") - public ResponseEntity remove(@PathVariable Long[] ids) { - return ResponseEntity.ok(service.deleteByIds(ids)); - } -} diff --git a/wms/src/main/java/com/cyl/wms/controller/InventoryMovementController.java b/wms/src/main/java/com/cyl/wms/controller/InventoryMovementController.java deleted file mode 100644 index 8bd0541..0000000 --- a/wms/src/main/java/com/cyl/wms/controller/InventoryMovementController.java +++ /dev/null @@ -1,102 +0,0 @@ -package com.cyl.wms.controller; - -import java.util.List; - -import com.cyl.wms.pojo.vo.form.InventoryMovementFrom; -import com.cyl.wms.pojo.vo.form.ShipmentOrderFrom; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; -import org.springframework.data.domain.PageImpl; -import org.springframework.data.domain.Pageable; -import org.springframework.data.domain.Page; -import org.springframework.http.ResponseEntity; -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.ruoyi.common.annotation.Log; -import com.ruoyi.common.core.controller.BaseController; -import com.ruoyi.common.enums.BusinessType; -import com.cyl.wms.convert.InventoryMovementConvert; -import com.cyl.wms.domain.InventoryMovement; -import com.cyl.wms.pojo.query.InventoryMovementQuery; -import com.cyl.wms.service.InventoryMovementService; -import com.cyl.wms.pojo.vo.InventoryMovementVO; -import com.ruoyi.common.utils.poi.ExcelUtil; -/** - * 库存移动Controller - * - * @author zcc - * @date 2022-08-05 - */ -@Api(description ="库存移动接口列表") -@RestController -@RequestMapping("/wms/inventoryMovement") -public class InventoryMovementController extends BaseController { - @Autowired - private InventoryMovementService service; - @Autowired - private InventoryMovementConvert convert; - - @ApiOperation("查询库存移动列表") - @PreAuthorize("@ss.hasPermi('wms:inventoryMovement:list')") - @PostMapping("/list") - public ResponseEntity> list(@RequestBody InventoryMovementQuery query, Pageable page) { - return ResponseEntity.ok(service.selectList(query, page)); - } - - @ApiOperation("导出库存移动列表") - @PreAuthorize("@ss.hasPermi('wms:inventoryMovement:export')") - @Log(title = "库存移动", businessType = BusinessType.EXPORT) - @GetMapping("/export") - public ResponseEntity export(InventoryMovementQuery query) { - Page page = service.selectList(query, null); - ExcelUtil util = new ExcelUtil<>(InventoryMovementVO.class); - return ResponseEntity.ok(util.writeExcel(page.getContent(), "库存移动数据")); - } - - @ApiOperation("获取库存移动详细信息") - @PreAuthorize("@ss.hasPermi('wms:inventoryMovement:query')") - @GetMapping(value = "/{id}") - public ResponseEntity getInfo(@PathVariable("id") Long id) { - return ResponseEntity.ok(service.selectById(id)); - } - - @ApiOperation("新增库存移动") - @PreAuthorize("@ss.hasPermi('wms:inventoryMovement:add')") - @Log(title = "库存移动", businessType = BusinessType.INSERT) - @PostMapping - public ResponseEntity add(@RequestBody InventoryMovement inventoryMovement) { - return ResponseEntity.ok(service.insert(inventoryMovement)); - } - - @ApiOperation("修改库存移动") - @PreAuthorize("@ss.hasPermi('wms:inventoryMovement:edit')") - @Log(title = "库存移动", businessType = BusinessType.UPDATE) - @PutMapping - public ResponseEntity edit(@RequestBody InventoryMovement inventoryMovement) { - return ResponseEntity.ok(service.update(inventoryMovement)); - } - - @ApiOperation("删除库存移动") - @PreAuthorize("@ss.hasPermi('wms:inventoryMovement:remove')") - @Log(title = "库存移动", businessType = BusinessType.DELETE) - @DeleteMapping("/{ids}") - public ResponseEntity remove(@PathVariable Long[] ids) { - return ResponseEntity.ok(service.deleteByIds(ids)); - } - - @ApiOperation("新增或更新库存移动") - @PreAuthorize("@ss.hasPermi('wms:inventoryMovement:add')") - @Log(title = "库存移动", businessType = BusinessType.INSERT) - @PostMapping("add-or-update") - public ResponseEntity addOrUpdate(@RequestBody InventoryMovementFrom order) { - return ResponseEntity.ok(service.addOrUpdate(order)); - } -} diff --git a/wms/src/main/java/com/cyl/wms/controller/InventoryMovementDetailController.java b/wms/src/main/java/com/cyl/wms/controller/InventoryMovementDetailController.java deleted file mode 100644 index b5909b4..0000000 --- a/wms/src/main/java/com/cyl/wms/controller/InventoryMovementDetailController.java +++ /dev/null @@ -1,93 +0,0 @@ -package com.cyl.wms.controller; - -import java.util.List; - -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; -import org.springframework.data.domain.PageImpl; -import org.springframework.data.domain.Pageable; -import org.springframework.data.domain.Page; -import org.springframework.http.ResponseEntity; -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.ruoyi.common.annotation.Log; -import com.ruoyi.common.core.controller.BaseController; -import com.ruoyi.common.enums.BusinessType; -import com.cyl.wms.convert.InventoryMovementDetailConvert; -import com.cyl.wms.domain.InventoryMovementDetail; -import com.cyl.wms.pojo.query.InventoryMovementDetailQuery; -import com.cyl.wms.service.InventoryMovementDetailService; -import com.cyl.wms.pojo.vo.InventoryMovementDetailVO; -import com.ruoyi.common.utils.poi.ExcelUtil; -/** - * 库存移动详情Controller - * - * @author zcc - * @date 2022-11-02 - */ -@Api(description ="库存移动详情接口列表") -@RestController -@RequestMapping("/wms/inventoryMovementDetail") -public class InventoryMovementDetailController extends BaseController { - @Autowired - private InventoryMovementDetailService service; - @Autowired - private InventoryMovementDetailConvert convert; - - @ApiOperation("查询库存移动详情列表") - @PreAuthorize("@ss.hasPermi('wms:inventoryMovementDetail:list')") - @PostMapping("/list") - public ResponseEntity> list(@RequestBody InventoryMovementDetailQuery query, Pageable page) { - List list = service.selectList(query, page); - return ResponseEntity.ok(new PageImpl<>(list, page, ((com.github.pagehelper.Page)list).getTotal())); - } - - @ApiOperation("导出库存移动详情列表") - @PreAuthorize("@ss.hasPermi('wms:inventoryMovementDetail:export')") - @Log(title = "库存移动详情", businessType = BusinessType.EXPORT) - @GetMapping("/export") - public ResponseEntity export(InventoryMovementDetailQuery query) { - List list = service.selectList(query, null); - ExcelUtil util = new ExcelUtil<>(InventoryMovementDetailVO.class); - return ResponseEntity.ok(util.writeExcel(convert.dos2vos(list), "库存移动详情数据")); - } - - @ApiOperation("获取库存移动详情详细信息") - @PreAuthorize("@ss.hasPermi('wms:inventoryMovementDetail:query')") - @GetMapping(value = "/{id}") - public ResponseEntity getInfo(@PathVariable("id") Long id) { - return ResponseEntity.ok(service.selectById(id)); - } - - @ApiOperation("新增库存移动详情") - @PreAuthorize("@ss.hasPermi('wms:inventoryMovementDetail:add')") - @Log(title = "库存移动详情", businessType = BusinessType.INSERT) - @PostMapping - public ResponseEntity add(@RequestBody InventoryMovementDetail inventoryMovementDetail) { - return ResponseEntity.ok(service.insert(inventoryMovementDetail)); - } - - @ApiOperation("修改库存移动详情") - @PreAuthorize("@ss.hasPermi('wms:inventoryMovementDetail:edit')") - @Log(title = "库存移动详情", businessType = BusinessType.UPDATE) - @PutMapping - public ResponseEntity edit(@RequestBody InventoryMovementDetail inventoryMovementDetail) { - return ResponseEntity.ok(service.update(inventoryMovementDetail)); - } - - @ApiOperation("删除库存移动详情") - @PreAuthorize("@ss.hasPermi('wms:inventoryMovementDetail:remove')") - @Log(title = "库存移动详情", businessType = BusinessType.DELETE) - @DeleteMapping("/{ids}") - public ResponseEntity remove(@PathVariable Long[] ids) { - return ResponseEntity.ok(service.deleteByIds(ids)); - } -} diff --git a/wms/src/main/java/com/cyl/wms/controller/InventorySettlementController.java b/wms/src/main/java/com/cyl/wms/controller/InventorySettlementController.java deleted file mode 100644 index 48172f9..0000000 --- a/wms/src/main/java/com/cyl/wms/controller/InventorySettlementController.java +++ /dev/null @@ -1,94 +0,0 @@ -package com.cyl.wms.controller; - -import com.cyl.wms.convert.InventorySettlementConvert; -import com.cyl.wms.domain.InventorySettlement; -import com.cyl.wms.pojo.query.InventorySettlementQuery; -import com.cyl.wms.pojo.vo.InventorySettlementVO; -import com.cyl.wms.pojo.vo.form.InventorySettlementFrom; -import com.cyl.wms.service.InventorySettlementService; -import com.ruoyi.common.annotation.Log; -import com.ruoyi.common.core.controller.BaseController; -import com.ruoyi.common.enums.BusinessType; -import com.ruoyi.common.utils.poi.ExcelUtil; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.data.domain.Page; -import org.springframework.data.domain.PageImpl; -import org.springframework.data.domain.Pageable; -import org.springframework.http.ResponseEntity; -import org.springframework.security.access.prepost.PreAuthorize; -import org.springframework.web.bind.annotation.*; - -import java.util.List; -/** - * 库存结算单Controller - * - * @author zcc - * @date 2023-04-18 - */ -@Api(description ="库存结算单接口列表") -@RestController -@RequestMapping("/wms/inventorySettlement") -public class InventorySettlementController extends BaseController { - @Autowired - private InventorySettlementService service; - @Autowired - private InventorySettlementConvert convert; - - @ApiOperation("查询库存结算单列表") - @PreAuthorize("@ss.hasPermi('wms:inventorySettlement:list')") - @PostMapping("/list") - public ResponseEntity> list(@RequestBody InventorySettlementQuery query, Pageable page) { - List list = service.selectList(query, page); - return ResponseEntity.ok(new PageImpl<>(list, page, ((com.github.pagehelper.Page)list).getTotal())); - } - - @ApiOperation("导出库存结算单列表") - @PreAuthorize("@ss.hasPermi('wms:inventorySettlement:export')") - @Log(title = "库存结算单", businessType = BusinessType.EXPORT) - @GetMapping("/export") - public ResponseEntity export(InventorySettlementQuery query) { - List list = service.selectList(query, null); - ExcelUtil util = new ExcelUtil<>(InventorySettlementVO.class); - return ResponseEntity.ok(util.writeExcel(convert.dos2vos(list), "库存结算单数据")); - } - - @ApiOperation("获取库存结算单详细信息") - @PreAuthorize("@ss.hasPermi('wms:inventorySettlement:query')") - @GetMapping(value = "/{id}") - public ResponseEntity getInfo(@PathVariable("id") Long id) { - return ResponseEntity.ok(service.selectById(id)); - } - - @ApiOperation("新增库存结算单") - @PreAuthorize("@ss.hasPermi('wms:inventorySettlement:add')") - @Log(title = "库存结算单", businessType = BusinessType.INSERT) - @PostMapping - public ResponseEntity add(@RequestBody InventorySettlement inventorySettlement) { - return ResponseEntity.ok(service.insert(inventorySettlement)); - } - - @ApiOperation("修改库存结算单") - @PreAuthorize("@ss.hasPermi('wms:inventorySettlement:edit')") - @Log(title = "库存结算单", businessType = BusinessType.UPDATE) - @PutMapping - public ResponseEntity edit(@RequestBody InventorySettlement inventorySettlement) { - return ResponseEntity.ok(service.update(inventorySettlement)); - } - - @ApiOperation("删除库存结算单") - @PreAuthorize("@ss.hasPermi('wms:inventorySettlement:remove')") - @Log(title = "库存结算单", businessType = BusinessType.DELETE) - @DeleteMapping("/{ids}") - public ResponseEntity remove(@PathVariable Long[] ids) { - return ResponseEntity.ok(service.deleteByIds(ids)); - } - @ApiOperation("新增或更新结算单据以及结算单据明细") - @PreAuthorize("@ss.hasPermi('wms:inventorySettlement:edit')") - @Log(title = "库存结算单据", businessType = BusinessType.INSERT) - @PostMapping("add-or-update") - public ResponseEntity addOrUpdate(@RequestBody InventorySettlementFrom inventorySettlementFrom) { - return ResponseEntity.ok(service.addOrUpdate(inventorySettlementFrom)); - } -} diff --git a/wms/src/main/java/com/cyl/wms/controller/InventorySettlementDetailController.java b/wms/src/main/java/com/cyl/wms/controller/InventorySettlementDetailController.java deleted file mode 100644 index 4268c7e..0000000 --- a/wms/src/main/java/com/cyl/wms/controller/InventorySettlementDetailController.java +++ /dev/null @@ -1,94 +0,0 @@ -package com.cyl.wms.controller; - -import com.cyl.wms.convert.InventorySettlementDetailConvert; -import com.cyl.wms.domain.InventorySettlementDetail; -import com.cyl.wms.pojo.query.InventorySettlementDetailQuery; -import com.cyl.wms.pojo.vo.InventorySettlementDetailVO; -import com.cyl.wms.service.InventorySettlementDetailService; -import com.ruoyi.common.annotation.Log; -import com.ruoyi.common.core.controller.BaseController; -import com.ruoyi.common.enums.BusinessType; -import com.ruoyi.common.utils.poi.ExcelUtil; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.data.domain.Page; -import org.springframework.data.domain.PageImpl; -import org.springframework.data.domain.Pageable; -import org.springframework.http.ResponseEntity; -import org.springframework.security.access.prepost.PreAuthorize; -import org.springframework.web.bind.annotation.*; - -import java.util.List; -/** - * 库存结算明细Controller - * - * @author zcc - * @date 2023-04-18 - */ -@Api(description ="库存结算明细接口列表") -@RestController -@RequestMapping("/wms/inventorySettlementDetail") -public class InventorySettlementDetailController extends BaseController { - @Autowired - private InventorySettlementDetailService service; - @Autowired - private InventorySettlementDetailConvert convert; - - @ApiOperation("查询库存结算明细列表") - @PreAuthorize("@ss.hasPermi('wms:inventorySettlementDetail:list')") - @PostMapping("/list") - public ResponseEntity> list(@RequestBody InventorySettlementDetailQuery query, Pageable page) { - List list = service.selectList(query, page); - return ResponseEntity.ok(new PageImpl<>(list, page, ((com.github.pagehelper.Page)list).getTotal())); - } - - @ApiOperation("查询库存信息") - @PreAuthorize("@ss.hasPermi('wms:inventorySettlementDetail:list')") - @PostMapping("/listByTime") - public ResponseEntity> listByTime(@RequestBody InventorySettlementDetailQuery query) { - List list = service.listByTime(query); - return ResponseEntity.ok(list); - } - - @ApiOperation("导出库存结算明细列表") - @PreAuthorize("@ss.hasPermi('wms:inventorySettlementDetail:export')") - @Log(title = "库存结算明细", businessType = BusinessType.EXPORT) - @GetMapping("/export") - public ResponseEntity export(InventorySettlementDetailQuery query) { - List list = service.selectList(query, null); - ExcelUtil util = new ExcelUtil<>(InventorySettlementDetailVO.class); - return ResponseEntity.ok(util.writeExcel(convert.dos2vos(list), "库存结算明细数据")); - } - - @ApiOperation("获取库存结算明细详细信息") - @PreAuthorize("@ss.hasPermi('wms:inventorySettlementDetail:query')") - @GetMapping(value = "/{id}") - public ResponseEntity getInfo(@PathVariable("id") Long id) { - return ResponseEntity.ok(service.selectById(id)); - } - - @ApiOperation("新增库存结算明细") - @PreAuthorize("@ss.hasPermi('wms:inventorySettlementDetail:add')") - @Log(title = "库存结算明细", businessType = BusinessType.INSERT) - @PostMapping - public ResponseEntity add(@RequestBody InventorySettlementDetail inventorySettlementDetail) { - return ResponseEntity.ok(service.insert(inventorySettlementDetail)); - } - - @ApiOperation("修改库存结算明细") - @PreAuthorize("@ss.hasPermi('wms:inventorySettlementDetail:edit')") - @Log(title = "库存结算明细", businessType = BusinessType.UPDATE) - @PutMapping - public ResponseEntity edit(@RequestBody InventorySettlementDetail inventorySettlementDetail) { - return ResponseEntity.ok(service.update(inventorySettlementDetail)); - } - - @ApiOperation("删除库存结算明细") - @PreAuthorize("@ss.hasPermi('wms:inventorySettlementDetail:remove')") - @Log(title = "库存结算明细", businessType = BusinessType.DELETE) - @DeleteMapping("/{ids}") - public ResponseEntity remove(@PathVariable Long[] ids) { - return ResponseEntity.ok(service.deleteByIds(ids)); - } -} diff --git a/wms/src/main/java/com/cyl/wms/controller/ItemController.java b/wms/src/main/java/com/cyl/wms/controller/ItemController.java deleted file mode 100644 index 75d5581..0000000 --- a/wms/src/main/java/com/cyl/wms/controller/ItemController.java +++ /dev/null @@ -1,114 +0,0 @@ -package com.cyl.wms.controller; - -import java.util.LinkedList; -import java.util.List; - -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; -import org.springframework.data.domain.PageImpl; -import org.springframework.data.domain.Pageable; -import org.springframework.data.domain.Page; -import org.springframework.http.ResponseEntity; -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.ruoyi.common.annotation.Log; -import com.ruoyi.common.core.controller.BaseController; -import com.ruoyi.common.enums.BusinessType; -import com.cyl.wms.convert.ItemConvert; -import com.cyl.wms.domain.Item; -import com.cyl.wms.pojo.query.ItemQuery; -import com.cyl.wms.service.ItemService; -import com.cyl.wms.pojo.vo.ItemVO; -import com.ruoyi.common.utils.poi.ExcelUtil; -/** - * 物料Controller - * - * @author zcc - * @date 2022-08-05 - */ -@Api(description ="物料接口列表") -@RestController -@RequestMapping("/wms/item") -public class ItemController extends BaseController { - @Autowired - private ItemService service; - @Autowired - private ItemConvert convert; - - @ApiOperation("查询物料列表") - @PreAuthorize("@ss.hasPermi('wms:item:list')") - @PostMapping("/list") - public ResponseEntity> list(@RequestBody ItemQuery query, Pageable page) { - List items = service.selectList(query, page); - List list = service.toVos(items); - - return ResponseEntity.ok(new PageImpl<>(list, page, ((com.github.pagehelper.Page)items).getTotal())); - } - @ApiOperation("查询物料列表") - @PreAuthorize("@ss.hasPermi('wms:item:list')") - @PostMapping("/all") - public ResponseEntity> all(@RequestBody ItemQuery query) { - List items = service.selectList(query, null); - return ResponseEntity.ok(convert.dos2vos(items)); - } - - @ApiOperation("导出物料列表") - @PreAuthorize("@ss.hasPermi('wms:item:export')") - @Log(title = "物料", businessType = BusinessType.EXPORT) - @GetMapping("/export") - public ResponseEntity export(ItemQuery query) { - List list = service.selectList(query, null); - ExcelUtil util = new ExcelUtil<>(ItemVO.class); - return ResponseEntity.ok(util.writeExcel(convert.dos2vos(list), "物料数据")); - } - - @ApiOperation("获取物料详细信息") - @PreAuthorize("@ss.hasPermi('wms:item:query')") - @GetMapping(value = "/{id}") - public ResponseEntity getInfo(@PathVariable("id") Long id) { - Item item = service.selectById(id); - ItemVO itemVO = service.toVo(item); - return ResponseEntity.ok(itemVO); - } - - @ApiOperation("新增物料") - @PreAuthorize("@ss.hasPermi('wms:item:add')") - @Log(title = "物料", businessType = BusinessType.INSERT) - @PostMapping - public ResponseEntity add(@RequestBody Item item) { - return ResponseEntity.ok(service.insert(item)); - } - - @ApiOperation("修改物料") - @PreAuthorize("@ss.hasPermi('wms:item:edit')") - @Log(title = "物料", businessType = BusinessType.UPDATE) - @PutMapping - public ResponseEntity edit(@RequestBody Item item) { - return ResponseEntity.ok(service.update(item)); - } - - @ApiOperation("删除物料") - @PreAuthorize("@ss.hasPermi('wms:item:remove')") - @Log(title = "物料", businessType = BusinessType.DELETE) - @DeleteMapping("/{ids}") - public ResponseEntity remove(@PathVariable Long[] ids) { - return ResponseEntity.ok(service.deleteByIds(ids)); - } - - @ApiOperation("查询过期物料") - @PreAuthorize("@ss.hasPermi('wms:item:list')") - @PostMapping("/expiryList") - public ResponseEntity> list(Pageable page){ - List items = service.queryExpiry(page); - List list = service.toVos(items); - return ResponseEntity.ok(new PageImpl<>(list, page, ((com.github.pagehelper.Page)items).getTotal())); - } -} diff --git a/wms/src/main/java/com/cyl/wms/controller/ItemTypeController.java b/wms/src/main/java/com/cyl/wms/controller/ItemTypeController.java deleted file mode 100644 index b502946..0000000 --- a/wms/src/main/java/com/cyl/wms/controller/ItemTypeController.java +++ /dev/null @@ -1,107 +0,0 @@ -package com.cyl.wms.controller; - -import com.cyl.wms.convert.ItemTypeConvert; -import com.cyl.wms.domain.ItemType; -import com.cyl.wms.pojo.query.ItemTypeQuery; -import com.cyl.wms.pojo.vo.ItemTypeVO; -import com.cyl.wms.service.ItemTypeService; -import com.ruoyi.common.annotation.Log; -import com.ruoyi.common.core.controller.BaseController; -import com.ruoyi.common.core.domain.AjaxResult; -import com.ruoyi.common.enums.BusinessType; -import com.ruoyi.common.utils.poi.ExcelUtil; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.data.domain.Page; -import org.springframework.data.domain.PageImpl; -import org.springframework.data.domain.Pageable; -import org.springframework.http.ResponseEntity; -import org.springframework.security.access.prepost.PreAuthorize; -import org.springframework.web.bind.annotation.*; - -import java.util.List; - -/** - * 物料类型表Controller - * - * @author zhangcheng - * @date 2023-04-03 - */ -@Api(description = "物料类型表接口列表") -@RestController -@RequestMapping("/wms/itemType") -public class ItemTypeController extends BaseController { - @Autowired - private ItemTypeService service; - @Autowired - private ItemTypeConvert convert; - - @ApiOperation("查询物料类型表列表") - @PreAuthorize("@ss.hasPermi('wms:itemType:list')") - @PostMapping("/list") - public ResponseEntity> list(@RequestBody ItemTypeQuery query, Pageable page) { - List list = service.selectList(query, page); - return ResponseEntity.ok(new PageImpl<>(list, page, ((com.github.pagehelper.Page) list).getTotal())); - } - - /** - * 查询物料类型表列表 - */ - @PreAuthorize("@ss.hasPermi('wms:itemType:list')") - @GetMapping("/noPageList") - public AjaxResult list(ItemTypeQuery query) { - List depts = service.selectList(query, null); - return AjaxResult.success(depts); - } - - @ApiOperation("导出物料类型表列表") - @PreAuthorize("@ss.hasPermi('wms:itemType:export')") - @Log(title = "物料类型表", businessType = BusinessType.EXPORT) - @GetMapping("/export") - public ResponseEntity export(ItemTypeQuery query) { - List list = service.selectList(query, null); - ExcelUtil util = new ExcelUtil<>(ItemTypeVO.class); - return ResponseEntity.ok(util.writeExcel(convert.dos2vos(list), "物料类型表数据")); - } - - /** - * 获取部门下拉树列表 - */ - @GetMapping("/treeselect") - public AjaxResult treeselect(ItemTypeQuery query) { - List itemTypes = service.selectList(query, null); - return AjaxResult.success(service.buildItemTypeTreeSelect(itemTypes)); - } - - @ApiOperation("获取物料类型表详细信息") - @PreAuthorize("@ss.hasPermi('wms:itemType:query')") - @GetMapping(value = "/{itemTypeId}") - public ResponseEntity getInfo(@PathVariable("itemTypeId") Long itemTypeId) { - return ResponseEntity.ok(service.selectByItemTypeId(itemTypeId)); - } - - @ApiOperation("新增物料类型表") - @PreAuthorize("@ss.hasPermi('wms:itemType:add')") - @Log(title = "物料类型表", businessType = BusinessType.INSERT) - @PostMapping - public ResponseEntity add(@RequestBody ItemType itemType) { - return ResponseEntity.ok(service.insert(itemType)); - } - - @ApiOperation("修改物料类型表") - @PreAuthorize("@ss.hasPermi('wms:itemType:edit')") - @Log(title = "物料类型表", businessType = BusinessType.UPDATE) - @PutMapping - public ResponseEntity edit(@RequestBody ItemType itemType) { - return ResponseEntity.ok(service.update(itemType)); - } - - @ApiOperation("删除物料类型表") - @PreAuthorize("@ss.hasPermi('wms:itemType:remove')") - @Log(title = "物料类型表", businessType = BusinessType.DELETE) - @DeleteMapping("/{itemTypeIds}") - public ResponseEntity remove(@PathVariable Long[] itemTypeIds) { - return ResponseEntity.ok(service.deleteByItemTypeIds(itemTypeIds)); - } -} diff --git a/wms/src/main/java/com/cyl/wms/controller/RackController.java b/wms/src/main/java/com/cyl/wms/controller/RackController.java deleted file mode 100644 index 7525cdb..0000000 --- a/wms/src/main/java/com/cyl/wms/controller/RackController.java +++ /dev/null @@ -1,93 +0,0 @@ -package com.cyl.wms.controller; - -import java.util.List; - -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; -import org.springframework.data.domain.PageImpl; -import org.springframework.data.domain.Pageable; -import org.springframework.data.domain.Page; -import org.springframework.http.ResponseEntity; -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.ruoyi.common.annotation.Log; -import com.ruoyi.common.core.controller.BaseController; -import com.ruoyi.common.enums.BusinessType; -import com.cyl.wms.convert.RackConvert; -import com.cyl.wms.domain.Rack; -import com.cyl.wms.pojo.query.RackQuery; -import com.cyl.wms.service.RackService; -import com.cyl.wms.pojo.vo.RackVO; -import com.ruoyi.common.utils.poi.ExcelUtil; -/** - * 货架Controller - * - * @author zcc - * @date 2022-08-05 - */ -@Api(description ="货架接口列表") -@RestController -@RequestMapping("/wms/rack") -public class RackController extends BaseController { - @Autowired - private RackService service; - @Autowired - private RackConvert convert; - - @ApiOperation("查询货架列表") - @PreAuthorize("@ss.hasPermi('wms:rack:list')") - @PostMapping("/list") - public ResponseEntity> list(@RequestBody RackQuery query, Pageable page) { - List list = service.selectList(query, page); - return ResponseEntity.ok(new PageImpl<>(list, page, ((com.github.pagehelper.Page)list).getTotal())); - } - - @ApiOperation("导出货架列表") - @PreAuthorize("@ss.hasPermi('wms:rack:export')") - @Log(title = "货架", businessType = BusinessType.EXPORT) - @GetMapping("/export") - public ResponseEntity export(RackQuery query) { - List list = service.selectList(query, null); - ExcelUtil util = new ExcelUtil<>(RackVO.class); - return ResponseEntity.ok(util.writeExcel(convert.dos2vos(list), "货架数据")); - } - - @ApiOperation("获取货架详细信息") - @PreAuthorize("@ss.hasPermi('wms:rack:query')") - @GetMapping(value = "/{id}") - public ResponseEntity getInfo(@PathVariable("id") Long id) { - return ResponseEntity.ok(service.selectById(id)); - } - - @ApiOperation("新增货架") - @PreAuthorize("@ss.hasPermi('wms:rack:add')") - @Log(title = "货架", businessType = BusinessType.INSERT) - @PostMapping - public ResponseEntity add(@RequestBody Rack rack) { - return ResponseEntity.ok(service.insert(rack)); - } - - @ApiOperation("修改货架") - @PreAuthorize("@ss.hasPermi('wms:rack:edit')") - @Log(title = "货架", businessType = BusinessType.UPDATE) - @PutMapping - public ResponseEntity edit(@RequestBody Rack rack) { - return ResponseEntity.ok(service.update(rack)); - } - - @ApiOperation("删除货架") - @PreAuthorize("@ss.hasPermi('wms:rack:remove')") - @Log(title = "货架", businessType = BusinessType.DELETE) - @DeleteMapping("/{ids}") - public ResponseEntity remove(@PathVariable Long[] ids) { - return ResponseEntity.ok(service.deleteByIds(ids)); - } -} diff --git a/wms/src/main/java/com/cyl/wms/controller/ReceiptOrderController.java b/wms/src/main/java/com/cyl/wms/controller/ReceiptOrderController.java deleted file mode 100644 index 65cde8f..0000000 --- a/wms/src/main/java/com/cyl/wms/controller/ReceiptOrderController.java +++ /dev/null @@ -1,97 +0,0 @@ -package com.cyl.wms.controller; - -import java.util.List; - -import com.cyl.wms.pojo.vo.form.ReceiptOrderForm; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; -import org.springframework.data.domain.PageImpl; -import org.springframework.data.domain.Pageable; -import org.springframework.data.domain.Page; -import org.springframework.http.ResponseEntity; -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.ruoyi.common.annotation.Log; -import com.ruoyi.common.core.controller.BaseController; -import com.ruoyi.common.enums.BusinessType; -import com.cyl.wms.convert.ReceiptOrderConvert; -import com.cyl.wms.domain.ReceiptOrder; -import com.cyl.wms.pojo.query.ReceiptOrderQuery; -import com.cyl.wms.service.ReceiptOrderService; -import com.cyl.wms.pojo.vo.ReceiptOrderVO; -import com.ruoyi.common.utils.poi.ExcelUtil; -/** - * 入库单Controller - * - * @author zcc - * @date 2022-08-29 - */ -@Api(description ="入库单接口列表") -@RestController -@RequestMapping("/wms/receiptOrder") -public class ReceiptOrderController extends BaseController { - @Autowired - private ReceiptOrderService service; - @Autowired - private ReceiptOrderConvert convert; - - @ApiOperation("查询入库单列表") - @PreAuthorize("@ss.hasPermi('wms:receiptOrder:list')") - @PostMapping("/list") - public ResponseEntity> list(@RequestBody ReceiptOrderQuery query, Pageable page) { - return ResponseEntity.ok(service.selectList(query, page)); - } - - @ApiOperation("导出入库单列表") - @PreAuthorize("@ss.hasPermi('wms:receiptOrder:export')") - @Log(title = "入库单", businessType = BusinessType.EXPORT) - @GetMapping("/export") - public ResponseEntity export(ReceiptOrderQuery query) { - List list = service.selectList(query); - ExcelUtil util = new ExcelUtil<>(ReceiptOrderVO.class); - return ResponseEntity.ok(util.writeExcel(list, "入库单数据")); - } - - @ApiOperation("获取入库单详细信息") - @PreAuthorize("@ss.hasPermi('wms:receiptOrder:query')") - @GetMapping(value = "/{id}") - public ResponseEntity getInfo(@PathVariable("id") Long id) { - return ResponseEntity.ok(service.selectById(id)); - } - - @ApiOperation("新增或更新入库单以及入库明细") - @PreAuthorize("@ss.hasPermi('wms:receiptOrder:add')") - @Log(title = "入库单", businessType = BusinessType.INSERT) - @PostMapping("add-or-update") - public ResponseEntity addOrUpdate(@RequestBody ReceiptOrderForm receiptOrder) { - if(receiptOrder.getId() == null ){ - return ResponseEntity.ok(service.add(receiptOrder)); - }else { - return ResponseEntity.ok(service.update(receiptOrder)); - } - } - - @ApiOperation("修改入库单") - @PreAuthorize("@ss.hasPermi('wms:receiptOrder:edit')") - @Log(title = "入库单", businessType = BusinessType.UPDATE) - @PutMapping - public ResponseEntity edit(@RequestBody ReceiptOrder receiptOrder) { - return ResponseEntity.ok(service.update(receiptOrder)); - } - - @ApiOperation("删除入库单") - @PreAuthorize("@ss.hasPermi('wms:receiptOrder:remove')") - @Log(title = "入库单", businessType = BusinessType.DELETE) - @DeleteMapping("/{ids}") - public ResponseEntity remove(@PathVariable Long[] ids) { - return ResponseEntity.ok(service.deleteByIds(ids)); - } -} diff --git a/wms/src/main/java/com/cyl/wms/controller/ReceiptOrderDetailController.java b/wms/src/main/java/com/cyl/wms/controller/ReceiptOrderDetailController.java deleted file mode 100644 index e373b63..0000000 --- a/wms/src/main/java/com/cyl/wms/controller/ReceiptOrderDetailController.java +++ /dev/null @@ -1,97 +0,0 @@ -package com.cyl.wms.controller; - -import java.util.LinkedList; -import java.util.List; - -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; -import org.springframework.data.domain.PageImpl; -import org.springframework.data.domain.Pageable; -import org.springframework.data.domain.Page; -import org.springframework.http.ResponseEntity; -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.ruoyi.common.annotation.Log; -import com.ruoyi.common.core.controller.BaseController; -import com.ruoyi.common.enums.BusinessType; -import com.cyl.wms.convert.ReceiptOrderDetailConvert; -import com.cyl.wms.domain.ReceiptOrderDetail; -import com.cyl.wms.pojo.query.ReceiptOrderDetailQuery; -import com.cyl.wms.service.ReceiptOrderDetailService; -import com.cyl.wms.pojo.vo.ReceiptOrderDetailVO; -import com.ruoyi.common.utils.poi.ExcelUtil; -/** - * 入库单详情Controller - * - * @author zcc - * @date 2022-08-29 - */ -@Api(description ="入库单详情接口列表") -@RestController -@RequestMapping("/wms/receiptOrderDetail") -public class ReceiptOrderDetailController extends BaseController { - @Autowired - private ReceiptOrderDetailService service; - @Autowired - private ReceiptOrderDetailConvert convert; - - @ApiOperation("查询入库单详情列表") - @PreAuthorize("@ss.hasPermi('wms:receiptOrderDetail:list')") - @PostMapping("/list") - public ResponseEntity> list(@RequestBody ReceiptOrderDetailQuery query, Pageable page) { - List items = service.selectList(query, page); - List list = service.toVos(items); - return ResponseEntity.ok(new PageImpl<>(list, page, ((com.github.pagehelper.Page)items).getTotal())); - } - - @ApiOperation("导出入库单详情列表") - @PreAuthorize("@ss.hasPermi('wms:receiptOrderDetail:export')") - @Log(title = "入库单详情", businessType = BusinessType.EXPORT) - @GetMapping("/export") - public ResponseEntity export(ReceiptOrderDetailQuery query) { - List list = service.selectList(query, null); - ExcelUtil util = new ExcelUtil<>(ReceiptOrderDetailVO.class); - return ResponseEntity.ok(util.writeExcel(convert.dos2vos(list), "入库单详情数据")); - } - - @ApiOperation("获取入库单详情详细信息") - @PreAuthorize("@ss.hasPermi('wms:receiptOrderDetail:query')") - @GetMapping(value = "/{id}") - public ResponseEntity getInfo(@PathVariable("id") Long id) { - ReceiptOrderDetail item = service.selectById(id); - ReceiptOrderDetailVO itemVO = service.toVo(item); - return ResponseEntity.ok(itemVO); - } - - @ApiOperation("新增入库单详情") - @PreAuthorize("@ss.hasPermi('wms:receiptOrderDetail:add')") - @Log(title = "入库单详情", businessType = BusinessType.INSERT) - @PostMapping - public ResponseEntity add(@RequestBody ReceiptOrderDetail receiptOrderDetail) { - return ResponseEntity.ok(service.insert(receiptOrderDetail)); - } - - @ApiOperation("修改入库单详情") - @PreAuthorize("@ss.hasPermi('wms:receiptOrderDetail:edit')") - @Log(title = "入库单详情", businessType = BusinessType.UPDATE) - @PutMapping - public ResponseEntity edit(@RequestBody ReceiptOrderDetail receiptOrderDetail) { - return ResponseEntity.ok(service.update(receiptOrderDetail)); - } - - @ApiOperation("删除入库单详情") - @PreAuthorize("@ss.hasPermi('wms:receiptOrderDetail:remove')") - @Log(title = "入库单详情", businessType = BusinessType.DELETE) - @DeleteMapping("/{ids}") - public ResponseEntity remove(@PathVariable Long[] ids) { - return ResponseEntity.ok(service.deleteByIds(ids)); - } -} diff --git a/wms/src/main/java/com/cyl/wms/controller/ShipmentOrderController.java b/wms/src/main/java/com/cyl/wms/controller/ShipmentOrderController.java deleted file mode 100644 index 6939e4e..0000000 --- a/wms/src/main/java/com/cyl/wms/controller/ShipmentOrderController.java +++ /dev/null @@ -1,119 +0,0 @@ -package com.cyl.wms.controller; - -import com.cyl.wms.convert.ShipmentOrderConvert; -import com.cyl.wms.domain.ShipmentOrder; -import com.cyl.wms.pojo.query.CustomerShipmentStatQuery; -import com.cyl.wms.pojo.query.ShipmentOrderQuery; -import com.cyl.wms.pojo.vo.CustomerShipmentStatVO; -import com.cyl.wms.pojo.vo.ShipmentOrderVO; -import com.cyl.wms.pojo.vo.form.ShipmentOrderFrom; -import com.cyl.wms.service.ShipmentOrderService; -import com.ruoyi.common.annotation.Log; -import com.ruoyi.common.core.controller.BaseController; -import com.ruoyi.common.core.domain.AjaxResult; -import com.ruoyi.common.enums.BusinessType; -import com.ruoyi.common.utils.poi.ExcelUtil; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; -import org.apache.commons.lang3.StringUtils; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.data.domain.Page; -import org.springframework.data.domain.Pageable; -import org.springframework.http.ResponseEntity; -import org.springframework.security.access.prepost.PreAuthorize; -import org.springframework.web.bind.annotation.*; - -import java.util.List; - -/** - * 出库单Controller - * - * @author zcc - * @date 2022-08-05 - */ -@Api(description ="出库单接口列表") -@RestController -@RequestMapping("/wms/shipmentOrder") -public class ShipmentOrderController extends BaseController { - @Autowired - private ShipmentOrderService service; - @Autowired - private ShipmentOrderConvert convert; - - @ApiOperation("查询出库单列表") - @PreAuthorize("@ss.hasPermi('wms:shipmentOrder:list')") - @PostMapping("/list") - public ResponseEntity> list(@RequestBody ShipmentOrderQuery query, Pageable page) { - return ResponseEntity.ok(service.selectList(query, page)); - } - - @ApiOperation("导出出库单列表") - @PreAuthorize("@ss.hasPermi('wms:shipmentOrder:export')") - @Log(title = "出库单", businessType = BusinessType.EXPORT) - @GetMapping("/export") - public ResponseEntity export(ShipmentOrderQuery query) { - Page list = service.selectList(query, null); - ExcelUtil util = new ExcelUtil<>(ShipmentOrderVO.class); - return ResponseEntity.ok(util.writeExcel(list.getContent(), "出库单数据")); - } - - @ApiOperation("获取出库单详细信息") - @PreAuthorize("@ss.hasPermi('wms:shipmentOrder:query')") - @GetMapping(value = "/{id}") - public ResponseEntity getInfo(@PathVariable("id") Long id) { - return ResponseEntity.ok(service.selectById(id)); - } - - @ApiOperation("新增出库单") - @PreAuthorize("@ss.hasPermi('wms:shipmentOrder:add')") - @Log(title = "出库单", businessType = BusinessType.INSERT) - @PostMapping - public ResponseEntity add(@RequestBody ShipmentOrder shipmentOrder) { - return ResponseEntity.ok(service.insert(shipmentOrder)); - } - - @ApiOperation("修改出库单") - @PreAuthorize("@ss.hasPermi('wms:shipmentOrder:edit')") - @Log(title = "出库单", businessType = BusinessType.UPDATE) - @PutMapping - public ResponseEntity edit(@RequestBody ShipmentOrder shipmentOrder) { - return ResponseEntity.ok(service.update(shipmentOrder)); - } - - @ApiOperation("删除出库单") - @PreAuthorize("@ss.hasPermi('wms:shipmentOrder:remove')") - @Log(title = "出库单", businessType = BusinessType.DELETE) - @DeleteMapping("/{ids}") - public ResponseEntity remove(@PathVariable Long[] ids) { - return ResponseEntity.ok(service.deleteByIds(ids)); - } - - @ApiOperation("新增或更新出库单以及出库单明细") - @PreAuthorize("@ss.hasPermi('wms:shipmentOrder:add')") - @Log(title = "出库单", businessType = BusinessType.INSERT) - @PostMapping("add-or-update") - public ResponseEntity addOrUpdate(@RequestBody ShipmentOrderFrom order) { - if(order.getId()==null){ - return ResponseEntity.ok(service.add(order)); - }else { - return ResponseEntity.ok(service.update(order)); - } - } - @ApiOperation("单个订单分配仓库") - @PreAuthorize("@ss.hasPermi('wms:shipmentOrder:edit')") - @Log(title = "出库单", businessType = BusinessType.UPDATE) - @PostMapping("allocated") - public ResponseEntity allocatedInventory(Long id,Integer type) { - service.allocatedInventory(id,type); - return ResponseEntity.ok().build(); - } - - @ApiOperation("客户物料类型维度统计出库金额") - @PostMapping("/statByCustomerAndType") - public ResponseEntity> statByCustomerAndType(@RequestBody CustomerShipmentStatQuery query) { - if(StringUtils.isBlank(query.getBeginTime()) || StringUtils.isBlank(query.getEndTime())){ - throw new RuntimeException("开始或结束时间不可为空"); - } - return ResponseEntity.ok(service.statByCustomerAndType(query)); - } -} diff --git a/wms/src/main/java/com/cyl/wms/controller/ShipmentOrderDetailController.java b/wms/src/main/java/com/cyl/wms/controller/ShipmentOrderDetailController.java deleted file mode 100644 index 4392f9d..0000000 --- a/wms/src/main/java/com/cyl/wms/controller/ShipmentOrderDetailController.java +++ /dev/null @@ -1,93 +0,0 @@ -package com.cyl.wms.controller; - -import java.util.List; - -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; -import org.springframework.data.domain.PageImpl; -import org.springframework.data.domain.Pageable; -import org.springframework.data.domain.Page; -import org.springframework.http.ResponseEntity; -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.ruoyi.common.annotation.Log; -import com.ruoyi.common.core.controller.BaseController; -import com.ruoyi.common.enums.BusinessType; -import com.cyl.wms.convert.ShipmentOrderDetailConvert; -import com.cyl.wms.domain.ShipmentOrderDetail; -import com.cyl.wms.pojo.query.ShipmentOrderDetailQuery; -import com.cyl.wms.service.ShipmentOrderDetailService; -import com.cyl.wms.pojo.vo.ShipmentOrderDetailVO; -import com.ruoyi.common.utils.poi.ExcelUtil; -/** - * 出库单详情Controller - * - * @author zcc - * @date 2022-08-05 - */ -@Api(description ="出库单详情接口列表") -@RestController -@RequestMapping("/wms/shipmentOrderDetail") -public class ShipmentOrderDetailController extends BaseController { - @Autowired - private ShipmentOrderDetailService service; - @Autowired - private ShipmentOrderDetailConvert convert; - - @ApiOperation("查询出库单详情列表") - @PreAuthorize("@ss.hasPermi('wms:shipmentOrderDetail:list')") - @PostMapping("/list") - public ResponseEntity> list(@RequestBody ShipmentOrderDetailQuery query, Pageable page) { - List list = service.selectList(query, page); - return ResponseEntity.ok(new PageImpl<>(list, page, ((com.github.pagehelper.Page)list).getTotal())); - } - - @ApiOperation("导出出库单详情列表") - @PreAuthorize("@ss.hasPermi('wms:shipmentOrderDetail:export')") - @Log(title = "出库单详情", businessType = BusinessType.EXPORT) - @GetMapping("/export") - public ResponseEntity export(ShipmentOrderDetailQuery query) { - List list = service.selectList(query, null); - ExcelUtil util = new ExcelUtil<>(ShipmentOrderDetailVO.class); - return ResponseEntity.ok(util.writeExcel(convert.dos2vos(list), "出库单详情数据")); - } - - @ApiOperation("获取出库单详情详细信息") - @PreAuthorize("@ss.hasPermi('wms:shipmentOrderDetail:query')") - @GetMapping(value = "/{id}") - public ResponseEntity getInfo(@PathVariable("id") Long id) { - return ResponseEntity.ok(service.selectById(id)); - } - - @ApiOperation("新增出库单详情") - @PreAuthorize("@ss.hasPermi('wms:shipmentOrderDetail:add')") - @Log(title = "出库单详情", businessType = BusinessType.INSERT) - @PostMapping - public ResponseEntity add(@RequestBody ShipmentOrderDetail shipmentOrderDetail) { - return ResponseEntity.ok(service.insert(shipmentOrderDetail)); - } - - @ApiOperation("修改出库单详情") - @PreAuthorize("@ss.hasPermi('wms:shipmentOrderDetail:edit')") - @Log(title = "出库单详情", businessType = BusinessType.UPDATE) - @PutMapping - public ResponseEntity edit(@RequestBody ShipmentOrderDetail shipmentOrderDetail) { - return ResponseEntity.ok(service.update(shipmentOrderDetail)); - } - - @ApiOperation("删除出库单详情") - @PreAuthorize("@ss.hasPermi('wms:shipmentOrderDetail:remove')") - @Log(title = "出库单详情", businessType = BusinessType.DELETE) - @DeleteMapping("/{ids}") - public ResponseEntity remove(@PathVariable Long[] ids) { - return ResponseEntity.ok(service.deleteByIds(ids)); - } -} diff --git a/wms/src/main/java/com/cyl/wms/controller/SupplierController.java b/wms/src/main/java/com/cyl/wms/controller/SupplierController.java deleted file mode 100644 index 3e63007..0000000 --- a/wms/src/main/java/com/cyl/wms/controller/SupplierController.java +++ /dev/null @@ -1,93 +0,0 @@ -package com.cyl.wms.controller; - -import java.util.List; - -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; -import org.springframework.data.domain.PageImpl; -import org.springframework.data.domain.Pageable; -import org.springframework.data.domain.Page; -import org.springframework.http.ResponseEntity; -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.ruoyi.common.annotation.Log; -import com.ruoyi.common.core.controller.BaseController; -import com.ruoyi.common.enums.BusinessType; -import com.cyl.wms.convert.SupplierConvert; -import com.cyl.wms.domain.Supplier; -import com.cyl.wms.pojo.query.SupplierQuery; -import com.cyl.wms.service.SupplierService; -import com.cyl.wms.pojo.vo.SupplierVO; -import com.ruoyi.common.utils.poi.ExcelUtil; -/** - * 供应商Controller - * - * @author zcc - * @date 2022-08-05 - */ -@Api(description ="供应商接口列表") -@RestController -@RequestMapping("/wms/supplier") -public class SupplierController extends BaseController { - @Autowired - private SupplierService service; - @Autowired - private SupplierConvert convert; - - @ApiOperation("查询供应商列表") - @PreAuthorize("@ss.hasPermi('wms:supplier:list')") - @PostMapping("/list") - public ResponseEntity> list(@RequestBody SupplierQuery query, Pageable page) { - List list = service.selectList(query, page); - return ResponseEntity.ok(new PageImpl<>(list, page, ((com.github.pagehelper.Page)list).getTotal())); - } - - @ApiOperation("导出供应商列表") - @PreAuthorize("@ss.hasPermi('wms:supplier:export')") - @Log(title = "供应商", businessType = BusinessType.EXPORT) - @GetMapping("/export") - public ResponseEntity export(SupplierQuery query) { - List list = service.selectList(query, null); - ExcelUtil util = new ExcelUtil<>(SupplierVO.class); - return ResponseEntity.ok(util.writeExcel(convert.dos2vos(list), "供应商数据")); - } - - @ApiOperation("获取供应商详细信息") - @PreAuthorize("@ss.hasPermi('wms:supplier:query')") - @GetMapping(value = "/{id}") - public ResponseEntity getInfo(@PathVariable("id") Long id) { - return ResponseEntity.ok(service.selectById(id)); - } - - @ApiOperation("新增供应商") - @PreAuthorize("@ss.hasPermi('wms:supplier:add')") - @Log(title = "供应商", businessType = BusinessType.INSERT) - @PostMapping - public ResponseEntity add(@RequestBody Supplier supplier) { - return ResponseEntity.ok(service.insert(supplier)); - } - - @ApiOperation("修改供应商") - @PreAuthorize("@ss.hasPermi('wms:supplier:edit')") - @Log(title = "供应商", businessType = BusinessType.UPDATE) - @PutMapping - public ResponseEntity edit(@RequestBody Supplier supplier) { - return ResponseEntity.ok(service.update(supplier)); - } - - @ApiOperation("删除供应商") - @PreAuthorize("@ss.hasPermi('wms:supplier:remove')") - @Log(title = "供应商", businessType = BusinessType.DELETE) - @DeleteMapping("/{ids}") - public ResponseEntity remove(@PathVariable Long[] ids) { - return ResponseEntity.ok(service.deleteByIds(ids)); - } -} diff --git a/wms/src/main/java/com/cyl/wms/controller/SupplierTransactionController.java b/wms/src/main/java/com/cyl/wms/controller/SupplierTransactionController.java deleted file mode 100644 index 0d8e76b..0000000 --- a/wms/src/main/java/com/cyl/wms/controller/SupplierTransactionController.java +++ /dev/null @@ -1,93 +0,0 @@ -package com.cyl.wms.controller; - -import java.util.List; - -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; -import org.springframework.data.domain.PageImpl; -import org.springframework.data.domain.Pageable; -import org.springframework.data.domain.Page; -import org.springframework.http.ResponseEntity; -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.ruoyi.common.annotation.Log; -import com.ruoyi.common.core.controller.BaseController; -import com.ruoyi.common.enums.BusinessType; -import com.cyl.wms.convert.SupplierTransactionConvert; -import com.cyl.wms.domain.SupplierTransaction; -import com.cyl.wms.pojo.query.SupplierTransactionQuery; -import com.cyl.wms.service.SupplierTransactionService; -import com.cyl.wms.pojo.vo.SupplierTransactionVO; -import com.ruoyi.common.utils.poi.ExcelUtil; -/** - * 供应商账户流水Controller - * - * @author zcc - * @date 2023-05-04 - */ -@Api(description ="供应商账户流水接口列表") -@RestController -@RequestMapping("/wms/supplierTransaction") -public class SupplierTransactionController extends BaseController { - @Autowired - private SupplierTransactionService service; - @Autowired - private SupplierTransactionConvert convert; - - @ApiOperation("查询供应商账户流水列表") - @PreAuthorize("@ss.hasPermi('wms:supplierTransaction:list')") - @PostMapping("/list") - public ResponseEntity> list(@RequestBody SupplierTransactionQuery query, Pageable page) { - List list = service.selectList(query, page); - return ResponseEntity.ok(new PageImpl<>(list, page, ((com.github.pagehelper.Page)list).getTotal())); - } - - @ApiOperation("导出供应商账户流水列表") - @PreAuthorize("@ss.hasPermi('wms:supplierTransaction:export')") - @Log(title = "供应商账户流水", businessType = BusinessType.EXPORT) - @GetMapping("/export") - public ResponseEntity export(SupplierTransactionQuery query) { - List list = service.selectList(query, null); - ExcelUtil util = new ExcelUtil<>(SupplierTransactionVO.class); - return ResponseEntity.ok(util.writeExcel(convert.dos2vos(list), "供应商账户流水数据")); - } - - @ApiOperation("获取供应商账户流水详细信息") - @PreAuthorize("@ss.hasPermi('wms:supplierTransaction:query')") - @GetMapping(value = "/{id}") - public ResponseEntity getInfo(@PathVariable("id") Integer id) { - return ResponseEntity.ok(service.selectById(id)); - } - - @ApiOperation("新增供应商账户流水") - @PreAuthorize("@ss.hasPermi('wms:supplierTransaction:add')") - @Log(title = "供应商账户流水", businessType = BusinessType.INSERT) - @PostMapping - public ResponseEntity add(@RequestBody SupplierTransaction supplierTransaction) { - return ResponseEntity.ok(service.insert(supplierTransaction)); - } - - @ApiOperation("修改供应商账户流水") - @PreAuthorize("@ss.hasPermi('wms:supplierTransaction:edit')") - @Log(title = "供应商账户流水", businessType = BusinessType.UPDATE) - @PutMapping - public ResponseEntity edit(@RequestBody SupplierTransaction supplierTransaction) { - return ResponseEntity.ok(service.update(supplierTransaction)); - } - - @ApiOperation("删除供应商账户流水") - @PreAuthorize("@ss.hasPermi('wms:supplierTransaction:remove')") - @Log(title = "供应商账户流水", businessType = BusinessType.DELETE) - @DeleteMapping("/{ids}") - public ResponseEntity remove(@PathVariable Long[] ids) { - return ResponseEntity.ok(service.deleteByIds(ids)); - } -} diff --git a/wms/src/main/java/com/cyl/wms/controller/WarehouseController.java b/wms/src/main/java/com/cyl/wms/controller/WarehouseController.java deleted file mode 100644 index b28d153..0000000 --- a/wms/src/main/java/com/cyl/wms/controller/WarehouseController.java +++ /dev/null @@ -1,93 +0,0 @@ -package com.cyl.wms.controller; - -import java.util.List; - -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; -import org.springframework.data.domain.PageImpl; -import org.springframework.data.domain.Pageable; -import org.springframework.data.domain.Page; -import org.springframework.http.ResponseEntity; -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.ruoyi.common.annotation.Log; -import com.ruoyi.common.core.controller.BaseController; -import com.ruoyi.common.enums.BusinessType; -import com.cyl.wms.convert.WarehouseConvert; -import com.cyl.wms.domain.Warehouse; -import com.cyl.wms.pojo.query.WarehouseQuery; -import com.cyl.wms.service.WarehouseService; -import com.cyl.wms.pojo.vo.WarehouseVO; -import com.ruoyi.common.utils.poi.ExcelUtil; -/** - * 仓库Controller - * - * @author zcc - * @date 2022-08-05 - */ -@Api(description ="仓库接口列表") -@RestController -@RequestMapping("/wms/warehouse") -public class WarehouseController extends BaseController { - @Autowired - private WarehouseService service; - @Autowired - private WarehouseConvert convert; - - @ApiOperation("查询仓库列表") - @PreAuthorize("@ss.hasPermi('wms:warehouse:list')") - @PostMapping("/list") - public ResponseEntity> list(@RequestBody WarehouseQuery query, Pageable page) { - List list = service.selectList(query, page); - return ResponseEntity.ok(new PageImpl<>(list, page, ((com.github.pagehelper.Page)list).getTotal())); - } - - @ApiOperation("导出仓库列表") - @PreAuthorize("@ss.hasPermi('wms:warehouse:export')") - @Log(title = "仓库", businessType = BusinessType.EXPORT) - @GetMapping("/export") - public ResponseEntity export(WarehouseQuery query) { - List list = service.selectList(query, null); - ExcelUtil util = new ExcelUtil<>(WarehouseVO.class); - return ResponseEntity.ok(util.writeExcel(convert.dos2vos(list), "仓库数据")); - } - - @ApiOperation("获取仓库详细信息") - @PreAuthorize("@ss.hasPermi('wms:warehouse:query')") - @GetMapping(value = "/{id}") - public ResponseEntity getInfo(@PathVariable("id") Long id) { - return ResponseEntity.ok(service.selectById(id)); - } - - @ApiOperation("新增仓库") - @PreAuthorize("@ss.hasPermi('wms:warehouse:add')") - @Log(title = "仓库", businessType = BusinessType.INSERT) - @PostMapping - public ResponseEntity add(@RequestBody Warehouse warehouse) { - return ResponseEntity.ok(service.insert(warehouse)); - } - - @ApiOperation("修改仓库") - @PreAuthorize("@ss.hasPermi('wms:warehouse:edit')") - @Log(title = "仓库", businessType = BusinessType.UPDATE) - @PutMapping - public ResponseEntity edit(@RequestBody Warehouse warehouse) { - return ResponseEntity.ok(service.update(warehouse)); - } - - @ApiOperation("删除仓库") - @PreAuthorize("@ss.hasPermi('wms:warehouse:remove')") - @Log(title = "仓库", businessType = BusinessType.DELETE) - @DeleteMapping("/{ids}") - public ResponseEntity remove(@PathVariable Long[] ids) { - return ResponseEntity.ok(service.deleteByIds(ids)); - } -} diff --git a/wms/src/main/java/com/cyl/wms/controller/WaveController.java b/wms/src/main/java/com/cyl/wms/controller/WaveController.java deleted file mode 100644 index 65a84ce..0000000 --- a/wms/src/main/java/com/cyl/wms/controller/WaveController.java +++ /dev/null @@ -1,115 +0,0 @@ -package com.cyl.wms.controller; - -import com.cyl.wms.convert.WaveConvert; -import com.cyl.wms.domain.Wave; -import com.cyl.wms.pojo.query.WaveQuery; -import com.cyl.wms.pojo.vo.WaveVO; -import com.cyl.wms.pojo.vo.form.OrderWaveFrom; -import com.cyl.wms.service.WaveService; -import com.ruoyi.common.annotation.Log; -import com.ruoyi.common.core.controller.BaseController; -import com.ruoyi.common.enums.BusinessType; -import com.ruoyi.common.utils.poi.ExcelUtil; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.data.domain.Page; -import org.springframework.data.domain.PageImpl; -import org.springframework.data.domain.Pageable; -import org.springframework.http.ResponseEntity; -import org.springframework.security.access.prepost.PreAuthorize; -import org.springframework.web.bind.annotation.*; - -import java.util.List; - -/** - * 波次Controller - * - * @author zhangcheng - * @date 2023-08-16 - */ -@Api(description = "波次接口列表") -@RestController -@RequestMapping("/wms/wave") -public class WaveController extends BaseController { - @Autowired - private WaveService service; - @Autowired - private WaveConvert convert; - - @ApiOperation("查询波次列表") - @PreAuthorize("@ss.hasPermi('wms:wave:list')") - @PostMapping("/list") - public ResponseEntity> list(@RequestBody WaveQuery query, Pageable page) { - List list = service.selectList(query, page); - return ResponseEntity.ok(new PageImpl<>(list, page, ((com.github.pagehelper.Page) list).getTotal())); - } - - @ApiOperation("导出波次列表") - @PreAuthorize("@ss.hasPermi('wms:wave:export')") - @Log(title = "波次", businessType = BusinessType.EXPORT) - @GetMapping("/export") - public ResponseEntity export(WaveQuery query) { - List list = service.selectList(query, null); - ExcelUtil util = new ExcelUtil<>(WaveVO.class); - return ResponseEntity.ok(util.writeExcel(convert.dos2vos(list), "波次数据")); - } - - @ApiOperation("获取波次详细信息") - @PreAuthorize("@ss.hasPermi('wms:wave:query')") - @GetMapping(value = "/{id}") - public ResponseEntity getInfo(@PathVariable("id") Long id) { - return ResponseEntity.ok(service.getShipmentOrders(id)); - } - - @ApiOperation("新增波次") - @PreAuthorize("@ss.hasPermi('wms:wave:add')") - @Log(title = "波次", businessType = BusinessType.INSERT) - @PostMapping - public ResponseEntity add(@RequestBody Wave wave) { - return ResponseEntity.ok(service.creatWave(wave)); - } - - @ApiOperation("波次单分配仓库") - @PreAuthorize("@ss.hasPermi('wms:wave:edit')") - @Log(title = "波次单", businessType = BusinessType.UPDATE) - @PostMapping("allocated") - public ResponseEntity allocatedInventory(Long id,Integer type) { - - return ResponseEntity.ok(service.allocatedInventory(id,type)); - } - - @ApiOperation("应用波次作业") - @PreAuthorize("@ss.hasPermi('wms:wave:edit')") - @Log(title = "波次单", businessType = BusinessType.UPDATE) - @PostMapping("confirmWave") - public ResponseEntity confirmWave(@RequestBody OrderWaveFrom order) { - return ResponseEntity.ok(service.confirmWave(order)); - } - - @ApiOperation("取消波次作业") - @PreAuthorize("@ss.hasPermi('wms:wave:edit')") - @Log(title = "波次单", businessType = BusinessType.UPDATE) - @PostMapping("cancelAllocatedInventory/{id}") - public ResponseEntity cancelAllocatedInventory(@PathVariable("id") Long id) { - return ResponseEntity.ok(service.cancelAllocatedInventory(id)); - } - - @ApiOperation("修改波次") - @PreAuthorize("@ss.hasPermi('wms:wave:edit')") - @Log(title = "波次", businessType = BusinessType.UPDATE) - @PutMapping - public ResponseEntity edit(@RequestBody Wave wave) { - return ResponseEntity.ok(service.update(wave)); - } - - @ApiOperation("删除波次") - @PreAuthorize("@ss.hasPermi('wms:wave:remove')") - @Log(title = "波次", businessType = BusinessType.DELETE) - @DeleteMapping("/{ids}") - public ResponseEntity remove(@PathVariable Long[] ids) { - return ResponseEntity.ok(service.deleteByIds(ids)); - } - - -} diff --git a/wms/src/main/java/com/cyl/wms/convert/AreaConvert.java b/wms/src/main/java/com/cyl/wms/convert/AreaConvert.java deleted file mode 100644 index 808ee08..0000000 --- a/wms/src/main/java/com/cyl/wms/convert/AreaConvert.java +++ /dev/null @@ -1,29 +0,0 @@ -package com.cyl.wms.convert; - -import org.mapstruct.Mapper; -import com.cyl.wms.domain.Area; -import com.cyl.wms.pojo.dto.AreaDTO; -import com.cyl.wms.pojo.vo.AreaVO; -import java.util.List; -/** - * 货区 DO <=> DTO <=> VO / BO / Query - * - * @author zcc - */ -@Mapper(componentModel = "spring") -public interface AreaConvert { - - /** - * @param source DO - * @return DTO - */ - AreaDTO do2dto(Area source); - - /** - * @param source DTO - * @return DO - */ - Area dto2do(AreaDTO source); - - List dos2vos(List list); -} diff --git a/wms/src/main/java/com/cyl/wms/convert/CarrierConvert.java b/wms/src/main/java/com/cyl/wms/convert/CarrierConvert.java deleted file mode 100644 index aa4f018..0000000 --- a/wms/src/main/java/com/cyl/wms/convert/CarrierConvert.java +++ /dev/null @@ -1,29 +0,0 @@ -package com.cyl.wms.convert; - -import org.mapstruct.Mapper; -import com.cyl.wms.domain.Carrier; -import com.cyl.wms.pojo.dto.CarrierDTO; -import com.cyl.wms.pojo.vo.CarrierVO; -import java.util.List; -/** - * 承运商 DO <=> DTO <=> VO / BO / Query - * - * @author zcc - */ -@Mapper(componentModel = "spring") -public interface CarrierConvert { - - /** - * @param source DO - * @return DTO - */ - CarrierDTO do2dto(Carrier source); - - /** - * @param source DTO - * @return DO - */ - Carrier dto2do(CarrierDTO source); - - List dos2vos(List list); -} diff --git a/wms/src/main/java/com/cyl/wms/convert/CustomerConvert.java b/wms/src/main/java/com/cyl/wms/convert/CustomerConvert.java deleted file mode 100644 index 7edbbe9..0000000 --- a/wms/src/main/java/com/cyl/wms/convert/CustomerConvert.java +++ /dev/null @@ -1,29 +0,0 @@ -package com.cyl.wms.convert; - -import org.mapstruct.Mapper; -import com.cyl.wms.domain.Customer; -import com.cyl.wms.pojo.dto.CustomerDTO; -import com.cyl.wms.pojo.vo.CustomerVO; -import java.util.List; -/** - * 客户 DO <=> DTO <=> VO / BO / Query - * - * @author zcc - */ -@Mapper(componentModel = "spring") -public interface CustomerConvert { - - /** - * @param source DO - * @return DTO - */ - CustomerDTO do2dto(Customer source); - - /** - * @param source DTO - * @return DO - */ - Customer dto2do(CustomerDTO source); - - List dos2vos(List list); -} diff --git a/wms/src/main/java/com/cyl/wms/convert/CustomerTransactionConvert.java b/wms/src/main/java/com/cyl/wms/convert/CustomerTransactionConvert.java deleted file mode 100644 index b610e2d..0000000 --- a/wms/src/main/java/com/cyl/wms/convert/CustomerTransactionConvert.java +++ /dev/null @@ -1,29 +0,0 @@ -package com.cyl.wms.convert; - -import org.mapstruct.Mapper; -import com.cyl.wms.domain.CustomerTransaction; -import com.cyl.wms.pojo.dto.CustomerTransactionDTO; -import com.cyl.wms.pojo.vo.CustomerTransactionVO; -import java.util.List; -/** - * 客户账户流水 DO <=> DTO <=> VO / BO / Query - * - * @author zcc - */ -@Mapper(componentModel = "spring") -public interface CustomerTransactionConvert { - - /** - * @param source DO - * @return DTO - */ - CustomerTransactionDTO do2dto(CustomerTransaction source); - - /** - * @param source DTO - * @return DO - */ - CustomerTransaction dto2do(CustomerTransactionDTO source); - - List dos2vos(List list); -} diff --git a/wms/src/main/java/com/cyl/wms/convert/DeliveryConvert.java b/wms/src/main/java/com/cyl/wms/convert/DeliveryConvert.java deleted file mode 100644 index 06eb780..0000000 --- a/wms/src/main/java/com/cyl/wms/convert/DeliveryConvert.java +++ /dev/null @@ -1,29 +0,0 @@ -package com.cyl.wms.convert; - -import org.mapstruct.Mapper; -import com.cyl.wms.domain.Delivery; -import com.cyl.wms.pojo.dto.DeliveryDTO; -import com.cyl.wms.pojo.vo.DeliveryVO; -import java.util.List; -/** - * 发货记录 DO <=> DTO <=> VO / BO / Query - * - * @author zcc - */ -@Mapper(componentModel = "spring") -public interface DeliveryConvert { - - /** - * @param source DO - * @return DTO - */ - DeliveryDTO do2dto(Delivery source); - - /** - * @param source DTO - * @return DO - */ - Delivery dto2do(DeliveryDTO source); - - List dos2vos(List list); -} diff --git a/wms/src/main/java/com/cyl/wms/convert/InventoryCheckConvert.java b/wms/src/main/java/com/cyl/wms/convert/InventoryCheckConvert.java deleted file mode 100644 index 944e221..0000000 --- a/wms/src/main/java/com/cyl/wms/convert/InventoryCheckConvert.java +++ /dev/null @@ -1,32 +0,0 @@ -package com.cyl.wms.convert; - -import com.cyl.wms.pojo.vo.form.InventoryCheckFrom; -import org.mapstruct.Mapper; -import com.cyl.wms.domain.InventoryCheck; -import com.cyl.wms.pojo.dto.InventoryCheckDTO; -import com.cyl.wms.pojo.vo.InventoryCheckVO; -import java.util.List; -/** - * 库存盘点单据 DO <=> DTO <=> VO / BO / Query - * - * @author zcc - */ -@Mapper(componentModel = "spring") -public interface InventoryCheckConvert { - - /** - * @param source DO - * @return DTO - */ - InventoryCheckDTO do2dto(InventoryCheck source); - - /** - * @param source DTO - * @return DO - */ - InventoryCheck dto2do(InventoryCheckDTO source); - - List dos2vos(List list); - - InventoryCheckFrom do2form(InventoryCheck inventoryCheck); -} diff --git a/wms/src/main/java/com/cyl/wms/convert/InventoryCheckDetailConvert.java b/wms/src/main/java/com/cyl/wms/convert/InventoryCheckDetailConvert.java deleted file mode 100644 index 28497c9..0000000 --- a/wms/src/main/java/com/cyl/wms/convert/InventoryCheckDetailConvert.java +++ /dev/null @@ -1,34 +0,0 @@ -package com.cyl.wms.convert; - -import com.cyl.wms.domain.InventoryHistory; -import org.mapstruct.Mapper; -import com.cyl.wms.domain.InventoryCheckDetail; -import com.cyl.wms.pojo.dto.InventoryCheckDetailDTO; -import com.cyl.wms.pojo.vo.InventoryCheckDetailVO; -import java.util.List; -/** - * 库存盘点单据详情 DO <=> DTO <=> VO / BO / Query - * - * @author zcc - */ -@Mapper(componentModel = "spring") -public interface InventoryCheckDetailConvert { - - /** - * @param source DO - * @return DTO - */ - InventoryCheckDetailDTO do2dto(InventoryCheckDetail source); - - /** - * @param source DTO - * @return DO - */ - InventoryCheckDetail dto2do(InventoryCheckDetailDTO source); - - List dos2vos(List list); - - List vos2dos(List details); - - InventoryHistory vo2InventoryHistory(InventoryCheckDetailVO it); -} diff --git a/wms/src/main/java/com/cyl/wms/convert/InventoryConvert.java b/wms/src/main/java/com/cyl/wms/convert/InventoryConvert.java deleted file mode 100644 index a081f13..0000000 --- a/wms/src/main/java/com/cyl/wms/convert/InventoryConvert.java +++ /dev/null @@ -1,32 +0,0 @@ -package com.cyl.wms.convert; - -import com.cyl.wms.domain.InventoryHistory; -import org.mapstruct.Mapper; -import com.cyl.wms.domain.Inventory; -import com.cyl.wms.pojo.dto.InventoryDTO; -import com.cyl.wms.pojo.vo.InventoryVO; -import java.util.List; -/** - * 库存 DO <=> DTO <=> VO / BO / Query - * - * @author zcc - */ -@Mapper(componentModel = "spring") -public interface InventoryConvert { - - /** - * @param source DO - * @return DTO - */ - InventoryDTO do2dto(Inventory source); - - /** - * @param source DTO - * @return DO - */ - Inventory dto2do(InventoryDTO source); - - List dos2vos(List list); - - Inventory inventoryHistory2invertory(InventoryHistory it); -} diff --git a/wms/src/main/java/com/cyl/wms/convert/InventoryHistoryConvert.java b/wms/src/main/java/com/cyl/wms/convert/InventoryHistoryConvert.java deleted file mode 100644 index e6f2ece..0000000 --- a/wms/src/main/java/com/cyl/wms/convert/InventoryHistoryConvert.java +++ /dev/null @@ -1,29 +0,0 @@ -package com.cyl.wms.convert; - -import org.mapstruct.Mapper; -import com.cyl.wms.domain.InventoryHistory; -import com.cyl.wms.pojo.dto.InventoryHistoryDTO; -import com.cyl.wms.pojo.vo.InventoryHistoryVO; -import java.util.List; -/** - * 库存记录 DO <=> DTO <=> VO / BO / Query - * - * @author zcc - */ -@Mapper(componentModel = "spring") -public interface InventoryHistoryConvert { - - /** - * @param source DO - * @return DTO - */ - InventoryHistoryDTO do2dto(InventoryHistory source); - - /** - * @param source DTO - * @return DO - */ - InventoryHistory dto2do(InventoryHistoryDTO source); - - List dos2vos(List list); -} diff --git a/wms/src/main/java/com/cyl/wms/convert/InventoryMovementConvert.java b/wms/src/main/java/com/cyl/wms/convert/InventoryMovementConvert.java deleted file mode 100644 index 90b5276..0000000 --- a/wms/src/main/java/com/cyl/wms/convert/InventoryMovementConvert.java +++ /dev/null @@ -1,34 +0,0 @@ -package com.cyl.wms.convert; - -import com.cyl.wms.pojo.vo.form.InventoryMovementFrom; -import org.mapstruct.Mapper; -import com.cyl.wms.domain.InventoryMovement; -import com.cyl.wms.pojo.dto.InventoryMovementDTO; -import com.cyl.wms.pojo.vo.InventoryMovementVO; - -import java.util.List; - -/** - * 库存移动 DO <=> DTO <=> VO / BO / Query - * - * @author zcc - */ -@Mapper(componentModel = "spring") -public interface InventoryMovementConvert { - - /** - * @param source DO - * @return DTO - */ - InventoryMovementDTO do2dto(InventoryMovement source); - - /** - * @param source DTO - * @return DO - */ - InventoryMovement dto2do(InventoryMovementDTO source); - - List dos2vos(List list); - - InventoryMovementFrom do2form(InventoryMovement order); -} diff --git a/wms/src/main/java/com/cyl/wms/convert/InventoryMovementDetailConvert.java b/wms/src/main/java/com/cyl/wms/convert/InventoryMovementDetailConvert.java deleted file mode 100644 index 394c6e5..0000000 --- a/wms/src/main/java/com/cyl/wms/convert/InventoryMovementDetailConvert.java +++ /dev/null @@ -1,38 +0,0 @@ -package com.cyl.wms.convert; - -import com.cyl.wms.domain.InventoryHistory; -import org.mapstruct.Mapper; -import com.cyl.wms.domain.InventoryMovementDetail; -import com.cyl.wms.pojo.dto.InventoryMovementDetailDTO; -import com.cyl.wms.pojo.vo.InventoryMovementDetailVO; -import org.mapstruct.Mapping; - -import java.util.List; - -/** - * 库存移动详情 DO <=> DTO <=> VO / BO / Query - * - * @author zcc - */ -@Mapper(componentModel = "spring") -public interface InventoryMovementDetailConvert { - - /** - * @param source DO - * @return DTO - */ - InventoryMovementDetailDTO do2dto(InventoryMovementDetail source); - - /** - * @param source DTO - * @return DO - */ - InventoryMovementDetail dto2do(InventoryMovementDetailDTO source); - - List dos2vos(List list); - - List vos2dos(List details); - - @Mapping(target = "quantity", source = "realQuantity") - InventoryHistory do2InventoryHistory(InventoryMovementDetailVO it); -} diff --git a/wms/src/main/java/com/cyl/wms/convert/InventorySettlementConvert.java b/wms/src/main/java/com/cyl/wms/convert/InventorySettlementConvert.java deleted file mode 100644 index e64f017..0000000 --- a/wms/src/main/java/com/cyl/wms/convert/InventorySettlementConvert.java +++ /dev/null @@ -1,33 +0,0 @@ -package com.cyl.wms.convert; - -import com.cyl.wms.domain.InventorySettlement; -import com.cyl.wms.pojo.dto.InventorySettlementDTO; -import com.cyl.wms.pojo.vo.InventorySettlementVO; -import com.cyl.wms.pojo.vo.form.InventorySettlementFrom; -import org.mapstruct.Mapper; - -import java.util.List; -/** - * 库存结算单 DO <=> DTO <=> VO / BO / Query - * - * @author zcc - */ -@Mapper(componentModel = "spring") -public interface InventorySettlementConvert { - - /** - * @param source DO - * @return DTO - */ - InventorySettlementDTO do2dto(InventorySettlement source); - - /** - * @param source DTO - * @return DO - */ - InventorySettlement dto2do(InventorySettlementDTO source); - - List dos2vos(List list); - - InventorySettlementFrom do2form(InventorySettlement inventorySettlement); -} diff --git a/wms/src/main/java/com/cyl/wms/convert/InventorySettlementDetailConvert.java b/wms/src/main/java/com/cyl/wms/convert/InventorySettlementDetailConvert.java deleted file mode 100644 index 4f5b70a..0000000 --- a/wms/src/main/java/com/cyl/wms/convert/InventorySettlementDetailConvert.java +++ /dev/null @@ -1,34 +0,0 @@ -package com.cyl.wms.convert; - -import com.cyl.wms.domain.InventorySettlementDetail; -import com.cyl.wms.pojo.dto.InventorySettlementDetailDTO; -import com.cyl.wms.pojo.vo.InventorySettlementDetailVO; -import org.mapstruct.Mapper; - -import java.util.List; -/** - * 库存结算明细 DO <=> DTO <=> VO / BO / Query - * - * @author zcc - */ -@Mapper(componentModel = "spring") -public interface InventorySettlementDetailConvert { - - /** - * @param source DO - * @return DTO - */ - InventorySettlementDetailDTO do2dto(InventorySettlementDetail source); - - /** - * @param source DTO - * @return DO - */ - InventorySettlementDetail dto2do(InventorySettlementDetailDTO source); - - List dos2vos(List list); - - List vos2dos(List details); - - List toVos(List inventoryCheckDetails); -} diff --git a/wms/src/main/java/com/cyl/wms/convert/ItemConvert.java b/wms/src/main/java/com/cyl/wms/convert/ItemConvert.java deleted file mode 100644 index 0c0f421..0000000 --- a/wms/src/main/java/com/cyl/wms/convert/ItemConvert.java +++ /dev/null @@ -1,35 +0,0 @@ -package com.cyl.wms.convert; - -import org.mapstruct.Mapper; -import com.cyl.wms.domain.Item; -import com.cyl.wms.pojo.dto.ItemDTO; -import com.cyl.wms.pojo.vo.ItemVO; -import java.util.List; -/** - * 物料 DO <=> DTO <=> VO / BO / Query - * - * @author zcc - */ -@Mapper(componentModel = "spring") -public interface ItemConvert { - - /** - * @param source DO - * @return DTO - */ - ItemDTO do2dto(Item source); - - /** - * @param source DTO - * @return DO - */ - Item dto2do(ItemDTO source); - - /** - * @param source DO - * @return VO - */ - ItemVO toVo(Item source); - - List dos2vos(List list); -} diff --git a/wms/src/main/java/com/cyl/wms/convert/ItemTypeConvert.java b/wms/src/main/java/com/cyl/wms/convert/ItemTypeConvert.java deleted file mode 100644 index dcbb7d9..0000000 --- a/wms/src/main/java/com/cyl/wms/convert/ItemTypeConvert.java +++ /dev/null @@ -1,29 +0,0 @@ -package com.cyl.wms.convert; - -import org.mapstruct.Mapper; -import com.cyl.wms.domain.ItemType; -import com.cyl.wms.pojo.dto.ItemTypeDTO; -import com.cyl.wms.pojo.vo.ItemTypeVO; -import java.util.List; -/** - * 物料类型表 DO <=> DTO <=> VO / BO / Query - * - * @author zcc - */ -@Mapper(componentModel = "spring") -public interface ItemTypeConvert { - - /** - * @param source DO - * @return DTO - */ - ItemTypeDTO do2dto(ItemType source); - - /** - * @param source DTO - * @return DO - */ - ItemType dto2do(ItemTypeDTO source); - - List dos2vos(List list); -} diff --git a/wms/src/main/java/com/cyl/wms/convert/RackConvert.java b/wms/src/main/java/com/cyl/wms/convert/RackConvert.java deleted file mode 100644 index 313f74a..0000000 --- a/wms/src/main/java/com/cyl/wms/convert/RackConvert.java +++ /dev/null @@ -1,29 +0,0 @@ -package com.cyl.wms.convert; - -import org.mapstruct.Mapper; -import com.cyl.wms.domain.Rack; -import com.cyl.wms.pojo.dto.RackDTO; -import com.cyl.wms.pojo.vo.RackVO; -import java.util.List; -/** - * 货架 DO <=> DTO <=> VO / BO / Query - * - * @author zcc - */ -@Mapper(componentModel = "spring") -public interface RackConvert { - - /** - * @param source DO - * @return DTO - */ - RackDTO do2dto(Rack source); - - /** - * @param source DTO - * @return DO - */ - Rack dto2do(RackDTO source); - - List dos2vos(List list); -} diff --git a/wms/src/main/java/com/cyl/wms/convert/ReceiptOrderConvert.java b/wms/src/main/java/com/cyl/wms/convert/ReceiptOrderConvert.java deleted file mode 100644 index 18250a3..0000000 --- a/wms/src/main/java/com/cyl/wms/convert/ReceiptOrderConvert.java +++ /dev/null @@ -1,32 +0,0 @@ -package com.cyl.wms.convert; - -import com.cyl.wms.pojo.vo.form.ReceiptOrderForm; -import org.mapstruct.Mapper; -import com.cyl.wms.domain.ReceiptOrder; -import com.cyl.wms.pojo.dto.ReceiptOrderDTO; -import com.cyl.wms.pojo.vo.ReceiptOrderVO; -import java.util.List; -/** - * 入库单 DO <=> DTO <=> VO / BO / Query - * - * @author zcc - */ -@Mapper(componentModel = "spring") -public interface ReceiptOrderConvert { - - /** - * @param source DO - * @return DTO - */ - ReceiptOrderDTO do2dto(ReceiptOrder source); - - /** - * @param source DTO - * @return DO - */ - ReceiptOrder dto2do(ReceiptOrderDTO source); - - List dos2vos(List list); - - ReceiptOrderForm do2form(ReceiptOrder bean); -} diff --git a/wms/src/main/java/com/cyl/wms/convert/ReceiptOrderDetailConvert.java b/wms/src/main/java/com/cyl/wms/convert/ReceiptOrderDetailConvert.java deleted file mode 100644 index 5150308..0000000 --- a/wms/src/main/java/com/cyl/wms/convert/ReceiptOrderDetailConvert.java +++ /dev/null @@ -1,44 +0,0 @@ -package com.cyl.wms.convert; - -import com.cyl.wms.domain.InventoryHistory; -import com.cyl.wms.domain.ReceiptOrderDetail; -import com.cyl.wms.pojo.dto.ReceiptOrderDetailDTO; -import com.cyl.wms.pojo.vo.ReceiptOrderDetailVO; -import org.mapstruct.Mapper; -import org.mapstruct.Mapping; - -import java.util.List; - -/** - * 入库单详情 DO <=> DTO <=> VO / BO / Query - * - * @author zcc - */ -@Mapper(componentModel = "spring") -public interface ReceiptOrderDetailConvert { - - /** - * @param source DO - * @return DTO - */ - ReceiptOrderDetailDTO do2dto(ReceiptOrderDetail source); - - /** - * @param source DTO - * @return DO - */ - ReceiptOrderDetail dto2do(ReceiptOrderDetailDTO source); - - /** - * @param source DO - * @return VO - */ - ReceiptOrderDetailVO toVo(ReceiptOrderDetail source); - - List dos2vos(List list); - - List vos2dos(List details); - - @Mapping(target = "quantity", source = "realQuantity") - InventoryHistory do2InventoryHistory(ReceiptOrderDetailVO it); -} diff --git a/wms/src/main/java/com/cyl/wms/convert/ShipmentOrderConvert.java b/wms/src/main/java/com/cyl/wms/convert/ShipmentOrderConvert.java deleted file mode 100644 index f984fa6..0000000 --- a/wms/src/main/java/com/cyl/wms/convert/ShipmentOrderConvert.java +++ /dev/null @@ -1,33 +0,0 @@ -package com.cyl.wms.convert; - -import com.cyl.wms.domain.ShipmentOrder; -import com.cyl.wms.pojo.dto.ShipmentOrderDTO; -import com.cyl.wms.pojo.vo.ShipmentOrderVO; -import com.cyl.wms.pojo.vo.form.ShipmentOrderFrom; -import org.mapstruct.Mapper; - -import java.util.List; -/** - * 出库单 DO <=> DTO <=> VO / BO / Query - * - * @author zcc - */ -@Mapper(componentModel = "spring") -public interface ShipmentOrderConvert { - - /** - * @param source DO - * @return DTO - */ - ShipmentOrderDTO do2dto(ShipmentOrder source); - - /** - * @param source DTO - * @return DO - */ - ShipmentOrder dto2do(ShipmentOrderDTO source); - - List dos2vos(List list); - - ShipmentOrderFrom do2form(ShipmentOrder bean); -} diff --git a/wms/src/main/java/com/cyl/wms/convert/ShipmentOrderDetailConvert.java b/wms/src/main/java/com/cyl/wms/convert/ShipmentOrderDetailConvert.java deleted file mode 100644 index 5d889e6..0000000 --- a/wms/src/main/java/com/cyl/wms/convert/ShipmentOrderDetailConvert.java +++ /dev/null @@ -1,58 +0,0 @@ -package com.cyl.wms.convert; - -import com.cyl.wms.domain.InventoryHistory; -import com.cyl.wms.domain.ShipmentOrderDetail; -import com.cyl.wms.pojo.dto.ShipmentOrderDetailDTO; -import com.cyl.wms.pojo.vo.ShipmentOrderDetailVO; -import org.apache.commons.lang3.SerializationUtils; -import org.mapstruct.Mapper; -import org.mapstruct.Mapping; - -import java.util.ArrayList; -import java.util.Collection; -import java.util.List; - -/** - * 出库单详情 DO <=> DTO <=> VO / BO / Query - * - * @author zcc - */ -@Mapper(componentModel = "spring") -public interface ShipmentOrderDetailConvert { - - /** - * @param source DO - * @return DTO - */ - ShipmentOrderDetailDTO do2dto(ShipmentOrderDetail source); - - /** - * @param source DTO - * @return DO - */ - ShipmentOrderDetail dto2do(ShipmentOrderDetailDTO source); - - List dos2vos(List list); - - List vos2dos(List details); - - @Mapping(target = "quantity", source = "realQuantity") - InventoryHistory do2InventoryHistory(ShipmentOrderDetailVO it); - - /* - * 深拷贝 - * @param original 原始集合 - * @return 拷贝后的集合 - * */ - default Collection copyList(Collection original) { - List deepCopy = new ArrayList<>(); - - for (ShipmentOrderDetailVO element : original) { - byte[] serializedObject = SerializationUtils.serialize(element); - ShipmentOrderDetailVO clonedElement = SerializationUtils.deserialize(serializedObject); - deepCopy.add(clonedElement); - } - - return deepCopy; - } -} diff --git a/wms/src/main/java/com/cyl/wms/convert/SupplierConvert.java b/wms/src/main/java/com/cyl/wms/convert/SupplierConvert.java deleted file mode 100644 index f4f4735..0000000 --- a/wms/src/main/java/com/cyl/wms/convert/SupplierConvert.java +++ /dev/null @@ -1,29 +0,0 @@ -package com.cyl.wms.convert; - -import org.mapstruct.Mapper; -import com.cyl.wms.domain.Supplier; -import com.cyl.wms.pojo.dto.SupplierDTO; -import com.cyl.wms.pojo.vo.SupplierVO; -import java.util.List; -/** - * 供应商 DO <=> DTO <=> VO / BO / Query - * - * @author zcc - */ -@Mapper(componentModel = "spring") -public interface SupplierConvert { - - /** - * @param source DO - * @return DTO - */ - SupplierDTO do2dto(Supplier source); - - /** - * @param source DTO - * @return DO - */ - Supplier dto2do(SupplierDTO source); - - List dos2vos(List list); -} diff --git a/wms/src/main/java/com/cyl/wms/convert/SupplierTransactionConvert.java b/wms/src/main/java/com/cyl/wms/convert/SupplierTransactionConvert.java deleted file mode 100644 index 0bfaf8c..0000000 --- a/wms/src/main/java/com/cyl/wms/convert/SupplierTransactionConvert.java +++ /dev/null @@ -1,29 +0,0 @@ -package com.cyl.wms.convert; - -import org.mapstruct.Mapper; -import com.cyl.wms.domain.SupplierTransaction; -import com.cyl.wms.pojo.dto.SupplierTransactionDTO; -import com.cyl.wms.pojo.vo.SupplierTransactionVO; -import java.util.List; -/** - * 供应商账户流水 DO <=> DTO <=> VO / BO / Query - * - * @author zcc - */ -@Mapper(componentModel = "spring") -public interface SupplierTransactionConvert { - - /** - * @param source DO - * @return DTO - */ - SupplierTransactionDTO do2dto(SupplierTransaction source); - - /** - * @param source DTO - * @return DO - */ - SupplierTransaction dto2do(SupplierTransactionDTO source); - - List dos2vos(List list); -} diff --git a/wms/src/main/java/com/cyl/wms/convert/WarehouseConvert.java b/wms/src/main/java/com/cyl/wms/convert/WarehouseConvert.java deleted file mode 100644 index 842c398..0000000 --- a/wms/src/main/java/com/cyl/wms/convert/WarehouseConvert.java +++ /dev/null @@ -1,29 +0,0 @@ -package com.cyl.wms.convert; - -import org.mapstruct.Mapper; -import com.cyl.wms.domain.Warehouse; -import com.cyl.wms.pojo.dto.WarehouseDTO; -import com.cyl.wms.pojo.vo.WarehouseVO; -import java.util.List; -/** - * 仓库 DO <=> DTO <=> VO / BO / Query - * - * @author zcc - */ -@Mapper(componentModel = "spring") -public interface WarehouseConvert { - - /** - * @param source DO - * @return DTO - */ - WarehouseDTO do2dto(Warehouse source); - - /** - * @param source DTO - * @return DO - */ - Warehouse dto2do(WarehouseDTO source); - - List dos2vos(List list); -} diff --git a/wms/src/main/java/com/cyl/wms/convert/WaveConvert.java b/wms/src/main/java/com/cyl/wms/convert/WaveConvert.java deleted file mode 100644 index 8a2d718..0000000 --- a/wms/src/main/java/com/cyl/wms/convert/WaveConvert.java +++ /dev/null @@ -1,29 +0,0 @@ -package com.cyl.wms.convert; - -import org.mapstruct.Mapper; -import com.cyl.wms.domain.Wave; -import com.cyl.wms.pojo.dto.WaveDTO; -import com.cyl.wms.pojo.vo.WaveVO; -import java.util.List; -/** - * 波次 DO <=> DTO <=> VO / BO / Query - * - * @author zhangcheng - */ -@Mapper(componentModel = "spring") -public interface WaveConvert { - - /** - * @param source DO - * @return DTO - */ - WaveDTO do2dto(Wave source); - - /** - * @param source DTO - * @return DO - */ - Wave dto2do(WaveDTO source); - - List dos2vos(List list); -} diff --git a/wms/src/main/java/com/cyl/wms/domain/Area.java b/wms/src/main/java/com/cyl/wms/domain/Area.java deleted file mode 100644 index fd41d1c..0000000 --- a/wms/src/main/java/com/cyl/wms/domain/Area.java +++ /dev/null @@ -1,42 +0,0 @@ -package com.cyl.wms.domain; - -import com.ruoyi.common.annotation.Excel; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import com.ruoyi.common.core.domain.BaseAudit; -import lombok.Data; -import com.baomidou.mybatisplus.annotation.TableName; -/** - * 货区对象 wms_area - * - * @author zcc - */ -@ApiModel(description="货区对象") -@Data -@TableName("wms_area") -public class Area extends BaseAudit { - private static final long serialVersionUID = 1L; - - @ApiModelProperty("ID") - private Long id; - - @ApiModelProperty("货区编号") - @Excel(name = "货区编号") - private String areaNo; - - @ApiModelProperty("货区名称") - @Excel(name = "货区名称") - private String areaName; - - @ApiModelProperty("所属仓库ID") - @Excel(name = "所属仓库ID") - private Long warehouseId; - - @ApiModelProperty("备注") - @Excel(name = "备注") - private String remark; - - @ApiModelProperty("删除标识") - private Integer delFlag; - -} diff --git a/wms/src/main/java/com/cyl/wms/domain/Carrier.java b/wms/src/main/java/com/cyl/wms/domain/Carrier.java deleted file mode 100644 index d6dfbe1..0000000 --- a/wms/src/main/java/com/cyl/wms/domain/Carrier.java +++ /dev/null @@ -1,62 +0,0 @@ -package com.cyl.wms.domain; - -import com.ruoyi.common.annotation.Excel; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import com.ruoyi.common.core.domain.BaseAudit; -import lombok.Data; -import com.baomidou.mybatisplus.annotation.TableName; -/** - * 承运商对象 wms_carrier - * - * @author zcc - */ -@ApiModel(description="承运商对象") -@Data -@TableName("wms_carrier") -public class Carrier extends BaseAudit { - private static final long serialVersionUID = 1L; - - @ApiModelProperty("ID") - private Long id; - - @ApiModelProperty("承运商编号") - @Excel(name = "承运商编号") - private String carrierNo; - - @ApiModelProperty("承运商名称") - @Excel(name = "承运商名称") - private String carrierName; - - @ApiModelProperty("承运商地址") - @Excel(name = "承运商地址") - private String address; - - @ApiModelProperty("手机号") - @Excel(name = "手机号") - private String mobile; - - @ApiModelProperty("座机号") - @Excel(name = "座机号") - private String tel; - - @ApiModelProperty("联系人") - @Excel(name = "联系人") - private String contact; - - @ApiModelProperty("级别") - @Excel(name = "级别") - private String level; - - @ApiModelProperty("Email") - @Excel(name = "Email") - private String email; - - @ApiModelProperty("备注") - @Excel(name = "备注") - private String remark; - - @ApiModelProperty("删除标识") - private Integer delFlag; - -} diff --git a/wms/src/main/java/com/cyl/wms/domain/Customer.java b/wms/src/main/java/com/cyl/wms/domain/Customer.java deleted file mode 100644 index 52d7f0b..0000000 --- a/wms/src/main/java/com/cyl/wms/domain/Customer.java +++ /dev/null @@ -1,77 +0,0 @@ -package com.cyl.wms.domain; - -import com.ruoyi.common.annotation.Excel; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import com.ruoyi.common.core.domain.BaseAudit; -import lombok.Data; -import com.baomidou.mybatisplus.annotation.TableName; - -import java.math.BigDecimal; - -/** - * 客户对象 wms_customer - * - * @author zcc - */ -@ApiModel(description="客户对象") -@Data -@TableName("wms_customer") -public class Customer extends BaseAudit { - private static final long serialVersionUID = 1L; - - @ApiModelProperty("ID") - private Long id; - - @ApiModelProperty("客户编号") - @Excel(name = "客户编号") - private String customerNo; - - @ApiModelProperty("客户名称") - @Excel(name = "客户名称") - private String customerName; - - @ApiModelProperty("开户行") - @Excel(name = "开户行") - private String bankName; - - @ApiModelProperty("银行卡号") - @Excel(name = "银行卡号") - private String bankAccount; - - @ApiModelProperty("应付款") - @Excel(name = "应付款") - private BigDecimal receivableAmount; - - @ApiModelProperty("客户地址") - @Excel(name = "客户地址") - private String address; - - @ApiModelProperty("手机号") - @Excel(name = "手机号") - private String mobile; - - @ApiModelProperty("座机号") - @Excel(name = "座机号") - private String tel; - - @ApiModelProperty("联系人") - @Excel(name = "联系人") - private String customerPerson; - - @ApiModelProperty("级别") - @Excel(name = "级别") - private String customerLevel; - - @ApiModelProperty("Email") - @Excel(name = "Email") - private String email; - - @ApiModelProperty("备注") - @Excel(name = "备注") - private String remark; - - @ApiModelProperty("删除标识") - private Integer delFlag; - -} diff --git a/wms/src/main/java/com/cyl/wms/domain/CustomerTransaction.java b/wms/src/main/java/com/cyl/wms/domain/CustomerTransaction.java deleted file mode 100644 index 82f24fa..0000000 --- a/wms/src/main/java/com/cyl/wms/domain/CustomerTransaction.java +++ /dev/null @@ -1,71 +0,0 @@ -package com.cyl.wms.domain; - -import java.math.BigDecimal; -import java.time.LocalDateTime; - -import com.fasterxml.jackson.annotation.JsonFormat; -import com.ruoyi.common.annotation.Excel; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; -import com.baomidou.mybatisplus.annotation.TableName; -/** - * 客户账户流水对象 wms_customer_transaction - * - * @author zcc - */ -@ApiModel(description="客户账户流水对象") -@Data -@TableName("wms_customer_transaction") -public class CustomerTransaction { - public static String ENTER = "11"; - public static String EXIT = "22"; - public static String SHIPMENT = "33"; - private static final long serialVersionUID = 1L; - - @ApiModelProperty("id") - private Integer id; - - @ApiModelProperty("交易编号") - @Excel(name = "交易编号") - private String transactionCode; - - @ApiModelProperty("用户编号") - @Excel(name = "用户编号") - private String customerId; - - @ApiModelProperty("交易类型 1:结款 2:应付 ") - @Excel(name = "交易类型 1:结款 2:应付 ") - private String transactionType; - - @ApiModelProperty("交易金额") - @Excel(name = "交易金额") - private BigDecimal transactionAmount; - - @ApiModelProperty("上期余额") - @Excel(name = "上期余额") - private BigDecimal previousBalance; - - @ApiModelProperty("当前余额") - @Excel(name = "当前余额") - private BigDecimal currentBalance; - - @ApiModelProperty("出库单号") - @Excel(name = "出库单号") - private int shipmentOrderId; - - @ApiModelProperty("备注") - @Excel(name = "备注") - private String remark; - - @ApiModelProperty("删除标志") - private Integer delFlag; - - @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") - @ApiModelProperty("创建时间") - private LocalDateTime createTime; - - @ApiModelProperty("更新时间") - private LocalDateTime updateTime; - -} diff --git a/wms/src/main/java/com/cyl/wms/domain/Delivery.java b/wms/src/main/java/com/cyl/wms/domain/Delivery.java deleted file mode 100644 index 23c22de..0000000 --- a/wms/src/main/java/com/cyl/wms/domain/Delivery.java +++ /dev/null @@ -1,47 +0,0 @@ -package com.cyl.wms.domain; - -import java.time.LocalDateTime; -import com.ruoyi.common.annotation.Excel; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import com.ruoyi.common.core.domain.BaseAudit; -import lombok.Data; -import com.baomidou.mybatisplus.annotation.TableName; -/** - * 发货记录对象 wms_delivery - * - * @author zcc - */ -@ApiModel(description="发货记录对象") -@Data -@TableName("wms_delivery") -public class Delivery extends BaseAudit { - private static final long serialVersionUID = 1L; - - @ApiModelProperty("ID") - private Long id; - - @ApiModelProperty("出库单主表Id") - @Excel(name = "出库单主表Id") - private Long shipmentOrderId; - - @ApiModelProperty("承运商Id") - @Excel(name = "承运商Id") - private Long carrierId; - - @ApiModelProperty("发货日期") - @Excel(name = "发货日期", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss") - private LocalDateTime deliveryDate; - - @ApiModelProperty("快递单号") - @Excel(name = "快递单号") - private String trackingNo; - - @ApiModelProperty("备注") - @Excel(name = "备注") - private String remark; - - @ApiModelProperty("删除标识") - private Integer delFlag; - -} diff --git a/wms/src/main/java/com/cyl/wms/domain/Inventory.java b/wms/src/main/java/com/cyl/wms/domain/Inventory.java deleted file mode 100644 index 421f43c..0000000 --- a/wms/src/main/java/com/cyl/wms/domain/Inventory.java +++ /dev/null @@ -1,87 +0,0 @@ -package com.cyl.wms.domain; - -import com.baomidou.mybatisplus.annotation.TableField; -import com.baomidou.mybatisplus.annotation.TableName; -import com.cyl.wms.pojo.vo.PlaceAndItem; -import com.fasterxml.jackson.annotation.JsonFormat; -import com.ruoyi.common.annotation.Excel; -import com.ruoyi.common.core.domain.BaseAudit; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; -import org.springframework.format.annotation.DateTimeFormat; - -import java.math.BigDecimal; -import java.time.LocalDateTime; - -/** - * 库存对象 wms_inventory - * - * @author zcc - */ -@ApiModel(description = "库存对象") -@Data -@TableName("wms_inventory") -public class Inventory extends BaseAudit implements PlaceAndItem { - private static final long serialVersionUID = 1L; - - @ApiModelProperty("ID") - private Long id; - - @ApiModelProperty("物料ID") - @Excel(name = "物料ID") - private Long itemId; - - @ApiModelProperty("所属仓库") - @Excel(name = "所属仓库") - private Long warehouseId; - - @ApiModelProperty("所属库区") - @Excel(name = "所属库区") - private Long areaId; - - @ApiModelProperty("货架id") - @Excel(name = "货架id") - private Long rackId; - - @ApiModelProperty("库存") - @Excel(name = "库存") - private BigDecimal quantity; - - @ApiModelProperty("备注") - @Excel(name = "备注") - private String remark; - - @ApiModelProperty("删除标识") - private Integer delFlag; - - @ApiModelProperty("生产日期") - @Excel(name = "生产日期", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss") - @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") - @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") - private LocalDateTime productionDate; - - @ApiModelProperty("有效期") - @Excel(name = "有效期", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss") - @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") - @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") - private LocalDateTime expiryDate; - - @ApiModelProperty("批次") - private String batch; - - @TableField(exist = false) - private String itemNo; - - @TableField(exist = false) - private String itemName; - - @TableField(exist = false) - private String warehouseName; - - @TableField(exist = false) - private String areaName; - - - -} diff --git a/wms/src/main/java/com/cyl/wms/domain/InventoryCheck.java b/wms/src/main/java/com/cyl/wms/domain/InventoryCheck.java deleted file mode 100644 index 1f60937..0000000 --- a/wms/src/main/java/com/cyl/wms/domain/InventoryCheck.java +++ /dev/null @@ -1,85 +0,0 @@ -package com.cyl.wms.domain; - -import java.math.BigDecimal; -import java.time.LocalDateTime; -import java.util.List; - -import com.baomidou.mybatisplus.annotation.TableField; -import com.ruoyi.common.annotation.Excel; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import com.ruoyi.common.core.domain.BaseAudit; -import lombok.Data; -import com.baomidou.mybatisplus.annotation.TableName; -/** - * 库存盘点单据对象 wms_inventory_check - * - * @author zcc - */ -@ApiModel(description="库存盘点单据对象") -@Data -@TableName("wms_inventory_check") -public class InventoryCheck extends BaseAudit { - private static final long serialVersionUID = 1L; - - public static String CREATED = "11"; - public static String FINISH = "22"; - - @ApiModelProperty("ID") - private Long id; - - @ApiModelProperty("库存盘点单号,系统自动生成") - @Excel(name = "库存盘点单号,系统自动生成") - private String inventoryCheckNo; - - @ApiModelProperty("库存盘点类型") - @Excel(name = "库存盘点类型") - private Integer inventoryCheckType; - - @ApiModelProperty("库存盘点单状态11:盘点中 22:已完成") - @Excel(name = "库存盘点单状态11:盘点中 22:已完成") - private Integer inventoryCheckStatus; - - @ApiModelProperty("盈亏数") - @Excel(name = "盈亏数") - private BigDecimal inventoryCheckTotal; - - @ApiModelProperty("审核状态") - @Excel(name = "审核状态") - private Integer checkStatus; - - @ApiModelProperty("审核人") - @Excel(name = "审核人") - private Long checkUserId; - - @ApiModelProperty("审核时间") - @Excel(name = "审核时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss") - private LocalDateTime checkTime; - - @ApiModelProperty("所属仓库") - @Excel(name = "所属仓库") - private Long warehouseId; - - @ApiModelProperty("所属库区") - @Excel(name = "所属库区") - private Long areaId; - - @ApiModelProperty("货架") - @Excel(name = "货架") - private Long rackId; - - @ApiModelProperty("附件文件") - @Excel(name = "附件文件") - private String attachment; - - @ApiModelProperty("备注") - @Excel(name = "备注") - private String remark; - - @ApiModelProperty("删除标识") - private Integer delFlag; - - @TableField(exist = false) - private List place; - -} diff --git a/wms/src/main/java/com/cyl/wms/domain/InventoryCheckDetail.java b/wms/src/main/java/com/cyl/wms/domain/InventoryCheckDetail.java deleted file mode 100644 index 70b735f..0000000 --- a/wms/src/main/java/com/cyl/wms/domain/InventoryCheckDetail.java +++ /dev/null @@ -1,59 +0,0 @@ -package com.cyl.wms.domain; - -import java.math.BigDecimal; -import com.ruoyi.common.annotation.Excel; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import com.ruoyi.common.core.domain.BaseAudit; -import lombok.Data; -import com.baomidou.mybatisplus.annotation.TableName; -/** - * 库存盘点单据详情对象 wms_inventory_check_detail - * - * @author zcc - */ -@ApiModel(description="库存盘点单据详情对象") -@Data -@TableName("wms_inventory_check_detail") -public class InventoryCheckDetail extends BaseAudit { - private static final long serialVersionUID = 1L; - - @ApiModelProperty("ID") - private Long id; - - @ApiModelProperty("库存盘点单") - @Excel(name = "库存盘点单") - private Long inventoryCheckId; - - @ApiModelProperty("物料") - @Excel(name = "物料") - private Long itemId; - - @ApiModelProperty("库存数量") - @Excel(name = "库存数量") - private BigDecimal quantity; - - @ApiModelProperty("盘点数量") - @Excel(name = "盘点数量") - private BigDecimal checkQuantity; - - @ApiModelProperty("所属仓库") - @Excel(name = "所属仓库") - private Long warehouseId; - - @ApiModelProperty("所属库区") - @Excel(name = "所属库区") - private Long areaId; - - @ApiModelProperty("货架") - @Excel(name = "货架") - private Long rackId; - - @ApiModelProperty("删除标识") - private Integer delFlag; - - @ApiModelProperty("备注") - @Excel(name = "备注") - private String remark; - -} diff --git a/wms/src/main/java/com/cyl/wms/domain/InventoryHistory.java b/wms/src/main/java/com/cyl/wms/domain/InventoryHistory.java deleted file mode 100644 index b0b3529..0000000 --- a/wms/src/main/java/com/cyl/wms/domain/InventoryHistory.java +++ /dev/null @@ -1,80 +0,0 @@ -package com.cyl.wms.domain; - -import java.math.BigDecimal; -import java.time.LocalDateTime; - -import com.cyl.wms.pojo.vo.PlaceAndItem; -import com.fasterxml.jackson.annotation.JsonFormat; -import com.ruoyi.common.annotation.Excel; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import com.ruoyi.common.core.domain.BaseAudit; -import lombok.Data; -import com.baomidou.mybatisplus.annotation.TableName; -import org.springframework.format.annotation.DateTimeFormat; - -/** - * 库存记录对象 wms_inventory_history - * - * @author zcc - */ -@ApiModel(description="库存记录对象") -@Data -@TableName("wms_inventory_history") -public class InventoryHistory extends BaseAudit implements PlaceAndItem { - private static final long serialVersionUID = 1L; - - @ApiModelProperty("ID") - private Long id; - - @ApiModelProperty("操作id(出库、入库、库存移动表单id)") - @Excel(name = "操作id", readConverterExp = "出库、入库、库存移动表单id") - private Long formId; - - @ApiModelProperty("操作类型") - @Excel(name = "操作类型") - private Integer formType; - - @ApiModelProperty("物料ID") - @Excel(name = "物料ID") - private Long itemId; - - @ApiModelProperty("所属仓库") - @Excel(name = "所属仓库") - private Long warehouseId; - - @ApiModelProperty("所属库区") - @Excel(name = "所属库区") - private Long areaId; - - @ApiModelProperty("货架id") - @Excel(name = "货架id") - private Long rackId; - - @ApiModelProperty("库存变化") - @Excel(name = "库存变化") - private BigDecimal quantity; - - @ApiModelProperty("备注") - @Excel(name = "备注") - private String remark; - - @ApiModelProperty("删除标识") - private Integer delFlag; - - @ApiModelProperty("生产日期") - @Excel(name = "生产日期", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss") - @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") - @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") - private LocalDateTime productionDate; - - @ApiModelProperty("有效期") - @Excel(name = "有效期", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss") - @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") - @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") - private LocalDateTime expiryDate; - - @ApiModelProperty("批次") - private String batch; - -} diff --git a/wms/src/main/java/com/cyl/wms/domain/InventoryMovement.java b/wms/src/main/java/com/cyl/wms/domain/InventoryMovement.java deleted file mode 100644 index bf4390d..0000000 --- a/wms/src/main/java/com/cyl/wms/domain/InventoryMovement.java +++ /dev/null @@ -1,59 +0,0 @@ -package com.cyl.wms.domain; - -import java.time.LocalDateTime; -import com.ruoyi.common.annotation.Excel; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import com.ruoyi.common.core.domain.BaseAudit; -import lombok.Data; -import com.baomidou.mybatisplus.annotation.TableName; -/** - * 库存移动对象 wms_inventory_movement - * - * @author zcc - */ -@ApiModel(description="库存移动对象") -@Data -@TableName("wms_inventory_movement") -public class InventoryMovement extends BaseAudit { - private static final long serialVersionUID = 1L; - - @ApiModelProperty("ID") - private Long id; - - @ApiModelProperty("库存移动编号") - @Excel(name = "库存移动编号") - private String inventoryMovementNo; - - @ApiModelProperty("原货架Id") - @Excel(name = "原货架Id") - private Long sourceRackId; - - @ApiModelProperty("目标货架") - @Excel(name = "目标货架") - private Long targetRackId; - - @ApiModelProperty("状态") - @Excel(name = "状态") - private Integer status; - - @ApiModelProperty("审核状态") - @Excel(name = "审核状态") - private Integer checkStatus; - - @ApiModelProperty("审核人") - @Excel(name = "审核人") - private Long checkUserId; - - @ApiModelProperty("审核时间") - @Excel(name = "审核时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss") - private LocalDateTime checkTime; - - @ApiModelProperty("备注") - @Excel(name = "备注") - private String remark; - - @ApiModelProperty("删除标识") - private Integer delFlag; - -} diff --git a/wms/src/main/java/com/cyl/wms/domain/InventoryMovementDetail.java b/wms/src/main/java/com/cyl/wms/domain/InventoryMovementDetail.java deleted file mode 100644 index 13adc40..0000000 --- a/wms/src/main/java/com/cyl/wms/domain/InventoryMovementDetail.java +++ /dev/null @@ -1,75 +0,0 @@ -package com.cyl.wms.domain; - -import java.math.BigDecimal; -import com.ruoyi.common.annotation.Excel; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import com.ruoyi.common.core.domain.BaseAudit; -import lombok.Data; -import com.baomidou.mybatisplus.annotation.TableName; -/** - * 库存移动详情对象 wms_inventory_movement_detail - * - * @author zcc - */ -@ApiModel(description="库存移动详情对象") -@Data -@TableName("wms_inventory_movement_detail") -public class InventoryMovementDetail extends BaseAudit { - private static final long serialVersionUID = 1L; - - @ApiModelProperty("ID") - private Long id; - - @ApiModelProperty("库存移动Id") - @Excel(name = "库存移动Id") - private Long inventoryMovementId; - - @ApiModelProperty("物料") - @Excel(name = "物料") - private Long itemId; - - @ApiModelProperty("计划数量") - @Excel(name = "计划数量") - private BigDecimal planQuantity; - - @ApiModelProperty("实际数量") - @Excel(name = "实际数量") - private BigDecimal realQuantity; - - @ApiModelProperty("删除标识") - private Integer delFlag; - - @ApiModelProperty("备注") - @Excel(name = "备注") - private String remark; - - @ApiModelProperty("源货架") - @Excel(name = "源货架") - private Long sourceRackId; - - @ApiModelProperty("源仓库") - @Excel(name = "源仓库") - private Long sourceWarehouseId; - - @ApiModelProperty("源库区") - @Excel(name = "源库区") - private Long sourceAreaId; - - @ApiModelProperty("移库状态") - @Excel(name = "移库状态") - private Integer moveStatus; - - @ApiModelProperty("目标货架") - @Excel(name = "目标货架") - private Long targetRackId; - - @ApiModelProperty("目标仓库") - @Excel(name = "目标仓库") - private Long targetWarehouseId; - - @ApiModelProperty("目标库区") - @Excel(name = "目标库区") - private Long targetAreaId; - -} diff --git a/wms/src/main/java/com/cyl/wms/domain/InventorySettlement.java b/wms/src/main/java/com/cyl/wms/domain/InventorySettlement.java deleted file mode 100644 index f7cb9ae..0000000 --- a/wms/src/main/java/com/cyl/wms/domain/InventorySettlement.java +++ /dev/null @@ -1,58 +0,0 @@ -package com.cyl.wms.domain; - -import com.baomidou.mybatisplus.annotation.TableName; -import com.fasterxml.jackson.annotation.JsonFormat; -import com.ruoyi.common.annotation.Excel; -import com.ruoyi.common.core.domain.BaseAudit; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; - -import java.time.LocalDateTime; - -/** - * 库存结算单对象 wms_inventory_settlement - * - * @author zcc - */ -@ApiModel(description="库存结算单对象") -@Data -@TableName("wms_inventory_settlement") -public class InventorySettlement extends BaseAudit { - private static final long serialVersionUID = 1L; - - @ApiModelProperty("ID") - private Long id; - - @ApiModelProperty("库存结算单状态11:结算中 22:已完成") - @Excel(name = "库存结算单状态11:结算中 22:已完成") - private Integer inventorySettlementStatus; - - @ApiModelProperty("结算类型,1:月结,2:年结") - @Excel(name = "结算类型,1:月结,2:年结") - private Integer settlementType; - - /** - * 开始时间 - */ - @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") - private LocalDateTime inventorySettlementStartTime; - - /** - * 结束时间 - */ - @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") - private LocalDateTime inventorySettlementEndTime; - - @ApiModelProperty("删除标识") - private Integer delFlag; - - @ApiModelProperty("备注") - @Excel(name = "备注") - private String remark; - - @ApiModelProperty("库存结算单号") - @Excel(name = "库存结算单号") - private String inventorySettlementNo; - -} diff --git a/wms/src/main/java/com/cyl/wms/domain/InventorySettlementDetail.java b/wms/src/main/java/com/cyl/wms/domain/InventorySettlementDetail.java deleted file mode 100644 index 3cd4239..0000000 --- a/wms/src/main/java/com/cyl/wms/domain/InventorySettlementDetail.java +++ /dev/null @@ -1,96 +0,0 @@ -package com.cyl.wms.domain; - -import com.baomidou.mybatisplus.annotation.TableName; -import com.ruoyi.common.annotation.Excel; -import com.ruoyi.common.core.domain.BaseAudit; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; - -import java.math.BigDecimal; -/** - * 库存结算明细对象 wms_inventory_settlement_detail - * - * @author zcc - */ -@ApiModel(description="库存结算明细对象") -@Data -@TableName("wms_inventory_settlement_detail") -public class InventorySettlementDetail extends BaseAudit { - private static final long serialVersionUID = 1L; - - @ApiModelProperty("ID") - private Long id; - - @ApiModelProperty("结算单id") - @Excel(name = "结算单id") - private Long settlementId; - - @ApiModelProperty("结算类型,1:月结,2:年结") - @Excel(name = "结算类型,1:月结,2:年结") - private Integer settlementType; - - @ApiModelProperty("物料id") - @Excel(name = "物料id") - private Long itemId; - - @ApiModelProperty("编号") - @Excel(name = "编号") - private String itemNo; - - @ApiModelProperty("名称") - @Excel(name = "名称") - private String itemName; - - @ApiModelProperty("仓库id") - @Excel(name = "仓库id") - private Long warehouseId; - - @ApiModelProperty("仓库编号") - @Excel(name = "仓库编号") - private String warehouseNo; - - @ApiModelProperty("仓库名称") - @Excel(name = "仓库名称") - private String warehouseName; - - @ApiModelProperty("库区id") - @Excel(name = "库区id") - private Long areaId; - - @ApiModelProperty("库区编号") - @Excel(name = "库区编号") - private String areaNo; - - @ApiModelProperty("库区名称") - @Excel(name = "库区名称") - private String areaName; - - @ApiModelProperty("上期结存") - @Excel(name = "上期结存") - private BigDecimal previousBalance; - - @ApiModelProperty("本期入库") - @Excel(name = "本期入库") - private BigDecimal currentEnter; - - @ApiModelProperty("本期出库") - @Excel(name = "本期出库") - private BigDecimal currentOut; - - @ApiModelProperty("本期盘点") - @Excel(name = "本期盘点") - private BigDecimal currentCheck; - - @ApiModelProperty("本期结存") - @Excel(name = "本期结存") - private BigDecimal currentBalance; - - @ApiModelProperty("删除标识") - private Integer delFlag; - - @ApiModelProperty("备注") - @Excel(name = "备注") - private String remark; - -} diff --git a/wms/src/main/java/com/cyl/wms/domain/Item.java b/wms/src/main/java/com/cyl/wms/domain/Item.java deleted file mode 100644 index ec09ef4..0000000 --- a/wms/src/main/java/com/cyl/wms/domain/Item.java +++ /dev/null @@ -1,102 +0,0 @@ -package com.cyl.wms.domain; - -import com.baomidou.mybatisplus.annotation.TableField; -import com.baomidou.mybatisplus.annotation.TableName; -import com.fasterxml.jackson.annotation.JsonFormat; -import com.ruoyi.common.annotation.Excel; -import com.ruoyi.common.core.domain.BaseAudit; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; -import org.springframework.format.annotation.DateTimeFormat; - -import java.math.BigDecimal; -import java.time.LocalDateTime; - -/** - * 物料对象 wms_item - * - * @author zcc - */ -@ApiModel(description = "物料对象") -@Data -@TableName("wms_item") -public class Item extends BaseAudit { - private static final long serialVersionUID = 1L; - - @ApiModelProperty("ID") - private Long id; - - @ApiModelProperty("编号") - @Excel(name = "编号") - private String itemNo; - - @ApiModelProperty("名称") - @Excel(name = "名称") - private String itemName; - - @ApiModelProperty("规格") - @Excel(name = "规格") - private String specification; - - @ApiModelProperty("分类") - @Excel(name = "分类") - private String itemType; - - @ApiModelProperty("单位类别") - @Excel(name = "单位类别") - private String unit; - - @ApiModelProperty("单价") - @Excel(name = "单价") - private String unitPrice; - - @ApiModelProperty("所属货架") - @Excel(name = "所属货架") - private Long rackId; - - @ApiModelProperty("所属库区") - @Excel(name = "所属库区") - private Long areaId; - - @ApiModelProperty("所属仓库") - @Excel(name = "所属仓库") - private Long warehouseId; - - @ApiModelProperty("安全库存") - @Excel(name = "安全库存") - private BigDecimal quantity; - - @ApiModelProperty("有效期") - @Excel(name = "有效期", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss") - @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") - @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") - private LocalDateTime expiryDate; - - @ApiModelProperty("生产日期") - @Excel(name = "生产日期", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss") - @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") - @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") - private LocalDateTime productionDate; - - @ApiModelProperty("批次") - @Excel(name = "批次") - private String batch; - - @ApiModelProperty("删除标识") - private Integer delFlag; - - @ApiModelProperty("备注") - @Excel(name = "备注") - private String remark; - - - @TableField(exist = false) - private String itemTypeName; - - @TableField(exist = false) - private String warehouseName; - - @TableField(exist = false) - private String areaName; -} diff --git a/wms/src/main/java/com/cyl/wms/domain/ItemType.java b/wms/src/main/java/com/cyl/wms/domain/ItemType.java deleted file mode 100644 index 2be66ee..0000000 --- a/wms/src/main/java/com/cyl/wms/domain/ItemType.java +++ /dev/null @@ -1,157 +0,0 @@ -package com.cyl.wms.domain; - -import com.baomidou.mybatisplus.annotation.IdType; -import com.baomidou.mybatisplus.annotation.TableField; -import com.baomidou.mybatisplus.annotation.TableId; -import com.baomidou.mybatisplus.annotation.TableName; -import com.ruoyi.common.annotation.Excel; -import com.ruoyi.common.core.domain.BaseAudit; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import org.apache.commons.lang3.builder.ToStringBuilder; -import org.apache.commons.lang3.builder.ToStringStyle; - -import javax.validation.constraints.NotBlank; -import java.util.ArrayList; -import java.util.List; - -/** - * 物料类型表对象 wms_item_type - * - * @author zhangcheng - */ -@ApiModel(description = "物料类型表对象") -@TableName("wms_item_type") -public class ItemType extends BaseAudit { - - @ApiModelProperty("物料类型id") - @TableId(value = "item_type_id", type = IdType.AUTO) - private Long itemTypeId; - - public Long getItemTypeId() { - return itemTypeId; - } - - public void setItemTypeId(Long itemTypeId) { - this.itemTypeId = itemTypeId; - } - - public String getTypeName() { - return typeName; - } - - public void setTypeName(String typeName) { - this.typeName = typeName; - } - - public void setChildren(List children) { - this.children = children; - } - - @ApiModelProperty("父物料类型id") - @Excel(name = "父物料类型id") - private Long parentId; - - @ApiModelProperty("祖级列表") - @Excel(name = "祖级列表") - private String ancestors; - - @ApiModelProperty("物料类型名称") - @Excel(name = "物料类型名称") - private String typeName; - - @ApiModelProperty("显示顺序") - @Excel(name = "显示顺序") - private String orderNum; - - @ApiModelProperty("物料类型状态(0正常 1停用)") - @Excel(name = "物料类型状态", readConverterExp = "0=正常,1=停用") - private String status; - - @ApiModelProperty("删除标志(0代表存在 2代表删除)") - private String delFlag; - - /** - * 父部门名称 - */ - @TableField(exist = false) - private String parentName = "11"; - /** - * 子部门 - */ - @TableField(exist = false) - private List children = new ArrayList(); - - public List getChildren() { - return children; - } - - public Long getParentId() { - return parentId; - } - - public void setParentId(Long parentId) { - this.parentId = parentId; - } - - public String getAncestors() { - return ancestors; - } - - public void setAncestors(String ancestors) { - this.ancestors = ancestors; - } - - - @NotBlank(message = "显示顺序不能为空") - public String getOrderNum() { - return orderNum; - } - - public void setOrderNum(String orderNum) { - this.orderNum = orderNum; - } - - - public String getStatus() { - return status; - } - - public void setStatus(String status) { - this.status = status; - } - - public String getDelFlag() { - return delFlag; - } - - public void setDelFlag(String delFlag) { - this.delFlag = delFlag; - } - - public String getParentName() { - return parentName; - } - - public void setParentName(String parentName) { - this.parentName = parentName; - } - - - @Override - public String toString() { - return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE) - .append("itemTypeId", getItemTypeId()) - .append("parentId", getParentId()) - .append("ancestors", getAncestors()) - .append("typeName", getTypeName()) - .append("orderNum", getOrderNum()) - .append("status", getStatus()) - .append("delFlag", getDelFlag()) - .append("createBy", getCreateBy()) - .append("createTime", getCreateTime()) - .append("updateBy", getUpdateBy()) - .append("updateTime", getUpdateTime()) - .toString(); - } -} diff --git a/wms/src/main/java/com/cyl/wms/domain/ItemTypeTreeSelect.java b/wms/src/main/java/com/cyl/wms/domain/ItemTypeTreeSelect.java deleted file mode 100644 index 74577d7..0000000 --- a/wms/src/main/java/com/cyl/wms/domain/ItemTypeTreeSelect.java +++ /dev/null @@ -1,72 +0,0 @@ -package com.cyl.wms.domain; - -import com.fasterxml.jackson.annotation.JsonInclude; - -import java.io.Serializable; -import java.util.List; -import java.util.stream.Collectors; - -/** - * Treeselect树结构实体类 - * - * @author zhangcheng - */ -public class ItemTypeTreeSelect implements Serializable { - - - private static final long serialVersionUID = 1L; - - /** - * 节点ID - */ - private Long id; - - /** - * 节点名称 - */ - private String label; - - /** - * 子节点 - */ - @JsonInclude(JsonInclude.Include.NON_EMPTY) - private List children; - - public ItemTypeTreeSelect() { - - } - - - public ItemTypeTreeSelect(ItemType itemType) { - this.id = itemType.getItemTypeId(); - this.label = itemType.getTypeName(); - this.children = itemType.getChildren().stream().map(ItemTypeTreeSelect::new).collect(Collectors.toList()); - } - - - public Long getId() { - return id; - } - - public void setId(Long id) { - this.id = id; - } - - public String getLabel() { - return label; - } - - public void setLabel(String label) { - this.label = label; - } - - public List getChildren() { - return children; - } - - public void setChildren(List children) { - this.children = children; - } - - -} diff --git a/wms/src/main/java/com/cyl/wms/domain/Rack.java b/wms/src/main/java/com/cyl/wms/domain/Rack.java deleted file mode 100644 index 6b91fe1..0000000 --- a/wms/src/main/java/com/cyl/wms/domain/Rack.java +++ /dev/null @@ -1,46 +0,0 @@ -package com.cyl.wms.domain; - -import com.ruoyi.common.annotation.Excel; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import com.ruoyi.common.core.domain.BaseAudit; -import lombok.Data; -import com.baomidou.mybatisplus.annotation.TableName; -/** - * 货架对象 wms_rack - * - * @author zcc - */ -@ApiModel(description="货架对象") -@Data -@TableName("wms_rack") -public class Rack extends BaseAudit { - private static final long serialVersionUID = 1L; - - @ApiModelProperty("ID") - private Long id; - - @ApiModelProperty("货架编号") - @Excel(name = "货架编号") - private String rackNo; - - @ApiModelProperty("货架名称") - @Excel(name = "货架名称") - private String rackName; - - @ApiModelProperty("所属货区") - @Excel(name = "所属货区") - private Long areaId; - - @ApiModelProperty("所属仓库") - @Excel(name = "所属仓库") - private Long warehouseId; - - @ApiModelProperty("备注") - @Excel(name = "备注") - private String remark; - - @ApiModelProperty("删除标识") - private Integer delFlag; - -} diff --git a/wms/src/main/java/com/cyl/wms/domain/ReceiptOrder.java b/wms/src/main/java/com/cyl/wms/domain/ReceiptOrder.java deleted file mode 100644 index 8e905be..0000000 --- a/wms/src/main/java/com/cyl/wms/domain/ReceiptOrder.java +++ /dev/null @@ -1,57 +0,0 @@ -package com.cyl.wms.domain; - -import com.ruoyi.common.annotation.Excel; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import com.ruoyi.common.core.domain.BaseAudit; -import lombok.Data; -import com.baomidou.mybatisplus.annotation.TableName; - -import java.math.BigDecimal; - -/** - * 入库单对象 wms_receipt_order - * - * @author zcc - */ -@ApiModel(description="入库单对象") -@Data -@TableName("wms_receipt_order") -public class ReceiptOrder extends BaseAudit { - private static final long serialVersionUID = 1L; - - @ApiModelProperty("ID") - private Long id; - - @ApiModelProperty("入库单号") - @Excel(name = "入库单号") - private String receiptOrderNo; - - @ApiModelProperty("入库类型") - @Excel(name = "入库类型") - private Integer receiptOrderType; - - @ApiModelProperty("供应商") - @Excel(name = "供应商") - private Long supplierId; - - @ApiModelProperty("订单号") - @Excel(name = "订单号") - private String orderNo; - - @ApiModelProperty("应付款合计") - @Excel(name = "应付款合计") - private BigDecimal payableAmount; - - @ApiModelProperty("入库状态") - @Excel(name = "入库状态") - private Integer receiptOrderStatus; - - @ApiModelProperty("备注") - @Excel(name = "备注") - private String remark; - - @ApiModelProperty("删除标识") - private Integer delFlag; - -} diff --git a/wms/src/main/java/com/cyl/wms/domain/ReceiptOrderDetail.java b/wms/src/main/java/com/cyl/wms/domain/ReceiptOrderDetail.java deleted file mode 100644 index 1adff5d..0000000 --- a/wms/src/main/java/com/cyl/wms/domain/ReceiptOrderDetail.java +++ /dev/null @@ -1,87 +0,0 @@ -package com.cyl.wms.domain; - -import java.math.BigDecimal; -import java.time.LocalDateTime; - -import com.fasterxml.jackson.annotation.JsonFormat; -import com.ruoyi.common.annotation.Excel; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import com.ruoyi.common.core.domain.BaseAudit; -import lombok.Data; -import com.baomidou.mybatisplus.annotation.TableName; -import org.springframework.format.annotation.DateTimeFormat; - -/** - * 入库单详情对象 wms_receipt_order_detail - * - * @author zcc - */ -@ApiModel(description="入库单详情对象") -@Data -@TableName("wms_receipt_order_detail") -public class ReceiptOrderDetail extends BaseAudit { - private static final long serialVersionUID = 1L; - - @ApiModelProperty("ID") - private Long id; - - @ApiModelProperty("入库单号") - @Excel(name = "入库单号") - private Long receiptOrderId; - - @ApiModelProperty("物料") - @Excel(name = "物料") - private Long itemId; - - @ApiModelProperty("计划数量") - @Excel(name = "计划数量") - private BigDecimal planQuantity; - - @ApiModelProperty("实际数量") - @Excel(name = "实际数量") - private BigDecimal realQuantity; - - @ApiModelProperty("所属货架") - @Excel(name = "所属货架") - private Long rackId; - - @ApiModelProperty("金额") - @Excel(name = "金额") - private BigDecimal money; - - @ApiModelProperty("删除标识") - private Integer delFlag; - - @ApiModelProperty("备注") - @Excel(name = "备注") - private String remark; - - @ApiModelProperty("所属仓库") - @Excel(name = "所属仓库") - private Long warehouseId; - - @ApiModelProperty("所属库区") - @Excel(name = "所属库区") - private Long areaId; - - @ApiModelProperty("入库状态") - @Excel(name = "入库状态") - private Integer receiptOrderStatus; - - @ApiModelProperty("生产日期") - @Excel(name = "生产日期", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss") - @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") - @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") - private LocalDateTime productionDate; - - @ApiModelProperty("有效期") - @Excel(name = "有效期", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss") - @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") - @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") - private LocalDateTime expiryDate; - - @ApiModelProperty("批次") - private String batch; - -} diff --git a/wms/src/main/java/com/cyl/wms/domain/ShipmentOrder.java b/wms/src/main/java/com/cyl/wms/domain/ShipmentOrder.java deleted file mode 100644 index 5dfd73a..0000000 --- a/wms/src/main/java/com/cyl/wms/domain/ShipmentOrder.java +++ /dev/null @@ -1,73 +0,0 @@ -package com.cyl.wms.domain; - -import com.baomidou.mybatisplus.annotation.TableName; -import com.ruoyi.common.annotation.Excel; -import com.ruoyi.common.core.domain.BaseAudit; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; - -import java.math.BigDecimal; -import java.time.LocalDateTime; - -/** - * 出库单对象 wms_shipment_order - * - * @author zcc - */ -@ApiModel(description = "出库单对象") -@Data -@TableName("wms_shipment_order") -public class ShipmentOrder extends BaseAudit { - private static final long serialVersionUID = 1L; - - @ApiModelProperty("ID") - private Long id; - - @ApiModelProperty("出库单号") - @Excel(name = "出库单号") - private String shipmentOrderNo; - - @ApiModelProperty("出库类型") - @Excel(name = "出库类型") - private Integer shipmentOrderType; - - @ApiModelProperty("出库订单") - @Excel(name = "出库订单") - private String orderNo; - - @ApiModelProperty("客户") - @Excel(name = "客户") - private Long customerId; - - @ApiModelProperty("应收款合计") - @Excel(name = "应收款合计") - private BigDecimal receivableAmount; - - @ApiModelProperty("出库单状态") - @Excel(name = "出库单状态") - private Integer shipmentOrderStatus; - - @ApiModelProperty("审核状态") - @Excel(name = "审核状态") - private Integer checkStatus; - - @ApiModelProperty("审核人") - @Excel(name = "审核人") - private Long checkUserId; - - @ApiModelProperty("审核时间") - @Excel(name = "审核时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss") - private LocalDateTime checkTime; - - @ApiModelProperty("备注") - @Excel(name = "备注") - private String remark; - - @ApiModelProperty("删除标识") - private Integer delFlag; - - @ApiModelProperty("波次号") - private String waveNo; - -} diff --git a/wms/src/main/java/com/cyl/wms/domain/ShipmentOrderDetail.java b/wms/src/main/java/com/cyl/wms/domain/ShipmentOrderDetail.java deleted file mode 100644 index 5cb7ee4..0000000 --- a/wms/src/main/java/com/cyl/wms/domain/ShipmentOrderDetail.java +++ /dev/null @@ -1,95 +0,0 @@ -package com.cyl.wms.domain; - -import com.baomidou.mybatisplus.annotation.TableField; -import com.baomidou.mybatisplus.annotation.TableName; -import com.fasterxml.jackson.annotation.JsonFormat; -import com.ruoyi.common.annotation.Excel; -import com.ruoyi.common.core.domain.BaseAudit; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; -import org.springframework.format.annotation.DateTimeFormat; - -import java.math.BigDecimal; -import java.time.LocalDateTime; - -/** - * 出库单详情对象 wms_shipment_order_detail - * - * @author zcc - */ -@ApiModel(description = "出库单详情对象") -@Data -@TableName("wms_shipment_order_detail") -public class ShipmentOrderDetail extends BaseAudit { - private static final long serialVersionUID = 1L; - - @ApiModelProperty("ID") - private Long id; - /** - * 订单号 - */ - @Excel(name = "订单号") - @TableField(exist = false) - private String orderNo; - - @ApiModelProperty("出库单") - @Excel(name = "出库单") - private Long shipmentOrderId; - - @ApiModelProperty("物料") - @Excel(name = "物料") - private Long itemId; - - @ApiModelProperty("计划数量") - @Excel(name = "计划数量") - private BigDecimal planQuantity; - - @ApiModelProperty("实际数量") - @Excel(name = "实际数量") - private BigDecimal realQuantity; - - @ApiModelProperty("货架") - @Excel(name = "货架") - private Long rackId; - - @ApiModelProperty("金额") - @Excel(name = "金额") - private BigDecimal money; - - @ApiModelProperty("删除标识") - private Integer delFlag; - - @ApiModelProperty("备注") - @Excel(name = "备注") - private String remark; - - @ApiModelProperty("所属仓库") - @Excel(name = "所属仓库") - private Long warehouseId; - - @ApiModelProperty("所属库区") - @Excel(name = "所属库区") - private Long areaId; - - @ApiModelProperty("出库状态") - @Excel(name = "出库状态") - private Integer shipmentOrderStatus; - - - @ApiModelProperty("生产日期") - @Excel(name = "生产日期", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss") - @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") - @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") - private LocalDateTime productionDate; - - @ApiModelProperty("有效期") - @Excel(name = "有效期", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss") - @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") - @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") - private LocalDateTime expiryDate; - - @ApiModelProperty("批次") - private String batch; - -} diff --git a/wms/src/main/java/com/cyl/wms/domain/Supplier.java b/wms/src/main/java/com/cyl/wms/domain/Supplier.java deleted file mode 100644 index 02dc52a..0000000 --- a/wms/src/main/java/com/cyl/wms/domain/Supplier.java +++ /dev/null @@ -1,77 +0,0 @@ -package com.cyl.wms.domain; - -import com.ruoyi.common.annotation.Excel; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import com.ruoyi.common.core.domain.BaseAudit; -import lombok.Data; -import com.baomidou.mybatisplus.annotation.TableName; - -import java.math.BigDecimal; - -/** - * 供应商对象 wms_supplier - * - * @author zcc - */ -@ApiModel(description="供应商对象") -@Data -@TableName("wms_supplier") -public class Supplier extends BaseAudit { - private static final long serialVersionUID = 1L; - - @ApiModelProperty("ID") - private Long id; - - @ApiModelProperty("供应商编号") - @Excel(name = "供应商编号") - private String supplierNo; - - @ApiModelProperty("供应商名称") - @Excel(name = "供应商名称") - private String supplierName; - - @ApiModelProperty("开户行") - @Excel(name = "开户行") - private String bankName; - - @ApiModelProperty("银行卡号") - @Excel(name = "银行卡号") - private String bankAccount; - - @ApiModelProperty("应付款") - @Excel(name = "应付款") - private BigDecimal payableAmount; - - @ApiModelProperty("供应商地址") - @Excel(name = "供应商地址") - private String address; - - @ApiModelProperty("手机号") - @Excel(name = "手机号") - private String mobileNo; - - @ApiModelProperty("座机号") - @Excel(name = "座机号") - private String telNo; - - @ApiModelProperty("联系人") - @Excel(name = "联系人") - private String contact; - - @ApiModelProperty("级别") - @Excel(name = "级别") - private String level; - - @ApiModelProperty("Email") - @Excel(name = "Email") - private String email; - - @ApiModelProperty("备注") - @Excel(name = "备注") - private String remark; - - @ApiModelProperty("删除标识") - private Integer delFlag; - -} diff --git a/wms/src/main/java/com/cyl/wms/domain/SupplierTransaction.java b/wms/src/main/java/com/cyl/wms/domain/SupplierTransaction.java deleted file mode 100644 index b24bb90..0000000 --- a/wms/src/main/java/com/cyl/wms/domain/SupplierTransaction.java +++ /dev/null @@ -1,70 +0,0 @@ -package com.cyl.wms.domain; - -import java.math.BigDecimal; -import java.time.LocalDateTime; - -import com.fasterxml.jackson.annotation.JsonFormat; -import com.ruoyi.common.annotation.Excel; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; -import com.baomidou.mybatisplus.annotation.TableName; -/** - * 供应商账户流水对象 wms_supplier_transaction - * - * @author zcc - */ -@ApiModel(description="供应商账户流水对象") -@Data -@TableName("wms_supplier_transaction") -public class SupplierTransaction { - public static String ENTER = "11"; - public static String EXIT = "22"; - public static String RECEIPT = "33"; - private static final long serialVersionUID = 1L; - - private int id; - - @ApiModelProperty("交易编号") - @Excel(name = "交易编号") - private String transactionCode; - - @ApiModelProperty("供应商编号") - @Excel(name = "供应商编号") - private String supplierId; - - @ApiModelProperty("交易类型 1:结款 2:应付 ") - @Excel(name = "交易类型 1:结款 2:应付 ") - private String transactionType; - - @ApiModelProperty("交易金额") - @Excel(name = "交易金额") - private BigDecimal transactionAmount; - - @ApiModelProperty("上期余额") - @Excel(name = "上期余额") - private BigDecimal previousBalance; - - @ApiModelProperty("当前余额") - @Excel(name = "当前余额") - private BigDecimal currentBalance; - - @ApiModelProperty("入库单号") - @Excel(name = "入库单号") - private int receiptOrderId; - - @ApiModelProperty("备注") - @Excel(name = "备注") - private String remark; - - @ApiModelProperty("删除标志") - private Integer delFlag; - - @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") - @ApiModelProperty("创建时间") - private LocalDateTime createTime; - - @ApiModelProperty("更新时间") - private LocalDateTime updateTime; - -} diff --git a/wms/src/main/java/com/cyl/wms/domain/Warehouse.java b/wms/src/main/java/com/cyl/wms/domain/Warehouse.java deleted file mode 100644 index 5668386..0000000 --- a/wms/src/main/java/com/cyl/wms/domain/Warehouse.java +++ /dev/null @@ -1,38 +0,0 @@ -package com.cyl.wms.domain; - -import com.ruoyi.common.annotation.Excel; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import com.ruoyi.common.core.domain.BaseAudit; -import lombok.Data; -import com.baomidou.mybatisplus.annotation.TableName; -/** - * 仓库对象 wms_warehouse - * - * @author zcc - */ -@ApiModel(description="仓库对象") -@Data -@TableName("wms_warehouse") -public class Warehouse extends BaseAudit { - private static final long serialVersionUID = 1L; - - @ApiModelProperty("ID") - private Long id; - - @ApiModelProperty("仓库编号") - @Excel(name = "仓库编号") - private String warehouseNo; - - @ApiModelProperty("仓库名称") - @Excel(name = "仓库名称") - private String warehouseName; - - @ApiModelProperty("删除标识") - private Integer delFlag; - - @ApiModelProperty("备注") - @Excel(name = "备注") - private String remark; - -} diff --git a/wms/src/main/java/com/cyl/wms/domain/Wave.java b/wms/src/main/java/com/cyl/wms/domain/Wave.java deleted file mode 100644 index d0daea5..0000000 --- a/wms/src/main/java/com/cyl/wms/domain/Wave.java +++ /dev/null @@ -1,44 +0,0 @@ -package com.cyl.wms.domain; - -import com.baomidou.mybatisplus.annotation.TableField; -import com.ruoyi.common.annotation.Excel; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import com.ruoyi.common.core.domain.BaseAudit; -import lombok.Data; -import com.baomidou.mybatisplus.annotation.TableName; - -import java.util.ArrayList; - -/** - * 波次对象 wms_wave - * - * @author zhangcheng - */ -@ApiModel(description = "波次对象") -@Data -@TableName("wms_wave") -public class Wave extends BaseAudit { - private static final long serialVersionUID = 1L; - - @ApiModelProperty("ID") - private Long id; - - @ApiModelProperty("波次号") - @Excel(name = "波次号") - private String waveNo; - - @ApiModelProperty("状态") - @Excel(name = "状态") - private String status; - - @ApiModelProperty("备注") - @Excel(name = "备注") - private String remark; - - @ApiModelProperty("删除标识") - private Integer delFlag; - @TableField(exist = false) - private ArrayList ids; - -} diff --git a/wms/src/main/java/com/cyl/wms/handler/DictDealHandler.java b/wms/src/main/java/com/cyl/wms/handler/DictDealHandler.java deleted file mode 100644 index 405cfdc..0000000 --- a/wms/src/main/java/com/cyl/wms/handler/DictDealHandler.java +++ /dev/null @@ -1,10 +0,0 @@ -package com.cyl.wms.handler; - -import com.ruoyi.common.utils.poi.ExcelHandlerAdapter; - -public class DictDealHandler implements ExcelHandlerAdapter { - @Override - public Object format(Object value, String[] args) { - return value; - } -} diff --git a/wms/src/main/java/com/cyl/wms/mapper/AreaMapper.java b/wms/src/main/java/com/cyl/wms/mapper/AreaMapper.java deleted file mode 100644 index 2e1c269..0000000 --- a/wms/src/main/java/com/cyl/wms/mapper/AreaMapper.java +++ /dev/null @@ -1,28 +0,0 @@ -package com.cyl.wms.mapper; - -import java.util.List; -import com.baomidou.mybatisplus.core.mapper.BaseMapper; -import org.apache.ibatis.annotations.Param; -import com.cyl.wms.domain.Area; - -/** - * 货区Mapper接口 - * - * @author zcc - */ -public interface AreaMapper extends BaseMapper { - /** - * 查询货区列表 - * - * @param area 货区 - * @return 货区集合 - */ - List selectByEntity(Area area); - - /** - * 批量软删除 - * @param ids - * @return - */ - int updateDelFlagByIds(@Param("ids") Long[] ids); -} diff --git a/wms/src/main/java/com/cyl/wms/mapper/CarrierMapper.java b/wms/src/main/java/com/cyl/wms/mapper/CarrierMapper.java deleted file mode 100644 index 82c5fd2..0000000 --- a/wms/src/main/java/com/cyl/wms/mapper/CarrierMapper.java +++ /dev/null @@ -1,28 +0,0 @@ -package com.cyl.wms.mapper; - -import java.util.List; -import com.baomidou.mybatisplus.core.mapper.BaseMapper; -import org.apache.ibatis.annotations.Param; -import com.cyl.wms.domain.Carrier; - -/** - * 承运商Mapper接口 - * - * @author zcc - */ -public interface CarrierMapper extends BaseMapper { - /** - * 查询承运商列表 - * - * @param carrier 承运商 - * @return 承运商集合 - */ - List selectByEntity(Carrier carrier); - - /** - * 批量软删除 - * @param ids - * @return - */ - int updateDelFlagByIds(@Param("ids") Long[] ids); -} diff --git a/wms/src/main/java/com/cyl/wms/mapper/CustomerMapper.java b/wms/src/main/java/com/cyl/wms/mapper/CustomerMapper.java deleted file mode 100644 index 081dffe..0000000 --- a/wms/src/main/java/com/cyl/wms/mapper/CustomerMapper.java +++ /dev/null @@ -1,28 +0,0 @@ -package com.cyl.wms.mapper; - -import java.util.List; -import com.baomidou.mybatisplus.core.mapper.BaseMapper; -import org.apache.ibatis.annotations.Param; -import com.cyl.wms.domain.Customer; - -/** - * 客户Mapper接口 - * - * @author zcc - */ -public interface CustomerMapper extends BaseMapper { - /** - * 查询客户列表 - * - * @param customer 客户 - * @return 客户集合 - */ - List selectByEntity(Customer customer); - - /** - * 批量软删除 - * @param ids - * @return - */ - int updateDelFlagByIds(@Param("ids") Long[] ids); -} diff --git a/wms/src/main/java/com/cyl/wms/mapper/CustomerTransactionMapper.java b/wms/src/main/java/com/cyl/wms/mapper/CustomerTransactionMapper.java deleted file mode 100644 index b96b03b..0000000 --- a/wms/src/main/java/com/cyl/wms/mapper/CustomerTransactionMapper.java +++ /dev/null @@ -1,29 +0,0 @@ -package com.cyl.wms.mapper; - -import java.util.List; -import com.baomidou.mybatisplus.core.mapper.BaseMapper; -import com.cyl.wms.pojo.query.CustomerTransactionQuery; -import org.apache.ibatis.annotations.Param; -import com.cyl.wms.domain.CustomerTransaction; - -/** - * 客户账户流水Mapper接口 - * - * @author zcc - */ -public interface CustomerTransactionMapper extends BaseMapper { - /** - * 查询客户账户流水列表 - * - * @param customerTransaction 客户账户流水 - * @return 客户账户流水集合 - */ - List selectByEntity(CustomerTransaction customerTransaction); - - /** - * 批量软删除 - * @param ids - * @return - */ - int updateDelFlagByIds(@Param("ids") Long[] ids); -} diff --git a/wms/src/main/java/com/cyl/wms/mapper/DeliveryMapper.java b/wms/src/main/java/com/cyl/wms/mapper/DeliveryMapper.java deleted file mode 100644 index a543002..0000000 --- a/wms/src/main/java/com/cyl/wms/mapper/DeliveryMapper.java +++ /dev/null @@ -1,28 +0,0 @@ -package com.cyl.wms.mapper; - -import java.util.List; -import com.baomidou.mybatisplus.core.mapper.BaseMapper; -import org.apache.ibatis.annotations.Param; -import com.cyl.wms.domain.Delivery; - -/** - * 发货记录Mapper接口 - * - * @author zcc - */ -public interface DeliveryMapper extends BaseMapper { - /** - * 查询发货记录列表 - * - * @param delivery 发货记录 - * @return 发货记录集合 - */ - List selectByEntity(Delivery delivery); - - /** - * 批量软删除 - * @param ids - * @return - */ - int updateDelFlagByIds(@Param("ids") Long[] ids); -} diff --git a/wms/src/main/java/com/cyl/wms/mapper/InventoryCheckDetailMapper.java b/wms/src/main/java/com/cyl/wms/mapper/InventoryCheckDetailMapper.java deleted file mode 100644 index cbba11a..0000000 --- a/wms/src/main/java/com/cyl/wms/mapper/InventoryCheckDetailMapper.java +++ /dev/null @@ -1,35 +0,0 @@ -package com.cyl.wms.mapper; - -import java.util.List; -import com.baomidou.mybatisplus.core.mapper.BaseMapper; -import org.apache.ibatis.annotations.Param; -import com.cyl.wms.domain.InventoryCheckDetail; - -/** - * 库存盘点单据详情Mapper接口 - * - * @author zcc - */ -public interface InventoryCheckDetailMapper extends BaseMapper { - /** - * 查询库存盘点单据详情列表 - * - * @param inventoryCheckDetail 库存盘点单据详情 - * @return 库存盘点单据详情集合 - */ - List selectByEntity(InventoryCheckDetail inventoryCheckDetail); - - /** - * 批量软删除 - * @param ids - * @return - */ - int updateDelFlagByIds(@Param("ids") Long[] ids); - - /** - * 批量插入 - * @param inventoryCheckDetails 库存盘点单据详情 - * @return 插入结果 - */ - int batchInsert(List inventoryCheckDetails); -} diff --git a/wms/src/main/java/com/cyl/wms/mapper/InventoryCheckMapper.java b/wms/src/main/java/com/cyl/wms/mapper/InventoryCheckMapper.java deleted file mode 100644 index fa4dc82..0000000 --- a/wms/src/main/java/com/cyl/wms/mapper/InventoryCheckMapper.java +++ /dev/null @@ -1,28 +0,0 @@ -package com.cyl.wms.mapper; - -import java.util.List; -import com.baomidou.mybatisplus.core.mapper.BaseMapper; -import org.apache.ibatis.annotations.Param; -import com.cyl.wms.domain.InventoryCheck; - -/** - * 库存盘点单据Mapper接口 - * - * @author zcc - */ -public interface InventoryCheckMapper extends BaseMapper { - /** - * 查询库存盘点单据列表 - * - * @param inventoryCheck 库存盘点单据 - * @return 库存盘点单据集合 - */ - List selectByEntity(InventoryCheck inventoryCheck); - - /** - * 批量软删除 - * @param ids - * @return - */ - int updateDelFlagByIds(@Param("ids") Long[] ids); -} diff --git a/wms/src/main/java/com/cyl/wms/mapper/InventoryHistoryMapper.java b/wms/src/main/java/com/cyl/wms/mapper/InventoryHistoryMapper.java deleted file mode 100644 index 5aaf4a4..0000000 --- a/wms/src/main/java/com/cyl/wms/mapper/InventoryHistoryMapper.java +++ /dev/null @@ -1,35 +0,0 @@ -package com.cyl.wms.mapper; - -import java.util.Collection; -import java.util.List; -import com.baomidou.mybatisplus.core.mapper.BaseMapper; -import com.cyl.wms.pojo.query.InventoryHistoryQuery; -import com.cyl.wms.pojo.vo.InventoryHistoryVO; -import org.apache.ibatis.annotations.Param; -import com.cyl.wms.domain.InventoryHistory; - -/** - * 库存记录Mapper接口 - * - * @author zcc - */ -public interface InventoryHistoryMapper extends BaseMapper { - /** - * 查询库存记录列表 - * - * @param inventoryHistory 库存记录 - * @return 库存记录集合 - */ - List selectByEntity(InventoryHistory inventoryHistory); - - /** - * 批量软删除 - * @param ids - * @return - */ - int updateDelFlagByIds(@Param("ids") Long[] ids); - - int batchInsert(@Param("list") Collection list); - - List selectPageList(InventoryHistoryQuery query); -} diff --git a/wms/src/main/java/com/cyl/wms/mapper/InventoryMapper.java b/wms/src/main/java/com/cyl/wms/mapper/InventoryMapper.java deleted file mode 100644 index b7b68eb..0000000 --- a/wms/src/main/java/com/cyl/wms/mapper/InventoryMapper.java +++ /dev/null @@ -1,80 +0,0 @@ -package com.cyl.wms.mapper; - -import com.baomidou.mybatisplus.core.conditions.Wrapper; -import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; -import com.baomidou.mybatisplus.core.mapper.BaseMapper; -import com.baomidou.mybatisplus.core.toolkit.Constants; -import com.cyl.wms.domain.Inventory; -import com.cyl.wms.domain.InventoryHistory; -import org.apache.ibatis.annotations.Param; - -import java.time.LocalDateTime; -import java.util.Collection; -import java.util.List; - -/** - * 库存Mapper接口 - * - * @author zcc - */ -public interface InventoryMapper extends BaseMapper { - /** - * 查询库存 - * - * @param queryWrapper 库存 - * @return 库存集合 - */ - List selectListGroupByWarehouseId(@Param(Constants.WRAPPER) Wrapper queryWrapper); - - /** - * 查询库存 - * - * @param queryWrapper 库存 - * @return 库存集合 - */ - List selectListGroupByAreaId(@Param(Constants.WRAPPER) QueryWrapper queryWrapper); - - /** - * 查询库存 - * - * @param queryWrapper 库存 - * @return 库存集合 - */ - List selectListGroupByItemTypeId(@Param(Constants.WRAPPER) QueryWrapper queryWrapper); - - /** - * 查询库存列表 - * - * @param inventory 库存 - * @return 库存集合 - */ - List selectByEntity(Inventory inventory); - - /** - * 批量软删除 - * - * @param ids - * @return - */ - int updateDelFlagByIds(@Param("ids") Long[] ids); - - int batchUpdateQuantityById(@Param("list") Collection list, @Param("updateTime") LocalDateTime updateTime, @Param("userId") Long userId); - - List selectAllByWarehouseAndItemId(@Param("list") Collection list); - - List selectAllByAreaAndItemId(@Param("list") Collection list); - - List selectAllByRackAndItemId(@Param("list") Collection list); - - int batchInsert(@Param("list") Collection list); - - List selectWarning(); - - /** - * 查询所有有效的物料(仓库,物料未被删除) - * - */ - List selectValidAll(); - - List selectLastInventory(@Param("itemId")Long itemId, @Param("sort")String sort); -} diff --git a/wms/src/main/java/com/cyl/wms/mapper/InventoryMovementDetailMapper.java b/wms/src/main/java/com/cyl/wms/mapper/InventoryMovementDetailMapper.java deleted file mode 100644 index 19aaa94..0000000 --- a/wms/src/main/java/com/cyl/wms/mapper/InventoryMovementDetailMapper.java +++ /dev/null @@ -1,36 +0,0 @@ -package com.cyl.wms.mapper; - -import java.util.Arrays; -import java.util.List; - -import com.baomidou.mybatisplus.core.mapper.BaseMapper; -import com.cyl.wms.pojo.vo.InventoryMovementVO; -import org.apache.ibatis.annotations.Param; -import com.cyl.wms.domain.InventoryMovementDetail; - -/** - * 库存移动详情Mapper接口 - * - * @author zcc - */ -public interface InventoryMovementDetailMapper extends BaseMapper { - /** - * 查询库存移动详情列表 - * - * @param inventoryMovementDetail 库存移动详情 - * @return 库存移动详情集合 - */ - List selectByEntity(InventoryMovementDetail inventoryMovementDetail); - - /** - * 批量软删除 - * - * @param ids - * @return - */ - int updateDelFlagByIds(@Param("ids") Long[] ids); - - List countByOrderId(List ids); - - int batchInsert(List inventoryMovementDetails); -} diff --git a/wms/src/main/java/com/cyl/wms/mapper/InventoryMovementMapper.java b/wms/src/main/java/com/cyl/wms/mapper/InventoryMovementMapper.java deleted file mode 100644 index 90130c3..0000000 --- a/wms/src/main/java/com/cyl/wms/mapper/InventoryMovementMapper.java +++ /dev/null @@ -1,28 +0,0 @@ -package com.cyl.wms.mapper; - -import java.util.List; -import com.baomidou.mybatisplus.core.mapper.BaseMapper; -import org.apache.ibatis.annotations.Param; -import com.cyl.wms.domain.InventoryMovement; - -/** - * 库存移动Mapper接口 - * - * @author zcc - */ -public interface InventoryMovementMapper extends BaseMapper { - /** - * 查询库存移动列表 - * - * @param inventoryMovement 库存移动 - * @return 库存移动集合 - */ - List selectByEntity(InventoryMovement inventoryMovement); - - /** - * 批量软删除 - * @param ids - * @return - */ - int updateDelFlagByIds(@Param("ids") Long[] ids); -} diff --git a/wms/src/main/java/com/cyl/wms/mapper/InventorySettlementDetailMapper.java b/wms/src/main/java/com/cyl/wms/mapper/InventorySettlementDetailMapper.java deleted file mode 100644 index 5a8dd3a..0000000 --- a/wms/src/main/java/com/cyl/wms/mapper/InventorySettlementDetailMapper.java +++ /dev/null @@ -1,36 +0,0 @@ -package com.cyl.wms.mapper; - -import com.baomidou.mybatisplus.core.mapper.BaseMapper; -import com.cyl.wms.domain.InventorySettlementDetail; -import org.apache.ibatis.annotations.Param; - -import java.util.List; - -/** - * 库存结算明细Mapper接口 - * - * @author zcc - */ -public interface InventorySettlementDetailMapper extends BaseMapper { - /** - * 查询库存结算明细列表 - * - * @param inventorySettlementDetail 库存结算明细 - * @return 库存结算明细集合 - */ - List selectByEntity(InventorySettlementDetail inventorySettlementDetail); - - /** - * 批量软删除 - * @param ids - * @return - */ - int updateDelFlagByIds(@Param("ids") Long[] ids); - - /** - * 批量插入 - * @param inventorySettlementDetails 库存结算单据详情 - * @return 插入结果 - */ - int batchInsert(List inventorySettlementDetails); -} diff --git a/wms/src/main/java/com/cyl/wms/mapper/InventorySettlementMapper.java b/wms/src/main/java/com/cyl/wms/mapper/InventorySettlementMapper.java deleted file mode 100644 index 14cead3..0000000 --- a/wms/src/main/java/com/cyl/wms/mapper/InventorySettlementMapper.java +++ /dev/null @@ -1,29 +0,0 @@ -package com.cyl.wms.mapper; - -import com.baomidou.mybatisplus.core.mapper.BaseMapper; -import com.cyl.wms.domain.InventorySettlement; -import org.apache.ibatis.annotations.Param; - -import java.util.List; - -/** - * 库存结算单Mapper接口 - * - * @author zcc - */ -public interface InventorySettlementMapper extends BaseMapper { - /** - * 查询库存结算单列表 - * - * @param inventorySettlement 库存结算单 - * @return 库存结算单集合 - */ - List selectByEntity(InventorySettlement inventorySettlement); - - /** - * 批量软删除 - * @param ids - * @return - */ - int updateDelFlagByIds(@Param("ids") Long[] ids); -} diff --git a/wms/src/main/java/com/cyl/wms/mapper/ItemMapper.java b/wms/src/main/java/com/cyl/wms/mapper/ItemMapper.java deleted file mode 100644 index cca9bc6..0000000 --- a/wms/src/main/java/com/cyl/wms/mapper/ItemMapper.java +++ /dev/null @@ -1,30 +0,0 @@ -package com.cyl.wms.mapper; - -import java.util.List; -import com.baomidou.mybatisplus.core.mapper.BaseMapper; -import org.apache.ibatis.annotations.Param; -import com.cyl.wms.domain.Item; - -/** - * 物料Mapper接口 - * - * @author zcc - */ -public interface ItemMapper extends BaseMapper { - /** - * 查询物料列表 - * - * @param item 物料 - * @return 物料集合 - */ - List selectByEntity(Item item); - - /** - * 批量软删除 - * @param ids - * @return - */ - int updateDelFlagByIds(@Param("ids") Long[] ids); - - List selectExpiry(); -} diff --git a/wms/src/main/java/com/cyl/wms/mapper/ItemTypeMapper.java b/wms/src/main/java/com/cyl/wms/mapper/ItemTypeMapper.java deleted file mode 100644 index 23c0268..0000000 --- a/wms/src/main/java/com/cyl/wms/mapper/ItemTypeMapper.java +++ /dev/null @@ -1,28 +0,0 @@ -package com.cyl.wms.mapper; - -import java.util.List; -import com.baomidou.mybatisplus.core.mapper.BaseMapper; -import org.apache.ibatis.annotations.Param; -import com.cyl.wms.domain.ItemType; - -/** - * 物料类型表Mapper接口 - * - * @author zcc - */ -public interface ItemTypeMapper extends BaseMapper { - /** - * 查询物料类型表列表 - * - * @param itemType 物料类型表 - * @return 物料类型表集合 - */ - List selectByEntity(ItemType itemType); - - /** - * 批量软删除 - * @param ids - * @return - */ - int updateDelFlagByIds(@Param("ids") Long[] ids); -} diff --git a/wms/src/main/java/com/cyl/wms/mapper/RackMapper.java b/wms/src/main/java/com/cyl/wms/mapper/RackMapper.java deleted file mode 100644 index 70cbf52..0000000 --- a/wms/src/main/java/com/cyl/wms/mapper/RackMapper.java +++ /dev/null @@ -1,28 +0,0 @@ -package com.cyl.wms.mapper; - -import java.util.List; -import com.baomidou.mybatisplus.core.mapper.BaseMapper; -import org.apache.ibatis.annotations.Param; -import com.cyl.wms.domain.Rack; - -/** - * 货架Mapper接口 - * - * @author zcc - */ -public interface RackMapper extends BaseMapper { - /** - * 查询货架列表 - * - * @param rack 货架 - * @return 货架集合 - */ - List selectByEntity(Rack rack); - - /** - * 批量软删除 - * @param ids - * @return - */ - int updateDelFlagByIds(@Param("ids") Long[] ids); -} diff --git a/wms/src/main/java/com/cyl/wms/mapper/ReceiptOrderDetailMapper.java b/wms/src/main/java/com/cyl/wms/mapper/ReceiptOrderDetailMapper.java deleted file mode 100644 index adf6305..0000000 --- a/wms/src/main/java/com/cyl/wms/mapper/ReceiptOrderDetailMapper.java +++ /dev/null @@ -1,35 +0,0 @@ -package com.cyl.wms.mapper; - -import java.util.Collection; -import java.util.List; -import com.baomidou.mybatisplus.core.mapper.BaseMapper; -import com.cyl.wms.domain.ReceiptOrder; -import com.cyl.wms.pojo.vo.ReceiptOrderVO; -import org.apache.ibatis.annotations.Param; -import com.cyl.wms.domain.ReceiptOrderDetail; - -/** - * 入库单详情Mapper接口 - * - * @author zcc - */ -public interface ReceiptOrderDetailMapper extends BaseMapper { - /** - * 查询入库单详情列表 - * - * @param receiptOrderDetail 入库单详情 - * @return 入库单详情集合 - */ - List selectByEntity(ReceiptOrderDetail receiptOrderDetail); - - /** - * 批量软删除 - * @param ids - * @return - */ - int updateDelFlagByIds(@Param("ids") Long[] ids); - - int batchInsert(List details); - - List countByOrderId(@Param("ids") Collection ids); -} diff --git a/wms/src/main/java/com/cyl/wms/mapper/ReceiptOrderMapper.java b/wms/src/main/java/com/cyl/wms/mapper/ReceiptOrderMapper.java deleted file mode 100644 index aaed9de..0000000 --- a/wms/src/main/java/com/cyl/wms/mapper/ReceiptOrderMapper.java +++ /dev/null @@ -1,28 +0,0 @@ -package com.cyl.wms.mapper; - -import java.util.List; -import com.baomidou.mybatisplus.core.mapper.BaseMapper; -import org.apache.ibatis.annotations.Param; -import com.cyl.wms.domain.ReceiptOrder; - -/** - * 入库单Mapper接口 - * - * @author zcc - */ -public interface ReceiptOrderMapper extends BaseMapper { - /** - * 查询入库单列表 - * - * @param receiptOrder 入库单 - * @return 入库单集合 - */ - List selectByEntity(ReceiptOrder receiptOrder); - - /** - * 批量软删除 - * @param ids - * @return - */ - int updateDelFlagByIds(@Param("ids") Long[] ids); -} diff --git a/wms/src/main/java/com/cyl/wms/mapper/ShipmentOrderDetailMapper.java b/wms/src/main/java/com/cyl/wms/mapper/ShipmentOrderDetailMapper.java deleted file mode 100644 index 9963251..0000000 --- a/wms/src/main/java/com/cyl/wms/mapper/ShipmentOrderDetailMapper.java +++ /dev/null @@ -1,44 +0,0 @@ -package com.cyl.wms.mapper; - -import com.baomidou.mybatisplus.core.mapper.BaseMapper; -import com.cyl.wms.domain.ShipmentOrderDetail; -import com.cyl.wms.pojo.query.CustomerShipmentStatQuery; -import com.cyl.wms.pojo.vo.CustomerShipmentStatVO; -import com.cyl.wms.pojo.vo.ShipmentOrderDetailVO; -import com.cyl.wms.pojo.vo.ShipmentOrderVO; -import org.apache.ibatis.annotations.Param; - -import java.util.List; - -/** - * 出库单详情Mapper接口 - * - * @author zcc - */ -public interface ShipmentOrderDetailMapper extends BaseMapper { - /** - * 查询出库单详情列表 - * - * @param shipmentOrderDetail 出库单详情 - * @return 出库单详情集合 - */ - List selectByEntity(ShipmentOrderDetail shipmentOrderDetail); - - /** - * 批量软删除 - * - * @param ids - * @return - */ - int updateDelFlagByIds(@Param("ids") Long[] ids); - - List countByOrderId(List ids); - - int batchInsert(List shipmentOrderDetails); - - List selectListGroupByItemId(@Param("id") long ids); - - List selectDetailByWaveNo(String waveNo); - - List statByCustomerAndType(@Param("query") CustomerShipmentStatQuery query); -} diff --git a/wms/src/main/java/com/cyl/wms/mapper/ShipmentOrderMapper.java b/wms/src/main/java/com/cyl/wms/mapper/ShipmentOrderMapper.java deleted file mode 100644 index 788ef1a..0000000 --- a/wms/src/main/java/com/cyl/wms/mapper/ShipmentOrderMapper.java +++ /dev/null @@ -1,28 +0,0 @@ -package com.cyl.wms.mapper; - -import java.util.List; -import com.baomidou.mybatisplus.core.mapper.BaseMapper; -import org.apache.ibatis.annotations.Param; -import com.cyl.wms.domain.ShipmentOrder; - -/** - * 出库单Mapper接口 - * - * @author zcc - */ -public interface ShipmentOrderMapper extends BaseMapper { - /** - * 查询出库单列表 - * - * @param shipmentOrder 出库单 - * @return 出库单集合 - */ - List selectByEntity(ShipmentOrder shipmentOrder); - - /** - * 批量软删除 - * @param ids - * @return - */ - int updateDelFlagByIds(@Param("ids") Long[] ids); -} diff --git a/wms/src/main/java/com/cyl/wms/mapper/SupplierMapper.java b/wms/src/main/java/com/cyl/wms/mapper/SupplierMapper.java deleted file mode 100644 index df23b3c..0000000 --- a/wms/src/main/java/com/cyl/wms/mapper/SupplierMapper.java +++ /dev/null @@ -1,28 +0,0 @@ -package com.cyl.wms.mapper; - -import java.util.List; -import com.baomidou.mybatisplus.core.mapper.BaseMapper; -import org.apache.ibatis.annotations.Param; -import com.cyl.wms.domain.Supplier; - -/** - * 供应商Mapper接口 - * - * @author zcc - */ -public interface SupplierMapper extends BaseMapper { - /** - * 查询供应商列表 - * - * @param supplier 供应商 - * @return 供应商集合 - */ - List selectByEntity(Supplier supplier); - - /** - * 批量软删除 - * @param ids - * @return - */ - int updateDelFlagByIds(@Param("ids") Long[] ids); -} diff --git a/wms/src/main/java/com/cyl/wms/mapper/SupplierTransactionMapper.java b/wms/src/main/java/com/cyl/wms/mapper/SupplierTransactionMapper.java deleted file mode 100644 index 629097a..0000000 --- a/wms/src/main/java/com/cyl/wms/mapper/SupplierTransactionMapper.java +++ /dev/null @@ -1,29 +0,0 @@ -package com.cyl.wms.mapper; - -import java.util.List; -import com.baomidou.mybatisplus.core.mapper.BaseMapper; -import com.cyl.wms.pojo.query.SupplierTransactionQuery; -import org.apache.ibatis.annotations.Param; -import com.cyl.wms.domain.SupplierTransaction; - -/** - * 供应商账户流水Mapper接口 - * - * @author zcc - */ -public interface SupplierTransactionMapper extends BaseMapper { - /** - * 查询供应商账户流水列表 - * - * @param supplierTransaction 供应商账户流水 - * @return 供应商账户流水集合 - */ - List selectByEntity(SupplierTransaction supplierTransaction); - - /** - * 批量软删除 - * @param ids - * @return - */ - int updateDelFlagByIds(@Param("ids") Long[] ids); -} diff --git a/wms/src/main/java/com/cyl/wms/mapper/WarehouseMapper.java b/wms/src/main/java/com/cyl/wms/mapper/WarehouseMapper.java deleted file mode 100644 index 002570b..0000000 --- a/wms/src/main/java/com/cyl/wms/mapper/WarehouseMapper.java +++ /dev/null @@ -1,28 +0,0 @@ -package com.cyl.wms.mapper; - -import java.util.List; -import com.baomidou.mybatisplus.core.mapper.BaseMapper; -import org.apache.ibatis.annotations.Param; -import com.cyl.wms.domain.Warehouse; - -/** - * 仓库Mapper接口 - * - * @author zcc - */ -public interface WarehouseMapper extends BaseMapper { - /** - * 查询仓库列表 - * - * @param warehouse 仓库 - * @return 仓库集合 - */ - List selectByEntity(Warehouse warehouse); - - /** - * 批量软删除 - * @param ids - * @return - */ - int updateDelFlagByIds(@Param("ids") Long[] ids); -} diff --git a/wms/src/main/java/com/cyl/wms/mapper/WaveMapper.java b/wms/src/main/java/com/cyl/wms/mapper/WaveMapper.java deleted file mode 100644 index f890cb6..0000000 --- a/wms/src/main/java/com/cyl/wms/mapper/WaveMapper.java +++ /dev/null @@ -1,28 +0,0 @@ -package com.cyl.wms.mapper; - -import java.util.List; -import com.baomidou.mybatisplus.core.mapper.BaseMapper; -import org.apache.ibatis.annotations.Param; -import com.cyl.wms.domain.Wave; - -/** - * 波次Mapper接口 - * - * @author zhangcheng - */ -public interface WaveMapper extends BaseMapper { - /** - * 查询波次列表 - * - * @param wave 波次 - * @return 波次集合 - */ - List selectByEntity(Wave wave); - - /** - * 批量软删除 - * @param ids - * @return - */ - int updateDelFlagByIds(@Param("ids") Long[] ids); -} diff --git a/wms/src/main/java/com/cyl/wms/pojo/dto/AreaDTO.java b/wms/src/main/java/com/cyl/wms/pojo/dto/AreaDTO.java deleted file mode 100644 index 49bda7a..0000000 --- a/wms/src/main/java/com/cyl/wms/pojo/dto/AreaDTO.java +++ /dev/null @@ -1,17 +0,0 @@ -package com.cyl.wms.pojo.dto; - -import com.ruoyi.common.core.domain.BaseAudit; -import lombok.Data; -/** - * 货区 DTO 对象 - * - * @author zcc - */ -@Data -public class AreaDTO extends BaseAudit { - private Long id; - private String areaNo; - private String areaName; - private Long warehouseId; - private String remark; -} diff --git a/wms/src/main/java/com/cyl/wms/pojo/dto/CarrierDTO.java b/wms/src/main/java/com/cyl/wms/pojo/dto/CarrierDTO.java deleted file mode 100644 index eab263f..0000000 --- a/wms/src/main/java/com/cyl/wms/pojo/dto/CarrierDTO.java +++ /dev/null @@ -1,22 +0,0 @@ -package com.cyl.wms.pojo.dto; - -import com.ruoyi.common.core.domain.BaseAudit; -import lombok.Data; -/** - * 承运商 DTO 对象 - * - * @author zcc - */ -@Data -public class CarrierDTO extends BaseAudit { - private Long id; - private String carrierNo; - private String carrierName; - private String address; - private String mobile; - private String tel; - private String contact; - private String level; - private String email; - private String remark; -} diff --git a/wms/src/main/java/com/cyl/wms/pojo/dto/CustomerDTO.java b/wms/src/main/java/com/cyl/wms/pojo/dto/CustomerDTO.java deleted file mode 100644 index de5ee1e..0000000 --- a/wms/src/main/java/com/cyl/wms/pojo/dto/CustomerDTO.java +++ /dev/null @@ -1,28 +0,0 @@ -package com.cyl.wms.pojo.dto; - -import com.ruoyi.common.core.domain.BaseAudit; -import lombok.Data; - -import java.math.BigDecimal; - -/** - * 客户 DTO 对象 - * - * @author zcc - */ -@Data -public class CustomerDTO extends BaseAudit { - private Long id; - private String customerNo; - private String customerName; - private String bankName; - private String bankAccount; - private BigDecimal receivableAmount; - private String address; - private String mobile; - private String tel; - private String customerPerson; - private String customerLevel; - private String email; - private String remark; -} diff --git a/wms/src/main/java/com/cyl/wms/pojo/dto/CustomerTransactionDTO.java b/wms/src/main/java/com/cyl/wms/pojo/dto/CustomerTransactionDTO.java deleted file mode 100644 index 99cd637..0000000 --- a/wms/src/main/java/com/cyl/wms/pojo/dto/CustomerTransactionDTO.java +++ /dev/null @@ -1,24 +0,0 @@ -package com.cyl.wms.pojo.dto; - -import java.math.BigDecimal; -import java.time.LocalDateTime; -import lombok.Data; -/** - * 客户账户流水 DTO 对象 - * - * @author zcc - */ -@Data -public class CustomerTransactionDTO { - private Integer id; - private String transactionCode; - private String customerId; - private String transactionType; - private BigDecimal transactionAmount; - private BigDecimal previousBalance; - private BigDecimal currentBalance; - private Long shipmentOrderId; - private String remark; - private LocalDateTime createTime; - private LocalDateTime updateTime; -} diff --git a/wms/src/main/java/com/cyl/wms/pojo/dto/DeliveryDTO.java b/wms/src/main/java/com/cyl/wms/pojo/dto/DeliveryDTO.java deleted file mode 100644 index 3391f58..0000000 --- a/wms/src/main/java/com/cyl/wms/pojo/dto/DeliveryDTO.java +++ /dev/null @@ -1,19 +0,0 @@ -package com.cyl.wms.pojo.dto; - -import java.time.LocalDateTime; -import com.ruoyi.common.core.domain.BaseAudit; -import lombok.Data; -/** - * 发货记录 DTO 对象 - * - * @author zcc - */ -@Data -public class DeliveryDTO extends BaseAudit { - private Long id; - private Long shipmentOrderId; - private Long carrierId; - private LocalDateTime deliveryDate; - private String trackingNo; - private String remark; -} diff --git a/wms/src/main/java/com/cyl/wms/pojo/dto/InventoryCheckDTO.java b/wms/src/main/java/com/cyl/wms/pojo/dto/InventoryCheckDTO.java deleted file mode 100644 index f8e5a7b..0000000 --- a/wms/src/main/java/com/cyl/wms/pojo/dto/InventoryCheckDTO.java +++ /dev/null @@ -1,27 +0,0 @@ -package com.cyl.wms.pojo.dto; - -import java.math.BigDecimal; -import java.time.LocalDateTime; -import com.ruoyi.common.core.domain.BaseAudit; -import lombok.Data; -/** - * 库存盘点单据 DTO 对象 - * - * @author zcc - */ -@Data -public class InventoryCheckDTO extends BaseAudit { - private Long id; - private String inventoryCheckNo; - private Integer inventoryCheckType; - private Integer inventoryCheckStatus; - private BigDecimal inventoryCheckTotal; - private Integer checkStatus; - private Long checkUserId; - private LocalDateTime checkTime; - private Long warehouseId; - private Long areaId; - private Long rackId; - private String attachment; - private String remark; -} diff --git a/wms/src/main/java/com/cyl/wms/pojo/dto/InventoryCheckDetailDTO.java b/wms/src/main/java/com/cyl/wms/pojo/dto/InventoryCheckDetailDTO.java deleted file mode 100644 index 12ce199..0000000 --- a/wms/src/main/java/com/cyl/wms/pojo/dto/InventoryCheckDetailDTO.java +++ /dev/null @@ -1,22 +0,0 @@ -package com.cyl.wms.pojo.dto; - -import java.math.BigDecimal; -import com.ruoyi.common.core.domain.BaseAudit; -import lombok.Data; -/** - * 库存盘点单据详情 DTO 对象 - * - * @author zcc - */ -@Data -public class InventoryCheckDetailDTO extends BaseAudit { - private Long id; - private Long inventoryCheckId; - private Long itemId; - private BigDecimal quantity; - private BigDecimal checkQuantity; - private Long warehouseId; - private Long areaId; - private Long rackId; - private String remark; -} diff --git a/wms/src/main/java/com/cyl/wms/pojo/dto/InventoryDTO.java b/wms/src/main/java/com/cyl/wms/pojo/dto/InventoryDTO.java deleted file mode 100644 index b4ea7e9..0000000 --- a/wms/src/main/java/com/cyl/wms/pojo/dto/InventoryDTO.java +++ /dev/null @@ -1,25 +0,0 @@ -package com.cyl.wms.pojo.dto; - -import java.math.BigDecimal; -import java.time.LocalDateTime; - -import com.ruoyi.common.core.domain.BaseAudit; -import lombok.Data; -/** - * 库存 DTO 对象 - * - * @author zcc - */ -@Data -public class InventoryDTO extends BaseAudit { - private Long id; - private Long itemId; - private Long warehouseId; - private Long areaId; - private Long rackId; - private BigDecimal quantity; - private String remark; - private LocalDateTime productionDate; - private LocalDateTime expiryDate; - private String batch; -} diff --git a/wms/src/main/java/com/cyl/wms/pojo/dto/InventoryHistoryDTO.java b/wms/src/main/java/com/cyl/wms/pojo/dto/InventoryHistoryDTO.java deleted file mode 100644 index 4f6816f..0000000 --- a/wms/src/main/java/com/cyl/wms/pojo/dto/InventoryHistoryDTO.java +++ /dev/null @@ -1,27 +0,0 @@ -package com.cyl.wms.pojo.dto; - -import java.math.BigDecimal; -import java.time.LocalDateTime; - -import com.ruoyi.common.core.domain.BaseAudit; -import lombok.Data; -/** - * 库存记录 DTO 对象 - * - * @author zcc - */ -@Data -public class InventoryHistoryDTO extends BaseAudit { - private Long id; - private Long formId; - private Integer formType; - private Long itemId; - private Long rackId; - private Long warehouseId; - private Long areaId; - private BigDecimal quantity; - private String remark; - private LocalDateTime productionDate; - private LocalDateTime expiryDate; - private String batch; -} diff --git a/wms/src/main/java/com/cyl/wms/pojo/dto/InventoryMovementDTO.java b/wms/src/main/java/com/cyl/wms/pojo/dto/InventoryMovementDTO.java deleted file mode 100644 index f7864bb..0000000 --- a/wms/src/main/java/com/cyl/wms/pojo/dto/InventoryMovementDTO.java +++ /dev/null @@ -1,22 +0,0 @@ -package com.cyl.wms.pojo.dto; - -import java.time.LocalDateTime; -import com.ruoyi.common.core.domain.BaseAudit; -import lombok.Data; -/** - * 库存移动 DTO 对象 - * - * @author zcc - */ -@Data -public class InventoryMovementDTO extends BaseAudit { - private Long id; - private String inventoryMovementNo; - private Long sourceRackId; - private Long targetRackId; - private Integer status; - private Integer checkStatus; - private Long checkUserId; - private LocalDateTime checkTime; - private String remark; -} diff --git a/wms/src/main/java/com/cyl/wms/pojo/dto/InventoryMovementDetailDTO.java b/wms/src/main/java/com/cyl/wms/pojo/dto/InventoryMovementDetailDTO.java deleted file mode 100644 index b912d73..0000000 --- a/wms/src/main/java/com/cyl/wms/pojo/dto/InventoryMovementDetailDTO.java +++ /dev/null @@ -1,26 +0,0 @@ -package com.cyl.wms.pojo.dto; - -import java.math.BigDecimal; -import com.ruoyi.common.core.domain.BaseAudit; -import lombok.Data; -/** - * 库存移动详情 DTO 对象 - * - * @author zcc - */ -@Data -public class InventoryMovementDetailDTO extends BaseAudit { - private Long id; - private Long inventoryMovementId; - private Long itemId; - private BigDecimal planQuantity; - private BigDecimal realQuantity; - private String remark; - private Long sourceRackId; - private Long sourceWarehouseId; - private Long sourceAreaId; - private Integer moveStatus; - private Long targetRackId; - private Long targetWarehouseId; - private Long targetAreaId; -} diff --git a/wms/src/main/java/com/cyl/wms/pojo/dto/InventorySettlementDTO.java b/wms/src/main/java/com/cyl/wms/pojo/dto/InventorySettlementDTO.java deleted file mode 100644 index 86c867a..0000000 --- a/wms/src/main/java/com/cyl/wms/pojo/dto/InventorySettlementDTO.java +++ /dev/null @@ -1,17 +0,0 @@ -package com.cyl.wms.pojo.dto; - -import com.ruoyi.common.core.domain.BaseAudit; -import lombok.Data; -/** - * 库存结算单 DTO 对象 - * - * @author zcc - */ -@Data -public class InventorySettlementDTO extends BaseAudit { - private Long id; - private Integer inventorySettlementStatus; - private Integer settlementType; - private String remark; - private String inventorySettlementNo; -} diff --git a/wms/src/main/java/com/cyl/wms/pojo/dto/InventorySettlementDetailDTO.java b/wms/src/main/java/com/cyl/wms/pojo/dto/InventorySettlementDetailDTO.java deleted file mode 100644 index 63761f3..0000000 --- a/wms/src/main/java/com/cyl/wms/pojo/dto/InventorySettlementDetailDTO.java +++ /dev/null @@ -1,32 +0,0 @@ -package com.cyl.wms.pojo.dto; - -import com.ruoyi.common.core.domain.BaseAudit; -import lombok.Data; - -import java.math.BigDecimal; -/** - * 库存结算明细 DTO 对象 - * - * @author zcc - */ -@Data -public class InventorySettlementDetailDTO extends BaseAudit { - private Long id; - private Long settlementId; - private Integer settlementType; - private Long itemId; - private String itemNo; - private String itemName; - private Long warehouseId; - private String warehouseNo; - private String warehouseName; - private Long areaId; - private String areaNo; - private String areaName; - private BigDecimal previousBalance; - private BigDecimal currentEnter; - private BigDecimal currentOut; - private BigDecimal currentCheck; - private BigDecimal currentBalance; - private String remark; -} diff --git a/wms/src/main/java/com/cyl/wms/pojo/dto/ItemDTO.java b/wms/src/main/java/com/cyl/wms/pojo/dto/ItemDTO.java deleted file mode 100644 index 4472374..0000000 --- a/wms/src/main/java/com/cyl/wms/pojo/dto/ItemDTO.java +++ /dev/null @@ -1,30 +0,0 @@ -package com.cyl.wms.pojo.dto; - -import java.math.BigDecimal; -import java.time.LocalDateTime; -import com.ruoyi.common.core.domain.BaseAudit; -import lombok.Data; -/** - * 物料 DTO 对象 - * - * @author zcc - */ -@Data -public class ItemDTO extends BaseAudit { - private Long id; - private String itemNo; - private String itemName; - private String itemType; - private String unit; - private Long rackId; - private Long areaId; - private Long warehouseId; - private BigDecimal quantity; - private LocalDateTime expiryDate; - private String remark; - - private String specification; - private String batch; - private LocalDateTime productionDate; - private BigDecimal unitPrice; -} diff --git a/wms/src/main/java/com/cyl/wms/pojo/dto/ItemTypeDTO.java b/wms/src/main/java/com/cyl/wms/pojo/dto/ItemTypeDTO.java deleted file mode 100644 index 984d4bc..0000000 --- a/wms/src/main/java/com/cyl/wms/pojo/dto/ItemTypeDTO.java +++ /dev/null @@ -1,18 +0,0 @@ -package com.cyl.wms.pojo.dto; - -import com.ruoyi.common.core.domain.BaseAudit; -import lombok.Data; -/** - * 物料类型表 DTO 对象 - * - * @author zcc - */ -@Data -public class ItemTypeDTO extends BaseAudit { - private Long itemTypeId; - private Long parentId; - private String ancestors; - private String typeName; - private Integer orderNum; - private String status; -} diff --git a/wms/src/main/java/com/cyl/wms/pojo/dto/RackDTO.java b/wms/src/main/java/com/cyl/wms/pojo/dto/RackDTO.java deleted file mode 100644 index d1e4ad1..0000000 --- a/wms/src/main/java/com/cyl/wms/pojo/dto/RackDTO.java +++ /dev/null @@ -1,18 +0,0 @@ -package com.cyl.wms.pojo.dto; - -import com.ruoyi.common.core.domain.BaseAudit; -import lombok.Data; -/** - * 货架 DTO 对象 - * - * @author zcc - */ -@Data -public class RackDTO extends BaseAudit { - private Long id; - private String rackNo; - private String rackName; - private Long areaId; - private Long warehouseId; - private String remark; -} diff --git a/wms/src/main/java/com/cyl/wms/pojo/dto/ReceiptOrderDTO.java b/wms/src/main/java/com/cyl/wms/pojo/dto/ReceiptOrderDTO.java deleted file mode 100644 index 9dd340c..0000000 --- a/wms/src/main/java/com/cyl/wms/pojo/dto/ReceiptOrderDTO.java +++ /dev/null @@ -1,19 +0,0 @@ -package com.cyl.wms.pojo.dto; - -import com.ruoyi.common.core.domain.BaseAudit; -import lombok.Data; -/** - * 入库单 DTO 对象 - * - * @author zcc - */ -@Data -public class ReceiptOrderDTO extends BaseAudit { - private Long id; - private String receiptOrderNo; - private Integer receiptOrderType; - private Long supplierId; - private String orderNo; - private Integer receiptOrderStatus; - private String remark; -} diff --git a/wms/src/main/java/com/cyl/wms/pojo/dto/ReceiptOrderDetailDTO.java b/wms/src/main/java/com/cyl/wms/pojo/dto/ReceiptOrderDetailDTO.java deleted file mode 100644 index 84d40d8..0000000 --- a/wms/src/main/java/com/cyl/wms/pojo/dto/ReceiptOrderDetailDTO.java +++ /dev/null @@ -1,28 +0,0 @@ -package com.cyl.wms.pojo.dto; - -import java.math.BigDecimal; -import java.time.LocalDateTime; - -import com.ruoyi.common.core.domain.BaseAudit; -import lombok.Data; -/** - * 入库单详情 DTO 对象 - * - * @author zcc - */ -@Data -public class ReceiptOrderDetailDTO extends BaseAudit { - private Long id; - private Long receiptOrderId; - private Long itemId; - private BigDecimal planQuantity; - private BigDecimal realQuantity; - private Long rackId; - private String remark; - private Long warehouseId; - private Long areaId; - private Integer receiptOrderStatus; - private LocalDateTime productionDate; - private LocalDateTime expiryDate; - private String batch; -} diff --git a/wms/src/main/java/com/cyl/wms/pojo/dto/ShipmentOrderDTO.java b/wms/src/main/java/com/cyl/wms/pojo/dto/ShipmentOrderDTO.java deleted file mode 100644 index 9ebbf98..0000000 --- a/wms/src/main/java/com/cyl/wms/pojo/dto/ShipmentOrderDTO.java +++ /dev/null @@ -1,23 +0,0 @@ -package com.cyl.wms.pojo.dto; - -import java.time.LocalDateTime; -import com.ruoyi.common.core.domain.BaseAudit; -import lombok.Data; -/** - * 出库单 DTO 对象 - * - * @author zcc - */ -@Data -public class ShipmentOrderDTO extends BaseAudit { - private Long id; - private String shipmentOrderNo; - private Integer shipmentOrderType; - private String orderNo; - private Long customerId; - private Integer shipmentOrderStatus; - private Integer checkStatus; - private Long checkUserId; - private LocalDateTime checkTime; - private String remark; -} diff --git a/wms/src/main/java/com/cyl/wms/pojo/dto/ShipmentOrderDetailDTO.java b/wms/src/main/java/com/cyl/wms/pojo/dto/ShipmentOrderDetailDTO.java deleted file mode 100644 index 8d79692..0000000 --- a/wms/src/main/java/com/cyl/wms/pojo/dto/ShipmentOrderDetailDTO.java +++ /dev/null @@ -1,28 +0,0 @@ -package com.cyl.wms.pojo.dto; - -import java.math.BigDecimal; -import java.time.LocalDateTime; - -import com.ruoyi.common.core.domain.BaseAudit; -import lombok.Data; -/** - * 出库单详情 DTO 对象 - * - * @author zcc - */ -@Data -public class ShipmentOrderDetailDTO extends BaseAudit { - private Long id; - private Long shipmentOrderId; - private Long itemId; - private BigDecimal planQuantity; - private BigDecimal realQuantity; - private Long rackId; - private String remark; - private Long warehouseId; - private Long areaId; - private Integer shipmentOrderStatus; - private LocalDateTime productionDate; - private LocalDateTime expiryDate; - private String batch; -} diff --git a/wms/src/main/java/com/cyl/wms/pojo/dto/SupplierDTO.java b/wms/src/main/java/com/cyl/wms/pojo/dto/SupplierDTO.java deleted file mode 100644 index a50b79f..0000000 --- a/wms/src/main/java/com/cyl/wms/pojo/dto/SupplierDTO.java +++ /dev/null @@ -1,28 +0,0 @@ -package com.cyl.wms.pojo.dto; - -import com.ruoyi.common.core.domain.BaseAudit; -import lombok.Data; - -import java.math.BigDecimal; - -/** - * 供应商 DTO 对象 - * - * @author zcc - */ -@Data -public class SupplierDTO extends BaseAudit { - private Long id; - private String supplierNo; - private String supplierName; - private String bankName; - private String bankAccount; - private BigDecimal payableAmount; - private String address; - private String mobileNo; - private String telNo; - private String contact; - private String level; - private String email; - private String remark; -} diff --git a/wms/src/main/java/com/cyl/wms/pojo/dto/SupplierTransactionDTO.java b/wms/src/main/java/com/cyl/wms/pojo/dto/SupplierTransactionDTO.java deleted file mode 100644 index 4ea7a70..0000000 --- a/wms/src/main/java/com/cyl/wms/pojo/dto/SupplierTransactionDTO.java +++ /dev/null @@ -1,24 +0,0 @@ -package com.cyl.wms.pojo.dto; - -import java.math.BigDecimal; -import java.time.LocalDateTime; -import lombok.Data; -/** - * 供应商账户流水 DTO 对象 - * - * @author zcc - */ -@Data -public class SupplierTransactionDTO { - private Integer id; - private String transactionCode; - private String supplierId; - private String transactionType; - private BigDecimal transactionAmount; - private BigDecimal previousBalance; - private BigDecimal currentBalance; - private Long receiptOrderId; - private String remark; - private LocalDateTime createTime; - private LocalDateTime updateTime; -} diff --git a/wms/src/main/java/com/cyl/wms/pojo/dto/WarehouseDTO.java b/wms/src/main/java/com/cyl/wms/pojo/dto/WarehouseDTO.java deleted file mode 100644 index ad9cd64..0000000 --- a/wms/src/main/java/com/cyl/wms/pojo/dto/WarehouseDTO.java +++ /dev/null @@ -1,16 +0,0 @@ -package com.cyl.wms.pojo.dto; - -import com.ruoyi.common.core.domain.BaseAudit; -import lombok.Data; -/** - * 仓库 DTO 对象 - * - * @author zcc - */ -@Data -public class WarehouseDTO extends BaseAudit { - private Long id; - private String warehouseNo; - private String warehouseName; - private String remark; -} diff --git a/wms/src/main/java/com/cyl/wms/pojo/dto/WaveDTO.java b/wms/src/main/java/com/cyl/wms/pojo/dto/WaveDTO.java deleted file mode 100644 index 56805b7..0000000 --- a/wms/src/main/java/com/cyl/wms/pojo/dto/WaveDTO.java +++ /dev/null @@ -1,16 +0,0 @@ -package com.cyl.wms.pojo.dto; - -import com.ruoyi.common.core.domain.BaseAudit; -import lombok.Data; -/** - * 波次 DTO 对象 - * - * @author zhangcheng - */ -@Data -public class WaveDTO extends BaseAudit { - private Long id; - private String waveNo; - private String status; - private String remark; -} diff --git a/wms/src/main/java/com/cyl/wms/pojo/query/AreaQuery.java b/wms/src/main/java/com/cyl/wms/pojo/query/AreaQuery.java deleted file mode 100644 index 10e9313..0000000 --- a/wms/src/main/java/com/cyl/wms/pojo/query/AreaQuery.java +++ /dev/null @@ -1,24 +0,0 @@ -package com.cyl.wms.pojo.query; - -import lombok.Data; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; - -/** - * 货区 查询 对象 - * - * @author zcc - */ -@ApiModel(description="货区 查询 对象") -@Data -public class AreaQuery { - @ApiModelProperty("货区编号 精确匹配") - private String areaNo; - - @ApiModelProperty("货区名称 精确匹配") - private String areaNameLike; - - @ApiModelProperty("所属仓库ID 精确匹配") - private Long warehouseId; - -} diff --git a/wms/src/main/java/com/cyl/wms/pojo/query/CarrierQuery.java b/wms/src/main/java/com/cyl/wms/pojo/query/CarrierQuery.java deleted file mode 100644 index b21e24e..0000000 --- a/wms/src/main/java/com/cyl/wms/pojo/query/CarrierQuery.java +++ /dev/null @@ -1,39 +0,0 @@ -package com.cyl.wms.pojo.query; - -import lombok.Data; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; - -/** - * 承运商 查询 对象 - * - * @author zcc - */ -@ApiModel(description="承运商 查询 对象") -@Data -public class CarrierQuery { - @ApiModelProperty("承运商编号 精确匹配") - private String carrierNo; - - @ApiModelProperty("承运商名称 精确匹配") - private String carrierNameLike; - - @ApiModelProperty("承运商地址 精确匹配") - private String address; - - @ApiModelProperty("手机号 精确匹配") - private String mobile; - - @ApiModelProperty("座机号 精确匹配") - private String tel; - - @ApiModelProperty("联系人 精确匹配") - private String contact; - - @ApiModelProperty("级别 精确匹配") - private String level; - - @ApiModelProperty("Email 精确匹配") - private String email; - -} diff --git a/wms/src/main/java/com/cyl/wms/pojo/query/CustomerQuery.java b/wms/src/main/java/com/cyl/wms/pojo/query/CustomerQuery.java deleted file mode 100644 index 15d3f61..0000000 --- a/wms/src/main/java/com/cyl/wms/pojo/query/CustomerQuery.java +++ /dev/null @@ -1,39 +0,0 @@ -package com.cyl.wms.pojo.query; - -import lombok.Data; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; - -/** - * 客户 查询 对象 - * - * @author zcc - */ -@ApiModel(description="客户 查询 对象") -@Data -public class CustomerQuery { - @ApiModelProperty("客户编号 精确匹配") - private String customerNo; - - @ApiModelProperty("客户名称 精确匹配") - private String customerNameLike; - - @ApiModelProperty("客户地址 精确匹配") - private String address; - - @ApiModelProperty("手机号 精确匹配") - private String mobile; - - @ApiModelProperty("座机号 精确匹配") - private String tel; - - @ApiModelProperty("联系人 精确匹配") - private String customerPerson; - - @ApiModelProperty("级别 精确匹配") - private String customerLevel; - - @ApiModelProperty("Email 精确匹配") - private String email; - -} diff --git a/wms/src/main/java/com/cyl/wms/pojo/query/CustomerShipmentStatQuery.java b/wms/src/main/java/com/cyl/wms/pojo/query/CustomerShipmentStatQuery.java deleted file mode 100644 index 17201a9..0000000 --- a/wms/src/main/java/com/cyl/wms/pojo/query/CustomerShipmentStatQuery.java +++ /dev/null @@ -1,11 +0,0 @@ -package com.cyl.wms.pojo.query; - -import lombok.Data; - -@Data -public class CustomerShipmentStatQuery { - private String beginTime; - private String endTime; - private Long customerId; - private Long itemTypeId; -} diff --git a/wms/src/main/java/com/cyl/wms/pojo/query/CustomerTransactionQuery.java b/wms/src/main/java/com/cyl/wms/pojo/query/CustomerTransactionQuery.java deleted file mode 100644 index 9434da6..0000000 --- a/wms/src/main/java/com/cyl/wms/pojo/query/CustomerTransactionQuery.java +++ /dev/null @@ -1,48 +0,0 @@ -package com.cyl.wms.pojo.query; - -import java.math.BigDecimal; -import java.time.LocalDateTime; - -import com.fasterxml.jackson.annotation.JsonFormat; -import lombok.Data; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; - -/** - * 客户账户流水 查询 对象 - * - * @author zcc - */ -@ApiModel(description="客户账户流水 查询 对象") -@Data -public class CustomerTransactionQuery { - @ApiModelProperty("交易编号 精确匹配") - private String transactionCode; - - @ApiModelProperty("用户编号 精确匹配") - private String customerId; - - @ApiModelProperty("交易类型 1:结款 2:应付 精确匹配") - private String transactionType; - - @ApiModelProperty("交易金额 精确匹配") - private BigDecimal transactionAmount; - - @ApiModelProperty("上期余额 精确匹配") - private BigDecimal previousBalance; - - @ApiModelProperty("当前余额 精确匹配") - private BigDecimal currentBalance; - - @ApiModelProperty("出库单号 精确匹配") - private Long shipmentOrderId; - - @ApiModelProperty("开始时间 精确匹配") - @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") - private LocalDateTime startTime; - - @ApiModelProperty("结束时间 精确匹配") - @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") - private LocalDateTime endTime; - -} diff --git a/wms/src/main/java/com/cyl/wms/pojo/query/DeliveryQuery.java b/wms/src/main/java/com/cyl/wms/pojo/query/DeliveryQuery.java deleted file mode 100644 index c622ddc..0000000 --- a/wms/src/main/java/com/cyl/wms/pojo/query/DeliveryQuery.java +++ /dev/null @@ -1,28 +0,0 @@ -package com.cyl.wms.pojo.query; - -import java.time.LocalDateTime; -import lombok.Data; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; - -/** - * 发货记录 查询 对象 - * - * @author zcc - */ -@ApiModel(description="发货记录 查询 对象") -@Data -public class DeliveryQuery { - @ApiModelProperty("出库单主表Id 精确匹配") - private Long shipmentOrderId; - - @ApiModelProperty("承运商Id 精确匹配") - private Long carrierId; - - @ApiModelProperty("发货日期 精确匹配") - private LocalDateTime deliveryDate; - - @ApiModelProperty("快递单号 精确匹配") - private String trackingNo; - -} diff --git a/wms/src/main/java/com/cyl/wms/pojo/query/InventoryCheckDetailQuery.java b/wms/src/main/java/com/cyl/wms/pojo/query/InventoryCheckDetailQuery.java deleted file mode 100644 index 798bae1..0000000 --- a/wms/src/main/java/com/cyl/wms/pojo/query/InventoryCheckDetailQuery.java +++ /dev/null @@ -1,37 +0,0 @@ -package com.cyl.wms.pojo.query; - -import java.math.BigDecimal; -import lombok.Data; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; - -/** - * 库存盘点单据详情 查询 对象 - * - * @author zcc - */ -@ApiModel(description="库存盘点单据详情 查询 对象") -@Data -public class InventoryCheckDetailQuery { - @ApiModelProperty("库存盘点单 精确匹配") - private Long inventoryCheckId; - - @ApiModelProperty("物料 精确匹配") - private Long itemId; - - @ApiModelProperty("库存数量 精确匹配") - private BigDecimal quantity; - - @ApiModelProperty("盘点数量 精确匹配") - private BigDecimal checkQuantity; - - @ApiModelProperty("所属仓库 精确匹配") - private Long warehouseId; - - @ApiModelProperty("所属库区 精确匹配") - private Long areaId; - - @ApiModelProperty("货架 精确匹配") - private Long rackId; - -} diff --git a/wms/src/main/java/com/cyl/wms/pojo/query/InventoryCheckQuery.java b/wms/src/main/java/com/cyl/wms/pojo/query/InventoryCheckQuery.java deleted file mode 100644 index 7b1fd0c..0000000 --- a/wms/src/main/java/com/cyl/wms/pojo/query/InventoryCheckQuery.java +++ /dev/null @@ -1,50 +0,0 @@ -package com.cyl.wms.pojo.query; - -import java.math.BigDecimal; -import java.time.LocalDateTime; -import lombok.Data; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; - -/** - * 库存盘点单据 查询 对象 - * - * @author zcc - */ -@ApiModel(description="库存盘点单据 查询 对象") -@Data -public class InventoryCheckQuery { - @ApiModelProperty("库存盘点单号,系统自动生成 精确匹配") - private String inventoryCheckNo; - - @ApiModelProperty("库存盘点类型 精确匹配") - private Integer inventoryCheckType; - - @ApiModelProperty("库存盘点单状态11:盘点中 22:已完成 精确匹配") - private Integer inventoryCheckStatus; - - @ApiModelProperty("盈亏数 精确匹配") - private BigDecimal inventoryCheckTotal; - - @ApiModelProperty("审核状态 精确匹配") - private Integer checkStatus; - - @ApiModelProperty("审核人 精确匹配") - private Long checkUserId; - - @ApiModelProperty("审核时间 精确匹配") - private LocalDateTime checkTime; - - @ApiModelProperty("所属仓库 精确匹配") - private Long warehouseId; - - @ApiModelProperty("所属库区 精确匹配") - private Long areaId; - - @ApiModelProperty("货架 精确匹配") - private Long rackId; - - @ApiModelProperty("附件文件 精确匹配") - private String attachment; - -} diff --git a/wms/src/main/java/com/cyl/wms/pojo/query/InventoryHistoryQuery.java b/wms/src/main/java/com/cyl/wms/pojo/query/InventoryHistoryQuery.java deleted file mode 100644 index 0060d21..0000000 --- a/wms/src/main/java/com/cyl/wms/pojo/query/InventoryHistoryQuery.java +++ /dev/null @@ -1,47 +0,0 @@ -package com.cyl.wms.pojo.query; - -import java.math.BigDecimal; -import lombok.Data; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; - -/** - * 库存记录 查询 对象 - * - * @author zcc - */ -@ApiModel(description="库存记录 查询 对象") -@Data -public class InventoryHistoryQuery { - @ApiModelProperty("操作id(出库、入库、库存移动表单id) 精确匹配") - private Long formId; - - @ApiModelProperty("操作类型 精确匹配") - private Integer formType; - - @ApiModelProperty("物料ID 精确匹配") - private Long itemId; - - @ApiModelProperty("货架id 精确匹配") - private Long warehouseId; - private Long areaId; - private Long rackId; - - @ApiModelProperty("库存变化 精确匹配") - private BigDecimal quantity; - - private String beginTime; - - private String endTime; - - /** - * 客户id - */ - private Long customerId; - - /** - * 供应商id - */ - private Long supplierId; - -} diff --git a/wms/src/main/java/com/cyl/wms/pojo/query/InventoryMovementDetailQuery.java b/wms/src/main/java/com/cyl/wms/pojo/query/InventoryMovementDetailQuery.java deleted file mode 100644 index 9207729..0000000 --- a/wms/src/main/java/com/cyl/wms/pojo/query/InventoryMovementDetailQuery.java +++ /dev/null @@ -1,49 +0,0 @@ -package com.cyl.wms.pojo.query; - -import java.math.BigDecimal; -import lombok.Data; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; - -/** - * 库存移动详情 查询 对象 - * - * @author zcc - */ -@ApiModel(description="库存移动详情 查询 对象") -@Data -public class InventoryMovementDetailQuery { - @ApiModelProperty("库存移动Id 精确匹配") - private Long inventoryMovementId; - - @ApiModelProperty("物料 精确匹配") - private Long itemId; - - @ApiModelProperty("计划数量 精确匹配") - private BigDecimal planQuantity; - - @ApiModelProperty("实际数量 精确匹配") - private BigDecimal realQuantity; - - @ApiModelProperty("源货架 精确匹配") - private Long sourceRackId; - - @ApiModelProperty("源仓库 精确匹配") - private Long sourceWarehouseId; - - @ApiModelProperty("源库区 精确匹配") - private Long sourceAreaId; - - @ApiModelProperty("移库状态 精确匹配") - private Integer moveStatus; - - @ApiModelProperty("目标货架 精确匹配") - private Long targetRackId; - - @ApiModelProperty("目标仓库 精确匹配") - private Long targetWarehouseId; - - @ApiModelProperty("目标库区 精确匹配") - private Long targetAreaId; - -} diff --git a/wms/src/main/java/com/cyl/wms/pojo/query/InventoryMovementQuery.java b/wms/src/main/java/com/cyl/wms/pojo/query/InventoryMovementQuery.java deleted file mode 100644 index 923ab05..0000000 --- a/wms/src/main/java/com/cyl/wms/pojo/query/InventoryMovementQuery.java +++ /dev/null @@ -1,21 +0,0 @@ -package com.cyl.wms.pojo.query; - -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; - -/** - * 库存移动 查询 对象 - * - * @author zcc - */ -@ApiModel(description="库存移动 查询 对象") -@Data -public class InventoryMovementQuery { - @ApiModelProperty("库存移动编号 精确匹配") - private String inventoryMovementNo; - - @ApiModelProperty("状态 精确匹配") - private Integer status; - -} diff --git a/wms/src/main/java/com/cyl/wms/pojo/query/InventoryPanelType.java b/wms/src/main/java/com/cyl/wms/pojo/query/InventoryPanelType.java deleted file mode 100644 index 9e2d170..0000000 --- a/wms/src/main/java/com/cyl/wms/pojo/query/InventoryPanelType.java +++ /dev/null @@ -1,14 +0,0 @@ -package com.cyl.wms.pojo.query; - -/* - * 库存看盘类型 - * */ -public interface InventoryPanelType { - // 仓库 - Long WAREHOUSE = 5L; - - Long AREA = 10L; - Long ITEMTYPE = 15L; - - Long ITEM = 20L; -} diff --git a/wms/src/main/java/com/cyl/wms/pojo/query/InventoryQuery.java b/wms/src/main/java/com/cyl/wms/pojo/query/InventoryQuery.java deleted file mode 100644 index 024ab51..0000000 --- a/wms/src/main/java/com/cyl/wms/pojo/query/InventoryQuery.java +++ /dev/null @@ -1,44 +0,0 @@ -package com.cyl.wms.pojo.query; - -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; - -import java.math.BigDecimal; -import java.util.List; - -/** - * 库存 查询 对象 - * - * @author zcc - */ -@ApiModel(description = "库存 查询 对象") -@Data -public class InventoryQuery implements InventoryPanelType { - @ApiModelProperty("物料ID 精确匹配") - private Long itemId; - - @ApiModelProperty("货架id 精确匹配") - private Long warehouseId; - - @ApiModelProperty("看板类型") - private Long panelType; - - @ApiModelProperty("区 id") - private Long areaId; - - @ApiModelProperty("货架 id") - private Long rackId; - - @ApiModelProperty("库存 起始值") - private BigDecimal quantityStart; - @ApiModelProperty("库存 结束值") - private BigDecimal quantityEnd; - @ApiModelProperty("批次") - private String batch; - @ApiModelProperty("物料名称") - private String itemName; - @ApiModelProperty("物料ids") - private List itemIds; - -} diff --git a/wms/src/main/java/com/cyl/wms/pojo/query/InventorySettlementDetailQuery.java b/wms/src/main/java/com/cyl/wms/pojo/query/InventorySettlementDetailQuery.java deleted file mode 100644 index a43fe7a..0000000 --- a/wms/src/main/java/com/cyl/wms/pojo/query/InventorySettlementDetailQuery.java +++ /dev/null @@ -1,79 +0,0 @@ -package com.cyl.wms.pojo.query; - -import com.fasterxml.jackson.annotation.JsonFormat; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; - -import java.math.BigDecimal; -import java.time.LocalDateTime; - -/** - * 库存结算明细 查询 对象 - * - * @author zcc - */ -@ApiModel(description="库存结算明细 查询 对象") -@Data -public class InventorySettlementDetailQuery { - @ApiModelProperty("结算单id 精确匹配") - private Long settlementId; - - @ApiModelProperty("结算类型,1:月结,2:年结 精确匹配") - private Integer settlementType; - - @ApiModelProperty("物料id 精确匹配") - private Long itemId; - - @ApiModelProperty("编号 精确匹配") - private String itemNo; - - @ApiModelProperty("名称 精确匹配") - private String itemNameLike; - - @ApiModelProperty("仓库id 精确匹配") - private Long warehouseId; - - @ApiModelProperty("仓库编号 精确匹配") - private String warehouseNo; - - @ApiModelProperty("仓库名称 精确匹配") - private String warehouseNameLike; - - @ApiModelProperty("库区id 精确匹配") - private Long areaId; - - @ApiModelProperty("库区编号 精确匹配") - private String areaNo; - - @ApiModelProperty("库区名称 精确匹配") - private String areaNameLike; - - @ApiModelProperty("上期结存 精确匹配") - private BigDecimal previousBalance; - - @ApiModelProperty("本期入库 精确匹配") - private BigDecimal currentEnter; - - @ApiModelProperty("本期出库 精确匹配") - private BigDecimal currentOut; - - @ApiModelProperty("本期盘点 精确匹配") - private BigDecimal currentCheck; - - @ApiModelProperty("本期结存 精确匹配") - private BigDecimal currentBalance; - - /** - * 开始时间 - */ - @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") - private LocalDateTime startTime; - - /** - * 结束时间 - */ - @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") - private LocalDateTime endTime; - -} diff --git a/wms/src/main/java/com/cyl/wms/pojo/query/InventorySettlementQuery.java b/wms/src/main/java/com/cyl/wms/pojo/query/InventorySettlementQuery.java deleted file mode 100644 index 9799e5a..0000000 --- a/wms/src/main/java/com/cyl/wms/pojo/query/InventorySettlementQuery.java +++ /dev/null @@ -1,24 +0,0 @@ -package com.cyl.wms.pojo.query; - -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; - -/** - * 库存结算单 查询 对象 - * - * @author zcc - */ -@ApiModel(description="库存结算单 查询 对象") -@Data -public class InventorySettlementQuery { - @ApiModelProperty("库存结算单状态11:结算中 22:已完成 精确匹配") - private Integer inventorySettlementStatus; - - @ApiModelProperty("结算类型,1:月结,2:年结 精确匹配") - private Integer settlementType; - - @ApiModelProperty("库存结算单号 精确匹配") - private String inventorySettlementNo; - -} diff --git a/wms/src/main/java/com/cyl/wms/pojo/query/ItemQuery.java b/wms/src/main/java/com/cyl/wms/pojo/query/ItemQuery.java deleted file mode 100644 index 3876947..0000000 --- a/wms/src/main/java/com/cyl/wms/pojo/query/ItemQuery.java +++ /dev/null @@ -1,49 +0,0 @@ -package com.cyl.wms.pojo.query; - -import java.math.BigDecimal; -import java.time.LocalDateTime; -import java.util.List; - -import lombok.Data; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; - -/** - * 物料 查询 对象 - * - * @author zcc - */ -@ApiModel(description="物料 查询 对象") -@Data -public class ItemQuery { - @ApiModelProperty("搜索内容") - private String search; - private List ids; - @ApiModelProperty("编号 精确匹配") - private String itemNo; - - @ApiModelProperty("名称 精确匹配") - private String itemNameLike; - - @ApiModelProperty("分类 精确匹配") - private String itemType; - - @ApiModelProperty("单位类别 精确匹配") - private String unit; - - @ApiModelProperty("所属货架 精确匹配") - private Long rackId; - - @ApiModelProperty("所属库区 精确匹配") - private Long areaId; - - @ApiModelProperty("所属仓库 精确匹配") - private Long warehouseId; - - @ApiModelProperty("安全库存 精确匹配") - private BigDecimal quantity; - - @ApiModelProperty("有效期 精确匹配") - private LocalDateTime expiryDate; - -} diff --git a/wms/src/main/java/com/cyl/wms/pojo/query/ItemTypeQuery.java b/wms/src/main/java/com/cyl/wms/pojo/query/ItemTypeQuery.java deleted file mode 100644 index 6226139..0000000 --- a/wms/src/main/java/com/cyl/wms/pojo/query/ItemTypeQuery.java +++ /dev/null @@ -1,30 +0,0 @@ -package com.cyl.wms.pojo.query; - -import lombok.Data; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; - -/** - * 物料类型表 查询 对象 - * - * @author zcc - */ -@ApiModel(description="物料类型表 查询 对象") -@Data -public class ItemTypeQuery { - @ApiModelProperty("父物料类型id 精确匹配") - private Long parentId; - - @ApiModelProperty("祖级列表 精确匹配") - private String ancestors; - - @ApiModelProperty("物料类型名称 精确匹配") - private String typeNameLike; - - @ApiModelProperty("显示顺序 精确匹配") - private Integer orderNum; - - @ApiModelProperty("物料类型状态(0正常 1停用) 精确匹配") - private String status; - -} diff --git a/wms/src/main/java/com/cyl/wms/pojo/query/RackQuery.java b/wms/src/main/java/com/cyl/wms/pojo/query/RackQuery.java deleted file mode 100644 index 1645d45..0000000 --- a/wms/src/main/java/com/cyl/wms/pojo/query/RackQuery.java +++ /dev/null @@ -1,27 +0,0 @@ -package com.cyl.wms.pojo.query; - -import lombok.Data; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; - -/** - * 货架 查询 对象 - * - * @author zcc - */ -@ApiModel(description="货架 查询 对象") -@Data -public class RackQuery { - @ApiModelProperty("货架编号 精确匹配") - private String rackNo; - - @ApiModelProperty("货架名称 精确匹配") - private String rackNameLike; - - @ApiModelProperty("所属货区 精确匹配") - private Long areaId; - - @ApiModelProperty("所属仓库 精确匹配") - private Long warehouseId; - -} diff --git a/wms/src/main/java/com/cyl/wms/pojo/query/ReceiptOrderDetailQuery.java b/wms/src/main/java/com/cyl/wms/pojo/query/ReceiptOrderDetailQuery.java deleted file mode 100644 index 4f90a3a..0000000 --- a/wms/src/main/java/com/cyl/wms/pojo/query/ReceiptOrderDetailQuery.java +++ /dev/null @@ -1,40 +0,0 @@ -package com.cyl.wms.pojo.query; - -import java.math.BigDecimal; -import lombok.Data; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; - -/** - * 入库单详情 查询 对象 - * - * @author zcc - */ -@ApiModel(description="入库单详情 查询 对象") -@Data -public class ReceiptOrderDetailQuery { - @ApiModelProperty("入库单号 精确匹配") - private Long receiptOrderId; - - @ApiModelProperty("物料 精确匹配") - private Long itemId; - - @ApiModelProperty("计划数量 精确匹配") - private BigDecimal planQuantity; - - @ApiModelProperty("实际数量 精确匹配") - private BigDecimal realQuantity; - - @ApiModelProperty("所属货架 精确匹配") - private Long rackId; - - @ApiModelProperty("所属仓库 精确匹配") - private Long warehouseId; - - @ApiModelProperty("所属库区 精确匹配") - private Long areaId; - - @ApiModelProperty("入库状态 精确匹配") - private Integer receiptOrderStatus; - -} diff --git a/wms/src/main/java/com/cyl/wms/pojo/query/ReceiptOrderQuery.java b/wms/src/main/java/com/cyl/wms/pojo/query/ReceiptOrderQuery.java deleted file mode 100644 index 5b1ceab..0000000 --- a/wms/src/main/java/com/cyl/wms/pojo/query/ReceiptOrderQuery.java +++ /dev/null @@ -1,30 +0,0 @@ -package com.cyl.wms.pojo.query; - -import lombok.Data; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; - -/** - * 入库单 查询 对象 - * - * @author zcc - */ -@ApiModel(description="入库单 查询 对象") -@Data -public class ReceiptOrderQuery { - @ApiModelProperty("入库单号 精确匹配") - private String receiptOrderNo; - - @ApiModelProperty("入库类型 精确匹配") - private Integer receiptOrderType; - - @ApiModelProperty("供应商 精确匹配") - private Long supplierId; - - @ApiModelProperty("订单号 精确匹配") - private String orderNo; - - @ApiModelProperty("入库状态 精确匹配") - private Integer receiptOrderStatus; - -} diff --git a/wms/src/main/java/com/cyl/wms/pojo/query/ShipmentOrderDetailQuery.java b/wms/src/main/java/com/cyl/wms/pojo/query/ShipmentOrderDetailQuery.java deleted file mode 100644 index 05c82ea..0000000 --- a/wms/src/main/java/com/cyl/wms/pojo/query/ShipmentOrderDetailQuery.java +++ /dev/null @@ -1,31 +0,0 @@ -package com.cyl.wms.pojo.query; - -import java.math.BigDecimal; -import lombok.Data; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; - -/** - * 出库单详情 查询 对象 - * - * @author zcc - */ -@ApiModel(description="出库单详情 查询 对象") -@Data -public class ShipmentOrderDetailQuery { - @ApiModelProperty("出库单 精确匹配") - private Long shipmentOrderId; - - @ApiModelProperty("物料 精确匹配") - private Long itemId; - - @ApiModelProperty("计划数量 精确匹配") - private BigDecimal planQuantity; - - @ApiModelProperty("实际数量 精确匹配") - private BigDecimal realQuantity; - - @ApiModelProperty("货架 精确匹配") - private Long rackId; - -} diff --git a/wms/src/main/java/com/cyl/wms/pojo/query/ShipmentOrderQuery.java b/wms/src/main/java/com/cyl/wms/pojo/query/ShipmentOrderQuery.java deleted file mode 100644 index e28305d..0000000 --- a/wms/src/main/java/com/cyl/wms/pojo/query/ShipmentOrderQuery.java +++ /dev/null @@ -1,31 +0,0 @@ -package com.cyl.wms.pojo.query; - -import java.time.LocalDateTime; -import lombok.Data; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; - -/** - * 出库单 查询 对象 - * - * @author zcc - */ -@ApiModel(description="出库单 查询 对象") -@Data -public class ShipmentOrderQuery { - @ApiModelProperty("出库单号,系统自动生成 精确匹配") - private String shipmentOrderNo; - - @ApiModelProperty("出库类型 精确匹配") - private Integer shipmentOrderType; - - @ApiModelProperty("出库订单 精确匹配") - private String orderNo; - - @ApiModelProperty("客户 精确匹配") - private Long customerId; - - @ApiModelProperty("出库单状态 精确匹配") - private Integer shipmentOrderStatus; - -} diff --git a/wms/src/main/java/com/cyl/wms/pojo/query/SupplierQuery.java b/wms/src/main/java/com/cyl/wms/pojo/query/SupplierQuery.java deleted file mode 100644 index 5c5a232..0000000 --- a/wms/src/main/java/com/cyl/wms/pojo/query/SupplierQuery.java +++ /dev/null @@ -1,39 +0,0 @@ -package com.cyl.wms.pojo.query; - -import lombok.Data; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; - -/** - * 供应商 查询 对象 - * - * @author zcc - */ -@ApiModel(description="供应商 查询 对象") -@Data -public class SupplierQuery { - @ApiModelProperty("供应商编号 精确匹配") - private String supplierNo; - - @ApiModelProperty("供应商名称 精确匹配") - private String supplierNameLike; - - @ApiModelProperty("供应商地址 精确匹配") - private String address; - - @ApiModelProperty("手机号 精确匹配") - private String mobileNo; - - @ApiModelProperty("座机号 精确匹配") - private String telNo; - - @ApiModelProperty("联系人 精确匹配") - private String contact; - - @ApiModelProperty("级别 精确匹配") - private String level; - - @ApiModelProperty("Email 精确匹配") - private String email; - -} diff --git a/wms/src/main/java/com/cyl/wms/pojo/query/SupplierTransactionQuery.java b/wms/src/main/java/com/cyl/wms/pojo/query/SupplierTransactionQuery.java deleted file mode 100644 index c37a415..0000000 --- a/wms/src/main/java/com/cyl/wms/pojo/query/SupplierTransactionQuery.java +++ /dev/null @@ -1,48 +0,0 @@ -package com.cyl.wms.pojo.query; - -import java.math.BigDecimal; -import java.time.LocalDateTime; - -import com.fasterxml.jackson.annotation.JsonFormat; -import lombok.Data; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; - -/** - * 供应商账户流水 查询 对象 - * - * @author zcc - */ -@ApiModel(description="供应商账户流水 查询 对象") -@Data -public class SupplierTransactionQuery { - @ApiModelProperty("交易编号 精确匹配") - private String transactionCode; - - @ApiModelProperty("供应商编号 精确匹配") - private String supplierId; - - @ApiModelProperty("交易类型 1:结款 2:应付 精确匹配") - private String transactionType; - - @ApiModelProperty("交易金额 精确匹配") - private BigDecimal transactionAmount; - - @ApiModelProperty("上期余额 精确匹配") - private BigDecimal previousBalance; - - @ApiModelProperty("当前余额 精确匹配") - private BigDecimal currentBalance; - - @ApiModelProperty("入库单号 精确匹配") - private Long receiptOrderId; - - @ApiModelProperty("开始时间 精确匹配") - @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") - private LocalDateTime startTime; - - @ApiModelProperty("结束时间 精确匹配") - @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") - private LocalDateTime endTime; - -} diff --git a/wms/src/main/java/com/cyl/wms/pojo/query/WarehouseQuery.java b/wms/src/main/java/com/cyl/wms/pojo/query/WarehouseQuery.java deleted file mode 100644 index da2c616..0000000 --- a/wms/src/main/java/com/cyl/wms/pojo/query/WarehouseQuery.java +++ /dev/null @@ -1,21 +0,0 @@ -package com.cyl.wms.pojo.query; - -import lombok.Data; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; - -/** - * 仓库 查询 对象 - * - * @author zcc - */ -@ApiModel(description="仓库 查询 对象") -@Data -public class WarehouseQuery { - @ApiModelProperty("仓库编号 精确匹配") - private String warehouseNo; - - @ApiModelProperty("仓库名称 精确匹配") - private String warehouseNameLike; - -} diff --git a/wms/src/main/java/com/cyl/wms/pojo/query/WaveQuery.java b/wms/src/main/java/com/cyl/wms/pojo/query/WaveQuery.java deleted file mode 100644 index 23386f2..0000000 --- a/wms/src/main/java/com/cyl/wms/pojo/query/WaveQuery.java +++ /dev/null @@ -1,21 +0,0 @@ -package com.cyl.wms.pojo.query; - -import lombok.Data; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; - -/** - * 波次 查询 对象 - * - * @author zhangcheng - */ -@ApiModel(description="波次 查询 对象") -@Data -public class WaveQuery { - @ApiModelProperty("波次号 精确匹配") - private String waveNo; - - @ApiModelProperty("状态 精确匹配") - private String status; - -} diff --git a/wms/src/main/java/com/cyl/wms/pojo/vo/AmountStatByItemTypeVO.java b/wms/src/main/java/com/cyl/wms/pojo/vo/AmountStatByItemTypeVO.java deleted file mode 100644 index bc56011..0000000 --- a/wms/src/main/java/com/cyl/wms/pojo/vo/AmountStatByItemTypeVO.java +++ /dev/null @@ -1,11 +0,0 @@ -package com.cyl.wms.pojo.vo; - -import lombok.Data; - -import java.math.BigDecimal; - -@Data -public class AmountStatByItemTypeVO { - private Long itemTypeId; - private BigDecimal amount; -} diff --git a/wms/src/main/java/com/cyl/wms/pojo/vo/AreaAndItemInfo.java b/wms/src/main/java/com/cyl/wms/pojo/vo/AreaAndItemInfo.java deleted file mode 100644 index 70505b1..0000000 --- a/wms/src/main/java/com/cyl/wms/pojo/vo/AreaAndItemInfo.java +++ /dev/null @@ -1,38 +0,0 @@ -package com.cyl.wms.pojo.vo; - -import java.math.BigDecimal; - -public interface AreaAndItemInfo extends PlaceAndItem { - void setItemName(String name); - - void setWarehouseName(String name); - - void setAreaName(String name); - - void setRackName(String name); - - void setItemNo(String name); - - - default void setItemUnit(String unit){} - - default void setItemUnitPrice(String money) {} - - default void setItemSpecification(String specification) {} - - default void setItemFactory(String factory){} - - default void setName(String name){} - - default void setOrderId(String orderId){} - - default void setItemDelFlag(Integer delFlag) { - - } - - default void setWarehouseDelFlag(Integer delFlag) { - - } - - default void setSafetyQuantity(BigDecimal safetyQuantity) {} -} diff --git a/wms/src/main/java/com/cyl/wms/pojo/vo/AreaVO.java b/wms/src/main/java/com/cyl/wms/pojo/vo/AreaVO.java deleted file mode 100644 index 97ff2cd..0000000 --- a/wms/src/main/java/com/cyl/wms/pojo/vo/AreaVO.java +++ /dev/null @@ -1,28 +0,0 @@ -package com.cyl.wms.pojo.vo; - -import com.ruoyi.common.annotation.Excel; -import com.fasterxml.jackson.annotation.JsonFormat; -import com.ruoyi.common.core.domain.BaseAudit; -import lombok.Data; -/** - * 货区 数据视图对象 - * - * @author zcc - */ -@Data -public class AreaVO extends BaseAudit { - /** ID */ - private Long id; - /** 货区编号 */ - @Excel(name = "货区编号") - private String areaNo; - /** 货区名称 */ - @Excel(name = "货区名称") - private String areaName; - /** 所属仓库ID */ - @Excel(name = "所属仓库ID") - private Long warehouseId; - /** 备注 */ - @Excel(name = "备注") - private String remark; -} diff --git a/wms/src/main/java/com/cyl/wms/pojo/vo/CarrierVO.java b/wms/src/main/java/com/cyl/wms/pojo/vo/CarrierVO.java deleted file mode 100644 index b9b8c0c..0000000 --- a/wms/src/main/java/com/cyl/wms/pojo/vo/CarrierVO.java +++ /dev/null @@ -1,43 +0,0 @@ -package com.cyl.wms.pojo.vo; - -import com.ruoyi.common.annotation.Excel; -import com.fasterxml.jackson.annotation.JsonFormat; -import com.ruoyi.common.core.domain.BaseAudit; -import lombok.Data; -/** - * 承运商 数据视图对象 - * - * @author zcc - */ -@Data -public class CarrierVO extends BaseAudit { - /** ID */ - private Long id; - /** 承运商编号 */ - @Excel(name = "承运商编号") - private String carrierNo; - /** 承运商名称 */ - @Excel(name = "承运商名称") - private String carrierName; - /** 承运商地址 */ - @Excel(name = "承运商地址") - private String address; - /** 手机号 */ - @Excel(name = "手机号") - private String mobile; - /** 座机号 */ - @Excel(name = "座机号") - private String tel; - /** 联系人 */ - @Excel(name = "联系人") - private String contact; - /** 级别 */ - @Excel(name = "级别") - private String level; - /** Email */ - @Excel(name = "Email") - private String email; - /** 备注 */ - @Excel(name = "备注") - private String remark; -} diff --git a/wms/src/main/java/com/cyl/wms/pojo/vo/CustomerShipmentStatVO.java b/wms/src/main/java/com/cyl/wms/pojo/vo/CustomerShipmentStatVO.java deleted file mode 100644 index 1a58801..0000000 --- a/wms/src/main/java/com/cyl/wms/pojo/vo/CustomerShipmentStatVO.java +++ /dev/null @@ -1,15 +0,0 @@ -package com.cyl.wms.pojo.vo; - -import lombok.Data; - -import java.math.BigDecimal; -import java.util.List; - -@Data -public class CustomerShipmentStatVO { - private Long customerId; - private String customerName; - private List data; - private BigDecimal total; - //查询出customerId customerName amount type -} diff --git a/wms/src/main/java/com/cyl/wms/pojo/vo/CustomerTransactionVO.java b/wms/src/main/java/com/cyl/wms/pojo/vo/CustomerTransactionVO.java deleted file mode 100644 index b9c7522..0000000 --- a/wms/src/main/java/com/cyl/wms/pojo/vo/CustomerTransactionVO.java +++ /dev/null @@ -1,45 +0,0 @@ -package com.cyl.wms.pojo.vo; - -import java.math.BigDecimal; -import java.time.LocalDateTime; -import com.ruoyi.common.annotation.Excel; -import com.fasterxml.jackson.annotation.JsonFormat; -import lombok.Data; -/** - * 客户账户流水 数据视图对象 - * - * @author zcc - */ -@Data -public class CustomerTransactionVO { - /** id */ - private Integer id; - /** 交易编号 */ - @Excel(name = "交易编号") - private String transactionCode; - /** 用户编号 */ - @Excel(name = "用户编号") - private String customerId; - /** 交易类型 1:结款 2:应付 */ - @Excel(name = "交易类型 1:结款 2:应付 ") - private String transactionType; - /** 交易金额 */ - @Excel(name = "交易金额") - private BigDecimal transactionAmount; - /** 上期余额 */ - @Excel(name = "上期余额") - private BigDecimal previousBalance; - /** 当前余额 */ - @Excel(name = "当前余额") - private BigDecimal currentBalance; - /** 出库单号 */ - @Excel(name = "出库单号") - private Long shipmentOrderId; - /** 备注 */ - @Excel(name = "备注") - private String remark; - /** 创建时间 */ - private LocalDateTime createTime; - /** 更新时间 */ - private LocalDateTime updateTime; -} diff --git a/wms/src/main/java/com/cyl/wms/pojo/vo/CustomerVO.java b/wms/src/main/java/com/cyl/wms/pojo/vo/CustomerVO.java deleted file mode 100644 index 0557249..0000000 --- a/wms/src/main/java/com/cyl/wms/pojo/vo/CustomerVO.java +++ /dev/null @@ -1,43 +0,0 @@ -package com.cyl.wms.pojo.vo; - -import com.ruoyi.common.annotation.Excel; -import com.fasterxml.jackson.annotation.JsonFormat; -import com.ruoyi.common.core.domain.BaseAudit; -import lombok.Data; -/** - * 客户 数据视图对象 - * - * @author zcc - */ -@Data -public class CustomerVO extends BaseAudit { - /** ID */ - private Long id; - /** 客户编号 */ - @Excel(name = "客户编号") - private String customerNo; - /** 客户名称 */ - @Excel(name = "客户名称") - private String customerName; - /** 客户地址 */ - @Excel(name = "客户地址") - private String address; - /** 手机号 */ - @Excel(name = "手机号") - private String mobile; - /** 座机号 */ - @Excel(name = "座机号") - private String tel; - /** 联系人 */ - @Excel(name = "联系人") - private String customerPerson; - /** 级别 */ - @Excel(name = "级别") - private String customerLevel; - /** Email */ - @Excel(name = "Email") - private String email; - /** 备注 */ - @Excel(name = "备注") - private String remark; -} diff --git a/wms/src/main/java/com/cyl/wms/pojo/vo/DeliveryVO.java b/wms/src/main/java/com/cyl/wms/pojo/vo/DeliveryVO.java deleted file mode 100644 index eb5173f..0000000 --- a/wms/src/main/java/com/cyl/wms/pojo/vo/DeliveryVO.java +++ /dev/null @@ -1,33 +0,0 @@ -package com.cyl.wms.pojo.vo; - -import java.time.LocalDateTime; -import com.ruoyi.common.annotation.Excel; -import com.fasterxml.jackson.annotation.JsonFormat; -import com.ruoyi.common.core.domain.BaseAudit; -import lombok.Data; -/** - * 发货记录 数据视图对象 - * - * @author zcc - */ -@Data -public class DeliveryVO extends BaseAudit { - /** ID */ - private Long id; - /** 出库单主表Id */ - @Excel(name = "出库单主表Id") - private Long shipmentOrderId; - /** 承运商Id */ - @Excel(name = "承运商Id") - private Long carrierId; - /** 发货日期 */ - @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") - @Excel(name = "发货日期", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss") - private LocalDateTime deliveryDate; - /** 快递单号 */ - @Excel(name = "快递单号") - private String trackingNo; - /** 备注 */ - @Excel(name = "备注") - private String remark; -} diff --git a/wms/src/main/java/com/cyl/wms/pojo/vo/InventoryCheckDetailVO.java b/wms/src/main/java/com/cyl/wms/pojo/vo/InventoryCheckDetailVO.java deleted file mode 100644 index 9f11da6..0000000 --- a/wms/src/main/java/com/cyl/wms/pojo/vo/InventoryCheckDetailVO.java +++ /dev/null @@ -1,44 +0,0 @@ -package com.cyl.wms.pojo.vo; - -import java.math.BigDecimal; -import java.util.List; - -import com.ruoyi.common.annotation.Excel; -import com.fasterxml.jackson.annotation.JsonFormat; -import com.ruoyi.common.core.domain.BaseAudit; -import lombok.Data; -/** - * 库存盘点单据详情 数据视图对象 - * - * @author zcc - */ -@Data -public class InventoryCheckDetailVO extends BaseAudit { - /** ID */ - private Long id; - /** 库存盘点单 */ - @Excel(name = "库存盘点单") - private Long inventoryCheckId; - /** 物料 */ - @Excel(name = "物料") - private Long itemId; - /** 库存数量 */ - @Excel(name = "库存数量") - private BigDecimal quantity; - /** 盘点数量 */ - @Excel(name = "盘点数量") - private BigDecimal checkQuantity; - /** 所属仓库 */ - @Excel(name = "所属仓库") - private Long warehouseId; - /** 所属库区 */ - @Excel(name = "所属库区") - private Long areaId; - /** 货架 */ - @Excel(name = "货架") - private Long rackId; - /** 备注 */ - @Excel(name = "备注") - private String remark; - private List place; -} diff --git a/wms/src/main/java/com/cyl/wms/pojo/vo/InventoryCheckVO.java b/wms/src/main/java/com/cyl/wms/pojo/vo/InventoryCheckVO.java deleted file mode 100644 index f112405..0000000 --- a/wms/src/main/java/com/cyl/wms/pojo/vo/InventoryCheckVO.java +++ /dev/null @@ -1,55 +0,0 @@ -package com.cyl.wms.pojo.vo; - -import java.math.BigDecimal; -import java.time.LocalDateTime; -import com.ruoyi.common.annotation.Excel; -import com.fasterxml.jackson.annotation.JsonFormat; -import com.ruoyi.common.core.domain.BaseAudit; -import lombok.Data; -/** - * 库存盘点单据 数据视图对象 - * - * @author zcc - */ -@Data -public class InventoryCheckVO extends BaseAudit { - /** ID */ - private Long id; - /** 库存盘点单号,系统自动生成 */ - @Excel(name = "库存盘点单号,系统自动生成") - private String inventoryCheckNo; - /** 库存盘点类型 */ - @Excel(name = "库存盘点类型") - private Integer inventoryCheckType; - /** 库存盘点单状态11:盘点中 22:已完成 */ - @Excel(name = "库存盘点单状态11:盘点中 22:已完成") - private Integer inventoryCheckStatus; - /** 盈亏数 */ - @Excel(name = "盈亏数") - private BigDecimal inventoryCheckTotal; - /** 审核状态 */ - @Excel(name = "审核状态") - private Integer checkStatus; - /** 审核人 */ - @Excel(name = "审核人") - private Long checkUserId; - /** 审核时间 */ - @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") - @Excel(name = "审核时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss") - private LocalDateTime checkTime; - /** 所属仓库 */ - @Excel(name = "所属仓库") - private Long warehouseId; - /** 所属库区 */ - @Excel(name = "所属库区") - private Long areaId; - /** 货架 */ - @Excel(name = "货架") - private Long rackId; - /** 附件文件 */ - @Excel(name = "附件文件") - private String attachment; - /** 备注 */ - @Excel(name = "备注") - private String remark; -} diff --git a/wms/src/main/java/com/cyl/wms/pojo/vo/InventoryHistoryVO.java b/wms/src/main/java/com/cyl/wms/pojo/vo/InventoryHistoryVO.java deleted file mode 100644 index d5efaea..0000000 --- a/wms/src/main/java/com/cyl/wms/pojo/vo/InventoryHistoryVO.java +++ /dev/null @@ -1,99 +0,0 @@ -package com.cyl.wms.pojo.vo; - -import com.ruoyi.common.annotation.Excel; -import com.ruoyi.common.core.domain.BaseAudit; -import lombok.Data; - -import java.math.BigDecimal; -import java.time.LocalDateTime; - -/** - * 库存记录 数据视图对象 - * - * @author zcc - */ -@Data -public class InventoryHistoryVO extends BaseAudit implements AreaAndItemInfo { - /** - * ID - */ - @Excel(name = "编号") - private Long id; - /** - * 操作id(出库、入库、库存移动表单id) - */ - private Long formId; - /** - * 操作类型 - */ - private Integer formType; - /** - * 操作类型名称 - */ - @Excel(name = "操作类型") - private String formTypeName; - /** - * 物料ID - */ - private Long itemId; - @Excel(name = "物料名称") - private String itemName; - @Excel(name = "物料编码") - private String itemNo; - /** - * 货架id - */ - private Long rackId; - private String rackName; - private Long warehouseId; - @Excel(name = "仓库名称") - private String warehouseName; - private Long areaId; - - @Excel(name = "库区名称") - private String areaName; - /** - * 库存变化 - */ - @Excel(name = "库存变化") - private BigDecimal quantity; - /** - * 备注 - */ - @Excel(name = "备注") - private String remark; - - private String itemUnit; - private String itemUnitPrice; - private String itemSpecification; - private String itemFactory; - private BigDecimal safetyQuantity; - /** - * 客户或供应商姓名 - */ - private String name; - /** - * 出入库单号 - */ - private String orderId; - - private String receiptOrderNo; - private String shipmentOrderNo; - private String customerName; - private String supplierName; - - /** - * 生产日期 - */ - private LocalDateTime productionDate; - - /** - * 有效期 - */ - private LocalDateTime expiryDate; - - /** - * 批次 - */ - private String batch; -} diff --git a/wms/src/main/java/com/cyl/wms/pojo/vo/InventoryMovementDetailVO.java b/wms/src/main/java/com/cyl/wms/pojo/vo/InventoryMovementDetailVO.java deleted file mode 100644 index 12e3344..0000000 --- a/wms/src/main/java/com/cyl/wms/pojo/vo/InventoryMovementDetailVO.java +++ /dev/null @@ -1,87 +0,0 @@ -package com.cyl.wms.pojo.vo; - -import java.math.BigDecimal; -import java.util.List; - -import com.ruoyi.common.annotation.Excel; -import com.fasterxml.jackson.annotation.JsonFormat; -import com.ruoyi.common.core.domain.BaseAudit; -import lombok.Data; - -/** - * 库存移动详情 数据视图对象 - * - * @author zcc - */ -@Data -public class InventoryMovementDetailVO extends BaseAudit { - /** - * ID - */ - private Long id; - /** - * 库存移动Id - */ - @Excel(name = "库存移动Id") - private Long inventoryMovementId; - /** - * 物料 - */ - @Excel(name = "物料") - private Long itemId; - /** - * 计划数量 - */ - @Excel(name = "计划数量") - private BigDecimal planQuantity; - /** - * 实际数量 - */ - @Excel(name = "实际数量") - private BigDecimal realQuantity; - /** - * 备注 - */ - @Excel(name = "备注") - private String remark; - /** - * 源货架 - */ - @Excel(name = "源货架") - private Long sourceRackId; - /** - * 源仓库 - */ - @Excel(name = "源仓库") - private Long sourceWarehouseId; - /** - * 源库区 - */ - @Excel(name = "源库区") - private Long sourceAreaId; - /** - * 移库状态 - */ - @Excel(name = "移库状态") - private Integer moveStatus; - /** - * 目标货架 - */ - @Excel(name = "目标货架") - private Long targetRackId; - /** - * 目标仓库 - */ - @Excel(name = "目标仓库") - private Long targetWarehouseId; - /** - * 目标库区 - */ - @Excel(name = "目标库区") - private Long targetAreaId; - - private List sourcePlace; - private List targetPlace; - - private Integer delFlag; -} diff --git a/wms/src/main/java/com/cyl/wms/pojo/vo/InventoryMovementVO.java b/wms/src/main/java/com/cyl/wms/pojo/vo/InventoryMovementVO.java deleted file mode 100644 index b4c1d3e..0000000 --- a/wms/src/main/java/com/cyl/wms/pojo/vo/InventoryMovementVO.java +++ /dev/null @@ -1,64 +0,0 @@ -package com.cyl.wms.pojo.vo; - -import java.time.LocalDateTime; - -import com.ruoyi.common.annotation.Excel; -import com.fasterxml.jackson.annotation.JsonFormat; -import com.ruoyi.common.core.domain.BaseAudit; -import lombok.Data; - -/** - * 库存移动 数据视图对象 - * - * @author zcc - */ -@Data -public class InventoryMovementVO extends BaseAudit { - /** - * ID - */ - private Long id; - /** - * 库存移动编号 - */ - @Excel(name = "库存移动编号") - private String inventoryMovementNo; - /** - * 原货架Id - */ - @Excel(name = "原货架Id") - private Long sourceRackId; - /** - * 目标货架 - */ - @Excel(name = "目标货架") - private Long targetRackId; - /** - * 状态 - */ - @Excel(name = "状态") - private Integer status; - /** - * 审核状态 - */ - @Excel(name = "审核状态") - private Integer checkStatus; - /** - * 审核人 - */ - @Excel(name = "审核人") - private Long checkUserId; - /** - * 审核时间 - */ - @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") - @Excel(name = "审核时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss") - private LocalDateTime checkTime; - /** - * 备注 - */ - @Excel(name = "备注") - private String remark; - private Integer detailCount; - private Integer itemCount; -} diff --git a/wms/src/main/java/com/cyl/wms/pojo/vo/InventorySettlementDetailVO.java b/wms/src/main/java/com/cyl/wms/pojo/vo/InventorySettlementDetailVO.java deleted file mode 100644 index 8f2ce75..0000000 --- a/wms/src/main/java/com/cyl/wms/pojo/vo/InventorySettlementDetailVO.java +++ /dev/null @@ -1,68 +0,0 @@ -package com.cyl.wms.pojo.vo; - -import com.ruoyi.common.annotation.Excel; -import com.ruoyi.common.core.domain.BaseAudit; -import lombok.Data; - -import java.math.BigDecimal; -/** - * 库存结算明细 数据视图对象 - * - * @author zcc - */ -@Data -public class InventorySettlementDetailVO extends BaseAudit { - /** ID */ - private Long id; - /** 结算单id */ - @Excel(name = "结算单id") - private Long settlementId; - /** 结算类型,1:月结,2:年结 */ - @Excel(name = "结算类型,1:月结,2:年结") - private Integer settlementType; - /** 物料id */ - @Excel(name = "物料id") - private Long itemId; - /** 编号 */ - @Excel(name = "编号") - private String itemNo; - /** 名称 */ - @Excel(name = "名称") - private String itemName; - /** 仓库id */ - @Excel(name = "仓库id") - private Long warehouseId; - /** 仓库编号 */ - @Excel(name = "仓库编号") - private String warehouseNo; - /** 仓库名称 */ - @Excel(name = "仓库名称") - private String warehouseName; - /** 库区id */ - @Excel(name = "库区id") - private Long areaId; - /** 库区编号 */ - @Excel(name = "库区编号") - private String areaNo; - /** 库区名称 */ - @Excel(name = "库区名称") - private String areaName; - /** 上期结存 */ - @Excel(name = "上期结存") - private BigDecimal previousBalance; - /** 本期入库 */ - @Excel(name = "本期入库") - private BigDecimal currentEnter; - /** 本期出库 */ - @Excel(name = "本期出库") - private BigDecimal currentOut; - /** 本期盘点 */ - @Excel(name = "本期盘点") - private BigDecimal currentCheck; - /** 本期结存 */ - @Excel(name = "本期结存") - private BigDecimal currentBalance; - /** 备注 */ - @Excel(name = "备注") - private String remark; -} diff --git a/wms/src/main/java/com/cyl/wms/pojo/vo/InventorySettlementVO.java b/wms/src/main/java/com/cyl/wms/pojo/vo/InventorySettlementVO.java deleted file mode 100644 index 876b753..0000000 --- a/wms/src/main/java/com/cyl/wms/pojo/vo/InventorySettlementVO.java +++ /dev/null @@ -1,27 +0,0 @@ -package com.cyl.wms.pojo.vo; - -import com.ruoyi.common.annotation.Excel; -import com.ruoyi.common.core.domain.BaseAudit; -import lombok.Data; -/** - * 库存结算单 数据视图对象 - * - * @author zcc - */ -@Data -public class InventorySettlementVO extends BaseAudit { - /** ID */ - private Long id; - /** 库存结算单状态11:结算中 22:已完成 */ - @Excel(name = "库存结算单状态11:结算中 22:已完成") - private Integer inventorySettlementStatus; - /** 结算类型,1:月结,2:年结 */ - @Excel(name = "结算类型,1:月结,2:年结") - private Integer settlementType; - /** 备注 */ - @Excel(name = "备注") - private String remark; - /** 库存结算单号 */ - @Excel(name = "库存结算单号") - private String inventorySettlementNo; -} diff --git a/wms/src/main/java/com/cyl/wms/pojo/vo/InventoryVO.java b/wms/src/main/java/com/cyl/wms/pojo/vo/InventoryVO.java deleted file mode 100644 index b679c21..0000000 --- a/wms/src/main/java/com/cyl/wms/pojo/vo/InventoryVO.java +++ /dev/null @@ -1,93 +0,0 @@ -package com.cyl.wms.pojo.vo; - -import com.fasterxml.jackson.annotation.JsonFormat; -import com.ruoyi.common.annotation.Excel; -import com.ruoyi.common.core.domain.BaseAudit; -import lombok.Data; - -import java.math.BigDecimal; -import java.time.LocalDateTime; - -/** - * 库存 数据视图对象 - * - * @author zcc - */ -@Data -public class InventoryVO extends BaseAudit implements AreaAndItemInfo { - /** - * ID - */ - private Long id; - /** - * 物料ID - */ - private Long itemId; - // 物料编号 - @Excel(name = "物料编码") - private String itemNo; - // 物料名称 - @Excel(name = "物料名称") - private String itemName; - // 物料类型 - @Excel(name = "物料类型") - private String itemTypeName; - /** - * 货架id - */ - private Long rackId; - // 货架 名称 - private String rackName; - private Long warehouseId; - // 仓库 名称 - @Excel(name = "仓库") - private String warehouseName; - private Long areaId; - // 库区 名称 - @Excel(name = "库区") - private String areaName; - /** - * 库存 - */ - @Excel(name = "库存") - private BigDecimal quantity; - /** - * 备注 - */ - @Excel(name = "备注") - private String remark; - private BigDecimal safetyQuantity; - - /** - * 物料删除标识 - */ - private Integer itemDelFlag; - - /** - * 仓库删除标识 - */ - private Integer warehouseDelFlag; - - /** - * 生产日期 - */ - @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") - private LocalDateTime productionDate; - - /** - * 有效期 - */ - @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") - private LocalDateTime expiryDate; - - /** - * 批次 - */ - private String batch; - - private String itemUnit; - - private String itemSpecification; - - private String itemUnitPrice; -} diff --git a/wms/src/main/java/com/cyl/wms/pojo/vo/ItemTypeVO.java b/wms/src/main/java/com/cyl/wms/pojo/vo/ItemTypeVO.java deleted file mode 100644 index 261233c..0000000 --- a/wms/src/main/java/com/cyl/wms/pojo/vo/ItemTypeVO.java +++ /dev/null @@ -1,31 +0,0 @@ -package com.cyl.wms.pojo.vo; - -import com.ruoyi.common.annotation.Excel; -import com.fasterxml.jackson.annotation.JsonFormat; -import com.ruoyi.common.core.domain.BaseAudit; -import lombok.Data; -/** - * 物料类型表 数据视图对象 - * - * @author zcc - */ -@Data -public class ItemTypeVO extends BaseAudit { - /** 物料类型id */ - private Long itemTypeId; - /** 父物料类型id */ - @Excel(name = "父物料类型id") - private Long parentId; - /** 祖级列表 */ - @Excel(name = "祖级列表") - private String ancestors; - /** 物料类型名称 */ - @Excel(name = "物料类型名称") - private String typeName; - /** 显示顺序 */ - @Excel(name = "显示顺序") - private Integer orderNum; - /** 物料类型状态(0正常 1停用) */ - @Excel(name = "物料类型状态", readConverterExp = "0=正常,1=停用") - private String status; -} diff --git a/wms/src/main/java/com/cyl/wms/pojo/vo/ItemVO.java b/wms/src/main/java/com/cyl/wms/pojo/vo/ItemVO.java deleted file mode 100644 index 994e982..0000000 --- a/wms/src/main/java/com/cyl/wms/pojo/vo/ItemVO.java +++ /dev/null @@ -1,74 +0,0 @@ -package com.cyl.wms.pojo.vo; - -import java.math.BigDecimal; -import java.time.LocalDateTime; -import java.util.List; - -import com.ruoyi.common.annotation.Excel; -import com.fasterxml.jackson.annotation.JsonFormat; -import com.ruoyi.common.core.domain.BaseAudit; -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; -/** - * 物料 数据视图对象 - * - * @author zcc - */ -@Data -public class ItemVO extends BaseAudit { - /** ID */ - private Long id; - /** 编号 */ - @Excel(name = "编号") - private String itemNo; - /** 名称 */ - @Excel(name = "名称") - private String itemName; - /** 分类 */ - private String itemType; - /** - * 所属类别 - */ - @Excel(name = "所属类别") - private String itemTypeName; - /** 单位类别 */ - @Excel(name = "单位类别") - private String unit; - /** 所属货架 */ - private Long rackId; - /** 所属库区 */ - private Long areaId; - /** 所属仓库名称 */ - @Excel(name = "所属仓库") - private String warehouseName; - /** 所属库区名称 */ - @Excel(name = "所属库区") - private String areaName; - /** 所属仓库 */ - private Long warehouseId; - /** 安全库存 */ - @Excel(name = "安全库存") - private BigDecimal quantity; - /** 有效期 */ - @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") - @Excel(name = "有效期", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss") - private LocalDateTime expiryDate; - /** 备注 */ - @Excel(name = "备注") - private String remark; - private List place; - private Integer delFlag; - - @Excel(name = "规格") - private String specification; - - @Excel(name = "单价") - private BigDecimal unitPrice; - - @Excel(name = "生产日期") - @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") - private LocalDateTime productionDate; - - @Excel(name = "批次") - private String batch; -} diff --git a/wms/src/main/java/com/cyl/wms/pojo/vo/PlaceAndItem.java b/wms/src/main/java/com/cyl/wms/pojo/vo/PlaceAndItem.java deleted file mode 100644 index dd771d6..0000000 --- a/wms/src/main/java/com/cyl/wms/pojo/vo/PlaceAndItem.java +++ /dev/null @@ -1,13 +0,0 @@ -package com.cyl.wms.pojo.vo; - -public interface PlaceAndItem { - Long getItemId(); - - Long getWarehouseId(); - - Long getAreaId(); - - Long getRackId(); - - String getBatch(); -} diff --git a/wms/src/main/java/com/cyl/wms/pojo/vo/RackVO.java b/wms/src/main/java/com/cyl/wms/pojo/vo/RackVO.java deleted file mode 100644 index 6969073..0000000 --- a/wms/src/main/java/com/cyl/wms/pojo/vo/RackVO.java +++ /dev/null @@ -1,31 +0,0 @@ -package com.cyl.wms.pojo.vo; - -import com.ruoyi.common.annotation.Excel; -import com.fasterxml.jackson.annotation.JsonFormat; -import com.ruoyi.common.core.domain.BaseAudit; -import lombok.Data; -/** - * 货架 数据视图对象 - * - * @author zcc - */ -@Data -public class RackVO extends BaseAudit { - /** ID */ - private Long id; - /** 货架编号 */ - @Excel(name = "货架编号") - private String rackNo; - /** 货架名称 */ - @Excel(name = "货架名称") - private String rackName; - /** 所属货区 */ - @Excel(name = "所属货区") - private Long areaId; - /** 所属仓库 */ - @Excel(name = "所属仓库") - private Long warehouseId; - /** 备注 */ - @Excel(name = "备注") - private String remark; -} diff --git a/wms/src/main/java/com/cyl/wms/pojo/vo/ReceiptOrderDetailVO.java b/wms/src/main/java/com/cyl/wms/pojo/vo/ReceiptOrderDetailVO.java deleted file mode 100644 index 3cf53de..0000000 --- a/wms/src/main/java/com/cyl/wms/pojo/vo/ReceiptOrderDetailVO.java +++ /dev/null @@ -1,73 +0,0 @@ -package com.cyl.wms.pojo.vo; - -import java.math.BigDecimal; -import java.time.LocalDateTime; -import java.util.List; - -import com.ruoyi.common.annotation.Excel; -import com.fasterxml.jackson.annotation.JsonFormat; -import com.ruoyi.common.core.domain.BaseAudit; -import lombok.Data; -import org.springframework.format.annotation.DateTimeFormat; - -/** - * 入库单详情 数据视图对象 - * - * @author zcc - */ -@Data -public class ReceiptOrderDetailVO extends BaseAudit { - /** ID */ - private Long id; - /** 入库单号 */ - @Excel(name = "入库单号") - private Long receiptOrderId; - /** 物料 */ - @Excel(name = "物料") - private Long itemId; - /** 计划数量 */ - @Excel(name = "计划数量") - private BigDecimal planQuantity; - /** 实际数量 */ - @Excel(name = "实际数量") - private BigDecimal realQuantity; - /** 所属货架 */ - @Excel(name = "所属货架") - private Long rackId; - @Excel(name = "金额") - private BigDecimal money; - /** 备注 */ - @Excel(name = "备注") - private String remark; - /** 所属仓库 */ - @Excel(name = "所属仓库") - private Long warehouseId; - /** 所属库区 */ - @Excel(name = "所属库区") - private Long areaId; - /** 入库状态 */ - @Excel(name = "入库状态") - private Integer receiptOrderStatus; - - /** - * 生产日期 - */ - @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") - @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") - private LocalDateTime productionDate; - - /** - * 有效期 - */ - @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") - @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") - private LocalDateTime expiryDate; - - /** - * 批次 - */ - private String batch; - private Integer delFlag; - private List place; - private ItemVO item; -} diff --git a/wms/src/main/java/com/cyl/wms/pojo/vo/ReceiptOrderVO.java b/wms/src/main/java/com/cyl/wms/pojo/vo/ReceiptOrderVO.java deleted file mode 100644 index 308e6cc..0000000 --- a/wms/src/main/java/com/cyl/wms/pojo/vo/ReceiptOrderVO.java +++ /dev/null @@ -1,42 +0,0 @@ -package com.cyl.wms.pojo.vo; - -import com.ruoyi.common.annotation.Excel; -import com.fasterxml.jackson.annotation.JsonFormat; -import com.ruoyi.common.core.domain.BaseAudit; -import lombok.Data; - -import java.math.BigDecimal; - -/** - * 入库单 数据视图对象 - * - * @author zcc - */ -@Data -public class ReceiptOrderVO extends BaseAudit { - /** ID */ - private Long id; - /** 入库单号 */ - @Excel(name = "入库单号") - private String receiptOrderNo; - /** 入库类型 */ - @Excel(name = "入库类型") - private Integer receiptOrderType; - /** 供应商 */ - @Excel(name = "供应商") - private Long supplierId; - /** 订单号 */ - @Excel(name = "订单号") - private String orderNo; - @Excel(name = "应付款合计") - private BigDecimal payableAmount; - /** 入库状态 */ - @Excel(name = "入库状态") - private Integer receiptOrderStatus; - /** 备注 */ - @Excel(name = "备注") - private String remark; - private Integer detailCount; - - private String createByName; -} diff --git a/wms/src/main/java/com/cyl/wms/pojo/vo/ShipmentOrderDetailVO.java b/wms/src/main/java/com/cyl/wms/pojo/vo/ShipmentOrderDetailVO.java deleted file mode 100644 index 6b341d3..0000000 --- a/wms/src/main/java/com/cyl/wms/pojo/vo/ShipmentOrderDetailVO.java +++ /dev/null @@ -1,110 +0,0 @@ -package com.cyl.wms.pojo.vo; - -import com.fasterxml.jackson.annotation.JsonFormat; -import com.ruoyi.common.annotation.Excel; -import com.ruoyi.common.core.domain.BaseAudit; -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; -import org.springframework.format.annotation.DateTimeFormat; - -import java.math.BigDecimal; -import java.time.LocalDateTime; -import java.util.List; - -/** - * 出库单详情 数据视图对象 - * - * @author zcc - */ -@Data -public class ShipmentOrderDetailVO extends BaseAudit { - private static final long serialVersionUID = 1L; - /** - * ID - */ - private Long id; - /** - * 订单号 - */ - @Excel(name = "订单号") - private String orderNo; - /** - * 出库单 - */ - @Excel(name = "出库单") - private Long shipmentOrderId; - /** - * 物料 - */ - @Excel(name = "物料") - private Long itemId; - /** - * 计划数量 - */ - @Excel(name = "计划数量") - private BigDecimal planQuantity; - /** - * 实际数量 - */ - @Excel(name = "实际数量") - private BigDecimal realQuantity; - /** - * 货架 - */ - @Excel(name = "货架") - private Long rackId; - /** - * 备注 - */ - @Excel(name = "备注") - private String remark; - - /** - * 所属仓库 - */ - @Excel(name = "所属仓库") - private Long warehouseId; - - @Excel(name = "金额") - private BigDecimal money; - - @ApiModelProperty("删除标识") - private Integer delFlag; - /** - * 所属库区 - */ - @Excel(name = "所属库区") - private Long areaId; - - @Excel(name = "出库状态") - private Integer shipmentOrderStatus; - - /** - * 生产日期 - */ - @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") - @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") - private LocalDateTime productionDate; - - /** - * 有效期 - */ - @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") - @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") - private LocalDateTime expiryDate; - - /** - * 批次 - */ - private String batch; - - private List place; - - private ItemVO item; - - private Long itemType; - - private String customerName; - - private Long customerId; -} diff --git a/wms/src/main/java/com/cyl/wms/pojo/vo/ShipmentOrderVO.java b/wms/src/main/java/com/cyl/wms/pojo/vo/ShipmentOrderVO.java deleted file mode 100644 index ef40a47..0000000 --- a/wms/src/main/java/com/cyl/wms/pojo/vo/ShipmentOrderVO.java +++ /dev/null @@ -1,75 +0,0 @@ -package com.cyl.wms.pojo.vo; - -import com.fasterxml.jackson.annotation.JsonFormat; -import com.ruoyi.common.annotation.Excel; -import com.ruoyi.common.core.domain.BaseAudit; -import lombok.Data; - -import java.time.LocalDateTime; - -/** - * 出库单 数据视图对象 - * - * @author zcc - */ -@Data -public class ShipmentOrderVO extends BaseAudit { - /** - * ID - */ - private Long id; - /** - * 出库单号,系统自动生成 - */ - @Excel(name = "出库单号,系统自动生成") - private String shipmentOrderNo; - /** - * 出库类型 - */ - @Excel(name = "出库类型") - private Integer shipmentOrderType; - /** - * 出库订单 - */ - @Excel(name = "出库订单") - private String orderNo; - /** - * 客户 - */ - @Excel(name = "客户") - private Long customerId; - /** - * 出库单状态 - */ - @Excel(name = "出库单状态") - private Integer shipmentOrderStatus; - /** - * 审核状态 - */ - @Excel(name = "审核状态") - private Integer checkStatus; - /** - * 审核人 - */ - @Excel(name = "审核人") - private Long checkUserId; - /** - * 审核时间 - */ - @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") - @Excel(name = "审核时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss") - private LocalDateTime checkTime; - /** - * 备注 - */ - @Excel(name = "备注") - private String remark; - - @Excel(name = "波次号") - private String waveNo; - - private Integer detailCount; - - private String createByName; - -} diff --git a/wms/src/main/java/com/cyl/wms/pojo/vo/SupplierTransactionVO.java b/wms/src/main/java/com/cyl/wms/pojo/vo/SupplierTransactionVO.java deleted file mode 100644 index b24dab5..0000000 --- a/wms/src/main/java/com/cyl/wms/pojo/vo/SupplierTransactionVO.java +++ /dev/null @@ -1,45 +0,0 @@ -package com.cyl.wms.pojo.vo; - -import java.math.BigDecimal; -import java.time.LocalDateTime; -import com.ruoyi.common.annotation.Excel; -import com.fasterxml.jackson.annotation.JsonFormat; -import lombok.Data; -/** - * 供应商账户流水 数据视图对象 - * - * @author zcc - */ -@Data -public class SupplierTransactionVO { - /** id */ - private Integer id; - /** 交易编号 */ - @Excel(name = "交易编号") - private String transactionCode; - /** 供应商编号 */ - @Excel(name = "供应商编号") - private String supplierId; - /** 交易类型 1:结款 2:应付 */ - @Excel(name = "交易类型 1:结款 2:应付 ") - private String transactionType; - /** 交易金额 */ - @Excel(name = "交易金额") - private BigDecimal transactionAmount; - /** 上期余额 */ - @Excel(name = "上期余额") - private BigDecimal previousBalance; - /** 当前余额 */ - @Excel(name = "当前余额") - private BigDecimal currentBalance; - /** 入库单号 */ - @Excel(name = "入库单号") - private Long receiptOrderId; - /** 备注 */ - @Excel(name = "备注") - private String remark; - /** 创建时间 */ - private LocalDateTime createTime; - /** 更新时间 */ - private LocalDateTime updateTime; -} diff --git a/wms/src/main/java/com/cyl/wms/pojo/vo/SupplierVO.java b/wms/src/main/java/com/cyl/wms/pojo/vo/SupplierVO.java deleted file mode 100644 index 1a0e7c9..0000000 --- a/wms/src/main/java/com/cyl/wms/pojo/vo/SupplierVO.java +++ /dev/null @@ -1,52 +0,0 @@ -package com.cyl.wms.pojo.vo; - -import com.ruoyi.common.annotation.Excel; -import com.fasterxml.jackson.annotation.JsonFormat; -import com.ruoyi.common.core.domain.BaseAudit; -import lombok.Data; - -import java.math.BigDecimal; - -/** - * 供应商 数据视图对象 - * - * @author zcc - */ -@Data -public class SupplierVO extends BaseAudit { - /** ID */ - private Long id; - /** 供应商编号 */ - @Excel(name = "供应商编号") - private String supplierNo; - /** 供应商名称 */ - @Excel(name = "供应商名称") - private String supplierName; - @Excel(name = "开户行") - private String bankName; - @Excel(name = "银行卡号") - private String bankAccount; - @Excel(name = "应付款") - private BigDecimal payableAmount; - /** 供应商地址 */ - @Excel(name = "供应商地址") - private String address; - /** 手机号 */ - @Excel(name = "手机号") - private String mobileNo; - /** 座机号 */ - @Excel(name = "座机号") - private String telNo; - /** 联系人 */ - @Excel(name = "联系人") - private String contact; - /** 级别 */ - @Excel(name = "级别") - private String level; - /** Email */ - @Excel(name = "Email") - private String email; - /** 备注 */ - @Excel(name = "备注") - private String remark; -} diff --git a/wms/src/main/java/com/cyl/wms/pojo/vo/WarehouseVO.java b/wms/src/main/java/com/cyl/wms/pojo/vo/WarehouseVO.java deleted file mode 100644 index 207d0a9..0000000 --- a/wms/src/main/java/com/cyl/wms/pojo/vo/WarehouseVO.java +++ /dev/null @@ -1,25 +0,0 @@ -package com.cyl.wms.pojo.vo; - -import com.ruoyi.common.annotation.Excel; -import com.fasterxml.jackson.annotation.JsonFormat; -import com.ruoyi.common.core.domain.BaseAudit; -import lombok.Data; -/** - * 仓库 数据视图对象 - * - * @author zcc - */ -@Data -public class WarehouseVO extends BaseAudit { - /** ID */ - private Long id; - /** 仓库编号 */ - @Excel(name = "仓库编号") - private String warehouseNo; - /** 仓库名称 */ - @Excel(name = "仓库名称") - private String warehouseName; - /** 备注 */ - @Excel(name = "备注") - private String remark; -} diff --git a/wms/src/main/java/com/cyl/wms/pojo/vo/WaveVO.java b/wms/src/main/java/com/cyl/wms/pojo/vo/WaveVO.java deleted file mode 100644 index ceb48e5..0000000 --- a/wms/src/main/java/com/cyl/wms/pojo/vo/WaveVO.java +++ /dev/null @@ -1,25 +0,0 @@ -package com.cyl.wms.pojo.vo; - -import com.ruoyi.common.annotation.Excel; -import com.fasterxml.jackson.annotation.JsonFormat; -import com.ruoyi.common.core.domain.BaseAudit; -import lombok.Data; -/** - * 波次 数据视图对象 - * - * @author zhangcheng - */ -@Data -public class WaveVO extends BaseAudit { - /** ID */ - private Long id; - /** 波次号 */ - @Excel(name = "波次号") - private String waveNo; - /** 状态 */ - @Excel(name = "状态") - private String status; - /** 备注 */ - @Excel(name = "备注") - private String remark; -} diff --git a/wms/src/main/java/com/cyl/wms/pojo/vo/form/InventoryCheckFrom.java b/wms/src/main/java/com/cyl/wms/pojo/vo/form/InventoryCheckFrom.java deleted file mode 100644 index 9fa2d9b..0000000 --- a/wms/src/main/java/com/cyl/wms/pojo/vo/form/InventoryCheckFrom.java +++ /dev/null @@ -1,21 +0,0 @@ -package com.cyl.wms.pojo.vo.form; - -import com.cyl.wms.domain.InventoryCheck; -import com.cyl.wms.pojo.vo.InventoryCheckDetailVO; -import com.cyl.wms.pojo.vo.ItemVO; -import lombok.Data; - -import java.util.List; - -/** - * 盘库单据 数据视图对象 - * - * @author zhangcheng - */ -@Data -public class InventoryCheckFrom extends InventoryCheck { - // 盘库单据详情 - private List details; - // 所有商品 - private List items; -} diff --git a/wms/src/main/java/com/cyl/wms/pojo/vo/form/InventoryMovementFrom.java b/wms/src/main/java/com/cyl/wms/pojo/vo/form/InventoryMovementFrom.java deleted file mode 100644 index 8f3de55..0000000 --- a/wms/src/main/java/com/cyl/wms/pojo/vo/form/InventoryMovementFrom.java +++ /dev/null @@ -1,16 +0,0 @@ -package com.cyl.wms.pojo.vo.form; - -import com.cyl.wms.domain.InventoryMovement; -import com.cyl.wms.pojo.vo.InventoryMovementDetailVO; -import com.cyl.wms.pojo.vo.ItemVO; -import lombok.Data; - -import java.util.List; - -@Data -public class InventoryMovementFrom extends InventoryMovement { - // 详情 - private List details; - // 所有商品 - private List items; -} diff --git a/wms/src/main/java/com/cyl/wms/pojo/vo/form/InventorySettlementFrom.java b/wms/src/main/java/com/cyl/wms/pojo/vo/form/InventorySettlementFrom.java deleted file mode 100644 index e3678f9..0000000 --- a/wms/src/main/java/com/cyl/wms/pojo/vo/form/InventorySettlementFrom.java +++ /dev/null @@ -1,21 +0,0 @@ -package com.cyl.wms.pojo.vo.form; - -import com.cyl.wms.domain.InventorySettlement; -import com.cyl.wms.pojo.vo.InventorySettlementDetailVO; -import com.cyl.wms.pojo.vo.ItemVO; -import lombok.Data; - -import java.util.List; - -/** - * 盘库结算 数据视图对象 - * - * @author zhangcheng - */ -@Data -public class InventorySettlementFrom extends InventorySettlement { - // 盘库结算详情 - private List details; - // 所有商品 - private List items; -} diff --git a/wms/src/main/java/com/cyl/wms/pojo/vo/form/OrderWaveFrom.java b/wms/src/main/java/com/cyl/wms/pojo/vo/form/OrderWaveFrom.java deleted file mode 100644 index 4b282d0..0000000 --- a/wms/src/main/java/com/cyl/wms/pojo/vo/form/OrderWaveFrom.java +++ /dev/null @@ -1,21 +0,0 @@ -package com.cyl.wms.pojo.vo.form; - -import com.cyl.wms.pojo.vo.ItemVO; -import com.cyl.wms.pojo.vo.ShipmentOrderDetailVO; -import com.cyl.wms.pojo.vo.WaveVO; -import lombok.Data; - -import java.util.List; -/** - * 波次 数据视图对象 - * - * @author zhangcheng - */ -@Data -public class OrderWaveFrom extends WaveVO { - // 出库单详情 - private List details; - private List allocationDetails; - // 所有商品 - private List items; -} diff --git a/wms/src/main/java/com/cyl/wms/pojo/vo/form/ReceiptOrderForm.java b/wms/src/main/java/com/cyl/wms/pojo/vo/form/ReceiptOrderForm.java deleted file mode 100644 index 7886eea..0000000 --- a/wms/src/main/java/com/cyl/wms/pojo/vo/form/ReceiptOrderForm.java +++ /dev/null @@ -1,16 +0,0 @@ -package com.cyl.wms.pojo.vo.form; - -import com.cyl.wms.domain.ReceiptOrder; -import com.cyl.wms.pojo.vo.ItemVO; -import com.cyl.wms.pojo.vo.ReceiptOrderDetailVO; -import lombok.Data; - -import java.util.List; - -@Data -public class ReceiptOrderForm extends ReceiptOrder { - // 入库单详情 - private List details; - // 所有商品 - private List items; -} diff --git a/wms/src/main/java/com/cyl/wms/pojo/vo/form/ShipmentOrderFrom.java b/wms/src/main/java/com/cyl/wms/pojo/vo/form/ShipmentOrderFrom.java deleted file mode 100644 index 20c82f1..0000000 --- a/wms/src/main/java/com/cyl/wms/pojo/vo/form/ShipmentOrderFrom.java +++ /dev/null @@ -1,20 +0,0 @@ -package com.cyl.wms.pojo.vo.form; - -import com.cyl.wms.domain.ShipmentOrder; -import com.cyl.wms.domain.ShipmentOrderDetail; -import com.cyl.wms.pojo.vo.DeliveryVO; -import com.cyl.wms.pojo.vo.ItemVO; -import com.cyl.wms.pojo.vo.ShipmentOrderDetailVO; -import lombok.Data; - -import java.util.List; - -@Data -public class ShipmentOrderFrom extends ShipmentOrder { - // 出库单详情 - private List details; - // 所有商品 - private List items; - // 物流信息 - private List delivery; -} diff --git a/wms/src/main/java/com/cyl/wms/service/AreaService.java b/wms/src/main/java/com/cyl/wms/service/AreaService.java deleted file mode 100644 index 796957c..0000000 --- a/wms/src/main/java/com/cyl/wms/service/AreaService.java +++ /dev/null @@ -1,117 +0,0 @@ -package com.cyl.wms.service; - -import java.util.*; -import java.time.LocalDateTime; - -import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; -import com.cyl.wms.domain.Warehouse; -import com.github.pagehelper.PageHelper; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.data.domain.Pageable; -import org.apache.commons.lang3.StringUtils; -import org.springframework.stereotype.Service; -import com.cyl.wms.mapper.AreaMapper; -import com.cyl.wms.domain.Area; -import com.cyl.wms.pojo.query.AreaQuery; - -/** - * 货区Service业务层处理 - * - * - * @author zcc - */ -@Service -public class AreaService { - @Autowired - private AreaMapper areaMapper; - - /** - * 查询货区 - * - * @param id 货区主键 - * @return 货区 - */ - public Area selectById(Long id) { - return areaMapper.selectById(id); - } - - /** - * 查询货区列表 - * - * @param query 查询条件 - * @param page 分页条件 - * @return 货区 - */ - public List selectList(AreaQuery query, Pageable page) { - if (page != null) { - PageHelper.startPage(page.getPageNumber() + 1, page.getPageSize()); - } - QueryWrapper qw = new QueryWrapper<>(); - qw.eq("del_flag",0); - String areaNo = query.getAreaNo(); - if (!StringUtils.isEmpty(areaNo)) { - qw.eq("area_no", areaNo); - } - String areaNameLike = query.getAreaNameLike(); - if (!StringUtils.isEmpty(areaNameLike)) { - qw.like("area_name", areaNameLike); - } - Long warehouseId = query.getWarehouseId(); - if (warehouseId != null) { - qw.eq("warehouse_id", warehouseId); - } - return areaMapper.selectList(qw); - } - - /** - * 新增货区 - * - * @param area 货区 - * @return 结果 - */ - public int insert(Area area) { - area.setDelFlag(0); - area.setCreateTime(LocalDateTime.now()); - return areaMapper.insert(area); - } - - /** - * 修改货区 - * - * @param area 货区 - * @return 结果 - */ - public int update(Area area) { - return areaMapper.updateById(area); - } - - /** - * 批量删除货区 - * - * @param ids 需要删除的货区主键 - * @return 结果 - */ - public int deleteByIds(Long[] ids) { - return areaMapper.updateDelFlagByIds(ids); - } - - /** - * 删除货区信息 - * - * @param id 货区主键 - * @return 结果 - */ - public int deleteById(Long id) { - Long[] ids = {id}; - return areaMapper.updateDelFlagByIds(ids); - } - - public List selectByIdIn(Collection ids) { - if (ids.isEmpty()) { - return new ArrayList<>(); - } - QueryWrapper qw = new QueryWrapper<>(); - qw.in("id", ids); - return areaMapper.selectList(qw); - } -} diff --git a/wms/src/main/java/com/cyl/wms/service/CarrierService.java b/wms/src/main/java/com/cyl/wms/service/CarrierService.java deleted file mode 100644 index a12d247..0000000 --- a/wms/src/main/java/com/cyl/wms/service/CarrierService.java +++ /dev/null @@ -1,127 +0,0 @@ -package com.cyl.wms.service; - -import java.util.Arrays; -import java.util.List; -import java.time.LocalDateTime; -import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; -import com.github.pagehelper.PageHelper; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.data.domain.Pageable; -import org.apache.commons.lang3.StringUtils; -import org.springframework.stereotype.Service; -import com.cyl.wms.mapper.CarrierMapper; -import com.cyl.wms.domain.Carrier; -import com.cyl.wms.pojo.query.CarrierQuery; - -/** - * 承运商Service业务层处理 - * - * - * @author zcc - */ -@Service -public class CarrierService { - @Autowired - private CarrierMapper carrierMapper; - - /** - * 查询承运商 - * - * @param id 承运商主键 - * @return 承运商 - */ - public Carrier selectById(Long id) { - return carrierMapper.selectById(id); - } - - /** - * 查询承运商列表 - * - * @param query 查询条件 - * @param page 分页条件 - * @return 承运商 - */ - public List selectList(CarrierQuery query, Pageable page) { - if (page != null) { - PageHelper.startPage(page.getPageNumber() + 1, page.getPageSize()); - } - QueryWrapper qw = new QueryWrapper<>(); - qw.eq("del_flag",0); - String carrierNo = query.getCarrierNo(); - if (!StringUtils.isEmpty(carrierNo)) { - qw.eq("carrier_no", carrierNo); - } - String carrierNameLike = query.getCarrierNameLike(); - if (!StringUtils.isEmpty(carrierNameLike)) { - qw.like("carrier_name", carrierNameLike); - } - String address = query.getAddress(); - if (!StringUtils.isEmpty(address)) { - qw.eq("address", address); - } - String mobile = query.getMobile(); - if (!StringUtils.isEmpty(mobile)) { - qw.eq("mobile", mobile); - } - String tel = query.getTel(); - if (!StringUtils.isEmpty(tel)) { - qw.eq("tel", tel); - } - String contact = query.getContact(); - if (!StringUtils.isEmpty(contact)) { - qw.eq("contact", contact); - } - String level = query.getLevel(); - if (!StringUtils.isEmpty(level)) { - qw.eq("level", level); - } - String email = query.getEmail(); - if (!StringUtils.isEmpty(email)) { - qw.eq("email", email); - } - return carrierMapper.selectList(qw); - } - - /** - * 新增承运商 - * - * @param carrier 承运商 - * @return 结果 - */ - public int insert(Carrier carrier) { - carrier.setDelFlag(0); - carrier.setCreateTime(LocalDateTime.now()); - return carrierMapper.insert(carrier); - } - - /** - * 修改承运商 - * - * @param carrier 承运商 - * @return 结果 - */ - public int update(Carrier carrier) { - return carrierMapper.updateById(carrier); - } - - /** - * 批量删除承运商 - * - * @param ids 需要删除的承运商主键 - * @return 结果 - */ - public int deleteByIds(Long[] ids) { - return carrierMapper.updateDelFlagByIds(ids); - } - - /** - * 删除承运商信息 - * - * @param id 承运商主键 - * @return 结果 - */ - public int deleteById(Long id) { - Long[] ids = {id}; - return carrierMapper.updateDelFlagByIds(ids); - } -} diff --git a/wms/src/main/java/com/cyl/wms/service/CustomerService.java b/wms/src/main/java/com/cyl/wms/service/CustomerService.java deleted file mode 100644 index 0a44817..0000000 --- a/wms/src/main/java/com/cyl/wms/service/CustomerService.java +++ /dev/null @@ -1,127 +0,0 @@ -package com.cyl.wms.service; - -import java.util.Arrays; -import java.util.List; -import java.time.LocalDateTime; -import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; -import com.github.pagehelper.PageHelper; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.data.domain.Pageable; -import org.apache.commons.lang3.StringUtils; -import org.springframework.stereotype.Service; -import com.cyl.wms.mapper.CustomerMapper; -import com.cyl.wms.domain.Customer; -import com.cyl.wms.pojo.query.CustomerQuery; - -/** - * 客户Service业务层处理 - * - * - * @author zcc - */ -@Service -public class CustomerService { - @Autowired - private CustomerMapper customerMapper; - - /** - * 查询客户 - * - * @param id 客户主键 - * @return 客户 - */ - public Customer selectById(Long id) { - return customerMapper.selectById(id); - } - - /** - * 查询客户列表 - * - * @param query 查询条件 - * @param page 分页条件 - * @return 客户 - */ - public List selectList(CustomerQuery query, Pageable page) { - if (page != null) { - PageHelper.startPage(page.getPageNumber() + 1, page.getPageSize()); - } - QueryWrapper qw = new QueryWrapper<>(); - qw.eq("del_flag",0); - String customerNo = query.getCustomerNo(); - if (!StringUtils.isEmpty(customerNo)) { - qw.eq("customer_no", customerNo); - } - String customerNameLike = query.getCustomerNameLike(); - if (!StringUtils.isEmpty(customerNameLike)) { - qw.like("customer_name", customerNameLike); - } - String address = query.getAddress(); - if (!StringUtils.isEmpty(address)) { - qw.eq("address", address); - } - String mobile = query.getMobile(); - if (!StringUtils.isEmpty(mobile)) { - qw.eq("mobile", mobile); - } - String tel = query.getTel(); - if (!StringUtils.isEmpty(tel)) { - qw.eq("tel", tel); - } - String customerPerson = query.getCustomerPerson(); - if (!StringUtils.isEmpty(customerPerson)) { - qw.eq("customer_person", customerPerson); - } - String customerLevel = query.getCustomerLevel(); - if (!StringUtils.isEmpty(customerLevel)) { - qw.eq("customer_level", customerLevel); - } - String email = query.getEmail(); - if (!StringUtils.isEmpty(email)) { - qw.eq("email", email); - } - return customerMapper.selectList(qw); - } - - /** - * 新增客户 - * - * @param customer 客户 - * @return 结果 - */ - public int insert(Customer customer) { - customer.setDelFlag(0); - customer.setCreateTime(LocalDateTime.now()); - return customerMapper.insert(customer); - } - - /** - * 修改客户 - * - * @param customer 客户 - * @return 结果 - */ - public int update(Customer customer) { - return customerMapper.updateById(customer); - } - - /** - * 批量删除客户 - * - * @param ids 需要删除的客户主键 - * @return 结果 - */ - public int deleteByIds(Long[] ids) { - return customerMapper.updateDelFlagByIds(ids); - } - - /** - * 删除客户信息 - * - * @param id 客户主键 - * @return 结果 - */ - public int deleteById(Long id) { - Long[] ids = {id}; - return customerMapper.updateDelFlagByIds(ids); - } -} diff --git a/wms/src/main/java/com/cyl/wms/service/CustomerTransactionService.java b/wms/src/main/java/com/cyl/wms/service/CustomerTransactionService.java deleted file mode 100644 index 9ec2403..0000000 --- a/wms/src/main/java/com/cyl/wms/service/CustomerTransactionService.java +++ /dev/null @@ -1,156 +0,0 @@ -package com.cyl.wms.service; - -import java.math.BigDecimal; -import java.time.LocalDateTime; -import java.util.Arrays; -import java.util.List; -import java.time.LocalDateTime; -import java.util.Optional; - -import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; -import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; -import com.cyl.wms.domain.Customer; -import com.cyl.wms.domain.SupplierTransaction; -import com.github.pagehelper.PageHelper; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.data.domain.Pageable; -import org.apache.commons.lang3.StringUtils; -import org.springframework.stereotype.Service; -import com.cyl.wms.mapper.CustomerTransactionMapper; -import com.cyl.wms.domain.CustomerTransaction; -import com.cyl.wms.pojo.query.CustomerTransactionQuery; - -/** - * 客户账户流水Service业务层处理 - * - * - * @author zcc - */ -@Service -public class CustomerTransactionService { - @Autowired - private CustomerTransactionMapper customerTransactionMapper; - - @Autowired - private CustomerService customerService; - - /** - * 查询客户账户流水 - * - * @param id 客户账户流水主键 - * @return 客户账户流水 - */ - public CustomerTransaction selectById(Integer id) { - return customerTransactionMapper.selectById(id); - } - - /** - * 查询客户账户流水列表 - * - * @param query 查询条件 - * @param page 分页条件 - * @return 客户账户流水 - */ - public List selectList(CustomerTransactionQuery query, Pageable page) { - if (page != null) { - PageHelper.startPage(page.getPageNumber() + 1, page.getPageSize(), "create_time desc"); - } - LambdaQueryWrapper qw = new LambdaQueryWrapper<>(); - if (!StringUtils.isEmpty(query.getCustomerId())){ - qw.eq(CustomerTransaction::getCustomerId, query.getCustomerId()); - } - if (!StringUtils.isEmpty(query.getTransactionCode())){ - qw.eq(CustomerTransaction::getTransactionCode, query.getTransactionCode()); - } - if (!StringUtils.isEmpty(query.getTransactionType())){ - qw.eq(CustomerTransaction::getTransactionType, query.getTransactionType()); - } - Optional.ofNullable(query.getStartTime()).ifPresent( - startTime -> qw.ge(CustomerTransaction::getCreateTime, query.getStartTime()) - ); - Optional.ofNullable(query.getEndTime()).ifPresent( - startTime -> qw.le(CustomerTransaction::getCreateTime, query.getEndTime()) - ); - return customerTransactionMapper.selectList(qw); - } - - /** - * 新增客户账户流水 - * - * @param customerTransaction 客户账户流水 - * @return 结果 - */ - public int insert(CustomerTransaction customerTransaction) { - Customer customer = customerService.selectById(Long.valueOf(customerTransaction.getCustomerId())); - if (customer == null){ - return 0; - } - customerTransaction.setCreateTime(LocalDateTime.now()); - customerTransaction.setPreviousBalance(customer.getReceivableAmount()); - BigDecimal duePay = customer.getReceivableAmount(); - BigDecimal after = customer.getReceivableAmount(); - if (CustomerTransaction.ENTER.equals(customerTransaction.getTransactionType())){ - after = duePay.subtract(customerTransaction.getTransactionAmount()); - }else if (CustomerTransaction.EXIT.equals(customerTransaction.getTransactionType())){ - after = duePay.add(customerTransaction.getTransactionAmount()); - }else if (CustomerTransaction.SHIPMENT.equals(customerTransaction.getTransactionType())){ - //查询该出库单是否已经添加 - LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper<>(); - queryWrapper.eq(CustomerTransaction::getShipmentOrderId, customerTransaction.getShipmentOrderId()); - queryWrapper.orderByDesc(CustomerTransaction::getId); - List customerTransactions = customerTransactionMapper.selectList(queryWrapper); - if (customerTransactions.size() > 0){ - //更新出库单金额 - CustomerTransaction customerTransaction1 = customerTransactions.get(0); - if (customerTransaction1.getTransactionAmount().compareTo(customerTransaction.getTransactionAmount()) != 0){ - //发生金额变化 - after = duePay.add(customerTransaction.getTransactionAmount().subtract(customerTransaction1.getTransactionAmount())); - }else { - //无金额变化 - return 0; - } - }else { - //新增 - after = duePay.add(customerTransaction.getTransactionAmount()); - } - } - customerTransaction.setCurrentBalance(after); - - //更新客户 应收款 - customer.setReceivableAmount(after); - customerService.update(customer); - - return customerTransactionMapper.insert(customerTransaction); - } - - /** - * 修改客户账户流水 - * - * @param customerTransaction 客户账户流水 - * @return 结果 - */ - public int update(CustomerTransaction customerTransaction) { - return customerTransactionMapper.updateById(customerTransaction); - } - - /** - * 批量删除客户账户流水 - * - * @param ids 需要删除的客户账户流水主键 - * @return 结果 - */ - public int deleteByIds(Long[] ids) { - return customerTransactionMapper.updateDelFlagByIds(ids); - } - - /** - * 删除客户账户流水信息 - * - * @param id 客户账户流水主键 - * @return 结果 - */ - public int deleteById(Long id) { - Long[] ids = {id}; - return customerTransactionMapper.updateDelFlagByIds(ids); - } -} diff --git a/wms/src/main/java/com/cyl/wms/service/DeliveryService.java b/wms/src/main/java/com/cyl/wms/service/DeliveryService.java deleted file mode 100644 index 7d00141..0000000 --- a/wms/src/main/java/com/cyl/wms/service/DeliveryService.java +++ /dev/null @@ -1,114 +0,0 @@ -package com.cyl.wms.service; - -import java.time.LocalDateTime; -import java.util.Arrays; -import java.util.List; -import java.time.LocalDateTime; -import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; -import com.cyl.wms.convert.DeliveryConvert; -import com.cyl.wms.pojo.vo.DeliveryVO; -import com.github.pagehelper.PageHelper; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.data.domain.Pageable; -import org.apache.commons.lang3.StringUtils; -import org.springframework.stereotype.Service; -import com.cyl.wms.mapper.DeliveryMapper; -import com.cyl.wms.domain.Delivery; -import com.cyl.wms.pojo.query.DeliveryQuery; - -/** - * 发货记录Service业务层处理 - * - * - * @author zcc - */ -@Service -public class DeliveryService { - @Autowired - private DeliveryMapper deliveryMapper; - - /** - * 查询发货记录 - * - * @param id 发货记录主键 - * @return 发货记录 - */ - public Delivery selectById(Long id) { - return deliveryMapper.selectById(id); - } - - /** - * 查询发货记录列表 - * - * @param query 查询条件 - * @param page 分页条件 - * @return 发货记录 - */ - public List selectList(DeliveryQuery query, Pageable page) { - if (page != null) { - PageHelper.startPage(page.getPageNumber() + 1, page.getPageSize(), "create_time desc"); - } - QueryWrapper qw = new QueryWrapper<>(); - qw.eq("del_flag",0); - Long shipmentOrderId = query.getShipmentOrderId(); - if (shipmentOrderId != null) { - qw.eq("shipment_order_id", shipmentOrderId); - } - Long carrierId = query.getCarrierId(); - if (carrierId != null) { - qw.eq("carrier_id", carrierId); - } - LocalDateTime deliveryDate = query.getDeliveryDate(); - if (deliveryDate != null) { - qw.eq("delivery_date", deliveryDate); - } - String trackingNo = query.getTrackingNo(); - if (!StringUtils.isEmpty(trackingNo)) { - qw.eq("tracking_no", trackingNo); - } - return deliveryMapper.selectList(qw); - } - - /** - * 新增发货记录 - * - * @param delivery 发货记录 - * @return 结果 - */ - public int insert(Delivery delivery) { - delivery.setDelFlag(0); - delivery.setCreateTime(LocalDateTime.now()); - return deliveryMapper.insert(delivery); - } - - /** - * 修改发货记录 - * - * @param delivery 发货记录 - * @return 结果 - */ - public int update(Delivery delivery) { - return deliveryMapper.updateById(delivery); - } - - /** - * 批量删除发货记录 - * - * @param ids 需要删除的发货记录主键 - * @return 结果 - */ - public int deleteByIds(Long[] ids) { - return deliveryMapper.updateDelFlagByIds(ids); - } - - /** - * 删除发货记录信息 - * - * @param id 发货记录主键 - * @return 结果 - */ - public int deleteById(Long id) { - Long[] ids = {id}; - return deliveryMapper.updateDelFlagByIds(ids); - } -} diff --git a/wms/src/main/java/com/cyl/wms/service/InventoryCheckDetailService.java b/wms/src/main/java/com/cyl/wms/service/InventoryCheckDetailService.java deleted file mode 100644 index 508a652..0000000 --- a/wms/src/main/java/com/cyl/wms/service/InventoryCheckDetailService.java +++ /dev/null @@ -1,153 +0,0 @@ -package com.cyl.wms.service; - -import java.math.BigDecimal; -import java.util.Arrays; -import java.util.LinkedList; -import java.util.List; -import java.time.LocalDateTime; -import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; -import com.cyl.wms.convert.InventoryCheckDetailConvert; -import com.cyl.wms.domain.InventoryHistory; -import com.cyl.wms.pojo.vo.InventoryCheckDetailVO; -import com.github.pagehelper.PageHelper; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.data.domain.Pageable; -import org.apache.commons.lang3.StringUtils; -import org.springframework.stereotype.Service; -import com.cyl.wms.mapper.InventoryCheckDetailMapper; -import com.cyl.wms.domain.InventoryCheckDetail; -import com.cyl.wms.pojo.query.InventoryCheckDetailQuery; - -/** - * 库存盘点单据详情Service业务层处理 - * - * - * @author zcc - */ -@Service -public class InventoryCheckDetailService { - @Autowired - private InventoryCheckDetailMapper inventoryCheckDetailMapper; - - @Autowired - private InventoryCheckDetailConvert convert; - - /** - * 查询库存盘点单据详情 - * - * @param id 库存盘点单据详情主键 - * @return 库存盘点单据详情 - */ - public InventoryCheckDetail selectById(Long id) { - return inventoryCheckDetailMapper.selectById(id); - } - - public List toVos(List items) { - List list = convert.dos2vos(items); - list.forEach(itemVO -> { - List place = new LinkedList<>(); - if (itemVO.getWarehouseId() != null) { - place.add(itemVO.getWarehouseId()); - } - if (itemVO.getAreaId() != null) { - place.add(itemVO.getAreaId()); - } - if (itemVO.getRackId() != null) { - place.add(itemVO.getRackId()); - } - itemVO.setPlace(place); - }); - return list; - } - - /** - * 查询库存盘点单据详情列表 - * - * @param query 查询条件 - * @param page 分页条件 - * @return 库存盘点单据详情 - */ - public List selectList(InventoryCheckDetailQuery query, Pageable page) { - if (page != null) { - PageHelper.startPage(page.getPageNumber() + 1, page.getPageSize()); - } - QueryWrapper qw = new QueryWrapper<>(); - qw.eq("del_flag",0); - Long inventoryCheckId = query.getInventoryCheckId(); - if (inventoryCheckId != null) { - qw.eq("inventory_check_id", inventoryCheckId); - } - Long itemId = query.getItemId(); - if (itemId != null) { - qw.eq("item_id", itemId); - } - BigDecimal quantity = query.getQuantity(); - if (quantity != null) { - qw.eq("quantity", quantity); - } - BigDecimal checkQuantity = query.getCheckQuantity(); - if (checkQuantity != null) { - qw.eq("check_quantity", checkQuantity); - } - Long warehouseId = query.getWarehouseId(); - if (warehouseId != null) { - qw.eq("warehouse_id", warehouseId); - } - Long areaId = query.getAreaId(); - if (areaId != null) { - qw.eq("area_id", areaId); - } - Long rackId = query.getRackId(); - if (rackId != null) { - qw.eq("rack_id", rackId); - } - return inventoryCheckDetailMapper.selectList(qw); - } - - /** - * 新增库存盘点单据详情 - * - * @param inventoryCheckDetail 库存盘点单据详情 - * @return 结果 - */ - public int insert(InventoryCheckDetail inventoryCheckDetail) { - inventoryCheckDetail.setDelFlag(0); - inventoryCheckDetail.setCreateTime(LocalDateTime.now()); - return inventoryCheckDetailMapper.insert(inventoryCheckDetail); - } - - /** - * 修改库存盘点单据详情 - * - * @param inventoryCheckDetail 库存盘点单据详情 - * @return 结果 - */ - public int update(InventoryCheckDetail inventoryCheckDetail) { - return inventoryCheckDetailMapper.updateById(inventoryCheckDetail); - } - - /** - * 批量删除库存盘点单据详情 - * - * @param ids 需要删除的库存盘点单据详情主键 - * @return 结果 - */ - public int deleteByIds(Long[] ids) { - return inventoryCheckDetailMapper.updateDelFlagByIds(ids); - } - - /** - * 删除库存盘点单据详情信息 - * - * @param id 库存盘点单据详情主键 - * @return 结果 - */ - public int deleteById(Long id) { - Long[] ids = {id}; - return inventoryCheckDetailMapper.updateDelFlagByIds(ids); - } - - public InventoryHistory vo2InventoryHistory(InventoryCheckDetailVO it) { - return convert.vo2InventoryHistory(it); - } -} diff --git a/wms/src/main/java/com/cyl/wms/service/InventoryCheckService.java b/wms/src/main/java/com/cyl/wms/service/InventoryCheckService.java deleted file mode 100644 index 3e3d9ac..0000000 --- a/wms/src/main/java/com/cyl/wms/service/InventoryCheckService.java +++ /dev/null @@ -1,319 +0,0 @@ -package com.cyl.wms.service; - -import cn.hutool.core.collection.CollUtil; -import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; -import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; -import com.cyl.wms.constant.ReceiptOrderConstant; -import com.cyl.wms.constant.ShipmentOrderConstant; -import com.cyl.wms.convert.InventoryCheckConvert; -import com.cyl.wms.convert.InventoryCheckDetailConvert; -import com.cyl.wms.domain.InventoryCheck; -import com.cyl.wms.domain.InventoryCheckDetail; -import com.cyl.wms.domain.InventoryHistory; -import com.cyl.wms.domain.Item; -import com.cyl.wms.mapper.InventoryCheckDetailMapper; -import com.cyl.wms.mapper.InventoryCheckMapper; -import com.cyl.wms.pojo.query.InventoryCheckDetailQuery; -import com.cyl.wms.pojo.query.InventoryCheckQuery; -import com.cyl.wms.pojo.query.ItemQuery; -import com.cyl.wms.pojo.vo.InventoryCheckDetailVO; -import com.cyl.wms.pojo.vo.ItemVO; -import com.cyl.wms.pojo.vo.form.InventoryCheckFrom; -import com.github.pagehelper.PageHelper; -import com.ruoyi.common.utils.SecurityUtils; -import lombok.extern.slf4j.Slf4j; -import org.apache.commons.lang3.StringUtils; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.data.domain.Pageable; -import org.springframework.stereotype.Service; -import org.springframework.transaction.annotation.Transactional; - -import java.math.BigDecimal; -import java.time.LocalDateTime; -import java.util.ArrayList; -import java.util.LinkedList; -import java.util.List; -import java.util.stream.Collectors; - -/** - * 库存盘点单据Service业务层处理 - * - * - * @author zcc - */ -@Slf4j -@Service -public class InventoryCheckService { - @Autowired - private InventoryCheckMapper inventoryCheckMapper; - - @Autowired - private InventoryCheckDetailMapper inventoryCheckDetailMapper; - - @Autowired - private InventoryCheckDetailConvert detailConvert; - - @Autowired - private InventoryCheckDetailService inventoryCheckDetailService; - - @Autowired - private InventoryHistoryService inventoryHistoryService; - - @Autowired - private InventoryService inventoryService; - - @Autowired - private ItemService itemService; - - @Autowired - private InventoryCheckConvert convert; - /** - * 查询库存盘点单据 - * - * @param id 库存盘点单据主键 - * @return 库存盘点单据 - */ - public InventoryCheckFrom selectById(Long id) { - InventoryCheck inventoryCheck = inventoryCheckMapper.selectById(id); - if (inventoryCheck == null) return null; - InventoryCheckFrom from = do2form(inventoryCheck); - - InventoryCheckDetailQuery inventoryCheckDetailQuery = new InventoryCheckDetailQuery(); - inventoryCheckDetailQuery.setInventoryCheckId(id); - List inventoryCheckDetails = inventoryCheckDetailService.selectList(inventoryCheckDetailQuery, null); - List inventoryCheckDetailsVos = inventoryCheckDetailService.toVos(inventoryCheckDetails); - from.setDetails(inventoryCheckDetailsVos); - if (!CollUtil.isEmpty(from.getDetails())) { - List itemIds = from.getDetails().stream().map(InventoryCheckDetailVO::getItemId).distinct().collect(Collectors.toList()); - ItemQuery query1 = new ItemQuery(); - query1.setIds(itemIds); - List list = itemService.selectList(query1, null); - List items = itemService.toVos(list); - from.setItems(items); - - } - return from; - } - - private InventoryCheckFrom do2form(InventoryCheck inventoryCheck) { - InventoryCheckFrom itemVO = convert.do2form(inventoryCheck); - - List place = new LinkedList<>(); - if (itemVO.getWarehouseId() != null) { - place.add(itemVO.getWarehouseId()); - } - if (itemVO.getAreaId() != null) { - place.add(itemVO.getAreaId()); - } - if (itemVO.getRackId() != null) { - place.add(itemVO.getRackId()); - } - itemVO.setPlace(place); - - return itemVO; - } - - /** - * 查询库存盘点单据列表 - * - * @param query 查询条件 - * @param page 分页条件 - * @return 库存盘点单据 - */ - public List selectList(InventoryCheckQuery query, Pageable page) { - if (page != null) { - PageHelper.startPage(page.getPageNumber() + 1, page.getPageSize(), "create_time desc"); - } - QueryWrapper qw = new QueryWrapper<>(); - qw.eq("del_flag",0); - String inventoryCheckNo = query.getInventoryCheckNo(); - if (!StringUtils.isEmpty(inventoryCheckNo)) { - qw.eq("inventory_check_no", inventoryCheckNo); - } - Integer inventoryCheckType = query.getInventoryCheckType(); - if (inventoryCheckType != null) { - qw.eq("inventory_check_type", inventoryCheckType); - } - Integer inventoryCheckStatus = query.getInventoryCheckStatus(); - if (inventoryCheckStatus != null) { - qw.eq("inventory_check_status", inventoryCheckStatus); - } - BigDecimal inventoryCheckTotal = query.getInventoryCheckTotal(); - if (inventoryCheckTotal != null) { - qw.eq("inventory_check_total", inventoryCheckTotal); - } - Integer checkStatus = query.getCheckStatus(); - if (checkStatus != null) { - qw.eq("check_status", checkStatus); - } - Long checkUserId = query.getCheckUserId(); - if (checkUserId != null) { - qw.eq("check_user_id", checkUserId); - } - LocalDateTime checkTime = query.getCheckTime(); - if (checkTime != null) { - qw.eq("check_time", checkTime); - } - Long warehouseId = query.getWarehouseId(); - if (warehouseId != null) { - qw.eq("warehouse_id", warehouseId); - } - Long areaId = query.getAreaId(); - if (areaId != null) { - qw.eq("area_id", areaId); - } - Long rackId = query.getRackId(); - if (rackId != null) { - qw.eq("rack_id", rackId); - } - String attachment = query.getAttachment(); - if (!StringUtils.isEmpty(attachment)) { - qw.eq("attachment", attachment); - } - return inventoryCheckMapper.selectList(qw); - } - - /** - * 新增库存盘点单据 - * - * @param inventoryCheck 库存盘点单据 - * @return 结果 - */ - public int insert(InventoryCheck inventoryCheck) { - inventoryCheck.setDelFlag(0); - inventoryCheck.setCreateTime(LocalDateTime.now()); - return inventoryCheckMapper.insert(inventoryCheck); - } - - /** - * 修改库存盘点单据 - * - * @param inventoryCheck 库存盘点单据 - * @return 结果 - */ - public int update(InventoryCheck inventoryCheck) { - return inventoryCheckMapper.updateById(inventoryCheck); - } - - /** - * 批量删除库存盘点单据 - * - * @param ids 需要删除的库存盘点单据主键 - * @return 结果 - */ - public int deleteByIds(Long[] ids) { - return inventoryCheckMapper.updateDelFlagByIds(ids); - } - - /** - * 删除库存盘点单据信息 - * - * @param id 库存盘点单据主键 - * @return 结果 - */ - public int deleteById(Long id) { - Long[] ids = {id}; - return inventoryCheckMapper.updateDelFlagByIds(ids); - } - - /** - * 新增或更新盘点单据以及盘点单据明细 - * - * @param inventoryCheckFrom 盘点单据 - * @return 结果 - */ - @Transactional - public int addOrUpdate(InventoryCheckFrom inventoryCheckFrom) { - int res; - // 1. 新增 - if (inventoryCheckFrom.getId() == null) { - inventoryCheckFrom.setDelFlag(0); - inventoryCheckFrom.setCreateTime(LocalDateTime.now()); - res = inventoryCheckMapper.insert(inventoryCheckFrom); - } else { - // 2.编辑 - // 2.1 更新盘点单 - res = inventoryCheckMapper.updateById(inventoryCheckFrom); - } - - if (InventoryCheckFrom.CREATED.equals(String.valueOf(inventoryCheckFrom.getInventoryCheckStatus()))) { - // 3.暂存 - // 3.1 删除明细单 - LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper<>(); - queryWrapper.eq(InventoryCheckDetail::getInventoryCheckId, inventoryCheckFrom.getId()); - inventoryCheckDetailMapper.delete(queryWrapper); - - // 3.2 保存明细单 - saveDetails(inventoryCheckFrom.getId(), inventoryCheckFrom.getDetails()); - } else if (InventoryCheckFrom.FINISH.equals(String.valueOf(inventoryCheckFrom.getInventoryCheckStatus()))) { - // 4.盘点结束 - - // 4.1 删除明细单 - LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper<>(); - queryWrapper.eq(InventoryCheckDetail::getInventoryCheckId, inventoryCheckFrom.getId()); - inventoryCheckDetailMapper.delete(queryWrapper); - - // 4.2 保存明细单 - saveDetails(inventoryCheckFrom.getId(), inventoryCheckFrom.getDetails()); - - // 4.3 操作库存流水,物料库存 - saveInventory(inventoryCheckFrom.getId(), inventoryCheckFrom.getDetails()); - } - - return res; - - } - - /** - * 操作库存流水,物料库存 - * - * @param inventoryCheckId 操作单 - * @param details 盘点单据详情 - */ - private void saveInventory(final Long inventoryCheckId, List details) { - List adds = new ArrayList<>(); - LocalDateTime now = LocalDateTime.now(); - Long userId = SecurityUtils.getUserId(); - details.forEach(it -> { - BigDecimal subtract = it.getCheckQuantity().subtract(it.getQuantity()); - InventoryHistory h = inventoryCheckDetailService.vo2InventoryHistory(it); - h.setFormId(inventoryCheckId); - if (subtract.compareTo(BigDecimal.ZERO) == 0) { - return; - } else if (subtract.compareTo(BigDecimal.ZERO) > 0) { - // 盘盈入库 - h.setFormType(ReceiptOrderConstant.CHECK_IN); - } else { - // 盘亏出库 - h.setFormType(ShipmentOrderConstant.CHECK_OUT); - } - - h.setQuantity(subtract); - h.setDelFlag(0); - h.setId(null); - h.setCreateTime(now); - h.setCreateBy(userId); - h.setUpdateBy(userId); - h.setUpdateTime(now); - adds.add(h); - }); - if (adds.size() > 0) { - int add1 = inventoryHistoryService.batchInsert(adds); - int update1 = inventoryService.batchUpdate1(adds); - log.info("inventoryHistory: {}, inventory: {}", add1, update1); - } - } - - /** - * 保存单据明细 - * - * @param details 盘点单据详情 - */ - private void saveDetails(Long checkId, List details) { - if (!CollUtil.isEmpty(details)) { - details.forEach(it -> it.setInventoryCheckId(checkId)); - List inventoryCheckDetails = detailConvert.vos2dos(details); - inventoryCheckDetailMapper.batchInsert(inventoryCheckDetails); - } - } -} diff --git a/wms/src/main/java/com/cyl/wms/service/InventoryHistoryService.java b/wms/src/main/java/com/cyl/wms/service/InventoryHistoryService.java deleted file mode 100644 index 82707e6..0000000 --- a/wms/src/main/java/com/cyl/wms/service/InventoryHistoryService.java +++ /dev/null @@ -1,250 +0,0 @@ -package com.cyl.wms.service; - -import cn.hutool.core.collection.CollUtil; -import cn.hutool.core.util.StrUtil; -import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; -import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; -import com.cyl.wms.convert.InventoryHistoryConvert; -import com.cyl.wms.domain.*; -import com.cyl.wms.mapper.*; -import com.cyl.wms.pojo.query.InventoryHistoryQuery; -import com.cyl.wms.pojo.vo.InventoryHistoryVO; -import com.github.pagehelper.PageHelper; -import com.ruoyi.common.constant.CommonConstant; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.data.domain.Page; -import org.springframework.data.domain.PageImpl; -import org.springframework.data.domain.Pageable; -import org.springframework.stereotype.Service; - -import java.math.BigDecimal; -import java.time.LocalDateTime; -import java.util.*; -import java.util.stream.Collectors; - -/** - * 库存记录Service业务层处理 - * - * @author zcc - */ -@Service -public class InventoryHistoryService { - @Autowired - private InventoryHistoryMapper inventoryHistoryMapper; - @Autowired - private InventoryHistoryConvert inventoryHistoryConvert; - @Autowired - private InventoryService inventoryService; - @Autowired - private ReceiptOrderMapper receiptOrderMapper; - @Autowired - private ShipmentOrderMapper shipmentOrderMapper; - @Autowired - private CustomerMapper customerMapper; - @Autowired - private SupplierMapper supplierMapper; - - /** - * 查询库存记录 - * - * @param id 库存记录主键 - * @return 库存记录 - */ - public InventoryHistory selectById(Long id) { - return inventoryHistoryMapper.selectById(id); - } - - /** - * 查询库存记录列表 - * - * @param query 查询条件 - * @return 库存记录 - */ - public List selectList(InventoryHistoryQuery query) { - List list = queryInventoryHistories(query); - List res = inventoryHistoryConvert.dos2vos(list); - inventoryService.injectAreaAndItemInfo(res); - inventoryService.injectDictDataLabel(res); - return res; - } - - /** - * 注入顾客或供应商姓名,出入库单号 - * @param res - */ - private void injectOrderIdAndName(List res) { - List receiptIds = res.stream().filter(it -> it.getFormType() < 10).map(InventoryHistoryVO::getFormId).collect(Collectors.toList()); - List shipmentIds = res.stream().filter(it -> it.getFormType() > 10).map(InventoryHistoryVO::getFormId).collect(Collectors.toList()); - Map receiptOrderMap = new HashMap<>(); - Map supplierMap = new HashMap<>(); - Map receiptMap = new HashMap<>(); - Map shipmentOrderMap = new HashMap<>(); - Map customerMap = new HashMap<>(); - Map shipmentMap = new HashMap<>(); - if (CollUtil.isNotEmpty(receiptIds)) { - List receiptOrderList = receiptOrderMapper.selectBatchIds(receiptIds); - receiptMap = receiptOrderList.stream().collect(Collectors.toMap(ReceiptOrder::getId, v -> Optional.ofNullable(v.getSupplierId()).orElse(0L))); - Set supplierIds = receiptOrderList.stream().map(ReceiptOrder::getSupplierId).collect(Collectors.toSet()); - if (CollUtil.isNotEmpty(supplierIds)) { - supplierMap = supplierMapper.selectBatchIds(supplierIds).stream().collect(Collectors.toMap(Supplier::getId, Supplier::getSupplierName)); - } - receiptOrderMap = receiptOrderList.stream().collect(Collectors.toMap(ReceiptOrder::getId, ReceiptOrder::getReceiptOrderNo)); - } - if (CollUtil.isNotEmpty(shipmentIds)) { - List shipmentOrderList = shipmentOrderMapper.selectBatchIds(shipmentIds); - shipmentMap = shipmentOrderList.stream().collect(Collectors.toMap(ShipmentOrder::getId, v -> Optional.ofNullable(v.getCustomerId()).orElse(0L))); - Set customerIds = shipmentOrderList.stream().map(ShipmentOrder::getCustomerId).collect(Collectors.toSet()); - if (CollUtil.isNotEmpty(customerIds)) { - customerMap = customerMapper.selectBatchIds(customerIds).stream().collect(Collectors.toMap(Customer::getId, Customer::getCustomerName)); - } - shipmentOrderMap = shipmentOrderList.stream().collect(Collectors.toMap(ShipmentOrder::getId, ShipmentOrder::getShipmentOrderNo)); - } - for (InventoryHistoryVO vo : res) { - if (vo.getFormType() < 10) { - vo.setOrderId(receiptOrderMap.get(vo.getFormId())); - vo.setName(supplierMap.get(receiptMap.get(vo.getFormId()))); - } else if (vo.getFormType() > 10){ - vo.setOrderId(shipmentOrderMap.get(vo.getFormId())); - vo.setName(customerMap.get(shipmentMap.get(vo.getFormId()))); - } - } - } - - private List queryInventoryHistories(InventoryHistoryQuery query) { - QueryWrapper qw = new QueryWrapper<>(); - qw.eq("del_flag", 0); - Long formId = query.getFormId(); - if (formId != null) { - qw.eq("form_id", formId); - } - Integer formType = query.getFormType(); - if (formType != null) { - qw.eq("form_type", formType); - } - Long itemId = query.getItemId(); - if (itemId != null) { - qw.eq("item_id", itemId); - } - if (query.getWarehouseId() != null) { - qw.eq("warehouse_id", query.getWarehouseId()); - } - if (query.getAreaId() != null) { - qw.eq("area_id", query.getAreaId()); - } - Long rackId = query.getRackId(); - if (rackId != null) { - qw.eq("rack_id", rackId); - } - BigDecimal quantity = query.getQuantity(); - if (quantity != null) { - qw.eq("quantity", quantity); - } - if (StrUtil.isNotBlank(query.getBeginTime()) && StrUtil.isNotBlank(query.getEndTime())) { - qw.between("create_time", query.getBeginTime(), query.getEndTime()); - } - List list = inventoryHistoryMapper.selectList(qw); - return list; - } - - public Page selectList(InventoryHistoryQuery query, Pageable page) { - PageHelper.startPage(page.getPageNumber() + 1, page.getPageSize(), "create_time desc"); - List list = inventoryHistoryMapper.selectPageList(query); - inventoryService.injectAreaAndItemInfo(list); - return new PageImpl<>(list, page, ((com.github.pagehelper.Page) list).getTotal()); - } - - /** - * 新增库存记录 - * - * @param inventoryHistory 库存记录 - * @return 结果 - */ - public int insert(InventoryHistory inventoryHistory) { - inventoryHistory.setDelFlag(0); - inventoryHistory.setCreateTime(LocalDateTime.now()); - return inventoryHistoryMapper.insert(inventoryHistory); - } - - /** - * 修改库存记录 - * - * @param inventoryHistory 库存记录 - * @return 结果 - */ - public int update(InventoryHistory inventoryHistory) { - return inventoryHistoryMapper.updateById(inventoryHistory); - } - - /** - * 批量删除库存记录 - * - * @param ids 需要删除的库存记录主键 - * @return 结果 - */ - public int deleteByIds(Long[] ids) { - return inventoryHistoryMapper.updateDelFlagByIds(ids); - } - - /** - * 删除库存记录信息 - * - * @param id 库存记录主键 - * @return 结果 - */ - public int deleteById(Long id) { - Long[] ids = {id}; - return inventoryHistoryMapper.updateDelFlagByIds(ids); - } - - /** - * 删除库存记录信息 - * - * @param formId 单据id - * @param formType 单据类型 - * @return 结果 - */ - public int deleteByForm(Long formId, Integer... formType) { - LambdaQueryWrapper qw = new LambdaQueryWrapper() - .eq(InventoryHistory::getFormId, formId); - if (formType.length > 0) { - List list = Arrays.asList(formType); - qw.in(InventoryHistory::getFormType, list); - } - return inventoryHistoryMapper.delete(qw); - } - - /** - * 查询库存记录信息 - * - * @param formId 单据id - * @param formType 单据类型 - * @return 结果 - */ - public List selectByForm(Long formId, Integer... formType) { - LambdaQueryWrapper qw = new LambdaQueryWrapper() - .eq(InventoryHistory::getFormId, formId); - if (formType.length > 0) { - List list = Arrays.asList(formType); - qw.in(InventoryHistory::getFormType, list); - } - return inventoryHistoryMapper.selectList(qw); - } - - /** - * 批量新增库存记录 - * - * @param list 库存记录列表 - * @return 结果 - */ - public int batchInsert(List list) { - if (CollUtil.isEmpty(list)) { - return 0; - } - int re = 0; - for (int s = 0; s < list.size(); s += CommonConstant.BATCH_SIZE) { - re += inventoryHistoryMapper.batchInsert(list.subList(s, Math.min(s + CommonConstant.BATCH_SIZE, list.size()))); - } - return re; - } - -} diff --git a/wms/src/main/java/com/cyl/wms/service/InventoryMovementDetailService.java b/wms/src/main/java/com/cyl/wms/service/InventoryMovementDetailService.java deleted file mode 100644 index 14192a7..0000000 --- a/wms/src/main/java/com/cyl/wms/service/InventoryMovementDetailService.java +++ /dev/null @@ -1,186 +0,0 @@ -package com.cyl.wms.service; - -import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; -import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; -import com.cyl.wms.convert.InventoryMovementDetailConvert; -import com.cyl.wms.domain.InventoryMovement; -import com.cyl.wms.domain.InventoryMovementDetail; -import com.cyl.wms.mapper.InventoryMovementDetailMapper; -import com.cyl.wms.pojo.query.InventoryMovementDetailQuery; -import com.cyl.wms.pojo.vo.InventoryMovementDetailVO; -import com.github.pagehelper.PageHelper; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.data.domain.Pageable; -import org.springframework.stereotype.Service; - -import java.math.BigDecimal; -import java.time.LocalDateTime; -import java.util.LinkedList; -import java.util.List; - -/** - * 库存移动详情Service业务层处理 - * - * @author zcc - */ -@Service -public class InventoryMovementDetailService { - @Autowired - private InventoryMovementDetailMapper inventoryMovementDetailMapper; - @Autowired - private InventoryMovementDetailConvert convert; - - /** - * 查询库存移动详情 - * - * @param id 库存移动详情主键 - * @return 库存移动详情 - */ - public InventoryMovementDetail selectById(Long id) { - return inventoryMovementDetailMapper.selectById(id); - } - - /** - * 查询库存移动详情列表 - * - * @param query 查询条件 - * @param page 分页条件 - * @return 库存移动详情 - */ - public List selectList(InventoryMovementDetailQuery query, Pageable page) { - if (page != null) { - PageHelper.startPage(page.getPageNumber() + 1, page.getPageSize()); - } - QueryWrapper qw = new QueryWrapper<>(); - qw.eq("del_flag", 0); - Long inventoryMovementId = query.getInventoryMovementId(); - if (inventoryMovementId != null) { - qw.eq("inventory_movement_id", inventoryMovementId); - } - Long itemId = query.getItemId(); - if (itemId != null) { - qw.eq("item_id", itemId); - } - BigDecimal planQuantity = query.getPlanQuantity(); - if (planQuantity != null) { - qw.eq("plan_quantity", planQuantity); - } - BigDecimal realQuantity = query.getRealQuantity(); - if (realQuantity != null) { - qw.eq("real_quantity", realQuantity); - } - Long sourceRackId = query.getSourceRackId(); - if (sourceRackId != null) { - qw.eq("source_rack_id", sourceRackId); - } - Long sourceWarehouseId = query.getSourceWarehouseId(); - if (sourceWarehouseId != null) { - qw.eq("source_warehouse_id", sourceWarehouseId); - } - Long sourceAreaId = query.getSourceAreaId(); - if (sourceAreaId != null) { - qw.eq("source_area_id", sourceAreaId); - } - Integer moveStatus = query.getMoveStatus(); - if (moveStatus != null) { - qw.eq("move_status", moveStatus); - } - Long targetRackId = query.getTargetRackId(); - if (targetRackId != null) { - qw.eq("target_rack_id", targetRackId); - } - Long targetWarehouseId = query.getTargetWarehouseId(); - if (targetWarehouseId != null) { - qw.eq("target_warehouse_id", targetWarehouseId); - } - Long targetAreaId = query.getTargetAreaId(); - if (targetAreaId != null) { - qw.eq("target_area_id", targetAreaId); - } - return inventoryMovementDetailMapper.selectList(qw); - } - - public List toVos(List items) { - List list = convert.dos2vos(items); - list.forEach(itemVO -> { - List sourcePlace = new LinkedList<>(); - List targetPlace = new LinkedList<>(); - if (itemVO.getSourceWarehouseId() != null) { - sourcePlace.add(itemVO.getSourceWarehouseId()); - } - if (itemVO.getSourceAreaId() != null) { - sourcePlace.add(itemVO.getSourceAreaId()); - } - if (itemVO.getSourceRackId() != null) { - sourcePlace.add(itemVO.getSourceRackId()); - } - itemVO.setSourcePlace(sourcePlace); - if (itemVO.getTargetWarehouseId() != null) { - targetPlace.add(itemVO.getTargetWarehouseId()); - } - if (itemVO.getTargetAreaId() != null) { - targetPlace.add(itemVO.getTargetAreaId()); - } - if (itemVO.getTargetRackId() != null) { - targetPlace.add(itemVO.getTargetRackId()); - } - itemVO.setTargetPlace(targetPlace); - }); - return list; - } - - /** - * 新增库存移动详情 - * - * @param inventoryMovementDetail 库存移动详情 - * @return 结果 - */ - public int insert(InventoryMovementDetail inventoryMovementDetail) { - inventoryMovementDetail.setDelFlag(0); - inventoryMovementDetail.setCreateTime(LocalDateTime.now()); - return inventoryMovementDetailMapper.insert(inventoryMovementDetail); - } - - /** - * 修改库存移动详情 - * - * @param inventoryMovementDetail 库存移动详情 - * @return 结果 - */ - public int update(InventoryMovementDetail inventoryMovementDetail) { - return inventoryMovementDetailMapper.updateById(inventoryMovementDetail); - } - - /** - * 批量删除库存移动详情 - * - * @param ids 需要删除的库存移动详情主键 - * @return 结果 - */ - public int deleteByIds(Long[] ids) { - return inventoryMovementDetailMapper.updateDelFlagByIds(ids); - } - - /** - * 删除库存移动详情信息 - * - * @param id 库存移动详情主键 - * @return 结果 - */ - public int deleteById(Long id) { - Long[] ids = {id}; - return inventoryMovementDetailMapper.updateDelFlagByIds(ids); - } - - /** - * 逻辑删除 库存移动详情信息 - * - * @param inventoryMovement 库存移动单 - */ - public void updateDelFlag(InventoryMovement inventoryMovement) { - LambdaUpdateWrapper updateWrapper = new LambdaUpdateWrapper() - .eq(InventoryMovementDetail::getInventoryMovementId, inventoryMovement.getId()) - .set(InventoryMovementDetail::getDelFlag, 1); - inventoryMovementDetailMapper.update(null, updateWrapper); - } -} diff --git a/wms/src/main/java/com/cyl/wms/service/InventoryMovementService.java b/wms/src/main/java/com/cyl/wms/service/InventoryMovementService.java deleted file mode 100644 index b2e9c77..0000000 --- a/wms/src/main/java/com/cyl/wms/service/InventoryMovementService.java +++ /dev/null @@ -1,320 +0,0 @@ -package com.cyl.wms.service; - -import cn.hutool.core.collection.CollUtil; -import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; -import com.cyl.wms.constant.InventoryMovementConstant; -import com.cyl.wms.convert.InventoryMovementConvert; -import com.cyl.wms.convert.InventoryMovementDetailConvert; -import com.cyl.wms.domain.InventoryHistory; -import com.cyl.wms.domain.InventoryMovement; -import com.cyl.wms.domain.InventoryMovementDetail; -import com.cyl.wms.domain.Item; -import com.cyl.wms.mapper.InventoryMovementDetailMapper; -import com.cyl.wms.mapper.InventoryMovementMapper; -import com.cyl.wms.pojo.query.InventoryMovementDetailQuery; -import com.cyl.wms.pojo.query.InventoryMovementQuery; -import com.cyl.wms.pojo.query.ItemQuery; -import com.cyl.wms.pojo.vo.InventoryMovementDetailVO; -import com.cyl.wms.pojo.vo.InventoryMovementVO; -import com.cyl.wms.pojo.vo.ItemVO; -import com.cyl.wms.pojo.vo.form.InventoryMovementFrom; -import com.github.pagehelper.PageHelper; -import com.ruoyi.common.utils.SecurityUtils; -import lombok.extern.slf4j.Slf4j; -import org.apache.commons.lang3.StringUtils; -import org.springframework.beans.BeanUtils; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.data.domain.Page; -import org.springframework.data.domain.PageImpl; -import org.springframework.data.domain.Pageable; -import org.springframework.stereotype.Service; -import org.springframework.transaction.annotation.Transactional; -import org.springframework.util.CollectionUtils; - -import java.math.BigDecimal; -import java.time.LocalDateTime; -import java.util.*; -import java.util.stream.Collectors; - -/** - * 库存移动Service业务层处理 - * - * @author zcc - */ -@Service -@Slf4j -public class InventoryMovementService { - @Autowired - private InventoryMovementMapper inventoryMovementMapper; - @Autowired - private InventoryMovementConvert convert; - @Autowired - private InventoryMovementDetailMapper inventoryMovementDetailMapper; - @Autowired - private InventoryMovementDetailService inventoryMovementDetailService; - @Autowired - private ItemService itemService; - @Autowired - private InventoryMovementDetailConvert detailConvert; - @Autowired - private InventoryHistoryService inventoryHistoryService; - @Autowired - private InventoryService inventoryService; - - - /** - * 查询库存移动 - * - * @param id 库存移动主键 - * @return 库存移动 - */ - public InventoryMovementFrom selectById(Long id) { - - InventoryMovement order = inventoryMovementMapper.selectById(id); - if (order == null) { - return null; - } - InventoryMovementDetailQuery query = new InventoryMovementDetailQuery(); - query.setInventoryMovementId(id); - InventoryMovementFrom form = convert.do2form(order); - List details = inventoryMovementDetailService.selectList(query, null); - List detailVOS = inventoryMovementDetailService.toVos(details); - form.setDetails(detailVOS); - if (!CollUtil.isEmpty(form.getDetails())) { - List itemIds = form.getDetails().stream().map(InventoryMovementDetailVO::getItemId).distinct().collect(Collectors.toList()); - ItemQuery query1 = new ItemQuery(); - query1.setIds(itemIds); - List list = itemService.selectList(query1, null); - List items = itemService.toVos(list); - form.setItems(items); - } - return form; - } - - /** - * 查询库存移动列表 - * - * @param query 查询条件 - * @param page 分页条件 - * @return 库存移动 - */ - public Page selectList(InventoryMovementQuery query, Pageable page) { - if (page != null) { - PageHelper.startPage(page.getPageNumber() + 1, page.getPageSize()); - } - QueryWrapper qw = new QueryWrapper<>(); - qw.orderByDesc("id"); - qw.eq("del_flag", 0); - String inventoryMovementNo = query.getInventoryMovementNo(); - if (!StringUtils.isEmpty(inventoryMovementNo)) { - qw.eq("inventory_movement_no", inventoryMovementNo); - } - Integer status = query.getStatus(); - if (status != null) { - qw.eq("status", status); - } - List list = inventoryMovementMapper.selectList(qw); - if (CollectionUtils.isEmpty(list)) { - return new PageImpl<>(Collections.EMPTY_LIST, page, 0); - } - List res = convert.dos2vos(list); - if (!CollUtil.isEmpty(res)) { - List ids = res.stream().map(InventoryMovementVO::getId).collect(Collectors.toList()); - Map id2count = inventoryMovementDetailMapper.countByOrderId(ids) - .stream().collect(Collectors.toMap(InventoryMovementVO::getId, it -> it)); - res.forEach(it -> { - InventoryMovementVO vo = id2count.get(it.getId()); - if (vo != null) { - it.setDetailCount(vo.getDetailCount()); - it.setItemCount(vo.getItemCount()); - } - }); - } - return new PageImpl<>(res, page, ((com.github.pagehelper.Page) list).getTotal()); - } - - /** - * 新增库存移动 - * - * @param inventoryMovement 库存移动 - * @return 结果 - */ - public int insert(InventoryMovement inventoryMovement) { - inventoryMovement.setDelFlag(0); - inventoryMovement.setCreateTime(LocalDateTime.now()); - return inventoryMovementMapper.insert(inventoryMovement); - } - - /** - * 修改库存移动 - * - * @param inventoryMovement 库存移动 - * @return 结果 - */ - public int update(InventoryMovement inventoryMovement) { - return inventoryMovementMapper.updateById(inventoryMovement); - } - - /** - * 批量删除库存移动 - * - * @param ids 需要删除的库存移动主键 - * @return 结果 - */ - @Transactional - public int deleteByIds(Long[] ids) { - int flag = 0; - for (Long id : ids) { - InventoryMovement inventoryMovement = inventoryMovementMapper.selectById(id); - if (inventoryMovement == null) { - continue; - } - Integer inventoryMovementStatus = inventoryMovement.getStatus(); - // 1. 逻辑删除移库单 - flag += inventoryMovementMapper.updateDelFlagByIds(ids); - // 2. 逻辑删除移库单详情 - inventoryMovementDetailService.updateDelFlag(inventoryMovement); - - if (inventoryMovementStatus != InventoryMovementConstant.ALL_IN && inventoryMovementStatus != InventoryMovementConstant.PART_IN) { - // 未移库的可以直接删除 - continue; - } - - // 3. 查询库存记录 - List inventoryHistories = inventoryHistoryService.selectByForm(inventoryMovement.getId(), - InventoryMovementConstant.IN_TYPE, InventoryMovementConstant.OUT_TYPE); - - // 翻转库存记录的数量 - inventoryHistories.forEach(it -> { - it.setQuantity(it.getQuantity().negate()); - log.info("删除移库单:{} 回滚库存:{} 数量:{}", inventoryMovement.getInventoryMovementNo(), - it.getWarehouseId() + "_" + it.getAreaId() + "_" + it.getRackId() + "_" + it.getItemId(), it.getQuantity()); - }); - - // 4. 回滚库存 - inventoryService.batchUpdate1(inventoryHistories); - - // 5. 删除库存记录 - inventoryHistoryService.deleteByForm(inventoryMovement.getId(), InventoryMovementConstant.IN_TYPE, InventoryMovementConstant.OUT_TYPE); - - // todo 6. 回滚供应商流水 -// supplierTransactionService.deleteByForm(inventoryMovement.getId(), inventoryMovement.getReceiptOrderType()); - } - return flag; - } - - /** - * 删除库存移动信息 - * - * @param id 库存移动主键 - * @return 结果 - */ - public int deleteById(Long id) { - Long[] ids = {id}; - return inventoryMovementMapper.updateDelFlagByIds(ids); - } - - @Transactional - public int addOrUpdate(InventoryMovementFrom order) { - int res; - // 1. 新增 - if (order.getId() == null) { - order.setDelFlag(0); - order.setCreateTime(LocalDateTime.now()); - res = inventoryMovementMapper.insert(order); - saveDetails(order.getId(), order.getDetails()); - return res; - } - // 2. 编辑 - QueryWrapper qw = new QueryWrapper<>(); - qw.eq("inventory_movement_id", order.getId()); - - // 新旧详情对比, 生成 库存记录修改 - List details = order.getDetails(); - Map dbDetailMap = inventoryMovementDetailMapper.selectList(qw).stream().collect(Collectors.toMap(InventoryMovementDetail::getId, it -> it)); - List inList = new ArrayList<>(); - List outList = new ArrayList<>(); - LocalDateTime now = LocalDateTime.now(); - Long userId = SecurityUtils.getUserId(); - details.forEach(it -> { - Integer status = it.getMoveStatus(); - if (status != InventoryMovementConstant.PART_IN && status != InventoryMovementConstant.ALL_IN) { - return; - } - // 新增时, status一定是未操作, 所以这个地方必定有值 - InventoryMovementDetail dbDetail = dbDetailMap.get(it.getId()); - // 如果上次的状态不是部分移动或者全部移动,则本次的库存变化为本次的全部 - Integer status1 = dbDetail.getMoveStatus(); - BigDecimal added; - - if (status1 != InventoryMovementConstant.PART_IN && status1 != InventoryMovementConstant.ALL_IN) { - added = it.getRealQuantity(); - } else { - BigDecimal before = dbDetail.getRealQuantity() == null ? BigDecimal.ZERO : dbDetail.getRealQuantity(); - BigDecimal after = it.getRealQuantity() == null ? BigDecimal.ZERO : it.getRealQuantity(); - // 数量变化有问题 - if (before.compareTo(after) >= 0) { - return; - } - added = after.subtract(before); - } - //判断库存是否足够出库 - inventoryService.checkInventory(it.getItemId(), it.getSourceWarehouseId(), it.getSourceAreaId(), it.getSourceRackId(), null, added); - - // 1. 创建移库日志 - InventoryHistory h = detailConvert.do2InventoryHistory(it); - h.setFormId(order.getId()); - h.setFormType(InventoryMovementConstant.IN_TYPE); - h.setRackId(it.getTargetRackId()); - h.setWarehouseId(it.getTargetWarehouseId()); - h.setAreaId(it.getTargetAreaId()); - h.setQuantity(added); - h.setDelFlag(0); - h.setId(null); - h.setCreateTime(now); - h.setCreateBy(userId); - inList.add(h); - - // 出库日志 - InventoryHistory out = new InventoryHistory(); - BeanUtils.copyProperties(h, out); - out.setFormType(InventoryMovementConstant.OUT_TYPE); - out.setQuantity(added.negate()); - out.setRackId(it.getSourceRackId()); - out.setWarehouseId(it.getSourceWarehouseId()); - out.setAreaId(it.getSourceAreaId()); - outList.add(out); - }); - if (outList.size() > 0) { - inventoryHistoryService.batchInsert(outList); - outList.forEach(it -> it.setQuantity(it.getQuantity().negate())); - inventoryService.batchUpdate1(outList); - } - if (inList.size() > 0) { - inventoryHistoryService.batchInsert(inList); - inventoryService.batchUpdate1(inList); - } - // 2.1 先删除details 再重新保存 - inventoryMovementDetailMapper.delete(qw); - saveDetails(order.getId(), order.getDetails()); - - // 2.2 更新移库单 - //判断移库单的整体状态 - Set statusList = order.getDetails().stream().map(it -> it.getMoveStatus()).collect(Collectors.toSet()); - if (statusList.size() == 1) { - order.setStatus(statusList.iterator().next()); - } else if (statusList.contains(InventoryMovementConstant.PART_IN)) { - order.setStatus(InventoryMovementConstant.PART_IN); - } - res = inventoryMovementMapper.updateById(order); - return res; - } - - private void saveDetails(Long orderId, List details) { - if (!CollUtil.isEmpty(details)) { - details.forEach(it -> it.setInventoryMovementId(orderId)); - List inventoryMovementDetails = detailConvert.vos2dos(details); - inventoryMovementDetailMapper.batchInsert(inventoryMovementDetails); - } - } -} diff --git a/wms/src/main/java/com/cyl/wms/service/InventoryService.java b/wms/src/main/java/com/cyl/wms/service/InventoryService.java deleted file mode 100644 index 2379b50..0000000 --- a/wms/src/main/java/com/cyl/wms/service/InventoryService.java +++ /dev/null @@ -1,638 +0,0 @@ -package com.cyl.wms.service; - -import cn.hutool.core.collection.CollUtil; -import cn.hutool.core.util.StrUtil; -import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; -import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; -import com.baomidou.mybatisplus.core.toolkit.Wrappers; -import com.cyl.wms.convert.InventoryConvert; -import com.cyl.wms.domain.*; -import com.cyl.wms.mapper.InventoryMapper; -import com.cyl.wms.mapper.ItemMapper; -import com.cyl.wms.pojo.query.InventoryQuery; -import com.cyl.wms.pojo.vo.AreaAndItemInfo; -import com.cyl.wms.pojo.vo.InventoryHistoryVO; -import com.cyl.wms.pojo.vo.InventoryVO; -import com.cyl.wms.pojo.vo.PlaceAndItem; -import com.github.pagehelper.PageHelper; -import com.ruoyi.common.constant.CommonConstant; -import com.ruoyi.common.constant.HttpStatus; -import com.ruoyi.common.core.domain.entity.SysDictData; -import com.ruoyi.common.exception.ServiceException; -import com.ruoyi.common.exception.WmsServiceException; -import com.ruoyi.common.utils.SecurityUtils; -import com.ruoyi.common.utils.SortUtil; -import com.ruoyi.system.service.ISysDictDataService; -import lombok.extern.slf4j.Slf4j; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.data.domain.Page; -import org.springframework.data.domain.PageImpl; -import org.springframework.data.domain.Pageable; -import org.springframework.stereotype.Service; -import org.springframework.transaction.annotation.Transactional; - -import java.math.BigDecimal; -import java.time.LocalDate; -import java.time.LocalDateTime; -import java.time.LocalTime; -import java.util.*; -import java.util.function.Function; -import java.util.stream.Collectors; - -/** - * 库存Service业务层处理 - * - * @author zcc - */ -@Service -@Slf4j -public class InventoryService { - @Autowired - private InventoryMapper inventoryMapper; - @Autowired - private InventoryConvert inventoryConvert; - @Autowired - private WarehouseService warehouseService; - @Autowired - private AreaService areaService; - @Autowired - private RackService rackService; - @Autowired - private ItemService itemService; - @Autowired - private ItemMapper itemMapper; - @Autowired - private ItemTypeService itemTypeService; - @Autowired - private ISysDictDataService sysDictDataService; - - /** - * 查询库存 - * - * @param id 库存主键 - * @return 库存 - */ - public Inventory selectById(Long id) { - return inventoryMapper.selectById(id); - } - - /** - * 查询库存列表 - * - * @param query 查询条件 - * @param page 分页条件 - * @return 库存 - */ - public List selectList(InventoryQuery query, Pageable page) { - if (page != null) { - PageHelper.startPage(page.getPageNumber() + 1, page.getPageSize()); - } - QueryWrapper qw = new QueryWrapper<>(); - Long itemId = query.getItemId(); - if (itemId != null) { - qw.eq("item_id", itemId); - } - Long rackId = query.getRackId(); - if (rackId != null) { - qw.eq("rack_id", rackId); - } - if (query.getWarehouseId() != null) { - qw.eq("warehouse_id", query.getWarehouseId()); - } - if (query.getAreaId() != null) { - qw.eq("area_id", query.getAreaId()); - } - if (query.getQuantityStart() != null) { - qw.ge("quantity", query.getQuantityStart()); - } - if (query.getQuantityEnd() != null) { - qw.le("quantity", query.getQuantityEnd()); - } - if (StrUtil.isNotBlank(query.getBatch())) { - qw.eq("batch", query.getBatch()); - } - if (CollUtil.isNotEmpty(query.getItemIds())) { - qw.in("item_id", query.getItemIds()); - } - return getInventoryList(query.getPanelType(), qw); - } - - /** - * 新增库存 - * - * @param inventory 库存 - * @return 结果 - */ - public int insert(Inventory inventory) { - inventory.setDelFlag(0); - inventory.setCreateTime(LocalDateTime.now()); - if (inventory.getWarehouseId() == null) { - inventory.setWarehouseId(-1L); - } - if (inventory.getAreaId() == null) { - inventory.setAreaId(-1L); - } - if (inventory.getRackId() == null) { - inventory.setRackId(-1L); - } - return inventoryMapper.insert(inventory); - } - - /** - * 修改库存 - * - * @param inventory 库存 - * @return 结果 - */ - public int update(Inventory inventory) { - return inventoryMapper.updateById(inventory); - } - - /** - * 批量删除库存 - * - * @param ids 需要删除的库存主键 - * @return 结果 - */ - public int deleteByIds(Long[] ids) { - return inventoryMapper.updateDelFlagByIds(ids); - } - - /** - * 删除库存信息 - * - * @param id 库存主键 - * @return 结果 - */ - public int deleteById(Long id) { - Long[] ids = {id}; - return inventoryMapper.updateDelFlagByIds(ids); - } - - public List getInventoryList(Long panelType, QueryWrapper qw) { - List items; - if (Objects.equals(panelType, InventoryQuery.WAREHOUSE)) { - qw.eq("del_flag", 0); - items = inventoryMapper.selectListGroupByWarehouseId(qw); - } else if (Objects.equals(panelType, InventoryQuery.AREA)) { - qw.eq("del_flag", 0); - items = inventoryMapper.selectListGroupByAreaId(qw); - } else if (Objects.equals(panelType, InventoryQuery.ITEMTYPE)) { - qw.eq("wi.del_flag", 0); - items = inventoryMapper.selectListGroupByItemTypeId(qw); - } else { - // 物料 - qw.eq("del_flag", 0); - qw.orderBy(true, false, "item_id"); - items = inventoryMapper.selectList(qw); - } - if (CollUtil.isEmpty(items)) { - return items; - } - return items; - } - - private void injectItemType(List items) { - if (CollUtil.isEmpty(items)) { - return; - } - Set itemIds = items.stream().map(InventoryVO::getItemId).collect(Collectors.toSet()); - Map itemIdAndTypeId = itemService.selectByIdIn(itemIds).stream().filter(item -> StrUtil.isNotBlank(item.getItemType())).collect(Collectors.toMap(Item::getId, it -> Long.parseLong(it.getItemType()))); - Map itemTypeMap = itemTypeService.selectByIdIn(itemIdAndTypeId.values()).stream().collect(Collectors.toMap(ItemType::getItemTypeId, it -> it)); - items.forEach(it -> { - Long type_key = itemIdAndTypeId.get(it.getItemId()); - if (it.getItemId() != null && itemTypeMap.containsKey(type_key)) { - it.setItemTypeName(itemTypeMap.get(type_key).getTypeName()); - } - }); - } - - public boolean canOutStock(Long itemId, Long warehouseId, Long areaId, Long rackId, BigDecimal quantity) { - QueryWrapper qw = new QueryWrapper<>(); - qw.eq("item_id", itemId) - .eq("warehouse_id", warehouseId) - .ge("quantity", quantity); - if (rackId != null) { - qw.eq("rack_id", rackId); - } - if (areaId != null) { - qw.eq("area_id", areaId); - } - return inventoryMapper.selectCount(qw) > 0; - } - - /* - * 根据物料id查询库存 - * */ - public Inventory queryInventoryByItemId(Long itemId, Long warehouseId, Long areaId, Long rackId, String batch) { - QueryWrapper qw = new QueryWrapper<>(); - qw.eq("item_id", itemId).eq("warehouse_id", warehouseId); - if (rackId != null) { - qw.eq("rack_id", rackId); - } - if (areaId != null) { - qw.eq("area_id", areaId); - } - if (StrUtil.isNotBlank(batch)) { - qw.eq("batch", batch); - } else { - qw.isNull("batch"); - } - return inventoryMapper.selectOne(qw); - } - - /* - * 判断库存是否足够出库 - * */ - public void checkInventory(Long itemId, Long warehouseId, Long areaId, Long rackId, String batch, BigDecimal added) { - HashMap map = new HashMap<>(); - map.put("itemId", itemId); - Inventory inventory = this.queryInventoryByItemId(itemId, warehouseId, areaId, rackId, batch); - if (inventory == null) { - Item item = itemService.selectById(itemId); - String msg = "商品:" + item.getItemName() + "(" + item.getItemNo() + ")" + ",库存不存在 无法出库
"; - throw new WmsServiceException(msg, HttpStatus.INVENTORY_SHORTAGE, map); - } else if (inventory.getQuantity().compareTo(added) < 0) { - Item item = itemService.selectById(itemId); - String msg = "商品:[" + item.getItemName() + "] 库存不足,无法出库" + - "
计划数量:" + added + ""; - throw new WmsServiceException(msg, HttpStatus.INVENTORY_SHORTAGE, map); - } - } - - public int batchUpdate1(List list) { - if (CollUtil.isEmpty(list)) { - return 0; - } - LocalDateTime now = LocalDateTime.now(); - Long userId = SecurityUtils.getUserId(); - // 对插入的数据进行分组 - List racks = new ArrayList<>(); - List areas = new ArrayList<>(); - List warehouses = new ArrayList<>(); - list.forEach(it -> { - if (it.getRackId() != null) { - racks.add(it); - return; - } - if (it.getAreaId() != null) { - areas.add(it); - return; - } - warehouses.add(it); - }); - int res = 0; - if (warehouses.size() > 0) { - res += saveData(warehouses, now, userId, - it -> it.getWarehouseId() + "_" + it.getItemId() + "_" + it.getBatch(), - inventoryMapper::selectAllByWarehouseAndItemId - ); - } - if (areas.size() > 0) { - res += saveData(areas, now, userId, - it -> it.getWarehouseId() + "_" + it.getAreaId() + "_" + it.getItemId() + "_" + it.getBatch(), - inventoryMapper::selectAllByAreaAndItemId - ); - } - if (racks.size() > 0) { - res += saveData(racks, now, userId, - it -> it.getWarehouseId() + "_" + it.getAreaId() + "_" + it.getRackId() + "_" + it.getItemId() + "_" + it.getBatch(), - inventoryMapper::selectAllByRackAndItemId - ); - } - return res; - } - - private int saveData(List list, LocalDateTime now, Long userId, - Function keyFunc, - Function, List> listFunc) { - List exists = listFunc.apply(list); - Map existKeys = exists.stream().collect(Collectors.toMap(keyFunc, Inventory::getId)); - List updates = new ArrayList<>(); - List adds1 = new ArrayList<>(); - list.forEach(it -> { - String key = keyFunc.apply(it); - Inventory v; - if (existKeys.containsKey(key)) { - v = new Inventory(); - v.setId(existKeys.get(key)); - v.setQuantity(it.getQuantity()); - updates.add(v); - return; - } - v = inventoryConvert.inventoryHistory2invertory(it); - v.setCreateTime(now); - v.setCreateBy(userId); - adds1.add(v); - }); - int re1 = batchUpdateQuantity(updates, now, userId); - int re2 = batchInsert(adds1); - return re1 + re2; - } - - public int batchUpdateQuantity(List updates, LocalDateTime updateTime, Long userId) { - if (CollUtil.isEmpty(updates)) { - return 0; - } - int re = 0; - for (int s = 0; s < updates.size(); s += CommonConstant.BATCH_SIZE) { - re += inventoryMapper.batchUpdateQuantityById( - updates.subList(s, Math.min(s + CommonConstant.BATCH_SIZE, updates.size())), - updateTime, - userId - ); - } - return re; - } - - public int batchInsert(List list) { - if (CollUtil.isEmpty(list)) { - return 0; - } - int re = 0; - for (int s = 0; s < list.size(); s += CommonConstant.BATCH_SIZE) { - re += inventoryMapper.batchInsert(list.subList(s, Math.min(s + CommonConstant.BATCH_SIZE, list.size()))); - } - return re; - } - - public Page queryPage(InventoryQuery query, Pageable page) { - if (StrUtil.isNotBlank(query.getItemName())) { - LambdaQueryWrapper itemLqw = Wrappers.lambdaQuery(); - itemLqw.select(Item::getId); - itemLqw.like(Item::getItemName, query.getItemName()); - List items = itemMapper.selectList(itemLqw); - if (CollUtil.isNotEmpty(items)) { - query.setItemIds(items.stream().map(Item::getId).collect(Collectors.toList())); - } else { - return new PageImpl<>(new ArrayList<>(), page, 0); - } - } - List list = selectList(query, page); - List res = inventoryConvert.dos2vos(list); - injectAreaAndItemInfo(res); - injectItemType(res); - return new PageImpl<>(res, page, ((com.github.pagehelper.Page) list).getTotal()); - } - - public void injectAreaAndItemInfo(List res) { - if (CollUtil.isEmpty(res)) { - return; - } - // 注入 仓库,货区,货架 id - Set warehouseIds = new HashSet<>(); - Set areaIds = new HashSet<>(); - Set rackIds = new HashSet<>(); - Set itemIds = new HashSet<>(); - res.forEach(it -> { - if (it.getWarehouseId() != null) { - warehouseIds.add(it.getWarehouseId()); - } - if (it.getAreaId() != null) { - areaIds.add(it.getAreaId()); - } - if (it.getRackId() != null) { - rackIds.add(it.getRackId()); - } - if (it.getItemId() != null) { - itemIds.add(it.getItemId()); - } - }); - Map warehouses = warehouseService.selectByIdIn(warehouseIds) - .stream().collect(Collectors.toMap(Warehouse::getId, it -> it)); - Map areas = areaService.selectByIdIn(areaIds) - .stream().collect(Collectors.toMap(Area::getId, it -> it)); - Map racks = rackService.selectByIdIn(rackIds) - .stream().collect(Collectors.toMap(Rack::getId, it -> it)); - Map items = itemService.selectByIdIn(itemIds) - .stream().collect(Collectors.toMap(Item::getId, it -> it)); - - res.forEach(it -> { - if (it.getWarehouseId() != null && warehouses.containsKey(it.getWarehouseId())) { - Warehouse warehouse = warehouses.get(it.getWarehouseId()); - it.setWarehouseName(warehouse.getWarehouseName()); - it.setWarehouseDelFlag(warehouse.getDelFlag()); - } - if (it.getAreaId() != null && areas.containsKey(it.getAreaId())) { - it.setAreaName(areas.get(it.getAreaId()).getAreaName()); - } - if (it.getRackId() != null && racks.containsKey(it.getRackId())) { - it.setRackName(racks.get(it.getRackId()).getRackName()); - } - if (it.getItemId() != null && items.containsKey(it.getItemId())) { - Item item = items.get(it.getItemId()); - it.setItemName(item.getItemName()); - it.setItemNo(item.getItemNo()); - it.setItemDelFlag(item.getDelFlag()); - it.setItemUnit(item.getUnit()); - it.setItemUnitPrice(item.getUnitPrice()); - it.setItemUnit(item.getUnit()); - it.setItemSpecification(item.getSpecification()); - it.setSafetyQuantity(item.getQuantity()); - } - }); - } - - public Page queryWarning(Pageable page) { - if (page != null) { - PageHelper.startPage(page.getPageNumber() + 1, page.getPageSize(), SortUtil.sort2string(page.getSort())); - } - List inventories = inventoryMapper.selectWarning(); - List res = inventoryConvert.dos2vos(inventories); - injectAreaAndItemInfo(res); - List allItems = itemService.getAllSaftyItems(); - Map saftyItems = allItems.stream().collect(Collectors.toMap(Item::getId, item -> item.getQuantity())); - res.forEach(item -> { - BigDecimal saftyQuantify = saftyItems.get(item.getItemId()); - item.setSafetyQuantity(saftyQuantify); - }); - return new PageImpl<>(res, page, ((com.github.pagehelper.Page) inventories).getTotal()); - } - - public List queryAll(InventoryQuery query) { - - List list = selectList(query, null); - List res = inventoryConvert.dos2vos(list); - injectAreaAndItemInfo(res); - return res; - } - - /** - * 查询所有有效的物料 - */ - public List queryValidAll() { - List list = inventoryMapper.selectValidAll(); - List res = inventoryConvert.dos2vos(list); - injectAreaAndItemInfo(res); - return res; - } - - /** - * 注入物料编码和名称 - * - * @param res 物料 - */ - public void injectItemNoAndItemName(List res) { - if (CollUtil.isEmpty(res)) { - return; - } - Set items = res.stream().map(Inventory::getItemId).collect(Collectors.toSet()); - Map itemMap = itemService.selectByIdIn(items).stream().collect(Collectors.toMap(Item::getId, it -> it)); - res.forEach(it -> { - if (it.getItemId() != null && itemMap.containsKey(it.getItemId())) { - it.setItemNo(itemMap.get(it.getItemId()).getItemNo()); - it.setItemName(itemMap.get(it.getItemId()).getItemName()); - } - }); - } - - /** - * 注入仓库名称 - * - * @param res 物料 - */ - public void injectWarehouseName(List res) { - if (CollUtil.isEmpty(res)) { - return; - } - Set warehouses = res.stream().map(Inventory::getWarehouseId).collect(Collectors.toSet()); - Map warehouseMap = warehouseService.selectByIdIn(warehouses).stream().collect(Collectors.toMap(Warehouse::getId, it -> it)); - res.forEach(it -> { - if (it.getWarehouseId() != null && warehouseMap.containsKey(it.getWarehouseId())) { - it.setWarehouseName(warehouseMap.get(it.getWarehouseId()).getWarehouseName()); - } - }); - } - - /** - * 注入库区名称 - * - * @param res 物料 - */ - public void injectAreaName(List res) { - if (CollUtil.isEmpty(res)) { - return; - } - Set areas = res.stream().map(Inventory::getAreaId).collect(Collectors.toSet()); - Map areaMap = areaService.selectByIdIn(areas).stream().collect(Collectors.toMap(Area::getId, it -> it)); - res.forEach(it -> { - if (it.getAreaId() != null && areaMap.containsKey(it.getAreaId())) { - it.setAreaName(areaMap.get(it.getAreaId()).getAreaName()); - } - }); - } - - public void injectDictDataLabel(List res) { - if (CollUtil.isEmpty(res)) { - return; - } - Set dictTypes = new HashSet<>(); - dictTypes.add("wms_inventory_oper_type"); - Map sysDictDataMap = sysDictDataService.selectDictDataByTypes(dictTypes).stream().collect(Collectors.toMap(SysDictData::getDictValue, it -> it)); - res.forEach(it -> { - if (it.getFormType() != null && sysDictDataMap.containsKey(String.valueOf(it.getFormType()))) { - it.setFormTypeName(sysDictDataMap.get(String.valueOf(it.getFormType())).getDictLabel()); - } - }); - } - - /** - * 逻辑删除 库存记录 - * - * @param itemIds 物料ids - */ - public Integer deleteByItemIds(Long[] itemIds) { - LambdaQueryWrapper inventoryLambdaQueryWrapper = new LambdaQueryWrapper<>(); - inventoryLambdaQueryWrapper.select(Inventory::getId); - inventoryLambdaQueryWrapper.in(Inventory::getItemId, Arrays.asList(itemIds)); - // 物料对应的库存记录id - List ids = inventoryMapper.selectList(inventoryLambdaQueryWrapper) - .stream().map(Inventory::getId).collect(Collectors.toList()); - if (CollUtil.isEmpty(ids)) { - return 0; - } - Long[] idArr = ids.toArray(new Long[0]); - return inventoryMapper.updateDelFlagByIds(idArr); - } - - /** - * 逻辑删除 库存记录 - * - * @param warehouseIds 仓库ids - */ - @Transactional - public Integer deleteByWarehouseIds(Long[] warehouseIds) { - LambdaQueryWrapper inventoryLambdaQueryWrapper = new LambdaQueryWrapper<>(); - inventoryLambdaQueryWrapper.select(Inventory::getId); - inventoryLambdaQueryWrapper.in(Inventory::getWarehouseId, Arrays.asList(warehouseIds)); - // 仓库对应的库存记录id - List ids = inventoryMapper.selectList(inventoryLambdaQueryWrapper) - .stream().map(Inventory::getId).collect(Collectors.toList()); - if (CollUtil.isEmpty(ids)) { - return 0; - } - Long[] idArr = ids.toArray(new Long[0]); - return inventoryMapper.updateDelFlagByIds(idArr); - } - - /* - * 根据库存分配规则分配库存 - * @param itemId 物料id - * @param planQuantity 计划数量 - * */ - public List allocatedInventory(Long itemId, BigDecimal planQuantity,Integer type) { - List inventoryList = new ArrayList<>(); - if (type == 1) { - // 默认使用仓库库存数量最小优先原则 - inventoryList = inventoryMapper.selectLastInventory(itemId,"asc"); - } else if (type == 2) { - //使用仓库库存数量最大优先原则 - inventoryList = inventoryMapper.selectLastInventory(itemId,"desc"); - } - - if (CollUtil.isEmpty(inventoryList)) { - log.error("库存不足,itemId:{},计划数量:{}", itemId, planQuantity); - throw new ServiceException("库存不足", HttpStatus.CONFIRMATION); - } - // 拆分物料明细 - List shipmentOrderDetailList = new ArrayList<>(); - for (Inventory inventory : inventoryList) { - ShipmentOrderDetail shipmentOrderDetail = new ShipmentOrderDetail(); - BigDecimal allocatedQuantity; - if (inventory.getQuantity().compareTo(planQuantity) > 0) { - allocatedQuantity = planQuantity; - } else { - allocatedQuantity = inventory.getQuantity(); - } - shipmentOrderDetail.setPlanQuantity(allocatedQuantity); - shipmentOrderDetail.setRealQuantity(allocatedQuantity); - shipmentOrderDetail.setWarehouseId(inventory.getWarehouseId()); - shipmentOrderDetail.setAreaId(inventory.getAreaId()); - shipmentOrderDetail.setRackId(inventory.getRackId()); - shipmentOrderDetail.setItemId(itemId); - shipmentOrderDetailList.add(shipmentOrderDetail); - planQuantity = planQuantity.subtract(inventory.getQuantity()); - if (planQuantity.compareTo(BigDecimal.ZERO) <= 0) { - break; - } - } - // 库存不足 - if (planQuantity.compareTo(BigDecimal.ZERO) > 0) { - throw new ServiceException("库存不足", HttpStatus.CONFIRMATION); - } - return shipmentOrderDetailList; - } - - public Page queryExpiry(Pageable page) { - if (page != null) { - PageHelper.startPage(page.getPageNumber() + 1, page.getPageSize(), SortUtil.sort2string(page.getSort())); - } - LambdaQueryWrapper queryWrapper = Wrappers.lambdaQuery(); - queryWrapper.isNotNull(Inventory::getExpiryDate); - queryWrapper.lt(Inventory::getExpiryDate, LocalDateTime.of(LocalDate.now(), LocalTime.MIN)); - List inventories = inventoryMapper.selectList(queryWrapper); - List res = inventoryConvert.dos2vos(inventories); - injectAreaAndItemInfo(res); - return new PageImpl<>(res, page, ((com.github.pagehelper.Page) inventories).getTotal()); - } -} diff --git a/wms/src/main/java/com/cyl/wms/service/InventorySettlementDetailService.java b/wms/src/main/java/com/cyl/wms/service/InventorySettlementDetailService.java deleted file mode 100644 index 5e65b9e..0000000 --- a/wms/src/main/java/com/cyl/wms/service/InventorySettlementDetailService.java +++ /dev/null @@ -1,257 +0,0 @@ -package com.cyl.wms.service; - -import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; -import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; -import com.cyl.wms.constant.ReceiptOrderConstant; -import com.cyl.wms.constant.ShipmentOrderConstant; -import com.cyl.wms.domain.InventoryHistory; -import com.cyl.wms.domain.InventorySettlementDetail; -import com.cyl.wms.mapper.InventoryHistoryMapper; -import com.cyl.wms.mapper.InventorySettlementDetailMapper; -import com.cyl.wms.pojo.query.InventorySettlementDetailQuery; -import com.cyl.wms.pojo.vo.InventoryVO; -import com.github.pagehelper.PageHelper; -import lombok.extern.slf4j.Slf4j; -import org.apache.commons.lang3.StringUtils; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.data.domain.Pageable; -import org.springframework.stereotype.Service; -import org.springframework.util.CollectionUtils; - -import java.math.BigDecimal; -import java.time.LocalDateTime; -import java.util.*; -import java.util.stream.Collectors; - -/** - * 库存结算明细Service业务层处理 - * - * @author zcc - */ -@Service -@Slf4j -public class InventorySettlementDetailService { - @Autowired - private InventoryService inventoryService; - @Autowired - private InventorySettlementDetailMapper inventorySettlementDetailMapper; - - @Autowired - private InventoryHistoryMapper inventoryHistoryMapper; - - /** - * 查询库存结算明细 - * - * @param id 库存结算明细主键 - * @return 库存结算明细 - */ - public InventorySettlementDetail selectById(Long id) { - return inventorySettlementDetailMapper.selectById(id); - } - - /** - * 查询库存结算明细列表 - * - * @param query 查询条件 - * @param page 分页条件 - * @return 库存结算明细 - */ - public List selectList(InventorySettlementDetailQuery query, Pageable page) { - if (page != null) { - PageHelper.startPage(page.getPageNumber() + 1, page.getPageSize()); - } - QueryWrapper qw = new QueryWrapper<>(); - qw.eq("del_flag", 0); - Long settlementId = query.getSettlementId(); - if (settlementId != null) { - qw.eq("settlement_id", settlementId); - } - Integer settlementType = query.getSettlementType(); - if (settlementType != null) { - qw.eq("settlement_type", settlementType); - } - Long itemId = query.getItemId(); - if (itemId != null) { - qw.eq("item_id", itemId); - } - String itemNo = query.getItemNo(); - if (!StringUtils.isEmpty(itemNo)) { - qw.eq("item_no", itemNo); - } - String itemNameLike = query.getItemNameLike(); - if (!StringUtils.isEmpty(itemNameLike)) { - qw.like("item_name", itemNameLike); - } - Long warehouseId = query.getWarehouseId(); - if (warehouseId != null) { - qw.eq("warehouse_id", warehouseId); - } - String warehouseNo = query.getWarehouseNo(); - if (!StringUtils.isEmpty(warehouseNo)) { - qw.eq("warehouse_no", warehouseNo); - } - String warehouseNameLike = query.getWarehouseNameLike(); - if (!StringUtils.isEmpty(warehouseNameLike)) { - qw.like("warehouse_name", warehouseNameLike); - } - Long areaId = query.getAreaId(); - if (areaId != null) { - qw.eq("area_id", areaId); - } - String areaNo = query.getAreaNo(); - if (!StringUtils.isEmpty(areaNo)) { - qw.eq("area_no", areaNo); - } - String areaNameLike = query.getAreaNameLike(); - if (!StringUtils.isEmpty(areaNameLike)) { - qw.like("area_name", areaNameLike); - } - BigDecimal previousBalance = query.getPreviousBalance(); - if (previousBalance != null) { - qw.eq("previous_balance", previousBalance); - } - BigDecimal currentEnter = query.getCurrentEnter(); - if (currentEnter != null) { - qw.eq("current_enter", currentEnter); - } - BigDecimal currentOut = query.getCurrentOut(); - if (currentOut != null) { - qw.eq("current_out", currentOut); - } - BigDecimal currentCheck = query.getCurrentCheck(); - if (currentCheck != null) { - qw.eq("current_check", currentCheck); - } - BigDecimal currentBalance = query.getCurrentBalance(); - if (currentBalance != null) { - qw.eq("current_balance", currentBalance); - } - return inventorySettlementDetailMapper.selectList(qw); - } - - /** - * 新增库存结算明细 - * - * @param inventorySettlementDetail 库存结算明细 - * @return 结果 - */ - public int insert(InventorySettlementDetail inventorySettlementDetail) { - inventorySettlementDetail.setDelFlag(0); - inventorySettlementDetail.setCreateTime(LocalDateTime.now()); - return inventorySettlementDetailMapper.insert(inventorySettlementDetail); - } - - /** - * 修改库存结算明细 - * - * @param inventorySettlementDetail 库存结算明细 - * @return 结果 - */ - public int update(InventorySettlementDetail inventorySettlementDetail) { - return inventorySettlementDetailMapper.updateById(inventorySettlementDetail); - } - - /** - * 批量删除库存结算明细 - * - * @param ids 需要删除的库存结算明细主键 - * @return 结果 - */ - public int deleteByIds(Long[] ids) { - return inventorySettlementDetailMapper.updateDelFlagByIds(ids); - } - - /** - * 删除库存结算明细信息 - * - * @param id 库存结算明细主键 - * @return 结果 - */ - public int deleteById(Long id) { - Long[] ids = {id}; - return inventorySettlementDetailMapper.updateDelFlagByIds(ids); - } - - /** - * 生成库存结算明细 - * - * @param query 查询条件 - * @return 结果 - */ - public List listByTime(InventorySettlementDetailQuery query) { - - //获取本结算周期的库存历史记录表 - LambdaQueryWrapper qw = new LambdaQueryWrapper<>(); - qw.eq(InventoryHistory::getDelFlag, 0); - if (query.getStartTime() != null) { - qw.between(InventoryHistory::getCreateTime, query.getStartTime(), query.getEndTime()); - } - List inventoryHistories = inventoryHistoryMapper.selectList(qw); - - //按照物料id_仓库id_库区id 分组 - Map> inventoryHistoryMap = inventoryHistories - .stream().collect(Collectors.groupingBy(it -> it.getItemId() + "_" + it.getWarehouseId() + "_" + it.getAreaId())); - - //获取上期结存表 - LambdaQueryWrapper settlementDetailLambdaQueryWrapper = new LambdaQueryWrapper<>(); - settlementDetailLambdaQueryWrapper.eq(InventorySettlementDetail::getDelFlag, 0); - settlementDetailLambdaQueryWrapper.eq(InventorySettlementDetail::getSettlementType, query.getSettlementType()); - settlementDetailLambdaQueryWrapper.orderByDesc(InventorySettlementDetail::getCreateTime); - List inventorySettlementDetails = inventorySettlementDetailMapper.selectList(settlementDetailLambdaQueryWrapper); - //按照物料id_仓库id_库区id 分组 - Map> previousInventorySettlementDetails = inventorySettlementDetails - .stream().collect(Collectors.groupingBy(it -> it.getItemId() + "_" + it.getWarehouseId() + "_" + it.getAreaId())); - - - List list = new LinkedList<>(); - List inventoryList = inventoryService.queryValidAll(); - log.info("有效库存:{}", inventoryList); - inventoryList.forEach(inventoryVO -> { - - - List inventoryHistories1 = inventoryHistoryMap.get(inventoryVO.getItemId() + "_" + inventoryVO.getWarehouseId() + "_" + inventoryVO.getAreaId()); - - if (CollectionUtils.isEmpty(inventoryHistories1)) inventoryHistories1 = new ArrayList<>(); - - //获取入库的库存变化总和 - List receipt = Arrays.asList(ReceiptOrderConstant.PURCHASE, ReceiptOrderConstant.OUTSOURCING, ReceiptOrderConstant.RETURN); - BigDecimal enter = inventoryHistories1.stream().filter(it -> receipt.contains(it.getFormType())).map(InventoryHistory::getQuantity).reduce(BigDecimal.ZERO, BigDecimal::add); - - //获取出库的库存变化总和 - List shipment = Arrays.asList(ShipmentOrderConstant.SALE, ShipmentOrderConstant.OUTSOURCING, ShipmentOrderConstant.DEPT, ShipmentOrderConstant.CHECK_OUT); - BigDecimal out = inventoryHistories1.stream().filter(it -> shipment.contains(it.getFormType())).map(InventoryHistory::getQuantity).reduce(BigDecimal.ZERO, BigDecimal::add); - - //获取盘库的库存变化总和 - List check = Arrays.asList(ReceiptOrderConstant.CHECK_IN, ShipmentOrderConstant.CHECK_OUT); - BigDecimal currCheck = inventoryHistories1.stream().filter(it -> check.contains(it.getFormType())).map(InventoryHistory::getQuantity).reduce(BigDecimal.ZERO, BigDecimal::add); - - //上期结存 - List previous = previousInventorySettlementDetails.get(inventoryVO.getItemId() + "_" + inventoryVO.getWarehouseId() + "_" + inventoryVO.getAreaId()); - BigDecimal previousBalance = BigDecimal.ZERO; - if (!CollectionUtils.isEmpty(previous)) { - previousBalance = previous.get(0).getCurrentBalance(); - } - - if (inventoryVO.getItemId() == null) { - System.out.println("物料id为空" + inventoryVO); - return; - } - InventorySettlementDetail inventorySettlementDetail = new InventorySettlementDetail(); - inventorySettlementDetail.setAreaId(inventoryVO.getAreaId()); - inventorySettlementDetail.setAreaName(inventoryVO.getAreaName()); - inventorySettlementDetail.setWarehouseId(inventoryVO.getWarehouseId()); - inventorySettlementDetail.setWarehouseName(inventoryVO.getWarehouseName()); - inventorySettlementDetail.setItemId(inventoryVO.getItemId()); - inventorySettlementDetail.setItemName(inventoryVO.getItemName()); - inventorySettlementDetail.setItemNo(inventoryVO.getItemNo()); - inventorySettlementDetail.setCurrentBalance(inventoryVO.getQuantity()); - inventorySettlementDetail.setCurrentOut(out.negate()); - inventorySettlementDetail.setCurrentEnter(enter); - inventorySettlementDetail.setCurrentCheck(currCheck); - inventorySettlementDetail.setPreviousBalance(previousBalance); - log.info("库存结算明细:{}", inventorySettlementDetail); - list.add(inventorySettlementDetail); - }); - return list; - } -} diff --git a/wms/src/main/java/com/cyl/wms/service/InventorySettlementService.java b/wms/src/main/java/com/cyl/wms/service/InventorySettlementService.java deleted file mode 100644 index 1af2668..0000000 --- a/wms/src/main/java/com/cyl/wms/service/InventorySettlementService.java +++ /dev/null @@ -1,198 +0,0 @@ -package com.cyl.wms.service; - -import cn.hutool.core.collection.CollUtil; -import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; -import com.cyl.wms.convert.InventorySettlementConvert; -import com.cyl.wms.convert.InventorySettlementDetailConvert; -import com.cyl.wms.domain.InventorySettlement; -import com.cyl.wms.domain.InventorySettlementDetail; -import com.cyl.wms.mapper.InventorySettlementDetailMapper; -import com.cyl.wms.mapper.InventorySettlementMapper; -import com.cyl.wms.pojo.query.InventorySettlementQuery; -import com.cyl.wms.pojo.vo.InventorySettlementDetailVO; -import com.cyl.wms.pojo.vo.form.InventoryCheckFrom; -import com.cyl.wms.pojo.vo.form.InventorySettlementFrom; -import com.github.pagehelper.PageHelper; -import com.ruoyi.common.utils.SecurityUtils; -import org.apache.commons.lang3.StringUtils; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.data.domain.Pageable; -import org.springframework.stereotype.Service; - -import java.time.LocalDateTime; -import java.util.List; - -/** - * 库存结算单Service业务层处理 - * - * @author zcc - */ -@Service -public class InventorySettlementService { - @Autowired - private InventorySettlementMapper inventorySettlementMapper; - @Autowired - private InventorySettlementDetailMapper inventorySettlementDetailMapper; - @Autowired - private InventorySettlementDetailConvert detailConvert; - @Autowired - private InventorySettlementConvert convert; - - /** - * 查询库存结算单 - * - * @param id 库存结算单主键 - * @return 库存结算单 - */ - public InventorySettlementFrom selectById(Long id) { - InventorySettlement inventorySettlement = inventorySettlementMapper.selectById(id); - if (inventorySettlement == null) return null; - InventorySettlementFrom from = convert.do2form(inventorySettlement); - - //注入 详情单 - LambdaQueryWrapper inventoryCheckDetailQuery = new LambdaQueryWrapper<>(); - inventoryCheckDetailQuery.eq(InventorySettlementDetail::getSettlementId, id); - List inventoryCheckDetails = inventorySettlementDetailMapper.selectList(inventoryCheckDetailQuery); - List inventoryCheckDetailsVos = detailConvert.toVos(inventoryCheckDetails); - from.setDetails(inventoryCheckDetailsVos); - return from; - } - - /** - * 查询库存结算单列表 - * - * @param query 查询条件 - * @param page 分页条件 - * @return 库存结算单 - */ - public List selectList(InventorySettlementQuery query, Pageable page) { - if (page != null) { - PageHelper.startPage(page.getPageNumber() + 1, page.getPageSize()); - } - LambdaQueryWrapper qw = new LambdaQueryWrapper<>(); - qw.eq(InventorySettlement::getDelFlag, 0); - qw.orderByDesc(InventorySettlement::getId); - Integer inventorySettlementStatus = query.getInventorySettlementStatus(); - if (inventorySettlementStatus != null) { - qw.eq(InventorySettlement::getInventorySettlementStatus, inventorySettlementStatus); - } - Integer settlementType = query.getSettlementType(); - if (settlementType != null) { - qw.eq(InventorySettlement::getSettlementType, settlementType); - } - String inventorySettlementNo = query.getInventorySettlementNo(); - if (!StringUtils.isEmpty(inventorySettlementNo)) { - qw.eq(InventorySettlement::getInventorySettlementNo, inventorySettlementNo); - } - return inventorySettlementMapper.selectList(qw); - } - - /** - * 新增库存结算单 - * - * @param inventorySettlement 库存结算单 - * @return 结果 - */ - public int insert(InventorySettlement inventorySettlement) { - inventorySettlement.setDelFlag(0); - inventorySettlement.setCreateTime(LocalDateTime.now()); - return inventorySettlementMapper.insert(inventorySettlement); - } - - /** - * 修改库存结算单 - * - * @param inventorySettlement 库存结算单 - * @return 结果 - */ - public int update(InventorySettlement inventorySettlement) { - return inventorySettlementMapper.updateById(inventorySettlement); - } - - /** - * 批量删除库存结算单 - * - * @param ids 需要删除的库存结算单主键 - * @return 结果 - */ - public int deleteByIds(Long[] ids) { - return inventorySettlementMapper.updateDelFlagByIds(ids); - } - - /** - * 删除库存结算单信息 - * - * @param id 库存结算单主键 - * @return 结果 - */ - public int deleteById(Long id) { - Long[] ids = {id}; - return inventorySettlementMapper.updateDelFlagByIds(ids); - } - - /** - * 新增或更新结算单据以及结算单据明细 - * - * @param inventorySettlementFrom 库存结算单 - * @return 结果 - */ - public int addOrUpdate(InventorySettlementFrom inventorySettlementFrom) { - int res; - // 1. 新增 - if (inventorySettlementFrom.getId() == null) { - inventorySettlementFrom.setDelFlag(0); - inventorySettlementFrom.setCreateTime(LocalDateTime.now()); - res = inventorySettlementMapper.insert(inventorySettlementFrom); - } else { - // 2.编辑 - // 2.1 更新结算单 - res = inventorySettlementMapper.updateById(inventorySettlementFrom); - } - - if (InventoryCheckFrom.CREATED.equals(String.valueOf(inventorySettlementFrom.getInventorySettlementStatus())) || InventoryCheckFrom.FINISH.equals(String.valueOf(inventorySettlementFrom.getInventorySettlementStatus()))) { - // 3.暂存 - // 3.1 删除明细单 - deleteDetails(inventorySettlementFrom); - - // 3.2 保存明细单 - saveDetails(inventorySettlementFrom); - } - - return res; - - } - - /** - * 删除明细单 - * - * @param inventorySettlementFrom 库存结算单 - */ - private void deleteDetails(InventorySettlementFrom inventorySettlementFrom) { - LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper<>(); - queryWrapper.eq(InventorySettlementDetail::getSettlementId, inventorySettlementFrom.getId()); - inventorySettlementDetailMapper.delete(queryWrapper); - } - - /** - * 保存单据明细 - * - * @param inventorySettlementFrom 库存结算单 - */ - private void saveDetails(InventorySettlementFrom inventorySettlementFrom) { - Long settlementId = inventorySettlementFrom.getId(); - List details = inventorySettlementFrom.getDetails(); - Integer settlementType = inventorySettlementFrom.getSettlementType(); - if (!CollUtil.isEmpty(details)) { - List inventoryCheckDetails = detailConvert.vos2dos(details); - Long userId = SecurityUtils.getUserId(); - inventoryCheckDetails.forEach(it -> { - it.setSettlementId(settlementId); - it.setSettlementType(settlementType); - it.setDelFlag(0); - it.setCreateTime(LocalDateTime.now()); - it.setCreateBy(userId); - }); - inventorySettlementDetailMapper.batchInsert(inventoryCheckDetails); - } - } -} diff --git a/wms/src/main/java/com/cyl/wms/service/ItemService.java b/wms/src/main/java/com/cyl/wms/service/ItemService.java deleted file mode 100644 index e5a3bcc..0000000 --- a/wms/src/main/java/com/cyl/wms/service/ItemService.java +++ /dev/null @@ -1,304 +0,0 @@ -package com.cyl.wms.service; - -import cn.hutool.core.collection.CollUtil; -import cn.hutool.core.util.StrUtil; -import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; -import com.cyl.wms.convert.ItemConvert; -import com.cyl.wms.domain.Area; -import com.cyl.wms.domain.Item; -import com.cyl.wms.domain.ItemType; -import com.cyl.wms.domain.Warehouse; -import com.cyl.wms.mapper.ItemMapper; -import com.cyl.wms.pojo.query.ItemQuery; -import com.cyl.wms.pojo.vo.ItemVO; -import com.github.pagehelper.PageHelper; -import com.ruoyi.common.utils.SecurityUtils; -import com.ruoyi.common.utils.SortUtil; -import org.apache.commons.lang3.StringUtils; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.data.domain.Pageable; -import org.springframework.stereotype.Service; - -import java.math.BigDecimal; -import java.time.LocalDateTime; -import java.util.*; -import java.util.stream.Collectors; - -/** - * 物料Service业务层处理 - * - * @author zcc - */ -@Service -public class ItemService { - @Autowired - private ItemMapper itemMapper; - @Autowired - private ItemConvert convert; - - @Autowired - private ItemTypeService itemTypeService; - @Autowired - private WarehouseService warehouseService; - @Autowired - private AreaService areaService; - - public List toVos(List items) { - List list = convert.dos2vos(items); - list.forEach(itemVO -> { - List place = new LinkedList<>(); - if (itemVO.getWarehouseId() != null) { - place.add(itemVO.getWarehouseId()); - } - if (itemVO.getAreaId() != null) { - place.add(itemVO.getAreaId()); - } - if (itemVO.getRackId() != null) { - place.add(itemVO.getRackId()); - } - itemVO.setPlace(place); - }); - return list; - } - - public ItemVO toVo(Item item) { - ItemVO itemVO = convert.toVo(item); - - List place = new LinkedList<>(); - if (itemVO.getWarehouseId() != null) { - place.add(itemVO.getWarehouseId()); - } - if (itemVO.getAreaId() != null) { - place.add(itemVO.getAreaId()); - } - if (itemVO.getRackId() != null) { - place.add(itemVO.getRackId()); - } - itemVO.setPlace(place); - return itemVO; - } - - /** - * 查询物料 - * - * @param id 物料主键 - * @return 物料 - */ - public Item selectById(Long id) { - return itemMapper.selectById(id); - } - - /** - * 查询物料列表 - * - * @param query 查询条件 - * @param page 分页条件 - * @return 物料 - */ - public List selectList(ItemQuery query, Pageable page) { - if (page != null) { - PageHelper.startPage(page.getPageNumber() + 1, page.getPageSize()); - } - QueryWrapper qw = new QueryWrapper<>(); - qw.orderByDesc("id"); - if (!StrUtil.isEmpty(query.getSearch())) { - String search = query.getSearch(); - qw.eq("create_by", SecurityUtils.getUserId()); - qw.and((qw1) -> { - qw1 = qw1.like("item_no", search) - .or() - .like("item_name", search); - if (search.matches("^\\d+$")) { - qw1.eq("id", Long.valueOf(search)); - } - }); - return itemMapper.selectList(qw); - } - if (!CollUtil.isEmpty(query.getIds())) { - qw.in("id", query.getIds()); - } - qw.eq("del_flag", 0); - String itemNo = query.getItemNo(); - if (!StringUtils.isEmpty(itemNo)) { - qw.eq("item_no", itemNo); - } - String itemNameLike = query.getItemNameLike(); - if (!StringUtils.isEmpty(itemNameLike)) { - qw.like("item_name", itemNameLike); - } - String itemType = query.getItemType(); - if (!StringUtils.isEmpty(itemType)) { - qw.eq("item_type", itemType); - } - String unit = query.getUnit(); - if (!StringUtils.isEmpty(unit)) { - qw.eq("unit", unit); - } - Long rackId = query.getRackId(); - if (rackId != null) { - qw.eq("rack_id", rackId); - } - Long areaId = query.getAreaId(); - if (areaId != null) { - qw.eq("area_id", areaId); - } - Long warehouseId = query.getWarehouseId(); - if (warehouseId != null) { - qw.eq("warehouse_id", warehouseId); - } - BigDecimal quantity = query.getQuantity(); - if (quantity != null) { - qw.eq("quantity", quantity); - } - LocalDateTime expiryDate = query.getExpiryDate(); - if (expiryDate != null) { - qw.eq("expiry_date", expiryDate); - } - return getItemList(qw); - } - - /** - * 新增物料 - * - * @param item 物料 - * @return 结果 - */ - public int insert(Item item) { - item.setDelFlag(0); - item.setCreateTime(LocalDateTime.now()); - return itemMapper.insert(item); - } - - /** - * 修改物料 - * - * @param item 物料 - * @return 结果 - */ - public int update(Item item) { - return itemMapper.updateById(item); - } - - /** - * 批量删除物料 - * - * @param ids 需要删除的物料主键 - * @return 结果 - */ - public int deleteByIds(Long[] ids) { - return itemMapper.updateDelFlagByIds(ids); - } - - /** - * 删除物料信息 - * - * @param id 物料主键 - * @return 结果 - */ - public int deleteById(Long id) { - Long[] ids = {id}; - return itemMapper.updateDelFlagByIds(ids); - } - - /** - * 查询物料列表 - * - * @param ids 物料主键集合 - * @return 物料列表 - */ - public List selectByIdIn(Collection ids) { - // 如果主键集合为空,直接返回空集合 - if (ids == null || ids.isEmpty()) { - return new ArrayList<>(); - } - QueryWrapper qw = new QueryWrapper<>(); - qw.in("id", ids); - return itemMapper.selectList(qw); - } - - public List getAllSaftyItems(){ - QueryWrapper qw = new QueryWrapper<>(); - qw.eq("del_flag", 0); - qw.isNotNull("quantity"); - return this.getItemList(qw); - } - private List getItemList(QueryWrapper qw) { - List items = itemMapper.selectList(qw); - injectTypeName(items); - injectWarehouseName(items); - injectAreaName(items); - return items; - } - - /** - * 注入物料类别名称 - * - * @param res 物料 - */ - public void injectTypeName(List res) { - if (CollUtil.isEmpty(res)) { - return; - } - Set types = res.stream().map(Item::getItemType).filter(Objects::nonNull).map(Long::valueOf).collect(Collectors.toSet()); - Map itemTypes = itemTypeService.selectByIdIn(types).stream().collect(Collectors.toMap(ItemType::getItemTypeId, it -> it)); - res.forEach(it -> { - Long typeId; - try { - typeId = Long.parseLong(it.getItemType()); - } catch (NumberFormatException e) { - return; - } - if (it.getItemName() != null && itemTypes.containsKey(typeId)) { - it.setItemTypeName(itemTypes.get(typeId).getTypeName()); - } - }); - } - - /** - * 注入仓库名称 - * @param res 物料 - */ - public void injectWarehouseName(List res){ - if (CollUtil.isEmpty(res)){ - return; - } - Set warehouses = res.stream().map(Item::getWarehouseId).collect(Collectors.toSet()); - Map warehouseMap = warehouseService.selectByIdIn(warehouses).stream().collect(Collectors.toMap(Warehouse::getId, it -> it)); - res.forEach(it -> { - if (it.getWarehouseId() != null && warehouseMap.containsKey(it.getWarehouseId())){ - it.setWarehouseName(warehouseMap.get(it.getWarehouseId()).getWarehouseName()); - } - }); - } - - /** - * 注入库区名称 - * @param res 物料 - */ - public void injectAreaName(List res){ - if (CollUtil.isEmpty(res)){ - return; - } - Set areas = res.stream().map(Item::getAreaId).collect(Collectors.toSet()); - Map areaMap = areaService.selectByIdIn(areas).stream().collect(Collectors.toMap(Area::getId, it -> it)); - res.forEach(it -> { - if (it.getAreaId() != null && areaMap.containsKey(it.getAreaId())){ - it.setAreaName(areaMap.get(it.getAreaId()).getAreaName()); - } - }); - } - - /** - * 查询过期物料 - * @param page 分页条件 - * @return 结果 - */ - public List queryExpiry(Pageable page) { - if (page != null){ - PageHelper.startPage(page.getPageNumber() + 1, page.getPageSize(), SortUtil.sort2string(page.getSort())); - } - List items = itemMapper.selectExpiry(); - injectTypeName(items); - return items; - } -} diff --git a/wms/src/main/java/com/cyl/wms/service/ItemTypeService.java b/wms/src/main/java/com/cyl/wms/service/ItemTypeService.java deleted file mode 100644 index 5986e1c..0000000 --- a/wms/src/main/java/com/cyl/wms/service/ItemTypeService.java +++ /dev/null @@ -1,197 +0,0 @@ -package com.cyl.wms.service; - -import java.util.*; -import java.time.LocalDateTime; -import java.util.stream.Collectors; - -import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; -import com.cyl.wms.domain.ItemTypeTreeSelect; -import com.github.pagehelper.PageHelper; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.data.domain.Pageable; -import org.apache.commons.lang3.StringUtils; -import org.springframework.stereotype.Service; -import com.cyl.wms.mapper.ItemTypeMapper; -import com.cyl.wms.domain.ItemType; -import com.cyl.wms.pojo.query.ItemTypeQuery; - -/** - * 物料类型表Service业务层处理 - * - * - * @author zcc - */ -@Service -public class ItemTypeService { - @Autowired - private ItemTypeMapper itemTypeMapper; - - /** - * 查询物料类型表 - * - * @param ids 物料类型表主键 - * @return 物料类型表 - */ - public List selectByIdIn(Collection ids) { - if (ids.isEmpty()){ - return Collections.emptyList(); - } - QueryWrapper qw = new QueryWrapper<>(); - qw.in("item_type_id",ids); - return itemTypeMapper.selectList(qw); - } - - /** - * 查询物料类型表 - * - * @param itemTypeId 物料类型表主键 - * @return 物料类型表 - */ - public ItemType selectByItemTypeId(Long itemTypeId) { - return itemTypeMapper.selectById(itemTypeId); - } - - /** - * 查询物料类型表列表 - * - * @param query 查询条件 - * @param page 分页条件 - * @return 物料类型表 - */ - public List selectList(ItemTypeQuery query, Pageable page) { - if (page != null) { - PageHelper.startPage(page.getPageNumber() + 1, page.getPageSize()); - } - QueryWrapper qw = new QueryWrapper<>(); - qw.eq("del_flag",0); - Long parentId = query.getParentId(); - if (parentId != null) { - qw.eq("parent_id", parentId); - } - String ancestors = query.getAncestors(); - if (!StringUtils.isEmpty(ancestors)) { - qw.eq("ancestors", ancestors); - } - String typeNameLike = query.getTypeNameLike(); - if (!StringUtils.isEmpty(typeNameLike)) { - qw.like("type_name", typeNameLike); - } - Integer orderNum = query.getOrderNum(); - if (orderNum != null) { - qw.eq("order_num", orderNum); - } - String status = query.getStatus(); - if (!StringUtils.isEmpty(status)) { - qw.eq("status", status); - } - return itemTypeMapper.selectList(qw); - } - - /** - * 新增物料类型表 - * - * @param itemType 物料类型表 - * @return 结果 - */ - public int insert(ItemType itemType) { - itemType.setDelFlag(String.valueOf(0)); - itemType.setCreateTime(LocalDateTime.now()); - return itemTypeMapper.insert(itemType); - } - - /** - * 修改物料类型表 - * - * @param itemType 物料类型表 - * @return 结果 - */ - public int update(ItemType itemType) { - return itemTypeMapper.updateById(itemType); - } - - /** - * 批量删除物料类型表 - * - * @param itemTypeIds 需要删除的物料类型表主键 - * @return 结果 - */ - public int deleteByItemTypeIds(Long[] itemTypeIds) { - return itemTypeMapper.updateDelFlagByIds(itemTypeIds); - } - - /** - * 删除物料类型表信息 - * - * @param itemTypeId 物料类型表主键 - * @return 结果 - */ - public int deleteByItemTypeId(Long itemTypeId) { - Long[] itemTypeIds = {itemTypeId}; - return itemTypeMapper.updateDelFlagByIds(itemTypeIds); - } - - public List buildItemTypeTreeSelect(List itemTypes) { - List itemTypeTrees = buildDeptTree(itemTypes); - return itemTypeTrees.stream().map(ItemTypeTreeSelect::new).collect(Collectors.toList()); - } - - /** - * 构建前端所需要树结构 - * - * @param itemTypes 部门列表 - * @return 树结构列表 - */ - public List buildDeptTree(List itemTypes) { - List returnList = new ArrayList<>(); - List tempList = new ArrayList(); - for (ItemType dept : itemTypes) { - tempList.add(dept.getItemTypeId()); - } - for (Iterator iterator = itemTypes.iterator(); iterator.hasNext(); ) { - ItemType dept = (ItemType) iterator.next(); - // 如果是顶级节点, 遍历该父节点的所有子节点 - if (!tempList.contains(dept.getParentId())) { - recursionFn(itemTypes, dept); - returnList.add(dept); - } - } - if (returnList.isEmpty()) { - returnList = itemTypes; - } - return returnList; - } - - /** - * 递归列表 - */ - private void recursionFn(List list, ItemType t) { - // 得到子节点列表 - List childList = getChildList(list, t); - t.setChildren(childList); - for (ItemType tChild : childList) { - if (hasChild(list, tChild)) { - recursionFn(list, tChild); - } - } - } - - /** - * 得到子节点列表 - */ - private List getChildList(List list, ItemType t) { - List tlist = new ArrayList<>(); - for (ItemType n : list) { - if (com.ruoyi.common.utils.StringUtils.isNotNull(n.getParentId()) && n.getParentId().longValue() == t.getItemTypeId().longValue()) { - tlist.add(n); - } - } - return tlist; - } - - /** - * 判断是否有子节点 - */ - private boolean hasChild(List list, ItemType t) { - return getChildList(list, t).size() > 0 ? true : false; - } -} diff --git a/wms/src/main/java/com/cyl/wms/service/RackService.java b/wms/src/main/java/com/cyl/wms/service/RackService.java deleted file mode 100644 index 5d60f84..0000000 --- a/wms/src/main/java/com/cyl/wms/service/RackService.java +++ /dev/null @@ -1,120 +0,0 @@ -package com.cyl.wms.service; - -import java.util.*; -import java.time.LocalDateTime; - -import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; -import com.cyl.wms.domain.Warehouse; -import com.github.pagehelper.PageHelper; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.data.domain.Pageable; -import org.apache.commons.lang3.StringUtils; -import org.springframework.stereotype.Service; -import com.cyl.wms.mapper.RackMapper; -import com.cyl.wms.domain.Rack; -import com.cyl.wms.pojo.query.RackQuery; - -/** - * 货架Service业务层处理 - * - * - * @author zcc - */ -@Service -public class RackService { - @Autowired - private RackMapper rackMapper; - - /** - * 查询货架 - * - * @param id 货架主键 - * @return 货架 - */ - public Rack selectById(Long id) { - return rackMapper.selectById(id); - } - - /** - * 查询货架列表 - * - * @param query 查询条件 - * @param page 分页条件 - * @return 货架 - */ - public List selectList(RackQuery query, Pageable page) { - if (page != null) { - PageHelper.startPage(page.getPageNumber() + 1, page.getPageSize()); - } - QueryWrapper qw = new QueryWrapper<>(); - qw.eq("del_flag",0); - String rackNo = query.getRackNo(); - if (!StringUtils.isEmpty(rackNo)) { - qw.eq("rack_no", rackNo); - } - String rackNameLike = query.getRackNameLike(); - if (!StringUtils.isEmpty(rackNameLike)) { - qw.like("rack_name", rackNameLike); - } - Long areaId = query.getAreaId(); - if (areaId != null) { - qw.eq("area_id", areaId); - } - Long warehouseId = query.getWarehouseId(); - if (warehouseId != null) { - qw.eq("warehouse_id", warehouseId); - } - return rackMapper.selectList(qw); - } - - /** - * 新增货架 - * - * @param rack 货架 - * @return 结果 - */ - public int insert(Rack rack) { - rack.setDelFlag(0); - rack.setCreateTime(LocalDateTime.now()); - return rackMapper.insert(rack); - } - - /** - * 修改货架 - * - * @param rack 货架 - * @return 结果 - */ - public int update(Rack rack) { - return rackMapper.updateById(rack); - } - - /** - * 批量删除货架 - * - * @param ids 需要删除的货架主键 - * @return 结果 - */ - public int deleteByIds(Long[] ids) { - return rackMapper.updateDelFlagByIds(ids); - } - - /** - * 删除货架信息 - * - * @param id 货架主键 - * @return 结果 - */ - public int deleteById(Long id) { - Long[] ids = {id}; - return rackMapper.updateDelFlagByIds(ids); - } - - public List selectByIdIn(Collection ids) { - if (ids.isEmpty()) - return new ArrayList<>(); - QueryWrapper qw = new QueryWrapper<>(); - qw.in("id", ids); - return rackMapper.selectList(qw); - } -} diff --git a/wms/src/main/java/com/cyl/wms/service/ReceiptOrderDetailService.java b/wms/src/main/java/com/cyl/wms/service/ReceiptOrderDetailService.java deleted file mode 100644 index 04bdf2d..0000000 --- a/wms/src/main/java/com/cyl/wms/service/ReceiptOrderDetailService.java +++ /dev/null @@ -1,175 +0,0 @@ -package com.cyl.wms.service; - -import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; -import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; -import com.cyl.wms.convert.ReceiptOrderDetailConvert; -import com.cyl.wms.domain.ReceiptOrder; -import com.cyl.wms.domain.ReceiptOrderDetail; -import com.cyl.wms.mapper.ReceiptOrderDetailMapper; -import com.cyl.wms.pojo.query.ReceiptOrderDetailQuery; -import com.cyl.wms.pojo.vo.ReceiptOrderDetailVO; -import com.github.pagehelper.PageHelper; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.data.domain.Pageable; -import org.springframework.stereotype.Service; - -import java.math.BigDecimal; -import java.time.LocalDateTime; -import java.util.LinkedList; -import java.util.List; - -/** - * 入库单详情Service业务层处理 - * - * @author zcc - */ -@Service -public class ReceiptOrderDetailService { - @Autowired - private ReceiptOrderDetailMapper receiptOrderDetailMapper; - @Autowired - private ReceiptOrderDetailConvert convert; - - public ReceiptOrderDetailVO toVo(ReceiptOrderDetail item) { - ReceiptOrderDetailVO itemVO = convert.toVo(item); - - List place = new LinkedList<>(); - if (itemVO.getWarehouseId() != null) { - place.add(itemVO.getWarehouseId()); - } - if (itemVO.getAreaId() != null) { - place.add(itemVO.getAreaId()); - } - if (itemVO.getRackId() != null) { - place.add(itemVO.getRackId()); - } - itemVO.setPlace(place); - return itemVO; - } - - public List toVos(List items) { - List list = convert.dos2vos(items); - list.forEach(itemVO -> { - List place = new LinkedList<>(); - if (itemVO.getWarehouseId() != null) { - place.add(itemVO.getWarehouseId()); - } - if (itemVO.getAreaId() != null) { - place.add(itemVO.getAreaId()); - } - if (itemVO.getRackId() != null) { - place.add(itemVO.getRackId()); - } - itemVO.setPlace(place); - }); - return list; - } - - /** - * 查询入库单详情 - * - * @param id 入库单详情主键 - * @return 入库单详情 - */ - public ReceiptOrderDetail selectById(Long id) { - return receiptOrderDetailMapper.selectById(id); - } - - /** - * 查询入库单详情列表 - * - * @param query 查询条件 - * @param page 分页条件 - * @return 入库单详情 - */ - public List selectList(ReceiptOrderDetailQuery query, Pageable page) { - if (page != null) { - PageHelper.startPage(page.getPageNumber() + 1, page.getPageSize()); - } - QueryWrapper qw = new QueryWrapper<>(); - qw.eq("del_flag", 0); - Long receiptOrderId = query.getReceiptOrderId(); - if (receiptOrderId != null) { - qw.eq("receipt_order_id", receiptOrderId); - } - Long itemId = query.getItemId(); - if (itemId != null) { - qw.eq("item_id", itemId); - } - BigDecimal planQuantity = query.getPlanQuantity(); - if (planQuantity != null) { - qw.eq("plan_quantity", planQuantity); - } - BigDecimal realQuantity = query.getRealQuantity(); - if (realQuantity != null) { - qw.eq("real_quantity", realQuantity); - } - Long rackId = query.getRackId(); - if (rackId != null) { - qw.eq("rack_id", rackId); - } - Long warehouseId = query.getWarehouseId(); - if (warehouseId != null) { - qw.eq("warehouse_id", warehouseId); - } - Long areaId = query.getAreaId(); - if (areaId != null) { - qw.eq("area_id", areaId); - } - Integer receiptOrderStatus = query.getReceiptOrderStatus(); - if (receiptOrderStatus != null) { - qw.eq("receipt_order_status", receiptOrderStatus); - } - return receiptOrderDetailMapper.selectList(qw); - } - - /** - * 新增入库单详情 - * - * @param receiptOrderDetail 入库单详情 - * @return 结果 - */ - public int insert(ReceiptOrderDetail receiptOrderDetail) { - receiptOrderDetail.setDelFlag(0); - receiptOrderDetail.setCreateTime(LocalDateTime.now()); - return receiptOrderDetailMapper.insert(receiptOrderDetail); - } - - /** - * 修改入库单详情 - * - * @param receiptOrderDetail 入库单详情 - * @return 结果 - */ - public int update(ReceiptOrderDetail receiptOrderDetail) { - return receiptOrderDetailMapper.updateById(receiptOrderDetail); - } - - /** - * 批量删除入库单详情 - * - * @param ids 需要删除的入库单详情主键 - * @return 结果 - */ - public int deleteByIds(Long[] ids) { - return receiptOrderDetailMapper.updateDelFlagByIds(ids); - } - - /** - * 删除入库单详情信息 - * - * @param id 入库单详情主键 - * @return 结果 - */ - public int deleteById(Long id) { - Long[] ids = {id}; - return receiptOrderDetailMapper.updateDelFlagByIds(ids); - } - - public void updateDelFlag(ReceiptOrder receiptOrder) { - LambdaUpdateWrapper updateWrapper = new LambdaUpdateWrapper() - .eq(ReceiptOrderDetail::getReceiptOrderId, receiptOrder.getId()) - .set(ReceiptOrderDetail::getDelFlag, 1); - receiptOrderDetailMapper.update(null, updateWrapper); - } -} diff --git a/wms/src/main/java/com/cyl/wms/service/ReceiptOrderService.java b/wms/src/main/java/com/cyl/wms/service/ReceiptOrderService.java deleted file mode 100644 index 96f0971..0000000 --- a/wms/src/main/java/com/cyl/wms/service/ReceiptOrderService.java +++ /dev/null @@ -1,386 +0,0 @@ -package com.cyl.wms.service; - -import cn.hutool.core.collection.CollUtil; -import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; -import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; -import com.cyl.wms.constant.ReceiptOrderConstant; -import com.cyl.wms.convert.ReceiptOrderConvert; -import com.cyl.wms.convert.ReceiptOrderDetailConvert; -import com.cyl.wms.domain.*; -import com.cyl.wms.mapper.ReceiptOrderDetailMapper; -import com.cyl.wms.mapper.ReceiptOrderMapper; -import com.cyl.wms.pojo.query.ItemQuery; -import com.cyl.wms.pojo.query.ReceiptOrderDetailQuery; -import com.cyl.wms.pojo.query.ReceiptOrderQuery; -import com.cyl.wms.pojo.vo.ItemVO; -import com.cyl.wms.pojo.vo.ReceiptOrderDetailVO; -import com.cyl.wms.pojo.vo.ReceiptOrderVO; -import com.cyl.wms.pojo.vo.form.ReceiptOrderForm; -import com.github.pagehelper.Constant; -import com.github.pagehelper.PageHelper; -import com.ruoyi.common.core.domain.entity.SysUser; -import com.ruoyi.common.utils.DateUtils; -import com.ruoyi.common.utils.SecurityUtils; -import com.ruoyi.system.mapper.SysUserMapper; -import com.ruoyi.system.service.impl.SysUserServiceImpl; -import lombok.extern.slf4j.Slf4j; -import org.apache.commons.lang3.StringUtils; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.data.domain.Page; -import org.springframework.data.domain.PageImpl; -import org.springframework.data.domain.Pageable; -import org.springframework.stereotype.Service; -import org.springframework.transaction.annotation.Transactional; - -import java.math.BigDecimal; -import java.time.LocalDateTime; -import java.util.ArrayList; -import java.util.List; -import java.util.Map; -import java.util.function.Function; -import java.util.stream.Collectors; - -/** - * 入库单Service业务层处理 - * - * @author zcc - */ -@Service -@Slf4j -public class ReceiptOrderService { - @Autowired - private ReceiptOrderMapper receiptOrderMapper; - @Autowired - private ReceiptOrderConvert receiptOrderConvert; - @Autowired - private ReceiptOrderDetailConvert receiptOrderDetailConvert; - @Autowired - private ReceiptOrderDetailMapper receiptOrderDetailMapper; - @Autowired - private ReceiptOrderDetailService receiptOrderDetailService; - @Autowired - private ItemService itemService; - @Autowired - private InventoryHistoryService inventoryHistoryService; - - @Autowired - private InventoryService inventoryService; - - @Autowired - private SupplierTransactionService supplierTransactionService; - - @Autowired - private SysUserServiceImpl userService; - @Autowired - private SysUserMapper userMapper; - - /** - * 查询入库单 - * - * @param id 入库单主键 - * @return 入库单 - */ - public ReceiptOrderForm selectById(Long id) { - ReceiptOrder order = receiptOrderMapper.selectById(id); - if (order == null) { - return null; - } - ReceiptOrderDetailQuery query = new ReceiptOrderDetailQuery(); - query.setReceiptOrderId(id); - ReceiptOrderForm form = receiptOrderConvert.do2form(order); - List receiptOrderDetails = receiptOrderDetailService.selectList(query, null); - List receiptOrderDetailVOS = receiptOrderDetailService.toVos(receiptOrderDetails); - form.setDetails(receiptOrderDetailVOS); - if (!CollUtil.isEmpty(form.getDetails())) { - List itemIds = form.getDetails().stream().map(ReceiptOrderDetailVO::getItemId).distinct().collect(Collectors.toList()); - ItemQuery query1 = new ItemQuery(); - query1.setIds(itemIds); - List list = itemService.selectList(query1, null); - List items = itemService.toVos(list); - form.setItems(items); - Map itemMap = items.stream().collect(Collectors.toMap(ItemVO::getId, Function.identity())); - form.getDetails().forEach(detail -> { - detail.setItem(itemMap.get(detail.getItemId())); - }); - } - return form; - } - - /** - * 查询入库单列表 - * - * @param query 查询条件 - * @return 入库单 - */ - public List selectList(ReceiptOrderQuery query) { - List list = selectList1(query); - return receiptOrderConvert.dos2vos(list); - } - - public Page selectList(ReceiptOrderQuery query, Pageable page) { - if (page != null) { - PageHelper.startPage(page.getPageNumber() + 1, page.getPageSize(), "create_time desc"); - } - List list = selectList1(query); - List res = receiptOrderConvert.dos2vos(list); - if (!CollUtil.isEmpty(res)) { - List ids = res.stream().map(ReceiptOrderVO::getId).collect(Collectors.toList()); - Map id2count = receiptOrderDetailMapper.countByOrderId(ids).stream().collect(Collectors.toMap(ReceiptOrderVO::getId, ReceiptOrderVO::getDetailCount)); - Map nickNameMap = userMapper.selectByBatchIds(res.stream().map(ReceiptOrderVO::getCreateBy).collect(Collectors.toSet())).stream().collect(Collectors.toMap(SysUser::getUserId, SysUser::getNickName)); - res.forEach(it -> { - it.setDetailCount(id2count.get(it.getId())); - it.setCreateByName(nickNameMap.get(it.getCreateBy())); - }); - } - return new PageImpl<>(res, page, ((com.github.pagehelper.Page) list).getTotal()); - } - - private List selectList1(ReceiptOrderQuery query) { - QueryWrapper qw = new QueryWrapper<>(); - qw.eq("del_flag", 0); - String receiptOrderNo = query.getReceiptOrderNo(); - if (!StringUtils.isEmpty(receiptOrderNo)) { - qw.eq("receipt_order_no", receiptOrderNo); - } - Integer receiptOrderType = query.getReceiptOrderType(); - if (receiptOrderType != null) { - qw.eq("receipt_order_type", receiptOrderType); - } - Long supplierId = query.getSupplierId(); - if (supplierId != null) { - qw.eq("supplier_id", supplierId); - } - String orderNo = query.getOrderNo(); - if (!StringUtils.isEmpty(orderNo)) { - qw.eq("order_no", orderNo); - } - Integer receiptOrderStatus = query.getReceiptOrderStatus(); - if (receiptOrderStatus != null) { - qw.eq("receipt_order_status", receiptOrderStatus); - } - return receiptOrderMapper.selectList(qw); - } - - /** - * 新增入库单 - * - * @param receiptOrder 入库单 - * @return 结果 - */ - @Transactional - public int add(ReceiptOrderForm receiptOrder) { - Long userId = SecurityUtils.getUserId(); - LocalDateTime optDate = LocalDateTime.now(); - int res; - // 1. 新增 - receiptOrder.setDelFlag(0); - receiptOrder.setCreateTime(optDate); - // 直接入库完成 - receiptOrder.setReceiptOrderStatus(ReceiptOrderConstant.ALL_IN); - res = receiptOrderMapper.insert(receiptOrder); - saveDetailsAllIn(receiptOrder.getId(), receiptOrder.getDetails()); - List addList = new ArrayList<>(); - receiptOrder.getDetails().forEach(detail -> { - InventoryHistory history = receiptOrderDetailConvert.do2InventoryHistory(detail); - history.setFormId(receiptOrder.getId()); - history.setFormType(receiptOrder.getReceiptOrderType()); - history.setQuantity(detail.getPlanQuantity()); - history.setDelFlag(0); - history.setCreateTime(optDate); - history.setCreateBy(userId); - addList.add(history); - }); - // 记录出入库历史 - inventoryHistoryService.batchInsert(addList); - // 更新库存 - inventoryService.batchUpdate1(addList); - if (receiptOrder.getSupplierId() != null && receiptOrder.getPayableAmount() != null) { - //保存订单金额到供应商流水表 - saveOrUpdatePayAmount(receiptOrder); - } - return res; - - } - - /** - * 更新入库单 - * - * @param receiptOrder 入库单 - * @return 结果 - */ - @Transactional - public int update(ReceiptOrderForm receiptOrder) { - int res; - // 2. 编辑 - QueryWrapper qw = new QueryWrapper<>(); - qw.eq("receipt_order_id", receiptOrder.getId()); - - // 新旧入库单详情对比, 生成 库存记录修改 - List details = receiptOrder.getDetails(); - Map dbDetailMap = receiptOrderDetailMapper.selectList(qw).stream().collect(Collectors.toMap(ReceiptOrderDetail::getId, it -> it)); - List adds = new ArrayList<>(); - LocalDateTime now = LocalDateTime.now(); - Long userId = SecurityUtils.getUserId(); - details.forEach(it -> { - Integer status = it.getReceiptOrderStatus(); - if (status != ReceiptOrderConstant.PART_IN && status != ReceiptOrderConstant.ALL_IN) { - return; - } - // 新增时, status一定是未入库, 所以这个地方必定有值 - ReceiptOrderDetail dbDetail = dbDetailMap.get(it.getId()); - // 如果上次的状态不是部分入库或者全部入库,则本次的库存变化为本次的全部 - Integer status1 = dbDetail.getReceiptOrderStatus(); - BigDecimal added; - if (status1 != ReceiptOrderConstant.PART_IN && status1 != ReceiptOrderConstant.ALL_IN) { - added = it.getRealQuantity(); - } else { - BigDecimal before = dbDetail.getRealQuantity() == null ? BigDecimal.ZERO : dbDetail.getRealQuantity(); - BigDecimal after = it.getRealQuantity() == null ? BigDecimal.ZERO : it.getRealQuantity(); - // 数量变化有问题 - if (before.compareTo(after) >= 0) { - return; - } - added = after.subtract(before); - } - - // 1. 前一次的实际数量是 0 - InventoryHistory h = receiptOrderDetailConvert.do2InventoryHistory(it); - h.setFormId(receiptOrder.getId()); - h.setFormType(receiptOrder.getReceiptOrderType()); - h.setQuantity(added); - h.setDelFlag(0); - h.setId(null); - h.setCreateTime(now); - h.setCreateBy(userId); - adds.add(h); - }); - - if (adds.size() > 0) { - int add1 = inventoryHistoryService.batchInsert(adds); - int update1 = inventoryService.batchUpdate1(adds); - log.info("inventoryHistory: {}, inventory: {}", add1, update1); - } - // 2.1 编辑或发货入库,都要先删除details 再重新保存 - receiptOrderDetailMapper.delete(qw); - saveDetails(receiptOrder.getId(), receiptOrder.getDetails()); - - if (receiptOrder.getSupplierId() != null && receiptOrder.getPayableAmount() != null) { - //保存订单金额到供应商流水表 - saveOrUpdatePayAmount(receiptOrder); - } - - // 2.2 更新入库单 - res = receiptOrderMapper.updateById(receiptOrder); - return res; - } - - /** - * 保存订单金额到供应商流水表 - * - * @param receiptOrder 入库单 - */ - private void saveOrUpdatePayAmount(ReceiptOrder receiptOrder) { - //todo 更换供应商 - //todo 删除入库单 - SupplierTransaction supplierTransaction = new SupplierTransaction(); - supplierTransaction.setSupplierId(String.valueOf(receiptOrder.getSupplierId())); - supplierTransaction.setTransactionType(SupplierTransaction.RECEIPT); - supplierTransaction.setTransactionAmount(receiptOrder.getPayableAmount()); - supplierTransaction.setReceiptOrderId(receiptOrder.getId().intValue()); - supplierTransaction.setTransactionCode("TS-" + DateUtils.randomId()); - supplierTransactionService.insert(supplierTransaction); - } - - private void saveDetails(Long orderId, List details) { - if (!CollUtil.isEmpty(details)) { - details.forEach(it -> it.setReceiptOrderId(orderId)); - List receiptOrders = receiptOrderDetailConvert.vos2dos(details); - if (receiptOrderDetailMapper.batchInsert(receiptOrders) < 1) { - throw new RuntimeException("批量创建入库单明细失败"); - } - } - } - - private void saveDetailsAllIn(Long orderId, List details) { - if (!CollUtil.isEmpty(details)) { - details.forEach( - it -> { - it.setReceiptOrderId(orderId); - it.setRealQuantity(it.getPlanQuantity()); - it.setReceiptOrderStatus(ReceiptOrderConstant.ALL_IN); - } - ); - List receiptOrders = receiptOrderDetailConvert.vos2dos(details); - if (receiptOrderDetailMapper.batchInsert(receiptOrders) < 1) { - throw new RuntimeException("批量创建入库单明细失败"); - } - } - } - - /** - * 修改入库单 - * - * @param receiptOrder 入库单 - * @return 结果 - */ - public int update(ReceiptOrder receiptOrder) { - return receiptOrderMapper.updateById(receiptOrder); - } - - /** - * 批量删除入库单 - * - * @param ids 需要删除的入库单主键 - * @return 结果 - */ - @Transactional - public int deleteByIds(Long[] ids) { - int flag = 0; - for (Long id : ids) { - ReceiptOrder receiptOrder = receiptOrderMapper.selectById(id); - if (receiptOrder == null) { - continue; - } - Integer receiptOrderStatus = receiptOrder.getReceiptOrderStatus(); - // 1. 逻辑删除入库单 - flag += receiptOrderMapper.updateDelFlagByIds(ids); - // 2. 逻辑删除入库单详情 - receiptOrderDetailService.updateDelFlag(receiptOrder); - - if (receiptOrderStatus != ReceiptOrderConstant.ALL_IN && receiptOrderStatus != ReceiptOrderConstant.PART_IN) { - // 未入库的可以直接删除 - continue; - } - - // 3. 查询库存记录 - List inventoryHistories = inventoryHistoryService.selectByForm(receiptOrder.getId(), receiptOrder.getReceiptOrderType()); - - // 翻转库存记录的数量 - inventoryHistories.forEach(it -> { - it.setQuantity(it.getQuantity().negate()); - log.info("回滚库存:{} 数量:{}", it.getWarehouseId() + "_" + it.getAreaId() + "_" + it.getRackId() + "_" + it.getItemId(), it.getQuantity()); - }); - - // 4. 回滚库存 - inventoryService.batchUpdate1(inventoryHistories); - - // 5. 删除库存记录 - inventoryHistoryService.deleteByForm(receiptOrder.getId(), receiptOrder.getReceiptOrderType()); - - // todo 6. 回滚供应商流水 -// supplierTransactionService.deleteByForm(receiptOrder.getId(), receiptOrder.getReceiptOrderType()); - } - return flag; - } - - /** - * 删除入库单信息 - * - * @param id 入库单主键 - * @return 结果 - */ - public int deleteById(Long id) { - Long[] ids = {id}; - return receiptOrderMapper.updateDelFlagByIds(ids); - } -} diff --git a/wms/src/main/java/com/cyl/wms/service/ShipmentOrderDetailService.java b/wms/src/main/java/com/cyl/wms/service/ShipmentOrderDetailService.java deleted file mode 100644 index 5409f87..0000000 --- a/wms/src/main/java/com/cyl/wms/service/ShipmentOrderDetailService.java +++ /dev/null @@ -1,160 +0,0 @@ -package com.cyl.wms.service; - -import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; -import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; -import com.cyl.wms.convert.ShipmentOrderDetailConvert; -import com.cyl.wms.domain.ShipmentOrder; -import com.cyl.wms.domain.ShipmentOrderDetail; -import com.cyl.wms.mapper.ShipmentOrderDetailMapper; -import com.cyl.wms.pojo.query.ShipmentOrderDetailQuery; -import com.cyl.wms.pojo.vo.ShipmentOrderDetailVO; -import com.github.pagehelper.PageHelper; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.data.domain.Pageable; -import org.springframework.stereotype.Service; - -import java.math.BigDecimal; -import java.time.LocalDateTime; -import java.util.LinkedList; -import java.util.List; - -/** - * 出库单详情Service业务层处理 - * - * @author zcc - */ -@Service -public class ShipmentOrderDetailService { - @Autowired - private ShipmentOrderDetailMapper shipmentOrderDetailMapper; - @Autowired - private ShipmentOrderDetailConvert convert; - - /** - * 查询出库单详情 - * - * @param id 出库单详情主键 - * @return 出库单详情 - */ - public ShipmentOrderDetail selectById(Long id) { - return shipmentOrderDetailMapper.selectById(id); - } - - /** - * 查询出库单详情列表 - * - * @param query 查询条件 - * @param page 分页条件 - * @return 出库单详情 - */ - public List selectList(ShipmentOrderDetailQuery query, Pageable page) { - if (page != null) { - PageHelper.startPage(page.getPageNumber() + 1, page.getPageSize()); - } - QueryWrapper qw = new QueryWrapper<>(); - qw.eq("del_flag", 0); - Long shipmentOrderId = query.getShipmentOrderId(); - if (shipmentOrderId != null) { - qw.eq("shipment_order_id", shipmentOrderId); - } - Long itemId = query.getItemId(); - if (itemId != null) { - qw.eq("item_id", itemId); - } - BigDecimal planQuantity = query.getPlanQuantity(); - if (planQuantity != null) { - qw.eq("plan_quantity", planQuantity); - } - BigDecimal realQuantity = query.getRealQuantity(); - if (realQuantity != null) { - qw.eq("real_quantity", realQuantity); - } - Long rackId = query.getRackId(); - if (rackId != null) { - qw.eq("rack_id", rackId); - } - return shipmentOrderDetailMapper.selectList(qw); - } - - - public List toVos(List items) { - List list = convert.dos2vos(items); - list.forEach(itemVO -> { - List place = new LinkedList<>(); - if (itemVO.getWarehouseId() != null) { - place.add(itemVO.getWarehouseId()); - } - if (itemVO.getAreaId() != null) { - place.add(itemVO.getAreaId()); - } - if (itemVO.getRackId() != null) { - place.add(itemVO.getRackId()); - } - itemVO.setPlace(place); - }); - return list; - } - - /** - * 新增出库单详情 - * - * @param shipmentOrderDetail 出库单详情 - * @return 结果 - */ - public int insert(ShipmentOrderDetail shipmentOrderDetail) { - shipmentOrderDetail.setDelFlag(0); - shipmentOrderDetail.setCreateTime(LocalDateTime.now()); - return shipmentOrderDetailMapper.insert(shipmentOrderDetail); - } - - /** - * 修改出库单详情 - * - * @param shipmentOrderDetail 出库单详情 - * @return 结果 - */ - public int update(ShipmentOrderDetail shipmentOrderDetail) { - return shipmentOrderDetailMapper.updateById(shipmentOrderDetail); - } - - /** - * 批量删除出库单详情 - * - * @param ids 需要删除的出库单详情主键 - * @return 结果 - */ - public int deleteByIds(Long[] ids) { - return shipmentOrderDetailMapper.updateDelFlagByIds(ids); - } - - /** - * 删除出库单详情信息 - * - * @param id 出库单详情主键 - * @return 结果 - */ - public int deleteById(Long id) { - Long[] ids = {id}; - return shipmentOrderDetailMapper.updateDelFlagByIds(ids); - } - - public void updateDelFlag(ShipmentOrder shipmentOrder) { - LambdaUpdateWrapper updateWrapper = new LambdaUpdateWrapper() - .eq(ShipmentOrderDetail::getShipmentOrderId, shipmentOrder.getId()) - .set(ShipmentOrderDetail::getDelFlag, 1); - shipmentOrderDetailMapper.update(null, updateWrapper); - - } - - /** - * 物理删除 出库单详情信息 - * - * @param orderId 出库单详情主键 - * @return 结果 - */ - public int deleteByOrderId(Long orderId) { - LambdaUpdateWrapper delete = new LambdaUpdateWrapper() - .eq(ShipmentOrderDetail::getShipmentOrderId, orderId); - return shipmentOrderDetailMapper.delete(delete); - } -} diff --git a/wms/src/main/java/com/cyl/wms/service/ShipmentOrderService.java b/wms/src/main/java/com/cyl/wms/service/ShipmentOrderService.java deleted file mode 100644 index 72cd73d..0000000 --- a/wms/src/main/java/com/cyl/wms/service/ShipmentOrderService.java +++ /dev/null @@ -1,526 +0,0 @@ -package com.cyl.wms.service; - -import cn.hutool.core.collection.CollUtil; -import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; -import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; -import com.cyl.wms.constant.ShipmentOrderConstant; -import com.cyl.wms.convert.DeliveryConvert; -import com.cyl.wms.convert.ShipmentOrderConvert; -import com.cyl.wms.convert.ShipmentOrderDetailConvert; -import com.cyl.wms.domain.*; -import com.cyl.wms.mapper.CustomerMapper; -import com.cyl.wms.mapper.ShipmentOrderDetailMapper; -import com.cyl.wms.mapper.ShipmentOrderMapper; -import com.cyl.wms.pojo.query.*; -import com.cyl.wms.pojo.vo.*; -import com.cyl.wms.pojo.vo.form.OrderWaveFrom; -import com.cyl.wms.pojo.vo.form.ShipmentOrderFrom; -import com.github.pagehelper.PageHelper; -import com.ruoyi.common.core.domain.entity.SysUser; -import com.ruoyi.common.exception.ServiceException; -import com.ruoyi.common.utils.DateUtils; -import com.ruoyi.common.utils.SecurityUtils; -import com.ruoyi.system.mapper.SysUserMapper; -import lombok.extern.slf4j.Slf4j; -import org.apache.commons.lang3.StringUtils; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.data.domain.Page; -import org.springframework.data.domain.PageImpl; -import org.springframework.data.domain.Pageable; -import org.springframework.stereotype.Service; -import org.springframework.transaction.annotation.Transactional; -import org.springframework.util.CollectionUtils; - -import java.math.BigDecimal; -import java.time.LocalDateTime; -import java.util.*; -import java.util.function.Function; -import java.util.stream.Collectors; - -/** - * 出库单Service业务层处理 - * - * @author zcc - */ -@Service -@Slf4j -public class ShipmentOrderService { - @Autowired - private ShipmentOrderMapper shipmentOrderMapper; - @Autowired - private ShipmentOrderConvert convert; - @Autowired - private ShipmentOrderDetailConvert detailConvert; - @Autowired - private ShipmentOrderDetailMapper shipmentOrderDetailMapper; - @Autowired - private ShipmentOrderDetailService shipmentOrderDetailService; - @Autowired - private ItemService itemService; - @Autowired - private DeliveryConvert deliveryConvert; - @Autowired - private DeliveryService deliveryService; - @Autowired - private InventoryHistoryService inventoryHistoryService; - @Autowired - private InventoryService inventoryService; - @Autowired - private CustomerTransactionService customerTransactionService; - @Autowired - private SysUserMapper userMapper; - @Autowired - private CustomerMapper customerMapper; - - /** - * 查询出库单 - * - * @param id 出库单主键 - * @return 出库单 - */ - public ShipmentOrderFrom selectById(Long id) { - ShipmentOrder order = shipmentOrderMapper.selectById(id); - if (order == null) { - return null; - } - ShipmentOrderDetailQuery query = new ShipmentOrderDetailQuery(); - query.setShipmentOrderId(id); - ShipmentOrderFrom form = convert.do2form(order); - List shipmentOrderDetails = shipmentOrderDetailService.selectList(query, null); - List shipmentOrderDetailVOS = shipmentOrderDetailService.toVos(shipmentOrderDetails); - form.setDetails(shipmentOrderDetailVOS); - if (!CollUtil.isEmpty(form.getDetails())) { - List itemIds = form.getDetails().stream().map(ShipmentOrderDetailVO::getItemId).distinct().collect(Collectors.toList()); - ItemQuery query1 = new ItemQuery(); - query1.setIds(itemIds); - List list = itemService.selectList(query1, null); - List items = itemService.toVos(list); - form.setItems(items); - - DeliveryQuery deliveryQuery = new DeliveryQuery(); - deliveryQuery.setShipmentOrderId(id); - List deliveries = deliveryService.selectList(deliveryQuery, null); - form.setDelivery(deliveryConvert.dos2vos(deliveries)); - Map itemMap = items.stream().collect(Collectors.toMap(ItemVO::getId, Function.identity())); - form.getDetails().forEach(detail -> { - detail.setItem(itemMap.get(detail.getItemId())); - }); - } - return form; - } - - /** - * 查询出库单列表 - * - * @param query 查询条件 - * @param page 分页条件 - * @return 出库单 - */ - public Page selectList(ShipmentOrderQuery query, Pageable page) { - if (page != null) { - PageHelper.startPage(page.getPageNumber() + 1, page.getPageSize()); - } - QueryWrapper qw = new QueryWrapper<>(); - qw.orderByDesc("id"); - qw.eq("del_flag", 0); - String shipmentOrderNo = query.getShipmentOrderNo(); - if (!StringUtils.isEmpty(shipmentOrderNo)) { - qw.eq("shipment_order_no", shipmentOrderNo); - } - Integer shipmentOrderType = query.getShipmentOrderType(); - if (shipmentOrderType != null) { - qw.eq("shipment_order_type", shipmentOrderType); - } - String orderNo = query.getOrderNo(); - if (!StringUtils.isEmpty(orderNo)) { - qw.eq("order_no", orderNo); - } - Long customerId = query.getCustomerId(); - if (customerId != null) { - qw.eq("customer_id", customerId); - } - Integer shipmentOrderStatus = query.getShipmentOrderStatus(); - if (shipmentOrderStatus != null) { - qw.eq("shipment_order_status", shipmentOrderStatus); - } - List list = shipmentOrderMapper.selectList(qw); - if (CollectionUtils.isEmpty(list)) { - return new PageImpl<>(Collections.EMPTY_LIST, page, 0); - } - List res = convert.dos2vos(list); - if (!CollUtil.isEmpty(res)) { - List ids = res.stream().map(ShipmentOrderVO::getId).collect(Collectors.toList()); - Map id2count = shipmentOrderDetailMapper.countByOrderId(ids) - .stream().collect(Collectors.toMap(ShipmentOrderVO::getId, ShipmentOrderVO::getDetailCount)); - Map nickNameMap = userMapper.selectByBatchIds(res.stream().map(ShipmentOrderVO::getCreateBy).collect(Collectors.toSet())).stream().collect(Collectors.toMap(SysUser::getUserId, SysUser::getNickName)); - res.forEach(it -> { - it.setDetailCount(id2count.get(it.getId())); - it.setCreateByName(nickNameMap.get(it.getCreateBy())); - }); - } - return new PageImpl<>(res, page, ((com.github.pagehelper.Page) list).getTotal()); - } - - /** - * 新增出库单 - * - * @param shipmentOrder 出库单 - * @return 结果 - */ - public int insert(ShipmentOrder shipmentOrder) { - shipmentOrder.setDelFlag(0); - shipmentOrder.setCreateTime(LocalDateTime.now()); - return shipmentOrderMapper.insert(shipmentOrder); - } - - /** - * 修改出库单 - * - * @param shipmentOrder 出库单 - * @return 结果 - */ - public int update(ShipmentOrder shipmentOrder) { - return shipmentOrderMapper.updateById(shipmentOrder); - } - - /** - * 批量删除出库单 - * - * @param ids 需要删除的出库单主键 - * @return 结果 - */ - @Transactional - public int deleteByIds(Long[] ids) { - int flag = 0; - for (Long id : ids) { - ShipmentOrder shipmentOrder = shipmentOrderMapper.selectById(id); - if (shipmentOrder == null) { - continue; - } - Integer shipmentOrderStatus = shipmentOrder.getShipmentOrderStatus(); - - // 1. 逻辑删除出库单 - flag += shipmentOrderMapper.updateDelFlagByIds(ids); - - // 2. 逻辑删除出库单详情 - shipmentOrderDetailService.updateDelFlag(shipmentOrder); - - if (shipmentOrderStatus != ShipmentOrderConstant.ALL_IN && shipmentOrderStatus != ShipmentOrderConstant.PART_IN) { - // 未出库的可以直接删除 - continue; - } - - // 3. 查询库存记录 - List inventoryHistories = inventoryHistoryService.selectByForm(shipmentOrder.getId(), shipmentOrder.getShipmentOrderType()); - - // 翻转库存记录的数量 - inventoryHistories.forEach(it -> { - it.setQuantity(it.getQuantity().negate()); - log.info("回滚库存:{} 数量:{}", it.getWarehouseId() + "_" + it.getAreaId() + "_" + it.getRackId() + "_" + it.getItemId(), it.getQuantity()); - }); - - // 4. 回滚库存 - inventoryService.batchUpdate1(inventoryHistories); - - // 5. 删除库存记录 - inventoryHistoryService.deleteByForm(shipmentOrder.getId(), shipmentOrder.getShipmentOrderType()); - - // todo 6. 回滚供应商流水 -// supplierTransactionService.deleteByForm(shipmentOrder.getId(), shipmentOrder.getReceiptOrderType()); - } - return flag; - } - - /** - * 删除出库单信息 - * - * @param id 出库单主键 - * @return 结果 - */ - public int deleteById(Long id) { - Long[] ids = {id}; - return shipmentOrderMapper.updateDelFlagByIds(ids); - } - - @Transactional - public int add(ShipmentOrderFrom order) { - LocalDateTime optDate = LocalDateTime.now(); - Long userId = SecurityUtils.getUserId(); - int res; - order.setDelFlag(0); - order.setCreateTime(optDate); - order.setShipmentOrderStatus(ShipmentOrderConstant.ALL_IN); - //直接出库完成 - res = shipmentOrderMapper.insert(order); - saveDetailsAllOut(order.getId(), order.getDetails()); - // 记录出库历史 - List addList = new ArrayList<>(); - order.getDetails().forEach(detail -> { - inventoryService.checkInventory(detail.getItemId(), detail.getWarehouseId(), detail.getAreaId(), detail.getRackId(), detail.getBatch(), detail.getPlanQuantity()); - InventoryHistory history = detailConvert.do2InventoryHistory(detail); - history.setFormId(order.getId()); - history.setFormType(order.getShipmentOrderType()); - history.setQuantity(detail.getPlanQuantity()); - history.setDelFlag(0); - history.setCreateTime(optDate); - history.setCreateBy(userId); - addList.add(history); - }); - inventoryHistoryService.batchInsert(addList); - // 更新库存 - addList.forEach(it -> it.setQuantity(it.getQuantity().negate())); - inventoryService.batchUpdate1(addList); - if (order.getReceivableAmount() != null && order.getCustomerId() != null) { - //保存订单金额到客户流水表 - saveOrUpdatePayAmount(order); - } - return res; - - - } - - public int update(ShipmentOrderFrom order) { - int res; - QueryWrapper qw = new QueryWrapper<>(); - qw.eq("shipment_order_id", order.getId()); - - // 新旧出库单详情对比, 生成 库存记录修改 - List details = order.getDetails(); - Map dbDetailMap = shipmentOrderDetailMapper.selectList(qw).stream().collect(Collectors.toMap(ShipmentOrderDetail::getId, it -> it)); - List adds = new ArrayList<>(); - LocalDateTime now = LocalDateTime.now(); - Long userId = SecurityUtils.getUserId(); - details.forEach(it -> { - Integer status = it.getShipmentOrderStatus(); - if (status != ShipmentOrderConstant.PART_IN && status != ShipmentOrderConstant.ALL_IN) { - return; - } - // 新增时, status一定是未出库, 所以这个地方必定有值 - ShipmentOrderDetail dbDetail = dbDetailMap.get(it.getId()); - // 如果上次的状态不是部分出库或者全部出库,则本次的库存变化为本次的全部 - Integer status1 = dbDetail.getShipmentOrderStatus(); - BigDecimal added; - - if (status1 != ShipmentOrderConstant.PART_IN && status1 != ShipmentOrderConstant.ALL_IN) { - added = it.getRealQuantity(); - } else { - BigDecimal before = dbDetail.getRealQuantity() == null ? BigDecimal.ZERO : dbDetail.getRealQuantity(); - BigDecimal after = it.getRealQuantity() == null ? BigDecimal.ZERO : it.getRealQuantity(); - // 数量变化有问题 - if (before.compareTo(after) >= 0) { - return; - } - added = after.subtract(before); - } - //判断库存是否足够出库 - inventoryService.checkInventory(it.getItemId(), it.getWarehouseId(), it.getAreaId(), it.getRackId(), null, added); - - // 1. 前一次的实际数量是 0 - InventoryHistory h = detailConvert.do2InventoryHistory(it); - h.setFormId(order.getId()); - h.setFormType(order.getShipmentOrderType()); - h.setQuantity(added.negate()); - h.setDelFlag(0); - h.setId(null); - h.setCreateTime(now); - h.setCreateBy(userId); - adds.add(h); - }); - if (!adds.isEmpty()) { - int add1 = inventoryHistoryService.batchInsert(adds); -// adds.forEach(it -> it.setQuantity(it.getQuantity().negate())); - int update1 = inventoryService.batchUpdate1(adds); - log.info("inventoryHistory: {}, inventory: {}", add1, update1); - } - // 2.1 先删除details 再重新保存 - shipmentOrderDetailMapper.delete(qw); - saveDetails(order.getId(), order.getDetails()); - if (order.getReceivableAmount() != null && order.getCustomerId() != null) { - //保存订单金额到客户流水表 - saveOrUpdatePayAmount(order); - } - - // 2.2 更新出库单 - //判断出库单的整体状态 - Set statusList = order.getDetails().stream().map(ShipmentOrderDetailVO::getShipmentOrderStatus).collect(Collectors.toSet()); - if (statusList.size() == 1) { - order.setShipmentOrderStatus(statusList.iterator().next()); - } else if (statusList.size() == 2) { - if (statusList.contains(ShipmentOrderConstant.DROP) && statusList.contains(ShipmentOrderConstant.ALL_IN)) { - //此时单据状态只有报废和全部出库,则出库单状态为全部出库 - order.setShipmentOrderStatus(ShipmentOrderConstant.ALL_IN); - } else if (statusList.contains(ShipmentOrderConstant.PART_IN) || statusList.contains(ShipmentOrderConstant.ALL_IN)) { - //此时单据状态有两个,包含部分出库和全部出库都是部分出库 - order.setShipmentOrderStatus(ShipmentOrderConstant.PART_IN); - } - - } else if (statusList.contains(ShipmentOrderConstant.PART_IN) || statusList.contains(ShipmentOrderConstant.ALL_IN)) { - //此时单据状态有两个,包含部分出库和全部出库都是部分出库 - order.setShipmentOrderStatus(ShipmentOrderConstant.PART_IN); - } - - res = shipmentOrderMapper.updateById(order); - return res; - } - - /** - * 保存订单金额到用户流水表 - * - * @param shipmentOrder 出库单 - */ - private void saveOrUpdatePayAmount(ShipmentOrder shipmentOrder) { - //todo 更换用户 - //todo 删除出库单 - CustomerTransaction customerTransaction = new CustomerTransaction(); - customerTransaction.setCustomerId(String.valueOf(shipmentOrder.getCustomerId())); - customerTransaction.setTransactionType(CustomerTransaction.SHIPMENT); - customerTransaction.setTransactionAmount(shipmentOrder.getReceivableAmount()); - customerTransaction.setShipmentOrderId(shipmentOrder.getId().intValue()); - customerTransaction.setTransactionCode("TS-" + DateUtils.randomId()); - customerTransactionService.insert(customerTransaction); - } - - private void saveDetails(Long orderId, List details) { - if (!CollUtil.isEmpty(details)) { - details.forEach(it -> it.setShipmentOrderId(orderId)); - List shipmentOrderDetails = detailConvert.vos2dos(details); - shipmentOrderDetailMapper.batchInsert(shipmentOrderDetails); - } - } - - private void saveDetailsAllOut(Long orderId, List details) { - if (!CollUtil.isEmpty(details)) { - details.forEach( - it -> { - it.setShipmentOrderId(orderId); - it.setRealQuantity(it.getPlanQuantity()); - it.setShipmentOrderStatus(ShipmentOrderConstant.ALL_IN); - }); - List shipmentOrderDetails = detailConvert.vos2dos(details); - shipmentOrderDetailMapper.batchInsert(shipmentOrderDetails); - } - } - - /* - * 单个订单分配仓库(填充详情单的仓库id,库区id,货架id) - * @param id 出库单id - * 1.根据出库单id查询出库单详情 - * 2.根据出库单详情的商品id,数量 - * 3.根据库存分配规则分配库存 - * 4.修改出库单详情 - * 5.修改出库单 - * */ - @Transactional - public void allocatedInventory(long id, Integer type) { - log.info("单个订单分配仓库,出库单id:{}", id); - // 1.根据出库单id查询出库单 - ShipmentOrder shipmentOrder = shipmentOrderMapper.selectById(id); - if (shipmentOrder == null) { - log.info("单个订单分配仓库--出库单不存在,{}", id); - throw new ServiceException("出库单不存在"); - } - // 2.根据出库单id查询出库单详情 - List allocationDetails = new ArrayList<>(); - List shipmentOrderDetails = shipmentOrderDetailMapper.selectListGroupByItemId(id); - log.info("出库单详情\n{}", shipmentOrderDetails); - // 3.获取出库单详情的商品id,数量 - shipmentOrderDetails.forEach(shipmentOrderDetail -> { - // 4.根据库存分配规则分配库存 - List shipmentOrderDetail1 = inventoryService.allocatedInventory(shipmentOrderDetail.getItemId(), - shipmentOrderDetail.getPlanQuantity(), type); - allocationDetails.addAll(shipmentOrderDetail1); - }); - allocationDetails.forEach(it -> { - // 5.修改出库单详情 - it.setShipmentOrderId(shipmentOrder.getId()); - it.setShipmentOrderStatus(ShipmentOrderConstant.NOT_IN); - it.setDelFlag(0); - }); - // 6.修改出库单 - shipmentOrderDetailService.deleteByOrderId(shipmentOrder.getId()); - shipmentOrderDetailMapper.batchInsert(allocationDetails); -// log.info("分配库存详情\n{}", allocationDetails); - - } - - public void updateWaveNo(Long orderId, String waveNo) { - ShipmentOrder shipmentOrder = shipmentOrderMapper.selectById(orderId); - if (shipmentOrder == null) { - throw new ServiceException("出库单不存在"); - } - String orderNo = shipmentOrder.getShipmentOrderNo(); - if (shipmentOrder.getShipmentOrderStatus() == ShipmentOrderConstant.ALL_IN || shipmentOrder.getShipmentOrderStatus() == ShipmentOrderConstant.PART_IN) { - throw new ServiceException("订单" + orderNo + "已经出库,不能分配波次"); - } - if (!StringUtils.isEmpty(shipmentOrder.getWaveNo())) { - throw new ServiceException("订单" + orderNo + "已经分配波次,不能重复分配"); - } - shipmentOrder.setWaveNo(waveNo); - shipmentOrderMapper.updateById(shipmentOrder); - } - - /* - * - * */ - public OrderWaveFrom selectDetailByWaveNo(String waveNo) { - OrderWaveFrom form = new OrderWaveFrom(); - List shipmentOrderDetails = shipmentOrderDetailMapper.selectDetailByWaveNo(waveNo); - List shipmentOrderDetailVOS = shipmentOrderDetailService.toVos(shipmentOrderDetails); - form.setDetails(shipmentOrderDetailVOS); - if (!CollUtil.isEmpty(form.getDetails())) { - List itemIds = form.getDetails().stream() - .map(ShipmentOrderDetailVO::getItemId).distinct().collect(Collectors.toList()); - ItemQuery query1 = new ItemQuery(); - query1.setIds(itemIds); - List list = itemService.selectList(query1, null); - List items = itemService.toVos(list); - form.setItems(items); - } - return form; - } - - public void deleteByWaveIds(Collection ids) { - LambdaUpdateWrapper qw = new LambdaUpdateWrapper<>(); - qw.in(ShipmentOrder::getWaveNo, ids); - qw.set(ShipmentOrder::getWaveNo, null); - shipmentOrderMapper.update(null, qw); - } - - public List statByCustomerAndType(CustomerShipmentStatQuery query) { - query.setBeginTime(query.getBeginTime() + " 00:00:00"); - query.setEndTime(query.getEndTime() + " 23:59:59"); - List shipmentOrderDetailVOS = shipmentOrderDetailMapper.statByCustomerAndType(query); - if (CollUtil.isEmpty(shipmentOrderDetailVOS)) { - return new ArrayList<>(); - } - //根据客户id和type分组统计 - // k:客户id k2:typeId v:统计后的金额 - Map> data = shipmentOrderDetailVOS.stream().collect(Collectors.groupingBy( - it -> it.getCustomerId() == null ? -1L : it.getCustomerId(), - Collectors.groupingBy( - ShipmentOrderDetailVO::getItemType, - Collectors.reducing( - BigDecimal.ZERO, - v -> v.getMoney() == null ? BigDecimal.ZERO : v.getMoney().multiply(new BigDecimal(String.valueOf(v.getRealQuantity()))), - BigDecimal::add))) - ); - Map customerNameMap = customerMapper.selectBatchIds(data.keySet()).stream().collect(Collectors.toMap(Customer::getId, Customer::getCustomerName)); - List result = new ArrayList<>(); - for (Map.Entry> entry : data.entrySet()) { - CustomerShipmentStatVO vo = new CustomerShipmentStatVO(); - vo.setCustomerId(entry.getKey()); - vo.setData(new ArrayList<>()); - vo.setCustomerName(customerNameMap.get(entry.getKey())); - vo.setTotal(BigDecimal.ZERO); - result.add(vo); - for (Map.Entry inner : entry.getValue().entrySet()) { - AmountStatByItemTypeVO innerVo = new AmountStatByItemTypeVO(); - innerVo.setItemTypeId(inner.getKey()); - innerVo.setAmount(inner.getValue()); - vo.getData().add(innerVo); - vo.setTotal(vo.getTotal().add(innerVo.getAmount())); - } - } - return result; - } -} diff --git a/wms/src/main/java/com/cyl/wms/service/SupplierService.java b/wms/src/main/java/com/cyl/wms/service/SupplierService.java deleted file mode 100644 index 22a19be..0000000 --- a/wms/src/main/java/com/cyl/wms/service/SupplierService.java +++ /dev/null @@ -1,127 +0,0 @@ -package com.cyl.wms.service; - -import java.util.Arrays; -import java.util.List; -import java.time.LocalDateTime; -import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; -import com.github.pagehelper.PageHelper; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.data.domain.Pageable; -import org.apache.commons.lang3.StringUtils; -import org.springframework.stereotype.Service; -import com.cyl.wms.mapper.SupplierMapper; -import com.cyl.wms.domain.Supplier; -import com.cyl.wms.pojo.query.SupplierQuery; - -/** - * 供应商Service业务层处理 - * - * - * @author zcc - */ -@Service -public class SupplierService { - @Autowired - private SupplierMapper supplierMapper; - - /** - * 查询供应商 - * - * @param id 供应商主键 - * @return 供应商 - */ - public Supplier selectById(Long id) { - return supplierMapper.selectById(id); - } - - /** - * 查询供应商列表 - * - * @param query 查询条件 - * @param page 分页条件 - * @return 供应商 - */ - public List selectList(SupplierQuery query, Pageable page) { - if (page != null) { - PageHelper.startPage(page.getPageNumber() + 1, page.getPageSize()); - } - QueryWrapper qw = new QueryWrapper<>(); - qw.eq("del_flag",0); - String supplierNo = query.getSupplierNo(); - if (!StringUtils.isEmpty(supplierNo)) { - qw.eq("supplier_no", supplierNo); - } - String supplierNameLike = query.getSupplierNameLike(); - if (!StringUtils.isEmpty(supplierNameLike)) { - qw.like("supplier_name", supplierNameLike); - } - String address = query.getAddress(); - if (!StringUtils.isEmpty(address)) { - qw.eq("address", address); - } - String mobileNo = query.getMobileNo(); - if (!StringUtils.isEmpty(mobileNo)) { - qw.eq("mobile_no", mobileNo); - } - String telNo = query.getTelNo(); - if (!StringUtils.isEmpty(telNo)) { - qw.eq("tel_no", telNo); - } - String contact = query.getContact(); - if (!StringUtils.isEmpty(contact)) { - qw.eq("contact", contact); - } - String level = query.getLevel(); - if (!StringUtils.isEmpty(level)) { - qw.eq("level", level); - } - String email = query.getEmail(); - if (!StringUtils.isEmpty(email)) { - qw.eq("email", email); - } - return supplierMapper.selectList(qw); - } - - /** - * 新增供应商 - * - * @param supplier 供应商 - * @return 结果 - */ - public int insert(Supplier supplier) { - supplier.setDelFlag(0); - supplier.setCreateTime(LocalDateTime.now()); - return supplierMapper.insert(supplier); - } - - /** - * 修改供应商 - * - * @param supplier 供应商 - * @return 结果 - */ - public int update(Supplier supplier) { - return supplierMapper.updateById(supplier); - } - - /** - * 批量删除供应商 - * - * @param ids 需要删除的供应商主键 - * @return 结果 - */ - public int deleteByIds(Long[] ids) { - return supplierMapper.updateDelFlagByIds(ids); - } - - /** - * 删除供应商信息 - * - * @param id 供应商主键 - * @return 结果 - */ - public int deleteById(Long id) { - Long[] ids = {id}; - return supplierMapper.updateDelFlagByIds(ids); - } -} diff --git a/wms/src/main/java/com/cyl/wms/service/SupplierTransactionService.java b/wms/src/main/java/com/cyl/wms/service/SupplierTransactionService.java deleted file mode 100644 index 946ac93..0000000 --- a/wms/src/main/java/com/cyl/wms/service/SupplierTransactionService.java +++ /dev/null @@ -1,153 +0,0 @@ -package com.cyl.wms.service; - -import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; -import com.cyl.wms.domain.Supplier; -import com.cyl.wms.domain.SupplierTransaction; -import com.cyl.wms.mapper.SupplierTransactionMapper; -import com.cyl.wms.pojo.query.SupplierTransactionQuery; -import com.github.pagehelper.PageHelper; -import org.apache.commons.lang3.StringUtils; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.data.domain.Pageable; -import org.springframework.stereotype.Service; - -import java.math.BigDecimal; -import java.time.LocalDateTime; -import java.util.List; -import java.util.Optional; - -/** - * 供应商账户流水Service业务层处理 - * - * @author zcc - */ -@Service -public class SupplierTransactionService { - @Autowired - private SupplierTransactionMapper supplierTransactionMapper; - - @Autowired - private SupplierService supplierService; - - /** - * 查询供应商账户流水 - * - * @param id 供应商账户流水主键 - * @return 供应商账户流水 - */ - public SupplierTransaction selectById(Integer id) { - return supplierTransactionMapper.selectById(id); - } - - /** - * 查询供应商账户流水列表 - * - * @param query 查询条件 - * @param page 分页条件 - * @return 供应商账户流水 - */ - public List selectList(SupplierTransactionQuery query, Pageable page) { - if (page != null) { - PageHelper.startPage(page.getPageNumber() + 1, page.getPageSize(), "create_time desc"); - } - LambdaQueryWrapper qw = new LambdaQueryWrapper<>(); - if (!StringUtils.isEmpty(query.getSupplierId())) { - qw.eq(SupplierTransaction::getSupplierId, query.getSupplierId()); - } - if (!StringUtils.isEmpty(query.getTransactionCode())) { - qw.eq(SupplierTransaction::getTransactionCode, query.getTransactionCode()); - } - if (!StringUtils.isEmpty(query.getTransactionType())) { - qw.eq(SupplierTransaction::getTransactionType, query.getTransactionType()); - } - Optional.ofNullable(query.getStartTime()).ifPresent( - startTime -> qw.ge(SupplierTransaction::getCreateTime, query.getStartTime()) - ); - Optional.ofNullable(query.getEndTime()).ifPresent( - startTime -> qw.le(SupplierTransaction::getCreateTime, query.getEndTime()) - ); - return supplierTransactionMapper.selectList(qw); - } - - /** - * 新增供应商账户流水 - * - * @param supplierTransaction 供应商账户流水 - * @return 结果 - */ - public int insert(SupplierTransaction supplierTransaction) { - Supplier supplier = supplierService.selectById(Long.valueOf(supplierTransaction.getSupplierId())); - if (supplier == null) { - return 0; - } - supplierTransaction.setCreateTime(LocalDateTime.now()); - supplierTransaction.setPreviousBalance(supplier.getPayableAmount()); - BigDecimal duePay = supplier.getPayableAmount(); - BigDecimal after = supplier.getPayableAmount(); - if (SupplierTransaction.ENTER.equals(supplierTransaction.getTransactionType())) { - after = duePay.subtract(supplierTransaction.getTransactionAmount()); - } else if (SupplierTransaction.EXIT.equals(supplierTransaction.getTransactionType())) { - after = duePay.add(supplierTransaction.getTransactionAmount()); - } else if (SupplierTransaction.RECEIPT.equals(supplierTransaction.getTransactionType())) { - - //查询 该入库单是否已经添加 - LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper<>(); - queryWrapper.eq(SupplierTransaction::getReceiptOrderId, supplierTransaction.getReceiptOrderId()); - queryWrapper.orderByDesc(SupplierTransaction::getId); - List supplierTransactions = supplierTransactionMapper.selectList(queryWrapper); - if (supplierTransactions.size() > 0) { - //更新入库单金额 - SupplierTransaction supplierTransaction1 = supplierTransactions.get(0); - if (supplierTransaction1.getTransactionAmount().compareTo(supplierTransaction.getTransactionAmount()) != 0) { - //发生金额变化 - after = duePay.add(supplierTransaction.getTransactionAmount().subtract(supplierTransaction1.getTransactionAmount())); - } else { - //无金额变化 - return 0; - } - } else { - //新增 - after = duePay.add(supplierTransaction.getTransactionAmount()); - } - - } - supplierTransaction.setCurrentBalance(after); - - //更新供应商 应付款 - supplier.setPayableAmount(after); - supplierService.update(supplier); - - return supplierTransactionMapper.insert(supplierTransaction); - } - - /** - * 修改供应商账户流水 - * - * @param supplierTransaction 供应商账户流水 - * @return 结果 - */ - public int update(SupplierTransaction supplierTransaction) { - return supplierTransactionMapper.updateById(supplierTransaction); - } - - /** - * 批量删除供应商账户流水 - * - * @param ids 需要删除的供应商账户流水主键 - * @return 结果 - */ - public int deleteByIds(Long[] ids) { - return supplierTransactionMapper.updateDelFlagByIds(ids); - } - - /** - * 删除供应商账户流水信息 - * - * @param id 供应商账户流水主键 - * @return 结果 - */ - public int deleteById(Long id) { - Long[] ids = {id}; - return supplierTransactionMapper.updateDelFlagByIds(ids); - } -} diff --git a/wms/src/main/java/com/cyl/wms/service/WarehouseService.java b/wms/src/main/java/com/cyl/wms/service/WarehouseService.java deleted file mode 100644 index d287b3e..0000000 --- a/wms/src/main/java/com/cyl/wms/service/WarehouseService.java +++ /dev/null @@ -1,121 +0,0 @@ -package com.cyl.wms.service; - -import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; -import com.cyl.wms.domain.Warehouse; -import com.cyl.wms.mapper.WarehouseMapper; -import com.cyl.wms.pojo.query.WarehouseQuery; -import com.github.pagehelper.PageHelper; -import org.apache.commons.lang3.StringUtils; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.data.domain.Pageable; -import org.springframework.stereotype.Service; - -import java.time.LocalDateTime; -import java.util.ArrayList; -import java.util.Collection; -import java.util.List; - -/** - * 仓库Service业务层处理 - * - * - * @author zcc - */ -@Service -public class WarehouseService { - @Autowired - private WarehouseMapper warehouseMapper; - - /** - * 查询仓库 - * - * @param id 仓库主键 - * @return 仓库 - */ - public Warehouse selectById(Long id) { - return warehouseMapper.selectById(id); - } - - /** - * 查询仓库列表 - * - * @param query 查询条件 - * @param page 分页条件 - * @return 仓库 - */ - public List selectList(WarehouseQuery query, Pageable page) { - if (page != null) { - PageHelper.startPage(page.getPageNumber() + 1, page.getPageSize()); - } - QueryWrapper qw = new QueryWrapper<>(); - qw.eq("del_flag",0); - String warehouseNo = query.getWarehouseNo(); - if (!StringUtils.isEmpty(warehouseNo)) { - qw.eq("warehouse_no", warehouseNo); - } - String warehouseNameLike = query.getWarehouseNameLike(); - if (!StringUtils.isEmpty(warehouseNameLike)) { - qw.like("warehouse_name", warehouseNameLike); - } - return warehouseMapper.selectList(qw); - } - - /** - * 新增仓库 - * - * @param warehouse 仓库 - * @return 结果 - */ - public int insert(Warehouse warehouse) { - warehouse.setDelFlag(0); - warehouse.setCreateTime(LocalDateTime.now()); - return warehouseMapper.insert(warehouse); - } - - /** - * 修改仓库 - * - * @param warehouse 仓库 - * @return 结果 - */ - public int update(Warehouse warehouse) { - return warehouseMapper.updateById(warehouse); - } - - /** - * 批量删除仓库 - * - * @param ids 需要删除的仓库主键 - * @return 结果 - */ - public int deleteByIds(Long[] ids) { - return warehouseMapper.updateDelFlagByIds(ids); - } - - /** - * 删除仓库信息 - * - * @param id 仓库主键 - * @return 结果 - */ - public int deleteById(Long id) { - Long[] ids = {id}; - return warehouseMapper.updateDelFlagByIds(ids); - } - - /** - * 根据主键集合查询仓库列表 - * - * @param ids 主键集合 - * @return 仓库列表 - */ - public List selectByIdIn(Collection ids) { - // 如果主键集合为空,直接返回空集合 - if (ids == null || ids.isEmpty()) { - return new ArrayList<>(); - } - QueryWrapper qw = new QueryWrapper<>(); - qw.in("id",ids); - return warehouseMapper.selectList(qw); - } -} diff --git a/wms/src/main/java/com/cyl/wms/service/WaveService.java b/wms/src/main/java/com/cyl/wms/service/WaveService.java deleted file mode 100644 index 685f946..0000000 --- a/wms/src/main/java/com/cyl/wms/service/WaveService.java +++ /dev/null @@ -1,402 +0,0 @@ -package com.cyl.wms.service; - -import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; -import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; -import com.cyl.wms.constant.ShipmentOrderConstant; -import com.cyl.wms.convert.ShipmentOrderDetailConvert; -import com.cyl.wms.domain.InventoryHistory; -import com.cyl.wms.domain.ShipmentOrder; -import com.cyl.wms.domain.ShipmentOrderDetail; -import com.cyl.wms.domain.Wave; -import com.cyl.wms.mapper.ShipmentOrderDetailMapper; -import com.cyl.wms.mapper.ShipmentOrderMapper; -import com.cyl.wms.mapper.WaveMapper; -import com.cyl.wms.pojo.query.WaveQuery; -import com.cyl.wms.pojo.vo.ShipmentOrderDetailVO; -import com.cyl.wms.pojo.vo.form.OrderWaveFrom; -import com.github.pagehelper.PageHelper; -import com.ruoyi.common.exception.ServiceException; -import com.ruoyi.common.utils.SecurityUtils; -import lombok.extern.slf4j.Slf4j; -import org.apache.commons.lang3.StringUtils; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.data.domain.Pageable; -import org.springframework.stereotype.Service; -import org.springframework.transaction.annotation.Transactional; - -import java.math.BigDecimal; -import java.time.LocalDateTime; -import java.util.*; -import java.util.concurrent.atomic.AtomicReference; -import java.util.stream.Collectors; - -/** - * 波次Service业务层处理 - * - * @author zhangcheng - */ -@Service -@Slf4j -public class WaveService { - @Autowired - private WaveMapper waveMapper; - @Autowired - private InventoryHistoryService inventoryHistoryService; - @Autowired - private ShipmentOrderService shipmentOrderService; - @Autowired - - private ShipmentOrderDetailService shipmentOrderDetailService; - @Autowired - private ShipmentOrderDetailConvert shipmentOrderDetailConvert; - - @Autowired - private ShipmentOrderMapper shipmentOrderMapper; - - @Autowired - private ShipmentOrderDetailMapper shipmentOrderDetailMapper; - @Autowired - private InventoryService inventoryService; - - /** - * 查询波次 - * - * @param id 波次主键 - * @return 波次 - */ - public Wave selectById(Long id) { - return waveMapper.selectById(id); - } - - /** - * 查询波次列表 - * - * @param query 查询条件 - * @param page 分页条件 - * @return 波次 - */ - public List selectList(WaveQuery query, Pageable page) { - if (page != null) { - PageHelper.startPage(page.getPageNumber() + 1, page.getPageSize()); - } - QueryWrapper qw = new QueryWrapper<>(); - qw.orderByDesc("id"); - qw.eq("del_flag", 0); - String waveNo = query.getWaveNo(); - if (!StringUtils.isEmpty(waveNo)) { - qw.eq("wave_no", waveNo); - } - String status = query.getStatus(); - if (!StringUtils.isEmpty(status)) { - qw.eq("status", status); - } - return waveMapper.selectList(qw); - } - - /** - * 新增波次 - * - * @param wave 波次 - * @return 结果 - */ - public int insert(Wave wave) { - wave.setDelFlag(0); - wave.setCreateTime(LocalDateTime.now()); - return waveMapper.insert(wave); - } - - /** - * 新增波次 - * - * @param wave 波次 - * @return 结果 - */ - @Transactional - public int creatWave(Wave wave) { - ArrayList orderIds = wave.getIds(); - log.info("出库单进行波次作业:{}", orderIds); - wave.setWaveNo("WV" + System.currentTimeMillis()); - wave.setStatus("1"); - wave.setDelFlag(0); - wave.setCreateTime(LocalDateTime.now()); - boolean flag = waveMapper.insert(wave) > 0; - if (flag) { - // 变更相应订单的波次号 - for (Long orderId : orderIds) { - shipmentOrderService.updateWaveNo(orderId, wave.getWaveNo()); - } - } - return flag ? 1 : 0; - } - - /** - * 获取波次单明细 - * - * @param id 波次id - * @return 结果 - */ - @Transactional - public OrderWaveFrom getShipmentOrders(long id) { - Wave wave = selectById(id); - if (wave == null) { - throw new ServiceException("波次单不存在"); - } - String waveNo = wave.getWaveNo(); - OrderWaveFrom orderWaveFrom = shipmentOrderService.selectDetailByWaveNo(waveNo); - orderWaveFrom.setRemark(wave.getRemark()); - return orderWaveFrom; - } - - - /** - * 修改波次 - * - * @param wave 波次 - * @return 结果 - */ - public int update(Wave wave) { - return waveMapper.updateById(wave); - } - - /** - * 批量删除波次 - * - * @param ids 需要删除的波次主键 - * @return 结果 - */ - public int deleteByIds(Long[] ids) { - shipmentOrderService.deleteByWaveIds(waveMapper.selectList(new LambdaQueryWrapper() - .select(Wave::getWaveNo) - .in(Wave::getId, Arrays.asList(ids))) - .stream().map(Wave::getWaveNo).collect(Collectors.toList())); - return waveMapper.updateDelFlagByIds(ids); - } - - /** - * 删除波次信息 - * - * @param id 波次主键 - * @return 结果 - */ - public int deleteById(Long id) { - Long[] ids = {id}; - return waveMapper.updateDelFlagByIds(ids); - } - - /* - * 波次单分配仓库 - * */ - @Transactional - public OrderWaveFrom allocatedInventory(Long id, Integer type) { - log.info("波次单分配仓库分配仓库,波次单id:{}", id); - Wave wave = selectById(id); - String waveNo = wave.getWaveNo(); - OrderWaveFrom shipmentOrderFrom = shipmentOrderService.selectDetailByWaveNo(waveNo); - List originalDetail = (List) shipmentOrderDetailConvert.copyList(shipmentOrderFrom.getDetails()); - - List originalDetails = aggregatedShipmentOrderDetailVOS(originalDetail); - // 根据itemId分组,统计数量 - Map collect = originalDetails.parallelStream().collect(Collectors.groupingBy(ShipmentOrderDetailVO::getItemId, - Collectors.reducing(BigDecimal.ZERO, ShipmentOrderDetailVO::getPlanQuantity, BigDecimal::add))); - - List allocationDetails = new ArrayList<>(); - - //collect分配库存 - collect.forEach((itemId, quantity) -> { - log.info("波次单分配仓库分配仓库,波次单id:{},物料id:{},数量:{}", id, itemId, quantity); - List shipmentOrderDetails = inventoryService. - allocatedInventory(itemId, quantity, type); - allocationDetails.addAll(shipmentOrderDetails); - }); - - log.info("分配库存详情\n{}", allocationDetails); - List list = shipmentOrderDetailService.toVos(allocationDetails); - List allocatedDetails = new ArrayList<>(); - - //2.更新原始库存 - originalDetails.forEach(originalOrder -> { - Long itemId = originalOrder.getItemId(); - BigDecimal planQuantity = originalOrder.getPlanQuantity(); - // 从list里面取出相同物料得库存记录,需要取planQuantity数量, - // 如果planQuantity数量小于库存数量,需要继续取下一个库存记录,直到planQuantity为0。 - // 已经被使用得list记录需要从list中移除 - for (int i = 0; i < list.size() && planQuantity.compareTo(BigDecimal.ZERO) > 0; i++) { - ShipmentOrderDetailVO availableDetail = list.get(i); - Long itemId1 = availableDetail.getItemId(); - BigDecimal availableQuantity = availableDetail.getPlanQuantity(); - if (itemId.equals(itemId1)) { - if (planQuantity.compareTo(availableQuantity) >= 0) { - //深拷贝一个新的对象 - planQuantity = planQuantity.subtract(availableQuantity); - originalOrder.setPlanQuantity(planQuantity); - allocatedDetails.add(convert2vo(originalOrder, availableDetail, availableQuantity)); - list.remove(i); - i--; - } else { - availableQuantity = availableQuantity.subtract(planQuantity); - // 更新list当前item得数量 - availableDetail.setPlanQuantity(availableQuantity); - list.set(i, availableDetail); - allocatedDetails.add(convert2vo(originalOrder, availableDetail, planQuantity)); - planQuantity = BigDecimal.ZERO; - } - } - } - - }); - //log.info("波次单分配仓库分配仓库,list:{}", list); - //todo 2.针对波次分配失败的打包创建子波次(当前不具备拆分子波次功能) - shipmentOrderFrom.setAllocationDetails(allocatedDetails); - //log.info("波次单分配仓库分配仓库,originalDetails:{},分配库存详情\n{}", originalDetails, allocatedDetails); - return shipmentOrderFrom; - } - - - /* - * 取消分配 即还原出库单明细 - * */ - private static List aggregatedShipmentOrderDetailVOS(List originalDetail) { - // 单个出库单分配后库区,还可以波次? 可以,这一步就是重新聚合订单分散得拣货数据。 - // 聚合出库单,防止用户先前分配过库存。如果分配过库存,需要把分配过的库存加回来。保留原始订单信息 - Map aggregatedDetails = new HashMap<>(); - originalDetail.forEach(vo -> { - String key = vo.getItemId() + "_" + vo.getOrderNo(); - aggregatedDetails.merge(key, vo, (existingVo, newVo) -> { - existingVo.setPlanQuantity(existingVo.getPlanQuantity().add(newVo.getPlanQuantity())); - existingVo.setDelFlag(0); - return existingVo; - }); - }); - return new ArrayList<>(aggregatedDetails.values()); - } - - private ShipmentOrderDetailVO convert2vo(ShipmentOrderDetailVO originalOrder, ShipmentOrderDetailVO availableDetail, BigDecimal availableQuantity) { - ShipmentOrderDetailVO shipmentOrderDetailVO2 = new ShipmentOrderDetailVO(); - shipmentOrderDetailVO2.setOrderNo(originalOrder.getOrderNo()); - shipmentOrderDetailVO2.setItemId(originalOrder.getItemId()); - shipmentOrderDetailVO2.setShipmentOrderId(originalOrder.getShipmentOrderId()); - shipmentOrderDetailVO2.setPlanQuantity(availableQuantity); - shipmentOrderDetailVO2.setRealQuantity(availableQuantity); - shipmentOrderDetailVO2.setWarehouseId(availableDetail.getWarehouseId()); - shipmentOrderDetailVO2.setAreaId(availableDetail.getAreaId()); - shipmentOrderDetailVO2.setPlace(availableDetail.getPlace()); - shipmentOrderDetailVO2.setDelFlag(0); - // 默认出库状态为未出库 - shipmentOrderDetailVO2.setShipmentOrderStatus(ShipmentOrderConstant.NOT_IN); - return shipmentOrderDetailVO2; - } - - @Transactional - public Integer confirmWave(OrderWaveFrom order) { - //获取波次单 - Wave wave = waveMapper.selectById(order.getId()); - List details = order.getAllocationDetails(); - // 删除出库单明细表 - List orderIds = details.stream().map(ShipmentOrderDetailVO::getShipmentOrderId).distinct().collect(Collectors.toList()); - LambdaQueryWrapper deleteWrapper = new LambdaQueryWrapper<>(); - deleteWrapper.in(ShipmentOrderDetail::getShipmentOrderId, orderIds); - shipmentOrderDetailMapper.delete(deleteWrapper); - - // 插入出库单明细表 - List shipmentOrderDetails = shipmentOrderDetailConvert.vos2dos(details); - - List adds = new ArrayList<>(); - LocalDateTime now = LocalDateTime.now(); - Long userId = SecurityUtils.getUserId(); - - details.forEach(it -> { - Integer status = it.getShipmentOrderStatus(); - if (status == ShipmentOrderConstant.NOT_IN || status == ShipmentOrderConstant.DROP) { - // 未出库,跳过 - return; - } - if (status == ShipmentOrderConstant.PART_IN) { - // 部分出库,需要更新出库单状态为未出库 - BigDecimal added = it.getRealQuantity(); - //判断库存是否足够出库 - inventoryService.checkInventory(it.getItemId(), it.getWarehouseId(), it.getAreaId(), it.getRackId(), null, added); - - // 1. 前一次的实际数量是 0 - InventoryHistory h = shipmentOrderDetailConvert.do2InventoryHistory(it); - h.setFormId(order.getId()); -// h.setFormType(order.getShipmentOrderType()); - h.setQuantity(added.negate()); - h.setDelFlag(0); - h.setId(null); - h.setCreateTime(now); - h.setCreateBy(userId); - adds.add(h); - } - }); - if (!adds.isEmpty()) { - int add1 = inventoryHistoryService.batchInsert(adds); -// adds.forEach(it -> it.setQuantity(it.getQuantity().negate())); - int update1 = inventoryService.batchUpdate1(adds); - log.info("inventoryHistory: {}, inventory: {}", add1, update1); - } - int batchInsert = shipmentOrderDetailMapper.batchInsert(shipmentOrderDetails); - - //先按照出库单ID分组 - Map> map = shipmentOrderDetails.stream().collect(Collectors.groupingBy(it -> it.getShipmentOrderId())); - Map orderMap = shipmentOrderMapper.selectList(new QueryWrapper().in("id", map.keySet())).stream().collect(Collectors.toMap(it -> it.getId(), it -> it)); - // 2.2 更新出库单 - AtomicReference finish = new AtomicReference<>(true); - map.forEach((key,val)->{ - //判断出库单的整体状态 - Set statusList = val.stream().map(ShipmentOrderDetail::getShipmentOrderStatus).collect(Collectors.toSet()); - ShipmentOrder shipmentOrder = orderMap.get(key); - if (statusList.size() == 1) { - shipmentOrder.setShipmentOrderStatus(statusList.iterator().next()); - } else if (statusList.size() == 2) { - if (statusList.contains(ShipmentOrderConstant.DROP) && statusList.contains(ShipmentOrderConstant.ALL_IN)) { - //此时单据状态只有报废和全部出库,则出库单状态为全部出库 - shipmentOrder.setShipmentOrderStatus(ShipmentOrderConstant.ALL_IN); - } else if (statusList.contains(ShipmentOrderConstant.PART_IN) || statusList.contains(ShipmentOrderConstant.ALL_IN)) { - //此时单据状态有两个,包含部分出库和全部出库都是部分出库 - shipmentOrder.setShipmentOrderStatus(ShipmentOrderConstant.PART_IN); - } - - } else if (statusList.contains(ShipmentOrderConstant.PART_IN) || statusList.contains(ShipmentOrderConstant.ALL_IN)) { - //此时单据状态有两个,包含部分出库和全部出库都是部分出库 - shipmentOrder.setShipmentOrderStatus(ShipmentOrderConstant.PART_IN); - } - if (finish.get()) { - finish.set(shipmentOrder.getShipmentOrderStatus() == ShipmentOrderConstant.ALL_IN); - } - shipmentOrderMapper.updateById(shipmentOrder); - }); - wave.setStatus(finish.get() ? "3":"2"); - if (!Objects.equals(order.getRemark(), wave.getRemark())) { - wave.setRemark(order.getRemark()); - } - waveMapper.updateById(wave); - return batchInsert; - - } - - /* - * 取消波次作业 - * */ - @Transactional - public Integer cancelAllocatedInventory(Long id) { - Wave wave = selectById(id); - String waveNo = wave.getWaveNo(); - OrderWaveFrom shipmentOrderFrom = shipmentOrderService.selectDetailByWaveNo(waveNo); - List originalDetail = (List) shipmentOrderDetailConvert.copyList(shipmentOrderFrom.getDetails()); - - List originalDetails = aggregatedShipmentOrderDetailVOS(originalDetail); - // 删除出库单明细表 - List orderIds = originalDetail.stream().map(ShipmentOrderDetailVO::getShipmentOrderId).distinct().collect(Collectors.toList()); - LambdaQueryWrapper deleteWrapper = new LambdaQueryWrapper<>(); - deleteWrapper.in(ShipmentOrderDetail::getShipmentOrderId, orderIds); - shipmentOrderDetailMapper.delete(deleteWrapper); - - // 插入出库单明细表 - List shipmentOrderDetails = shipmentOrderDetailConvert.vos2dos(originalDetails); - shipmentOrderDetails.forEach(shipmentOrderDetail -> { - shipmentOrderDetail.setDelFlag(0); - shipmentOrderDetail.setShipmentOrderStatus(ShipmentOrderConstant.NOT_IN); - }); - return shipmentOrderDetailMapper.batchInsert(shipmentOrderDetails); - } -} diff --git a/wms/src/main/resources/application.properties b/wms/src/main/resources/application.properties deleted file mode 100644 index 8b13789..0000000 --- a/wms/src/main/resources/application.properties +++ /dev/null @@ -1 +0,0 @@ - diff --git a/wms/src/main/resources/mapper/AreaMapper.xml b/wms/src/main/resources/mapper/AreaMapper.xml deleted file mode 100644 index db6e545..0000000 --- a/wms/src/main/resources/mapper/AreaMapper.xml +++ /dev/null @@ -1,43 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - select id, area_no, area_name, warehouse_id, remark, del_flag, create_by, create_time, update_by, update_time from wms_area - - - - - - update wms_area set del_flag=1 - - id in #{it} - - - diff --git a/wms/src/main/resources/mapper/CarrierMapper.xml b/wms/src/main/resources/mapper/CarrierMapper.xml deleted file mode 100644 index 9f087c9..0000000 --- a/wms/src/main/resources/mapper/CarrierMapper.xml +++ /dev/null @@ -1,53 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - select id, carrier_no, carrier_name, address, mobile, tel, contact, level, email, remark, del_flag, create_by, create_time, update_by, update_time from wms_carrier - - - - - - update wms_carrier set del_flag=1 - - id in #{it} - - - diff --git a/wms/src/main/resources/mapper/CustomerMapper.xml b/wms/src/main/resources/mapper/CustomerMapper.xml deleted file mode 100644 index 9ecdf3f..0000000 --- a/wms/src/main/resources/mapper/CustomerMapper.xml +++ /dev/null @@ -1,53 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - select id, customer_no, customer_name, address, mobile, tel, customer_person, customer_level, email, remark, del_flag, create_by, create_time, update_by, update_time from wms_customer - - - - - - update wms_customer set del_flag=1 - - id in #{it} - - - diff --git a/wms/src/main/resources/mapper/CustomerTransactionMapper.xml b/wms/src/main/resources/mapper/CustomerTransactionMapper.xml deleted file mode 100644 index aa509f7..0000000 --- a/wms/src/main/resources/mapper/CustomerTransactionMapper.xml +++ /dev/null @@ -1,46 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - select id, transaction_code, customer_id, transaction_type, transaction_amount, previous_balance, current_balance, shipment_order_id, remark, del_flag, create_time, update_time from wms_customer_transaction - - - - - - - update wms_customer_transaction set del_flag=1 - - id in #{it} - - - diff --git a/wms/src/main/resources/mapper/DeliveryMapper.xml b/wms/src/main/resources/mapper/DeliveryMapper.xml deleted file mode 100644 index 5858ab1..0000000 --- a/wms/src/main/resources/mapper/DeliveryMapper.xml +++ /dev/null @@ -1,45 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - select id, shipment_order_id, carrier_id, delivery_date, tracking_no, remark, del_flag, create_by, create_time, update_by, update_time from wms_delivery - - - - - - update wms_delivery set del_flag=1 - - id in #{it} - - - diff --git a/wms/src/main/resources/mapper/InventoryCheckDetailMapper.xml b/wms/src/main/resources/mapper/InventoryCheckDetailMapper.xml deleted file mode 100644 index c2df2cd..0000000 --- a/wms/src/main/resources/mapper/InventoryCheckDetailMapper.xml +++ /dev/null @@ -1,79 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - select id, inventory_check_id, item_id, quantity, check_quantity, warehouse_id, area_id, rack_id, del_flag, remark, create_by, create_time, update_by, update_time from wms_inventory_check_detail - - - - - insert into wms_inventory_check_detail - (inventory_check_id, - item_id, - quantity, - check_quantity, - warehouse_id, - area_id, - rack_id, - remark, - create_by, - create_time, - update_by, - update_time - ) - values - - - #{item.inventoryCheckId,jdbcType=BIGINT},#{item.itemId,jdbcType=BIGINT},#{item.quantity,jdbcType=DECIMAL},#{item.checkQuantity,jdbcType=DECIMAL}, - #{item.warehouseId,jdbcType=BIGINT}, #{item.areaId,jdbcType=BIGINT}, #{item.rackId,jdbcType=BIGINT}, - #{item.remark,jdbcType=VARCHAR},#{item.createBy,jdbcType=BIGINT},#{item.createTime,jdbcType=TIMESTAMP}, - #{item.updateBy,jdbcType=BIGINT},#{item.updateTime,jdbcType=TIMESTAMP}, - - - - - - - - - update wms_inventory_check_detail set del_flag=1 - - id in #{it} - - - diff --git a/wms/src/main/resources/mapper/InventoryCheckMapper.xml b/wms/src/main/resources/mapper/InventoryCheckMapper.xml deleted file mode 100644 index 99ee578..0000000 --- a/wms/src/main/resources/mapper/InventoryCheckMapper.xml +++ /dev/null @@ -1,59 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - select id, inventory_check_no, inventory_check_type, inventory_check_status, inventory_check_total, check_status, check_user_id, check_time, warehouse_id, area_id, rack_id, attachment, remark, del_flag, create_by, create_time, update_by, update_time from wms_inventory_check - - - - - - update wms_inventory_check set del_flag=1 - - id in #{it} - - - diff --git a/wms/src/main/resources/mapper/InventoryHistoryMapper.xml b/wms/src/main/resources/mapper/InventoryHistoryMapper.xml deleted file mode 100644 index e829fa0..0000000 --- a/wms/src/main/resources/mapper/InventoryHistoryMapper.xml +++ /dev/null @@ -1,147 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - select id, - form_id, - form_type, - item_id, - rack_id, - quantity, - remark, - del_flag, - create_by, - create_time, - update_by, - update_time - from wms_inventory_history - - - - - - - update wms_inventory_history set del_flag=1 - - id in - #{it} - - - - insert into wms_inventory_history - (form_id, form_type, item_id, rack_id, quantity, remark, del_flag, create_by, create_time, update_by, - update_time, warehouse_id, area_id, batch, production_date, expiry_date) - values - - - #{item.formId, jdbcType=BIGINT}, - #{item.formType, jdbcType=INTEGER}, - #{item.itemId, jdbcType=BIGINT}, - #{item.rackId, jdbcType=BIGINT}, - #{item.quantity, jdbcType=DECIMAL}, - #{item.remark, jdbcType=VARCHAR}, - #{item.delFlag, jdbcType=TINYINT}, - #{item.createBy, jdbcType=BIGINT}, - #{item.createTime, jdbcType=DATE}, - #{item.updateBy, jdbcType=BIGINT}, - #{item.updateTime, jdbcType=DATE}, - #{item.warehouseId, jdbcType=BIGINT}, - #{item.areaId, jdbcType=BIGINT}, - #{item.batch, jdbcType=VARCHAR}, - #{item.productionDate, jdbcType=DATE}, - #{item.expiryDate, jdbcType=DATE}, - - - - diff --git a/wms/src/main/resources/mapper/InventoryMapper.xml b/wms/src/main/resources/mapper/InventoryMapper.xml deleted file mode 100644 index 652a56d..0000000 --- a/wms/src/main/resources/mapper/InventoryMapper.xml +++ /dev/null @@ -1,187 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - select id, - item_id, - rack_id, - quantity, - remark, - del_flag, - create_by, - create_time, - update_by, - update_time - from wms_inventory - - - - - - update wms_inventory set del_flag=1 - - id in - #{it} - - - - update wms_inventory - set quantity = quantity + ( - case - - when id = #{it.id} then #{it.quantity} - - end - ), - update_time = #{updateTime}, - update_by = #{userId} - where id in - - #{it.id} - - - - - - - - - - - - - - insert into wms_inventory - (item_id, rack_id, quantity, remark, del_flag, create_by, create_time, update_by, update_time, warehouse_id, - area_id, batch, production_date, expiry_date) - values - - - #{item.itemId, jdbcType=BIGINT}, #{item.rackId, jdbcType=BIGINT}, #{item.quantity, jdbcType=DECIMAL}, - #{item.remark, jdbcType=VARCHAR}, #{item.delFlag, jdbcType=TINYINT}, #{item.createBy, jdbcType=BIGINT}, - #{item.createTime, jdbcType=DATE}, #{item.updateBy, jdbcType=BIGINT}, #{item.updateTime, jdbcType=DATE}, - #{item.warehouseId, jdbcType=BIGINT}, #{item.areaId, jdbcType=BIGINT},#{item.batch, jdbcType=VARCHAR}, - #{item.productionDate, jdbcType=DATE},#{item.expiryDate, jdbcType=DATE} - - - - diff --git a/wms/src/main/resources/mapper/InventoryMovementDetailMapper.xml b/wms/src/main/resources/mapper/InventoryMovementDetailMapper.xml deleted file mode 100644 index d49db32..0000000 --- a/wms/src/main/resources/mapper/InventoryMovementDetailMapper.xml +++ /dev/null @@ -1,147 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - select id, - inventory_movement_id, - item_id, - plan_quantity, - real_quantity, - del_flag, - remark, - create_by, - create_time, - update_by, - update_time, - source_rack_id, - source_warehouse_id, - source_area_id, - move_status, - target_rack_id, - target_warehouse_id, - target_area_id - from wms_inventory_movement_detail - - - - - - update wms_inventory_movement_detail - set del_flag=1 - - id in - - #{it} - - - - - - insert into wms_inventory_movement_detail - ( - inventory_movement_id, - item_id, - plan_quantity, - real_quantity, - del_flag, - remark, - create_by, - create_time, - update_by, - update_time, - source_rack_id, - source_warehouse_id, - source_area_id, - move_status, - target_rack_id, - target_warehouse_id, - target_area_id) - values - - - #{item.inventoryMovementId, jdbcType=BIGINT}, #{item.itemId, jdbcType=BIGINT}, - #{item.planQuantity, jdbcType=DECIMAL}, #{item.realQuantity, jdbcType=DECIMAL}, - #{item.delFlag, jdbcType=TINYINT}, #{item.remark, jdbcType=VARCHAR}, - #{item.createBy, jdbcType=BIGINT}, #{item.createTime, jdbcType=DATE}, #{item.updateBy, jdbcType=BIGINT}, - #{item.updateTime, jdbcType=DATE}, #{item.sourceRackId, jdbcType=BIGINT}, - #{item.sourceWarehouseId, jdbcType=BIGINT}, #{item.sourceAreaId,jdbcType=BIGINT},#{item.moveStatus, jdbcType=TINYINT}, - #{item.targetRackId, jdbcType=BIGINT},#{item.targetWarehouseId, jdbcType=BIGINT}, #{item.targetAreaId,jdbcType=BIGINT} - - - - diff --git a/wms/src/main/resources/mapper/InventoryMovementMapper.xml b/wms/src/main/resources/mapper/InventoryMovementMapper.xml deleted file mode 100644 index c8e9267..0000000 --- a/wms/src/main/resources/mapper/InventoryMovementMapper.xml +++ /dev/null @@ -1,47 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - select id, inventory_movement_no, source_rack_id, target_rack_id, status, check_status, check_user_id, check_time, remark, del_flag, create_by, create_time, update_by, update_time from wms_inventory_movement - - - - - - update wms_inventory_movement set del_flag=1 - - id in #{it} - - - diff --git a/wms/src/main/resources/mapper/InventorySettlementDetailMapper.xml b/wms/src/main/resources/mapper/InventorySettlementDetailMapper.xml deleted file mode 100644 index 298b596..0000000 --- a/wms/src/main/resources/mapper/InventorySettlementDetailMapper.xml +++ /dev/null @@ -1,90 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - select id, settlement_id, settlement_type, item_id, item_no, item_name, warehouse_id, warehouse_no, warehouse_name, area_id, area_no, area_name, previous_balance, current_enter, current_out, current_check, current_balance, del_flag, remark, create_by, create_time, update_by, update_time from wms_inventory_settlement_detail - - - - insert into wms_inventory_settlement_detail - (settlement_id, settlement_type, item_id, item_no, item_name, - warehouse_id, warehouse_no, warehouse_name,area_id, area_no, area_name, - previous_balance, current_enter, current_out, current_check, current_balance, - remark, create_by, create_time, update_by, update_time - ) - values - - - #{item.settlementId,jdbcType=BIGINT},#{item.settlementType,jdbcType=BIGINT},#{item.itemId,jdbcType=BIGINT},#{item.itemNo,jdbcType=VARCHAR},#{item.itemName,jdbcType=VARCHAR}, - #{item.warehouseId,jdbcType=BIGINT},#{item.warehouseNo,jdbcType=VARCHAR},#{item.warehouseName,jdbcType=VARCHAR}, - #{item.areaId,jdbcType=BIGINT},#{item.areaNo,jdbcType=VARCHAR},#{item.areaName,jdbcType=VARCHAR}, - #{item.previousBalance,jdbcType=DECIMAL},#{item.currentEnter,jdbcType=DECIMAL},#{item.currentOut,jdbcType=DECIMAL},#{item.currentCheck,jdbcType=DECIMAL},#{item.currentBalance,jdbcType=DECIMAL}, - #{item.remark,jdbcType=VARCHAR},#{item.createBy,jdbcType=BIGINT},#{item.createTime,jdbcType=TIMESTAMP}, - #{item.updateBy,jdbcType=BIGINT},#{item.updateTime,jdbcType=TIMESTAMP}, - - - - - - - - - update wms_inventory_settlement_detail set del_flag=1 - - id in #{it} - - - diff --git a/wms/src/main/resources/mapper/InventorySettlementMapper.xml b/wms/src/main/resources/mapper/InventorySettlementMapper.xml deleted file mode 100644 index 6527bc8..0000000 --- a/wms/src/main/resources/mapper/InventorySettlementMapper.xml +++ /dev/null @@ -1,43 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - select id, inventory_settlement_status, settlement_type, del_flag, remark, create_by, create_time, update_by, update_time, inventory_settlement_no from wms_inventory_settlement - - - - - - update wms_inventory_settlement set del_flag=1 - - id in #{it} - - - diff --git a/wms/src/main/resources/mapper/ItemMapper.xml b/wms/src/main/resources/mapper/ItemMapper.xml deleted file mode 100644 index 00b0fad..0000000 --- a/wms/src/main/resources/mapper/ItemMapper.xml +++ /dev/null @@ -1,64 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - select id, item_no, item_name, item_type, unit, rack_id, area_id, warehouse_id, quantity, expiry_date, del_flag, remark, create_by, create_time, update_by, update_time from wms_item - - - - - - - update wms_item set del_flag=1 - - id in #{it} - - - diff --git a/wms/src/main/resources/mapper/ItemTypeMapper.xml b/wms/src/main/resources/mapper/ItemTypeMapper.xml deleted file mode 100644 index b34b0d2..0000000 --- a/wms/src/main/resources/mapper/ItemTypeMapper.xml +++ /dev/null @@ -1,58 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - select item_type_id, - parent_id, - ancestors, - type_name, - order_num, - status, - del_flag, - create_by, - create_time, - update_by, - update_time - from wms_item_type - - - - - - update wms_item_type set del_flag=1 - - item_type_id in - #{it} - - - diff --git a/wms/src/main/resources/mapper/RackMapper.xml b/wms/src/main/resources/mapper/RackMapper.xml deleted file mode 100644 index bdca07d..0000000 --- a/wms/src/main/resources/mapper/RackMapper.xml +++ /dev/null @@ -1,41 +0,0 @@ - - - - - - - - - - - - - - - - - - - - select id, rack_no, rack_name, area_id, warehouse_id, remark, del_flag, create_by, create_time, update_by, update_time from wms_rack - - - - - - update wms_rack set del_flag=1 - - id in #{it} - - - diff --git a/wms/src/main/resources/mapper/ReceiptOrderDetailMapper.xml b/wms/src/main/resources/mapper/ReceiptOrderDetailMapper.xml deleted file mode 100644 index 449fa3a..0000000 --- a/wms/src/main/resources/mapper/ReceiptOrderDetailMapper.xml +++ /dev/null @@ -1,77 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - select id, receipt_order_id, item_id, plan_quantity, real_quantity, rack_id, del_flag, remark, create_by, create_time, update_by, update_time, warehouse_id, area_id, receipt_order_status from wms_receipt_order_detail - - - - - - update wms_receipt_order_detail set del_flag=1 - - id in #{it} - - - - receipt_order_id, item_id, plan_quantity, real_quantity, rack_id, money, del_flag, remark, create_by, create_time, update_by, update_time, warehouse_id, area_id, receipt_order_status, batch, production_date, expiry_date - - - insert into wms_receipt_order_detail - () - values - - - #{item.receiptOrderId, jdbcType=BIGINT}, #{item.itemId, jdbcType=BIGINT}, #{item.planQuantity, jdbcType=DECIMAL}, #{item.realQuantity, jdbcType=DECIMAL}, #{item.rackId, jdbcType=BIGINT},#{item.money, jdbcType=DECIMAL},#{item.delFlag, jdbcType=TINYINT}, #{item.remark, jdbcType=VARCHAR}, #{item.createBy, jdbcType=BIGINT}, #{item.createTime, jdbcType=DATE}, #{item.updateBy, jdbcType=BIGINT}, #{item.updateTime, jdbcType=DATE}, #{item.warehouseId, jdbcType=BIGINT}, #{item.areaId, jdbcType=BIGINT}, #{item.receiptOrderStatus, jdbcType=TINYINT}, #{item.batch, jdbcType=VARCHAR}, #{item.productionDate, jdbcType=DATE}, #{item.expiryDate, jdbcType=DATE}, - - - - diff --git a/wms/src/main/resources/mapper/ReceiptOrderMapper.xml b/wms/src/main/resources/mapper/ReceiptOrderMapper.xml deleted file mode 100644 index 44e8aa5..0000000 --- a/wms/src/main/resources/mapper/ReceiptOrderMapper.xml +++ /dev/null @@ -1,47 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - select id, receipt_order_no, receipt_order_type, supplier_id, order_no, receipt_order_status, remark, del_flag, create_by, create_time, update_by, update_time from wms_receipt_order - - - - - - update wms_receipt_order set del_flag=1 - - id in #{it} - - - diff --git a/wms/src/main/resources/mapper/ShipmentOrderDetailMapper.xml b/wms/src/main/resources/mapper/ShipmentOrderDetailMapper.xml deleted file mode 100644 index d7d3d5e..0000000 --- a/wms/src/main/resources/mapper/ShipmentOrderDetailMapper.xml +++ /dev/null @@ -1,161 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - select id, - shipment_order_id, - item_id, - plan_quantity, - real_quantity, - rack_id, - del_flag, - remark, - create_by, - create_time, - update_by, - update_time, - warehouse_id, - area_id, - shipment_order_status - from wms_shipment_order_detail - - - - - - update wms_shipment_order_detail - set del_flag=1 - - id in - - #{it} - - - - - - insert into wms_shipment_order_detail - (shipment_order_id, - item_id, - plan_quantity, - real_quantity, - rack_id, - money, - del_flag, - remark, - create_by, - create_time, - update_by, - update_time, - warehouse_id, - area_id, - shipment_order_status, - batch, - production_date, - expiry_date) - values - - - #{item.shipmentOrderId, jdbcType=BIGINT}, #{item.itemId, jdbcType=BIGINT}, - #{item.planQuantity, jdbcType=DECIMAL}, #{item.realQuantity, jdbcType=DECIMAL}, - #{item.rackId, jdbcType=BIGINT},#{item.money, jdbcType=DECIMAL}, #{item.delFlag, jdbcType=TINYINT}, - #{item.remark, jdbcType=VARCHAR}, - #{item.createBy, jdbcType=BIGINT}, #{item.createTime, jdbcType=DATE}, #{item.updateBy, jdbcType=BIGINT}, - #{item.updateTime, jdbcType=DATE}, #{item.warehouseId, jdbcType=BIGINT}, - #{item.areaId, jdbcType=BIGINT}, #{item.shipmentOrderStatus, jdbcType=TINYINT},#{item.batch, jdbcType=VARCHAR}, - #{item.productionDate, jdbcType=DATE}, #{item.expiryDate, jdbcType=DATE} - - - - - - - - - diff --git a/wms/src/main/resources/mapper/ShipmentOrderMapper.xml b/wms/src/main/resources/mapper/ShipmentOrderMapper.xml deleted file mode 100644 index 79fbbe4..0000000 --- a/wms/src/main/resources/mapper/ShipmentOrderMapper.xml +++ /dev/null @@ -1,53 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - select id, shipment_order_no, shipment_order_type, order_no, customer_id, shipment_order_status, check_status, check_user_id, check_time, remark, del_flag, create_by, create_time, update_by, update_time from wms_shipment_order - - - - - - update wms_shipment_order set del_flag=1 - - id in #{it} - - - diff --git a/wms/src/main/resources/mapper/SupplierMapper.xml b/wms/src/main/resources/mapper/SupplierMapper.xml deleted file mode 100644 index 1670dc4..0000000 --- a/wms/src/main/resources/mapper/SupplierMapper.xml +++ /dev/null @@ -1,53 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - select id, supplier_no, supplier_name, address, mobile_no, tel_no, contact, level, email, remark, del_flag, create_by, create_time, update_by, update_time from wms_supplier - - - - - - update wms_supplier set del_flag=1 - - id in #{it} - - - diff --git a/wms/src/main/resources/mapper/SupplierTransactionMapper.xml b/wms/src/main/resources/mapper/SupplierTransactionMapper.xml deleted file mode 100644 index 01c86f2..0000000 --- a/wms/src/main/resources/mapper/SupplierTransactionMapper.xml +++ /dev/null @@ -1,49 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - select id, transaction_code, supplier_id, transaction_type, transaction_amount, previous_balance, current_balance, receipt_order_id, remark, del_flag, create_time, update_time from wms_supplier_transaction - - - - - - - - update wms_supplier_transaction set del_flag=1 - - id in #{it} - - - - - diff --git a/wms/src/main/resources/mapper/WarehouseMapper.xml b/wms/src/main/resources/mapper/WarehouseMapper.xml deleted file mode 100644 index ed830be..0000000 --- a/wms/src/main/resources/mapper/WarehouseMapper.xml +++ /dev/null @@ -1,41 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - select id, warehouse_no, warehouse_name, del_flag, remark, create_by, create_time, update_by, update_time from wms_warehouse - - - - - - update wms_warehouse set del_flag=1 - - id in #{it} - - - diff --git a/wms/src/main/resources/mapper/WaveMapper.xml b/wms/src/main/resources/mapper/WaveMapper.xml deleted file mode 100644 index 6ee8651..0000000 --- a/wms/src/main/resources/mapper/WaveMapper.xml +++ /dev/null @@ -1,41 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - select id, wave_no, status, remark, del_flag, create_by, create_time, update_by, update_time from wms_wave - - - - - - update wms_wave set del_flag=1 - - id in #{it} - - - diff --git a/wms/src/test/java/com/cyl/wms/WmsApplicationTests.java b/wms/src/test/java/com/cyl/wms/WmsApplicationTests.java deleted file mode 100644 index 35cb4c6..0000000 --- a/wms/src/test/java/com/cyl/wms/WmsApplicationTests.java +++ /dev/null @@ -1,13 +0,0 @@ -package com.cyl.wms; - -import org.junit.jupiter.api.Test; -import org.springframework.boot.test.context.SpringBootTest; - -@SpringBootTest -class WmsApplicationTests { - - @Test - void contextLoads() { - } - -}